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 \ No newline at end of file
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
</div> </div>
<el-dialog class="white-dialog" title="新增白名单" :visible.sync="dialogVisible" width="668px" <el-dialog class="white-dialog" title="新增白名单" :visible.sync="dialogVisible" width="668px"
:before-close="handleClose" :close-on-click-modal="false"> :before-close="handleClose" :close-on-click-modal="false">
<el-form ref="whiteForm" class="white-form" :model="whiteForm" label-width="150px"> <el-form ref="whiteForm" class="white-form" :model="whiteForm" :rules="rules" label-width="150px">
<el-form-item label="手机号码:"> <el-form-item label="手机号码:" prop="staffPhone">
<el-input v-model="whiteForm.staffPhone" placeholder="请输入手机号码"></el-input> <el-input v-model="whiteForm.staffPhone" maxlength="11" placeholder="请输入手机号码"></el-input>
</el-form-item> </el-form-item>
<div class="line"></div> <div class="line"></div>
<el-form-item label="员工姓名:"> <el-form-item label="员工姓名:">
...@@ -51,10 +51,19 @@ ...@@ -51,10 +51,19 @@
</template> </template>
<script> <script>
import { Util } from '@/common/util'
import { getWhiteStaff, getSwitchConfig, addSwitchConfig, getStaffInfo, addWhiteStaff, delWhiteStaff } from "@api/resident" import { getWhiteStaff, getSwitchConfig, addSwitchConfig, getStaffInfo, addWhiteStaff, delWhiteStaff } from "@api/resident"
export default { export default {
name: 'MeasureConfig', name: 'MeasureConfig',
data() { data() {
function checkPhone(rule, value, callback) {
console.log(value);
if (!Util.checkPhone(value)) {
callback(new Error('请输入正确的手机号码'))
return false
}
callback()
}
return { return {
// 收入测算配置 // 收入测算配置
configFlag: 0, configFlag: 0,
...@@ -87,6 +96,17 @@ export default { ...@@ -87,6 +96,17 @@ export default {
whiteForm: { whiteForm: {
staffName: '', staffName: '',
staffPhone: '' staffPhone: ''
},
rules: {
staffPhone: [
{
required: true,
message: '请输入手机号码',
trigger: 'blur'
}, {
validator: checkPhone,
trigger: 'blur'
}]
} }
} }
}, },
...@@ -119,9 +139,11 @@ export default { ...@@ -119,9 +139,11 @@ export default {
}, },
// 查询员工 // 查询员工
searchStaff() { searchStaff() {
this.$refs.whiteForm.validate((valid) => {
if (valid) {
const {staffPhone} = this.whiteForm const {staffPhone} = this.whiteForm
if (!staffPhone) return this.$message.error('请输入手机号码') // if (!staffPhone) return this.$message.error('请输入手机号码')
getStaffInfo({staffPhone: this.whiteForm.staffPhone}).then(res => { getStaffInfo({staffPhone}).then(res => {
console.log(res); console.log(res);
if (res) { if (res) {
this.whiteForm.staffName = res.staffName this.whiteForm.staffName = res.staffName
...@@ -129,6 +151,8 @@ export default { ...@@ -129,6 +151,8 @@ export default {
this.$message.error('不存在该直营驻店人员') this.$message.error('不存在该直营驻店人员')
} }
}) })
}
})
}, },
// 加入白名单 // 加入白名单
addWhite() { addWhite() {
......
...@@ -11,24 +11,32 @@ ...@@ -11,24 +11,32 @@
<el-button size="small" @click="handleReset"> 重置 </el-button> <el-button size="small" @click="handleReset"> 重置 </el-button>
</div> </div>
</div> </div>
<div class="d2-container-content"> <div class="d2-container-content" style="height: 450px; overflow: auto;">
<d2-table-header> <d2-table-header>
<el-button type="primary">导出</el-button> <el-button type="primary" @click="handleExport">导出</el-button>
</d2-table-header> </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> </div>
</d2-container> </d2-container>
</div> </div>
</template> </template>
<script> <script>
import { deepClone } from "@/common/util"
import { mapActions, mapState } from 'vuex'
import { listGoodsType, getIncomePage } from '@api/resident' import { listGoodsType, getIncomePage } from '@api/resident'
import { jobTypeEnum, sceneTypeEnum, carTypeEnum } from './contant'
import dayjs from 'dayjs';
export default { export default {
name: 'MeasureTable', name: 'MeasureTable',
data() { data() {
return { return {
// 收入测算 // 收入测算
searchForm: {}, searchForm: {
sceneType: '',
configCarType: ''
},
searchFormSearch: {},
labelWidth: '110px', labelWidth: '110px',
showFormData: [ showFormData: [
{ {
...@@ -70,7 +78,10 @@ export default { ...@@ -70,7 +78,10 @@ export default {
{ {
label: '产品名称', label: '产品名称',
name: 'showGoodsTypeName', name: 'showGoodsTypeName',
type: 'input' type: 'select',
optionId: 'goodsId',
optionLabel: 'goodsName',
optionList: []
}, },
{ {
label: '品牌', label: '品牌',
...@@ -95,9 +106,10 @@ export default { ...@@ -95,9 +106,10 @@ export default {
}, },
{ {
label: '测算收入日期', label: '测算收入日期',
name: 'calculationDayBegin', name: 'calculationDay',
type: 'datePicker', type: 'datePicker',
dateType: 'date', dateType: 'date',
isClear: true,
pickerOptions: 'rangePickerOptions' pickerOptions: 'rangePickerOptions'
} }
], ],
...@@ -108,73 +120,87 @@ export default { ...@@ -108,73 +120,87 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '姓名', label: '姓名',
prop: 'staffName' prop: 'staffName',
width: '150px'
}, },
{ {
label: '电话号码', label: '电话号码',
prop: 'staffPhone' prop: 'staffPhone',
width: '120px'
}, },
{ {
label: '职级', label: '职级',
prop: 'staffName' prop: 'jobType',
width: '120px',
formatter: (cellValue) => {
return jobTypeEnum[cellValue.jobType] || '-'
}
}, },
{ {
label: '服务门店', label: '服务门店',
prop: 'merchantName' prop: 'merchantName',
width: '120px'
}, },
{ {
label: '所属业务', label: '所属业务',
prop: 'sceneType', prop: 'sceneType',
width: '100px',
formatter: (cellValue) => { formatter: (cellValue) => {
return { return sceneTypeEnum[cellValue.sceneType] || '-'
0: '会员权益/升级',
1: '轻改'
}[cellValue.cellValue]
} }
}, },
{ {
label: '品牌', label: '品牌',
prop: 'staffName' prop: 'configCarType',
formatter: (cellValue) => {
return carTypeEnum[cellValue.configCarType] || '-'
}
}, },
{ {
label: '应触客台数', label: '应触客台数',
prop: 'staffName' prop: 'shouldToShopCount'
}, },
{ {
label: '产值', label: '产值',
prop: 'staffName' prop: 'orderTotalPrice'
}, },
{ {
label: '成交量', label: '成交量',
prop: 'staffName' prop: 'orderCount'
}, },
{ {
label: '渗透率', label: '渗透率',
prop: 'staffName' prop: 'penetrationRate',
formatter: (cellValue) => {
return cellValue.penetrationRate ? cellValue.penetrationRate + '%' : '-'
}
}, },
{ {
label: '提成系数', label: '提成系数',
prop: 'staffName' prop: 'calculateValue'
}, },
{ {
label: '提成比例', label: '提成比例',
prop: 'staffName' prop: 'commissionRatio',
formatter: (cellValue) => {
return cellValue.commissionRatio ? cellValue.commissionRatio + '%' : '-'
}
}, },
{ {
label: '客单价', label: '客单价',
prop: 'staffName' prop: 'avgCustomerOrderPrice'
}, },
{ {
label: '客单价提成系数', label: '客单价提成系数',
prop: 'staffName' prop: 'avgCustomerOrderPriceCalculateValue'
}, },
{ {
label: '提成金额', label: '提成金额',
prop: 'staffName' prop: 'commissionPrice'
}, },
{ {
label: '测算收入日期', label: '测算收入日期',
prop: 'staffName' prop: 'calculationDay'
}, },
] ]
}, },
...@@ -183,17 +209,97 @@ export default { ...@@ -183,17 +209,97 @@ export default {
created() { created() {
this.getProduct() this.getProduct()
}, },
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
methods: { methods: {
...mapActions('d2admin/user', ['actionSetDownloadList']),
getProduct() { getProduct() {
listGoodsType().then(res => { 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() { 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() { 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 { ...@@ -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('保存成功')
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!