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 = {
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 = {
// 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)
},
// /**
// * 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
......@@ -337,5 +337,5 @@ 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 downLoadFile = Util.downLoadFile
export const returnFloat = Util.returnFloat
......@@ -3,8 +3,7 @@
<template>
<el-alert title="每月最后一天24:00按当月业务完成情况自动计算员工绩效。"
show-icon
class="tip-cla">
</el-alert>
class="tip-cla"></el-alert>
</template>
<div class="container">
<GLCombiForm ref="showSearch"
......@@ -97,9 +96,9 @@
</template>
<script>
import * as dayjs from 'dayjs'
// import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { downLoadFile } from '@/common/util'
import { downLoadFile } from '@/common/format'
import ResidentDetailDialog from './residentDetailDialog.vue'
import ResidentCorrectionDialog from './residentCorrectionDialog.vue'
export default {
......@@ -122,7 +121,7 @@ export default {
{
label: '绩效月份',
prop: 'performanceMonth',
addHtml: 'performanceMonth',
addHtml: 'performanceMonth'
},
{
label: '员工姓名',
......@@ -135,7 +134,7 @@ export default {
label: '员工手机号',
name: 'staffPhone',
type: 'input',
inputType: "number",
inputType: 'number',
isClear: true,
maxlength: '11'
},
......@@ -306,7 +305,7 @@ export default {
prop: 'status',
width: '100px',
addHtml: 'applyStatus'
},
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
......@@ -324,16 +323,18 @@ export default {
// 基本数据
baseData: {
merchantList: [],
statusList: [{
confId: 0,
confName: '未下发'
},
{
confId: 1,
confName: '已下发'
}]
statusList: [
{
confId: 0,
confName: '未下发'
},
{
confId: 1,
confName: '已下发'
}
]
},
setMonthFlag: false,//第一次进入页面时设置绩效月份参数值
setMonthFlag: false //第一次进入页面时设置绩效月份参数值
}
},
components: {
......@@ -348,15 +349,15 @@ export default {
methods: {
getLastMonth() {
// 获取上个月日期
var date = new Date;
var year = date.getFullYear();
var month = date.getMonth();
var date = new Date()
var year = date.getFullYear()
var month = date.getMonth()
if (month == 0) {
year = year - 1;
month = 12;
year = year - 1
month = 12
}
month = month > 10 ? month : "0" + month
this.searchForm.performanceMonth = year.toString() + '-' + month;
month = month > 10 ? month : '0' + month
this.searchForm.performanceMonth = year.toString() + '-' + month
},
getServiceCenterList() {
const params = {
......@@ -373,7 +374,8 @@ export default {
},
beforeSearchFn() {
return new Promise(resolve => {
if (!this.setMonthFlag) {//进入页面时设置绩效月份参数值
if (!this.setMonthFlag) {
//进入页面时设置绩效月份参数值
this.getLastMonth()
}
this.tableSearchForm = this.getParams()
......@@ -425,13 +427,13 @@ export default {
distribute_commit(selectedData) {
if (!selectedData?.length) {
this.$message({
message: "请选择需要下发的记录",
type: "warning",
message: '请选择需要下发的记录',
type: 'warning',
showClose: true
})
return false
}
var idList = selectedData.map((item) => {
var idList = selectedData.map(item => {
return item.id
})
this.$confirm('<strong>是否确定下发?</strong> <div>完成工资记录下发后,员工可查看到对应的工资记录,且不允许再修改</div> ', '提示', {
......@@ -439,17 +441,19 @@ export default {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$apis.performanceManage.batchIssueApi({ idList: idList }).then(res => {
this.$notify({
type: 'success',
title: res.message || '操作成功'
})
.then(() => {
this.$apis.performanceManage.batchIssueApi({ idList: idList }).then(res => {
this.$notify({
type: 'success',
title: res.message || '操作成功'
})
this.$refs.residentRef.refreshTable()
})
this.$refs.residentRef.refreshTable()
})
}).catch(err => {
console.log(err)
})
.catch(err => {
console.log(err)
})
},
exportExcel_summary() {
var params = this.getParams()
......@@ -462,11 +466,11 @@ export default {
this.$apis.performanceManage.exportDetailApi(params).then(res => {
downLoadFile(res)
})
},
}
}
}
</script>
<style scoped>
<style scoped lang="scss">
.tip-cla {
margin: 16px 0 16px 0;
width: 1184px;
......@@ -474,10 +478,12 @@ export default {
background: #e4e3ff;
border-radius: 4px;
}
.flex {
display: flex;
align-items: center;
}
.dot {
width: 6px;
height: 6px;
......@@ -485,12 +491,15 @@ export default {
border-radius: 4px;
margin-right: 6px;
}
.green {
background: #4aca74;
}
.red {
background: #eb4e4e;
}
.grey {
background: #999999;
}
......
......@@ -3,8 +3,7 @@
<template>
<el-alert title="每月最后一天24:00按当月业务完成情况自动计算员工绩效。"
show-icon
class="tip-cla">
</el-alert>
class="tip-cla"></el-alert>
</template>
<div class="container">
<GLCombiForm ref="showSearch"
......@@ -97,9 +96,9 @@
</template>
<script>
import * as dayjs from 'dayjs'
// import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { downLoadFile } from '@/common/util'
import { downLoadFile } from '@/common/format'
import TechnicianDetailDialog from './technicianDetailDialog.vue'
import TechnicianCorrectionDialog from './technicianCorrectionDialog.vue'
export default {
......@@ -122,7 +121,7 @@ export default {
{
label: '绩效月份',
prop: 'performanceMonth',
addHtml: 'performanceMonth',
addHtml: 'performanceMonth'
},
{
label: '员工姓名',
......@@ -135,7 +134,7 @@ export default {
label: '员工手机号',
name: 'staffPhone',
type: 'input',
inputType: "number",
inputType: 'number',
isClear: true,
maxlength: '11'
},
......@@ -239,7 +238,7 @@ export default {
prop: 'status',
width: '100px',
addHtml: 'applyStatus'
},
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
......@@ -257,16 +256,18 @@ export default {
// 基本数据
baseData: {
merchantList: [],
statusList: [{
confId: 0,
confName: '未下发'
},
{
confId: 1,
confName: '已下发'
}]
statusList: [
{
confId: 0,
confName: '未下发'
},
{
confId: 1,
confName: '已下发'
}
]
},
setMonthFlag: false,//第一次进入页面时设置绩效月份参数值
setMonthFlag: false //第一次进入页面时设置绩效月份参数值
}
},
components: {
......@@ -280,14 +281,14 @@ export default {
methods: {
getLastMonth() {
// 获取上个月日期
var date = new Date;
var year = date.getFullYear();
var month = date.getMonth();
var date = new Date()
var year = date.getFullYear()
var month = date.getMonth()
if (month == 0) {
year = year - 1;
month = 12;
year = year - 1
month = 12
}
this.searchForm.performanceMonth = year.toString() + '-' + month;
this.searchForm.performanceMonth = year.toString() + '-' + month
},
getServiceCenterList() {
const params = {
......@@ -304,7 +305,8 @@ export default {
},
beforeSearchFn() {
return new Promise(resolve => {
if (!this.setMonthFlag) {//进入页面时设置绩效月份参数值
if (!this.setMonthFlag) {
//进入页面时设置绩效月份参数值
this.getLastMonth()
}
this.tableSearchForm = this.getParams()
......@@ -356,13 +358,13 @@ export default {
distribute_commit(selectedData) {
if (!selectedData?.length) {
this.$message({
message: "请选择需要下发的记录",
type: "warning",
message: '请选择需要下发的记录',
type: 'warning',
showClose: true
})
return false
}
var idList = selectedData.map((item) => {
var idList = selectedData.map(item => {
return item.id
})
this.$confirm('<strong>是否确定下发?</strong> <div>完成工资记录下发后,员工可查看到对应的工资记录,且不允许再修改</div> ', '提示', {
......@@ -370,17 +372,19 @@ export default {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$apis.performanceManage.batchIssueApi({ idList: idList }).then(res => {
this.$notify({
type: 'success',
title: res.message || '操作成功'
})
.then(() => {
this.$apis.performanceManage.batchIssueApi({ idList: idList }).then(res => {
this.$notify({
type: 'success',
title: res.message || '操作成功'
})
this.$refs.residentRef.refreshTable()
})
this.$refs.residentRef.refreshTable()
})
}).catch(err => {
console.log(err)
})
.catch(err => {
console.log(err)
})
},
exportExcel_summary() {
var params = this.getParams()
......@@ -393,7 +397,7 @@ export default {
this.$apis.performanceManage.exportDetailApi(params).then(res => {
downLoadFile(res)
})
},
}
}
}
</script>
......@@ -405,10 +409,12 @@ export default {
background: #e4e3ff;
border-radius: 4px;
}
.flex {
display: flex;
align-items: center;
}
.dot {
width: 6px;
height: 6px;
......@@ -416,12 +422,15 @@ export default {
border-radius: 4px;
margin-right: 6px;
}
.green {
background: #4aca74;
}
.red {
background: #eb4e4e;
}
.grey {
background: #999999;
}
......
......@@ -7,8 +7,8 @@
</div>
</template>
<script>
import ResidentPerformance from "./components/residentPerformance.vue"
import TechnicianPerformance from "./components/technicianPerformance.vue"
import ResidentPerformance from './components/residentPerformance.vue'
import TechnicianPerformance from './components/technicianPerformance.vue'
export default {
components: {
ResidentPerformance,
......@@ -16,40 +16,34 @@ export default {
},
data() {
return {
activeName: "1",
activeName: '1',
tabPaneList: [
{
label: "驻店绩效",
name: "1"
label: '驻店绩效',
name: '1'
},
{
label: "技师绩效",
name: "2"
label: '技师绩效',
name: '2'
}
],
tabName: "ResidentPerformance"
tabName: 'ResidentPerformance'
}
},
mounted() {
},
computed: {
},
watch: {
},
mounted() { },
computed: {},
watch: {},
methods: {
handleClick() {
let arr = {
1: "residentPerformance",
2: "technicianPerformance"
1: 'residentPerformance',
2: 'technicianPerformance'
}
this.tabName = arr[+this.activeName]
console.log(this.tabName);
},
console.log(this.tabName)
}
}
}
</script>
<style scoped>
<style scoped lang="scss">
</style>
......@@ -3,7 +3,9 @@ const packageName = require('./package.json').name
const node_env = process.env.NODE_ENV === 'production'
const publicPath = node_env ? `/child/${packageName}/` : '/'
const resolve = dir => path.join(__dirname, dir)
const CopyDir = require('./plugins/copyDir')
const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const isDev = process.env.NODE_ENV !== 'development'
const cdn = {
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']
......@@ -13,21 +15,22 @@ module.exports = {
publicPath,
assetsDir: 'static',
productionSourceMap: false,
configureWebpack: {
resolve: {
configureWebpack: config => {
config.resolve = {
alias: {
'@': resolve('src'),
assets: resolve('src/assets'),
views: resolve('src/views'),
components: resolve('src/components')
}
},
output: {
}
config.output = {
...config.output,
library: `${packageName}-[name]`,
libraryTarget: 'umd', // 把微应用打包成 umd 库格式
jsonpFunction: `webpackJsonp_${packageName}`
},
externals: {
}
config.externals = {
vue: 'Vue',
'element-ui': 'ELEMENT',
'vue-router': 'VueRouter',
......@@ -36,7 +39,38 @@ module.exports = {
echarts: 'echarts',
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: {
hot: true,
disableHostCheck: true,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!