Commit 95f7f0f6 by 李伟康

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

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