ConstructionDetailModal.js
2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// components/SelectInvoiceModal/SelectInvoiceModal.js
import api from '~/tabWorkOrder/api'
Component({
/**
* 组件的属性列表
*/
properties: {
visible: {
type: Boolean,
value: false,
observer: function (n, o) {
this.handleOpen()
}
},
orderInfo: {
type: Object,
value: {}
},
orderCode: {
type: String,
value: ''
}
},
/**
* 组件的生命周期
*/
lifetimes: {
// attached() {
// this.handleOpen()
// }
},
/**
* 组件的初始数据
*/
data: {
// selectType: 82,
loading: false
},
/**
* 组件的方法列表
*/
methods: {
openInventoryPopup(e){
console.log(e)
let {inventory:{
upgradeGoodsCommodityCode,
upgradeGoodsCustomCode,
specification,
stock
}} = e.target.dataset
const inventoryData ={
upgradeGoodsCommodityCode,
upgradeGoodsCustomCode,
specification,
stock
}
this.triggerEvent('openInventory', inventoryData)
},
navto(e) {
wx.$util.showToast('施工单详情不在本次迁移范围内')
},
selectType(e) {
let { type } = e.currentTarget.dataset
this.setData({
selectType: type
})
},
handleOpen() {
let { orderCode } = this.data
api
.listConstruction({ orderCode })
.then(res => {
console.log(res, 'listConstruction')
let listConstruction = res.data.map(item => {
item.subGoodsName = item.subOrderList
.map(sub => sub.upgradeGoodsName)
.join('/')
item.upgradeGoodsCommodityCode = item.subOrderList
.map(sub => sub.upgradeGoodsCommodityCode)
.join('/')
item.upgradeGoodsCustomCode = item.subOrderList
.map(sub => sub.upgradeGoodsCustomCode)
.join('/')
item.specification = item.subOrderList
.map(sub => sub.specification)
.join('/')
item.stock = item.subOrderList
.map(sub => sub.stock)
.join('/')
item.mainTechnician = item.mainTechnicianList
.map(sub => sub.technicianName)
.join('/')
return item
})
// console.log(listConstruction, 'listConstruction')
this.setData({
constructionList: listConstruction
})
})
.catch(err => {
console.log(err)
})
wx.$modal(
this,
{
show: true,
tabTitleShow: true,
tapTitle: '查看客户施工单',
success: res => { },
error: () => { }
},
'#modal'
)
},
handleCancel() {
this.triggerEvent('cancel')
},
handleConfirm() {
this.triggerEvent('confirm')
this.handleCancel()
}
}
})