Commit 7cf01d63 by huyue

收入测算配置、晋升/降级配置开发联调

1 parent b0bc3b08
......@@ -363,4 +363,52 @@ export function exportSummary(data) {
export function getAllStaff(data) {
data.method = 'dj.api.smartcarlife.staff.specificBusinessRolePerson.areaSupervision.pageConfigured'
return request(data, 'post')
}
// 收入测算-白名单员工分页
export function getWhiteStaff(data) {
data.method = 'dj.smartcarlife.api.incomeMeasurement.white.staff.list'
return request(data, 'post')
}
// 收入测算-查询收入测算配置开关
export function getSwitchConfig(data = {}) {
data.method = 'dj.smartcarlife.api.incomeMeasurement.switch.config.get'
return request(data, 'post')
}
// 收入测算-添加白名单员工
export function addWhiteStaff(data) {
data.method = 'dj.smartcarlife.api.incomeMeasurement.white.staff.add'
return request(data, 'post')
}
// 收入测算配置开关更新
export function addSwitchConfig(data) {
data.method = 'dj.smartcarlife.api.incomeMeasurement.switch.config.add'
return request(data, 'post')
}
// 收入测算-删除白名单员工
export function delWhiteStaff(data) {
data.method = 'dj.smartcarlife.api.incomeMeasurement.white.staff.del'
return request(data, 'post')
}
// 查询员工详情
export function getStaffInfo(data) {
data.method = 'dj.smartcarlife.api.incomeMeasurement.staff.info.get'
return request(data, 'post')
}
// 职级介绍配置查询
export function getRankConfig(data) {
data.method = 'dj.smartcarlife.api.job.rank.config.get'
return request(data, 'post')
}
// 职级介绍配置更新
export function addRankConfig(data) {
data.method = 'dj.smartcarlife.api.job.rank.config.add'
return request(data, 'post')
}
\ No newline at end of file
......@@ -212,7 +212,7 @@ export default {
data: [],
// 页码
page: {
pageSize: 10,
pageSize: 3,
currentPage: 1
},
total: 10,
......
......@@ -829,16 +829,28 @@ export const routerName = {
parentId: "912",
cache: false
},
auth: [
{
authId: "9121501",
parentId: "91215",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
}
],
component: _import("residentManage/dailyPaperManagement/index")
},
91216: {
path: "/measurement",
name: "measurement",
meta: {
title: "收入测算配置",
authId: "91216",
parentId: "912",
cache: false
},
component: _import("residentManage/measurement/index")
},
91217: {
path: "/promotionAndDmotion",
name: "promotionAndDmotion",
meta: {
title: "晋升/降级配置",
authId: "91217",
parentId: "912",
cache: false
},
component: _import("residentManage/promotionAndDmotion/index")
}
}
......@@ -26,11 +26,11 @@
<el-table :data="tableData" border style="width: 100%;text-align: center;">
<el-table-column prop="staffName" label="督导姓名">
</el-table-column>
<el-table-column prop="lastSubmitDate" label="最近提交日报日期">
<el-table-column prop="lastSubmitDate" sortable label="最近提交日报日期">
</el-table-column>
<el-table-column prop="weekSubmitCount" label="本周提交总数">
<el-table-column prop="weekSubmitCount" sortable label="本周提交总数">
</el-table-column>
<el-table-column prop="monthSubmitCount" label="本月提交总数">
<el-table-column prop="monthSubmitCount" sortable label="本月提交总数">
</el-table-column>
</el-table>
</template>
......@@ -76,6 +76,7 @@ export default {
if (this.type == 2) {
this.getSummaryStaff()
} else if (this.type == 1) {
this.value = []
this.getStaff()
}
}
......
<template>
<div>
<!-- class="order-detail" -->
<d2-container>
<!-- <div class="offline-account"> -->
<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 slot="createdDate">
<el-date-picker
v-model="searchForm.createdDate"
type="date"
placeholder="选择日期"
:picker-options="pickerOption"
@change="dateChange">
</el-date-picker>
</div>
<div slot="merchantId">
<el-select v-model="searchForm.merchantIds" multiple filterable placeholder="请选择">
<el-option
......@@ -87,7 +94,6 @@
<Drawer :drawerVisible="drawer" :type="contentType" :templateData="templateData" @handleClose="handleClose" @handleSubmit="handleSubmit">
</Drawer>
</d2-container>
</div>
</template>
......@@ -99,6 +105,7 @@ import Drawer from './drawer.vue';
import mockData from '../data.json'
import recordData from './record.json'
import dayjs from 'dayjs'
import { rangePickerOptions } from '@/common/format'
export default {
name: 'TransferAccountsList',
components: {
......@@ -113,6 +120,7 @@ export default {
merchantIds: ''
},
searchFormSearch: {},
pickerOption: rangePickerOptions,
showFormData: [
{
label: '日报模板',
......@@ -130,13 +138,15 @@ export default {
label: '模板2',
value: 2
}
]
],
changeAttr: (value, targetItem) => {
console.log(value);
this.getStaff()
}
}, {
label: '日报日期',
name: 'createdDate',
type: 'datePicker',
dateType: 'date',
pickerOptions: 'rangePickerOptions'
addHtml: 'createdDate'
}, {
label: '督导',
name: 'merchantIds',
......@@ -177,7 +187,7 @@ export default {
drawer: false,
contentType: 0,
tabList: [],
activeName: '',
activeName: null,
recordData: [],
summaryData: {},
templateData: {},
......@@ -186,7 +196,7 @@ export default {
}
},
created() {//默认当前日期
this.searchForm.createdDate = new Date('2025-01-06')
this.searchForm.createdDate = new Date()
this.getTemplate()
},
mounted() {
......@@ -211,6 +221,7 @@ export default {
})
},
getTemplate() {
// 获取日报模板下拉内容
getTemplateList().then(res => {
this.showFormData[0].optionList = res
this.searchForm.typeName = res[0].typeName
......@@ -218,6 +229,7 @@ export default {
typeName: this.searchForm.typeName,
createdDate: dayjs(new Date(this.searchForm.createdDate)).format('YYYY-MM-DD')
}
// 根据日期和模板内容 ,获取督导下拉
getStaffList(params).then(res => {
this.merchantIdOptions = res
this.handleSearch()
......@@ -253,7 +265,7 @@ export default {
this.changeTable()
},
// 改变表头
changeTable() {
changeTable(isSort = false) {
this.tableData = []
let colums = []
this.sortObj = {}
......@@ -264,6 +276,7 @@ export default {
label: i.name,
prop: i.key
}
// 写入前端规则
if (frontRule) {
if (frontRule.hasOwnProperty('sortable')) {
obj.sortable = 'custom'
......@@ -277,6 +290,7 @@ export default {
}
colums.push(obj)
})
// 制作表格数据
const _table = this.recordData.map(item => item.types.find(i => i.key == this.activeName))
_table.forEach((m,i) => {
const obj = {}
......@@ -298,7 +312,7 @@ export default {
this.tableParams.tableColumns = colums
const _index = this.tabList.findIndex(item => item.key == this.activeName)
this.tabList[_index].tableColumns = colums
this.key = new Date().getTime()
if (!isSort) this.key = new Date().getTime() // 切换表格强制刷新,排序不刷新
},
async handleSearch() {
console.log(this.searchForm);
......@@ -335,11 +349,11 @@ export default {
orderByType: sortObj[sortColum][sort],
orderByKey: sortColum
}
this.getTableList(params)
this.getTableList(params, true)
}
},
// 获取列表数据
async getTableList(sort = {}){
async getTableList(sort = {}, isSort = false){
const { typeName, createdDate, merchantIds } = this.searchForm
const params2 = {
templateCode: this.templateData.code,
......@@ -352,10 +366,12 @@ export default {
// 表格
const r2 = await getRecordPage(params2)
console.log(r2);
this.tableTotal = r2.total
this.activeName = this.tabList[0].key
this.recordData = r2.list
this.changeTable()
this.tableTotal = r2.total;
// this.activeName = this.tabList[0].key;
if (this.activeName == 0) this.activeName = this.tabList[0].key
console.log(this.activeName, this.activeName == 0, 'active');
this.recordData = r2.list;
this.changeTable(isSort);
},
handleReset() {
this.searchForm = {
......@@ -364,7 +380,6 @@ export default {
merchantIds: []
}
this.handleSearch()
// this.$refs.recordTable.refreshTable(false, true)
},
handleExport() {
......@@ -395,6 +410,19 @@ export default {
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
dateChange(e) {
this.getStaff()
},
getStaff() {
const {createdDate, typeName} = this.searchForm
const params = {
typeName,
createdDate: dayjs(new Date(createdDate)).format('YYYY-MM-DD')
}
getStaffList(params).then(res => {
this.merchantIdOptions = res
})
}
}
}
......
<template>
<d2-container>
<div class="measurement-header">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="收入测算" name="first">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="labelWidth"
:form-data="showFormData">
</d2-search>
</el-tab-pane>
<el-tab-pane label="收入测算配置" name="second">
<div class="d2-container-content">
<div class="app-config">
展业助手收入测算入口配置:
<el-radio-group v-model="configFlag" @change="radioChange">
<el-radio :label="0">会员全开</el-radio>
<el-radio :label="1">会员关闭</el-radio>
<el-radio :label="2">白名单开启</el-radio>
</el-radio-group>
</div>
<template v-if="configFlag == '2'">
<div class="theader">
<h2>白名单管理</h2>
<div>
<el-button @click="handleAdd" size="small" type="primary">
增加
</el-button>
</div>
</div>
<d2-table ref="measurementConfigTable" :hasNum="false" :get-list-api="getListApi"
:search-form="searchFormSearch" :table-params="tableParams">
<template slot="auth-button" slot-scope="scope">
<el-button type="text" @click="delWhite(scope.scope)">删除</el-button>
</template>
</d2-table>
</template>
</div>
</el-tab-pane>
</el-tabs>
</div>
<template v-if="activeName == 'first'">
<d2-table ref="measurementTable" :search-form="searchForm" :table-params="measurementTableParams"></d2-table>
</template>
<el-dialog class="white-dialog" title="新增白名单" :visible.sync="dialogVisible" width="668px"
:before-close="handleClose" :close-on-click-modal="false">
<el-form ref="whiteForm" class="white-form" :model="whiteForm" label-width="150px">
<el-form-item label="手机号码:">
<el-input v-model="whiteForm.staffPhone" placeholder="请输入手机号码"></el-input>
</el-form-item>
<div class="line"></div>
<el-form-item label="员工姓名:">
{{whiteForm.staffName}}
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<template v-if="whiteForm.staffName">
<el-button type="primary" @click="addWhite">加入白名单</el-button>
</template>
<template v-else>
<el-button type="primary" @click="searchStaff">查询</el-button>
<el-button @click="dialogVisible = false">取 消</el-button>
</template>
</span>
</el-dialog>
</d2-container>
</template>
<script>
import { getWhiteStaff, getSwitchConfig, addSwitchConfig, getStaffInfo, addWhiteStaff, delWhiteStaff } from "@api/resident"
export default {
data() {
return {
activeName: 'second',
// 收入测算
searchForm: {},
labelWidth: '110px',
showFormData: [
{
label: '员工姓名',
name: 'staffName',
type: 'input'
},
{
label: '电话号码',
name: 'staffPhone',
type: 'input'
},
{
label: '门店名称',
name: 'merchantName',
type: 'input'
},
{
label: '所属业务',
name: 'staffPhone',
type: 'input'
},
{
label: '产品名称',
name: 'staffPhone',
type: 'input'
},
{
label: '品牌',
name: 'staffPhone',
type: 'input'
},
{
label: '测算收入日期',
name: 'staffPhone',
type: 'input'
}
],
measurementTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [
{
label: '姓名',
prop: 'staffName'
},
{
label: '电话号码',
prop: 'staffName'
},
{
label: '职级',
prop: 'staffName'
},
{
label: '服务门店',
prop: 'staffName'
},
{
label: '所属业务',
prop: 'staffName'
},
{
label: '品牌',
prop: 'staffName'
},
{
label: '应触客台数',
prop: 'staffName'
},
{
label: '产值',
prop: 'staffName'
},
{
label: '成交量',
prop: 'staffName'
},
{
label: '渗透率',
prop: 'staffName'
},
{
label: '提成系数',
prop: 'staffName'
},
{
label: '提成比例',
prop: 'staffName'
},
{
label: '客单价',
prop: 'staffName'
},
{
label: '客单价提成系数',
prop: 'staffName'
},
{
label: '提成金额',
prop: 'staffName'
},
{
label: '测算收入日期',
prop: 'staffName'
},
]
},
// 收入测算配置
configFlag: 0,
getListApi: getWhiteStaff,
searchFormSearch: {},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '员工姓名',
prop: 'staffName'
},
{
label: '电话号码',
prop: 'staffPhone'
},
{
label: '适配业务',
prop: 'staffScenes'
},
{
label: '服务门店',
prop: 'serviceMerchantName'
}
]
},
dialogVisible: false,
whiteForm: {
staffName: '',
staffPhone: ''
}
}
},
created() {
this.getSwitch()
},
methods: {
// 查询测试配置开关
async getSwitch() {
const res = await getSwitchConfig()
this.configFlag = res.configFlag
},
handleAdd() {
console.log('111');
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
this.whiteForm = {
staffName: '',
staffPhone: ''
}
},
handleClick(tab) {
console.log(tab);
},
radioChange(e) {
console.log(e);
addSwitchConfig({ configFlag: e }).then(res => {
console.log(res)
if (res) this.$message.success('修改成功')
})
},
// 查询员工
searchStaff() {
const {staffPhone} = this.whiteForm
if (!staffPhone) return this.$message.error('请输入手机号码')
getStaffInfo({staffPhone: this.whiteForm.staffPhone}).then(res => {
console.log(res);
if (res) {
this.whiteForm.staffName = res.staffName
} else {
this.$message.error('不存在该直营驻店人员')
}
})
},
// 加入白名单
addWhite() {
const {staffPhone, staffName} = this.whiteForm
addWhiteStaff({staffPhone, staffName}).then(res => {
console.log(res);
if (res) {
this.$message.success('修改成功')
this.$refs.measurementConfigTable.refreshTable(true, true)
this.handleClose()
}
})
},
delWhite(row) {
console.log(row);
delWhiteStaff({id: row.id}).then(res => {
if (res) {
this.$message.success('删除成功')
this.$refs.measurementConfigTable.refreshTable(true, true)
}
})
}
}
}
</script>
<style lang="scss" scoped>
.measurement-header {
background-color: #fff;
// padding: 0 20px;
.app-config {
color: #333333;
font-size: 16px;
padding: 12.5px 20px;
background-color: #F8FAFF;
// margin: 0 20px;
}
.d2-container-content {
margin-top: 0 !important;
padding: 0 20px 20px !important;
}
.theader {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
h2 {
font-weight: 600;
font-size: 16px;
color: #333333;
}
}
}
.white-form {
height: 108px;
.line {
width: 100%;
height: 1px;
background-color: #E5E5E5;
margin-bottom: 20px;
}
}
</style>
<style lang="scss">
.measurement-header {
#tab-first {
padding-left: 20px !important;
}
.el-tabs__nav-wrap {
line-height: 54px;
.el-tabs__item {
font-size: 16px !important;
}
}
}
.white-dialog {
.el-dialog__header {
border-bottom: 1px solid #E5E5E5 !important;
}
.el-dialog__footer {
border-top: 1px solid #E5E5E5 !important;
padding: 14px 20px !important;
.el-button {
width: auto;
}
}
}
</style>
\ No newline at end of file
<template>
<div>
<div :id="id"></div>
</div>
</template>
<script>
import { uploadImg, syncUploadVideo, uploadVideo } from "@/api/sys.base"
import E from "wangeditor"
export default {
name: "TextBox",
data() {
return {
editor: "",
content: "",
editorOption: {}
}
},
props: {
id: {
type: String,
default: 'div-demo'
},
excludeMenus: {
type: Array,
default: () => ["code"]
},
boxHeight: {
type: Number,
default: 240
}
},
mounted() {
this.getEdit()
},
methods: {
getEdit() {
const _this = this
this.editor = new E(`#${this.id}`)
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = "down"
this.editor.config.height = this.boxHeight
this.editor.config.width = "500px"
this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.onchange = (html) => {
// console.log(html);
this.content = html // 绑定当前逐渐地值
this.$emit("change", this.content) // 将内容同步到父组件中
}
this.editor.config.onfocus = () => {
this.$emit("focus")
}
// 上传图片
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error("上传图片大小不能超过" + limitSize + "MB!")
return true
}
reader.readAsDataURL(file)
reader.onload = (e) => {
const imgFile = e.target.result
const base64 =
file.name.split(".")[file.name.split(".").length - 1] +
"@" +
imgFile.split(",")[1]
// _this.$apis.common.pictureUpload({ file: base64 }).then(res => {
uploadImg({ file: base64, compress: 0 }).then((res) => {
if (res) {
// console.log(res)
insertImgFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
// 上传视频
this.editor.config.customUploadVideo = function (
resultFiles,
insertVideoFn
) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error("上传视频大小不能超过" + limitSize + "MB!")
return true
}
reader.readAsDataURL(file)
reader.onload = (e) => {
const videoFile = e.target.result
const base64 =
file.name.split(".")[file.name.split(".").length - 1] +
"@" +
videoFile.split(",")[1]
_this.$apis.common.pictureUpload({ file: base64 }).then((res) => {
if (res) {
// console.log(res)
insertVideoFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
this.editor.config.onchangeTimeout = 5000
this.editor.create()
},
setEdit(html) {
this.$nextTick(() => {
this.editor.txt.html(html)
})
},
forbidEdit() {
// this.editor.$textElem.attr('contenteditable', false)
this.editor.disable()
}
}
}
</script>
<style lang="scss" scoped>
#div-demo {
width: 575px;
// margin: 16px 300px 0 0;
}
.el-form .editor {
margin-top: 20px;
}
.myQuillEditor {
background-color: #fff;
height: 200px;
}
</style>
<style>
.w-e-text-container {
z-index: 1 !important;
}
.w-e-toolbar {
z-index: 2 !important;
}
</style>
<template>
<d2-container>
<div class="promotion">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="晋升/降级配置" name="first">
<div class="sub-promotion">
<el-tabs v-model="subActiveName" type="card" @tab-click="handleSubClick">
<el-tab-pane v-for="(item, index) in tabList" :key="index" :label="item.label" :name="item.name"></el-tab-pane>
</el-tabs>
</div>
</el-tab-pane>
<el-tab-pane label="" name="second"></el-tab-pane>
</el-tabs>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="150px" class="demo-ruleForm">
<el-form-item label="职级介绍:" prop="rankIntroduction">
<TextBox ref="rankIntroduction" class="editor-box" id="rankIntroduction" :excludeMenus="['code', 'video', 'table', 'justify', 'todo', 'splitLine']" @change="(e) => handleTextBoxChange(e, 'rankIntroduction')" @focus="handleTextBoxFocus('rankIntroduction')" :boxHeight="120"></TextBox>
</el-form-item>
<el-form-item label="晋升介绍:" prop="promotionIntroduction">
<TextBox ref="promotionIntroduction" class="editor-box" id="promotionIntroduction" :excludeMenus="['code', 'video', 'table', 'justify', 'todo', 'splitLine']" @change="(e) => handleTextBoxChange(e, 'promotionIntroduction')" :boxHeight="120"></TextBox>
</el-form-item>
<el-form-item label="降级介绍:" prop="downgradeIntroduction">
<TextBox ref="downgradeIntroduction" class="editor-box" id="downgradeIntroduction" :excludeMenus="['code', 'video', 'table', 'justify', 'todo', 'splitLine']" @change="(e) => handleTextBoxChange(e, 'downgradeIntroduction')" :boxHeight="120"></TextBox>
</el-form-item>
</el-form>
<div class="btn">
<el-button type="primary" @click="submit">保存</el-button>
</div>
</div>
</d2-container>
</template>
<script>
import TextBox from './TextBox.vue';
import { getRankConfig, addRankConfig } from "@api/resident"
export default {
components: {
TextBox
},
data() {
return {
activeName: 'first',
subActiveName: '1',
tabList: [
{
label: '实习生',
name: '1'
},
{
label: '见习驻店',
name: '2'
},
{
label: '初级驻店',
name: '3'
},
{
label: '中级驻店',
name: '4'
},
{
label: '高级驻店',
name: '5'
}
],
formKey: ['rankIntroduction', 'promotionIntroduction', 'downgradeIntroduction'],
ruleForm: {
rankIntroduction: '',
promotionIntroduction: '',
downgradeIntroduction: ''
},
rules: {
rankIntroduction: [{ required: true, message: '请输入职级介绍', trigger: 'blur' }]
}
}
},
created() {
this.getConfig()
},
methods: {
getConfig() {
getRankConfig({jobType: this.subActiveName}).then(res => {
// this.ruleForm = res
if (res) {
this.formKey.forEach(i => {
this.ruleForm[i] = res[i]
this.$refs[i].setEdit(res[i])
})
if (res.id) this.ruleForm.id = res.id
} else {
console.log('121321');
this.formKey.forEach(i => {
this.ruleForm[i] = ''
this.$refs[i].setEdit('')
if (this.ruleForm.id) delete this.ruleForm.id
})
}
})
},
handleTextBoxChange(val, key) {
console.log(val, key)
this.ruleForm[key] = val
},
handleTextBoxFocus(key) {
console.log(key, 'focus');
// this.$refs.TextBox.setEdit(this.formData.content)
},
handleClick(tab) {
},
handleSubClick(tab) {
this.subActiveName = tab.name
console.log(this.subActiveName);
this.getConfig()
},
submit() {
console.log(this.ruleForm);
this.$refs.ruleForm.validate((valid) => {
if (valid) {
console.log(232);
addRankConfig({...this.ruleForm, jobType: this.subActiveName}).then(res => {
if (res) this.$message.success('保存成功')
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.promotion {
background-color: #fff;
}
.btn {
width: 100%;
text-align: center;
padding-bottom: 20px;
}
</style>
<style lang="scss">
.promotion {
#tab-first {
padding-left: 20px !important;
}
.el-tabs__nav-wrap {
line-height: 54px;
.el-tabs__item {
font-size: 16px !important;
}
}
.sub-promotion {
padding: 0 20px;
.el-tabs__nav-wrap {
line-height: 40px;
.el-tabs__item {
font-size: 14px !important;
}
}
}
}
</style>
<style lang="scss">
.editor-box {
#div-demo {
width: calc(100% - 20px);
}
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!