18 Commits

Author SHA1 Message Date
Ryan Ran
5e4d228ac2 修改商家上传回显图片bug 2024-10-31 17:09:00 +08:00
RyanRan
f2491124d1 B2C代码提交 2024-10-20 21:43:59 +08:00
chc
ef7d3d7a1a b2c版本 2024-10-18 15:33:52 +08:00
RyanRan
ea7ce1636e 补充昨天提交 2024-10-08 10:27:07 +08:00
Yer11214
a2de4ccb2e Merge branch 'dev-b2c' of https://gitee.com/beijing_hongye_huicheng/lilishop-ui into dev-b2c 2024-10-07 22:23:06 +08:00
Yer11214
0a1182f1e6 解决oss问题 2024-10-07 22:23:05 +08:00
chc
47a77ff046 补充提交 2024-10-07 17:37:57 +08:00
Yer11214
1923061d78 自提点设置 2024-10-07 17:36:18 +08:00
chc
8ed1d92f80 完善电子面单 2024-10-07 17:29:50 +08:00
Yer11214
7c330ebeb1 电子面单发货地址 2024-10-07 17:23:23 +08:00
Yer11214
6e872f0287 满额活动指定商品功能 2024-10-07 17:11:51 +08:00
Yer11214
7cdb8d5456 补充提交 2024-10-07 16:59:12 +08:00
Yer11214
c106423742 会员评价 2024-10-07 16:55:27 +08:00
Yer11214
108bb6c901 商家端商品发布查询功能 2024-10-07 16:15:13 +08:00
Yer11214
e45a1db2f9 buyer端隐藏店铺展示内容 2024-10-05 22:23:00 +08:00
Yer11214
9e630bb2ba 提交促销以己部分页面商家端功能迁移,接口对接 2024-10-05 14:33:37 +08:00
Yer11214
c03778676c 提b2c部分基础迁移代码 2024-10-02 20:41:30 +08:00
Yer11214
c970309802 删除/隐藏部分页面店铺展示 2024-09-08 23:14:13 +08:00
354 changed files with 27537 additions and 16567 deletions

View File

@@ -1,38 +0,0 @@
## 目标
- 增加 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

View File

@@ -1 +0,0 @@
{"neverMindDeployCard":true}

View File

@@ -1,12 +1,16 @@
## Lilishop B2B2C商城系统
#### 欢迎交流需求,交流业务,交流技术(基础问题自行解决,其他问题先看文档后提问)
#### 不用削尖脑袋往老群里加,老群活跃度较低,很多潜水党,新群相对而言活跃一些 :tw-1f606: :tw-1f606: :tw-1f606: :tw-1f606: :tw-1f606: :tw-1f606:
#### PS **演示站点所有环境均部署master分支。如果有演示站点问题可以反馈如果演示站点没问题本地运行有问题需自行处理**
- **[在线客服](https://work.weixin.qq.com/kfid/kfc4d8dc24a73c15f44)**
- **微信交流1群(已满)**
- **微信交流2群**:
![微信群](https://lilishop-wechat.oss-cn-beijing.aliyuncs.com/wechat.jpg)
##### 交流 qq 1群 961316482已满
##### 交流 qq 2群 875294241(已满)
##### 交流 qq 3群 263785057已满
##### 交流 qq 4群 674617534 (已满)
##### 交流 qq 5群 594675235
##### 体验 公众号/小程序/APP 体验,扫描二维码
@@ -15,41 +19,6 @@
[![star](https://gitee.com/beijing_hongye_huicheng/lilishop/badge/star.svg?theme=dark)](https://gitee.com/beijing_hongye_huicheng/lilishop/stargazers)
  ![github](https://img.shields.io/github/stars/hongyehuicheng/lilishop.svg?style=social&logo=#181717)
## 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/
@@ -60,11 +29,8 @@ https://www.bilibili.com/video/BV1WD87eoE9F/
## 开发项目
#### 安装Node.js
保证`node`版本`14`,推荐 14.17.0
2025-10-10日拉的代码之后不限制于node版本为14这里只是以14版本为例子
可以使用 `yarn` 或者 `npm` 进行安装
#### yarn 安装/启动
@@ -83,6 +49,17 @@ yarn install
yarn dev
```
#### npm 安装/启动
```
npm config set registry https://registry.npmmirror.com
// 以buyer项目为例
cd buyer
npm run install
npm run dev
```
#### FAQ
@@ -132,13 +109,6 @@ 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
@@ -253,6 +223,16 @@ PS手机验证码为 111111
4.限制商用如果需要商业使用请联系我们。QQ3409056806.或者加入qq群联系群主。
### 交流群
##### 交流 qq 1群 961316482已满
##### 交流 qq 2群 875294241已满
##### 交流 qq 3群 263785057已满
##### 交流 qq 4群 674617534已满
##### 交流 qq 5群 594675235
### 附录
有人有自己的学习视频、学习记录文档、希望宣传关联开源项目等均可以私聊仓库所有者。

View File

@@ -1 +0,0 @@
engine-strict=false

View File

@@ -1 +0,0 @@
--ignore-engines true

View File

@@ -1,5 +1,19 @@
### UI 框架与版本
# new
- `view-design@^4.3.2`
- `vue@^2.6.11`
## Project setup
```
npm install
```
### 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/).

View File

@@ -3,12 +3,9 @@
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "vue-cli-service serve",
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"dev": "vue-cli-service serve"
},
"engines": {
"node": ">=14"
"build": "vue-cli-service build"
},
"dependencies": {
"@amap/amap-jsapi-loader": "0.0.7",
@@ -18,10 +15,11 @@
"less": "^2.7.0",
"less-loader": "^5.0.0",
"mv-count-down": "^0.1.15",
"sass": "^1.63.6",
"postcss-loader": "^4.3.0",
"node-sass": "^4.14.1",
"postcss-loader": "^7.0.1",
"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",
@@ -34,7 +32,7 @@
"devDependencies": {
"@vue/cli-service": "~4.5.0",
"compression-webpack-plugin": "^5.0.0",
"sass-loader": "^10.4.1",
"sass-loader": "^7.3.1",
"uglifyjs-webpack-plugin": "^2.2.0",
"vue-template-compiler": "^2.6.11"
},
@@ -42,10 +40,5 @@
"> 1%",
"last 2 versions",
"not dead"
],
"resolutions": {
"minimatch": "^3.1.2",
"node-sass": "npm:sass@^1.63.6",
"@achrinza/node-ipc": "9.2.2"
}
]
}

View File

@@ -10,10 +10,12 @@ 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{
@@ -33,6 +35,7 @@ export default {
}
},
getSite(){
//获取基本站点信息
getBaseSite().then((res) => {

View File

@@ -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 备注 非必填
*/

View File

@@ -10,6 +10,19 @@ 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,
});
}
/**
* 验证码校验
*/

View File

@@ -527,3 +527,44 @@ 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",
}
});
}

View File

@@ -173,7 +173,7 @@ export default {
border-radius: 18.9px;
::v-deep .ivu-input.ivu-input-large {
/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 {
}
}
::v-deep .ivu-input-group-append {
/deep/ .ivu-input-group-append {
border-radius: 19.6px !important;
cursor: pointer;
box-sizing: border-box;

View File

@@ -113,12 +113,12 @@ export default {
}
}
::v-deep .ivu-card, .ivu-card-head, ._Card {
/deep/ .ivu-card, .ivu-card-head, ._Card {
margin-bottom: 20px;
@include white_background_color();
}
::v-deep .ivu-card-head {
/deep/ .ivu-card-head {
position: relative;
padding: 0 14px;
height: 50px;
@@ -140,7 +140,7 @@ export default {
cursor: pointer;
}
::v-deep .ivu-card-body {
/deep/ .ivu-card-body {
padding: 0 !important;
display: none;
}

View File

@@ -147,11 +147,11 @@ export default {
justify-content: center;
flex-direction: column;
}
::v-deep.popup .ivu-drawer-body{
/deep/.popup .ivu-drawer-body{
padding: 0!important;
background-color: #eee;
}
::v-deep.popup .ivu-drawer-wrap{
/deep/.popup .ivu-drawer-wrap{
z-index: 3001;
}
</style>

View File

@@ -326,7 +326,7 @@ export default {
.item-intro-img {
width: 100%;
min-height: 300px;
::v-deep img{
/deep/ img{
margin:0 auto;
}
}
@@ -472,7 +472,7 @@ export default {
.ivu-tabs-ink-bar {
background-color: $theme_color !important;
}
::v-deep.ivu-tabs-bar{
/deep/.ivu-tabs-bar{
border: none;
}
.item-tabs > .ivu-tabs > .ivu-tabs-bar .ivu-tabs-tab{

View File

@@ -81,9 +81,6 @@
</DropdownMenu>
</Dropdown>
</li>
<li>
<span class="nav-item" @click="shopEntry">店铺入驻</span>
</li>
</ul>
</div>
@@ -162,18 +159,6 @@ 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) {

View File

@@ -95,11 +95,7 @@ export default {
label: "宝贝收藏",
path: "/home/Favorites"
},
{
icon: "shop",
label: "收藏店铺",
path: "/home/Favorites?type=STORE"
},
{
icon: "carts",
label: "购物车",

View File

@@ -84,10 +84,10 @@ export default {
border-top: 1.4px solid #e2e2e2;
}
&:hover {
::v-deep .goods-name {
/deep/ .goods-name {
color: $theme_color;
}
::v-deep .goods-desc {
/deep/ .goods-desc {
color: $theme_color;
}
}

View File

@@ -6,11 +6,11 @@
</p>
<!-- 普通发票 -->
<div class="nav-content">
<Form :model="invoiceForm" ref="form" label-position="left" :rules="ruleInline" :label-width="110">
<Form :model="invoiceForm" ref="form" label-position="left" :label-width="110">
<FormItem label="发票类型">
<RadioGroup v-model="invoice" type="button" button-style="solid">
<Radio @on-change="changeInvoice" :label="1">电子普通发票</Radio>
<Radio :label="2" :disabled="true">增值税专用发票</Radio>
<Radio :label="2" >增值税专用发票</Radio>
</RadioGroup>
</FormItem>
<FormItem label="发票抬头">
@@ -24,10 +24,46 @@
</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>
@@ -36,8 +72,10 @@
</FormItem>
</Form>
<div style="text-align: center">
<Button type="primary" :loading="loading" @click="submit">保存发票信息</Button>
<Button type="primary" class="mr_10" :loading="loading" @click="submit">保存发票信息</Button>
<Button type="default" @click="invoiceAvailable = false">取消</Button>
</div>
</div>
</Modal>
@@ -45,11 +83,15 @@
</template>
<script>
import { receiptSelect } from '@/api/cart.js';
import { TINumber } from '@/plugins/RegExp.js';
import { getMemberReceiptList ,setMemberReceiptList,delMemberReceipt } from '@/api/member.js';
export default {
name: 'invoiceModal',
data () {
return {
receiptList:[],
showMore:false,
delReceiptLoad:false,
invoice: 1, // 发票类型
invoiceAvailable: false, // 模态框显隐
loading: false, // 提交状态
@@ -59,17 +101,36 @@ export default {
taxpayerId: '', // 纳税人识别号
receiptContent: '商品明细' // 发票内容
},
isDefault:false,
type: 1, // 1 个人 2 单位
ruleInline: {
taxpayerId: [
{ required: true, message: '请填写纳税人识别号' },
{ pattern: TINumber, message: '请填写正确的纳税人识别号' }
]
}
searchParams:{
pageNumber:1,
pageSize:5
},
total:0,
};
},
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) {
@@ -85,7 +146,40 @@ 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
}
},
/**
* 选择发票抬头
*/
@@ -94,12 +188,16 @@ export default {
this.type = val;
});
},
chooseReceipt(val){
this.$refs.poptip.visible = false
this.invoiceForm.receiptTitle = val.receiptTitle
this.invoiceForm.taxpayerId = val.taxpayerId
},
/**
* 保存判断
*/
save () {
let flage = true;
let flag = true;
// 保存分为两种类型,个人以及企业
const { receiptTitle } = JSON.parse(
@@ -108,31 +206,35 @@ export default {
// 判断是否填写发票抬头
if (!receiptTitle) {
this.$Message.error('请填写发票抬头!');
flage = false;
flag = false;
return false;
}
if (this.type === 2) {
this.$refs.form.validate((valid) => {
if (!valid) {
flage = false;
flag = false;
}
});
} else {
delete this.invoiceForm.taxpayerId;
}
return flage;
return flag;
},
// 保存发票信息
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);
}
@@ -156,9 +258,33 @@ 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>

View File

@@ -3,7 +3,7 @@
</template>
<script>
import { getIMDetail } from "@/api/common";
import { getIMDetail ,getImSetting} from "@/api/common";
import Storage from "@/plugins/storage";
import { getMemberMsg } from "@/api/login";
export default {
@@ -40,9 +40,15 @@ export default {
},
// 获取im信息
async getIMDetailMethods() {
let res = await getIMDetail();
// 获取pc im
// let res = await getImSetting();
// if (res.success) {
// this.IMLink = res.result.qrCode
// }
let res = await getImSetting();
if (res.success) {
this.IMLink = res.result;
window.open(res.result.url);
// this.IMLink = res.result.qrCode;
}
},
},

View File

@@ -57,15 +57,6 @@
: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"
@@ -546,90 +537,6 @@ 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;

View File

@@ -12,15 +12,8 @@
</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 @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>
<span class="ml_10" @click="getIMDetailMethods()">联系客服</span>
</div>
</div>
</div>
@@ -36,6 +29,12 @@
<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>
@@ -68,16 +67,19 @@ 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})
@@ -230,4 +232,11 @@ export default {
margin:10px 0
}
.img{
text-align: center;
>img{
width: 200px;
height: 200px;
}
}
</style>

View File

@@ -74,12 +74,6 @@
已有<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"

View File

@@ -17,10 +17,6 @@ export const orderStatusList = [
name: '待发货',
status: 'UNDELIVERED'
},
{
name: '部分发货',
status: 'PARTS_DELIVERED'
},
{
name: '已发货',
status: 'DELIVERED'

View File

@@ -54,7 +54,7 @@ export default {
</script>
<style scoped lang="scss">
::v-deep .ivu-col-span-2, .ivu-col-span-4 {
/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;
::v-deep .ivu-col {
/deep/ .ivu-col {
padding: 8px 0;
}

View File

@@ -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">

View File

@@ -584,7 +584,7 @@ export default {
margin-left: 25px;
margin-top: 5px
}
::v-deep .ivu-alert-message {
/deep/ .ivu-alert-message {
p {
margin: 4px 0;
}

View File

@@ -16,7 +16,6 @@
{{ 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">

View File

@@ -42,10 +42,8 @@
</div>
</div>
</div>
<div>
<span @click="shopPage(order.shopId)">{{ order.storeName }}</span>
</div>
<div>
<div class="btns">
<!-- 订单基础操作 -->
<Button @click="goDetail(order.sn)" type="info" size="small">售后详情</Button>
<Button @click="openModal(order)"
@@ -184,14 +182,7 @@ 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))
@@ -363,4 +354,10 @@ export default {
.modal-goods {
padding: 5px;
}
.btns{
>*{
margin: 4px 0;
}
}
</style>

View File

@@ -13,15 +13,7 @@
<p class="global_color fontsize_18">{{ afterSale.orderStatusValue }}</p>
<p>售后单号:{{ afterSale.sn }} &nbsp;&nbsp;&nbsp;订单号:{{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>

View File

@@ -59,10 +59,8 @@
</div>
</div>
</div>
<div>
<span @click="shopPage(order.storeId)">{{ order.storeName }}</span>
</div>
<div>
<div class="btns">
<!-- 订单基础操作 -->
<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>
@@ -195,14 +193,7 @@ 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} });
@@ -391,4 +382,9 @@ export default {
}
}
}
.btns{
>*{
margin: 4px 0;
}
}
</style>

View File

@@ -106,9 +106,7 @@
</div>
<!-- 订单商品 -->
<div class="goods">
<div class="shop-name">
<span @click="shopPage(order.order.storeId)">{{order.order.storeName}}</span>
</div>
<table>
<thead>
<tr>
@@ -488,24 +486,6 @@ 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;
@@ -604,21 +584,22 @@ table {
.layui-layer-wrap > .div-express-log {
max-height: 300px;
}
::v-deep .layui-layer-wrap > .div-express-log::-webkit-scrollbar{
/deep/ .layui-layer-wrap > .div-express-log::-webkit-scrollbar{
width: 1px;
height: 5px;
}
::v-deep .layui-layer-wrap > .div-express-log::-webkit-scrollbar-thumb{
/deep/ .layui-layer-wrap > .div-express-log::-webkit-scrollbar-thumb{
border-radius: 1em;
background-color: rgba(50,50,50,.3);
}
::v-deep .layui-layer-wrap > .div-express-log::-webkit-scrollbar-track{
/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;

View File

@@ -115,13 +115,7 @@
</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>&nbsp;&nbsp;
</span>
</div>
<div class="goods-list">
<div class="goods-item" v-for="(goods, goodsIndex) in shop.checkedSkuList" :key="goodsIndex">
<span class="hover-color" @click="
@@ -890,53 +884,6 @@ 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;

View File

@@ -32,9 +32,7 @@
已有<span>{{ item.commentNum || 0 }}</span
>人评价
</div>
<div class="goods-show-seller">
<span>{{ item.storeName }}</span>
</div>
</div>
</div>
<div class="page-size">

View File

@@ -66,9 +66,7 @@
: 100
" />
</div>
<div class="goods-show-seller">
<span>{{ item.storeName }}</span>
</div>
</div>
</div>
<BaseFooter />

View File

@@ -9,6 +9,7 @@ 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'),

View File

@@ -70,7 +70,7 @@ module.exports = {
loaderOptions: {
sass: {
additionalData: `@import "@/assets/styles/global.scss";` //全局加载scss
data: `@import "@/assets/styles/global.scss";` //全局加载scss
},
// 向 CSS 相关的 loader 传递选项
less: {

View File

@@ -24,7 +24,6 @@
"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": {

View File

@@ -33,11 +33,6 @@ 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'

View File

@@ -65,14 +65,9 @@
> -->
</p>
<!-- 对话列表 -->
<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)">
<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)">
<div class="avatar-box">
<face :text="item.face" v-if="item.face"></face>
<face-null :text="item.name" v-else></face-null>
@@ -84,7 +79,9 @@
<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 }}条未读
@@ -92,9 +89,11 @@
<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>
@@ -112,7 +111,9 @@
<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>
@@ -123,12 +124,13 @@
</span>
<span v-else>[群消息]</span>
</template>
<span>{{ item.msg_text }}</span>
</template>
</div>
</div>
</div>
</RecycleScroller>
</template>
</el-main>
</el-scrollbar>
</el-container>
@@ -149,8 +151,6 @@
</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,7 +179,6 @@ export default {
UserSearch,
OtherLink,
WelcomeModule,
RecycleScroller
},
data () {
return {

View File

@@ -1 +0,0 @@
engine-strict=false

View File

@@ -1 +0,0 @@
--ignore-engines true

View File

@@ -1,15 +1,33 @@
# 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行修改避免报错

View File

@@ -9,9 +9,6 @@
"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",
@@ -19,16 +16,13 @@
"core-js": "^3.6.5",
"dplayer": "^1.26.0",
"js-cookie": "^2.2.1",
"price-color": "1.0.2",
"sass": "^1.63.6",
"sass-loader": "^10.4.1",
"node-sass": "^4.14.1",
"sass-loader": "^8.0.2",
"sockjs-client": "^1.4.0",
"swiper": "^6.3.5",
"uuid": "^8.3.2",
"tdesign-vue": "^1.14.2",
"tdesign-icons-vue": "^0.2.3",
"@vue/composition-api": "^1.7.1",
"vue": "2.6.14",
"view-design": "^4.7.0",
"vue": "^2.6.10",
"vue-awesome-swiper": "^4.1.1",
"vue-i18n": "^8.15.1",
"vue-json-excel": "^0.3.0",
@@ -37,7 +31,8 @@
"vue-router": "^3.1.3",
"vuedraggable": "^2.23.2",
"vuex": "^3.4.0",
"xss": "^1.0.7"
"xss": "^1.0.7",
"price-color": "1.0.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.4.4",
@@ -52,11 +47,6 @@
"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.14"
},
"resolutions": {
"minimatch": "^3.1.2",
"node-sass": "npm:sass@^1.63.6",
"@achrinza/node-ipc": "9.2.2"
"vue-template-compiler": "^2.6.10"
}
}

Binary file not shown.

Binary file not shown.

View File

@@ -23,7 +23,7 @@ export const postVerifyImg = (params) => {
// 获取系统基础信息
export const getBaseSite = () => {
return getRequestWithNoToken(`${commonUrl}/common/common/site`);
return getRequest(`${commonUrl}/common/common/site`);
};
// 上传文件

View File

@@ -57,5 +57,15 @@ 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)
}

View File

@@ -101,23 +101,20 @@ export const getGoodsCategory = (parent_id) => {
}
// 上架商品
export const upGoods = (params) => {
return putRequest(`/goods/goods/up`, params)
export const upGoods = (id, params) => {
return putRequest(`/goods/goods/${id}/up`, params)
}
// 下架商品
export const lowGoods = (params) => {
return putRequest(`/goods/goods/under`, params)
export const lowGoods = (id, params) => {
return putRequest(`/goods/goods/${id}/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)
@@ -127,12 +124,8 @@ export const getAuthGoodsListData = (params) => {
return getRequest('/goods/goods/auth/list', params)
}
// 审核商品
export const authGoods = (params) => {
return putRequest(`/goods/goods/auth`, params,{
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
export const authGoods = (id, params) => {
return putRequest(`/goods/goods/${id}/auth`, params)
}
//查询分类绑定参数信息
@@ -232,3 +225,60 @@ 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);
};

View File

@@ -111,7 +111,7 @@ export const changeMobile = (params) => {
};
// 获取用户数据 多条件
export const getUserListData = (params) => {
return getRequest("/passport/user/getByCondition", params);
return getRequest("/passport/user", params);
};
// 通过用户名搜索
export const searchUserByName = (username, params) => {
@@ -445,21 +445,6 @@ 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);

View File

@@ -42,6 +42,11 @@ 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) => {
@@ -126,10 +131,7 @@ 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) => {
@@ -161,12 +163,18 @@ export const storeAddress = (sn) => {
return getRequest(`/order/afterSale/getStoreAfterSaleAddress/${sn}`)
}
// 获取订单数量统计
export const getOrderNum = (params) => {
return getRequest(`/order/order/orderNum`, params)
}
// 订单核验
export const orderTake = (sn, verificationCode) => {
return putRequest(`/order/order/take/${sn}/${verificationCode}`);
};
// 获取售后数量统计
export const getAfterSaleNumVO = (params) => {
return getRequest(`/order/afterSale/afterSaleNumVO`, params)
//分包裹发货
export const partDelivery = (orderSn,params) => {
return postRequest(`/order/order/${orderSn}/partDelivery`,params,{
"Content-type": "application/json"
})
}
// 修改订单备注
export const modifyOrderRemark = (sn, params) => {
return putRequest(`/order/order/${sn}/sellerRemark`, params);
};

View File

@@ -114,5 +114,5 @@ export const getPrivacy = (type) => {
}
//修改隐私协议数据
export const updatePrivacy = (id,type,params) => {
return putRequest(`/other/article/updateArticle/${type}/${id}`, params, {"Content-Type": "application/json"})
return putRequest(`/other/article/updateArticle/${type}?id=${id}`, params, {"Content-Type": "application/json"})
}

View File

@@ -281,3 +281,32 @@ 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}`)
}

View File

@@ -1,5 +1,5 @@
// 统一请求路径前缀在libs/axios.js中修改
import {getRequest, postRequest, putRequest} from '@/libs/axios';
import {getRequest, postRequest, putRequest,deleteRequest} from '@/libs/axios';
//查询店铺列表
export const getBillPage = (params) => {
@@ -87,3 +87,40 @@ 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.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -1,44 +0,0 @@
<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>

View File

@@ -10,14 +10,7 @@
{{ 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>
@@ -40,7 +33,7 @@ export default {
params: {
// 请求参数
pageNumber: 1,
pageSize: 20,
pageSize: 10,
storeName: "",
},
dateList: [

View File

@@ -1,7 +1,7 @@
<template>
<div class="wrapper">
<t-button @click="handleClickUploadImage">上传图片</t-button>
<t-dialog :visible.sync="show" :width="850" header="上传图片" @confirm="callback" @close="show=false">
<Button @click="handleClickUploadImage">上传图片</Button>
<Modal v-model="show" width="850" @on-ok="callback" title="上传图片">
<div class="import-oss" @click="importOSS">
从资源库中导入
</div>
@@ -19,50 +19,53 @@
<img alt="image" :src="item.url"/>
<div class="upload-list-cover">
<div>
<t-icon name="search" size="30" @click="$previewImage(item.url)" />
<t-icon name="delete" size="30" @click="handleRemoveGoodsPicture(__index)" />
<Icon
size="30"
type="md-search"
@click.native="$previewImage(item.url)"
></Icon>
<Icon
size="30"
type="md-trash"
@click.native="handleRemoveGoodsPicture(__index)"
></Icon>
</div>
</div>
</template>
</div>
</vuedraggable>
<div class="upload-box">
<t-upload
<Upload
ref="upload"
:action="uploadFileUrl"
:format="['jpg', 'jpeg', 'png']"
:headers="{ ...accessToken }"
accept=".jpg,.jpeg,.png"
:sizeLimit="{ size: 10240, unit: 'KB' }"
@success="handleSuccessGoodsPicture"
@fail="handleFail"
:showUploadFileList="false"
:multiple="true"
theme="dragger"
:max-size="10240"
:on-exceeded-size="handleMaxSize"
:on-format-error="handleFormatError"
:on-success="handleSuccessGoodsPicture"
:show-upload-list="false"
multiple
type="drag"
>
<div style="width: 148px; height: 148px; line-height: 148px; display:flex; align-items:center; justify-content:center;">
<t-icon size="20" name="add" />
<div style="width: 148px; height: 148px; line-height: 148px">
<Icon size="20" type="md-add"></Icon>
</div>
</t-upload>
</Upload>
</div>
</div>
</t-dialog>
</Modal>
<t-dialog :width="1000" :visible.sync="showOssManager" header="资源库" @confirm="confirmUrls" @close="showOssManager=false">
<Modal width="1000" v-model="showOssManager" @on-ok="confirmUrls">
<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>
</Modal>
</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: {
@@ -99,19 +102,23 @@ export default {
this.images.splice(__index, 1);
},
// 图片大小不正确
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("上传失败");
}
handleMaxSize(file) {
this.$Notice.warning({
title: "超过文件大小限制",
desc: "图片大小不能超过10MB",
});
},
// 图片格式不正确
handleFormatError(file) {
this.$Notice.warning({
title: "文件格式不正确",
desc: "文件 " + file.name + " 的格式不正确",
});
},
// sku图片上传成功
handleSuccessGoodsPicture({ response, file }) {
if (response) {
file.url = response.result;
handleSuccessGoodsPicture(res, file) {
if (file.response) {
file.url = file.response.result;
this.images.push(file);
}
},
@@ -122,7 +129,7 @@ export default {
this.showOssManager = false
},
handleCallback(val){
MessagePlugin.success("导入成功")
this.$Message.success("导入成功")
this.images.push({url:val.url})
},
// 从资源库中导入图片

View File

@@ -51,18 +51,22 @@
<li class="hz-u-square hz-u-square-br" data-pointer="dealBR"></li>
</ul>
<t-dialog
:visible.sync="showModal"
header="编辑热区"
:draggable="true"
@close="cancelZone"
<Modal
v-model="showModal"
title="编辑热区"
draggable
scrollable
:mask="false"
ok-text="保存"
@on-ok="saveZone"
@on-cancel="cancelZone"
>
<div>
<div class="hz-edit-img">
<img class="show-image" :src="zoneForm.img" alt />
</div>
<t-form :data="zoneForm" :labelWidth="80">
<Form :model="zoneForm" :label-width="80">
<!-- <FormItem label="图片链接:">
<Input v-model="zoneForm.img"></Input>
<Button size="small" type="primary" @click="handleSelectImg"
@@ -70,31 +74,26 @@
>
:v-model="zoneForm.type === 'goods' ? zoneForm.goodsName : zoneForm.link"
</FormItem> -->
<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>
<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>
</div>
<template #footer>
<t-button variant="text" @click="cancelZone">取消</t-button>
<t-button theme="primary" @click="saveZone">保存</t-button>
</template>
</t-dialog>
</Modal>
<!-- 选择商品链接 -->
<liliDialog ref="liliDialog" @selectedLink="selectedLink"></liliDialog>
<!-- 选择图片 -->
<t-dialog :width="1200" :visible.sync="picModelFlag" header="选择图片">
<Modal width="1200px" v-model="picModelFlag" footer-hide>
<ossManage
@callback="callbackSelected"
:isComponent="true"
:initialize="picModelFlag"
ref="ossManage"
/>
<template #footer>
<t-button variant="text" @click="picModelFlag=false">关闭</t-button>
</template>
</t-dialog>
</Modal>
</li>
</template>

View File

@@ -1,11 +1,13 @@
<template>
<t-dialog
:visible.sync="flag"
:width="800"
header="绘制热区"
:closeOnOverlayClick="false"
@close="clickClose"
@confirm="clickOK"
<Modal
:styles="{ top: '120px' }"
width="800"
@on-cancel="clickClose"
@on-ok="clickOK"
v-model="flag"
:mask-closable="false"
title="绘制热区"
scrollable
>
<template v-if="flag">
<hotzone
@@ -15,7 +17,7 @@
:image="res.img"
></hotzone>
</template>
</t-dialog>
</Modal>
</template>
<script>
import hotzone from "./components/Hotzone.vue";
@@ -55,11 +57,11 @@ export default {
};
</script>
<style scoped lang="scss">
::v-deep .t-dialog {
/deep/ .ivu-modal {
overflow: hidden;
height: 650px !important;
}
::v-deep .t-dialog__body {
/deep/ .ivu-modal-body {
width: 100%;
height: 500px;
overflow: hidden;

View File

@@ -19,6 +19,7 @@
getQueryGoodsList();
}
"
icon="ios-search"
clearable
style="width: 150px"
v-model="goodsParams.goodsName"
@@ -40,10 +41,9 @@
goodsParams.pageNumber = 1;
getQueryGoodsList();
"
icon="ios-search"
>搜索</Button
>
<template #icon><t-icon name="search" /></template>
搜索
</Button>
</div>
</div>
<div>

View File

@@ -1,5 +1,5 @@
<template>
<t-dialog :visible.sync="flag" :width="1160" header="选择" :closeOnOverlayClick="false" @close="clickClose" @confirm="clickOK">
<Modal :styles="{ top: '120px' }" width="1160" :z-index="10000" @on-cancel="clickClose" @on-ok="clickOK" v-model="flag" :mask-closable="false" scrollable>
<template v-if="flag">
<goodsDialog
@selected="
@@ -21,7 +21,7 @@
class="linkDialog"
/>
</template>
</t-dialog>
</Modal>
</template>
<script>
import goodsDialog from "./goods-dialog";
@@ -86,11 +86,11 @@ export default {
};
</script>
<style scoped lang="scss">
::v-deep .t-dialog {
/deep/ .ivu-modal {
overflow: hidden;
height: 650px !important;
}
::v-deep .t-dialog__body {
/deep/ .ivu-modal-body {
width: 100%;
height: 500px;
overflow: hidden;

View File

@@ -1,9 +1,10 @@
<template>
<div class="wrapper">
<t-tabs :value="wap[0].title" class="tabs" @change="onTabChange">
<t-tab-panel
<Tabs :value="wap[0].title" class="tabs">
<TabPane
:label="item.title"
:value="item.title"
:name="item.title"
@click="clickTag(item, i)"
v-for="(item, i) in wap"
:key="i"
>
@@ -16,8 +17,9 @@
}
"
/>
</t-tab-panel>
</t-tabs>
</TabPane>
<!-- </template> -->
</Tabs>
</div>
</template>
<script>
@@ -63,13 +65,11 @@ export default {
}
return cur;
}, []);
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,8 +94,6 @@ export default {
});
},
methods: {
onTabChange(val){
}
// isVisible(item) {
// const type = this.$route.query.pagetype;
// if (type == "INDEX" && [ "discover"].includes(item.name)) {
@@ -122,11 +120,11 @@ export default {
width: 100%;
}
::v-deep .ivu-modal {
/deep/ .ivu-modal {
overflow: hidden;
height: 650px !important;
}
::v-deep .ivu-modal-body {
/deep/ .ivu-modal-body {
width: 100%;
height: 500px;
overflow: hidden;

View File

@@ -42,12 +42,12 @@
}
}
::v-deep .ivu-scroll-container {
/deep/ .ivu-scroll-container {
width: 100% !important;
height: 400px !important;
}
::v-deep .ivu-scroll-content {
/deep/ .ivu-scroll-content {
/* */
display: flex;
flex-wrap: wrap;
@@ -81,7 +81,7 @@
align-items: center;
margin: 10px;
::v-deep img {
/deep/ img {
width: 60px;
height: 60px;
text-align: center;

View File

@@ -70,9 +70,16 @@ export default {
params: {
// 请求参数
pageNumber: 1,
pageSize: 20,
pageSize: 10,
},
pintuanColumns: [
// 表头
{
title: "活动标题",
key: "title",
tooltip: true,
width: 250,
},
{
title: "商品名称",
key: "goodsName",
@@ -101,12 +108,12 @@ export default {
render: (h, params) => {
return h("div", [
h(
"a",
"Button",
{
style: {
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none",
props: {
// type: this.index == params.index ? "primary" : "",
type: 'default',
size: "small",
},
on: {
click: () => {
@@ -194,12 +201,12 @@ export default {
render: (h, params) => {
return h("div", [
h(
"a",
"Button",
{
style: {
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none",
props: {
// type: this.index == params.index ? "primary" : "",
type: 'default',
size: "small",
},
on: {
click: () => {
@@ -246,12 +253,12 @@ export default {
render: (h, params) => {
return h("div", [
h(
"a",
"Button",
{
style: {
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none",
props: {
// type: this.index == params.index ? "primary" : "",
type: 'default',
size: "small",
},
on: {
click: () => {
@@ -332,15 +339,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: "积分商品",
@@ -376,10 +383,7 @@ 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) {
@@ -420,7 +424,7 @@ img {
overflow: auto;
width: 100%;
}
::v-deep .ivu-table-wrapper {
/deep/ .ivu-table-wrapper {
width: 100%;
}
.list {

View File

@@ -1,8 +1,8 @@
<template>
<div>
<t-row :gutter="30">
<t-col
:span="4"
<Row :gutter="30">
<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)"
>
<t-icon name="link" size="24" />
<Icon size="24" :type="item.icon" />
<p>{{ item.title }}</p>
</div>
</t-col>
</Col>
<!-- 外部链接只有pc端跳转 -->
<t-col :span="4">
<Col span="4">
<div
v-if="linkVisible"
class="card"
:class="{ active: selectedIndex == linkList.length }"
@click="handleLink(linkItem, linkList.length)"
>
<t-icon name="link" size="24" />
<Icon size="24" :type="linkItem.icon" />
<p>{{ linkItem.title }}</p>
</div>
</t-col>
</t-row>
</Col>
</Row>
</div>
</template>
<script>
@@ -157,7 +157,7 @@ export default {
text-align: center;
transition: 0.35s;
cursor: pointer;
::v-deep p {
/deep/ p {
margin: 10px 0;
}
border: 1px solid #ededed;

View File

@@ -33,7 +33,7 @@ export default {
};
</script>
<style lang="scss" scoped>
::v-deep .ivu-card-body {
/deep/ .ivu-card-body {
height: 414px;
overflow: auto;
}
@@ -69,11 +69,11 @@ export default {
height: 416px;
overflow: hidden;
}
::v-deep .ivu-table {
/deep/ .ivu-table {
height: 300px !important;
overflow: auto;
}
::v-deep .ivu-card-body {
/deep/ .ivu-card-body {
padding: 0;
height: auto;
}

View File

@@ -4,12 +4,12 @@
<div class="query-wrapper">
<div class="query-item">
<div>店铺名称</div>
<t-input placeholder="请输入店铺名称" @clear="shopsData=[]; params.storeName=''; params.pageNumber =1; init()" @enter="()=>{shopsData=[]; params.pageNumber =1; init();}" clearable style="width: 150px"
<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"
v-model="params.storeName" />
</div>
<div class="query-item">
<t-button theme="primary" @click="shopsData=[];params.pageNumber =1; init();">搜索</t-button>
<Button type="primary" @click="shopsData=[];params.pageNumber =1; init();" icon="ios-search">搜索</Button>
</div>
</div>
<div>
@@ -25,16 +25,19 @@
<div class="wap-sku" :class="{'theme_color':(item.storeDisable === 'OPEN' ? true : false) }">{{ item.storeDisable === 'OPEN' ? '开启中' : '未开启' }}</div>
</div>
</div>
<t-loading v-if="loading" :loading="true" fullscreen></t-loading>
<Spin size="large" fix v-if="loading"></Spin>
</div>
<t-pagination
:current="params.pageNumber"
:total="Number(total)"
:pageSize="params.pageSize"
<Page
:total="total"
class="pageration"
@on-change="changePageSize"
:page-size="params.pageSize"
size="small"
:showJumper="true"
@change="onPaginationChange"
/>
show-total
show-elevator
>
</Page>
</div>
</div>
</div>
@@ -62,9 +65,8 @@ export default {
this.init();
},
methods: {
onPaginationChange({ current, pageSize }){
this.params.pageNumber = current;
this.params.pageSize = pageSize;
changePageSize(v){
this.params.pageNumber = v;
this.init();
},
init() {

View File

@@ -45,7 +45,7 @@ export default {
order: "desc",
pageClientType: "H5",
pageNumber: 1,
pageSize: 20,
pageSize: 10,
pageType: "SPECIAL",
},
total: 0, // 表单数据总数
@@ -137,7 +137,7 @@ img {
overflow: auto;
width: 100%;
}
::v-deep .ivu-table-wrapper {
/deep/ .ivu-table-wrapper {
width: 100%;
}
.list {

View File

@@ -5,7 +5,16 @@
<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>

View File

@@ -10,19 +10,15 @@
@on-clear="clearSelect"
/>
<Poptip transfer trigger="click" placement="right" title="选择部门" width="250">
<Button>
<template #icon><t-icon name="browse" /></template>
选择部门
</Button>
<Button icon="md-list">选择部门</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"

View File

@@ -1,20 +1,25 @@
<template>
<div>
<div style="display:flex;">
<t-input
<Input
v-model="currentValue"
@change="handleChange"
@on-change="handleChange"
v-show="showInput"
:placeholder="placeholder"
:size="size"
:disabled="disabled"
:readonly="readonly"
:maxlength="maxlength"
>
<template #suffix>
<a style="margin-left:8px" @click="viewImage=true">预览</a>
</template>
</t-input>
<t-button @click="handleCLickImg('storeLogo')">选择图片</t-button>
<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>
<!--<Upload-->
<!--:action="uploadFileUrl"-->
<!--:headers="accessToken"-->
@@ -34,19 +39,16 @@
<!--</Upload>-->
</div>
<t-dialog header="图片预览" :visible.sync="viewImage" :width="500" @close="viewImage=false">
<Modal title="图片预览" v-model="viewImage" :styles="{top: '30px'}" draggable>
<img :src="currentValue" alt="该资源不存在" style="max-width: 300px;margin: 0 auto;display: block;" />
<template #footer>
<t-button variant="text" @click="viewImage=false">关闭</t-button>
</template>
</t-dialog>
<div slot="footer">
<Button @click="viewImage=false">关闭</Button>
</div>
</Modal>
<t-dialog :width="1200" header="选择图片" :visible.sync="picModalFlag" @close="picModalFlag=false">
<Modal width="1200px" v-model="picModalFlag">
<ossManage @callback="callbackSelected" ref="ossManage" :isComponent="true" :initialize="picModalFlag" />
<template #footer>
<t-button variant="text" @click="picModalFlag=false">关闭</t-button>
</template>
</t-dialog>
</Modal>
</div>
</template>
@@ -54,7 +56,6 @@
<script>
import { uploadFile } from "@/api/index";
import ossManage from "@/views/sys/oss-manage/ossManage";
import { MessagePlugin } from "tdesign-vue";
export default {
name: "uploadPicInput",
components: {
@@ -160,7 +161,7 @@ export default {
// 上传失败
handleError(error, file, fileList) {
this.loading = false;
MessagePlugin.error(error.toString());
this.$Message.error(error.toString());
},
// 上传成功回显
handleChange(v) {

View File

@@ -13,48 +13,48 @@
<div v-if="item.status == 'finished'" style="height:60px;">
<img :src="item.url" />
<div class="upload-list-cover">
<t-icon name="browse" @click="handleView(item.url)"></t-icon>
<t-icon name="delete" @click="handleRemove(item)"></t-icon>
<Icon type="ios-eye-outline" @click="handleView(item.url)"></Icon>
<Icon type="ios-trash-outline" @click="handleRemove(item)"></Icon>
</div>
</div>
<div v-else>
<t-progress v-if="item.showProgress" :percentage="item.percentage"></t-progress>
<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
</div>
</div>
</vuedraggable>
<t-upload
<Upload
ref="upload"
:multiple="multiple"
:showUploadFileList="false"
:autoUpload="true"
: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"
: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;display:flex;align-items:center;justify-content:center;">
<t-icon name="camera" size="20"></t-icon>
<div style="width: 58px;height:58px;line-height: 58px;">
<Icon type="md-camera" size="20"></Icon>
</div>
</t-upload>
</Upload>
</div>
<t-dialog header="图片预览" :visible.sync="viewImage" :width="600">
<Modal title="图片预览" v-model="viewImage" :styles="{top: '30px'}" draggable>
<img :src="imgUrl" alt="无效的图片链接" style="width: 100%;margin: 0 auto;display: block;" />
<template #footer>
<t-button variant="text" @click="viewImage=false">关闭</t-button>
</template>
</t-dialog>
<div slot="footer">
<Button @click="viewImage=false">关闭</Button>
</div>
</Modal>
</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({ response, file }) {
if (response && response.success) {
file.url = response.result;
handleSuccess(res, file) {
if (res.success) {
file.url = res.result;
// 单张图片处理
if (!this.multiple && this.uploadList.length > 0) {
// 删除第一张
@@ -121,25 +121,35 @@ export default {
// 返回组件值
this.returnValue();
} else {
MessagePlugin.error((response && response.message) || '上传失败');
this.$Message.error(res.message);
}
},
// 上传失败
handleError({ error }) {
MessagePlugin.error((error && error.toString()) || '上传失败');
handleError(error, file, fileList) {
this.$Message.error(error.toString());
},
// 格式校验
handleFormatError(file) {
MessagePlugin.warning("所选文件格式不正确, 请选择 .jpg/.jpeg/.png/.gif 文件");
this.$Notice.warning({
title: "不支持的文件格式",
desc:
"所选文件‘ " +
file.name +
" ’格式不正确, 请选择 .jpg .jpeg .png .gif图片格式文件"
});
},
// 上传文件大小校验
handleMaxSize(file) {
MessagePlugin.warning("所选文件大小过大不能超过1M");
this.$Notice.warning({
title: "文件大小过大",
desc:
"所选文件大小过大不能超过1M."
});
},
// 上传之前钩子
handleBeforeUpload() {
if (this.multiple && this.uploadList.length >= this.limit) {
MessagePlugin.warning("最多只能上传" + this.limit + "张图片");
this.$Message.warning("最多只能上传" + this.limit + "张图片");
return false;
}
return true;
@@ -175,7 +185,7 @@ export default {
if (typeof v == "string") {
// 单张
if (this.multiple) {
MessagePlugin.warning("多张上传仅支持数组数据类型");
this.$Message.warning("多张上传仅支持数组数据类型");
return;
}
if (!v) {
@@ -192,7 +202,7 @@ export default {
} else if (typeof v == "object") {
// 多张
if (!this.multiple) {
MessagePlugin.warning("单张上传仅支持字符串数据类型");
this.$Message.warning("单张上传仅支持字符串数据类型");
return;
}
this.uploadList = [];
@@ -208,7 +218,7 @@ export default {
if (init) {
this.$emit("input", v.slice(0, this.limit));
}
MessagePlugin.warning("最多只能上传" + this.limit + "张图片");
this.$Message.warning("最多只能上传" + this.limit + "张图片");
} else {
v.forEach(e => {
let item = {

View File

@@ -1,9 +1,9 @@
<template>
<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>
<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>
<div>
<div v-if="mapDefault === 'select'">
<div class="selector">
@@ -18,24 +18,21 @@
</div>
<div class="footer">
<t-button theme="primary" @click="finished">确定</t-button>
<Button type="primary" @click="finished">确定</Button>
</div>
</div>
<mapping v-if="mapDefault === 'map'" ref="map" @getAddress="getAddress" />
</div>
<template #footer>
<t-button variant="text" @click="enableMap=false">关闭</t-button>
</template>
</t-dialog>
</Modal>
</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() {
@@ -107,7 +104,7 @@ export default {
// 选择完成
finished() {
if(!this.chiosend[0]){
MessagePlugin.error("请选择地址")
this.$Message.error("请选择地址")
return
}
const params = this.chiosend.filter((item) => item!=="" && item.value !== "");

View File

@@ -0,0 +1,222 @@
<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>

View File

@@ -1,12 +1,13 @@
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: {},
components: { Radio },
data() {
return {
radioSelectedIndex: -1,

View File

@@ -1,7 +1,7 @@
import axios from "axios";
import { getStore, setStore } from "./storage.js";
import { router } from "../router/index";
import { MessagePlugin } from "tdesign-vue";
import { Message } from "view-design";
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 => {
MessagePlugin.error("请求超时");
Message.error("请求超时");
return Promise.reject(err);
}
);
@@ -53,14 +53,14 @@ service.interceptors.response.use(
const data = response.data;
// 根据返回的code值来做不同的处理(和后端约定)
if (!data.success && data.message) {
MessagePlugin.error(data.message);
Message.error(data.message);
}
switch (data.code) {
case 400:
if (data.message !== null) {
MessagePlugin.error(data.message);
Message.error(data.message);
} else {
MessagePlugin.error("系统异常");
Message.error("系统异常");
}
break;
case 20004:
@@ -70,9 +70,9 @@ service.interceptors.response.use(
setStore("accessToken", "");
if (router.history.current.name != "login") {
if (data.message !== null) {
MessagePlugin.error(data.message);
Message.error(data.message);
} else {
MessagePlugin.error("未知错误,请重新登录");
Message.error("未知错误,请重新登录");
}
router.push("/login");
}
@@ -81,9 +81,9 @@ service.interceptors.response.use(
case 500:
// 系统异常
if (data.message !== null) {
MessagePlugin.error(data.message);
Message.error(data.message);
} else {
MessagePlugin.error("系统异常");
Message.error("系统异常");
}
break;
default:
@@ -119,7 +119,7 @@ service.interceptors.response.use(
}
} else {
// 其他错误处理
MessagePlugin.error(error.response.data.message);
Message.error(error.response.data.message);
}
}
/* router.push("/login") */

View File

@@ -237,17 +237,6 @@ 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) {

View File

@@ -2,6 +2,8 @@ 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);
@@ -15,8 +17,8 @@ Vue.config.lang = lang;
// 多语言配置 vue-i18n 6.x+
Vue.locale = () => { };
const messages = {
'zh-CN': zhLocale,
'en-US': enLocale
'zh-CN': Object.assign(zhCnLocale, zhLocale),
'en-US': Object.assign(enUsLocale, enLocale)
};
const i18n = new VueI18n({
locale: lang,

View File

@@ -1,14 +1,9 @@
// 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"
@@ -66,467 +61,11 @@ Vue.prototype.wapLinkTo = function (goodsId, skuId) {
import priceColorScheme from 'price-color'
Vue.use(priceColorScheme);
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 })
}
})
const copyViewUi = {...ViewUI}
copyViewUi.Input.props.maxlength.default = inputMaxLength // 挂载最大输入值
Vue.use(copyViewUi, {
i18n: (key, value) => i18n.t(key, value),
});
Vue.component('liliDialog', liliDialog)
@@ -545,7 +84,6 @@ 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;

View File

@@ -1,4 +1,5 @@
import Vue from 'vue';
import ViewUI from 'view-design';
import Util from '../libs/util';
import VueRouter from 'vue-router';
import Cookies from 'js-cookie';
@@ -23,6 +24,7 @@ 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();
@@ -47,6 +49,7 @@ 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);
});

View File

@@ -31,6 +31,20 @@ 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: "修改密码",
@@ -55,6 +69,12 @@ 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: "店铺详细",
@@ -235,6 +255,12 @@ 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: "满减满折详情",

View File

@@ -34,21 +34,11 @@ const app = {
// 动态添加主界面路由,需要缓存
updateAppRouter(state, routes) {
state.routers.push(...routes);
const useAddRoute = typeof router.addRoute === 'function';
if (useAddRoute) {
(routes || []).forEach(r => router.addRoute(r));
} else {
router.addRoutes(routes);
}
},
// 动态添加全局路由404、500等页面不需要缓存
updateDefaultRouter(state, 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;

View File

@@ -19,9 +19,10 @@
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;
@@ -41,8 +42,3 @@
-webkit-line-clamp: 4;
overflow: hidden;
}
// 为Card组件之间增加间距
.ivu-card + .ivu-card {
margin-top: 10px;
}

View File

@@ -1,3 +1,6 @@
@import "~view-design/src/styles/index.less";
// iview 自定义样式
@primary-color: #ff5c58;
@info-color: #fa6419;
@success-color: #68cabe;
@@ -8,3 +11,9 @@
@table-td-highlight-bg: #ededed;
@font-size-base: 12px;
.ivu-drawer,
.drawer,
.ivu-drawer-wrap {
z-index: 2600 !important;
}

View File

@@ -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 {

View File

@@ -93,3 +93,12 @@ export const REQUIRED = {
required: true,
message:'请填写参数'
}
export const WHITE_SPACE = {
whitespace: true,
message: "不可为纯空格",
}
export const VARCHAR60 = {
pattern: /^.{1,60}$/,
message: '长度应该限制在1-60个字符'
}

View File

@@ -12,7 +12,7 @@
<shrinkable-menu></shrinkable-menu>
</div>
<!-- 顶部标题栏主体 -->
<div class="main-header-con" style="height: 60px">
<div class="main-header-con" :style="{ height: setting.isUseTabsRouter ? '100px' : '60px' }">
<div class="main-header">
<div class="header-avator-con">
<!-- 左侧栏 -->
@@ -37,34 +37,42 @@
</Tooltip>
</li>
</ul>
<t-dropdown>
<Dropdown
transfer
trigger="hover"
@on-click="handleClickUserDropdown"
>
<div class="dropList">
<span class="main-user-name">{{ userInfo.nickName }}</span>
<t-avatar
:image="avatarPath"
<Avatar
icon="ios-person"
:src="avatarPath"
style="background: #fff; margin-left: 10px"
></t-avatar>
></Avatar>
</div>
<t-dropdown-menu>
<t-dropdown-item @click="handleClickUserDropdown('personalCenter')">{{
<DropdownMenu slot="list">
<DropdownItem name="personalCenter">{{
$t("userCenter")
}}</t-dropdown-item>
<t-dropdown-item @click="handleClickUserDropdown('changePass')">{{
}}</DropdownItem>
<DropdownItem name="changePass">{{
$t("changePass")
}}</t-dropdown-item>
<t-dropdown-item @click="handleClickUserDropdown('loginOut')">{{
}}</DropdownItem>
<DropdownItem name="loginOut" divided>{{
$t("logout")
}}</t-dropdown-item>
</t-dropdown-menu>
</t-dropdown>
}}</DropdownItem>
</DropdownMenu>
</Dropdown>
</Row>
</div>
</div>
</div>
</div>
<!-- 已打开的页面标签 -->
<div class="tags-con" v-if="setting.isUseTabsRouter">
<tags-page-opened :pageTagsList="pageTagsList"></tags-page-opened>
</div>
<div class="single-page-con" :style="{ 'top': '60px', height: 'calc(100% - 70px)' }">
</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">
<!-- <keep-alive :include="cachePage"> -->
<router-view></router-view>
@@ -80,6 +88,7 @@
<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";
@@ -93,7 +102,7 @@ const config = require("@/config/index.js");
export default {
components: {
shrinkableMenu,
tagsPageOpened,
messageTip,
circleLoading,
configDrawer
@@ -116,6 +125,9 @@ export default {
loading() {
return this.$store.state.app.loading;
},
pageTagsList() {
return this.$store.state.app.pageOpenedList; // 打开的页面的页面对象
},
avatarPath() {
return localStorage.avatorImgPath;
},
@@ -133,7 +145,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;
@@ -184,7 +196,23 @@ 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;
@@ -197,6 +225,10 @@ export default {
},
},
watch: {
$route(to, from) {
this.checkTag(to.name);
localStorage.currentPageName = to.name;
},
},
mounted() {
this.init();
@@ -207,6 +239,8 @@ export default {
});
},
created() {
// 显示打开的页面的列表
this.$store.commit("setOpenedList");
},
};
</script>

View File

@@ -1,25 +1,51 @@
<template>
<div class="search">
<t-card>
<div class="operation">
<t-button @click="add" theme="primary">添加</t-button>
<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
>
</div>
<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>
</Modal>
</div>
</template>
@@ -32,7 +58,6 @@ import {
} from "@/api/index";
import { regular } from "@/utils";
import { MessagePlugin, DialogPlugin } from "tdesign-vue";
export default {
name: "custom-words",
data() {
@@ -44,7 +69,7 @@ export default {
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 20, // 页面大小
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
words: "",
@@ -61,16 +86,82 @@ export default {
],
},
submitLoading: false, // 添加或编辑提交状态
selectList: [],
selectCount: 0,
selectedRowKeys: [],
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
{ 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 },
// 表头
{
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);
},
},
},
"删除"
),
]);
},
},
],
data: [], // 表单数据
total: 0, // 表单数据总数
@@ -80,25 +171,25 @@ export default {
init() {
this.getDataList();
},
onPaginationChange({ current, pageSize }) {
this.searchForm.pageNumber = current;
this.searchForm.pageSize = pageSize;
changePage(v) {
this.searchForm.pageNumber = v;
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.selectedRowKeys = [];
this.selectList = [];
this.selectCount = 0;
this.$refs.table.selectAll(false);
},
// 选中状态变更
onSelectChange(selectedRowKeys, { selectedRowData }) {
this.selectedRowKeys = selectedRowKeys;
const e = selectedRowData || [];
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
@@ -127,7 +218,7 @@ export default {
insertCustomWords(this.form).then((res) => {
this.submitLoading = false;
if (res.success) {
MessagePlugin.success("操作成功");
this.$Message.success("操作成功");
this.getDataList();
this.modalVisible = false;
}
@@ -138,7 +229,7 @@ export default {
updateCustomWords(this.form).then((res) => {
this.submitLoading = false;
if (res.success) {
MessagePlugin.success("操作成功");
this.$Message.success("操作成功");
this.getDataList();
this.modalVisible = false;
}
@@ -151,8 +242,8 @@ export default {
add() {
this.modalType = 0;
this.modalTitle = "添加";
this.form = { name: "" };
if (this.$refs.form && typeof this.$refs.form.reset === 'function') { this.$refs.form.reset(); }
this.form = {}
this.$refs.form.resetFields();
this.modalVisible = true;
},
@@ -166,14 +257,17 @@ export default {
},
// 删除
remove(v) {
DialogPlugin.confirm({
header: "确认删除",
this.$Modal.confirm({
title: "确认删除",
// 记得确认修改此处
content: "您确认要删除 " + v.name + " ?",
theme: "warning",
onConfirm: () => {
loading: true,
onOk: () => {
// 删除
delCustom(v.id).then((res) => {
this.$Modal.remove();
if (res.success) {
MessagePlugin.success("操作成功");
this.$Message.success("操作成功");
this.getDataList();
}
});
@@ -183,20 +277,24 @@ export default {
// 批量删除
delAll() {
if (this.selectCount <= 0) {
MessagePlugin.warning("您还未选择要删除的数据");
this.$Message.warning("您还未选择要删除的数据");
return;
}
DialogPlugin.confirm({
header: "确认删除",
this.$Modal.confirm({
title: "确认删除",
content: "您确认要删除所选的 " + this.selectCount + " 条数据?",
theme: "warning",
onConfirm: () => {
loading: true,
onOk: () => {
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) {
MessagePlugin.success("操作成功");
this.$Message.success("操作成功");
this.clearSelectAll();
this.getDataList();
}

View File

@@ -1,164 +1,435 @@
<template>
<div>
<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" />
<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>
</div>
</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>
</Modal>
</div>
</template>
<script>
import {editDistribution, getDistributionListData, resumeDistribution, retreatDistribution} from "@/api/distribution";
import {distributionStatusList} from "./dataJson.js";
import { MessagePlugin, DialogPlugin } from "tdesign-vue";
import {regular} from "@/utils";
export default {
name: "distribution",
components: {},
data() {
return {
distributionStatusList,
loading: true,
modalVisible: false,
activeStatus: 'ALL',
distributionStatusList, // 分销状态
loading: true, // 表单加载状态
modalVisible: false, // 添加或编辑显示
distributionForm: {
name: "",
idNumber: "",
settlementBankAccountName: "",
settlementBankAccountNum: "",
settlementBankBranchName: "",
settlementBankBranchName: ""
},
submitLoading: false,
// 表单验证规则
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, // 编辑提交状态
searchForm: {
pageNumber: 1,
pageSize: 20,
memberName: "",
distributionStatus: "",
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
},
columns: [
{ 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) } }, ["编辑"]),
]);
} },
{
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",
},
})
]
);
},
},
],
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(); },
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(); },
// 初始化数据
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();
},
// 获取列表数据
getDataList() {
this.loading = true;
this.searchForm.distributionStatus = this.activeStatus === 'ALL' ? '' : this.activeStatus;
this.searchForm.status = "PASS";
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) {
DialogPlugin.confirm({
header: "确认清退",
this.$Modal.confirm({
title: "提示",
// 记得确认修改此处
content: "您确认要清退 " + v.memberName + " ?",
theme: "warning",
onConfirm: () => {
retreatDistribution(v.id).then((res) => { if (res.success) { MessagePlugin.success("操作成功"); this.getDataList(); } });
loading: true,
onOk: () => {
// 删除
retreatDistribution(v.id).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
}
});
},
});
},
// 恢复分销商
resume(v) {
DialogPlugin.confirm({
header: "确认恢复",
this.$Modal.confirm({
title: "提示",
// 记得确认修改此处
content: "您确认要恢复 " + v.memberName + " ?",
theme: "warning",
onConfirm: () => {
resumeDistribution(v.id).then((res) => { if (res.success) { MessagePlugin.success("操作成功"); this.getDataList(); } });
loading: true,
onOk: () => {
// 删除
resumeDistribution(v.id).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
}
});
},
});
},
// 编辑
edit(v) {
const data = JSON.parse(JSON.stringify(v));
for (let attr in data) { if (data[attr] === null) { data[attr] = ""; } }
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);
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) { MessagePlugin.success("操作成功"); this.getDataList(); this.modalVisible = false; }
if (res.success) {
this.$Message.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>

View File

@@ -1,35 +1,59 @@
<template>
<div>
<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="Number(total)"
:pageSize="searchForm.pageSize"
:pageSizeOptions="[20, 50, 100]"
size="small"
:showJumper="true"
@change="onPaginationChange"
<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"
/>
</div>
</t-card>
</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
: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>
</div>
</template>
<script>
import { auditDistribution, getDistributionListData } from "@/api/distribution";
import { MessagePlugin, DialogPlugin } from "tdesign-vue";
export default {
name: "distributionApply",
@@ -39,31 +63,67 @@ export default {
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 20, // 页面大小
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
startDate: "", // 起始时间
endDate: "", // 终止时间
},
columns: [
{ 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: "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: "action",
key: "action",
align: "center",
fixed: "right",
width: 200,
cell: (h, params) => {
return h("div", { class: "ops" }, [
render: (h, params) => {
return h("div", [
h(
"a",
"Button",
{
props: {
type: "success",
size: "small",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.audit(params.row, "PASS");
@@ -72,10 +132,13 @@ export default {
},
"通过"
),
h("span", {}, "|"),
h(
"a",
"Button",
{
props: {
type: "error",
size: "small",
},
on: {
click: () => {
this.audit(params.row, "REFUSE");
@@ -97,59 +160,56 @@ 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 = 20;
this.searchForm.pageSize = 10;
this.getDataList();
},
// 获取列表数据
getDataList() {
this.loading = true;
this.searchForm.distributionStatus = "APPLY";
getDistributionListData(this.searchForm)
.then((res) => {
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;
});
this.total = this.data.length;
this.loading = false;
},
//审核
audit(v, status) {
let test = "拒绝";
if (status === "PASS") {
if (status == "PASS") {
test = "通过";
}
const params = { status };
DialogPlugin.confirm({
header: "确认" + test,
let params = {
status: status,
};
this.$Modal.confirm({
title: "确认" + test,
// 记得确认修改此处
content: "您确认要" + test + " " + v.memberName + " ?",
theme: "warning",
onConfirm: () => {
loading: true,
onOk: () => {
auditDistribution(v.id, params).then((res) => {
this.$Modal.remove();
if (res.success) {
MessagePlugin.success("操作成功");
this.$Message.success("操作成功");
this.getDataList();
}
});
@@ -162,15 +222,3 @@ 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>

View File

@@ -1,81 +1,64 @@
<template>
<div>
<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" />
<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>
</div>
</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>
</Modal>
</div>
</template>
<script>
import { auditDistributionCash, getDistributionCash } from "@/api/distribution";
import { cashStatusList } from "./dataJson";
import { MessagePlugin, DialogPlugin } from "tdesign-vue";
import {
auditDistributionCash,
getDistributionCash
} from "@/api/distribution";
import { cashStatusList } from './dataJson';
export default {
name: "distributionCash",
data() {
@@ -87,7 +70,7 @@ export default {
result: 'FAIL_AUDITING', // 是否通过
searchForm: { // 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 20, // 页面大小
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
},
@@ -99,65 +82,129 @@ 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: "申请时间",
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: "状态",
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]);
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: "操作",
colKey: "action",
key: "action",
align: "center",
fixed: "right",
width: 130,
cell: (h, params) => {
if (params.row.distributionCashStatus !== "APPLY") {
return h("div", { class: "ops" }, [
render: (h, params) => {
if(params.row.distributionCashStatus != 'APPLY'){
return h("div", [
h(
"a",
"Button",
{
props: {
type: "primary",
size: "small",
},
style: {
marginRight: "5px"
},
on: {
click: () => {
this.view(params.row);
},
},
}
}
},
"查看"
),
]);
}
return h("div", { class: "ops" }, [
}else {
return h("div", [
h(
"a",
"Button",
{
props: {
type: "primary",
size: "small",
},
style: {
marginRight: "5px"
},
on: {
click: () => {
this.edit(params.row);
},
},
}
}
},
"审核"
),
]);
},
},
}
}
}
],
data: [], // 表单数据
total: 0 // 表单数据总数
@@ -178,68 +225,59 @@ 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 = 20;
this.searchForm.pageSize = 10;
this.getDataList();
},
// 获取列表数据
getDataList() {
this.loading = true;
getDistributionCash(this.searchForm)
.then((res) => {
// 带多条件搜索参数获取表单数据 请自行修改接口
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;
});
this.total = this.data.length;
this.loading = false;
},
// 通过还是拒绝申请
handleSubmit() {
let result = "拒绝";
if (this.result === "VIA_AUDITING") {
result = "通过";
let result = "拒绝"
if(this.result == 'VIA_AUDITING'){
result = "通过"
}
DialogPlugin.confirm({
header: "确认审核",
this.$refs.form.validate(valid => {
if (valid) {
this.$Modal.confirm({
title: "确认审核",
content: "您确认要审核"+result+"么?",
theme: "warning",
onConfirm: () => {
this.submitLoading = true;
auditDistributionCash(this.form.id, { result: this.result })
.then((res) => {
this.submitLoading = false;
loading: true,
onOk: () => {
auditDistributionCash(this.form.id,{result:this.result}).then(res => {
if (res.success) {
MessagePlugin.success("审核成功");
this.$Modal.remove();
this.$Message.success("审核成功");
this.getDataList();
this.modalVisible = false;
} else {
this.modalVisible = false;
}
})
.catch(() => {
this.submitLoading = false;
});
},
}
})
}
});
},
// 弹出modal 审核
edit(v) {
this.modalTitle = "审核";
this.handleStatus = 'edit';
if (this.$refs.form && typeof this.$refs.form.reset === 'function') { this.$refs.form.reset(); }
this.$refs.form.resetFields();
// 转换null为""
for (let attr in v) {
if (v[attr] === null) {
@@ -253,7 +291,7 @@ export default {
view(v){
this.modalTitle = "查看";
this.handleStatus = 'view';
if (this.$refs.form && typeof this.$refs.form.reset === 'function') { this.$refs.form.reset(); }
this.$refs.form.resetFields();
// 转换null为""
for (let attr in v) {
if (v[attr] === null) {
@@ -272,15 +310,3 @@ 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>

View File

@@ -1,45 +1,70 @@
<template>
<div>
<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 }">
<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}">
<div>
<div class="div-zoom">
<a @click="linkTo(row.goodsId,row.skuId)">{{row.goodsName}}</a>
</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>
<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>
</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" />
</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
>
</div>
</t-card>
</Modal>
</div>
</template>
<script>
import { delDistributionGoods, getDistributionGoods } from "@/api/distribution";
import { delDistributionGoods, getDistributionGoods,distributionGoodsCheck } from "@/api/distribution";
import vueQr from "vue-qr";
import { MessagePlugin, DialogPlugin } from "tdesign-vue";
export default {
components: {
"vue-qr": vueQr,
@@ -47,75 +72,107 @@ export default {
name: "distributionGoods",
data() {
return {
modalVisible: false, // 添加或编辑显示
modalTitle: "", // 添加或编辑标题
form:{
commission : 1 // 分销金额
},
loading: true, // 表单加载状态
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 20, // 页面大小
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
},
selectList: [],
selectCount: 0,
selectedRowKeys: [],
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
// 表头
{
type: "selection",
width: 60,
align: "center",
fixed: "left",
},
{
title: "商品图片",
fixed: "left",
colKey: "thumbnail",
key: "thumbnail",
width: 120,
align: "center",
cell: (h, p) => h("img", { attrs: { src: p.row.thumbnail || "", alt: "加载图片失败" }, style: { cursor: "pointer", width: "80px", height: "60px", margin: "10px 0", objectFit: "contain" } }),
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",
},
});
},
},
{
title: "商品名称",
colKey: "goodsName",
slot: "goodsName",
minWidth: 200,
tooltip: true,
},
{
title: "商品价格",
colKey: "price",
key: "price",
minWidth: 100,
cell: (h, p) => h("priceColorScheme", { props: { value: p.row.price, color: this.$mainColor } }),
render: (h, params) => {
return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
},
},
{
title: "库存",
colKey: "quantity",
key: "quantity",
minWidth: 80,
},
{
title: "添加时间",
colKey: "createTime",
key: "createTime",
minWidth: 100,
},
{
title: "店铺名称",
colKey: "storeName",
key: "storeName",
minWidth: 100,
tooltip: true,
},
{
title: "佣金金额",
colKey: "commission",
key: "commission",
minWidth: 100,
sortable: false,
cell: (h, p) => h("priceColorScheme", { props: { value: p.row.commission, color: this.$mainColor } }),
render: (h, params) => {
return h("priceColorScheme", {props:{value:params.row.commission,color:this.$mainColor}} );
},
},
{
title: "操作",
colKey: "action",
key: "action",
align: "center",
fixed: "right",
minWidth: 100,
cell: (h, params) => {
return h("div", { class: "ops" }, [
render: (h, params) => {
return h("div", [
h(
"a",
"Button",
{
props: {
type: "error",
size: "small",
},
on: {
click: () => {
this.remove(params.row);
@@ -128,15 +185,53 @@ 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();
@@ -147,55 +242,46 @@ 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 = 20;
this.searchForm.pageSize = 10;
this.getDataList();
},
// 清除选中状态
clearSelectAll() {
this.selectedRowKeys = [];
this.selectList = [];
this.selectCount = 0;
this.$refs.table.selectAll(false);
},
onSelectChange(keys, { selectedRowData }) {
this.selectedRowKeys = keys;
this.selectList = selectedRowData || [];
this.selectCount = keys.length;
// 选中后赋值
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
// 获取列表数据
getDataList() {
this.loading = true;
getDistributionGoods(this.searchForm)
.then((res) => {
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;
});
this.total = this.data.length;
this.loading = false;
},
// 下架商品
remove(v) {
DialogPlugin.confirm({
header: "确认下架",
this.$Modal.confirm({
title: "确认下架",
content: "您确认要下架么?",
theme: "warning",
onConfirm: () => {
loading: true,
onOk: () => {
// 下架
delDistributionGoods(v.id).then((res) => {
this.$Modal.remove();
if (res.success) {
MessagePlugin.success("下架成功");
this.$Message.success("下架成功");
this.getDataList();
}
});
@@ -205,18 +291,23 @@ export default {
// 批量下架
delAll() {
if (this.selectCount <= 0) {
MessagePlugin.warning("您还未选择要下架的数据");
this.$Message.warning("您还未选择要下架的数据");
return;
}
DialogPlugin.confirm({
header: "确认下架",
this.$Modal.confirm({
title: "确认下架",
content: "您确认要下架所选的 " + this.selectCount + " 条数据?",
theme: "warning",
onConfirm: () => {
const ids = (this.selectList || []).map((item) => item.id);
loading: true,
onOk: () => {
let ids = [];
this.selectList.forEach((item) => {
ids.push(item.id);
});
// 批量下架
delDistributionGoods(ids.toString()).then((res) => {
this.$Modal.remove();
if (res.success) {
MessagePlugin.success("下架成功");
this.$Message.success("下架成功");
this.clearSelectAll();
this.getDataList();
}
@@ -230,17 +321,5 @@ 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>

View File

@@ -1,62 +1,68 @@
<template>
<div>
<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 }">
<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">
<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>
</div>
<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>
<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>
</div>
</template>
<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 slot-scope="{row}" slot="distributionOrderStatus">
<Tag :color="filterStatusColor(row.distributionOrderStatus)">{{filterStatus(row.distributionOrderStatus)}}</Tag>
</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>
</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>
</div>
</template>
<script>
import { getDistributionOrder } from "@/api/distribution";
import { orderStatusList } from "./dataJson";
import { getShopListData } from "@/api/shops";
import vueQr from "vue-qr";
import { MessagePlugin } from "tdesign-vue";
import {
getDistributionOrder
} from "@/api/distribution";
import {orderStatusList} from './dataJson'
import vueQr from 'vue-qr'
export default {
name: "distributionOrder",
@@ -65,25 +71,60 @@
},
data() {
return {
timeRange: undefined, // 范围时间
timeRange: [], // 范围时间
orderStatusList, // 订单状态列表
shopList: [], // 店铺列表
distributionId: this.$route.query.id, // 分销id
loading: true, // 表单加载状态
searchForm: { // 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 20, // 页面大小
pageSize: 10, // 页面大小
sort:"create_time",
order:"desc"
},
columns: [
{ 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 },
{
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,
}
],
data: [], // 表单数据
total: 0 // 表单数据总数
@@ -93,78 +134,49 @@
// 初始化数据
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 = 20;
this.searchForm.pageSize = 10;
this.getDataList();
},
// 获取列表数据
getDataList() {
this.searchForm.distributionId = this.distributionId;
this.loading = true;
if (Array.isArray(this.timeRange) && this.timeRange.length === 2) {
const startTime = this.timeRange[0]
const endTime = this.timeRange[1]
if (this.timeRange && this.timeRange[0]) {
let startTime = this.timeRange[0]
let 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) => {
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;
});
this.total = this.data.length;
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: 'NO_COMPLETED', title: '未完成'},
{status: 'WAIT_BILL', title: '待结算'},
{status: 'COMPLETE', title: '完成'},
{status: 'REFUND', title: '退款'},
]
@@ -173,20 +185,21 @@
return arr[i].title;
}
}
return '未完成'; // 默认返回未完成
},
filterStatusColor (status) { // 状态tag标签颜色
const arr = [
{status: 'NO_COMPLETED', color: 'orange'},
{status: 'COMPLETE', color: 'green'},
{status: 'REFUND', color: 'red'},
{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'},
]
for (let i=0;i<arr.length;i++) {
if (arr[i].status === status) {
return arr[i].color;
}
}
return 'orange'; // 默认返回橙色
}
},
mounted() {

View File

@@ -1,23 +1,27 @@
<template>
<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>
<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>
</template>
<script>
import { setSetting, getSetting } from "@/api/index";
import { MessagePlugin } from "tdesign-vue";
import { regular } from "@/utils";
export default {
name: "distributionSetting",
@@ -55,7 +59,7 @@ export default {
submit() {
setSetting("DISTRIBUTION_SETTING", this.form).then((res) => {
if (res.success) {
MessagePlugin.success("操作成功");
this.$Message.success("操作成功");
this.getDataList();
}
});

View File

@@ -1,32 +1,53 @@
<template>
<div class="search">
<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>
<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
>
</div>
<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>
</Modal>
</div>
</template>
@@ -39,7 +60,6 @@ import {
} from "@/api/index";
import {regular} from "@/utils";
import { MessagePlugin, DialogPlugin } from "tdesign-vue";
export default {
name: "goods-unit",
@@ -51,7 +71,7 @@ export default {
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 20, // 页面大小
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
name: "",
@@ -68,16 +88,82 @@ export default {
]
},
submitLoading: false, // 添加或编辑提交状态
selectedRowKeys: [],
selectList: [],
selectCount: 0,
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
{ 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 },
// 表头
{
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);
},
},
},
"删除"
),
]);
},
},
],
data: [], // 表单数据
total: 0, // 表单数据总数
@@ -99,31 +185,20 @@ 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 = 20;
this.searchForm.pageSize = 10;
this.getDataList();
},
// 清除选中
clearSelectAll() {
this.selectedRowKeys = [];
this.selectList = [];
this.selectCount = 0;
this.$refs.table.selectAll(false);
},
// 选中回调
onSelectChange(keys, { selectedRowData }) {
this.selectedRowKeys = keys;
this.selectList = selectedRowData || [];
this.selectCount = keys.length;
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
// 获取列表数据
getDataList() {
@@ -179,10 +254,8 @@ export default {
// 添加
add() {
this.modalTitle = "添加";
this.form = { name: "" };
if (this.$refs.form && typeof this.$refs.form.reset === "function") {
this.$refs.form.reset();
}
this.form = {};
this.$refs.form.resetFields();
this.modalVisible = true;
},
@@ -195,40 +268,53 @@ export default {
},
// 删除
remove(v) {
DialogPlugin.confirm({
header: "确认删除",
this.$Modal.confirm({
title: "确认删除",
// 记得确认修改此处
content: "您确认要删除 " + v.name + " ?",
theme: "warning",
onConfirm: () => {
loading: true,
onOk: () => {
// 删除
delGoodsUnit(v.id).then((res) => {
this.$Modal.remove();
if (res.success) {
MessagePlugin.success("操作成功");
this.$Message.success("操作成功");
this.getDataList();
}
});
},
});
},
// 刷新
refresh() {
this.loading = true;
setTimeout(() => {
this.getDataList();
this.loading = false;
this.$Message.success("刷新成功");
}, 500);
},
// 全部删除
delAll() {
if (this.selectCount <= 0) {
MessagePlugin.warning("您还未选择要删除的数据");
this.$Message.warning("您还未选择要删除的数据");
return;
}
DialogPlugin.confirm({
header: "确认删除",
this.$Modal.confirm({
title: "确认删除",
content: "您确认要删除所选的 " + this.selectCount + " 条数据?",
theme: "warning",
onConfirm: () => {
loading: true,
onOk: () => {
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) {
MessagePlugin.success("操作成功");
this.$Message.success("操作成功");
this.clearSelectAll();
this.getDataList();
}

View File

@@ -0,0 +1,528 @@
/*选择商品品类*/
.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;
}

View File

@@ -1,140 +1,160 @@
<template>
<div class="search">
<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>
<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>
<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>
<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>
<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 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 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>
</div>
</template>
<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>
</t-card>
<t-dialog :visible.sync="modalVisible" header="下架操作" width="500px" :footer="false" @close="modalVisible = false">
</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
>
<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>
</Modal>
</div>
</template>
<script>
import { getGoodsListData,getGoodsNumerData, upGoods, lowGoods, authGoods } from "@/api/goods";
import { getGoodsListData, upGoods, lowGoods } from "@/api/goods";
import vueQr from "vue-qr";
import { MessagePlugin, DialogPlugin } from "tdesign-vue";
export default {
components: {
"vue-qr": vueQr,
@@ -148,72 +168,184 @@ export default {
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 20, // 页面大小
pageSize: 10, // 页面大小
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: [
{ 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 },
{
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);
},
},
},
"查看"
),
]);
}
},
},
],
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) {
@@ -225,42 +357,11 @@ 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 = 20;
this.searchForm.pageSize = 10;
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() {
@@ -273,15 +374,6 @@ 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;
@@ -294,33 +386,27 @@ export default {
},
// 下架
lower() {
let params = {
goodsId: this.id,
reason:this.underForm.reason
};
lowGoods(params).then((res) => {
lowGoods(this.id, this.underForm).then((res) => {
this.$Modal.remove();
if (res.success) {
MessagePlugin.success("操作成功");
this.$Message.success("操作成功");
this.modalVisible = false;
this.getDataList();
this.getNumberData();
}
});
},
// 上架
// 商家
upper(v) {
const dlg = DialogPlugin.confirm({
header: "确认上架",
this.$Modal.confirm({
title: "确认上架",
content: "您确认要上架 " + v.goodsName + " ?",
theme: "warning",
onConfirm: () => {
dlg.hide();
const params = { goodsId: v.id };
upGoods(params).then((res) => {
loading: true,
onOk: () => {
upGoods(v.id).then((res) => {
this.$Modal.remove();
if (res.success) {
MessagePlugin.success("上架成功");
this.$Message.success("上架成功");
this.getDataList();
this.getNumberData();
}
});
},
@@ -331,229 +417,13 @@ export default {
showDetail(v) {
let id = v.id;
this.$options.filters.customRouterPush({
name: "goods-detail",
name: "goods-publish",
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