From 34feb4908ec7b7e5b51adf6355603978c67bd3a4 Mon Sep 17 00:00:00 2001 From: cuijian <cuijian@xalxzn.com> Date: 星期四, 05 六月 2025 09:53:14 +0800 Subject: [PATCH] 申请单入库 --- src/views/tms/modules/inbound/InboundModel.vue | 201 ++++++++++++++++--------------------------------- 1 files changed, 67 insertions(+), 134 deletions(-) diff --git a/src/views/tms/modules/inbound/InboundModel.vue b/src/views/tms/modules/inbound/InboundModel.vue index 5692855..7548919 100644 --- a/src/views/tms/modules/inbound/InboundModel.vue +++ b/src/views/tms/modules/inbound/InboundModel.vue @@ -8,33 +8,45 @@ @cancel="handleCancel" > <a-spin :spinning="confirmLoading"> - <a-form :form="form"> + <a-form-model ref="form" :model="model" :rules="validatorRules"> <a-row style="width: 100%"> <a-col :span="24 / 2"> - <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鍏ュ簱绫诲瀷"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="宸ュ叿鍒嗙被缂栧彿"> + <a-input v-model="model.classifyNum" placeholder="璇疯緭鍏ュ伐鍏峰垎绫荤紪鐮�" :disabled="true"></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="宸ュ叿鍒嗙被鍚嶇О"> + <a-input v-model="model.typeName" placeholder="璇疯緭鍏ュ伐鍏峰垎绫诲悕绉�" :disabled="true"></a-input> + </a-form-model-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鍏ュ簱绫诲瀷" prop="inStorehouseType"> <j-dict-select-tag :disabled="disableSubmit" type="list" - v-decorator="['inStorehouseType', validatorRules.inStorehouseType]" + v-model="model.inStorehouseType" :triggerChange="true" dictCode="in_storehouse_type" placeholder="璇烽�夋嫨鍏ュ簱绫诲瀷" @change="handleTypeChange" /> - </a-form-item> + </a-form-model-item> </a-col> <a-col :span="24 / 2"> - <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鍏ュ簱鏃堕棿"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鍏ュ簱鏃堕棿" prop="inboundTime"> <a-date-picker @change="onChange" :disabled="disableSubmit" style="width: 100%" - v-decorator="['inboundTime', validatorRules.inboundTime]" + v-model="model.inboundTime" /> - </a-form-item> + </a-form-model-item> </a-col> </a-row> - </a-form> + </a-form-model> </a-spin> <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectReturnList()" v-show="returnShow && !disableSubmit">閫夋嫨鍊熷嚭宸ュ叿</a-button> <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()" v-show="toolingShow && !disableSubmit">閫夋嫨宸ュ叿</a-button> @@ -54,9 +66,9 @@ <div :key="col.dataIndex"> <a-input-number v-if="col.dataIndex == 'inStorageQuantity'" - :disabled="quantityDisable" + :disabled="record.accuracyClass == '1'" :value="text" - @change="(e) => handleChange(e, record.key, col, index)" + @change="(e) => handleChange(e, record, col, index)" :min="1" /> </div> @@ -75,9 +87,9 @@ <template slot="footer" v-if="disableSubmit == true"> <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> </template> - <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal> - <j-select-return-list-modal ref="returnModalForm" @ok="modalFormOk"></j-select-return-list-modal> - <j-select-sharpen-list-modal ref="sharpenModalForm" @ok="modalFormOk"></j-select-sharpen-list-modal> + <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk" :classifyId="classifyId"></j-select-tooling-modal> + <j-select-return-list-modal ref="returnModalForm" @ok="modalFormOk" :classifyId="classifyId"></j-select-return-list-modal> + <j-select-sharpen-list-modal ref="sharpenModalForm" @ok="modalFormOk" :classifyId="classifyId"></j-select-sharpen-list-modal> </a-modal> </template> @@ -95,7 +107,7 @@ import JSelectSharpenListModal from '.././inboundOrder/JSelectSharpenListModal' export default { - name: 'InboundOrderModel', + name: 'InboundModel', components: { JSelectToolingModal, JMultiSelectTag, @@ -118,6 +130,7 @@ showSizeChanger: true, total: 0 }, + form: this.$form.createForm(this), isDisabled: false, selectedRowKeys: {}, state: { @@ -127,18 +140,11 @@ maintenanceState: false, checkState: false, }, - inboundDate: '', - applicationDate: '', - supplierShow: false, disableSubmit: false, - numDisable:false, quantityDisable:false, - onlyCodeDisable:true, returnShow:false, toolingShow:false, sharpenShow:false, - addDisable:false, - toolinngOptions:[], title: '鎿嶄綔', visible: false, model: {}, @@ -152,32 +158,22 @@ }, confirmLoading: false, loading: false, - form: this.$form.createForm(this), dataSource: [], - toolingTreeData:[], - warehouseOptions:[], - locationOptions:[], - allToolingList:[], param: {}, - barcodeCurrentType: false, inboundOrderId:'', validatorRules: { - inStorehouseType: { - rules: [ + inStorehouseType: [ { required: true, message: '璇烽�夋嫨鍏ュ簱绫诲瀷!', }, ], - }, - inboundTime: { - rules: [ + inboundTime:[ { required: true, message: '璇烽�夋嫨鐢宠鍏ュ簱鏃ユ湡!', }, ], - }, }, url: { addInStorage: '/tms/inboundOrder/addInStorage', @@ -186,7 +182,6 @@ queryReturnList:'/tms/toolLedgerDetail/list', detailList:'/tms/inboundDetail/list', }, - toolingOptions:[], columns: [ { title: '#', @@ -220,6 +215,12 @@ dataIndex: 'toolModel' }, { + title: '鍞竴缂栫爜', + align: 'center', + dataIndex: 'onlyCode', + width: 150, + }, + { title: '鍏ュ簱鏁伴噺', align: 'center', dataIndex: 'inStorageQuantity', @@ -232,9 +233,13 @@ scopedSlots: { customRender: 'action' }, }, ], + classifyId:'' } }, - created() {}, + created() { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, methods: { modalFormOk() { }, @@ -243,56 +248,42 @@ this.param.pageSize = this.ipagination.pageSize return filterObj(this.param) }, - add() { - this.edit({}) + add (nodeSelected) { + this.classifyId = nodeSelected.key + this.model.classifyNum = nodeSelected.entity.classifyId + this.model.typeName = nodeSelected.entity.typeName + this.dataSource = [] + this.visible = true; }, - edit(record) { - let that = this - this.form.resetFields() - this.model = Object.assign({}, record) - this.visible = true - this.isDisabled = false - this.disableSubmit = false - if (record.id) { - if(record.inStorehouseType == "1"){ - this.toolingShow = true - }else if(record.inStorehouseType == "2"){ - this.returnShow = true - }else if(record.inStorehouseType == "5"){ - this.sharpenShow = true - } - this.inboundOrderId = record.id - this.detailList(this.inboundOrderId) - } - this.initOptions() - this.$nextTick(() => { - this.form.setFieldsValue( - pick(this.model, 'inboundNum', 'inStorehouseType', 'inboundTime', 'applicationReason', 'handler','approvalDate','reviewer','approvalOpinion','remark') - ) - }) - }, - handleChange(value, key, column, index) { + handleChange(value, record, column, index) { //let t = (this.ipaginationm.current - 1) * this.ipaginationm.pageSize + index + let key = record.key const temp = [...this.dataSource] const target = temp.filter(item => key === item.key)[index]; if (target) { target[column.dataIndex] = value - this.dataSource = temp + + if(column.dataIndex === 'inStorageQuantity'){ + if(target['quantity']<value){ + this.$message.error('鍏ュ簱鏁伴噺涓嶈兘澶т簬鍑哄簱鏁伴噺!') + this.isDisabled = true + }else{ + this.isDisabled = false + } + } + this.dataSource = temp } }, close() { this.$emit('close') this.dataSource = [] + this.model = {}, this.visible = false - this.supplierShow = false, this.disableSubmit = false, - this.numDisable = false, this.quantityDisable = false, - this.onlyCodeDisable = true, this.returnShow = false, this.toolingShow = false, - this.sharpenShow = false, - this.addDisable = false + this.sharpenShow = false }, handleTableChange(pagination, filters, sorter) { this.ipagination = pagination @@ -306,6 +297,7 @@ that.confirmLoading = true let formData = Object.assign(this.model, values) formData.detailData = this.dataSource + formData.classifyId = this.classifyId postAction(this.url.addInStorage, formData) .then((res) => { if (res.success) { @@ -329,7 +321,7 @@ selectTooling: function () { let ids = [] for (let i = 0; i < this.dataSource.length; i++) { - ids.push(this.dataSource[i].toolCodeId) + ids.push(this.dataSource[i].id) } this.$refs.toolingModalForm.showModal(ids) this.$refs.toolingModalForm.title = '閫夋嫨宸ュ叿' @@ -359,44 +351,22 @@ this.dataSource.splice(index, 1) }, onChange() {}, - //鎺у埗鎵爜鎴栨墜閫� - selectCurrentUserType(e) { - if (e == '0') { - this.barcodeCurrentType = true - } else { - this.barcodeCurrentType = false - } - }, - //鎵嬮�変汉鍛樺�� - selectCurrentUserChange(e) { - console.log('褰撳墠鎵嬮��', e) - // this.form.setFieldsValue({ - // // userName: e, - // userNameId: e, - // }) - }, //鍏ュ簱绫诲瀷 handleTypeChange(value) { this.dataSource = [] if(value == 1){ this.toolingShow = true this.quantityDisable = false - this.addDisable = true - this.numDisable = false }else{ this.toolingShow = false } if(value == 2){ - this.numDisable = true - this.addDisable = false this.returnShow = true this.quantityDisable = true }else{ this.returnShow = false } if (value == 5) { - this.numDisable = true - this.addDisable = false this.sharpenShow = true this.quantityDisable = true } else { @@ -404,52 +374,12 @@ } }, - //娣诲姞宸ュ叿鎸夐挳 - addTooling() { - const temp = [...this.dataSource]; - temp.push({ indexId: temp.length + 1 }); - this.dataSource = temp; - }, detailList(inboundOrderId) { this.param.inboundOrderId = inboundOrderId getAction(this.url.detailList, this.getQueryParams()).then((res) => { if (res.success) { this.dataSource = res.result.records this.ipagination.total = res.result.total; - } - }) - }, - initOptions() { - - ajaxGetDictItems("mes_base_warehouse,name,id,del_flag!='1' order by num asc", null).then((res) => { - if (res.success) { - if (res.result) { - for (let i = 0; i < res.result.length; i++) { - res.result[i].label = res.result[i].title; - } - } - this.warehouseOptions = res.result; - } - }) - ajaxGetDictItems("mes_base_storage_area,name,id,del_flag!='1'", null).then((res) => { - if (res.success) { - if (res.result) { - for (let i = 0; i < res.result.length; i++) { - res.result[i].label = res.result[i].title; - } - } - this.locationOptions = res.result; - } - }) - ajaxGetDictItems("mes_base_tooling,num,id,del_flag!='1'", null).then((res) => { - if (res.success) { - if (res.result) { - for (let i = 0; i < res.result.length; i++) { - res.result[i].label = res.result[i].title; - res.result[i].toolingName = res.result[i].name - } - } - this.toolingOptions = res.result; } }) }, @@ -465,13 +395,16 @@ //getCurrSelected 浜嬩欢 鎺ユ敹缁勪欢浼犻�掔殑鍙傛暟 for (let i = 0; i < data.length; i++) { this.dataSource.push({ - toolCodeId:data[i].id, + id: data[i].id, + toolCodeId: data[i].toolCodeId, toolCode: data[i].toolCode, chineseName: data[i].chineseName, toolModel: data[i].toolModel, applicationType: data[i].applicationTypeName, onlyCode:data[i].onlyCode, - inStorageQuantity:data[i].storageQuantity + inStorageQuantity:data[i].storageQuantity || data[i].quantity, + quantity:data[i].quantity, + accuracyClass:data[i].accuracyClass }) } //this.ipaginationm.total = this.dataSource.length -- Gitblit v1.9.3