Commit c7adcd28 by 王志慧

Merge branch 'v4.27.0' of http://192.168.3.233:8090/saas/scrm-micro-shop into v4.27.0

2 parents c07f8f0f ecf6fcfc
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
...@@ -60,3 +60,20 @@ export const afterTodayOptions = { ...@@ -60,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)
}
...@@ -247,22 +247,22 @@ export const Util = { ...@@ -247,22 +247,22 @@ export const Util = {
// throw new Error("Unable to clone obj! Its type isn't supported.") // throw new Error("Unable to clone obj! Its type isn't supported.")
// }, // },
/** // /**
* url下载文件 // * url下载文件
* // *
*/ // */
downLoadFile: function(url) { // downLoadFile: function(url) {
// console.log(row) // // console.log(row)
// return // // return
const Temp = document.createElement('a') // const Temp = document.createElement('a')
// Temp.href = process.env.VUE_APP_BASE_URL + '/article/export.do?articleId=' + row.id // // Temp.href = process.env.VUE_APP_BASE_URL + '/article/export.do?articleId=' + row.id
Temp.href = url + '?timestamp=' + new Date().getTime() // Temp.href = url + '?timestamp=' + new Date().getTime()
// console.log(url) // // console.log(url)
// console.log(Temp.href) // // console.log(Temp.href)
document.body.append(Temp) // document.body.append(Temp)
Temp.click() // Temp.click()
document.body.removeChild(Temp) // document.body.removeChild(Temp)
}, // },
/** /**
* @param {Object} json * @param {Object} json
...@@ -337,5 +337,5 @@ export const showToast = Util.Info ...@@ -337,5 +337,5 @@ export const showToast = Util.Info
export const showLoading = Util.loading export const showLoading = Util.loading
export const hideLoading = Util.closeLoading export const hideLoading = Util.closeLoading
export const deepClone = Util.deepClone export const deepClone = Util.deepClone
export const downLoadFile = Util.downLoadFile // export const downLoadFile = Util.downLoadFile
export const returnFloat = Util.returnFloat export const returnFloat = Util.returnFloat
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
<template> <template>
<el-alert title="每月最后一天24:00按当月业务完成情况自动计算员工绩效。" <el-alert title="每月最后一天24:00按当月业务完成情况自动计算员工绩效。"
show-icon show-icon
class="tip-cla"> class="tip-cla"></el-alert>
</el-alert>
</template> </template>
<div class="container"> <div class="container">
<GLCombiForm ref="showSearch" <GLCombiForm ref="showSearch"
...@@ -97,9 +96,9 @@ ...@@ -97,9 +96,9 @@
</template> </template>
<script> <script>
import * as dayjs from 'dayjs' // import * as dayjs from 'dayjs'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import { downLoadFile } from '@/common/util' import { downLoadFile } from '@/common/format'
import ResidentDetailDialog from './residentDetailDialog.vue' import ResidentDetailDialog from './residentDetailDialog.vue'
import ResidentCorrectionDialog from './residentCorrectionDialog.vue' import ResidentCorrectionDialog from './residentCorrectionDialog.vue'
export default { export default {
...@@ -122,7 +121,7 @@ export default { ...@@ -122,7 +121,7 @@ export default {
{ {
label: '绩效月份', label: '绩效月份',
prop: 'performanceMonth', prop: 'performanceMonth',
addHtml: 'performanceMonth', addHtml: 'performanceMonth'
}, },
{ {
label: '员工姓名', label: '员工姓名',
...@@ -135,7 +134,7 @@ export default { ...@@ -135,7 +134,7 @@ export default {
label: '员工手机号', label: '员工手机号',
name: 'staffPhone', name: 'staffPhone',
type: 'input', type: 'input',
inputType: "number", inputType: 'number',
isClear: true, isClear: true,
maxlength: '11' maxlength: '11'
}, },
...@@ -306,7 +305,7 @@ export default { ...@@ -306,7 +305,7 @@ export default {
prop: 'status', prop: 'status',
width: '100px', width: '100px',
addHtml: 'applyStatus' addHtml: 'applyStatus'
}, }
] ]
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
...@@ -324,16 +323,18 @@ export default { ...@@ -324,16 +323,18 @@ export default {
// 基本数据 // 基本数据
baseData: { baseData: {
merchantList: [], merchantList: [],
statusList: [{ statusList: [
{
confId: 0, confId: 0,
confName: '未下发' confName: '未下发'
}, },
{ {
confId: 1, confId: 1,
confName: '已下发' confName: '已下发'
}] }
]
}, },
setMonthFlag: false,//第一次进入页面时设置绩效月份参数值 setMonthFlag: false //第一次进入页面时设置绩效月份参数值
} }
}, },
components: { components: {
...@@ -348,15 +349,15 @@ export default { ...@@ -348,15 +349,15 @@ export default {
methods: { methods: {
getLastMonth() { getLastMonth() {
// 获取上个月日期 // 获取上个月日期
var date = new Date; var date = new Date()
var year = date.getFullYear(); var year = date.getFullYear()
var month = date.getMonth(); var month = date.getMonth()
if (month == 0) { if (month == 0) {
year = year - 1; year = year - 1
month = 12; month = 12
} }
month = month > 10 ? month : "0" + month month = month > 10 ? month : '0' + month
this.searchForm.performanceMonth = year.toString() + '-' + month; this.searchForm.performanceMonth = year.toString() + '-' + month
}, },
getServiceCenterList() { getServiceCenterList() {
const params = { const params = {
...@@ -373,7 +374,8 @@ export default { ...@@ -373,7 +374,8 @@ export default {
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
if (!this.setMonthFlag) {//进入页面时设置绩效月份参数值 if (!this.setMonthFlag) {
//进入页面时设置绩效月份参数值
this.getLastMonth() this.getLastMonth()
} }
this.tableSearchForm = this.getParams() this.tableSearchForm = this.getParams()
...@@ -425,13 +427,13 @@ export default { ...@@ -425,13 +427,13 @@ export default {
distribute_commit(selectedData) { distribute_commit(selectedData) {
if (!selectedData?.length) { if (!selectedData?.length) {
this.$message({ this.$message({
message: "请选择需要下发的记录", message: '请选择需要下发的记录',
type: "warning", type: 'warning',
showClose: true showClose: true
}) })
return false return false
} }
var idList = selectedData.map((item) => { var idList = selectedData.map(item => {
return item.id return item.id
}) })
this.$confirm('<strong>是否确定下发?</strong> <div>完成工资记录下发后,员工可查看到对应的工资记录,且不允许再修改</div> ', '提示', { this.$confirm('<strong>是否确定下发?</strong> <div>完成工资记录下发后,员工可查看到对应的工资记录,且不允许再修改</div> ', '提示', {
...@@ -439,7 +441,8 @@ export default { ...@@ -439,7 +441,8 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { })
.then(() => {
this.$apis.performanceManage.batchIssueApi({ idList: idList }).then(res => { this.$apis.performanceManage.batchIssueApi({ idList: idList }).then(res => {
this.$notify({ this.$notify({
type: 'success', type: 'success',
...@@ -447,7 +450,8 @@ export default { ...@@ -447,7 +450,8 @@ export default {
}) })
this.$refs.residentRef.refreshTable() this.$refs.residentRef.refreshTable()
}) })
}).catch(err => { })
.catch(err => {
console.log(err) console.log(err)
}) })
}, },
...@@ -462,11 +466,11 @@ export default { ...@@ -462,11 +466,11 @@ export default {
this.$apis.performanceManage.exportDetailApi(params).then(res => { this.$apis.performanceManage.exportDetailApi(params).then(res => {
downLoadFile(res) downLoadFile(res)
}) })
}, }
} }
} }
</script> </script>
<style scoped> <style scoped lang="scss">
.tip-cla { .tip-cla {
margin: 16px 0 16px 0; margin: 16px 0 16px 0;
width: 1184px; width: 1184px;
...@@ -474,10 +478,12 @@ export default { ...@@ -474,10 +478,12 @@ export default {
background: #e4e3ff; background: #e4e3ff;
border-radius: 4px; border-radius: 4px;
} }
.flex { .flex {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.dot { .dot {
width: 6px; width: 6px;
height: 6px; height: 6px;
...@@ -485,12 +491,15 @@ export default { ...@@ -485,12 +491,15 @@ export default {
border-radius: 4px; border-radius: 4px;
margin-right: 6px; margin-right: 6px;
} }
.green { .green {
background: #4aca74; background: #4aca74;
} }
.red { .red {
background: #eb4e4e; background: #eb4e4e;
} }
.grey { .grey {
background: #999999; background: #999999;
} }
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
<template> <template>
<el-alert title="每月最后一天24:00按当月业务完成情况自动计算员工绩效。" <el-alert title="每月最后一天24:00按当月业务完成情况自动计算员工绩效。"
show-icon show-icon
class="tip-cla"> class="tip-cla"></el-alert>
</el-alert>
</template> </template>
<div class="container"> <div class="container">
<GLCombiForm ref="showSearch" <GLCombiForm ref="showSearch"
...@@ -97,9 +96,9 @@ ...@@ -97,9 +96,9 @@
</template> </template>
<script> <script>
import * as dayjs from 'dayjs' // import * as dayjs from 'dayjs'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import { downLoadFile } from '@/common/util' import { downLoadFile } from '@/common/format'
import TechnicianDetailDialog from './technicianDetailDialog.vue' import TechnicianDetailDialog from './technicianDetailDialog.vue'
import TechnicianCorrectionDialog from './technicianCorrectionDialog.vue' import TechnicianCorrectionDialog from './technicianCorrectionDialog.vue'
export default { export default {
...@@ -122,7 +121,7 @@ export default { ...@@ -122,7 +121,7 @@ export default {
{ {
label: '绩效月份', label: '绩效月份',
prop: 'performanceMonth', prop: 'performanceMonth',
addHtml: 'performanceMonth', addHtml: 'performanceMonth'
}, },
{ {
label: '员工姓名', label: '员工姓名',
...@@ -135,7 +134,7 @@ export default { ...@@ -135,7 +134,7 @@ export default {
label: '员工手机号', label: '员工手机号',
name: 'staffPhone', name: 'staffPhone',
type: 'input', type: 'input',
inputType: "number", inputType: 'number',
isClear: true, isClear: true,
maxlength: '11' maxlength: '11'
}, },
...@@ -239,7 +238,7 @@ export default { ...@@ -239,7 +238,7 @@ export default {
prop: 'status', prop: 'status',
width: '100px', width: '100px',
addHtml: 'applyStatus' addHtml: 'applyStatus'
}, }
] ]
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
...@@ -257,16 +256,18 @@ export default { ...@@ -257,16 +256,18 @@ export default {
// 基本数据 // 基本数据
baseData: { baseData: {
merchantList: [], merchantList: [],
statusList: [{ statusList: [
{
confId: 0, confId: 0,
confName: '未下发' confName: '未下发'
}, },
{ {
confId: 1, confId: 1,
confName: '已下发' confName: '已下发'
}] }
]
}, },
setMonthFlag: false,//第一次进入页面时设置绩效月份参数值 setMonthFlag: false //第一次进入页面时设置绩效月份参数值
} }
}, },
components: { components: {
...@@ -280,14 +281,14 @@ export default { ...@@ -280,14 +281,14 @@ export default {
methods: { methods: {
getLastMonth() { getLastMonth() {
// 获取上个月日期 // 获取上个月日期
var date = new Date; var date = new Date()
var year = date.getFullYear(); var year = date.getFullYear()
var month = date.getMonth(); var month = date.getMonth()
if (month == 0) { if (month == 0) {
year = year - 1; year = year - 1
month = 12; month = 12
} }
this.searchForm.performanceMonth = year.toString() + '-' + month; this.searchForm.performanceMonth = year.toString() + '-' + month
}, },
getServiceCenterList() { getServiceCenterList() {
const params = { const params = {
...@@ -304,7 +305,8 @@ export default { ...@@ -304,7 +305,8 @@ export default {
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
if (!this.setMonthFlag) {//进入页面时设置绩效月份参数值 if (!this.setMonthFlag) {
//进入页面时设置绩效月份参数值
this.getLastMonth() this.getLastMonth()
} }
this.tableSearchForm = this.getParams() this.tableSearchForm = this.getParams()
...@@ -356,13 +358,13 @@ export default { ...@@ -356,13 +358,13 @@ export default {
distribute_commit(selectedData) { distribute_commit(selectedData) {
if (!selectedData?.length) { if (!selectedData?.length) {
this.$message({ this.$message({
message: "请选择需要下发的记录", message: '请选择需要下发的记录',
type: "warning", type: 'warning',
showClose: true showClose: true
}) })
return false return false
} }
var idList = selectedData.map((item) => { var idList = selectedData.map(item => {
return item.id return item.id
}) })
this.$confirm('<strong>是否确定下发?</strong> <div>完成工资记录下发后,员工可查看到对应的工资记录,且不允许再修改</div> ', '提示', { this.$confirm('<strong>是否确定下发?</strong> <div>完成工资记录下发后,员工可查看到对应的工资记录,且不允许再修改</div> ', '提示', {
...@@ -370,7 +372,8 @@ export default { ...@@ -370,7 +372,8 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { })
.then(() => {
this.$apis.performanceManage.batchIssueApi({ idList: idList }).then(res => { this.$apis.performanceManage.batchIssueApi({ idList: idList }).then(res => {
this.$notify({ this.$notify({
type: 'success', type: 'success',
...@@ -378,7 +381,8 @@ export default { ...@@ -378,7 +381,8 @@ export default {
}) })
this.$refs.residentRef.refreshTable() this.$refs.residentRef.refreshTable()
}) })
}).catch(err => { })
.catch(err => {
console.log(err) console.log(err)
}) })
}, },
...@@ -393,7 +397,7 @@ export default { ...@@ -393,7 +397,7 @@ export default {
this.$apis.performanceManage.exportDetailApi(params).then(res => { this.$apis.performanceManage.exportDetailApi(params).then(res => {
downLoadFile(res) downLoadFile(res)
}) })
}, }
} }
} }
</script> </script>
...@@ -405,10 +409,12 @@ export default { ...@@ -405,10 +409,12 @@ export default {
background: #e4e3ff; background: #e4e3ff;
border-radius: 4px; border-radius: 4px;
} }
.flex { .flex {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.dot { .dot {
width: 6px; width: 6px;
height: 6px; height: 6px;
...@@ -416,12 +422,15 @@ export default { ...@@ -416,12 +422,15 @@ export default {
border-radius: 4px; border-radius: 4px;
margin-right: 6px; margin-right: 6px;
} }
.green { .green {
background: #4aca74; background: #4aca74;
} }
.red { .red {
background: #eb4e4e; background: #eb4e4e;
} }
.grey { .grey {
background: #999999; background: #999999;
} }
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
</div> </div>
</template> </template>
<script> <script>
import ResidentPerformance from "./components/residentPerformance.vue" import ResidentPerformance from './components/residentPerformance.vue'
import TechnicianPerformance from "./components/technicianPerformance.vue" import TechnicianPerformance from './components/technicianPerformance.vue'
export default { export default {
components: { components: {
ResidentPerformance, ResidentPerformance,
...@@ -16,40 +16,34 @@ export default { ...@@ -16,40 +16,34 @@ export default {
}, },
data() { data() {
return { return {
activeName: "1", activeName: '1',
tabPaneList: [ tabPaneList: [
{ {
label: "驻店绩效", label: '驻店绩效',
name: "1" name: '1'
}, },
{ {
label: "技师绩效", label: '技师绩效',
name: "2" name: '2'
} }
], ],
tabName: "ResidentPerformance" tabName: 'ResidentPerformance'
} }
}, },
mounted() { mounted() { },
computed: {},
}, watch: {},
computed: {
},
watch: {
},
methods: { methods: {
handleClick() { handleClick() {
let arr = { let arr = {
1: "residentPerformance", 1: 'residentPerformance',
2: "technicianPerformance" 2: 'technicianPerformance'
} }
this.tabName = arr[+this.activeName] this.tabName = arr[+this.activeName]
console.log(this.tabName); console.log(this.tabName)
}, }
} }
} }
</script> </script>
<style scoped> <style scoped lang="scss">
</style> </style>
...@@ -4,9 +4,12 @@ ...@@ -4,9 +4,12 @@
<div class="container edit-container"> <div class="container edit-container">
<p class="page-title">基础信息</p> <p class="page-title">基础信息</p>
<div v-loading="loading"> <div v-loading="loading">
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="defaultLabelWidth" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit"
:labelWidth="defaultLabelWidth" :isBlock="true" :formRef="editChildRef" :formObj="editForm"
:formData="editFormData" :formRules="editRule">
<div slot="merchantList"> <div slot="merchantList">
<el-button size="small" class="selectWrap" icon="el-icon-plus" plain @click="handleRelateStoreClose">选择门店</el-button> <el-button size="small" class="selectWrap" icon="el-icon-plus" plain
@click="handleRelateStoreClose">选择门店</el-button>
<GLTable ref="warehousListRef" :hasPage="false" :tableParams="tableParams" :tableData="editForm.merchantList"> <GLTable ref="warehousListRef" :hasPage="false" :tableParams="tableParams" :tableData="editForm.merchantList">
<span slot="customBtn" slot-scope="scope"> <span slot="customBtn" slot-scope="scope">
<el-button class="p-0" type="text" @click="handleMerchantDelete(scope)">删除</el-button> <el-button class="p-0" type="text" @click="handleMerchantDelete(scope)">删除</el-button>
...@@ -19,27 +22,34 @@ ...@@ -19,27 +22,34 @@
<div class="container edit-container mt16"> <div class="container edit-container mt16">
<p class="page-title">绩效信息</p> <p class="page-title">绩效信息</p>
<div v-loading="loading"> <div v-loading="loading">
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef1" :isEdit="isEdit" :labelWidth="defaultLabelWidth" :isBlock="true" :formRef="editChildRef" :formObj="employeePerformanceConfig" :formData="performanceFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef1" :isEdit="isEdit"
:labelWidth="defaultLabelWidth" :isBlock="true" :formRef="editChildRef" :formObj="employeePerformanceConfig"
:formData="performanceFormData" :formRules="editRule">
<!-- 绩效设置 --> <!-- 绩效设置 -->
<div slot="performanceFlag"> <div slot="performanceFlag">
<el-switch v-model="employeePerformanceConfig.performanceBFlag" class="switchStyle" active-color="#5850ff" active-text="开" inactive-text="关" @change="changeSwitch('performance')"></el-switch> <el-switch v-model="employeePerformanceConfig.performanceBFlag" class="switchStyle" active-color="#5850ff"
active-text="开" inactive-text="关" @change="changeSwitch('performance')"></el-switch>
</div> </div>
<!-- 基本工资/元 --> <!-- 基本工资/元 -->
<div slot="basicWage"> <div slot="basicWage">
<el-input type="text" v-model="employeePerformanceConfig.basicWage" @blur="handleCalcuPrice('employeePerformanceConfig', 'basicWage')" placeholder="请输入"></el-input> <el-input type="text" v-model="employeePerformanceConfig.basicWage"
@blur="handleCalcuPrice('employeePerformanceConfig', 'basicWage')" placeholder="请输入"></el-input>
</div> </div>
<!-- 保底工资/元 --> <!-- 保底工资/元 -->
<div slot="minimumWage"> <div slot="minimumWage">
<el-input type="text" v-model="employeePerformanceConfig.minimumWage" @blur="handleCalcuPrice('employeePerformanceConfig', 'minimumWage')" placeholder="请输入"></el-input> <el-input type="text" v-model="employeePerformanceConfig.minimumWage"
@blur="handleCalcuPrice('employeePerformanceConfig', 'minimumWage')" placeholder="请输入"></el-input>
</div> </div>
<!--提成奖励 高客单奖励 成交率奖励--> <!--提成奖励 高客单奖励 成交率奖励-->
<div :slot="item + 'Flag'" :key="index" v-for="(item, index) in addHtmls"> <div :slot="item + 'Flag'" :key="index" v-for="(item, index) in addHtmls">
<el-switch v-model="employeePerformanceConfig[item + 'BFlag']" class="switchStyle" active-color="#5850ff" active-text="开" inactive-text="关" @change="changeSwitch(item)"></el-switch> <el-switch v-model="employeePerformanceConfig[item + 'BFlag']" class="switchStyle" active-color="#5850ff"
active-text="开" inactive-text="关" @change="changeSwitch(item)"></el-switch>
<span class="explain" v-if="item != 'minimumWage'" @click="handleExplain(item)">示例说明</span> <span class="explain" v-if="item != 'minimumWage'" @click="handleExplain(item)">示例说明</span>
<!-- 表单 --> <!-- 表单 -->
<div v-if="employeePerformanceConfig[item + 'BFlag']"> <div v-if="employeePerformanceConfig[item + 'BFlag']">
<template v-if="item == 'commissionBonus' || item == 'highCustomerUnitBonus' || item == 'successRateBonus'"> <template v-if="item == 'commissionBonus' || item == 'highCustomerUnitBonus' || item == 'successRateBonus'">
<GLTable ref="orderRef" class="award-wrap" :tableData="employeePerformanceConfig[item + 'List']" :noDataImg="url" :tableParams="tableDataItem(item)" :hasPage="false"> <GLTable ref="orderRef" class="award-wrap" :tableData="employeePerformanceConfig[item + 'List']"
:noDataImg="url" :tableParams="tableDataItem(item)" :hasPage="false">
<template slot="startValue" slot-scope="scope"> <template slot="startValue" slot-scope="scope">
<span v-if="scope.scope.isStartEdit">{{ scope.scope.startValue }}</span> <span v-if="scope.scope.isStartEdit">{{ scope.scope.startValue }}</span>
<el-form-item v-else style="margin-bottom: 0px"> <el-form-item v-else style="margin-bottom: 0px">
...@@ -48,13 +58,17 @@ ...@@ -48,13 +58,17 @@
</template> </template>
<template slot="endValue" slot-scope="scope"> <template slot="endValue" slot-scope="scope">
<span v-if="scope.scope.isEndEdit">--</span> <span v-if="scope.scope.isEndEdit">--</span>
<el-form-item v-else style="margin-bottom: 0px" :prop="item + 'List.' + scope.index + '.endValue'" :rules="editRule.endValue"> <el-form-item v-else style="margin-bottom: 0px" :prop="item + 'List.' + scope.index + '.endValue'"
<el-input v-model="scope.scope.endValue" placeholder="请输入" @blur="handleCalculate(item, 'endValue', scope.index)"></el-input> :rules="editRule.endValue">
<el-input v-model="scope.scope.endValue" placeholder="请输入"
@blur="handleCalculate(item, 'endValue', scope.index)"></el-input>
</el-form-item> </el-form-item>
</template> </template>
<template slot="calculateValue" slot-scope="scope"> <template slot="calculateValue" slot-scope="scope">
<el-form-item style="margin-bottom: 0px" :prop="item + 'List.' + scope.index + '.calculateValue'" :rules="editRule.calculateValue"> <el-form-item style="margin-bottom: 0px" :prop="item + 'List.' + scope.index + '.calculateValue'"
<el-input v-model="scope.scope.calculateValue" placeholder="请输入" @blur="handleCalculate(item, 'calculateValue', scope.index)"></el-input> :rules="editRule.calculateValue">
<el-input v-model="scope.scope.calculateValue" placeholder="请输入"
@blur="handleCalculate(item, 'calculateValue', scope.index)"></el-input>
</el-form-item> </el-form-item>
</template> </template>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
...@@ -68,12 +82,16 @@ ...@@ -68,12 +82,16 @@
</template> </template>
<template v-else-if="item == 'constructionBonus'"> <template v-else-if="item == 'constructionBonus'">
<div class="constructionBonus-wrap"> <div class="constructionBonus-wrap">
<el-form ref="editFormRef2" size="small" :rules="editRule" :model="employeePerformanceConfig" label-width="160px" :inline="true"> <el-form ref="editFormRef2" size="small" :rules="editRule" :model="employeePerformanceConfig"
label-width="160px" :inline="true">
<el-form-item label="升级订单施工奖励/元:" prop="upgradeConstructionBonus"> <el-form-item label="升级订单施工奖励/元:" prop="upgradeConstructionBonus">
<el-input v-model="employeePerformanceConfig.upgradeConstructionBonus" @blur="handleCalcuPrice('employeePerformanceConfig', 'upgradeConstructionBonus')" placeholder="请输入"></el-input> <el-input v-model="employeePerformanceConfig.upgradeConstructionBonus"
@blur="handleCalcuPrice('employeePerformanceConfig', 'upgradeConstructionBonus')"
placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="战败订单施工奖励/元:" prop="notUpgradeConstructionBonus"> <el-form-item label="战败订单施工奖励/元:" prop="notUpgradeConstructionBonus">
<el-input v-model="employeePerformanceConfig.notUpgradeConstructionBonus" placeholder="请输入" @blur="handleCalcuPrice('employeePerformanceConfig', 'notUpgradeConstructionBonus')" ></el-input> <el-input v-model="employeePerformanceConfig.notUpgradeConstructionBonus" placeholder="请输入"
@blur="handleCalcuPrice('employeePerformanceConfig', 'notUpgradeConstructionBonus')"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -88,14 +106,17 @@ ...@@ -88,14 +106,17 @@
<el-button type="primary" @click="handleConfirm" size="medium" :loading="loading">提交</el-button> <el-button type="primary" @click="handleConfirm" size="medium" :loading="loading">提交</el-button>
</GLFooter> </GLFooter>
<!-- 门店弹窗 --> <!-- 门店弹窗 -->
<relate-store-dialog v-if="relateStoreVisible" ref="editFormMerchantRef" :relateStoreVisible="relateStoreVisible" :storeApi="storeApi" :storeSearchForm="storeSearchForm" :storeSelected="selectedList" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="relateStoreVisible=false"> <relate-store-dialog v-if="relateStoreVisible" ref="editFormMerchantRef" :relateStoreVisible="relateStoreVisible"
:storeApi="storeApi" :storeSearchForm="storeSearchForm" :storeSelected="selectedList"
@handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="relateStoreVisible = false">
<el-row slot> <el-row slot>
<el-form :model="storeSearchForm" ref="relate" :inline="true" label-width="90px"> <el-form :model="storeSearchForm" ref="relate" :inline="true" label-width="90px">
<el-form-item label="门店名称:" prop="merchantName"> <el-form-item label="门店名称:" prop="merchantName">
<el-input :size="size" v-model.trim="storeSearchForm.merchantName" placeholder="请输入门店名称" clearable></el-input> <el-input :size="size" v-model.trim="storeSearchForm.merchantName" placeholder="请输入门店名称" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="商户号:" prop="merchantIdKeyword"> <el-form-item label="商户号:" prop="merchantIdKeyword">
<el-input :size="size" v-model.trim="storeSearchForm.merchantIdKeyword" placeholder="请输入商户号" clearable></el-input> <el-input :size="size" v-model.trim="storeSearchForm.merchantIdKeyword" placeholder="请输入商户号"
clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button :size="size" type="primary" @click="handleSearchStore">搜索</el-button> <el-button :size="size" type="primary" @click="handleSearchStore">搜索</el-button>
...@@ -109,7 +130,7 @@ ...@@ -109,7 +130,7 @@
</template> </template>
<script> <script>
import relateStoreDialog from './relateStoreDialog' import relateStoreDialog from './relateStoreDialog.vue'
import explainDialog from './explainDialog.vue' import explainDialog from './explainDialog.vue'
import BigNumber from 'bignumber.js' import BigNumber from 'bignumber.js'
export default { export default {
...@@ -570,7 +591,7 @@ export default { ...@@ -570,7 +591,7 @@ export default {
}, },
handleCalcuPrice(formName, data) { handleCalcuPrice(formName, data) {
this[formName][data] = this[formName][data] ? new BigNumber(this[formName][data]).dp(2).toNumber() : '' this[formName][data] = this[formName][data] ? new BigNumber(this[formName][data]).dp(2).toNumber() : ''
if(!this[formName][data]) this[formName][data]='' if (!this[formName][data]) this[formName][data] = ''
}, },
handleCalculate(item, key, index) { handleCalculate(item, key, index) {
let formData = this.employeePerformanceConfig[item + 'List'] let formData = this.employeePerformanceConfig[item + 'List']
...@@ -583,7 +604,7 @@ export default { ...@@ -583,7 +604,7 @@ export default {
//下一行区间开启值自动在上一行的区间结束值的基础上+0.01 //下一行区间开启值自动在上一行的区间结束值的基础上+0.01
if (formData[index + 1] && key == 'endValue' && formData[index][key]) formData[index + 1].startValue = new BigNumber(formData[index][key]).plus(0.01).toNumber() if (formData[index + 1] && key == 'endValue' && formData[index][key]) formData[index + 1].startValue = new BigNumber(formData[index][key]).plus(0.01).toNumber()
if(! formData[index][key]) formData[index][key]='' if (!formData[index][key]) formData[index][key] = ''
}, },
handleDelete(item, index) { handleDelete(item, index) {
let bonusType = item == 'commissionBonus' ? 0 : item == 'highCustomerUnitBonus' ? 1 : 2 let bonusType = item == 'commissionBonus' ? 0 : item == 'highCustomerUnitBonus' ? 1 : 2
...@@ -735,7 +756,7 @@ export default { ...@@ -735,7 +756,7 @@ export default {
.then(() => { .then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => {}) .catch(() => { })
} else { } else {
this.cancelJump() this.cancelJump()
} }
...@@ -760,9 +781,8 @@ export default { ...@@ -760,9 +781,8 @@ export default {
this.$refs.editFormMerchantRef.handleCurrentChange(1) this.$refs.editFormMerchantRef.handleCurrentChange(1)
}, },
handleSearchReset() { handleSearchReset() {
this.storeSearchForm.merchantName= '', ; (this.storeSearchForm.merchantName = ''),
this.storeSearchForm.merchantIdKeyword= '', (this.storeSearchForm.merchantIdKeyword = ''),
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.editFormMerchantRef.handleCurrentChange(1) this.$refs.editFormMerchantRef.handleCurrentChange(1)
}) })
...@@ -793,9 +813,11 @@ export default { ...@@ -793,9 +813,11 @@ export default {
margin-left: 154px; margin-left: 154px;
margin-top: -22px; margin-top: -22px;
} }
/deep/ td.el-table__cell { /deep/ td.el-table__cell {
height: 64px; height: 64px;
} }
/deep/ .el-form-item__error { /deep/ .el-form-item__error {
padding-top: 2px; padding-top: 2px;
z-index: 9999999; z-index: 9999999;
...@@ -883,6 +905,4 @@ export default { ...@@ -883,6 +905,4 @@ export default {
color: #5850ff; color: #5850ff;
margin-left: 9px; margin-left: 9px;
cursor: pointer; cursor: pointer;
}
</style>
\ No newline at end of file \ No newline at end of file
}</style>
...@@ -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!