Showing
12 changed files
with
125 additions
and
15 deletions
| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | <view class="section"> |
| 6 | 6 | <text class="row customer">{{ detail.code }}</text> |
| 7 | 7 | <view class="row" v-if="status === 'STANDARD'"><text class="label">正式合同规范性审核</text><text class="value"><span class="info-status" :style="detail.standardApprovedName ? getStatusCss(detail.standardApprovedName) : ''" >{{ detail.standardApprovedName || '-' }}</span></text></view> |
| 8 | + <view class="row" v-if="detail.status === 'STANDARD'"><text class="label">合同状态</text><text class="value"><span class="info-status" :style="detail.shippingStatusName ? getShippingStatusName(detail.shippingStatusName) : { color: '#000'}" >{{ detail.shippingStatusName || '-' }}</span></text></view> | |
| 8 | 9 | <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-' |
| 9 | 10 | }}</text></view> |
| 10 | 11 | <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-' |
| ... | ... | @@ -106,11 +107,13 @@ |
| 106 | 107 | </template> |
| 107 | 108 | |
| 108 | 109 | <script> |
| 109 | -import { getContractApi, deleteContractApi, uploadStandardContract, uploadSignedContractFile, statusStyle} from '@/api/contract' | |
| 110 | +import { getContractApi, deleteContractApi, uploadStandardContract, uploadSignedContractFile, statusStyle, statusMap } from '@/api/contract' | |
| 110 | 111 | import ProductRel from './productRel.vue' |
| 111 | 112 | import DetailButtons from '@/components/detail-buttons/index.vue' |
| 112 | 113 | import FileUpload from '@/components/file-upload/index.vue' |
| 113 | 114 | import SingleSelectSheet from '@/components/single-select/index.vue' |
| 115 | +import { fillStandardApprovedName } from '@/utils/dic.js' | |
| 116 | + | |
| 114 | 117 | export default { |
| 115 | 118 | name: 'ContractForeignStdDetail', |
| 116 | 119 | components: { ProductRel, DetailButtons, FileUpload, SingleSelectSheet }, |
| ... | ... | @@ -161,6 +164,7 @@ export default { |
| 161 | 164 | packaging: '' |
| 162 | 165 | }, |
| 163 | 166 | statusStyle: statusStyle, |
| 167 | + statusMap: statusMap, | |
| 164 | 168 | productList: [], |
| 165 | 169 | buttons: [{ |
| 166 | 170 | text: '编辑', |
| ... | ... | @@ -226,6 +230,13 @@ export default { |
| 226 | 230 | this.loadDetail() |
| 227 | 231 | }, |
| 228 | 232 | methods: { |
| 233 | + getShippingStatusName(name) { | |
| 234 | + const found = this.statusMap[name] || '' | |
| 235 | + return { | |
| 236 | + backgroundColor: found || '#000', | |
| 237 | + color: found ? '#fff' : '#000' | |
| 238 | + } | |
| 239 | + }, | |
| 229 | 240 | getStatusCss(name) { |
| 230 | 241 | const list = Array.isArray(this.statusStyle) ? this.statusStyle : [] |
| 231 | 242 | const found = list.find(it => it && it.text === name) || {} |
| ... | ... | @@ -373,6 +384,7 @@ export default { |
| 373 | 384 | destinationId: data.provinceId && data.cityId && data.districtId ? [data.provinceId, data.cityId, data.districtId] : '', |
| 374 | 385 | destinationLabel: data.provinceName && data.cityName && data.districtName ? `${data.provinceName} / ${data.cityName} / ${data.districtName}` : '', |
| 375 | 386 | } |
| 387 | + this.detail = await fillStandardApprovedName(this.detail) | |
| 376 | 388 | const lines = Array.isArray(data.contractDistributorLineList) ? data.contractDistributorLineList : [] |
| 377 | 389 | this.productList = lines |
| 378 | 390 | } catch (e) { | ... | ... |
| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | <view class="section"> |
| 6 | 6 | <text class="row customer">{{ detail.code }}</text> |
| 7 | 7 | <view class="row" v-if="detail.status === 'STANDARD' || detail.status === 'FORMAL'"><text class="label">{{ detail.status === 'STANDARD' ? '标准合同' : '正式合同' }}规范性审核状态</text><text class="value"><span class="info-status" :style="detail.standardApprovedName ? getStatusCss(detail.standardApprovedName) : ''" >{{ detail.standardApprovedName || '-' }}</span></text></view> |
| 8 | + <view class="row" v-if="detail.status === 'STANDARD'"><text class="label">合同状态</text><text class="value"><span class="info-status" :style="detail.shippingStatusName ? getShippingStatusName(detail.shippingStatusName) : { color: '#000'}" >{{ detail.shippingStatusName || '-' }}</span></text></view> | |
| 8 | 9 | <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-' |
| 9 | 10 | }}</text></view> |
| 10 | 11 | <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-' |
| ... | ... | @@ -113,11 +114,12 @@ |
| 113 | 114 | </template> |
| 114 | 115 | |
| 115 | 116 | <script> |
| 116 | -import { getContractApi, deleteContractApi, uploadFormalContract, uploadStandardContract, uploadSignedContractFile, statusStyle } from '@/api/contract' | |
| 117 | +import { getContractApi, deleteContractApi, uploadFormalContract, uploadStandardContract, uploadSignedContractFile, statusStyle, statusMap } from '@/api/contract' | |
| 117 | 118 | import ProductRel from './productRel.vue' |
| 118 | 119 | import DetailButtons from '@/components/detail-buttons/index.vue' |
| 119 | 120 | import FileUpload from '@/components/file-upload/index.vue' |
| 120 | 121 | import SingleSelectSheet from '@/components/single-select/index.vue' |
| 122 | +import { fillStandardApprovedName } from '@/utils/dic.js' | |
| 121 | 123 | |
| 122 | 124 | export default { |
| 123 | 125 | name: 'ContractForeignStockDetail', |
| ... | ... | @@ -133,6 +135,7 @@ export default { |
| 133 | 135 | standardStandardizedName: '', |
| 134 | 136 | sheet: { visible: false, title: '请选择', options: [], value: '' }, |
| 135 | 137 | statusStyle: statusStyle, |
| 138 | + statusMap: statusMap, | |
| 136 | 139 | detail: { |
| 137 | 140 | code: '', |
| 138 | 141 | supplier: '', |
| ... | ... | @@ -287,6 +290,13 @@ export default { |
| 287 | 290 | this.loadDetail() |
| 288 | 291 | }, |
| 289 | 292 | methods: { |
| 293 | + getShippingStatusName(name) { | |
| 294 | + const found = this.statusMap[name] || '' | |
| 295 | + return { | |
| 296 | + backgroundColor: found || '#000', | |
| 297 | + color: found ? '#fff' : '#000' | |
| 298 | + } | |
| 299 | + }, | |
| 290 | 300 | getStatusCss(name) { |
| 291 | 301 | const list = Array.isArray(this.statusStyle) ? this.statusStyle : [] |
| 292 | 302 | const found = list.find(it => it && it.text === name) || {} |
| ... | ... | @@ -455,6 +465,7 @@ export default { |
| 455 | 465 | destinationId: data.provinceId && data.cityId && data.districtId ? [data.provinceId, data.cityId, data.districtId] : '', |
| 456 | 466 | destinationLabel: data.provinceName && data.cityName && data.districtName ? `${data.provinceName} / ${data.cityName} / ${data.districtName}` : '', |
| 457 | 467 | } |
| 468 | + this.detail = await fillStandardApprovedName(this.detail) | |
| 458 | 469 | const lines = Array.isArray(data.contractDistributorLineList) ? data.contractDistributorLineList : [] |
| 459 | 470 | this.productList = lines |
| 460 | 471 | } catch (e) { | ... | ... |
| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | <view class="section"> |
| 6 | 6 | <text class="row customer">{{ detail.code }}</text> |
| 7 | 7 | <view class="row" v-if="detail.status === 'STANDARD' || detail.status === 'FORMAL'"><text class="label">{{ detail.status === 'STANDARD' ? '标准合同' : '正式合同' }}规范性审核状态</text><text class="value"><span class="info-status" :style="detail.standardApprovedName ? getStatusCss(detail.standardApprovedName) : ''" >{{ detail.standardApprovedName || '-' }}</span></text></view> |
| 8 | + <view class="row" v-if="detail.status === 'STANDARD'"><text class="label">合同状态</text><text class="value"><span class="info-status" :style="detail.shippingStatusName ? getShippingStatusName(detail.shippingStatusName) : { color: '#000'}" >{{ detail.shippingStatusName || '-' }}</span></text></view> | |
| 8 | 9 | <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-' |
| 9 | 10 | }}</text></view> |
| 10 | 11 | <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-' |
| ... | ... | @@ -114,11 +115,12 @@ |
| 114 | 115 | </template> |
| 115 | 116 | |
| 116 | 117 | <script> |
| 117 | -import { getContractApi, deleteContractApi, uploadFormalContract, uploadStandardContract, uploadSignedContractFile, statusStyle } from '@/api/contract' | |
| 118 | +import { getContractApi, deleteContractApi, uploadFormalContract, uploadStandardContract, uploadSignedContractFile, statusStyle, statusMap } from '@/api/contract' | |
| 118 | 119 | import ProductRel from './productRel.vue' |
| 119 | 120 | import DetailButtons from '@/components/detail-buttons/index.vue' |
| 120 | 121 | import FileUpload from '@/components/file-upload/index.vue' |
| 121 | 122 | import SingleSelectSheet from '@/components/single-select/index.vue' |
| 123 | +import { fillStandardApprovedName } from '@/utils/dic.js' | |
| 122 | 124 | |
| 123 | 125 | export default { |
| 124 | 126 | name: 'ContractForeignUnplanDetail', |
| ... | ... | @@ -171,6 +173,7 @@ export default { |
| 171 | 173 | }, |
| 172 | 174 | productList: [], |
| 173 | 175 | statusStyle: statusStyle, |
| 176 | + statusMap: statusMap, | |
| 174 | 177 | buttons: [{ |
| 175 | 178 | text: '编辑', |
| 176 | 179 | visible: true, |
| ... | ... | @@ -294,6 +297,13 @@ export default { |
| 294 | 297 | this.loadDetail() |
| 295 | 298 | }, |
| 296 | 299 | methods: { |
| 300 | + getShippingStatusName(name) { | |
| 301 | + const found = this.statusMap[name] || '' | |
| 302 | + return { | |
| 303 | + backgroundColor: found || '#000', | |
| 304 | + color: found ? '#fff' : '#000' | |
| 305 | + } | |
| 306 | + }, | |
| 297 | 307 | getStatusCss(name) { |
| 298 | 308 | const list = Array.isArray(this.statusStyle) ? this.statusStyle : [] |
| 299 | 309 | const found = list.find(it => it && it.text === name) || {} |
| ... | ... | @@ -465,6 +475,7 @@ export default { |
| 465 | 475 | destinationId: data.provinceId && data.cityId && data.districtId ? [data.provinceId, data.cityId, data.districtId] : '', |
| 466 | 476 | destinationLabel: data.provinceName && data.cityName && data.districtName ? `${data.provinceName} / ${data.cityName} / ${data.districtName}` : '', |
| 467 | 477 | } |
| 478 | + this.detail = await fillStandardApprovedName(this.detail) | |
| 468 | 479 | const lines = Array.isArray(data.contractDistributorLineList) ? data.contractDistributorLineList : [] |
| 469 | 480 | this.productList = lines |
| 470 | 481 | } catch (e) { | ... | ... |
| ... | ... | @@ -36,7 +36,7 @@ |
| 36 | 36 | </template> |
| 37 | 37 | </uni-list-item> |
| 38 | 38 | |
| 39 | - <uni-list-item title="授信截止日期"> | |
| 39 | + <uni-list-item title="授时截止日期"> | |
| 40 | 40 | <template v-slot:footer> |
| 41 | 41 | <uni-datetime-picker type="date" v-model="form.validityTime" /> |
| 42 | 42 | </template> |
| ... | ... | @@ -211,7 +211,7 @@ export default { |
| 211 | 211 | { key: 'company', label: '所属单位' }, |
| 212 | 212 | { key: 'materialTypeId', label: '品种' }, |
| 213 | 213 | { key: 'hasFrameworkAgreement', label: '是否签订框架合同' }, |
| 214 | - { key: 'validityTime', label: '授信截止日期' } | |
| 214 | + { key: 'validityTime', label: '授时截止日期' } | |
| 215 | 215 | ] |
| 216 | 216 | for (const it of checks) { |
| 217 | 217 | const val = this.form[it.key] | ... | ... |
| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | <view class="row"><text class="label">品种</text><text class="value">{{ form.materialTypeName }}</text></view> |
| 10 | 10 | <view class="row"><text class="label">是否签订</text><text class="value">{{ form.hasFrameworkAgreementName |
| 11 | 11 | }}</text></view> |
| 12 | - <view class="row"><text class="label">授信截止日期</text><text class="value">{{ form.validityTime }}</text></view> | |
| 12 | + <view class="row"><text class="label">授时截止日期</text><text class="value">{{ form.validityTime }}</text></view> | |
| 13 | 13 | </view> |
| 14 | 14 | </view> |
| 15 | 15 | </scroll-view> | ... | ... |
| ... | ... | @@ -36,7 +36,7 @@ |
| 36 | 36 | </template> |
| 37 | 37 | </uni-list-item> |
| 38 | 38 | |
| 39 | - <uni-list-item title="授信截止日期"> | |
| 39 | + <uni-list-item title="授时截止日期"> | |
| 40 | 40 | <template v-slot:footer> |
| 41 | 41 | <uni-datetime-picker type="date" v-model="form.validityTime" /> |
| 42 | 42 | </template> |
| ... | ... | @@ -160,7 +160,7 @@ export default { |
| 160 | 160 | { key: 'company', label: '所属单位' }, |
| 161 | 161 | { key: 'materialTypeId', label: '品种' }, |
| 162 | 162 | { key: 'hasFrameworkAgreement', label: '是否签订框架合同' }, |
| 163 | - { key: 'validityTime', label: '授信截止日期' } | |
| 163 | + { key: 'validityTime', label: '授时截止日期' } | |
| 164 | 164 | ] |
| 165 | 165 | for (const it of checks) { |
| 166 | 166 | const val = this.form[it.key] | ... | ... |
| ... | ... | @@ -5,6 +5,7 @@ statusStyl<template> |
| 5 | 5 | <view class="section"> |
| 6 | 6 | <text class="row customer">{{ detail.code }}</text> |
| 7 | 7 | <view class="row" v-if="status === 'STANDARD'"><text class="label">正式合同规范性审核</text><text class="value"><span class="info-status" :style="detail.standardApprovedName ? getStatusCss(detail.standardApprovedName) : ''" >{{ detail.standardApprovedName || '-' }}</span></text></view> |
| 8 | + <view class="row" v-if="detail.status === 'STANDARD'"><text class="label">合同状态</text><text class="value"><span class="info-status" :style="detail.shippingStatusName ? getShippingStatusName(detail.shippingStatusName) : { color: '#000'}" >{{ detail.shippingStatusName || '-' }}</span></text></view> | |
| 8 | 9 | <view class="row"><text class="label">承揽方</text><text class="value">{{ detail.supplierName || '-' |
| 9 | 10 | }}</text></view> |
| 10 | 11 | <view class="row"><text class="label">定作方</text><text class="value">{{ detail.buyerName || '-' |
| ... | ... | @@ -104,12 +105,12 @@ statusStyl<template> |
| 104 | 105 | </template> |
| 105 | 106 | |
| 106 | 107 | <script> |
| 107 | -import { getContractApi, deleteContractApi, uploadStandardContract, statusStyle } from '@/api/contract' | |
| 108 | +import { getContractApi, deleteContractApi, uploadStandardContract, statusStyle, statusMap } from '@/api/contract' | |
| 108 | 109 | import ProductRel from './productRel.vue' |
| 109 | 110 | import DetailButtons from '@/components/detail-buttons/index.vue' |
| 110 | 111 | import FileUpload from '@/components/file-upload/index.vue' |
| 111 | 112 | import SingleSelectSheet from '@/components/single-select/index.vue' |
| 112 | - | |
| 113 | +import { fillStandardApprovedName } from '@/utils/dic.js' | |
| 113 | 114 | |
| 114 | 115 | export default { |
| 115 | 116 | name: 'ContractProcessDetail', |
| ... | ... | @@ -161,6 +162,7 @@ export default { |
| 161 | 162 | }, |
| 162 | 163 | productList: [], |
| 163 | 164 | statusStyle: statusStyle, |
| 165 | + statusMap: statusMap, | |
| 164 | 166 | buttons: [{ |
| 165 | 167 | text: '编辑', |
| 166 | 168 | visible: true, |
| ... | ... | @@ -218,6 +220,13 @@ export default { |
| 218 | 220 | this.loadDetail() |
| 219 | 221 | }, |
| 220 | 222 | methods: { |
| 223 | + getShippingStatusName(name) { | |
| 224 | + const found = this.statusMap[name] || '' | |
| 225 | + return { | |
| 226 | + backgroundColor: found || '#000', | |
| 227 | + color: found ? '#fff' : '#000' | |
| 228 | + } | |
| 229 | + }, | |
| 221 | 230 | getStatusCss(name) { |
| 222 | 231 | const list = Array.isArray(this.statusStyle) ? this.statusStyle : [] |
| 223 | 232 | const found = list.find(it => it && it.text === name) || {} |
| ... | ... | @@ -359,6 +368,7 @@ export default { |
| 359 | 368 | destinationId: data.provinceId && data.cityId && data.districtId ? [data.provinceId, data.cityId, data.districtId] : '', |
| 360 | 369 | destinationLabel: data.provinceName && data.cityName && data.districtName ? `${data.provinceName} / ${data.cityName} / ${data.districtName}` : '', |
| 361 | 370 | } |
| 371 | + this.detail = await fillStandardApprovedName(this.detail) | |
| 362 | 372 | const lines = Array.isArray(data.contractStdProcessingLineList) ? data.contractStdProcessingLineList : [] |
| 363 | 373 | this.productList = lines |
| 364 | 374 | } catch (e) { | ... | ... |
| ... | ... | @@ -4,7 +4,8 @@ |
| 4 | 4 | <view class="detail-page"> |
| 5 | 5 | <view class="section"> |
| 6 | 6 | <text class="row customer">{{ detail.code }}</text> |
| 7 | - <view class="row" v-if="status === 'STANDARD'"><text class="label">正式合同规范性审核</text><text class="value"><span class="info-status" :style="detail.standardApprovedName ? getStatusCss(detail.standardApprovedName) : ''" >{{ detail.standardApprovedName || '-' }}</span></text></view> | |
| 7 | + <view class="row" v-if="detail.status === 'STANDARD'"><text class="label">正式合同规范性审核</text><text class="value"><span class="info-status" :style="detail.standardApprovedName ? getStatusCss(detail.standardApprovedName) : ''" >{{ detail.standardApprovedName || '-' }}</span></text></view> | |
| 8 | + <view class="row" v-if="detail.status === 'STANDARD'"><text class="label">合同状态</text><text class="value"><span class="info-status" :style="detail.shippingStatusName ? getShippingStatusName(detail.shippingStatusName) : { color: '#000'}" >{{ detail.shippingStatusName || '-' }}</span></text></view> | |
| 8 | 9 | <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || |
| 9 | 10 | '-'}}</text></view> |
| 10 | 11 | <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || |
| ... | ... | @@ -108,11 +109,12 @@ |
| 108 | 109 | </template> |
| 109 | 110 | |
| 110 | 111 | <script> |
| 111 | -import { getContractApi, deleteContractApi, uploadStandardContract, statusStyle } from '@/api/contract' | |
| 112 | +import { getContractApi, deleteContractApi, uploadStandardContract, statusStyle, statusMap } from '@/api/contract' | |
| 112 | 113 | import ProductRel from './productRel.vue' |
| 113 | 114 | import DetailButtons from '@/components/detail-buttons/index.vue' |
| 114 | 115 | import FileUpload from '@/components/file-upload/index.vue' |
| 115 | 116 | import SingleSelectSheet from '@/components/single-select/index.vue' |
| 117 | +import { getDicByCodes, getDicName } from '@/utils/dic.js' | |
| 116 | 118 | |
| 117 | 119 | export default { |
| 118 | 120 | name: 'ContractRetailDetail', |
| ... | ... | @@ -198,6 +200,8 @@ export default { |
| 198 | 200 | }, |
| 199 | 201 | ], |
| 200 | 202 | statusStyle: statusStyle, |
| 203 | + statusMap: statusMap, | |
| 204 | + dicOptions: { AUDIT_STATUS: [] } | |
| 201 | 205 | } |
| 202 | 206 | }, |
| 203 | 207 | computed: { |
| ... | ... | @@ -219,6 +223,7 @@ export default { |
| 219 | 223 | const status = options && options.status ? options.status : '' |
| 220 | 224 | this.id = id |
| 221 | 225 | this.status = status |
| 226 | + this.loadAuditStatusDic() | |
| 222 | 227 | this.loadDetail() |
| 223 | 228 | }, |
| 224 | 229 | methods: { |
| ... | ... | @@ -230,6 +235,27 @@ export default { |
| 230 | 235 | backgroundColor: found.bgColor || '#000' |
| 231 | 236 | } |
| 232 | 237 | }, |
| 238 | + async loadAuditStatusDic() { | |
| 239 | + try { | |
| 240 | + const results = await getDicByCodes(['AUDIT_STATUS']) | |
| 241 | + this.dicOptions.AUDIT_STATUS = (results.AUDIT_STATUS && results.AUDIT_STATUS.data) || [] | |
| 242 | + this.refreshStandardApprovedName() | |
| 243 | + } catch (e) { | |
| 244 | + this.dicOptions.AUDIT_STATUS = [] | |
| 245 | + } | |
| 246 | + }, | |
| 247 | + refreshStandardApprovedName() { | |
| 248 | + const code = this.detail && this.detail.standardApproved | |
| 249 | + const name = getDicName('AUDIT_STATUS', code, this.dicOptions.AUDIT_STATUS) | |
| 250 | + this.detail = { ...this.detail, standardApprovedName: name } | |
| 251 | + }, | |
| 252 | + getShippingStatusName(name) { | |
| 253 | + const found = this.statusMap[name] || '' | |
| 254 | + return { | |
| 255 | + backgroundColor: found || '#000', | |
| 256 | + color: found ? '#fff' : '#000' | |
| 257 | + } | |
| 258 | + }, | |
| 233 | 259 | onUploadSubmit() { |
| 234 | 260 | if (!this.fileInfo.id) { |
| 235 | 261 | uni.showToast({ |
| ... | ... | @@ -362,6 +388,7 @@ export default { |
| 362 | 388 | } |
| 363 | 389 | const lines = Array.isArray(data.contractDistributorLineList) ? data.contractDistributorLineList : [] |
| 364 | 390 | this.productList = lines |
| 391 | + this.refreshStandardApprovedName() | |
| 365 | 392 | } catch (e) { |
| 366 | 393 | this.detail = { ...this.detail } |
| 367 | 394 | this.productList = [] | ... | ... |
| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | <view class="section"> |
| 6 | 6 | <text class="row customer">{{ detail.code }}</text> |
| 7 | 7 | <view class="row" v-if="detail.status === 'STANDARD' || detail.status === 'FORMAL'"><text class="label">{{ detail.status === 'STANDARD' ? '标准合同' : '正式合同' }}规范性审核状态</text><text class="value"><span class="info-status" :style="detail.standardApprovedName ? getStatusCss(detail.standardApprovedName) : ''" >{{ detail.standardApprovedName || '-' }}</span></text></view> |
| 8 | + <view class="row" v-if="detail.status === 'STANDARD'"><text class="label">合同状态</text><text class="value"><span class="info-status" :style="detail.shippingStatusName ? getShippingStatusName(detail.shippingStatusName) : { color: '#000'}" >{{ detail.shippingStatusName || '-' }}</span></text></view> | |
| 8 | 9 | <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-' |
| 9 | 10 | }}</text></view> |
| 10 | 11 | <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-' |
| ... | ... | @@ -108,7 +109,8 @@ |
| 108 | 109 | </template> |
| 109 | 110 | |
| 110 | 111 | <script> |
| 111 | -import { getContractApi, deleteContractApi, uploadFormalContract, uploadStandardContract, statusStyle } from '@/api/contract' | |
| 112 | +import { getContractApi, deleteContractApi, uploadFormalContract, uploadStandardContract, statusStyle, statusMap } from '@/api/contract' | |
| 113 | +import { fillStandardApprovedName } from '@/utils/dic.js' | |
| 112 | 114 | import ProductRel from './productRel.vue' |
| 113 | 115 | import DetailButtons from '@/components/detail-buttons/index.vue' |
| 114 | 116 | import FileUpload from '@/components/file-upload/index.vue' |
| ... | ... | @@ -162,6 +164,7 @@ export default { |
| 162 | 164 | }, |
| 163 | 165 | productList: [], |
| 164 | 166 | statusStyle: statusStyle, |
| 167 | + statusMap: statusMap, | |
| 165 | 168 | buttons: [{ |
| 166 | 169 | text: '编辑', |
| 167 | 170 | visible: true, |
| ... | ... | @@ -273,6 +276,13 @@ export default { |
| 273 | 276 | this.loadDetail() |
| 274 | 277 | }, |
| 275 | 278 | methods: { |
| 279 | + getShippingStatusName(name) { | |
| 280 | + const found = this.statusMap[name] || '' | |
| 281 | + return { | |
| 282 | + backgroundColor: found || '#000', | |
| 283 | + color: found ? '#fff' : '#000' | |
| 284 | + } | |
| 285 | + }, | |
| 276 | 286 | onDelete() { |
| 277 | 287 | uni.showModal({ |
| 278 | 288 | title: '确认删除', |
| ... | ... | @@ -425,6 +435,7 @@ export default { |
| 425 | 435 | destinationId: data.provinceId && data.cityId && data.districtId ? [data.provinceId, data.cityId, data.districtId] : '', |
| 426 | 436 | destinationLabel: data.provinceName && data.cityName && data.districtName ? `${data.provinceName} / ${data.cityName} / ${data.districtName}` : '', |
| 427 | 437 | } |
| 438 | + this.detail = await fillStandardApprovedName(this.detail) | |
| 428 | 439 | const lines = Array.isArray(data.contractDistributorLineList) ? data.contractDistributorLineList : [] |
| 429 | 440 | this.productList = lines |
| 430 | 441 | } catch (e) { |
| ... | ... | @@ -547,4 +558,4 @@ export default { |
| 547 | 558 | color: rgba(0, 0, 0, 0.6); |
| 548 | 559 | font-size: 32rpx; |
| 549 | 560 | } |
| 550 | -</style> | |
| \ No newline at end of file | ||
| 561 | +</style> | ... | ... |
| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | <view class="section"> |
| 6 | 6 | <text class="row customer">{{ detail.code }}</text> |
| 7 | 7 | <view class="row" v-if="detail.status === 'STANDARD' || detail.status === 'FORMAL'"><text class="label">{{ detail.status === 'STANDARD' ? '标准合同' : '正式合同' }}规范性审核状态</text><text class="value"><span class="info-status" :style="detail.standardApprovedName ? getStatusCss(detail.standardApprovedName) : ''" >{{ detail.standardApprovedName || '-' }}</span></text></view> |
| 8 | + <view class="row" v-if="detail.status === 'STANDARD'"><text class="label">合同状态</text><text class="value"><span class="info-status" :style="detail.shippingStatusName ? getShippingStatusName(detail.shippingStatusName) :{ color: '#000'}" >{{ detail.shippingStatusName || '-' }}</span></text></view> | |
| 8 | 9 | <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-' |
| 9 | 10 | }}</text></view> |
| 10 | 11 | <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-' |
| ... | ... | @@ -114,11 +115,12 @@ |
| 114 | 115 | </template> |
| 115 | 116 | |
| 116 | 117 | <script> |
| 117 | -import { getContractApi, deleteContractApi, uploadFormalContract, statusStyle, uploadStandardContract } from '@/api/contract' | |
| 118 | +import { getContractApi, deleteContractApi, uploadFormalContract, statusStyle, uploadStandardContract, statusMap } from '@/api/contract' | |
| 118 | 119 | import ProductRel from './productRel.vue' |
| 119 | 120 | import DetailButtons from '@/components/detail-buttons/index.vue' |
| 120 | 121 | import FileUpload from '@/components/file-upload/index.vue' |
| 121 | 122 | import SingleSelectSheet from '@/components/single-select/index.vue' |
| 123 | +import { fillStandardApprovedName } from '@/utils/dic.js' | |
| 122 | 124 | |
| 123 | 125 | export default { |
| 124 | 126 | name: 'ContractUnplanDetail', |
| ... | ... | @@ -170,6 +172,7 @@ export default { |
| 170 | 172 | packaging: '' |
| 171 | 173 | }, |
| 172 | 174 | statusStyle: statusStyle, |
| 175 | + statusMap: statusMap, | |
| 173 | 176 | productList: [], |
| 174 | 177 | buttons: [{ |
| 175 | 178 | text: '编辑', |
| ... | ... | @@ -287,6 +290,14 @@ export default { |
| 287 | 290 | this.loadDetail() |
| 288 | 291 | }, |
| 289 | 292 | methods: { |
| 293 | + getShippingStatusName(name) { | |
| 294 | + const found = this.statusMap[name] || '' | |
| 295 | + console.log(found,'found') | |
| 296 | + return { | |
| 297 | + backgroundColor: found || '#000', | |
| 298 | + color: found ? '#fff' : '#000' | |
| 299 | + } | |
| 300 | + }, | |
| 290 | 301 | getStatusCss(name) { |
| 291 | 302 | const list = Array.isArray(this.statusStyle) ? this.statusStyle : [] |
| 292 | 303 | const found = list.find(it => it && it.text === name) || {} |
| ... | ... | @@ -453,6 +464,7 @@ export default { |
| 453 | 464 | destinationId: data.provinceId && data.cityId && data.districtId ? [data.provinceId, data.cityId, data.districtId] : '', |
| 454 | 465 | destinationLabel: data.provinceName && data.cityName && data.districtName ? `${data.provinceName} / ${data.cityName} / ${data.districtName}` : '', |
| 455 | 466 | } |
| 467 | + this.detail = await fillStandardApprovedName(this.detail) | |
| 456 | 468 | const lines = Array.isArray(data.contractDistributorLineList) ? data.contractDistributorLineList : [] |
| 457 | 469 | this.productList = lines |
| 458 | 470 | } catch (e) { | ... | ... |
| ... | ... | @@ -38,3 +38,18 @@ export function getDicName(code, value, items = []) { |
| 38 | 38 | const item = list.find(it => it && it.code === value); |
| 39 | 39 | return item ? item.name : value; |
| 40 | 40 | } |
| 41 | + | |
| 42 | +export function getAuditStatusName(value, items = []) { | |
| 43 | + return getDicName('AUDIT_STATUS', value, items); | |
| 44 | +} | |
| 45 | + | |
| 46 | +export async function getAuditStatusOptions() { | |
| 47 | + const results = await getDicByCodes(['AUDIT_STATUS']); | |
| 48 | + return (results.AUDIT_STATUS && results.AUDIT_STATUS.data) || []; | |
| 49 | +} | |
| 50 | + | |
| 51 | +export async function fillStandardApprovedName(detail = {}) { | |
| 52 | + const items = await getAuditStatusOptions(); | |
| 53 | + const name = getAuditStatusName(detail && detail.standardApproved, items); | |
| 54 | + return { ...detail, standardApprovedName: name }; | |
| 55 | +} | ... | ... |