|
@@ -123,6 +123,7 @@
|
|
|
<el-button type="primary" @click="dispatchOrder">下派任务</el-button>
|
|
<el-button type="primary" @click="dispatchOrder">下派任务</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="flex flex-wrap gap-3">
|
|
<div class="flex flex-wrap gap-3">
|
|
|
|
|
+ <el-button v-if="canAcceptOrder(selectedOrder)" type="warning" @click="acceptOrder">接单</el-button>
|
|
|
<el-button v-if="canStartRepair(selectedOrder)" type="primary" @click="startRepair">开始维修</el-button>
|
|
<el-button v-if="canStartRepair(selectedOrder)" type="primary" @click="startRepair">开始维修</el-button>
|
|
|
<el-button v-if="canSubmitVerify(selectedOrder)" type="warning" @click="submitVerify">提交验收</el-button>
|
|
<el-button v-if="canSubmitVerify(selectedOrder)" type="warning" @click="submitVerify">提交验收</el-button>
|
|
|
<el-button v-if="canApprove(selectedOrder)" type="success" @click="approveOrder(true)">验收通过</el-button>
|
|
<el-button v-if="canApprove(selectedOrder)" type="success" @click="approveOrder(true)">验收通过</el-button>
|
|
@@ -294,7 +295,7 @@ function getOrderStatusMeta(status) {
|
|
|
6: { key: 'completed', text: '已结案', tag: 'success' },
|
|
6: { key: 'completed', text: '已结案', tag: 'success' },
|
|
|
7: { key: 'completed', text: '已驳回', tag: 'danger' },
|
|
7: { key: 'completed', text: '已驳回', tag: 'danger' },
|
|
|
8: { key: 'processing', text: '延期审核', tag: 'warning' },
|
|
8: { key: 'processing', text: '延期审核', tag: 'warning' },
|
|
|
- 9: { key: 'completed', text: '已延期', tag: 'warning' }
|
|
|
|
|
|
|
+ 9: { key: 'pending', text: '延期待接单', tag: 'warning' }
|
|
|
}
|
|
}
|
|
|
return map[Number(status)] || { key: '', text: '—', tag: 'info' }
|
|
return map[Number(status)] || { key: '', text: '—', tag: 'info' }
|
|
|
}
|
|
}
|
|
@@ -432,8 +433,12 @@ function canDispatch(order) {
|
|
|
return Number(order.orderStatus) === 1
|
|
return Number(order.orderStatus) === 1
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+function canAcceptOrder(order) {
|
|
|
|
|
+ return [2, 9].includes(Number(order.orderStatus))
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
function canStartRepair(order) {
|
|
function canStartRepair(order) {
|
|
|
- return [2, 3].includes(Number(order.orderStatus))
|
|
|
|
|
|
|
+ return Number(order.orderStatus) === 3
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function canSubmitVerify(order) {
|
|
function canSubmitVerify(order) {
|
|
@@ -460,6 +465,7 @@ function hasOperationButtons(order) {
|
|
|
if (!order) return false
|
|
if (!order) return false
|
|
|
return (
|
|
return (
|
|
|
canDispatch(order) ||
|
|
canDispatch(order) ||
|
|
|
|
|
+ canAcceptOrder(order) ||
|
|
|
canStartRepair(order) ||
|
|
canStartRepair(order) ||
|
|
|
canSubmitVerify(order) ||
|
|
canSubmitVerify(order) ||
|
|
|
canApprove(order) ||
|
|
canApprove(order) ||
|
|
@@ -575,6 +581,15 @@ function confirmDispatchUser() {
|
|
|
dispatchDialogVisible.value = false
|
|
dispatchDialogVisible.value = false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+async function acceptOrder() {
|
|
|
|
|
+ try {
|
|
|
|
|
+ await operateCurrent(3, '接单')
|
|
|
|
|
+ ElMessage.success('已接单')
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ ElMessage.error(error?.message || '接单失败')
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
async function startRepair() {
|
|
async function startRepair() {
|
|
|
try {
|
|
try {
|
|
|
await operateCurrent(4, '开始维修')
|
|
await operateCurrent(4, '开始维修')
|
|
@@ -656,7 +671,7 @@ function getLogType(operType) {
|
|
|
6: 'success',
|
|
6: 'success',
|
|
|
7: 'danger',
|
|
7: 'danger',
|
|
|
8: 'warning',
|
|
8: 'warning',
|
|
|
- 9: 'success'
|
|
|
|
|
|
|
+ 9: 'warning'
|
|
|
}
|
|
}
|
|
|
return map[Number(operType)] || 'info'
|
|
return map[Number(operType)] || 'info'
|
|
|
}
|
|
}
|