From 2f519ead537a0b38019bbf64a6075cbb6e08f9b4 Mon Sep 17 00:00:00 2001 From: hyingbo <1363390067@qq.com> Date: 星期三, 09 七月 2025 13:53:01 +0800 Subject: [PATCH] 车间大屏看板设置设备默认图片 --- src/views/tms/modules/inboundOrder/InboundOrderModel.vue | 155 +++++++++++++++++++++++++++------------------------ 1 files changed, 83 insertions(+), 72 deletions(-) diff --git a/src/views/tms/modules/inboundOrder/InboundOrderModel.vue b/src/views/tms/modules/inboundOrder/InboundOrderModel.vue index 3118a1e..4e1d578 100644 --- a/src/views/tms/modules/inboundOrder/InboundOrderModel.vue +++ b/src/views/tms/modules/inboundOrder/InboundOrderModel.vue @@ -40,8 +40,24 @@ /> </a-form-item> </a-col> - <a-col :span="24 / 2"> + <!-- <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="搴撲綅鍙�"> + <a-select + :triggerChange="true" + :options="locationCodeOptions" + v-decorator="[ 'locationCodeId', validatorRules.locationCodeId ]" + /> + </a-form-item> + </a-col> --> + <!-- <a-col :span="24 / 2"> <a-form-item label="鐢宠鍘熷洜" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input placeholder="璇疯緭鍏ョ敵璇峰師鍥�" :disabled="disableSubmit" v-decorator="['applicationReason', validatorRules.applicationReason]" /> + </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-input placeholder="璇疯緭鍏ョ敵璇峰師鍥�" :disabled="disableSubmit" v-decorator="['applicationReason', validatorRules.applicationReason]" /> </a-form-item> </a-col> @@ -55,7 +71,7 @@ v-if="!barcodeCurrentType" placeholder="璇烽�夋嫨缁忔墜浜�" v-decorator="['handler', { rules: [{ required: false, message: '璇烽�夋嫨缁忔墜浜�' }] }]" - dict="sys_user,realname,id,del_flag=0" + dict="sys_user,realname,username,del_flag=0" @change="selectCurrentUserChange" /> </a-form-item> @@ -64,10 +80,10 @@ <a-col :span="24 / 2"> <a-form-item label="瀹℃牳浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> <j-search-select-tag - :disabled="true" + :disabled="disableSubmit" placeholder="璇烽�夋嫨瀹℃牳浜�" v-decorator="['reviewer', validatorRules.reviewer]" - dict="sys_user,realname,id,del_flag=0" + dict="sys_user,realname,username,del_flag=0" @change="selectCurrentUserChange" /> </a-form-item> @@ -109,9 +125,9 @@ </a-row> </a-form> </a-spin> - <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()" v-show="returnShow && !disableSubmit">閫夋嫨鍊熺敤鍑哄簱鍗�</a-button> + <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> - <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()" v-show="sharpenShow && !disableSubmit">閫夋嫨鍒冪(鍑哄簱鍗�</a-button> + <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectSharpenList()" v-show="sharpenShow && !disableSubmit">閫夋嫨鍒冪(宸ュ叿</a-button> <a-table ref="table" bordered @@ -127,11 +143,22 @@ <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)" :min="1" /> + <a-select + v-if="col.dataIndex == 'goodsShelvesId'" + :disabled="disableSubmit" + :triggerChange="true" + :value="text" + show-search + :filter-option="filterOption" + style="width: 100%" + :options="locationCodeOptions" + @change="(e) => handleChange(e, record.key, col, index)" + /> </div> </template> <span slot="action" slot-scope="text, record, index"> @@ -166,6 +193,7 @@ import { filterObj } from '@/utils/util' import JSelectReturnListModal from './JSelectReturnListModal' import JSelectSharpenListModal from './JSelectSharpenListModal' +import store from '@/store' export default { name: 'InboundOrderModel', @@ -176,6 +204,7 @@ JSelectReturnListModal, JSearchSelectTag, JSelectSharpenListModal, + store }, data() { return { @@ -235,7 +264,7 @@ barcodeCurrentType: false, inboundOrderId:'', validatorRules: { - type: { + inStorehouseType: { rules: [ { required: true, @@ -243,19 +272,27 @@ }, ], }, - inboundDate: { + inboundTime: { rules: [ { required: true, - message: '璇烽�夋嫨鐢宠鍏ュ簱鏃ユ湡!', + message: '璇烽�夋嫨鐢宠鍏ュ簱鏃堕棿!', }, ], }, - applicant: { + applicationReason: { rules: [ { required: true, - message: '璇烽�夋嫨鐢宠浜�!', + message: '璇峰~鍐欑敵璇峰師鍥�!', + }, + ], + }, + reviewer: { + rules: [ + { + required: true, + message: '璇烽�夋嫨瀹℃牳浜�!', }, ], }, @@ -263,11 +300,9 @@ url: { add: '/tms/inboundOrder/add', edit: '/tms/inboundOrder/edit', - queryByUserName: '/sys/user/queryByUserName', toolingList:'/tms/baseTools/list', - queryAccountList:'/tms/baseTools/list', - querySharpenList:'/tms/baseTools/list', - queryReturnList:'/tms/baseTools/list', + querySharpenList:'/tms/toolLedgerDetail/list', + queryReturnList:'/tms/toolLedgerDetail/list', detailList:'/tms/inboundDetail/list', }, toolingOptions:[], @@ -303,6 +338,12 @@ align: 'center', dataIndex: 'toolModel' }, + { + title: '搴撲綅鍙�', + align: 'center', + dataIndex: 'goodsShelvesId', + scopedSlots: { customRender: 'goodsShelvesId' }, + }, { title: '鍏ュ簱鏁伴噺', align: 'center', @@ -316,11 +357,21 @@ scopedSlots: { customRender: 'action' }, }, ], + locationCodeOptions:[] } }, - created() {}, + created() { + ajaxGetDictItems("tms_goods_shelves,location_code,id", null).then((res) => { + if (res.success) { + this.locationCodeOptions = res.result + } + }) + }, methods: { modalFormOk() { + }, + filterOption(input, option) { + return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 }, getQueryParams() { this.param.pageNo = this.ipagination.current @@ -328,6 +379,7 @@ return filterObj(this.param) }, add() { + this.handle = store.getters.userInfo.username this.edit({}) }, edit(record) { @@ -348,7 +400,6 @@ 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') @@ -361,6 +412,14 @@ const target = temp.filter(item => key === item.key)[index]; if (target) { target[column.dataIndex] = value + if(column.dataIndex === 'inStorageQuantity'){ + if(target['quantity']<value){ + this.$message.error('鍏ュ簱鏁伴噺涓嶈兘澶т簬鍑哄簱鏁伴噺!') + this.isDisabled = true + }else{ + this.isDisabled = false + } + } this.dataSource = temp } }, @@ -419,7 +478,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 = '閫夋嫨宸ュ叿' @@ -449,14 +508,6 @@ this.dataSource.splice(index, 1) }, onChange() {}, - //鎺у埗鎵爜鎴栨墜閫� - selectCurrentUserType(e) { - if (e == '0') { - this.barcodeCurrentType = true - } else { - this.barcodeCurrentType = false - } - }, //鎵嬮�変汉鍛樺�� selectCurrentUserChange(e) { console.log('褰撳墠鎵嬮��', e) @@ -494,52 +545,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; } }) }, @@ -555,16 +566,16 @@ //getCurrSelected 浜嬩欢 鎺ユ敹缁勪欢浼犻�掔殑鍙傛暟 for (let i = 0; i < data.length; i++) { this.dataSource.push({ - toolCodeId:data[i].id, - toolingId: data[i].toolingId || 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, - unitName: data[i].unitName || data[i].unitId_dictText, onlyCode:data[i].onlyCode, - noAccountQuantity:data[i].noAccountQuantity, - inStorageQuantity:data[i].storageQuantity + quantity:data[i].quantity, + inStorageQuantity:data[i].storageQuantity || data[i].quantity || 1, + accuracyClass:data[i].accuracyClass }) } //this.ipaginationm.total = this.dataSource.length -- Gitblit v1.9.3