jufubao-admin-library 1.0.0-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +90 -0
- package/library/gulpfile.js/const.js +51 -0
- package/library/gulpfile.js/index.js +237 -0
- package/library/gulpfile.js/util.js +114 -0
- package/library/viewModules/config.js +75 -0
- package/library/viewModules/viewStat/router/supplierStat.js +33 -0
- package/library/viewModules/viewStat/schemas/supplier.stat.js +70 -0
- package/library/viewModules/viewStat/schemas.js +18 -0
- package/library/viewModules/viewStat/viewsStat/index/components/stat-all.vue +233 -0
- package/library/viewModules/viewStat/viewsStat/index/components/stat-product.vue +129 -0
- package/library/viewModules/viewStat/viewsStat/index/components/stat-supplier.vue +124 -0
- package/library/viewModules/viewStat/viewsStat/index/components/table-category.vue +309 -0
- package/library/viewModules/viewStat/viewsStat/index/components/table-product.vue +316 -0
- package/library/viewModules/viewStat/viewsStat/index/components/table-supplier.vue +276 -0
- package/library/viewModules/viewStat/viewsStat/index/index.vue +117 -0
- package/library/viewModules/viewTask/router/tasks.js +34 -0
- package/library/viewModules/viewTask/schemas/tasks.js +52 -0
- package/library/viewModules/viewTask/viewTask/list.vue +195 -0
- package/library/viewModules/viewsEnterpriseBuy/router/enterprise_buy.js +91 -0
- package/library/viewModules/viewsEnterpriseBuy/schemas/enterprise_buy.js +420 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/OrderInfoButton.vue +550 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/cardList.vue +119 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/expressCopy.vue +259 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/operateHistory.vue +164 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/send_list.vue +395 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/storeList.vue +100 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/workHistory.vue +163 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/detail.vue +503 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/list.vue +635 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/order_detail.vue +860 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/set_create.vue +219 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/set_list.vue +237 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/table-card.vue +180 -0
- package/library/viewModules/viewsFinance/router/balance.js +75 -0
- package/library/viewModules/viewsFinance/router/finance.js +30 -0
- package/library/viewModules/viewsFinance/schemas/trade.record.js +153 -0
- package/library/viewModules/viewsFinance/schemas/wallet.js +116 -0
- package/library/viewModules/viewsFinance/viewsFinance/balance/components/listChannel.vue +220 -0
- package/library/viewModules/viewsFinance/viewsFinance/balance/components/listOpenapi.vue +260 -0
- package/library/viewModules/viewsFinance/viewsFinance/balance/components/listPartner.vue +217 -0
- package/library/viewModules/viewsFinance/viewsFinance/balance/components/listSupplier.vue +229 -0
- package/library/viewModules/viewsFinance/viewsFinance/balance/detail_channel.vue +401 -0
- package/library/viewModules/viewsFinance/viewsFinance/balance/detail_openapi.vue +364 -0
- package/library/viewModules/viewsFinance/viewsFinance/balance/detail_partner.vue +633 -0
- package/library/viewModules/viewsFinance/viewsFinance/balance/detail_supplier.vue +417 -0
- package/library/viewModules/viewsFinance/viewsFinance/balance/list.vue +75 -0
- package/library/viewModules/viewsFinance/viewsFinance/index.vue +191 -0
- package/library/viewModules/viewsLimit/router/buyLimit/buyLimit.js +31 -0
- package/library/viewModules/viewsLimit/schemas/buyLimit.js +22 -0
- package/library/viewModules/viewsLimit/viewsLimit/index.vue +211 -0
- package/package.json +114 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="app-container">
|
|
3
|
+
<el-card class="app-container__search">
|
|
4
|
+
<xd-search
|
|
5
|
+
dateFilter
|
|
6
|
+
v-if="searchForm.length > 0"
|
|
7
|
+
v-model="searchParams"
|
|
8
|
+
:list="searchForm"
|
|
9
|
+
@onSearch="handleSearch"
|
|
10
|
+
@onDone="getList"
|
|
11
|
+
></xd-search>
|
|
12
|
+
</el-card>
|
|
13
|
+
<el-card class="app-container__list">
|
|
14
|
+
<div class="app-container__list-pagination">
|
|
15
|
+
<div></div>
|
|
16
|
+
<div class="table-stat">
|
|
17
|
+
<p>共计 销量<span>{{totalData.product_num}}</span>个,
|
|
18
|
+
建议售价金额<span>{{divide(totalData.sale_amount) }}</span>元,
|
|
19
|
+
货源进货价金额<span>{{divide(totalData.purchase_amount)}}</span>元,
|
|
20
|
+
平台进货价金额<span>{{divide(totalData.dist_amount)}}</span>元</p>
|
|
21
|
+
<el-button type="primary" @click="doExport">条件导出</el-button>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="app-container__list-table">
|
|
25
|
+
<xd-table
|
|
26
|
+
:headers="headers"
|
|
27
|
+
:list="tables"
|
|
28
|
+
is-border
|
|
29
|
+
@onSortChange="handleSortChange"
|
|
30
|
+
></xd-table>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="app-container__list-pagination">
|
|
33
|
+
<xd-pagination
|
|
34
|
+
:page="page_token"
|
|
35
|
+
:total="total"
|
|
36
|
+
:limit.sync="page_size"
|
|
37
|
+
:autoScroll="false"
|
|
38
|
+
@onPagination="handlePagination"
|
|
39
|
+
></xd-pagination>
|
|
40
|
+
</div>
|
|
41
|
+
</el-card>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<script>
|
|
47
|
+
import XdSearch from "@/components/XdSearch";
|
|
48
|
+
import XdPagination from "@/components/XdPagination.vue";
|
|
49
|
+
import XdTable from "@/components/XdTable";
|
|
50
|
+
import { baseJsDateToTime } from "@/utils/xd.base";
|
|
51
|
+
import { getOptions } from "@/utils/options"
|
|
52
|
+
import { mapActions } from "vuex"
|
|
53
|
+
|
|
54
|
+
export default {
|
|
55
|
+
name: "ComponentTableSupplier",
|
|
56
|
+
components: {
|
|
57
|
+
XdPagination, //翻译插件
|
|
58
|
+
XdSearch, //搜查插件
|
|
59
|
+
XdTable
|
|
60
|
+
},
|
|
61
|
+
data() {
|
|
62
|
+
return {
|
|
63
|
+
|
|
64
|
+
//分页参数
|
|
65
|
+
page_token: 1, //当前页面数量
|
|
66
|
+
page_size: 20, //搜索参数
|
|
67
|
+
total: 0,
|
|
68
|
+
searchForm: [], //搜索区域模块表单
|
|
69
|
+
searchParams: null, //搜索参数
|
|
70
|
+
sort_by: "", //排序字段
|
|
71
|
+
sort_direct: "", //排序方向 asc递增 desc递减
|
|
72
|
+
totalData: {},
|
|
73
|
+
supplierLevel: [],
|
|
74
|
+
|
|
75
|
+
//列表对象
|
|
76
|
+
tables: [],
|
|
77
|
+
headers: [
|
|
78
|
+
{ "type": "normal", "prop": "supplier_id", "align": "left", "width": 80, "label": "供应商ID" },
|
|
79
|
+
{ "type": "normal", "prop": "supplier_name", "align": "center", "minWidth": 200, "label": "供应商名称" },
|
|
80
|
+
{ "type": "normal", "prop": "supplier_level", "align": "center", "width": 80, "label": "供应商评级" },
|
|
81
|
+
{ "type": "normal", "prop": "total_product_num", "align": "center", "width": 100, "label": "总销量", "sort": "custom" },
|
|
82
|
+
{ "type": "price", "prop": "total_sale_amount", "align": "center", "width": 100, "label": "建议售价金额", "unit": "元", "sort": "custom" },
|
|
83
|
+
{ "type": "price", "prop": "total_purchase_amount", "align": "center", "width": 100, "label": "货源进货价金额", "unit": "元", "sort": "custom" },
|
|
84
|
+
{ "type": "price", "prop": "total_dist_amount", "align": "center", "width": 100, "label": "平台进货价金额", "unit": "元", "sort": "custom" },
|
|
85
|
+
{ "type": "normal", "prop": "total_real_product_num", "align": "center", "minWidth": 100, "label": "实际销量", "sort": "custom" },
|
|
86
|
+
{ "type": "price", "prop": "total_real_sale_amount", "align": "center", "width": 120, "label": "实际建议售价金额", "unit": "元", "sort": "custom" },
|
|
87
|
+
{ "type": "normal", "prop": "total_aftersale_product_num", "align": "center", "minWidth": 100, "label": "售后次数", "sort": "custom" },
|
|
88
|
+
{ "type": "price", "prop": "total_aftersale_amount", "align": "center", "width": 100, "label": "售后建议售价金额", "unit": "元", "sort": "custom" },
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
created() {
|
|
93
|
+
getOptions({
|
|
94
|
+
server: 'supplier-public',
|
|
95
|
+
fn: 'supplier-level',
|
|
96
|
+
path: 'p1',
|
|
97
|
+
}).then(res => {
|
|
98
|
+
this.supplierLevel = res.data.list;
|
|
99
|
+
}).finally(() => {
|
|
100
|
+
this.initSearchForm();
|
|
101
|
+
})
|
|
102
|
+
},
|
|
103
|
+
methods: {
|
|
104
|
+
...mapActions("supplierStat", ['supplierCycSales']),
|
|
105
|
+
divide(price) {
|
|
106
|
+
return this.$xdHelper.divisionFloatNumber(price, 100);
|
|
107
|
+
},
|
|
108
|
+
doExport(){
|
|
109
|
+
this.$prompt('请输入导出文件名称', '提示', {
|
|
110
|
+
confirmButtonText: '确定',
|
|
111
|
+
cancelButtonText: '取消',
|
|
112
|
+
inputPattern: /[\S]+/,
|
|
113
|
+
inputErrorMessage: '请填写正确的名称'
|
|
114
|
+
}).then(({ value }) => {
|
|
115
|
+
let { supplier_id, ...other } = this.searchParams;
|
|
116
|
+
if(supplier_id && supplier_id.length > 0){
|
|
117
|
+
other.supplier_id = supplier_id[0].value;
|
|
118
|
+
}
|
|
119
|
+
let params = {
|
|
120
|
+
...other,
|
|
121
|
+
export: true,
|
|
122
|
+
file_ext: "xlsx",
|
|
123
|
+
file_name: value,
|
|
124
|
+
};
|
|
125
|
+
let loading = this.$loading({});
|
|
126
|
+
this.supplierCycSales(params).then(res => {
|
|
127
|
+
loading.close();
|
|
128
|
+
this.$alert('导出任务已经开始执行,请去任务管理查看下载状态', '提示', {
|
|
129
|
+
confirmButtonText: '确定',
|
|
130
|
+
});
|
|
131
|
+
}).catch(err => {
|
|
132
|
+
this.$message.error(err.msg);
|
|
133
|
+
loading.close();
|
|
134
|
+
})
|
|
135
|
+
})
|
|
136
|
+
},
|
|
137
|
+
/**
|
|
138
|
+
* @description 获取数据列表
|
|
139
|
+
*/
|
|
140
|
+
getList() {
|
|
141
|
+
let { supplier_id, ...other } = this.searchParams;
|
|
142
|
+
if(supplier_id && supplier_id.length > 0){
|
|
143
|
+
other.supplier_id = supplier_id[0].value;
|
|
144
|
+
}
|
|
145
|
+
//请求数据
|
|
146
|
+
let params = {
|
|
147
|
+
...other,
|
|
148
|
+
page_token: this.page_token,
|
|
149
|
+
page_size: this.page_size,
|
|
150
|
+
sort_by: this.sort_by,
|
|
151
|
+
sort_direct: this.sort_direct,
|
|
152
|
+
};
|
|
153
|
+
console.log(params)
|
|
154
|
+
let loading = this.$loading({});
|
|
155
|
+
this.supplierCycSales(params).then(res => {
|
|
156
|
+
loading.close();
|
|
157
|
+
this.tables = res.data.list;
|
|
158
|
+
this.totalData = res.data.total;
|
|
159
|
+
this.total = res.data.total_page_size
|
|
160
|
+
}).catch(err => {
|
|
161
|
+
loading.close();
|
|
162
|
+
})
|
|
163
|
+
},
|
|
164
|
+
handleSortChange({ prop, order }) {
|
|
165
|
+
if(order === null){
|
|
166
|
+
this.sort_by = '';
|
|
167
|
+
this.sort_direct = '';
|
|
168
|
+
this.getList();
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
this.sort_by = prop;
|
|
172
|
+
this.sort_direct = order === 'ascending' ? 'asc' : 'desc';
|
|
173
|
+
this.getList();
|
|
174
|
+
},
|
|
175
|
+
/**
|
|
176
|
+
* @description 点击搜索进行搜索操作
|
|
177
|
+
* @param action 动作
|
|
178
|
+
* @param form 搜索请求参数
|
|
179
|
+
*/
|
|
180
|
+
handleSearch({ action, form }) {
|
|
181
|
+
this.page_token = 1;
|
|
182
|
+
this.getList();
|
|
183
|
+
},
|
|
184
|
+
/**
|
|
185
|
+
* @description 初始化搜索模块
|
|
186
|
+
*/
|
|
187
|
+
initSearchForm() {
|
|
188
|
+
let yesterDay = new Date().getTime() - 24 * 60 * 60 * 1000;
|
|
189
|
+
yesterDay = baseJsDateToTime(yesterDay/1000);
|
|
190
|
+
yesterDay = yesterDay.split(' ')[0];
|
|
191
|
+
|
|
192
|
+
this.searchForm = [
|
|
193
|
+
{
|
|
194
|
+
label: '交易时间:', //label
|
|
195
|
+
ele: 'xd-date', //package 名称
|
|
196
|
+
valueKey: ['time_range_start', 'time_range_end'], //form[valueKey]
|
|
197
|
+
value: [yesterDay, yesterDay], //v-model
|
|
198
|
+
format: 'yyyy-MM-dd', //时间显示格式
|
|
199
|
+
formatValue: 'yyyy-MM-dd', //输出时间格式
|
|
200
|
+
placeholder: ['开始时间', '结束时间'],
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
label: "供应商名称:", //label
|
|
204
|
+
ele: "xd-remote-select", //package 名称
|
|
205
|
+
valueKey: "supplier_id", //form[valueKey]s
|
|
206
|
+
value: [], //v-model
|
|
207
|
+
placeholder: "请选择供应商",
|
|
208
|
+
multiple: false,
|
|
209
|
+
collapseTags: false,
|
|
210
|
+
className: 'input40',
|
|
211
|
+
remoteSearch: (query, resolve) => {
|
|
212
|
+
getOptions({
|
|
213
|
+
server: 'supplier-partner',
|
|
214
|
+
fn: 'supplier',
|
|
215
|
+
path: 'p1',
|
|
216
|
+
params: {
|
|
217
|
+
keyword: query,
|
|
218
|
+
page_token: 1,
|
|
219
|
+
page_size: 500,
|
|
220
|
+
}
|
|
221
|
+
})
|
|
222
|
+
.then(res => {
|
|
223
|
+
resolve(res.data.list)
|
|
224
|
+
})
|
|
225
|
+
.catch(err => {
|
|
226
|
+
console.log(err, 'err')
|
|
227
|
+
})
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
// {
|
|
231
|
+
// label: "供应商名称",
|
|
232
|
+
// ele: "el-input",
|
|
233
|
+
// valueKey: "supplier_id",
|
|
234
|
+
// value: "",
|
|
235
|
+
// placeholder: "请输入供应商名称"
|
|
236
|
+
// },
|
|
237
|
+
{
|
|
238
|
+
label: "供应商评级",
|
|
239
|
+
ele: "xd-select-list",
|
|
240
|
+
valueKey: "supplier_level",
|
|
241
|
+
value: "",
|
|
242
|
+
placeholder: "请选择供应商评级",
|
|
243
|
+
list: this.supplierLevel
|
|
244
|
+
},
|
|
245
|
+
];
|
|
246
|
+
},
|
|
247
|
+
/**
|
|
248
|
+
* @description 翻页处理方法
|
|
249
|
+
* @param page {Number} 访问页面页码数
|
|
250
|
+
*/
|
|
251
|
+
handlePagination(page) {
|
|
252
|
+
this.page_token = page;
|
|
253
|
+
this.getList();
|
|
254
|
+
}, //todo
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
</script>
|
|
258
|
+
|
|
259
|
+
<style scoped lang="scss">
|
|
260
|
+
.table-stat{
|
|
261
|
+
display: flex;
|
|
262
|
+
justify-content: space-between;
|
|
263
|
+
align-items: center;
|
|
264
|
+
p{
|
|
265
|
+
font-size: 14px;
|
|
266
|
+
color: #2E3033;
|
|
267
|
+
span{
|
|
268
|
+
color: #FF6A00;
|
|
269
|
+
font-weight: 600;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
</style>
|
|
276
|
+
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="app-container">
|
|
3
|
+
<stat-all v-permission="[Role.totalCounts]"></stat-all>
|
|
4
|
+
<stat-product v-permission="[Role.productCycCounts]" style="margin-top: 20px;"></stat-product>
|
|
5
|
+
<stat-supplier v-permission="[Role.supplierCycCounts]" style="margin-top: 20px"></stat-supplier>
|
|
6
|
+
<el-card v-if="has_tab" style="margin-top: 20px;">
|
|
7
|
+
<el-tabs v-model="activeName" >
|
|
8
|
+
<el-tab-pane v-if="has_tab_supplier" label="供应商" name="supplier">
|
|
9
|
+
<table-supplier v-if="has_tab_supplier"></table-supplier>
|
|
10
|
+
</el-tab-pane>
|
|
11
|
+
<el-tab-pane v-if="has_tab_product" label="货源商品" name="product">
|
|
12
|
+
<table-product v-if="has_tab_product"></table-product>
|
|
13
|
+
</el-tab-pane>
|
|
14
|
+
<el-tab-pane v-if="has_tab_category" label="货源商品分类" name="category">
|
|
15
|
+
<table-category v-if="has_tab_category"></table-category>
|
|
16
|
+
</el-tab-pane>
|
|
17
|
+
</el-tabs>
|
|
18
|
+
</el-card>
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
import {mapActions} from 'vuex';
|
|
25
|
+
import statAll from "./components/stat-all.vue"
|
|
26
|
+
import statProduct from "./components/stat-product.vue"
|
|
27
|
+
import statSupplier from "./components/stat-supplier.vue"
|
|
28
|
+
import tableSupplier from "./components/table-supplier.vue"
|
|
29
|
+
import tableProduct from "./components/table-product.vue"
|
|
30
|
+
import tableCategory from "./components/table-category.vue"
|
|
31
|
+
import checkPermission from "@/utils/permission"
|
|
32
|
+
import Role from "@/constant/modules/supplierStat"
|
|
33
|
+
|
|
34
|
+
export default {
|
|
35
|
+
name: 'AppDashboard',
|
|
36
|
+
components: {
|
|
37
|
+
statAll,
|
|
38
|
+
statProduct,
|
|
39
|
+
statSupplier,
|
|
40
|
+
tableSupplier,
|
|
41
|
+
tableProduct,
|
|
42
|
+
tableCategory
|
|
43
|
+
},
|
|
44
|
+
data() {
|
|
45
|
+
return {
|
|
46
|
+
Role,
|
|
47
|
+
title: '',
|
|
48
|
+
activeName: "supplier",
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
computed: {
|
|
52
|
+
has_tab_supplier(){
|
|
53
|
+
return checkPermission([Role.supplierCycSales])
|
|
54
|
+
},
|
|
55
|
+
has_tab_product(){
|
|
56
|
+
return checkPermission([Role.productCycSales])
|
|
57
|
+
},
|
|
58
|
+
has_tab_category(){
|
|
59
|
+
return checkPermission([Role.productCategoryCycSales])
|
|
60
|
+
},
|
|
61
|
+
has_tab(){
|
|
62
|
+
return checkPermission([Role.supplierCycSales, Role.productCycSales, Role.productCategoryCycSales])
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
created() {
|
|
67
|
+
if(this.has_tab){
|
|
68
|
+
this.activeName = this.has_tab_supplier ? "supplier" : this.has_tab_product ? "product" : "category"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
methods: {
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<style lang="scss" scoped>
|
|
78
|
+
.app-container {
|
|
79
|
+
height: 100%;
|
|
80
|
+
// padding: 80px 0 0;
|
|
81
|
+
|
|
82
|
+
&__image {
|
|
83
|
+
max-width: 500px;
|
|
84
|
+
margin: 0 auto;
|
|
85
|
+
|
|
86
|
+
& > img {
|
|
87
|
+
width: 100%;
|
|
88
|
+
opacity: 0.8;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&__indextitle {
|
|
93
|
+
font-size: 40px;
|
|
94
|
+
font-weight: bold;
|
|
95
|
+
padding: 50px 0;
|
|
96
|
+
text-align: center;
|
|
97
|
+
color: #444;
|
|
98
|
+
text-shadow: 5px -2px 4px rgba(0, 0, 0, .1);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@media screen and (max-width: 768px) {
|
|
104
|
+
.app-container {
|
|
105
|
+
|
|
106
|
+
&__image {
|
|
107
|
+
max-width: 80vw;
|
|
108
|
+
margin: 0 auto;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&__indextitle {
|
|
112
|
+
font-size: 20px;
|
|
113
|
+
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import Layout from '@/layout'
|
|
4
|
+
import task from '@/constant/modules/tasks' //引用权限值
|
|
5
|
+
|
|
6
|
+
const tasksRouter = {
|
|
7
|
+
path: '/tasks',
|
|
8
|
+
sort: 70,
|
|
9
|
+
component: Layout,
|
|
10
|
+
name: '任务管理',
|
|
11
|
+
redirect: '/tasks/list',
|
|
12
|
+
meta: {
|
|
13
|
+
title: '任务管理',
|
|
14
|
+
icon: 'xdicon_rizhi',
|
|
15
|
+
iconSize: 22,
|
|
16
|
+
roles: [task.getAsyncList]
|
|
17
|
+
},
|
|
18
|
+
children: [
|
|
19
|
+
{
|
|
20
|
+
path: 'list',
|
|
21
|
+
name: '任务管理',
|
|
22
|
+
component: () => import ('@/viewTask/list'),
|
|
23
|
+
meta: {
|
|
24
|
+
title: '任务管理',
|
|
25
|
+
icon: 'xdicon_rizhi',
|
|
26
|
+
iconSize: 22,
|
|
27
|
+
roles: [task.getAsyncList]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default tasksRouter
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
name: 'tasks',
|
|
5
|
+
title: '任务管理',
|
|
6
|
+
vuex: true,
|
|
7
|
+
model: [
|
|
8
|
+
{
|
|
9
|
+
mapFn: 'getAsyncList',
|
|
10
|
+
isRule: false,
|
|
11
|
+
title: '获取任务列表',
|
|
12
|
+
// #ifdef admin partner partner-stat oa-finance supplier
|
|
13
|
+
path: '/@@@@/v1/async/list',
|
|
14
|
+
// #endif
|
|
15
|
+
//#ifdef partner-gift partner-mall partner-movie partner-market
|
|
16
|
+
path: '/@@@@/v1/:xsiteid/:xnamespace/async/list',
|
|
17
|
+
// #endif
|
|
18
|
+
params: {
|
|
19
|
+
page_token: ['页码', 'String', '必选'],
|
|
20
|
+
page_size: ['页长', 'Number', '必选'],
|
|
21
|
+
partner_id: ['加盟商id', 'Number', '非必选'],
|
|
22
|
+
},
|
|
23
|
+
disabled: true,
|
|
24
|
+
role: '@@@@.@@@@@.SYSTEM_TASKS_LIST',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
mapFn: 'asyncRetry',
|
|
28
|
+
isRule: false,
|
|
29
|
+
title: '任务query',
|
|
30
|
+
// #ifdef admin partner partner-stat oa-finance supplier
|
|
31
|
+
path: '/@@@@/v1/async/retry',
|
|
32
|
+
// #endif
|
|
33
|
+
// #ifdef partner-gift partner-mall partner-movie partner-market
|
|
34
|
+
path: '/@@@@/v1/:xsiteid/:xnamespace/async/retry',
|
|
35
|
+
// #endif
|
|
36
|
+
params: {
|
|
37
|
+
serial_no: ['id', 'String', '必选'],
|
|
38
|
+
},
|
|
39
|
+
disabled: true,
|
|
40
|
+
// #ifdef admin
|
|
41
|
+
role: 'ROLE_ADMIN_SYSTEM_TASKS_AGAIN',
|
|
42
|
+
// #endif
|
|
43
|
+
// #ifndef admin
|
|
44
|
+
role: '',
|
|
45
|
+
// #endif
|
|
46
|
+
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
],
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="app-container">
|
|
3
|
+
<el-card class="app-container__list">
|
|
4
|
+
<div slot="header">导出任务</div>
|
|
5
|
+
<div class="app-container__list-pagination">
|
|
6
|
+
<div></div>
|
|
7
|
+
<div>
|
|
8
|
+
<el-button type="primary" @click="getList()">刷新</el-button>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="app-container__list-table">
|
|
12
|
+
<xd-table
|
|
13
|
+
is-border
|
|
14
|
+
:get-link="getLink"
|
|
15
|
+
:headers="headers"
|
|
16
|
+
:list="tables"
|
|
17
|
+
@onClick="handleBtnClick"
|
|
18
|
+
>
|
|
19
|
+
<template
|
|
20
|
+
slot="file_name"
|
|
21
|
+
slot-scope="scope"
|
|
22
|
+
>{{scope.row.file_name}}.{{scope.row.file_ext}}</template>
|
|
23
|
+
<template slot="operate" slot-scope="scope">
|
|
24
|
+
<el-button
|
|
25
|
+
type="primary"
|
|
26
|
+
size="small"
|
|
27
|
+
@click="handleOperate(item.action,scope.row.serial_no,scope.row.download_url)"
|
|
28
|
+
v-for="(item,index) in scope.row.buttons"
|
|
29
|
+
:key="index"
|
|
30
|
+
>{{item.title}}</el-button>
|
|
31
|
+
</template>
|
|
32
|
+
</xd-table>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="app-container__list-pagination">
|
|
35
|
+
<xd-pagination
|
|
36
|
+
:total="total"
|
|
37
|
+
:limit.sync="limit"
|
|
38
|
+
:page="pageSize"
|
|
39
|
+
:auto-scroll="false"
|
|
40
|
+
@onPagination="handlePagination"
|
|
41
|
+
></xd-pagination>
|
|
42
|
+
</div>
|
|
43
|
+
</el-card>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script>
|
|
48
|
+
import XdPagination from "@/components/XdPagination.vue"
|
|
49
|
+
import XdTable from "@/components/XdTable"
|
|
50
|
+
import XdSearch from "@/components/XdSearch"
|
|
51
|
+
import { Loading } from 'element-ui'
|
|
52
|
+
import checkPermission from "@/utils/permission"
|
|
53
|
+
import {
|
|
54
|
+
mapActions,
|
|
55
|
+
mapState,
|
|
56
|
+
} from 'vuex'
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
export default {
|
|
60
|
+
name: "PageTasksList",
|
|
61
|
+
components: {
|
|
62
|
+
XdPagination, //翻译插件
|
|
63
|
+
XdTable,
|
|
64
|
+
XdSearch
|
|
65
|
+
},
|
|
66
|
+
data () {
|
|
67
|
+
return {
|
|
68
|
+
|
|
69
|
+
//搜索
|
|
70
|
+
searchForm: [], //搜索区域模块表单
|
|
71
|
+
searchParams: null, //搜索参数
|
|
72
|
+
|
|
73
|
+
//分页参数
|
|
74
|
+
pageSize: 1, //当前页面数量
|
|
75
|
+
limit: 20, //搜索参数
|
|
76
|
+
total: 0,
|
|
77
|
+
|
|
78
|
+
//列表对象
|
|
79
|
+
tables: [],
|
|
80
|
+
headers: [
|
|
81
|
+
{ "type": "normal", "prop": "serial_no", "align": "center", "width": 120, "label": "ID" },
|
|
82
|
+
{ "type": "normal", "prop": "file_name", "align": "center", "minWidth": 200, "label": "文件名称" },
|
|
83
|
+
{ "type": "normal", "prop": "status_text", "align": "center", "width": 100, "label": "任务状态" },
|
|
84
|
+
{ "type": "normal", "prop": "error_reason", "align": "center", "minWidth": 200, "label": "错误原因" },
|
|
85
|
+
{ "type": "normal", "prop": "admin_user", "align": "center", "width": 100, "label": "操作人" },
|
|
86
|
+
{ "type": "normal", "prop": "created_time", "align": "center", "width": 190, "label": "创建时间" },
|
|
87
|
+
{ "type": "normal", "prop": "updated_time", "align": "center", "width": 190, "label": "更新时间" },
|
|
88
|
+
{ "type": "normal", "prop": "success_time", "align": "center", "width": 190, "label": "结束时间" },
|
|
89
|
+
{
|
|
90
|
+
"type": "operate",
|
|
91
|
+
"align": "center",
|
|
92
|
+
"prop": "operate",
|
|
93
|
+
"width": 130,
|
|
94
|
+
"isCheckHide": true,
|
|
95
|
+
"label": "操作",
|
|
96
|
+
"values": []
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
created () {
|
|
102
|
+
this.getList()
|
|
103
|
+
},
|
|
104
|
+
methods: {
|
|
105
|
+
...mapActions('tasks', [
|
|
106
|
+
'getAsyncList', 'asyncRetry'
|
|
107
|
+
]),
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @description 点击按钮操作
|
|
111
|
+
* @param value {Object} 按钮对象
|
|
112
|
+
* @param row {Object} 行对象
|
|
113
|
+
*/
|
|
114
|
+
handleBtnClick ({ value, row }) {
|
|
115
|
+
if (value.name === '编辑') {
|
|
116
|
+
this.$router.push({
|
|
117
|
+
path: '/classified/edit/1'
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @description 获取数据列表
|
|
124
|
+
*/
|
|
125
|
+
getList () {
|
|
126
|
+
|
|
127
|
+
let params = {
|
|
128
|
+
page_token: this.pageSize,
|
|
129
|
+
page_size: this.limit,
|
|
130
|
+
}
|
|
131
|
+
let loading = this.$loading({})
|
|
132
|
+
this.getAsyncList(params).then(res => {
|
|
133
|
+
const { list, total_size } = res.data
|
|
134
|
+
this.tables = list.map(item => {
|
|
135
|
+
Object.assign(item, {
|
|
136
|
+
success_time: getTimeFormat(item.success_time),
|
|
137
|
+
created_time: getTimeFormat(item.created_time),
|
|
138
|
+
updated_time: getTimeFormat(item.updated_time)
|
|
139
|
+
})
|
|
140
|
+
return item
|
|
141
|
+
})
|
|
142
|
+
this.total = total_size
|
|
143
|
+
loading.close()
|
|
144
|
+
}).catch(err => {
|
|
145
|
+
loading.close()
|
|
146
|
+
})
|
|
147
|
+
},
|
|
148
|
+
/**
|
|
149
|
+
* @description 预设获取页面跳转地址方法(次场景可以不实现)
|
|
150
|
+
* @param item
|
|
151
|
+
*/
|
|
152
|
+
getLink (item) {
|
|
153
|
+
return '/'
|
|
154
|
+
},
|
|
155
|
+
/**
|
|
156
|
+
*按钮操作
|
|
157
|
+
**/
|
|
158
|
+
handleOperate (action, serial_no, url) {
|
|
159
|
+
if (action === 'retry') {
|
|
160
|
+
//重新执行
|
|
161
|
+
this.asyncRetry({ serial_no: serial_no })
|
|
162
|
+
.then(res => {
|
|
163
|
+
this.$message({
|
|
164
|
+
type: 'success',
|
|
165
|
+
message: '操作成功!'
|
|
166
|
+
})
|
|
167
|
+
this.getList()
|
|
168
|
+
}).catch(err => {
|
|
169
|
+
console.log(err, 'err')
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
} else if (action === 'download') {
|
|
173
|
+
//下载
|
|
174
|
+
window.open(url)
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
/**
|
|
178
|
+
* @description 翻页处理方法
|
|
179
|
+
* @param page {Number} 访问页面页码数
|
|
180
|
+
*/
|
|
181
|
+
handlePagination (page) {
|
|
182
|
+
this.pageSize = page
|
|
183
|
+
this.getList()
|
|
184
|
+
},
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
</script>
|
|
188
|
+
|
|
189
|
+
<style scoped lang="less">
|
|
190
|
+
.xd-table {
|
|
191
|
+
.el-button {
|
|
192
|
+
margin: 0 auto;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
</style>
|