Commit c3192dfc8f59efd3d93d58cad5f4099ba75d9507

Authored by 史婷婷
1 parent 3f6d1ec5

feat: 资信管理审核-客户信息&公司评审-暂存

@@ -376,7 +376,6 @@ export default { @@ -376,7 +376,6 @@ export default {
376 annualTotalSales: '', 376 annualTotalSales: '',
377 mainIndustry: '', 377 mainIndustry: '',
378 annualMaterialOverview: '', 378 annualMaterialOverview: '',
379 - companyCreditLimit: '',  
380 corePersonnelList: [], 379 corePersonnelList: [],
381 }, 380 },
382 sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, 381 sheet: { visible: false, title: '请选择', field: '', options: [], value: '' },
@@ -25,8 +25,7 @@ @@ -25,8 +25,7 @@
25 <view class="action-modal_header">{{ approveType === 'PASS' ? '通过' : '驳回' }}</view> 25 <view class="action-modal_header">{{ approveType === 'PASS' ? '通过' : '驳回' }}</view>
26 <view class="action-modal_body"> 26 <view class="action-modal_body">
27 <text class="tip">{{ approveType === 'PASS' ? '您将通过该信息的审核' : '您将驳回该信息的审核' }}</text> 27 <text class="tip">{{ approveType === 'PASS' ? '您将通过该信息的审核' : '您将驳回该信息的审核' }}</text>
28 - <uni-easyinput v-model="message"  
29 - :placeholder="approveType === 'PASS' ? '请输入通过原因' : '请输入驳回原因'" /> 28 + <uni-easyinput v-model="message" :placeholder="approveType === 'PASS' ? '请输入通过原因' : '请输入驳回原因'" />
30 </view> 29 </view>
31 <view class="action-modal_footer"> 30 <view class="action-modal_footer">
32 <button class="btn cancel" @click="cancelApprove">取消</button> 31 <button class="btn cancel" @click="cancelApprove">取消</button>
@@ -35,15 +34,93 @@ @@ -35,15 +34,93 @@
35 </view> 34 </view>
36 </view> 35 </view>
37 </uni-popup> 36 </uni-popup>
  37 +
  38 + <uni-popup ref="customerInfoPopup" type="bottom" :mask-click="false">
  39 + <view class="dialog">
  40 + <view class="dialog_header">
  41 + <text>上传客户信息</text>
  42 + <view class="dialog_close" @click="closeCustomerInfo">×</view>
  43 + </view>
  44 + <view class="dialog_body">
  45 + <view class="dialog_row">
  46 + <text class="dialog_label">上传工商信息</text>
  47 + <FileUpload v-model="businessFile" />
  48 + <view v-if="businessFile && businessFile.name" class="upload-show">{{ businessFile.name }}
  49 + </view>
  50 + </view>
  51 + <view class="dialog_row">
  52 + <text class="dialog_label">上传股东信息</text>
  53 + <FileUpload v-model="shareholderFile" />
  54 + <view v-if="shareholderFile && shareholderFile.name" class="upload-show">{{ shareholderFile.name
  55 + }}</view>
  56 + </view>
  57 + </view>
  58 + <view class="dialog_footer">
  59 + <button class="btn confirm" type="primary" @click="onCustomerInfoSave">保存</button>
  60 + </view>
  61 + </view>
  62 + </uni-popup>
  63 +
  64 + <uni-popup ref="companyReviewPopup" type="bottom" :mask-click="false">
  65 + <view class="dialog">
  66 + <view class="dialog_header">
  67 + <text>公司评审</text>
  68 + <view class="dialog_close" @click="closeCompanyReview">×</view>
  69 + </view>
  70 + <view class="dialog_body">
  71 + <uni-list>
  72 + <uni-list-item title="结算期限">
  73 + <template v-slot:footer>
  74 + <uni-easyinput v-model="companyReview.companySettlementPeriod" placeholder="请输入结算期限"
  75 + :inputBorder="false" />
  76 + </template>
  77 + </uni-list-item>
  78 + <uni-list-item title="加工操作方案">
  79 + <template v-slot:footer>
  80 + <uni-easyinput v-model="companyReview.companyMaterialSupplyPlan" placeholder="请输入加工操作方案"
  81 + :inputBorder="false" />
  82 + </template>
  83 + </uni-list-item>
  84 + <uni-list-item class="select-item" clickable
  85 + :rightText="companyReview.companySuggestedCategoryName || '请选择'" showArrow
  86 + @click="openSheet('companySuggestedCategory')">
  87 + <template v-slot:body>
  88 + <view class="item-title"><text>客户分类</text></view>
  89 + </template>
  90 + </uni-list-item>
  91 + <uni-list-item title="授信额度">
  92 + <template v-slot:footer>
  93 + <view class="amount-row">
  94 + <uni-easyinput type="number" v-model="companyReview.companyCreditLimit"
  95 + placeholder="0.00" :inputBorder="false" />
  96 + <text class="unit">万元</text>
  97 + </view>
  98 + </template>
  99 + </uni-list-item>
  100 + </uni-list>
  101 + </view>
  102 + <view class="dialog_footer">
  103 + <button class="btn confirm" type="primary" @click="onCompanyReviewSave">保存</button>
  104 + </view>
  105 + </view>
  106 + </uni-popup>
  107 +
  108 + <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options"
  109 + v-model="sheet.value" @confirm="onSheetConfirm" />
38 </view> 110 </view>
39 </template> 111 </template>
40 <script> 112 <script>
41 import FlowTimeline from '@/components/flow-timeline/index.vue' 113 import FlowTimeline from '@/components/flow-timeline/index.vue'
  114 +import SingleSelectSheet from '@/components/single-select/index.vue'
  115 +import FileUpload from '@/components/file-upload/index.vue'
42 import { getSysFlowComponentPath } from '@/utils/flow-components.js' 116 import { getSysFlowComponentPath } from '@/utils/flow-components.js'
43 import { getFlowLinkByInstanceIdApi, getInstanceByBusinessIdApi, approvePassApi, approveRefuseApi } from '@/api/flow.js' 117 import { getFlowLinkByInstanceIdApi, getInstanceByBusinessIdApi, approvePassApi, approveRefuseApi } from '@/api/flow.js'
  118 +import { getDicByCodeApi } from '@/api/base.js'
44 export default { 119 export default {
45 components: { 120 components: {
46 - FlowTimeline 121 + FlowTimeline,
  122 + SingleSelectSheet,
  123 + FileUpload
47 }, 124 },
48 data() { 125 data() {
49 return { 126 return {
@@ -56,9 +133,16 @@ export default { @@ -56,9 +133,16 @@ export default {
56 }, 133 },
57 isEnd: false, // 流程是否结束 134 isEnd: false, // 流程是否结束
58 nodeList: [], 135 nodeList: [],
59 - extraBtnText: '',  
60 approveType: 'PASS', 136 approveType: 'PASS',
61 - message: '' 137 + message: '',
  138 + customerInfoVisible: false,
  139 + companyReviewVisible: false,
  140 + businessFile: { id: '', name: '' },
  141 + shareholderFile: { id: '', name: '' },
  142 + customerInfo: { businessFileName: '', businessFileId: '', shareholderFileName: '', shareholderFileId: '' },
  143 + companyReview: { companySettlementPeriod: '', companyMaterialSupplyPlan: '', companySuggestedCategory: '', companySuggestedCategoryName: '', companyCreditLimit: '' },
  144 + categoryOptions: [],
  145 + sheet: { visible: false, title: '请选择', options: [], value: '', field: '' }
62 } 146 }
63 }, 147 },
64 computed: { 148 computed: {
@@ -66,6 +150,22 @@ export default { @@ -66,6 +150,22 @@ export default {
66 // sourceBusinessType 业务类型 todo 待处理--主要是合同那边使用 150 // sourceBusinessType 业务类型 todo 待处理--主要是合同那边使用
67 const name = getSysFlowComponentPath(this.auditCtx.bizFlag || '') 151 const name = getSysFlowComponentPath(this.auditCtx.bizFlag || '')
68 return name || '' 152 return name || ''
  153 + },
  154 + roleCodes() {
  155 + const g = this.$store && this.$store.getters
  156 + return (g && g.roleCodes) || []
  157 + },
  158 + extraBtnText() {
  159 + let text = ''
  160 + if (String(this.auditCtx.bizFlag || '') === 'CUSTOMER_CREDIT_EDIT') {
  161 + const codes = Array.isArray(this.roleCodes) ? this.roleCodes : []
  162 + if (codes.includes('yzkzg')) {
  163 + text = '公司评审'
  164 + } else if (codes.includes('yzkday')) {
  165 + text = '客户信息'
  166 + }
  167 + }
  168 + return text
69 } 169 }
70 }, 170 },
71 onLoad() { 171 onLoad() {
@@ -105,6 +205,7 @@ export default { @@ -105,6 +205,7 @@ export default {
105 if (this.auditCtx && this.auditCtx.instanceId) { 205 if (this.auditCtx && this.auditCtx.instanceId) {
106 this.loadFlowLinkByInstanceId(this.auditCtx.instanceId) 206 this.loadFlowLinkByInstanceId(this.auditCtx.instanceId)
107 } 207 }
  208 + this.loadCategoryOptions()
108 }, 209 },
109 onUnload() { 210 onUnload() {
110 try { 211 try {
@@ -114,6 +215,15 @@ export default { @@ -114,6 +215,15 @@ export default {
114 } catch (e) { } 215 } catch (e) { }
115 }, 216 },
116 methods: { 217 methods: {
  218 + async loadCategoryOptions() {
  219 + try {
  220 + const res = await getDicByCodeApi('CUSTOMER_CATEGORY')
  221 + const list = res.data || []
  222 + this.categoryOptions = (list || []).map(it => ({ label: it.name || '', value: it.code || '' }))
  223 + } catch (e) {
  224 + this.categoryOptions = []
  225 + }
  226 + },
117 loadFlowLinkByInstanceId(instanceId) { 227 loadFlowLinkByInstanceId(instanceId) {
118 getFlowLinkByInstanceIdApi({ instanceId }).then(res => { 228 getFlowLinkByInstanceIdApi({ instanceId }).then(res => {
119 console.log('审核__loadFlowLinkByInstanceId', res) 229 console.log('审核__loadFlowLinkByInstanceId', res)
@@ -126,7 +236,9 @@ export default { @@ -126,7 +236,9 @@ export default {
126 const ref = this.$refs.basicRef 236 const ref = this.$refs.basicRef
127 const vals = ref && typeof ref.getFormValues === 'function' ? ref.getFormValues() : {} 237 const vals = ref && typeof ref.getFormValues === 'function' ? ref.getFormValues() : {}
128 return { 238 return {
129 - ...vals 239 + ...vals,
  240 + customerInfo: { ...this.customerInfo },
  241 + companyReview: { ...this.companyReview }
130 } 242 }
131 }, 243 },
132 // 驳回 244 // 驳回
@@ -138,23 +250,116 @@ export default { @@ -138,23 +250,116 @@ export default {
138 // 通过 250 // 通过
139 // 在这里增加业务判断 比如 资信管理,判断有没有填写客户信息、公司评审(这些是不同角色进行操作的) 251 // 在这里增加业务判断 比如 资信管理,判断有没有填写客户信息、公司评审(这些是不同角色进行操作的)
140 onPass() { 252 onPass() {
  253 + console.log('审核__roles&&bizFlag', this.roleCodes, this.auditCtx.bizFlag);
  254 + // 客户资信的审核
  255 + if (this.auditCtx.bizFlag === 'CUSTOMER_CREDIT_EDIT') {
  256 + // 运作科档案员审核(yzkday) --显示客户信息按钮,可上传工商信息、股东信息的图片
  257 + if (this.roleCodes.includes('yzkday') && !this.hsCustomerInfo()) {
  258 + uni.showToast({
  259 + title: '请填写客户信息',
  260 + icon: 'none'
  261 + })
  262 + return
  263 + }
  264 + // 运作科主管审核(yzkzg) --显示公司评审按钮,可对加工操作方案、授信额度、结算期限、客户等级进行修改
  265 + if (this.roleCodes.includes('yzkzg') && !this.hsCompanyReview()) {
  266 + uni.showToast({
  267 + title: '请填写公司评审信息',
  268 + icon: 'none'
  269 + })
  270 + return
  271 + }
  272 + }
141 this.approveType = 'PASS' 273 this.approveType = 'PASS'
142 this.message = '' 274 this.message = ''
143 this.$refs.approvePopup.open() 275 this.$refs.approvePopup.open()
144 }, 276 },
  277 + // 是否填写-客户信息
  278 + hsCustomerInfo() {
  279 + if (this.customerInfo.businessFileId || this.customerInfo.shareholderFileId) {
  280 + return true
  281 + }
  282 + return false
  283 + },
  284 + // 是否填写-公司评审信息
  285 + hsCompanyReview() {
  286 + if (this.companyReview.companySettlementPeriod || this.companyReview.companyMaterialSupplyPlan || this.companyReview.companySuggestedCategory || this.companyReview.companySuggestedCategoryName || this.companyReview.companyCreditLimit) {
  287 + return true
  288 + }
  289 + return false
  290 + },
  291 + // 更多按钮操作
145 onExtra() { 292 onExtra() {
146 - const payload = this.getPayload()  
147 - uni.showToast({  
148 - title: this.extraBtnText,  
149 - icon: 'none'  
150 - }) 293 + if (this.extraBtnText === '客户信息') {
  294 + this.$refs.customerInfoPopup && this.$refs.customerInfoPopup.open()
  295 + } else if (this.extraBtnText === '公司评审') {
  296 + this.$refs.companyReviewPopup && this.$refs.companyReviewPopup.open()
  297 + }
  298 + },
  299 + // 上传客户信息 保存
  300 + onCustomerInfoSave() {
  301 + const b = this.businessFile || {}
  302 + const s = this.shareholderFile || {}
  303 + this.customerInfo.businessFileId = b.id || ''
  304 + this.customerInfo.businessFileName = b.name || ''
  305 + this.customerInfo.shareholderFileId = s.id || ''
  306 + this.customerInfo.shareholderFileName = s.name || ''
  307 + this.$refs.customerInfoPopup && this.$refs.customerInfoPopup.close()
  308 + console.log('审核__customerInfo', this.customerInfo)
  309 + uni.showToast({ title: '已保存', icon: 'none' })
  310 + },
  311 + openSheet(field) {
  312 + if (field === 'companySuggestedCategory') {
  313 + const current = this.companyReview.companySuggestedCategory
  314 + const match = (this.categoryOptions || []).find(o => String(o.value) === String(current) || String(o.label) === String(current))
  315 + this.sheet = { ...this.sheet, visible: true, title: '建议客户分类', options: this.categoryOptions, value: match ? match.value : '', field }
  316 + }
  317 + },
  318 + closeCustomerInfo() {
  319 + this.$refs.customerInfoPopup && this.$refs.customerInfoPopup.close()
  320 + },
  321 + closeCompanyReview() {
  322 + this.$refs.companyReviewPopup && this.$refs.companyReviewPopup.close()
  323 + },
  324 + onSheetConfirm({ value, label }) {
  325 + const field = this.sheet.field
  326 + if (!field) return
  327 + if (field === 'companySuggestedCategory') {
  328 + this.companyReview.companySuggestedCategory = value || ''
  329 + this.companyReview.companySuggestedCategoryName = label || ''
  330 + }
  331 + this.sheet.visible = false
  332 + },
  333 + // 公司评审 保存
  334 + onCompanyReviewSave() {
  335 + this.$refs.companyReviewPopup && this.$refs.companyReviewPopup.close();
  336 + console.log('审核__companyReview', this.companyReview)
  337 + uni.showToast({ title: '已保存', icon: 'none' })
151 }, 338 },
152 cancelApprove() { 339 cancelApprove() {
153 this.$refs.approvePopup.close() 340 this.$refs.approvePopup.close()
154 }, 341 },
155 confirmApprove() { 342 confirmApprove() {
  343 + let _data = this.getPayload() || {};
  344 + // 客户资信的审核
  345 + if (this.auditCtx.bizFlag === 'CUSTOMER_CREDIT_EDIT') {
  346 + // 运作科档案员审核(yzkday) --客户信息数据
  347 + if (this.roleCodes.includes('yzkday')) {
  348 + _data = {
  349 + ..._data,
  350 + ...this.customerInfo
  351 + }
  352 + }
  353 + // 运作科主管审核(yzkzg) --公司评审数据
  354 + if (this.roleCodes.includes('yzkzg')) {
  355 + _data = {
  356 + ..._data,
  357 + ...this.companyReview
  358 + }
  359 + }
  360 + }
156 const payload = { 361 const payload = {
157 - variables:this.getPayload(), 362 + variables: _data,
158 message: this.message, 363 message: this.message,
159 taskId: this.auditCtx.taskId 364 taskId: this.auditCtx.taskId
160 } 365 }
@@ -215,19 +420,19 @@ export default { @@ -215,19 +420,19 @@ export default {
215 align-items: center; 420 align-items: center;
216 height: 96rpx; 421 height: 96rpx;
217 422
218 - &.bg1 {  
219 - background-image: url('~@/static/images/flow/tab_1_icon.png');  
220 - background-repeat: no-repeat;  
221 - background-position: right center;  
222 - background-size: cover;  
223 - } 423 + &.bg1 {
  424 + background-image: url('~@/static/images/flow/tab_1_icon.png');
  425 + background-repeat: no-repeat;
  426 + background-position: right center;
  427 + background-size: cover;
  428 + }
224 429
225 - &.bg2 {  
226 - background-image: url('~@/static/images/flow/tab_2_icon.png');  
227 - background-repeat: no-repeat;  
228 - background-position: right center;  
229 - background-size: cover;  
230 - } 430 + &.bg2 {
  431 + background-image: url('~@/static/images/flow/tab_2_icon.png');
  432 + background-repeat: no-repeat;
  433 + background-position: right center;
  434 + background-size: cover;
  435 + }
231 436
232 .tab { 437 .tab {
233 width: 50%; 438 width: 50%;
@@ -351,4 +556,90 @@ export default { @@ -351,4 +556,90 @@ export default {
351 } 556 }
352 } 557 }
353 } 558 }
  559 +
  560 +.dialog {
  561 + width: 100%;
  562 + max-height: 70vh;
  563 + overflow-y: auto;
  564 + padding: 32rpx 28rpx calc(20rpx + env(safe-area-inset-bottom));
  565 + background: #fff;
  566 + border-radius: 20rpx 20rpx 0 0;
  567 +
  568 + &_header {
  569 + position: relative;
  570 + text-align: center;
  571 + font-size: 34rpx;
  572 + font-weight: 600;
  573 + margin-bottom: 12rpx;
  574 + color: rgba(0, 0, 0, 0.9);
  575 + }
  576 +
  577 + &_body {
  578 + padding: 12rpx 4rpx 24rpx;
  579 + }
  580 +
  581 + &_footer {
  582 + padding-top: 12rpx;
  583 + display: flex;
  584 + justify-content: center;
  585 +
  586 + .btn {
  587 + width: 100%;
  588 + height: 80rpx;
  589 + line-height: 80rpx;
  590 + border-radius: 12rpx;
  591 + font-size: 32rpx;
  592 + background: $theme-primary;
  593 + color: #fff;
  594 +
  595 + &::after {
  596 + border: none;
  597 + }
  598 + }
  599 + }
  600 +}
  601 +
  602 +.dialog_close {
  603 + position: absolute;
  604 + right: 16rpx;
  605 + top: 0;
  606 + width: 64rpx;
  607 + height: 64rpx;
  608 + line-height: 64rpx;
  609 + text-align: center;
  610 + font-size: 36rpx;
  611 + color: rgba(0, 0, 0, 0.6);
  612 +}
  613 +
  614 +.dialog_row {
  615 + margin-bottom: 24rpx;
  616 +}
  617 +
  618 +.dialog_label {
  619 + display: block;
  620 + margin-bottom: 12rpx;
  621 + font-size: 28rpx;
  622 + color: rgba(0, 0, 0, 0.9);
  623 +}
  624 +
  625 +.upload-show {
  626 + margin-top: 8rpx;
  627 + font-size: 26rpx;
  628 + color: rgba(0, 0, 0, 0.6);
  629 +}
  630 +
  631 +.select-item .item-title {
  632 + font-size: 28rpx;
  633 + color: rgba(0, 0, 0, 0.9);
  634 +}
  635 +
  636 +.amount-row {
  637 + display: flex;
  638 + align-items: center;
  639 + gap: 12rpx;
  640 +}
  641 +
  642 +.amount-row .unit {
  643 + color: rgba(0, 0, 0, 0.6);
  644 +}
354 </style> 645 </style>