From 15b5761c51a43606194cc2424a32638675854514 Mon Sep 17 00:00:00 2001 From: qiankanghui Date: Mon, 27 Jul 2026 11:46:11 +0800 Subject: [PATCH] =?UTF-8?q?RFID=E5=88=B0=E8=BE=BE=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reportWorkOrder/reportDefectOrder2.vue | 80 ++++++++++++++----- 1 file changed, 62 insertions(+), 18 deletions(-) diff --git a/src/views/modules/reportWorkOrder/reportDefectOrder2.vue b/src/views/modules/reportWorkOrder/reportDefectOrder2.vue index 8221e97..3f5ae37 100644 --- a/src/views/modules/reportWorkOrder/reportDefectOrder2.vue +++ b/src/views/modules/reportWorkOrder/reportDefectOrder2.vue @@ -556,7 +556,7 @@ - +
@@ -619,6 +619,7 @@ + 选择到达人员 @@ -1263,6 +1264,7 @@ export default { roleName: '', }, operatorModelFlag: false, + isSingleSelectOperator: false, // 标识是否为单选模式 operatorList: [], roleList: [], assistantModelFlag: false, @@ -2280,20 +2282,48 @@ export default { // 多选 selectionChangeHandle2 (val) { - this.dataListSelections2 = val + // 如果是单选模式,只保留最后一个选中的项 + if (this.isSingleSelectOperator && val.length > 1) { + // 清除之前的选择 + this.$refs.operatorTable.clearSelection() + // 只选中最后一个 + this.$nextTick(() => { + this.$refs.operatorTable.toggleRowSelection(val[val.length - 1], true) + }) + this.dataListSelections2 = [val[val.length - 1]] + } else { + this.dataListSelections2 = val + } }, // 确认多选机修人员 confirmOperator () { - this.saveData.operatorName = '' - this.saveData.operator = '' - for (let i = 0; i < this.dataListSelections2.length; i++) { - this.saveData.operatorName = this.saveData.operatorName + ";" + this.dataListSelections2[i].adminName - this.saveData.operator = this.saveData.operator + ";" + this.dataListSelections2[i].adminID + // 如果是单选模式(03-RFID到达人员选择) + if (this.isSingleSelectOperator) { + if (!this.dataListSelections2 || this.dataListSelections2.length === 0) { + this.$message.warning('请选择到达人员!') + return + } + if (this.dataListSelections2.length > 1) { + this.$message.warning('只能选择一个到达人员!') + return + } + this.saveData.operator = this.dataListSelections2[0].adminID + this.saveData.operatorName = this.dataListSelections2[0].adminName + this.operatorModelFlag = false + this.isSingleSelectOperator = false + } else { + // 多选模式(原有的执行人员选择) + this.saveData.operatorName = '' + this.saveData.operator = '' + for (let i = 0; i < this.dataListSelections2.length; i++) { + this.saveData.operatorName = this.saveData.operatorName + ";" + this.dataListSelections2[i].adminName + this.saveData.operator = this.saveData.operator + ";" + this.dataListSelections2[i].adminID + } + this.saveData.operator = this.saveData.operator.substring(1) + this.saveData.operatorName = this.saveData.operatorName.substring(1) + this.operatorModelFlag = false } - this.saveData.operator = this.saveData.operator.substring(1) - this.saveData.operatorName = this.saveData.operatorName.substring(1) - this.operatorModelFlag = false }, // 增加协助人弹窗 @@ -2593,14 +2623,9 @@ export default { chooseReachOperator (row) { this.saveData.site = row.site this.saveData.buNo = row.buNo - // 只有 03-RFID BU 才固定为计划执行人员 - if (row.buNo === '03-RFID') { - this.saveData.operator = row.planOperator || '' - this.saveData.operatorName = row.planOperatorName || '' - } else { - this.saveData.operator = '' - this.saveData.operatorName = '' - } + // 03-RFID BU 也可以选择不固定为计划执行人员 + this.saveData.operator = '' + this.saveData.operatorName = '' this.operatorData.bu = row.site + '_' + row.buNo this.reachData = row this.chooseReachModelFlag = true @@ -2650,6 +2675,25 @@ export default { }) }, + // 打开单选人员选择对话框(用于03-RFID) + openSingleOperatorSelect () { + this.isSingleSelectOperator = true // 设置为单选模式 + this.operatorData.bu = this.saveData.site + '_' + this.saveData.buNo + // 先清空缓存选中 + this.$nextTick(() => this.$refs.operatorTable.clearSelection()) + // 查询人员 + getOperatorList(this.operatorData).then(({data}) => { + if (data && data.code === 0) { + this.operatorList = data.rows + this.operatorModelFlag = true + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + // 执行 reportModal (row) { this.saveData = {