|
|
|
|
@ -255,6 +255,7 @@
|
|
|
|
|
<div class="footer-buttons">
|
|
|
|
|
<el-button @click="goBack">返 回</el-button>
|
|
|
|
|
<el-button type="primary" @click="handleSubmit" v-if="!isView">保 存</el-button>
|
|
|
|
|
<el-button type="primary" @click="openDispatchDialog" v-if="!isView && repairInstanceId && billsStatus === '0'">指定派工</el-button>
|
|
|
|
|
<el-button type="warning" @click="onStartRepair" v-if="!isView && repairInstanceId && billsStatus === '0'">开始维修</el-button>
|
|
|
|
|
<el-button type="success" @click="onCompleteRepair" v-if="!isView && repairInstanceId && billsStatus === '1'">完成维修</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
@ -274,6 +275,21 @@
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="指定派工" :visible.sync="dispatchDialogVisible" width="40%" append-to-body>
|
|
|
|
|
<el-form label-width="100px">
|
|
|
|
|
<el-form-item label="执行人">
|
|
|
|
|
<el-select v-model="selectedUserId" placeholder="请选择执行人" filterable style="width: 100%" @change="onSelectUser">
|
|
|
|
|
<el-option v-for="u in userOptions" :key="u.userId" :label="u.nickName || u.userName" :value="u.userId" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="dispatchDialogVisible = false">取 消</el-button>
|
|
|
|
|
<el-button type="primary" @click="confirmDispatch">确 定</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 开始维修对话框 -->
|
|
|
|
|
<el-dialog title="开始维修" :visible.sync="startRepairDialogVisible" width="50%" append-to-body>
|
|
|
|
|
<el-form ref="startRepairForm" :model="startRepairForm" :rules="startRepairRules" label-width="100px">
|
|
|
|
|
@ -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)
|
|
|
|
|
|