From 6cc226dbf5626b27dd179984bc9dd977225fd21e Mon Sep 17 00:00:00 2001 From: liuying <1427574514@qq.com> Date: 周四, 25 4月 2024 14:49:01 +0800 Subject: [PATCH] bug --- iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue | 128 +++++++++++++++++++++++++++++++----------- 1 files changed, 93 insertions(+), 35 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 2749b69..420db3b 100644 --- a/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue +++ b/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue @@ -1,5 +1,5 @@ <template> - <a-modal title="鏂板鍩虹鐗╂枡淇℃伅" :width="1200" :visible="visible" :confirmLoading="confirmLoading" @ok="handleSubmit" + <a-modal :title="title" :width="1300" :visible="visible" :confirmLoading="confirmLoading" @ok="handleSubmit" @cancel="handleCancel"> <a-spin :spinning="confirmLoading"> <!-- tab --> @@ -30,7 +30,7 @@ <a-form-item label="鐗╂枡绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-select style="width: 100%" placeholder="璇烽�夋嫨鐗╂枡绫诲瀷" v-decorator="['materialType']"> <a-select-option v-for="(item, index) in materialTypeData" :key="index" - :value="Number(item.materialTypeCode)">{{ item.materialTypeName }}</a-select-option> + :value="item.materialTypeCode">{{ item.materialTypeName }}</a-select-option> </a-select> </a-form-item> @@ -43,7 +43,7 @@ <a-form-item label="ABC鍒嗙被" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <!-- <a-input-number placeholder="璇疯緭鍏BC鍒嗙被" style="width: 100%" v-decorator="['aBCClass']" /> --> - <a-select style="width: 100%" placeholder="璇烽�夋嫨ABC鍒嗙被" v-decorator="['factoryCode']"> + <a-select style="width: 100%" placeholder="璇烽�夋嫨ABC鍒嗙被" v-decorator="['aBCClass']"> <a-select-option v-for="(item, index) in materialTypeData2" :key="index" :value="Number(item.code)">{{ item.name }}</a-select-option> </a-select> @@ -61,7 +61,7 @@ <!-- <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)">{{ + <a-select-option v-for="(item, index) in selectTypeData1" :key="index" :value="item.unitCode">{{ item.unitName }}</a-select-option> </a-select> @@ -71,7 +71,7 @@ <!-- <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)">{{ + <a-select-option v-for="(item, index) in selectTypeData2" :key="index" :value="item.unitCode">{{ item.unitName }}</a-select-option> </a-select> @@ -125,13 +125,16 @@ </template> <script> -import { WmsMaterialAdd, GetAreas, GetStations, materialTypeDataList } from '@/api/modular/main/WmsMaterialManage' + +import { + WmsMaterialAdd, WmsMaterialEdit, WmsMaterialDetailList,materialTypeDataList +} from '@/api/modular/main/WmsBase/WmsMaterialManage' import addForm from './tabItem/addForm.vue' import addFormBaseCustomer from './tabItem/addFormBaseCustomer/addFormBaseCustomer.vue' 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' +import { WmsUnitPage} from '@/api/modular/main/WmsBase/WmsUnitManage' export default { components: { addForm, @@ -142,9 +145,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 } @@ -161,7 +167,10 @@ stationNameParameterData: [], visible: false, confirmLoading: false, - form: this.$form.createForm(this) + form: this.$form.createForm(this), + materialTypeData2: [], + selectTypeData2:[], + selectTypeData1:[] } }, methods: { @@ -199,22 +208,53 @@ // } // 鏇夸唬鍝� if (e == 4) { + this.$nextTick(() => { // let materialCode = this.form.getFieldValue('materialCode'); // let materialName = this.form.getFieldValue('materialName'); this.$refs.addFormWmsSubstituteGoodRef.initShowSubstituteGood() + }) } }, handleOk() { }, // 鍒濆鍖栨柟娉� - add(record) { + add(record, type) { this.visible = true - // this.$nextTick(() => { - // // this.getSelects() - // }) - const materialTypeOption = this.$options - this.materialTypeData2 = materialTypeOption.filters['dictData']('abc_class') - // const inspectionMethodOption = this.$options - // this.inspectionMethodData = inspectionMethodOption.filters['dictData']('material_inspection') + if (record) {//缂栬緫 + if (type == '璇︽儏') { + this.title = '璇︽儏鐗╂枡淇℃伅璇︽儏';// 璇︽儏 + } else { + this.title = '缂栬緫鍩虹鐗╂枡淇℃伅'; + } + this.$nextTick(() => { + this.form.setFieldsValue({ + ...record + }) + }) + WmsMaterialDetailList({ + id: record.id + }) + .then(res => { + if (res.success) { + console.log("666666666666") + console.log(res) + this.$refs.WmsControlRule.list = res.data.baseCustomerList || [] + this.$refs.addFormBaseCustomer.list = res.data.controlRuleDetailList || [] + this.$refs.addFormWmsSubstituteGoodRef.list = res.data.substituteGoodList || [] + // this.$message.success('缂栬緫鎴愬姛') + // this.confirmLoading = false + // this.$emit('ok', values) + // this.handleCancel() + } else { + this.$message.error('璇︽儏澶辫触锛�' + JSON.stringify(res.message)) + } + }) + .finally(res => { + this.confirmLoading = false + }) + + } else { + this.title = '鏂板鍩虹鐗╂枡淇℃伅';// 鏂板 + } }, getSelects() { if (this.areaNameParameterData.length <= 0 || this.stationNameParameterData.length <= 0) { @@ -274,7 +314,7 @@ BaseCustomerList = this.$refs.addFormBaseCustomer.list } - console.log(6666666666666 + '瀹㈡埛妗f闆嗗悎') + console.log(6666666666666 + '寰�鏉ュ叧绯婚泦鍚�') // console.log(6666666666666 + '鍖呰鍏崇郴') // console.log(this.$refs.addFormContainerPackagingRef.list) @@ -283,24 +323,42 @@ MaterialInput: values, ControlRuleld: ControlRuleld, //鎺у埗灞炴�� SubstituteGoodList: SubstituteGoodList, //鏇夸唬鍝� - BaseCustomerList: BaseCustomerList, //瀹㈡埛妗f闆嗗悎 + BaseCustomerList: BaseCustomerList, //寰�鏉ュ叧绯婚泦鍚� // ContainerPackagingList: this.$refs.addFormContainerPackagingRef.list //鍖呰鍏崇郴 } this.confirmLoading = true - WmsMaterialAdd(param) - .then(res => { - if (res.success) { - this.$message.success('鏂板鎴愬姛') + if (this.title == '鏂板鍩虹鐗╂枡淇℃伅') { + WmsMaterialAdd(param) + .then(res => { + if (res.success) { + this.$message.success('鏂板鎴愬姛') + this.confirmLoading = false + this.$emit('ok', values) + this.handleCancel() + } else { + this.$message.error('鏂板澶辫触锛�' + JSON.stringify(res.message)) + } + }) + .finally(res => { this.confirmLoading = false - this.$emit('ok', values) - this.handleCancel() - } else { - this.$message.error('鏂板澶辫触锛�' + JSON.stringify(res.message)) - } - }) - .finally(res => { - this.confirmLoading = false - }) + }) + } else { + WmsMaterialEdit(param) + .then(res => { + if (res.success) { + this.$message.success('缂栬緫鎴愬姛') + this.confirmLoading = false + this.$emit('ok', values) + this.handleCancel() + } else { + this.$message.error('缂栬緫澶辫触锛�' + JSON.stringify(res.message)) + } + }) + .finally(res => { + this.confirmLoading = false + }) + } + } else { this.confirmLoading = false } @@ -329,8 +387,8 @@ </script> <style lang="less" scoped> - .ant-row.ant-form-item { - width: 50% !important; - display: inline-block; - } +.ant-row.ant-form-item { + width: 50% !important; + display: inline-block; +} </style> -- Gitblit v1.9.3