|
1
|
1
|
<template>
|
|
2
|
2
|
<view class="detail-page">
|
|
3
|
3
|
<scroll-view class="scroll" scroll-y>
|
|
4
|
|
- <view class="section">
|
|
5
|
|
- <text class="row company">{{ safeText(form.code) }}</text>
|
|
6
|
|
- <view v-if="canEdit" class="row">
|
|
7
|
|
- <text class="label required">公司名称</text>
|
|
8
|
|
- <view class="value select-value" @click="openCompanySheet">
|
|
9
|
|
- <text :class="form.companyShortName || form.companyName ? '' : 'placeholder'">{{ form.companyShortName || form.companyName || '请选择公司名称' }}</text>
|
|
10
|
|
- <text class="arrow">›</text>
|
|
|
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>
|
|
|
54
|
+ <template v-slot:body>
|
|
|
55
|
+ <view class="item-title">
|
|
|
56
|
+ <text class="required" v-if="canEdit">*</text><text>日期</text>
|
|
|
57
|
+ </view>
|
|
|
58
|
+ </template>
|
|
|
59
|
+ <template v-slot:footer>
|
|
|
60
|
+ <uni-datetime-picker v-if="canEdit" type="date" v-model="form.date" return-type="string" />
|
|
|
61
|
+ <uni-easyinput v-else :value="formatDateOnly(form.date)" :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.validityPeriod" :inputBorder="false" disabled placeholder="-" />
|
|
|
68
|
+ </template>
|
|
|
69
|
+ </uni-list-item>
|
|
|
70
|
+
|
|
|
71
|
+ <uni-list-item title="报价人">
|
|
|
72
|
+ <template v-slot:footer>
|
|
|
73
|
+ <uni-easyinput :value="form.quoterName" :inputBorder="false" disabled placeholder="-" />
|
|
|
74
|
+ </template>
|
|
|
75
|
+ </uni-list-item>
|
|
|
76
|
+
|
|
|
77
|
+ <uni-list-item class="select-item" :class="typeof form.longTermOperation === 'boolean' ? 'is-filled' : 'is-empty'">
|
|
|
78
|
+ <template v-slot:body>
|
|
|
79
|
+ <view class="item-title"><text>是否长单操作</text></view>
|
|
|
80
|
+ </template>
|
|
|
81
|
+ <template v-slot:footer>
|
|
|
82
|
+ <text class="readonly-text">{{ boolText(form.longTermOperation) }}</text>
|
|
|
83
|
+ </template>
|
|
|
84
|
+ </uni-list-item>
|
|
|
85
|
+
|
|
|
86
|
+ <uni-list-item class="select-item" :class="typeof form.terminalCustomer === 'boolean' ? 'is-filled' : 'is-empty'">
|
|
|
87
|
+ <template v-slot:body>
|
|
|
88
|
+ <view class="item-title"><text>是否终端客户</text></view>
|
|
|
89
|
+ </template>
|
|
|
90
|
+ <template v-slot:footer>
|
|
|
91
|
+ <text class="readonly-text">{{ boolText(form.terminalCustomer) }}</text>
|
|
|
92
|
+ </template>
|
|
|
93
|
+ </uni-list-item>
|
|
|
94
|
+
|
|
|
95
|
+ <uni-list-item class="select-item" :class="typeof form.priced === 'boolean' ? 'is-filled' : 'is-empty'">
|
|
|
96
|
+ <template v-slot:body>
|
|
|
97
|
+ <view class="item-title"><text>是否未点价</text></view>
|
|
|
98
|
+ </template>
|
|
|
99
|
+ <template v-slot:footer>
|
|
|
100
|
+ <text class="readonly-text">{{ boolText(form.priced) }}</text>
|
|
|
101
|
+ </template>
|
|
|
102
|
+ </uni-list-item>
|
|
|
103
|
+
|
|
|
104
|
+ <uni-list-item v-if="form.priced === true" title="点价截止日期">
|
|
|
105
|
+ <template v-slot:footer>
|
|
|
106
|
+ <uni-easyinput :value="pricingDeadlineDisplay" :inputBorder="false" disabled placeholder="-" />
|
|
|
107
|
+ </template>
|
|
|
108
|
+ </uni-list-item>
|
|
|
109
|
+
|
|
|
110
|
+ <uni-list-item v-if="form.priced === true" class="select-item" :class="typeof form.temporaryPrice === 'boolean' ? 'is-filled' : 'is-empty'">
|
|
|
111
|
+ <template v-slot:body>
|
|
|
112
|
+ <view class="item-title"><text>是否暂定价</text></view>
|
|
|
113
|
+ </template>
|
|
|
114
|
+ <template v-slot:footer>
|
|
|
115
|
+ <text class="readonly-text">{{ boolText(form.temporaryPrice) }}</text>
|
|
|
116
|
+ </template>
|
|
|
117
|
+ </uni-list-item>
|
|
|
118
|
+
|
|
|
119
|
+ <uni-list-item class="select-item" :class="typeof form.otherExpenseSettlement === 'boolean' ? 'is-filled' : 'is-empty'">
|
|
|
120
|
+ <template v-slot:body>
|
|
|
121
|
+ <view class="item-title"><text>其他费用凭票到厂另行结算</text></view>
|
|
|
122
|
+ </template>
|
|
|
123
|
+ <template v-slot:footer>
|
|
|
124
|
+ <text class="readonly-text">{{ boolText(form.otherExpenseSettlement) }}</text>
|
|
|
125
|
+ </template>
|
|
|
126
|
+ </uni-list-item>
|
|
|
127
|
+
|
|
|
128
|
+ <uni-list-item class="select-item" :class="form.deliveryMode ? 'is-filled' : 'is-empty'">
|
|
|
129
|
+ <template v-slot:body>
|
|
|
130
|
+ <view class="item-title"><text>交提货方式</text></view>
|
|
|
131
|
+ </template>
|
|
|
132
|
+ <template v-slot:footer>
|
|
|
133
|
+ <text class="readonly-text">{{ getDeliveryMethodLabel() }}</text>
|
|
|
134
|
+ </template>
|
|
|
135
|
+ </uni-list-item>
|
|
|
136
|
+
|
|
|
137
|
+ <uni-list-item class="select-item" :class="typeof form.commodityBuyout === 'boolean' ? 'is-filled' : 'is-empty'">
|
|
|
138
|
+ <template v-slot:body>
|
|
|
139
|
+ <view class="item-title"><text>是否通货买断</text></view>
|
|
|
140
|
+ </template>
|
|
|
141
|
+ <template v-slot:footer>
|
|
|
142
|
+ <text class="readonly-text">{{ boolText(form.commodityBuyout) }}</text>
|
|
|
143
|
+ </template>
|
|
|
144
|
+ </uni-list-item>
|
|
|
145
|
+
|
|
|
146
|
+ <uni-list-item class="select-item" :class="typeof form.qualityBuyout === 'boolean' ? 'is-filled' : 'is-empty'">
|
|
|
147
|
+ <template v-slot:body>
|
|
|
148
|
+ <view class="item-title"><text>是否质量买断</text></view>
|
|
|
149
|
+ </template>
|
|
|
150
|
+ <template v-slot:footer>
|
|
|
151
|
+ <text class="readonly-text">{{ boolText(form.qualityBuyout) }}</text>
|
|
|
152
|
+ </template>
|
|
|
153
|
+ </uni-list-item>
|
|
|
154
|
+
|
|
|
155
|
+ <uni-list-item class="select-item" :class="typeof form.quantityBuyout === 'boolean' ? 'is-filled' : 'is-empty'">
|
|
|
156
|
+ <template v-slot:body>
|
|
|
157
|
+ <view class="item-title"><text>是否数量买断</text></view>
|
|
|
158
|
+ </template>
|
|
|
159
|
+ <template v-slot:footer>
|
|
|
160
|
+ <text class="readonly-text">{{ boolText(form.quantityBuyout) }}</text>
|
|
|
161
|
+ </template>
|
|
|
162
|
+ </uni-list-item>
|
|
|
163
|
+
|
|
|
164
|
+ <uni-list-item class="select-item" :class="typeof form.doorDelivery === 'boolean' ? 'is-filled' : 'is-empty'">
|
|
|
165
|
+ <template v-slot:body>
|
|
|
166
|
+ <view class="item-title"><text>是否送货上门</text></view>
|
|
|
167
|
+ </template>
|
|
|
168
|
+ <template v-slot:footer>
|
|
|
169
|
+ <text class="readonly-text">{{ boolText(form.doorDelivery) }}</text>
|
|
|
170
|
+ </template>
|
|
|
171
|
+ </uni-list-item>
|
|
|
172
|
+
|
|
|
173
|
+ <uni-list-item title="另付运费">
|
|
|
174
|
+ <template v-slot:footer>
|
|
|
175
|
+ <uni-easyinput
|
|
|
176
|
+ v-if="canEdit"
|
|
|
177
|
+ v-model="form.shippingCost"
|
|
|
178
|
+ type="digit"
|
|
|
179
|
+ :inputBorder="false"
|
|
|
180
|
+ placeholder="请输入另付运费"
|
|
|
181
|
+ @input="onShippingCostInput"
|
|
|
182
|
+ @blur="onShippingCostBlur"
|
|
|
183
|
+ />
|
|
|
184
|
+ <uni-easyinput v-else :value="shippingCostDisplay" :inputBorder="false" disabled placeholder="-" />
|
|
|
185
|
+ </template>
|
|
|
186
|
+ </uni-list-item>
|
|
|
187
|
+
|
|
|
188
|
+ <uni-list-item title="装车费">
|
|
|
189
|
+ <template v-slot:footer>
|
|
|
190
|
+ <uni-easyinput :value="loadingFeeDisplay" :inputBorder="false" disabled placeholder="-" />
|
|
|
191
|
+ </template>
|
|
|
192
|
+ </uni-list-item>
|
|
|
193
|
+
|
|
|
194
|
+ <uni-list-item title="开票品名">
|
|
|
195
|
+ <template v-slot:footer>
|
|
|
196
|
+ <uni-easyinput :value="form.invoiceProductName" :inputBorder="false" disabled placeholder="-" />
|
|
|
197
|
+ </template>
|
|
|
198
|
+ </uni-list-item>
|
|
|
199
|
+
|
|
|
200
|
+ <uni-list-item title="交货日期">
|
|
|
201
|
+ <template v-slot:footer>
|
|
|
202
|
+ <uni-easyinput :value="deliveryDateDisplay" :inputBorder="false" disabled placeholder="-" />
|
|
|
203
|
+ </template>
|
|
|
204
|
+ </uni-list-item>
|
|
|
205
|
+
|
|
|
206
|
+ <uni-list-item title="结算方式">
|
|
|
207
|
+ <template v-slot:footer>
|
|
|
208
|
+ <uni-easyinput :value="form.settlementMethod" :inputBorder="false" disabled placeholder="-" />
|
|
|
209
|
+ </template>
|
|
|
210
|
+ </uni-list-item>
|
|
|
211
|
+
|
|
|
212
|
+ <uni-list-item title="结算比例(%)">
|
|
|
213
|
+ <template v-slot:footer>
|
|
|
214
|
+ <uni-easyinput :value="settlementRatioDisplay" :inputBorder="false" disabled placeholder="-" />
|
|
|
215
|
+ </template>
|
|
|
216
|
+ </uni-list-item>
|
|
|
217
|
+
|
|
|
218
|
+ <uni-list-item
|
|
|
219
|
+ class="select-item"
|
|
|
220
|
+ :class="(form.priceTableId || form.priceTableCode) ? 'is-filled' : 'is-empty'"
|
|
|
221
|
+ :clickable="canEdit"
|
|
|
222
|
+ :rightText="canEdit ? (priceTableCodeLabel || '请选择价格表编号') : ''"
|
|
|
223
|
+ :showArrow="canEdit"
|
|
|
224
|
+ @click="canEdit ? openPriceTableSheet() : undefined"
|
|
|
225
|
+ >
|
|
|
226
|
+ <template v-slot:body>
|
|
|
227
|
+ <view class="item-title">
|
|
|
228
|
+ <text class="required" v-if="canEdit">*</text><text>价格表编号</text>
|
|
|
229
|
+ </view>
|
|
|
230
|
+ </template>
|
|
|
231
|
+ <template v-if="!canEdit" v-slot:footer>
|
|
|
232
|
+ <uni-easyinput :value="priceTableDisplay === '-' ? '' : priceTableDisplay" :inputBorder="false" disabled placeholder="-" />
|
|
|
233
|
+ </template>
|
|
|
234
|
+ </uni-list-item>
|
|
|
235
|
+
|
|
|
236
|
+ <uni-list-item title="协调事由">
|
|
|
237
|
+ <template v-slot:footer>
|
|
|
238
|
+ <uni-easyinput :value="form.coordinationReason" :inputBorder="false" disabled placeholder="-" />
|
|
|
239
|
+ </template>
|
|
|
240
|
+ </uni-list-item>
|
|
|
241
|
+
|
|
|
242
|
+ <uni-list-item title="票类状况">
|
|
|
243
|
+ <template v-slot:footer>
|
|
|
244
|
+ <uni-easyinput :value="form.invoiceTypeStatus" :inputBorder="false" disabled placeholder="-" />
|
|
|
245
|
+ </template>
|
|
|
246
|
+ </uni-list-item>
|
|
|
247
|
+
|
|
|
248
|
+ <uni-list-item title="数量合计">
|
|
|
249
|
+ <template v-slot:footer>
|
|
|
250
|
+ <uni-easyinput :value="totalQuantityDisplay" :inputBorder="false" disabled placeholder="-" />
|
|
|
251
|
+ </template>
|
|
|
252
|
+ </uni-list-item>
|
|
|
253
|
+
|
|
|
254
|
+ <uni-list-item v-if="attachmentList.length" title="附件">
|
|
|
255
|
+ <template v-slot:footer>
|
|
|
256
|
+ <view class="attach-list">
|
|
|
257
|
+ <view v-for="(at, idx) in attachmentList" :key="idx" class="attach-item">
|
|
|
258
|
+ <text class="attach-name">{{ at.name }}</text>
|
|
|
259
|
+ <text class="attach-view" @click.stop="onPreviewAttachment(at)">查看</text>
|
|
|
260
|
+ </view>
|
|
|
261
|
+ </view>
|
|
|
262
|
+ </template>
|
|
|
263
|
+ </uni-list-item>
|
|
|
264
|
+ </uni-list>
|
|
|
265
|
+
|
|
|
266
|
+ <view class="title-header">
|
|
|
267
|
+ <image class="title-header_icon" src="/static/images/title.png" />
|
|
|
268
|
+ <span>明细信息</span>
|
|
|
269
|
+ </view>
|
|
|
270
|
+ <view v-if="lineListWithName.length" class="edit-line-list">
|
|
|
271
|
+ <view v-for="(line, idx) in lineListWithName" :key="line.itemId || idx" class="edit-line-block">
|
|
|
272
|
+ <view class="line-title">明细{{ idx + 1 }}</view>
|
|
|
273
|
+ <uni-list>
|
|
|
274
|
+ <uni-list-item title="品种">
|
|
|
275
|
+ <template v-slot:footer>
|
|
|
276
|
+ <uni-easyinput :value="line.productName" :inputBorder="false" disabled placeholder="-" />
|
|
|
277
|
+ </template>
|
|
|
278
|
+ </uni-list-item>
|
|
|
279
|
+ <uni-list-item title="料型">
|
|
|
280
|
+ <template v-slot:footer>
|
|
|
281
|
+ <uni-easyinput :value="line.materialType" :inputBorder="false" disabled placeholder="-" />
|
|
|
282
|
+ </template>
|
|
|
283
|
+ </uni-list-item>
|
|
|
284
|
+ <uni-list-item title="数量(吨)">
|
|
|
285
|
+ <template v-slot:footer>
|
|
|
286
|
+ <uni-easyinput :value="lineNumberDisplay(line.quantity)" :inputBorder="false" disabled placeholder="-" />
|
|
|
287
|
+ </template>
|
|
|
288
|
+ </uni-list-item>
|
|
|
289
|
+ <uni-list-item title="实际采购价">
|
|
|
290
|
+ <template v-slot:footer>
|
|
|
291
|
+ <uni-easyinput :value="lineNumberDisplay(line.actualPurchasePrice)" :inputBorder="false" disabled placeholder="-" />
|
|
|
292
|
+ </template>
|
|
|
293
|
+ </uni-list-item>
|
|
|
294
|
+ <uni-list-item title="含运到厂价">
|
|
|
295
|
+ <template v-slot:footer>
|
|
|
296
|
+ <uni-easyinput :value="lineNumberDisplay(line.includingShippingPrice)" :inputBorder="false" disabled placeholder="-" />
|
|
|
297
|
+ </template>
|
|
|
298
|
+ </uni-list-item>
|
|
|
299
|
+ <uni-list-item title="价格表价格">
|
|
|
300
|
+ <template v-slot:footer>
|
|
|
301
|
+ <uni-easyinput
|
|
|
302
|
+ v-if="canEdit"
|
|
|
303
|
+ v-model="line.priceListPrices"
|
|
|
304
|
+ type="digit"
|
|
|
305
|
+ :inputBorder="false"
|
|
|
306
|
+ placeholder="请输入价格表价格"
|
|
|
307
|
+ @input="onLinePriceInput(idx, $event)"
|
|
|
308
|
+ @blur="onLinePriceBlur(idx)"
|
|
|
309
|
+ />
|
|
|
310
|
+ <uni-easyinput v-else :value="lineNumberDisplay(line.priceListPrices)" :inputBorder="false" disabled placeholder="-" />
|
|
|
311
|
+ </template>
|
|
|
312
|
+ </uni-list-item>
|
|
|
313
|
+ <uni-list-item title="协调幅度">
|
|
|
314
|
+ <template v-slot:footer>
|
|
|
315
|
+ <uni-easyinput :value="lineNumberDisplay(line.coordinationRange)" :inputBorder="false" disabled placeholder="-" />
|
|
|
316
|
+ </template>
|
|
|
317
|
+ </uni-list-item>
|
|
|
318
|
+ <uni-list-item title="买断料预计损耗">
|
|
|
319
|
+ <template v-slot:footer>
|
|
|
320
|
+ <uni-easyinput :value="lineNumberDisplay(line.estimatedLoss)" :inputBorder="false" disabled placeholder="-" />
|
|
|
321
|
+ </template>
|
|
|
322
|
+ </uni-list-item>
|
|
|
323
|
+ <uni-list-item title="申请损耗(%)">
|
|
|
324
|
+ <template v-slot:footer>
|
|
|
325
|
+ <uni-easyinput :value="lineNumberDisplay(line.applicationAttrition)" :inputBorder="false" disabled placeholder="-" />
|
|
|
326
|
+ </template>
|
|
|
327
|
+ </uni-list-item>
|
|
|
328
|
+ <uni-list-item
|
|
|
329
|
+ class="select-item"
|
|
|
330
|
+ :class="line.workshopName ? 'is-filled' : 'is-empty'"
|
|
|
331
|
+ :clickable="canEditWorkshop"
|
|
|
332
|
+ :rightText="canEditWorkshop ? (line.workshopName || '请选择分厂') : ''"
|
|
|
333
|
+ :showArrow="canEditWorkshop"
|
|
|
334
|
+ @click="canEditWorkshop ? openWorkshopSheet(idx) : undefined"
|
|
|
335
|
+ >
|
|
|
336
|
+ <template v-slot:body>
|
|
|
337
|
+ <view class="item-title">
|
|
|
338
|
+ <text class="required" v-if="canEditWorkshop">*</text><text>选择分厂</text>
|
|
|
339
|
+ </view>
|
|
|
340
|
+ </template>
|
|
|
341
|
+ <template v-if="!canEditWorkshop" v-slot:footer>
|
|
|
342
|
+ <uni-easyinput :value="line.workshopName" :inputBorder="false" disabled placeholder="-" />
|
|
|
343
|
+ </template>
|
|
|
344
|
+ </uni-list-item>
|
|
|
345
|
+ </uni-list>
|
|
11
|
346
|
</view>
|
|
12
|
347
|
</view>
|
|
13
|
|
- <view v-else class="row"><text class="label">公司简称</text><text class="value">{{ safeText(form.companyShortName || form.companyName) }}</text></view>
|
|
14
|
|
- <view class="row"><text class="label">供应商名称</text><text class="value">{{ safeText(form.supplierName) }}</text></view>
|
|
15
|
|
- <view class="row"><text class="label">采购处</text><text class="value">{{ safeText(form.purchaseDepartmentName || form.purchaseDepartment) }}</text></view>
|
|
16
|
|
- <view class="row"><text class="label">区域</text><text class="value">{{ safeText(form.regionName || form.region) }}</text></view>
|
|
17
|
|
- <view v-if="canEdit" class="row">
|
|
18
|
|
- <text class="label required">日期</text>
|
|
19
|
|
- <view class="value date-value">
|
|
20
|
|
- <uni-datetime-picker type="date" v-model="form.date" return-type="string" />
|
|
|
348
|
+ <view v-else class="section empty-tip">暂无明细</view>
|
|
|
349
|
+
|
|
|
350
|
+ <view class="material-condition-section">
|
|
|
351
|
+ <view class="section-header">
|
|
|
352
|
+ <image class="opCollapse" src="/static/images/title.png" />
|
|
|
353
|
+ <text class="section-title">料质状况</text>
|
|
|
354
|
+ </view>
|
|
|
355
|
+ <view class="section-content">
|
|
|
356
|
+ <view class="form-row">
|
|
|
357
|
+ <text class="form-label">是否启用料质状况</text>
|
|
|
358
|
+ <text class="form-value">{{ boolText(form.materialConditionEnabled) }}</text>
|
|
|
359
|
+ </view>
|
|
|
360
|
+ <template v-if="form.materialConditionEnabled">
|
|
|
361
|
+ <view v-for="mc in materialConditionConfigs" :key="mc.field" class="material-group">
|
|
|
362
|
+ <text class="material-label">{{ mc.label }}</text>
|
|
|
363
|
+ <view class="tag-list">
|
|
|
364
|
+ <view v-for="opt in getDictOptions(mc.dictCode)" :key="opt.code" class="tag-btn" :class="{ active: isTagSelected(mc.field, opt.code) }">{{ opt.name }}</view>
|
|
|
365
|
+ </view>
|
|
|
366
|
+ </view>
|
|
|
367
|
+ </template>
|
|
21
|
368
|
</view>
|
|
22
|
369
|
</view>
|
|
23
|
|
- <view v-else class="row"><text class="label">日期</text><text class="value">{{ formatDateOnly(form.date) }}</text></view>
|
|
24
|
|
- <view class="row"><text class="label">报价时效</text><text class="value">{{ safeText(form.validityPeriod) }}</text></view>
|
|
25
|
|
- <view class="row"><text class="label">报价人</text><text class="value">{{ safeText(form.quoterName) }}</text></view>
|
|
26
|
|
- <view class="row"><text class="label">是否长单操作</text><text class="value">{{ boolText(form.longTermOperation) }}</text></view>
|
|
27
|
|
- <view class="row"><text class="label">是否终端客户</text><text class="value">{{ boolText(form.terminalCustomer) }}</text></view>
|
|
28
|
|
- <view class="row"><text class="label">是否未点价</text><text class="value">{{ boolText(form.priced) }}</text></view>
|
|
29
|
|
- <view v-if="form.priced === true" class="row"><text class="label">点价截止日期</text><text class="value">{{ formatDateOnly(form.pricingDeadline) }}</text></view>
|
|
30
|
|
- <view v-if="form.priced === true" class="row"><text class="label">是否暂定价</text><text class="value">{{ boolText(form.temporaryPrice) }}</text></view>
|
|
31
|
|
- <view class="row"><text class="label">其他费用凭票到厂另行结算</text><text class="value">{{ boolText(form.otherExpenseSettlement) }}</text></view>
|
|
32
|
|
- <view class="row"><text class="label">交提货方式</text><text class="value">{{ getDeliveryMethodLabel() }}</text></view>
|
|
33
|
|
- <view class="row"><text class="label">是否通货买断</text><text class="value">{{ boolText(form.commodityBuyout) }}</text></view>
|
|
34
|
|
- <view class="row"><text class="label">是否质量买断</text><text class="value">{{ boolText(form.qualityBuyout) }}</text></view>
|
|
35
|
|
- <view class="row"><text class="label">是否数量买断</text><text class="value">{{ boolText(form.quantityBuyout) }}</text></view>
|
|
36
|
|
- <view class="row"><text class="label">是否送货上门</text><text class="value">{{ boolText(form.doorDelivery) }}</text></view>
|
|
37
|
|
- <view class="row">
|
|
38
|
|
- <text class="label">另付运费</text>
|
|
39
|
|
- <input v-if="canEdit" class="value line-input" v-model="form.shippingCost" type="digit" placeholder="请输入" @input="onShippingCostInput" @blur="onShippingCostBlur" />
|
|
40
|
|
- <text v-else class="value">{{ formatNumber(form.shippingCost) }}</text>
|
|
|
370
|
+
|
|
|
371
|
+ <view class="remark-section">
|
|
|
372
|
+ <view class="section-header">
|
|
|
373
|
+ <image class="opCollapse" src="/static/images/title.png" />
|
|
|
374
|
+ <text class="section-title">备注</text>
|
|
|
375
|
+ </view>
|
|
|
376
|
+ <view class="section-content">
|
|
|
377
|
+ <text class="remark-text">{{ safeText(form.remark) }}</text>
|
|
|
378
|
+ </view>
|
|
41
|
379
|
</view>
|
|
42
|
|
- <view class="row"><text class="label">装车费</text><text class="value">{{ formatNumber(form.loadingFee) }}</text></view>
|
|
43
|
|
- <view class="row"><text class="label">开票品名</text><text class="value">{{ safeText(form.invoiceProductName) }}</text></view>
|
|
44
|
|
- <view class="row"><text class="label">交货日期</text><text class="value">{{ formatDateOnly(form.deliveryDate) }}</text></view>
|
|
45
|
|
- <view class="row"><text class="label">结算方式</text><text class="value">{{ safeText(form.settlementMethod) }}</text></view>
|
|
46
|
|
- <view class="row"><text class="label">结算比例(%)</text><text class="value">{{ formatNumber(form.settlementRatio) }}</text></view>
|
|
47
|
|
- <view class="row">
|
|
48
|
|
- <text class="label" :class="{ required: canEdit }">价格表编号</text>
|
|
49
|
|
- <view v-if="canEdit" class="value select-value" @click="openPriceTableSheet">
|
|
50
|
|
- <text :class="priceTableCodeLabel ? '' : 'placeholder'">{{ priceTableCodeLabel || '请选择价格表编号' }}</text>
|
|
51
|
|
- <text class="arrow">›</text>
|
|
|
380
|
+
|
|
|
381
|
+ <view class="remark-section">
|
|
|
382
|
+ <view class="section-header">
|
|
|
383
|
+ <image class="opCollapse" src="/static/images/title.png" />
|
|
|
384
|
+ <text class="section-title">变更事由</text>
|
|
|
385
|
+ </view>
|
|
|
386
|
+ <view class="section-content">
|
|
|
387
|
+ <text class="remark-text">{{ safeText(form.changeReason) }}</text>
|
|
52
|
388
|
</view>
|
|
53
|
|
- <text v-else class="value">{{ priceTableDisplay }}</text>
|
|
54
|
389
|
</view>
|
|
55
|
|
- <view class="row"><text class="label">协调事由</text><text class="value">{{ safeText(form.coordinationReason) }}</text></view>
|
|
56
|
|
- <view class="row"><text class="label">票类状况</text><text class="value">{{ safeText(form.invoiceTypeStatus) }}</text></view>
|
|
57
|
|
- <view class="row"><text class="label">数量合计</text><text class="value">{{ formatNumber(form.totalQuantity) }}</text></view>
|
|
58
|
|
- <view class="row" v-if="attachmentList.length">
|
|
59
|
|
- <text class="label">附件</text>
|
|
60
|
|
- <view class="attach-list">
|
|
61
|
|
- <view v-for="(at, idx) in attachmentList" :key="idx" class="attach-item">
|
|
62
|
|
- <text class="attach-name">{{ at.name }}</text>
|
|
63
|
|
- <text class="attach-view" @click.stop="onPreviewAttachment(at)">查看</text>
|
|
|
390
|
+ </template>
|
|
|
391
|
+
|
|
|
392
|
+ <template v-else>
|
|
|
393
|
+ <view class="section">
|
|
|
394
|
+ <text class="row company">{{ safeText(form.code) }}</text>
|
|
|
395
|
+ <view class="row"><text class="label">公司简称</text><text class="value">{{ safeText(form.companyShortName || form.companyName) }}</text></view>
|
|
|
396
|
+ <view class="row"><text class="label">供应商名称</text><text class="value">{{ safeText(form.supplierName) }}</text></view>
|
|
|
397
|
+ <view class="row"><text class="label">采购处</text><text class="value">{{ safeText(form.purchaseDepartmentName || form.purchaseDepartment) }}</text></view>
|
|
|
398
|
+ <view class="row"><text class="label">区域</text><text class="value">{{ safeText(form.regionName || form.region) }}</text></view>
|
|
|
399
|
+ <view class="row"><text class="label">日期</text><text class="value">{{ formatDateOnly(form.date) }}</text></view>
|
|
|
400
|
+ <view class="row"><text class="label">报价时效</text><text class="value">{{ safeText(form.validityPeriod) }}</text></view>
|
|
|
401
|
+ <view class="row"><text class="label">报价人</text><text class="value">{{ safeText(form.quoterName) }}</text></view>
|
|
|
402
|
+ <view class="row"><text class="label">是否长单操作</text><text class="value">{{ boolText(form.longTermOperation) }}</text></view>
|
|
|
403
|
+ <view class="row"><text class="label">是否终端客户</text><text class="value">{{ boolText(form.terminalCustomer) }}</text></view>
|
|
|
404
|
+ <view class="row"><text class="label">是否未点价</text><text class="value">{{ boolText(form.priced) }}</text></view>
|
|
|
405
|
+ <view v-if="form.priced === true" class="row"><text class="label">点价截止日期</text><text class="value">{{ formatDateOnly(form.pricingDeadline) }}</text></view>
|
|
|
406
|
+ <view v-if="form.priced === true" class="row"><text class="label">是否暂定价</text><text class="value">{{ boolText(form.temporaryPrice) }}</text></view>
|
|
|
407
|
+ <view class="row"><text class="label">其他费用凭票到厂另行结算</text><text class="value">{{ boolText(form.otherExpenseSettlement) }}</text></view>
|
|
|
408
|
+ <view class="row"><text class="label">交提货方式</text><text class="value">{{ getDeliveryMethodLabel() }}</text></view>
|
|
|
409
|
+ <view class="row"><text class="label">是否通货买断</text><text class="value">{{ boolText(form.commodityBuyout) }}</text></view>
|
|
|
410
|
+ <view class="row"><text class="label">是否质量买断</text><text class="value">{{ boolText(form.qualityBuyout) }}</text></view>
|
|
|
411
|
+ <view class="row"><text class="label">是否数量买断</text><text class="value">{{ boolText(form.quantityBuyout) }}</text></view>
|
|
|
412
|
+ <view class="row"><text class="label">是否送货上门</text><text class="value">{{ boolText(form.doorDelivery) }}</text></view>
|
|
|
413
|
+ <view class="row"><text class="label">另付运费</text><text class="value">{{ formatNumber(form.shippingCost) }}</text></view>
|
|
|
414
|
+ <view class="row"><text class="label">装车费</text><text class="value">{{ formatNumber(form.loadingFee) }}</text></view>
|
|
|
415
|
+ <view class="row"><text class="label">开票品名</text><text class="value">{{ safeText(form.invoiceProductName) }}</text></view>
|
|
|
416
|
+ <view class="row"><text class="label">交货日期</text><text class="value">{{ formatDateOnly(form.deliveryDate) }}</text></view>
|
|
|
417
|
+ <view class="row"><text class="label">结算方式</text><text class="value">{{ safeText(form.settlementMethod) }}</text></view>
|
|
|
418
|
+ <view class="row"><text class="label">结算比例(%)</text><text class="value">{{ formatNumber(form.settlementRatio) }}</text></view>
|
|
|
419
|
+ <view class="row"><text class="label">价格表编号</text><text class="value">{{ priceTableDisplay }}</text></view>
|
|
|
420
|
+ <view class="row"><text class="label">协调事由</text><text class="value">{{ safeText(form.coordinationReason) }}</text></view>
|
|
|
421
|
+ <view class="row"><text class="label">票类状况</text><text class="value">{{ safeText(form.invoiceTypeStatus) }}</text></view>
|
|
|
422
|
+ <view class="row"><text class="label">数量合计</text><text class="value">{{ formatNumber(form.totalQuantity) }}</text></view>
|
|
|
423
|
+ <view class="row" v-if="attachmentList.length">
|
|
|
424
|
+ <text class="label">附件</text>
|
|
|
425
|
+ <view class="attach-list">
|
|
|
426
|
+ <view v-for="(at, idx) in attachmentList" :key="idx" class="attach-item">
|
|
|
427
|
+ <text class="attach-name">{{ at.name }}</text>
|
|
|
428
|
+ <text class="attach-view" @click.stop="onPreviewAttachment(at)">查看</text>
|
|
|
429
|
+ </view>
|
|
64
|
430
|
</view>
|
|
65
|
431
|
</view>
|
|
66
|
432
|
</view>
|
|
67
|
|
- </view>
|
|
68
|
|
-
|
|
69
|
|
- <view class="title-header">
|
|
70
|
|
- <image class="title-header_icon" src="/static/images/title.png" />
|
|
71
|
|
- <span>明细信息</span>
|
|
72
|
|
- </view>
|
|
73
|
|
- <view v-if="lineListWithName.length" class="section">
|
|
74
|
|
- <view v-for="(line, idx) in lineListWithName" :key="line.itemId || idx" class="line-block">
|
|
75
|
|
- <view class="line-title">明细{{ idx + 1 }}</view>
|
|
76
|
|
- <view class="row"><text class="label">品种</text><text class="value">{{ safeText(line.productName) }}</text></view>
|
|
77
|
|
- <view class="row"><text class="label">料型</text><text class="value">{{ safeText(line.materialType) }}</text></view>
|
|
78
|
|
- <view class="row"><text class="label">数量(吨)</text><text class="value">{{ formatNumber(line.quantity) }}</text></view>
|
|
79
|
|
- <view class="row"><text class="label">实际采购价</text><text class="value">{{ formatNumber(line.actualPurchasePrice) }}</text></view>
|
|
80
|
|
- <view class="row"><text class="label">含运到厂价</text><text class="value">{{ formatNumber(line.includingShippingPrice) }}</text></view>
|
|
81
|
|
- <view class="row">
|
|
82
|
|
- <text class="label">价格表价格</text>
|
|
83
|
|
- <input v-if="canEdit" class="value line-input" v-model="line.priceListPrices" type="digit" placeholder="请输入" @input="onLinePriceInput(idx, $event)" @blur="onLinePriceBlur(idx)" />
|
|
84
|
|
- <text v-else class="value">{{ formatNumber(line.priceListPrices) }}</text>
|
|
85
|
|
- </view>
|
|
86
|
|
- <view class="row"><text class="label">协调幅度</text><text class="value">{{ formatNumber(line.coordinationRange) }}</text></view>
|
|
87
|
|
- <view class="row"><text class="label">买断料预计损耗</text><text class="value">{{ formatNumber(line.estimatedLoss) }}</text></view>
|
|
88
|
|
- <view class="row"><text class="label">申请损耗(%)</text><text class="value">{{ formatNumber(line.applicationAttrition) }}</text></view>
|
|
89
|
|
- <view class="row">
|
|
90
|
|
- <text class="label" :class="{ required: canEditWorkshop }">选择分厂</text>
|
|
91
|
|
- <view v-if="canEditWorkshop" class="value select-value" @click="openWorkshopSheet(idx)">
|
|
92
|
|
- <text :class="line.workshopName ? '' : 'placeholder'">{{ line.workshopName || '请选择分厂' }}</text>
|
|
93
|
|
- <text class="arrow">›</text>
|
|
94
|
|
- </view>
|
|
95
|
|
- <text v-else class="value">{{ safeText(line.workshopName) }}</text>
|
|
|
433
|
+
|
|
|
434
|
+ <view class="title-header">
|
|
|
435
|
+ <image class="title-header_icon" src="/static/images/title.png" />
|
|
|
436
|
+ <span>明细信息</span>
|
|
|
437
|
+ </view>
|
|
|
438
|
+ <view v-if="lineListWithName.length" class="section">
|
|
|
439
|
+ <view v-for="(line, idx) in lineListWithName" :key="line.itemId || idx" class="line-block">
|
|
|
440
|
+ <view class="line-title">明细{{ idx + 1 }}</view>
|
|
|
441
|
+ <view class="row"><text class="label">品种</text><text class="value">{{ safeText(line.productName) }}</text></view>
|
|
|
442
|
+ <view class="row"><text class="label">料型</text><text class="value">{{ safeText(line.materialType) }}</text></view>
|
|
|
443
|
+ <view class="row"><text class="label">数量(吨)</text><text class="value">{{ formatNumber(line.quantity) }}</text></view>
|
|
|
444
|
+ <view class="row"><text class="label">实际采购价</text><text class="value">{{ formatNumber(line.actualPurchasePrice) }}</text></view>
|
|
|
445
|
+ <view class="row"><text class="label">含运到厂价</text><text class="value">{{ formatNumber(line.includingShippingPrice) }}</text></view>
|
|
|
446
|
+ <view class="row"><text class="label">价格表价格</text><text class="value">{{ formatNumber(line.priceListPrices) }}</text></view>
|
|
|
447
|
+ <view class="row"><text class="label">协调幅度</text><text class="value">{{ formatNumber(line.coordinationRange) }}</text></view>
|
|
|
448
|
+ <view class="row"><text class="label">买断料预计损耗</text><text class="value">{{ formatNumber(line.estimatedLoss) }}</text></view>
|
|
|
449
|
+ <view class="row"><text class="label">申请损耗(%)</text><text class="value">{{ formatNumber(line.applicationAttrition) }}</text></view>
|
|
|
450
|
+ <view class="row"><text class="label">选择分厂</text><text class="value">{{ safeText(line.workshopName) }}</text></view>
|
|
96
|
451
|
</view>
|
|
97
|
452
|
</view>
|
|
98
|
|
- </view>
|
|
99
|
|
- <view v-else class="section empty-tip">暂无明细</view>
|
|
100
|
|
-
|
|
101
|
|
- <view class="title-header">
|
|
102
|
|
- <image class="title-header_icon" src="/static/images/title.png" />
|
|
103
|
|
- <span>料质状况</span>
|
|
104
|
|
- </view>
|
|
105
|
|
- <view class="section">
|
|
106
|
|
- <view class="row"><text class="label">是否启用料质状况</text><text class="value">{{ boolText(form.materialConditionEnabled) }}</text></view>
|
|
107
|
|
- <template v-if="form.materialConditionEnabled">
|
|
108
|
|
- <view v-for="mc in materialConditionConfigs" :key="mc.field" class="material-group">
|
|
109
|
|
- <text class="material-label">{{ mc.label }}</text>
|
|
110
|
|
- <view class="tag-list">
|
|
111
|
|
- <view v-for="opt in getDictOptions(mc.dictCode)" :key="opt.code" class="tag-btn" :class="{ active: isTagSelected(mc.field, opt.code) }">{{ opt.name }}</view>
|
|
|
453
|
+ <view v-else class="section empty-tip">暂无明细</view>
|
|
|
454
|
+
|
|
|
455
|
+ <view class="title-header">
|
|
|
456
|
+ <image class="title-header_icon" src="/static/images/title.png" />
|
|
|
457
|
+ <span>料质状况</span>
|
|
|
458
|
+ </view>
|
|
|
459
|
+ <view class="section">
|
|
|
460
|
+ <view class="row"><text class="label">是否启用料质状况</text><text class="value">{{ boolText(form.materialConditionEnabled) }}</text></view>
|
|
|
461
|
+ <template v-if="form.materialConditionEnabled">
|
|
|
462
|
+ <view v-for="mc in materialConditionConfigs" :key="mc.field" class="material-group">
|
|
|
463
|
+ <text class="material-label">{{ mc.label }}</text>
|
|
|
464
|
+ <view class="tag-list">
|
|
|
465
|
+ <view v-for="opt in getDictOptions(mc.dictCode)" :key="opt.code" class="tag-btn" :class="{ active: isTagSelected(mc.field, opt.code) }">{{ opt.name }}</view>
|
|
|
466
|
+ </view>
|
|
112
|
467
|
</view>
|
|
113
|
|
- </view>
|
|
114
|
|
- </template>
|
|
115
|
|
- </view>
|
|
116
|
|
-
|
|
117
|
|
- <view class="title-header">
|
|
118
|
|
- <image class="title-header_icon" src="/static/images/title.png" />
|
|
119
|
|
- <span>备注</span>
|
|
120
|
|
- </view>
|
|
121
|
|
- <view class="section">
|
|
122
|
|
- <text class="remark-text">{{ safeText(form.remark) }}</text>
|
|
123
|
|
- </view>
|
|
124
|
|
-
|
|
125
|
|
- <view class="title-header">
|
|
126
|
|
- <image class="title-header_icon" src="/static/images/title.png" />
|
|
127
|
|
- <span>变更事由</span>
|
|
128
|
|
- </view>
|
|
129
|
|
- <view class="section">
|
|
130
|
|
- <text class="remark-text">{{ safeText(form.changeReason) }}</text>
|
|
131
|
|
- </view>
|
|
|
468
|
+ </template>
|
|
|
469
|
+ </view>
|
|
|
470
|
+
|
|
|
471
|
+ <view class="title-header">
|
|
|
472
|
+ <image class="title-header_icon" src="/static/images/title.png" />
|
|
|
473
|
+ <span>备注</span>
|
|
|
474
|
+ </view>
|
|
|
475
|
+ <view class="section">
|
|
|
476
|
+ <text class="remark-text">{{ safeText(form.remark) }}</text>
|
|
|
477
|
+ </view>
|
|
|
478
|
+
|
|
|
479
|
+ <view class="title-header">
|
|
|
480
|
+ <image class="title-header_icon" src="/static/images/title.png" />
|
|
|
481
|
+ <span>变更事由</span>
|
|
|
482
|
+ </view>
|
|
|
483
|
+ <view class="section">
|
|
|
484
|
+ <text class="remark-text">{{ safeText(form.changeReason) }}</text>
|
|
|
485
|
+ </view>
|
|
|
486
|
+ </template>
|
|
132
|
487
|
</scroll-view>
|
|
133
|
488
|
|
|
134
|
489
|
<RelateSelectSheet
|
|
...
|
...
|
@@ -172,12 +527,13 @@ import SingleSelectSheet from '@/components/single-select/index.vue' |
|
172
|
527
|
export default {
|
|
173
|
528
|
name: 'SchedulePlanChangeViewer',
|
|
174
|
529
|
components: { RelateSelectSheet, SingleSelectSheet },
|
|
175
|
|
- props: { id: { type: [String, Number], default: '' } },
|
|
|
530
|
+ props: { id: { type: [String, Number], default: '' }, roleCodes: { type: Array, default: function () { return [] } } },
|
|
176
|
531
|
data() {
|
|
177
|
532
|
return {
|
|
178
|
533
|
form: {},
|
|
179
|
534
|
lineList: [],
|
|
180
|
535
|
attachmentList: [],
|
|
|
536
|
+ _roleCodesFromApi: [],
|
|
181
|
537
|
materialConditionConfigs: [
|
|
182
|
538
|
{ field: 'materialConditionCopperRice', label: '铜米', dictCode: 'COPPER_RICE' },
|
|
183
|
539
|
{ field: 'materialConditionBrightCopper', label: '光亮铜', dictCode: 'BRIGHT_COPPER' },
|
|
...
|
...
|
@@ -191,16 +547,18 @@ export default { |
|
191
|
547
|
dictData: {},
|
|
192
|
548
|
productOptions: [],
|
|
193
|
549
|
workshopOptions: [],
|
|
|
550
|
+ priceTableList: [],
|
|
194
|
551
|
deliveryOptions: [],
|
|
195
|
552
|
isGyglkzg: false,
|
|
196
|
553
|
isGyglkzlglg: false,
|
|
|
554
|
+ isGyglkjhgly: false,
|
|
197
|
555
|
companySheetVisible: false,
|
|
198
|
556
|
priceSheetVisible: false,
|
|
199
|
557
|
workshopSheet: { visible: false, title: '请选择分厂', options: [], value: '', idx: -1 },
|
|
200
|
558
|
companyDisplayFields: [
|
|
201
|
|
- { label: '公司简称', field: 'companyShortName' },
|
|
|
559
|
+ { label: '公司简称', field: 'shortName' },
|
|
202
|
560
|
{ label: '公司名称', field: 'companyName' },
|
|
203
|
|
- { label: '编码', field: 'code' }
|
|
|
561
|
+ { label: '办事处', field: 'deptName' }
|
|
204
|
562
|
],
|
|
205
|
563
|
priceTableDisplayFields: [
|
|
206
|
564
|
{ label: '价格表编号', field: 'priceTableCode' },
|
|
...
|
...
|
@@ -210,21 +568,93 @@ export default { |
|
210
|
568
|
}
|
|
211
|
569
|
},
|
|
212
|
570
|
computed: {
|
|
|
571
|
+ isEditLayout() {
|
|
|
572
|
+ return this.canEdit || this.canEditWorkshop
|
|
|
573
|
+ },
|
|
|
574
|
+ parentRoleCodes() {
|
|
|
575
|
+ try {
|
|
|
576
|
+ var codes = null
|
|
|
577
|
+ var p = this.$parent
|
|
|
578
|
+ for (var i = 0; i < 5 && p; i++) {
|
|
|
579
|
+ if (p.roleCodes != null && Array.isArray(p.roleCodes)) {
|
|
|
580
|
+ codes = p.roleCodes
|
|
|
581
|
+ break
|
|
|
582
|
+ }
|
|
|
583
|
+ if (p.$store && p.$store.getters && Array.isArray(p.$store.getters.roleCodes)) {
|
|
|
584
|
+ codes = p.$store.getters.roleCodes
|
|
|
585
|
+ break
|
|
|
586
|
+ }
|
|
|
587
|
+ p = p.$parent
|
|
|
588
|
+ }
|
|
|
589
|
+ if (!codes && this.$store && this.$store.getters && Array.isArray(this.$store.getters.roleCodes)) {
|
|
|
590
|
+ codes = this.$store.getters.roleCodes
|
|
|
591
|
+ }
|
|
|
592
|
+ return Array.isArray(codes) ? codes : []
|
|
|
593
|
+ } catch (e) {
|
|
|
594
|
+ return []
|
|
|
595
|
+ }
|
|
|
596
|
+ },
|
|
|
597
|
+ mergedRoleCodes() {
|
|
|
598
|
+ var r1 = Array.isArray(this.roleCodes) ? this.roleCodes : []
|
|
|
599
|
+ var r2 = Array.isArray(this.parentRoleCodes) ? this.parentRoleCodes : []
|
|
|
600
|
+ if (!r1.length && !r2.length) return []
|
|
|
601
|
+ var map = {}
|
|
|
602
|
+ ;[]
|
|
|
603
|
+ .concat(r1)
|
|
|
604
|
+ .concat(r2)
|
|
|
605
|
+ .forEach(function (c) {
|
|
|
606
|
+ if (c != null && c !== '') map[String(c)] = true
|
|
|
607
|
+ })
|
|
|
608
|
+ return Object.keys(map)
|
|
|
609
|
+ },
|
|
213
|
610
|
isAuditPage() {
|
|
214
|
611
|
try {
|
|
|
612
|
+ // 优先:父级 audit.vue 已明确存在(roleCodes 能取到 或 父级路由配置)
|
|
|
613
|
+ if (Array.isArray(this.parentRoleCodes) && this.parentRoleCodes.length) {
|
|
|
614
|
+ return true
|
|
|
615
|
+ }
|
|
215
|
616
|
var pages = getCurrentPages()
|
|
216
|
617
|
var cur = pages[pages.length - 1]
|
|
217
|
618
|
var route = cur && cur.route ? String(cur.route) : ''
|
|
218
|
|
- return route === 'pages/flow/audit'
|
|
|
619
|
+ var options = cur && cur.options ? cur.options : {}
|
|
|
620
|
+ var path = (cur && cur.$page && cur.$page.fullPath) ? String(cur.$page.fullPath) : ''
|
|
|
621
|
+ var url = (cur && cur.url) ? String(cur.url) : ''
|
|
|
622
|
+ if (
|
|
|
623
|
+ route.indexOf('pages/flow/audit') !== -1 ||
|
|
|
624
|
+ route === 'pages/flow/audit' ||
|
|
|
625
|
+ path.indexOf('pages/flow/audit') !== -1 ||
|
|
|
626
|
+ url.indexOf('pages/flow/audit') !== -1 ||
|
|
|
627
|
+ (options && options.taskId) ||
|
|
|
628
|
+ (options && options.instanceId)
|
|
|
629
|
+ ) {
|
|
|
630
|
+ return true
|
|
|
631
|
+ }
|
|
|
632
|
+ var p2 = this.$parent
|
|
|
633
|
+ for (var j = 0; j < 5 && p2; j++) {
|
|
|
634
|
+ var n = p2.$options && p2.$options.name ? String(p2.$options.name) : ''
|
|
|
635
|
+ var r = p2.$options && p2.$options.__file ? String(p2.$options.__file) : ''
|
|
|
636
|
+ if (
|
|
|
637
|
+ n.indexOf('Audit') !== -1 ||
|
|
|
638
|
+ n === 'FlowAudit' ||
|
|
|
639
|
+ r.indexOf('flow/audit') !== -1 ||
|
|
|
640
|
+ (p2.auditCtx && typeof p2.auditCtx === 'object')
|
|
|
641
|
+ ) {
|
|
|
642
|
+ return true
|
|
|
643
|
+ }
|
|
|
644
|
+ p2 = p2.$parent
|
|
|
645
|
+ }
|
|
|
646
|
+ return false
|
|
219
|
647
|
} catch (e) {
|
|
220
|
648
|
return false
|
|
221
|
649
|
}
|
|
222
|
650
|
},
|
|
223
|
651
|
canEdit() {
|
|
224
|
|
- return !!this.isGyglkzg && this.isAuditPage
|
|
|
652
|
+ var codes = this.mergedRoleCodes.length ? this.mergedRoleCodes : (Array.isArray(this._roleCodesFromApi) ? this._roleCodesFromApi : [])
|
|
|
653
|
+ return ( codes.includes('gyglkjhgly')) && this.isAuditPage
|
|
225
|
654
|
},
|
|
226
|
655
|
canEditWorkshop() {
|
|
227
|
|
- return !!this.isGyglkzlglg && this.isAuditPage
|
|
|
656
|
+ var codes = this.mergedRoleCodes.length ? this.mergedRoleCodes : (Array.isArray(this._roleCodesFromApi) ? this._roleCodesFromApi : [])
|
|
|
657
|
+ return codes.includes('gyglkzlglg') && this.isAuditPage
|
|
228
|
658
|
},
|
|
229
|
659
|
workshopOptsComputed() {
|
|
230
|
660
|
var list = Array.isArray(this.workshopOptions) ? this.workshopOptions : []
|
|
...
|
...
|
@@ -241,10 +671,60 @@ export default { |
|
241
|
671
|
var n = Number(v)
|
|
242
|
672
|
return isNaN(n) ? 0 : n
|
|
243
|
673
|
},
|
|
|
674
|
+ purchaseDepartmentDisplay() {
|
|
|
675
|
+ var d = this.form || {}
|
|
|
676
|
+ return d.purchaseDepartmentName != null ? d.purchaseDepartmentName : (d.purchaseDepartment != null ? d.purchaseDepartment : '')
|
|
|
677
|
+ },
|
|
|
678
|
+ regionDisplay() {
|
|
|
679
|
+ var d = this.form || {}
|
|
|
680
|
+ return d.regionName != null ? d.regionName : (d.region != null ? d.region : '')
|
|
|
681
|
+ },
|
|
|
682
|
+ pricingDeadlineDisplay() {
|
|
|
683
|
+ var d = this.form || {}
|
|
|
684
|
+ var s = d.pricingDeadline == null ? '' : String(d.pricingDeadline).trim()
|
|
|
685
|
+ if (!s) return ''
|
|
|
686
|
+ if (s.length >= 10) return s.slice(0, 10)
|
|
|
687
|
+ return s
|
|
|
688
|
+ },
|
|
|
689
|
+ deliveryDateDisplay() {
|
|
|
690
|
+ var d = this.form || {}
|
|
|
691
|
+ var s = d.deliveryDate == null ? '' : String(d.deliveryDate).trim()
|
|
|
692
|
+ if (!s) return ''
|
|
|
693
|
+ if (s.length >= 10) return s.slice(0, 10)
|
|
|
694
|
+ return s
|
|
|
695
|
+ },
|
|
|
696
|
+ loadingFeeDisplay() {
|
|
|
697
|
+ var v = (this.form || {}).loadingFee
|
|
|
698
|
+ if (v == null || v === '') return ''
|
|
|
699
|
+ var n = Number(v)
|
|
|
700
|
+ if (isNaN(n)) return String(v)
|
|
|
701
|
+ return n.toLocaleString('zh-CN', { maximumFractionDigits: 4 })
|
|
|
702
|
+ },
|
|
|
703
|
+ settlementRatioDisplay() {
|
|
|
704
|
+ var v = (this.form || {}).settlementRatio
|
|
|
705
|
+ if (v == null || v === '') return ''
|
|
|
706
|
+ var n = Number(v)
|
|
|
707
|
+ if (isNaN(n)) return String(v)
|
|
|
708
|
+ return n.toLocaleString('zh-CN', { maximumFractionDigits: 4 })
|
|
|
709
|
+ },
|
|
|
710
|
+ shippingCostDisplay() {
|
|
|
711
|
+ var v = (this.form || {}).shippingCost
|
|
|
712
|
+ if (v == null || v === '') return ''
|
|
|
713
|
+ var n = Number(v)
|
|
|
714
|
+ if (isNaN(n)) return String(v)
|
|
|
715
|
+ return n.toLocaleString('zh-CN', { maximumFractionDigits: 4 })
|
|
|
716
|
+ },
|
|
|
717
|
+ totalQuantityDisplay() {
|
|
|
718
|
+ var v = (this.form || {}).totalQuantity
|
|
|
719
|
+ if (v == null || v === '') return ''
|
|
|
720
|
+ var n = Number(v)
|
|
|
721
|
+ if (isNaN(n)) return String(v)
|
|
|
722
|
+ return n.toLocaleString('zh-CN', { maximumFractionDigits: 4 })
|
|
|
723
|
+ },
|
|
244
|
724
|
priceTableCodeLabel() {
|
|
245
|
725
|
var d = this.form || {}
|
|
246
|
|
- var code = d.priceTableCode != null ? d.priceTableCode : ''
|
|
247
|
|
- var name = d.priceTableName || ''
|
|
|
726
|
+ var code = d.priceTableCode != null ? d.priceTableCode : (d.priceId != null ? d.priceId : (d.priceTableId != null ? d.priceTableId : ''))
|
|
|
727
|
+ var name = d.priceTableName || d.tableName || d.name || ''
|
|
248
|
728
|
if (name || code) {
|
|
249
|
729
|
return (name ? name + (code ? ' (' + code + ')' : '') : String(code))
|
|
250
|
730
|
}
|
|
...
|
...
|
@@ -287,8 +767,8 @@ export default { |
|
287
|
767
|
},
|
|
288
|
768
|
priceTableDisplay() {
|
|
289
|
769
|
var d = this.form || {}
|
|
290
|
|
- var code = d.priceTableCode != null ? String(d.priceTableCode).trim() : ''
|
|
291
|
|
- var name = d.priceTableName || ''
|
|
|
770
|
+ var code = d.priceTableCode != null ? String(d.priceTableCode).trim() : (d.priceId != null ? String(d.priceId).trim() : (d.priceTableId != null ? String(d.priceTableId).trim() : ''))
|
|
|
771
|
+ var name = d.priceTableName || d.tableName || d.name || ''
|
|
292
|
772
|
if (name || code) {
|
|
293
|
773
|
return (name ? name + (code ? ' (' + code + ')' : '') : String(code))
|
|
294
|
774
|
}
|
|
...
|
...
|
@@ -311,10 +791,14 @@ export default { |
|
311
|
791
|
},
|
|
312
|
792
|
methods: {
|
|
313
|
793
|
getUserInfo() {
|
|
|
794
|
+ var self = this
|
|
314
|
795
|
getInfo()
|
|
315
|
796
|
.then((res) => {
|
|
316
|
|
- this.isGyglkzg = !!(res?.roleCodes?.includes('gyglkzg') && res?.roleCodes?.includes('001'));
|
|
317
|
|
- this.isGyglkzlglg = !!(res?.roleCodes?.includes('gyglkzlglg') && res?.roleCodes?.includes('001'));
|
|
|
797
|
+ var codes = Array.isArray(res?.roleCodes) ? res.roleCodes : []
|
|
|
798
|
+ self._roleCodesFromApi = codes
|
|
|
799
|
+ // self.isGyglkzg = !!(codes.includes('gyglkzg') && codes.includes('001'));
|
|
|
800
|
+ self.isGyglkzlglg = !!(codes.includes('gyglkzlglg') && codes.includes('001'));
|
|
|
801
|
+ self.isGyglkjhgly = codes.includes('gyglkjhgly');
|
|
318
|
802
|
})
|
|
319
|
803
|
.catch((err) => {
|
|
320
|
804
|
console.error('获取用户信息失败:', err);
|
|
...
|
...
|
@@ -353,14 +837,22 @@ export default { |
|
353
|
837
|
var self = this
|
|
354
|
838
|
try {
|
|
355
|
839
|
var results = await Promise.all([
|
|
|
840
|
+ this.pCall(priceTableQueryApi, { pageIndex: 1, pageSize: 1000 }),
|
|
356
|
841
|
this.pCall(breedRelationshipQueryApi, { pageIndex: 1, pageSize: 1000 }),
|
|
357
|
842
|
this.pCall(workshopQueryApi, { pageIndex: 1, pageSize: 1000 })
|
|
358
|
843
|
])
|
|
359
|
|
- var r1 = (results[0] && results[0].data) ? results[0].data : {}
|
|
360
|
|
- var r2 = (results[1] && results[1].data) ? results[1].data : {}
|
|
|
844
|
+ var r0 = (results[0] && results[0].data) ? results[0].data : {}
|
|
|
845
|
+ var r1 = (results[1] && results[1].data) ? results[1].data : {}
|
|
|
846
|
+ var r2 = (results[2] && results[2].data) ? results[2].data : {}
|
|
|
847
|
+ 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 : []))
|
|
|
848
|
+ self.priceTableList = Array.isArray(rawPriceTableList) ? rawPriceTableList.map(function (item) { return self.normalizePriceTableRow(item) }) : []
|
|
361
|
849
|
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 : []))
|
|
362
|
850
|
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 : []))
|
|
|
851
|
+ if (self.isGyglkjhgly && self.isAuditPage && !self.priceTableCodeLabel && (self.form.priceTableId || self.form.priceId || self.form.priceTableCode)) {
|
|
|
852
|
+ self.fillPriceTableFromDetail(self.form)
|
|
|
853
|
+ }
|
|
363
|
854
|
} catch (e) {
|
|
|
855
|
+ self.priceTableList = []
|
|
364
|
856
|
self.productOptions = []
|
|
365
|
857
|
self.workshopOptions = []
|
|
366
|
858
|
}
|
|
...
|
...
|
@@ -399,15 +891,23 @@ export default { |
|
399
|
891
|
var lines = d.lines || d.procurementPlanLineList || d.lineList || []
|
|
400
|
892
|
this.lineList = Array.isArray(lines) ? lines.slice() : []
|
|
401
|
893
|
// 初始化可编辑字段
|
|
402
|
|
- this.form.companyId = d.companyId || ''
|
|
403
|
|
- this.form.companyShortName = d.companyShortName || d.companyName || ''
|
|
|
894
|
+ this.form.companyId = d.companyId || d.companyShortId || ''
|
|
|
895
|
+ this.form.companyShortId = d.companyShortId || d.companyId || ''
|
|
|
896
|
+ this.form.companyShortName = d.companyShortName || d.shortName || d.companyName || d.name || ''
|
|
|
897
|
+ this.form.companyName = d.companyName || d.companyShortName || d.shortName || d.name || ''
|
|
|
898
|
+ this.form.priceTableId = d.priceTableId || d.priceId || ''
|
|
|
899
|
+ this.form.priceId = d.priceId || d.priceTableId || ''
|
|
|
900
|
+ this.form.priceTableCode = d.priceTableCode || d.code || ''
|
|
|
901
|
+ this.form.priceTableName = d.priceTableName || d.tableName || d.name || ''
|
|
404
|
902
|
var date = d.date ? String(d.date).trim() : ''
|
|
405
|
903
|
this.form.date = date.length >= 10 ? date.slice(0, 10) : date
|
|
406
|
904
|
var sc = d.shippingCost
|
|
407
|
905
|
this.form.shippingCost = (sc != null && sc !== '') ? this.toFixed(sc, 2) : ''
|
|
408
|
906
|
this.buildAttachmentList()
|
|
409
|
907
|
this.refreshLinesFromShipping()
|
|
410
|
|
- if (this.canEdit) {
|
|
|
908
|
+ if (this.isGyglkjhgly && this.isAuditPage) {
|
|
|
909
|
+ this.fillPriceTableFromDetail(d)
|
|
|
910
|
+ } else if (this.canEdit) {
|
|
411
|
911
|
this.loadLatestPriceTableAndApply()
|
|
412
|
912
|
} else {
|
|
413
|
913
|
this.fetchPriceDetailAndApply(d.priceId)
|
|
...
|
...
|
@@ -476,6 +976,12 @@ export default { |
|
476
|
976
|
if (isNaN(n)) return String(v)
|
|
477
|
977
|
return n.toLocaleString('zh-CN', { maximumFractionDigits: 4 })
|
|
478
|
978
|
},
|
|
|
979
|
+ lineNumberDisplay(v) {
|
|
|
980
|
+ if (v == null || v === '') return ''
|
|
|
981
|
+ var n = Number(v)
|
|
|
982
|
+ if (isNaN(n)) return String(v)
|
|
|
983
|
+ return n.toLocaleString('zh-CN', { maximumFractionDigits: 4 })
|
|
|
984
|
+ },
|
|
479
|
985
|
onPreviewAttachment(at) {
|
|
480
|
986
|
if (!at || !at.id) {
|
|
481
|
987
|
uni.showToast({ title: '无法查看', icon: 'none' })
|
|
...
|
...
|
@@ -484,14 +990,36 @@ export default { |
|
484
|
990
|
uni.showToast({ title: '查看附件 ' + at.name, icon: 'none' })
|
|
485
|
991
|
},
|
|
486
|
992
|
// ==================== 公司下拉 ====================
|
|
|
993
|
+ normalizeCompanyRow(row) {
|
|
|
994
|
+ var item = row || {}
|
|
|
995
|
+ var id = item.id != null ? item.id : (item.companyShortId != null ? item.companyShortId : (item.companyId != null ? item.companyId : (item.value != null ? item.value : '')))
|
|
|
996
|
+ var shortName = item.shortName != null ? item.shortName : (item.companyShortName != null ? item.companyShortName : (item.companyName != null ? item.companyName : (item.name != null ? item.name : '')))
|
|
|
997
|
+ var companyName = item.companyName != null ? item.companyName : (item.name != null ? item.name : shortName)
|
|
|
998
|
+ var deptName = item.deptName != null ? item.deptName : (item.departmentName != null ? item.departmentName : '')
|
|
|
999
|
+ var code = item.code != null ? item.code : (item.companyCode != null ? item.companyCode : '')
|
|
|
1000
|
+ return Object.assign({}, item, {
|
|
|
1001
|
+ id: id,
|
|
|
1002
|
+ value: id,
|
|
|
1003
|
+ companyId: id,
|
|
|
1004
|
+ companyShortId: id,
|
|
|
1005
|
+ shortName: shortName,
|
|
|
1006
|
+ companyShortName: shortName,
|
|
|
1007
|
+ companyName: companyName,
|
|
|
1008
|
+ name: companyName,
|
|
|
1009
|
+ deptName: deptName,
|
|
|
1010
|
+ code: code
|
|
|
1011
|
+ })
|
|
|
1012
|
+ },
|
|
487
|
1013
|
fetchCompanyList(args) {
|
|
488
|
1014
|
var extra = (args && args.extra) ? args.extra : {}
|
|
489
|
1015
|
var keyword = extra.keyword || extra.name || ''
|
|
490
|
1016
|
var params = { pageIndex: args.pageIndex || 1, pageSize: args.pageSize || 20 }
|
|
491
|
1017
|
if (keyword) params.name = keyword
|
|
|
1018
|
+ var self = this
|
|
492
|
1019
|
return companyShortQueryApi(params).then(function (res) {
|
|
493
|
1020
|
var d = (res && res.data) ? res.data : {}
|
|
494
|
1021
|
var records = (d.datas && Array.isArray(d.datas)) ? d.datas : ((d.records && Array.isArray(d.records)) ? d.records : ((d.list && Array.isArray(d.list)) ? d.list : []))
|
|
|
1022
|
+ records = Array.isArray(records) ? records.map(function (item) { return self.normalizeCompanyRow(item) }) : []
|
|
495
|
1023
|
var total = d.totalCount || d.count || (records ? records.length : 0)
|
|
496
|
1024
|
var hasNext = !!d.hasNext
|
|
497
|
1025
|
return { records: records, totalCount: total, hasNext: hasNext }
|
|
...
|
...
|
@@ -505,9 +1033,11 @@ export default { |
|
505
|
1033
|
onCompanyConfirm(e) {
|
|
506
|
1034
|
var items = (e && e.items) ? e.items : []
|
|
507
|
1035
|
if (!items.length) return
|
|
508
|
|
- var row = items[0] || {}
|
|
|
1036
|
+ var row = this.normalizeCompanyRow(items[0] || {})
|
|
509
|
1037
|
this.form.companyId = row.id || ''
|
|
510
|
|
- this.form.companyShortName = row.companyShortName || row.companyName || row.name || ''
|
|
|
1038
|
+ this.form.companyShortId = row.id || ''
|
|
|
1039
|
+ this.form.companyShortName = row.companyShortName || ''
|
|
|
1040
|
+ this.form.companyName = row.companyName || row.companyShortName || ''
|
|
511
|
1041
|
},
|
|
512
|
1042
|
// ==================== 价格表下拉 ====================
|
|
513
|
1043
|
fetchPriceTableList(args) {
|
|
...
|
...
|
@@ -515,9 +1045,11 @@ export default { |
|
515
|
1045
|
var keyword = extra.keyword || extra.name || ''
|
|
516
|
1046
|
var params = { pageIndex: args.pageIndex || 1, pageSize: args.pageSize || 20 }
|
|
517
|
1047
|
if (keyword) params.name = keyword
|
|
|
1048
|
+ var self = this
|
|
518
|
1049
|
return priceTableQueryApi(params).then(function (res) {
|
|
519
|
1050
|
var d = (res && res.data) ? res.data : {}
|
|
520
|
1051
|
var records = (d.datas && Array.isArray(d.datas)) ? d.datas : ((d.records && Array.isArray(d.records)) ? d.records : ((d.list && Array.isArray(d.list)) ? d.list : []))
|
|
|
1052
|
+ records = Array.isArray(records) ? records.map(function (item) { return self.normalizePriceTableRow(item) }) : []
|
|
521
|
1053
|
var total = d.totalCount || d.count || (records ? records.length : 0)
|
|
522
|
1054
|
var hasNext = !!d.hasNext
|
|
523
|
1055
|
return { records: records, totalCount: total, hasNext: hasNext }
|
|
...
|
...
|
@@ -533,10 +1065,60 @@ export default { |
|
533
|
1065
|
if (!items.length) return
|
|
534
|
1066
|
this.selectPriceTableRow(items[0] || {})
|
|
535
|
1067
|
},
|
|
|
1068
|
+ normalizePriceTableRow(row) {
|
|
|
1069
|
+ var item = row || {}
|
|
|
1070
|
+ var id = item.id != null ? item.id : (item.priceId != null ? item.priceId : (item.value != null ? item.value : ''))
|
|
|
1071
|
+ var code = item.priceTableCode != null ? item.priceTableCode : (item.code != null ? item.code : (item.priceCode != null ? item.priceCode : ''))
|
|
|
1072
|
+ var name = item.priceTableName != null ? item.priceTableName : (item.tableName != null ? item.tableName : (item.name != null ? item.name : (item.label != null ? item.label : '')))
|
|
|
1073
|
+ var effectiveDate = item.effectiveDate != null ? item.effectiveDate : (item.createTime != null ? item.createTime : (item.updateTime != null ? item.updateTime : (item.date != null ? item.date : '')))
|
|
|
1074
|
+ return Object.assign({}, item, {
|
|
|
1075
|
+ id: id,
|
|
|
1076
|
+ priceId: id,
|
|
|
1077
|
+ priceTableId: id,
|
|
|
1078
|
+ code: code,
|
|
|
1079
|
+ priceTableCode: code,
|
|
|
1080
|
+ name: name,
|
|
|
1081
|
+ tableName: name,
|
|
|
1082
|
+ priceTableName: name,
|
|
|
1083
|
+ effectiveDate: effectiveDate
|
|
|
1084
|
+ })
|
|
|
1085
|
+ },
|
|
536
|
1086
|
selectPriceTableRow(row) {
|
|
537
|
|
- this.form.priceTableId = row.id || ''
|
|
538
|
|
- this.form.priceTableCode = row.priceTableCode || row.code || ''
|
|
539
|
|
- this.form.priceTableName = row.priceTableName || row.name || ''
|
|
|
1087
|
+ var item = this.normalizePriceTableRow(row)
|
|
|
1088
|
+ this.form.priceTableId = item.id || ''
|
|
|
1089
|
+ this.form.priceId = item.id || ''
|
|
|
1090
|
+ this.form.priceTableCode = item.priceTableCode || ''
|
|
|
1091
|
+ this.form.priceTableName = item.priceTableName || ''
|
|
|
1092
|
+ if (this.form.priceTableId) {
|
|
|
1093
|
+ this.fetchPriceDetailAndApply(this.form.priceTableId)
|
|
|
1094
|
+ }
|
|
|
1095
|
+ },
|
|
|
1096
|
+ fillPriceTableFromDetail(d) {
|
|
|
1097
|
+ var detail = d || this.form || {}
|
|
|
1098
|
+ var code = detail.priceTableCode != null ? detail.priceTableCode : ''
|
|
|
1099
|
+ var id = detail.priceTableId != null ? detail.priceTableId : (detail.priceId != null ? detail.priceId : '')
|
|
|
1100
|
+ var token = code || id
|
|
|
1101
|
+ if (!token) return
|
|
|
1102
|
+ var sc = String(token)
|
|
|
1103
|
+ var list = Array.isArray(this.priceTableList) ? this.priceTableList : []
|
|
|
1104
|
+ var matched = null
|
|
|
1105
|
+ for (var i = 0; i < list.length; i++) {
|
|
|
1106
|
+ var o = list[i]
|
|
|
1107
|
+ var id = String(o.id || o.priceId || o.value || '')
|
|
|
1108
|
+ var c = String(o.priceTableCode || o.code || o.priceCode || '')
|
|
|
1109
|
+ if (id === sc || c === sc) {
|
|
|
1110
|
+ matched = o
|
|
|
1111
|
+ break
|
|
|
1112
|
+ }
|
|
|
1113
|
+ }
|
|
|
1114
|
+ if (matched) {
|
|
|
1115
|
+ this.selectPriceTableRow(matched)
|
|
|
1116
|
+ return
|
|
|
1117
|
+ }
|
|
|
1118
|
+ this.form.priceTableId = id || ''
|
|
|
1119
|
+ this.form.priceId = id || ''
|
|
|
1120
|
+ this.form.priceTableCode = code || (id ? String(id) : '')
|
|
|
1121
|
+ this.form.priceTableName = detail.priceTableName != null ? detail.priceTableName : (detail.tableName != null ? detail.tableName : (detail.name != null ? detail.name : ''))
|
|
540
|
1122
|
if (this.form.priceTableId) {
|
|
541
|
1123
|
this.fetchPriceDetailAndApply(this.form.priceTableId)
|
|
542
|
1124
|
}
|
|
...
|
...
|
@@ -548,7 +1130,7 @@ export default { |
|
548
|
1130
|
var d = (res && res.data) ? res.data : {}
|
|
549
|
1131
|
var list = (d.datas && Array.isArray(d.datas)) ? d.datas : ((d.records && Array.isArray(d.records)) ? d.records : ((d.list && Array.isArray(d.list)) ? d.list : []))
|
|
550
|
1132
|
if (!list || !list.length) return
|
|
551
|
|
- self.selectPriceTableRow(list[0])
|
|
|
1133
|
+ self.selectPriceTableRow(self.normalizePriceTableRow(list[0]))
|
|
552
|
1134
|
} catch (e) {
|
|
553
|
1135
|
return
|
|
554
|
1136
|
}
|
|
...
|
...
|
@@ -559,11 +1141,16 @@ export default { |
|
559
|
1141
|
try {
|
|
560
|
1142
|
var res = await priceTableDetailApi({ id: priceId })
|
|
561
|
1143
|
var d = (res && res.data) ? res.data : {}
|
|
|
1144
|
+ if (d.id != null && this.form) {
|
|
|
1145
|
+ this.$set(this.form, 'priceTableId', d.id)
|
|
|
1146
|
+ this.$set(this.form, 'priceId', d.id)
|
|
|
1147
|
+ }
|
|
562
|
1148
|
if (d.code != null && this.form) {
|
|
563
|
1149
|
this.$set(this.form, 'priceTableCode', String(d.code))
|
|
564
|
1150
|
}
|
|
565
|
|
- if (d.priceTableName != null && this.form) {
|
|
566
|
|
- this.$set(this.form, 'priceTableName', d.priceTableName)
|
|
|
1151
|
+ var priceTableName = d.priceTableName != null ? d.priceTableName : (d.tableName != null ? d.tableName : (d.name != null ? d.name : ''))
|
|
|
1152
|
+ if (priceTableName && this.form) {
|
|
|
1153
|
+ this.$set(this.form, 'priceTableName', priceTableName)
|
|
567
|
1154
|
}
|
|
568
|
1155
|
var priceLines = self.extractPriceLines(d)
|
|
569
|
1156
|
self.applyPriceLinesToLines(priceLines)
|
|
...
|
...
|
@@ -731,6 +1318,28 @@ export default { |
|
731
|
1318
|
this.$set(row, 'coordinationRange', this.toFixed(coord, 2))
|
|
732
|
1319
|
},
|
|
733
|
1320
|
// ==================== 审核提交 ====================
|
|
|
1321
|
+ joinStr(arr) {
|
|
|
1322
|
+ if (Array.isArray(arr)) return arr.filter(Boolean).join(',')
|
|
|
1323
|
+ if (typeof arr === 'string') return arr
|
|
|
1324
|
+ return ''
|
|
|
1325
|
+ },
|
|
|
1326
|
+ pickId(v) {
|
|
|
1327
|
+ if (v == null || v === '') return ''
|
|
|
1328
|
+ if (typeof v === 'string' || typeof v === 'number') return String(v)
|
|
|
1329
|
+ if (typeof v === 'object') {
|
|
|
1330
|
+ return String(v.id != null ? v.id : (v.value != null ? v.value : (v.code != null ? v.code : '')))
|
|
|
1331
|
+ }
|
|
|
1332
|
+ return String(v)
|
|
|
1333
|
+ },
|
|
|
1334
|
+ toBool(v, fallback) {
|
|
|
1335
|
+ if (typeof v === 'boolean') return v
|
|
|
1336
|
+ if (v === 'true' || v === '1' || v === 1) return true
|
|
|
1337
|
+ if (v === 'false' || v === '0' || v === 0) return false
|
|
|
1338
|
+ return typeof fallback === 'boolean' ? fallback : false
|
|
|
1339
|
+ },
|
|
|
1340
|
+ boolToStr(v) {
|
|
|
1341
|
+ return v === true ? 'true' : 'false'
|
|
|
1342
|
+ },
|
|
734
|
1343
|
checkForm() {
|
|
735
|
1344
|
if (!this.canEdit) return true
|
|
736
|
1345
|
if (!this.form.companyId) {
|
|
...
|
...
|
@@ -758,25 +1367,73 @@ export default { |
|
758
|
1367
|
},
|
|
759
|
1368
|
getFormValues() {
|
|
760
|
1369
|
var self = this
|
|
761
|
|
- var lines = Array.isArray(this.lineList) ? this.lineList : []
|
|
762
|
|
- return {
|
|
763
|
|
- companyId: this.form.companyId || '',
|
|
764
|
|
- companyShortName: this.form.companyShortName || this.form.companyName || '',
|
|
765
|
|
- date: this.form.date || '',
|
|
766
|
|
- shippingCost: this.form.shippingCost != null && this.form.shippingCost !== '' ? this.toNumber(this.form.shippingCost) : null,
|
|
767
|
|
- priceTableId: this.form.priceTableId || '',
|
|
768
|
|
- priceTableCode: this.form.priceTableCode || '',
|
|
769
|
|
- lineList: lines.map(function (r) {
|
|
770
|
|
- return {
|
|
771
|
|
- itemId: r.itemId || r.id || '',
|
|
772
|
|
- workshopId: r.workshopId || '',
|
|
773
|
|
- workshopName: r.workshopName || '',
|
|
774
|
|
- priceListPrices: self.toNumber(r.priceListPrices),
|
|
775
|
|
- includingShippingPrice: self.toNumber(r.includingShippingPrice),
|
|
776
|
|
- coordinationRange: self.toNumber(r.coordinationRange)
|
|
777
|
|
- }
|
|
778
|
|
- })
|
|
|
1370
|
+ var d = this.form || {}
|
|
|
1371
|
+ var lines = Array.isArray(this.lineList) ? this.lineList.slice() : []
|
|
|
1372
|
+ var lineList = lines.map(function (row, i) {
|
|
|
1373
|
+ var r = row || {}
|
|
|
1374
|
+ var itemId = r.itemId != null ? r.itemId : (r.id != null ? String(r.id) : (r._key != null ? r._key : ('line-' + Date.now() + '-' + i)))
|
|
|
1375
|
+ return {
|
|
|
1376
|
+ id: r.id != null ? r.id : '',
|
|
|
1377
|
+ itemId: itemId,
|
|
|
1378
|
+ productId: self.pickId(r.productId),
|
|
|
1379
|
+ materialType: r.materialType != null ? String(r.materialType) : '',
|
|
|
1380
|
+ quantity: r.quantity != null ? (self.toNumber(r.quantity)) : '',
|
|
|
1381
|
+ actualPurchasePrice: r.actualPurchasePrice != null ? (self.toNumber(r.actualPurchasePrice)) : '',
|
|
|
1382
|
+ includingShippingPrice: r.includingShippingPrice != null ? (self.toNumber(r.includingShippingPrice)) : '',
|
|
|
1383
|
+ priceListPrices: r.priceListPrices != null ? (self.toNumber(r.priceListPrices)) : '',
|
|
|
1384
|
+ coordinationRange: r.coordinationRange != null ? (self.toNumber(r.coordinationRange)) : '',
|
|
|
1385
|
+ estimatedLoss: r.estimatedLoss != null ? (self.toNumber(r.estimatedLoss)) : '',
|
|
|
1386
|
+ applicationAttrition: r.applicationAttrition != null ? (self.toNumber(r.applicationAttrition)) : '',
|
|
|
1387
|
+ paintDamageRatio: r.paintDamageRatio != null ? (self.toNumber(r.paintDamageRatio)) : '',
|
|
|
1388
|
+ workshopId: self.pickId(r.workshopId),
|
|
|
1389
|
+ procurementPlanChangeId: r.procurementPlanChangeId != null ? r.procurementPlanChangeId : (d.id != null ? d.id : '')
|
|
|
1390
|
+ }
|
|
|
1391
|
+ })
|
|
|
1392
|
+ var body = {
|
|
|
1393
|
+ id: d.id || '',
|
|
|
1394
|
+ procurementPlanId: d.procurementPlanId || '',
|
|
|
1395
|
+ changeReason: d.changeReason != null ? String(d.changeReason) : '',
|
|
|
1396
|
+ code: d.code != null ? String(d.code) : '',
|
|
|
1397
|
+ companyShortId: this.pickId(d.companyShortId || d.companyId),
|
|
|
1398
|
+ supplierId: this.pickId(d.supplierId),
|
|
|
1399
|
+ purchaseDepartment: this.pickId(d.purchaseDepartmentId || d.purchaseDepartment),
|
|
|
1400
|
+ region: this.pickId(d.regionId || d.region),
|
|
|
1401
|
+ date: d.date != null ? String(d.date).slice(0, 10) : '',
|
|
|
1402
|
+ validityPeriod: d.validityPeriod != null ? String(d.validityPeriod) : '',
|
|
|
1403
|
+ quoterId: this.pickId(d.quoterId),
|
|
|
1404
|
+ quoterName: d.quoterName != null ? String(d.quoterName) : '',
|
|
|
1405
|
+ longTermOperation: this.boolToStr(this.toBool(d.longTermOperation, false)),
|
|
|
1406
|
+ terminalCustomer: this.boolToStr(this.toBool(d.terminalCustomer, false)),
|
|
|
1407
|
+ priced: this.boolToStr(this.toBool(d.priced, false)),
|
|
|
1408
|
+ pricingDeadline: d.pricingDeadline != null ? String(d.pricingDeadline) : '',
|
|
|
1409
|
+ temporaryPrice: this.boolToStr(this.toBool(d.temporaryPrice, false)),
|
|
|
1410
|
+ otherExpenseSettlement: this.boolToStr(this.toBool(d.otherExpenseSettlement, false)),
|
|
|
1411
|
+ deliveryMode: d.deliveryMode != null ? String(d.deliveryMode) : '',
|
|
|
1412
|
+ commodityBuyout: this.boolToStr(this.toBool(d.commodityBuyout, false)),
|
|
|
1413
|
+ qualityBuyout: this.boolToStr(this.toBool(d.qualityBuyout, false)),
|
|
|
1414
|
+ quantityBuyout: this.boolToStr(this.toBool(d.quantityBuyout, false)),
|
|
|
1415
|
+ doorDelivery: this.boolToStr(this.toBool(d.doorDelivery, false)),
|
|
|
1416
|
+ shippingCost: d.shippingCost != null ? (this.toNumber(d.shippingCost)) : '',
|
|
|
1417
|
+ loadingFee: d.loadingFee != null ? (this.toNumber(d.loadingFee)) : '',
|
|
|
1418
|
+ invoiceProductName: d.invoiceProductName != null ? String(d.invoiceProductName) : '',
|
|
|
1419
|
+ deliveryDate: d.deliveryDate != null ? String(d.deliveryDate) : '',
|
|
|
1420
|
+ settlementMethod: d.settlementMethod != null ? String(d.settlementMethod) : '',
|
|
|
1421
|
+ settlementRatio: d.settlementRatio != null ? (this.toNumber(d.settlementRatio)) : '',
|
|
|
1422
|
+ priceId: this.pickId(d.priceTableId || d.priceId),
|
|
|
1423
|
+ coordinationReason: d.coordinationReason != null ? String(d.coordinationReason) : '',
|
|
|
1424
|
+ invoiceTypeStatus: d.invoiceTypeStatus != null ? String(d.invoiceTypeStatus) : '',
|
|
|
1425
|
+ totalQuantity: d.totalQuantity != null ? (this.toNumber(d.totalQuantity)) : '',
|
|
|
1426
|
+ remark: d.remark != null ? String(d.remark) : '',
|
|
|
1427
|
+ materialConditionEnabled: this.boolToStr(this.toBool(d.materialConditionEnabled, false)),
|
|
|
1428
|
+ approvalStatus: d.approvalStatus != null ? String(d.approvalStatus) : '',
|
|
|
1429
|
+ processStatus: d.processStatus != null ? String(d.processStatus) : '',
|
|
|
1430
|
+ processNode: d.processNode != null ? String(d.processNode) : '',
|
|
|
1431
|
+ lines: lineList
|
|
779
|
1432
|
}
|
|
|
1433
|
+ this.materialConditionConfigs.forEach(function (mc) {
|
|
|
1434
|
+ body[mc.field] = self.joinStr(d[mc.field])
|
|
|
1435
|
+ })
|
|
|
1436
|
+ return body
|
|
780
|
1437
|
}
|
|
781
|
1438
|
}
|
|
782
|
1439
|
}
|
|
...
|
...
|
@@ -784,11 +1441,22 @@ export default { |
|
784
|
1441
|
<style lang="scss" scoped>
|
|
785
|
1442
|
.detail-page {
|
|
786
|
1443
|
background: #f3f3f3;
|
|
|
1444
|
+ min-height: 100%;
|
|
787
|
1445
|
}
|
|
788
|
1446
|
.scroll {
|
|
789
|
1447
|
flex: 1;
|
|
790
|
1448
|
padding: 8rpx 0 48rpx;
|
|
791
|
1449
|
}
|
|
|
1450
|
+.edit-list,
|
|
|
1451
|
+.edit-line-list {
|
|
|
1452
|
+ margin-bottom: 20rpx;
|
|
|
1453
|
+}
|
|
|
1454
|
+.edit-line-block {
|
|
|
1455
|
+ margin-bottom: 20rpx;
|
|
|
1456
|
+ &:last-child {
|
|
|
1457
|
+ margin-bottom: 0;
|
|
|
1458
|
+ }
|
|
|
1459
|
+}
|
|
792
|
1460
|
.title-header {
|
|
793
|
1461
|
display: flex;
|
|
794
|
1462
|
align-items: center;
|
|
...
|
...
|
@@ -956,4 +1624,147 @@ export default { |
|
956
|
1624
|
color: rgba(0, 0, 0, 0.4);
|
|
957
|
1625
|
padding: 24rpx 0;
|
|
958
|
1626
|
}
|
|
|
1627
|
+::v-deep .edit-list,
|
|
|
1628
|
+::v-deep .edit-line-block .uni-list {
|
|
|
1629
|
+ background: transparent;
|
|
|
1630
|
+ .uni-list-item__container {
|
|
|
1631
|
+ padding: 32rpx;
|
|
|
1632
|
+ }
|
|
|
1633
|
+}
|
|
|
1634
|
+::v-deep .uni-list {
|
|
|
1635
|
+ .uni-easyinput {
|
|
|
1636
|
+ display: flex;
|
|
|
1637
|
+ .uni-input-input {
|
|
|
1638
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
1639
|
+ }
|
|
|
1640
|
+ }
|
|
|
1641
|
+ .uni-input-placeholder {
|
|
|
1642
|
+ z-index: 1;
|
|
|
1643
|
+ }
|
|
|
1644
|
+ .uni-input-input {
|
|
|
1645
|
+ background-color: #ffffff;
|
|
|
1646
|
+ }
|
|
|
1647
|
+ background: transparent;
|
|
|
1648
|
+ &-item {
|
|
|
1649
|
+ &__extra-text {
|
|
|
1650
|
+ font-size: 32rpx;
|
|
|
1651
|
+ }
|
|
|
1652
|
+ &__content-title {
|
|
|
1653
|
+ font-size: 32rpx;
|
|
|
1654
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
1655
|
+ }
|
|
|
1656
|
+ &__container {
|
|
|
1657
|
+ .uni-easyinput {
|
|
|
1658
|
+ &__placeholder-class {
|
|
|
1659
|
+ font-size: 32rpx;
|
|
|
1660
|
+ color: rgba(0, 0, 0, 0.4);
|
|
|
1661
|
+ }
|
|
|
1662
|
+ &__content {
|
|
|
1663
|
+ border: none;
|
|
|
1664
|
+ background-color: #ffffff !important;
|
|
|
1665
|
+ &-input {
|
|
|
1666
|
+ padding-left: 0 !important;
|
|
|
1667
|
+ height: 48rpx;
|
|
|
1668
|
+ line-height: 48rpx;
|
|
|
1669
|
+ font-size: 32rpx;
|
|
|
1670
|
+ }
|
|
|
1671
|
+ .content-clear-icon {
|
|
|
1672
|
+ font-size: 44rpx !important;
|
|
|
1673
|
+ }
|
|
|
1674
|
+ }
|
|
|
1675
|
+ }
|
|
|
1676
|
+ .item-title,
|
|
|
1677
|
+ .uni-list-item__content {
|
|
|
1678
|
+ flex: none;
|
|
|
1679
|
+ min-height: 48rpx;
|
|
|
1680
|
+ line-height: 48rpx;
|
|
|
1681
|
+ font-size: 32rpx;
|
|
|
1682
|
+ position: relative;
|
|
|
1683
|
+ width: 240rpx;
|
|
|
1684
|
+ margin-right: 32rpx;
|
|
|
1685
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
1686
|
+ .required {
|
|
|
1687
|
+ color: red;
|
|
|
1688
|
+ position: absolute;
|
|
|
1689
|
+ top: 50%;
|
|
|
1690
|
+ transform: translateY(-50%);
|
|
|
1691
|
+ left: -16rpx;
|
|
|
1692
|
+ }
|
|
|
1693
|
+ }
|
|
|
1694
|
+ }
|
|
|
1695
|
+ &.select-item {
|
|
|
1696
|
+ &.is-empty {
|
|
|
1697
|
+ .uni-list-item__extra-text {
|
|
|
1698
|
+ color: rgba(0, 0, 0, 0.4) !important;
|
|
|
1699
|
+ }
|
|
|
1700
|
+ }
|
|
|
1701
|
+ &.is-filled {
|
|
|
1702
|
+ .uni-list-item__extra-text {
|
|
|
1703
|
+ color: rgba(0, 0, 0, 0.9) !important;
|
|
|
1704
|
+ }
|
|
|
1705
|
+ }
|
|
|
1706
|
+ .serial-number-row {
|
|
|
1707
|
+ display: flex;
|
|
|
1708
|
+ align-items: center;
|
|
|
1709
|
+ }
|
|
|
1710
|
+ }
|
|
|
1711
|
+ }
|
|
|
1712
|
+}
|
|
|
1713
|
+.readonly-text {
|
|
|
1714
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
1715
|
+ font-size: 32rpx;
|
|
|
1716
|
+ line-height: 48rpx;
|
|
|
1717
|
+ text-align: right;
|
|
|
1718
|
+ white-space: pre-wrap;
|
|
|
1719
|
+ word-break: break-all;
|
|
|
1720
|
+}
|
|
|
1721
|
+.value-code {
|
|
|
1722
|
+ width: 260rpx;
|
|
|
1723
|
+ text-align: left;
|
|
|
1724
|
+}
|
|
|
1725
|
+.material-condition-section,
|
|
|
1726
|
+.remark-section {
|
|
|
1727
|
+ margin-top: 20rpx;
|
|
|
1728
|
+ background: #fff;
|
|
|
1729
|
+}
|
|
|
1730
|
+.section-header {
|
|
|
1731
|
+ display: flex;
|
|
|
1732
|
+ align-items: center;
|
|
|
1733
|
+ padding: 24rpx 32rpx;
|
|
|
1734
|
+ border-bottom: 1rpx solid #f0f0f0;
|
|
|
1735
|
+}
|
|
|
1736
|
+.section-title {
|
|
|
1737
|
+ font-size: 32rpx;
|
|
|
1738
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
1739
|
+ font-weight: 600;
|
|
|
1740
|
+ line-height: 44rpx;
|
|
|
1741
|
+}
|
|
|
1742
|
+.opCollapse {
|
|
|
1743
|
+ width: 32rpx;
|
|
|
1744
|
+ height: 28rpx;
|
|
|
1745
|
+ margin-right: 16rpx;
|
|
|
1746
|
+ margin-top: 4rpx;
|
|
|
1747
|
+ flex: 0 0 32rpx;
|
|
|
1748
|
+}
|
|
|
1749
|
+.section-content {
|
|
|
1750
|
+ padding: 32rpx;
|
|
|
1751
|
+}
|
|
|
1752
|
+.form-row {
|
|
|
1753
|
+ display: flex;
|
|
|
1754
|
+ align-items: center;
|
|
|
1755
|
+ justify-content: space-between;
|
|
|
1756
|
+ margin-bottom: 24rpx;
|
|
|
1757
|
+}
|
|
|
1758
|
+.form-row:last-child {
|
|
|
1759
|
+ margin-bottom: 0;
|
|
|
1760
|
+}
|
|
|
1761
|
+.form-label {
|
|
|
1762
|
+ font-size: 32rpx;
|
|
|
1763
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
1764
|
+}
|
|
|
1765
|
+.form-value {
|
|
|
1766
|
+ font-size: 32rpx;
|
|
|
1767
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
1768
|
+ text-align: right;
|
|
|
1769
|
+}
|
|
959
|
1770
|
</style> |
...
|
...
|
|