|
...
|
...
|
@@ -44,6 +44,9 @@ |
|
44
|
44
|
<view v-if="form.executionStandard === 'OTHER'" class="row"><text class="label">标准</text><text
|
|
45
|
45
|
class="value">{{ form.executionStandardRemarks }}</text></view>
|
|
46
|
46
|
</view>
|
|
|
47
|
+ <view class="section">
|
|
|
48
|
+ <view class="row"><text class="label">质保书</text><text class="value act" @click="downloadFile(form.warrantyCertificateFileId, form.warrantyCertificateFileName)">{{ form.warrantyCertificateFileName }}</text></view>
|
|
|
49
|
+ </view>
|
|
47
|
50
|
|
|
48
|
51
|
<view class="title-header">
|
|
49
|
52
|
<image class="title-header_icon" src="/static/images/title.png" />
|
|
...
|
...
|
@@ -66,13 +69,32 @@ |
|
66
|
69
|
</view>
|
|
67
|
70
|
</scroll-view>
|
|
68
|
71
|
<detail-buttons :buttons="displayButtons" @click="handleButtonClick" />
|
|
|
72
|
+ <uni-popup ref="uploadPopup" type="bottom" :mask-click="false">
|
|
|
73
|
+ <view class="dialog">
|
|
|
74
|
+ <view class="dialog_header">
|
|
|
75
|
+ <text>上传质保书</text>
|
|
|
76
|
+ <view class="dialog_close" @click="closeUploadInfo"></view>
|
|
|
77
|
+ </view>
|
|
|
78
|
+ <view class="dialog_body">
|
|
|
79
|
+ <view class="dialog_row">
|
|
|
80
|
+ <text class="dialog_label">质保书</text>
|
|
|
81
|
+ <FileUpload v-model="uploadFile" />
|
|
|
82
|
+ </view>
|
|
|
83
|
+ </view>
|
|
|
84
|
+ <view class="dialog_footer">
|
|
|
85
|
+ <button class="btn confirm" type="primary" @click="onUploadSave">保存</button>
|
|
|
86
|
+ </view>
|
|
|
87
|
+ </view>
|
|
|
88
|
+ </uni-popup>
|
|
69
|
89
|
</view>
|
|
70
|
90
|
</template>
|
|
71
|
91
|
|
|
72
|
92
|
<script>
|
|
73
|
|
-import { getDetailApi, cancelApi, checkApi } from '@/api/order_list.js'
|
|
|
93
|
+import { getDetailApi, cancelApi, checkApi, uploadWarrantyCertificate } from '@/api/order_list.js'
|
|
74
|
94
|
import Product from './product.vue'
|
|
75
|
95
|
import DetailButtons from '@/components/detail-buttons/index.vue'
|
|
|
96
|
+import FileUpload from '@/components/file-upload/index.vue'
|
|
|
97
|
+import { downloadFile } from '@/utils/downloadFile.js'
|
|
76
|
98
|
import {
|
|
77
|
99
|
getDicName
|
|
78
|
100
|
} from '@/utils/dic.js'
|
|
...
|
...
|
@@ -82,7 +104,7 @@ import { |
|
82
|
104
|
|
|
83
|
105
|
export default {
|
|
84
|
106
|
name: 'OrderListDetail',
|
|
85
|
|
- components: { Product, DetailButtons },
|
|
|
107
|
+ components: { Product, DetailButtons, FileUpload },
|
|
86
|
108
|
data() {
|
|
87
|
109
|
return {
|
|
88
|
110
|
form: {},
|
|
...
|
...
|
@@ -92,7 +114,9 @@ export default { |
|
92
|
114
|
{ text: '审核', visible: true, variant: 'primary', event: 'audit' },
|
|
93
|
115
|
{ text: '申请发货', visible: true, variant: 'outline', event: 'shipmentApply' },
|
|
94
|
116
|
{ text: '取消', visible: true, variant: 'outline', event: 'cancel', style: { color: 'rgba(0,0,0,0.9)', border: '1px solid #DCDCDC' } },
|
|
|
117
|
+ { text: '上传质保书', visible: true, variant: 'outline', event: 'upload' },
|
|
95
|
118
|
],
|
|
|
119
|
+ uploadFile: { id: '', name: '' },
|
|
96
|
120
|
dicOptions: {
|
|
97
|
121
|
AUDIT_STATUS: [],
|
|
98
|
122
|
SUPPLIER: [],
|
|
...
|
...
|
@@ -105,13 +129,16 @@ export default { |
|
105
|
129
|
const s = String((this.form && this.form.status) || '')
|
|
106
|
130
|
const e = String((this.form && this.form.examineStatus) || '')
|
|
107
|
131
|
const d = (this.form && this.form.showExamine) || false
|
|
|
132
|
+ const u = (this.form && this.form.showUpload) || false
|
|
|
133
|
+
|
|
108
|
134
|
return {
|
|
109
|
135
|
isRefuse: e === 'REFUSE',
|
|
110
|
136
|
isAudit: e === 'AUDIT',
|
|
111
|
137
|
isAuditDetail: !this.form.sampleOrder,
|
|
112
|
138
|
canExamine: d,
|
|
113
|
139
|
canDeliveryApply: s === 'ISSUED' && (!this.form.freeze || false) && Number(this.form.totalQuantity) > 0,
|
|
114
|
|
- contractCreateBy: this.form.contractCreateBy
|
|
|
140
|
+ contractCreateBy: this.form.contractCreateBy,
|
|
|
141
|
+ showUpload: u,
|
|
115
|
142
|
}
|
|
116
|
143
|
},
|
|
117
|
144
|
displayButtons() {
|
|
...
|
...
|
@@ -123,6 +150,7 @@ export default { |
|
123
|
150
|
{ ...this.buttons[2], visible: f.isAudit && f.canExamine && this.$auth.hasPermi('order-manage:order-list:approve') },
|
|
124
|
151
|
{ ...this.buttons[3], visible: f.canDeliveryApply && this.$auth.hasPermi('order-manage:order-list:apply') },
|
|
125
|
152
|
{ ...this.buttons[4], visible: f.isRefuse && f.contractCreateBy && this.$auth.hasPermi('order-manage:order-list:cancel') },
|
|
|
153
|
+ { ...this.buttons[5], visible: f.showUpload && this.$auth.hasPermi('order-manage:order-list:upload') },
|
|
126
|
154
|
]
|
|
127
|
155
|
}
|
|
128
|
156
|
},
|
|
...
|
...
|
@@ -151,6 +179,7 @@ export default { |
|
151
|
179
|
audit: () => this.onAudit(),
|
|
152
|
180
|
shipmentApply: () => this.onShipmentApply(),
|
|
153
|
181
|
cancel: () => this.onCancel(),
|
|
|
182
|
+ upload: () => this.onUpload(),
|
|
154
|
183
|
}
|
|
155
|
184
|
const fn = map[btn.event]
|
|
156
|
185
|
if (typeof fn === 'function') fn()
|
|
...
|
...
|
@@ -206,6 +235,37 @@ export default { |
|
206
|
235
|
}
|
|
207
|
236
|
})
|
|
208
|
237
|
},
|
|
|
238
|
+ onUpload() {
|
|
|
239
|
+ this.$refs.uploadPopup && this.$refs.uploadPopup.open()
|
|
|
240
|
+ },
|
|
|
241
|
+ downloadFile,
|
|
|
242
|
+ closeUploadInfo() {
|
|
|
243
|
+ this.uploadFile = { id: '', name: '' };
|
|
|
244
|
+ this.$refs.uploadPopup && this.$refs.uploadPopup.close()
|
|
|
245
|
+ },
|
|
|
246
|
+ async onUploadSave() {
|
|
|
247
|
+ console.log('onUploadSave__this.uploadFile', this.uploadFile)
|
|
|
248
|
+ if (!this.uploadFile.id) {
|
|
|
249
|
+ uni.showToast({
|
|
|
250
|
+ title: '请上传质保书',
|
|
|
251
|
+ icon: 'none'
|
|
|
252
|
+ })
|
|
|
253
|
+ return
|
|
|
254
|
+ }
|
|
|
255
|
+ const params = {
|
|
|
256
|
+ warrantyCertificateFileId: this.uploadFile.id,
|
|
|
257
|
+ warrantyCertificateFileName: this.uploadFile.name,
|
|
|
258
|
+ id: this.form.id
|
|
|
259
|
+ }
|
|
|
260
|
+ try {
|
|
|
261
|
+ await uploadWarrantyCertificate(params)
|
|
|
262
|
+ uni.showToast({ title: '保存成功', icon: 'success' })
|
|
|
263
|
+ setTimeout(() => { uni.redirectTo({ url: '/pages/order_list/index' }) }, 300)
|
|
|
264
|
+ } catch (e) {
|
|
|
265
|
+ uni.showToast({ title: (e && e.msg) || '保存失败', icon: 'none' })
|
|
|
266
|
+ }
|
|
|
267
|
+ },
|
|
|
268
|
+
|
|
209
|
269
|
loadAllDicData() {
|
|
210
|
270
|
const dicCodes = ['AUDIT_STATUS', 'SUPPLIER', 'APPLICABLE_STANDARD']
|
|
211
|
271
|
return getDicByCodes(dicCodes).then(results => {
|
|
...
|
...
|
@@ -472,4 +532,82 @@ export default { |
|
472
|
532
|
font-weight: 600;
|
|
473
|
533
|
}
|
|
474
|
534
|
}
|
|
|
535
|
+
|
|
|
536
|
+.dialog {
|
|
|
537
|
+ width: 100%;
|
|
|
538
|
+ overflow-y: auto;
|
|
|
539
|
+ padding: 32rpx 28rpx calc(20rpx + env(safe-area-inset-bottom));
|
|
|
540
|
+ background: #fff;
|
|
|
541
|
+ border-radius: 20rpx 20rpx 0 0;
|
|
|
542
|
+
|
|
|
543
|
+ &_header {
|
|
|
544
|
+ position: relative;
|
|
|
545
|
+ text-align: center;
|
|
|
546
|
+ font-size: 34rpx;
|
|
|
547
|
+ font-weight: 600;
|
|
|
548
|
+ margin-bottom: 12rpx;
|
|
|
549
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
550
|
+ }
|
|
|
551
|
+
|
|
|
552
|
+ &_body {
|
|
|
553
|
+ padding: 12rpx 4rpx 24rpx;
|
|
|
554
|
+ max-height: 70vh;
|
|
|
555
|
+ overflow-y: auto;
|
|
|
556
|
+
|
|
|
557
|
+ }
|
|
|
558
|
+
|
|
|
559
|
+ .split_body {
|
|
|
560
|
+ max-height: 60vh;
|
|
|
561
|
+ }
|
|
|
562
|
+
|
|
|
563
|
+ &_footer {
|
|
|
564
|
+ padding-top: 12rpx;
|
|
|
565
|
+ display: flex;
|
|
|
566
|
+ justify-content: center;
|
|
|
567
|
+
|
|
|
568
|
+ .btn {
|
|
|
569
|
+ width: 100%;
|
|
|
570
|
+ height: 80rpx;
|
|
|
571
|
+ line-height: 80rpx;
|
|
|
572
|
+ border-radius: 12rpx;
|
|
|
573
|
+ font-size: 32rpx;
|
|
|
574
|
+ background: $theme-primary;
|
|
|
575
|
+ color: #fff;
|
|
|
576
|
+
|
|
|
577
|
+ &::after {
|
|
|
578
|
+ border: none;
|
|
|
579
|
+ }
|
|
|
580
|
+ }
|
|
|
581
|
+ }
|
|
|
582
|
+}
|
|
|
583
|
+
|
|
|
584
|
+.dialog_close {
|
|
|
585
|
+ position: absolute;
|
|
|
586
|
+ right: 16rpx;
|
|
|
587
|
+ top: 0rpx;
|
|
|
588
|
+ width: 48rpx;
|
|
|
589
|
+ height: 48rpx;
|
|
|
590
|
+ background-image: url('~@/static/images/flow/close_icon.png');
|
|
|
591
|
+ background-repeat: no-repeat;
|
|
|
592
|
+ background-position: right center;
|
|
|
593
|
+ background-size: cover;
|
|
|
594
|
+}
|
|
|
595
|
+
|
|
|
596
|
+.dialog_row {
|
|
|
597
|
+ margin-bottom: 24rpx;
|
|
|
598
|
+}
|
|
|
599
|
+
|
|
|
600
|
+.dialog_label {
|
|
|
601
|
+ display: block;
|
|
|
602
|
+ margin-bottom: 12rpx;
|
|
|
603
|
+ font-size: 28rpx;
|
|
|
604
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
605
|
+}
|
|
|
606
|
+
|
|
|
607
|
+.upload-show {
|
|
|
608
|
+ margin-top: 8rpx;
|
|
|
609
|
+ font-size: 26rpx;
|
|
|
610
|
+ color: rgba(0, 0, 0, 0.6);
|
|
|
611
|
+}
|
|
|
612
|
+
|
|
475
|
613
|
</style> |
...
|
...
|
|