|
|
@ -9,7 +9,7 @@ |
|
|
|
v-if="data.status == 'PECEIVED' && (!serviceList || serviceList && serviceList.length == 0)">转办 |
|
|
|
</view> --> |
|
|
|
<view @click="transfer" |
|
|
|
v-if="data.status == 'PECEIVED'&&auth.hasPermiOr(['eam:device-maintenance-job-main:turnTo','eam:mold-maintenance-job-main:turnTo','eam:tech-maintenance-job-main:orderClick'])"> |
|
|
|
v-if="data.status == 'PECEIVED'&&((type=='DEVICE'&&auth.hasPermi('eam:device-maintenance-job-main:turnToAPP'))||(type=='MOLD'&&auth.hasPermi('eam:mold-maintenance-job-main:turnToAPP'))||(type=='TECH'&&auth.hasPermi('eam:tech-maintenance-job-main:turnToAPP')))"> |
|
|
|
转办 |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -207,23 +207,23 @@ |
|
|
|
</view> |
|
|
|
<view class="footer"> |
|
|
|
<view class="btns" |
|
|
|
v-if="data.status == 'PENDING'&&auth.hasPermiOr(['eam:device-maintenance-job-main:orderClick','eam:mold-maintenance-job-main:orderClick','eam:tech-maintenance-job-main:orderClick'])"> |
|
|
|
v-if="data.status == 'PENDING'&&((type=='DEVICE'&&auth.hasPermi('eam:device-maintenance-job-main:orderClickAPP'))||(type=='MOLD'&&auth.hasPermi('eam:mold-maintenance-job-main:orderClickAPP'))||(type=='TECH'&&auth.hasPermi('eam:tech-maintenance-job-main:orderClickAPP')))"> |
|
|
|
<u-button type="primary" @click="orderClick(1)" :loading='loading' :disabled='loading'>接单</u-button> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="btns" v-if="data.status == 'PECEIVED'"> |
|
|
|
<u-button shape="shape" type="warning" style="min-width: 120rpx;" :loading='loading1' @click="editForm" |
|
|
|
:disabled='loading1' |
|
|
|
v-if="auth.hasPermiOr(['eam:device-maintenance-job-main:update','eam:mold-maintenance-job-main:update','eam:tech-maintenance-job-main:update'])">修改工单</u-button> |
|
|
|
:disabled='loading1' v-if="(type=='DEVICE'&&auth.hasPermi('eam:device-maintenance-job-main:updateAPP'))||(type=='MOLD'&&auth.hasPermi('eam:mold-maintenance-job-main:updateAPP'))||(type=='TECH'&&auth.hasPermi('eam:tech-maintenance-job-main:updateAPP'))">修改工单</u-button> |
|
|
|
|
|
|
|
<u-button type="primary" @click="orderClickSuccess()" :loading='loading' :disabled='loading' |
|
|
|
v-if="auth.hasPermiOr(['eam:device-maintenance-job-main:orderClickFinish','eam:mold-maintenance-job-main:orderClickFinish','eam:tech-maintenance-job-main:orderClickFinish'])">完成</u-button> |
|
|
|
v-if="(type=='DEVICE'&&auth.hasPermi('eam:device-maintenance-job-main:orderClickFinishAPP'))||(type=='MOLD'&&auth.hasPermi('eam:mold-maintenance-job-main:orderClickFinishAPP'))||(type=='TECH'&&auth.hasPermi('eam:tech-maintenance-job-main:orderClickFinishAPP'))">完成</u-button> |
|
|
|
</view> |
|
|
|
<view class="btns" |
|
|
|
v-if="((data.status == 'COMPLETED' && !data.requestNumber) || (data.status == 'APPLYPASS')) && auth.hasPermiOr(['eam:device-maintenance-job-main:orderClickVerify','eam:mold-maintenance-job-main:orderClickVerify','eam:tech-maintenance-job-main:orderClickVerify'])"> |
|
|
|
v-if="((data.status == 'COMPLETED' && !data.requestNumber) || (data.status == 'APPLYPASS')) && ((type=='DEVICE'&&auth.hasPermi('eam:device-maintenance-job-main:orderClickVerifyAPP'))||(type=='MOLD'&&auth.hasPermi('eam:mold-maintenance-job-main:orderClickVerifyAPP'))||(type=='TECH'&&auth.hasPermi('eam:tech-maintenance-job-main:orderClickVerifyAPP')))"> |
|
|
|
<u-button type="primary" @click="verify()" :loading='loading' :disabled='loading'>验证</u-button> |
|
|
|
</view> |
|
|
|
<view class="btns" |
|
|
|
v-if="(data.status == 'COMPLETED' && data.requestNumber && data.applyer == store.id)&&auth.hasPermiOr(['eam:device-maintenance-job-main:orderClickConfirm','eam:mold-maintenance-job-main:orderClickConfirm','eam:tech-maintenance-job-main:orderClickConfirm'])"> |
|
|
|
v-if="(data.status == 'COMPLETED' && data.requestNumber && data.applyer == store.id)&& ((type=='DEVICE'&&auth.hasPermi('eam:device-maintenance-job-main:orderClickConfirmAPP'))||(type=='MOLD'&&auth.hasPermi('eam:mold-maintenance-job-main:orderClickConfirmAPP'))||(type=='TECH'&&auth.hasPermi('eam:tech-maintenance-job-main:orderClickConfirmAPP')))"> |
|
|
|
<u-button type="primary" @click="orderClickApply()" :loading='loading' |
|
|
|
:disabled='loading'>维修确认</u-button> |
|
|
|
</view> |
|
|
@ -430,7 +430,7 @@ |
|
|
|
loading.value = false |
|
|
|
}, 1500) |
|
|
|
} else { |
|
|
|
proxy.$modal.showToast('操作失败') |
|
|
|
proxy.$modal.showToast(res.msg) |
|
|
|
loading.value = false |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
@ -441,7 +441,7 @@ |
|
|
|
/** |
|
|
|
* 维修确认 |
|
|
|
*/ |
|
|
|
async function orderClickConfirm() { |
|
|
|
async function orderClickConfirm(status) { |
|
|
|
isApplyShowSuccess.value = false |
|
|
|
result.value = status |
|
|
|
isShowSuccess.value = false |
|
|
@ -449,43 +449,26 @@ |
|
|
|
number: data.value.number, |
|
|
|
status: data.value.status, |
|
|
|
id: data.value.id, |
|
|
|
result: result.value, |
|
|
|
result: result.value , |
|
|
|
requestNumber: data.value.requestNumber, |
|
|
|
content: data.value.applyContent ? data.value.applyContent : '' |
|
|
|
} |
|
|
|
// 修改工单接口参数 |
|
|
|
const dataTwo = { |
|
|
|
id: data.value && data.value.id ? data.value.id : '', |
|
|
|
describes: data.value.describes, |
|
|
|
type: data.value.type, |
|
|
|
deviceNumber: data.value.deviceNumber, |
|
|
|
factoryAreaNumber: data.value.factoryAreaNumber, |
|
|
|
classes: data.value.classes, |
|
|
|
faultType: data.value.faultType |
|
|
|
} |
|
|
|
// 如果直接点击完成先走修改工单接口 |
|
|
|
await repairOrderApi.orderClickConfirm(dataTwo).then((res) => { }).catch(() => { |
|
|
|
proxy.$modal.closeLoading() |
|
|
|
loading.value = false |
|
|
|
}) |
|
|
|
proxy.$modal.confirm('是否完成?').then(async () => { |
|
|
|
proxy.$modal.loading('加载中') |
|
|
|
loading.value = true |
|
|
|
await repairOrderApi.orderClickFinish(dataOne).then((res) => { |
|
|
|
if (res.data) { |
|
|
|
proxy.$modal.showToast('操作成功') |
|
|
|
setTimeout(() => { |
|
|
|
proxy.$tab.navigateBack() |
|
|
|
loading.value = false |
|
|
|
}, 1500) |
|
|
|
} else { |
|
|
|
proxy.$modal.showToast('操作失败') |
|
|
|
proxy.$modal.loading('加载中') |
|
|
|
loading.value = true |
|
|
|
await repairOrderApi.orderClickConfirm(dataOne, type.value).then((res) => { |
|
|
|
if (res.data) { |
|
|
|
proxy.$modal.showToast('操作成功') |
|
|
|
setTimeout(() => { |
|
|
|
proxy.$tab.navigateBack() |
|
|
|
loading.value = false |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
proxy.$modal.closeLoading() |
|
|
|
}, 1500) |
|
|
|
} else { |
|
|
|
proxy.$modal.showToast(res.msg) |
|
|
|
loading.value = false |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
proxy.$modal.closeLoading() |
|
|
|
loading.value = false |
|
|
|
}) |
|
|
|
} |
|
|
|
/** |
|
|
@ -501,22 +484,6 @@ |
|
|
|
requestNumber: data.value.requestNumber, |
|
|
|
content: data.value.applyContent ? data.value.applyContent : '' |
|
|
|
} |
|
|
|
// 修改工单接口参数 |
|
|
|
const dataTwo = { |
|
|
|
id: data.value && data.value.id ? data.value.id : '', |
|
|
|
describes: data.value.describes, |
|
|
|
type: data.value.type, |
|
|
|
deviceNumber: data.value.deviceNumber, |
|
|
|
factoryAreaNumber: data.value.factoryAreaNumber, |
|
|
|
classes: data.value.classes, |
|
|
|
faultType: data.value.faultType |
|
|
|
} |
|
|
|
// 如果直接点击完成先走修改工单接口 |
|
|
|
await repairOrderApi.repairOrderUpdate(dataTwo, type.value).then((res) => { }).catch(() => { |
|
|
|
proxy.$modal.closeLoading() |
|
|
|
loading.value = false |
|
|
|
}) |
|
|
|
proxy.$modal.confirm('是否完成?').then(async () => { |
|
|
|
proxy.$modal.loading('加载中') |
|
|
|
loading.value = true |
|
|
|
await repairOrderApi.orderClickVerify(dataOne, type.value).then((res) => { |
|
|
@ -527,14 +494,13 @@ |
|
|
|
loading.value = false |
|
|
|
}, 1500) |
|
|
|
} else { |
|
|
|
proxy.$modal.showToast('操作失败') |
|
|
|
proxy.$modal.showToast(res.msg) |
|
|
|
loading.value = false |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
proxy.$modal.closeLoading() |
|
|
|
loading.value = false |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
// APP维修工单接单、点击完成、验证 |
|
|
|
// async function orderClick(type1) { |
|
|
@ -656,7 +622,7 @@ |
|
|
|
await getDeviceRepairDetailsByNumber() |
|
|
|
loading.value = false |
|
|
|
} else { |
|
|
|
proxy.$modal.showToast('操作失败') |
|
|
|
proxy.$modal.showToast(res.msg) |
|
|
|
loading.value = false |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
@ -770,7 +736,7 @@ |
|
|
|
}) |
|
|
|
} |
|
|
|
async function getDeviceRepairDetail(number) { |
|
|
|
await repairOrderApi.getDeviceRepairDetail(number,type.value).then((res) => { |
|
|
|
await repairOrderApi.getDeviceRepairDetail(number, type.value).then((res) => { |
|
|
|
proxy.$modal.closeLoading() |
|
|
|
data.value = res.data |
|
|
|
if (data.value.requestNumber) { |
|
|
|