|
|
@ -142,7 +142,68 @@ |
|
|
|
</template> |
|
|
|
</Dialog> |
|
|
|
|
|
|
|
<Dialog |
|
|
|
ref="confirmDialog" |
|
|
|
title="确认意见" |
|
|
|
v-model="confirmDialogVisible" |
|
|
|
:width="600" |
|
|
|
:maxHeight="760" |
|
|
|
:style="{height:'500px'}" |
|
|
|
:before-close="handleBeforeConfirmClose" |
|
|
|
> |
|
|
|
<el-form class="demo-form-inline"> |
|
|
|
<el-form-item label="确认意见"> |
|
|
|
<!-- 确保@change事件绑定在el-radio-group上 --> |
|
|
|
<el-radio-group v-model="confirmFormValue.confirmStatus"> |
|
|
|
<el-radio :label="'APPLYPASS'">通过</el-radio> |
|
|
|
<el-radio :label="'APPLYREJECTED'">驳回</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="意见"> |
|
|
|
<el-input |
|
|
|
type="textarea" |
|
|
|
v-model="confirmFormValue.confirmContent" |
|
|
|
placeholder="请填写意见" |
|
|
|
clearable |
|
|
|
:rows="12" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<template #footer> |
|
|
|
<div style="text-align: center;"> |
|
|
|
<el-button type="primary" @click="confirmCancel">取消</el-button> |
|
|
|
<el-button type="primary" @click="confirmSubmit">提交</el-button> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</Dialog> |
|
|
|
|
|
|
|
<Dialog |
|
|
|
ref="verifyDialog" |
|
|
|
title="验证意见" |
|
|
|
v-model="verifyDialogVisible" |
|
|
|
:width="600" |
|
|
|
:maxHeight="700" |
|
|
|
:style="{height:'450px'}" |
|
|
|
:before-close="handleBeforeVerifyClose" |
|
|
|
> |
|
|
|
<el-form :model="verifyFormValue" class="demo-form-inline"> |
|
|
|
<el-form-item label="验证意见"> |
|
|
|
<el-input |
|
|
|
type="textarea" |
|
|
|
v-model="verifyFormValue.verifyContent" |
|
|
|
placeholder="请填写验证意见" |
|
|
|
clearable |
|
|
|
:rows="12" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<template #footer> |
|
|
|
<div style="text-align: center;"> |
|
|
|
<el-button type="primary" @click="verifyCancel">取消</el-button> |
|
|
|
<el-button type="primary" @click="verifySubmit">提交</el-button> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</Dialog> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
@ -190,6 +251,16 @@ const tempIdeaRefViewKey = ref(0) |
|
|
|
const tempIdeaRefViewTitle = ref('是否临时措施') |
|
|
|
const isTemporary = ref(false) |
|
|
|
const tempIdeaRefViewData = ref() |
|
|
|
const confirmDialogVisible = ref(false) |
|
|
|
const verifyDialogVisible = ref(false) |
|
|
|
const confirmFormValue = ref({ |
|
|
|
confirmStatus: 'APPLYPASS', |
|
|
|
confirmContent: '', |
|
|
|
}) |
|
|
|
const verifyFormValue = ref({ |
|
|
|
verifyContent: '', |
|
|
|
}) |
|
|
|
const openRowValue = ref() |
|
|
|
routeName.value = route.name |
|
|
|
const tableColumns = ref(MoldMaintenanceMain.allSchemas.tableColumns) |
|
|
|
|
|
|
@ -362,7 +433,7 @@ const isShowMainButton = (row, val) => { |
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance)) }), // 编辑 |
|
|
|
defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && row.status != 'APPLYPASS' && isReceiver(row.maintenance) )}), // 编辑 |
|
|
|
defaultButtons.acceptOrderBtn({ |
|
|
|
hide: !( |
|
|
|
row.status == 'PENDING' && judgeIsTheClass(row) |
|
|
@ -376,12 +447,17 @@ const butttondata = (row) => { |
|
|
|
}), // 维修 |
|
|
|
defaultButtons.verifyOrderBtn({ |
|
|
|
hide: !( |
|
|
|
row.status == 'COMPLETED' && judgeIsTheClassEngineer(row) |
|
|
|
judgeIsTheClassEngineerAndApply(row,'VERIFY') |
|
|
|
) |
|
|
|
}), // 验证 |
|
|
|
defaultButtons.finishOrderBtn({ |
|
|
|
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && row.hasDetails) |
|
|
|
}), // 完成 |
|
|
|
defaultButtons.confirmOrderBtn({ |
|
|
|
hide: !( |
|
|
|
judgeIsTheClassEngineerAndApply(row,'CONFIRM') |
|
|
|
) |
|
|
|
}), // 确认 |
|
|
|
defaultButtons.pictureBtn({ |
|
|
|
hide: !(row.filePathList != null && row.filePathList.length > 0) |
|
|
|
}) // 预览报修图片 |
|
|
@ -419,8 +495,10 @@ const buttonTableClick = async (val, row) => { |
|
|
|
openFormSec('turnOrder', row) |
|
|
|
} else if (val == 'finishOrder') { |
|
|
|
finishOrder(row) |
|
|
|
} else if (val == 'verifyOrder') { |
|
|
|
verifyOrder(row) |
|
|
|
} else if (val == 'verifyOrder') { |
|
|
|
verifyOrder(row) |
|
|
|
} else if (val == 'confirmOrder') { |
|
|
|
confirmOrder(row) |
|
|
|
} else if (val == 'repair') { |
|
|
|
openDetail(row, '代码', row.code) |
|
|
|
} else if (val == 'picture') { |
|
|
@ -453,6 +531,8 @@ const openDetail = async (row: any, titleName: any, titleValue: any) => { |
|
|
|
row.deviceNumberDetail = moldListAll.find((account) => account.number == row.deviceNumber)?.name |
|
|
|
row.factoryAreaNumberDetail = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name |
|
|
|
row.maintenanceDetail = userListAll.find((account) => account.id == row.maintenance)?.nickname |
|
|
|
row.declarerDetail = userListAll.find((account) => account.id == row.declarer)?.nickname |
|
|
|
row.verifyerDetail = userListAll.find((account) => account.id == row.verifyer)?.nickname |
|
|
|
operatRecord.value = row; |
|
|
|
detailRef.value.openDetail(row, titleName, titleValue,'MoldMaintenanceMain') |
|
|
|
} |
|
|
@ -545,17 +625,61 @@ function confirmFinish(row) { |
|
|
|
|
|
|
|
// 验证 |
|
|
|
function verifyOrder(row) { |
|
|
|
openRowValue.value = row |
|
|
|
verifyDialogVisible.value = true |
|
|
|
} |
|
|
|
|
|
|
|
// 验证 |
|
|
|
function verifySubmit() { |
|
|
|
const row = openRowValue.value |
|
|
|
let param = { |
|
|
|
id: row.id, |
|
|
|
number: row.number, |
|
|
|
status: row.status, |
|
|
|
requestNumber: row.requestNumber, |
|
|
|
content: verifyFormValue.value.verifyContent |
|
|
|
} |
|
|
|
MoldMaintenanceMainApi.verifyOrder(param).then(res => { |
|
|
|
verifyDialogVisible.value = false |
|
|
|
getList() |
|
|
|
message.success('操作成功') |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 验证取消 |
|
|
|
function verifyCancel(row) { |
|
|
|
verifyDialogVisible.value = false |
|
|
|
} |
|
|
|
|
|
|
|
// 确认 |
|
|
|
function confirmOrder(row) { |
|
|
|
openRowValue.value = row |
|
|
|
confirmDialogVisible.value = true |
|
|
|
} |
|
|
|
|
|
|
|
// 确认 |
|
|
|
function confirmSubmit() { |
|
|
|
const row = openRowValue.value |
|
|
|
let param = { |
|
|
|
id: row.id, |
|
|
|
number: row.number, |
|
|
|
status: row.status, |
|
|
|
result: confirmFormValue.value.confirmStatus, |
|
|
|
requestNumber: row.requestNumber, |
|
|
|
content: confirmFormValue.value.confirmContent, |
|
|
|
} |
|
|
|
MoldMaintenanceMainApi.confirmOrder(param).then(res => { |
|
|
|
confirmDialogVisible.value = false |
|
|
|
getList() |
|
|
|
message.success('操作成功') |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 确认取消 |
|
|
|
function confirmCancel(row) { |
|
|
|
confirmDialogVisible.value = false |
|
|
|
} |
|
|
|
|
|
|
|
// 维修 |
|
|
|
function repair() {} |
|
|
|
|
|
|
@ -718,6 +842,10 @@ const openFormSec = async (type: string, row?: any) => { |
|
|
|
tableData.value = [] // 重置明细数据 |
|
|
|
newRow.value = { ...row } |
|
|
|
newRow.value.turnType = '0' |
|
|
|
MoldMaintenanceMainSecRules.classes = [{ required: false }] |
|
|
|
MoldMaintenanceMainSecRules.faultType = [{ required: false }] |
|
|
|
MoldMaintenanceMainSecRules.describes = [{ required: false }] |
|
|
|
MoldMaintenanceMainSecRules.maintenance = [{ required: false }] |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'type' |
|
|
|
}).componentProps.disabled = false |
|
|
@ -764,82 +892,50 @@ const openFormSec = async (type: string, row?: any) => { |
|
|
|
|
|
|
|
const onChangeSec = (field, cur, item,formRefSec) => { |
|
|
|
if (field == 'type') { |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'maintenance' |
|
|
|
}).componentProps.optionsAlias = { |
|
|
|
labelField: 'name', |
|
|
|
valueField: 'id' |
|
|
|
} |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.disabled = false |
|
|
|
if (cur == 'MOLD') { |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.options = moldList.value |
|
|
|
selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: null }).then(res => { |
|
|
|
repairUser.value = res |
|
|
|
const setV = {} |
|
|
|
setV['maintenance'] = '' |
|
|
|
formRefSec.setValues(setV) |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'maintenance' |
|
|
|
}).componentProps.options = res |
|
|
|
}) |
|
|
|
MoldAccountsApi.getMoldAccountsNoPage({}).then(res => { |
|
|
|
const setV = {} |
|
|
|
setV['deviceNumber'] = '' |
|
|
|
formRefSec.setValues(setV) |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.options = res |
|
|
|
}) |
|
|
|
} else if (cur == 'TECH') { |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.options = deviceList.value |
|
|
|
selecUserByType({ classType: 'TECH', factoryAreaNumber: '', flag: null }).then(res => { |
|
|
|
repairUser.value = res |
|
|
|
const setV = {} |
|
|
|
setV['maintenance'] = '' |
|
|
|
formRefSec.setValues(setV) |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'maintenance' |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.options = moldList.value |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.options = res |
|
|
|
}) |
|
|
|
} else if (cur == 'TECH') { |
|
|
|
|
|
|
|
DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => { |
|
|
|
const setV = {} |
|
|
|
setV['deviceNumber'] = '' |
|
|
|
formRefSec.setValues(setV) |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.options = res |
|
|
|
}) |
|
|
|
} else if(cur == 'DEVICE'){ |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.options = deviceList.value |
|
|
|
selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null }).then(res => { |
|
|
|
repairUser.value = res |
|
|
|
const setV = {} |
|
|
|
setV['maintenance'] = '' |
|
|
|
formRefSec.setValues(setV) |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'maintenance' |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.options = deviceList.value |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.options = res |
|
|
|
}) |
|
|
|
} else if(cur == 'DEVICE'){ |
|
|
|
DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => { |
|
|
|
const setV = {} |
|
|
|
setV['deviceNumber'] = '' |
|
|
|
setV['maintenance'] = '' |
|
|
|
formRefSec.setValues(setV) |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.options = res |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.options = deviceList.value |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.options = res |
|
|
|
}) |
|
|
|
} |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'maintenance' |
|
|
|
}).componentProps.disabled = false |
|
|
|
} |
|
|
|
if (field == 'turnType') { |
|
|
|
if (cur == '0') { |
|
|
@ -849,6 +945,7 @@ const onChangeSec = (field, cur, item,formRefSec) => { |
|
|
|
setV['deviceNumber'] = newRow.value.deviceNumber |
|
|
|
setV['type'] = newRow.value.type |
|
|
|
formRefSec.setValues(setV) |
|
|
|
MoldMaintenanceMainSecRules.maintenance = [{ required: false }] |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'type' |
|
|
|
}).componentProps.disabled = false |
|
|
@ -897,6 +994,7 @@ const onChangeSec = (field, cur, item,formRefSec) => { |
|
|
|
setV['deviceNumber'] = newRow.value.deviceNumber |
|
|
|
setV['type'] = newRow.value.type |
|
|
|
formRefSec.setValues(setV) |
|
|
|
MoldMaintenanceMainSecRules.maintenance = [{ required: true }] |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'type' |
|
|
|
}).componentProps.disabled = true |
|
|
@ -938,6 +1036,7 @@ const onChangeSec = (field, cur, item,formRefSec) => { |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'maintenance' |
|
|
|
}).componentProps.disabled = false |
|
|
|
MoldMaintenanceMainSecRules.maintenance = [{ required: true }] |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'maintenance' |
|
|
|
}).componentProps.options = res |
|
|
@ -1037,6 +1136,39 @@ const validateRow = (row) => { |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const judgeIsTheClassEngineerAndApply = (row,type) => { |
|
|
|
// 先判断角色是否满足条件 |
|
|
|
const rolesOk = userStore.roles.some(item => { |
|
|
|
if (row.type == 'MOLD') { |
|
|
|
return item === 'mold_class_Engineer_role'; |
|
|
|
} |
|
|
|
}); |
|
|
|
// 如果角色不满足条件,直接返回false |
|
|
|
if (!rolesOk) return false; |
|
|
|
// 根据不同的状态进行判断 |
|
|
|
if (row.status === 'COMPLETED' && type == 'CONFIRM') { |
|
|
|
// COMPLETED状态下,需要额外判断requestNumber和declarer |
|
|
|
if(row.requestNumber != null && row.requestNumber !== '' && row.declarer === userStore.getUser.id){ |
|
|
|
return true |
|
|
|
}else{ |
|
|
|
return false |
|
|
|
} |
|
|
|
} else if (row.status === 'APPLYPASS' && type == 'VERIFY') { |
|
|
|
// APPLYPASS状态下,可能有其他逻辑,这里直接返回true作为示例 |
|
|
|
// 根据实际情况,这里可能需要添加额外的逻辑判断 |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
// 如果不是COMPLETED或APPLYPASS状态,或者COMPLETED状态下条件不满足,则默认返回false |
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|