|
|
|
@ -91,7 +91,12 @@ |
|
|
|
<!-- 填写内容 --> |
|
|
|
<!-- 填写内容 --> |
|
|
|
<view class="info" v-if="!reservationDisabled"> |
|
|
|
<view class="info" v-if="!reservationDisabled"> |
|
|
|
<view class="info_title">巡检任务</view> |
|
|
|
<view class="info_title">巡检任务</view> |
|
|
|
<u-collapse :accordion="false" ref="collapseTask"> |
|
|
|
<view class="info_search"> |
|
|
|
|
|
|
|
<u-search placeholder="请输入设备名称" v-model="deviceNameSearch" :clearabled="true" |
|
|
|
|
|
|
|
@change="deviceNameSearchFn" :show-action="false"></u-search> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<u-collapse :accordion="false" ref="collapseTask" |
|
|
|
|
|
|
|
v-if="detailForm.details && detailForm.details.length > 0"> |
|
|
|
<u-collapse-item v-for="(item, index) in detailForm.details" :key="index"> |
|
|
|
<u-collapse-item v-for="(item, index) in detailForm.details" :key="index"> |
|
|
|
<view slot="title"> |
|
|
|
<view slot="title"> |
|
|
|
<text class="collapse-title">实验室楼层:{{ item.floorName }}</text> |
|
|
|
<text class="collapse-title">实验室楼层:{{ item.floorName }}</text> |
|
|
|
@ -149,6 +154,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</u-collapse-item> |
|
|
|
</u-collapse-item> |
|
|
|
</u-collapse> |
|
|
|
</u-collapse> |
|
|
|
|
|
|
|
<u-empty text="设备为空" mode="list" v-else></u-empty> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="info"> |
|
|
|
<view class="info"> |
|
|
|
<u-form labelPosition="left" ref="sendOrderForm" :model="detailForm" :label-width="120" class="repair_form"> |
|
|
|
<u-form labelPosition="left" ref="sendOrderForm" :model="detailForm" :label-width="120" class="repair_form"> |
|
|
|
@ -338,7 +344,9 @@ export default { |
|
|
|
approveResult: null,//1通过 0驳回 |
|
|
|
approveResult: null,//1通过 0驳回 |
|
|
|
approveText: '',//展示内容 |
|
|
|
approveText: '',//展示内容 |
|
|
|
approveTime: '',//当前时间 |
|
|
|
approveTime: '',//当前时间 |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
deviceNameSearch: '',//巡检任务 搜索设备名称 |
|
|
|
|
|
|
|
deviceList: [],//记录设备总数 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
onLoad(options) { |
|
|
|
@ -357,16 +365,24 @@ export default { |
|
|
|
if (this.detailsType == 'task') { |
|
|
|
if (this.detailsType == 'task') { |
|
|
|
this.$u.api.getTaskDetail(query).then(res => { |
|
|
|
this.$u.api.getTaskDetail(query).then(res => { |
|
|
|
if (res.code == 200) { |
|
|
|
if (res.code == 200) { |
|
|
|
this.detailForm = res.data |
|
|
|
|
|
|
|
this.updateData(res.data.details) |
|
|
|
this.updateData(res.data.details) |
|
|
|
|
|
|
|
this.detailForm = res.data |
|
|
|
|
|
|
|
this.deviceList = this.detailForm.details |
|
|
|
|
|
|
|
this.signUrl = res.data.signUrl |
|
|
|
|
|
|
|
this.remark = res.data.remark |
|
|
|
this.collapseData = JSON.parse(JSON.stringify(res.data.details)) |
|
|
|
this.collapseData = JSON.parse(JSON.stringify(res.data.details)) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.$u.api.getRepairDetail(query).then(res => { |
|
|
|
this.$u.api.getRepairDetail(query).then(res => { |
|
|
|
if (res.code == 200) { |
|
|
|
if (res.code == 200) { |
|
|
|
this.detailForm = res.data |
|
|
|
|
|
|
|
this.updateData(res.data.details) |
|
|
|
this.updateData(res.data.details) |
|
|
|
|
|
|
|
this.detailForm = res.data |
|
|
|
|
|
|
|
this.deviceList = this.detailForm.details |
|
|
|
|
|
|
|
this.signUrl = res.data.signUrl |
|
|
|
|
|
|
|
this.remark = res.data.remark |
|
|
|
this.collapseData = JSON.parse(JSON.stringify(res.data.details)) |
|
|
|
this.collapseData = JSON.parse(JSON.stringify(res.data.details)) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
@ -456,7 +472,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 维修人员提交明细 |
|
|
|
// 维修人员提交明细 |
|
|
|
submitQuest() { |
|
|
|
submitQuest() { |
|
|
|
let newArr = this.handleData(this.detailForm.details) |
|
|
|
let newArr = this.handleData(this.deviceList) |
|
|
|
let status = newArr.every((item) => { |
|
|
|
let status = newArr.every((item) => { |
|
|
|
return item.status != null |
|
|
|
return item.status != null |
|
|
|
}) |
|
|
|
}) |
|
|
|
@ -480,33 +496,34 @@ export default { |
|
|
|
taskId: this.detailForm.id |
|
|
|
taskId: this.detailForm.id |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.$u.api.updateDetaile(queryData).then(res => { |
|
|
|
console.log(11111111, newArr) |
|
|
|
if (res.code == 200) { |
|
|
|
// this.$u.api.updateDetaile(queryData).then(res => { |
|
|
|
let signInfo={ |
|
|
|
// if (res.code == 200) { |
|
|
|
id:this.detailForm.id, |
|
|
|
// let signInfo = { |
|
|
|
signUrl:this.signUrl, |
|
|
|
// id: this.detailForm.id, |
|
|
|
remark:this.remark |
|
|
|
// signUrl: this.signUrl, |
|
|
|
} |
|
|
|
// remark: this.remark |
|
|
|
this.$u.api.updateSign(signInfo).then(res => { |
|
|
|
// } |
|
|
|
if (res.code == 200) { |
|
|
|
// this.$u.api.updateSign(signInfo).then(res => { |
|
|
|
let query = { |
|
|
|
// if (res.code == 200) { |
|
|
|
id: this.detailForm.id, |
|
|
|
// let query = { |
|
|
|
} |
|
|
|
// id: this.detailForm.id, |
|
|
|
// this.$u.api.taskServicemanSubmit(query).then(res => { |
|
|
|
// } |
|
|
|
// if (res.code == 200) { |
|
|
|
// this.$u.api.taskServicemanSubmit(query).then(res => { |
|
|
|
// uni.showToast({ title: "提交成功", icon: "none" }); |
|
|
|
// if (res.code == 200) { |
|
|
|
// setTimeout(() => { |
|
|
|
// uni.showToast({ title: "提交成功", icon: "none" }); |
|
|
|
// uni.navigateBack({ |
|
|
|
// setTimeout(() => { |
|
|
|
// delta: 1 // 默认值是1,表示回退一个页面 |
|
|
|
// uni.navigateBack({ |
|
|
|
// }) |
|
|
|
// delta: 1 // 默认值是1,表示回退一个页面 |
|
|
|
// }, 500) |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// }, 500) |
|
|
|
// }) |
|
|
|
// } |
|
|
|
} |
|
|
|
// }) |
|
|
|
}) |
|
|
|
// } |
|
|
|
|
|
|
|
// }) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
// } |
|
|
|
|
|
|
|
// }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 客户确认巡检任务 |
|
|
|
// 客户确认巡检任务 |
|
|
|
changeApproveResult(e) { |
|
|
|
changeApproveResult(e) { |
|
|
|
@ -743,14 +760,55 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
calendarChange(e) { |
|
|
|
calendarChange(e) { |
|
|
|
this.reservationTime = e.result |
|
|
|
this.reservationTime = e.result |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 更改 手风琴的高度 |
|
|
|
|
|
|
|
itemCollapseChange() { |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
this.$refs.collapseTask.init() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
deviceNameSearchFn(val) { |
|
|
|
|
|
|
|
this.detailForm.details = [] |
|
|
|
|
|
|
|
let newArr = this.filterByDeviceName(this.deviceList, val) |
|
|
|
|
|
|
|
this.detailForm.details = newArr.details |
|
|
|
|
|
|
|
this.itemCollapseChange() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 过滤 搜索条件 |
|
|
|
|
|
|
|
filterByDeviceName(data, targetDeviceName) { |
|
|
|
|
|
|
|
// 定义一个递归函数来处理多维数组 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const recursiveFilter = (details) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return details |
|
|
|
|
|
|
|
.map(item => { |
|
|
|
|
|
|
|
// 过滤 item.details,保持设备名称匹配的项 |
|
|
|
|
|
|
|
const filteredDetails = item.details ? item.details.map(subItem => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const matchingDetails = subItem.details |
|
|
|
|
|
|
|
? subItem.details.filter(detail => detail.deviceName.includes(targetDeviceName)) |
|
|
|
|
|
|
|
: []; |
|
|
|
|
|
|
|
console.log('matchingDetails', matchingDetails) |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
...subItem, |
|
|
|
|
|
|
|
details: matchingDetails.length > 0 ? matchingDetails : undefined, // 只保留有匹配项的 details |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}).filter(subItem => subItem.details) : []; // 仅保留 details 不为空的项 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
...item, |
|
|
|
|
|
|
|
details: filteredDetails.length > 0 ? filteredDetails : undefined, // 只保留有匹配项的 details |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.filter(item => item.details); // 过滤掉没有匹配 details 的项 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
...data, |
|
|
|
|
|
|
|
details: recursiveFilter(data) |
|
|
|
|
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 更改 手风琴的高度 |
|
|
|
|
|
|
|
itemCollapseChange() { |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
this.$refs.collapseTask.init() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
@ -774,6 +832,9 @@ export default { |
|
|
|
margin: 18rpx 0 0rpx 20rpx; |
|
|
|
margin: 18rpx 0 0rpx 20rpx; |
|
|
|
font-weight: bold; |
|
|
|
font-weight: bold; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.info_search{ |
|
|
|
|
|
|
|
padding:0 32rpx |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.info_item { |
|
|
|
.info_item { |
|
|
|
padding: 4rpx 20rpx 0; |
|
|
|
padding: 4rpx 20rpx 0; |
|
|
|
|