Commit 1a24cc88 by 前端

Merge branch 'SAAS+V4.49.0-0121' of http://192.168.3.233:8090/saas_plus/dj-car-l…

…ife-system into SAAS+V4.49.0-0121
2 parents 93894e57 d3268a39
...@@ -426,3 +426,15 @@ export function addRankConfig(data) { ...@@ -426,3 +426,15 @@ export function addRankConfig(data) {
data.method = 'dj.smartcarlife.api.job.rank.config.add' data.method = 'dj.smartcarlife.api.job.rank.config.add'
return request(data, 'post') return request(data, 'post')
} }
// 员工收入测算
export function getIncomePage(data) {
data.method = 'dj.api.smartcarlife.staff.incomeCalculation.page'
return request(data, 'post')
}
// 获取商品信息列表
export function listGoodsType(data = {}) {
data.method = 'dj.api.smartcarlife.staff.incomeCalculation.listGoodsType'
return request(data, 'post')
}
\ No newline at end of file \ No newline at end of file
...@@ -98,6 +98,12 @@ export const rangePickerOptions = { ...@@ -98,6 +98,12 @@ export const rangePickerOptions = {
} }
} }
/** 时间空间-限制只能选昨天之前的时间 */
export const yesterdayPicker = {
disabledDate(date) {
return date.getTime() > Date.now() - 8.64e7
}
}
/** /**
* 时间控件-限制只能选当前及之后的日期 * 时间控件-限制只能选当前及之后的日期
*/ */
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<el-option v-for="(subItem, subIndex) in item.optionList" :key="subIndex" <el-option v-for="(subItem, subIndex) in item.optionList" :key="subIndex"
:label="subItem[item.optionLabel]" :value="subItem[item.optionId]" /> :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" />
</el-select> </el-select>
<el-date-picker v-else-if="item.type === 'datePicker'" v-model="searchForm[item.name]" <el-date-picker v-else-if="item.type === 'datePicker'" :style="{ width: item.width || '100%' }" v-model="searchForm[item.name]"
:type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至" :type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOption[item.pickerOptions]" /> start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOption[item.pickerOptions]" />
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item" /> <slot v-if="item.addHtml" :name="item.addHtml" :scope="item" />
...@@ -73,13 +73,14 @@ ...@@ -73,13 +73,14 @@
</template> </template>
<script> <script>
import { rangePickerOptions } from '@/common/format' import { rangePickerOptions, yesterdayPicker } from '@/common/format'
export default { export default {
name: 'D2Search', name: 'D2Search',
data() { data() {
return { return {
pickerOption: { pickerOption: {
rangePickerOptions: rangePickerOptions rangePickerOptions: rangePickerOptions,
yesterdayPicker: yesterdayPicker
} }
} }
}, },
......
...@@ -191,7 +191,7 @@ export const packageGoodsDetail = [ ...@@ -191,7 +191,7 @@ export const packageGoodsDetail = [
value: 'goodsName' value: 'goodsName'
}, { }, {
label: '所属分类', label: '所属分类',
value: 'goodsTypeName' value: 'tempGoodsTypeName'
}, { }, {
label: '商品ID', label: '商品ID',
value: 'upgradeCommodityCode' value: 'upgradeCommodityCode'
......
...@@ -293,9 +293,8 @@ export default { ...@@ -293,9 +293,8 @@ export default {
const resArr = [] const resArr = []
res.list && res.list.forEach(val => { res.list && res.list.forEach(val => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type) const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}` const result = types.filter(type => type).join('-')
: goodsTypeName
val.upgradeGoodsList.forEach(v => { val.upgradeGoodsList.forEach(v => {
resArr.push({ resArr.push({
confId: v.id, confId: v.id,
...@@ -369,9 +368,8 @@ export default { ...@@ -369,9 +368,8 @@ export default {
if (res?.upgradeProductFlag == 'Y') productType.push(2) if (res?.upgradeProductFlag == 'Y') productType.push(2)
if (res?.baseProductFlag == 'Y') productType.push(1) if (res?.baseProductFlag == 'Y') productType.push(1)
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = res.goodsInfo const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = res.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type) const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}` const result = types.filter(type => type).join('-')
: goodsTypeName
res.productType = productType // 产品类型 res.productType = productType // 产品类型
res.upgradePrice = res.upgradeGoods?.upgradePrice // 参考售价 res.upgradePrice = res.upgradeGoods?.upgradePrice // 参考售价
res.positionNames = positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '' // 部位 res.positionNames = positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '' // 部位
......
...@@ -184,9 +184,8 @@ export default { ...@@ -184,9 +184,8 @@ export default {
if (res?.upgradeProductFlag == 'Y') productType.push(2) if (res?.upgradeProductFlag == 'Y') productType.push(2)
if (res?.baseProductFlag == 'Y') productType.push(1) if (res?.baseProductFlag == 'Y') productType.push(1)
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = res.goodsInfo const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = res.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type) const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}` const result = types.filter(type => type).join('-')
: goodsTypeName
const productTypeTextArr = [] const productTypeTextArr = []
// 太阳膜/延保类回显部位 // 太阳膜/延保类回显部位
const positionNamesArr = deepClone(this.positionTypeList).filter(val => (res?.upgradeGoods.position?.split(','))?.includes(val.position + '')) || [] const positionNamesArr = deepClone(this.positionTypeList).filter(val => (res?.upgradeGoods.position?.split(','))?.includes(val.position + '')) || []
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
@handleChangeSelect="handleChangeSelect"> @handleChangeSelect="handleChangeSelect">
<template slot="goodsCascader"> <template slot="goodsCascader">
<el-cascader :options="baseData.productTypeList" style="width: 100%;" <el-cascader :options="baseData.productTypeList" style="width: 100%;"
v-model="tempGoodsType" :placeholder="'请选择'" v-model="tempGoodsType" :placeholder="'请选择'" filterable
@change="selectAddAttr($event)" @change="selectAddAttr($event)"
:props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }" :show-all-levels="false"> :props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }">
</el-cascader> </el-cascader>
</template> </template>
</d2-search> </d2-search>
...@@ -472,9 +472,8 @@ export default { ...@@ -472,9 +472,8 @@ export default {
prop: 'goodsTypeName', prop: 'goodsTypeName',
formatter: (cellValue) => { formatter: (cellValue) => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = cellValue.goodsInfo const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = cellValue.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type) const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}` const result = types.filter(type => type).join('-')
: goodsTypeName
return result return result
}, },
width: 170 width: 170
......
...@@ -249,9 +249,8 @@ export default { ...@@ -249,9 +249,8 @@ export default {
const resArr = [] const resArr = []
res.list && res.list.forEach(val => { res.list && res.list.forEach(val => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type) const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}` const result = types.filter(type => type).join('-')
: goodsTypeName
val.upgradeGoodsList.forEach(v => { val.upgradeGoodsList.forEach(v => {
resArr.push({ resArr.push({
confId: v.id, confId: v.id,
...@@ -313,9 +312,8 @@ export default { ...@@ -313,9 +312,8 @@ export default {
const defaultSelect = [] // 上架商品 默认选中项 const defaultSelect = [] // 上架商品 默认选中项
res?.merchantGoodsInfoList?.forEach(val => { res?.merchantGoodsInfoList?.forEach(val => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type) const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}` const result = types.filter(type => type).join('-')
: goodsTypeName
const positionNamesArr = deepClone(this.positionTypeList)?.filter(subVal => (val?.upgradeGoods?.position?.split(','))?.includes(subVal.position + '')) || [] const positionNamesArr = deepClone(this.positionTypeList)?.filter(subVal => (val?.upgradeGoods?.position?.split(','))?.includes(subVal.position + '')) || []
res.groundingGoodsList.push({ res.groundingGoodsList.push({
id: val.id, id: val.id,
......
...@@ -151,9 +151,8 @@ export default { ...@@ -151,9 +151,8 @@ export default {
arr = upgradeSupplyModeList arr = upgradeSupplyModeList
} }
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type) const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}` const result = types.filter(type => type).join('-')
: goodsTypeName
this.editForm[1].formBlock.push(packageGoodsDetail) this.editForm[1].formBlock.push(packageGoodsDetail)
// 太阳膜类回显部位 // 太阳膜类回显部位
const positionNamesArr = deepClone(this.positionTypeList).filter(subVal => (val?.upgradeGoods?.position?.split(','))?.includes(subVal.position + '')) || [] const positionNamesArr = deepClone(this.positionTypeList).filter(subVal => (val?.upgradeGoods?.position?.split(','))?.includes(subVal.position + '')) || []
......
...@@ -175,9 +175,9 @@ ...@@ -175,9 +175,9 @@
</el-select> </el-select>
<!-- 级联选择器 --> <!-- 级联选择器 -->
<el-cascader v-else-if="item.type === 'cascader'" :style="{ width: item.width || formItemWidth }" :options="item.optionList" <el-cascader v-else-if="item.type === 'cascader'" :style="{ width: item.width || formItemWidth }" :options="item.optionList"
v-model="formData[item.name]" :placeholder="'请选择' + item.label" v-model="formData[item.name]" :placeholder="'请选择' + item.label" filterable
@change="selectAddAttr($event, item)" aria-hidden="false" @change="selectAddAttr($event, item)" aria-hidden="false"
:props="{ checkStrictly: true, label: item.optionLabel, value: item.optionId }" :show-all-levels="false"> :props="{ checkStrictly: true, label: item.optionLabel, value: item.optionId }">
</el-cascader> </el-cascader>
</el-form-item> </el-form-item>
</div> </div>
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
:form-data="showFormData"> :form-data="showFormData">
<template slot="goodsCascader"> <template slot="goodsCascader">
<el-cascader :options="baseData.productTypeList" style="width: 100%;" <el-cascader :options="baseData.productTypeList" style="width: 100%;"
v-model="tempGoodsType" :placeholder="'请选择'" v-model="tempGoodsType" :placeholder="'请选择'" filterable
@change="selectAddAttr($event)" @change="selectAddAttr($event)"
:props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }" :show-all-levels="false"> :props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }">
</el-cascader> </el-cascader>
</template> </template>
</d2-search> </d2-search>
...@@ -211,9 +211,8 @@ export default { ...@@ -211,9 +211,8 @@ export default {
prop: 'goodsTypeName', prop: 'goodsTypeName',
formatter: (cellValue) => { formatter: (cellValue) => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = cellValue.goodsInfo const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = cellValue.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type) const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}` const result = types.filter(type => type).join('-')
: goodsTypeName
return result return result
} }
}, { }, {
...@@ -314,6 +313,7 @@ export default { ...@@ -314,6 +313,7 @@ export default {
mounted() { mounted() {
var allOpt = { confId: '', confValue: '全部' } var allOpt = { confId: '', confValue: '全部' }
this.baseData.statusList.unshift(allOpt) this.baseData.statusList.unshift(allOpt)
this.getBaseData()
// 获取全部类目 屏蔽服务商自建类目 // 获取全部类目 屏蔽服务商自建类目
getAllCategory({ categoryTypeList: this.selfBuildGoodsType, pageSize: 9999, currentPage: 1 }).then(res => { getAllCategory({ categoryTypeList: this.selfBuildGoodsType, pageSize: 9999, currentPage: 1 }).then(res => {
this.baseData.productTypeList = res?.list || [] this.baseData.productTypeList = res?.list || []
......
...@@ -646,7 +646,7 @@ export default { ...@@ -646,7 +646,7 @@ export default {
} }
// 第4列(员工姓名列)根据 staffUuid 进行合并 // 第4列(员工姓名列)根据 staffUuid 进行合并
if (columnIndex === 3) { if (columnIndex === 3 || columnIndex > 7) {
console.log(rowIndex, row.staffUuid) console.log(rowIndex, row.staffUuid)
console.log(row, column, rowIndex, columnIndex) console.log(row, column, rowIndex, columnIndex)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div class="content"> <div class="content">
<div class="title">基本信息</div> <div class="title">基本信息</div>
<template v-if="type == 1"> <template v-if="type == 1">
<el-transfer class="transfer" v-model="value" filterable :titles="['待选列表', '已选列表']" <el-transfer :key="key" class="transfer" v-model="value" filterable :titles="['待选列表', '已选列表']"
:left-default-checked="leftDefaultChecked" :right-default-checked="rightDefaultChecked" :format="{ :left-default-checked="leftDefaultChecked" :right-default-checked="rightDefaultChecked" :format="{
noChecked: '${total}项', noChecked: '${total}项',
hasChecked: '${checked}/${total}项' hasChecked: '${checked}/${total}项'
...@@ -24,14 +24,22 @@ ...@@ -24,14 +24,22 @@
<div class="basic-info"><span>缺失份数:</span>{{ templateData.undoCount }}份</div> <div class="basic-info"><span>缺失份数:</span>{{ templateData.undoCount }}份</div>
<div class="title">明细数据 <el-button type="primary" size="mini" @click="exportTable">导出</el-button></div> <div class="title">明细数据 <el-button type="primary" size="mini" @click="exportTable">导出</el-button></div>
<el-table :data="tableData" border style="width: 100%;text-align: center;"> <el-table :data="tableData" border style="width: 100%;text-align: center;">
<el-table-column prop="staffName" label="督导姓名"> <el-table-column v-for="(item, index) in tableParams" :sortable="item.sortable" :key="index" :prop="item.prop" :label="item.label">
<template slot-scope="scope">
<slot :scope="scope.row">
{{ scope.row[item.prop] == null ? '-' : scope.row[item.prop] }}
</slot>
</template>
</el-table-column>
<!-- <el-table-column prop="staffName" label="督导姓名">
{{ scope.row.staffName || "-" }}
</el-table-column> </el-table-column>
<el-table-column prop="lastSubmitDate" sortable label="最近提交日报日期"> <el-table-column prop="lastSubmitDate" sortable label="最近提交日报日期">
</el-table-column> </el-table-column>
<el-table-column prop="weekSubmitCount" sortable label="本周提交总数"> <el-table-column prop="weekSubmitCount" sortable label="本周提交总数">
</el-table-column> </el-table-column>
<el-table-column prop="monthSubmitCount" sortable label="本月提交总数"> <el-table-column prop="monthSubmitCount" sortable label="本月提交总数">
</el-table-column> </el-table-column> -->
</el-table> </el-table>
</template> </template>
<template v-else> <template v-else>
...@@ -77,6 +85,11 @@ export default { ...@@ -77,6 +85,11 @@ export default {
this.getSummaryStaff() this.getSummaryStaff()
} else if (this.type == 1) { } else if (this.type == 1) {
this.value = [] this.value = []
this.leftChecked = []
this.rightChecked= []
this.leftDefaultChecked = []
this.rightDefaultChecked= []
this.key = new Date().getTime()
this.getStaff() this.getStaff()
} }
} }
...@@ -102,7 +115,29 @@ export default { ...@@ -102,7 +115,29 @@ export default {
rightChecked: [], rightChecked: [],
leftDefaultChecked: [], leftDefaultChecked: [],
rightDefaultChecked: [], rightDefaultChecked: [],
tableData: [] tableData: [],
tableParams: [
{
label: '督导姓名',
prop: 'staffName'
},
{
label: '最近提交日报日期',
prop: 'lastSubmitDate',
sortable: true
},
{
label: '本周提交总数',
prop: 'weekSubmitCount',
sortable: true
},
{
label: '本月提交总数',
prop: 'monthSubmitCount',
sortable: true
}
],
key: new Date().getTime()
} }
}, },
...@@ -187,9 +222,6 @@ export default { ...@@ -187,9 +222,6 @@ export default {
templateCode: code, templateCode: code,
createdDate createdDate
} }
exportSummary(params).then(res => {
console.log(res);
})
params.method = 'dj.api.smartcarlife.digital.management.record.staff.summary.export' params.method = 'dj.api.smartcarlife.digital.management.record.staff.summary.export'
const list = [ const list = [
...this.dowloadList, ...this.dowloadList,
...@@ -233,8 +265,12 @@ export default { ...@@ -233,8 +265,12 @@ export default {
createdDate createdDate
} }
getSummaryStaff(params).then(res => { getSummaryStaff(params).then(res => {
console.log(res, '===='); // console.log(res, '====');
// if (res.length) {
// res.forEach(item => {
// if (!item.staffName) item.s
// })
// }
this.tableData = res this.tableData = res
}) })
} }
...@@ -306,4 +342,7 @@ export default { ...@@ -306,4 +342,7 @@ export default {
} }
} }
} }
.el-table .cell {
text-align: center;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
v-model="searchForm.createdDate" v-model="searchForm.createdDate"
type="date" type="date"
placeholder="选择日期" placeholder="选择日期"
:clearable="false"
:picker-options="pickerOption" :picker-options="pickerOption"
@change="dateChange"> @change="dateChange">
</el-date-picker> </el-date-picker>
...@@ -54,8 +55,8 @@ ...@@ -54,8 +55,8 @@
<el-tab-pane v-for="item in tabList" :key="item.id" :label="item.name" :name="item.key"> <el-tab-pane v-for="item in tabList" :key="item.id" :label="item.name" :name="item.key">
<d2-table :ref="item.key + 'Table'" :key="key" :hasNum="false" :tableTotal="tableTotal" @sortChange="sortChange" :sort-obj="sortObj" :tableData="tableData" :search-form="searchFormSearch" :table-params="tableParams" @refreshTable="refreshTable"> <d2-table :ref="item.key + 'Table'" :key="key" :hasNum="false" :tableTotal="tableTotal" @sortChange="sortChange" :sort-obj="sortObj" :tableData="tableData" :search-form="searchFormSearch" :table-params="tableParams" @refreshTable="refreshTable">
<div class="text-box" slot="multiterm" slot-scope="scope"> <div class="text-box" slot="multiterm" slot-scope="scope">
<span>{{ scope.scope[scope.prop].split(',')[0] }}</span> <span>{{ scope.scope[scope.prop] ? scope.scope[scope.prop].split(',')[0] : '-'}}</span>
<el-popover placement="top" width="fit-content" trigger="hover"> <el-popover v-if="scope.scope[scope.prop]" placement="top" width="fit-content" trigger="hover">
<div> <div>
<div <div
v-for="(item, index) in scope.scope[scope.prop].split(',')" v-for="(item, index) in scope.scope[scope.prop].split(',')"
...@@ -69,9 +70,15 @@ ...@@ -69,9 +70,15 @@
<div class="precent-box" slot="percent" slot-scope="scope"> <div class="precent-box" slot="percent" slot-scope="scope">
<div class="total">{{scope.scope[scope.prop].value}}{{scope.scope[scope.prop].suffix}}</div> <div class="total">{{scope.scope[scope.prop].value}}{{scope.scope[scope.prop].suffix}}</div>
<div class="precent"> <div class="precent">
<template v-if="scope.scope[scope.prop].monthRate">
<div :class="scope.scope[scope.prop].monthRate > 0 ? 'red' : scope.scope[scope.prop].monthRate == 0 ? '' : 'green'">月 {{scope.scope[scope.prop].monthRate}}%</div> <div :class="scope.scope[scope.prop].monthRate > 0 ? 'red' : scope.scope[scope.prop].monthRate == 0 ? '' : 'green'">月 {{scope.scope[scope.prop].monthRate}}%</div>
</template>
<template v-else>月 -</template>
<div class="line"></div> <div class="line"></div>
<template v-if="scope.scope[scope.prop].weekRate">
<div :class="scope.scope[scope.prop].weekRate > 0 ? 'red' : scope.scope[scope.prop].weekRate == 0 ? '' : 'green'">周 {{scope.scope[scope.prop].weekRate}}%</div> <div :class="scope.scope[scope.prop].weekRate > 0 ? 'red' : scope.scope[scope.prop].weekRate == 0 ? '' : 'green'">周 {{scope.scope[scope.prop].weekRate}}%</div>
</template>
<template v-else>周 -</template>
</div> </div>
</div> </div>
<div class="text-box" slot="text" slot-scope="scope"> <div class="text-box" slot="text" slot-scope="scope">
...@@ -81,10 +88,16 @@ ...@@ -81,10 +88,16 @@
{{scope.scope[scope.prop] || '-'}} {{scope.scope[scope.prop] || '-'}}
</div> </div>
<div class="text-box" slot="link" slot-scope="scope"> <div class="text-box" slot="link" slot-scope="scope">
<template v-if="scope.scope[scope.prop]">
<a :href="scope.scope[scope.prop]" target="_blank">复制链接</a> <a :href="scope.scope[scope.prop]" target="_blank">复制链接</a>
</template>
<template v-else>-</template>
</div> </div>
<div class="text-box" slot="picture" slot-scope="scope"> <div class="text-box" slot="picture" slot-scope="scope">
<template v-if="scope.scope[scope.prop]">
<a :href="scope.scope[scope.prop]" target="_blank">查看</a> <a :href="scope.scope[scope.prop]" target="_blank">查看</a>
</template>
<template v-else>-</template>
</div> </div>
</d2-table> </d2-table>
</el-tab-pane> </el-tab-pane>
...@@ -367,8 +380,8 @@ export default { ...@@ -367,8 +380,8 @@ export default {
const r2 = await getRecordPage(params2) const r2 = await getRecordPage(params2)
console.log(r2); console.log(r2);
this.tableTotal = r2.total; this.tableTotal = r2.total;
// this.activeName = this.tabList[0].key; this.activeName = this.tabList[0].key;
if (this.activeName == 0) this.activeName = this.tabList[0].key // if (this.activeName == 0) this.activeName = this.tabList[0].key
console.log(this.activeName, this.activeName == 0, 'active'); console.log(this.activeName, this.activeName == 0, 'active');
this.recordData = r2.list; this.recordData = r2.list;
this.changeTable(isSort); this.changeTable(isSort);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
:tableData="salaryList" :tableData="salaryList"
:table-params="salaryTableParams"> :table-params="salaryTableParams">
<template slot="deferredIncluded" slot-scope="scope"> <template slot="deferredIncluded" slot-scope="scope">
<span v-if="!isEmpty(scope.scope.deferIncome)">-</span> <span v-if="isEmpty(scope.scope.deferIncome)">-</span>
<el-tooltip class="item" effect="dark" v-else placement="top"> <el-tooltip class="item" effect="dark" v-else placement="top">
<template slot="content"> <template slot="content">
<p>{{ getMonthSixMonthsBack }}月递延金</p> <p>{{ getMonthSixMonthsBack }}月递延金</p>
...@@ -33,11 +33,12 @@ ...@@ -33,11 +33,12 @@
<div> <div>
<span>{{ subItem.merchantName }}</span> <span>{{ subItem.merchantName }}</span>
<span>{{ subItem.merchantId }}</span> <span>{{ subItem.merchantId }}</span>
<span class="car-text" v-if="subItem.configCarType">{{ subItem.configCarType ==1 ? '单问界' : '其他车系' }}</span>
</div> </div>
<div>门店总提成金额<span class="price-text">{{ subItem.goodsCommissionPrice || '-' }}元</span></div> <div>门店总提成金额<span class="price-text">{{ subItem.goodsCommissionPrice || '-' }}元</span></div>
</div> </div>
<div class="content-item-body"> <div class="content-item-body">
<div class="left-line"> <div class="left-line" :style="{ 'height': subItem.dailyReportDeductDateList && subItem.dailyReportDeductDateList.length ? 'calc(100% - 55px)' : 'calc(100% - 24px)'}">
<div class="line" :style="{'top': (48 * (idx + 1) + 63) + 'px'}" v-for="(v, idx) in subItem.allocationDetailList" :key="idx"></div> <div class="line" :style="{'top': (48 * (idx + 1) + 63) + 'px'}" v-for="(v, idx) in subItem.allocationDetailList" :key="idx"></div>
</div> </div>
<div class="content-item-body-title"> <div class="content-item-body-title">
...@@ -116,28 +117,28 @@ export default { ...@@ -116,28 +117,28 @@ export default {
label: '平板扣款', label: '平板扣款',
prop: 'padDeductMoney', prop: 'padDeductMoney',
formatter: (row) => { formatter: (row) => {
return !isEmpty(row.padDeductMoney) ? `-¥${Math.abs(row.padDeductMoney)}` : '-' return !isEmpty(row.padDeductMoney) ? `- ¥${Math.abs(row.padDeductMoney)}` : '-'
} }
}, },
{ {
label: '日报扣款', label: '日报扣款',
prop: 'dailyDeductMoney', prop: 'dailyDeductMoney',
formatter: (row) => { formatter: (row) => {
return !isEmpty(row.dailyDeductMoney) ? `-¥${Math.abs(row.dailyDeductMoney)}` : '-' return !isEmpty(row.dailyDeductMoney) ? `- ¥${Math.abs(row.dailyDeductMoney)}` : '-'
} }
}, },
{ {
label: '退单冲减', label: '退单冲减',
prop: 'refundOffset', prop: 'refundOffset',
formatter: (row) => { formatter: (row) => {
return !isEmpty(row.refundOffset) ? `-¥${Math.abs(row.refundOffset)}` : '-' return !isEmpty(row.refundOffset) ? `- ¥${Math.abs(row.refundOffset)}` : '-'
} }
}, },
{ {
label: '递延金扣款', label: '递延金扣款',
prop: 'deferExpenses', prop: 'deferExpenses',
formatter: (row) => { formatter: (row) => {
return !isEmpty(row.deferExpenses) ? `-¥${Math.abs(row.deferExpenses)}` : '-' return !isEmpty(row.deferExpenses) ? `- ¥${Math.abs(row.deferExpenses)}` : '-'
} }
}, },
{ {
...@@ -150,7 +151,7 @@ export default { ...@@ -150,7 +151,7 @@ export default {
prop: 'correctSalary', prop: 'correctSalary',
width: '120px', width: '120px',
formatter: (row) => { formatter: (row) => {
return !isEmpty(row.correctSalary) ? (row.correctSalary >= 0 ? `¥${row.correctSalary}` : `-¥${Math.abs(row.correctSalary)}`) : '-' return !isEmpty(row.correctSalary) ? `¥${row.correctSalary}` : '-'
} }
}, },
] ]
...@@ -193,7 +194,7 @@ export default { ...@@ -193,7 +194,7 @@ export default {
prop: '', prop: '',
width: 100, width: 100,
formatter: (row) => { formatter: (row) => {
return `${!isEmpty(row.calculateValue) ? row.calculateValue : '-'}%×${!isEmpty(row.outputCommissionRatio) ? row.outputCommissionRatio : '-'}` return row.allocationType == 5 ? `${!isEmpty(row.outputCommissionRatio) ? row.outputCommissionRatio : '-'}%×${row.calculateValue}` : row.allocationType == 6 ? `${row.outputCommissionRatio}%×1` : '-'
} }
}, },
{ {
...@@ -335,7 +336,19 @@ export default { ...@@ -335,7 +336,19 @@ export default {
margin-top: 20px; margin-top: 20px;
font-weight: bold; font-weight: bold;
border-bottom: 1px solid #E7E7E7; border-bottom: 1px solid #E7E7E7;
.car-text {
margin-left: 16px;
font-weight: normal;
padding: 4px 8px;
height: 12px;
font-size: 12px;
color: #666666;
background: #FFFFFF;
border: 1px solid #E8E8E8;
border-radius: 2px;
}
.price-text{ .price-text{
margin-left: 2px;
color: #2A58AD; color: #2A58AD;
} }
} }
...@@ -346,7 +359,6 @@ export default { ...@@ -346,7 +359,6 @@ export default {
position: absolute; position: absolute;
left: 15px; left: 15px;
width: 1px; width: 1px;
height: calc(100% - 24px);
background: #E7E7E7; background: #E7E7E7;
.line{ .line{
width: 21px; width: 21px;
......
const jobTypeEnum = {
0: '实习生(理论)',
1: '实习生(实践)',
2: '初级驻店',
3: '中级驻店',
4: '高级驻店',
5: '小店长',
6: '大店长',
7: '初级区域督导',
8: '中级区域督导',
9: '高级区域督导',
10: '见习驻店'
}
const sceneTypeEnum = {
0: '会员权益/升级',
1: '轻改'
}
const carTypeEnum = {
1: '问界',
2: '其他'
}
export {
jobTypeEnum,
sceneTypeEnum,
carTypeEnum
}
\ No newline at end of file \ No newline at end of file
<template> <template>
<d2-container> <!-- <d2-container> -->
<div class="measurement">
<div class="measurement-header"> <div class="measurement-header">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="收入测算" name="first"> <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>
<el-tab-pane label="收入测算配置" name="second"> <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-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
<template v-if="activeName == 'first'"> <components :is="tabName"></components>
<d2-table ref="measurementTable" :search-form="searchForm" :table-params="measurementTableParams"></d2-table> </div>
</template> <!-- </d2-container> -->
<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> </template>
<script> <script>
import { getWhiteStaff, getSwitchConfig, addSwitchConfig, getStaffInfo, addWhiteStaff, delWhiteStaff } from "@api/resident" import MeasureTable from './measureTable.vue';
import MeasureConfig from './measureConfig.vue';
export default { export default {
data() { data() {
return { return {
activeName: 'second', activeName: 'first',
// 收入测算
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'
}, },
{ components: {MeasureTable, MeasureConfig},
label: '服务门店', computed: {
prop: 'serviceMerchantName' tabName() {
} let sname
] switch(this.activeName) {
}, case 'first':
dialogVisible: false, sname = 'MeasureTable';
whiteForm: { break
staffName: '', case 'second':
staffPhone: '' sname = 'MeasureConfig'
break
default:
break
} }
console.log(sname, '===');
return sname
} }
}, },
created() {
this.getSwitch()
},
methods: { 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) { handleClick(tab) {
console.log(tab); this.activeName = tab.name
},
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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.measurement {
margin: 0 20px;
}
.measurement-header { .measurement-header {
background-color: #fff; 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 { .d2-container-content {
margin-top: 0 !important; margin-top: 0 !important;
padding: 0 20px 20px !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>
<style lang="scss"> <style lang="scss">
.measurement-header { .measurement-header {
...@@ -337,17 +75,4 @@ export default { ...@@ -337,17 +75,4 @@ export default {
} }
} }
} }
.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> </style>
\ No newline at end of file \ No newline at end of file
<template>
<d2-container>
<div class="measurement-header">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="收入测算" name="first">
</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: 'first',
// 收入测算
searchForm: {},
labelWidth: '110px',
showFormData: [
{
label: '员工姓名',
name: 'staffName',
type: 'input'
},
{
label: '电话号码',
name: 'staffPhone',
type: 'input'
},
{
label: '门店名称',
name: 'merchantName',
type: 'input'
},
{
label: '所属业务',
name: 'staffPhone',
type: 'select',
optionId: 'value',
optionLabel: 'label',
optionList: [
{
label: '全部',
value: ''
},
{
label: '会员权益/升级',
value: '0'
},
{
label: '轻改',
value: '1'
}
]
},
{
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 \ No newline at end of file
<template>
<div>
<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-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" :rules="rules" label-width="150px">
<el-form-item label="手机号码:" prop="staffPhone">
<el-input v-model="whiteForm.staffPhone" maxlength="11" 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>
</div>
</template>
<script>
import { Util } from '@/common/util'
import { getWhiteStaff, getSwitchConfig, addSwitchConfig, getStaffInfo, addWhiteStaff, delWhiteStaff } from "@api/resident"
export default {
name: 'MeasureConfig',
data() {
function checkPhone(rule, value, callback) {
console.log(value);
if (!Util.checkPhone(value)) {
callback(new Error('请输入正确的手机号码'))
return false
}
callback()
}
return {
// 收入测算配置
configFlag: 1,
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: ''
},
rules: {
staffPhone: [
{
required: true,
message: '请输入手机号码',
trigger: 'blur'
}, {
validator: checkPhone,
trigger: 'blur'
}]
}
}
},
created() {
this.getSwitch()
},
methods: {
// 查询测试配置开关
async getSwitch() {
const res = await getSwitchConfig()
if(res) this.configFlag = res.configFlag
},
handleAdd() {
console.log('111');
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
this.whiteForm = {
staffName: '',
staffPhone: ''
}
},
radioChange(e) {
console.log(e);
addSwitchConfig({ configFlag: e }).then(res => {
console.log(res)
if (res) this.$message.success('修改成功')
})
},
// 查询员工
searchStaff() {
this.$refs.whiteForm.validate((valid) => {
if (valid) {
const {staffPhone} = this.whiteForm
// if (!staffPhone) return this.$message.error('请输入手机号码')
getStaffInfo({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>
.d2-container-content {
background-color: #fff;
margin-top: 0 !important;
padding: 0 20px 20px !important;
}
.app-config {
color: #333333;
font-size: 16px;
padding: 12.5px 20px;
background-color: #F8FAFF;
// margin: 0 20px;
}
.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>
\ No newline at end of file \ No newline at end of file
<template>
<div class="">
<d2-container class="m-t-40">
<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" style="height: 450px; overflow: auto;">
<d2-table-header>
<el-button type="primary" @click="handleExport">导出</el-button>
</d2-table-header>
<d2-table ref="measurementTable" :before-search-fn="beforeSearchFn" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="measurementTableParams"></d2-table>
</div>
</d2-container>
</div>
</template>
<script>
import { deepClone } from "@/common/util"
import { mapActions, mapState } from 'vuex'
import { listGoodsType, getIncomePage } from '@api/resident'
import { jobTypeEnum, sceneTypeEnum, carTypeEnum } from './contant'
import dayjs from 'dayjs';
export default {
name: 'MeasureTable',
data() {
return {
// 收入测算
searchForm: {
sceneType: '',
configCarType: ''
},
searchFormSearch: {},
labelWidth: '110px',
showFormData: [
{
label: '员工姓名',
name: 'staffName',
type: 'input'
},
{
label: '电话号码',
name: 'staffPhone',
type: 'input'
},
{
label: '门店名称',
name: 'merchantName',
type: 'input'
},
{
label: '所属业务',
name: 'sceneType',
type: 'select',
optionId: 'value',
optionLabel: 'label',
optionList: [
{
label: '全部',
value: ''
},
{
label: '会员权益/升级',
value: '0'
},
{
label: '轻改',
value: '1'
}
]
},
{
label: '产品名称',
name: 'showGoodsTypeName',
type: 'select',
optionId: 'goodsId',
optionLabel: 'goodsName',
optionList: [],
isClear: true
},
{
label: '品牌',
name: 'configCarType',
type: 'select',
optionId: 'value',
optionLabel: 'label',
optionList: [
{
label: '全部',
value: ''
},
{
label: '问界',
value: '1'
},
{
label: '其他',
value: '2'
}
]
},
{
label: '测算收入日期',
name: 'calculationDay',
type: 'datePicker',
dateType: 'date',
isClear: true,
pickerOptions: 'yesterdayPicker'
}
],
getListApi: getIncomePage,
measurementTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [
{
label: '姓名',
prop: 'staffName',
width: '150px'
},
{
label: '电话号码',
prop: 'staffPhone',
width: '120px'
},
{
label: '职级',
prop: 'jobType',
width: '120px',
formatter: (cellValue) => {
return jobTypeEnum[cellValue.jobType] || '-'
}
},
{
label: '服务门店',
prop: 'merchantName',
width: '120px'
},
{
label: '所属业务',
prop: 'sceneType',
width: '100px',
formatter: (cellValue) => {
return sceneTypeEnum[cellValue.sceneType] || '-'
}
},
{
label: '品牌',
prop: 'configCarType',
formatter: (cellValue) => {
return carTypeEnum[cellValue.configCarType] || '-'
}
},
{
label: '产品名称',
prop: 'showGoodsTypeName'
},
{
label: '应触客台数',
prop: 'shouldToShopCount',
width: '100px',
},
{
label: '产值',
prop: 'orderTotalPrice'
},
{
label: '成交量',
prop: 'orderCount'
},
{
label: '渗透率',
prop: 'penetrationRate',
formatter: (cellValue) => {
return cellValue.penetrationRate ? cellValue.penetrationRate + '%' : '-'
}
},
{
label: '提成系数',
prop: 'calculateValue'
},
{
label: '提成比例',
prop: 'commissionRatio',
formatter: (cellValue) => {
return cellValue.commissionRatio ? cellValue.commissionRatio + '%' : '-'
}
},
{
label: '客单价',
prop: 'avgCustomerOrderPrice'
},
{
label: '客单价提成系数',
prop: 'avgCustomerOrderPriceCalculateValue',
width: '150px',
},
{
label: '提成金额',
prop: 'commissionPrice'
},
{
label: '测算收入日期',
prop: 'calculationDay',
width: '120px',
},
]
},
}
},
created() {
this.getProduct()
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
methods: {
...mapActions('d2admin/user', ['actionSetDownloadList']),
getProduct() {
listGoodsType().then(res => {
console.log(res, '获取商品');
const list = []
if (res) {
res.forEach(item => {
const _shop = {...item}
if (item.thirdLevelGoodsTypeName) {
_shop.goodsName = item.thirdLevelGoodsTypeName
_shop.goodsId = item.thirdLevelGoodsType
_shop.type = 3
} else if (item.secondaryGoodsTypeName) {
_shop.goodsName = item.secondaryGoodsTypeName
_shop.goodsId = item.secondaryGoodsType
_shop.type = 2
} else {
_shop.goodsName = item.goodsTypeName
_shop.goodsId = item.goodsType
_shop.type = 1
}
list.push(_shop)
console.log(_shop);
})
this.showFormData[4].optionList = list
} else {
this.showFormData[4].optionList = []
}
})
},
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.getParams())
resolve()
})
},
handleSearch() {
const params = this.getParams()
console.log(params, '-==-=');
this.$refs.measurementTable.refreshTable(true, true)
},
getParams() {
let params = deepClone(this.searchForm)
const { showGoodsTypeName, calculationDay } = this.searchForm
if (showGoodsTypeName) {
const _goods = this.showFormData[4].optionList.find(item => item.goodsId == showGoodsTypeName)
// delete _goods.goodsId
// delete _goods.goodsName
delete params.showGoodsTypeName
const { type } = _goods
if (type == 1) {
params.goodsType = _goods.goodsType
params.goodsTypeName = _goods.goodsTypeName
} else if (type == 2) {
params.secondaryGoodsType = _goods.secondaryGoodsType
params.secondaryGoodsTypeName = _goods.secondaryGoodsTypeName
} else if (type ==3 ) {
params.thirdLevelGoodsType = _goods.thirdLevelGoodsType
params.thirdLevelGoodsTypeName = _goods.thirdLevelGoodsTypeName
}
// params = Object.assign({}, _goods)
}
if (calculationDay) {
params.calculationDayBegin = dayjs(calculationDay).format('YYYY-MM-DD')
params.calculationDayEnd = dayjs(calculationDay).format('YYYY-MM-DD')
// delete params.calculationDay
} else {
if (params.calculationDayBegin) delete params.calculationDayBegin
if (params.calculationDayEnd) delete params.calculationDayEnd
}
return params
},
handleReset() {
this.searchForm = {
sceneType: '',
configCarType: ''
}
this.$refs.measurementTable.refreshTable(true, true)
},
handleExport() {
var params = this.getParams()
// 去除为null的值
for (const key in params) {
if (params[key] === null || params[key] === '' || params[key].length == 0) {
delete params[key]
}
}
params.method = 'dj.api.smartcarlife.staff.incomeCalculation.exportAsync'
const list = [
...this.dowloadList,
{
name: '收入测算',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
}
}
}
</script>
<style lang="scss" scoped>
.header {
background-color: #fff;
}
.m-t-40 {
margin-top: 40px;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -109,13 +109,13 @@ export default { ...@@ -109,13 +109,13 @@ export default {
handleSubClick(tab) { handleSubClick(tab) {
this.subActiveName = tab.name this.subActiveName = tab.name
console.log(this.subActiveName); console.log(this.subActiveName);
this.$refs.ruleForm.resetFields()
this.getConfig() this.getConfig()
}, },
submit() { submit() {
console.log(this.ruleForm); console.log(this.ruleForm);
this.$refs.ruleForm.validate((valid) => { this.$refs.ruleForm.validate((valid) => {
if (valid) { if (valid) {
console.log(232);
addRankConfig({...this.ruleForm, jobType: this.subActiveName}).then(res => { addRankConfig({...this.ruleForm, jobType: this.subActiveName}).then(res => {
if (res) this.$message.success('保存成功') if (res) this.$message.success('保存成功')
}) })
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<el-button class="copy_btn" type="primary" size="small" plain @click="copyConfig">复制该配置到{{ defaultActiveName == 4 ? '初级驻店' : jobTypeList[Number(defaultActiveName) + 1] }}</el-button> <el-button class="copy_btn" type="primary" size="small" plain @click="copyConfig">复制该配置到{{ defaultActiveName == 4 ? '初级驻店' : jobTypeList[Number(defaultActiveName) + 1] }}</el-button>
<template> <template>
<el-table :data="subItem.configInfo.campusList" :header-cell-style="rowClass"> <el-table :data="subItem.configInfo.campusList" :header-cell-style="rowClass">
<el-table-column label="序号" type="index" width="50" align="center"></el-table-column> <el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column prop="productType" label="产品名称" min-width="175"> <el-table-column prop="productType" label="产品名称" min-width="175">
<template slot-scope="scope"> <template slot-scope="scope">
<el-form-item :prop="`campusList[${scope.$index}].productType`" :rules="rules.productType" label-width="0"> <el-form-item :prop="`campusList[${scope.$index}].productType`" :rules="rules.productType" label-width="0">
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
<div class="config-table"> <div class="config-table">
<template> <template>
<el-table :data="subItem.configInfo.customerList" :header-cell-style="rowClass"> <el-table :data="subItem.configInfo.customerList" :header-cell-style="rowClass">
<el-table-column label="序号" type="index" width="50" align="center"></el-table-column> <el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column prop="percentage" label="售后客户计提标准" min-width="500"> <el-table-column prop="percentage" label="售后客户计提标准" min-width="500">
<template slot-scope="scope"> <template slot-scope="scope">
产品名称为 产品名称为
...@@ -571,6 +571,7 @@ export default { ...@@ -571,6 +571,7 @@ export default {
::v-deep.config-table { ::v-deep.config-table {
.el-table .cell { .el-table .cell {
padding: 0 10px; padding: 0 10px;
text-align: left;
} }
.el-table__body-wrapper { .el-table__body-wrapper {
.el-table__row td:nth-child(1) { .el-table__row td:nth-child(1) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!