Commit 8d9717fb1b7edcae85ac49721a6fa6a12c8225d2

Authored by gesilong
1 parent 754bc0ae

commit:优化合同状态详情得展示

... ... @@ -5,7 +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 + <view v-if="detail.status === 'STANDARD'" :class="['status', `status_${detail.shippingStatusName}`]" />
9 9 <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-'
10 10 }}</text></view>
11 11 <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-'
... ... @@ -214,7 +214,6 @@ export default {
214 214 {
215 215 text: '审核详情',
216 216 visible: true,
217   - variant: 'primary',
218 217 event: 'auditDetail'
219 218 },
220 219 ],
... ... @@ -241,13 +240,6 @@ export default {
241 240 this.loadDetail()
242 241 },
243 242 methods: {
244   - getShippingStatusName(name) {
245   - const found = this.statusMap[name] || ''
246   - return {
247   - backgroundColor: found || '#000',
248   - color: found ? '#fff' : '#000'
249   - }
250   - },
251 243 getStatusCss(name) {
252 244 const list = Array.isArray(this.statusStyle) ? this.statusStyle : []
253 245 const found = list.find(it => it && it.text === name) || {}
... ... @@ -436,6 +428,32 @@ export default {
436 428 padding: 32rpx;
437 429 background: #fff;
438 430 margin-bottom: 20rpx;
  431 + .status {
  432 + position: absolute;
  433 + top: 16rpx;
  434 + right: 52rpx;
  435 + width: 180rpx;
  436 + height: 146rpx;
  437 + background-repeat: no-repeat;
  438 + background-size: 100% 100%;
  439 + background-position: center;
  440 +
  441 + &_审批中 {
  442 + background-image: url('~@/static/images/contract/status_1.png');
  443 + }
  444 +
  445 + &_生产中 {
  446 + background-image: url('~@/static/images/contract/status_2.png');
  447 + }
  448 +
  449 + &_已发货 {
  450 + background-image: url('~@/static/images/contract/status_3.png');
  451 + }
  452 +
  453 + &_已签收 {
  454 + background-image: url('~@/static/images/contract/status_4.png');
  455 + }
  456 + }
439 457 }
440 458
441 459 .section1 {
... ...
... ... @@ -10,7 +10,8 @@
10 10 <span v-if="detail.status === 'STANDARD'" class="info-status" :style="detail.standardApprovedName ? getStatusCss(detail.standardApprovedName) : ''" >{{ detail.standardApprovedName || '-' }}</span>
11 11 <span v-if="detail.status === 'FORMAL'" class="info-status" :style="detail.formalApprovedName ? getStatusCss(detail.formalApprovedName) : ''" >{{ detail.formalApprovedName || '-' }}</span>
12 12 </text>
13   - </view> <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>
  13 + </view>
  14 + <view v-if="detail.status === 'STANDARD'" :class="['status', `status_${detail.shippingStatusName}`]" />
14 15 <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-'
15 16 }}</text></view>
16 17 <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-'
... ... @@ -251,19 +252,16 @@ export default {
251 252 {
252 253 text: '正式合同审核详情',
253 254 visible: true,
254   - variant: 'primary',
255 255 event: 'auditDetail1'
256 256 },
257 257 {
258 258 text: '正式合同审核详情',
259 259 visible: true,
260   - variant: 'primary',
261 260 event: 'auditDetail2'
262 261 },
263 262 {
264 263 text: '标准合同审核详情',
265 264 visible: true,
266   - variant: 'primary',
267 265 event: 'auditDetail3'
268 266 },
269 267 {
... ... @@ -306,13 +304,6 @@ export default {
306 304 this.loadDetail()
307 305 },
308 306 methods: {
309   - getShippingStatusName(name) {
310   - const found = this.statusMap[name] || ''
311   - return {
312   - backgroundColor: found || '#000',
313   - color: found ? '#fff' : '#000'
314   - }
315   - },
316 307 getStatusCss(name) {
317 308 const list = Array.isArray(this.statusStyle) ? this.statusStyle : []
318 309 const found = list.find(it => it && it.text === name) || {}
... ... @@ -523,6 +514,32 @@ export default {
523 514 padding: 32rpx;
524 515 background: #fff;
525 516 margin-bottom: 20rpx;
  517 + .status {
  518 + position: absolute;
  519 + top: 16rpx;
  520 + right: 52rpx;
  521 + width: 180rpx;
  522 + height: 146rpx;
  523 + background-repeat: no-repeat;
  524 + background-size: 100% 100%;
  525 + background-position: center;
  526 +
  527 + &_审批中 {
  528 + background-image: url('~@/static/images/contract/status_1.png');
  529 + }
  530 +
  531 + &_生产中 {
  532 + background-image: url('~@/static/images/contract/status_2.png');
  533 + }
  534 +
  535 + &_已发货 {
  536 + background-image: url('~@/static/images/contract/status_3.png');
  537 + }
  538 +
  539 + &_已签收 {
  540 + background-image: url('~@/static/images/contract/status_4.png');
  541 + }
  542 + }
526 543 }
527 544
528 545 .section1 {
... ...
... ... @@ -12,7 +12,8 @@
12 12 <span v-if="detail.status === 'FORMAL'" class="info-status" :style="detail.formalApprovedName ? getStatusCss(detail.formalApprovedName) : ''" >{{ detail.formalApprovedName || '-' }}</span>
13 13
14 14 </text>
15   - </view> <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>
  15 + </view>
  16 + <view v-if="detail.status === 'STANDARD'" :class="['status', `status_${detail.shippingStatusName}`]" />
16 17 <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-'
17 18 }}</text></view>
18 19 <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-'
... ... @@ -259,19 +260,16 @@ export default {
259 260 {
260 261 text: '正式合同审核详情',
261 262 visible: true,
262   - variant: 'primary',
263 263 event: 'auditDetail1'
264 264 },
265 265 {
266 266 text: '正式合同审核详情',
267 267 visible: true,
268   - variant: 'primary',
269 268 event: 'auditDetail2'
270 269 },
271 270 {
272 271 text: '标准合同审核详情',
273 272 visible: true,
274   - variant: 'primary',
275 273 event: 'auditDetail3'
276 274 },
277 275 {
... ... @@ -315,13 +313,6 @@ export default {
315 313 this.loadDetail()
316 314 },
317 315 methods: {
318   - getShippingStatusName(name) {
319   - const found = this.statusMap[name] || ''
320   - return {
321   - backgroundColor: found || '#000',
322   - color: found ? '#fff' : '#000'
323   - }
324   - },
325 316 getStatusCss(name) {
326 317 const list = Array.isArray(this.statusStyle) ? this.statusStyle : []
327 318 const found = list.find(it => it && it.text === name) || {}
... ... @@ -537,6 +528,32 @@ export default {
537 528 padding: 32rpx;
538 529 background: #fff;
539 530 margin-bottom: 20rpx;
  531 + .status {
  532 + position: absolute;
  533 + top: 16rpx;
  534 + right: 52rpx;
  535 + width: 180rpx;
  536 + height: 146rpx;
  537 + background-repeat: no-repeat;
  538 + background-size: 100% 100%;
  539 + background-position: center;
  540 +
  541 + &_审批中 {
  542 + background-image: url('~@/static/images/contract/status_1.png');
  543 + }
  544 +
  545 + &_生产中 {
  546 + background-image: url('~@/static/images/contract/status_2.png');
  547 + }
  548 +
  549 + &_已发货 {
  550 + background-image: url('~@/static/images/contract/status_3.png');
  551 + }
  552 +
  553 + &_已签收 {
  554 + background-image: url('~@/static/images/contract/status_4.png');
  555 + }
  556 + }
540 557 }
541 558
542 559 .section1 {
... ...
... ... @@ -5,7 +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 + <view v-if="detail.status === 'STANDARD'" :class="['status', `status_${detail.shippingStatusName}`]" />
9 9 <view class="row"><text class="label">承揽方</text><text class="value">{{ detail.supplierName || '-'
10 10 }}</text></view>
11 11 <view class="row"><text class="label">定作方</text><text class="value">{{ detail.buyerName || '-'
... ... @@ -205,7 +205,6 @@ export default {
205 205 {
206 206 text: '审核详情',
207 207 visible: true,
208   - variant: 'primary',
209 208 event: 'auditDetail'
210 209 },
211 210 ],
... ... @@ -231,13 +230,6 @@ export default {
231 230 this.loadDetail()
232 231 },
233 232 methods: {
234   - getShippingStatusName(name) {
235   - const found = this.statusMap[name] || ''
236   - return {
237   - backgroundColor: found || '#000',
238   - color: found ? '#fff' : '#000'
239   - }
240   - },
241 233 getStatusCss(name) {
242 234 const list = Array.isArray(this.statusStyle) ? this.statusStyle : []
243 235 const found = list.find(it => it && it.text === name) || {}
... ... @@ -420,6 +412,32 @@ export default {
420 412 padding: 32rpx;
421 413 background: #fff;
422 414 margin-bottom: 20rpx;
  415 + .status {
  416 + position: absolute;
  417 + top: 16rpx;
  418 + right: 52rpx;
  419 + width: 180rpx;
  420 + height: 146rpx;
  421 + background-repeat: no-repeat;
  422 + background-size: 100% 100%;
  423 + background-position: center;
  424 +
  425 + &_审批中 {
  426 + background-image: url('~@/static/images/contract/status_1.png');
  427 + }
  428 +
  429 + &_生产中 {
  430 + background-image: url('~@/static/images/contract/status_2.png');
  431 + }
  432 +
  433 + &_已发货 {
  434 + background-image: url('~@/static/images/contract/status_3.png');
  435 + }
  436 +
  437 + &_已签收 {
  438 + background-image: url('~@/static/images/contract/status_4.png');
  439 + }
  440 + }
423 441 }
424 442 .section1 {
425 443 background: #fff;
... ...
... ... @@ -5,7 +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'"><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 v-if="detail.status === 'STANDARD'" :class="['status', `status_${detail.shippingStatusName}`]" />
9 9 <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName ||
10 10 '-'}}</text></view>
11 11 <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName ||
... ... @@ -60,7 +60,7 @@
60 60 }}</text></view>
61 61 </view>
62 62
63   - <view class="section" v-if="status === 'STANDARD'">
  63 + <view class="section" v-if="detail.status === 'STANDARD'">
64 64 <view class="row"><text class="label">规范性合同</text><text class="value" style="color: #3D48A3;">{{
65 65 detail.standardFileName || '-' }}</text></view>
66 66 <view class="row"><text class="label">合同是否规范</text><text class="value">{{
... ... @@ -205,7 +205,6 @@ export default {
205 205 {
206 206 text: '审核详情',
207 207 visible: true,
208   - variant: 'primary',
209 208 event: 'auditDetail'
210 209 },
211 210 ],
... ... @@ -259,13 +258,6 @@ export default {
259 258 const name = getDicName('AUDIT_STATUS', code, this.dicOptions.AUDIT_STATUS)
260 259 this.detail = { ...this.detail, standardApprovedName: name }
261 260 },
262   - getShippingStatusName(name) {
263   - const found = this.statusMap[name] || ''
264   - return {
265   - backgroundColor: found || '#000',
266   - color: found ? '#fff' : '#000'
267   - }
268   - },
269 261 onUploadSubmit() {
270 262 if (!this.fileInfo.id) {
271 263 uni.showToast({
... ... @@ -428,8 +420,35 @@ export default {
428 420 padding: 32rpx;
429 421 background: #fff;
430 422 margin-bottom: 20rpx;
  423 + .status {
  424 + position: absolute;
  425 + top: 16rpx;
  426 + right: 52rpx;
  427 + width: 180rpx;
  428 + height: 146rpx;
  429 + background-repeat: no-repeat;
  430 + background-size: 100% 100%;
  431 + background-position: center;
  432 +
  433 + &_审批中 {
  434 + background-image: url('~@/static/images/contract/status_1.png');
  435 + }
  436 +
  437 + &_生产中 {
  438 + background-image: url('~@/static/images/contract/status_2.png');
  439 + }
  440 +
  441 + &_已发货 {
  442 + background-image: url('~@/static/images/contract/status_3.png');
  443 + }
  444 +
  445 + &_已签收 {
  446 + background-image: url('~@/static/images/contract/status_4.png');
  447 + }
  448 + }
431 449 }
432 450
  451 +
433 452 .section1 {
434 453 background: #fff;
435 454 margin-bottom: 20rpx;
... ...
... ... @@ -12,7 +12,8 @@
12 12 <span v-if="detail.status === 'FORMAL'" class="info-status" :style="detail.formalApprovedName ? getStatusCss(detail.formalApprovedName) : ''" >{{ detail.formalApprovedName || '-' }}</span>
13 13
14 14 </text>
15   - </view> <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>
  15 + </view>
  16 + <view v-if="detail.status === 'STANDARD'" :class="['status', `status_${detail.shippingStatusName}`]" />
16 17 <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-'
17 18 }}</text></view>
18 19 <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-'
... ... @@ -245,19 +246,16 @@ export default {
245 246 {
246 247 text: '正式合同审核详情',
247 248 visible: true,
248   - variant: 'primary',
249 249 event: 'auditDetail1'
250 250 },
251 251 {
252 252 text: '正式合同审核详情',
253 253 visible: true,
254   - variant: 'primary',
255 254 event: 'auditDetail2'
256 255 },
257 256 {
258 257 text: '标准合同审核详情',
259 258 visible: true,
260   - variant: 'primary',
261 259 event: 'auditDetail3'
262 260 },
263 261 ],
... ... @@ -295,13 +293,6 @@ export default {
295 293 this.loadDetail()
296 294 },
297 295 methods: {
298   - getShippingStatusName(name) {
299   - const found = this.statusMap[name] || ''
300   - return {
301   - backgroundColor: found || '#000',
302   - color: found ? '#fff' : '#000'
303   - }
304   - },
305 296 onDelete() {
306 297 uni.showModal({
307 298 title: '确认删除',
... ... @@ -501,6 +492,32 @@ export default {
501 492 padding: 32rpx;
502 493 background: #fff;
503 494 margin-bottom: 20rpx;
  495 + .status {
  496 + position: absolute;
  497 + top: 16rpx;
  498 + right: 52rpx;
  499 + width: 180rpx;
  500 + height: 146rpx;
  501 + background-repeat: no-repeat;
  502 + background-size: 100% 100%;
  503 + background-position: center;
  504 +
  505 + &_审批中 {
  506 + background-image: url('~@/static/images/contract/status_1.png');
  507 + }
  508 +
  509 + &_生产中 {
  510 + background-image: url('~@/static/images/contract/status_2.png');
  511 + }
  512 +
  513 + &_已发货 {
  514 + background-image: url('~@/static/images/contract/status_3.png');
  515 + }
  516 +
  517 + &_已签收 {
  518 + background-image: url('~@/static/images/contract/status_4.png');
  519 + }
  520 + }
504 521 }
505 522 .section1 {
506 523 background: #fff;
... ...
... ... @@ -13,7 +13,7 @@
13 13
14 14 </text>
15 15 </view>
16   - <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>
  16 + <view v-if="detail.status === 'STANDARD'" :class="['status', `status_${detail.shippingStatusName}`]" />
17 17 <view class="row"><text class="label">供方</text><text class="value">{{ detail.supplierName || '-'
18 18 }}</text></view>
19 19 <view class="row"><text class="label">需方</text><text class="value">{{ detail.buyerName || '-'
... ... @@ -253,19 +253,16 @@ export default {
253 253 {
254 254 text: '正式合同审核详情',
255 255 visible: true,
256   - variant: 'primary',
257 256 event: 'auditDetail1'
258 257 },
259 258 {
260 259 text: '正式合同审核详情',
261 260 visible: true,
262   - variant: 'primary',
263 261 event: 'auditDetail2'
264 262 },
265 263 {
266 264 text: '标准合同审核详情',
267 265 visible: true,
268   - variant: 'primary',
269 266 event: 'auditDetail3'
270 267 },
271 268 ],
... ... @@ -302,14 +299,6 @@ export default {
302 299 this.loadDetail()
303 300 },
304 301 methods: {
305   - getShippingStatusName(name) {
306   - const found = this.statusMap[name] || ''
307   - console.log(found,'found')
308   - return {
309   - backgroundColor: found || '#000',
310   - color: found ? '#fff' : '#000'
311   - }
312   - },
313 302 getStatusCss(name) {
314 303 const list = Array.isArray(this.statusStyle) ? this.statusStyle : []
315 304 const found = list.find(it => it && it.text === name) || {}
... ... @@ -522,6 +511,32 @@ export default {
522 511 padding: 32rpx;
523 512 background: #fff;
524 513 margin-bottom: 20rpx;
  514 + .status {
  515 + position: absolute;
  516 + top: 16rpx;
  517 + right: 52rpx;
  518 + width: 180rpx;
  519 + height: 146rpx;
  520 + background-repeat: no-repeat;
  521 + background-size: 100% 100%;
  522 + background-position: center;
  523 +
  524 + &_审批中 {
  525 + background-image: url('~@/static/images/contract/status_1.png');
  526 + }
  527 +
  528 + &_生产中 {
  529 + background-image: url('~@/static/images/contract/status_2.png');
  530 + }
  531 +
  532 + &_已发货 {
  533 + background-image: url('~@/static/images/contract/status_3.png');
  534 + }
  535 +
  536 + &_已签收 {
  537 + background-image: url('~@/static/images/contract/status_4.png');
  538 + }
  539 + }
525 540 }
526 541
527 542 .section1 {
... ...