Commit 25a38ba27db8ebce9c450fe9fae16c0efa182aa3

Authored by 史婷婷
1 parent 55689acb

feat: 发货单-详情-子表-按钮展示逻辑(申请延期&拆分)

... ... @@ -15,7 +15,7 @@
15 15
16 16 <!-- 产品 -->
17 17 <view class="section2">
18   - <Product mode="view" :list="form.detailList" />
  18 + <Product mode="view" :status="form.status" :list="form.detailList" />
19 19 </view>
20 20 <view class="section">
21 21 <view class="row"><text class="label">签收单据</text><text class="value act">{{ form.fileName }}</text></view>
... ... @@ -56,7 +56,8 @@ export default {
56 56 return {
57 57 form: {},
58 58 buttons: [
59   - { text: '编辑', visible: true, variant: 'outline', event: 'edit' },
  59 + // 编辑涉及到的产品-子表操作 放到详情里面
  60 + // { text: '编辑', visible: true, variant: 'outline', event: 'edit' },
60 61 { text: '填写实发数', visible: true, variant: 'outline', event: 'fill' },
61 62 { text: '上传签收单据', visible: true, variant: 'primary', event: 'upload' },
62 63 ],
... ... @@ -76,9 +77,9 @@ export default {
76 77 displayButtons() {
77 78 const f = this.statusFlags
78 79 return [
79   - { ...this.buttons[0], visible: f.canEdit && this.$auth.hasPermi('shipping-plan-manage:invoice:modify') },
80   - { ...this.buttons[1], visible: f.canFill && this.$auth.hasPermi('shipping-plan-manage:invoice:fill') },
81   - { ...this.buttons[2], visible: f.canUpload && this.$auth.hasPermi('shipping-plan-manage:invoice:upload') },
  80 + // { ...this.buttons[0], visible: f.canEdit && this.$auth.hasPermi('shipping-plan-manage:invoice:modify') },
  81 + { ...this.buttons[0], visible: f.canFill && this.$auth.hasPermi('shipping-plan-manage:invoice:fill') },
  82 + { ...this.buttons[1], visible: f.canUpload && this.$auth.hasPermi('shipping-plan-manage:invoice:upload') },
82 83 ]
83 84 }
84 85 },
... ... @@ -98,17 +99,17 @@ export default {
98 99 handleButtonClick(btn) {
99 100 if (!btn || btn.disabled) return
100 101 const map = {
101   - edit: () => this.onEdit(),
  102 + // edit: () => this.onEdit(),
102 103 fill: () => this.onFill(),
103 104 upload: () => this.onUpload(),
104 105 }
105 106 const fn = map[btn.event]
106 107 if (typeof fn === 'function') fn()
107 108 },
108   - onEdit() {
  109 + // onEdit() {
109 110 // const id = this.form.id || this.form.code
110 111 // if (id) uni.navigateTo({ url: `/pages/invoice/modify?id=${id}` })
111   - },
  112 + // },
112 113 onFill() {
113 114 const id = this.form.id || this.form.code
114 115 if (id) uni.navigateTo({ url: `/pages/invoice/fill?id=${id}` })
... ...
... ... @@ -133,6 +133,11 @@
133 133 <view class="row"><text class="label">回程费</text><text class="value">{{ item.contractType === 'PROCESS_STD_AGMT' ? item.shippingCost : '' }}</text></view>
134 134 <view class="row"><text class="label">牌号</text><text class="value">{{ item.brand }}</text></view>
135 135 <view class="row"><text class="label">高新</text><text class="value">-</text></view>
  136 + <view v-if="status === 'UN_SHIPMENTS' && $auth.hasPermi('shipping-plan-manage:invoice:modify') " class="row row-opt">
  137 + <text class="row-opt_btn">申请延期</text>
  138 + <text class="line"></text>
  139 + <text class="row-opt_btn">拆分</text>
  140 + </view>
136 141 </view>
137 142 </view>
138 143
... ... @@ -145,6 +150,7 @@ export default {
145 150 props: {
146 151 title: { type: String, default: '' },
147 152 mode: { type: String, default: 'add' },
  153 + status: { type: String, default: '' },
148 154 list: { type: Array, default: () => [] },
149 155 },
150 156 data() {
... ... @@ -669,6 +675,33 @@ export default {
669 675 height: 60rpx;
670 676 align-items: center;
671 677 }
  678 +
  679 + &.row-opt {
  680 + height: 80rpx;
  681 + display: flex;
  682 + justify-content: flex-end;
  683 + align-items: center;
  684 + position: relative;
  685 + right: -20rpx;
  686 +
  687 + .row-opt_btn {
  688 + font-size: 30rpx;
  689 + padding: 0 40rpx;
  690 + text-align: center;
  691 + &:first-child {
  692 + color: $theme-primary;
  693 + }
  694 + &:last-child {
  695 + color: $theme-primary;
  696 + }
  697 + }
  698 + .line {
  699 + display: block;
  700 + width: 2rpx;
  701 + height: 30rpx;
  702 + background: rgba(0, 0, 0, 0.2);
  703 + }
  704 + }
672 705 }
673 706
674 707 .row:last-child {
... ... @@ -676,7 +709,7 @@ export default {
676 709 }
677 710
678 711 .label {
679   - width: 260rpx;
  712 + width: 200rpx;
680 713 margin-right: 14rpx;
681 714 color: rgba(0, 0, 0, 0.6);
682 715 font-size: 28rpx;
... ...