Commit d3541766f048bf4340246b4914a7a1f090dac396

Authored by 史婷婷
1 parent 9fddd46b

feat: 撤销单-详情&只读产品

... ... @@ -4,50 +4,26 @@
4 4 <view class="detail-page">
5 5 <view class="section">
6 6 <text class="row company">{{ form.orderNo }}</text>
7   - <view :class="['status', `status_${form.examineStatus}`]" />
8   - <view class="row"><text class="label">供货单位</text><text class="value">{{ getDicName('SUPPLIER',
9   - form.supplyUnit, dicOptions.SUPPLIER) }}</text></view>
  7 + <view :class="['status', `status_${form.status}`]" />
10 8 <view class="row"><text class="label">订货单位</text><text class="value">{{ form.orderingUnitName }}</text>
11 9 </view>
12 10 <view class="row"><text class="label">订货日期</text><text class="value">{{ form.orderDate }}</text></view>
13   - <view class="row"><text class="label">生产厂</text><text class="value">{{ form.workshopName }}</text></view>
14   - <view class="row"><text class="label">结算方式或期限</text><text class="value">{{ form.settlementTerms }}</text></view>
15   - <view class="row"><text class="label">交货方式</text><text class="value">{{ form.deliveryMethod }}</text></view>
  11 + <view class="row"><text class="label">申请撤单日期</text><text class="value">{{ form.documentPreparationDate }}</text></view>
  12 + <view class="row"><text class="label">所属办</text><text class="value">{{ form.deptName }}</text></view>
16 13 </view>
17 14
18   - <!-- 产品-变更前 -->
  15 + <!-- 产品 -->
19 16 <view class="mgb10">
20   - <Product title="变更前" mode="view" :options="genderOptions" :list="form.beforeChangeSpecList" :totalQuantity="form.totalQuantity || 0" />
21   - </view>
22   -
23   - <!-- 产品-变更后 -->
24   - <view class="mgb10">
25   - <Product title="变更后" mode="view" :options="genderOptions" :list="form.afterChangeSpecList" :totalQuantity="form.afterTotalQuantity || 0" />
  17 + <Product mode="view" :list="form.purchaseOrderRevokeLineList" :totalQuantity="form.totalQuantity || 0" :totalRevokeQuantity="form.totalRevokeQuantity || 0"/>
26 18 </view>
27 19
28 20 <view class="section">
29   - <view class="row"><text class="label">价格表编号</text><text class="value">{{ form.priceListNo }}</text></view>
30   - <view class="row"><text class="label">开票情况</text><text class="value">{{ form.invoicingStatus }}</text></view>
31   - <view class="row"><text class="label">运费</text><text class="value">{{ form.shippingCost }}</text></view>
32   - <view class="row"><text class="label">包装费</text><text class="value">{{ form.packagingFee }}</text></view>
33   - <view class="row"><text class="label">执行标准</text><text class="value">{{ getDicName('APPLICABLE_STANDARD',
34   - form.executionStandard, dicOptions.APPLICABLE_STANDARD) }}</text></view>
  21 + <view class="row"><text class="label">撤销原因</text><text class="value">{{ form.revokeReason }}</text></view>
35 22 </view>
36 23
37   - <view class="title-header">
38   - <image class="title-header_icon" src="/static/images/title.png" />
39   - <span>具体质量要求</span>
40   - </view>
41 24 <view class="section">
42   - <view class="row"><text class="label">件重条头</text><text class="value">{{ form.pieceWeightHeader }}</text></view>
43   - <view class="row"><text class="label">表面</text><text class="value">{{ form.surface }}</text></view>
44   - <view class="row"><text class="label">公差</text><text class="value">{{ form.tolerance }}</text></view>
45   - <view class="row"><text class="label">性能</text><text class="value">{{ form.performance }}</text></view>
46   - <view class="row"><text class="label">成分</text><text class="value">{{ form.element }}</text></view>
47   - <view class="row"><text class="label">包装</text><text class="value">{{ form.packaging }}</text></view>
48   - <view class="row"><text class="label">备注</text><text class="value">{{ form.remarks }}</text></view>
  25 + <view class="row"><text class="label">撤销确认凭证</text><text class="value act">{{ form.confirmationVoucherFileName }}</text></view>
49 26 </view>
50   -
51 27 </view>
52 28 </scroll-view>
53 29 <detail-buttons :buttons="displayButtons" @click="handleButtonClick" />
... ... @@ -55,15 +31,9 @@
55 31 </template>
56 32
57 33 <script>
58   -import { getDetailApi, cancelApi, confirmApi } from '@/api/revoke_list.js'
  34 +import { getDetailApi, cancelApi } from '@/api/revoke_list.js'
59 35 import Product from './product.vue'
60 36 import DetailButtons from '@/components/detail-buttons/index.vue'
61   -import {
62   - getDicName
63   -} from '@/utils/dic.js'
64   -import {
65   - getDicByCodes
66   -} from '@/utils/dic'
67 37
68 38 export default {
69 39 name: 'RevokeListDetail',
... ... @@ -71,35 +41,24 @@ export default {
71 41 data() {
72 42 return {
73 43 form: {},
74   - enterpriseTypeOptions: [],
75   - genderOptions: [],
76   - categoryOptions: [],
77   - historyList: [],
78 44 buttons: [
79 45 { text: '编辑', visible: true, variant: 'outline', event: 'edit' },
80 46 { text: '审核详情', visible: true, variant: 'outline', event: 'auditDetail' },
81 47 { text: '审核', visible: true, variant: 'primary', event: 'audit' },
82   - { text: '确认变更', visible: true, variant: 'outline', event: 'confirmChange' },
83 48 { text: '取消', visible: true, variant: 'outline', event: 'cancel', style: { color: 'rgba(0,0,0,0.9)', border: '1px solid #DCDCDC' } },
84   - ],
85   - dicOptions: {
86   - AUDIT_STATUS: [],
87   - SUPPLIER: [],
88   - APPLICABLE_STANDARD: [],
89   - },
  49 + ]
90 50 }
91 51 },
92 52 computed: {
93 53 statusFlags() {
94 54 const m = this.form || {}
95   - const e = String(m.examineStatus || '')
  55 + const e = String(m.status || '')
96 56 return {
97 57 isRefuse: e === 'REFUSE',
98 58 isAudit: e === 'AUDIT',
99   - canEdit: e === 'REFUSE' && !!m.changeCreateBy,
  59 + canEdit: e === 'REFUSE' && !!m.revokeCreateBy,
100 60 canAudit: e === 'AUDIT' && !!m.showExamine,
101 61 canCancel: e === 'REFUSE',
102   - canConfirmChange: e === 'REFUSE' && !!m.output
103 62 }
104 63 },
105 64 displayButtons() {
... ... @@ -108,13 +67,11 @@ export default {
108 67 { ...this.buttons[0], visible: f.canEdit },
109 68 { ...this.buttons[1], visible: true },
110 69 { ...this.buttons[2], visible: f.canAudit },
111   - { ...this.buttons[3], visible: f.canConfirmChange },
112   - { ...this.buttons[4], visible: f.canCancel },
  70 + { ...this.buttons[3], visible: f.canCancel },
113 71 ]
114 72 }
115 73 },
116 74 created() {
117   - this.loadAllDicData()
118 75 },
119 76 onLoad(query) {
120 77 const id = (query && (query.id || query.code)) || ''
... ... @@ -136,7 +93,6 @@ export default {
136 93 edit: () => this.onEdit(),
137 94 auditDetail: () => this.onAuditDetail(),
138 95 audit: () => this.onAudit(),
139   - confirmChange: () => this.onConfirmChange(),
140 96 cancel: () => this.onCancel(),
141 97 }
142 98 const fn = map[btn.event]
... ... @@ -148,7 +104,7 @@ export default {
148 104 onEdit() {
149 105 const id = this.getBusinessId()
150 106 const query = id ? ('?id=' + encodeURIComponent(id)) : ''
151   - uni.navigateTo({ url: '/pages/change_list/modify' + query })
  107 + uni.navigateTo({ url: '/pages/revoke_list/modify' + query })
152 108 },
153 109 onAuditDetail() {
154 110 const CACHE_KEY = 'sourceBusinessId'
... ... @@ -160,26 +116,6 @@ export default {
160 116 uni.setStorageSync(CACHE_KEY, this.getBusinessId())
161 117 uni.navigateTo({ url: '/pages/flow/audit' })
162 118 },
163   - onConfirmChange() {
164   - const id = this.getBusinessId();
165   - if (!id) return
166   - uni.showModal({
167   - title: '系统提示',
168   - content: '是否确定确认变更?',
169   - confirmText: '确定',
170   - cancelText: '取消',
171   - success: (res) => {
172   - if (res && res.confirm) {
173   - confirmApi(id).then(() => {
174   - uni.showToast({ title: '已确认变更', icon: 'none' })
175   - setTimeout(() => { uni.redirectTo({ url: '/pages/change_list/index' }) }, 300)
176   - }).catch(() => {
177   - uni.showToast({ title: '确认变更失败', icon: 'none' })
178   - })
179   - }
180   - }
181   - })
182   - },
183 119 onCancel() {
184 120 const id = this.getBusinessId()
185 121 if (!id) return
... ... @@ -192,7 +128,7 @@ export default {
192 128 if (res && res.confirm) {
193 129 cancelApi(id).then(() => {
194 130 uni.showToast({ title: '已取消', icon: 'none' })
195   - setTimeout(() => { uni.redirectTo({ url: '/pages/change_list/index' }) }, 300)
  131 + setTimeout(() => { uni.redirectTo({ url: '/pages/revoke_list/index' }) }, 300)
196 132 }).catch(() => {
197 133 uni.showToast({ title: '取消失败', icon: 'none' })
198 134 })
... ... @@ -200,21 +136,6 @@ export default {
200 136 }
201 137 })
202 138 },
203   - loadAllDicData() {
204   - const dicCodes = ['AUDIT_STATUS', 'SUPPLIER', 'APPLICABLE_STANDARD']
205   - return getDicByCodes(dicCodes).then(results => {
206   - this.dicOptions.AUDIT_STATUS = results.AUDIT_STATUS.data || []
207   - this.dicOptions.SUPPLIER = results.SUPPLIER.data || []
208   - this.dicOptions.APPLICABLE_STANDARD = results.APPLICABLE_STANDARD.data || []
209   - }).catch(() => {
210   - this.dicOptions = {
211   - AUDIT_STATUS: [],
212   - SUPPLIER: [],
213   - APPLICABLE_STANDARD: [],
214   - }
215   - })
216   - },
217   - getDicName: getDicName,
218 139 }
219 140 }
220 141 </script>
... ...
... ... @@ -14,11 +14,11 @@
14 14 <CardList ref="cardRef" :fetchFn="fetchList" :query="query" :extra="extraParams" :enable-refresh="true"
15 15 :enable-load-more="true" row-key="id" @loaded="onLoaded" @error="onError">
16 16 <template v-slot="{ item }">
17   - <view class="card">
  17 + <view class="card" @click.stop="onCardClick(item)">
18 18 <view class="card-header">
19 19 <text class="title omit2">{{ item.orderingUnitName }}</text>
20 20 <text v-if="item.status" :class="['status', `status_${item.status}`]">{{ filterStatus(item.status)
21   - }}</text>
  21 + }}</text>
22 22 </view>
23 23 <view class="info-row"><text>订单编号</text><text>{{ item.orderNo }}</text></view>
24 24 <view class="info-row"><text>订货日期</text><text>{{ item.orderDate }}</text></view>
... ... @@ -167,6 +167,14 @@ export default {
167 167 url: '/pages/revoke_list/add'
168 168 })
169 169 },
  170 + onCardClick(item) {
  171 + const id = (item && (item.id || item.code)) || ''
  172 + if (!id) return
  173 + const query = '?id=' + encodeURIComponent(id)
  174 + uni.navigateTo({
  175 + url: '/pages/revoke_list/detail' + query
  176 + })
  177 + },
170 178 }
171 179 }
172 180 </script>
... ...
... ... @@ -108,19 +108,20 @@
108 108 </view>
109 109 </view>
110 110 <view class="row"><text class="label">状态</text><text class="value">{{ item.status }}</text></view>
111   - <view class="row"><text class="label">数量kg</text><text class="value">{{ item.quantity }}</text></view>
112   - <!-- showSalesPrice 判断是否显示 -->
113   - <view class="row" v-if="item.showSalesPrice"><text class="label">销售价格</text><text class="value">{{
114   - item.salesPrice }}</text></view>
  111 + <view class="row"><text class="label">原数量kg</text><text class="value">{{ item.quantity }}</text></view>
  112 + <view class="row"><text class="label">销售价格</text><text class="value">{{item.salesPrice }}</text></view>
115 113 <view class="row"><text class="label">发货日期</text><text class="value">{{ item.deliveryDate }}</text>
116 114 </view>
117   - <view class="row"><text class="label">考核超协</text><text class="value">{{ item.assessmentExceedsAgreement
  115 + <view class="row"><text class="label">撤销数量kg</text><text class="value">{{ item.revokeQuantity
118 116 }}</text></view>
119 117 </view>
120 118 <view class="view-total">
121 119 <view class="head">合计</view>
122 120 <view class="row">
123   - <text class="label">总数量</text><text class="value">{{ totalQuantity }}</text>
  121 + <text class="label">原数量</text><text class="value">{{ totalQuantity }}</text>
  122 + </view>
  123 + <view class="row">
  124 + <text class="label">撤销数量</text><text class="value">{{ totalRevokeQuantity }}</text>
124 125 </view>
125 126 </view>
126 127 </view>
... ... @@ -137,13 +138,13 @@ export default {
137 138 list: { type: Array, default: () => [] },
138 139 max: { type: Number, default: 8 },
139 140 options: { type: Array, default: () => [] },
140   - totalQuantity: { type: Number, default: 0 }
  141 + totalQuantity: { type: Number, default: 0 },
  142 + totalRevokeQuantity: { type: Number, default: 0 }
141 143 },
142 144 data() {
143 145 return {
144 146 items: [],
145 147 collapsedView: false,
146   - sheet: { visible: false, title: '请选择性别', options: [], value: '', idx: -1 }
147 148 }
148 149 },
149 150 computed: {
... ... @@ -591,7 +592,7 @@ export default {
591 592 }
592 593
593 594 .label {
594   - width: 140rpx;
  595 + width: 150rpx;
595 596 margin-right: 14rpx;
596 597 color: rgba(0, 0, 0, 0.6);
597 598 font-size: 28rpx;
... ...