Commit 13340b52 by 前端

Merge branch 'SAAS+V4.47.2-1218' into 'develop'

上线合并

See merge request !386
2 parents e60e5c39 3be8208e
Showing 45 changed files with 4499 additions and 230 deletions
...@@ -124,3 +124,189 @@ export function reportTrack(data) { ...@@ -124,3 +124,189 @@ export function reportTrack(data) {
data.method = "clue.api.burial.point.record.batch.insert" data.method = "clue.api.burial.point.record.batch.insert"
return request(data, "post") return request(data, "post")
} }
// 获取门店工资绩效列表
export function getStoreSalaryListApi(data) {
data.method = `${path2}merchantPerformanceConfig.page`
return request(data, "post")
}
// 禁用/启用门店工资绩效
export function editStoreSalaryStatusApi(data) {
data.method = `${path2}merchantPerformanceConfig.updateStatus`
return request(data, "post")
}
// 删除门店工资绩效
export function deleteStoreSalaryApi(data) {
data.method = `${path2}merchantPerformanceConfig.delete`
return request(data, "post")
}
// 新增/编辑绩效方案
export function configPerformancePlanApi(data) {
data.method = `${path2}merchantPerformanceConfig.batchConfig`
return request(data, "post")
}
// 获取绩效方案详情
export function getPerformancePlanDetailApi(data) {
data.method = `${path2}merchantPerformanceConfig.getLatestConfigDetail`
return request(data, "post")
}
// 获取分发门店列表
export function getDistributeStoreListApi(data) {
data.method = `${path2}merchantPerformanceConfig.pageDistributeMerchant`
return request(data, "post")
}
// 获取应用商品
export function getAppGoodsApi(data) {
data.method = `${path2}merchantPerformanceConfig.pageMerchantGoods`
return request(data, "post")
}
// 获取激励池存入列表
export function getIncentivePoolDepositListApi(data) {
data.method = `${path2}incentivePool.pageIncome`
return request(data, "post")
}
// 获取激励池支出列表
export function getIncentivePoolExpendListApi(data) {
data.method = `${path2}incentivePool.pageExpenses`
return request(data, "post")
}
// 获取激励池统计信息
export function getIncentivePoolStatisticsApi(data) {
data.method = `${path2}incentivePool.total`
return request(data, "post")
}
// 获取激励池存入明细
export function getIncentivePoolDetailApi(data) {
data.method = `${path2}incentivePool.getIncomeById`
return request(data, "post")
}
// 激励池新增支出
export function addIncentivePoolApi(data) {
data.method = `${path2}incentivePool.addExpenses`
return request(data, "post")
}
// 获取已配置职级的所有员工数据
export function getLevelStaffListApi(data) {
data.method = `${path2}incentivePool.hasJobStaffPage`
return request(data, "post")
}
// 获取激励池支出详情(备注记录)
export function getIncentivePoolRemarkRecordApi(data) {
data.method = `${path2}incentivePool.getExpensesById`
return request(data, "post")
}
// 激励池支出修改备注
export function editIncentivePoolRemarkApi(data) {
data.method = `${path2}incentivePool.updateExpensesRemark`
return request(data, "post")
}
// 获取驻店管理列表
export function getResidentListApi(data) {
data.method = `${path2}staffBaseInfo.pageList`
return request(data, "post")
}
// 导入员工修订工资
export function importStaffSalaryApi(data) {
data.method = `${path2}staffMonthSalary.correctSalary.byImport`
return request(data, "post", ["file"])
}
// 获取帮带导师数据
export function getResidentTeacherListApi(data) {
data.method = `${path2}staffBaseInfo.Mentor.list`
return request(data, "post")
}
// 根据场景获取门店列表
export function getStoreListBySceneApi(data) {
data.method = `dj.smartcarlife.api.scene.shopMerchant.pageList`
return request(data, "post")
}
// 根据门店反查管理的园区店列表
export function getStoreParkListApi(data) {
data.method = `dj.smartcarlife.api.scene.yqMerchant.pageList`
return request(data, "post")
}
// 创建员工
export function createStaffApi(data) {
data.method = `${path2}staffBaseInfo.account.add`
return request(data, "post")
}
// 编辑员工
export function editStaffApi(data) {
data.method = `${path2}staffBaseInfo.staffDetailInfo.update`
return request(data, "post")
}
// 员工分配门店账号
export function assignStoreAccountApi(data) {
data.method = `${path2}staffBaseInfo.account.other.add`
return request(data, "post")
}
// 获取员工详情信息
export function getStaffDetailApi(data) {
data.method = `${path2}staffBaseInfo.selectStaffDetailInfo`
return request(data, "post")
}
// 获取员工历史业绩
export function getStaffHistoryApi(data) {
data.method = `${path2}staffMonthSalary.page`
return request(data, "post")
}
// 获取员工工资统计数据
export function getStaffSalaryStatisticsApi(data) {
data.method = `${path2}staffMonthSalary.stat`
return request(data, "post")
}
// 获取提成门店数据
export function getCommissionLogicApi(data) {
data.method = `${path2}staffBaseInfo.listStaffOrderMerchant`
return request(data, "post")
}
// 获取员工历史订单列表
export function getStaffHistoryOrderListApi(data) {
data.method = `${path2}staffBaseInfo.listStaffDailyPerformancePage`
return request(data, "post")
}
// 修订应发工资
export function reviseSalaryApi(data) {
data.method = `${path2}staffMonthSalary.correctSalary`
return request(data, "post")
}
// 修订工资操作记录
export function getSalaryRecordApi(data) {
data.method = `${path2}staffSalaryCorrectRecord.page`
return request(data, "post")
}
// 获取工资明细
export function getSalaryDetailApi(data) {
data.method = `${path2}staffMonthSalary.detail`
return request(data, "post")
}
import request from "./request"
import RequestMethods from "./request.methods"
const path = "dj.smartcarlife.api."
// 交易明细列表
export function nbcbAccDetailPage(data) {
data.method = `${path}nbcb.acc.detail.page`
return request(data, RequestMethods.POST)
}
// 财资数据筛选项列表
export function nbcbAccDetailConfig(data) {
data.method = `${path}nbcb.acc.detail.config`
return request(data, RequestMethods.POST)
}
// 交易明细重取
export function nbcbAccDetailRefetch(data) {
data.method = `${path}nbcb.acc.detail.refetch`
return request(data, RequestMethods.POST)
}
// 批量同步交易明细
export function nbcbAccDetailBatchSync(data) {
data.method = `${path}nbcb.acc.detail.batch.sync`
return request(data, RequestMethods.POST)
}
// 交易明细详情
export function nbcbAccDetail(data) {
data.method = `${path}nbcb.acc.detail`
return request(data, RequestMethods.POST)
}
// 交易明细关联回单pdf
export function nbcbReceiptPdfUrl(data) {
data.method = `${path}nbcb.receipt.pdf.url`
return request(data, RequestMethods.POST)
}
...@@ -970,3 +970,48 @@ export const statusOpt = [ ...@@ -970,3 +970,48 @@ export const statusOpt = [
{ confId: 3, confValue: "已完成" }, { confId: 3, confValue: "已完成" },
{ confId: 0, confValue: "无需处理" } { confId: 0, confValue: "无需处理" }
] ]
// 员工职级
export const staffLevelList = [
{ confId: 0, confValue: "实习生(理论)" },
{ confId: 1, confValue: "实习生(实践)" },
{ confId: 2, confValue: "初级驻店" },
{ confId: 3, confValue: "中级驻店" },
{ confId: 4, confValue: "高级驻店" },
{ confId: 5, confValue: "小店长" },
{ confId: 6, confValue: "大店长" },
{ confId: 7, confValue: "初级区域督导" },
{ confId: 8, confValue: "中级区域督导" },
{ confId: 9, confValue: "高级区域督导" }
]
// 所属业务
export const staffSceneLabelList = [
{ confId: "1", confValue: "轻改" },
{ confId: "0", confValue: "会员权益/升级" }
]
// 财资数据 收支标志
export const cdSignOpt = [
{ confId: 0, confValue: "收入" },
{ confId: 1, confValue: "支出" }
]
// 财资数据 同步状态
export const jdSyncOpt = [
{ confId: 0, confValue: "失败" },
{ confId: 1, confValue: "成功" }
]
// 财资数据 操作项
export const operationTypeOpt = [
{ confId: 1, confValue: "重推财资数据" },
{ confId: 2, confValue: "推送财资数据" },
{ confId: 3, confValue: "获取财资数据" }
]
// 财资数据 操作项
export const operationResultOpt = [
{ confId: "Y", confValue: "成功" },
{ confId: "N", confValue: "失败" }
]
...@@ -21,13 +21,13 @@ export const routerName = { ...@@ -21,13 +21,13 @@ export const routerName = {
}, },
auth: [ auth: [
{ {
authId: '9050103', authId: "9050103",
parentId: '90501', parentId: "90501",
label: '下载对账单', label: "下载对账单",
icon: 'download', icon: "download",
category: 'Button', category: "Button",
type: 'primary', type: "primary",
handle: 'downloadAccount' handle: "downloadAccount"
}, },
{ {
authId: "9050101", authId: "9050101",
...@@ -292,5 +292,54 @@ export const routerName = { ...@@ -292,5 +292,54 @@ export const routerName = {
} }
], ],
component: _import("financeManage/balanceStatistics/index") component: _import("financeManage/balanceStatistics/index")
},
90509: {
path: "/theAssetData",
name: "theAssetData",
meta: {
title: "财资数据",
authId: "90509",
parentId: "905",
cache: false
},
auth: [
{
authId: "9050901",
parentId: "90509",
label: "重取明细",
category: "Button",
type: "primary",
handle: "handleRefetchDetail"
},
{
authId: "9050902",
parentId: "90509",
label: "批量重推",
category: "Button",
type: "primary",
handle: "handleBatchRepush"
},
{
authId: "9050903",
parentId: "90509",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9050904",
parentId: "90509",
label: "详情",
handle: "handleDetail"
},
{
authId: "9050905",
parentId: "90509",
label: "回单",
handle: "handleReceipt"
}
],
component: _import("financeManage/theAssetData/index")
} }
} }
...@@ -105,7 +105,7 @@ export const routerName = { ...@@ -105,7 +105,7 @@ export const routerName = {
parentId: "91205", parentId: "91205",
label: "设备登录历史", label: "设备登录历史",
category: "Button", category: "Button",
type: "primary", type: "default",
handle: "handleLoginHistory" handle: "handleLoginHistory"
}, },
{ {
...@@ -113,7 +113,7 @@ export const routerName = { ...@@ -113,7 +113,7 @@ export const routerName = {
parentId: "91205", parentId: "91205",
label: "导出人员", label: "导出人员",
category: "Button", category: "Button",
type: "primary", type: "default",
handle: "handleExportPerson" handle: "handleExportPerson"
}, },
{ {
...@@ -121,110 +121,151 @@ export const routerName = { ...@@ -121,110 +121,151 @@ export const routerName = {
parentId: "91205", parentId: "91205",
label: "导出标签", label: "导出标签",
category: "Button", category: "Button",
type: "primary", type: "default",
handle: "handleExportLabel" handle: "handleExportLabel"
}, },
{ {
authId: "9120505", authId: "9120505",
parentId: "91205", parentId: "91205",
label: "编辑", label: "编辑员工",
handle: "handleEdit", handle: "handleEdit",
addRoutePath: [ addRoutePath: [
{ {
authId: "912050501", authId: "912050501",
name: "员工编辑", name: "编辑员工",
parentId: "9120505" parentId: "9120505"
} }
] ]
} },
],
component: _import("systemConfig/inStoreManage/inStoreControlList")
},
912050501: {
path: "/editStaff",
name: "editStaff",
meta: {
title: "员工编辑",
authId: "912050501",
parentId: "9120505",
cache: false,
activePath: "/inStoreManage"
},
component: _import("systemConfig/inStoreManage/editStaff")
},
91206: {
path: "/staffManage",
name: "staffManage",
meta: {
title: "驻店工资绩效",
authId: "91206",
parentId: "912",
cache: false
},
auth: [
{ {
authId: "9120601", authId: "9120506",
parentId: "91206", parentId: "91205",
label: "导出工资绩效", label: "创建员工",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleExport" handle: "handleCreateStaff"
}, },
{ {
authId: "9120602", authId: "9120507",
parentId: "91206", parentId: "91205",
label: "导入员工", label: "导出员工业绩",
category: "Button", category: "Button",
handle: "handleImport" type: "default",
handle: "handleExportPerformance"
}, },
{ {
authId: "9120603", authId: "9120508",
parentId: "91206", parentId: "91205",
label: "绩效配置", label: "历史业绩",
handle: "handlePerformance", handle: "handleHistoryPerformance",
addRoutePath: [
{
authId: "912060301",
name: "绩效配置",
parentId: "91206"
}
]
},
{
authId: "9120604",
parentId: "91206",
label: "导师配置",
handle: "handleMentor",
addRoutePath: [ addRoutePath: [
{ {
authId: "912060401", authId: "912050501",
name: "导师配置", name: "历史业绩",
parentId: "91206" parentId: "9120505"
} }
] ]
}, },
{ {
authId: "9120605", authId: "9120509",
parentId: "91206", parentId: "91205",
label: "启用工资绩效", label: "修订工资",
handle: "handleEnableOrDisable", handle: "handleEditSalary"
ruleObj: {
attr: "performanceFlag",
rule: {
N: "启用工资绩效",
Y: "禁用工资绩效"
}
}
}, },
{ {
authId: "9120606", authId: "9120510",
parentId: "91206", parentId: "91205",
label: "业绩详情", label: "工资明细",
handle: "handleDetail" handle: "handleSalaryDetail",
} }
], ],
component: _import("systemConfig/businessSchoolManage/index") component: _import("residentManage/inStoreManage/inStoreControlList")
}, },
912050501: {
path: "/staffInfo",
name: "staffInfo",
meta: {
title: "员工信息",
authId: "912050501",
parentId: "9120505",
cache: false,
activePath: "/inStoreManage"
},
component: _import("residentManage/inStoreManage/staffInfo")
},
// 91206: {
// path: "/staffManage",
// name: "staffManage",
// meta: {
// title: "驻店工资绩效",
// authId: "91206",
// parentId: "912",
// cache: false
// },
// auth: [
// {
// authId: "9120601",
// parentId: "91206",
// label: "导出工资绩效",
// category: "Button",
// type: "primary",
// handle: "handleExport"
// },
// {
// authId: "9120602",
// parentId: "91206",
// label: "导入员工",
// category: "Button",
// handle: "handleImport"
// },
// {
// authId: "9120603",
// parentId: "91206",
// label: "绩效配置",
// handle: "handlePerformance",
// addRoutePath: [
// {
// authId: "912060301",
// name: "绩效配置",
// parentId: "91206"
// }
// ]
// },
// {
// authId: "9120604",
// parentId: "91206",
// label: "导师配置",
// handle: "handleMentor",
// addRoutePath: [
// {
// authId: "912060401",
// name: "导师配置",
// parentId: "91206"
// }
// ]
// },
// {
// authId: "9120605",
// parentId: "91206",
// label: "启用工资绩效",
// handle: "handleEnableOrDisable",
// ruleObj: {
// attr: "performanceFlag",
// rule: {
// N: "启用工资绩效",
// Y: "禁用工资绩效"
// }
// }
// },
// {
// authId: "9120606",
// parentId: "91206",
// label: "业绩详情",
// handle: "handleDetail"
// }
// ],
// component: _import("systemConfig/businessSchoolManage/index")
// },
91208: { 91208: {
path: "/exercise", path: "/exercise",
name: "exercise", name: "exercise",
...@@ -346,30 +387,30 @@ export const routerName = { ...@@ -346,30 +387,30 @@ export const routerName = {
}, },
component: _import("residentManage/exercise/add") component: _import("residentManage/exercise/add")
}, },
912060301: { // 912060301: {
path: "/performanceConfig", // path: "/performanceConfig",
name: "performanceConfig", // name: "performanceConfig",
meta: { // meta: {
title: "绩效配置", // title: "绩效配置",
authId: "912060301", // authId: "912060301",
parentId: "91206", // parentId: "91206",
sideHidden: true, // sideHidden: true,
activePath: "/staffManage" // activePath: "/staffManage"
}, // },
component: _import("systemConfig/businessSchoolManage/performanceConfig") // component: _import("systemConfig/businessSchoolManage/performanceConfig")
}, // },
912060401: { // 912060401: {
path: "/mentorConfig", // path: "/mentorConfig",
name: "mentorConfig", // name: "mentorConfig",
meta: { // meta: {
title: "导师配置", // title: "导师配置",
authId: "912060401", // authId: "912060401",
parentId: "91206", // parentId: "91206",
sideHidden: true, // sideHidden: true,
activePath: "/staffManage" // activePath: "/staffManage"
}, // },
component: _import("systemConfig/businessSchoolManage/mentorConfig") // component: _import("systemConfig/businessSchoolManage/mentorConfig")
}, // },
91207: { 91207: {
path: "/inStoreGoalsConfig", path: "/inStoreGoalsConfig",
name: "inStoreGoalsConfig", name: "inStoreGoalsConfig",
...@@ -563,5 +604,113 @@ export const routerName = { ...@@ -563,5 +604,113 @@ export const routerName = {
} }
], ],
component: _import("residentManage/tabletManagement") component: _import("residentManage/tabletManagement")
},
91212: {
path: "/salaryPerformance",
name: "salaryPerformance",
meta: {
title: "驻店工资绩效",
authId: "91212",
parentId: "912",
cache: false
},
auth: [
{
authId: "9121201",
parentId: "91212",
label: "新增绩效方案",
category: "Button",
type: "primary",
handle: "handleToAdd",
addRoutePath: [
{
authId: "912120101",
name: "新增绩效方案",
parentId: "91212"
}
]
},
{
authId: "9121202",
parentId: "91212",
label: "编辑",
handle: "handleToEdit",
addRoutePath: [
{
authId: "912070101",
name: "编辑",
parentId: "91207"
}
]
},
{
authId: "9121203",
parentId: "91212",
label: "删除",
handle: "handleDelete"
},
{
authId: "9121204",
parentId: "91212",
label: "启用",
handle: "handleEnableOrDisable",
ruleObj: {
attr: "status",
rule: {
2: "启用",
1: "禁用"
}
}
},
{
authId: "9121205",
parentId: "91212",
label: "导出", // 门店工资绩效导出
category: "Button",
type: "default",
handle: "handleExport"
},
{
authId: "9121206",
parentId: "91212",
label: "新增支出",
category: "Button",
type: "primary",
handle: "handleAddExpenditure"
},
{
authId: "9121207",
parentId: "91212",
label: "导出", // 激励池导出
category: "Button",
type: "default",
handle: "handleExport"
},
{
authId: "9121208",
parentId: "91212",
label: "修改备注",
handle: "handleToNote"
},
{
authId: "9121209",
parentId: "91212",
label: "明细",
handle: "handleDetail"
}
],
component: _import("residentManage/salaryPerformance/index")
},
912120101: {
path: "/performanceScheme",
name: "performanceScheme",
meta: {
title: "新增绩效方案",
authId: "912120101",
parentId: "91212",
sideHidden: true,
activePath: "/salaryPerformance"
},
component: _import("residentManage/salaryPerformance/performanceScheme")
} }
} }
...@@ -44,7 +44,6 @@ import { saveFollowRecord } from '@api/earlyWarningManager' ...@@ -44,7 +44,6 @@ import { saveFollowRecord } from '@api/earlyWarningManager'
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { findMerchantStaffList } from '@api/index' import { findMerchantStaffList } from '@api/index'
import { afterPickerOptions_timeChoose } from '@/common/format' import { afterPickerOptions_timeChoose } from '@/common/format'
// import { baseConfig } from '@/main'
export default { export default {
name: 'HandleDialog', name: 'HandleDialog',
data() { data() {
...@@ -65,10 +64,8 @@ export default { ...@@ -65,10 +64,8 @@ export default {
}, },
handleFormRef: 'handleFormRef', handleFormRef: 'handleFormRef',
formRules: { formRules: {
// followStatus: [{ required: true, message: '请选择处理结果', trigger: 'change' }],
followNotes: [{ required: true, message: '请输入跟进内容', trigger: 'blur' }], followNotes: [{ required: true, message: '请输入跟进内容', trigger: 'blur' }],
nextFollowerId: [{ required: true, message: '请选择下次跟进人', trigger: 'change' }] nextFollowerId: [{ required: true, message: '请选择下次跟进人', trigger: 'change' }]
// nextFollowerTime: [{ required: true, message: '请选择下次跟进时间', trigger: 'change' }]
}, },
editFormData: [{ editFormData: [{
label: '处理结果', label: '处理结果',
...@@ -161,11 +158,6 @@ export default { ...@@ -161,11 +158,6 @@ export default {
this[formName].forEach((item, index) => { this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) { if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', deepClone(this.baseData[item.optionsName])) this.$set(this[formName][index], 'optionList', deepClone(this.baseData[item.optionsName]))
if (this[formName][index].label == '业务场景') { // 业务场景默认选中第一项
console.log(this.baseData[item.optionsName])
this.infoForm.sceneType = this.baseData[item.optionsName][0].confId
}
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') { if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {} const temp = {}
temp[this[formName][index].optionId] = '' temp[this[formName][index].optionId] = ''
...@@ -184,13 +176,6 @@ export default { ...@@ -184,13 +176,6 @@ export default {
this[formName][idx].isHide = isHide this[formName][idx].isHide = isHide
}, },
// showOrHideAttr_transferType(formName, addHtml, isHide) {
// const idx = this[formName].findIndex(item => item.addHtml == addHtml)
// console.log('idx', idx)
// console.log('this[formName][idx].isHide', this[formName][idx].isHide)
// this[formName][idx].isHide = isHide
// },
// 获取全部员工 过滤出服务商负责人可选数据 // 获取全部员工 过滤出服务商负责人可选数据
findMerchantStaffList() { findMerchantStaffList() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -198,13 +183,11 @@ export default { ...@@ -198,13 +183,11 @@ export default {
// 服务商负责人(根据角色名过滤) // 服务商负责人(根据角色名过滤)
const arr = [] const arr = []
res?.map(val => { res?.map(val => {
// if (val.roleName == baseConfig.roleName) {
arr.push({ arr.push({
userId: val.uuid, userId: val.uuid,
userName: val.staffName, userName: val.staffName,
userPhone: val.staffPhone userPhone: val.staffPhone
}) })
// }
}) })
this.baseData.followUpPersonOpt = arr this.baseData.followUpPersonOpt = arr
this.getOptionsList('editFormData', false) this.getOptionsList('editFormData', false)
......
...@@ -496,28 +496,6 @@ export default { ...@@ -496,28 +496,6 @@ export default {
handleExport() { handleExport() {
var params = this.searchForm var params = this.searchForm
// if (params.statuses.length > 0) {
// const statuses = `statuses[0]`
// params[statuses] = params.statuses[0]
// delete params.statuses
// }
// 去除为null的值
// for (const key in params) {
// if (params[key] === null || params[key] === '') {
// delete params[key]
// }
// }
// params.method = 'dj.api.smartcarlife.warningmsg.warningMsgDetailListWithPageExport'
// const list = [
// ...this.dowloadList,
// {
// name: '员工预警明细',
// exportParam: JSON.stringify(params),
// status: 'waiting',
// timeid: new Date().getTime()
// }
// ]
// this.actionSetDownloadList({ list, type: 'dowloadList' })
warningMsgDetailListWithPageExport(params).then((res) => { warningMsgDetailListWithPageExport(params).then((res) => {
res && downLoadFile(res) res && downLoadFile(res)
...@@ -529,13 +507,6 @@ export default { ...@@ -529,13 +507,6 @@ export default {
this.detailVisible = true this.detailVisible = true
}, },
// dialogClose(flag) {
// this.categoryVisible = !this.categoryVisible
// if (flag) {
// this.$refs.detailListTable.refreshTable()
// }
// },
handleDeal(row) { handleDeal(row) {
this.recordInfo = row this.recordInfo = row
this.handleVisible = true this.handleVisible = true
......
...@@ -44,7 +44,6 @@ import { saveFollowRecord } from '@api/earlyWarningManager' ...@@ -44,7 +44,6 @@ import { saveFollowRecord } from '@api/earlyWarningManager'
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { findMerchantStaffList } from '@api/index' import { findMerchantStaffList } from '@api/index'
import { afterPickerOptions_timeChoose } from '@/common/format' import { afterPickerOptions_timeChoose } from '@/common/format'
// import { baseConfig } from '@/main'
export default { export default {
name: 'HandleDialog', name: 'HandleDialog',
data() { data() {
...@@ -65,10 +64,8 @@ export default { ...@@ -65,10 +64,8 @@ export default {
}, },
handleFormRef: 'handleFormRef', handleFormRef: 'handleFormRef',
formRules: { formRules: {
// followStatus: [{ required: true, message: '请选择处理结果', trigger: 'change' }],
followNotes: [{ required: true, message: '请输入跟进内容', trigger: 'blur' }], followNotes: [{ required: true, message: '请输入跟进内容', trigger: 'blur' }],
nextFollowerId: [{ required: true, message: '请选择下次跟进人', trigger: 'change' }] nextFollowerId: [{ required: true, message: '请选择下次跟进人', trigger: 'change' }]
// nextFollowerTime: [{ required: true, message: '请选择下次跟进时间', trigger: 'change' }]
}, },
editFormData: [{ editFormData: [{
label: '处理结果', label: '处理结果',
...@@ -160,11 +157,6 @@ export default { ...@@ -160,11 +157,6 @@ export default {
this[formName].forEach((item, index) => { this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) { if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', deepClone(this.baseData[item.optionsName])) this.$set(this[formName][index], 'optionList', deepClone(this.baseData[item.optionsName]))
if (this[formName][index].label == '业务场景') { // 业务场景默认选中第一项
console.log(this.baseData[item.optionsName])
this.infoForm.sceneType = this.baseData[item.optionsName][0].confId
}
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') { if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {} const temp = {}
temp[this[formName][index].optionId] = '' temp[this[formName][index].optionId] = ''
...@@ -183,13 +175,6 @@ export default { ...@@ -183,13 +175,6 @@ export default {
this[formName][idx].isHide = isHide this[formName][idx].isHide = isHide
}, },
// showOrHideAttr_transferType(formName, addHtml, isHide) {
// const idx = this[formName].findIndex(item => item.addHtml == addHtml)
// console.log('idx', idx)
// console.log('this[formName][idx].isHide', this[formName][idx].isHide)
// this[formName][idx].isHide = isHide
// },
// 获取全部员工 过滤出服务商负责人可选数据 // 获取全部员工 过滤出服务商负责人可选数据
findMerchantStaffList() { findMerchantStaffList() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -197,13 +182,11 @@ export default { ...@@ -197,13 +182,11 @@ export default {
// 服务商负责人(根据角色名过滤) // 服务商负责人(根据角色名过滤)
const arr = [] const arr = []
res?.map(val => { res?.map(val => {
// if (val.roleName == baseConfig.roleName) {
arr.push({ arr.push({
userId: val.uuid, userId: val.uuid,
userName: val.staffName, userName: val.staffName,
userPhone: val.staffPhone userPhone: val.staffPhone
}) })
// }
}) })
this.baseData.followUpPersonOpt = arr this.baseData.followUpPersonOpt = arr
this.getOptionsList('editFormData', false) this.getOptionsList('editFormData', false)
......
...@@ -80,7 +80,6 @@ ...@@ -80,7 +80,6 @@
</template> </template>
<script> <script>
// import { mapActions, mapState } from 'vuex'
import { Util, deepClone, downLoadFile } from '@/common/util' import { Util, deepClone, downLoadFile } from '@/common/util'
import detailDialog from './components/detailDialog' import detailDialog from './components/detailDialog'
import handleDialog from './components/handleDialog' import handleDialog from './components/handleDialog'
...@@ -352,9 +351,6 @@ export default { ...@@ -352,9 +351,6 @@ export default {
handleDialog handleDialog
}, },
computed: { computed: {
// ...mapState({
// dowloadList: (state) => state.d2admin.user.dowloadList
// })
}, },
mounted() { mounted() {
console.log('this.paramsObj', this.paramsObj) console.log('this.paramsObj', this.paramsObj)
...@@ -368,11 +364,6 @@ export default { ...@@ -368,11 +364,6 @@ export default {
}, },
methods: { methods: {
// ...mapActions({
// get: 'd2admin/base/get',
// close: 'd2admin/page/close'
// }),
// ...mapActions('d2admin/user', ['actionSetDownloadList']),
async getBaseData() { async getBaseData() {
this.findAllData(2) this.findAllData(2)
...@@ -386,7 +377,6 @@ export default { ...@@ -386,7 +377,6 @@ export default {
if (this.searchForm.warnCycle) { if (this.searchForm.warnCycle) {
this.searchForm.warningStartDate = Util.dateFormate(this.searchForm.warnCycle[0], 'YYYY-MM-DD') this.searchForm.warningStartDate = Util.dateFormate(this.searchForm.warnCycle[0], 'YYYY-MM-DD')
this.searchForm.warningEndDate = Util.dateFormate(this.searchForm.warnCycle[1], 'YYYY-MM-DD') this.searchForm.warningEndDate = Util.dateFormate(this.searchForm.warnCycle[1], 'YYYY-MM-DD')
// delete this.searchForm.warnCycle
} else { } else {
delete this.searchForm.warningStartDate delete this.searchForm.warningStartDate
delete this.searchForm.warningEndDate delete this.searchForm.warningEndDate
...@@ -394,7 +384,6 @@ export default { ...@@ -394,7 +384,6 @@ export default {
if (this.searchForm.createTime) { if (this.searchForm.createTime) {
this.searchForm.startDate = Util.dateFormate(this.searchForm.createTime[0], 'YYYY-MM-DD') this.searchForm.startDate = Util.dateFormate(this.searchForm.createTime[0], 'YYYY-MM-DD')
this.searchForm.endDate = Util.dateFormate(this.searchForm.createTime[1], 'YYYY-MM-DD') this.searchForm.endDate = Util.dateFormate(this.searchForm.createTime[1], 'YYYY-MM-DD')
// delete this.searchForm.createTime
} else { } else {
delete this.searchForm.startDate delete this.searchForm.startDate
delete this.searchForm.endDate delete this.searchForm.endDate
...@@ -474,29 +463,6 @@ export default { ...@@ -474,29 +463,6 @@ export default {
handleExport() { handleExport() {
var params = this.searchForm var params = this.searchForm
// if (params.statuses.length > 0) {
// const statuses = `statuses[0]`
// params[statuses] = params.statuses[0]
// delete params.statuses
// }
// 去除为null的值
// for (const key in params) {
// if (params[key] === null || params[key] === '') {
// delete params[key]
// }
// }
// params.method = 'dj.api.smartcarlife.warningmsg.warningMsgDetailListWithPageExport'
// const list = [
// ...this.dowloadList,
// {
// name: '员工预警明细',
// exportParam: JSON.stringify(params),
// status: 'waiting',
// timeid: new Date().getTime()
// }
// ]
// this.actionSetDownloadList({ list, type: 'dowloadList' })
warningMsgDetailListWithPageExport(params).then((res) => { warningMsgDetailListWithPageExport(params).then((res) => {
res && downLoadFile(res) res && downLoadFile(res)
}) })
...@@ -507,13 +473,6 @@ export default { ...@@ -507,13 +473,6 @@ export default {
this.detailVisible = true this.detailVisible = true
}, },
// dialogClose(flag) {
// this.categoryVisible = !this.categoryVisible
// if (flag) {
// this.$refs.detailListTable.refreshTable()
// }
// },
handleDeal(row) { handleDeal(row) {
this.recordInfo = row this.recordInfo = row
this.handleVisible = true this.handleVisible = true
......
<template>
<div class="range">
<div :class="[
' el-date-editor',
'el-range-editor',
'el-input__inner',
'el-date-editor--daterange',
'el-range-editor--small',
pickerVisible ? 'is-active' : ''
]"
@click="handleRangeClick"
@mouseleave="showClose = false"
@mousemove="handleMove"
ref="reference">
<template v-if="infinity">
<el-input-number class="el-range-input hide-btn"
:placeholder="startPlaceholder"
v-model="userInput[0]"
@blur="handleBlur(0)"></el-input-number>
<span class="el-range-separator">至</span>
<el-input-number class="el-range-input hide-btn"
:placeholder="endPlaceholder"
v-model="userInput[1]"
@blur="handleBlur(1)"></el-input-number>
</template>
<template v-else>
<el-input v-model="userInput[0]"
:placeholder="startPlaceholder"
@blur="handleBlur(0)"
@input="handleStartInput"
class="el-range-input"></el-input>
<span class="el-range-separator">至</span>
<el-input v-model="userInput[1]"
:placeholder="endPlaceholder"
@input="handleEndInput"
@focus="handleFocus"
@blur="handleBlur(1)"
class="el-range-input"></el-input>
</template>
<i v-show="showClose"
@click="handleClickIcon"
class="el-icon-circle-close"></i>
</div>
<!----><!---->
</div>
</template>
<script>
import { limitPrice } from '@/common/format'
export default {
data() {
return {
pickerVisible: false,
showClose: false,
userInput: this.displayValue,
oldVal: {
startInput: '',
endInput: ''
}
}
},
props: {
displayValue: Array,
placeholder: String,
startPlaceholder: String,
endPlaceholder: String,
infinity: Boolean
},
watch: {
displayValue(val) {
if (val) {
this.userInput = val
}
}
},
methods: {
handleStartInput(event) {
// const isNumber = /^\d+$/.test(event)
// if (!isNumber) {
// event = null
// }
// if (event > 100) event = 100
// this.userInput[0] = event
this.userInput[0] = limitPrice(event, this.oldVal.startInput, 20, 2)
this.oldVal.startInput = this.userInput[0]
},
handleEndInput(event) {
// const isNumber = /^\d+$/.test(event)
// if (!isNumber) {
// event = null
// }
// if (event > 100) event = 100
// this.userInput[1] = event
this.userInput[1] = limitPrice(event, this.oldVal.endInput, 20, 2)
this.oldVal.endInput = this.userInput[1]
},
handleClickIcon(event) {
this.userInput[0] = null
this.userInput[1] = null
},
valueIsEmpty() {
const val = this.userInput
if (Array.isArray(val)) {
for (let i = 0, len = val.length; i < len; i++) {
if (val[i]) {
return false
}
}
}
return true
},
handleRangeClick() {
this.pickerVisible = true
},
handleMove() {
if (this.valueIsEmpty()) {
this.showClose = false
} else {
this.showClose = true
}
},
handleFocus() {
if (!this.pickerVisible) {
this.pickerVisible = true
this.$emit("focus", this)
}
},
handleBlur(index) {
this.pickerVisible = false
this.contrastValue()
},
contrastValue() {
const val = this.userInput
if (Array.isArray(val)) {
if (+val[0] > +val[1]) {
val[1] = null
}
}
}
}
}
</script>
<style scoped lang="scss">
.range {
.el-range-input {
::v-deep {
input {
border: 0;
margin-top: -2px;
height: 28px;
}
}
}
.el-icon-circle-close {
color: #dcdfe6;
margin-left: 10px;
}
.hide-btn {
::v-deep {
span {
display: none;
}
input {
padding: 0;
}
}
}
}
</style>
<!-- 重取明细 -->
<template>
<baseDialog :dialog-config="dialogConfig"
:is-show.sync="dialogShow"
class="accountDailog"
@handleClick="handleAddConfirm">
<div class="tipFont">重新获取银行明细与回单,需等待15分钟,且接口限制单次获取上限1000条,请谨慎选择筛选条件!</div>
<div class="add-dialog">
<glsx-combi-form class="edit-form-container"
ref="editFormRef"
label-width="150px"
default-width="400px"
:form-ref="handleFormRef"
:form-obj="infoForm"
:form-data="editFormData"
:form-rules="formRules">
</glsx-combi-form>
</div>
<!-- <span class="dialog-footer">
<el-button size="small"
@click="dialogShow = false">取 消</el-button>
<el-button size="small"
type="primary"
@click="handleSelect">确 定</el-button>
</span> -->
</baseDialog>
</template>
<script>
import { nbcbAccDetailConfig, nbcbAccDetailRefetch } from '@api/theAssetData'
import { Util, deepClone } from '@/common/util'
export default {
name: 'RefetchDialog',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
infoForm: {
accNameList: [],
bankType: '',
bankAcc: '',
transactionTime: ''
},
dialogConfig: {
title: '重取明细',
width: '720px'
// isShowFooter: false
},
config: {
// isShowFooter: false
},
handleFormRef: 'handleFormRef',
formRules: {
transactionTime: [{ required: true, message: '请选择交易时间', trigger: 'change' }],
},
editFormData: [{
label: '单位名称',
name: 'accNameList',
type: 'select',
isClear: true,
multiple: true,
collapseTags: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'accNameList'
}, {
label: '银行类别',
name: 'bankType',
type: 'select',
isClear: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'bankTypeList'
}, {
label: '本方账号',
name: 'bankAcc',
type: 'select',
isClear: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'bankAccList'
}, {
label: '交易时间',
name: 'transactionTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}],
baseData: {
accNameList: [],
bankTypeList: [],
bankAccList: []
}
}
},
props: {
visible: {
type: Boolean,
default: false
}
// paramsObj: {
// type: Object,
// default: {}
// }
},
watch: {
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'visible' })
}
}
},
mounted() {
this.nbcbAccDetailConfig()
// this.getOptionsList()
},
methods: {
getOptionsList() {
this.editFormData.forEach((item, index) => {
if (item.type === 'select') {
// if (
// this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部' && item.label != '单位名称'
// ) {
// const temp = {}
// temp[this.showFormData[index].optionId] = ''
// temp[this.showFormData[index].optionLabel] = '全部'
// this.baseData[item.optionsName].unshift(temp)
// }
this.$set(
this.editFormData[index],
'optionList',
this.baseData[item.optionsName]
)
}
})
},
// 财资数据筛选项列表
nbcbAccDetailConfig() {
nbcbAccDetailConfig({}).then(res => {
for (var key in res) {
if (this.baseData[key]) {
this.baseData[key] = res[key]
this.baseData[key] = this.baseData[key].map(item => {
return {
confId: item,
confValue: item
}
})
}
}
this.getOptionsList()
})
},
handleAddConfirm() {
this.$refs.editFormRef.$refs[this.handleFormRef].validate(valid => {
if (valid) {
var params = deepClone(this.infoForm)
if (params.accNameList.length == 0 && params.bankType == '' && params.bankAcc == '') {
// this.notice.warningTips('请选择除日期外的任意一个或多个条件!')
this.$message({
message: "请选择除日期外的任意一个或多个条件!",
type: "warning",
showClose: true
})
return
}
if (params.transactionTime) {
params.transTimeStart = Util.dateFormate(params.transactionTime[0], 'YYYY-MM-DD')
params.transTimeEnd = Util.dateFormate(params.transactionTime[1], 'YYYY-MM-DD')
} else {
delete params.transTimeStart
delete params.transTimeEnd
}
this.$confirm('请确认是否要执行当前操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false
}).then(() => {
nbcbAccDetailRefetch(params).then(res => {
this.notice.okTips()
this.dialogShow = true
})
}).catch(err => {
console.log(err)
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.add-dialog {
margin: 20px 0;
.reject-input {
::v-deep .el-textarea__inner {
height: 70px;
}
}
.el-textarea .el-input__count {
right: 90px;
bottom: -10px;
font-size: 12px;
color: #999999;
}
.tips {
color: #999999;
}
.down-cla {
width: 56px;
height: 32px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #185efe;
text-align: right;
line-height: 32px;
padding-left: 8px;
// cursor: pointer;
}
.upload-file {
::v-deep .el-upload-dragger {
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
width: 300px;
height: 160px;
background: #f7f7f7;
.el-icon-upload {
margin: 0;
}
.el-upload__text {
font-size: 14px;
color: #000000;
}
.item-tips {
font-size: 12px;
color: #999999;
height: 22px;
line-height: 22px;
}
.text-tips {
font-size: 14px;
}
}
}
.file-box {
width: 350px;
.file-item {
margin-top: 6px;
position: relative;
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
cursor: pointer;
::v-deep .el-progress-bar {
width: 320px;
background: #ffffff;
border: 1px solid #f4f6fc;
border-radius: 4px;
.el-progress-bar__outer {
background: transparent;
border-radius: 4px;
.el-progress-bar__inner {
background: #f5f7fa;
border-radius: 4px;
}
}
}
::v-deep .el-image-viewer__wrapper {
width: 100vw;
height: 100vh;
}
.file-name {
position: absolute;
left: 12px;
top: 6px;
transform: translateY(-50%);
color: #333333;
font-size: 14px;
max-width: 300px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.image-file {
z-index: -1;
}
}
.file-item:first-child {
margin-top: 15px;
.file-name {
position: absolute;
left: 12px;
top: 15px;
transform: translateY(-50%);
color: #333333;
font-size: 14px;
}
}
}
}
.tipFont {
margin: 10px 0 0 60px;
width: 535px;
height: 22px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 12px;
color: #eb4e4e;
}
</style>
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
</el-input> </el-input>
</template> </template>
<template v-if="item.name == 'minSellPrice'"> <template v-if="item.name == 'minSellPrice'">
<el-checkbox @change="$event => changeCheckMinprice($event, eleIndex)" v-model="ele['validMinSellPriceFlag']" class="check-min-price"></el-checkbox> <el-checkbox v-model="ele['validMinSellPriceFlag']" class="check-min-price"></el-checkbox>
<span class="tips-text">勾选时提单校验最低价</span> <span class="tips-text">勾选时提单校验最低价</span>
</template> </template>
<el-select v-else-if="item.type === 'select'" v-model="ele[item.name]" :clearable="item.isClear" <el-select v-else-if="item.type === 'select'" v-model="ele[item.name]" :clearable="item.isClear"
...@@ -557,7 +557,8 @@ export default { ...@@ -557,7 +557,8 @@ export default {
warrantyType: '', // 质保卡类型 warrantyType: '', // 质保卡类型
upgradeSupplyMode: '', // 升级/产品供货模式 upgradeSupplyMode: '', // 升级/产品供货模式
djCost: '', // 嘀加成本 djCost: '', // 嘀加成本
thirdPartyCost: '' // 第三方成本 thirdPartyCost: '', // 第三方成本
validMinSellPriceFlag: false
}) })
let arr = this.formList[1].formBlock let arr = this.formList[1].formBlock
arr?.unshift(packageGoodsForm) arr?.unshift(packageGoodsForm)
...@@ -755,10 +756,6 @@ export default { ...@@ -755,10 +756,6 @@ export default {
if (this.filterEmpty(num)) return '-' if (this.filterEmpty(num)) return '-'
return (Math.round(num * pow) / pow).toFixed(2) return (Math.round(num * pow) / pow).toFixed(2)
}, },
// 商品是否校验最低价
changeCheckMinprice(e, index) {
this.$set(this.formData?.groundingGoodsList[index], 'validMinSellPrice', e ? 'Y' : 'N')
},
handleUp(e) { handleUp(e) {
console.log(this.formData) console.log(this.formData)
this.$refs[this.formRef + 'd2FormRuleForm'].validate((valid, options) => { this.$refs[this.formRef + 'd2FormRuleForm'].validate((valid, options) => {
......
...@@ -140,8 +140,7 @@ export default { ...@@ -140,8 +140,7 @@ export default {
sellPrice: '', // 套餐售价总价 sellPrice: '', // 套餐售价总价
minSellPrice: '', // 套餐最低售价 minSellPrice: '', // 套餐最低售价
djCost: '', // 嘀加成本 djCost: '', // 嘀加成本
thirdPartyCost: '', // 第三方成本 thirdPartyCost: '', // 第三方成本
validMinSellPriceFlag: false, // 是否校验最低价
groundingGoodsList: [{ // 上架商品集合 groundingGoodsList: [{ // 上架商品集合
upgradeGoodsId: '', // 商品id upgradeGoodsId: '', // 商品id
goodsAlias: '', // 商品别名 goodsAlias: '', // 商品别名
...@@ -154,7 +153,8 @@ export default { ...@@ -154,7 +153,8 @@ export default {
recoveryCost: '', // 回收成本 recoveryCost: '', // 回收成本
virtualAccountCost: '', // 虚拟对账成本 virtualAccountCost: '', // 虚拟对账成本
djCost: '', // 嘀加成本 djCost: '', // 嘀加成本
thirdPartyCost: '' // 第三方成本 thirdPartyCost: '', // 第三方成本
validMinSellPriceFlag: false // 是否校验最低价
}], }],
voucherList: [] // 上架凭证 voucherList: [] // 上架凭证
}, },
...@@ -335,7 +335,6 @@ export default { ...@@ -335,7 +335,6 @@ export default {
confTypeNameValue: `(${val?.goodsTypeName} / ${val?.goodsName} / ${val?.upgradeCommodityCode})` confTypeNameValue: `(${val?.goodsTypeName} / ${val?.goodsName} / ${val?.upgradeCommodityCode})`
}) })
}) })
res.validMinSellPriceFlag = res?.validMinSellPrice == 'Y'
res.voucherList.forEach(val => { // 处理上传进度 默认进度100% res.voucherList.forEach(val => { // 处理上传进度 默认进度100%
if (val.voucherFileUrl) val.uploadProgress = 100 if (val.voucherFileUrl) val.uploadProgress = 100
}) })
...@@ -391,7 +390,7 @@ export default { ...@@ -391,7 +390,7 @@ export default {
goodsAlias: val?.goodsAlias, goodsAlias: val?.goodsAlias,
sellPrice: val?.sellPrice, sellPrice: val?.sellPrice,
minSellPrice: val?.minSellPrice, minSellPrice: val?.minSellPrice,
validMinSellPrice: val.validMinSellPrice, validMinSellPrice: val.validMinSellPriceFlag ? 'Y' : 'N',
djCost: val?.djCost, djCost: val?.djCost,
goodsType: val?.goodsType, goodsType: val?.goodsType,
thirdPartyCost: val?.thirdPartyCost, thirdPartyCost: val?.thirdPartyCost,
......
...@@ -258,7 +258,7 @@ export default { ...@@ -258,7 +258,7 @@ export default {
if (this.infoForm.status == 4) { if (this.infoForm.status == 4) {
let idx = this.editFormData.findIndex(item => item.label == '结算凭证') let idx = this.editFormData.findIndex(item => item.label == '结算凭证')
this.editFormData[idx].isHide = false this.editFormData[idx].isHide = false
this.formRules.attachmentList[0].required = true // this.formRules.attachmentList[0].required = true
} }
}, },
......
...@@ -81,14 +81,14 @@ export default { ...@@ -81,14 +81,14 @@ export default {
}, },
data() { data() {
var checkPhoto = (rule, value, callback) => { var checkPhoto = (rule, value, callback) => {
if (this.infoForm.attachmentList.length === 0) { // if (this.infoForm.attachmentList.length === 0) {
this.$message({ // this.$message({
message: '请上传结算凭证', // message: '请上传结算凭证',
type: 'error' // type: 'error'
}) // })
} else { // } else {
callback() callback()
} // }
} }
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
...@@ -103,7 +103,7 @@ export default { ...@@ -103,7 +103,7 @@ export default {
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
formRules: { formRules: {
// attachmentList: [{ required: true, message: '请上传结算凭证', trigger: 'change' }] // attachmentList: [{ required: true, message: '请上传结算凭证', trigger: 'change' }]
attachmentList: [{ required: true, validator: checkPhoto, trigger: 'change' }] attachmentList: [{ required: false, validator: checkPhoto, trigger: 'change' }]
}, },
editFormData: [{ editFormData: [{
label: '结算凭证', label: '结算凭证',
......
<!-- 导出员工业绩 -->
<template>
<baseDialog :dialog-config="dialogConfig" :is-show.sync="visible"
@handleClick="handleAddConfirm">
<div class="detail-dialog">
<glsx-combi-form class="edit-form-container"
ref="editFormRef"
label-width="154px"
:is-block="true"
form-ref="editChildRef"
:form-obj="infoForm"
:form-data="formData"
:form-rules="formRules">
<template slot="monthPicker">
<el-date-picker
v-model="infoForm.month"
type="month"
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>
</template>
<template slot="importSalary">
<el-button size="small" class="import_btn">
<input type="file"
id="fileUpload"
class="import_input"
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>
<div class="file_box" v-if="fileName">
<div class="file_name">{{fileName}}</div>
<i class="el-icon-delete"
@click="handleFileDelete"></i>
</div>
<el-button class="handle_import" size="small" type="primary" plain @click="importData">导入更新</el-button>
</template>
</glsx-combi-form>
</div>
</baseDialog>
</template>
<script>
import { getLevelStaffListApi } from '@api/resident'
import { staffSceneLabelList } from '@/common/constants'
import { deepClone } from '@/common/util'
export default {
name: 'exportPerformanceDialog',
data() {
return {
formData: [
{
label: '选择员工',
name: 'staffPhoneList',
type: 'select',
optionList: [],
multiple: true,
collapseTags: true,
optionId: 'staffPhone',
optionLabel: 'staffName',
optionsName: 'staffList'
},
{
label: '选择时间',
name: 'month',
addHtml: 'monthPicker',
rules: [{ required: true, message: '请选择时间', trigger: 'change' }]
},
{
label: '',
addHtml: 'exportBtn'
},
{
label: '',
addHtml: 'titleBox2'
},
{
label: '导入修正实发工资',
name: '',
addHtml: 'importSalary'
}
],
formRules: {
staffPhoneList: [
{ required: true, message: '请选择员工', trigger: 'change' }
]
},
monthPickerOptions: {
disabledDate(time) {
const today = new Date()
const currentYear = today.getFullYear()
const currentMonth = today.getMonth()
const month = time.getMonth()
const year = time.getFullYear()
if (year === currentYear) {
return month >= currentMonth || month < currentMonth - 3
}
return year !== currentYear
}
},
infoForm: {
staffPhoneList: [],
sceneType: [],
month: ''
},
baseData: {
sceneTypesList: deepClone(staffSceneLabelList),
staffList: []
},
dialogConfig: {
title: '导出员工业绩',
width: '720px'
},
fileName: ''
}
},
props: {
exportPerformanceVisible: {
type: Boolean,
default: false
},
},
computed: {
visible: {
get() {
return this.exportPerformanceVisible
},
set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'exportPerformanceVisible' })
}
}
},
mounted() {
this.getStaffList()
this.getOptions()
},
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) {
this.$emit('handleExport', this.infoForm)
}
})
},
// 下载模板
downloadTemplate() {
this.$refs.editFormRef?.$refs?.editChildRef?.validate((valid) => {
if (valid) {
this.$emit('handleDownloadTemplate', this.infoForm)
}
})
},
// 上传文件
importFile(e) {
const size = e.target.files[0].size / 1024 / 1024
if (size < 9) {
this.fileName = e.target.files[0].name
// // 转码base64
const reader = new FileReader()
reader.readAsDataURL(e.target.files[0])
reader.onload = (event) => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(",")
this.fileInfo =
e.target.files[0].name.split(".")[1] + "@" + arrBase64[1]
document.getElementById("fileUpload").value = ""
}
} else {
this.notice.errorTips("上传文件不可超过9M")
}
},
// 删除文件
handleFileDelete() {
this.fileInfo = null
this.fileName = ''
},
// 导入更新
importData() {
if (!this.fileInfo) return this.$message.warning('请上传导入文件')
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')
}
}
}
</script>
<style lang="scss" scoped>
.sceneTypes_check{
margin-right: 20px;
}
.export_btn{
margin-left: 154px;
}
.title_box{
font-size: 15px;
color: #1D1D1D;
font-weight: 600;
border-bottom: 1px solid #E5E5E5;
padding: 8px;
margin-bottom: 16px;
}
.import_btn{
position: relative;
margin-bottom: 10px;
.import_input{
opacity: 0;
position: absolute;
right: 0;
top: 0;
width: 98px;
height: 36px;
cursor: pointer;
font-size: 0;
}
}
.file_box{
display: flex;
align-items: center;
margin-bottom: 10px;
.file_name{
border-radius: 4px;
width: 320px;
height: 26px;
line-height: 26px;
background: #F5F7FA;
color: #333333;
padding: 0 12px;
margin-right: 10px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.handle_import{
display: block;
margin: 0 !important;
}
</style>
<style lang="scss">
.statement-of-export-performance-month-picker {
.el-month-table .in-range .cell:hover {
color: #FFFFFF;
}
.el-month-table td.today .cell {
color: #C0C4CC;
}
}
.el-tag.el-tag--info{
border-color: #2A58AD !important;
}
.detail-dialog{
.glsx-combi-form .el-tag.el-tag--info .el-tag__close{
background: #C0C4CC !important;
color: #2A58AD !important;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 员工标签 -->
<template>
<baseDialog :dialog-config="dialogConfig" :is-show.sync="visible" class="accountDailog"
@handleClick="handleAddConfirm">
<div class="detail-dialog">
<el-form ref="flagFrom" class="flagFrom d2-container-content" :model="infoForm" label-width="250px"
v-loading="$store.state.d2admin.loading.value">
<el-form-item label="员工姓名:" class="flag-div">
{{ info.staffName }}
</el-form-item>
<el-form-item label="服务门店:" class="flag-div">
<el-select v-model="shopMerchant" placeholder="请选择" class="el_select itd" @change="staffLabelDetail">
<el-option v-for="item in info.shopMerchantList" :key="item.merchantId" :value="item.merchantId"
:label="item.merchantName + ' ' + item.merchantId" />
</el-select>
</el-form-item>
<el-form-item label="" v-for="(item, index1) in commLabelUnitList" class="flag-div" :key="index1">
<span class="tips-block" slot="label">
<span class="tips-label">{{ item.commLabelGroupInfo.groupName }}</span>
<el-tooltip popper-class="tooltip-class" effect="dark" placement="right">
<div slot="content">{{ item.commLabelGroupInfo.groupDesc }}</div>
<span class="tips-icon" />
</el-tooltip>:
</span>
<span v-for="(obj, index2) in item.commLabelList" class="label-span" :key="index2">{{ obj.labelName }}</span>
</el-form-item>
</el-form>
</div>
</baseDialog>
</template>
<script>
// import { sceneCodeList, transferTypeList } from '@/common/constants.js'
import { Util, deepClone } from '@/common/util'
import { staffLabelDetail } from '@/api/inStoreManage.js'
export default {
name: 'FlagDialog',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
infoForm: {
},
dialogConfig: {
title: '员工标签',
width: '1080px'
},
editChildRef: 'editChildRef',
baseData: {
},
commLabelUnitList: [],
shopMerchant: ''
}
},
props: {
flagVisible: {
type: Boolean,
default: false
},
info: {
type: Object,
default: null
}
},
watch: {
},
computed: {
visible: {
get() {
return this.flagVisible
},
set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'flagVisible' })
}
}
},
mounted() {
if (this.info.shopMerchantList) {
this.shopMerchant = this.info.shopMerchantList[0].merchantId
}
this.staffLabelDetail()
},
methods: {
staffLabelDetail() {
var params = {}
params.staffUuid = this.info.staffUuid
params.merchantId = this.shopMerchant
staffLabelDetail(params).then(res => {
this.commLabelUnitList = deepClone(res.commLabelUnitList)
})
},
handleAddConfirm() {
this.visible = true
}
}
}
</script>
<style lang="scss" scoped>
.flagFrom.d2-container-content {
margin-top: 0 !important;
}
.detail-dialog {
.itd {
width: 400px;
}
.flag-div {
// height: 40rpx;
// font-family: PingFangSC-Regular;
// font-weight: 400;
// font-size: 28rpx;
// line-height: 40rpx;
.label-span {
margin-right: 10px;
max-width: 250px;
height: 26px;
background: #fafbfe;
border: 1px solid #e8e8ea;
border-radius: 4px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #666666;
padding: 4px 8px;
}
}
}
</style>
<!-- 设备登录历史 -->
<template>
<baseDialog :dialog-config="dialogConfig"
:is-show.sync="visible"
class="accountDailog"
@handleClick="handleAddConfirm">
<div>
<div class="header"
slot="header"
style="padding: 10px 20px;">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="labelWidth"
:form-data="showFormData" />
<div class="up-btns">
<el-button @click="handleSearch"
size="small"
type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table ref="recordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn">
</d2-table>
</div>
</div>
</baseDialog>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { merchantShopGoodsStockPage } from '@api/stockManage'
import { queryloginLog } from '@api/inStoreManage'
export default {
name: 'LoginHistoryDialog',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
labelWidth: '100px',
dialogConfig: {
title: '设备登录历史',
width: '1500px'
},
// editChildRef: 'editChildRef',
searchForm: {
userName: '',
loginTime: '',
loginDeviceType: ''
},
searchFormSearch: {},
showFormData: [{
label: '员工姓名',
name: 'userName',
type: 'input',
maxlength: '50',
isClear: true
}, {
label: '日期',
name: 'loginTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
}, {
label: '登录设备',
name: 'loginDeviceType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'loginDeviceTypeList'
}],
getListApi: queryloginLog,
tableData: [],
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
// tableOption: false,
tableColumns: [
{
label: '登录员工',
prop: 'userName'
},
{
label: '日期',
prop: 'loginTime',
formatter: (cellValue) => {
return cellValue.loginTime ? Util.dateFormate(cellValue.loginTime, 'YYYY-MM-DD') : ''
}
},
{
label: '时间',
prop: 'loginTime',
formatter: (cellValue) => {
return cellValue.loginTime ? Util.dateFormate(cellValue.loginTime, 'HH:ss') : ''
}
},
{
label: '登录设备',
prop: 'loginDeviceType',
formatter: (cellValue) => {
return this.baseData.loginDeviceTypeList.find(item => item.confId == cellValue.loginDeviceType)?.confValue
}
}]
},
baseData: {
loginDeviceTypeList: [
{ confId: '1', confValue: "pad端" },
{ confId: '2', confValue: "手机端" }
]
},
}
},
props: {
loginHistoryVisible: {
type: Boolean,
default: false
}
},
watch: {
},
computed: {
visible: {
get() {
return this.loginHistoryVisible
},
set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'loginHistoryVisible' })
}
}
},
mounted() {
this.getOptionsList()
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm)
if (this.searchFormSearch.loginTime) {
this.searchFormSearch.startLoginTime = Util.dateFormate(this.searchFormSearch.loginTime[0], 'YYYY-MM-DD 00:00:00')
this.searchFormSearch.endLoginTime = Util.dateFormate(this.searchFormSearch.loginTime[1], 'YYYY-MM-DD 23:59:59')
delete this.searchFormSearch.loginTime
}
resolve()
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
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])
}
})
},
handleSearch() {
this.$refs.recordTable.refreshTable(false, true)
},
handleReset() {
this.searchForm = {
userName: '',
loginTime: '',
loginDeviceType: ''
}
this.$refs.recordTable.refreshTable(false, true)
},
handleAddConfirm() {
this.visible = true
}
}
}
</script>
<style lang="scss" scoped>
.flagFrom.d2-container-content {
margin-top: 0 !important;
}
.detail-dialog {
}
</style>
<!-- 修订应发工资 -->
<template>
<baseDialog :dialog-config="dialogConfig" :is-show.sync="visible"
@handleClick="handleAddConfirm">
<div class="detail-dialog">
<glsx-combi-form class="edit-form-container"
ref="editFormRef"
label-width="140px"
:is-block="true"
form-ref="editChildRef"
:form-obj="infoForm"
:form-data="formData"
:form-rules="formRules">
<template slot="syncUnit"><span class="unit">元</span></template>
</glsx-combi-form>
<div class="history-box" v-if="infoForm['historyRemark'].length">
<div class="line">
<span class="text">历史备注以及备注时间</span>
</div>
<el-timeline>
<el-timeline-item v-for="(reviewInfo, infoId) in infoForm['historyRemark']"
:color="infoId == 0 ? '#2A58AD' : '#999999'"
:key="infoId"
:timestamp="reviewInfo.updatedDateStr">
{{ reviewInfo.reviewMessage }}
</el-timeline-item>
</el-timeline>
</div>
</div>
</baseDialog>
</template>
<script>
import { reviseSalaryApi, getSalaryRecordApi } from '@api/resident'
import { Util,} from '@/common/util'
import { limitPrice } from '@/common/format'
export default {
name: 'RevisedSalaryDialog',
props: {
revisedSalaryVisible: {
type: Boolean,
default: false
},
revisedSalaryRow: {
type: Object,
default: () => ({})
}
},
data() {
return {
dialogConfig: {
title: '修订合计应发工资',
width: '720px'
},
formData: [
{
label: '当前月份合计应发',
name: 'currentSalary',
type: 'input',
isDisabled: true
},
{
label: '修订为',
name: 'correctSalary',
type: 'input',
width: '136px',
inputFn: (e) => {
e = e.replace(/[^\d.]/g, '')
let oldValue = `${this.infoForm['oldcorrectSalary']}`
this.$set(this.infoForm, 'correctSalary', limitPrice(e, oldValue, 6, 2, 0))
this.$set(this.infoForm, 'oldcorrectSalary', this.infoForm['correctSalary'])
},
suffixSlot: 'syncUnit'
},
{
label: '备注',
name: 'remark',
type: 'input',
inputType: 'textarea',
rows: 5,
maxlength: 500,
showLimit: true
}
],
infoForm: {
correctSalary: '',
remark: '',
historyRemark: []
},
formRules: {
correctSalary: [
{ required: true, message: '请输入修订后的应发工资', trigger: 'blur' }
],
remark: [
{ required: true, message: '请输入备注', trigger: 'blur' }
]
}
}
},
computed: {
visible: {
get() {
return this.revisedSalaryVisible
},
set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'revisedSalaryVisible' })
}
}
},
mounted() {
// 获取修订工资备注记录
this.getRecord()
},
methods: {
getRecord() {
getSalaryRecordApi({ staffPhone: this.revisedSalaryRow.staffPhone, salaryMonth: this.revisedSalaryRow.salaryMonth, pageSize: 10, currentPage: 1 }).then(res => {
res?.list?.forEach(item => {
item.reviewMessage = item.remark
item.updatedDateStr = Util.dateFormate(item.createdDate, 'YYYY-MM-DD HH:mm:ss')
})
this.infoForm.historyRemark = res?.list || []
this.$set(this.infoForm, 'currentSalary', this.revisedSalaryRow.correctSalary || this.revisedSalaryRow.salary)
})
},
handleAddConfirm() {
this.$refs.editFormRef?.$refs?.editChildRef?.validate((valid) => {
if (valid) {
reviseSalaryApi({id: this.revisedSalaryRow.id, correctSalary: this.infoForm['correctSalary'], remark: this.infoForm['remark']}).then(res => {
this.$message.success('修订成功')
this.$emit('dialogClose', { flag: true, attrName: 'revisedSalaryVisible' })
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.detail-dialog{
.unit{
margin-left: 4px;
}
.line{
width: 100%;
height: 1px;
background: #E6E6E6;
position: relative;
margin: 32px 0;
.text{
position: absolute;
left: 50%;
top: -10px;
transform: translateX(-50%);
background: #fff;
padding: 0 16px;
font-size: 14px;
color: #00000066;
}
}
::v-deep .el-timeline-item__node--normal{
width: 8px;
height: 8px;
}
::v-deep .el-timeline-item__tail{
left: 2px
}
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 工资明细 -->
<template>
<baseDialog :dialog-config="dialogConfig" :is-show.sync="visible"
@handleClick="handleAddConfirm">
<div class="dialog-content">
<div class="header">
<div class="header-item">
<label>个人基本工资:</label>
<span class="value">{{ isEmpty(detailInfo.basicSalary) ? '-' : detailInfo.basicSalary }}元</span>
</div>
<div class="header-item">
<label>保底工资:</label>
<span class="value">{{ isEmpty(detailInfo.minimumSalary) ? '-' : detailInfo.minimumSalary }}元</span>
</div>
<div class="header-item">
<label>导师收入:</label>
<span class="value">{{ isEmpty(detailInfo.mentorCommission) ? '-' : detailInfo.mentorCommission}}元</span>
</div>
<div class="header-item">
<label>导师收入来源:</label>
<span class="value">{{ detailInfo.studentNameList && detailInfo.studentNameList.length ? detailInfo.studentNameList.join('、') : '-' }}</span>
</div>
</div>
<div class="content" v-if="detailInfo && detailInfo.detailArray && detailInfo.detailArray.length">
<div class="title">{{ detailRow.month }}月提成构成:</div>
<el-tabs v-model="activeName" type="card">
<el-tab-pane v-for="(item, index) in detailInfo.detailArray" :key="index" :label="item.key" :name="`${index}`">
<div v-for="(subItem, subIdx) in item.data" :key="subIdx" class="content-item">
<div class="content-item-header">
<span>{{ subItem.merchantName }}</span>
<span>{{ subItem.merchantId }}</span>
</div>
<div class="content-item-body">
<div class="left-line">
<div class="line" :style="{'top': (48 * (idx + 1) + 63) + 'px'}" v-for="(v, idx) in subItem.allocationDetailList" :key="idx"></div>
</div>
<div class="content-item-body-title">
<span>{{ subItem.staffName || '-' }} | </span>
<span>{{ filterStr(subItem.sceneType, staffSceneLabelList) || '-' }} | </span>
<span>产值贡献{{ isEmpty(subItem.orderTotalPrice) ? '-' : `¥${subItem.orderTotalPrice}` }} | </span>
<span>{{ filterStr(subItem.jobType, staffLevelList, detailRow.hireType) || '-' }} | </span>
<span>周期渗透率{{ !isEmpty(subItem.penetrationRate) ? `${subItem.penetrationRate}%` : '-'}} | </span>
<span>提成系数{{ !isEmpty(subItem.calculateValue) ? `${subItem.calculateValue}%` : '-'}}</span>
</div>
<d2-table :hasPage="false"
:tableData="subItem.allocationDetailList"
:table-params="tableParams">
</d2-table>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
<div class="footer">
<span>个人工资=基本工资</span>
<span class="amount">{{ isEmpty(detailInfo.basicSalary) ? '-' : detailInfo.basicSalary }}元</span>
<span>+总提成</span>
<span class="amount">{{ isEmpty(detailInfo.commissionPrice) ? '-' : detailInfo.commissionPrice }}元</span>
</div>
</div>
</baseDialog>
</template>
<script>
import { getSalaryDetailApi } from '@api/resident'
import { staffLevelList, staffSceneLabelList } from '@/common/constants.js'
import { Util } from "@/common/util"
import { isEmpty, filterStr } from '../util.js'
export default {
name: 'SalaryDetailsDialog',
data() {
return {
isEmpty,
filterStr,
staffLevelList,
staffSceneLabelList,
dialogConfig: {
title: '工资明细',
width: '1080px'
},
detailInfo: {},
activeName: '',
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableColumns: [
{
label: '分配实体',
prop: 'allocationType',
formatter: (row) => {
return ['个人', '导师', '督导', '激励池'][row.allocationType - 1] || '-'
}
},
{
label: '姓名',
prop: 'staffName'
},
{
label: '比例',
prop: 'commissionRatio',
width: 80,
formatter: (row) => {
return row.commissionRatio ? `${row.commissionRatio}%` : '-'
}
},
{
label: '关联时间',
prop: '',
formatter: (row) => {
return row.startTime && row.endTime ? Util.dateFormate(row.startTime, 'MM月DD日') + '至' + Util.dateFormate(row.endTime, 'MM月DD日') : '-'
}
},
{
label: '应分金额',
prop: 'commissionPrice',
width: 100,
formatter: (row) => {
return row.commissionPrice ? `¥${row.commissionPrice}` : '-'
}
}
]
}
}
},
props: {
salaryDetailsVisible: {
type: Boolean,
default: false
},
detailRow: {
type: Object,
default: () => {}
}
},
computed: {
visible: {
get() {
return this.salaryDetailsVisible
},
set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'salaryDetailsVisible' })
}
},
firstHalf() {
const monthStr = this.detailRow?.month.toString().padStart(2, '0');
return `${monthStr}月01日至${monthStr}月15日`;
},
secondHalf() {
const monthStr = this.detailRow?.month.toString().padStart(2, '0');
const daysInMonth = new Date(this.detailRow?.currentYear, this.detailRow?.month, 0).getDate();
return `${monthStr}月16日至${monthStr}月${daysInMonth}日`;
}
},
mounted() {
this.getSalaryDetail()
},
methods: {
handleAddConfirm() {
this.$emit('dialogClose')
},
getSalaryDetail() {
getSalaryDetailApi({ id: this.detailRow.id }).then(res => {
if (res) {
const detailArray = res?.detailList && Object.keys(res?.detailList)?.map(key => {
return {
key: key,
data: res?.detailList[key]
}
})
res.detailArray = detailArray
this.activeName = detailArray?.length ? '0' : ''
}
this.detailInfo = res || {}
})
}
}
}
</script>
<style lang="scss" scoped>
.dialog-content {
max-height: calc(68vh - 60px);
overflow: auto;
.header {
display: flex;
flex-wrap: wrap;
align-items: center;
.header-item{
flex: 33% 0 0;
margin-bottom: 16px;
label {
display: inline-block;
width: 124px;
color: #666666;
text-align: right;
}
.value {
color: #1D1D1D;
}
}
}
.content{
.title {
color: #333333;
font-weight: bold;
}
::v-deep .el-tabs__header {
margin-bottom: 0;
.el-tabs__nav-scroll{
background: #ffffff;
padding: 16px 0 0;
.el-tabs__nav{
height: 38px;
background: #E8E8E8;
border-radius: 4px;
margin-left: 2px;
padding: 2px;
.el-tabs__active-bar {
display: none !important;
}
.el-tabs__item {
height: 32px;
line-height: 32px;
width: 170px;
color: #666666;
padding: 0 24px;
}
.el-tabs__item.is-active {
color: #2A58AD;
font-weight: 600;
background: #ffffff;
border-radius: 3px;
border: none;
}
}
}
}
.content-item{
.content-item-header{
height: 42px;
line-height: 42px;
background: #F5F7FA;
color: #000000;
padding: 0 16px;
margin-top: 20px;
font-weight: bold;
border-bottom: 1px solid #E7E7E7;
}
.content-item-body{
padding: 0 36px;
position: relative;
.left-line{
position: absolute;
left: 15px;
width: 1px;
height: calc(100% - 24px);
background: #E7E7E7;
.line{
width: 21px;
height: 1px;
background: #E7E7E7;
position: absolute;
left: 0;
}
}
.content-item-body-title{
color: #1D1D1D;
padding: 12px 0;
}
::v-deep .el-table th {
background: #F5F7FA;
}
::v-deep .el-table__row{
height: 48px;
}
}
}
}
.footer{
color: #333333;
font-weight: 500;
padding: 16px;
.amount{
font-size: 16px;
font-weight: 600;
color: #2A58AD;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="layout">
<div class="tab"
ref="tabbox">
<div :class="['tab-item', { 'item-active': windowId == -1 }]"
@click="windowId = -1">
驻店管理
</div>
<template v-for="(i, index) in tab">
<template>
<div :key="i.id"
:class="['tab-item', { 'item-active': windowId == i.id }]"
@click="windowId = i.id"
:ref="`tab-${index}`">
{{ i.text }}
<div class="close"
@click.stop="close(index)">
<i class="el-icon-close"></i>
</div>
</div>
</template>
</template>
<template v-if="dropdownList.length">
<div class="arrow-box">
<el-dropdown trigger="click"
@command="windowId = $event">
<div class="dropdown-link">
<i class="el-icon-arrow-down"></i>
</div>
<el-dropdown-menu slot="dropdown">
<template v-for="(i, index) in dropdownList">
<el-dropdown-item :class="{ 'dropdown-item-active': windowId == i.id }"
:key="i.id"
:command="i.id">
<div class="dropdown-item">
{{ i.text }}
<div class="close"
@click.stop="closeDrop(index)">
<i class="el-icon-close"></i>
</div>
</div>
</el-dropdown-item>
</template>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</div>
<div class="content">
<InStoreManageIndex v-show="windowId == -1"
ref="inStoreManageIndex"
@openWindow="openWindow" />
<template v-for="i in [...tab, ...dropdownList]">
<staffInfo :ref="`recep-${i.id}`"
:key="i.id"
v-show="windowId == i.id"
:query-data="i.data"
@backIndex="backIndex" />
</template>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import InStoreManageIndex from "./index"
import staffInfo from "./staffInfo"
export default {
name: "",
components: {
InStoreManageIndex,
staffInfo
},
data() {
return {
tab: [],
dropdownList: [],
windowId: -1,
tabboxWidth: 0
}
},
// 在beforeDestroy钩子中移除事件监听
beforeDestroy() {
window.removeEventListener('popstate', this.preventBack)
},
// 在你的Vue组件的mounted钩子中添加事件监听
mounted() {
history.pushState(null, null, document.URL)
window.addEventListener('popstate', this.preventBack)
if (this.tabboxWidth == 0) this.tabboxWidth = this.$refs.tabbox.offsetWidth
},
methods: {
preventBack() {
if (this.windowId !== -1) {
const [recep] = this.$refs[`recep-${this.windowId}`]
if (recep && recep.isQualityVisible) recep.isQualityVisible = false
else this.windowId = -1
history.pushState(null, null, document.URL)
} else this.$router.go(-1)
},
openWindow(data) {
const id = `${data.staffName}_${data.phoneNumber}`
const windowList = [...this.tab, ...this.dropdownList]
const windowItem = windowList.find((e) => e.id == id)
if (windowItem) {
this.$refs[`recep-${id}`]?.[0]?.setActiveName(data)
return this.windowId = id
}
if (windowList.length == 20) return this.$message.error("最多同时打开20个tabs")
const item = {
text: data.staffName || '-',
data,
id
}
if (this.dropdownList.length) this.dropdownList.push(item)
else {
this.tab.push(item)
this.checkEl()
}
this.windowId = id
},
close(index) {
this.tab.splice(index, 1)
if (this.dropdownList.length) {
this.tab.push(this.dropdownList[0])
this.closeDrop(0)
}
this.windowId = -1
this.checkEl()
},
closeDrop(index) {
this.dropdownList.splice(index, 1)
},
checkEl() {
const { tab, tabboxWidth } = this
const len = tab.length - 1
this.$nextTick(() => {
const [el] = this.$refs[`tab-${len}`]
if (el) {
const { offsetWidth, offsetLeft } = el
if (offsetLeft + offsetWidth / 2 > tabboxWidth - 54) {
this.dropdownList.push(tab[len])
this.tab.splice(len, 1)
}
}
})
},
backIndex() {
this.windowId = -1
this.$refs['inStoreManageIndex']?.handleSearch()
}
}
}
</script>
<style scoped lang='scss'>
.layout {
height: 100%;
.tab {
display: flex;
align-items: center;
margin-left: 20px;
width: calc(100% - 54px);
box-sizing: border-box;
&-item {
width: fit-content;
height: 40px;
padding: 0 20px;
background: #fafafa;
border-radius: 4px 4px 0 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
color: #666666;
cursor: pointer;
line-height: 40px;
margin-right: 1px;
flex-shrink: 0;
.close {
border-radius: 100%;
padding: 4px;
margin-left: 4px;
display: flex;
align-items: center;
justify-content: center;
&:hover {
background-color: #666;
.el-icon-close {
color: #fff;
}
}
}
.el-icon-close {
font-size: 12px;
display: flex;
align-items: center;
justify-content: center;
color: #666666;
transform: translateY(1px);
}
}
.item-active {
font-weight: 500;
color: #2a58ad;
background: #ffffff;
}
.arrow-box {
width: 32px;
height: 40px;
line-height: 40px;
text-align: center;
background: #fafafa;
cursor: pointer;
flex-shrink: 0;
.el-dropdown {
width: 100%;
}
}
}
.content {
position: relative;
width: 100%;
height: calc(100% - 40px);
// overflow-y: scroll;
box-sizing: border-box;
// padding-bottom: 70px;
}
}
::v-deep.dropdown-item {
display: flex;
align-items: center;
justify-content: center;
.close {
border-radius: 100%;
padding: 4px;
margin-left: 4px;
display: flex;
align-items: center;
justify-content: center;
&:hover {
background-color: #666;
.el-icon-close {
color: #fff;
}
}
i {
margin-right: 0;
}
}
.el-icon-close {
font-size: 12px;
color: #666666;
}
}
.dropdown-item-active {
background-color: #eaeef7;
color: #5579bd;
}
</style>
<!-- 员工编辑 -->
<template>
<d2-container ref="staffInfoWrap">
<div class="staffInfo-wrap" >
<el-tabs v-model="activeName" type="card" @tab-click="tabClick">
<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">
<historical-performance ref="historicalPerformance" v-if="activeName == 'historyPerformance'" :queryData="queryData"></historical-performance>
</el-tab-pane>
</el-tabs>
<div class="btnCon">
<el-button v-if="activeName == 'staffInfo'" type="primary" @click="handleConfirm">提交</el-button>
<el-button v-if="activeName != 'staffInfo'" type="primary" @click="handleCancel">返回</el-button>
<el-button v-if="activeName == 'staffInfo'" @click="handleCancel">返回</el-button>
</div>
</div>
</d2-container>
</template>
<script>
import { mapActions } from "vuex"
import historicalPerformance from "./components/historicalPerformance.vue"
import editStaff from "./components/editStaff.vue"
export default {
name: "StaffInfo",
props: {
queryData: Object
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
activeName: 'staffInfo',
editPermissionFlag: false,
historyPerformanceFlag: false
}
},
components: {
editStaff,
historicalPerformance
},
computed: {},
async mounted() {
this.setActiveName(this.queryData)
this.$nextTick(() => {
const $store = this.$store.getters['d2admin/auth/curBtns']
const btnId = '9120505' // 员工编辑权限
const btnId2 = '9120508' // 历史业绩权限
const _item = $store?.find(i => (i.authId === btnId))
const _item2 = $store?.find(i => (i.authId === btnId2))
if (_item) {
this.editPermissionFlag = true
}
if (_item2) {
this.historyPerformanceFlag = true
}
})
},
methods: {
...mapActions({
get: "d2admin/base/get",
close: "d2admin/page/close"
}),
async getBaseData() { },
// tab选中项
setActiveName(data) {
this.activeName = data.activeName
setTimeout(() => {
// 将页面滚动回顶部
if (this.$refs['staffInfoWrap'] && this.$refs['staffInfoWrap'].$refs['component'] && this.$refs['staffInfoWrap'].$refs['component'].$el) {
this.$refs['staffInfoWrap'].$refs['component'].$el.scrollTop = 0
// 重新请求页面接口
let refs = data.activeName == 'staffInfo' ? 'editStaff' : 'historicalPerformance'
this.$refs[refs].resetData()
}
})
},
tabClick() {
this.setActiveName({ activeName: this.activeName })
},
handleCancel() {
this.$emit("backIndex")
},
handleConfirm() {
this.$refs.editStaff.handleConfirm().then(() => {
this.$emit("backIndex")
})
}
}
}
</script>
<style scoped lang="scss" >
.btnCon {
width: 100%;
margin-top: 40px;
text-align: center;
}
.staffInfo-wrap {
height: 100%;
// margin-left: 20px;
// overflow-y: scroll;
// height: calc(100vh - 40px);
::v-deep .el-tabs__header {
position: sticky;
top: 0;
margin-bottom: 0;
z-index: 10;
.el-tabs__nav-scroll{
background: #ffffff;
padding: 16px 0;
.el-tabs__nav{
height: 38px;
background: #E8E8E8;
border-radius: 4px;
margin-left: 22px;
padding: 2px;
.el-tabs__active-bar {
display: none !important;
}
.el-tabs__item {
height: 32px;
line-height: 32px;
width: 104px;
color: #666666;
padding: 0 24px;
}
.el-tabs__item.is-active {
color: #2A58AD;
font-weight: 600;
background: #ffffff;
border-radius: 3px;
border: none;
}
}
}
}
}
</style>
export function isEmpty(data) {
return (data ?? '') === ''
}
export function filterStr(val, dataList, hireType) {
if (isEmpty(val)) return '-'
if (hireType == 2 && val == 9) return '区域督导'
const staffStr = `${val}`?.split(',')
let result = staffStr?.map(v => {
const found = dataList?.find(item => item.confId == v)
return found?.confValue
})
return result?.length ? result.join('、') : '-'
}
\ No newline at end of file \ No newline at end of file
<!-- 新增支出 -->
<template>
<div>
<d2-dialog
:title="'新增支出'"
:is-visible="expenseVisible"
width="700px"
@closeDialog="handleAdd"
@confirmDialog="handleAddConfirm"
>
<glsx-combi-form class="edit-form-container"
ref="editFormRef"
label-width="110px"
:is-block="true"
form-ref="editChildRef"
:form-obj="expenseForm"
:form-data="formData"
:form-rules="formRules">
<template slot="staff">
<el-select v-model="expenseForm.staffPhone" placeholder="请选择员工"
style="width: 432px" remote reserve-keyword @visible-change="visibleChange"
:remote-method="remoteMethod" v-el-select-loadmore="interestsLoadmore" @change="handleStaffChange" filterable>
<el-option v-for="item in baseData.staffList" :key="item.staffPhone" :label="item.staffName" :value="item.staffPhone"></el-option>
</el-select>
</template>
<template slot="syncUnit"><span class="unit">元</span></template>
</glsx-combi-form>
</d2-dialog>
</div>
</template>
<script>
import { mapActions } from "vuex"
import { limitPrice } from '@/common/format'
import { addIncentivePoolApi, getLevelStaffListApi } from '@/api/resident'
import { staffLevelList } from '@/common/constants.js'
import { filterStr } from '../../inStoreManage/util.js'
export default {
name: "AddExpenseDialog",
data() {
return {
expenseForm: {
staffPhone: "",
jobType: "",
merchantName: "",
amount: "",
remark: ""
},
formData: [
{
label: '员工',
name: 'staffName',
addHtml: 'staff',
rules: [{ required: true, message: '请选择员工', trigger: 'change' }]
},
{
label: '员工手机号',
name: 'staffPhone',
type: 'input',
isDisabled: true
},
{
label: '员工职级',
name: 'jobTypeStr',
type: 'input',
isDisabled: true
},
{
label: '归属门店',
name: 'merchantName',
type: 'input',
isDisabled: true
},
{
label: '支出金额',
name: 'amount',
type: 'input',
width: '136px',
inputFn: (e) => {
e = e.replace(/[^\d.]/g, '')
let oldValue = this.expenseForm['oldamount'] || ''
this.$set(this.expenseForm, 'amount', limitPrice(e, oldValue, 6, 2, 0))
this.$set(this.expenseForm, 'oldamount', this.expenseForm['amount'])
},
suffixSlot: 'syncUnit'
},
{
label: '备注',
name: 'remark',
type: 'input',
inputType: 'textarea',
rows: 4,
maxlength: 100,
showLimit: true
}
],
formRules: {
amount: [
{ required: true, message: "请输入支出金额", trigger: "change" },
{
required: true,
trigger: 'blur',
validator: (rule, value, callback) => {
(+value > +this.expensePoolInfo.totalBalance) ? callback(new Error('不得超过激励池总额')) : callback()
}
}
],
},
// 基本数据
baseData: {
staffList: []
},
staffName: "",
currentPage: 1,
pageSize: 20
}
},
props: {
expenseVisible: {
type: Boolean,
default: false
},
expensePoolInfo: {
type: Object,
default: () => {}
}
},
watch: {
expenseVisible(val) {
if (val) {
this.$nextTick(() => {
this.$refs.addExpenseForm?.resetFields()
})
}
}
},
directives: {
"el-select-loadmore": {
bind(el, binding) {
setTimeout(() => {
const SELECTWRAP_DOM = el.querySelector(
'.el-select-dropdown .el-select-dropdown__wrap'
)
if (SELECTWRAP_DOM) {
SELECTWRAP_DOM.addEventListener('scroll', function () {
const condition =
this.scrollHeight - this.scrollTop <= this.clientHeight
if (condition) {
binding.value()
}
})
}
}, 500)
}
}
},
mounted() {
},
methods: {
...mapActions({
get: "d2admin/base/get"
}),
visibleChange(data) {
// 获取焦点重新渲染下拉框数据
if (data) {
this.staffName = ""
this.currentPage = 1
this.baseData.staffList = []
this.getSelectingList()
}
},
// 获取配置职级的员工
remoteMethod(query) {
this.staffName = query
this.currentPage = 1
this.baseData.staffList = []
this.getSelectingList()
},
// 获取更多员工
interestsLoadmore() {
setTimeout(() => {
this.currentPage = this.currentPage + 1
if (this.allPages < this.currentPage) {
this.currentPage = this.allPages
return
}
this.getSelectingList()
}, 10)
},
// 获取员工列表
getSelectingList() {
let params = {
currentPage: this.currentPage,
pageSize: this.pageSize,
staffName: this.staffName
}
getLevelStaffListApi(params).then(res => {
this.baseData.staffList = this.baseData.staffList.concat(res.list || [])
this.allPages = res.pages
})
},
// 选择员工 将附带信息赋值到输入框
handleStaffChange(val) {
this.baseData.staffList.forEach(item => {
if (item.staffPhone === val) {
this.$set(this.expenseForm, 'staffPhone', item.staffPhone)
this.$set(this.expenseForm, 'jobTypeStr', filterStr(item.jobType, staffLevelList, item.hireType))
this.$set(this.expenseForm, 'merchantName', item.merchantName)
this.$set(this.expenseForm, 'staffName', item.staffName)
this.$set(this.expenseForm, 'jobType', item.jobType)
}
})
},
handleAdd() {
this.$emit("expenseClose")
},
handleAddConfirm() {
this.$refs.editFormRef?.$refs.editChildRef?.validate((valid) => {
if (valid) {
let params = {
staffPhone: this.expenseForm?.staffPhone,
staffName: this.expenseForm?.staffName,
jobType: this.expenseForm?.jobType,
expensePrice: this.expenseForm?.amount,
remark: this.expenseForm?.remark
}
addIncentivePoolApi(params).then(res => {
this.$message.success('添加成功')
this.$emit("expenseClose", true)
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.unit{
margin-left: 4px;
}
</style>
<!-- 应用商品弹窗 -->
<template>
<d2-dialog
:title="title"
:is-visible.sync="appliedGoodsVisible"
width="50%"
btn-ok-label="确定"
@confirmDialog="handleAppliedGoodsConfirm"
@closeDialog="handleAppliedGoodsClose"
class="appliedGoods">
<slot />
<el-row class="tableCon">
<div class="tableBox">
<el-table
ref="seletingTable"
:data="selectingData"
height="464px"
class="table"
border
@select="handleChange"
@select-all="handleAll">
<el-table-column type="selection"
width="55"
align="center" />
<el-table-column prop="upgradeGoodsName" label="商品名称" align="center">
</el-table-column>
</el-table>
<el-pagination
small
background
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-size="pageSize"
layout="total, prev, pager, next"
:total="total" />
</div>
<el-table
class="tableBox table"
:data="selectedData"
border
height="464px">
<el-table-column prop="upgradeGoodsName" label="商品名称" align="center">
<template slot-scope="scope">
<span :class="{'gray': scope.row.merchantGoodsStatus != 1}">{{ scope.row.upgradeGoodsName }}</span>
</template>
</el-table-column>
<el-table-column label="删除" align="center" width="50px">
<template slot-scope="scope">
<el-button
class="el-icon-delete"
@click="handleDelete(scope.row)"
type="text" />
</template>
</el-table-column>
</el-table>
</el-row>
</d2-dialog>
</template>
<script>
import { deepClone } from '@/common/util'
export default {
name: "RelateStoreDialog",
data() {
return {
selectedData: [],
selectingData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 20
}
},
props: {
title: {
type: String,
default: ""
},
appliedGoodsVisible: {
type: Boolean,
default: false
},
goodsApi: {
type: Function,
default: () => {}
},
goodsSearchForm: {
type: Object,
default: () => {}
},
addGoodsRow: {
type: Object,
default: () => {}
}
},
mounted() {
this.selectedData = deepClone(this.addGoodsRow?.goodsData)
console.log(this.selectedData)
this.getSelectingList()
},
methods: {
recoverySelection() {
var exitIds = this.selectedData.map((item) => item.merchantGoodsCode)
this.selectingData.forEach((item) => {
if (exitIds.includes(item.merchantGoodsCode)) {
this.$nextTick(() => {
this.$refs.seletingTable.toggleRowSelection(item, true)
})
}
})
},
getSelectingList() {
this.goodsApi({
...this.goodsSearchForm,
currentPage: this.currentPage,
pageSize: this.pageSize,
merchantId: this.addGoodsRow?.merchantId
}).then((res) => {
res.list?.forEach(v => {
v.merchantGoodsStatus = v.status
})
this.selectingData = res.list
this.total = res.total
this.$nextTick(() => {
this.recoverySelection()
})
})
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(
(item) => item.merchantGoodsCode === row.merchantGoodsCode
)
addOrDelete
? this.selectedData.push(row)
: (this.selectedData = this.selectedData.filter(
(item) => item.merchantGoodsCode !== row.merchantGoodsCode
))
},
handleAll(selection) {
this.selectingData.forEach((item) => {
var isExit = this.selectedData.findIndex(
(subItem) => subItem.merchantGoodsCode === item.merchantGoodsCode
)
if (selection.length && isExit === -1) {
this.selectedData.push(item)
} else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1)
}
})
},
handleDelete(row) {
this.selectedData = this.selectedData.filter(
(item) => item.merchantGoodsCode !== row.merchantGoodsCode
)
const obj = this.selectingData.find((v) => v.merchantGoodsCode == row.merchantGoodsCode)
this.$nextTick(() => {
this.$refs.seletingTable.toggleRowSelection(obj)
})
},
handleCurrentChange(val) {
this.currentPage = val
this.getSelectingList()
},
handleAppliedGoodsConfirm() {
this.selectedData.forEach((val) => {
if (!val.goodsData) val.goodsData = []
})
this.$emit("handleAppliedGoodsConfirm", this.selectedData)
},
handleAppliedGoodsClose() {
this.$emit("handleAppliedGoodsClose")
}
}
}
</script>
<style lang="scss">
.appliedGoods .table {
margin: 0 auto 20px !important;
width: 98%;
}
.appliedGoods .tableCon {
margin-top: 20px;
display: flex;
.tableBox {
flex: 1;
.gray{
color: #66666642;
}
}
}
.service-store .appliedGoods .el-table .cell,
.d2-form .appliedGoods .el-table .cell {
line-height: 26px !important;
}
.service-store .appliedGoods .el-table--medium td,
.d2-form .appliedGoods .el-table--medium td {
padding: 6px 8px !important;
}
.appliedGoods .red {
color: red;
}
.appliedGoods .tip-icon {
position: absolute;
display: inline-block;
height: 10px;
width: 10px;
line-height: 10px;
color: #ffffff;
background-color: red;
border: 1px solid red;
border-radius: 50%;
cursor: pointer;
font-size: 6px;
margin-left: 2px;
}
</style>
<!-- 激励池明细 -->
<template>
<baseDialog :dialog-config="dialogConfig" :is-show.sync="visible"
@handleClick="handleAddConfirm">
<div class="dialog-content">
<div class="header">
<div class="header-right">
<span>{{ detailInfo.commissionMonthStr }}月提成构成:</span>
<span class="cycle">{{ detailRow.cycle }}</span>
</div>
</div>
<div class="content">
<div class="content-item">
<div class="content-item-header">
<span>{{ detailInfo.merchantName }}</span>
<span>{{ detailInfo.merchantId }}</span>
</div>
<div class="content-item-body" v-if="detailInfo.commissionRecord">
<div class="left-line">
<div class="line" :style="{'top': (48 * (idx + 1) + 63) + 'px'}" v-for="(v, idx) in detailInfo.commissionRecord.allocationDetailList" :key="idx"></div>
</div>
<div class="content-item-body-title">
<span>{{ detailInfo.staffName }} | </span>
<span>{{ detailInfo.sceneType == 1 ? '轻改' : detailInfo.sceneType == 2 ? '会员权益/升级' : '-'}} | </span>
<span>产值贡献{{ detailInfo.totalPrice }}元 | </span>
<span>{{ detailInfo.jobTypeStr }} | </span>
<span>周期渗透率{{ !isEmpty(detailInfo.commissionRecord.penetrationRate) ? `${detailInfo.commissionRecord.penetrationRate}%` : '-' }} | </span>
<span>提成系数{{ !isEmpty(detailInfo.commissionRecord.calculateValue) ? `${detailInfo.commissionRecord.calculateValue}%` : '-' }} | </span>
</div>
<d2-table :hasPage="false"
:tableData="detailInfo.commissionRecord.allocationDetailList"
:table-params="tableParams">
</d2-table>
</div>
<div class="content-item-footer">
<span>激励池实存:</span>
<span class="amount">{{ detailInfo.actualJlcPrice }}元</span>
</div>
</div>
</div>
</div>
</baseDialog>
</template>
<script>
import { getIncentivePoolDetailApi } from '@api/resident'
import { Util } from '@/common/util'
import { staffLevelList } from '@/common/constants'
import { filterStr } from '../../inStoreManage/util.js'
export default {
name: 'DepositDetailDialog',
data() {
return {
dialogConfig: {
title: '激励池明细',
width: '1080px'
},
detailInfo: {
},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableColumns: [
{
label: '分配实体',
prop: 'allocationType',
formatter: (row) => {
return ['个人', '导师', '督导', '激励池'][row.allocationType - 1] || '-'
}
},
{
label: '分配人',
prop: 'staffName'
},
{
label: '比例',
prop: 'commissionRatio',
width: 80,
formatter: (row) => {
return row.commissionRatio ? `${row.commissionRatio}%` : '-'
}
},
{
label: '关联时间',
prop: '',
formatter: (row) => {
return row.startTime && row.endTime ? Util.dateFormate(row.startTime, 'MM月DD日') + '至' + Util.dateFormate(row.endTime, 'MM月DD日') : '-'
}
},
{
label: '应分金额',
prop: 'commissionPrice',
width: 100,
formatter: (row) => {
return row.commissionPrice ? `¥${row.commissionPrice}` : '-'
}
}
]
}
}
},
props: {
depositDetailVisible: {
type: Boolean,
default: false
},
detailRow: {
type: Object,
default: () => ({})
}
},
computed: {
visible: {
get() {
return this.depositDetailVisible
},
set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'depositDetailVisible' })
}
}
},
mounted() {
this.getIncentivePoolDetail()
},
methods: {
handleAddConfirm() {
this.$emit('dialogClose')
},
isEmpty(data) {
return (data ?? '') === ''
},
getIncentivePoolDetail() {
getIncentivePoolDetailApi({ id: this.detailRow.id }).then(res => {
if (res) {
res.commissionMonthStr = res?.commissionMonth ? res?.commissionMonth.split('-')[1] : '-'
res.jobTypeStr = filterStr(res?.jobType, staffLevelList, res?.hireType)
}
this.detailInfo = res || {}
})
}
}
}
</script>
<style lang="scss" scoped>
.dialog-content{
max-height: calc(68vh - 60px);
overflow: auto;
.header{
height: 40px;
display: flex;
align-items: center;
.header-left{
color: #333333;
font-weight: bold;
margin-right: 24px;
}
.header-right{
color: #333333;
font-weight: 600;
font-size: 14px;
.cycle{
color: #2A58AD;
}
}
}
.content{
.content-item{
.content-item-header{
height: 42px;
line-height: 42px;
background: #F5F7FA;
color: #000000;
padding: 0 16px;
font-weight: bold;
border-bottom: 1px solid #E7E7E7;
}
.content-item-body{
padding: 0 36px;
position: relative;
.left-line{
position: absolute;
left: 15px;
width: 1px;
height: calc(100% - 24px);
background: #E7E7E7;
.line{
width: 21px;
height: 1px;
background: #E7E7E7;
position: absolute;
left: 0;
}
}
.content-item-body-title{
color: #1D1D1D;
padding: 12px 0;
}
::v-deep .el-table th {
background: #F5F7FA;
}
::v-deep .el-table__row{
height: 48px;
}
}
.content-item-footer{
color: #333333;
font-weight: bold;
padding: 16px;
.amount{
font-size: 16px;
color: #2A58AD;
}
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 激励池 - 存入 -->
<template>
<div class="deposit-list">
<d2-table ref="depositTable"
:has-num="false"
:search-form="searchFormSearch"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn">
<div slot="auth-button"
slot-scope="scope">
<auth-button :data="scope.scope"
:show-btn-ids="['9121209']" />
</div>
</d2-table>
<deposit-detail-dialog :deposit-detail-visible="depositDetailVisible" v-if="depositDetailVisible" @dialogClose="handleCloseDialog" :detail-row="detailRow"></deposit-detail-dialog>
</div>
</template>
<script>
import { mapActions } from 'vuex'
import { Util, deepClone } from '@/common/util'
import { staffLevelList } from '@/common/constants.js'
import depositDetailDialog from './depositDetailDialog.vue'
import { getIncentivePoolDepositListApi } from '@/api/resident'
import { filterStr } from '../../inStoreManage/util.js'
export default {
name: 'DepositList',
components: {
depositDetailDialog
},
data() {
return {
searchFormSearch: {},
getListApi: getIncentivePoolDepositListApi,
// 表格参数
tableParams: {
needUnique: true,
mutiSelectUniqueKey: 'uniqueVal',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: {
width: '100'
},
tableColumns: [{
label: '序号',
prop: 'ownSerialNum',
type: 'ownSerialNum',
width: '60'
}, {
label: '周期',
prop: '',
formatter: (cellValue) => {
return Util.dateFormate(cellValue.startTime, 'MM月DD日') + '至' + Util.dateFormate(cellValue.endTime, 'MM月DD日')
},
width: 160
}, {
label: '员工姓名',
prop: 'staffName',
}, {
label: '职级',
prop: 'jobType',
width: 120,
formatter: (cellValue) => {
return filterStr(cellValue.jobType, this.baseData.jobTypeList, cellValue.hireType)
}
}, {
label: '门店',
prop: 'merchantName',
formatter: (cellValue) => {
return `${cellValue.merchantName}${cellValue.merchantId}` || '-'
}
}, {
label: '业务',
prop: '',
formatter: (cellValue) => {
const mapping = { 1: '轻改', 0: '会员权益/升级' }
return mapping[cellValue.sceneType] || '-'
},
width: 120
}, {
label: '贡献产值',
prop: 'totalPrice',
formatter: (cellValue) => {
return cellValue.totalPrice ? '¥' + cellValue.totalPrice : '-'
},
width: 120
}, {
label: '存入比例',
prop: 'jlcCommissionRatio',
formatter: (cellValue) => {
return cellValue.jlcCommissionRatio ? cellValue.jlcCommissionRatio + '%' : '-'
},
width: 100
}, {
label: '应存金额',
prop: 'jlcCommissionPrice',
formatter: (cellValue) => {
return cellValue.jlcCommissionPrice ? '¥' + cellValue.jlcCommissionPrice : '-'
},
width: 100
}, {
label: '实存金额',
prop: 'actualJlcPrice',
formatter: (cellValue) => {
return cellValue.actualJlcPrice ? '¥' + cellValue.actualJlcPrice : '-'
},
width: 100
}]
},
baseData: {
jobTypeList: deepClone(staffLevelList)
},
depositDetailVisible: false,
detailRow: {}
}
},
props: {
parentSearchForm: {
type: Object,
default: () => { }
}
},
mounted() {
},
methods: {
...mapActions({
get: 'd2admin/base/get'
}),
keyDowmGetList() {
this.$refs.depositTable.refreshTable(true, true)
},
beforeSearchFn() {
return new Promise(resolve => {
if (this.parentSearchForm.month && this.parentSearchForm.month?.length) {
const startDate = this.parentSearchForm.month[0]
const endDate = this.parentSearchForm.month[1]
this.parentSearchForm.commissionMonthStart = Util.dateFormate(startDate, "YYYY-MM")
this.parentSearchForm.commissionMonthEnd = Util.dateFormate(endDate, "YYYY-MM")
}
delete this.parentSearchForm.month
this.searchFormSearch = {
...this.parentSearchForm
}
resolve()
})
},
// 激励池明细
handleDetail(row) {
row.cycle = Util.dateFormate(row.startTime, 'MM月DD日') + '至' + Util.dateFormate(row.endTime, 'MM月DD日')
this.detailRow = row
this.handleCloseDialog()
},
handleCloseDialog() {
this.depositDetailVisible = !this.depositDetailVisible
}
}
}
</script>
<style scoped></style>
<!-- 激励池 - 支出 -->
<template>
<div class="expense-list">
<d2-table ref="expenseTable"
:has-num="false"
:search-form="searchFormSearch"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn">
<template slot="remark" slot-scope="scope">
<el-popover placement="top" width="300" trigger="hover">
<div class="merchant-name-box">
{{ remarkFilter(scope.scope) }}
</div>
<div slot="reference">
{{ remarkFilter(scope.scope, 20) }}
</div>
</el-popover>
</template>
<template slot="auth-button" slot-scope="scope">
<auth-button :data="scope.scope" :show-btn-ids="['9121208']" />
</template>
</d2-table>
<add-expense-dialog :expense-visible="expenseVisible" v-if="expenseVisible" :expense-pool-info="staticData" @expenseClose="expenseClose"></add-expense-dialog>
<d2-dialog title="修改备注"
:is-visible="remarkVisible"
width="720px"
@confirmDialog="handleConfirm"
@closeDialog="handleClose">
<div class="form-content">
<el-form ref="remarkForm" :model="remarkForm" :rules="rules" label-width="154px">
<el-form-item label="备注:" prop="remark">
<el-input type="textarea" v-model="remarkForm.remark" :rows="4" maxlength="100" class="wid_432" show-word-limit placeholder="请输入备注"></el-input>
</el-form-item>
<el-form-item label="历史备注:">
<div v-for="item in remarkForm.historyRemark" :key="item.id" class="history-remark">
<el-input type="textarea" v-model="item.remark" :rows="4" maxlength="500" class="wid_432" show-word-limit disabled></el-input>
<div class="time">{{ item.createTimeStr }}</div>
</div>
</el-form-item>
</el-form>
</div>
</d2-dialog>
</div>
</template>
<script>
import { mapActions } from 'vuex'
import { Util, deepClone } from '@/common/util'
import addExpenseDialog from './addExpenseDialog.vue'
import { staffLevelList } from '@/common/constants.js'
import { editIncentivePoolRemarkApi, getIncentivePoolExpendListApi, getIncentivePoolRemarkRecordApi } from '@api/resident'
import { filterStr } from '../../inStoreManage/util.js'
export default {
name: 'ExpenseList',
components: {
addExpenseDialog
},
data() {
return {
searchFormSearch: {},
getListApi: getIncentivePoolExpendListApi,
// 表格参数
tableParams: {
needUnique: true,
mutiSelectUniqueKey: 'uniqueVal',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: {
width: '100'
},
tableColumns: [{
label: '序号',
prop: 'ownSerialNum',
type: 'ownSerialNum',
width: '60'
}, {
label: '员工姓名',
prop: 'staffName'
}, {
label: '职级',
prop: 'jobType',
formatter: (cellValue) => {
return filterStr(cellValue.jobType, this.baseData.jobTypeList, cellValue.hireType)
}
}, {
label: '支出时间',
prop: 'createdDate',
formatter: (cellValue) => {
return cellValue.createdDate ? Util.dateFormate(cellValue.createdDate, 'YYYY-MM-DD HH:mm:ss') : '-'
}
}, {
label: '金额',
prop: 'expensePrice',
formatter: (cellValue) => {
return cellValue.expensePrice ? `¥${cellValue.expensePrice}` : '-'
}
}, {
label: '操作人',
prop: 'updatedBy'
}, {
label: '备注',
prop: 'remark',
width: '300',
addHtml: 'remark'
}]
},
expenseVisible: false,
baseData: {
jobTypeList: deepClone(staffLevelList)
},
remarkForm: {historyRemark: []},
remarkVisible: false,
rules: {
remark: [
{ required: true, message: '请输入备注', trigger: 'blur' }
]
}
}
},
props: {
parentSearchForm: {
type: Object,
default: () => { }
},
staticData: {
type: Object,
default: () => { }
}
},
mounted() {
},
methods: {
...mapActions({
get: 'd2admin/base/get'
}),
remarkFilter(ele, lenght) {
if (ele.remark) {
return lenght ? (ele.remark?.length > lenght ? ele.remark.substring(0, lenght) + '\u2026' : ele.remark.substring(0, lenght)) : ele.remark
} else {
return '-'
}
},
keyDowmGetList() {
this.$refs.expenseTable.refreshTable(true, true)
},
beforeSearchFn() {
return new Promise(resolve => {
if (this.parentSearchForm.time && this.parentSearchForm.time?.length) {
this.parentSearchForm.startTime = Util.dateFormate(
this.parentSearchForm.time[0],
"YYYY-MM-DD HH:mm:ss"
)
this.parentSearchForm.endTime =
Util.dateFormate(this.parentSearchForm.time[1], "YYYY-MM-DD") + " 23:59:59"
}
delete this.parentSearchForm.time
this.searchFormSearch = {
...this.parentSearchForm
}
resolve()
})
},
// 编辑备注
handleToNote(row) {
this.remarkRow = row
getIncentivePoolRemarkRecordApi({ id: row.id }).then(res => {
res?.remarkRecordList?.forEach(v => {
v.createTimeStr = Util.dateFormate(v.createdDate, 'YYYY-MM-DD HH:mm:ss')
})
this.remarkForm.historyRemark = res?.remarkRecordList || []
this.handleClose()
})
},
handleConfirm() {
this.$refs.remarkForm.validate((valid) => {
if (valid) {
editIncentivePoolRemarkApi({ id: this.remarkRow.id, remark: this.remarkForm.remark }).then(res => {
this.$message.success('备注成功')
this.handleClose()
this.$refs.expenseTable.refreshTable(true, true)
})
}
})
},
handleClose() {
this.remarkVisible = !this.remarkVisible
this.$nextTick(() => {
this.$set(this.remarkForm, 'remark', '')
})
},
// 新增支出
handleAddExpenditure() {
this.expenseClose()
},
expenseClose(confirm) {
if (confirm) {
this.expenseVisible = !this.expenseVisible
// 刷新列表数据
this.$refs.expenseTable.refreshTable(true, true)
// 刷新统计数据
this.$emit('refreshStatic')
} else {
this.expenseVisible = !this.expenseVisible
}
}
}
}
</script>
<style lang="scss" scoped>
.wid_432{
width: 432px;
}
.time{
font-size: 14px;
color: #999999;
}
.form-content{
max-height: calc(65vh - 60px);
overflow: auto;
}
</style>
<!-- 门店工资绩效 -->
<template>
<d2-container class="performance-list m-t-40">
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="'100px'"
:form-data="showFormData">
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<auth-button category="Button"
style="display: inline-block"
:show-btn-ids="['9121201', '9121205']" />
</d2-table-header>
<d2-table ref="performanceTable"
:has-num="false"
:search-form="searchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn">
<div slot="auth-button"
slot-scope="scope">
<!-- 编辑 -->
<span style="margin-right: 10px;">
<auth-button :data="scope.scope"
:show-btn-ids="['9121202']" />
</span>
<!-- 启用/禁用 -->
<span style="margin-right: 10px;">
<auth-button :data="scope.scope"
:show-btn-ids="['9121204']" />
</span>
<!-- 删除 -->
<span>
<auth-button :data="scope.scope"
:show-btn-ids="['9121203']" />
</span>
</div>
</d2-table>
</div>
</d2-container>
</template>
<script>
import { mapActions, mapState } from 'vuex'
import { getStoreSalaryListApi, editStoreSalaryStatusApi, deleteStoreSalaryApi } from '@api/resident'
export default {
name: "PerformanceList",
data() {
return {
getListApi: getStoreSalaryListApi,
// 搜索框
showFormData: [{
label: '商户名称',
name: 'merchantName',
type: 'input',
isClear: true
}, {
label: '商户号',
name: 'merchantId',
type: 'input',
inputType: 'number',
isClear: true
}, {
label: '适配业务',
name: 'sceneType',
type: 'select',
optionList: [],
optionId: "confId",
optionLabel: "confLabel",
optionsName: "sceneTypeList"
}, {
label: '招聘通道',
name: 'hireType',
type: 'select',
optionList: [],
optionId: "confId",
optionLabel: "confLabel",
optionsName: "hireTypeList"
}],
// 表格参数
tableParams: {
needUnique: true,
mutiSelectUniqueKey: 'uniqueVal',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: {
width: '100'
},
tableColumns: [{
label: '序号',
prop: 'ownSerialNum',
type: 'ownSerialNum',
width: '60'
}, {
label: '商户名称',
prop: 'merchantName',
formatter: (cellValue) => {
return `${cellValue.merchantName}${cellValue.merchantId}` || '-'
}
}, {
label: '绩效方案',
prop: 'schemeName'
}, {
label: '适配业务',
prop: 'sceneType',
formatter: (cellValue) => {
return cellValue.sceneType == '1' ? '轻改' : '会员权益/升级'
}
}, {
label: '招聘通道',
prop: 'hireType',
formatter: (cellValue) => {
return cellValue.hireType ? cellValue.hireType == '1' ? '校招管培生' : '社会招聘' : '-'
}
}, {
label: '状态',
prop: 'status',
className: (cellValue) => {
return {
1: 'greenSpot',
2: 'redSpot'
}[cellValue.status]
},
formatter: (cellValue) => {
return cellValue.status == 1 ? '启用' : '禁用'
},
width: '100'
}]
},
// 查询条件
searchForm: {
merchantName: '',
merchantId: '',
sceneType: '',
hireType: ''
},
baseData: {
sceneTypeList: [{
confId: '1',
confLabel: '轻改'
}, {
confId: '0',
confLabel: '会员权益/升级'
}],
hireTypeList: [{
confId: '1',
confLabel: '校招管培生'
}, {
confId: '2',
confLabel: '社会招聘'
}]
}
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList,
updateList: (state) => state.d2admin.user.updateList,
updateRefesh: (state) => state.d2admin.user.updateRefesh
})
},
mounted() {
this.getOptions()
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
...mapActions('d2admin/user', ['actionSetDownloadList']),
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
getOptions() {
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.showFormData[index].optionList = this.baseData[item.optionsName]
}
})
},
// 新增绩效方案
handleToAdd() {
this.close({ tagName: '/salaryPerformance' })
this.$router.push({
path: '/performanceScheme',
query: {
addOrEdit: 'add'
}
})
},
// 编辑方案
handleToEdit(row) {
this.close({ tagName: '/performanceScheme' })
this.$router.push({
path: '/performanceScheme',
query: {
addOrEdit: 'edit',
params: JSON.stringify(row)
}
})
},
// 启用/禁用
handleEnableOrDisable(row) {
let text = row.status == '1' ? '禁用' : '启用'
this.$confirm(`是否确认${text}?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
editStoreSalaryStatusApi({id: row.id, status: row.status == '1' ? '2' : '1'}).then(res => {
this.$message.success(`${text}成功`)
this.$refs.performanceTable.refreshTable()
})
}).catch(err => {
console.log(err)
})
},
// 删除方案
handleDelete(row) {
this.$confirm("是否确认删除该绩效方案", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
deleteStoreSalaryApi({id: row.id}).then(res => {
this.$message.success("删除成功")
this.$refs.performanceTable.refreshTable()
})
}).catch(err => {
console.log(err)
})
},
// 导出
handleExport() {
var params = {
...this.searchForm
}
params.method = 'dj.api.smartcarlife.merchantPerformanceConfig.exportAsync'
const list = [
...this.dowloadList,
{
name: '门店工资绩效',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
// 重置
handleReset() {
this.searchForm = {
merchantName: '',
merchantId: '',
sceneType: '',
hireType: ''
}
this.$refs.performanceTable.refreshTable()
}
}
}
</script>
<style lang="scss" scoped>
.m-t-40 {
margin-top: 40px;
}
</style>
<!-- 关联门店弹窗 -->
<template>
<d2-dialog
:title="title"
:is-visible.sync="relateStoreVisible"
width="70%"
btn-ok-label="确定"
@confirmDialog="handleRelateStoreConfirm"
@closeDialog="handleRelateStoreClose"
class="relateStore">
<slot />
<el-row class="tableCon">
<div class="tableBox">
<el-table
ref="seletingTable"
:data="selectingData"
height="464px"
class="table"
border
@select="handleChange"
@select-all="handleAll">
<el-table-column type="selection" width="55" align="center" />
<el-table-column prop="merchantName" label="门店名称" align="center">
</el-table-column>
<el-table-column prop="merchantId" label="门店商户号" align="center">
</el-table-column>
<el-table-column
prop="yqMerchantName"
label="服务对接"
align="center">
</el-table-column>
<el-table-column
prop="yqMerchantId"
label="服务对接商户号"
align="center">
</el-table-column>
</el-table>
<el-pagination
small
background
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-size="pageSize"
layout="total, prev, pager, next"
:total="total" />
</div>
<el-table
class="tableBox table"
:data="selectedData"
border
height="464px">
<el-table-column prop="merchantName" label="门店名称" align="center">
<template slot-scope="scope">
<span>{{ scope.row.merchantName }}</span>
</template>
</el-table-column>
<el-table-column prop="merchantId" label="门店商户号" align="center">
<template slot-scope="scope">
<span>{{ scope.row.merchantId }}</span>
</template>
</el-table-column>
<el-table-column label="删除" align="center" width="50px">
<template slot-scope="scope">
<el-button
class="el-icon-delete"
@click="handleDelete(scope.row)"
type="text" />
</template>
</el-table-column>
</el-table>
</el-row>
</d2-dialog>
</template>
<script>
export default {
name: "RelateStoreDialog",
data() {
return {
selectedData: [],
selectingData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 20
}
},
props: {
title: {
type: String,
default: "分发门店"
},
relateStoreVisible: {
type: Boolean,
default: false
},
storeApi: {
type: Function,
default: () => {}
},
storeSelected: {
type: Array,
default: () => []
},
storeSearchForm: {
type: Object,
default: () => {}
},
formData: {
type: Object,
default: () => {}
},
},
mounted() {
this.selectedData = this.storeSelected
this.getSelectingList()
},
methods: {
recoverySelection() {
var exitIds = this.selectedData.map((item) => item.merchantId)
this.selectingData.forEach((item) => {
exitIds.includes(item.merchantId) &&
this.$refs.seletingTable.toggleRowSelection(item, true)
})
},
getSelectingList() {
this.storeApi({
...this.storeSearchForm,
currentPage: this.currentPage,
pageSize: this.pageSize,
sceneType: this.formData.sceneType,
hireType: this.formData.hireType
}).then((res) => {
res?.list?.forEach((val) => {
val?.sceneList?.forEach((subVal) => {
if (subVal.scene == this.selectedScene) {
val.yqMerchantId = subVal?.yqMerchant?.merchantId || "-"
val.yqMerchantName = subVal?.yqMerchant?.merchantName || "-"
}
})
})
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) => {
var isExit = this.selectedData.findIndex(
(subItem) => subItem.merchantId === item.merchantId
)
if (selection.length && isExit === -1) {
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
)
const obj = this.selectingData.find((v) => v.merchantId == row.merchantId)
this.$refs.seletingTable.toggleRowSelection(obj)
},
handleCurrentChange(val) {
this.currentPage = val
this.getSelectingList()
},
handleRelateStoreConfirm() {
this.selectedData.forEach((val) => {
if (!val.goodsData) val.goodsData = []
})
this.$emit("handleRelateStoreConfirm", this.selectedData)
},
handleRelateStoreClose() {
this.$emit("handleRelateStoreClose")
}
}
}
</script>
<style lang="scss">
.relateStore .table {
margin: 0 auto 20px !important;
width: 98%;
}
.relateStore .tableCon {
margin-top: 20px;
display: flex;
.tableBox {
flex: 1;
}
}
.service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell {
line-height: 26px !important;
}
.service-store .relateStore .el-table--medium td,
.d2-form .relateStore .el-table--medium td {
padding: 6px 8px !important;
}
.relateStore .red {
color: red;
}
.relateStore .tip-icon {
position: absolute;
display: inline-block;
height: 10px;
width: 10px;
line-height: 10px;
color: #ffffff;
background-color: red;
border: 1px solid red;
border-radius: 50%;
cursor: pointer;
font-size: 6px;
margin-left: 2px;
}
</style>
<!-- 激励池 -->
<template>
<d2-container class="rewardPool-list m-t-40">
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="'100px'"
:form-data="copyShowFormData">
<template>
<div slot="monthSelect">
<el-date-picker
class="month-class"
v-model="searchForm.month"
:picker-options="rangePickerOptions"
type="monthrange"
range-separator="至"
start-placeholder="开始月份"
end-placeholder="结束月份"></el-date-picker>
</div>
</template>
</d2-search>
<div class="up-btns">
<el-button size="small"
type="primary"
@click="handleSearch">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<div class="static-text">截止至{{ staticData.date }},当前激励池余额{{ staticData.totalBalance }},上月存入{{ staticData.curMonthIncome }},上月支出{{ staticData.curMonthExpenses }}</div>
<span style="position: absolute; right: 41px; top: 20px; z-index: 999">
<auth-button :show-btn-ids="
activeName === 'expenseList' ? ['9121206'] : ['9121207']
"
category="Button" />
</span>
<el-tabs v-model="activeName"
type="card"
@tab-click="handleReset">
<el-tab-pane label="存入"
name="depositList">
<deposit-list v-if="activeName == 'depositList'"
ref="depositList"
:parent-search-form="searchForm" />
</el-tab-pane>
<el-tab-pane label="支出"
name="expenseList">
<expense-list v-if="activeName == 'expenseList'"
ref="expenseList"
:parent-search-form="searchForm"
:static-data="staticData"
@refreshStatic="handleRefreshStatic" />
</el-tab-pane>
</el-tabs>
</div>
</d2-container>
</template>
<script>
import depositList from './depositList.vue'
import expenseList from './expenseList.vue'
import { mapActions, mapState } from 'vuex'
import { Util, deepClone } from '@/common/util'
import { staffLevelList } from '@/common/constants.js'
import { rangePickerOptions } from '@/common/format'
import { getIncentivePoolStatisticsApi } from '@api/resident'
export default {
name: "RewardPoolList",
components: {
depositList,
expenseList
},
data() {
return {
rangePickerOptions: rangePickerOptions,
// 搜索框
showFormData: [{
label: '员工姓名',
name: 'staffName',
type: 'input',
isClear: true,
keyFn: this.handleSearch
}, {
label: '职级',
name: 'jobType',
type: 'select',
isClear: true,
optionsName: 'jobTypeList',
optionId: 'confId',
optionLabel: 'confValue',
keyFn: this.handleSearch
}],
// 查询条件
searchForm: {
staffName: '',
merchantName: '',
merchantId: '',
jobType: '',
month: [],
time: []
},
activeName: 'depositList',
baseData: {
jobTypeList: deepClone(staffLevelList)
},
copyShowFormData: [],
staticData: {}
}
},
watch: {
activeName: {
handler() {
this.parentSearchForm = {
staffName: ''
}
this.changeShowFormData()
},
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList,
updateList: (state) => state.d2admin.user.updateList,
updateRefesh: (state) => state.d2admin.user.updateRefesh
})
},
mounted() {
this.getOptionsList()
// 获取统计信息
this.getIncentivePoolStatistics()
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
...mapActions('d2admin/user', ['actionSetDownloadList']),
getIncentivePoolStatistics() {
getIncentivePoolStatisticsApi({}).then(res => {
this.staticData = res || {}
this.staticData.date = Util.dateFormate(new Date(), 'YYYY年MM月DD日')
})
},
handleRefreshStatic() {
this.getIncentivePoolStatistics()
},
getOptionsList() {
this.changeShowFormData()
},
changeShowFormData() {
const copyShowFormData = deepClone(this.showFormData)
switch (this.activeName) {
case 'depositList':
copyShowFormData.push({
label: '门店',
name: 'merchantName',
type: 'input',
keyFn: this.handleSearch
}, {
label: '月份',
name: 'month',
type: 'monthSelect',
addHtml: 'monthSelect'
})
this.copyShowFormData = copyShowFormData
break
case 'expenseList':
copyShowFormData.push({
label: '时间',
name: 'time',
type: "datePicker",
isClear: true,
pickerOptions: "rangePickerOptions",
keyFn: this.handleSearch
})
this.copyShowFormData = copyShowFormData
break
}
copyShowFormData.forEach((item, index) => {
if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][copyShowFormData[index].optionLabel] !== '全部') {
const temp = {}
temp[copyShowFormData[index].optionId] = ''
temp[copyShowFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(copyShowFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
handleSearch() {
this.$nextTick(() => {
this.$refs[this.activeName].keyDowmGetList()
})
},
// 重置
handleReset() {
this.searchForm = {
staffName: '',
merchantName: '',
merchantId: '',
jobType: '',
month: []
}
this.handleSearch()
},
// 导出
handleExport() {
var params = {
...this.searchForm,
}
if (params.month && params.month?.length) {
const startDate = params.month[0]
const endDate = params.month[1]
params.commissionMonthStart = Util.dateFormate(startDate, "YYYY-MM")
params.commissionMonthEnd = Util.dateFormate(endDate, "YYYY-MM")
}
delete params.month
params.method = 'dj.api.smartcarlife.incentivePool.exportIncome.async'
const list = [
...this.dowloadList,
{
name: '激励池存入',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
handleAddExpenditure() {
this.$nextTick(() => {
this.$refs[this.activeName].handleAddExpenditure()
})
}
}
}
</script>
<style lang="scss" scoped>
.month-class{
width: 100% !important;
}
.m-t-40 {
margin-top: 40px;
::v-deep .el-tabs__header {
padding: 0 !important;
margin: 0 0 15px !important
}
}
.static-text{
position: absolute;
top: 30px;
left: 200px;
// margin-top: 20px;
font-size: 14px;
color: #666;
}
.d2-container-content{
position: relative;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!