Commit 644475fc by zhangxw

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 727b27ca 1c5fb0fc
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
......@@ -28,9 +28,9 @@
</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" label-width="150px">
<el-form-item label="手机号码:">
<el-input v-model="whiteForm.staffPhone" placeholder="请输入手机号码"></el-input>
<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="员工姓名:">
......@@ -51,10 +51,19 @@
</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: 0,
......@@ -87,6 +96,17 @@ export default {
whiteForm: {
staffName: '',
staffPhone: ''
},
rules: {
staffPhone: [
{
required: true,
message: '请输入手机号码',
trigger: 'blur'
}, {
validator: checkPhone,
trigger: 'blur'
}]
}
}
},
......@@ -119,15 +139,19 @@ export default {
},
// 查询员工
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('不存在该直营驻店人员')
}
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('不存在该直营驻店人员')
}
})
}
})
},
// 加入白名单
......
......@@ -11,24 +11,32 @@
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<div class="d2-container-content">
<div class="d2-container-content" style="height: 450px; overflow: auto;">
<d2-table-header>
<el-button type="primary">导出</el-button>
<el-button type="primary" @click="handleExport">导出</el-button>
</d2-table-header>
<d2-table ref="measurementTable" :get-list-api="getListApi" :search-form="searchForm" :table-params="measurementTableParams"></d2-table>
<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: {},
searchForm: {
sceneType: '',
configCarType: ''
},
searchFormSearch: {},
labelWidth: '110px',
showFormData: [
{
......@@ -70,7 +78,10 @@ export default {
{
label: '产品名称',
name: 'showGoodsTypeName',
type: 'input'
type: 'select',
optionId: 'goodsId',
optionLabel: 'goodsName',
optionList: []
},
{
label: '品牌',
......@@ -95,9 +106,10 @@ export default {
},
{
label: '测算收入日期',
name: 'calculationDayBegin',
name: 'calculationDay',
type: 'datePicker',
dateType: 'date',
isClear: true,
pickerOptions: 'rangePickerOptions'
}
],
......@@ -108,73 +120,87 @@ export default {
tableColumns: [
{
label: '姓名',
prop: 'staffName'
prop: 'staffName',
width: '150px'
},
{
label: '电话号码',
prop: 'staffPhone'
prop: 'staffPhone',
width: '120px'
},
{
label: '职级',
prop: 'staffName'
prop: 'jobType',
width: '120px',
formatter: (cellValue) => {
return jobTypeEnum[cellValue.jobType] || '-'
}
},
{
label: '服务门店',
prop: 'merchantName'
prop: 'merchantName',
width: '120px'
},
{
label: '所属业务',
prop: 'sceneType',
width: '100px',
formatter: (cellValue) => {
return {
0: '会员权益/升级',
1: '轻改'
}[cellValue.cellValue]
return sceneTypeEnum[cellValue.sceneType] || '-'
}
},
{
label: '品牌',
prop: 'staffName'
prop: 'configCarType',
formatter: (cellValue) => {
return carTypeEnum[cellValue.configCarType] || '-'
}
},
{
label: '应触客台数',
prop: 'staffName'
prop: 'shouldToShopCount'
},
{
label: '产值',
prop: 'staffName'
prop: 'orderTotalPrice'
},
{
label: '成交量',
prop: 'staffName'
prop: 'orderCount'
},
{
label: '渗透率',
prop: 'staffName'
prop: 'penetrationRate',
formatter: (cellValue) => {
return cellValue.penetrationRate ? cellValue.penetrationRate + '%' : '-'
}
},
{
label: '提成系数',
prop: 'staffName'
prop: 'calculateValue'
},
{
label: '提成比例',
prop: 'staffName'
prop: 'commissionRatio',
formatter: (cellValue) => {
return cellValue.commissionRatio ? cellValue.commissionRatio + '%' : '-'
}
},
{
label: '客单价',
prop: 'staffName'
prop: 'avgCustomerOrderPrice'
},
{
label: '客单价提成系数',
prop: 'staffName'
prop: 'avgCustomerOrderPriceCalculateValue'
},
{
label: '提成金额',
prop: 'staffName'
prop: 'commissionPrice'
},
{
label: '测算收入日期',
prop: 'staffName'
prop: 'calculationDay'
},
]
},
......@@ -183,17 +209,97 @@ export default {
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() {
console.log(this.searchForm);
// const params = this.getParams()
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
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' })
}
}
}
......
......@@ -109,13 +109,13 @@ export default {
handleSubClick(tab) {
this.subActiveName = tab.name
console.log(this.subActiveName);
this.$refs.ruleForm.resetFields()
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('保存成功')
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!