From ab81a379c4b13ca53916494de5d979db8116ef20 Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Thu, 6 Nov 2025 13:33:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(dms):=20=E6=B7=BB=E5=8A=A0=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E6=B4=BE=E5=B7=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在故障工单详情页添加指定派工按钮及对话框 - 实现选择执行人并提交派工逻辑 - 新增调用指定派工接口 /dms/dmsBillsFaultInstance/dispatch - 在工单列表页增加指定派工操作入口 - 引入用户列表接口用于派工人员选择 - 添加相关状态判断和权限控制 --- src/api/dms/dmsBillsFaultInstance.js | 9 +++ .../dms/dmsBillsFaultInstance/detail.vue | 61 ++++++++++++++++++- src/views/dms/dmsBillsFaultInstance/index.vue | 60 ++++++++++++++++++ 3 files changed, 129 insertions(+), 1 deletion(-) diff --git a/src/api/dms/dmsBillsFaultInstance.js b/src/api/dms/dmsBillsFaultInstance.js index cc528b4..c30bcc7 100644 --- a/src/api/dms/dmsBillsFaultInstance.js +++ b/src/api/dms/dmsBillsFaultInstance.js @@ -98,3 +98,12 @@ export function getBillsFaultInstance4Repair(repairInstanceId) { method: 'get' }) } + +// 指定派工 +export function dispatchRepair(data) { + return request({ + url: '/dms/dmsBillsFaultInstance/dispatch', + method: 'post', + data: data + }) +} diff --git a/src/views/dms/dmsBillsFaultInstance/detail.vue b/src/views/dms/dmsBillsFaultInstance/detail.vue index 2ec106d..7364ae7 100644 --- a/src/views/dms/dmsBillsFaultInstance/detail.vue +++ b/src/views/dms/dmsBillsFaultInstance/detail.vue @@ -255,6 +255,7 @@ @@ -274,6 +275,21 @@ + + + + + + + + + + + + @@ -371,11 +387,13 @@ import { addDmsBillsFaultInstance, updateDmsBillsFaultInstance, startRepair, - completeRepair + completeRepair, + dispatchRepair } from '@/api/dms/dmsBillsFaultInstance' import { getDeviceLedgerList } from '@/api/base/deviceLedger' import { getKnowledgeRepairList } from '@/api/dms/knowledgeRepair' import { getToken } from '@/utils/auth' +import { selectUserList } from '@/api/system/user' export default { name: 'FaultRepairDetail', @@ -446,6 +464,11 @@ export default { ] }, + dispatchDialogVisible: false, + userOptions: [], + selectedUserId: null, + selectedUserName: '', + // 操作记录对话框 recordDialogVisible: false, recordDialogTitle: '', @@ -760,6 +783,42 @@ export default { }) }, + /** 打开派工对话框 */ + openDispatchDialog() { + if (!this.repairInstanceId) { + return this.$message.warning('未找到工单ID,无法派工') + } + this.selectedUserId = null + this.selectedUserName = '' + selectUserList({}).then(res => { + this.userOptions = (res && res.rows && res.rows.length ? res.rows : res.data) || [] + this.dispatchDialogVisible = true + }) + }, + + /** 选择人员 */ + onSelectUser(val) { + const u = (this.userOptions || []).find(x => x.userId === val) + this.selectedUserName = u ? (u.nickName || u.userName) : '' + }, + + /** 确认派工 */ + confirmDispatch() { + if (!this.selectedUserId) { + return this.$message.warning('请选择执行人') + } + const payload = { + repairInstanceId: this.repairInstanceId, + handleUserId: this.selectedUserId, + handleBy: this.selectedUserName + } + dispatchRepair(payload).then(() => { + this.$modal.msgSuccess('派工成功') + this.dispatchDialogVisible = false + this.loadData() + }) + }, + /** 提交表单 */ handleSubmit() { console.log('提交表单, faultForm:', this.faultForm) diff --git a/src/views/dms/dmsBillsFaultInstance/index.vue b/src/views/dms/dmsBillsFaultInstance/index.vue index 84509a1..361291b 100644 --- a/src/views/dms/dmsBillsFaultInstance/index.vue +++ b/src/views/dms/dmsBillsFaultInstance/index.vue @@ -101,6 +101,13 @@ @click="handleEditDetail(scope.row)" v-hasPermi="['dms:dmsBillsFaultInstance:edit']" >编辑 + 指定派工 取 消 + + + + + + + + + + + @@ -377,8 +398,10 @@ import { handleFaultExport, startRepair, completeRepair, + dispatchRepair, getBillsFaultInstance4Repair } from "@/api/dms/dmsBillsFaultInstance"; +import { selectUserList } from '@/api/system/user' import { listDmsRepair } from '@/api/dms/dmsRepair' import { listDmsRepairInstance } from '@/api/dms/dmsRepairInstance' import { listPoint,listSelectInspection } from '@/api/dms/dmsBillsInstance' @@ -446,6 +469,12 @@ export default { title: "", // 是否显示弹出层 open: false, + // 指定派工对话框 + dispatchDialogVisible: false, + userOptions: [], + selectedUserId: null, + selectedUserName: '', + dispatchRow: null, // 查询参数 queryParams: { pageNum: 1, @@ -648,6 +677,37 @@ export default { this.getList() }) }, + handleDispatch(row) { + this.dispatchRow = row + this.selectedUserId = null + this.selectedUserName = '' + selectUserList({}).then(res => { + this.userOptions = (res && res.rows && res.rows.length ? res.rows : res.data) || [] + this.dispatchDialogVisible = true + }) + }, + onSelectUser(val) { + const u = (this.userOptions || []).find(x => x.userId === val) + this.selectedUserName = u ? (u.nickName || u.userName) : '' + }, + confirmDispatch() { + if (!this.dispatchRow || !this.dispatchRow.repairInstanceId) { + return this.$message.warning('未找到工单ID,无法派工') + } + if (!this.selectedUserId) { + return this.$message.warning('请选择执行人') + } + const payload = { + repairInstanceId: this.dispatchRow.repairInstanceId, + handleUserId: this.selectedUserId, + handleBy: this.selectedUserName + } + dispatchRepair(payload).then(() => { + this.$modal.msgSuccess('派工成功') + this.dispatchDialogVisible = false + this.getList() + }) + }, /** 完成维修(列表快捷) */ handleCompleteRepair(row) { getBillsFaultInstance4Repair(row.repairInstanceId).then(res => {