mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-20 01:45:53 +08:00
Compare commits
70 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43f214b40a | ||
|
|
d701c72928 | ||
|
|
028f32a73c | ||
|
|
e5d98d022e | ||
|
|
799184fd21 | ||
|
|
756cb28daa | ||
|
|
5f6eb6a26d | ||
|
|
4efbec5741 | ||
|
|
86dbc0d86e | ||
|
|
c32d011851 | ||
|
|
311ca35afc | ||
|
|
1a3fae6501 | ||
|
|
3432530de7 | ||
|
|
af85493863 | ||
|
|
ae85f0d612 | ||
|
|
16c4a78e29 | ||
|
|
8fb87aa64d | ||
|
|
c5d675b6d2 | ||
|
|
f4d06b2d7b | ||
|
|
bb610a7cd8 | ||
|
|
bb864e72b3 | ||
|
|
c6c4797d87 | ||
|
|
25fed42395 | ||
|
|
66c4676493 | ||
|
|
f8747b5d5d | ||
|
|
0eb58d4b8a | ||
|
|
7b30ea343f | ||
|
|
7db8484a7c | ||
|
|
78b058009b | ||
|
|
05abad3905 | ||
|
|
ad178b1806 | ||
|
|
075c20ae41 | ||
|
|
56420bd4d0 | ||
|
|
a18fc729c0 | ||
|
|
099941a54e | ||
|
|
3867d51d92 | ||
|
|
f1be18b7e3 | ||
|
|
ef46380f9e | ||
|
|
d711273cf0 | ||
|
|
5e7cf2d679 | ||
|
|
11319ba21f | ||
|
|
b4a706820e | ||
|
|
376a3223dc | ||
|
|
a85ec69549 | ||
|
|
ebf4d6d3eb | ||
|
|
2ccd8265b9 | ||
|
|
fb1671d062 | ||
|
|
95e37df2ec | ||
|
|
cfde72f1ab | ||
|
|
efc778acbc | ||
|
|
37384ebadd | ||
|
|
9a7aee7e97 | ||
|
|
1a56534d28 | ||
|
|
79e7e5f087 | ||
|
|
aea03cf975 | ||
|
|
8ef6f944dc | ||
|
|
e18d243961 | ||
|
|
765b633cea | ||
|
|
9c402a3878 | ||
|
|
86426b087a | ||
|
|
c5aaa2f3e2 | ||
|
|
cc59bb6094 | ||
|
|
5662da1210 | ||
|
|
863725d3ba | ||
|
|
b1acfbdd4b | ||
|
|
001f9c3f30 | ||
|
|
8d4df4b66e | ||
|
|
604447508a | ||
|
|
6f30949620 | ||
|
|
10e8e82fe4 |
38
.trae/documents/Fix TDesign form reset in Custom Words.md
Normal file
38
.trae/documents/Fix TDesign form reset in Custom Words.md
Normal file
@@ -0,0 +1,38 @@
|
||||
## 目标
|
||||
- 增加 Tabs 与内容的间距样式
|
||||
- 将“查看”弹窗统一为右侧抽屉并用 `t-descriptions` 展示
|
||||
- 修复自定义分词页面 `resetFields()` 报错为 TDesign 的 `reset()`
|
||||
|
||||
## 涉及页面与改动
|
||||
### 1) 站内信模板
|
||||
- 文件:`manager/src/views/sys/message/noticeMessageTemplate.vue`
|
||||
- 改动:
|
||||
- 给 `t-tabs` 增加类名(如 `notice-tabs`),样式:`::v-deep(.notice-tabs .t-tabs__content){ padding-top:16px }`
|
||||
- 在每个 `t-tab-panel` 内包裹 `div.tab-content` 并设 `padding-top:16px`
|
||||
- 将查看详情 `t-dialog` 改为 `t-drawer`(`placement="right" size="800px"`),内容改为 `t-descriptions` 单列展示(标题、类型、模板内容等),保留编辑/发送交互不变
|
||||
|
||||
### 2) 意见反馈
|
||||
- 文件:`manager/src/views/page/feedback/feedback.vue`
|
||||
- 改动:
|
||||
- 将详情 `t-dialog` 改为 `t-drawer`(右侧展开)
|
||||
- 只读内容用 `t-descriptions` 单列展示(用户名、手机、类型、内容、图片列表),移除禁用表单控件
|
||||
- 分页区域由 iView `Row/Page` 改为 `t-pagination`(保持现有页码/页大小逻辑)
|
||||
- 抽屉底部仅保留“返回”按钮(左对齐)
|
||||
|
||||
### 3) 自定义分词
|
||||
- 文件:`manager/src/views/custom-words/index.vue`
|
||||
- 改动:
|
||||
- 在 `add()` 等调用中,将 `this.$refs.form.resetFields()` 替换为:
|
||||
- `if (this.$refs.form && typeof this.$refs.form.reset === 'function') { this.$refs.form.reset(); } else { this.form = { name: '' } }`
|
||||
- 初始化 `this.form` 改为显式字段对象,确保校验兼容
|
||||
- 检查页面是否存在其他 iView API(如 `$Message/$Modal`),若有统一为 `MessagePlugin/DialogPlugin`
|
||||
|
||||
## 验证
|
||||
- 打开对应页面,切换 Tabs,间距生效
|
||||
- 点击“查看”→ 抽屉从右侧展开,信息以 `t-descriptions` 单列展示,底部仅“返回”按钮
|
||||
- 自定义分词点击“添加”,不再出现 `resetFields` 报错,表单成功清空
|
||||
- 分页切换正常且无控制台警告
|
||||
|
||||
## 注意
|
||||
- 不改动现有业务接口与数据结构;仅替换 UI 容器与只读展示方式
|
||||
- 样式值可根据视觉反馈上调(如 20px)
|
||||
1
.vercel/project.json
Normal file
1
.vercel/project.json
Normal file
@@ -0,0 +1 @@
|
||||
{"neverMindDeployCard":true}
|
||||
80
README.md
80
README.md
@@ -1,16 +1,12 @@
|
||||
## Lilishop B2B2C商城系统
|
||||
|
||||
#### 欢迎交流需求,交流业务,交流技术(基础问题自行解决,其他问题先看文档后提问)
|
||||
|
||||
#### 不用削尖脑袋往老群里加,老群活跃度较低,很多潜水党,新群相对而言活跃一些 :tw-1f606: :tw-1f606: :tw-1f606: :tw-1f606: :tw-1f606: :tw-1f606:
|
||||
|
||||
#### PS: **演示站点所有环境均部署master分支。如果有演示站点问题,可以反馈,如果演示站点没问题本地运行有问题,需自行处理**
|
||||
|
||||
##### 交流 qq 1群 961316482(已满)
|
||||
##### 交流 qq 2群 875294241(已满)
|
||||
##### 交流 qq 3群 263785057(已满)
|
||||
##### 交流 qq 4群 674617534 (已满)
|
||||
##### 交流 qq 5群 594675235
|
||||
- **[在线客服](https://work.weixin.qq.com/kfid/kfc4d8dc24a73c15f44)**
|
||||
- **微信交流1群(已满)**
|
||||
- **微信交流2群**:
|
||||

|
||||
|
||||
##### 体验 公众号/小程序/APP 体验,扫描二维码
|
||||
|
||||
@@ -19,6 +15,41 @@
|
||||
[](https://gitee.com/beijing_hongye_huicheng/lilishop/stargazers)
|
||||

|
||||
|
||||
## 2025-10-10日更新
|
||||
兼容更高的node版本16
|
||||
|
||||
这里我用的是node版本 v16.20.2
|
||||
|
||||
npm版本 8.19.4
|
||||
|
||||
使用yarn install 然后执行 yarn dev
|
||||
|
||||
yarn 安装/启动
|
||||
```
|
||||
// 如果没有 yarn 安装yarn
|
||||
npm install yarn -g
|
||||
|
||||
// 切换源
|
||||
yarn config set registry https://registry.npmmirror.com
|
||||
|
||||
// 以buyer项目为例
|
||||
cd buyer
|
||||
|
||||
yarn install
|
||||
|
||||
yarn dev
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
没有二开过的项目直接拉最新代码即可,二开项目可以跟着提交记录一起同步修改 install出现问题检查的话删除 "package-lock.json" 重新install
|
||||
|
||||
Q&A 为什么不升级更高的node版本? :因为高node版本 OpenSSL 改动 导致旧版本 Webpack 插件会失效 试了好几次如果兼容的话 需要升级Webpack5以及其他的插件 升级内容较多 为了更稳定的还是尽量少动为主
|
||||
|
||||
****
|
||||
|
||||
|
||||
## 如何在本地环境运行lilishop-ui部署视频
|
||||
https://www.bilibili.com/video/BV1B28EeJEnP/
|
||||
|
||||
@@ -29,8 +60,11 @@ https://www.bilibili.com/video/BV1WD87eoE9F/
|
||||
## 开发项目
|
||||
|
||||
#### 安装Node.js
|
||||
|
||||
保证`node`版本`14`,推荐 14.17.0
|
||||
|
||||
2025-10-10日拉的代码之后不限制于node版本为14,这里只是以14版本为例子
|
||||
|
||||
可以使用 `yarn` 或者 `npm` 进行安装
|
||||
|
||||
#### yarn 安装/启动
|
||||
@@ -49,17 +83,6 @@ yarn install
|
||||
yarn dev
|
||||
```
|
||||
|
||||
#### npm 安装/启动
|
||||
```
|
||||
npm config set registry https://registry.npmmirror.com
|
||||
|
||||
// 以buyer项目为例
|
||||
cd buyer
|
||||
|
||||
npm run install
|
||||
|
||||
npm run dev
|
||||
```
|
||||
|
||||
#### FAQ
|
||||
|
||||
@@ -109,6 +132,13 @@ github 镜像: https://github.com/lilishop?tab=repositories
|
||||
商城UI 项目下3个文件夹
|
||||
buyer:买家PC端,seller:商家端,manager:后台管理端
|
||||
|
||||
### 前端 UI 框架与版本
|
||||
|
||||
- manager:`tdesign-vue@^1.14.2`、`tdesign-icons-vue@^0.2.3`、`view-design@^4.7.0`、`vue@2.6.14`
|
||||
- buyer:`view-design@^4.3.2`、`vue@^2.6.11`
|
||||
- seller:`view-design@^4.6.1`、`vue@^2.6.10`
|
||||
- im:`element-ui@^2.14.1`、`vue@^2.6.11`
|
||||
|
||||
|
||||
### 演示地址
|
||||
PS:手机验证码为 ‘111111’
|
||||
@@ -223,19 +253,9 @@ PS:手机验证码为 ‘111111’
|
||||
|
||||
4.限制商用,如果需要商业使用请联系我们。QQ3409056806.或者加入qq群联系群主。
|
||||
|
||||
|
||||
|
||||
### 交流群
|
||||
|
||||
##### 交流 qq 1群 961316482(已满)
|
||||
##### 交流 qq 2群 875294241(已满)
|
||||
##### 交流 qq 3群 263785057(已满)
|
||||
##### 交流 qq 4群 674617534(已满)
|
||||
##### 交流 qq 5群 594675235
|
||||
|
||||
### 附录
|
||||
有人有自己的学习视频、学习记录文档、希望宣传关联开源项目等均可以私聊仓库所有者。
|
||||
|
||||
类似:
|
||||
|
||||
清晨敲代码同学的分析: https://blog.csdn.net/vaevaevae233/category_12103567.html
|
||||
清晨敲代码同学的分析: https://blog.csdn.net/vaevaevae233/category_12103567.html
|
||||
|
||||
1
buyer/.npmrc
Normal file
1
buyer/.npmrc
Normal file
@@ -0,0 +1 @@
|
||||
engine-strict=false
|
||||
1
buyer/.yarnrc
Normal file
1
buyer/.yarnrc
Normal file
@@ -0,0 +1 @@
|
||||
--ignore-engines true
|
||||
@@ -1,19 +1,5 @@
|
||||
# new
|
||||
### UI 框架与版本
|
||||
|
||||
## Project setup
|
||||
```
|
||||
npm install
|
||||
```
|
||||
- `view-design@^4.3.2`
|
||||
- `vue@^2.6.11`
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||
|
||||
@@ -3,9 +3,12 @@
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vue-cli-service serve",
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build"
|
||||
"build": "vue-cli-service build",
|
||||
"dev": "vue-cli-service serve"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"dependencies": {
|
||||
"@amap/amap-jsapi-loader": "0.0.7",
|
||||
@@ -15,11 +18,10 @@
|
||||
"less": "^2.7.0",
|
||||
"less-loader": "^5.0.0",
|
||||
"mv-count-down": "^0.1.15",
|
||||
"node-sass": "^4.14.1",
|
||||
"postcss-loader": "^7.0.1",
|
||||
"sass": "^1.63.6",
|
||||
"postcss-loader": "^4.3.0",
|
||||
"psl": "^1.8.0",
|
||||
"qs": "^6.9.4",
|
||||
"sass-loader": "^7.3.1",
|
||||
"uuid": "^8.3.2",
|
||||
"view-design": "^4.3.2",
|
||||
"vue": "^2.6.11",
|
||||
@@ -32,7 +34,7 @@
|
||||
"devDependencies": {
|
||||
"@vue/cli-service": "~4.5.0",
|
||||
"compression-webpack-plugin": "^5.0.0",
|
||||
"sass-loader": "^7.3.1",
|
||||
"sass-loader": "^10.4.1",
|
||||
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||
"vue-template-compiler": "^2.6.11"
|
||||
},
|
||||
@@ -40,5 +42,10 @@
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not dead"
|
||||
]
|
||||
],
|
||||
"resolutions": {
|
||||
"minimatch": "^3.1.2",
|
||||
"node-sass": "npm:sass@^1.63.6",
|
||||
"@achrinza/node-ipc": "9.2.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,12 +10,10 @@ import { getBaseSite } from "@/api/common.js";
|
||||
export default {
|
||||
name: "App",
|
||||
mounted() {
|
||||
|
||||
this.init();
|
||||
},
|
||||
methods:{
|
||||
init(){
|
||||
|
||||
if(!storage.getItem("siteName")||!storage.getItem("logoImg")||!storage.getItem("sitelogo_expiration_time")) {
|
||||
this.getSite();
|
||||
}else{
|
||||
@@ -35,7 +33,6 @@ export default {
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
getSite(){
|
||||
//获取基本站点信息
|
||||
getBaseSite().then((res) => {
|
||||
|
||||
@@ -63,7 +63,7 @@ export function addCartGoods (params) {
|
||||
|
||||
/**
|
||||
* 创建交易
|
||||
* @param client 客户端:H5/移动端 PC/PC端,WECHAT_MP/小程序端,APP/移动应用端
|
||||
* @param client 客户端:H5/移动端 PC/PC端,WECHAT_MP/小程序,APP/移动应用端
|
||||
* @param way 购物车购买:CART/立即购买:BUY_NOW / 积分购买:POINT
|
||||
* @param remark 备注 非必填
|
||||
*/
|
||||
|
||||
@@ -10,19 +10,6 @@ export function getVerifyImg (verificationEnums) {
|
||||
needToken: false
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function getImSetting(params) {
|
||||
return request({
|
||||
url: `/buyer/other/setting/get/IM_SETTING`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 验证码校验
|
||||
*/
|
||||
|
||||
@@ -527,44 +527,3 @@ export function getGoodsDistribution (distributionId) {
|
||||
needToken: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会员发票抬头列表
|
||||
*/
|
||||
export function getMemberReceiptList (params) {
|
||||
return request({
|
||||
url: `/buyer/wallet/receipt`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存会员发票抬头
|
||||
*/
|
||||
export function setMemberReceiptList (params) {
|
||||
return request({
|
||||
url: `/buyer/wallet/receipt`,
|
||||
method: Method.POST,
|
||||
needToken: true,
|
||||
data:params
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存会员发票抬头
|
||||
*/
|
||||
export function delMemberReceipt(id) {
|
||||
return request({
|
||||
url: `/buyer/wallet/receipt/${id}`,
|
||||
method: Method.DELETE,
|
||||
needToken: true,
|
||||
params:{id},
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ export default {
|
||||
border-radius: 18.9px;
|
||||
|
||||
|
||||
/deep/ .ivu-input.ivu-input-large {
|
||||
::v-deep .ivu-input.ivu-input-large {
|
||||
border: 1.4px solid $theme_color;
|
||||
box-sizing: border-box;
|
||||
border-radius: 19.6px;
|
||||
@@ -188,7 +188,7 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .ivu-input-group-append {
|
||||
::v-deep .ivu-input-group-append {
|
||||
border-radius: 19.6px !important;
|
||||
cursor: pointer;
|
||||
box-sizing: border-box;
|
||||
|
||||
@@ -113,12 +113,12 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .ivu-card, .ivu-card-head, ._Card {
|
||||
::v-deep .ivu-card, .ivu-card-head, ._Card {
|
||||
margin-bottom: 20px;
|
||||
@include white_background_color();
|
||||
}
|
||||
|
||||
/deep/ .ivu-card-head {
|
||||
::v-deep .ivu-card-head {
|
||||
position: relative;
|
||||
padding: 0 14px;
|
||||
height: 50px;
|
||||
@@ -140,7 +140,7 @@ export default {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/deep/ .ivu-card-body {
|
||||
::v-deep .ivu-card-body {
|
||||
padding: 0 !important;
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -147,11 +147,11 @@ export default {
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
/deep/.popup .ivu-drawer-body{
|
||||
::v-deep.popup .ivu-drawer-body{
|
||||
padding: 0!important;
|
||||
background-color: #eee;
|
||||
}
|
||||
/deep/.popup .ivu-drawer-wrap{
|
||||
::v-deep.popup .ivu-drawer-wrap{
|
||||
z-index: 3001;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -326,7 +326,7 @@ export default {
|
||||
.item-intro-img {
|
||||
width: 100%;
|
||||
min-height: 300px;
|
||||
/deep/ img{
|
||||
::v-deep img{
|
||||
margin:0 auto;
|
||||
}
|
||||
}
|
||||
@@ -472,7 +472,7 @@ export default {
|
||||
.ivu-tabs-ink-bar {
|
||||
background-color: $theme_color !important;
|
||||
}
|
||||
/deep/.ivu-tabs-bar{
|
||||
::v-deep.ivu-tabs-bar{
|
||||
border: none;
|
||||
}
|
||||
.item-tabs > .ivu-tabs > .ivu-tabs-bar .ivu-tabs-tab{
|
||||
|
||||
@@ -81,7 +81,10 @@
|
||||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="nav-item" @click="shopEntry">店铺入驻</span>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -159,6 +162,18 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
shopEntry() {
|
||||
// 店铺入驻
|
||||
if (storage.getItem('accessToken')) {
|
||||
let routeUrl = this.$router.resolve({
|
||||
path: '/shopEntry',
|
||||
query: {id: 1}
|
||||
});
|
||||
window.open(routeUrl.href, '_blank');
|
||||
} else {
|
||||
this.$router.push('login');
|
||||
}
|
||||
},
|
||||
getCartList() {
|
||||
// 获取购物车列表
|
||||
if (this.userInfo.username) {
|
||||
|
||||
@@ -95,7 +95,11 @@ export default {
|
||||
label: "宝贝收藏",
|
||||
path: "/home/Favorites"
|
||||
},
|
||||
|
||||
{
|
||||
icon: "shop",
|
||||
label: "收藏店铺",
|
||||
path: "/home/Favorites?type=STORE"
|
||||
},
|
||||
{
|
||||
icon: "carts",
|
||||
label: "购物车",
|
||||
|
||||
@@ -84,10 +84,10 @@ export default {
|
||||
border-top: 1.4px solid #e2e2e2;
|
||||
}
|
||||
&:hover {
|
||||
/deep/ .goods-name {
|
||||
::v-deep .goods-name {
|
||||
color: $theme_color;
|
||||
}
|
||||
/deep/ .goods-desc {
|
||||
::v-deep .goods-desc {
|
||||
color: $theme_color;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
</p>
|
||||
<!-- 普通发票 -->
|
||||
<div class="nav-content">
|
||||
<Form :model="invoiceForm" ref="form" label-position="left" :label-width="110">
|
||||
<Form :model="invoiceForm" ref="form" label-position="left" :rules="ruleInline" :label-width="110">
|
||||
<FormItem label="发票类型">
|
||||
<RadioGroup v-model="invoice" type="button" button-style="solid">
|
||||
<Radio @on-change="changeInvoice" :label="1">电子普通发票</Radio>
|
||||
<Radio :label="2" >增值税专用发票</Radio>
|
||||
<Radio :label="2" :disabled="true">增值税专用发票</Radio>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
<FormItem label="发票抬头">
|
||||
@@ -24,46 +24,10 @@
|
||||
</FormItem>
|
||||
<FormItem label="单位名称" v-if="type === 2" prop="receiptTitle">
|
||||
<i-input v-model="invoiceForm.receiptTitle"></i-input>
|
||||
<Poptip ref="poptip" placement="right" width="300">
|
||||
<div class="global_color">选择其他发票抬头</div>
|
||||
<div slot="content">
|
||||
<Spin fix v-if="delReceiptLoad"></Spin>
|
||||
<div class="receipt-content">
|
||||
<div class="flex receipt-item" v-for="item in receiptList" :key="item.id" >
|
||||
<div @click="chooseReceipt(item)">
|
||||
<div class="receipt-title">{{ item.receiptTitle }}</div>
|
||||
<div>{{ item.taxpayerId }}</div>
|
||||
</div>
|
||||
<div class="global_color" @click="delReceipt(item.id)">
|
||||
删除
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
<Page :total="total" @on-change="changePage"
|
||||
:current="searchParams.pageNumber" :page-size="searchParams.pageSize" size="small" />
|
||||
</div>
|
||||
</div>
|
||||
</Poptip>
|
||||
</FormItem>
|
||||
<FormItem label="纳税人识别号" v-if="type === 2" prop="taxpayerId">
|
||||
<i-input v-model="invoiceForm.taxpayerId"></i-input>
|
||||
</FormItem>
|
||||
<div v-if="type === 2" class="more" @click="showMore = !showMore">更多选填项</div>
|
||||
<div v-if="showMore">
|
||||
<FormItem label="单位地址" v-if="type === 2" prop="address">
|
||||
<i-input v-model="invoiceForm.address"></i-input>
|
||||
</FormItem>
|
||||
<FormItem label="单位电话" v-if="type === 2" prop="mobile">
|
||||
<i-input v-model="invoiceForm.mobile"></i-input>
|
||||
</FormItem>
|
||||
<FormItem label="开户银行" v-if="type === 2" prop="bank">
|
||||
<i-input v-model="invoiceForm.bank"></i-input>
|
||||
</FormItem>
|
||||
<FormItem label="银行账号" v-if="type === 2" prop="bankNumber">
|
||||
<i-input v-model="invoiceForm.bankNumber"></i-input>
|
||||
</FormItem>
|
||||
</div>
|
||||
<FormItem label="发票内容">
|
||||
<RadioGroup v-model="invoiceForm.receiptContent" type="button" button-style="solid">
|
||||
<Radio label="商品明细">商品明细</Radio>
|
||||
@@ -72,10 +36,8 @@
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div style="text-align: center">
|
||||
|
||||
<Button type="primary" class="mr_10" :loading="loading" @click="submit">保存发票信息</Button>
|
||||
<Button type="default" @click="invoiceAvailable = false">取消</Button>
|
||||
|
||||
<Button type="primary" :loading="loading" @click="submit">保存发票信息</Button>
|
||||
<Button type="default" @click="invoiceAvailable = false">取消</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
@@ -83,15 +45,11 @@
|
||||
</template>
|
||||
<script>
|
||||
import { receiptSelect } from '@/api/cart.js';
|
||||
import { getMemberReceiptList ,setMemberReceiptList,delMemberReceipt } from '@/api/member.js';
|
||||
|
||||
import { TINumber } from '@/plugins/RegExp.js';
|
||||
export default {
|
||||
name: 'invoiceModal',
|
||||
data () {
|
||||
return {
|
||||
receiptList:[],
|
||||
showMore:false,
|
||||
delReceiptLoad:false,
|
||||
invoice: 1, // 发票类型
|
||||
invoiceAvailable: false, // 模态框显隐
|
||||
loading: false, // 提交状态
|
||||
@@ -101,36 +59,17 @@ export default {
|
||||
taxpayerId: '', // 纳税人识别号
|
||||
receiptContent: '商品明细' // 发票内容
|
||||
},
|
||||
isDefault:false,
|
||||
type: 1, // 1 个人 2 单位
|
||||
searchParams:{
|
||||
|
||||
pageNumber:1,
|
||||
pageSize:5
|
||||
},
|
||||
total:0,
|
||||
ruleInline: {
|
||||
taxpayerId: [
|
||||
{ required: true, message: '请填写纳税人识别号' },
|
||||
{ pattern: TINumber, message: '请填写正确的纳税人识别号' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
props: ['invoiceData'],
|
||||
watch: {
|
||||
type(val){
|
||||
if(val === 2 && !this.invoiceForm.receiptTitle){
|
||||
// 查找默认的发票抬头
|
||||
const defaultValue = this.receiptList.find(item => item.isDefault === 1)
|
||||
if(!defaultValue){
|
||||
this.invoiceForm.receiptTitle = this.receiptList[0].receiptTitle
|
||||
this.invoiceForm.taxpayerId = this.receiptList[0].taxpayerId
|
||||
}else{
|
||||
this.invoiceForm.receiptTitle = defaultValue.receiptTitle
|
||||
this.invoiceForm.taxpayerId = defaultValue.taxpayerId
|
||||
}
|
||||
}
|
||||
},
|
||||
invoiceAvailable(val){
|
||||
if(val){
|
||||
this.getReceiptList()
|
||||
}
|
||||
},
|
||||
// 回显的发票信息
|
||||
invoiceData: {
|
||||
handler (val) {
|
||||
@@ -146,40 +85,7 @@ export default {
|
||||
immeadite: true
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.getReceiptList()
|
||||
},
|
||||
methods: {
|
||||
changePage(v){
|
||||
this.searchParams.pageNumber = v;
|
||||
this.getReceiptList();
|
||||
},
|
||||
getReceiptList () { // 获取抬头列表
|
||||
getMemberReceiptList(this.searchParams).then(res => {
|
||||
if (res.success) {
|
||||
const list = res.result.records;
|
||||
this.receiptList = list;
|
||||
this.total = res.result.total
|
||||
}
|
||||
})
|
||||
},
|
||||
async delReceipt(id){
|
||||
try {
|
||||
this.delReceiptLoad = true
|
||||
const res = await delMemberReceipt(id)
|
||||
this.delReceiptLoad = false
|
||||
if(res.success){
|
||||
if(this.searchParams.pageNumber !==1 && this.total - 1 < this.searchParams.pageNumber * this.searchParams.pageSize){
|
||||
this.searchParams.pageNumber = this.searchParams.pageNumber - 1
|
||||
}
|
||||
this.$Message.success('删除成功')
|
||||
this.getReceiptList()
|
||||
}
|
||||
} catch (error) {
|
||||
this.delReceiptLoad = false
|
||||
}
|
||||
|
||||
},
|
||||
/**
|
||||
* 选择发票抬头
|
||||
*/
|
||||
@@ -188,16 +94,12 @@ export default {
|
||||
this.type = val;
|
||||
});
|
||||
},
|
||||
chooseReceipt(val){
|
||||
this.$refs.poptip.visible = false
|
||||
this.invoiceForm.receiptTitle = val.receiptTitle
|
||||
this.invoiceForm.taxpayerId = val.taxpayerId
|
||||
},
|
||||
|
||||
/**
|
||||
* 保存判断
|
||||
*/
|
||||
save () {
|
||||
let flag = true;
|
||||
let flage = true;
|
||||
|
||||
// 保存分为两种类型,个人以及企业
|
||||
const { receiptTitle } = JSON.parse(
|
||||
@@ -206,35 +108,31 @@ export default {
|
||||
// 判断是否填写发票抬头
|
||||
if (!receiptTitle) {
|
||||
this.$Message.error('请填写发票抬头!');
|
||||
flag = false;
|
||||
flage = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.type === 2) {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (!valid) {
|
||||
flag = false;
|
||||
flage = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
delete this.invoiceForm.taxpayerId;
|
||||
}
|
||||
|
||||
return flag;
|
||||
return flage;
|
||||
},
|
||||
// 保存发票信息
|
||||
async submit () {
|
||||
if (this.save()) {
|
||||
|
||||
this.loading = true;
|
||||
let submit = {
|
||||
way: this.$route.query.way,
|
||||
...this.invoiceForm
|
||||
};
|
||||
// 存储到发票列表中
|
||||
await setMemberReceiptList({...submit,isDefault:this.isDefault ? 1 : 0})
|
||||
this.loading = true;
|
||||
let receipt = await receiptSelect(submit);
|
||||
|
||||
if (receipt.success) {
|
||||
this.$emit('change', true);
|
||||
}
|
||||
@@ -258,33 +156,9 @@ export default {
|
||||
color: $theme_color;
|
||||
}
|
||||
}
|
||||
.global_color{
|
||||
cursor: pointer;
|
||||
}
|
||||
.receipt-item{
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding:8px 16px;
|
||||
cursor: pointer;
|
||||
line-height: 1.5;
|
||||
border-bottom: 1px solid #ededed;
|
||||
}
|
||||
|
||||
.receipt-content{
|
||||
height: 280px;
|
||||
}
|
||||
|
||||
.nav-content {
|
||||
width: 500px;
|
||||
margin: 10px auto;
|
||||
}
|
||||
.more{
|
||||
text-align: center;
|
||||
color: $theme_color;
|
||||
margin-bottom: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
/deep/ .ivu-input{
|
||||
width: 280px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getIMDetail ,getImSetting} from "@/api/common";
|
||||
import { getIMDetail } from "@/api/common";
|
||||
import Storage from "@/plugins/storage";
|
||||
import { getMemberMsg } from "@/api/login";
|
||||
export default {
|
||||
@@ -40,15 +40,9 @@ export default {
|
||||
},
|
||||
// 获取im信息
|
||||
async getIMDetailMethods() {
|
||||
// 获取pc im
|
||||
// let res = await getImSetting();
|
||||
// if (res.success) {
|
||||
// this.IMLink = res.result.qrCode
|
||||
// }
|
||||
let res = await getImSetting();
|
||||
let res = await getIMDetail();
|
||||
if (res.success) {
|
||||
window.open(res.result.url);
|
||||
// this.IMLink = res.result.qrCode;
|
||||
this.IMLink = res.result;
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -57,6 +57,15 @@
|
||||
:key="index"
|
||||
>
|
||||
<div class="shop-name">
|
||||
<div>
|
||||
<Checkbox
|
||||
v-model="shop.checked"
|
||||
@on-change="changeChecked(shop.checked, 'shop', shop.storeId)"
|
||||
></Checkbox>
|
||||
<span class="go-shop-page" @click="goShopPage(shop.storeId)">{{
|
||||
shop.storeName
|
||||
}}</span>
|
||||
</div>
|
||||
<span
|
||||
class="shop-coupon"
|
||||
v-if="shop.couponList.length"
|
||||
@@ -537,6 +546,90 @@ export default {
|
||||
padding-top: 100px;
|
||||
}
|
||||
&-items {
|
||||
.shop-name {
|
||||
height: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 20px;
|
||||
position: relative;
|
||||
@include title_color($light_title_color);
|
||||
> * {
|
||||
width: 50%;
|
||||
}
|
||||
.go-shop-page:hover {
|
||||
color: $theme_color;
|
||||
cursor: pointer;
|
||||
}
|
||||
.customer-service {
|
||||
margin-left: 5px;
|
||||
color: #fcc217;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
color: $theme_color;
|
||||
}
|
||||
}
|
||||
/** 优惠券 */
|
||||
.shop-coupon {
|
||||
width: 80px;
|
||||
height: 24px;
|
||||
position: relative;
|
||||
background: url(../assets/images/cart-coupon-icons02.png) 0 0 no-repeat;
|
||||
> div {
|
||||
position: absolute;
|
||||
top: 35px;
|
||||
left: 0;
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
background-color: #fff;
|
||||
border: 1px solid $theme_color;
|
||||
// border-radius: 3px;
|
||||
z-index: 1;
|
||||
padding: 10px 20px;
|
||||
&::before {
|
||||
content: "";
|
||||
display: block;
|
||||
background: url(../assets/images/cart-coupon-icons02.png) 0 -58px no-repeat;
|
||||
width: 80px;
|
||||
height: 12px;
|
||||
position: absolute;
|
||||
top: -12px;
|
||||
left: 0;
|
||||
}
|
||||
.coupon-item {
|
||||
margin-bottom: 10px;
|
||||
span:nth-child(1) {
|
||||
border: 1px solid #e33937;
|
||||
display: inline-block;
|
||||
padding: 3px 10px;
|
||||
color: $theme_color;
|
||||
border-radius: 3px;
|
||||
}
|
||||
span:nth-child(2) {
|
||||
font-size: 12px;
|
||||
margin-left: 5px;
|
||||
color: #999;
|
||||
}
|
||||
.coupon-btn {
|
||||
height: 26px;
|
||||
float: right;
|
||||
font-size: 12px;
|
||||
}
|
||||
&::after {
|
||||
display: block;
|
||||
content: "";
|
||||
clear: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.promotion-notice {
|
||||
text-align: right;
|
||||
font-size: 12px;
|
||||
}
|
||||
.shop-coupon-show {
|
||||
background-position-y: -34px;
|
||||
}
|
||||
}
|
||||
.goods-item {
|
||||
position: relative;
|
||||
@extend .cart-goods-title;
|
||||
|
||||
@@ -12,8 +12,15 @@
|
||||
</Breadcrumb>
|
||||
<div class="store-collect" v-if="!takeDownSale">
|
||||
<span class="mr_10" v-if="goodsMsg.data">
|
||||
<router-link :to="'Merchant?id=' + goodsMsg.data.storeId">{{
|
||||
goodsMsg.data.storeName
|
||||
}}</router-link>
|
||||
</span>
|
||||
<span class="ml_10" @click="getIMDetailMethods()">联系客服</span>
|
||||
<span @click="collect">
|
||||
<Icon type="ios-heart" :color="storeCollected ? '#ed3f14' : '#666'" />
|
||||
{{ storeCollected? "已收藏店铺": "收藏店铺" }}
|
||||
</span>
|
||||
<span class="ml_10" @click="IMService(goodsMsg.data.storeId,goodsMsg.data.goodsId,goodsMsg.data.id)">联系客服</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -29,12 +36,6 @@
|
||||
<Button size="small" @click="target('goodsList')">返回商品列表</Button>
|
||||
</div>
|
||||
</empty>
|
||||
|
||||
<Modal title="扫码联系客服" hide-footer v-model="showQrCode">
|
||||
<div class="img">
|
||||
<img :src="IMLink" alt="">
|
||||
</div>
|
||||
</Modal>
|
||||
<Spin size="large" fix v-if="isLoading"></Spin>
|
||||
<BaseFooter></BaseFooter>
|
||||
</div>
|
||||
@@ -67,19 +68,16 @@ export default {
|
||||
mixins: [imTalk],
|
||||
data () {
|
||||
return {
|
||||
showQrCode:false,
|
||||
goodsMsg: {}, // 商品信息
|
||||
isLoading: false, // 加载状态
|
||||
categoryBar: [], // 分类
|
||||
storeCollected: false, // 商品收藏
|
||||
storeMsg: {}, // 店铺信息
|
||||
takeDownSale:false, // 是否下架
|
||||
IMLink:"",
|
||||
// qrCode:""
|
||||
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 跳转首页或商品页面
|
||||
target(url){
|
||||
this.$router.push({path: url})
|
||||
@@ -232,11 +230,4 @@ export default {
|
||||
margin:10px 0
|
||||
|
||||
}
|
||||
.img{
|
||||
text-align: center;
|
||||
>img{
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -74,6 +74,12 @@
|
||||
已有<span>{{ item.commentNum || 0 }}</span
|
||||
>人评价
|
||||
</div>
|
||||
<div class="goods-show-seller">
|
||||
<span class="text-bottom" style="color: #e4393c">{{
|
||||
item.storeName
|
||||
}}</span>
|
||||
</div>
|
||||
|
||||
<div class="goods-show-right">
|
||||
<Tag
|
||||
class="goods-show-tag"
|
||||
|
||||
@@ -17,6 +17,10 @@ export const orderStatusList = [
|
||||
name: '待发货',
|
||||
status: 'UNDELIVERED'
|
||||
},
|
||||
{
|
||||
name: '部分发货',
|
||||
status: 'PARTS_DELIVERED'
|
||||
},
|
||||
{
|
||||
name: '已发货',
|
||||
status: 'DELIVERED'
|
||||
|
||||
@@ -54,7 +54,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
/deep/ .ivu-col-span-2, .ivu-col-span-4 {
|
||||
::v-deep .ivu-col-span-2, .ivu-col-span-4 {
|
||||
text-align: center;
|
||||
color: $theme_color;
|
||||
}
|
||||
@@ -71,7 +71,7 @@ export default {
|
||||
border-bottom: 1px solid $border_color;
|
||||
padding: 16px 0;
|
||||
|
||||
/deep/ .ivu-col {
|
||||
::v-deep .ivu-col {
|
||||
padding: 8px 0;
|
||||
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- <Alert class="l_title" show-icon type="warning">商家申诉信息</Alert>
|
||||
<Alert class="l_title" show-icon type="warning">商家申诉信息</Alert>
|
||||
<table cellspacing="0" cellpadding='0' border="1">
|
||||
<tr>
|
||||
<td>申诉时间</td>
|
||||
@@ -68,7 +68,7 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table> -->
|
||||
</table>
|
||||
|
||||
<Alert class="l_title" show-icon type="warning">平台仲裁</Alert>
|
||||
<table cellspacing="0" cellpadding='0' border="1">
|
||||
|
||||
@@ -584,7 +584,7 @@ export default {
|
||||
margin-left: 25px;
|
||||
margin-top: 5px
|
||||
}
|
||||
/deep/ .ivu-alert-message {
|
||||
::v-deep .ivu-alert-message {
|
||||
p {
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
{{ item.goodsName }}
|
||||
</div>
|
||||
<div v-else class="goodsTitle hover-pointer" @click="buynow(item.skuId, item.goodsId,item.id)" >
|
||||
{{ item.storeName }}
|
||||
<Tag color="error" class="operated" v-if="item.selfOperated">商家自营</Tag>
|
||||
</div>
|
||||
<div class="goodsPrice">
|
||||
|
||||
@@ -42,8 +42,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btns">
|
||||
<div>
|
||||
<span @click="shopPage(order.shopId)">{{ order.storeName }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<!-- 订单基础操作 -->
|
||||
<Button @click="goDetail(order.sn)" type="info" size="small">售后详情</Button>
|
||||
<Button @click="openModal(order)"
|
||||
@@ -182,7 +184,14 @@ export default {
|
||||
});
|
||||
window.open(routeUrl.href, '_blank');
|
||||
},
|
||||
|
||||
// 跳转店铺首页
|
||||
shopPage(id) {
|
||||
let routeUrl = this.$router.resolve({
|
||||
path: '/Merchant',
|
||||
query: {id: id}
|
||||
});
|
||||
window.open(routeUrl.href, '_blank');
|
||||
},
|
||||
getList() { // 获取售后列表
|
||||
this.spinShow = true;
|
||||
let params = JSON.parse(JSON.stringify(this.params))
|
||||
@@ -354,10 +363,4 @@ export default {
|
||||
.modal-goods {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.btns{
|
||||
>*{
|
||||
margin: 4px 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -13,7 +13,15 @@
|
||||
<p class="global_color fontsize_18">{{ afterSale.orderStatusValue }}</p>
|
||||
<p>售后单号:{{ afterSale.sn }} 订单号:{{afterSale.orderSn}}</p>
|
||||
<div style="color:#999;" class="operation-time">创建时间:{{afterSale.createTime}}</div>
|
||||
|
||||
<div class="service-after">
|
||||
<div>
|
||||
本次售后服务由<span>{{afterSale.storeName}}</span>为您提供
|
||||
</div>
|
||||
<div>
|
||||
<img :src="afterSale.goodsImage" alt="" width="60" height="60">
|
||||
<span>{{afterSale.goodsName}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="order-card">
|
||||
<h3>售后进程</h3>
|
||||
|
||||
@@ -59,8 +59,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btns">
|
||||
<div>
|
||||
<span @click="shopPage(order.storeId)">{{ order.storeName }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<!-- 订单基础操作 -->
|
||||
<Button @click="orderDetail(order.sn)" type="info" size="small">订单详情</Button>
|
||||
<Button @click="handleCancelOrder(order.sn)" type="error" v-if="order.allowOperationVO.cancel" size="small">取消订单</Button>
|
||||
@@ -193,7 +195,14 @@ export default {
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
|
||||
// 跳转店铺首页
|
||||
shopPage (id) {
|
||||
let routeUrl = this.$router.resolve({
|
||||
path: '/Merchant',
|
||||
query: { id: id }
|
||||
});
|
||||
window.open(routeUrl.href, '_blank');
|
||||
},
|
||||
orderDetail (sn) {
|
||||
// 跳转订单详情
|
||||
this.$router.push({ name: 'OrderDetail', query: {sn} });
|
||||
@@ -382,9 +391,4 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.btns{
|
||||
>*{
|
||||
margin: 4px 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -106,7 +106,9 @@
|
||||
</div>
|
||||
<!-- 订单商品 -->
|
||||
<div class="goods">
|
||||
|
||||
<div class="shop-name">
|
||||
<span @click="shopPage(order.order.storeId)">{{order.order.storeName}}</span>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -486,6 +488,24 @@ export default {
|
||||
top: 20px;
|
||||
}
|
||||
}
|
||||
/** 店铺名称 */
|
||||
.shop-name {
|
||||
margin: 15px 0;
|
||||
span {
|
||||
color: #438cde;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
color: $theme_color;
|
||||
}
|
||||
}
|
||||
.ivu-icon {
|
||||
color: #ff8f23;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
color: $theme_color;
|
||||
}
|
||||
}
|
||||
}
|
||||
/** 商品列表 */
|
||||
table {
|
||||
border: 1px solid #ddd;
|
||||
@@ -584,22 +604,21 @@ table {
|
||||
.layui-layer-wrap > .div-express-log {
|
||||
max-height: 300px;
|
||||
}
|
||||
/deep/ .layui-layer-wrap > .div-express-log::-webkit-scrollbar{
|
||||
::v-deep .layui-layer-wrap > .div-express-log::-webkit-scrollbar{
|
||||
width: 1px;
|
||||
height: 5px;
|
||||
}
|
||||
/deep/ .layui-layer-wrap > .div-express-log::-webkit-scrollbar-thumb{
|
||||
::v-deep .layui-layer-wrap > .div-express-log::-webkit-scrollbar-thumb{
|
||||
border-radius: 1em;
|
||||
background-color: rgba(50,50,50,.3);
|
||||
}
|
||||
/deep/ .layui-layer-wrap > .div-express-log::-webkit-scrollbar-track{
|
||||
::v-deep .layui-layer-wrap > .div-express-log::-webkit-scrollbar-track{
|
||||
border-radius: 1em;
|
||||
background-color: rgba(50,50,50,.1);
|
||||
}
|
||||
|
||||
|
||||
.div-express-log {
|
||||
max-height: 300px;
|
||||
border: solid 1px #e7e7e7;
|
||||
background: #fafafa;
|
||||
overflow-y: auto;
|
||||
|
||||
@@ -115,7 +115,13 @@
|
||||
</div>
|
||||
<div class="goods-msg" v-for="(shop, shopIndex) in goodsList" :key="shopIndex">
|
||||
<div v-if="shop.checked">
|
||||
|
||||
<div class="shop-name">
|
||||
<span>
|
||||
<span class="hover-color" @click="goShopPage(shop.storeId)">{{
|
||||
shop.storeName
|
||||
}}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="goods-list">
|
||||
<div class="goods-item" v-for="(goods, goodsIndex) in shop.checkedSkuList" :key="goodsIndex">
|
||||
<span class="hover-color" @click="
|
||||
@@ -884,6 +890,53 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
/** 购买商品列表 start */
|
||||
.shop-name {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
>span:nth-child(1) {
|
||||
font-weight: bold;
|
||||
|
||||
.ivu-icon {
|
||||
color: #ff8f23;
|
||||
|
||||
&:hover {
|
||||
color: $theme_color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
>span:nth-child(2) {
|
||||
color: #999;
|
||||
position: relative;
|
||||
display: flex;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.delivery-list {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 20px;
|
||||
background-color: #f3fafe;
|
||||
box-shadow: 0px 0px 5px #b9b2b2;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
width: 200px;
|
||||
min-height: 100px;
|
||||
padding: 10px;
|
||||
|
||||
li {
|
||||
width: 90px;
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.goods-list {
|
||||
width: 1150px;
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
已有<span>{{ item.commentNum || 0 }}</span
|
||||
>人评价
|
||||
</div>
|
||||
|
||||
<div class="goods-show-seller">
|
||||
<span>{{ item.storeName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-size">
|
||||
|
||||
@@ -66,7 +66,9 @@
|
||||
: 100
|
||||
" />
|
||||
</div>
|
||||
|
||||
<div class="goods-show-seller">
|
||||
<span>{{ item.storeName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<BaseFooter />
|
||||
|
||||
@@ -9,7 +9,6 @@ Vue.use(Vuex);
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
imQrCode: '',
|
||||
navList: [], // 首页快捷导航
|
||||
cartNum: storage.getItem('cartNum') || 0,
|
||||
logoImg: storage.getItem('logoImg') || require('@/assets/images/logo2.png'),
|
||||
|
||||
@@ -70,7 +70,7 @@ module.exports = {
|
||||
|
||||
loaderOptions: {
|
||||
sass: {
|
||||
data: `@import "@/assets/styles/global.scss";` //全局加载scss
|
||||
additionalData: `@import "@/assets/styles/global.scss";` //全局加载scss
|
||||
},
|
||||
// 向 CSS 相关的 loader 传递选项
|
||||
less: {
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
"vue-cropper": "^0.5.5",
|
||||
"vue-prism-editor": "^0.5.1",
|
||||
"vue-router": "^3.4.9",
|
||||
"vue-virtual-scroller": "^1.1.2",
|
||||
"vuex": "^3.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -33,6 +33,11 @@ Object.keys(filters).forEach((key) => {
|
||||
Vue.filter(key, filters[key]);
|
||||
});
|
||||
|
||||
|
||||
import VueVirtualScroller from 'vue-virtual-scroller'
|
||||
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
|
||||
Vue.component('RecycleScroller', VueVirtualScroller.RecycleScroller)
|
||||
|
||||
// 引入自定义全局css
|
||||
import '@/assets/css/global.less'
|
||||
|
||||
|
||||
@@ -65,9 +65,14 @@
|
||||
> -->
|
||||
</p>
|
||||
<!-- 对话列表 -->
|
||||
<template v-if="loadStatus === 1">
|
||||
<div v-for="(item, index) in userTalkItem" :key="item.id" class="talk-item pointer"
|
||||
:class="{ active: activeIndex == index }" @click="clickTab(item.userId, item, index)">
|
||||
<RecycleScroller
|
||||
:item-size="64"
|
||||
:items="userTalkItem"
|
||||
:prerender="10"
|
||||
v-slot="{ item, index }"
|
||||
>
|
||||
|
||||
<div v-bind:key="item.id" class="talk-item pointer" :class="{ active: activeIndex == index }" @click="clickTab(item.userId, item, index)">
|
||||
<div class="avatar-box">
|
||||
<face :text="item.face" v-if="item.face"></face>
|
||||
<face-null :text="item.name" v-else></face-null>
|
||||
@@ -79,9 +84,7 @@
|
||||
<div class="title">
|
||||
<div class="card-name">
|
||||
<p class="nickname">
|
||||
{{
|
||||
item.remark_name ? item.remark_name : item.name
|
||||
}}
|
||||
{{ item.remark_name ? item.remark_name : item.name }}
|
||||
</p>
|
||||
<div v-show="item.unread" class="larkc-tag">
|
||||
{{ item.unread }}条未读
|
||||
@@ -89,11 +92,9 @@
|
||||
<div v-show="item.is_top" class="larkc-tag top">
|
||||
TOP
|
||||
</div>
|
||||
|
||||
<div v-show="item.is_robot" class="larkc-tag top">
|
||||
BOT
|
||||
</div>
|
||||
|
||||
<div v-show="item.talk_type == 2" class="larkc-tag group">
|
||||
群组
|
||||
</div>
|
||||
@@ -111,9 +112,7 @@
|
||||
<span v-if="item.lastMessageType === 'ORDER'">[订单链接]</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<template v-if="
|
||||
index_name != item.index_name && item.draft_text
|
||||
">
|
||||
<template v-if="index_name != item.index_name && item.draft_text">
|
||||
<span class="draft-color">[草稿]</span>
|
||||
<span>{{ item.draft_text }}</span>
|
||||
</template>
|
||||
@@ -124,13 +123,12 @@
|
||||
</span>
|
||||
<span v-else>[群消息]</span>
|
||||
</template>
|
||||
|
||||
<span>{{ item.msg_text }}</span>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</RecycleScroller>
|
||||
</el-main>
|
||||
</el-scrollbar>
|
||||
</el-container>
|
||||
@@ -151,6 +149,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { RecycleScroller } from 'vue-virtual-scroller'
|
||||
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
|
||||
import { mapGetters, mapState } from "vuex";
|
||||
import MainLayout from "@/views/layout/MainLayout";
|
||||
import WelcomeModule from "@/components/layout/WelcomeModule";
|
||||
@@ -179,6 +179,7 @@ export default {
|
||||
UserSearch,
|
||||
OtherLink,
|
||||
WelcomeModule,
|
||||
RecycleScroller
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
|
||||
1
manager/.npmrc
Normal file
1
manager/.npmrc
Normal file
@@ -0,0 +1 @@
|
||||
engine-strict=false
|
||||
1
manager/.yarnrc
Normal file
1
manager/.yarnrc
Normal file
@@ -0,0 +1 @@
|
||||
--ignore-engines true
|
||||
@@ -1,33 +1,15 @@
|
||||
# LILISHOP-UI
|
||||
|
||||
## Project setup
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Run your tests
|
||||
```
|
||||
npm run test
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
npm run lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
详情点击 [https://cli.vuejs.org/zn/config/](https://cli.vuejs.org/zn/config/).
|
||||
|
||||
### UI 框架与版本
|
||||
|
||||
- `tdesign-vue@^1.14.2`
|
||||
- `tdesign-icons-vue@^0.2.3`
|
||||
- `vue@2.6.14`
|
||||
|
||||
#### login.vue页面,测试时不走权限,直接return 318行
|
||||
#### Main.vue 页面,241行,修改,避免报错
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
"build": "vue-cli-service build",
|
||||
"dev": "vue-cli-service serve"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"dependencies": {
|
||||
"@amap/amap-jsapi-loader": "0.0.7",
|
||||
"@antv/g2": "^4.1.12",
|
||||
@@ -16,13 +19,16 @@
|
||||
"core-js": "^3.6.5",
|
||||
"dplayer": "^1.26.0",
|
||||
"js-cookie": "^2.2.1",
|
||||
"node-sass": "^4.14.1",
|
||||
"sass-loader": "^8.0.2",
|
||||
"price-color": "1.0.2",
|
||||
"sass": "^1.63.6",
|
||||
"sass-loader": "^10.4.1",
|
||||
"sockjs-client": "^1.4.0",
|
||||
"swiper": "^6.3.5",
|
||||
"uuid": "^8.3.2",
|
||||
"view-design": "^4.7.0",
|
||||
"vue": "^2.6.10",
|
||||
"tdesign-vue": "^1.14.2",
|
||||
"tdesign-icons-vue": "^0.2.3",
|
||||
"@vue/composition-api": "^1.7.1",
|
||||
"vue": "2.6.14",
|
||||
"vue-awesome-swiper": "^4.1.1",
|
||||
"vue-i18n": "^8.15.1",
|
||||
"vue-json-excel": "^0.3.0",
|
||||
@@ -31,8 +37,7 @@
|
||||
"vue-router": "^3.1.3",
|
||||
"vuedraggable": "^2.23.2",
|
||||
"vuex": "^3.4.0",
|
||||
"xss": "^1.0.7",
|
||||
"price-color": "1.0.2"
|
||||
"xss": "^1.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^4.4.4",
|
||||
@@ -47,6 +52,11 @@
|
||||
"style-resources-loader": "^1.3.2",
|
||||
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||
"vue-cli-plugin-style-resources-loader": "^0.1.4",
|
||||
"vue-template-compiler": "^2.6.10"
|
||||
"vue-template-compiler": "2.6.14"
|
||||
},
|
||||
"resolutions": {
|
||||
"minimatch": "^3.1.2",
|
||||
"node-sass": "npm:sass@^1.63.6",
|
||||
"@achrinza/node-ipc": "9.2.2"
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -23,7 +23,7 @@ export const postVerifyImg = (params) => {
|
||||
|
||||
// 获取系统基础信息
|
||||
export const getBaseSite = () => {
|
||||
return getRequest(`${commonUrl}/common/common/site`);
|
||||
return getRequestWithNoToken(`${commonUrl}/common/common/site`);
|
||||
};
|
||||
|
||||
// 上传文件
|
||||
|
||||
@@ -57,15 +57,5 @@ export const auditDistributionCash = (id,params) => {
|
||||
return postRequest(`/distribution/cash/audit/${id}`, params)
|
||||
}
|
||||
|
||||
// 取消分销商品
|
||||
export const distributionGoodsCancel = (id) => {
|
||||
return deleteRequest(`/distribution/goods/cancel/${id}`)
|
||||
}
|
||||
|
||||
// 选择分销商品
|
||||
export const distributionGoodsCheck = (id,param) => {
|
||||
return putRequest(`/distribution/goods/checked/${id}`,param)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import { getRequest, postRequest, putRequest, deleteRequest } from '@/libs/axios';
|
||||
import { getRequest, postRequest, putRequest, deleteRequest} from '@/libs/axios';
|
||||
|
||||
// 获取商品品牌分页列表
|
||||
export const getManagerBrandPage = (params) => {
|
||||
@@ -7,8 +7,8 @@ export const getManagerBrandPage = (params) => {
|
||||
}
|
||||
|
||||
// 批量删除
|
||||
export const delBrand = (ids) => {
|
||||
return deleteRequest(`/goods/brand/delByIds/${ids}`)
|
||||
export const delBrand = (ids) =>{
|
||||
return deleteRequest(`/goods/brand/delByIds/${ids}`)
|
||||
}
|
||||
|
||||
|
||||
@@ -48,12 +48,12 @@ export const getSpecificationList = (params) => {
|
||||
|
||||
//获取分类列表数据
|
||||
export const getAllCategoryList = (parent_id) => {
|
||||
return getRequest(`/goods/category/${parent_id}/all-children`)
|
||||
return getRequest(`/goods/category/${parent_id}/all-children`)
|
||||
}
|
||||
|
||||
//获取分类列表数据
|
||||
export const getCategoryTree = () => {
|
||||
return getRequest(`/goods/category/allChildren`)
|
||||
return getRequest(`/goods/category/allChildren`)
|
||||
}
|
||||
|
||||
// 添加商品分类
|
||||
@@ -83,7 +83,7 @@ export const insertSpec = (params) => {
|
||||
return postRequest('/goods/spec', params)
|
||||
}
|
||||
// 添加或修改规格设置
|
||||
export const updateSpec = (id, params) => {
|
||||
export const updateSpec = (id,params) => {
|
||||
return putRequest(`/goods/spec/${id}`, params)
|
||||
}
|
||||
//根据分类id获取关联规格
|
||||
@@ -101,20 +101,23 @@ export const getGoodsCategory = (parent_id) => {
|
||||
}
|
||||
|
||||
// 上架商品
|
||||
export const upGoods = (id, params) => {
|
||||
return putRequest(`/goods/goods/${id}/up`, params)
|
||||
export const upGoods = (params) => {
|
||||
return putRequest(`/goods/goods/up`, params)
|
||||
}
|
||||
|
||||
// 下架商品
|
||||
export const lowGoods = (id, params) => {
|
||||
return putRequest(`/goods/goods/${id}/under`, params)
|
||||
export const lowGoods = (params) => {
|
||||
return putRequest(`/goods/goods/under`, params)
|
||||
}
|
||||
|
||||
// 获取商品sku分页列表
|
||||
export const getGoodsSkuData = (params) => {
|
||||
return getRequest('/goods/goods/sku/list', params)
|
||||
}
|
||||
|
||||
|
||||
// 获取商品数量
|
||||
export const getGoodsNumerData = (params) => {
|
||||
return getRequest('/goods/goods/goodsNumber', params)
|
||||
}
|
||||
// 获取商品分页列表
|
||||
export const getGoodsListData = (params) => {
|
||||
return getRequest('/goods/goods/list', params)
|
||||
@@ -124,8 +127,12 @@ export const getAuthGoodsListData = (params) => {
|
||||
return getRequest('/goods/goods/auth/list', params)
|
||||
}
|
||||
// 审核商品
|
||||
export const authGoods = (id, params) => {
|
||||
return putRequest(`/goods/goods/${id}/auth`, params)
|
||||
export const authGoods = (params) => {
|
||||
return putRequest(`/goods/goods/auth`, params,{
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//查询分类绑定参数信息
|
||||
@@ -170,38 +177,38 @@ export const getGoodsSpecInfo = (category_id, params) => {
|
||||
|
||||
//获取sku列表
|
||||
export const getSkuPage = (params) => {
|
||||
return getRequest(`/goodsSku/getByPage`, params)
|
||||
return getRequest(`/goodsSku/getByPage`, params)
|
||||
}
|
||||
|
||||
|
||||
//查看商品详情
|
||||
export const getGoodsDetail = (id) => {
|
||||
return getRequest(`/goods/goods/get/${id}`)
|
||||
return getRequest(`/goods/goods/get/${id}`)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 获取订单统计图表
|
||||
export const getOrderChart = (params) => {
|
||||
return getRequest(`/statistics/order`, params)
|
||||
return getRequest(`/statistics/order`, params)
|
||||
}
|
||||
|
||||
|
||||
// 订单统计概览
|
||||
export const getOrderOverView = (params) => {
|
||||
return getRequest(`/statistics/order/overview`, params)
|
||||
return getRequest(`/statistics/order/overview`, params)
|
||||
}
|
||||
|
||||
// 统计相关订单统计
|
||||
|
||||
export const statisticsOrderList = (params) => {
|
||||
return getRequest(`/statistics/order/order`, params)
|
||||
return getRequest(`/statistics/order/order`, params)
|
||||
}
|
||||
|
||||
// 统计相关退单统计
|
||||
|
||||
export const statisticsOrderRefundList = (params) => {
|
||||
return getRequest(`/statistics/order/refund`, params)
|
||||
return getRequest(`/statistics/order/refund`, params)
|
||||
}
|
||||
|
||||
|
||||
@@ -225,60 +232,3 @@ export const refundStatistics = (params) => {
|
||||
export const refundPriceStatistics = (params) => {
|
||||
return getRequest(`/statistics/refund/order/getPrice`, params)
|
||||
}
|
||||
// 获取草稿商品分页列表
|
||||
export const getDraftGoodsListData = params => {
|
||||
return getRequest("/goods/draftGoods/page", params);
|
||||
};
|
||||
// 获取草稿商品详情
|
||||
export const getDraftGoodsDetail = id => {
|
||||
return getRequest(`/goods/draftGoods/${id}`);
|
||||
};
|
||||
// 保存草稿商品
|
||||
export function saveDraftGoods(params) {
|
||||
return postRequest("/goods/draftGoods/save", params, {
|
||||
"Content-Type": "application/json"
|
||||
});
|
||||
}
|
||||
|
||||
// 删除草稿商品
|
||||
export const deleteDraftGoods = id => {
|
||||
return deleteRequest(`/goods/draftGoods/${id}`);
|
||||
};
|
||||
|
||||
|
||||
export function createGoods(params) {
|
||||
return postRequest("/goods/goods/create", params, {
|
||||
"Content-Type": "application/json"
|
||||
});
|
||||
}
|
||||
|
||||
export function editGoods(goodsId, params) {
|
||||
return putRequest(`/goods/goods/update/${goodsId}`, params, {
|
||||
"Content-Type": "application/json"
|
||||
});
|
||||
}
|
||||
|
||||
//根据分类id获取关联品牌
|
||||
export const getCategoryBrandListDataSeller = (category_id, params) => {
|
||||
return getRequest(`/goods/category/${category_id}/brands`, params);
|
||||
};
|
||||
|
||||
//查询分类绑定参数信息
|
||||
export const getCategoryParamsListDataSeller = (id, params) => {
|
||||
return getRequest(`/goods/categoryParameters/${id}`, params);
|
||||
};
|
||||
|
||||
// 获取商品详情
|
||||
export const getGoods = id => {
|
||||
return getRequest(`/goods/goods/get/${id}`);
|
||||
};
|
||||
|
||||
//保存获取关联规格
|
||||
export const getGoodsSpecInfoSeller = (category_id) => {
|
||||
return getRequest(`/goods/spec/${category_id}`);
|
||||
};
|
||||
|
||||
// 获取商品单位列表
|
||||
export const getGoodsUnitList = params => {
|
||||
return getRequest(`/goods/goodsUnit`,params);
|
||||
};
|
||||
|
||||
@@ -111,7 +111,7 @@ export const changeMobile = (params) => {
|
||||
};
|
||||
// 获取用户数据 多条件
|
||||
export const getUserListData = (params) => {
|
||||
return getRequest("/passport/user", params);
|
||||
return getRequest("/passport/user/getByCondition", params);
|
||||
};
|
||||
// 通过用户名搜索
|
||||
export const searchUserByName = (username, params) => {
|
||||
@@ -445,6 +445,21 @@ export const getProgress = () => {
|
||||
return getRequest(`/other/elasticsearch/progress`);
|
||||
};
|
||||
|
||||
// 删除ES中下架的商品
|
||||
export const deleteGoodsDown = () => {
|
||||
return getRequest(`/other/elasticsearch/deleteGoodsDown`);
|
||||
};
|
||||
|
||||
// 删除不存在的索引
|
||||
export const delSkuIndex = () => {
|
||||
return getRequest(`/other/elasticsearch/delSkuIndex`);
|
||||
};
|
||||
|
||||
// 生成所有商品的缓存
|
||||
export const generateGoodsCache = () => {
|
||||
return getRequest(`/other/elasticsearch/cache`);
|
||||
};
|
||||
|
||||
// 分页查询自定义分词
|
||||
export const getCustomWordsPage = (params) => {
|
||||
return getRequest(`/other/customWords/page`, params);
|
||||
|
||||
@@ -42,11 +42,6 @@ export const afterSaleOrderDetail = (sn) => {
|
||||
export const afterSaleSellerReview = (sn, params) => {
|
||||
return putRequest(`/order/afterSale/review/${sn}`, params)
|
||||
}
|
||||
//查询包裹列表
|
||||
export const getPackage = (orderSn) => {
|
||||
return getRequest(`/order/order/getPackage/${orderSn}`);
|
||||
}
|
||||
|
||||
|
||||
// 商家确认收货
|
||||
export const afterSaleSellerConfirm = (sn, params) => {
|
||||
@@ -131,7 +126,10 @@ export const getAfterSaleOrderDetail = (sn) => {
|
||||
export const getAfterSaleTraces = (sn) => {
|
||||
return getRequest(`/order/afterSale/getDeliveryTraces/${sn}`)
|
||||
}
|
||||
|
||||
// 获取商家选中的物流公司
|
||||
export const getLogisticsChecked = () => {
|
||||
return getRequest(`/other/logistics/getChecked`)
|
||||
}
|
||||
|
||||
//查询物流
|
||||
export const getTraces = (sn, params) => {
|
||||
@@ -163,18 +161,12 @@ export const storeAddress = (sn) => {
|
||||
return getRequest(`/order/afterSale/getStoreAfterSaleAddress/${sn}`)
|
||||
}
|
||||
|
||||
// 订单核验
|
||||
export const orderTake = (sn, verificationCode) => {
|
||||
return putRequest(`/order/order/take/${sn}/${verificationCode}`);
|
||||
};
|
||||
|
||||
//分包裹发货
|
||||
export const partDelivery = (orderSn,params) => {
|
||||
return postRequest(`/order/order/${orderSn}/partDelivery`,params,{
|
||||
"Content-type": "application/json"
|
||||
})
|
||||
// 获取订单数量统计
|
||||
export const getOrderNum = (params) => {
|
||||
return getRequest(`/order/order/orderNum`, params)
|
||||
}
|
||||
|
||||
// 获取售后数量统计
|
||||
export const getAfterSaleNumVO = (params) => {
|
||||
return getRequest(`/order/afterSale/afterSaleNumVO`, params)
|
||||
}
|
||||
// 修改订单备注
|
||||
export const modifyOrderRemark = (sn, params) => {
|
||||
return putRequest(`/order/order/${sn}/sellerRemark`, params);
|
||||
};
|
||||
|
||||
@@ -114,5 +114,5 @@ export const getPrivacy = (type) => {
|
||||
}
|
||||
//修改隐私协议数据
|
||||
export const updatePrivacy = (id,type,params) => {
|
||||
return putRequest(`/other/article/updateArticle/${type}?id=${id}`, params, {"Content-Type": "application/json"})
|
||||
return putRequest(`/other/article/updateArticle/${type}/${id}`, params, {"Content-Type": "application/json"})
|
||||
}
|
||||
@@ -280,33 +280,4 @@ export const deletePointsGoodsCategoryById = id => {
|
||||
// 获取优惠券领取记录
|
||||
export const getCouponReceiveList = (params) => {
|
||||
return getRequest("/promotion/coupon/received", params);
|
||||
};
|
||||
|
||||
// 新增满减活动
|
||||
export const newFullDiscount = (params) => {
|
||||
return postRequest(`/promotion/fullDiscount`, params, { 'Content-type': 'application/json' })
|
||||
}
|
||||
|
||||
|
||||
// 编辑满减活动
|
||||
export const editFullDiscount = (params) => {
|
||||
return putRequest(`/promotion/fullDiscount`, params, { 'Content-type': 'application/json' })
|
||||
}
|
||||
// 新建 拼团
|
||||
export const savePintuan = (params) => {
|
||||
return postRequest('/promotion/pintuan', params, { 'Content-type': 'application/json' })
|
||||
}
|
||||
// 编辑 拼团
|
||||
export const editPintuan = (params) => {
|
||||
return putRequest('/promotion/pintuan', params, { 'Content-type': 'application/json' })
|
||||
}
|
||||
|
||||
// 添加限时抢购 商品
|
||||
export const setSeckillGoods = (params) => {
|
||||
return postRequest(`/promotion/seckill/apply/${params.seckillId}`, params.applyVos, { 'Content-type': 'application/json' })
|
||||
}
|
||||
|
||||
// 添加限时抢购 商品
|
||||
export const removeSeckillGoods = (seckillId, ids) => {
|
||||
return deleteRequest(`/promotion/seckill/apply/${seckillId}/${ids}`)
|
||||
}
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {getRequest, postRequest, putRequest,deleteRequest} from '@/libs/axios';
|
||||
import {getRequest, postRequest, putRequest} from '@/libs/axios';
|
||||
|
||||
//查询店铺列表
|
||||
export const getBillPage = (params) => {
|
||||
@@ -87,40 +87,3 @@ export const downloadBill = (id) => {
|
||||
return getRequest(`/order/bill/downLoad/${id}`, {}, 'blob')
|
||||
}
|
||||
|
||||
//查询运费模板
|
||||
export const getShipTemplate = () => {
|
||||
return getRequest(`/setting/freightTemplate`)
|
||||
}
|
||||
|
||||
export const replyMemberComment = (id, params) => {
|
||||
return putRequest(`/member/evaluation/reply/${id}`, params)
|
||||
}
|
||||
//删除运费模板
|
||||
export const deleteShipTemplate = (id) => {
|
||||
return deleteRequest(`/setting/freightTemplate/${id}`)
|
||||
}
|
||||
//新增运费模板
|
||||
export const addShipTemplate = (params, headers) => {
|
||||
return postRequest(`/setting/freightTemplate`, params, headers)
|
||||
}
|
||||
//编辑运费模板
|
||||
export const editShipTemplate = (id, params, headers) => {
|
||||
return putRequest(`/setting/freightTemplate/${id}`, params, headers)
|
||||
}
|
||||
|
||||
// 获取商家自提点
|
||||
export const getShopAddress = (id, params) => {
|
||||
return getRequest(`/store/member/storeAddress/`, params)
|
||||
}
|
||||
|
||||
export const editShopAddress = (id, params) => {
|
||||
return putRequest(`/store/member/storeAddress/${id}`, params)
|
||||
}
|
||||
|
||||
export const addShopAddress = (params) => {
|
||||
return postRequest(`/store/member/storeAddress/`, params)
|
||||
}
|
||||
|
||||
export const deleteShopAddress = (id) => {
|
||||
return deleteRequest(`/store/member/storeAddress/${id}`)
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 754 B |
Binary file not shown.
|
Before Width: | Height: | Size: 3.6 KiB |
44
manager/src/components/TdPage.vue
Normal file
44
manager/src/components/TdPage.vue
Normal file
@@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<t-pagination
|
||||
:current="current"
|
||||
:total="Number(total)"
|
||||
:pageSize="pageSize"
|
||||
:pageSizeOptions="pageSizeOptionsComputed"
|
||||
:size="size"
|
||||
:showJumper="showElevator || showJumper"
|
||||
@change="onTdChange"
|
||||
v-bind="$attrs"
|
||||
/>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'Page',
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
current: { type: Number, default: 1 },
|
||||
total: { type: [Number, String], default: 0 },
|
||||
pageSize: { type: Number, default: 20 },
|
||||
pageSizeOpts: { type: Array, default: () => [] },
|
||||
pageSizeOptions: { type: Array, default: () => [] },
|
||||
size: { type: String, default: 'small' },
|
||||
showElevator: { type: Boolean, default: false },
|
||||
showJumper: { type: Boolean, default: false },
|
||||
showSizer: { type: Boolean, default: false },
|
||||
showTotal: { type: Boolean, default: false }
|
||||
},
|
||||
computed: {
|
||||
pageSizeOptionsComputed() {
|
||||
return (this.pageSizeOptions && this.pageSizeOptions.length)
|
||||
? this.pageSizeOptions
|
||||
: (this.pageSizeOpts && this.pageSizeOpts.length ? this.pageSizeOpts : undefined)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onTdChange(info) {
|
||||
if (info && typeof info.current !== 'undefined') this.$emit('on-change', info.current)
|
||||
if (info && typeof info.pageSize !== 'undefined') this.$emit('on-page-size-change', info.pageSize)
|
||||
this.$emit('change', info)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -10,7 +10,14 @@
|
||||
{{ item.year + '年' + item.month + '月' }}</Option>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<div class="shop-list" v-if="!closeShop">
|
||||
<Select clearable @on-change="changeshop(selectedWay)" v-model="storeId" placeholder="店铺查询"
|
||||
style="width:200px;margin-left:10px;">
|
||||
<Scroll :on-reach-bottom="handleReachBottom">
|
||||
<Option v-for="(item, index) in shopsData" :value="item.id" :key="index">{{ item.storeName }}</Option>
|
||||
</Scroll>
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -33,7 +40,7 @@ export default {
|
||||
params: {
|
||||
// 请求参数
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
storeName: "",
|
||||
},
|
||||
dateList: [
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<Button @click="handleClickUploadImage">上传图片</Button>
|
||||
<Modal v-model="show" width="850" @on-ok="callback" title="上传图片">
|
||||
<t-button @click="handleClickUploadImage">上传图片</t-button>
|
||||
<t-dialog :visible.sync="show" :width="850" header="上传图片" @confirm="callback" @close="show=false">
|
||||
<div class="import-oss" @click="importOSS">
|
||||
从资源库中导入
|
||||
</div>
|
||||
@@ -19,53 +19,50 @@
|
||||
<img alt="image" :src="item.url"/>
|
||||
<div class="upload-list-cover">
|
||||
<div>
|
||||
<Icon
|
||||
size="30"
|
||||
type="md-search"
|
||||
@click.native="$previewImage(item.url)"
|
||||
></Icon>
|
||||
<Icon
|
||||
size="30"
|
||||
type="md-trash"
|
||||
@click.native="handleRemoveGoodsPicture(__index)"
|
||||
></Icon>
|
||||
<t-icon name="search" size="30" @click="$previewImage(item.url)" />
|
||||
<t-icon name="delete" size="30" @click="handleRemoveGoodsPicture(__index)" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</vuedraggable>
|
||||
<div class="upload-box">
|
||||
<Upload
|
||||
<t-upload
|
||||
ref="upload"
|
||||
:action="uploadFileUrl"
|
||||
:format="['jpg', 'jpeg', 'png']"
|
||||
:headers="{ ...accessToken }"
|
||||
:max-size="10240"
|
||||
:on-exceeded-size="handleMaxSize"
|
||||
:on-format-error="handleFormatError"
|
||||
:on-success="handleSuccessGoodsPicture"
|
||||
:show-upload-list="false"
|
||||
multiple
|
||||
type="drag"
|
||||
accept=".jpg,.jpeg,.png"
|
||||
:sizeLimit="{ size: 10240, unit: 'KB' }"
|
||||
@success="handleSuccessGoodsPicture"
|
||||
@fail="handleFail"
|
||||
:showUploadFileList="false"
|
||||
:multiple="true"
|
||||
theme="dragger"
|
||||
>
|
||||
<div style="width: 148px; height: 148px; line-height: 148px">
|
||||
<Icon size="20" type="md-add"></Icon>
|
||||
<div style="width: 148px; height: 148px; line-height: 148px; display:flex; align-items:center; justify-content:center;">
|
||||
<t-icon size="20" name="add" />
|
||||
</div>
|
||||
</Upload>
|
||||
</t-upload>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
</t-dialog>
|
||||
|
||||
<Modal width="1000" v-model="showOssManager" @on-ok="confirmUrls">
|
||||
<OssManage ref="ossManage" :isComponent="true" :initialize="showOssManager" @selected="(list)=>{ selectedImage = list}" @callback="handleCallback" />
|
||||
</Modal>
|
||||
<t-dialog :width="1000" :visible.sync="showOssManager" header="资源库" @confirm="confirmUrls" @close="showOssManager=false">
|
||||
<OssManage ref="ossManage" :isComponent="true" :initialize="showOssManager" @selected="(list)=>{ selectedImage = list}" @callback="handleCallback" />
|
||||
<template #footer>
|
||||
<t-button variant="text" @click="showOssManager=false">关闭</t-button>
|
||||
<t-button theme="primary" @click="confirmUrls">确定</t-button>
|
||||
</template>
|
||||
</t-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import vuedraggable from "vuedraggable";
|
||||
import {uploadFile} from "@/libs/axios";
|
||||
import { MessagePlugin } from "tdesign-vue";
|
||||
// import OssManage from "@/views/sys/oss-manage/ossManage";
|
||||
import OssManage from "@/views/sys/oss-manage/ossManage.vue";
|
||||
|
||||
export default {
|
||||
name: "upload-image",
|
||||
components: {
|
||||
@@ -102,23 +99,19 @@ export default {
|
||||
this.images.splice(__index, 1);
|
||||
},
|
||||
// 图片大小不正确
|
||||
handleMaxSize(file) {
|
||||
this.$Notice.warning({
|
||||
title: "超过文件大小限制",
|
||||
desc: "图片大小不能超过10MB",
|
||||
});
|
||||
},
|
||||
// 图片格式不正确
|
||||
handleFormatError(file) {
|
||||
this.$Notice.warning({
|
||||
title: "文件格式不正确",
|
||||
desc: "文件 " + file.name + " 的格式不正确",
|
||||
});
|
||||
handleFail({ error, file }) {
|
||||
if (error && error.type === 'exceed-size') {
|
||||
MessagePlugin.warning("图片大小不能超过10MB");
|
||||
} else if (error && error.type === 'accept') {
|
||||
MessagePlugin.warning("文件格式不正确(仅支持 .jpg/.jpeg/.png)");
|
||||
} else {
|
||||
MessagePlugin.error("上传失败");
|
||||
}
|
||||
},
|
||||
// sku图片上传成功
|
||||
handleSuccessGoodsPicture(res, file) {
|
||||
if (file.response) {
|
||||
file.url = file.response.result;
|
||||
handleSuccessGoodsPicture({ response, file }) {
|
||||
if (response) {
|
||||
file.url = response.result;
|
||||
this.images.push(file);
|
||||
}
|
||||
},
|
||||
@@ -129,7 +122,7 @@ export default {
|
||||
this.showOssManager = false
|
||||
},
|
||||
handleCallback(val){
|
||||
this.$Message.success("导入成功")
|
||||
MessagePlugin.success("导入成功")
|
||||
this.images.push({url:val.url})
|
||||
},
|
||||
// 从资源库中导入图片
|
||||
|
||||
@@ -51,22 +51,18 @@
|
||||
<li class="hz-u-square hz-u-square-br" data-pointer="dealBR"></li>
|
||||
</ul>
|
||||
|
||||
<Modal
|
||||
v-model="showModal"
|
||||
title="编辑热区"
|
||||
draggable
|
||||
scrollable
|
||||
:mask="false"
|
||||
ok-text="保存"
|
||||
@on-ok="saveZone"
|
||||
@on-cancel="cancelZone"
|
||||
<t-dialog
|
||||
:visible.sync="showModal"
|
||||
header="编辑热区"
|
||||
:draggable="true"
|
||||
@close="cancelZone"
|
||||
>
|
||||
<div>
|
||||
<div class="hz-edit-img">
|
||||
<img class="show-image" :src="zoneForm.img" alt />
|
||||
</div>
|
||||
|
||||
<Form :model="zoneForm" :label-width="80">
|
||||
<t-form :data="zoneForm" :labelWidth="80">
|
||||
<!-- <FormItem label="图片链接:">
|
||||
<Input v-model="zoneForm.img"></Input>
|
||||
<Button size="small" type="primary" @click="handleSelectImg"
|
||||
@@ -74,26 +70,31 @@
|
||||
>
|
||||
:v-model="zoneForm.type === 'goods' ? zoneForm.goodsName : zoneForm.link"
|
||||
</FormItem> -->
|
||||
<FormItem label="跳转链接:">
|
||||
<Input type="textarea" v-if="zoneForm.type === 'other' && zoneForm.title === '外部链接'" v-model="zoneForm.link" ></Input>
|
||||
<Button size="small" type="primary" @click="handleSelectLink"
|
||||
>选择链接</Button
|
||||
>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<t-form-item label="跳转链接:">
|
||||
<t-textarea v-if="zoneForm.type === 'other' && zoneForm.title === '外部链接'" v-model="zoneForm.link" />
|
||||
<t-button size="small" theme="primary" @click="handleSelectLink">选择链接</t-button>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</div>
|
||||
</Modal>
|
||||
<template #footer>
|
||||
<t-button variant="text" @click="cancelZone">取消</t-button>
|
||||
<t-button theme="primary" @click="saveZone">保存</t-button>
|
||||
</template>
|
||||
</t-dialog>
|
||||
<!-- 选择商品。链接 -->
|
||||
<liliDialog ref="liliDialog" @selectedLink="selectedLink"></liliDialog>
|
||||
<!-- 选择图片 -->
|
||||
<Modal width="1200px" v-model="picModelFlag" footer-hide>
|
||||
<t-dialog :width="1200" :visible.sync="picModelFlag" header="选择图片">
|
||||
<ossManage
|
||||
@callback="callbackSelected"
|
||||
:isComponent="true"
|
||||
:initialize="picModelFlag"
|
||||
ref="ossManage"
|
||||
/>
|
||||
</Modal>
|
||||
<template #footer>
|
||||
<t-button variant="text" @click="picModelFlag=false">关闭</t-button>
|
||||
</template>
|
||||
</t-dialog>
|
||||
</li>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
<template>
|
||||
<Modal
|
||||
:styles="{ top: '120px' }"
|
||||
width="800"
|
||||
@on-cancel="clickClose"
|
||||
@on-ok="clickOK"
|
||||
v-model="flag"
|
||||
:mask-closable="false"
|
||||
title="绘制热区"
|
||||
scrollable
|
||||
<t-dialog
|
||||
:visible.sync="flag"
|
||||
:width="800"
|
||||
header="绘制热区"
|
||||
:closeOnOverlayClick="false"
|
||||
@close="clickClose"
|
||||
@confirm="clickOK"
|
||||
>
|
||||
<template v-if="flag">
|
||||
<hotzone
|
||||
@@ -17,7 +15,7 @@
|
||||
:image="res.img"
|
||||
></hotzone>
|
||||
</template>
|
||||
</Modal>
|
||||
</t-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import hotzone from "./components/Hotzone.vue";
|
||||
@@ -57,11 +55,11 @@ export default {
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
/deep/ .ivu-modal {
|
||||
::v-deep .t-dialog {
|
||||
overflow: hidden;
|
||||
height: 650px !important;
|
||||
}
|
||||
/deep/ .ivu-modal-body {
|
||||
::v-deep .t-dialog__body {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
overflow: hidden;
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
getQueryGoodsList();
|
||||
}
|
||||
"
|
||||
icon="ios-search"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
v-model="goodsParams.goodsName"
|
||||
@@ -41,9 +40,10 @@
|
||||
goodsParams.pageNumber = 1;
|
||||
getQueryGoodsList();
|
||||
"
|
||||
icon="ios-search"
|
||||
>搜索</Button
|
||||
>
|
||||
<template #icon><t-icon name="search" /></template>
|
||||
搜索
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<Modal :styles="{ top: '120px' }" width="1160" :z-index="10000" @on-cancel="clickClose" @on-ok="clickOK" v-model="flag" :mask-closable="false" scrollable>
|
||||
<t-dialog :visible.sync="flag" :width="1160" header="选择" :closeOnOverlayClick="false" @close="clickClose" @confirm="clickOK">
|
||||
<template v-if="flag">
|
||||
<goodsDialog
|
||||
@selected="
|
||||
@@ -21,7 +21,7 @@
|
||||
class="linkDialog"
|
||||
/>
|
||||
</template>
|
||||
</Modal>
|
||||
</t-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import goodsDialog from "./goods-dialog";
|
||||
@@ -86,11 +86,11 @@ export default {
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
/deep/ .ivu-modal {
|
||||
::v-deep .t-dialog {
|
||||
overflow: hidden;
|
||||
height: 650px !important;
|
||||
}
|
||||
/deep/ .ivu-modal-body {
|
||||
::v-deep .t-dialog__body {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
overflow: hidden;
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<Tabs :value="wap[0].title" class="tabs">
|
||||
<TabPane
|
||||
<t-tabs :value="wap[0].title" class="tabs" @change="onTabChange">
|
||||
<t-tab-panel
|
||||
:label="item.title"
|
||||
:name="item.title"
|
||||
@click="clickTag(item, i)"
|
||||
:value="item.title"
|
||||
v-for="(item, i) in wap"
|
||||
:key="i"
|
||||
>
|
||||
@@ -17,9 +16,8 @@
|
||||
}
|
||||
"
|
||||
/>
|
||||
</TabPane>
|
||||
<!-- </template> -->
|
||||
</Tabs>
|
||||
</t-tab-panel>
|
||||
</t-tabs>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -65,11 +63,13 @@ export default {
|
||||
}
|
||||
return cur;
|
||||
}, []);
|
||||
this.wap.forEach((items,indexs) => {
|
||||
if(items.title == '活动'){
|
||||
this.wap.splice(indexs,1)
|
||||
}
|
||||
})
|
||||
if (this.$route.path !== '/floorList/main') {
|
||||
this.wap.forEach((items, indexs) => {
|
||||
if (items.title == '活动') {
|
||||
this.wap.splice(indexs, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
}else{
|
||||
this.wap.push( {
|
||||
title: "活动",
|
||||
@@ -94,6 +94,8 @@ export default {
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
onTabChange(val){
|
||||
}
|
||||
// isVisible(item) {
|
||||
// const type = this.$route.query.pagetype;
|
||||
// if (type == "INDEX" && [ "discover"].includes(item.name)) {
|
||||
@@ -120,11 +122,11 @@ export default {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/deep/ .ivu-modal {
|
||||
::v-deep .ivu-modal {
|
||||
overflow: hidden;
|
||||
height: 650px !important;
|
||||
}
|
||||
/deep/ .ivu-modal-body {
|
||||
::v-deep .ivu-modal-body {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
overflow: hidden;
|
||||
|
||||
@@ -42,12 +42,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .ivu-scroll-container {
|
||||
::v-deep .ivu-scroll-container {
|
||||
width: 100% !important;
|
||||
height: 400px !important;
|
||||
}
|
||||
|
||||
/deep/ .ivu-scroll-content {
|
||||
::v-deep .ivu-scroll-content {
|
||||
/* */
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
@@ -81,7 +81,7 @@
|
||||
align-items: center;
|
||||
margin: 10px;
|
||||
|
||||
/deep/ img {
|
||||
::v-deep img {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
text-align: center;
|
||||
|
||||
@@ -70,16 +70,9 @@ export default {
|
||||
params: {
|
||||
// 请求参数
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
},
|
||||
pintuanColumns: [
|
||||
// 表头
|
||||
{
|
||||
title: "活动标题",
|
||||
key: "title",
|
||||
tooltip: true,
|
||||
width: 250,
|
||||
},
|
||||
{
|
||||
title: "商品名称",
|
||||
key: "goodsName",
|
||||
@@ -108,12 +101,12 @@ export default {
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
"a",
|
||||
{
|
||||
props: {
|
||||
// type: this.index == params.index ? "primary" : "",
|
||||
type: 'default',
|
||||
size: "small",
|
||||
style: {
|
||||
color: "#2d8cf0",
|
||||
cursor: "pointer",
|
||||
textDecoration: "none",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
@@ -201,12 +194,12 @@ export default {
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
"a",
|
||||
{
|
||||
props: {
|
||||
// type: this.index == params.index ? "primary" : "",
|
||||
type: 'default',
|
||||
size: "small",
|
||||
style: {
|
||||
color: "#2d8cf0",
|
||||
cursor: "pointer",
|
||||
textDecoration: "none",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
@@ -253,12 +246,12 @@ export default {
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
"a",
|
||||
{
|
||||
props: {
|
||||
// type: this.index == params.index ? "primary" : "",
|
||||
type: 'default',
|
||||
size: "small",
|
||||
style: {
|
||||
color: "#2d8cf0",
|
||||
cursor: "pointer",
|
||||
textDecoration: "none",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
@@ -339,15 +332,15 @@ export default {
|
||||
this.sortGoods("SECKILL");
|
||||
},
|
||||
};
|
||||
case "COUPON":
|
||||
return {
|
||||
title: "优惠券",
|
||||
methodsed: () => {
|
||||
this.showPromotionList = [];
|
||||
this.activeColumns = this.pintuanColumns;
|
||||
this.sortGoods("COUPON");
|
||||
},
|
||||
};
|
||||
// case "COUPON":
|
||||
// return {
|
||||
// title: "优惠券",
|
||||
// methodsed: () => {
|
||||
// this.showPromotionList = [];
|
||||
// this.activeColumns = this.pintuanColumns;
|
||||
// this.sortGoods("COUPON");
|
||||
// },
|
||||
// };
|
||||
case "POINTS_GOODS":
|
||||
return {
|
||||
title: "积分商品",
|
||||
@@ -383,7 +376,10 @@ export default {
|
||||
getPromotion(res) {
|
||||
if (res.result) {
|
||||
this.promotionList = res.result;
|
||||
// 去除优惠券
|
||||
delete this.promotionList.COUPON;
|
||||
Object.keys(res.result)[0] && this.typeOption(Object.keys(res.result)[0]).methodsed();
|
||||
this.promotions = Object.keys(res.result)[0];
|
||||
}
|
||||
|
||||
// if (Object.keys(res.result).length) {
|
||||
@@ -424,7 +420,7 @@ img {
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
}
|
||||
/deep/ .ivu-table-wrapper {
|
||||
::v-deep .ivu-table-wrapper {
|
||||
width: 100%;
|
||||
}
|
||||
.list {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<Row :gutter="30">
|
||||
<Col
|
||||
span="4"
|
||||
<t-row :gutter="30">
|
||||
<t-col
|
||||
:span="4"
|
||||
v-for="(item, index) in linkList"
|
||||
:key="index"
|
||||
v-if="
|
||||
@@ -15,23 +15,23 @@
|
||||
:class="{ active: selectedIndex == index }"
|
||||
@click="handleLink(item, index)"
|
||||
>
|
||||
<Icon size="24" :type="item.icon" />
|
||||
<t-icon name="link" size="24" />
|
||||
<p>{{ item.title }}</p>
|
||||
</div>
|
||||
</Col>
|
||||
</t-col>
|
||||
<!-- 外部链接,只有pc端跳转 -->
|
||||
<Col span="4">
|
||||
<t-col :span="4">
|
||||
<div
|
||||
v-if="linkVisible"
|
||||
class="card"
|
||||
:class="{ active: selectedIndex == linkList.length }"
|
||||
@click="handleLink(linkItem, linkList.length)"
|
||||
>
|
||||
<Icon size="24" :type="linkItem.icon" />
|
||||
<t-icon name="link" size="24" />
|
||||
<p>{{ linkItem.title }}</p>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</t-col>
|
||||
</t-row>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -157,7 +157,7 @@ export default {
|
||||
text-align: center;
|
||||
transition: 0.35s;
|
||||
cursor: pointer;
|
||||
/deep/ p {
|
||||
::v-deep p {
|
||||
margin: 10px 0;
|
||||
}
|
||||
border: 1px solid #ededed;
|
||||
|
||||
@@ -33,7 +33,7 @@ export default {
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
/deep/ .ivu-card-body {
|
||||
::v-deep .ivu-card-body {
|
||||
height: 414px;
|
||||
overflow: auto;
|
||||
}
|
||||
@@ -69,11 +69,11 @@ export default {
|
||||
height: 416px;
|
||||
overflow: hidden;
|
||||
}
|
||||
/deep/ .ivu-table {
|
||||
::v-deep .ivu-table {
|
||||
height: 300px !important;
|
||||
overflow: auto;
|
||||
}
|
||||
/deep/ .ivu-card-body {
|
||||
::v-deep .ivu-card-body {
|
||||
padding: 0;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
<div class="query-wrapper">
|
||||
<div class="query-item">
|
||||
<div>店铺名称</div>
|
||||
<Input placeholder="请输入店铺名称" @on-clear="shopsData=[]; params.storeName=''; params.pageNumber =1; init()" @on-enter="()=>{shopsData=[]; params.pageNumber =1; init();}" icon="ios-search" clearable style="width: 150px"
|
||||
<t-input placeholder="请输入店铺名称" @clear="shopsData=[]; params.storeName=''; params.pageNumber =1; init()" @enter="()=>{shopsData=[]; params.pageNumber =1; init();}" clearable style="width: 150px"
|
||||
v-model="params.storeName" />
|
||||
</div>
|
||||
|
||||
<div class="query-item">
|
||||
<Button type="primary" @click="shopsData=[];params.pageNumber =1; init();" icon="ios-search">搜索</Button>
|
||||
<t-button theme="primary" @click="shopsData=[];params.pageNumber =1; init();">搜索</t-button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
@@ -25,19 +25,16 @@
|
||||
<div class="wap-sku" :class="{'theme_color':(item.storeDisable === 'OPEN' ? true : false) }">{{ item.storeDisable === 'OPEN' ? '开启中' : '未开启' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<Spin size="large" fix v-if="loading"></Spin>
|
||||
<t-loading v-if="loading" :loading="true" fullscreen></t-loading>
|
||||
</div>
|
||||
<Page
|
||||
:total="total"
|
||||
class="pageration"
|
||||
@on-change="changePageSize"
|
||||
:page-size="params.pageSize"
|
||||
<t-pagination
|
||||
:current="params.pageNumber"
|
||||
:total="Number(total)"
|
||||
:pageSize="params.pageSize"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
|
||||
>
|
||||
</Page>
|
||||
:showJumper="true"
|
||||
@change="onPaginationChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -65,8 +62,9 @@ export default {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
changePageSize(v){
|
||||
this.params.pageNumber = v;
|
||||
onPaginationChange({ current, pageSize }){
|
||||
this.params.pageNumber = current;
|
||||
this.params.pageSize = pageSize;
|
||||
this.init();
|
||||
},
|
||||
init() {
|
||||
|
||||
@@ -45,7 +45,7 @@ export default {
|
||||
order: "desc",
|
||||
pageClientType: "H5",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
pageType: "SPECIAL",
|
||||
},
|
||||
total: 0, // 表单数据总数
|
||||
@@ -137,7 +137,7 @@ img {
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
}
|
||||
/deep/ .ivu-table-wrapper {
|
||||
::v-deep .ivu-table-wrapper {
|
||||
width: 100%;
|
||||
}
|
||||
.list {
|
||||
|
||||
@@ -5,16 +5,7 @@
|
||||
<h3>
|
||||
内容设置
|
||||
</h3>
|
||||
<div class="config-item flex flex-a-c flex-j-sb">
|
||||
<div>
|
||||
<Tooltip theme="light" placement="bottom-end" max-width="100" content="关闭之后部分页面点击'查看''详情'等按钮将跳到新页面展示" >
|
||||
<div>
|
||||
多标签Tab页内嵌模式
|
||||
</div>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<i-switch v-model="setting.isUseTabsRouter"></i-switch>
|
||||
</div>
|
||||
|
||||
</Drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -10,15 +10,19 @@
|
||||
@on-clear="clearSelect"
|
||||
/>
|
||||
<Poptip transfer trigger="click" placement="right" title="选择部门" width="250">
|
||||
<Button icon="md-list">选择部门</Button>
|
||||
<Button>
|
||||
<template #icon><t-icon name="browse" /></template>
|
||||
选择部门
|
||||
</Button>
|
||||
<div slot="content">
|
||||
<Input
|
||||
v-model="searchKey"
|
||||
suffix="ios-search"
|
||||
@on-change="searchDep"
|
||||
placeholder="输入部门名搜索"
|
||||
clearable
|
||||
/>
|
||||
>
|
||||
<template #suffixIcon><t-icon name="search" /></template>
|
||||
</Input>
|
||||
<div class="dep-tree-bar">
|
||||
<Tree
|
||||
:data="dataDep"
|
||||
|
||||
@@ -1,25 +1,20 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="display:flex;">
|
||||
<Input
|
||||
<t-input
|
||||
v-model="currentValue"
|
||||
@on-change="handleChange"
|
||||
@change="handleChange"
|
||||
v-show="showInput"
|
||||
:placeholder="placeholder"
|
||||
:size="size"
|
||||
:disabled="disabled"
|
||||
:readonly="readonly"
|
||||
:maxlength="maxlength"
|
||||
>
|
||||
<Poptip slot="append" transfer trigger="hover" title="图片预览" placement="right">
|
||||
<Icon type="md-eye" class="see-icon" />
|
||||
<div slot="content">
|
||||
<img :src="currentValue" alt="该资源不存在" style="max-width: 300px;margin: 0 auto;display: block;" />
|
||||
<a @click="viewImage=true" style="margin-top:5px;text-align:right;display:block">查看大图</a>
|
||||
</div>
|
||||
</Poptip>
|
||||
</Input>
|
||||
<Button @click="handleCLickImg('storeLogo')">选择图片</Button>
|
||||
<template #suffix>
|
||||
<a style="margin-left:8px" @click="viewImage=true">预览</a>
|
||||
</template>
|
||||
</t-input>
|
||||
<t-button @click="handleCLickImg('storeLogo')">选择图片</t-button>
|
||||
<!--<Upload-->
|
||||
<!--:action="uploadFileUrl"-->
|
||||
<!--:headers="accessToken"-->
|
||||
@@ -39,16 +34,19 @@
|
||||
<!--</Upload>-->
|
||||
</div>
|
||||
|
||||
<Modal title="图片预览" v-model="viewImage" :styles="{top: '30px'}" draggable>
|
||||
<t-dialog header="图片预览" :visible.sync="viewImage" :width="500" @close="viewImage=false">
|
||||
<img :src="currentValue" alt="该资源不存在" style="max-width: 300px;margin: 0 auto;display: block;" />
|
||||
<div slot="footer">
|
||||
<Button @click="viewImage=false">关闭</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
<template #footer>
|
||||
<t-button variant="text" @click="viewImage=false">关闭</t-button>
|
||||
</template>
|
||||
</t-dialog>
|
||||
|
||||
<Modal width="1200px" v-model="picModalFlag">
|
||||
<t-dialog :width="1200" header="选择图片" :visible.sync="picModalFlag" @close="picModalFlag=false">
|
||||
<ossManage @callback="callbackSelected" ref="ossManage" :isComponent="true" :initialize="picModalFlag" />
|
||||
</Modal>
|
||||
<template #footer>
|
||||
<t-button variant="text" @click="picModalFlag=false">关闭</t-button>
|
||||
</template>
|
||||
</t-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@@ -56,6 +54,7 @@
|
||||
<script>
|
||||
import { uploadFile } from "@/api/index";
|
||||
import ossManage from "@/views/sys/oss-manage/ossManage";
|
||||
import { MessagePlugin } from "tdesign-vue";
|
||||
export default {
|
||||
name: "uploadPicInput",
|
||||
components: {
|
||||
@@ -161,7 +160,7 @@ export default {
|
||||
// 上传失败
|
||||
handleError(error, file, fileList) {
|
||||
this.loading = false;
|
||||
this.$Message.error(error.toString());
|
||||
MessagePlugin.error(error.toString());
|
||||
},
|
||||
// 上传成功回显
|
||||
handleChange(v) {
|
||||
|
||||
@@ -13,48 +13,48 @@
|
||||
<div v-if="item.status == 'finished'" style="height:60px;">
|
||||
<img :src="item.url" />
|
||||
<div class="upload-list-cover">
|
||||
<Icon type="ios-eye-outline" @click="handleView(item.url)"></Icon>
|
||||
<Icon type="ios-trash-outline" @click="handleRemove(item)"></Icon>
|
||||
<t-icon name="browse" @click="handleView(item.url)"></t-icon>
|
||||
<t-icon name="delete" @click="handleRemove(item)"></t-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
|
||||
<t-progress v-if="item.showProgress" :percentage="item.percentage"></t-progress>
|
||||
</div>
|
||||
</div>
|
||||
</vuedraggable>
|
||||
<Upload
|
||||
<t-upload
|
||||
ref="upload"
|
||||
:multiple="multiple"
|
||||
:show-upload-list="false"
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:format="['jpg','jpeg','png','gif']"
|
||||
:max-size="1024"
|
||||
:on-format-error="handleFormatError"
|
||||
:on-exceeded-size="handleMaxSize"
|
||||
:before-upload="handleBeforeUpload"
|
||||
type="drag"
|
||||
:showUploadFileList="false"
|
||||
:autoUpload="true"
|
||||
:action="uploadFileUrl"
|
||||
:headers="accessToken"
|
||||
accept=".jpg,.jpeg,.png,.gif"
|
||||
:sizeLimit="{ size: 1024, unit: 'KB' }"
|
||||
:beforeUpload="handleBeforeUpload"
|
||||
theme="dragger"
|
||||
@success="handleSuccess"
|
||||
@fail="handleError"
|
||||
style="display: inline-block;width:58px;"
|
||||
>
|
||||
<div style="width: 58px;height:58px;line-height: 58px;">
|
||||
<Icon type="md-camera" size="20"></Icon>
|
||||
<div style="width: 58px;height:58px;line-height: 58px;display:flex;align-items:center;justify-content:center;">
|
||||
<t-icon name="camera" size="20"></t-icon>
|
||||
</div>
|
||||
</Upload>
|
||||
</t-upload>
|
||||
</div>
|
||||
<Modal title="图片预览" v-model="viewImage" :styles="{top: '30px'}" draggable>
|
||||
<t-dialog header="图片预览" :visible.sync="viewImage" :width="600">
|
||||
<img :src="imgUrl" alt="无效的图片链接" style="width: 100%;margin: 0 auto;display: block;" />
|
||||
<div slot="footer">
|
||||
<Button @click="viewImage=false">关闭</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
<template #footer>
|
||||
<t-button variant="text" @click="viewImage=false">关闭</t-button>
|
||||
</template>
|
||||
</t-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { uploadFile } from "@/api/index";
|
||||
import vuedraggable from "vuedraggable";
|
||||
import { MessagePlugin } from "tdesign-vue";
|
||||
export default {
|
||||
name: "uploadPicThumb",
|
||||
components: {
|
||||
@@ -109,9 +109,9 @@ export default {
|
||||
this.returnValue();
|
||||
},
|
||||
// 上传成功
|
||||
handleSuccess(res, file) {
|
||||
if (res.success) {
|
||||
file.url = res.result;
|
||||
handleSuccess({ response, file }) {
|
||||
if (response && response.success) {
|
||||
file.url = response.result;
|
||||
// 单张图片处理
|
||||
if (!this.multiple && this.uploadList.length > 0) {
|
||||
// 删除第一张
|
||||
@@ -121,35 +121,25 @@ export default {
|
||||
// 返回组件值
|
||||
this.returnValue();
|
||||
} else {
|
||||
this.$Message.error(res.message);
|
||||
MessagePlugin.error((response && response.message) || '上传失败');
|
||||
}
|
||||
},
|
||||
// 上传失败
|
||||
handleError(error, file, fileList) {
|
||||
this.$Message.error(error.toString());
|
||||
handleError({ error }) {
|
||||
MessagePlugin.error((error && error.toString()) || '上传失败');
|
||||
},
|
||||
// 格式校验
|
||||
handleFormatError(file) {
|
||||
this.$Notice.warning({
|
||||
title: "不支持的文件格式",
|
||||
desc:
|
||||
"所选文件‘ " +
|
||||
file.name +
|
||||
" ’格式不正确, 请选择 .jpg .jpeg .png .gif图片格式文件"
|
||||
});
|
||||
MessagePlugin.warning("所选文件格式不正确, 请选择 .jpg/.jpeg/.png/.gif 文件");
|
||||
},
|
||||
// 上传文件大小校验
|
||||
handleMaxSize(file) {
|
||||
this.$Notice.warning({
|
||||
title: "文件大小过大",
|
||||
desc:
|
||||
"所选文件大小过大,不能超过1M."
|
||||
});
|
||||
MessagePlugin.warning("所选文件大小过大,不能超过1M");
|
||||
},
|
||||
// 上传之前钩子
|
||||
handleBeforeUpload() {
|
||||
if (this.multiple && this.uploadList.length >= this.limit) {
|
||||
this.$Message.warning("最多只能上传" + this.limit + "张图片");
|
||||
MessagePlugin.warning("最多只能上传" + this.limit + "张图片");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -185,7 +175,7 @@ export default {
|
||||
if (typeof v == "string") {
|
||||
// 单张
|
||||
if (this.multiple) {
|
||||
this.$Message.warning("多张上传仅支持数组数据类型");
|
||||
MessagePlugin.warning("多张上传仅支持数组数据类型");
|
||||
return;
|
||||
}
|
||||
if (!v) {
|
||||
@@ -202,7 +192,7 @@ export default {
|
||||
} else if (typeof v == "object") {
|
||||
// 多张
|
||||
if (!this.multiple) {
|
||||
this.$Message.warning("单张上传仅支持字符串数据类型");
|
||||
MessagePlugin.warning("单张上传仅支持字符串数据类型");
|
||||
return;
|
||||
}
|
||||
this.uploadList = [];
|
||||
@@ -218,7 +208,7 @@ export default {
|
||||
if (init) {
|
||||
this.$emit("input", v.slice(0, this.limit));
|
||||
}
|
||||
this.$Message.warning("最多只能上传" + this.limit + "张图片");
|
||||
MessagePlugin.warning("最多只能上传" + this.limit + "张图片");
|
||||
} else {
|
||||
v.forEach(e => {
|
||||
let item = {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<Modal width="800" footer-hide v-model="enableMap">
|
||||
<RadioGroup @on-change="changeMap" v-model="mapDefault" type="button">
|
||||
<Radio label="select">级联选择</Radio>
|
||||
<Radio label="map" v-if="aMapSwitch">高德地图</Radio>
|
||||
</RadioGroup>
|
||||
<t-dialog :width="800" :visible.sync="enableMap" header="选择地址" @close="enableMap=false">
|
||||
<t-radio-group @change="changeMap" v-model="mapDefault">
|
||||
<t-radio value="select">级联选择</t-radio>
|
||||
<t-radio value="map" v-if="aMapSwitch">高德地图</t-radio>
|
||||
</t-radio-group>
|
||||
<div>
|
||||
<div v-if="mapDefault === 'select'">
|
||||
<div class="selector">
|
||||
@@ -18,21 +18,24 @@
|
||||
|
||||
</div>
|
||||
<div class="footer">
|
||||
<Button type="primary" @click="finished">确定</Button>
|
||||
<t-button theme="primary" @click="finished">确定</t-button>
|
||||
</div>
|
||||
</div>
|
||||
<mapping v-if="mapDefault === 'map'" ref="map" @getAddress="getAddress" />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</Modal>
|
||||
<template #footer>
|
||||
<t-button variant="text" @click="enableMap=false">关闭</t-button>
|
||||
</template>
|
||||
</t-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { aMapSwitch } from '@/config/index'
|
||||
import mapping from "@/components/map/index.vue";
|
||||
import * as API_Setup from "@/api/common.js";
|
||||
import { MessagePlugin } from "tdesign-vue";
|
||||
export default {
|
||||
components: { mapping },
|
||||
data() {
|
||||
@@ -104,7 +107,7 @@ export default {
|
||||
// 选择完成
|
||||
finished() {
|
||||
if(!this.chiosend[0]){
|
||||
this.$Message.error("请选择地址")
|
||||
MessagePlugin.error("请选择地址")
|
||||
return
|
||||
}
|
||||
const params = this.chiosend.filter((item) => item!=="" && item.value !== "");
|
||||
|
||||
@@ -1,222 +0,0 @@
|
||||
<template>
|
||||
<Modal :mask-closable="false" :value="switched" v-model="switched" title="选择地址" @on-ok="submit" @on-cancel="cancel">
|
||||
<div class="flex">
|
||||
<Spin size="large" fix v-if="spinShow"></Spin>
|
||||
<Tree ref="tree" class="tree" :data="data" expand-node show-checkbox multiple></Tree>
|
||||
</div>
|
||||
</Modal>
|
||||
</template>
|
||||
<script>
|
||||
import { getAllCity } from "@/api/index";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
switched: false, // 控制模态框显隐
|
||||
spinShow: false, // 加载loading
|
||||
data: [], // 地区数据
|
||||
selectedWay: [], // 选择的地区
|
||||
callBackData: "", // 打开组件的回显数据
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
clear() { // 引用该组件的父组件会调用
|
||||
this.data = [];
|
||||
this.selectedWay = [];
|
||||
this.init();
|
||||
},
|
||||
/**
|
||||
* 关闭
|
||||
*/
|
||||
cancel() {
|
||||
this.switched = false;
|
||||
|
||||
// 关闭的时候所有数据设置成disabled为true
|
||||
this.data.forEach((item) => {
|
||||
this.$set(item, "disabled", false);
|
||||
item.children.forEach((child) => {
|
||||
this.$set(child, "disabled", false);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 打开地图选择器
|
||||
* @param {val} 回调的数据
|
||||
* @param {index} 当前操作的运费模板的索引
|
||||
*/
|
||||
open(val, index) {
|
||||
if (val) {
|
||||
//已选中的地址
|
||||
let checkedData = this.$store.state.shipTemplate;
|
||||
|
||||
let checkData = [];
|
||||
let disabledData = checkedData.filter((item, i) => {
|
||||
if (i != index) {
|
||||
return i != index;
|
||||
} else {
|
||||
checkData.push(item);
|
||||
}
|
||||
});
|
||||
// 选中
|
||||
checkData.forEach((check) => {
|
||||
// 循环出已经选中的地址id
|
||||
check.areaId.split(",").forEach((ids) => {
|
||||
this.data.forEach((item) => {
|
||||
// 如果当前省份下市区全部选中则选中该省份
|
||||
if (check.selectedAll) {
|
||||
check.area.split(",").forEach((area) => {
|
||||
if (area == item.name) {
|
||||
this.$set(item, "checked", true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 将市区继续循环
|
||||
item.children.forEach((child, childIndex) => {
|
||||
// 判断当前市区是否是已选中状态
|
||||
if (item.checked) {
|
||||
this.$set(child, "checked", true);
|
||||
}
|
||||
if (child.id == ids) {
|
||||
this.$set(child, "checked", true);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// 禁用
|
||||
disabledData.forEach((dis) => {
|
||||
// 循环出已经选中的地址id
|
||||
dis.areaId.split(",").forEach((ids) => {
|
||||
// 循环出省份
|
||||
this.data.forEach((item) => {
|
||||
// 如果当前省份下市区全部选中则禁用该省份
|
||||
if (dis.selectedAll) {
|
||||
dis.area.split(",").forEach((area) => {
|
||||
if (area == item.name) {
|
||||
this.$set(item, "disabled", true);
|
||||
}
|
||||
});
|
||||
}
|
||||
// 将市区继续循环
|
||||
item.children.forEach((child, childIndex) => {
|
||||
// 判断当前市区是否是已禁用状态
|
||||
if (item.disabled) {
|
||||
this.$set(child, "disabled", true);
|
||||
} else {
|
||||
if (child.id == ids) {
|
||||
this.$set(child, "disabled", true);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
this.switched ? (this.switched = true) : (this.switched = true);
|
||||
},
|
||||
|
||||
/**
|
||||
* 提交并筛选出省市
|
||||
*/
|
||||
submit() {
|
||||
// 筛选出省市
|
||||
let list = this.$refs.tree.getCheckedAndIndeterminateNodes();
|
||||
|
||||
let sort = [];
|
||||
list.forEach((item, i) => {
|
||||
item.selectedList = [];
|
||||
item.selectedAll = false;
|
||||
// 筛选出当前的省份
|
||||
if (item.level == "province" && !item.disabled) {
|
||||
sort.push({
|
||||
...item,
|
||||
});
|
||||
}
|
||||
|
||||
// 筛选出当前选中的市
|
||||
sort.forEach((sortItem, sortIndex) => {
|
||||
if (
|
||||
item.level != "province" &&
|
||||
sortItem.id == item.parentId &&
|
||||
!item.disabled
|
||||
) {
|
||||
sortItem.selectedList.push({
|
||||
...item,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 判断如果当前省是否全选
|
||||
this.data.forEach((whether) => {
|
||||
sort.forEach((item) => {
|
||||
// 如果当前省匹配
|
||||
if (
|
||||
item.id == whether.id &&
|
||||
item.selectedList.length == whether.children.length
|
||||
) {
|
||||
// 给一个全选子级的标识符
|
||||
item.selectedList.forEach((child) => {
|
||||
this.$set(child, "selectedAll", true);
|
||||
});
|
||||
this.$set(item, "selectedAll", true);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
this.$emit("selected", sort);
|
||||
|
||||
this.cancel();
|
||||
},
|
||||
// 初始化地区数据
|
||||
init() {
|
||||
getAllCity().then((res) => {
|
||||
if (res.result) {
|
||||
res.result.forEach((item) => {
|
||||
item.children.forEach((child) => {
|
||||
child.title = child.name;
|
||||
});
|
||||
|
||||
let data = {
|
||||
title: item.name,
|
||||
|
||||
...item,
|
||||
};
|
||||
this.data.push(data);
|
||||
|
||||
this.selectedWay.push({ name: data.title, id: data.id });
|
||||
});
|
||||
this.$store.state.regions = this.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.flex {
|
||||
display: flex;
|
||||
position: relative;
|
||||
}
|
||||
.tree {
|
||||
flex: 2;
|
||||
}
|
||||
.form {
|
||||
flex: 8;
|
||||
}
|
||||
.button-list {
|
||||
margin-left: 80px;
|
||||
> * {
|
||||
margin: 0 4px;
|
||||
}
|
||||
}
|
||||
/deep/ .ivu-modal-body {
|
||||
height: 400px !important;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -1,13 +1,12 @@
|
||||
import Checkbox from '../Checkbox/Checkbox'; // eslint-disable-line
|
||||
// import Radio from '../Radio/Radio'; // eslint-disable-line
|
||||
import { mixins } from './utils';
|
||||
import { Radio } from 'view-design'; // eslint-disable-line
|
||||
|
||||
/* eslint-disable no-underscore-dangle */
|
||||
export default {
|
||||
name: 'TreeTable__body',
|
||||
mixins: [mixins],
|
||||
components: { Radio },
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
radioSelectedIndex: -1,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from "axios";
|
||||
import { getStore, setStore } from "./storage.js";
|
||||
import { router } from "../router/index";
|
||||
import { Message } from "view-design";
|
||||
import { MessagePlugin } from "tdesign-vue";
|
||||
import Cookies from "js-cookie";
|
||||
import { handleRefreshToken } from "../api/index";
|
||||
import {v4 as uuidv4} from 'uuid';
|
||||
@@ -42,7 +42,7 @@ service.interceptors.request.use(
|
||||
return config;
|
||||
},
|
||||
err => {
|
||||
Message.error("请求超时");
|
||||
MessagePlugin.error("请求超时");
|
||||
return Promise.reject(err);
|
||||
}
|
||||
);
|
||||
@@ -53,14 +53,14 @@ service.interceptors.response.use(
|
||||
const data = response.data;
|
||||
// 根据返回的code值来做不同的处理(和后端约定)
|
||||
if (!data.success && data.message) {
|
||||
Message.error(data.message);
|
||||
MessagePlugin.error(data.message);
|
||||
}
|
||||
switch (data.code) {
|
||||
case 400:
|
||||
if (data.message !== null) {
|
||||
Message.error(data.message);
|
||||
MessagePlugin.error(data.message);
|
||||
} else {
|
||||
Message.error("系统异常");
|
||||
MessagePlugin.error("系统异常");
|
||||
}
|
||||
break;
|
||||
case 20004:
|
||||
@@ -70,9 +70,9 @@ service.interceptors.response.use(
|
||||
setStore("accessToken", "");
|
||||
if (router.history.current.name != "login") {
|
||||
if (data.message !== null) {
|
||||
Message.error(data.message);
|
||||
MessagePlugin.error(data.message);
|
||||
} else {
|
||||
Message.error("未知错误,请重新登录");
|
||||
MessagePlugin.error("未知错误,请重新登录");
|
||||
}
|
||||
router.push("/login");
|
||||
}
|
||||
@@ -81,9 +81,9 @@ service.interceptors.response.use(
|
||||
case 500:
|
||||
// 系统异常
|
||||
if (data.message !== null) {
|
||||
Message.error(data.message);
|
||||
MessagePlugin.error(data.message);
|
||||
} else {
|
||||
Message.error("系统异常");
|
||||
MessagePlugin.error("系统异常");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -119,7 +119,7 @@ service.interceptors.response.use(
|
||||
}
|
||||
} else {
|
||||
// 其他错误处理
|
||||
Message.error(error.response.data.message);
|
||||
MessagePlugin.error(error.response.data.message);
|
||||
}
|
||||
}
|
||||
/* router.push("/login") */
|
||||
|
||||
@@ -237,6 +237,17 @@ util.initRouterNode = function(routers, data) {
|
||||
for (let item of data) {
|
||||
let menu = Object.assign({}, item);
|
||||
|
||||
// 过滤空路径,避免生成 "path:''" 的重复路由
|
||||
if (!menu.path || String(menu.path).trim() === '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 去重:同名路由不重复添加
|
||||
const exists = routers.some(r => r && r.name === menu.name);
|
||||
if (exists) {
|
||||
continue;
|
||||
}
|
||||
|
||||
menu.component = lazyLoading(menu.frontRoute);
|
||||
|
||||
if (item.children && item.children.length > 0) {
|
||||
|
||||
@@ -2,8 +2,6 @@ import Vue from 'vue';
|
||||
import VueI18n from 'vue-i18n';
|
||||
import zhLocale from './lang/zh-CN';
|
||||
import enLocale from './lang/en-US';
|
||||
import zhCnLocale from 'view-design/src/locale/lang/zh-CN';
|
||||
import enUsLocale from 'view-design/src/locale/lang/en-US';
|
||||
|
||||
Vue.use(VueI18n);
|
||||
|
||||
@@ -17,8 +15,8 @@ Vue.config.lang = lang;
|
||||
// 多语言配置 vue-i18n 6.x+
|
||||
Vue.locale = () => { };
|
||||
const messages = {
|
||||
'zh-CN': Object.assign(zhCnLocale, zhLocale),
|
||||
'en-US': Object.assign(enUsLocale, enLocale)
|
||||
'zh-CN': zhLocale,
|
||||
'en-US': enLocale
|
||||
};
|
||||
const i18n = new VueI18n({
|
||||
locale: lang,
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
// The Vue build version to load with the `import` command
|
||||
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
|
||||
import Vue from 'vue'
|
||||
import ViewUI from 'view-design'
|
||||
// import 'view-design/dist/styles/iview.css'
|
||||
import './styles/theme.less';
|
||||
import TDesign from 'tdesign-vue'
|
||||
import 'tdesign-vue/es/style/index.css'
|
||||
import TdPage from '@/components/TdPage.vue'
|
||||
import VueCompositionApi from '@vue/composition-api'
|
||||
import { Icon as TIcon } from 'tdesign-icons-vue'
|
||||
import 'tdesign-icons-vue/lib/style/index.css'
|
||||
import { MessagePlugin, DialogPlugin, NotificationPlugin, NotifyPlugin } from 'tdesign-vue'
|
||||
|
||||
import "core-js/stable"
|
||||
// import "regenerator-runtime/runtime"
|
||||
@@ -61,11 +66,467 @@ Vue.prototype.wapLinkTo = function (goodsId, skuId) {
|
||||
import priceColorScheme from 'price-color'
|
||||
Vue.use(priceColorScheme);
|
||||
|
||||
const copyViewUi = {...ViewUI}
|
||||
copyViewUi.Input.props.maxlength.default = inputMaxLength // 挂载最大输入值
|
||||
Vue.use(copyViewUi, {
|
||||
i18n: (key, value) => i18n.t(key, value),
|
||||
});
|
||||
Vue.use(VueCompositionApi)
|
||||
Vue.use(TDesign)
|
||||
Vue.component('t-icon', TIcon)
|
||||
Vue.component('Page', TdPage)
|
||||
|
||||
Vue.prototype.$Message = MessagePlugin
|
||||
let __lastDialog = null
|
||||
Vue.prototype.$Modal = {
|
||||
confirm: function (opts) {
|
||||
const d = DialogPlugin.confirm({
|
||||
header: opts && (opts.title || opts.header),
|
||||
content: opts && (opts.content || opts.desc),
|
||||
theme: opts && opts.theme ? opts.theme : 'default',
|
||||
onConfirm: opts && opts.onOk,
|
||||
onCancel: opts && opts.onCancel,
|
||||
onClose: opts && opts.onClose
|
||||
})
|
||||
__lastDialog = d
|
||||
return d
|
||||
},
|
||||
info: function (opts) {
|
||||
const d = DialogPlugin.alert({
|
||||
header: opts && (opts.title || '提示'),
|
||||
content: opts && (opts.content || opts.desc),
|
||||
theme: 'info',
|
||||
onClose: opts && (opts.onOk || opts.onClose)
|
||||
})
|
||||
__lastDialog = d
|
||||
return d
|
||||
},
|
||||
success: function (opts) {
|
||||
const d = DialogPlugin.alert({
|
||||
header: opts && (opts.title || '成功'),
|
||||
content: opts && (opts.content || opts.desc),
|
||||
theme: 'success',
|
||||
onClose: opts && (opts.onOk || opts.onClose)
|
||||
})
|
||||
__lastDialog = d
|
||||
return d
|
||||
},
|
||||
warning: function (opts) {
|
||||
const d = DialogPlugin.alert({
|
||||
header: opts && (opts.title || '警告'),
|
||||
content: opts && (opts.content || opts.desc),
|
||||
theme: 'warning',
|
||||
onClose: opts && (opts.onOk || opts.onClose)
|
||||
})
|
||||
__lastDialog = d
|
||||
return d
|
||||
},
|
||||
error: function (opts) {
|
||||
const d = DialogPlugin.alert({
|
||||
header: opts && (opts.title || '错误'),
|
||||
content: opts && (opts.content || opts.desc),
|
||||
theme: 'danger',
|
||||
onClose: opts && (opts.onOk || opts.onClose)
|
||||
})
|
||||
__lastDialog = d
|
||||
return d
|
||||
},
|
||||
remove: function () {
|
||||
if (__lastDialog && typeof __lastDialog.hide === 'function') {
|
||||
__lastDialog.hide()
|
||||
} else if (__lastDialog && typeof __lastDialog.destroy === 'function') {
|
||||
__lastDialog.destroy()
|
||||
}
|
||||
__lastDialog = null
|
||||
}
|
||||
}
|
||||
Vue.prototype.$Notice = {
|
||||
info: function (opts) {
|
||||
return NotificationPlugin.info({
|
||||
title: opts && opts.title,
|
||||
content: opts && (opts.desc || opts.content)
|
||||
})
|
||||
},
|
||||
success: function (opts) {
|
||||
return NotificationPlugin.success({
|
||||
title: opts && opts.title,
|
||||
content: opts && (opts.desc || opts.content)
|
||||
})
|
||||
},
|
||||
warning: function (opts) {
|
||||
return NotificationPlugin.warning({
|
||||
title: opts && opts.title,
|
||||
content: opts && (opts.desc || opts.content)
|
||||
})
|
||||
},
|
||||
error: function (opts) {
|
||||
return NotificationPlugin.error({
|
||||
title: opts && opts.title,
|
||||
content: opts && (opts.desc || opts.content)
|
||||
})
|
||||
},
|
||||
closeAll: function () {
|
||||
return NotificationPlugin.closeAll()
|
||||
}
|
||||
}
|
||||
|
||||
Vue.component('Input', {
|
||||
inheritAttrs: false,
|
||||
props: ['value'],
|
||||
model: { prop: 'value', event: 'input' },
|
||||
render(h){
|
||||
const attrs = this.$attrs || {}
|
||||
const props = Object.assign({}, attrs, { value: this.value })
|
||||
const on = Object.assign({}, this.$listeners, {
|
||||
change: v => this.$emit('input', v),
|
||||
enter: e => this.$emit('on-enter', e),
|
||||
clear: e => this.$emit('on-clear', e),
|
||||
input: v => this.$emit('input', v)
|
||||
})
|
||||
if(attrs.type === 'textarea'){
|
||||
const taProps = Object.assign({}, props)
|
||||
delete taProps.type
|
||||
return h('t-textarea', { props: taProps, on })
|
||||
}
|
||||
return h('t-input', { props, on })
|
||||
}
|
||||
})
|
||||
Vue.component('Card', {
|
||||
inheritAttrs: false,
|
||||
render(h){
|
||||
return h('t-card', { props: this.$attrs }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('Button', {
|
||||
inheritAttrs: false,
|
||||
render(h){
|
||||
const attrs = this.$attrs || {}
|
||||
const type = attrs.type
|
||||
let theme = attrs.theme
|
||||
let variant = attrs.variant
|
||||
if(!theme){
|
||||
switch(type){
|
||||
case 'primary': theme = 'primary'; break
|
||||
case 'default': theme = 'default'; break
|
||||
case 'success': theme = 'success'; break
|
||||
case 'warning': theme = 'warning'; break
|
||||
case 'error': theme = 'danger'; break
|
||||
case 'info': theme = 'primary'; break
|
||||
case 'text': theme = theme || 'default'; variant = 'text'; break
|
||||
default: theme = theme || 'default'
|
||||
}
|
||||
}
|
||||
if(attrs.ghost){ variant = 'outline' }
|
||||
const props = Object.assign({}, attrs, { theme })
|
||||
if(variant){ props.variant = variant }
|
||||
delete props.type
|
||||
delete props.ghost
|
||||
return h('t-button', { props, on: this.$listeners }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('Spin', {
|
||||
props: ['size','fix'],
|
||||
render(h){
|
||||
const size = this.size === 'large' ? 'large' : 'small'
|
||||
return h('t-loading', { props: { loading: true, size, fullscreen: !!this.fix } })
|
||||
}
|
||||
})
|
||||
Vue.component('Tag', {
|
||||
props: ['color'],
|
||||
render(h){
|
||||
let theme = 'default'
|
||||
if(this.color === 'geekblue') theme = 'primary'
|
||||
return h('t-tag', { props: { theme } }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('Cascader', {
|
||||
inheritAttrs: false,
|
||||
props: ['value','data','placeholder'],
|
||||
model: { prop: 'value', event: 'input' },
|
||||
render(h){
|
||||
const props = { value: this.value, options: this.data, placeholder: this.placeholder }
|
||||
const on = Object.assign({}, this.$listeners, { change: val => this.$emit('input', val) })
|
||||
return h('t-cascader', { props, on })
|
||||
}
|
||||
})
|
||||
Vue.component('Tabs', {
|
||||
inheritAttrs: false,
|
||||
props: ['value'],
|
||||
model: { prop: 'value', event: 'change' },
|
||||
render(h){
|
||||
const props = Object.assign({}, this.$attrs, { value: this.value })
|
||||
const on = Object.assign({}, this.$listeners, { change: v => this.$emit('change', v) })
|
||||
return h('t-tabs', { props, on }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('TabPane', {
|
||||
props: ['label','name'],
|
||||
render(h){
|
||||
const value = this.name
|
||||
const props = { label: this.label, value }
|
||||
return h('t-tab-panel', { props }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('Row', {
|
||||
inheritAttrs: false,
|
||||
render(h){
|
||||
return h('t-row', { attrs: this.$attrs }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('Col', {
|
||||
inheritAttrs: false,
|
||||
render(h){
|
||||
const props = Object.assign({}, this.$attrs)
|
||||
if(typeof props.span !== 'undefined') props.span = Number(props.span)
|
||||
return h('t-col', { props }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('Modal', {
|
||||
inheritAttrs: false,
|
||||
props: ['value','title','footerHide','closable','maskClosable'],
|
||||
model: { prop: 'value', event: 'input' },
|
||||
render(h){
|
||||
const props = {
|
||||
visible: !!this.value,
|
||||
header: this.title,
|
||||
closeOnOverlayClick: this.maskClosable !== false,
|
||||
closeBtn: this.closable !== false,
|
||||
}
|
||||
const on = {
|
||||
confirm: e => this.$emit('on-ok', e),
|
||||
cancel: e => this.$emit('on-cancel', e),
|
||||
close: e => this.$emit('on-close', e),
|
||||
'update:visible': v => this.$emit('input', v)
|
||||
}
|
||||
const slots = Object.assign({}, this.$slots)
|
||||
if(this.footerHide){
|
||||
props.footer = null
|
||||
}
|
||||
return h('t-dialog', { props, on }, slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('Drawer', {
|
||||
inheritAttrs: false,
|
||||
props: ['value','title','size','closeOnOverlayClick'],
|
||||
model: { prop: 'value', event: 'input' },
|
||||
render(h){
|
||||
const props = {
|
||||
visible: !!this.value,
|
||||
header: this.title,
|
||||
size: String(this.size || 400),
|
||||
closeOnOverlayClick: this.closeOnOverlayClick !== false
|
||||
}
|
||||
const on = {
|
||||
'update:visible': v => this.$emit('input', v)
|
||||
}
|
||||
return h('t-drawer', { props, on }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('Dropdown', {
|
||||
inheritAttrs: false,
|
||||
props: ['trigger','placement','disabled','hideOnClick'],
|
||||
render(h){
|
||||
const props = Object.assign({}, this.$attrs, {
|
||||
trigger: this.trigger || this.$attrs.trigger || 'hover',
|
||||
placement: this.placement || this.$attrs.placement || 'bottom',
|
||||
disabled: this.disabled || this.$attrs.disabled,
|
||||
hideOnClick: this.hideOnClick !== undefined ? this.hideOnClick : this.$attrs.hideOnClick
|
||||
})
|
||||
return h('t-dropdown', { props, on: this.$listeners }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('DropdownMenu', {
|
||||
render(h){
|
||||
return h('t-dropdown-menu', {}, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('DropdownItem', {
|
||||
inheritAttrs: false,
|
||||
props: ['name','command','disabled','divider'],
|
||||
render(h){
|
||||
const value = this.name || this.command
|
||||
const props = { value, disabled: !!this.disabled, divider: !!this.divider }
|
||||
const on = Object.assign({}, this.$listeners)
|
||||
return h('t-dropdown-item', { props, on }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('Alert', {
|
||||
props: ['type','title'],
|
||||
render(h){
|
||||
const theme = this.type || 'info'
|
||||
return h('t-alert', { props: { theme, message: this.title } })
|
||||
}
|
||||
})
|
||||
Vue.component('Form', {
|
||||
inheritAttrs: false,
|
||||
props: ['model','rules','inline','labelWidth'],
|
||||
methods: {
|
||||
validate(cb){
|
||||
const inst = this.$refs && this.$refs.tForm
|
||||
if(!inst){ if(cb) cb(false); return false }
|
||||
const r = inst.validate && inst.validate()
|
||||
if(cb){
|
||||
Promise.resolve(r).then(res => {
|
||||
const ok = res === true || res === null || (res && typeof res === 'object' && Object.keys(res).length === 0)
|
||||
cb(ok)
|
||||
}).catch(() => cb(false))
|
||||
}
|
||||
return r
|
||||
},
|
||||
resetFields(){
|
||||
const inst = this.$refs && this.$refs.tForm
|
||||
if(inst && inst.reset) inst.reset()
|
||||
},
|
||||
reset(){
|
||||
const inst = this.$refs && this.$refs.tForm
|
||||
if(inst && inst.reset) inst.reset()
|
||||
}
|
||||
},
|
||||
render(h){
|
||||
const attrs = this.$attrs || {}
|
||||
const props = {
|
||||
data: this.model || attrs.model || {},
|
||||
rules: this.rules || attrs.rules,
|
||||
layout: (this.inline || attrs.inline) ? 'inline' : (attrs.layout || 'vertical'),
|
||||
labelWidth: this.labelWidth || attrs.labelWidth || attrs['label-width']
|
||||
}
|
||||
return h('t-form', { props, on: this.$listeners, ref: 'tForm' }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('FormItem', {
|
||||
inheritAttrs: false,
|
||||
props: ['prop','label'],
|
||||
render(h){
|
||||
const attrs = this.$attrs || {}
|
||||
const props = {
|
||||
name: this.prop || attrs.prop || '',
|
||||
label: this.label || attrs.label || ''
|
||||
}
|
||||
return h('t-form-item', { props }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('Table', {
|
||||
props: ['columns','data','loading','height','border','rowKey','tooltip'],
|
||||
render(h){
|
||||
const cols = (this.columns || []).map(c => {
|
||||
const nc = Object.assign({}, c)
|
||||
if(c.render && !c.cell){
|
||||
nc.cell = (h2, { row, col, rowIndex }) => c.render(h2, { row, column: col, index: rowIndex })
|
||||
delete nc.render
|
||||
}
|
||||
if(c.key && !c.colKey){
|
||||
nc.colKey = c.key
|
||||
delete nc.key
|
||||
}
|
||||
return nc
|
||||
})
|
||||
const props = { columns: cols, data: this.data, loading: this.loading, height: this.height, rowKey: this.rowKey || 'id' }
|
||||
return h('t-table', { props })
|
||||
}
|
||||
})
|
||||
Vue.component('Select', {
|
||||
inheritAttrs: false,
|
||||
props: ['value'],
|
||||
model: { prop: 'value', event: 'change' },
|
||||
render(h){
|
||||
const props = Object.assign({}, this.$attrs, { value: this.value })
|
||||
const on = Object.assign({}, this.$listeners, { change: v => { this.$emit('on-change', v); this.$emit('change', v) } })
|
||||
return h('t-select', { props, on }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('Option', {
|
||||
props: ['value','label'],
|
||||
render(h){
|
||||
return h('t-option', { props: { value: this.value, label: this.label } }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('InputNumber', {
|
||||
inheritAttrs: false,
|
||||
props: ['value','min','max','step','size','disabled'],
|
||||
model: { prop: 'value', event: 'change' },
|
||||
render(h){
|
||||
const props = Object.assign({}, this.$attrs, { value: this.value })
|
||||
const on = Object.assign({}, this.$listeners, { change: v => { this.$emit('change', v); this.$emit('input', v) } })
|
||||
return h('t-input-number', { props, on })
|
||||
}
|
||||
})
|
||||
Vue.component('RadioGroup', {
|
||||
inheritAttrs: false,
|
||||
props: ['value'],
|
||||
model: { prop: 'value', event: 'change' },
|
||||
render(h){
|
||||
const attrs = this.$attrs || {}
|
||||
const props = Object.assign({}, attrs, { value: this.value })
|
||||
delete props.type
|
||||
delete props['button-style']
|
||||
const on = Object.assign({}, this.$listeners, { change: v => this.$emit('change', v) })
|
||||
return h('t-radio-group', { props, on }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('Radio', {
|
||||
inheritAttrs: false,
|
||||
props: ['label','disabled'],
|
||||
render(h){
|
||||
const value = this.label
|
||||
const props = Object.assign({}, this.$attrs, { value, disabled: !!this.disabled })
|
||||
return h('t-radio', { props }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('CheckboxGroup', {
|
||||
inheritAttrs: false,
|
||||
props: ['value'],
|
||||
model: { prop: 'value', event: 'change' },
|
||||
render(h){
|
||||
const props = Object.assign({}, this.$attrs, { value: this.value })
|
||||
const on = Object.assign({}, this.$listeners, { change: v => { this.$emit('change', v); this.$emit('on-change', v) } })
|
||||
return h('t-checkbox-group', { props, on }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('Checkbox', {
|
||||
inheritAttrs: false,
|
||||
props: ['label','disabled'],
|
||||
render(h){
|
||||
const props = Object.assign({}, this.$attrs, { value: this.label, disabled: !!this.disabled })
|
||||
return h('t-checkbox', { props }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('i-switch', {
|
||||
props: ['value'],
|
||||
model: { prop: 'value', event: 'change' },
|
||||
render(h){
|
||||
return h('t-switch', { props: { value: this.value }, on: { change: v => { this.$emit('on-change', v); this.$emit('change', v) } } })
|
||||
}
|
||||
})
|
||||
Vue.component('Tooltip', {
|
||||
props: ['content','placement'],
|
||||
render(h){
|
||||
return h('t-tooltip', { props: { content: this.content, placement: this.placement || 'top' } }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('Poptip', {
|
||||
inheritAttrs: false,
|
||||
props: ['title','placement'],
|
||||
render(h){
|
||||
const props = { content: this.title || this.$attrs.content, placement: this.placement || 'top' }
|
||||
const on = Object.assign({}, this.$listeners, { confirm: e => this.$emit('on-ok', e), cancel: e => this.$emit('on-cancel', e) })
|
||||
return h('t-popconfirm', { props, on }, this.$slots.default)
|
||||
}
|
||||
})
|
||||
Vue.component('Icon', {
|
||||
props: ['type','size','color'],
|
||||
render(h){
|
||||
const map = {
|
||||
'md-home': 'home',
|
||||
'md-cart': 'cart',
|
||||
'md-heart': 'heart',
|
||||
'md-document': 'file',
|
||||
'md-person': 'user',
|
||||
'ios-link': 'link',
|
||||
'ios-videocam': 'video',
|
||||
'md-share-alt': 'share'
|
||||
}
|
||||
const name = map[this.type] || this.type || 'link'
|
||||
const props = { name: name, size: this.size }
|
||||
const data = {}
|
||||
if(this.color){ data.style = { color: this.color } }
|
||||
return h('t-icon', { props, ...data })
|
||||
}
|
||||
})
|
||||
|
||||
Vue.component('liliDialog', liliDialog)
|
||||
|
||||
@@ -84,6 +545,7 @@ Vue.prototype.removeStore = removeStore;
|
||||
Vue.prototype.$mainColor = mainColor;
|
||||
Vue.prototype.md5 = md5;
|
||||
|
||||
|
||||
Array.prototype.remove = function (from, to) {
|
||||
var rest = this.slice((to || from) + 1 || this.length);
|
||||
this.length = from < 0 ? this.length + from : from;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import Vue from 'vue';
|
||||
import ViewUI from 'view-design';
|
||||
import Util from '../libs/util';
|
||||
import VueRouter from 'vue-router';
|
||||
import Cookies from 'js-cookie';
|
||||
@@ -24,7 +23,6 @@ VueRouter.prototype.push = function push(location) {
|
||||
export const router = new VueRouter(RouterConfig);
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
ViewUI.LoadingBar.start();
|
||||
Util.title(to.meta.title);
|
||||
|
||||
next();
|
||||
@@ -49,7 +47,6 @@ router.beforeEach((to, from, next) => {
|
||||
|
||||
router.afterEach((to) => {
|
||||
Util.openNewPage(router.app, to.name, to.params, to.query);
|
||||
ViewUI.LoadingBar.finish();
|
||||
window.scrollTo(0, 0);
|
||||
});
|
||||
|
||||
|
||||
@@ -31,20 +31,6 @@ export const otherRouter = {
|
||||
meta: { title: "个人中心" },
|
||||
component: () => import("@/views/personal-center/personal-center.vue")
|
||||
},
|
||||
{
|
||||
path: "pickup",
|
||||
title: "自提点设置",
|
||||
name: "pickup",
|
||||
meta: { title: "自提点设置" },
|
||||
component: () => import("@/views/sys/setting-manage/pickup.vue")
|
||||
},
|
||||
{
|
||||
path: "goods-publish",
|
||||
title: "商品发布",
|
||||
name: "goods-publish",
|
||||
meta: { title: "商品发布" },
|
||||
component: () => import("@/views/goods/goodsOperation.vue")
|
||||
},
|
||||
{
|
||||
path: "change-password",
|
||||
title: "修改密码",
|
||||
@@ -69,12 +55,6 @@ export const otherRouter = {
|
||||
name: "shop",
|
||||
component: () => import("@/views/seller/shop/shopList.vue")
|
||||
},
|
||||
{
|
||||
path: "shipTemplate",
|
||||
title: "自提点设置",
|
||||
name: "shipTemplate",
|
||||
component: () => import("@/views/logistics/shipTemplate.vue")
|
||||
},
|
||||
{
|
||||
path: "shop-detail",
|
||||
title: "店铺详细",
|
||||
@@ -255,12 +235,6 @@ export const otherRouter = {
|
||||
name: "pintuan-goods",
|
||||
component: () => import("@/views/promotions/pintuan/pintuan-goods.vue")
|
||||
},
|
||||
{
|
||||
path: "promotions/pintuan/pintuan-create",
|
||||
title: "添加拼团活动",
|
||||
name: "pintuan-create",
|
||||
component: () => import("@/views/promotions/pintuan/pintuan-create.vue")
|
||||
},
|
||||
{
|
||||
path: "promotions/full-discount-detail",
|
||||
title: "满减满折详情",
|
||||
|
||||
@@ -34,11 +34,21 @@ const app = {
|
||||
// 动态添加主界面路由,需要缓存
|
||||
updateAppRouter(state, routes) {
|
||||
state.routers.push(...routes);
|
||||
router.addRoutes(routes);
|
||||
const useAddRoute = typeof router.addRoute === 'function';
|
||||
if (useAddRoute) {
|
||||
(routes || []).forEach(r => router.addRoute(r));
|
||||
} else {
|
||||
router.addRoutes(routes);
|
||||
}
|
||||
},
|
||||
// 动态添加全局路由404、500等页面,不需要缓存
|
||||
updateDefaultRouter(state, routes) {
|
||||
router.addRoutes(routes);
|
||||
const useAddRoute = typeof router.addRoute === 'function';
|
||||
if (useAddRoute) {
|
||||
(routes || []).forEach(r => router.addRoute(r));
|
||||
} else {
|
||||
router.addRoutes(routes);
|
||||
}
|
||||
},
|
||||
setAdded(state, v) {
|
||||
state.added = v;
|
||||
|
||||
@@ -19,10 +19,9 @@
|
||||
width: 100% !important;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #f0f0f0;
|
||||
// background-color: #f0f0f0;
|
||||
border-radius: 0.4em;
|
||||
padding: 10px;
|
||||
margin: 0;
|
||||
|
||||
flex-wrap: wrap;
|
||||
> .ivu-form-item {
|
||||
margin: 8px 10px !important;
|
||||
@@ -42,3 +41,8 @@
|
||||
-webkit-line-clamp: 4;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
// 为Card组件之间增加间距
|
||||
.ivu-card + .ivu-card {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
@import "~view-design/src/styles/index.less";
|
||||
// iview 自定义样式
|
||||
|
||||
@primary-color: #ff5c58;
|
||||
@info-color: #fa6419;
|
||||
@primary-color: #ff5c58;
|
||||
@info-color: #fa6419;
|
||||
@success-color: #68cabe;
|
||||
@error-color: #ff3c2a;
|
||||
@table-thead-bg: #f8f8f9;
|
||||
@@ -11,9 +8,3 @@
|
||||
@table-td-highlight-bg: #ededed;
|
||||
@font-size-base: 12px;
|
||||
|
||||
.ivu-drawer,
|
||||
.drawer,
|
||||
.ivu-drawer-wrap {
|
||||
z-index: 2600 !important;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ export function clientTypeWay(val) {
|
||||
} else if (val == "PC") {
|
||||
return "PC端";
|
||||
} else if (val == "WECHAT_MP") {
|
||||
return "小程序端";
|
||||
return "小程序";
|
||||
} else if (val == "APP") {
|
||||
return "移动应用端";
|
||||
} else {
|
||||
|
||||
@@ -93,12 +93,3 @@ export const REQUIRED = {
|
||||
required: true,
|
||||
message:'请填写参数'
|
||||
}
|
||||
|
||||
export const WHITE_SPACE = {
|
||||
whitespace: true,
|
||||
message: "不可为纯空格",
|
||||
}
|
||||
export const VARCHAR60 = {
|
||||
pattern: /^.{1,60}$/,
|
||||
message: '长度应该限制在1-60个字符'
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<shrinkable-menu></shrinkable-menu>
|
||||
</div>
|
||||
<!-- 顶部标题栏主体 -->
|
||||
<div class="main-header-con" :style="{ height: setting.isUseTabsRouter ? '100px' : '60px' }">
|
||||
<div class="main-header-con" style="height: 60px">
|
||||
<div class="main-header">
|
||||
<div class="header-avator-con">
|
||||
<!-- 左侧栏 -->
|
||||
@@ -37,42 +37,34 @@
|
||||
</Tooltip>
|
||||
</li>
|
||||
</ul>
|
||||
<Dropdown
|
||||
transfer
|
||||
trigger="hover"
|
||||
@on-click="handleClickUserDropdown"
|
||||
>
|
||||
<t-dropdown>
|
||||
<div class="dropList">
|
||||
<span class="main-user-name">{{ userInfo.nickName }}</span>
|
||||
<Avatar
|
||||
icon="ios-person"
|
||||
:src="avatarPath"
|
||||
<t-avatar
|
||||
:image="avatarPath"
|
||||
style="background: #fff; margin-left: 10px"
|
||||
></Avatar>
|
||||
></t-avatar>
|
||||
</div>
|
||||
<DropdownMenu slot="list">
|
||||
<DropdownItem name="personalCenter">{{
|
||||
<t-dropdown-menu>
|
||||
<t-dropdown-item @click="handleClickUserDropdown('personalCenter')">{{
|
||||
$t("userCenter")
|
||||
}}</DropdownItem>
|
||||
<DropdownItem name="changePass">{{
|
||||
}}</t-dropdown-item>
|
||||
<t-dropdown-item @click="handleClickUserDropdown('changePass')">{{
|
||||
$t("changePass")
|
||||
}}</DropdownItem>
|
||||
<DropdownItem name="loginOut" divided>{{
|
||||
}}</t-dropdown-item>
|
||||
<t-dropdown-item @click="handleClickUserDropdown('loginOut')">{{
|
||||
$t("logout")
|
||||
}}</DropdownItem>
|
||||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
}}</t-dropdown-item>
|
||||
</t-dropdown-menu>
|
||||
</t-dropdown>
|
||||
</Row>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 已打开的页面标签 -->
|
||||
<div class="tags-con" v-if="setting.isUseTabsRouter">
|
||||
<tags-page-opened :pageTagsList="pageTagsList"></tags-page-opened>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="single-page-con" :style="{ 'top': setting.isUseTabsRouter ? '100px' : '60px', height: setting.isUseTabsRouter ? 'calc(100% - 110px)' : 'calc(100% - 70px)' }">
|
||||
<div class="single-page-con" :style="{ 'top': '60px', height: 'calc(100% - 70px)' }">
|
||||
<div class="single-page">
|
||||
<!-- <keep-alive :include="cachePage"> -->
|
||||
<router-view></router-view>
|
||||
@@ -88,7 +80,6 @@
|
||||
|
||||
<script>
|
||||
import shrinkableMenu from "./main-parts/shrinkable-menu/shrinkable-menu.vue";
|
||||
import tagsPageOpened from "./main-parts/tags-page-opened.vue";
|
||||
import messageTip from "./main-parts/message-tip.vue";
|
||||
import circleLoading from "@/components/lili/circle-loading.vue";
|
||||
import configDrawer from "@/components/lili/config-drawer.vue";
|
||||
@@ -102,7 +93,7 @@ const config = require("@/config/index.js");
|
||||
export default {
|
||||
components: {
|
||||
shrinkableMenu,
|
||||
tagsPageOpened,
|
||||
|
||||
messageTip,
|
||||
circleLoading,
|
||||
configDrawer
|
||||
@@ -125,9 +116,6 @@ export default {
|
||||
loading() {
|
||||
return this.$store.state.app.loading;
|
||||
},
|
||||
pageTagsList() {
|
||||
return this.$store.state.app.pageOpenedList; // 打开的页面的页面对象
|
||||
},
|
||||
avatarPath() {
|
||||
return localStorage.avatorImgPath;
|
||||
},
|
||||
@@ -145,7 +133,7 @@ export default {
|
||||
let userInfo = JSON.parse(Cookies.get("userInfoManager"));
|
||||
|
||||
this.userInfo = userInfo;
|
||||
this.checkTag(this.$route.name);
|
||||
|
||||
let currWidth = document.body.clientWidth;
|
||||
if (currWidth <= 1200) {
|
||||
this.sliceNum = 2;
|
||||
@@ -196,23 +184,7 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
//切换标签
|
||||
checkTag(name) {
|
||||
let openpageHasTag = this.pageTagsList.some((item) => {
|
||||
if (item.name == name) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (!openpageHasTag) {
|
||||
// 解决关闭当前标签后再点击回退按钮会退到当前页时没有标签的问题
|
||||
util.openNewPage(
|
||||
this,
|
||||
name,
|
||||
this.$route.params || {},
|
||||
this.$route.query || {}
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
//宽度动态计算
|
||||
resize() {
|
||||
let currWidth = document.body.clientWidth;
|
||||
@@ -225,10 +197,6 @@ export default {
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
$route(to, from) {
|
||||
this.checkTag(to.name);
|
||||
localStorage.currentPageName = to.name;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
@@ -239,8 +207,6 @@ export default {
|
||||
});
|
||||
},
|
||||
created() {
|
||||
// 显示打开的页面的列表
|
||||
this.$store.commit("setOpenedList");
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,51 +1,25 @@
|
||||
<template>
|
||||
<div class="search">
|
||||
<Card>
|
||||
<Row class="operation">
|
||||
<Button @click="add" type="primary">添加</Button>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-selection-change="changeSelect"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page
|
||||
:current="searchForm.pageNumber"
|
||||
:total="total"
|
||||
:page-size="searchForm.pageSize"
|
||||
@on-change="changePage"
|
||||
@on-page-size-change="changePageSize"
|
||||
:page-size-opts="[10, 20, 50]"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
show-sizer
|
||||
></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
<Modal
|
||||
:title="modalTitle"
|
||||
v-model="modalVisible"
|
||||
:mask-closable="false"
|
||||
:width="500"
|
||||
>
|
||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||
<FormItem label="自定义分词" prop="name">
|
||||
<Input v-model="form.name" clearable style="width: 100%" />
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
|
||||
>提交</Button
|
||||
>
|
||||
<t-card>
|
||||
<div class="operation">
|
||||
<t-button @click="add" theme="primary">添加</t-button>
|
||||
</div>
|
||||
</Modal>
|
||||
<t-table :loading="loading" :columns="columns" :data="data" ref="table" rowKey="id" :rowSelection="{ type: 'multiple', selectedRowKeys }" @select-change="onSelectChange"></t-table>
|
||||
<div class="mt_10" style="display: flex; justify-content: flex-end">
|
||||
<t-pagination :current="searchForm.pageNumber" :total="Number(total)" :pageSize="searchForm.pageSize" :pageSizeOptions="[20, 50, 100]" size="small" :showJumper="true" @change="onPaginationChange" />
|
||||
</div>
|
||||
</t-card>
|
||||
<t-dialog :visible="modalVisible" :header="modalTitle" :mask-closable="false" :width="500" @close="modalVisible = false">
|
||||
<t-form ref="form" :data="form" :labelWidth="100" :rules="formValidate">
|
||||
<t-form-item label="自定义分词" name="name">
|
||||
<t-input v-model="form.name" clearable style="width: 100%" />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<template #footer>
|
||||
<t-button variant="text" @click="modalVisible = false">取消</t-button>
|
||||
<t-button theme="primary" :loading="submitLoading" @click="handleSubmit">提交</t-button>
|
||||
</template>
|
||||
</t-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -58,6 +32,7 @@ import {
|
||||
} from "@/api/index";
|
||||
|
||||
import { regular } from "@/utils";
|
||||
import { MessagePlugin, DialogPlugin } from "tdesign-vue";
|
||||
export default {
|
||||
name: "custom-words",
|
||||
data() {
|
||||
@@ -69,7 +44,7 @@ export default {
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
pageSize: 20, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
words: "",
|
||||
@@ -86,82 +61,16 @@ export default {
|
||||
],
|
||||
},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
selectList: [],
|
||||
selectCount: 0,
|
||||
selectedRowKeys: [],
|
||||
columns: [
|
||||
// 表头
|
||||
{
|
||||
type: "selection",
|
||||
width: 60,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "自定义分词",
|
||||
key: "name",
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
key: "createTime",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
title: "更新时间",
|
||||
key: "updateTime",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
title: "操作人",
|
||||
key: "createBy",
|
||||
minWidth: 150
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
width: 200,
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "info",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.detail(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"修改"
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.remove(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"删除"
|
||||
),
|
||||
]);
|
||||
},
|
||||
},
|
||||
{ colKey: "row-select", type: "multiple", width: 60, align: "center" },
|
||||
{ title: "自定义分词", colKey: "name", minWidth: 120 },
|
||||
{ title: "创建时间", colKey: "createTime", width: 200 },
|
||||
{ title: "更新时间", colKey: "updateTime", width: 200 },
|
||||
{ title: "操作人", colKey: "createBy", minWidth: 150 },
|
||||
{ title: "操作", colKey: "action", align: "center", fixed: "right", width: 200 },
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
@@ -171,25 +80,25 @@ export default {
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
onPaginationChange({ current, pageSize }) {
|
||||
this.searchForm.pageNumber = current;
|
||||
this.searchForm.pageSize = pageSize;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.getDataList();
|
||||
},
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
this.selectedRowKeys = [];
|
||||
this.selectList = [];
|
||||
this.selectCount = 0;
|
||||
},
|
||||
// 选中状态变更
|
||||
changeSelect(e) {
|
||||
onSelectChange(selectedRowKeys, { selectedRowData }) {
|
||||
this.selectedRowKeys = selectedRowKeys;
|
||||
const e = selectedRowData || [];
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
@@ -218,7 +127,7 @@ export default {
|
||||
insertCustomWords(this.form).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
MessagePlugin.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
@@ -229,7 +138,7 @@ export default {
|
||||
updateCustomWords(this.form).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
MessagePlugin.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
@@ -242,8 +151,8 @@ export default {
|
||||
add() {
|
||||
this.modalType = 0;
|
||||
this.modalTitle = "添加";
|
||||
this.form = {}
|
||||
this.$refs.form.resetFields();
|
||||
this.form = { name: "" };
|
||||
if (this.$refs.form && typeof this.$refs.form.reset === 'function') { this.$refs.form.reset(); }
|
||||
|
||||
this.modalVisible = true;
|
||||
},
|
||||
@@ -257,17 +166,14 @@ export default {
|
||||
},
|
||||
// 删除
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
// 记得确认修改此处
|
||||
DialogPlugin.confirm({
|
||||
header: "确认删除",
|
||||
content: "您确认要删除 " + v.name + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
theme: "warning",
|
||||
onConfirm: () => {
|
||||
delCustom(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
MessagePlugin.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
@@ -277,24 +183,20 @@ export default {
|
||||
// 批量删除
|
||||
delAll() {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要删除的数据");
|
||||
MessagePlugin.warning("您还未选择要删除的数据");
|
||||
return;
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
DialogPlugin.confirm({
|
||||
header: "确认删除",
|
||||
content: "您确认要删除所选的 " + this.selectCount + " 条数据?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
theme: "warning",
|
||||
onConfirm: () => {
|
||||
let ids = "";
|
||||
this.selectList.forEach(function (e) {
|
||||
ids += e.id + ",";
|
||||
});
|
||||
this.selectList.forEach(function (e) { ids += e.id + ","; });
|
||||
ids = ids.substring(0, ids.length - 1);
|
||||
// 批量删除
|
||||
delSensitive(ids).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
MessagePlugin.success("操作成功");
|
||||
this.clearSelectAll();
|
||||
this.getDataList();
|
||||
}
|
||||
|
||||
@@ -1,435 +1,164 @@
|
||||
<template>
|
||||
<div>
|
||||
<Card>
|
||||
<Row @keydown.enter.native.prevent="handleSearch">
|
||||
<Form
|
||||
ref="searchForm"
|
||||
:model="searchForm"
|
||||
inline
|
||||
:label-width="70"
|
||||
class="search-form"
|
||||
>
|
||||
<Form-item label="会员名称" prop="memberName">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.memberName"
|
||||
placeholder="请输入会员名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
<Form-item label="状态">
|
||||
<Select
|
||||
v-model="searchForm.distributionStatus"
|
||||
style="width: 200px"
|
||||
>
|
||||
<Option
|
||||
v-for="item in distributionStatusList"
|
||||
:value="item.value"
|
||||
:key="item.value"
|
||||
>{{ item.label }}
|
||||
</Option
|
||||
>
|
||||
</Select>
|
||||
</Form-item>
|
||||
<Button
|
||||
@click="handleSearch"
|
||||
type="primary"
|
||||
icon="ios-search"
|
||||
class="search-btn"
|
||||
>搜索
|
||||
</Button
|
||||
>
|
||||
</Form>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
class="mt_10"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page
|
||||
:current="searchForm.pageNumber"
|
||||
:total="total"
|
||||
:page-size="searchForm.pageSize"
|
||||
@on-change="changePage"
|
||||
@on-page-size-change="changePageSize"
|
||||
:page-size-opts="[10, 20, 50]"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
show-sizer
|
||||
></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
<Modal title="修改分销员" v-model="modalVisible" :mask-closable="false" :width="600">
|
||||
<Form ref="distributionForm" :model="distributionForm" :label-width="150" :rules="distributionFormValidate">
|
||||
<FormItem label="姓名" prop="name">
|
||||
<Input v-model="distributionForm.name" clearable style="width: 100%"/>
|
||||
</FormItem>
|
||||
<FormItem label="身份证号" prop="idNumber">
|
||||
<Input v-model="distributionForm.idNumber" clearable style="width: 100%"/>
|
||||
</FormItem>
|
||||
<FormItem label="结算银行开户行名称" prop="settlementBankAccountName">
|
||||
<Input v-model="distributionForm.settlementBankAccountName" clearable style="width: 100%"/>
|
||||
</FormItem>
|
||||
<FormItem label="结算银行开户账号" prop="settlementBankAccountNum">
|
||||
<Input v-model="distributionForm.settlementBankAccountNum" clearable style="width: 100%"/>
|
||||
</FormItem>
|
||||
<FormItem label="结算银行开户支行名称" prop="settlementBankBranchName">
|
||||
<Input v-model="distributionForm.settlementBankBranchName" clearable style="width: 100%"/>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit">提交</Button>
|
||||
<t-card style="margin-bottom: 12px">
|
||||
<t-form :data="searchForm" layout="inline" :labelWidth="70" class="search-form" @submit="handleSearch">
|
||||
<t-form-item label="会员名称" name="memberName">
|
||||
<t-input v-model="searchForm.memberName" placeholder="请输入会员名称" clearable style="width: 240px" />
|
||||
</t-form-item>
|
||||
|
||||
<t-form-item>
|
||||
<t-button theme="primary" @click="handleSearch">搜索</t-button>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</t-card>
|
||||
<t-card>
|
||||
<t-tabs :value="activeStatus" @change="onStatusTabChange" class="status-tabs">
|
||||
<t-tab-panel label="全部" value="ALL" />
|
||||
<t-tab-panel v-for="item in distributionStatusList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</t-tabs>
|
||||
<t-table :loading="loading" :columns="columns" :data="data" ref="table" class="mt_10" rowKey="id"></t-table>
|
||||
<div class="mt_10" style="display: flex; justify-content: flex-end">
|
||||
<t-pagination :current="searchForm.pageNumber" :total="Number(total)" :pageSize="searchForm.pageSize" :pageSizeOptions="[20, 50, 100]" size="small" :showJumper="true" @change="onPaginationChange" />
|
||||
</div>
|
||||
</Modal>
|
||||
</t-card>
|
||||
<t-drawer :visible.sync="modalVisible" :header="'修改分销员'" placement="right" size="500px" @close="modalVisible = false">
|
||||
<t-form ref="distributionForm" :data="distributionForm" :labelWidth="150">
|
||||
<t-form-item label="姓名" name="name">
|
||||
<t-input v-model="distributionForm.name" />
|
||||
</t-form-item>
|
||||
<t-form-item label="身份证号" name="idNumber">
|
||||
<t-input v-model="distributionForm.idNumber" />
|
||||
</t-form-item>
|
||||
<t-form-item label="结算银行开户行名称" name="settlementBankAccountName">
|
||||
<t-input v-model="distributionForm.settlementBankAccountName" />
|
||||
</t-form-item>
|
||||
<t-form-item label="结算银行开户账号" name="settlementBankAccountNum">
|
||||
<t-input v-model="distributionForm.settlementBankAccountNum" />
|
||||
</t-form-item>
|
||||
<t-form-item label="结算银行开户支行名称" name="settlementBankBranchName">
|
||||
<t-input v-model="distributionForm.settlementBankBranchName" />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<template #footer>
|
||||
<t-button variant="text" @click="modalVisible = false">取消</t-button>
|
||||
<t-button theme="primary" :loading="submitLoading" @click="handleSubmit">提交</t-button>
|
||||
</template>
|
||||
</t-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {editDistribution, getDistributionListData, resumeDistribution, retreatDistribution} from "@/api/distribution";
|
||||
import {distributionStatusList} from "./dataJson.js";
|
||||
import {regular} from "@/utils";
|
||||
import { editDistribution, getDistributionListData, resumeDistribution, retreatDistribution } from "@/api/distribution";
|
||||
import { distributionStatusList } from "./dataJson.js";
|
||||
import { MessagePlugin, DialogPlugin } from "tdesign-vue";
|
||||
|
||||
export default {
|
||||
name: "distribution",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
distributionStatusList, // 分销状态
|
||||
loading: true, // 表单加载状态
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
distributionStatusList,
|
||||
loading: true,
|
||||
modalVisible: false,
|
||||
activeStatus: 'ALL',
|
||||
distributionForm: {
|
||||
name: "",
|
||||
idNumber: "",
|
||||
settlementBankAccountName: "",
|
||||
settlementBankAccountNum: "",
|
||||
settlementBankBranchName: ""
|
||||
settlementBankBranchName: "",
|
||||
},
|
||||
// 表单验证规则
|
||||
distributionFormValidate: {
|
||||
name: [
|
||||
regular.REQUIRED,
|
||||
regular.VARCHAR20
|
||||
],
|
||||
idNumber: [
|
||||
regular.REQUIRED,
|
||||
regular.VARCHAR20
|
||||
],
|
||||
settlementBankAccountName: [
|
||||
regular.REQUIRED,
|
||||
regular.VARCHAR20
|
||||
],
|
||||
settlementBankAccountNum: [
|
||||
regular.REQUIRED,
|
||||
regular.VARCHAR20
|
||||
],
|
||||
settlementBankBranchName: [
|
||||
regular.REQUIRED,
|
||||
regular.VARCHAR20
|
||||
],
|
||||
},
|
||||
submitLoading: false, // 编辑提交状态
|
||||
submitLoading: false,
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
pageNumber: 1,
|
||||
pageSize: 20,
|
||||
memberName: "",
|
||||
distributionStatus: "",
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: "会员名称",
|
||||
key: "memberName",
|
||||
minWidth: 120,
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "姓名",
|
||||
key: "name",
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
title: "身份证号",
|
||||
key: "idNumber",
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: "结算银行开户行名称",
|
||||
key: "settlementBankAccountName",
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: "结算银行开户账号",
|
||||
key: "settlementBankAccountNum",
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: "结算银行开户支行名称",
|
||||
key: "settlementBankBranchName",
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: "推广单数",
|
||||
key: "distributionOrderCount",
|
||||
minWidth: 120,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: "分销订单金额",
|
||||
key: "distributionOrderPrice",
|
||||
width: 150,
|
||||
sortable: false,
|
||||
render: (h, params) => {
|
||||
return h("priceColorScheme", {props: {value: params.row.distributionOrderPrice, color: this.$mainColor}});
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "分销金额",
|
||||
key: "rebateTotal",
|
||||
width: 150,
|
||||
sortable: false,
|
||||
render: (h, params) => {
|
||||
return h("priceColorScheme", {props: {value: params.row.rebateTotal, color: this.$mainColor}});
|
||||
},
|
||||
|
||||
},
|
||||
{
|
||||
title: "待提现金额",
|
||||
key: "canRebate",
|
||||
width: 150,
|
||||
sortable: false,
|
||||
render: (h, params) => {
|
||||
return h("priceColorScheme", {props: {value: params.row.canRebate, color: 'green'}});
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "冻结金额",
|
||||
key: "commissionFrozen",
|
||||
width: 150,
|
||||
sortable: false,
|
||||
render: (h, params) => {
|
||||
return h("priceColorScheme", {props: {value: params.row.commissionFrozen, color: '#347dda'}});
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
key: "distributionStatus",
|
||||
width: 150,
|
||||
sortable: false,
|
||||
render: (h, params) => {
|
||||
if (params.row.distributionStatus == "PASS") {
|
||||
return h("Tag", {props: {color: "green",},}, "通过");
|
||||
} else if (params.row.distributionStatus == "APPLY") {
|
||||
return h("Tag", {props: {color: "geekblue",},}, "待审核");
|
||||
} else if (params.row.distributionStatus == "RETREAT") {
|
||||
return h("Tag", {props: {color: "volcano",},}, "清退");
|
||||
} else if (params.row.distributionStatus == "REFUSE") {
|
||||
return h("Tag", {props: {color: "red",},}, "拒绝");
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
width: 140,
|
||||
render: (h, params) => {
|
||||
return h(
|
||||
"div",
|
||||
{
|
||||
style: {
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
},
|
||||
},
|
||||
[
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
display:
|
||||
params.row.distributionStatus != "RETREAT"
|
||||
? "block"
|
||||
: "none",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.retreat(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"清退"
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "success",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
display:
|
||||
params.row.distributionStatus == "RETREAT"
|
||||
? "block"
|
||||
: "none",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.resume(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"恢复"
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "info",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.edit(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"编辑"
|
||||
), h(
|
||||
"div",
|
||||
{
|
||||
style: {
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
},
|
||||
})
|
||||
]
|
||||
);
|
||||
},
|
||||
},
|
||||
{ title: "会员名称", colKey: "memberName", minWidth: 120, align: "left", tooltip: true },
|
||||
{ title: "姓名", colKey: "name", minWidth: 100, align: "left" },
|
||||
{ title: "身份证号", colKey: "idNumber", minWidth: 120, align: "left" },
|
||||
{ title: "结算银行开户行名称", colKey: "settlementBankAccountName", minWidth: 120, align: "left" },
|
||||
{ title: "结算银行开户账号", colKey: "settlementBankAccountNum", minWidth: 120, align: "left" },
|
||||
{ title: "结算银行开户支行名称", colKey: "settlementBankBranchName", minWidth: 120, align: "left" },
|
||||
{ title: "推广单数", colKey: "distributionOrderCount", minWidth: 120, width: 150, align: "left" },
|
||||
{ title: "分销订单金额", colKey: "distributionOrderPrice", width: 150, align: "left", cell: (h, p) => p.row.distributionOrderPrice != null ? h("priceColorScheme", { props: { value: p.row.distributionOrderPrice, color: this.$mainColor } }) : h('span', '-') },
|
||||
{ title: "分销金额", colKey: "rebateTotal", width: 150, align: "left", cell: (h, p) => p.row.rebateTotal != null ? h("priceColorScheme", { props: { value: p.row.rebateTotal, color: this.$mainColor } }) : h('span', '-') },
|
||||
{ title: "待提现金额", colKey: "canRebate", width: 150, align: "left", cell: (h, p) => p.row.canRebate != null ? h("priceColorScheme", { props: { value: p.row.canRebate, color: "green" } }) : h('span', '-') },
|
||||
{ title: "冻结金额", colKey: "commissionFrozen", width: 150, align: "left", cell: (h, p) => p.row.commissionFrozen != null ? h("priceColorScheme", { props: { value: p.row.commissionFrozen, color: "#347dda" } }) : h('span', '-') },
|
||||
{ title: "状态", colKey: "distributionStatus", width: 150, align: "left", cell: (h, p) => {
|
||||
const s = p.row.distributionStatus;
|
||||
const map = { PASS: { theme: "success", label: "通过" }, APPLY: { theme: "warning", label: "待审核" }, RETREAT: { theme: "warning", label: "清退" }, REFUSE: { theme: "danger", label: "拒绝" } };
|
||||
const cfg = map[s] || { theme: "default", label: s };
|
||||
return h("t-tag", { props: { theme: cfg.theme, variant: "light", size: "small" } }, [cfg.label]);
|
||||
} },
|
||||
{ title: "操作", colKey: "action", align: "center", fixed: "right", width: 180, cell: (h, p) => {
|
||||
return h("div", { class: "ops" }, [
|
||||
h("t-button", { props: { theme: "danger", size: "small" }, style: { marginRight: "8px", display: p.row.distributionStatus !== "RETREAT" ? "inline-block" : "none" }, on: { click: () => this.retreat(p.row) } }, ["清退"]),
|
||||
h("t-button", { props: { theme: "success", size: "small" }, style: { marginRight: "8px", display: p.row.distributionStatus === "RETREAT" ? "inline-block" : "none" }, on: { click: () => this.resume(p.row) } }, ["恢复"]),
|
||||
h("t-button", { props: { theme: "default", size: "small" }, on: { click: () => this.edit(p.row) } }, ["编辑"]),
|
||||
]);
|
||||
} },
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
data: [],
|
||||
total: 0,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
// 分页 改变页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
},
|
||||
// 分页 改变页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
// 获取列表数据
|
||||
init() { this.getDataList(); },
|
||||
changePage(v) { this.searchForm.pageNumber = v; this.getDataList(); },
|
||||
changePageSize(v) { this.searchForm.pageSize = v; this.getDataList(); },
|
||||
onPaginationChange(info) { if (info && typeof info.pageSize !== "undefined" && info.pageSize !== this.searchForm.pageSize) { this.changePageSize(info.pageSize); } if (info && typeof info.current !== "undefined") { this.changePage(info.current); } },
|
||||
handleSearch() { this.searchForm.pageNumber = 1; this.searchForm.pageSize = 20; this.getDataList(); },
|
||||
onStatusTabChange(v) { this.activeStatus = v; this.searchForm.pageNumber = 1; this.getDataList(); },
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
this.searchForm.status = "PASS";
|
||||
this.searchForm.distributionStatus = this.activeStatus === 'ALL' ? '' : this.activeStatus;
|
||||
getDistributionListData(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
}).catch(() => { this.loading = false; });
|
||||
},
|
||||
// 清退分销商
|
||||
retreat(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "提示",
|
||||
// 记得确认修改此处
|
||||
DialogPlugin.confirm({
|
||||
header: "确认清退",
|
||||
content: "您确认要清退 " + v.memberName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
retreatDistribution(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
theme: "warning",
|
||||
onConfirm: () => {
|
||||
retreatDistribution(v.id).then((res) => { if (res.success) { MessagePlugin.success("操作成功"); this.getDataList(); } });
|
||||
},
|
||||
});
|
||||
},
|
||||
// 恢复分销商
|
||||
resume(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "提示",
|
||||
// 记得确认修改此处
|
||||
DialogPlugin.confirm({
|
||||
header: "确认恢复",
|
||||
content: "您确认要恢复 " + v.memberName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
resumeDistribution(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
theme: "warning",
|
||||
onConfirm: () => {
|
||||
resumeDistribution(v.id).then((res) => { if (res.success) { MessagePlugin.success("操作成功"); this.getDataList(); } });
|
||||
},
|
||||
});
|
||||
},
|
||||
// 编辑
|
||||
edit(v) {
|
||||
this.$refs.distributionForm.resetFields();
|
||||
// 转换null为""
|
||||
for (let attr in v) {
|
||||
if (v[attr] === null) {
|
||||
v[attr] = "";
|
||||
}
|
||||
}
|
||||
let str = JSON.stringify(v);
|
||||
let data = JSON.parse(str);
|
||||
const data = JSON.parse(JSON.stringify(v));
|
||||
for (let attr in data) { if (data[attr] === null) { data[attr] = ""; } }
|
||||
this.distributionForm = data;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
// 提交表单
|
||||
handleSubmit() {
|
||||
this.$refs.distributionForm.validate((valid) => {
|
||||
if (valid) {
|
||||
// 编辑
|
||||
editDistribution(this.distributionForm).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
editDistribution(this.distributionForm).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) { MessagePlugin.success("操作成功"); this.getDataList(); this.modalVisible = false; }
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
mounted() { this.init(); },
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.status-tabs { margin: 8px 0; }
|
||||
::v-deep .status-tabs .t-tabs__content { display: none; }
|
||||
</style>
|
||||
|
||||
@@ -1,59 +1,35 @@
|
||||
<template>
|
||||
<div>
|
||||
<Card>
|
||||
<Row @keydown.enter.native.prevent="handleSearch">
|
||||
<Form
|
||||
ref="searchForm"
|
||||
:model="searchForm"
|
||||
inline
|
||||
:label-width="70"
|
||||
class="search-form"
|
||||
>
|
||||
<Form-item label="会员名称" prop="memberName">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.memberName"
|
||||
placeholder="请输入会员名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
<Button
|
||||
@click="handleSearch"
|
||||
type="primary"
|
||||
class="search-btn"
|
||||
>搜索</Button
|
||||
>
|
||||
</Form>
|
||||
</Row>
|
||||
<Table
|
||||
class="mt_10"
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page
|
||||
<t-card style="margin-bottom: 12px">
|
||||
<t-form :data="searchForm" layout="inline" :labelWidth="70" class="search-form" @submit="handleSearch">
|
||||
<t-form-item label="会员名称" name="memberName">
|
||||
<t-input v-model="searchForm.memberName" placeholder="请输入会员名称" clearable style="width: 240px" />
|
||||
</t-form-item>
|
||||
<t-form-item>
|
||||
<t-button theme="primary" class="search-btn" @click="handleSearch">搜索</t-button>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</t-card>
|
||||
<t-card>
|
||||
<t-table class="mt_10" :loading="loading" :columns="columns" :data="data" ref="table" rowKey="id"></t-table>
|
||||
<div class="mt_10" style="display: flex; justify-content: flex-end">
|
||||
<t-pagination
|
||||
:current="searchForm.pageNumber"
|
||||
:total="total"
|
||||
:page-size="searchForm.pageSize"
|
||||
@on-change="changePage"
|
||||
@on-page-size-change="changePageSize"
|
||||
:page-size-opts="[10, 20, 50]"
|
||||
:total="Number(total)"
|
||||
:pageSize="searchForm.pageSize"
|
||||
:pageSizeOptions="[20, 50, 100]"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
show-sizer
|
||||
></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
:showJumper="true"
|
||||
@change="onPaginationChange"
|
||||
/>
|
||||
</div>
|
||||
</t-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { auditDistribution, getDistributionListData } from "@/api/distribution";
|
||||
import { MessagePlugin, DialogPlugin } from "tdesign-vue";
|
||||
|
||||
export default {
|
||||
name: "distributionApply",
|
||||
@@ -63,67 +39,31 @@ export default {
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
pageSize: 20, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
startDate: "", // 起始时间
|
||||
endDate: "", // 终止时间
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: "会员名称",
|
||||
key: "memberName",
|
||||
minWidth: 100,
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "姓名",
|
||||
key: "name",
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
title: "身份证号",
|
||||
key: "idNumber",
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: "结算银行开户行名称",
|
||||
key: "settlementBankAccountName",
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: "结算银行开户账号",
|
||||
key: "settlementBankAccountNum",
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: "结算银行开户支行名称",
|
||||
key: "settlementBankBranchName",
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: "提交时间",
|
||||
key: "createTime",
|
||||
minWidth: 100,
|
||||
},
|
||||
{ title: "会员名称", colKey: "memberName", minWidth: 100, align: "left", tooltip: true },
|
||||
{ title: "姓名", colKey: "name", minWidth: 100, align: "left" },
|
||||
{ title: "身份证号", colKey: "idNumber", minWidth: 120, align: "left" },
|
||||
{ title: "结算银行开户行名称", colKey: "settlementBankAccountName", minWidth: 120, align: "left" },
|
||||
{ title: "结算银行开户账号", colKey: "settlementBankAccountNum", minWidth: 120, align: "left" },
|
||||
{ title: "结算银行开户支行名称", colKey: "settlementBankBranchName", minWidth: 120, align: "left" },
|
||||
{ title: "提交时间", colKey: "createTime", minWidth: 120, align: "left" },
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
colKey: "action",
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
width: 200,
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
cell: (h, params) => {
|
||||
return h("div", { class: "ops" }, [
|
||||
h(
|
||||
"Button",
|
||||
"a",
|
||||
{
|
||||
props: {
|
||||
type: "success",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.audit(params.row, "PASS");
|
||||
@@ -132,13 +72,10 @@ export default {
|
||||
},
|
||||
"通过"
|
||||
),
|
||||
h("span", {}, "|"),
|
||||
h(
|
||||
"Button",
|
||||
"a",
|
||||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.audit(params.row, "REFUSE");
|
||||
@@ -160,56 +97,59 @@ export default {
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
// 分页 改变页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
// 分页 改变页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
onPaginationChange(info) {
|
||||
if (info && typeof info.pageSize !== "undefined" && info.pageSize !== this.searchForm.pageSize) {
|
||||
this.changePageSize(info.pageSize);
|
||||
}
|
||||
if (info && typeof info.current !== "undefined") {
|
||||
this.changePage(info.current);
|
||||
}
|
||||
},
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.searchForm.pageSize = 20;
|
||||
this.getDataList();
|
||||
},
|
||||
// 获取列表数据
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
this.searchForm.distributionStatus = "APPLY";
|
||||
getDistributionListData(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
getDistributionListData(this.searchForm)
|
||||
.then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
//审核
|
||||
audit(v, status) {
|
||||
let test = "拒绝";
|
||||
if (status == "PASS") {
|
||||
if (status === "PASS") {
|
||||
test = "通过";
|
||||
}
|
||||
let params = {
|
||||
status: status,
|
||||
};
|
||||
this.$Modal.confirm({
|
||||
title: "确认" + test,
|
||||
// 记得确认修改此处
|
||||
const params = { status };
|
||||
DialogPlugin.confirm({
|
||||
header: "确认" + test,
|
||||
content: "您确认要" + test + " " + v.memberName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
theme: "warning",
|
||||
onConfirm: () => {
|
||||
auditDistribution(v.id, params).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
MessagePlugin.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
@@ -222,3 +162,15 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.ops a {
|
||||
color: #2d8cf0;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
.ops span {
|
||||
display: inline-block;
|
||||
margin: 0 8px;
|
||||
color: #dcdee2;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,64 +1,81 @@
|
||||
<template>
|
||||
<div>
|
||||
<Card>
|
||||
<Form ref="searchForm" @keydown.enter.native.prevent="handleSearch" :model="searchForm" class="search-form">
|
||||
<Form-item label="会员名称" class="flex" prop="memberName">
|
||||
<Input
|
||||
type="text" placeholder="请输入会员名称" v-model="searchForm.memberName" clearable
|
||||
style="width: 200px"></Input>
|
||||
</Form-item>
|
||||
<Form-item label="编号" class="flex">
|
||||
<Input
|
||||
type="text" placeholder="请输入编号" v-model="searchForm.sn" clearable
|
||||
style="width: 200px"></Input>
|
||||
</Form-item>
|
||||
<Form-item label="状态"
|
||||
style="width: 200px">
|
||||
<Select v-model="searchForm.distributionCashStatus" clearable style="width: 150px">
|
||||
<Option v-for="item in cashStatusList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
||||
</Select>
|
||||
</Form-item>
|
||||
<Form-item>
|
||||
<Button @click="handleSearch" type="primary">搜索</Button>
|
||||
</Form-item>
|
||||
</Form>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10"></Table>
|
||||
<Row type="flex" justify="end" class="page padding-row">
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10,20,50]" size="small" show-total show-elevator show-sizer></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable='false' :width="500">
|
||||
<Form ref="form" :model="form" :label-width="100" >
|
||||
<FormItem label="编号">
|
||||
<Input disabled v-model="form.sn" clearable style="width:100%"/>
|
||||
</FormItem>
|
||||
<FormItem label="会员名称">
|
||||
<Input disabled v-model="form.distributionName" clearable style="width:100%"/>
|
||||
</FormItem>
|
||||
<FormItem label="金额">
|
||||
<Input disabled v-model="form.price" clearable style="width:100%"/>
|
||||
</FormItem>
|
||||
<FormItem label="是否通过" prop="result" v-if="handleStatus =='edit'">
|
||||
<RadioGroup v-model="result" type="button" button-style="solid">
|
||||
<Radio label="VIA_AUDITING">通过</Radio>
|
||||
<Radio label="FAIL_AUDITING">拒绝</Radio>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer" v-if="handleStatus == 'edit'">
|
||||
<Button type="text" @click="modalVisible=false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit">提交</Button>
|
||||
<t-card style="margin-bottom: 12px">
|
||||
<t-form :data="searchForm" layout="inline" class="search-form" @submit="handleSearch">
|
||||
<t-form-item label="会员名称" name="memberName">
|
||||
<t-input v-model="searchForm.memberName" placeholder="请输入会员名称" clearable style="width: 240px" />
|
||||
</t-form-item>
|
||||
<t-form-item label="编号" name="sn">
|
||||
<t-input v-model="searchForm.sn" placeholder="请输入编号" clearable style="width: 240px" />
|
||||
</t-form-item>
|
||||
<t-form-item label="状态">
|
||||
<t-select v-model="searchForm.distributionCashStatus" clearable style="width: 240px">
|
||||
<t-option v-for="item in cashStatusList" :value="item.value" :key="item.value" :label="item.label" />
|
||||
</t-select>
|
||||
</t-form-item>
|
||||
<t-form-item>
|
||||
<t-button theme="primary" @click="handleSearch">搜索</t-button>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</t-card>
|
||||
<t-card>
|
||||
<t-table :loading="loading" :columns="columns" :data="data" ref="table" class="mt_10" rowKey="id"></t-table>
|
||||
<div class="page padding-row" style="display: flex; justify-content: flex-end">
|
||||
<t-pagination :current="searchForm.pageNumber" :total="Number(total)" :pageSize="searchForm.pageSize" :pageSizeOptions="[20, 50, 100]" size="small" :showJumper="true" @change="onPaginationChange" />
|
||||
</div>
|
||||
</Modal>
|
||||
</t-card>
|
||||
<t-drawer :visible.sync="modalVisible" :header="modalTitle" placement="right" size="500px" @close="modalVisible = false">
|
||||
<div v-if="handleStatus === 'view'">
|
||||
<t-descriptions :column="1" size="medium">
|
||||
<t-descriptions-item label="编号">{{ form.sn }}</t-descriptions-item>
|
||||
<t-descriptions-item label="会员名称">{{ form.distributionName }}</t-descriptions-item>
|
||||
<t-descriptions-item label="申请金额">{{ form.price }}</t-descriptions-item>
|
||||
<t-descriptions-item label="申请时间">{{ form.createTime }}</t-descriptions-item>
|
||||
<t-descriptions-item label="姓名">{{ form.name }}</t-descriptions-item>
|
||||
<t-descriptions-item label="身份证号">{{ form.idNumber }}</t-descriptions-item>
|
||||
<t-descriptions-item label="结算银行开户行名称">{{ form.settlementBankAccountName }}</t-descriptions-item>
|
||||
<t-descriptions-item label="结算银行开户账号">{{ form.settlementBankAccountNum }}</t-descriptions-item>
|
||||
<t-descriptions-item label="结算银行开户支行名称">{{ form.settlementBankBranchName }}</t-descriptions-item>
|
||||
<t-descriptions-item label="处理时间">{{ form.updateTime }}</t-descriptions-item>
|
||||
<t-descriptions-item label="状态">{{ { APPLY: '待处理', VIA_AUDITING: '通过', FAIL_AUDITING: '审核拒绝' }[form.distributionCashStatus] || form.distributionCashStatus }}</t-descriptions-item>
|
||||
</t-descriptions>
|
||||
</div>
|
||||
<div v-else>
|
||||
<t-form ref="form" :data="form" :labelWidth="100">
|
||||
<t-form-item label="编号">
|
||||
<t-input v-model="form.sn" disabled style="width: 100%" />
|
||||
</t-form-item>
|
||||
<t-form-item label="会员名称">
|
||||
<t-input v-model="form.distributionName" disabled style="width: 100%" />
|
||||
</t-form-item>
|
||||
<t-form-item label="金额">
|
||||
<t-input v-model="form.price" disabled style="width: 100%" />
|
||||
</t-form-item>
|
||||
<t-form-item label="是否通过">
|
||||
<t-radio-group v-model="result">
|
||||
<t-radio value="VIA_AUDITING">通过</t-radio>
|
||||
<t-radio value="FAIL_AUDITING">拒绝</t-radio>
|
||||
</t-radio-group>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div v-if="handleStatus === 'edit'" style="display: flex; justify-content: flex-end">
|
||||
<t-button variant="text" @click="modalVisible = false">取消</t-button>
|
||||
<t-button theme="primary" :loading="submitLoading" style="margin-left: 8px" @click="handleSubmit">提交</t-button>
|
||||
</div>
|
||||
<div v-else style="display: flex; justify-content: flex-start">
|
||||
<t-button theme="primary" @click="modalVisible = false">返回</t-button>
|
||||
</div>
|
||||
</template>
|
||||
</t-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
auditDistributionCash,
|
||||
getDistributionCash
|
||||
} from "@/api/distribution";
|
||||
import { cashStatusList } from './dataJson';
|
||||
import { auditDistributionCash, getDistributionCash } from "@/api/distribution";
|
||||
import { cashStatusList } from "./dataJson";
|
||||
import { MessagePlugin, DialogPlugin } from "tdesign-vue";
|
||||
export default {
|
||||
name: "distributionCash",
|
||||
data() {
|
||||
@@ -70,7 +87,7 @@ export default {
|
||||
result: 'FAIL_AUDITING', // 是否通过
|
||||
searchForm: { // 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
pageSize: 20, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
},
|
||||
@@ -82,129 +99,65 @@ export default {
|
||||
},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
columns: [
|
||||
{ title: "编号", colKey: "sn", width: 300, align: "left" },
|
||||
{ title: "会员名称", colKey: "distributionName", minWidth: 120, align: "left" },
|
||||
{ title: "申请金额", colKey: "price", minWidth: 100, align: "left", cell: (h, p) => h("priceColorScheme", { props: { value: p.row.price, color: this.$mainColor } }) },
|
||||
{ title: "申请时间", colKey: "createTime", minWidth: 150, align: "left" },
|
||||
{ title: "姓名", colKey: "name", minWidth: 100, align: "left" },
|
||||
{ title: "身份证号", colKey: "idNumber", minWidth: 120, align: "left" },
|
||||
{ title: "结算银行开户行名称", colKey: "settlementBankAccountName", minWidth: 120, align: "left" },
|
||||
{ title: "结算银行开户账号", colKey: "settlementBankAccountNum", minWidth: 120, align: "left" },
|
||||
{ title: "结算银行开户支行名称", colKey: "settlementBankBranchName", minWidth: 120, align: "left" },
|
||||
{ title: "处理时间", colKey: "updateTime", minWidth: 150, align: "left" },
|
||||
{
|
||||
title: "编号",
|
||||
key: "sn",
|
||||
minWidth: 200
|
||||
},
|
||||
{
|
||||
title: "会员名称",
|
||||
key: "distributionName",
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
title: "申请金额",
|
||||
key: "price",
|
||||
minWidth: 90,
|
||||
render: (h, params) => {
|
||||
return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
|
||||
title: "状态",
|
||||
colKey: "distributionCashStatus",
|
||||
minWidth: 120,
|
||||
align: "left",
|
||||
cell: (h, p) => {
|
||||
const s = p.row.distributionCashStatus;
|
||||
const map = { APPLY: { theme: "warning", label: "待处理" }, VIA_AUDITING: { theme: "success", label: "通过" }, FAIL_AUDITING: { theme: "danger", label: "审核拒绝" } };
|
||||
const cfg = map[s] || { theme: "default", label: s };
|
||||
return h("t-tag", { props: { theme: cfg.theme, variant: "light", size: "small" } }, [cfg.label]);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "申请时间",
|
||||
key: "createTime",
|
||||
minWidth: 130
|
||||
},
|
||||
{
|
||||
title: "姓名",
|
||||
key: "name",
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
title: "身份证号",
|
||||
key: "idNumber",
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: "结算银行开户行名称",
|
||||
key: "settlementBankAccountName",
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: "结算银行开户账号",
|
||||
key: "settlementBankAccountNum",
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: "结算银行开户支行名称",
|
||||
key: "settlementBankBranchName",
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: "处理时间",
|
||||
key: "updateTime",
|
||||
minWidth: 130
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
key: "distributionCashStatus",
|
||||
minWidth: 100,
|
||||
render: (h, params) => {
|
||||
if (params.row.distributionCashStatus == 'APPLY') {
|
||||
return h("div", "待处理");
|
||||
}
|
||||
if (params.row.distributionCashStatus == 'VIA_AUDITING') {
|
||||
return h("div", "通过");
|
||||
}
|
||||
if (params.row.distributionCashStatus == 'FAIL_AUDITING') {
|
||||
return h("div", "审核拒绝");
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
colKey: "action",
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
width: 130,
|
||||
render: (h, params) => {
|
||||
if(params.row.distributionCashStatus != 'APPLY'){
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "primary",
|
||||
size: "small",
|
||||
cell: (h, params) => {
|
||||
if (params.row.distributionCashStatus !== "APPLY") {
|
||||
return h("div", { class: "ops" }, [
|
||||
h(
|
||||
"a",
|
||||
{
|
||||
on: {
|
||||
click: () => {
|
||||
this.view(params.row);
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.view(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"查看"
|
||||
),
|
||||
|
||||
]);
|
||||
}else {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "primary",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.edit(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"审核"
|
||||
),
|
||||
|
||||
]);
|
||||
},
|
||||
"查看"
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return h("div", { class: "ops" }, [
|
||||
h(
|
||||
"a",
|
||||
{
|
||||
on: {
|
||||
click: () => {
|
||||
this.edit(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"审核"
|
||||
),
|
||||
]);
|
||||
},
|
||||
},
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0 // 表单数据总数
|
||||
@@ -225,59 +178,68 @@ export default {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
onPaginationChange(info) {
|
||||
if (info && typeof info.pageSize !== 'undefined' && info.pageSize !== this.searchForm.pageSize) {
|
||||
this.changePageSize(info.pageSize);
|
||||
}
|
||||
if (info && typeof info.current !== 'undefined') {
|
||||
this.changePage(info.current);
|
||||
}
|
||||
},
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.searchForm.pageSize = 20;
|
||||
this.getDataList();
|
||||
},
|
||||
// 获取列表数据
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
getDistributionCash(this.searchForm).then(res => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
getDistributionCash(this.searchForm)
|
||||
.then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 通过还是拒绝申请
|
||||
handleSubmit() {
|
||||
let result = "拒绝"
|
||||
if(this.result == 'VIA_AUDITING'){
|
||||
result = "通过"
|
||||
let result = "拒绝";
|
||||
if (this.result === "VIA_AUDITING") {
|
||||
result = "通过";
|
||||
}
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认审核",
|
||||
content: "您确认要审核"+result+"么?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
auditDistributionCash(this.form.id,{result:this.result}).then(res => {
|
||||
if (res.success) {
|
||||
this.$Modal.remove();
|
||||
this.$Message.success("审核成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
} else {
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
DialogPlugin.confirm({
|
||||
header: "确认审核",
|
||||
content: "您确认要审核" + result + "么?",
|
||||
theme: "warning",
|
||||
onConfirm: () => {
|
||||
this.submitLoading = true;
|
||||
auditDistributionCash(this.form.id, { result: this.result })
|
||||
.then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
MessagePlugin.success("审核成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
} else {
|
||||
this.modalVisible = false;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.submitLoading = false;
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
// 弹出modal 审核
|
||||
edit(v) {
|
||||
this.modalTitle = "审核";
|
||||
this.handleStatus = 'edit';
|
||||
this.$refs.form.resetFields();
|
||||
if (this.$refs.form && typeof this.$refs.form.reset === 'function') { this.$refs.form.reset(); }
|
||||
// 转换null为""
|
||||
for (let attr in v) {
|
||||
if (v[attr] === null) {
|
||||
@@ -291,7 +253,7 @@ export default {
|
||||
view(v){
|
||||
this.modalTitle = "查看";
|
||||
this.handleStatus = 'view';
|
||||
this.$refs.form.resetFields();
|
||||
if (this.$refs.form && typeof this.$refs.form.reset === 'function') { this.$refs.form.reset(); }
|
||||
// 转换null为""
|
||||
for (let attr in v) {
|
||||
if (v[attr] === null) {
|
||||
@@ -310,3 +272,15 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.ops a {
|
||||
color: #2d8cf0;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
.ops span {
|
||||
display: inline-block;
|
||||
margin: 0 8px;
|
||||
color: #dcdee2;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,70 +1,45 @@
|
||||
<template>
|
||||
<div>
|
||||
<Card>
|
||||
<Form @keydown.enter.native.prevent="handleSearch" ref="searchForm" :model="searchForm" inline :label-width="70"
|
||||
class="search-form">
|
||||
<Form-item label="商品名称" prop="goodsName">
|
||||
<Input type="text" v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 200px" />
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
</Form>
|
||||
<Row class="operation" style="margin:10px 0;">
|
||||
<Button @click="add" type="primary">添加</Button>
|
||||
|
||||
<Button @click="delAll" type="primary">批量下架</Button>
|
||||
</Row>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"
|
||||
@on-selection-change="changeSelect">
|
||||
<template slot="goodsName" slot-scope="{row}">
|
||||
<t-card style="margin-bottom: 12px">
|
||||
<t-form :data="searchForm" layout="inline" :labelWidth="70" class="search-form" @submit="handleSearch">
|
||||
<t-form-item label="商品名称" name="goodsName">
|
||||
<t-input v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 240px" />
|
||||
</t-form-item>
|
||||
<t-form-item>
|
||||
<t-button theme="primary" class="search-btn" @click="handleSearch">搜索</t-button>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</t-card>
|
||||
<t-card>
|
||||
<div class="operation padding-row">
|
||||
<t-button theme="primary" @click="delAll">批量下架</t-button>
|
||||
</div>
|
||||
<t-table :loading="loading" :columns="columns" :data="data" ref="table" rowKey="id" :rowSelection="{ type: 'multiple', selectedRowKeys }" @select-change="onSelectChange">
|
||||
<template #goodsName="{ row }">
|
||||
<div>
|
||||
<div class="div-zoom">
|
||||
<a @click="linkTo(row.goodsId,row.skuId)">{{row.goodsName}}</a>
|
||||
<a @click="linkTo(row.goodsId,row.skuId)">{{ row.goodsName }}</a>
|
||||
</div>
|
||||
<Poptip trigger="hover" title="扫码在手机中查看" transfer>
|
||||
<div slot="content">
|
||||
<vue-qr :text="wapLinkTo(row.goodsId,row.skuId)" :margin="0" colorDark="#000" colorLight="#fff"
|
||||
:size="150"></vue-qr>
|
||||
</div>
|
||||
<img src="../../assets/qrcode.svg" class="hover-pointer" width="20" height="20" alt="">
|
||||
</Poptip>
|
||||
<t-popup trigger="hover" placement="top" :showArrow="true">
|
||||
<template #content>
|
||||
<vue-qr :text="wapLinkTo(row.goodsId,row.skuId)" :margin="0" colorDark="#000" colorLight="#fff" :size="150" />
|
||||
</template>
|
||||
<img src="../../assets/qrcode.svg" class="hover-pointer" width="20" height="20" alt="" />
|
||||
</t-popup>
|
||||
</div>
|
||||
</template>
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
||||
@on-page-size-change="changePageSize" :page-size-opts="[10,20,50]" size="small" show-total show-elevator
|
||||
show-sizer></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
<liliDialog
|
||||
ref="liliDialog"
|
||||
@selectedGoodsData="selectedGoodsData"
|
||||
></liliDialog>
|
||||
<Modal
|
||||
:title="modalTitle"
|
||||
v-model="modalVisible"
|
||||
:mask-closable="false"
|
||||
:width="500"
|
||||
>
|
||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||
<FormItem label="分销佣金" prop="commission">
|
||||
<Input v-model="form.commission" clearable style="width: 100%"/>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
|
||||
>提交
|
||||
</Button
|
||||
>
|
||||
</t-table>
|
||||
<div class="mt_10" style="display: flex; justify-content: flex-end">
|
||||
<t-pagination :current="searchForm.pageNumber" :total="Number(total)" :pageSize="searchForm.pageSize" :pageSizeOptions="[20, 50, 100]" size="small" :showJumper="true" @change="onPaginationChange" />
|
||||
</div>
|
||||
</Modal>
|
||||
</t-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { delDistributionGoods, getDistributionGoods,distributionGoodsCheck } from "@/api/distribution";
|
||||
import { delDistributionGoods, getDistributionGoods } from "@/api/distribution";
|
||||
import vueQr from "vue-qr";
|
||||
import { MessagePlugin, DialogPlugin } from "tdesign-vue";
|
||||
export default {
|
||||
components: {
|
||||
"vue-qr": vueQr,
|
||||
@@ -72,107 +47,75 @@ export default {
|
||||
name: "distributionGoods",
|
||||
data() {
|
||||
return {
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
form:{
|
||||
commission : 1 // 分销金额
|
||||
},
|
||||
loading: true, // 表单加载状态
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
pageSize: 20, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
},
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
selectList: [],
|
||||
selectCount: 0,
|
||||
selectedRowKeys: [],
|
||||
columns: [
|
||||
// 表头
|
||||
{
|
||||
type: "selection",
|
||||
width: 60,
|
||||
align: "center",
|
||||
fixed: "left",
|
||||
},
|
||||
{
|
||||
title: "商品图片",
|
||||
fixed: "left",
|
||||
key: "thumbnail",
|
||||
colKey: "thumbnail",
|
||||
width: 120,
|
||||
align: "center",
|
||||
render: (h, params) => {
|
||||
return h("img", {
|
||||
attrs: {
|
||||
src: params.row.thumbnail || '',
|
||||
alt: "加载图片失败",
|
||||
},
|
||||
style: {
|
||||
cursor: "pointer",
|
||||
width: "80px",
|
||||
height: "60px",
|
||||
margin: "10px 0",
|
||||
"object-fit": "contain",
|
||||
},
|
||||
});
|
||||
},
|
||||
cell: (h, p) => h("img", { attrs: { src: p.row.thumbnail || "", alt: "加载图片失败" }, style: { cursor: "pointer", width: "80px", height: "60px", margin: "10px 0", objectFit: "contain" } }),
|
||||
},
|
||||
{
|
||||
title: "商品名称",
|
||||
slot: "goodsName",
|
||||
colKey: "goodsName",
|
||||
minWidth: 200,
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "商品价格",
|
||||
key: "price",
|
||||
colKey: "price",
|
||||
minWidth: 100,
|
||||
render: (h, params) => {
|
||||
return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
|
||||
},
|
||||
|
||||
cell: (h, p) => h("priceColorScheme", { props: { value: p.row.price, color: this.$mainColor } }),
|
||||
},
|
||||
|
||||
{
|
||||
title: "库存",
|
||||
key: "quantity",
|
||||
colKey: "quantity",
|
||||
minWidth: 80,
|
||||
},
|
||||
{
|
||||
title: "添加时间",
|
||||
key: "createTime",
|
||||
colKey: "createTime",
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
title: "店铺名称",
|
||||
key: "storeName",
|
||||
colKey: "storeName",
|
||||
minWidth: 100,
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "佣金金额",
|
||||
key: "commission",
|
||||
colKey: "commission",
|
||||
minWidth: 100,
|
||||
sortable: false,
|
||||
render: (h, params) => {
|
||||
return h("priceColorScheme", {props:{value:params.row.commission,color:this.$mainColor}} );
|
||||
},
|
||||
cell: (h, p) => h("priceColorScheme", { props: { value: p.row.commission, color: this.$mainColor } }),
|
||||
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
colKey: "action",
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
minWidth: 100,
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
cell: (h, params) => {
|
||||
return h("div", { class: "ops" }, [
|
||||
h(
|
||||
"Button",
|
||||
"a",
|
||||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.remove(params.row);
|
||||
@@ -185,53 +128,15 @@ export default {
|
||||
},
|
||||
},
|
||||
],
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
skuId:0,
|
||||
formValidate: {
|
||||
commission: [
|
||||
{ required: true, message: '请输入大于1小于9999的合法分销金额'},
|
||||
{
|
||||
pattern: /^[1-9]\d{0,3}(\.\d{1,2})?$/,
|
||||
message: "请输入大于1小于9999的合法分销金额",
|
||||
trigger: "change"
|
||||
}],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 选择商品回调
|
||||
selectedGoodsData(v){
|
||||
this.modalVisible = true
|
||||
this.form.commission = 1
|
||||
this.modalTitle = "保存分销商品"
|
||||
this.skuId = v[0].id
|
||||
},
|
||||
// 添加商品
|
||||
handleSubmit(){
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
distributionGoodsCheck(this.skuId,this.form).then(res => {
|
||||
if(res.message === 'success') {
|
||||
this.$Message.success("添加成功");
|
||||
}
|
||||
this.modalVisible = false
|
||||
this.getDataList()
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
add(){
|
||||
this.$refs.liliDialog.flag = true;
|
||||
this.$refs.liliDialog.goodsFlag = true;
|
||||
this.$refs.liliDialog.singleGoods();
|
||||
},
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
// 分页 改变页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
@@ -242,46 +147,55 @@ export default {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
onPaginationChange(info) {
|
||||
if (info && typeof info.pageSize !== "undefined" && info.pageSize !== this.searchForm.pageSize) {
|
||||
this.changePageSize(info.pageSize);
|
||||
}
|
||||
if (info && typeof info.current !== "undefined") {
|
||||
this.changePage(info.current);
|
||||
}
|
||||
},
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.searchForm.pageSize = 20;
|
||||
this.getDataList();
|
||||
},
|
||||
// 清除选中状态
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
this.selectedRowKeys = [];
|
||||
this.selectList = [];
|
||||
this.selectCount = 0;
|
||||
},
|
||||
// 选中后赋值
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
onSelectChange(keys, { selectedRowData }) {
|
||||
this.selectedRowKeys = keys;
|
||||
this.selectList = selectedRowData || [];
|
||||
this.selectCount = keys.length;
|
||||
},
|
||||
// 获取列表数据
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
getDistributionGoods(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
getDistributionGoods(this.searchForm)
|
||||
.then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 下架商品
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认下架",
|
||||
DialogPlugin.confirm({
|
||||
header: "确认下架",
|
||||
content: "您确认要下架么?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 下架
|
||||
theme: "warning",
|
||||
onConfirm: () => {
|
||||
delDistributionGoods(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("下架成功");
|
||||
MessagePlugin.success("下架成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
@@ -291,23 +205,18 @@ export default {
|
||||
// 批量下架
|
||||
delAll() {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要下架的数据");
|
||||
MessagePlugin.warning("您还未选择要下架的数据");
|
||||
return;
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认下架",
|
||||
DialogPlugin.confirm({
|
||||
header: "确认下架",
|
||||
content: "您确认要下架所选的 " + this.selectCount + " 条数据?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
let ids = [];
|
||||
this.selectList.forEach((item) => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
// 批量下架
|
||||
theme: "warning",
|
||||
onConfirm: () => {
|
||||
const ids = (this.selectList || []).map((item) => item.id);
|
||||
delDistributionGoods(ids.toString()).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("下架成功");
|
||||
MessagePlugin.success("下架成功");
|
||||
this.clearSelectAll();
|
||||
this.getDataList();
|
||||
}
|
||||
@@ -321,5 +230,17 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.ops a {
|
||||
color: #2d8cf0;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
.ops span {
|
||||
display: inline-block;
|
||||
margin: 0 8px;
|
||||
color: #dcdee2;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
@@ -1,68 +1,62 @@
|
||||
<template>
|
||||
<div>
|
||||
<Card>
|
||||
<Form ref="searchForm" @keydown.enter.native="handleSearch" :model="searchForm" inline :label-width="70" class="search-form">
|
||||
<Form-item label="订单编号" prop="orderSn">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.orderSn"
|
||||
placeholder="请输入订单编号"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
<Form-item label="分销商" prop="distributionName">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.distributionName"
|
||||
placeholder="请输入分销商名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
<Form-item label="订单时间">
|
||||
<DatePicker type="daterange" v-model="timeRange" format="yyyy-MM-dd" placeholder="选择时间"
|
||||
style="width: 210px"></DatePicker>
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
</Form>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10">
|
||||
<template slot-scope="{row}" slot="goodsMsg">
|
||||
<t-card style="margin-bottom: 12px">
|
||||
<t-form :data="searchForm" layout="inline" :labelWidth="70" class="search-form" @submit="handleSearch">
|
||||
<t-form-item label="订单编号" name="orderSn">
|
||||
<t-input v-model="searchForm.orderSn" placeholder="请输入订单编号" clearable style="width: 240px" />
|
||||
</t-form-item>
|
||||
<t-form-item label="分销商" name="distributionName">
|
||||
<t-input v-model="searchForm.distributionName" placeholder="请输入分销商名称" clearable style="width: 240px" />
|
||||
</t-form-item>
|
||||
<t-form-item label="店铺名称">
|
||||
<t-select v-model="searchForm.storeId" placeholder="请选择" :filterable="true" clearable style="width: 240px" @input-change="searchChange">
|
||||
<t-option v-for="item in shopList" :value="item.id" :key="item.id" :label="item.storeName" />
|
||||
</t-select>
|
||||
</t-form-item>
|
||||
<t-form-item label="订单时间">
|
||||
<t-date-picker v-model="timeRange" mode="date" range format="YYYY-MM-DD" valueType="time-stamp" placeholder="选择时间" style="width: 240px" />
|
||||
</t-form-item>
|
||||
<t-form-item>
|
||||
<t-button theme="primary" class="search-btn" @click="handleSearch">搜索</t-button>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</t-card>
|
||||
<t-card>
|
||||
<t-table :loading="loading" :columns="columns" :data="data" ref="table" class="mt_10" rowKey="id">
|
||||
<template #goodsMsg="{ row }">
|
||||
<div class="goods-msg">
|
||||
<img :src="row.image" width="60" height="60" alt="">
|
||||
<img :src="row.image" width="60" height="60" alt="" />
|
||||
<div>
|
||||
<div class="div-zoom">
|
||||
<a @click="linkTo(row.goodsId,row.skuId)">{{row.goodsName}}</a>
|
||||
<a @click="linkTo(row.goodsId,row.skuId)">{{ row.goodsName }}</a>
|
||||
</div>
|
||||
<div style="color:#999;font-size:10px">数量:x{{row.num}}</div>
|
||||
<Poptip trigger="hover" title="扫码在手机中查看" transfer>
|
||||
<div slot="content">
|
||||
<vue-qr :text="wapLinkTo(row.goodsId,row.skuId)" :margin="0" colorDark="#000" colorLight="#fff" :size="150"></vue-qr>
|
||||
</div>
|
||||
<img src="../../assets/qrcode.svg" class="hover-pointer" width="20" height="20" alt="">
|
||||
</Poptip>
|
||||
<div style="color:#999;font-size:10px">数量:x{{ row.num }}</div>
|
||||
<t-popup trigger="hover" placement="top" :showArrow="true">
|
||||
<template #content>
|
||||
<vue-qr :text="wapLinkTo(row.goodsId,row.skuId)" :margin="0" colorDark="#000" colorLight="#fff" :size="150" />
|
||||
</template>
|
||||
<img src="../../assets/qrcode.svg" class="hover-pointer" width="20" height="20" alt="" />
|
||||
</t-popup>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template slot-scope="{row}" slot="distributionOrderStatus">
|
||||
<Tag :color="filterStatusColor(row.distributionOrderStatus)">{{filterStatus(row.distributionOrderStatus)}}</Tag>
|
||||
<template #distributionOrderStatus="{ row }">
|
||||
<t-tag :theme="filterStatusColor(row.distributionOrderStatus) === 'green' ? 'success' : (filterStatusColor(row.distributionOrderStatus) === 'orange' ? 'warning' : 'danger')" size="small" variant="light">{{ filterStatus(row.distributionOrderStatus) }}</t-tag>
|
||||
</template>
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize"
|
||||
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10,20,50]"
|
||||
size="small" show-total show-elevator show-sizer></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
</t-table>
|
||||
<div class="mt_10" style="display: flex; justify-content: flex-end">
|
||||
<t-pagination :current="searchForm.pageNumber" :total="Number(total)" :pageSize="searchForm.pageSize" :pageSizeOptions="[20, 50, 100]" size="small" :showJumper="true" @change="onPaginationChange" />
|
||||
</div>
|
||||
</t-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getDistributionOrder
|
||||
} from "@/api/distribution";
|
||||
import {orderStatusList} from './dataJson'
|
||||
import vueQr from 'vue-qr'
|
||||
import { getDistributionOrder } from "@/api/distribution";
|
||||
import { orderStatusList } from "./dataJson";
|
||||
import { getShopListData } from "@/api/shops";
|
||||
import vueQr from "vue-qr";
|
||||
import { MessagePlugin } from "tdesign-vue";
|
||||
|
||||
export default {
|
||||
name: "distributionOrder",
|
||||
@@ -71,60 +65,25 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
timeRange: [], // 范围时间
|
||||
timeRange: undefined, // 范围时间
|
||||
orderStatusList, // 订单状态列表
|
||||
shopList: [], // 店铺列表
|
||||
distributionId: this.$route.query.id, // 分销id
|
||||
loading: true, // 表单加载状态
|
||||
searchForm: { // 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
pageSize: 20, // 页面大小
|
||||
sort:"create_time",
|
||||
order:"desc"
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: "订单编号",
|
||||
key: "orderSn",
|
||||
minWidth: 180,
|
||||
fixed: "left",
|
||||
tooltip: true
|
||||
},
|
||||
{
|
||||
title: '商品信息',
|
||||
slot: 'goodsMsg',
|
||||
minWidth: 150
|
||||
},
|
||||
|
||||
{
|
||||
title: "分销商",
|
||||
key: "distributionName",
|
||||
tooltip: true,
|
||||
minWidth:80,
|
||||
},
|
||||
|
||||
{
|
||||
title: "状态",
|
||||
slot: "distributionOrderStatus",
|
||||
minWidth:80,
|
||||
},
|
||||
{
|
||||
title: "佣金金额",
|
||||
key: "rebate",
|
||||
minWidth:80,
|
||||
sortable: false,
|
||||
render: (h, params) => {
|
||||
return h("priceColorScheme", {props:{value:params.row.rebate,color:this.$mainColor}} );
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
fixed: "right",
|
||||
title: "创建时间",
|
||||
key: "createTime",
|
||||
minWidth:100,
|
||||
sortable: false,
|
||||
}
|
||||
{ title: "订单编号", colKey: "orderSn", minWidth: 180, fixed: "left", tooltip: true },
|
||||
{ title: "商品信息", colKey: "goodsMsg", minWidth: 180 },
|
||||
{ title: "分销商", colKey: "distributionName", tooltip: true, minWidth: 120 },
|
||||
{ title: "店铺名称", colKey: "storeName", minWidth: 120, tooltip: true },
|
||||
{ title: "状态", colKey: "distributionOrderStatus", minWidth: 120 },
|
||||
{ title: "佣金金额", colKey: "rebate", minWidth: 120, cell: (h, p) => h("priceColorScheme", { props: { value: p.row.rebate, color: this.$mainColor } }) },
|
||||
{ fixed: "right", title: "创建时间", colKey: "createTime", minWidth: 150 },
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0 // 表单数据总数
|
||||
@@ -134,49 +93,78 @@
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
this.getShopList()
|
||||
},
|
||||
//分页 改变页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
},
|
||||
// 分页 改变页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
onPaginationChange(info) {
|
||||
if (info && typeof info.pageSize !== "undefined" && info.pageSize !== this.searchForm.pageSize) {
|
||||
this.changePageSize(info.pageSize);
|
||||
}
|
||||
if (info && typeof info.current !== "undefined") {
|
||||
this.changePage(info.current);
|
||||
}
|
||||
},
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.searchForm.pageSize = 20;
|
||||
this.getDataList();
|
||||
},
|
||||
// 获取列表数据
|
||||
getDataList() {
|
||||
this.searchForm.distributionId = this.distributionId;
|
||||
this.loading = true;
|
||||
if (this.timeRange && this.timeRange[0]) {
|
||||
let startTime = this.timeRange[0]
|
||||
let endTime = this.timeRange[1]
|
||||
if (Array.isArray(this.timeRange) && this.timeRange.length === 2) {
|
||||
const startTime = this.timeRange[0]
|
||||
const endTime = this.timeRange[1]
|
||||
this.searchForm.startTime = this.$options.filters.unixToDate(startTime / 1000)
|
||||
this.searchForm.endTime = this.$options.filters.unixToDate(endTime / 1000)
|
||||
} else {
|
||||
this.searchForm.startTime = null
|
||||
this.searchForm.endTime = null
|
||||
}
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
getDistributionOrder(this.searchForm).then(res => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
getDistributionOrder(this.searchForm)
|
||||
.then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getShopList(val) { // 获取店铺列表 搜索用
|
||||
const params = {
|
||||
pageNumber: 1,
|
||||
pageSize: 20,
|
||||
storeName: ''
|
||||
}
|
||||
if (val) {
|
||||
params.storeName = val;
|
||||
} else {
|
||||
params.storeName = ''
|
||||
}
|
||||
|
||||
getShopListData(params).then(res => {
|
||||
this.shopList = res.result.records
|
||||
})
|
||||
},
|
||||
searchChange(val) { // 店铺搜索,键盘点击回调
|
||||
this.getShopList(val)
|
||||
},
|
||||
|
||||
filterStatus (status) { // 过滤订单状态
|
||||
const arr = [
|
||||
{status: 'WAIT_BILL', title: '待结算'},
|
||||
{status: 'NO_COMPLETED', title: '未完成'},
|
||||
{status: 'COMPLETE', title: '完成'},
|
||||
{status: 'REFUND', title: '退款'},
|
||||
]
|
||||
@@ -185,21 +173,20 @@
|
||||
return arr[i].title;
|
||||
}
|
||||
}
|
||||
return '未完成'; // 默认返回未完成
|
||||
},
|
||||
filterStatusColor (status) { // 状态tag标签颜色
|
||||
const arr = [
|
||||
{status: 'WAIT_BILL', color: 'blue'},
|
||||
{status: 'WAIT_CASH', color: 'orange'},
|
||||
{status: 'COMPLETE_CASH', color: 'green'},
|
||||
{status: 'CANCEL', color: 'red'},
|
||||
{status: 'NO_COMPLETED', color: 'red'},
|
||||
{status: 'REFUND', color: 'magenta'},
|
||||
{status: 'NO_COMPLETED', color: 'orange'},
|
||||
{status: 'COMPLETE', color: 'green'},
|
||||
{status: 'REFUND', color: 'red'},
|
||||
]
|
||||
for (let i=0;i<arr.length;i++) {
|
||||
if (arr[i].status === status) {
|
||||
return arr[i].color;
|
||||
}
|
||||
}
|
||||
return 'orange'; // 默认返回橙色
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
@@ -1,27 +1,23 @@
|
||||
<template>
|
||||
<div style="background-color: #fff;">
|
||||
|
||||
<Form ref="form" :model="form" :rules="formRule" :label-width="120" style="padding: 10px;">
|
||||
|
||||
<Divider orientation="left">分销设置</Divider>
|
||||
<FormItem label="是否开启分销" prop="isOpen">
|
||||
<i-switch size="large" v-model="form.isOpen" :true-value="true" :false-value="false">
|
||||
<span slot="open">开启</span>
|
||||
<span slot="close">关闭</span>
|
||||
</i-switch>
|
||||
</FormItem>
|
||||
<FormItem label="分销关系绑定天数" prop="distributionDay">
|
||||
<InputNumber :min="1" :max="365" style="width:100px;" v-model="form.distributionDay"></InputNumber>
|
||||
</FormItem>
|
||||
<FormItem>
|
||||
<Button type="primary" @click="submit">保存</Button>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</div>
|
||||
<t-card>
|
||||
<t-form ref="form" :data="form" :rules="formRule" :labelWidth="120" style="padding: 10px;">
|
||||
<t-divider align="left">分销设置</t-divider>
|
||||
<t-form-item label="是否开启分销" name="isOpen">
|
||||
<t-switch v-model="form.isOpen" />
|
||||
</t-form-item>
|
||||
<t-form-item label="分销关系绑定天数" name="distributionDay">
|
||||
<t-input-number :min="1" :max="365" style="width:100px;" v-model="form.distributionDay" />
|
||||
</t-form-item>
|
||||
<t-form-item>
|
||||
<t-button theme="primary" @click="submit">保存</t-button>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</t-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { setSetting, getSetting } from "@/api/index";
|
||||
import { MessagePlugin } from "tdesign-vue";
|
||||
import { regular } from "@/utils";
|
||||
export default {
|
||||
name: "distributionSetting",
|
||||
@@ -59,7 +55,7 @@ export default {
|
||||
submit() {
|
||||
setSetting("DISTRIBUTION_SETTING", this.form).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
MessagePlugin.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,53 +1,32 @@
|
||||
<template>
|
||||
<div class="search">
|
||||
<Card>
|
||||
<Row class="operation">
|
||||
<Button @click="add" type="primary">添加</Button>
|
||||
<Button @click="refresh">刷新</Button>
|
||||
<Button @click="delAll">批量删除</Button>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-selection-change="changeSelect"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page
|
||||
:current="searchForm.pageNumber"
|
||||
:total="total"
|
||||
:page-size="searchForm.pageSize"
|
||||
@on-change="changePage"
|
||||
@on-page-size-change="changePageSize"
|
||||
:page-size-opts="[10, 20, 50]"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
show-sizer
|
||||
></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
<Modal
|
||||
:title="modalTitle"
|
||||
v-model="modalVisible"
|
||||
:mask-closable="false"
|
||||
:width="500"
|
||||
>
|
||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||
<FormItem label="计量单位" prop="name">
|
||||
<Input v-model="form.name" clearable style="width: 100%" />
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
|
||||
>提交</Button
|
||||
>
|
||||
<t-card>
|
||||
<div class="operation" style="margin-bottom: 10px;">
|
||||
<t-button theme="primary" @click="add">添加</t-button>
|
||||
<t-button variant="outline" @click="delAll" style="margin-left: 8px;">批量删除</t-button>
|
||||
</div>
|
||||
</Modal>
|
||||
<t-table :loading="loading" :columns="columns" :data="data" rowKey="id" :rowSelection="{ type: 'multiple', selectedRowKeys }" @select-change="onSelectChange">
|
||||
<template #action="{ row }">
|
||||
<a style="color:#2d8cf0;cursor:pointer;text-decoration:none;margin-right:5px" @click="edit(row)">修改</a>
|
||||
<span style="margin:0 8px;color:#dcdee2">|</span>
|
||||
<a style="color:#2d8cf0;cursor:pointer;text-decoration:none" @click="remove(row)">删除</a>
|
||||
</template>
|
||||
</t-table>
|
||||
<div class="mt_10" style="display: flex; justify-content: flex-end">
|
||||
<t-pagination :current="searchForm.pageNumber" :total="Number(total)" :pageSize="searchForm.pageSize" :pageSizeOptions="[20, 50, 100]" size="small" :showJumper="true" @change="onPaginationChange" />
|
||||
</div>
|
||||
</t-card>
|
||||
<t-drawer :visible.sync="modalVisible" :header="modalTitle" placement="right" size="500px" @close="modalVisible = false">
|
||||
<t-form ref="form" :data="form" :labelWidth="100" :rules="formValidate">
|
||||
<t-form-item label="计量单位" name="name">
|
||||
<t-input v-model="form.name" style="width: 100%" />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<template #footer>
|
||||
<t-button variant="text" @click="modalVisible = false">取消</t-button>
|
||||
<t-button theme="primary" :loading="submitLoading" @click="handleSubmit">提交</t-button>
|
||||
</template>
|
||||
</t-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -59,7 +38,8 @@ import {
|
||||
delGoodsUnit
|
||||
} from "@/api/index";
|
||||
|
||||
import {regular} from "@/utils";
|
||||
import { regular } from "@/utils";
|
||||
import { MessagePlugin, DialogPlugin } from "tdesign-vue";
|
||||
|
||||
export default {
|
||||
name: "goods-unit",
|
||||
@@ -68,14 +48,14 @@ export default {
|
||||
loading: true, // 表单加载状态
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
name: "",
|
||||
},
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 20, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
name: "",
|
||||
},
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
name: "",
|
||||
@@ -88,82 +68,16 @@ export default {
|
||||
]
|
||||
},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
selectedRowKeys: [],
|
||||
selectList: [],
|
||||
selectCount: 0,
|
||||
columns: [
|
||||
// 表头
|
||||
{
|
||||
type: "selection",
|
||||
width: 60,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "计量单位",
|
||||
key: "name",
|
||||
minWidth: 120
|
||||
},
|
||||
|
||||
{
|
||||
title: "创建时间",
|
||||
key: "createTime",
|
||||
width: 180
|
||||
},
|
||||
{
|
||||
title: "更新时间",
|
||||
key: "updateTime",
|
||||
width: 180
|
||||
},
|
||||
{
|
||||
title: "操作人",
|
||||
key: "createBy",
|
||||
minWidth: 150
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
width: 200,
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "info",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.edit(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"修改"
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.remove(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"删除"
|
||||
),
|
||||
]);
|
||||
},
|
||||
},
|
||||
{ colKey: "row-select", type: "multiple", width: 60, align: "center" },
|
||||
{ title: "计量单位", colKey: "name", minWidth: 120 },
|
||||
{ title: "创建时间", colKey: "createTime", width: 180 },
|
||||
{ title: "更新时间", colKey: "updateTime", width: 180 },
|
||||
{ title: "操作人", colKey: "createBy", minWidth: 150 },
|
||||
{ title: "操作", colKey: "action", align: "center", fixed: "right", width: 200 },
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
@@ -185,20 +99,31 @@ export default {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
onPaginationChange(info) {
|
||||
if (info && typeof info.pageSize !== "undefined" && info.pageSize !== this.searchForm.pageSize) {
|
||||
this.changePageSize(info.pageSize);
|
||||
}
|
||||
if (info && typeof info.current !== "undefined") {
|
||||
this.changePage(info.current);
|
||||
}
|
||||
},
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.searchForm.pageSize = 20;
|
||||
this.getDataList();
|
||||
},
|
||||
// 清除选中
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
this.selectedRowKeys = [];
|
||||
this.selectList = [];
|
||||
this.selectCount = 0;
|
||||
},
|
||||
// 选中回调
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
onSelectChange(keys, { selectedRowData }) {
|
||||
this.selectedRowKeys = keys;
|
||||
this.selectList = selectedRowData || [];
|
||||
this.selectCount = keys.length;
|
||||
},
|
||||
// 获取列表数据
|
||||
getDataList() {
|
||||
@@ -254,8 +179,10 @@ export default {
|
||||
// 添加
|
||||
add() {
|
||||
this.modalTitle = "添加";
|
||||
this.form = {};
|
||||
this.$refs.form.resetFields();
|
||||
this.form = { name: "" };
|
||||
if (this.$refs.form && typeof this.$refs.form.reset === "function") {
|
||||
this.$refs.form.reset();
|
||||
}
|
||||
|
||||
this.modalVisible = true;
|
||||
},
|
||||
@@ -268,53 +195,40 @@ export default {
|
||||
},
|
||||
// 删除
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
// 记得确认修改此处
|
||||
DialogPlugin.confirm({
|
||||
header: "确认删除",
|
||||
content: "您确认要删除 " + v.name + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
theme: "warning",
|
||||
onConfirm: () => {
|
||||
delGoodsUnit(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
MessagePlugin.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
// 刷新
|
||||
refresh() {
|
||||
this.loading = true;
|
||||
setTimeout(() => {
|
||||
this.getDataList();
|
||||
this.loading = false;
|
||||
this.$Message.success("刷新成功");
|
||||
}, 500);
|
||||
},
|
||||
|
||||
// 全部删除
|
||||
delAll() {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要删除的数据");
|
||||
MessagePlugin.warning("您还未选择要删除的数据");
|
||||
return;
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
DialogPlugin.confirm({
|
||||
header: "确认删除",
|
||||
content: "您确认要删除所选的 " + this.selectCount + " 条数据?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
theme: "warning",
|
||||
onConfirm: () => {
|
||||
let ids = "";
|
||||
this.selectList.forEach(function (e) {
|
||||
ids += e.id + ",";
|
||||
});
|
||||
ids = ids.substring(0, ids.length - 1);
|
||||
// 批量删除
|
||||
delGoodsUnit(ids).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
MessagePlugin.success("操作成功");
|
||||
this.clearSelectAll();
|
||||
this.getDataList();
|
||||
}
|
||||
|
||||
@@ -1,528 +0,0 @@
|
||||
/*选择商品品类*/
|
||||
.content-goods-publish {
|
||||
padding: 15px;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
border-radius: 0.8em;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
background: none repeat 0 0 #fff;
|
||||
|
||||
/*商品品类*/
|
||||
.goods-category {
|
||||
min-height: 500px;
|
||||
border-radius: 0.8em;
|
||||
text-align: left;
|
||||
padding: 10px;
|
||||
background: #ededed;
|
||||
|
||||
ul {
|
||||
padding: 12px 8px;
|
||||
list-style: none;
|
||||
width: 300px;
|
||||
background: none repeat 0 0 #fff;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
|
||||
border-radius: 0.4em;
|
||||
display: inline-block;
|
||||
letter-spacing: normal;
|
||||
margin-right: 15px;
|
||||
vertical-align: top;
|
||||
word-spacing: normal;
|
||||
|
||||
li {
|
||||
line-height: 20px;
|
||||
padding: 10px 5px;
|
||||
cursor: pointer;
|
||||
color: #333;
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 当前品类被选中的样式 */
|
||||
.activeClass {
|
||||
border-radius: 0.4em;
|
||||
background-color: rgba($color: $theme_color, $alpha: 0.2);
|
||||
border: 1px solid rgba($color: $theme_color, $alpha: 0.8);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/*!*当前选择的商品品类文字*!*/
|
||||
.current-goods-category {
|
||||
text-align: left;
|
||||
padding: 10px;
|
||||
width: 100%;
|
||||
border: 1px solid #fbeed5;
|
||||
color: #c09853;
|
||||
background-color: #fcf8e3;
|
||||
margin: 10px auto;
|
||||
padding: 8px 35px 8px 14px;
|
||||
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
/*编辑基本信息*/
|
||||
.el-form {
|
||||
padding-bottom: 80px;
|
||||
|
||||
.el-form-item {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
.sku-val {
|
||||
justify-content: flex-start;
|
||||
flex-wrap: wrap;
|
||||
|
||||
>.ivu-form {
|
||||
flex-wrap: wrap !important;
|
||||
}
|
||||
|
||||
/deep/ .sku-item-content-val {
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
div.base-info-item {
|
||||
h4 {
|
||||
margin-bottom: 10px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid #ddd;
|
||||
background-color: #f8f8f8;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
>div {
|
||||
padding-left: 5%;
|
||||
}
|
||||
|
||||
.form-item-view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
// padding-left: 80px;
|
||||
|
||||
.form-item-view-wholesale {
|
||||
display: flex;
|
||||
|
||||
.form-item-view-wholesale-preview {
|
||||
padding-left: 5%;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.layout {
|
||||
margin-bottom: 20px;
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
|
||||
.sku-item-content {
|
||||
margin: 20px 0;
|
||||
display: flex;
|
||||
width: 100% !important;
|
||||
flex: 1;
|
||||
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
width: 100%;
|
||||
|
||||
>.ivu-card-body {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ivu-card-body {
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.sku-item-content-name {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.shop-category-text {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.form-item-view-bottom {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.item-goods-properts-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
word-break: break-all;
|
||||
white-space: normal;
|
||||
width: 300px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.item-goods-properts {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/** 审核信息-拒绝原因 */
|
||||
.auth-info {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
width: 30%;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.goods-name-width {
|
||||
width: 50%;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.el-form-item__content {
|
||||
margin-left: 120px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
p.goods-group-manager {
|
||||
padding-left: 7.5%;
|
||||
text-align: left;
|
||||
color: #999;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/*teatarea*/
|
||||
/deep/ .el-textarea {
|
||||
width: 150%;
|
||||
}
|
||||
|
||||
.seo-text {
|
||||
width: 150%;
|
||||
}
|
||||
}
|
||||
|
||||
/*折叠面板*/
|
||||
.el-collapse-item {
|
||||
/deep/ .el-collapse-item__header {
|
||||
text-align: left;
|
||||
background-color: #f8f8f8;
|
||||
padding: 0 10px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin-left: 5%;
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
/deep/ .el-form-item__content {
|
||||
margin-left: 120px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
p.goods-group-manager {
|
||||
padding-left: 12%;
|
||||
text-align: left;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/deep/ .el-collapse-item__content {
|
||||
padding: 10px 0;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
.success {
|
||||
>h1 {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
>* {
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.operation {
|
||||
>* {
|
||||
margin: 10px 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*商品描述*/
|
||||
.goods-intro {
|
||||
line-height: 40;
|
||||
}
|
||||
|
||||
/** 底部步骤 */
|
||||
.footer {
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
padding: 10px;
|
||||
background-color: #ffc;
|
||||
position: sticky;
|
||||
bottom: 0px;
|
||||
text-align: center;
|
||||
z-index: 999;
|
||||
|
||||
>.ivu-btn {
|
||||
margin: 0 10px;
|
||||
}
|
||||
}
|
||||
|
||||
/*图片上传组件第一张图设置封面*/
|
||||
.goods-images {
|
||||
/deep/ li.el-upload-list__item:first-child {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/deep/ li.el-upload-list__item:first-child:after {
|
||||
content: "封";
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
left: -15px;
|
||||
top: -6px;
|
||||
width: 40px;
|
||||
height: 24px;
|
||||
padding-top: 6px;
|
||||
background: #13ce66;
|
||||
text-align: center;
|
||||
-webkit-transform: rotate(-45deg);
|
||||
transform: rotate(-45deg);
|
||||
-webkit-box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
.el-form-item__label {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.step-list {
|
||||
height: 60px;
|
||||
padding: 10px 30px;
|
||||
background-color: #fff;
|
||||
margin-bottom: 20px;
|
||||
border-radius: 0.8em;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.add-sku-btn {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.sku-item:not(:first-child) {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.sku-upload-list {
|
||||
text-align: center;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.preview-picture {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
// text-align: center;
|
||||
border: 1px solid transparent;
|
||||
// justify-self: center;
|
||||
// align-self: center;
|
||||
}
|
||||
|
||||
.preview-picture img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.sku-upload-list img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.sku-upload-list-cover {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
.sku-upload-list:hover .sku-upload-list-cover {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.sku-upload-list-cover i {
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
margin: 0 2px;
|
||||
}
|
||||
|
||||
.required {
|
||||
/deep/ .ivu-form-item-label::before {
|
||||
content: "*";
|
||||
display: inline-block;
|
||||
margin-right: 4px;
|
||||
line-height: 1;
|
||||
font-family: SimSun;
|
||||
font-size: 14px;
|
||||
color: #ed4014;
|
||||
}
|
||||
}
|
||||
|
||||
.demo-upload-list {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
text-align: center;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
display: inline-block;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
margin-right: 4px;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.demo-upload-list img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.demo-upload-list-cover {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
|
||||
right: 0;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.demo-upload-list:hover .demo-upload-list-cover {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.demo-upload-list-cover div {
|
||||
margin-top: 50px;
|
||||
width: 100%;
|
||||
|
||||
>i {
|
||||
width: 50%;
|
||||
margin-top: 8px;
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.active-goods-type {
|
||||
background: #e8e8e8;
|
||||
}
|
||||
|
||||
.goods-type-list {
|
||||
max-height: 500px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.template-item {
|
||||
justify-content: flex-start !important;
|
||||
}
|
||||
|
||||
.tree-bar {
|
||||
height: auto !important;
|
||||
max-height: auto !important;
|
||||
min-height: 240px !important;
|
||||
}
|
||||
|
||||
.goods-type-item {
|
||||
padding: 20px 0;
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
transition: 0.35s;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
/deep/ img {
|
||||
margin-right: 20px;
|
||||
width: 100px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/deep/ p {
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.goods-type-item:hover {
|
||||
background: #ededed;
|
||||
}
|
||||
|
||||
.goods-list-box {
|
||||
height: 450px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
h2 {
|
||||
cursor: pointer;
|
||||
font-size: 21px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.form-item-view-wholesale-form-col {
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
.form-item-view-wholesale-row-del {
|
||||
display: "flex";
|
||||
justify-content: "space-between";
|
||||
align-items: "center";
|
||||
}
|
||||
.promise-intro-btn{
|
||||
margin: 10px 0;
|
||||
text-align: left;
|
||||
}
|
||||
@@ -1,160 +1,140 @@
|
||||
<template>
|
||||
<div class="search">
|
||||
<Card>
|
||||
<Form
|
||||
ref="searchForm"
|
||||
:model="searchForm"
|
||||
inline
|
||||
:label-width="70"
|
||||
class="search-form"
|
||||
@keydown.enter.native="handleSearch"
|
||||
>
|
||||
<Form-item label="商品名称" prop="goodsName">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.goodsName"
|
||||
placeholder="请输入商品名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
<Form-item label="商品编号" prop="id">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.id"
|
||||
placeholder="请输入商品编号"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
<t-card style="margin-bottom: 12px">
|
||||
<t-form ref="searchForm" :data="searchForm" layout="inline" :labelWidth="70" class="search-form" @submit="handleSearch">
|
||||
<t-form-item label="商品名称" name="goodsName">
|
||||
<t-input v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 240px" />
|
||||
</t-form-item>
|
||||
<t-form-item label="商品ID" name="id">
|
||||
<t-input v-model="searchForm.id" placeholder="请输入商品ID" clearable style="width: 240px" />
|
||||
</t-form-item>
|
||||
<t-form-item label="店铺名称" name="storeName">
|
||||
<t-input v-model="searchForm.storeName" placeholder="请输入店铺名称" clearable style="width: 240px" />
|
||||
</t-form-item>
|
||||
<t-form-item label="销售模式" name="salesModel">
|
||||
<t-select v-model="searchForm.salesModel" placeholder="请选择" clearable style="width: 240px">
|
||||
<t-option value="RETAIL" label="零售" />
|
||||
<t-option value="WHOLESALE" label="批发" />
|
||||
</t-select>
|
||||
</t-form-item>
|
||||
<t-form-item label="商品类型" name="goodsType">
|
||||
<t-select v-model="searchForm.goodsType" placeholder="请选择" clearable style="width: 240px">
|
||||
<t-option value="PHYSICAL_GOODS" label="实物商品" />
|
||||
<t-option value="VIRTUAL_GOODS" label="虚拟商品" />
|
||||
</t-select>
|
||||
</t-form-item>
|
||||
<t-form-item>
|
||||
<t-button theme="primary" class="search-btn" @click="handleSearch">搜索</t-button>
|
||||
<t-button variant="outline" style="margin-left: 8px" @click="handleReset">重置</t-button>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</t-card>
|
||||
<t-card>
|
||||
|
||||
<Form-item label="状态" prop="status">
|
||||
<Select
|
||||
v-model="searchForm.marketEnable"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
>
|
||||
<Option value="UPPER">上架</Option>
|
||||
<Option value="DOWN">下架</Option>
|
||||
</Select>
|
||||
</Form-item>
|
||||
<Form-item label="销售模式" prop="status">
|
||||
<Select
|
||||
v-model="searchForm.salesModel"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
>
|
||||
<Option value="RETAIL">零售</Option>
|
||||
<Option value="WHOLESALE">批发</Option>
|
||||
</Select>
|
||||
</Form-item>
|
||||
<Form-item label="商品类型" prop="status">
|
||||
<Select
|
||||
v-model="searchForm.goodsType"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
>
|
||||
<Option value="PHYSICAL_GOODS">实物商品</Option>
|
||||
<Option value="VIRTUAL_GOODS">虚拟商品</Option>
|
||||
</Select>
|
||||
</Form-item>
|
||||
<Button
|
||||
@click="handleSearch"
|
||||
class="search-btn"
|
||||
type="primary"
|
||||
icon="ios-search"
|
||||
>搜索</Button
|
||||
>
|
||||
</Form>
|
||||
<div class="mt_10">
|
||||
<Button type="primary" @click="handleAdd">新增商品</Button>
|
||||
<div class="goods-tab">
|
||||
<t-tabs v-model="currentStatus" @change="goodsStatusClick">
|
||||
<t-tab-panel v-for="(item,index) in goodsStatusWithCount" :key="index" :label="item.title" :value="item.value"></t-tab-panel>
|
||||
</t-tabs>
|
||||
</div>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
class="mt_10"
|
||||
>
|
||||
<!-- 商品栏目格式化 -->
|
||||
<template slot="goodsSlot" slot-scope="{ row }">
|
||||
<div style="margin: 5px 0px; height: 80px; display: flex">
|
||||
<div style="">
|
||||
<img
|
||||
:src="row.original"
|
||||
style="height: 60px; margin-top: 1px; width: 60px"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div style="margin-left: 13px">
|
||||
<div class="div-zoom">
|
||||
<a @click="linkTo(row.id, row.skuId)">{{ row.goodsName }}</a>
|
||||
</div>
|
||||
<Poptip trigger="hover" title="扫码在手机中查看" transfer>
|
||||
<div slot="content">
|
||||
<vue-qr
|
||||
:text="wapLinkTo(row.id, row.skuId)"
|
||||
:margin="0"
|
||||
colorDark="#000"
|
||||
colorLight="#fff"
|
||||
:size="150"
|
||||
></vue-qr>
|
||||
</div>
|
||||
<img
|
||||
src="../../../assets/qrcode.svg"
|
||||
class="hover-pointer"
|
||||
width="20"
|
||||
height="20"
|
||||
alt=""
|
||||
/>
|
||||
</Poptip>
|
||||
<div class="batch-operations" style="margin: 10px 0;">
|
||||
<t-button theme="success" :disabled="selectedRows.length === 0" @click="batchUpper" style="margin-right: 10px;">批量上架</t-button>
|
||||
<t-button theme="warning" :disabled="selectedRows.length === 0" @click="batchLower" style="margin-right: 10px;">批量下架</t-button>
|
||||
<t-button v-if="currentStatus === 'TOBEAUDITED'" theme="primary" :disabled="selectedRows.length === 0" @click="batchAudit">批量审核</t-button>
|
||||
</div>
|
||||
|
||||
<t-table :loading="loading" :columns="columns" :data="data" rowKey="id" :rowSelection="{ type: 'multiple', selectedRowKeys }" @select-change="onTSelectChange" class="mt_10">
|
||||
<template #imageSlot="{ row }">
|
||||
<div style="margin-top: 5px;">
|
||||
<img :src="row.original" style="height: 50px; width: 50px; object-fit: cover;" />
|
||||
</div>
|
||||
</template>
|
||||
<template #goodsSlot="{ row }">
|
||||
<div style="margin: 5px 0px; padding: 10px 0px;">
|
||||
<div class="div-zoom">
|
||||
<a @click="linkTo(row.id, row.skuId)">{{ row.goodsName }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page
|
||||
:current="searchForm.pageNumber"
|
||||
:total="total"
|
||||
:page-size="searchForm.pageSize"
|
||||
@on-change="changePage"
|
||||
@on-page-size-change="changePageSize"
|
||||
:page-size-opts="[10, 20, 50]"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
show-sizer
|
||||
></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
<Modal
|
||||
title="下架操作"
|
||||
v-model="modalVisible"
|
||||
:mask-closable="false"
|
||||
:width="500"
|
||||
>
|
||||
<Form ref="underForm" :model="underForm" :label-width="100">
|
||||
<FormItem label="下架原因" prop="reason">
|
||||
<Input v-model="underForm.reason" clearable style="width: 100%" />
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="lower"
|
||||
>提交</Button
|
||||
>
|
||||
|
||||
<template #action="{ row }">
|
||||
<template v-if="row.authFlag === 'TOBEAUDITED'">
|
||||
<a style="color:#2d8cf0;cursor:pointer;text-decoration:none" @click="openAuditModal(row)">审核</a>
|
||||
<span style="margin:0 8px;color:#dcdee2">|</span>
|
||||
<a style="color:#2d8cf0;cursor:pointer;text-decoration:none" @click="showDetail(row)">查看</a>
|
||||
</template>
|
||||
<template v-else-if="row.marketEnable == 'DOWN'">
|
||||
<a style="color:#2d8cf0;cursor:pointer;text-decoration:none" @click="upper(row)">上架</a>
|
||||
<span style="margin:0 8px;color:#dcdee2">|</span>
|
||||
<a style="color:#2d8cf0;cursor:pointer;text-decoration:none" @click="showDetail(row)">查看</a>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a style="color:#2d8cf0;cursor:pointer;text-decoration:none" @click="edit(row)">下架</a>
|
||||
<span style="margin:0 8px;color:#dcdee2">|</span>
|
||||
<a style="color:#2d8cf0;cursor:pointer;text-decoration:none" @click="showDetail(row)">查看</a>
|
||||
</template>
|
||||
</template>
|
||||
</t-table>
|
||||
<div class="mt_10" style="display: flex; justify-content: flex-end">
|
||||
<t-pagination :current="searchForm.pageNumber" :total="Number(total)" :pageSize="searchForm.pageSize" :pageSizeOptions="[20, 50, 100]" size="small" :showJumper="true" @change="onPaginationChange" />
|
||||
</div>
|
||||
</Modal>
|
||||
</t-card>
|
||||
<t-dialog :visible.sync="modalVisible" header="下架操作" width="500px" :footer="false" @close="modalVisible = false">
|
||||
title="下架操作"
|
||||
>
|
||||
<t-form ref="underForm" :data="underForm" :labelWidth="100">
|
||||
<t-form-item label="下架原因" name="reason">
|
||||
<t-input v-model="underForm.reason" style="width: 100%" />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<div style="text-align:right;margin-top: 12px;">
|
||||
<t-button variant="text" @click="modalVisible = false">取消</t-button>
|
||||
<t-button theme="primary" :loading="submitLoading" @click="lower">提交</t-button>
|
||||
</div>
|
||||
</t-dialog>
|
||||
<t-dialog :visible.sync="auditModalVisible" header="商品审核" width="500px" :footer="false" @close="auditModalVisible = false">
|
||||
<t-form ref="auditForm" :data="goodsAuditForm" :labelWidth="100">
|
||||
<t-form-item label="审核结果" name="auth_flag">
|
||||
<t-radio-group v-model="goodsAuditForm.auth_flag">
|
||||
<t-radio :value="1">审核通过</t-radio>
|
||||
<t-radio :value="2">审核拒绝</t-radio>
|
||||
</t-radio-group>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<div style="text-align:right;margin-top: 12px;">
|
||||
<t-button variant="text" @click="auditModalVisible = false">取消</t-button>
|
||||
<t-button theme="primary" @click="confirmAudit">提交审核</t-button>
|
||||
</div>
|
||||
</t-dialog>
|
||||
<t-dialog :visible.sync="batchAuditModalVisible" header="批量商品审核" width="500px" :footer="false" @close="batchAuditModalVisible = false">
|
||||
<t-form ref="batchAuditForm" :data="batchAuditForm" :labelWidth="100">
|
||||
<t-form-item label="审核结果" name="auth_flag">
|
||||
<t-radio-group v-model="batchAuditForm.auth_flag">
|
||||
<t-radio :value="1">审核通过</t-radio>
|
||||
<t-radio :value="2">审核拒绝</t-radio>
|
||||
</t-radio-group>
|
||||
</t-form-item>
|
||||
<t-form-item label="审核备注" name="reason" v-if="batchAuditForm.auth_flag === 2">
|
||||
<t-textarea v-model="batchAuditForm.reason" :rows="3" placeholder="请输入拒绝原因" />
|
||||
</t-form-item>
|
||||
<t-form-item label="选中商品">
|
||||
<div style="max-height: 200px; overflow-y: auto;">
|
||||
<t-tag v-for="item in selectedRows" :key="item.id" style="margin: 2px;">{{item.goodsName}}</t-tag>
|
||||
</div>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<div style="text-align:right;margin-top: 12px;">
|
||||
<t-button variant="text" @click="batchAuditModalVisible = false">取消</t-button>
|
||||
<t-button theme="primary" @click="submitBatchAudit">提交审核</t-button>
|
||||
</div>
|
||||
</t-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getGoodsListData, upGoods, lowGoods } from "@/api/goods";
|
||||
import { getGoodsListData,getGoodsNumerData, upGoods, lowGoods, authGoods } from "@/api/goods";
|
||||
import vueQr from "vue-qr";
|
||||
import { MessagePlugin, DialogPlugin } from "tdesign-vue";
|
||||
export default {
|
||||
components: {
|
||||
"vue-qr": vueQr,
|
||||
@@ -168,184 +148,72 @@ export default {
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
pageSize: 20, // 页面大小
|
||||
sort: "create_time", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
goodsName: "",
|
||||
id: "",
|
||||
storeName: "",
|
||||
salesModel: "",
|
||||
goodsType: "",
|
||||
goodsStatus: "",
|
||||
},
|
||||
underForm: {
|
||||
// 下架原因
|
||||
reason: "",
|
||||
},
|
||||
goodsAuditForm: {
|
||||
// 商品审核表单
|
||||
auth_flag: 1,
|
||||
},
|
||||
auditModalVisible: false, // 审核弹框显示状态
|
||||
currentAuditGoods: null, // 当前审核的商品
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectedRowKeys: [],
|
||||
columns: [
|
||||
{
|
||||
title: "商品名称",
|
||||
key: "goodsName",
|
||||
minWidth: 180,
|
||||
slot: "goodsSlot",
|
||||
},
|
||||
{
|
||||
title: "商品编号",
|
||||
key: "id",
|
||||
minWidth: 150,
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "价格",
|
||||
key: "price",
|
||||
width: 130,
|
||||
render: (h, params) => {
|
||||
return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "销售模式",
|
||||
key: "salesModel",
|
||||
width: 100,
|
||||
render: (h, params) => {
|
||||
if (params.row.salesModel === "RETAIL") {
|
||||
return h("Tag", { props: { color: "orange" } }, "零售");
|
||||
} else if (params.row.salesModel === "WHOLESALE") {
|
||||
return h("Tag", { props: { color: "magenta" } }, "批发");
|
||||
} else {
|
||||
return h("Tag", { props: { color: "volcano" } }, "其他类型");
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "商品类型",
|
||||
key: "goodsType",
|
||||
width: 130,
|
||||
render: (h, params) => {
|
||||
if (params.row.goodsType === "PHYSICAL_GOODS") {
|
||||
return h("Tag", { props: { color: "green" } }, "实物商品");
|
||||
} else if (params.row.goodsType === "VIRTUAL_GOODS") {
|
||||
return h("Tag", { props: { color: "volcano" } }, "虚拟商品");
|
||||
} else {
|
||||
return h("Tag", { props: { color: "geekblue" } }, "电子卡券");
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
key: "marketEnable",
|
||||
width: 100,
|
||||
render: (h, params) => {
|
||||
if (params.row.marketEnable == "DOWN") {
|
||||
return h("Tag", { props: { color: "volcano" } }, "下架");
|
||||
} else if (params.row.marketEnable == "UPPER") {
|
||||
return h("Tag", { props: { color: "green" } }, "上架");
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "审核状态",
|
||||
key: "authFlag",
|
||||
width: 130,
|
||||
render: (h, params) => {
|
||||
if (params.row.authFlag == "TOBEAUDITED") {
|
||||
return h("Tag", { props: { color: "volcano" } }, "待审核");
|
||||
} else if (params.row.authFlag == "PASS") {
|
||||
return h("Tag", { props: { color: "green" } }, "通过");
|
||||
} else if (params.row.authFlag == "REFUSE") {
|
||||
return h("Tag", { props: { color: "red" } }, "拒绝");
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
width: 150,
|
||||
render: (h, params) => {
|
||||
if (params.row.marketEnable == "DOWN") {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "info",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.upper(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"上架"
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
size: "small",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.showDetail(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"查看"
|
||||
),
|
||||
]);
|
||||
} else {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.edit(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"下架"
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
size: "small",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.showDetail(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"查看"
|
||||
),
|
||||
]);
|
||||
}
|
||||
},
|
||||
},
|
||||
{ colKey: "row-select", type: "multiple", width: 60, align: "center" },
|
||||
{ title: "商品ID", colKey: "id", width: 260 },
|
||||
{ title: "商品图片", colKey: "imageSlot", width: 180 },
|
||||
{ title: "商品名称", colKey: "goodsSlot", width: 180 },
|
||||
{ title: "价格", colKey: "price", width: 100, cell: (h, { row }) => h("priceColorScheme", { props: { value: row.price, color: this.$mainColor } }) },
|
||||
{ title: "销量", colKey: "buyCount", width: 100 },
|
||||
{ title: "库存", colKey: "quantity", width: 100 },
|
||||
{ title: "店铺名称", colKey: "storeName", width: 180 },
|
||||
{ title: "操作", colKey: "action", align: "center", fixed: "right", width: 200 },
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
currentStatus: '',
|
||||
goodsNumerData: {},
|
||||
goodsAuditForm: {
|
||||
// 商品编辑表单
|
||||
auth_flag: 1,
|
||||
},
|
||||
selectedRows: [], // 选中的行数据
|
||||
selectAll: false, // 全选状态
|
||||
batchAuditModalVisible: false, // 批量审核弹框显示状态
|
||||
batchAuditForm: {
|
||||
auth_flag: 1,
|
||||
reason: ''
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
goodsStatusWithCount() {
|
||||
return [
|
||||
{title: '全部', value: ''},
|
||||
{title: `出售中${this.goodsNumerData.upperGoodsNum ? '(' + this.goodsNumerData.upperGoodsNum + ')' : ''}`, value: 'UPPER'},
|
||||
{title: `仓库中${this.goodsNumerData.downGoodsNum ? '(' + this.goodsNumerData.downGoodsNum + ')' : ''}`, value: 'DOWN'},
|
||||
{title: `待审核${this.goodsNumerData.auditGoodsNum ? '(' + this.goodsNumerData.auditGoodsNum + ')' : ''}`, value: 'TOBEAUDITED'},
|
||||
{title: `审核未通过${this.goodsNumerData.refuseGoodsNum ? '(' + this.goodsNumerData.refuseGoodsNum + ')' : ''}`, value: 'REFUSE'}
|
||||
];
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 新增商品
|
||||
handleAdd(){
|
||||
this.$router.push('/goods-publish')
|
||||
},
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
this.getNumberData();
|
||||
},
|
||||
// 分页 改变页码
|
||||
changePage(v) {
|
||||
@@ -357,11 +225,42 @@ export default {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
onPaginationChange(info) {
|
||||
if (info && typeof info.pageSize !== "undefined" && info.pageSize !== this.searchForm.pageSize) {
|
||||
this.changePageSize(info.pageSize);
|
||||
}
|
||||
if (info && typeof info.current !== "undefined") {
|
||||
this.changePage(info.current);
|
||||
}
|
||||
},
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.searchForm.pageSize = 20;
|
||||
this.getDataList();
|
||||
this.getNumberData();
|
||||
},
|
||||
handleReset() {
|
||||
this.searchForm = {
|
||||
pageNumber: 1,
|
||||
pageSize: 20,
|
||||
sort: "create_time",
|
||||
order: "desc",
|
||||
goodsName: "",
|
||||
id: "",
|
||||
storeName: "",
|
||||
salesModel: "",
|
||||
goodsType: "",
|
||||
goodsStatus: "",
|
||||
};
|
||||
this.currentStatus = '';
|
||||
this.selectedRows = [];
|
||||
this.selectedRowKeys = [];
|
||||
if (this.$refs.table) {
|
||||
this.$refs.table.selectAll(false);
|
||||
}
|
||||
this.getDataList();
|
||||
this.getNumberData();
|
||||
},
|
||||
// 获取数据
|
||||
getDataList() {
|
||||
@@ -374,6 +273,15 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
getNumberData() {
|
||||
// 创建一个不包含goodsStatus字段的搜索参数
|
||||
const { goodsStatus, ...searchParams } = this.searchForm;
|
||||
getGoodsNumerData(searchParams).then((res) => {
|
||||
if (res.success) {
|
||||
this.goodsNumerData = res.result;
|
||||
}
|
||||
})
|
||||
},
|
||||
// 编辑
|
||||
edit(v) {
|
||||
this.id = v.id;
|
||||
@@ -386,27 +294,33 @@ export default {
|
||||
},
|
||||
// 下架
|
||||
lower() {
|
||||
lowGoods(this.id, this.underForm).then((res) => {
|
||||
this.$Modal.remove();
|
||||
let params = {
|
||||
goodsId: this.id,
|
||||
reason:this.underForm.reason
|
||||
};
|
||||
lowGoods(params).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
MessagePlugin.success("操作成功");
|
||||
this.modalVisible = false;
|
||||
this.getDataList();
|
||||
this.getNumberData();
|
||||
}
|
||||
});
|
||||
},
|
||||
// 商家
|
||||
// 上架
|
||||
upper(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认上架",
|
||||
const dlg = DialogPlugin.confirm({
|
||||
header: "确认上架",
|
||||
content: "您确认要上架 " + v.goodsName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
upGoods(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
theme: "warning",
|
||||
onConfirm: () => {
|
||||
dlg.hide();
|
||||
const params = { goodsId: v.id };
|
||||
upGoods(params).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success("上架成功");
|
||||
MessagePlugin.success("上架成功");
|
||||
this.getDataList();
|
||||
this.getNumberData();
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -417,13 +331,229 @@ export default {
|
||||
showDetail(v) {
|
||||
let id = v.id;
|
||||
this.$options.filters.customRouterPush({
|
||||
name: "goods-publish",
|
||||
name: "goods-detail",
|
||||
query: { id: id },
|
||||
})
|
||||
},
|
||||
|
||||
// 商品状态筛选
|
||||
goodsStatusClick(item) {
|
||||
// 根据选择的状态设置搜索条件
|
||||
if (item === 0) {
|
||||
// 全部:清除状态筛选
|
||||
delete this.searchForm.goodsStatus;
|
||||
} else {
|
||||
// 其他状态正常赋值
|
||||
this.searchForm.goodsStatus = item;
|
||||
}
|
||||
this.currentStatus = item;
|
||||
|
||||
// tab切换时清除选中内容
|
||||
this.selectedRows = [];
|
||||
if (this.$refs.table) {
|
||||
this.$refs.table.selectAll(false);
|
||||
}
|
||||
|
||||
this.getDataList();
|
||||
},
|
||||
examine(v, authFlag) {
|
||||
// 审核商品
|
||||
let examine = "通过";
|
||||
this.goodsAuditForm.authFlag = "PASS";
|
||||
if (authFlag != 1) {
|
||||
examine = "拒绝";
|
||||
this.goodsAuditForm.authFlag = "REFUSE";
|
||||
}
|
||||
|
||||
const dlg = DialogPlugin.confirm({
|
||||
header: "确认审核",
|
||||
content: "您确认要审核" + examine + " " + v.goodsName + " ?",
|
||||
theme: "warning",
|
||||
onConfirm: () => {
|
||||
dlg.hide();
|
||||
this.goodsAuditForm.goodsIds = v.id;
|
||||
const formData = new FormData();
|
||||
formData.append('goodsIds', v.id);
|
||||
formData.append('authFlag', this.goodsAuditForm.authFlag);
|
||||
authGoods(formData).then((res) => {
|
||||
if (res.success) {
|
||||
MessagePlugin.success("审核成功");
|
||||
this.getDataList();
|
||||
this.getNumberData();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 打开审核弹框
|
||||
openAuditModal(goods) {
|
||||
this.currentAuditGoods = goods;
|
||||
this.goodsAuditForm.auth_flag = 1;
|
||||
this.goodsAuditForm.reason = '';
|
||||
this.auditModalVisible = true;
|
||||
},
|
||||
|
||||
// 确认审核(二次确认)
|
||||
confirmAudit() {
|
||||
const auditText = this.goodsAuditForm.auth_flag === 1 ? '通过' : '拒绝';
|
||||
const dlg = DialogPlugin.confirm({
|
||||
header: '确认审核',
|
||||
content: `您确认要审核${auditText} "${this.currentAuditGoods.goodsName}" 吗?`,
|
||||
theme: 'warning',
|
||||
onConfirm: () => {
|
||||
dlg.hide();
|
||||
this.submitAudit();
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 提交审核
|
||||
submitAudit() {
|
||||
let formData = new FormData();
|
||||
formData.append('goodsIds', this.currentAuditGoods.id);
|
||||
formData.append('authFlag', this.goodsAuditForm.auth_flag === 1 ? 'PASS' : 'REFUSE');
|
||||
authGoods(formData).then((res) => {
|
||||
if (res.success) {
|
||||
MessagePlugin.success('审核成功');
|
||||
this.auditModalVisible = false;
|
||||
this.getDataList();
|
||||
this.getNumberData();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 选择框事件处理
|
||||
onTSelectChange(keys, { selectedRowData }) {
|
||||
this.selectedRowKeys = keys;
|
||||
this.selectedRows = selectedRowData || [];
|
||||
},
|
||||
|
||||
// 批量上架
|
||||
batchUpper() {
|
||||
if (this.selectedRows.length === 0) {
|
||||
this.$Message.warning('请先选择要上架的商品');
|
||||
return;
|
||||
}
|
||||
|
||||
const goodsNames = this.selectedRows.map(item => item.goodsName).join('、');
|
||||
DialogPlugin.confirm({
|
||||
header: '确认批量上架',
|
||||
content: `您确认要上架以下商品吗?\n${goodsNames}`,
|
||||
theme: 'warning',
|
||||
onConfirm: () => {
|
||||
const goodsIds = this.selectedRows.map(item => item.id);
|
||||
const params = { goodsId: goodsIds };
|
||||
upGoods(params).then((res) => {
|
||||
if (res.success) {
|
||||
MessagePlugin.success('批量上架成功');
|
||||
this.selectedRows = [];
|
||||
this.selectedRowKeys = [];
|
||||
this.selectAll = false;
|
||||
this.getDataList();
|
||||
this.getNumberData();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 批量下架
|
||||
batchLower() {
|
||||
if (this.selectedRows.length === 0) {
|
||||
this.$Message.warning('请先选择要下架的商品');
|
||||
return;
|
||||
}
|
||||
|
||||
const goodsNames = this.selectedRows.map(item => item.goodsName).join('、');
|
||||
DialogPlugin.confirm({
|
||||
header: '确认批量下架',
|
||||
content: `您确认要下架以下商品吗?\n${goodsNames}`,
|
||||
theme: 'warning',
|
||||
onConfirm: () => {
|
||||
const goodsIds = this.selectedRows.map(item => item.id);
|
||||
const params = { goodsId: goodsIds, reason: '批量下架操作' };
|
||||
lowGoods(params).then((res) => {
|
||||
if (res.success) {
|
||||
MessagePlugin.success('批量下架成功');
|
||||
this.selectedRows = [];
|
||||
this.selectedRowKeys = [];
|
||||
this.selectAll = false;
|
||||
this.getDataList();
|
||||
this.getNumberData();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 批量审核
|
||||
batchAudit() {
|
||||
if (this.selectedRows.length === 0) {
|
||||
MessagePlugin.warning('请先选择要审核的商品');
|
||||
return;
|
||||
}
|
||||
|
||||
// 重置批量审核表单
|
||||
this.batchAuditForm = {
|
||||
auth_flag: 1,
|
||||
reason: ''
|
||||
};
|
||||
this.batchAuditModalVisible = true;
|
||||
},
|
||||
|
||||
// 提交批量审核
|
||||
submitBatchAudit() {
|
||||
if (this.selectedRows.length === 0) {
|
||||
MessagePlugin.warning('请先选择要审核的商品');
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果是拒绝审核,必须填写原因
|
||||
if (this.batchAuditForm.auth_flag === 2 && !this.batchAuditForm.reason.trim()) {
|
||||
MessagePlugin.warning('审核拒绝时必须填写拒绝原因');
|
||||
return;
|
||||
}
|
||||
|
||||
const actionText = this.batchAuditForm.auth_flag === 1 ? '通过' : '拒绝';
|
||||
const goodsNames = this.selectedRows.map(item => item.goodsName).join('、');
|
||||
|
||||
const dlg = DialogPlugin.confirm({
|
||||
header: `确认批量审核${actionText}`,
|
||||
content: `您确认要${actionText}以下商品的审核吗?\n${goodsNames}`,
|
||||
theme: 'warning',
|
||||
onConfirm: () => {
|
||||
dlg.hide();
|
||||
const goodsIds = this.selectedRows.map(item => item.id);
|
||||
const formData = new FormData();
|
||||
formData.append('goodsId', goodsIds);
|
||||
formData.append('authFlag', this.batchAuditForm.auth_flag === 1 ? 'PASS' : 'REFUSE');
|
||||
formData.append('reason', this.batchAuditForm.reason || '');
|
||||
authGoods(formData).then((res) => {
|
||||
if (res.success) {
|
||||
MessagePlugin.success(`批量审核${actionText}成功`);
|
||||
this.selectedRows = [];
|
||||
this.selectedRowKeys = [];
|
||||
this.selectAll = false;
|
||||
this.batchAuditModalVisible = false;
|
||||
this.getDataList();
|
||||
this.getNumberData();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
// Tab组件样式
|
||||
.goods-tab {
|
||||
::v-deep .ivu-tabs-tab {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user