Commit dc84c6eb by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !14
2 parents ae03586c c47521bd
Showing 79 changed files with 2158 additions and 1315 deletions
...@@ -22,59 +22,97 @@ module.exports = { ...@@ -22,59 +22,97 @@ module.exports = {
echarts: false echarts: false
}, },
rules: { rules: {
'arrow-spacing': [2, { 'arrow-spacing': [
'before': true, 2,
'after': true {
}], before: true,
'block-spacing': [2, 'always'], after: true
'brace-style': [2, '1tbs', { }
'allowSingleLine': true ],
}], eqeqeq: 'off',
// 'no-eval': ['error', { allowIndirect: false }], // default is false
'no-eval': 'off', // default is false
// allow async-await
'generator-star-spacing': 'off',
// 'block-spacing': [2, 'always'],
'brace-style': [
2,
'1tbs',
{
allowSingleLine: true
}
],
'comma-dangle': [2, 'never'], 'comma-dangle': [2, 'never'],
'comma-spacing': [2, { 'comma-spacing': [
'before': false, 2,
'after': true {
}], before: false,
after: true
}
],
'comma-style': [2, 'last'], 'comma-style': [2, 'last'],
'curly': [2, 'multi-line'], curly: [2, 'multi-line'],
'dot-location': [2, 'property'], 'dot-location': [2, 'property'],
'indent': [2, 2, { indent: [
'SwitchCase': 1 2,
}], 2,
'key-spacing': [2, { {
'beforeColon': false, SwitchCase: 1
'afterColon': true }
}], ],
'keyword-spacing': [2, { 'key-spacing': [
'before': true, 2,
'after': true {
}], beforeColon: false,
'new-cap': [2, { afterColon: true
'newIsCap': true, }
'capIsNew': false ],
}], 'keyword-spacing': [
2,
{
before: true,
after: true
}
],
'new-cap': [
2,
{
newIsCap: true,
capIsNew: false
}
],
'no-extra-parens': [2, 'functions'], 'no-extra-parens': [2, 'functions'],
'no-floating-decimal': 2, 'no-floating-decimal': 2,
'no-multi-spaces': 2, 'no-multi-spaces': 2,
'no-multiple-empty-lines': [2, { 'no-multiple-empty-lines': [
'max': 1 2,
}], {
max: 1
}
],
'no-trailing-spaces': 2, 'no-trailing-spaces': 2,
'quotes': [2, 'single', { quotes: [
'avoidEscape': true, 2,
'allowTemplateLiterals': true 'single',
}], {
'semi': [2, 'never'], avoidEscape: true,
allowTemplateLiterals: true
}
],
semi: [2, 'never'],
'space-before-blocks': [2, 'always'], 'space-before-blocks': [2, 'always'],
'space-before-function-paren': [2, 'never'], // 'space-before-function-paren': [2, 'never'],
'space-before-function-paren': 0,
'space-in-parens': [2, 'never'], 'space-in-parens': [2, 'never'],
'space-infix-ops': 2, 'space-infix-ops': 2,
'space-unary-ops': [2, { 'space-unary-ops': [
'words': true, 2,
'nonwords': false {
}], words: true,
nonwords: false
}
],
'spaced-comment': [2, 'always'], 'spaced-comment': [2, 'always'],
'prefer-const': 2 'prefer-const': 2
} }
}
};
...@@ -2,4 +2,8 @@ ...@@ -2,4 +2,8 @@
[D2Admin](https://github.com/d2-projects/d2-admin) simplified version of the start template, delete all the sample code in the full version, retain all core functions. [D2Admin](https://github.com/d2-projects/d2-admin) simplified version of the start template, delete all the sample code in the full version, retain all core functions.
[Gitee](https://gitee.com/fairyever/d2-admin-start-kit)
\ No newline at end of file \ No newline at end of file
[Gitee](https://gitee.com/fairyever/d2-admin-start-kit)
从 develop 分支号 dev_v4.4.0 本来用来开发审核以及报表功能版本, wangql_dev_v4.4.0 已开发部分对应需求,未往 dev_v4.4.0 版本合并,因此目前 dev_v4.4.0 分支无用
从 develop 拉分支号 dev_v4.5.1 用来开发转化加 V4.5.0 功能需求
从 dev_v4.5.0 拉分支号 dev_v4.5.2 用来新建菜单对应现在的虚拟对公账户功能,以前的菜单保留以防万一
No preview for this file type
...@@ -4938,6 +4938,22 @@ ...@@ -4938,6 +4938,22 @@
"safer-buffer": "^2.1.0" "safer-buffer": "^2.1.0"
} }
}, },
"echarts": {
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/echarts/-/echarts-5.3.2.tgz",
"integrity": "sha512-LWCt7ohOKdJqyiBJ0OGBmE9szLdfA9sGcsMEi+GGoc6+Xo75C+BkcT/6NNGRHAWtnQl2fNow05AQjznpap28TQ==",
"requires": {
"tslib": "2.3.0",
"zrender": "5.3.1"
},
"dependencies": {
"tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
}
}
},
"editorconfig": { "editorconfig": {
"version": "0.15.3", "version": "0.15.3",
"resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.3.tgz", "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.3.tgz",
...@@ -16005,6 +16021,21 @@ ...@@ -16005,6 +16021,21 @@
"dev": true "dev": true
} }
} }
},
"zrender": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/zrender/-/zrender-5.3.1.tgz",
"integrity": "sha512-7olqIjy0gWfznKr6vgfnGBk7y4UtdMvdwFmK92vVQsQeDPyzkHW1OlrLEKg6GHz1W5ePf0FeN1q2vkl/HFqhXw==",
"requires": {
"tslib": "2.3.0"
},
"dependencies": {
"tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
}
}
} }
} }
} }
{ {
"name": "dj-car-life-system", "name": "dj-car-life-system",
"version": "0.1.0", "version": "0.1.0",
"private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve --open", "serve": "vue-cli-service serve --open",
"start": "npm run serve", "start": "npm run serve",
...@@ -16,6 +17,7 @@ ...@@ -16,6 +17,7 @@
"better-scroll": "^1.15.2", "better-scroll": "^1.15.2",
"dayjs": "^1.8.12", "dayjs": "^1.8.12",
"default-passive-events": "^2.0.0", "default-passive-events": "^2.0.0",
"echarts": "^5.3.2",
"element-ui": "^2.13.1", "element-ui": "^2.13.1",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"flex.css": "^1.1.7", "flex.css": "^1.1.7",
...@@ -34,7 +36,7 @@ ...@@ -34,7 +36,7 @@
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-i18n": "^8.14.0", "vue-i18n": "^8.14.0",
"vue-qr": "^2.5.0", "vue-qr": "^2.5.0",
"vue-router": "^3.0.3", "vue-router": "3.0.5",
"vuex": "^3.0.1", "vuex": "^3.0.1",
"xlsx": "^0.16.9" "xlsx": "^0.16.9"
}, },
......
import request from './request' import request from './request'
const path = 'dj.api.' // const path = 'dj.api.'
const path2 = 'dj.api.smartcarlife.' const path2 = 'dj.api.smartcarlife.'
export function getTodayInvite(data) { export function getTodayInvite(data) {
...@@ -45,4 +45,4 @@ export function getIncomeFlowList(data) { ...@@ -45,4 +45,4 @@ export function getIncomeFlowList(data) {
export function getIncomeProductList(data) { export function getIncomeProductList(data) {
data.method = `${path2}workbench.statistics.goods.grossProfitRadio` data.method = `${path2}workbench.statistics.goods.grossProfitRadio`
return request(data) return request(data)
}
\ No newline at end of file \ No newline at end of file
}
...@@ -101,4 +101,10 @@ export function moneyValidApi(data) { ...@@ -101,4 +101,10 @@ export function moneyValidApi(data) {
export function getWsUrlApi(data) { export function getWsUrlApi(data) {
data.method = `${path}user.getWsUrl` data.method = `${path}user.getWsUrl`
return request(data) return request(data)
}
\ No newline at end of file \ No newline at end of file
}
// 商户管理 - 查看详情 - 修改入驻日期
export function entrydateUpdate(data) {
data.method = `${path2}entrydate.update`
return request(data, 'post')
}
...@@ -15,12 +15,24 @@ export function registerYseMerchantApi(data) { ...@@ -15,12 +15,24 @@ export function registerYseMerchantApi(data) {
return request(data, 'post') return request(data, 'post')
} }
// 注册线下商户_新版 registerYseMerchantApiNew
export function registerYseMerchantApiNew(data) {
data.method = `${djPath}yseMerchantOffline.registerNew`
return request(data, 'post')
}
// 注册线下商户-存草稿 // 注册线下商户-存草稿
export function draftYseMerchantApi(data) { export function draftYseMerchantApi(data) {
data.method = `${djPath}yseMerchantOffline.saveDrafts` data.method = `${djPath}yseMerchantOffline.saveDrafts`
return request(data, 'post') return request(data, 'post')
} }
// 注册线下商户-存草稿_新版
export function draftYseMerchantApiNew(data) {
data.method = `${djPath}yseMerchantOffline.saveDraftsNew`
return request(data, 'post')
}
// 获取商户虚拟对公账户详情 // 获取商户虚拟对公账户详情
export function getDetailApi(data) { export function getDetailApi(data) {
data.method = `${djPath}yseMerchantOffline.getDetail` data.method = `${djPath}yseMerchantOffline.getDetail`
...@@ -38,3 +50,20 @@ export function getMerchantPageSearch(data) { ...@@ -38,3 +50,20 @@ export function getMerchantPageSearch(data) {
data.method = `${path}page.search` data.method = `${path}page.search`
return request(data, 'post') return request(data, 'post')
} }
// 下载账户合同
export function downloadContract(data) {
data.method = `${path}yseMerchantOffline.downSign`
return request(data, 'post')
}
// 获取省市区信息
export function getAreaInfoApi(data) {
data.method = `${djPath}yseMerchantOffline.getAreaInfo`
return request(data, 'post')
}
// 根据开户支行编号查询区域信息
export function getAreaInfoByOpenAccBankTypeApi(data) {
data.method = `${djPath}yseMerchantOffline.getAreaInfoByOpenAccBankType`
return request(data, 'post')
}
...@@ -25,22 +25,18 @@ const request = (params = {}, method = RequestMethods.GET, noSignAttr = []) => { ...@@ -25,22 +25,18 @@ const request = (params = {}, method = RequestMethods.GET, noSignAttr = []) => {
* mock - url = params.method * mock - url = params.method
* 调后端接口 - url = '' * 调后端接口 - url = ''
*/ */
const url = params.method // '' const url = params.method
// console.log(url)
/** /**
* 调后端接口,请使用以下代码。 * 调后端接口,请使用以下代码。
*/ */
var reqData = var reqData =
// baseURL: process.env.VUE_APP_API + '?method=' + params.method,
method === RequestMethods.POST method === RequestMethods.POST
? { ? { baseURL: '/', data: sign(params, noSignAttr) }
// baseURL: process.env.VUE_APP_API + '?method=' + params.method, : { params: sign(params, noSignAttr) }
baseURL: '/', // console.log(method === RequestMethods.POST)
data: sign(params, noSignAttr) // console.log(url)
}
: {
params: sign(params, noSignAttr)
}
console.log(method === RequestMethods.POST)
console.log(url)
return axios({ return axios({
url, url,
method, method,
......
...@@ -41,4 +41,4 @@ export function GETYQMERCHANTCONFIGDETAIL(data) { ...@@ -41,4 +41,4 @@ export function GETYQMERCHANTCONFIGDETAIL(data) {
export function UPDATEYQMERCHANTCONFIG(data) { export function UPDATEYQMERCHANTCONFIG(data) {
data.method = `dj.api.smarcarlife.yqMerchantConfig.modify` data.method = `dj.api.smarcarlife.yqMerchantConfig.modify`
return request(data, 'post') return request(data, 'post')
}
\ No newline at end of file \ No newline at end of file
}
...@@ -9,7 +9,7 @@ import request from './request' ...@@ -9,7 +9,7 @@ import request from './request'
import RequestMethods from './request.methods' import RequestMethods from './request.methods'
// 用户相关 // 用户相关
const USER_PATH = 'dj.api.' const USER_PATH = 'dj.api.'
// 角色相关 // 角色相关
const ROLE_PATH = 'fims.role.' const ROLE_PATH = 'fims.role.'
export const LOGIN_URL = `${USER_PATH}user.login` export const LOGIN_URL = `${USER_PATH}user.login`
...@@ -23,23 +23,23 @@ export const ROLE_LIST_URL = `${ROLE_PATH}list` ...@@ -23,23 +23,23 @@ export const ROLE_LIST_URL = `${ROLE_PATH}list`
export function AccountLogin(data) { export function AccountLogin(data) {
data.method = LOGIN_URL data.method = LOGIN_URL
return request(data) return request(data)
// return new Promise(resolve => { // return new Promise(resolve => {
// resolve({ // resolve({
// roleId: 7, // roleId: 7,
// roleType: 2, // roleType: 2,
// mobile: '15234057707', // mobile: '15234057707',
// userName: 'wxw', // userName: 'wxw',
// loginName: 'foutouren', // loginName: 'foutouren',
// authes: [] // authes: []
// // authes: [{ // // authes: [{
// // authId: '10101', // // authId: '10101',
// // parentId: '101' // // parentId: '101'
// // }, { // // }, {
// // authId: '102', // // authId: '102',
// // parentId: '0' // // parentId: '0'
// // }] // // }]
// }) // })
// }) // })
} }
// 选择账号 // 选择账号
...@@ -199,4 +199,4 @@ export function RoleList(data = {}) { ...@@ -199,4 +199,4 @@ export function RoleList(data = {}) {
export function RoleDetail(data = {}) { export function RoleDetail(data = {}) {
data.method = `${ROLE_PATH}detail` data.method = `${ROLE_PATH}detail`
return request(data, RequestMethods.GET) return request(data, RequestMethods.GET)
}
\ No newline at end of file \ No newline at end of file
}
/* /*
* @Author: limin * @Author: limin
* @Date: 2019-08-26 18:02:55 * @Date: 2019-08-26 18:02:55
* @Last Modified by: chenwq * @Last Modified by: chenwq
* @Last Modified time: 2021-06-07 16:30:53 * @Last Modified time: 2021-06-07 16:30:53
*/ */
import request from './request' import request from './request'
import RequestMethods from './request.methods' import RequestMethods from './request.methods'
export const BASE_DATA_URL = 'fims.configuration.from.conftype' export const BASE_DATA_URL = 'fims.configuration.from.conftype'
const path = 'dj.api.' const path = 'dj.api.'
// 获取商品分类列表 // 获取商品分类列表
export function getProductType(data) { export function getProductType(data) {
data.method = `${path}goods.type.list` data.method = `${path}goods.type.list`
return request(data) return request(data)
} }
// 获取渠道列表 // 获取渠道列表
export function getChannelType(data) { export function getChannelType(data) {
data.method = `${path}channel.type.list` data.method = `${path}channel.type.list`
return request(data) return request(data)
} }
// 图片上传 // 图片上传
export function uploadImg(data) { export function uploadImg(data) {
data.method = `${path}common.uploadImg` data.method = `${path}common.uploadImg`
return request(data, RequestMethods.POST, ['file']) return request(data, RequestMethods.POST, ['file'])
} }
// 图片识别 // 图片识别
export function imgRecognitionApi(data) { export function imgRecognitionApi(data) {
data.method = `${path}common.ocr.recognition` data.method = `${path}common.ocr.recognition`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 银行列表 // 银行列表
export function getBankListApi(data) { export function getBankListApi(data) {
data.method = `${path}yseBankInfo.bankList` data.method = `${path}yseBankInfo.bankList`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 银行列表-支行 // 银行列表-支行
export function getYseBankListApi(data) { export function getYseBankListApi(data) {
data.method = `${path}yseBankInfo.listWithPage` data.method = `${path}yseBankInfo.listWithPage`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 给指定号码发送验证码 // 给指定号码发送验证码
export function sendToSmsCodeApi(data) { export function sendToSmsCodeApi(data) {
data.method = `${path}smartcarlife.sms.sendSmsCode` data.method = `${path}smartcarlife.sms.sendSmsCode`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 获取配置列表 // 获取配置列表
export function commonConfigApi(data) { export function commonConfigApi(data) {
data.method = `${path}common.config.list` data.method = `${path}common.config.list`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
...@@ -328,7 +328,7 @@ export function limitPrice( ...@@ -328,7 +328,7 @@ export function limitPrice(
regRule regRule
) { ) {
var reg = { var reg = {
priceReg: /^\d[\d\.]*$/, priceReg: /^\d[\d\.]*$/, // eslint-disable-line
numReg: /^[1-9]\d*$/ numReg: /^[1-9]\d*$/
} }
regRule = regRule || 'priceReg' regRule = regRule || 'priceReg'
...@@ -415,7 +415,7 @@ export const afterTodayOptions = { ...@@ -415,7 +415,7 @@ export const afterTodayOptions = {
// 'N':'不扣水续费' // 'N':'不扣水续费'
// } // }
//财务列表-订单表-表头原始数据 // 财务列表-订单表-表头原始数据
export const orderTableHead = [ export const orderTableHead = [
{ {
name: '序号', name: '序号',
...@@ -465,7 +465,7 @@ export const orderTableHead = [ ...@@ -465,7 +465,7 @@ export const orderTableHead = [
prop: 'orderType', prop: 'orderType',
sort: 21, sort: 21,
formatter: function(row, column) { formatter: function(row, column) {
let orderTypeList = [ const orderTypeList = [
{ {
confId: '1', confId: '1',
confLabel: '正常' confLabel: '正常'
...@@ -487,7 +487,7 @@ export const orderTableHead = [ ...@@ -487,7 +487,7 @@ export const orderTableHead = [
confLabel: '未收款' confLabel: '未收款'
} }
] ]
let o = orderTypeList.find(k => +k.confId === row.orderType) const o = orderTypeList.find(k => +k.confId === row.orderType)
return o ? o.confLabel : '-' return o ? o.confLabel : '-'
} }
} }
...@@ -688,7 +688,7 @@ export const billsTableHead = [ ...@@ -688,7 +688,7 @@ export const billsTableHead = [
prop: 'divisionType', prop: 'divisionType',
sort: 5, sort: 5,
formatter: function(row, column) { formatter: function(row, column) {
let divisionTypeList = [ const divisionTypeList = [
{ {
confId: '1', confId: '1',
confLabel: '线下对账' confLabel: '线下对账'
...@@ -698,7 +698,7 @@ export const billsTableHead = [ ...@@ -698,7 +698,7 @@ export const billsTableHead = [
confLabel: '线上分账' confLabel: '线上分账'
} }
] ]
let o = divisionTypeList.find(k => { const o = divisionTypeList.find(k => {
return k.confId == row.divisionType return k.confId == row.divisionType
}) })
return o ? o.confLabel : '-' return o ? o.confLabel : '-'
...@@ -720,7 +720,7 @@ export const billsTableHead = [ ...@@ -720,7 +720,7 @@ export const billsTableHead = [
prop: 'odDivisionStatus', prop: 'odDivisionStatus',
sort: 19, sort: 19,
formatter: function(row, column) { formatter: function(row, column) {
let ODDIVISIONSTATUS = { const ODDIVISIONSTATUS = {
1: '待分账', 1: '待分账',
2: '分账中', 2: '分账中',
3: '分账成功', 3: '分账成功',
...@@ -737,7 +737,7 @@ export const billsTableHead = [ ...@@ -737,7 +737,7 @@ export const billsTableHead = [
prop: 'deductChargeFlag', prop: 'deductChargeFlag',
sort: 20, sort: 20,
formatter: function(row, column) { formatter: function(row, column) {
let DEDUCTCHARGEFLAG = { const DEDUCTCHARGEFLAG = {
Y: '扣除手续费(按0.6%的标准)', Y: '扣除手续费(按0.6%的标准)',
N: '不扣水续费' N: '不扣水续费'
} }
......
// 将该代码定义为一个js文件
const resize = {
bind(el, binding) {
let width = ''
let height = ''
function isResize() {
const style = document.defaultView.getComputedStyle(el)
if (width !== style.width || height !== style.height) {
binding.value()
}
width = style.width
height = style.height
}
el._vueSetInterval_ = setInterval(isResize, 300)
},
unbind(el) {
clearInterval(el._vueSetInterval_)
}
}
export default resize
import Vue from 'vue' // import Vue from 'vue'
import { Message, MessageBox, Loading } from 'element-ui'
import { Message, MessageBox, Loading } from 'element-ui';
import moment from 'moment' import moment from 'moment'
let loadingInstance = '' let loadingInstance = ''
export const Util = { export const Util = {
/** /**
* 简单alert * 简单alert
* title 标题 * title 标题
...@@ -31,25 +29,25 @@ export const Util = { ...@@ -31,25 +29,25 @@ export const Util = {
callback: function(action, done) { callback: function(action, done) {
if (action == 'confirm') { if (action == 'confirm') {
if (options.success) { if (options.success) {
(options.success)(done) options.success(done)
} }
} else { } else {
console.log(done); console.log(done)
// done() // done()
} }
} }
}); })
/* Vue.$vux.alert.show({ /* Vue.$vux.alert.show({
title: options.title||'', title: options.title||'',
content: options.message||'', content: options.message||'',
onShow() { onShow() {
options.onShow?(options.onShow)():''; options.onShow?(options.onShow)():'';
}, },
onHide() { onHide() {
options.onHide?(options.onHide)():''; options.onHide?(options.onHide)():'';
} }
}) */ }) */
}, },
/** /**
...@@ -61,8 +59,7 @@ export const Util = { ...@@ -61,8 +59,7 @@ export const Util = {
type: options.type || 'error', type: options.type || 'error',
duration: options.time || 2000, duration: options.time || 2000,
onClose: options.onClose || '' onClose: options.onClose || ''
}); })
}, },
/** /**
...@@ -83,108 +80,110 @@ export const Util = { ...@@ -83,108 +80,110 @@ export const Util = {
loading: function(message) { loading: function(message) {
loadingInstance = Loading.service({ loadingInstance = Loading.service({
text: message || '加载中...' text: message || '加载中...'
}); })
}, },
/** /**
* 关闭loading * 关闭loading
*/ */
closeLoading: function() { closeLoading: function() {
loadingInstance.close(); loadingInstance.close()
}, },
/** /**
* 校验手机号码格式 * 校验手机号码格式
*/ */
checkPhone: function(mobile) { checkPhone: function(mobile) {
let myreg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/; const myreg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
return myreg.test(mobile); return myreg.test(mobile)
}, },
/** /**
* 校验固定电话 * 校验固定电话
*/ */
validationTel: function(tel) { validationTel: function(tel) {
let reg = /^0[\d]{2,3}-[\d]{7,8}$/; const reg = /^0[\d]{2,3}-[\d]{7,8}$/
return reg.test(tel); return reg.test(tel)
}, },
/** /**
* 是否特殊字符 * 是否特殊字符
*/ */
isSpecialLetter: function(str) { isSpecialLetter: function(str) {
let reg = new RegExp("[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]"); const reg = new RegExp(
return reg.test(str); "[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]"
)
return reg.test(str)
}, },
/** /**
* 只能输入英文字母和数字,不能输入中文 * 只能输入英文字母和数字,不能输入中文
*/ */
validationInput: function(str) { validationInput: function(str) {
let reg = /[^\w\.\/]/ig; const reg = /[^\w\.\/]/gi // eslint-disable-line
return reg.test(str); return reg.test(str)
}, },
/** /**
* 获取当前时间 * 获取当前时间
*/ */
getCurrentDate: function() { getCurrentDate: function() {
let time = new Date(); const time = new Date()
let y = time.getFullYear(); const y = time.getFullYear()
let m = time.getMonth() + 1; const m = time.getMonth() + 1
let d = time.getDate(); const d = time.getDate()
return { return {
date: y + '/' + m + '/' + d date: y + '/' + m + '/' + d
} }
}, },
/** /**
   * 获取浏览器参数 * 获取浏览器参数
   */ */
  getUrlParams: function(name) { getUrlParams: function(name) {
    let vars = [], const vars = []
      hash; let hash
      let oParams = {}; const oParams = {}
    let hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); const hashes = window.location.href
    for (let i = 0; i < hashes.length; i++) { .slice(window.location.href.indexOf('?') + 1)
      hash = hashes[i].split('='); .split('&')
      vars.push(hash[0]); for (let i = 0; i < hashes.length; i++) {
      oParams[hash[0]] = hash[1]; hash = hashes[i].split('=')
    } vars.push(hash[0])
    console.log(vars); oParams[hash[0]] = hash[1]
    if(name){ }
      return oParams[name]; console.log(vars)
    }else{ if (name) {
      return oParams; return oParams[name]
    } } else {
  }, return oParams
}
},
/** /**
* 根据当前时间,计算往后30天的日期 * 根据当前时间,计算往后30天的日期
*/ */
getAfterDate: function(day) { getAfterDate: function(day) {
let date1 = new Date(); const date1 = new Date()
let date2 = new Date(date1); const date2 = new Date(date1)
let time = 30; let time = 30
if (day) { if (day) {
time = day; time = day
} }
date2.setDate(date1.getDate() + time); date2.setDate(date1.getDate() + time)
let _date = date2.getFullYear() + '-' + (date2.getMonth() + 1) + '-' + date2.getDate(); const _date =
date2.getFullYear() + '-' + (date2.getMonth() + 1) + '-' + date2.getDate()
return { return {
date: _date, date: _date,
year: date2.getFullYear(), year: date2.getFullYear(),
month: date2.getMonth() + 1, month: date2.getMonth() + 1,
day: date2.getDate() day: date2.getDate()
}; }
}, },
/** /**
* 日期格式转换 * 日期格式转换
*/ */
...@@ -213,7 +212,7 @@ export const Util = { ...@@ -213,7 +212,7 @@ export const Util = {
if (str.length > m) { if (str.length > m) {
n = str.slice(0, m) + '...' n = str.slice(0, m) + '...'
} }
return n return n
}, },
...@@ -223,7 +222,7 @@ export const Util = { ...@@ -223,7 +222,7 @@ export const Util = {
* console.log(bar===foo) false * console.log(bar===foo) false
* @param {*} obj * @param {*} obj
*/ */
deepClone: function (obj) { deepClone: function(obj) {
// Handle the 3 simple types, and null or undefined or function // Handle the 3 simple types, and null or undefined or function
if (obj == null || typeof obj !== 'object') return obj if (obj == null || typeof obj !== 'object') return obj
// Handle Date // Handle Date
...@@ -243,12 +242,11 @@ export const Util = { ...@@ -243,12 +242,11 @@ export const Util = {
return copy return copy
} }
throw new Error("Unable to clone obj! Its type isn't supported.") throw new Error("Unable to clone obj! Its type isn't supported.")
}, }
} }
export const showModal = Util.msg export const showModal = Util.msg
export const showToast = Util.Info export const showToast = Util.Info
export const showLoading = Util.loading export const showLoading = Util.loading
export const hideLoading = Util.closeLoading export const hideLoading = Util.closeLoading
export const deepClone = Util.deepClone
\ No newline at end of file \ No newline at end of file
export const deepClone = Util.deepClone
<template>
<el-dialog id="baseDialog"
top="30vh"
:close-on-click-modal="true"
:close-on-press-escape="true"
:title="dialogConfig.title"
:width="dialogConfig.width"
:visible.sync="visible"
:show-close="config.showClose"
:append-to-body="config.appendToBody">
<slot></slot>
<div slot="footer"
v-if="config.isShowFooter">
<el-button type="danger"
@click="confirmBtn">
{{config.confirm_name}}
</el-button>
<el-button @click="visible = false">
{{ config.cancel_name }}
</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
name: 'baseDialog',
props: {
dialogConfig: {
required: false,
type: Object,
default: function () {
return {
title: '提示',
width: '480px'
}
}
},
config: {
required: false,
type: Object,
default: function () {
return {
showClose: true,
appendToBody: false, // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
isShowFooter: true,
cancel_name: '取 消',
confirm_name: '确 定'
}
}
},
isShow: {
// 弹窗是否展示
type: Boolean,
default: false
}
// width: {
// //弹窗宽度
// type: String,
// default: '',
// },
// cancel_name: {
// //取消按钮名称
// type: String,
// default: '取 消',
// },
// confirm_name: {
// //确定按钮名称
// type: String,
// default: '确 定',
// },
// isShowFooter: {
// //是否自定底部
// type: Boolean,
// default: true,
// },
// closeClick: {
// type: Boolean,
// default: false,
// },
// appendToBody: {
// // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
// type: Boolean,
// default: false,
// },
},
data() {
return {}
},
computed: {
visible: {
get() {
return this.isShow
},
set(val) {
this.$emit('update:isShow', false)
}
}
},
methods: {
confirmBtn() {
// 触发保存
this.$emit('handleClick')
}
},
created() {
// console.log('baseDialog')
},
mounted() { }
}
</script>
<style scoped lang="scss">
::v-deep .el-dialog {
// height: 90vh;
border-radius: 6px;
// padding: 0;
overflow: hidden;
.el-dialog__header {
// box-shadow: 0px 0px 5px 0px rgba(136, 152, 157, 0.3);
border-bottom: solid 1px #e6e6e6;
border-radius: 6px 6px 0px 0px;
padding: 18px 20px 18px 25px;
.el-dialog__title {
// color: #212121;
color: #333333;
font-family: PingFangSC-Medium;
font-size: 20px;
font-weight: 600;
// font-weight: 16px;
}
.el-dialog__close {
color: #666;
font-weight: 600;
font-size: 20px;
}
}
.el-dialog__body {
box-sizing: border-box;
// padding-left: 25px;
padding: 15px 20px 30px;
color: #333;
max-height: calc(100% - 121px);
// height: calc(100% - 121px);
}
.roleTitle {
margin-right: 40px;
}
}
</style>
export default { export default {
name: 'AuthButton', name: 'AuthButton',
props: { props: {
label: { label: {
type: String, type: String,
default: '' default: ''
}, },
size: { size: {
type: String, type: String,
default: 'mini' default: 'mini'
}, },
// type: { // type: {
// type: String, // type: String,
// default: 'text' // default: 'text'
// }, // },
category: { category: {
type: String, type: String,
default: 'operation' default: 'operation'
}, },
loading: { loading: {
type: Boolean, type: Boolean,
default: false default: false
}, },
disabled: { disabled: {
type: Boolean, type: Boolean,
default: false default: false
}, },
id: { id: {
type: String, type: String,
default: null default: null
}, },
accept: { accept: {
type: String, type: String,
default: null default: null
}, },
mapping: { mapping: {
type: Object, type: Object,
default: null default: null
}, },
showBtnIds: { showBtnIds: {
type: Array, type: Array,
default: [] // props类型为Object/Array 使用函数方法解决
}, default: () => []
data: Object },
}, data: Object
functional: true, // 开启函数化组件 },
render: (h, ctx) => { functional: true, // 开启函数化组件
const _this = ctx.parent // 获取 vue this 实例 render: (h, ctx) => {
// console.log(ctx); const _this = ctx.parent // 获取 vue this 实例
/** // console.log(ctx);
* 获取传入参数 /**
* category 非必填 button 类别 暂时两种 1 表格操作:operation ,2 Button 按钮: action 默认 operation ----- route 中不标明 视为默认值 operation * 获取传入参数
* data 点击按钮时 需要得到的参数 比如 table 中的 当前行数据 row * category 非必填 button 类别 暂时两种 1 表格操作:operation ,2 Button 按钮: action 默认 operation ----- route 中不标明 视为默认值 operation
* mapping 非必填 但: 当列表中的操作选项 根据 某个字段 变化的话 必填 且 必须 注明 field: 字段名 * data 点击按钮时 需要得到的参数 比如 table 中的 当前行数据 row
* label 当传入label 字段时 标识明确指定渲染该label 的按钮 * mapping 非必填 但: 当列表中的操作选项 根据 某个字段 变化的话 必填 且 必须 注明 field: 字段名
* size 按钮样式,默认mini * label 当传入label 字段时 标识明确指定渲染该label 的按钮
* showBtnIds 按需显示按钮 * size 按钮样式,默认mini
*/ * showBtnIds 按需显示按钮
const { */
category, const { category, data, mapping, label, size, showBtnIds } = ctx.props
data, let curBtns = []
mapping, /**
label, * 判断一个按钮(btn)是否存在与当前行(data) 的映射关系(mapping)中
size, * @param {*} btn
showBtnIds */
} = ctx.props const filter = btn =>
let curBtns = [] mapping ? mapping[data[mapping['field']]].includes(btn.label) : true
/** const $store = _this.$store.getters['d2admin/auth/curBtns']
* 判断一个按钮(btn)是否存在与当前行(data) 的映射关系(mapping)中 if (!$store) return h('div')
* @param {*} btn if (label) {
*/ // 指定label
const filter = btn => mapping ? mapping[data[mapping['field']]].includes(btn.label) : true const __item = $store.find(btn => btn.label === label && filter(btn))
const $store = _this.$store.getters['d2admin/auth/curBtns'] __item && curBtns.push(__item)
if (!$store) return h('div') } else {
if (label) { // 指定label /**
const __item = $store.find(btn => (btn.label === label) && filter(btn)) * 拿到当前模块(页面) 所拥有按钮列表 过滤type属性 与 映射关系 返回需要显示的按钮列表
__item && curBtns.push(__item) */
} else { curBtns = $store.filter(btn => {
/** if (category === 'operation') {
* 拿到当前模块(页面) 所拥有按钮列表 过滤type属性 与 映射关系 返回需要显示的按钮列表 return (btn.category === 'operation' || !btn.category) && filter(btn)
*/ } else if (!category) {
curBtns = $store.filter(btn => { // 未指定类别
if (category === 'operation') { return !btn.category && filter(btn)
return (btn.category === 'operation' || !btn.category) && filter(btn) }
} else if (!category) { // 未指定类别 return btn.category === category && filter(btn)
return !btn.category && filter(btn) })
} }
return (btn.category === category) && filter(btn) if (curBtns.length === 0) return h('div')
}) const __aBtns = []
} /**
if (curBtns.length === 0) return h('div') * 循环最终显示的按钮列表
const __aBtns = [] * 并渲染到页面
/** */
* 循环最终显示的按钮列表 curBtns = showBtnIds.length
* 并渲染到页面 ? curBtns.filter(item => showBtnIds.includes(item.authId))
*/ : curBtns
curBtns = showBtnIds.length ? curBtns.filter(item => showBtnIds.includes(item.authId)) : curBtns curBtns.forEach(btn => {
curBtns.forEach(btn => { // var judgeRes = data ? (data.yqMerchantId === _this.$store.state.d2admin.user.info.detail.merchantId) : true
// var judgeRes = data ? (data.yqMerchantId === _this.$store.state.d2admin.user.info.detail.merchantId) : true // var isShow = !btn.judgeShow ? true : judgeRes
// var isShow = !btn.judgeShow ? true : judgeRes // if ((btn.category === 'Button') || (data && isShow)) {
// if ((btn.category === 'Button') || (data && isShow)) { __aBtns.push(
__aBtns.push(h('el-button', { h(
props: { 'el-button',
type: btn.type || (btn.category === 'Button' ? '' : 'text'), {
icon: btn.icon ? `el-icon-${btn.icon}` : '', props: {
size: size, type: btn.type || (btn.category === 'Button' ? '' : 'text'),
disabled: btn.ruleObj ? (btn.ruleObj.hasOwnProperty('disabledStatusList') ? btn.ruleObj.disabledStatusList.includes(data[btn.ruleObj.attr]) : false) : false icon: btn.icon ? `el-icon-${btn.icon}` : '',
}, size: size,
style: { disabled: btn.ruleObj
color: btn.color ? btn.ruleObj.hasOwnProperty('disabledStatusList')
}, ? btn.ruleObj.disabledStatusList.includes(
on: { data[btn.ruleObj.attr]
click: (e) => btn.handle && _this[btn.handle](data, e) )
} : false
}, [btn.ruleObj ? btn.ruleObj.rule[data[btn.ruleObj.attr]] : btn.label])) : false
// } },
}) style: {
return h('span', {}, [...__aBtns, ctx.children]) color: btn.color
} },
} on: {
click: e => btn.handle && _this[btn.handle](data, e)
}
},
[btn.ruleObj ? btn.ruleObj.rule[data[btn.ruleObj.attr]] : btn.label]
)
)
// }
})
return h('span', {}, [...__aBtns, ctx.children])
}
}
<template> <template>
<div class="d2-container-full"> <div class="d2-container-full">
<!-- <el-scrollbar> --> <!-- <el-scrollbar> -->
<div v-if="$slots.header" class="d2-container-full__header" ref="header" :class="this.active?'active':'close'"> <div v-if="$slots.header"
<slot name="header" /> class="d2-container-full__header"
<d2-header-switch /> ref="header"
</div> :class="this.active?'active':'close'">
<div class="d2-container-full__body" ref="body"> <slot name="header" />
<slot /> <d2-header-switch />
</div> </div>
<div v-if="$slots.footer" class="d2-container-full__footer" ref="footer"> <div class="d2-container-full__body"
<slot name="footer" /> ref="body">
</div> <slot />
<!-- </el-scrollbar> --> </div>
</div> <div v-if="$slots.footer"
</template> class="d2-container-full__footer"
ref="footer">
<script> <slot name="footer" />
import scroll from './mixins/normal' </div>
export default { <!-- </el-scrollbar> -->
name: 'd2-container-full', </div>
mixins: [scroll], </template>
components: {
// d2HeaderSwitch: () => import('./d2-header-switch.vue') <script>
}, import scroll from './mixins/normal'
data() { export default {
return { name: 'd2-container-full',
oHeaderStyle: { mixins: [scroll],
padding: '20px 20px 0 20px' components: {
} d2HeaderSwitch: () => import('./d2-header-switch.vue')
} },
}, data() {
computed: { return {
active() { oHeaderStyle: {
return this.$store.state.d2admin.tsearch.active padding: '20px 20px 0 20px'
} }
}, }
mounted() { },
// 增加滚动事件监听 computed: {
this.addScrollListener() active() {
}, return this.$store.state.d2admin.tsearch.active
beforeDestroy() { }
// 移除滚动事件监听 },
this.removeScrollListener() mounted() {
} // 增加滚动事件监听
} this.addScrollListener()
</script> },
beforeDestroy() {
<style lang="scss"> // 移除滚动事件监听
.d2-container-full { this.removeScrollListener()
.d2-container-full__header { }
position: relative; }
transition: all .2s ease; </script>
&.close{
height: 0; <style lang="scss">
padding: 0 20px !important; .d2-container-full {
form{ .d2-container-full__header {
opacity: 0; position: relative;
} transition: all 0.2s ease;
border-bottom-color:rgba(0,0,0,0) !important; &.close {
} height: 0;
.el-form-item{ padding: 0 20px !important;
margin-bottom: 4px; form {
} opacity: 0;
} }
} border-bottom-color: rgba(0, 0, 0, 0) !important;
}
//滚动条的宽度 .el-form-item {
::-webkit-scrollbar { margin-bottom: 4px;
width: 10px; }
height: 10px; }
} }
//滚动条的滑块
::-webkit-scrollbar-thumb { //滚动条的宽度
background-color: #a1a3a9; ::-webkit-scrollbar {
border-radius: 3px; width: 10px;
} height: 10px;
</style> }
//滚动条的滑块
::-webkit-scrollbar-thumb {
background-color: #a1a3a9;
border-radius: 3px;
}
</style>
<template> <template>
<div <div v-if="show"
v-if="show" class="d2-header-switch"
class="d2-header-switch" :class="{ 'd2-header-switch--active': isActive }"
:class="{ 'd2-header-switch--active': isActive }" @click="handleClick">
@click="handleClick"> <d2-el-icon :name="name" />
<d2-el-icon :name="name"/> <li :class="$store.state.d2admin.tsearch.active?'fa fa-compress':'fa fa-expand'"></li>
<li :class="$store.state.d2admin.tsearch.active?'fa fa-compress':'fa fa-expand'"></li> </div>
</div> </template>
</template>
<script>
<script> import { mapMutations } from 'vuex'
import { mapMutations } from 'vuex' export default {
export default { data() {
data() { return {
return { isActive: false,
isActive: false, path: ''
path: '' }
} },
}, computed: {
computed: { show() {
show() { return true
return true },
}, name() {
name() { return this.$store.state.d2admin.tsearch.active ? 'top-right' : 'bottom-left'
return this.$store.state.d2admin.tsearch.active ? 'top-right' : 'bottom-left' }
} },
}, mounted() {
mounted() { setTimeout(() => (this.isActive = true), 0)
setTimeout(() => (this.isActive = true), 0) },
}, methods: {
methods: { ...mapMutations('d2admin/tsearch', ['toggle']),
...mapMutations('d2admin/tsearch', ['toggle']), // 点击按钮的时候跳转到源代码
// 点击按钮的时候跳转到源代码 handleClick() {
handleClick() { this.toggle()
this.toggle() }
} }
} }
} </script>
</script>
<style lang="scss" scoped>
<style lang="scss" scoped> .d2-header-switch {
.d2-header-switch { $borderRadius: 30px;
$borderRadius: 30px; $paddingLR: 30px;
$paddingLR: 30px; $paddingTB: 2px;
$paddingTB: 2px; $fontSize: 12px;
$fontSize: 12px; $rightOuter: $paddingLR / 2;
$rightOuter: $paddingLR / 2; opacity: 0;
opacity: 0; position: absolute;
position: absolute; z-index: 2000;
z-index: 2019; right: 20%;
right: 20%; bottom: -17px;
bottom: -17px; font-size: $fontSize;
font-size: $fontSize; line-height: $fontSize;
line-height: $fontSize; font-weight: bold;
font-weight: bold; border-radius: 0 0 $borderRadius $borderRadius;
border-radius: 0 0 $borderRadius $borderRadius; padding: $paddingTB $paddingLR;
padding: $paddingTB $paddingLR; background-color: rgba(#fff, 1);
background-color: rgba(#fff, 1); border: 1px solid #dcdfe6;
border: 1px solid #DCDFE6; border-top: none;
border-top: none; color: #606266;
color: #606266; transition: all 0.3s;
transition: all .3s; @extend %unable-select;
@extend %unable-select; &.d2-header-switch--active {
&.d2-header-switch--active { opacity: 1;
opacity: 1; }
} }
} </style>
</style>
<!-- 编辑商品弹窗 --> <!-- 编辑商品弹窗 -->
<template> <template>
<d2-dialog <d2-dialog title="添加绑定升级商品"
title="添加绑定升级商品" :isVisible.sync="relateProVisible"
:isVisible.sync="relateProVisible" btnOkLabel="关联"
btnOkLabel="关联" width="950px"
width="950px" @confirmDialog="handleRelateProConfirm"
@confirmDialog="handleRelateProConfirm" @closeDialog="handleRelateProClose"
@closeDialog="handleRelateProClose" class="relatePro">
class="relatePro"
>
<div class="relateProDialog flex"> <div class="relateProDialog flex">
<img <img v-show="proInfo.thumbUrl"
v-show="proInfo.thumbUrl" :src="proInfo.thumbUrl" />
:src="proInfo.thumbUrl" <img v-show="!proInfo.thumbUrl"
/> src="./image/no-choice.png" />
<img <el-form :model="proInfo"
v-show="!proInfo.thumbUrl" :rules="rules"
src="./image/no-choice.png" label-width="110px"
/> ref="proRuleForm1"
<el-form style="width: calc(100% - 180px);">
:model="proInfo"
:rules="rules"
label-width="110px"
ref="proRuleForm1"
style="width: calc(100% - 180px);"
>
<div class="w-50"> <div class="w-50">
<el-form-item <el-form-item label="选择产品"
label="选择产品" prop="goodsCode">
prop="goodsCode" <el-select style="width: 98%;"
> v-model="proInfo.goodsCode"
<el-select placeholder="请选择一款作为升级商品"
style="width: 98%;" value-key="goodsCode"
v-model="proInfo.goodsCode" filterable
placeholder="请选择一款作为升级商品" @change="handleChangeGood">
value-key="goodsCode" <el-option v-for="item in proList"
filterable="true" :key="item.goodsCode"
@change="handleChangeGood" :label="item.goodsName"
> :value="item.goodsCode"
<el-option :disabled="item.disabled"></el-option>
v-for="item in proList"
:key="item.goodsCode"
:label="item.goodsName"
:value="item.goodsCode"
:disabled="item.disabled"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</div> </div>
<div class="w-50"> <div class="w-50">
<el-form-item label="分类"> <el-form-item label="分类">
<el-input <el-input disabled
disabled placeholder="分类"
placeholder="分类" :value="proInfo.goodsTypeName"
:value="proInfo.goodsTypeName" class="dis-in-block"></el-input>
class="dis-in-block"
></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="w-50"> <div class="w-50">
</div> </div>
<div class="w-50"> <div class="w-50">
<el-form-item label="编号"> <el-form-item label="编号">
<el-input <el-input disabled
disabled placeholder="编号"
placeholder="编号" :value="proInfo.sapCode"
:value="proInfo.sapCode" class="dis-in-block"></el-input>
class="dis-in-block"
></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="w-50"> <div class="w-50">
<el-form-item <el-form-item label="产品成本"
label="产品成本" prop="shopPrice">
prop="shopPrice" <el-input v-model="proInfo.shopPrice"
> placeholder="请输入建议产品成本"
<el-input class="dis-in-block"
v-model="proInfo.shopPrice" @input="handleShopPrice"
placeholder="请输入建议产品成本" @blur="handleShopPriceBlur">
class="dis-in-block" <i slot="suffix"
@input="handleShopPrice" class="suffix">元</i>
@blur="handleShopPriceBlur"
>
<i
slot="suffix"
class="suffix"
>元</i>
</el-input> </el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="w-50"> <div class="w-50">
<el-form-item <el-form-item label="建议升级价格"
label="建议升级价格" prop="upgradePrice">
prop="upgradePrice" <el-input v-model="proInfo.upgradePrice"
> placeholder="请输入建议升级价格"
<el-input class="dis-in-block"
v-model="proInfo.upgradePrice" @input="handleUpgradePrice">
placeholder="请输入建议升级价格" <i slot="suffix"
class="dis-in-block" class="suffix">元</i>
@input="handleUpgradePrice"
>
<i
slot="suffix"
class="suffix"
>元</i>
</el-input> </el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="w-50"> <div class="w-50">
<el-form-item <el-form-item label="商品最低价"
label="商品最低价" prop="shopMinPrice">
prop="shopMinPrice" <el-input v-model="proInfo.shopMinPrice"
> placeholder="请输入商品最低价"
<el-input class="dis-in-block"
v-model="proInfo.shopMinPrice" @input="handleShopMinPrice">
placeholder="请输入商品最低价" <i slot="suffix"
class="dis-in-block" class="suffix">元</i>
@input="handleShopMinPrice"
>
<i
slot="suffix"
class="suffix"
>元</i>
</el-input> </el-input>
</el-form-item> </el-form-item>
</div> </div>
<div <div class="w-50"
class="w-50" v-show="warrantyProList.includes(proInfo.goodsType)">
v-show="warrantyProList.includes(proInfo.goodsType)" <el-form-item label="质保年限"
> prop="warrantyPeriod">
<el-form-item <el-select style="width: 98%;"
label="质保年限" :class="{ 'select-suffix': !!proInfo.warrantyPeriod }"
prop="warrantyPeriod" v-model="proInfo.warrantyPeriod">
> <el-option v-for="item in warrantyPeriodList"
<el-select :key="item.confId"
style="width: 98%;" :label="item.confLabel"
:class="{ 'select-suffix': !!proInfo.warrantyPeriod }" :value="item.confId"></el-option>
v-model="proInfo.warrantyPeriod"
>
<el-option
v-for="item in warrantyPeriodList"
:key="item.confId"
:label="item.confLabel"
:value="item.confId"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</div> </div>
...@@ -178,14 +134,24 @@ export default { ...@@ -178,14 +134,24 @@ export default {
goodsCode: [{ required: true, message: '请选择关联升级商品', trigger: 'change' }], goodsCode: [{ required: true, message: '请选择关联升级商品', trigger: 'change' }],
upgradePrice: [ upgradePrice: [
{ required: true, message: '请输入建议升级价', trigger: 'blur' }, { required: true, message: '请输入建议升级价', trigger: 'blur' },
{ required: true, {
required: true,
trigger: 'blur', trigger: 'blur',
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
(+value < +this.proInfo.shopPrice) ? callback(new Error('建议升级价需要大于或等于产品成本')) : callback() (+value < +this.proInfo.shopPrice) ? callback(new Error('建议升级价需要大于或等于产品成本')) : callback()
} }
}], }],
shopPrice: [{ required: true, message: '请输入产品成本', trigger: 'blur' }], shopPrice: [{ required: true, message: '请输入产品成本', trigger: 'blur' }],
shopMinPrice: [{ required: true, message: '请输入商品最低价', trigger: 'blur' }] shopMinPrice: [
{ required: true, message: '请输入商品最低价', trigger: 'blur' },
{
required: true,
trigger: 'blur',
validator: (rule, value, callback) => {
(+value < +this.proInfo.shopPrice) ? callback(new Error('商品最低价数值小于产品成本')) : callback()
}
}
]
}, },
oldVal: { oldVal: {
upgradePrice: '', upgradePrice: '',
......
...@@ -17,50 +17,50 @@ export default { ...@@ -17,50 +17,50 @@ export default {
props: { props: {
show: { show: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
title: { title: {
type: String, type: String,
default: '提示', default: '提示'
}, },
width: { width: {
type: String, type: String,
default: '46%', default: '46%'
}, },
cancel: { cancel: {
required: false, required: false,
type: Function, type: Function
}, },
confirm: { confirm: {
required: false, required: false,
type: Function, type: Function
}, },
usefooter: { usefooter: {
required: false, required: false,
type: Boolean, type: Boolean,
default: false, default: false
}, },
appendtobody: { appendtobody: {
required: false, required: false,
type: Boolean, type: Boolean,
default: false, default: false
}, }
}, },
data() { data() {
return { return {
hasFooter: false, hasFooter: false
} }
}, },
created() { created() {
let o = this.$slots const o = this.$slots
this.hasFooter = o.footer this.hasFooter = o.footer
}, },
mounted: function () {}, mounted: function() {},
methods: { methods: {
/** /**
* 取消关闭弹框 * 取消关闭弹框
*/ */
onCancel: function () { onCancel: function() {
// 兼容以前的页面 // 兼容以前的页面
this.$emit('close') this.$emit('close')
}, },
...@@ -68,8 +68,8 @@ export default { ...@@ -68,8 +68,8 @@ export default {
/** /**
* 确定 * 确定
*/ */
onConfirm: function () {}, onConfirm: function() {}
}, }
} }
</script> </script>
......
import Vue from 'vue' import Vue from 'vue'
import d2Container from './d2-container' import d2Container from './d2-container'
import authButton from './d2-auth/d2-auth-btn.js' import authButton from './d2-auth/d2-auth-btn.js'
// 注意 有些组件使用异步加载会有影响 // 注意 有些组件使用异步加载会有影响
Vue.component('d2-container', d2Container) Vue.component('d2-container', d2Container)
Vue.component('d2-icon', () => import('./d2-icon')) Vue.component('d2-icon', () => import('./d2-icon'))
Vue.component('d2-el-icon', () => import('./d2-el-icon')) Vue.component('d2-el-icon', () => import('./d2-el-icon'))
Vue.component('d2-icon-svg', () => import('./d2-icon-svg/index.vue')) Vue.component('d2-icon-svg', () => import('./d2-icon-svg/index.vue'))
Vue.component('d2-table-header', () => import('./d2-table-header/index.vue')) Vue.component('d2-table-header', () => import('./d2-table-header/index.vue'))
Vue.component('d2-table', () => import('./d2-table/index.vue')) Vue.component('d2-table', () => import('./d2-table/index.vue'))
Vue.component('d2-dialog', () => import('./d2-dialog/index.vue')) Vue.component('d2-dialog', () => import('./d2-dialog/index.vue'))
Vue.component('d2-form', () => import('./d2-form/index.vue')) Vue.component('d2-form', () => import('./d2-form/index.vue'))
Vue.component('d2-search', () => import('./d2-search/index.vue')) Vue.component('d2-search', () => import('./d2-search/index.vue'))
Vue.component('relateStoreDialog', () => import('./d2-form/relateStoreDialog.vue')) Vue.component('relateStoreDialog', () =>
Vue.component([authButton.name], authButton) import('./d2-form/relateStoreDialog.vue')
)
// Vue.component([authButton.name], authButton)
Vue.component(authButton.name, authButton)
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
:key="index" :key="index"
:command="language.value"> :command="language.value">
<d2-icon :name="$i18n.locale === language.value ? 'dot-circle-o' : 'circle-o'" class="d2-mr-5"/> <d2-icon :name="$i18n.locale === language.value ? 'dot-circle-o' : 'circle-o'" class="d2-mr-5"/>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
......
...@@ -9,18 +9,12 @@ ...@@ -9,18 +9,12 @@
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown>--> </el-dropdown>-->
<div <div v-popover:popover-personal
v-popover:popover-personal class="d2-mr personal-wrap">
class="d2-mr personal-wrap" <span v-if="show"
> class="btn-text">{{info && info.detail ? (info.detail.userType == 2 ? `${info.detail.userName}` : '管理员') : '未登录'}}</span>
<span <span class="btn-text out-txt"
v-if="show" @click="clear">退出</span>
class="btn-text"
>{{info && info.detail ? (info.detail.userType == 2 ? `${info.detail.userName}` : '管理员') : '未登录'}}</span>
<span
class="btn-text out-txt"
@click="clear"
>退出</span>
<!-- <el-popover ref="popover-personal" placement="bottom-end" v-model="userVisible" trigger="manual"> <!-- <el-popover ref="popover-personal" placement="bottom-end" v-model="userVisible" trigger="manual">
<i slot="reference" :class="['arrow-icon', 'el-icon-arrow-down', userVisible ? 'drOpen' : '']" @click="handleAccountClose"></i> <i slot="reference" :class="['arrow-icon', 'el-icon-arrow-down', userVisible ? 'drOpen' : '']" @click="handleAccountClose"></i>
<el-popover popper-class="accout-panel" placement="left-end" :visible-arrow="false" v-model="accountPanelVisible" trigger="manual"> <el-popover popper-class="accout-panel" placement="left-end" :visible-arrow="false" v-model="accountPanelVisible" trigger="manual">
...@@ -38,7 +32,7 @@ ...@@ -38,7 +32,7 @@
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import PersonalPanel from '../personal-panel' // import PersonalPanel from '../personal-panel'
export default { export default {
data() { data() {
return { return {
...@@ -47,11 +41,14 @@ export default { ...@@ -47,11 +41,14 @@ export default {
userVisible: false, userVisible: false,
accountInfo: { accountInfo: {
accountList: [] accountList: []
},
info: {
} }
} }
}, },
components: { components: {
PersonalPanel // PersonalPanel
}, },
mounted() { mounted() {
this.show = false this.show = false
...@@ -76,8 +73,8 @@ export default { ...@@ -76,8 +73,8 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(async() => { }).then(async () => {
const reload = async() => { const reload = async () => {
localStorage.clear() localStorage.clear()
await this.logout() await this.logout()
window.location.reload() window.location.reload()
...@@ -100,7 +97,7 @@ export default { ...@@ -100,7 +97,7 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(async() => { }).then(async () => {
this.$router.push('/login') this.$router.push('/login')
await this.logout() await this.logout()
await this.$StoreReset.call(this.$store) // 重置 store await this.$StoreReset.call(this.$store) // 重置 store
...@@ -124,7 +121,7 @@ export default { ...@@ -124,7 +121,7 @@ export default {
cursor: pointer; cursor: pointer;
} }
.el-icon-arrow-down { .el-icon-arrow-down {
transition: all .2s ease-in-out; transition: all 0.2s ease-in-out;
} }
.personal-wrap .arrow-icon.drOpen { .personal-wrap .arrow-icon.drOpen {
transform: rotate(-180deg); transform: rotate(-180deg);
......
...@@ -127,7 +127,7 @@ export default { ...@@ -127,7 +127,7 @@ export default {
} }
) )
.then(() => { .then(() => {
const reload = async () => { const reload = async() => {
localStorage.clear() localStorage.clear()
await this.logout() await this.logout()
this.$store.commit('d2admin/gray/set', false) this.$store.commit('d2admin/gray/set', false)
...@@ -161,7 +161,7 @@ export default { ...@@ -161,7 +161,7 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) })
.then(async () => { .then(async() => {
await this.$store.commit('d2admin/gray/set', false) await this.$store.commit('d2admin/gray/set', false)
resolve(true) resolve(true)
}) })
......
...@@ -9,7 +9,7 @@ const COOKIE_NAME_PREFIX = `${process.env.VUE_APP_STORAGE_PREFIX}-${process.env. ...@@ -9,7 +9,7 @@ const COOKIE_NAME_PREFIX = `${process.env.VUE_APP_STORAGE_PREFIX}-${process.env.
* @param {Object} setting cookie setting * @param {Object} setting cookie setting
*/ */
cookies.set = function(name = 'default', value = '', cookieSetting = {}) { cookies.set = function(name = 'default', value = '', cookieSetting = {}) {
let currentCookieSetting = { const currentCookieSetting = {
expires: 1 expires: 1
} }
Object.assign(currentCookieSetting, cookieSetting) Object.assign(currentCookieSetting, cookieSetting)
......
...@@ -13,7 +13,7 @@ const util = { ...@@ -13,7 +13,7 @@ const util = {
* @description 更新标题 * @description 更新标题
* @param {String} title 标题 * @param {String} title 标题
*/ */
util.title = function (titleText) { util.title = function(titleText) {
const processTitle = process.env.VUE_APP_TITLE const processTitle = process.env.VUE_APP_TITLE
window.document.title = `${processTitle}${titleText ? ` | ${titleText}` : ''}` window.document.title = `${processTitle}${titleText ? ` | ${titleText}` : ''}`
} }
...@@ -22,7 +22,7 @@ util.title = function (titleText) { ...@@ -22,7 +22,7 @@ util.title = function (titleText) {
* @description 打开新页面 * @description 打开新页面
* @param {String} url 地址 * @param {String} url 地址
*/ */
util.open = function (url, target) { util.open = function(url, target) {
var a = document.createElement('a') var a = document.createElement('a')
a.setAttribute('href', url) a.setAttribute('href', url)
a.setAttribute('target', target || '_blank') a.setAttribute('target', target || '_blank')
...@@ -64,9 +64,9 @@ util.deepClone = (obj) => { ...@@ -64,9 +64,9 @@ util.deepClone = (obj) => {
* @param {Function} condition 回调函数,必须返回谓词,判断是否找到了。会传入(item, index, level)三个参数 * @param {Function} condition 回调函数,必须返回谓词,判断是否找到了。会传入(item, index, level)三个参数
* @param {String} children 子数组的key * @param {String} children 子数组的key
*/ */
util.deepFind = function (menus, id) { util.deepFind = function(menus, id) {
const cloneMenus = util.deepClone(menus) const cloneMenus = util.deepClone(menus)
for (let menu of cloneMenus) { for (const menu of cloneMenus) {
if (menu.id === id) { if (menu.id === id) {
delete menu.children delete menu.children
return menu return menu
...@@ -112,7 +112,7 @@ util.colorToRgb = (sColor, alpha) => { ...@@ -112,7 +112,7 @@ util.colorToRgb = (sColor, alpha) => {
* 重置form * 重置form
* 用法: util.resetForm.call(this,'formName') * 用法: util.resetForm.call(this,'formName')
*/ */
util.resetForm = function (formName) { util.resetForm = function(formName) {
this.$nextTick(() => { this.$nextTick(() => {
for (var key in this[formName]) { for (var key in this[formName]) {
if (this[formName].hasOwnProperty(key)) { if (this[formName].hasOwnProperty(key)) {
...@@ -127,7 +127,7 @@ util.resetForm = function (formName) { ...@@ -127,7 +127,7 @@ util.resetForm = function (formName) {
* 格式化时间 * 格式化时间
* @param {Array} time * @param {Array} time
*/ */
util.formatTime = function (time) { util.formatTime = function(time) {
return { return {
startTime: time ? time[0] + ' ' + '00:00:00' : '', startTime: time ? time[0] + ' ' + '00:00:00' : '',
endTime: time ? time[1] + ' ' + '23:59:59' : '' endTime: time ? time[1] + ' ' + '23:59:59' : ''
......
...@@ -31,7 +31,7 @@ Vue.use(d2Admin) ...@@ -31,7 +31,7 @@ Vue.use(d2Admin)
Vue.prototype.notice = notice Vue.prototype.notice = notice
const isProd = process.env.NODE_ENV === 'production' const isProd = process.env.NODE_ENV === 'production'
console.log(isProd) // console.log(isProd)
if (!isProd) { if (!isProd) {
Vue.config.devtools = true Vue.config.devtools = true
} }
...@@ -44,6 +44,8 @@ axios({ ...@@ -44,6 +44,8 @@ axios({
method: 'get' method: 'get'
}).then(({ data }) => { }).then(({ data }) => {
baseConfig = data baseConfig = data
// 先本地切换到测试环境接口
// data.axios.baseURL = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
new Vue({ new Vue({
router, router,
store, store,
......
import store from '@/store' import store from '@/store'
import axios from 'axios' import axios from 'axios'
import { import { Message } from 'element-ui'
Message
} from 'element-ui'
import util from '@/libs/util' import util from '@/libs/util'
import router from '@/router' import router from '@/router'
// import { // import {
// LogExternals // LogExternals
// } from '@/common/constants' // } from '@/common/constants'
import { import { baseConfig } from '@/main'
baseConfig
} from '@/main'
import Qs from 'qs' import Qs from 'qs'
axios.defaults.withCredentials = true axios.defaults.withCredentials = true
// const expiresMinute = 60 // 过期时间(分钟) // const expiresMinute = 60 // 过期时间(分钟)
...@@ -48,9 +44,11 @@ function errorLog(error) { ...@@ -48,9 +44,11 @@ function errorLog(error) {
const service = axios.create({ const service = axios.create({
// baseURL: baseURL, // baseURL: baseURL,
timeout: 100000, // 请求超时时间 timeout: 100000, // 请求超时时间
transformRequest: [function(data) { transformRequest: [
return Qs.stringify(data) function(data) {
}] return Qs.stringify(data)
}
]
}) })
// 请求拦截器 // 请求拦截器
...@@ -71,7 +69,38 @@ service.interceptors.request.use( ...@@ -71,7 +69,38 @@ service.interceptors.request.use(
// }) // })
// } // }
// config.url = baseConfig.axios.baseURL + config.url // config.url = baseConfig.axios.baseURL + config.url
config.url = baseConfig.axios.baseURL // console.log(config.data.method.includes('dj.api.common.uploadImg'))
// console.log(config)
// console.log(Object.prototype.toString.call(config.data))
// console.log(config.data.method)
if (process.env.NODE_ENV == 'development') {
// 处理图片开发环境没用的问题
const type = Object.prototype.toString.call(config.data)
const methodList = [
'dj.api.common.uploadImg',
'dj.api.common.ocr.recognition',
'dj.api.smartcarlife.sms.sendSmsCode'
]
if (
type == '[object Object]' &&
methodList.includes(config.data.method)
) {
config.url = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
} else {
config.url = baseConfig.axios.baseURL
}
} else {
config.url = baseConfig.axios.baseURL
}
// if (config.params && config.params.method.includes('common.uploadImg')) {
// config.url = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// } else {
// config.url = baseConfig.axios.baseURL
// }
// config.url = baseConfig.axios.baseURL
// config.timeout = baseConfig.axios.timeout // config.timeout = baseConfig.axios.timeout
resolve(config) resolve(config)
}) })
......
import Vue from 'vue' import Vue from 'vue'
import VueRouter from 'vue-router' import VueRouter from 'vue-router'
// 进度条 // 进度条
import NProgress from 'nprogress' import NProgress from 'nprogress'
import 'nprogress/nprogress.css' import 'nprogress/nprogress.css'
import store from '@/store/index' import store from '@/store/index'
import util from '@/libs/util.js' import util from '@/libs/util.js'
// 路由数据 // 路由数据
import routes from './routes' import routes from './routes'
const originalPush = VueRouter.prototype.push // 解决连续点击路由异常问题 limin const originalPush = VueRouter.prototype.push // 解决连续点击路由异常问题 limin
VueRouter.prototype.push = function push(location) { VueRouter.prototype.push = function push(location, onResolve, onReject) {
return originalPush.call(this, location) && originalPush.call(this, location).catch(err => err) // 解决Uncaught (in promise) 控制台报错问题
} // console.log(onResolve)
Vue.use(VueRouter) // console.log(onReject)
if (onResolve || onReject) {
// 导出路由 在 main.js 里使用 return originalPush.call(this, location, onResolve, onReject)
const router = new VueRouter({ }
routes // return originalPush.call(this, location).catch(err => err)
}) return (
originalPush.call(this, location) &&
const setCurrent = path => { originalPush.call(this, location).catch(err => err)
return new Promise(async resolve => { )
path !== '/login' && await store.dispatch('d2admin/page/currentSet', path) }
resolve() Vue.use(VueRouter)
})
} // 导出路由 在 main.js 里使用
const router = new VueRouter({
/** routes
* 路由拦截 })
* 权限验证
*/ const setCurrent = path => {
router.beforeEach(async(to, from, next) => { return new Promise(async resolve => {
const source = store.state.d2admin.auth.source path !== '/login' && (await store.dispatch('d2admin/page/currentSet', path))
// 确认已经加载多标签页数据 https://github.com/d2-projects/d2-admin/issues/201 resolve()
// await store.dispatch('d2admin/page/isLoaded') })
// 确认已经加载组件尺寸设置 https://github.com/d2-projects/d2-admin/issues/198 }
// await store.dispatch('d2admin/size/isLoaded')
// 设置当前页 下次登录 默认打开此页面 /**
await setCurrent(to.fullPath) * 路由拦截
// 进度条 * 权限验证
NProgress.start() */
// 关闭搜索面板 router.beforeEach(async (to, from, next) => {
store.commit('d2admin/search/set', false) const source = store.state.d2admin.auth.source
if (from.name === null && to.path !== '/login' && !source) { // 页面刷新 动态路由会失效 初始化路由与左侧菜单栏 // 确认已经加载多标签页数据 https://github.com/d2-projects/d2-admin/issues/201
await store.dispatch('d2admin/auth/init') // await store.dispatch('d2admin/page/isLoaded')
await store.dispatch('d2admin/account/load') // 确认已经加载组件尺寸设置 https://github.com/d2-projects/d2-admin/issues/198
next(to.path) // await store.dispatch('d2admin/size/isLoaded')
} else { // 设置当前页 下次登录 默认打开此页面
if (store.state.d2admin.user.info) { // sessionstorage 用户存在继续当前路由 不存在 跳转登录 防止页面关闭还可以打开页面 await setCurrent(to.fullPath)
next() // 进度条
} else { NProgress.start()
if (to.path === '/login') { // 如果是登录页面路径,就直接next() // 关闭搜索面板
next() store.commit('d2admin/search/set', false)
} else { // 不然就跳转到登录; if (from.name === null && to.path !== '/login' && !source) {
await store.dispatch('d2admin/account/logout') // 页面刷新 动态路由会失效 初始化路由与左侧菜单栏
next('/login') await store.dispatch('d2admin/auth/init')
} await store.dispatch('d2admin/account/load')
} next(to.path)
} } else {
}) if (store.state.d2admin.user.info) {
// sessionstorage 用户存在继续当前路由 不存在 跳转登录 防止页面关闭还可以打开页面
router.afterEach(to => { next()
// 进度条 } else {
NProgress.done() if (to.path === '/login') {
// 多页控制 打开新的页面 // 如果是登录页面路径,就直接next()
store.dispatch('d2admin/page/open', to) next()
// 更改标题 } else {
util.title(to.meta.title) // 不然就跳转到登录;
// 保存当前页面meta信息 await store.dispatch('d2admin/account/logout')
store.dispatch('d2admin/auth/setCurrentPageMeta', to.meta) next('/login')
}) }
}
export const ResetRouter = () => new VueRouter({ }
routes })
})
router.afterEach(to => {
export default router // 进度条
NProgress.done()
// 多页控制 打开新的页面
store.dispatch('d2admin/page/open', to)
// 更改标题
util.title(to.meta.title)
// 保存当前页面meta信息
store.dispatch('d2admin/auth/setCurrentPageMeta', to.meta)
})
export const ResetRouter = () =>
new VueRouter({
routes
})
export default router
...@@ -795,6 +795,54 @@ export const resources = { ...@@ -795,6 +795,54 @@ export const resources = {
activePath: '/accountList' activePath: '/accountList'
}, },
component: _import('systemConfig/account/applyAccount') component: _import('systemConfig/account/applyAccount')
},
'90610': {
path: '/accountList_new',
name: 'accountList_new',
meta: {
title: '新虚拟对公账户',
authId: '90610',
parentId: '906',
cache: false
},
auth: [
{
authId: '9061001',
parentId: '90610',
label: '申请虚拟对公账户',
handle: 'handleApply',
ruleObj: {
attr: 'accountStatus',
rule: {
1: '申请虚拟对公账户',
2: '申请虚拟对公账户',
3: '账户详情',
4: '申请虚拟对公账户'
},
disabledStatusList: [2]
},
addRoutePath: [
{
authId: '90611',
name: '申请虚拟对账账户',
parentId: '90610'
}
]
}
],
component: _import('systemConfig/accountNew/accountList')
},
'90611': {
path: '/applyAccount_new',
name: 'applyAccount_new',
meta: {
title: '申请虚拟对账账户',
authId: '90611',
parentId: '90610',
cache: false,
activePath: '/accountList_new'
},
component: _import('systemConfig/accountNew/applyAccount')
} }
// '90602': { // '90602': {
// path: '/serviceStore', // path: '/serviceStore',
......
...@@ -11,7 +11,7 @@ Vue.prototype.$StoreReset = function() { ...@@ -11,7 +11,7 @@ Vue.prototype.$StoreReset = function() {
Vue.use(Vuex) Vue.use(Vuex)
const isProd = process.env.NODE_ENV === 'production' const isProd = process.env.NODE_ENV === 'production'
console.log(isProd) // console.log(isProd)
if (!isProd) { if (!isProd) {
Vue.config.devtools = true Vue.config.devtools = true
} }
......
...@@ -5,17 +5,14 @@ ...@@ -5,17 +5,14 @@
* @Last Modified time: 2020-11-15 10:22:06 * @Last Modified time: 2020-11-15 10:22:06
*/ */
import { import { getChannelType, getProductType } from '@/api/sys.base'
getChannelType, // import {
getProductType // BaseData
} from '@/api/sys.base' // } from '@/common/constants'
import { // const map = {
BaseData // [BaseData.channelType]: getChannelType,
} from '@/common/constants' // [BaseData.productType]: getProductType
const map = { // }
[BaseData.channelType]: getChannelType,
[BaseData.productType]: getProductType
}
export default { export default {
namespaced: true, namespaced: true,
state: { state: {
...@@ -30,31 +27,23 @@ export default { ...@@ -30,31 +27,23 @@ export default {
* 每次登录会强制 初始化 * 每次登录会强制 初始化
* @param {*} param0 * @param {*} param0
*/ */
init({ init({ state, dispatch, commit }) {
state,
dispatch,
commit
}) {
return new Promise(async resolve => { return new Promise(async resolve => {
Promise.all([ Promise.all([getChannelType({}), getProductType({})]).then(
getChannelType({}), async([channelType, productType]) => {
getProductType({}) state.channelType = channelType.slice(0, 2)
]).then(async([channelType, productType]) => { state.productType = productType
state.channelType = channelType.slice(0, 2) await dispatch('save2db', {
state.productType = productType name: '',
await dispatch('save2db', { value: state
name: '', })
value: state resolve(state)
}) }
resolve(state) )
})
}) })
}, },
// 重置 // 重置
clear({ clear({ state, dispatch }) {
state,
dispatch
}) {
return new Promise(async resolve => { return new Promise(async resolve => {
state.channelType = [] state.channelType = []
state.productType = [] state.productType = []
...@@ -72,14 +61,13 @@ export default { ...@@ -72,14 +61,13 @@ export default {
* @param {*} param0 * @param {*} param0
* @param {*} name 名称 state 中的任意一个 强烈建议 使用 @/common/constants/BaseData 中的常量 便于灵活修改 * @param {*} name 名称 state 中的任意一个 强烈建议 使用 @/common/constants/BaseData 中的常量 便于灵活修改
*/ */
get({ get({ state, dispatch }, name) {
state,
dispatch
}, name) {
return new Promise(async resolve => { return new Promise(async resolve => {
let __data = state[name] let __data = state[name]
if (__data) { if (__data) {
__data = await dispatch('getFromdb', `base.${name}`) || await dispatch('getFromAjax', name) __data =
(await dispatch('getFromdb', `base.${name}`)) ||
(await dispatch('getFromAjax', name))
state[name] = __data state[name] = __data
await dispatch('save2db', { await dispatch('save2db', {
name, name,
...@@ -89,13 +77,7 @@ export default { ...@@ -89,13 +77,7 @@ export default {
resolve(__data) resolve(__data)
}) })
}, },
set({ set({ state, dispatch }, { name, value }) {
state,
dispatch
}, {
name,
value
}) {
return new Promise(async resolve => { return new Promise(async resolve => {
state[name] = value state[name] = value
await dispatch('save2db', { await dispatch('save2db', {
...@@ -111,13 +93,11 @@ export default { ...@@ -111,13 +93,11 @@ export default {
* 内存 -> 前端持久化数据库 -> 后台接口 * 内存 -> 前端持久化数据库 -> 后台接口
* @param {*} param0 * @param {*} param0
*/ */
load({ load({ state, dispatch }) {
state,
dispatch
}) {
return new Promise(async resolve => { return new Promise(async resolve => {
if (state.channelType.length === 0) { if (state.channelType.length === 0) {
state = await dispatch('getFromdb', 'base') || await dispatch('init') state =
(await dispatch('getFromdb', 'base')) || (await dispatch('init'))
} }
const { channelType, productType } = state const { channelType, productType } = state
resolve({ channelType, productType }) resolve({ channelType, productType })
...@@ -128,17 +108,19 @@ export default { ...@@ -128,17 +108,19 @@ export default {
* @param {*} param0 * @param {*} param0
* @param {*} path 数据 路径 * @param {*} path 数据 路径
*/ */
getFromdb({ getFromdb({ dispatch }, path) {
dispatch
}, path) {
return new Promise(async resolve => { return new Promise(async resolve => {
const value = await dispatch('d2admin/db/get', { const value = await dispatch(
dbName: 'database', 'd2admin/db/get',
path, {
user: false dbName: 'database',
}, { path,
root: true user: false
}) },
{
root: true
}
)
resolve(value) resolve(value)
}) })
}, },
...@@ -148,21 +130,20 @@ export default { ...@@ -148,21 +130,20 @@ export default {
* @param {*} param0 * @param {*} param0
* @param {*} param1 value 需要持久化的数据 path 需要持久化的数据路径 * @param {*} param1 value 需要持久化的数据 path 需要持久化的数据路径
*/ */
save2db({ save2db({ dispatch }, { value, name }) {
dispatch
}, {
value,
name
}) {
return new Promise(async resolve => { return new Promise(async resolve => {
await dispatch('d2admin/db/set', { await dispatch(
dbName: 'database', 'd2admin/db/set',
path: name ? `base.${name}` : 'base', {
value, dbName: 'database',
user: false path: name ? `base.${name}` : 'base',
}, { value,
root: true user: false
}) },
{
root: true
}
)
resolve(value) resolve(value)
}) })
}, },
...@@ -171,19 +152,13 @@ export default { ...@@ -171,19 +152,13 @@ export default {
* @param {*} param0 * @param {*} param0
* @param {*} name @/common/constants/BaseData 中的常量 * @param {*} name @/common/constants/BaseData 中的常量
*/ */
getFromAjax({ getFromAjax({ state, dispatch, commit }, name) {
state,
dispatch,
commit
}, name) {
return new Promise(async resolve => { return new Promise(async resolve => {
// const value = await map[name]({ [TYPE_NAME]: Object.values(BaseData).find(data => data.KEY === name).TYPE }) // const value = await map[name]({ [TYPE_NAME]: Object.values(BaseData).find(data => data.KEY === name).TYPE })
resolve() resolve()
}) })
}, },
async reset({ async reset({ dispatch }) {
dispatch
}) {
await dispatch('clear') await dispatch('clear')
} }
} }
......
...@@ -11,12 +11,12 @@ const userInfo = JSON.parse(unescape(sessionStorage.getItem(SESSION_NAME))) || { ...@@ -11,12 +11,12 @@ const userInfo = JSON.parse(unescape(sessionStorage.getItem(SESSION_NAME))) || {
const INDEX_PATH = userInfo ? (userInfo.detail.accountType !== 7 ? '/index' : '/onlineAccountList') : '/index' const INDEX_PATH = userInfo ? (userInfo.detail.accountType !== 7 ? '/index' : '/onlineAccountList') : '/index'
const defaultPage = userInfo ? (userInfo.detail.accountType !== 7 ? home : localRoutes['90503']) : home const defaultPage = userInfo ? (userInfo.detail.accountType !== 7 ? home : localRoutes['90503']) : home
defaultPage.fullPath = INDEX_PATH defaultPage.fullPath = INDEX_PATH
// 判定是否需要缓存 // 判定是否需要缓存
const isKeepAlive = data => _.get(data, 'meta.cache', false) const isKeepAlive = data => _.get(data, 'meta.cache', false)
// const setIcon = meta => { // const setIcon = meta => {
// console.log(meta) // console.log(meta)
// return (meta.icon = localRoutes[meta.authId].icon) // return (meta.icon = localRoutes[meta.authId].icon)
// } // }
export default { export default {
namespaced: true, namespaced: true,
...@@ -84,28 +84,28 @@ export default { ...@@ -84,28 +84,28 @@ export default {
// valid 有效列表 1, 1, 0, 1 => 有效, 有效, 失效, 有效 // valid 有效列表 1, 1, 0, 1 => 有效, 有效, 失效, 有效
const valid = [] const valid = []
const __oSource = await dispatch('d2admin/auth/load', null, { const __oSource = await dispatch('d2admin/auth/load', null, {
root: true root: true
}) })
// 处理数据 // 处理数据
state.opened = value state.opened = value
.map(opened => { .map(opened => {
// 忽略首页 // 忽略首页
if (opened.fullPath === INDEX_PATH) { if (opened.fullPath === INDEX_PATH) {
valid.push(1) valid.push(1)
// setIcon(opened.meta) // setIcon(opened.meta)
return opened return opened
} }
// 尝试在所有的支持多标签页的页面里找到 name 匹配的页面 // 尝试在所有的支持多标签页的页面里找到 name 匹配的页面
const find = state.pool.find(item => { const find = state.pool.find(item => {
return ( return (
item.path === opened.path && item.path === opened.path &&
__oSource.some(obj => +obj.authId === +item.meta.authId) __oSource.some(obj => +obj.authId === +item.meta.authId)
) )
}) })
// 记录有效或无效信息 // 记录有效或无效信息
valid.push(find ? 1 : 0) valid.push(find ? 1 : 0)
// 返回合并后的数据 新的覆盖旧的 // 返回合并后的数据 新的覆盖旧的
// 新的数据中一般不会携带 params 和 query, 所以旧的参数会留存 // 新的数据中一般不会携带 params 和 query, 所以旧的参数会留存
return Object.assign({}, opened, find) return Object.assign({}, opened, find)
}) })
.filter((opened, index) => valid[index] === 1) .filter((opened, index) => valid[index] === 1)
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
// state.openedLoaded = true // state.openedLoaded = true
// 根据 opened 数据生成缓存设置 // 根据 opened 数据生成缓存设置
commit('keepAliveRefresh') commit('keepAliveRefresh')
// end // end
resolve() resolve()
}) })
}, },
...@@ -128,16 +128,16 @@ export default { ...@@ -128,16 +128,16 @@ export default {
return new Promise(async resolve => { return new Promise(async resolve => {
// 设置数据 // 设置数据
dispatch( dispatch(
'd2admin/db/set', { 'd2admin/db/set', {
dbName: 'sys', dbName: 'sys',
path: 'page.opened', path: 'page.opened',
value: state.opened, value: state.opened,
user: true user: true
}, { }, {
root: true root: true
} }
) )
// end // end
resolve() resolve()
}) })
}, },
...@@ -163,10 +163,10 @@ export default { ...@@ -163,10 +163,10 @@ export default {
page.params = params || page.params page.params = params || page.params
page.query = query || page.query page.query = query || page.query
page.fullPath = fullPath || page.fullPath page.fullPath = fullPath || page.fullPath
// state.opened.splice(index, 1, page) // state.opened.splice(index, 1, page)
// 持久化 // 持久化
await dispatch('opend2db') await dispatch('opend2db')
// end // end
resolve() resolve()
}) })
}, },
...@@ -192,16 +192,16 @@ export default { ...@@ -192,16 +192,16 @@ export default {
newTag.params = params || newTag.params newTag.params = params || newTag.params
newTag.query = query || newTag.query newTag.query = query || newTag.query
newTag.fullPath = fullPath || newTag.fullPath newTag.fullPath = fullPath || newTag.fullPath
// setIcon(newTag.meta) // setIcon(newTag.meta)
// 添加进当前显示的页面数组 // 添加进当前显示的页面数组
state.opened.push(newTag) state.opened.push(newTag)
// 如果这个页面需要缓存 将其添加到缓存设置 // 如果这个页面需要缓存 将其添加到缓存设置
if (isKeepAlive(newTag)) { if (isKeepAlive(newTag)) {
dispatch('keepAlivePush', tag.name) dispatch('keepAlivePush', tag.name)
} }
// 持久化 // 持久化
await dispatch('opend2db') await dispatch('opend2db')
// end // end
resolve() resolve()
}) })
}, },
...@@ -224,11 +224,11 @@ export default { ...@@ -224,11 +224,11 @@ export default {
return new Promise(async resolve => { return new Promise(async resolve => {
// 已经打开的页面 // 已经打开的页面
const opened = state.opened const opened = state.opened
// 判断此页面是否已经打开 并且记录位置 // 判断此页面是否已经打开 并且记录位置
// let pageOpendIndex = 0 // let pageOpendIndex = 0
const page = opened.find((page, index) => { const page = opened.find((page, index) => {
const same = page.fullPath === fullPath const same = page.fullPath === fullPath
// pageOpendIndex = same ? index : pageOpendIndex // pageOpendIndex = same ? index : pageOpendIndex
return same return same
}) })
if (page) { if (page) {
...@@ -242,7 +242,7 @@ export default { ...@@ -242,7 +242,7 @@ export default {
} else { } else {
// 页面以前没有打开过 // 页面以前没有打开过
const page = state.pool.find(t => t.name === name) const page = state.pool.find(t => t.name === name)
// 如果这里没有找到 page 代表这个路由虽然在框架内 但是不参与标签页显示 // 如果这里没有找到 page 代表这个路由虽然在框架内 但是不参与标签页显示
if (page) { if (page) {
await dispatch('add', { await dispatch('add', {
tag: Object.assign({}, page), tag: Object.assign({}, page),
...@@ -274,7 +274,7 @@ export default { ...@@ -274,7 +274,7 @@ export default {
// 下个新的页面 // 下个新的页面
let newPage = state.opened[0] let newPage = state.opened[0]
const isCurrent = state.current === tagName const isCurrent = state.current === tagName
// 如果关闭的页面就是当前显示的页面 // 如果关闭的页面就是当前显示的页面
if (isCurrent) { if (isCurrent) {
// 去找一个新的页面 // 去找一个新的页面
const len = state.opened.length const len = state.opened.length
...@@ -294,12 +294,12 @@ export default { ...@@ -294,12 +294,12 @@ export default {
if (index >= 0) { if (index >= 0) {
// 如果这个页面是缓存的页面 将其在缓存设置中删除 // 如果这个页面是缓存的页面 将其在缓存设置中删除
dispatch('keepAliveRemove', state.opened[index].name) dispatch('keepAliveRemove', state.opened[index].name)
// 更新数据 删除关闭的页面 // 更新数据 删除关闭的页面
state.opened.splice(index, 1) state.opened.splice(index, 1)
} }
// 持久化 // 持久化
await dispatch('opend2db') await dispatch('opend2db')
// 最后需要判断是否需要跳到首页 // 最后需要判断是否需要跳到首页
if (isCurrent) { if (isCurrent) {
const { const {
name = '', params = {}, query = {} name = '', params = {}, query = {}
...@@ -328,21 +328,21 @@ export default { ...@@ -328,21 +328,21 @@ export default {
} = {}) { } = {}) {
return new Promise(async resolve => { return new Promise(async resolve => {
await dispatch('_do', { await dispatch('_do', {
pageSelect, pageSelect,
call: currentIndex => { call: currentIndex => {
return new Promise(async resolve => { return new Promise(async resolve => {
if (currentIndex > 0) { if (currentIndex > 0) {
// 删除打开的页面 并在缓存设置中删除 // 删除打开的页面 并在缓存设置中删除
await dispatch('_splice', { await dispatch('_splice', {
index: 1, index: 1,
howmany: currentIndex - 1 howmany: currentIndex - 1
}) })
} }
resolve() resolve()
}) })
} }
}) })
// end // end
resolve() resolve()
}) })
}, },
...@@ -390,28 +390,28 @@ export default { ...@@ -390,28 +390,28 @@ export default {
} = {}) { } = {}) {
return new Promise(async resolve => { return new Promise(async resolve => {
await dispatch('_do', { await dispatch('_do', {
pageSelect, pageSelect,
call: currentIndex => { call: currentIndex => {
return new Promise(async resolve => { return new Promise(async resolve => {
// 删除打开的页面数据 并更新缓存设置 // 删除打开的页面数据 并更新缓存设置
if (currentIndex === 0) { if (currentIndex === 0) {
await dispatch('_splice', { await dispatch('_splice', {
index: 1 index: 1
}) })
} else { } else {
await dispatch('_splice', { await dispatch('_splice', {
index: currentIndex + 1 index: currentIndex + 1
}) })
await dispatch('_splice', { await dispatch('_splice', {
index: 1, index: 1,
howmany: currentIndex - 1 howmany: currentIndex - 1
}) })
} }
resolve() resolve()
}) })
} }
}) })
// end // end
resolve() resolve()
}) })
}, },
...@@ -428,11 +428,11 @@ export default { ...@@ -428,11 +428,11 @@ export default {
return new Promise(async resolve => { return new Promise(async resolve => {
// 删除打开的页面 并在缓存设置中删除 // 删除打开的页面 并在缓存设置中删除
await dispatch('closeOpened') await dispatch('closeOpened')
// dispatch('currentSet', _index) // dispatch('currentSet', _index)
// 持久化 // 持久化
// await dispatch('opend2db') // await dispatch('opend2db')
router.replace(INDEX_PATH) router.replace(INDEX_PATH)
// end // end
resolve() resolve()
}) })
}, },
...@@ -458,14 +458,14 @@ export default { ...@@ -458,14 +458,14 @@ export default {
} }
}) })
await call(currentIndex) await call(currentIndex)
// 设置当前的页面 // 设置当前的页面
// dispatch('currentSet', pageAim) // dispatch('currentSet', pageAim)
if (router.app.$route.fullPath !== pageAim) { if (router.app.$route.fullPath !== pageAim) {
router.push(pageAim) router.push(pageAim)
} }
// 持久化 // 持久化
await dispatch('opend2db') await dispatch('opend2db')
// end // end
resolve() resolve()
}) })
}, },
...@@ -508,7 +508,7 @@ export default { ...@@ -508,7 +508,7 @@ export default {
}, fullPath) { }, fullPath) {
return new Promise(async resolve => { return new Promise(async resolve => {
await commit('setCurrent', fullPath) await commit('setCurrent', fullPath)
// 设置数据 // 设置数据
dispatch( dispatch(
'd2admin/db/set', { 'd2admin/db/set', {
dbName: 'sys', dbName: 'sys',
...@@ -562,11 +562,11 @@ export default { ...@@ -562,11 +562,11 @@ export default {
return new Promise(async resolve => { return new Promise(async resolve => {
// 删除打开的页面 并在缓存设置中删除 // 删除打开的页面 并在缓存设置中删除
await dispatch('_splice', { await dispatch('_splice', {
index: 1 index: 1
}) })
// 持久化 // 持久化
await dispatch('opend2db') await dispatch('opend2db')
// end // end
resolve() resolve()
}) })
}, },
...@@ -688,4 +688,4 @@ export default { ...@@ -688,4 +688,4 @@ export default {
}) })
} }
} }
}
\ No newline at end of file \ No newline at end of file
}
import util from '@/libs/util.js' import util from '@/libs/util.js'
export default { export default {
namespaced: true, namespaced: true,
mutations: { mutations: {
/** /**
* @description 显示版本信息 * @description 显示版本信息
* @param {Object} state state * @param {Object} state state
*/ */
versionShow() { versionShow() {
util.log.capsule(process.env.VUE_APP_TITLE, `v${process.env.VUE_APP_VERSION}`) util.log.capsule(
console.log('广联赛讯 http://www.glsx.com.cn') process.env.VUE_APP_TITLE,
} `v${process.env.VUE_APP_VERSION}`
} )
} console.log('广联赛讯 http://www.glsx.com.cn')
}
}
}
...@@ -46,7 +46,7 @@ export default { ...@@ -46,7 +46,7 @@ export default {
load({ state, commit, dispatch }) { load({ state, commit, dispatch }) {
return new Promise(async resolve => { return new Promise(async resolve => {
// store 赋值 // store 赋值
let activeName = await dispatch('d2admin/db/get', { const activeName = await dispatch('d2admin/db/get', {
dbName: 'sys', dbName: 'sys',
path: 'theme.activeName', path: 'theme.activeName',
defaultValue: state.list[0].name, defaultValue: state.list[0].name,
......
...@@ -88,4 +88,4 @@ export default { ...@@ -88,4 +88,4 @@ export default {
dispatch('clear') dispatch('clear')
} }
} }
}
\ No newline at end of file \ No newline at end of file
}
...@@ -19,12 +19,9 @@ ...@@ -19,12 +19,9 @@
<el-radio-button label="2">4S店</el-radio-button> <el-radio-button label="2">4S店</el-radio-button>
<el-radio-button label="7">服务商</el-radio-button> <el-radio-button label="7">服务商</el-radio-button>
<el-radio-button label="6">园区店</el-radio-button> <el-radio-button label="6">园区店</el-radio-button>
<!-- <el-radio-button label="2" <!-- <el-radio-button label="2" @click.native.prevent="clickMerchantType('2')">4S店</el-radio-button>
@click.native.prevent="clickMerchantType('2')">4S店</el-radio-button> <el-radio-button label="7" @click.native.prevent="clickMerchantType('7')">服务商</el-radio-button>
<el-radio-button label="7" <el-radio-button label="6" @click.native.prevent="clickMerchantType('6')">园区店</el-radio-button> -->
@click.native.prevent="clickMerchantType('7')">服务商</el-radio-button>
<el-radio-button label="6"
@click.native.prevent="clickMerchantType('6')">园区店</el-radio-button> -->
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="选择商户:" <el-form-item label="选择商户:"
...@@ -43,7 +40,7 @@ ...@@ -43,7 +40,7 @@
multiple-limit="10" multiple-limit="10"
filterable filterable
style="width:400px"> style="width:400px">
<el-option v-for="(item, index) in baseData.merchantList" <el-option v-for="item in baseData.merchantList"
:key="item.merchantId" :key="item.merchantId"
:label="item.merchantName" :label="item.merchantName"
:value="item.merchantId"></el-option> :value="item.merchantId"></el-option>
...@@ -86,14 +83,16 @@ ...@@ -86,14 +83,16 @@
</template> </template>
<script> <script>
import { BaseData, rangePickerOptions } from '@/common/constants.js' import {
// BaseData,
rangePickerOptions} from '@/common/constants.js'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import * as api from '@api/finance' import * as api from '@api/finance'
import { getMerchantPageSearch } from '@api/publicAccount' import { getMerchantPageSearch } from '@api/publicAccount'
export default { export default {
name: 'downloadAccountDialog', name: 'downloadAccountDialog',
data () { data() {
let validateLonlat = (rule, value, callback) => { const validateLonlat = (rule, value, callback) => {
if (value) { if (value) {
if (!this.infoForm.payEndDate) { if (!this.infoForm.payEndDate) {
callback(new Error('请选择结束日期')) callback(new Error('请选择结束日期'))
...@@ -214,19 +213,19 @@ export default { ...@@ -214,19 +213,19 @@ export default {
// } // }
}, },
created () { created() {
// this.$nextTick(() => { // this.$nextTick(() => {
// this.$refs.accountForm.resetFields(); // this.$refs.accountForm.resetFields();
// }) // })
}, },
components: {}, components: {},
mounted () { mounted() {
this.selectMerchant() this.selectMerchant()
}, },
methods: { methods: {
selectMerchant () { selectMerchant() {
var params = {} var params = {}
params.currentPage = 1 params.currentPage = 1
params.pageSize = 1000 params.pageSize = 1000
...@@ -245,26 +244,26 @@ export default { ...@@ -245,26 +244,26 @@ export default {
}) })
}, },
clickMerchantType (e) { clickMerchantType(e) {
e === this.infoForm.merchantType e === this.infoForm.merchantType
? (this.infoForm.merchantType = '') ? (this.infoForm.merchantType = '')
: (this.infoForm.merchantType = e) : (this.infoForm.merchantType = e)
console.log(this.infoForm.merchantType) console.log(this.infoForm.merchantType)
}, },
changeType () { changeType() {
this.infoForm.merchant = [] this.infoForm.merchant = []
// this.baseData.merchantList = [] // this.baseData.merchantList = []
this.selectMerchant() this.selectMerchant()
}, },
changeStartDate () { changeStartDate() {
if (this.infoForm.payEndDate) { if (this.infoForm.payEndDate) {
this.infoForm.payEndDate = '' this.infoForm.payEndDate = ''
} }
}, },
remoteMethod (query) { remoteMethod(query) {
// if (query !== '') { // if (query !== '') {
this.selectLoading = true this.selectLoading = true
var params = {} var params = {}
...@@ -284,7 +283,7 @@ export default { ...@@ -284,7 +283,7 @@ export default {
// } // }
}, },
handleAddConfirm () { handleAddConfirm() {
// console.log(this.infoForm.remark) // console.log(this.infoForm.remark)
console.log(this.infoForm) console.log(this.infoForm)
// this.handleClose() // this.handleClose()
...@@ -316,7 +315,7 @@ export default { ...@@ -316,7 +315,7 @@ export default {
}) })
}, },
handleClose () { handleClose() {
this.$emit('accountClose', true) this.$emit('accountClose', true)
} }
} }
......
...@@ -423,14 +423,14 @@ import { ...@@ -423,14 +423,14 @@ import {
orderTypeList orderTypeList
} from '@/common/constants.js' } from '@/common/constants.js'
import downloadAccountDialog from './downloadAccountDialog' import downloadAccountDialog from './downloadAccountDialog'
import * as echarts from 'echarts'
export default { export default {
name: 'financeList', name: 'financeList',
components: { components: {
downloadAccountDialog downloadAccountDialog
}, },
data () { data() {
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
isSubOrder: false, isSubOrder: false,
...@@ -575,7 +575,7 @@ export default { ...@@ -575,7 +575,7 @@ export default {
} }
}, },
mounted () { mounted() {
// console.log(document.getElementById('financeChart')) // console.log(document.getElementById('financeChart'))
if (this.userInfo.beSuper) { if (this.userInfo.beSuper) {
getParkStore({}).then(res => { getParkStore({}).then(res => {
...@@ -602,14 +602,14 @@ export default { ...@@ -602,14 +602,14 @@ export default {
this.getTotal() this.getTotal()
}, },
watch: { watch: {
summaryDate (newValue) { summaryDate(newValue) {
this.getSummary() this.getSummary()
} }
}, },
methods: { methods: {
...mapActions({ close: 'd2admin/page/close' }), ...mapActions({ close: 'd2admin/page/close' }),
handleAddClose (isRefresh = false) { }, handleAddClose(isRefresh = false) { },
drawFunnelChart () { drawFunnelChart() {
// console.log(funnelOption) // console.log(funnelOption)
getTransferData({}).then(res => { getTransferData({}).then(res => {
funnelOption.series[0].data[0].tooltipValue = res.totalCustomerNums funnelOption.series[0].data[0].tooltipValue = res.totalCustomerNums
...@@ -621,7 +621,7 @@ export default { ...@@ -621,7 +621,7 @@ export default {
this.financeChart.setOption(funnelOption) this.financeChart.setOption(funnelOption)
}) })
}, },
handleReset () { handleReset() {
this.searchForm = { this.searchForm = {
time: '', time: '',
yqMerchantId: '', yqMerchantId: '',
...@@ -643,7 +643,7 @@ export default { ...@@ -643,7 +643,7 @@ export default {
this.getOptionsList() this.getOptionsList()
}, },
// 导出 // 导出
handleExport () { handleExport() {
var params = this.getParams() var params = this.getParams()
params.pageNum = 1 params.pageNum = 1
api.exportFile(params).then(res => { api.exportFile(params).then(res => {
...@@ -651,12 +651,12 @@ export default { ...@@ -651,12 +651,12 @@ export default {
this.$open(res) this.$open(res)
}) })
}, },
//下载对账单 // 下载对账单
downloadAccount () { downloadAccount() {
this.accountVisible = !this.accountVisible this.accountVisible = !this.accountVisible
}, },
// 查看明细 // 查看明细
handleDetail (data) { handleDetail(data) {
this.close({ tagName: '/financeDetail' }) this.close({ tagName: '/financeDetail' })
this.$router.push({ this.$router.push({
name: 'financeDetail', name: 'financeDetail',
...@@ -666,7 +666,7 @@ export default { ...@@ -666,7 +666,7 @@ export default {
}) })
}, },
getServiceStore (merchantId) { getServiceStore(merchantId) {
getServiceStore({ getServiceStore({
yqMerchantId: merchantId yqMerchantId: merchantId
}).then(res => { }).then(res => {
...@@ -675,14 +675,11 @@ export default { ...@@ -675,14 +675,11 @@ export default {
}) })
}, },
getOptionsList () { getOptionsList() {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select') { if (item.type === 'select') {
if ( if (
this.baseData[item.optionsName].length && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部'
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== '全部'
) { ) {
const temp = {} const temp = {}
temp[this.showFormData[index].optionId] = '' temp[this.showFormData[index].optionId] = ''
...@@ -697,7 +694,7 @@ export default { ...@@ -697,7 +694,7 @@ export default {
} }
}) })
}, },
getSummary () { getSummary() {
api api
.getSummary({ .getSummary({
beginDateStr: this.summaryDate beginDateStr: this.summaryDate
...@@ -715,10 +712,10 @@ export default { ...@@ -715,10 +712,10 @@ export default {
this.summayData = res this.summayData = res
}) })
}, },
keyDowmGetList () { keyDowmGetList() {
this.getList() this.getList()
}, },
getList () { getList() {
var params = this.getParams() var params = this.getParams()
params = { params = {
...this.page, ...this.page,
...@@ -750,7 +747,7 @@ export default { ...@@ -750,7 +747,7 @@ export default {
this.total = res.total this.total = res.total
}) })
}, },
numAddPrefix (item) { numAddPrefix(item) {
const moneyLabels = [ const moneyLabels = [
'goodsCost', 'goodsCost',
'totalPrice', 'totalPrice',
...@@ -777,7 +774,7 @@ export default { ...@@ -777,7 +774,7 @@ export default {
} }
return item return item
}, },
getSelectInputParams () { getSelectInputParams() {
const list = Object.keys(this.searchSelectObj) const list = Object.keys(this.searchSelectObj)
var params = {} var params = {}
list.forEach(i => { list.forEach(i => {
...@@ -786,7 +783,7 @@ export default { ...@@ -786,7 +783,7 @@ export default {
}) })
return params return params
}, },
getParams () { getParams() {
var params = this.getSelectInputParams() var params = this.getSelectInputParams()
if (this.searchForm.yqMerchantId) { if (this.searchForm.yqMerchantId) {
params.yqMerchantId = this.searchForm.yqMerchantId params.yqMerchantId = this.searchForm.yqMerchantId
...@@ -814,29 +811,29 @@ export default { ...@@ -814,29 +811,29 @@ export default {
// } // }
return params return params
}, },
getTotal () { getTotal() {
api.getListTotal(this.getParams()).then(res => { api.getListTotal(this.getParams()).then(res => {
this.totalObj = res this.totalObj = res
}) })
}, },
handleSearch () { handleSearch() {
this.page.pageNum = 1 this.page.pageNum = 1
this.getList() this.getList()
this.getTotal() this.getTotal()
}, },
// 每页条数 // 每页条数
handleSizeChange (value) { handleSizeChange(value) {
this.page.pageSize = value this.page.pageSize = value
this.getList() this.getList()
}, },
// 页码 // 页码
handleCurrentChange (value) { handleCurrentChange(value) {
this.page.pageNum = value this.page.pageNum = value
this.getList() this.getList()
}, },
accountClose (isRefresh) { accountClose(isRefresh) {
this.accountVisible = !this.accountVisible this.accountVisible = !this.accountVisible
// isRefresh && this.handleSearch() // isRefresh && this.handleSearch()
} }
......
<!-- 商品管理 --> <!-- 商品管理 -->
<template> <template>
<d2-container class="commodity"> <d2-container class="commodity">
<div <div class="header"
class="header" slot="header">
slot="header" <d2-search ref="showSearch"
> class="show-search"
<d2-search :searchForm="searchForm"
ref="showSearch" :formData="showFormData">
class="show-search"
:searchForm="searchForm"
:formData="showFormData"
>
<!-- <p> <!-- <p>
<el-input <el-input
size="small" size="small"
...@@ -22,84 +18,60 @@ ...@@ -22,84 +18,60 @@
</p> --> </p> -->
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button <el-button :id="tableParams.btnId"
:id="tableParams.btnId" size="small"
size="small" type="primary">查询</el-button>
type="primary" <el-button size="small"
>查询</el-button> @click="handleReset">重置</el-button>
<el-button
size="small"
@click="handleReset"
>重置</el-button>
</div> </div>
</div> </div>
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table-header> <d2-table-header>
<span slot="left"> <span slot="left">
<auth-button <auth-button category="Button"
category="Button" style="{display: inline-block}"
style="{display: inline-block}" :showBtnIds="['9030201']"></auth-button>
showBtnIds="['9030201']"
></auth-button>
</span> </span>
<auth-button <auth-button category="Button"
category="Button" style="{display: inline-block}"
style="{display: inline-block}" :showBtnIds="['9030202']"></auth-button>
showBtnIds="['9030202']"
></auth-button>
</d2-table-header> </d2-table-header>
<d2-table <d2-table ref="commodityTable"
ref="commodityTable" :hasNum="false"
:hasNum="false" :searchForm="searchForm"
:searchForm="searchForm" :tableParams="tableParams"
:tableParams="tableParams" :getListApi="getListApi"
:getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
:beforeSearchFn="beforeSearchFn" <img slot="img"
> slot-scope="scope"
<img class="pro-img"
slot="img" :src="scope.scope.goodsInfo.thumbUrl" />
slot-scope="scope" <template v-if="Object.keys(scope.scope).includes('upgradeGoodsList')"
class="pro-img" slot="auth-button"
:src="scope.scope.goodsInfo.thumbUrl" slot-scope="scope">
/> <el-button type="text"
<template size="mini"
v-if="Object.keys(scope.scope).includes('upgradeGoodsList')" style="margin-right: 10px;"
slot="auth-button" @click="handleCommodityDetail(scope.scope)">查看</el-button>
slot-scope="scope" <auth-button :data="scope.scope"></auth-button>
>
<el-button
type="text"
size="mini"
style="margin-right: 10px;"
@click="handleCommodityDetail(scope.scope)"
>查看</el-button>
<auth-button
:data="scope.scope"
></auth-button>
</template> </template>
</d2-table> </d2-table>
</div> </div>
<d2-dialog <d2-dialog v-if="detailVisible"
:title="detailData ? detailData.goodsInfo.goodsName : ''" :title="detailData ? detailData.goodsInfo.goodsName : ''"
:className="storeDetail" :className="storeDetail"
:isVisible.sync="detailVisible" :isVisible.sync="detailVisible"
:showClose="showClose" :showClose="showClose"
noCancel="true" noCancel="true"
@closeDialog="handleDetailClose" @closeDialog="handleDetailClose"
@confirmDialog="handleDetailClose" @confirmDialog="handleDetailClose">
> <store-detail :detailData="detailData"></store-detail>
<store-detail
v-if="detailVisible"
:detailData="detailData"
></store-detail>
</d2-dialog> </d2-dialog>
<!-- 查看面板 --> <!-- 查看面板 -->
<drawer-detail <drawer-detail v-if="drawerDetailVisible"
v-if="drawerDetailVisible" :drawerDetailVisible="drawerDetailVisible"
:drawerDetailVisible="drawerDetailVisible" :commodityInfoId="commodityDetailInfoId"
:commodityInfoId="commodityDetailInfoId" @handleDrawerClose="handleDrawerClose"></drawer-detail>
@handleDrawerClose="handleDrawerClose"
></drawer-detail>
</d2-container> </d2-container>
</template> </template>
......
<!-- 发券宝 --> <!-- 发券宝 -->
<template> <template>
<d2-container class="coupons"> <d2-container class="coupons">
<div <div class="header"
class="header" slot="header">
slot="header" <d2-search ref="showSearch"
> class="show-search"
<d2-search :searchForm="parentSearchForm"
ref="showSearch" :formData="showFormData">
class="show-search"
:searchForm="parentSearchForm"
:formData="showFormData"
>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button <el-button size="small"
size="small" type="primary"
type="primary" @click="handleSearch">查询</el-button>
@click="handleSearch" <el-button size="small"
>查询</el-button> @click="handleReset">重置</el-button>
<el-button
size="small"
@click="handleReset"
>重置</el-button>
</div> </div>
</div> </div>
<div <div class="d2-container-content"
class="d2-container-content" style="position: positive;">
style="position: positive;"
>
<span style="position: absolute; right: 41px; top: 42px; z-index: 999;"> <span style="position: absolute; right: 41px; top: 42px; z-index: 999;">
<auth-button <auth-button :showBtnIds="activeName === 'storeList' ? ['9030601', '9030605'] : ['9030605']"
:showBtnIds="activeName === 'storeList' ? ['9030601', '9030605'] : ['9030605']" category="Button"></auth-button>
category="Button"
></auth-button>
</span> </span>
<el-tabs <el-tabs v-model="activeName"
v-model="activeName" type="card"
type="card" @tab-click="handleSearch">
@tab-click="handleSearch" <el-tab-pane label="店面列表"
> name="storeList">
<el-tab-pane <store-list ref="storeList"
label="店面列表" :parentSearchForm="parentSearchForm"></store-list>
name="storeList"
>
<store-list
ref="storeList"
:parentSearchForm="parentSearchForm"
></store-list>
</el-tab-pane> </el-tab-pane>
<el-tab-pane <el-tab-pane label="领用明细"
label="领用明细" name="couponsDetail">
name="couponsDetail" <coupons-detail ref="couponsDetail"
> :parentSearchForm="parentSearchForm"></coupons-detail>
<coupons-detail
ref="couponsDetail"
:parentSearchForm="parentSearchForm"
></coupons-detail>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
<edit-coupons-dialog <edit-coupons-dialog :couponsVisible="couponsVisible"
:couponsVisible="couponsVisible" @couponClose="couponClose"></edit-coupons-dialog>
@couponClose="couponClose"
></edit-coupons-dialog>
</d2-container> </d2-container>
</template> </template>
......
<!-- 产品管理 --> <!-- 产品管理 -->
<template> <template>
<d2-container class="product"> <d2-container class="product">
<div <div class="header"
class="header" slot="header">
slot="header" <d2-search ref="showSearch"
> class="show-search"
<d2-search :searchForm="searchForm"
ref="showSearch" :formData="showFormData">
class="show-search"
:searchForm="searchForm"
:formData="showFormData"
>
<!-- <p> <!-- <p>
<el-input <el-input
size="small" size="small"
...@@ -22,50 +18,36 @@ ...@@ -22,50 +18,36 @@
</p> --> </p> -->
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button <el-button :id="tableParams.btnId"
:id="tableParams.btnId" size="small"
size="small" type="primary">查询</el-button>
type="primary" <el-button size="small"
>查询</el-button> @click="handleReset">重置</el-button>
<el-button
size="small"
@click="handleReset"
>重置</el-button>
</div> </div>
</div> </div>
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table-header> <d2-table-header>
<span slot="left"> <span slot="left">
<auth-button <auth-button category="Button"
category="Button" style="{display: inline-block}"
style="{display: inline-block}" showBtnIds="['9030101']"></auth-button>
showBtnIds="['9030101']"
></auth-button>
</span> </span>
<auth-button <auth-button category="Button"
category="Button" style="{display: inline-block}"
style="{display: inline-block}" showBtnIds="['9030103']"></auth-button>
showBtnIds="['9030103']"
></auth-button>
</d2-table-header> </d2-table-header>
<d2-table <d2-table ref="productTable"
ref="productTable" :searchForm="searchForm"
:searchForm="searchForm" :tableParams="tableParams"
:tableParams="tableParams" :getListApi="getListApi"
:getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
:beforeSearchFn="beforeSearchFn" <img slot="img"
> slot-scope="scope"
<img class="pro-img"
slot="img" :src="scope.scope.thumbUrl" />
slot-scope="scope" <auth-button slot="auth-button"
class="pro-img" slot-scope="scope"
:src="scope.scope.thumbUrl" :data="scope.scope"></auth-button>
/>
<auth-button
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
></auth-button>
</d2-table> </d2-table>
</div> </div>
</d2-container> </d2-container>
......
...@@ -3,7 +3,7 @@ const customTransOption = { ...@@ -3,7 +3,7 @@ const customTransOption = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
} }
}, },
legend: { legend: {
...@@ -17,7 +17,7 @@ const customTransOption = { ...@@ -17,7 +17,7 @@ const customTransOption = {
containLabel: true containLabel: true
}, },
toolbox: { toolbox: {
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
...@@ -26,15 +26,15 @@ const customTransOption = { ...@@ -26,15 +26,15 @@ const customTransOption = {
axisLine: { axisLine: {
show: false, show: false,
lineStyle: { lineStyle: {
} }
}, },
axisTick: { axisTick: {
show: false show: false
}, },
axisLabel: { axisLabel: {
//interval: 0, // interval: 0,
//rotate: 45 // rotate: 45
}, },
offset: 10 offset: 10
}, },
...@@ -53,17 +53,17 @@ const customTransOption = { ...@@ -53,17 +53,17 @@ const customTransOption = {
{ {
name: '客户到店', name: '客户到店',
type: 'line', type: 'line',
//stack: '总量', // stack: '总量',
itemStyle: { itemStyle: {
color: '#0947C6' color: '#0947C6'
}, },
data: [120, 132, 101, 134, 90, 230, 210], data: [120, 132, 101, 134, 90, 230, 210]
}, },
{ {
name: '客户转化', name: '客户转化',
type: 'line', type: 'line',
//stack: '总量', // stack: '总量',
itemStyle: { itemStyle: {
color: '#2B9AFF' color: '#2B9AFF'
}, },
......
export function debounce(func, wait, immediate) { export function debounce(func, wait, immediate) {
let timeout, args, context, timestamp, result; let timeout, args, context, timestamp, result
const later = function () { const later = function() {
// 据上一次触发时间间隔 // 据上一次触发时间间隔
const last = +new Date() - timestamp; const last = +new Date() - timestamp
// 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
if (last < wait && last > 0) { if (last < wait && last > 0) {
timeout = setTimeout(later, wait - last); timeout = setTimeout(later, wait - last)
} else { } else {
timeout = null; timeout = null
// 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用 // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
if (!immediate) { if (!immediate) {
result = func.apply(context, args); result = func.apply(context, args)
if (!timeout) context = args = null; if (!timeout) context = args = null
} }
} }
}; }
return function (...args) { return function(...args) {
context = this; context = this
timestamp = +new Date(); timestamp = +new Date()
const callNow = immediate && !timeout; const callNow = immediate && !timeout
// 如果延时不存在,重新设定延时 // 如果延时不存在,重新设定延时
if (!timeout) timeout = setTimeout(later, wait); if (!timeout) timeout = setTimeout(later, wait)
if (callNow) { if (callNow) {
result = func.apply(context, args); result = func.apply(context, args)
context = args = null; context = args = null
} }
return result;
};
}
\ No newline at end of file \ No newline at end of file
return result
}
}
...@@ -2,7 +2,7 @@ const incomeFlowOption = { ...@@ -2,7 +2,7 @@ const incomeFlowOption = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
} }
}, },
/* legend: { /* legend: {
...@@ -16,7 +16,7 @@ const incomeFlowOption = { ...@@ -16,7 +16,7 @@ const incomeFlowOption = {
containLabel: true containLabel: true
}, },
toolbox: { toolbox: {
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
...@@ -25,15 +25,15 @@ const incomeFlowOption = { ...@@ -25,15 +25,15 @@ const incomeFlowOption = {
axisLine: { axisLine: {
show: false, show: false,
lineStyle: { lineStyle: {
} }
}, },
axisTick: { axisTick: {
show: false show: false
}, },
axisLabel: { axisLabel: {
//interval: 0, // interval: 0,
//rotate: 45 // rotate: 45
}, },
offset: 10 offset: 10
}, },
...@@ -57,8 +57,8 @@ const incomeFlowOption = { ...@@ -57,8 +57,8 @@ const incomeFlowOption = {
color: '#0947C6' color: '#0947C6'
}, },
data: [120, 132, 101, 134, 90, 230, 210], data: [120, 132, 101, 134, 90, 230, 210],
smooth: true, smooth: true
}, }
/* { /* {
name: '支出', name: '支出',
type: 'line', type: 'line',
...@@ -72,4 +72,4 @@ const incomeFlowOption = { ...@@ -72,4 +72,4 @@ const incomeFlowOption = {
] ]
} }
export default incomeFlowOption
\ No newline at end of file \ No newline at end of file
export default incomeFlowOption
const incomeProductOption = { const incomeProductOption = {
color: ['rgba(9,71,198,0.8)', 'rgba(255,178,25,1)','rgba(255,178,25,0.8)','rgba(0,157,255,1)', 'rgba(0,157,255,0.8)', 'rgba(0,157,255,0.6)', 'rgba(0,228,115,1)','rgba(0,228,115,0.8)'], color: [
'rgba(9,71,198,0.8)',
'rgba(255,178,25,1)',
'rgba(255,178,25,0.8)',
'rgba(0,157,255,1)',
'rgba(0,157,255,0.8)',
'rgba(0,157,255,0.6)',
'rgba(0,228,115,1)',
'rgba(0,228,115,0.8)'
],
title: { title: {
text: '累计收入\n555555元', text: '累计收入\n555555元',
top: '50%', top: '50%',
...@@ -14,8 +23,10 @@ const incomeProductOption = { ...@@ -14,8 +23,10 @@ const incomeProductOption = {
}, },
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
formatter: (params) => { formatter: params => {
return `${insertTooltipBr(params.name)} : ${params.value}(${params.percent}%)` return `${insertTooltipBr(params.name)} : ${params.value}(${
params.percent
}%)`
}, },
position: [10, 10] position: [10, 10]
}, },
...@@ -23,12 +34,12 @@ const incomeProductOption = { ...@@ -23,12 +34,12 @@ const incomeProductOption = {
{ {
name: '毛利', name: '毛利',
type: 'pie', type: 'pie',
minAngle: 5, minAngle: 5,
avoidLabelOverlap: true, avoidLabelOverlap: true,
radius: ['40%', '60%'], radius: ['40%', '60%'],
center: ['50%', '60%'], center: ['50%', '60%'],
label:{ label: {
show: false, show: false
/* align: 'left', /* align: 'left',
normal:{ normal:{
formatter(v) { formatter(v) {
...@@ -57,24 +68,33 @@ const incomeProductOption = { ...@@ -57,24 +68,33 @@ const incomeProductOption = {
} }
] ]
} }
function insertBr(text) { // function insertBr(text) {
if(text.length <= 8){ // if (text.length <= 8) {
return text; // return text
}else if(text.length > 8 && text.length <= 16){ // } else if (text.length > 8 && text.length <= 16) {
return text = `${text.slice(0,8)}\n${text.slice(8)}\n` // return (text = `${text.slice(0, 8)}\n${text.slice(8)}\n`)
}else if(text.length > 16 && text.length <= 24){ // } else if (text.length > 16 && text.length <= 24) {
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16)}\n` // return (text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(
}else if(text.length > 24 && text.length <= 30){ // 16
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16,24)}\n${text.slice(24)}\n` // )}\n`)
}else if(text.length > 30){ // } else if (text.length > 24 && text.length <= 30) {
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16,24)}\n${text.slice(24,30)}\n${text.slice(30)}\n` // return (text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(
} // 16,
} // 24
// )}\n${text.slice(24)}\n`)
// } else if (text.length > 30) {
// return (text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(
// 16,
// 24
// )}\n${text.slice(24, 30)}\n${text.slice(30)}\n`)
// }
// }
function insertTooltipBr(text) { function insertTooltipBr(text) {
if(text.length <= 30){ if (text.length <= 30) {
return text; return text
}else if(text.length > 30){ } else if (text.length > 30) {
return text = `${text.slice(0,30)}</br>${text.slice(30)}` text = `${text.slice(0, 30)}</br>${text.slice(30)}`
return text
} }
} }
export default incomeProductOption export default incomeProductOption
const storeFlowOption = { const storeFlowOption = {
color: ['rgba(9,71,198,1)', 'rgba(9,71,198,0.8)', 'rgba(9,71,198,0.6)','rgba(9,71,198,0.4)','rgba(9,71,198,0.3)'], color: [
'rgba(9,71,198,1)',
'rgba(9,71,198,0.8)',
'rgba(9,71,198,0.6)',
'rgba(9,71,198,0.4)',
'rgba(9,71,198,0.3)'
],
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
//formatter: '{a} <br/>{b} : {c} ({d}%)', // formatter: '{a} <br/>{b} : {c} ({d}%)',
formatter: (params) => { formatter: params => {
return `${insertTooltipBr(params.name)} : ${params.value}(${params.percent}%)` return `${insertTooltipBr(params.name)} : ${params.value}(${
params.percent
}%)`
}, },
position: [10, 10] position: [10, 10]
}, },
...@@ -13,9 +20,9 @@ const storeFlowOption = { ...@@ -13,9 +20,9 @@ const storeFlowOption = {
orient: 'vertical', orient: 'vertical',
right: 0, right: 0,
data: [], data: [],
formatter: function (name) { formatter: function(name) {
if(name.length>8) { if (name.length > 8) {
return name.substr(0,8)+'...' return name.substr(0, 8) + '...'
} }
return name return name
}, },
...@@ -30,12 +37,12 @@ const storeFlowOption = { ...@@ -30,12 +37,12 @@ const storeFlowOption = {
{ {
name: '4s门店客流量', name: '4s门店客流量',
type: 'pie', type: 'pie',
minAngle: 5, minAngle: 5,
avoidLabelOverlap: true, avoidLabelOverlap: true,
radius: '50%', radius: '50%',
center: ['40%', '65%'], center: ['40%', '65%'],
label:{ label: {
show:false, show: false
/* align: 'left', /* align: 'left',
normal:{ normal:{
formatter(v) { formatter(v) {
...@@ -48,23 +55,21 @@ const storeFlowOption = { ...@@ -48,23 +55,21 @@ const storeFlowOption = {
} */ } */
}, },
data: [ data: [
{ {
value: 335, value: 335,
name: '直接访问', name: '直接访问'
}, },
{ {
value: 335, value: 335,
name: '直接访问', name: '直接访问'
}, },
{ {
value: 335, value: 335,
name: '直接访问', name: '直接访问',
itemStyle: { itemStyle: {
color: 'rgba(9,71,198,0.6)' color: 'rgba(9,71,198,0.6)'
}, }
}, }
], ],
emphasis: { emphasis: {
itemStyle: { itemStyle: {
...@@ -77,25 +82,34 @@ const storeFlowOption = { ...@@ -77,25 +82,34 @@ const storeFlowOption = {
] ]
} }
function insertBr(text) { // function insertBr(text) {
if(text.length <= 8){ // if (text.length <= 8) {
return text; // return text
}else if(text.length > 8 && text.length <= 16){ // } else if (text.length > 8 && text.length <= 16) {
return text = `${text.slice(0,8)}\n${text.slice(8)}\n` // return (text = `${text.slice(0, 8)}\n${text.slice(8)}\n`)
}else if(text.length > 16 && text.length <= 24){ // } else if (text.length > 16 && text.length <= 24) {
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16)}\n` // return (text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(
}else if(text.length > 24 && text.length <= 30){ // 16
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16,24)}\n${text.slice(24)}\n` // )}\n`)
}else if(text.length > 30){ // } else if (text.length > 24 && text.length <= 30) {
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16,24)}\n${text.slice(24,30)}\n${text.slice(30)}\n` // return (text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(
} // 16,
} // 24
// )}\n${text.slice(24)}\n`)
// } else if (text.length > 30) {
// return (text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(
// 16,
// 24
// )}\n${text.slice(24, 30)}\n${text.slice(30)}\n`)
// }
// }
function insertTooltipBr(text) { function insertTooltipBr(text) {
if(text.length <= 30){ if (text.length <= 30) {
return text; return text
}else if(text.length > 30){ } else if (text.length > 30) {
return text = `${text.slice(0,30)}</br>${text.slice(30)}` text = `${text.slice(0, 30)}</br>${text.slice(30)}`
return text
} }
} }
......
...@@ -151,7 +151,7 @@ import { mapActions } from 'vuex' ...@@ -151,7 +151,7 @@ import { mapActions } from 'vuex'
// import { getOrderDetail } from '@api/order' // import { getOrderDetail } from '@api/order'
export default { export default {
name: 'orderDetail', name: 'orderDetail',
data () { data() {
return { return {
imgVisible: false, imgVisible: false,
detail: { detail: {
...@@ -180,7 +180,8 @@ export default { ...@@ -180,7 +180,8 @@ export default {
1: '预录员', 1: '预录员',
2: '转化员', 2: '转化员',
3: '转化员', 3: '转化员',
4: '用户' 4: '用户',
5: '管理员'
}, },
constructioOpts: { constructioOpts: {
'Y': '已施工', 'Y': '已施工',
...@@ -195,7 +196,7 @@ export default { ...@@ -195,7 +196,7 @@ export default {
} }
}, },
mounted () { mounted() {
this.detail = this.$route.params.detail this.detail = this.$route.params.detail
// console.log(this.detail) // console.log(this.detail)
}, },
...@@ -214,10 +215,10 @@ export default { ...@@ -214,10 +215,10 @@ export default {
// getTotalNums() { // getTotalNums() {
// return this.detail.subOrderList.reduce((prev, item) => prev + item.nums, 0) // return this.detail.subOrderList.reduce((prev, item) => prev + item.nums, 0)
// }, // },
handleEnlargeImg () { handleEnlargeImg() {
this.imgVisible = !this.imgVisible this.imgVisible = !this.imgVisible
}, },
getSummaries (param) { getSummaries(param) {
const { columns } = param const { columns } = param
const sums = [] const sums = []
columns.forEach((column, index) => { columns.forEach((column, index) => {
...@@ -241,7 +242,7 @@ export default { ...@@ -241,7 +242,7 @@ export default {
return sums return sums
}, },
handleClose () { handleClose() {
this.close({ tagName: '/orderList' }) this.close({ tagName: '/orderList' })
this.$router.push({ name: 'orderList' }) this.$router.push({ name: 'orderList' })
this.close({ tagName: '/orderDetail' }) this.close({ tagName: '/orderDetail' })
......
...@@ -163,7 +163,7 @@ import { mapActions } from 'vuex' ...@@ -163,7 +163,7 @@ import { mapActions } from 'vuex'
import { getServiceStore, getParkStore } from '@api/editCustomer' import { getServiceStore, getParkStore } from '@api/editCustomer'
export default { export default {
name: 'orderList', name: 'orderList',
data () { data() {
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
statusOpts: { statusOpts: {
...@@ -173,8 +173,8 @@ export default { ...@@ -173,8 +173,8 @@ export default {
4: '已支付', 4: '已支付',
// 5: '已退款', // 5: '已退款',
6: '已评价', 6: '已评价',
9: '已撤销' 9: '已撤销',
10: '已关闭'
}, },
upgradeOpts: { upgradeOpts: {
'Y': '已升级', 'Y': '已升级',
...@@ -295,7 +295,7 @@ export default { ...@@ -295,7 +295,7 @@ export default {
}, },
{ {
confId: 10, confId: 10,
confLabel: 'test' confLabel: '已关闭'
} }
], ],
upgradeList: [{ upgradeList: [{
...@@ -332,7 +332,7 @@ export default { ...@@ -332,7 +332,7 @@ export default {
} }
}, },
mounted () { mounted() {
if (this.userInfo.beSuper) { if (this.userInfo.beSuper) {
getParkStore({}).then(res => { getParkStore({}).then(res => {
res.forEach(item => { res.forEach(item => {
...@@ -351,7 +351,7 @@ export default { ...@@ -351,7 +351,7 @@ export default {
methods: { methods: {
...mapActions({ close: 'd2admin/page/close' }), ...mapActions({ close: 'd2admin/page/close' }),
handleReset () { handleReset() {
this.searchForm = { this.searchForm = {
status: '', status: '',
upgradeFinishFlag: '', upgradeFinishFlag: '',
...@@ -364,7 +364,7 @@ export default { ...@@ -364,7 +364,7 @@ export default {
this.baseData.storeIdList = [] this.baseData.storeIdList = []
this.getOptionsList() this.getOptionsList()
}, },
getServiceStore (merchantId) { getServiceStore(merchantId) {
getServiceStore({ getServiceStore({
yqMerchantId: merchantId yqMerchantId: merchantId
}).then(res => { }).then(res => {
...@@ -372,7 +372,7 @@ export default { ...@@ -372,7 +372,7 @@ export default {
this.getOptionsList() this.getOptionsList()
}) })
}, },
getOptionsList () { getOptionsList() {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select') { if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') { if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
...@@ -385,7 +385,7 @@ export default { ...@@ -385,7 +385,7 @@ export default {
} }
}) })
}, },
getParams () { getParams() {
const params = _.cloneDeep(this.searchForm) const params = _.cloneDeep(this.searchForm)
const form = this.searchForm const form = this.searchForm
...@@ -396,10 +396,10 @@ export default { ...@@ -396,10 +396,10 @@ export default {
return params return params
}, },
keyDowmGetList () { keyDowmGetList() {
this.getList() this.getList()
}, },
getList () { getList() {
var params = this.getParams() var params = this.getParams()
params = { params = {
...this.page, ...this.page,
...@@ -413,7 +413,7 @@ export default { ...@@ -413,7 +413,7 @@ export default {
this.total = res.total this.total = res.total
}) })
}, },
getOrderCount () { getOrderCount() {
var params = this.getParams() var params = this.getParams()
params = { params = {
...params ...params
...@@ -422,13 +422,13 @@ export default { ...@@ -422,13 +422,13 @@ export default {
this.totalCount = res.totalPriceCount this.totalCount = res.totalPriceCount
}) })
}, },
handleSearch () { handleSearch() {
this.page.pageNum = 1 this.page.pageNum = 1
this.getOrderCount() this.getOrderCount()
this.getList() this.getList()
}, },
// 导出 // 导出
handleExport () { handleExport() {
var params = this.getParams() var params = this.getParams()
params.pageNum = 1 params.pageNum = 1
exportFile(params).then(res => { exportFile(params).then(res => {
...@@ -436,7 +436,7 @@ export default { ...@@ -436,7 +436,7 @@ export default {
}) })
}, },
// 查看详情 // 查看详情
handleDetail (data) { handleDetail(data) {
// console.log(data.row) // console.log(data.row)
this.close({ tagName: '/orderDetail' }) this.close({ tagName: '/orderDetail' })
this.$router.push({ this.$router.push({
...@@ -447,13 +447,13 @@ export default { ...@@ -447,13 +447,13 @@ export default {
}) })
}, },
// 每页条数 // 每页条数
handleSizeChange (value) { handleSizeChange(value) {
this.page.pageSize = value this.page.pageSize = value
this.getList() this.getList()
}, },
// 页码 // 页码
handleCurrentChange (value) { handleCurrentChange(value) {
this.page.pageNum = value this.page.pageNum = value
this.getList() this.getList()
} }
......
...@@ -244,11 +244,11 @@ export default { ...@@ -244,11 +244,11 @@ export default {
// 注意 这里的演示没有传验证码 // 注意 这里的演示没有传验证码
// 具体需要传递的数据请自行修改代码 // 具体需要传递的数据请自行修改代码
this.login(_p) this.login(_p)
.then(async ({ isMutiAccount, accountInfo, userInfo }) => { .then(async({ isMutiAccount, accountInfo, userInfo }) => {
if(isMutiAccount) { if (isMutiAccount) {
this.isMutiAccount = isMutiAccount this.isMutiAccount = isMutiAccount
this.accountInfo = accountInfo this.accountInfo = accountInfo
this.loginToken = accountInfo.loginToken this.loginToken = accountInfo.loginToken
} else { } else {
const _current = userInfo.detail.accountType !== 7 ? await this.current() : '/onlineAccountList' const _current = userInfo.detail.accountType !== 7 ? await this.current() : '/onlineAccountList'
await this.initBaseData() await this.initBaseData()
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
import { getDetailApi } from '@api/publicAccount' import { getDetailApi } from '@api/publicAccount'
export default { export default {
name: 'accountDetail', name: 'accountDetail',
data () { data() {
return { return {
detailForm: {}, detailForm: {},
// 图片对于字段 // 图片对于字段
...@@ -200,7 +200,7 @@ export default { ...@@ -200,7 +200,7 @@ export default {
}, },
watch: { watch: {
accountDetailVisible (newVal) { accountDetailVisible(newVal) {
if (newVal) { if (newVal) {
this.merchantId = this.merchantRow.merchantId this.merchantId = this.merchantRow.merchantId
this.getDetail() this.getDetail()
...@@ -208,13 +208,13 @@ export default { ...@@ -208,13 +208,13 @@ export default {
} }
}, },
mounted () { mounted() {
this.merchantId = this.merchantRow.merchantId this.merchantId = this.merchantRow.merchantId
this.getDetail() this.getDetail()
}, },
methods: { methods: {
getDetail () { getDetail() {
getDetailApi({ merchantId: this.merchantId }).then(res => { getDetailApi({ merchantId: this.merchantId }).then(res => {
// console.log(res) // console.log(res)
this.currentPage = res.yseMerchantInfo ? res.yseMerchantInfo.custType : 'O' this.currentPage = res.yseMerchantInfo ? res.yseMerchantInfo.custType : 'O'
......
...@@ -159,7 +159,7 @@ import { uploadImg, imgRecognitionApi, getBankListApi, getYseBankListApi, sendTo ...@@ -159,7 +159,7 @@ import { uploadImg, imgRecognitionApi, getBankListApi, getYseBankListApi, sendTo
import { registerYseMerchantApi, draftYseMerchantApi, getDetailApi } from '@api/publicAccount' import { registerYseMerchantApi, draftYseMerchantApi, getDetailApi } from '@api/publicAccount'
export default { export default {
name: 'applyAccount', name: 'applyAccount',
data () { data() {
var checkPhoneObj = { var checkPhoneObj = {
required: true, required: true,
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
...@@ -641,7 +641,7 @@ export default { ...@@ -641,7 +641,7 @@ export default {
glUploadImg glUploadImg
}, },
mounted () { mounted() {
if (this.$route.params.merchantId) { if (this.$route.params.merchantId) {
this.targetAccount = this.$route.params this.targetAccount = this.$route.params
sessionStorage.setItem(this.sessionName, JSON.stringify(this.$route.params)) sessionStorage.setItem(this.sessionName, JSON.stringify(this.$route.params))
...@@ -681,7 +681,7 @@ export default { ...@@ -681,7 +681,7 @@ export default {
close: 'd2admin/page/close' close: 'd2admin/page/close'
}), }),
// 获取详情,数据恢复 // 获取详情,数据恢复
getDetail () { getDetail() {
getDetailApi({ merchantId: this.targetAccount.merchantId }).then(res => { getDetailApi({ merchantId: this.targetAccount.merchantId }).then(res => {
// console.log(res) // console.log(res)
if (res.yseMerchantInfo) { if (res.yseMerchantInfo) {
...@@ -750,19 +750,19 @@ export default { ...@@ -750,19 +750,19 @@ export default {
}) })
}, },
// 开户行 // 开户行
getBankList () { getBankList() {
getBankListApi({}).then(res => { getBankListApi({}).then(res => {
this.formList[this.findFormIdx('bankType')].optionList = res this.formList[this.findFormIdx('bankType')].optionList = res
}) })
}, },
// 支行 // 支行
getYseBankList () { }, getYseBankList() { },
// 找到在formList的位置,通过name来匹配 // 找到在formList的位置,通过name来匹配
findFormIdx (name) { findFormIdx(name) {
return this.formList.findIndex(item => item.name === name) return this.formList.findIndex(item => item.name === name)
}, },
// 切换radio后,将obj里面的图片写入editForm // 切换radio后,将obj里面的图片写入editForm
afterChangePic () { afterChangePic() {
// this[this.typeToForm[this.custType]] // this[this.typeToForm[this.custType]]
var picKeys = Object.keys(this.picObj) var picKeys = Object.keys(this.picObj)
picKeys.forEach(item => { picKeys.forEach(item => {
...@@ -776,7 +776,7 @@ export default { ...@@ -776,7 +776,7 @@ export default {
// console.log(this.picObj) // console.log(this.picObj)
}, },
// 切换radio/编辑,开户行恢复opt数据 // 切换radio/编辑,开户行恢复opt数据
recoveryOpenAccBank () { recoveryOpenAccBank() {
this.formList[this.findFormIdx('openAccBankType')].optionList = this.editForm.openAccBankType ? [{ branchBankType: this.editForm.openAccBankType, branchBankName: this.editForm.openAccBankName }] : [] this.formList[this.findFormIdx('openAccBankType')].optionList = this.editForm.openAccBankType ? [{ branchBankType: this.editForm.openAccBankType, branchBankName: this.editForm.openAccBankName }] : []
}, },
// 上传/删除图片后,将图片的值写入Obj中 // 上传/删除图片后,将图片的值写入Obj中
...@@ -785,7 +785,7 @@ export default { ...@@ -785,7 +785,7 @@ export default {
// ? (this.editForm.papers[this.picObj[attrName].attrName] = this.picObj[attrName].url) // ? (this.editForm.papers[this.picObj[attrName].attrName] = this.picObj[attrName].url)
// : delete this.editForm.papers[this.picObj[attrName].attrName] // : delete this.editForm.papers[this.picObj[attrName].attrName]
// }, // },
handleImgChange ({ file, attrName, targetItem }) { handleImgChange({ file, attrName, targetItem }) {
var hasFnList = ['idCard', 'idCardBack', 'bankCard', 'businessLicense'] var hasFnList = ['idCard', 'idCardBack', 'bankCard', 'businessLicense']
var reader = new FileReader() var reader = new FileReader()
var fileInfo = file.raw var fileInfo = file.raw
...@@ -804,18 +804,18 @@ export default { ...@@ -804,18 +804,18 @@ export default {
}) })
} }
}, },
handleImgRemove ({ attrName, targetItem }) { handleImgRemove({ attrName, targetItem }) {
this.picObj[attrName].url = '' this.picObj[attrName].url = ''
delete this.editForm.papers[this.picObj[attrName].attrName] delete this.editForm.papers[this.picObj[attrName].attrName]
// this.writeToEditForm(attrName, false) // this.writeToEditForm(attrName, false)
// this.$refs.editFormRef.$refs.editFrom.validateField(targetItem.name) // this.$refs.editFormRef.$refs.editFrom.validateField(targetItem.name)
}, },
handlePreview (file, attrName) { handlePreview(file, attrName) {
// console.log(file) // console.log(file)
// console.log(attrName) // console.log(attrName)
}, },
// 验证码 // 验证码
handleSend () { handleSend() {
sendToSmsCodeApi({ phone: this.editForm.operPhone }).then((res) => { sendToSmsCodeApi({ phone: this.editForm.operPhone }).then((res) => {
this.notice.okTips('已发送,30分钟内有效') this.notice.okTips('已发送,30分钟内有效')
this.isSend = true this.isSend = true
...@@ -824,7 +824,7 @@ export default { ...@@ -824,7 +824,7 @@ export default {
this.msgDown() this.msgDown()
}) })
}, },
msgDown () { msgDown() {
this.time = setTimeout(() => { this.time = setTimeout(() => {
clearTimeout(this.time) clearTimeout(this.time)
if (this.sendMsg > 1) { if (this.sendMsg > 1) {
...@@ -836,7 +836,7 @@ export default { ...@@ -836,7 +836,7 @@ export default {
}, 1000) }, 1000)
}, },
// 自动识别type - 识别类型(1:身份证;2:银行卡;3:营业执照);imgUrl - 图片地址 // 自动识别type - 识别类型(1:身份证;2:银行卡;3:营业执照);imgUrl - 图片地址
handleAutoRecognition (type, imgUrl, needWriteList) { handleAutoRecognition(type, imgUrl, needWriteList) {
// console.log(type) // console.log(type)
// console.log(imgUrl) // console.log(imgUrl)
imgRecognitionApi({ type: type, imgUrl: imgUrl }).then(res => { imgRecognitionApi({ type: type, imgUrl: imgUrl }).then(res => {
...@@ -865,7 +865,7 @@ export default { ...@@ -865,7 +865,7 @@ export default {
} }
}) })
}, },
getParams () { getParams() {
var params = _.cloneDeep(this.editForm) var params = _.cloneDeep(this.editForm)
params.merchantId = this.targetAccount.merchantId params.merchantId = this.targetAccount.merchantId
// 身份证日期 // 身份证日期
...@@ -886,11 +886,11 @@ export default { ...@@ -886,11 +886,11 @@ export default {
return params return params
}, },
jumpScroll (idName) { jumpScroll(idName) {
document.getElementById(idName).scrollIntoView() document.getElementById(idName).scrollIntoView()
}, },
// 确认 // 确认
handleConfirm () { handleConfirm() {
var params = this.getParams() var params = this.getParams()
var picKeys = Object.keys(this.picObj) var picKeys = Object.keys(this.picObj)
for (var item of picKeys) { for (var item of picKeys) {
...@@ -912,7 +912,7 @@ export default { ...@@ -912,7 +912,7 @@ export default {
}) })
}, },
// 存草稿 // 存草稿
handleDraft () { handleDraft() {
var params = this.getParams() var params = this.getParams()
draftYseMerchantApi(params).then(res => { draftYseMerchantApi(params).then(res => {
this.notice.okTips() this.notice.okTips()
...@@ -920,11 +920,11 @@ export default { ...@@ -920,11 +920,11 @@ export default {
}) })
}, },
// 删除session // 删除session
deleteSession () { deleteSession() {
sessionStorage.removeItem(this.sessionName) sessionStorage.removeItem(this.sessionName)
}, },
// 取消 // 取消
handleCancel () { handleCancel() {
this.isSend = false this.isSend = false
this.time && clearTimeout(this.time) this.time && clearTimeout(this.time)
this.deleteSession() this.deleteSession()
......
<!-- 虚拟对账账户 -->
<template>
<d2-container class="account-list">
<div class="header"
slot="header">
<d2-search ref="showSearch"
:searchForm="searchForm"
:formData="showFormData">
<!-- :slot-scope="item" -->
<template slot="channelType">
<el-cascader style="width: 50%;"
:options="merchantLevelOptions[nameToOption[searchForm.channelType]]"
:props="{ checkStrictly: true, value: 'id', label: 'merchantName' }"
:show-all-levels="false"
v-model="merchantLevelVal"
clearable
filterable></el-cascader>
</template>
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">查询</el-button>
<el-button size="small"
@click="handleReset">重置</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table ref="merchantTable"
:getListApi="getListApi"
:searchForm="searchFormSearch"
:tableParams="tableParams"
:beforeSearchFn="beforeSearchFn">
<auth-button slot="auth-button"
slot-scope="scope"
:data="scope.scope"></auth-button>
</d2-table>
</div>
<!-- width="70%"
title="申请虚拟对公账户详情"
btnOkLabel="确定"
v-if="accountDetailVisible"
@confirmDialog="handleDetailClose"
noCancel="true" -->
<!-- v-if="accountDetailVisible" -->
<baseDialog :isShow.sync="accountDetailVisible"
:config="dialogConfig.setting"
:dialogConfig="dialogConfig.config"
@closeDialog="handleDetailClose">
<!-- <span>test</span> -->
<account-detail v-if="accountDetailVisible"
:accountDetailVisible="accountDetailVisible"
:merchantRow="merchantRow"></account-detail>
</baseDialog>
<!-- <d2-dialog
title="申请虚拟对公账户详情"
:isVisible.sync="accountDetailVisible"
width="70%"
btnOkLabel="确定"
noCancel="true"
@confirmDialog="handleDetailClose"
@closeDialog="handleDetailClose"
>
<account-detail
:accountDetailVisible="accountDetailVisible"
:merchantRow="merchantRow"
></account-detail>
</d2-dialog> -->
</d2-container>
</template>
<script>
import _ from 'lodash'
import { Util } from '@/common/util'
import { getListApi, getMerchantLevelApi } from '@api/publicAccount'
import { mapActions } from 'vuex'
import accountDetail from './accountDetail'
import { BaseData, merchantStoreServiceList } from '@/common/constants.js'
import baseDialog from '@/components/baseDialog/baseDialog'
export default {
name: 'accountList',
data() {
return {
// 账户详情
accountDetailVisible: false,
merchantRow: {},
nameToOption: {
1: 'dj',
2: 'gh'
},
merchantLevelOptions: {
dj: [],
gh: []
},
// 搜索
merchantLevelVal: [],
searchForm: {
merchantType: '',
channelType: '',
merchantName: '',
accountStatus: '',
merchantId: ''
},
searchFormSearch: {},
showFormData: [{
label: '商户分类',
name: 'merchantType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'merchantStoreServiceList'
}, {
label: '渠道',
name: 'channelType',
addHtml: 'channelType',
type: 'select',
width: '50%',
optionList: [],
optionId: 'value',
optionLabel: 'name',
optionsName: 'channelTypeList',
changeAttr: (value, targetItem) => {
this.merchantLevelVal = []
}
}, {
label: '商户名称',
name: 'merchantName',
type: 'input',
isClear: true,
placeholder: '请输入4S店/服务商名称',
keyFn: this.keyDowmGetList
}, {
label: '账户状态',
name: 'accountStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'statusList'
}, {
label: '商户号',
name: 'merchantId',
type: 'input',
inputType: 'number',
maxlength: '9',
isClear: true,
placeholder: '请输入4S店/服务商商务号',
keyFn: this.keyDowmGetList
}],
// 表格
getListApi: getListApi,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [{
label: '名称',
prop: 'merchantName'
}, {
label: '编号',
prop: 'merchantId'
}, {
label: '商户分类',
prop: 'merchantType',
formatter: (cellValue) => {
// var item = this.baseData.merchantStoreServiceList.find(item => item.confId === cellValue.merchantType)
return cellValue.merchantType === 7 ? '服务商' : '4S店'
}
}, {
label: '渠道',
prop: '',
formatter: cellValue => {
return cellValue.channelType === 1 ? '嘀加' : '广汇'
}
}, {
label: '账户状态',
prop: 'accountStatus',
formatter: (cellValue) => {
return this.baseData.statusList.find(item => item.confId === cellValue.accountStatus).confLabel
}
}, {
label: '最近更新时间',
prop: 'updatedDate',
formatter: (cellValue) => {
return Util.dateFormate(cellValue.updatedDate, 'YYYY-MM-DD HH:mm:ss')
}
}]
},
baseData: {
channelTypeList: [],
statusList: [{
confId: 1,
confLabel: '未申请'
}, {
confId: 2,
confLabel: '审核中'
}, {
confId: 3,
confLabel: '生效'
}, {
confId: 4,
confLabel: '失败'
}],
merchantStoreServiceList: merchantStoreServiceList
},
dialogConfig: {
setting: {
showClose: true,
appendToBody: false,
// width: '720px',
btnList: [
// { name: '取消', type: 'cancel' },
// { name: '前往', type: 'confirm' }
]
},
config: {
title: '查看详情',
width: '720px'
}
}
}
},
components: {
accountDetail,
baseDialog
},
mounted() {
this.getBaseData()
// 1-嘀加;2-广汇
this.getMerchantLevel(1)
this.getMerchantLevel(2)
// console.log(this.merchantLevelOptions)
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
async getBaseData() {
this.baseData.channelTypeList = await this.get(BaseData.channelType)
this.getOptionsList()
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
getMerchantLevel(channelType) {
// channelType:1-嘀加;2-广汇
getMerchantLevelApi({ channelType: channelType }).then(res => {
// this.merchantLevelOptions[this.nameToOption[channelType]] = JSON.parse(res)
this.merchantLevelOptions[this.nameToOption[channelType]] = res
})
},
// 账户状态不同,会有不同的操作
// 1/4 - 待申请/失败(编辑);2 - 审核中(置灰); 3 - 生效中(详情)
handleApply(cellValue) {
// 查看详情
if (cellValue.accountStatus === 3) {
this.merchantRow = cellValue
this.handleDetailClose()
return true
}
// 编辑
this.close({ tagName: '/applyAccount_new' })
this.$router.push({
name: 'applyAccount_new',
params: cellValue
})
},
handleReset() {
this.searchForm = {
merchantType: '',
channelType: '',
merchantName: '',
accountStatus: '',
merchantId: ''
}
this.merchantLevelVal = []
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = _.cloneDeep(this.searchForm)
this.searchFormSearch.merchantTypeList = this.searchForm.merchantType ? [this.searchForm.merchantType] : [2, 7]
this.searchFormSearch.merchantId = this.searchForm.merchantId ? this.searchForm.merchantId : this.merchantLevelVal[this.merchantLevelVal.length - 1]
delete this.searchFormSearch.merchantType
resolve()
})
},
keyDowmGetList() {
this.$refs.merchantTable.refreshTable()
},
handleDetailClose() {
// console.log('visible')
this.accountDetailVisible = !this.accountDetailVisible
}
}
}
</script>
<style>
.el-cascader-panel .el-cascader-menu {
width: 260px;
}
</style>
<!-- 编辑表单组件 -->
<template>
<d2-container>
<el-form ref="editForm"
class="editForm d2-container-content"
:model="editForm"
:rules="formRules"
:label-width="labelWidth"
v-loading="$store.state.d2admin.loading.value">
<!-- <p name="title"
class="edit-title">{{title}}</p> -->
<slot name="failMessage"></slot>
<div v-for="(item, index) in formList"
:key="index"
:style="{...item.style}">
<p v-if="item.isTitle"
class="edit-title"
style="margin-bottom:22px">{{item.titleName}}</p>
<el-form-item v-if="(item.showAttrList ? item.showAttrList.includes(currentPage) : true) && (item.showForsettlement ? item.showForsettlement.includes(settlementPage) : true) && (item.showForContractType ? item.showForContractType.includes(contractTypePage) : true)"
:prop="item.name"
:label="typeof item.label === 'object' ? (item.label[currentPage] || item.label[settlementPage] || item.label[contractTypePage] + ':') : (item.label ? item.label + ':' : '')"
:id="item.name"
:label-width="item.label ? labelWidth : '0px'"
:rules="item.showAttrList ? (item.showAttrList.includes(currentPage) ? item.rules : []) : item.rules"
class="dis-in-block is-required"
:style="{'margin-bottom': !item.type ? '0px' : '22px'}">
<el-input v-if="item.type === 'input'"
:id="item.name"
v-model="editForm[item.name]"
:size="item.size || 'mini'"
:placeholder="typeof item.placeholder === 'object' ? (item.placeholder[currentPage] || item.placeholder[settlementPage]): (item.placeholder || ('请输入' + item.label))"
:maxlength="item.maxlength || 80"
:style="{'width': item.width || formDefaultWidth}"
:disabled="item.isDisabled"
clearable
@blur="blur($event,item)"
@input="input($event,item)">
<i slot="suffix"
class="suffix">{{item.unit}}</i>
</el-input>
<!-- 选择框 -->
<el-select v-else-if="item.type === 'select'"
:id="item.name"
v-model="editForm[item.name]"
:size="item.size || 'mini'"
:clearable="item.isClear"
:placeholder="typeof item.placeholder === 'object' ? (item.placeholder[currentPage] || item.placeholder[settlementPage]): (item.placeholder || '请选择' + item.label)"
@change="item.hanleSelectChange($event, item)"
filterable
:style="{'width': item.width || formDefaultWidth}"
:disabled="item.isDisabled">
<el-option v-for="subItem in item.optionList"
:key="subItem[item.optionId]"
:label="subItem[item.optionLabel]"
:value="subItem[item.optionId]">
</el-option>
</el-select>
<!-- 选择框 - 远程搜索 -->
<el-select v-else-if="item.type === 'filterSelect'"
:id="item.name"
v-model="editForm[item.name]"
:size="item.size || 'mini'"
filterable
remote
:allow-create="item.noAllowCreate || false"
:placeholder="typeof item.placeholder === 'object' ? (item.placeholder[currentPage] || item.placeholder[settlementPage]): (item.placeholder || '请选择' + item.label)"
:remote-method="(query) => item.remoteMethod(query, item)"
@change="item.hanleSelectChange($event, item)"
:style="{'width': item.width || formDefaultWidth}"
clearable>
<el-option v-for="subItem in item.optionList"
:key="subItem[item.optionId]"
:label="subItem[item.optionLabel]"
:value="subItem[item.optionId]">
</el-option>
</el-select>
<!-- 单选框 -->
<el-radio-group v-else-if="item.type === 'radio'"
:id="item.name"
:size="item.size || 'mini'"
v-model="editForm[item.name]"
@change="change($event,item)">
<el-radio v-for="(subItem, subIdx) in item.radioOptList"
:key="subIdx"
:label="subItem.value">
{{subItem.label}}
<el-tooltip content="线下签约确定提交后,请联系银盛工作人员人工审核"
v-if="item.name == 'contractType' && subIdx == 0"
placement="top">
<i class="el-icon-question"
@click.native.prevent="stop"
style="color: #606266;"></i>
</el-tooltip>
</el-radio>
</el-radio-group>
<!-- 时间 -->
<el-date-picker v-else-if="item.type === 'datePicker'"
:id="item.name"
v-model="editForm[item.name]"
:size="item.size || 'mini'"
:type="item.datePickerType || 'date'"
:clearable="item.isClear || false"
:placeholder="'请选择' + (item.placeholder || item.label)"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="change($event,item)">
</el-date-picker>
<slot v-else
:name="item.slotName"
:scope="item"></slot>
<span v-show="item.itemSuffix"
:style="{...item.itemSuffixStyle}">{{item.itemSuffix}}</span>
</el-form-item>
</div>
<el-form-item style="margin-top: 20px;">
<el-button type="primary"
@click="handleConfirm">确定</el-button>
<el-button @click="handleDraft">存草稿</el-button>
<el-button @click="handleCancel">取消</el-button>
</el-form-item>
</el-form>
</d2-container>
</template>
<script>
export default {
name: 'editForm',
data() {
return {
labelWidth: '170px',
formDefaultWidth: '350px'
}
},
props: {
title: {
type: String,
default: '编辑'
},
// 标记字段,用于显示/隐藏某些表单项
currentPage: {
type: String,
default: ''
},
// 标记字段,用于显示/隐藏结算方式对应的项
settlementPage: {
type: [String, Number],
default: ''
},
// 标记字段,用于显示/隐藏签约方式对应的项
contractTypePage: {
type: [String, Number],
default: ''
},
// 表单规则
formRules: {
type: Object,
default: () => { }
},
// 绑定的表单值
editForm: {
type: Object,
default: () => { }
},
// 表单列表
formList: {
type: Array,
default: () => []
}
},
mounted() { },
methods: {
stop() {
console.log('stop')
},
// selectAddAttr(value, targetItem) { }
// 处理属性没有对应事件的情况
input(event, item) {
// console.log(event)
// input($event,item)
// console.log(item)
item.handleInput && item.handleInput(event, item)
},
blur(event, item) {
item.handleBlur && item.handleBlur(event, item)
},
change(event, item) {
item.handleChange && item.handleChange(event, item)
},
jumpScroll(idName) {
document.getElementById(idName).scrollIntoView(event)
// document.getElementById(idName).scrollIntoView(event, item)
},
// 确认
handleConfirm() {
this.$refs.editForm.validate((valid, opt) => {
var hasError = Object.keys(opt)
if (!valid) {
this.jumpScroll(hasError[0])
return false
}
this.$emit('handleConfirm')
})
},
// 存草稿
handleDraft() {
this.$emit('handleDraft')
},
// 取消
handleCancel() {
this.$emit('handleCancel')
}
}
}
</script>
<style scoped>
.d2-container-content {
margin-top: 0 !important;
}
</style>
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!