Showing
2 changed files
with
42 additions
and
16 deletions
| ... | ... | @@ -86,7 +86,7 @@ |
| 86 | 86 | <uni-popup ref="uploadPopup" type="bottom" :mask-click="false" :safe-area="true"> |
| 87 | 87 | <view class="upload-dialog"> |
| 88 | 88 | <view class="upload-header"> |
| 89 | - <text class="title">上传规范性合同</text> | |
| 89 | + <text class="title">{{ uploadType === 'seal' ? '上传双方盖章合同' : '上传规范性合同' }}</text> | |
| 90 | 90 | <uni-icons type="closeempty" style="position: absolute; right: 16px;" size="22" |
| 91 | 91 | @click="$refs.uploadPopup.close()" /> |
| 92 | 92 | </view> |
| ... | ... | @@ -96,7 +96,7 @@ |
| 96 | 96 | <FileUpload v-model="fileInfo" /> |
| 97 | 97 | </view> |
| 98 | 98 | <view v-if="fileInfo && fileInfo.name" class="upload-show">{{ fileInfo.name }}</view> |
| 99 | - <view class="row1" @click="openStandardizedSheet"> | |
| 99 | + <view class="row1" @click="openStandardizedSheet" v-if="uploadType !== 'seal'"> | |
| 100 | 100 | <view class="label1">合同是否规范</view> |
| 101 | 101 | <uni-icons type="right" size="18" v-if="!standardStandardizedName"></uni-icons> |
| 102 | 102 | <view class="value" v-else>{{ standardStandardizedName }}</view> |
| ... | ... | @@ -113,7 +113,7 @@ |
| 113 | 113 | </template> |
| 114 | 114 | |
| 115 | 115 | <script> |
| 116 | -import { getContractApi, deleteContractApi, uploadFormalContract, uploadStandardContract } from '@/api/contract' | |
| 116 | +import { getContractApi, deleteContractApi, uploadFormalContract, uploadStandardContract, uploadSignedContractFile } from '@/api/contract' | |
| 117 | 117 | import ProductRel from './productRel.vue' |
| 118 | 118 | import DetailButtons from '@/components/detail-buttons/index.vue' |
| 119 | 119 | import FileUpload from '@/components/file-upload/index.vue' |
| ... | ... | @@ -246,6 +246,12 @@ export default { |
| 246 | 246 | variant: 'primary', |
| 247 | 247 | event: 'auditDetail3' |
| 248 | 248 | }, |
| 249 | + { | |
| 250 | + text: '上传双方盖章合同', | |
| 251 | + visible: true, | |
| 252 | + variant: 'outline', | |
| 253 | + event: 'uploadSeal' | |
| 254 | + }, | |
| 249 | 255 | ], |
| 250 | 256 | } |
| 251 | 257 | }, |
| ... | ... | @@ -270,6 +276,7 @@ export default { |
| 270 | 276 | { ...this.buttons[9], visible: (s === 'FORMAL' && t) }, |
| 271 | 277 | { ...this.buttons[10], visible: (s === 'STANDARD' && t) }, |
| 272 | 278 | { ...this.buttons[11], visible: (s === 'STANDARD' && a) }, |
| 279 | + { ...this.buttons[12], visible: (s === 'STANDARD') }, | |
| 273 | 280 | ] |
| 274 | 281 | } |
| 275 | 282 | }, |
| ... | ... | @@ -326,14 +333,19 @@ export default { |
| 326 | 333 | }) |
| 327 | 334 | return |
| 328 | 335 | } |
| 329 | - if (!this.standardStandardized) { | |
| 336 | + if (!this.standardStandardized && this.uploadType !== 'seal') { | |
| 330 | 337 | uni.showToast({ |
| 331 | 338 | title: '请选择合同是否规范', |
| 332 | 339 | icon: 'error' |
| 333 | 340 | }) |
| 334 | 341 | return |
| 335 | 342 | } |
| 336 | - const data = this.uploadType === 'formal' ? { | |
| 343 | + const data = this.uploadType === 'seal' ? | |
| 344 | + { | |
| 345 | + id: this.id, | |
| 346 | + signedContractFileId: this.fileInfo.id, | |
| 347 | + signedContractFileName: this.fileInfo.name, | |
| 348 | + } :this.uploadType === 'formal' ? { | |
| 337 | 349 | id: this.id, |
| 338 | 350 | formalFileId: this.fileInfo.id, |
| 339 | 351 | formalFileName: this.fileInfo.name, |
| ... | ... | @@ -344,15 +356,15 @@ export default { |
| 344 | 356 | standardFileName: this.fileInfo.name, |
| 345 | 357 | standardStandardized: this.standardStandardized |
| 346 | 358 | } |
| 347 | - const api = this.uploadType === 'formal' ? uploadFormalContract : uploadStandardContract | |
| 359 | + const api = this.uploadType === 'seal' ? uploadSignedContractFile : this.uploadType === 'formal' ? uploadFormalContract : uploadStandardContract | |
| 348 | 360 | uni.showModal({ |
| 349 | 361 | title: '确认提交', |
| 350 | - content: this.uploadType === 'formal' ? '确定提交正式合同吗?' : '确定提交标准合同吗?', | |
| 362 | + content: this.uploadType === 'seal' ? '确定提交双方盖章合同吗?' : this.uploadType === 'formal' ? '确定提交正式合同吗?' : '确定提交标准合同吗?', | |
| 351 | 363 | success: (res) => { |
| 352 | 364 | if (res.confirm) { |
| 353 | 365 | api({ ...this.detail, ...data }).then(() => { |
| 354 | 366 | uni.showToast({ |
| 355 | - title: this.uploadType === 'formal' ? '上传正式合同成功' : '上传标准合同成功', | |
| 367 | + title: this.uploadType === 'seal' ? '上传双方盖章合同成功' : this.uploadType === 'formal' ? '上传正式合同成功' : '上传标准合同成功', | |
| 356 | 368 | icon: 'success' |
| 357 | 369 | }) |
| 358 | 370 | setTimeout(() => { |
| ... | ... | @@ -402,6 +414,8 @@ export default { |
| 402 | 414 | if (e === 'auditDetail1') return this.onAuditDetail(this.detail.id || '', 'FORMAL_CONTRACT') |
| 403 | 415 | if (e === 'auditDetail2') return this.onAuditDetail(this.detail.parentId || '', 'FORMAL_CONTRACT') |
| 404 | 416 | if (e === 'auditDetail3') return this.onAuditDetail(this.detail.id || '', 'STANDARD_CONTRACT') |
| 417 | + if (e === 'uploadSeal') return this.uploadContract(this.detail.id || '', 'seal') | |
| 418 | + | |
| 405 | 419 | }, |
| 406 | 420 | onAudit(id, type) { |
| 407 | 421 | const CACHE_KEY = 'sourceBusinessId' | ... | ... |
| ... | ... | @@ -87,7 +87,7 @@ |
| 87 | 87 | <uni-popup ref="uploadPopup" type="bottom" :mask-click="false" :safe-area="true"> |
| 88 | 88 | <view class="upload-dialog"> |
| 89 | 89 | <view class="upload-header"> |
| 90 | - <text class="title">上传规范性合同</text> | |
| 90 | + <text class="title">{{ uploadType === 'seal' ? '上传双方盖章合同' : '上传规范性合同' }}</text> | |
| 91 | 91 | <uni-icons type="closeempty" style="position: absolute; right: 16px;" size="22" |
| 92 | 92 | @click="$refs.uploadPopup.close()" /> |
| 93 | 93 | </view> |
| ... | ... | @@ -97,7 +97,7 @@ |
| 97 | 97 | <FileUpload v-model="fileInfo" /> |
| 98 | 98 | </view> |
| 99 | 99 | <view v-if="fileInfo && fileInfo.name" class="upload-show">{{ fileInfo.name }}</view> |
| 100 | - <view class="row1" @click="openStandardizedSheet"> | |
| 100 | + <view class="row1" @click="openStandardizedSheet" v-if="uploadType !== 'seal'"> | |
| 101 | 101 | <view class="label1">合同是否规范</view> |
| 102 | 102 | <uni-icons type="right" size="18" v-if="!standardStandardizedName"></uni-icons> |
| 103 | 103 | <view class="value" v-else>{{ standardStandardizedName }}</view> |
| ... | ... | @@ -114,7 +114,7 @@ |
| 114 | 114 | </template> |
| 115 | 115 | |
| 116 | 116 | <script> |
| 117 | -import { getContractApi, deleteContractApi, uploadFormalContract, uploadStandardContract } from '@/api/contract' | |
| 117 | +import { getContractApi, deleteContractApi, uploadFormalContract, uploadStandardContract, uploadSignedContractFile } from '@/api/contract' | |
| 118 | 118 | import ProductRel from './productRel.vue' |
| 119 | 119 | import DetailButtons from '@/components/detail-buttons/index.vue' |
| 120 | 120 | import FileUpload from '@/components/file-upload/index.vue' |
| ... | ... | @@ -252,6 +252,12 @@ export default { |
| 252 | 252 | variant: 'primary', |
| 253 | 253 | event: 'auditDetail3' |
| 254 | 254 | }, |
| 255 | + { | |
| 256 | + text: '上传双方盖章合同附件', | |
| 257 | + visible: true, | |
| 258 | + variant: 'outline', | |
| 259 | + event: 'uploadSeal' | |
| 260 | + }, | |
| 255 | 261 | ], |
| 256 | 262 | } |
| 257 | 263 | }, |
| ... | ... | @@ -277,6 +283,7 @@ export default { |
| 277 | 283 | { ...this.buttons[10], visible: (s === 'FORMAL' && a) }, //正式合同审核详情 |
| 278 | 284 | { ...this.buttons[11], visible: (s === 'STANDARD' && a) }, //正式合同审核详情 |
| 279 | 285 | { ...this.buttons[12], visible: (s === 'STANDARD' && t) }, //标准合同审核详情 |
| 286 | + { ...this.buttons[13], visible: (s === 'STANDARD') }, //上传双方盖章合同附件 | |
| 280 | 287 | ] |
| 281 | 288 | } |
| 282 | 289 | }, |
| ... | ... | @@ -343,14 +350,18 @@ export default { |
| 343 | 350 | }) |
| 344 | 351 | return |
| 345 | 352 | } |
| 346 | - if (!this.standardStandardized) { | |
| 353 | + if (!this.standardStandardized && this.uploadType !== 'seal') { | |
| 347 | 354 | uni.showToast({ |
| 348 | 355 | title: '请选择合同是否规范', |
| 349 | 356 | icon: 'error' |
| 350 | 357 | }) |
| 351 | 358 | return |
| 352 | 359 | } |
| 353 | - const data = this.uploadType === 'formal' ? { | |
| 360 | + const data = this.uploadType === 'seal' ? { | |
| 361 | + id: this.id, | |
| 362 | + signedContractFileId: this.fileInfo.id, | |
| 363 | + signedContractFileName: this.fileInfo.name, | |
| 364 | + } : this.uploadType === 'formal' ? { | |
| 354 | 365 | id: this.id, |
| 355 | 366 | formalFileId: this.fileInfo.id, |
| 356 | 367 | formalFileName: this.fileInfo.name, |
| ... | ... | @@ -361,15 +372,15 @@ export default { |
| 361 | 372 | standardFileName: this.fileInfo.name, |
| 362 | 373 | standardStandardized: this.standardStandardized |
| 363 | 374 | } |
| 364 | - const api = this.uploadType === 'formal' ? uploadFormalContract : uploadStandardContract | |
| 375 | + const api = this.uploadType === 'seal' ? uploadSignedContractFile : this.uploadType === 'formal' ? uploadFormalContract : uploadStandardContract | |
| 365 | 376 | uni.showModal({ |
| 366 | 377 | title: '确认提交', |
| 367 | - content: this.uploadType === 'formal' ? '确定提交正式合同吗?' : '确定提交标准合同吗?', | |
| 378 | + content: this.uploadType === 'formal' ? '确定提交正式合同吗?' : this.uploadType === 'seal' ? '确定提交双方盖章合同吗?' : '确定提交标准合同吗?', | |
| 368 | 379 | success: (res) => { |
| 369 | 380 | if (res.confirm) { |
| 370 | 381 | api({ ...this.detail, ...data }).then(() => { |
| 371 | 382 | uni.showToast({ |
| 372 | - title: this.uploadType === 'formal' ? '上传正式合同成功' : '上传标准合同成功', | |
| 383 | + title: this.uploadType === 'seal' ? '上传双方盖章合同成功' : this.uploadType === 'formal' ? '上传正式合同成功' : '上传标准合同成功', | |
| 373 | 384 | icon: 'success' |
| 374 | 385 | }) |
| 375 | 386 | setTimeout(() => { |
| ... | ... | @@ -415,6 +426,7 @@ export default { |
| 415 | 426 | if (e === 'auditDetail1') return this.onAuditDetail(this.detail.id || '', 'FORMAL_CONTRACT') |
| 416 | 427 | if (e === 'auditDetail2') return this.onAuditDetail(this.detail.parentId || '', 'FORMAL_CONTRACT') |
| 417 | 428 | if (e === 'auditDetail3') return this.onAuditDetail(this.detail.id || '', 'STANDARD_CONTRACT') |
| 429 | + if (e === 'uploadSeal') return this.uploadContract(this.detail.id || '', 'seal') | |
| 418 | 430 | }, |
| 419 | 431 | onAudit(id, type) { |
| 420 | 432 | const CACHE_KEY = 'sourceBusinessId' | ... | ... |