圣诞快乐

# v1.3 更新列表
    1. 【新增】砍价
	2. 【新增】拼团
	3. 【新增】一号通
	4. 【修复】商品sku 编辑时出现商品属性对应错误的问题
	5. 【修复】商品推广海报生成二维码可能会出错的问题【小程序调试中】
	6. 【修复】微信公众号和小程序头像可能获取不到的问题
	7. 【修复】下单时可能会出错的问题
	8. 【修复】pc管理端用户访问量
	9. 【修复】微信退款
	10. 【修复】管理端订单状态可能出现不正确的情况
	11. 【修复】WEB管理端-菜单色调,短信API更新,首页用户访问量,系统设置tab是自动选择下一及表单
	12. 【修复】系统设置出现更新不正确的问题
This commit is contained in:
stivepeim
2020-12-23 15:56:45 +08:00
parent f3975936c2
commit 0d32da772d
768 changed files with 40200 additions and 46123 deletions

View File

@@ -3,7 +3,6 @@ ENV = 'development'
# base api
# VUE_APP_BASE_API = '/dev-api'
# VUE_APP_BASE_API = 'https://api.java.crmeb.net'
VUE_APP_BASE_API = 'http://127.0.0.1:8080'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,

View File

@@ -3,5 +3,5 @@ ENV = 'production'
# base api
# VUE_APP_BASE_API = '/prod-api'
VUE_APP_BASE_API = 'https://api.java.crmeb.net'
VUE_APP_BASE_API = 'http://127.0.0.1'

View File

@@ -1,38 +1,3 @@
~~~
## 开发
```bash
# 克隆项目
git clone https://gitee.com/ZhongBangKeJi/crmeb_java/
# 进入项目目录
cd ##
# 安装依赖
npm install
# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题
npm install --registry=https://registry.npm.taobao.org
# 启动服务
npm run dev
```
浏览器访问 http://localhost:9527
## 发布
```bash
# 构建测试环境
npm run build:stage
# 构建生产环境
npm run build:prod
```
公用组件
无限极分类组件 src/components/Category
使用范围:菜单,文章等各种分类配置数据

258
admin/README.md Normal file
View File

@@ -0,0 +1,258 @@
# CRMEB Admin
## 开发规范
统一使用ES6 语法
方法注释
/*
* th => 表头
* data => 数据
* fileName => 文件名
* fileType => 文件类型
* sheetName => sheet页名
*/
export default function toExcel ({ th, data, fileName, fileType, sheetName })
行注释 //
### 命名
页面目录 文件夹命名格式骆驼式命名法,例如:用户列表 userList
例如:商品模块
store 商品
├─ store 商品管理
├─index.vue 首页
├─ creatStore 新建商品
├─ index.vue
├─ sort 商品分类
├─ index.vue
├─storeAttr 商品规格
├─ index.vue
├─storeComment 商品评论
├─ index.vue
页面命名、组建、文件夹 命名格式小驼峰命名法,例如:用户列表 userList
类名函数命名 大驼峰式 例如addUser
变量命名 小驼峰式 例如user 或者 userInfo
常量 采用全大些下划线命名 例如VUE_APP_API_URl
### 文件管理规范
views 页面模块必须件文件夹区分
api 接口一个模块一个文件
组建 一个组建一个文件夹
plugins 插件一个插件一个文件夹
vuex 路由状态管理一个模块在modules 中建一个文件夹
router 一个模块一个模块在modules 中建一个文件夹
style 样式尽量采用iView自带组建common.less 系统通用样式不要轻易动
自定义通用样式 style.less,每次添加必须加注释页面独立样式在在页面内写后缀less 格式
组建样式 styles 中添加文件夹 composents 对应components 目录新建样式文件
utils 自定义工具js 独立命名,一般不用新建文件夹
## 模块命名
~~~
├─ login 登录
├─ dashboard 首页
├─ store 商品管理
├─ order 系统订单管理
├─ distribution 分销
├─ user 用户管理
├─ content 内容管理
├─ appSetting 各个应用模块功能管理公众号、小程序、支付宝、百度小程序、今日头条小程序
├─ marketing 营销管理 优惠劵 积分 秒杀
├─ sms 设置 短信设置
├─ systemSetting 设置 管理员权限 系统设置 物流设置
├─ maintain 维护 配置分类 组合数据 表单配置
├─ error-page 错误页
~~~
## 目录结构
主要目录结构及说明:
~~~
├── public # 静态资源
│ ├── favicon.ico # favicon图标
│ └── index.html # html 模板
│ └── UEditor # 富文本编辑器插件
├── src # 源代码
│ ├── api # 所有请求
│ │ └──user.js # 有关登录/用户的接口
│ │ └──article.js # 有关内容的接口
│ │ └──categoryApi.js # 有关配置的接口
│ │ └──configTabApi.js # 有关配置分类的接口
│ │ └──dashboard.js # 有关统计的接口
│ │ └──distribution.js # 有关分销的接口
│ │ └──logistics.js # 有关城市数据、物流配置的接口
│ │ └──marketing.js # 有关优惠券、秒杀的接口
│ │ └──order.js # 有关订单的接口
│ │ └──role.js # 有关权限的接口
│ │ └──roleApi.js # 有关菜单的接口
│ │ └──sms.js # 有关短信的接口
│ │ └──store.js # 有关商品的接口
│ │ └──storePoint.js # 有关提货点的接口
│ │ └──productCreateApi.js # 有关附件上传的接口
│ │ └──systemadmin.js # 有关管理员的接口
│ │ └──systemConfig.js # 有关系统配置的接口
│ │ └──systemFormConfig.js # 有关表单配置的接口
│ │ └──systemGroup.js # 有关组合数据的接口
│ │ └──systemSetting.js # 有关上传文件的接口
│ │ └──user.js # 有关用户的接口
│ │ └──wxApi.js # 有关微信的接口
│ ├── assets # 图片、svg 等静态资源
│ ├── components # 公共组件
│ │ └──articleList # 文章列表
│ │ └──attrFrom # 商品规格
│ │ └──Breadcrumb # 头部标题标签
│ │ └──cards # 统计小方块
│ │ └──echarts # 统计图
│ │ └──Category # 分类
│ │ └──customerInfo # 用户列表
│ │ └──FormGenerator # 表单配置
│ │ └──couponList # 优惠劵列表
│ │ └──goodsList # 商品列表
│ │ └──Hamburger # 导航收缩组件
│ │ └──HeaderSearch # 导航搜索组件
│ │ └──iconFrom # 导航添加图标
│ │ └──RightPanel # 右侧设置按钮,设置导航相关
│ │ └──Screenfull # 全屏
│ │ └──SvgIcon # svg图标
│ │ └──Tinymce # 颜色选择
│ │ └──ThemePicker # 右侧设置按钮,设置组题颜色
│ │ └──templatesFrom # 运费模板
│ │ └──ueditorFrom # 富文本编辑器
│ │ └──uploadPicture # 上传图片组件
│ │ └──Upload # 上传文件组件
│ │ └──UploadExcel # 下载Excel
│ │ └──userList # 用户列表
│ │ └──TimeSelect # 时间段选择
│ ├── layouts # 导航布局
│ │ ├──index # 主页面
│ │ ├──components # 导航组件
│ │ └──Settings # 右边小按钮,设置导航等
│ │ └──Sidebar # 侧边导航
│ │ └──TagsView # tab标签页导航
│ │ └──Navbar # 头部导航
│ │ └──AppMain # 导航路由
│ │ └──index.js # 组件引用
│ │ └──mixins # 自适应大小
│ ├── libs # 公共js方法
│ │ └──settingMer # 配置请求地址
│ ├── views # 所有页面
│ │ └──login # 登录
│ │ └──index # 登录
│ │ └──dashboard # 首页
│ │ └──store # 商品
│ │ └──creatStore # 添加商品
│ │ └──storeAttr # 商品规格
│ │ └──sort # 商品分类
│ │ └──taoBao # 复制商品
│ │ └──storeComment # 商品评论
│ │ └──order # 订单管理
│ │ └──marketing # 营销
│ │ └──coupon # 优惠劵
│ │ └──systemSetting # 设置
│ │ └──administratorAuthority # 管理权限
│ │ └──adminList # 管理员列表
│ │ └──identityManager# 身份管理
│ │ └──permissionRules# 权限规则
│ │ └──logistics # 物流设置
│ │ └──cityList # 城市数据
│ │ └──companyList # 物流公司
│ │ └──config # 物流配置
│ │ └──shippingTemplates # 运费模板
│ │ └──setting # 系统设置
│ │ └──systemStore # 提货点设置
│ │ └──appSetting # 应用 小程序 公众号设置
│ │ └──content # 内容
│ │ └──article # 文章管理
│ │ └──articleclass # 文章分类
│ │ └──datas # 统计数据
│ │ └──user # 用户
│ │ └──list # 用户管理
│ │ └──grade # 用户等级/标签
│ │ └──group # 用户分组
│ │ └──distribution # 分销设置
│ │ └──maintain # 维护
│ │ └──devconfig # 组合数据
│ │ └──formConfig # 表单配置
│ │ └──financial # 财务
│ │ └──error-page # 错误页
│ │ └──404 # 错误页404
│ │ └──403 # 错误页403
│ ├── filters # 过滤器
│ ├── router # 路由配置
│ │ └──modules # 页面路由模块
│ │ └──content.js # 有关内容 文章
│ │ └──user.js # 有关用户
│ │ └──appSetting.js # 有关应用
│ │ └──marketing.js # 有关优惠券、秒杀
│ │ └──distribution.js # 有关分销
│ │ └──order.js # 有关订单
│ │ └──financial.js # 有关财务
│ │ └──store.js # 有关商品
│ │ └──maintain.js # 有关维护
│ │ └──operation.js # 有关设置
│ │ └──index.js # 路由的汇总
│ ├── store # Vuex 状态管理
│ ├── utils # 全局公用方法
│ │ └──request.js # 请求封装
│ │ └──settingMer.js # 请求地址配置
│ ├── styles # 样式管理
│ ├── permission.js # 路由拦截
│ ├── main.js # 入口文件 加载组件 初始化等
│ └── App.vue # 入口页面
├── tests # 测试
├── .env.xxx # 环境变量配置
├── .eslintrc.js # eslint 配置项
├── .babelrc # babel-loader 配置
├── .travis.yml # 自动化CI配置
├── vue.config.js # vue-cli 配置
├── postcss.config.js # postcss 配置
└── package.json # package.json
~~~
## 开发
```bash
# 克隆项目
git clone https://gitee.com/ZhongBangKeJi/crmeb_java/
# 进入项目目录
cd ##
# 安装依赖
npm install
# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题
npm install --registry=https://registry.npm.taobao.org
# 启动服务
npm run dev
```
浏览器访问 http://localhost:9527
## 发布
```bash
# 构建测试环境
npm run build:stage
# 构建生产环境
npm run build:prod
```
## 其它
```bash
# 预览发布环境效果
npm run preview
# 预览发布环境效果 + 静态资源分析
npm run preview -- --report
# 代码格式检查
npm run lint
# 代码格式检查并自动修复
npm run lint -- --fix
```

258
admin/README.zh-CN.md Normal file
View File

@@ -0,0 +1,258 @@
# CRMEB Admin
## 开发规范
统一使用ES6 语法
方法注释
/*
* th => 表头
* data => 数据
* fileName => 文件名
* fileType => 文件类型
* sheetName => sheet页名
*/
export default function toExcel ({ th, data, fileName, fileType, sheetName })
行注释 //
### 命名
页面目录 文件夹命名格式骆驼式命名法,例如:用户列表 userList
例如:商品模块
store 商品
├─ store 商品管理
├─index.vue 首页
├─ creatStore 新建商品
├─ index.vue
├─ sort 商品分类
├─ index.vue
├─storeAttr 商品规格
├─ index.vue
├─storeComment 商品评论
├─ index.vue
页面命名、组建、文件夹 命名格式小驼峰命名法,例如:用户列表 userList
类名函数命名 大驼峰式 例如addUser
变量命名 小驼峰式 例如user 或者 userInfo
常量 采用全大些下划线命名 例如VUE_APP_API_URl
### 文件管理规范
views 页面模块必须件文件夹区分
api 接口一个模块一个文件
组建 一个组建一个文件夹
plugins 插件一个插件一个文件夹
vuex 路由状态管理一个模块在modules 中建一个文件夹
router 一个模块一个模块在modules 中建一个文件夹
style 样式尽量采用iView自带组建common.less 系统通用样式不要轻易动
自定义通用样式 style.less,每次添加必须加注释页面独立样式在在页面内写后缀less 格式
组建样式 styles 中添加文件夹 composents 对应components 目录新建样式文件
utils 自定义工具js 独立命名,一般不用新建文件夹
## 模块命名
~~~
├─ login 登录
├─ dashboard 首页
├─ store 商品管理
├─ order 系统订单管理
├─ distribution 分销
├─ user 用户管理
├─ content 内容管理
├─ appSetting 各个应用模块功能管理公众号、小程序、支付宝、百度小程序、今日头条小程序
├─ marketing 营销管理 优惠劵 积分 秒杀
├─ sms 设置 短信设置
├─ systemSetting 设置 管理员权限 系统设置 物流设置
├─ maintain 维护 配置分类 组合数据 表单配置
├─ error-page 错误页
~~~
## 目录结构
主要目录结构及说明:
~~~
├── public # 静态资源
│ ├── favicon.ico # favicon图标
│ └── index.html # html 模板
│ └── UEditor # 富文本编辑器插件
├── src # 源代码
│ ├── api # 所有请求
│ │ └──user.js # 有关登录/用户的接口
│ │ └──article.js # 有关内容的接口
│ │ └──categoryApi.js # 有关配置的接口
│ │ └──configTabApi.js # 有关配置分类的接口
│ │ └──dashboard.js # 有关统计的接口
│ │ └──distribution.js # 有关分销的接口
│ │ └──logistics.js # 有关城市数据、物流配置的接口
│ │ └──marketing.js # 有关优惠券、秒杀的接口
│ │ └──order.js # 有关订单的接口
│ │ └──role.js # 有关权限的接口
│ │ └──roleApi.js # 有关菜单的接口
│ │ └──sms.js # 有关短信的接口
│ │ └──store.js # 有关商品的接口
│ │ └──storePoint.js # 有关提货点的接口
│ │ └──productCreateApi.js # 有关附件上传的接口
│ │ └──systemadmin.js # 有关管理员的接口
│ │ └──systemConfig.js # 有关系统配置的接口
│ │ └──systemFormConfig.js # 有关表单配置的接口
│ │ └──systemGroup.js # 有关组合数据的接口
│ │ └──systemSetting.js # 有关上传文件的接口
│ │ └──user.js # 有关用户的接口
│ │ └──wxApi.js # 有关微信的接口
│ ├── assets # 图片、svg 等静态资源
│ ├── components # 公共组件
│ │ └──articleList # 文章列表
│ │ └──attrFrom # 商品规格
│ │ └──Breadcrumb # 头部标题标签
│ │ └──cards # 统计小方块
│ │ └──echarts # 统计图
│ │ └──Category # 分类
│ │ └──customerInfo # 用户列表
│ │ └──FormGenerator # 表单配置
│ │ └──couponList # 优惠劵列表
│ │ └──goodsList # 商品列表
│ │ └──Hamburger # 导航收缩组件
│ │ └──HeaderSearch # 导航搜索组件
│ │ └──iconFrom # 导航添加图标
│ │ └──RightPanel # 右侧设置按钮,设置导航相关
│ │ └──Screenfull # 全屏
│ │ └──SvgIcon # svg图标
│ │ └──Tinymce # 颜色选择
│ │ └──ThemePicker # 右侧设置按钮,设置组题颜色
│ │ └──templatesFrom # 运费模板
│ │ └──ueditorFrom # 富文本编辑器
│ │ └──uploadPicture # 上传图片组件
│ │ └──Upload # 上传文件组件
│ │ └──UploadExcel # 下载Excel
│ │ └──userList # 用户列表
│ │ └──TimeSelect # 时间段选择
│ ├── layouts # 导航布局
│ │ ├──index # 主页面
│ │ ├──components # 导航组件
│ │ └──Settings # 右边小按钮,设置导航等
│ │ └──Sidebar # 侧边导航
│ │ └──TagsView # tab标签页导航
│ │ └──Navbar # 头部导航
│ │ └──AppMain # 导航路由
│ │ └──index.js # 组件引用
│ │ └──mixins # 自适应大小
│ ├── libs # 公共js方法
│ │ └──settingMer # 配置请求地址
│ ├── views # 所有页面
│ │ └──login # 登录
│ │ └──index # 登录
│ │ └──dashboard # 首页
│ │ └──store # 商品
│ │ └──creatStore # 添加商品
│ │ └──storeAttr # 商品规格
│ │ └──sort # 商品分类
│ │ └──taoBao # 复制商品
│ │ └──storeComment # 商品评论
│ │ └──order # 订单管理
│ │ └──marketing # 营销
│ │ └──coupon # 优惠劵
│ │ └──systemSetting # 设置
│ │ └──administratorAuthority # 管理权限
│ │ └──adminList # 管理员列表
│ │ └──identityManager# 身份管理
│ │ └──permissionRules# 权限规则
│ │ └──logistics # 物流设置
│ │ └──cityList # 城市数据
│ │ └──companyList # 物流公司
│ │ └──config # 物流配置
│ │ └──shippingTemplates # 运费模板
│ │ └──setting # 系统设置
│ │ └──systemStore # 提货点设置
│ │ └──appSetting # 应用 小程序 公众号设置
│ │ └──content # 内容
│ │ └──article # 文章管理
│ │ └──articleclass # 文章分类
│ │ └──datas # 统计数据
│ │ └──user # 用户
│ │ └──list # 用户管理
│ │ └──grade # 用户等级/标签
│ │ └──group # 用户分组
│ │ └──distribution # 分销设置
│ │ └──maintain # 维护
│ │ └──devconfig # 组合数据
│ │ └──formConfig # 表单配置
│ │ └──financial # 财务
│ │ └──error-page # 错误页
│ │ └──404 # 错误页404
│ │ └──403 # 错误页403
│ ├── filters # 过滤器
│ ├── router # 路由配置
│ │ └──modules # 页面路由模块
│ │ └──content.js # 有关内容 文章
│ │ └──user.js # 有关用户
│ │ └──appSetting.js # 有关应用
│ │ └──marketing.js # 有关优惠券、秒杀
│ │ └──distribution.js # 有关分销
│ │ └──order.js # 有关订单
│ │ └──financial.js # 有关财务
│ │ └──store.js # 有关商品
│ │ └──maintain.js # 有关维护
│ │ └──operation.js # 有关设置
│ │ └──index.js # 路由的汇总
│ ├── store # Vuex 状态管理
│ ├── utils # 全局公用方法
│ │ └──request.js # 请求封装
│ │ └──settingMer.js # 请求地址配置
│ ├── styles # 样式管理
│ ├── permission.js # 路由拦截
│ ├── main.js # 入口文件 加载组件 初始化等
│ └── App.vue # 入口页面
├── tests # 测试
├── .env.xxx # 环境变量配置
├── .eslintrc.js # eslint 配置项
├── .babelrc # babel-loader 配置
├── .travis.yml # 自动化CI配置
├── vue.config.js # vue-cli 配置
├── postcss.config.js # postcss 配置
└── package.json # package.json
~~~
## 开发
```bash
# 克隆项目
git clone https://gitee.com/ZhongBangKeJi/crmeb_java/
# 进入项目目录
cd ##
# 安装依赖
npm install
# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题
npm install --registry=https://registry.npm.taobao.org
# 启动服务
npm run dev
```
浏览器访问 http://localhost:9527
## 发布
```bash
# 构建测试环境
npm run build:stage
# 构建生产环境
npm run build:prod
```
## 其它
```bash
# 预览发布环境效果
npm run preview
# 预览发布环境效果 + 静态资源分析
npm run preview -- --report
# 代码格式检查
npm run lint
# 代码格式检查并自动修复
npm run lint -- --fix
```

View File

@@ -37,7 +37,7 @@
'bold', 'italic', 'underline', 'strikethrough', '|', 'superscript', 'subscript', '|', 'forecolor', 'backcolor', '|',
'removeformat', '|', 'insertorderedlist', 'insertunorderedlist', '|', 'selectall', 'cleardoc', 'paragraph', '|',
'fontfamily', 'fontsize', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|',
'horizontal', 'print', 'preview', 'fullscreen'
'horizontal', 'fullscreen'
]],
// toolbars: [[
// 'source', '|', 'undo', 'redo', '|',

View File

@@ -125,3 +125,14 @@ export function categroyByIds(pram) {
params: data
})
}
/**
* 修改 显示关闭状态
* @param pram
*/
export function categroyUpdateStatus(id) {
return request({
url: `/admin/category/updateStatus/${id}`,
method: 'GET'
})
}

View File

@@ -84,6 +84,18 @@ export function topUpLogDeleteApi(params) {
})
}
/**
* 充值 退款
* @param pram
*/
export function refundApi(data) {
return request({
url: '/admin/user/topUpLog/refund',
method: 'post',
data
})
}
/**
* 资金监控 列表
* @param pram

View File

@@ -53,12 +53,29 @@ export function expressList(data) {
})
}
// 同步物流公司
export function expressSyncApi() {
return request({
url: '/admin/express/sync/express',
method: 'post'
})
}
// 物流公司修改状态
export function expressUpdateShow(data) {
return request({
url: '/admin/express/update/show',
method: 'post',
data
})
}
// 物流公司 编辑
export function expressUpdate(data) {
return request({
url: '/admin/express/update',
method: 'post',
params: { ...data }
data
})
}

View File

@@ -230,3 +230,212 @@ export function seckillConfigStatusApi(id,params) {
params
})
}
/**
* 砍价商品 列表
*/
export function bargainListApi(params) {
return request({
url: `/admin/store/bargain/list`,
method: 'get',
params
})
}
/**
* 砍价商品 新增
*/
export function bargainSaveApi(data) {
return request({
url: `/admin/store/bargain/save`,
method: 'POST',
data
})
}
/**
* 砍价商品 详情
*/
export function bargainInfoApi(params) {
return request({
url: `/admin/store/bargain/info`,
method: 'get',
params
})
}
/**
* 砍价商品 编辑
*/
export function bargainUpdateApi(params, data) {
return request({
url: `/admin/store/bargain/update`,
method: 'post',
params,
data
})
}
/**
* 砍价商品 删除
*/
export function bargainDeleteApi(params) {
return request({
url: `/admin/store/bargain/delete`,
method: 'get',
params
})
}
/**
* 砍价列表 详情
*/
export function bargainOrderPinkApi(id) {
return request({
url: `/admin/store/bargain/bargain_list/${id}`,
method: 'get'
})
}
/**
* 砍价列表 列表
*/
export function bargainListListApi(params) {
return request({
url: `/admin/store/bargain/bargain_list`,
method: 'get',
params
})
}
/**
* 拼团商品 修改拼团状态
*/
export function bargainStatusApi(params) {
return request({
url: `/admin/store/bargain/update/status`,
method: 'post',
params
})
}
/**
* 拼团商品 列表
*/
export function combinationListApi(params) {
return request({
url: `/admin/store/combination/list`,
method: 'get',
params
})
}
/**
* 拼团商品 删除
*/
export function combinationDeleteApi(params) {
return request({
url: `/admin/store/combination/delete`,
method: 'get',
params
})
}
/**
* 拼团商品 新增
*/
export function combinationSaveApi(data) {
return request({
url: `/admin/store/combination/save`,
method: 'post',
data
})
}
/**
* 拼团商品 修改
*/
export function combinationUpdateApi(params,data) {
return request({
url: `/admin/store/combination/update`,
method: 'post',
params,
data
})
}
/**
* 拼团商品 详情
*/
export function combinationInfoApi(params) {
return request({
url: `/admin/store/combination/info`,
method: 'get',
params
})
}
/**
* 拼团商品 修改拼团状态
*/
export function combinationStatusApi(params) {
return request({
url: `/admin/store/combination/update/status`,
method: 'post',
params
})
}
/**
* 拼团列表 列表
*/
export function combineListApi(params) {
return request({
url: `/admin/store/combination/combine/list`,
method: 'get',
params
})
}
/**
* 拼团列表 统计
*/
export function combineStatisticsApi(params) {
return request({
url: `/admin/store/combination/statistics`,
method: 'get',
params
})
}
/**
* 拼团列表 详情
*/
export function combineOrderPinkApi(id) {
return request({
url: `/admin/store/combination/order_pink/${id}`,
method: 'get'
})
}
/**
* 砍价 导出
*/
export function exportBargainApi(params) {
return request({
url: `/admin/export/excel/bargain/product`,
method: 'get',
params
})
}
/**
* 拼团 导出
*/
export function exportcombiantionApi(params) {
return request({
url: `/admin/export/excel/combiantion/product`,
method: 'get',
params
})
}

View File

@@ -78,11 +78,11 @@ export function orderMarkApi(params) {
* 订单 发货
* @param pram
*/
export function orderSendApi(params) {
export function orderSendApi(data) {
return request({
url: '/admin/store/order/send',
method: 'get',
params
method: 'post',
data
})
}
@@ -174,3 +174,24 @@ export function orderTimeApi(params) {
params
})
}
/**
*面单默认配置信息
*/
export function sheetInfoApi() {
return request({
url: `/admin/store/order/sheet/info`,
method: 'get'
})
}
/**
*面单默认配置信息
*/
export function getLogisticsInfoApi(params) {
return request({
url: `/admin/store/order/getLogisticsInfo`,
method: 'get',
params
})
}

View File

@@ -4,7 +4,7 @@ import request from '@/utils/request'
*/
export function smsLstApi(params) {
return request({
url: '/admin/sms/record/list',
url: '/admin/pass/user/record',
method: 'get',
params
})
@@ -12,30 +12,31 @@ export function smsLstApi(params) {
/**
* @description 短信账户 -- 登录
*/
export function configApi(params) {
export function configApi(data) {
return request({
url: '/admin/sms/login',
method: 'get',
params
url: '/admin/pass/login',
method: 'post',
data
})
}
/**
* @description 短信账户 -- 获取验证码
*/
export function captchaApi(phone) {
export function captchaApi(params) {
return request({
url: `/admin/sms/sendCodeForRegister/${phone}`,
method: 'get'
url: `/admin/pass/sendUserCode`,
method: 'get',
params
})
}
/**
* @description 短信账户 -- 注册
*/
export function registerApi(params) {
export function registerApi(data) {
return request({
url: '/admin/sms/register',
url: '/admin/pass/register',
method: 'post',
params
data
})
}
/**
@@ -43,7 +44,7 @@ export function registerApi(params) {
*/
export function isLoginApi() {
return request({
url: '/admin/sms/islogin',
url: '/admin/pass/isLogin',
method: 'get'
})
}
@@ -52,7 +53,7 @@ export function isLoginApi() {
*/
export function logoutApi() {
return request({
url: '/admin/sms/logout',
url: '/admin/pass/logout',
method: 'get'
})
}
@@ -70,7 +71,7 @@ export function smsNumberApi() {
*/
export function smsTempLstApi(params) {
return request({
url: '/admin/sms/temp/list',
url: '/admin/sms/temps',
method: 'get',
params
})
@@ -80,7 +81,7 @@ export function smsTempLstApi(params) {
*/
export function smsPriceApi(params) {
return request({
url: '/admin/sms/pay/list',
url: '/admin/pass/meal/list',
method: 'get',
params
})
@@ -88,21 +89,21 @@ export function smsPriceApi(params) {
/**
* @description 短信购买 -- 支付码
*/
export function payCodeApi(params) {
export function payCodeApi(data) {
return request({
url: '/admin/sms/pay/qrCode',
method: 'get',
params
url: '/admin/pass/meal/code',
method: 'post',
data
})
}
/**
* @description 短信模板 -- 添加表单
*/
export function tempCreateApi(params) {
export function tempCreateApi(data) {
return request({
url: '/admin/sms/temp/apply',
method: 'post',
params
data
})
}
/**
@@ -110,7 +111,7 @@ export function tempCreateApi(params) {
*/
export function smsInfoApi() {
return request({
url: '/admin/sms/info',
url: '/admin/pass/info',
method: 'get'
})
}
@@ -125,3 +126,68 @@ export function smsSaveApi(params) {
params
})
}
/**
* @description 短信 -- 修改密码
*/
export function updatePasswordApi(data) {
return request({
url: '/admin/pass/update/password',
method: 'post',
data
})
}
/**
* @description 短信 -- 修改手机号
*/
export function updateHoneApi(data) {
return request({
url: '/admin/pass/update/phone',
method: 'post',
data
})
}
/**
* @description 一号通 -- 服务开通
*/
export function serviceOpenApi(data) {
return request({
url: '/admin/pass/service/open',
method: 'post',
data
})
}
/**
* @description 一号通 -- 电子面单模板
*/
export function exportTempApi(params) {
return request({
url: '/admin/express/template',
method: 'get',
params
})
}
/**
* @description 全部物流公司
*/
export function expressAllApi() {
return request({
url: 'admin/express/all',
method: 'get'
})
}
/**
* @description 修改签名
*/
export function smsSignApi(data) {
return request({
url: 'admin/sms/modify/sign',
method: 'post',
data
})
}

View File

@@ -252,3 +252,26 @@ export function restoreApi(id) {
method: 'get'
})
}
/**
* 商品列表 导出
* @param pram
*/
export function productExcelApi(params) {
return request({
url: `/admin/export/excel/product`,
method: 'get',
params
})
}
/**
* 商品列表 获取复制商品配置
* @param pram
*/
export function copyConfigApi() {
return request({
url: `/admin/store/product/copy/config`,
method: 'post'
})
}

View File

@@ -47,6 +47,18 @@ export function storeDeleteApi(data) {
})
}
/**
* 提货点门店回收站刪除
* @param pram
*/
export function allDeleteApi(params) {
return request({
url: '/admin/system/store/completely/delete',
method: 'get',
params
})
}
/**
* 提货点添加
* @param pram
@@ -85,6 +97,18 @@ export function storeUpdateApi(data,id) {
})
}
/**
* 提货点恢复
* @param pram
*/
export function storeRecoveryApi(params) {
return request({
url: '/admin/system/store/recovery',
method: 'get',
params
})
}
/**
* 核销员分页列表
* @param pram

View File

@@ -346,3 +346,14 @@ export function captchaApi() {
method: 'get'
})
}
/**
* @description 修改上级推广人
*/
export function updateSpreadApi(data) {
return request({
url: `/admin/user/update/spread`,
method: 'post',
data
})
}

View File

@@ -123,6 +123,17 @@ export function replySaveApi(data) {
})
}
/**
* 关键字回复 修改状态
* @param pram
*/
export function replyStatusApi(params) {
return request({
url: `/admin/wechat/keywords/reply/status`,
method: 'post',
params
})
}
/**
* 关键字回复 编辑
* @param pram

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -20,12 +20,15 @@
<el-form inline size="small">
<el-form-item>
<el-select v-model="listPram.status" placeholder="状态" class="selWidth">
<el-option
v-for="item in constants.roleListStatus"
:key="item.value"
:label="item.label"
:value="item.value"
/>
<el-option label="全部" :value="-1"></el-option>
<el-option label="显示" :value="1"></el-option>
<el-option label="不显示" :value="0"></el-option>
<!--<el-option-->
<!--v-for="item in constants.roleListStatus"-->
<!--:key="item.value"-->
<!--:label="item.label"-->
<!--:value="item.value"-->
<!--/>-->
</el-select>
</el-form-item>
<el-form-item>
@@ -78,11 +81,26 @@
</template>
</el-table-column>
<el-table-column label="排序" prop="sort" min-width="150" />
<el-table-column label="启用状态" width="150">
<el-table-column
label="状态"
min-width="150"
>
<template slot-scope="scope">
<span>{{ scope.row.status | filterYesOrNo }}</span>
<el-switch
v-model="scope.row.status"
:active-value="true"
:inactive-value="false"
active-text="显示"
inactive-text="隐藏"
@change="onchangeIsShow(scope.row)"
/>
</template>
</el-table-column>
<!--<el-table-column label="启用状态" width="150">-->
<!--<template slot-scope="scope">-->
<!--<span>{{ scope.row.status | filterYesOrNo }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column label="操作" min-width="200" fixed="right">
<template slot-scope="scope">
<el-button
@@ -201,6 +219,12 @@ export default {
// }
},
methods: {
onchangeIsShow(row){
categoryApi.categroyUpdateStatus( row.id ).then(() => {
this.$message.success('修改成功')
this.handlerGetTreeList()
})
},
handleEditMenu(rowData) {
this.editDialogConfig.isCreate = 1
this.editDialogConfig.data = rowData

View File

@@ -2,6 +2,7 @@
<div>
<parser
v-if="formConf.fields.length > 0"
v-loading="loading"
:is-edit="isCreate === 1"
:form-conf="formConf"
:form-edit-data="editData"
@@ -40,6 +41,7 @@ export default {
},
data() {
return {
loading: false,
formConf: { fields: [] }
}
},
@@ -48,9 +50,13 @@ export default {
},
methods: {
handlerGetFormConfig(formId) { // 获取表单配置后生成table列
this.loading = true
const _pram = { id: formId }
systemFormConfigApi.getFormConfigInfo(_pram).then(data => {
this.formConf = JSON.parse(data.content)
this.loading = false
}).catch(()=>{
this.loading = false
})
},
handlerSubmit(formValue) {

View File

@@ -14,7 +14,7 @@
// type: Object,
// default: null
// },
series: {
seriesData: {
type: Array,
default: () => []
},
@@ -26,6 +26,10 @@
type: String,
default: ''
},
yAxisData: {
type: Array,
default: () => []
},
legendData: {
type: Array,
default: () => []
@@ -35,11 +39,11 @@
return {
styles: 'height:300px',
infoLists: this.infoList,
seriesArray: this.series
seriesArray: this.seriesData
}
},
watch: {
series: {
seriesData: {
handler(newVal, oldVal) {
this.seriesArray = newVal;
this.handleSetVisitChart();
@@ -83,7 +87,7 @@
type: 'pie',
radius: '70%',
center: ['50%', '60%'],
data: this.series || [],
data: this.seriesArray || [],
emphasis: {
itemStyle: {
shadowBlur: 10,
@@ -100,9 +104,9 @@
trigger: 'axis'
},
toolbox: {},
// legend: {
// data: this.infoLists.legend || []
// },
legend: {
data: this.legendData || []
},
color: ['#1495EB', '#00CC66', '#F9D249', '#ff9900', '#9860DF'],
grid: {
left: 16,
@@ -144,7 +148,7 @@
data: this.xAxis
}
],
yAxis: {
yAxis: this.yAxisData.length?this.yAxisData:{
axisLine: {
show: false
},

View File

@@ -0,0 +1,154 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-form inline>
<el-form-item>
<el-input v-model="tableFrom.keyword" placeholder="请输入用户名称" class="selWidth">
<el-button slot="append" icon="el-icon-search" @click="getList" />
</el-input>
</el-form-item>
</el-form>
</div>
<el-table
v-loading="loading"
:data="tableData.data"
width="800px"
size="small"
>
<el-table-column label="" width="40">
<template scope="scope">
<el-radio v-model="templateRadio" :label="scope.row.uid" @change.native="getTemplateRow(scope.$index,scope.row)">&nbsp</el-radio>
</template>
</el-table-column>
<el-table-column
prop="uid"
label="ID"
min-width="60"
/>
<el-table-column
prop="nickname"
label="微信用户名称"
min-width="130"
/>
<el-table-column label="客服头像" min-width="80">
<template slot-scope="scope">
<div class="demo-image__preview">
<el-image
class="tabImage"
:src="scope.row.avatar"
:preview-src-list="[scope.row.avatar]"
/>
</div>
</template>
</el-table-column>
<el-table-column
label="性别"
min-width="80"
>
<template slot-scope="scope">
<span>{{ scope.row.sex | saxFilter }}</span>
</template>
</el-table-column>
<el-table-column
label="地区"
min-width="130"
>
<template slot-scope="scope">
<span>{{ scope.row.addres }}</span>
</template>
</el-table-column>
<el-table-column
label="是否关注公众号"
min-width="120"
>
<template slot-scope="scope">
<span>{{ scope.row.sex | saxFilter }}</span>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
:page-sizes="[10, 20, 30, 40]"
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
</div>
</template>
<script>
import { userListApi } from '@/api/user'
export default {
name: 'UserList',
filters: {
saxFilter(status) {
const statusMap = {
0: '未知',
1: '男',
2: '女'
}
return statusMap[status]
},
statusFilter(status) {
const statusMap = {
'wechat': '微信用户',
'routine': '小程序用户'
}
return statusMap[status]
}
},
data() {
return {
templateRadio: 0,
loading: false,
tableData: {
data: [],
total: 0
},
tableFrom: {
page: 1,
limit: 10,
keyword: ''
}
}
},
mounted() {
this.getList()
},
methods: {
getTemplateRow(idx, row) {
this.$emit('getTemplateRow', row);
},
// 列表
getList() {
this.loading = true
userListApi(this.tableFrom).then(res => {
this.tableData.data = res.list
this.tableData.total = res.total
this.loading = false
}).catch(res => {
this.$message.error(res.message)
this.loading = false
})
},
pageChange(page) {
this.tableFrom.page = page
this.getList()
},
handleSizeChange(val) {
this.tableFrom.limit = val
this.getList()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -141,3 +141,64 @@ export function extractStatusFilter(status) {
}
return statusMap[status]
}
/**
* @description 砍价状态
*/
export function bargainStatusFilter(status) {
const statusMap = {
'1': '进行中',
'2': '未完成',
'3': '已成功'
}
return statusMap[status]
}
/**
* @description 砍价状态
*/
export function bargainColorFilter(status) {
const statusMap = {
'1': '',
'2': 'danger',
'3': 'success'
}
return statusMap[status]
}
/**
* @description 拼团状态
*/
export function groupStatusFilter(status) {
const statusMap = {
'1': '进行中',
'2': '已成功',
'3': '未完成'
}
return statusMap[status]
}
/**
* @description 拼团状态
*/
export function groupColorFilter(status) {
const statusMap = {
'1': '',
'2': 'success',
'3': 'danger'
}
return statusMap[status]
}
/**
* @description 一号通tab值
*/
export function onePassTypeFilter(status) {
const statusMap = {
'sms': '短信',
'copy': '商品采集',
'expr_query': '物流查询',
'expr_dump': '电子面单打印'
}
return statusMap[status]
}

View File

@@ -16,7 +16,8 @@
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<div class="avatar-wrapper">
<img :src="avatar+'?imageView2/1/w/80/h/80'" class="user-avatar">
{{JavaInfo.account}}
<!--<img :src="avatar+'?imageView2/1/w/80/h/80'" class="user-avatar">-->
<i class="el-icon-caret-bottom" />
</div>
<el-dropdown-menu slot="dropdown">
@@ -29,7 +30,7 @@
<router-link :to=" { path: '/maintain/user' } " v-if="!isPhone">
<el-dropdown-item>个人中心</el-dropdown-item>
</router-link>
<el-dropdown-item @click.native="onUnbundling">解绑账号</el-dropdown-item>
<!--<el-dropdown-item @click.native="onUnbundling">解绑账号</el-dropdown-item>-->
<!-- <a target="_blank" href="https://github.com/PanJiaChen/vue-element-admin/">-->
<!-- <el-dropdown-item>Github</el-dropdown-item>-->
<!-- </a>-->
@@ -53,7 +54,7 @@ import ErrorLog from '@/components/ErrorLog'
import Screenfull from '@/components/Screenfull'
import Search from '@/components/HeaderSearch'
import { unbindApi } from '@/api/wxApi'
import Cookies from 'js-cookie'
export default {
components: {
Breadcrumb,
@@ -64,7 +65,8 @@ export default {
},
data() {
return {
isPhone: this.$wechat.isPhone()
isPhone: this.$wechat.isPhone(),
JavaInfo: JSON.parse(Cookies.get('JavaInfo')),
}
},
computed: {

View File

@@ -67,7 +67,6 @@
width: 100%;
height: 65px;
line-height: 65px;
background: #2b2f3a;
text-align: center;
overflow: hidden;

View File

@@ -100,81 +100,6 @@ export const constantRoutes = [
meta: { title: '商品统计', icon: '' }
}
]
},
{
path: 'bargain',
component: () => import('@/views/marketing/bargain/index'),
name: 'datasBargain',
meta: { title: '砍价管理', icon: '' },
alwaysShow: true,
children: [
{
path: 'bargainGoods',
component: () => import('@/views/marketing/bargain/index'),
name: 'datasBargainGoods',
meta: { title: '砍价商品', icon: '' }
}
]
},
{
path: 'groupBuy',
component: () => import('@/views/marketing/groupBuy/index'),
name: 'datasGroupBuy',
meta: { title: '拼团管理', icon: '' },
children: [
{
path: 'groupGoods',
component: () => import('@/views/marketing/groupBuy/goods/index'),
name: 'DatasGroupGoods',
meta: { title: '拼团商品', icon: '' }
},
{
path: 'groupList',
component: () => import('@/views/marketing/groupBuy/list/list'),
name: 'DatasGroupList',
meta: { title: '拼团列表', icon: '' }
}
]
},
{
path: 'spike',
component: () => import('@/views/marketing/spike/index'),
name: 'DatasSpike',
meta: { title: '秒杀管理', icon: '' },
children: [
{
path: 'spikeconfig',
component: () => import('@/views/marketing/spike/config/index'),
name: 'DatasSpikeConfig',
meta: { title: '秒杀配置', icon: '' }
},
{
path: 'bargainList',
component: () => import('@/views/marketing/spike/googs/index'),
name: 'DatasBargainList',
meta: { title: '秒杀商品', icon: '' }
}
]
},
{
path: 'integral',
component: () => import('@/views/marketing/integral/index'),
name: 'DatasIntegral',
meta: { title: '积分', icon: '' },
children: [
{
path: 'integralconfig',
component: () => import('@/views/marketing/integral/config/index'),
name: 'DatasIntegralConfig',
meta: { title: '积分配置', icon: '' }
},
{
path: 'integrallog',
component: () => import('@/views/marketing/integral/integralLog/index'),
name: 'DatasIntegralLog',
meta: { title: '积分日志', icon: '' }
}
]
}
]
},

View File

@@ -60,9 +60,22 @@ const marketingRouter = {
children: [
{
path: 'bargainGoods',
component: () => import('@/views/marketing/bargain/index'),
component: () => import('@/views/marketing/bargain/bargainGoods/index'),
name: 'bargainGoods',
meta: { title: '砍价商品', icon: '' }
},
{
path: 'creatBargain/:id?',
component: () => import('@/views/marketing/bargain/bargainGoods/creatBargain'),
name: 'creatBargain',
meta: { title: '砍价商品', icon: '',noCache: true,
activeMenu: `/marketing/bargain/bargainGoods` }
},
{
path: 'bargainList',
component: () => import('@/views/marketing/bargain/bargainList/index'),
name: 'bargainList',
meta: { title: '砍价列表', icon: '' }
}
]
},
@@ -75,13 +88,20 @@ const marketingRouter = {
children: [
{
path: 'groupGoods',
component: () => import('@/views/marketing/groupBuy/goods/index'),
component: () => import('@/views/marketing/groupBuy/groupGoods/index'),
name: 'groupGoods',
meta: { title: '拼团商品', icon: '' }
},
{
path: 'creatGroup/:id?',
component: () => import('@/views/marketing/groupBuy/groupGoods/creatGroup'),
name: 'creatGroup',
meta: { title: '拼团商品', icon: '',noCache: true,
activeMenu: `/marketing/groupBuy/groupGoods` }
},
{
path: 'groupList',
component: () => import('@/views/marketing/groupBuy/list/list'),
component: () => import('@/views/marketing/groupBuy/groupList/index'),
name: 'groupList',
meta: { title: '拼团列表', icon: '' }
}

View File

@@ -20,6 +20,15 @@ const operationRouter = {
icon: 'clipboard'
}
},
{
path: 'onePass',
name: 'onePass',
component: () => import('@/views/sms/smsConfig'),
meta: {
title: '一号通',
icon: 'clipboard'
}
},
{
path: 'roleManager',
name: 'RoleManager',
@@ -140,13 +149,13 @@ const operationRouter = {
path: 'template',
component: () => import('@/views/sms/smsTemplate'),
name: 'SmsTemplate',
meta: { title: '短信模板', noCache: true }
meta: { title: '短信模板', noCache: true, activeMenu: `/operation/onePass` }
},
{
path: 'pay',
component: () => import('@/views/sms/smsPay'),
name: 'SmsPay',
meta: { title: '短信购买', noCache: true }
meta: { title: '短信购买', noCache: true, activeMenu: `/operation/onePass` }
},
{
path: 'message',

View File

@@ -10,7 +10,7 @@ module.exports = {
* @type {boolean} true | false
* @description Whether show the settings right-panel
*/
showSettings: true,
showSettings: false,
/**
* @type {boolean} true | false

View File

@@ -82,6 +82,13 @@
-webkit-justify-content: space-between;
justify-content: space-between;
}
.acea-row.row-column-around {
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
justify-content: space-around;
-webkit-justify-content: space-around;
}
.divBox{
padding: 20px;
box-sizing: border-box;
@@ -196,6 +203,9 @@ table .el-image{
.mr15{
margin-right: 15px;
}
.mb5{
margin-bottom: 5px;
}
.mt20{
margin-top: 20px;
}

View File

@@ -13,10 +13,10 @@ $menuText:#bfcbd9;
$menuActiveText:#409EFF;
$subMenuActiveText:#f4f4f5; // https://github.com/ElemeFE/element/issues/12951
$menuBg:#304156;
$menuBg:#001529;
$menuHover:#263445;
$subMenuBg:#1f2d3d;
$subMenuBg:#000c17;
$subMenuHover:#001528;
$sideBarWidth: 210px;
@@ -26,6 +26,7 @@ $sideBarWidth: 210px;
:export {
menuText: $menuText;
menuActiveText: $menuActiveText;
menuActiveBg:$menuActiveText;
subMenuActiveText: $subMenuActiveText;
menuBg: $menuBg;
menuHover: $menuHover;

View File

@@ -24,7 +24,7 @@ export const categoryType = [ // 1 产品分类2 附件分类3 文章分
]
export const roleListStatus = [
{ label: '全部', value: -1 },
{ label: '全部', value: '' },
{ label: '显示', value: 1 },
{ label: '不显示', value: 0 }
]

View File

@@ -10,10 +10,10 @@
</el-select>
</el-form-item>
<el-form-item label="名称:">
<el-input v-model="tableFrom.title" placeholder="请输入模板名称" class="selWidth" size="small"></el-input>
<el-input v-model="tableFrom.title" placeholder="请输入模板名称" class="selWidth" size="small" clearable></el-input>
</el-form-item>
<el-form-item label="ID">
<el-input v-model="tableFrom.tempId" placeholder="请输入模板ID" class="selWidth" size="small"></el-input>
<el-input v-model="tableFrom.tempId" placeholder="请输入模板ID" class="selWidth" size="small" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="seachList" size="small">查询</el-button>
@@ -92,7 +92,7 @@
<el-table-column
prop="createTime"
label="添加时间"
min-width="120"
min-width="150"
/>
<el-table-column label="操作" min-width="150" fixed="right" align="center">
<template slot-scope="scope">
@@ -256,6 +256,8 @@
myTempStatusApi({status: row.status , id: row.id}).then(() => {
this.$message.success('修改成功')
this.getList()
}).catch(()=>{
row.status = !row.status
})
},
// 修改场景

View File

@@ -5,7 +5,7 @@
<div class="container">
<el-form size="small" :inline="true" label-width="100px">
<el-form-item label="模板标题:">
<el-input v-model="tableFrom.title" placeholder="请输入模板标题" class="selWidth" size="small"></el-input>
<el-input v-model="tableFrom.title" placeholder="请输入模板标题" class="selWidth" size="small" clearable></el-input>
</el-form-item>
<el-form-item label="所属类目:">
<el-select v-model="tableFrom.categoryId" placeholder="请选择状态" clearable class="selWidth">

View File

@@ -120,7 +120,7 @@
class="mr10"
/>
<el-upload
class="upload-demo mr10 mb15"
class="upload-demo mr10"
action
:http-request="handleUploadForm"
:headers="myHeaders"

View File

@@ -5,7 +5,7 @@
<div class="container">
<el-form size="small" :inline="true">
<el-form-item label="回复类型:">
<el-select v-model="tableFrom.type" placeholder="请选择类型" @change="seachList" class="selWidth">
<el-select v-model="tableFrom.type" placeholder="请选择类型" @change="seachList" class="selWidth" clearable>
<el-option label="文本消息" value="text"></el-option>
<el-option label="图片消息" value="image"></el-option>
<el-option label="图文消息" value="news"></el-option>
@@ -13,7 +13,7 @@
</el-select>
</el-form-item>
<el-form-item label="关键字:">
<el-input v-model="tableFrom.keywords" placeholder="请输入关键字" class="selWidth" size="small">
<el-input v-model="tableFrom.keywords" placeholder="请输入关键字" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" size="small" @click="seachList" />
</el-input>
</el-form-item>
@@ -58,6 +58,8 @@
v-model="scope.row.status"
:active-value="true"
:inactive-value="false"
active-text="显示"
inactive-text="隐藏"
@change="onchangeIsShow(scope.row)"
/>
</template>
@@ -87,7 +89,7 @@
</template>
<script>
import { replyListApi, replyDeleteApi, replyUpdateApi } from '@/api/wxApi'
import { replyListApi, replyDeleteApi, replyUpdateApi, replyStatusApi } from '@/api/wxApi'
import { getToken } from '@/utils/auth'
export default {
name: 'WechatKeyword',
@@ -115,8 +117,11 @@ export default {
this.getList()
},
onchangeIsShow(row) {
replyUpdateApi(row.id, row).then(() => {
this.$message.success('修改成功')
replyStatusApi({id:row.id, status:row.status}).then(() => {
this.$message.success('修改成功');
this.getList();
}).catch(()=>{
row.status = !row.status
})
},
// 列表
@@ -141,7 +146,7 @@ export default {
// 删除
handleDelete(id, idx) {
this.$modalSure().then(() => {
replyDeleteApi(id).then(() => {
replyDeleteApi({id: id}).then(() => {
this.$message.success('删除成功')
this.getList()
})

View File

@@ -9,17 +9,8 @@
<el-option :label="item.label" :value="item.value" v-for="(item, index) in switchData" :key="index"></el-option>
</el-select>
</el-form-item>
<el-form-item label="类型:">
<el-select v-model="tableFrom.type" placeholder="请选择类型" clearable class="selWidth">
<el-option label="订阅消息" value="0"></el-option>
<el-option label="模板消息" value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item label="模板名称:">
<el-input v-model="tableFrom.name" placeholder="请输入模板名称" class="selWidth" size="small"></el-input>
</el-form-item>
<el-form-item label="微信模板ID">
<el-input v-model="tableFrom.tempId" placeholder="请输入微信模板ID" class="selWidth" size="small"></el-input>
<el-input v-model="tableFrom.name" placeholder="请输入模板名称" class="selWidth" size="small" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="seachList" size="small">查询</el-button>
@@ -41,6 +32,11 @@
width="80"
prop="id"
/>
<el-table-column
prop="tempKey"
label="模板编号"
min-width="150"
/>
<el-table-column
prop="tempId"
label="模板ID"
@@ -136,9 +132,7 @@
page: 1,
limit: 20,
status: '',
name: '',
type: this.$route.path.indexOf('routineTemplate') !== -1? '0' :'1',
tempId: ''
name: ''
},
tableData: {
data: [],
@@ -217,6 +211,8 @@
wechatTemplateStatusApi(row.id, {status: row.status}).then(() => {
this.$message.success('修改成功')
this.getList()
}).catch(()=>{
row.status = !row.status
})
}
}

View File

@@ -55,10 +55,10 @@
<el-form-item label="是否热门">
<el-switch v-model="pram.isHot" />
</el-form-item>
<el-form-item label="原文链接">
<p>原文链接选填填写之后在图文左下方会出现此链接</p>
<el-input v-model="pram.url" placeholder="原文链接" />
</el-form-item>
<!--<el-form-item label="原文链接">-->
<!--<p>原文链接选填填写之后在图文左下方会出现此链接</p>-->
<!--<el-input v-model="pram.url" placeholder="原文链接" />-->
<!--</el-form-item>-->
<el-form-item>
<el-button type="primary" @click="handerSubmit('pram')">保存</el-button>
</el-form-item>
@@ -169,9 +169,9 @@ export default {
// this.pram.mediaId = mediaId
},
handlerGetCategoryTreeData() {
const _pram = { type: constants.categoryType[2].value, status: 1, pid: 0 }
categoryApi.treeCategroy(_pram).then(data => {
this.categoryTreeData = data
categoryApi.listCategroy({ type: 3, status: '' }).then(data => {
this.categoryTreeData = data.list
localStorage.setItem('articleClass', JSON.stringify(data.list))
})
},
handerSubmit(form) {

View File

@@ -58,11 +58,11 @@
<el-table-column prop="synopsis" label="文章简介" show-overflow-tooltip min-width="250"/>
<el-table-column prop="shareTitle" label="分享标题" show-overflow-tooltip min-width="200"/>
<el-table-column prop="updateTime" label="更新时间" min-width="180"/>
<el-table-column label="操作" min-width="180" fixed="right">
<el-table-column label="操作" min-width="100" fixed="right" align="center">
<template slot-scope="scope">
<el-button type="text" @click="handlerOpenEdit(1, scope.row)">编辑</el-button>
<el-button type="text" disabled>关联产品</el-button>
<el-button type="text" @click="handlerDelete(scope.row)">删除</el-button>
<el-button type="text" size="small" @click="handlerOpenEdit(1, scope.row)">编辑</el-button>
<!--<el-button type="text" size="small" disabled>关联产品</el-button>-->
<el-button type="text" size="small" @click="handlerDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -79,7 +79,7 @@
:visible.sync="editDialogConfig.visible"
:title="editDialogConfig.isEdit === 0?'创建文章':'编辑文章'"
top="1vh"
width="80%"
width="900px"
destroy-on-close
:modal="false"
:close-on-click-modal="false"

View File

@@ -9,7 +9,7 @@
<span class="ivu-pl-8">用户</span>
</div>
</div>
<echarts-from ref="userChart" :echartsTitle="line" :xAxis="xAxis" :series="series" v-if="infoList"></echarts-from>
<echarts-from ref="userChart" :echartsTitle="line" :xAxis="xAxis" :seriesData="series" v-if="infoList"></echarts-from>
</el-card>
</el-col>
<el-col :xl="8" :lg="12" :md="24" :sm="24" :xs="24">
@@ -21,7 +21,7 @@
</div>
</div>
<echarts-from ref="visitChart" :echartsTitle="circle" :legendData="legendData"
:series="seriesUser" v-if="chartBuy"></echarts-from>
:seriesData="seriesUser" v-if="chartBuy"></echarts-from>
</el-card>
</el-col>
</el-row>

View File

@@ -20,7 +20,7 @@
</div>
</div>
<h4>订单量趋势</h4>
<echarts-from ref="visitChart" :series="series" :xAxis="xAxis" v-if="info"></echarts-from>
<echarts-from ref="visitChart" :yAxisData="yAxisData" :seriesData="series" :xAxis="xAxis" v-if="info" :legendData="legendData"></echarts-from>
</el-card>
</el-col>
</el-row>
@@ -39,9 +39,59 @@
series: [],
xAxis: [],
info: {},
legendData: []
legendData: [],
yAxisData: []
}
},
mounted(){
this.yAxisData = [
{
type: 'value',
name: '金额',
axisLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
textStyle: {
color: '#7F8B9C'
}
},
splitLine: {
show: true,
lineStyle: {
color: '#F5F7F9'
}
}
},
{
type: 'value',
name: '数量',
axisLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
textStyle: {
color: '#7F8B9C'
}
},
splitLine: {
show: true,
lineStyle: {
color: '#F5F7F9'
}
}
// axisLabel: {
// formatter: '{value} °C'
// }
}
]
},
methods: {
// 时间改变
handleChangeVisitType() {
@@ -58,10 +108,11 @@
for (let key in res.quality) {
qualitys.push(Number(res.quality[key]))
}
this.legendData = ['订单金额','订单数']
this.series = [{
"name":"订单金额",
"type":"bar",
"itemStyle":{
name:"订单金额",
type:"bar",
itemStyle:{
"normal":{
"color":{
"x":0,
@@ -85,12 +136,12 @@
}
}
},
"data": pices
data: pices
},
{
"name":"订单数",
"type":"bar",
"itemStyle":{
name:"订单数",
type:"line",
itemStyle:{
"normal":{
"color":{
"x":0,
@@ -114,7 +165,8 @@
}
}
},
"data": qualitys
yAxisIndex: 1,
data: qualitys
}]
})
},
@@ -143,9 +195,9 @@
}
this.series = [
{
"name":"上周金额",
"type":"bar",
"itemStyle":{
name :"上周金额",
type:"bar",
itemStyle:{
"normal":{
"color":{
"x":0,
@@ -169,12 +221,12 @@
}
}
},
"data": prePrice
data: prePrice
},
{
"name":"本周金额",
"type":"bar",
"itemStyle":{
name:"本周金额",
type:"bar",
itemStyle:{
"normal":{
"color":{
"x":0,
@@ -198,12 +250,12 @@
}
}
},
"data": price
data: price
},
{
"name":"上周订单数",
"type":"line",
"itemStyle":{
name:"上周订单数",
type:"line",
itemStyle:{
"normal":{
"color":{
"x":0,
@@ -227,12 +279,13 @@
}
}
},
"data": preQuality
yAxisIndex: 1,
data: preQuality
},
{
"name":"本周订单数",
"type":"line",
"itemStyle":{
name:"本周订单数",
type:"line",
itemStyle:{
"normal":{
"color":{
"x":0,
@@ -256,7 +309,8 @@
}
}
},
"data": qualitys
yAxisIndex: 1,
data: qualitys
}
]
})
@@ -286,9 +340,9 @@
}
this.series = [
{
"name":"上月金额",
"type":"bar",
"itemStyle":{
name:"上月金额",
type:"bar",
itemStyle:{
"normal":{
"color":{
"x":0,
@@ -312,12 +366,12 @@
}
}
},
"data": prePrice
data: prePrice
},
{
"name":"本月金额",
"type":"bar",
"itemStyle":{
name:"本月金额",
type:"bar",
itemStyle:{
"normal":{
"color":{
"x":0,
@@ -341,12 +395,12 @@
}
}
},
"data": price
data: price
},
{
"name":"上月订单数",
"type":"line",
"itemStyle":{
name:"上月订单数",
type:"line",
itemStyle:{
"normal":{
"color":{
"x":0,
@@ -370,12 +424,13 @@
}
}
},
"data": preQuality
yAxisIndex: 1,
data: preQuality
},
{
"name":"本月订单数",
"type":"line",
"itemStyle":{
name:"本月订单数",
type:"line",
itemStyle:{
"normal":{
"color":{
"x":0,
@@ -399,7 +454,8 @@
}
}
},
"data": qualitys
yAxisIndex: 1,
data: qualitys
}
]
})
@@ -429,9 +485,9 @@
}
this.series = [
{
"name":"去年金额",
"type":"bar",
"itemStyle":{
name:"去年金额",
type:"bar",
itemStyle:{
"normal":{
"color":{
"x":0,
@@ -455,12 +511,12 @@
}
}
},
"data": prePrice
data: prePrice
},
{
"name":"今年金额",
"type":"bar",
"itemStyle":{
name:"今年金额",
type:"bar",
itemStyle:{
"normal":{
"color":{
"x":0,
@@ -484,12 +540,12 @@
}
}
},
"data": price
data: price
},
{
"name":"去年订单数",
"type":"line",
"itemStyle":{
name:"去年订单数",
type:"line",
itemStyle:{
"normal":{
"color":{
"x":0,
@@ -513,12 +569,13 @@
}
}
},
"data": preQuality
yAxisIndex: 1,
data: preQuality
},
{
"name":"今年订单数",
"type":"line",
"itemStyle":{
name:"今年订单数",
type:"line",
itemStyle:{
"normal":{
"color":{
"x":0,
@@ -542,7 +599,8 @@
}
}
},
"data": qualitys
yAxisIndex: 1,
data: qualitys
}
]
})

View File

@@ -46,7 +46,7 @@
<i class="el-icon-warning-outline" />
</el-tooltip>
</span>
<el-input-number v-model="promoterForm.storeBrokerageRatio" class="selWidth" placeholder="订单交易成功后给上级返佣的比例0 - 100,例:5 = 反订单金额的5%"></el-input-number>
<el-input-number v-model="promoterForm.storeBrokerageRatio" step-strictly :min="0" :max="100" class="selWidth" placeholder="订单交易成功后给上级返佣的比例0 - 100,例:5 = 反订单金额的5%"></el-input-number>
<span>%</span>
</el-form-item>
<el-form-item prop="storeBrokerageTwo">
@@ -56,7 +56,7 @@
<i class="el-icon-warning-outline" />
</el-tooltip>
</span>
<el-input-number v-model="promoterForm.storeBrokerageTwo" class="selWidth" placeholder="订单交易成功后给上级返佣的比例0 ~ 100,例:5 = 反订单金额的5%"></el-input-number>
<el-input-number v-model="promoterForm.storeBrokerageTwo" step-strictly :min="0" :max="100" class="selWidth" placeholder="订单交易成功后给上级返佣的比例0 ~ 100,例:5 = 反订单金额的5%"></el-input-number>
<span>%</span>
</el-form-item>
<el-form-item prop="userExtractMinPrice">
@@ -66,7 +66,7 @@
<i class="el-icon-warning-outline" />
</el-tooltip>
</span>
<el-input-number v-model="promoterForm.userExtractMinPrice" :precision="2" :step="0.1" class="selWidth" placeholder="用户提现最低金额"></el-input-number>
<el-input-number v-model="promoterForm.userExtractMinPrice" :min="0" :precision="2" :step="0.1" class="selWidth" placeholder="用户提现最低金额"></el-input-number>
</el-form-item>
<el-form-item prop="userExtractBank">
<span slot="label">
@@ -89,7 +89,7 @@
<i class="el-icon-warning-outline" />
</el-tooltip>
</span>
<el-input-number v-model="promoterForm.extractTime" :precision="2" :step="0.1" class="selWidth" placeholder="佣金冻结时间(天)"></el-input-number>
<el-input-number v-model="promoterForm.extractTime" :min="0" class="selWidth" placeholder="佣金冻结时间(天)"></el-input-number>
</el-form-item>
<el-form-item prop="storeBrokeragePrice">
<span slot="label">
@@ -98,7 +98,7 @@
<i class="el-icon-warning-outline" />
</el-tooltip>
</span>
<el-input-number v-model="promoterForm.storeBrokeragePrice" placeholder="满额分销满足金额开通分销权限" :precision="2" :step="0.1" class="selWidth"></el-input-number>
<el-input-number v-model="promoterForm.storeBrokeragePrice" placeholder="满额分销满足金额开通分销权限" :min="0" :precision="2" :step="0.1" class="selWidth"></el-input-number>
</el-form-item>
<el-form-item>
<el-button size="mini" type="primary" :loading="loading" @click="submitForm('promoterForm')">立即创建</el-button>

View File

@@ -11,7 +11,7 @@
<el-date-picker v-model="timeVal" value-format="yyyy-MM-dd" format="yyyy-MM-dd" size="small" type="daterange" placement="bottom-end" placeholder="自定义时间" style="width: 250px;" @change="onchangeTime" />
</el-form-item>
<el-form-item label="关键字:">
<el-input v-model="tableFrom.keywords" placeholder="请输入姓名、电话、UID" class="selWidth" size="small">
<el-input v-model="tableFrom.keywords" placeholder="请输入姓名、电话、UID" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" size="small" @click="seachList" />
</el-input>
</el-form-item>
@@ -93,7 +93,7 @@
prop="brokeragePrice"
/>
<el-table-column
prop="spread.nickname"
prop="spreadNickname"
label="上级推广人"
min-width="150"
/>
@@ -107,7 +107,7 @@
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="onSpreadOrder(scope.row.uid, 'order')">推广订单</el-dropdown-item>
<!--<el-dropdown-item @click.native="onSpreadType(scope.row.uid)">推广方式</el-dropdown-item>-->
<el-dropdown-item @click.native="clearSpread(scope.row)">清除上级推广人</el-dropdown-item>
<el-dropdown-item @click.native="clearSpread(scope.row)" v-if="scope.row.spreadNickname">清除上级推广人</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
@@ -149,7 +149,7 @@
</el-radio-group>
</el-form-item>
<el-form-item label="关键字:" class="width100">
<el-input v-model="spreadFrom.nickName" placeholder="请输入请输入姓名、电话、UID" class="selWidth" size="small">
<el-input v-model="spreadFrom.nickName" :placeholder="onName === 'order'?'请输入订单号':'请输入姓名、电话、UID'" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" size="small" @click="onChanges" />
</el-input>
</el-form-item>
@@ -226,20 +226,20 @@
highlight-current-row
>
<el-table-column
prop="order_sn"
prop="orderId"
label="订单ID"
min-width="120"
/>
<el-table-column
label="用户信息"
min-width="100"
min-width="150"
>
<template slot-scope="scope">
<span>{{ scope.row.user.nickname }}</span>
<span>{{scope.row.realName}}<el-divider direction="vertical"></el-divider>{{ scope.row.userPhone }}</span>
</template>
</el-table-column>
<el-table-column
prop="create_time"
prop="createTime"
label="时间"
min-width="150"
/>
@@ -247,7 +247,7 @@
sortable
label="返佣金额"
min-width="120"
prop="brokerage"
prop="deductionPrice"
/>
</el-table>
<div class="block">

View File

@@ -105,11 +105,6 @@
</el-radio-group>
<el-date-picker v-model="timeValUser" value-format="yyyy-MM-dd" format="yyyy-MM-dd" size="small" type="daterange" placement="bottom-end" placeholder="自定义时间" style="width: 250px;" @change="onchangeTimeUser" />
</el-form-item>
<el-form-item label="关键字:">
<el-input v-model="userTableFrom.keywords" placeholder="请输入订单id" class="selWidth" size="small">
<el-button slot="append" icon="el-icon-search" size="small" @click="getUserList(1)" />
</el-input>
</el-form-item>
</el-form>
<el-divider></el-divider>
<el-table
@@ -148,8 +143,8 @@
:current-page="userTableFrom.page"
layout="total, sizes, prev, pager, next, jumper"
:total="userDetailData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
@size-change="userHandleSizeChange"
@current-change="userPageChange"
/>
</div>
</div>
@@ -184,7 +179,6 @@
userTableFrom: {
page: 1,
limit: 10,
keywords: '',
dateLimit: ''
},
fromList: fromList,
@@ -207,6 +201,7 @@
this.userDetail = row
this.Visible = true
this.tablistLoading = true
this.userTableFrom.limit = 10
this.getUserList()
},
getUserList(num){
@@ -225,6 +220,14 @@
this.userTableFrom.page = 1;
this.getUserList()
},
userPageChange(page) {
this.userTableFrom.page = page
this.getUserList()
},
userHandleSizeChange(val) {
this.userTableFrom.limit = val
this.getUserList()
},
// 具体日期
onchangeTimeUser(e) {
this.timeValUser = e

View File

@@ -11,7 +11,7 @@
<el-date-picker v-model="timeVal" value-format="yyyy-MM-dd" format="yyyy-MM-dd" size="small" type="daterange" placement="bottom-end" placeholder="自定义时间" style="width: 250px;" @change="onchangeTime" />
</el-form-item>
<el-form-item label="提现状态:">
<el-radio-group v-model="tableFrom.status" type="button" size="small" @change="getList(1)">
<el-radio-group v-model="tableFrom.status" type="button" size="small" @change="getList(1)" clearable>
<el-radio-button label="">全部</el-radio-button>
<el-radio-button label="0">审核中</el-radio-button>
<el-radio-button label="1">已提现</el-radio-button>
@@ -19,7 +19,7 @@
</el-radio-group>
</el-form-item>
<el-form-item label="提现方式:">
<el-radio-group v-model="tableFrom.extractType" type="button" size="small" @change="getList(1)">
<el-radio-group v-model="tableFrom.extractType" type="button" size="small" @change="getList(1)" clearable>
<el-radio-button label="">全部</el-radio-button>
<el-radio-button label="bank">银行卡</el-radio-button>
<el-radio-button label="alipay">支付宝</el-radio-button>
@@ -27,7 +27,7 @@
</el-radio-group>
</el-form-item>
<el-form-item label="关键字:" class="width100">
<el-input v-model="tableFrom.keywords" placeholder="微信号/姓名/支付宝账号/银行卡号/失败原因" class="selWidth" size="small">
<el-input v-model="tableFrom.keywords" placeholder="微信号/姓名/支付宝账号/银行卡号/失败原因" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" size="small" @click="getList(1)" />
</el-input>
</el-form-item>

View File

@@ -18,7 +18,7 @@
</el-radio-group>
</el-form-item>
<el-form-item label="关键字:" class="width100">
<el-input v-model="tableFrom.keywords" placeholder="微信昵称/姓名/订单号" class="selWidth" size="small">
<el-input v-model="tableFrom.keywords" placeholder="微信昵称/姓名/订单号" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" size="small" @click="getList(1)" />
</el-input>
</el-form-item>
@@ -103,7 +103,7 @@
<el-table-column label="操作" min-width="120" fixed="right" align="center">
<template slot-scope="scope">
<el-button type="text" size="small" @click="handleDelete(scope.row)" v-if="!scope.row.paid">删除</el-button>
<el-button type="text" size="small" @click="handleRefund(scope.row)" v-else>退款</el-button>
<el-button type="text" size="small" @click="handleRefund(scope.row)" v-if="parseFloat(scope.row.refundPrice) <= 0 && scope.row.paid">退款</el-button>
</template>
</el-table-column>
</el-table>
@@ -119,18 +119,36 @@
/>
</div>
</el-card>
<!--退款-->
<el-dialog
title="退款"
:visible.sync="dialogVisible"
width="500px"
:before-close="handleClose">
<zb-parser
v-if="dialogVisible"
:form-id="130"
:is-create="isCreate"
:edit-data="editData"
@submit="handlerSubmit"
@resetForm="resetForm"
/>
</el-dialog>
</div>
</template>
<script>
import { topUpLogListApi, balanceApi, topUpLogDeleteApi } from '@/api/financial'
import { topUpLogListApi, balanceApi, topUpLogDeleteApi, refundApi } from '@/api/financial'
import cardsData from '@/components/cards/index'
import { fromList } from '@/utils/constants.js'
import zbParser from '@/components/FormGenerator/components/parser/ZBParser'
export default {
name: 'AccountsBill',
components: { cardsData },
components: { cardsData, zbParser },
data() {
return {
editData: {},
isCreate: 1,
cardLists: [],
timeVal: [],
tableData: {
@@ -145,7 +163,8 @@
page: 1,
limit: 20
},
fromList: fromList
fromList: fromList,
dialogVisible: false
}
},
mounted() {
@@ -153,8 +172,27 @@
this.getStatistics()
},
methods: {
resetForm(formValue) {
this.handleClose();
},
handlerSubmit(formValue) {
refundApi(formValue).then(data => {
this.$message.success('操作成功')
this.dialogVisible = false
this.editData = {}
this.getList()
})
},
handleClose() {
this.dialogVisible = false
this.editData = {}
},
handleRefund(row) {
if(row.price == row.refundPrice) return this.$message.waiting('已退完支付金额!不能再退款了 ');
if(row.rechargeType === 'balance') return this.$message.waiting('佣金转入余额,不能退款 ');
this.editData.orderId = row.orderId
this.editData.id = row.id
this.dialogVisible = true
},
handleDelete(row, idx) {
this.$modalSure().then(() => {
@@ -203,10 +241,10 @@
balanceApi().then(res => {
const stat = res
this.cardLists = [
{ name: '充值总金额', count: stat.totalPayPrice, icon: 'el-icon-s-goods' },
{ name: '充值退款金额', count: stat.totalRefundPrice, icon: 'el-icon-s-order' },
{ name: '小程序充值金额', count: stat.totalRoutinePrice, icon: 'el-icon-s-cooperation' },
{ name: '公众号充值金额', count: stat.totalWxPrice, icon: 'el-icon-s-finance' }
{ name: '充值总金额', count: stat.total, icon: 'el-icon-s-goods' },
{ name: '充值退款金额', count: stat.refund, icon: 'el-icon-s-order' },
{ name: '小程序充值金额', count: stat.routine, icon: 'el-icon-s-cooperation' },
{ name: '公众号充值金额', count: stat.weChat, icon: 'el-icon-s-finance' }
]
})
}

View File

@@ -10,18 +10,18 @@
</el-radio-group>
<el-date-picker v-model="timeVal" value-format="yyyy-MM-dd" format="yyyy-MM-dd" size="small" type="daterange" placement="bottom-end" placeholder="自定义时间" style="width: 250px;" @change="onchangeTime" />
</el-form-item>
<el-form-item label="明细类型:">
<el-select class="selWidth" v-model="tableFrom.type" filterable clearable placeholder="请选择" @change="getList(1)">
<el-option
v-for="(item, index) in optionList"
:key="index"
:label="item.title"
:value="item.type"
/>
</el-select>
</el-form-item>
<!--<el-form-item label="明细类型:">-->
<!--<el-select class="selWidth" v-model="tableFrom.type" filterable clearable placeholder="请选择" @change="getList(1)">-->
<!--<el-option-->
<!--v-for="(item, index) in optionList"-->
<!--:key="index"-->
<!--:label="item.title"-->
<!--:value="item.type"-->
<!--/>-->
<!--</el-select>-->
<!--</el-form-item>-->
<el-form-item label="关键字:" class="width100">
<el-input v-model="tableFrom.keywords" placeholder="微信昵称/ID" class="selWidth" size="small">
<el-input v-model="tableFrom.keywords" placeholder="微信昵称/ID" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" size="small" @click="getList(1)" />
</el-input>
</el-form-item>
@@ -98,7 +98,7 @@
},
listLoading: true,
tableFrom: {
type: '',
// type: '',
dateLimit: '',
keywords: '',
page: 1,

View File

@@ -109,8 +109,8 @@ export default {
}
}
const validatePassword = (rule, value, callback) => {
if (value.length < 6) {
callback(new Error('The password can not be less than 6 digits'))
if (value.length < 6 || value.length >12) {
callback(new Error('密码位数为6-12位'))
} else {
callback()
}

View File

@@ -20,7 +20,7 @@
<!-- </el-form-item>-->
</el-form>
</div>
<el-button type="primary" size="mini" @click="handlerOpenEditData({},0)">添加数据</el-button>
<el-button type="primary" size="mini" @click="handlerOpenEditData({},0)" v-if="((formData.id==55 || formData.name==='签到天数配置') && dataList.list.length<7) || (formData.id!=55|| formData.name!=='签到天数配置')">添加数据</el-button>
<el-dialog
:title="editDataConfig.isCreate === 0?'添加数据':'编辑数据'"
:visible.sync="editDataConfig.visible"

View File

@@ -5,7 +5,7 @@
<div class="container">
<el-form inline>
<el-form-item label="数据搜索">
<el-input v-model="listPram.keywords" placeholder="请输入IDKEY组合数据名称简介" class="selWidth" size="small">
<el-input v-model="listPram.keywords" placeholder="请输入IDKEY组合数据名称简介" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" size="small" @click="handlerSearch" />
</el-input>
</el-form-item>

View File

@@ -0,0 +1,869 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-steps :active="currentTab" align-center finish-status="success">
<el-step title="选择秒杀商品" />
<el-step title="填写基础信息" />
<el-step title="修改商品详情" />
</el-steps>
</div>
<el-form
ref="formValidate"
v-loading="fullscreenLoading"
class="formValidate mt20"
:rules="ruleValidate"
:model="formValidate"
label-width="150px"
@submit.native.prevent
>
<!-- 砍价商品-->
<div v-show="currentTab === 0">
<el-form-item label="选择商品:" prop="image">
<div class="upLoadPicBox" @click="changeGood">
<div v-if="formValidate.image" class="pictrue"><img :src="formValidate.image"></div>
<div v-else class="upLoad">
<i class="el-icon-camera cameraIconfont"/>
</div>
</div>
</el-form-item>
</div>
<!-- 商品信息-->
<div v-show="currentTab === 1">
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="商品主图:" prop="image">
<div class="upLoadPicBox" @click="modalPicTap('1')">
<div v-if="formValidate.image" class="pictrue"><img :src="formValidate.image"></div>
<div v-else class="upLoad">
<i class="el-icon-camera cameraIconfont" />
</div>
</div>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="商品轮播图:" prop="images">
<div class="acea-row">
<div
v-for="(item,index) in formValidate.imagess"
:key="index"
class="pictrue"
draggable="true"
@dragstart="handleDragStart($event, item)"
@dragover.prevent="handleDragOver($event, item)"
@dragenter="handleDragEnter($event, item)"
@dragend="handleDragEnd($event, item)"
>
<img :src="item">
<i class="el-icon-error btndel" @click="handleRemove(index)" />
</div>
<div v-if="formValidate.imagess.length<10" class="upLoadPicBox" @click="modalPicTap('2')">
<div class="upLoad">
<i class="el-icon-camera cameraIconfont" />
</div>
</div>
</div>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="砍价活动名称:" prop="title">
<el-input v-model="formValidate.title" placeholder="请输入商品名称" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="砍价活动简介:">
<el-input v-model="formValidate.info" maxlength="250" type="textarea" :rows="3" placeholder="请输入商品简介" />
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="单位:" prop="unitName">
<el-input v-model="formValidate.unitName" placeholder="请输入单位" class="selWidthd"/>
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="排序:" prop="sort">
<el-input v-model="formValidate.sort" placeholder="请输入排序" class="selWidthd"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="活动时间:">
<el-date-picker
class="mr20"
v-model="timeVal"
type="daterange"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="onchangeTime">
</el-date-picker>
<span>设置活动开启结束时间用户可以在设置时间内发起参与砍价</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="砍价人数:" prop="peopleNum">
<el-input-number v-model="formValidate.peopleNum" :min="1" :step="1" step-strictly step-strictly placeholder="请输入砍价人数" class="selWidthd mr20"/>
<span>需邀请多少人砍价成功</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="帮砍次数:" prop="bargainNum">
<el-input-number v-model="formValidate.bargainNum" :min="1" :step="1" step-strictly placeholder="请输入帮砍次数" class="selWidthd mr20"/>
<span>单个商品用户可以帮砍的次数次数设置为1甲和乙同时将商品A的砍价链接发给丙丙只能帮甲或乙其中一个人砍价</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="购买数量限制:" prop="num">
<el-input-number v-model="formValidate.num" :min="1" :step="1" step-strictly placeholder="请输入购买数量限制" class="selWidthd mr20"/>
<span>单个活动每个用户发起砍价次数限制</span>
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="运费模板:" prop="tempId">
<div class="acea-row">
<el-select v-model="formValidate.tempId" placeholder="请选择" class="selWidthd">
<el-option
v-for="item in shippingList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<!--<el-button class="mr15" @click="addTem">添加运费模板</el-button>-->
</div>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="活动状态:" required>
<el-radio-group v-model="formValidate.status">
<el-radio :label="0" class="radio">关闭</el-radio>
<el-radio :label="1">开启</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<!-- 规格表格-->
<el-col :span="24">
<el-form-item label="商品属性:" class="labeltop" required>
<el-table
ref="multipleTable"
:data="formValidate.ManyAttrValue"
tooltip-effect="dark"
style="width: 100%">
<el-table-column label="选择" min-width="60">
<template slot-scope="scope">
<el-radio v-model="radio" :label="scope.row"
@change.native="changeType(scope.row)"
>&nbsp;
</el-radio>
</template>
</el-table-column>
<template v-if="manyTabDate && formValidate.specType">
<el-table-column v-for="(item,iii) in manyTabDate" :key="iii" align="center" :label="manyTabTit[iii].title" min-width="80">
<template slot-scope="scope">
<span class="priceBox" v-text="scope.row[iii]" />
</template>
</el-table-column>
</template>
<el-table-column align="center" label="图片" min-width="80">
<template slot-scope="scope">
<div class="upLoadPicBox" @click="modalPicTap('1','duo',scope.$index)">
<div v-if="scope.row.image" class="pictrue tabPic"><img :src="scope.row.image"></div>
<div v-else class="upLoad tabPic">
<i class="el-icon-camera cameraIconfont" />
</div>
</div>
</template>
</el-table-column>
<el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="140">
<template slot-scope="{row,$index}">
<template v-if="formThead[iii].title === '砍价起始金额'">
<el-form-item
:prop="`multipleSelection.${$index}.price`"
:rules="ruleValidate.price"
class="inpBox"
>
<el-input-number
size="small"
v-model="row[iii]"
:min="0"
:precision="2" :step="0.1"
class="priceBox"
/>
</el-form-item>
</template>
<template v-else-if="formThead[iii].title === '砍价最低价'">
<el-form-item
:prop="`ManyAttrValue.${$index}.minPrice`"
:rules="ruleValidate.minPrice"
class="inpBox"
>
<el-input-number
size="small"
v-model="row[iii]"
:min="0"
:max="parseFloat(row.price)"
:precision="2" :step="0.1"
class="priceBox"
/>
</el-form-item>
</template>
<template v-else-if="formThead[iii].title === '限量'">
<el-form-item
:prop="`ManyAttrValue.${$index}.quota`"
:rules="ruleValidate.quota"
class="inpBox"
>
<el-input-number
size="small"
v-model="row[iii]"
type="number"
:min="1"
:max="row.stock"
:step="1" step-strictly
class="priceBox"
@change="inpChange(row[iii], row.id)"
/>
</el-form-item>
</template>
<span v-else v-text="row[iii]" class="priceBox" />
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-col>
</el-row>
</div>
<!-- 商品详情-->
<div v-show="currentTab === 2">
<el-form-item label="商品详情:">
<ueditor-from v-model="formValidate.content" :content="formValidate.content" />
</el-form-item>
<el-form-item label="商品规则:">
<ueditor-from v-model="formValidate.rule" :content="formValidate.rule" />
</el-form-item>
</div>
<el-form-item style="margin-top:30px;">
<el-button
v-show="(!$route.params.id && currentTab > 0) || ($route.params.id && currentTab===2)"
type="primary"
class="submission"
size="small"
@click="handleSubmitUp"
>上一步</el-button>
<el-button
v-show="currentTab == 0"
type="primary"
class="submission"
size="small"
@click="handleSubmitNest1('formValidate')"
>下一步</el-button>
<el-button
v-show="currentTab == 1"
type="primary"
class="submission"
size="small"
@click="handleSubmitNest2('formValidate')"
>下一步</el-button>
<el-button
v-show="currentTab===2"
:loading="loading"
type="primary"
class="submission"
size="small"
@click="handleSubmit('formValidate')"
>提交</el-button>
</el-form-item>
</el-form>
</el-card>
<CreatTemplates ref="addTemplates" @getList="getShippingList" />
</div>
</template>
<script>
import { productDetailApi, categoryApi } from '@/api/store'
import { shippingTemplatesList } from '@/api/logistics'
import { getSeckillList } from '@/libs/public'
import { bargainSaveApi, bargainUpdateApi, bargainInfoApi } from '@/api/marketing'
import CreatTemplates from '@/views/systemSetting/logistics/shippingTemplates/creatTemplates'
const defaultObj = {
image: '',
images: '',
imagess: [],
title: '',
info: '',
num: 1,
unitName: '',
sort: 0,
giveIntegral: 0,
ficti: 0,
isShow: false,
tempId: '',
attrValue: [{
image: '',
price: 0,
minPrice: 0,
cost: 0,
otPrice: 0,
stock: 0,
quota: 1,
weight: 0,
volume: 0,
barCode: ''
}],
attr: [],
selectRule: '',
content: '',
specType: false,
id: 0,
// productId: 0,
timeId: '',
startTime: '',
stopTime: '',
timeVal: [],
status: 0,
rule: '',
ManyAttrValue: [{
image: '',
price: 0,
minPrice: 0,
cost: 0,
otPrice: 0,
stock: 0,
quota: 1,
weight: 0,
volume: 0,
barCode: ''
}], // 多规格
multipleSelection: [{
image: '',
price: 0,
minPrice: 0,
cost: 0,
otPrice: 0,
stock: 0,
quota: 1,
weight: 0,
volume: 0,
barCode: ''
}]
}
const objTitle = {
price: {
title: '砍价起始金额'
},
minPrice: {
title: '砍价最低价'
},
cost: {
title: '成本价'
},
otPrice: {
title: '原价'
},
stock: {
title: '库存'
},
quota: {
title: "限量",
},
weight: {
title: '重量KG'
},
volume: {
title: '体积(m³)'
},
barCode: {
title: '商品编号'
}
}
export default {
name: "creatSeckill",
components: { CreatTemplates },
data() {
return {
props2: {
children: 'child',
label: 'name',
value: 'id',
multiple: true,
emitPath: false
},
grid2: {
xl: 8,
lg: 10,
md: 12,
sm: 24,
xs: 24
},
currentTab: 0,
formThead: Object.assign({}, objTitle),
formValidate: {},
loading: false,
fullscreenLoading: false,
merCateList: [], // 商户分类筛选
shippingList: [], // 运费模板
seckillTime: [],
ruleValidate: {
productId: [
{ required: true, message: '请选择商品', trigger: 'change' }
],
title: [
{ required: true, message: '请输入商品标题', trigger: 'blur' }
],
attrValue: [
{ required: true, message: '请选择商品属相', trigger: 'change', type: 'array', min: '1' }
],
num: [
{ required: true, message: '请输入购买数量限制', trigger: 'blur' }
],
unitName: [
{ required: true, message: '请输入单位', trigger: 'blur' }
],
info: [
{ required: true, message: '请输入秒杀商品简介', trigger: 'blur' }
],
tempId: [
{ required: true, message: '请选择运费模板', trigger: 'change' }
],
timeId: [
{ required: true, message: '请选择活动时间', trigger: 'change' }
],
image: [
{ required: true, message: '请上传商品图', trigger: 'change' }
],
imagess: [
{ required: true, message: '请上传商品轮播图', type: 'array', trigger: 'change' }
],
specType: [
{ required: true, message: '请选择商品规格', trigger: 'change' }
],
timeVal:[
{ required: true, message: '请选择活动日期', trigger: 'change', type: 'array'}
],
bargainNum:[
{ required: true, message: '请输入帮砍次数', trigger: 'blur'}
],
peopleNum: [
{ required: true, message: '请输入砍价人数', trigger: 'blur'}
],
price: [
{ required: true, message: '请输入砍价起始金额', trigger: 'blur'}
],
minPrice: [
{ required: true, message: '请输入砍价最低金额', trigger: 'blur'}
],
quota: [
{ required: true, message: '请输入限量', trigger: 'blur'}
]
},
manyTabDate: {},
manyTabTit: {},
attrInfo: {},
tempRoute: {},
multipleSelection: [Object.assign({}, defaultObj.attrValue[0])],
productId: 0,
timeVal: [],
radio: '',
ManyAttrValue: [Object.assign({}, defaultObj.attrValue[0])], // 多规格
}
},
computed: {
attrValue() {
const obj = Object.assign({}, defaultObj.attrValue[0])
delete obj.image
return obj
}
},
created() {
this.$watch('formValidate.attr', this.watCh)
this.tempRoute = Object.assign({}, this.$route)
},
mounted() {
getSeckillList(1).then((res) => {
this.seckillTime = res.list
})
this.formValidate.imagess = []
if ( this.$route.params.id ) {
this.setTagsViewTitle()
this.getInfo()
this.currentTab = 1
}
this.getShippingList()
this.getCategorySelect()
},
methods: {
changeType(row, index){
row.checked = true;
this.formValidate.multipleSelection = [row];
},
inpChange(currentValue, id){
// this.ManyAttrValue.map(item => {
// if(!currentValue && item.id ===id){
// item.quota = 1
// this.$set(item, 'quota', 1)
// this.ManyAttrValue = Object.assign([], this.ManyAttrValue)
// }
// })
console.log(this.ManyAttrValue)
// if(!currentValue) item.quota = 1
},
watCh(val) {
const tmp = {}
const tmpTab = {}
this.formValidate.attr.forEach((o, i) => {
tmp['value' + i] = { title: o.attrName }
tmpTab['value' + i] = ''
})
this.manyTabTit = tmp
this.manyTabDate = tmpTab
this.formThead = Object.assign({}, this.formThead, tmp)
},
handleRemove (i) {
this.formValidate.imagess.splice(i, 1)
},
// 点击商品图
modalPicTap (tit, num, i) {
const _this = this
this.$modalUpload(function(img) {
if(tit==='1'&& !num){
_this.formValidate.image = img[0].sattDir
_this.formValidate.ManyAttrValue[0].image = img[0].sattDir
}
if(tit==='2'&& !num){
if(img.length>10) return this.$message.warning("最多选择10张图片");
if(img.length + _this.formValidate.imagess.length > 10) return this.$message.warning("最多选择10张图片");
img.map((item) => {
_this.formValidate.imagess.push(item.sattDir)
});
}
if(tit==='1'&& num === 'duo' ){
_this.specType ? _this.formValidate.ManyAttrValue[i].image = img[0].sattDir : _this.formValidate.ManyAttrValue[0].image = img[0].sattDir
}
},tit, 'content')
},
// 具体日期
onchangeTime(e) {
this.formValidate.timeVal = e;
this.formValidate.startTime = e ? e[0] : "";
this.formValidate.stopTime = e ? e[1] : "";
},
changeGood(){
const _this = this
this.$modalGoodList(function(row) {
_this.formValidate.image = row.image
_this.productId = row.id
// _this.formValidate.productId = row.id
})
},
handleSubmitNest1() {
if (!this.formValidate.image) {
this.$message.warning("请选择商品!");
return;
} else {
this.currentTab++;
if (!this.$route.params.id) this.getProdect(this.productId);
}
},
// 商品分类;
getCategorySelect() {
categoryApi({ status: -1, type: 1 }).then(res => {
this.merCateList = this.filerMerCateList(res)
})
},
filerMerCateList(treeData) {
return treeData.map((item) => {
if(!item.child){
item.disabled = true
}
item.label = item.name
return item
})
},
// 运费模板;
getShippingList() {
shippingTemplatesList(this.tempData).then(res => {
this.shippingList = res.list
})
},
// 运费模板
addTem() {
this.$refs.addTemplates.dialogVisible = true
this.$refs.addTemplates.getCityList()
},
// 商品详情
getInfo () {
if(!this.$route.params.id){
this.getProdect(this.productId)
}else{
this.getSekllProdect(this.$route.params.id)
}
},
getProdect(id) {
this.fullscreenLoading = true
productDetailApi(id).then(async res => {
let info = res
this.formValidate = info;
this.formValidate.imagess = JSON.parse(info.sliderImage);
this.formValidate.title = info.storeName;
this.formValidate.proName = info.storeName;
this.formValidate.info = info.storeInfo;
this.formValidate.productId = info.id;
this.formValidate.timeId = this.$route.params.id ? Number(info.timeId) : this.$route.params.timeId ? Number(this.$route.params.timeId) : '';
this.formValidate.startTime = info.startTime || '';
this.formValidate.stopTime = info.stopTime || '';
this.formValidate.timeVal = [];
this.formValidate.status = 0;
this.formValidate.num = 1;
this.formValidate.rule = '';
this.formValidate.peopleNum = 1;
this.formValidate.bargainNum = 1;
if(info.specType){
info.attrValues.forEach((row) => {
row.quota = row.stock;
});
this.formValidate.ManyAttrValue = info.attrValues
this.multipleSelection = info.attrValues
}else{
info.attrValue.forEach((row) => {
row.quota = row.stock;
});
this.formValidate.ManyAttrValue = info.attrValue
this.radio = info.attrValue[0]
this.formValidate.attr = []
}
this.fullscreenLoading = false
}).catch(res => {
this.fullscreenLoading = false
})
},
getSekllProdect(id) {
this.fullscreenLoading = true
bargainInfoApi({id:id}).then(async res => {
let info = res;
this.formValidate = info;
this.formValidate.proName = info.title;
this.formValidate.imagess = JSON.parse(info.sliderImage);
this.formValidate.timeId = Number(info.timeId);
this.timeVal = info.startTime && info.stopTime ? [info.startTime, info.stopTime] : []
if(info.specType){
this.formValidate.ManyAttrValue = info.attrValues;
this.$nextTick(() => {
this.formValidate.ManyAttrValue.forEach((item, index) => {
if (item.checked) {
this.$set(item, 'price', item.price)
this.$set(item, 'quota', item.quota)
this.radio = item
}
})
});
}else{
this.formValidate.ManyAttrValue = info.attrValue;
this.formValidate.attr = [];
this.radio = info.attrValue[0];
}
this.fullscreenLoading = false
}).catch(res => {
this.fullscreenLoading = false
})
},
handleSubmitNest2(name) {
this.$refs[name].validate((valid) => {
if (valid) {
if(this.formValidate.specType && this.multipleSelection.length ===0 ) return this.$message.warning("请选择至少一个商品属性!");
return this.$message.warning("请填写完整信息!");
this.currentTab++;
// this.multipleSelection.every((value, index) => {
// if(!value.quota){
// this.$message.warning("请填选择至少一个商品属性!");
// return false;
// }else{
// this.currentTab++;
// return true;
// }
// });
// for(i = 0; i < this.multipleSelection.length; i++){
// if(!this.multipleSelection[i].quota){
// break;
// }else{
// this.currentTab++;
// }
// }
} else {
return false;
}
});
},
// 提交
handleSubmit(name) {
if(!this.formValidate.specType){
this.formValidate.attr = []
this.formValidate.attrValue = this.formValidate.ManyAttrValue
}else{
this.formValidate.attrValue = this.multipleSelection
}
this.formValidate.images = JSON.stringify(this.formValidate.imagess)
this.$refs[name].validate((valid) => {
if (valid) {
this.fullscreenLoading = true;
this.loading = true;
this.$route.params.id
? bargainUpdateApi({id: this.$route.params.id}, this.formValidate)
.then(async () => {
this.fullscreenLoading = false;
this.$message.success('编辑成功');
this.$router.push({
path: "/marketing/bargain/bargainGoods",
});
this.$refs[name].resetFields();
this.formValidate.images = [];
this.loading = false;
})
.catch(() => {
this.fullscreenLoading = false;
this.loading = false;
})
: bargainSaveApi(this.formValidate)
.then(async (res) => {
this.fullscreenLoading = false;
this.$message.success('新增成功');
this.$router.push({
path: "/marketing/bargain/bargainGoods",
});
this.$refs[name].resetFields();
this.formValidate.images = [];
this.loading = false;
})
.catch(() => {
this.fullscreenLoading = false;
this.loading = false;
});
} else {
if (
!this.formValidate.storeName ||
!this.formValidate.unitName ||
!this.formValidate.store_info ||
!this.formValidate.image ||
!this.formValidate.images
) {
this.$message.warning("请填写完整商品信息!");
}
}
});
},
handleSubmitUp() {
if (this.currentTab-- < 0) this.currentTab = 0;
},
setTagsViewTitle() {
const title = '编辑秒杀商品'
const route = Object.assign({}, this.tempRoute, { title: `${title}-${this.$route.params.id}` })
this.$store.dispatch('tagsView/updateVisitedView', route)
},
}
}
</script>
<style scoped lang="scss">
.inpBox{
/deep/.el-form-item__error {
line-height: 20px !important;
position: static !important;
}
}
.labeltop{
/deep/.el-input-number--small{
/*width: 172px !important;*/
min-width: 132px !important;
}
}
.proCoupon{
/deep/.el-form-item__content{
margin-top: 5px;
}
}
.tabPic{
width: 40px !important;
height: 40px !important;
img{
width: 100%;
height: 100%;
}
}
.noLeft{
/deep/.el-form-item__content{
margin-left: 0 !important;
}
}
.tabNumWidth{
/deep/.el-input-number--medium{
width: 121px !important;
}
/deep/.el-input-number__increase{
width: 20px !important;
font-size: 12px !important;
}
/deep/.el-input-number__decrease{
width: 20px !important;
font-size: 12px !important;
}
/deep/.el-input-number--medium .el-input__inner {
padding-left: 25px !important;
padding-right: 25px !important;
}
/deep/ thead{
line-height: normal !important;
}
/deep/ .el-table .cell{
line-height: normal !important;
}
}
.selWidth{
width: 80%;
}
.selWidthd{
width: 350px;
}
.button-new-tag {
height: 28px;
line-height: 26px;
padding-top: 0;
padding-bottom: 0;
}
.input-new-tag {
width: 90px;
margin-left: 10px;
vertical-align: bottom;
}
.pictrue{
width: 60px;
height: 60px;
border: 1px dotted rgba(0,0,0,0.1);
margin-right: 10px;
position: relative;
cursor: pointer;
img{
width: 100%;
height: 100%;
}
}
.btndel{
position: absolute;
z-index: 1;
width :20px !important;
height: 20px !important;
left: 46px;
top: -4px;
}
.labeltop{
/deep/.el-form-item__label{
/*float: none !important;*/
/*display: inline-block !important;*/
/*margin-left: 120px !important;*/
/*width: auto !important;*/
}
}
</style>

View File

@@ -0,0 +1,865 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-steps :active="currentTab" align-center finish-status="success">
<el-step title="选择砍价商品" />
<el-step title="填写基础信息" />
<el-step title="修改商品详情" />
</el-steps>
</div>
<el-form
ref="formValidate"
v-loading="fullscreenLoading"
class="formValidate mt20"
:rules="ruleValidate"
:model="formValidate"
label-width="150px"
@submit.native.prevent
>
<!-- 砍价商品-->
<div v-show="currentTab === 0">
<el-form-item label="选择商品:" prop="image">
<div class="upLoadPicBox" @click="changeGood">
<div v-if="formValidate.image" class="pictrue"><img :src="formValidate.image"></div>
<div v-else class="upLoad">
<i class="el-icon-camera cameraIconfont"/>
</div>
</div>
</el-form-item>
</div>
<!-- 商品信息-->
<div v-show="currentTab === 1">
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="商品主图:" prop="image">
<div class="upLoadPicBox" @click="modalPicTap('1')">
<div v-if="formValidate.image" class="pictrue"><img :src="formValidate.image"></div>
<div v-else class="upLoad">
<i class="el-icon-camera cameraIconfont" />
</div>
</div>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="商品轮播图:" prop="images">
<div class="acea-row">
<div
v-for="(item,index) in formValidate.imagess"
:key="index"
class="pictrue"
draggable="true"
@dragstart="handleDragStart($event, item)"
@dragover.prevent="handleDragOver($event, item)"
@dragenter="handleDragEnter($event, item)"
@dragend="handleDragEnd($event, item)"
>
<img :src="item">
<i class="el-icon-error btndel" @click="handleRemove(index)" />
</div>
<div v-if="formValidate.imagess.length<10" class="upLoadPicBox" @click="modalPicTap('2')">
<div class="upLoad">
<i class="el-icon-camera cameraIconfont" />
</div>
</div>
</div>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="砍价活动名称:" prop="title">
<el-input v-model="formValidate.title" maxlength="249" placeholder="请输入砍价活动名称" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="砍价活动简介:" prop="info">
<el-input v-model="formValidate.info" maxlength="250" type="textarea" :rows="3" placeholder="请输入砍价活动简介" />
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="单位:" prop="unitName">
<el-input v-model="formValidate.unitName" placeholder="请输入单位" class="selWidthd"/>
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="排序:" prop="sort">
<el-input-number v-model="formValidate.sort" :max="9999" placeholder="请输入排序" class="selWidthd"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="活动日期:" prop="timeVal">
<el-date-picker
class="mr20"
v-model="formValidate.timeVal"
type="daterange"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions"
@change="onchangeTime">
</el-date-picker>
<span>设置活动开启结束时间用户可以在设置时间内发起参与砍价</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="砍价人数:" prop="peopleNum">
<el-input-number v-model="formValidate.peopleNum" :min="2" :step="1" step-strictly step-strictly placeholder="请输入砍价人数" class="selWidthd mr20"/>
<span>需邀请多少人砍价成功</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="帮砍次数:" prop="bargainNum">
<el-input-number v-model="formValidate.bargainNum" :min="1" :step="1" step-strictly placeholder="请输入帮砍次数" class="selWidthd mr20"/>
<span>单个商品用户可以帮砍的次数次数设置为1甲和乙同时将商品A的砍价链接发给丙丙只能帮甲或乙其中一个人砍价</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="购买数量限制:" prop="num">
<el-input-number v-model="formValidate.num" :min="1" :step="1" step-strictly placeholder="请输入购买数量限制" class="selWidthd mr20"/>
<span>单个活动每个用户发起砍价次数限制</span>
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="运费模板:" prop="tempId">
<div class="acea-row">
<el-select v-model="formValidate.tempId" placeholder="请选择" class="selWidthd">
<el-option
v-for="item in shippingList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<!--<el-button class="mr15" @click="addTem">添加运费模板</el-button>-->
</div>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="活动状态:" required>
<el-radio-group v-model="formValidate.status">
<el-radio :label="0" class="radio">关闭</el-radio>
<el-radio :label="1">开启</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<!-- 规格表格-->
<el-col :span="24">
<el-form-item label="商品属性:" class="labeltop" required>
<el-table
ref="multipleTable"
:data="ManyAttrValue"
tooltip-effect="dark"
style="width: 100%">
<el-table-column label="选择" width="50">
<template slot-scope="scope">
<el-radio v-model="radio" :label="scope.row"
@change.native="changeType(scope.row)"
>&nbsp;
</el-radio>
</template>
</el-table-column>
<template v-if="manyTabDate && formValidate.specType">
<el-table-column v-for="(item,iii) in manyTabDate" :key="iii" align="center" :label="manyTabTit[iii].title" min-width="80">
<template slot-scope="scope">
<span class="priceBox" v-text="scope.row[iii]" />
</template>
</el-table-column>
</template>
<el-table-column align="center" label="图片" min-width="80">
<template slot-scope="scope">
<div class="upLoadPicBox" @click="modalPicTap('1','duo',scope.$index)">
<div v-if="scope.row.image" class="pictrue tabPic"><img :src="scope.row.image"></div>
<div v-else class="upLoad tabPic">
<i class="el-icon-camera cameraIconfont" />
</div>
</div>
</template>
</el-table-column>
<el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="140">
<template slot-scope="{row,$index}">
<el-input-number
v-if="formThead[iii].title === '砍价起始金额'"
size="small"
v-model="row[iii]"
:min="0"
:precision="2" :step="0.1"
class="priceBox"
/>
<el-input-number
size="small"
v-else-if="formThead[iii].title === '砍价最低价'"
v-model="row[iii]"
:min="0"
:max="parseFloat(row.price)"
:precision="2" :step="0.1"
class="priceBox"
/>
<el-input-number
size="small"
v-else-if="formThead[iii].title === '限量'"
v-model="row[iii]"
type="number"
:min="1"
:max="row.stock"
:step="1" step-strictly
class="priceBox"
@change="inpChange(row[iii], row.id)"
/>
<span v-else v-text="row[iii]" class="priceBox" />
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-col>
</el-row>
</div>
<!-- 商品详情-->
<div v-show="currentTab === 2">
<el-form-item label="商品详情:">
<ueditor-from v-model="formValidate.content" :content="formValidate.content" />
</el-form-item>
<el-form-item label="商品规则:">
<ueditor-from v-model="formValidate.rule" :content="formValidate.rule" />
</el-form-item>
</div>
<el-form-item style="margin-top:30px;">
<el-button
v-show="(!$route.params.id && currentTab > 0) || ($route.params.id && currentTab===2)"
type="primary"
class="submission"
size="small"
@click="handleSubmitUp"
>上一步</el-button>
<el-button
v-show="currentTab == 0"
type="primary"
class="submission"
size="small"
@click="handleSubmitNest1('formValidate')"
>下一步</el-button>
<el-button
v-show="currentTab == 1"
type="primary"
class="submission"
size="small"
@click="handleSubmitNest2('formValidate')"
>下一步</el-button>
<el-button
v-show="currentTab===2"
:loading="loading"
type="primary"
class="submission"
size="small"
@click="handleSubmit('formValidate')"
>提交</el-button>
</el-form-item>
</el-form>
</el-card>
<CreatTemplates ref="addTemplates" @getList="getShippingList" />
</div>
</template>
<script>
import { productDetailApi, categoryApi } from '@/api/store'
import { shippingTemplatesList } from '@/api/logistics'
import { getSeckillList } from '@/libs/public'
import { bargainSaveApi, bargainUpdateApi, bargainInfoApi } from '@/api/marketing'
import CreatTemplates from '@/views/systemSetting/logistics/shippingTemplates/creatTemplates'
const defaultObj = {
image: '',
images: '',
imagess: [],
title: '',
info: '',
num: 1,
unitName: '',
sort: 0,
giveIntegral: 0,
ficti: 0,
isShow: false,
tempId: '',
attrValue: [{
image: '',
price: 0,
minPrice: 0,
cost: 0,
otPrice: 0,
stock: 0,
quota: 1,
weight: 0,
volume: 0,
barCode: ''
}],
attr: [],
selectRule: '',
content: '',
specType: false,
id: 0,
// productId: 0,
timeId: '',
startTime: '',
stopTime: '',
timeVal: [],
status: 0,
rule: ''
}
const objTitle = {
price: {
title: '砍价起始金额'
},
minPrice: {
title: '砍价最低价'
},
cost: {
title: '成本价'
},
otPrice: {
title: '原价'
},
stock: {
title: '库存'
},
quota: {
title: "限量",
},
weight: {
title: '重量KG'
},
volume: {
title: '体积(m³)'
},
barCode: {
title: '商品编号'
}
}
export default {
name: "creatSeckill",
components: { CreatTemplates },
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < new Date().setTime(new Date().getTime() - 3600 * 1000 * 24);
}
},
props2: {
children: 'child',
label: 'name',
value: 'id',
multiple: true,
emitPath: false
},
grid2: {
xl: 8,
lg: 10,
md: 12,
sm: 24,
xs: 24
},
currentTab: 0,
formThead: Object.assign({}, objTitle),
formValidate: Object.assign({}, defaultObj),
loading: false,
fullscreenLoading: false,
merCateList: [], // 商户分类筛选
shippingList: [], // 运费模板
seckillTime: [],
ruleValidate: {
productId: [
{ required: true, message: '请选择商品', trigger: 'change' }
],
title: [
{ required: true, message: '请输入砍价活动名称', trigger: 'blur' }
],
attrValue: [
{ required: true, message: '请选择商品属相', trigger: 'change', type: 'array', min: '1' }
],
num: [
{ required: true, message: '请输入购买数量限制', trigger: 'blur' }
],
unitName: [
{ required: true, message: '请输入单位', trigger: 'blur' }
],
info: [
{ required: true, message: '请输入砍价商品简介', trigger: 'blur' }
],
tempId: [
{ required: true, message: '请选择运费模板', trigger: 'change' }
],
timeId: [
{ required: true, message: '请选择活动时间', trigger: 'change' }
],
image: [
{ required: true, message: '请上传商品图', trigger: 'change' }
],
imagess: [
{ required: true, message: '请上传商品轮播图', type: 'array', trigger: 'change' }
],
specType: [
{ required: true, message: '请选择商品规格', trigger: 'change' }
],
timeVal:[
{ required: true, message: '请选择活动日期', trigger: 'change', type: 'array'}
],
bargainNum:[
{ required: true, message: '请输入帮砍次数', trigger: 'blur'}
],
peopleNum: [
{ required: true, message: '请输入砍价人数', trigger: 'blur'}
],
price: [
{ required: true, message: '333333', trigger: 'blur'}
]
},
manyTabDate: {},
manyTabTit: {},
attrInfo: {},
tempRoute: {},
multipleSelection: [],
productId: 0,
radio: '',
ManyAttrValue: [Object.assign({}, defaultObj.attrValue[0])], // 多规格
}
},
computed: {
attrValue() {
const obj = Object.assign({}, defaultObj.attrValue[0])
delete obj.image
return obj
}
},
created() {
this.$watch('formValidate.attr', this.watCh)
this.tempRoute = Object.assign({}, this.$route)
},
mounted() {
getSeckillList(1).then((res) => {
this.seckillTime = res.list
})
this.formValidate.imagess = []
if ( this.$route.params.id ) {
this.setTagsViewTitle()
this.getInfo()
this.currentTab = 1
}
this.getShippingList()
this.getCategorySelect()
},
methods: {
changeType(row, index){
row.checked = true;
this.multipleSelection = [row];
},
inpChange(currentValue, id){
// this.ManyAttrValue.map(item => {
// if(!currentValue && item.id ===id){
// item.quota = 1
// this.$set(item, 'quota', 1)
// this.ManyAttrValue = Object.assign([], this.ManyAttrValue)
// }
// })
console.log(this.ManyAttrValue)
// if(!currentValue) item.quota = 1
},
watCh(val) {
const tmp = {}
const tmpTab = {}
this.formValidate.attr.forEach((o, i) => {
tmp['value' + i] = { title: o.attrName }
tmpTab['value' + i] = ''
})
this.manyTabTit = tmp
this.manyTabDate = tmpTab
this.formThead = Object.assign({}, this.formThead, tmp)
},
handleRemove (i) {
this.formValidate.imagess.splice(i, 1)
},
// 点击商品图
modalPicTap (tit, num, i) {
const _this = this
this.$modalUpload(function(img) {
if(tit==='1'&& !num){
_this.formValidate.image = img[0].sattDir
_this.ManyAttrValue[0].image = img[0].sattDir
}
if(tit==='2'&& !num){
if(img.length>10) return this.$message.warning("最多选择10张图片");
if(img.length + _this.formValidate.imagess.length > 10) return this.$message.warning("最多选择10张图片");
img.map((item) => {
_this.formValidate.imagess.push(item.sattDir)
});
}
if(tit==='1'&& num === 'duo' ){
_this.specType ? _this.ManyAttrValue[i].image = img[0].sattDir : _this.ManyAttrValue[0].image = img[0].sattDir
}
},tit, 'content')
},
// 具体日期
onchangeTime(e) {
this.formValidate.timeVal = e;
this.formValidate.startTime = e ? e[0] : "";
this.formValidate.stopTime = e ? e[1] : "";
},
changeGood(){
const _this = this
this.$modalGoodList(function(row) {
_this.formValidate.image = row.image
_this.productId = row.id
// _this.formValidate.productId = row.id
})
},
handleSubmitNest1() {
if (!this.formValidate.image) {
this.$message.warning("请选择商品!");
return;
} else {
this.currentTab++;
if (!this.$route.params.id) this.getProdect(this.productId);
}
},
// 商品分类;
getCategorySelect() {
categoryApi({ status: -1, type: 1 }).then(res => {
this.merCateList = this.filerMerCateList(res)
})
},
filerMerCateList(treeData) {
return treeData.map((item) => {
if(!item.child){
item.disabled = true
}
item.label = item.name
return item
})
},
// 运费模板;
getShippingList() {
shippingTemplatesList(this.tempData).then(res => {
this.shippingList = res.list
})
},
// 运费模板
addTem() {
this.$refs.addTemplates.dialogVisible = true
this.$refs.addTemplates.getCityList()
},
// 商品详情
getInfo () {
if(!this.$route.params.id){
this.getProdect(this.productId)
}else{
this.getSekllProdect(this.$route.params.id)
}
},
getProdect(id) {
this.fullscreenLoading = true
productDetailApi(id).then(async res => {
this.formValidate = {
image: res.image,
imagess: JSON.parse(res.sliderImage),
title: res.storeName,
info: res.storeInfo,
proName: res.storeName,
unitName: res.unitName,
sort: res.sort,
tempId: res.tempId,
attr: res.attr,
selectRule: res.selectRule,
content: res.content,
specType: res.specType,
productId: res.id,
giveIntegral: res.giveIntegral,
ficti: res.ficti,
startTime: res.startTime || '',
stopTime: res.stopTime || '',
timeVal: [],
status: 0,
num : 1,
bargainNum : 2,
peopleNum : 1,
rule : ''
}
if(res.specType){
res.attrValues.forEach((row) => {
row.quota = row.stock;
});
this.ManyAttrValue = res.attrValues
this.multipleSelection = res.attrValues
}else{
res.attrValue.forEach((row) => {
row.quota = row.stock;
});
this.ManyAttrValue = res.attrValue
this.radio = res.attrValue[0]
this.formValidate.attr = []
}
this.fullscreenLoading = false
}).catch(res => {
this.fullscreenLoading = false
})
},
getSekllProdect(id) {
this.fullscreenLoading = true
bargainInfoApi({id:id}).then(async res => {
this.formValidate = {
image: res.image,
imagess: res.sliderImage?JSON.parse(res.sliderImage):[],
title: res.title,
proName: res.title,
info: res.info,
unitName: res.unitName,
sort: res.sort,
tempId: res.tempId,
attr: res.attr,
selectRule: res.selectRule,
content: res.content,
specType: res.specType,
productId: res.productId,
giveIntegral: res.giveIntegral,
ficti: res.ficti,
startTime: res.startTime || '',
stopTime: res.stopTime || '',
timeVal: res.startTime && res.stopTime ? [res.startTime, res.stopTime] : [],
status: res.status,
num : res.num,
bargainNum : res.bargainNum,
peopleNum : res.peopleNum,
rule : res.rule
}
if(res.specType){
this.ManyAttrValue = res.attrValues;
this.$nextTick(() => {
this.ManyAttrValue.forEach((item, index) => {
if (item.checked) {
this.radio = item
}
})
});
}else{
this.ManyAttrValue = res.attrValue;
this.formValidate.attr = [];
this.radio = res.attrValue[0];
}
this.fullscreenLoading = false
}).catch(res => {
this.fullscreenLoading = false
})
},
handleSubmitNest2(name) {
this.$refs[name].validate((valid) => {
if (valid) {
if(!this.radio){
return this.$message.warning("请选择一个商品属性!");
}else{
if(!this.radio.price) return this.$message.warning("请填写砍价起始金额!");
// if(!this.radio.minPrice) return this.$message.warning("请填写砍价最低价!");
if(!this.radio.quota) return this.$message.warning("请填写限量!");
}
this.currentTab++;
} else {
return false;
}
});
},
// 提交
handleSubmit(name) {
if(!this.formValidate.specType){
this.formValidate.attr = []
this.formValidate.attrValue = this.ManyAttrValue
}else{
this.formValidate.attrValue = [this.radio]
}
this.formValidate.images = JSON.stringify(this.formValidate.imagess)
this.$refs[name].validate((valid) => {
if (valid) {
this.fullscreenLoading = true;
this.loading = true;
this.$route.params.id
? bargainUpdateApi({id: this.$route.params.id}, this.formValidate)
.then(async () => {
this.fullscreenLoading = false;
this.$message.success('编辑成功');
this.$router.push({
path: "/marketing/bargain/bargainGoods",
});
this.$refs[name].resetFields();
this.formValidate.images = [];
this.loading = false;
})
.catch(() => {
this.fullscreenLoading = false;
this.loading = false;
})
: bargainSaveApi(this.formValidate)
.then(async (res) => {
this.fullscreenLoading = false;
this.$message.success('新增成功');
this.$router.push({
path: "/marketing/bargain/bargainGoods",
});
this.$refs[name].resetFields();
this.formValidate.images = [];
this.loading = false;
})
.catch(() => {
this.fullscreenLoading = false;
this.loading = false;
});
} else {
if (
!this.formValidate.storeName ||
!this.formValidate.unitName ||
!this.formValidate.store_info ||
!this.formValidate.image ||
!this.formValidate.images
) {
this.$message.warning("请填写完整商品信息!");
}
}
});
},
handleSubmitUp() {
if (this.currentTab-- < 0) this.currentTab = 0;
},
setTagsViewTitle() {
const title = '编辑砍价商品'
const route = Object.assign({}, this.tempRoute, { title: `${title}-${this.$route.params.id}` })
this.$store.dispatch('tagsView/updateVisitedView', route)
},
// 移动
handleDragStart (e, item) {
this.dragging = item;
},
handleDragEnd (e, item) {
this.dragging = null
},
handleDragOver (e) {
e.dataTransfer.dropEffect = 'move'
},
handleDragEnter (e, item) {
e.dataTransfer.effectAllowed = 'move'
if (item === this.dragging) {
return
}
const newItems = [...this.formValidate.imagess]
const src = newItems.indexOf(this.dragging)
const dst = newItems.indexOf(item)
newItems.splice(dst, 0, ...newItems.splice(src, 1))
this.formValidate.imagess = newItems;
}
}
}
</script>
<style scoped lang="scss">
.inpBox{
/deep/.el-form-item__error {
color: #ff4949;
font-size: 12px;
line-height: 20px;
padding-top: 4px;
position: static !important;
/* position: absolute; */
/* top: 100%; */
/* left: 0; */
}
}
.labeltop{
/deep/.el-input-number--small{
/*width: 172px !important;*/
min-width: 132px !important;
}
}
.proCoupon{
/deep/.el-form-item__content{
margin-top: 5px;
}
}
.tabPic{
width: 40px !important;
height: 40px !important;
img{
width: 100%;
height: 100%;
}
}
.noLeft{
/deep/.el-form-item__content{
margin-left: 0 !important;
}
}
.tabNumWidth{
/deep/.el-input-number--medium{
width: 121px !important;
}
/deep/.el-input-number__increase{
width: 20px !important;
font-size: 12px !important;
}
/deep/.el-input-number__decrease{
width: 20px !important;
font-size: 12px !important;
}
/deep/.el-input-number--medium .el-input__inner {
padding-left: 25px !important;
padding-right: 25px !important;
}
/deep/ thead{
line-height: normal !important;
}
/deep/ .el-table .cell{
line-height: normal !important;
}
}
.selWidth{
width: 80%;
}
.selWidthd{
width: 350px;
}
.button-new-tag {
height: 28px;
line-height: 26px;
padding-top: 0;
padding-bottom: 0;
}
.input-new-tag {
width: 90px;
margin-left: 10px;
vertical-align: bottom;
}
.pictrue{
width: 60px;
height: 60px;
border: 1px dotted rgba(0,0,0,0.1);
margin-right: 10px;
position: relative;
cursor: pointer;
img{
width: 100%;
height: 100%;
}
}
.btndel{
position: absolute;
z-index: 1;
width :20px !important;
height: 20px !important;
left: 46px;
top: -4px;
}
.labeltop{
/deep/.el-form-item__label{
/*float: none !important;*/
/*display: inline-block !important;*/
/*margin-left: 120px !important;*/
/*width: auto !important;*/
}
}
</style>

View File

@@ -0,0 +1,213 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="container">
<el-form inline>
<el-form-item label="砍价状态:">
<el-select v-model="tableFrom.status" placeholder="请选择" class="filter-item selWidth mr20" @change="getList(1)" clearable>
<el-option label="关闭" :value="0" />
<el-option label="开启" :value="1" />
</el-select>
</el-form-item>
<el-form-item label="商品搜索:">
<el-input v-model="tableFrom.keywords" placeholder="请输入商品名称、ID" class="selWidth" clearable>
<el-button slot="append" icon="el-icon-search" @click="getList(1)"/>
</el-input>
</el-form-item>
</el-form>
</div>
<router-link :to=" { path:'/marketing/bargain/creatBargain' }">
<el-button size="mini" type="primary" class="mr10">添加砍价商品</el-button>
</router-link>
<el-button size="mini" class="mr10" @click="exportList">导出</el-button>
</div>
<el-table
v-loading="listLoading"
:data="tableData.data"
style="width: 100%"
size="mini"
ref="multipleTable"
>
<el-table-column
prop="id"
label="ID"
min-width="50"
/>
<el-table-column label="砍价图片" min-width="80">
<template slot-scope="scope">
<div class="demo-image__preview">
<el-image
style="width: 36px; height: 36px"
:src="scope.row.image"
:preview-src-list="[scope.row.image]"
/>
</div>
</template>
</el-table-column>
<el-table-column
label="砍价名称"
prop="title"
min-width="100"
/>
<el-table-column
label="砍价价格"
prop="price"
min-width="100"
/>
<el-table-column
label="最低价"
prop="minPrice"
min-width="100"
/>
<el-table-column
label="参与人数"
prop="countPeopleAll"
min-width="100"
/>
<el-table-column
label="帮忙砍价人数"
prop="countPeopleHelp"
min-width="100"
/>
<el-table-column
label="砍价成功人数"
prop="countPeopleSuccess"
min-width="100"
/>
<el-table-column
label="限量"
min-width="100"
prop="quotaShow"
/>
<el-table-column
label="限量剩余"
prop="surplusQuota"
min-width="100"
/>
<el-table-column
prop="stopTime"
label="结束时间"
min-width="130"
/>
<el-table-column
label="砍价状态"
min-width="150"
>
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
:active-value="true"
:inactive-value="false"
active-text="开启"
inactive-text="关闭"
@change="onchangeIsShow(scope.row)"
/>
</template>
</el-table-column>
<el-table-column label="操作" min-width="130" fixed="right" align="center">
<template slot-scope="scope">
<router-link :to="{ path:'/marketing/bargain/creatBargain/' + scope.row.id}">
<el-button type="text" size="small">编辑</el-button>
</router-link>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)" class="mr10">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block mb20">
<el-pagination
:page-sizes="[10, 20, 30, 40]"
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
</div>
</template>
<script>
import { bargainListApi,bargainDeleteApi,bargainStatusApi,exportBargainApi } from '@/api/marketing'
export default {
name: "index",
data() {
return {
tableFrom: {
page: 1,
limit: 20,
keywords: '',
status: null
},
listLoading: true,
tableData: {
data: [],
total: 0
},
}
},
mounted() {
this.getList()
},
methods: {
//导出
exportList(){
exportBargainApi({keywords: this.tableFrom.keywords, status:this.tableFrom.status}).then((res) => {
window.open(res.fileName)
})
},
// 删除
handleDelete(id, idx) {
this.$modalSure().then(() => {
bargainDeleteApi({id: id}).then(() => {
this.$message.success('删除成功')
this.tableData.data.splice(idx, 1)
})
})
},
onchangeIsShow(row) {
bargainStatusApi({id:row.id, status: row.status})
.then(async () => {
this.$message.success('修改成功');
this.getList()
}).catch(()=>{
row.status = !row.status
})
},
// 列表
getList(num) {
this.listLoading = true
this.tableFrom.page = num ? num : this.tableFrom.page;
bargainListApi(this.tableFrom).then(res => {
this.tableData.data = res.list
this.tableData.total = res.total
this.listLoading = false
}).catch((res) => {
this.listLoading = false
})
},
pageChange(page) {
this.tableFrom.page = page
this.getList()
},
handleSizeChange(val) {
this.tableFrom.limit = val
this.getList()
},
add() {
this.isCreate = 0
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
this.editData = {}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,246 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="container">
<el-form size="small" label-width="100px">
<el-form-item label="时间选择:" class="width100">
<el-radio-group v-model="tableFrom.dateLimit" type="button" class="mr20" size="small" @change="selectChange(tableFrom.dateLimit)">
<el-radio-button v-for="(item,i) in fromList.fromTxt" :key="i" :label="item.val">{{ item.text }}</el-radio-button>
</el-radio-group>
<el-date-picker v-model="timeVal" value-format="yyyy-MM-dd" format="yyyy-MM-dd" size="small" type="daterange" placement="bottom-end" placeholder="自定义时间" style="width: 250px;" @change="onchangeTime" />
</el-form-item>
<el-form-item label="砍价状态:">
<el-select v-model="tableFrom.status" placeholder="请选择" class="filter-item selWidth mr20" @change="getList(1)" clearable>
<el-option label="进行中" :value="1" />
<el-option label="未完成" :value="2" />
<el-option label="已成功" :value="3" />
</el-select>
</el-form-item>
</el-form>
</div>
</div>
<el-table
v-loading="listLoading"
:data="tableData.data"
style="width: 100%"
size="mini"
ref="multipleTable"
>
<el-table-column
prop="id"
label="ID"
min-width="50"
/>
<el-table-column label="头像" min-width="80">
<template slot-scope="scope">
<div class="demo-image__preview">
<el-image
style="width: 36px; height: 36px"
:src="scope.row.avatar"
:preview-src-list="[scope.row.avatar]"
/>
</div>
</template>
</el-table-column>
<el-table-column
label="发起用户"
prop="nickname"
min-width="100"
/>
<el-table-column
label="开启时间"
prop="addTime"
min-width="150"
/>
<el-table-column
label="砍价商品"
prop="title"
min-width="100"
/>
<el-table-column
label="最低价"
prop="bargainPriceMin"
min-width="100"
/>
<el-table-column
label="当前价"
prop="nowPrice"
min-width="100"
/>
<el-table-column
label="总砍价次数"
prop="peopleNum"
min-width="100"
/>
<el-table-column
label="剩余砍价次数"
min-width="100"
prop="num"
/>
<el-table-column
prop="dataTime"
label="结束时间"
min-width="150"
/>
<el-table-column
label="砍价状态"
min-width="150"
>
<template slot-scope="scope">
<el-tag :type="scope.row.status | bargainColorFilter">{{scope.row.status | bargainStatusFilter}}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" min-width="150" fixed="right" align="center">
<template slot-scope="scope">
<el-button type="text" size="small" @click="handleLook(scope.row.id)" class="mr10">查看详情</el-button>
</template>
</el-table-column>
</el-table>
<div class="block mb20">
<el-pagination
:page-sizes="[10, 20, 30, 40]"
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
<el-dialog
title="查看详情"
:visible.sync="dialogVisible"
width="650px"
:before-close="handleClose">
<el-table
v-loading="listLoadingPink"
:data="tableDataPink.data"
style="width: 100%"
size="mini"
ref="multipleTable"
>
<el-table-column
prop="uid"
label="用户id"
min-width="50"
/>
<el-table-column label="用户头像" min-width="80">
<template slot-scope="scope">
<div class="demo-image__preview">
<el-image
style="width: 36px; height: 36px"
:src="scope.row.avatar"
:preview-src-list="[scope.row.avatar]"
/>
</div>
</template>
</el-table-column>
<el-table-column
label="用户名称"
prop="nickname"
min-width="100"
/>
<el-table-column
label="砍价金额"
prop="price"
min-width="100"
/>
<el-table-column
label="砍价时间"
prop="addTime"
min-width="180"
/>
</el-table>
</el-dialog>
</div>
</template>
<script>
import {fromList} from '@/utils/constants.js';
import { bargainListListApi,bargainOrderPinkApi } from '@/api/marketing'
export default {
name: "index",
data() {
return {
listLoadingPink: false,
dialogVisible: false,
tableDataPink: {
data: []
},
tableData: {
data: [],
total: 0
},
listLoading: false,
tableFrom: {
dateLimit: '',
status: '',
page: 1,
limit: 20
},
fromList: fromList,
timeVal: []
}
},
mounted() {
this.getList()
},
methods:{
handleClose(){
this.dialogVisible = false
},
handleLook(id){
this.dialogVisible = true;
this.getPink(id);
},
getPink(id) {
this.listLoadingPink = true;
bargainOrderPinkApi(id).then(res => {
this.tableDataPink.data = res
this.listLoadingPink = false
}).catch(() => {
this.listLoadingPink = false
})
},
selectChange(tab) {
this.tableFrom.dateLimit = tab
this.tableFrom.page = 1
this.timeVal = []
this.getList()
},
// 具体日期
onchangeTime(e) {
this.timeVal = e
this.tableFrom.dateLimit = e ? this.timeVal.join(',') : ''
this.tableFrom.page = 1
this.getList()
},
// 列表
getList(num) {
this.listLoading = true;
this.tableFrom.page = num ? num : this.tableFrom.page;
bargainListListApi(this.tableFrom).then(res => {
this.tableData.data = res.list
this.tableData.total = res.total
this.listLoading = false
}).catch(() => {
this.listLoading = false
})
},
pageChange(page) {
this.tableFrom.page = page
this.getList()
},
handleSizeChange(val) {
this.tableFrom.limit = val
this.getList()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -1,11 +1,13 @@
<template>
<div>砍价</div>
<div>
<router-view />
</div>
</template>
<script>
export default {
export default {
}
}
</script>
<style lang="sass" scoped>

View File

@@ -15,10 +15,10 @@
<el-form-item label="选择品类:" prop="primaryKey" v-if="ruleForm.useType === 3">
<el-cascader v-model="ruleForm.primaryKey" :options="merCateList" :props="props2" clearable class="selWidth" :show-all-levels="false" />
</el-form-item>
<el-form-item label="商品:" v-if="ruleForm.useType === 2">
<el-form-item label="商品:" v-if="ruleForm.useType === 2" prop="checked">
<div class="acea-row">
<template v-if="checked.length">
<div class="pictrue" v-for="(item, index) in checked" :key="index">
<template v-if="ruleForm.checked.length">
<div class="pictrue" v-for="(item, index) in ruleForm.checked" :key="index">
<img :src="item.image">
<i class="el-icon-error btndel" @click="handleRemove(index)" />
</div>
@@ -48,7 +48,7 @@
<el-radio :label="true">时间段</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="使用有效期限(天)" prop="resource" v-if="!ruleForm.isFixedTime">
<el-form-item label="使用有效期限(天)" prop="day" v-if="!ruleForm.isFixedTime">
<el-input-number v-model="ruleForm.day" :min="0" label="描述文字"></el-input-number>
</el-form-item>
<el-form-item label="使用有效期限" prop="resource" v-if="ruleForm.isFixedTime">
@@ -60,6 +60,7 @@
format="yyyy - MM - dd - HH : mm : ss"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
:picker-options="pickerOptions"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
@@ -77,6 +78,7 @@
range-separator=""
format="yyyy - MM - dd - HH : mm : ss"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
@@ -123,6 +125,11 @@
name: "creatCoupon",
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < new Date().setTime(new Date().getTime() - 3600 * 1000 * 24);
}
},
loading: false,
threshold: false,
termTime: [],
@@ -154,14 +161,26 @@
receiveEndTime: '',
sort: 0,
total: 1,
status: false
status: false,
checked: []
},
rules: {
name: [
{ required: true, message: '请输入优惠券名称', trigger: 'blur' },
],
},
checked: []
day: [
{ required: true, message: '请输入使用有效期限(天)', trigger: 'blur' },
],
money: [
{ required: true, message: '请输入优惠券面值', trigger: 'blur' },
],
primaryKey: [
{ required: true, message: '请选择品类', trigger: 'change' },
],
checked: [
{ required: true, message: '请至少选择一个商品', trigger: 'change', type: 'array' },
]
}
}
},
mounted() {
@@ -195,9 +214,9 @@
sort: info.sort,
total: info.total,
status: info.status,
primaryKey: Number(info.primaryKey)
primaryKey: Number(info.primaryKey),
checked: res.product
}
this.checked = res.product
info.minPrice === 0 ? this.threshold = false : this.threshold = true
info.isForever ? this.isForeverTime = [info.receiveStartTime, info.receiveEndTime] : this.isForeverTime = []
info.isFixedTime ? this.termTime = [info.useStartTime, info.useEndTime] : this.termTime = []
@@ -208,16 +227,16 @@
})
},
handleRemove (i) {
this.checked.splice(i, 1)
this.ruleForm.checked.splice(i, 1)
},
changeGood(){
const _this = this
this.$modalGoodList(function(row) {
_this.checked = row
},'many',_this.checked)
_this.ruleForm.checked = row
},'many',_this.ruleForm.checked)
},
submitForm(formName) {
if( this.ruleForm.useType === 2 ) this.ruleForm.primaryKey = this.checked.map(item => {return item.id}).join(',')
if( this.ruleForm.useType === 2 ) this.ruleForm.primaryKey = this.ruleForm.checked.map(item => {return item.id}).join(',')
if( this.ruleForm.useType === 1 ) this.ruleForm.primaryKey = ''
if( !this.threshold ) this.ruleForm.minPrice = 0
if( !this.ruleForm.isLimited ) this.ruleForm.total = 0

View File

@@ -10,7 +10,7 @@
<el-option label="开启" :value="1" />
</el-select>
<span class="seachTiele">优惠券名称</span>
<el-input v-model="tableFrom.name" placeholder="请输入优惠券名称" class="selWidth">
<el-input v-model="tableFrom.name" placeholder="请输入优惠券名称" class="selWidth" clearable>
<el-button slot="append" icon="el-icon-search" @click="seachList" />
</el-input>
</div>
@@ -142,7 +142,7 @@
style="width: 100%"
>
<el-table-column
prop="user.nickname"
prop="nickname"
label="用户名"
min-width="120"
/>
@@ -271,6 +271,8 @@
couponIssueStatusApi({id:row.id, status:row.status}).then(() => {
this.$message.success('修改成功')
this.getList()
}).catch(()=>{
row.status = !row.status
})
}
}

View File

@@ -1,13 +0,0 @@
<template>
<div>拼团</div>
</template>
<script>
export default {
}
</script>
<style lang="sass" scoped>
</style>

View File

@@ -0,0 +1,901 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-steps :active="currentTab" align-center finish-status="success">
<el-step title="选择拼团商品" />
<el-step title="填写基础信息" />
<el-step title="修改商品详情" />
</el-steps>
</div>
<el-form
ref="formValidate"
v-loading="fullscreenLoading"
class="formValidate mt20"
:rules="ruleValidate"
:model="formValidate"
label-width="180px"
@submit.native.prevent
>
<!-- 砍价商品-->
<div v-show="currentTab === 0">
<el-form-item label="选择商品:" prop="image">
<div class="upLoadPicBox" @click="changeGood">
<div v-if="formValidate.image" class="pictrue"><img :src="formValidate.image"></div>
<div v-else class="upLoad">
<i class="el-icon-camera cameraIconfont"/>
</div>
</div>
</el-form-item>
</div>
<!-- 商品信息-->
<div v-show="currentTab === 1">
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="商品主图:" prop="image">
<div class="upLoadPicBox" @click="modalPicTap('1')">
<div v-if="formValidate.image" class="pictrue"><img :src="formValidate.image"></div>
<div v-else class="upLoad">
<i class="el-icon-camera cameraIconfont" />
</div>
</div>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="商品轮播图:" prop="imagelist">
<div class="acea-row">
<div
v-for="(item,index) in formValidate.imagelist"
:key="index"
class="pictrue"
draggable="true"
@dragstart="handleDragStart($event, item)"
@dragover.prevent="handleDragOver($event, item)"
@dragenter="handleDragEnter($event, item)"
@dragend="handleDragEnd($event, item)"
>
<img :src="item">
<i class="el-icon-error btndel" @click="handleRemove(index)" />
</div>
<div v-if="formValidate.imagelist.length<10" class="upLoadPicBox" @click="modalPicTap('2')">
<div class="upLoad">
<i class="el-icon-camera cameraIconfont" />
</div>
</div>
</div>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="拼团名称:" prop="title">
<el-input v-model="formValidate.title" maxlength="249" placeholder="请输入拼团名称" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="拼团简介:" prop="info">
<el-input v-model="formValidate.info" maxlength="250" type="textarea" :rows="3" placeholder="请输入拼团简介" />
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="单位:" prop="unitName">
<el-input v-model="formValidate.unitName" placeholder="请输入单位" class="selWidthd"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="活动日期:" prop="timeVal">
<el-date-picker
class="mr20"
v-model="formValidate.timeVal"
type="daterange"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions"
@change="onchangeTime">
</el-date-picker>
<span>设置活动开启结束时间用户可以在设置时间内发起参与拼团</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="拼团时效(单位 小时)" prop="effectiveTime">
<el-input-number v-model="formValidate.effectiveTime" :min="1" :step="1" step-strictly step-strictly placeholder="请输入拼团人数" class="selWidthd mr20"/>
<span>用户发起拼团后开始计时需在设置时间内邀请到规定好友人数参团超过时效时间则系统判定拼团失败自动发起退款</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="拼团人数:" prop="people">
<el-input-number v-model="formValidate.people" :min="2" :step="1" step-strictly step-strictly placeholder="请输入拼团人数" class="selWidthd mr20"/>
<span>单次拼团需要参与的用户数</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="购买数量限制:" prop="num">
<el-input-number v-model="formValidate.num" :min="1" :step="1" step-strictly placeholder="请输入帮砍次数" class="selWidthd mr20"/>
<span>活动时间内每个用户参与拼团的次数限制例如设置为4表示本次活动有效期内每个用户最多可参与购买4次</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="单次购买数量限制:" prop="onceNum">
<el-input-number v-model="formValidate.onceNum" :min="1" :step="1" step-strictly placeholder="请输入购买数量限制" class="selWidthd mr20"/>
<span>用户参与拼团时一次购买最大数量限制例如设置为2表示参与拼团时用户一次购买数量最大可选择2个</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="补齐人数:" prop="peopleNum">
<el-input-number v-model="formValidate.peopleNum" :min="0" :max="formValidate.people - 1" :step="1" step-strictly placeholder="请输入补齐人数" class="selWidthd mr20"/>
<span>当用户参与拼团后成团时效内未成团情况下设置补齐人数可虚拟成团例如成团人数为10人补齐人数为4人真实用户需要参与6人成团才可以在最后未成团时自动补齐虚拟人员</span>
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="排序:" prop="sort">
<el-input-number v-model="formValidate.sort" :max="9999" placeholder="请输入排序" class="selWidthd"/>
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="运费模板:" prop="tempId">
<div class="acea-row">
<el-select v-model="formValidate.tempId" placeholder="请选择" class="selWidthd">
<el-option
v-for="item in shippingList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<!--<el-button class="mr15" @click="addTem">添加运费模板</el-button>-->
</div>
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="热门推荐:" required>
<el-radio-group v-model="formValidate.isHost">
<el-radio :label="false" class="radio">关闭</el-radio>
<el-radio :label="true">开启</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="活动状态:" required>
<el-radio-group v-model="formValidate.isShow">
<el-radio :label="false" class="radio">关闭</el-radio>
<el-radio :label="true">开启</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<!-- 规格表格-->
<el-col :span="24">
<el-form-item label="商品属性:" class="labeltop" required>
<el-table
ref="multipleTable"
:data="ManyAttrValue"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
key="1"
v-if="formValidate.specType"
width="55">
</el-table-column>
<template v-if="manyTabDate && formValidate.specType">
<el-table-column v-for="(item,iii) in manyTabDate" :key="iii" align="center" :label="manyTabTit[iii].title" min-width="80">
<template slot-scope="scope">
<span class="priceBox" v-text="scope.row[iii]" />
</template>
</el-table-column>
</template>
<el-table-column align="center" label="图片" min-width="80">
<template slot-scope="scope">
<div class="upLoadPicBox" @click="modalPicTap('1','duo',scope.$index)">
<div v-if="scope.row.image" class="pictrue tabPic"><img :src="scope.row.image"></div>
<div v-else class="upLoad tabPic">
<i class="el-icon-camera cameraIconfont" />
</div>
</div>
</template>
</el-table-column>
<el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="140">
<template slot-scope="scope">
<el-input-number
size="small"
v-if="formThead[iii].title === '拼团价'"
v-model="scope.row[iii]"
:min="0"
:precision="2" :step="0.1"
class="priceBox"
/>
<el-input-number
size="small"
v-else-if="formThead[iii].title === '限量'"
v-model="scope.row[iii]"
type="number"
:min="1"
:max="scope.row.stock"
:step="1" step-strictly
class="priceBox"
@change="inpChange(scope.row[iii], scope.row.id)"
/>
<span v-else v-text="scope.row[iii]" class="priceBox" />
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-col>
</el-row>
</div>
<!-- 商品详情-->
<div v-show="currentTab === 2">
<el-form-item label="商品详情:">
<ueditor-from v-model="formValidate.content" :content="formValidate.content" />
</el-form-item>
</div>
<el-form-item style="margin-top:30px;">
<el-button
v-show="(!$route.params.id && currentTab > 0) || ($route.params.id && currentTab===2)"
type="primary"
class="submission"
size="small"
@click="handleSubmitUp"
>上一步</el-button>
<el-button
v-show="currentTab == 0"
type="primary"
class="submission"
size="small"
@click="handleSubmitNest1('formValidate')"
>下一步</el-button>
<el-button
v-show="currentTab == 1"
type="primary"
class="submission"
size="small"
@click="handleSubmitNest2('formValidate')"
>下一步</el-button>
<el-button
v-show="currentTab===2"
:loading="loading"
type="primary"
class="submission"
size="small"
@click="handleSubmit('formValidate')"
>提交</el-button>
</el-form-item>
</el-form>
</el-card>
<CreatTemplates ref="addTemplates" @getList="getShippingList" />
</div>
</template>
<script>
import { productDetailApi, categoryApi } from '@/api/store'
import { shippingTemplatesList } from '@/api/logistics'
import { getSeckillList } from '@/libs/public'
import { combinationSaveApi, combinationUpdateApi, combinationInfoApi } from '@/api/marketing'
import CreatTemplates from '@/views/systemSetting/logistics/shippingTemplates/creatTemplates'
const defaultObj = {
image: '',
images: '',
imagelist: [],
title: '',
info: '',
num: 1,
unitName: '',
sort: 0,
giveIntegral: 0,
ficti: 0,
isShow: false,
tempId: '',
attrValue: [{
image: '',
price: 0,
cost: 0,
otPrice: 0,
stock: 0,
quota: 1,
weight: 0,
volume: 0,
barCode: ''
}],
attr: [],
selectRule: '',
content: '',
specType: false,
id: 0,
// productId: 0,
startTime: '',
stopTime: '',
timeVal: [],
effectiveTime: 0,
people: 2,
peopleNum: 0
}
const objTitle = {
price: {
title: '拼团价'
},
cost: {
title: '成本价'
},
otPrice: {
title: '原价'
},
stock: {
title: '库存'
},
quota: {
title: "限量",
},
barCode: {
title: '商品编号'
},
weight: {
title: '重量KG'
},
volume: {
title: '体积(m³)'
}
}
export default {
name: "creatSeckill",
components: { CreatTemplates },
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < new Date().setTime(new Date().getTime() - 3600 * 1000 * 24);
}
},
props2: {
children: 'child',
label: 'name',
value: 'id',
multiple: true,
emitPath: false
},
grid2: {
xl: 8,
lg: 10,
md: 12,
sm: 24,
xs: 24
},
currentTab: 0,
formThead: Object.assign({}, objTitle),
formValidate: Object.assign({}, defaultObj),
loading: false,
fullscreenLoading: false,
merCateList: [], // 商户分类筛选
shippingList: [], // 运费模板
seckillTime: [],
ruleValidate: {
productId: [
{ required: true, message: '请选择商品', trigger: 'change' }
],
title: [
{ required: true, message: '请输入商品标题', trigger: 'blur' }
],
attrValue: [
{ required: true, message: '请选择商品属相', trigger: 'change', type: 'array', min: '1' }
],
num: [
{ required: true, message: '请输入购买数量限制', trigger: 'blur' }
],
unitName: [
{ required: true, message: '请输入单位', trigger: 'blur' }
],
info: [
{ required: true, message: '请输入拼团商品简介', trigger: 'blur' }
],
tempId: [
{ required: true, message: '请选择运费模板', trigger: 'change' }
],
image: [
{ required: true, message: '请上传商品图', trigger: 'change' }
],
imagelist: [
{ required: true, message: '请上传商品轮播图', type: 'array', trigger: 'change' }
],
specType: [
{ required: true, message: '请选择商品规格', trigger: 'change' }
],
timeVal:[
{ required: true, message: '请选择活动日期', trigger: 'change', type: 'array'}
],
peopleNum:[
{ required: true, message: '请输入补齐人数', trigger: 'blur'}
],
onceNum: [
{ required: true, message: '请输入单次购买数量限制', trigger: 'blur'}
],
people: [
{ required: true, message: '请输入拼团人数', trigger: 'blur'}
],
effectiveTime: [
{ required: true, message: '请输入拼团时效', trigger: 'blur'}
]
},
manyTabDate: {},
manyTabTit: {},
attrInfo: {},
tempRoute: {},
multipleSelection: [],
productId: 0,
radio: '',
ManyAttrValue: [Object.assign({}, defaultObj.attrValue[0])], // 多规格
}
},
computed: {
attrValue() {
const obj = Object.assign({}, defaultObj.attrValue[0])
delete obj.image
return obj
}
},
created() {
this.$watch('formValidate.attr', this.watCh)
this.tempRoute = Object.assign({}, this.$route)
},
mounted() {
getSeckillList(1).then((res) => {
this.seckillTime = res.list
})
this.formValidate.imagelist = []
if ( this.$route.params.id ) {
this.setTagsViewTitle()
this.getInfo()
this.currentTab = 1
}
this.getShippingList()
this.getCategorySelect()
},
methods: {
handleSelectionChange(val) {
val.map(item => {
item.checked = true
})
this.multipleSelection = val;
},
inpChange(currentValue, id){
// this.ManyAttrValue.map(item => {
// if(!currentValue && item.id ===id){
// item.quota = 1
// this.$set(item, 'quota', 1)
// this.ManyAttrValue = Object.assign([], this.ManyAttrValue)
// }
// })
console.log(this.ManyAttrValue)
// if(!currentValue) item.quota = 1
},
watCh(val) {
const tmp = {}
const tmpTab = {}
this.formValidate.attr.forEach((o, i) => {
tmp['value' + i] = { title: o.attrName }
tmpTab['value' + i] = ''
})
this.manyTabTit = tmp
this.manyTabDate = tmpTab
this.formThead = Object.assign({}, this.formThead, tmp)
},
handleRemove (i) {
this.formValidate.imagelist.splice(i, 1)
// this.imagelist=[...this.imagelist];
},
// 点击商品图
modalPicTap (tit, num, i) {
const _this = this
this.$modalUpload(function(img) {
if(tit==='1'&& !num){
_this.formValidate.image = img[0].sattDir
_this.ManyAttrValue[0].image = img[0].sattDir
}
if(tit==='2'&& !num){
if(img.length>10) return this.$message.warning("最多选择10张图片");
if(img.length + _this.formValidate.imagelist.length > 10) return this.$message.warning("最多选择10张图片");
img.map((item) => {
_this.formValidate.imagelist.push(item.sattDir)
});
}
if(tit==='1'&& num === 'duo' ){
_this.specType ? _this.ManyAttrValue[i].image = img[0].sattDir : _this.ManyAttrValue[0].image = img[0].sattDir
}
},tit, 'content')
},
// 具体日期
onchangeTime(e) {
this.formValidate.timeVal = e;
this.formValidate.startTime = e ? e[0] : "";
this.formValidate.stopTime = e ? e[1] : "";
},
changeGood(){
const _this = this
this.$modalGoodList(function(row) {
_this.formValidate.image = row.image
_this.productId = row.id
// _this.formValidate.productId = row.id
})
},
handleSubmitNest1() {
if (!this.formValidate.image) {
this.$message.warning("请选择商品!");
return;
} else {
this.currentTab++;
if (!this.$route.params.id) this.getProdect(this.productId);
}
},
// 商品分类;
getCategorySelect() {
categoryApi({ status: -1, type: 1 }).then(res => {
this.merCateList = this.filerMerCateList(res)
})
},
filerMerCateList(treeData) {
return treeData.map((item) => {
if(!item.child){
item.disabled = true
}
item.label = item.name
return item
})
},
// 运费模板;
getShippingList() {
shippingTemplatesList(this.tempData).then(res => {
this.shippingList = res.list
})
},
// 运费模板
addTem() {
this.$refs.addTemplates.dialogVisible = true
this.$refs.addTemplates.getCityList()
},
// 商品详情
getInfo () {
if(!this.$route.params.id){
this.getProdect(this.productId)
}else{
this.getSekllProdect(this.$route.params.id)
}
},
getProdect(id) {
this.fullscreenLoading = true
productDetailApi(id).then(async res => {
this.formValidate = res;
this.formValidate = {
image: res.image,
imagelist: JSON.parse(res.sliderImage),
title: res.storeName,
info: res.storeInfo,
quota: '',
unitName: res.unitName,
sort: res.sort,
tempId: res.tempId,
attr: res.attr,
selectRule: res.selectRule,
content: res.content,
specType: res.specType,
productId: res.id,
giveIntegral: res.giveIntegral,
ficti: res.ficti,
startTime: res.startTime || '',
stopTime: res.stopTime || '',
timeVal: [],
status: 0,
isShow: false,
num : 1,
isHost : false,
people : 2,
onceNum : 1,
virtualRation : '',
effectiveTime : 0,
isPostage: false
}
if(res.specType){
res.attrValues.forEach((row) => {
row.quota = row.stock;
});
this.$nextTick(() => {
res.attrValues.forEach((row) => {
this.$refs.multipleTable.toggleRowSelection(row, true);
this.$set(row, 'checked', true)
});
});
this.ManyAttrValue = res.attrValues
this.multipleSelection = res.attrValues
}else{
res.attrValue.forEach((row) => {
row.quota = row.stock;
});
this.ManyAttrValue = res.attrValue
this.formValidate.attr = []
}
this.fullscreenLoading = false
}).catch(res => {
this.fullscreenLoading = false
})
},
getSekllProdect(id) {
this.fullscreenLoading = true
combinationInfoApi({id:id}).then(async res => {
this.formValidate = res;
this.formValidate = {
image: res.image,
imagelist: JSON.parse(res.sliderImage),
title: res.title,
info: res.info,
unitName: res.unitName,
sort: res.sort,
tempId: res.tempId,
attr: res.attr,
selectRule: res.selectRule,
content: res.content,
specType: res.specType,
productId: res.productId,
giveIntegral: res.giveIntegral,
ficti: res.ficti,
timeVal: res.startTimeStr && res.stopTimeStr ? [res.startTimeStr, res.stopTimeStr] : [],
status: res.status,
isShow: res.isShow,
num : res.num,
isHost : res.isHost,
people : res.people,
onceNum : res.onceNum,
virtualRation : res.virtualRation,
effectiveTime : res.effectiveTime,
isPostage: false,
startTime: res.startTimeStr || '',
stopTime: res.stopTimeStr || '',
peopleNum : Math.floor(res.people-res.virtualRation/100*res.people)
}
if(res.specType){
this.ManyAttrValue = res.attrValues;
this.$nextTick(() => {
this.ManyAttrValue.forEach((item, index) => {
if (item.checked) {
this.$set(item, 'price', item.price)
this.$set(item, 'quota', item.quota)
this.$nextTick(() => {
this.$refs.multipleTable.toggleRowSelection(item, true)
})
}
})
});
}else{
this.ManyAttrValue = res.attrValue
this.formValidate.attr = []
}
this.fullscreenLoading = false
}).catch(res => {
this.fullscreenLoading = false
})
},
handleSubmitNest2(name) {
this.$refs[name].validate((valid) => {
if (valid) {
if(this.formValidate.specType && this.multipleSelection.length ===0 ) return this.$message.warning("请选择至少一个商品属性!");
this.currentTab++;
// this.multipleSelection.every((value, index) => {
// if(!value.quota){
// this.$message.warning("请填选择至少一个商品属性!");
// return false;
// }else{
// this.currentTab++;
// return true;
// }
// });
// for(i = 0; i < this.multipleSelection.length; i++){
// if(!this.multipleSelection[i].quota){
// break;
// }else{
// this.currentTab++;
// }
// }
} else {
return false;
}
});
},
// 提交
handleSubmit(name) {
if(!this.formValidate.specType){
this.formValidate.attr = []
this.formValidate.attrValue = this.ManyAttrValue
}else{
this.formValidate.attrValue = this.multipleSelection
}
this.formValidate.images = JSON.stringify(this.formValidate.imagelist);
this.formValidate.virtualRation = Math.floor((this.formValidate.people - this.formValidate.peopleNum) / this.formValidate.people * 100)
this.$refs[name].validate((valid) => {
if (valid) {
this.fullscreenLoading = true;
this.loading = true;
this.$route.params.id
? combinationUpdateApi({id: this.$route.params.id}, this.formValidate)
.then(async () => {
this.fullscreenLoading = false;
this.$message.success('编辑成功');
this.$router.push({
path: "/marketing/groupBuy/groupGoods",
});
this.$refs[name].resetFields();
this.formValidate.imagelist = [];
this.loading = false;
})
.catch(() => {
this.fullscreenLoading = false;
this.loading = false;
})
: combinationSaveApi(this.formValidate)
.then(async (res) => {
this.fullscreenLoading = false;
this.$message.success('新增成功');
this.$router.push({
path: "/marketing/groupBuy/groupGoods",
});
this.$refs[name].resetFields();
this.formValidate.imagelist = [];
this.loading = false;
})
.catch(() => {
this.fullscreenLoading = false;
this.loading = false;
});
} else {
if (
!this.formValidate.storeName ||
!this.formValidate.unitName ||
!this.formValidate.store_info ||
!this.formValidate.image ||
!this.formValidate.images
) {
this.$message.warning("请填写完整商品信息!");
}
}
});
},
handleSubmitUp() {
if (this.currentTab-- < 0) this.currentTab = 0;
},
setTagsViewTitle() {
const title = '编辑拼团商品'
const route = Object.assign({}, this.tempRoute, { title: `${title}-${this.$route.params.id}` })
this.$store.dispatch('tagsView/updateVisitedView', route)
},
// 移动
handleDragStart (e, item) {
this.dragging = item;
},
handleDragEnd (e, item) {
this.dragging = null
},
handleDragOver (e) {
e.dataTransfer.dropEffect = 'move'
},
handleDragEnter (e, item) {
e.dataTransfer.effectAllowed = 'move'
if (item === this.dragging) {
return
}
const newItems = [...this.formValidate.imagelist]
const src = newItems.indexOf(this.dragging)
const dst = newItems.indexOf(item)
newItems.splice(dst, 0, ...newItems.splice(src, 1))
this.formValidate.imagelist = newItems;
}
}
}
</script>
<style scoped lang="scss">
.inpBox{
/deep/.el-form-item__error {
color: #ff4949;
font-size: 12px;
line-height: 20px;
padding-top: 4px;
position: static !important;
/* position: absolute; */
/* top: 100%; */
/* left: 0; */
}
}
.labeltop{
/deep/.el-input-number--small{
/*width: 172px !important;*/
min-width: 132px !important;
}
}
.proCoupon{
/deep/.el-form-item__content{
margin-top: 5px;
}
}
.tabPic{
width: 40px !important;
height: 40px !important;
img{
width: 100%;
height: 100%;
}
}
.noLeft{
/deep/.el-form-item__content{
margin-left: 0 !important;
}
}
.tabNumWidth{
/deep/.el-input-number--medium{
width: 121px !important;
}
/deep/.el-input-number__increase{
width: 20px !important;
font-size: 12px !important;
}
/deep/.el-input-number__decrease{
width: 20px !important;
font-size: 12px !important;
}
/deep/.el-input-number--medium .el-input__inner {
padding-left: 25px !important;
padding-right: 25px !important;
}
/deep/ thead{
line-height: normal !important;
}
/deep/ .el-table .cell{
line-height: normal !important;
}
}
.selWidth{
width: 80%;
}
.selWidthd{
width: 350px;
}
.button-new-tag {
height: 28px;
line-height: 26px;
padding-top: 0;
padding-bottom: 0;
}
.input-new-tag {
width: 90px;
margin-left: 10px;
vertical-align: bottom;
}
.pictrue{
width: 60px;
height: 60px;
border: 1px dotted rgba(0,0,0,0.1);
margin-right: 10px;
position: relative;
cursor: pointer;
img{
width: 100%;
height: 100%;
}
}
.btndel{
position: absolute;
z-index: 1;
width :20px !important;
height: 20px !important;
left: 46px;
top: -4px;
}
.labeltop{
/deep/.el-form-item__label{
/*float: none !important;*/
/*display: inline-block !important;*/
/*margin-left: 120px !important;*/
/*width: auto !important;*/
}
}
</style>

View File

@@ -0,0 +1,218 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="container">
<el-form inline>
<el-form-item label="拼团状态:">
<el-select v-model="tableFrom.isShow" placeholder="请选择" class="filter-item selWidth mr20" @change="getList(1)" clearable>
<el-option label="关闭" :value="0" />
<el-option label="开启" :value="1" />
</el-select>
</el-form-item>
<el-form-item label="商品搜索:">
<el-input v-model="tableFrom.keywords" placeholder="请输入商品名称、ID" class="selWidth" clearable>
<el-button slot="append" icon="el-icon-search" @click="getList(1)"/>
</el-input>
</el-form-item>
</el-form>
</div>
<router-link :to=" { path:'/marketing/groupBuy/creatGroup' }">
<el-button size="mini" type="primary" class="mr10">添加拼团商品</el-button>
</router-link>
<el-button size="mini" class="mr10" @click="exportList">导出</el-button>
</div>
<el-table
v-loading="listLoading"
:data="tableData.data"
style="width: 100%"
size="mini"
ref="multipleTable"
>
<el-table-column
prop="id"
label="ID"
min-width="50"
/>
<el-table-column label="拼图图片" min-width="80">
<template slot-scope="scope">
<div class="demo-image__preview">
<el-image
style="width: 36px; height: 36px"
:src="scope.row.image"
:preview-src-list="[scope.row.image]"
/>
</div>
</template>
</el-table-column>
<el-table-column
label="拼团名称"
prop="title"
min-width="100"
/>
<el-table-column
label="原价"
prop="otPrice"
min-width="100"
/>
<el-table-column
label="拼团价"
prop="price"
min-width="100"
/>
<el-table-column
label="拼团人数"
prop="countPeople"
min-width="100"
/>
<el-table-column
label="参与人数"
prop="countPeopleAll"
min-width="100"
/>
<el-table-column
label="成团数量"
prop="countPeoplePink"
min-width="100"
/>
<el-table-column
label="限量"
min-width="100"
prop="quotaShow"
/>
<el-table-column
label="限量剩余"
prop="remainingQuota"
min-width="100"
/>
<el-table-column
prop="stopTime"
label="结束时间"
min-width="130"
>
<template slot-scope="scope">
<span>{{ scope.row.stopTime| formatDate}}</span>
</template>
</el-table-column>
<el-table-column
label="拼团状态"
min-width="150"
>
<template slot-scope="scope">
<el-switch
v-model="scope.row.isShow"
:active-value="true"
:inactive-value="false"
active-text="开启"
inactive-text="关闭"
@change="onchangeIsShow(scope.row)"
/>
</template>
</el-table-column>
<el-table-column label="操作" min-width="150" fixed="right" align="center">
<template slot-scope="scope">
<router-link :to="{ path:'/marketing/groupBuy/creatGroup/' + scope.row.id}">
<el-button type="text" size="small">编辑</el-button>
</router-link>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)" class="mr10">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block mb20">
<el-pagination
:page-sizes="[10, 20, 30, 40]"
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
</div>
</template>
<script>
import { combinationListApi, combinationDeleteApi, combinationStatusApi, exportcombiantionApi } from '@/api/marketing'
import { formatDates } from '@/utils/index';
export default {
name: "index",
filters: {
formatDate (time) {
if (time !== 0) {
const date = new Date(time);
return formatDates(date, 'yyyy-MM-dd hh:mm');
}
}
},
data() {
return {
tableFrom: {
page: 1,
limit: 20,
keywords: '',
isShow: ''
},
listLoading: true,
tableData: {
data: [],
total: 0
},
}
},
mounted() {
this.getList()
},
methods: {
//导出
exportList(){
exportcombiantionApi({keywords: this.tableFrom.keywords, isShow:this.tableFrom.isShow}).then((res) => {
window.open(res.fileName)
})
},
// 删除
handleDelete(id, idx) {
this.$modalSure().then(() => {
combinationDeleteApi({id: id}).then(() => {
this.$message.success('删除成功')
this.tableData.data.splice(idx, 1)
})
})
},
onchangeIsShow(row) {
combinationStatusApi({id:row.id,isShow: row.isShow})
.then(async () => {
this.$message.success('修改成功');
this.getList()
}).catch(()=>{
row.isShow = !row.isShow
})
},
// 列表
getList(num) {
this.listLoading = true
this.tableFrom.page = num ? num : this.tableFrom.page;
combinationListApi(this.tableFrom).then(res => {
this.tableData.data = res.list
this.tableData.total = res.total
this.listLoading = false
}).catch((res) => {
this.listLoading = false
})
},
pageChange(page) {
this.tableFrom.page = page
this.getList()
},
handleSizeChange(val) {
this.tableFrom.limit = val
this.getList()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,265 @@
<template>
<div class="divBox">
<el-card class="box-card mb15">
<cards-data :cardLists="cardLists"></cards-data>
</el-card>
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="container">
<el-form size="small" label-width="100px">
<el-form-item label="时间选择:" class="width100">
<el-radio-group v-model="tableFrom.dateLimit" type="button" class="mr20" size="small" @change="selectChange(tableFrom.dateLimit)">
<el-radio-button v-for="(item,i) in fromList.fromTxt" :key="i" :label="item.val">{{ item.text }}</el-radio-button>
</el-radio-group>
<el-date-picker v-model="timeVal" value-format="yyyy-MM-dd" format="yyyy-MM-dd" size="small" type="daterange" placement="bottom-end" placeholder="自定义时间" style="width: 250px;" @change="onchangeTime" />
</el-form-item>
<el-form-item label="拼团状态:">
<el-select v-model="tableFrom.status" placeholder="请选择" class="filter-item selWidth mr20" @change="getList(1)" clearable>
<el-option label="进行中" :value="1" />
<el-option label="已成功" :value="2" />
<el-option label="未完成" :value="3" />
</el-select>
</el-form-item>
</el-form>
</div>
</div>
<el-table
v-loading="listLoading"
:data="tableData.data"
style="width: 100%"
size="mini"
ref="multipleTable"
>
<el-table-column
prop="id"
label="ID"
min-width="50"
/>
<el-table-column label="头像" min-width="80">
<template slot-scope="scope">
<div class="demo-image__preview">
<el-image
style="width: 36px; height: 36px"
:src="scope.row.avatar"
:preview-src-list="[scope.row.avatar]"
/>
</div>
</template>
</el-table-column>
<el-table-column
label="开团团长"
prop="nickname"
min-width="100"
/>
<el-table-column
label="开团时间"
prop="addTime"
min-width="100"
/>
<el-table-column
label="拼团商品"
prop="title"
min-width="100"
/>
<el-table-column
label="几人团"
prop="people"
min-width="100"
/>
<el-table-column
label="几人参加"
prop="countPeople"
min-width="100"
/>
<el-table-column
prop="stopTime"
label="结束时间"
min-width="130"
/>
<el-table-column
label="拼团状态"
min-width="150"
>
<template slot-scope="scope">
<el-tag :type="scope.row.status | groupColorFilter">{{scope.row.status | groupStatusFilter}}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" min-width="150" fixed="right" align="center">
<template slot-scope="scope">
<el-button type="text" size="small" @click="handleLook(scope.row.id)" class="mr10">查看详情</el-button>
</template>
</el-table-column>
</el-table>
<div class="block mb20">
<el-pagination
:page-sizes="[10, 20, 30, 40]"
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
<el-dialog
title="查看详情"
:visible.sync="dialogVisible"
width="650px"
:before-close="handleClose">
<el-table
v-loading="listLoadingPink"
:data="tableDataPink.data"
style="width: 100%"
size="mini"
ref="multipleTable"
>
<el-table-column
prop="id"
label="ID"
min-width="50"
/>
<el-table-column label="头像" min-width="80">
<template slot-scope="scope">
<div class="demo-image__preview">
<el-image
style="width: 36px; height: 36px"
:src="scope.row.avatar"
:preview-src-list="[scope.row.avatar]"
/>
</div>
</template>
</el-table-column>
<el-table-column
label="用户名称"
prop="nickname"
min-width="100"
/>
<el-table-column
label="订单编号"
prop="orderId"
min-width="180"
/>
<el-table-column
label="金额"
prop="price"
min-width="100"
/>
<el-table-column
label="订单状态"
min-width="100"
>
<template slot-scope="scope">
<span>{{scope.row.status | orderStatusFilter}}</span>
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>
<script>
import {fromList} from '@/utils/constants.js';
import { combineListApi, combineStatisticsApi,combineOrderPinkApi } from '@/api/marketing'
import cardsData from '@/components/cards/index'
export default {
name: "groupList",
components: {
cardsData
},
data() {
return {
listLoadingPink: false,
dialogVisible: false,
tableDataPink: {
data: []
},
tableData: {
data: [],
total: 0
},
listLoading: false,
tableFrom: {
dateLimit: '',
status: '',
page: 1,
limit: 20
},
fromList: fromList,
timeVal: [],
cardLists: []
}
},
mounted() {
this.getStatistics();
this.getList();
},
methods:{
handleClose(){
this.dialogVisible = false
},
handleLook(id){
this.dialogVisible = true;
this.getPink(id);
},
getPink(id) {
this.listLoadingPink = true;
combineOrderPinkApi(id).then(res => {
this.tableDataPink.data = res
this.listLoadingPink = false
}).catch(() => {
this.listLoadingPink = false
})
},
selectChange(tab) {
this.tableFrom.dateLimit = tab
this.tableFrom.page = 1
this.timeVal = []
this.getList()
},
// 具体日期
onchangeTime(e) {
this.timeVal = e
this.tableFrom.dateLimit = e ? this.timeVal.join(',') : ''
this.tableFrom.page = 1
this.getList()
},
// 列表
getList(num) {
this.listLoading = true;
this.tableFrom.page = num ? num : this.tableFrom.page;
combineListApi(this.tableFrom).then(res => {
this.tableData.data = res.list
this.tableData.total = res.total
this.listLoading = false
}).catch(() => {
this.listLoading = false
})
},
pageChange(page) {
this.tableFrom.page = page
this.getList()
},
handleSizeChange(val) {
this.tableFrom.limit = val
this.getList()
},
// 统计
getStatistics() {
combineStatisticsApi().then(res => {
this.cardLists = [
{ name: '参与人数(人)', count: res.countPeople },
{ name: '成团数量(个)', count: res.countTeam }
]
}).catch(() => {
this.listLoading = false
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -11,7 +11,7 @@
</el-select>
</el-form-item>
<el-form-item label="秒杀名称:">
<el-input v-model="tableFrom.name" placeholder="请输入秒杀名称" class="selWidth">
<el-input v-model="tableFrom.name" placeholder="请输入秒杀名称" class="selWidth" clearable>
<el-button slot="append" icon="el-icon-search" @click="getList(1)"/>
</el-input>
</el-form-item>
@@ -187,7 +187,9 @@
.then(async () => {
this.$message.success('修改成功');
this.getList()
})
}).catch(()=>{
row.status = !row.status
})
},
onEditSort(row) {
this.$set(row, 'isEdit', true)

View File

@@ -42,7 +42,7 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="商品轮播图:" prop="images">
<el-form-item label="商品轮播图:" prop="imagess">
<div class="acea-row">
<div
v-for="(item,index) in formValidate.imagess"
@@ -57,7 +57,7 @@
<img :src="item">
<i class="el-icon-error btndel" @click="handleRemove(index)" />
</div>
<div class="upLoadPicBox" @click="modalPicTap('2')">
<div v-if="formValidate.imagess.length<10" class="upLoadPicBox" @click="modalPicTap('2')">
<div class="upLoad">
<i class="el-icon-camera cameraIconfont" />
</div>
@@ -67,12 +67,12 @@
</el-col>
<el-col :span="24">
<el-form-item label="商品标题:" prop="title">
<el-input v-model="formValidate.title" placeholder="请输入商品名称" />
<el-input v-model="formValidate.title" maxlength="249" placeholder="请输入商品名称" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="秒杀活动简介:">
<el-input v-model="formValidate.info" type="textarea" :rows="3" placeholder="请输入商品简介" />
<el-input v-model="formValidate.info" type="textarea" maxlength="250" :rows="3" placeholder="请输入商品简介" />
</el-form-item>
</el-col>
<!--<el-col v-bind="grid2">-->
@@ -115,6 +115,7 @@
size="small"
type="daterange"
placement="bottom-end"
:picker-options="pickerOptions"
placeholder="请选择活动日期"
@change="onchangeTime"
/>
@@ -318,6 +319,11 @@
components: { CreatTemplates },
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < new Date().setTime(new Date().getTime() - 3600 * 1000 * 24);
}
},
props2: {
children: 'child',
label: 'name',
@@ -451,6 +457,8 @@
_this.ManyAttrValue[0].image = img[0].sattDir
}
if(tit==='2'&& !num){
if(img.length>10) return this.$message.warning("最多选择10张图片");
if(img.length + _this.formValidate.imagess.length > 10) return this.$message.warning("最多选择10张图片");
img.map((item) => {
_this.formValidate.imagess.push(item.sattDir)
});
@@ -715,6 +723,27 @@
const route = Object.assign({}, this.tempRoute, { title: `${title}-${this.$route.params.id}` })
this.$store.dispatch('tagsView/updateVisitedView', route)
},
// 移动
handleDragStart (e, item) {
this.dragging = item;
},
handleDragEnd (e, item) {
this.dragging = null
},
handleDragOver (e) {
e.dataTransfer.dropEffect = 'move'
},
handleDragEnter (e, item) {
e.dataTransfer.effectAllowed = 'move'
if (item === this.dragging) {
return
}
const newItems = [...this.formValidate.imagess]
const src = newItems.indexOf(this.dragging)
const dst = newItems.indexOf(item)
newItems.splice(dst, 0, ...newItems.splice(src, 1))
this.formValidate.imagess = newItems;
}
}
}
</script>

View File

@@ -24,7 +24,7 @@
<!--</el-input>-->
</el-form-item>
<el-form-item label="商品搜索:">
<el-input v-model="tableFrom.keywords" placeholder="请输入商品ID/名称" class="selWidth">
<el-input v-model="tableFrom.keywords" placeholder="请输入商品ID/名称" class="selWidth" clearable>
<el-button slot="append" icon="el-icon-search" @click="getList(1)"/>
</el-input>
</el-form-item>
@@ -218,7 +218,9 @@
.then(async () => {
this.$message.success('修改成功');
this.getList()
})
}).catch(()=>{
row.status = !row.status
})
}
}
}

View File

@@ -323,6 +323,7 @@ export default {
setTime: function(time) {
this.time = time;
this.where.dateLimit = time
this.filter.dateLimit = time
this.list = [];
this.filter.page = 1;
this.loaded = false;
@@ -356,8 +357,8 @@ export default {
} else {
this.renderValues = [this.value.join("-")];
}
console.log( this.renderValues)
this.where.dateLimit = parseTime(this.renderValues[0], '{y}-{m}-{d}')+','+parseTime(this.renderValues[1], '{y}-{m}-{d}')
this.where.dateLimit = this.renderValues.join(',')
// this.where.dateLimit = parseTime(this.renderValues[0], '{y}-{m}-{d}')+','+parseTime(this.renderValues[1], '{y}-{m}-{d}')
this.filter.dateLimit = this.where.dateLimit
},
prev(y, m, w) {

View File

@@ -3,11 +3,11 @@
<el-card class="box-card">
<div slot="header" class="clearfix">
<!--<el-tabs v-model="tableFrom.type" @tab-click="getList">-->
<!--<el-tab-pane label="全部订单" name="" />-->
<!--<el-tab-pane label="普通订单" name="1" />-->
<!--<el-tab-pane label="拼团订单" name="2" />-->
<!--<el-tab-pane label="秒杀订单" name="3" />-->
<!--<el-tab-pane label="砍价订单" name="4" />-->
<!--<el-tab-pane label="全部订单" name=""/>-->
<!--<el-tab-pane label="普通订单" name="1"/>-->
<!--<el-tab-pane label="拼团订单" name="2"/>-->
<!--<el-tab-pane label="秒杀订单" name="3"/>-->
<!--<el-tab-pane label="砍价订单" name="4"/>-->
<!--</el-tabs>-->
<div class="container">
<el-form size="small" label-width="100px">
@@ -32,7 +32,7 @@
<el-date-picker v-model="timeVal" value-format="yyyy-MM-dd" format="yyyy-MM-dd" size="small" type="daterange" placement="bottom-end" placeholder="自定义时间" style="width: 220px;" @change="onchangeTime" />
</el-form-item>
<el-form-item label="订单号:" class="width100">
<el-input v-model="tableFrom.orderId" placeholder="请输入订单号" class="selWidth" size="small">
<el-input v-model="tableFrom.orderId" placeholder="请输入订单号" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" size="small" @click="seachList" />
</el-input>
</el-form-item>
@@ -83,11 +83,11 @@
<span v-show="scope.row.isDel" style="color: #ED4014;display: block;">用户已删除</span>
</template>
</el-table-column>
<!--<el-table-column-->
<!--prop="id"-->
<!--label="订单类型"-->
<!--min-width="150"-->
<!--/>-->
<el-table-column
prop="orderType"
label="订单类型"
min-width="130"
/>
<el-table-column
prop="realName"
label="用户信息"
@@ -99,15 +99,17 @@
>
<template slot-scope="scope">
<div v-if=" scope.row.productList && scope.row.productList.length">
<div v-for="(val, i ) in scope.row.productList" :key="i" class="tabBox acea-row row-middle">
<div v-for="(val, i ) in scope.row.productList" :key="i" class="tabBox acea-row row-middle" style="flex-wrap: inherit;">
<div class="demo-image__preview">
<el-image
:src="val.info.productInfo.image"
:preview-src-list="[val.info.productInfo.image]"
/>
</div>
<span class="tabBox_tit mr10">{{ val.info.productInfo.storeName + ' | ' }}{{ val.info.productInfo.attrInfo.suk ? val.info.productInfo.attrInfo.suk:'-' }}</span>
<span class="tabBox_pice">{{ '¥'+ val.info.productInfo.attrInfo.price ? val.info.productInfo.attrInfo.price + ' x '+ val.info.cartNum : '-' }}</span>
<div>
<span class="tabBox_tit mr10">{{ val.info.productInfo.storeName + ' | ' }}{{ val.info.productInfo.attrInfo.suk ? val.info.productInfo.attrInfo.suk:'-' }}</span>
<span class="tabBox_pice">{{ '¥'+ val.info.productInfo.attrInfo.price ? val.info.productInfo.attrInfo.price + ' x '+ val.info.cartNum : '-' }}</span>
</div>
</div>
</div>
</template>
@@ -161,7 +163,7 @@
<template slot-scope="scope">
<el-button v-if="scope.row.paid === false" type="text" size="small" @click="edit(scope.row)" class="mr10">编辑</el-button>
<el-button v-if="scope.row.statusStr.key === 'notShipped' && scope.row.shippingType === 1 && scope.row.refundStatus !==2" type="text" size="small" class="mr10" @click="sendOrder(scope.row)">发送货</el-button>
<el-button v-if="scope.row.shippingType === 2 && scope.row.statusStr.key === 'toBeWrittenOff' && scope.row.paid == true && scope.row.refundStatus === 0 && isWriteOff" type="text" size="small" class="mr10" @click="onWriteOff(scope.row)">立即核销</el-button>
<el-button v-if="scope.row.shippingType === 2 && scope.row.statusStr.key === 'toBeWrittenOff' && scope.row.paid == true && scope.row.refundStatus === 0 " type="text" size="small" class="mr10" @click="onWriteOff(scope.row)">立即核销</el-button>
<el-dropdown trigger="click">
<span class="el-dropdown-link">
更多<i class="el-icon-arrow-down el-icon--right" />
@@ -171,7 +173,7 @@
<el-dropdown-item @click.native="onOrderLog(scope.row.id)">订单记录</el-dropdown-item>
<el-dropdown-item @click.native="onOrderMark(scope.row)">订单备注</el-dropdown-item>
<el-dropdown-item v-show="scope.row.statusStr.key === 'refunding'" @click.native="onOrderRefuse(scope.row)">拒绝退款</el-dropdown-item>
<el-dropdown-item v-show="scope.row.statusStr.key === 'refunding' && ((parseFloat(scope.row.payPrice) > parseFloat(scope.row.refundPrice) || (scope.row.payPrice == 0 && [0,1].indexOf(scope.row.refundStatus) !== -1)))" @click.native="onOrderRefund(scope.row)">立即退款</el-dropdown-item>
<el-dropdown-item v-show="scope.row.statusStr.key !== 'refunded' && ((parseFloat(scope.row.payPrice) >= parseFloat(scope.row.refundPrice) || (scope.row.payPrice == 0 && [0,1].indexOf(scope.row.refundStatus) !== -1)))" @click.native="onOrderRefund(scope.row)">立即退款</el-dropdown-item>
<el-dropdown-item @click.native="handleDelete(scope.row, scope.$index)">删除订单</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
@@ -419,6 +421,7 @@
sendOrder(row) {
this.$refs.send.modals = true;
this.$refs.send.getList();
this.$refs.send.sheetInfo();
this.orderId = row.id;
},
// 订单删除
@@ -474,7 +477,7 @@
cancelButtonText: '取消',
inputErrorMessage: '请输入订单备注',
inputType: 'textarea',
inputValue: row.mark,
inputValue: row.remark,
inputPlaceholder: '请输入订单备注',
inputValidator: (value) => { if(!value) return '输入不能为空'}
}).then(({value}) => {
@@ -581,7 +584,7 @@
font-size: 12px;
}
.tabBox_tit {
width: 60%;
/*width: 60%;*/
font-size: 12px !important;
margin: 0 2px 0 10px;
letter-spacing: 1px;

View File

@@ -1,75 +1,108 @@
<template>
<el-dialog
title="订单信息"
:visible.sync="dialogVisible"
width="700px"
v-if="orderDatalist"
>
<div class="description" v-loading="loading">
<div class="title">用户信息</div>
<div class="acea-row">
<div class="description-term">用户昵称{{orderDatalist.user?orderDatalist.user.nickname:orderDatalist.realName}}</div>
<div class="description-term">绑定电话{{orderDatalist.user.phone ? orderDatalist.user.phone : '无'}}</div>
</div>
<el-divider></el-divider>
<div class="title">{{orderDatalist.statusStr.key === 'toBeWrittenOff'?'提货信息': '收货信息'}}</div>
<div class="acea-row">
<div class="description-term">{{orderDatalist.statusStr.key === 'toBeWrittenOff'?'提货人': '收货人'}}{{orderDatalist.realName}}</div>
<div class="description-term">{{orderDatalist.statusStr.key === 'toBeWrittenOff'?'提货电话': '收货电话'}}{{orderDatalist.userPhone}}</div>
<div class="description-term" v-if="orderDatalist.statusStr.key !== 'toBeWrittenOff'">{{orderDatalist.statusStr.key === 'toBeWrittenOff'?'提货地址': '收货地址'}}{{orderDatalist.userAddress}}</div>
<div class="description-term">订单编号{{orderDatalist.orderId}}</div>
<div class="description-term">订单状态{{orderDatalist.status | orderStatusFilter}}</div>
<div class="description-term">商品总数{{orderDatalist.totalNum}}</div>
<div class="description-term">商品总价{{orderDatalist.totalPrice}}</div>
<div class="description-term">交付邮费{{orderDatalist.payPostage}}</div>
<div class="description-term">优惠券金额{{orderDatalist.couponPrice}}</div>
<div class="description-term">实际支付{{orderDatalist.payPrice}}</div>
<div class="description-term" v-if="orderDatalist.refundPrice">退款金额{{orderDatalist.refundPrice}}</div>
<div class="description-term" v-if="orderDatalist.useIntegral">使用积分{{orderDatalist.useIntegral}}</div>
<div class="description-term" v-if="orderDatalist.backIntegral">退回积分{{orderDatalist.backIntegral}}</div>
<div class="description-term">创建时间{{orderDatalist.createTime}}</div>
<div class="description-term">支付方式{{orderDatalist.payTypeStr}}</div>
<div class="description-term">推广人{{orderDatalist.spreadInfo.id + ' / ' +orderDatalist.spreadInfo.name}}</div>
<div class="description-term" v-if="orderDatalist.shippingType === 2 && orderDatalist.statusStr.key === 'notShipped'">门店名称{{orderDatalist.storeName}}</div>
<div class="description-term" v-if="orderDatalist.shippingType === 2 && orderDatalist.statusStr.key === 'notShipped'">核销码{{orderDatalist.user_phone}}</div>
<div class="description-term">商家备注{{orderDatalist.remark}}</div>
<template v-if="orderDatalist.statusStr.key === 'toBeWrittenOff' && orderDatalist.systemStore">
<div class="description-term">提货码{{orderDatalist.verifyCode}}</div>
<div class="description-term">门店名称{{orderDatalist.systemStore.name}}</div>
<div class="description-term">门店电话{{orderDatalist.systemStore.phone}}</div>
<div class="description-term">门店地址{{orderDatalist.systemStore.address + orderDatalist.systemStore.detailedAddress}}</div>
</template>
<div>
<el-dialog
title="订单信息"
:visible.sync="dialogVisible"
width="700px"
v-if="orderDatalist"
>
<div class="description" v-loading="loading">
<div class="title">用户信息</div>
<div class="acea-row">
<div class="description-term">用户昵称{{orderDatalist.user?orderDatalist.user.nickname:orderDatalist.realName}}</div>
<div class="description-term">绑定电话{{orderDatalist.user.phone ? orderDatalist.user.phone : '无'}}</div>
</div>
<el-divider></el-divider>
<div class="title">{{orderDatalist.statusStr.key === 'toBeWrittenOff'?'提货信息': '收货信息'}}</div>
<div class="acea-row">
<div class="description-term">{{orderDatalist.statusStr.key === 'toBeWrittenOff'?'提货': '收货'}}{{orderDatalist.realName}}</div>
<div class="description-term">{{orderDatalist.statusStr.key === 'toBeWrittenOff'?'提货电话': '收货电话'}}{{orderDatalist.userPhone}}</div>
<div class="description-term" v-if="orderDatalist.statusStr.key !== 'toBeWrittenOff'">{{orderDatalist.statusStr.key === 'toBeWrittenOff'?'提货地址': '收货地址'}}{{orderDatalist.userAddress}}</div>
</div>
<el-divider></el-divider>
<div class="title">订单信息</div>
<div class="acea-row">
<div class="description-term">订单编号{{orderDatalist.orderId}}</div>
<div class="description-term" style="color: red">订单状态{{orderDatalist.status | orderStatusFilter}}</div>
<div class="description-term">商品总数{{orderDatalist.totalNum}}</div>
<div class="description-term">商品总价{{orderDatalist.totalPrice}}</div>
<div class="description-term">交付邮费{{orderDatalist.payPostage}}</div>
<div class="description-term">优惠券金额{{orderDatalist.couponPrice}}</div>
<div class="description-term">实际支付{{orderDatalist.payPrice}}</div>
<div class="description-term" v-if="orderDatalist.refundPrice">退款金额{{orderDatalist.refundPrice}}</div>
<div class="description-term" v-if="orderDatalist.useIntegral">使用积分{{orderDatalist.useIntegral}}</div>
<div class="description-term" v-if="orderDatalist.backIntegral">退回积分{{orderDatalist.backIntegral}}</div>
<div class="description-term">创建时间{{orderDatalist.createTime}}</div>
<div class="description-term">支付方式{{orderDatalist.payTypeStr}}</div>
<div class="description-term">推广人{{orderDatalist.spreadInfo.id + ' / ' +orderDatalist.spreadInfo.name}}</div>
<div class="description-term" v-if="orderDatalist.shippingType === 2 && orderDatalist.statusStr.key === 'notShipped'">门店名称{{orderDatalist.storeName}}</div>
<div class="description-term" v-if="orderDatalist.shippingType === 2 && orderDatalist.statusStr.key === 'notShipped'">核销码{{orderDatalist.user_phone}}</div>
<div class="description-term">商家备注{{orderDatalist.remark}}</div>
<template v-if="orderDatalist.statusStr.key === 'toBeWrittenOff' && orderDatalist.systemStore">
<div class="description-term">提货码{{orderDatalist.verifyCode}}</div>
<div class="description-term">门店名称{{orderDatalist.systemStore.name}}</div>
<div class="description-term">门店电话{{orderDatalist.systemStore.phone}}</div>
<div class="description-term">门店地址{{orderDatalist.systemStore.address + orderDatalist.systemStore.detailedAddress}}</div>
</template>
</div>
<template v-if="orderDatalist.deliveryType === 'express'">
<el-divider></el-divider>
<div class="title">物流信息</div>
<div class="acea-row">
<div class="description-term">快递公司{{orderDatalist.deliveryName}}</div>
<div class="description-term">快递单号{{orderDatalist.deliveryId}}<el-button type="primary" size="mini" @click="openLogistics" style="margin-left: 5px">物流查询</el-button></div>
</div>
</template>
<template v-if="orderDatalist.deliveryType === 'send'">
<el-divider></el-divider>
<div class="title">配送信息</div>
<div class="acea-row">
<div class="description-term">送货人姓名{{orderDatalist.deliveryName}}</div>
<div class="description-term">送货人电话{{orderDatalist.deliveryId}}</div>
</div>
</template>
<template v-if="orderDatalist.mark">
<el-divider></el-divider>
<div class="title">用户备注</div>
<div class="acea-row">
<div class="description-term">{{orderDatalist.mark}}</div>
</div>
</template>
</div>
<template v-if="orderDatalist.deliveryType === 'express'">
<el-divider></el-divider>
<div class="title">物流信息</div>
<div class="acea-row">
<div class="description-term">快递公司{{orderDatalist.deliveryName}}</div>
<div class="description-term">快递单号{{orderDatalist.deliveryId}}</div>
</el-dialog>
<el-dialog
v-if="orderDatalist"
title="提示"
:visible.sync="modal2"
width="30%">
<div class="logistics acea-row row-top">
<div class="logistics_img"><img src="@/assets/imgs/expressi.jpg"></div>
<div class="logistics_cent">
<span class="mb10">物流公司{{orderDatalist.deliveryName}}</span>
<span>物流单号{{orderDatalist.deliveryId}}</span>
</div>
</template>
<template v-if="orderDatalist.deliveryType === 'send'">
<el-divider></el-divider>
<div class="title">配送信息</div>
<div class="acea-row">
<div class="description-term">送货人姓名{{orderDatalist.deliveryName}}</div>
<div class="description-term">送货人电话{{orderDatalist.deliveryId}}</div>
</div>
<div class="acea-row row-column-around trees-coadd">
<div class="scollhide">
<el-timeline :reverse="reverse">
<el-timeline-item v-for="(item,i) in result" :key="i">
<p class="time" v-text="item.time"></p>
<p class="content" v-text="item.status"></p>
</el-timeline-item>
</el-timeline >
</div>
</template>
<template v-if="orderDatalist.mark">
<el-divider></el-divider>
<div class="title">用户备注</div>
<div class="acea-row">
<div class="description-term">{{orderDatalist.mark}}</div>
</div>
</template>
</div>
</el-dialog>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="dialogVisible = false"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { orderDetailApi } from '@/api/order'
import { orderDetailApi, getLogisticsInfoApi } from '@/api/order'
export default {
name: 'OrderDetail',
props: {
@@ -80,20 +113,34 @@ export default {
},
data() {
return {
reverse: true,
dialogVisible: false,
orderDatalist: null,
loading: false
loading: false,
modal2: false,
result: []
}
},
mounted() {
},
methods: {
openLogistics () {
this.getOrderData()
this.modal2 = true;
},
// 获取订单物流信息
getOrderData () {
getLogisticsInfoApi({id:this.orderId}).then(async res => {
this.result = res.result;
})
},
getDetail(id) {
this.loading = true
orderDetailApi({id: id}).then(res => {
this.orderDatalist = res
this.loading = false
}).catch(() => {
this.orderDatalist = null
this.loading = false
})
}
@@ -102,20 +149,68 @@ export default {
</script>
<style scoped lang="scss">
.title{
margin-bottom: 16px;
color: #17233d;
font-weight: 500;
font-size: 14px;
}
.description{
&-term {
display: table-cell;
padding-bottom: 10px;
line-height: 20px;
width: 50%;
font-size: 12px;
.logistics {
align-items: center;
padding: 10px 0px;
.logistics_img {
width: 45px;
height: 45px;
margin-right: 12px;
img {
width: 100%;
height: 100%;
}
}
.logistics_cent {
span {
display: block;
font-size: 12px;
}
}
}
.trees-coadd {
width: 100%;
height: 400px;
border-radius: 4px;
overflow: hidden;
.scollhide {
width: 100%;
height: 100%;
overflow: auto;
margin-left: 18px;
padding: 10px 0 10px 0;
box-sizing: border-box;
.content {
font-size: 12px;
}
.time {
font-size: 12px;
color: #2d8cf0;
}
}
}
.title {
margin-bottom: 10px;
color: #17233d;
font-weight: 500;
font-size: 14px;
}
.description {
&-term {
display: table-cell;
padding-bottom: 5px;
line-height: 20px;
width: 50%;
font-size: 12px;
}
/deep/ .el-divider--horizontal {
margin: 12px 0 !important;
}
}
}
</style>

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :visible.sync="modals" title="订单记录" class="order_box">
<el-form ref="formItem" :model="formItem" label-width="110px" @submit.native.prevent>
<el-dialog :visible.sync="modals" title="订单记录" class="order_box" :before-close="handleClose" width="600px">
<el-form ref="formItem" :model="formItem" label-width="110px" @submit.native.prevent :rules="rules">
<el-form-item label="选择类型:">
<el-radio-group v-model="formItem.type" @change="changeRadio(formItem.type)">
<el-radio label="1">发货</el-radio>
@@ -9,25 +9,59 @@
</el-radio-group>
</el-form-item>
<div v-if="formItem.type==='1'">
<el-form-item label="快递公司" prop="expressId"
:rules="[{ required: true, message: '请选择快递公司', trigger: 'change' }]">
<el-select v-model="formItem.expressId" style="width:80%;">
<el-option v-for="(item,i) in express" :value="item.id" :key="i" :label="item.name"></el-option>
<el-form-item label="发货类型" prop="expressId">
<el-radio-group v-model="formItem.expressRecordType" @change="changeRadio(formItem.expressRecordType)">
<el-radio label="1">手动填写</el-radio>
<el-radio label="2">电子面单打印</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="快递公司:" prop="expressCode">
<el-select v-model="formItem.expressCode" filterable style="width:80%;" @change="onChangeExport(formItem.expressCode)">
<el-option v-for="(item,i) in express" :value="item.code" :key="i" :label="item.name"></el-option>
</el-select>
</el-form-item>
<el-form-item label="快递单号:" prop="expressCode"
:rules="[{ required: true, message: '请输入快递单号', trigger: 'blur' }]">
<el-input v-model="formItem.expressCode" placeholder="请输入快递单号" style="width:80%;"></el-input>
<el-form-item v-if="formItem.expressRecordType === '1'" label="快递单号:" prop="expressNumber">
<el-input v-model="formItem.expressNumber" placeholder="请输入快递单号" style="width:80%;"></el-input>
</el-form-item>
<template v-if="formItem.expressRecordType === '2'">
<el-form-item label="电子面单:" class="express_temp_id" prop="expressTempId">
<div class="acea-row">
<el-select v-model="formItem.expressTempId" placeholder="请选择电子面单" :class="[formItem.expressTempId?'width9':'width8']" @change="onChangeImg">
<el-option v-for="(item,i) in exportTempList" :value="item.temp_id" :key="i" :label="item.title"></el-option>
</el-select>
<div v-if="formItem.expressTempId" style="position: relative;">
<!--<span class="tempImg" @click="">预览</span>-->
<div class="tempImgList ml10">
<div class="demo-image__preview">
<el-image
style="width: 36px; height: 36px"
:src="tempImg"
:preview-src-list="[tempImg]"
/>
</div>
</div>
</div>
<!--<Button v-if="formItem.expressTempId" type="text" @click="preview">预览</Button>-->
</div>
</el-form-item>
<el-form-item label="寄件人姓名:" prop="toName">
<el-input v-model="formItem.toName" placeholder="请输入寄件人姓名" style="width:80%;"></el-input>
</el-form-item>
<el-form-item label="寄件人电话:" prop="toTel">
<el-input v-model="formItem.toTel" placeholder="请输入寄件人电话" style="width:80%;"></el-input>
</el-form-item>
<el-form-item label="寄件人地址:" prop="toAddr">
<el-input v-model="formItem.toAddr" placeholder="请输入寄件人地址" style="width:80%;"></el-input>
</el-form-item>
</template>
</div>
<div v-if="formItem.type==='2'">
<el-form-item label="送货人姓名:" prop="expressId"
:rules="[{ required: true, message: '请输入送货人姓名', trigger: 'blur' }]">
<el-input v-model="formItem.expressId" placeholder="请输入送货人姓名" style="width:80%;"></el-input>
<el-form-item label="送货人姓名:" prop="deliveryName">
<el-input v-model="formItem.deliveryName" placeholder="请输入送货人姓名" style="width:80%;"></el-input>
</el-form-item>
<el-form-item label="送货人电话:" prop="expressCode"
:rules="[{ required: true, message: '请输入送货人电话', trigger: 'blur' }]">
<el-input v-model="formItem.expressCode" placeholder="请输入送货人电话" style="width:80%;"></el-input>
<el-form-item label="送货人电话:" prop="deliveryTel">
<el-input v-model="formItem.deliveryTel" placeholder="请输入送货人电话" style="width:80%;"></el-input>
</el-form-item>
</div>
</el-form>
@@ -39,8 +73,17 @@
</template>
<script>
import { orderSendApi } from '@/api/order'
import { expressList } from '@/api/logistics';
import { orderSendApi, sheetInfoApi } from '@/api/order'
import { expressAllApi, exportTempApi } from '@/api/sms'
const validatePhone = (rule, value, callback) => {
if (!value) {
return callback(new Error('请填写手机号'));
} else if (!/^1[3456789]\d{9}$/.test(value)) {
callback(new Error('手机号格式不正确!'));
} else {
callback();
}
};
export default {
name: 'orderSend',
props: {
@@ -50,17 +93,78 @@
return {
formItem: {
type: '1',
expressRecordType: '1',
expressId: '',
expressCode: '',
id: ''
id: '',
deliveryName: '',
deliveryTel: '',
// expressName: '',
expressNumber:'',
expressTempId: '',
toAddr: '',
toName: '',
toTel: '',
},
modals: false,
express: []
express: [],
exportTempList: [],
tempImg: '',
rules: {
toName: [
{ required: true, message: '请输寄件人姓名', trigger: 'blur' }
],
toTel: [
{ required: true, validator: validatePhone, trigger: 'blur' }
],
toAddr: [
{ required: true, message: '请输入寄件人地址', trigger: 'blur' }
],
expressCode: [
{ required: true, message: '请选择快递公司', trigger: 'change' }
],
expressNumber: [
{ required: true, message: '请输入快递单号', trigger: 'blur' }
],
expressTempId: [
{ required: true, message: '请选择电子面单', trigger: 'change' }
],
deliveryName: [
{ required: true, message: '请输入送货人姓名', trigger: 'blur' }
],
deliveryTel: [
{ required: true, validator: validatePhone, trigger: 'blur' }
]
}
}
},
mounted () {
},
methods: {
// 默认信息
sheetInfo () {
sheetInfoApi().then(async res => {
this.formItem.toAddr= res.exportToAddress || '';
this.formItem.toName= res.exportToName || '';
this.formItem.toTel= res.exportToTel || '';
})
},
// 快递公司选择
onChangeExport (val) {
this.formItem.expressTempId = '';
this.exportTemp(val);
},
// 电子面单模板
exportTemp (val) {
exportTempApi({ com: val }).then(async res => {
this.exportTempList = res.data.data || [];
})
},
onChangeImg (item) {
this.exportTempList.map(i => {
if (i.temp_id === item) this.tempImg = i.pic
})
},
changeRadio (o) {
if( o === '3'){
this.formItem.expressId = ''
@@ -69,8 +173,8 @@
},
// 物流公司列表
getList () {
expressList({ page: 1, limit: 999, isShow:1 }).then(async res => {
this.express = res.list
expressAllApi().then(async res => {
this.express = res
})
},
// 提交
@@ -89,15 +193,39 @@
}
})
},
handleClose(){
this.cancel('formItem');
},
cancel (name) {
this.modals = false;
this.$refs[name].resetFields();
this.formItem.type = '1';
this.formItem.expressRecordType = '1';
}
}
}
</script>
<style scoped>
<style scoped lang="scss">
.width8 {
width: 80%;
}
.width9 {
width: 70%;
}
.tempImgList {
// opacity: 1;
width: 38px !important;
height: 30px !important;
// margin-top: -30px;
cursor: pointer;
position: absolute;
z-index: 11;
img {
width: 38px !important;
height: 30px !important;
}
}
</style>

View File

@@ -0,0 +1,228 @@
<template>
<div class="login-container">
<el-steps :active="current" align-center>
<el-step title="验证账号信息"></el-step>
<el-step title="修改账户密码"></el-step>
<el-step title="登录"></el-step>
</el-steps>
<el-form ref="formInline" :model="formInline" size="medium" :rules="ruleInline" class="login-form" autocomplete="on" label-position="left">
<template v-if="current === 0">
<el-form-item prop="phone">
<el-input type="text" v-model="formInline.phone" prefix="ios-contact-outline"
placeholder="请输入手机号" size="large"/>
</el-form-item>
<el-form-item prop="code" class="captcha">
<div class="acea-row" style="flex-wrap: nowrap;">
<el-input
ref="username"
v-model="formInline.code"
placeholder="验证码"
name="username"
type="text"
tabindex="1"
autocomplete="off"
prefix-icon="el-icon-message"
style="width: 90%"
/>
<el-button size="mini" :disabled=!this.canClick @click="cutDown">{{cutNUm}}</el-button>
</div>
</el-form-item>
</template>
<template v-if="current === 1">
<el-form-item prop="password" class="maxInpt">
<el-input type="password" v-model="formInline.password" prefix="ios-lock-outline"
placeholder="请输入新密码" size="large"/>
</el-form-item>
<el-form-item prop="checkPass" class="maxInpt">
<el-input type="password" v-model="formInline.checkPass" prefix="ios-lock-outline"
placeholder="请验证新密码" size="large"/>
</el-form-item>
</template>
<template v-if="current === 2">
<el-form-item prop="phone" class="maxInpt">
<el-input type="text" v-model="formInline.phone" prefix="ios-contact-outline"
placeholder="请输入手机号"/>
</el-form-item>
<el-form-item prop="password" class="maxInpt">
<el-input type="password" v-model="formInline.password" prefix="ios-lock-outline"
placeholder="请输入密码"/>
</el-form-item>
</template>
<el-form-item class="maxInpt">
<el-button v-if="current === 0" type="primary" @click="handleSubmit1('formInline',current)" class="mb20 width100">下一步</el-button>
<el-button v-if="current === 1" type="primary" @click="handleSubmit2('formInline',current)" class="mb20 width100">提交</el-button>
<el-button v-if="current === 2" type="primary" @click="handleSubmit('formInline',current)" class="mb20 width100">登录</el-button>
<el-button @click="returns('formInline')" class="width100" style="margin-left: 0px;">返回</el-button>
</el-form-item>
<!--<el-button v-if="current === 0" size="mini" :loading="loading" type="primary" style="width:100%;margin-bottom:20px;" @click="handleSubmit('formInline')">注册</el-button>-->
<!--<el-button size="mini" type="primary" style="width:100%;margin-bottom:20px;" @click="changelogo">立即登录</el-button>-->
</el-form>
</div>
</template>
<script>
import { updatePasswordApi, captchaApi, configApi } from '@/api/sms';
export default {
name: 'forgetPassword',
data () {
const validatePhone = (rule, value, callback) => {
if (!value) {
return callback(new Error('请填写手机号'));
} else if (!/^1[3456789]\d{9}$/.test(value)) {
callback(new Error('手机号格式不正确!'));
} else {
callback();
}
};
var validatePass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入密码'));
}else {
if(this.current === 1){
if (this.formInline.checkPass !== '') {
this.$refs.formInline.validateField('checkPass');
}
callback();
}else{
if(value !== this.formInline.checkPass){
callback(new Error('请输入正确密码!'));
}
callback();
}
}
};
var validatePass2 = (rule, value, callback) => {
if (value === '') {
callback(new Error('请再次输入密码'));
} else if (value !== this.formInline.password) {
callback(new Error('两次输入密码不一致!'));
} else {
callback();
}
};
return {
cutNUm: '获取验证码',
canClick: true,
current: 0,
formInline: {
account: '',
phone: '',
code: '',
password: '',
checkPass: '',
},
ruleInline: {
phone: [
{ required: true, validator: validatePhone, trigger: 'blur' }
],
code: [
{ required: true, message: '请输入验证码', trigger: 'blur' }
],
password: [
{ validator: validatePass, trigger: 'blur' }
],
checkPass: [
{ validator: validatePass2, trigger: 'blur' }
],
}
}
},
methods: {
// 短信验证码
cutDown () {
if (this.formInline.phone) {
if (!this.canClick) return;
this.canClick = false;
this.cutNUm = 60;
let data = {
phone: this.formInline.phone,
types: 1
};
captchaApi(data).then(async res => {
this.$message.success(res.msg);
})
let time = setInterval(() => {
this.cutNUm--;
if (this.cutNUm === 0) {
this.cutNUm = '获取验证码';
this.canClick = true;
clearInterval(time)
}
}, 1000)
} else {
this.$message.warning('请填写手机号!');
}
},
handleSubmit1 (name, current) {
this.$refs[name].validate((valid) => {
if (valid) {
this.current = 1;
} else {
return false;
}
})
},
handleSubmit2(name) {
this.formInline.account = this.formInline.phone
this.$refs[name].validate((valid) => {
if (valid) {
updatePasswordApi(this.formInline).then(async res => {
this.$message.success('修改成功');
this.current = 2;
})
} else {
return false;
}
})
},
//登录
handleSubmit (name) {
this.$refs[name].validate((valid) => {
if (valid) {
configApi({
account: this.formInline.account,
password: this.formInline.password
}).then(async res => {
this.$message.success('登录成功!');
this.$emit('on-Login');
})
} else {
return false;
}
})
},
returns () {
this.current === 0 ? this.$emit('goback'): this.current = 0
}
}
}
</script>
<style scoped lang="scss">
.login-form {
flex: 1;
padding: 32px 0;
text-align: center;
width: 384px;
margin: 0 auto;
overflow: hidden;
}
.width100{
width: 100%;
}
.maxInpt{
max-width:400px;
margin-left:auto;
margin-right:auto;
}
.code {
display: flex;
align-items: center;
justify-content: center;
}
.ivu-steps-item:last-child{
width: unset!important;
}
</style>

View File

@@ -0,0 +1,217 @@
<template>
<div class="login-container">
<el-steps :active="current" align-center>
<el-step title="验证账号信息"></el-step>
<el-step title="修改手机号码"></el-step>
<el-step title="登录"></el-step>
</el-steps>
<el-form ref="formInline" :model="formInline" size="medium" :rules="ruleInline" class="login-form" autocomplete="on" label-position="left">
<template v-if="current === 0">
<el-form-item prop="account">
<el-input type="text" v-model="formInline.account" prefix="ios-contact-outline"
placeholder="请输入当前手机号" size="large"/>
</el-form-item>
<el-form-item prop="password">
<el-input type="password" v-model="formInline.password" prefix="ios-contact-outline"
placeholder="请输入密码" size="large"/>
</el-form-item>
</template>
<template v-if="current === 1">
<el-form-item prop="phone" class="maxInpt">
<el-input type="text" v-model="formInline.phone" prefix="ios-lock-outline"
placeholder="请输入新手机号" size="large"/>
</el-form-item>
<el-form-item prop="code" class="captcha">
<div class="acea-row" style="flex-wrap: nowrap;">
<el-input
ref="username"
v-model="formInline.code"
placeholder="验证码"
name="username"
type="text"
tabindex="1"
autocomplete="off"
prefix-icon="el-icon-message"
style="width: 90%"
/>
<el-button size="mini" :disabled=!this.canClick @click="cutDown">{{cutNUm}}</el-button>
</div>
</el-form-item>
</template>
<template v-if="current === 2">
<el-form-item prop="phone" class="maxInpt">
<el-input type="text" v-model="formInline.phone" prefix="ios-contact-outline"
placeholder="请输入手机号"/>
</el-form-item>
<el-form-item prop="password" class="maxInpt">
<el-input type="password" v-model="formInline.password" prefix="ios-lock-outline"
placeholder="请输入密码"/>
</el-form-item>
</template>
<el-form-item class="maxInpt">
<el-button v-if="current === 0" type="primary" @click="handleSubmit1('formInline',current)" class="mb20 width100">下一步</el-button>
<el-button v-if="current === 1" type="primary" @click="handleSubmit2('formInline',current)" class="mb20 width100">提交</el-button>
<el-button v-if="current === 2" type="primary" @click="handleSubmit('formInline',current)" class="mb20 width100">登录</el-button>
<el-button @click="returns('formInline')" class="width100" style="margin-left: 0px;">返回</el-button>
</el-form-item>
<!--<el-button v-if="current === 0" size="mini" :loading="loading" type="primary" style="width:100%;margin-bottom:20px;" @click="handleSubmit('formInline')">注册</el-button>-->
<!--<el-button size="mini" type="primary" style="width:100%;margin-bottom:20px;" @click="changelogo">立即登录</el-button>-->
</el-form>
</div>
</template>
<script>
import { captchaApi, configApi, updateHoneApi } from '@/api/sms';
export default {
name: 'forgetPhone',
props: {
isIndex: {
type: Boolean,
default: false
}
},
data () {
const validatePhone = (rule, value, callback) => {
if (!value) {
return callback(new Error('请填写手机号'));
} else if (!/^1[3456789]\d{9}$/.test(value)) {
callback(new Error('手机号格式不正确!'));
} else {
callback();
}
};
var validatePass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入密码'));
} else {
if (this.formInline.checkPass !== '') {
this.$refs.formInline.validateField('checkPass');
}
callback();
}
};
return {
cutNUm: '获取验证码',
canClick: true,
current: 0,
formInline: {
account: '',
phone: '',
code: '',
password: '',
},
ruleInline: {
phone: [
{ required: true, validator: validatePhone, trigger: 'blur' }
],
code: [
{ required: true, message: '请输入验证码', trigger: 'blur' }
],
password: [
{ required: true, message: '请输入密码', trigger: 'blur' }
],
account: [
{ required: true, validator: validatePhone, trigger: 'blur' }
]
}
}
},
methods: {
// 短信验证码
cutDown () {
if (this.formInline.phone) {
if (!this.canClick) return;
this.canClick = false;
this.cutNUm = 60;
let data = {
phone: this.formInline.phone,
types: 1
};
captchaApi(data).then(async res => {
this.$message.success(res.msg);
})
let time = setInterval(() => {
this.cutNUm--;
if (this.cutNUm === 0) {
this.cutNUm = '获取验证码';
this.canClick = true;
clearInterval(time)
}
}, 1000)
} else {
this.$message.warning('请填写手机号!');
}
},
handleSubmit1 (name) {
this.$refs[name].validate((valid) => {
if (valid) {
this.handleSubmit(name,1);
} else {
return false;
}
})
},
handleSubmit2(name) {
this.$refs[name].validate((valid) => {
if (valid) {
updateHoneApi(this.formInline).then(async res => {
this.$message.success('操作成功')
this.current = 2;
})
} else {
return false;
}
})
},
//登录
handleSubmit (name,num) {
this.$refs[name].validate((valid) => {
if (valid) {
configApi({
account: this.formInline.account,
password: this.formInline.password
}).then(async res => {
num===1?this.$message.success("原手机号密码正确"):this.$message.success("登录成功");
num===1?this.current = 1:this.$emit('on-Login');
})
} else {
return false;
}
})
},
returns () {
this.current === 0 ? this.$emit('gobackPhone'): this.current = 0
}
}
}
</script>
<style scoped lang="scss">
.login-form {
flex: 1;
padding: 32px 0;
text-align: center;
width: 384px;
margin: 0 auto;
overflow: hidden;
}
.width100{
width: 100%;
}
.maxInpt{
max-width:400px;
margin-left:auto;
margin-right:auto;
}
.code {
display: flex;
align-items: center;
justify-content: center;
}
.ivu-steps-item:last-child{
width: unset!important;
}
</style>

View File

@@ -5,7 +5,7 @@
<el-form ref="formInline" size="small" :model="formInline" :rules="ruleInline" class="login-form"
autocomplete="on" label-position="left">
<div class="title-container">
<h3 class="title">短信账户登录</h3>
<h3 class="title mb15">短信账户登录</h3>
</div>
<el-form-item prop="account">
<el-input
@@ -19,14 +19,14 @@
autocomplete="off"
/>
</el-form-item>
<el-form-item prop="token">
<el-form-item prop="password">
<el-input
:key="passwordType"
ref="token"
v-model="formInline.token"
ref="password"
v-model="formInline.password"
:type="passwordType"
placeholder="密码"
name="token"
name="password"
tabindex="2"
auto-complete="off"
prefix-icon="el-icon-lock"
@@ -38,7 +38,7 @@
<el-button size="mini" :loading="loading" type="primary" style="width:100%;margin-bottom:20px;"
@click="handleSubmit('formInline')">登录
</el-button>
<el-button size="mini" type="text" style="width: 100%;" @click="changeReg">注册账户</el-button>
<el-button size="mini" type="text" style="width: 100%;margin-left: 0" @click="changeReg">注册账户</el-button>
</el-form>
</el-col>
</el-row>
@@ -53,13 +53,13 @@ export default {
return {
formInline: {
account: '',
token: ''
password: ''
},
ruleInline: {
account: [
{ required: true, message: '请输入用户名', trigger: 'blur' }
],
token: [
password: [
{ required: true, message: '请输入密码', trigger: 'blur' }
]
},
@@ -90,12 +90,14 @@ export default {
handleSubmit(name) {
this.$refs[name].validate((valid) => {
if (valid) {
this.loading = true;
configApi(this.formInline).then(async res => {
this.$message.success('登录成功!')
this.$store.dispatch('user/isLogin')
this.$emit('on-Login')
}).catch(res => {
this.$message.error(res.message)
this.loading = false;
}).catch(()=>{
this.loading = false;
})
} else {
return false

View File

@@ -2,28 +2,21 @@
<div class="login-container">
<el-form ref="formInline" size="small" :model="formInline" :rules="ruleInline" class="login-form" autocomplete="on" label-position="left">
<div class="title-container">
<h3 class="title">短信账户注册</h3>
<h3 class="title mb15">一号通账户注册</h3>
</div>
<el-form-item prop="account">
<el-form-item prop="phone">
<el-input
ref="account"
v-model="formInline.account"
placeholder="请输入短信平台账号"
prefix-icon="el-icon-user"
name="username"
type="text"
tabindex="1"
auto-complete="off"
v-model="formInline.phone"
placeholder="请输入您的手机号"
prefix-icon="el-icon-phone-outline"
/>
</el-form-item>
<el-form-item prop="password">
<el-input
:key="passwordType"
ref="password"
v-model="formInline.password"
:type="passwordType"
placeholder="请输入短信平台密码/token"
name="password"
tabindex="2"
auto-complete="off"
prefix-icon="el-icon-lock"
@@ -34,38 +27,16 @@
</el-form-item>
<el-form-item prop="domain">
<el-input
ref="password"
v-model="formInline.domain"
placeholder="请输入网址域名"
name="password"
prefix-icon="el-icon-position"
/>
</el-form-item>
<el-form-item prop="phone">
<el-input
ref="password"
v-model="formInline.phone"
placeholder="请输入您的手机号"
prefix-icon="el-icon-phone-outline"
name="password"
/>
</el-form-item>
<el-form-item prop="sign">
<el-input
ref="password"
v-model="formInline.sign"
placeholder="请输入短信签名例如CRMEB"
name="password"
prefix-icon="el-icon-price-tag"
/>
</el-form-item>
<el-form-item prop="code" class="captcha">
<div class="acea-row" style="flex-wrap: nowrap;">
<el-input
ref="username"
v-model="formInline.code"
placeholder="验证码"
name="username"
type="text"
tabindex="1"
autocomplete="off"
@@ -75,8 +46,8 @@
<el-button size="mini" :disabled=!this.canClick @click="cutDown">{{cutNUm}}</el-button>
</div>
</el-form-item>
<el-button size="mini" :loading="loading" type="primary" style="width:100%;margin-bottom:20px;" @click="handleSubmit('formInline')">注册</el-button>
<el-button size="mini" type="primary" style="width:100%;margin-bottom:20px;" @click="changelogo">立即登录</el-button>
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:20px;" @click="handleSubmit('formInline')">注册</el-button>
<el-button type="primary" style="width:100%;margin-bottom:20px;" @click="changelogo">立即登录</el-button>
</el-form>
</div>
</template>
@@ -106,13 +77,9 @@ export default {
code: '',
domain: '',
phone: '',
sign: '',
password: ''
},
ruleInline: {
account: [
{ required: true, message: '请输入短信平台账号', trigger: 'blur' }
],
password: [
{ required: true, message: '请输入短信平台密码/token', trigger: 'blur' }
],
@@ -122,9 +89,6 @@ export default {
phone: [
{ required: true, validator: validatePhone, trigger: 'blur' }
],
sign: [
{ required: true, message: '请输入短信签名', trigger: 'blur' }
],
code: [
{ required: true, message: '请输入验证码', trigger: 'blur' }
]
@@ -148,8 +112,11 @@ export default {
if (!this.canClick) return
this.canClick = false
this.cutNUm = 60
captchaApi(this.formInline.phone).then(async res => {
this.$message.success(res.data.message)
captchaApi({
phone: this.formInline.phone,
types: 0
}).then(async res => {
this.$message.success('发送成功')
})
const time = setInterval(() => {
this.cutNUm--
@@ -165,13 +132,18 @@ export default {
},
// 注册
handleSubmit(name) {
this.formInline.account = this.formInline.phone
this.$refs[name].validate((valid) => {
if (valid) {
this.loading = true;
registerApi(this.formInline).then(async res => {
this.$message.success('注册成功')
setTimeout(() => {
this.changelogo()
}, 1000)
this.loading = false;
}).catch(()=>{
this.loading = false;
})
} else {
return false

View File

@@ -1,19 +1,26 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div class="filter-container mb20">
<div>
<el-tabs v-model="tableFrom.type" @tab-click="onChangeType">
<el-tab-pane label="短信" name="sms"></el-tab-pane>
<el-tab-pane label="商品采集" name="copy"></el-tab-pane>
<el-tab-pane label="物流查询" name="expr_query"></el-tab-pane>
<el-tab-pane label="电子面单打印" name="expr_dump"></el-tab-pane>
</el-tabs>
<!--短信列表-->
<div class="note" v-if="(tableFrom.type==='sms' && sms.open === 1) || (tableFrom.type==='expr_query' && query.open === 1) || (tableFrom.type==='copy' && copy.open === 1) || (tableFrom.type==='expr_dump' && dump.open === 1)">
<div class="filter-container mb20" v-if="tableFrom.type === 'sms'">
<div class="demo-input-suffix">
<span class="seachTiele">短信状态</span>
<el-radio-group v-model="tableFrom.resultCode" size="small" @change="getList">
<el-radio-button label="">全部</el-radio-button>
<el-radio-button label="100">成功</el-radio-button>
<el-radio-button label="130">失败</el-radio-button>
<el-radio-button label="131">空号</el-radio-button>
<el-radio-button label="132">停机</el-radio-button>
<el-radio-button label="133">关机</el-radio-button>
<el-radio-button label="134">无状态</el-radio-button>
<el-radio-button label="400">黑名单</el-radio-button>
<el-radio-group v-model="tableFrom.status" size="small" @change="getList" class="mr20">
<el-radio-button label="3">全部</el-radio-button>
<el-radio-button label="1">成功</el-radio-button>
<el-radio-button label="2">失败</el-radio-button>
<el-radio-button label="0">发送中</el-radio-button>
</el-radio-group>
<router-link :to="{path: '/operation/systemSms/template'}">
<el-button type="primary" size="mini" class="mr20">短信模板</el-button>
</router-link>
<el-button size="mini" @click="editSign">修改签名</el-button>
</div>
</div>
<el-table
@@ -24,40 +31,17 @@
highlight-current-row
>
<el-table-column
prop="id"
label="ID"
min-width="50"
/>
<el-table-column
prop="phone"
label="手机号"
min-width="120"
/>
<el-table-column
prop="content"
label="模板内容"
min-width="450"
/>
<el-table-column
prop="template"
label="模板ID"
min-width="100"
/>
<el-table-column
prop="memo"
label="备注"
min-width="200"
/>
<el-table-column
label="发送时间"
min-width="150"
prop="createTime"
/>
<el-table-column
prop="resultcode"
label="状态码"
min-width="100"
/>
v-for="(item, index) in columns2" :key="index"
:prop="item.key"
:label="item.title"
:min-width="item.minWidth">
<template slot-scope="scope">
<div v-if="['content'].indexOf(item.key) > -1" class="demo-image__preview">
<span>{{scope.row[item.key].num}}</span>
</div>
<span v-else>{{ scope.row[item.key] }}</span>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
@@ -70,18 +54,170 @@
@current-change="pageChange"
/>
</div>
</el-card>
</div>
<!--无开通-->
<div v-else>
<!--开通按钮-->
<div v-if="(tableFrom.type==='sms' && !isSms) || (tableFrom.type==='expr_dump' && !isDump) || ((tableFrom.type==='copy' || tableFrom.type==='expr_query') && !isCopy)" class="wuBox acea-row row-column-around row-middle">
<div class="wuTu"><img src="../../../../assets/imgs/wutu.png"></div>
<div class="mb15">
<span class="wuSp1">{{tableFrom.type | onePassTypeFilter}}未开通哦</span>
<span class="wuSp2">点击立即开通按钮即可使用{{tableFrom.type | onePassTypeFilter}}服务哦</span>
</div>
<el-button size="medium" type="primary" @click="onOpenIndex(tableFrom.type)">立即开通</el-button>
</div>
<!--短信立即开通/开通电子面单服务-->
<div class="smsBox" v-if="(isDump && tableFrom.type==='expr_dump') || (isSms && tableFrom.type==='sms')">
<div class="index_from page-account-container">
<div class="page-account-top">
<span class="page-account-top-tit">开通电子面单服务</span>
</div>
<el-form ref="formInlineDump" :model="formInlineDump" :rules="ruleInline" @submit.native.prevent @keyup.enter="handleSubmitDump('formInlineDump')">
<el-form-item prop="sign" class="maxInpt" v-if="isSms && tableFrom.type==='sms'" key="1">
<el-input type="text" v-model="formInlineDump.sign" prefix="ios-contact-outline" placeholder="请输入短信签名"/>
</el-form-item>
<template v-if="isDump && tableFrom.type==='expr_dump'">
<el-form-item prop="com" class="maxInpt">
<el-select v-model="formInlineDump.com" filterable placeholder="请选择快递公司" @change="onChangeExport" style="text-align: left;" class="width10">
<el-option v-for="(item,index) in exportList" :value="item.code" :key="index" :label="item.name"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="temp_id" class="tempId maxInpt">
<div class="acea-row">
<el-select v-model="formInlineDump.tempId" placeholder="请选择电子面单模板" style="text-align: left;" :class="[formInlineDump.tempId?'width9':'width10']" @change="onChangeImg">
<el-option v-for="(item, index) in exportTempList" :value="item.temp_id" :key="index" :label="item.title"></el-option>
</el-select>
<div v-if="formInlineDump.tempId" style="position: relative;">
<!--<span class="tempImg" @click="">预览</span>-->
<div class="tempImgList ml10">
<div class="demo-image__preview">
<el-image
style="width: 36px; height: 36px"
:src="tempImg"
:preview-src-list="[tempImg]"
/>
</div>
</div>
</div>
</div>
</el-form-item>
<el-form-item prop="toName" class="maxInpt">
<el-input type="text" v-model="formInlineDump.toName" prefix="ios-contact-outline"
placeholder="请填写寄件人姓名"/>
</el-form-item>
<el-form-item prop="toTel" class="maxInpt">
<el-input type="text" v-model="formInlineDump.toTel" prefix="ios-contact-outline"
placeholder="请填写寄件人电话"/>
</el-form-item>
<el-form-item prop="toAddress" class="maxInpt">
<el-input type="text" v-model="formInlineDump.toAddress" prefix="ios-contact-outline"
placeholder="请填写寄件人详细地址"/>
</el-form-item>
<el-form-item prop="siid" class="maxInpt">
<el-input type="text" v-model="formInlineDump.siid" prefix="ios-contact-outline"
placeholder="请填写云打印编号"/>
</el-form-item>
</template>
<el-form-item class="maxInpt">
<el-button type="primary" size="medium" :loading="loading" @click="handleSubmitDump('formInlineDump')" class="btn width10">立即开通</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
<!--修改签名-->
<el-dialog
title="短信账户签名修改"
:visible.sync="dialogVisible"
width="500px"
:before-close="handleClose">
<el-form ref="formInline" size="small" :model="formInline" :rules="ruleInlineSign" class="login-form" autocomplete="on" label-position="left">
<el-form-item>
<el-input v-model="formInline.account" :disabled="true" prefix-icon="el-icon-user">
</el-input>
</el-form-item>
<el-form-item prop="sign">
<el-input
v-model="formInline.sign"
placeholder="请输入短信签名例如CRMEB"
prefix-icon="el-icon-document"
>
</el-input>
</el-form-item>
<el-form-item prop="phone">
<el-input
v-model="formInline.phone"
placeholder="请输入您的手机号"
prefix-icon="el-icon-phone-outline"
>
</el-input>
</el-form-item>
<el-form-item prop="code" class="captcha">
<div class="acea-row" style="flex-wrap: nowrap;">
<el-input
ref="username"
v-model="formInline.code"
placeholder="验证码"
name="username"
type="text"
tabindex="1"
autocomplete="off"
prefix-icon="el-icon-message"
style="width: 90%"
/>
<el-button size="mini" :disabled=!this.canClick @click="cutDown">{{cutNUm}}</el-button>
</div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSubmit('formInline')"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { smsLstApi } from '@/api/sms'
import { smsLstApi, serviceOpenApi, exportTempApi, expressAllApi, captchaApi, smsSignApi } from '@/api/sms'
import * as commFilter from '@/filters/commFilter';
import Template from "../../../appSetting/wxAccount/wxTemplate/index";
export default {
name: 'TableList',
props: {
copy: {
type: Object,
default: null
},
dump: {
type: Object,
default: null
},
query: {
type: Object,
default: null
},
sms: {
type: Object,
default: null
},
accountInfo: {
type: Object,
default: null
}
},
components: {Template},
data() {
const validatePhone = (rule, value, callback) => {
if (!value) {
return callback(new Error('请填写手机号'));
} else if (!/^1[3456789]\d{9}$/.test(value)) {
callback(new Error('手机号格式不正确!'));
} else {
callback();
}
};
return {
dialogVisible: false,
listLoading: false,
tableData: {
data: [],
@@ -90,20 +226,333 @@ export default {
tableFrom: {
page: 1,
limit: 20,
resultCode: ''
}
status: '',
type: 'sms'
},
columns2: [],
isSms: false, // 是否开通短信
isDump: false, // 是否开通电子面单,是否开通物流查询
isCopy: false, // 是否开通商品采集
modals: false,
loading: false,
formInlineDump: {
tempId: '',
sign: '',
com: '',
toName: '',
toTel: '',
siid: '',
toAddress: '',
type: ''
},
ruleInline: {
sign: [
{ required: true, message: '请输入短信签名', trigger: 'blur' }
],
phone: [
{ required: true, validator: validatePhone, trigger: 'blur' }
],
code: [
{ required: true, message: '请输入验证码', trigger: 'blur' }
],
com: [
{ required: true, message: '请选择快递公司', trigger: 'change' }
],
tempId: [
{ required: true, message: '请选择打印模板', trigger: 'change' }
],
toName: [
{ required: true, message: '请输寄件人姓名', trigger: 'blur' }
],
toTel: [
{ required: true, validator: validatePhone, trigger: 'blur' }
],
siid: [
{ required: true, message: '请输入云打印机编号', trigger: 'blur' }
],
toAddress: [
{ required: true, message: '请输寄件人地址', trigger: 'blur' }
]
},
tempImg: '', // 图片
exportTempList: [], // 电子面单模板
exportList: [], // 快递公司列表
formInline: {
phone: '',
code: '',
sign: ''
},
ruleInlineSign: {
sign: [
{ required: true, message: '请输入短信签名', trigger: 'blur' }
],
phone: [
{ required: true, validator: validatePhone, trigger: 'blur' }
],
code: [
{ required: true, message: '请输入验证码', trigger: 'blur' }
]
},
cutNUm: '获取验证码',
canClick: true,
}
},
watch: {
sms (n) {
if (n.open === 1) this.getList();
}
},
mounted() {
this.getList()
if (this.isChecked === '1' && this.sms.open === 1) this.getList();
},
methods: {
editSign(){
this.formInline.account = this.accountInfo.account;
this.formInline.sign = this.accountInfo.sms.sign;
this.dialogVisible = true;
},
//修改签名
handleSubmit (name) {
this.$refs[name].validate((valid) => {
if (valid) {
smsSignApi(this.formInline).then(async res => {
this.$message.success('修改成功!');
this.dialogVisible = false;
this.$refs[formName].resetFields();
})
} else {
return false;
}
})
},
// 短信验证码
cutDown () {
if (this.formInline.phone) {
if (!this.canClick) return;
this.canClick = false;
this.cutNUm = 60;
let data = {
phone: this.formInline.phone,
types: 1
};
captchaApi(data).then(async res => {
this.$message.success(res.msg);
})
let time = setInterval(() => {
this.cutNUm--;
if (this.cutNUm === 0) {
this.cutNUm = '获取验证码';
this.canClick = true;
clearInterval(time)
}
}, 1000)
} else {
this.$message.warning('请填写手机号!');
}
},
handleClose(){
this.dialogVisible = false
this.$refs['formInline'].resetFields();
},
// 首页去开通
onOpenIndex (val) {
this.tableFrom.type = val;
switch (val) {
case 'sms':
this.isSms = true;
break;
case 'expr_dump':
this.openDump();
break;
default:
this.openOther();
break;
}
},
// 开通其他
openOther () {
this.$confirm(`确定开通${commFilter.onePassTypeFilter(this.tableFrom.type)}吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// this.handleSubmitDump('formInlineDump');
serviceOpenApi({type: this.tableFrom.type}).then(async res => {
this.$message.success('开通成功!');
this.getList();
this.$emit('openService')
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
})
},
// 开通电子面单
openDump () {
this.exportTempAllList();
this.isDump = true;
},
// 物流公司
exportTempAllList () {
expressAllApi().then(async res => {
this.exportList = res;
})
},
// 快递公司选择
onChangeExport (val) {
this.formInlineDump.tempId = '';
this.exportTemp(val);
},
// 电子面单模板
exportTemp (val) {
exportTempApi({ com: val }).then(async res => {
this.exportTempList = res.data.data || [];
})
},
onChangeImg (item) {
this.exportTempList.map(i => {
if (i.temp_id === item) this.tempImg = i.pic
})
},
handleSubmitDump (name) {
this.formInlineDump.type = this.tableFrom.type;
this.$refs[name].validate((valid) => {
if (valid) {
this.loading = true;
serviceOpenApi(this.formInlineDump).then(async res => {
this.$emit('openService');
this.$message.success('开通成功!');
this.getList();
this.loading = false;
}).catch(()=>{
this.loading = false;
})
} else {
return false;
}
})
},
onChangeType () {
this.tableFrom.page = 1
this.getList()
},
// 列表
getList() {
this.listLoading = true
smsLstApi(this.tableFrom).then(res => {
this.tableData.data = res.list
this.tableData.total = res.total
this.tableData.data = res.data
this.tableData.total = res.count
switch (this.tableFrom.type) {
case 'sms':
this.columns2 = [
{
title: '手机号',
key: 'phone',
minWidth: 100
},
{
title: '模板内容',
key: 'content',
minWidth: 590
},
{
title: '发送时间',
key: 'add_time',
minWidth: 150
},
{
title: '状态码',
key: '_resultcode',
minWidth: 100
}
]
break;
case 'expr_dump':
this.columns2 = [
// {
// title: '订单号',
// slot: 'num',
// minWidth: 150
// },
{
title: '发货人',
key: 'from_name',
minWidth: 120
},
{
title: '收货人',
key: 'to_name',
minWidth: 120
},
{
title: '快递单号',
key: 'num',
minWidth: 120
},
{
title: '快递公司编码',
key: 'code',
minWidth: 120
},
{
title: '状态',
key: '_resultcode',
minWidth: 100
},
{
title: '打印时间',
key: 'add_time',
minWidth: 150
}
]
break;
case 'expr_query':
this.columns2 = [
{
title: '快递单号',
key: 'content',
minWidth: 120
},
{
title: '快递公司编码',
key: 'code',
minWidth: 120
},
{
title: '状态',
key: '_resultcode',
minWidth: 120
},
{
title: '添加时间',
key: 'add_time',
minWidth: 150
}
]
break;
default:
this.columns2 = [
{
title: '复制URL',
key: 'url',
minWidth: 400
},
{
title: '请求状态',
key: '_resultcode',
minWidth: 120
},
{
title: '添加时间',
key: 'add_time',
minWidth: 150
}
]
break;
}
this.listLoading = false
}).catch(res => {
this.listLoading = false
@@ -121,6 +570,87 @@ export default {
}
</script>
<style scoped>
<style lang="scss" scoped>
/*@aaa: ~'>>>';*/
.order_box /deep/.ivu-form-item-content{
margin-left: 50px!important;
}
.maxInpt{
max-width:400px;
margin-left:auto;
margin-right:auto;
}
.smsBox .page-account-top{
text-align: center;
margin: 70px 0 30px 0;
}
.note{
margin-top: 15px;
}
.tempImg{
cursor: pointer;
margin-left: 11px;
color: #1890FF;
}
.tempImgList{
// opacity: 1;
width: 38px !important;
height: 30px !important;
// margin-top: -30px;
cursor: pointer;
position: absolute;
z-index: 11;
img{
width: 38px !important;
height: 30px !important;
}
}
.width9{
width: 90%;
}
.width10{
width: 100%;
}
.wuBox{
width: 100%;
}
.wuSp1{
display: block;
text-align: center;
color: #000000;
font-size: 21px;
font-weight: 500;
line-height: 32px;
margin-top: 23px;
margin-bottom: 5px;
}
.wuSp2{
opacity: 45%;
font-weight: 400;
color: #000000;
line-height: 22px;
margin-bottom: 30px;
}
.page-account-top-tit{
font-size: 21px;
color: #1890FF;
}
.wuTu{
width: 295px;
height: 164px;
margin-top: 54px;
img{
width: 100%;
height: 100%;
}
+ span {
margin-bottom: 20px;
}
}
.tempId{
.ivu-form-item-content{
text-align: left !important;
}
}
</style>

View File

@@ -1,6 +1,6 @@
<template>
<div class="divBox">
<el-card v-if="isShowList" v-loading="fullscreenLoading" class="box-card">
<el-card v-if="isShowList" v-loading="fullscreenLoading" class="box-card mb20">
<div class="content acea-row row-middle">
<div class="demo-basic--circle acea-row row-middle">
<div class="circleUrl mr20"><img :src="circleUrl"></div>
@@ -8,41 +8,48 @@
<div class="dashboard-workplace-header-tip">
<div class="dashboard-workplace-header-tip-title">{{ smsAccount }}祝您每一天开心</div>
<div class="dashboard-workplace-header-tip-desc">
<!--<span class="mr10">修改密码</span>-->
<span @click="signOut">退出登录</span>
<span class="mr10" @click="onChangePassswordIndex">修改密码</span>
<span class="mr10" @click="onChangePhone">修改手机号</span>
<span @click="signOut" class="mr10">退出登录</span>
</div>
</div>
</div>
<div class="dashboard-workplace-header-extra">
<el-row type="flex" justify="center" align="middle" :gutter="12">
<el-col :span="8">
<span class="pfont acea-row row-middle">
<el-avatar icon="el-icon-user-solid" size="small" class="mr10" />
<span>剩余条数</span>
</span>
<span class="rR" v-text="numbers" />
</el-col>
<el-col :span="8">
<span class="pfont acea-row row-middle">
<el-avatar icon="el-icon-user-solid" size="small" class="mr10" />
<span>已发送</span>
</span>
<span class="rR" v-text="sendTotal" />
</el-col>
<el-col :span="8">
<span class="pfont acea-row row-middle">
<el-avatar icon="el-icon-user-solid" size="small" class="mr10" />
<span>总条</span>
</span>
<span class="rR" v-text="amount" />
</el-col>
</el-row>
<div class="dashboard">
<div class="dashboard-workplace-header-extra">
<div class="acea-row">
<div class="header-extra">
<p class="mb5"><span>短信条数</span></p>
<p class="mb5">{{sms.num || 0}}</p>
<el-button size="mini" type="primary" @click="sms.open ===0?onOpen('sms'):mealPay('sms')" v-text="sms.open ===0?'开通服务':'套餐购买'"></el-button>
</div>
<div class="header-extra">
<p class="mb5"><span>采集次数</span></p>
<p class="mb5">{{copy.num || 0}}</p>
<el-button size="mini" type="primary" @click="copy.open ===0?onOpen('copy'):mealPay('copy')" v-text="copy.open ===0?'开通服务':'套餐购买'"></el-button>
</div>
<div class="header-extra">
<p class="mb5"><span>物流查询次数</span></p>
<p class="mb5">{{query.num || 0}}</p>
<el-button size="mini" type="primary" @click="query.open ===0?onOpen('expr_query'):mealPay('expr_query')" v-text="query.open ===0?'开通服务':'套餐购买'"></el-button>
</div>
<div class="header-extra" style="border: none;">
<p class="mb5"><span>面单打印次</span> </p>
<p class="mb5">{{dump.num || 0}}</p>
<el-button size="mini" type="primary" @click="dump.open ===0?onOpen('expr_dump'):mealPay('expr_dump')" v-text="dump.open ===0?'开通服务':'套餐购买'"></el-button>
</div>
</div>
</div>
</div>
</div>
</el-card>
<table-list v-if="isShowList" />
<login-from v-if="isShowLogn" @on-changes="onChangeReg" @on-Login="onLogin" />
<register-from v-if="isShowReg" @on-change="logoup" />
<el-card class="box-card" v-loading="loading">
<table-list v-if="isShowList" ref="tableLists" :sms="sms" :copy="copy" :dump="dump" :query="query" :accountInfo="accountInfo" @openService="openService"/>
<login-from v-if="isShowLogn" @on-changes="onChangeReg" @on-Login="onLogin" />
<forget-password v-if="isShow" @goback="goback" @on-Login="onLogin" :isIndex="isIndex"></forget-password>
<forget-phone v-if="isForgetPhone" @gobackPhone="gobackPhone" @on-Login="onLogin"></forget-phone>
<register-from v-if="isShowReg" @on-change="logoup" />
</el-card>
</div>
</template>
@@ -50,24 +57,31 @@
import tableList from './components/tableList'
import loginFrom from './components/loginFrom'
import registerFrom from './components/register'
import forgetPassword from './components/forgetPassword';
import forgetPhone from './components/forgetPhone';
import { logoutApi, smsNumberApi, smsInfoApi } from '@/api/sms'
import { mapGetters } from 'vuex'
export default {
name: 'SmsConfig',
components: { tableList, loginFrom, registerFrom },
components: { tableList, loginFrom, registerFrom, forgetPassword, forgetPhone },
data() {
return {
fullscreenLoading: false,
loading: false,
smsAccount: '',
circleUrl: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
accountInfo:{},
spinShow: false,
isShowLogn: false,
isShow: false,
isShowReg: false,
isShowList: false,
amount: 0,
numbers: 0,
sendTotal: 0
isForgetPhone: false, // 修改手机号
isIndex: false, // 判断忘记密码返回的路径
isShowLogn: false, // 登录
isShow: false, // 修改密码
isShowReg: false, // 注册
isShowList: false, // 登录之后列表
sms: { open: 0 }, // 短信信息
query: { open: 0 }, // 物流查询
dump: { open: 0 }, // 电子面单打印
copy: { open: 0 } // 商品采集
}
},
computed: {
@@ -84,14 +98,78 @@ export default {
// }
},
methods: {
// 开通服务
openService (val) {
this.getNumber();
},
onOpen (val) {
this.$refs.tableLists.onOpenIndex(val);
},
// 手机号返回
gobackPhone () {
this.isShowList = true;
this.isForgetPhone = false;
},
onChangePhone () {
this.isForgetPhone = true
this.isShowLogn = false;
this.isShowList = false;
},
// 密码返回
goback () {
if (this.isIndex) {
this.isShowList = true;
this.isShow = false;
} else {
this.isShowLogn = true;
this.isShow = false;
}
},
// 修改密码
onChangePassswordIndex () {
this.isIndex = true;
this.passsword();
},
passsword () {
this.isShowLogn = false;
this.isShow = true;
this.isShowList = false;
},
mealPay (val) {
this.$router.push({ path:'/operation/systemSms/pay',query:{type:val}});
},
// 剩余条数
getNumber() {
this.loading = true;
smsInfoApi().then(async res => {
const data = res
this.numbers = data.num
this.sendTotal = data.surp
this.amount = data.num + data.surp
this.smsAccount = data.account
let data = res;
this.sms = {
num: data.sms.num,
open: data.sms.open,
surp: data.sms.open
};
this.query = {
num: data.query.num,
open: data.query.open,
surp: data.query.open
};
this.dump = {
num: data.dump.num,
open: data.dump.open,
surp: data.dump.open
};
this.copy = {
num: data.copy.num,
open: data.copy.open,
surp: data.copy.open
};
this.loading = false;
this.smsAccount = data.account;
this.accountInfo = data;
}).catch(res => {
this.isShowLogn = true;
this.isShowList = false;
this.loading = false;
})
},
// 登录跳转
@@ -100,6 +178,7 @@ export default {
if (url) {
this.$router.replace(url)
} else {
this.getNumber()
this.isShowLogn = false
this.isShow = false
this.isShowReg = false
@@ -115,8 +194,8 @@ export default {
this.isShowList = data.status
if (data.status) {
this.smsAccount = data.info
this.getNumber()
}
this.getNumber()
this.fullscreenLoading = false
}).catch(res => {
this.fullscreenLoading = false
@@ -129,8 +208,6 @@ export default {
this.isShowLogn = true
this.isShowList = false
this.$store.dispatch('user/isLogin')
}).catch(res => {
this.$message.error(res.message)
})
},
// 立即注册
@@ -150,6 +227,16 @@ export default {
</script>
<style scoped lang="scss">
.dashboard{
width: auto !important;
min-width: 300px;
}
.header-extra{
/*width: 25%;*/
border-right: 1px solid #E9E9E9;
text-align: center;
padding: 0 18px;
}
$cursor: #1890ff;
.content{
justify-content: space-between;

View File

@@ -1,6 +1,16 @@
<template>
<div class="divBox">
<el-card class="box-card">
<router-link :to="{path:'/operation/onePass'}">
<el-button class="mb35" size="mini" icon="el-icon-arrow-left">返回</el-button>
</router-link>
<el-tabs v-model="tableFrom.type" @tab-click="onChangeType" class="mb20">
<el-tab-pane label="短信" name="sms"></el-tab-pane>
<el-tab-pane label="商品采集" name="copy"></el-tab-pane>
<el-tab-pane label="物流查询" name="expr_query"></el-tab-pane>
<el-tab-pane label="电子面单打印" name="expr_dump"></el-tab-pane>
</el-tabs>
<el-row v-loading="fullscreenLoading" :gutter="16">
<el-col :span="24" class="ivu-text-left mb20">
<el-col :xs="12" :sm="6" :md="4" :lg="3" class="mr20">
@@ -101,7 +111,10 @@ export default {
current: 0,
checkList: {},
fullscreenLoading: false,
code: {}
code: {},
tableFrom: {
type: 'sms'
},
}
},
computed: {
@@ -109,19 +122,24 @@ export default {
'isLogin'
])
},
created () {
this.tableFrom.type = this.$route.query.type;
this.onIsLogin();
},
mounted() {
this.getNumber()
this.getPrice()
return
if (!this.isLogin) {
this.$router.push('/operation/systemSms/config?url=' + this.$route.path)
this.$router.push('/operation/onePass?url=' + this.$route.path)
} else {
this.getNumber()
this.getPrice()
}
},
methods: {
onChangeType (val) {
this.current = 0;
this.getPrice();
this.getNumber()
},
// 查看是否登录
onIsLogin() {
this.fullscreenLoading = true
@@ -129,29 +147,42 @@ export default {
const data = res
if (!data.status) {
this.$message.warning('请先登录')
this.$router.push('/operation/systemSms/config?url=' + this.$route.path)
this.$router.push('/operation/onePass?url=' + this.$route.path)
} else {
this.getNumber()
this.getPrice()
}
this.fullscreenLoading = false
}).catch(res => {
this.$router.push('/operation/systemSms/config?url=' + this.$route.path)
this.$router.push('/operation/onePass?url=' + this.$route.path)
this.fullscreenLoading = false
})
},
// 剩余条数
getNumber() {
smsInfoApi().then(async res => {
const data = res
this.numbers = data.number
this.account = data.account
let data = res;
this.account = data.account;
switch (this.tableFrom.type) {
case 'sms':
this.numbers = data.sms.num
break;
case 'copy':
this.numbers = data.copy.num
break;
case 'expr_dump':
this.numbers = data.dump.num
break;
default:
this.numbers = data.query.num
break;
}
})
},
// 支付套餐
getPrice() {
this.fullscreenLoading = true
smsPriceApi({ page: 1, limit: 9999}).then(async res => {
smsPriceApi(this.tableFrom).then(async res => {
setTimeout(() => {
this.fullscreenLoading = false
}, 800)
@@ -178,7 +209,9 @@ export default {
const data = {
payType: 'weixin',
mealId: item.id,
price: item.price
price: item.price,
num: item.num,
type: this.tableFrom.type
}
payCodeApi(data).then(async res => {
this.code = res

View File

@@ -4,26 +4,9 @@
<el-card v-loading="fullscreenLoading" class="box-card">
<div slot="header" class="clearfix">
<div class="container">
<el-form :inline="true">
<el-form-item label="模板状态:" class="mr10">
<el-select v-model="tableFrom.status" placeholder="请选择" clearable class="filter-item selWidth mr20" @change="userSearchs">
<el-option value="1" label="可用"></el-option>
<el-option value="0" label="不可用"></el-option>
</el-select>
</el-form-item>
<el-form-item label="模板类型:" class="mr10">
<el-select v-model="tableFrom.type" placeholder="请选择" clearable class="filter-item selWidth mr20" @change="userSearchs">
<el-option value="1" label="验证码"></el-option>
<el-option value="2" label="通知"></el-option>
<el-option value="3" label="推广"></el-option>
</el-select>
</el-form-item>
<el-form-item label="模板名称:" class="mr10">
<el-input v-model="tableFrom.title" placeholder="请输入模板名称" class="selWidth">
<el-button slot="append" icon="el-icon-search" @click="userSearchs" />
</el-input>
</el-form-item>
</el-form>
<router-link :to="{path:'/operation/onePass'}">
<el-button class="mb35" size="mini" icon="el-icon-arrow-left">返回</el-button>
</router-link>
</div>
<el-button size="mini" type="primary" @click="add">添加短信模板</el-button>
</div>
@@ -40,7 +23,7 @@
min-width="50"
/>
<el-table-column
prop="templateid"
prop="temp_id"
label="模板ID"
min-width="80"
/>
@@ -59,7 +42,7 @@
min-width="100"
>
<template slot-scope="{row}">
<span>{{ row.type | typesFilter }}</span>
<span>{{ row.temp_type | typesFilter }}</span>
</template>
</el-table-column>
<el-table-column label="模板状态">
@@ -67,11 +50,6 @@
<span>{{ row.status | statusFilter }}</span>
</template>
</el-table-column>
<el-table-column
prop="add_time"
label="添加时间"
min-width="150"
/>
</el-table>
<div class="block">
<el-pagination
@@ -142,10 +120,7 @@ export default {
},
tableFrom: {
page: 1,
limit: 20,
status: '',
title: '',
type: ''
limit: 20
}
}
},
@@ -156,7 +131,7 @@ export default {
},
mounted() {
if (!this.isLogin) {
this.$router.push('/operation/systemSms/config?url=' + this.$route.path)
this.$router.push('/operation/onePass?url=' + this.$route.path)
} else {
this.getList()
}
@@ -187,13 +162,13 @@ export default {
const data = res
if (!data.status) {
this.$message.warning('请先登录')
this.$router.push( '/operation/systemSms/config?url=' + this.$route.path)
this.$router.push( '/operation/onePass?url=' + this.$route.path)
} else {
this.getList()
}
this.fullscreenLoading = false
}).catch(res => {
this.$router.push( '/operation/systemSms/config?url=' + this.$route.path)
this.$router.push( '/operation/onePass?url=' + this.$route.path)
this.fullscreenLoading = false
})
},

View File

@@ -14,7 +14,7 @@
<!-- 商品信息-->
<el-col v-bind="grid2">
<el-form-item label="商品名称:" prop="storeName">
<el-input v-model="formValidate.storeName" placeholder="请输入商品名称" />
<el-input v-model="formValidate.storeName" maxlength="249" placeholder="请输入商品名称" />
</el-form-item>
</el-col>
<el-col v-bind="grid2">
@@ -34,7 +34,7 @@
</el-col>
<el-col v-bind="grid2">
<el-form-item label="商品简介:">
<el-input v-model="formValidate.storeInfo" type="textarea" :rows="3" placeholder="请输入商品简介" />
<el-input v-model="formValidate.storeInfo" type="textarea" maxlength="250" :rows="3" placeholder="请输入商品简介" />
</el-form-item>
</el-col>
<el-col v-bind="grid2">
@@ -63,7 +63,7 @@
<img :src="item">
<i class="el-icon-error btndel" @click="handleRemove(index)" />
</div>
<div class="upLoadPicBox" @click="modalPicTap('2')">
<div v-if="formValidate.sliderImages.length<10" class="upLoadPicBox" @click="modalPicTap('2')">
<div class="upLoad">
<i class="el-icon-camera cameraIconfont" />
</div>
@@ -329,19 +329,17 @@
<el-input v-model="scope.row[iii]" :type="formThead[iii].title==='商品编号'?'text':'number'" class="priceBox" />
</template>
</el-table-column>
<template v-if="formValidate.isSub">
<el-table-column align="center" label="一级返佣(元)" min-width="120">
<template slot-scope="scope">
<el-input v-model="scope.row.brokerage" type="number" :min="0" class="priceBox" />
</template>
</el-table-column>
<el-table-column align="center" label="二级返佣(元)" min-width="120">
<template slot-scope="scope">
<el-input v-model="scope.row.brokerageTwo" type="number" :min="0" class="priceBox" />
</template>
</el-table-column>
</template>
<el-table-column align="center" label="操作" min-width="80">
<el-table-column align="center" label="一级返佣(元)" min-width="120" v-if="formValidate.isSub">
<template slot-scope="scope">
<el-input v-model="scope.row.brokerage" type="number" :min="0" class="priceBox" />
</template>
</el-table-column>
<el-table-column align="center" label="二级返佣(元)" min-width="120" v-if="formValidate.isSub">
<template slot-scope="scope">
<el-input v-model="scope.row.brokerageTwo" type="number" :min="0" class="priceBox" />
</template>
</el-table-column>
<el-table-column key="3" align="center" label="操作" min-width="80">
<template slot-scope="scope">
<el-button type="text" class="submission" @click="delAttrTable(scope.$index)">删除</el-button>
</template>
@@ -366,6 +364,7 @@
import { shippingTemplatesList } from '@/api/logistics'
import { clearTreeData } from '@/utils/ZBKJIutil'
import CreatTemplates from '@/views/systemSetting/logistics/shippingTemplates/creatTemplates'
import Templates from "../../appSetting/wxAccount/wxTemplate/index";
const defaultObj = {
image: '',
sliderImages: [],
@@ -432,7 +431,7 @@
const proOptions = [{ name: '是否热卖', value: 'isHot' }, { name: '优品推荐', value: 'isGood' }, { name: '促销单品', value: 'isBenefit' }, { name: '是否精品', value: 'isBest' }, { name: '是否新品', value: 'isNew' }]
export default {
name: 'ProductProductAdd',
components: { CreatTemplates },
components: {Templates, CreatTemplates },
data() {
return {
activity: { '默认': 'red', '秒杀': 'blue', '砍价': 'green', '拼团': 'yellow' },
@@ -525,7 +524,8 @@
keywords: ''
},
tempRoute: {},
keyNum: 0
keyNum: 0,
isAttr: false
}
},
computed: {
@@ -543,7 +543,7 @@
watch: {
'formValidate.attr': {
handler: function(val) {
if (this.formValidate.specType) this.watCh(val)
if (this.formValidate.specType && this.isAttr) this.watCh(val)
},
immediate: false,
deep: true
@@ -571,6 +571,7 @@
},
methods: {
handleCloseCoupon(tag) {
this.isAttr = true
this.formValidate.coupons.splice(this.formValidate.coupons.indexOf(tag), 1)
},
addCoupon() {
@@ -697,10 +698,12 @@
},
// 选择规格
onChangeSpec(num) {
this.isAttr = true;
if (num) this.productGetRule()
},
// 选择属性确认
confirm() {
this.isAttr = true
if (!this.formValidate.selectRule) {
return this.$message.warning('请选择属性')
}
@@ -810,6 +813,7 @@
},
// 删除规格
handleRemoveAttr(index) {
this.isAttr = true
this.formValidate.attr.splice(index, 1)
this.manyFormValidate.splice(index, 1)
},
@@ -819,6 +823,7 @@
},
// 添加规则名称
createAttrName() {
this.isAttr = true
if (this.formDynamic.attrsName && this.formDynamic.attrsVal) {
const data = {
attrName: this.formDynamic.attrsName,
@@ -841,6 +846,7 @@
},
// 添加属性
createAttr (num, idx) {
this.isAttr = true
if (num) {
this.formValidate.attr[idx].attrValue.push(num);
var hash = {};
@@ -858,6 +864,7 @@
getInfo () {
this.fullscreenLoading = true
productDetailApi(this.$route.params.id).then(async res => {
this.isAttr = false;
let info = res
this.formValidate = {
image: info.image,
@@ -903,10 +910,20 @@
// inputVisible: false
}
})
this.ManyAttrValue = info.attrValues
this.ManyAttrValue = info.attrValues;
this.ManyAttrValue.forEach((val) => {
this.attrInfo[Object.values(val.attrValue).sort().join('/')] = val
})
const tmp = {}
const tmpTab = {}
this.formValidate.attr.forEach((o, i) => {
tmp['value' + i] = { title: o.attrName }
tmpTab['value' + i] = ''
})
this.manyTabTit = tmp
this.manyTabDate = tmpTab
this.formThead = Object.assign({}, this.formThead, tmp)
}else{
this.OneattrValue = info.attrValue
this.formValidate.attr = []
@@ -929,6 +946,8 @@
_this.OneattrValue[0].image = img[0].sattDir
}
if(tit==='2'&& !num){
if(img.length>10) return this.$message.warning("最多选择10张图片");
if(img.length + _this.formValidate.sliderImages.length > 10) return this.$message.warning("最多选择10张图片");
img.map((item) => {
_this.formValidate.sliderImages.push(item.sattDir)
});
@@ -949,19 +968,17 @@
if (this.currentTab-- <0) this.currentTab = 0;
},
handleSubmitNest(name){
if (this.currentTab++ > 2) this.currentTab = 0
// this.$refs[name].validate((valid) => {
// if (valid) {
// if (this.currentTab++ > 2) this.currentTab = 0;
// // this.currentTab=1
// } else {
// if(!this.formValidate.store_name || !this.formValidate.cate_id || !this.formValidate.keyword
// || !this.formValidate.unit_name || !this.formValidate.store_info
// || !this.formValidate.image || !this.formValidate.slider_image){
// this.$message.warning("请填写完整商品信息!");
// }
// }
// })
this.$refs[name].validate((valid) => {
if (valid) {
if (this.currentTab++ > 2) this.currentTab = 0;
} else {
if(!this.formValidate.store_name || !this.formValidate.cate_id || !this.formValidate.keyword
|| !this.formValidate.unit_name || !this.formValidate.store_info
|| !this.formValidate.image || !this.formValidate.slider_image){
this.$message.warning("请填写完整商品信息!");
}
}
})
},
// 提交
handleSubmit (name) {

View File

@@ -11,7 +11,7 @@
<el-cascader v-model="tableFrom.cateId" :options="merCateList" :props="props" clearable class="selWidth mr20" @change="seachList" size="small"/>
</el-form-item>
<el-form-item label="商品搜索:">
<el-input v-model="tableFrom.keywords" placeholder="请输入商品名称关键字商品ID" class="selWidth" size="small">
<el-input v-model="tableFrom.keywords" placeholder="请输入商品名称关键字商品ID" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" @click="seachList" size="small"/>
</el-input>
</el-form-item>
@@ -20,7 +20,7 @@
<router-link :to=" { path:'/store/list/creatProduct' } ">
<el-button size="small" type="primary" class="mr10">添加商品</el-button>
</router-link>
<el-button size="small" type="success" class="mr10" @click="onCopy">复制淘宝天猫拼多多京东苏宁</el-button>
<el-button size="small" type="success" class="mr10" @click="onCopy">商品采集</el-button>
<el-button size="small" @click="exports">导出</el-button>
</div>
<el-table
@@ -116,13 +116,13 @@
<span>{{scope.row.addTime | formatDate}}</span>
</template>
</el-table-column>
<el-table-column label="操作" min-width="120" fixed="right" align="center">
<el-table-column label="操作" min-width="150" fixed="right" align="center">
<template slot-scope="scope">
<router-link :to="{path: '/store/list/creatProduct/' + scope.row.id}">
<el-button type="text" size="small" class="mr10">编辑</el-button>
</router-link>
<el-button v-if="tableFrom.type === '5'" type="text" size="small" @click="handleRestore(scope.row.id, scope.$index)">恢复商品</el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)">{{ tableFrom.type === '5' ? '删除' : '加入回收站' }}</el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, tableFrom.type)">{{ tableFrom.type === '5' ? '删除' : '加入回收站' }}</el-button>
</template>
</el-table-column>
</el-table>
@@ -140,19 +140,19 @@
</el-card>
<el-dialog
title="复制淘宝、天猫、拼多多、京东、苏宁"
title="复制淘宝、天猫、京东、苏宁"
:visible.sync="dialogVisible"
width="1000px"
width="1200px"
:modal="false"
class="taoBaoModal"
:before-close="handleClose">
<tao-bao v-if="dialogVisible"></tao-bao>
<tao-bao v-if="dialogVisible" @handleClose="handleClose"></tao-bao>
</el-dialog>
</div>
</template>
<script>
import { productLstApi, productDeleteApi, categoryApi, putOnShellApi, offShellApi, productHeadersApi, productExportApi, restoreApi } from '@/api/store'
import { productLstApi, productDeleteApi, categoryApi, putOnShellApi, offShellApi, productHeadersApi, productExportApi, restoreApi, productExcelApi } from '@/api/store'
import { getToken } from '@/utils/auth'
import taoBao from './taoBao'
export default {
@@ -209,13 +209,21 @@ export default {
handleClose() {
this.dialogVisible = false
},
handleCloseMod(item){
this.dialogVisible = item
this.goodHeade();
this.getList();
},
// 复制
onCopy(){
this.dialogVisible = true
},
// 导出
exports () {
window.open(this.objectUrl + 'admin/export/excel/product?type=1&Authori-zation=' + getToken())
productExcelApi({cateId:this.tableFrom.cateId,keywords: this.tableFrom.keywords, type:this.tableFrom.type}).then((res) => {
window.open(res.fileName)
})
// window.open(this.objectUrl + 'admin/export/excel/product?type=1&Authori-zation=' + getToken())
},
// 获取商品表单头数量
goodHeade () {
@@ -231,6 +239,7 @@ export default {
this.merCateList = res
}).catch(res => {
this.$message.error(res.message)
this.$message.error(res.message)
})
},
// 列表
@@ -270,10 +279,14 @@ export default {
this.$message.success('上架成功')
this.getList()
this.goodHeade();
}).catch(()=>{
row.isShow = !row.isShow
}) : offShellApi(row.id).then(() => {
this.$message.success('下架成功')
this.getList()
this.goodHeade();
}).catch(()=>{
row.isShow = !row.isShow
})
}
}

View File

@@ -5,7 +5,7 @@
<div class="container">
<el-form inline size="small">
<el-form-item label="规格搜索:">
<el-input v-model="tableFrom.keywords" placeholder="请输入商品规格" class="selWidth">
<el-input v-model="tableFrom.keywords" placeholder="请输入商品规格" class="selWidth" clearable>
<el-button slot="append" icon="el-icon-search" @click="seachList" />
</el-input>
</el-form-item>

View File

@@ -46,7 +46,7 @@
<i class="el-icon-error btndel" @click="handleRemove(index)" />
<!--<Button shape="circle" icon="md-close" class="btndel" @click.native="handleRemove(index)" />-->
</div>
<div class="upLoadPicBox" @click="modalPicTap('2')">
<div v-if="pics<10" class="upLoadPicBox" @click="modalPicTap('2')">
<div class="upLoad">
<i class="el-icon-camera cameraIconfont" />
</div>

View File

@@ -17,26 +17,25 @@
</el-select>
</el-form-item>
<el-form-item label="商品搜索:" class="mr10">
<el-input v-model="tableFrom.productSearch" placeholder="请输入商品名称商品id" class="selWidth" size="small">
<el-input v-model="tableFrom.productSearch" placeholder="请输入商品名称商品id" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" @click="seachList" size="small"/>
</el-input>
</el-form-item>
<el-form-item label="用户名称:">
<el-select v-model="uids" class="selWidth" reserve-keyword multiple remote filterable
:remote-method="remoteMethod" :loading="loading" placeholder="请输入用户名称" clearable @change="seachList">
<el-option
v-for="item in options"
:key="item.uid"
:label="item.nickname"
:value="item.uid">
</el-option>
</el-select>
<el-input v-model="tableFrom.nickname" placeholder="请输入用户名称" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" @click="seachList" size="small"/>
</el-input>
</el-form-item>
<!--<el-form-item label="用户名称:">-->
<!--<el-input v-model="tableFrom.nickname" placeholder="请输入用户名称" class="selWidth" size="small">-->
<!--<el-button slot="append" icon="el-icon-search" @click="seachList" size="small"/>-->
<!--</el-input>-->
<!--</el-form-item>-->
<!--<el-select v-model="uids" class="selWidth" reserve-keyword multiple remote filterable-->
<!--:remote-method="remoteMethod" :loading="loading" placeholder="请输入用户名称" clearable @change="seachList">-->
<!--<el-option-->
<!--v-for="item in options"-->
<!--:key="item.uid"-->
<!--:label="item.nickname"-->
<!--:value="item.uid">-->
<!--</el-option>-->
<!--</el-select>-->
</el-form>
</div>
<el-button size="small" type="primary" @click="add">添加虚拟评论</el-button>
@@ -71,9 +70,14 @@
label="用户名称"
min-width="200"
/>
<el-table-column
prop="productScore"
label="商品评分"
min-width="90"
/>
<el-table-column
prop="serviceScore"
label="评分"
label="服务评分"
min-width="90"
/>
<el-table-column
@@ -185,7 +189,8 @@ export default {
limit: 20,
isReply: '',
dateLimit: '',
uid: '',
// uid: '',
nickname: '',
productSearch:'',
isDel: false
},

View File

@@ -1,21 +1,29 @@
<template>
<div class="Box">
<el-card>
<div>生成的商品默认是没有上架的请手动上架商品</div>
<div>生成的商品默认是没有上架的请手动上架商品
<span v-if="copyConfig.copyType && copyConfig.copyType==1">您当前剩余{{copyConfig.copyNum}}条采集次数
<router-link :to="{path:'/operation/onePass'}">
<el-link type="primary" :underline="false">增加采集次数</el-link>
</router-link>
</span>
<el-link v-if="copyConfig.copyType && copyConfig.copyType!=1" type="primary" :underline="false" href="https://www.kancloud.cn/crmeb/crmeb_java/1909022" target="_blank">如何配置密钥</el-link>
<br>
商品采集设置设置 > 系统设置 > 第三方接口设置 > 采集商品配置如配置一号通采集请先登录一号通账号无一号通请选择99Api设置</div>
</el-card>
<el-form class="formValidate mt20" ref="formValidate" :model="formValidate" :rules="ruleInline" label-width="120px"
@submit.native.prevent v-loading="loading">
<el-form-item>
<el-form-item v-if="copyConfig.copyType && copyConfig.copyType!=1">
<el-radio-group v-model="form">
<el-radio :label="1">淘宝</el-radio>
<el-radio :label="2">京东</el-radio>
<el-radio :label="3">苏宁</el-radio>
<el-radio :label="4">拼多多</el-radio>
<!--<el-radio :label="3">苏宁</el-radio>-->
<!--<el-radio :label="4">拼多多</el-radio>-->
<el-radio :label="5">天猫</el-radio>
</el-radio-group>
</el-form-item>
<el-row :gutter="24">
<el-col :span="24">
<el-col :span="24" v-if="copyConfig.copyType">
<el-form-item label="链接地址:">
<el-input v-model="url" placeholder="请输入链接地址" class="selWidth" size="small">
<el-button slot="append" icon="el-icon-search" @click="add" size="small"/>
@@ -25,12 +33,12 @@
<el-col v-if="formValidate">
<el-col :span="24">
<el-form-item label="商品名称:" prop="storeName">
<el-input v-model="formValidate.storeName" placeholder="请输入商品名称"></el-input>
<el-input v-model="formValidate.storeName" maxlength="249" placeholder="请输入商品名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="商品简介:">
<el-input v-model="formValidate.storeInfo" type="textarea" :rows="3" placeholder="请输入商品简介"></el-input>
<el-input v-model="formValidate.storeInfo" maxlength="250" type="textarea" :rows="3" placeholder="请输入商品简介"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
@@ -103,7 +111,7 @@
</div>
</el-form-item>
</el-col>
<el-col v-if="formValidate.specType" :span="24" class="noForm">
<el-col v-if="formValidate.specType || formValidate.attr.length" :span="24" class="noForm">
<el-form-item label="批量设置:" class="labeltop">
<el-table :data="oneFormBatch" border class="tabNumWidth" size="mini">
<el-table-column align="center" label="图片" min-width="80">
@@ -186,13 +194,13 @@
</template>
<script>
import {crawlFromApi, treeListApi, crawlSaveApi, categoryApi, importProductApi, productCreateApi} from '@/api/store';
import {crawlFromApi, treeListApi, crawlSaveApi, categoryApi, importProductApi, productCreateApi, copyConfigApi} from '@/api/store';
import { shippingTemplatesList } from '@/api/logistics'
const defaultObj = [{
image: '',
price: null,
cost: null,
ot_price: null,
otPrice: null,
stock: null,
barCode: '',
weight: null,
@@ -205,7 +213,7 @@
cost: {
title: '成本价'
},
ot_price: {
otPrice: {
title: '原价'
},
stock: {
@@ -274,7 +282,8 @@
md: 12,
sm: 24,
xs: 24
}
},
copyConfig: {}
}
},
created() {
@@ -303,8 +312,18 @@
},
mounted() {
this.productGetTemplate();
this.getCopyConfig();
},
methods: {
// 删除表格中的属性
delAttrTable(index) {
this.ManyAttrValue.splice(index, 1)
},
getCopyConfig(){
copyConfigApi().then(res => {
this.copyConfig = res
})
},
// 批量添加
batchAdd() {
// if (!this.oneFormBatch[0].pic || !this.oneFormBatch[0].price || !this.oneFormBatch[0].cost || !this.oneFormBatch[0].ot_price ||
@@ -313,7 +332,7 @@
this.$set(val, 'image', this.oneFormBatch[0].image)
this.$set(val, 'price', this.oneFormBatch[0].price)
this.$set(val, 'cost', this.oneFormBatch[0].cost)
this.$set(val, 'ot_price', this.oneFormBatch[0].ot_price)
this.$set(val, 'otPrice', this.oneFormBatch[0].otPrice)
this.$set(val, 'stock', this.oneFormBatch[0].stock)
this.$set(val, 'barCode', this.oneFormBatch[0].barCode)
this.$set(val, 'weight', this.oneFormBatch[0].weight)
@@ -350,7 +369,7 @@
image: '',
price: 0,
cost: 0,
ot_price: 0,
otPrice: 0,
stock: 0,
barCode: '',
weight: 0,
@@ -381,7 +400,7 @@
image: '',
price: 0,
cost: 0,
ot_price: 0,
otPrice: 0,
stock: 0,
barCode: '',
weight: 0,
@@ -429,17 +448,16 @@
// }
this.loading = true;
importProductApi({ url: this.url, form: this.form}).then(res => {
let info = res
this.formValidate = {
image: info.image,
sliderImages: JSON.parse(info.sliderImage),
sliderImage: info.sliderImage,
storeName: info.storeName,
storeInfo: info.storeInfo,
keyword: info.keyword,
cateIds: info.cateId ? info.cateId.split(',') : [], // 商品分类id
cateId: info.cateId,// 商品分类id传值
unitName: info.unitName,
image: res.image,
sliderImages: JSON.parse(res.sliderImage),
sliderImage: res.sliderImage,
storeName: res.storeName,
storeInfo: res.storeInfo,
keyword: res.keyword,
cateIds: res.cateId ? res.cateId.split(',') : [], // 商品分类id
cateId: res.cateId,// 商品分类id传值
unitName: res.unitName,
sort: 0,
isShow: 0,
isBenefit: 0,
@@ -447,20 +465,20 @@
isGood: 0,
isHot: 0,
isBest: 0,
tempId: info.tempId,
attrValue: info.attrValue,
attr: info.attr || [],
selectRule: info.selectRule,
tempId: res.tempId,
attrValue: res.attrValue,
attr: res.attr || [],
selectRule: res.selectRule,
isSub: false,
content: info.content,
specType: info.specType || false,
id: info.id,
giveIntegral: info.giveIntegral,
ficti: info.ficti
content: res.content,
specType: res.attr.length ? true : false,
id: res.id,
giveIntegral: res.giveIntegral,
ficti: res.ficti
}
if(this.formValidate.attr.length){
for (var i = 0; i < this.formValidate.attr.length; i++) {
this.formValidate.attr[i].attrValue = JSON.parse(info.attr[i].attrValues)
this.formValidate.attr[i].attrValue = JSON.parse(this.formValidate.attr[i].attrValues)
}
}
this.loading = false;
@@ -473,13 +491,9 @@
},
// 提交
handleSubmit (name) {
this.formValidate.attr.length ? this.formValidate.attrValue=JSON.stringify(this.ManyAttrValue):this.formValidate.attrValue=[]
this.formValidate.attr.length ? this.formValidate.attrValue=this.ManyAttrValue:this.formValidate.attrValue=[]
this.formValidate.cateId = this.formValidate.cateIds.join(',')
this.formValidate.sliderImage = JSON.stringify(this.formValidate.sliderImages)
if(!this.formValidate.specType){
this.formValidate.attr = []
this.formValidate.attrValue = ''
}
for (var i = 0; i < this.formValidate.attr.length; i++) {
this.formValidate.attr[i].attrValues = JSON.stringify(this.formValidate.attr[i].attrValue)
}
@@ -488,7 +502,7 @@
this.modal_loading = true
productCreateApi(this.formValidate).then(async res => {
this.$message.success('新增成功');
this.$parent.dialogVisible = false
this.$emit('handleCloseMod', false)
this.modal_loading = false
}).catch(() => {
this.modal_loading = false
@@ -510,6 +524,8 @@
_this.OneattrValue[0].image = img[0].sattDir
}
if(tit==='2'&& !num){
if(img.length>10) return this.$message.warning("最多选择10张图片");
if(img.length + _this.formValidate.sliderImages.length > 10) return this.$message.warning("最多选择10张图片");
img.map((item) => {
_this.formValidate.sliderImages.push(item.sattDir)
});

View File

@@ -4,24 +4,14 @@
<div slot="header" class="clearfix">
<div class="container">
<el-form ref="form" inline :model="form">
<el-form-item label="状态">
<el-select v-model="form.isShow" placeholder="状态" clearable @change="handlerSearch" class="selWidth">
<el-option
v-for="item in constants.switchStatus"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="关键字:">
<el-input v-model="form.keywords" placeholder="请输入关键字" class="selWidth" size="small">
<el-input v-model="form.keywords" placeholder="请输入关键字" class="selWidth" size="small" clearable>
<el-button slot="append" size="small" icon="el-icon-search" @click="handlerSearch" />
</el-input>
</el-form-item>
</el-form>
</div>
<el-button type="primary" size="small" @click="addExpress">添加物流公司</el-button>
<el-button type="primary" size="small" @click="addExpress">同步物流公司</el-button>
</div>
<el-table
v-loading="loading"
@@ -57,7 +47,7 @@
<el-switch
v-model="scope.row.isShow"
class="demo"
:active-value="1" :inactive-value="0"
:active-value="true" :inactive-value="false"
active-text="开启"
inactive-text="关闭"
@change="bindStatus(scope.row)"
@@ -72,7 +62,7 @@
>
<template slot-scope="scope">
<el-button type="text" size="small" @click="bindEdit(scope.row)">编辑</el-button>
<el-button type="text" size="small" @click="bindDelete(scope.row)">删除</el-button>
<!--<el-button type="text" size="small" @click="bindDelete(scope.row)">删除</el-button>-->
</template>
</el-table-column>
</el-table>
@@ -89,12 +79,35 @@
</div>
</el-card>
<el-dialog
title="添加物流公司"
title="编辑物流公司"
:visible.sync="dialogVisible"
width="700px"
:before-close="handleClose"
>
<parser v-if="formShow" ref="formBox" class="formBox" :form-conf="formConf" :form-edit-data="formData" :is-edit="isCreate === 1" @submit="submit" />
<el-form :model="formData" :rules="rules" ref="formData" label-width="100px" class="demo-ruleForm">
<el-form-item label="月结账号" prop="account" v-if="formData.partnerId">
<el-input v-model="formData.account" placeholder="请输入月结账号"></el-input>
</el-form-item>
<el-form-item label="月结密码" prop="password" v-if="formData.partnerKey">
<el-input v-model="formData.password" placeholder="请输入月结密码"></el-input>
</el-form-item>
<el-form-item label="网点名称" prop="netName" v-if="formData.net">
<el-input v-model="formData.netName" placeholder="请输入网点名称"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number v-model="formData.sort" :min="0" :max="9999" label="排序"></el-input-number>
</el-form-item>
<el-form-item label="是否启用" prop="isShow">
<el-radio-group v-model="formData.isShow">
<el-radio :label="false">隐藏</el-radio>
<el-radio :label="true">启用</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submit('formData')"> </el-button>
</span>
<!--<parser v-if="formShow" ref="formBox" class="formBox" :form-conf="formConf" :form-edit-data="formData" :is-edit="isCreate === 1" @submit="submit" />-->
</el-dialog>
</div>
</template>
@@ -113,8 +126,7 @@ export default {
// 表单
formConf: { fields: [] },
form: {
keywords: '',
isShow: null
keywords: ''
},
tableData: {},
page: 1,
@@ -122,10 +134,26 @@ export default {
loading: false,
dialogVisible: false,
fromType: 'add',
formData: {},
formData: {
isShow: false
},
isCreate: 0,
formShow: false,
editId: 0
editId: 0,
rules: {
sort: [
{ required: true, message: '请输入排序', trigger: 'blur' },
],
account: [
{ required: true, message: '请输入月结账号', trigger: 'blur' },
],
password: [
{ required: true, message: '请输入月结密码', trigger: 'blur' },
],
netName: [
{ required: true, message: '请输入网点名称', trigger: 'blur' },
]
}
}
},
created() {
@@ -142,16 +170,18 @@ export default {
logistics.expressList({
page: this.page,
limit: this.limit,
keywords: this.form.keywords,
isShow: this.form.isShow
keywords: this.form.keywords
}).then(res => {
this.loading = false
this.tableData = res
}).catch(()=>{
this.loading = false
})
},
// 物流开关
bindStatus(item) {
logistics.expressUpdate({
logistics.expressUpdateShow({
account: item.account,
code: item.code,
id: item.id,
isShow: item.isShow,
@@ -175,12 +205,9 @@ export default {
},
// 添加物流公司
addExpress() {
this.fromType = 'add'
const _pram = { id: 71 }
systemFormConfigApi.getFormConfigInfo(_pram).then(data => {
this.dialogVisible = true
this.formConf = JSON.parse(data.content)
this.formShow = true
logistics.expressSyncApi().then(data => {
this.page = 1
this.getExpressList()
})
},
// 删除物流公司
@@ -193,50 +220,33 @@ export default {
})
},
// 表单提交
submit(data) {
if (this.fromType === 'add') {
logistics.expressSave(data).then(res => {
this.handleClose()
this.getExpressList()
this.$message.success('操作成功')
})
} else {
data.id = this.editId
logistics.expressUpdate(data).then(res => {
this.handleClose()
this.getExpressList()
this.$message.success('操作成功')
})
}
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
logistics.expressUpdate(this.formData).then(res => {
this.$message.success('操作成功')
this.handleClose()
this.getExpressList()
})
} else {
return false;
}
});
},
// 关闭模态框
handleClose(done) {
this.formShow = false
this.formData = {}
// this.formData = {}
this.formConf.fields = []
this.dialogVisible = false
this.isCreate = 0
},
// 编辑
bindEdit(item) {
this.dialogVisible = true
this.editId = item.id
this.fromType = 'edit'
const _pram = { id: 71 }
systemFormConfigApi.getFormConfigInfo(_pram).then(data => {
this.formShow = false
this.isCreate = 0
this.dialogVisible = true
this.formConf = JSON.parse(data.content)
this.getInfo(item)
})
},
getInfo(item) {
logistics.expressInfo({ id: item.id }).then(res => {
this.formData = res
this.isCreate = 1
setTimeout(() => { // 让表单重复渲染待编辑数据
this.formShow = true
}, 80)
})
}
}

View File

@@ -5,7 +5,7 @@
<div class="container">
<el-form ref="form" inline :model="form">
<el-form-item label="模板名称:">
<el-input v-model="form.keywords" placeholder="请输入模板名称" class="selWidth" size="small">
<el-input v-model="form.keywords" placeholder="请输入模板名称" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" @click="handleSearch" />
</el-input>
</el-form-item>

View File

@@ -6,7 +6,7 @@
v-for="tab,index in treeList"
:key="index"
:label="tab.name"
:name="tab.extra"
:name="tab.id.toString()"
>
<!-- 文件上传特殊处理-->
<!-- <template v-if="activeNamel1 == 4">-->
@@ -77,7 +77,7 @@ export default {
formConf: { content: { fields: [] }, id: null, render: false, isEdit: false },
formConfChild: { content: { fields: [] }, id: null, render: false, isEdit: false },
activeNamel1: null,
activeNamel2: '本地(不推荐)',//针对文件特殊处理
activeNamel2: '',//针对文件特殊处理
treeList: [],
editDataChild: {},
isCreate: 0,
@@ -91,42 +91,46 @@ export default {
this.getCurrentUploadSelectedFlag()
},
methods: {
handleTabClick(tab, event) {
if (tab.name) {
this.handlerGetLevel1FormConfig(tab.name)
} else if (tab.$children.length > 0 ) { // 初次加载第二层的第一个Tab数据
// if(tab.$children[0].panes){ // todo 优化。。。
// this.activeNamel2 = tab.$children[0].panes[0].name
// }else{
// conaole.integralLog()
// }
let _selected = tab.$children[0].panes[0]
// 设置特殊处理的文件长传表单默认选中第一个tab
this.activeNamel2 = _selected.name != 72 ? _selected.name : _selected.label
if(this.activeNamel2 == 108){
switch (this.currentSelectedUploadFlag) {
case 1:
this.activeNamel2 = '本地(不推荐)'
this.handlerGetLevel2FormConfig(108)
break
case 2:
this.activeNamel2 = '阿里云配置'
this.handlerGetLevel2FormConfig(81)
break
case 3:
this.activeNamel2 = '七牛云配置'
this.handlerGetLevel2FormConfig(82)
break
case 4:
this.activeNamel2 = '腾讯云配置'
this.handlerGetLevel2FormConfig(83)
break
}
}else{
this.handlerGetLevel2FormConfig(_selected.name)
}
}
// handleTabClick(tab, event) {
// if (tab.name) {
// this.handlerGetLevel1FormConfig(tab.name)
// } else if (tab.$children.length > 0 ) { // 初次加载第二层的第一个Tab数据
// // if(tab.$children[0].panes){ // todo 优化。。。
// // this.activeNamel2 = tab.$children[0].panes[0].name
// // }else{
// // conaole.integralLog()
// // }
// let _selected = tab.$children[0].panes[0]
// // 设置特殊处理的文件长传表单默认选中第一个tab
// this.activeNamel2 = _selected.name != 72 ? _selected.name : _selected.label
// if(this.activeNamel2 == 108){
// switch (this.currentSelectedUploadFlag) {
// case 1:
// this.activeNamel2 = '本地(不推荐)'
// this.handlerGetLevel2FormConfig(108)
// break
// case 2:
// this.activeNamel2 = '阿里云配置'
// this.handlerGetLevel2FormConfig(81)
// break
// case 3:
// this.activeNamel2 = '七牛云配置'
// this.handlerGetLevel2FormConfig(82)
// break
// case 4:
// this.activeNamel2 = '腾讯云配置'
// this.handlerGetLevel2FormConfig(83)
// break
// }
// }else{
// this.handlerGetLevel2FormConfig(_selected.name)
// }
//
// }
// },
handleTabClick(tab) {
this.activeNamel2 = tab.$children[0].panes[0].name;
this.handlerGetLevel2FormConfig(this.activeNamel2);
},
handlerGetLevel1FormConfig(id) {
const formPram = { id: id }
@@ -210,15 +214,16 @@ export default {
this.loading = true
categoryApi.treeCategroy(_pram).then(data => {
this.treeList = this.handleAddArrt(data)
if (this.treeList.length > 0) this.activeNamel1 = this.treeList[0].extra
if (this.treeList.length > 0) this.activeNamel1 = this.treeList[0].id.toString();
if (this.treeList.length > 0 && this.treeList[0].child.length > 0) {
this.activeNamel2 = this.treeList[0].child[0].extra
}
if (this.activeNamel2) {
this.handlerGetLevel2FormConfig(this.treeList[0].child[0].extra)
} else {
this.handlerGetLevel1FormConfig(this.treeList[0].extra)
}
// else {
// this.handlerGetLevel1FormConfig(this.treeList[0].extra)
//}
this.loading = false
}).catch(() =>{
this.loading = false

View File

@@ -130,8 +130,8 @@
storeStaffUpdateStatusApi({id:id,status:isShow}).then(() => {
that.$message.success("操作成功");
that.tableList();
}).catch(res=>{
that.$message.error(res.message);
}).catch(()=>{
row.isShow = !row.isShow
})
},
storeList() {

View File

@@ -21,7 +21,7 @@
</el-select>
</el-form-item>
<el-form-item label="关键字:">
<el-input v-model="tableFrom.keywords" placeholder="请输入姓名、电话、订单ID" class="selWidth" size="small">
<el-input v-model="tableFrom.keywords" placeholder="请输入姓名、电话、订单ID" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" size="small" @click="getList(1)" />
</el-input>
</el-form-item>
@@ -87,7 +87,7 @@
<el-table-column
prop="storeName"
label="核销门店"
min-width="100"
min-width="150"
/>
<el-table-column
label="支付状态"
@@ -108,7 +108,7 @@
<el-table-column
prop="createTime"
label="下单时间"
min-width="100"
min-width="150"
/>
</el-table>
<div class="block">

View File

@@ -165,7 +165,7 @@
storeInfoApi({id:id}).then(res=>{
that.ruleForm = res;
that.ruleForm.address = res.address.split(",");
that.dayTime = res.dayTime.split("-")
that.dayTime = res.dayTime.split(",")
this.loading = false;
})
},
@@ -235,7 +235,7 @@
},
//营业时间
onchangeTime(e){
this.ruleForm.dayTime = e ? e.join(',','-') : '';
this.ruleForm.dayTime = e ? e.join(',') : '';
},
//上传图片
modalPicTap (tit) {

View File

@@ -9,7 +9,7 @@
</el-tabs>
<el-form ref="form" inline :model="artFrom" @submit.native.prevent>
<el-form-item label="关键字:">
<el-input v-model="artFrom.keywords" placeholder="请输入提货点名称/电话" class="selWidth" size="small">
<el-input v-model="artFrom.keywords" placeholder="请输入提货点名称/电话" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" @click="search" />
</el-input>
</el-form-item>
@@ -82,7 +82,9 @@
<template slot-scope="{ row, index }">
<el-button type="text" size="small" @click="edit(row.id)">编辑</el-button>
<el-divider direction="vertical"></el-divider>
<el-button type="text" size="small" @click="storeDelete(row.id)">删除</el-button>
<el-button v-if="artFrom.status==='2'" type="text" size="small" @click="storeRecovery(row.id)">恢复</el-button>
<el-divider v-if="artFrom.status==='2'" direction="vertical"></el-divider>
<el-button type="text" size="small" @click="artFrom.status==='2'?allDelete(row.id):storeDelete(row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -103,7 +105,7 @@
<script>
import systemStore from './addPoint';
import { storeListApi, storeGetCountApi, storeUpdateStatusApi, storeDeleteApi } from '@/api/storePoint';
import { storeListApi, storeGetCountApi, storeUpdateStatusApi, storeDeleteApi, allDeleteApi, storeRecoveryApi } from '@/api/storePoint';
export default {
name: 'Point',
components: { systemStore },
@@ -141,8 +143,6 @@ export default {
that.loading = false;
that.tableData = res.list;
that.total = res.total;
}).catch(res => {
that.$message.error(res.message);
})
},
//切换页数
@@ -172,8 +172,18 @@ export default {
that.$message.success("操作成功");
that.tableList();
that.storeGetCount();
}).catch(res=>{
that.$message.error(res.message);
}).catch(()=>{
row.isShow = !row.isShow
})
},
// 恢复
storeRecovery(id){
this.$modalSure('恢复提货吗').then(() => {
storeRecoveryApi({ id: id }).then(() => {
this.$message.success('恢复成功')
this.storeGetCount();
this.tableList();
})
})
},
//刪除
@@ -182,11 +192,18 @@ export default {
that.$modalSure().then(() => {
storeDeleteApi({ id: id }).then(() => {
that.$message.success('删除成功')
that.tableList();
that.storeGetCount();
that.tableList();
})
})
},
allDelete(id){
this.$modalSure().then(() => {
allDeleteApi({ id: id }).then(() => {
this.$message.success('删除成功')
this.storeGetCount();
this.tableList();
})
}).catch(res=>{
that.$message.error(res.message);
})
},
//添加

View File

@@ -7,12 +7,12 @@
<el-form-item label="用户状态:" class="mr10">
<el-select v-model="tableFrom.isShow" clearable placeholder="请选择用户状态" @change="seachList" class="selWidth">
<el-option label="全部" value=""></el-option>
<el-option label="显示" value="1"></el-option>
<el-option label="隐藏" value="0"></el-option>
<el-option label="显示" value="true"></el-option>
<el-option label="隐藏" value="false"></el-option>
</el-select>
</el-form-item>
<el-form-item label="等级名称:">
<el-input v-model="tableFrom.name" placeholder="请输入等级名称" class="selWidth">
<el-input v-model="tableFrom.name" placeholder="请输入等级名称" class="selWidth" clearable>
<el-button slot="append" icon="el-icon-search" @click="seachList" size="small"/>
</el-input>
</el-form-item>
@@ -75,7 +75,7 @@
<el-table-column label="操作" min-width="120" fixed="right" align="center">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row.id)" class="mr10">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row.id, scope.$index)">删除</el-button>
<!--<el-button type="text" @click="handleDelete(scope.row.id, scope.$index)">删除</el-button>-->
</template>
</el-table-column>
</el-table>
@@ -174,6 +174,8 @@
levelUseApi({id: row.id, value:row.isShow}).then(() => {
this.$message.success('修改成功')
this.getList()
}).catch(()=>{
row.isShow = !row.isShow
})
}
}

View File

@@ -31,7 +31,7 @@
<el-table-column label="操作" min-width="120" fixed="right" align="center">
<template slot-scope="scope">
<el-button class="mr10" type="text" size="small" @click="onAdd(scope.row)">编辑</el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)">删除</el-button>
<!--<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)" disable>删除</el-button>-->
</template>
</el-table-column>
</el-table>

View File

@@ -25,6 +25,9 @@
<el-form-item label="用户地址:">
<el-input v-model="ruleForm.addres" class="selWidth"></el-input>
</el-form-item>
<el-form-item label="用户备注:">
<el-input v-model="ruleForm.mark" type="textarea" class="selWidth"></el-input>
</el-form-item>
<el-form-item label="用户等级:">
<el-select v-model="ruleForm.level" placeholder="请选择" class="selWidth" clearable filterable>
<el-option :value="item.id" v-for="(item, index) in levelList" :key="index" :label="item.name"></el-option>
@@ -69,8 +72,8 @@
phone: '',
realName: '',
addres:'',
groupId: 0,
level: 0,
groupId: '',
level: '',
isPromoter: false,
status: false,
}
@@ -112,12 +115,12 @@
realName: res.realName,
status: res.status,
addres: res.addres,
groupId: Number(res.groupId),
level: res.level,
groupId: Number(res.groupId) || '',
level: res.level || '',
isPromoter: res.isPromoter,
tagId: res.tagId
tagId: res.tagId || ''
}
this.labelData = res.tagId.split(',').map(Number)
this.labelData = res.tagId ? res.tagId.split(',').map(Number): []
})
},
// 分组列表

View File

@@ -58,7 +58,7 @@
</el-col>
<el-col v-bind="grid" v-if="userFrom.country ==='CN'">
<el-form-item label="省份:">
<el-cascader :options="addresData" :props="propsCity" v-model="address" @change="handleChange" class="selWidth"></el-cascader>
<el-cascader :options="addresData" :props="propsCity" filterable v-model="address" @change="handleChange" clearable class="selWidth"></el-cascader>
</el-form-item>
</el-col>
</el-col>
@@ -250,7 +250,7 @@
min-width="100"
>
<template slot-scope="scope">
<span>{{scope.row.level | levelFilter | filterEmpty}}</span>
<!--<span>{{scope.row.level | levelFilter | filterEmpty}}</span>-->
</template>
</el-table-column>
<el-table-column
@@ -281,11 +281,22 @@
label="积分"
min-width="100"
/>
<el-table-column label="操作" min-width="200" fixed="right" align="center">
<el-table-column label="操作" min-width="130" fixed="right" align="center">
<template slot-scope="scope">
<el-button type="text" size="small" @click="onDetails(scope.row.uid)">账户详情</el-button>
<el-button type="text" @click="editUser(scope.row.uid)" size="small">编辑</el-button>
<el-button type="text" @click="editPoint(scope.row.uid)" size="small">积分余额</el-button>
<el-dropdown trigger="click">
<span class="el-dropdown-link">
更多<i class="el-icon-arrow-down el-icon--right" />
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="onDetails(scope.row.uid)">账户详情</el-dropdown-item>
<el-dropdown-item @click.native="editPoint(scope.row.uid)">积分余额</el-dropdown-item>
<el-dropdown-item @click.native="setBatch('group',scope.row)">设置分组</el-dropdown-item>
<el-dropdown-item @click.native="setBatch('label',scope.row)">设置标签</el-dropdown-item>
<el-dropdown-item @click.native="setExtension(scope.row)">修改上级推广人</el-dropdown-item>
<el-dropdown-item @click.native="clearSpread(scope.row)" v-if="scope.row.spreadUid && scope.row.spreadUid>0">清除上级推广人</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
@@ -301,6 +312,38 @@
/>
</div>
</el-card>
<!--修改推广人-->
<el-dialog
title="修改推广人"
:visible.sync="extensionVisible"
width="500px"
:before-close="handleCloseExtension">
<el-form class="formExtension mt20" ref="formExtension" :model="formExtension" :rules="ruleInline" label-width="120px"
@submit.native.prevent v-loading="loading">
<el-form-item label="用户头像:" prop="image">
<div class="upLoadPicBox" @click="modalPicTap">
<div v-if="formExtension.image" class="pictrue"><img :src="formExtension.image"></div>
<div v-else class="upLoad">
<i class="el-icon-camera cameraIconfont"/>
</div>
</div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="onSubExtension('formExtension')"> </el-button>
</span>
</el-dialog>
<!--用户列表-->
<el-dialog
title="用户列表"
:visible.sync="userVisible"
width="700px">
<user-list v-if="userVisible" @getTemplateRow="getTemplateRow"></user-list>
<span slot="footer" class="dialog-footer">
<el-button @click="userVisible = false"> </el-button>
<el-button type="primary" @click="userVisible = false"> </el-button>
</span>
</el-dialog>
<!--批量设置-->
<el-dialog
title="设置"
@@ -313,8 +356,9 @@
label="用户分组"
:rules="[{ required: true, message: '请选择用户分组', trigger: 'change' }]"
v-if="batchName ==='group'"
key="1"
>
<el-select v-model="dynamicValidateForm.groupId" placeholder="请选择分组" style="width: 80%" filterable multiple>
<el-select v-model="dynamicValidateForm.groupId" placeholder="请选择分组" style="width: 80%" filterable>
<el-option :value="item.id" v-for="(item, index) in groupList" :key="index" :label="item.groupName"></el-option>
</el-select>
</el-form-item>
@@ -347,6 +391,7 @@
title="积分余额"
:visible.sync="VisiblePoint"
width="500px"
:close-on-click-modal="false"
:before-close="handlePointClose">
<el-form :model="PointValidateForm" ref="PointValidateForm" label-width="100px" class="demo-dynamic" v-loading="loadingPoint">
<el-form-item
@@ -362,7 +407,7 @@
label="余额"
required
>
<el-input type="text" v-model.number="PointValidateForm.moneyValue"></el-input>
<el-input-number type="text" v-model="PointValidateForm.moneyValue" :max="999999"></el-input-number>
</el-form-item>
<el-form-item
label="修改积分"
@@ -377,7 +422,7 @@
label="积分"
required
>
<el-input type="text" v-model.number="PointValidateForm.integralValue"></el-input>
<el-input-number type="text" v-model="PointValidateForm.integralValue" :max="999999"></el-input-number>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@@ -398,14 +443,16 @@
</template>
<script>
import { userListApi, groupListApi, levelListApi, tagListApi, groupPiApi, tagPiApi, foundsApi } from '@/api/user'
import { userListApi, groupListApi, levelListApi, tagListApi, groupPiApi, tagPiApi, foundsApi, updateSpreadApi } from '@/api/user'
import { spreadClearApi } from '@/api/distribution'
import editFrom from './edit'
import userDetails from './userDetails'
import userList from '@/components/userList'
import * as logistics from '@/api/logistics.js'
import Cookies from 'js-cookie'
export default {
name: 'UserIndex',
components:{ editFrom, userDetails },
components:{ editFrom, userDetails,userList },
filters: {
sexFilter(status) {
const statusMap = {
@@ -419,6 +466,14 @@
},
data() {
return {
formExtension: {
image: '',
spreadUid: '',
userId: ''
},
ruleInline: {},
extensionVisible: false,
userVisible: false,
pickerOptions: {
shortcuts: [
{
@@ -500,13 +555,13 @@
props: {
children: 'child',
label: 'name',
value: 'id',
value: 'name',
emitPath: false
},
propsCity: {
children: 'child',
label: 'name',
value: 'cityId'
value: 'name'
},
headeNum: [
{ 'type': '', 'name': '全部用户' },
@@ -585,6 +640,46 @@
this.getCityList()
},
methods: {
// 清除
clearSpread(row) {
this.$modalSure('解除【' + row.nickname + '】的上级推广人吗').then(() => {
spreadClearApi(row.uid).then((res) => {
this.$message.success('清除成功')
this.getList()
})
})
},
onSubExtension(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
updateSpreadApi(this.formExtension).then(res => {
this.$message.success('设置成功')
this.extensionVisible = false
this.getList()
})
} else {
return false;
}
});
},
getTemplateRow(row){
this.formExtension.image = row.avatar
this.formExtension.spreadUid = row.uid
},
setExtension(row){
this.formExtension = {
image: '',
spreadUid: '',
userId: row.uid
};
this.extensionVisible = true
},
handleCloseExtension(){
this.extensionVisible = false
},
modalPicTap(){
this.userVisible = true
},
resetForm(){
this.visible = false;
},
@@ -609,6 +704,7 @@
this.levelData = []
this.groupData = []
this.labelData = []
this.timeVal = []
this.getList()
},
// 列表
@@ -686,14 +782,14 @@
}
},
editUser(id) {
this.visible = true
this.uid = id
this.visible = true
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.loading = true
this.batchName ==='group' ? groupPiApi({groupId: this.dynamicValidateForm.groupId.join(','), id: this.userIds}).then(res => {
this.batchName ==='group' ? groupPiApi({groupId: this.dynamicValidateForm.groupId, id: this.userIds}).then(res => {
this.$message.success('设置成功')
this.loading = false
this.handleClose()
@@ -713,8 +809,16 @@
}
});
},
setBatch(name){
setBatch(name, row){
this.batchName = name
if(row){
this.selectionList = [row]
this.userIds = row.uid
}else{
this.selectionList=[]
}
// row?this.selectionList = [row]:this.selectionList=[]
if (this.selectionList.length === 0) return this.$message.warning('请选择要设置的用户')
this.dialogVisible = true
},
@@ -722,11 +826,6 @@
this.dialogVisible = false
this.$refs['dynamicValidateForm'].resetFields();
},
// 选择时间
selectChange (tab) {
this.timeVal = [];
this.getList();
},
// 全选
onSelectTab (selection) {
this.selectionList = selection;
@@ -758,7 +857,7 @@
// 具体日期
onchangeTime (e) {
this.timeVal = e;
this.tableFrom.dateLimit = e ? this.timeVal.join(',') : '';
this.userFrom.dateLimit = e ? this.timeVal.join(',') : '';
},
// 分组列表
groupLists () {
@@ -817,9 +916,13 @@
? putOnShellApi( row.id ).then(() => {
this.$message.success('上架成功')
this.getList()
}).catch(()=>{
row.isShow = !row.isShow
}) : offShellApi(row.id).then(() => {
this.$message.success('下架成功')
this.getList()
}).catch(()=>{
row.isShow = !row.isShow
})
}
}
@@ -833,6 +936,14 @@
/*width: 87% !important;*/
/*}*/
/*}*/
.el-dropdown-link {
cursor: pointer;
color: #409EFF;
font-size: 12px;
}
.el-icon-arrow-down {
font-size: 12px;
}
.text-right{
text-align: right;
}

View File

View File

@@ -35,6 +35,13 @@ export function postCombinationRemove(data) {
return request.post("combination/remove",data);
}
/**
* 拼团 更多拼团
*/
export function getCombinationMore(data) {
return request.get("combination/more",data,{noAuth:true});
}
/**
* 砍价列表
*/
@@ -72,7 +79,7 @@ export function getBargainDetail(id) {
* 砍价 开启砍价用户信息
*/
export function postBargainStartUser(data) {
return request.post("bargain/start/user", data);
return request.get("bargain/start/user", data);
}
/**
@@ -97,24 +104,24 @@ export function postBargainHelpPrice(data) {
}
/**
* 砍价 砍价帮
* 砍价 砍价帮
*/
export function postBargainHelpList(data) {
return request.post("bargain/help/list", data);
export function postBargainHelpList(params,data) {
return request.get("bargain/help/list?limit="+params.limit+"&page="+params.page, data,{});
}
/**
* 砍价 砍价帮总人数、剩余金额、进度条、已经砍掉的价格
*/
export function postBargainHelpCount(data) {
return request.post("bargain/help/count", data);
return request.get("bargain/help/count", data,1);
}
/**
* 砍价 观看/分享/参与次数
*/
export function postBargainShare(bargainId) {
return request.post("bargain/share", { bargainId: bargainId});
return request.get("bargain/share/" + bargainId);
}
/**

View File

@@ -168,12 +168,14 @@ export function orderRefundVerify(data) {
* 订单确认获取订单详细信息
* @param string cartId
*/
export function orderConfirm(cartId, isNew, addAgain,secKill) {
export function orderConfirm(cartId, isNew, addAgain,secKill,combination,bargain) {
return request.post('order/confirm', {
cartIds: cartId,
isNew: isNew,
addAgain: addAgain,
secKill: secKill
secKill: secKill,
combination:combination,
bargain:bargain
}, {}, 1);
}

View File

@@ -68,7 +68,7 @@
function runTime() {
//时间函数
let intDiff = that.datatime - Date.parse(new Date()) / 1000; //获取数据中的时间戳的时间差;
let intDiff = that.datatime - Date.parse(new Date())/1000; //获取数据中的时间戳的时间差;
let day = 0,
hour = 0,
minute = 0,

View File

@@ -30,7 +30,7 @@
</view>
<!-- 无优惠券 -->
<view class='pictrue' v-else>
<image src='/static/images/noCoupon.png'></image>
<image src='../../static/images/noCoupon.png'></image>
</view>
</view>
<view class='mask' catchtouchmove="true" :hidden='coupon.coupon==false' @click='close'></view>

View File

@@ -161,7 +161,6 @@
});
},
upload(){
debugger
if(!this.uploadUrl) {
uni.showModal({
content: '请填写上传接口'

View File

@@ -1,6 +1,6 @@
<template>
<view class="empty-box">
<image src="/static/images/empty-box.png"></image>
<image src="../static/images/empty-box.png"></image>
<view class="txt">{{title}}</view>
</view>
</template>

Some files were not shown because too many files have changed in this diff Show More