diff --git a/src/api/report.js b/src/api/report.js index d18ccfb..c386e02 100644 --- a/src/api/report.js +++ b/src/api/report.js @@ -16,9 +16,9 @@ export function repairPage(params,type) { if(type == 'DEVICE'){ return http.get('/eam/device-repair-request/getAppPage',{params}) }else if(type == 'MOLD'){ - return http.post('/eam/mold-repair-request/getAppPage',{params}) + return http.get('/eam/mold-repair-request/getAppPage',{params}) }else if(type == 'TECH'){ - return http.post('/eam/tech-repair-request/getAppPage',{params}) + return http.get('/eam/tech-repair-request/getAppPage',{params}) } } // 撤销 @@ -26,8 +26,8 @@ export function repairCancel(id,type) { if(type == 'DEVICE'){ return http.delete('/eam/device-repair-request/cancel?id='+id) }else if(type == 'MOLD'){ - return http.post('/eam/mold-repair-request/cancel?id='+id) + return http.delete('/eam/mold-repair-request/cancel?id='+id) }else if(type == 'TECH'){ - return http.post('/eam/tech-repair-request/cancel?id='+id) + return http.delete('/eam/tech-repair-request/cancel?id='+id) } } diff --git a/src/pages/deviceReport/index.vue b/src/pages/deviceReport/index.vue index 3620cd2..9173e5a 100644 --- a/src/pages/deviceReport/index.vue +++ b/src/pages/deviceReport/index.vue @@ -4,8 +4,7 @@ @@ -44,7 +43,13 @@ type="primary" shape='circle' /> - 撤销 + 撤销 diff --git a/src/pages/deviceReport/myDeviceReport.vue b/src/pages/deviceReport/myDeviceReport.vue index 1d88bbc..868849c 100644 --- a/src/pages/deviceReport/myDeviceReport.vue +++ b/src/pages/deviceReport/myDeviceReport.vue @@ -59,7 +59,7 @@ ref, getCurrentInstance } from 'vue' - import * as deviceApi from "@/api/device.js" + import * as reportApi from "@/api/report.js" const { proxy } = getCurrentInstance() const params = ref({ pageNo: 1, @@ -72,7 +72,7 @@ if (status.value == 'nomore') return; status.value = 'loading'; proxy.$modal.loading('加载中') - await deviceApi.deviceRepairPage(params.value).then((res) => { + await reportApi.repairPage(params.value,'DEVICE').then((res) => { proxy.$modal.closeLoading() if (res.data.list.length > 0) { list.value = list.value.concat(res.data.list); diff --git a/src/pages/index.vue b/src/pages/index.vue index 3118b01..e36c992 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -162,16 +162,20 @@ await proxy.$onLaunched; if (getAccessToken()) { meaus.value = store.meaus - if(meaus.value&&meaus.value[3]&&meaus.value[3].children){ - isShowItemApprove1.value = meaus.value[3].children.some(item=>{ + console.log(meaus.value) + let isHave = meaus.value.find (item=>item.path == 'parePartsManagement') + let isHaveIndex = meaus.value.findIndex (item=>item.path == 'parePartsManagement') + if(isHave&&isHave.children){ + isShowItemApprove1.value = isHave.children.some(item=>{ return item.componentName == 'itemApprove1' }) - isShowItemApprove2.value = meaus.value[3].children.some(item=>{ + isShowItemApprove2.value = isHave.children.some(item=>{ return item.componentName == 'itemApprove2' }) await sparePartsApplicationApprovePage() await sparePartsApplicationApprovePage1() - + console.log(isShowItemApprove1.value) + console.log(isShowItemApprove2.value) // 如果只有一级审核 、待审核数量等于一级审核数量 if(isShowItemApprove1.value && !isShowItemApprove2.value){ number.value =number1.value @@ -182,7 +186,7 @@ } // 如果一级审核二级审核都存在 待审核数量等于二级审核数量 if(isShowItemApprove1.value && isShowItemApprove2.value){ - meaus.value[3].children.splice(1,1) + meaus.value[isHaveIndex].children.splice(1,1) number.value =number2.value } } diff --git a/src/pages/overhaulOrder/addForm.vue b/src/pages/overhaulOrder/addForm.vue index b1e3d1c..4f36151 100644 --- a/src/pages/overhaulOrder/addForm.vue +++ b/src/pages/overhaulOrder/addForm.vue @@ -142,7 +142,7 @@ //维修人员 const selecUserList = ref([])//维修人员 const isShowSelecUser = ref(false) - const chooseUserInfo = ref({}) + const chooseUserInfo = ref(null) function submit() { // 校验 if (!form.value.describes) { @@ -393,6 +393,10 @@ } // 选择人员 function chooseUser() { + if(!chooseUserInfo.value){ + proxy.$modal.showToast('请选择人员') + return; + } form.value[field.value] = chooseUserInfo.value isShowSelecUser.value = false } diff --git a/src/pages/overhaulOrder/index.vue b/src/pages/overhaulOrder/index.vue index 40a4815..0a69431 100644 --- a/src/pages/overhaulOrder/index.vue +++ b/src/pages/overhaulOrder/index.vue @@ -5,7 +5,7 @@ title="检修工单"> diff --git a/src/pages/repairOrder/detail.vue b/src/pages/repairOrder/detail.vue index c36a910..7a4545e 100644 --- a/src/pages/repairOrder/detail.vue +++ b/src/pages/repairOrder/detail.vue @@ -9,7 +9,7 @@ v-if="data.status == 'PECEIVED' && (!serviceList || serviceList && serviceList.length == 0)">转办 --> + 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')))"> 转办 @@ -207,23 +207,23 @@ + 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')))"> 接单 修改工单 + :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'))">修改工单 + 完成 + 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'))">完成 + 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')))"> 验证 + 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')))"> 维修确认 @@ -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) { diff --git a/src/pages/repairOrder/index.vue b/src/pages/repairOrder/index.vue index c71176d..cb4dd2e 100644 --- a/src/pages/repairOrder/index.vue +++ b/src/pages/repairOrder/index.vue @@ -4,7 +4,7 @@ diff --git a/src/pages/repairOrder/myOrder.vue b/src/pages/repairOrder/myOrder.vue index 6873fe3..01e323a 100644 --- a/src/pages/repairOrder/myOrder.vue +++ b/src/pages/repairOrder/myOrder.vue @@ -95,7 +95,7 @@ if (status.value == 'nomore') return; status.value = 'loading'; proxy.$modal.loading('加载中') - await repairOrderApi.repairOrderPage(params.value).then((res) => { + await repairOrderApi.repairOrderPage(params.value,'DEVICE').then((res) => { proxy.$modal.closeLoading() if (res.data.list.length > 0) { list.value = list.value.concat(res.data.list); diff --git a/src/pages/repairOrder/transfer.vue b/src/pages/repairOrder/transfer.vue index 51121d5..e15a05f 100644 --- a/src/pages/repairOrder/transfer.vue +++ b/src/pages/repairOrder/transfer.vue @@ -174,7 +174,7 @@ proxy.$modal.confirm('是否转办维修工单').then(() => { proxy.$modal.loading('加载中') loading.value = true - repairOrderApi.transfer(paramsData).then((res) => { + repairOrderApi.transfer(paramsData,type.value).then((res) => { proxy.$modal.closeLoading() if (res.data) { proxy.$modal.showToast('转办成功') diff --git a/src/pages/sparePartsApplication/detail.vue b/src/pages/sparePartsApplication/detail.vue index 2aade75..96fcf2b 100644 --- a/src/pages/sparePartsApplication/detail.vue +++ b/src/pages/sparePartsApplication/detail.vue @@ -38,8 +38,8 @@ - - + + diff --git a/src/pages/sparePartsApplication/index.vue b/src/pages/sparePartsApplication/index.vue index b99a020..8c0738e 100644 --- a/src/pages/sparePartsApplication/index.vue +++ b/src/pages/sparePartsApplication/index.vue @@ -4,7 +4,7 @@ @@ -41,7 +41,7 @@ 撤回 + v-if="item.status==0&&auth.hasPermi('eam:item-apply-request-main:cancelAPP')" @click="cancle(item)">撤回 diff --git a/src/pages/sparePartsApplicationApprove/index.vue b/src/pages/sparePartsApplicationApprove/index.vue index 690e2eb..cd4d4cb 100644 --- a/src/pages/sparePartsApplicationApprove/index.vue +++ b/src/pages/sparePartsApplicationApprove/index.vue @@ -38,9 +38,9 @@ 驳回 + v-if="item.status==0&&((from==2&&auth.hasPermi('eam:item-apply-request-main:role0APP'))||(from==3&&auth.hasPermi('eam:item-apply-request-main:role1APP')))" @click="reject(item)">驳回 通过 + v-if="item.status==0&&((from==2&&auth.hasPermi('eam:item-apply-request-main:role0APP'))||(from==3&&auth.hasPermi('eam:item-apply-request-main:role1APP')))" @click="agree(item)">通过 diff --git a/src/pages/spotCheckOrder/detail.vue b/src/pages/spotCheckOrder/detail.vue index a812bd1..b9694fd 100644 --- a/src/pages/spotCheckOrder/detail.vue +++ b/src/pages/spotCheckOrder/detail.vue @@ -95,7 +95,7 @@ + v-if="(data.status == 'COMPLETED' || data.status =='APPLYPASS' || data.status =='APPLYREJECTED')&& ((type=='DEVICE'&&auth.hasPermi('eam:device-spot-inspection-record-main:orderClickVerifyAPP'))||(type=='MOLD'&&auth.hasPermi('eam:mold-spot-inspection-record-main:orderClickVerifyAPP'))||(type=='TECH'&&auth.hasPermi('eam:tech-spot-inspection-record-main:orderClickVerifyAPP')))"> 验证 diff --git a/src/pages/spotCheckOrder/index.vue b/src/pages/spotCheckOrder/index.vue index 33fc37a..186274a 100644 --- a/src/pages/spotCheckOrder/index.vue +++ b/src/pages/spotCheckOrder/index.vue @@ -4,7 +4,7 @@ diff --git a/src/pages/spotCheckOrder/myOrder.vue b/src/pages/spotCheckOrder/myOrder.vue index eb620cd..f45162d 100644 --- a/src/pages/spotCheckOrder/myOrder.vue +++ b/src/pages/spotCheckOrder/myOrder.vue @@ -80,7 +80,7 @@ if (status.value == 'nomore') return; status.value = 'loading'; proxy.$modal.loading('加载中') - await spotCheckOrderApi.spotCheckOrderPage(params.value).then((res) => { + await spotCheckOrderApi.spotCheckOrderPage(params.value,'DEVICE').then((res) => { proxy.$modal.closeLoading() if (res.data.list.length > 0) { list.value = list.value.concat(res.data.list); diff --git a/src/pages/upkeepOrder/detail.vue b/src/pages/upkeepOrder/detail.vue index 1c1875f..745b266 100644 --- a/src/pages/upkeepOrder/detail.vue +++ b/src/pages/upkeepOrder/detail.vue @@ -142,13 +142,13 @@ 接单 完成 验证 diff --git a/src/pages/upkeepOrder/myOrder.vue b/src/pages/upkeepOrder/myOrder.vue index 6292289..a40a2a7 100644 --- a/src/pages/upkeepOrder/myOrder.vue +++ b/src/pages/upkeepOrder/myOrder.vue @@ -89,7 +89,7 @@ if (status.value == 'nomore') return; status.value = 'loading'; proxy.$modal.loading('加载中') - await upkeepOrderApi.upkeepOrderPage(params.value).then((res) => { + await upkeepOrderApi.upkeepOrderPage(params.value,'DEVICE').then((res) => { proxy.$modal.closeLoading() if (res.data.list.length > 0) { list.value = list.value.concat(res.data.list);