Showing
1 changed file
with
48 additions
and
7 deletions
| ... | ... | @@ -27,11 +27,15 @@ |
| 27 | 27 | <view class="row"><text class="label">包装</text><text class="value">{{ form.packaging }}</text></view> |
| 28 | 28 | <view class="row"><text class="label">件重条头</text><text class="value">{{ form.weight }}</text></view> |
| 29 | 29 | <view class="row"><text class="label">其他</text><text class="value">{{ form.other }}</text></view> |
| 30 | - <view class="row"><text class="label">结论</text><text class="value">{{ form.other }}</text></view> | |
| 31 | - <view class="row"><text class="label"></text><text class="value">{{ form.sampleResultSub }}</text></view> | |
| 30 | + <view class="row"><text class="label">结论</text><text class="value">{{ getDicName('SAMPLE_RESULT', | |
| 31 | + form.sampleResult, dicOptions.SAMPLE_RESULT) }}</text></view> | |
| 32 | + <view class="row"><text class="label"></text><text class="value">{{ getDicName('SAMPLE_RESULT_SUB', | |
| 33 | + form.sampleResultSub, dicOptions.SAMPLE_RESULT_SUB) }}</text></view> | |
| 32 | 34 | </view> |
| 33 | 35 | <view class="section"> |
| 34 | - <view class="row"><text class="label">客户评价依据</text><text class="value act" @click="downloadFile(form.customerReviewsFileId, form.customerReviewsFileName)">{{ form.customerReviewsFileName | |
| 36 | + <view class="row"><text class="label">客户评价依据</text><text class="value act" | |
| 37 | + @click="downloadFile(form.customerReviewsFileId, form.customerReviewsFileName)">{{ | |
| 38 | + form.customerReviewsFileName | |
| 35 | 39 | }}</text></view> |
| 36 | 40 | </view> |
| 37 | 41 | </view> |
| ... | ... | @@ -45,6 +49,12 @@ import { getDetailApi } from '@/api/follow_up_form.js' |
| 45 | 49 | import Product from './product.vue' |
| 46 | 50 | import DetailButtons from '@/components/detail-buttons/index.vue' |
| 47 | 51 | import { downloadFile } from '@/utils/downloadFile.js' |
| 52 | +import { | |
| 53 | + getDicByCodes | |
| 54 | +} from '@/utils/dic' | |
| 55 | +import { | |
| 56 | + getDicName | |
| 57 | +} from '@/utils/dic.js' | |
| 48 | 58 | |
| 49 | 59 | export default { |
| 50 | 60 | name: 'FollowUpFormDetail', |
| ... | ... | @@ -56,7 +66,13 @@ export default { |
| 56 | 66 | { text: '编辑', visible: true, variant: 'outline', event: 'edit' }, |
| 57 | 67 | { text: '审核详情', visible: true, variant: 'outline', event: 'auditDetail' }, |
| 58 | 68 | { text: '审核', visible: true, variant: 'primary', event: 'audit' }, |
| 59 | - ] | |
| 69 | + ], | |
| 70 | + dicOptions: { | |
| 71 | + SAMPLE_RESULT: [], | |
| 72 | + SAMPLE_RESULT_SUB: [] | |
| 73 | + }, | |
| 74 | + sampleResultLocal: [], | |
| 75 | + sampleResultSubLocal: [] | |
| 60 | 76 | } |
| 61 | 77 | }, |
| 62 | 78 | computed: { |
| ... | ... | @@ -76,7 +92,7 @@ export default { |
| 76 | 92 | const f = this.statusFlags; |
| 77 | 93 | console.log('displayButtons_f', f) |
| 78 | 94 | return [ |
| 79 | - { ...this.buttons[0], visible: f.canEdit && this.$auth.hasPermi('sample-order:follow-up-form:modify') }, | |
| 95 | + { ...this.buttons[0], visible: f.canEdit && this.$auth.hasPermi('sample-order:follow-up-form:modify') }, | |
| 80 | 96 | { ...this.buttons[1], visible: f.canAuditDetail && this.$auth.hasPermi('sample-order:follow-up-form:review') }, |
| 81 | 97 | { ...this.buttons[2], visible: f.canAudit && this.$auth.hasPermi('sample-order:follow-up-form:approve') }, |
| 82 | 98 | ] |
| ... | ... | @@ -84,7 +100,10 @@ export default { |
| 84 | 100 | }, |
| 85 | 101 | onLoad(query) { |
| 86 | 102 | const id = (query && (query.id || query.code)) || '' |
| 87 | - if (id) this.loadDetail(id) | |
| 103 | + if (id) { | |
| 104 | + this.loadDetail(id) | |
| 105 | + this.loadAllDicData() | |
| 106 | + } | |
| 88 | 107 | }, |
| 89 | 108 | methods: { |
| 90 | 109 | async loadDetail(id) { |
| ... | ... | @@ -118,7 +137,29 @@ export default { |
| 118 | 137 | uni.navigateTo({ url: '/pages/flow/audit' }) |
| 119 | 138 | }, |
| 120 | 139 | downloadFile, |
| 121 | - | |
| 140 | + getDicName, | |
| 141 | + loadAllDicData() { | |
| 142 | + const dicCodes = ['SAMPLE_RESULT', 'SAMPLE_RESULT_SUB'] | |
| 143 | + return getDicByCodes(dicCodes).then(results => { | |
| 144 | + this.dicOptions.SAMPLE_RESULT = results.SAMPLE_RESULT.data || [] | |
| 145 | + this.dicOptions.SAMPLE_RESULT_SUB = results.SAMPLE_RESULT_SUB.data || [] | |
| 146 | + this.sampleResultLocal = (this.dicOptions.SAMPLE_RESULT || []).map(it => ({ | |
| 147 | + value: it.code, | |
| 148 | + text: it.name | |
| 149 | + })) | |
| 150 | + this.sampleResultSubLocal = (this.dicOptions.SAMPLE_RESULT_SUB || []).map(it => ({ | |
| 151 | + value: it.code, | |
| 152 | + text: it.name | |
| 153 | + })) | |
| 154 | + }).catch(() => { | |
| 155 | + this.dicOptions = { | |
| 156 | + SAMPLE_RESULT: [], | |
| 157 | + SAMPLE_RESULT_SUB: [] | |
| 158 | + } | |
| 159 | + this.sampleResultLocal = [] | |
| 160 | + this.sampleResultSubLocal = [] | |
| 161 | + }) | |
| 162 | + }, | |
| 122 | 163 | } |
| 123 | 164 | } |
| 124 | 165 | </script> | ... | ... |