|
|
|
|
@ -15,14 +15,12 @@ |
|
|
|
|
<view class="info_title">巡检配置</view> |
|
|
|
|
<u-form labelPosition="left" ref="sendOrderForm" :model="detailForm" :label-width="200" class="repair_form"> |
|
|
|
|
<u-form-item label="巡检内容:" prop="dispatchTime" :border-bottom="false"> |
|
|
|
|
|
|
|
|
|
<u-input v-model="detailForm.taskContent" :disabled="true" :border="true" |
|
|
|
|
class="sp-new-input-diabled" /> |
|
|
|
|
|
|
|
|
|
<u-input v-model="detailForm.taskContent" :disabled="true" :border="true" class="sp-new-input-diabled" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="任务开始时间:" prop="dispatchTime" :border-bottom="false"> |
|
|
|
|
|
|
|
|
|
<u-input v-model="detailForm.startTime" :disabled="true" :border="true" |
|
|
|
|
class="sp-new-input-diabled" /> |
|
|
|
|
|
|
|
|
|
<u-input v-model="detailForm.startTime" :disabled="true" :border="true" class="sp-new-input-diabled" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="预约上门时间:" prop="customerOpinion" :border-bottom="false"> |
|
|
|
|
<u-input v-if="reservationDisabled" v-model="reservationTime" type="select" |
|
|
|
|
@ -78,21 +76,11 @@ |
|
|
|
|
</u-collapse-item> |
|
|
|
|
</u-collapse> |
|
|
|
|
</view> |
|
|
|
|
<view class="info" |
|
|
|
|
v-if="detailForm.repairStatus == 100 || detailForm.repairStatus == 101 || detailForm.repairStatus == 102"> |
|
|
|
|
<view class="info_title" v-if="detailForm.repairStatus == 100">维修人员驳回</view> |
|
|
|
|
<view class="info_title" v-if="detailForm.repairStatus == 101">主管驳回</view> |
|
|
|
|
<view class="info_title" v-if="detailForm.repairStatus == 102">客户驳回</view> |
|
|
|
|
<view class="info_item"> |
|
|
|
|
<text class="item_left_txt">驳回原因:</text> |
|
|
|
|
<text class="item_right_txt">{{ detailForm.approveRemark }}</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- 填写内容 --> |
|
|
|
|
<view class="info" v-if="!reservationDisabled"> |
|
|
|
|
<view class="info_title">巡检任务</view> |
|
|
|
|
<u-collapse :accordion="false" ref="collapseTask"> |
|
|
|
|
<u-collapse-item v-for="(item, index) in detailForm.details" :key="index" @change="itemCollapseChange"> |
|
|
|
|
<u-collapse-item v-for="(item, index) in detailForm.details" :key="index"> |
|
|
|
|
<view slot="title"> |
|
|
|
|
<text class="collapse-title">实验室楼层:{{ item.floorName }}</text> |
|
|
|
|
</view> |
|
|
|
|
@ -106,7 +94,7 @@ |
|
|
|
|
<view class="info_item"> |
|
|
|
|
<text class="item_left_txt">状态:</text> |
|
|
|
|
<text class="item_right_txt"> |
|
|
|
|
<u-radio-group v-model="s.status" :disabled="taskDisabled"> |
|
|
|
|
<u-radio-group v-model="s.status"> |
|
|
|
|
<u-radio name="0">正常</u-radio> |
|
|
|
|
<u-radio name="1">异常</u-radio> |
|
|
|
|
</u-radio-group> |
|
|
|
|
@ -117,20 +105,18 @@ |
|
|
|
|
<text class="item_left_txt">现场照片:</text> |
|
|
|
|
<text class="item_right_txt" v-if="s.picUrl == ''"> |
|
|
|
|
|
|
|
|
|
<view class="btn" v-if="!taskDisabled" @click="uploadImg(index, vindex, sindex)">上传照片</view> |
|
|
|
|
<view v-else>无</view> |
|
|
|
|
<view class="btn" @click="uploadImg(index, vindex, sindex)">上传照片</view> |
|
|
|
|
</text> |
|
|
|
|
<text class="item_right_txt" v-else> |
|
|
|
|
<image v-if="!taskDisabled" @click="uploadImg(index, vindex, sindex)" |
|
|
|
|
class="item_right_img" :src="s.picUrl"></image> |
|
|
|
|
<image v-else class="item_right_img" :src="s.picUrl"></image> |
|
|
|
|
<image @click="uploadImg(index, vindex, sindex)" class="item_right_img" |
|
|
|
|
:src="s.picUrl"></image> |
|
|
|
|
</text> |
|
|
|
|
</view> |
|
|
|
|
<view class="info_item"> |
|
|
|
|
<text class="item_left_txt">使用人签字:</text> |
|
|
|
|
<text class="item_right_txt"> |
|
|
|
|
|
|
|
|
|
<u-input :disabled="taskDisabled" :border="true" v-model="s.signUrl" :placeholder="'请输入'" :class="taskDisabled?'sp-new-input-diabled':''" /> |
|
|
|
|
|
|
|
|
|
<u-input :border="true" v-model="s.signUrl" :placeholder="'请输入'" /> |
|
|
|
|
<!-- <image v-if="s.qianzi" :src="s.qianzi" style="width: 144px;height: 77rpx;" |
|
|
|
|
mode="widthFix" @click="toPop1(index, vindex, sindex)"></image> |
|
|
|
|
<view v-else class="btn" @click="toPop1(index, vindex, sindex)">签字</view> --> |
|
|
|
|
@ -139,23 +125,22 @@ |
|
|
|
|
<view class="info_item"> |
|
|
|
|
<text class="item_left_txt">备注:</text> |
|
|
|
|
<text class="item_right_txt"> |
|
|
|
|
|
|
|
|
|
<u-input :disabled="taskDisabled" :border="true" type="textarea" v-model="s.remark" :placeholder="'请输入'" :class="taskDisabled?'sp-new-input-diabled':''" /> |
|
|
|
|
|
|
|
|
|
<u-input :border="true" type="textarea" v-model="s.remark" :placeholder="'请输入'" /> |
|
|
|
|
</text> |
|
|
|
|
</view> |
|
|
|
|
<view class="info_item" |
|
|
|
|
v-if="(dataTypes == 4 && (detailForm.repairStatus == 1 || detailForm.repairStatus == 101))||(dataTypes == 3 && (detailForm.repairStatus == 2 || detailForm.repairStatus == 102))"> |
|
|
|
|
<view class="info_item"> |
|
|
|
|
<text class="item_left_txt">价格:</text> |
|
|
|
|
<text class="item_right_txt"> |
|
|
|
|
<u-input v-model="s.price" type="number" :border="true" :disabled="priceDisabled" :class="priceDisabled?'sp-new-input-diabled':''" /> |
|
|
|
|
<u-input v-model="s.price" type="number" :border="true" /> |
|
|
|
|
</text> |
|
|
|
|
</view> |
|
|
|
|
<view class="info_item" v-if="dataTypes == 1 && detailForm.repairStatus == 3"> |
|
|
|
|
<text class="item_left_txt">是否维修:</text> |
|
|
|
|
<text class="item_right_txt"> |
|
|
|
|
<u-radio-group v-model="s.isRepair"> |
|
|
|
|
<u-radio :name="1">是</u-radio> |
|
|
|
|
<u-radio :name="0">否</u-radio> |
|
|
|
|
<u-radio name="1">是</u-radio> |
|
|
|
|
<u-radio name="0">否</u-radio> |
|
|
|
|
</u-radio-group> |
|
|
|
|
</text> |
|
|
|
|
</view> |
|
|
|
|
@ -176,13 +161,12 @@ |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="意见:" prop="reportPeople" :border-bottom="false" |
|
|
|
|
v-if="approveInfo.approveText == '未完成'"> |
|
|
|
|
<u-input v-model="approveInfo.approveRemark" :border="true" placeholder="请输入" type="textarea" |
|
|
|
|
:height="120" /> |
|
|
|
|
<u-input v-model="approveInfo.approveRemark" :border="true" placeholder="请输入" type="textarea" :height="120" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
</u-form> |
|
|
|
|
</view> |
|
|
|
|
<!-- 维修负责人 巡检维修方案审批 --> |
|
|
|
|
<view class="info" v-if="dataTypes == 3 && (detailForm.repairStatus == 2 || detailForm.repairStatus == 102)"> |
|
|
|
|
<view class="info" v-if="dataTypes == 3 && detailForm.repairStatus == 2"> |
|
|
|
|
<view class="info_title">维修方案审批</view> |
|
|
|
|
<u-form labelPosition="left" ref="repairInfoForm" :model="repairApproveInfo" :label-width="140" |
|
|
|
|
class="repair_form"> |
|
|
|
|
@ -194,8 +178,7 @@ |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="审批意见:" prop="reportPeople" :border-bottom="false" |
|
|
|
|
v-if="repairApproveInfo.approveText == '驳回'"> |
|
|
|
|
<u-input v-model="repairApproveInfo.approveRemark" :border="true" placeholder="请输入" type="textarea" |
|
|
|
|
:height="120" /> |
|
|
|
|
<u-input v-model="repairApproveInfo.approveRemark" :border="true" placeholder="请输入" type="textarea" :height="120" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
</u-form> |
|
|
|
|
</view> |
|
|
|
|
@ -213,46 +196,45 @@ |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="审批意见:" prop="reportPeople" :border-bottom="false" |
|
|
|
|
v-if="customerApproveInfo.approveText == '驳回'"> |
|
|
|
|
<u-input v-model="customerApproveInfo.approveRemark" :border="true" placeholder="请输入" |
|
|
|
|
type="textarea" :height="120" /> |
|
|
|
|
<u-input v-model="customerApproveInfo.approveRemark" :border="true" placeholder="请输入" type="textarea" :height="120" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
</u-form> |
|
|
|
|
</view> |
|
|
|
|
<!-- 维修人员接收任务单 --> |
|
|
|
|
<view class="repair-btn" style="margin-right: 32rpx;width:100%" |
|
|
|
|
v-if="dataTypes == 4 && detailForm.taskStatus == 1 && detailsType == 'task'"> |
|
|
|
|
v-if="dataTypes == 4 && detailForm.taskStatus == 1&&detailsType=='task'"> |
|
|
|
|
<u-button size="medium" @click="endOrderCancel()">取消</u-button> |
|
|
|
|
<u-button size="medium" type="primary" @click="receiveQuest()">接单</u-button> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<!-- 维修人员提交巡检详情 --> |
|
|
|
|
<view class="repair-btn" style="margin-right: 32rpx;width:100%" |
|
|
|
|
v-if="dataTypes == 4 && detailForm.taskStatus == 2 && detailsType == 'task'"> |
|
|
|
|
v-if="dataTypes == 4 && detailForm.taskStatus == 2&&detailsType=='task'"> |
|
|
|
|
<u-button size="medium" @click="endOrderCancel()">取消</u-button> |
|
|
|
|
<u-button size="medium" type="primary" @click="submitQuest()">提交</u-button> |
|
|
|
|
</view> |
|
|
|
|
<!-- 客户 确认巡检任务是否完成提交 --> |
|
|
|
|
<view class="repair-btn" style="margin-right: 32rpx;width:100%" |
|
|
|
|
v-if="dataTypes == 1 && detailForm.taskStatus == 3 && detailsType == 'task'"> |
|
|
|
|
v-if="dataTypes == 1 && detailForm.taskStatus == 3&&detailsType=='task'"> |
|
|
|
|
<u-button size="medium" @click="endOrderCancel()">取消</u-button> |
|
|
|
|
<u-button size="medium" type="primary" @click="customerQuest()">提交</u-button> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<!-- 维修人员 提交维修方案 --> |
|
|
|
|
<view class="repair-btn" style="margin-right: 32rpx;width:100%" |
|
|
|
|
v-if="dataTypes == 4 && (detailForm.repairStatus == 1 || detailForm.repairStatus == 101) && detailsType == 'repair'"> |
|
|
|
|
v-if="dataTypes == 4 && detailForm.repairStatus == 1&&detailsType=='repair'"> |
|
|
|
|
<u-button size="medium" @click="endOrderCancel()">取消</u-button> |
|
|
|
|
<u-button size="medium" type="primary" @click="solutionSubmit()">提交方案</u-button> |
|
|
|
|
</view> |
|
|
|
|
<!-- 维修主管审批 巡检 维修方案 --> |
|
|
|
|
<view class="repair-btn" style="margin-right: 32rpx;width:100%" |
|
|
|
|
v-if="dataTypes == 3 && (detailForm.repairStatus == 2 || detailForm.repairStatus == 102) && detailsType == 'repair'"> |
|
|
|
|
v-if="dataTypes == 3 && detailForm.repairStatus == 2&&detailsType=='repair'"> |
|
|
|
|
<u-button size="medium" @click="endOrderCancel()">取消</u-button> |
|
|
|
|
<u-button size="medium" type="primary" @click="repairApproveSubmit()">提交</u-button> |
|
|
|
|
</view> |
|
|
|
|
<!-- 客户审批 巡检 维修方案 确认是否维修--> |
|
|
|
|
<view class="repair-btn" style="margin-right: 32rpx;width:100%" |
|
|
|
|
v-if="dataTypes == 1 && detailForm.repairStatus == 3 && detailsType == 'repair'"> |
|
|
|
|
v-if="dataTypes == 1 && detailForm.repairStatus == 3&&detailsType=='repair'"> |
|
|
|
|
<u-button size="medium" @click="endOrderCancel()">取消</u-button> |
|
|
|
|
<u-button size="medium" type="primary" @click="customerApproveSubmit()">提交</u-button> |
|
|
|
|
</view> |
|
|
|
|
@ -275,12 +257,6 @@ export default { |
|
|
|
|
reservationDisabled() { |
|
|
|
|
return (this.dataTypes == 4 && this.detailForm.taskStatus == 1) || (this.type == 'view') ? true : false |
|
|
|
|
}, |
|
|
|
|
taskDisabled() { |
|
|
|
|
return (this.dataTypes == 4 && (this.detailForm.taskStatus == 2)) ? false : true |
|
|
|
|
}, |
|
|
|
|
priceDisabled(){ |
|
|
|
|
return this.dataTypes == 4 && (this.detailForm.repairStatus == 1 || this.detailForm.repairStatus == 101)?false:true |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
@ -355,33 +331,19 @@ export default { |
|
|
|
|
this.$u.api.getTaskDetail(query).then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
this.detailForm = res.data |
|
|
|
|
this.updateData(res.data.details) |
|
|
|
|
this.collapseData = JSON.parse(JSON.stringify(res.data.details)) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.$u.api.getRepairDetail(query).then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
this.detailForm = res.data |
|
|
|
|
this.updateData(res.data.details) |
|
|
|
|
this.collapseData = JSON.parse(JSON.stringify(res.data.details)) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
// 处理数据 更改数据价格为-1的数据 |
|
|
|
|
updateData(data) { |
|
|
|
|
if (data.length > 0) { |
|
|
|
|
for (let i = 0; i < data.length; i++) { |
|
|
|
|
data[i].price = data[i].price < 0 ? null : data[i].price |
|
|
|
|
if (data[i].details.length > 0) { |
|
|
|
|
this.updateData(data[i].details) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
endOrderCancel() { |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 // 默认值是1,表示回退一个页面 |
|
|
|
|
@ -421,7 +383,7 @@ export default { |
|
|
|
|
sizeType: ["original", "compressed"], // 可以指定是原图还是压缩图,默认二者都有 |
|
|
|
|
sourceType: ["album", "camera"], // 可以指定来源是相册还是相机,默认二者都有 |
|
|
|
|
success: (res) => { |
|
|
|
|
this.$refs.BetLoading.show() |
|
|
|
|
// this.BetLoading.show() |
|
|
|
|
// 成功选择图片后的回调 |
|
|
|
|
const tempFilePaths = res.tempFilePaths; |
|
|
|
|
this.uploadFile(tempFilePaths[0], index, vindex, sindex); |
|
|
|
|
@ -444,11 +406,10 @@ export default { |
|
|
|
|
let info = JSON.parse(res.data); |
|
|
|
|
console.log("上传成功", info); // 上传成功后的操作 |
|
|
|
|
this.detailForm.details[index].details[vindex].details[sindex].picUrl = info.data.link |
|
|
|
|
this.itemCollapseChange() |
|
|
|
|
this.$refs.BetLoading.hide() |
|
|
|
|
// this.BetLoading.hide() |
|
|
|
|
}, |
|
|
|
|
error: (uploadFileRes) => { |
|
|
|
|
this.$refs.BetLoading.hide() |
|
|
|
|
// this.BetLoading.hide() |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
@ -471,16 +432,13 @@ export default { |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
let queryData = [] |
|
|
|
|
console.log(111111111, newArr) |
|
|
|
|
newArr.forEach(item => { |
|
|
|
|
// item.id=this.detailForm.id |
|
|
|
|
queryData.push({ |
|
|
|
|
id: item.id, |
|
|
|
|
id: this.detailForm.id, |
|
|
|
|
status: item.status, |
|
|
|
|
signUrl: item.signUrl, |
|
|
|
|
remark: item.remark, |
|
|
|
|
picUrl: item.picUrl, |
|
|
|
|
taskId: this.detailForm.id |
|
|
|
|
remark: item.remark |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
this.$u.api.updateDetaile(queryData).then(res => { |
|
|
|
|
@ -632,21 +590,19 @@ export default { |
|
|
|
|
let isRepair = newArr.every((item) => { |
|
|
|
|
return item.isRepair == -1 |
|
|
|
|
}) |
|
|
|
|
if (isRepair) { |
|
|
|
|
uni.showToast({ title: "请选择异常设备是否维修", icon: "none" }); |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
if (this.customerApproveInfo.approveResult == null) { |
|
|
|
|
uni.showToast({ title: "请选择审核结果", icon: "none" }); |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
if (this.customerApproveInfo.approveResult == 1) { |
|
|
|
|
if (isRepair) { |
|
|
|
|
uni.showToast({ title: "请选择异常设备是否维修", icon: "none" }); |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (this.customerApproveInfo.approveResult == 0 && this.customerApproveInfo.approveRemark == '') { |
|
|
|
|
uni.showToast({ title: "请填写驳回原因", icon: "none" }); |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
if (this.customerApproveInfo.approveResult == 0 && this.customerApproveInfo.approveRemark == '') { |
|
|
|
|
uni.showToast({ title: "请填写驳回原因", icon: "none" }); |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (this.customerApproveInfo.approveResult == 1) {//通过 |
|
|
|
|
let query = { |
|
|
|
|
task: { |
|
|
|
|
@ -671,14 +627,14 @@ export default { |
|
|
|
|
approveTime: dateFormat("yyyy-MM-dd hh:mm:ss", new Date()),//当前时间 |
|
|
|
|
approveRemark: this.customerApproveInfo.approveRemark,//审批备注 |
|
|
|
|
} |
|
|
|
|
this.$u.api.repairCustomerRefuse(query_).then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
uni.showToast({ title: "驳回成功", icon: "none" }); |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.endOrderCancel() |
|
|
|
|
}, 500) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
// this.$u.api.repairCustomerRefuse(query_).then(res => { |
|
|
|
|
// if (res.code == 200) { |
|
|
|
|
// uni.showToast({ title: "审核成功", icon: "none" }); |
|
|
|
|
// setTimeout(() => { |
|
|
|
|
// this.endOrderCancel() |
|
|
|
|
// }, 500) |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
@ -735,12 +691,6 @@ export default { |
|
|
|
|
}, |
|
|
|
|
calendarChange(e) { |
|
|
|
|
this.reservationTime = e.result |
|
|
|
|
}, |
|
|
|
|
// 更改 手风琴的高度 |
|
|
|
|
itemCollapseChange() { |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.$refs.collapseTask.init() |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -794,9 +744,8 @@ export default { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.item_right_img { |
|
|
|
|
width: 140rpx; |
|
|
|
|
height: 140rpx; |
|
|
|
|
border-radius: 8rpx; |
|
|
|
|
width: 100%; |
|
|
|
|
height: 200rpx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|