Commit ffd12c3b by zhangxw

4月份大版本需求开发

1 parent e1963598
......@@ -231,7 +231,7 @@ export function getResidentListApi(data) {
// 导入员工修订工资
export function importStaffSalaryApi(data) {
data.method = `${path2}staffMonthSalary.correctSalary.byImport`
data.method = `${path2}staffMonthSalary.staffSalary.import`
return request(data, "post", ["file"])
}
......@@ -505,4 +505,16 @@ export function getClockSalaryList(data = {}) {
export function exportClockSalaryList(data = {}) {
data.method = 'dj.api.smartcarlife.clock.in.staff.appeal.list.export'
return request(data, 'post')
}
// 获取员工月度扣款明细
export function getStaffDeductDetailAPI(data) {
data.method = `${path2}staffMonthSalary.deductDetail`
return request(data, 'post')
}
// 获取员工考勤明细
export function getStaffAttendanceDetailAPI(data) {
data.method = `${path2}clock.in.staff.attendance.detail`
return request(data, "post")
}
\ No newline at end of file
......@@ -455,8 +455,10 @@ export default {
}
})
v.listShowSpecificationData = specificationValueSequenceArr?.join('/')
} else {
} else if (v?.specificationData?.includes(";~;")) {
v.listShowSpecificationData = v?.specificationData?.replace(RegExp(';~;', 'g'), '/')
} else {
v.listShowSpecificationData = "-"
}
// v.listShowSpecificationData =
// val.goodsSpecificationNameList?.length > 1
......@@ -474,6 +476,8 @@ export default {
val.goodsSpecificationNameList
v.createdDate = val.createdDate
v.updatedDate = val.updatedDate
v.goodsInfo.brandMerchantName = val.goodsInfo?.brandMerchantName || '-'
v.goodsInfo.supplierName = val.goodsInfo?.supplierName || '-'
})
const minPrice = shopPriceArr.length
? Math.min(...shopPriceArr)
......
......@@ -148,7 +148,7 @@ export const routerName = {
{
authId: "9120507",
parentId: "91205",
label: "导出员工业绩",
label: "工资导入导出",
category: "Button",
type: "default",
handle: "handleExportPerformance"
......@@ -156,12 +156,12 @@ export const routerName = {
{
authId: "9120508",
parentId: "91205",
label: "历史业绩",
label: "工资提成",
handle: "handleHistoryPerformance",
addRoutePath: [
{
authId: "912050501",
name: "历史业绩",
name: "工资提成",
parentId: "9120505"
}
]
......
......@@ -354,6 +354,13 @@ export default {
return cellValue.upgradeGoodsName || '-'
}
}, {
label: '规格',
prop: 'thirdPartyCode',
width: 140,
formatter: (cellValue) => {
return cellValue?.specificationData || '-'
}
}, {
label: '售价/元',
prop: 'sellPrice',
formatter: (cellValue) => {
......
......@@ -119,7 +119,7 @@
<script>
import { Util } from '@/common/util'
import { getProductManageList, productImport } from '@api/productManage'
import { getAllCategory } from '@api/product'
import { getAllCategory, getBrandSupplyMerchant } from '@api/product'
import { mapActions, mapState, mapMutations } from 'vuex'
import { baseGoodsDelete } from '@api/commodity'
import drawerDetail from './components/drawerDetail.vue'
......@@ -137,7 +137,9 @@ export default {
secondaryGoodsType: '',
thirdLevelGoodsType: '',
baseGoodsStatus: '',
type: ''
type: '',
supplierCode: '',
brandMerchantCode: ''
},
tempGoodsType: [],
showFormData: [{
......@@ -170,9 +172,23 @@ export default {
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'statusList'
}
],
}, {
label: '供应方',
name: 'supplierCode',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'relatedPartyName',
optionsName: 'supplierCodeList'
}, {
label: '品牌方',
name: 'brandMerchantCode',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'relatedPartyName',
optionsName: 'brandMerchantCodeList'
}],
getListApi: getProductManageList,
// 表格参数
tableParams: {
......@@ -216,6 +232,14 @@ export default {
return result
}
}, {
label: '供应方',
parentProp: 'goodsInfo',
prop: 'supplierName'
}, {
label: '品牌方',
parentProp: 'goodsInfo',
prop: 'brandMerchantName'
}, {
label: '规格',
prop: 'listShowSpecificationData',
width: '160'
......@@ -277,7 +301,9 @@ export default {
}, {
confId: 3,
confValue: '草稿'
}]
}],
supplierCodeList: [], // 供应方
brandMerchantCodeList: [] // 品牌方
},
selfBuildGoodsType: baseConfig.selfBuildGoodsType || '', // 服务商自建类目值
positionTypeList: [], // 太阳膜类商品部位
......@@ -318,6 +344,9 @@ export default {
getAllCategory({ categoryTypeList: this.selfBuildGoodsType, pageSize: 9999, currentPage: 1 }).then(res => {
this.baseData.productTypeList = res?.list || []
})
// 获取品牌方/供应方数据 1品牌商 2供应方
this.getBrandSupplyList(1)
this.getBrandSupplyList(2)
},
methods: {
......@@ -327,6 +356,18 @@ export default {
}),
...mapMutations('d2admin/user', ['setUpdateRefesh']),
...mapActions('d2admin/user', ['actionSetDownloadList']),
getBrandSupplyList(num) {
getBrandSupplyMerchant({
partitionFlag: num
}).then(res => {
if (num == 1) {
this.baseData.brandMerchantCodeList = res
} else {
this.baseData.supplierCodeList = res
}
this.getBaseData()
})
},
selectAddAttr(value) {
this.searchForm.goodsType = value?.[0]
this.searchForm.secondaryGoodsType = value?.[1]
......@@ -336,6 +377,17 @@ export default {
this.positionTypeList = await this.get(BaseData.positionTypeList)
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {}
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
}
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
......
<!-- 基本工资明细 -->
<template>
<div class="basic-dialog">
<d2-dialog
title="考勤明细"
:is-visible="visible"
noCancel
:isShowFooter="false"
width="720px"
@closeDialog="handleConfirm"
@confirmDialog="handleConfirm"
>
<div class="top-box">
<div class="item">本月应出勤天数:{{ staticData.requiredAttendanceDays }}天</div>
<div class="item">实际出勤天数:{{ staticData.actualAttendanceDays }}</div>
</div>
<div class="content">
<el-tabs v-model="activeName">
<el-tab-pane
v-for="item in tabList"
:key="item.id"
:label="item.label"
:name="item.id"
>
<el-table
v-if="item.tableData.length"
:data="item.tableData"
class="table_class"
border
:header-cell-style="{
'text-align': 'center',
'background-color': '#fafafa'
}"
show-summary
:summary-method="getSummaries"
style="width: 100%"
>
<el-table-column
type="index"
align="center"
label="序号"
width="80"
/>
<el-table-column
:prop="'attendanceType'"
align="center"
label="考勤类型"
/>
<el-table-column
:prop="'clockInDate'"
align="center"
label="考勤日期"
/>
<el-table-column
:prop="'deductionDays'"
align="center"
label="扣减天数"
/>
</el-table>
<div class="empty-box" v-else>
<img src="@/assets/empty.png">
<div class="empty-text">暂无记录</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</d2-dialog>
</div>
</template>
<script>
import BigNumber from 'bignumber.js'
import { getStaffAttendanceDetailAPI } from '@api/resident.js'
import { isEmpty } from '../util.js'
export default {
name: 'BasicSalaryDialog',
data() {
return {
isEmpty,
activeName: '0',
tabList: [{
label: '扣减天数',
id: '0',
tableData: []
}, {
label: '着装异常',
id: '1',
tableData: []
}, {
label: '法定节假日加班',
id: '2',
tableData: []
}],
staticData: {}
}
},
props: {
basicVisible: {
type: Boolean,
default: false
},
detailInfo: {
type: Object,
default: () => {}
}
},
computed: {
visible: {
get() {
return this.basicVisible
},
set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'basicVisible' })
}
}
},
mounted() {
this.getDetail()
},
methods: {
// 处理请求接口日期传参
getMonthStartEndWithTime(monthStr) {
const [year, month] = monthStr.split('-').map(Number)
const firstDay = new Date(year, month - 1, 1, 0, 0, 0)
const firstDayStr = this.formatDateTime(firstDay)
const lastDay = new Date(year, month, 0, 23, 59, 59)
const lastDayStr = this.formatDateTime(lastDay)
return {
firstDay: firstDayStr,
lastDay: lastDayStr
}
},
formatDateTime(date) {
const y = date.getFullYear();
const m = String(date.getMonth() + 1).padStart(2, '0');
const d = String(date.getDate()).padStart(2, '0');
const hh = String(date.getHours()).padStart(2, '0');
const mm = String(date.getMinutes()).padStart(2, '0');
const ss = String(date.getSeconds()).padStart(2, '0');
return `${y}-${m}-${d} ${hh}:${mm}:${ss}`;
},
getDetail() {
let { firstDay, lastDay } = this.getMonthStartEndWithTime(this.detailInfo?.salaryMonth)
let params = {
pageSize: 9999,
currentPage: 1,
staffPhone: this.detailInfo?.staffPhone,
commitTimeStart: firstDay,
commitTimeEnd: lastDay
}
getStaffAttendanceDetailAPI(params).then(res => {
res?.exceptionInfoList?.forEach(val => {
val?.exceptionDetailList?.forEach(v => {
v.attendanceType = `${!this.isEmpty(v.attendanceType) ? v.attendanceType : ''}${!this.isEmpty(v.exceptionState) ? v.exceptionState : ''}`
})
})
// 实际出勤天数大于等于应出勤天数,显示满勤
if (Number(res?.actualAttendanceDays) >= Number(res?.requiredAttendanceDays)) {
res.actualAttendanceDays = '满勤'
} else {
res.actualAttendanceDays = `${res?.actualAttendanceDays}天`
}
this.tabList = this.categorizeData(res?.exceptionInfoList, [1, 2, 3, 4])
this.staticData = res || {}
})
},
// 处理返回数据
categorizeData(originalData, typeGroups) {
const result = this.tabList
originalData?.forEach(item => {
const detailList = item?.exceptionDetailList || []
// 扣减天数
if (typeGroups?.includes(item.exceptionType)) {
this.processAndPushData(detailList, result[0].tableData, '-')
// 着装异常
} else if (item.exceptionType === 5) {
this.processAndPushData(detailList, result[1].tableData, '-')
// 加班
} else if (item.exceptionType === 6) {
this.processAndPushData(detailList, result[2].tableData, '+')
}
})
return result
},
processAndPushData(sourceData, targetArray, prefix) {
sourceData.forEach(item => {
const days = Number(item.deductionDays)
targetArray.push({
...item,
deductionDays: isNaN(days) ? item.deductionDays : `${prefix}${Math.abs(days)}`
})
})
},
// 表格底部累加
getSummaries(param) {
const { columns } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = this.activeName == '2' ? '加班天数合计' : '扣减天数合计'
column.align = "is-left"
column.colSpan = 3
return
}
if (index === 1) {
const numberList = this.tabList[Number(this.activeName)]?.tableData.map((item) => !isNaN(item.deductionDays) ? item.deductionDays : 0)
sums[index] =
(numberList.length
? numberList.reduce((preVal, curVal) => {
return `${this.activeName == 2 ? '+' : ''}${new BigNumber(preVal || 0).plus(new BigNumber(curVal || 0)).toNumber()}`
})
: "0")
}
})
return sums
},
handleConfirm() {
this.$emit('dialogClose')
}
}
}
</script>
<style lang="scss" scoped>
.basic-dialog{
::v-deep .el-dialog__header {
color: #333333;
font-family: PingFangSC-Medium;
font-size: 20px;
font-weight: 600;
border-bottom: 1px solid #e6e6e6;
}
::v-deep .el-dialog__headerbtn .el-dialog__close {
color: #666;
font-weight: 600;
font-size: 20px;
}
.top-box {
display: flex;
align-items: center;
margin-bottom: 8px;
.item {
width: 50%;
}
}
.content {
::v-deep .el-tabs__header {
position: relative;
.el-tabs__nav-scroll{
background: transparent;
padding: 0;
overflow: hidden;
.el-tabs__nav {
background: transparent;
height: auto;
border-radius: 0;
margin-left: 0;
padding: 0;
.el-tabs__active-bar {
display: inline-block !important;
}
.el-tabs__item {
height: 40px;
line-height: 40px;
padding: 0 10px;
}
.el-tabs__item.is-active {
color: #2A58AD;
font-weight: 600;
background: transparent;
border: none;
}
}
}
}
}
.table_class {
margin-top: 10px !important;
max-height: calc(68vh - 130px);
overflow-y: auto;
::v-deep .el-table__row{
height: 48px;
td {
text-align: center;
}
}
::v-deep .el-table__footer-wrapper .has-gutter{
height: 48px;
}
}
.empty-box {
text-align: center;
padding-bottom: 80px;
img {
width: 64px;
height: 40px;
margin-top: 100px;
}
.empty-text {
font-size: 14px;
color: #999999;
}
}
}
</style>
\ No newline at end of file
<!-- 扣款明细 -->
<template>
<div class="deduction-dialog">
<d2-dialog
:is-visible="visible"
noCancel
:isShowFooter="false"
width="720px"
@closeDialog="handleConfirm"
@confirmDialog="handleConfirm"
>
<div slot="sub-title" class="title">扣款明细
<el-tooltip class="item" effect="dark" placement="right">
<template slot="content">
<img style="width: 400px;" src="https://img02.glsx.com.cn/weapp/resource/saas/dj/images/deduction_tips_img.png" />
</template>
<i class="el-icon-info"></i>
</el-tooltip>
</div>
<div class="content" v-if="show">
<div class="item" v-for="item in formData" :key="item.value">
<div class="label">{{ item.label }}:</div>
<div class="value">
<el-input :value="formatMoney(infoData[item.value], item)" disabled></el-input>
<div v-if="item.tipsKey && infoData[item.value]" class="value-tips">
月度总提成的<span style="color: #2A58AD;">{{infoData[item.tipsKey]}}%</span>延迟6个月发放
</div>
<div v-if="item.hasDetail" class="value-tips">
<template v-if="item.value === 'dailyDeductMoney'">
<div class="deduct-item" v-if="infoData.dailyDeductDetailData1.length">精品升级 本月扣
<span v-for="(subItem, subIndex) in infoData.dailyDeductDetailData1" :key="subIndex" class="tips-text">{{ subItem }}日
<span v-if="subIndex !== infoData.dailyDeductDetailData1.length - 1">、</span>
</span>
</div>
<div class="deduct-item" v-if="infoData.dailyDeductDetailData2.length">会员权益/升级 本月扣
<span v-for="(subItem, subIndex) in infoData.dailyDeductDetailData2" :key="subIndex" class="tips-text">{{ subItem }}日
<span v-if="subIndex !== infoData.dailyDeductDetailData2.length - 1">、</span>
</span>
</div>
</template>
<template v-else-if="item.value === 'padDeductMoney'">
<div>
本月录音数<span class="tips-text">{{ infoData.recordingCount || 0 }}</span>条 本月总触客数<span class="tips-text">{{ infoData.toShopFilmCount || 0 }}</span>人
</div>
</template>
</div>
</div>
</div>
</div>
</d2-dialog>
</div>
</template>
<script>
import { getStaffDeductDetailAPI } from '@api/resident'
import { isEmpty, filterStr } from '../util.js'
export default {
name: 'BasicSalaryDialog',
data() {
return {
isEmpty,
dialogConfig: {
title: '',
width: '720px'
},
formData: [
{
label: '日报扣款',
value: 'dailyDeductMoney',
hasDetail: true
},
{
label: '平板扣款',
value: 'padDeductMoney',
hasDetail: true
},
{
label: '递延金扣款',
value: 'deferExpenses',
tipsKey: 'deferredRatio'
},
{
label: '递延金纳入',
value: 'deferIncome',
tipsKey: 'deferredRatio2'
},
{
label: '退单冲减',
value: 'refundOffset'
},
{
label: '其它应发/应扣',
value: 'otherDeduction'
}
],
infoData: {},
show: false
}
},
props: {
deductionVisible: {
type: Boolean,
default: false
},
detailRow: {
type: Object,
default: () => {}
},
detailInfo: {
type: Object,
default: () => {}
}
},
computed: {
visible: {
get() {
return this.deductionVisible
},
set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'deductionVisible' })
}
}
},
mounted() {
this.getDeductDetail()
},
methods: {
formatMoney(value, item) {
const num = Number(value);
return isNaN(num) ? '0元' : `${num}元`;
},
handleConfirm() {
this.$emit('dialogClose')
},
getDeductDetail() {
getStaffDeductDetailAPI({ id: this.detailRow?.id }).then(res => {
res.toShopFilmCount = null
this.infoData = {
...res,
refundOffset: !this.isEmpty(res?.refundOffset) ? `-${Math.abs(res?.refundOffset)}` : 0,
dailyDeductDetailData1: res?.dailyDeductDetailData1?.length ? this.getSortedDays(res?.dailyDeductDetailData1) : [],
dailyDeductDetailData2: res?.dailyDeductDetailData2?.length ? this.getSortedDays(res?.dailyDeductDetailData2) : []
}
this.show = true
})
},
getSortedDays(dateArray, ascending = true) {
// 1. 按日期排序
const sortedDates = dateArray.sort((a, b) => {
return ascending ? new Date(a) - new Date(b) : new Date(b) - new Date(a)
})
return sortedDates.map(date => {
const day = date.split("-")[2]
return parseInt(day, 10).toString()
})
}
}
}
</script>
<style lang="scss" scoped>
.deduction-dialog {
::v-deep .el-dialog__header {
border-bottom: 1px solid #e6e6e6;
}
::v-deep .el-dialog__headerbtn .el-dialog__close {
color: #666;
font-weight: 600;
font-size: 20px;
}
::v-deep .dialog-sub-title {
color: #333333;
font-family: PingFangSC-Medium;
font-size: 20px;
font-weight: 600;
}
.content{
padding: 0 30px;
max-height: calc(68vh - 70px);
overflow-y: auto;
.item {
display: flex;
// align-items: center;
margin-bottom: 20px;
.label {
width: 110px;
text-align: right;
margin-top: 8px;
color: #333333;
}
.value {
width: 432px;
.value-tips {
margin-top: 8px;
color: #666666;
.tips-text {
color: #5579bd;
}
}
.deduct-item{
margin-top: 5px;
&:first-child {
margin: 0;
}
}
}
}
}
}
</style>
\ No newline at end of file
<!-- 导出员工业绩 -->
<!-- 工资导入导出 -->
<template>
<baseDialog :dialog-config="dialogConfig" :is-show.sync="visible"
@handleClick="handleAddConfirm">
......@@ -11,25 +11,41 @@
:form-obj="infoForm"
:form-data="formData"
:form-rules="formRules">
<template slot="titleBox1">
<div class="title_box">工资导出</div>
</template>
<template slot="staffPhoneList">
<el-select
class="select"
style="width: 432px;"
filterable
v-model="infoForm.staffPhoneList"
multiple
collapse-tags
:multiple-limit="10"
>
<el-option
v-for="item in baseData.staffList"
:key="item.staffPhone"
:label="item.staffName"
:value="item.staffPhone"
/>
</el-select>
</template>
<template slot="monthPicker">
<el-date-picker
v-model="infoForm.month"
type="month"
type="monthrange"
style="width: 432px;"
:picker-options="monthPickerOptions"
popper-class="statement-of-export-performance-month-picker">
</el-date-picker>
</template>
<template slot="sceneType">
<el-checkbox-group v-model="infoForm.sceneType" class="sceneTypes_check">
<el-checkbox v-for="item in baseData.sceneTypesList" :key="item.confId" :label="item.confId">{{item.confValue}}</el-checkbox>
</el-checkbox-group>
</template>
<template slot="exportBtn">
<el-button type="primary" class="export_btn" size="small" plain @click="exportData">导出</el-button>
</template>
<template slot="titleBox2">
<div class="title_box">修正业绩</div>
<div class="title_box">导入更新</div>
</template>
<template slot="importSalary">
<el-button size="small" class="import_btn">
......@@ -39,7 +55,7 @@
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
@change="importFile($event)" />
<i class="el-icon-plus"></i>上传文件</el-button>
<el-button type="text" size="small" @click="downloadTemplate">模板下载</el-button>
<!-- <el-button type="text" size="small" @click="downloadTemplate">模板下载</el-button> -->
<div class="file_box" v-if="fileName">
<div class="file_name">{{fileName}}</div>
<i class="el-icon-delete"
......@@ -54,23 +70,19 @@
<script>
import { getLevelStaffListApi } from '@api/resident'
import { staffSceneLabelList } from '@/common/constants'
import { deepClone } from '@/common/util'
export default {
name: 'exportPerformanceDialog',
data() {
return {
formData: [
{
label: '',
addHtml: 'titleBox1'
},
{
label: '选择员工',
name: 'staffPhoneList',
type: 'select',
optionList: [],
multiple: true,
collapseTags: true,
optionId: 'staffPhone',
optionLabel: 'staffName',
optionsName: 'staffList'
addHtml: 'staffPhoneList'
},
{
label: '选择时间',
......@@ -87,7 +99,7 @@ export default {
addHtml: 'titleBox2'
},
{
label: '导入修正实发工资',
label: '导入更新',
name: '',
addHtml: 'importSalary'
}
......@@ -104,27 +116,28 @@ export default {
const currentMonth = today.getMonth()
const month = date.getMonth()
const year = date.getFullYear()
// 当前年份
// 计算过去12个月的起始日期
const twelveMonthsAgo = new Date(today)
twelveMonthsAgo.setMonth(currentMonth - 11)
// 允许选择过去12个月的日期,不包含当前月份
if (year === currentYear) {
return month >= currentMonth || month < currentMonth - 3
return month >= currentMonth || date > today || date < twelveMonthsAgo;
} else if (year === currentYear - 1) {
return month > 11 || month < 9
return month > 11 || month < currentMonth
} else {
return year >= currentYear
return year < currentYear - 1 || year > currentYear
}
}
},
infoForm: {
staffPhoneList: [],
sceneType: [],
month: ''
month: []
},
baseData: {
sceneTypesList: deepClone(staffSceneLabelList),
staffList: []
},
dialogConfig: {
title: '导出员工业绩',
title: '工资导入导出',
width: '720px'
},
fileName: ''
......@@ -148,20 +161,22 @@ export default {
},
mounted() {
this.getStaffList()
this.getOptions()
this.$nextTick(() => {
this.$refs.editFormRef?.$refs?.editChildRef?.clearValidate()
})
},
methods: {
// 获取员工下拉框数据
getStaffList() {
getLevelStaffListApi({pageSize: 9999, currentPage: 1}).then(res => {
this.baseData.staffList = res?.list || []
this.getOptions()
})
},
// 导出
exportData() {
this.$refs.editFormRef?.$refs?.editChildRef?.validate((valid) => {
if (valid) {
if (this.infoForm?.staffPhoneList?.length > 10) return this.$message.warning('最大不超过10个员工')
this.$emit('handleExport', this.infoForm)
}
})
......@@ -206,20 +221,6 @@ export default {
this.$emit('handleImport', this.fileInfo, this.fileName)
},
getOptions() {
this.formData.forEach((item, index) => {
if (item.type === "select") {
this.$set(
this.formData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
this.$nextTick(() => {
this.$refs.editFormRef?.$refs?.editChildRef?.clearValidate()
})
},
handleAddConfirm() {
this.$emit('dialogClose')
}
......@@ -228,9 +229,6 @@ export default {
</script>
<style lang="scss" scoped>
.sceneTypes_check{
margin-right: 20px;
}
.export_btn{
margin-left: 154px;
}
......@@ -239,8 +237,7 @@ export default {
color: #1D1D1D;
font-weight: 600;
border-bottom: 1px solid #E5E5E5;
padding: 8px;
margin-bottom: 16px;
padding: 0 8px;
}
.import_btn{
position: relative;
......
<!-- 员工历史业绩 -->
<!-- 员工工资提成 -->
<template>
<div class="historicalPerformance">
<div class="content">
<div class="tips-header">
<i class="el-icon-warning custom-icon"></i>
<span class="log-text">请先到员工信息中配置员工基本工资,并设置员工职级以及入职日期,配置调店分配周期以判断日报扣款规则(当前员工所在门店请到驻店工资绩效配置方案)</span>
</div>
<div class="header">
<div class="name">{{ performanceData.staffName }}</div>
<div><span>|</span>{{ performanceData.staffPhone }}<span>|</span>{{ performanceData.hireType == 1 ? '校招管培生' : performanceData.hireType == 2 ? '社会招聘' : '-' }}</div>
......@@ -32,7 +36,7 @@
</el-table-column>
<el-table-column align="center">
<template slot="header">
<span>作为导师收入</span>
<span>导师激励</span>
</template>
<template slot-scope="scope">
<span>{{ !isEmpty(scope.row.mentorCommission) ? `¥${scope.row.mentorCommission}` : '-' }}</span>
......@@ -40,7 +44,7 @@
</el-table-column>
<el-table-column align="center">
<template slot="header">
<span>门店提成</span>
<span>业务提成</span>
</template>
<template slot-scope="scope">
<span>{{ !isEmpty(scope.row.merchantCommission) ? `¥${scope.row.merchantCommission}` : '-' }}</span>
......@@ -62,6 +66,11 @@
<span>{{ !isEmpty(scope.row.dailyDeductMoney) ? `- ¥${Math.abs(scope.row.dailyDeductMoney)}` : '-' }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="递延金">
<template slot-scope="scope">
<span>{{ !isEmpty(scope.row.deferredPayment) ? `${scope.row.deferredPayment > 0 ? '+' : '-'} ¥${Math.abs(scope.row.deferredPayment)}` : '-' }}</span>
</template>
</el-table-column>
<el-table-column align="center">
<template slot="header">
<span>退单冲减</span>
......@@ -72,26 +81,10 @@
</el-table-column>
<el-table-column align="center">
<template slot="header">
<span>正负冲减</span>
</template>
<template slot-scope="scope">
<span>{{ !isEmpty(scope.row.otherDeduction) ? `¥${scope.row.otherDeduction}` : '-' }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="递延金扣款">
<template slot-scope="scope">
<span>{{ scope.row.deferExpenses ? `- ¥${Math.abs(scope.row.deferExpenses)}` : '-' }}</span>
<span>其他应发/应扣</span>
</template>
</el-table-column>
<el-table-column align="center" label="递延金纳入">
<template slot-scope="scope">
<span v-if="isEmpty(scope.row.deferIncome)">-</span>
<el-tooltip class="item" effect="dark" v-else placement="top">
<template slot="content">
<p>{{ getMonthSixMonthsBack(scope.row) }}月递延金</p>
</template>
<span>{{ `¥${scope.row.deferIncome}` }}</span>
</el-tooltip>
<span>{{ !isEmpty(scope.row.otherDeduction) ? `${scope.row.otherDeduction < 0 ? '-' : ''} ¥${Math.abs(scope.row.otherDeduction)}` : '-' }}</span>
</template>
</el-table-column>
<el-table-column align="center">
......@@ -239,7 +232,7 @@
</div>
<!-- 修订合计应发工资 -->
<revised-salary-dialog :revised-salary-visible="revisedSalaryVisible" v-if="revisedSalaryVisible" :revised-salary-row="revisedSalaryRow" @dialogClose="handleSalaryCloseDialog"></revised-salary-dialog>
<!-- 工资明细 -->
<!-- 提成构成 -->
<salary-details-dialog :salary-details-visible="salaryDetailsVisible" v-if="salaryDetailsVisible" @dialogClose="handleSalaryDetailsColseDialog" :detail-row="detailRow"></salary-details-dialog>
</div>
</template>
......@@ -378,6 +371,7 @@ export default {
row.staffSceneLabelStr = filterStr(row.staffSceneLabel, this.staffSceneLabelList)
row.jobTypeStr = filterStr(row.jobTypes, staffLevelList, this.performanceData?.hireType)
row.personalSalary = basicSalary.plus(commissionPrice).toNumber() < minimumSalary.toNumber() ? minimumSalary.toNumber() : basicSalary.plus(commissionPrice).toNumber() // 基本工资+提成<保底工资,则取保底工资
row.deferredPayment = !this.isEmpty(row.deferExpenses) && !this.isEmpty(row.deferIncome) ? new BigNumber((0 - row.deferExpenses) || 0).plus(new BigNumber(row.deferIncome) || 0).toNumber() : ''
})
this.performanceTableData = (this.whiteFlag ? res?.list : []) || []
})
......@@ -431,6 +425,24 @@ export default {
.historicalPerformance {
background: #fff;
.content {
.tips-header {
padding: 3px 12px;
display: flex;
background: #f47f131a;
margin-left: 20px;
margin-bottom: 8px;
width: fit-content;
.custom-icon{
color: #F47F13;
width: 16px;
height: 16px;
margin: 1px 8px 0 0;
}
.log-text {
font-size: 14px;
color: #F47F13;
}
}
.header{
padding: 0 20px;
height: 48px;
......
......@@ -77,7 +77,7 @@ export default {
return {
isEmpty,
dialogConfig: {
title: '修订合计应发工资',
title: '修订工资',
width: '720px'
},
formData: [
......@@ -93,7 +93,7 @@ export default {
addHtml: 'refundOffset'
},
{
label: '正负冲减',
label: '其他应发/应扣',
name: 'customDeduction',
addHtml: 'customDeduction'
},
......@@ -107,6 +107,7 @@ export default {
name: 'remark',
type: 'input',
inputType: 'textarea',
placeholder: '描述补充应发和应扣项目明细',
rows: 5,
maxlength: 500,
showLimit: true
......@@ -174,10 +175,10 @@ export default {
}
// 清除与输入框1和输入框2相关的内容
const refundOffsetText = !this.isEmpty(this.infoForm['refundOffset']) && !isNaN(this.infoForm['refundOffset']) ? `退单冲减${this.infoForm['refundOffset']},` : ''
const customDeductionText = !this.isEmpty(this.infoForm['customDeduction']) && !isNaN(this.infoForm['customDeduction']) ? `正负冲减${this.infoForm['customDeduction']},` : ''
const customDeductionText = !this.isEmpty(this.infoForm['customDeduction']) && !isNaN(this.infoForm['customDeduction']) ? `其他应发/应扣${this.infoForm['customDeduction']},` : ''
let existingText = this.infoForm.remark
.replace(/退单冲减[^,]*/g, '')
.replace(/正负冲减[^,]*/g, '')
.replace(/其他应发\/应扣[^,]*/g, '')
.trim()
// 添加新的输入框内容
......@@ -237,7 +238,7 @@ export default {
remark: this.infoForm.remark
}
if (this.computedValue - 0 < 0) return this.$message.warning('实发工资不能小于0')
if (isNaN(params.customDeduction)) return this.$message.warning('正负冲减值需为数字')
if (isNaN(params.customDeduction)) return this.$message.warning('其他应发/应扣值需为数字')
reviseSalaryApi(params).then(res => {
this.$message.success('修订成功')
this.$emit('dialogClose', { flag: true, attrName: 'revisedSalaryVisible' })
......
......@@ -38,7 +38,7 @@
<span style="display: inline-block;margin-right: 10px;">
<auth-button category="Button" :show-btn-ids="['9120502']" />
</span>
<!-- <auth-button category="Button" :show-btn-ids="['9120507']" /> -->
<auth-button category="Button" :show-btn-ids="['9120507']" />
</d2-table-header>
<d2-table ref="recordTable"
class="inStoreTable"
......@@ -66,7 +66,7 @@
@dialogClose="flagDialogClose" />
<!-- 创建员工 -->
<creat-staff-dialog :creat-staff-visible="creatStaffVisible" v-if="creatStaffVisible" @dialogClose="creatStaffDialogClose" />
<!-- 导出员工业绩 -->
<!-- 工资导入导出 -->
<export-performance-dialog :export-performance-visible="exportVisible" v-if="exportVisible" @handleDownloadTemplate="handleDownloadTemplate" @dialogClose="exportDialogClose" @handleExport="handleExport" @handleImport="handleImport" />
</div>
</template>
......@@ -419,7 +419,7 @@ export default {
this.creatStaffVisible = !this.creatStaffVisible
},
// 导出员工业绩
// 工资导入导出
handleExportPerformance() {
this.exportDialogClose()
},
......@@ -439,17 +439,17 @@ export default {
})
}
if (params.month) {
params.startMonth = Util.dateFormate(params.month, 'YYYY-MM')
params.endMonth = Util.dateFormate(params.month, 'YYYY-MM')
params.startMonth = Util.dateFormate(params.month[0], 'YYYY-MM')
params.endMonth = Util.dateFormate(params.month[1], 'YYYY-MM')
}
delete params.month
delete params.staffPhoneList
delete params.sceneType
params.method = 'dj.api.smartcarlife.staffCommission.exportAsync'
params.method = 'dj.api.smartcarlife.staffMonthSalary.staffSalary.exportAsync'
const list = [
...this.dowloadList,
{
name: '员工业绩列表',
name: '员工工资列表',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
......@@ -473,11 +473,11 @@ export default {
delete params.month
delete params.staffPhoneList
delete params.sceneType
params.method = "dj.api.smartcarlife.staffMonthSalary.correctSalary.template.exportAsync"
params.method = "dj.api.smartcarlife.staffMonthSalary.staffSalary.exportAsync"
const list = [
...this.dowloadList,
{
name: "修订工资模板",
name: "导入更新模板",
exportParam: JSON.stringify(params),
status: "waiting",
timeid: new Date().getTime()
......
......@@ -6,7 +6,7 @@
<el-tab-pane label="员工信息" name="staffInfo" v-if="editPermissionFlag">
<edit-staff ref="editStaff" v-if="activeName == 'staffInfo'" :queryData="queryData"></edit-staff>
</el-tab-pane>
<el-tab-pane label="历史业绩" name="historyPerformance" v-if="historyPerformanceFlag">
<el-tab-pane label="工资提成" name="historyPerformance" v-if="historyPerformanceFlag">
<historical-performance ref="historicalPerformance" v-if="activeName == 'historyPerformance'" :queryData="queryData"></historical-performance>
</el-tab-pane>
</el-tabs>
......
......@@ -180,7 +180,8 @@ export default {
jobTypeName: '初级驻店',
configInfo: {
campusList: [],
customerList: []
customerList: [],
fixedList: []
}
},
{
......@@ -188,7 +189,8 @@ export default {
jobTypeName: '中级驻店',
configInfo: {
campusList: [],
customerList: []
customerList: [],
fixedList: []
}
},
{
......@@ -196,7 +198,8 @@ export default {
jobTypeName: '高级驻店',
configInfo: {
campusList: [],
customerList: []
customerList: [],
fixedList: []
}
}]
let brandIds = this.routerQuery?.brandIds || []
......@@ -358,10 +361,12 @@ export default {
if (item.configCarType == val.carType) {
val.performanceInfo?.forEach(v => {
if (v.jobType == item.jobType) {
if (item.performanceType != 5) {
v.configInfo.campusList.push(item)
} else {
if (item.performanceType == 5) {
v.configInfo.customerList.push(item)
} else if (item.performanceType == 6) {
v.configInfo.fixedList.push(item)
} else {
v.configInfo.campusList.push(item)
}
}
})
......@@ -618,6 +623,27 @@ export default {
})
})
})
// 处理固定提成
res?.forEach(item => {
item?.performanceInfo?.forEach(it => {
it?.configInfo?.fixedList?.forEach(v => {
configItemList.push({
jobType: it.jobType,
configCarType: item.carType,
goodsType: v.goodsType,
goodsTypeName: v.goodsTypeName,
secondaryGoodsType: v.secondaryGoodsType,
secondaryGoodsTypeName: v.secondaryGoodsTypeName,
thirdLevelGoodsType: v.thirdLevelGoodsType,
thirdLevelGoodsTypeName: v.thirdLevelGoodsTypeName,
performanceType: 6, // 绩效类型(1:渗透率,2:高产值,3:成交率,4:均客单,5:售后提成,6:固定提成)
startValue: v.startValue,
endValue: v.endValue,
calculateValue: v.calculateValue
})
})
})
})
// 再处理售后(为保证与后端数据顺序相同)
res?.forEach(item => {
item?.performanceInfo?.forEach(it => {
......@@ -721,7 +747,7 @@ export default {
let arr = []
this.carTypeData?.forEach(item => {
item.performanceInfo?.forEach(item2 => {
if (item2?.configInfo?.campusList?.length || item2?.configInfo?.customerList?.length) arr.push(item2)
if (item2?.configInfo?.campusList?.length || item2?.configInfo?.customerList?.length || item2?.configInfo?.fixedList?.length) arr.push(item2)
})
})
if (!arr.length) {
......
......@@ -301,6 +301,15 @@
</el-switch>
<span class="flag-text">查看订单商品成本</span>
</el-form-item>
<el-form-item label="捆绑轻改门店:">
<el-select v-model="form.bindMerchantId" remote reserve-keyword class="el_select itd"
placeholder="请选择" @visible-change="visibleChange" :remote-method="remoteMethod" clearable
v-el-select-loadmore="interestsLoadmore" filterable @change="bindMerchantChange">
<el-option v-for="item in upgradeMerchantList" :key="item.merchantId"
:label="item.merchantName" :value="item.merchantId" />
</el-select>
<span class="item-tips">注:单选1.1场景的门店,当前门店权益/延保录单后,会给客户赠送该门店1.1太阳膜礼券</span>
</el-form-item>
<!-- <el-form-item label="阳光激励费:" prop="sunlightIncentiveCost">
<div>
<span class="rateInput_s">精品升级</span>
......@@ -366,7 +375,7 @@ import {
findSellerMerchantStaffList,
getResidentStaffList
} from "@/api/shopConfig.js"
import { serviceGetMerchantList } from "@api/merchant"
import { serviceGetMerchantList, getList } from "@api/merchant"
import { findMerchantStaffList, merchantStaffByRoleList } from "@api/index"
import { businessNature, sceneForShop } from "@/common/constants.js"
......@@ -397,7 +406,8 @@ export default {
currentMonthOutputValue: "",
nextMonthOutputValue: "",
serviceMerchantServiceChargeConfig: {},
shopMerchantConfig: {}
shopMerchantConfig: {},
bindMerchantId: ''
// boutiqueSunshineInspiration: '',
// quotationSunshineInspiration: '',
// boutiqueMarketInspiration: '',
......@@ -455,6 +465,26 @@ export default {
serviceBossList: [],
storePersonList: [], // 盯防负责人列表
flySuperList: [], // 飞行督导列表
currentPage: 1,
upgradeMerchantList: []
}
},
directives: {
"el-select-loadmore": {
bind(el, binding) {
setTimeout(() => {
const SELECTWRAP_DOM = el.querySelector(
".el-select-dropdown .el-select-dropdown__wrap"
)
SELECTWRAP_DOM.addEventListener("scroll", function () {
const condition =
this.scrollHeight - this.scrollTop <= this.clientHeight
if (condition) {
binding.value()
}
})
}, 1000)
}
}
},
......@@ -524,6 +554,8 @@ export default {
}
})
res.costPrivacyShowFlag = res?.shopMerchantConfig?.costPrivacyShowFlag || ''
res.bindMerchantId = res?.shopMerchantConfig?.bindMerchantId || ''
res.bindMerchantName = res?.shopMerchantConfig?.bindMerchantName || ''
this.form = deepClone(res)
if (!this.form.serviceMerchantServiceChargeConfig) {
// 未设置过时,手续费默认为打开并且费率为2
......@@ -561,6 +593,11 @@ export default {
return item_new
})
}
const defaultSelect = res?.bindMerchantId ? [{ // 捆绑轻改门店 默认选中项 用于回显
merchantId: res?.bindMerchantId,
merchantName: res?.bindMerchantName
}] : []
this.getUpgradeMerchantList(defaultSelect)
resolve()
})
})
......@@ -790,6 +827,62 @@ export default {
}
},
remoteMethod(query) {
this.merchantNameKeyword = query
this.currentPage = 1
this.upgradeMerchantList = []
this.getUpgradeMerchantList() // 请求接口
},
visibleChange(data) {
// 获取焦点重新渲染下拉框数据
if (data) {
if (this.merchantNameKeyword) {
this.merchantNameKeyword = ""
this.currentPage = 1
this.upgradeMerchantList = []
this.getUpgradeMerchantList()
}
}
},
interestsLoadmore() {
setTimeout(() => {
this.currentPage = this.currentPage + 1
if (this.allPages < this.currentPage) {
this.currentPage = this.allPages
return
}
this.getUpgradeMerchantList()
}, 10)
},
// 获取1.1场景门店列表
getUpgradeMerchantList(defaultSelect) {
getList({merchantName: this.merchantNameKeyword, scene: 1, currentPage: this.currentPage, pageSize: 20}).then(res => {
this.allPages = res.pages
let arr = this.upgradeMerchantList.concat(res?.list || [])
if (defaultSelect?.length) arr = arr.concat(defaultSelect)
this.upgradeMerchantList = this.unique(arr)
})
.catch(() => { })
},
unique(arr) {
const res = new Map()
return arr.filter((a) => !res.has(a.merchantId) && res.set(a.merchantId, 1))
},
bindMerchantChange(e) {
console.log(e)
let name = this.upgradeMerchantList?.find(val => val.merchantId == e)?.merchantName
this.form = {
...this.form,
bindMerchantId: e,
bindMerchantName: name
}
},
/**
* 保存信息
*/
......@@ -912,6 +1005,7 @@ export default {
// _params.quotationMarketInspiration =
// shopMerchantConfig.quotationMarketInspiration
console.log(_params)
if (!_params.bindMerchantId) _params.bindMerchantName = ''
shopSetting({ dataString: JSON.stringify(_params) }).then((res) => {
this.notice.okTips()
this.handleCancel()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!