Compare commits
171 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
a347a2a38f | |
|
|
ea8c0021db | |
|
|
f6b0bcc5f1 | |
|
|
4d1029cd6e | |
|
|
b265faa4bc | |
|
|
7c8942942d | |
|
|
bbd8405605 | |
|
|
e640d10830 | |
|
|
eead4de81f | |
|
|
0bbe08306a | |
|
|
78a51f3b81 | |
|
|
d0a43f7f43 | |
|
|
f8fbe4fe83 | |
|
|
8581e454aa | |
|
|
7035f09192 | |
|
|
8d7d3c8ea1 | |
|
|
c626bca335 | |
|
|
74a180cba1 | |
|
|
2150cacf1c | |
|
|
8099e17e2c | |
|
|
146e6ec2b1 | |
|
|
1172883260 | |
|
|
3c9fa6cc3f | |
|
|
8a3a30807a | |
|
|
bcf5d09b3b | |
|
|
66f8f95cda | |
|
|
c1eda32f29 | |
|
|
9c1a2a1de7 | |
|
|
8d2950e3f2 | |
|
|
d955593106 | |
|
|
be980f153c | |
|
|
ffd1a57c11 | |
|
|
c00c4858f7 | |
|
|
2ed4b046af | |
|
|
401f9b4daa | |
|
|
ff44b9126a | |
|
|
8b908cdc08 | |
|
|
1f06dffae3 | |
|
|
42642cdac5 | |
|
|
6f1c8bf455 | |
|
|
2ae72a8ae6 | |
|
|
f723b25933 | |
|
|
ccf923ae5e | |
|
|
233eb98ff1 | |
|
|
8b84a14032 | |
|
|
0408ccf5e5 | |
|
|
2ef2bcf83b | |
|
|
a821d74884 | |
|
|
8a3ca7d550 | |
|
|
d96cef1970 | |
|
|
629046124b | |
|
|
e37f1da1d8 | |
|
|
1ebd4c6c45 | |
|
|
bb32631a25 | |
|
|
dd77b5e154 | |
|
|
0be1523119 | |
|
|
5eff7a0dc1 | |
|
|
aff6bd0998 | |
|
|
dddc60f5a5 | |
|
|
397832c9fe | |
|
|
c03a9a1992 | |
|
|
e88ef7360a | |
|
|
36c57f5ad1 | |
|
|
c4059d109c | |
|
|
dd4c301ec6 | |
|
|
a9dd2d2374 | |
|
|
c9ac6eb138 | |
|
|
10e3af1cb3 | |
|
|
f1eda32158 | |
|
|
f37cd3b1dd | |
|
|
addb27be82 | |
|
|
ac1c17e958 | |
|
|
065d159b49 | |
|
|
8593295e21 | |
|
|
a602398cb9 | |
|
|
1bb073dc44 | |
|
|
c9bbb2d8ad | |
|
|
af774198d5 | |
|
|
ea2e040706 | |
|
|
79a341b2a2 | |
|
|
f91247a853 | |
|
|
f214412610 | |
|
|
8dde3eea48 | |
|
|
0935333d36 | |
|
|
fc0c361e94 | |
|
|
2ecd70c7ce | |
|
|
d127edaf55 | |
|
|
f39fee341e | |
|
|
456b262cbe | |
|
|
d6a8aca57f | |
|
|
d12ecff83d | |
|
|
4f927cd201 | |
|
|
2cb8006f8d | |
|
|
a6f6b1918c | |
|
|
010db705ac | |
|
|
847a682a78 | |
|
|
72cfbf259b | |
|
|
7a3fd61550 | |
|
|
6dd4146cc6 | |
|
|
c14f7e45c0 | |
|
|
6118d2ef91 | |
|
|
a06f3f3919 | |
|
|
57e2eeb66d | |
|
|
9dc307b031 | |
|
|
4750e500de | |
|
|
06101c6ed2 | |
|
|
fb732f8ebe | |
|
|
ed9ec61ab4 | |
|
|
67207be4f2 | |
|
|
6c8e4d868a | |
|
|
d5e400d0cb | |
|
|
402c1ad237 | |
|
|
c05707e6f0 | |
|
|
9e23ae3915 | |
|
|
a6113908b4 | |
|
|
9c815458a5 | |
|
|
ef518bafa0 | |
|
|
0ae7fbb32d | |
|
|
939702e998 | |
|
|
ad74689313 | |
|
|
9c98052782 | |
|
|
14e3a4d081 | |
|
|
fe9793b9f5 | |
|
|
747b408e7b | |
|
|
5110bd6d57 | |
|
|
3d4434dbbe | |
|
|
55e696a6a2 | |
|
|
5e283bb804 | |
|
|
f9ae277ca8 | |
|
|
fe2aa7359b | |
|
|
98c9b20e37 | |
|
|
0d42d145af | |
|
|
cf7bbfc030 | |
|
|
ac96e0f3e0 | |
|
|
14bf3f4ac8 | |
|
|
02f0401855 | |
|
|
d51dd3382d | |
|
|
e571869422 | |
|
|
72ed4be931 | |
|
|
5045f11c53 | |
|
|
cf5860abbc | |
|
|
83658f712c | |
|
|
d53314b523 | |
|
|
04bd127b95 | |
|
|
15b9dddc4c | |
|
|
776ad6dc26 | |
|
|
0392fc7d25 | |
|
|
eba0939005 | |
|
|
7605011b63 | |
|
|
2026193f0f | |
|
|
313ec6e6f9 | |
|
|
49569e348f | |
|
|
56477f87b5 | |
|
|
2056413f58 | |
|
|
7266dd9309 | |
|
|
192c37c946 | |
|
|
526aeda953 | |
|
|
fc9f0ea2a3 | |
|
|
075db76d00 | |
|
|
80b713c3d5 | |
|
|
f71e170a02 | |
|
|
d369fdd918 | |
|
|
a683be3873 | |
|
|
d7dd3d3372 | |
|
|
1d674d15d3 | |
|
|
8135d4616b | |
|
|
055b0a068b | |
|
|
5eb74b5463 | |
|
|
8441022041 | |
|
|
2e2205badc | |
|
|
11c6823d12 |
|
|
@ -1,11 +1,16 @@
|
|||
ENV = 'development'
|
||||
|
||||
# 接口地址
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.128:8000'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.202:8000'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.42:8000'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.133:8000'
|
||||
VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.98:8000'
|
||||
# 测试
|
||||
VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
|
||||
# 生产
|
||||
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.96:8000'
|
||||
# 张松
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.147:8000/'
|
||||
VUE_APP_WS_API = 'ws://192.168.2.128:8000'
|
||||
|
||||
# 是否启用 babel-plugin-dynamic-import-node插件
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
# 是否启用 babel-plugin-dynamic-import-node插
|
||||
|
|
@ -2,7 +2,10 @@ ENV = 'production'
|
|||
|
||||
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
||||
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
|
||||
VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
||||
# 测试
|
||||
VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
|
||||
# 生产
|
||||
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.98:8000'
|
||||
# 如果接口是 http 形式, wss 需要改为 ws
|
||||
VUE_APP_WS_API = 'wss://123.56.110.252
|
||||
|
|
|
|||
|
|
@ -38,6 +38,13 @@ npm run build:prod
|
|||
|
||||
#### 常见问题
|
||||
|
||||
0、运行报错
|
||||
解决方案:
|
||||
```
|
||||
$env:NODE_OPTIONS="--openssl-legacy-provider"
|
||||
```
|
||||
|
||||
|
||||
1、linux 系统在安装依赖的时候会出现 node-sass 无法安装的问题
|
||||
|
||||
解决方案:
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
"fuse.js": "3.4.4",
|
||||
"js-beautify": "^1.10.2",
|
||||
"js-cookie": "2.2.0",
|
||||
"js-md5": "^0.8.3",
|
||||
"jsencrypt": "^3.0.0-rc.1",
|
||||
"jszip": "^3.7.1",
|
||||
"material-components-vue": "^1.2.0",
|
||||
|
|
@ -43,9 +44,12 @@
|
|||
"normalize.css": "7.0.0",
|
||||
"nprogress": "0.2.0",
|
||||
"path-to-regexp": "2.4.0",
|
||||
"qrcode": "^1.5.3",
|
||||
"qs": "^6.10.1",
|
||||
"reconnecting-websocket": "^4.4.0",
|
||||
"screenfull": "4.2.0",
|
||||
"sortablejs": "1.8.4",
|
||||
"sortablejs": "^1.15.2",
|
||||
"terser-webpack-plugin": "^4.2.3",
|
||||
"vue": "^2.6.14",
|
||||
"vue-amap": "^0.5.10",
|
||||
"vue-clipboard2": "^0.3.3",
|
||||
|
|
@ -78,6 +82,7 @@
|
|||
"babel-jest": "23.6.0",
|
||||
"babel-plugin-dynamic-import-node": "2.3.0",
|
||||
"babel-plugin-transform-remove-console": "^6.9.4",
|
||||
"cache-loader": "^4.1.0",
|
||||
"chalk": "2.4.2",
|
||||
"chokidar": "2.1.5",
|
||||
"compression-webpack-plugin": "5.0.2",
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<meta http-equiv="pragram" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title><%= webpackConfig.name %></title>
|
||||
<script type="text/javascript">
|
||||
|
|
|
|||
|
|
@ -15,12 +15,13 @@ export default {
|
|||
高宽分别对应横竖滚动条的尺寸*/
|
||||
::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
}
|
||||
|
||||
/*定义滚动条轨道
|
||||
内阴影+圆角*/
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: #F5F5F5;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
/*定义滑块
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
import request from "@/utils/request";
|
||||
|
||||
|
||||
/**
|
||||
* 查询歌曲列表
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopSonglist(params) {
|
||||
return request({
|
||||
url: "/api/tbShopSong",
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 新增歌曲
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopSongAdd(data) {
|
||||
return request({
|
||||
url: "/api/tbShopSong",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改歌曲
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopSongEdit(data) {
|
||||
return request({
|
||||
url: "/api/tbShopSong",
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 删除歌曲
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopSongDel(ids) {
|
||||
return request({
|
||||
url: '/api/tbShopSong',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
import request from "@/utils/request";
|
||||
|
||||
/**
|
||||
* 增加打印机
|
||||
* @returns
|
||||
*/
|
||||
export function tbPrintMachine(data, method = "post") {
|
||||
return request({
|
||||
url: "/api/tbPrintMachine",
|
||||
method: method,
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取应用中心列表
|
||||
* @returns
|
||||
*/
|
||||
export function appCenterGet() {
|
||||
return request({
|
||||
url: "/api/appCenter",
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增/编辑酒品
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopStorageGood(data, method = "post") {
|
||||
return request({
|
||||
url: "/api/tbShopStorageGood",
|
||||
method: method,
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询酒品列表
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopStorageGoodlist(data) {
|
||||
return request({
|
||||
url: "/api/tbShopStorageGood/list",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增存酒
|
||||
* @returns
|
||||
*/
|
||||
export function storageWin(data) {
|
||||
return request({
|
||||
url: "/api/storage",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询存酒列表
|
||||
* @returns
|
||||
*/
|
||||
export function storageList(data) {
|
||||
return request({
|
||||
url: "/api/storage/list",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 存取酒
|
||||
* @returns
|
||||
*/
|
||||
export function storagePut(data) {
|
||||
return request({
|
||||
url: "/api/storage",
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询存取酒记录
|
||||
* @returns
|
||||
*/
|
||||
export function recordList(params) {
|
||||
return request({
|
||||
url: "/api/storage/recordList",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 存酒统计
|
||||
* @returns
|
||||
*/
|
||||
export function countRecord(data) {
|
||||
return request({
|
||||
url: "/api/storage/countRecord",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
import request from "@/utils/request";
|
||||
|
||||
/**
|
||||
* 查询耗材类型
|
||||
* @returns
|
||||
*/
|
||||
export function gettbConsType(params) {
|
||||
return request({
|
||||
url: '/api/tbConsType',
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增耗材类型
|
||||
* @returns
|
||||
*/
|
||||
export function posttbConsType(data) {
|
||||
return request({
|
||||
url: '/api/tbConsType',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 修改耗材类型
|
||||
* @returns
|
||||
*/
|
||||
export function puttbConsType(data) {
|
||||
return request({
|
||||
url: '/api/tbConsType',
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 查询耗材信息
|
||||
* @returns
|
||||
*/
|
||||
export function gettbConsInfo(params) {
|
||||
return request({
|
||||
url: '/api/tbConsInfo',
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 耗材入库
|
||||
* @returns
|
||||
*/
|
||||
export function posttbConsInfostockIn(data) {
|
||||
return request({
|
||||
url: '/api/tbConsInfo/stockIn',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 修改单位耗材值耗材
|
||||
* @returns
|
||||
*/
|
||||
export function postapitbConsInfo(data) {
|
||||
return request({
|
||||
url: '/api/tbConsInfo',
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 新增耗材信息
|
||||
* @returns
|
||||
*/
|
||||
export function posttbConsInfo(data) {
|
||||
return request({
|
||||
url: '/api/tbConsInfo',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询查询耗材规格信息
|
||||
* @returns
|
||||
*/
|
||||
export function getviewConSku(params) {
|
||||
return request({
|
||||
url: '/api/viewConSku',
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 查询查询商品规格
|
||||
* @returns
|
||||
*/
|
||||
export function gettbProductSpec(params) {
|
||||
return request({
|
||||
url: '/api/viewProductSkuShop',
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 新增商品规格耗材信息
|
||||
* @returns
|
||||
*/
|
||||
export function posttbProskuCon(data) {
|
||||
return request({
|
||||
url: '/api/tbProskuCon',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 新增商品规格耗材信息-修改后
|
||||
* @returns
|
||||
*/
|
||||
export function posttbProskuCons(data) {
|
||||
return request({
|
||||
url: '/api/tbProskuCon',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 修改商品规格耗材信息状态
|
||||
* @returns
|
||||
*/
|
||||
export function puttbProskuCon(data) {
|
||||
return request({
|
||||
url: '/api/tbProskuCon',
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 编辑单位耗材值
|
||||
// export function puttbProskuCon(data) {
|
||||
// return request({
|
||||
// url: '/api/tbProskuCon',
|
||||
// method: "put",
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
/**
|
||||
* 删除商品规格耗材信息状态
|
||||
* @returns
|
||||
*/
|
||||
export function deletetbProskuCon(data) {
|
||||
return request({
|
||||
url: '/api/tbProskuCon',
|
||||
method: "delete",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 查询耗材流水信息
|
||||
* @returns
|
||||
*/
|
||||
export function gettbConsInfoFlow(params) {
|
||||
return request({
|
||||
url: '/api/tbConsInfoFlow',
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
|
@ -1,27 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
import request from "@/utils/request";
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
* @returns
|
||||
*/
|
||||
export function tbProductGet(params) {
|
||||
return request({
|
||||
url: '/api/tbProduct',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
return request({
|
||||
url: "/api/tbProduct",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
export function tbProductlist(params) {
|
||||
return request({
|
||||
url: "/api/tbProduct/list",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 商品分类列表
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopCategoryGet(params) {
|
||||
return request({
|
||||
url: `/api/tbShopCategory`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 进销存类型字典
|
||||
* @returns
|
||||
*/
|
||||
export function dictDetail(params) {
|
||||
return request({
|
||||
url: `/api/dictDetail`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
return request({
|
||||
url: `/api/dictDetail`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -29,11 +46,11 @@ export function dictDetail(params) {
|
|||
* @returns
|
||||
*/
|
||||
export function tbProductStockDetail(data) {
|
||||
return request({
|
||||
url: `/api/tbProductStockDetail/stock`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return request({
|
||||
url: `/api/tbProductStockDetail/stock`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -41,11 +58,11 @@ export function tbProductStockDetail(data) {
|
|||
* @returns
|
||||
*/
|
||||
export function tbProductStockDetailSum(params) {
|
||||
return request({
|
||||
url: `/api/tbProductStockDetail/sum`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
return request({
|
||||
url: `/api/tbProductStockDetail/sum`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -53,23 +70,30 @@ export function tbProductStockDetailSum(params) {
|
|||
* @returns
|
||||
*/
|
||||
export function tbShopPurveyorGet(params) {
|
||||
return request({
|
||||
url: `/api/tbShopPurveyor`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
return request({
|
||||
url: `/api/tbShopPurveyor`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
// 供应商列表1
|
||||
export function tbShopPurveyorGets(params) {
|
||||
return request({
|
||||
url: `/api/tbShopPurveyorTransact`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加供应商
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopPurveyor(data, method = 'post') {
|
||||
return request({
|
||||
url: `/api/tbShopPurveyor`,
|
||||
method: method,
|
||||
data
|
||||
})
|
||||
export function tbShopPurveyor(data, method = "post") {
|
||||
return request({
|
||||
url: `/api/tbShopPurveyor`,
|
||||
method: method,
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -77,11 +101,11 @@ export function tbShopPurveyor(data, method = 'post') {
|
|||
* @returns
|
||||
*/
|
||||
export function tbShopPurveyorTransactGet(params) {
|
||||
return request({
|
||||
url: `/api/tbShopPurveyorTransact`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
return request({
|
||||
url: `/api/tbShopPurveyorTransact`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -89,23 +113,30 @@ export function tbShopPurveyorTransactGet(params) {
|
|||
* @returns
|
||||
*/
|
||||
export function tbShopPurveyorTransactInfo(data) {
|
||||
return request({
|
||||
url: `/api/tbShopPurveyorTransact/info`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return request({
|
||||
url: `/api/tbShopPurveyorTransact/info`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 付款
|
||||
export function paidAmount(data) {
|
||||
return request({
|
||||
url: `/api/tbShopPurveyorTransact/payTransact`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 进货账目汇总(单一供应商)
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopPurveyorTransactSum(params) {
|
||||
return request({
|
||||
url: `/api/tbShopPurveyorTransact/sum`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
return request({
|
||||
url: `/api/tbShopPurveyorTransact/sum`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -113,11 +144,11 @@ export function tbShopPurveyorTransactSum(params) {
|
|||
* @returns
|
||||
*/
|
||||
export function tbProductStockOperateList(data) {
|
||||
return request({
|
||||
url: `/api/tbProductStockOperate/list`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return request({
|
||||
url: `/api/tbProductStockOperate/list`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -125,10 +156,10 @@ export function tbProductStockOperateList(data) {
|
|||
* @returns
|
||||
*/
|
||||
export function tbProductStockOperateDetail(id) {
|
||||
return request({
|
||||
url: `/api/tbProductStockOperate/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/api/tbProductStockOperate/${id}`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -136,11 +167,230 @@ export function tbProductStockOperateDetail(id) {
|
|||
* @returns
|
||||
*/
|
||||
export function tbProductStockOperateOutAndOn(data) {
|
||||
return request({
|
||||
url: `/api/tbProductStockOperate/outAndOn`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return request({
|
||||
url: `/api/tbProductStockOperate/outAndOn`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 库存列表
|
||||
* @returns
|
||||
*/
|
||||
export function stock(params) {
|
||||
return request({
|
||||
url: `/api/stock/v2`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
// 库存列表子集列表
|
||||
export function stocks(params) {
|
||||
return request({
|
||||
url: `/api/stock/sku`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 导出数据
|
||||
* @returns
|
||||
*/
|
||||
export function stockdownload(data) {
|
||||
return request({
|
||||
url: "/api/stock/download/v2",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
},
|
||||
responseType: "blob"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @returns
|
||||
*/
|
||||
export function stockdoImport(file) {
|
||||
const formData = new FormData();
|
||||
formData.append("file", file);
|
||||
formData.append("shopId", localStorage.getItem("shopId"));
|
||||
return request({
|
||||
url: "/api/stock/doImport/v2",
|
||||
method: "post",
|
||||
data: formData,
|
||||
Headers: {
|
||||
"Content-Type": "multipart/form-data"
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 库存开关
|
||||
* @returns
|
||||
*/
|
||||
export function stockStateChange(params) {
|
||||
return request({
|
||||
url: `/api/stock/isStock`,
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
// 警戒设置
|
||||
export function stockStatewarnLine(params) {
|
||||
return request({
|
||||
url: `/api/stock/warnLine`,
|
||||
method: "put",
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
// 共享库存
|
||||
export function stockStateChanges(params) {
|
||||
return request({
|
||||
url: `/api/stock/productStatus`,
|
||||
method: "put",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增盘点
|
||||
* @returns
|
||||
*/
|
||||
export function tbProductStocktakin(data) {
|
||||
return request({
|
||||
url: `/api/tbProductStocktakin`,
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 盘点记录查询
|
||||
* @returns
|
||||
*/
|
||||
export function tbProductStocktakinGet(data) {
|
||||
return request({
|
||||
url: `/api/tbProductStocktakin`,
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 账单付款记录
|
||||
export function tbShopPurveyorTransacttransactPayInfos(params) {
|
||||
return request({
|
||||
url: `/api/tbShopPurveyorTransact/transactPayInfos`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询耗材信息
|
||||
* @returns
|
||||
*/
|
||||
export function tbConsInfoGet(data) {
|
||||
return request({
|
||||
url: `/api/tbConsInfo`,
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 耗材出入库
|
||||
* @returns
|
||||
*/
|
||||
export function stockInOut(data) {
|
||||
return request({
|
||||
url: `/api/tbConsInfo/stockInOut`,
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增盘点耗材
|
||||
* @returns
|
||||
*/
|
||||
export function tbConCheck(data) {
|
||||
return request({
|
||||
url: `/api/tbConCheck`,
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询盘点耗材
|
||||
* @returns
|
||||
*/
|
||||
export function tbConCheckGet(data) {
|
||||
return request({
|
||||
url: `/api/tbConCheck`,
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 耗材导出
|
||||
* @returns
|
||||
*/
|
||||
export function tbConsInfodownload(data) {
|
||||
return request({
|
||||
url: "/api/tbConsInfo/download",
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
},
|
||||
responseType: "blob"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入耗材
|
||||
* @returns
|
||||
*/
|
||||
export function tbConsInfoinputStock(file) {
|
||||
const formData = new FormData();
|
||||
formData.append("file", file);
|
||||
formData.append("shopId", localStorage.getItem("shopId"));
|
||||
return request({
|
||||
url: "/api/tbConsInfo/inputStock",
|
||||
method: "post",
|
||||
data: formData,
|
||||
Headers: {
|
||||
"Content-Type": "multipart/form-data"
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
107
src/api/order.js
107
src/api/order.js
|
|
@ -1,63 +1,92 @@
|
|||
import request from '@/utils/request'
|
||||
import request from "@/utils/request";
|
||||
|
||||
/**
|
||||
* 查询订单
|
||||
* @param {*} data
|
||||
* @returns
|
||||
* @param {*} data
|
||||
* @returns
|
||||
*/
|
||||
export function tbOrderInfoData(data) {
|
||||
return request({
|
||||
url: '/api/tbOrderInfo/date',
|
||||
method: 'post',
|
||||
data: {
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
...data
|
||||
}
|
||||
})
|
||||
return request({
|
||||
url: "/api/tbOrderInfo/date",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param {*} data
|
||||
* @returns
|
||||
* @returns
|
||||
*/
|
||||
export function tbOrderInfoDownload(data) {
|
||||
return request({
|
||||
url: '/api/tbOrderInfo/download',
|
||||
method: 'post',
|
||||
data: {
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
...data
|
||||
},
|
||||
responseType: 'blob'
|
||||
})
|
||||
return request({
|
||||
url: "/api/tbOrderInfo/download",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
},
|
||||
responseType: "blob"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过Id查询订单
|
||||
* @param {*} id
|
||||
* @returns
|
||||
* @param {*} id
|
||||
* @returns
|
||||
*/
|
||||
export function tbOrderInfoDetail(id) {
|
||||
return request({
|
||||
url: `/api/tbOrderInfo/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/api/tbOrderInfo/${id}`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过Id查询订单
|
||||
* @param {*} createdAt
|
||||
* @returns
|
||||
* @param {*} createdAt
|
||||
* @returns
|
||||
*/
|
||||
export function payCount(createdAt) {
|
||||
console.log(createdAt);
|
||||
return request({
|
||||
url: `/api/tbOrderInfo/payCount`,
|
||||
method: 'post',
|
||||
data: {
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
createdAt: createdAt
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log(createdAt);
|
||||
return request({
|
||||
url: `/api/tbOrderInfo/payCount`,
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
createdAt: createdAt
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单列表
|
||||
* @param {*} createdAt
|
||||
* @returns
|
||||
*/
|
||||
export function tbGroupOrderInfo(params) {
|
||||
return request({
|
||||
url: `/api/tbGroupOrderInfo`,
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 退单
|
||||
* @param {*} data
|
||||
* @returns
|
||||
*/
|
||||
export function returnGpOrder(data) {
|
||||
return request({
|
||||
url: `/api/tbGroupOrderInfo/returnGpOrder`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
import request from "@/utils/request";
|
||||
|
||||
/**
|
||||
* 验证码
|
||||
*/
|
||||
export function sendMsg(params) {
|
||||
return request({
|
||||
url: "/api/tbUserInfo/sendMsg",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
// 提交表单
|
||||
export function modfiyUserInfo(data) {
|
||||
return request({
|
||||
url: "/api/tbUserInfo/modfiyUserInfo",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
|
@ -1,39 +1,110 @@
|
|||
import request from '@/utils/request'
|
||||
import request from "@/utils/request";
|
||||
|
||||
/**
|
||||
* 支付方式
|
||||
* @returns
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopPayTypeGet(params) {
|
||||
return request({
|
||||
url: '/api/tbShopPayType',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
return request({
|
||||
url: "/api/tbShopPayType",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改/增加支付方式
|
||||
* @returns
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopPayType(data, method = 'post') {
|
||||
return request({
|
||||
url: '/api/tbShopPayType',
|
||||
method: method,
|
||||
data
|
||||
})
|
||||
export function tbShopPayType(data, method = "post") {
|
||||
return request({
|
||||
url: "/api/tbShopPayType",
|
||||
method: method,
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 增删改查新增字典
|
||||
* @returns
|
||||
* @returns
|
||||
*/
|
||||
export function dict(data, method = 'get') {
|
||||
return request({
|
||||
url: '/api/dict',
|
||||
method: method,
|
||||
data: data,
|
||||
params: data
|
||||
})
|
||||
export function dict(data, method = "get") {
|
||||
return request({
|
||||
url: "/api/dict",
|
||||
method: method,
|
||||
data: data,
|
||||
params: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改字典
|
||||
* @returns
|
||||
*/
|
||||
export function dictPut(data) {
|
||||
return request({
|
||||
url: "/api/dict",
|
||||
method: "put",
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增/编辑资源
|
||||
* @returns
|
||||
*/
|
||||
export function tbPlatformDictPostPut(data, method = "post") {
|
||||
return request({
|
||||
url: "/api/tbPlatformDict",
|
||||
method: method,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 资源列表
|
||||
* @returns
|
||||
*/
|
||||
export function tbPlatformDictGet(params) {
|
||||
return request({
|
||||
url: "/api/tbPlatformDict",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增团购卷分类
|
||||
* @returns
|
||||
*/
|
||||
export function tbCouponCategoryPostPut(data, method = "post") {
|
||||
return request({
|
||||
url: "/api/tbCouponCategory",
|
||||
method: method,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询团购卷分类
|
||||
* @returns
|
||||
*/
|
||||
export function tbCouponCategoryGet(params) {
|
||||
return request({
|
||||
url: "/api/tbCouponCategory",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询资源类别列表
|
||||
* @returns
|
||||
*/
|
||||
export function tbPlatformDictType(params) {
|
||||
return request({
|
||||
url: "/api/tbPlatformDictType",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
|
|
|||
271
src/api/shop.js
271
src/api/shop.js
|
|
@ -1,4 +1,4 @@
|
|||
import request from '@/utils/request'
|
||||
import request from "@/utils/request";
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
|
|
@ -6,10 +6,10 @@ import request from '@/utils/request'
|
|||
*/
|
||||
export function tbProduct(params) {
|
||||
return request({
|
||||
url: '/api/tbProduct',
|
||||
method: 'get',
|
||||
url: "/api/tbProduct",
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -18,10 +18,10 @@ export function tbProduct(params) {
|
|||
*/
|
||||
export function tbProductDelete(data) {
|
||||
return request({
|
||||
url: '/api/tbProduct',
|
||||
method: 'delete',
|
||||
url: "/api/tbProduct",
|
||||
method: "delete",
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -30,10 +30,10 @@ export function tbProductDelete(data) {
|
|||
*/
|
||||
export function tbShopUnit(params) {
|
||||
return request({
|
||||
url: '/api/tbShopUnit',
|
||||
method: 'get',
|
||||
url: "/api/tbShopUnit",
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -43,8 +43,8 @@ export function tbShopUnit(params) {
|
|||
export function tbShopCurrency(shopId) {
|
||||
return request({
|
||||
url: `/api/tbShopCurrency/${shopId}`,
|
||||
method: 'get'
|
||||
})
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -54,9 +54,9 @@ export function tbShopCurrency(shopId) {
|
|||
export function tbShopCurrencyPut(data) {
|
||||
return request({
|
||||
url: `/api/tbShopCurrency`,
|
||||
method: 'put',
|
||||
method: "put",
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -66,9 +66,9 @@ export function tbShopCurrencyPut(data) {
|
|||
export function tbShopUnitPost(data) {
|
||||
return request({
|
||||
url: `/api/tbShopUnit`,
|
||||
method: 'post',
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -78,9 +78,9 @@ export function tbShopUnitPost(data) {
|
|||
export function tbShopUnitPut(data) {
|
||||
return request({
|
||||
url: `/api/tbShopUnit`,
|
||||
method: 'put',
|
||||
method: "put",
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -90,9 +90,9 @@ export function tbShopUnitPut(data) {
|
|||
export function tbShopUnitDelete(data) {
|
||||
return request({
|
||||
url: `/api/tbShopUnit`,
|
||||
method: 'delete',
|
||||
method: "delete",
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -102,9 +102,9 @@ export function tbShopUnitDelete(data) {
|
|||
export function tbShopCurrencyGet(params) {
|
||||
return request({
|
||||
url: `/api/tbShopUnit`,
|
||||
method: 'get',
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -114,21 +114,21 @@ export function tbShopCurrencyGet(params) {
|
|||
export function tbShopCategoryGet(params) {
|
||||
return request({
|
||||
url: `/api/tbShopCategory`,
|
||||
method: 'get',
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增、编辑分类/新增、编辑子分类
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopCategoryPost(data, method = 'post') {
|
||||
export function tbShopCategoryPost(data, method = "post") {
|
||||
return request({
|
||||
url: `/api/tbShopCategory`,
|
||||
method: method,
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -138,9 +138,9 @@ export function tbShopCategoryPost(data, method = 'post') {
|
|||
export function tbShopCategoryDelete(data) {
|
||||
return request({
|
||||
url: `/api/tbShopCategory`,
|
||||
method: 'delete',
|
||||
method: "delete",
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -150,9 +150,9 @@ export function tbShopCategoryDelete(data) {
|
|||
export function tbProductSpecPost(data) {
|
||||
return request({
|
||||
url: `/api/tbProductSpec`,
|
||||
method: 'post',
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -162,9 +162,9 @@ export function tbProductSpecPost(data) {
|
|||
export function tbProductSpecGet(params) {
|
||||
return request({
|
||||
url: `/api/tbProductSpec`,
|
||||
method: 'get',
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -174,9 +174,9 @@ export function tbProductSpecGet(params) {
|
|||
export function tbProductSpecPut(data) {
|
||||
return request({
|
||||
url: `/api/tbProductSpec`,
|
||||
method: 'put',
|
||||
method: "put",
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -186,9 +186,9 @@ export function tbProductSpecPut(data) {
|
|||
export function tbProductSpecDelete(data) {
|
||||
return request({
|
||||
url: `/api/tbProductSpec`,
|
||||
method: 'DELETE',
|
||||
method: "DELETE",
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -198,9 +198,9 @@ export function tbProductSpecDelete(data) {
|
|||
export function tbProductGroupPost(data) {
|
||||
return request({
|
||||
url: `/api/tbProductGroup`,
|
||||
method: 'post',
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -210,9 +210,9 @@ export function tbProductGroupPost(data) {
|
|||
export function tbProductGroupPut(data) {
|
||||
return request({
|
||||
url: `/api/tbProductGroup`,
|
||||
method: 'PUT',
|
||||
method: "PUT",
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -222,9 +222,9 @@ export function tbProductGroupPut(data) {
|
|||
export function tbProductGroupGet(params) {
|
||||
return request({
|
||||
url: `/api/tbProductGroup`,
|
||||
method: 'get',
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -234,8 +234,8 @@ export function tbProductGroupGet(params) {
|
|||
export function productListGet(productGroup) {
|
||||
return request({
|
||||
url: `/api/tbProductGroup/${productGroup}`,
|
||||
method: 'get'
|
||||
})
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -245,9 +245,9 @@ export function productListGet(productGroup) {
|
|||
export function tbProductGroupDelete(data) {
|
||||
return request({
|
||||
url: `/api/tbProductGroup`,
|
||||
method: 'DELETE',
|
||||
method: "DELETE",
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -257,9 +257,9 @@ export function tbProductGroupDelete(data) {
|
|||
export function tbProductPost(data) {
|
||||
return request({
|
||||
url: `/api/tbProduct`,
|
||||
method: 'post',
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -269,9 +269,9 @@ export function tbProductPost(data) {
|
|||
export function tbProductPut(data) {
|
||||
return request({
|
||||
url: `/api/tbProduct`,
|
||||
method: 'put',
|
||||
method: "put",
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -282,8 +282,8 @@ export function tbProductPut(data) {
|
|||
export function tbProductGetDetail(product) {
|
||||
return request({
|
||||
url: `/api/tbProduct/${product}`,
|
||||
method: 'get'
|
||||
})
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -293,9 +293,9 @@ export function tbProductGetDetail(product) {
|
|||
export function tbShopInfo(params) {
|
||||
return request({
|
||||
url: `/api/tbShopInfo`,
|
||||
method: 'get',
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -305,9 +305,9 @@ export function tbShopInfo(params) {
|
|||
export function tbMerchantRegisterPost(data) {
|
||||
return request({
|
||||
url: `/api/tbMerchantRegister`,
|
||||
method: 'post',
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -317,21 +317,21 @@ export function tbMerchantRegisterPost(data) {
|
|||
export function tbMerchantRegisterList(data) {
|
||||
return request({
|
||||
url: `/api/tbMerchantRegister/list`,
|
||||
method: 'post',
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加/编辑店铺
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopInfoPost(data, method = 'post') {
|
||||
export function tbShopInfoPost(data, method = "post") {
|
||||
return request({
|
||||
url: `/api/tbShopInfo`,
|
||||
method: method,
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -341,8 +341,8 @@ export function tbShopInfoPost(data, method = 'post') {
|
|||
export function tbMerchantThirdApply(shopId) {
|
||||
return request({
|
||||
url: `/api/tbMerchantThirdApply/${shopId}`,
|
||||
method: 'get'
|
||||
})
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -352,9 +352,9 @@ export function tbMerchantThirdApply(shopId) {
|
|||
export function tbMerchantThirdApplyPut(data) {
|
||||
return request({
|
||||
url: `/api/tbMerchantThirdApply`,
|
||||
method: 'put',
|
||||
method: "put",
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -364,21 +364,21 @@ export function tbMerchantThirdApplyPut(data) {
|
|||
export function tbProductIsHot(params) {
|
||||
return request({
|
||||
url: `/api/tbProduct/isHot`,
|
||||
method: 'get',
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加/编辑优惠券
|
||||
* @returns
|
||||
*/
|
||||
export function tbMerchantCoupon(data, method = 'post') {
|
||||
export function tbMerchantCoupon(data, method = "post") {
|
||||
return request({
|
||||
url: `/api/tbMerchantCoupon`,
|
||||
method: method,
|
||||
data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -388,10 +388,141 @@ export function tbMerchantCoupon(data, method = 'post') {
|
|||
export function tbMerchantCouponGet(params) {
|
||||
return request({
|
||||
url: `/api/tbMerchantCoupon`,
|
||||
method: 'get',
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置热销商品
|
||||
* @returns
|
||||
*/
|
||||
export function geocode(params) {
|
||||
return request({
|
||||
url: `/api/geocode`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增、修改活动
|
||||
* @returns
|
||||
*/
|
||||
export function modityActivate(data) {
|
||||
return request({
|
||||
url: `/shop/storage/modityActivate`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动列表
|
||||
* @returns
|
||||
*/
|
||||
export function findActivate(params) {
|
||||
return request({
|
||||
url: `/shop/storage/findActivate`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 商家用户列表
|
||||
* @returns
|
||||
*/
|
||||
export function queryAllShopUser(params) {
|
||||
return request({
|
||||
url: `/api/tbShopUser/queryAllShopUser`,
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 查询商家用户概述信息
|
||||
* @returns
|
||||
*/
|
||||
export function queryAllShopInfo(params) {
|
||||
return request({
|
||||
url: `/api/tbShopUser/summary`,
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改商品排序
|
||||
* @returns
|
||||
*/
|
||||
export function upProSort(data) {
|
||||
return request({
|
||||
url: `/api/tbProduct/upProSort`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分组排序
|
||||
* @returns
|
||||
*/
|
||||
export function upGroupSort(data) {
|
||||
return request({
|
||||
url: `/api/tbProductGroup/upGroupSort`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分类排序
|
||||
* @returns
|
||||
*/
|
||||
export function upCategorySort(data) {
|
||||
return request({
|
||||
url: `/api/tbShopCategory/upCategorySort`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询店铺充值记录
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopUserRecharge(params) {
|
||||
return request({
|
||||
url: `/api/tbShopUser/recharge`,
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出充值记录
|
||||
* @returns
|
||||
*/
|
||||
export function downloadTableRecharge(data) {
|
||||
return request({
|
||||
url: `/api/tbShopUser/recharge/download`,
|
||||
method: "post",
|
||||
data:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
},
|
||||
responseType: "blob"
|
||||
});
|
||||
}
|
||||
|
|
|
|||
106
src/api/table.js
106
src/api/table.js
|
|
@ -1,16 +1,16 @@
|
|||
// 桌台管理
|
||||
import request from '@/utils/request'
|
||||
import request from "@/utils/request";
|
||||
|
||||
/**
|
||||
* 台桌列表
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopTableGet(params) {
|
||||
return request({
|
||||
url: `/api/tbShopTable`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
return request({
|
||||
url: `/api/tbShopTable`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -18,11 +18,11 @@ export function tbShopTableGet(params) {
|
|||
* @returns
|
||||
*/
|
||||
export function tbShopAreaGet(params) {
|
||||
return request({
|
||||
url: `/api/tbShopArea`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
return request({
|
||||
url: `/api/tbShopArea`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -30,11 +30,11 @@ export function tbShopAreaGet(params) {
|
|||
* @returns
|
||||
*/
|
||||
export function tbShopArea(data, method) {
|
||||
return request({
|
||||
url: `/api/tbShopArea`,
|
||||
method: method,
|
||||
data
|
||||
})
|
||||
return request({
|
||||
url: `/api/tbShopArea`,
|
||||
method: method,
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -42,11 +42,11 @@ export function tbShopArea(data, method) {
|
|||
* @returns
|
||||
*/
|
||||
export function tbShopAreaDelete(data) {
|
||||
return request({
|
||||
url: `/api/tbShopArea`,
|
||||
method: 'DELETE',
|
||||
data
|
||||
})
|
||||
return request({
|
||||
url: `/api/tbShopArea`,
|
||||
method: "DELETE",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -54,11 +54,11 @@ export function tbShopAreaDelete(data) {
|
|||
* @returns
|
||||
*/
|
||||
export function tbShopTable(data, method) {
|
||||
return request({
|
||||
url: `/api/tbShopTable`,
|
||||
method: method,
|
||||
data
|
||||
})
|
||||
return request({
|
||||
url: `/api/tbShopTable`,
|
||||
method: method,
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -66,11 +66,55 @@ export function tbShopTable(data, method) {
|
|||
* @returns
|
||||
*/
|
||||
export function tbShopTableDelete(data) {
|
||||
return request({
|
||||
url: `/api/tbShopTable`,
|
||||
method: 'DELETE',
|
||||
data
|
||||
})
|
||||
return request({
|
||||
url: `/api/tbShopTable`,
|
||||
method: "DELETE",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载桌码
|
||||
* @returns
|
||||
*/
|
||||
export function downloadTableCode(data) {
|
||||
return request({
|
||||
url: `/api/deviceStock/batchDownload`,
|
||||
method: "post",
|
||||
data,
|
||||
responseType: "blob"
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 桌台统计
|
||||
* @returns
|
||||
*/
|
||||
export function summaryTable(params) {
|
||||
return request({
|
||||
url: `/api/summary/table`,
|
||||
method: "get",
|
||||
params:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 桌台统计导出文档
|
||||
* @returns
|
||||
*/
|
||||
export function summaryTableDownload(data) {
|
||||
return request({
|
||||
url: `/api/summary/table/download`,
|
||||
method: "POST",
|
||||
data:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
},
|
||||
responseType: 'blob'
|
||||
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,8 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-upload
|
||||
:action="uploadUrl"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:on-success="handleUploadSuccess"
|
||||
:on-error="handleUploadError"
|
||||
name="file"
|
||||
:show-file-list="false"
|
||||
:headers="headers"
|
||||
style="display: none"
|
||||
ref="upload"
|
||||
v-if="this.type == 'url'"
|
||||
>
|
||||
<el-upload :action="uploadUrl" :before-upload="handleBeforeUpload" :on-success="handleUploadSuccess"
|
||||
:on-error="handleUploadError" name="file" :show-file-list="false" :headers="headers" style="display: none"
|
||||
ref="upload" v-if="this.type == 'url'">
|
||||
</el-upload>
|
||||
<div class="editor" ref="editor" :style="styles"></div>
|
||||
</div>
|
||||
|
|
@ -125,6 +116,11 @@ export default {
|
|||
init() {
|
||||
const editor = this.$refs.editor;
|
||||
this.Quill = new Quill(editor, this.options);
|
||||
this.Quill.enable(false)
|
||||
this.$nextTick(() => {
|
||||
this.Quill.enable(true)
|
||||
this.Quill.blur()
|
||||
})
|
||||
// 如果设置了上传地址则自定义图片上传事件
|
||||
if (this.type == 'url') {
|
||||
let toolbar = this.Quill.getModule("toolbar");
|
||||
|
|
@ -155,6 +151,7 @@ export default {
|
|||
this.Quill.on("editor-change", (eventName, ...args) => {
|
||||
this.$emit("on-editor-change", eventName, ...args);
|
||||
});
|
||||
|
||||
},
|
||||
// 上传前校检格式和大小
|
||||
handleBeforeUpload(file) {
|
||||
|
|
@ -172,7 +169,7 @@ export default {
|
|||
// 获取富文本组件实例
|
||||
let quill = this.Quill;
|
||||
// 如果上传成功
|
||||
if (res.id >0) {
|
||||
if (res.id > 0) {
|
||||
// 获取光标所在位置
|
||||
let length = quill.getSelection().index;
|
||||
// 插入图片 res.url为服务器返回的图片地址
|
||||
|
|
@ -191,16 +188,20 @@ export default {
|
|||
</script>
|
||||
|
||||
<style>
|
||||
.editor, .ql-toolbar {
|
||||
.editor,
|
||||
.ql-toolbar {
|
||||
white-space: pre-wrap !important;
|
||||
line-height: normal !important;
|
||||
}
|
||||
|
||||
.quill-img {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ql-snow .ql-tooltip[data-mode="link"]::before {
|
||||
content: "请输入链接地址:";
|
||||
}
|
||||
|
||||
.ql-snow .ql-tooltip.ql-editing a.ql-action::after {
|
||||
border-right: 0px;
|
||||
content: "保存";
|
||||
|
|
@ -215,14 +216,17 @@ export default {
|
|||
.ql-snow .ql-picker.ql-size .ql-picker-item::before {
|
||||
content: "14px";
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before,
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before {
|
||||
content: "10px";
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before,
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before {
|
||||
content: "18px";
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before,
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before {
|
||||
content: "32px";
|
||||
|
|
@ -232,26 +236,32 @@ export default {
|
|||
.ql-snow .ql-picker.ql-header .ql-picker-item::before {
|
||||
content: "文本";
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
|
||||
content: "标题1";
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
|
||||
content: "标题2";
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
|
||||
content: "标题3";
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
|
||||
content: "标题4";
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before {
|
||||
content: "标题5";
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before {
|
||||
content: "标题6";
|
||||
|
|
@ -261,10 +271,12 @@ export default {
|
|||
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
|
||||
content: "标准字体";
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before,
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before {
|
||||
content: "衬线字体";
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="monospace"]::before,
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
|
||||
content: "等宽字体";
|
||||
|
|
|
|||
|
|
@ -0,0 +1,138 @@
|
|||
<template>
|
||||
<el-dialog title="选择团购券分类" :visible.sync="dialogVisible" @open="resetHandle()">
|
||||
<el-form :model="searhForm" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="searhForm.name" placeholder="分类名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="head-container">
|
||||
<el-table ref="table" :data="tableData.list" v-loading="tableData.loading">
|
||||
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
||||
<el-table-column label="名称" prop="name"></el-table-column>
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0"
|
||||
disabled></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" @size-change="sizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="confirmHandle">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { tbCouponCategoryGet } from "@/api/setting";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
searhForm: {
|
||||
name: ''
|
||||
},
|
||||
tableData: {
|
||||
page: 0,
|
||||
size: 10,
|
||||
total: 0,
|
||||
loading: false,
|
||||
list: []
|
||||
},
|
||||
goods: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 确定选商品
|
||||
confirmHandle(row) {
|
||||
let res = this.$refs.table.selection
|
||||
this.$emit('success', res)
|
||||
this.close()
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.searhForm.name = ''
|
||||
this.tableData.page = 0
|
||||
this.tableData.size = 10
|
||||
this.tableData.list = []
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页大小改变
|
||||
sizeChange(e) {
|
||||
this.tableData.size = e
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 商品列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await tbCouponCategoryGet({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
name: this.searhForm.name,
|
||||
sort: 'id',
|
||||
})
|
||||
this.tableData.list = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
|
||||
if (this.goods.length) {
|
||||
this.$nextTick(() => {
|
||||
this.selection()
|
||||
})
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.tableData.loading = false
|
||||
}, 500);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
show(goods) {
|
||||
this.dialogVisible = true
|
||||
if (goods && goods.length) {
|
||||
this.goods = [...goods]
|
||||
} else {
|
||||
this.goods = []
|
||||
}
|
||||
this.resetHandle()
|
||||
this.getTableData()
|
||||
},
|
||||
close() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
selection() {
|
||||
this.goods.forEach(row => {
|
||||
this.tableData.list.forEach((item, index) => {
|
||||
if (row.id == item.id) {
|
||||
this.$refs.table.toggleRowSelection(this.tableData.list[index]);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.shop_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
span {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -30,6 +30,19 @@
|
|||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.typeEnum }}
|
||||
</template>
|
||||
</el-table-column> <el-table-column label="是否售罄">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.isPauseSale == 1?'是':'否' }}
|
||||
</template>
|
||||
</el-table-column> <el-table-column label="是否分销">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.isDistribute == 1?'是':'否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="售价">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.lowPrice }}
|
||||
|
|
@ -40,7 +53,7 @@
|
|||
{{ scope.row.realSalesNumber }}/{{ scope.row.stockNumber }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分类" prop="categoryName"></el-table-column>
|
||||
<el-table-column label="分类名称" prop="categoryName"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
|
|
@ -112,7 +125,6 @@ export default {
|
|||
shopId: localStorage.getItem('shopId'),
|
||||
sort: 'id',
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.list = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
|
||||
|
|
@ -121,6 +133,9 @@ export default {
|
|||
this.selection()
|
||||
})
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.tableData.loading = false
|
||||
}, 500);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
|
|
|
|||
78
src/main.js
78
src/main.js
|
|
@ -1,60 +1,72 @@
|
|||
import Vue from 'vue'
|
||||
import Vue from "vue";
|
||||
|
||||
import Cookies from 'js-cookie'
|
||||
import Cookies from "js-cookie";
|
||||
|
||||
import 'normalize.css/normalize.css'
|
||||
import "normalize.css/normalize.css";
|
||||
|
||||
import Element from 'element-ui'
|
||||
import Element from "element-ui";
|
||||
|
||||
// 数据字典
|
||||
import dict from './components/Dict'
|
||||
import Editor from "@/components/Editor"
|
||||
import dict from "./components/Dict";
|
||||
import Editor from "@/components/Editor";
|
||||
|
||||
// 权限指令
|
||||
import checkPer from '@/utils/permission'
|
||||
import permission from './components/Permission'
|
||||
import './assets/styles/element-variables.scss'
|
||||
import checkPer from "@/utils/permission";
|
||||
import permission from "./components/Permission";
|
||||
import "./assets/styles/element-variables.scss";
|
||||
|
||||
// global css
|
||||
import './assets/styles/index.scss'
|
||||
import "./assets/styles/index.scss";
|
||||
|
||||
import App from './App'
|
||||
import store from './store'
|
||||
import router from './router/routers'
|
||||
import App from "./App";
|
||||
import store from "./store";
|
||||
import router from "./router/routers";
|
||||
|
||||
import './assets/icons' // icon
|
||||
import './router/index' // permission control
|
||||
import "./assets/icons"; // icon
|
||||
import "./router/index"; // permission control
|
||||
|
||||
// 全局引入
|
||||
import EleUploadImage from 'vue-ele-upload-image'
|
||||
import VueAMap from 'vue-amap';
|
||||
import EleUploadImage from "vue-ele-upload-image";
|
||||
import VueAMap from "vue-amap";
|
||||
|
||||
import VueClipboard from 'vue-clipboard2'
|
||||
import VueClipboard from "vue-clipboard2";
|
||||
|
||||
import { isPcBowser } from "@/utils/index";
|
||||
|
||||
Vue.component(EleUploadImage.name, EleUploadImage)
|
||||
Vue.component('Editor', Editor)
|
||||
Vue.component(EleUploadImage.name, EleUploadImage);
|
||||
Vue.component("Editor", Editor);
|
||||
|
||||
Vue.use(checkPer)
|
||||
Vue.use(permission)
|
||||
Vue.use(dict)
|
||||
Vue.use(checkPer);
|
||||
Vue.use(permission);
|
||||
Vue.use(dict);
|
||||
Vue.use(Element, {
|
||||
size: Cookies.get('size') || 'small' // set element-ui default size
|
||||
})
|
||||
Vue.use(VueAMap)
|
||||
Vue.use(VueClipboard)
|
||||
size: Cookies.get("size") || "small" // set element-ui default size
|
||||
});
|
||||
Vue.use(VueAMap);
|
||||
Vue.use(VueClipboard);
|
||||
|
||||
Vue.prototype.isPcBowser = isPcBowser();
|
||||
|
||||
VueAMap.initAMapApiLoader({
|
||||
key: '6033c97e67bf2e9ceac306e1a3fa35f8',
|
||||
key: "6033c97e67bf2e9ceac306e1a3fa35f8",
|
||||
// securityJsCode: '0547b69252ef0ed14e11f5c4ac152f07',
|
||||
plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor']
|
||||
})
|
||||
plugin: [
|
||||
"AMap.Autocomplete",
|
||||
"AMap.PlaceSearch",
|
||||
"AMap.Scale",
|
||||
"AMap.OverView",
|
||||
"AMap.ToolBar",
|
||||
"AMap.MapType",
|
||||
"AMap.PolyEditor",
|
||||
"AMap.CircleEditor"
|
||||
]
|
||||
});
|
||||
|
||||
Vue.config.productionTip = false
|
||||
Vue.config.productionTip = false;
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
router,
|
||||
store,
|
||||
render: h => h(App)
|
||||
})
|
||||
});
|
||||
|
|
|
|||
|
|
@ -52,6 +52,12 @@ export const constantRouterMap = [
|
|||
component: (resolve) => require(['@/views/home/data_forms'], resolve),
|
||||
name: 'data_forms',
|
||||
meta: { title: '数据报表' }
|
||||
},
|
||||
{
|
||||
path: 'data_tables',
|
||||
component: (resolve) => require(['@/views/home/data_tables'], resolve),
|
||||
name: 'data_tables',
|
||||
meta: { title: '桌台统计' }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -10,22 +10,22 @@
|
|||
*/
|
||||
export function parseTime(time, cFormat) {
|
||||
if (arguments.length === 0) {
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
|
||||
let date
|
||||
if (typeof time === 'undefined' || time === null || time === 'null') {
|
||||
return ''
|
||||
} else if (typeof time === 'object') {
|
||||
date = time
|
||||
const format = cFormat || "{y}-{m}-{d} {h}:{i}:{s}";
|
||||
let date;
|
||||
if (typeof time === "undefined" || time === null || time === "null") {
|
||||
return "";
|
||||
} else if (typeof time === "object") {
|
||||
date = time;
|
||||
} else {
|
||||
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
||||
time = parseInt(time)
|
||||
if (typeof time === "string" && /^[0-9]+$/.test(time)) {
|
||||
time = parseInt(time);
|
||||
}
|
||||
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||
time = time * 1000
|
||||
if (typeof time === "number" && time.toString().length === 10) {
|
||||
time = time * 1000;
|
||||
}
|
||||
date = new Date(time)
|
||||
date = new Date(time);
|
||||
}
|
||||
const formatObj = {
|
||||
y: date.getFullYear(),
|
||||
|
|
@ -35,17 +35,19 @@ export function parseTime(time, cFormat) {
|
|||
i: date.getMinutes(),
|
||||
s: date.getSeconds(),
|
||||
a: date.getDay()
|
||||
}
|
||||
};
|
||||
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
|
||||
let value = formatObj[key]
|
||||
let value = formatObj[key];
|
||||
// Note: getDay() returns 0 on Sunday
|
||||
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
|
||||
if (result.length > 0 && value < 10) {
|
||||
value = '0' + value
|
||||
if (key === "a") {
|
||||
return ["日", "一", "二", "三", "四", "五", "六"][value];
|
||||
}
|
||||
return value || 0
|
||||
})
|
||||
return time_str
|
||||
if (result.length > 0 && value < 10) {
|
||||
value = "0" + value;
|
||||
}
|
||||
return value || 0;
|
||||
});
|
||||
return time_str;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -54,40 +56,40 @@ export function parseTime(time, cFormat) {
|
|||
* @returns {string}
|
||||
*/
|
||||
export function formatTime(time, option) {
|
||||
if (('' + time).length === 10) {
|
||||
time = parseInt(time) * 1000
|
||||
if (("" + time).length === 10) {
|
||||
time = parseInt(time) * 1000;
|
||||
} else {
|
||||
time = +time
|
||||
time = +time;
|
||||
}
|
||||
const d = new Date(time)
|
||||
const now = Date.now()
|
||||
const d = new Date(time);
|
||||
const now = Date.now();
|
||||
|
||||
const diff = (now - d) / 1000
|
||||
const diff = (now - d) / 1000;
|
||||
|
||||
if (diff < 30) {
|
||||
return '刚刚'
|
||||
return "刚刚";
|
||||
} else if (diff < 3600) {
|
||||
// less 1 hour
|
||||
return Math.ceil(diff / 60) + '分钟前'
|
||||
return Math.ceil(diff / 60) + "分钟前";
|
||||
} else if (diff < 3600 * 24) {
|
||||
return Math.ceil(diff / 3600) + '小时前'
|
||||
return Math.ceil(diff / 3600) + "小时前";
|
||||
} else if (diff < 3600 * 24 * 2) {
|
||||
return '1天前'
|
||||
return "1天前";
|
||||
}
|
||||
if (option) {
|
||||
return parseTime(time, option)
|
||||
return parseTime(time, option);
|
||||
} else {
|
||||
return (
|
||||
d.getMonth() +
|
||||
1 +
|
||||
'月' +
|
||||
"月" +
|
||||
d.getDate() +
|
||||
'日' +
|
||||
"日" +
|
||||
d.getHours() +
|
||||
'时' +
|
||||
"时" +
|
||||
d.getMinutes() +
|
||||
'分'
|
||||
)
|
||||
"分"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -96,18 +98,18 @@ export function formatTime(time, option) {
|
|||
* @returns {Object}
|
||||
*/
|
||||
export function getQueryObject(url) {
|
||||
url = url == null ? window.location.href : url
|
||||
const search = url.substring(url.lastIndexOf('?') + 1)
|
||||
const obj = {}
|
||||
const reg = /([^?&=]+)=([^?&=]*)/g
|
||||
url = url == null ? window.location.href : url;
|
||||
const search = url.substring(url.lastIndexOf("?") + 1);
|
||||
const obj = {};
|
||||
const reg = /([^?&=]+)=([^?&=]*)/g;
|
||||
search.replace(reg, (rs, $1, $2) => {
|
||||
const name = decodeURIComponent($1)
|
||||
let val = decodeURIComponent($2)
|
||||
val = String(val)
|
||||
obj[name] = val
|
||||
return rs
|
||||
})
|
||||
return obj
|
||||
const name = decodeURIComponent($1);
|
||||
let val = decodeURIComponent($2);
|
||||
val = String(val);
|
||||
obj[name] = val;
|
||||
return rs;
|
||||
});
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -116,14 +118,14 @@ export function getQueryObject(url) {
|
|||
*/
|
||||
export function byteLength(str) {
|
||||
// returns the byte length of an utf8 string
|
||||
let s = str.length
|
||||
let s = str.length;
|
||||
for (var i = str.length - 1; i >= 0; i--) {
|
||||
const code = str.charCodeAt(i)
|
||||
if (code > 0x7f && code <= 0x7ff) s++
|
||||
else if (code > 0x7ff && code <= 0xffff) s += 2
|
||||
if (code >= 0xDC00 && code <= 0xDFFF) i--
|
||||
const code = str.charCodeAt(i);
|
||||
if (code > 0x7f && code <= 0x7ff) s++;
|
||||
else if (code > 0x7ff && code <= 0xffff) s += 2;
|
||||
if (code >= 0xdc00 && code <= 0xdfff) i--;
|
||||
}
|
||||
return s
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -131,13 +133,13 @@ export function byteLength(str) {
|
|||
* @returns {Array}
|
||||
*/
|
||||
export function cleanArray(actual) {
|
||||
const newArray = []
|
||||
const newArray = [];
|
||||
for (let i = 0; i < actual.length; i++) {
|
||||
if (actual[i]) {
|
||||
newArray.push(actual[i])
|
||||
newArray.push(actual[i]);
|
||||
}
|
||||
}
|
||||
return newArray
|
||||
return newArray;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -145,13 +147,13 @@ export function cleanArray(actual) {
|
|||
* @returns {Array}
|
||||
*/
|
||||
export function param(json) {
|
||||
if (!json) return ''
|
||||
if (!json) return "";
|
||||
return cleanArray(
|
||||
Object.keys(json).map(key => {
|
||||
if (json[key] === undefined) return ''
|
||||
return encodeURIComponent(key) + '=' + encodeURIComponent(json[key])
|
||||
if (json[key] === undefined) return "";
|
||||
return encodeURIComponent(key) + "=" + encodeURIComponent(json[key]);
|
||||
})
|
||||
).join('&')
|
||||
).join("&");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -159,19 +161,19 @@ export function param(json) {
|
|||
* @returns {Object}
|
||||
*/
|
||||
export function param2Obj(url) {
|
||||
const search = url.split('?')[1]
|
||||
const search = url.split("?")[1];
|
||||
if (!search) {
|
||||
return {}
|
||||
return {};
|
||||
}
|
||||
return JSON.parse(
|
||||
'{"' +
|
||||
decodeURIComponent(search)
|
||||
.replace(/"/g, '\\"')
|
||||
.replace(/&/g, '","')
|
||||
.replace(/=/g, '":"')
|
||||
.replace(/\+/g, ' ') +
|
||||
'"}'
|
||||
)
|
||||
decodeURIComponent(search)
|
||||
.replace(/"/g, '\\"')
|
||||
.replace(/&/g, '","')
|
||||
.replace(/=/g, '":"')
|
||||
.replace(/\+/g, " ") +
|
||||
'"}'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -179,9 +181,9 @@ export function param2Obj(url) {
|
|||
* @returns {string}
|
||||
*/
|
||||
export function html2Text(val) {
|
||||
const div = document.createElement('div')
|
||||
div.innerHTML = val
|
||||
return div.textContent || div.innerText
|
||||
const div = document.createElement("div");
|
||||
div.innerHTML = val;
|
||||
return div.textContent || div.innerText;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -191,21 +193,21 @@ export function html2Text(val) {
|
|||
* @returns {Object}
|
||||
*/
|
||||
export function objectMerge(target, source) {
|
||||
if (typeof target !== 'object') {
|
||||
target = {}
|
||||
if (typeof target !== "object") {
|
||||
target = {};
|
||||
}
|
||||
if (Array.isArray(source)) {
|
||||
return source.slice()
|
||||
return source.slice();
|
||||
}
|
||||
Object.keys(source).forEach(property => {
|
||||
const sourceProperty = source[property]
|
||||
if (typeof sourceProperty === 'object') {
|
||||
target[property] = objectMerge(target[property], sourceProperty)
|
||||
const sourceProperty = source[property];
|
||||
if (typeof sourceProperty === "object") {
|
||||
target[property] = objectMerge(target[property], sourceProperty);
|
||||
} else {
|
||||
target[property] = sourceProperty
|
||||
target[property] = sourceProperty;
|
||||
}
|
||||
})
|
||||
return target
|
||||
});
|
||||
return target;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -214,18 +216,18 @@ export function objectMerge(target, source) {
|
|||
*/
|
||||
export function toggleClass(element, className) {
|
||||
if (!element || !className) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
let classString = element.className
|
||||
const nameIndex = classString.indexOf(className)
|
||||
let classString = element.className;
|
||||
const nameIndex = classString.indexOf(className);
|
||||
if (nameIndex === -1) {
|
||||
classString += '' + className
|
||||
classString += "" + className;
|
||||
} else {
|
||||
classString =
|
||||
classString.substr(0, nameIndex) +
|
||||
classString.substr(nameIndex + className.length)
|
||||
classString.substr(nameIndex + className.length);
|
||||
}
|
||||
element.className = classString
|
||||
element.className = classString;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -233,10 +235,10 @@ export function toggleClass(element, className) {
|
|||
* @returns {Date}
|
||||
*/
|
||||
export function getTime(type) {
|
||||
if (type === 'start') {
|
||||
return new Date().getTime() - 3600 * 1000 * 24 * 90
|
||||
if (type === "start") {
|
||||
return new Date().getTime() - 3600 * 1000 * 24 * 90;
|
||||
} else {
|
||||
return new Date(new Date().toDateString())
|
||||
return new Date(new Date().toDateString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -247,38 +249,38 @@ export function getTime(type) {
|
|||
* @return {*}
|
||||
*/
|
||||
export function debounce(func, wait, immediate) {
|
||||
let timeout, args, context, timestamp, result
|
||||
let timeout, args, context, timestamp, result;
|
||||
|
||||
const later = function () {
|
||||
const later = function() {
|
||||
// 据上一次触发时间间隔
|
||||
const last = +new Date() - timestamp
|
||||
const last = +new Date() - timestamp;
|
||||
|
||||
// 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
|
||||
if (last < wait && last > 0) {
|
||||
timeout = setTimeout(later, wait - last)
|
||||
timeout = setTimeout(later, wait - last);
|
||||
} else {
|
||||
timeout = null
|
||||
timeout = null;
|
||||
// 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
|
||||
if (!immediate) {
|
||||
result = func.apply(context, args)
|
||||
if (!timeout) context = args = null
|
||||
result = func.apply(context, args);
|
||||
if (!timeout) context = args = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return function (...args) {
|
||||
context = this
|
||||
timestamp = +new Date()
|
||||
const callNow = immediate && !timeout
|
||||
return function(...args) {
|
||||
context = this;
|
||||
timestamp = +new Date();
|
||||
const callNow = immediate && !timeout;
|
||||
// 如果延时不存在,重新设定延时
|
||||
if (!timeout) timeout = setTimeout(later, wait)
|
||||
if (!timeout) timeout = setTimeout(later, wait);
|
||||
if (callNow) {
|
||||
result = func.apply(context, args)
|
||||
context = args = null
|
||||
result = func.apply(context, args);
|
||||
context = args = null;
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -289,18 +291,18 @@ export function debounce(func, wait, immediate) {
|
|||
* @returns {Object}
|
||||
*/
|
||||
export function deepClone(source) {
|
||||
if (!source && typeof source !== 'object') {
|
||||
throw new Error('error arguments', 'deepClone')
|
||||
if (!source && typeof source !== "object") {
|
||||
throw new Error("error arguments", "deepClone");
|
||||
}
|
||||
const targetObj = source.constructor === Array ? [] : {}
|
||||
const targetObj = source.constructor === Array ? [] : {};
|
||||
Object.keys(source).forEach(keys => {
|
||||
if (source[keys] && typeof source[keys] === 'object') {
|
||||
targetObj[keys] = deepClone(source[keys])
|
||||
if (source[keys] && typeof source[keys] === "object") {
|
||||
targetObj[keys] = deepClone(source[keys]);
|
||||
} else {
|
||||
targetObj[keys] = source[keys]
|
||||
targetObj[keys] = source[keys];
|
||||
}
|
||||
})
|
||||
return targetObj
|
||||
});
|
||||
return targetObj;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -308,16 +310,16 @@ export function deepClone(source) {
|
|||
* @returns {Array}
|
||||
*/
|
||||
export function uniqueArr(arr) {
|
||||
return Array.from(new Set(arr))
|
||||
return Array.from(new Set(arr));
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
export function createUniqueString() {
|
||||
const timestamp = +new Date() + ''
|
||||
const randomNum = parseInt((1 + Math.random()) * 65536) + ''
|
||||
return (+(randomNum + timestamp)).toString(32)
|
||||
const timestamp = +new Date() + "";
|
||||
const randomNum = parseInt((1 + Math.random()) * 65536) + "";
|
||||
return (+(randomNum + timestamp)).toString(32);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -327,7 +329,7 @@ export function createUniqueString() {
|
|||
* @returns {boolean}
|
||||
*/
|
||||
export function hasClass(ele, cls) {
|
||||
return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'))
|
||||
return !!ele.className.match(new RegExp("(\\s|^)" + cls + "(\\s|$)"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -336,7 +338,7 @@ export function hasClass(ele, cls) {
|
|||
* @param {string} cls
|
||||
*/
|
||||
export function addClass(ele, cls) {
|
||||
if (!hasClass(ele, cls)) ele.className += ' ' + cls
|
||||
if (!hasClass(ele, cls)) ele.className += " " + cls;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -346,45 +348,45 @@ export function addClass(ele, cls) {
|
|||
*/
|
||||
export function removeClass(ele, cls) {
|
||||
if (hasClass(ele, cls)) {
|
||||
const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)')
|
||||
ele.className = ele.className.replace(reg, ' ')
|
||||
const reg = new RegExp("(\\s|^)" + cls + "(\\s|$)");
|
||||
ele.className = ele.className.replace(reg, " ");
|
||||
}
|
||||
}
|
||||
|
||||
// 替换邮箱字符
|
||||
export function regEmail(email) {
|
||||
if (String(email).indexOf('@') > 0) {
|
||||
const str = email.split('@')
|
||||
let _s = ''
|
||||
if (String(email).indexOf("@") > 0) {
|
||||
const str = email.split("@");
|
||||
let _s = "";
|
||||
if (str[0].length > 3) {
|
||||
for (var i = 0; i < str[0].length - 3; i++) {
|
||||
_s += '*'
|
||||
_s += "*";
|
||||
}
|
||||
}
|
||||
var new_email = str[0].substr(0, 3) + _s + '@' + str[1]
|
||||
var new_email = str[0].substr(0, 3) + _s + "@" + str[1];
|
||||
}
|
||||
return new_email
|
||||
return new_email;
|
||||
}
|
||||
|
||||
// 替换手机字符
|
||||
export function regMobile(mobile) {
|
||||
if (mobile.length > 7) {
|
||||
var new_mobile = mobile.substr(0, 3) + '****' + mobile.substr(7)
|
||||
var new_mobile = mobile.substr(0, 3) + "****" + mobile.substr(7);
|
||||
}
|
||||
return new_mobile
|
||||
return new_mobile;
|
||||
}
|
||||
|
||||
// 下载文件
|
||||
export function downloadFile(obj, name, suffix) {
|
||||
const url = window.URL.createObjectURL(new Blob([obj]))
|
||||
const link = document.createElement('a')
|
||||
link.style.display = 'none'
|
||||
link.href = url
|
||||
const fileName = parseTime(new Date()) + '-' + name + '.' + suffix
|
||||
link.setAttribute('download', fileName)
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
const url = window.URL.createObjectURL(new Blob([obj]));
|
||||
const link = document.createElement("a");
|
||||
link.style.display = "none";
|
||||
link.href = url;
|
||||
const fileName = parseTime(new Date()) + "-" + name + "." + suffix;
|
||||
link.setAttribute("download", fileName);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -398,3 +400,41 @@ export function RandomNumBoth(Max, Min = 0) {
|
|||
var num = Min + Math.round(Rand * Range); //四舍五入
|
||||
return num;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是不是PC浏览器
|
||||
* @returns
|
||||
*/
|
||||
export function isPcBowser() {
|
||||
if (!window.navigator) {
|
||||
return false;
|
||||
} else {
|
||||
if (/Mobile|Android|webOS|iPhone|iPad|Phone/i.test(navigator.userAgent)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保留小数n位,不进行四舍五入
|
||||
* num你传递过来的数字,
|
||||
* decimal你保留的几位,默认保留小数后两位
|
||||
* isInt 是否保留0
|
||||
*/
|
||||
export function formatDecimal(num, decimal = 2, isInt = false) {
|
||||
num = num.toFixed(3).toString();
|
||||
const index = num.indexOf(".");
|
||||
if (index !== -1) {
|
||||
num = num.substring(0, decimal + index + 1);
|
||||
} else {
|
||||
num = num.substring(0);
|
||||
}
|
||||
//截取后保留两位小数
|
||||
if (isInt) {
|
||||
return parseFloat(num);
|
||||
} else {
|
||||
return parseFloat(num).toFixed(decimal);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,166 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container flex">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="$refs.addSong.show()">
|
||||
添加歌曲
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="flex">
|
||||
<span>歌手页地址:</span>
|
||||
<a class="cursor-pointer" target="_blank" :href="singgerUrl">{{singgerUrl}}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="head-container" id="table_drag">
|
||||
<el-table :data="tableData.list" v-loading="tableData.loading" row-key="id">
|
||||
<el-table-column label="排序" sortable prop="sort"></el-table-column>
|
||||
<el-table-column label="id" prop="id"></el-table-column>
|
||||
<el-table-column label="歌曲图片" prop="img">
|
||||
<template v-slot="scope">
|
||||
<el-image :src="scope.row.img"
|
||||
style="width:40px;height: 40px;border-radius: 4px;background-color: #efefef;">
|
||||
<div class="img_error" slot="error">
|
||||
<i class="icon el-icon-document-delete"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="歌曲名称" prop="name"></el-table-column>
|
||||
<el-table-column label="演出歌手" prop="singer"></el-table-column>
|
||||
<el-table-column label="单价" prop="price"></el-table-column>
|
||||
<el-table-column label="点唱次数" prop="salesNumber"></el-table-column>
|
||||
<el-table-column label="歌曲状态" prop="status">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0"
|
||||
@change="showChange($event, scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="240">
|
||||
<template v-slot="scope">
|
||||
<!-- <el-button type="text" icon="el-icon-rank" v-if="isPcBowser">排序</el-button>
|
||||
<el-button type="text" size="mini" round icon="el-icon-edit" @click="$refs.addSong.show(scope.row)"
|
||||
style="margin-left: 20px !important;">编辑</el-button> -->
|
||||
<el-button type="text" size="mini" round icon="el-icon-edit" @click="$refs.addSong.show(scope.row)">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delHandle([scope.row.id])">
|
||||
<el-button type="text" size="mini" round icon="el-icon-delete" slot="reference">
|
||||
删除
|
||||
</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<addSong ref="addSong" @success="addSongSuccess"></addSong>
|
||||
<el-pagination @size-change="paginationSizeChange" :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sortable from 'sortablejs'
|
||||
import {
|
||||
tbShopSonglist,tbShopSongDel,tbShopSongEdit
|
||||
} from '@/api/application-song'
|
||||
import addSong from './componentsCompoents/add-song.vue'
|
||||
export default {
|
||||
components: {
|
||||
addSong
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
singgerUrl:'',
|
||||
tableData: {
|
||||
page: 0,
|
||||
size: 10,
|
||||
total: 0,
|
||||
loading: false,
|
||||
list: []
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
jumpUrl(url){
|
||||
window.open(url)
|
||||
},
|
||||
addSongSuccess() {
|
||||
this.getTableData()
|
||||
},
|
||||
paginationSizeChange(e){
|
||||
this.tableData.size = e
|
||||
this.getTableData()
|
||||
},
|
||||
async showChange(e,row){
|
||||
try {
|
||||
this.tableData.loading = true
|
||||
const data = { ...row }
|
||||
data.status = e
|
||||
await tbShopSongEdit(data, 'put')
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
this.tableData.loading = false
|
||||
}
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.tableData.page = 0;
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 删除
|
||||
async delHandle(ids) {
|
||||
try {
|
||||
await tbShopSongDel(ids)
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: `删除成功`,
|
||||
type: 'success'
|
||||
});
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
// 获取音乐列表
|
||||
async getTableData() {
|
||||
try {
|
||||
this.tableData.loading = true
|
||||
const res = await tbShopSonglist({
|
||||
page: this.tableData.page+1,
|
||||
size: this.tableData.size,
|
||||
sort: 'id',
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.list = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
const baseUrl=location.hostname==='localhost'? 'https://admintestweb.sxczgkj.cn': location.origin
|
||||
this.singgerUrl = baseUrl+'/song-H5/index.html?t='+res.songUrl
|
||||
} catch (error) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.flex{
|
||||
display: flex;
|
||||
align-content: center;
|
||||
}
|
||||
.cursor-pointer{
|
||||
cursor: pointer;
|
||||
color: #1890ff!important;
|
||||
transition: all 0.3s;
|
||||
font-size: 16px;
|
||||
}
|
||||
.cursor-pointer:hover{
|
||||
opacity: .7;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,388 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-dialog :title="form.id ? '编辑酒品' : '添加酒品'" :visible.sync="dialogVisible" @close="reset">
|
||||
<div class="head-container" v-if="!form.id">
|
||||
<div class="tab_wrap">
|
||||
<div class="tab" :style="{ '--index': form.source }">
|
||||
<div class="item" v-for="(item, index) in tabs" :key="item.value"
|
||||
:class="{ active: index == form.source }" @click="tabChange(item)">
|
||||
{{ item.label }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="left">
|
||||
<template v-if="form.source == 0">
|
||||
<el-form-item label="酒品名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入酒品名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="酒品图片">
|
||||
<uploadImg ref="uploadImg" :limit="1" @success="e => form.imgUrl = e[0]"
|
||||
@remove="form.imgUrl = ''" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-if="!form.id">
|
||||
<el-form-item label="选择商品" prop="name">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus"
|
||||
@click="$refs.shopListRef.show([...productIds])">
|
||||
添加商品
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="shop_list">
|
||||
<div class="item_wrap" v-for="(item, index) in productIds" :key="item.id"
|
||||
@click="productIds.splice(index, 1)">
|
||||
<div class="item" :data-index="index + 1">
|
||||
<el-image :src="item.coverImg" style="width: 100%;height: 100%;"></el-image>
|
||||
</div>
|
||||
<div class="name">{{ item.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-form-item label="商品">
|
||||
<div class="goods_info">
|
||||
<el-image :src="form.imgUrl" style="width: 50px;height: 50px;"></el-image>
|
||||
<div class="info">{{ form.name }}</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</template>
|
||||
<el-form-item label="单位">
|
||||
<el-input v-model="form.unit" placeholder="请输入单位" style="width: 200px;" />
|
||||
<!-- <el-select v-model="form.unitId" placeholder="请选择单位" style="width: 200px;" @change="selectUnitt">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in units" :key="item.id"></el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" plain icon="el-icon-plus"
|
||||
@click="$refs.addUnitRef.show()">添加单位</el-button> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="有效期(天)">
|
||||
<el-input-number v-model="form.period" controls-position="right" step-strictly :min="1"
|
||||
placeholder="请输入有效期(天)"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmitHandle">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<addUnit ref="addUnitRef" @success="tbShopUnit" />
|
||||
<shopList ref="shopListRef" @success="slectShop" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { tbShopStorageGood } from '@/api/application'
|
||||
import { queryAllShopUser, tbShopUnit } from '@/api/shop'
|
||||
import uploadImg from '@/components/uploadImg'
|
||||
import addUnit from '@/views/product/components/addUnit'
|
||||
import shopList from '@/components/shopList'
|
||||
export default {
|
||||
components: {
|
||||
uploadImg,
|
||||
addUnit,
|
||||
shopList
|
||||
},
|
||||
data() {
|
||||
const nameValidator = (rule, value, callback) => {
|
||||
if (this.form.source == 0) {
|
||||
if (!this.form.name) {
|
||||
callback(new Error('请输入酒名名'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
} else {
|
||||
if (!this.productIds.length) {
|
||||
callback(new Error('请选择商品'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tabs: [
|
||||
{
|
||||
value: 0,
|
||||
label: '手动添加'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '从商品添加'
|
||||
}
|
||||
],
|
||||
units: [],
|
||||
loading: false,
|
||||
options: [],
|
||||
productIds: [],
|
||||
form: {
|
||||
name: '',
|
||||
imgUrl: '',
|
||||
source: 0,
|
||||
id: '',
|
||||
goods: [
|
||||
{
|
||||
imgUrl: '',
|
||||
name: '',
|
||||
}
|
||||
],
|
||||
period: '',
|
||||
unit: ''
|
||||
},
|
||||
resetForm: '',
|
||||
rules: {
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
validator: nameValidator,
|
||||
trigger: 'change'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.resetForm = { ...this.form }
|
||||
// this.getTableData()
|
||||
this.tbShopUnit()
|
||||
},
|
||||
methods: {
|
||||
slectShop(res) {
|
||||
if (this.productIds.length) {
|
||||
res.map(async item => {
|
||||
if (!await this.checkShop(item.id)) {
|
||||
this.productIds.push({ ...item })
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.productIds = res
|
||||
}
|
||||
},
|
||||
selectUnitt(e) {
|
||||
this.form.unit = this.units.find(item => item.id == e).name
|
||||
},
|
||||
// 获取单位
|
||||
async tbShopUnit() {
|
||||
try {
|
||||
const res = await tbShopUnit({
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
sort: 'id',
|
||||
page: 0,
|
||||
size: 100
|
||||
})
|
||||
this.units = res.content
|
||||
} catch (error) { }
|
||||
},
|
||||
// 切换类型
|
||||
tabChange(item) {
|
||||
this.form.source = this.tabs.findIndex(i => i.value == item.value)
|
||||
},
|
||||
// 获取用户列表
|
||||
async getTableData(query = '') {
|
||||
this.loading = true
|
||||
try {
|
||||
const res = await queryAllShopUser({
|
||||
telephone: query,
|
||||
})
|
||||
this.loading = false
|
||||
this.options = res.content
|
||||
} catch (error) {
|
||||
this.loading = false
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
// 提交
|
||||
onSubmitHandle() {
|
||||
this.$refs.form.validate(async valid => {
|
||||
if (valid) {
|
||||
try {
|
||||
if (this.form.source == 0) {
|
||||
// 手动大导入
|
||||
this.form.goods = [{
|
||||
name: this.form.name,
|
||||
imgUrl: this.form.imgUrl
|
||||
}]
|
||||
} else {
|
||||
this.form.goods = this.productIds.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
imgUrl: item.coverImg
|
||||
}
|
||||
})
|
||||
}
|
||||
let res = await tbShopStorageGood(this.form, this.form.id ? 'put' : 'post')
|
||||
this.$emit('success', res)
|
||||
this.close()
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: `${this.form.id ? '编辑' : '添加'}成功`,
|
||||
type: 'success'
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
show(obj) {
|
||||
this.dialogVisible = true
|
||||
if (obj && obj.id) {
|
||||
this.form = obj
|
||||
if (obj.imgUrl && obj.source == 0) {
|
||||
setTimeout(() => {
|
||||
this.$refs.uploadImg.fileList = [
|
||||
{
|
||||
url: obj.imgUrl
|
||||
}
|
||||
]
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
reset() {
|
||||
if (this.form.source == 0) {
|
||||
this.$refs.uploadImg.clearFiles()
|
||||
}
|
||||
this.form = { ...this.resetForm }
|
||||
this.$refs.form.resetFields()
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.goods_info {
|
||||
background-color: #f9f9f9;
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.head-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.tab_wrap {
|
||||
background-color: #DCF0E8;
|
||||
padding: 4px;
|
||||
|
||||
.tab {
|
||||
--w: 120px;
|
||||
height: 35px;
|
||||
display: flex;
|
||||
position: relative;
|
||||
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
width: var(--w);
|
||||
height: inherit;
|
||||
background-color: #39D47A;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: calc(var(--index) * var(--w));
|
||||
z-index: 1;
|
||||
transition: left .3s ease-in-out;
|
||||
}
|
||||
|
||||
.item {
|
||||
width: var(--w);
|
||||
height: inherit;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
color: #39D47A;
|
||||
transition: all .1s ease-in-out .15s;
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&.active {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.shop_list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.item_wrap {
|
||||
$size: 80px;
|
||||
|
||||
.item {
|
||||
$radius: 4px;
|
||||
width: $size;
|
||||
height: $size;
|
||||
border-radius: $radius;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
margin-right: 10px;
|
||||
margin-top: 10px;
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: attr(data-index);
|
||||
font-size: 12px;
|
||||
height: 20px;
|
||||
display: flex;
|
||||
padding: 0 10px;
|
||||
border-radius: 0 0 $radius 0;
|
||||
align-items: center;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
backdrop-filter: blur(10px);
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
&::before {
|
||||
content: '删除';
|
||||
font-size: 12px;
|
||||
width: 100%;
|
||||
height: 20px;
|
||||
display: flex;
|
||||
padding: 0 10px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
backdrop-filter: blur(10px);
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
transition: all .1s ease-in-out;
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
width: $size;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
<template>
|
||||
<div class="head-container">
|
||||
<div class="head-container">
|
||||
<el-form :model="query" inline>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="$refs.addModal.show()">添加酒品</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="搜索">
|
||||
<el-input v-model="query.name" placeholder="酒名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.data" v-loading="tableData.loading">
|
||||
<el-table-column label="酒名" prop="name">
|
||||
<template v-slot="scope">
|
||||
<div style="display: flex;align-items: center;">
|
||||
<el-image :src="scope.row.imgUrl"
|
||||
style="width:40px;height: 40px;border-radius: 4px;background-color: #efefef;">
|
||||
<div class="img_error" slot="error">
|
||||
<i class="icon el-icon-document-delete"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
<span style="margin-left: 10px;">{{ scope.row.name }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" prop="unit">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="primary">{{ scope.row.unit }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="有效期(天)" prop="period"></el-table-column>
|
||||
<el-table-column label="来源" prop="source">
|
||||
<template v-slot="scope">
|
||||
<span v-if="scope.row.source == 0">手动导入</span>
|
||||
<span v-if="scope.row.source == 1">商品导入</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120">
|
||||
<template v-slot="scope">
|
||||
<div style="display: flex;gap: 10px;">
|
||||
<el-button type="text"
|
||||
@click="$refs.winAddModal.show({ name: scope.row.name, imgUrl: scope.row.imgUrl, expDay: scope.row.period, unit: scope.row.unit }, true)">存酒</el-button>
|
||||
<el-button type="text" @click="$refs.addModal.show(scope.row)">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delHandle(scope.row)">
|
||||
<el-button type="text" slot="reference">删除</el-button>
|
||||
</el-popconfirm>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
</div>
|
||||
<addModal ref="addModal" @success="getTableData" />
|
||||
<winAddModal ref="winAddModal" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { tbShopStorageGoodlist, tbShopStorageGood } from '@/api/application'
|
||||
import addModal from './addModal'
|
||||
import winAddModal from '../winestorage/addModal'
|
||||
export default {
|
||||
components: {
|
||||
addModal,
|
||||
winAddModal
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusList: [
|
||||
{
|
||||
value: 0,
|
||||
label: '已取完'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '未取完'
|
||||
}
|
||||
],
|
||||
query: {
|
||||
name: ""
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 10,
|
||||
loading: false,
|
||||
total: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
// 删除
|
||||
async delHandle(row) {
|
||||
try {
|
||||
let obj = { ...row }
|
||||
obj.isDel = 1
|
||||
await tbShopStorageGood(obj, 'put')
|
||||
this.$notify.success('删除成功')
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.tableData.page = 0;
|
||||
this.query.name = ''
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1;
|
||||
this.getTableData()
|
||||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await tbShopStorageGoodlist({
|
||||
name: this.query.name,
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.data = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,188 @@
|
|||
<template>
|
||||
<el-dialog :title="form.id ? '编辑存酒' : '添加存酒'" width="500px" :visible.sync="dialogVisible" @close="reset">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="left">
|
||||
<template v-if="!form.id">
|
||||
<el-form-item label="选择用户" prop="userid">
|
||||
<el-select v-model="form.userid" placeholder="请输入用户昵称" filterable remote
|
||||
:remote-method="queryAllShopUser" :loading="loading" @change="userChange">
|
||||
<el-option v-for="item in options" :key="item.id" :label="`${item.nickName}-${item.telephone}`"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="选择酒品">
|
||||
<el-select v-model="form.name" @change="wineChange" v-if="!wine">
|
||||
<el-option :label="item.name" :value="item.name" v-for="(item, index) in wineList"
|
||||
:key="index"></el-option>
|
||||
</el-select>
|
||||
<div class="goods_info" v-else>
|
||||
<el-image :src="form.imgUrl" style="width: 50px;height: 50px;"></el-image>
|
||||
<div class="info">{{ form.name }}</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量">
|
||||
<el-input-number v-model="form.num" :step="1" step-strictly :min="1"></el-input-number>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item label="数量" v-else>
|
||||
<el-input-number v-model="num" :step="1" step-strictly :min="1" :max="form.num"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmitHandle">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { queryAllShopUser } from '@/api/shop'
|
||||
import { tbShopStorageGoodlist, storageWin, storagePut } from '@/api/application'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
options: [],
|
||||
num: '',
|
||||
wine: false,
|
||||
form: {
|
||||
id: '',
|
||||
imgUrl: '',
|
||||
name: '',
|
||||
nickname: '',
|
||||
num: 1,
|
||||
status: '',
|
||||
telphone: '',
|
||||
unit: '',
|
||||
userid: '',
|
||||
expDay: ''
|
||||
},
|
||||
resetForm: '',
|
||||
rules: {
|
||||
userid: [
|
||||
{
|
||||
required: true,
|
||||
message: ' ',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
},
|
||||
wineList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.resetForm = { ...this.form }
|
||||
this.queryAllShopUser()
|
||||
this.tbShopStorageGoodlist()
|
||||
},
|
||||
methods: {
|
||||
// 选择用户
|
||||
userChange(e) {
|
||||
let user = this.options.find(item => item.id == e)
|
||||
this.form.nickname = user.nickName
|
||||
this.form.telphone = user.telephone
|
||||
},
|
||||
// 选择酒品
|
||||
wineChange(e) {
|
||||
let wine = this.wineList.find(item => item.name == e)
|
||||
this.form.imgUrl = wine.imgUrl
|
||||
this.form.expDay = wine.period
|
||||
this.form.unit = wine.unit
|
||||
},
|
||||
// 获取酒品列表
|
||||
async tbShopStorageGoodlist() {
|
||||
try {
|
||||
const res = await tbShopStorageGoodlist({
|
||||
page: 0,
|
||||
size: 100
|
||||
})
|
||||
this.wineList = res.content
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
// 获取用户列表
|
||||
async queryAllShopUser(query = '') {
|
||||
this.loading = true
|
||||
try {
|
||||
const res = await queryAllShopUser({
|
||||
name: query,
|
||||
})
|
||||
this.loading = false
|
||||
this.options = res.content
|
||||
} catch (error) {
|
||||
this.loading = false
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
// 提交
|
||||
onSubmitHandle() {
|
||||
console.log(this.form)
|
||||
this.$refs.form.validate(async valid => {
|
||||
if (valid) {
|
||||
try {
|
||||
let res = ''
|
||||
if (this.form.id) {
|
||||
res = await storagePut({
|
||||
id: this.form.id,
|
||||
num: this.num,
|
||||
type: 0
|
||||
})
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: `取酒成功`,
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
res = await storageWin(this.form)
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: `存酒成功`,
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
this.$emit('success', res)
|
||||
this.close()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
async show(obj = {}, wine = false) {
|
||||
this.dialogVisible = true
|
||||
if (obj && obj.id) {
|
||||
this.form = { ...obj }
|
||||
}
|
||||
if (obj && obj.name) {
|
||||
this.form.name = obj.name
|
||||
this.form.imgUrl = obj.imgUrl
|
||||
this.form.expDay = obj.expDay
|
||||
this.form.unit = obj.unit
|
||||
}
|
||||
this.wine = wine
|
||||
},
|
||||
close() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
reset() {
|
||||
this.form = { ...this.resetForm }
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.goods_info {
|
||||
background-color: #f9f9f9;
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<template>
|
||||
<el-dialog title="记录" width="500px" :visible.sync="dialogVisible">
|
||||
<el-steps :active="list.length" direction="vertical" :space="100">
|
||||
<el-step :title="item.content" :description="item.time" v-for="item in list" :key="item.id"></el-step>
|
||||
</el-steps>
|
||||
<el-empty description="暂无记录" v-if="!list.length"></el-empty>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { recordList } from '@/api/application'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
list: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 查询存取酒记录
|
||||
async recordList(storageId) {
|
||||
try {
|
||||
this.loading = true
|
||||
const res = await recordList({ storageId: storageId })
|
||||
this.list = res.content
|
||||
this.loading = false
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
show(id) {
|
||||
this.dialogVisible = true
|
||||
this.recordList(id)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
<template>
|
||||
<div class="head-container">
|
||||
<div class="head-container">
|
||||
<el-form :model="query" inline>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="$refs.addModal.show()">添加存酒</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="搜索">
|
||||
<el-input v-model="query.name" placeholder="酒名/用户昵称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号">
|
||||
<el-input v-model="query.telphone" placeholder="手机号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="query.status">
|
||||
<el-option v-for="item in statusList" :key="item.value" :value="item.value"
|
||||
:label="item.label"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.data" v-loading="tableData.loading" row-key="id">
|
||||
<el-table-column label="用户名" prop="nickname">
|
||||
<template v-slot="scope">
|
||||
<div style="display: flex;align-items: center;">
|
||||
<el-image src=""
|
||||
style="width:40px;height: 40px;background-color: #efefef;display: flex;align-items: center;justify-content: center;">
|
||||
<i class="el-icon-folder-delete" slot="error" style="font-size: 20px;color: #999;"></i>
|
||||
</el-image>
|
||||
<span style="margin-left: 10px;">{{ scope.row.telphone }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="酒品名" prop="name">
|
||||
<template v-slot="scope">
|
||||
<div style="display: flex;align-items: center;">
|
||||
<el-image :src="scope.row.imgUrl" style="width:40px;height: 40px;">
|
||||
<i class="el-icon-folder-delete" slot="error"></i>
|
||||
</el-image>
|
||||
<span style="margin-left: 10px;">{{ scope.row.name }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="name">
|
||||
<template v-slot="scope">
|
||||
<span>{{ scope.row.num }}({{ scope.row.unit }})</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="存酒时间" prop="savTime"></el-table-column>
|
||||
<el-table-column label="到期时间" prop="expTime"></el-table-column>
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template v-slot="scope">
|
||||
<el-tag :type="statusList.find(item => item.value === scope.row.status).type">{{
|
||||
statusList.find(item => item.value === scope.row.status).label }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120">
|
||||
<template v-slot="scope">
|
||||
<div style="display: flex;gap: 10px;">
|
||||
<el-button type="text" @click="$refs.HistoryModal.show(scope.row.id)">查看记录</el-button>
|
||||
<el-button type="text" v-if="scope.row.status == 0" disabled>已取完</el-button>
|
||||
<el-button type="text" @click="$refs.addModal.show(scope.row)"
|
||||
v-if="scope.row.status == 1">取酒</el-button>
|
||||
<el-button type="text" v-if="scope.row.status == 2" disabled>已过期</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
</div>
|
||||
<addModal ref="addModal" @success="getTableData" />
|
||||
<HistoryModal ref="HistoryModal" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import addModal from './addModal'
|
||||
import HistoryModal from './historyModal'
|
||||
import { storageList } from '@/api/application'
|
||||
export default {
|
||||
components: {
|
||||
addModal,
|
||||
HistoryModal
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusList: [
|
||||
{
|
||||
value: '',
|
||||
label: '全部',
|
||||
type: 'warning'
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '已取完',
|
||||
type: 'warning'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '存储中',
|
||||
type: 'primary'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '已过期',
|
||||
type: 'info'
|
||||
}
|
||||
],
|
||||
query: {
|
||||
name: "",
|
||||
telphone: "",
|
||||
status: ''
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 10,
|
||||
loading: false,
|
||||
total: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.tableData.page = 0
|
||||
this.query.name = ''
|
||||
this.query.telphone = ''
|
||||
this.query.status = ''
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1;
|
||||
this.getTableData()
|
||||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
try {
|
||||
this.tableData.loading = true
|
||||
const res = await storageList({
|
||||
...this.query,
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.data = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
<template>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.data" v-loading="tableData.loading">
|
||||
<el-table-column label="商品信息">
|
||||
<template v-slot="scope">
|
||||
<div class="shop_info">
|
||||
<el-image :src="scope.row.imgUrl"
|
||||
style="width: 50px;height: 50px;border-radius: 4px;background-color: #efefef;">
|
||||
<div class="img_error" slot="error">
|
||||
<i class="icon el-icon-document-delete"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
<div class="info">
|
||||
<span>{{ scope.row.name }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="有效存酒" prop="savNum"></el-table-column>
|
||||
<el-table-column label="已过期存酒" prop="expNum"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { countRecord } from '@/api/application'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 10,
|
||||
loading: false,
|
||||
total: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
try {
|
||||
this.tableData.loading = true
|
||||
const res = await countRecord({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.data = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.shop_info {
|
||||
display: flex;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding-left: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.tag_wrap {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,172 @@
|
|||
<template>
|
||||
<el-dialog :title="title" width="500px" :visible.sync="dialogVisible" @close="diaClose">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="left">
|
||||
<el-form-item label="歌曲图片">
|
||||
<uploadImg ref="uploadImg" :limit="1" @success="uploadSuccess" @remove="uploadRemove" />
|
||||
<div class="tips"></div>
|
||||
</el-form-item>
|
||||
<el-form-item label="歌曲名称" prop="name">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="原唱歌手">
|
||||
<el-input v-model="form.originSinger"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="演出歌手名称" prop="singer">
|
||||
<el-input v-model="form.singer"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="单价" prop="price">
|
||||
<el-input type="number" v-model="form.price"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input type="number" v-model="form.sort"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmitHandle">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uploadImg from '@/components/uploadImg'
|
||||
import {
|
||||
tbShopSongAdd,tbShopSongEdit
|
||||
} from '@/api/application-song'
|
||||
const form={
|
||||
img: '',
|
||||
name: '',
|
||||
singer: '',
|
||||
originSinger: '',
|
||||
price: 0,
|
||||
sort: 0
|
||||
}
|
||||
export default {
|
||||
components: {
|
||||
uploadImg
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
dialogVisible: false,
|
||||
rules: {
|
||||
name: [{
|
||||
required: true,
|
||||
message: '歌曲名称必填',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
singer: [{
|
||||
required: true,
|
||||
message: '演出歌手名称必填',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
price: [{
|
||||
required: true,
|
||||
message: '单价必填',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
sort: [{
|
||||
required: true,
|
||||
message: '排序必填',
|
||||
trigger: 'blur'
|
||||
}]
|
||||
},
|
||||
form:{...form}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
restForm(){
|
||||
console.log('restForm')
|
||||
console.log(form)
|
||||
this.form={...form}
|
||||
this.$refs.uploadImg.clearFiles()
|
||||
},
|
||||
diaClose(){
|
||||
this.restForm()
|
||||
},
|
||||
uploadSuccess(res) {
|
||||
this.form.img = res[0]
|
||||
console.log(this.form.img);
|
||||
},
|
||||
uploadRemove() {
|
||||
this.form.img = ''
|
||||
},
|
||||
// 提交
|
||||
onSubmitHandle() {
|
||||
console.log(this.form)
|
||||
this.$refs.form.validate(async valid => {
|
||||
if (valid) {
|
||||
try {
|
||||
let res = ''
|
||||
if (this.form.id) { //编辑
|
||||
res = await tbShopSongEdit(this.form)
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: `修改成功`,
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
//添加
|
||||
res = await tbShopSongAdd(this.form)
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: `添加成功`,
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
this.close()
|
||||
|
||||
this.$emit('success', res)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
async show(obj = {}) {
|
||||
console.log(obj);
|
||||
// this.form=this.$options.data().form
|
||||
this.dialogVisible = true
|
||||
this.title='添加歌曲'
|
||||
|
||||
if (obj && obj.id) {
|
||||
this.title='编辑歌曲'
|
||||
this.form = {
|
||||
...obj
|
||||
}
|
||||
}
|
||||
if (obj && obj.hasOwnProperty('img')&&obj.img) {
|
||||
console.log(obj.img)
|
||||
this.form.img = obj.img
|
||||
requestAnimationFrame(()=>{
|
||||
this.$refs.uploadImg.fileList = [{
|
||||
url: obj.img
|
||||
}]
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
close() {
|
||||
this.restForm()
|
||||
this.dialogVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.goods_info {
|
||||
background-color: #f9f9f9;
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="title">应用中心</div>
|
||||
<div class="list">
|
||||
<div class="item" v-for="item in list" :key="item.id" @click="to(item)">
|
||||
<img :src="item.coverImg" class="icon">
|
||||
<div class="info">
|
||||
<div class="name">{{ item.name }}</div>
|
||||
<div class="intro">
|
||||
{{ item.value }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { appCenterGet } from "@/api/application";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.appCenterGet()
|
||||
},
|
||||
methods: {
|
||||
// 跳转
|
||||
to(item) {
|
||||
localStorage.setItem('applocation', JSON.stringify(item))
|
||||
this.$router.push({
|
||||
name: item.absUrl
|
||||
})
|
||||
},
|
||||
// 获取应用列表
|
||||
async appCenterGet() {
|
||||
try {
|
||||
const res = await appCenterGet()
|
||||
this.list = res
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.title {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.list {
|
||||
padding: 20px 0;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 14px;
|
||||
|
||||
.item {
|
||||
width: 400px;
|
||||
background-color: #f5f5f5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 14px;
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
|
||||
.info {
|
||||
.name {
|
||||
color: #39D47A;
|
||||
}
|
||||
|
||||
.intro {
|
||||
color: #39D47A;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding-left: 10px;
|
||||
|
||||
.name {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.intro {
|
||||
color: #999;
|
||||
margin-top: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="header">
|
||||
<div class="item">
|
||||
<img :src="applocation.coverImg" class="icon">
|
||||
<div class="info">
|
||||
<div class="name">{{ applocation.name }}</div>
|
||||
<div class="intro">
|
||||
{{ applocation.value }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<div class="tab_wrap">
|
||||
<div class="tab" :style="{ '--index': tabActive }">
|
||||
<div class="item" v-for="item in tabs" :key="item.value" @click="tabChange(item)">
|
||||
{{ item.label }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<winestorageRecord v-if="tabActive == 0" />
|
||||
<wineRecord v-if="tabActive == 1" />
|
||||
<winetotal v-if="tabActive == 2" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import winestorageRecord from './components/winestorage/record.vue'
|
||||
import wineRecord from './components/wine/record.vue'
|
||||
import winetotal from './components/winetotal/winetotal.vue'
|
||||
export default {
|
||||
components: {
|
||||
winestorageRecord,
|
||||
wineRecord,
|
||||
winetotal
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
applocation: JSON.parse(localStorage.getItem('applocation')),
|
||||
tabActive: 0,
|
||||
tabs: [
|
||||
{
|
||||
value: 1,
|
||||
label: '存酒记录'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '可存酒管理'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '存酒统计'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
tabChange(item) {
|
||||
this.tabActive = this.tabs.findIndex(i => i.value == item.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.header {
|
||||
display: flex;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
background-color: #f5f5f5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 14px;
|
||||
|
||||
.icon {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding-left: 10px;
|
||||
|
||||
.name {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.intro {
|
||||
color: #999;
|
||||
margin-top: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tab_wrap {
|
||||
background-color: #f5f5f5;
|
||||
padding: 4px;
|
||||
margin-top: 20px;
|
||||
|
||||
.tab {
|
||||
--w: 150px;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
position: relative;
|
||||
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
width: var(--w);
|
||||
height: inherit;
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: calc(var(--index) * var(--w));
|
||||
z-index: 1;
|
||||
transition: left .3s ease-in-out;
|
||||
}
|
||||
|
||||
.item {
|
||||
width: var(--w);
|
||||
height: inherit;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -5,7 +5,17 @@
|
|||
<el-tab-pane label="销量" name="2"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="head-container">
|
||||
<el-form :model="query" label-position="left">
|
||||
<el-form :model="query" inline label-position="left">
|
||||
<template v-if="orderType == 2">
|
||||
<el-form-item>
|
||||
<el-input placeholder="商品名称" v-model="query.proName" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="query.cateId" placeholder="商品分类" style="width: 140px;">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in categorys" :key="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="timeValue" @change="timeChange">
|
||||
<el-radio-button label="">全部</el-radio-button>
|
||||
|
|
@ -17,24 +27,15 @@
|
|||
<el-radio-button label="month">本月</el-radio-button>
|
||||
<el-radio-button label="custom">自定义</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-date-picker
|
||||
v-model="query.createdAt"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
v-if="timeValue == 'custom'"
|
||||
>
|
||||
</el-date-picker
|
||||
><el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-date-picker v-model="query.createdAt" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
v-if="timeValue == 'custom'">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
<el-button
|
||||
icon="el-icon-download"
|
||||
v-loading="downloadLoading"
|
||||
@click="downloadHandle"
|
||||
>
|
||||
<el-button icon="el-icon-download" v-loading="downloadLoading" @click="downloadHandle">
|
||||
<span v-if="!downloadLoading">导出Excel</span>
|
||||
<span v-else>下载中...</span>
|
||||
</el-button>
|
||||
|
|
@ -48,54 +49,95 @@
|
|||
<i class="icon" :class="item.icon"></i>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="m">¥{{ item.payAmount }}</div>
|
||||
<div class="m">
|
||||
<template v-if="item.isAmount == 1">¥</template>
|
||||
{{ item.payAmount }}
|
||||
</div>
|
||||
<div class="t">{{ item.payType }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table
|
||||
:data="tableData.data"
|
||||
v-loading="tableData.loading"
|
||||
v-if="orderType == 1"
|
||||
>
|
||||
<el-table :data="tableData.data" v-loading="tableData.loading" v-if="orderType == 1">
|
||||
<el-table-column label="日期" prop="tradeDay"></el-table-column>
|
||||
<el-table-column label="总金额" prop="total"></el-table-column>
|
||||
<el-table-column label="微信小程序支付" prop="wxLite"></el-table-column>
|
||||
<el-table-column label="扫码支付金额" prop="scanCode"></el-table-column>
|
||||
<el-table-column label="现金支付金额" prop="cash"></el-table-column>
|
||||
<el-table-column label="营业额" prop="total">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.total }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="销售额" prop="total">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.total | totalfilter(scope.row.refund) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="微信小程序支付" prop="wxLite">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.wxLite }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="扫码支付金额" prop="scanCode">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.scanCode }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="现金支付金额" prop="cash">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.cash }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="会员充值" prop="cash">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.recharge }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="会员支付" prop="cash">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.deposit }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="充值金额" prop="cash">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.recharge }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="退款金额" prop="cash">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.refund }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table
|
||||
:data="tableData.data"
|
||||
v-loading="tableData.loading"
|
||||
v-if="orderType == 2"
|
||||
>
|
||||
<el-table :data="tableData.data" v-loading="tableData.loading" v-if="orderType == 2">
|
||||
<el-table-column label="商品名称" prop="productName"></el-table-column>
|
||||
<el-table-column
|
||||
label="商品描述"
|
||||
prop="productSkuName"
|
||||
></el-table-column>
|
||||
<el-table-column label="商品分类" prop="cateName"></el-table-column>
|
||||
<el-table-column label="商品描述" prop="productSkuName"></el-table-column>
|
||||
<el-table-column label="单价" prop="price"></el-table-column>
|
||||
<el-table-column label="销量" prop="salesNum"></el-table-column>
|
||||
<el-table-column label="退单量" prop="refNum"></el-table-column>
|
||||
<el-table-column label="总量" prop="num"></el-table-column>
|
||||
<el-table-column label="销售金额" prop="salesAmount">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.salesAmount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退款金额" prop="refAmount">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.refAmount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination
|
||||
:total="tableData.total"
|
||||
:current-page="tableData.page + 1"
|
||||
:page-size="tableData.size"
|
||||
@current-change="paginationChange"
|
||||
@size-change="sizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
></el-pagination>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" @size-change="sizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { daydownload, daycount, summaryday } from "@/api/home";
|
||||
import { tbShopCategoryGet } from '@/api/shop'
|
||||
import dayjs from "dayjs";
|
||||
import { downloadFile } from "@/utils/index";
|
||||
|
||||
|
|
@ -105,8 +147,11 @@ export default {
|
|||
timeValue: "",
|
||||
resetQuery: null,
|
||||
orderType: "1",
|
||||
categorys: [],
|
||||
query: {
|
||||
createdAt: []
|
||||
createdAt: [],
|
||||
proName: '',
|
||||
cateId: ''
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
|
|
@ -123,13 +168,47 @@ export default {
|
|||
filters: {
|
||||
timeFilter(time) {
|
||||
return dayjs(time).format("YYYY-MM-DD HH:mm:ss");
|
||||
},
|
||||
totalfilter(item,d) {
|
||||
let num = item + d
|
||||
return num.toFixed(2)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.resetQuery = { ...this.query };
|
||||
this.getTableData();
|
||||
this.tbShopCategoryGet()
|
||||
},
|
||||
methods: {
|
||||
// 获取商品分类
|
||||
async tbShopCategoryGet() {
|
||||
try {
|
||||
const res = await tbShopCategoryGet({
|
||||
page: 0,
|
||||
size: 200,
|
||||
sort: 'id,desc',
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
let categorys = []
|
||||
for (let item of res.content) {
|
||||
categorys.push({
|
||||
name: `|----${item.name}`,
|
||||
id: item.id
|
||||
})
|
||||
if (item.childrenList.length) {
|
||||
for (let val of item.childrenList) {
|
||||
categorys.push({
|
||||
name: `|----|----${val.name}`,
|
||||
id: val.id
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
this.categorys = categorys
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 获取订单汇总
|
||||
async daycount() {
|
||||
try {
|
||||
|
|
@ -149,7 +228,9 @@ export default {
|
|||
const file = await daydownload({
|
||||
type: this.orderType,
|
||||
startTime: this.query.createdAt[0],
|
||||
endTime: this.query.createdAt[1]
|
||||
endTime: this.query.createdAt[1],
|
||||
cateId: this.query.cateId,
|
||||
proName: this.query.proName
|
||||
});
|
||||
downloadFile(file, "数据", "xlsx");
|
||||
this.downloadLoading = false;
|
||||
|
|
@ -184,7 +265,9 @@ export default {
|
|||
size: this.tableData.size,
|
||||
type: this.orderType,
|
||||
startTime: this.query.createdAt[0],
|
||||
endTime: this.query.createdAt[1]
|
||||
endTime: this.query.createdAt[1],
|
||||
proName: this.query.proName,
|
||||
cateId: this.query.cateId
|
||||
});
|
||||
this.tableData.loading = false;
|
||||
this.tableData.data = res.content;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,389 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<!-- <el-tabs v-model="orderType" @tab-click="getTableData">
|
||||
<el-tab-pane label="收款" name="1"></el-tab-pane>
|
||||
<el-tab-pane label="销量" name="2"></el-tab-pane>
|
||||
</el-tabs> -->
|
||||
<div class="head-container">
|
||||
<el-form :model="query" inline label-position="left">
|
||||
<el-radio-group v-model="timeValue" @change="timeChange">
|
||||
<el-radio-button label="">全部</el-radio-button>
|
||||
<el-radio-button label="0">今天</el-radio-button>
|
||||
<el-radio-button label="-1">昨天</el-radio-button>
|
||||
<el-radio-button label="-7">最近7天</el-radio-button>
|
||||
<el-radio-button label="-30">最近30天</el-radio-button>
|
||||
<el-radio-button label="week">本周</el-radio-button>
|
||||
<el-radio-button label="month">本月</el-radio-button>
|
||||
<el-radio-button label="custom">自定义</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-date-picker v-model="query.createdAt" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
>
|
||||
</el-date-picker>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
<el-button icon="el-icon-download" v-loading="downloadLoading" @click="downloadHandle">
|
||||
<span v-if="!downloadLoading">导出Excel</span>
|
||||
<span v-else>下载中...</span>
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- <div class="head-container">
|
||||
<div class="collect_wrap">
|
||||
<div class="item" v-for="item in payCountList" :key="item.id">
|
||||
<div class="icon_wrap" style="--bg-color:#C978EE">
|
||||
<i class="icon" :class="item.icon"></i>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="m">
|
||||
<template v-if="item.isAmount == 1">¥</template>
|
||||
{{ item.payAmount }}
|
||||
</div>
|
||||
<div class="t">{{ item.payType }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.data" v-loading="tableData.loading" v-if="orderType == 1">
|
||||
|
||||
<el-table-column
|
||||
type="index"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="序号" prop="id"></el-table-column> -->
|
||||
<!-- <el-table-column label="区域id" prop="areaId"></el-table-column> -->
|
||||
<el-table-column label="区域名称" prop="areaName"></el-table-column>
|
||||
<!-- <el-table-column label="门店id" prop="shopId"></el-table-column> -->
|
||||
<!-- <el-table-column label="台桌Id" prop="tableId"></el-table-column> -->
|
||||
<el-table-column label="台桌号" prop="tableName"></el-table-column>
|
||||
<el-table-column label="订单数量" prop="orderCount">
|
||||
<template v-slot="scope">
|
||||
<div class="cursor-pointer" @click="toTableOrderList(scope.row)">
|
||||
{{ scope.row.orderCount }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="订单金额" prop="orderAmount"></el-table-column>
|
||||
|
||||
</el-table>
|
||||
<!-- <el-table :data="tableData.data" v-loading="tableData.loading" v-if="orderType == 2">
|
||||
<el-table-column label="商品名称" prop="productName"></el-table-column>
|
||||
<el-table-column label="商品分类" prop="cateName"></el-table-column>
|
||||
<el-table-column label="商品描述" prop="productSkuName"></el-table-column>
|
||||
<el-table-column label="销量" prop="salesNum"></el-table-column>
|
||||
<el-table-column label="退单量" prop="refNum"></el-table-column>
|
||||
<el-table-column label="销售金额" prop="salesAmount">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.salesAmount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退款金额" prop="refAmount">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.refAmount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table> -->
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" @size-change="sizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { summaryTable,summaryTableDownload } from '@/api/table'
|
||||
import dayjs from "dayjs";
|
||||
import { downloadFile } from "@/utils/index";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
timeValue: "",
|
||||
resetQuery: null,
|
||||
orderType: "1",
|
||||
categorys: [],
|
||||
query: {
|
||||
createdAt: [],
|
||||
proName: '',
|
||||
cateId: ''
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 10,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
downloadLoading: false,
|
||||
payCountList: "",
|
||||
payCountTotal: 0
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
timeFilter(time) {
|
||||
return dayjs(time).format("YYYY-MM-DD HH:mm:ss");
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.resetQuery = { ...this.query };
|
||||
this.getTableData();
|
||||
},
|
||||
methods: {
|
||||
//携带table id跳转到订单列表页面
|
||||
toTableOrderList(data){
|
||||
console.log(data)
|
||||
this.$router.push({
|
||||
path:'/order_manage/order_list',
|
||||
query:{
|
||||
tableName: data.tableName
|
||||
}
|
||||
})
|
||||
},
|
||||
// 导出Excel
|
||||
async downloadHandle() {
|
||||
try {
|
||||
this.downloadLoading = true;
|
||||
const file = await summaryTableDownload({
|
||||
startTime: this.query.createdAt[0],
|
||||
endTime: this.query.createdAt[1],
|
||||
});
|
||||
downloadFile(file, "数据", "xlsx");
|
||||
this.downloadLoading = false;
|
||||
} catch (error) {
|
||||
this.downloadLoading = false;
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.timeValue = "";
|
||||
this.query = { ...this.resetQuery };
|
||||
this.page = 0;
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页大小改变
|
||||
sizeChange(e) {
|
||||
this.tableData.size = e;
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1;
|
||||
this.getTableData();
|
||||
},
|
||||
async getTableData() {
|
||||
this.tableData.loading = true;
|
||||
try {
|
||||
const res = await summaryTable({
|
||||
page: this.tableData.page+1,
|
||||
size: this.tableData.size,
|
||||
startTime:this.query.createdAt[0],
|
||||
endTime:this.query.createdAt[1]
|
||||
});
|
||||
this.tableData.loading = false;
|
||||
this.tableData.data = res;
|
||||
this.tableData.total = res.length;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 切换时间
|
||||
timeChange(e) {
|
||||
const format = ["YYYY-MM-DD 00:00:00", "YYYY-MM-DD 23:59:59"];
|
||||
switch (e) {
|
||||
case "":
|
||||
// 全部
|
||||
this.query.createdAt = [];
|
||||
break;
|
||||
case "0":
|
||||
// 今天
|
||||
this.query.createdAt = [
|
||||
dayjs().format(format[0]),
|
||||
dayjs().format(format[1])
|
||||
];
|
||||
break;
|
||||
case "-1":
|
||||
// 昨天
|
||||
this.query.createdAt = [
|
||||
dayjs()
|
||||
.add(-1, "d")
|
||||
.format(format[0]),
|
||||
dayjs()
|
||||
.add(-1, "d")
|
||||
.format(format[1])
|
||||
];
|
||||
break;
|
||||
case "-7":
|
||||
// 最近7天
|
||||
this.query.createdAt = [
|
||||
dayjs()
|
||||
.add(-7, "d")
|
||||
.format(format[0]),
|
||||
dayjs().format(format[1])
|
||||
];
|
||||
break;
|
||||
case "-30":
|
||||
// 最近7天
|
||||
this.query.createdAt = [
|
||||
dayjs()
|
||||
.add(-30, "d")
|
||||
.format(format[0]),
|
||||
dayjs().format(format[1])
|
||||
];
|
||||
break;
|
||||
case "week":
|
||||
// 本周
|
||||
this.query.createdAt = [
|
||||
dayjs()
|
||||
.startOf("week")
|
||||
.format(format[0]),
|
||||
dayjs()
|
||||
.endOf("week")
|
||||
.format(format[1])
|
||||
];
|
||||
break;
|
||||
case "month":
|
||||
// 本周
|
||||
this.query.createdAt = [
|
||||
dayjs()
|
||||
.startOf("month")
|
||||
.format(format[0]),
|
||||
dayjs()
|
||||
.endOf("month")
|
||||
.format(format[1])
|
||||
];
|
||||
break;
|
||||
case "custom":
|
||||
// 自定义
|
||||
this.query.createdAt = [];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.cursor-pointer{
|
||||
cursor: pointer;
|
||||
color: #1890ff;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.cursor-pointer:hover{
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
.collect_wrap {
|
||||
display: flex;
|
||||
gap: 14px;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #f5f5f5;
|
||||
padding: 20px;
|
||||
|
||||
.icon_wrap {
|
||||
$size: 34px;
|
||||
$border: 6px;
|
||||
width: $size;
|
||||
height: $size;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: var(--bg-color);
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
width: $size + $border;
|
||||
height: $size + $border;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: var(--bg-color);
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.icon {
|
||||
font-size: 16px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-left: 10px;
|
||||
|
||||
.m {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.t {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
padding-top: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.refund {
|
||||
color: #ff9731;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.table_order_info {
|
||||
.order_no {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.type {
|
||||
color: #e6a23c;
|
||||
}
|
||||
}
|
||||
|
||||
.goods_info {
|
||||
.row {
|
||||
display: flex;
|
||||
|
||||
&:not(:first-child) {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.cover {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-left: 10px;
|
||||
|
||||
.sku {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,257 @@
|
|||
<!-- 新增耗材盘点 -->
|
||||
<template>
|
||||
<el-dialog
|
||||
title="耗材盘点"
|
||||
:visible.sync="dialogVisible"
|
||||
width="80%"
|
||||
@open="form.note = ''"
|
||||
>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-position="left"
|
||||
inline
|
||||
>
|
||||
<el-form-item label="账存数量">
|
||||
<el-input :value="detail.num" readonly style="width: 180px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="实际数量">
|
||||
<el-input-number
|
||||
v-model="form.lpNum"
|
||||
:min="0"
|
||||
:step="1"
|
||||
step-strictly
|
||||
style="width: 180px;"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="盈亏数量">
|
||||
<el-input
|
||||
:value="profitNumber"
|
||||
readonly
|
||||
:class="{ lose: profitNumber < 0 }"
|
||||
style="width: 180px;"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="单价">
|
||||
<el-input v-model="detail.price" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="盈亏金额">
|
||||
<el-input
|
||||
:value="profitPrice"
|
||||
readonly
|
||||
:class="{ lose: profitNumber < 0 }"
|
||||
style="width: 180px;"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="备注">
|
||||
<el-input v-model="form.note" placeholder="请输入备注" style="width: 300px;"></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="onSubmitHandle"
|
||||
>确 定</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="head-container">
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableData.list"
|
||||
v-loading="tableData.loading"
|
||||
border
|
||||
stripe
|
||||
>
|
||||
<!-- <el-table-column label="商品信息" width="150px">
|
||||
<template v-slot="scope">
|
||||
<div class="shop_info">
|
||||
<el-image :src="scope.row.coverImg" style="width: 30px;height: 30px;">
|
||||
<div class="img_error" slot="error">
|
||||
<i class="icon el-icon-document-delete"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
<span>{{ scope.row.name }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="售价" prop="price">
|
||||
<template v-slot="scope">
|
||||
¥{{ formatDecimal(scope.row.price) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="帐存库存" prop="stockNumber"></el-table-column>
|
||||
<el-table-column label="盈亏数量" prop="lpNum"></el-table-column>
|
||||
<el-table-column label="盈亏金额" prop="lpAmount">
|
||||
<template v-slot="scope">
|
||||
¥{{ formatDecimal(scope.row.lpAmount) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="实际库存"
|
||||
prop="acStockNumber"
|
||||
></el-table-column>
|
||||
<el-table-column label="盘点时间" prop="createTime"></el-table-column>
|
||||
<!-- <el-table-column label="盘点备注" prop="note"></el-table-column> -->
|
||||
</el-table>
|
||||
</div>
|
||||
<el-pagination
|
||||
:total="tableData.total"
|
||||
:current-page="tableData.page + 1"
|
||||
:page-sizes="[5, 10, 30, 50]"
|
||||
:page-size="tableData.size"
|
||||
@current-change="paginationChange"
|
||||
@size-change="sizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
></el-pagination>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatDecimal } from "@/utils";
|
||||
import { tbConCheck, tbConCheckGet } from "@/api/invoicing";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formatDecimal,
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
detail: "",
|
||||
form: {
|
||||
conInfoId: "",
|
||||
lpNum: 0
|
||||
},
|
||||
rules: {
|
||||
stocktakinNum: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入盘点数量",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
},
|
||||
resetForm: "",
|
||||
searhForm: {
|
||||
name: "",
|
||||
skuId: "",
|
||||
productId: ""
|
||||
},
|
||||
tableData: {
|
||||
page: 0,
|
||||
size: 5,
|
||||
total: 0,
|
||||
loading: false,
|
||||
list: []
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.resetForm = { ...this.form };
|
||||
},
|
||||
computed: {
|
||||
profitNumber() {
|
||||
return formatDecimal(this.form.lpNum - this.detail.num, 2, true);
|
||||
},
|
||||
profitPrice() {
|
||||
return formatDecimal(
|
||||
(this.form.lpNum - this.detail.num) * this.detail.price
|
||||
);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmitHandle() {
|
||||
this.$refs.form.validate(async valid => {
|
||||
if (valid) {
|
||||
try {
|
||||
this.loading = true;
|
||||
let res = await tbConCheck({
|
||||
conInfoId: this.form.conInfoId,
|
||||
lpNum: this.profitNumber
|
||||
});
|
||||
this.detail.num = this.form.lpNum;
|
||||
this.form.lpNum = 0;
|
||||
this.form.lpNum = this.detail.num;
|
||||
|
||||
this.$emit("success", res);
|
||||
this.loading = false;
|
||||
this.$message({
|
||||
title: "注意",
|
||||
message: `添加成功`,
|
||||
type: "success"
|
||||
});
|
||||
this.getTableData();
|
||||
} catch (error) {
|
||||
this.loading = false;
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
show(obj) {
|
||||
// console.log(obj);
|
||||
this.detail = { ...obj };
|
||||
this.detail.num = formatDecimal(
|
||||
obj.stockNumber - obj.stockConsume,
|
||||
2,
|
||||
false
|
||||
);
|
||||
this.dialogVisible = true;
|
||||
this.form.conInfoId = obj.id;
|
||||
this.form.lpNum = this.detail.num;
|
||||
|
||||
this.searhForm.skuId = obj.productId;
|
||||
this.searhForm.productId = obj.proId;
|
||||
|
||||
this.tableData.page = 0;
|
||||
this.tableData.total = 0;
|
||||
this.tableData.list = [];
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页大小改变
|
||||
sizeChange(e) {
|
||||
this.tableData.size = e;
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1;
|
||||
this.getTableData();
|
||||
},
|
||||
// 商品列表
|
||||
async getTableData() {
|
||||
try {
|
||||
this.tableData.loading = true;
|
||||
const res = await tbConCheckGet({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
conInfoId: this.form.conInfoId,
|
||||
sort: "id,desc"
|
||||
});
|
||||
this.tableData.list = res.content;
|
||||
this.tableData.total = res.totalElements;
|
||||
setTimeout(() => {
|
||||
this.tableData.loading = false;
|
||||
}, 500);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.lose {
|
||||
&::v-deep .el-input__inner {
|
||||
color: rgb(238, 29, 29);
|
||||
}
|
||||
}
|
||||
|
||||
.shop_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
span {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,205 @@
|
|||
<!-- 新增库存盘点 -->
|
||||
<template>
|
||||
<el-dialog title="库存盘点" :visible.sync="dialogVisible" width="80%" @open="form.note = ''">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" inline>
|
||||
<el-form-item label="账存数量">
|
||||
<el-input v-model="detail.stockNumber" readonly style="width: 180px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="实际数量">
|
||||
<el-input-number v-model="form.stocktakinNum" :min="0" :step="1" step-strictly
|
||||
style="width: 180px;"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="盈亏数量">
|
||||
<el-input v-model="profitNumber" readonly :class="{ lose: profitNumber < 0 }"
|
||||
style="width: 180px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="单价">
|
||||
<el-input v-model="detail.salePrice" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="盈亏金额">
|
||||
<el-input v-model="profitPrice" readonly :class="{ lose: profitNumber < 0 }"
|
||||
style="width: 180px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.note" placeholder="请输入备注" style="width: 300px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="onSubmitHandle">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="head-container">
|
||||
<el-table ref="table" :data="tableData.list" v-loading="tableData.loading" border stripe>
|
||||
<el-table-column label="商品信息" width="150px">
|
||||
<template v-slot="scope">
|
||||
<div class="shop_info">
|
||||
<el-image :src="scope.row.coverImg" style="width: 30px;height: 30px;">
|
||||
<div class="img_error" slot="error">
|
||||
<i class="icon el-icon-document-delete"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
<span>{{ scope.row.name }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="售价" prop="price">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.price }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="帐存库存" prop="stock"></el-table-column>
|
||||
<el-table-column label="盈亏数量" prop="phaseNum"></el-table-column>
|
||||
<el-table-column label="盈亏金额" prop="phasePrice">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.phasePrice }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实际库存" prop="inventoryStock"></el-table-column>
|
||||
<el-table-column label="盘点时间" prop="createTime"></el-table-column>
|
||||
<el-table-column label="盘点备注" prop="note"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-sizes="[5, 10, 30, 50]"
|
||||
:page-size="tableData.size" @current-change="paginationChange" @size-change="sizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatDecimal } from '@/utils'
|
||||
import { tbProductStocktakin, tbProductStocktakinGet } from '@/api/invoicing'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
detail: '',
|
||||
form: {
|
||||
skuId: '', // sku商品必传
|
||||
productId: '', // 必传
|
||||
stocktakinNum: '', // 必传
|
||||
price: '', // 商品价格 非必传 为空盘点价格为商品价格
|
||||
note: "" // 盘点备注 非必传
|
||||
},
|
||||
rules: {
|
||||
stocktakinNum: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入盘点数量',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
},
|
||||
resetForm: '',
|
||||
searhForm: {
|
||||
name: '',
|
||||
skuId: '',
|
||||
productId: ''
|
||||
},
|
||||
tableData: {
|
||||
page: 0,
|
||||
size: 5,
|
||||
total: 0,
|
||||
loading: false,
|
||||
list: []
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.resetForm = { ...this.form }
|
||||
},
|
||||
computed: {
|
||||
profitNumber() {
|
||||
return this.form.stocktakinNum - this.detail.stockNumber
|
||||
},
|
||||
profitPrice() {
|
||||
return formatDecimal((this.form.stocktakinNum - this.detail.stockNumber) * this.detail.salePrice)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmitHandle() {
|
||||
this.$refs.form.validate(async valid => {
|
||||
if (valid) {
|
||||
try {
|
||||
this.loading = true
|
||||
let res = await tbProductStocktakin(this.form)
|
||||
this.detail.stockNumber = this.form.stocktakinNum
|
||||
this.$emit('success', res)
|
||||
// this.dialogVisible = false
|
||||
this.loading = false
|
||||
this.$notify({
|
||||
title: '注意',
|
||||
message: `添加成功`,
|
||||
type: 'success'
|
||||
});
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
this.loading = false
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
show(obj) {
|
||||
console.log(obj);
|
||||
this.detail = { ...obj }
|
||||
this.dialogVisible = true
|
||||
this.form.skuId = obj.skuId
|
||||
this.form.productId = obj.proId
|
||||
this.form.stocktakinNum = obj.stockNumber
|
||||
|
||||
this.searhForm.skuId = obj.productId
|
||||
this.searhForm.productId = obj.proId
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页大小改变
|
||||
sizeChange(e) {
|
||||
this.tableData.size = e
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 商品列表
|
||||
async getTableData() {
|
||||
try {
|
||||
this.tableData.loading = true
|
||||
const res = await tbProductStocktakinGet({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
name: this.searhForm.name,
|
||||
skuId: this.searhForm.category,
|
||||
productId: this.searhForm.productId,
|
||||
sort: 'id,desc',
|
||||
})
|
||||
this.tableData.list = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
setTimeout(() => {
|
||||
this.tableData.loading = false
|
||||
}, 500);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.lose {
|
||||
&::v-deep .el-input__inner {
|
||||
color: rgb(238, 29, 29);
|
||||
}
|
||||
}
|
||||
|
||||
.shop_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
span {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -10,9 +10,9 @@
|
|||
<el-form-item label="地址">
|
||||
<el-input type="textarea" v-model="form.address" placeholder="请输入地址"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签">
|
||||
<!-- <el-form-item label="标签">
|
||||
<el-input v-model="form.tip" placeholder="请输入标签"></el-input>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注">
|
||||
<el-input type="textarea" v-model="form.remark" placeholder="请输入备注"></el-input>
|
||||
</el-form-item>
|
||||
|
|
@ -35,7 +35,7 @@ export default {
|
|||
purveyorName: '',
|
||||
purveyorTelephone: '',
|
||||
address: '',
|
||||
tip: '',
|
||||
// tip: '',
|
||||
remark: '',
|
||||
},
|
||||
rules: {
|
||||
|
|
@ -85,7 +85,7 @@ export default {
|
|||
this.form.purveyorName = ''
|
||||
this.form.purveyorTelephone = ''
|
||||
this.form.address = ''
|
||||
this.form.tip = ''
|
||||
// this.form.tip = ''
|
||||
this.form.remark = ''
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,170 @@
|
|||
<!-- 耗材列表 -->
|
||||
<template>
|
||||
<el-dialog title="选择耗材" :visible.sync="dialogVisible" @open="resetHandle()">
|
||||
<el-form :model="searchForm" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.conTypeName" placeholder="耗材类型名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.conCode" placeholder="耗材代码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.conName" placeholder="耗材名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="head-container">
|
||||
<el-table ref="table" :data="tableData.list" v-loading="tableData.loading" @select="firstSelectChange">
|
||||
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
||||
<el-table-column label="耗材名称" prop="conName"></el-table-column>
|
||||
<el-table-column label="价格" prop="price"></el-table-column>
|
||||
<el-table-column label="耗材代码" prop="conCode"></el-table-column>
|
||||
<el-table-column label="耗材类型名称" prop="conTypeName"></el-table-column>
|
||||
<el-table-column label="单位" prop="conUnit"></el-table-column>
|
||||
<el-table-column label="最近入库量" prop="lasterInStock"></el-table-column>
|
||||
<el-table-column label="库存数量" prop="stockNumber">
|
||||
<template v-slot="scope">
|
||||
{{ formatDecimal(scope.row.stockNumber - scope.row.stockConsume, 2, true) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="操作" fixed="right">
|
||||
<template v-slot="scope">
|
||||
<el-button type="primary" size="mini" @click="confirmHandle(scope.row)">选择</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" @size-change="sizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="confirmHandle">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatDecimal } from '@/utils'
|
||||
import { tbConsInfoGet } from "@/api/invoicing";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formatDecimal,
|
||||
dialogVisible: false,
|
||||
searchForm: {
|
||||
conTypeId: '',
|
||||
conTypeName: '',
|
||||
conCode: '',
|
||||
conName: ''
|
||||
},
|
||||
resetSearchForm: '',
|
||||
tableData: {
|
||||
page: 0,
|
||||
size: 10,
|
||||
total: 0,
|
||||
loading: false,
|
||||
list: []
|
||||
},
|
||||
goods: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.resetSearchForm = { ...this.searchForm }
|
||||
},
|
||||
methods: {
|
||||
firstSelectChange() {
|
||||
// console.log(selection)
|
||||
let selection = this.$refs.table.selection
|
||||
if (selection.length > 1 && this.isselect) {
|
||||
const del_row = selection.shift();
|
||||
this.$refs.table.toggleRowSelection(del_row, false);
|
||||
}
|
||||
},
|
||||
// 确定选商品
|
||||
confirmHandle() {
|
||||
let res = this.$refs.table.selection
|
||||
this.$emit('success', res)
|
||||
this.close()
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.searchForm = { ...this.resetSearchForm }
|
||||
this.tableData.page = 0
|
||||
this.tableData.size = 10
|
||||
this.tableData.list = []
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页大小改变
|
||||
sizeChange(e) {
|
||||
this.tableData.size = e
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 耗材列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await tbConsInfoGet({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
...this.searchForm
|
||||
})
|
||||
this.tableData.list = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
|
||||
if (this.goods.length) {
|
||||
this.$nextTick(() => {
|
||||
this.selection()
|
||||
})
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.tableData.loading = false
|
||||
}, 500);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
show(goods) {
|
||||
this.dialogVisible = true
|
||||
if (goods && goods.length) {
|
||||
this.goods = goods
|
||||
} else {
|
||||
this.goods = []
|
||||
}
|
||||
this.resetHandle()
|
||||
this.getTableData()
|
||||
},
|
||||
close() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
selection() {
|
||||
this.goods.forEach(row => {
|
||||
this.tableData.list.forEach((item, index) => {
|
||||
if (row.id == item.id) {
|
||||
this.$refs.table.toggleRowSelection(this.tableData.list[index]);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.shop_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
span {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -3,10 +3,13 @@
|
|||
<el-dialog title="详情记录" width="80%" :visible.sync="dialogVisible" @close="dialogVisible = false">
|
||||
<div class="head-container">
|
||||
<el-select v-model="query.type" placeholder="选择类型">
|
||||
<el-option :label="item.label" :value="item.value" v-for="item in typeList" :key="item.id"></el-option>
|
||||
<el-option label="供应商入库" value="purveyor"></el-option>
|
||||
<el-option label="供应商退货" value="reject"></el-option>
|
||||
<el-option label="其他入库" value="purchase"></el-option>
|
||||
<el-option label="其他出库" value="other-out"></el-option>
|
||||
</el-select>
|
||||
<el-date-picker v-model="query.createdAt" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss">
|
||||
end-placeholder="结束日期" value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
|
|
@ -21,21 +24,23 @@
|
|||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.list" v-loading="tableData.loading">
|
||||
<el-table-column label="变动数量" prop="stockNumber">
|
||||
<template v-slot="scope">
|
||||
<span class="num" :class="{ active: scope.row.stockNumber > 0 }">{{ scope.row.stockNumber }} {{
|
||||
scope.row.unitName
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="info">{{ scope.row.tagName }}</el-tag>
|
||||
<el-tag type="info">{{ scope.row.type }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="原有库存" prop="leftNumber">
|
||||
</el-table-column>
|
||||
<el-table-column label="变动数量" prop="stockNumber">
|
||||
<template v-slot="scope">
|
||||
<span class="num" :class="{ active: scope.row.stockNumber > 0 }">
|
||||
{{ scope.row.stockNumber }} {{ scope.row.unitName }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="剩余库存">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.leftNumber - scope.row.stockNumber }} {{ scope.row.unitName }}
|
||||
{{ scope.row.leftNumber + scope.row.stockNumber }} {{ scope.row.unitName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作时间" prop="updatedAt">
|
||||
|
|
@ -52,7 +57,7 @@
|
|||
|
||||
<script>
|
||||
import dayjs from 'dayjs'
|
||||
import { dictDetail, tbProductStockDetail, tbProductStockDetailSum } from '@/api/invoicing'
|
||||
import { tbProductStockDetail, tbProductStockDetailSum } from '@/api/invoicing'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -78,21 +83,24 @@ export default {
|
|||
methods: {
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
let arr = []
|
||||
if (this.query.createdAt.length) {
|
||||
arr = [this.query.createdAt[0] + ' 00:00:00', this.query.createdAt[1] + ' 23:59:59']
|
||||
} else {
|
||||
arr = []
|
||||
}
|
||||
try {
|
||||
const res = await tbProductStockDetail({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
sort: this.tableData.sort,
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
productId: this.goods.id,
|
||||
productId: this.goods.proId,
|
||||
type: this.query.type,
|
||||
createdAt: this.query.createdAt
|
||||
createdAt: arr
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.list = res.content.map(item => {
|
||||
item.tagName = this.typeList.find(val => val.value == item.type).label
|
||||
return item
|
||||
})
|
||||
this.tableData.list = res.content
|
||||
console.log(this.tableData.list)
|
||||
this.tableData.total = res.totalElements
|
||||
} catch (error) {
|
||||
|
|
@ -109,37 +117,26 @@ export default {
|
|||
this.query.blurry = ''
|
||||
this.tableData.page = 0
|
||||
this.tableData.list = []
|
||||
this.query.type = ''
|
||||
this.query.createdAt = []
|
||||
this.getTableData()
|
||||
},
|
||||
async show(obj) {
|
||||
this.dialogVisible = true
|
||||
this.goods = obj
|
||||
this.tbProductStockDetailSum()
|
||||
await this.dictDetail()
|
||||
await this.getTableData()
|
||||
},
|
||||
async tbProductStockDetailSum() {
|
||||
try {
|
||||
const { exchange } = await tbProductStockDetailSum({
|
||||
productId: this.goods.id
|
||||
productId: this.goods.proId
|
||||
})
|
||||
this.exchange = exchange
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
async dictDetail() {
|
||||
try {
|
||||
const res = await dictDetail({
|
||||
dictName: 'product_stock_type',
|
||||
page: 0,
|
||||
size: 100
|
||||
})
|
||||
this.typeList = res.content
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,24 @@
|
|||
<template>
|
||||
<el-dialog title="详情" width="80%" :visible.sync="dialogVisible" @close="dialogVisible = false">
|
||||
<div class="head-container">
|
||||
<span>【{{ tableData.detail.type == 'reject' ? '退货出库' : '供应商入库' }}】</span>
|
||||
<span>【{{ row.type }}】</span>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.detail.stockSnap" v-loading="tableData.loading" height="400px">
|
||||
<el-table-column :label="`商品名称${tableData.detail.stockSnap.length}`" prop="name"></el-table-column>
|
||||
<el-table-column :label="`商品名称`" prop="name"></el-table-column>
|
||||
<el-table-column label="规格" prop="specSnap"></el-table-column>
|
||||
<el-table-column label="原库存" prop="stockNumber"></el-table-column>
|
||||
<el-table-column label="变动数量" prop="number">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.number }}{{ scope.row.unitName }}
|
||||
<span v-if="tableData.detail.subType == -1">-</span> {{ scope.row.number }} {{
|
||||
scope.row.unitName
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="现有库存" prop="number">
|
||||
<template v-slot="scope">
|
||||
{{ returnNowHasNumbr(scope.row) }}
|
||||
<!-- {{ scope.row.stockNumber*1 + scope.row.number*1 }} {{ scope.row.unitName }} -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -16,7 +26,7 @@
|
|||
<div class="head-container">
|
||||
<div class="row">备注:{{ tableData.detail.remark }}</div>
|
||||
<div class="row">操作人:{{ tableData.detail.operatorSnap.name }}</div>
|
||||
<div class="row">创建时间:{{ tableData.detail.createdAt }}</div>
|
||||
<div class="row">创建时间:{{ dayjs(tableData.detail.createdAt).format('YYYY-MM-DD HH:mm:ss') }}</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
|
@ -28,6 +38,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
dayjs,
|
||||
row: '',
|
||||
dialogVisible: false,
|
||||
tableData: {
|
||||
loading: false,
|
||||
|
|
@ -41,9 +52,14 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
show(id) {
|
||||
//返回现有库存数量
|
||||
returnNowHasNumbr(row) {
|
||||
return row.stockNumber * 1 + row.number * 1 + row.unitName
|
||||
},
|
||||
show(row) {
|
||||
this.dialogVisible = true
|
||||
this.getTableData(id)
|
||||
this.row = row
|
||||
this.getTableData(row.id)
|
||||
},
|
||||
async getTableData(id) {
|
||||
this.tableData.loading = true
|
||||
|
|
|
|||
|
|
@ -0,0 +1,208 @@
|
|||
<template>
|
||||
<el-dialog title="选择商品" :visible.sync="dialogVisible" @open="resetHandle()">
|
||||
<el-form :model="searhForm" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="searhForm.name" placeholder="商品名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searhForm.category" placeholder="商品分类">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in categoryList"
|
||||
:key="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="head-container">
|
||||
<el-table ref="table" :data="tableData.list" @select="firstSelectChange" v-loading="tableData.loading">
|
||||
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
||||
<el-table-column label="商品信息">
|
||||
<template v-slot="scope">
|
||||
<div class="shop_info">
|
||||
<el-image :src="scope.row.coverImg" style="width: 30px;height: 30px;">
|
||||
<div class="img_error" slot="error">
|
||||
<i class="icon el-icon-document-delete"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
<span>{{ scope.row.name }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.typeEnum }}
|
||||
</template>
|
||||
</el-table-column> <el-table-column label="是否售罄">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.isPauseSale == 1 ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column> <el-table-column label="是否分销">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.isDistribute == 1 ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="售价">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.lowPrice }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="销量/库存">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.realSalesNumber }}/{{ scope.row.stockNumber }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分类名称" prop="categoryName"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" @size-change="sizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="confirmHandle">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { tbShopCategoryGet, tbProductlist } from "@/api/invoicing";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
searhForm: {
|
||||
name: '',
|
||||
category: ''
|
||||
},
|
||||
categoryList: [],
|
||||
tableData: {
|
||||
page: 0,
|
||||
size: 10,
|
||||
total: 0,
|
||||
loading: false,
|
||||
list: []
|
||||
},
|
||||
goods: [],
|
||||
// 是否单选
|
||||
isselect: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
firstSelectChange() {
|
||||
// console.log(selection)
|
||||
let selection = this.$refs.table.selection
|
||||
if (selection.length > 1 && this.isselect) {
|
||||
const del_row = selection.shift();
|
||||
this.$refs.table.toggleRowSelection(del_row, false);
|
||||
}
|
||||
},
|
||||
// 确定选商品
|
||||
confirmHandle() {
|
||||
let res = this.$refs.table.selection
|
||||
this.$emit('success', res)
|
||||
this.close()
|
||||
},
|
||||
// 是否单选
|
||||
isselectEvent() {
|
||||
this.isselect = true
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.searhForm.name = ''
|
||||
this.searhForm.category = ''
|
||||
this.tableData.page = 0
|
||||
this.tableData.size = 10
|
||||
this.tableData.list = []
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页大小改变
|
||||
sizeChange(e) {
|
||||
this.tableData.size = e
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 商品列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await tbProductlist({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
name: this.searhForm.name,
|
||||
categoryId: this.searhForm.category,
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
sort: 'id',
|
||||
})
|
||||
this.tableData.list = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
|
||||
if (this.goods.length) {
|
||||
this.$nextTick(() => {
|
||||
this.selection()
|
||||
})
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.tableData.loading = false
|
||||
}, 500);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
// 商品分类
|
||||
async tbShopCategoryGet() {
|
||||
try {
|
||||
const res = await tbShopCategoryGet({
|
||||
page: 0,
|
||||
size: 100,
|
||||
sort: 'id',
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.categoryList = res.content
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
show(goods) {
|
||||
this.dialogVisible = true
|
||||
if (goods && goods.length) {
|
||||
this.goods = goods
|
||||
} else {
|
||||
this.goods = []
|
||||
}
|
||||
this.resetHandle()
|
||||
this.tbShopCategoryGet()
|
||||
this.getTableData()
|
||||
},
|
||||
close() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
selection() {
|
||||
this.goods.forEach(row => {
|
||||
this.tableData.list.forEach((item, index) => {
|
||||
if (row.id == item.id) {
|
||||
this.$refs.table.toggleRowSelection(this.tableData.list[index]);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.shop_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
span {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-form :model="query" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="query.conName" placeholder="耗材信息名称" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="clickseetableData.data"
|
||||
v-loading="clickseetableData.loading"
|
||||
row-key="id"
|
||||
height="66vh"
|
||||
>
|
||||
<el-table-column label="耗材名称" prop="conName" />
|
||||
<el-table-column label="变动库存" prop="amount">
|
||||
<template v-slot="scope">
|
||||
<span :class="{ red: scope.row.bizType == '-' }"
|
||||
>{{ scope.row.bizType }}{{ scope.row.amount }}</span
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="现有库存" prop="balance" />
|
||||
<!-- <el-table-column label="业务编码" prop="bizCode" /> -->
|
||||
<el-table-column label="业务说明" prop="bizName" />
|
||||
<el-table-column label="商品名称" prop="productName" />
|
||||
<!-- <el-table-column label="正负号标识" prop="bizType" /> -->
|
||||
<!-- <el-table-column label="耗材id" prop="consId" /> -->
|
||||
<el-table-column label="创建时间" prop="createTime"></el-table-column>
|
||||
<!-- <el-table-column label="更新时间" prop="updateTime">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination
|
||||
:total="clickseetableData.total"
|
||||
:current-page="clickseetableData.page + 1"
|
||||
:page-size="clickseetableData.size"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="paginationChangetype"
|
||||
@size-change="
|
||||
e => {
|
||||
clickseetableData.size = e;
|
||||
clickseetableData.page = 0;
|
||||
getTableData();
|
||||
}
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { gettbConsInfoFlow } from "@/api/consumable";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
query: {
|
||||
conName: ""
|
||||
},
|
||||
clickseetableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 30,
|
||||
loading: false,
|
||||
total: 0
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData();
|
||||
},
|
||||
methods: {
|
||||
resetHandle() {
|
||||
this.clickseetableData.page = 0;
|
||||
this.clickseetableData.size = 30;
|
||||
this.query.conName = "";
|
||||
this.getTableData();
|
||||
},
|
||||
pageSizeChange(e) {
|
||||
this.clickseetableData.size = e;
|
||||
this.getTableData();
|
||||
},
|
||||
paginationChangetype(e) {
|
||||
this.clickseetableData.page = e - 1;
|
||||
this.getTableData();
|
||||
},
|
||||
// 查看查询耗材流水信息
|
||||
async getTableData() {
|
||||
try {
|
||||
this.clickseetableData.loading = true;
|
||||
const res = await gettbConsInfoFlow({
|
||||
page: this.clickseetableData.page,
|
||||
size: this.clickseetableData.size,
|
||||
consId: "",
|
||||
conName: this.query.conName,
|
||||
shopId: localStorage.getItem("shopId")
|
||||
});
|
||||
this.clickseetableData.loading = false;
|
||||
this.clickseetableData.data = res.content;
|
||||
this.clickseetableData.total = res.totalElements;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,631 @@
|
|||
<!-- eslint-disable no-empty -->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<div class="row_wrap">
|
||||
<div class="row">
|
||||
<el-input v-model="query.conTypeId" size="small" clearable placeholder="请输入类型id" style="width: 150px;"
|
||||
@keyup.enter.native="getTableData" />
|
||||
<el-input v-model="query.conTypeName" size="small" clearable placeholder="请输入类型名称" style="width: 150px;"
|
||||
@keyup.enter.native="getTableData" />
|
||||
<el-input v-model="query.conCode" size="small" clearable placeholder="请输入耗材代码" style="width: 150px;"
|
||||
@keyup.enter.native="getTableData" />
|
||||
<el-input v-model="query.conName" size="small" clearable placeholder="请输入耗材名称" style="width: 150px;"
|
||||
@keyup.enter.native="getTableData" />
|
||||
<div style="width: 150px;">
|
||||
<el-select v-model="query.status" placeholder="请选择商品规格" style="width: 100%;">
|
||||
<el-option :label="item.label" :value="item.value" v-for="item in typeEnums" :key="item.label" />
|
||||
</el-select>
|
||||
</div>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-button icon="el-icon-download" :loading="downloadLoading" @click="protHandle">导出耗材</el-button>
|
||||
<el-button icon="el-icon-upload2" :loading="uploadLoading" @click="dialogVisible = true">导入耗材</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="clickdialogframe('add')">添加</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="head-container" id="table_drag">
|
||||
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id">
|
||||
<el-table-column prop="id" label="ID" width="50px" />
|
||||
<el-table-column label="耗材名称" prop="conName" />
|
||||
<el-table-column label="耗材代码" prop="conCode" />
|
||||
<!-- <el-table-column label="类型id" prop="conTypeId" /> -->
|
||||
<el-table-column label="分类名称" prop="conTypeName" />
|
||||
<el-table-column label="单位" prop="conUnit" />
|
||||
<el-table-column label="创建时间" prop="createTime" width="200">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.createTime).format("YYYY-MM-DD HH:mm:ss") }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="最近入库量" prop="lasterInStock" /> -->
|
||||
<el-table-column label="库存数量" prop="stockNumber">
|
||||
<template v-slot="scope">
|
||||
{{ (scope.row.stockNumber - scope.row.stockConsume).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="预警值" prop="conWarning" />
|
||||
<!-- <el-table-column label="单位耗材值" prop="surplusStock" /> -->
|
||||
<!-- <el-table-column label="排序" prop="sort" sortable /> -->
|
||||
<el-table-column label="更新时间" prop="updateTime" width="200">
|
||||
<!-- <template v-slot="scope">
|
||||
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" fixed="right">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" @click="editorHandle(scope.row)">编辑</el-button>
|
||||
<el-button type="text" @click="clicksee(scope.row)" style="margin-left: 10px !important;">耗材记录</el-button>
|
||||
<el-button type="text" size="mini" style="margin-left: 10px !important;"
|
||||
@click="$refs.AddConsTakin.show(scope.row)">耗材盘点</el-button>
|
||||
<!-- <el-button type="text" icon="el-icon-rank">排序</el-button> -->
|
||||
<!-- <el-button type="text" @click="clickdialogfadd(scope.row)"
|
||||
style="margin-left: 10px !important;">入库</el-button> -->
|
||||
<!-- <el-button type="text" icon="el-icon-edit" @click="clickdialogframe('edit', scope.row)">编辑</el-button> -->
|
||||
<!-- <el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
|
||||
slot="reference">删除</el-button>
|
||||
</el-popconfirm> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange" @size-change="e => {
|
||||
tableData.size = e;
|
||||
tableData.page = 0;
|
||||
getTableData();
|
||||
}
|
||||
" />
|
||||
</div>
|
||||
<!-- 耗材入库 -->
|
||||
<el-dialog title="耗材入库" :visible.sync="libraryshow">
|
||||
<el-form :inline="true" ref="reflibrary" :model="libraryshowdata" :rules="ruleslibrary" class="demo-form-inline">
|
||||
<el-form-item label="耗材入库数量" prop="stockNumber">
|
||||
<el-input v-model.number="libraryshowdata.stockNumber" type="number" placeholder="请输入单位"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item style="display: flex;justify-content: flex-end;">
|
||||
<el-button @click="libraryshow = false">取 消</el-button>
|
||||
<el-button type="primary" @click="clickdialoglibraryshow('reflibrary')">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
<!-- 修改和增加 -->
|
||||
<el-dialog :title="dialogtitle" :visible.sync="dialogshow" width="70%">
|
||||
<el-form :inline="true" ref="refruleForm" :model="ruleForm" :rules="rules" class="demo-form-inline">
|
||||
<el-form-item label="单位" prop="conUnit" v-if="dialogtitle == '添加'">
|
||||
<el-input v-model="ruleForm.conUnit" placeholder="请输入单位"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材类型" prop="conTypeId" v-if="dialogtitle == '添加'">
|
||||
<el-select v-model="ruleForm.conTypeId" placeholder="请选择">
|
||||
<el-option v-for="item in consTypeList" :key="item.conTypeId" :label="item.conTypeName" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item
|
||||
label="耗材类型"
|
||||
prop="conNames"
|
||||
v-if="dialogtitle == '添加'"
|
||||
>
|
||||
<el-input
|
||||
v-model="ruleForm.conNames"
|
||||
placeholder="请输耗材信息名称"
|
||||
disabled
|
||||
></el-input>
|
||||
</el-form-item>-->
|
||||
<!-- <el-form-item v-if="dialogtitle == '添加'">
|
||||
<el-button type="primary" @click="typedialogshow = true"
|
||||
>去选择</el-button
|
||||
>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="耗材信息名称" prop="conName">
|
||||
<el-input v-model="ruleForm.conName" placeholder="请输入耗材信息名称"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="耗材信息代码" prop="conCode">
|
||||
<el-input
|
||||
v-model="ruleForm.conCode"
|
||||
placeholder="请输入耗材信息代码"
|
||||
></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="耗材价格">
|
||||
<el-input v-model="ruleForm.price" placeholder="请输入耗材价格"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="预警值">
|
||||
<el-input v-model="ruleForm.conWarning" placeholder="请输入耗材预警值"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" v-if="dialogtitle == '编辑'">
|
||||
<el-switch v-model="ruleForm.status" active-value="1" inactive-value="0"></el-switch>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="单位耗材值" prop="surplusStock">
|
||||
<el-input v-model="ruleForm.surplusStock" placeholder="请输入单位耗材值"></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item style="display: flex;justify-content: flex-end;">
|
||||
<el-button @click="dialogshow = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm('refruleForm')">
|
||||
确 定
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
<el-dialog title="选择类型" :visible.sync="typedialogshow">
|
||||
<div class="head-container">
|
||||
<el-input v-model="querytypedialogshowquery.conTypeName" size="small" clearable placeholder="请输入耗材类型名称"
|
||||
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableDatatype" />
|
||||
<el-input v-model="querytypedialogshowquery.conTypeCode" size="small" clearable placeholder="请输入耗材类型代码"
|
||||
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableDatatype" />
|
||||
<el-select v-model="querytypedialogshowquery.status" placeholder="请选择商品规格" style="width: 100%;">
|
||||
<el-option :label="item.label" :value="item.value" v-for="item in typeEnums" :key="item.label" />
|
||||
</el-select>
|
||||
<div style="margin-top: 10px;">
|
||||
<el-button type="primary" @click="getTableDatatype">查询</el-button>
|
||||
<el-button @click="resetHandletype">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table ref="table" :data="tableDatatype.data" v-loading="tableDatatype.loading" row-key="id">
|
||||
<el-table-column label="耗材类型名称" prop="conTypeName" />
|
||||
<el-table-column label="耗材类型代码" prop="conTypeCode" />
|
||||
<el-table-column label="店铺ID" prop="shopId" />
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="primary" v-if="scope.row.status == '1'">正常</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.status == '0'">禁用</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-button @click="tableDatatypetable(scope.row)">确定</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableDatatype.total" :current-page="tableDatatype.page + 1"
|
||||
:page-size="tableDatatype.size" layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="paginationChangetype" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog title="耗材信息" :visible.sync="clickseetypedialogshow">
|
||||
<div class="head-container">
|
||||
<el-table ref="table" :data="clickseetableData.data" v-loading="clickseetableData.loading" row-key="id"
|
||||
height="450">
|
||||
<el-table-column label="耗材名称" prop="conName" />
|
||||
<el-table-column label="变动库存" prop="amount">
|
||||
<template v-slot="scope">
|
||||
<span :class="{ red: scope.row.bizType == '-' }">{{ scope.row.bizType }}{{ scope.row.amount }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="现有库存" prop="balance" />
|
||||
<!-- <el-table-column label="业务编码" prop="bizCode" /> -->
|
||||
<el-table-column label="业务说明" prop="bizName" />
|
||||
<!-- <el-table-column label="正负号标识" prop="bizType" /> -->
|
||||
<!-- <el-table-column label="耗材id" prop="consId" /> -->
|
||||
<el-table-column label="商品信息" prop="productName"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime"></el-table-column>
|
||||
<!-- <el-table-column label="更新时间" prop="updateTime">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="clickseetableData.total" :current-page="clickseetableData.page + 1"
|
||||
:page-size="clickseetableData.size" layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="paginationChangetype"
|
||||
@size-change="e => { clickseetableData.size = e; clickseetableData.page = 0; getConsRecord() }" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 耗材盘点 -->
|
||||
<AddConsTakin ref="AddConsTakin" @success="resetHandle" />
|
||||
<!-- 导入耗材 -->
|
||||
<el-dialog title="导入库存" :visible.sync="dialogVisible">
|
||||
<UploadExcel :beforeUpload="excelSuccessUpload" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sortable from "sortablejs";
|
||||
import dayjs from "dayjs";
|
||||
import settings from "@/settings";
|
||||
import { upProSort } from "@/api/shop";
|
||||
import {
|
||||
gettbConsType,
|
||||
gettbConsInfo,
|
||||
posttbConsInfo,
|
||||
gettbConsInfoFlow,
|
||||
posttbConsInfostockIn,
|
||||
postapitbConsInfo
|
||||
} from "@/api/consumable";
|
||||
import AddConsTakin from "../components/addConsTakin";
|
||||
import { tbConsInfodownload, tbConsInfoinputStock } from '@/api/invoicing'
|
||||
import { downloadFile } from "@/utils";
|
||||
import UploadExcel from '@/components/UploadExcel'
|
||||
export default {
|
||||
components: { AddConsTakin, UploadExcel },
|
||||
data() {
|
||||
return {
|
||||
dayjs,
|
||||
consTypeList: [],
|
||||
query: {
|
||||
conTypeId: "",
|
||||
conTypeName: "",
|
||||
conCode: "",
|
||||
conName: "",
|
||||
status: ''
|
||||
},
|
||||
resetQuery: '',
|
||||
libraryshow: false, //耗材入库显示
|
||||
libraryshowdata: {
|
||||
id: "",
|
||||
stockNumber: ""
|
||||
},
|
||||
ruleslibrary: {
|
||||
stockNumber: [
|
||||
{ required: true, message: "请输入入库数量", trigger: "blur" }
|
||||
]
|
||||
},
|
||||
categorys: [],
|
||||
typeEnums: [
|
||||
{
|
||||
label: "正常",
|
||||
value: "1"
|
||||
},
|
||||
{
|
||||
label: "禁用",
|
||||
value: "0"
|
||||
}
|
||||
],
|
||||
dialogshow: false, //弹框显示
|
||||
dialogtitle: "", //文字显示
|
||||
typedialogshow: false,
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 30,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
querytypedialogshowquery: {
|
||||
conTypeCode: "",
|
||||
conTypeName: "",
|
||||
status: ""
|
||||
},
|
||||
tableDatatype: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 30,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
clickseetypedialogshow: false,
|
||||
clickseetableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 30,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
ruleFormLoading: false,
|
||||
ruleForm: {
|
||||
conCode: "",
|
||||
conName: "",
|
||||
conTypeId: "",
|
||||
price: "0",
|
||||
conNames: "",
|
||||
// surplusStock: '',
|
||||
conUnit: "",
|
||||
conWarning: "999",
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
status: ''
|
||||
},
|
||||
rules: {
|
||||
conCode: [
|
||||
{ required: true, message: "请输入耗材信息代码", trigger: "blur" }
|
||||
],
|
||||
conName: [
|
||||
{ required: true, message: "请输入耗材信息名称", trigger: "blur" }
|
||||
],
|
||||
conTypeId: [
|
||||
{ required: true, message: "请选择耗材类型", trigger: "blur" }
|
||||
],
|
||||
price: [{ required: true, message: "请输入耗材价格", trigger: "blur" }],
|
||||
conWarning: [
|
||||
{ required: true, message: "请输入耗材预警值", trigger: "blur" }
|
||||
],
|
||||
conTypeId: [
|
||||
{ required: true, message: "请输入耗材类型id", trigger: "blur" }
|
||||
],
|
||||
conUnit: [{ required: true, message: "请输入单位", trigger: "blur" }],
|
||||
conWarning: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入单位",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
},
|
||||
downloadLoading: false,
|
||||
uploadLoading: false,
|
||||
dialogVisible: false,
|
||||
consRecordItem: ''
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.resetQuery = { ...this.query }
|
||||
this.getTableData();
|
||||
this.getTableDatatype();
|
||||
},
|
||||
methods: {
|
||||
// 导入耗材
|
||||
async excelSuccessUpload(file) {
|
||||
try {
|
||||
this.uploadLoading = true
|
||||
this.dialogVisible = false
|
||||
await tbConsInfoinputStock(file)
|
||||
this.uploadLoading = false
|
||||
this.$notify.success('导入成功')
|
||||
this.resetHandle()
|
||||
} catch (error) {
|
||||
this.dialogVisible = false
|
||||
this.uploadLoading = false
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 耗材导出
|
||||
async protHandle() {
|
||||
try {
|
||||
this.downloadLoading = true;
|
||||
const file = await tbConsInfodownload(this.query)
|
||||
downloadFile(file, "耗材", "xlsx");
|
||||
this.downloadLoading = false;
|
||||
} catch (error) {
|
||||
this.downloadLoading = false;
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 编辑
|
||||
editorHandle(row) {
|
||||
this.dialogtitle = "编辑";
|
||||
for (let key in this.ruleForm) {
|
||||
this.ruleForm[key] = row[key];
|
||||
}
|
||||
this.ruleForm.id = row.id;
|
||||
this.dialogshow = true;
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query = { ...this.resetQuery }
|
||||
this.tableData.page = 0;
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1;
|
||||
this.getTableData();
|
||||
},
|
||||
paginationChangetype(e) {
|
||||
this.clickseetableData.page = e - 1;
|
||||
this.getConsRecord();
|
||||
},
|
||||
// 获取信息
|
||||
async getTableData() {
|
||||
this.tableData.loading = true;
|
||||
try {
|
||||
const res = await gettbConsInfo({
|
||||
...this.query,
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
shopId: localStorage.getItem("shopId")
|
||||
});
|
||||
this.tableData.loading = false;
|
||||
this.tableData.data = res.content;
|
||||
this.tableData.total = res.totalElements;
|
||||
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 获取类型
|
||||
async gettbConsType() {
|
||||
try {
|
||||
const res = await gettbConsType({
|
||||
page: 0,
|
||||
size: 100,
|
||||
shopId: localStorage.getItem("shopId")
|
||||
})
|
||||
this.consTypeList = res.content
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 获取类型
|
||||
async getTableDatatype() {
|
||||
this.tableDatatype.loading = true;
|
||||
try {
|
||||
const res = await gettbConsType({
|
||||
page: this.tableDatatype.page,
|
||||
size: this.tableDatatype.size,
|
||||
conTypeCode: this.querytypedialogshowquery.conTypeCode,
|
||||
conTypeName: this.querytypedialogshowquery.conTypeName,
|
||||
status: this.querytypedialogshowquery.status,
|
||||
shopId: localStorage.getItem("shopId")
|
||||
});
|
||||
this.tableDatatype.loading = false;
|
||||
this.tableDatatype.data = res.content;
|
||||
this.tableDatatype.total = res.totalElements;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 重置查询
|
||||
resetHandletype() {
|
||||
this.querytypedialogshowquery.conTypeName = "";
|
||||
this.querytypedialogshowquery.conTypeCode = "";
|
||||
this.querytypedialogshowquery.status = "";
|
||||
this.tableData.page = 0;
|
||||
this.getTableDatatype();
|
||||
},
|
||||
// 选择的类型
|
||||
tableDatatypetable(item) {
|
||||
// this.ruleForm.conCode = item.conTypeCode
|
||||
this.ruleForm.conNames = item.conTypeName;
|
||||
this.ruleForm.conTypeId = item.id;
|
||||
this.typedialogshow = false;
|
||||
},
|
||||
async clickdialogfadd(item) {
|
||||
this.libraryshow = true;
|
||||
this.libraryshowdata.id = item.id;
|
||||
},
|
||||
async clickdialoglibraryshow(formName) {
|
||||
this.$refs[formName].validate(async valid => {
|
||||
if (valid) {
|
||||
await posttbConsInfostockIn({
|
||||
id: this.libraryshowdata.id,
|
||||
stockNumber: this.libraryshowdata.stockNumber
|
||||
});
|
||||
this.libraryshow = false;
|
||||
this.$refs[formName].resetFields();
|
||||
this.getTableData();
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 弹框修改值 添加 编辑
|
||||
clickdialogframe(type, item) {
|
||||
if (type == "add") {
|
||||
// 添加
|
||||
this.dialogtitle = "添加";
|
||||
this.gettbConsType()
|
||||
this.$nextTick(() => {
|
||||
this.$refs.refruleForm.resetFields();
|
||||
});
|
||||
} else {
|
||||
this.dialogtitle = "编辑";
|
||||
this.ruleForm.id = item.id;
|
||||
this.ruleForm.conTypeId = item.conTypeId;
|
||||
this.ruleForm.conCode = item.conCode;
|
||||
this.ruleForm.conName = item.conName;
|
||||
// this.ruleForm.surplusStock = item.surplusStock
|
||||
this.ruleForm.conWarning = item.conWarning;
|
||||
this.ruleForm.conUnit = item.conUnit;
|
||||
}
|
||||
this.dialogshow = true;
|
||||
},
|
||||
submitForm(formName) {
|
||||
this.$refs[formName].validate(async valid => {
|
||||
if (valid) {
|
||||
this.ruleFormLoading = true;
|
||||
if (this.dialogtitle == "编辑") {
|
||||
await postapitbConsInfo(this.ruleForm);
|
||||
this.$message({ type: "success", message: "编辑成功" });
|
||||
this.dialogshow = false;
|
||||
} else {
|
||||
//添加
|
||||
console.log(this.ruleForm, '调试')
|
||||
await posttbConsInfo({
|
||||
...this.ruleForm
|
||||
});
|
||||
this.$message({ type: "success", message: "添加成功" });
|
||||
}
|
||||
this.dialogshow = false;
|
||||
this.$refs[formName].resetFields();
|
||||
this.ruleFormLoading = false;
|
||||
this.getTableData();
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
},
|
||||
// 删除商品
|
||||
async delTableHandle(ids) {
|
||||
try {
|
||||
await tbProductDelete(ids);
|
||||
this.getTableData();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 显示耗材记录
|
||||
async clicksee(item) {
|
||||
this.consRecordItem = item
|
||||
this.clickseetypedialogshow = true;
|
||||
this.getConsRecord()
|
||||
},
|
||||
// 获取耗材记录
|
||||
async getConsRecord() {
|
||||
try {
|
||||
this.clickseetableData.loading = true;
|
||||
const res = await gettbConsInfoFlow({
|
||||
page: this.clickseetableData.page,
|
||||
size: this.clickseetableData.size,
|
||||
consId: this.consRecordItem.id,
|
||||
conName: this.consRecordItem.conName,
|
||||
shopId: localStorage.getItem("shopId")
|
||||
});
|
||||
this.clickseetableData.loading = false;
|
||||
this.clickseetableData.data = res.content;
|
||||
this.clickseetableData.total = res.totalElements;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.row_wrap {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.handle {
|
||||
font-size: 18px;
|
||||
color: #999;
|
||||
|
||||
&:hover {
|
||||
cursor: grab;
|
||||
}
|
||||
}
|
||||
|
||||
.shop_info {
|
||||
display: flex;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding-left: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.tag_wrap {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.red {
|
||||
color: rgb(219, 32, 32);
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,549 @@
|
|||
<!-- eslint-disable no-empty -->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="3">
|
||||
<el-input v-model="query.conName" size="small" clearable placeholder="请输入耗材信息名称"
|
||||
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableData" />
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-input v-model="query.specSnap" size="small" clearable placeholder="请输入规格名称" style="width: 100%;"
|
||||
class="filter-item" @keyup.enter.native="getTableData" />
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-input v-model="query.name" size="small" clearable placeholder="请输入商品名称" style="width: 100%;"
|
||||
class="filter-item" @keyup.enter.native="getTableData" />
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-select v-model="query.status" placeholder="请选择商品规格" style="width: 100%;">
|
||||
<el-option :label="item.label" :value="item.value" v-for="item in typeEnums"
|
||||
:key="item.label" />
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button type="primary" icon="el-icon-plus"
|
||||
@click="$refs.shopList.show(tableData.list)">选择商品规格</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="head-container" id="table_drag">
|
||||
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id">
|
||||
<el-table-column prop="id" label="ID" width="50px" />
|
||||
<el-table-column label="耗材信息" prop="conName" />
|
||||
<el-table-column label="商品" prop="name" />
|
||||
<el-table-column label="规格" prop="specSnap" />
|
||||
<el-table-column label="单笔消耗数" prop="surplusStock" />
|
||||
<!-- <el-table-column label="价格" prop="conName" /> -->
|
||||
<el-table-column label="耗材信息代码" prop="conCode" />
|
||||
<el-table-column label="耗材信息单位" prop="conUnit" />
|
||||
<el-table-column label="库存" prop="stockNumber" />
|
||||
<el-table-column label="创建时间" prop="createTime">
|
||||
<!-- <template v-slot="scope">
|
||||
{{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="primary" v-if="scope.row.status == '1'">启用</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.status == '0'">禁用</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="更新时间" prop="updateTime">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" width="200">
|
||||
<template v-slot="scope">
|
||||
<!-- <el-button type="text" icon="el-icon-rank">排序</el-button> -->
|
||||
<el-button type="text" icon="el-icon-edit"
|
||||
@click="clickdialogframe('edit', scope.row)">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
|
||||
slot="reference">删除</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange"
|
||||
@size-change="e => { tableData.size = e; getTableData() }" />
|
||||
</div>
|
||||
<el-dialog :title="dialogtitle" :visible.sync="dialogshow" width="1000px">
|
||||
<el-form ref="addSelect" :inline="true">
|
||||
<!-- <el-form-item label="商品名称" v-for="(ele, index) in addSelect">
|
||||
<template >
|
||||
{{ addSelect.length ? addSelect[index].name : '' }}
|
||||
</template>
|
||||
</el-form-item> -->
|
||||
|
||||
|
||||
<template v-for="(ele, index) in commodityArr">
|
||||
<template v-if="ele.names">
|
||||
<br />
|
||||
<el-form-item label="商品名称">
|
||||
{{ ele.names }}
|
||||
</el-form-item>
|
||||
<br />
|
||||
</template>
|
||||
|
||||
|
||||
<el-form-item label="商品规格">
|
||||
<el-input v-model="ele.specSnap" style="width: 130px;" placeholder="请选择商品规格"
|
||||
disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材信息" prop="conName">
|
||||
<el-input v-model="ele.conName" style="width: 130px;" placeholder="请选择耗材信息" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="selecthaocai(ele)">去选择耗材信息</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位耗材值">
|
||||
<el-input v-model="ele.surplusStock" type=number placeholder="请输入单位耗材值"
|
||||
@input="handleKeyUp($event, index)"></el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<el-form-item style="display: flex;justify-content: flex-end;">
|
||||
<el-button @click="dialogshow = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm('addSelect')">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="耗材信息" :visible.sync="informationdialogshow">
|
||||
<div class="head-container">
|
||||
<el-input v-model="queryinformation.conTypeId" size="small" clearable placeholder="请输入类型id"
|
||||
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableDatainformation" />
|
||||
<el-input v-model="queryinformation.conTypeName" size="small" clearable placeholder="请输入类型名称"
|
||||
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableDatainformation" />
|
||||
<el-input v-model="queryinformation.conCode" size="small" clearable placeholder="请输入耗材代码"
|
||||
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableDatainformation" />
|
||||
<el-input v-model="queryinformation.conName" size="small" clearable placeholder="请输入耗材名称"
|
||||
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableDatainformation" />
|
||||
<div style="display: flex; justify-content: flex-end;">
|
||||
<el-button style="margin-right: 20px;" type="primary"
|
||||
@click="getTableDatainformation">查询</el-button>
|
||||
<el-button @click="resetHandleinformation">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table ref="table" :data="tableDatainformation.data" v-loading="tableDatainformation.loading"
|
||||
row-key="id">
|
||||
<el-table-column prop="id" label="ID" width="50px" />
|
||||
<el-table-column label="耗材名称" prop="conName" />
|
||||
<el-table-column label="耗材代码" prop="conCode" />
|
||||
<el-table-column label="类型名称" prop="conTypeName" />
|
||||
<el-table-column label="单位" prop="conUnit" />
|
||||
<el-table-column label="库存数量" prop="stockNumber">
|
||||
<template v-slot="scope">
|
||||
{{ (scope.row.stockNumber - scope.row.stockConsume).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="单位耗材值" prop="surplusStock" /> -->
|
||||
<el-table-column label="" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-button @click="tableDatainformationtable(scope.row)">确定</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableDatainformation.total" :current-page="tableDatainformation.page + 1"
|
||||
:page-size="tableDatainformation.size" layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="paginationChangeinformation"
|
||||
@size-change="e => { tableDatainformation.size = e; tableDatainformation.page = 0; getTableDatainformation() }" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog title="编辑" :visible.sync="informationdialogshowedit" width="20%">
|
||||
<el-form ref="addSelect" :inline="true">
|
||||
<el-form-item label="单位耗材值">
|
||||
<el-input v-model="surplusStocks.surplusStock" type=number
|
||||
@input="limitInput($event, 'monthOutputValue')" placeholder="请输入单位耗材值"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item style="display: flex;justify-content: flex-end;">
|
||||
<el-button @click="informationdialogshowedit = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm('addSelect')">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
<shopList ref="shopList" @success="selectShop" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sortable from 'sortablejs'
|
||||
import dayjs from 'dayjs'
|
||||
import shopList from '../components/shopList'
|
||||
import { upProSort, tbProduct } from '@/api/shop'
|
||||
import { getviewConSku, gettbProductSpec, gettbConsInfo, posttbProskuCons, puttbProskuCon, deletetbProskuCon } from '@/api/consumable'
|
||||
export default {
|
||||
components: { shopList },
|
||||
data() {
|
||||
return {
|
||||
dayjs,
|
||||
query: {
|
||||
conName: '',
|
||||
specSnap: '',
|
||||
name: '',
|
||||
status: ''
|
||||
},
|
||||
surplusStocks: '',
|
||||
typeEnums: [{
|
||||
label: '正常',
|
||||
value: '1'
|
||||
}, {
|
||||
label: '禁用',
|
||||
value: '0'
|
||||
}],
|
||||
dialogshow: false, //弹框显示
|
||||
dialogtitle: '', //文字显示
|
||||
informationdialogshow: false,
|
||||
informationdialogshowedit: false,
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 30,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
queryinformation: {
|
||||
conTypeId: '',
|
||||
conTypeName: '',
|
||||
conCode: '',
|
||||
conName: ''
|
||||
},
|
||||
tableDatainformation: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 30,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
tableDataskudialogshow: false,
|
||||
querytableDatasku: {
|
||||
specSnap: '',
|
||||
name: '',
|
||||
shopName: ''
|
||||
},
|
||||
tableDatasku: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 30,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
rules: {
|
||||
|
||||
},
|
||||
// 动态新增选择框-所有数据
|
||||
addSelect: [],
|
||||
// 筛选集合
|
||||
commodityArr: [],
|
||||
// 选择耗材的index
|
||||
ALLisDistribute: null,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
this.getTableDatasku()
|
||||
this.getTableDatainformation()
|
||||
this.$nextTick(() => {
|
||||
// this.tableDrag()
|
||||
// this.$refs.shopList.isselectEvent()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
limitInput(value, name) {
|
||||
this.surplusStocks.surplusStock = ('' + value) // 第一步:转成字符串
|
||||
// .replace(/[^\d^\.]+/g, '') // 第二步:把不是数字,不是小数点的过滤掉
|
||||
|
||||
.replace(/^0+(\d)/, '$1') // 第三步:第一位0开头,0后面为数字,则过滤掉,取后面的数字
|
||||
|
||||
.replace(/^\./, '0.') // 第四步:如果输入的第一位为小数点,则替换成 0. 实现自动补全
|
||||
|
||||
.match(/^\d*(\.?\d{0,2})/g)[0] || ''
|
||||
},
|
||||
handleKeyUp(value, index) {
|
||||
console.log(value, index, '体哦傲视1')
|
||||
if (value < 0) {
|
||||
this.commodityArr[index].surplusStock = (value * -1)
|
||||
}
|
||||
},
|
||||
selectShop(res) {
|
||||
this.commodityArr = []
|
||||
this.addSelect = res
|
||||
console.log(res, 'tiaosjo')
|
||||
res.forEach((ele, i) => {
|
||||
// isDistribute1为共享库存-商品,0不共享是多规格
|
||||
// 判断是否共享拆分数据到商品和规格集合里
|
||||
let sname = ele.name
|
||||
if (ele.isDistribute == 1) {
|
||||
ele.specSnap = ele.name
|
||||
ele.conName = ele.conName
|
||||
this.commodityArr.push(ele)
|
||||
ele.names = sname
|
||||
} else {
|
||||
// 规格数据处理
|
||||
ele.skuList.forEach((element, indexs) => {
|
||||
if (indexs == 0) {
|
||||
element.names = sname
|
||||
}
|
||||
element.conInfoId = element.id
|
||||
element.conName = element.conName
|
||||
if (element.specSnap == null) {
|
||||
element.specSnap = sname
|
||||
}
|
||||
this.commodityArr.push(element)
|
||||
|
||||
})
|
||||
}
|
||||
})
|
||||
this.clickdialogframe('add')
|
||||
|
||||
},
|
||||
// 选择耗材
|
||||
selecthaocai(item) {
|
||||
this.ALLisDistribute = item
|
||||
this.informationdialogshow = true
|
||||
},
|
||||
//表格拖拽
|
||||
tableDrag() {
|
||||
const el = document.querySelector('#table_drag .el-table__body-wrapper tbody')
|
||||
new Sortable(el, {
|
||||
animation: 150,
|
||||
onEnd: async e => {
|
||||
// console.log('拖拽结束===', e);
|
||||
if (e.oldIndex == e.newIndex) return
|
||||
let oid = this.tableData.data[e.oldIndex].id
|
||||
let nid = this.tableData.data[e.newIndex].id
|
||||
let ids = this.tableData.data.map(item => item.id)
|
||||
try {
|
||||
await upProSort({
|
||||
strId: oid,
|
||||
endId: nid,
|
||||
ids: ids
|
||||
})
|
||||
await this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query.conName = ''
|
||||
this.query.specSnap = ''
|
||||
this.query.name = ''
|
||||
this.query.status = ''
|
||||
this.tableData.page = 0
|
||||
this.getTableData()
|
||||
},
|
||||
resetHandlesku() {
|
||||
this.querytableDatasku.specSnap = ''
|
||||
this.querytableDatasku.name = ''
|
||||
this.querytableDatasku.shopName = ''
|
||||
this.tableDatasku.page = 0
|
||||
this.getTableDatasku()
|
||||
},
|
||||
resetHandleinformation() {
|
||||
this.queryinformation.conTypeId = ''
|
||||
this.queryinformation.conTypeName = ''
|
||||
this.queryinformation.conCode = ''
|
||||
this.queryinformation.conName = ''
|
||||
this.tableDatainformation.page = 0
|
||||
this.getTableDatainformation()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await getviewConSku({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
conName: this.query.conName,
|
||||
specSnap: this.query.specSnap,
|
||||
name: this.query.name,
|
||||
status: this.query.status,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.data = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
paginationChangeinformation(e) {
|
||||
this.tableDatainformation.page = e - 1
|
||||
this.getTableDatainformation()
|
||||
},
|
||||
// 获取信息管理
|
||||
async getTableDatainformation() {
|
||||
this.tableDatainformation.loading = true
|
||||
try {
|
||||
const res = await gettbConsInfo({
|
||||
page: this.tableDatainformation.page,
|
||||
size: this.tableDatainformation.size,
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
conTypeId: this.queryinformation.conTypeId,
|
||||
conTypeName: this.queryinformation.conTypeName,
|
||||
conCode: this.queryinformation.conCode,
|
||||
conName: this.queryinformation.conName,
|
||||
})
|
||||
this.tableDatainformation.loading = false
|
||||
this.tableDatainformation.data = res.content
|
||||
this.tableDatainformation.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
// 耗材信息的信息
|
||||
tableDatainformationtable(item) {
|
||||
this.commodityArr.forEach(ele => {
|
||||
if (ele.id == this.ALLisDistribute.id) {
|
||||
ele.consInfoId = item.id
|
||||
ele.conInfoId = item.id
|
||||
ele.conName = item.conName
|
||||
ele.skuId = ele.id
|
||||
}
|
||||
})
|
||||
this.informationdialogshow = false
|
||||
},
|
||||
// 获取商品规格
|
||||
async getTableDatasku() {
|
||||
this.tableDatasku.loading = true
|
||||
try {
|
||||
const res = await tbProduct({
|
||||
page: this.tableDatasku.page,
|
||||
size: this.tableDatasku.size,
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
specSnap: this.querytableDatasku.specSnap,
|
||||
name: this.querytableDatasku.name,
|
||||
sort: 'id.desc',
|
||||
shopName: this.querytableDatasku.shopName
|
||||
})
|
||||
this.tableDatasku.loading = false
|
||||
this.tableDatasku.data = res.content
|
||||
this.tableDatasku.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
Changeinformationsku(e) {
|
||||
this.tableDatasku.page = e - 1
|
||||
this.getTableDatasku()
|
||||
},
|
||||
// 弹框修改值 添加 编辑
|
||||
clickdialogframe(type, item) {
|
||||
if (type == 'add') { // 添加
|
||||
this.dialogtitle = '添加'
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addSelect.resetFields()
|
||||
})
|
||||
this.dialogshow = true
|
||||
} else {
|
||||
this.informationdialogshowedit = true
|
||||
this.dialogtitle = '编辑'
|
||||
this.surplusStocks = item
|
||||
}
|
||||
},
|
||||
async submitForm(formName) {
|
||||
if (this.dialogtitle == '编辑') {
|
||||
let { id, surplusStock } = this.surplusStocks
|
||||
await puttbProskuCon({
|
||||
id,
|
||||
surplusStock
|
||||
})
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.informationdialogshowedit = false
|
||||
} else {
|
||||
// isDistribute1为共享库存-商品,0不共享是多规格
|
||||
let isgongx = false
|
||||
this.commodityArr.forEach(ele => {
|
||||
if (!ele.skuId || !ele.surplusStock) {
|
||||
isgongx = true
|
||||
}
|
||||
})
|
||||
if (isgongx) {
|
||||
this.$message.error('请选择耗材信息与输入耗材值')
|
||||
isgongx = false
|
||||
return
|
||||
}
|
||||
this.addSelect.forEach(ele => {
|
||||
ele.skuInfos = ele.skuList
|
||||
ele.productId = ele.id //商品id
|
||||
})
|
||||
await posttbProskuCons(this.addSelect)
|
||||
this.$message({
|
||||
message: '新增成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.ALLisDistribute = null
|
||||
this.dialogshow = false
|
||||
}
|
||||
this.$refs[formName].resetFields()
|
||||
this.getTableData()
|
||||
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
// 删除商品
|
||||
async delTableHandle(ids) {
|
||||
try {
|
||||
await deletetbProskuCon(ids)
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.handle {
|
||||
font-size: 18px;
|
||||
color: #999;
|
||||
|
||||
&:hover {
|
||||
cursor: grab;
|
||||
}
|
||||
}
|
||||
|
||||
.shop_info {
|
||||
display: flex;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding-left: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.tag_wrap {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,300 @@
|
|||
<!-- eslint-disable no-empty -->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="3">
|
||||
<el-input v-model="query.conTypeName" size="small" clearable placeholder="请输入耗材类型名称" style="width: 100%;"
|
||||
class="filter-item" @keyup.enter.native="getTableData" />
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-input v-model="query.conTypeCode" size="small" clearable placeholder="请输入耗材类型代码" style="width: 100%;"
|
||||
class="filter-item" @keyup.enter.native="getTableData" />
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-select v-model="query.status" placeholder="请选择商品规格" style="width: 100%;">
|
||||
<el-option :label="item.label" :value="item.value" v-for="item in typeEnums" :key="item.label" />
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="clickdialogframe('add')">添加</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="head-container" id="table_drag">
|
||||
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id">
|
||||
<el-table-column prop="id" label="ID" width="50px" />
|
||||
<el-table-column label="耗材类型名称" prop="conTypeName" />
|
||||
<el-table-column label="耗材类型代码" prop="conTypeCode" />
|
||||
<el-table-column label="创建时间" prop="createTime">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="店铺ID" prop="shopId">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.shopId }}
|
||||
<!-- <el-link type="primary" @click="$router.push({ name: 'information' })">{{ scope.row.shopId }}</el-link> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="primary" v-if="scope.row.status == '1'">正常</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.status == '0'">禁用</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="排序" prop="sort" sortable /> -->
|
||||
<el-table-column label="更新时间" prop="updateTime">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template v-slot="scope">
|
||||
<!-- <el-button type="text" icon="el-icon-rank">排序</el-button> -->
|
||||
<el-button type="text" icon="el-icon-edit" @click="clickdialogframe('edit', scope.row)">编辑</el-button>
|
||||
<!-- <el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
|
||||
slot="reference">删除</el-button>
|
||||
</el-popconfirm> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange"
|
||||
@size-change="e => { tableData.size = e; tableData.page = 0; getTableData() }" />
|
||||
</div>
|
||||
<el-dialog :title="dialogtitle" :visible.sync="dialogshow">
|
||||
<el-form ref="refruleForm" :model="ruleForm" :rules="rules">
|
||||
<el-form-item label="耗材类型名称" prop="conTypeName">
|
||||
<el-input v-model="ruleForm.conTypeName" />
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材类型代码" prop="conTypeCode">
|
||||
<el-input v-model="ruleForm.conTypeCode" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否禁用" prop="status">
|
||||
<el-switch v-model="ruleForm.status" />
|
||||
</el-form-item>
|
||||
<el-form-item style="display: flex;justify-content: flex-end;">
|
||||
<el-button @click="dialogshow = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm('refruleForm')">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sortable from 'sortablejs'
|
||||
import dayjs from 'dayjs'
|
||||
import settings from '@/settings'
|
||||
import { upProSort } from '@/api/shop'
|
||||
import { gettbConsType, posttbConsType, puttbConsType } from '@/api/consumable'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dayjs,
|
||||
query: {
|
||||
conTypeCode: '',
|
||||
conTypeName: '',
|
||||
status: ''
|
||||
},
|
||||
categorys: [],
|
||||
typeEnums: [{
|
||||
label: '正常',
|
||||
value: '1'
|
||||
}, {
|
||||
label: '禁用',
|
||||
value: '0'
|
||||
}],
|
||||
dialogshow: false, //弹框显示
|
||||
dialogtitle: '', //文字显示
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 30,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
ruleForm: {
|
||||
conTypeCode: '',
|
||||
conTypeName: '',
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
status: false
|
||||
},
|
||||
rules: {
|
||||
conTypeName: [
|
||||
{ required: true, message: '请输入耗材类型名称', trigger: 'blur' }
|
||||
],
|
||||
conTypeCode: [
|
||||
{ required: true, message: '请输入耗材类型代码', trigger: 'blur' }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: '选择状态', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
this.$nextTick(() => {
|
||||
// this.tableDrag()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
//表格拖拽
|
||||
tableDrag() {
|
||||
const el = document.querySelector('#table_drag .el-table__body-wrapper tbody')
|
||||
new Sortable(el, {
|
||||
animation: 150,
|
||||
onEnd: async e => {
|
||||
// console.log('拖拽结束===', e);
|
||||
if (e.oldIndex == e.newIndex) return
|
||||
let oid = this.tableData.data[e.oldIndex].id
|
||||
let nid = this.tableData.data[e.newIndex].id
|
||||
let ids = this.tableData.data.map(item => item.id)
|
||||
try {
|
||||
await upProSort({
|
||||
strId: oid,
|
||||
endId: nid,
|
||||
ids: ids
|
||||
})
|
||||
await this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query.conTypeCode = ''
|
||||
this.query.conTypeName = ''
|
||||
this.query.status = ''
|
||||
this.tableData.page = 0
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await gettbConsType({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
conTypeCode: this.query.conTypeCode,
|
||||
conTypeName: this.query.conTypeName,
|
||||
status: this.query.status,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.data = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
// 弹框修改值 添加 编辑
|
||||
clickdialogframe(type, item) {
|
||||
// eslint-disable-next-line eqeqeq
|
||||
if (type == 'add') { // 添加
|
||||
this.dialogtitle = '添加'
|
||||
this.$nextTick(() => {
|
||||
this.$refs.refruleForm.resetFields()
|
||||
})
|
||||
} else {
|
||||
this.dialogtitle = '编辑'
|
||||
this.ruleForm.id = item.id
|
||||
this.ruleForm.conTypeCode = item.conTypeCode
|
||||
this.ruleForm.conTypeName = item.conTypeName
|
||||
this.ruleForm.status = item.status == 0 ? true : false
|
||||
}
|
||||
this.dialogshow = true
|
||||
},
|
||||
submitForm(formName) {
|
||||
this.$refs[formName].validate(async (valid) => {
|
||||
if (valid) {
|
||||
if (this.dialogtitle == '编辑') {
|
||||
await puttbConsType({
|
||||
id: this.ruleForm.id,
|
||||
conTypeCode: this.ruleForm.conTypeCode,
|
||||
conTypeName: this.ruleForm.conTypeName,
|
||||
shopId: this.ruleForm.shopId,
|
||||
status: this.ruleForm.status ? '0' : '1'
|
||||
})
|
||||
this.dialogshow = false
|
||||
|
||||
this.getTableData()
|
||||
} else {
|
||||
await posttbConsType({
|
||||
conTypeCode: this.ruleForm.conTypeCode,
|
||||
conTypeName: this.ruleForm.conTypeName,
|
||||
shopId: this.ruleForm.shopId,
|
||||
status: this.ruleForm.status ? '0' : '1'
|
||||
})
|
||||
}
|
||||
this.dialogshow = false
|
||||
this.$refs[formName].resetFields()
|
||||
this.getTableData()
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
// 删除商品
|
||||
async delTableHandle(ids) {
|
||||
try {
|
||||
await tbProductDelete(ids)
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.handle {
|
||||
font-size: 18px;
|
||||
color: #999;
|
||||
|
||||
&:hover {
|
||||
cursor: grab;
|
||||
}
|
||||
}
|
||||
|
||||
.shop_info {
|
||||
display: flex;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding-left: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.tag_wrap {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,75 +1,162 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-input v-model="query.name" size="small" clearable placeholder="商品名称" style="width: 100%;"
|
||||
class="filter-item" @keyup.enter.native="getTableData" />
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="row_wrap">
|
||||
<div class="row">
|
||||
<el-input v-model="query.name" size="small" clearable placeholder="商品名称"
|
||||
@keyup.enter.native="getTableData" />
|
||||
<!-- <el-input v-model="query.num" placeholder="库存数量:少于多少xx" /> -->
|
||||
<div style="width: 300px;">
|
||||
<el-select v-model="query.categoryId" placeholder="商品分类" style="width: 100%;">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in categorys" :key="item.id" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="width: 300px;">
|
||||
<el-select v-model="query.isStock" placeholder="库存开关" style="width: 100%;">
|
||||
<el-option label="开" :value="1">开</el-option>
|
||||
<el-option label="关" :value="0">关</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-button @click="Uppop()">库存预警:{{ warnLine }}</el-button>
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-button icon="el-icon-download" :loading="downloadLoading" @click="protHandle">导出库存</el-button>
|
||||
<el-button icon="el-icon-upload2" :loading="uploadLoading"
|
||||
@click="dialogVisible = true">导入库存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.list" v-loading="tableData.loading">
|
||||
<el-table-column label="商品信息">
|
||||
<el-table :data="tableData.list" v-loading="tableData.loading" row-key="id" lazy :load="load"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
|
||||
<el-table-column width="30">
|
||||
<template v-slot="scope">
|
||||
<i class="" v-if="scope.row.hasChildren == false"></i>
|
||||
<!-- <div v-if="scope.row.iskaiguans == 1" style="padding-left: 20px;"></div> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品信息" width="200px">
|
||||
<template v-slot="scope">
|
||||
<div class="shop_info">
|
||||
<el-image :src="scope.row.coverImg" class="cover">
|
||||
<el-image :src="scope.row.img" class="cover" v-if="scope.row.iskaiguans != 1">
|
||||
<div class="img_error" slot="error">
|
||||
<i class="icon el-icon-document-delete"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
<div class="info">
|
||||
<span>{{ scope.row.name }}</span>
|
||||
<div>
|
||||
<el-tag type="primary">{{ scope.row.typeEnum | typeEnum }}</el-tag>
|
||||
<div v-if="scope.row.iskaiguans != 1">
|
||||
<el-tag type="primary">{{ scope.row.type }}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存" prop="stockNumber">
|
||||
<el-table-column label="规格" prop="number">
|
||||
<template v-slot="scope">
|
||||
{{ `${scope.row.stockNumber} ${scope.row.unitName}` }}
|
||||
<div v-if="scope.row.iskaiguans">
|
||||
{{ scope.row.specSnap }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存" prop="number">
|
||||
<template v-slot="scope">
|
||||
<span :class="[scope.row.stockNumber <= warnLine ? 'colorStyle' : '']">
|
||||
{{ `${scope.row.stockNumber} ${scope.row.unitName}` }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="库存开关">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.isStock" :active-value="1" :inactive-value="0"></el-switch>
|
||||
<el-switch v-model="scope.row.isStock" :active-value="1" :inactive-value="0"
|
||||
v-if="scope.row.hasChildren || scope.row.hasChildren == false"
|
||||
@change="showChange($event, scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<el-table-column label="共享库存">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.isDistribute" :active-value="1" :inactive-value="0"
|
||||
v-if="scope.row.hasChildren || scope.row.hasChildren == false"
|
||||
@change="showChanges($event, scope.row, 'proId', 'distribute')"></el-switch>
|
||||
</template>
|
||||
</el-table-column> <el-table-column label="售罄">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.isPauseSale" :active-value="1" :inactive-value="0"
|
||||
@change="showChangess($event, scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="240px">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" size="mini"
|
||||
@click="$refs.invoicingDetail.show(scope.row)">库存记录</el-button>
|
||||
<template v-if="!scope.row.hasChildren">
|
||||
<el-button type="text" size="mini" style="margin-left: 10px !important;"
|
||||
@click="$refs.AddStockTakin.show(scope.row)">库存盘点</el-button>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
<el-pagination @size-change="paginationSizeChange" :total="tableData.total"
|
||||
:current-page="tableData.page + 1" :page-size="tableData.size" @current-change="paginationChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
</div>
|
||||
<invoicingDetail ref="invoicingDetail" />
|
||||
<!-- 导入库存弹窗 -->
|
||||
<el-dialog title="导入库存" :visible.sync="dialogVisible">
|
||||
<UploadExcel :beforeUpload="excelSuccessUpload" />
|
||||
</el-dialog>
|
||||
<!-- 预存弹窗组件 -->
|
||||
<el-dialog title="" :visible.sync="dialogTableVisible" width="350px">
|
||||
<el-form>
|
||||
<el-form-item label="库存预存设置" label-width="120px">
|
||||
<el-input v-model="montey" type="number" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogTableVisible = false; montey = ''">取 消</el-button>
|
||||
<el-button type="primary" @click="sumbit()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 新增库存盘点 -->
|
||||
<AddStockTakin ref="AddStockTakin" @success="resetHandle" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { tbProductGet } from '@/api/invoicing'
|
||||
import { stock, stockdownload, stockdoImport, stockStatewarnLine, stockStateChanges, stocks } from '@/api/invoicing'
|
||||
import { tbShopCategoryGet } from '@/api/shop'
|
||||
import settings from '@/settings'
|
||||
import invoicingDetail from './components/invoicingDetail'
|
||||
import AddStockTakin from './components/addStockTakin'
|
||||
import UploadExcel from '@/components/UploadExcel/'
|
||||
import { downloadFile } from "@/utils/index";
|
||||
export default {
|
||||
components: {
|
||||
invoicingDetail
|
||||
invoicingDetail,
|
||||
UploadExcel,
|
||||
AddStockTakin
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
dialogTableVisible: false,
|
||||
montey: "",
|
||||
categorys: [],
|
||||
query: {
|
||||
name: ''
|
||||
name: '',
|
||||
isStock: '',
|
||||
num: '',
|
||||
categoryId: ''
|
||||
},
|
||||
resetQuery: '',
|
||||
downloadLoading: false,
|
||||
uploadLoading: false,
|
||||
warnLine: null, // 警戒线
|
||||
tableData: {
|
||||
page: 0,
|
||||
size: 10,
|
||||
|
|
@ -80,48 +167,196 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
typeEnum(m) {
|
||||
return settings.typeEnum.find(item => item.typeEnum == m).label
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.resetQuery = { ...this.query }
|
||||
this.tbShopCategoryGet()
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
Uppop() {
|
||||
this.dialogTableVisible = true
|
||||
},
|
||||
async sumbit() {
|
||||
try {
|
||||
const res = await tbProductGet({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
sort: this.tableData.sort,
|
||||
name: this.query.name,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
const res = await stockStatewarnLine({
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
warnLine: this.montey
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.list = res.content.map(item => {
|
||||
let stockNumber = 0
|
||||
for (let i of item.skuList) {
|
||||
stockNumber += i.stockNumber
|
||||
}
|
||||
item.stockNumber = stockNumber
|
||||
return item
|
||||
})
|
||||
this.tableData.total = res.totalElements
|
||||
|
||||
this.$message({ type: 'success', message: '修改成功!' });
|
||||
setTimeout(() => {
|
||||
this.dialogTableVisible = false
|
||||
this.montey = ''
|
||||
this.getTableData()
|
||||
}, 500);
|
||||
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
async load(tree, treeNode, resolve) {
|
||||
const res = await stocks({
|
||||
productId: tree.proId,
|
||||
})
|
||||
res.forEach(ele => ele.iskaiguans = 1)
|
||||
setTimeout(() => {
|
||||
resolve(res)
|
||||
}, 50);
|
||||
},
|
||||
async excelSuccessUpload(file) {
|
||||
console.log(file);
|
||||
try {
|
||||
this.uploadLoading = true
|
||||
this.dialogVisible = false
|
||||
const res = await stockdoImport(file)
|
||||
this.uploadLoading = false
|
||||
this.$notify.success('导入成功')
|
||||
this.tableData.list = []
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
this.dialogVisible = false
|
||||
this.uploadLoading = false
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 导出库存
|
||||
async protHandle() {
|
||||
try {
|
||||
this.downloadLoading = true;
|
||||
const file = await stockdownload({
|
||||
name: this.query.name,
|
||||
isStock: this.query.isStock,
|
||||
num: this.query.num
|
||||
})
|
||||
downloadFile(file, "商品库存", "xlsx");
|
||||
this.downloadLoading = false;
|
||||
} catch (error) {
|
||||
this.downloadLoading = false;
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 状态切换
|
||||
async showChange(e, row) {
|
||||
await stockStateChanges({
|
||||
"updateKey": 'stock',
|
||||
"updateValue": row.isStock,
|
||||
"targetId": row.proId,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
// 共享库存
|
||||
async showChanges(e, row, name, value) {
|
||||
await stockStateChanges({
|
||||
"updateKey": value,
|
||||
"updateValue": row.isDistribute,
|
||||
"targetId": row[name],
|
||||
shopId: localStorage.getItem('shopId')
|
||||
|
||||
})
|
||||
this.tableData.list = []
|
||||
this.getTableData()
|
||||
|
||||
},
|
||||
// 售罄
|
||||
async showChangess(e, row) {
|
||||
if (row.hasChildren || row.hasChildren == false) {
|
||||
await stockStateChanges({
|
||||
"updateKey": 'pauseSale',
|
||||
"updateValue": row.isPauseSale,
|
||||
"targetId": row.proId,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
|
||||
})
|
||||
} else {
|
||||
await stockStateChanges({
|
||||
"updateKey": 'pauseSaleSku',
|
||||
"updateValue": row.isPauseSale,
|
||||
"targetId": row.skuId,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await stock({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
name: this.query.name,
|
||||
isStock: this.query.isStock,
|
||||
num: this.query.num,
|
||||
categoryId: this.query.categoryId,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.total = res.totalElements
|
||||
// 多规格数据处理
|
||||
res.content.forEach(element => {
|
||||
if (element.type == '多规格' && element.isDistribute == 0) {
|
||||
element.hasChildren = true
|
||||
} else {
|
||||
element.hasChildren = false
|
||||
}
|
||||
});
|
||||
this.warnLine = res.warnLine
|
||||
this.tableData.list = res.content
|
||||
console.log(this.tableData.list);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 获取商品分类列表
|
||||
async tbShopCategoryGet() {
|
||||
try {
|
||||
const res = await tbShopCategoryGet({
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
page: 0,
|
||||
size: 100,
|
||||
sort: 'id'
|
||||
})
|
||||
let categorys = []
|
||||
for (let item of res.content) {
|
||||
categorys.push({
|
||||
name: `|----${item.name}`,
|
||||
id: item.id
|
||||
})
|
||||
if (item.childrenList.length) {
|
||||
for (let val of item.childrenList) {
|
||||
categorys.push({
|
||||
name: `|----|----${val.name}`,
|
||||
id: val.id
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
this.categorys = categorys
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
// 每页条数改变是回调
|
||||
paginationSizeChange(e) {
|
||||
console.log(e);
|
||||
this.tableData.size = e
|
||||
this.tableData.page = 0
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
console.log(e)
|
||||
this.tableData.page = e - 1
|
||||
this.tableData.list = []
|
||||
this.getTableData()
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query.blurry = ''
|
||||
this.query = { ...this.resetQuery }
|
||||
this.tableData.page = 0;
|
||||
this.tableData.list = []
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
|
|
@ -148,4 +383,27 @@ export default {
|
|||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
.row_wrap {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.colorStyle {
|
||||
color: rgb(231, 42, 42);
|
||||
font-weight: 700;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.cell {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* flex-direction: row-reverse; */
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<div class="head-container">
|
||||
<div class="filter_wrap">
|
||||
<el-date-picker v-model="query.createdAt" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" @change="getTableData">
|
||||
end-placeholder="结束日期" value-format="yyyy-MM-dd" @change="getTableData">
|
||||
</el-date-picker>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
|
|
@ -13,12 +13,13 @@
|
|||
<el-table :data="tableData.list" v-loading="tableData.loading">
|
||||
<el-table-column label="类型" prop="type">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.type == 'reject' ? '退货出库' : '供应商入库' }}
|
||||
{{ scope.row.type }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供应商名称" prop="purveyorName"></el-table-column>
|
||||
<el-table-column label="商品数量" prop="totalAmount">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.stockSnap.length }}
|
||||
{{ scope.row.stockSnap && scope.row.stockSnap.length }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="remark"></el-table-column>
|
||||
|
|
@ -32,9 +33,9 @@
|
|||
{{ dayjs(scope.row.stockTime).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120">
|
||||
<el-table-column label="操作" width="80">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" size="mini" @click="$refs.operatingDetail.show(scope.row.id)">
|
||||
<el-button type="text" size="mini" @click="$refs.operatingDetail.show(scope.row)">
|
||||
详情
|
||||
</el-button>
|
||||
<!-- <el-button type="text" size="mini" @click="$refs.operatingDetail.show(scope.row.id)">
|
||||
|
|
@ -45,7 +46,9 @@
|
|||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
@current-change="paginationChange"
|
||||
@size-change="e => { tableData.size = e; tableData.page = 0; getTableData() }"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
<operatingDetail ref="operatingDetail" />
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -80,12 +83,19 @@ export default {
|
|||
methods: {
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
let arr = []
|
||||
console.log(this.query, 'tiaoshi1')
|
||||
if (this.query.createdAt.length) {
|
||||
arr = [this.query.createdAt[0] + ' 00:00:00', this.query.createdAt[1] + ' 23:59:59']
|
||||
} else {
|
||||
arr = []
|
||||
}
|
||||
try {
|
||||
const res = await tbProductStockOperateList({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
createdAt: this.query.createdAt
|
||||
createdAt: arr
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.list = res.content
|
||||
|
|
|
|||
|
|
@ -2,7 +2,18 @@
|
|||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-form ref="queryForm" :model="queryForm" :rules="queryRules" label-position="left" label-width="80px">
|
||||
<el-form-item label="出库类型">
|
||||
<el-form-item label="入库内容">
|
||||
<div class="shop_type_box">
|
||||
<div class="item" v-for="item in inTabs" :key="item.value"
|
||||
:class="{ active: inTabValue == item.value }" @click="tabChange(item.value, item.type)">
|
||||
<div class="s_title">{{ item.label }}</div>
|
||||
<div class="active_dot">
|
||||
<i class="el-icon-check"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库类型" v-if="inTabValue == 'goods'">
|
||||
<div class="shop_type_box">
|
||||
<div class="item" v-for="(item, index) in shopTypes" :key="index"
|
||||
:class="{ active: shopTypesActive == index }" @click="changeTypeEnum(index)">
|
||||
|
|
@ -13,6 +24,17 @@
|
|||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库类型" v-else>
|
||||
<div class="shop_type_box">
|
||||
<div class="item" v-for="(item, index) in shopTypes2" :key="index"
|
||||
:class="{ active: shopTypesActive == index }" @click="changeTypeEnum(index)">
|
||||
<div class="s_title">{{ item.label }}</div>
|
||||
<div class="active_dot">
|
||||
<i class="el-icon-check"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="8" v-if="shopTypes[shopTypesActive].value == 'purveyor'">
|
||||
<el-form-item label="供应商" prop="purveyorId">
|
||||
|
|
@ -32,13 +54,13 @@
|
|||
</el-row>
|
||||
<el-row v-if="shopTypes[shopTypesActive].value == 'purveyor'">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="应收金额">
|
||||
<el-form-item label="应付金额">
|
||||
<el-input v-model="queryForm.totalAmount" placeholder="请输入应收金额"
|
||||
style="width: 220px;"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实收金额">
|
||||
<el-form-item label="实付金额">
|
||||
<el-input v-model="queryForm.paidAmount" placeholder="请输入实收金额"
|
||||
style="width: 220px;"></el-input>
|
||||
</el-form-item>
|
||||
|
|
@ -67,44 +89,90 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="$refs.shopList.show(tableData.list)">选择商品</el-button>
|
||||
<el-button type="primary" @click="$refs.ConsumableList.show(tableData.list)"
|
||||
v-if="inTabValue == 'consumable'">选择耗材</el-button>
|
||||
<el-button type="primary" @click="$refs.shopList.show(tableData.list)" v-else>选择商品</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-button type="primary" plain>
|
||||
<el-button type="primary" plain v-if="inTabValue == 'consumable'">
|
||||
共{{ tableData.list.length }}种耗材,金额合计<span style="color: red;">¥{{ queryForm.totalAmount }}</span>
|
||||
</el-button>
|
||||
<el-button type="primary" plain v-else>
|
||||
共{{ tableData.list.length }}种商品,金额合计<span style="color: red;">¥{{ queryForm.totalAmount }}</span>
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.list">
|
||||
<el-table :data="tableData.list" v-if="inTabValue == 'consumable'">
|
||||
<el-table-column label="耗材名称" prop="conName">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.conName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="进价">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.price" :min="0" controls-position="right"
|
||||
@change="consCountTotal()"></el-input-number>
|
||||
<div class="tips">原价¥{{ scope.row.costPrice }}/{{ scope.row.conUnit }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.stockNumber" :min="0" controls-position="right"
|
||||
@change="consCountTotal()"></el-input-number>
|
||||
<div class="tips">入库前:{{ scope.row.number }}{{ scope.row.conUnit }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小计">
|
||||
<template v-slot="scope">
|
||||
<!-- <el-input-number v-model="scope.row.totalAmount" :min="0"
|
||||
controls-position="right"></el-input-number> -->
|
||||
<el-input :value="formatDecimal(scope.row.price * scope.row.stockNumber)" readonly
|
||||
style="width: 100px;" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="变动后剩余库存">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.stockNumber + scope.row.number }}{{ scope.row.conUnit }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" width="80">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" @click="tableData.list.splice(scope.$index, 1)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table :data="tableData.list" v-else>
|
||||
<el-table-column type="index" width="50"></el-table-column>
|
||||
<el-table-column label="商品名称" prop="name">
|
||||
<template v-slot="scope">
|
||||
<div class="name_wrap">
|
||||
<span class="name">{{ scope.row.name }}</span>
|
||||
<el-tag type="info" v-if="scope.row.specSnap" size="mini">{{ scope.row.specSnap }}</el-tag>
|
||||
<!-- <el-tag type="info" v-if="scope.row.specSnap" size="mini">{{ scope.row.specSnap }}</el-tag> -->
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="进价">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.guidePrice" :min="0" controls-position="right"
|
||||
@change="e => scope.row.totalAmount = e * scope.row.number"></el-input-number>
|
||||
<el-input-number v-model="scope.row.costPrice" :min="0" controls-position="right"
|
||||
@change="e => { modifyPrice(); scope.row.costPrice = e }"></el-input-number>
|
||||
<div class="tips">成本价¥{{ scope.row.costPrice }}/{{ scope.row.unitName }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.number" :min="0" controls-position="right"
|
||||
@change="e => scope.row.totalAmount = e * scope.row.guidePrice"></el-input-number>
|
||||
@change="e => { modifyPrice(); scope.row.totalAmount = e }"></el-input-number>
|
||||
<div class="tips">入库前:{{ scope.row.stockNumber }}{{ scope.row.unitName }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小计">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.totalAmount" :min="0"
|
||||
controls-position="right"></el-input-number>
|
||||
<!-- <el-input-number v-model="scope.row.totalAmount" :min="0"
|
||||
controls-position="right"></el-input-number> -->
|
||||
<el-input :value="scope.row.costPrice * scope.row.number" readonly style="width: 100px;" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变动后剩余库存">
|
||||
|
|
@ -122,7 +190,10 @@
|
|||
<div>
|
||||
<el-button type="primary" @click="submitHandle" :loading="queryFormLoading">确定</el-button>
|
||||
</div>
|
||||
<!-- 选择商品 -->
|
||||
<shopList ref="shopList" @success="selectShop" />
|
||||
<!-- 选择耗材 -->
|
||||
<ConsumableList ref="ConsumableList" @success="selectConsumable" />
|
||||
<el-dialog :visible.sync="showResult" :show-close="false" :close-on-press-escape="false"
|
||||
:close-on-click-modal="false">
|
||||
<el-result icon="success" title="入库提交成功" :subTitle="`共操作${tableData.list.length}件商品`">
|
||||
|
|
@ -139,14 +210,31 @@
|
|||
|
||||
<script>
|
||||
import dayjs from 'dayjs'
|
||||
import shopList from '@/components/shopList'
|
||||
import { tbShopPurveyorGet, tbProductStockOperateOutAndOn } from '@/api/invoicing'
|
||||
import shopList from './components/shopList'
|
||||
import ConsumableList from './components/consumableList'
|
||||
import { tbShopPurveyorGet, tbProductStockOperateOutAndOn, stockInOut } from '@/api/invoicing'
|
||||
import { formatDecimal } from '@/utils'
|
||||
export default {
|
||||
components: {
|
||||
shopList
|
||||
shopList,
|
||||
ConsumableList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formatDecimal,
|
||||
inTabValue: 'goods',
|
||||
inTabs: [
|
||||
{
|
||||
label: '商品入库',
|
||||
value: 'goods',
|
||||
type: 'purveyor'
|
||||
},
|
||||
{
|
||||
label: '耗材入库',
|
||||
value: 'consumable',
|
||||
type: 'in'
|
||||
}
|
||||
],
|
||||
shopTypesActive: 0,
|
||||
shopTypes: [
|
||||
{
|
||||
|
|
@ -158,6 +246,12 @@ export default {
|
|||
value: 'purchase'
|
||||
}
|
||||
],
|
||||
shopTypes2: [
|
||||
{
|
||||
label: '供应商入库',
|
||||
value: 'purveyor'
|
||||
},
|
||||
],
|
||||
resetForm: '',
|
||||
queryFormLoading: false,
|
||||
queryForm: {
|
||||
|
|
@ -177,7 +271,7 @@ export default {
|
|||
purveyorId: [
|
||||
{
|
||||
required: true,
|
||||
message: ' ',
|
||||
message: '请选择供应商',
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
|
|
@ -201,14 +295,52 @@ export default {
|
|||
this.tbShopPurveyorGet()
|
||||
},
|
||||
methods: {
|
||||
// 切换入库内容
|
||||
tabChange(value, type) {
|
||||
console.log(type);
|
||||
this.inTabValue = value
|
||||
this.shopTypesActive = 0
|
||||
this.resetHandle()
|
||||
this.queryForm.type = type
|
||||
},
|
||||
// 计算耗材总价
|
||||
consCountTotal() {
|
||||
let zong = 0
|
||||
this.tableData.list.forEach(ele => {
|
||||
zong += ele.price * ele.stockNumber
|
||||
})
|
||||
this.queryForm.totalAmount = formatDecimal(zong)
|
||||
},
|
||||
// 计算商品总价
|
||||
modifyPrice() {
|
||||
let zong = 0
|
||||
this.tableData.list.forEach(ele => {
|
||||
zong += ele.costPrice * ele.number
|
||||
})
|
||||
this.queryForm.totalAmount = formatDecimal(zong)
|
||||
},
|
||||
// 提交
|
||||
submitHandle() {
|
||||
this.$refs.queryForm.validate(async valid => {
|
||||
if (valid) {
|
||||
try {
|
||||
this.queryFormLoading = true
|
||||
this.queryForm.list = this.tableData.list
|
||||
await tbProductStockOperateOutAndOn(this.queryForm)
|
||||
switch (this.inTabValue) {
|
||||
case 'goods':
|
||||
this.queryForm.list = this.tableData.list
|
||||
await tbProductStockOperateOutAndOn(this.queryForm)
|
||||
break;
|
||||
case 'consumable':
|
||||
this.queryForm.accountsPayable = this.queryForm.totalAmount
|
||||
this.queryForm.actualPayment = this.queryForm.paidAmount
|
||||
this.queryForm.paymentTime = this.queryForm.paidAt
|
||||
this.queryForm.supplierId = this.queryForm.purveyorId
|
||||
this.queryForm.list = this.tableData.list
|
||||
await stockInOut(this.queryForm)
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.queryFormLoading = false
|
||||
this.showResult = true
|
||||
} catch (error) {
|
||||
|
|
@ -218,6 +350,16 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
// 选择耗材
|
||||
selectConsumable(res) {
|
||||
this.tableData.list = res.map(item => {
|
||||
item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true)
|
||||
item.stockNumber = 0
|
||||
item.costPrice = item.price
|
||||
item.conInfold = item.id
|
||||
return item
|
||||
})
|
||||
},
|
||||
// 选择商品
|
||||
selectShop(res) {
|
||||
let arr = []
|
||||
|
|
@ -241,6 +383,7 @@ export default {
|
|||
this.showResult = false
|
||||
this.queryForm = { ...this.resetForm }
|
||||
this.tableData.list = []
|
||||
this.$refs.queryForm.resetFields()
|
||||
},
|
||||
// 切换类型
|
||||
changeTypeEnum(index) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,18 @@
|
|||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-form ref="queryForm" :model="queryForm" :rules="queryRules" label-position="left" label-width="80px">
|
||||
<el-form-item label="出库类型">
|
||||
<el-form-item label="出库内容">
|
||||
<div class="shop_type_box">
|
||||
<div class="item" v-for="item in inTabs" :key="item.value"
|
||||
:class="{ active: inTabValue == item.value }" @click="tabChange(item.value, item.type)">
|
||||
<div class="s_title">{{ item.label }}</div>
|
||||
<div class="active_dot">
|
||||
<i class="el-icon-check"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="出库类型" v-if="inTabValue == 'goods'">
|
||||
<div class="shop_type_box">
|
||||
<div class="item" v-for="(item, index) in shopTypes" :key="index"
|
||||
:class="{ active: shopTypesActive == index }" @click="changeTypeEnum(index)">
|
||||
|
|
@ -13,6 +24,17 @@
|
|||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="出库类型" v-else>
|
||||
<div class="shop_type_box">
|
||||
<div class="item" v-for="(item, index) in shopTypes2" :key="index"
|
||||
:class="{ active: shopTypesActive == index }" @click="changeTypeEnum(index)">
|
||||
<div class="s_title">{{ item.label }}</div>
|
||||
<div class="active_dot">
|
||||
<i class="el-icon-check"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="8" v-if="shopTypes[shopTypesActive].value == 'reject'">
|
||||
<el-form-item label="供应商" prop="purveyorId">
|
||||
|
|
@ -39,7 +61,8 @@
|
|||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实收金额">
|
||||
<el-input v-model="queryForm.paidAmount" placeholder="请输入实收金额" style="width: 220px;"></el-input>
|
||||
<el-input v-model="queryForm.paidAmount" placeholder="请输入实收金额"
|
||||
style="width: 220px;"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
@ -53,7 +76,8 @@
|
|||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="批号">
|
||||
<el-input v-model="queryForm.batchNumber" placeholder="请输入批号" style="width: 220px;"></el-input>
|
||||
<el-input v-model="queryForm.batchNumber" placeholder="请输入批号"
|
||||
style="width: 220px;"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
@ -65,7 +89,9 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="$refs.shopList.show(tableData.list)">选择商品</el-button>
|
||||
<el-button type="primary" @click="$refs.ConsumableList.show(tableData.list)"
|
||||
v-if="inTabValue == 'consumable'">选择耗材</el-button>
|
||||
<el-button type="primary" @click="$refs.shopList.show(tableData.list)" v-else>选择商品</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
|
@ -75,7 +101,46 @@
|
|||
</el-button>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.list">
|
||||
<el-table :data="tableData.list" v-if="inTabValue == 'consumable'">
|
||||
<el-table-column label="耗材名称" prop="conName">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.conName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="进价">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.price" :min="0" controls-position="right"
|
||||
@change="consCountTotal()"></el-input-number>
|
||||
<div class="tips">原价¥{{ scope.row.costPrice }}/{{ scope.row.conUnit }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.stockNumber" :min="0" controls-position="right"
|
||||
@change="consCountTotal()"></el-input-number>
|
||||
<div class="tips">出库前:{{ scope.row.number }}{{ scope.row.conUnit }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小计">
|
||||
<template v-slot="scope">
|
||||
<!-- <el-input-number v-model="scope.row.totalAmount" :min="0"
|
||||
controls-position="right"></el-input-number> -->
|
||||
<el-input :value="formatDecimal(scope.row.price * scope.row.stockNumber)" readonly
|
||||
style="width: 100px;" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="变动后剩余库存">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.stockNumber - scope.row.number }}{{ scope.row.conUnit }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" width="80">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" @click="tableData.list.splice(scope.$index, 1)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table :data="tableData.list" v-else>
|
||||
<el-table-column type="index" width="50"></el-table-column>
|
||||
<el-table-column label="商品名称" prop="name">
|
||||
<template v-slot="scope">
|
||||
|
|
@ -87,22 +152,23 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="进价">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.guidePrice" :min="0" controls-position="right"
|
||||
@change="e => scope.row.totalAmount = e * scope.row.number"></el-input-number>
|
||||
<el-input-number v-model="scope.row.costPrice" :min="0" controls-position="right"
|
||||
@change="e => { modifyPrice(); scope.row.costPrice = e }"></el-input-number>
|
||||
<div class="tips">成本价¥{{ scope.row.costPrice }}/{{ scope.row.unitName }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.number" :min="0" controls-position="right"
|
||||
@change="e => scope.row.totalAmount = e * scope.row.guidePrice"></el-input-number>
|
||||
@change="e => { modifyPrice(); scope.row.totalAmount = e }"></el-input-number>
|
||||
<div class="tips">出库前:{{ scope.row.stockNumber }}{{ scope.row.unitName }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小计">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.totalAmount" :min="0"
|
||||
controls-position="right"></el-input-number>
|
||||
<!-- <el-input-number v-model="scope.row.totalAmount" :min="0"
|
||||
controls-position="right"></el-input-number> -->
|
||||
<el-input :value="scope.row.costPrice * scope.row.number" readonly style="width: 100px;" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变动后剩余库存">
|
||||
|
|
@ -120,7 +186,10 @@
|
|||
<div>
|
||||
<el-button type="primary" @click="submitHandle" :loading="queryFormLoading">确定</el-button>
|
||||
</div>
|
||||
<!-- 选择商品 -->
|
||||
<shopList ref="shopList" @success="selectShop" />
|
||||
<!-- 选择耗材 -->
|
||||
<ConsumableList ref="ConsumableList" @success="selectConsumable" />
|
||||
<el-dialog :visible.sync="showResult" :show-close="false" :close-on-press-escape="false"
|
||||
:close-on-click-modal="false">
|
||||
<el-result icon="success" title="出库提交成功" :subTitle="`共操作${tableData.list.length}件商品`">
|
||||
|
|
@ -137,14 +206,31 @@
|
|||
|
||||
<script>
|
||||
import dayjs from 'dayjs'
|
||||
import shopList from '@/components/shopList'
|
||||
import { tbShopPurveyorGet, tbProductStockOperateOutAndOn } from '@/api/invoicing'
|
||||
import shopList from './components/shopList'
|
||||
import ConsumableList from './components/consumableList'
|
||||
import { tbShopPurveyorGet, tbProductStockOperateOutAndOn, stockInOut } from '@/api/invoicing'
|
||||
import { formatDecimal } from '@/utils'
|
||||
export default {
|
||||
components: {
|
||||
shopList
|
||||
shopList,
|
||||
ConsumableList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formatDecimal,
|
||||
inTabValue: 'goods',
|
||||
inTabs: [
|
||||
{
|
||||
label: '商品出库',
|
||||
value: 'goods',
|
||||
type: 'reject'
|
||||
},
|
||||
{
|
||||
label: '耗材出库',
|
||||
value: 'consumable',
|
||||
type: 'out'
|
||||
}
|
||||
],
|
||||
shopTypesActive: 0,
|
||||
shopTypes: [
|
||||
{
|
||||
|
|
@ -156,6 +242,12 @@ export default {
|
|||
value: 'other-out'
|
||||
}
|
||||
],
|
||||
shopTypes2: [
|
||||
{
|
||||
label: '供应商退货',
|
||||
value: 'reject'
|
||||
}
|
||||
],
|
||||
resetForm: '',
|
||||
queryFormLoading: false,
|
||||
queryForm: {
|
||||
|
|
@ -169,7 +261,7 @@ export default {
|
|||
time: dayjs().format('YYYY-MM-DD'),
|
||||
totalAmount: 0,
|
||||
type: 'reject',
|
||||
shopId: localStorage.getItem('shopId')
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
},
|
||||
queryRules: {
|
||||
purveyorId: [
|
||||
|
|
@ -199,14 +291,52 @@ export default {
|
|||
this.tbShopPurveyorGet()
|
||||
},
|
||||
methods: {
|
||||
// 切换入库内容
|
||||
tabChange(value, type) {
|
||||
this.inTabValue = value
|
||||
this.shopTypesActive = 0
|
||||
this.resetHandle()
|
||||
this.queryForm.type = type
|
||||
},
|
||||
// 计算耗材总价
|
||||
consCountTotal() {
|
||||
let zong = 0
|
||||
this.tableData.list.forEach(ele => {
|
||||
zong += ele.price * ele.stockNumber
|
||||
})
|
||||
this.queryForm.totalAmount = formatDecimal(zong)
|
||||
},
|
||||
// 计算商品总价
|
||||
modifyPrice() {
|
||||
let zong = 0
|
||||
this.tableData.list.forEach(ele => {
|
||||
zong += ele.costPrice * ele.number
|
||||
})
|
||||
this.queryForm.totalAmount = zong
|
||||
},
|
||||
// 提交
|
||||
submitHandle() {
|
||||
this.$refs.queryForm.validate(async valid => {
|
||||
if (valid) {
|
||||
try {
|
||||
this.queryFormLoading = true
|
||||
this.queryForm.list = this.tableData.list
|
||||
await tbProductStockOperateOutAndOn(this.queryForm)
|
||||
switch (this.inTabValue) {
|
||||
case 'goods':
|
||||
this.queryForm.list = this.tableData.list
|
||||
await tbProductStockOperateOutAndOn(this.queryForm)
|
||||
break;
|
||||
case 'consumable':
|
||||
this.queryForm.accountsPayable = this.queryForm.totalAmount
|
||||
this.queryForm.actualPayment = this.queryForm.paidAmount
|
||||
this.queryForm.paymentTime = this.queryForm.paidAt
|
||||
this.queryForm.supplierId = this.queryForm.purveyorId
|
||||
this.queryForm.list = this.tableData.list
|
||||
this.queryForm.type = 'out'
|
||||
await stockInOut(this.queryForm)
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.queryFormLoading = false
|
||||
this.showResult = true
|
||||
} catch (error) {
|
||||
|
|
@ -216,6 +346,16 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
// 选择耗材
|
||||
selectConsumable(res) {
|
||||
this.tableData.list = res.map(item => {
|
||||
item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true)
|
||||
item.stockNumber = 0
|
||||
item.costPrice = item.price
|
||||
item.conInfold = item.id
|
||||
return item
|
||||
})
|
||||
},
|
||||
// 选择商品
|
||||
selectShop(res) {
|
||||
let arr = []
|
||||
|
|
@ -239,6 +379,7 @@ export default {
|
|||
this.showResult = false
|
||||
this.queryForm = { ...this.resetForm }
|
||||
this.tableData.list = []
|
||||
this.$refs.queryForm.resetFields()
|
||||
},
|
||||
// 切换类型
|
||||
changeTypeEnum(index) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,165 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<div class="filter_wrap">
|
||||
<el-input v-model="query.name" size="small" clearable placeholder="供应商"
|
||||
@keyup.enter.native="getTableData" style="width: 200px;" />
|
||||
<el-select v-model="query.type" placeholder="选择类型">
|
||||
<el-option label="进货" value="purveyor"></el-option>
|
||||
<el-option label="退货" value="reject"></el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="$refs.addSupplier.show()">添加供应商</el-button>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.list" v-loading="tableData.loading">
|
||||
<el-table-column label="供应商" prop="purveyorName"></el-table-column>
|
||||
<el-table-column label="联系电话" prop="purveyorTelephone"></el-table-column>
|
||||
<el-table-column label="地址" prop="address"></el-table-column>
|
||||
<!-- <el-table-column label="标签" prop="tip"></el-table-column> -->
|
||||
<el-table-column label="备注" prop="remark"></el-table-column>
|
||||
<el-table-column label="剩余付款金额" prop="waitAmount">
|
||||
<template v-slot="scope">
|
||||
<span class="num">
|
||||
¥{{ scope.row.waitAmount }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="待付款笔数" prop="waitCount">
|
||||
<template v-slot="scope">
|
||||
<template v-if="scope.row.waitCount > 0">
|
||||
有<span class="count">{{ scope.row.waitCount }}笔</span>未付
|
||||
</template>
|
||||
<template v-else>-</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="type">
|
||||
<template v-slot="scope">
|
||||
<el-tag :type="scope.row.type == 0 ? 'warning' : 'success'">
|
||||
{{ scope.row.type == 0 ? '待支付' : '已完结' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上笔进货日期" prop="lastTransactAt">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.lastTransactAt && dayjs(scope.row.lastTransactAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="250">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" size="mini" round icon="el-icon-edit"
|
||||
@click="$refs.addSupplier.show(scope.row)">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delHandle([scope.row.id])">
|
||||
<el-button type="text" size="mini" round icon="el-icon-delete" slot="reference">
|
||||
删除
|
||||
</el-button>
|
||||
</el-popconfirm>
|
||||
<router-link :to="{ name: 'purchase_detail', query: { purveyorId: scope.row.id } }">
|
||||
<el-button type="text" size="mini">结款记录</el-button>
|
||||
</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" @size-change="pagesizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
<addSupplier ref="addSupplier" @success="getTableData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dayjs from 'dayjs'
|
||||
import { tbShopPurveyorGets, tbShopPurveyor } from '@/api/invoicing'
|
||||
import addSupplier from './components/addSupplier'
|
||||
export default {
|
||||
components: {
|
||||
addSupplier
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dayjs,
|
||||
query: {
|
||||
name: '',
|
||||
type: ""
|
||||
},
|
||||
tableData: {
|
||||
page: 0,
|
||||
size: 10,
|
||||
total: 0,
|
||||
sort: 'id',
|
||||
loading: false,
|
||||
list: []
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
// 删除
|
||||
async delHandle(ids) {
|
||||
try {
|
||||
await tbShopPurveyor(ids, 'delete')
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: `删除成功`,
|
||||
type: 'success'
|
||||
});
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await tbShopPurveyorGets({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
sort: this.tableData.sort,
|
||||
purveyorName: this.query.name,
|
||||
type: this.query.type,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.list = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query.name = ''
|
||||
this.query.type = ''
|
||||
this.tableData.page = 0;
|
||||
this.getTableData()
|
||||
},
|
||||
pagesizeChange(e) {
|
||||
this.tableData.size = e
|
||||
this.tableData.page = 0;
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.num {
|
||||
color: #F56C6C;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.count {
|
||||
color: #409EFF;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -5,7 +5,8 @@
|
|||
<el-input v-model="query.name" clearable placeholder="供应商" @keyup.enter.native="getTableData"
|
||||
style="width: 200px;" />
|
||||
<el-select v-model="query.type" placeholder="付款状态">
|
||||
<el-option :label="item.label" :value="item.value" v-for="item in types" :key="item.id"></el-option>
|
||||
<el-option label="待支付" value="0"></el-option>
|
||||
<el-option label="已完结" value="1"></el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
|
|
@ -37,7 +38,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="上笔进货日期" prop="lastTransactAt">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.lastTransactAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
{{ scope.row.lastTransactAt && dayjs(scope.row.lastTransactAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="80">
|
||||
|
|
@ -77,7 +78,6 @@ export default {
|
|||
}
|
||||
},
|
||||
mounted() {
|
||||
this.dictDetail()
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -111,14 +111,6 @@ export default {
|
|||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
async dictDetail() {
|
||||
const { content } = await dictDetail({
|
||||
dictName: 'purveyor_transact_status',
|
||||
size: 100,
|
||||
page: 0
|
||||
})
|
||||
this.types = content
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<div class="head-container">
|
||||
<el-radio-group v-model="query.time" @change="timeChange">
|
||||
<el-radio-button :label="item.value" v-for="item in timeList" :key="item.label">{{ item.label
|
||||
}}</el-radio-button>
|
||||
}}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div class="head-container" v-if="query.time == 'custom'">
|
||||
|
|
@ -13,8 +13,13 @@
|
|||
</div>
|
||||
<div class="head-container">
|
||||
<div class="filter_wrap">
|
||||
<el-select v-model="query.type" placeholder="付款状态">
|
||||
<el-option :label="item.label" :value="item.value" v-for="item in types" :key="item.id"></el-option>
|
||||
<el-select v-model="query.status" placeholder="付款状态">
|
||||
<el-option label="待支付" value="0"></el-option>
|
||||
<el-option label="已付款" value="1"></el-option>
|
||||
</el-select>
|
||||
<el-select v-model="query.type" placeholder="选择类型">
|
||||
<el-option label="进货" value="purveyor"></el-option>
|
||||
<el-option label="退货" value="reject"></el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
|
|
@ -60,7 +65,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<!-- <div class="head-container">
|
||||
<div class="select_count_wrap">
|
||||
<div class="select_count">
|
||||
<i class="icon el-icon-warning"></i>
|
||||
|
|
@ -70,7 +75,7 @@
|
|||
</div>
|
||||
<el-button>批量付款</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.list" v-loading="tableData.loading" @select="selectHandle"
|
||||
@select-all="selectHandle">
|
||||
|
|
@ -82,52 +87,104 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="类型" prop="type">
|
||||
<template v-slot="scope">
|
||||
进货单
|
||||
{{ scope.row.type | typeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总金额" prop="totalAmount">
|
||||
<el-table-column label="应付金额" prop="totalAmount">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.totalAmount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="已付款金额" prop="totalAmount">
|
||||
<template v-slot="scope">
|
||||
<span style="color: #47B505;">
|
||||
¥{{ scope.row.paidAmount }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="待付款金额" prop="waitAmount">
|
||||
<template v-slot="scope">
|
||||
<span class="num" v-if="scope.row.waitAmount > 0">¥{{ scope.row.waitAmount }}</span>
|
||||
<span v-else>-</span>
|
||||
<span class="num"> ¥{{ scope.row.waitAmount }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="info">{{ types.find(item => item.value == scope.row.status).label }}</el-tag>
|
||||
<el-tag type="info">
|
||||
{{ types.find(item => item.value == scope.row.status).label }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款方式" prop="payType"></el-table-column>
|
||||
<el-table-column label="备注" prop="remark"></el-table-column>
|
||||
<el-table-column label="付款时间" prop="updatedAt">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.paidAt && dayjs(scope.row.paidAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="80">
|
||||
<el-table-column label="操作" align="center">
|
||||
<template v-slot="scope">
|
||||
<router-link :to="{ name: 'purchase_detail', query: { purveyorId: scope.row.purveyorId } }">
|
||||
<el-button type="text" size="mini">查看详情</el-button>
|
||||
</router-link>
|
||||
<el-button type="text" size="mini" round @click="Uppop(scope.row.id)">付款</el-button>
|
||||
<el-button type="text" size="mini"
|
||||
@click="typedialogshowsumbit(scope.row.id)">账单付款记录</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
<!-- 付款弹窗组件 -->
|
||||
<el-dialog title="" :visible.sync="dialogTableVisible" width="350px">
|
||||
<el-form :rules="rules" ref="ruleForm" :model="ruleForm">
|
||||
<el-form-item label="付款金额" label-width="80px" prop="montey">
|
||||
<el-input v-model="ruleForm.montey" placeholder="请输入金额" type="number" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="付款方式" label-width="80px">
|
||||
<el-input v-model="ruleForm.payType" placeholder="请输入付款方式" type="text"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" label-width="80px">
|
||||
<el-input v-model="ruleForm.remark" placeholder="请输备注" type="text" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogTableVisible = false; ruleForm.montey = ''; ruleForm.payType = ''">取
|
||||
消</el-button>
|
||||
<el-button type="primary" @click="sumbit('ruleForm')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog title="账单付款记录" :visible.sync="typedialogshow">
|
||||
<div class="head-container">
|
||||
<el-input v-model="querytypedialogshow.type" size="small" clearable placeholder="支付方式"
|
||||
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableDatatype" />
|
||||
<div style="margin-top: 10px;">
|
||||
<el-button type="primary" @click="getTableDatatype">查询</el-button>
|
||||
<el-button @click="resetHandletype">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table ref="table" :data="tableDatatype.data" v-loading="tableDatatype.loading" row-key="id">
|
||||
<el-table-column label="支付方式" prop="payType" />
|
||||
<el-table-column label="支付金额" prop="paidAmount" />
|
||||
<el-table-column label="备注" prop="remark" />
|
||||
<el-table-column label="创建时间" prop="createTime">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dayjs from 'dayjs'
|
||||
import { tbShopPurveyorTransactInfo, dictDetail, tbShopPurveyorTransactSum } from '@/api/invoicing'
|
||||
import { tbShopPurveyorTransactInfo, paidAmount, dictDetail, tbShopPurveyorTransactSum, tbShopPurveyorTransacttransactPayInfos } from '@/api/invoicing'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 付款当前的id
|
||||
idinfo: "",
|
||||
dayjs,
|
||||
dialogTableVisible: false,
|
||||
timeList: [
|
||||
{
|
||||
label: '全部',
|
||||
|
|
@ -162,10 +219,29 @@ export default {
|
|||
value: 'custom'
|
||||
}
|
||||
],
|
||||
types: [],
|
||||
types: [
|
||||
{
|
||||
value: 0,
|
||||
label: '待付款'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '已付款'
|
||||
},
|
||||
{
|
||||
value: '-1',
|
||||
label: '作废'
|
||||
}
|
||||
],
|
||||
ruleForm: {
|
||||
montey: null,
|
||||
payType: null,
|
||||
remark: ""
|
||||
},
|
||||
selectCount: 0,
|
||||
query: {
|
||||
type: '',
|
||||
status: '',
|
||||
time: 'all',
|
||||
createdAt: []
|
||||
},
|
||||
|
|
@ -177,15 +253,65 @@ export default {
|
|||
loading: false,
|
||||
list: []
|
||||
},
|
||||
info: ''
|
||||
info: '',
|
||||
rules: {
|
||||
montey: [
|
||||
{ required: true, message: '请输入金额', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
typedialogshow: false,//查看详情
|
||||
querytypedialogshow: {
|
||||
type: '',
|
||||
id: ''
|
||||
},
|
||||
tableDatatype: {
|
||||
page: 0,
|
||||
size: 10,
|
||||
total: 0,
|
||||
loading: false,
|
||||
list: []
|
||||
}
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
typeFilter(t) {
|
||||
const m = {
|
||||
purveyor: '进货单',
|
||||
reject: '退货单',
|
||||
cons_in: '耗材入库',
|
||||
cons_out: '耗材出库'
|
||||
}
|
||||
return m[t]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.dictDetail()
|
||||
this.getTableData()
|
||||
this.tbShopPurveyorTransactSum()
|
||||
},
|
||||
methods: {
|
||||
Uppop(id) {
|
||||
this.dialogTableVisible = true
|
||||
this.idinfo = id
|
||||
},
|
||||
sumbit(formName) {
|
||||
this.$refs[formName].validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.dialogTableVisible = false
|
||||
const res = await paidAmount({
|
||||
id: this.idinfo,
|
||||
paidAmount: this.ruleForm.montey,
|
||||
payType: this.ruleForm.payType,
|
||||
remark: this.ruleForm.remark
|
||||
})
|
||||
this.$message({ type: 'success', message: '付款成功!' });
|
||||
this.ruleForm.montey = ''
|
||||
this.ruleForm.payType = ''
|
||||
this.getTableData()
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
|
|
@ -194,13 +320,14 @@ export default {
|
|||
size: this.tableData.size,
|
||||
sort: this.tableData.sort,
|
||||
purveyorId: this.$route.query.purveyorId,
|
||||
status: this.query.type,
|
||||
type: 'purveyor',
|
||||
createdAt: this.query.createdAt
|
||||
status: this.query.status,
|
||||
type: this.query.type,
|
||||
createdAt: this.query.createdAt,
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.list = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
this.tbShopPurveyorTransactSum()
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
|
@ -210,6 +337,8 @@ export default {
|
|||
this.query.time = 'all'
|
||||
this.query.createdAt = []
|
||||
this.tableData.page = 0;
|
||||
this.query.type = ''
|
||||
this.query.status = ''
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
|
|
@ -217,14 +346,6 @@ export default {
|
|||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
async dictDetail() {
|
||||
const { content } = await dictDetail({
|
||||
dictName: 'purveyor_transact_status',
|
||||
size: 100,
|
||||
page: 0
|
||||
})
|
||||
this.types = content
|
||||
},
|
||||
// 选择时间
|
||||
timeChange(e) {
|
||||
this.query.createdAt = []
|
||||
|
|
@ -259,8 +380,41 @@ export default {
|
|||
this.selectCount = selection.length
|
||||
},
|
||||
async tbShopPurveyorTransactSum() {
|
||||
this.info = await tbShopPurveyorTransactSum({ purveyorId: this.$route.query.purveyorId, type: 'purveyor' })
|
||||
}
|
||||
this.info = await tbShopPurveyorTransactSum({ purveyorId: this.$route.query.purveyorId, type: this.query.type })
|
||||
},
|
||||
//记录分页
|
||||
paginationChangetype(e) {
|
||||
this.tableDatatype.page = e - 1
|
||||
this.getTableDatatype()
|
||||
},
|
||||
// 记录重置查询
|
||||
resetHandletype() {
|
||||
this.querytypedialogshow.type = ''
|
||||
this.tableData.page = 0
|
||||
this.getTableDatatype()
|
||||
},
|
||||
typedialogshowsumbit(ID) {
|
||||
this.querytypedialogshow.id = ID
|
||||
this.getTableDatatype()
|
||||
},
|
||||
//记录列表
|
||||
async getTableDatatype() {
|
||||
this.tableDatatype.loading = true
|
||||
try {
|
||||
const res = await tbShopPurveyorTransacttransactPayInfos({
|
||||
// page: this.tableDatatype.page,
|
||||
// size: this.tableDatatype.size,
|
||||
type: this.querytypedialogshow.type,
|
||||
id: this.querytypedialogshow.id
|
||||
})
|
||||
this.typedialogshow = true
|
||||
this.tableDatatype.loading = false
|
||||
this.tableDatatype.data = res
|
||||
this.tableDatatype.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -347,4 +501,9 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
<!-- <style>
|
||||
/deep/ .el-dialog__body{
|
||||
padding-right: 20px!important;
|
||||
}
|
||||
</style> -->
|
||||
|
|
@ -5,7 +5,8 @@
|
|||
<el-input v-model="query.name" clearable placeholder="供应商" @keyup.enter.native="getTableData"
|
||||
style="width: 200px;" />
|
||||
<el-select v-model="query.type" placeholder="付款状态">
|
||||
<el-option :label="item.label" :value="item.value" v-for="item in types" :key="item.id"></el-option>
|
||||
<el-option label="待支付" value="0"></el-option>
|
||||
<el-option label="已完结" value="1"></el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
|
|
@ -37,7 +38,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="上笔进货日期" prop="lastTransactAt">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.lastTransactAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
{{ scope.row.lastTransactAt && dayjs(scope.row.lastTransactAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="80">
|
||||
|
|
@ -50,13 +51,14 @@
|
|||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
@current-change="paginationChange" @size-change="pagesizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dayjs from 'dayjs'
|
||||
import { tbShopPurveyorTransactGet, dictDetail } from '@/api/invoicing'
|
||||
import { tbShopPurveyorTransactGet } from '@/api/invoicing'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -77,7 +79,6 @@ export default {
|
|||
}
|
||||
},
|
||||
mounted() {
|
||||
this.dictDetail()
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -112,13 +113,9 @@ export default {
|
|||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
async dictDetail() {
|
||||
const { content } = await dictDetail({
|
||||
dictName: 'purveyor_transact_status',
|
||||
size: 100,
|
||||
page: 0
|
||||
})
|
||||
this.types = content
|
||||
pagesizeChange(e) {
|
||||
this.tableData.size = e
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<div class="filter_wrap">
|
||||
<el-input v-model="query.name" size="small" clearable placeholder="供应商" @keyup.enter.native="getTableData"
|
||||
style="width: 200px;" />
|
||||
<el-input v-model="query.name" size="small" clearable placeholder="供应商"
|
||||
@keyup.enter.native="getTableData" style="width: 200px;" />
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</div>
|
||||
|
|
@ -32,7 +32,8 @@
|
|||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
@current-change="paginationChange" @size-change="pagesizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
<addSupplier ref="addSupplier" @success="getTableData" />
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -100,6 +101,10 @@ export default {
|
|||
this.tableData.page = 0;
|
||||
this.getTableData()
|
||||
},
|
||||
pagesizeChange(e) {
|
||||
this.tableData.size = e
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="foot">退款:¥-{{ item.refundAmount }}</div>
|
||||
<div class="foot">退款:¥-{{ item.orderAmount }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,296 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-form :model="query" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="query.orderNo" placeholder="订单号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="query.payType" placeholder="支付类型">
|
||||
<el-option label="微信支付" value="wechatPay" />
|
||||
<el-option label="支付宝支付" value="aliPay" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="query.phone" placeholder="联系电话"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="query.proName" placeholder="商品名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="query.status" placeholder="状态">
|
||||
<el-option label="待付款" value="unpaid" />
|
||||
<el-option label="待使用" value="unused" />
|
||||
<el-option label="已完成" value="closed" />
|
||||
<el-option label="退款中" value="refunding" />
|
||||
<el-option label="已退款" value="refund" />
|
||||
<el-option label="已取消" value="cancelled" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-date-picker v-model="query.createdAt" type="daterange" range-separator="至"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']"
|
||||
value-format="yyyy-MM-dd HH:mm:ss">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.data" v-loading="tableData.loading">
|
||||
<el-table-column label="订单号" prop="orderNo"></el-table-column>
|
||||
<el-table-column label="团购卷名称" prop="proName"></el-table-column>
|
||||
<el-table-column label="到期日期" prop="expDate"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime"></el-table-column>
|
||||
<el-table-column label="下单数量" prop="number"></el-table-column>
|
||||
<el-table-column label="已退数量" prop="refundNumber"></el-table-column>
|
||||
<el-table-column label="订单金额" prop="orderAmount">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.orderAmount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付金额" prop="payAmount">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.payAmount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付方式" prop="payType">
|
||||
<template v-slot="scope">
|
||||
{{ payF(scope.row.payType) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="下单人电话" prop="phone"></el-table-column>
|
||||
<el-table-column label="是否支持退款" prop="refundAble">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.refundAble ? "是" : "否" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="remark"></el-table-column>
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template v-slot="scope">
|
||||
<el-tag :type="statusF(scope.row.status)">
|
||||
{{ scope.row.status }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交易日期" prop="tradeDay"></el-table-column>
|
||||
<el-table-column label="核销员" prop="verifier"></el-table-column>
|
||||
<!-- <el-table-column label="操作" width="100">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" icon="el-icon-edit" @click="showRefund(scope.row)"
|
||||
:disabled="!scope.row.refundAble">退款</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
</div>
|
||||
<el-dialog title="退款" :visible.sync="showDialog" width="400px">
|
||||
<el-form ref="refundForm" :model="refundForm" :rules="refundFormRules" label-position="top">
|
||||
<el-form-item label="退单数" prop="num">
|
||||
<el-select v-model="refundForm.num" placeholder="请选择退单数" style="width: 100%;"
|
||||
@change="refundNumChange">
|
||||
<el-option :label="item" :value="item" v-for="item in refundNumList" :key="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="退单金额">
|
||||
<el-input v-model="refundForm.refundAmount" disabled placeholder="请选择退单数"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="退款原因">
|
||||
<el-input v-model="refundForm.refundReason" type="textarea" placeholder="请输入退款原因"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="showDialog = false">取消</el-button>
|
||||
<el-button type="primary" :loading="refundLoading" @click="refundConfirm">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { tbGroupOrderInfo, returnGpOrder } from "@/api/order";
|
||||
import dayjs from "dayjs";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
query: {
|
||||
orderNo: "",
|
||||
payType: "",
|
||||
phone: "",
|
||||
proName: "",
|
||||
status: "",
|
||||
createTime: []
|
||||
},
|
||||
resetQuery: "",
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 10,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
payTypes: [
|
||||
{
|
||||
value: "wechatPay",
|
||||
label: "微信支付"
|
||||
},
|
||||
{
|
||||
value: "aliPay",
|
||||
label: "支付宝支付"
|
||||
}
|
||||
],
|
||||
statusList: [
|
||||
{
|
||||
value: "unpaid",
|
||||
label: "待付款",
|
||||
type: "warning"
|
||||
},
|
||||
{
|
||||
value: "unused",
|
||||
label: "待使用",
|
||||
type: "primary"
|
||||
},
|
||||
{
|
||||
value: "closed",
|
||||
label: "已完成",
|
||||
type: "success"
|
||||
},
|
||||
{
|
||||
value: "refunding",
|
||||
label: "退款中",
|
||||
type: "warning"
|
||||
},
|
||||
{
|
||||
value: "refund",
|
||||
label: "已退款",
|
||||
type: "default"
|
||||
},
|
||||
{
|
||||
value: "cancelled",
|
||||
label: "已取消",
|
||||
type: "danger"
|
||||
}
|
||||
],
|
||||
row: '',
|
||||
showDialog: false,
|
||||
refundNumList: [],
|
||||
refundLoading: false,
|
||||
refundForm: {
|
||||
num: '',
|
||||
orderId: '',
|
||||
refundAmount: '',
|
||||
refundDesc: '',
|
||||
refundReason: ''
|
||||
},
|
||||
refundFormRules: {
|
||||
num: [
|
||||
{
|
||||
required: true,
|
||||
message: ' ',
|
||||
trigger: 'change'
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
timeFilter(s) {
|
||||
return dayjs(s).format("YYYY-MM-DD HH:mm:ss");
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData();
|
||||
this.resetQuery = { ...this.query };
|
||||
},
|
||||
methods: {
|
||||
// 提交退单
|
||||
refundConfirm() {
|
||||
this.$refs.refundForm.validate(async valid => {
|
||||
if (valid) {
|
||||
try {
|
||||
this.refundLoading = true
|
||||
const res = await returnGpOrder(this.refundForm)
|
||||
this.refundLoading = false
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: `退单成功`,
|
||||
type: 'success'
|
||||
});
|
||||
this.showDialog = false
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
this.refundLoading = false
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 计算退单金额
|
||||
refundNumChange(e) {
|
||||
this.refundForm.refundAmount = Math.floor(this.row.orderAmount / e * 100) / 100
|
||||
},
|
||||
// 显示退款
|
||||
showRefund(row) {
|
||||
this.row = row
|
||||
let arr = []
|
||||
for (let i = 1; i <= row.number - row.refundNumber; i++) {
|
||||
arr.push(i)
|
||||
}
|
||||
this.refundNumList = arr
|
||||
this.refundForm.orderId = row.id
|
||||
this.showDialog = true
|
||||
},
|
||||
payF(p) {
|
||||
return p && this.payTypes.find(item => item.value == p).label;
|
||||
},
|
||||
statusF(t) {
|
||||
return t && this.statusList.find(item => item.label == t).type;
|
||||
},
|
||||
// 切换状态
|
||||
async statusChange(e, row) {
|
||||
try {
|
||||
this.tableData.loading = true;
|
||||
const data = { ...row };
|
||||
data.status = e;
|
||||
await tbPrintMachine(data, "put");
|
||||
this.getTableData();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
this.tableData.loading = false;
|
||||
}
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query = { ...this.resetQuery };
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1;
|
||||
this.getTableData();
|
||||
},
|
||||
// 获取列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true;
|
||||
try {
|
||||
const res = await tbGroupOrderInfo({
|
||||
...this.query,
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
sort: "id"
|
||||
});
|
||||
this.tableData.loading = false;
|
||||
this.tableData.data = res.content;
|
||||
this.tableData.total = res.totalElements;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
</div>
|
||||
<div class="head-container">
|
||||
<div class="collect_wrap">
|
||||
<div class="item">
|
||||
<!-- <div class="item">
|
||||
<div class="icon_wrap" style="--bg-color:#C978EE">
|
||||
<i class="icon el-icon-s-goods"></i>
|
||||
</div>
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
<div class="m">¥{{ payCountTotal }}</div>
|
||||
<div class="t">总金额</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="item" v-for="item in payCountList" :key="item.payType">
|
||||
<div class="icon_wrap" style="--bg-color:#fff">
|
||||
<el-image class="img" :src="item.icon"></el-image>
|
||||
|
|
@ -123,10 +123,8 @@
|
|||
{{ item.productName }}
|
||||
<span
|
||||
class="refund"
|
||||
v-if="
|
||||
item.status == 'refunding' || item.status == 'refund'
|
||||
"
|
||||
>(退 - {{ item.num }})</span
|
||||
v-if="item.refundNumber"
|
||||
>(退 - {{ item.refundNumber }})</span
|
||||
>
|
||||
</div>
|
||||
<div class="sku">{{ item.productSkuName }}</div>
|
||||
|
|
@ -135,18 +133,19 @@
|
|||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="订单金额">
|
||||
<el-table-column label="台桌号" prop="tableName"></el-table-column>
|
||||
<el-table-column label="订单金额">
|
||||
<template v-slot="scope">
|
||||
<div>{{ scope.row.orderType | orderTypeFilter }}</div>
|
||||
<div
|
||||
class="refund"
|
||||
v-if="
|
||||
scope.row.status == 'refunding' || scope.row.status == 'refund'
|
||||
v-if="
|
||||
scope.row.orderType == 'return'
|
||||
"
|
||||
>
|
||||
退款:-¥{{ scope.row.refundAmount }}
|
||||
退款:-¥{{ scope.row.orderAmount }}
|
||||
</div>
|
||||
<div>¥{{ scope.row.orderAmount }}</div>
|
||||
<div v-else>¥{{ scope.row.orderAmount }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态">
|
||||
|
|
@ -260,6 +259,9 @@ export default {
|
|||
}
|
||||
},
|
||||
mounted() {
|
||||
if(this.$route.query.tableName){
|
||||
this.query.tableName = this.$route.query.tableName
|
||||
}
|
||||
this.resetQuery = { ...this.query };
|
||||
this.tbShopPayTypeGet();
|
||||
this.getTableData();
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -4,7 +4,7 @@
|
|||
<el-button type="primary" icon="el-icon-plus" @click="$refs.addClassifyRef.show()">添加分类</el-button>
|
||||
<addClassify ref="addClassifyRef" @success="getTableData" />
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<div class="head-container" id="table_drag">
|
||||
<el-table :data="tableData.list" v-loading="tableData.loading" row-key="id"
|
||||
:tree-props="{ children: 'childrenList' }">
|
||||
<el-table-column label="排序" prop="sort" sortable width="100"></el-table-column>
|
||||
|
|
@ -56,8 +56,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
// import Sortable from 'sortablejs'
|
||||
import addClassify from './components/addClassify'
|
||||
import { tbShopCategoryGet, tbShopCategoryDelete, tbShopCategoryPost } from '@/api/shop'
|
||||
import { tbShopCategoryGet, tbShopCategoryDelete, tbShopCategoryPost, upCategorySort } from '@/api/shop'
|
||||
export default {
|
||||
components: {
|
||||
addClassify
|
||||
|
|
@ -75,8 +76,37 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
// this.$nextTick(() => {
|
||||
// this.tableDrag()
|
||||
// })
|
||||
},
|
||||
methods: {
|
||||
//表格拖拽
|
||||
// tableDrag() {
|
||||
// const el = document.querySelector('#table_drag .el-table__body-wrapper tbody')
|
||||
// new Sortable(el, {
|
||||
// animation: 150,
|
||||
// onEnd: async e => {
|
||||
// console.log('拖拽结束===', e);
|
||||
// return
|
||||
// if (e.oldIndex == e.newIndex) return
|
||||
// let oid = this.tableData.list[e.oldIndex].id
|
||||
// let nid = this.tableData.list[e.newIndex].id
|
||||
// let ids = this.tableData.list.map(item => item.id)
|
||||
// let isParent = this.tableData.list[e.oldIndex].pid ? 1 : 0
|
||||
// try {
|
||||
// await upCategorySort({
|
||||
// strId: oid,
|
||||
// endId: nid,
|
||||
// ids: ids
|
||||
// })
|
||||
// await this.getTableData()
|
||||
// } catch (error) {
|
||||
// console.log(error);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// 状态切换
|
||||
async showChange(e, row) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<el-form-item label="开关">
|
||||
<el-switch v-model="form.isShow" :active-value="1" :inactive-value="0"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序">
|
||||
<el-form-item label="排序" v-if="form.id">
|
||||
<el-input-number v-model="form.sort" controls-position="right" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
|
@ -92,7 +92,7 @@ export default {
|
|||
show(obj) {
|
||||
// console.log(obj)
|
||||
this.dialogVisible = true
|
||||
if (obj.pid) {
|
||||
if (obj && obj.pid) {
|
||||
this.form.pid = obj.pid
|
||||
}
|
||||
if (obj && obj.id) {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
<el-radio :label="0">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="分组排序">
|
||||
<el-form-item label="分组排序" v-if="form.id">
|
||||
<el-input-number v-model="form.sort" controls-position="right" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<el-form-item label="单位名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="单位名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序">
|
||||
<el-form-item label="排序" v-if="form.id">
|
||||
<el-input v-model="form.sort"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
</el-button>
|
||||
<addGroup ref="addGroupRef" @success="resetHandle" />
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.list" v-loading="tableData.loading">
|
||||
<div class="head-container" id="table_drag">
|
||||
<el-table :data="tableData.list" v-loading="tableData.loading" row-key="id">
|
||||
<el-table-column label="排序" sortable prop="sort"></el-table-column>
|
||||
<el-table-column label="分组名称" prop="name"></el-table-column>
|
||||
<el-table-column label="状态">
|
||||
|
|
@ -16,10 +16,11 @@
|
|||
@change="showChange($event, scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<el-table-column label="操作" width="240">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" size="mini" round icon="el-icon-edit"
|
||||
@click="$refs.addGroupRef.show(scope.row)">编辑</el-button>
|
||||
<el-button type="text" icon="el-icon-rank" v-if="isPcBowser">排序</el-button>
|
||||
<el-button type="text" size="mini" round icon="el-icon-edit" @click="$refs.addGroupRef.show(scope.row)"
|
||||
style="margin-left: 20px !important;">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delHandle([scope.row.id])">
|
||||
<el-button type="text" size="mini" round icon="el-icon-delete" slot="reference">
|
||||
删除
|
||||
|
|
@ -35,8 +36,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import Sortable from 'sortablejs'
|
||||
import addGroup from '../components/addGroup'
|
||||
import { tbProductGroupGet, tbProductGroupDelete, tbProductGroupPut } from '@/api/shop'
|
||||
import { tbProductGroupGet, tbProductGroupDelete, tbProductGroupPut, upGroupSort } from '@/api/shop'
|
||||
export default {
|
||||
components: {
|
||||
addGroup
|
||||
|
|
@ -45,7 +47,7 @@ export default {
|
|||
return {
|
||||
tableData: {
|
||||
page: 0,
|
||||
size: 10,
|
||||
size: 30,
|
||||
total: 0,
|
||||
loading: false,
|
||||
list: []
|
||||
|
|
@ -54,8 +56,37 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
if (this.isPcBowser) {
|
||||
this.$nextTick(() => {
|
||||
this.tableDrag()
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//表格拖拽
|
||||
tableDrag() {
|
||||
const el = document.querySelector('#table_drag .el-table__body-wrapper tbody')
|
||||
new Sortable(el, {
|
||||
animation: 150,
|
||||
onEnd: async e => {
|
||||
// console.log('拖拽结束===', e);
|
||||
if (e.oldIndex == e.newIndex) return
|
||||
let oid = this.tableData.list[e.oldIndex].id
|
||||
let nid = this.tableData.list[e.newIndex].id
|
||||
let ids = this.tableData.list.map(item => item.id)
|
||||
try {
|
||||
await upGroupSort({
|
||||
strId: oid,
|
||||
endId: nid,
|
||||
ids: ids
|
||||
})
|
||||
await this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 状态切换
|
||||
async showChange(e, row) {
|
||||
try {
|
||||
|
|
@ -91,8 +122,8 @@ export default {
|
|||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
this.tableData.loading = true
|
||||
const res = await tbProductGroupGet({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button type="primary" @click="queryHandle">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
@ -31,8 +31,9 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.data" v-loading="tableData.loading">
|
||||
<div class="head-container" id="table_drag">
|
||||
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id">
|
||||
<el-table-column prop="id" label="ID" width="50px"></el-table-column>
|
||||
<el-table-column label="商品信息">
|
||||
<template v-slot="scope">
|
||||
<div class="shop_info">
|
||||
|
|
@ -79,7 +80,9 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template v-slot="scope">
|
||||
<router-link :to="{ path: '/product/add_shop', query: { goods_id: scope.row.id } }">
|
||||
<el-button type="text" icon="el-icon-rank" v-if="isPcBowser">排序</el-button>
|
||||
<router-link :to="{ path: '/product/add_shop', query: { goods_id: scope.row.id } }"
|
||||
style="margin-left: 20px !important;">
|
||||
<el-button type="text" icon="el-icon-edit">编辑</el-button>
|
||||
</router-link>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||
|
|
@ -98,9 +101,10 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import Sortable from 'sortablejs'
|
||||
import dayjs from 'dayjs'
|
||||
import settings from '@/settings'
|
||||
import { tbProduct, tbShopCategoryGet, tbProductDelete, tbProductIsHot } from '@/api/shop'
|
||||
import { tbProduct, tbShopCategoryGet, tbProductDelete, tbProductIsHot, upProSort } from '@/api/shop'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -115,17 +119,51 @@ export default {
|
|||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 10,
|
||||
size: 30,
|
||||
loading: false,
|
||||
total: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
this.tbShopCategoryGet()
|
||||
async mounted() {
|
||||
await this.tbShopCategoryGet()
|
||||
await this.getTableData()
|
||||
if (this.isPcBowser) {
|
||||
this.$nextTick(() => {
|
||||
this.tableDrag()
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 选择分类
|
||||
queryHandle() {
|
||||
localStorage.setItem('shopIndexQuery', JSON.stringify(this.query))
|
||||
this.getTableData()
|
||||
},
|
||||
//表格拖拽
|
||||
tableDrag() {
|
||||
const el = document.querySelector('#table_drag .el-table__body-wrapper tbody')
|
||||
new Sortable(el, {
|
||||
animation: 150,
|
||||
onEnd: async e => {
|
||||
// console.log('拖拽结束===', e);
|
||||
if (e.oldIndex == e.newIndex) return
|
||||
let oid = this.tableData.data[e.oldIndex].id
|
||||
let nid = this.tableData.data[e.newIndex].id
|
||||
let ids = this.tableData.data.map(item => item.id)
|
||||
try {
|
||||
await upProSort({
|
||||
strId: oid,
|
||||
endId: nid,
|
||||
ids: ids
|
||||
})
|
||||
await this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置热门
|
||||
async changeHot(e, row) {
|
||||
console.log(row)
|
||||
|
|
@ -145,6 +183,8 @@ export default {
|
|||
this.query.name = ''
|
||||
this.query.categoryId = ''
|
||||
this.query.typeEnum = ''
|
||||
this.tableData.page = 0
|
||||
localStorage.setItem('shopIndexQuery', JSON.stringify(this.query))
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
|
|
@ -154,8 +194,13 @@ export default {
|
|||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
let localQuery = JSON.parse(localStorage.getItem('shopIndexQuery'))
|
||||
if (localQuery != null) {
|
||||
this.query = localQuery
|
||||
}
|
||||
|
||||
this.tableData.loading = true
|
||||
const res = await tbProduct({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
|
|
@ -199,6 +244,15 @@ export default {
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.handle {
|
||||
font-size: 18px;
|
||||
color: #999;
|
||||
|
||||
&:hover {
|
||||
cursor: grab;
|
||||
}
|
||||
}
|
||||
|
||||
.shop_info {
|
||||
display: flex;
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,8 @@ export default {
|
|||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
sort: 'id',
|
||||
shopId: localStorage.getItem('shopId')
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
name: this.query.blurry
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.list = res.content
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
<el-form-item label="店铺名称" prop="shopName">
|
||||
<el-input v-model="form.shopName" placeholder="请输入门店名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="连锁店扩展店名">
|
||||
<el-input v-model="form.chainName" placeholder="请输入连锁店扩展店名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="门店logo" prop="logo">
|
||||
<el-image :src="form.logo || require('@/assets/images/upload.png')" fit="contain"
|
||||
style="width: 80px;height: 80px;" @click="showUpload = true; uploadIndex = 1"></el-image>
|
||||
|
|
@ -47,16 +50,19 @@
|
|||
<el-input-number v-model="form.takeaway_money" placeholder="0.00" controls-position="right"
|
||||
:min="0"></el-input-number>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="店铺经度">
|
||||
<el-form-item label="店铺经度" prop="provinces">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-input v-model="form.lng" placeholder="经度"></el-input>
|
||||
<el-col :span="9" v-if="form.provinces">
|
||||
<el-input :value="`${form.provinces}-${form.cities}-${form.districts}`" disabled />
|
||||
</el-col>
|
||||
<el-col :span="4" v-if="form.lng">
|
||||
<el-input v-model="form.lng" placeholder="经度" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="4" v-if="form.lng">
|
||||
<el-input v-model="form.lat" placeholder="纬度" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-input v-model="form.lat" placeholder="纬度" style="margin-left: 10px;"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button type="primary" plain icon="el-icon-place" style="margin-left: 20px;"
|
||||
<el-button type="primary" plain icon="el-icon-place"
|
||||
@click="showLocation = true">选择坐标</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
@ -78,7 +84,7 @@
|
|||
<el-dialog title="选择地址" :visible.sync="showLocation" :modal="false" :modal-append-to-body="false">
|
||||
<div class="map_box">
|
||||
<div class="map">
|
||||
<el-amap :center="amapOptions.center">
|
||||
<el-amap ref="map" :center="amapOptions.center">
|
||||
<el-amap-marker :position="amapOptions.center"></el-amap-marker>
|
||||
</el-amap>
|
||||
</div>
|
||||
|
|
@ -86,7 +92,6 @@
|
|||
<el-amap-search-box :search-option="searchOption"
|
||||
:on-search-result="onSearchResult"></el-amap-search-box>
|
||||
</div>
|
||||
|
||||
<div class="search_wrap">
|
||||
<div class="item" v-for="item in locationSearchList" :key="item.id">
|
||||
<div class="left">
|
||||
|
|
@ -130,7 +135,7 @@
|
|||
import { getToken } from '@/utils/auth'
|
||||
import { mapGetters } from 'vuex'
|
||||
import crudQiNiu from '@/api/tools/qiniu'
|
||||
import { tbShopInfoPost } from '@/api/shop'
|
||||
import { tbShopInfoPost, geocode } from '@/api/shop'
|
||||
export default {
|
||||
computed: {
|
||||
...mapGetters([
|
||||
|
|
@ -169,7 +174,11 @@ export default {
|
|||
detail: '',
|
||||
status: 1,
|
||||
logo: '',
|
||||
coverImg: ''
|
||||
coverImg: '',
|
||||
provinces: '',
|
||||
cities: '',
|
||||
districts: '',
|
||||
chainName: ''
|
||||
},
|
||||
resetForm: '',
|
||||
rules: {
|
||||
|
|
@ -180,6 +189,13 @@ export default {
|
|||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
provinces: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择坐标',
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
logo: [
|
||||
{
|
||||
required: true,
|
||||
|
|
@ -227,10 +243,20 @@ export default {
|
|||
this.amapOptions.center = [res[0].lng, res[0].lat]
|
||||
},
|
||||
// 确认地址选择
|
||||
selectLocationHandle(item) {
|
||||
async selectLocationHandle(item) {
|
||||
console.log(item);
|
||||
this.form.lng = item.lng
|
||||
this.form.lat = item.lat
|
||||
this.form.address = item.address
|
||||
this.showLocation = false
|
||||
|
||||
const position = `${item.lng},${item.lat}`;
|
||||
const res = JSON.parse(await geocode({ location: position }))
|
||||
console.log(res);
|
||||
|
||||
this.form.provinces = res.addressComponent.province
|
||||
this.form.cities = res.addressComponent.city
|
||||
this.form.districts = res.addressComponent.district
|
||||
},
|
||||
// 保存
|
||||
submitHandle() {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,12 @@
|
|||
<el-form-item label="支付密码">
|
||||
<el-input v-model="form.payPassword" placeholder="请输入支付密码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="小程序appid">
|
||||
<el-input v-model="form.smallAppid" placeholder="请输入小程序appid"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺id">
|
||||
<el-input v-model="form.storeId" placeholder="请输入店铺id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio :label="1">启用</el-radio>
|
||||
|
|
@ -44,7 +50,9 @@ export default ({
|
|||
id: '',
|
||||
payPassword: '',
|
||||
status: 1,
|
||||
appId: ''
|
||||
appId: '',
|
||||
smallAppid: '',
|
||||
storeId: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -85,6 +93,8 @@ export default ({
|
|||
this.form.payPassword = res.payPassword
|
||||
this.form.status = res.status
|
||||
this.form.appId = res.appId
|
||||
this.form.smallAppid = res.smallAppid
|
||||
this.form.storeId = res.storeId
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,77 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-form ref="form" :model="form" label-width="120px" label-position="left">
|
||||
<el-form-item label="操作密码">
|
||||
<el-input v-model="form.password" type="number" @input="jiantingshuru" :disabled="disabled"
|
||||
:placeholder="disabled ? '******' : '请输入操作密码'" style="width: 200px;"></el-input>
|
||||
<el-button type="primary" @click="resetting">重置</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="安全手机号">
|
||||
{{ form.phone | phoneFilter }}
|
||||
</el-form-item>
|
||||
<el-form-item label="验证码">
|
||||
<el-input v-model="form.prepareAmount" placeholder="点击发送" style="width: 200px;"></el-input>
|
||||
<el-button type="primary" @click="onSubmit">发送</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitHandle">保存 </el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import md5 from 'js-md5';
|
||||
import { tbShopInfo } from "@/api/user";
|
||||
import { sendMsg, modfiyUserInfo } from "@/api/securitySetting"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
disabled: true,
|
||||
form: {}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getinfo()
|
||||
},
|
||||
methods: {
|
||||
jiantingshuru(e) {
|
||||
this.form.password = e.substr(0, 6)
|
||||
},
|
||||
// 获取用户信息
|
||||
async getinfo() {
|
||||
const shopId = localStorage.getItem("shopId");
|
||||
const res = await tbShopInfo(shopId);
|
||||
this.form = res
|
||||
// this.form.password = '******'
|
||||
},
|
||||
async submitHandle() {
|
||||
let data = {
|
||||
code: this.form.prepareAmount,
|
||||
pwd: md5(this.form.password),
|
||||
}
|
||||
const res = await modfiyUserInfo(data);
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
})
|
||||
},
|
||||
resetting() {
|
||||
this.form.password = ''
|
||||
this.disabled = false
|
||||
},
|
||||
async onSubmit() {
|
||||
const res = await sendMsg();
|
||||
this.$message({
|
||||
message: '发送成功',
|
||||
type: 'success'
|
||||
})
|
||||
},
|
||||
},
|
||||
filters: {
|
||||
phoneFilter(d) {
|
||||
let str = d + ''
|
||||
return str.substr(0, 3) + '***' + str.substr(-4)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -1,120 +1,86 @@
|
|||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="120px"
|
||||
label-position="left"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="140px" label-position="left">
|
||||
<el-form-item label="门店名称" prop="shopName">
|
||||
<el-input
|
||||
v-model="form.shopName"
|
||||
placeholder="请输入门店名称"
|
||||
style="width: 500px;"
|
||||
></el-input>
|
||||
<el-input v-model="form.shopName" placeholder="请输入门店名称" style="width: 500px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="连锁店扩展店名">
|
||||
<el-input v-model="form.chainName" placeholder="请输入连锁店扩展店名" style="width: 500px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="门店logo">
|
||||
<el-image
|
||||
:src="form.logo || require('@/assets/images/upload.png')"
|
||||
fit="contain"
|
||||
style="width: 80px;height: 80px;"
|
||||
@click="
|
||||
<el-image :src="form.logo || require('@/assets/images/upload.png')" fit="contain"
|
||||
style="width: 80px;height: 80px;" @click="
|
||||
showUpload = true;
|
||||
uploadIndex = 1;
|
||||
"
|
||||
></el-image>
|
||||
uploadIndex = 1;
|
||||
"></el-image>
|
||||
</el-form-item>
|
||||
<el-form-item label="门店照片">
|
||||
<el-image
|
||||
:src="form.coverImg || require('@/assets/images/upload.png')"
|
||||
fit="contain"
|
||||
style="width: 80px;height: 80px;"
|
||||
@click="
|
||||
<el-image :src="form.coverImg || require('@/assets/images/upload.png')" fit="contain"
|
||||
style="width: 80px;height: 80px;" @click="
|
||||
showUpload = true;
|
||||
uploadIndex = 2;
|
||||
"
|
||||
></el-image>
|
||||
uploadIndex = 2;
|
||||
"></el-image>
|
||||
</el-form-item>
|
||||
<el-form-item label="微信二维码">
|
||||
<el-image
|
||||
:src="form.shopQrcode || require('@/assets/images/upload.png')"
|
||||
fit="contain"
|
||||
style="width: 80px;height: 80px;"
|
||||
@click="
|
||||
<el-image :src="form.shopQrcode || require('@/assets/images/upload.png')" fit="contain"
|
||||
style="width: 80px;height: 80px;" @click="
|
||||
showUpload = true;
|
||||
uploadIndex = 3;
|
||||
"
|
||||
></el-image>
|
||||
uploadIndex = 3;
|
||||
"></el-image>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input
|
||||
v-model="form.phone"
|
||||
placeholder="请输入联系电话"
|
||||
style="width: 500px;"
|
||||
></el-input>
|
||||
<el-input v-model="form.phone" placeholder="请输入联系电话" style="width: 500px;"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="外卖起送金额">
|
||||
<el-input-number v-model="form.takeaway_money" placeholder="0.00" controls-position="right"
|
||||
:min="0"></el-input-number>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="店铺经度">
|
||||
<el-form-item label="店铺经度" prop="provinces">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-input v-model="form.lng" placeholder="经度"></el-input>
|
||||
<el-col :span="9" v-if="form.provinces">
|
||||
<el-input :value="`${form.provinces}-${form.cities}-${form.districts}`" disabled />
|
||||
</el-col>
|
||||
<el-col :span="4" v-if="form.lng">
|
||||
<el-input v-model="form.lng" placeholder="经度" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="4" v-if="form.lng">
|
||||
<el-input v-model="form.lat" placeholder="纬度" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-input
|
||||
v-model="form.lat"
|
||||
placeholder="纬度"
|
||||
style="margin-left: 10px;"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-place"
|
||||
style="margin-left: 20px;"
|
||||
@click="showLocation = true"
|
||||
>选择坐标</el-button
|
||||
>
|
||||
<el-button type="primary" plain icon="el-icon-place" @click="showLocation = true">选择坐标</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="color: #999;">注:准确的定位便于用户导航到店铺</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="门店详细地址">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.address"
|
||||
placeholder="请输入门店详细地址"
|
||||
style="width: 500px;"
|
||||
></el-input>
|
||||
<el-input type="textarea" v-model="form.address" placeholder="请输入门店详细地址" style="width: 500px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="营业时间">
|
||||
<el-time-picker
|
||||
placeholder="起始时间"
|
||||
v-model="startTime"
|
||||
:picker-options="{
|
||||
selectableRange: '00:00:00 - 23:59:59',
|
||||
format: 'HH:mm'
|
||||
}"
|
||||
format="HH:mm"
|
||||
value-format="HH:mm"
|
||||
>
|
||||
<el-select v-model="form.businessStartDay" placeholder="周几开始">
|
||||
<el-option :value="item.label" :label="item.label" v-for="item in weeks" :key="item.value"></el-option>
|
||||
</el-select>
|
||||
<el-select v-model="form.businessEndDay" placeholder="周几结束">
|
||||
<el-option :value="item.label" :label="item.label" v-for="item in weeks" :key="item.value"></el-option>
|
||||
</el-select>
|
||||
<el-time-picker placeholder="起始时间" v-model="startTime" :picker-options="{
|
||||
selectableRange: '00:00:00 - 23:59:59',
|
||||
format: 'HH:mm'
|
||||
}" format="HH:mm" value-format="HH:mm">
|
||||
</el-time-picker>
|
||||
<el-time-picker
|
||||
placeholder="结束时间"
|
||||
v-model="endTime"
|
||||
:picker-options="{
|
||||
selectableRange: `${startTime}:00 - 23:59:59`
|
||||
}"
|
||||
format="HH:mm"
|
||||
value-format="HH:mm"
|
||||
>
|
||||
<el-time-picker placeholder="结束时间" v-model="endTime" :picker-options="{
|
||||
selectableRange: `${startTime}:00 - 23:59:59`
|
||||
}" format="HH:mm" value-format="HH:mm">
|
||||
</el-time-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否开启8折活动">
|
||||
<el-switch v-model="form.isOpenYhq" active-value="true" inactive-value="false"></el-switch>
|
||||
<!-- <div style="color: #999;">是否允许用户在小程序端支付订单</div> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="是否开启会员支付">
|
||||
<el-switch v-model="form.isUseVip" :active-value="1" :inactive-value="0"></el-switch>
|
||||
<!-- <div style="color: #999;">是否允许用户在小程序端支付订单</div> -->
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="结算类型">
|
||||
<el-radio-group v-model="form.settleType">
|
||||
<el-radio :label="0">今日</el-radio>
|
||||
|
|
@ -135,12 +101,7 @@
|
|||
</el-time-picker>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="店铺简介">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.detail"
|
||||
placeholder="请输入店铺简介"
|
||||
style="width: 500px;"
|
||||
></el-input>
|
||||
<el-input type="textarea" v-model="form.detail" placeholder="请输入店铺简介" style="width: 500px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
|
|
@ -149,11 +110,7 @@
|
|||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="submitHandle"
|
||||
:loading="formLoading"
|
||||
>
|
||||
<el-button type="primary" @click="submitHandle" :loading="formLoading">
|
||||
<span v-if="!formLoading">保存</span>
|
||||
<span v-else>保存中...</span>
|
||||
</el-button>
|
||||
|
|
@ -168,10 +125,7 @@
|
|||
</el-amap>
|
||||
</div>
|
||||
<div class="search_box">
|
||||
<el-amap-search-box
|
||||
:search-option="searchOption"
|
||||
:on-search-result="onSearchResult"
|
||||
></el-amap-search-box>
|
||||
<el-amap-search-box :search-option="searchOption" :on-search-result="onSearchResult"></el-amap-search-box>
|
||||
</div>
|
||||
|
||||
<div class="search_wrap">
|
||||
|
|
@ -189,23 +143,10 @@
|
|||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:visible.sync="showUpload"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
width="500px"
|
||||
@close="showUpload = false"
|
||||
>
|
||||
<el-upload
|
||||
:before-remove="handleBeforeRemove"
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:file-list="fileList"
|
||||
:headers="headers"
|
||||
:action="qiNiuUploadApi"
|
||||
class="upload-demo"
|
||||
multiple
|
||||
>
|
||||
<el-dialog :visible.sync="showUpload" :close-on-click-modal="false" append-to-body width="500px"
|
||||
@close="showUpload = false">
|
||||
<el-upload :before-remove="handleBeforeRemove" :on-success="handleSuccess" :on-error="handleError"
|
||||
:file-list="fileList" :headers="headers" :action="qiNiuUploadApi" class="upload-demo" multiple>
|
||||
<el-button size="small" type="primary">点击上传</el-button>
|
||||
<div slot="tip" style="display: block;" class="el-upload__tip">
|
||||
请勿上传违法文件,且文件不超过15M
|
||||
|
|
@ -223,6 +164,7 @@ import { getToken } from "@/utils/auth";
|
|||
import { mapGetters } from "vuex";
|
||||
import crudQiNiu from "@/api/tools/qiniu";
|
||||
import { tbShopInfo, tbShopInfoPut } from "@/api/user";
|
||||
import { geocode } from '@/api/shop'
|
||||
export default {
|
||||
computed: {
|
||||
...mapGetters(["qiNiuUploadApi"])
|
||||
|
|
@ -272,7 +214,37 @@ export default {
|
|||
amapOptions: {
|
||||
center: [108.946465, 34.347984],
|
||||
position: []
|
||||
}
|
||||
},
|
||||
weeks: [
|
||||
{
|
||||
value: '1',
|
||||
label: '周一'
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '周二'
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '周三'
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
label: '周四'
|
||||
},
|
||||
{
|
||||
value: '5',
|
||||
label: '周五'
|
||||
},
|
||||
{
|
||||
value: '6',
|
||||
label: '周六'
|
||||
},
|
||||
{
|
||||
value: '7',
|
||||
label: '周天'
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -284,10 +256,19 @@ export default {
|
|||
this.amapOptions.center = [res[0].lng, res[0].lat];
|
||||
},
|
||||
// 确认地址选择
|
||||
selectLocationHandle(item) {
|
||||
async selectLocationHandle(item) {
|
||||
this.form.lng = item.lng;
|
||||
this.form.lat = item.lat;
|
||||
this.form.address = item.address
|
||||
this.showLocation = false;
|
||||
|
||||
const position = `${item.lng},${item.lat}`;
|
||||
const res = JSON.parse(await geocode({ location: position }))
|
||||
console.log(res);
|
||||
|
||||
this.form.provinces = res.addressComponent.province
|
||||
this.form.cities = res.addressComponent.city
|
||||
this.form.districts = res.addressComponent.district
|
||||
},
|
||||
// 获取用户详情
|
||||
async tbShopInfo() {
|
||||
|
|
@ -300,7 +281,7 @@ export default {
|
|||
this.startTime = businessTime[0];
|
||||
this.endTime = businessTime[1];
|
||||
}
|
||||
} catch (error) {}
|
||||
} catch (error) { }
|
||||
},
|
||||
// 保存
|
||||
submitHandle() {
|
||||
|
|
@ -319,7 +300,7 @@ export default {
|
|||
message: "提交成功",
|
||||
type: "success"
|
||||
});
|
||||
} catch (error) {}
|
||||
} catch (error) { }
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -333,7 +314,7 @@ export default {
|
|||
handleBeforeRemove(file, fileList) {
|
||||
for (let i = 0; i < this.files.length; i++) {
|
||||
if (this.files[i].uid === file.uid) {
|
||||
crudQiNiu.del([this.files[i].id]).then(res => {});
|
||||
crudQiNiu.del([this.files[i].id]).then(res => { });
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@
|
|||
<el-dropdown @command="dropdownClick">
|
||||
<el-button type="text">更多<i class="el-icon-arrow-down"></i></el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{ row: scope.row, command: 1 }">详情</el-dropdown-item>
|
||||
<el-dropdown-item :command="{ row: scope.row, command: 1 }">三方配置</el-dropdown-item>
|
||||
<el-dropdown-item :command="2">续费记录</el-dropdown-item>
|
||||
<el-dropdown-item :command="3">前往店铺</el-dropdown-item>
|
||||
<el-dropdown-item :command="4">重置密码</el-dropdown-item>
|
||||
|
|
|
|||
|
|
@ -3,19 +3,28 @@
|
|||
<el-tabs v-model="activeName" type="card">
|
||||
<el-tab-pane label="店铺信息" name="1"></el-tab-pane>
|
||||
<el-tab-pane label="基础配置" name="2"></el-tab-pane>
|
||||
<!-- <el-tab-pane label="通知配置" name="3"></el-tab-pane> -->
|
||||
<el-tab-pane label="安全设置" name="4"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<shopInfo v-if="activeName == 1" />
|
||||
<shopSetting v-if="activeName == 2" />
|
||||
<notice v-if="activeName == 3" />
|
||||
<securitySetting v-if="activeName == 4" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import shopInfo from './components/shopInfo'
|
||||
import shopSetting from './components/shopSetting'
|
||||
import notice from './components/notice'
|
||||
import securitySetting from './components/securitySetting'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
shopInfo,
|
||||
shopSetting
|
||||
shopSetting,
|
||||
notice,securitySetting
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -1,33 +1,30 @@
|
|||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '添加'" :visible.sync="dialogVisible" @close="reset">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="left">
|
||||
<el-form-item label="类型" v-if="!form.releId">
|
||||
<el-radio-group v-model="form.type">
|
||||
<el-radio :label="item.value" v-for="item in typeList" :key="item.value">{{ item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="字典名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入分类名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="字典描述" prop="description">
|
||||
<el-input v-model="form.description" placeholder="请输入分类名称"></el-input>
|
||||
<el-form-item label="字典描述" prop="value">
|
||||
<el-input v-model="form.value" placeholder="请输入分类名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="字典标签" prop="dictName">
|
||||
<el-input v-model="form.dictName" placeholder="请输入分类名称"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="开关">
|
||||
<el-switch
|
||||
v-model="form.isShow"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
></el-switch>
|
||||
<el-form-item label="状态">
|
||||
<el-switch v-model="form.status" :active-value="1" :inactive-value="0"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序">
|
||||
<el-input-number
|
||||
v-model="form.sort"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
></el-input-number>
|
||||
</el-form-item> -->
|
||||
<el-input-number v-model="form.sort" controls-position="right" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmitHandle">确 定</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="onSubmitHandle">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
|
@ -38,13 +35,31 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
form: {
|
||||
id: "",
|
||||
pid: "",
|
||||
releId: '',
|
||||
dictName: "",
|
||||
description: "",
|
||||
name: ""
|
||||
value: "",
|
||||
name: "",
|
||||
type: 'common',
|
||||
status: 1,
|
||||
sort: 0
|
||||
},
|
||||
typeList: [
|
||||
{
|
||||
value: 'common',
|
||||
label: '通用'
|
||||
},
|
||||
{
|
||||
value: 'home',
|
||||
label: '首页'
|
||||
},
|
||||
{
|
||||
value: 'hot',
|
||||
label: '热销'
|
||||
}
|
||||
],
|
||||
resetForm: "",
|
||||
rules: {
|
||||
dictName: [
|
||||
|
|
@ -54,7 +69,7 @@ export default {
|
|||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
description: [
|
||||
value: [
|
||||
{
|
||||
required: true,
|
||||
message: " ",
|
||||
|
|
@ -76,11 +91,12 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
onSubmitHandle() {
|
||||
console.log(this.form);
|
||||
this.$refs.form.validate(async valid => {
|
||||
if (valid) {
|
||||
try {
|
||||
this.loading = true
|
||||
this.form.shopId = localStorage.getItem("shopId");
|
||||
this.form.releId && (this.form.type = '')
|
||||
let res = await dict(this.form, this.form.id ? "put" : "post");
|
||||
this.$emit("success", res);
|
||||
this.close();
|
||||
|
|
@ -89,6 +105,7 @@ export default {
|
|||
message: `${this.form.id ? "编辑" : "添加"}成功`,
|
||||
type: "success"
|
||||
});
|
||||
this.loading = false
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
|
@ -99,7 +116,7 @@ export default {
|
|||
// console.log(obj)
|
||||
this.dialogVisible = true;
|
||||
if (obj && obj.pid) {
|
||||
this.form.pid = obj.pid;
|
||||
this.form.releId = obj.pid;
|
||||
}
|
||||
if (obj && obj.id) {
|
||||
this.form = { ...obj };
|
||||
|
|
|
|||
|
|
@ -20,16 +20,21 @@
|
|||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.list" v-loading="tableData.loading" row-key="id"
|
||||
:tree-props="{ children: 'childrenList' }">
|
||||
<el-table-column type="index" width="50">
|
||||
</el-table-column>
|
||||
:tree-props="{ children: 'dictDetails' }">
|
||||
<!-- <el-table-column type="index" width="50"></el-table-column> -->
|
||||
<el-table-column label="名称" prop="name"></el-table-column>
|
||||
<el-table-column label="描述" prop="description"></el-table-column>
|
||||
<el-table-column label="描述" prop="value"></el-table-column>
|
||||
<el-table-column label="标签" prop="dictName"></el-table-column>
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0"
|
||||
@change="changeHot($event, scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" size="mini" round icon="el-icon-plus"
|
||||
@click="$refs.addRef.show({ pid: scope.row.id })" v-if="!scope.row.pid">添加下级字典</el-button>
|
||||
@click="$refs.addRef.show({ pid: scope.row.id })" v-if="!scope.row.releId">添加下级字典</el-button>
|
||||
<el-button type="text" size="mini" round icon="el-icon-edit"
|
||||
@click="$refs.addRef.show(scope.row)">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delHandle([scope.row.id])">
|
||||
|
|
@ -50,7 +55,7 @@
|
|||
|
||||
<script>
|
||||
import add from "./components/add";
|
||||
import { dict } from "@/api/setting";
|
||||
import { dict, dictPut } from "@/api/setting";
|
||||
export default {
|
||||
components: {
|
||||
add
|
||||
|
|
@ -71,8 +76,16 @@ export default {
|
|||
this.getTableData();
|
||||
},
|
||||
methods: {
|
||||
// 添加子分类
|
||||
addChildGatgory(row) { },
|
||||
// 切换状态
|
||||
async changeHot(e, row) {
|
||||
try {
|
||||
this.tableData.loading = true
|
||||
await dictPut({ ...row })
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 查询table
|
||||
toQuery() {
|
||||
this.getTableData();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,83 @@
|
|||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '添加'" :visible.sync="dialogVisible" @close="reset">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="left">
|
||||
<el-form-item label="字典名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入分类名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-switch v-model="form.status" :active-value="1" :inactive-value="0"></el-switch>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="排序">
|
||||
<el-input-number v-model="form.sort" controls-position="right" :min="0"></el-input-number>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="onSubmitHandle">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { tbCouponCategoryPostPut } from "@/api/setting";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
form: {
|
||||
id: "",
|
||||
name: "",
|
||||
status: 1
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: " ",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
},
|
||||
resetForm: "",
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.resetForm = { ...this.form };
|
||||
},
|
||||
methods: {
|
||||
onSubmitHandle() {
|
||||
this.$refs.form.validate(async valid => {
|
||||
if (valid) {
|
||||
try {
|
||||
this.loading = true
|
||||
let res = await tbCouponCategoryPostPut(this.form, this.form.id ? "put" : "post");
|
||||
this.$emit("success", res);
|
||||
this.close();
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: `${this.form.id ? "编辑" : "添加"}成功`,
|
||||
type: "success"
|
||||
});
|
||||
this.loading = false
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
show(obj) {
|
||||
this.dialogVisible = true;
|
||||
if (obj && obj.id) {
|
||||
this.form = { ...obj };
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
reset() {
|
||||
this.form = { ...this.resetForm };
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,133 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-input v-model="query.name" size="small" clearable placeholder="请输入名称" style="width: 100%;"
|
||||
class="filter-item" @keyup.enter.native="getTableData" />
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="$refs.addRef.show()">
|
||||
添加团购券分类
|
||||
</el-button>
|
||||
<add ref="addRef" @success="getTableData" />
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.list" v-loading="tableData.loading">
|
||||
<el-table-column label="名称" prop="name"></el-table-column>
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0"
|
||||
@change="changeHot($event, scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" size="mini" round icon="el-icon-edit"
|
||||
@click="$refs.addRef.show(scope.row)">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delHandle([scope.row.id])">
|
||||
<el-button type="text" size="mini" round icon="el-icon-delete" slot="reference">
|
||||
删除
|
||||
</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import add from "./components/add";
|
||||
import { tbCouponCategoryGet, tbCouponCategoryPostPut } from "@/api/setting";
|
||||
export default {
|
||||
components: {
|
||||
add
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
query: {
|
||||
name: ''
|
||||
},
|
||||
tableData: {
|
||||
page: 0,
|
||||
size: 10,
|
||||
total: 0,
|
||||
loading: false,
|
||||
list: []
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData();
|
||||
},
|
||||
methods: {
|
||||
// 切换状态
|
||||
async changeHot(e, row) {
|
||||
try {
|
||||
this.tableData.loading = true
|
||||
await tbCouponCategoryPostPut({ ...row })
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 查询table
|
||||
toQuery() {
|
||||
this.getTableData();
|
||||
}, // 重置查询
|
||||
resetHandle() {
|
||||
this.tableData.page = 0;
|
||||
this.query.blurry = "";
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1;
|
||||
this.getTableData();
|
||||
},
|
||||
// 删除
|
||||
async delHandle(ids) {
|
||||
try {
|
||||
await tbCouponCategoryPostPut(ids, "delete");
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: `删除成功`,
|
||||
type: "success"
|
||||
});
|
||||
this.getTableData();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
async getTableData() {
|
||||
this.tableData.loading = true;
|
||||
try {
|
||||
const res = await tbCouponCategoryGet(
|
||||
{
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
blurry: this.query.name,
|
||||
sort: ''
|
||||
}
|
||||
);
|
||||
this.tableData.loading = false;
|
||||
this.tableData.list = res.content;
|
||||
this.tableData.total = res.totalElements;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -79,6 +79,12 @@
|
|||
<el-form-item v-show="form.iFrame.toString() !== 'true' && form.type.toString() === '1'" label="选中父级菜单">
|
||||
<el-input v-model="form.activeMenu" placeholder="请输入父级菜单path" style="width: 178px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商家可用">
|
||||
<el-radio-group v-model="form.isShop" size="mini">
|
||||
<el-radio-button :label="1">是</el-radio-button>
|
||||
<el-radio-button :label="0">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="上级类目" prop="pid">
|
||||
<treeselect v-model="form.pid" :options="menus" :load-options="loadMenus" style="width: 450px;"
|
||||
placeholder="选择上级类目" />
|
||||
|
|
@ -125,6 +131,12 @@
|
|||
<span v-else>是</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isShop" label="商家可用" width="75px">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.isShop">是</span>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建日期" width="135px" />
|
||||
<el-table-column v-if="checkPer(['admin', 'menu:edit', 'menu:del'])" label="操作" width="130px" align="center"
|
||||
fixed="right">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,305 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-dialog :title="form.id ? '编辑' : '添加'" :visible.sync="dialogVisible" @close="reset">
|
||||
<div class="div_h">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="left">
|
||||
<el-form-item label="资源类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择资源类型" @change="typeChange">
|
||||
<el-option v-for="item in typeList" :key="item.key" :label="item.name" :value="item.key"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="团购卷" prop="group">
|
||||
<div v-if="!productIds.length">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="$refs.groupTypeList.show()">
|
||||
添加团购券
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="shop_list" v-else>
|
||||
<el-tag closable type="primary" v-for="(item, index) in productIds" :key="item.id"
|
||||
@close="productIds.splice(index, 1)">
|
||||
{{ item.name }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="值" prop="value">
|
||||
<el-input v-model="form.value" placeholder="请输入值"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="跳转类型" prop="jumpType">
|
||||
<el-select v-model="form.jumpType" placeholder="请选择资源类型">
|
||||
<el-option v-for="item in jumpTypeList" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="展示图">
|
||||
<uploadImg ref="uploadImg2" @success="res => form.coverImg = res[0]" @remove="form.coverImg = ''" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字体色">
|
||||
<el-color-picker v-model="form.fontColor"></el-color-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="背景色">
|
||||
<el-color-picker v-model="form.backColor"></el-color-picker>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="相对跳转地址" prop="value">
|
||||
<el-input v-model="form.relUrl" placeholder="请输入相对跳转地址"></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="绝对跳转地址" prop="value">
|
||||
<el-input v-model="form.absUrl" placeholder="请输入绝对跳转地址"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签前小图标">
|
||||
<uploadImg ref="uploadImg1" @success="res => form.shareImg = res[0]" @remove="form.shareImg = ''" />
|
||||
</el-form-item>
|
||||
<el-form-item label="APP端展示">
|
||||
<el-radio-group v-model="form.isShowApp">
|
||||
<el-radio :label="1">展示</el-radio>
|
||||
<el-radio :label="0">不展示</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="收银端展示">
|
||||
<el-radio-group v-model="form.isShowCash">
|
||||
<el-radio :label="1">展示</el-radio>
|
||||
<el-radio :label="0">不展示</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="小程序端展示">
|
||||
<el-radio-group v-model="form.isShowMall">
|
||||
<el-radio :label="1">展示</el-radio>
|
||||
<el-radio :label="0">不展示</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序">
|
||||
<el-input-number v-model="form.sort" controls-position="right" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="onSubmitHandle">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<groupTypeList ref="groupTypeList" @success="groupSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { tbPlatformDictPostPut, tbPlatformDictType } from "@/api/setting";
|
||||
import uploadImg from '@/components/uploadImg'
|
||||
import enumData from '../enumData.js'
|
||||
import groupTypeList from '@/components/groupTypeList'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
uploadImg,
|
||||
groupTypeList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
productIds: [],
|
||||
form: {
|
||||
id: "",
|
||||
shareImg: '',
|
||||
name: "",
|
||||
value: "",
|
||||
fontColor: "",
|
||||
backColor: '',
|
||||
type: '',
|
||||
jumpType: '',
|
||||
relUrl: '',
|
||||
absUrl: '',
|
||||
coverImg: '',
|
||||
isShowApp: 0,
|
||||
isShowCash: 0,
|
||||
isShowMall: 0,
|
||||
sort: 0
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: " ",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
type: [
|
||||
{
|
||||
required: true,
|
||||
message: " ",
|
||||
trigger: "change"
|
||||
}
|
||||
],
|
||||
jumpType: [
|
||||
{
|
||||
required: true,
|
||||
message: " ",
|
||||
trigger: "change"
|
||||
}
|
||||
]
|
||||
},
|
||||
jumpTypeList: enumData.jumpTypeList,
|
||||
typeList: [],
|
||||
resetForm: "",
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.resetForm = { ...this.form };
|
||||
this.tbPlatformDictType()
|
||||
},
|
||||
methods: {
|
||||
// 获取资源类别
|
||||
async tbPlatformDictType() {
|
||||
try {
|
||||
const res = await tbPlatformDictType()
|
||||
this.typeList = res.content
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
groupSuccess(row) {
|
||||
this.productIds = [row]
|
||||
this.form.name = row.name
|
||||
this.form.value = row.id
|
||||
},
|
||||
// 选择类型
|
||||
typeChange(e) {
|
||||
// if (e == 'group') {
|
||||
|
||||
// } else if (e == 'custom') {
|
||||
|
||||
// } else {
|
||||
|
||||
// }
|
||||
},
|
||||
// 提交
|
||||
onSubmitHandle() {
|
||||
this.$refs.form.validate(async valid => {
|
||||
if (valid) {
|
||||
try {
|
||||
this.loading = true
|
||||
this.form.shopId = localStorage.getItem("shopId");
|
||||
this.form.releId && (this.form.type = '')
|
||||
let res = await tbPlatformDictPostPut(this.form, this.form.id ? "put" : "post");
|
||||
this.$emit("success", res);
|
||||
this.close();
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: `${this.form.id ? "编辑" : "添加"}成功`,
|
||||
type: "success"
|
||||
});
|
||||
this.loading = false
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
show(obj) {
|
||||
this.dialogVisible = true;
|
||||
if (obj && obj.id) {
|
||||
this.form = { ...obj };
|
||||
if (obj.shareImg) {
|
||||
setTimeout(() => {
|
||||
this.$refs.uploadImg1.fileList = [
|
||||
{
|
||||
url: obj.shareImg
|
||||
}
|
||||
]
|
||||
}, 100)
|
||||
}
|
||||
if (obj.coverImg) {
|
||||
setTimeout(() => {
|
||||
this.$refs.uploadImg2.fileList = [
|
||||
{
|
||||
url: obj.coverImg
|
||||
}
|
||||
]
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
reset() {
|
||||
this.form = { ...this.resetForm };
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.div_h {
|
||||
max-height: 50vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.shop_list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.item_wrap {
|
||||
$size: 80px;
|
||||
|
||||
.item {
|
||||
$radius: 4px;
|
||||
width: $size;
|
||||
height: $size;
|
||||
border-radius: $radius;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
margin-right: 10px;
|
||||
margin-top: 10px;
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: attr(data-index);
|
||||
font-size: 12px;
|
||||
height: 20px;
|
||||
display: flex;
|
||||
padding: 0 10px;
|
||||
border-radius: 0 0 $radius 0;
|
||||
align-items: center;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
backdrop-filter: blur(10px);
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
&::before {
|
||||
content: '删除';
|
||||
font-size: 12px;
|
||||
width: 100%;
|
||||
height: 20px;
|
||||
display: flex;
|
||||
padding: 0 10px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
backdrop-filter: blur(10px);
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
transition: all .1s ease-in-out;
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
width: $size;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
export default {
|
||||
jumpTypeList: [
|
||||
{
|
||||
value: "scan",
|
||||
label: "特殊跳转"
|
||||
},
|
||||
{
|
||||
value: "relative",
|
||||
label: "内部页面"
|
||||
},
|
||||
{
|
||||
value: "absolute",
|
||||
label: "外链"
|
||||
}
|
||||
],
|
||||
typeList: [
|
||||
{
|
||||
value: "homeDistrict",
|
||||
label: "金刚区"
|
||||
},
|
||||
{
|
||||
value: "carousel",
|
||||
label: "轮播图"
|
||||
},
|
||||
{
|
||||
value: "proTag",
|
||||
label: "商品标签"
|
||||
},
|
||||
{
|
||||
value: "shopTag",
|
||||
label: "店铺标签"
|
||||
},
|
||||
{
|
||||
value: "icon",
|
||||
label: "小图标"
|
||||
},
|
||||
{
|
||||
value: "subShop",
|
||||
label: "预约到店顶部图"
|
||||
},
|
||||
{
|
||||
value: "ownMenu",
|
||||
label: "个人中心菜单"
|
||||
},
|
||||
// {
|
||||
// value: "group",
|
||||
// label: "团购卷"
|
||||
// },
|
||||
{
|
||||
value: "hotCoupon",
|
||||
label: "热榜推荐"
|
||||
}
|
||||
// {
|
||||
// value: "custom",
|
||||
// label: "自定义"
|
||||
// }
|
||||
]
|
||||
};
|
||||
|
|
@ -0,0 +1,227 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-input v-model="query.name" size="small" clearable placeholder="请输入名称或描述" style="width: 100%;"
|
||||
class="filter-item" @keyup.enter.native="getTableData" />
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-select v-model="query.type" placeholder="请选择资源类型">
|
||||
<el-option v-for="item in typeList" :key="item.key" :label="item.name"
|
||||
:value="item.key"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="$refs.addRef.show()">
|
||||
添加资源
|
||||
</el-button>
|
||||
<add ref="addRef" @success="getTableData" />
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.list" v-loading="tableData.loading">
|
||||
<el-table-column label="描述" prop="name"></el-table-column>
|
||||
<el-table-column label="类型" prop="type">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.type }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="跳转类型" prop="jumpType">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.jumpType | jumpFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="展示图" prop="coverImg">
|
||||
<template v-slot="scope">
|
||||
<el-image :src="scope.row.coverImg" style="width: 40px;height: 40px;" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="标签前小图标" prop="shareImg">
|
||||
<template v-slot="scope">
|
||||
<el-image :src="scope.row.shareImg" style="width: 40px;height: 40px;" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="背景色" prop="backColor">
|
||||
<template v-slot="scope">
|
||||
<div class="color_wrap">
|
||||
<div class="dot" :style="{ backgroundColor: scope.row.backColor }"></div>
|
||||
<span>{{ scope.row.backColor }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="字体颜色" prop="fontColor">
|
||||
<template v-slot="scope">
|
||||
<div class="color_wrap">
|
||||
<div class="dot" :style="{ backgroundColor: scope.row.fontColor }"></div>
|
||||
<span>{{ scope.row.fontColor }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="相对跳转地址" prop="relUrl"></el-table-column>
|
||||
<el-table-column label="绝对跳转地址" prop="absUrl"></el-table-column>
|
||||
<el-table-column label="APP端展示" prop="isShowApp">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.isShowApp" :active-value="1" :inactive-value="0"
|
||||
@change="changeHot($event, scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收银端展示" prop="isShowCash">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.isShowCash" :active-value="1" :inactive-value="0"
|
||||
@change="changeHot($event, scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小程序端展示" prop="isShowMall">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.isShowMall" :active-value="1" :inactive-value="0"
|
||||
@change="changeHot($event, scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" size="mini" round icon="el-icon-edit"
|
||||
@click="$refs.addRef.show(scope.row)">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delHandle([scope.row.id])">
|
||||
<el-button type="text" size="mini" round icon="el-icon-delete" slot="reference">
|
||||
删除
|
||||
</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import enumData from './enumData.js'
|
||||
import add from "./components/add";
|
||||
import { tbPlatformDictGet, tbPlatformDictPostPut, tbPlatformDictType } from "@/api/setting";
|
||||
export default {
|
||||
components: {
|
||||
add
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
enumData,
|
||||
typeList: [],
|
||||
query: {
|
||||
name: "",
|
||||
type: ''
|
||||
},
|
||||
tableData: {
|
||||
page: 0,
|
||||
size: 10,
|
||||
total: 0,
|
||||
loading: false,
|
||||
list: []
|
||||
}
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
jumpFilter(t) {
|
||||
return t ? enumData.jumpTypeList.find(item => item.value == t).label : ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.tbPlatformDictType()
|
||||
},
|
||||
methods: {
|
||||
typeFilter(t) {
|
||||
let e = t ? this.typeList.find(item => item.value == t).label : t
|
||||
return e ? e : t
|
||||
},
|
||||
// 获取资源类别
|
||||
async tbPlatformDictType() {
|
||||
try {
|
||||
const res = await tbPlatformDictType()
|
||||
this.typeList = res.content
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 切换状态
|
||||
async changeHot(e, row) {
|
||||
try {
|
||||
this.tableData.loading = true
|
||||
await tbPlatformDictPostPut({ ...row }, 'put')
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 查询table
|
||||
toQuery() {
|
||||
this.getTableData();
|
||||
}, // 重置查询
|
||||
resetHandle() {
|
||||
this.tableData.page = 0;
|
||||
this.query.blurry = "";
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1;
|
||||
this.getTableData();
|
||||
},
|
||||
// 删除
|
||||
async delHandle(ids) {
|
||||
try {
|
||||
await tbPlatformDictPostPut(ids, "delete");
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: `删除成功`,
|
||||
type: "success"
|
||||
});
|
||||
this.getTableData();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true;
|
||||
try {
|
||||
const res = await tbPlatformDictGet(
|
||||
{
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
...this.query,
|
||||
sort: 'id'
|
||||
}
|
||||
);
|
||||
this.tableData.loading = false;
|
||||
this.tableData.list = res.content;
|
||||
this.tableData.total = res.totalElements;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.color_wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.dot {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border-radius: 50%;
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<template>
|
||||
<el-dialog title="下载桌码" width="400px" :visible.sync="dialogVisible" @open="reset">
|
||||
<el-form ref="form" :model="form" label-position="left">
|
||||
<el-form-item label="下载数量">
|
||||
<el-input-number v-model="form.number" :min="1" :max="total * 2"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="onSubmitHandle">下 载</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { downloadFile } from "@/utils/index";
|
||||
import { downloadTableCode } from '@/api/table'
|
||||
export default {
|
||||
props: {
|
||||
total: {
|
||||
type: [Number, String],
|
||||
default: 1
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
form: {
|
||||
number: 1
|
||||
},
|
||||
resetForm: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.resetForm = { ...this.form }
|
||||
},
|
||||
methods: {
|
||||
async onSubmitHandle() {
|
||||
try {
|
||||
this.loading = true
|
||||
const file = await downloadTableCode({
|
||||
count: this.form.number,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.loading = false
|
||||
this.dialogVisible = false
|
||||
this.$message.success('下载成功')
|
||||
downloadFile(file, "桌码", "zip");
|
||||
} catch (error) {
|
||||
this.loading = false
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
show(obj) {
|
||||
this.dialogVisible = true
|
||||
// if (obj && obj.id) {
|
||||
// this.form = JSON.parse(JSON.stringify(obj))
|
||||
// }
|
||||
},
|
||||
close() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
reset() {
|
||||
this.form = { ...this.resetForm }
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -16,7 +16,9 @@
|
|||
<div class="filter_wrap">
|
||||
<el-button icon="el-icon-plus" @click="$refs.addEara.show()">添加区域</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="$refs.addTable.show()">添加台桌</el-button>
|
||||
<el-button type="primary" icon="el-icon-download">下载台桌码</el-button>
|
||||
<el-button type="primary" icon="el-icon-download" @click="$refs.downloadTableCode.show()">
|
||||
下载台桌码
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-download">下载店铺码</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -33,7 +35,8 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<el-tag type="warning" size="mini">{{ item.type == 0 ? '低消' : '计时' }}</el-tag>
|
||||
<el-tag :type="item.isPredate == 1 ? '' : 'info'" size="mini">{{ item.isPredate == 1 ? '可预约' : '不可预约' }}</el-tag>
|
||||
<el-tag :type="item.isPredate == 1 ? '' : 'info'" size="mini">{{ item.isPredate == 1 ? '可预约'
|
||||
: '不可预约' }}</el-tag>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span class="tips">客座次数:{{ item.maxCapacity }}人</span>
|
||||
|
|
@ -60,23 +63,27 @@
|
|||
</div>
|
||||
<addEara ref="addEara" @success="tbShopAreaGet" />
|
||||
<addTable ref="addTable" @success="tbShopTableGet" />
|
||||
<downloadTableCode :total="total" ref="downloadTableCode" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import addEara from './components/addEara'
|
||||
import addTable from './components/addTable'
|
||||
import downloadTableCode from './components/downloadTableCode'
|
||||
import { tbShopTableGet, tbShopAreaGet, tbShopAreaDelete, tbShopTableDelete } from '@/api/table'
|
||||
export default {
|
||||
components: {
|
||||
addEara,
|
||||
addTable
|
||||
addTable,
|
||||
downloadTableCode
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabVlaue: '',
|
||||
tabs: [],
|
||||
loading: false,
|
||||
total: 0,
|
||||
tableList: [],
|
||||
status: {
|
||||
subscribe: {
|
||||
|
|
@ -128,11 +135,12 @@ export default {
|
|||
async tbShopTableGet() {
|
||||
this.loading = true
|
||||
try {
|
||||
const { content } = await tbShopTableGet({
|
||||
const { content, total } = await tbShopTableGet({
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
areaId: this.tabVlaue
|
||||
})
|
||||
this.tableList = content
|
||||
this.total = total
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
}, 300)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,132 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<!-- <div class="head-container">
|
||||
<el-form :model="query" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="query.shopId" placeholder="请输入店铺ID"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div> -->
|
||||
<div class="head-container">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="$refs.addActive.show()">
|
||||
添加活动
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.data" v-loading="tableData.loading">
|
||||
<el-table-column label="店铺ID" prop="shopId"></el-table-column>
|
||||
<el-table-column label="最小金额" prop="minNum"></el-table-column>
|
||||
<el-table-column label="最大金额" prop="maxNum"></el-table-column>
|
||||
<el-table-column label="赠送金额" prop="handselNum"></el-table-column>
|
||||
<el-table-column label="赠送类型" prop="handselType">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.handselType | handselTypeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="排序" sortable prop="sort"></el-table-column> -->
|
||||
<el-table-column label="是否启用" prop="isDel">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.isDel" active-value="0" inactive-value="1"
|
||||
@change="statusChange($event, scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" icon="el-icon-edit"
|
||||
@click="$refs.addActive.show(scope.row)">编辑</el-button>
|
||||
<!-- <el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
|
||||
slot="reference">删除</el-button>
|
||||
</el-popconfirm> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total"></el-pagination>
|
||||
</div>
|
||||
<addActive ref="addActive" @success="getTableData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import handselTypes from './handselTypes'
|
||||
import addActive from './components/addActive'
|
||||
import { findActivate, modityActivate } from '@/api/shop'
|
||||
import dayjs from 'dayjs'
|
||||
export default {
|
||||
components: {
|
||||
addActive
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
query: {
|
||||
shopId: ''
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 10,
|
||||
loading: false,
|
||||
total: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
handselTypeFilter(value) {
|
||||
return handselTypes.find(item => item.value == value).label
|
||||
},
|
||||
timeFilter(s) {
|
||||
return dayjs(s).format('YYYY-MM-DD HH:mm:ss')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
// 切换状态
|
||||
async statusChange(e, row) {
|
||||
try {
|
||||
this.tableData.loading = true
|
||||
const data = { ...row }
|
||||
data.status = e
|
||||
await modityActivate(data)
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
this.tableData.loading = false
|
||||
}
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query.name = ''
|
||||
this.query.type = ''
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await findActivate({
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.data = res
|
||||
this.tableData.total = res.length
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,376 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<!-- <el-tabs v-model="orderType" @tab-click="getTableData">
|
||||
<el-tab-pane label="收款" name="1"></el-tab-pane>
|
||||
<el-tab-pane label="销量" name="2"></el-tab-pane>
|
||||
</el-tabs> -->
|
||||
<div class="head-container">
|
||||
<el-form :model="query" inline label-position="left">
|
||||
<el-radio-group v-model="timeValue" @change="timeChange">
|
||||
<el-radio-button label="">全部</el-radio-button>
|
||||
<el-radio-button label="0">今天</el-radio-button>
|
||||
<el-radio-button label="-1">昨天</el-radio-button>
|
||||
<el-radio-button label="-7">最近7天</el-radio-button>
|
||||
<el-radio-button label="-30">最近30天</el-radio-button>
|
||||
<el-radio-button label="week">本周</el-radio-button>
|
||||
<el-radio-button label="month">本月</el-radio-button>
|
||||
<el-radio-button label="custom">自定义</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-date-picker v-model="query.createdAt" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
>
|
||||
</el-date-picker>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
<el-button icon="el-icon-download" v-loading="downloadLoading" @click="downloadHandle">
|
||||
<span v-if="!downloadLoading">导出Excel</span>
|
||||
<span v-else>下载中...</span>
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- <div class="head-container">
|
||||
<div class="collect_wrap">
|
||||
<div class="item" v-for="item in payCountList" :key="item.id">
|
||||
<div class="icon_wrap" style="--bg-color:#C978EE">
|
||||
<i class="icon" :class="item.icon"></i>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="m">
|
||||
<template v-if="item.isAmount == 1">¥</template>
|
||||
{{ item.payAmount }}
|
||||
</div>
|
||||
<div class="t">{{ item.payType }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.data" v-loading="tableData.loading" v-if="orderType == 1">
|
||||
|
||||
<el-table-column
|
||||
type="index"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column label="id" prop="id"></el-table-column>
|
||||
<!-- <el-table-column label="头像地址" prop="headImg">
|
||||
<template v-slot="scope">
|
||||
<el-image :src="scope.row.headImg"
|
||||
style="width:40px;height: 40px;border-radius: 4px;background-color: #efefef;">
|
||||
<div class="img_error" slot="error">
|
||||
<i class="icon el-icon-document-delete"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="门店" prop="shopName"></el-table-column>
|
||||
<el-table-column label="用户手机号" prop="userPhone"></el-table-column>
|
||||
<el-table-column label="用户名" prop="userName"></el-table-column>
|
||||
<el-table-column label="充值金额" prop="rechargeAmount"></el-table-column>
|
||||
<el-table-column label="充值类型" prop="rechargeType"></el-table-column>
|
||||
<el-table-column label="充值时间" prop="rechargeTime"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" @size-change="sizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { tbShopUserRecharge,downloadTableRecharge } from '@/api/shop'
|
||||
import dayjs from "dayjs";
|
||||
import { downloadFile } from "@/utils/index";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
timeValue: "",
|
||||
resetQuery: null,
|
||||
orderType: "1",
|
||||
categorys: [],
|
||||
query: {
|
||||
createdAt: [],
|
||||
proName: '',
|
||||
cateId: ''
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 10,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
downloadLoading: false,
|
||||
payCountList: "",
|
||||
payCountTotal: 0
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
timeFilter(time) {
|
||||
return dayjs(time).format("YYYY-MM-DD HH:mm:ss");
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.resetQuery = { ...this.query };
|
||||
this.getTableData();
|
||||
},
|
||||
methods: {
|
||||
//携带table id跳转到订单列表页面
|
||||
toTableOrderList(data){
|
||||
console.log(data)
|
||||
this.$router.push({
|
||||
path:'/order_manage/order_list',
|
||||
query:{
|
||||
tableName: data.tableName
|
||||
}
|
||||
})
|
||||
},
|
||||
// 导出Excel
|
||||
async downloadHandle() {
|
||||
try {
|
||||
this.downloadLoading = true;
|
||||
const file = await downloadTableRecharge({
|
||||
startTime: this.query.createdAt[0],
|
||||
endTime: this.query.createdAt[1],
|
||||
});
|
||||
downloadFile(file, "数据", "xlsx");
|
||||
this.downloadLoading = false;
|
||||
} catch (error) {
|
||||
this.downloadLoading = false;
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.timeValue = "";
|
||||
this.query = { ...this.resetQuery };
|
||||
this.page = 0;
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页大小改变
|
||||
sizeChange(e) {
|
||||
this.tableData.size = e;
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1;
|
||||
this.getTableData();
|
||||
},
|
||||
async getTableData() {
|
||||
this.tableData.loading = true;
|
||||
try {
|
||||
const res = await tbShopUserRecharge({
|
||||
page: this.tableData.page+1,
|
||||
size: this.tableData.size,
|
||||
startTime:this.query.createdAt[0],
|
||||
endTime:this.query.createdAt[1]
|
||||
});
|
||||
console.log(res.records)
|
||||
this.tableData.loading = false;
|
||||
this.tableData.data = res.records;
|
||||
this.tableData.total = res.total;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 切换时间
|
||||
timeChange(e) {
|
||||
const format = ["YYYY-MM-DD 00:00:00", "YYYY-MM-DD 23:59:59"];
|
||||
switch (e) {
|
||||
case "":
|
||||
// 全部
|
||||
this.query.createdAt = [];
|
||||
break;
|
||||
case "0":
|
||||
// 今天
|
||||
this.query.createdAt = [
|
||||
dayjs().format(format[0]),
|
||||
dayjs().format(format[1])
|
||||
];
|
||||
break;
|
||||
case "-1":
|
||||
// 昨天
|
||||
this.query.createdAt = [
|
||||
dayjs()
|
||||
.add(-1, "d")
|
||||
.format(format[0]),
|
||||
dayjs()
|
||||
.add(-1, "d")
|
||||
.format(format[1])
|
||||
];
|
||||
break;
|
||||
case "-7":
|
||||
// 最近7天
|
||||
this.query.createdAt = [
|
||||
dayjs()
|
||||
.add(-7, "d")
|
||||
.format(format[0]),
|
||||
dayjs().format(format[1])
|
||||
];
|
||||
break;
|
||||
case "-30":
|
||||
// 最近7天
|
||||
this.query.createdAt = [
|
||||
dayjs()
|
||||
.add(-30, "d")
|
||||
.format(format[0]),
|
||||
dayjs().format(format[1])
|
||||
];
|
||||
break;
|
||||
case "week":
|
||||
// 本周
|
||||
this.query.createdAt = [
|
||||
dayjs()
|
||||
.startOf("week")
|
||||
.format(format[0]),
|
||||
dayjs()
|
||||
.endOf("week")
|
||||
.format(format[1])
|
||||
];
|
||||
break;
|
||||
case "month":
|
||||
// 本周
|
||||
this.query.createdAt = [
|
||||
dayjs()
|
||||
.startOf("month")
|
||||
.format(format[0]),
|
||||
dayjs()
|
||||
.endOf("month")
|
||||
.format(format[1])
|
||||
];
|
||||
break;
|
||||
case "custom":
|
||||
// 自定义
|
||||
this.query.createdAt = [];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.cursor-pointer{
|
||||
cursor: pointer;
|
||||
color: #1890ff;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.cursor-pointer:hover{
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
.collect_wrap {
|
||||
display: flex;
|
||||
gap: 14px;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #f5f5f5;
|
||||
padding: 20px;
|
||||
|
||||
.icon_wrap {
|
||||
$size: 34px;
|
||||
$border: 6px;
|
||||
width: $size;
|
||||
height: $size;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: var(--bg-color);
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
width: $size + $border;
|
||||
height: $size + $border;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: var(--bg-color);
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.icon {
|
||||
font-size: 16px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-left: 10px;
|
||||
|
||||
.m {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.t {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
padding-top: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.refund {
|
||||
color: #ff9731;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.table_order_info {
|
||||
.order_no {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.type {
|
||||
color: #e6a23c;
|
||||
}
|
||||
}
|
||||
|
||||
.goods_info {
|
||||
.row {
|
||||
display: flex;
|
||||
|
||||
&:not(:first-child) {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.cover {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-left: 10px;
|
||||
|
||||
.sku {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-dialog :title="form.id ? '编辑活动' : '添加活动'" :visible.sync="dialogVisible" @close="reset">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="left">
|
||||
<el-form-item label="最小金额">
|
||||
<el-input-number v-model="form.minNum" controls-position="right" :min="1"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="最大金额">
|
||||
<el-input-number v-model="form.maxNum" controls-position="right" :min="1"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="赠送数量">
|
||||
<el-input-number v-model="form.handselNum" controls-position="right" :min="1"></el-input-number>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="赠送类型">
|
||||
<el-select v-model="form.handselType">
|
||||
<el-option :label="item.label" :value="item.value" v-for="item in handselTypes"
|
||||
:key="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="状态">
|
||||
<el-switch v-model="form.isDel" active-value="0" inactive-value="1"></el-switch>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="onSubmitHandle">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import handselTypes from '../handselTypes'
|
||||
import { modityActivate } from '@/api/shop'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
handselTypes: handselTypes,
|
||||
form: {
|
||||
id: '',
|
||||
shopId: '',
|
||||
minNum: 1,
|
||||
maxNum: 1,
|
||||
handselNum: 1, // 打印类型
|
||||
handselType: 'GD',
|
||||
isDel: '0'
|
||||
},
|
||||
resetForm: '',
|
||||
rules: {
|
||||
minNum: [
|
||||
{
|
||||
required: true,
|
||||
message: ' ',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
maxNum: [
|
||||
{
|
||||
required: true,
|
||||
message: ' ',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.resetForm = { ...this.form }
|
||||
},
|
||||
methods: {
|
||||
// 确认选择商品分类
|
||||
classifySuccess(e) {
|
||||
this.form.config.categoryList = e
|
||||
},
|
||||
onSubmitHandle() {
|
||||
console.log(this.form)
|
||||
this.$refs.form.validate(async valid => {
|
||||
if (valid) {
|
||||
try {
|
||||
this.loading = true
|
||||
this.form.shopId = localStorage.getItem('shopId')
|
||||
let res = await modityActivate(this.form)
|
||||
this.$emit('success', res)
|
||||
this.close()
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: `${this.form.id ? '编辑' : '添加'}成功`,
|
||||
type: 'success'
|
||||
});
|
||||
this.loading = false
|
||||
} catch (error) {
|
||||
this.loading = false
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
show(obj) {
|
||||
this.dialogVisible = true
|
||||
if (obj && obj.id) {
|
||||
this.form = { ...obj }
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
reset() {
|
||||
this.form = { ...this.resetForm }
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
export default [
|
||||
{
|
||||
label: "固定金额",
|
||||
value: "GD"
|
||||
},
|
||||
{
|
||||
label: "比例",
|
||||
value: "RATIO"
|
||||
}
|
||||
];
|
||||
|
|
@ -0,0 +1,291 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-form :model="query" inline>
|
||||
<el-form-item label="搜索">
|
||||
<el-input
|
||||
v-model="query.name"
|
||||
placeholder="请输入昵称或手机号"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否为会员">
|
||||
<el-select v-model="query.isVip" placeholder="是否是会员">
|
||||
<el-option value="" label="全部"></el-option>
|
||||
<el-option :value="1" label="是"></el-option>
|
||||
<el-option :value="0" label="否"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- <div class="head-container">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="$refs.addActive.show()">
|
||||
添加活动
|
||||
</el-button>
|
||||
</div> -->
|
||||
<div class="head-container">
|
||||
<div class="card">
|
||||
<!-- <div class="title">统计数据</div> -->
|
||||
<div class="row">
|
||||
<div class="item">
|
||||
<div class="t">会员数</div>
|
||||
<div class="n">{{ shopInfo.userTotal || 0 }}</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="t">会员余额</div>
|
||||
<div class="n">{{ shopInfo.balanceTotal || 0 }}</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="t">充值金额</div>
|
||||
<div class="n">{{ shopInfo.chageTotal || 0 }}</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<el-button type="success" @click="toPage('charge')"
|
||||
>充值记录</el-button
|
||||
>
|
||||
<!-- <el-button type="danger" @click="toPage('cost')">消费记录</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.data" v-loading="tableData.loading">
|
||||
<el-table-column label="ID" prop="id"></el-table-column>
|
||||
<el-table-column label="用户" prop="headImg" width="200px">
|
||||
<template v-slot="scope">
|
||||
<div class="user_info">
|
||||
<el-image
|
||||
:src="scope.row.headImg"
|
||||
style="width: 40px;height: 40px;flex-shrink: 0;"
|
||||
>
|
||||
<div slot="error" class="image-slot">
|
||||
<i class="el-icon-user"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
<span class="name">{{ scope.row.nickName }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="性别" prop="sex">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="priamry">{{ scope.row.sex || "未知" }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="会员" prop="isVip">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="warning" v-if="scope.row.isVip"
|
||||
>会员等级{{ scope.row.isVip }}</el-tag
|
||||
>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="余额" prop="amount"></el-table-column>
|
||||
<el-table-column label="积分" prop="totalScore"></el-table-column>
|
||||
<el-table-column
|
||||
label="手机号"
|
||||
prop="telephone"
|
||||
width="160"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="生日"
|
||||
prop="birthDay"
|
||||
width="200"
|
||||
></el-table-column>
|
||||
<el-table-column label="注册时间" prop="createAt" width="200">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.createAt | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最近登录时间" prop="lastLoginAt" width="200">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.lastLoginAt | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="操作" width="90" fixed="right">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" @click="$refs.addActive.show(scope.row)">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
|
||||
slot="reference">删除</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination
|
||||
:total="tableData.total"
|
||||
:current-page="tableData.page + 1"
|
||||
:page-size="tableData.size"
|
||||
@size-change="sizeChange"
|
||||
@current-change="paginationChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { queryAllShopUser, queryAllShopInfo } from "@/api/shop";
|
||||
import dayjs from "dayjs";
|
||||
let cacheData = {};
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
query: {
|
||||
name: "",
|
||||
isVip: 1
|
||||
},
|
||||
shopInfo: {
|
||||
balanceTotal: 0,
|
||||
userTotal: 0,
|
||||
chageTotal: 0
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 10,
|
||||
loading: false,
|
||||
total: 0
|
||||
}
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
timeFilter(s) {
|
||||
return dayjs(s).format("YYYY-MM-DD HH:mm:ss");
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
cacheData = { ...this.query };
|
||||
this.getTableData();
|
||||
this.getShopInfo();
|
||||
},
|
||||
methods: {
|
||||
toPage(type) {
|
||||
const pages = {
|
||||
charge: "charge_list",
|
||||
cost: "cost_list"
|
||||
};
|
||||
this.$router.push({
|
||||
name: pages[type]
|
||||
});
|
||||
console.log(pages[type]);
|
||||
},
|
||||
// 获取商家用户概述信息
|
||||
async getShopInfo() {
|
||||
try {
|
||||
const res = await queryAllShopInfo(this.query);
|
||||
this.shopInfo = res;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
sizeChange() {
|
||||
this.tableData.page = 0;
|
||||
this.getTableData();
|
||||
},
|
||||
// 切换状态
|
||||
async statusChange(e, row) {
|
||||
try {
|
||||
this.tableData.loading = true;
|
||||
const data = { ...row };
|
||||
data.status = e;
|
||||
await modityActivate(data);
|
||||
this.getTableData();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
this.tableData.loading = false;
|
||||
}
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query.name = "";
|
||||
this.query.isVip = 1;
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1;
|
||||
this.getTableData();
|
||||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true;
|
||||
//用于当页码为2以及以上查询条件更改时重置页码
|
||||
if (cacheData.isVip !== this.query.isVip) {
|
||||
this.tableData.page = 0;
|
||||
}
|
||||
cacheData.isVip = this.query.isVip;
|
||||
try {
|
||||
const res = await queryAllShopUser({
|
||||
...this.query,
|
||||
size: this.tableData.size,
|
||||
page: this.tableData.page + 1
|
||||
});
|
||||
this.tableData.loading = false;
|
||||
this.tableData.data = res.content;
|
||||
this.tableData.total = res.totalElements;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.user_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.name {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .image-slot {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #efefef;
|
||||
font-size: 20px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.card {
|
||||
background-color: #f5f5f5;
|
||||
padding: 0 14px;
|
||||
|
||||
.title {
|
||||
font-size: 22px;
|
||||
padding-top: 14px;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
padding: 20px 0;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
|
||||
.t {
|
||||
text-align: center;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.n {
|
||||
color: #000;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
padding-top: 6px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -46,6 +46,10 @@ module.exports = {
|
|||
configureWebpack: {
|
||||
// provide the app's title in webpack's name field, so that
|
||||
// it can be accessed in index.html to inject the correct title.
|
||||
// 关闭 webpack 的性能提示
|
||||
performance: {
|
||||
hints: false
|
||||
},
|
||||
name: name,
|
||||
resolve: {
|
||||
alias: {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
const TerserPlugin = require("terser-webpack-plugin");
|
||||
|
||||
module.exports = {
|
||||
// 其他配置项...
|
||||
optimization: {
|
||||
minimize: true, // 必须开启,否则配置不失效
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
terserOptions: {
|
||||
compress: {
|
||||
drop_console: true
|
||||
}
|
||||
}
|
||||
})
|
||||
]
|
||||
}
|
||||
};
|
||||
Loading…
Reference in New Issue