Commit cc80feab by 张立顺

ohter:eslint 格式化问题

1 parent a7307d38
{
"name": "dj-car-life-system",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --open",
"start": "npm run serve",
......
......@@ -45,4 +45,4 @@ export function getIncomeFlowList(data) {
export function getIncomeProductList(data) {
data.method = `${path2}workbench.statistics.goods.grossProfitRadio`
return request(data)
}
\ No newline at end of file
}
......@@ -32,13 +32,13 @@ const request = (params = {}, method = RequestMethods.GET, noSignAttr = []) => {
var reqData =
method === RequestMethods.POST
? {
// baseURL: process.env.VUE_APP_API + '?method=' + params.method,
baseURL: '/',
data: sign(params, noSignAttr)
}
// baseURL: process.env.VUE_APP_API + '?method=' + params.method,
baseURL: '/',
data: sign(params, noSignAttr)
}
: {
params: sign(params, noSignAttr)
}
params: sign(params, noSignAttr)
}
console.log(method === RequestMethods.POST)
console.log(url)
return axios({
......
......@@ -41,4 +41,4 @@ export function GETYQMERCHANTCONFIGDETAIL(data) {
export function UPDATEYQMERCHANTCONFIG(data) {
data.method = `dj.api.smarcarlife.yqMerchantConfig.modify`
return request(data, 'post')
}
\ No newline at end of file
}
......@@ -9,7 +9,7 @@ import request from './request'
import RequestMethods from './request.methods'
// 用户相关
const USER_PATH = 'dj.api.'
// 角色相关
// 角色相关
const ROLE_PATH = 'fims.role.'
export const LOGIN_URL = `${USER_PATH}user.login`
......@@ -23,23 +23,23 @@ export const ROLE_LIST_URL = `${ROLE_PATH}list`
export function AccountLogin(data) {
data.method = LOGIN_URL
return request(data)
// return new Promise(resolve => {
// resolve({
// roleId: 7,
// roleType: 2,
// mobile: '15234057707',
// userName: 'wxw',
// loginName: 'foutouren',
// authes: []
// // authes: [{
// // authId: '10101',
// // parentId: '101'
// // }, {
// // authId: '102',
// // parentId: '0'
// // }]
// })
// })
// return new Promise(resolve => {
// resolve({
// roleId: 7,
// roleType: 2,
// mobile: '15234057707',
// userName: 'wxw',
// loginName: 'foutouren',
// authes: []
// // authes: [{
// // authId: '10101',
// // parentId: '101'
// // }, {
// // authId: '102',
// // parentId: '0'
// // }]
// })
// })
}
// 选择账号
......@@ -199,4 +199,4 @@ export function RoleList(data = {}) {
export function RoleDetail(data = {}) {
data.method = `${ROLE_PATH}detail`
return request(data, RequestMethods.GET)
}
\ No newline at end of file
}
......@@ -415,7 +415,7 @@ export const afterTodayOptions = {
// 'N':'不扣水续费'
// }
//财务列表-订单表-表头原始数据
// 财务列表-订单表-表头原始数据
export const orderTableHead = [
{
name: '序号',
......@@ -465,7 +465,7 @@ export const orderTableHead = [
prop: 'orderType',
sort: 21,
formatter: function(row, column) {
let orderTypeList = [
const orderTypeList = [
{
confId: '1',
confLabel: '正常'
......@@ -487,7 +487,7 @@ export const orderTableHead = [
confLabel: '未收款'
}
]
let o = orderTypeList.find(k => +k.confId === row.orderType)
const o = orderTypeList.find(k => +k.confId === row.orderType)
return o ? o.confLabel : '-'
}
}
......@@ -688,7 +688,7 @@ export const billsTableHead = [
prop: 'divisionType',
sort: 5,
formatter: function(row, column) {
let divisionTypeList = [
const divisionTypeList = [
{
confId: '1',
confLabel: '线下对账'
......@@ -698,7 +698,7 @@ export const billsTableHead = [
confLabel: '线上分账'
}
]
let o = divisionTypeList.find(k => {
const o = divisionTypeList.find(k => {
return k.confId == row.divisionType
})
return o ? o.confLabel : '-'
......@@ -720,7 +720,7 @@ export const billsTableHead = [
prop: 'odDivisionStatus',
sort: 19,
formatter: function(row, column) {
let ODDIVISIONSTATUS = {
const ODDIVISIONSTATUS = {
1: '待分账',
2: '分账中',
3: '分账成功',
......@@ -737,7 +737,7 @@ export const billsTableHead = [
prop: 'deductChargeFlag',
sort: 20,
formatter: function(row, column) {
let DEDUCTCHARGEFLAG = {
const DEDUCTCHARGEFLAG = {
Y: '扣除手续费(按0.6%的标准)',
N: '不扣水续费'
}
......
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'
let loadingInstance = ''
export const Util = {
/**
* 简单alert
* title 标题
......@@ -31,25 +30,25 @@ export const Util = {
callback: function(action, done) {
if (action == 'confirm') {
if (options.success) {
(options.success)(done)
options.success(done)
}
} else {
console.log(done);
console.log(done)
// done()
}
}
});
})
/* Vue.$vux.alert.show({
title: options.title||'',
content: options.message||'',
onShow() {
options.onShow?(options.onShow)():'';
},
onHide() {
options.onHide?(options.onHide)():'';
}
}) */
title: options.title||'',
content: options.message||'',
onShow() {
options.onShow?(options.onShow)():'';
},
onHide() {
options.onHide?(options.onHide)():'';
}
}) */
},
/**
......@@ -61,8 +60,7 @@ export const Util = {
type: options.type || 'error',
duration: options.time || 2000,
onClose: options.onClose || ''
});
})
},
/**
......@@ -83,108 +81,110 @@ export const Util = {
loading: function(message) {
loadingInstance = Loading.service({
text: message || '加载中...'
});
})
},
/**
* 关闭loading
*/
closeLoading: function() {
loadingInstance.close();
loadingInstance.close()
},
/**
* 校验手机号码格式
*/
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}$/;
return myreg.test(mobile);
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)
},
/**
* 校验固定电话
*/
validationTel: function(tel) {
let reg = /^0[\d]{2,3}-[\d]{7,8}$/;
return reg.test(tel);
const reg = /^0[\d]{2,3}-[\d]{7,8}$/
return reg.test(tel)
},
/**
* 是否特殊字符
*/
isSpecialLetter: function(str) {
let reg = new RegExp("[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]");
return reg.test(str);
const reg = new RegExp(
"[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]"
)
return reg.test(str)
},
/**
* 只能输入英文字母和数字,不能输入中文
*/
validationInput: function(str) {
let reg = /[^\w\.\/]/ig;
return reg.test(str);
const reg = /[^\w\.\/]/gi
return reg.test(str)
},
/**
* 获取当前时间
*/
getCurrentDate: function() {
let time = new Date();
let y = time.getFullYear();
let m = time.getMonth() + 1;
let d = time.getDate();
const time = new Date()
const y = time.getFullYear()
const m = time.getMonth() + 1
const d = time.getDate()
return {
date: y + '/' + m + '/' + d
}
},
/**
   * 获取浏览器参数
   */
  getUrlParams: function(name) {
    let vars = [],
      hash;
      let oParams = {};
    let hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for (let i = 0; i < hashes.length; i++) {
      hash = hashes[i].split('=');
      vars.push(hash[0]);
      oParams[hash[0]] = hash[1];
    }
    console.log(vars);
    if(name){
      return oParams[name];
    }else{
      return oParams;
    }
  },
* 获取浏览器参数
*/
getUrlParams: function(name) {
const vars = []
let hash
const oParams = {}
const hashes = window.location.href
.slice(window.location.href.indexOf('?') + 1)
.split('&')
for (let i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=')
vars.push(hash[0])
oParams[hash[0]] = hash[1]
}
console.log(vars)
if (name) {
return oParams[name]
} else {
return oParams
}
},
/**
* 根据当前时间,计算往后30天的日期
*/
getAfterDate: function(day) {
let date1 = new Date();
let date2 = new Date(date1);
let time = 30;
const date1 = new Date()
const date2 = new Date(date1)
let time = 30
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 {
date: _date,
year: date2.getFullYear(),
month: date2.getMonth() + 1,
day: date2.getDate()
};
}
},
/**
* 日期格式转换
*/
......@@ -213,7 +213,7 @@ export const Util = {
if (str.length > m) {
n = str.slice(0, m) + '...'
}
return n
},
......@@ -223,7 +223,7 @@ export const Util = {
* console.log(bar===foo) false
* @param {*} obj
*/
deepClone: function (obj) {
deepClone: function(obj) {
// Handle the 3 simple types, and null or undefined or function
if (obj == null || typeof obj !== 'object') return obj
// Handle Date
......@@ -243,12 +243,11 @@ export const Util = {
return copy
}
throw new Error("Unable to clone obj! Its type isn't supported.")
},
}
}
export const showModal = Util.msg
export const showToast = Util.Info
export const showLoading = Util.loading
export const hideLoading = Util.closeLoading
export const deepClone = Util.deepClone
\ No newline at end of file
export const deepClone = Util.deepClone
......@@ -17,50 +17,50 @@ export default {
props: {
show: {
type: Boolean,
default: false,
default: false
},
title: {
type: String,
default: '提示',
default: '提示'
},
width: {
type: String,
default: '46%',
default: '46%'
},
cancel: {
required: false,
type: Function,
type: Function
},
confirm: {
required: false,
type: Function,
type: Function
},
usefooter: {
required: false,
type: Boolean,
default: false,
default: false
},
appendtobody: {
required: false,
type: Boolean,
default: false,
},
default: false
}
},
data() {
return {
hasFooter: false,
hasFooter: false
}
},
created() {
let o = this.$slots
const o = this.$slots
this.hasFooter = o.footer
},
mounted: function () {},
mounted: function() {},
methods: {
/**
* 取消关闭弹框
*/
onCancel: function () {
onCancel: function() {
// 兼容以前的页面
this.$emit('close')
},
......@@ -68,8 +68,8 @@ export default {
/**
* 确定
*/
onConfirm: function () {},
},
onConfirm: function() {}
}
}
</script>
......
......@@ -12,7 +12,7 @@
:key="index"
:command="language.value">
<d2-icon :name="$i18n.locale === language.value ? 'dot-circle-o' : 'circle-o'" class="d2-mr-5"/>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
......
......@@ -127,7 +127,7 @@ export default {
}
)
.then(() => {
const reload = async () => {
const reload = async() => {
localStorage.clear()
await this.logout()
this.$store.commit('d2admin/gray/set', false)
......@@ -161,7 +161,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
})
.then(async () => {
.then(async() => {
await this.$store.commit('d2admin/gray/set', false)
resolve(true)
})
......
......@@ -9,7 +9,7 @@ const COOKIE_NAME_PREFIX = `${process.env.VUE_APP_STORAGE_PREFIX}-${process.env.
* @param {Object} setting cookie setting
*/
cookies.set = function(name = 'default', value = '', cookieSetting = {}) {
let currentCookieSetting = {
const currentCookieSetting = {
expires: 1
}
Object.assign(currentCookieSetting, cookieSetting)
......
......@@ -13,7 +13,7 @@ const util = {
* @description 更新标题
* @param {String} title 标题
*/
util.title = function (titleText) {
util.title = function(titleText) {
const processTitle = process.env.VUE_APP_TITLE
window.document.title = `${processTitle}${titleText ? ` | ${titleText}` : ''}`
}
......@@ -22,7 +22,7 @@ util.title = function (titleText) {
* @description 打开新页面
* @param {String} url 地址
*/
util.open = function (url, target) {
util.open = function(url, target) {
var a = document.createElement('a')
a.setAttribute('href', url)
a.setAttribute('target', target || '_blank')
......@@ -64,9 +64,9 @@ util.deepClone = (obj) => {
* @param {Function} condition 回调函数,必须返回谓词,判断是否找到了。会传入(item, index, level)三个参数
* @param {String} children 子数组的key
*/
util.deepFind = function (menus, id) {
util.deepFind = function(menus, id) {
const cloneMenus = util.deepClone(menus)
for (let menu of cloneMenus) {
for (const menu of cloneMenus) {
if (menu.id === id) {
delete menu.children
return menu
......@@ -112,7 +112,7 @@ util.colorToRgb = (sColor, alpha) => {
* 重置form
* 用法: util.resetForm.call(this,'formName')
*/
util.resetForm = function (formName) {
util.resetForm = function(formName) {
this.$nextTick(() => {
for (var key in this[formName]) {
if (this[formName].hasOwnProperty(key)) {
......@@ -127,7 +127,7 @@ util.resetForm = function (formName) {
* 格式化时间
* @param {Array} time
*/
util.formatTime = function (time) {
util.formatTime = function(time) {
return {
startTime: time ? time[0] + ' ' + '00:00:00' : '',
endTime: time ? time[1] + ' ' + '23:59:59' : ''
......
......@@ -17,35 +17,35 @@ export default {
// console.log(router.addRoutes);
return new Promise((resolve, reject) => {
var params = {
userName: p.userName,
password: md5(p.password).toLowerCase()
}
// 开始请求登录接口
userName: p.userName,
password: md5(p.password).toLowerCase()
}
// 开始请求登录接口
AccountLogin(params).then(async(accountInfo = {}) => {
// 设置 cookie 一定要存 uuid 和 token 两个 cookie
// 整个系统依赖这两个数据进行校验和存储
// uuid 是用户身份唯一标识 用户注册的时候确定 并且不可改变 不可重复
// token 代表用户当前登录状态 建议在网络请求中携带 token
// 如有必要 token 需要定时更新,默认保存一天
// util.cookies.set('uuid', accountInfo.loginName)
if (accountInfo.accountList.length > 1) {
resolve({ isMutiAccount: true, accountInfo: accountInfo, userInfo: {} })
} else {
util.cookies.set('token', accountInfo.sessionId)
getUserInfo({}).then(async userInfo => {
userInfo.beSuper = userInfo.loginAccount.isAdmin == 1
userInfo.detail = userInfo.merchant
Object.keys(userInfo.loginAccount).forEach(item => {
if (userInfo.loginAccount[item] && !userInfo.detail[item]) {
userInfo.detail[item] = userInfo.loginAccount[item]
}
})
userInfo.merchantAccountLevel = userInfo.detail.merchantAccountLevel
await dispatch('getAuth', { userInfo: userInfo, accountInfo: accountInfo })
resolve({ isMutiAccount: false, accountInfo: accountInfo, userInfo: userInfo })
// 设置 cookie 一定要存 uuid 和 token 两个 cookie
// 整个系统依赖这两个数据进行校验和存储
// uuid 是用户身份唯一标识 用户注册的时候确定 并且不可改变 不可重复
// token 代表用户当前登录状态 建议在网络请求中携带 token
// 如有必要 token 需要定时更新,默认保存一天
// util.cookies.set('uuid', accountInfo.loginName)
if (accountInfo.accountList.length > 1) {
resolve({ isMutiAccount: true, accountInfo: accountInfo, userInfo: {} })
} else {
util.cookies.set('token', accountInfo.sessionId)
getUserInfo({}).then(async userInfo => {
userInfo.beSuper = userInfo.loginAccount.isAdmin == 1
userInfo.detail = userInfo.merchant
Object.keys(userInfo.loginAccount).forEach(item => {
if (userInfo.loginAccount[item] && !userInfo.detail[item]) {
userInfo.detail[item] = userInfo.loginAccount[item]
}
})
}
})
userInfo.merchantAccountLevel = userInfo.detail.merchantAccountLevel
await dispatch('getAuth', { userInfo: userInfo, accountInfo: accountInfo })
resolve({ isMutiAccount: false, accountInfo: accountInfo, userInfo: userInfo })
})
}
})
.catch(err => {
console.log('err: ', err)
reject(err)
......@@ -54,8 +54,8 @@ export default {
},
/**
* @description 获取用户权限
* @param {*} param0
* @param {*} param1
* @param {*} param0
* @param {*} param1
*/
getAuth({ commit, dispatch }, { userInfo, accountInfo }) {
return new Promise((resolve, reject) => {
......@@ -75,29 +75,29 @@ export default {
var tempAuths = []
var targetRoutes = (res.beSuper) ? routeAll : res.map(i => i.authId)
routeAll.map(i => i.authId).forEach((item, index) => {
targetRoutes.includes(item) && tempAuths.push(routeAll[index])
if (routeAll[index].hasOwnProperty('addRoutePath')) {
routeAll[index].addRoutePath.forEach(k => {
if (!tempAuths.map(m => m.authId).includes(k.authId)) {
tempAuths.push(k)
}
})
}
})
// const authes = (+accountInfo.roleType === SUPPER_ADMIN) ?
// util.permision.flatten(Object.values(localRoutes))
// .map(obj => ({ authId: obj.authId, parentId: obj.parentId })) :
// tempAuths
targetRoutes.includes(item) && tempAuths.push(routeAll[index])
if (routeAll[index].hasOwnProperty('addRoutePath')) {
routeAll[index].addRoutePath.forEach(k => {
if (!tempAuths.map(m => m.authId).includes(k.authId)) {
tempAuths.push(k)
}
})
}
})
// const authes = (+accountInfo.roleType === SUPPER_ADMIN) ?
// util.permision.flatten(Object.values(localRoutes))
// .map(obj => ({ authId: obj.authId, parentId: obj.parentId })) :
// tempAuths
const authes = tempAuths
await dispatch('d2admin/auth/set', authes, { root: true })
// delete accountInfo.authes
// 初始化权限
// delete accountInfo.authes
// 初始化权限
await dispatch('d2admin/auth/init', null, { root: true })
// // 设置 vuex 用户信息
// // 设置 vuex 用户信息
await dispatch('d2admin/user/set', { info: userInfo, accountInfo }, { root: true })
// // 用户登录后从持久化数据加载一系列的设置
// // 用户登录后从持久化数据加载一系列的设置
await dispatch('load')
// 结束
// 结束
resolve(userInfo)
})
})
......@@ -116,8 +116,8 @@ export default {
// util.cookies.remove('uuid')
await dispatch('d2admin/user/clear', null, { root: true })
await dispatch('d2admin/base/clear', null, { root: true })
// await commit('d2admin/page/setCurrent', null, { root: true })
// await commit('d2admin/auth/set', null, { root: true })
// await commit('d2admin/page/setCurrent', null, { root: true })
// await commit('d2admin/auth/set', null, { root: true })
resolve()
})
},
......@@ -129,23 +129,23 @@ export default {
return new Promise(async resolve => {
// DB -> store 加载用户名
await dispatch('d2admin/user/load', null, { root: true })
// DB -> store 加载主题
// DB -> store 加载主题
await dispatch('d2admin/theme/load', null, { root: true })
// DB -> store 加载页面过渡效果设置
// DB -> store 加载页面过渡效果设置
await dispatch('d2admin/transition/load', null, { root: true })
// DB -> store 持久化数据加载上次退出时的多页列表
// DB -> store 持久化数据加载上次退出时的多页列表
await dispatch('d2admin/page/openedLoad', null, { root: true })
// DB -> store 持久化数据加载侧边栏折叠状态
// DB -> store 持久化数据加载侧边栏折叠状态
await dispatch('d2admin/menu/asideCollapseLoad', null, { root: true })
// DB -> store 持久化数据加载全局尺寸
// DB -> store 持久化数据加载全局尺寸
await dispatch('d2admin/size/load', null, { root: true })
// DB - > 初始化 基础数据
// await dispatch('d2admin/base/init', null, { root: true })
// 后台接口 -> store
// await dispatch('d2admin/auth/init', null, { root: true })
// end
// DB - > 初始化 基础数据
// await dispatch('d2admin/base/init', null, { root: true })
// 后台接口 -> store
// await dispatch('d2admin/auth/init', null, { root: true })
// end
resolve()
})
}
}
}
\ No newline at end of file
}
......@@ -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 defaultPage = userInfo ? (userInfo.detail.accountType !== 7 ? home : localRoutes['90503']) : home
defaultPage.fullPath = INDEX_PATH
// 判定是否需要缓存
// 判定是否需要缓存
const isKeepAlive = data => _.get(data, 'meta.cache', false)
// const setIcon = meta => {
// console.log(meta)
// return (meta.icon = localRoutes[meta.authId].icon)
// }
// const setIcon = meta => {
// console.log(meta)
// return (meta.icon = localRoutes[meta.authId].icon)
// }
export default {
namespaced: true,
......@@ -84,28 +84,28 @@ export default {
// valid 有效列表 1, 1, 0, 1 => 有效, 有效, 失效, 有效
const valid = []
const __oSource = await dispatch('d2admin/auth/load', null, {
root: true
})
// 处理数据
root: true
})
// 处理数据
state.opened = value
.map(opened => {
// 忽略首页
if (opened.fullPath === INDEX_PATH) {
valid.push(1)
// setIcon(opened.meta)
// setIcon(opened.meta)
return opened
}
// 尝试在所有的支持多标签页的页面里找到 name 匹配的页面
const find = state.pool.find(item => {
return (
item.path === opened.path &&
return (
item.path === opened.path &&
__oSource.some(obj => +obj.authId === +item.meta.authId)
)
})
// 记录有效或无效信息
)
})
// 记录有效或无效信息
valid.push(find ? 1 : 0)
// 返回合并后的数据 新的覆盖旧的
// 新的数据中一般不会携带 params 和 query, 所以旧的参数会留存
// 返回合并后的数据 新的覆盖旧的
// 新的数据中一般不会携带 params 和 query, 所以旧的参数会留存
return Object.assign({}, opened, find)
})
.filter((opened, index) => valid[index] === 1)
......@@ -113,7 +113,7 @@ export default {
// state.openedLoaded = true
// 根据 opened 数据生成缓存设置
commit('keepAliveRefresh')
// end
// end
resolve()
})
},
......@@ -128,16 +128,16 @@ export default {
return new Promise(async resolve => {
// 设置数据
dispatch(
'd2admin/db/set', {
dbName: 'sys',
path: 'page.opened',
value: state.opened,
user: true
}, {
root: true
}
)
// end
'd2admin/db/set', {
dbName: 'sys',
path: 'page.opened',
value: state.opened,
user: true
}, {
root: true
}
)
// end
resolve()
})
},
......@@ -163,10 +163,10 @@ export default {
page.params = params || page.params
page.query = query || page.query
page.fullPath = fullPath || page.fullPath
// state.opened.splice(index, 1, page)
// 持久化
// state.opened.splice(index, 1, page)
// 持久化
await dispatch('opend2db')
// end
// end
resolve()
})
},
......@@ -192,16 +192,16 @@ export default {
newTag.params = params || newTag.params
newTag.query = query || newTag.query
newTag.fullPath = fullPath || newTag.fullPath
// setIcon(newTag.meta)
// 添加进当前显示的页面数组
// setIcon(newTag.meta)
// 添加进当前显示的页面数组
state.opened.push(newTag)
// 如果这个页面需要缓存 将其添加到缓存设置
// 如果这个页面需要缓存 将其添加到缓存设置
if (isKeepAlive(newTag)) {
dispatch('keepAlivePush', tag.name)
}
// 持久化
await dispatch('opend2db')
// end
// end
resolve()
})
},
......@@ -224,11 +224,11 @@ export default {
return new Promise(async resolve => {
// 已经打开的页面
const opened = state.opened
// 判断此页面是否已经打开 并且记录位置
// let pageOpendIndex = 0
// 判断此页面是否已经打开 并且记录位置
// let pageOpendIndex = 0
const page = opened.find((page, index) => {
const same = page.fullPath === fullPath
// pageOpendIndex = same ? index : pageOpendIndex
// pageOpendIndex = same ? index : pageOpendIndex
return same
})
if (page) {
......@@ -242,7 +242,7 @@ export default {
} else {
// 页面以前没有打开过
const page = state.pool.find(t => t.name === name)
// 如果这里没有找到 page 代表这个路由虽然在框架内 但是不参与标签页显示
// 如果这里没有找到 page 代表这个路由虽然在框架内 但是不参与标签页显示
if (page) {
await dispatch('add', {
tag: Object.assign({}, page),
......@@ -274,7 +274,7 @@ export default {
// 下个新的页面
let newPage = state.opened[0]
const isCurrent = state.current === tagName
// 如果关闭的页面就是当前显示的页面
// 如果关闭的页面就是当前显示的页面
if (isCurrent) {
// 去找一个新的页面
const len = state.opened.length
......@@ -294,12 +294,12 @@ export default {
if (index >= 0) {
// 如果这个页面是缓存的页面 将其在缓存设置中删除
dispatch('keepAliveRemove', state.opened[index].name)
// 更新数据 删除关闭的页面
// 更新数据 删除关闭的页面
state.opened.splice(index, 1)
}
// 持久化
await dispatch('opend2db')
// 最后需要判断是否需要跳到首页
// 最后需要判断是否需要跳到首页
if (isCurrent) {
const {
name = '', params = {}, query = {}
......@@ -328,21 +328,21 @@ export default {
} = {}) {
return new Promise(async resolve => {
await dispatch('_do', {
pageSelect,
call: currentIndex => {
return new Promise(async resolve => {
if (currentIndex > 0) {
// 删除打开的页面 并在缓存设置中删除
await dispatch('_splice', {
index: 1,
howmany: currentIndex - 1
})
}
resolve()
})
}
})
// end
pageSelect,
call: currentIndex => {
return new Promise(async resolve => {
if (currentIndex > 0) {
// 删除打开的页面 并在缓存设置中删除
await dispatch('_splice', {
index: 1,
howmany: currentIndex - 1
})
}
resolve()
})
}
})
// end
resolve()
})
},
......@@ -390,28 +390,28 @@ export default {
} = {}) {
return new Promise(async resolve => {
await dispatch('_do', {
pageSelect,
call: currentIndex => {
return new Promise(async resolve => {
// 删除打开的页面数据 并更新缓存设置
if (currentIndex === 0) {
await dispatch('_splice', {
index: 1
})
} else {
await dispatch('_splice', {
index: currentIndex + 1
})
await dispatch('_splice', {
index: 1,
howmany: currentIndex - 1
})
}
resolve()
})
}
})
// end
pageSelect,
call: currentIndex => {
return new Promise(async resolve => {
// 删除打开的页面数据 并更新缓存设置
if (currentIndex === 0) {
await dispatch('_splice', {
index: 1
})
} else {
await dispatch('_splice', {
index: currentIndex + 1
})
await dispatch('_splice', {
index: 1,
howmany: currentIndex - 1
})
}
resolve()
})
}
})
// end
resolve()
})
},
......@@ -428,11 +428,11 @@ export default {
return new Promise(async resolve => {
// 删除打开的页面 并在缓存设置中删除
await dispatch('closeOpened')
// dispatch('currentSet', _index)
// 持久化
// await dispatch('opend2db')
// dispatch('currentSet', _index)
// 持久化
// await dispatch('opend2db')
router.replace(INDEX_PATH)
// end
// end
resolve()
})
},
......@@ -458,14 +458,14 @@ export default {
}
})
await call(currentIndex)
// 设置当前的页面
// dispatch('currentSet', pageAim)
// 设置当前的页面
// dispatch('currentSet', pageAim)
if (router.app.$route.fullPath !== pageAim) {
router.push(pageAim)
}
// 持久化
await dispatch('opend2db')
// end
// end
resolve()
})
},
......@@ -508,7 +508,7 @@ export default {
}, fullPath) {
return new Promise(async resolve => {
await commit('setCurrent', fullPath)
// 设置数据
// 设置数据
dispatch(
'd2admin/db/set', {
dbName: 'sys',
......@@ -562,11 +562,11 @@ export default {
return new Promise(async resolve => {
// 删除打开的页面 并在缓存设置中删除
await dispatch('_splice', {
index: 1
})
// 持久化
index: 1
})
// 持久化
await dispatch('opend2db')
// end
// end
resolve()
})
},
......@@ -688,4 +688,4 @@ export default {
})
}
}
}
\ No newline at end of file
}
......@@ -46,7 +46,7 @@ export default {
load({ state, commit, dispatch }) {
return new Promise(async resolve => {
// store 赋值
let activeName = await dispatch('d2admin/db/get', {
const activeName = await dispatch('d2admin/db/get', {
dbName: 'sys',
path: 'theme.activeName',
defaultValue: state.list[0].name,
......
......@@ -88,4 +88,4 @@ export default {
dispatch('clear')
}
}
}
\ No newline at end of file
}
......@@ -21,7 +21,7 @@
<el-radio-button label="6">园区店</el-radio-button>
<!-- <el-radio-button label="2"
@click.native.prevent="clickMerchantType('2')">4S店</el-radio-button>
<el-radio-button label="7"
<el-radio-button label="7"
@click.native.prevent="clickMerchantType('7')">服务商</el-radio-button>
<el-radio-button label="6"
@click.native.prevent="clickMerchantType('6')">园区店</el-radio-button> -->
......@@ -92,8 +92,8 @@ import * as api from '@api/finance'
import { getMerchantPageSearch } from '@api/publicAccount'
export default {
name: 'downloadAccountDialog',
data () {
let validateLonlat = (rule, value, callback) => {
data() {
const validateLonlat = (rule, value, callback) => {
if (value) {
if (!this.infoForm.payEndDate) {
callback(new Error('请选择结束日期'))
......@@ -214,19 +214,19 @@ export default {
// }
},
created () {
created() {
// this.$nextTick(() => {
// this.$refs.accountForm.resetFields();
// })
},
components: {},
mounted () {
mounted() {
this.selectMerchant()
},
methods: {
selectMerchant () {
selectMerchant() {
var params = {}
params.currentPage = 1
params.pageSize = 1000
......@@ -245,26 +245,26 @@ export default {
})
},
clickMerchantType (e) {
clickMerchantType(e) {
e === this.infoForm.merchantType
? (this.infoForm.merchantType = '')
: (this.infoForm.merchantType = e)
console.log(this.infoForm.merchantType)
},
changeType () {
changeType() {
this.infoForm.merchant = []
// this.baseData.merchantList = []
this.selectMerchant()
},
changeStartDate () {
changeStartDate() {
if (this.infoForm.payEndDate) {
this.infoForm.payEndDate = ''
}
},
remoteMethod (query) {
remoteMethod(query) {
// if (query !== '') {
this.selectLoading = true
var params = {}
......@@ -284,7 +284,7 @@ export default {
// }
},
handleAddConfirm () {
handleAddConfirm() {
// console.log(this.infoForm.remark)
console.log(this.infoForm)
// this.handleClose()
......@@ -316,7 +316,7 @@ export default {
})
},
handleClose () {
handleClose() {
this.$emit('accountClose', true)
}
}
......
......@@ -430,7 +430,7 @@ export default {
downloadAccountDialog
},
data () {
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
isSubOrder: false,
......@@ -575,7 +575,7 @@ export default {
}
},
mounted () {
mounted() {
// console.log(document.getElementById('financeChart'))
if (this.userInfo.beSuper) {
getParkStore({}).then(res => {
......@@ -602,14 +602,14 @@ export default {
this.getTotal()
},
watch: {
summaryDate (newValue) {
summaryDate(newValue) {
this.getSummary()
}
},
methods: {
...mapActions({ close: 'd2admin/page/close' }),
handleAddClose (isRefresh = false) { },
drawFunnelChart () {
handleAddClose(isRefresh = false) { },
drawFunnelChart() {
// console.log(funnelOption)
getTransferData({}).then(res => {
funnelOption.series[0].data[0].tooltipValue = res.totalCustomerNums
......@@ -621,7 +621,7 @@ export default {
this.financeChart.setOption(funnelOption)
})
},
handleReset () {
handleReset() {
this.searchForm = {
time: '',
yqMerchantId: '',
......@@ -643,7 +643,7 @@ export default {
this.getOptionsList()
},
// 导出
handleExport () {
handleExport() {
var params = this.getParams()
params.pageNum = 1
api.exportFile(params).then(res => {
......@@ -651,12 +651,12 @@ export default {
this.$open(res)
})
},
//下载对账单
downloadAccount () {
// 下载对账单
downloadAccount() {
this.accountVisible = !this.accountVisible
},
// 查看明细
handleDetail (data) {
handleDetail(data) {
this.close({ tagName: '/financeDetail' })
this.$router.push({
name: 'financeDetail',
......@@ -666,7 +666,7 @@ export default {
})
},
getServiceStore (merchantId) {
getServiceStore(merchantId) {
getServiceStore({
yqMerchantId: merchantId
}).then(res => {
......@@ -675,13 +675,13 @@ export default {
})
},
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
this.showFormData[index].optionLabel
] !== '全部'
) {
const temp = {}
......@@ -697,7 +697,7 @@ export default {
}
})
},
getSummary () {
getSummary() {
api
.getSummary({
beginDateStr: this.summaryDate
......@@ -715,10 +715,10 @@ export default {
this.summayData = res
})
},
keyDowmGetList () {
keyDowmGetList() {
this.getList()
},
getList () {
getList() {
var params = this.getParams()
params = {
...this.page,
......@@ -750,7 +750,7 @@ export default {
this.total = res.total
})
},
numAddPrefix (item) {
numAddPrefix(item) {
const moneyLabels = [
'goodsCost',
'totalPrice',
......@@ -777,7 +777,7 @@ export default {
}
return item
},
getSelectInputParams () {
getSelectInputParams() {
const list = Object.keys(this.searchSelectObj)
var params = {}
list.forEach(i => {
......@@ -786,7 +786,7 @@ export default {
})
return params
},
getParams () {
getParams() {
var params = this.getSelectInputParams()
if (this.searchForm.yqMerchantId) {
params.yqMerchantId = this.searchForm.yqMerchantId
......@@ -814,29 +814,29 @@ export default {
// }
return params
},
getTotal () {
getTotal() {
api.getListTotal(this.getParams()).then(res => {
this.totalObj = res
})
},
handleSearch () {
handleSearch() {
this.page.pageNum = 1
this.getList()
this.getTotal()
},
// 每页条数
handleSizeChange (value) {
handleSizeChange(value) {
this.page.pageSize = value
this.getList()
},
// 页码
handleCurrentChange (value) {
handleCurrentChange(value) {
this.page.pageNum = value
this.getList()
},
accountClose (isRefresh) {
accountClose(isRefresh) {
this.accountVisible = !this.accountVisible
// isRefresh && this.handleSearch()
}
......
......@@ -436,7 +436,7 @@ export default {
pageSize: 20
},
payTypeOpts: {
'1':'微信支付',
'1': '微信支付',
'2': '4S店支付',
'3': 'POS机收款'
},
......
......@@ -3,7 +3,7 @@ const customTransOption = {
tooltip: {
trigger: 'axis',
axisPointer: {
}
},
legend: {
......@@ -17,7 +17,7 @@ const customTransOption = {
containLabel: true
},
toolbox: {
},
xAxis: {
type: 'category',
......@@ -26,15 +26,15 @@ const customTransOption = {
axisLine: {
show: false,
lineStyle: {
}
},
axisTick: {
show: false
},
axisLabel: {
//interval: 0,
//rotate: 45
// interval: 0,
// rotate: 45
},
offset: 10
},
......@@ -53,17 +53,17 @@ const customTransOption = {
{
name: '客户到店',
type: 'line',
//stack: '总量',
// stack: '总量',
itemStyle: {
color: '#0947C6'
},
data: [120, 132, 101, 134, 90, 230, 210],
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: '客户转化',
type: 'line',
//stack: '总量',
// stack: '总量',
itemStyle: {
color: '#2B9AFF'
},
......
export function debounce(func, wait, immediate) {
let timeout, args, context, timestamp, result;
let timeout, args, context, timestamp, result
const later = function () {
const later = function() {
// 据上一次触发时间间隔
const last = +new Date() - timestamp;
const last = +new Date() - timestamp
// 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
if (last < wait && last > 0) {
timeout = setTimeout(later, wait - last);
timeout = setTimeout(later, wait - last)
} else {
timeout = null;
timeout = null
// 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
if (!immediate) {
result = func.apply(context, args);
if (!timeout) context = args = null;
result = func.apply(context, args)
if (!timeout) context = args = null
}
}
};
}
return function (...args) {
context = this;
timestamp = +new Date();
const callNow = immediate && !timeout;
return function(...args) {
context = this
timestamp = +new Date()
const callNow = immediate && !timeout
// 如果延时不存在,重新设定延时
if (!timeout) timeout = setTimeout(later, wait);
if (!timeout) timeout = setTimeout(later, wait)
if (callNow) {
result = func.apply(context, args);
context = args = null;
result = func.apply(context, args)
context = args = null
}
return result;
};
}
\ No newline at end of file
return result
}
}
......@@ -2,7 +2,7 @@ const incomeFlowOption = {
tooltip: {
trigger: 'axis',
axisPointer: {
}
},
/* legend: {
......@@ -16,7 +16,7 @@ const incomeFlowOption = {
containLabel: true
},
toolbox: {
},
xAxis: {
type: 'category',
......@@ -25,15 +25,15 @@ const incomeFlowOption = {
axisLine: {
show: false,
lineStyle: {
}
},
axisTick: {
show: false
},
axisLabel: {
//interval: 0,
//rotate: 45
// interval: 0,
// rotate: 45
},
offset: 10
},
......@@ -57,8 +57,8 @@ const incomeFlowOption = {
color: '#0947C6'
},
data: [120, 132, 101, 134, 90, 230, 210],
smooth: true,
},
smooth: true
}
/* {
name: '支出',
type: 'line',
......@@ -72,4 +72,4 @@ const incomeFlowOption = {
]
}
export default incomeFlowOption
\ No newline at end of file
export default incomeFlowOption
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: {
text: '累计收入\n555555元',
top: '50%',
......@@ -23,12 +23,12 @@ const incomeProductOption = {
{
name: '毛利',
type: 'pie',
minAngle: 5,
minAngle: 5,
avoidLabelOverlap: true,
radius: ['40%', '60%'],
center: ['50%', '60%'],
label:{
show: false,
label: {
show: false
/* align: 'left',
normal:{
formatter(v) {
......@@ -58,23 +58,23 @@ const incomeProductOption = {
]
}
function insertBr(text) {
if(text.length <= 8){
return text;
}else if(text.length > 8 && text.length <= 16){
return text = `${text.slice(0,8)}\n${text.slice(8)}\n`
}else if(text.length > 16 && text.length <= 24){
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16)}\n`
}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)}\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`
if (text.length <= 8) {
return text
} else if (text.length > 8 && text.length <= 16) {
return text = `${text.slice(0, 8)}\n${text.slice(8)}\n`
} else if (text.length > 16 && text.length <= 24) {
return text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(16)}\n`
} 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)}\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) {
if(text.length <= 30){
return text;
}else if(text.length > 30){
return text = `${text.slice(0,30)}</br>${text.slice(30)}`
if (text.length <= 30) {
return text
} else if (text.length > 30) {
return text = `${text.slice(0, 30)}</br>${text.slice(30)}`
}
}
export default incomeProductOption
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: {
trigger: 'item',
//formatter: '{a} <br/>{b} : {c} ({d}%)',
// formatter: '{a} <br/>{b} : {c} ({d}%)',
formatter: (params) => {
return `${insertTooltipBr(params.name)} : ${params.value}(${params.percent}%)`
},
......@@ -13,9 +13,9 @@ const storeFlowOption = {
orient: 'vertical',
right: 0,
data: [],
formatter: function (name) {
if(name.length>8) {
return name.substr(0,8)+'...'
formatter: function(name) {
if (name.length > 8) {
return name.substr(0, 8) + '...'
}
return name
},
......@@ -30,12 +30,12 @@ const storeFlowOption = {
{
name: '4s门店客流量',
type: 'pie',
minAngle: 5,
minAngle: 5,
avoidLabelOverlap: true,
radius: '50%',
center: ['40%', '65%'],
label:{
show:false,
label: {
show: false
/* align: 'left',
normal:{
formatter(v) {
......@@ -48,23 +48,23 @@ const storeFlowOption = {
} */
},
data: [
{
value: 335,
name: '直接访问',
{
value: 335,
name: '直接访问'
},
{
value: 335,
name: '直接访问',
{
value: 335,
name: '直接访问'
},
{
value: 335,
name: '直接访问',
{
value: 335,
name: '直接访问',
itemStyle: {
color: 'rgba(9,71,198,0.6)'
},
},
}
}
],
emphasis: {
itemStyle: {
......@@ -78,24 +78,24 @@ const storeFlowOption = {
}
function insertBr(text) {
if(text.length <= 8){
return text;
}else if(text.length > 8 && text.length <= 16){
return text = `${text.slice(0,8)}\n${text.slice(8)}\n`
}else if(text.length > 16 && text.length <= 24){
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16)}\n`
}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)}\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`
if (text.length <= 8) {
return text
} else if (text.length > 8 && text.length <= 16) {
return text = `${text.slice(0, 8)}\n${text.slice(8)}\n`
} else if (text.length > 16 && text.length <= 24) {
return text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(16)}\n`
} 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)}\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) {
if(text.length <= 30){
return text;
}else if(text.length > 30){
return text = `${text.slice(0,30)}</br>${text.slice(30)}`
if (text.length <= 30) {
return text
} else if (text.length > 30) {
return text = `${text.slice(0, 30)}</br>${text.slice(30)}`
}
}
......
......@@ -244,11 +244,11 @@ export default {
// 注意 这里的演示没有传验证码
// 具体需要传递的数据请自行修改代码
this.login(_p)
.then(async ({ isMutiAccount, accountInfo, userInfo }) => {
if(isMutiAccount) {
this.isMutiAccount = isMutiAccount
this.accountInfo = accountInfo
this.loginToken = accountInfo.loginToken
.then(async({ isMutiAccount, accountInfo, userInfo }) => {
if (isMutiAccount) {
this.isMutiAccount = isMutiAccount
this.accountInfo = accountInfo
this.loginToken = accountInfo.loginToken
} else {
const _current = userInfo.detail.accountType !== 7 ? await this.current() : '/onlineAccountList'
await this.initBaseData()
......
......@@ -32,7 +32,7 @@
import { getDetailApi } from '@api/publicAccount'
export default {
name: 'accountDetail',
data () {
data() {
return {
detailForm: {},
// 图片对于字段
......@@ -200,7 +200,7 @@ export default {
},
watch: {
accountDetailVisible (newVal) {
accountDetailVisible(newVal) {
if (newVal) {
this.merchantId = this.merchantRow.merchantId
this.getDetail()
......@@ -208,13 +208,13 @@ export default {
}
},
mounted () {
mounted() {
this.merchantId = this.merchantRow.merchantId
this.getDetail()
},
methods: {
getDetail () {
getDetail() {
getDetailApi({ merchantId: this.merchantId }).then(res => {
// console.log(res)
this.currentPage = res.yseMerchantInfo ? res.yseMerchantInfo.custType : 'O'
......
......@@ -159,7 +159,7 @@ import { uploadImg, imgRecognitionApi, getBankListApi, getYseBankListApi, sendTo
import { registerYseMerchantApi, draftYseMerchantApi, getDetailApi } from '@api/publicAccount'
export default {
name: 'applyAccount',
data () {
data() {
var checkPhoneObj = {
required: true,
validator: (rule, value, callback) => {
......@@ -641,7 +641,7 @@ export default {
glUploadImg
},
mounted () {
mounted() {
if (this.$route.params.merchantId) {
this.targetAccount = this.$route.params
sessionStorage.setItem(this.sessionName, JSON.stringify(this.$route.params))
......@@ -681,7 +681,7 @@ export default {
close: 'd2admin/page/close'
}),
// 获取详情,数据恢复
getDetail () {
getDetail() {
getDetailApi({ merchantId: this.targetAccount.merchantId }).then(res => {
// console.log(res)
if (res.yseMerchantInfo) {
......@@ -750,19 +750,19 @@ export default {
})
},
// 开户行
getBankList () {
getBankList() {
getBankListApi({}).then(res => {
this.formList[this.findFormIdx('bankType')].optionList = res
})
},
// 支行
getYseBankList () { },
getYseBankList() { },
// 找到在formList的位置,通过name来匹配
findFormIdx (name) {
findFormIdx(name) {
return this.formList.findIndex(item => item.name === name)
},
// 切换radio后,将obj里面的图片写入editForm
afterChangePic () {
afterChangePic() {
// this[this.typeToForm[this.custType]]
var picKeys = Object.keys(this.picObj)
picKeys.forEach(item => {
......@@ -776,7 +776,7 @@ export default {
// console.log(this.picObj)
},
// 切换radio/编辑,开户行恢复opt数据
recoveryOpenAccBank () {
recoveryOpenAccBank() {
this.formList[this.findFormIdx('openAccBankType')].optionList = this.editForm.openAccBankType ? [{ branchBankType: this.editForm.openAccBankType, branchBankName: this.editForm.openAccBankName }] : []
},
// 上传/删除图片后,将图片的值写入Obj中
......@@ -785,7 +785,7 @@ export default {
// ? (this.editForm.papers[this.picObj[attrName].attrName] = this.picObj[attrName].url)
// : delete this.editForm.papers[this.picObj[attrName].attrName]
// },
handleImgChange ({ file, attrName, targetItem }) {
handleImgChange({ file, attrName, targetItem }) {
var hasFnList = ['idCard', 'idCardBack', 'bankCard', 'businessLicense']
var reader = new FileReader()
var fileInfo = file.raw
......@@ -804,18 +804,18 @@ export default {
})
}
},
handleImgRemove ({ attrName, targetItem }) {
handleImgRemove({ attrName, targetItem }) {
this.picObj[attrName].url = ''
delete this.editForm.papers[this.picObj[attrName].attrName]
// this.writeToEditForm(attrName, false)
// this.$refs.editFormRef.$refs.editFrom.validateField(targetItem.name)
},
handlePreview (file, attrName) {
handlePreview(file, attrName) {
// console.log(file)
// console.log(attrName)
},
// 验证码
handleSend () {
handleSend() {
sendToSmsCodeApi({ phone: this.editForm.operPhone }).then((res) => {
this.notice.okTips('已发送,30分钟内有效')
this.isSend = true
......@@ -824,7 +824,7 @@ export default {
this.msgDown()
})
},
msgDown () {
msgDown() {
this.time = setTimeout(() => {
clearTimeout(this.time)
if (this.sendMsg > 1) {
......@@ -836,7 +836,7 @@ export default {
}, 1000)
},
// 自动识别type - 识别类型(1:身份证;2:银行卡;3:营业执照);imgUrl - 图片地址
handleAutoRecognition (type, imgUrl, needWriteList) {
handleAutoRecognition(type, imgUrl, needWriteList) {
// console.log(type)
// console.log(imgUrl)
imgRecognitionApi({ type: type, imgUrl: imgUrl }).then(res => {
......@@ -865,7 +865,7 @@ export default {
}
})
},
getParams () {
getParams() {
var params = _.cloneDeep(this.editForm)
params.merchantId = this.targetAccount.merchantId
// 身份证日期
......@@ -886,11 +886,11 @@ export default {
return params
},
jumpScroll (idName) {
jumpScroll(idName) {
document.getElementById(idName).scrollIntoView()
},
// 确认
handleConfirm () {
handleConfirm() {
var params = this.getParams()
var picKeys = Object.keys(this.picObj)
for (var item of picKeys) {
......@@ -912,7 +912,7 @@ export default {
})
},
// 存草稿
handleDraft () {
handleDraft() {
var params = this.getParams()
draftYseMerchantApi(params).then(res => {
this.notice.okTips()
......@@ -920,11 +920,11 @@ export default {
})
},
// 删除session
deleteSession () {
deleteSession() {
sessionStorage.removeItem(this.sessionName)
},
// 取消
handleCancel () {
handleCancel() {
this.isSend = false
this.time && clearTimeout(this.time)
this.deleteSession()
......
......@@ -176,7 +176,7 @@ export default {
name: 'merchantId',
type: 'input',
placeholder: '请输入商户号',
isClear: true,
isClear: true
// keyFn: this.keyDowmGetList
}],
getListApi: getList,
......
......@@ -289,7 +289,7 @@ export default {
},
changeDate(date) {
console.log(date);
console.log(date)
var params = {}
params.merchantId = this.merchantInfo.merchantId
params.entryDate = date
......
......@@ -114,7 +114,7 @@ export default {
label: '姓名/名称'
}, {
name: 'merchantName',
label: '所属商户'
label: '所属商户'
}
// {
// parentName: 'role',
......
......@@ -300,7 +300,7 @@ export default {
// merchant: serviceItem
}
// console.log(params)
addParentMerchant({data: params}).then(res => {
addParentMerchant({ data: params }).then(res => {
this.notice.okTips()
this.handleRelateClose()
this.keyDowmGetList()
......
......@@ -24,7 +24,7 @@
import { showToast } from '@/common/util'
import {
GETYQMERCHANTCONFIGDETAIL,
UPDATEYQMERCHANTCONFIG,
UPDATEYQMERCHANTCONFIG
} from '@api/serviceManage'
export default {
data() {
......@@ -33,10 +33,10 @@ export default {
{ id: 2, name: '门店收款', disabled: false },
{ id: 3, name: 'POS机收款', disabled: false },
{ id: 0, name: '不升级', disabled: true },
{ id: 1, name: '微信支付', disabled: false },
{ id: 1, name: '微信支付', disabled: false }
// { id: 4, name: '支付宝支付', disabled: false },
],
checkList: [0],
checkList: [0]
}
},
mounted() {
......@@ -45,8 +45,8 @@ export default {
methods: {
// 获取园区店配置
getInfo() {
let o = this.$route.query
let oParams = {}
const o = this.$route.query
const oParams = {}
oParams.yqMerchantId = o.yqMerchantId
GETYQMERCHANTCONFIGDETAIL(oParams).then((res) => {
this.checkList = res.supportPayTypes || []
......@@ -57,8 +57,8 @@ export default {
// 监听支付方式勾选
onChange(list) {
console.log(list)
let olist = this.pageTypeList
let idx = list.findIndex((k) => k == 3)
const olist = this.pageTypeList
const idx = list.findIndex((k) => k == 3)
// 初始化,所有设置可选
olist.map((k) => {
......@@ -68,7 +68,7 @@ export default {
return k
})
//如果包含 POS机收款,则不能选择微信、支付宝
// 如果包含 POS机收款,则不能选择微信、支付宝
if (idx >= 0) {
olist.map((k) => {
if (k.id == 1 || k.id == 4) {
......@@ -78,7 +78,7 @@ export default {
})
}
//如果包含 微信、支付宝,则不能选择POS机收款
// 如果包含 微信、支付宝,则不能选择POS机收款
if (list.indexOf(1) >= 0 || list.indexOf(4) >= 0) {
olist.map((k) => {
if (k.id == 3) {
......@@ -99,31 +99,31 @@ export default {
saveInfo() {
if (!this.checkList || this.checkList.length <= 0) {
showToast({
message: '请选择支付方式',
message: '请选择支付方式'
})
return false
}
if (this.checkList.indexOf(3) < 0 && this.checkList.indexOf(1) < 0) {
showToast({
message: '微信支付和pos机收款必须选择一个',
message: '微信支付和pos机收款必须选择一个'
})
return false
}
let oParams = {}
const oParams = {}
oParams.yqMerchantId = this.$route.query.yqMerchantId
oParams.supportPayTypes = this.checkList
UPDATEYQMERCHANTCONFIG(oParams).then((res) => {
console.log(res)
showToast({
message: '保存成功',
type: 'success',
type: 'success'
})
this.goBack()
})
},
},
}
}
}
</script>
<style lang="scss" scoped>
......
......@@ -165,7 +165,7 @@ export default {
}, {
confId: 8,
confLabel: '虚拟园区店'
}],
}]
}
}
},
......@@ -228,7 +228,7 @@ export default {
)
}
})
},
}
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!