Commit 55867b90 by 张立顺

feat 功能联调

1 parent 804da921
...@@ -53,5 +53,8 @@ export function getStaffTaskDetailApi(data) { ...@@ -53,5 +53,8 @@ export function getStaffTaskDetailApi(data) {
return request(data, "post") return request(data, "post")
} }
// dj.api.smartcarlife.merchantTargetConfig.getDetail/1.0.0
// 查看店面目标配置详情 // 查看店面目标配置详情
export function merchantTargetConfigDetail(data) {
data.method = `dj.api.smartcarlife.merchantTargetConfig.getDetail`
return request(data, "post")
}
...@@ -13,6 +13,14 @@ export function limitPrice( ...@@ -13,6 +13,14 @@ export function limitPrice(
maxValue, maxValue,
regRule regRule
) { ) {
console.log(
newValue,
minValue,
newValue &&
((minValue && newValue < minValue) || (maxValue && newValue > maxValue)),
"limitPrice"
)
var reg = { var reg = {
priceReg: /^\d[\d\.]*$/, // eslint-disable-line priceReg: /^\d[\d\.]*$/, // eslint-disable-line
numReg: /^[1-9]\d*$/, numReg: /^[1-9]\d*$/,
...@@ -49,9 +57,9 @@ export function limitPrice( ...@@ -49,9 +57,9 @@ export function limitPrice(
} }
} }
//允许输入负数的输入框限制 // 允许输入负数的输入框限制
export function limitPriceForNegative(newValue) { export function limitPriceForNegative(newValue) {
//用来检索整数且不超过七位数 // 用来检索整数且不超过七位数
const limitDigit = /[0-9]{1,7}/ const limitDigit = /[0-9]{1,7}/
// 用来检索小数且小数点后不超过两位数 // 用来检索小数且小数点后不超过两位数
const limitDigitdot = /[0-9]{1,7}.[\d]{0,2}/ const limitDigitdot = /[0-9]{1,7}.[\d]{0,2}/
...@@ -114,10 +122,10 @@ export const afterTodayOptions = { ...@@ -114,10 +122,10 @@ export const afterTodayOptions = {
/** /**
* 时间控件-限制选择30天时间范围,且不大于当前时间 * 时间控件-限制选择30天时间范围,且不大于当前时间
*/ */
export var pickerMinDate = "" //获取开始选择时间 export var pickerMinDate = "" // 获取开始选择时间
export var pickerMaxDate = "" //获取结束选择时间 export var pickerMaxDate = "" // 获取结束选择时间
export const rangePickerOptions_30day = { export const rangePickerOptions_30day = {
//时间范围选择控制 // 时间范围选择控制
onPick({ maxDate, minDate }) { onPick({ maxDate, minDate }) {
console.log("minDate", minDate) console.log("minDate", minDate)
console.log("maxDate", maxDate) console.log("maxDate", maxDate)
...@@ -143,7 +151,7 @@ export const rangePickerOptions_30day = { ...@@ -143,7 +151,7 @@ export const rangePickerOptions_30day = {
return time.getTime() > maxTime || time.getTime() > Date.now() - 86400000 return time.getTime() > maxTime || time.getTime() > Date.now() - 86400000
} }
if (pickerMaxDate !== "" && !pickerMinDate) { if (pickerMaxDate !== "" && !pickerMinDate) {
let minTime = pickerMaxDate - day31 const minTime = pickerMaxDate - day31
return time.getTime() < minTime || time.getTime() > Date.now() - 86400000 return time.getTime() < minTime || time.getTime() > Date.now() - 86400000
} }
return time.getTime() > Date.now() - 86400000 return time.getTime() > Date.now() - 86400000
...@@ -155,7 +163,7 @@ export const rangePickerOptions_30day = { ...@@ -155,7 +163,7 @@ export const rangePickerOptions_30day = {
*/ */
export var selectDate = "" export var selectDate = ""
export const rangePickerOptions_30day2 = { export const rangePickerOptions_30day2 = {
//时间范围选择控制 // 时间范围选择控制
onPick({ maxDate, minDate }) { onPick({ maxDate, minDate }) {
selectDate = minDate.getTime() selectDate = minDate.getTime()
if (maxDate) { if (maxDate) {
...@@ -164,8 +172,8 @@ export const rangePickerOptions_30day2 = { ...@@ -164,8 +172,8 @@ export const rangePickerOptions_30day2 = {
}, },
disabledDate(time) { disabledDate(time) {
if (selectDate !== "") { if (selectDate !== "") {
let one = 30 * 24 * 3600 * 1000 const one = 30 * 24 * 3600 * 1000
let minTime = selectDate - one const minTime = selectDate - one
let maxTime = selectDate + one let maxTime = selectDate + one
if (maxTime > new Date()) { if (maxTime > new Date()) {
maxTime = new Date() maxTime = new Date()
......
...@@ -1009,7 +1009,7 @@ export const routerName = { ...@@ -1009,7 +1009,7 @@ export const routerName = {
sideHidden: true, sideHidden: true,
activePath: "/inStoreGoalsConfig" activePath: "/inStoreGoalsConfig"
}, },
component: _import("systemConfig/inStoreGoalsConfig/inStoreConfigView") component: _import("systemConfig/inStoreGoalsConfig/addInStoreConfig")
}, },
// 查看驻店员工任务 // 查看驻店员工任务
90628: { 90628: {
......
...@@ -9,31 +9,40 @@ ...@@ -9,31 +9,40 @@
</div> </div>
<div class="itemCon"> <div class="itemCon">
<el-form-item label="选择门店" prop="merchantId" required> <el-form-item label="选择门店" prop="merchantId" required>
<el-select style="width: 300px;" width="300px" v-model="storeConfigConObj.merchantId" filterable <el-select :disabled="routerParams.idEdit == 'true' || routerForView" style="width: 300px;" width="300px"
placeholder="请选择门店" @change="restData"> v-model="storeConfigConObj.merchantId" filterable placeholder="请选择门店" @change="restData">
<el-option v-for="item in baseData.merchantList " :key="item.merchantId" :label="item.merchantName" <el-option v-for="item in baseData.merchantList " :key="item.merchantId" :label="item.merchantName"
:value="item.merchantId" /> :value="item.merchantId" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="场景名称" prop="sceneType" required> <el-form-item label="场景名称" prop="sceneType" required>
<el-checkbox-group v-model="storeConfigConObj.sceneType" @change="restData"> <el-checkbox-group :disabled="routerParams.idEdit == 'true' || routerForView"
<el-checkbox false-label="null" true-label="1" name="state">精品升级</el-checkbox> v-model="storeConfigConObj.sceneType" @change="restData">
<el-checkbox false-label="null" true-label="0" name="state">会员权益/升级</el-checkbox> <el-checkbox false-label="null" :true-label="1" name="state">精品升级</el-checkbox>
<el-checkbox false-label="null" :true-label="0" name="state">会员权益/升级</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<el-form-item label="驻店员工"> <el-form-item label="驻店员工">
<div class="nothingTips"> <div v-if="storeConfigConObj.merchantId && storeConfigConObj.sceneType">
<div>未配置</div> <el-table style="width: 600px;" v-if="merchantTargetConfigGetStaffList.length"
:data="merchantTargetConfigGetStaffList" border stripe :header-cell-style="rowClass">
<el-table-column label="员工" prop="staffName" align="center">
</el-table-column>
<el-table-column label="联系方式" prop="phoneNumber" align="center">
</el-table-column>
<el-table-column label="账号创建时间" prop="registerTime" align="center">
</el-table-column>
</el-table>
<div v-else class="nothingTips">
<div>未配置</div>
<el-alert title="为不影响员工查看驻店目标,请尽快配置员工账号。" type="warning" show-icon>
</el-alert>
</div>
</div> </div>
<!-- <el-table> <!-- <el-table>
</el-table> --> </el-table> -->
<!-- <el-checkbox-group v-model="storeConfigConObj.sceneType">
<el-checkbox false-label="null" true-label="1" name="state">精品升级</el-checkbox>
<el-checkbox false-label="null" true-label="0" name="state">会员权益/升级</el-checkbox>
</el-checkbox-group> -->
</el-form-item> </el-form-item>
</div> </div>
...@@ -51,7 +60,7 @@ ...@@ -51,7 +60,7 @@
</el-form-item> </el-form-item>
<el-form-item label="考核方案" prop="periodList"> <el-form-item label="考核方案" prop="periodList">
<!-- <span>半个月1次</span> style="width: 60%" 'text-align': 'center', --> <!-- <span>半个月1次</span> style="width: 60%" 'text-align': 'center', -->
<el-button type="primary" @click="addLine">新增方案</el-button> <el-button v-if="!routerForView" type="primary" @click="addLine">新增方案</el-button>
<el-table :data="tableData" border stripe :header-cell-style="rowClass"> <el-table :data="tableData" border stripe :header-cell-style="rowClass">
<el-table-column label="月度" align="center"> <el-table-column label="月度" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -109,7 +118,7 @@ ...@@ -109,7 +118,7 @@
</div> </div>
</template> </template>
</el-table-column> --> </el-table-column> -->
<el-table-column label="操作" align="center"> <el-table-column label="操作" v-if="!routerForView" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span> <span>
<!-- v-if="scope.$index != (form.tableData.length - 1)" form.tableData, --> <!-- v-if="scope.$index != (form.tableData.length - 1)" form.tableData, -->
...@@ -123,16 +132,20 @@ ...@@ -123,16 +132,20 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-form-item> </el-form-item>
<div class="footer"> <div class="footer" v-if="!routerForView">
<el-button @click="saveDraft" type="primary">存草稿</el-button> <el-button @click="saveDraft" type="primary">存草稿</el-button>
<el-button @click="submitForm" type="primary">保存</el-button> <el-button @click="submitForm" type="primary">保存</el-button>
<el-button @click="drawerShow = false">取消</el-button> <el-button @click="routerBack">取消</el-button>
</div>
<div class="footer" v-if="routerForView">
<el-button @click="routerBack" type="primary">返回</el-button>
</div> </div>
</div> </div>
</el-form> </el-form>
<drawerPeriodItemEdit :visible.sync="drawerShow" :mode="mode" :period-item="editPeriodObj" <drawerPeriodItemEdit :visible.sync="drawerShow" :mode="mode" :period-item="editPeriodObj"
@submitPeriodItem="submitPeriodItem"> @submitPeriodItem="submitPeriodItem" :store-config-con-obj-search-obj="storeConfigConObjSearchObj">
</drawerPeriodItemEdit> </drawerPeriodItemEdit>
<!-- </div> --> <!-- </div> -->
...@@ -144,7 +157,7 @@ ...@@ -144,7 +157,7 @@
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import drawerPeriodItemEdit from './components/drawerPeriodItemEdit.vue' import drawerPeriodItemEdit from './components/drawerPeriodItemEdit.vue'
import { getList } from '@api/merchant.js' import { getList } from '@api/merchant.js'
import { merchantTargetConfigUpdate, merchantTargetConfigGetStaffList } from '@api/inStoreTargetConfig.js' import { merchantTargetConfigUpdate, merchantTargetConfigGetStaffList, merchantTargetConfigDetail } from '@api/inStoreTargetConfig.js'
const periodList = [ const periodList = [
{ {
checkMonth: '1', checkMonth: '1',
...@@ -243,6 +256,8 @@ export default { ...@@ -243,6 +256,8 @@ export default {
}, },
data() { data() {
return { return {
merchantTargetConfigGetStaffList: [],
// drawerShow: true,
drawerShow: false, drawerShow: false,
checkMonthObj: { checkMonthObj: {
1: '首月', 1: '首月',
...@@ -254,7 +269,7 @@ export default { ...@@ -254,7 +269,7 @@ export default {
2: '下半月' 2: '下半月'
}, },
selectCarTypeObj: { selectCarTypeObj: {
0: '-', 0: '无',
1: '车辆价格', 1: '车辆价格',
2: '车辆类型' 2: '车辆类型'
}, },
...@@ -295,12 +310,40 @@ export default { ...@@ -295,12 +310,40 @@ export default {
// set(newVal) { // set(newVal) {
// this.$emit('dialogClose', { flag: newVal, attrName: 'addVisible' }) // this.$emit('dialogClose', { flag: newVal, attrName: 'addVisible' })
// } // }
},
routerParams() {
return this.$route.query
},
routerForView() {
return this.$route.name == 'inStoreConfigView'
},
storeConfigConObjSearchObj() {
return {
merchantIds: [this.storeConfigConObj.merchantId],
sceneType: this.storeConfigConObj.sceneType
}
} }
}, },
mounted() { mounted() {
this.getMerchantList() this.getMerchantList()
if (this.routerParams.merchantId) {
this.getDetail()
}
}, },
methods: { methods: {
routerBack() {
this.$router.go(-1)
},
getDetail() {
const { merchantId, sceneType } = this.routerParams
merchantTargetConfigDetail({ merchantId, sceneType }).then(res => {
console.log(res)
this.storeConfigConObj = deepClone(res)
this.getStaff()
}).catch((err) => {
console.log(err)
})
},
restData() { restData() {
// this. = periodList // this. = periodList
this.storeConfigConObj = deepClone({ ...this.storeConfigConObj, periodList }) this.storeConfigConObj = deepClone({ ...this.storeConfigConObj, periodList })
...@@ -315,7 +358,9 @@ export default { ...@@ -315,7 +358,9 @@ export default {
merchantTargetConfigGetStaffList({ merchantTargetConfigGetStaffList({
merchantId, sceneType merchantId, sceneType
}).then(res => { }).then(res => {
this.merchantTargetConfigGetStaffList = res || []
console.log(res, 'merchantTargetConfigGetStaffList') console.log(res, 'merchantTargetConfigGetStaffList')
// this
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
}) })
...@@ -361,13 +406,13 @@ export default { ...@@ -361,13 +406,13 @@ export default {
defaultFlag: 'N', defaultFlag: 'N',
checkMonth: '2', checkMonth: '2',
checkPeriod: '1', checkPeriod: '1',
selectCarType: '0', selectCarType: 0,
selectGoodsType: '0', selectGoodsType: 0,
selectPackageType: '0', selectPackageType: 1,
conversionRate: '1', conversionRate: 1,
conversionRatePercentage: '1', conversionRatePercentage: 1,
customerUnitPrice: '1', customerUnitPrice: 1,
customerUnitPricePercentage: '1' customerUnitPricePercentage: 1
} }
}, },
handleMove() { handleMove() {
...@@ -381,6 +426,11 @@ export default { ...@@ -381,6 +426,11 @@ export default {
const params = deepClone(this.storeConfigConObj) const params = deepClone(this.storeConfigConObj)
merchantTargetConfigUpdate(params).then(res => { merchantTargetConfigUpdate(params).then(res => {
console.log(res, 'merchantTargetConfigUpdate') console.log(res, 'merchantTargetConfigUpdate')
this.$notify({
type: 'success',
title: '保存成功'
})
this.$router.push('/inStoreGoalsConfig')
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!