|
@ -9,7 +9,8 @@ |
|
|
v-if="data.status == 'PECEIVED' && (!serviceList || serviceList && serviceList.length == 0)">转办 |
|
|
v-if="data.status == 'PECEIVED' && (!serviceList || serviceList && serviceList.length == 0)">转办 |
|
|
</view> --> |
|
|
</view> --> |
|
|
<view @click="transfer" |
|
|
<view @click="transfer" |
|
|
v-if="data.status == 'PECEIVED'">转办 |
|
|
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'])"> |
|
|
|
|
|
转办 |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="dec"> |
|
|
<view class="dec"> |
|
@ -162,8 +163,7 @@ |
|
|
</view> |
|
|
</view> |
|
|
<view class="" @click.stop="delService(item)"> |
|
|
<view class="" @click.stop="delService(item)"> |
|
|
<u-icon name="trash" color="#aaaaaa" size="40" |
|
|
<u-icon name="trash" color="#aaaaaa" size="40" |
|
|
v-if="data.status == 'PECEIVED'" |
|
|
v-if="data.status == 'PECEIVED'"></u-icon> |
|
|
></u-icon> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
@ -198,8 +198,7 @@ |
|
|
</view> |
|
|
</view> |
|
|
<!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> --> |
|
|
<!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> --> |
|
|
</view> |
|
|
</view> |
|
|
<view class="add-btn" |
|
|
<view class="add-btn" v-if="data.status == 'PENDING' || data.status == 'PECEIVED'"> |
|
|
v-if="data.status == 'PENDING' || data.status == 'PECEIVED'"> |
|
|
|
|
|
<u-button type="primary" @click="addSubForm('creat')"><u-icon name="plus-circle" color="#ffffff" |
|
|
<u-button type="primary" @click="addSubForm('creat')"><u-icon name="plus-circle" color="#ffffff" |
|
|
size="36"></u-icon>添加维修内容</u-button> |
|
|
size="36"></u-icon>添加维修内容</u-button> |
|
|
</view> |
|
|
</view> |
|
@ -207,21 +206,26 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="footer"> |
|
|
<view class="footer"> |
|
|
<view class="btns" v-if="data.status == 'PENDING'"> |
|
|
<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'])"> |
|
|
<u-button type="primary" @click="orderClick(1)" :loading='loading' :disabled='loading'>接单</u-button> |
|
|
<u-button type="primary" @click="orderClick(1)" :loading='loading' :disabled='loading'>接单</u-button> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="btns" v-if="data.status == 'PECEIVED'"> |
|
|
<view class="btns" v-if="data.status == 'PECEIVED'"> |
|
|
<u-button shape="shape" type="warning" style="min-width: 120rpx;" :loading='loading1' @click="editForm" |
|
|
<u-button shape="shape" type="warning" style="min-width: 120rpx;" :loading='loading1' @click="editForm" |
|
|
:disabled='loading1'>修改工单</u-button> |
|
|
:disabled='loading1' |
|
|
<u-button type="primary" @click="orderClickSuccess()" :loading='loading' |
|
|
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='loading'>完成</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> |
|
|
</view> |
|
|
</view> |
|
|
<view class="btns" v-if="(data.status == 'COMPLETED' && !data.requestNumber) || (data.status == 'APPLYPASS')"> |
|
|
<view class="btns" |
|
|
<u-button type="primary" @click="orderClickVerify()" :loading='loading' :disabled='loading'>验证</u-button> |
|
|
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'])"> |
|
|
|
|
|
<u-button type="primary" @click="verify()" :loading='loading' :disabled='loading'>验证</u-button> |
|
|
</view> |
|
|
</view> |
|
|
<view class="btns" v-if="data.status == 'COMPLETED' && data.requestNumber && data.applyer == store.id"> |
|
|
<view class="btns" |
|
|
<u-button type="primary" @click="orderClickApply()" :loading='loading' :disabled='loading'>维修确认</u-button> |
|
|
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'])"> |
|
|
|
|
|
<u-button type="primary" @click="orderClickApply()" :loading='loading' |
|
|
|
|
|
:disabled='loading'>维修确认</u-button> |
|
|
</view> |
|
|
</view> |
|
|
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
|
|
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
|
|
</view> |
|
|
</view> |
|
@ -237,7 +241,7 @@ |
|
|
</view> |
|
|
</view> |
|
|
<view class="popup-footer"> |
|
|
<view class="popup-footer"> |
|
|
<view @click="isShowSuccess = false">取消</view> |
|
|
<view @click="isShowSuccess = false">取消</view> |
|
|
<view class="sure" @click="sure">确认</view> |
|
|
<view class="sure" @click="orderClickFinish">确认</view> |
|
|
</view> |
|
|
</view> |
|
|
</u-popup> |
|
|
</u-popup> |
|
|
|
|
|
|
|
@ -249,7 +253,7 @@ |
|
|
</view> |
|
|
</view> |
|
|
<view class="popup-footer"> |
|
|
<view class="popup-footer"> |
|
|
<view @click="cancel">取消</view> |
|
|
<view @click="cancel">取消</view> |
|
|
<view class="sure" @click="verify">确认</view> |
|
|
<view class="sure" @click="orderClickVerify">确认</view> |
|
|
</view> |
|
|
</view> |
|
|
</u-popup> |
|
|
</u-popup> |
|
|
|
|
|
|
|
@ -260,8 +264,8 @@ |
|
|
<textarea v-model="data.applyContent" placeholder="请输入内容"></textarea> |
|
|
<textarea v-model="data.applyContent" placeholder="请输入内容"></textarea> |
|
|
</view> |
|
|
</view> |
|
|
<view class="popup-footer"> |
|
|
<view class="popup-footer"> |
|
|
<view class="sure" @click="apply('APPLYPASS')">通过</view> |
|
|
<view class="sure" @click="orderClickConfirm('APPLYPASS')">通过</view> |
|
|
<view class="reject" @click="apply('APPLYREJECTED')" style="color: red;">驳回</view> |
|
|
<view class="reject" @click="orderClickConfirm('APPLYREJECTED')" style="color: red;">驳回</view> |
|
|
</view> |
|
|
</view> |
|
|
</u-popup> |
|
|
</u-popup> |
|
|
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
|
|
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
|
@ -283,6 +287,7 @@ |
|
|
import * as dictApi from "@/api/dict.js" |
|
|
import * as dictApi from "@/api/dict.js" |
|
|
import * as repairOrderApi from "@/api/repairOrder.js" |
|
|
import * as repairOrderApi from "@/api/repairOrder.js" |
|
|
import { useCountStore } from '@/store' |
|
|
import { useCountStore } from '@/store' |
|
|
|
|
|
import auth from '@/plugins/auth' |
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() |
|
|
const { proxy } = getCurrentInstance() |
|
|
// 获取自定义的store |
|
|
// 获取自定义的store |
|
@ -376,7 +381,7 @@ |
|
|
/** |
|
|
/** |
|
|
* 点击验证完结填写意见 |
|
|
* 点击验证完结填写意见 |
|
|
*/ |
|
|
*/ |
|
|
function orderClickVerify() { |
|
|
function verify() { |
|
|
data.value.applyContent = null; |
|
|
data.value.applyContent = null; |
|
|
isVerifyShowSuccess.value = true |
|
|
isVerifyShowSuccess.value = true |
|
|
} |
|
|
} |
|
@ -389,45 +394,110 @@ |
|
|
function radioGroupChange(e) { |
|
|
function radioGroupChange(e) { |
|
|
result.value = e |
|
|
result.value = e |
|
|
} |
|
|
} |
|
|
function sure() { |
|
|
// 完成 |
|
|
|
|
|
async function orderClickFinish() { |
|
|
isShowSuccess.value = false |
|
|
isShowSuccess.value = false |
|
|
orderClick(2) |
|
|
const dataOne = { |
|
|
|
|
|
number: data.value.number, |
|
|
|
|
|
status: data.value.status, |
|
|
|
|
|
id: data.value.id, |
|
|
|
|
|
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.repairOrderUpdate(dataTwo, type.value).then((res) => { }).catch(() => { |
|
|
|
|
|
proxy.$modal.closeLoading() |
|
|
|
|
|
loading.value = false |
|
|
|
|
|
}) |
|
|
|
|
|
proxy.$modal.loading('加载中') |
|
|
|
|
|
loading.value = true |
|
|
|
|
|
await repairOrderApi.orderClickFinish(dataOne, type.value).then((res) => { |
|
|
|
|
|
if (res.data) { |
|
|
|
|
|
proxy.$modal.showToast('操作成功') |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
proxy.$tab.navigateBack() |
|
|
|
|
|
loading.value = false |
|
|
|
|
|
}, 1500) |
|
|
|
|
|
} else { |
|
|
|
|
|
proxy.$modal.showToast('操作失败') |
|
|
|
|
|
loading.value = false |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
proxy.$modal.closeLoading() |
|
|
|
|
|
loading.value = false |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
/** |
|
|
/** |
|
|
* 维修确认 |
|
|
* 维修确认 |
|
|
*/ |
|
|
*/ |
|
|
function apply(status) { |
|
|
async function orderClickConfirm() { |
|
|
isApplyShowSuccess.value = false |
|
|
isApplyShowSuccess.value = false |
|
|
result.value = status |
|
|
result.value = status |
|
|
orderClick(3) |
|
|
isShowSuccess.value = false |
|
|
|
|
|
const dataOne = { |
|
|
|
|
|
number: data.value.number, |
|
|
|
|
|
status: data.value.status, |
|
|
|
|
|
id: data.value.id, |
|
|
|
|
|
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('操作失败') |
|
|
|
|
|
loading.value = false |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
proxy.$modal.closeLoading() |
|
|
|
|
|
loading.value = false |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
/** |
|
|
/** |
|
|
* 验证确认 |
|
|
* 验证确认 |
|
|
*/ |
|
|
*/ |
|
|
function verify() { |
|
|
async function orderClickVerify() { |
|
|
isVerifyShowSuccess.value = false |
|
|
isVerifyShowSuccess.value = false |
|
|
orderClick(2) |
|
|
|
|
|
} |
|
|
|
|
|
// APP维修工单接单、点击完成、验证 |
|
|
|
|
|
async function orderClick(type1) { |
|
|
|
|
|
// 如果是接单 |
|
|
|
|
|
// if (this.data.status == 'PENDING') { |
|
|
|
|
|
// if (this.$store.state.user.dept.parentId != this.data.factoryAreaNumber) { |
|
|
|
|
|
// this.$modal.showToast('当前人员厂区与工单来源的厂区不一致') |
|
|
|
|
|
// return; |
|
|
|
|
|
// } |
|
|
|
|
|
// if (this.$store.state.user.dept.classType != this.data.type) { |
|
|
|
|
|
// this.$modal.showToast('当前人员班组与工单类型不一致') |
|
|
|
|
|
// return; |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const dataOne = { |
|
|
const dataOne = { |
|
|
number: data.value.number, |
|
|
number: data.value.number, |
|
|
status: data.value.status, |
|
|
status: data.value.status, |
|
|
id: data.value.id, |
|
|
id: data.value.id, |
|
|
result: type1 == 2||type1 == 3 ? result.value : '', |
|
|
result: result.value, |
|
|
requestNumber: data.value.requestNumber, |
|
|
requestNumber: data.value.requestNumber, |
|
|
content: data.value.applyContent ? data.value.applyContent : '' |
|
|
content: data.value.applyContent ? data.value.applyContent : '' |
|
|
} |
|
|
} |
|
@ -441,30 +511,19 @@ |
|
|
classes: data.value.classes, |
|
|
classes: data.value.classes, |
|
|
faultType: data.value.faultType |
|
|
faultType: data.value.faultType |
|
|
} |
|
|
} |
|
|
let tips = data.value.status == 'PENDING' ? '是否接单?' : data.value.status == 'PECEIVED' ? '是否完成?' : data.value.status == 'COMPLETED' && data.value.requestNumber && data.value.applyer == store.id ? '是否确认提交?' :data.value.status == 'COMPLETED' && !data.value.requestNumber ? '是否验证完结?':data.value.status == 'APPLYPASS' ? '是否验证完结?':'' |
|
|
|
|
|
if(type1 == 2 || type1 ==3){ |
|
|
|
|
|
// 如果直接点击完成先走修改工单接口 |
|
|
// 如果直接点击完成先走修改工单接口 |
|
|
if (data.value.status == 'PECEIVED') { |
|
|
await repairOrderApi.repairOrderUpdate(dataTwo, type.value).then((res) => { }).catch(() => { |
|
|
await repairOrderApi.repairOrderUpdate(dataTwo).then((res) => { }).catch(() => { |
|
|
|
|
|
proxy.$modal.closeLoading() |
|
|
proxy.$modal.closeLoading() |
|
|
loading.value = false |
|
|
loading.value = false |
|
|
}) |
|
|
}) |
|
|
} |
|
|
proxy.$modal.confirm('是否完成?').then(async () => { |
|
|
proxy.$modal.confirm(tips).then(async () => { |
|
|
|
|
|
proxy.$modal.loading('加载中') |
|
|
proxy.$modal.loading('加载中') |
|
|
loading.value = true |
|
|
loading.value = true |
|
|
await repairOrderApi.orderClick(dataOne).then((res) => { |
|
|
await repairOrderApi.orderClickVerify(dataOne, type.value).then((res) => { |
|
|
if (res.data) { |
|
|
if (res.data) { |
|
|
proxy.$modal.showToast('操作成功') |
|
|
proxy.$modal.showToast('操作成功') |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
if(type1==3){ |
|
|
|
|
|
// proxy.$tab.navigateTo(`/pages/repairOrder/index?type=${type.value}&flag=2`) |
|
|
|
|
|
proxy.$tab.navigateBack() |
|
|
proxy.$tab.navigateBack() |
|
|
}else{ |
|
|
|
|
|
// proxy.$tab.navigateTo(`/pages/repairOrder/index?type=${type.value}`) |
|
|
|
|
|
proxy.$tab.navigateBack() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
loading.value = false |
|
|
loading.value = false |
|
|
}, 1500) |
|
|
}, 1500) |
|
|
} else { |
|
|
} else { |
|
@ -476,27 +535,126 @@ |
|
|
loading.value = false |
|
|
loading.value = false |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}else{ |
|
|
} |
|
|
proxy.$modal.confirm(tips).then(async () => { |
|
|
// APP维修工单接单、点击完成、验证 |
|
|
|
|
|
// async function orderClick(type1) { |
|
|
|
|
|
// // 如果是接单 |
|
|
|
|
|
// // if (this.data.status == 'PENDING') { |
|
|
|
|
|
// // if (this.$store.state.user.dept.parentId != this.data.factoryAreaNumber) { |
|
|
|
|
|
// // this.$modal.showToast('当前人员厂区与工单来源的厂区不一致') |
|
|
|
|
|
// // return; |
|
|
|
|
|
// // } |
|
|
|
|
|
// // if (this.$store.state.user.dept.classType != this.data.type) { |
|
|
|
|
|
// // this.$modal.showToast('当前人员班组与工单类型不一致') |
|
|
|
|
|
// // return; |
|
|
|
|
|
// // } |
|
|
|
|
|
// // } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const dataOne = { |
|
|
|
|
|
// number: data.value.number, |
|
|
|
|
|
// status: data.value.status, |
|
|
|
|
|
// id: data.value.id, |
|
|
|
|
|
// result: type1 == 2||type1 == 3 ? 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 |
|
|
|
|
|
// } |
|
|
|
|
|
// let tips = data.value.status == 'PENDING' ? '是否接单?' : data.value.status == 'PECEIVED' ? '是否完成?' : data.value.status == 'COMPLETED' && data.value.requestNumber && data.value.applyer == store.id ? '是否确认提交?' :data.value.status == 'COMPLETED' && !data.value.requestNumber ? '是否验证完结?':data.value.status == 'APPLYPASS' ? '是否验证完结?':'' |
|
|
|
|
|
// if(type1 == 2 || type1 ==3){ |
|
|
|
|
|
// // 如果直接点击完成先走修改工单接口 |
|
|
|
|
|
// if (data.value.status == 'PECEIVED') { |
|
|
|
|
|
// await repairOrderApi.repairOrderUpdate(dataTwo).then((res) => { }).catch(() => { |
|
|
|
|
|
// proxy.$modal.closeLoading() |
|
|
|
|
|
// loading.value = false |
|
|
|
|
|
// }) |
|
|
|
|
|
// } |
|
|
|
|
|
// proxy.$modal.confirm(tips).then(async () => { |
|
|
|
|
|
// proxy.$modal.loading('加载中') |
|
|
|
|
|
// loading.value = true |
|
|
|
|
|
// await repairOrderApi.orderClick(dataOne).then((res) => { |
|
|
|
|
|
// if (res.data) { |
|
|
|
|
|
// proxy.$modal.showToast('操作成功') |
|
|
|
|
|
// setTimeout(() => { |
|
|
|
|
|
// if(type1==3){ |
|
|
|
|
|
// // proxy.$tab.navigateTo(`/pages/repairOrder/index?type=${type.value}&flag=2`) |
|
|
|
|
|
// proxy.$tab.navigateBack() |
|
|
|
|
|
// }else{ |
|
|
|
|
|
// // proxy.$tab.navigateTo(`/pages/repairOrder/index?type=${type.value}`) |
|
|
|
|
|
// proxy.$tab.navigateBack() |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// loading.value = false |
|
|
|
|
|
// }, 1500) |
|
|
|
|
|
// } else { |
|
|
|
|
|
// proxy.$modal.showToast('操作失败') |
|
|
|
|
|
// loading.value = false |
|
|
|
|
|
// } |
|
|
|
|
|
// }).catch(() => { |
|
|
|
|
|
// proxy.$modal.closeLoading() |
|
|
|
|
|
// loading.value = false |
|
|
|
|
|
// }) |
|
|
|
|
|
// }) |
|
|
|
|
|
// }else{ |
|
|
|
|
|
// proxy.$modal.confirm(tips).then(async () => { |
|
|
|
|
|
// proxy.$modal.loading('加载中') |
|
|
|
|
|
// loading.value = true |
|
|
|
|
|
// // 如果直接点击完成先走修改工单接口 |
|
|
|
|
|
// if (data.value.status == 'PECEIVED') { |
|
|
|
|
|
// await repairOrderApi.repairOrderUpdate(dataTwo).then((res) => { }).catch(() => { |
|
|
|
|
|
// proxy.$modal.closeLoading() |
|
|
|
|
|
// loading.value = false |
|
|
|
|
|
// }) |
|
|
|
|
|
// } |
|
|
|
|
|
// await repairOrderApi.orderClick(dataOne).then(async(res) => { |
|
|
|
|
|
// if (res.data) { |
|
|
|
|
|
// proxy.$modal.showToast('操作成功') |
|
|
|
|
|
// await getDeviceRepairDetail(number.value) |
|
|
|
|
|
// await getDeviceRepairDetailsByNumber() |
|
|
|
|
|
// loading.value = false |
|
|
|
|
|
// // setTimeout(() => { |
|
|
|
|
|
// // // proxy.$tab.navigateBack() |
|
|
|
|
|
|
|
|
|
|
|
// // }, 1500) |
|
|
|
|
|
// } else { |
|
|
|
|
|
// proxy.$modal.showToast('操作失败') |
|
|
|
|
|
// loading.value = false |
|
|
|
|
|
// } |
|
|
|
|
|
// }).catch(() => { |
|
|
|
|
|
// proxy.$modal.closeLoading() |
|
|
|
|
|
// loading.value = false |
|
|
|
|
|
// }) |
|
|
|
|
|
// }) |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// 点击接单 |
|
|
|
|
|
async function orderClick() { |
|
|
|
|
|
const dataOne = { |
|
|
|
|
|
number: data.value.number, |
|
|
|
|
|
status: data.value.status, |
|
|
|
|
|
id: data.value.id, |
|
|
|
|
|
result: '', |
|
|
|
|
|
requestNumber: data.value.requestNumber, |
|
|
|
|
|
content: data.value.applyContent ? data.value.applyContent : '' |
|
|
|
|
|
} |
|
|
|
|
|
proxy.$modal.confirm('是否接单').then(async () => { |
|
|
proxy.$modal.loading('加载中') |
|
|
proxy.$modal.loading('加载中') |
|
|
loading.value = true |
|
|
loading.value = true |
|
|
// 如果直接点击完成先走修改工单接口 |
|
|
await repairOrderApi.orderClick(dataOne, type.value).then(async (res) => { |
|
|
if (data.value.status == 'PECEIVED') { |
|
|
|
|
|
await repairOrderApi.repairOrderUpdate(dataTwo).then((res) => { }).catch(() => { |
|
|
|
|
|
proxy.$modal.closeLoading() |
|
|
|
|
|
loading.value = false |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
await repairOrderApi.orderClick(dataOne).then(async(res) => { |
|
|
|
|
|
if (res.data) { |
|
|
if (res.data) { |
|
|
proxy.$modal.showToast('操作成功') |
|
|
proxy.$modal.showToast('操作成功') |
|
|
await getDeviceRepairDetail(number.value) |
|
|
await getDeviceRepairDetail(number.value) |
|
|
await getDeviceRepairDetailsByNumber() |
|
|
await getDeviceRepairDetailsByNumber() |
|
|
loading.value = false |
|
|
loading.value = false |
|
|
// setTimeout(() => { |
|
|
|
|
|
// // proxy.$tab.navigateBack() |
|
|
|
|
|
|
|
|
|
|
|
// }, 1500) |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
proxy.$modal.showToast('操作失败') |
|
|
proxy.$modal.showToast('操作失败') |
|
|
loading.value = false |
|
|
loading.value = false |
|
@ -507,14 +665,14 @@ |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
// 获取维修报修信息 |
|
|
// 获取维修报修信息 |
|
|
async function getDeviceRepairDetailsByNumber() { |
|
|
async function getDeviceRepairDetailsByNumber() { |
|
|
if (data.value.requestNumber) { |
|
|
if (data.value.requestNumber) { |
|
|
await repairOrderApi.getDeviceRepairDetailsByNumber({ |
|
|
await repairOrderApi.getDeviceRepairDetailsByNumber({ |
|
|
type: type.value, |
|
|
type: type.value, |
|
|
requestNumber: data.value.requestNumber |
|
|
requestNumber: data.value.requestNumber |
|
|
}).then((res) => { |
|
|
}, type.value).then((res) => { |
|
|
if (res.data) { |
|
|
if (res.data) { |
|
|
data1.value = res.data |
|
|
data1.value = res.data |
|
|
} |
|
|
} |
|
@ -524,8 +682,8 @@ |
|
|
// 获取维修内容列表 |
|
|
// 获取维修内容列表 |
|
|
function getRepairOrderDetaiList() { |
|
|
function getRepairOrderDetaiList() { |
|
|
repairOrderApi.repairOrderDetailList({ |
|
|
repairOrderApi.repairOrderDetailList({ |
|
|
number: number.value |
|
|
number: number.value, |
|
|
}).then((res) => { |
|
|
}, type.value).then((res) => { |
|
|
if (res.data) { |
|
|
if (res.data) { |
|
|
serviceList.value = res.data |
|
|
serviceList.value = res.data |
|
|
} |
|
|
} |
|
@ -593,7 +751,7 @@ |
|
|
proxy.$modal.confirm('是否修改维修工单').then(() => { |
|
|
proxy.$modal.confirm('是否修改维修工单').then(() => { |
|
|
proxy.$modal.loading('加载中') |
|
|
proxy.$modal.loading('加载中') |
|
|
loading1.value = true |
|
|
loading1.value = true |
|
|
repairOrderApi.repairOrderUpdate(paramesData).then((res) => { |
|
|
repairOrderApi.repairOrderUpdate(paramesData, type.value).then((res) => { |
|
|
proxy.$modal.closeLoading() |
|
|
proxy.$modal.closeLoading() |
|
|
if (res.data) { |
|
|
if (res.data) { |
|
|
proxy.$modal.showToast('修改成功') |
|
|
proxy.$modal.showToast('修改成功') |
|
@ -612,10 +770,28 @@ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
async function getDeviceRepairDetail(number) { |
|
|
async function getDeviceRepairDetail(number) { |
|
|
await repairOrderApi.getDeviceRepairDetail(number).then((res) => { |
|
|
await repairOrderApi.getDeviceRepairDetail(number,type.value).then((res) => { |
|
|
proxy.$modal.closeLoading() |
|
|
proxy.$modal.closeLoading() |
|
|
data.value = res.data |
|
|
data.value = res.data |
|
|
if (res.data) { |
|
|
if (data.value.requestNumber) { |
|
|
|
|
|
list.value = [{ |
|
|
|
|
|
name: '设备信息', |
|
|
|
|
|
value: 1 |
|
|
|
|
|
}, { |
|
|
|
|
|
name: '报修信息', |
|
|
|
|
|
value: 2 |
|
|
|
|
|
}, { |
|
|
|
|
|
name: '维修内容', |
|
|
|
|
|
value: 3 |
|
|
|
|
|
}] |
|
|
|
|
|
} else { |
|
|
|
|
|
list.value = [{ |
|
|
|
|
|
name: '设备信息', |
|
|
|
|
|
value: 1 |
|
|
|
|
|
}, { |
|
|
|
|
|
name: '维修内容', |
|
|
|
|
|
value: 3 |
|
|
|
|
|
}] |
|
|
} |
|
|
} |
|
|
loading.value = false |
|
|
loading.value = false |
|
|
}).catch(() => { |
|
|
}).catch(() => { |
|
@ -637,27 +813,7 @@ |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
onShow(async () => { |
|
|
onShow(async () => { |
|
|
if (number.value) { |
|
|
|
|
|
|
|
|
|
|
|
list.value = [{ |
|
|
|
|
|
name: '设备信息', |
|
|
|
|
|
value: 1 |
|
|
|
|
|
}, { |
|
|
|
|
|
name: '报修信息', |
|
|
|
|
|
value: 2 |
|
|
|
|
|
}, { |
|
|
|
|
|
name: '维修内容', |
|
|
|
|
|
value: 3 |
|
|
|
|
|
}] |
|
|
|
|
|
} else { |
|
|
|
|
|
list.value = [{ |
|
|
|
|
|
name: '设备信息', |
|
|
|
|
|
value: 1 |
|
|
|
|
|
}, { |
|
|
|
|
|
name: '维修内容', |
|
|
|
|
|
value: 3 |
|
|
|
|
|
}] |
|
|
|
|
|
} |
|
|
|
|
|
getRepairOrderDetaiList() |
|
|
getRepairOrderDetaiList() |
|
|
maintenanceShift.value = await dictApi.getDict('maintenance_shift') |
|
|
maintenanceShift.value = await dictApi.getDict('maintenance_shift') |
|
|
faultType.value = await dictApi.getDict('fault_type') |
|
|
faultType.value = await dictApi.getDict('fault_type') |
|
|