From d289be3b10e9b259625ca9128b54bc62950c4e48 Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期一, 08 九月 2025 17:57:49 +0800 Subject: [PATCH] 出库状态改为生命周期 其他文档改为电子文档 电子文档新增指派设备结构树 --- src/views/tms/modules/outBound/OutboundDetailSelectList.vue | 48 ++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 38 insertions(+), 10 deletions(-) diff --git a/src/views/tms/modules/outBound/OutboundDetailSelectList.vue b/src/views/tms/modules/outBound/OutboundDetailSelectList.vue index 6953efe..b9e0a03 100644 --- a/src/views/tms/modules/outBound/OutboundDetailSelectList.vue +++ b/src/views/tms/modules/outBound/OutboundDetailSelectList.vue @@ -16,21 +16,31 @@ <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index"> <div :key="col.dataIndex"> - + <a-input-number v-if="col.dataIndex === 'ratedLife'" - :disabled="record.accuracyClass != '1'" + :disabled="record.accuracyClass !== '1'" :value="text" @change="(e) => handleChange(e, record.key, col, index)" :min="1" /> + <div v-if="col.dataIndex === 'ratedLife' && record.accuracyClass === '1' && isFieldEmpty(record.ratedLife)" + style="color: #ff4d4f; font-size: 12px;"> + 蹇呭~ + </div> + <a-input-number v-if="col.dataIndex === 'useLife'" - :disabled="record.accuracyClass != '1'" + :disabled="record.accuracyClass !== '1'" :value="text" @change="(e) => handleChange(e, record.key, col, index)" :min="1" /> + <div v-if="col.dataIndex === 'useLife' && record.accuracyClass === '1' && isFieldEmpty(record.useLife)" + style="color: #ff4d4f; font-size: 12px;"> + 蹇呭~ + </div> + </div> </template> @@ -139,7 +149,7 @@ // dataIndex: 'outActualCount' // }, { - title:'鍑哄簱鐘舵��', + title:'鐢熷懡鍛ㄦ湡', align:"center", dataIndex: 'status_dictText' }, @@ -208,6 +218,9 @@ } }, methods: { + isFieldEmpty(value) { + return value === undefined || value === null || value === ''; + }, onSelectChange(selectedRowKeys, selectionRows) { this.selectedRowKeys = selectedRowKeys; this.selectionRows = selectionRows; @@ -219,15 +232,19 @@ this.ipagination.current = 1 }, handleOutbound(record) { - console.log(this.mainId) - console.log(record) + // 鍏堣繘琛屽繀濉牎楠� + const errors = this.validateRequiredFields(record); + if (errors.length > 0) { + this.$message.error(errors.join('锛�')); + return; + } const params = [ { outBoundOrderId: this.mainId, outboundDetailId: record.id, outboundQuantity: record.outboundQuantity, - ratedLife:record.ratedLife, - useLife:record.useLife + ratedLife: record.ratedLife, + useLife: record.useLife } ] postAction(this.url.outbound, params).then(res=>{ @@ -249,8 +266,19 @@ this.dataSource = temp } }, - - + validateRequiredFields(record) { + const errors = []; + // 鍙湁鍦ㄤ笉绂佺敤鐘舵�佷笅鎵嶉渶瑕佹牎楠屽繀濉� + if (record.accuracyClass === '1') { + if (this.isFieldEmpty(record.ratedLife)) { + errors.push('棰濆畾瀵垮懡涓哄繀濉」'); + } + if (this.isFieldEmpty(record.useLife)) { + errors.push('浣跨敤瀵垮懡涓哄繀濉」'); + } + } + return errors; + } } } </script> -- Gitblit v1.9.3