Commit d59d9149 by 岑成威

fix: 场景选择

1 parent f5c584e8
<template> <template>
<view class="scene-list"> <view class="scene-list">
<template v-for="(i, index) in listData"> <view
v-for="(i, index) in listData"
:key="index"
@click="choose(i)"
:class="['item flex', { active: checkActive(i) }]"
>
<view <view
:key="index" class="scene-type-tag"
@click="choose(i)" :style="{ background: sceneTag.bg, color: sceneTag.color }"
:class="['item flex', { active: checkActive(i) }]" >{{ sceneTag.label }}</view>
> <view class="sprite-icon icon-tag-checked"></view>
<view {{ i.name || i.staffName }}
class="scene-type-tag" </view>
:style="{ background: sceneTag.bg, color: sceneTag.color }"
>{{ sceneTag.label }}</view>
<view class="sprite-icon icon-tag-checked"></view>
{{ i.staffName }}
</view>
</template>
</view> </view>
</template> </template>
...@@ -21,22 +20,22 @@ ...@@ -21,22 +20,22 @@
import popupmixin from './popupmixin' import popupmixin from './popupmixin'
const SCENE_TYPE_TAG_MAP = { const SCENE_TYPE_TAG_MAP = {
0: { label: '轻改', bg: '#5575f51a', color: '#5575f5' }, 1: { label: '轻改', bg: '#5575f51a', color: '#5575f5' },
1: { label: '权益', bg: '#4bc8fe1a', color: '#4bc8fe' }, 0: { label: '权益', bg: '#4bc8fe1a', color: '#4bc8fe' },
2: { label: '保险', bg: '#00baad1a', color: '#00baad' }, 2: { label: '保险', bg: '#00baad1a', color: '#00baad' },
7: { label: '二手车', bg: '#fe624b1a', color: '#fe624b' }, 7: { label: '二手车', bg: '#fe624b1a', color: '#fe624b' },
4: { label: '其他', bg: '#ff9d2e1a', color: '#ff9d2e' } 4: { label: '其他', bg: '#ff9d2e1a', color: '#ff9d2e' }
} }
const MOCK_SCENE_LIST = [ const MOCK_SCENE_LIST = [
{ uuid: '100101', staffName: '精品升级', baseSceneCode: '100101', sceneType: 1, businessType: null }, { uuid: '100101', name: '精品升级', baseSceneCode: '100101', sceneType: 1, businessType: null },
{ uuid: '100102', staffName: '交新车干配', baseSceneCode: '100102', sceneType: 2, businessType: null }, { uuid: '100102', name: '交新车干配', baseSceneCode: '100102', sceneType: 2, businessType: null },
{ uuid: '100103', staffName: '售后众筹', baseSceneCode: '100103', sceneType: 3, businessType: null }, { uuid: '100103', name: '售后众筹', baseSceneCode: '100103', sceneType: 3, businessType: null },
{ uuid: '110101', staffName: '售前会员权益升级', baseSceneCode: '110101', sceneType: 0, businessType: 1 }, { uuid: '110101', name: '售前会员权益升级', baseSceneCode: '110101', sceneType: 0, businessType: 1 },
{ uuid: '110102', staffName: '售后会员权益升级', baseSceneCode: '110102', sceneType: 0, businessType: 1 }, { uuid: '110102', name: '售后会员权益升级', baseSceneCode: '110102', sceneType: 0, businessType: 1 },
{ uuid: '110201', staffName: '售前延保', baseSceneCode: '110201', sceneType: 0, businessType: 2 }, { uuid: '110201', name: '售前延保', baseSceneCode: '110201', sceneType: 0, businessType: 2 },
{ uuid: '110202', staffName: '售后延保', baseSceneCode: '110202', sceneType: 0, businessType: 2 }, { uuid: '110202', name: '售后延保', baseSceneCode: '110202', sceneType: 0, businessType: 2 },
{ uuid: '120101', staffName: '二手车收车', baseSceneCode: '120101', sceneType: 7, businessType: null } { uuid: '120101', name: '二手车收车', baseSceneCode: '120101', sceneType: 7, businessType: null }
] ]
export default { export default {
...@@ -107,7 +106,8 @@ export default { ...@@ -107,7 +106,8 @@ export default {
employeeList = JSON.parse(JSON.stringify(list)), employeeList = JSON.parse(JSON.stringify(list)),
arr = [] arr = []
employeeList.map(e => { employeeList.map(e => {
if (e.staffName && e.staffName.toUpperCase().indexOf(searchValue) != -1) arr.push(e) const sceneName = e.name || e.staffName
if (sceneName && sceneName.toUpperCase().indexOf(searchValue) != -1) arr.push(e)
}) })
this.searchList = arr this.searchList = arr
this.searchStatus = true this.searchStatus = true
......
...@@ -4,12 +4,10 @@ ...@@ -4,12 +4,10 @@
<view class="sprite-icon icon-tag-checked"></view> <view class="sprite-icon icon-tag-checked"></view>
全部 全部
</view> </view>
<template v-for="(i, index) in list"> <view v-for="(i, index) in list" :key="index" @click="choose(i)" :class="['item flex', { active: checkActive(i) }]">
<view :key="index" @click="choose(i)" :class="['item flex', { active: checkActive(i) }]"> <view class="sprite-icon icon-tag-checked"></view>
<view class="sprite-icon icon-tag-checked"></view> {{ i.name || i.staffName }}
{{ i.staffName }} </view>
</view>
</template>
</view> </view>
</template> </template>
...@@ -43,6 +41,9 @@ ...@@ -43,6 +41,9 @@
this.getList() this.getList()
}, },
methods: { methods: {
getSceneId (item = {}) {
return item.baseSceneCode
},
async getList () { async getList () {
const { userInfo, params } = this, const { userInfo, params } = this,
{ cacheData } = params { cacheData } = params
...@@ -58,14 +59,14 @@ ...@@ -58,14 +59,14 @@
? data ? data
: [ : [
// 接口暂无数据时的临时模拟返回(来自 scene 表) // 接口暂无数据时的临时模拟返回(来自 scene 表)
{ uuid: '100101', staffName: '精品升级', baseSceneCode: '100101', sceneType: 1, businessType: null }, { uuid: '100101', name: '精品升级', baseSceneCode: '100101', sceneType: 1, businessType: null },
{ uuid: '100102', staffName: '交新车干配', baseSceneCode: '100102', sceneType: 2, businessType: null }, { uuid: '100102', name: '交新车干配', baseSceneCode: '100102', sceneType: 2, businessType: null },
{ uuid: '100103', staffName: '售后众筹', baseSceneCode: '100103', sceneType: 3, businessType: null }, { uuid: '100103', name: '售后众筹', baseSceneCode: '100103', sceneType: 3, businessType: null },
{ uuid: '110101', staffName: '售前会员权益升级', baseSceneCode: '110101', sceneType: 0, businessType: 1 }, { uuid: '110101', name: '售前会员权益升级', baseSceneCode: '110101', sceneType: 0, businessType: 1 },
{ uuid: '110102', staffName: '售后会员权益升级', baseSceneCode: '110102', sceneType: 0, businessType: 1 }, { uuid: '110102', name: '售后会员权益升级', baseSceneCode: '110102', sceneType: 0, businessType: 1 },
{ uuid: '110201', staffName: '售前延保', baseSceneCode: '110201', sceneType: 0, businessType: 2 }, { uuid: '110201', name: '售前延保', baseSceneCode: '110201', sceneType: 0, businessType: 2 },
{ uuid: '110202', staffName: '售后延保', baseSceneCode: '110202', sceneType: 0, businessType: 2 }, { uuid: '110202', name: '售后延保', baseSceneCode: '110202', sceneType: 0, businessType: 2 },
{ uuid: '120101', staffName: '二手车收车', baseSceneCode: '120101', sceneType: 7, businessType: null } { uuid: '120101', name: '二手车收车', baseSceneCode: '120101', sceneType: 7, businessType: null }
] ]
this.initList(list) this.initList(list)
...@@ -83,17 +84,19 @@ ...@@ -83,17 +84,19 @@
}, },
choose (i) { choose (i) {
if (i) { if (i) {
let { uuid } = i, const sceneId = this.getSceneId(i)
if (!sceneId) return
let
{ currentIds } = this, { currentIds } = this,
index = currentIds.indexOf(uuid) index = currentIds.indexOf(sceneId)
if (index == -1) this.currentIds.push(uuid) if (index == -1) this.currentIds.push(sceneId)
else this.currentIds.splice(index, 1) else this.currentIds.splice(index, 1)
} }
}, },
checkActive (i) { checkActive (i) {
let { currentIds } = this, let { currentIds } = this,
active = false active = false
if (currentIds.length) active = currentIds.includes(i.uuid) if (currentIds.length) active = currentIds.includes(this.getSceneId(i))
return active return active
// return this.currentIds.includes(i.uuid) // return this.currentIds.includes(i.uuid)
}, },
......
...@@ -4,12 +4,10 @@ ...@@ -4,12 +4,10 @@
<view class="sprite-icon icon-tag-checked"></view> <view class="sprite-icon icon-tag-checked"></view>
全部 全部
</view> </view>
<template v-for="(i, index) in list"> <view v-for="(i, index) in list" :key="index" @click="choose(i)" :class="['item flex', { active: checkActive(i) }]">
<view :key="index" @click="choose(i)" :class="['item flex', { active: checkActive(i) }]"> <view class="sprite-icon icon-tag-checked"></view>
<view class="sprite-icon icon-tag-checked"></view> {{ i.name || i.staffName }}
{{ i.staffName }} </view>
</view>
</template>
</view> </view>
</template> </template>
...@@ -43,6 +41,9 @@ ...@@ -43,6 +41,9 @@
this.getList() this.getList()
}, },
methods: { methods: {
getSceneId (item = {}) {
return item.baseSceneCode
},
async getList () { async getList () {
const { userInfo, params } = this, const { userInfo, params } = this,
{ cacheData } = params { cacheData } = params
...@@ -57,14 +58,14 @@ ...@@ -57,14 +58,14 @@
const list = (data && data.length) const list = (data && data.length)
? data ? data
: [ : [
{ uuid: '100101', staffName: '精品升级', baseSceneCode: '100101', sceneType: 1, businessType: null }, { uuid: '100101', name: '精品升级', baseSceneCode: '100101', sceneType: 1, businessType: null },
{ uuid: '100102', staffName: '交新车干配', baseSceneCode: '100102', sceneType: 2, businessType: null }, { uuid: '100102', name: '交新车干配', baseSceneCode: '100102', sceneType: 2, businessType: null },
{ uuid: '100103', staffName: '售后众筹', baseSceneCode: '100103', sceneType: 3, businessType: null }, { uuid: '100103', name: '售后众筹', baseSceneCode: '100103', sceneType: 3, businessType: null },
{ uuid: '110101', staffName: '售前会员权益升级', baseSceneCode: '110101', sceneType: 0, businessType: 1 }, { uuid: '110101', name: '售前会员权益升级', baseSceneCode: '110101', sceneType: 0, businessType: 1 },
{ uuid: '110102', staffName: '售后会员权益升级', baseSceneCode: '110102', sceneType: 0, businessType: 1 }, { uuid: '110102', name: '售后会员权益升级', baseSceneCode: '110102', sceneType: 0, businessType: 1 },
{ uuid: '110201', staffName: '售前延保', baseSceneCode: '110201', sceneType: 0, businessType: 2 }, { uuid: '110201', name: '售前延保', baseSceneCode: '110201', sceneType: 0, businessType: 2 },
{ uuid: '110202', staffName: '售后延保', baseSceneCode: '110202', sceneType: 0, businessType: 2 }, { uuid: '110202', name: '售后延保', baseSceneCode: '110202', sceneType: 0, businessType: 2 },
{ uuid: '120101', staffName: '二手车收车', baseSceneCode: '120101', sceneType: 7, businessType: null } { uuid: '120101', name: '二手车收车', baseSceneCode: '120101', sceneType: 7, businessType: null }
] ]
this.initList(list) this.initList(list)
params.cacheData = list params.cacheData = list
...@@ -81,17 +82,19 @@ ...@@ -81,17 +82,19 @@
}, },
choose (i) { choose (i) {
if (i) { if (i) {
let { uuid } = i, const sceneId = this.getSceneId(i)
if (!sceneId) return
let
{ currentIds } = this, { currentIds } = this,
index = currentIds.indexOf(uuid) index = currentIds.indexOf(sceneId)
if (index == -1) this.currentIds.push(uuid) if (index == -1) this.currentIds.push(sceneId)
else this.currentIds.splice(index, 1) else this.currentIds.splice(index, 1)
} }
}, },
checkActive (i) { checkActive (i) {
let { currentIds } = this, let { currentIds } = this,
active = false active = false
if (currentIds.length) active = currentIds.includes(i.uuid) if (currentIds.length) active = currentIds.includes(this.getSceneId(i))
return active return active
// return this.currentIds.includes(i.uuid) // return this.currentIds.includes(i.uuid)
}, },
......
...@@ -63,6 +63,13 @@ ...@@ -63,6 +63,13 @@
</view> </view>
<view class="payType flex align-center"> <view class="payType flex align-center">
<view class="payType-label">场景名称</view>
<view class="payType-value flex align-center">
{{ orderCardDetail.baseSceneName || '-' }}
</view>
</view>
<view class="payType flex align-center">
<view class="payType-label">审批状态</view> <view class="payType-label">审批状态</view>
<view class="payType-value flex align-center"> <view class="payType-value flex align-center">
{{ goodsOrderApplyStatus[orderCardDetail.goodsOrderApplyStatus] }} {{ goodsOrderApplyStatus[orderCardDetail.goodsOrderApplyStatus] }}
......
...@@ -92,6 +92,12 @@ export default { ...@@ -92,6 +92,12 @@ export default {
outTradeNo: outTradeNo.join(','), outTradeNo: outTradeNo.join(','),
tradeNo: tradeNo.join(',') tradeNo: tradeNo.join(',')
}) })
// 补录订单也需要默认订单类型(用于页面“订单类型”字段展示)
if (!this.orderObj.orderTypeCode) this.$set(this.orderObj, 'orderTypeCode', '1')
if (!this.orderObj.djOrderType) this.$set(this.orderObj, 'djOrderType', '正常订单')
const orderTypeCell = this.formList?.[2]?.find(item => item.value === 'djOrderType')
if (orderTypeCell) orderTypeCell.current = this.orderObj.djOrderType
return return
} }
// 编辑和修改订单进入这里 // 编辑和修改订单进入这里
...@@ -228,6 +234,7 @@ export default { ...@@ -228,6 +234,7 @@ export default {
payeeType: 1, payeeType: 1,
salesType: '0', salesType: '0',
orderTypeCode: '1', // 默认正常订单 orderTypeCode: '1', // 默认正常订单
djOrderType: '正常订单', // 默认正常订单(表单展示用)
frontGear: null, // 1 ,回显upgradeGoodsPosition == 1 frontGear: null, // 1 ,回显upgradeGoodsPosition == 1
frontWindow: null, // 2 frontWindow: null, // 2
rearWindow: null, // 3 rearWindow: null, // 3
...@@ -308,14 +315,14 @@ export default { ...@@ -308,14 +315,14 @@ export default {
if (!recentBaseSceneCode) return if (!recentBaseSceneCode) return
const MOCK_SCENE_LIST = [ const MOCK_SCENE_LIST = [
{ uuid: '100101', staffName: '精品升级', baseSceneCode: '100101', sceneType: 1, businessType: null }, { uuid: '100101', name: '精品升级', baseSceneCode: '100101', sceneType: 1, businessType: null },
{ uuid: '100102', staffName: '交新车干配', baseSceneCode: '100102', sceneType: 2, businessType: null }, { uuid: '100102', name: '交新车干配', baseSceneCode: '100102', sceneType: 2, businessType: null },
{ uuid: '100103', staffName: '售后众筹', baseSceneCode: '100103', sceneType: 3, businessType: null }, { uuid: '100103', name: '售后众筹', baseSceneCode: '100103', sceneType: 3, businessType: null },
{ uuid: '110101', staffName: '售前会员权益升级', baseSceneCode: '110101', sceneType: 0, businessType: 1 }, { uuid: '110101', name: '售前会员权益升级', baseSceneCode: '110101', sceneType: 0, businessType: 1 },
{ uuid: '110102', staffName: '售后会员权益升级', baseSceneCode: '110102', sceneType: 0, businessType: 1 }, { uuid: '110102', name: '售后会员权益升级', baseSceneCode: '110102', sceneType: 0, businessType: 1 },
{ uuid: '110201', staffName: '售前延保', baseSceneCode: '110201', sceneType: 0, businessType: 2 }, { uuid: '110201', name: '售前延保', baseSceneCode: '110201', sceneType: 0, businessType: 2 },
{ uuid: '110202', staffName: '售后延保', baseSceneCode: '110202', sceneType: 0, businessType: 2 }, { uuid: '110202', name: '售后延保', baseSceneCode: '110202', sceneType: 0, businessType: 2 },
{ uuid: '120101', staffName: '二手车收车', baseSceneCode: '120101', sceneType: 7, businessType: null } { uuid: '120101', name: '二手车收车', baseSceneCode: '120101', sceneType: 7, businessType: null }
] ]
// getSceneListWithOrder 有 Promise 缓存,不会重复发请求;接口无数据时 fallback 到 mock // getSceneListWithOrder 有 Promise 缓存,不会重复发请求;接口无数据时 fallback 到 mock
const rawList = await uni.$api.equityApi.getSceneListWithOrder({ const rawList = await uni.$api.equityApi.getSceneListWithOrder({
...@@ -326,7 +333,7 @@ export default { ...@@ -326,7 +333,7 @@ export default {
const item = listData.find(i => String(i.baseSceneCode || i.uuid) === String(recentBaseSceneCode)) const item = listData.find(i => String(i.baseSceneCode || i.uuid) === String(recentBaseSceneCode))
if (!item) return if (!item) return
this.$set(this.orderObj, 'baseSceneCode', item.staffName) this.$set(this.orderObj, 'baseSceneCode', item.name || item.staffName)
this.$set(this.orderObj, 'baseSceneCodeValue', item.baseSceneCode || item.uuid) this.$set(this.orderObj, 'baseSceneCodeValue', item.baseSceneCode || item.uuid)
this.$set(this.orderObj, 'sceneType', item.sceneType) this.$set(this.orderObj, 'sceneType', item.sceneType)
} catch (e) {} } catch (e) {}
...@@ -733,7 +740,7 @@ export default { ...@@ -733,7 +740,7 @@ export default {
}, 0) }, 0)
} else if (_typeValue.key === 'baseSceneCode') { } else if (_typeValue.key === 'baseSceneCode') {
// 场景名称:页面显示名称;提交时使用 code // 场景名称:页面显示名称;提交时使用 code
this.$set(this.orderObj, 'baseSceneCode', chooseContent.staffName) this.$set(this.orderObj, 'baseSceneCode', chooseContent.name || chooseContent.staffName)
this.$set(this.orderObj, 'baseSceneCodeValue', chooseContent.uuid) this.$set(this.orderObj, 'baseSceneCodeValue', chooseContent.uuid)
this.$set(this.orderObj, 'sceneType', chooseContent.sceneType) this.$set(this.orderObj, 'sceneType', chooseContent.sceneType)
// 选择后保存最近选中场景(sceneType 用登录场景) // 选择后保存最近选中场景(sceneType 用登录场景)
......
...@@ -324,14 +324,14 @@ export default { ...@@ -324,14 +324,14 @@ export default {
if (!recentBaseSceneCode) return if (!recentBaseSceneCode) return
const MOCK_SCENE_LIST = [ const MOCK_SCENE_LIST = [
{ uuid: '100101', staffName: '精品升级', baseSceneCode: '100101', sceneType: 1, businessType: null }, { uuid: '100101', name: '精品升级', baseSceneCode: '100101', sceneType: 1, businessType: null },
{ uuid: '100102', staffName: '交新车干配', baseSceneCode: '100102', sceneType: 2, businessType: null }, { uuid: '100102', name: '交新车干配', baseSceneCode: '100102', sceneType: 2, businessType: null },
{ uuid: '100103', staffName: '售后众筹', baseSceneCode: '100103', sceneType: 3, businessType: null }, { uuid: '100103', name: '售后众筹', baseSceneCode: '100103', sceneType: 3, businessType: null },
{ uuid: '110101', staffName: '售前会员权益升级', baseSceneCode: '110101', sceneType: 0, businessType: 1 }, { uuid: '110101', name: '售前会员权益升级', baseSceneCode: '110101', sceneType: 0, businessType: 1 },
{ uuid: '110102', staffName: '售后会员权益升级', baseSceneCode: '110102', sceneType: 0, businessType: 1 }, { uuid: '110102', name: '售后会员权益升级', baseSceneCode: '110102', sceneType: 0, businessType: 1 },
{ uuid: '110201', staffName: '售前延保', baseSceneCode: '110201', sceneType: 0, businessType: 2 }, { uuid: '110201', name: '售前延保', baseSceneCode: '110201', sceneType: 0, businessType: 2 },
{ uuid: '110202', staffName: '售后延保', baseSceneCode: '110202', sceneType: 0, businessType: 2 }, { uuid: '110202', name: '售后延保', baseSceneCode: '110202', sceneType: 0, businessType: 2 },
{ uuid: '120101', staffName: '二手车收车', baseSceneCode: '120101', sceneType: 7, businessType: null } { uuid: '120101', name: '二手车收车', baseSceneCode: '120101', sceneType: 7, businessType: null }
] ]
// getSceneListWithOrder 有 Promise 缓存,不会重复发请求;接口无数据时 fallback 到 mock // getSceneListWithOrder 有 Promise 缓存,不会重复发请求;接口无数据时 fallback 到 mock
const rawList = await uni.$api.equityApi.getSceneListWithOrder({ const rawList = await uni.$api.equityApi.getSceneListWithOrder({
...@@ -342,7 +342,7 @@ export default { ...@@ -342,7 +342,7 @@ export default {
const item = listData.find(i => String(i.baseSceneCode || i.uuid) === String(recentBaseSceneCode)) const item = listData.find(i => String(i.baseSceneCode || i.uuid) === String(recentBaseSceneCode))
if (!item) return if (!item) return
this.$set(this.orderObj, 'baseSceneCode', item.staffName) this.$set(this.orderObj, 'baseSceneCode', item.name || item.staffName)
this.$set(this.orderObj, 'baseSceneCodeValue', item.baseSceneCode || item.uuid) this.$set(this.orderObj, 'baseSceneCodeValue', item.baseSceneCode || item.uuid)
this.$set(this.orderObj, 'sceneType', item.sceneType) this.$set(this.orderObj, 'sceneType', item.sceneType)
} catch (e) {} } catch (e) {}
...@@ -467,7 +467,7 @@ export default { ...@@ -467,7 +467,7 @@ export default {
this.$set(this.orderObj, 'createDate', dayjs(chooseContent).format('YYYY-MM-DD')) this.$set(this.orderObj, 'createDate', dayjs(chooseContent).format('YYYY-MM-DD'))
} else if (_typeValue.key === 'baseSceneCode') { } else if (_typeValue.key === 'baseSceneCode') {
// 场景名称:页面显示名称;接口参数使用 code // 场景名称:页面显示名称;接口参数使用 code
this.$set(this.orderObj, 'baseSceneCode', chooseContent.staffName) this.$set(this.orderObj, 'baseSceneCode', chooseContent.name || chooseContent.staffName)
this.$set(this.orderObj, 'baseSceneCodeValue', chooseContent.uuid) this.$set(this.orderObj, 'baseSceneCodeValue', chooseContent.uuid)
this.$set(this.orderObj, 'sceneType', chooseContent.sceneType) this.$set(this.orderObj, 'sceneType', chooseContent.sceneType)
// 选择后保存最近选中场景(sceneType 用登录场景) // 选择后保存最近选中场景(sceneType 用登录场景)
......
...@@ -217,14 +217,14 @@ export default { ...@@ -217,14 +217,14 @@ export default {
if (!recentBaseSceneCode) return if (!recentBaseSceneCode) return
const MOCK_SCENE_LIST = [ const MOCK_SCENE_LIST = [
{ uuid: '100101', staffName: '精品升级', baseSceneCode: '100101', sceneType: 1, businessType: null }, { uuid: '100101', name: '精品升级', baseSceneCode: '100101', sceneType: 1, businessType: null },
{ uuid: '100102', staffName: '交新车干配', baseSceneCode: '100102', sceneType: 2, businessType: null }, { uuid: '100102', name: '交新车干配', baseSceneCode: '100102', sceneType: 2, businessType: null },
{ uuid: '100103', staffName: '售后众筹', baseSceneCode: '100103', sceneType: 3, businessType: null }, { uuid: '100103', name: '售后众筹', baseSceneCode: '100103', sceneType: 3, businessType: null },
{ uuid: '110101', staffName: '售前会员权益升级', baseSceneCode: '110101', sceneType: 0, businessType: 1 }, { uuid: '110101', name: '售前会员权益升级', baseSceneCode: '110101', sceneType: 0, businessType: 1 },
{ uuid: '110102', staffName: '售后会员权益升级', baseSceneCode: '110102', sceneType: 0, businessType: 1 }, { uuid: '110102', name: '售后会员权益升级', baseSceneCode: '110102', sceneType: 0, businessType: 1 },
{ uuid: '110201', staffName: '售前延保', baseSceneCode: '110201', sceneType: 0, businessType: 2 }, { uuid: '110201', name: '售前延保', baseSceneCode: '110201', sceneType: 0, businessType: 2 },
{ uuid: '110202', staffName: '售后延保', baseSceneCode: '110202', sceneType: 0, businessType: 2 }, { uuid: '110202', name: '售后延保', baseSceneCode: '110202', sceneType: 0, businessType: 2 },
{ uuid: '120101', staffName: '二手车收车', baseSceneCode: '120101', sceneType: 7, businessType: null } { uuid: '120101', name: '二手车收车', baseSceneCode: '120101', sceneType: 7, businessType: null }
] ]
// getSceneListWithOrder 有 Promise 缓存,不会重复发请求;接口无数据时 fallback 到 mock // getSceneListWithOrder 有 Promise 缓存,不会重复发请求;接口无数据时 fallback 到 mock
const rawList = await uni.$api.equityApi.getSceneListWithOrder({ const rawList = await uni.$api.equityApi.getSceneListWithOrder({
...@@ -235,7 +235,7 @@ export default { ...@@ -235,7 +235,7 @@ export default {
const item = listData.find(i => String(i.baseSceneCode || i.uuid) === String(recentBaseSceneCode)) const item = listData.find(i => String(i.baseSceneCode || i.uuid) === String(recentBaseSceneCode))
if (!item) return if (!item) return
this.$set(this.orderObj, 'baseSceneCode', item.staffName) this.$set(this.orderObj, 'baseSceneCode', item.name || item.staffName)
this.$set(this.orderObj, 'baseSceneCodeValue', item.baseSceneCode || item.uuid) this.$set(this.orderObj, 'baseSceneCodeValue', item.baseSceneCode || item.uuid)
this.$set(this.orderObj, 'sceneType', item.sceneType) this.$set(this.orderObj, 'sceneType', item.sceneType)
} catch (e) {} } catch (e) {}
...@@ -647,7 +647,7 @@ export default { ...@@ -647,7 +647,7 @@ export default {
this.$set(this.orderObj, 'city', chooseContent.city == chooseContent.province ? chooseContent.city : `${chooseContent.province}-${chooseContent.city}`) this.$set(this.orderObj, 'city', chooseContent.city == chooseContent.province ? chooseContent.city : `${chooseContent.province}-${chooseContent.city}`)
} else if (_typeValue.key === 'baseSceneCode') { } else if (_typeValue.key === 'baseSceneCode') {
// 场景名称:界面显示名称;提交时使用 code // 场景名称:界面显示名称;提交时使用 code
this.$set(this.orderObj, 'baseSceneCode', chooseContent.staffName) this.$set(this.orderObj, 'baseSceneCode', chooseContent.name || chooseContent.staffName)
this.$set(this.orderObj, 'baseSceneCodeValue', chooseContent.uuid) this.$set(this.orderObj, 'baseSceneCodeValue', chooseContent.uuid)
this.$set(this.orderObj, 'sceneType', chooseContent.sceneType) this.$set(this.orderObj, 'sceneType', chooseContent.sceneType)
// 选择后保存最近选中场景(sceneType 用登录场景) // 选择后保存最近选中场景(sceneType 用登录场景)
......
...@@ -209,14 +209,14 @@ export default { ...@@ -209,14 +209,14 @@ export default {
if (!recentBaseSceneCode) return if (!recentBaseSceneCode) return
const MOCK_SCENE_LIST = [ const MOCK_SCENE_LIST = [
{ uuid: '100101', staffName: '精品升级', baseSceneCode: '100101', sceneType: 1, businessType: null }, { uuid: '100101', name: '精品升级', baseSceneCode: '100101', sceneType: 1, businessType: null },
{ uuid: '100102', staffName: '交新车干配', baseSceneCode: '100102', sceneType: 2, businessType: null }, { uuid: '100102', name: '交新车干配', baseSceneCode: '100102', sceneType: 2, businessType: null },
{ uuid: '100103', staffName: '售后众筹', baseSceneCode: '100103', sceneType: 3, businessType: null }, { uuid: '100103', name: '售后众筹', baseSceneCode: '100103', sceneType: 3, businessType: null },
{ uuid: '110101', staffName: '售前会员权益升级', baseSceneCode: '110101', sceneType: 0, businessType: 1 }, { uuid: '110101', name: '售前会员权益升级', baseSceneCode: '110101', sceneType: 0, businessType: 1 },
{ uuid: '110102', staffName: '售后会员权益升级', baseSceneCode: '110102', sceneType: 0, businessType: 1 }, { uuid: '110102', name: '售后会员权益升级', baseSceneCode: '110102', sceneType: 0, businessType: 1 },
{ uuid: '110201', staffName: '售前延保', baseSceneCode: '110201', sceneType: 0, businessType: 2 }, { uuid: '110201', name: '售前延保', baseSceneCode: '110201', sceneType: 0, businessType: 2 },
{ uuid: '110202', staffName: '售后延保', baseSceneCode: '110202', sceneType: 0, businessType: 2 }, { uuid: '110202', name: '售后延保', baseSceneCode: '110202', sceneType: 0, businessType: 2 },
{ uuid: '120101', staffName: '二手车收车', baseSceneCode: '120101', sceneType: 7, businessType: null } { uuid: '120101', name: '二手车收车', baseSceneCode: '120101', sceneType: 7, businessType: null }
] ]
// getSceneListWithOrder 有 Promise 缓存,不会重复发请求;接口无数据时 fallback 到 mock // getSceneListWithOrder 有 Promise 缓存,不会重复发请求;接口无数据时 fallback 到 mock
const rawList = await uni.$api.equityApi.getSceneListWithOrder({ const rawList = await uni.$api.equityApi.getSceneListWithOrder({
...@@ -227,7 +227,7 @@ export default { ...@@ -227,7 +227,7 @@ export default {
const item = listData.find(i => String(i.baseSceneCode || i.uuid) === String(recentBaseSceneCode)) const item = listData.find(i => String(i.baseSceneCode || i.uuid) === String(recentBaseSceneCode))
if (!item) return if (!item) return
this.$set(this.orderObj, 'baseSceneCode', item.staffName) this.$set(this.orderObj, 'baseSceneCode', item.name || item.staffName)
this.$set(this.orderObj, 'baseSceneCodeValue', item.baseSceneCode || item.uuid) this.$set(this.orderObj, 'baseSceneCodeValue', item.baseSceneCode || item.uuid)
this.$set(this.orderObj, 'sceneType', item.sceneType) this.$set(this.orderObj, 'sceneType', item.sceneType)
} catch (e) {} } catch (e) {}
...@@ -369,7 +369,7 @@ export default { ...@@ -369,7 +369,7 @@ export default {
this.$set(this.orderObj, 'createDate', dayjs(chooseContent).format('YYYY-MM-DD')) this.$set(this.orderObj, 'createDate', dayjs(chooseContent).format('YYYY-MM-DD'))
} else if (_typeValue.key === 'baseSceneCode') { } else if (_typeValue.key === 'baseSceneCode') {
// 场景名称:页面显示名称;后续接口参数使用 sceneType/code // 场景名称:页面显示名称;后续接口参数使用 sceneType/code
this.$set(this.orderObj, 'baseSceneCode', chooseContent.staffName) this.$set(this.orderObj, 'baseSceneCode', chooseContent.name || chooseContent.staffName)
this.$set(this.orderObj, 'baseSceneCodeValue', chooseContent.uuid) this.$set(this.orderObj, 'baseSceneCodeValue', chooseContent.uuid)
this.$set(this.orderObj, 'sceneType', chooseContent.sceneType) this.$set(this.orderObj, 'sceneType', chooseContent.sceneType)
// 选择后保存最近选中场景(sceneType 用登录场景) // 选择后保存最近选中场景(sceneType 用登录场景)
...@@ -487,6 +487,11 @@ export default { ...@@ -487,6 +487,11 @@ export default {
let { default4SStoreInfo } = this.userInfo let { default4SStoreInfo } = this.userInfo
console.log(default4SStoreInfo, '4s店信息') console.log(default4SStoreInfo, '4s店信息')
let params = this.defaultMsg let params = this.defaultMsg
// 业务场景(与新建工单一致:提交使用 code;页面展示用 name)
params.baseSceneCode = this.orderObj.baseSceneCodeValue || this.orderObj.baseSceneCode
if (this.orderObj.sceneType !== undefined && this.orderObj.sceneType !== null) {
params.sceneType = this.orderObj.sceneType
}
params.owner.owner = this.orderObj.customerName params.owner.owner = this.orderObj.customerName
params.owner.phone = this.orderObj.customerPhone params.owner.phone = this.orderObj.customerPhone
params.owner.salesType = this.orderObj.salesType params.owner.salesType = this.orderObj.salesType
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<view class="order-list align-center"> <view class="order-list align-center">
<view class="order flex align-center"> <view class="order flex align-center">
<view class="order-label">场景名称</view> <view class="order-label">场景名称</view>
<view class="order-value flex">{{ goodsOrderApplyStatus[orderCardDetail.approveStatus] || '-' }}</view> <view class="order-value flex">{{ orderCardDetail.baseSceneName || '-' }}</view>
</view> </view>
</view> </view>
<view class="order-list align-center"> <view class="order-list align-center">
......
...@@ -226,6 +226,13 @@ const FORM_LIST = [ ...@@ -226,6 +226,13 @@ const FORM_LIST = [
const DEFEAT_FORM_LIST = [ const DEFEAT_FORM_LIST = [
[ [
{ {
label: '场景名称',
value: 'baseSceneCode',
type: 'select',
key: 'baseSceneCode',
required: true
},
{
label: '战败日期', label: '战败日期',
value: 'todayShow', value: 'todayShow',
type: 'select', type: 'select',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!