|
|
|
1
|
+<template>
|
|
|
|
2
|
+ <view class="detail-page">
|
|
|
|
3
|
+ <scroll-view class="scroll" scroll-y>
|
|
|
|
4
|
+ <template v-if="isEditLayout">
|
|
|
|
5
|
+ <uni-list class="edit-list">
|
|
|
|
6
|
+ <uni-list-item class="select-item is-filled">
|
|
|
|
7
|
+ <template v-slot:body>
|
|
|
|
8
|
+ <view class="item-title"><text>编号</text></view>
|
|
|
|
9
|
+ </template>
|
|
|
|
10
|
+ <template v-slot:footer>
|
|
|
|
11
|
+ <view class="serial-number-row">
|
|
|
|
12
|
+ <text class="readonly-text value-code">{{ safeText(form.code) }}</text>
|
|
|
|
13
|
+ </view>
|
|
|
|
14
|
+ </template>
|
|
|
|
15
|
+ </uni-list-item>
|
|
|
|
16
|
+
|
|
|
|
17
|
+ <uni-list-item
|
|
|
|
18
|
+ class="select-item"
|
|
|
|
19
|
+ :class="(form.companyShortName || form.companyName) ? 'is-filled' : 'is-empty'"
|
|
|
|
20
|
+ :clickable="canEdit"
|
|
|
|
21
|
+ :rightText="canEdit ? (form.companyShortName || form.companyName || '请选择公司名称') : ''"
|
|
|
|
22
|
+ :showArrow="canEdit"
|
|
|
|
23
|
+ @click="canEdit ? openCompanySheet() : undefined"
|
|
|
|
24
|
+ >
|
|
|
|
25
|
+ <template v-slot:body>
|
|
|
|
26
|
+ <view class="item-title">
|
|
|
|
27
|
+ <text class="required" v-if="canEdit">*</text><text>公司名称</text>
|
|
|
|
28
|
+ </view>
|
|
|
|
29
|
+ </template>
|
|
|
|
30
|
+ <template v-if="!canEdit" v-slot:footer>
|
|
|
|
31
|
+ <uni-easyinput :value="form.companyShortName || form.companyName" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
32
|
+ </template>
|
|
|
|
33
|
+ </uni-list-item>
|
|
|
|
34
|
+
|
|
|
|
35
|
+ <uni-list-item title="供应商名称">
|
|
|
|
36
|
+ <template v-slot:footer>
|
|
|
|
37
|
+ <uni-easyinput :value="form.supplierName" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
38
|
+ </template>
|
|
|
|
39
|
+ </uni-list-item>
|
|
|
|
40
|
+
|
|
|
|
41
|
+ <uni-list-item title="采购处">
|
|
|
|
42
|
+ <template v-slot:footer>
|
|
|
|
43
|
+ <uni-easyinput :value="purchaseDepartmentDisplay" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
44
|
+ </template>
|
|
|
|
45
|
+ </uni-list-item>
|
|
|
|
46
|
+
|
|
|
|
47
|
+ <uni-list-item title="区域">
|
|
|
|
48
|
+ <template v-slot:footer>
|
|
|
|
49
|
+ <uni-easyinput :value="regionDisplay" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
50
|
+ </template>
|
|
|
|
51
|
+ </uni-list-item>
|
|
|
|
52
|
+
|
|
|
|
53
|
+ <uni-list-item title="日期">
|
|
|
|
54
|
+ <template v-slot:footer>
|
|
|
|
55
|
+ <uni-easyinput :value="formatDateOnly(form.date)" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
56
|
+ </template>
|
|
|
|
57
|
+ </uni-list-item>
|
|
|
|
58
|
+
|
|
|
|
59
|
+ <uni-list-item title="报价时效">
|
|
|
|
60
|
+ <template v-slot:footer>
|
|
|
|
61
|
+ <uni-easyinput :value="form.validityPeriod" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
62
|
+ </template>
|
|
|
|
63
|
+ </uni-list-item>
|
|
|
|
64
|
+
|
|
|
|
65
|
+ <uni-list-item title="报价人">
|
|
|
|
66
|
+ <template v-slot:footer>
|
|
|
|
67
|
+ <uni-easyinput :value="form.quoterName" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
68
|
+ </template>
|
|
|
|
69
|
+ </uni-list-item>
|
|
|
|
70
|
+
|
|
|
|
71
|
+ <uni-list-item class="select-item" :class="typeof form.longTermOperation === 'boolean' ? 'is-filled' : 'is-empty'">
|
|
|
|
72
|
+ <template v-slot:body>
|
|
|
|
73
|
+ <view class="item-title"><text>是否长单操作</text></view>
|
|
|
|
74
|
+ </template>
|
|
|
|
75
|
+ <template v-slot:footer>
|
|
|
|
76
|
+ <text class="readonly-text">{{ boolText(form.longTermOperation) }}</text>
|
|
|
|
77
|
+ </template>
|
|
|
|
78
|
+ </uni-list-item>
|
|
|
|
79
|
+
|
|
|
|
80
|
+ <uni-list-item class="select-item" :class="typeof form.terminalCustomer === 'boolean' ? 'is-filled' : 'is-empty'">
|
|
|
|
81
|
+ <template v-slot:body>
|
|
|
|
82
|
+ <view class="item-title"><text>是否终端客户</text></view>
|
|
|
|
83
|
+ </template>
|
|
|
|
84
|
+ <template v-slot:footer>
|
|
|
|
85
|
+ <text class="readonly-text">{{ boolText(form.terminalCustomer) }}</text>
|
|
|
|
86
|
+ </template>
|
|
|
|
87
|
+ </uni-list-item>
|
|
|
|
88
|
+
|
|
|
|
89
|
+ <uni-list-item class="select-item" :class="typeof form.priced === 'boolean' ? 'is-filled' : 'is-empty'">
|
|
|
|
90
|
+ <template v-slot:body>
|
|
|
|
91
|
+ <view class="item-title"><text>是否未点价</text></view>
|
|
|
|
92
|
+ </template>
|
|
|
|
93
|
+ <template v-slot:footer>
|
|
|
|
94
|
+ <text class="readonly-text">{{ boolText(form.priced) }}</text>
|
|
|
|
95
|
+ </template>
|
|
|
|
96
|
+ </uni-list-item>
|
|
|
|
97
|
+
|
|
|
|
98
|
+ <uni-list-item v-if="form.priced === true" title="点价截止日期">
|
|
|
|
99
|
+ <template v-slot:footer>
|
|
|
|
100
|
+ <uni-easyinput :value="pricingDeadlineDisplay" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
101
|
+ </template>
|
|
|
|
102
|
+ </uni-list-item>
|
|
|
|
103
|
+
|
|
|
|
104
|
+ <uni-list-item v-if="form.priced === true" class="select-item" :class="typeof form.temporaryPrice === 'boolean' ? 'is-filled' : 'is-empty'">
|
|
|
|
105
|
+ <template v-slot:body>
|
|
|
|
106
|
+ <view class="item-title"><text>是否暂定价</text></view>
|
|
|
|
107
|
+ </template>
|
|
|
|
108
|
+ <template v-slot:footer>
|
|
|
|
109
|
+ <text class="readonly-text">{{ boolText(form.temporaryPrice) }}</text>
|
|
|
|
110
|
+ </template>
|
|
|
|
111
|
+ </uni-list-item>
|
|
|
|
112
|
+
|
|
|
|
113
|
+ <uni-list-item class="select-item" :class="typeof form.otherExpenseSettlement === 'boolean' ? 'is-filled' : 'is-empty'">
|
|
|
|
114
|
+ <template v-slot:body>
|
|
|
|
115
|
+ <view class="item-title"><text>其他费用凭票到厂另行结算</text></view>
|
|
|
|
116
|
+ </template>
|
|
|
|
117
|
+ <template v-slot:footer>
|
|
|
|
118
|
+ <text class="readonly-text">{{ boolText(form.otherExpenseSettlement) }}</text>
|
|
|
|
119
|
+ </template>
|
|
|
|
120
|
+ </uni-list-item>
|
|
|
|
121
|
+
|
|
|
|
122
|
+ <uni-list-item class="select-item" :class="form.deliveryMode ? 'is-filled' : 'is-empty'">
|
|
|
|
123
|
+ <template v-slot:body>
|
|
|
|
124
|
+ <view class="item-title"><text>交提货方式</text></view>
|
|
|
|
125
|
+ </template>
|
|
|
|
126
|
+ <template v-slot:footer>
|
|
|
|
127
|
+ <text class="readonly-text">{{ getDeliveryMethodLabel() }}</text>
|
|
|
|
128
|
+ </template>
|
|
|
|
129
|
+ </uni-list-item>
|
|
|
|
130
|
+
|
|
|
|
131
|
+ <uni-list-item class="select-item" :class="typeof form.commodityBuyout === 'boolean' ? 'is-filled' : 'is-empty'">
|
|
|
|
132
|
+ <template v-slot:body>
|
|
|
|
133
|
+ <view class="item-title"><text>是否通货买断</text></view>
|
|
|
|
134
|
+ </template>
|
|
|
|
135
|
+ <template v-slot:footer>
|
|
|
|
136
|
+ <text class="readonly-text">{{ boolText(form.commodityBuyout) }}</text>
|
|
|
|
137
|
+ </template>
|
|
|
|
138
|
+ </uni-list-item>
|
|
|
|
139
|
+
|
|
|
|
140
|
+ <uni-list-item class="select-item" :class="typeof form.qualityBuyout === 'boolean' ? 'is-filled' : 'is-empty'">
|
|
|
|
141
|
+ <template v-slot:body>
|
|
|
|
142
|
+ <view class="item-title"><text>是否质量买断</text></view>
|
|
|
|
143
|
+ </template>
|
|
|
|
144
|
+ <template v-slot:footer>
|
|
|
|
145
|
+ <text class="readonly-text">{{ boolText(form.qualityBuyout) }}</text>
|
|
|
|
146
|
+ </template>
|
|
|
|
147
|
+ </uni-list-item>
|
|
|
|
148
|
+
|
|
|
|
149
|
+ <uni-list-item class="select-item" :class="typeof form.quantityBuyout === 'boolean' ? 'is-filled' : 'is-empty'">
|
|
|
|
150
|
+ <template v-slot:body>
|
|
|
|
151
|
+ <view class="item-title"><text>是否数量买断</text></view>
|
|
|
|
152
|
+ </template>
|
|
|
|
153
|
+ <template v-slot:footer>
|
|
|
|
154
|
+ <text class="readonly-text">{{ boolText(form.quantityBuyout) }}</text>
|
|
|
|
155
|
+ </template>
|
|
|
|
156
|
+ </uni-list-item>
|
|
|
|
157
|
+
|
|
|
|
158
|
+ <uni-list-item class="select-item" :class="typeof form.doorDelivery === 'boolean' ? 'is-filled' : 'is-empty'">
|
|
|
|
159
|
+ <template v-slot:body>
|
|
|
|
160
|
+ <view class="item-title"><text>是否送货上门</text></view>
|
|
|
|
161
|
+ </template>
|
|
|
|
162
|
+ <template v-slot:footer>
|
|
|
|
163
|
+ <text class="readonly-text">{{ boolText(form.doorDelivery) }}</text>
|
|
|
|
164
|
+ </template>
|
|
|
|
165
|
+ </uni-list-item>
|
|
|
|
166
|
+
|
|
|
|
167
|
+ <uni-list-item title="另付运费">
|
|
|
|
168
|
+ <template v-slot:footer>
|
|
|
|
169
|
+ <uni-easyinput
|
|
|
|
170
|
+ v-if="canEdit"
|
|
|
|
171
|
+ v-model="form.shippingCost"
|
|
|
|
172
|
+ type="digit"
|
|
|
|
173
|
+ :inputBorder="false"
|
|
|
|
174
|
+ placeholder="请输入另付运费"
|
|
|
|
175
|
+ @input="onShippingCostInput"
|
|
|
|
176
|
+ @blur="onShippingCostBlur"
|
|
|
|
177
|
+ />
|
|
|
|
178
|
+ <uni-easyinput v-else :value="shippingCostDisplay" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
179
|
+ </template>
|
|
|
|
180
|
+ </uni-list-item>
|
|
|
|
181
|
+
|
|
|
|
182
|
+ <uni-list-item title="装车费">
|
|
|
|
183
|
+ <template v-slot:footer>
|
|
|
|
184
|
+ <uni-easyinput :value="loadingFeeDisplay" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
185
|
+ </template>
|
|
|
|
186
|
+ </uni-list-item>
|
|
|
|
187
|
+
|
|
|
|
188
|
+ <uni-list-item>
|
|
|
|
189
|
+ <template v-slot:body>
|
|
|
|
190
|
+ <view class="item-title">
|
|
|
|
191
|
+ <text class="required" v-if="canEdit">*</text><text>开票品名</text>
|
|
|
|
192
|
+ </view>
|
|
|
|
193
|
+ </template>
|
|
|
|
194
|
+ <template v-slot:footer>
|
|
|
|
195
|
+ <uni-easyinput
|
|
|
|
196
|
+ v-if="canEdit"
|
|
|
|
197
|
+ v-model="form.invoiceProductName"
|
|
|
|
198
|
+ :inputBorder="false"
|
|
|
|
199
|
+ placeholder="请输入开票品名"
|
|
|
|
200
|
+ />
|
|
|
|
201
|
+ <uni-easyinput v-else :value="form.invoiceProductName" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
202
|
+ </template>
|
|
|
|
203
|
+ </uni-list-item>
|
|
|
|
204
|
+
|
|
|
|
205
|
+ <uni-list-item title="交货日期">
|
|
|
|
206
|
+ <template v-slot:footer>
|
|
|
|
207
|
+ <uni-easyinput :value="deliveryDateDisplay" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
208
|
+ </template>
|
|
|
|
209
|
+ </uni-list-item>
|
|
|
|
210
|
+
|
|
|
|
211
|
+ <uni-list-item title="结算方式">
|
|
|
|
212
|
+ <template v-slot:footer>
|
|
|
|
213
|
+ <uni-easyinput :value="form.settlementMethod" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
214
|
+ </template>
|
|
|
|
215
|
+ </uni-list-item>
|
|
|
|
216
|
+
|
|
|
|
217
|
+ <uni-list-item title="结算比例(%)">
|
|
|
|
218
|
+ <template v-slot:footer>
|
|
|
|
219
|
+ <uni-easyinput :value="settlementRatioDisplay" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
220
|
+ </template>
|
|
|
|
221
|
+ </uni-list-item>
|
|
|
|
222
|
+
|
|
|
|
223
|
+ <uni-list-item title="价格表编号">
|
|
|
|
224
|
+ <template v-slot:footer>
|
|
|
|
225
|
+ <uni-easyinput :value="priceTableDisplay === '-' ? '' : priceTableDisplay" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
226
|
+ </template>
|
|
|
|
227
|
+ </uni-list-item>
|
|
|
|
228
|
+
|
|
|
|
229
|
+ <uni-list-item title="协调事由">
|
|
|
|
230
|
+ <template v-slot:footer>
|
|
|
|
231
|
+ <uni-easyinput :value="form.coordinationReason" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
232
|
+ </template>
|
|
|
|
233
|
+ </uni-list-item>
|
|
|
|
234
|
+
|
|
|
|
235
|
+ <uni-list-item title="票类状况">
|
|
|
|
236
|
+ <template v-slot:footer>
|
|
|
|
237
|
+ <uni-easyinput :value="form.invoiceTypeStatus" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
238
|
+ </template>
|
|
|
|
239
|
+ </uni-list-item>
|
|
|
|
240
|
+
|
|
|
|
241
|
+ <uni-list-item title="数量合计">
|
|
|
|
242
|
+ <template v-slot:footer>
|
|
|
|
243
|
+ <uni-easyinput :value="totalQuantityDisplay" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
244
|
+ </template>
|
|
|
|
245
|
+ </uni-list-item>
|
|
|
|
246
|
+
|
|
|
|
247
|
+ <uni-list-item v-if="attachmentList.length" title="附件">
|
|
|
|
248
|
+ <template v-slot:footer>
|
|
|
|
249
|
+ <view class="attach-list">
|
|
|
|
250
|
+ <view v-for="(at, idx) in attachmentList" :key="idx" class="attach-item">
|
|
|
|
251
|
+ <text class="attach-name">{{ at.name }}</text>
|
|
|
|
252
|
+ <text class="attach-view" @click.stop="onPreviewAttachment(at)">查看</text>
|
|
|
|
253
|
+ </view>
|
|
|
|
254
|
+ </view>
|
|
|
|
255
|
+ </template>
|
|
|
|
256
|
+ </uni-list-item>
|
|
|
|
257
|
+ </uni-list>
|
|
|
|
258
|
+
|
|
|
|
259
|
+ <view class="title-header">
|
|
|
|
260
|
+ <image class="title-header_icon" src="/static/images/title.png" />
|
|
|
|
261
|
+ <span>明细信息</span>
|
|
|
|
262
|
+ </view>
|
|
|
|
263
|
+ <view v-if="lineListWithName.length" class="edit-line-list">
|
|
|
|
264
|
+ <view v-for="(line, idx) in lineListWithName" :key="line.itemId || line.id || idx" class="edit-line-block">
|
|
|
|
265
|
+ <view class="line-title">明细{{ idx + 1 }}</view>
|
|
|
|
266
|
+ <uni-list>
|
|
|
|
267
|
+ <uni-list-item title="品种">
|
|
|
|
268
|
+ <template v-slot:footer>
|
|
|
|
269
|
+ <uni-easyinput :value="line.productName" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
270
|
+ </template>
|
|
|
|
271
|
+ </uni-list-item>
|
|
|
|
272
|
+ <uni-list-item title="料型">
|
|
|
|
273
|
+ <template v-slot:footer>
|
|
|
|
274
|
+ <uni-easyinput :value="line.materialType" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
275
|
+ </template>
|
|
|
|
276
|
+ </uni-list-item>
|
|
|
|
277
|
+ <uni-list-item title="数量(吨)">
|
|
|
|
278
|
+ <template v-slot:footer>
|
|
|
|
279
|
+ <uni-easyinput :value="lineNumberDisplay(line.quantity)" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
280
|
+ </template>
|
|
|
|
281
|
+ </uni-list-item>
|
|
|
|
282
|
+ <uni-list-item title="实际采购价">
|
|
|
|
283
|
+ <template v-slot:footer>
|
|
|
|
284
|
+ <uni-easyinput :value="lineNumberDisplay(line.actualPurchasePrice)" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
285
|
+ </template>
|
|
|
|
286
|
+ </uni-list-item>
|
|
|
|
287
|
+ <uni-list-item title="含运到厂价">
|
|
|
|
288
|
+ <template v-slot:footer>
|
|
|
|
289
|
+ <uni-easyinput :value="lineNumberDisplay(line.includingShippingPrice)" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
290
|
+ </template>
|
|
|
|
291
|
+ </uni-list-item>
|
|
|
|
292
|
+ <uni-list-item title="价格表价格">
|
|
|
|
293
|
+ <template v-slot:footer>
|
|
|
|
294
|
+ <uni-easyinput :value="lineNumberDisplay(line.priceListPrices)" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
295
|
+ </template>
|
|
|
|
296
|
+ </uni-list-item>
|
|
|
|
297
|
+ <uni-list-item title="协调幅度">
|
|
|
|
298
|
+ <template v-slot:footer>
|
|
|
|
299
|
+ <uni-easyinput :value="lineNumberDisplay(line.coordinationRange)" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
300
|
+ </template>
|
|
|
|
301
|
+ </uni-list-item>
|
|
|
|
302
|
+ <uni-list-item title="买断料预计损耗">
|
|
|
|
303
|
+ <template v-slot:footer>
|
|
|
|
304
|
+ <uni-easyinput :value="lineNumberDisplay(line.estimatedLoss)" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
305
|
+ </template>
|
|
|
|
306
|
+ </uni-list-item>
|
|
|
|
307
|
+ <uni-list-item title="申请损耗(%)">
|
|
|
|
308
|
+ <template v-slot:footer>
|
|
|
|
309
|
+ <uni-easyinput :value="lineNumberDisplay(line.applicationAttrition)" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
310
|
+ </template>
|
|
|
|
311
|
+ </uni-list-item>
|
|
|
|
312
|
+ <uni-list-item
|
|
|
|
313
|
+ class="select-item"
|
|
|
|
314
|
+ :class="line.workshopName ? 'is-filled' : 'is-empty'"
|
|
|
|
315
|
+ :clickable="canEditWorkshop"
|
|
|
|
316
|
+ :rightText="canEditWorkshop ? (line.workshopName || '请选择分厂') : ''"
|
|
|
|
317
|
+ :showArrow="canEditWorkshop"
|
|
|
|
318
|
+ @click="canEditWorkshop ? openWorkshopSheet(idx) : undefined"
|
|
|
|
319
|
+ >
|
|
|
|
320
|
+ <template v-slot:body>
|
|
|
|
321
|
+ <view class="item-title">
|
|
|
|
322
|
+ <text class="required" v-if="canEditWorkshop">*</text><text>选择分厂</text>
|
|
|
|
323
|
+ </view>
|
|
|
|
324
|
+ </template>
|
|
|
|
325
|
+ <template v-if="!canEditWorkshop" v-slot:footer>
|
|
|
|
326
|
+ <uni-easyinput :value="line.workshopName" :inputBorder="false" disabled placeholder="-" />
|
|
|
|
327
|
+ </template>
|
|
|
|
328
|
+ </uni-list-item>
|
|
|
|
329
|
+ </uni-list>
|
|
|
|
330
|
+ </view>
|
|
|
|
331
|
+ </view>
|
|
|
|
332
|
+ <view v-else class="section empty-tip">暂无明细</view>
|
|
|
|
333
|
+
|
|
|
|
334
|
+ <view class="material-condition-section">
|
|
|
|
335
|
+ <view class="section-header">
|
|
|
|
336
|
+ <image class="opCollapse" src="/static/images/title.png" />
|
|
|
|
337
|
+ <text class="section-title">料质状况</text>
|
|
|
|
338
|
+ </view>
|
|
|
|
339
|
+ <view class="section-content">
|
|
|
|
340
|
+ <view class="form-row">
|
|
|
|
341
|
+ <text class="form-label">是否启用料质状况</text>
|
|
|
|
342
|
+ <text class="form-value">{{ boolText(form.materialConditionEnabled) }}</text>
|
|
|
|
343
|
+ </view>
|
|
|
|
344
|
+ <template v-if="form.materialConditionEnabled">
|
|
|
|
345
|
+ <view v-for="mc in materialConditionConfigs" :key="mc.field" class="material-group">
|
|
|
|
346
|
+ <text class="material-label">{{ mc.label }}</text>
|
|
|
|
347
|
+ <view class="tag-list">
|
|
|
|
348
|
+ <view v-for="opt in getDictOptions(mc.dictCode)" :key="opt.code" class="tag-btn" :class="{ active: isTagSelected(mc.field, opt.code) }">{{ opt.name }}</view>
|
|
|
|
349
|
+ </view>
|
|
|
|
350
|
+ </view>
|
|
|
|
351
|
+ </template>
|
|
|
|
352
|
+ </view>
|
|
|
|
353
|
+ </view>
|
|
|
|
354
|
+
|
|
|
|
355
|
+ <view class="remark-section">
|
|
|
|
356
|
+ <view class="section-header">
|
|
|
|
357
|
+ <image class="opCollapse" src="/static/images/title.png" />
|
|
|
|
358
|
+ <text class="section-title">备注</text>
|
|
|
|
359
|
+ </view>
|
|
|
|
360
|
+ <view class="section-content">
|
|
|
|
361
|
+ <text class="remark-text">{{ safeText(form.remark) }}</text>
|
|
|
|
362
|
+ </view>
|
|
|
|
363
|
+ </view>
|
|
|
|
364
|
+
|
|
|
|
365
|
+ <view class="remark-section">
|
|
|
|
366
|
+ <view class="section-header">
|
|
|
|
367
|
+ <image class="opCollapse" src="/static/images/title.png" />
|
|
|
|
368
|
+ <text class="section-title">变更事由</text>
|
|
|
|
369
|
+ </view>
|
|
|
|
370
|
+ <view class="section-content">
|
|
|
|
371
|
+ <text class="remark-text">{{ safeText(form.changeReason) }}</text>
|
|
|
|
372
|
+ </view>
|
|
|
|
373
|
+ </view>
|
|
|
|
374
|
+ </template>
|
|
|
|
375
|
+
|
|
|
|
376
|
+ <template v-else>
|
|
|
|
377
|
+ <view class="section">
|
|
|
|
378
|
+ <text class="row company">{{ safeText(form.code) }}</text>
|
|
|
|
379
|
+ <view class="row"><text class="label">公司简称</text><text class="value">{{ safeText(form.companyShortName || form.companyName) }}</text></view>
|
|
|
|
380
|
+ <view class="row"><text class="label">供应商名称</text><text class="value">{{ safeText(form.supplierName) }}</text></view>
|
|
|
|
381
|
+ <view class="row"><text class="label">采购处</text><text class="value">{{ safeText(form.purchaseDepartmentName || form.purchaseDepartment) }}</text></view>
|
|
|
|
382
|
+ <view class="row"><text class="label">区域</text><text class="value">{{ safeText(form.regionName || form.region) }}</text></view>
|
|
|
|
383
|
+ <view class="row"><text class="label">日期</text><text class="value">{{ formatDateOnly(form.date) }}</text></view>
|
|
|
|
384
|
+ <view class="row"><text class="label">报价时效</text><text class="value">{{ safeText(form.validityPeriod) }}</text></view>
|
|
|
|
385
|
+ <view class="row"><text class="label">报价人</text><text class="value">{{ safeText(form.quoterName) }}</text></view>
|
|
|
|
386
|
+ <view class="row"><text class="label">是否长单操作</text><text class="value">{{ boolText(form.longTermOperation) }}</text></view>
|
|
|
|
387
|
+ <view class="row"><text class="label">是否终端客户</text><text class="value">{{ boolText(form.terminalCustomer) }}</text></view>
|
|
|
|
388
|
+ <view class="row"><text class="label">是否未点价</text><text class="value">{{ boolText(form.priced) }}</text></view>
|
|
|
|
389
|
+ <view v-if="form.priced === true" class="row"><text class="label">点价截止日期</text><text class="value">{{ formatDateOnly(form.pricingDeadline) }}</text></view>
|
|
|
|
390
|
+ <view v-if="form.priced === true" class="row"><text class="label">是否暂定价</text><text class="value">{{ boolText(form.temporaryPrice) }}</text></view>
|
|
|
|
391
|
+ <view class="row"><text class="label">其他费用凭票到厂另行结算</text><text class="value">{{ boolText(form.otherExpenseSettlement) }}</text></view>
|
|
|
|
392
|
+ <view class="row"><text class="label">交提货方式</text><text class="value">{{ getDeliveryMethodLabel() }}</text></view>
|
|
|
|
393
|
+ <view class="row"><text class="label">是否通货买断</text><text class="value">{{ boolText(form.commodityBuyout) }}</text></view>
|
|
|
|
394
|
+ <view class="row"><text class="label">是否质量买断</text><text class="value">{{ boolText(form.qualityBuyout) }}</text></view>
|
|
|
|
395
|
+ <view class="row"><text class="label">是否数量买断</text><text class="value">{{ boolText(form.quantityBuyout) }}</text></view>
|
|
|
|
396
|
+ <view class="row"><text class="label">是否送货上门</text><text class="value">{{ boolText(form.doorDelivery) }}</text></view>
|
|
|
|
397
|
+ <view class="row"><text class="label">另付运费</text><text class="value">{{ formatNumber(form.shippingCost) }}</text></view>
|
|
|
|
398
|
+ <view class="row"><text class="label">装车费</text><text class="value">{{ formatNumber(form.loadingFee) }}</text></view>
|
|
|
|
399
|
+ <view class="row"><text class="label">开票品名</text><text class="value">{{ safeText(form.invoiceProductName) }}</text></view>
|
|
|
|
400
|
+ <view class="row"><text class="label">交货日期</text><text class="value">{{ formatDateOnly(form.deliveryDate) }}</text></view>
|
|
|
|
401
|
+ <view class="row"><text class="label">结算方式</text><text class="value">{{ safeText(form.settlementMethod) }}</text></view>
|
|
|
|
402
|
+ <view class="row"><text class="label">结算比例(%)</text><text class="value">{{ formatNumber(form.settlementRatio) }}</text></view>
|
|
|
|
403
|
+ <view class="row"><text class="label">价格表编号</text><text class="value">{{ priceTableDisplay }}</text></view>
|
|
|
|
404
|
+ <view class="row"><text class="label">协调事由</text><text class="value">{{ safeText(form.coordinationReason) }}</text></view>
|
|
|
|
405
|
+ <view class="row"><text class="label">票类状况</text><text class="value">{{ safeText(form.invoiceTypeStatus) }}</text></view>
|
|
|
|
406
|
+ <view class="row"><text class="label">数量合计</text><text class="value">{{ formatNumber(form.totalQuantity) }}</text></view>
|
|
|
|
407
|
+ <view class="row" v-if="attachmentList.length">
|
|
|
|
408
|
+ <text class="label">附件</text>
|
|
|
|
409
|
+ <view class="attach-list">
|
|
|
|
410
|
+ <view v-for="(at, idx) in attachmentList" :key="idx" class="attach-item">
|
|
|
|
411
|
+ <text class="attach-name">{{ at.name }}</text>
|
|
|
|
412
|
+ <text class="attach-view" @click.stop="onPreviewAttachment(at)">查看</text>
|
|
|
|
413
|
+ </view>
|
|
|
|
414
|
+ </view>
|
|
|
|
415
|
+ </view>
|
|
|
|
416
|
+ </view>
|
|
|
|
417
|
+
|
|
|
|
418
|
+ <ProductRel
|
|
|
|
419
|
+ mode="view"
|
|
|
|
420
|
+ :list="lineListWithName"
|
|
|
|
421
|
+ :product-options="productOptions"
|
|
|
|
422
|
+ :workshop-options="workshopOptions"
|
|
|
|
423
|
+ :shipping-cost="form.shippingCost"
|
|
|
|
424
|
+ :price-map="priceMap"
|
|
|
|
425
|
+ />
|
|
|
|
426
|
+
|
|
|
|
427
|
+ <view class="title-header">
|
|
|
|
428
|
+ <image class="title-header_icon" src="/static/images/title.png" />
|
|
|
|
429
|
+ <span>料质状况</span>
|
|
|
|
430
|
+ </view>
|
|
|
|
431
|
+ <view class="section">
|
|
|
|
432
|
+ <view class="row"><text class="label">是否启用料质状况</text><text class="value">{{ boolText(form.materialConditionEnabled) }}</text></view>
|
|
|
|
433
|
+ <template v-if="form.materialConditionEnabled">
|
|
|
|
434
|
+ <view v-for="mc in materialConditionConfigs" :key="mc.field" class="material-group">
|
|
|
|
435
|
+ <text class="material-label">{{ mc.label }}</text>
|
|
|
|
436
|
+ <view class="tag-list">
|
|
|
|
437
|
+ <view v-for="opt in getDictOptions(mc.dictCode)" :key="opt.code" class="tag-btn" :class="{ active: isTagSelected(mc.field, opt.code) }">{{ opt.name }}</view>
|
|
|
|
438
|
+ </view>
|
|
|
|
439
|
+ </view>
|
|
|
|
440
|
+ </template>
|
|
|
|
441
|
+ </view>
|
|
|
|
442
|
+
|
|
|
|
443
|
+ <view class="title-header">
|
|
|
|
444
|
+ <image class="title-header_icon" src="/static/images/title.png" />
|
|
|
|
445
|
+ <span>备注</span>
|
|
|
|
446
|
+ </view>
|
|
|
|
447
|
+ <view class="section">
|
|
|
|
448
|
+ <text class="remark-text">{{ safeText(form.remark) }}</text>
|
|
|
|
449
|
+ </view>
|
|
|
|
450
|
+
|
|
|
|
451
|
+ <view class="title-header">
|
|
|
|
452
|
+ <image class="title-header_icon" src="/static/images/title.png" />
|
|
|
|
453
|
+ <span>变更事由</span>
|
|
|
|
454
|
+ </view>
|
|
|
|
455
|
+ <view class="section">
|
|
|
|
456
|
+ <text class="remark-text">{{ safeText(form.changeReason) }}</text>
|
|
|
|
457
|
+ </view>
|
|
|
|
458
|
+ </template>
|
|
|
|
459
|
+ </scroll-view>
|
|
|
|
460
|
+
|
|
|
|
461
|
+ <RelateSelectSheet
|
|
|
|
462
|
+ v-if="companySheetVisible"
|
|
|
|
463
|
+ :visible.sync="companySheetVisible"
|
|
|
|
464
|
+ title="选择公司"
|
|
|
|
465
|
+ :fetch-fn="fetchCompanyList"
|
|
|
|
466
|
+ :display-fields="companyDisplayFields"
|
|
|
|
467
|
+ :page-size="20"
|
|
|
|
468
|
+ :multiple="false"
|
|
|
|
469
|
+ row-key="id"
|
|
|
|
470
|
+ @confirm="onCompanyConfirm"
|
|
|
|
471
|
+ />
|
|
|
|
472
|
+ <RelateSelectSheet
|
|
|
|
473
|
+ v-if="priceSheetVisible"
|
|
|
|
474
|
+ :visible.sync="priceSheetVisible"
|
|
|
|
475
|
+ title="选择价格表"
|
|
|
|
476
|
+ :fetch-fn="fetchPriceTableList"
|
|
|
|
477
|
+ :display-fields="priceTableDisplayFields"
|
|
|
|
478
|
+ :page-size="20"
|
|
|
|
479
|
+ :multiple="false"
|
|
|
|
480
|
+ row-key="id"
|
|
|
|
481
|
+ @confirm="onPriceTableConfirm"
|
|
|
|
482
|
+ />
|
|
|
|
483
|
+ <SingleSelectSheet
|
|
|
|
484
|
+ :visible.sync="workshopSheet.visible"
|
|
|
|
485
|
+ title="请选择分厂"
|
|
|
|
486
|
+ :options="workshopSheet.options"
|
|
|
|
487
|
+ v-model="workshopSheet.value"
|
|
|
|
488
|
+ @confirm="onWorkshopConfirm"
|
|
|
|
489
|
+ />
|
|
|
|
490
|
+ </view>
|
|
|
|
491
|
+</template>
|
|
|
|
492
|
+
|
|
|
|
493
|
+<script>
|
|
|
|
494
|
+import ProductRel from './productRel.vue'
|
|
|
|
495
|
+import { procurementPlanReplenishFindByIdApi } from '@/api/procure-manage/procurementPlan.js'
|
|
|
|
496
|
+import { getDicByCodes, getDicName } from '@/utils/dic.js'
|
|
|
|
497
|
+import { priceTableQueryApi, breedRelationshipQueryApi, workshopQueryApi, companyShortQueryApi } from '@/api/devManage.js'
|
|
|
|
498
|
+import { getInfo } from '@/api/login.js'
|
|
|
|
499
|
+import RelateSelectSheet from '@/components/relate-select/index.vue'
|
|
|
|
500
|
+import SingleSelectSheet from '@/components/single-select/index.vue'
|
|
|
|
501
|
+
|
|
|
|
502
|
+export default {
|
|
|
|
503
|
+ name: 'SupplePlanViewer',
|
|
|
|
504
|
+ components: { ProductRel, RelateSelectSheet, SingleSelectSheet },
|
|
|
|
505
|
+ props: {
|
|
|
|
506
|
+ id: { type: [String, Number], default: '' },
|
|
|
|
507
|
+ roleCodes: { type: Array, default: function () { return [] } }
|
|
|
|
508
|
+ },
|
|
|
|
509
|
+ data() {
|
|
|
|
510
|
+ return {
|
|
|
|
511
|
+ form: {},
|
|
|
|
512
|
+ lineList: [],
|
|
|
|
513
|
+ attachmentList: [],
|
|
|
|
514
|
+ _roleCodesFromApi: [],
|
|
|
|
515
|
+ materialConditionConfigs: [
|
|
|
|
516
|
+ { field: 'materialConditionCopperRice', label: '铜米', dictCode: 'COPPER_RICE' },
|
|
|
|
517
|
+ { field: 'materialConditionBrightCopper', label: '光亮铜', dictCode: 'BRIGHT_COPPER' },
|
|
|
|
518
|
+ { field: 'materialConditionFirstClass', label: '一特', dictCode: 'FIRST_CLASS' },
|
|
|
|
519
|
+ { field: 'materialConditionSecondClass', label: '二特', dictCode: 'SECOND_CLASS' },
|
|
|
|
520
|
+ { field: 'materialConditionTinCoated', label: '镀锡紫', dictCode: 'TIN_COATED' },
|
|
|
|
521
|
+ { field: 'materialConditionScrap', label: '角料', dictCode: 'SCRAP' },
|
|
|
|
522
|
+ { field: 'materialConditionWhiteYellow', label: '镀白黄', dictCode: 'WHITE_YELLOW' },
|
|
|
|
523
|
+ { field: 'materialConditionPhosphorCopper', label: '磷铜', dictCode: 'PHOSPHOR_COPPER' }
|
|
|
|
524
|
+ ],
|
|
|
|
525
|
+ dicOptions: {
|
|
|
|
526
|
+ AUDIT_STATUS: [],
|
|
|
|
527
|
+ PROCESS_STATUS: [],
|
|
|
|
528
|
+ DELIVERY_METHOD: []
|
|
|
|
529
|
+ },
|
|
|
|
530
|
+ dictData: {},
|
|
|
|
531
|
+ priceTableList: [],
|
|
|
|
532
|
+ priceMap: {},
|
|
|
|
533
|
+ productOptions: [],
|
|
|
|
534
|
+ workshopOptions: [],
|
|
|
|
535
|
+ isGyglkzg: false,
|
|
|
|
536
|
+ isGyglkzlglg: false,
|
|
|
|
537
|
+ isGyglkjhgly: false,
|
|
|
|
538
|
+ companySheetVisible: false,
|
|
|
|
539
|
+ priceSheetVisible: false,
|
|
|
|
540
|
+ priceTableCodeLabel: '',
|
|
|
|
541
|
+ workshopSheet: { visible: false, title: '请选择分厂', options: [], value: '', idx: -1 },
|
|
|
|
542
|
+ companyDisplayFields: [
|
|
|
|
543
|
+ { label: '公司简称', field: 'shortName' },
|
|
|
|
544
|
+ { label: '公司名称', field: 'companyName' },
|
|
|
|
545
|
+ { label: '办事处', field: 'deptName' }
|
|
|
|
546
|
+ ],
|
|
|
|
547
|
+ priceTableDisplayFields: [
|
|
|
|
548
|
+ { label: '价格表编号', field: 'priceTableCode' },
|
|
|
|
549
|
+ { label: '名称', field: 'priceTableName' },
|
|
|
|
550
|
+ { label: '日期', field: 'effectiveDate' }
|
|
|
|
551
|
+ ]
|
|
|
|
552
|
+ }
|
|
|
|
553
|
+ },
|
|
|
|
554
|
+ computed: {
|
|
|
|
555
|
+ isEditLayout() {
|
|
|
|
556
|
+ return this.canEdit || this.canEditWorkshop
|
|
|
|
557
|
+ },
|
|
|
|
558
|
+ parentRoleCodes() {
|
|
|
|
559
|
+ try {
|
|
|
|
560
|
+ var codes = null
|
|
|
|
561
|
+ var p = this.$parent
|
|
|
|
562
|
+ for (var i = 0; i < 5 && p; i++) {
|
|
|
|
563
|
+ if (p.roleCodes != null && Array.isArray(p.roleCodes)) {
|
|
|
|
564
|
+ codes = p.roleCodes
|
|
|
|
565
|
+ break
|
|
|
|
566
|
+ }
|
|
|
|
567
|
+ if (p.$store && p.$store.getters && Array.isArray(p.$store.getters.roleCodes)) {
|
|
|
|
568
|
+ codes = p.$store.getters.roleCodes
|
|
|
|
569
|
+ break
|
|
|
|
570
|
+ }
|
|
|
|
571
|
+ p = p.$parent
|
|
|
|
572
|
+ }
|
|
|
|
573
|
+ if (!codes && this.$store && this.$store.getters && Array.isArray(this.$store.getters.roleCodes)) {
|
|
|
|
574
|
+ codes = this.$store.getters.roleCodes
|
|
|
|
575
|
+ }
|
|
|
|
576
|
+ return Array.isArray(codes) ? codes : []
|
|
|
|
577
|
+ } catch (e) {
|
|
|
|
578
|
+ return []
|
|
|
|
579
|
+ }
|
|
|
|
580
|
+ },
|
|
|
|
581
|
+ mergedRoleCodes() {
|
|
|
|
582
|
+ var r1 = Array.isArray(this.roleCodes) ? this.roleCodes : []
|
|
|
|
583
|
+ var r2 = Array.isArray(this.parentRoleCodes) ? this.parentRoleCodes : []
|
|
|
|
584
|
+ if (!r1.length && !r2.length) return []
|
|
|
|
585
|
+ var map = {}
|
|
|
|
586
|
+ ;[].concat(r1).concat(r2).forEach(function (c) {
|
|
|
|
587
|
+ if (c != null && c !== '') map[String(c)] = true
|
|
|
|
588
|
+ })
|
|
|
|
589
|
+ return Object.keys(map)
|
|
|
|
590
|
+ },
|
|
|
|
591
|
+ isAuditPage() {
|
|
|
|
592
|
+ try {
|
|
|
|
593
|
+ if (Array.isArray(this.parentRoleCodes) && this.parentRoleCodes.length) {
|
|
|
|
594
|
+ return true
|
|
|
|
595
|
+ }
|
|
|
|
596
|
+ var pages = getCurrentPages()
|
|
|
|
597
|
+ var cur = pages[pages.length - 1]
|
|
|
|
598
|
+ var route = cur && cur.route ? String(cur.route) : ''
|
|
|
|
599
|
+ var options = cur && cur.options ? cur.options : {}
|
|
|
|
600
|
+ var path = (cur && cur.$page && cur.$page.fullPath) ? String(cur.$page.fullPath) : ''
|
|
|
|
601
|
+ var url = (cur && cur.url) ? String(cur.url) : ''
|
|
|
|
602
|
+ if (
|
|
|
|
603
|
+ route.indexOf('pages/flow/audit') !== -1 ||
|
|
|
|
604
|
+ route === 'pages/flow/audit' ||
|
|
|
|
605
|
+ path.indexOf('pages/flow/audit') !== -1 ||
|
|
|
|
606
|
+ url.indexOf('pages/flow/audit') !== -1 ||
|
|
|
|
607
|
+ (options && options.taskId) ||
|
|
|
|
608
|
+ (options && options.instanceId)
|
|
|
|
609
|
+ ) {
|
|
|
|
610
|
+ return true
|
|
|
|
611
|
+ }
|
|
|
|
612
|
+ var p2 = this.$parent
|
|
|
|
613
|
+ for (var j = 0; j < 5 && p2; j++) {
|
|
|
|
614
|
+ var n = p2.$options && p2.$options.name ? String(p2.$options.name) : ''
|
|
|
|
615
|
+ var r = p2.$options && p2.$options.__file ? String(p2.$options.__file) : ''
|
|
|
|
616
|
+ if (
|
|
|
|
617
|
+ n.indexOf('Audit') !== -1 ||
|
|
|
|
618
|
+ n === 'FlowAudit' ||
|
|
|
|
619
|
+ r.indexOf('flow/audit') !== -1 ||
|
|
|
|
620
|
+ (p2.auditCtx && typeof p2.auditCtx === 'object')
|
|
|
|
621
|
+ ) {
|
|
|
|
622
|
+ return true
|
|
|
|
623
|
+ }
|
|
|
|
624
|
+ p2 = p2.$parent
|
|
|
|
625
|
+ }
|
|
|
|
626
|
+ return false
|
|
|
|
627
|
+ } catch (e) {
|
|
|
|
628
|
+ return false
|
|
|
|
629
|
+ }
|
|
|
|
630
|
+ },
|
|
|
|
631
|
+ canEdit() {
|
|
|
|
632
|
+ var codes = this.mergedRoleCodes.length ? this.mergedRoleCodes : (Array.isArray(this._roleCodesFromApi) ? this._roleCodesFromApi : [])
|
|
|
|
633
|
+ return (codes.includes('gyglkjhgly')) && this.isAuditPage
|
|
|
|
634
|
+ },
|
|
|
|
635
|
+ canEditWorkshop() {
|
|
|
|
636
|
+ var codes = this.mergedRoleCodes.length ? this.mergedRoleCodes : (Array.isArray(this._roleCodesFromApi) ? this._roleCodesFromApi : [])
|
|
|
|
637
|
+ return codes.includes('gyglkzlglg') && this.isAuditPage
|
|
|
|
638
|
+ },
|
|
|
|
639
|
+ productMap() {
|
|
|
|
640
|
+ var list = Array.isArray(this.productOptions) ? this.productOptions : []
|
|
|
|
641
|
+ var m = {}
|
|
|
|
642
|
+ list.forEach(function (o) {
|
|
|
|
643
|
+ var key = String(o.productId || o.id || o.value || '')
|
|
|
|
644
|
+ if (key) m[key] = o
|
|
|
|
645
|
+ })
|
|
|
|
646
|
+ return m
|
|
|
|
647
|
+ },
|
|
|
|
648
|
+ workshopMap() {
|
|
|
|
649
|
+ var list = Array.isArray(this.workshopOptions) ? this.workshopOptions : []
|
|
|
|
650
|
+ var m = {}
|
|
|
|
651
|
+ list.forEach(function (o) {
|
|
|
|
652
|
+ var key = String(o.workshopId || o.id || o.value || '')
|
|
|
|
653
|
+ if (key) m[key] = o
|
|
|
|
654
|
+ })
|
|
|
|
655
|
+ return m
|
|
|
|
656
|
+ },
|
|
|
|
657
|
+ lineListWithName() {
|
|
|
|
658
|
+ var self = this
|
|
|
|
659
|
+ var list = Array.isArray(this.lineList) ? this.lineList : []
|
|
|
|
660
|
+ return list.map(function (row) {
|
|
|
|
661
|
+ if (!row.productName) {
|
|
|
|
662
|
+ var pid = String(row.productId || '')
|
|
|
|
663
|
+ var p = pid ? self.productMap[pid] : null
|
|
|
|
664
|
+ if (p) row.productName = p.productName || p.name || p.label || ''
|
|
|
|
665
|
+ }
|
|
|
|
666
|
+ if (!row.workshopName) {
|
|
|
|
667
|
+ var wid = String(row.workshopId || '')
|
|
|
|
668
|
+ var w = wid ? self.workshopMap[wid] : null
|
|
|
|
669
|
+ if (w) row.workshopName = w.workshopName || w.name || w.label || ''
|
|
|
|
670
|
+ }
|
|
|
|
671
|
+ return row
|
|
|
|
672
|
+ })
|
|
|
|
673
|
+ },
|
|
|
|
674
|
+ priceTableDisplay() {
|
|
|
|
675
|
+ var d = this.form || {}
|
|
|
|
676
|
+ var code = d.priceTableCode != null ? String(d.priceTableCode).trim() : (d.priceId != null ? String(d.priceId).trim() : (d.priceTableId != null ? String(d.priceTableId).trim() : ''))
|
|
|
|
677
|
+ var name = d.priceTableName || d.tableName || d.name || ''
|
|
|
|
678
|
+ if (name || code) {
|
|
|
|
679
|
+ return (name ? name + (code ? ' (' + code + ')' : '') : String(code))
|
|
|
|
680
|
+ }
|
|
|
|
681
|
+ return '-'
|
|
|
|
682
|
+ },
|
|
|
|
683
|
+ purchaseDepartmentDisplay() {
|
|
|
|
684
|
+ var d = this.form || {}
|
|
|
|
685
|
+ return d.purchaseDepartmentName != null ? d.purchaseDepartmentName : (d.purchaseDepartment != null ? d.purchaseDepartment : '')
|
|
|
|
686
|
+ },
|
|
|
|
687
|
+ regionDisplay() {
|
|
|
|
688
|
+ var d = this.form || {}
|
|
|
|
689
|
+ return d.regionName != null ? d.regionName : (d.region != null ? d.region : '')
|
|
|
|
690
|
+ },
|
|
|
|
691
|
+ pricingDeadlineDisplay() {
|
|
|
|
692
|
+ var d = this.form || {}
|
|
|
|
693
|
+ var s = d.pricingDeadline == null ? '' : String(d.pricingDeadline).trim()
|
|
|
|
694
|
+ if (!s) return ''
|
|
|
|
695
|
+ if (s.length >= 10) return s.slice(0, 10)
|
|
|
|
696
|
+ return s
|
|
|
|
697
|
+ },
|
|
|
|
698
|
+ deliveryDateDisplay() {
|
|
|
|
699
|
+ var d = this.form || {}
|
|
|
|
700
|
+ var s = d.deliveryDate == null ? '' : String(d.deliveryDate).trim()
|
|
|
|
701
|
+ if (!s) return ''
|
|
|
|
702
|
+ if (s.length >= 10) return s.slice(0, 10)
|
|
|
|
703
|
+ return s
|
|
|
|
704
|
+ },
|
|
|
|
705
|
+ shippingCostDisplay() {
|
|
|
|
706
|
+ var v = (this.form || {}).shippingCost
|
|
|
|
707
|
+ if (v == null || v === '') return ''
|
|
|
|
708
|
+ var n = Number(v)
|
|
|
|
709
|
+ if (isNaN(n)) return String(v)
|
|
|
|
710
|
+ return n
|
|
|
|
711
|
+ },
|
|
|
|
712
|
+ loadingFeeDisplay() {
|
|
|
|
713
|
+ var v = (this.form || {}).loadingFee
|
|
|
|
714
|
+ if (v == null || v === '') return ''
|
|
|
|
715
|
+ var n = Number(v)
|
|
|
|
716
|
+ if (isNaN(n)) return String(v)
|
|
|
|
717
|
+ return n
|
|
|
|
718
|
+ },
|
|
|
|
719
|
+ settlementRatioDisplay() {
|
|
|
|
720
|
+ var v = (this.form || {}).settlementRatio
|
|
|
|
721
|
+ if (v == null || v === '') return ''
|
|
|
|
722
|
+ var n = Number(v)
|
|
|
|
723
|
+ if (isNaN(n)) return String(v)
|
|
|
|
724
|
+ return n
|
|
|
|
725
|
+ },
|
|
|
|
726
|
+ totalQuantityDisplay() {
|
|
|
|
727
|
+ var v = (this.form || {}).totalQuantity
|
|
|
|
728
|
+ if (v == null || v === '') return ''
|
|
|
|
729
|
+ var n = Number(v)
|
|
|
|
730
|
+ if (isNaN(n)) return String(v)
|
|
|
|
731
|
+ return n
|
|
|
|
732
|
+ }
|
|
|
|
733
|
+ },
|
|
|
|
734
|
+ created() {
|
|
|
|
735
|
+ this.getUserInfo()
|
|
|
|
736
|
+ this.loadDictData()
|
|
|
|
737
|
+ this.loadRefData()
|
|
|
|
738
|
+ },
|
|
|
|
739
|
+ watch: {
|
|
|
|
740
|
+ id: {
|
|
|
|
741
|
+ immediate: true,
|
|
|
|
742
|
+ handler(val) {
|
|
|
|
743
|
+ const v = (val !== undefined && val !== null) ? String(val) : ''
|
|
|
|
744
|
+ if (v) this.loadDetail(v)
|
|
|
|
745
|
+ }
|
|
|
|
746
|
+ }
|
|
|
|
747
|
+ },
|
|
|
|
748
|
+ methods: {
|
|
|
|
749
|
+ getUserInfo() {
|
|
|
|
750
|
+ var self = this
|
|
|
|
751
|
+ getInfo()
|
|
|
|
752
|
+ .then((res) => {
|
|
|
|
753
|
+ var codes = Array.isArray(res?.roleCodes) ? res.roleCodes : []
|
|
|
|
754
|
+ self._roleCodesFromApi = codes
|
|
|
|
755
|
+ self.isGyglkzlglg = !!(codes.includes('gyglkzlglg') && codes.includes('001'))
|
|
|
|
756
|
+ self.isGyglkjhgly = codes.includes('gyglkjhgly')
|
|
|
|
757
|
+ })
|
|
|
|
758
|
+ .catch((err) => {
|
|
|
|
759
|
+ console.error('获取用户信息失败:', err)
|
|
|
|
760
|
+ })
|
|
|
|
761
|
+ },
|
|
|
|
762
|
+ toNumber(v) {
|
|
|
|
763
|
+ if (v == null || v === '') return 0
|
|
|
|
764
|
+ var n = Number(v)
|
|
|
|
765
|
+ return isNaN(n) ? 0 : n
|
|
|
|
766
|
+ },
|
|
|
|
767
|
+ lineNumberDisplay(v) {
|
|
|
|
768
|
+ if (v == null || v === '') return ''
|
|
|
|
769
|
+ var n = Number(v)
|
|
|
|
770
|
+ if (isNaN(n)) return String(v)
|
|
|
|
771
|
+ return n
|
|
|
|
772
|
+ },
|
|
|
|
773
|
+ getInputValue(e) {
|
|
|
|
774
|
+ if (e && e.detail && e.detail.value !== undefined) return e.detail.value
|
|
|
|
775
|
+ return e
|
|
|
|
776
|
+ },
|
|
|
|
777
|
+ async loadDictData() {
|
|
|
|
778
|
+ var self = this
|
|
|
|
779
|
+ var codes = [].concat(
|
|
|
|
780
|
+ this.materialConditionConfigs.map(function (mc) { return mc.dictCode }),
|
|
|
|
781
|
+ ['DELIVERY_METHOD', 'AUDIT_STATUS', 'PROCESS_STATUS']
|
|
|
|
782
|
+ )
|
|
|
|
783
|
+ try {
|
|
|
|
784
|
+ var results = await getDicByCodes(codes)
|
|
|
|
785
|
+ var d = results || {}
|
|
|
|
786
|
+ this.dictData = d
|
|
|
|
787
|
+ this.dicOptions.AUDIT_STATUS = (d.AUDIT_STATUS && d.AUDIT_STATUS.data) || []
|
|
|
|
788
|
+ this.dicOptions.PROCESS_STATUS = (d.PROCESS_STATUS && d.PROCESS_STATUS.data) || []
|
|
|
|
789
|
+ this.dicOptions.DELIVERY_METHOD = (d.DELIVERY_METHOD && d.DELIVERY_METHOD.data) || []
|
|
|
|
790
|
+ } catch (e) {
|
|
|
|
791
|
+ this.dictData = {}
|
|
|
|
792
|
+ }
|
|
|
|
793
|
+ },
|
|
|
|
794
|
+ getDictOptions(dictCode) {
|
|
|
|
795
|
+ var data = this.dictData[dictCode]
|
|
|
|
796
|
+ return (data && data.data) ? data.data : []
|
|
|
|
797
|
+ },
|
|
|
|
798
|
+ isTagSelected(field, code) {
|
|
|
|
799
|
+ var selected = this.form ? this.form[field] : undefined
|
|
|
|
800
|
+ if (Array.isArray(selected)) return selected.indexOf(code) >= 0
|
|
|
|
801
|
+ if (typeof selected === 'string' && selected) {
|
|
|
|
802
|
+ return selected.split(',').indexOf(code) >= 0
|
|
|
|
803
|
+ }
|
|
|
|
804
|
+ return false
|
|
|
|
805
|
+ },
|
|
|
|
806
|
+ getAuditStatusText(status) {
|
|
|
|
807
|
+ var v = status == null ? '' : String(status)
|
|
|
|
808
|
+ if (!v) return '-'
|
|
|
|
809
|
+ return getDicName('AUDIT_STATUS', v, this.dicOptions.AUDIT_STATUS) || v
|
|
|
|
810
|
+ },
|
|
|
|
811
|
+ getProcessStatusText(status) {
|
|
|
|
812
|
+ var v = status == null ? '' : String(status)
|
|
|
|
813
|
+ if (!v) return '-'
|
|
|
|
814
|
+ return getDicName('PROCESS_STATUS', v, this.dicOptions.PROCESS_STATUS) || v
|
|
|
|
815
|
+ },
|
|
|
|
816
|
+ getDeliveryMethodLabel() {
|
|
|
|
817
|
+ var opts = this.getDictOptions('DELIVERY_METHOD') || []
|
|
|
|
818
|
+ var v = String(this.form.deliveryMode != null ? this.form.deliveryMode : '')
|
|
|
|
819
|
+ if (!v) return '-'
|
|
|
|
820
|
+ for (var i = 0; i < opts.length; i++) {
|
|
|
|
821
|
+ var o = opts[i]
|
|
|
|
822
|
+ var code = o.code != null ? String(o.code) : (o.value != null ? String(o.value) : '')
|
|
|
|
823
|
+ if (code === v) return o.name || o.label || '-'
|
|
|
|
824
|
+ }
|
|
|
|
825
|
+ return v
|
|
|
|
826
|
+ },
|
|
|
|
827
|
+ buildPriceMap() {
|
|
|
|
828
|
+ var list = Array.isArray(this.priceTableList) ? this.priceTableList : []
|
|
|
|
829
|
+ var map = {}
|
|
|
|
830
|
+ list.forEach(function (item) {
|
|
|
|
831
|
+ var id = item && item.id != null ? String(item.id) : ''
|
|
|
|
832
|
+ var code = item && item.priceTableCode != null ? String(item.priceTableCode) : ''
|
|
|
|
833
|
+ if (id) map[id] = item
|
|
|
|
834
|
+ if (code) map[code] = item
|
|
|
|
835
|
+ })
|
|
|
|
836
|
+ this.priceMap = map
|
|
|
|
837
|
+ },
|
|
|
|
838
|
+ normalizePriceTableRow(item) {
|
|
|
|
839
|
+ if (!item) return item
|
|
|
|
840
|
+ if (!item.id && item.priceTableId) item.id = item.priceTableId
|
|
|
|
841
|
+ if (!item.priceTableId && item.id) item.priceTableId = item.id
|
|
|
|
842
|
+ if (!item.priceTableCode && item.code) item.priceTableCode = item.code
|
|
|
|
843
|
+ if (!item.priceTableName && item.name) item.priceTableName = item.name
|
|
|
|
844
|
+ return item
|
|
|
|
845
|
+ },
|
|
|
|
846
|
+ fillPriceTableFromDetail(d) {
|
|
|
|
847
|
+ var pId = d.priceTableId || d.priceId || ''
|
|
|
|
848
|
+ var pCode = d.priceTableCode || ''
|
|
|
|
849
|
+ if (!pId && !pCode) return
|
|
|
|
850
|
+ var target = null
|
|
|
|
851
|
+ var list = this.priceTableList
|
|
|
|
852
|
+ for (var i = 0; i < list.length; i++) {
|
|
|
|
853
|
+ var it = list[i]
|
|
|
|
854
|
+ if (pId && (String(it.id) === String(pId) || String(it.priceTableId) === String(pId))) { target = it; break }
|
|
|
|
855
|
+ }
|
|
|
|
856
|
+ if (!target && pCode) {
|
|
|
|
857
|
+ for (var j = 0; j < list.length; j++) {
|
|
|
|
858
|
+ var it2 = list[j]
|
|
|
|
859
|
+ if (String(it2.priceTableCode) === String(pCode)) { target = it2; break }
|
|
|
|
860
|
+ }
|
|
|
|
861
|
+ }
|
|
|
|
862
|
+ if (target) {
|
|
|
|
863
|
+ this.form.priceTableId = target.id || target.priceTableId || pId
|
|
|
|
864
|
+ this.form.priceId = target.id || target.priceId || pId
|
|
|
|
865
|
+ this.form.priceTableCode = target.priceTableCode || pCode
|
|
|
|
866
|
+ var label = target.priceTableName || ''
|
|
|
|
867
|
+ var codeLabel = target.priceTableCode || ''
|
|
|
|
868
|
+ if (label || codeLabel) this.priceTableCodeLabel = label ? label + (codeLabel ? ' (' + codeLabel + ')' : '') : codeLabel
|
|
|
|
869
|
+ }
|
|
|
|
870
|
+ },
|
|
|
|
871
|
+ async loadRefData() {
|
|
|
|
872
|
+ var self = this
|
|
|
|
873
|
+ try {
|
|
|
|
874
|
+ var results = await Promise.all([
|
|
|
|
875
|
+ this.pCall(priceTableQueryApi, { pageIndex: 1, pageSize: 1000 }),
|
|
|
|
876
|
+ this.pCall(breedRelationshipQueryApi, { pageIndex: 1, pageSize: 1000 }),
|
|
|
|
877
|
+ this.pCall(workshopQueryApi, { pageIndex: 1, pageSize: 1000 })
|
|
|
|
878
|
+ ])
|
|
|
|
879
|
+ var r0 = (results[0] && results[0].data) ? results[0].data : {}
|
|
|
|
880
|
+ var r1 = (results[1] && results[1].data) ? results[1].data : {}
|
|
|
|
881
|
+ var r2 = (results[2] && results[2].data) ? results[2].data : {}
|
|
|
|
882
|
+ var rawPriceTableList = (r0.datas && Array.isArray(r0.datas)) ? r0.datas : ((r0.list && Array.isArray(r0.list)) ? r0.list : ((r0.records && Array.isArray(r0.records)) ? r0.records : []))
|
|
|
|
883
|
+ self.priceTableList = Array.isArray(rawPriceTableList) ? rawPriceTableList.map(function (item) { return self.normalizePriceTableRow(item) }) : []
|
|
|
|
884
|
+ self.productOptions = (r1.datas && Array.isArray(r1.datas)) ? r1.datas : ((r1.list && Array.isArray(r1.list)) ? r1.list : ((r1.records && Array.isArray(r1.records)) ? r1.records : []))
|
|
|
|
885
|
+ self.workshopOptions = (r2.datas && Array.isArray(r2.datas)) ? r2.datas : ((r2.list && Array.isArray(r2.list)) ? r2.list : ((r2.records && Array.isArray(r2.records)) ? r2.records : []))
|
|
|
|
886
|
+ self.buildPriceMap()
|
|
|
|
887
|
+ if (self.isGyglkjhgly && self.isAuditPage && !self.priceTableCodeLabel && (self.form.priceTableId || self.form.priceId || self.form.priceTableCode)) {
|
|
|
|
888
|
+ self.fillPriceTableFromDetail(self.form)
|
|
|
|
889
|
+ }
|
|
|
|
890
|
+ } catch (e) {
|
|
|
|
891
|
+ self.priceTableList = []
|
|
|
|
892
|
+ self.productOptions = []
|
|
|
|
893
|
+ self.workshopOptions = []
|
|
|
|
894
|
+ self.priceMap = {}
|
|
|
|
895
|
+ }
|
|
|
|
896
|
+ },
|
|
|
|
897
|
+ pCall(fn, params) {
|
|
|
|
898
|
+ try {
|
|
|
|
899
|
+ return Promise.resolve(fn(params))
|
|
|
|
900
|
+ } catch (e) {
|
|
|
|
901
|
+ return Promise.reject(e)
|
|
|
|
902
|
+ }
|
|
|
|
903
|
+ },
|
|
|
|
904
|
+ boolText(v) {
|
|
|
|
905
|
+ if (typeof v === 'boolean') return v ? '是' : '否'
|
|
|
|
906
|
+ if (v === 'true' || v === '1' || v === 1) return '是'
|
|
|
|
907
|
+ if (v === 'false' || v === '0' || v === 0) return '否'
|
|
|
|
908
|
+ return '-'
|
|
|
|
909
|
+ },
|
|
|
|
910
|
+ formatDateOnly(v) {
|
|
|
|
911
|
+ var s = v == null ? '' : String(v).trim()
|
|
|
|
912
|
+ if (!s) return '-'
|
|
|
|
913
|
+ if (s.length >= 10) return s.slice(0, 10)
|
|
|
|
914
|
+ return s
|
|
|
|
915
|
+ },
|
|
|
|
916
|
+ safeText(v) {
|
|
|
|
917
|
+ var s = v == null ? '' : String(v)
|
|
|
|
918
|
+ return s.trim() ? s : '-'
|
|
|
|
919
|
+ },
|
|
|
|
920
|
+ formatNumber(v) {
|
|
|
|
921
|
+ if (v == null || v === '') return '-'
|
|
|
|
922
|
+ var n = Number(v)
|
|
|
|
923
|
+ if (isNaN(n)) return String(v)
|
|
|
|
924
|
+ return n
|
|
|
|
925
|
+ },
|
|
|
|
926
|
+ buildAttachmentList() {
|
|
|
|
927
|
+ var ids = this.form.attachmentFileIds
|
|
|
|
928
|
+ var names = this.form.attachmentFileNames
|
|
|
|
929
|
+ var idArr = (typeof ids === 'string' && ids) ? ids.split(',').filter(Boolean) : (Array.isArray(ids) ? ids : [])
|
|
|
|
930
|
+ var nameArr = (typeof names === 'string' && names) ? names.split(',').filter(Boolean) : (Array.isArray(names) ? names : [])
|
|
|
|
931
|
+ var len = Math.max(idArr.length, nameArr.length)
|
|
|
|
932
|
+ var list = []
|
|
|
|
933
|
+ for (var i = 0; i < len; i++) {
|
|
|
|
934
|
+ list.push({ id: idArr[i] || '', name: nameArr[i] || ('附件' + (i + 1)) })
|
|
|
|
935
|
+ }
|
|
|
|
936
|
+ this.attachmentList = list
|
|
|
|
937
|
+ },
|
|
|
|
938
|
+ onShippingCostInput(e) {
|
|
|
|
939
|
+ var v = this.getInputValue(e)
|
|
|
|
940
|
+ if (v != null && v !== '' && !isNaN(Number(v)) && Number(v) < 0) {
|
|
|
|
941
|
+ this.form.shippingCost = 0
|
|
|
|
942
|
+ }
|
|
|
|
943
|
+ this.recalcIncludingShipping()
|
|
|
|
944
|
+ },
|
|
|
|
945
|
+ onShippingCostBlur(e) {
|
|
|
|
946
|
+ var v = (e && e.detail && e.detail.value != null) ? e.detail.value : this.form.shippingCost
|
|
|
|
947
|
+ if (v == null || v === '') return
|
|
|
|
948
|
+ var n = Number(v)
|
|
|
|
949
|
+ if (isNaN(n)) return
|
|
|
|
950
|
+ if (n < 0) { this.form.shippingCost = 0; this.recalcIncludingShipping(); return }
|
|
|
|
951
|
+ this.form.shippingCost = n
|
|
|
|
952
|
+ this.recalcIncludingShipping()
|
|
|
|
953
|
+ },
|
|
|
|
954
|
+ recalcIncludingShipping() {
|
|
|
|
955
|
+ var self = this
|
|
|
|
956
|
+ var sc = this.toNumber(this.form.shippingCost)
|
|
|
|
957
|
+ var lines = Array.isArray(this.lineList) ? this.lineList : []
|
|
|
|
958
|
+ lines.forEach(function (line) {
|
|
|
|
959
|
+ var actual = Number(line.actualPurchasePrice)
|
|
|
|
960
|
+ if (!isNaN(actual)) {
|
|
|
|
961
|
+ line.includingShippingPrice = actual + sc
|
|
|
|
962
|
+ }
|
|
|
|
963
|
+ })
|
|
|
|
964
|
+ },
|
|
|
|
965
|
+ onLinePriceInput(idx, e) {
|
|
|
|
966
|
+ var v = this.getInputValue(e)
|
|
|
|
967
|
+ var lines = Array.isArray(this.lineList) ? this.lineList : []
|
|
|
|
968
|
+ var line = lines[idx]
|
|
|
|
969
|
+ if (!line) return
|
|
|
|
970
|
+ if (v != null && v !== '' && !isNaN(Number(v)) && Number(v) < 0) {
|
|
|
|
971
|
+ line.priceListPrices = 0
|
|
|
|
972
|
+ }
|
|
|
|
973
|
+ },
|
|
|
|
974
|
+ onLinePriceBlur(idx) {
|
|
|
|
975
|
+ var lines = Array.isArray(this.lineList) ? this.lineList : []
|
|
|
|
976
|
+ var line = lines[idx]
|
|
|
|
977
|
+ if (!line) return
|
|
|
|
978
|
+ var v = line.priceListPrices
|
|
|
|
979
|
+ if (v == null || v === '') return
|
|
|
|
980
|
+ var n = Number(v)
|
|
|
|
981
|
+ if (isNaN(n)) return
|
|
|
|
982
|
+ if (n < 0) { line.priceListPrices = 0; return }
|
|
|
|
983
|
+ line.priceListPrices = n
|
|
|
|
984
|
+ },
|
|
|
|
985
|
+ openCompanySheet() { this.companySheetVisible = true },
|
|
|
|
986
|
+ fetchCompanyList(params) {
|
|
|
|
987
|
+ try {
|
|
|
|
988
|
+ return Promise.resolve(companyShortQueryApi(params))
|
|
|
|
989
|
+ } catch (e) { return Promise.reject(e) }
|
|
|
|
990
|
+ },
|
|
|
|
991
|
+ onCompanyConfirm(rows) {
|
|
|
|
992
|
+ var row = Array.isArray(rows) && rows[0] ? rows[0] : null
|
|
|
|
993
|
+ if (!row) return
|
|
|
|
994
|
+ this.form.companyId = row.id || row.companyId || row.companyShortId || ''
|
|
|
|
995
|
+ this.form.companyShortId = row.companyShortId || row.id || row.companyId || ''
|
|
|
|
996
|
+ this.form.companyShortName = row.shortName || row.companyShortName || row.companyName || row.name || ''
|
|
|
|
997
|
+ this.form.companyName = row.companyName || row.name || row.shortName || ''
|
|
|
|
998
|
+ },
|
|
|
|
999
|
+ openPriceTableSheet() { this.priceSheetVisible = true },
|
|
|
|
1000
|
+ fetchPriceTableList(params) {
|
|
|
|
1001
|
+ try { return Promise.resolve(priceTableQueryApi(params)) } catch (e) { return Promise.reject(e) }
|
|
|
|
1002
|
+ },
|
|
|
|
1003
|
+ onPriceTableConfirm(rows) {
|
|
|
|
1004
|
+ var row = Array.isArray(rows) && rows[0] ? rows[0] : null
|
|
|
|
1005
|
+ if (!row) return
|
|
|
|
1006
|
+ var t = this.normalizePriceTableRow(row)
|
|
|
|
1007
|
+ this.form.priceTableId = t.id || t.priceTableId || ''
|
|
|
|
1008
|
+ this.form.priceId = t.id || t.priceId || ''
|
|
|
|
1009
|
+ this.form.priceTableCode = t.priceTableCode || ''
|
|
|
|
1010
|
+ var label = t.priceTableName || ''
|
|
|
|
1011
|
+ var codeLabel = t.priceTableCode || ''
|
|
|
|
1012
|
+ this.priceTableCodeLabel = label ? label + (codeLabel ? ' (' + codeLabel + ')' : '') : codeLabel
|
|
|
|
1013
|
+ this.fillLinePriceListPrices(t)
|
|
|
|
1014
|
+ },
|
|
|
|
1015
|
+ fillLinePriceListPrices(priceTable) {
|
|
|
|
1016
|
+ if (!priceTable) return
|
|
|
|
1017
|
+ var self = this
|
|
|
|
1018
|
+ var list = Array.isArray(this.lineList) ? this.lineList : []
|
|
|
|
1019
|
+ var lines = priceTable.lines || priceTable.priceTableLineList || []
|
|
|
|
1020
|
+ if (!Array.isArray(lines) || !lines.length) return
|
|
|
|
1021
|
+ list.forEach(function (line) {
|
|
|
|
1022
|
+ if (line.priceListPrices != null && line.priceListPrices !== '' && line.priceListPrices !== 0) return
|
|
|
|
1023
|
+ var pid = String(line.productId || '')
|
|
|
|
1024
|
+ if (!pid) return
|
|
|
|
1025
|
+ var target = null
|
|
|
|
1026
|
+ for (var i = 0; i < lines.length; i++) {
|
|
|
|
1027
|
+ var l = lines[i]
|
|
|
|
1028
|
+ var lid = String(l.productId || l.breedId || l.id || '')
|
|
|
|
1029
|
+ if (lid === pid) { target = l; break }
|
|
|
|
1030
|
+ }
|
|
|
|
1031
|
+ if (!target) return
|
|
|
|
1032
|
+ var p = target.price != null ? target.price : (target.actualPrice != null ? target.actualPrice : target.priceListPrices)
|
|
|
|
1033
|
+ if (p != null && p !== '') {
|
|
|
|
1034
|
+ var n = Number(p)
|
|
|
|
1035
|
+ if (!isNaN(n)) line.priceListPrices = n
|
|
|
|
1036
|
+ }
|
|
|
|
1037
|
+ })
|
|
|
|
1038
|
+ },
|
|
|
|
1039
|
+ openWorkshopSheet(idx) {
|
|
|
|
1040
|
+ var opts = Array.isArray(this.workshopOptions) ? this.workshopOptions.map(function (o) {
|
|
|
|
1041
|
+ return {
|
|
|
|
1042
|
+ label: o.workshopName != null ? o.workshopName : (o.name != null ? o.name : o.label),
|
|
|
|
1043
|
+ value: o.workshopId != null ? o.workshopId : (o.id != null ? o.id : o.value)
|
|
|
|
1044
|
+ }
|
|
|
|
1045
|
+ }) : []
|
|
|
|
1046
|
+ var lines = Array.isArray(this.lineList) ? this.lineList : []
|
|
|
|
1047
|
+ var line = lines[idx]
|
|
|
|
1048
|
+ var val = line ? (line.workshopId != null ? String(line.workshopId) : '') : ''
|
|
|
|
1049
|
+ this.workshopSheet = { visible: true, title: '请选择分厂', options: opts, value: val, idx: idx }
|
|
|
|
1050
|
+ },
|
|
|
|
1051
|
+ onWorkshopConfirm(value, label) {
|
|
|
|
1052
|
+ var idx = this.workshopSheet.idx
|
|
|
|
1053
|
+ var lines = Array.isArray(this.lineList) ? this.lineList : []
|
|
|
|
1054
|
+ var line = lines[idx]
|
|
|
|
1055
|
+ if (!line) return
|
|
|
|
1056
|
+ line.workshopId = value != null ? value : ''
|
|
|
|
1057
|
+ line.workshopName = label != null ? label : ''
|
|
|
|
1058
|
+ },
|
|
|
|
1059
|
+ getFormValues() {
|
|
|
|
1060
|
+ var self = this
|
|
|
|
1061
|
+ var form = this.form || {}
|
|
|
|
1062
|
+ var result = JSON.parse(JSON.stringify(form))
|
|
|
|
1063
|
+ this.materialConditionConfigs.forEach(function (mc) {
|
|
|
|
1064
|
+ var arr = form[mc.field]
|
|
|
|
1065
|
+ var listField = mc.field + 'List'
|
|
|
|
1066
|
+ if (Array.isArray(arr)) {
|
|
|
|
1067
|
+ result[mc.field] = arr.join(',')
|
|
|
|
1068
|
+ result[listField] = arr.slice()
|
|
|
|
1069
|
+ } else if (typeof arr === 'string' && arr) {
|
|
|
|
1070
|
+ result[mc.field] = arr
|
|
|
|
1071
|
+ result[listField] = arr.split(',').filter(Boolean)
|
|
|
|
1072
|
+ } else {
|
|
|
|
1073
|
+ result[mc.field] = ''
|
|
|
|
1074
|
+ result[listField] = []
|
|
|
|
1075
|
+ }
|
|
|
|
1076
|
+ })
|
|
|
|
1077
|
+ var lines = Array.isArray(this.lineList) ? this.lineList : []
|
|
|
|
1078
|
+ result.procurementPlanReplenishLineList = lines.map(function (r) {
|
|
|
|
1079
|
+ var line = JSON.parse(JSON.stringify(r))
|
|
|
|
1080
|
+ if (r.shippingCost != null && r.shippingCost !== '') {
|
|
|
|
1081
|
+ line.shippingCost = Number(r.shippingCost)
|
|
|
|
1082
|
+ }
|
|
|
|
1083
|
+ if (r.loadingFee != null && r.loadingFee !== '') {
|
|
|
|
1084
|
+ line.loadingFee = Number(r.loadingFee)
|
|
|
|
1085
|
+ }
|
|
|
|
1086
|
+ if (r.actualPurchasePrice != null && r.actualPurchasePrice !== '') {
|
|
|
|
1087
|
+ line.actualPurchasePrice = Number(r.actualPurchasePrice)
|
|
|
|
1088
|
+ }
|
|
|
|
1089
|
+ if (r.includingShippingPrice != null && r.includingShippingPrice !== '') {
|
|
|
|
1090
|
+ line.includingShippingPrice = Number(r.includingShippingPrice)
|
|
|
|
1091
|
+ }
|
|
|
|
1092
|
+ if (r.coordinationRange != null && r.coordinationRange !== '') {
|
|
|
|
1093
|
+ line.coordinationRange = Number(r.coordinationRange)
|
|
|
|
1094
|
+ }
|
|
|
|
1095
|
+ if (r.priceListPrices != null && r.priceListPrices !== '') {
|
|
|
|
1096
|
+ line.priceListPrices = Number(r.priceListPrices)
|
|
|
|
1097
|
+ }
|
|
|
|
1098
|
+ if (r.quantity != null && r.quantity !== '') {
|
|
|
|
1099
|
+ line.quantity = Number(r.quantity)
|
|
|
|
1100
|
+ }
|
|
|
|
1101
|
+ if (r.estimatedLoss != null && r.estimatedLoss !== '') {
|
|
|
|
1102
|
+ line.estimatedLoss = Number(r.estimatedLoss)
|
|
|
|
1103
|
+ }
|
|
|
|
1104
|
+ if (r.applicationAttrition != null && r.applicationAttrition !== '') {
|
|
|
|
1105
|
+ line.applicationAttrition = Number(r.applicationAttrition)
|
|
|
|
1106
|
+ }
|
|
|
|
1107
|
+ return line
|
|
|
|
1108
|
+ })
|
|
|
|
1109
|
+ return result
|
|
|
|
1110
|
+ },
|
|
|
|
1111
|
+ checkForm() {
|
|
|
|
1112
|
+ if (!this.canEdit && !this.canEditWorkshop) return true
|
|
|
|
1113
|
+ if (this.canEdit) {
|
|
|
|
1114
|
+ if (!this.form.companyId && !this.form.companyShortId) {
|
|
|
|
1115
|
+ uni.showToast({ title: '请选择公司名称', icon: 'none' }); return false
|
|
|
|
1116
|
+ }
|
|
|
|
1117
|
+ if (!this.form.invoiceProductName) {
|
|
|
|
1118
|
+ uni.showToast({ title: '请输入开票品名', icon: 'none' }); return false
|
|
|
|
1119
|
+ }
|
|
|
|
1120
|
+ }
|
|
|
|
1121
|
+ if (this.canEditWorkshop) {
|
|
|
|
1122
|
+ var lines = Array.isArray(this.lineList) ? this.lineList : []
|
|
|
|
1123
|
+ for (var i = 0; i < lines.length; i++) {
|
|
|
|
1124
|
+ var l = lines[i]
|
|
|
|
1125
|
+ if (!l.workshopId) {
|
|
|
|
1126
|
+ uni.showToast({ title: '请选择第' + (i + 1) + '条明细的分厂', icon: 'none' }); return false
|
|
|
|
1127
|
+ }
|
|
|
|
1128
|
+ }
|
|
|
|
1129
|
+ }
|
|
|
|
1130
|
+ return true
|
|
|
|
1131
|
+ },
|
|
|
|
1132
|
+ async loadDetail(id) {
|
|
|
|
1133
|
+ try {
|
|
|
|
1134
|
+ var res = await procurementPlanReplenishFindByIdApi({ id: id })
|
|
|
|
1135
|
+ var d = (res && res.data) ? res.data : {}
|
|
|
|
1136
|
+ var self = this
|
|
|
|
1137
|
+ var boolFields = ['longTermOperation', 'terminalCustomer', 'priced', 'temporaryPrice', 'otherExpenseSettlement', 'commodityBuyout', 'qualityBuyout', 'quantityBuyout', 'doorDelivery', 'materialConditionEnabled']
|
|
|
|
1138
|
+ boolFields.forEach(function (f) {
|
|
|
|
1139
|
+ var v = d[f]
|
|
|
|
1140
|
+ if (typeof v === 'string') {
|
|
|
|
1141
|
+ d[f] = v === 'true' || v === '1'
|
|
|
|
1142
|
+ } else if (typeof v === 'number') {
|
|
|
|
1143
|
+ d[f] = v === 1
|
|
|
|
1144
|
+ } else {
|
|
|
|
1145
|
+ d[f] = !!v
|
|
|
|
1146
|
+ }
|
|
|
|
1147
|
+ })
|
|
|
|
1148
|
+ this.materialConditionConfigs.forEach(function (mc) {
|
|
|
|
1149
|
+ var v = d[mc.field]
|
|
|
|
1150
|
+ if (typeof v === 'string' && v) {
|
|
|
|
1151
|
+ d[mc.field] = v.split(',').filter(Boolean)
|
|
|
|
1152
|
+ } else if (!Array.isArray(v)) {
|
|
|
|
1153
|
+ d[mc.field] = []
|
|
|
|
1154
|
+ }
|
|
|
|
1155
|
+ })
|
|
|
|
1156
|
+ this.form = d
|
|
|
|
1157
|
+ this.lineList = Array.isArray(d.procurementPlanReplenishLineList) ? d.procurementPlanReplenishLineList.slice() : []
|
|
|
|
1158
|
+ this.form.companyId = d.companyId || d.companyShortId || ''
|
|
|
|
1159
|
+ this.form.companyShortId = d.companyShortId || d.companyId || ''
|
|
|
|
1160
|
+ this.form.companyShortName = d.companyShortName || d.shortName || d.companyName || d.name || ''
|
|
|
|
1161
|
+ this.form.companyName = d.companyName || d.companyShortName || d.shortName || d.name || ''
|
|
|
|
1162
|
+ this.form.priceTableId = d.priceTableId || d.priceId || ''
|
|
|
|
1163
|
+ this.form.priceId = d.priceId || d.priceTableId || ''
|
|
|
|
1164
|
+ this.buildAttachmentList()
|
|
|
|
1165
|
+ if (this.isGyglkjhgly && this.isAuditPage) {
|
|
|
|
1166
|
+ this.fillPriceTableFromDetail(d)
|
|
|
|
1167
|
+ } else if (this.canEdit) {
|
|
|
|
1168
|
+ this.fillPriceTableFromDetail(d)
|
|
|
|
1169
|
+ }
|
|
|
|
1170
|
+ } catch (e) {
|
|
|
|
1171
|
+ this.form = {}
|
|
|
|
1172
|
+ this.lineList = []
|
|
|
|
1173
|
+ this.attachmentList = []
|
|
|
|
1174
|
+ }
|
|
|
|
1175
|
+ },
|
|
|
|
1176
|
+ onPreviewAttachment(at) {
|
|
|
|
1177
|
+ if (!at || !at.id) {
|
|
|
|
1178
|
+ uni.showToast({ title: '无法查看', icon: 'none' })
|
|
|
|
1179
|
+ return
|
|
|
|
1180
|
+ }
|
|
|
|
1181
|
+ uni.showToast({ title: '查看附件 ' + at.name, icon: 'none' })
|
|
|
|
1182
|
+ }
|
|
|
|
1183
|
+ }
|
|
|
|
1184
|
+}
|
|
|
|
1185
|
+</script>
|
|
|
|
1186
|
+
|
|
|
|
1187
|
+<style lang="scss" scoped>
|
|
|
|
1188
|
+.detail-page {
|
|
|
|
1189
|
+ background: #f3f3f3;
|
|
|
|
1190
|
+}
|
|
|
|
1191
|
+.scroll {
|
|
|
|
1192
|
+ flex: 1;
|
|
|
|
1193
|
+ padding: 8rpx 0 144rpx;
|
|
|
|
1194
|
+}
|
|
|
|
1195
|
+.title-header {
|
|
|
|
1196
|
+ display: flex;
|
|
|
|
1197
|
+ align-items: center;
|
|
|
|
1198
|
+ padding: 24rpx 32rpx 12rpx;
|
|
|
|
1199
|
+ background-color: #ffffff;
|
|
|
|
1200
|
+ margin-top: 20rpx;
|
|
|
|
1201
|
+ .title-header_icon {
|
|
|
|
1202
|
+ width: 36rpx;
|
|
|
|
1203
|
+ height: 36rpx;
|
|
|
|
1204
|
+ margin-right: 12rpx;
|
|
|
|
1205
|
+ }
|
|
|
|
1206
|
+ span {
|
|
|
|
1207
|
+ font-size: 34rpx;
|
|
|
|
1208
|
+ font-weight: 600;
|
|
|
|
1209
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
1210
|
+ }
|
|
|
|
1211
|
+}
|
|
|
|
1212
|
+.section {
|
|
|
|
1213
|
+ padding: 32rpx;
|
|
|
|
1214
|
+ background: #fff;
|
|
|
|
1215
|
+ margin-bottom: 20rpx;
|
|
|
|
1216
|
+}
|
|
|
|
1217
|
+.row {
|
|
|
|
1218
|
+ display: flex;
|
|
|
|
1219
|
+ margin-bottom: 28rpx;
|
|
|
|
1220
|
+ &:last-child { margin-bottom: 0; }
|
|
|
|
1221
|
+ &.company {
|
|
|
|
1222
|
+ font-size: 36rpx;
|
|
|
|
1223
|
+ font-weight: 600;
|
|
|
|
1224
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
1225
|
+ padding-top: 8rpx;
|
|
|
|
1226
|
+ line-height: 50rpx;
|
|
|
|
1227
|
+ }
|
|
|
|
1228
|
+ .label {
|
|
|
|
1229
|
+ max-width: 420rpx;
|
|
|
|
1230
|
+ margin-right: 20rpx;
|
|
|
|
1231
|
+ line-height: 32rpx;
|
|
|
|
1232
|
+ font-size: 28rpx;
|
|
|
|
1233
|
+ color: rgba(0, 0, 0, 0.6);
|
|
|
|
1234
|
+ }
|
|
|
|
1235
|
+ .value {
|
|
|
|
1236
|
+ flex: 1;
|
|
|
|
1237
|
+ line-height: 32rpx;
|
|
|
|
1238
|
+ font-size: 28rpx;
|
|
|
|
1239
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
1240
|
+ text-align: right;
|
|
|
|
1241
|
+ word-break: break-all;
|
|
|
|
1242
|
+ }
|
|
|
|
1243
|
+}
|
|
|
|
1244
|
+.attach-list {
|
|
|
|
1245
|
+ flex: 1;
|
|
|
|
1246
|
+ display: flex;
|
|
|
|
1247
|
+ flex-direction: column;
|
|
|
|
1248
|
+ align-items: flex-end;
|
|
|
|
1249
|
+ gap: 8rpx;
|
|
|
|
1250
|
+}
|
|
|
|
1251
|
+.attach-item {
|
|
|
|
1252
|
+ display: flex;
|
|
|
|
1253
|
+ align-items: center;
|
|
|
|
1254
|
+ gap: 16rpx;
|
|
|
|
1255
|
+ .attach-name {
|
|
|
|
1256
|
+ font-size: 26rpx;
|
|
|
|
1257
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
1258
|
+ }
|
|
|
|
1259
|
+ .attach-view {
|
|
|
|
1260
|
+ font-size: 26rpx;
|
|
|
|
1261
|
+ color: $theme-primary;
|
|
|
|
1262
|
+ }
|
|
|
|
1263
|
+}
|
|
|
|
1264
|
+.material-group {
|
|
|
|
1265
|
+ margin-top: 32rpx;
|
|
|
|
1266
|
+ &:first-child { margin-top: 0; }
|
|
|
|
1267
|
+}
|
|
|
|
1268
|
+.material-label {
|
|
|
|
1269
|
+ display: block;
|
|
|
|
1270
|
+ font-size: 28rpx;
|
|
|
|
1271
|
+ color: rgba(0, 0, 0, 0.6);
|
|
|
|
1272
|
+ margin-bottom: 20rpx;
|
|
|
|
1273
|
+}
|
|
|
|
1274
|
+.tag-list {
|
|
|
|
1275
|
+ display: flex;
|
|
|
|
1276
|
+ flex-wrap: wrap;
|
|
|
|
1277
|
+ gap: 16rpx;
|
|
|
|
1278
|
+}
|
|
|
|
1279
|
+.tag-btn {
|
|
|
|
1280
|
+ padding: 12rpx 24rpx;
|
|
|
|
1281
|
+ border: 1rpx solid #ddd;
|
|
|
|
1282
|
+ border-radius: 8rpx;
|
|
|
|
1283
|
+ font-size: 28rpx;
|
|
|
|
1284
|
+ color: #999;
|
|
|
|
1285
|
+ background: #f5f5f5;
|
|
|
|
1286
|
+}
|
|
|
|
1287
|
+.tag-btn.active {
|
|
|
|
1288
|
+ background: $theme-primary;
|
|
|
|
1289
|
+ border-color: $theme-primary;
|
|
|
|
1290
|
+ color: #fff;
|
|
|
|
1291
|
+}
|
|
|
|
1292
|
+.remark-text {
|
|
|
|
1293
|
+ font-size: 28rpx;
|
|
|
|
1294
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
1295
|
+ line-height: 1.6;
|
|
|
|
1296
|
+ white-space: pre-wrap;
|
|
|
|
1297
|
+}
|
|
|
|
1298
|
+
|
|
|
|
1299
|
+.edit-list {
|
|
|
|
1300
|
+ background: #ffffff;
|
|
|
|
1301
|
+}
|
|
|
|
1302
|
+.serial-number-row {
|
|
|
|
1303
|
+ display: flex;
|
|
|
|
1304
|
+ justify-content: flex-end;
|
|
|
|
1305
|
+ align-items: center;
|
|
|
|
1306
|
+ flex: 1;
|
|
|
|
1307
|
+ .readonly-text {
|
|
|
|
1308
|
+ font-size: 28rpx;
|
|
|
|
1309
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
1310
|
+ }
|
|
|
|
1311
|
+ .value-code {
|
|
|
|
1312
|
+ font-weight: 600;
|
|
|
|
1313
|
+ color: $theme-primary;
|
|
|
|
1314
|
+ }
|
|
|
|
1315
|
+}
|
|
|
|
1316
|
+.item-title {
|
|
|
|
1317
|
+ display: flex;
|
|
|
|
1318
|
+ align-items: center;
|
|
|
|
1319
|
+ font-size: 28rpx;
|
|
|
|
1320
|
+ color: rgba(0, 0, 0, 0.6);
|
|
|
|
1321
|
+ line-height: 32rpx;
|
|
|
|
1322
|
+ .required {
|
|
|
|
1323
|
+ color: #dd524d;
|
|
|
|
1324
|
+ margin-right: 6rpx;
|
|
|
|
1325
|
+ }
|
|
|
|
1326
|
+}
|
|
|
|
1327
|
+.select-item.is-filled {
|
|
|
|
1328
|
+ .uni-list-item__content {
|
|
|
|
1329
|
+ color: rgba(0, 0, 0, 0.9) !important;
|
|
|
|
1330
|
+ }
|
|
|
|
1331
|
+}
|
|
|
|
1332
|
+.readonly-text {
|
|
|
|
1333
|
+ font-size: 28rpx;
|
|
|
|
1334
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
1335
|
+}
|
|
|
|
1336
|
+.edit-line-list {
|
|
|
|
1337
|
+ padding: 0;
|
|
|
|
1338
|
+}
|
|
|
|
1339
|
+.edit-line-block {
|
|
|
|
1340
|
+ background: #ffffff;
|
|
|
|
1341
|
+ margin-top: 20rpx;
|
|
|
|
1342
|
+ padding-bottom: 20rpx;
|
|
|
|
1343
|
+}
|
|
|
|
1344
|
+.line-title {
|
|
|
|
1345
|
+ padding: 20rpx 32rpx 10rpx;
|
|
|
|
1346
|
+ font-size: 30rpx;
|
|
|
|
1347
|
+ font-weight: 600;
|
|
|
|
1348
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
1349
|
+}
|
|
|
|
1350
|
+.empty-tip {
|
|
|
|
1351
|
+ padding: 60rpx 32rpx;
|
|
|
|
1352
|
+ text-align: center;
|
|
|
|
1353
|
+ color: rgba(0, 0, 0, 0.4);
|
|
|
|
1354
|
+ font-size: 26rpx;
|
|
|
|
1355
|
+}
|
|
|
|
1356
|
+.material-condition-section,
|
|
|
|
1357
|
+.remark-section {
|
|
|
|
1358
|
+ background: #ffffff;
|
|
|
|
1359
|
+ margin-top: 20rpx;
|
|
|
|
1360
|
+ padding-bottom: 32rpx;
|
|
|
|
1361
|
+}
|
|
|
|
1362
|
+.section-header {
|
|
|
|
1363
|
+ display: flex;
|
|
|
|
1364
|
+ align-items: center;
|
|
|
|
1365
|
+ padding: 24rpx 32rpx 12rpx;
|
|
|
|
1366
|
+ .opCollapse {
|
|
|
|
1367
|
+ width: 36rpx;
|
|
|
|
1368
|
+ height: 36rpx;
|
|
|
|
1369
|
+ margin-right: 12rpx;
|
|
|
|
1370
|
+ }
|
|
|
|
1371
|
+ .section-title {
|
|
|
|
1372
|
+ font-size: 34rpx;
|
|
|
|
1373
|
+ font-weight: 600;
|
|
|
|
1374
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
1375
|
+ }
|
|
|
|
1376
|
+}
|
|
|
|
1377
|
+.section-content {
|
|
|
|
1378
|
+ padding: 16rpx 32rpx 0;
|
|
|
|
1379
|
+}
|
|
|
|
1380
|
+.form-row {
|
|
|
|
1381
|
+ display: flex;
|
|
|
|
1382
|
+ justify-content: space-between;
|
|
|
|
1383
|
+ align-items: center;
|
|
|
|
1384
|
+ padding: 16rpx 0;
|
|
|
|
1385
|
+ .form-label {
|
|
|
|
1386
|
+ font-size: 28rpx;
|
|
|
|
1387
|
+ color: rgba(0, 0, 0, 0.6);
|
|
|
|
1388
|
+ }
|
|
|
|
1389
|
+ .form-value {
|
|
|
|
1390
|
+ font-size: 28rpx;
|
|
|
|
1391
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
1392
|
+ }
|
|
|
|
1393
|
+}
|
|
|
|
1394
|
+:deep(.uni-list-item) {
|
|
|
|
1395
|
+ min-height: 104rpx;
|
|
|
|
1396
|
+ padding-left: 32rpx;
|
|
|
|
1397
|
+ padding-right: 32rpx;
|
|
|
|
1398
|
+ &::after {
|
|
|
|
1399
|
+ left: 32rpx;
|
|
|
|
1400
|
+ right: 32rpx;
|
|
|
|
1401
|
+ }
|
|
|
|
1402
|
+ &:last-child::after {
|
|
|
|
1403
|
+ display: none;
|
|
|
|
1404
|
+ }
|
|
|
|
1405
|
+}
|
|
|
|
1406
|
+:deep(.uni-list) {
|
|
|
|
1407
|
+ background-color: #ffffff;
|
|
|
|
1408
|
+}
|
|
|
|
1409
|
+:deep(.uni-easyinput__content-input),
|
|
|
|
1410
|
+:deep(.uni-easyinput__content-textarea) {
|
|
|
|
1411
|
+ min-height: 72rpx;
|
|
|
|
1412
|
+ font-size: 28rpx;
|
|
|
|
1413
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
1414
|
+ &.is-disabled {
|
|
|
|
1415
|
+ color: rgba(0, 0, 0, 0.6);
|
|
|
|
1416
|
+ background: transparent;
|
|
|
|
1417
|
+ }
|
|
|
|
1418
|
+}
|
|
|
|
1419
|
+:deep(.uni-datetime-picker) {
|
|
|
|
1420
|
+ font-size: 28rpx;
|
|
|
|
1421
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
1422
|
+}
|
|
|
|
1423
|
+</style> |