index.vue
11.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
<!-- 采购发货 -->
<template>
<div class="layout">
<div class="allocate" :style="{ height: isHeight ? 'calc(100vh - 68px)' : '100%' }">
<!-- 订单基本信息 -->
<div class="info-section">
<div class="title">
订单基本信息
<div class="status">
<span :style="{ color: getStepText('orderStatusOpts', allocateOrderInfo.billStatus, 'color') }">{{ getStepText('orderStatusOpts', allocateOrderInfo.billStatus, 'label') }}</span>
|
<span :style="{ color: getStepText('deliveryStatusOpts', allocateOrderInfo.deliveryStatus, 'color') }">
{{ getStepText('deliveryStatusOpts', allocateOrderInfo.deliveryStatus, 'label') }}
</span>
</div>
</div>
<div v-for="(item, index) in orderBasicInfoList" :key="index" class="info-item">
<span>{{ item.label }}</span>
<span class="value" v-if="item.formatter">{{ item.formatter(allocateOrderInfo) }}</span>
<span class="value" v-else>{{ allocateOrderInfo[item.value] || '--' }}</span>
</div>
</div>
<!-- 订单基本信息 -->
<div class="info-section">
<div class="title">
产品信息
<span class="title-tip">点击产品名称可查看商品全部信息</span>
</div>
<StickyTable :columns="tableColumns" :data="allocateOrderInfo.stockAllocateDetailList" :height="allocateOrderInfo.stockAllocateDetailList.length > 5 ? '216px' : 'auto'">
<template #goodsName="{ row }">
<span style="color: #347bff; cursor: pointer" @click="handleProductClick(row)">{{ row.goodsName || '-' }}</span>
</template>
</StickyTable>
</div>
<!-- 其他信息 -->
<div class="info-section">
<div class="title">其他信息</div>
<div class="info-item">
<span>备注</span>
<span class="word-break">{{ formatOpinionText(allocateOrderInfo.remark) }}</span>
</div>
</div>
<!-- 审核流程进度 -->
<div class="info-section">
<div class="title">审核流程进度</div>
<review-status :infoData="allocateOrderInfo"></review-status>
</div>
<!-- 审核记录 -->
<div class="info-section">
<div class="title">审核记录</div>
<record :recordList="allocateOrderInfo.auditDetaiList"></record>
</div>
</div>
<div class="footer">
<div
class="reject btn"
@click="handleReject"
v-if="
(allocateOrderInfo.billStatus === 1 && staffType == 2) ||
(allocateOrderInfo.billStatus === 2 && staffType == 3) ||
(allocateOrderInfo.deliveryStatus === 1 && staffType == 4 && allocateOrderInfo.billStatus == 5)
"
>
驳回
</div>
<div class="approve btn" @click="handleApprove" v-if="(allocateOrderInfo.billStatus === 1 && staffType == 2) || (allocateOrderInfo.billStatus === 2 && staffType == 3)">通过</div>
</div>
<reject-comp :isVisible="rejectVisible" v-if="rejectVisible" :infoData="allocateOrderInfo" @cancel="handleCancel" @success="handleSuccess"></reject-comp>
<approve-comp :isVisible="approveVisible" v-if="approveVisible" :infoData="allocateOrderInfo" @cancel="handleApproveCancel" @success="handleApproveSuccess"></approve-comp>
</div>
</template>
<script type="text/ecmascript-6">
import { getLocalStorage } from '@/utils/util'
import { deepClone } from '@/utils/tools'
import { purchasingPatternOptions } from '@/utils/constants'
import reviewStatus from './reviewStatus.vue'
import record from './record.vue'
import rejectComp from './components/rejectComp.vue'
import ApproveComp from './components/approveComp.vue'
// import detailComp from './components/detailComp.vue'
import allocateApi from '@/api/allocate'
import StickyTable from '@/components/StickyTable.vue'
export default {
components: { reviewStatus, record, rejectComp, ApproveComp, StickyTable },
name: '',
data() {
return {
staffType: this.$route.query.staffType, // (2-运营审核 3-商务审核 4-采购发货审核)
orderCode: this.$route.query.orderCode,
allocateOrderInfo: {},
productInfo: {},
approveVisible: false,
rejectVisible: false,
tableColumns: [
{ label: '产品名称', prop: 'goodsName', width: '120px' },
{ label: '产品ID', prop: 'upgradeGoodsCommodityCode', width: '150px' },
{ label: '产品编码', prop: 'productCode', width: '100px' },
{ label: '规格', prop: 'specificationData', width: '90px' },
{
label: '调拨数量',
prop: 'allocateNumber',
width: '100px',
formatter: cellValue => {
return cellValue.allocateNumber || cellValue.allocateNumber === 0 ? cellValue.allocateNumber + ([1, 4, 6, 12, 14].includes(cellValue.goodsType) ? '米' : '件') : '--'
}
},
{
label: '调入门店库存',
prop: 'inStockQty',
width: '120px',
formatter: cellValue => {
return cellValue.inStockQty || cellValue.inStockQty === 0 ? cellValue.inStockQty + ([1, 4, 6, 12, 14].includes(cellValue.goodsType) ? '米' : '件') : '--'
},
isHidden:false
},
{
label: '调出门店库存', prop: 'outStockQty', width: '120px', formatter: cellValue => {
return cellValue.outStockQty || cellValue.outStockQty === 0 ? cellValue.outStockQty + ([1, 4, 6, 12, 14].includes(cellValue.goodsType) ? '米' : '件') : '--'
}
},
{
label: '膜卷号', prop: 'filmRollNo', width: '90px'
}
],
orderBasicInfoList: [
{ label: '调拨编号', value: 'allocateCode' },
{ label: '调入门店', value: 'callInMerchantName' },
{ label: '调出门店', value: 'callOutMerchantName' },
{
label: '调拨数量',
value: 'totalAllocateNumber'
},
{ label: '发起时间', value: 'submitTime' },
{
label: '当前审核节点',
value: '',
formatter: cellValue => {
return cellValue.billStatus == 1 ? '运营审核' : cellValue.billStatus == 2 ? '商务审核' : '--'
}
}
],
deliveryStatusOpts: {
1: {
label: '未发货',
color: '#999999'
},
2: {
label: '全部发货',
color: '#35C376'
},
3: {
label: '部分发货',
color: '#FF9D0A'
},
4: {
label: '结束发货',
color: '#F24724'
}
},
// 订单状态 1.待审核,2运营已审核,3.已取消,4.运营已驳回,5.商务已审核,6.商务已驳回,7.发货已驳回
orderStatusOpts: {
1: {
label: '待审核',
color: '#FF9D0A'
},
2: {
label: '待审核',
color: '#FF9D0A'
},
3: {
label: '已取消',
color: '#999999'
},
4: {
label: '已驳回',
color: '#F24724'
},
5: {
label: '已审核',
color: '#35C376'
},
6: {
label: '已驳回',
color: '#F24724'
},
7: {
label: '已驳回',
color: '#F24724'
}
},
baseData: {
purchasingPatternOptions: deepClone(purchasingPatternOptions)
}
}
},
//D+调拨管理查找调拨单号
// 第一步:http://192.168.2.111:9527/dj-scrm-wx-work-main-test/#/cannibalize?orderCode=DB202604152929&staffType=2&name=glsadmin 运营审核
// 第二步:http://192.168.2.111:9527/dj-scrm-wx-work-main-test/#/cannibalize?orderCode=DB202604152929&staffType=3&name=glsadmin 商务审核
// 第二步: http://192.168.2.111:9527/dj-scrm-wx-work-main-test/#/cannibalize?orderCode=DB202604152929&staffType=4&name=glsadmin 采购发货审核
created() {
this.allocateOrderDetail()
},
computed: {
isHeight() {
const { billStatus, deliveryStatus } = this.allocateOrderInfo || {}
const staffType = this.staffType
return (
(billStatus === 1 && staffType == 2) ||
(billStatus === 2 && staffType == 3) ||
(deliveryStatus === 1 && staffType == 4 && billStatus == 5)
)
}
},
mounted() {
this.tableColumns.forEach(item=>{
//运营审核屏蔽调出门店
if(item.label == '调出门店库存'&&this.staffType == 2){
item.isHidden = true
}
})
},
methods: {
formatOpinionText(opinion) {
const s = String(opinion == null ? "-" : opinion);
return s.replace(/\\r\\n/g, "\n").replace(/\\n/g, "\n");
},
handleProductClick(row){
this.$router.push({
path: '/cannibalize/detail',
query: {
id: row.id,
staffType:this.staffType,
yqMerchantId:row.yqMerchantId
}
})
},
handleApproveCancel() {
this.approveVisible = false
},
handleCancel() {
this.rejectVisible = false
},
handleSuccess() {
this.handleCancel()
this.allocateOrderDetail()
},
handleApproveSuccess() {
this.handleApproveCancel()
this.allocateOrderDetail()
},
getStepText(opts, status, key) {
const mapping = this[opts][status]
return mapping ? mapping[key] : ''
},
getStatusItem(baseData, optKey, row, rowKey) {
if (!baseData || !baseData[optKey] || !row) return null
return baseData[optKey].find(
item => item.confId == row[rowKey] // 使用严格相等
)
},
handleSelect() {
this.sendOutVisible = true
},
async allocateOrderDetail() {
let result = await allocateApi.allocateOrderDetail({ allocateCode: this.orderCode })
if (result.code == 0) {
this.allocateOrderInfo = result.data
}
},
//驳回
handleReject() {
this.rejectVisible = true
},
//通过
handleApprove() {
this.approveVisible = true
}
}
}
</script>
<style scoped lang="scss">
.layout {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
.footer {
display: flex;
align-items: center;
justify-content: space-between;
margin: 7px 16px 10px;
.btn {
flex: 1;
border-radius: 6px;
height: 41px;
line-height: 41px;
font-size: 16px;
}
.reject {
border: 1px solid #dee0e3;
background: #f4f5f7;
color: #292d33;
text-align: center;
}
.approve {
background: #347bff;
color: #ffffff;
text-align: center;
margin-left: 11px;
}
}
}
.allocate {
width: 100vw;
padding: 12px 10px;
box-sizing: border-box;
height: calc(100% - 68px);
overflow: scroll;
.info-section {
padding: 16px 16px 6px;
border-radius: 8px;
font-size: 14px;
background: #ffffff;
box-sizing: border-box;
margin-bottom: 12px;
.title {
color: #333333;
font-size: 15px;
margin-bottom: 10px;
position: relative;
font-weight: 600;
.status {
font-size: 13px;
position: absolute;
right: 0px;
font-weight: normal;
top: 0px;
}
.title-tip {
color: #999999;
font-size: 12px;
font-weight: 400;
margin-left: 4px;
}
}
}
.info-item {
margin-bottom: 10px;
display: flex;
}
.info-item :nth-child(1) {
display: inline-block;
width: 88px;
color: #999999;
margin-right: 12px;
}
.info-item :nth-child(2) {
color: #292d33;
width: 223px;
white-space: wrap;
display: inline-block;
white-space: pre-wrap;
word-break: break-word;
}
.word-break {
white-space: pre-wrap;
word-break: break-word;
}
}
</style>