|
@@ -35,7 +35,7 @@
|
|
|
<view class="row-label">备注说明:</view>
|
|
|
<view class="row-value">{{ detail.remarks || ' --' }}</view>
|
|
|
</view>
|
|
|
- <view class="status">{{ detail.status }}</view>
|
|
|
+ <view class="status" :style="[statusStyle(detail.status)]">{{ detail.status }}</view>
|
|
|
</view>
|
|
|
<block v-if="detail.team.length">
|
|
|
<view class="label">巡检人员</view>
|
|
@@ -60,13 +60,38 @@ import nodes from "./modules/nodes"
|
|
|
export default {
|
|
|
name: "Detail",
|
|
|
components: { but, nodes },
|
|
|
+ computed: {
|
|
|
+ statusStyle() {
|
|
|
+ return function (status) {
|
|
|
+ let obj = {};
|
|
|
+ switch (status) {
|
|
|
+ case '待接单':
|
|
|
+ obj = { color: '#EB4B5C', background: 'rgba(235, 75, 92, .2)' }
|
|
|
+ break;
|
|
|
+ case '待开始':
|
|
|
+ obj = { color: '#3874F6', background: 'rgba(56, 116, 246, .2)' }
|
|
|
+ break;
|
|
|
+ case '进行中':
|
|
|
+ obj = { color: '#5AB73F', background: 'rgba(90, 183, 63, .2)' };
|
|
|
+ break;
|
|
|
+ case '已完成':
|
|
|
+ obj = { color: '#F27F37', background: 'rgba(242, 127, 55, .2)' };
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ obj = { color: '#999999', background: 'rgba(153, 153, 153, .2)' }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return obj
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
detail: {
|
|
|
team: [],
|
|
|
nodes: [],
|
|
|
status: "",
|
|
|
- node: null,
|
|
|
+ child: null,
|
|
|
},
|
|
|
isShowBut: true,
|
|
|
sa_workorderid: 0,
|
|
@@ -75,6 +100,10 @@ export default {
|
|
|
onLoad(options) {
|
|
|
this.sa_workorderid = options.id;
|
|
|
this.getDetail(true)
|
|
|
+ this.$Http.updateNodes = this.getDetail.bind(this);
|
|
|
+ },
|
|
|
+ onUnload() {
|
|
|
+ delete this.$Http.updateNodes;
|
|
|
},
|
|
|
methods: {
|
|
|
getDetail(init = false) {
|
|
@@ -102,25 +131,24 @@ export default {
|
|
|
this.detail = res.data;
|
|
|
this.$refs.List.RefreshToComplete();
|
|
|
this.$refs.List.setHeight();
|
|
|
- if (this.node) this.nodeClick(this.node)
|
|
|
+ if (this.child) this.nodeClick(this.child)
|
|
|
})
|
|
|
},
|
|
|
- nodeClick(node) {
|
|
|
- this.$Http.node = node;
|
|
|
+ nodeClick(child) {
|
|
|
if (['待接单', '待开始'].includes(this.detail.status)) {
|
|
|
- if (this.detail.status == '待开始') this.node = node;
|
|
|
+ if (this.detail.status == '待开始') this.child = child;
|
|
|
this.$refs.but.onClick(true)
|
|
|
} else if (['暂停', '作废', '已完成'].includes(this.detail.status)) {
|
|
|
// 3、暂停/作废/已完成的工单,点击工序详情可查询,不可编辑;
|
|
|
uni.navigateTo({
|
|
|
- url: '/packageA/workOrder/setNode?readOnly=true'
|
|
|
+ url: `/packageA/workOrder/setNode?isReadOnly=true&sa_workorderid=${this.detail.sa_workorderid}&sa_workorder_nodeid=${child.sa_workorder_nodeid}&w_deviceid=${this.detail.w_deviceid}`
|
|
|
});
|
|
|
} else if (this.detail.status == '进行中') {
|
|
|
// 2、已开始的工单(工单状态为进行中),点击工序进入工序详情,若工序未完成,可查询可编辑;已完成工序仅查询不可编辑
|
|
|
uni.navigateTo({
|
|
|
- url: '/packageA/workOrder/setNode'
|
|
|
+ url: `/packageA/workOrder/setNode?sa_workorderid=${this.detail.sa_workorderid}&sa_workorder_nodeid=${child.sa_workorder_nodeid}&w_deviceid=${this.detail.w_deviceid}`
|
|
|
});
|
|
|
- this.node = null;
|
|
|
+ this.child = null;
|
|
|
}
|
|
|
},
|
|
|
onUnShowBut(e) {
|
|
@@ -128,7 +156,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onUnload() {
|
|
|
- delete this.$Http.node
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -169,8 +196,6 @@ export default {
|
|
|
top: 0;
|
|
|
right: 0;
|
|
|
padding: 4px 8px;
|
|
|
- background: #FFEFEF;
|
|
|
- color: #F65050;
|
|
|
font-size: 12px;
|
|
|
border-radius: 0 0 0 4px;
|
|
|
}
|