From a674e9834bec0ce5a18b751c7434323cc7199ce5 Mon Sep 17 00:00:00 2001 From: lixiangyu <lixiangyu@xalxzn.com> Date: 星期四, 11 九月 2025 17:57:34 +0800 Subject: [PATCH] feat(cms): CuttingReceiveDetailList.vue刀具领用功能中新增领用单提交功能 CuttingReceiveList.vue 刀具领用 提交按钮的前端样式和刀具领用归还按钮的前端样式 --- src/views/cms/modules/CuttingReceiveModal.vue | 753 ++++++++++++++++++++++++++++----------------------------- 1 files changed, 375 insertions(+), 378 deletions(-) diff --git a/src/views/cms/modules/CuttingReceiveModal.vue b/src/views/cms/modules/CuttingReceiveModal.vue index 75531e4..804ed5f 100644 --- a/src/views/cms/modules/CuttingReceiveModal.vue +++ b/src/views/cms/modules/CuttingReceiveModal.vue @@ -1,165 +1,165 @@ <template> - <a-modal :title="title" :visible="visible" :fullScreen="true" :width="1200" @ok="handleOk" @cancel="handleCancel"> - <a-spin :spinning="confirmLoading"> - <a-form :form="form"> - <a-row style="width: 100%"> - <a-col :span="24 / 2"> - <a-form-item label="棰嗙敤浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <j-search-select-tag - :disabled="disableSubmit" - placeholder="璇烽�夋嫨棰嗙敤浜�" - v-decorator="['receiver', { rules: [{ required: true, message: '璇烽�夋嫨棰嗙敤浜�' }] }]" - dict="sys_user,realname,id,del_flag=0" - /> - </a-form-item> - </a-col> - <a-col :span="24 / 2"> - <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="棰嗙敤鏃ユ湡"> - <a-date-picker - :disabled="disableSubmit" - style="width: 100%" - v-decorator="['receiveTime', validatorRules.receiveTime]" - /> - </a-form-item> - </a-col> - </a-row> - <a-row style="width: 100%"> - <a-col :span="24"> - <a-form-item label="棰嗙敤璇存槑" :labelCol="{span:3}" :wrapperCol="{span:21}"> - <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ラ鐢ㄨ鏄�" - v-decorator="['receiveComment', validatorRules.receiveComment]" /> - </a-form-item> - </a-col> - </a-row> - <a-row style="width: 100%"> - <a-col :span="24 / 2"> - <a-form-item label="纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <j-search-select-tag - :disabled="disableSubmit" - placeholder="璇烽�夋嫨纭浜�" - v-decorator="['confirmer', { rules: [{ required: false, message: '璇烽�夋嫨纭浜�' }] }]" - dict="sys_user,realname,id,del_flag=0" - /> - </a-form-item> - </a-col> - <a-col :span="24 / 2"> - <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="纭鏃ユ湡"> - <a-date-picker - :disabled="disableSubmit" - style="width: 100%" - v-decorator="['confirmTime', validatorRules.confirmTime]" - /> - </a-form-item> - </a-col> - </a-row> - <a-row style="width: 100%"> - <a-col :span="24"> - <a-form-item label="纭鎰忚" :labelCol="{span:3}" :wrapperCol="{span:21}"> - <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" - v-decorator="['confirmComment', validatorRules.confirmComment]" /> - </a-form-item> - </a-col> - </a-row> - <a-row style="width: 100%"> - <a-col :span="24 / 2"> - <a-form-item label="鏄惁浼氬綊杩�" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-input :disabled="disableSubmit" placeholder="璇疯緭鍏ユ槸鍚︿細褰掕繕" - v-decorator="['returnFlag', validatorRules.returnFlag]"></a-input> - </a-form-item> - </a-col> - <a-col :span="24 / 2"> - <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="褰掕繕鏃ユ湡"> - <a-date-picker - :disabled="disableSubmit" - style="width: 100%" - v-decorator="['returnTime', validatorRules.returnTime]" - /> - </a-form-item> - </a-col> - </a-row> - <a-row style="width: 100%"> - <a-col :span="24"> - <a-form-item label="褰掕繕璇存槑" :labelCol="{span:3}" :wrapperCol="{span:21}"> - <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ュ綊杩樿鏄�" - v-decorator="['returnComment', validatorRules.returnComment]" /> - </a-form-item> - </a-col> - </a-row> - <a-row style="width: 100%"> - <a-col :span="24 / 2"> - <a-form-item label="褰掕繕纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <j-search-select-tag - :disabled="disableSubmit" - placeholder="璇烽�夋嫨褰掕繕纭浜�" - v-decorator="['returnConfirmer', { rules: [{ required: false, message: '璇烽�夋嫨褰掕繕纭浜�' }] }]" - dict="sys_user,realname,id,del_flag=0" - /> - </a-form-item> - </a-col> - <a-col :span="24 / 2"> - <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="褰掕繕纭鏃ユ湡"> - <a-date-picker - :disabled="disableSubmit" - style="width: 100%" - v-decorator="['returnConfirmTime', validatorRules.returnConfirmTime]" - /> - </a-form-item> - </a-col> - </a-row> - <a-row style="width: 100%"> - <a-col :span="24"> - <a-form-item label="褰掕繕纭鎰忚" :labelCol="{span:3}" :wrapperCol="{span:21}"> - <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ュ綊杩樼‘璁ゆ剰瑙�" - v-decorator="['returnConfirmComment', validatorRules.returnConfirmComment]" /> - </a-form-item> - </a-col> - </a-row> - </a-form> - </a-spin> - <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()">閫夋嫨鍒�鍏�</a-button> - <a-table - ref="table" - bordered - size="middle" - rowKey="id" - :columns="columns" - :dataSource="dataSource" - :pagination="ipagination" - :loading="loading" - > - <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index" > - <div :key="col.dataIndex"> - <a-input - :value="text" - :disabled="disableSubmit" - v-if="col.dataIndex === 'workpieceMaterial'" - @change="(e)=>handleChange(e.target.value, record.key, col, index)" - /> - <a-input-number - v-if="col.dataIndex === 'usedLife'" - :value="text" - @change="(e) => handleChange(e, record.key, col, index)" - :min="1" - /> - </div> - </template> - <span slot="action" slot-scope="text, record, index"> + <a-modal :title="title" :visible="visible" :fullScreen="true" :width="1200" @ok="handleOk" @cancel="handleCancel"> + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="棰嗙敤浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-search-select-tag + :disabled="disableSubmit" + placeholder="璇烽�夋嫨棰嗙敤浜�" + v-decorator="['receiver', { rules: [{ required: true, message: '璇烽�夋嫨棰嗙敤浜�' }] }]" + dict="sys_user,realname,id,del_flag=0" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="棰嗙敤鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['receiveTime', validatorRules.receiveTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="棰嗙敤璇存槑" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ラ鐢ㄨ鏄�" + v-decorator="['receiveComment', validatorRules.receiveComment]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-search-select-tag + :disabled="disableSubmit" + placeholder="璇烽�夋嫨纭浜�" + v-decorator="['confirmer', { rules: [{ required: false, message: '璇烽�夋嫨纭浜�' }] }]" + dict="sys_user,realname,id,del_flag=0" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="纭鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['confirmTime', validatorRules.confirmTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="纭鎰忚" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" + v-decorator="['confirmComment', validatorRules.confirmComment]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="鏄惁浼氬綊杩�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="disableSubmit" placeholder="璇疯緭鍏ユ槸鍚︿細褰掕繕" + v-decorator="['returnFlag', validatorRules.returnFlag]"></a-input> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="褰掕繕鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['returnTime', validatorRules.returnTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="褰掕繕璇存槑" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ュ綊杩樿鏄�" + v-decorator="['returnComment', validatorRules.returnComment]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="褰掕繕纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-search-select-tag + :disabled="disableSubmit" + placeholder="璇烽�夋嫨褰掕繕纭浜�" + v-decorator="['returnConfirmer', { rules: [{ required: false, message: '璇烽�夋嫨褰掕繕纭浜�' }] }]" + dict="sys_user,realname,id,del_flag=0" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="褰掕繕纭鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['returnConfirmTime', validatorRules.returnConfirmTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="褰掕繕纭鎰忚" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ュ綊杩樼‘璁ゆ剰瑙�" + v-decorator="['returnConfirmComment', validatorRules.returnConfirmComment]" /> + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()">閫夋嫨搴撳瓨鍒�鍏�</a-button> + <a-table + ref="table" + bordered + size="middle" + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + > + <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index"> + <div :key="col.dataIndex"> + <a-input + :value="text" + :disabled="disableSubmit" + v-if="col.dataIndex === 'workpieceMaterial'" + @change="(e)=>handleChange(e.target.value, record.key, col, index)" + /> + <a-input-number + v-if="col.dataIndex === 'usedLife'" + :value="text" + @change="(e) => handleChange(e, record.key, col, index)" + :min="1" + /> + </div> + </template> + <span slot="action" slot-scope="text, record, index"> <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record, index)"> <a>鍒犻櫎</a> </a-popconfirm> </span> - </a-table> - <template slot="footer" v-if="disableSubmit == false"> - <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> - <a-button @click="handleOk" type="primary">鎻愪氦</a-button> - </template> + </a-table> + <template slot="footer" v-if="disableSubmit == false"> + <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> + <a-button @click="handleOk" type="primary">鎻愪氦</a-button> + </template> - <template slot="footer" v-if="disableSubmit == true"> - <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> - </template> - <j-select-inventory-modal ref="inventoryModalForm" @ok="modalFormOk"></j-select-inventory-modal> -<!-- <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal>--> - </a-modal> + <template slot="footer" v-if="disableSubmit == true"> + <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> + </template> + <j-select-inventory-modal ref="inventoryModalForm" @ok="modalFormOk"></j-select-inventory-modal> + <!-- <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal>--> + </a-modal> </template> <script> @@ -176,229 +176,226 @@ import JSelectInventoryModal from '@views/cms/modules/JSelectInventoryModal.vue' export default { - name: 'CuttingInboundModal', - components: { - JSelectToolingModal, - JSelectInventoryModal, - JMultiSelectTag, - JDictSelectTag, - store, - moment - }, - data() { - return { - /* 鍒嗛〉鍙傛暟 */ - ipagination: { - current: 1, - pageSize: 10, - pageSizeOptions: ['10', '20', '30'], - showTotal: (total, range) => { - return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' - }, - showQuickJumper: true, - showSizeChanger: true, - total: 0 - }, - title: '鏂板', - visible: false, - selectedRowKeys: {}, - model: {}, - labelCol: { - xs: { span: 24 }, - sm: { span: 6 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 18 } - }, - confirmLoading: false, - loading: false, - form: this.$form.createForm(this), - dataSource: [], - param: {}, - validatorRules: {}, - columns: [ - { - title: '#', - dataIndex: '', - key: 'rowIndex', - width: 50, - align: 'center', - customRender: function(t, r, index) { - return parseInt(index) + 1 - } - }, - { - title: '鍒�鍏风紪鐮�', - align: 'center', - dataIndex: 'cuttingCode', - width: 150 - }, - { - title: '鍒�鍏峰悕绉�', - align: 'center', - dataIndex: 'cuttingName' - }, - { - title: '宸ヤ欢鏉愯川', - align: 'center', - dataIndex: 'workpieceMaterial', - scopedSlots: { customRender: 'workpieceMaterial' } - }, - { - title: '浣跨敤瀵垮懡', - align: 'center', - dataIndex: 'usedLife', - scopedSlots: { customRender: 'usedLife' } - }, - { - title: '鎿嶄綔', - dataIndex: 'action', - align: 'center', - scopedSlots: { customRender: 'action' } - } - ], - url: { - add: '/cms/cuttingReceive/add', - detailList: '/cms/cuttingReceive/detailList' - }, - orderId: '', - disableSubmit: false - } - }, - methods: { - modalFormOk() { - - }, - getQueryParams() { - this.param.pageNo = this.ipagination.current - this.param.pageSize = this.ipagination.pageSize - return filterObj(this.param) - }, - add() { - let receiver = store.getters.userInfo.id - let receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') - this.edit({ receiver: receiver, receiveTime: receiveTime }) - }, - edit(record) { - record.receiver = store.getters.userInfo.id - record.receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') - this.form.resetFields() - this.model = Object.assign({}, record) - this.visible = true - this.disableSubmit = false - if (record.id) { - this.orderId = record.id - this.detailList(this.orderId) + name: 'CuttingInboundModal', + components: { + JSelectToolingModal, + JSelectInventoryModal, + JMultiSelectTag, + JDictSelectTag, + store, + moment + }, + data() { + return { + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + title: '鏂板', + visible: false, + selectedRowKeys: {}, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 18 } + }, + confirmLoading: false, + loading: false, + form: this.$form.createForm(this), + dataSource: [], + param: {}, + validatorRules: {}, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 50, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鍒�鍏风紪鐮�', + align: 'center', + dataIndex: 'cuttingCode', + width: 150 + }, + { + title: '鍒�鍏峰悕绉�', + align: 'center', + dataIndex: 'cuttingName' + }, + { + title: '宸ヤ欢鏉愯川', + align: 'center', + dataIndex: 'workpieceMaterial', + scopedSlots: { customRender: 'workpieceMaterial' } + }, + { + title: '浣跨敤瀵垮懡', + align: 'center', + dataIndex: 'usedLife', + scopedSlots: { customRender: 'usedLife' } + }, + { + title: '鎿嶄綔', + align: 'center', + dataIndex: 'action', + scopedSlots: { customRender: 'action' } + } + ], + url: { + add: '/cms/cuttingReceive/add', + detailList: '/cms/cuttingReceive/detailList' + }, + orderId: '', + disableSubmit: false } - this.$nextTick(() => { - this.form.setFieldsValue( - pick(this.model, 'receiver', 'receiveTime', 'receiveComment', 'confirmer', 'confirmTime', 'confirmComment' - , 'returnFlag', 'returnTime', 'returnComment', 'returnConfirmer', 'returnConfirmTime', 'returnConfirmComment') - ) + }, + methods: { + modalFormOk() { + + }, + getQueryParams() { + this.param.pageNo = this.ipagination.current + this.param.pageSize = this.ipagination.pageSize + return filterObj(this.param) + }, + add() { + let receiver = store.getters.userInfo.id + let receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') + this.edit({ receiver: receiver, receiveTime: receiveTime }) + }, + edit(record) { + record.receiver = store.getters.userInfo.id + record.receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') + this.form.resetFields() + this.model = Object.assign({}, record) + this.visible = true + this.disableSubmit = false + if (record.id) { + this.orderId = record.id + this.detailList(this.orderId) + } + this.$nextTick(() => { + this.form.setFieldsValue( + pick(this.model, 'receiver', 'receiveTime', 'receiveComment', 'confirmer', 'confirmTime', 'confirmComment' + , 'returnFlag', 'returnTime', 'returnComment', 'returnConfirmer', 'returnConfirmTime', 'returnConfirmComment') + ) + }) + }, + handleDelete(record, index) { + this.dataSource.splice(index, 1) + }, + handleChange(value, key, column, index) { + //let t = (this.ipaginationm.current - 1) * this.ipaginationm.pageSize + index + const temp = [...this.dataSource] + const target = temp.filter((item) => key === item.key)[index] + if (target) { + target[column.dataIndex] = value + this.dataSource = temp + } + }, + selectTooling: function() { + let ids = [] + for (let i = 0; i < this.dataSource.length; i++) { + ids.push(this.dataSource[i].inventoryId) + console.log('褰撳墠鏁版嵁婧�:', this.dataSource) + } + // this.$refs.toolingModalForm.showModal(ids) + // this.$refs.toolingModalForm.title = '閫夋嫨鍒�鍏�' + // this.$refs.toolingModalForm.disableSubmit = false + + this.$refs.inventoryModalForm.showModal(ids) + this.$refs.inventoryModalForm.title = '閫夋嫨搴撳瓨鍒�鍏�' + this.$refs.inventoryModalForm.disableSubmit = false + + }, + detailList(orderId) { + this.param.orderId = orderId + getAction(this.url.detailList, this.getQueryParams()).then((res) => { + if (res.success) { + this.dataSource = res.result + } + }) + }, + filterOption(input, option) { + return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + handleOk() { + if (this.dataSource.length == 0) { + this.$message.error('璇峰厛閫夋嫨鍏ュ簱鍒�鍏�') + return + } + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true + let formData = Object.assign(this.model, values) + formData.detailData = this.dataSource + + // 纭繚 detailData 鍖呭惈 inventoryId + formData.detailData = this.dataSource.map(item => ({ + ...item, + // 纭繚 inventoryId 琚纭紶閫� + inventoryId: item.inventoryId + })) + + postAction(that.url.add, formData) + .then((res) => { + if (res.success) { + that.$message.success('棰嗙敤鎴愬姛') + that.$emit('ok', new Date()) + } else { + that.$message.warning(res.message) + } + }) + .finally(() => { + that.confirmLoading = false + that.close() + }) + } + }) + }, + handleCancel() { + this.close() + }, + close() { + this.$emit('close') + this.dataSource = [] + this.visible = false + this.disableSubmit = false + } + }, + mounted() { + this.$bus.$on('selectionRows', (data) => { + console.log('鎺ユ敹鍒扮殑閫夋嫨鏁版嵁:', data) + //getCurrSelected 浜嬩欢 鎺ユ敹缁勪欢浼犻�掔殑鍙傛暟 + for (let i = 0; i < data.length; i++) { + this.dataSource.push({ + inventoryId: data[i].id, + cuttingCode: data[i].cuttingCode, + cuttingName: data[i].cuttingName, + cuttingId: data[i].cuttingId + }) + } + console.log('鏇存柊鍚庣殑鏁版嵁婧�:', this.dataSource) }) - }, - handleDelete(record, index) { - this.dataSource.splice(index, 1) - }, - handleChange(value, key, column, index) { - //let t = (this.ipaginationm.current - 1) * this.ipaginationm.pageSize + index - const temp = [...this.dataSource] - const target = temp.filter((item) => key === item.key)[index] - if (target) { - target[column.dataIndex] = value - this.dataSource = temp - } - }, - selectTooling: function() { - let ids = [] - for (let i = 0; i < this.dataSource.length; i++) { - ids.push(this.dataSource[i].inventoryId) - console.log('褰撳墠鏁版嵁婧�:', this.dataSource) - } - // this.$refs.toolingModalForm.showModal(ids) - // this.$refs.toolingModalForm.title = '閫夋嫨鍒�鍏�' - // this.$refs.toolingModalForm.disableSubmit = false - - this.$refs.inventoryModalForm.showModal(ids) - this.$refs.inventoryModalForm.title = '閫夋嫨鍒�鍏�' - this.$refs.inventoryModalForm.disableSubmit = false - - }, - detailList(orderId) { - this.param.orderId = orderId - getAction(this.url.detailList, this.getQueryParams()).then((res) => { - if (res.success) { - this.dataSource = res.result - } - }) - }, - filterOption(input, option) { - return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 - }, - handleOk() { - if (this.dataSource.length == 0) { - this.$message.error('璇峰厛閫夋嫨鍏ュ簱鍒�鍏�') - return - } - const that = this - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.form.validateFields((err, values) => { - if (!err) { - that.confirmLoading = true - let formData = Object.assign(this.model, values) - formData.detailData = this.dataSource - - // 娣诲姞鏇存柊搴撳瓨鐘舵�佺殑閫昏緫 - const inventoryIds = this.dataSource.map(item => item.inventoryId) - const updateInventoryStatus = inventoryIds.length > 0 ? - //闇�瑕佸啓涓�涓洿鏂板簱瀛樼姸鎬佺殑鎺ュ彛鍦ㄥ悗绔紙杩樻病鍐�25/9/9锛� - postAction('/cms/inventory/updateStatus', { - ids: inventoryIds, - status: '寰呭嚭搴�' //璁句负寰呭嚭搴� - }) : Promise.resolve() - updateInventoryStatus.then(() => { - return postAction(that.url.add, formData) - }).then((res) => { - if (res.success) { - that.$message.success('棰嗙敤鎴愬姛') - that.$emit('ok', new Date()) - } else { - that.$message.warning(res.message) - } - }).catch((error) => { - that.$message.error('鎿嶄綔澶辫触: ' + error.message) - }).finally(() => { - that.confirmLoading = false - that.close() - }) - } - }) - }, - handleCancel() { - this.close() - }, - close() { - this.$emit('close') - this.dataSource = [] - this.visible = false - this.disableSubmit = false - } - }, - mounted() { - this.$bus.$on('selectionRows', (data) => { - console.log('鎺ユ敹鍒扮殑閫夋嫨鏁版嵁:', data) - //getCurrSelected 浜嬩欢 鎺ユ敹缁勪欢浼犻�掔殑鍙傛暟 - for (let i = 0; i < data.length; i++) { - this.dataSource.push({ - inventoryId: data[i].id, - cuttingCode: data[i].cuttingCode, - cuttingName: data[i].cuttingName, - cuttingId: data[i].cuttingId - }) - } - console.log('鏇存柊鍚庣殑鏁版嵁婧�:', this.dataSource) - }) - } + } } </script> \ No newline at end of file -- Gitblit v1.9.3