Commit 3f47ab97e638ac01f88a507aaca40f139225c46c

Authored by 史婷婷
1 parent e000bb49

feat: 产品试样结果跟踪单-审核&审核详情

1   -<template>
2   - <view class="page">
3   - <scroll-view class="scroll" scroll-y>
4   - <view class="detail-page">
5   - <view v-if="isEditAll">
6   - <view class="section">
7   - <uni-list-item title="订货单位" class="no-border-top">
8   - <template v-slot:footer>
9   - <view class="readonly-text">{{ form.orderingUnitName }}</view>
10   - </template>
11   - </uni-list-item>
12   - <uni-list-item class="select-item" :class="form.sampleTypeName ? 'is-filled' : 'is-empty'"
13   - clickable @click="openSheet('sampleType')" :rightText="form.sampleTypeName || '请选择'"
14   - showArrow>
15   - <template v-slot:body>
16   - <view class="item-title"><text>试样种类</text></view>
17   - </template>
18   - </uni-list-item>
19   - <uni-list-item class="select-item" :class="form.customerTypeName ? 'is-filled' : 'is-empty'"
20   - clickable @click="openSheet('customerType')" :rightText="form.customerTypeName || '请选择'"
21   - showArrow>
22   - <template v-slot:body>
23   - <view class="item-title"><text>客户类型</text></view>
24   - </template>
25   - </uni-list-item>
26   - <uni-list-item title="生产厂">
27   - <template v-slot:footer>
28   - <view class="readonly-text">{{ form.workshopName }}</view>
29   - </template>
30   - </uni-list-item>
31   - <uni-list-item title="所属品种">
32   - <template v-slot:footer>
33   - <view class="readonly-text">{{ form.belongingBreed }}</view>
34   - </template>
35   - </uni-list-item>
36   - <uni-list-item title="原供货同行">
37   - <template v-slot:footer>
38   - <uni-easyinput v-model="form.originalSupplierPeer" placeholder="请输入原供货同行"
39   - :inputBorder="false" />
40   - </template>
41   - </uni-list-item>
42   - </view>
43   -
44   - <!-- 产品 -->
45   - <view class="section2">
46   - <!-- mode="add" 允许编辑 -->
47   - <Product mode="add" :list="initPurchaseOrderLineList" @change="purchaseOrderLineListChange"
48   - :provideSamplesOptions="provideSamplesOptions"
49   - :clearParametersOptions="clearParametersOptions" />
50   - </view>
51   -
52   - <view class="section3">
53   - <view class="view-total">
54   - <view class="head">合计</view>
55   - <view class="row">
56   - <view class="row2">
57   - <text class="label">数量</text><text class="value">{{ form.totalQuantity }}</text>
58   - </view>
59   - </view>
60   - </view>
61   - </view>
62   -
63   - <view class="section2">
64   -
65   - <uni-list-item class="select-item"
66   - :class="form.sampleQuantityRegulationName ? 'is-filled' : 'is-empty'" clickable
67   - @click="openSheet('sampleQuantityRegulation')"
68   - :rightText="form.sampleQuantityRegulationName || '请选择'" showArrow>
69   - <template v-slot:body>
70   - <view class="item-title"><text>本次试样数量是否超规定</text></view>
71   - </template>
72   - </uni-list-item>
73   -
74   - <uni-list-item class="select-item"
75   - :class="form.specificationQuantityRegulationName ? 'is-filled' : 'is-empty'" clickable
76   - @click="openSheet('specificationQuantityRegulation')"
77   - :rightText="form.specificationQuantityRegulationName || '请选择'" showArrow>
78   - <template v-slot:body>
79   - <view class="item-title"><text>试样规格个数是否超规定</text></view>
80   - </template>
81   - </uni-list-item>
82   -
83   - <uni-list-item title="试样次数">
84   - <template v-slot:footer>
85   - <uni-easyinput type="textarea" v-model="form.sampleFrequency" placeholder="请输入试样次数"
86   - :inputBorder="false" />
87   - </template>
88   - </uni-list-item>
89   -
90   - <uni-list-item title="前期不合格描述">
91   - <template v-slot:footer>
92   - <uni-easyinput type="textarea" v-model="form.earlyNonconformityDescription"
93   - placeholder="请输入前期不合格描述" :inputBorder="false" />
94   - </template>
95   - </uni-list-item>
96   -
97   - </view>
98   - </view>
99   - <view v-else class="detail-section">
100   - <view class="section">
101   - <text class="row company">{{ form.orderingUnitName }}</text>
102   - <view :class="['status', `status_${form.status}`]" />
103   - <view class="row"><text class="label">试样种类</text><text class="value">{{ form.sampleTypeName
104   - }}</text></view>
105   - <view class="row"><text class="label">客户类型</text><text class="value">{{ form.customerTypeName
106   - }}</text></view>
107   - <view class="row"><text class="label">分厂</text><text class="value">{{ form.workshopName
108   - }}</text></view>
109   - <view class="row"><text class="label">所属品种</text><text class="value">{{ form.belongingBreed
110   - }}</text></view>
111   - <view class="row"><text class="label">原供货同行</text><text class="value">{{
112   - form.originalSupplierPeer }}</text>
113   - </view>
114   - </view>
115   -
116   - <!-- 产品 -->
117   - <view class="section2">
118   - <Product mode="view" :list="form.productSampleConfirmationSlipDetailList" />
119   - </view>
120   -
121   - <view class="section3">
122   - <view class="view-total">
123   - <view class="head">合计</view>
124   - <view class="row">
125   - <view class="row2">
126   - <text class="label">数量</text><text class="value">{{ form.totalQuantity }}</text>
127   - </view>
128   - </view>
129   - </view>
130   - </view>
131   -
132   - <view class="section">
133   - <view class="row"><text class="label">数量</text><text class="value">{{ form.totalQuantity
134   - }}</text></view>
135   - <view class="row"><text class="label">本次试样数量是否超规定</text><text class="value">{{
136   - form.sampleQuantityRegulation ?
137   - '是' : '否' }}</text></view>
138   - <view class="row"><text class="label">试样规格个数是否超规定</text><text class="value">{{
139   - form.specificationQuantityRegulation ? '是' : '否' }}</text></view>
140   - <view class="row"><text class="label">试样次数</text><text class="value">{{ form.sampleFrequency
141   - }}</text></view>
142   - <uni-list-item v-if="isEditEarlyNonconformityDescription" title="前期不合格描述">
143   - <template v-slot:footer>
144   - <uni-easyinput type="textarea" v-model="form.earlyNonconformityDescription"
145   - placeholder="请输入前期不合格描述" :inputBorder="false" />
146   - </template>
147   - </uni-list-item>
148   - <view v-else class="row"><text class="label">前期不合格描述</text><text class="value">{{
149   - form.earlyNonconformityDescription
150   - }}</text></view>
151   - </view>
152   - </view>
153   -
154   -
155   - </view>
156   - </scroll-view>
157   - <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options"
158   - v-model="sheet.value" @confirm="onSheetConfirm" />
159   - </view>
160   -</template>
161   -
162   -<script>
163   -import { getDetailApi } from '@/api/confirmation_form.js'
164   -import Product from './product.vue'
165   -import {
166   - getDicByCodes
167   -} from '@/utils/dic'
168   -import SingleSelectSheet from '@/components/single-select/index.vue'
169   -// 办事处内勤:可编辑 (编辑时的所有字段)
170   -// 办事处主管:只能编辑 :前期不合格描述
171   -// 其他人 :只能查看
172   -export default {
173   - name: 'ConfirmationFormApprove',
174   - components: { Product, SingleSelectSheet },
175   - props: { id: { type: [String, Number], default: '' } },
176   - data() {
177   - return {
178   - form: {},
179   - initPurchaseOrderLineList: [],
180   - roleCodes: [],
181   - canEditSupplementary: false,
182   - isEditAll: false,
183   - isEditEarlyNonconformityDescription: false,
184   - sheet: { visible: false, title: '请选择', options: [], value: '', field: '' },
185   - dicOptions: {
186   - ENTERPRISE_TYPE: [], // 客户类型
187   - SAMPLE_TYPE: [], // 试样种类
188   - CLEAR_PARAMETERS: [], // 是否提供明确参数
189   - PROVIDE_SAMPLES: [], // 是否提供样品
190   - },
191   - enterpriseTypeLocal: [], // 客户类型
192   - sampleTypeLocal: [], // 试样种类
193   - provideSamplesOptions: [], // 是否提供样品
194   - clearParametersOptions: [], // 是否提供明确参数
195   - }
196   - },
197   - computed: {
198   - },
199   - watch: {
200   - id: {
201   - immediate: true,
202   - handler(val) {
203   - const v = (val !== undefined && val !== null) ? String(val) : ''
204   - if (v) {
205   - this.loadDetail(v);
206   - this.loadAllDicData()
207   - this.getRoleInfo();
208   - }
209   - }
210   - }
211   - },
212   - onLoad(query) {
213   -
214   - },
215   - methods: {
216   - getRoleInfo() {
217   - this.roleCodes = this.$store.getters.roleCodes || [];
218   - console.log('roleCodes', this.roleCodes)
219   - // 办事处内勤:可编辑 (编辑时的所有字段) bscnq
220   - this.isEditAll = this.roleCodes.includes('bscnq');
221   - // 办事处主管:只能编辑 :前期不合格描述 bsczg
222   - this.isEditEarlyNonconformityDescription = this.roleCodes.includes('bsczg');
223   - },
224   - async loadDetail(id) {
225   - try {
226   - const res = await getDetailApi(id)
227   - const m = res.data || {}
228   - const next = { ...this.form, ...m }
229   - // 确保ID存在
230   - next.id = m.id || id
231   - next.sampleQuantityRegulationName = m.sampleQuantityRegulation === true ? '是' : '否'
232   - next.specificationQuantityRegulationName = m.specificationQuantityRegulation === true ? '是' : '否'
233   - // 映射列表
234   - // 注意:详情返回的是 productSampleConfirmationSlipDetailList,需要赋值给 initPurchaseOrderLineList 以便 Product 组件初始化
235   - // 且需要处理字段兼容性,确保 Product 组件能正确显示和编辑
236   - const lines = Array.isArray(m.productSampleConfirmationSlipDetailList) ? m.productSampleConfirmationSlipDetailList.map(x => ({
237   - ...x,
238   - // 确保 Product 组件需要的字段存在
239   - // Product组件使用: quantity(需发), shippedQuantity(实发), supplementaryQuantity(需求补货), salesPrice(单价)
240   - // 详情接口返回的字段应该已经包含了这些,如果有差异需要在此处转换
241   - // 注意:add.vue中 onRelateConfirm 做了映射,这里是回显,通常直接使用即可
242   - })) : []
243   -
244   - this.form = next;
245   - this.initPurchaseOrderLineList = lines;
246   - } catch (e) {
247   - this.form = {}
248   - }
249   - },
250   - loadAllDicData() {
251   - const dicCodes = ['ENTERPRISE_TYPE', 'SAMPLE_TYPE', 'CLEAR_PARAMETERS', 'PROVIDE_SAMPLES']
252   - return getDicByCodes(dicCodes).then(results => {
253   - this.dicOptions.ENTERPRISE_TYPE = results.ENTERPRISE_TYPE.data || []
254   - this.dicOptions.SAMPLE_TYPE = results.SAMPLE_TYPE.data || []
255   - this.dicOptions.CLEAR_PARAMETERS = results.CLEAR_PARAMETERS.data || []
256   - this.dicOptions.PROVIDE_SAMPLES = results.PROVIDE_SAMPLES.data || []
257   -
258   - this.enterpriseTypeLocal = (this.dicOptions.ENTERPRISE_TYPE || []).map(it => ({
259   - value: it.code,
260   - label: it.name
261   - }))
262   - this.sampleTypeLocal = (this.dicOptions.SAMPLE_TYPE || []).map(it => ({
263   - value: it.code,
264   - label: it.name
265   - }))
266   - this.provideSamplesOptions = (this.dicOptions.PROVIDE_SAMPLES || []).map(it => ({
267   - value: it.code,
268   - label: it.name
269   - }))
270   - this.clearParametersOptions = (this.dicOptions.CLEAR_PARAMETERS || []).map(it => ({
271   - value: it.code,
272   - label: it.name
273   - }))
274   - }).catch(() => {
275   - this.dicOptions = {
276   - ENTERPRISE_TYPE: [], // 客户类型
277   - SAMPLE_TYPE: [], // 试样种类
278   - CLEAR_PARAMETERS: [], // 是否提供明确参数
279   - PROVIDE_SAMPLES: [], // 是否提供样品
280   - }
281   - this.enterpriseTypeLocal = []
282   - this.sampleTypeLocal = []
283   - this.provideSamplesOptions = []
284   - this.clearParametersOptions = []
285   - })
286   - },
287   - calculateSummary(list) {
288   - const summary = (list || []).reduce((acc, it) => {
289   - const qty = Number(it.supplementaryQuantity) || 0
290   - const shipped = Number(it.shippedQuantity) || 0
291   - const orderQty = Number(it.quantity) || 0
292   - acc.totalSupplementaryQuantity += qty
293   - acc.totalShippedQuantity += shipped
294   - acc.totalQuantity += orderQty
295   - return acc
296   - }, { totalQuantity: 0, totalShippedQuantity: 0, totalSupplementaryQuantity: 0 })
297   -
298   - const fixedTotalQuantity = Number(summary.totalQuantity.toFixed(2))
299   - const fixedTotalShippedQuantity = Number(summary.totalShippedQuantity.toFixed(2))
300   - const fixedTotalSupplementaryQuantity = Number(summary.totalSupplementaryQuantity.toFixed(2))
301   - this.form.totalQuantity = fixedTotalQuantity
302   - this.form.totalShippedQuantity = fixedTotalShippedQuantity
303   - this.form.totalSupplementaryQuantity = fixedTotalSupplementaryQuantity
304   - },
305   - purchaseOrderLineListChange(data) {
306   - const list = Array.isArray(data) ? data : []
307   - this.form.productSampleConfirmationSlipDetailList = list
308   - },
309   - getFormValues() {
310   - delete this.form.status;
311   - const m = this.form || {}
312   - return JSON.parse(JSON.stringify(m))
313   - },
314   - // 审批-通过:校验表单
315   - checkForm() {
316   - return true
317   - },
318   - openSheet(field) {
319   - let options = []
320   - let title = ''
321   - let value = ''
322   -
323   - if (field === 'sampleType') {
324   - title = '试样种类'
325   - options = this.sampleTypeLocal
326   - value = this.form.sampleType
327   - } else if (field === 'customerType') {
328   - title = '客户类型'
329   - options = this.enterpriseTypeLocal
330   - value = this.form.customerType
331   - } else if (field === 'sampleQuantityRegulation') {
332   - title = '本次试样数量是否超规定'
333   - options = [{ value: true, label: '是' }, { value: false, label: '否' }]
334   - value = this.form.sampleQuantityRegulation
335   - } else if (field === 'specificationQuantityRegulation') {
336   - title = '试样规格个数是否超规定'
337   - options = [{ value: true, label: '是' }, { value: false, label: '否' }]
338   - value = this.form.specificationQuantityRegulation
339   - }
340   -
341   - const match = options.find(o => String(o.value) === String(value))
342   - this.sheet = { ...this.sheet, visible: true, title, options, field, value: match ? match.value : '' }
343   - },
344   - onSheetConfirm({ value, label }) {
345   - const field = this.sheet.field
346   - this.form[field] = value
347   - this.form[field + 'Name'] = label
348   - this.sheet.visible = false
349   - },
350   - }
351   -}
352   -</script>
353   -
354   -<style lang="scss" scoped>
355   -.page {
356   - display: flex;
357   - flex-direction: column;
358   - height: 100vh;
359   -}
360   -
361   -.scroll {
362   - flex: 1;
363   - background: #f3f3f3;
364   -}
365   -
366   -.detail-page {
367   - padding-bottom: 150rpx;
368   -}
369   -
370   -.section {
371   - padding: 32rpx;
372   - background: #fff;
373   - margin-bottom: 20rpx;
374   - position: relative;
375   -
376   -}
377   -
378   -.row {
379   - display: flex;
380   - margin-bottom: 28rpx;
381   -
382   - &:last-child {
383   - margin-bottom: 0;
384   - }
385   -
386   - &.company {
387   - font-size: 36rpx;
388   - font-weight: 600;
389   - color: rgba(0, 0, 0, 0.9);
390   - padding-top: 10rpx;
391   - margin-bottom: 32rpx;
392   - line-height: 50rpx;
393   - }
394   -
395   - .label {
396   - width: 240rpx;
397   - line-height: 32rpx;
398   - font-size: 28rpx;
399   - color: rgba(0, 0, 0, 0.6);
400   - }
401   -
402   - .value {
403   - flex: 1;
404   - line-height: 32rpx;
405   - font-size: 28rpx;
406   - color: rgba(0, 0, 0, 0.9);
407   - text-align: right;
408   - word-break: break-all;
409   - }
410   -}
411   -
412   -.title-header {
413   - background-color: #fff;
414   - display: flex;
415   - align-items: center;
416   - padding: 32rpx 32rpx 22rpx;
417   - border-bottom: 1rpx dashed #f0f0f0;
418   -
419   - &_icon {
420   - width: 32rpx;
421   - height: 28rpx;
422   - margin-right: 16rpx;
423   - }
424   -
425   - span {
426   - color: rgba(0, 0, 0, 0.9);
427   - font-size: 32rpx;
428   - line-height: 44rpx;
429   - font-weight: 600;
430   - }
431   -}
432   -
433   -.section3 {
434   - padding: 0 32rpx;
435   - background-color: #fff;
436   - margin-bottom: 20rpx;
437   -}
438   -
439   -.view-total {
440   - padding: 20rpx 0;
441   -
442   - .head {
443   - font-size: 32rpx;
444   - font-weight: 600;
445   - line-height: 50rpx;
446   - color: rgba(0, 0, 0, 0.9);
447   - padding-bottom: 16rpx;
448   - margin-bottom: 24rpx;
449   - border-bottom: 1px dashed #E7E7E7;
450   - }
451   -
452   - .row {
453   - display: flex;
454   - margin-bottom: 24rpx;
455   - line-height: 32rpx;
456   -
457   - .row2 {
458   - width: 50%;
459   - }
460   -
461   - .label {
462   - width: 180rpx;
463   - margin-right: 14rpx;
464   - color: rgba(0, 0, 0, 0.6);
465   - font-size: 28rpx;
466   - }
467   -
468   - .value {
469   - flex: 1;
470   - color: rgba(0, 0, 0, 0.9);
471   - font-size: 28rpx;
472   - white-space: pre-wrap;
473   - word-break: break-all;
474   - }
475   - }
476   -}
477   -
478   -::v-deep .no-border-top {
479   - .uni-list--border::after {
480   - background-color: transparent;
481   - }
482   -}
483   -
484   -.detail-section {
485   -
486   - .section {
487   - padding: 32rpx;
488   - background: #fff;
489   - margin-bottom: 20rpx;
490   - position: relative;
491   -
492   -
493   - }
494   -
495   - .row {
496   - display: flex;
497   - margin-bottom: 28rpx;
498   -
499   - &:last-child {
500   - margin-bottom: 0;
501   - }
502   -
503   - &.company {
504   - font-size: 36rpx;
505   - font-weight: 600;
506   - color: rgba(0, 0, 0, 0.9);
507   - padding-top: 10rpx;
508   - margin-bottom: 32rpx;
509   - line-height: 50rpx;
510   - }
511   -
512   - .label {
513   - max-width: 400rpx;
514   - margin-right: 20rpx;
515   - line-height: 32rpx;
516   - font-size: 28rpx;
517   - color: rgba(0, 0, 0, 0.6);
518   - }
519   -
520   - .value {
521   - flex: 1;
522   - line-height: 32rpx;
523   - font-size: 28rpx;
524   - color: rgba(0, 0, 0, 0.9);
525   - text-align: right;
526   - word-break: break-all;
527   - }
528   - }
529   -
530   - .title-header {
531   - background-color: #fff;
532   - display: flex;
533   - align-items: center;
534   - padding: 32rpx 32rpx 22rpx;
535   - border-bottom: 1rpx dashed #f0f0f0;
536   -
537   - &_icon {
538   - width: 32rpx;
539   - height: 28rpx;
540   - margin-right: 16rpx;
541   - }
542   -
543   - span {
544   - color: rgba(0, 0, 0, 0.9);
545   - font-size: 32rpx;
546   - line-height: 44rpx;
547   - font-weight: 600;
548   - }
549   - }
550   -
551   - .section2 {
552   - background: #f1f1f1;
553   - }
554   -
555   -
556   - .section3 {
557   - padding: 0 32rpx;
558   - background-color: #fff;
559   - margin: 20rpx 0;
560   - }
561   -
562   - .view-total {
563   - padding-bottom: 20rpx;
564   -
565   - .head {
566   - font-size: 32rpx;
567   - font-weight: 600;
568   - line-height: 50rpx;
569   - color: rgba(0, 0, 0, 0.9);
570   - padding-bottom: 16rpx;
571   - margin-bottom: 24rpx;
572   - border-bottom: 1px dashed #E7E7E7;
573   - }
574   -
575   - .row {
576   - display: flex;
577   - margin-bottom: 24rpx;
578   - line-height: 32rpx;
579   -
580   - .row2 {
581   - width: 50%;
582   - }
583   -
584   - .label {
585   - width: 180rpx;
586   - margin-right: 14rpx;
587   - color: rgba(0, 0, 0, 0.6);
588   - font-size: 28rpx;
589   - }
590   -
591   - .value {
592   - flex: 1;
593   - color: rgba(0, 0, 0, 0.9);
594   - font-size: 28rpx;
595   - white-space: pre-wrap;
596   - word-break: break-all;
597   - }
598   - }
599   - }
600   -}
601   -</style>
... ... @@ -3,29 +3,38 @@
3 3 <scroll-view class="scroll" scroll-y>
4 4 <view class="detail-page">
5 5 <view class="section">
6   - <text class="row company">{{ form.orderingUnitName }}</text>
7   - <view :class="['status', `status_${form.status}`]" />
8   - <view class="row"><text class="label">试样种类</text><text class="value">{{ form.sampleTypeName }}</text></view>
9   - <view class="row"><text class="label">客户类型</text><text class="value">{{ form.customerTypeName }}</text></view>
10   - <view class="row"><text class="label">分厂</text><text class="value">{{ form.workshopName }}</text></view>
11   - <view class="row"><text class="label">所属品种</text><text class="value">{{ form.belongingBreed }}</text></view>
12   - <view class="row"><text class="label">原供货同行</text><text class="value">{{ form.originalSupplierPeer }}</text>
13   - </view>
  6 + <text class="row company">{{ form.customerName }}</text>
  7 + <view class="row"><text class="label">订单编号</text><text class="value">{{ form.orderCode }}</text></view>
  8 + <view class="row"><text class="label">生产厂</text><text class="value">{{ form.workshopName }}</text></view>
14 9 </view>
15 10
16 11 <!-- 产品 -->
17 12 <view class="section2">
18   - <Product mode="view" :list="form.productSampleConfirmationSlipDetailList" />
  13 + <Product mode="view" :list="form.detailList" />
19 14 </view>
20 15
  16 + <view class="title-header">
  17 + <image class="title-header_icon" src="/static/images/title.png" />
  18 + <span>本次试样概况</span>
  19 + </view>
  20 +
  21 + <view class="section">
  22 + <view class="row"><text class="label">表面</text><text class="value">{{ form.surface }}</text></view>
  23 + <view class="row"><text class="label">性能</text><text class="value">{{ form.performance }}</text></view>
  24 + <view class="row"><text class="label">公差</text><text class="value">{{ form.tolerance }}</text></view>
  25 + <view class="row"><text class="label">带型</text><text class="value">{{ form.bandingPattern }}</text></view>
  26 + <view class="row"><text class="label">包装</text><text class="value">{{ form.packaging }}</text></view>
  27 + <view class="row"><text class="label">件重条头</text><text class="value">{{ form.weight }}</text></view>
  28 + <view class="row"><text class="label">其他</text><text class="value">{{ form.other }}</text></view>
  29 + <view class="row"><text class="label">结论</text><text class="value">{{ getDicName('SAMPLE_RESULT',
  30 + form.sampleResult, dicOptions.SAMPLE_RESULT) }}</text></view>
  31 + <view class="row"><text class="label"></text><text class="value">{{ getDicName('SAMPLE_RESULT_SUB',
  32 + form.sampleResultSub, dicOptions.SAMPLE_RESULT_SUB) }}</text></view>
  33 + </view>
21 34 <view class="section">
22   - <view class="row"><text class="label">数量</text><text class="value">{{ form.totalQuantity }}</text></view>
23   - <view class="row"><text class="label">本次试样数量是否超规定</text><text class="value">{{ form.sampleQuantityRegulation ?
24   - '是' : '否' }}</text></view>
25   - <view class="row"><text class="label">试样规格个数是否超规定</text><text class="value">{{
26   - form.specificationQuantityRegulation ? '是' : '否' }}</text></view>
27   - <view class="row"><text class="label">试样次数</text><text class="value">{{ form.sampleFrequency }}</text></view>
28   - <view class="row"><text class="label">前期不合格描述</text><text class="value">{{ form.earlyNonconformityDescription
  35 + <view class="row"><text class="label">客户评价依据</text><text class="value act"
  36 + @click="downloadFile(form.customerReviewsFileId, form.customerReviewsFileName)">{{
  37 + form.customerReviewsFileName
29 38 }}</text></view>
30 39 </view>
31 40 </view>
... ... @@ -34,16 +43,29 @@
34 43 </template>
35 44
36 45 <script>
37   -import { getDetailApi } from '@/api/confirmation_form.js'
  46 +import { getDetailApi } from '@/api/follow_up_form.js'
38 47 import Product from './product.vue'
  48 +import { downloadFile } from '@/utils/downloadFile.js'
  49 +import {
  50 + getDicByCodes
  51 +} from '@/utils/dic'
  52 +import {
  53 + getDicName
  54 +} from '@/utils/dic.js'
39 55
40 56 export default {
41   - name: 'ConfirmationFormViewer',
  57 + name: 'FollowUpFormViewer',
42 58 components: { Product },
43 59 props: { id: { type: [String, Number], default: '' } },
44 60 data() {
45 61 return {
46 62 form: {},
  63 + dicOptions: {
  64 + SAMPLE_RESULT: [],
  65 + SAMPLE_RESULT_SUB: []
  66 + },
  67 + sampleResultLocal: [],
  68 + sampleResultSubLocal: []
47 69 }
48 70 },
49 71 computed: {
... ... @@ -52,6 +74,7 @@ export default {
52 74 id: {
53 75 immediate: true,
54 76 handler(val) {
  77 + this.loadAllDicData()
55 78 const v = (val !== undefined && val !== null) ? String(val) : ''
56 79 if (v) this.loadDetail(v)
57 80 }
... ... @@ -68,6 +91,35 @@ export default {
68 91 this.form = {}
69 92 }
70 93 },
  94 + downloadFile,
  95 + getDicName,
  96 + loadAllDicData() {
  97 + const dicCodes = ['SAMPLE_RESULT', 'SAMPLE_RESULT_SUB']
  98 + return getDicByCodes(dicCodes).then(results => {
  99 + this.dicOptions.SAMPLE_RESULT = results.SAMPLE_RESULT.data || []
  100 + this.dicOptions.SAMPLE_RESULT_SUB = results.SAMPLE_RESULT_SUB.data || []
  101 + this.sampleResultLocal = (this.dicOptions.SAMPLE_RESULT || []).map(it => ({
  102 + value: it.code,
  103 + text: it.name
  104 + }))
  105 + this.sampleResultSubLocal = (this.dicOptions.SAMPLE_RESULT_SUB || []).map(it => ({
  106 + value: it.code,
  107 + text: it.name
  108 + }))
  109 + }).catch(() => {
  110 + this.dicOptions = {
  111 + SAMPLE_RESULT: [],
  112 + SAMPLE_RESULT_SUB: []
  113 + }
  114 + this.sampleResultLocal = []
  115 + this.sampleResultSubLocal = []
  116 + })
  117 + },
  118 + getFormValues() {
  119 + delete this.form.status;
  120 + const m = this.form || {}
  121 + return JSON.parse(JSON.stringify(m))
  122 + },
71 123 }
72 124 }
73 125 </script>
... ... @@ -85,7 +137,7 @@ export default {
85 137 }
86 138
87 139 .detail-page {
88   - padding-bottom: 20rpx;
  140 + padding-bottom: 144rpx;
89 141 }
90 142
91 143 .section {
... ... @@ -128,6 +180,10 @@ export default {
128 180 color: rgba(0, 0, 0, 0.9);
129 181 text-align: right;
130 182 word-break: break-all;
  183 +
  184 + &.act {
  185 + color: $theme-primary;
  186 + }
131 187 }
132 188 }
133 189
... ...
... ... @@ -14,6 +14,7 @@ import DraftOrderViewer from '@/pages/draft_order/viewer.vue'
14 14 import DelayedShipmentViewer from '@/pages/delay_invoice/viewer.vue'
15 15 import ConfirmationFormViewer from '@/pages/confirmation_form/viewer.vue'
16 16 import ConfirmationFormApprove from '@/pages/confirmation_form/approve.vue'
  17 +import FollowUpFormViewer from '@/pages/follow_up_form/viewer.vue'
17 18
18 19 export default function registerComponents(Vue) {
19 20 Vue.component('CustomerDevelopViewer', CustomerDevelopViewer)
... ... @@ -32,4 +33,5 @@ export default function registerComponents(Vue) {
32 33 Vue.component('DelayedShipmentViewer', DelayedShipmentViewer)
33 34 Vue.component('ConfirmationFormViewer', ConfirmationFormViewer)
34 35 Vue.component('ConfirmationFormApprove', ConfirmationFormApprove)
  36 + Vue.component('FollowUpFormViewer', FollowUpFormViewer)
35 37 }
\ No newline at end of file
... ...
... ... @@ -85,6 +85,12 @@ export const getSysFlowComponentPath = (bizFlag) => {
85 85 case 'CONFIRMATION_SLIP_EDIT': // 产品试样确认单
86 86 componentPath = 'ConfirmationFormApprove'; // 产品试样确认单-审批
87 87 break;
  88 + case 'RESULT_TRACKING': // 产品试样跟踪单
  89 + componentPath = 'FollowUpFormViewer'; // 产品试样跟踪单-审批详情
  90 + break;
  91 + case 'RESULT_TRACKING_EDIT': // 产品试样跟踪单
  92 + componentPath = 'FollowUpFormViewer'; // 产品试样跟踪单-审批
  93 + break;
88 94 }
89 95 return componentPath;
90 96 };
\ No newline at end of file
... ...