Commit 42b605b5baffc220ff1bd66d2713da98bb6db036

Authored by 史婷婷
1 parent 9e32b803

feat: 产品试样确认单-详情 按钮逻辑

@@ -44,9 +44,7 @@ export default { @@ -44,9 +44,7 @@ export default {
44 buttons: [ 44 buttons: [
45 { text: '编辑', visible: true, variant: 'outline', event: 'edit' }, 45 { text: '编辑', visible: true, variant: 'outline', event: 'edit' },
46 { text: '审核详情', visible: true, variant: 'outline', event: 'auditDetail' }, 46 { text: '审核详情', visible: true, variant: 'outline', event: 'auditDetail' },
47 - { text: '填写补货时间', visible: true, variant: 'outline', event: 'fill' },  
48 { text: '审核', visible: true, variant: 'primary', event: 'audit' }, 47 { text: '审核', visible: true, variant: 'primary', event: 'audit' },
49 - { text: '取消', visible: true, variant: 'outline', event: 'cancel', style: { color: 'rgba(0,0,0,0.9)', border: '1px solid #DCDCDC' } },  
50 ] 48 ]
51 } 49 }
52 }, 50 },
@@ -54,23 +52,21 @@ export default { @@ -54,23 +52,21 @@ export default {
54 statusFlags() { 52 statusFlags() {
55 const m = this.form || {} 53 const m = this.form || {}
56 const e = String(m.status || '') 54 const e = String(m.status || '')
  55 + // showAudit 这个字段就是后端自己判断的 制单人所在区域 所有人 权限
57 return { 56 return {
58 - isRefuse: e === 'REFUSE' || false,  
59 - isAudit: e === 'AUDIT' || false,  
60 - canEdit: e === 'REFUSE' && m.isOwner || false, 57 + // todo 等下还原
  58 + // canEdit: !e && m.showAudit || false,
  59 + canEdit: true,
61 canAudit: e === 'AUDIT' && m.showExamine || false, 60 canAudit: e === 'AUDIT' && m.showExamine || false,
62 - canCancel: e === 'REFUSE' && m.isOwner || false,  
63 - canFill: e === 'PASS' && !m.completed || false, 61 + canAuditDetail: !!e || false,
64 } 62 }
65 }, 63 },
66 displayButtons() { 64 displayButtons() {
67 const f = this.statusFlags 65 const f = this.statusFlags
68 return [ 66 return [
69 - { ...this.buttons[0], visible: f.canEdit && this.$auth.hasPermi('shipping-plan-manage:replenishment-order:modify') },  
70 - { ...this.buttons[1], visible: this.$auth.hasPermi('shipping-plan-manage:replenishment-order:review') },  
71 - { ...this.buttons[2], visible: f.canFill && this.$auth.hasPermi('shipping-plan-manage:replenishment-order:fill') },  
72 - { ...this.buttons[3], visible: f.canAudit && this.$auth.hasPermi('shipping-plan-manage:replenishment-order:approve') },  
73 - { ...this.buttons[4], visible: f.canCancel && this.$auth.hasPermi('shipping-plan-manage:replenishment-order:cancel') }, 67 + { ...this.buttons[0], visible: f.canEdit }, // 不需要额外的角色权限
  68 + { ...this.buttons[1], visible: f.canAuditDetail && this.$auth.hasPermi('sample-order:confirmation-form:review') },
  69 + { ...this.buttons[2], visible: f.canAudit && this.$auth.hasPermi('sample-order:confirmation-form:approve') },
74 ] 70 ]
75 } 71 }
76 }, 72 },