Commit a4c90257 by 前端

Merge branch 'v4.27.0' into 'master'

V4.27.0

See merge request !7
2 parents 1c082ec1 c7adcd28
...@@ -1895,51 +1895,6 @@ ...@@ -1895,51 +1895,6 @@
"integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
"dev": true "dev": true
}, },
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"ssri": { "ssri": {
"version": "8.0.1", "version": "8.0.1",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz",
...@@ -1948,28 +1903,6 @@ ...@@ -1948,28 +1903,6 @@
"requires": { "requires": {
"minipass": "^3.1.1" "minipass": "^3.1.1"
} }
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
} }
} }
}, },
...@@ -13414,6 +13347,75 @@ ...@@ -13414,6 +13347,75 @@
} }
} }
}, },
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-router": { "vue-router": {
"version": "3.6.5", "version": "3.6.5",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.6.5.tgz", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.6.5.tgz",
......
const path = require('path')
class copyDir {
apply(compiler) {
// done是webpack 得编译完成周期
compiler.hooks.afterEmit.tap('DonePlugins', function(stats) {
// console.log('编译完成!!')
// 因为写在文件夹里面 要找外面的文件要加../
// 删除element
removeDir(`${__dirname}/../dist/static/css`)
// cpSync(
// path.join(__dirname, '../copyDirTarget'),
// path.join(__dirname, '../dist')
// )
// cpSync(
// path.join(__dirname, '../copyDirTarget'),
// path.join(__dirname, '../dist//dj-carlife-web')
// )
// removeDir(`${__dirname}/../copyDirTarget`)
})
}
}
/** 主要版本 */
const major = process.version.match(/v([0-9]*).([0-9]*)/)[1]
/** 特性版本 */
const minor = process.version.match(/v([0-9]*).([0-9]*)/)[2]
/**
* 文件夹复制
* @param {string} source 源文件夹
* @param {string} destination 目标文件夹
*/
function cpSync(source, destination) {
const fs = require('fs')
// console.log('source', source)
// 判断node版本不是16.7.0以上的版本
// 则进入兼容处理
// 这样处理是因为16.7.0的版本支持了直接复制文件夹的操作
if (Number(major) < 16 || (Number(major) == 16 && Number(minor) < 7)) {
// 如果存在文件夹 先递归删除该文件夹
if (fs.existsSync(destination)) fs.rmSync(destination, { recursive: true })
// 新建文件夹 递归新建
fs.mkdirSync(destination, { recursive: true })
// 读取源文件夹
const rd = fs.readdirSync(source)
// console.log('rd', rd)
for (const fd of rd) {
// 循环拼接源文件夹/文件全名称
const sourceFullName = source + '/' + fd
// 循环拼接目标文件夹/文件全名称
const destFullName = destination + '/' + fd
// 读取文件信息
const lstatRes = fs.lstatSync(sourceFullName)
// 是否是文件
if (lstatRes.isFile()) fs.copyFileSync(sourceFullName, destFullName)
// 是否是文件夹
if (lstatRes.isDirectory()) cpSync(sourceFullName, destFullName)
}
} else fs.cpSync(source, destination, { force: true, recursive: true })
}
/**
* @caption 删除本地文件夹/文件
* @param {String} directoryPath 例: d://x/x/x.json 或者 d://x/x/x
*/
function removeDir(directoryPath) {
const fs = require('fs')
fs.readdir(directoryPath, (err, files) => {
if (err) {
console.error('读取目录失败:', err)
return
}
if (files.length === 0) {
console.log('目录为空,没有文件可删除。')
return
}
const lastFile = files[files.length - 1]
const filePath = path.join(directoryPath, lastFile)
fs.unlink(filePath, err => {
if (err) {
console.error('删除文件失败:', err)
} else {
console.log('最后一个文件已被成功删除。')
}
})
})
// 判断文件是否存在
// require('fs').existsSync(directoryPath) && dleteDir()
// function dleteDir() {
// const files = fs.readdirSync(directoryPath)
// for (var i = 0; i < files.length; i++) {
// const newPath = path.join(directoryPath, files[i])
// const stat = fs.statSync(newPath)
// if (stat.isDirectory()) {
// // 如果是文件夹就递归下去
// removeDir(newPath)
// } else {
// // 删除文件
// fs.unlinkSync(newPath)
// }
// }
// fs.rmdirSync(directoryPath) // 如果文件夹是空的,就将自己删除掉
// }
}
module.exports = copyDir
const removeDir = require('./removeFn')
class AsyncRomveDir {
apply(compiler) {
// console.log('自定义异步组件');
compiler.hooks.afterEmit.tapAsync('AsyncPlugin', (compilation, cb) => {
setTimeout(() => {
// console.log()
removeDir(`${__dirname}/../copyDirTarget`)
cb()
}, 5000)
})
}
}
module.exports = AsyncRomveDir
/**
* @caption 删除本地文件夹/文件
* @param {String} directoryPath 例: d://x/x/x.json 或者 d://x/x/x
*/
function removeDir(directoryPath) {
const fs = require('fs')
const path = require('path')
// 判断文件是否存在
require('fs').existsSync(directoryPath) && dleteDir()
function dleteDir() {
const files = fs.readdirSync(directoryPath)
for (var i = 0; i < files.length; i++) {
const newPath = path.join(directoryPath, files[i])
const stat = fs.statSync(newPath)
if (stat.isDirectory()) {
// 如果是文件夹就递归下去
removeDir(newPath)
} else {
// 删除文件
fs.unlinkSync(newPath)
}
}
fs.rmdirSync(directoryPath) // 如果文件夹是空的,就将自己删除掉
}
}
module.exports = removeDir
import { http } from '@/main'
// 批量下发
const batchIssueApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smarcarlife.employeePerformanceResult.batchIssue'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 查看明细
const getDetailApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smarcarlife.employeePerformanceResult.detail'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 绩效校正
const correctApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smarcarlife.employeePerformanceResult.correct'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 导出明细表
const exportDetailApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smarcarlife.employeePerformanceResult.exportDetail'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 导出汇总表
const exportSummaryApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smarcarlife.employeePerformanceResult.exportSummary'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 分页查询员工绩效
const getListApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smarcarlife.employeePerformanceResult.page'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
export default { batchIssueApi, getDetailApi, correctApi, exportDetailApi, exportSummaryApi, getListApi }
import { http } from '@/main'
// 分页查询服务中心信息
const getList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smartcarlife.serviceCenter.page'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 分页查询开店审核记录
const getReviewList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smartcarlife.createMerchant.review.page'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 查询商户详情
const getMerchantInfo = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smartcarlife.merchantCustomer.merchantInfo'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 创建服务中心
const saveServiceCenter = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smartcarlife.serviceCenter.save'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 更新服务中心
const updateServiceCenter = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smartcarlife.serviceCenter.update'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// // 根据场景查询产品
// const findProByScene = params => {
// params.method = `scrm.api.busassistant.activity.productByscene`
// return http({
// url: 'rop-scrm-busassistant/router',
// method: 'POST',
// data: params,
// sign: true
// })
// }
// // 查询场景和产品的开通状态
// const getSceneProStatus = params => {
// params.method = `scrm.api.busassistant.activity.findSceneProductStatus`
// return http({
// url: 'rop-scrm-busassistant/router',
// method: 'POST',
// data: params,
// sign: true
// })
// }
// // 查看客户销售顾问:
// const getStaffList = params => {
// params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
// params.routerMethod = 'dj.api.smartcarlife.staff.searchStaffPage'
// return http({
// url: 'rop-scrm-boutiquecoupon/router',
// method: 'POST',
// data: params,
// sign: true
// })
// }
// // 创建邀请销售顾问二维码
// const getInviteCode = params => {
// params.method = `scrm.api.busassistant.merchantCustomer.inviteCode`
// return http({
// url: 'rop-scrm-busassistant/router',
// method: 'POST',
// data: params,
// sign: true
// })
// }
export default { getList, getReviewList, saveServiceCenter, updateServiceCenter, getMerchantInfo }
import { http } from '@/main'
// 分页查询客户信息
const getList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smartcarlife.merchant.staff.page'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取服务中心下拉筛选 所有服务商数据
const getServiceCenterList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.businessAssistant.serviceCenter.listByServiceMerchantId'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 根据园区店商户号获取4s列表(包含超管权限)
const getSimpleMerchantListByPage = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.scenemerchantref.query4SRefByYqShopPageIncludeAdmin`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 查询员工详情
const getMerchantInfo = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smartcarlife.merchant.staff.performanceConfig.detail'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 新增客户
const createMerchantStaff = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smartcarlife.merchant.staff.save'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 编辑客户
const updateMerchantStaff = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smartcarlife.merchant.staff.update'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getList, getServiceCenterList, getSimpleMerchantListByPage, getMerchantInfo, createMerchantStaff, updateMerchantStaff }
$--color-primary: #5850ff !default;
/* 改变 icon 字体路径变量,必需 */
$--font-path: '~element-ui/lib/theme-chalk/fonts';
@import "~element-ui/packages/theme-chalk/src/index";
\ No newline at end of file \ No newline at end of file
...@@ -7,12 +7,18 @@ export function getCurrentSixMonth(n = 5) { ...@@ -7,12 +7,18 @@ export function getCurrentSixMonth(n = 5) {
export function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, maxValue, regRule) { export function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, maxValue, regRule) {
var reg = { var reg = {
priceReg: /^\d[\d\.]*$/, // eslint-disable-line priceReg: /^\d[\d\.]*$/, // eslint-disable-line
numReg: /^[1-9]\d*$/ numReg: /^[1-9]\d*$/,
burdenNumReg: /^([-+])?\d+(\.[0-9]{1,2})?$/ //允许负数
// burdenNumReg: /^[+-]?\d+(\.\d+)?$/ //允许负数
} }
regRule = regRule || 'priceReg' regRule = regRule || 'priceReg'
if (newValue && ((minValue && newValue < minValue) || (maxValue && newValue > maxValue))) { if (newValue && ((minValue && newValue < minValue) || (maxValue && newValue > maxValue))) {
return oldValue || '' return oldValue || ''
} }
console.log(regRule)
console.log(reg[regRule])
console.log(reg[regRule].test(newValue + ''))
if (newValue && reg[regRule].test(newValue + '')) { if (newValue && reg[regRule].test(newValue + '')) {
if (/\./.test(newValue)) { if (/\./.test(newValue)) {
newValue = newValue + '' newValue = newValue + ''
...@@ -54,3 +60,20 @@ export const afterTodayOptions = { ...@@ -54,3 +60,20 @@ export const afterTodayOptions = {
return false return false
} }
} }
/**
* url下载文件
*
*/
export function downLoadFile(url) {
// console.log(row)
// return
const Temp = document.createElement('a')
// Temp.href = process.env.VUE_APP_BASE_URL + '/article/export.do?articleId=' + row.id
Temp.href = url + '?timestamp=' + new Date().getTime()
// console.log(url)
// console.log(Temp.href)
document.body.append(Temp)
Temp.click()
document.body.removeChild(Temp)
}
// import Vue from 'vue'
import { Message, MessageBox, Loading } from 'element-ui'
// import moment from 'moment'
import dayjs from 'dayjs'
let loadingInstance = ''
export const Util = {
/**
* 简单alert
* title 标题
* message 内容
* className 自定义class
* showCancelButton 是否展示取消按钮
* confirmButtonText 确认按钮文案
* cancelButtonText 取消按钮文案
* confirmButtonColor 确认按钮颜色
* cancelButtonColor 取消按钮颜色
*/
msg: function(options) {
MessageBox({
title: options.title || '',
type: options.type || 'error',
message: options.message || '',
className: options.className || '',
showCancelButton: options.showCancelButton || false,
confirmButtonText: options.confirmButtonText || '确认',
cancelButtonText: options.cancelButtonText || '取消',
confirmButtonColor: options.confirmButtonColor || '#1989fa',
cancelButtonColor: options.cancelButtonColor || '#000',
dangerouslyUseHTMLString: true,
callback: function(action, done) {
if (action == 'confirm') {
if (options.success) {
options.success(done)
}
} else {
console.log(done)
// done()
}
}
})
/* Vue.$vux.alert.show({
title: options.title||'',
content: options.message||'',
onShow() {
options.onShow?(options.onShow)():'';
},
onHide() {
options.onHide?(options.onHide)():'';
}
}) */
},
/**
* 提示框
*/
Info: function(options) {
Message({
message: options.message || '提示',
type: options.type || 'error',
duration: options.time || 2000,
onClose: options.onClose || ''
})
},
/**
* 轻提示
*/
Tips: function(options) {
Message({
message: options.message || '提示',
duration: options.duration || 3000,
type: options.type || 'text',
icon: options.icon || ''
})
},
/**
* loading
*/
loading: function(message) {
loadingInstance = Loading.service({
text: message || '加载中...'
})
},
/**
* 关闭loading
*/
closeLoading: function() {
loadingInstance.close()
},
/**
* 校验手机号码格式
*/
checkPhone: function(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) {
const reg = /^0[\d]{2,3}-[\d]{7,8}$/
return reg.test(tel)
},
/**
* 是否特殊字符
*/
isSpecialLetter: function(str) {
const reg = new RegExp("[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]")
return reg.test(str)
},
/**
* 只能输入英文字母和数字,不能输入中文
*/
validationInput: function(str) {
const reg = /[^\w\.\/]/gi // eslint-disable-line
return reg.test(str)
},
/**
* 获取当前时间
*/
getCurrentDate: function() {
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) {
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) {
const date1 = new Date()
const date2 = new Date(date1)
let time = 30
if (day) {
time = day
}
date2.setDate(date1.getDate() + time)
const _date = date2.getFullYear() + '-' + (date2.getMonth() + 1) + '-' + date2.getDate()
return {
date: _date,
year: date2.getFullYear(),
month: date2.getMonth() + 1,
day: date2.getDate()
}
},
/**
* 日期格式转换
*/
dateFormate: function(str, type) {
let txt = 'YYYY-MM-DD'
if (type) {
txt = type
}
const m = dayjs(str).format(txt)
return m
},
/**
* 字段截取
*/
cutStr: function(str, num) {
if (!str) {
return ''
}
let m = 10
let n = str
if (num) {
m = num
}
if (str.length > m) {
n = str.slice(0, m) + '...'
}
return n
},
// /**
// * 深克隆 所有原型链上的对象和属性
// * 例: const bar=deepClone(foo)
// * console.log(bar===foo) false
// * @param {*} obj
// */
// deepClone: function(obj) {
// const clone = require('rfdc')({ proto: false, circles: false })
// return clone(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
// if (obj instanceof Date) {
// const copy = new Date()
// copy.setTime(obj.getTime())
// return copy
// }
// // Handle Array or Object
// if ((obj instanceof Array) | (obj instanceof Object)) {
// const copy = obj instanceof Array ? [] : {}
// for (var attr in obj) {
// // if (Object.prototype.hasOwnProperty.call(attr)) {
// if (obj.hasOwnProperty(attr)) {
// copy[attr] = Util.deepClone(obj[attr])
// // console.log("copy[attr] ", copy[attr])
// }
// }
// return copy
// }
// throw new Error("Unable to clone obj! Its type isn't supported.")
// },
// /**
// * url下载文件
// *
// */
// downLoadFile: function(url) {
// // console.log(row)
// // return
// const Temp = document.createElement('a')
// // Temp.href = process.env.VUE_APP_BASE_URL + '/article/export.do?articleId=' + row.id
// Temp.href = url + '?timestamp=' + new Date().getTime()
// // console.log(url)
// // console.log(Temp.href)
// document.body.append(Temp)
// Temp.click()
// document.body.removeChild(Temp)
// },
/**
* @param {Object} json
* @param {Object} type: 默认不传 ==>全部小写;传1 ==>全部大写;传2 ==>首字母大写
* 将json的key值进行大小写转换
*/
jsonKeysToCase: function(json, type) {
if (typeof json == 'object') {
var tempJson = JSON.parse(JSON.stringify(json))
toCase(tempJson)
return tempJson
} else {
return json
}
function toCase(json) {
if (typeof json == 'object') {
if (Array.isArray(json)) {
json.forEach(function(item) {
toCase(item)
})
} else {
for (var key in json) {
var item = json[key]
if (typeof item == 'object') {
toCase(item)
}
delete json[key]
switch (type) {
case 1:
// key值全部大写
json[key.toLocaleUpperCase()] = item
break
case 2:
// key值首字母大写,其余小写
json[key.substring(0, 1).toLocaleUpperCase() + key.substring(1).toLocaleLowerCase()] = item
break
default:
// 默认key值全部小写
json[key.toLocaleLowerCase()] = item
break
}
}
}
}
}
},
// 判断字段为空时显示
fieldShow: function(field, show) {
return field || show
},
// 整数补零显示两位小数
returnFloat: function(num) {
num = num.toString()
if (num.indexOf('.') != -1) {
let newVal = num.split('.')
if (newVal[1].length == 1) {
newVal = newVal.join('.')
newVal += '0'
num = newVal
}
} else {
num += '.00'
}
return num
}
}
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
// export const downLoadFile = Util.downLoadFile
export const returnFloat = Util.returnFloat
<!-- 驻店绩效-校正弹窗 -->
<template>
<GLDialog title="校正"
mode="mid"
:visible.sync="isVisible"
:before-close="handleClose"
v-loading="loading"
@onOk="handleConfirm"
@onCancel="handleClose">
<div>
<glsx-combi-form class="edit-form-container m-r-20"
ref="editFormRef"
:labelWidth="defaultLabelWidth"
:isBlock="true"
:formRef="editChildRef"
:formObj="editForm"
:formData="editFormData"
:formRules="editRule">
</glsx-combi-form>
</div>
</GLDialog>
</template>
<script>
import { limitPrice } from '@/common/format'
export default {
name: 'ResidentCorrectionDialog',
data() {
return {
editChildRef: 'editChildRef',
editForm: {
customerUnitPrice: '',
successRate: '',
otherExpenses: '',
},
oldVal: {
customerUnitPrice: '',
successRate: '',
otherExpenses: '',
},
editRule: {
customerUnitPrice: [{ required: true, message: '请输入当月平均客单价', trigger: 'change' }],
successRate: [{ required: true, message: '请输入当月成交率', trigger: 'change' }],
otherExpenses: [{ required: true, message: '请输入其他费用', trigger: 'change' }],
},
editFormData: [
{
label: '当月平均客单价/元',
name: 'customerUnitPrice',
type: 'input',
width: '432px',
inputFn: (value, item) => {
this.handleCustomerUnitPrice(value)
}
},
{
label: '当月成交率/%',
name: 'successRate',
type: 'input',
width: '432px',
inputFn: (value, item) => {
this.handleSuccessRatee(value)
}
},
{
label: '其他费用/元',
name: 'otherExpenses',
type: 'input',
width: '432px',
inputFn: (value, item) => {
this.handleOtherExpenses(value)
}
},
],
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
recordInfo: {
type: Object,
default: () => { }
}
},
methods: {
handleCustomerUnitPrice(newVal) {
this.editForm.customerUnitPrice = limitPrice(newVal, this.oldVal.customerUnitPrice, 9, 2, 0, 999999)
this.oldVal.customerUnitPrice = this.editForm.customerUnitPrice
},
handleSuccessRatee(newVal) {
this.editForm.successRate = limitPrice(newVal, this.oldVal.successRate, 6, 2, 0, 100)
this.oldVal.successRate = this.editForm.successRate
},
handleOtherExpenses(newVal) {
this.editForm.otherExpenses = limitPrice(newVal, this.oldVal.otherExpenses, 10, 2, -999999, 999999, 'burdenNumReg')
this.oldVal.otherExpenses = this.editForm.otherExpenses
},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.editForm)
params.id = this.recordInfo.id
console.log(params);
this.$apis.performanceManage.correctApi(params)
.then(res => {
this.$notify({
type: 'success',
title: res.message || '操作成功'
})
this.handleClose()
})
}
})
},
handleClose() {
this.$emit('handleClose')
}
}
}
</script>
<style scoped>
</style>
<!-- 驻店绩效-查看明细弹窗 -->
<template>
<GLDialog class="apply-store"
bigTitle="查看明细"
mode="big"
:visible.sync="isVisible"
:before-close="handleClose"
v-loading="loading"
:hasFooter="false">
<div>
<slot name="search"></slot>
<GLTable ref="storeRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun">
<div class="tb-ellipsis"
slot="customerName"
slot-scope="scope">
<el-popover placement="top"
popper-class="base-popper"
trigger="hover"
:content="scope.scope.customerName">
<span slot="reference">
{{ scope.scope.customerName }}
</span>
</el-popover>
</div>
</GLTable>
</div>
</GLDialog>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
export default {
name: 'ResidentDetailDialog',
data() {
return {
// 表格组件
userInfo: {},
tableSearchForm: {},
url: url,
getListApi: this.$apis.performanceManage.getDetailApi,
// 表格参数
tableParams: {
listName: 'list',
tableColumns: [
{
label: '订单编码',
prop: 'orderCode',
width: 180
},
{
label: '支付时间',
prop: 'orderTime',
width: '180px',
formatter: cellValue => {
return cellValue.orderTime ? dayjs(cellValue.orderTime).format('YYYY-MM-DD HH:mm:ss') : '--'
}
},
{
label: '客户名称',
prop: 'customerName',
addHtml: 'customerName',
minWidth: 120
},
{
label: '客户手机号',
prop: 'customerPhone',
width: 130
},
{
label: '订单产值',
prop: 'orderMoney',
width: 100,
formatter: cellValue => {
return cellValue.orderMoney || cellValue.orderMoney == 0 ? cellValue.orderMoney.toFixed(2) : '-'
}
},
{
label: '提成奖励',
prop: 'commissionBonus',
width: 100,
formatter: cellValue => {
return cellValue.commissionBonus || cellValue.commissionBonus == 0 ? cellValue.commissionBonus.toFixed(2) : '-'
}
},
{
label: '高客单奖励',
prop: 'highCustomerUnitBonus',
width: 120,
formatter: cellValue => {
return cellValue.highCustomerUnitBonus || cellValue.highCustomerUnitBonus == 0 ? cellValue.highCustomerUnitBonus.toFixed(2) : '-'
}
},
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
searchForm: {
type: Object,
default: () => { }
},
recordInfo: {
type: Object,
default: () => { }
}
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
// this.tableSearchForm.staffUuid = this.recordInfo.staffUuid
// this.tableSearchForm.performanceMonth = this.recordInfo.performanceMonth
this.tableSearchForm.id = this.recordInfo.id
resolve()
})
},
handleClose() {
this.$emit('handleClose')
}
}
}
</script>
<style scoped>
</style>
<!-- 技师绩效-校正弹窗 -->
<template>
<GLDialog title="校正"
mode="mid"
:visible.sync="isVisible"
:before-close="handleClose"
v-loading="loading"
@onOk="handleConfirm"
@onCancel="handleClose">
<div>
<glsx-combi-form class="edit-form-container m-r-20"
ref="editFormRef"
:labelWidth="defaultLabelWidth"
:isBlock="true"
:formRef="editChildRef"
:formObj="editForm"
:formData="editFormData"
:formRules="editRule">
</glsx-combi-form>
</div>
</GLDialog>
</template>
<script>
import { limitPrice } from '@/common/format'
export default {
name: 'TechnicianCorrectionDialog',
data() {
return {
editChildRef: 'editChildRef',
editForm: {
otherExpenses: '',
},
oldVal: {
otherExpenses: '',
},
editRule: {
otherExpenses: [{ required: true, message: '请输入其他费用', trigger: 'change' }],
},
editFormData: [
{
label: '其他费用/元',
name: 'otherExpenses',
type: 'input',
width: '432px',
inputFn: (value, item) => {
this.handleOtherExpenses(value)
}
},
],
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
recordInfo: {
type: Object,
default: () => { }
}
},
methods: {
handleOtherExpenses(newVal) {
this.editForm.otherExpenses = limitPrice(newVal, this.oldVal.otherExpenses, 10, 2, -999999, 999999, 'burdenNumReg')
this.oldVal.otherExpenses = this.editForm.otherExpenses
},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.editForm)
params.id = this.recordInfo.id
console.log(params);
this.$apis.performanceManage.correctApi(params)
.then(res => {
this.$notify({
type: 'success',
title: res.message || '操作成功'
})
this.handleClose()
})
}
})
},
handleClose() {
this.$emit('handleClose')
}
}
}
</script>
<style scoped>
</style>
<!-- 技师绩效-查看明细弹窗 -->
<template>
<GLDialog class="apply-store"
bigTitle="查看明细"
mode="big"
:visible.sync="isVisible"
:before-close="handleClose"
v-loading="loading"
:hasFooter="false">
<div>
<slot name="search"></slot>
<GLTable ref="storeRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun">
<div class="tb-ellipsis"
slot="customerName"
slot-scope="scope">
<el-popover placement="top"
popper-class="base-popper"
trigger="hover"
:content="scope.scope.customerName">
<span slot="reference">
{{ scope.scope.customerName }}
</span>
</el-popover>
</div>
</GLTable>
</div>
</GLDialog>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
export default {
name: 'TechnicianDetailDialog',
data() {
return {
// 表格组件
userInfo: {},
tableSearchForm: {},
url: url,
getListApi: this.$apis.performanceManage.getDetailApi,
// 表格参数
tableParams: {
listName: 'list',
tableColumns: [
{
label: '订单编码',
prop: 'orderCode',
width: 180
},
{
label: '订单类型',
prop: 'upgradeFlag',
width: 100,
formatter: cellValue => {
return this.baseData.upgradeFlagList.find((item) => item.confId === cellValue.upgradeFlag).confName || "-"
}
},
{
label: '支付时间',
prop: 'orderTime',
width: '180px',
formatter: cellValue => {
return cellValue.orderTime ? dayjs(cellValue.orderTime).format('YYYY-MM-DD HH:mm:ss') : '--'
}
},
{
label: '客户名称',
prop: 'customerName',
addHtml: 'customerName',
minWidth: 120
},
{
label: '客户手机号',
prop: 'customerPhone',
width: 130
},
{
label: '订单产值',
prop: 'orderMoney',
width: 100,
formatter: cellValue => {
return cellValue.orderMoney || cellValue.orderMoney == 0 ? cellValue.orderMoney.toFixed(2) : '-'
}
},
{
label: '施工奖励',
prop: 'constructionBonus',
width: 100,
formatter: cellValue => {
return cellValue.constructionBonus || cellValue.constructionBonus == 0 ? cellValue.constructionBonus.toFixed(2) : '-'
}
}
],
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 基本数据
baseData: {
upgradeFlagList: [{
confId: 'Y',
confName: '升级'
},
{
confId: 'N',
confName: '战败'
}]
},
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
searchForm: {
type: Object,
default: () => { }
},
recordInfo: {
type: Object,
default: () => { }
}
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
// this.tableSearchForm.staffUuid = this.recordInfo.staffUuid
// this.tableSearchForm.performanceMonth = this.recordInfo.performanceMonth
this.tableSearchForm.id = this.recordInfo.id
resolve()
})
},
handleClose() {
this.$emit('handleClose')
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<GLTabs v-model="activeName"
:tabPaneList="tabPaneList"
@tab-click="handleClick"></GLTabs>
<components :is="tabName"></components>
</div>
</template>
<script>
import ResidentPerformance from './components/residentPerformance.vue'
import TechnicianPerformance from './components/technicianPerformance.vue'
export default {
components: {
ResidentPerformance,
TechnicianPerformance
},
data() {
return {
activeName: '1',
tabPaneList: [
{
label: '驻店绩效',
name: '1'
},
{
label: '技师绩效',
name: '2'
}
],
tabName: 'ResidentPerformance'
}
},
mounted() { },
computed: {},
watch: {},
methods: {
handleClick() {
let arr = {
1: 'residentPerformance',
2: 'technicianPerformance'
}
this.tabName = arr[+this.activeName]
console.log(this.tabName)
}
}
}
</script>
<style scoped lang="scss">
</style>
<!-- 我的开店申请弹窗 -->
<template>
<GLDialog class="apply-store" bigTitle="我的开店申请" mode="big" :visible.sync="isVisible" :before-close="handleClose" v-loading="loading" :hasFooter="false">
<div>
<slot name="search"></slot>
<GLTable ref="storeRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="tb-ellipsis" slot="merchantName" slot-scope="scope">
<el-popover placement="top" popper-class="base-popper" trigger="hover" :content="scope.scope.merchantName">
<span slot="reference">
{{ scope.scope.merchantName }}
</span>
</el-popover>
</div>
<div class="tb-ellipsis" slot="merchantAddress" slot-scope="scope">
<el-popover placement="top" popper-class="base-popper" trigger="hover" :content="scope.scope.merchantAddress">
<span slot="reference">
{{ scope.scope.merchantAddress }}
</span>
</el-popover>
</div>
<div slot="brand" slot-scope="scope">
<el-popover placement="top" popper-class="base-popper" trigger="hover" :content="scope.scope.merchantBrandNameList ? scope.scope.merchantBrandNameList.join('/') : '--'">
<span slot="reference" class="one-line-ellipsis">
{{ scope.scope.merchantBrandNameList ? scope.scope.merchantBrandNameList.join('/') : '--' }}
</span>
</el-popover>
</div>
<div class="tb-ellipsis" slot="yqMerchantName" slot-scope="scope">
<el-popover placement="top" popper-class="base-popper" trigger="hover" :content="scope.scope.yqMerchantName">
<span slot="reference">
{{ scope.scope.yqMerchantName }}
</span>
</el-popover>
</div>
<div slot="applyStatus" slot-scope="scope" class="flex">
<div :class="['dot', statusClass[scope.scope.reviewStatus]]"></div>
{{ reviewStatusObj[scope.scope.reviewStatus] }}
</div>
</GLTable>
</div>
</GLDialog>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
export default {
name: 'ApplyStoreDialog',
data() {
return {
// 表格组件
userInfo: {},
tableSearchForm: {},
url: url,
getListApi: this.$apis.customer.getReviewList,
// 表格参数
tableParams: {
listName: 'list',
tableColumns: [
{
label: '客户名称',
prop: 'merchantName',
addHtml: 'merchantName',
minWidth: 120
},
{
label: '联系人',
prop: 'contactName',
width: 120,
line: 1
},
{
label: '联系电话',
prop: 'phone',
width: 130
},
{
label: '地址',
prop: 'merchantAddress',
addHtml: 'merchantAddress',
minWidth: 120
},
{
label: '主营品牌',
prop: '',
width: 140,
line: 1,
addHtml: 'brand'
},
{
label: '所属服务中心',
prop: 'yqMerchantName',
addHtml: 'yqMerchantName',
minWidth: 120
},
{
label: '申请时间',
prop: 'createdDate',
width: '180px',
formatter: cellValue => {
return cellValue.createdDate ? dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss') : '--'
}
},
{
label: '申请状态',
prop: 'reviewStatus',
width: '100px',
addHtml: 'applyStatus'
},
{
label: '说明',
prop: 'rejectedReason',
width: 100,
line: 1
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
statusClass: {
1: '',
2: 'green',
3: 'red'
},
reviewStatusObj: {
1: '审核中',
2: '已通过',
3: '已驳回'
}
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
searchForm: {
type: Object,
default: () => { }
}
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm.merchantType = 2
this.tableSearchForm.partnerMerchantId = this.$globalState.session.merchantId
resolve()
})
},
handleClose() {
this.$emit('handleClose')
}
}
}
</script>
<style scoped>
.flex {
display: flex;
align-items: center;
}
.dot {
width: 6px;
height: 6px;
background: #5850ff;
border-radius: 4px;
margin-right: 6px;
}
.green {
background: #4aca74;
}
.red {
background: #eb4e4e;
}
</style>
<!-- 邀请销售顾问 -->
<template>
<GLDialog title="邀请销售顾问" mode="mid" :visible.sync="isVisible" :before-close="handleClose" @onOk="handleClose" @onCancel="handleClose">
<div class="share-dialog">
<div class="box">
<div class="title">邀请方式1:二维码邀请</div>
<div class="flex">
<img style="width: 118px; height: 118px;" :src="inviteData.qrcodeUrl" />
<el-button style="padding: 8px 0;" :size="size" type="text" @click="handleSaveImg(inviteData.qrcodeUrl)">下载图片</el-button>
</div>
</div>
<div class="box">
<div class="title">邀请方式2:链接邀请</div>
<span class="txt-blue">{{ inviteData.inviteUrl }}</span>
<el-button :size="size" type="text" @click="handleSaveTxt(inviteData.inviteUrl)">复制</el-button>
</div>
</div>
</GLDialog>
</template>
<script>
export default {
name: 'InviteDialog',
data() {
return {
inviteData: {}
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
inviteInfo: {
type: Object,
default: () => { }
}
// hideStatus: Boolean
},
mounted() {
this.getInviteCode()
},
methods: {
getInviteCode() {
let sceneStr = ''
let sceneToNum = {
SC001: 0,
SC002: 1,
SC003: 2,
SC004: 3
}
this.inviteInfo.sceneCodeList && this.inviteInfo.sceneCodeList.forEach(item => {
sceneStr = sceneStr + (sceneStr ? (',' + sceneToNum[item]) : sceneToNum[item])
})
let params = {
merchantId: this.inviteInfo.shopMerchantId,
staffLabel: sceneStr
}
this.$apis.customer.getInviteCode(params).then(res => {
this.inviteData = res
})
},
handleSaveImg(url, downloadTxt = '海报') {
var alink = document.createElement('a')
alink.href = url
alink.setAttribute('target', '_blank')
alink.download = downloadTxt
alink.click()
alink.remove()
},
handleSaveTxt(txt) {
this.$message({
message: '复制成功',
type: 'success',
customClass: 'message-Z-zinde'
})
const input = document.createElement('input')
document.body.appendChild(input)
input.setAttribute('value', txt)
input.select()
document.execCommand('Copy')
document.body.removeChild(input)
},
handleClose() {
this.$emit('handleClose')
}
}
}
</script>
<style scoped>
.share-dialog {
display: flex;
}
.share-dialog .flex {
display: flex;
align-items: flex-end;
}
.share-dialog .box {
box-sizing: border-box;
width: calc((100% - 16px) / 2);
height: 182px;
padding: 20px;
background: #f9f9f9;
}
.share-dialog .box:first-child {
margin-right: 16px;
}
.share-dialog .title {
font-size: 14px;
color: #333333;
font-weight: 500;
margin-bottom: 8px;
}
.txt-blue {
font-size: 14px;
color: #5092ff;
}
</style>
<template>
<div class="map-box" :style="{ height: mapHeight + 'px' }">
<div id="container" style="width: 100%; height: 100%"></div>
<div class="map-address">{{ address }}</div>
<div id="myPageTop" style="position: absolute; top: 10px; width: 50%; left: 25%">
<el-input placeholder="请输入关键字" v-model="input" class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="searchAddress"></el-button>
</el-input>
</div>
</div>
</template>
<script>
let map, marker, placeSearch
export default {
name: 'map',
props: {
mapHeight: {
type: Number,
default: 300
}
},
data() {
return {
input: '',
address: '',
lnglat: [],
geocoderAddress: {}
}
},
methods: {
mapInit() {
map = new AMap.Map('container', {
resizeEnable: true,
zoom: 20
})
AMap.plugin(['AMap.PlaceSearch'], function() {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
pageSize: 8, // 单页显示结果条数
pageIndex: 1, // 页码
citylimit: false, //是否强制限制在设置的城市内搜索
// panel: "panel", // 结果列表将在此容器中进行展示。
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: 'default'
})
})
// 添加列表点选监听事件
map.on('click', this.getAddress)
},
searchAddress() {
let _this = this
placeSearch.search(this.input, function(status, result) {
if (status === 'complete' && result.poiList.pois.length) {
let lnglat = result.poiList.pois[0].location
_this.getAddress(lnglat)
}
})
},
addMarker(lnglat) {
let position
if (lnglat.lng) {
position = [lnglat.lng, lnglat.lat]
} else {
position = lnglat
}
marker = new AMap.Marker({
icon: new AMap.Icon({
image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
size: new AMap.Size(27, 34), //图标大小
imageSize: new AMap.Size(27, 34)
}),
position: position,
offset: new AMap.Pixel(-10, -10)
})
map.add(marker)
map.setFitView()
},
getAddress(e) {
let self = this
let lnglat
if (e.type == 'click') {
lnglat = e.lnglat
} else {
let { lng, lat } = e
lnglat = [lng, lat]
}
if (marker) {
marker.setMap(null)
marker = null
}
self.addMarker(lnglat)
AMap.plugin('AMap.Geocoder', () => {
const geocoder = new AMap.Geocoder()
geocoder.getAddress(lnglat, (status, result) => {
self.lnglat = lnglat
self.address = result.regeocode.formattedAddress
geocoder.getLocation(self.address, (status, result) => {
if (status === 'complete' && result.info === 'OK') {
this.geocoderAddress = result.geocodes[0]
}
})
})
})
},
selectAddress(e) {
//这里获得点选地点的经纬度
this.getAddress()
}
},
mounted() {
this.mapInit()
}
}
</script>
<style scoped lang="scss">
.map-box {
position: relative;
width: 100%;
}
#container {
position: absolute;
height: 100%;
}
#panel {
position: absolute;
max-height: 90%;
overflow-y: auto;
top: 80px;
right: 10px;
width: 280px;
}
.map-address {
position: absolute;
line-height: 20px;
bottom: -30px;
}
</style>
<!-- 我的开店申请弹窗 -->
<template>
<GLDialog class="apply-store"
bigTitle="我的开店申请"
mode="big"
:visible.sync="isVisible"
:before-close="handleClose"
v-loading="loading"
:hasFooter="false">
<div>
<slot name="search"></slot>
<GLTable ref="storeRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun">
<div class="tb-ellipsis"
slot="merchantName"
slot-scope="scope">
<el-popover placement="top"
popper-class="base-popper"
trigger="hover"
:content="scope.scope.merchantName">
<span slot="reference">
{{ scope.scope.merchantName }}
</span>
</el-popover>
</div>
<div class="tb-ellipsis"
slot="merchantAddress"
slot-scope="scope">
<el-popover placement="top"
popper-class="base-popper"
trigger="hover"
:content="scope.scope.merchantAddress">
<span slot="reference">
{{ scope.scope.merchantAddress }}
</span>
</el-popover>
</div>
<div slot="brand"
slot-scope="scope">
<el-popover placement="top"
popper-class="base-popper"
trigger="hover"
:content="scope.scope.merchantBrandNameList ? scope.scope.merchantBrandNameList.join('/') : '--'">
<span slot="reference"
class="one-line-ellipsis">
{{ scope.scope.merchantBrandNameList ? scope.scope.merchantBrandNameList.join('/') : '--' }}
</span>
</el-popover>
</div>
<div slot="applyStatus"
slot-scope="scope"
class="flex">
<div :class="['dot', statusClass[scope.scope.reviewStatus]]"></div>
{{ reviewStatusObj[scope.scope.reviewStatus] }}
</div>
</GLTable>
</div>
</GLDialog>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
export default {
name: 'ApplyStoreDialog',
data() {
return {
// 表格组件
userInfo: {},
tableSearchForm: {},
url: url,
getListApi: this.$apis.customer.getReviewList,
// 表格参数
tableParams: {
listName: 'list',
tableColumns: [
{
label: '服务中心名称',
prop: 'merchantName',
addHtml: 'merchantName',
minWidth: 120
},
{
label: '联系人',
prop: 'contactName',
width: 120,
line: 1
},
{
label: '联系电话',
prop: 'phone',
width: 130
},
{
label: '地址',
prop: 'merchantAddress',
addHtml: 'merchantAddress',
minWidth: 120
},
{
label: '主营品牌',
prop: '',
width: 140,
line: 1,
addHtml: 'brand'
},
{
label: '申请时间',
prop: 'createdDate',
width: '180px',
formatter: cellValue => {
return cellValue.createdDate ? dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss') : '--'
}
},
{
label: '申请状态',
prop: 'reviewStatus',
width: '100px',
addHtml: 'applyStatus'
},
{
label: '说明',
prop: 'rejectedReason',
width: 100,
line: 1
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
statusClass: {
1: '',
2: 'green',
3: 'red'
},
reviewStatusObj: {
1: '审核中',
2: '已通过',
3: '已驳回'
}
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
searchForm: {
type: Object,
default: () => { }
}
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm.merchantType = 1
this.tableSearchForm.partnerMerchantId = this.$globalState.session.merchantId
resolve()
})
},
handleClose() {
this.$emit('handleClose')
}
}
}
</script>
<style scoped>
.flex {
display: flex;
align-items: center;
}
.dot {
width: 6px;
height: 6px;
background: #5850ff;
border-radius: 4px;
margin-right: 6px;
}
.green {
background: #4aca74;
}
.red {
background: #eb4e4e;
}
</style>
<template>
<div class="map-box"
:style="{ height: mapHeight + 'px' }">
<div id="container"
style="width: 100%; height: 100%"></div>
<div class="map-address">{{ address }}</div>
<div id="myPageTop"
style="position: absolute; top: 10px; width: 50%; left: 25%">
<el-input placeholder="请输入关键字"
v-model="input"
class="input-with-select">
<el-button slot="append"
icon="el-icon-search"
@click="searchAddress"></el-button>
</el-input>
</div>
</div>
</template>
<script>
let map, marker, placeSearch
export default {
name: 'map',
props: {
mapHeight: {
type: Number,
default: 300
}
},
data() {
return {
input: '',
address: '',
lnglat: [],
geocoderAddress: {}
}
},
methods: {
mapInit() {
map = new AMap.Map('container', {
resizeEnable: true,
zoom: 20
})
AMap.plugin(['AMap.PlaceSearch'], function () {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
pageSize: 8, // 单页显示结果条数
pageIndex: 1, // 页码
citylimit: false, //是否强制限制在设置的城市内搜索
// panel: "panel", // 结果列表将在此容器中进行展示。
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: 'default'
})
})
// 添加列表点选监听事件
map.on('click', this.getAddress)
},
searchAddress() {
let _this = this
placeSearch.search(this.input, function (status, result) {
if (status === 'complete' && result.poiList.pois.length) {
let lnglat = result.poiList.pois[0].location
_this.getAddress(lnglat)
}
})
},
addMarker(lnglat) {
let position
if (lnglat.lng) {
position = [lnglat.lng, lnglat.lat]
} else {
position = lnglat
}
marker = new AMap.Marker({
icon: new AMap.Icon({
image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
size: new AMap.Size(27, 34), //图标大小
imageSize: new AMap.Size(27, 34)
}),
position: position,
offset: new AMap.Pixel(-10, -10)
})
map.add(marker)
map.setFitView()
},
getAddress(e) {
let self = this
let lnglat
if (e.type == 'click') {
lnglat = e.lnglat
} else {
let { lng, lat } = e
lnglat = [lng, lat]
}
if (marker) {
marker.setMap(null)
marker = null
}
self.addMarker(lnglat)
AMap.plugin('AMap.Geocoder', () => {
const geocoder = new AMap.Geocoder()
geocoder.getAddress(lnglat, (status, result) => {
self.lnglat = lnglat
self.address = result.regeocode.formattedAddress
geocoder.getLocation(self.address, (status, result) => {
if (status === 'complete' && result.info === 'OK') {
this.geocoderAddress = result.geocodes[0]
}
})
})
})
},
selectAddress(e) {
//这里获得点选地点的经纬度
this.getAddress()
}
},
mounted() {
this.mapInit()
}
}
</script>
<style scoped lang="scss">
.map-box {
position: relative;
width: 100%;
}
#container {
position: absolute;
height: 100%;
}
#panel {
position: absolute;
max-height: 90%;
overflow-y: auto;
top: 80px;
right: 10px;
width: 280px;
}
.map-address {
position: absolute;
line-height: 20px;
bottom: -30px;
}
</style>
<template>
<div class="shop">
<div class="container">
<GLCombiForm ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="showFormData"
@handleOk="handleSearch"
@handleRest="handleReset"></GLCombiForm>
<div class="table-header">
<h2>服务中心管理列表</h2>
<div>
<el-button size="small"
@click="handleEditService('add')"
type="primary"
plain>新增服务中心</el-button>
<el-button size="small"
@click="handleApply">我的开店申请</el-button>
</div>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="pointRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun">
<div class="tb-ellipsis"
slot="merchantName"
slot-scope="scope">
<el-popover placement="top"
popper-class="base-popper"
trigger="hover"
:content="scope.scope.merchantName">
<span slot="reference">
{{ scope.scope.merchantName }}
</span>
</el-popover>
</div>
<div class="table-btns"
slot="auth-button"
slot-scope="scope">
<GLTableButton :buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<ApplyStoreDialog v-if="isApplyVisible"
:isVisible="isApplyVisible"
@handleClose="handleApply"></ApplyStoreDialog>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import ApplyStoreDialog from './components/ApplyStoreDialog.vue'
export default {
data() {
return {
size: 'small',
url: url,
userInfo: {},
searchForm: {
yqMerchantNameKeyword: '',
yqMerchantIdKeyword: ''
},
tableSearchForm: {},
showFormData: [
{
label: '服务中心名称',
name: 'yqMerchantNameKeyword',
type: 'input',
isClear: true,
maxlength: 20
},
{
label: '商户号',
name: 'yqMerchantIdKeyword',
type: 'input',
isClear: true,
maxlength: 20
},
],
tableButtonList: [
{
type: 'GLButton',
name: '编辑',
attrs: {
type: 'text',
fn: '编辑'
},
listeners: {
click: row => this.handleEditService('edit', row)
}
},
],
// 表格
getListApi: this.$apis.serviceCenter.getList,
tableParams: {
listName: 'list',
tableOption: {
width: '150px'
},
tableColumns: [
{
label: '服务中心名称',
prop: 'merchantName',
addHtml: 'merchantName',
minWidth: 120
},
{
label: '商户号',
prop: 'merchantId',
width: 120
},
{
label: '联系人',
prop: 'contactName',
width: 130,
line: 1
},
{
label: '联系电话',
prop: 'phone',
width: 130
},
{
label: '创建时间',
prop: 'createdDate',
width: '180px',
formatter: cellValue => {
return cellValue.createdDate ? dayjs(cellValue.createdDate).format('YYYY/MM/DD HH:mm:ss') : '--'
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
isApplyVisible: false,
// 基本数据
baseData: {
}
}
},
components: {
ApplyStoreDialog,
// InviteDialog
},
mounted() {
this.userInfo = this.$globalState.session
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
handleSearch() {
this.$refs.pointRef.refreshTable()
},
handleReset() {
this.searchForm = {
yqMerchantNameKeyword: '',
yqMerchantIdKeyword: ''
}
this.handleSearch()
},
handleApply() {
this.isApplyVisible = !this.isApplyVisible
},
handleEditService(editType, row) {
var params = {
editType: editType,
$title: encodeURI(editType == 'add' ? '新增服务中心' : '编辑服务中心')
}
editType != 'add' && (params.merchantInfo = row)
this.$router.push({
path: '/serviceCenter/editService',
query: params
})
},
}
}
</script>
<style scoped>
.import-btn {
position: relative;
width: 116px;
height: 32px;
text-align: center;
background: #5850ff;
border-radius: 4px;
color: #ffffff;
font-size: 14px;
margin-right: 8px;
}
.import-input {
opacity: 0;
position: absolute;
right: 0;
top: 0;
width: 98px;
height: 36px;
cursor: pointer;
font-size: 0;
}
</style>
<template>
<GLDialog :title="title" mode="mid" :visible.sync="isVisible" okText="确定" :before-close="handleClose" @onOk="handleConfirm" @onCancel="handleClose">
<div class="explain-title">示例规则定义</div>
<p class="business-info" v-if="diffExplain == 'constructionBonus'">升级订单施工奖励:70.00元;战败订单施工奖励:50.00元</p>
<GLTable v-else :tableData="tableData" :tableParams="tableParams" :hasPage="false"></GLTable>
<div class="explain-title mt20">示例业务场景</div>
<div class="business-info" v-html="infoHtml"></div>
</GLDialog>
</template>
<script>
export default {
data() {
return {
tableParams: {
tableColumns: [
{
label: '区间开始值',
prop: 'startValue'
},
{
label: '区间结束值',
prop: 'endValue'
},
{
label: '奖励金额/元',
prop: 'calculateValue'
}
]
},
tableData: []
}
},
props: {
isExplain: {
type: Boolean,
default: false
},
diffExplain: {
type: String,
default: ''
}
},
computed: {
title() {
const titleObj = {
commissionBonus: '提成奖励示例说明',
highCustomerUnitBonus: '高客单奖励示例说明',
successRateBonus: '成交率奖励示例说明',
constructionBonus: '施工奖励示例说明'
}
return titleObj[this.diffExplain]
},
infoHtml() {
const infoObj = {
commissionBonus: `<div class='mb10'>员工A在某个月中完成升级订单5个,对应的订单产值1000.00元、1500.00元、2000.00元、2500.00元、3000.00元,</div>
<div class='mb10'>则月度的平均客单价=升级订单总产值/升级订单数量=2000.00元,对应规则的提成比例=10.00%,按每个升级订单的产值*10%计算每单提成;</div>
<div class='mb10'>则员工A在该月份获得的总提成奖励=100.00+150.00+200.00+250.00+300.00=1000.00元。</div>`,
highCustomerUnitBonus: `<div class='mb10'>员工A在某个月中完成升级订单5个,对应的订单产值1000.00元、1500.00元、2000.00元、2500.00元、3000.00元,</div>
<div class='mb10'>按高客单奖励规则,产值在0.00-2000.00元的订单每单奖励0.00元(不奖励),产值在2000.00元以上的订单每单奖励100.00元;</div>
<div class='mb10'>则员工A在该月份获得的高客单奖励=0.00+0.00+0.00+100.00+100.00=200元。</div>`,
successRateBonus: `<div class='mb10'>员工A在某个月中完成升级订单9个,战败订单1个</div>
<div class='mb10'>则月度的成交率=升级订单数/(升级订单数+战败订单数)=90.00%,对应规则的奖励金额=1000.00元;</div>
<div class='mb10'>则员工A在该月份获得的成交率奖励=1000.00元。</div>`,
constructionBonus: `<div class='mb10'>员工A在某个月中施工了升级订单5个,施工了战败订单5个;</div>
<div class='mb10'>则员工A在该月份获得的总提成奖励=(70.00*5)+(50.00*5)=600.00元。</div>`
}
return infoObj[this.diffExplain]
},
isVisible() {
return this.isExplain
}
},
watch: {
diffExplain(newVal) {
console.log(newVal)
if (newVal == 'successRateBonus') {
this.tableData = [
{ startValue: '', endValue: '80%', calculateValue: 0.0 },
{ startValue: '80.01%', endValue: '90%', calculateValue: 1000.0 },
{ startValue: '90.01%', endValue: '', calculateValue: 2000.0 }
]
} else if (newVal == 'commissionBonus') {
this.tableData = [
{ startValue: 0.0, endValue: 2000.0, calculateValue: '10%' },
{ startValue: 2000.01, endValue: '', calculateValue: '20%' }
]
} else {
this.tableData = [
{ startValue: 0.0, endValue: 2000.0, calculateValue: 0.0 },
{ startValue: 2000.01, endValue: '', calculateValue: 2000.01 }
]
}
if (newVal == 'commissionBonus') {
this.tableParams.tableColumns[2].label = '提成比例'
} else {
this.tableParams.tableColumns[2].label = '奖励金额/元'
}
}
},
methods: {
handleConfirm() {
this.$emit('handleClose')
},
handleClose() {
this.$emit('handleClose')
}
}
}
</script>
<style lang="scss">
.explain-title {
font-weight: 600;
font-size: 16px;
color: #333333;
margin-bottom: 10px;
}
.business-info {
font-size: 14px;
color: #333333;
line-height: 18px;
}
.mb10 {
margin-bottom: 10px;
}
.mt20 {
margin-top: 20px;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="shop">
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="table-header">
<h2>员工管理列表</h2>
<div>
<el-button size="small" @click="handleEditStaff('add')" type="primary" plain>新增员工</el-button>
</div>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="pointRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="tb-ellipsis" slot="staffNameKeyword" slot-scope="scope">
<el-popover placement="top" popper-class="base-popper" trigger="hover" :content="scope.scope.staffNameKeyword">
<span slot="reference">
{{ scope.scope.staffNameKeyword }}
</span>
</el-popover>
</div>
<div class="tb-ellipsis" slot="merchantName" slot-scope="scope">
<el-popover placement="top" popper-class="base-popper" trigger="hover" :content="scope.scope.merchantName">
<span slot="reference">
{{ scope.scope.merchantName }}
</span>
</el-popover>
</div>
<div slot="visibleMerchantList" slot-scope="scope">
<el-tooltip v-if="scope.scope.visibleMerchantList && scope.scope.visibleMerchantList.length > 0" placement="top" effect="light">
<div slot="content">
<div class="text-3 font-12 weight-6" style="line-height: 24px">使用门店</div>
<div class="merchant-wrap">
<div class="text-6 font-12" style="line-height: 24px" v-for="item in scope.scope.visibleMerchantList" :key="item">{{ item.merchantName }}</div>
</div>
</div>
<div class="use-store">
<img src="@/assets/store.png" />
x {{ scope.scope.visibleMerchantList.length }}
</div>
</el-tooltip>
<span v-else>--</span>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<!-- <ApplyStoreDialog v-if="isApplyVisible" :isVisible="isApplyVisible" @handleClose="handleApply"></ApplyStoreDialog> -->
<!-- <InviteDialog v-if="isInviteVisible" :isVisible="isInviteVisible" :inviteInfo="inviteInfo" @handleClose="handleInviteClose"></InviteDialog> -->
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
// import ApplyStoreDialog from './components/ApplyStoreDialog.vue'
// import InviteDialog from './components/InviteDialog.vue'
export default {
data() {
return {
size: 'small',
url: url,
userInfo: {},
merchantNoList: [],
searchForm: {
staffPhoneKeyword: '',
staffNameKeyword: '',
staffType: '',
yqMerchantId: ''
},
tableSearchForm: {},
showFormData: [
{
label: '员工姓名',
name: 'staffNameKeyword',
type: 'input',
isClear: true,
maxlength: 50
},
{
label: '员工手机号',
name: 'staffPhoneKeyword',
type: 'input',
isClear: true,
maxlength: 50
},
{
label: '员工类型',
name: 'staffType',
type: 'select',
optionList: [],
optionId: 'value',
optionLabel: 'text',
optionsName: 'staffTypeList'
},
{
label: '所属服务中心',
name: 'yqMerchantId',
type: 'select',
optionList: [],
optionId: 'yqMerchantId',
optionLabel: 'yqMerchantName',
optionsName: 'merchantList'
}
],
tableButtonList: [
{
type: 'el-button',
name: '编辑',
attrs: {
type: 'text',
fn: '编辑'
},
listeners: {
click: row => this.handleEditStaff('edit', row)
}
}
],
// 表格
getListApi: this.$apis.staff.getList,
tableParams: {
listName: 'list',
tableOption: {
width: '80px'
},
tableColumns: [
{
label: '员工姓名',
prop: 'staffName',
minWidth: 100
},
{
label: '员工类型',
prop: 'staffBusinessType',
formatter: cellValue => {
const data = this.baseData.staffTypeList.filter(item => item.value == cellValue.staffBusinessType)
return data.length > 0 ? data[0].text : '--'
},
minWidth: 120
},
{
label: '员工手机号',
prop: 'staffPhone',
minWidth: 120
},
{
label: '所属服务中心',
prop: 'merchantName',
addHtml: 'merchantName',
minWidth: 120
},
{
label: '负责门店',
prop: '',
addHtml: 'visibleMerchantList',
minWidth: 100
},
{
label: '创建时间',
prop: 'createdDate',
minWidth: 150,
formatter: cellValue => {
return cellValue.createdDate ? dayjs(cellValue.createdDate).format('YYYY/MM/DD') : '--'
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
isApplyVisible: false,
isInviteVisible: false,
inviteInfo: {},
// 基本数据
baseData: {
merchantList: [],
staffTypeList: [
{ text: '驻店', value: 0 },
{ text: '技师', value: 1 }
]
}
}
},
mounted() {},
methods: {
getServiceCenterList() {
const params = {
partnerMerchantId: this.$globalState.session.merchantId
}
return new Promise(resolve => {
this.$apis.customer.getServiceCenterList(params).then(res => {
this.baseData.merchantList = res
resolve(res)
this.$utils.getOptionsList(this, 'showFormData')
})
})
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
return params
},
async beforeSearchFn() {
this.merchantNoList = []
let data = await this.getServiceCenterList()
data.forEach(item => {
this.merchantNoList.push(item.yqMerchantId)
})
return new Promise(resolve => {
this.tableSearchForm = JSON.parse(JSON.stringify(this.getParams()))
this.tableSearchForm.merchantNoList = this.tableSearchForm.yqMerchantId ? [this.tableSearchForm.yqMerchantId] : this.merchantNoList
delete this.tableSearchForm.yqMerchantId
resolve()
})
},
handleSearch() {
this.$refs.pointRef.refreshTable()
},
handleReset() {
this.searchForm = {}
this.handleSearch()
},
handleApply() {
this.isApplyVisible = !this.isApplyVisible
},
handleInviteClose() {
this.isInviteVisible = !this.isInviteVisible
},
handleInvite(row) {
this.inviteInfo = row
this.handleInviteClose()
},
handleEditStaff(editType, row) {
var params = {
editType: editType,
}
editType != 'add' && (params.merchantInfo = row)
this.$router.push({
path: '/staffManage/edit',
query: {
$title: encodeURI(editType == 'add' ? '新增员工' : '编辑员工'),
obj: JSON.stringify(params)
}
})
}
}
}
</script>
<style scoped lang="scss">
.import-btn {
position: relative;
width: 116px;
height: 32px;
text-align: center;
background: #5850ff;
border-radius: 4px;
color: #ffffff;
font-size: 14px;
margin-right: 8px;
}
.import-input {
opacity: 0;
position: absolute;
right: 0;
top: 0;
width: 98px;
height: 36px;
cursor: pointer;
font-size: 0;
}
.use-store {
display: flex;
font-size: 14px;
color: #5850ff;
align-items: center;
img {
width: 14px;
height: 12.98px;
margin-right: 8px;
}
}
.table-btns {
width: 80px;
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 关联门店弹窗 -->
<template>
<GLDialog bigTitle="选择门店" mode="big" :visible.sync="relateStoreVisible" okText="关联" :before-close="handleRelateStoreClose" @onOk="handleRelateStoreConfirm" @onCancel="handleRelateStoreClose" class="relateStore">
<slot></slot>
<el-row>
<el-col :span="16">
<div class="title">门店列表</div>
<el-table ref="seletingTable" class="table hightline" :data="selectingData" height="460px" @select="handleChange" @select-all="handleAll">
<el-table-column fixed="left" width="5">
<template slot-scope="scope">
<span :scope="scope"></span>
</template>
</el-table-column>
<el-table-column type="selection" width="55" align="center" :selectable="selectable"></el-table-column>
<el-table-column prop="merchantName" width="300" label="门店名称" align="center"></el-table-column>
<el-table-column prop="merchantId" label="商户号" width="300" align="center"></el-table-column>
</el-table>
<el-pagination v-if="hasPage" small background @current-change="handleCurrentChange" :current-page.sync="pageNum" :page-size="pageSize" layout="total, prev, pager, next" :total="total"></el-pagination>
</el-col>
<el-col :span="8">
<div class="title mar_l10">已选门店</div>
<div class="selected_box">
<div class="box_top">
<span>已选</span>
<el-button type="text" @click="handelClearStore">清空</el-button>
</div>
<div class="box_content">
<div class="select_item" v-for="(subItem, subIndex) in selectedData" :key="subIndex">
<div class="text_value">{{ subItem.merchantName }}({{subItem.merchantId}})</div>
<div class="select_clear" @click="handleDelete(subItem)"><i class="el-icon-error"></i></div>
</div>
</div>
</div>
</el-col>
</el-row>
</GLDialog>
</template>
<script>
export default {
name: 'relateStoreDialog',
data() {
return {
selectedData: [],
selectingData: [],
// 分页
total: 0,
pageNum: 1,
pageSize: 20
}
},
props: {
relateStoreVisible: {
type: Boolean,
default: false
},
hasPage: {
type: Boolean,
default: true
},
// 页面来源
// sourcePage: {
// type: String,
// default: ''
// },
storeApi: {
type: Function,
default: () => { }
},
storeSelected: {
type: Array,
default: () => []
},
storeSearchForm: {
type: Object,
default: () => { }
}
// 去掉表格中某些字段
// noTableField: {
// type: Array,
// default: () => []
// }
},
mounted() {
this.selectedData = this.storeSelected?this.storeSelected:[]
this.selectedData&&this.selectedData.forEach(item => {
item.merchantId = item.merchantId ? item.merchantId + '' : item.merchantId
})
this.getSelectingList()
},
methods: {
selectable(row, index) {
var isSelect = row.hasOwnProperty('beServed') ? !row.beServed : true
return isSelect
},
recoverySelection() {
var exitIds = this.selectedData.map(item => item.merchantId + '')
this.selectingData.forEach(item => {
if (exitIds.includes(item.merchantId + '')) {
this.$refs.seletingTable.toggleRowSelection(item, true)
} else {
this.$refs.seletingTable.toggleRowSelection(item, false)
}
})
},
getSelectingList() {
this.storeApi({
...this.storeSearchForm,
currentPage: this.pageNum,
pageSize: this.hasPage ? this.pageSize : 99999,
scene: 1,
partnerMerchantId: this.$globalState?.session?.merchantId
}).then(res => {
this.selectingData = res.list || []
this.total = res.total
this.$nextTick(() => {
this.recoverySelection()
})
})
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(item => +item.merchantId === +row.merchantId)
addOrDelete ? this.selectedData.push(row) : (this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId))
},
handleAll(selection) {
this.selectingData?.forEach(item => {
let isExit = this.selectedData.findIndex(subItem => +subItem.merchantId === +item.merchantId)
var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
if (selection.length && isExit === -1 && !isServed) {
this.selectedData.push(item)
} else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1)
}
})
},
handleDelete(row) {
this.selectedData = this.selectedData.filter(item => +item.merchantId !== +row.merchantId)
this.recoverySelection()
},
handelClearStore() {
this.selectedData = []
this.recoverySelection()
},
handleCurrentChange(val) {
this.pageNum = val
this.getSelectingList()
},
handleRelateStoreConfirm() {
if (!this.selectedData.length) {
this.$message({
message: '请选择关联门店',
type: 'warning',
showClose: true,
customClass: 'message-Z-zinde'
})
return true
}
this.$emit('handleRelateStoreConfirm', this.selectedData)
},
handleRelateStoreClose() {
this.$emit('handleRelateStoreClose')
}
}
}
</script>
<style lang="scss" scoped>
.relateStore{
.title{
font-size: 16px;
margin-bottom: 10px;
}
.mar_l10{
margin-left: 10px;
}
.selected_box{
margin-left: 10px;
border: 1px solid #E5E5E5;
height: 460px;
.box_top{
font-size: 16px;
padding: 11px 26px;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #E5E5E5;
}
.box_content{
padding: 12px 8px;
overflow-y: scroll;
height: calc(100% - 40px);
box-sizing: border-box;
.select_item{
display: flex;
align-items: center;
justify-content: space-between;
height: 32px;
padding: 0 8px;
cursor: pointer;
.text_value{
width: calc(100% - 50px);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.select_clear{
width: 12px;
height: 12px;
i{
color: #A6A6A6;
}
}
}
.select_item:hover{
background: #F2F1FF;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -3,7 +3,9 @@ const packageName = require('./package.json').name ...@@ -3,7 +3,9 @@ const packageName = require('./package.json').name
const node_env = process.env.NODE_ENV === 'production' const node_env = process.env.NODE_ENV === 'production'
const publicPath = node_env ? `/child/${packageName}/` : '/' const publicPath = node_env ? `/child/${packageName}/` : '/'
const resolve = dir => path.join(__dirname, dir) const resolve = dir => path.join(__dirname, dir)
const CopyDir = require('./plugins/copyDir')
const CDN_DOMAIN = 'https://img02.glsx.com.cn/' const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const isDev = process.env.NODE_ENV !== 'development'
const cdn = { const cdn = {
css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`], css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`, 'https://webapi.amap.com/loader.js'] js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`, 'https://webapi.amap.com/loader.js']
...@@ -13,21 +15,22 @@ module.exports = { ...@@ -13,21 +15,22 @@ module.exports = {
publicPath, publicPath,
assetsDir: 'static', assetsDir: 'static',
productionSourceMap: false, productionSourceMap: false,
configureWebpack: { configureWebpack: config => {
resolve: { config.resolve = {
alias: { alias: {
'@': resolve('src'), '@': resolve('src'),
assets: resolve('src/assets'), assets: resolve('src/assets'),
views: resolve('src/views'), views: resolve('src/views'),
components: resolve('src/components') components: resolve('src/components')
} }
}, }
output: { config.output = {
...config.output,
library: `${packageName}-[name]`, library: `${packageName}-[name]`,
libraryTarget: 'umd', // 把微应用打包成 umd 库格式 libraryTarget: 'umd', // 把微应用打包成 umd 库格式
jsonpFunction: `webpackJsonp_${packageName}` jsonpFunction: `webpackJsonp_${packageName}`
}, }
externals: { config.externals = {
vue: 'Vue', vue: 'Vue',
'element-ui': 'ELEMENT', 'element-ui': 'ELEMENT',
'vue-router': 'VueRouter', 'vue-router': 'VueRouter',
...@@ -36,7 +39,38 @@ module.exports = { ...@@ -36,7 +39,38 @@ module.exports = {
echarts: 'echarts', echarts: 'echarts',
AMap: 'AMap' AMap: 'AMap'
} }
// let plugins = []
// if (isDev) {
// // plugins.push(new CopyDir()) // 把dist 文件修改成有两份来兼容部署时请求目录不一样的情况
// }
// config.plugins = [...config.plugins, ...plugins]
}, },
// configureWebpack: {
// resolve: {
// alias: {
// '@': resolve('src'),
// assets: resolve('src/assets'),
// views: resolve('src/views'),
// components: resolve('src/components')
// }
// },
// output: {
// library: `${packageName}-[name]`,
// libraryTarget: 'umd', // 把微应用打包成 umd 库格式
// jsonpFunction: `webpackJsonp_${packageName}`
// },
// externals: {
// vue: 'Vue',
// 'element-ui': 'ELEMENT',
// 'vue-router': 'VueRouter',
// vuex: 'Vuex',
// axios: 'axios',
// echarts: 'echarts',
// AMap: 'AMap'
// }
// },
devServer: { devServer: {
hot: true, hot: true,
disableHostCheck: true, disableHostCheck: true,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!