From 0e394ed580b09329ecaa8476bbb6334f8212b009 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周四, 25 4月 2024 13:40:31 +0800 Subject: [PATCH] Merge branch 'master' of http://222.71.245.114:9086/r/iWare_RawMaterialWarehouse --- iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue | 138 ++++++++++++++++++++++++++++++++-------------- 1 files changed, 96 insertions(+), 42 deletions(-) diff --git a/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue b/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue index b8f8f15..717475c 100644 --- a/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue +++ b/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue @@ -1,13 +1,12 @@ <template> - <a-modal title="鏂板鍩虹鐗╂枡淇℃伅" :width="900" :visible="visible" :confirmLoading="confirmLoading" @ok="handleSubmit" + <a-modal :title="title" :width="1200" :visible="visible" :confirmLoading="confirmLoading" @ok="handleSubmit" @cancel="handleCancel"> <a-spin :spinning="confirmLoading"> <!-- tab --> <a-tabs default-active-key="1" @change="callbacktab"> <a-tab-pane key="1" tab="鍩烘湰淇℃伅"> <!-- <add-form ref="addFormRef" @ok="handleOk" /> --> - - <!-- 鍩烘湰淇℃伅 --> + <!-- 鍩烘湰淇℃伅 layout="inline" layout="vertical" --> <a-form :form="form"> <a-form-item label="鐗╂枡鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="璇疯緭鍏ョ墿鏂欏悕绉�" @@ -35,12 +34,6 @@ </a-select> </a-form-item> - <!-- <a-col :md="8" :sm="24"> - - </a-col> --> - - - <a-form-item label="鐗╂枡缁�" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="璇疯緭鍏ョ墿鏂欑粍" v-decorator="['materialGroup']" /> </a-form-item> @@ -48,7 +41,15 @@ <a-input placeholder="璇疯緭鍏BC鍒嗙被鍚嶇О" v-decorator="['aBCClassName']" /> </a-form-item> --> <a-form-item label="ABC鍒嗙被" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> - <a-input-number placeholder="璇疯緭鍏BC鍒嗙被" style="width: 100%" v-decorator="['aBCClass']" /> + <!-- <a-input-number placeholder="璇疯緭鍏BC鍒嗙被" style="width: 100%" v-decorator="['aBCClass']" /> --> + + <a-select style="width: 100%" placeholder="璇烽�夋嫨ABC鍒嗙被" v-decorator="['factoryCode']"> + <a-select-option v-for="(item, index) in materialTypeData2" :key="index" :value="Number(item.code)">{{ + item.name }}</a-select-option> + </a-select> + + + </a-form-item> <a-form-item label="鐗╂枡瑙勬牸" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="璇疯緭鍏ョ墿鏂欒鏍�" v-decorator="['materialSpec']" /> @@ -57,10 +58,24 @@ <a-input placeholder="璇疯緭鍏ラ粯璁ゅ叆搴撳簱浣�" v-decorator="['inPlaceCode']" /> </a-form-item> <a-form-item label="搴撳瓨鍗曚綅" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> - <a-input placeholder="璇疯緭鍏ュ簱瀛樺崟浣�" v-decorator="['materialUnit']" /> + <!-- <a-input placeholder="璇疯緭鍏ュ簱瀛樺崟浣�" v-decorator="['materialUnit']" /> --> + + <a-select style="width: 100%" placeholder="璇烽�夋嫨搴撳瓨鍗曚綅" v-decorator="['materialUnit']"> + <a-select-option v-for="(item, index) in selectTypeData1" :key="index" :value="Number(item.unitCode)">{{ + item.unitName }}</a-select-option> + </a-select> + + </a-form-item> <a-form-item label="閲囪喘鍗曚綅" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> - <a-input placeholder="璇疯緭鍏ラ噰璐崟浣�" v-decorator="['pOUnit']" /> + <!-- <a-input placeholder="璇疯緭鍏ラ噰璐崟浣�" v-decorator="['pOUnit']" /> --> + + <a-select style="width: 100%" placeholder="璇烽�夋嫨閲囪喘鍗曚綅" v-decorator="['pOUnit']"> + <a-select-option v-for="(item, index) in selectTypeData2" :key="index" :value="Number(item.unitCode)">{{ + item.unitName }}</a-select-option> + </a-select> + + </a-form-item> <a-form-item label="棰滆壊" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="璇疯緭鍏ラ鑹�" v-decorator="['color']" /> @@ -89,16 +104,16 @@ </a-form> </a-tab-pane> <a-tab-pane key="2" tab="鎺у埗灞炴��" force-render> - <add-control-rule ref="WmsControlRule" /> + <add-control-rule v-if="visible" ref="WmsControlRule" /> </a-tab-pane> <a-tab-pane key="3" tab="鎵规灞炴��"> 闇�姹傚緟瀹� </a-tab-pane> <a-tab-pane key="4" tab="鏇夸唬鍝佺鐞�"> - <add-form-sub ref="addFormWmsSubstituteGoodRef" /> + <add-form-sub v-if="visible" ref="addFormWmsSubstituteGoodRef" /> </a-tab-pane> <a-tab-pane key="5" tab="瀹㈡埛"> - <add-form-base-customer ref="addFormBaseCustomer" /> + <add-form-base-customer v-if="visible" ref="addFormBaseCustomer" /> </a-tab-pane> <!-- <a-tab-pane key="6" tab="鍖呰鍏崇郴"> @@ -116,7 +131,7 @@ import addFormContainerPackaging from './tabItem/WmsContainerPackaging/addFormContainerPackaging.vue' import addFormSub from './tabItem/WmsSubstituteGood/addFormWmsSubstituteGood.vue' import addControlRule from './tabItem/WmsControlRule/addForm.vue' - +import { WmsUnitPage, WmsUnitDelete, WmsUnitToExcel } from '@/api/modular/main/WmsBase/WmsUnitManage' export default { components: { addForm, @@ -127,9 +142,12 @@ }, created() { this.materialTypeDataList() + const materialTypeOption = this.$options + this.materialTypeData2 = materialTypeOption.filters['dictData']('abc_class_type') }, data() { return { + title: '', labelCol: { // xs: { span: 24 }, // sm: { span: 5 } @@ -146,46 +164,67 @@ stationNameParameterData: [], visible: false, confirmLoading: false, - form: this.$form.createForm(this) + form: this.$form.createForm(this), + materialTypeData2:[] } }, methods: { + // 鐗╂枡绫诲瀷 materialTypeDataList() { materialTypeDataList().then((d) => { this.materialTypeData = d.data || [] }).catch(() => { }) + // 搴撳瓨鍗曚綅 + WmsUnitPage().then((d) => { + this.selectTypeData1 = d.data.rows || [] + }).catch(() => { + + }) + + // 閲囪喘鍗曚綅 + WmsUnitPage().then((d) => { + this.selectTypeData2 = d.data.rows || [] + }).catch(() => { + + }) + }, callbacktab(e) { //鍖呰鍏崇郴 - if (e == 6) { - this.$nextTick(() => { - let materialType = this.form.getFieldValue('materialType'); - // 璋冩帴鍙� 浼犵墿鏂欑被鍨� - this.$refs.addFormContainerPackagingRef.initShow(materialType) - - }) - } + // if (e == 6) { + // this.$nextTick(() => { + // let materialType = this.form.getFieldValue('materialType'); + // // 璋冩帴鍙� 浼犵墿鏂欑被鍨� + // this.$refs.addFormContainerPackagingRef.initShow(materialType) + // }) + // } // 鏇夸唬鍝� if (e == 4) { - let materialCode = this.form.getFieldValue('materialCode'); - let materialName = this.form.getFieldValue('materialName'); - this.$refs.addFormWmsSubstituteGoodRef.initShow(materialCode, materialName) + // let materialCode = this.form.getFieldValue('materialCode'); + // let materialName = this.form.getFieldValue('materialName'); + this.$refs.addFormWmsSubstituteGoodRef.initShowSubstituteGood() } }, handleOk() { }, // 鍒濆鍖栨柟娉� add(record) { + + this.visible = true - this.$nextTick(() => { - this.getSelects() - }) - // const materialTypeOption = this.$options - // this.materialTypeData = materialTypeOption.filters['dictData']('material_type') - const inspectionMethodOption = this.$options - this.inspectionMethodData = inspectionMethodOption.filters['dictData']('material_inspection') + if (record) {//缂栬緫 + this.title = '缂栬緫鍩虹鐗╂枡淇℃伅'; + this.$nextTick(() => { + this.form.setFieldsValue({ + ...record + }) + }) + + } else { // 鏂板 + this.title = '鏂板鍩虹鐗╂枡淇℃伅'; + } }, getSelects() { if (this.areaNameParameterData.length <= 0 || this.stationNameParameterData.length <= 0) { @@ -208,7 +247,7 @@ const { form: { validateFields } } = this - + validateFields((errors, values) => { if (!errors) { // if (this.$getObjectType(values.areas) === 'array') { @@ -227,21 +266,25 @@ // } console.log(6666666666666 + '鎺у埗灞炴��') - var ControlRuleld = this.$refs.WmsControlRule.form.getFieldValue('id') || '' let SubstituteGoodList = [] - if(this.$refs.addFormWmsSubstituteGoodRef && this.$refs.addFormWmsSubstituteGoodRef.list.length>0){ + if (this.$refs.addFormWmsSubstituteGoodRef && this.$refs.addFormWmsSubstituteGoodRef.list.length > 0) { SubstituteGoodList = this.$refs.addFormWmsSubstituteGoodRef.list + SubstituteGoodList.forEach(item => { + item.materialName = this.form.getFieldValue('materialName') + item.materialCode = this.form.getFieldValue('materialCode') + }) } console.log(6666666666666 + '鏇夸唬鍝�') let BaseCustomerList = []; - if(this.$refs.addFormBaseCustomer && this.$refs.addFormBaseCustomer.list.length>0){ - BaseCustomerList = this.$refs.addFormWmsSubstituteGoodRef.list + if (this.$refs.addFormBaseCustomer && this.$refs.addFormBaseCustomer.list.length > 0) { + BaseCustomerList = this.$refs.addFormBaseCustomer.list + } - console.log(6666666666666 + '瀹㈡埛妗f闆嗗悎') + console.log(6666666666666 + '寰�鏉ュ叧绯婚泦鍚�') // console.log(6666666666666 + '鍖呰鍏崇郴') // console.log(this.$refs.addFormContainerPackagingRef.list) @@ -250,7 +293,7 @@ MaterialInput: values, ControlRuleld: ControlRuleld, //鎺у埗灞炴�� SubstituteGoodList: SubstituteGoodList, //鏇夸唬鍝� - BaseCustomerList: BaseCustomerList, //瀹㈡埛妗f闆嗗悎 + BaseCustomerList: BaseCustomerList, //寰�鏉ュ叧绯婚泦鍚� // ContainerPackagingList: this.$refs.addFormContainerPackagingRef.list //鍖呰鍏崇郴 } this.confirmLoading = true @@ -286,7 +329,18 @@ handleCancel() { this.form.resetFields() this.visible = false + // this.$refs.WmsControlRule.form.resetFields() + // this.$refs.addFormWmsSubstituteGoodRef.list =[] + // this.$refs.addFormWmsSubstituteGoodRef.list =[] + } } } </script> + +<style lang="less" scoped> +.ant-row.ant-form-item { + width: 50% !important; + display: inline-block; +} +</style> -- Gitblit v1.9.3