Commit 3ccb9f0d07c8bf922bbe6d3c812183c3ddfa6a82

Authored by 严涛
1 parent 8d1e5c53

质保书上传

@@ -75,3 +75,14 @@ export function checkApi(params) { @@ -75,3 +75,14 @@ export function checkApi(params) {
75 }, 75 },
76 }) 76 })
77 } 77 }
  78 +
  79 +
  80 +// 上传质保书
  81 +export function uploadWarrantyCertificate(params) {
  82 + return request({
  83 + url: `${baseUrl}/uploadWarrantyCertificate`,
  84 + method: 'put',
  85 + data: params,
  86 + contentType: ContentTypeEnum.JSON
  87 + })
  88 +}
@@ -4,7 +4,8 @@ module.exports = { @@ -4,7 +4,8 @@ module.exports = {
4 themeColor: '#3d48a3', 4 themeColor: '#3d48a3',
5 5
6 // baseUrl: 'http://ft.wecando21cn.com/api', 6 // baseUrl: 'http://ft.wecando21cn.com/api',
7 - baseUrl: 'http://gjtd.ahcjxc.com:81/api', 7 + // baseUrl: 'http://gjtd.ahcjxc.com:81/api',
  8 + baseUrl: 'http://erp.qgutech.com//api',
8 // baseUrl: 'http://127.0.0.1:8085', 9 // baseUrl: 'http://127.0.0.1:8085',
9 // 应用信息 10 // 应用信息
10 appInfo: { 11 appInfo: {
@@ -20,9 +20,21 @@ @@ -20,9 +20,21 @@
20 <Product mode="view" :status="form.status" :list="form.detailList" @applyDelay="applyDelayFun" 20 <Product mode="view" :status="form.status" :list="form.detailList" @applyDelay="applyDelayFun"
21 @split="splitFun" /> 21 @split="splitFun" />
22 </view> 22 </view>
  23 +
23 <view class="section"> 24 <view class="section">
24 <view class="row"><text class="label">签收单据</text><text class="value act" @click="downloadFile(form.fileId, form.fileName)">{{ form.fileName }}</text></view> 25 <view class="row"><text class="label">签收单据</text><text class="value act" @click="downloadFile(form.fileId, form.fileName)">{{ form.fileName }}</text></view>
25 </view> 26 </view>
  27 +
  28 + <view class="section">
  29 + <view class="row">
  30 + <text class="label">质保书</text>
  31 + <view class="value">
  32 + <view v-for="item in form.warrantyCertificateList" :key="item.fileId" class="file-item" @click="downloadFile(item.fileId, item.fileName)">
  33 + <text class="value act">{{ item.fileName }}</text>
  34 + </view>
  35 + </view>
  36 + </view>
  37 + </view>
26 </view> 38 </view>
27 </scroll-view> 39 </scroll-view>
28 <detail-buttons :buttons="displayButtons" @click="handleButtonClick" /> 40 <detail-buttons :buttons="displayButtons" @click="handleButtonClick" />
@@ -47,11 +59,11 @@ @@ -47,11 +59,11 @@
47 <uni-popup ref="fillDatePopup" type="bottom" :mask-click="false"> 59 <uni-popup ref="fillDatePopup" type="bottom" :mask-click="false">
48 <view class="dialog"> 60 <view class="dialog">
49 <view class="dialog_header"> 61 <view class="dialog_header">
50 - <text>填写日期</text> 62 + <text>填写日期</text>
51 <view class="dialog_close" @click="closeFillDateInfo"></view> 63 <view class="dialog_close" @click="closeFillDateInfo"></view>
52 - </view> 64 + </view>
53 <view class="dialog_body fill-data_body"> 65 <view class="dialog_body fill-data_body">
54 - <uni-list> 66 + <uni-list>
55 <uni-list-item title="原发货日期"> 67 <uni-list-item title="原发货日期">
56 <template v-slot:footer> 68 <template v-slot:footer>
57 <view class="value">{{ fillDateForm.shipmentsDate }}</view> 69 <view class="value">{{ fillDateForm.shipmentsDate }}</view>
@@ -827,4 +839,10 @@ export default { @@ -827,4 +839,10 @@ export default {
827 } 839 }
828 } 840 }
829 } 841 }
  842 +.file-item {
  843 + margin-bottom: 12rpx;
  844 + &:last-child {
  845 + margin-bottom: 0;
  846 + }
  847 +}
830 </style> 848 </style>
@@ -44,6 +44,9 @@ @@ -44,6 +44,9 @@
44 <view v-if="form.executionStandard === 'OTHER'" class="row"><text class="label">标准</text><text 44 <view v-if="form.executionStandard === 'OTHER'" class="row"><text class="label">标准</text><text
45 class="value">{{ form.executionStandardRemarks }}</text></view> 45 class="value">{{ form.executionStandardRemarks }}</text></view>
46 </view> 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 <view class="title-header"> 51 <view class="title-header">
49 <image class="title-header_icon" src="/static/images/title.png" /> 52 <image class="title-header_icon" src="/static/images/title.png" />
@@ -66,13 +69,32 @@ @@ -66,13 +69,32 @@
66 </view> 69 </view>
67 </scroll-view> 70 </scroll-view>
68 <detail-buttons :buttons="displayButtons" @click="handleButtonClick" /> 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 </view> 89 </view>
70 </template> 90 </template>
71 91
72 <script> 92 <script>
73 -import { getDetailApi, cancelApi, checkApi } from '@/api/order_list.js' 93 +import { getDetailApi, cancelApi, checkApi, uploadWarrantyCertificate } from '@/api/order_list.js'
74 import Product from './product.vue' 94 import Product from './product.vue'
75 import DetailButtons from '@/components/detail-buttons/index.vue' 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 import { 98 import {
77 getDicName 99 getDicName
78 } from '@/utils/dic.js' 100 } from '@/utils/dic.js'
@@ -82,7 +104,7 @@ import { @@ -82,7 +104,7 @@ import {
82 104
83 export default { 105 export default {
84 name: 'OrderListDetail', 106 name: 'OrderListDetail',
85 - components: { Product, DetailButtons }, 107 + components: { Product, DetailButtons, FileUpload },
86 data() { 108 data() {
87 return { 109 return {
88 form: {}, 110 form: {},
@@ -92,7 +114,9 @@ export default { @@ -92,7 +114,9 @@ export default {
92 { text: '审核', visible: true, variant: 'primary', event: 'audit' }, 114 { text: '审核', visible: true, variant: 'primary', event: 'audit' },
93 { text: '申请发货', visible: true, variant: 'outline', event: 'shipmentApply' }, 115 { text: '申请发货', visible: true, variant: 'outline', event: 'shipmentApply' },
94 { text: '取消', visible: true, variant: 'outline', event: 'cancel', style: { color: 'rgba(0,0,0,0.9)', border: '1px solid #DCDCDC' } }, 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 dicOptions: { 120 dicOptions: {
97 AUDIT_STATUS: [], 121 AUDIT_STATUS: [],
98 SUPPLIER: [], 122 SUPPLIER: [],
@@ -105,13 +129,16 @@ export default { @@ -105,13 +129,16 @@ export default {
105 const s = String((this.form && this.form.status) || '') 129 const s = String((this.form && this.form.status) || '')
106 const e = String((this.form && this.form.examineStatus) || '') 130 const e = String((this.form && this.form.examineStatus) || '')
107 const d = (this.form && this.form.showExamine) || false 131 const d = (this.form && this.form.showExamine) || false
  132 + const u = (this.form && this.form.showUpload) || false
  133 +
108 return { 134 return {
109 isRefuse: e === 'REFUSE', 135 isRefuse: e === 'REFUSE',
110 isAudit: e === 'AUDIT', 136 isAudit: e === 'AUDIT',
111 isAuditDetail: !this.form.sampleOrder, 137 isAuditDetail: !this.form.sampleOrder,
112 canExamine: d, 138 canExamine: d,
113 canDeliveryApply: s === 'ISSUED' && (!this.form.freeze || false) && Number(this.form.totalQuantity) > 0, 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 displayButtons() { 144 displayButtons() {
@@ -123,6 +150,7 @@ export default { @@ -123,6 +150,7 @@ export default {
123 { ...this.buttons[2], visible: f.isAudit && f.canExamine && this.$auth.hasPermi('order-manage:order-list:approve') }, 150 { ...this.buttons[2], visible: f.isAudit && f.canExamine && this.$auth.hasPermi('order-manage:order-list:approve') },
124 { ...this.buttons[3], visible: f.canDeliveryApply && this.$auth.hasPermi('order-manage:order-list:apply') }, 151 { ...this.buttons[3], visible: f.canDeliveryApply && this.$auth.hasPermi('order-manage:order-list:apply') },
125 { ...this.buttons[4], visible: f.isRefuse && f.contractCreateBy && this.$auth.hasPermi('order-manage:order-list:cancel') }, 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,6 +179,7 @@ export default {
151 audit: () => this.onAudit(), 179 audit: () => this.onAudit(),
152 shipmentApply: () => this.onShipmentApply(), 180 shipmentApply: () => this.onShipmentApply(),
153 cancel: () => this.onCancel(), 181 cancel: () => this.onCancel(),
  182 + upload: () => this.onUpload(),
154 } 183 }
155 const fn = map[btn.event] 184 const fn = map[btn.event]
156 if (typeof fn === 'function') fn() 185 if (typeof fn === 'function') fn()
@@ -206,6 +235,37 @@ export default { @@ -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 loadAllDicData() { 269 loadAllDicData() {
210 const dicCodes = ['AUDIT_STATUS', 'SUPPLIER', 'APPLICABLE_STANDARD'] 270 const dicCodes = ['AUDIT_STATUS', 'SUPPLIER', 'APPLICABLE_STANDARD']
211 return getDicByCodes(dicCodes).then(results => { 271 return getDicByCodes(dicCodes).then(results => {
@@ -472,4 +532,82 @@ export default { @@ -472,4 +532,82 @@ export default {
472 font-weight: 600; 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 </style> 613 </style>