Commit 4a7493ddc340d5018642939f3caff3b26c67b821

Authored by gesilong
2 parents d9a12bd9 ca15bfb1

Merge branch 'cjerp-1.0' into publish_cjerp

@@ -12,6 +12,7 @@ export const statusMap = { @@ -12,6 +12,7 @@ export const statusMap = {
12 '生产中': '#2BA471', 12 '生产中': '#2BA471',
13 '审核通过': '#2BA471', 13 '审核通过': '#2BA471',
14 '审核中': '#3D48A3', 14 '审核中': '#3D48A3',
  15 + '审批中': '#3D48A3',
15 '已签收': '#E7E7E7', 16 '已签收': '#E7E7E7',
16 '已取消': '#000', 17 '已取消': '#000',
17 '已发货': '#D54941', 18 '已发货': '#D54941',
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 <view class="section"> 5 <view class="section">
6 <text class="row customer">{{ detail.code }}</text> 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="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 <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-' 9 <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-'
9 }}</text></view> 10 }}</text></view>
10 <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-' 11 <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-'
@@ -106,11 +107,13 @@ @@ -106,11 +107,13 @@
106 </template> 107 </template>
107 108
108 <script> 109 <script>
109 -import { getContractApi, deleteContractApi, uploadStandardContract, uploadSignedContractFile, statusStyle} from '@/api/contract' 110 +import { getContractApi, deleteContractApi, uploadStandardContract, uploadSignedContractFile, statusStyle, statusMap } from '@/api/contract'
110 import ProductRel from './productRel.vue' 111 import ProductRel from './productRel.vue'
111 import DetailButtons from '@/components/detail-buttons/index.vue' 112 import DetailButtons from '@/components/detail-buttons/index.vue'
112 import FileUpload from '@/components/file-upload/index.vue' 113 import FileUpload from '@/components/file-upload/index.vue'
113 import SingleSelectSheet from '@/components/single-select/index.vue' 114 import SingleSelectSheet from '@/components/single-select/index.vue'
  115 +import { fillStandardApprovedName } from '@/utils/dic.js'
  116 +
114 export default { 117 export default {
115 name: 'ContractForeignStdDetail', 118 name: 'ContractForeignStdDetail',
116 components: { ProductRel, DetailButtons, FileUpload, SingleSelectSheet }, 119 components: { ProductRel, DetailButtons, FileUpload, SingleSelectSheet },
@@ -161,6 +164,7 @@ export default { @@ -161,6 +164,7 @@ export default {
161 packaging: '' 164 packaging: ''
162 }, 165 },
163 statusStyle: statusStyle, 166 statusStyle: statusStyle,
  167 + statusMap: statusMap,
164 productList: [], 168 productList: [],
165 buttons: [{ 169 buttons: [{
166 text: '编辑', 170 text: '编辑',
@@ -226,6 +230,13 @@ export default { @@ -226,6 +230,13 @@ export default {
226 this.loadDetail() 230 this.loadDetail()
227 }, 231 },
228 methods: { 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 getStatusCss(name) { 240 getStatusCss(name) {
230 const list = Array.isArray(this.statusStyle) ? this.statusStyle : [] 241 const list = Array.isArray(this.statusStyle) ? this.statusStyle : []
231 const found = list.find(it => it && it.text === name) || {} 242 const found = list.find(it => it && it.text === name) || {}
@@ -373,6 +384,7 @@ export default { @@ -373,6 +384,7 @@ export default {
373 destinationId: data.provinceId && data.cityId && data.districtId ? [data.provinceId, data.cityId, data.districtId] : '', 384 destinationId: data.provinceId && data.cityId && data.districtId ? [data.provinceId, data.cityId, data.districtId] : '',
374 destinationLabel: data.provinceName && data.cityName && data.districtName ? `${data.provinceName} / ${data.cityName} / ${data.districtName}` : '', 385 destinationLabel: data.provinceName && data.cityName && data.districtName ? `${data.provinceName} / ${data.cityName} / ${data.districtName}` : '',
375 } 386 }
  387 + this.detail = await fillStandardApprovedName(this.detail)
376 const lines = Array.isArray(data.contractDistributorLineList) ? data.contractDistributorLineList : [] 388 const lines = Array.isArray(data.contractDistributorLineList) ? data.contractDistributorLineList : []
377 this.productList = lines 389 this.productList = lines
378 } catch (e) { 390 } catch (e) {
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 <view class="section"> 5 <view class="section">
6 <text class="row customer">{{ detail.code }}</text> 6 <text class="row customer">{{ detail.code }}</text>
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> 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 <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-' 9 <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-'
9 }}</text></view> 10 }}</text></view>
10 <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-' 11 <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-'
@@ -113,11 +114,12 @@ @@ -113,11 +114,12 @@
113 </template> 114 </template>
114 115
115 <script> 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 import ProductRel from './productRel.vue' 118 import ProductRel from './productRel.vue'
118 import DetailButtons from '@/components/detail-buttons/index.vue' 119 import DetailButtons from '@/components/detail-buttons/index.vue'
119 import FileUpload from '@/components/file-upload/index.vue' 120 import FileUpload from '@/components/file-upload/index.vue'
120 import SingleSelectSheet from '@/components/single-select/index.vue' 121 import SingleSelectSheet from '@/components/single-select/index.vue'
  122 +import { fillStandardApprovedName } from '@/utils/dic.js'
121 123
122 export default { 124 export default {
123 name: 'ContractForeignStockDetail', 125 name: 'ContractForeignStockDetail',
@@ -133,6 +135,7 @@ export default { @@ -133,6 +135,7 @@ export default {
133 standardStandardizedName: '', 135 standardStandardizedName: '',
134 sheet: { visible: false, title: '请选择', options: [], value: '' }, 136 sheet: { visible: false, title: '请选择', options: [], value: '' },
135 statusStyle: statusStyle, 137 statusStyle: statusStyle,
  138 + statusMap: statusMap,
136 detail: { 139 detail: {
137 code: '', 140 code: '',
138 supplier: '', 141 supplier: '',
@@ -287,6 +290,13 @@ export default { @@ -287,6 +290,13 @@ export default {
287 this.loadDetail() 290 this.loadDetail()
288 }, 291 },
289 methods: { 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 getStatusCss(name) { 300 getStatusCss(name) {
291 const list = Array.isArray(this.statusStyle) ? this.statusStyle : [] 301 const list = Array.isArray(this.statusStyle) ? this.statusStyle : []
292 const found = list.find(it => it && it.text === name) || {} 302 const found = list.find(it => it && it.text === name) || {}
@@ -455,6 +465,7 @@ export default { @@ -455,6 +465,7 @@ export default {
455 destinationId: data.provinceId && data.cityId && data.districtId ? [data.provinceId, data.cityId, data.districtId] : '', 465 destinationId: data.provinceId && data.cityId && data.districtId ? [data.provinceId, data.cityId, data.districtId] : '',
456 destinationLabel: data.provinceName && data.cityName && data.districtName ? `${data.provinceName} / ${data.cityName} / ${data.districtName}` : '', 466 destinationLabel: data.provinceName && data.cityName && data.districtName ? `${data.provinceName} / ${data.cityName} / ${data.districtName}` : '',
457 } 467 }
  468 + this.detail = await fillStandardApprovedName(this.detail)
458 const lines = Array.isArray(data.contractDistributorLineList) ? data.contractDistributorLineList : [] 469 const lines = Array.isArray(data.contractDistributorLineList) ? data.contractDistributorLineList : []
459 this.productList = lines 470 this.productList = lines
460 } catch (e) { 471 } catch (e) {
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 <view class="section"> 5 <view class="section">
6 <text class="row customer">{{ detail.code }}</text> 6 <text class="row customer">{{ detail.code }}</text>
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> 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 <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-' 9 <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-'
9 }}</text></view> 10 }}</text></view>
10 <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-' 11 <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-'
@@ -114,11 +115,12 @@ @@ -114,11 +115,12 @@
114 </template> 115 </template>
115 116
116 <script> 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 import ProductRel from './productRel.vue' 119 import ProductRel from './productRel.vue'
119 import DetailButtons from '@/components/detail-buttons/index.vue' 120 import DetailButtons from '@/components/detail-buttons/index.vue'
120 import FileUpload from '@/components/file-upload/index.vue' 121 import FileUpload from '@/components/file-upload/index.vue'
121 import SingleSelectSheet from '@/components/single-select/index.vue' 122 import SingleSelectSheet from '@/components/single-select/index.vue'
  123 +import { fillStandardApprovedName } from '@/utils/dic.js'
122 124
123 export default { 125 export default {
124 name: 'ContractForeignUnplanDetail', 126 name: 'ContractForeignUnplanDetail',
@@ -171,6 +173,7 @@ export default { @@ -171,6 +173,7 @@ export default {
171 }, 173 },
172 productList: [], 174 productList: [],
173 statusStyle: statusStyle, 175 statusStyle: statusStyle,
  176 + statusMap: statusMap,
174 buttons: [{ 177 buttons: [{
175 text: '编辑', 178 text: '编辑',
176 visible: true, 179 visible: true,
@@ -294,6 +297,13 @@ export default { @@ -294,6 +297,13 @@ export default {
294 this.loadDetail() 297 this.loadDetail()
295 }, 298 },
296 methods: { 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 getStatusCss(name) { 307 getStatusCss(name) {
298 const list = Array.isArray(this.statusStyle) ? this.statusStyle : [] 308 const list = Array.isArray(this.statusStyle) ? this.statusStyle : []
299 const found = list.find(it => it && it.text === name) || {} 309 const found = list.find(it => it && it.text === name) || {}
@@ -465,6 +475,7 @@ export default { @@ -465,6 +475,7 @@ export default {
465 destinationId: data.provinceId && data.cityId && data.districtId ? [data.provinceId, data.cityId, data.districtId] : '', 475 destinationId: data.provinceId && data.cityId && data.districtId ? [data.provinceId, data.cityId, data.districtId] : '',
466 destinationLabel: data.provinceName && data.cityName && data.districtName ? `${data.provinceName} / ${data.cityName} / ${data.districtName}` : '', 476 destinationLabel: data.provinceName && data.cityName && data.districtName ? `${data.provinceName} / ${data.cityName} / ${data.districtName}` : '',
467 } 477 }
  478 + this.detail = await fillStandardApprovedName(this.detail)
468 const lines = Array.isArray(data.contractDistributorLineList) ? data.contractDistributorLineList : [] 479 const lines = Array.isArray(data.contractDistributorLineList) ? data.contractDistributorLineList : []
469 this.productList = lines 480 this.productList = lines
470 } catch (e) { 481 } catch (e) {
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 </template> 36 </template>
37 </uni-list-item> 37 </uni-list-item>
38 38
39 - <uni-list-item title="授截止日期"> 39 + <uni-list-item title="授截止日期">
40 <template v-slot:footer> 40 <template v-slot:footer>
41 <uni-datetime-picker type="date" v-model="form.validityTime" /> 41 <uni-datetime-picker type="date" v-model="form.validityTime" />
42 </template> 42 </template>
@@ -211,7 +211,7 @@ export default { @@ -211,7 +211,7 @@ export default {
211 { key: 'company', label: '所属单位' }, 211 { key: 'company', label: '所属单位' },
212 { key: 'materialTypeId', label: '品种' }, 212 { key: 'materialTypeId', label: '品种' },
213 { key: 'hasFrameworkAgreement', label: '是否签订框架合同' }, 213 { key: 'hasFrameworkAgreement', label: '是否签订框架合同' },
214 - { key: 'validityTime', label: '授截止日期' } 214 + { key: 'validityTime', label: '授截止日期' }
215 ] 215 ]
216 for (const it of checks) { 216 for (const it of checks) {
217 const val = this.form[it.key] 217 const val = this.form[it.key]
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 <view class="row"><text class="label">品种</text><text class="value">{{ form.materialTypeName }}</text></view> 9 <view class="row"><text class="label">品种</text><text class="value">{{ form.materialTypeName }}</text></view>
10 <view class="row"><text class="label">是否签订</text><text class="value">{{ form.hasFrameworkAgreementName 10 <view class="row"><text class="label">是否签订</text><text class="value">{{ form.hasFrameworkAgreementName
11 }}</text></view> 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 </view> 13 </view>
14 </view> 14 </view>
15 </scroll-view> 15 </scroll-view>
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 </template> 36 </template>
37 </uni-list-item> 37 </uni-list-item>
38 38
39 - <uni-list-item title="授截止日期"> 39 + <uni-list-item title="授截止日期">
40 <template v-slot:footer> 40 <template v-slot:footer>
41 <uni-datetime-picker type="date" v-model="form.validityTime" /> 41 <uni-datetime-picker type="date" v-model="form.validityTime" />
42 </template> 42 </template>
@@ -160,7 +160,7 @@ export default { @@ -160,7 +160,7 @@ export default {
160 { key: 'company', label: '所属单位' }, 160 { key: 'company', label: '所属单位' },
161 { key: 'materialTypeId', label: '品种' }, 161 { key: 'materialTypeId', label: '品种' },
162 { key: 'hasFrameworkAgreement', label: '是否签订框架合同' }, 162 { key: 'hasFrameworkAgreement', label: '是否签订框架合同' },
163 - { key: 'validityTime', label: '授截止日期' } 163 + { key: 'validityTime', label: '授截止日期' }
164 ] 164 ]
165 for (const it of checks) { 165 for (const it of checks) {
166 const val = this.form[it.key] 166 const val = this.form[it.key]
@@ -5,6 +5,7 @@ statusStyl<template> @@ -5,6 +5,7 @@ statusStyl<template>
5 <view class="section"> 5 <view class="section">
6 <text class="row customer">{{ detail.code }}</text> 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="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 <view class="row"><text class="label">承揽方</text><text class="value">{{ detail.supplierName || '-' 9 <view class="row"><text class="label">承揽方</text><text class="value">{{ detail.supplierName || '-'
9 }}</text></view> 10 }}</text></view>
10 <view class="row"><text class="label">定作方</text><text class="value">{{ detail.buyerName || '-' 11 <view class="row"><text class="label">定作方</text><text class="value">{{ detail.buyerName || '-'
@@ -104,12 +105,12 @@ statusStyl<template> @@ -104,12 +105,12 @@ statusStyl<template>
104 </template> 105 </template>
105 106
106 <script> 107 <script>
107 -import { getContractApi, deleteContractApi, uploadStandardContract, statusStyle } from '@/api/contract' 108 +import { getContractApi, deleteContractApi, uploadStandardContract, statusStyle, statusMap } from '@/api/contract'
108 import ProductRel from './productRel.vue' 109 import ProductRel from './productRel.vue'
109 import DetailButtons from '@/components/detail-buttons/index.vue' 110 import DetailButtons from '@/components/detail-buttons/index.vue'
110 import FileUpload from '@/components/file-upload/index.vue' 111 import FileUpload from '@/components/file-upload/index.vue'
111 import SingleSelectSheet from '@/components/single-select/index.vue' 112 import SingleSelectSheet from '@/components/single-select/index.vue'
112 - 113 +import { fillStandardApprovedName } from '@/utils/dic.js'
113 114
114 export default { 115 export default {
115 name: 'ContractProcessDetail', 116 name: 'ContractProcessDetail',
@@ -161,6 +162,7 @@ export default { @@ -161,6 +162,7 @@ export default {
161 }, 162 },
162 productList: [], 163 productList: [],
163 statusStyle: statusStyle, 164 statusStyle: statusStyle,
  165 + statusMap: statusMap,
164 buttons: [{ 166 buttons: [{
165 text: '编辑', 167 text: '编辑',
166 visible: true, 168 visible: true,
@@ -218,6 +220,13 @@ export default { @@ -218,6 +220,13 @@ export default {
218 this.loadDetail() 220 this.loadDetail()
219 }, 221 },
220 methods: { 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 getStatusCss(name) { 230 getStatusCss(name) {
222 const list = Array.isArray(this.statusStyle) ? this.statusStyle : [] 231 const list = Array.isArray(this.statusStyle) ? this.statusStyle : []
223 const found = list.find(it => it && it.text === name) || {} 232 const found = list.find(it => it && it.text === name) || {}
@@ -359,6 +368,7 @@ export default { @@ -359,6 +368,7 @@ export default {
359 destinationId: data.provinceId && data.cityId && data.districtId ? [data.provinceId, data.cityId, data.districtId] : '', 368 destinationId: data.provinceId && data.cityId && data.districtId ? [data.provinceId, data.cityId, data.districtId] : '',
360 destinationLabel: data.provinceName && data.cityName && data.districtName ? `${data.provinceName} / ${data.cityName} / ${data.districtName}` : '', 369 destinationLabel: data.provinceName && data.cityName && data.districtName ? `${data.provinceName} / ${data.cityName} / ${data.districtName}` : '',
361 } 370 }
  371 + this.detail = await fillStandardApprovedName(this.detail)
362 const lines = Array.isArray(data.contractStdProcessingLineList) ? data.contractStdProcessingLineList : [] 372 const lines = Array.isArray(data.contractStdProcessingLineList) ? data.contractStdProcessingLineList : []
363 this.productList = lines 373 this.productList = lines
364 } catch (e) { 374 } catch (e) {
@@ -4,7 +4,8 @@ @@ -4,7 +4,8 @@
4 <view class="detail-page"> 4 <view class="detail-page">
5 <view class="section"> 5 <view class="section">
6 <text class="row customer">{{ detail.code }}</text> 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 <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || 9 <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName ||
9 '-'}}</text></view> 10 '-'}}</text></view>
10 <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || 11 <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName ||
@@ -108,11 +109,12 @@ @@ -108,11 +109,12 @@
108 </template> 109 </template>
109 110
110 <script> 111 <script>
111 -import { getContractApi, deleteContractApi, uploadStandardContract, statusStyle } from '@/api/contract' 112 +import { getContractApi, deleteContractApi, uploadStandardContract, statusStyle, statusMap } from '@/api/contract'
112 import ProductRel from './productRel.vue' 113 import ProductRel from './productRel.vue'
113 import DetailButtons from '@/components/detail-buttons/index.vue' 114 import DetailButtons from '@/components/detail-buttons/index.vue'
114 import FileUpload from '@/components/file-upload/index.vue' 115 import FileUpload from '@/components/file-upload/index.vue'
115 import SingleSelectSheet from '@/components/single-select/index.vue' 116 import SingleSelectSheet from '@/components/single-select/index.vue'
  117 +import { getDicByCodes, getDicName } from '@/utils/dic.js'
116 118
117 export default { 119 export default {
118 name: 'ContractRetailDetail', 120 name: 'ContractRetailDetail',
@@ -198,6 +200,8 @@ export default { @@ -198,6 +200,8 @@ export default {
198 }, 200 },
199 ], 201 ],
200 statusStyle: statusStyle, 202 statusStyle: statusStyle,
  203 + statusMap: statusMap,
  204 + dicOptions: { AUDIT_STATUS: [] }
201 } 205 }
202 }, 206 },
203 computed: { 207 computed: {
@@ -219,6 +223,7 @@ export default { @@ -219,6 +223,7 @@ export default {
219 const status = options && options.status ? options.status : '' 223 const status = options && options.status ? options.status : ''
220 this.id = id 224 this.id = id
221 this.status = status 225 this.status = status
  226 + this.loadAuditStatusDic()
222 this.loadDetail() 227 this.loadDetail()
223 }, 228 },
224 methods: { 229 methods: {
@@ -230,6 +235,27 @@ export default { @@ -230,6 +235,27 @@ export default {
230 backgroundColor: found.bgColor || '#000' 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 onUploadSubmit() { 259 onUploadSubmit() {
234 if (!this.fileInfo.id) { 260 if (!this.fileInfo.id) {
235 uni.showToast({ 261 uni.showToast({
@@ -362,6 +388,7 @@ export default { @@ -362,6 +388,7 @@ export default {
362 } 388 }
363 const lines = Array.isArray(data.contractDistributorLineList) ? data.contractDistributorLineList : [] 389 const lines = Array.isArray(data.contractDistributorLineList) ? data.contractDistributorLineList : []
364 this.productList = lines 390 this.productList = lines
  391 + this.refreshStandardApprovedName()
365 } catch (e) { 392 } catch (e) {
366 this.detail = { ...this.detail } 393 this.detail = { ...this.detail }
367 this.productList = [] 394 this.productList = []
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 <view class="section"> 5 <view class="section">
6 <text class="row customer">{{ detail.code }}</text> 6 <text class="row customer">{{ detail.code }}</text>
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> 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 <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-' 9 <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-'
9 }}</text></view> 10 }}</text></view>
10 <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-' 11 <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-'
@@ -108,7 +109,8 @@ @@ -108,7 +109,8 @@
108 </template> 109 </template>
109 110
110 <script> 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 import ProductRel from './productRel.vue' 114 import ProductRel from './productRel.vue'
113 import DetailButtons from '@/components/detail-buttons/index.vue' 115 import DetailButtons from '@/components/detail-buttons/index.vue'
114 import FileUpload from '@/components/file-upload/index.vue' 116 import FileUpload from '@/components/file-upload/index.vue'
@@ -162,6 +164,7 @@ export default { @@ -162,6 +164,7 @@ export default {
162 }, 164 },
163 productList: [], 165 productList: [],
164 statusStyle: statusStyle, 166 statusStyle: statusStyle,
  167 + statusMap: statusMap,
165 buttons: [{ 168 buttons: [{
166 text: '编辑', 169 text: '编辑',
167 visible: true, 170 visible: true,
@@ -273,6 +276,13 @@ export default { @@ -273,6 +276,13 @@ export default {
273 this.loadDetail() 276 this.loadDetail()
274 }, 277 },
275 methods: { 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 onDelete() { 286 onDelete() {
277 uni.showModal({ 287 uni.showModal({
278 title: '确认删除', 288 title: '确认删除',
@@ -425,6 +435,7 @@ export default { @@ -425,6 +435,7 @@ export default {
425 destinationId: data.provinceId && data.cityId && data.districtId ? [data.provinceId, data.cityId, data.districtId] : '', 435 destinationId: data.provinceId && data.cityId && data.districtId ? [data.provinceId, data.cityId, data.districtId] : '',
426 destinationLabel: data.provinceName && data.cityName && data.districtName ? `${data.provinceName} / ${data.cityName} / ${data.districtName}` : '', 436 destinationLabel: data.provinceName && data.cityName && data.districtName ? `${data.provinceName} / ${data.cityName} / ${data.districtName}` : '',
427 } 437 }
  438 + this.detail = await fillStandardApprovedName(this.detail)
428 const lines = Array.isArray(data.contractDistributorLineList) ? data.contractDistributorLineList : [] 439 const lines = Array.isArray(data.contractDistributorLineList) ? data.contractDistributorLineList : []
429 this.productList = lines 440 this.productList = lines
430 } catch (e) { 441 } catch (e) {
@@ -547,4 +558,4 @@ export default { @@ -547,4 +558,4 @@ export default {
547 color: rgba(0, 0, 0, 0.6); 558 color: rgba(0, 0, 0, 0.6);
548 font-size: 32rpx; 559 font-size: 32rpx;
549 } 560 }
550 -</style>  
  561 +</style>
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 <view class="section"> 5 <view class="section">
6 <text class="row customer">{{ detail.code }}</text> 6 <text class="row customer">{{ detail.code }}</text>
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> 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 <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-' 9 <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-'
9 }}</text></view> 10 }}</text></view>
10 <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-' 11 <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-'
@@ -114,11 +115,12 @@ @@ -114,11 +115,12 @@
114 </template> 115 </template>
115 116
116 <script> 117 <script>
117 -import { getContractApi, deleteContractApi, uploadFormalContract, statusStyle, uploadStandardContract } from '@/api/contract' 118 +import { getContractApi, deleteContractApi, uploadFormalContract, statusStyle, uploadStandardContract, statusMap } from '@/api/contract'
118 import ProductRel from './productRel.vue' 119 import ProductRel from './productRel.vue'
119 import DetailButtons from '@/components/detail-buttons/index.vue' 120 import DetailButtons from '@/components/detail-buttons/index.vue'
120 import FileUpload from '@/components/file-upload/index.vue' 121 import FileUpload from '@/components/file-upload/index.vue'
121 import SingleSelectSheet from '@/components/single-select/index.vue' 122 import SingleSelectSheet from '@/components/single-select/index.vue'
  123 +import { fillStandardApprovedName } from '@/utils/dic.js'
122 124
123 export default { 125 export default {
124 name: 'ContractUnplanDetail', 126 name: 'ContractUnplanDetail',
@@ -170,6 +172,7 @@ export default { @@ -170,6 +172,7 @@ export default {
170 packaging: '' 172 packaging: ''
171 }, 173 },
172 statusStyle: statusStyle, 174 statusStyle: statusStyle,
  175 + statusMap: statusMap,
173 productList: [], 176 productList: [],
174 buttons: [{ 177 buttons: [{
175 text: '编辑', 178 text: '编辑',
@@ -287,6 +290,14 @@ export default { @@ -287,6 +290,14 @@ export default {
287 this.loadDetail() 290 this.loadDetail()
288 }, 291 },
289 methods: { 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 getStatusCss(name) { 301 getStatusCss(name) {
291 const list = Array.isArray(this.statusStyle) ? this.statusStyle : [] 302 const list = Array.isArray(this.statusStyle) ? this.statusStyle : []
292 const found = list.find(it => it && it.text === name) || {} 303 const found = list.find(it => it && it.text === name) || {}
@@ -453,6 +464,7 @@ export default { @@ -453,6 +464,7 @@ export default {
453 destinationId: data.provinceId && data.cityId && data.districtId ? [data.provinceId, data.cityId, data.districtId] : '', 464 destinationId: data.provinceId && data.cityId && data.districtId ? [data.provinceId, data.cityId, data.districtId] : '',
454 destinationLabel: data.provinceName && data.cityName && data.districtName ? `${data.provinceName} / ${data.cityName} / ${data.districtName}` : '', 465 destinationLabel: data.provinceName && data.cityName && data.districtName ? `${data.provinceName} / ${data.cityName} / ${data.districtName}` : '',
455 } 466 }
  467 + this.detail = await fillStandardApprovedName(this.detail)
456 const lines = Array.isArray(data.contractDistributorLineList) ? data.contractDistributorLineList : [] 468 const lines = Array.isArray(data.contractDistributorLineList) ? data.contractDistributorLineList : []
457 this.productList = lines 469 this.productList = lines
458 } catch (e) { 470 } catch (e) {
@@ -38,3 +38,18 @@ export function getDicName(code, value, items = []) { @@ -38,3 +38,18 @@ export function getDicName(code, value, items = []) {
38 const item = list.find(it => it && it.code === value); 38 const item = list.find(it => it && it.code === value);
39 return item ? item.name : value; 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 +}