Commit 95f7f0f6 by 李伟康

feat: 新增日报相关功能并优化门店日报流程

1.  新增多选组件OptionsComponent,支持自定义多选场景
2.  新增日报标签、实际交付日期字段,适配精品和权益工具页
3.  调整环境配置,切换默认环境为uat
4.  新增客户标签映射字典与格式化展示
5.  优化弹窗交互与表单校验逻辑
6.  新增门店日报专属路由与拦截配置
7.  修复部分页面样式与代码格式问题
1 parent f9fe7ce2
...@@ -221,14 +221,14 @@ export default { ...@@ -221,14 +221,14 @@ export default {
pageDirect: true, pageDirect: true,
noInterception: true noInterception: true
}, },
{ // {
icon: 'negotiation-detail', // icon: 'negotiation-detail',
name: 'NegotiationDetail', // name: 'NegotiationDetail',
label: '洽谈明细', // label: '洽谈明细',
page: '/pages/common/dailyNewspaper/index', // page: '/pages/common/dailyNewspaper/index',
eventCode: 'negotiation_detail_page', // eventCode: 'negotiation_detail_page',
noInterception: true // noInterception: true
}, // },
] ]
try { try {
let userInfo = uni.$storage.get('userInfo'), let userInfo = uni.$storage.get('userInfo'),
...@@ -236,14 +236,15 @@ export default { ...@@ -236,14 +236,15 @@ export default {
newReport = await this.isNewVersionNeed(shopMerchantId) newReport = await this.isNewVersionNeed(shopMerchantId)
if (newReport && sceneType != 7) { if (newReport && sceneType != 7) {
let [staffDailyReport] = entranceList let [staffDailyReport] = entranceList
entranceList[0] = { // entranceList[0] = {
...staffDailyReport, // ...staffDailyReport,
name: 'staffDailyReport', // name: 'staffDailyReport',
page: '/pages/common/dailyNewspaper/index', // page: '/pages/common/dailyNewspaper/index',
eventCode: 'staff_daily_report_page', // eventCode: 'staff_daily_report_page',
} // }
delete entranceList[0]
entranceList.map(e => { entranceList.map(e => {
if (['staffDailyReport', 'storeDailyReport', 'NegotiationDetail'].includes(e.name)) e.sceneType = [0, 1] if (['storeDailyReport'].includes(e.name)) e.sceneType = [0, 1]
}) })
} }
this.$store.dispatch('setNewReport', newReport) this.$store.dispatch('setNewReport', newReport)
......
...@@ -517,7 +517,7 @@ export default { ...@@ -517,7 +517,7 @@ export default {
/** /**
* 获取员工场景小分类 * 获取员工场景小分类
*/ */
this.getStaffBaseSceneCodeList() // this.getStaffBaseSceneCodeList()
/** /**
* 获取门店场景小分类 * 获取门店场景小分类
*/ */
......
const target = ['ip', 'dev', 'uat', 'prod', 'beta'] const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 3 const index = 1
/** /**
* *
0本地 0本地
......
...@@ -98,13 +98,13 @@ export default { ...@@ -98,13 +98,13 @@ export default {
if (currentPage.route == 'pages/boutique/tool/index') { if (currentPage.route == 'pages/boutique/tool/index') {
if (isNewReport) if (isNewReport)
uni.redirectTo({ uni.redirectTo({
url: `/pages/common/dailyNewspaper/index?componentName=StaffDailyReport&currentDate=${formattedDate}` url: `/pages/common/dailyNewspaper/index?componentName=StoreDailyReport&currentDate=${formattedDate}`
}) })
else uni.$emit('jumpToDailyReport', formattedDate) else uni.$emit('jumpToDailyReport', formattedDate)
} else { } else {
if (isNewReport) if (isNewReport)
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/dailyNewspaper/index?componentName=StaffDailyReport&currentDate=${formattedDate}` url: `/pages/common/dailyNewspaper/index?componentName=StoreDailyReport&currentDate=${formattedDate}`
}) })
else else
uni.navigateTo({ uni.navigateTo({
...@@ -207,6 +207,7 @@ export default { ...@@ -207,6 +207,7 @@ export default {
sceneType: 0 sceneType: 0
}) })
.then(data => { .then(data => {
return resolve(false)
if (data) { if (data) {
// 获取当前日期 // 获取当前日期
let currentDate = new Date() let currentDate = new Date()
...@@ -226,13 +227,13 @@ export default { ...@@ -226,13 +227,13 @@ export default {
if (currentPage.route == 'pages/equity/tool/index') { if (currentPage.route == 'pages/equity/tool/index') {
if (isNewReport) if (isNewReport)
uni.redirectTo({ uni.redirectTo({
url: `/pages/common/dailyNewspaper/index?componentName=StaffDailyReport&currentDate=${formattedDate}` url: `/pages/common/dailyNewspaper/index?componentName=StoreDailyReport&currentDate=${formattedDate}`
}) })
else uni.$emit('jumpToDailyReport', formattedDate) else uni.$emit('jumpToDailyReport', formattedDate)
} else { } else {
if (isNewReport) if (isNewReport)
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/dailyNewspaper/index?componentName=StaffDailyReport&currentDate=${formattedDate}` url: `/pages/common/dailyNewspaper/index?componentName=StoreDailyReport&currentDate=${formattedDate}`
}) })
else else
uni.navigateTo({ uni.navigateTo({
......
import dayjs from 'dayjs'
const CUSTOMER_TAGS = {
1: '已触客',
2: '已拉群',
3: '已交付引荐',
4: '首保维保客户 ',
5: '事故车客户'
}
module.exports = { module.exports = {
data: { data: {
CUSTOMER_TAGS,
orderObj: [ orderObj: [
{ {
label: '工单编号', label: '工单编号',
...@@ -29,6 +38,18 @@ module.exports = { ...@@ -29,6 +38,18 @@ module.exports = {
key: 'customerName' key: 'customerName'
}, },
{ {
label: '日报标签',
key: 'customerTags',
format: (data) => {
return data.split(',').map(item => CUSTOMER_TAGS[item]).join('/')
}
},
{
label:'实际交付日期',
key: 'actualDeliveryDate',
format: (val) => dayjs(val).format('YYYY-MM-DD')
},
{
label: '性别', label: '性别',
key: 'customerSex', key: 'customerSex',
enum: { enum: {
......
...@@ -75,6 +75,19 @@ const FORM_LIST = [ ...@@ -75,6 +75,19 @@ const FORM_LIST = [
required: true required: true
}, },
{ {
hidden: false,
label: '日报标签',
value:'customerTags',
type:'radio',
multiple: true,
},
{
hidden: false,
label:'实际交付日期',
value:'actualDeliveryDate',
type:"single-calendar"
},
{
label: '性别', label: '性别',
value: 'customerSex', value: 'customerSex',
type: 'radio', type: 'radio',
......
...@@ -193,7 +193,7 @@ export default { ...@@ -193,7 +193,7 @@ export default {
}, },
async entranceClick (item) { async entranceClick (item) {
if (this.toolComponentName == item.name) return if (this.toolComponentName == item.name) return
const noInterceptPage = ['DailyReport'] const noInterceptPage = ['DailyReport','storeDailyReport']
// 原禁止提单inspectionOfProhibitionBill方法被替换getLimitRecord // 原禁止提单inspectionOfProhibitionBill方法被替换getLimitRecord
// if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return // if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return
if (!noInterceptPage.includes(item.name) && (await this.checkDailyReport())) return if (!noInterceptPage.includes(item.name) && (await this.checkDailyReport())) return
......
...@@ -47,11 +47,14 @@ ...@@ -47,11 +47,14 @@
</view> </view>
<view class="footer"> <view class="footer">
<Footer> <Footer>
<view :class="['btn default-btn', { w50: !saveBtn || !showPushBtn }]" @click="$emit('showNegotiationList')">查看洽谈明细表汇总</view> <!-- <view :class="['btn default-btn', { w100: !saveBtn || !showPushBtn }]" @click="$emit('showNegotiationList')">
<view :class="['btn default-btn',{w50:!saveBtn || !showPushBtn}]" @click="saveBtn = true" v-if="!saveBtn">编辑</view> 查看洽谈明细表汇总</view> -->
<view :class="['btn default-btn', { w100: !saveBtn || !showPushBtn }]" @click="saveBtn = true"
v-if="!saveBtn">编辑
</view>
<template v-else> <template v-else>
<view :class="['btn default-btn',{w50:!showPushBtn}]" @click="$emit('saveReport', list)">保存</view> <view :class="['btn default-btn', { w100: !showPushBtn }]" @click="$emit('saveReport', list)">保存</view>
<view class="btn" @click="$emit('submitReport', list )" v-if="showPushBtn">上报数据</view> <view class="btn" @click="$emit('submitReport', list)" v-if="showPushBtn">上报数据</view>
</template> </template>
</Footer> </Footer>
</view> </view>
...@@ -75,7 +78,7 @@ import DailyPopup from '../components/DailyPopup/index.vue' ...@@ -75,7 +78,7 @@ import DailyPopup from '../components/DailyPopup/index.vue'
export default { export default {
name: 'StoreDailyReport', name: 'StoreDailyReport',
components: { Table, Nothing, Footer, EditForm, FormItem, DailyPopup }, components: { Table, Nothing, Footer, EditForm, FormItem, DailyPopup },
inject: ['userInfo', 'sceneType'], inject: ['userInfo', 'sceneType','dailyReportRecordId'],
props: { props: {
templateData: { templateData: {
type: Array, type: Array,
...@@ -83,8 +86,8 @@ export default { ...@@ -83,8 +86,8 @@ export default {
}, },
reportDate: String, reportDate: String,
ReportStatus: null, ReportStatus: null,
isToday:Boolean, isToday: Boolean,
SubmissionStatus:null SubmissionStatus: null
}, },
data() { data() {
return { return {
...@@ -94,8 +97,8 @@ export default { ...@@ -94,8 +97,8 @@ export default {
} }
}, },
computed: { computed: {
showPushBtn(){ showPushBtn() {
return this.SubmissionStatus != 1 && this.isToday return this.SubmissionStatus == 2 && this.isToday && this.dailyReportRecordId()
} }
}, },
watch: { watch: {
...@@ -105,7 +108,7 @@ export default { ...@@ -105,7 +108,7 @@ export default {
this.list = utils.deepClone(val) this.list = utils.deepClone(val)
setTimeout(() => { setTimeout(() => {
this.loadComplete = true this.loadComplete = true
if (val.length) this.getMonthlyPendingCount() // if (val.length) this.getMonthlyPendingCount()
}, 200) }, 200)
}, },
immediate: true, immediate: true,
...@@ -129,12 +132,22 @@ export default { ...@@ -129,12 +132,22 @@ export default {
mounted() { mounted() {
}, },
methods: { methods: {
getCurrentStaff() {
const { name, uuid } = uni.$storage.get("userInfo"),
key = 'F2-107-6'
return {
name,
uuid,
key
}
},
itemShow(i) { itemShow(i) {
if (i.rules) { if (i.rules) {
let { keys, result } = i.rules, let { keys, result } = i.rules,
{ list } = this { list } = this
if (keys && result) { if (keys && result) {
console.log(result, keys)
let params = keys.map((c, index) => `val${index + 1}`), let params = keys.map((c, index) => `val${index + 1}`),
// 将 new Function 改为 eval 方式 // 将 new Function 改为 eval 方式
func = eval(`(function(${params.join(',')}) { return ${result}; })`), func = eval(`(function(${params.join(',')}) { return ${result}; })`),
...@@ -165,11 +178,22 @@ export default { ...@@ -165,11 +178,22 @@ export default {
addItem(index) { addItem(index) {
let { templateData, saveBtn } = this let { templateData, saveBtn } = this
if (!saveBtn) return if (!saveBtn) return
this.list[index].children.push(templateData[index].origin_children) try {
let data = this.list[index].children[this.list[index].children.length - 1], this.list[index].children.push(templateData[index].origin_children)
c_index = this.list[index].children.length - 1, let data = this.list[index].children[this.list[index].children.length - 1],
parent = this.list[index] c_index = this.list[index].children.length - 1,
this.$refs.editForm.open(data, c_index, index, parent) parent = this.list[index]
let { name, uuid, key } = this.getCurrentStaff()
data.forEach(item => {
if (item.key == key) {
item.value = name
item[key] = uuid
}
})
this.$refs.editForm.open(data, c_index, index, parent)
} catch (error) {
console.log(error)
}
}, },
confirm(data, c_index, index) { confirm(data, c_index, index) {
this.$set(this.list[index].children, c_index, utils.deepClone(data)) this.$set(this.list[index].children, c_index, utils.deepClone(data))
...@@ -385,7 +409,7 @@ export default { ...@@ -385,7 +409,7 @@ export default {
} }
.btn { .btn {
width: calc(100% / 3 - #{toRpx(32)}); width: calc(100% / 2 - #{toRpx(32)});
height: toRpx(80); height: toRpx(80);
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -401,8 +425,9 @@ export default { ...@@ -401,8 +425,9 @@ export default {
background: #3b73ff1a; background: #3b73ff1a;
color: #4673ff; color: #4673ff;
} }
.w50{
width: calc(100% / 2 - #{toRpx(32)}); .w100 {
width: 100%;
} }
} }
} }
......
<template> <template>
<view class="car-model-box"> <view class="car-model-box">
<scroll-view <scroll-view class="scroll-view" scroll-y :scroll-into-view="letter">
class="scroll-view"
scroll-y
:scroll-into-view="letter"
>
<template v-if="listData.length"> <template v-if="listData.length">
<template v-for="(i, index) in listData"> <template v-for="(i, index) in listData">
<view <view class="item-box" :key="index" :id="i.letter">
class="item-box" <view class="letter-title flex">{{ i.letter }}</view>
:key="index" <template v-for="(c, cindex) in i.list">
:id="i.letter" <view class="car-model" :key="cindex">
> <view class="brand-name">{{ c.name }}</view>
<view class="letter-title flex">{{i.letter}}</view>
<template v-for="(c,cindex) in i.list">
<view
class="car-model"
:key="cindex"
>
<view class="brand-name">{{c.name}}</view>
<template v-for="(j, jindex) in c.childs"> <template v-for="(j, jindex) in c.childs">
<view <view :key="jindex" class="car-block">
:key="jindex" <view class="sub-brand-name" @click="getCarSeries(j, c)">
class="car-block" {{ j.name }}
>
<view
class="sub-brand-name"
@click="getCarSeries(j,c)"
>
{{j.name}}
</view> </view>
<view class="series-list"> <view class="series-list">
<template v-for="(k, kindex) in j.childs"> <template v-for="(k, kindex) in j.childs">
<view <view class="series-name" :key="kindex">
class="series-name" <view :class="['series-name flex', { active: checkActive(k) }]" @click="getCarTypeList(c,j, k)">
:key="kindex" {{ k.name }}
> <uni-icons :type="`${k.childs && k.childs.length && k.open ? 'down' : 'right'}`"
<view size="18"></uni-icons>
class="series-name flex"
@click="getCarTypeList(k)"
>
{{k.name}}
<uni-icons
:type="`${k.childs && k.childs.length && k.open ?'down':'right'}`"
size="18"
></uni-icons>
</view> </view>
<view <view class="brand-list" v-if="k.open">
class="brand-list" <template v-for="(s, sindex) in k.childs">
v-if="k.open" <view :class="['item flex', { active: checkActive(s) }]" :key="`${s.id}_${sindex}`"
> @click.stop="chooseCarType(s, c)">
<template v-for="(s,sindex) in k.childs"> {{ s.name }}
<view
:class="['item flex',{active: checkActive(s)}]"
:key="`${s.id}_${sindex}`"
@click.stop="chooseCarType(s,c)"
>
{{s.name}}
<view class="sprite-icon icon-tag-checked"></view> <view class="sprite-icon icon-tag-checked"></view>
</view> </view>
</template> </template>
...@@ -76,12 +45,8 @@ ...@@ -76,12 +45,8 @@
</scroll-view> </scroll-view>
<view class="letter-list"> <view class="letter-list">
<template v-for="(i, index) in listData"> <template v-for="(i, index) in listData">
<view <view class="letter-item" :key="index" @click="letter = i.letter">
class="letter-item" {{ i.letter }}
:key="index"
@click="letter = i.letter"
>
{{i.letter}}
</view> </view>
</template> </template>
</view> </view>
...@@ -93,15 +58,15 @@ import popupmixin from './popupmixin' ...@@ -93,15 +58,15 @@ import popupmixin from './popupmixin'
export default { export default {
mixins: [popupmixin], mixins: [popupmixin],
name: 'CarModelList', name: 'CarModelList',
data () { data() {
return { return {
letter: 'A', letter: 'A',
} }
}, },
mounted () { mounted() {
}, },
methods: { methods: {
async getList (searchValue) { async getList(searchValue) {
const { userInfo, params } = this, const { userInfo, params } = this,
{ cacheData } = params { cacheData } = params
this.currentId = '' this.currentId = ''
...@@ -115,7 +80,7 @@ export default { ...@@ -115,7 +80,7 @@ export default {
{ carBrandList } = data[0] { carBrandList } = data[0]
this.updateParams(params, carBrandList || []) this.updateParams(params, carBrandList || [])
}, },
initData (carData) { initData(carData) {
let { params: { idKey }, data: { customer, carInfo } } = this, let { params: { idKey }, data: { customer, carInfo } } = this,
letterList = Array.from(new Set([...carData.map((e) => e.letter)])), letterList = Array.from(new Set([...carData.map((e) => e.letter)])),
carModelList = letterList.map(e => { carModelList = letterList.map(e => {
...@@ -134,7 +99,7 @@ export default { ...@@ -134,7 +99,7 @@ export default {
this.list = carModelList this.list = carModelList
this.$emit('onComplete') this.$emit('onComplete')
}, },
handleSearch (searchValue) { handleSearch(searchValue) {
if (!searchValue) { if (!searchValue) {
this.searchStatus = false this.searchStatus = false
this.letter = 'A' this.letter = 'A'
...@@ -178,7 +143,7 @@ export default { ...@@ -178,7 +143,7 @@ export default {
} }
}, },
async getCarSeries (j, c) { async getCarSeries(j, c) {
if (j.childs && j.childs.length) return if (j.childs && j.childs.length) return
uni.showLoading({ uni.showLoading({
mask: true mask: true
...@@ -191,7 +156,17 @@ export default { ...@@ -191,7 +156,17 @@ export default {
j.childs = data j.childs = data
this.$forceUpdate() this.$forceUpdate()
}, },
async getCarTypeList (k) { async getCarTypeList(c,j, k) {
let chooseItem = {
vehicleBrandId: c.id,
vehicleBrandName: c.name,
vehicleSubBrandId: j.id,
vehicleSubBrandName: j.name,
vehicleSeriesId: k.id,
vehicleSeriesName: k.name
}
this.currentId = k.id
this.$emit('choose', chooseItem)
if (k.childs && k.childs.length) { if (k.childs && k.childs.length) {
k.open = !k.open k.open = !k.open
this.$forceUpdate() this.$forceUpdate()
...@@ -215,7 +190,7 @@ export default { ...@@ -215,7 +190,7 @@ export default {
}) })
}, },
chooseCarType (s, c) { chooseCarType(s, c) {
let chooseItem = { let chooseItem = {
vehicleBrandId: c.id, vehicleBrandId: c.id,
vehicleBrandName: c.name, vehicleBrandName: c.name,
...@@ -229,11 +204,11 @@ export default { ...@@ -229,11 +204,11 @@ export default {
this.currentId = s.id this.currentId = s.id
this.$emit('choose', chooseItem) this.$emit('choose', chooseItem)
}, },
checkActive (s) { checkActive(s) {
let { currentId, data, params, data: { key } } = this, let { currentId, data, params, data: { key } } = this,
carInfo = data[key] || {} carInfo = data[key] || {}
return (currentId ? s.id == currentId : s.id == carInfo[params.idKey] || '' ) return (currentId ? s.id == currentId : s.id == carInfo[params.idKey] || '')
}, },
} }
} }
...@@ -244,9 +219,11 @@ export default { ...@@ -244,9 +219,11 @@ export default {
position: relative; position: relative;
height: 100%; height: 100%;
width: 100%; width: 100%;
.scroll-view { .scroll-view {
height: 100%; height: 100%;
} }
.letter-list { .letter-list {
position: absolute; position: absolute;
top: 50%; top: 50%;
...@@ -258,8 +235,10 @@ export default { ...@@ -258,8 +235,10 @@ export default {
padding: 0 toRpx(18); padding: 0 toRpx(18);
text-align: center; text-align: center;
} }
.item-box { .item-box {
margin-bottom: toRpx(32); margin-bottom: toRpx(32);
.letter-title { .letter-title {
color: #888888; color: #888888;
font-size: toRpx(28); font-size: toRpx(28);
...@@ -267,8 +246,10 @@ export default { ...@@ -267,8 +246,10 @@ export default {
background: #f5f7fa; background: #f5f7fa;
padding-left: toRpx(48); padding-left: toRpx(48);
} }
.car-model { .car-model {
margin: 0 toRpx(48); margin: 0 toRpx(48);
.brand-name { .brand-name {
color: #000; color: #000;
font-size: toRpx(40); font-size: toRpx(40);
...@@ -276,9 +257,11 @@ export default { ...@@ -276,9 +257,11 @@ export default {
margin: toRpx(20) 0; margin: toRpx(20) 0;
font-weight: 500; font-weight: 500;
} }
.car-block { .car-block {
border-bottom: toRpx(2) solid #dce0e6; border-bottom: toRpx(2) solid #dce0e6;
} }
.sub-brand-name { .sub-brand-name {
color: #333; color: #333;
font-size: toRpx(32); font-size: toRpx(32);
...@@ -288,17 +271,23 @@ export default { ...@@ -288,17 +271,23 @@ export default {
margin: toRpx(16) 0; margin: toRpx(16) 0;
padding-left: toRpx(10); padding-left: toRpx(10);
} }
.series-name { .series-name {
color: #555; color: #555;
font-size: toRpx(28); font-size: toRpx(30);
line-height: toRpx(40); line-height: toRpx(40);
width: 100%; width: 100%;
flex-shrink: 0; flex-shrink: 0;
margin-bottom: toRpx(16); margin-bottom: toRpx(16);
padding-left: toRpx(20); padding-left: toRpx(20);
} }
.series-name.active {
color: #2c66f7;
font-weight: 500;
}
} }
} }
.brand-list { .brand-list {
// display: grid; // display: grid;
// grid-template-columns: repeat(4, 1fr); // grid-template-columns: repeat(4, 1fr);
...@@ -307,17 +296,18 @@ export default { ...@@ -307,17 +296,18 @@ export default {
// gap: toRpx(32) 0; // gap: toRpx(32) 0;
flex-wrap: wrap; flex-wrap: wrap;
padding: 0 toRpx(20); padding: 0 toRpx(20);
.item { .item {
width: calc((100% - #{toRpx(96)}) / 4); width: calc((100% - #{toRpx(96)}) / 4);
justify-content: center; justify-content: center;
min-height: toRpx(72); min-height: toRpx(64);
border-radius: toRpx(8); border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6; border: toRpx(2) solid #dce0e6;
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
color: #333333; color: #333333;
font-size: toRpx(32); font-size: toRpx(26);
padding: toRpx(10) toRpx(20); padding: toRpx(6) toRpx(14);
box-sizing: border-box; box-sizing: border-box;
.sprite-icon { .sprite-icon {
display: none; display: none;
...@@ -326,10 +316,12 @@ export default { ...@@ -326,10 +316,12 @@ export default {
right: 0; right: 0;
} }
} }
.active { .active {
border-color: #2c66f7; border-color: #2c66f7;
background: #ecf1ff; background: #ecf1ff;
color: #2c66f7; color: #2c66f7;
.sprite-icon { .sprite-icon {
display: block; display: block;
} }
......
<template>
<view class="options-list">
<template v-for="(i, index) in listData">
<view :key="index" @click="choose(i)" :class="['item flex', { active: checkActive(i) }]">
<view class="sprite-icon icon-tag-checked"></view>
{{ i.label }}
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'OptionsComponent',
inject: ['userInfo'],
data() {
return {
}
},
computed: {
},
mounted() {
},
methods: {
async getList() {
const hasCommonElement = (arrA, arrB) => {
return arrA.some(item => arrB.includes(item))
}
const isSubset = (arrA, arrB) => {
// 检查arrB的每个元素是否都在arrA中
const setA = new Set(arrA)
return arrB.every(item => setA.has(item))
}
let { params, data: { options }, STORE_BASE_SCENE_CODE, CAR_BRAND_ID } = this
this.currentId = ''
this.currentIds = []
this.chooseList = []
this.componentLoading(params)
options = options.filter(item => {
// 品牌过滤
let filterBrand = true,
filterScene = true,
brandId = true,
flag = true
if (item.filterBrandId && item.filterBrandId.length) {
filterBrand = !isSubset(item.filterBrandId, CAR_BRAND_ID)
} else {
brandId = item.brandId && item.brandId.length ? hasCommonElement(item.brandId, CAR_BRAND_ID) : true
}
filterScene = item.baseSceneCode&& item.baseSceneCode?.length ? hasCommonElement(item.baseSceneCode, STORE_BASE_SCENE_CODE) : true
flag = filterBrand && brandId && filterScene
if(item.matchEffect) flag = true
return flag
})
this.updateParams(params, options || [])
},
initData(list) {
const { data, data: { key }, params: { multiple } } = this
if (data[key]) {
if (!multiple) {
this.currentId = data[key]
let item = list.find(i => i.value == this.currentId)
this.$emit('choose', item)
} else {
let arr = data[key]
if (typeof arr == 'string') arr = arr.split(',')
this.chooseList = arr.map(i => list.find(e => e.value == i))
this.currentIds = arr
this.$emit('choose', this.chooseList)
}
}
this.list = list
this.$emit('onComplete')
},
choose(i) {
let { params: { multiple }, currentIds } = this
if (!multiple) {
this.currentId = i.value
this.$emit('choose', i)
} else {
let index = currentIds.indexOf(i.value)
if (index == -1) {
this.currentIds.push(i.value)
this.chooseList.push(i)
} else {
this.currentIds.splice(index, 1)
this.chooseList.splice(index, 1)
}
this.$emit('choose', this.chooseList)
}
},
checkActive(i) {
let { currentId, currentIds, data: { key }, data } = this
if (currentIds && currentIds.length) return currentIds.includes(i.value)
return currentId ? i.value == currentId : i.value == data[key]
}
}
}
</script>
<style scoped lang="scss">
.options-list {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
export default { export default {
inject: ['userInfo', 'baseConfigData'], inject: ['userInfo', 'baseConfigData'],
data () { data() {
return { return {
list: [], list: [],
searchStatus: false, searchStatus: false,
searchList: [], searchList: [],
chooseList: [], chooseList: [],
currentId: '', currentId: '',
currentIds: [], currentIds: []
} }
}, },
props: { props: {
...@@ -16,22 +16,31 @@ export default { ...@@ -16,22 +16,31 @@ export default {
dataKey: String, dataKey: String,
isDefeatOrder: Boolean, isDefeatOrder: Boolean,
positionTypeList: Array, positionTypeList: Array,
reqParams: Object, reqParams: Object
}, },
computed: { computed: {
listData () { listData() {
return this.searchStatus ? this.searchList : this.list return this.searchStatus ? this.searchList : this.list
}, },
noData () { noData() {
return !this.listData.length return !this.listData.length
}, },
sceneType(){ sceneType() {
return uni.$storage.get('userInfo').sceneType return uni.$storage.get('userInfo').sceneType
},
CAR_BRAND_ID() {
const carBrandList = uni.$storage.get('carBrandList'),
carBrandId = carBrandList.map(item => item.id)
return carBrandId
},
STORE_BASE_SCENE_CODE() {
const storeBaseSceneCode = uni.$storage.get('storeBaseSceneCode')
return storeBaseSceneCode
} }
}, },
watch: { watch: {
noData: { noData: {
handler (val) { handler(val) {
let { params } = this let { params } = this
params.noData = val params.noData = val
this.updateParams(params) this.updateParams(params)
...@@ -40,17 +49,16 @@ export default { ...@@ -40,17 +49,16 @@ export default {
} }
}, },
methods: { methods: {
updateParams (params, data) { updateParams(params, data) {
if (data) { if (data) {
this.initData && this.initData(data) this.initData && this.initData(data)
params.cacheData = data params.cacheData = data
} }
this.$emit('update:params', params) this.$emit('update:params', params)
}, },
componentLoading (params) { componentLoading(params) {
params.loadComplete = false params.loadComplete = false
this.$emit('update:params', this.params) this.$emit('update:params', this.params)
} }
} }
}
\ No newline at end of file \ No newline at end of file
}
...@@ -71,6 +71,18 @@ const componentConfig = { ...@@ -71,6 +71,18 @@ const componentConfig = {
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
noData: false noData: false
},
7: {
name: 'OptionsComponent',
title: '多选',
multiple: true,
placeholder: '请输入选项',
nullTips: '请选择选项',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false,
hideSearch: true
} }
} }
......
...@@ -100,6 +100,7 @@ import OrderList from './components/OrderList.vue' ...@@ -100,6 +100,7 @@ import OrderList from './components/OrderList.vue'
import DateTime from './components/DateTime.vue' import DateTime from './components/DateTime.vue'
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import utils from '@/utils/utils' import utils from '@/utils/utils'
import OptionsComponent from './components/OptionsComponent.vue'
export default { export default {
components: { components: {
...@@ -108,6 +109,7 @@ export default { ...@@ -108,6 +109,7 @@ export default {
CarModelList, CarModelList,
OrderList, OrderList,
DateTime, DateTime,
OptionsComponent,
}, },
name: '', name: '',
props: { props: {
......
...@@ -77,6 +77,15 @@ export default { ...@@ -77,6 +77,15 @@ export default {
return rules?.maxDate ? dayjs(eval(rules.maxDate)).format('YYYY-MM-DD') : '2099-12-31' return rules?.maxDate ? dayjs(eval(rules.maxDate)).format('YYYY-MM-DD') : '2099-12-31'
} }
}, },
STORE_BASE_SCENE_CODE() {
const storeBaseSceneCode = uni.$storage.get('storeBaseSceneCode')
return storeBaseSceneCode.map(item => String(item)) || []
},
CAR_BRAND_ID() {
const carBrandList = uni.$storage.get('carBrandList'),
carBrandId = carBrandList.map(item => String(item.id))
return carBrandId || []
},
}, },
mounted() { mounted() {
}, },
...@@ -95,6 +104,19 @@ export default { ...@@ -95,6 +104,19 @@ export default {
* @param parent 父级数据 * @param parent 父级数据
*/ */
open(data, c_index, index, parent) { open(data, c_index, index, parent) {
const hasCommonElement = (arrA, arrB) => {
arrA = arrA.map(item => String(item))
arrB = arrB.map(item => String(item))
return arrA.some(i => arrB.includes(i))
}
data.forEach(item => {
if (item.type == 'select' && !item.optionsKey) {
item.options = item.options.filter(i => i.baseSceneCode && i.baseSceneCode?.length ? hasCommonElement(i.baseSceneCode, this.STORE_BASE_SCENE_CODE) : true)
}
})
data.$sceneCodes = this.STORE_BASE_SCENE_CODE
data.$brandIds = this.CAR_BRAND_ID || []
this.data = utils.deepClone(data) || {} this.data = utils.deepClone(data) || {}
this.c_index = c_index || 0 this.c_index = c_index || 0
this.index = index || 0 this.index = index || 0
...@@ -131,8 +153,9 @@ export default { ...@@ -131,8 +153,9 @@ export default {
func = eval(`(function(${params.join(',')}) { return ${result}; })`), func = eval(`(function(${params.join(',')}) { return ${result}; })`),
value = [] value = []
keys.map(key => { keys.map(key => {
let item = data.find(i => i.key == key) let i = data.find(i => i.key == key)
if (item) value.push(item.value || null) if (data[key]) value.push(data[key])
if (i) value.push(i.type == 'multipleSelect' ? i[i.key] : i.value || null)
}) })
let show = func(...value) let show = func(...value)
item.show = show item.show = show
...@@ -150,8 +173,12 @@ export default { ...@@ -150,8 +173,12 @@ export default {
onInput(val, index) { onInput(val, index) {
this.$set(this.data[index], 'value', val) this.$set(this.data[index], 'value', val)
}, },
onSelect(val, index) { onSelect(item, index) {
this.$set(this.data[index], 'value', val) console.log(item, index)
let { key } = this.data[index]
console.log(this.data[index])
this.$set(this.data[index], key, item.value)
this.$set(this.data[index], 'value', item.label)
}, },
openSelect(item, type, index) { openSelect(item, type, index) {
let list = this.data || [] let list = this.data || []
...@@ -169,12 +196,15 @@ export default { ...@@ -169,12 +196,15 @@ export default {
/** 根据 popupType 处理数据 /** 根据 popupType 处理数据
* 5: 日期时间选择 * 5: 日期时间选择
* 6: 日历 * 6: 日历
* 7: 多选
*/ */
if (popupType == 6 || popupType == 5) { if (popupType == 6 || popupType == 5) {
this.$set(this.data[itemIndex], 'value', chooseContent) this.$set(this.data[itemIndex], 'value', chooseContent)
} else if (popupType == 3) { } else if (popupType == 3) {
const { vehicleBrandName, vehicleSubBrandName, vehicleSeriesName, vehicleShapeName } = chooseContent const { vehicleBrandName, vehicleSubBrandName, vehicleSeriesName, vehicleShapeName } = chooseContent
this.$set(this.data[itemIndex], 'value', `${vehicleBrandName}-${vehicleSubBrandName}-${vehicleSeriesName}-${vehicleShapeName}`) let carName = `${vehicleBrandName}-${vehicleSubBrandName}-${vehicleSeriesName}`
if (vehicleShapeName) carName += `-${vehicleShapeName}`
this.$set(this.data[itemIndex], 'value', carName)
this.$set(this.data[itemIndex], this.data[itemIndex].key, chooseContent) this.$set(this.data[itemIndex], this.data[itemIndex].key, chooseContent)
} else if (popupType == 4) { } else if (popupType == 4) {
...@@ -189,6 +219,11 @@ export default { ...@@ -189,6 +219,11 @@ export default {
}) })
} }
} else if (popupType == 7) {
let label = chooseContent.map(item => item.label).join('/'),
value = chooseContent.map(item => item.value)
this.$set(this.data[itemIndex], 'value', label)
this.$set(this.data[itemIndex], this.data[itemIndex].key, value)
} else { } else {
this.$set(this.data[itemIndex], 'value', chooseContent.staffName) this.$set(this.data[itemIndex], 'value', chooseContent.staffName)
this.$set(this.data[itemIndex], this.data[itemIndex].key, chooseContent.uuid) this.$set(this.data[itemIndex], this.data[itemIndex].key, chooseContent.uuid)
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
</template> </template>
<template v-else> <template v-else>
<picker class="picker" mode="selector" @change="select" :range="item.options || []" range-key="label"> <picker class="picker" mode="selector" @change="select" :range="item.options || []" range-key="label">
<view :class="['select flex', { 'placeholderStyle': !item.value }]" ><text <view :class="['select flex', { 'placeholderStyle': !item.value }]"><text class="text-hide">{{ item.value
class="text-hide">{{ item.value || item.placeholder || '请选择' }}</text> || item.placeholder || '请选择' }}</text>
<view class="sprite-icon icon-icon-select"></view> <view class="sprite-icon icon-icon-select"></view>
</view> </view>
</picker> </picker>
...@@ -75,10 +75,7 @@ ...@@ -75,10 +75,7 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import dayjs from 'dayjs';
import utils from '@/utils/utils'
import permision from '@/js_sdk/wa-permission/permission.js' import permision from '@/js_sdk/wa-permission/permission.js'
export default { export default {
name: 'FormItem', name: 'FormItem',
props: { props: {
...@@ -142,10 +139,10 @@ export default { ...@@ -142,10 +139,10 @@ export default {
if (item.optionsKey || ['date', 'datetime', 'carBrandSelect'].includes(item.type)) { if (item.optionsKey || ['date', 'datetime', 'carBrandSelect'].includes(item.type)) {
if (item.optionsKey == 'storeStaffList' && item.type == 'select') popupType = 1 if (item.optionsKey == 'storeStaffList' && item.type == 'select') popupType = 1
if (item.optionsKey == 'orderList') popupType = 4 if (item.optionsKey == 'orderList') popupType = 4
if (item.optionsKey == 'options') popupType = 7
this.$emit('openSelect', item, popupType) this.$emit('openSelect', item, popupType)
} else { } else {
this.$emit('onSelect', item.options[e.detail.value].value) this.$emit('onSelect', item.options[e.detail.value])
} }
}, },
async clickPrefix() { async clickPrefix() {
...@@ -415,7 +412,8 @@ export default { ...@@ -415,7 +412,8 @@ export default {
background: #f4f5f7; background: #f4f5f7;
padding: toRpx(24); padding: toRpx(24);
box-sizing: border-box; box-sizing: border-box;
.select{
.select {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: block; display: block;
......
...@@ -78,7 +78,7 @@ export default { ...@@ -78,7 +78,7 @@ export default {
dailyReportRecordId: '', dailyReportRecordId: '',
reportStatus: '', reportStatus: '',
submissionStatus: '', submissionStatus: '',
submissionDate:'' submissionDate: ''
} }
}, },
onBackPress(options) { onBackPress(options) {
...@@ -104,10 +104,10 @@ export default { ...@@ -104,10 +104,10 @@ export default {
carBrandId = carBrandList.map(item => item.id) carBrandId = carBrandList.map(item => item.id)
return carBrandId return carBrandId
}, },
BASE_SCENE_CODE() { // BASE_SCENE_CODE() {
const baseSceneCode = uni.$storage.get('baseSceneCode') // const baseSceneCode = uni.$storage.get('baseSceneCode')
return baseSceneCode // return baseSceneCode
}, // },
STORE_BASE_SCENE_CODE() { STORE_BASE_SCENE_CODE() {
const storeBaseSceneCode = uni.$storage.get('storeBaseSceneCode') const storeBaseSceneCode = uni.$storage.get('storeBaseSceneCode')
return storeBaseSceneCode return storeBaseSceneCode
...@@ -212,14 +212,10 @@ export default { ...@@ -212,14 +212,10 @@ export default {
const setA = new Set(arrA) const setA = new Set(arrA)
return arrB.every(item => setA.has(item)) return arrB.every(item => setA.has(item))
} }
const { templateType, CAR_BRAND_ID, BASE_SCENE_CODE, STORE_BASE_SCENE_CODE } = this, const { templateType, CAR_BRAND_ID, STORE_BASE_SCENE_CODE } = this,
data = await uni.$api.dailyTemplateApi.getDailyTemplate(templateType), data = await uni.$api.dailyTemplateApi.getDailyTemplate(templateType),
baseCode = templateType == 2 ? STORE_BASE_SCENE_CODE : BASE_SCENE_CODE baseCode = STORE_BASE_SCENE_CODE
let templateData = Object.values(data) let templateData = Object.values(data)
// .filter(item => {
// // 场景类型过滤
// return item.sceneType.length ? item.sceneType.includes(SCENE_TYPE) : true
// })
.filter(item => { .filter(item => {
// 品牌过滤 // 品牌过滤
if (item.filterBrandId && item.filterBrandId.length) { if (item.filterBrandId && item.filterBrandId.length) {
...@@ -270,6 +266,7 @@ export default { ...@@ -270,6 +266,7 @@ export default {
} }
}) })
uni.hideLoading() uni.hideLoading()
console.log(templateData)
this.templateData = templateData this.templateData = templateData
}, },
setCurrentDate(currentDate) { setCurrentDate(currentDate) {
...@@ -283,13 +280,9 @@ export default { ...@@ -283,13 +280,9 @@ export default {
}, },
async checkReport() { async checkReport() {
let componentRef = this.$refs[`ref-${this.componentName}`], let componentRef = this.$refs[`ref-${this.componentName}`],
{ templateData, templateType, currentDate } = this { templateData, currentDate } = this
// if (templateType != 1) {
// if (!componentRef.isToday) return false
// } else {
let lastDay = dayjs().subtract(30, 'day') let lastDay = dayjs().subtract(30, 'day')
if (!lastDay.isBefore(dayjs(currentDate), 'day')) return false if (!lastDay.isBefore(dayjs(currentDate), 'day')) return false
// }
return templateData.length ? componentRef.saveBtnStatus : false return templateData.length ? componentRef.saveBtnStatus : false
}, },
...@@ -450,8 +443,8 @@ export default { ...@@ -450,8 +443,8 @@ export default {
uni.showLoading({ title: '提交中...', mask: true }) uni.showLoading({ title: '提交中...', mask: true })
const saveData = await uni.$api.dailyTemplateApi.saveDraft(reportParams) const saveData = await uni.$api.dailyTemplateApi.saveDraft(reportParams)
if (saveData) { if (saveData) {
const dailyReportRecordId = await this.getReportDetail(true), const { dailyReportRecordId } = this,
data = await uni.$api.dailyTemplateApi.submitReport({ dailyReportRecordId }) data = await uni.$api.dailyTemplateApi.submitReport({ dailyReportRecordId })
uni.hideLoading() uni.hideLoading()
if (data) { if (data) {
uni.showToast({ title: '操作成功', icon: 'success', mask: true }) uni.showToast({ title: '操作成功', icon: 'success', mask: true })
......
...@@ -19,7 +19,7 @@ export default { ...@@ -19,7 +19,7 @@ export default {
}, },
ReportStatus: null, ReportStatus: null,
SubmissionStatus: null, SubmissionStatus: null,
submissionDate:[String, Number] submissionDate: [String, Number]
}, },
computed: { computed: {
/**可编辑日期 */ /**可编辑日期 */
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
}, },
reportParams() { reportParams() {
let { shopMerchantId, shopMerchantName, uuid, name, merchantId, merchantName } = this.userInfo, let { shopMerchantId, shopMerchantName, uuid, name, merchantId, merchantName } = this.userInfo,
{ currentDate, templateType, dailyReportRecordId, sceneType, SubmissionStatus , submissionDate} = this, { currentDate, templateType, dailyReportRecordId, sceneType, SubmissionStatus, submissionDate } = this,
params = { params = {
merchantId: shopMerchantId, merchantId: shopMerchantId,
merchantName: shopMerchantName, merchantName: shopMerchantName,
...@@ -44,11 +44,11 @@ export default { ...@@ -44,11 +44,11 @@ export default {
templateType: templateType(), templateType: templateType(),
yqMerchantId: merchantId, yqMerchantId: merchantId,
yqMerchantName: merchantName, yqMerchantName: merchantName,
sceneType, sceneType
} }
if (!SubmissionStatus) params.submissionStatus = 2 if (!SubmissionStatus) params.submissionStatus = 2
else params.submissionStatus = SubmissionStatus else params.submissionStatus = SubmissionStatus
if(!submissionDate) params.submissionDate = dayjs().format('YYYY-MM-DD HH:mm:ss') if (!submissionDate) params.submissionDate = dayjs().format('YYYY-MM-DD HH:mm:ss')
else params.submissionDate = dayjs(submissionDate).format('YYYY-MM-DD HH:mm:ss') else params.submissionDate = dayjs(submissionDate).format('YYYY-MM-DD HH:mm:ss')
if (dailyReportRecordId()) params.dailyReportRecordId = dailyReportRecordId() if (dailyReportRecordId()) params.dailyReportRecordId = dailyReportRecordId()
return params return params
...@@ -67,8 +67,9 @@ export default { ...@@ -67,8 +67,9 @@ export default {
func = eval(`(function(${params.join(',')}) { return ${result}; })`), func = eval(`(function(${params.join(',')}) { return ${result}; })`),
value = [] value = []
keys.map(key => { keys.map(key => {
let item = data.find(i => i.key == key) let i = data.find(i => i.key == key)
if (item) value.push(item.value || null) if (data[key]) value.push(data[key])
if (i) value.push(i.type == 'multipleSelect' ? i[i.key] : i.value || null)
}) })
let show = func(...value) let show = func(...value)
return show return show
...@@ -141,10 +142,11 @@ export default { ...@@ -141,10 +142,11 @@ export default {
}) })
const { shopMerchantId } = this.userInfo, const { shopMerchantId } = this.userInfo,
{ sceneType } = this, { sceneType } = this,
carBrandList = await uni.$api.boutiqueApi.getDailyReportCarBrand({ carBrandList =
merchantId: shopMerchantId, (await uni.$api.boutiqueApi.getDailyReportCarBrand({
sceneType merchantId: shopMerchantId,
}) || [] sceneType
})) || []
requestJson.carBrandList = carBrandList.map(({ firstBrandId, firstBrandName, brandId, brandName }) => ({ requestJson.carBrandList = carBrandList.map(({ firstBrandId, firstBrandName, brandId, brandName }) => ({
firstBrandId, firstBrandId,
firstBrandName, firstBrandName,
...@@ -169,7 +171,7 @@ export default { ...@@ -169,7 +171,7 @@ export default {
} }
}, },
async submitReport(res) { async submitReport(res) {
let reportParams = await this.saveReport(res, true) let reportParams = await this.saveReport(res, true)
this.$emit('submitReport', reportParams) this.$emit('submitReport', reportParams)
} }
} }
......
const CUSTOMER_TAGS = {
1: '已触客',
2: '已拉群',
3: '已交付引荐',
4: '首保维保客户 ',
5: '事故车客户'
}
module.exports = { module.exports = {
data: { data: {
CUSTOMER_TAGS,
orderObj: [ orderObj: [
{ {
label: '工单编号', label: '工单编号',
...@@ -29,6 +37,21 @@ module.exports = { ...@@ -29,6 +37,21 @@ module.exports = {
key: 'customerName' key: 'customerName'
}, },
{ {
label: '日报标签',
key: 'customerTags',
format: data => {
return data
.split(',')
.map(item => CUSTOMER_TAGS[item])
.join('/')
}
},
{
label: '实际交付日期',
key: 'actualDeliveryDate',
format: val => dayjs(val).format('YYYY-MM-DD')
},
{
label: '性别', label: '性别',
key: 'customerSex', key: 'customerSex',
enum: { enum: {
...@@ -220,7 +243,7 @@ module.exports = { ...@@ -220,7 +243,7 @@ module.exports = {
goodsOrderApplyStatus: { goodsOrderApplyStatus: {
0: '审批中', //区域运营待审核 0: '审批中', //区域运营待审核
1: '审批通过', //线上运营待审核 1: '审批通过', //线上运营待审核
2: '审批驳回', 2: '审批驳回'
}, },
orderType: { orderType: {
1: '正常订单', 1: '正常订单',
...@@ -228,7 +251,7 @@ module.exports = { ...@@ -228,7 +251,7 @@ module.exports = {
3: '买赠策略', 3: '买赠策略',
4: '冲量活动', 4: '冲量活动',
5: '组合付款', 5: '组合付款',
6:'内部结算' 6: '内部结算'
} }
} }
} }
...@@ -5,18 +5,16 @@ ...@@ -5,18 +5,16 @@
<view class="box"> <view class="box">
<scroll-view class="scroll-view" scroll-y="true"> <scroll-view class="scroll-view" scroll-y="true">
<view class="box-content"> <view class="box-content">
<GlCell :formList="formList" :formData="orderObj" @radioChange="radioChange" @inputBlur="inputBlur" @handleCell="handleCell" :titleList="titleList"> <GlCell :formList="formList" :formData="orderObj" @radioChange="radioChange" @inputBlur="inputBlur"
@handleCell="handleCell" :titleList="titleList" @confirmCalendar="confirmCalendar">
<template slot="customer"> <template slot="customer">
<view class="customer-title flex"> <view class="customer-title flex">
客户信息 客户信息
<view <view class="customer-file flex" @click="
class="customer-file flex" handleCell({
@click=" key: 'customer'
handleCell({ })
key: 'customer' ">
})
"
>
<view class="sprite-icon icon-customer-list"></view> <view class="sprite-icon icon-customer-list"></view>
客户档案 客户档案
</view> </view>
...@@ -24,7 +22,9 @@ ...@@ -24,7 +22,9 @@
</template> </template>
<template slot="skuGoods"> <template slot="skuGoods">
<template v-if="orderObj.skuGoods.length"> <template v-if="orderObj.skuGoods.length">
<SkuGoods :list="orderObj.skuGoods" @changeTotalPrice="changeTotalPrice" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData" :orderTypeCode="orderObj.orderTypeCode"></SkuGoods> <SkuGoods :list="orderObj.skuGoods" @changeTotalPrice="changeTotalPrice"
:positionTypeList="positionTypeList" :baseConfigData="baseConfigData"
:orderTypeCode="orderObj.orderTypeCode"></SkuGoods>
</template> </template>
<template v-if="orderObj.total > 0"> <template v-if="orderObj.total > 0">
<view class="total"> <view class="total">
...@@ -46,7 +46,8 @@ ...@@ -46,7 +46,8 @@
</view> </view>
</view> </view>
<!-- 弹窗 --> <!-- 弹窗 -->
<order-popup ref="orderPopup" :data="orderObj" :dataKey="valueKey" @onConfirm="onConfirm" :externalData="externalData" :popupType="popupType" :popupTitle="popupTitle" /> <order-popup ref="orderPopup" :data="orderObj" :dataKey="valueKey" @onConfirm="onConfirm"
:externalData="externalData" :popupType="popupType" :popupTitle="popupTitle" />
<template v-if="showUpload"> <template v-if="showUpload">
<view class="upload-box"> <view class="upload-box">
<upload-proof-of-payment @back="clearPayMentDocList" @confirm="uploadConfirm" /> <upload-proof-of-payment @back="clearPayMentDocList" @confirm="uploadConfirm" />
...@@ -120,6 +121,31 @@ export default { ...@@ -120,6 +121,31 @@ export default {
}, },
deep: true, deep: true,
immediate: true immediate: true
},
"orderObj.salesType": {
handler(newVal) {
const selected = Boolean(this.orderObj && (this.orderObj.baseSceneCodeValue || this.orderObj.baseSceneCode))
console.log(newVal, 'newVal')
let formList = this.formList
formList.map(item => {
item.map(child => {
if (child.value == 'customerTags') {
let hidden = !selected || newVal == 2
child.hidden = hidden
if (hidden) this.$set(this.orderObj, 'customerTags', [])
}
if (child.value == 'actualDeliveryDate') {
let hidden = ![0].includes(+newVal) || !selected
child.hidden = hidden
if (hidden) this.$set(this.orderObj, 'actualDeliveryDate', '')
}
})
})
this.formList = formList
},
immediate: true,
deep: true
} }
}, },
data() { data() {
...@@ -149,7 +175,9 @@ export default { ...@@ -149,7 +175,9 @@ export default {
ownerGender: '男', ownerGender: '男',
salesType: '0', salesType: '0',
carInfo: {}, carInfo: {},
price: '' price: '',
customerTags: [], // 日报标签
actualDeliveryDate: '', // 实际交付日期
}, // 弹窗传入的数据}, }, // 弹窗传入的数据},
popupType: 0, popupType: 0,
popupTypeEnum, popupTypeEnum,
...@@ -184,11 +212,11 @@ export default { ...@@ -184,11 +212,11 @@ export default {
this.initData() this.initData()
}, },
methods: { methods: {
updateSceneGate () { updateSceneGate() {
const selected = Boolean(this.orderObj && (this.orderObj.baseSceneCodeValue || this.orderObj.baseSceneCode)) const selected = Boolean(this.orderObj && (this.orderObj.baseSceneCodeValue || this.orderObj.baseSceneCode))
const list = this.formList || [] const list = this.formList || []
list.forEach(group => { list.forEach(group => {
;(group || []).forEach(item => { ; (group || []).forEach(item => {
if (!item) return if (!item) return
if (item._originHidden === undefined) item._originHidden = Boolean(item.hidden) if (item._originHidden === undefined) item._originHidden = Boolean(item.hidden)
if (!selected) { if (!selected) {
...@@ -201,7 +229,7 @@ export default { ...@@ -201,7 +229,7 @@ export default {
this.formList = list this.formList = list
return selected return selected
}, },
async initRecentSceneEcho () { async initRecentSceneEcho() {
try { try {
const userInfo = this.userInfo || (uni.$storage.get('userInfo') || {}) const userInfo = this.userInfo || (uni.$storage.get('userInfo') || {})
const phone = userInfo.phone const phone = userInfo.phone
...@@ -231,7 +259,7 @@ export default { ...@@ -231,7 +259,7 @@ export default {
// 同步表单展示(GlCell 部分字段依赖 current) // 同步表单展示(GlCell 部分字段依赖 current)
const sceneCell = this.formList?.[0]?.find(v => v && v.value === 'baseSceneCode') const sceneCell = this.formList?.[0]?.find(v => v && v.value === 'baseSceneCode')
if (sceneCell) sceneCell.current = item.name || item.staffName || '' if (sceneCell) sceneCell.current = item.name || item.staffName || ''
} catch (e) {} } catch (e) { }
}, },
async getQuotationInfoById(id) { async getQuotationInfoById(id) {
try { try {
...@@ -584,7 +612,7 @@ export default { ...@@ -584,7 +612,7 @@ export default {
0: pointsMultiRole == 'Y' ? '销售顾问/录单员' : '推荐人', 0: pointsMultiRole == 'Y' ? '销售顾问/录单员' : '推荐人',
4: '车型', 4: '车型',
13: payType == 2 ? '4S店收款时间' : '嘀加收款时间', 13: payType == 2 ? '4S店收款时间' : '嘀加收款时间',
29:'确认业务场景名称' 29: '确认业务场景名称'
}[this.popupType] }[this.popupType]
// 确保 orderPopup 引用存在后再调用 open 方法 // 确保 orderPopup 引用存在后再调用 open 方法
if (this.$refs.orderPopup && this.$refs.orderPopup.open) { if (this.$refs.orderPopup && this.$refs.orderPopup.open) {
...@@ -595,8 +623,19 @@ export default { ...@@ -595,8 +623,19 @@ export default {
}, },
// 单选框change事件 // 单选框change事件
radioChange(e, val) { radioChange(e, val) {
this.$set(this.orderObj, val.value, e.detail.value) if (val.multiple) {
if (val.value == 'payee') this.changePayee() let key = val.value,
value = this.orderObj[key] || []
if (value.includes(e)) {
value = value.filter(item => item !== e)
} else {
value.push(e)
}
this.$set(this.orderObj, key, value)
} else {
this.$set(this.orderObj, val.value, e.detail.value)
if (val.value == 'payee') this.changePayee()
}
}, },
// 弹窗确认回调 // 弹窗确认回调
onConfirm(val, flag) { onConfirm(val, flag) {
...@@ -1184,12 +1223,19 @@ export default { ...@@ -1184,12 +1223,19 @@ export default {
return pre return pre
}, []) }, [])
let keyList = ['mode', 'payee', 'payType', 'referrerId', 'referrer', 'deliveryId', 'deliveryName', 'total', 'notes', 'tradeNo', 'transactionNo', 'paymentDocList', 'id', 'orderId', 'pay2Time'], let keyList = ['mode', 'payee', 'payType', 'referrerId', 'referrer', 'deliveryId', 'deliveryName', 'total', 'notes', 'tradeNo', 'transactionNo', 'paymentDocList', 'id', 'orderId', 'pay2Time'],
customerKeyList = ['owner', 'phone', 'certificateNo', 'carVin', 'seat', 'price', 'ownerGender', 'city', 'ageRange', 'hobby', 'companion', 'carColor', 'salesType'] customerKeyList = ['owner', 'phone', 'certificateNo', 'carVin', 'seat', 'price', 'ownerGender', 'city', 'ageRange', 'hobby', 'companion', 'carColor', 'salesType', 'customerTags', 'actualDeliveryDate']
keyList.map(key => { keyList.map(key => {
if (orderInfo[key] != null) params[key] = orderInfo[key] if (orderInfo[key] != null) params[key] = orderInfo[key]
}) })
customerKeyList.map(key => { customerKeyList.map(key => {
if (orderInfo[key] != null) params.owner[key] = orderInfo[key] if (orderInfo[key] != null) {
if (key == 'customerTags'){
if(orderInfo[key].length > 0) orderInfo[key] = orderInfo[key].join(',')
else orderInfo[key] = ''
}
if (orderInfo[key] && key == 'actualDeliveryDate') orderInfo[key] += ' 00:00:00'
params.owner[key] = orderInfo[key]
}
}) })
if (orderInfo.ownerId) params.owner.id = orderInfo.ownerId if (orderInfo.ownerId) params.owner.id = orderInfo.ownerId
return params return params
...@@ -1394,7 +1440,9 @@ export default { ...@@ -1394,7 +1440,9 @@ export default {
certificateNo: customerInfo.customerCertificateNo || '', certificateNo: customerInfo.customerCertificateNo || '',
salesType, salesType,
carVin: customerInfo.carVin || '', carVin: customerInfo.carVin || '',
carColor: customerInfo.carColor || '' carColor: customerInfo.carColor || '',
customerTags: customerInfo.customerTags || [],
actualDeliveryDate: customerInfo.actualDeliveryDate ? dayjs(customerInfo.actualDeliveryDate).format('YYYY-MM-DD') : ''
}) })
this.formList[1].map(e => { this.formList[1].map(e => {
if (e.value == 'salesType') e.current = salesType if (e.value == 'salesType') e.current = salesType
...@@ -1465,7 +1513,12 @@ export default { ...@@ -1465,7 +1513,12 @@ export default {
this.showUpload = false this.showUpload = false
this.orderObj.paymentDocList = [] this.orderObj.paymentDocList = []
this.orderObj.transactionNo = '' this.orderObj.transactionNo = ''
} },
// 选择日期事件
confirmCalendar(e, key) {
let value = e.fulldate
this.$set(this.orderObj, key, value)
},
} }
} }
</script> </script>
...@@ -1474,14 +1527,17 @@ export default { ...@@ -1474,14 +1527,17 @@ export default {
.order { .order {
height: 100%; height: 100%;
position: relative; position: relative;
&-box { &-box {
visibility: visible; visibility: visible;
height: 100%; height: 100%;
} }
.hide { .hide {
opacity: 0; opacity: 0;
visibility: hidden; visibility: hidden;
} }
.upload-box { .upload-box {
position: absolute; position: absolute;
left: 0; left: 0;
...@@ -1528,9 +1584,11 @@ export default { ...@@ -1528,9 +1584,11 @@ export default {
font-size: toRpx(24); font-size: toRpx(24);
color: #999; color: #999;
} }
.btns { .btns {
padding: toRpx(24) toRpx(128); padding: toRpx(24) toRpx(128);
gap: toRpx(32); gap: toRpx(32);
.save { .save {
background: #3b73ff1a; background: #3b73ff1a;
color: #4673ff; color: #4673ff;
...@@ -1538,6 +1596,7 @@ export default { ...@@ -1538,6 +1596,7 @@ export default {
font-weight: 500; font-weight: 500;
} }
} }
.btn { .btn {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -1548,11 +1607,13 @@ export default { ...@@ -1548,11 +1607,13 @@ export default {
border-radius: toRpx(48); border-radius: toRpx(48);
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%); background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
} }
.customer-title { .customer-title {
.customer-file { .customer-file {
margin-left: toRpx(20); margin-left: toRpx(20);
color: #347bff; color: #347bff;
font-size: toRpx(24); font-size: toRpx(24);
.sprite-icon { .sprite-icon {
margin-right: toRpx(4); margin-right: toRpx(4);
} }
......
...@@ -60,6 +60,29 @@ const FORM_LIST = [ ...@@ -60,6 +60,29 @@ const FORM_LIST = [
required: true required: true
}, },
{ {
hidden: false,
label: '日报标签',
value: 'customerTags',
type: 'radio',
multiple: true,
radioList: [
{
value: '1',
name: '已触客'
},
{
value: '3',
name: '已交付引荐'
},
]
},
{
hidden: false,
label: '实际交付日期',
value: 'actualDeliveryDate',
type:"single-calendar"
},
{
label: '性别', label: '性别',
value: 'ownerGender', value: 'ownerGender',
type: 'radio', type: 'radio',
......
...@@ -203,7 +203,7 @@ export default { ...@@ -203,7 +203,7 @@ export default {
}, },
async entranceClick (item) { async entranceClick (item) {
if (this.toolComponentName == item.name) return if (this.toolComponentName == item.name) return
const noInterceptPage = ['DailyReport'] const noInterceptPage = ['DailyReport','storeDailyReport']
// if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return // if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return
if (!noInterceptPage.includes(item.name) && (await this.checkDailyReport())) return if (!noInterceptPage.includes(item.name) && (await this.checkDailyReport())) return
// 提示去学习中心弹窗 // 提示去学习中心弹窗
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!