merchantOrder.vue
12.5 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
<template>
<d2-container>
<el-card shadow="never">
<el-form :inline="true" :model="formInline" class="demo-form-inline" size="small">
<el-form-item label="订单ID">
<el-input v-model="formInline.orderNumber" placeholder="请输入订单ID" />
</el-form-item>
<el-form-item label="物流编码">
<el-input v-model="formInline.materialCode" placeholder="请输入物流编码" />
</el-form-item>
<el-form-item label="产品类型">
<el-select v-model="formInline.type" placeholder="请选择">
<el-option value="" label="全部">全部</el-option>
<el-option v-for="item in deviceTypeList" :key="item.id" :value="item.id" :label="item.name">{{item.name}}</el-option>
</el-select>
</el-form-item>
<el-form-item label="下单商户名称">
<el-input v-model="formInline.merchantName" placeholder="请输入下单商户名称" />
</el-form-item>
<el-form-item label="渠道类型">
<el-select v-model="formInline.channel" placeholder="请选择">
<el-option value="" label="全部">全部</el-option>
<el-option value="1" label="广汇代销">广汇代销</el-option>
<el-option value="2" label="金融风控代销">金融风控代销</el-option>
<el-option value="3" label="同盟会渠道">同盟会渠道</el-option>
<el-option value="4" label="金融渠道">金融渠道</el-option>
<el-option value="5" label="亿咖通">亿咖通</el-option>
<el-option value="6" label="特殊渠道(指定产品)">特殊渠道(指定产品)</el-option>
</el-select>
</el-form-item>
<el-form-item label="订单状态">
<el-select v-model="formInline.status" placeholder="请选择">
<el-option value="" label="全部">全部</el-option>
<el-option value="1" label="待审核">待审核</el-option>
<el-option value="2" label="待发货">待发货</el-option>
<el-option value="3" label="待签收">待签收</el-option>
<el-option value="4" label="部分签收">部分签收</el-option>
<el-option value="5" label="已完成">已完成</el-option>
<el-option value="6" label="已驳回">已驳回</el-option>
<el-option value="7" label="已作废">已作废</el-option>
</el-select>
</el-form-item>
<el-form-item label="下单时间">
<el-date-picker
v-model="orderDate"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
/>
</el-form-item>
<el-form-item label="审核时间">
<el-date-picker
v-model="checkDate"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" :loading="tableLoading" @click="getList()">搜索</el-button>
</el-form-item>
</el-form>
</el-card>
<!-- 表格区域 开始 -->
<div class="table_box">
<el-table v-loading="tableLoading" :data="tableData" stripe style="width: 100%" size="small" border>
<el-table-column type="index" :index="index => {return index+1}" label="序号" width="80" fixed="left" />
<el-table-column prop="orderNumber" label="订单ID" :width="tdWidth" fixed="left" />
<el-table-column prop="channel" label="商户渠道" :width="tdWidth">
<template slot-scope="scope">{{ CHANNELTYPE[scope.row.channel] }}</template>
</el-table-column>
<el-table-column prop="merchantName" label="下单商户" :width="tdWidth" />
<el-table-column prop="name" label="物料名称" :width="tdWidth">
<template slot-scope="scope">{{ scope.row.productInfo?scope.row.productInfo.name:'' }}</template>
</el-table-column>
<el-table-column prop="materialCode" label="物料编号" :width="tdWidth">
<template slot-scope="scope">{{ showMaterialCode(scope.row) }}</template>
</el-table-column>
<el-table-column prop="type" label="设备类型" :width="tdWidth">
<template slot-scope="scope">{{ showDeviceType(scope.row) }}</template>
</el-table-column>
<el-table-column prop="totalOrder" label="订购总数" :width="tdWidth" />
<el-table-column prop="totalCheck" label="审核总数" :width="tdWidth" />
<el-table-column prop="dispatchOrderNumber" label="发货单号" :width="tdWidth">
<template slot-scope="scope">{{ scope.row.merchantOrderDetailInfo?scope.row.merchantOrderDetailInfo.dispatchOrderNumber:'' }}</template>
</el-table-column>
<el-table-column prop="shipmentsQuantity" label="已发数量" :width="tdWidth">
<template slot-scope="scope">{{ scope.row.merchantOrderDetailInfo?scope.row.merchantOrderDetailInfo.shipmentsQuantity:'' }}</template>
</el-table-column>
<el-table-column prop="acceptQuantity" label="签收数量" :width="tdWidth">
<template slot-scope="scope">{{ scope.row.merchantOrderDetailInfo?scope.row.merchantOrderDetailInfo.acceptQuantity:'' }}</template>
</el-table-column>
<el-table-column prop="oweQuantity" label="欠数" :width="tdWidth">
<template slot-scope="scope">{{ scope.row.totalCheck - (scope.row.merchantOrderDetailInfo?scope.row.merchantOrderDetailInfo.shipmentsQuantity:0) }}</template>
</el-table-column>
<el-table-column prop="amount" label="产品价格" :width="tdWidth">
<template slot-scope="scope">¥{{ scope.row.amount }}</template>
</el-table-column>
<el-table-column prop="productRemarks" label="备注" :width="tdWidth">
<template slot-scope="scope">{{ scope.row.merchantOrderDetailInfo?scope.row.merchantOrderDetailInfo.productRemarks:'' }}</template>
</el-table-column>
<el-table-column prop="orderTime" label="下单时间" :width="tdWidth">
<template slot-scope="scope">{{ DATEFORMATE(scope.row.orderTime, 'YYYY-MM-DD HH:mm:ss') }}</template>
</el-table-column>
<el-table-column prop="checkBy" label="审核人" :width="tdWidth">
<template slot-scope="scope">{{ scope.row.merchantOrderDetailInfo?scope.row.merchantOrderDetailInfo.checkBy:'' }}</template>
</el-table-column>
<el-table-column prop="checkTime" label="审核时间" :width="tdWidth">
<template slot-scope="scope">{{ DATEFORMATE(scope.row.merchantOrderDetailInfo.checkTime, 'YYYY-MM-DD HH:mm:ss') }}</template>
</el-table-column>
<el-table-column prop="status" label="订单状态" :width="tdWidth">
<template slot-scope="scope">{{ ORDERSTATUS[scope.row.status] }}</template>
</el-table-column>
<el-table-column prop="remarks" label="备注一" :width="tdWidth" />
<el-table-column prop="signNumberCode" label="签收单单据号" :width="tdWidth" />
<el-table-column prop="singOrderPhoto" label="签收单图片" :width="tdWidth" />
<el-table-column prop="操作" label="操作" :width="tdWidth" fixed="right">
<template slot-scope="scope">
<el-button type="primary" size="mini" v-if="scope.row.status == 1">审核</el-button>
<el-button type="primary" size="mini" v-if="scope.row.status == 2 && showButton(scope.row)">发货</el-button>
<el-button type="primary" size="mini" v-if="scope.row.status == 2 && !showButton(scope.row)">分配发货</el-button>
<el-button type="primary" size="mini" v-if="scope.row.status == 3||scope.row.status == 4 && showSpecilButton(scope.row)">发货</el-button>
<el-button type="primary" size="mini" v-if="scope.row.status == 2">修改</el-button>
<el-button type="primary" size="mini" v-if="scope.row.status == 2">作废</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination_list">
<el-pagination
background
layout="sizes, total,prev, pager, next, jumper"
:total="pageTotal"
:page-size="pageSize"
:page-sizes="pageSizes"
@current-change="getList"
@size-change="changePageSize"
/>
</div>
</div>
<!-- 表格区域 end -->
</d2-container>
</template>
<script>
import {
GETLISTMERCHANTORDER,
GETDEVICETYPE
} from '@/http/interface'
export default {
data() {
return {
formInline: {},
tableData: [],
dialogVisible: false,
tableLoading: false,
pageTotal: 0,
userInfo: {},
currentPage: 1,
pageSizes: [10, 20, 30, 40],
pageSize: 10,
orderDate: [],
checkDate: [],
tdWidth: 170,
DATEFORMATE: (str, type) => {
return this.$Util.dateFormate(str, type)
},
deviceTypeList: [],
CHANNELTYPE: {
1: '广汇代销',
2: '金融风控代销',
3: '同盟会渠道',
4: '金融渠道',
5: '亿咖通',
6: '特殊渠道(指定产品)'
},
ORDERSTATUS: {
0: '已驳回',
1: '待审核',
2: '待发货',
3: '待签收',
4: '部分签收',
5: '已完成',
6: '已开票',
7: '已作废'
}
}
},
created() {
},
mounted: function() {
this.getList()
this.getDeviceList()
},
methods: {
/**
* 查询列表
*/
getList: function(current) {
const _this = this
const oParams = _this.getParams()
console.log(current)
oParams.pageNum = current || _this.currentPage
_this.tableLoading = true
GETLISTMERCHANTORDER(oParams).then(res => {
console.log(res)
_this.tableLoading = false
if (res.returnCode == 0) {
const {
data
} = res
const {
total,
list
} = data
_this.tableData = list || []
_this.pageTotal = total
}
})
},
/**
* 获取查询参数
*/
getParams: function() {
const mk = this.formInline
const m = this.orderDate
const n = this.checkDate
let oParams = {}
if (m && m.length > 0) {
mk.startDate = m[0]
mk.endDate = m[1]
} else {
delete mk.startDate
delete mk.endDate
}
if (n && n.length > 0) {
mk.checkStartDate = n[0]
mk.checkEndDate = n[1]
} else {
delete mk.checkStartDate
delete mk.checkEndDate
}
oParams.condition = mk
oParams.pageSize = this.pageSize
return oParams
},
/**
* 每页展示
*/
changePageSize: function(e) {
this.pageSize = e
this.getList()
},
/**
* 获取设备类型列表
*/
getDeviceList: function() {
let _this = this
GETDEVICETYPE().then(res => {
const { data } = res
_this.deviceTypeList = data || []
})
},
/**
* 表格中显示设备类型
*/
showDeviceType: function(row) {
const l = this.deviceTypeList
const t = row.productInfo?row.productInfo.type:''
let n = ''
const m = l.find(function(k){
return k.id == t
})
if (m) {
n = m.name
}
return n
},
/**
* 表格中显示物料编号
*/
showMaterialCode: function(row) {
let m = row.productInfo?row.productInfo:{}
let n = m.productDetailList || []
let j = ''
let b = n.find(k => {
return k.type == 0 || k.type == 7
})
if (b) {
j = b.materialCode
}
return j
},
/**
* 表格中显示操作按钮
*/
showButton: function(row) {
let m = row.productInfo ? row.productInfo.type : ''
if (m == 10) {
return true
} else {
return false
}
},
/**
* 表格中显示操作按钮
*/
showSpecilButton: function(row) {
let status = row.status
let m = row.logisticsList || []
let b = row.merchantOrderDetailInfo?row.merchantOrderDetailInfo.shipmentsQuantity:''
let n = m.find(function(k){
return k.type == 5
})
if(n){
if(b != row.totalCheck){
return true
}
}else{
return false
}
}
}
}
</script>
<style lang="scss">
.table_box {
margin: 20px 0;
}
</style>