Commit 65b039d6 by 李伟康

```

feat(popup): 新增客户类型、证件类型等选项弹窗组件

新增多个通用选项选择弹窗组件,包括客户类型、证件类型、购车类型、车辆使用性质、品牌车系选择和变速箱类型。同时优化了弹窗配置结构和支持自定义样式与隐藏底部按钮功能。

改进了 GlCell 表单组件的功能,支持只读输入、标签提示、日历选择器及插槽内容渲染,并完善了事件传递逻辑。

更新权益创建页面以适配新的表单字段及交互需求,引入轮胎相关组件并调整默认值设置。

修复部分组件数据初始化和视图刷新问题,提升用户体验。
```
2 parents 9156330f 6478eff7
...@@ -2,7 +2,7 @@ import http from '../request/http' ...@@ -2,7 +2,7 @@ import http from '../request/http'
module.exports = { module.exports = {
/** 销售顾问/录单员 & 交付专员 */ /** 销售顾问/录单员 & 交付专员 */
getEmployeeList(data) { getEmployeeList (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.employee.onTheJob.getByMerchantId', method: 'dj.api.smartcarlife.employee.onTheJob.getByMerchantId',
projectName: 'boutique', projectName: 'boutique',
...@@ -13,7 +13,7 @@ module.exports = { ...@@ -13,7 +13,7 @@ module.exports = {
* 二级流量方 * 二级流量方
*/ */
getDiversionMerchantRef(data) { getDiversionMerchantRef (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.diversionMerchant.getDiversionMerchantRef', method: 'dj.api.smartcarlife.diversionMerchant.getDiversionMerchantRef',
projectName: 'boutique', projectName: 'boutique',
...@@ -24,7 +24,7 @@ module.exports = { ...@@ -24,7 +24,7 @@ module.exports = {
* 获取门店品牌车型 * 获取门店品牌车型
*/ */
getMerchantCarBrandList(data) { getMerchantCarBrandList (data) {
return http.post({ return http.post({
method: 'dj.api.get.car.brandList', method: 'dj.api.get.car.brandList',
projectName: 'boutique', projectName: 'boutique',
...@@ -36,7 +36,7 @@ module.exports = { ...@@ -36,7 +36,7 @@ module.exports = {
/*** /***
* 获取门店礼券列表 * 获取门店礼券列表
*/ */
getMerchantCouponList(data) { getMerchantCouponList (data) {
return http.post({ return http.post({
method: 'dj.api.smartCarLife.merchant.coupon.list', method: 'dj.api.smartCarLife.merchant.coupon.list',
projectName: 'boutique', projectName: 'boutique',
...@@ -46,7 +46,7 @@ module.exports = { ...@@ -46,7 +46,7 @@ module.exports = {
/** /**
* 获取客户礼券列表 * 获取客户礼券列表
*/ */
getCustomerCouponList(data) { getCustomerCouponList (data) {
return http.post({ return http.post({
method: 'dj.api.customer.coupon.list', method: 'dj.api.customer.coupon.list',
projectName: 'boutique', projectName: 'boutique',
...@@ -56,7 +56,7 @@ module.exports = { ...@@ -56,7 +56,7 @@ module.exports = {
/** /**
* 获取商品列表 * 获取商品列表
*/ */
getGoodsList(data) { getGoodsList (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.selectOrderGoods.list', method: 'dj.api.smartcarlife.selectOrderGoods.list',
projectName: 'boutique', projectName: 'boutique',
...@@ -65,7 +65,7 @@ module.exports = { ...@@ -65,7 +65,7 @@ module.exports = {
}, },
/**获取订单列表筛选转化人员&销售顾问 */ /**获取订单列表筛选转化人员&销售顾问 */
getOrderScreenEmployeeList(data) { getOrderScreenEmployeeList (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.employee.getByMerchantId', method: 'dj.api.smartcarlife.employee.getByMerchantId',
projectName: 'boutique', projectName: 'boutique',
...@@ -75,7 +75,7 @@ module.exports = { ...@@ -75,7 +75,7 @@ module.exports = {
/** /**
* 获取园区店配置 * 获取园区店配置
*/ */
getYqStoreConfig(data) { getYqStoreConfig (data) {
return http.get({ return http.get({
method: 'dj.api.smarcarlife.yqMerchantConfig.detail', method: 'dj.api.smarcarlife.yqMerchantConfig.detail',
projectName: 'boutique', projectName: 'boutique',
...@@ -86,7 +86,7 @@ module.exports = { ...@@ -86,7 +86,7 @@ module.exports = {
* 战败下单商品列表 * 战败下单商品列表
* *
*/ */
getOrderUpgradeGoodsList(data) { getOrderUpgradeGoodsList (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.orderUpgradeGoods.listByMerchantId', method: 'dj.api.smartcarlife.orderUpgradeGoods.listByMerchantId',
projectName: 'boutique', projectName: 'boutique',
...@@ -96,7 +96,7 @@ module.exports = { ...@@ -96,7 +96,7 @@ module.exports = {
/** /**
* 获取精品升级场景 太阳膜类商品部位数据 * 获取精品升级场景 太阳膜类商品部位数据
*/ */
getPositionList(data) { getPositionList (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.goodsPosition.list', method: 'dj.api.smartcarlife.goodsPosition.list',
projectName: 'boutique', projectName: 'boutique',
...@@ -107,7 +107,7 @@ module.exports = { ...@@ -107,7 +107,7 @@ module.exports = {
* 获取提单客户档案列表 * 获取提单客户档案列表
* *
*/ */
getQuotationCustomerList(data) { getQuotationCustomerList (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.customer.page', method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.customer.page',
projectName: 'boutique', projectName: 'boutique',
...@@ -115,7 +115,7 @@ module.exports = { ...@@ -115,7 +115,7 @@ module.exports = {
}) })
}, },
/**搜索订单(含套餐) */ /**搜索订单(含套餐) */
getWorkPackageGoodsList(data) { getWorkPackageGoodsList (data) {
let params = data || {} let params = data || {}
params.sceneType = 1 params.sceneType = 1
return http.post( return http.post(
...@@ -131,5 +131,31 @@ module.exports = { ...@@ -131,5 +131,31 @@ module.exports = {
'dj', 'dj',
1000000 1000000
) )
} },
/**
* 获取车品牌
*/
getCarBrandList (data = {}) {
return http.post({
method: 'scrm.api.carlife.common.getOnlyCarBrandList',
projectName: 'carlife',
...data
}, false, 'scrm')
},
/** 获取车系列表 */
getCarSeriesList (data = {}) {
return http.post({
method: 'scrm.api.carlife.common.getCarSeriesList',
projectName: 'carlife',
...data
}, false, 'scrm')
},
/** 获取车型 */
getCarTypeList (data = {}) {
return http.post({
method: 'scrm.api.carlife.common.getCarTypeList',
projectName: 'carlife',
...data
}, false, 'scrm')
},
} }
<template> <template>
<view <view class="gl-cell">
class="gl-cell"
v-if="formList.length"
>
<view <view
v-for="(items, boxIdx) in formList" v-for="(items, boxIdx) in formList"
:key="boxIdx" :key="boxIdx"
class="cell-box-block" class="cell-box-block"
> >
<view class="cell-box"> <view
class="cell-box"
v-if="items.length"
:style="cellBoxStyle"
>
<template v-if="titleList.length"> <template v-if="titleList.length">
<view <view
class="cell-title flex" class="cell-title flex"
...@@ -52,6 +53,12 @@ ...@@ -52,6 +53,12 @@
v-if="item.required" v-if="item.required"
class="required" class="required"
>*</view> >*</view>
<template v-if="item.labelTips">
<view
class="label-tips"
@click.stop="onLabelTipsClick(item)"
>{{ item.labelTips }}</view>
</template>
</view> </view>
<view class="cell-value"> <view class="cell-value">
<!-- 输入框 --> <!-- 输入框 -->
...@@ -66,6 +73,7 @@ ...@@ -66,6 +73,7 @@
:maxlength="item.maxlength ? item.maxlength : -1" :maxlength="item.maxlength ? item.maxlength : -1"
placeholder-class="input-placeholder" placeholder-class="input-placeholder"
@input="item.inputType === 'number' && item.maxlength ? (formData[item.value] = String($event.target.value).slice(0, item.maxlength)) : null" @input="item.inputType === 'number' && item.maxlength ? (formData[item.value] = String($event.target.value).slice(0, item.maxlength)) : null"
:readonly="item.readonly || false"
/> />
<view <view
v-if="item.valueIcon" v-if="item.valueIcon"
...@@ -123,6 +131,63 @@ ...@@ -123,6 +131,63 @@
:maxlength="item.maxlength" :maxlength="item.maxlength"
></textarea> ></textarea>
</template> </template>
<template v-else-if="item.type === 'single-calendar'">
<view
class="value"
@click="openCalendar(boxIdx,idx)"
>
<template v-if="!item.addHtml && formData[item.value]">
{{ formData[item.value] }}
</template>
<template v-else>
<span class="placeholder">请选择</span>
</template>
<view class="sprite-icon icon-icon-select"></view>
</view>
<uni-calendar
:ref="`calendar-${boxIdx}-${idx}`"
:insert="false"
:clearDate="false"
:startDate="item.startDate || ''"
:endDate="item.endDate || ''"
:date="formData[item.value] || item.endDate"
showBottomBtn
@confirm="confirmCalendar($event,item.value )"
/>
</template>
<template v-else-if="item.type === 'range-calendar'">
<view
class="value"
@click="openCalendar(boxIdx,idx)"
>
<template v-if="!item.addHtml && formData[item.value]">
{{ formData[item.value] }}
</template>
<template v-else>
<span class="placeholder">请选择</span>
</template>
<view class="sprite-icon icon-icon-select"></view>
</view>
<uni-calendar
:ref="`calendar-${boxIdx}-${idx}`"
range
:insert="false"
:clearDate="false"
:startDate="item.startDate || ''"
:endDate="item.endDate || ''"
:rangeValue="formData[item.value]"
showBottomBtn
@confirm="confirmCalendar($event,item.value)"
/>
</template>
<slot
v-else-if="item.cellHtml"
:name="item.cellHtml"
></slot>
<template v-if="item.suffix">
<view class="suffix">{{item.suffix}}</view>
</template>
</view> </view>
</view> </view>
<slot <slot
...@@ -140,6 +205,7 @@ ...@@ -140,6 +205,7 @@
</template> </template>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
...@@ -171,7 +237,9 @@ export default { ...@@ -171,7 +237,9 @@ export default {
type: Array, type: Array,
default: () => [] default: () => []
}, },
collapseControl: Boolean collapseControl: Boolean,
cellBoxStyle: String,
index: Number
}, },
data () { data () {
return { return {
...@@ -184,7 +252,7 @@ export default { ...@@ -184,7 +252,7 @@ export default {
methods: { methods: {
onCellClick (item) { onCellClick (item) {
if (item.type === 'select') { if (item.type === 'select') {
this.$emit('handleCell', item) this.$emit('handleCell', item, this.index)
} }
}, },
onRadioChange (e, item) { onRadioChange (e, item) {
...@@ -194,10 +262,20 @@ export default { ...@@ -194,10 +262,20 @@ export default {
this.$emit('handleValue', item) this.$emit('handleValue', item)
}, },
handleBlur (e, item) { handleBlur (e, item) {
this.$emit('inputBlur', e, item) this.$emit('inputBlur', e, item, this.index)
}, },
collapseAll (index) { collapseAll (index) {
this.$emit('collapseAll', index) this.$emit('collapseAll', index)
},
confirmCalendar (e, key) {
this.$emit('confirmCalendar', e, key, this.index)
},
openCalendar (index, ind) {
let [calendar] = this.$refs[`calendar-${index}-${ind}`]
if (calendar) calendar.open()
},
onLabelTipsClick (item) {
this.$emit('handleLabelTips', item)
} }
} }
} }
...@@ -270,7 +348,12 @@ export default { ...@@ -270,7 +348,12 @@ export default {
font-size: toRpx(28); font-size: toRpx(28);
display: flex; display: flex;
align-items: center; align-items: center;
.label-tips {
margin-left: 8rpx;
color: #4673ff;
font-size: 24rpx;
font-weight: 400;
}
.sprite-icon { .sprite-icon {
margin-right: toRpx(8); margin-right: toRpx(8);
} }
...@@ -304,7 +387,12 @@ export default { ...@@ -304,7 +387,12 @@ export default {
margin-left: toRpx(20); margin-left: toRpx(20);
overflow: hidden; overflow: hidden;
font-size: toRpx(28); font-size: toRpx(28);
display: flex;
align-items: center;
.suffix {
flex-shrink: 0;
margin-left: 16rpx;
}
uni-input { uni-input {
font-size: toRpx(28); font-size: toRpx(28);
} }
...@@ -318,6 +406,8 @@ export default { ...@@ -318,6 +406,8 @@ export default {
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
height: 100%; height: 100%;
width: 100%;
word-break: break-all;
.sprite-icon { .sprite-icon {
margin-bottom: toRpx(2); margin-bottom: toRpx(2);
} }
...@@ -345,6 +435,7 @@ export default { ...@@ -345,6 +435,7 @@ export default {
width: 100%; width: 100%;
border: none; border: none;
padding: 0; padding: 0;
background-color: transparent;
} }
.input-bottom { .input-bottom {
min-height: toRpx(100); min-height: toRpx(100);
......
<template>
<view
class="car-model-box"
:key="viewKey"
>
<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="brand-list">
<template v-for="(j, jindex) in c.childs_list">
<view
:key="jindex"
:class="['sub-brand-name']"
>
<view
class="subtitle subtitle-one"
@click.stop="chooseSubBrand(j, c , jindex, cindex, index)"
> {{j.name}}</view>
</view>
<template v-for="(k,kindex) in j.children">
<view
class="sub-item flex"
:key="`${k.id}_${kindex}`"
>
<view
class="subtitle subtitle-two"
@click.stop="chooseSeries(k,jindex, cindex, index ,kindex)"
>{{k.name}}</view>
<template v-for="(s,sindex) in k.children">
<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>
</view>
</template>
</template>
</view>
</view>
</template>
</view>
</template>
<view class="block"></view>
</template>
</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>
</template>
</view>
<view class="right-box">
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'CarBrand',
data () {
return {
letter: 'A',
viewKey: Date.now()
}
},
mounted () {
},
methods: {
async getList (searchValue) {
const { userInfo, params } = this,
{ cacheData } = params
this.currentId = ''
if (cacheData && cacheData.length) {
this.initData(cacheData)
if (searchValue) this.handleSearch(searchValue)
return
}
const data = await uni.$api.popupApi.getCarBrandList()
this.updateParams(params, data || [])
},
initData (carData) {
let { params: { idKey }, data: { customer, carInfo }, sceneType } = this,
letterList = Array.from(new Set([...carData.map((e) => e.letter)])),
carModelList = letterList.map(e => {
let list = []
carData.map(i => {
if (e === i.letter) {
i.childs_list = i.childs;
list.push(i)
}
})
return {
letter: e,
list,
}
})
this.list = carModelList
this.$emit('onComplete')
},
handleSearch (searchValue) {
if (!searchValue) {
this.searchStatus = false
this.letter = 'A'
} else {
searchValue = searchValue.toUpperCase()
let { list } = this,
carBrand = JSON.parse(JSON.stringify(list))
let arr = [];
carBrand.map(c => {
c.list.map(i => {
let childs_list = [],
i_name = i.name.toUpperCase()
i.childs_list.map((k) => {
let k_name = k.name.toUpperCase()
if (k_name.indexOf(searchValue) != -1) {
childs_list.push(k);
}
});
if (i_name.indexOf(searchValue) != -1 || childs_list.length > 0) {
i.childs_list = childs_list.length > 0 ? childs_list : i.childs_list;
arr.push(i);
}
})
})
let letterList = Array.from(new Set([...arr.map((e) => e.letter)]));
let searchList = letterList.map((l) => {
let _list = [];
arr.map((i) => {
if (l === i.letter) {
_list.push(i);
}
})
return {
letter: l,
list: _list,
}
})
this.searchList = searchList
this.searchStatus = true
}
},
async chooseSubBrand (that, item, jindex, cindex, index) {
uni.showLoading({
mask: true
})
const data = await uni.$api.popupApi.getCarSeriesList({
brandId: item.id,
childBrandId: that.id
})
uni.hideLoading()
this.listData[index].list[cindex].childs_list[jindex].children = data
this.viewKey = Date.now()
},
async chooseSeries (k, jindex, cindex, index, kindex) {
uni.showLoading({
mask: true
})
const data = await uni.$api.popupApi.getCarTypeList({
carSeriesId: k.id
})
uni.hideLoading()
this.listData[index].list[cindex].childs_list[jindex].children[kindex].children = data
this.viewKey = Date.now()
},
chooseCarType (s, c) {
let chooseItem = {
vehicleBrandId: c.id,
vehicleBrandName: c.name,
vehicleSubBrandId: s.brandId,
vehicleSubBrandName: s.brandName,
vehicleSeriesId: s.seriesId,
vehicleSeriesName: s.seriesName,
vehicleShapeId: s.id,
vehicleShapeName: s.name
}
this.currentId = s.id
this.$emit('choose', chooseItem)
},
checkActive (j) {
let { currentId, data, params } = this
return currentId ?
j.id == currentId : j.id == data[params.idKey]
},
}
}
</script>
<style scoped lang='scss'>
.car-model-box {
position: relative;
height: 100%;
width: 100%;
.scroll-view {
height: 100%;
}
.letter-list {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 0;
color: #888888;
font-size: toRpx(28);
line-height: toRpx(28);
padding: 0 toRpx(18);
text-align: center;
}
.item-box {
margin-bottom: toRpx(32);
.letter-title {
color: #888888;
font-size: toRpx(28);
height: toRpx(40);
background: #f5f7fa;
padding-left: toRpx(48);
}
.car-model {
margin: 0 toRpx(48);
.brand-name {
color: #333333;
font-size: toRpx(32);
line-height: toRpx(44);
margin: toRpx(16) 0;
}
.sub-brand-name {
color: #888888;
font-size: toRpx(28);
line-height: toRpx(40);
width: 100%;
flex-shrink: 0;
}
}
}
.brand-list {
// display: grid;
// grid-template-columns: repeat(4, 1fr);
display: flex;
// gap: toRpx(32) 0;
flex-wrap: wrap;
.subtitle {
width: 100%;
flex-shrink: 0;
}
.subtitle-one {
margin-bottom: 10rpx;
}
.subtitle-two {
color: #000;
font-size: 36rpx;
font-weight: 500;
}
.sub-item {
width: 100%;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
display: flex;
flex-wrap: wrap;
gap: toRpx(32);
margin-bottom: 20rpx;
align-items: stretch;
}
.item {
width: calc((100% - #{toRpx(96)}) / 4);
justify-content: center;
min-height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
padding: 10rpx;
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
}
.block {
width: 100%;
height: 24rpx;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="gearbox-list">
<template v-for="(i, index) in list">
<view
:key="index"
@click="choose(i)"
:class="['item flex', { active: currentId ? i.value == currentId : i.value == data[params.idKey] }]"
>
<view class="sprite-icon icon-tag-checked"></view>
<template v-if="!i.type">
{{ i.value }}
</template>
<template v-else>
<input
type="text"
v-model="i.value"
class="input"
:placeholder="i.label"
>
</template>
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'Gearbox',
inject: ['userInfo'],
data () {
return {
}
},
mounted () {
},
methods: {
async getList () {
const { params } = this
this.currentId = ''
let data = [
{
value: 'MT变速箱'
},
{
value: 'AMT变速箱'
},
{
value: 'AT变速箱'
},
{
value: 'CVT变速箱'
},
{
value: 'DCT变速箱'
},
{
label: '自定义',
value: '',
type: 'input'
}
]
this.updateParams(params, data)
},
initData (list) {
const { params: { idKey }, data } = this
console.log(data[idKey])
if (data[idKey]) {
this.currentId = data[idKey]
this.$emit('choose', data[idKey])
let index = list.findIndex(item => item.value == data[idKey])
if(index == -1) list[list.length - 1].value = data[idKey]
}
this.list = list
this.$emit('onComplete')
},
handleSearch (searchValue) {
this.list = []
this.getList(searchValue, true)
},
choose (i) {
this.currentId = i.value
this.$emit('choose', i.value)
}
}
}
</script>
<style scoped lang="scss">
.gearbox-list {
display: grid;
grid-template-columns: repeat(2, 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;
}
.input{
width: 100%;
height: 100%;
text-align: center;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
<template>
<view class="seat-list">
<template v-for="(i, index) in list">
<view
:key="index"
@click="choose(i)"
:class="['item flex', { active: currentId != null ? i.optionId == currentId : i.optionId == data[params.idKey] }]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{ i.optionLabel }}
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'Options',
inject: ['userInfo'],
data () {
return {
}
},
mounted () {
},
methods: {
async getList () {
const { params } = this
this.currentId = '-1'
this.updateParams(params, params.options)
},
initData (list) {
const { params: { idKey }, data } = this
if (data[idKey] != null) {
this.currentId = data[idKey]
this.$emit('choose', data[idKey])
}
this.list = list
this.$emit('onComplete')
},
choose (i) {
this.currentId = i.optionId
this.$emit('choose', i)
}
}
}
</script>
<style scoped lang="scss">
.seat-list {
display: grid;
grid-template-columns: repeat(3, 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>
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* 18: 座位数 * 18: 座位数
* 19: 客户档案 * 19: 客户档案
* 20: 战败客户档案 * 20: 战败客户档案
* 21: 客户类型
*/ */
const componentConfig = { const componentConfig = {
...@@ -239,6 +240,108 @@ const componentConfig = { ...@@ -239,6 +240,108 @@ const componentConfig = {
searchValue: '', searchValue: '',
noData: false, noData: false,
defeat: true defeat: true
} },
21: {
name: 'Options',
title: '客户类型',
nullTips: '请选择客户类型',
idKey: 'customerType',
hideSearch: true,
loadComplete: false,
options: [{
optionId: 1,
optionLabel: '个人'
}, {
optionId: 2,
optionLabel: '企业'
}, {
optionId: 3,
optionLabel: '个人(港澳)'
}, {
optionId: 4,
optionLabel: '个人(台)'
}, {
optionId: 5,
optionLabel: '个人(军官)'
}]
},
22: {
name: 'Options',
title: '证件类型',
nullTips: '请选择证件类型',
idKey: 'cardType',
hideSearch: true,
loadComplete: false,
options: [{
optionId: 1,
optionLabel: '身份证'
}, {
optionId: 2,
optionLabel: '统一社会信息代码'
}, {
optionId: 3,
optionLabel: '港澳返乡证'
}, {
optionId: 4,
optionLabel: '台胞证'
}, {
optionId: 5,
optionLabel: '军官证'
}, {
optionId: 7,
optionLabel: '护照'
}]
},
23: {
name: 'Options',
title: '购车类型',
nullTips: '请选择购车类型',
idKey: 'buyCarType',
hideSearch: true,
loadComplete: false,
options: [{
optionId: 0,
optionLabel: '贷款车'
}, {
optionId: 1,
optionLabel: '全款车'
}]
},
24: {
name: 'Options',
title: '车辆使用性质',
nullTips: '请选择车辆使用性质',
idKey: 'vehicleNature',
hideSearch: true,
loadComplete: false,
options: [{
optionId: 0,
optionLabel: '营运'
}, {
optionId: 1,
optionLabel: '非营运'
}]
},
25: {
name: 'CarBrand',
title: '选择品牌车系',
placeholder: '查找',
idKey: 'vehicleShapeId',
nullTips: '请选择品牌车系',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false,
hideSearch: true,
popupStyle: 'height:90vh;'
},
26: {
name: 'Gearbox',
title: '变速箱类型',
nullTips: '请选择变速箱类型',
idKey: 'gearbox',
hideSearch: true,
loadComplete: false
},
} }
export default { componentConfig } export default { componentConfig }
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
@onCancel="cancel" @onCancel="cancel"
@onReset="reset" @onReset="reset"
:showReset="popupType === 15" :showReset="popupType === 15"
:hideFooter="componentObject[popupType].hideFooter"
:popupStyle="componentObject[popupType].popupStyle || ''"
> >
<view class="popup-title flex"> <view class="popup-title flex">
{{ title }} {{ title }}
...@@ -44,7 +46,11 @@ ...@@ -44,7 +46,11 @@
</view> </view>
</view> </view>
</template> </template>
<view :class="['popup-body', { 'hide-search': componentObject[popupType].hideSearch }]"> <view :class="['popup-body',
{'hide-footer': componentObject[popupType].hideFooter },
{'hide-search': componentObject[popupType].hideSearch },
{'hide-footer-search':componentObject[popupType].hideFooter && componentObject[popupType].hideSearch }
]">
<scroll-view <scroll-view
scroll-y scroll-y
:class="['popup-scroll-view', { show: componentObject[popupType].loadComplete }]" :class="['popup-scroll-view', { show: componentObject[popupType].loadComplete }]"
...@@ -100,6 +106,10 @@ import AgeRange from './components/AgeRange.vue' ...@@ -100,6 +106,10 @@ import AgeRange from './components/AgeRange.vue'
import City from './components/City.vue' import City from './components/City.vue'
import Seat from './components/Seat.vue' import Seat from './components/Seat.vue'
import Customer from './components/Customer.vue' import Customer from './components/Customer.vue'
import Options from './components/Options.vue'
import CarBrand from './components/CarBrand.vue'
import Gearbox from './components/Gearbox.vue'
export default { export default {
components: { components: {
Popup, Popup,
...@@ -119,6 +129,9 @@ export default { ...@@ -119,6 +129,9 @@ export default {
City, City,
Seat, Seat,
Customer, Customer,
Options,
CarBrand,
Gearbox
}, },
name: '', name: '',
props: { props: {
...@@ -250,7 +263,7 @@ export default { ...@@ -250,7 +263,7 @@ export default {
if (!autoClose) this.$refs.popup.close() if (!autoClose) this.$refs.popup.close()
return return
} }
if (chooseContent) { if (chooseContent != null) {
if (Array.isArray(chooseContent) && !chooseContent.length && componentObject[popupType].nullTips) throw componentObject[popupType].nullTips if (Array.isArray(chooseContent) && !chooseContent.length && componentObject[popupType].nullTips) throw componentObject[popupType].nullTips
this.$emit('onConfirm', { this.$emit('onConfirm', {
chooseContent, chooseContent,
...@@ -381,6 +394,15 @@ export default { ...@@ -381,6 +394,15 @@ export default {
padding-top: 0; padding-top: 0;
} }
} }
.hide-footer {
height: calc(100% - #{toRpx(184)});
}
.hide-footer-search {
height: calc(100% - #{toRpx(104)});
.popup-scroll-view {
padding-top: 0;
}
}
.popup-footer { .popup-footer {
padding: toRpx(64) 0; padding: toRpx(64) 0;
justify-content: center; justify-content: center;
...@@ -412,6 +434,11 @@ export default { ...@@ -412,6 +434,11 @@ export default {
justify-content: center; justify-content: center;
} }
} }
.car-popup {
.popup-box {
height: 90vh;
}
}
.right-box { .right-box {
width: 46vw; width: 46vw;
height: 100vh; height: 100vh;
......
<template> <template>
<uni-popup ref="popup" :type="position" :is-mask-click="maskClick" :animation="animation"> <uni-popup ref="popup" :type="position" :is-mask-click="maskClick" :animation="animation">
<view :class="['popup-box', { 'right-box': position == 'right' }]"> <view :class="['popup-box', { 'right-box': position == 'right' }]" :style="popupStyle">
<slot></slot> <slot></slot>
<view class="popup-footer flex" v-if="showReset"> <template v-if="!hideFooter">
<view class="popup-btn-three popup-cancel" @click="cancel">{{ cancelText }}</view> <view class="popup-footer flex" v-if="showReset">
<view class="popup-btn-three popup-reset" @click="reset">{{ resetText }}</view> <view class="popup-btn-three popup-cancel" @click="cancel">{{ cancelText }}</view>
<view class="popup-btn-three popup-confirm" @click="confirm">{{ confirmText }}</view> <view class="popup-btn-three popup-reset" @click="reset">{{ resetText }}</view>
</view> <view class="popup-btn-three popup-confirm" @click="confirm">{{ confirmText }}</view>
<view class="popup-footer flex" v-else> </view>
<view class="popup-btn popup-cancel" @click="cancel">{{ cancelText }}</view> <view class="popup-footer flex" v-else>
<view class="popup-btn popup-confirm" @click="confirm">{{ confirmText }}</view> <view class="popup-btn popup-cancel" @click="cancel">{{ cancelText }}</view>
</view> <view class="popup-btn popup-confirm" @click="confirm">{{ confirmText }}</view>
</view>
</template>
</view> </view>
</uni-popup> </uni-popup>
</template> </template>
...@@ -47,7 +49,12 @@ export default { ...@@ -47,7 +49,12 @@ export default {
showReset: { showReset: {
type: Boolean, type: Boolean,
default: false default: false
} },
popupStyle: {
type: String,
default: ''
},
hideFooter:Boolean
}, },
......
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
scroll-y scroll-y
class="scroll-view" class="scroll-view"
> >
<view class="box-content"> <view
class="box-content"
:key="viewKey"
>
<GlCell <GlCell
:formList="formList" :formList="formList"
:formData="orderObj" :formData="orderObj"
...@@ -14,12 +17,21 @@ ...@@ -14,12 +17,21 @@
@handleCell="handleCell" @handleCell="handleCell"
:titleList="titleList" :titleList="titleList"
@collapseAll="collapseAll" @collapseAll="collapseAll"
collapseControl
> >
<template #goodsHtml> <!-- <template #goodsHtml>
恒河猴 <EquityGoods :externalData="orderObj" />
</template> -->
<template #tireHtml>
<template v-if="orderObj.tireFlag == 1">
<EquityTire :externalData="orderObj" />
</template>
</template> </template>
<template #uploadHtml> <template #uploadHtml>
恒河猴1 hhh
</template>
<template #conversion>
改装
</template> </template>
</GlCell> </GlCell>
...@@ -42,31 +54,60 @@ ...@@ -42,31 +54,60 @@
@onConfirm="onConfirm" @onConfirm="onConfirm"
:popupType="popupType" :popupType="popupType"
/> />
<uni-calendar
ref="calendar"
:insert="false"
:clearDate="false"
:endDate="endDate"
@confirm="confirmCalendar($event,'billingDate')"
:date="orderObj.billingDate"
showBottomBtn
/>
<uni-calendar
ref="futureCalendar"
:insert="false"
:clearDate="false"
:startDate="endDate"
@confirm="confirmCalendar($event,'effectiveDate')"
:date="orderObj.effectiveDate"
showBottomBtn
/>
</view> </view>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import utils from '@/utils/utils' import utils from '@/utils/utils'
import { EQUITY_FORM_LIST, EQUITY_FORM_TITLE_LIST, popupTypeEnum } from '../contant' import { EQUITY_FORM_LIST, EQUITY_FORM_TITLE_LIST, EQUITY_POPUP_ENUM } from '../contant'
import GlCell from '@/components/Form/GlCell.vue' import GlCell from '@/components/Form/GlCell.vue'
import OrderPopup from '@/components/OrderPopup/index.vue' import OrderPopup from '@/components/OrderPopup/index.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import EquityGoods from './EquityGoods/EquityGoods.vue'
import EquityTire from './EquityGoods/EquityTire.vue'
export default { export default {
name: 'CreateEquity', name: 'CreateEquity',
components: { components: {
GlCell, GlCell,
OrderPopup OrderPopup,
EquityGoods,
EquityTire
}, },
data () { data () {
return { return {
formList: utils.deepClone(EQUITY_FORM_LIST), formList: utils.deepClone(EQUITY_FORM_LIST),
titleList: utils.deepClone(EQUITY_FORM_TITLE_LIST), titleList: utils.deepClone(EQUITY_FORM_TITLE_LIST),
endDate: dayjs().format('YYYY-MM-DD'),
orderObj: { orderObj: {
carSeriesId: '' billingDate: dayjs().format('YYYY-MM-DD'),
effectiveDate: dayjs().add(1, 'day').format('YYYY-MM-DD'),
vehicleSeriesId: '',
ybAttachmentFlag: 1,
goodInfoList: []
}, },
popupType: 0 popupType: 0,
viewKey: Date.now()
} }
}, },
mounted () { mounted () {
...@@ -76,20 +117,47 @@ export default { ...@@ -76,20 +117,47 @@ export default {
handleCell (val) { handleCell (val) {
console.log(val) console.log(val)
this.popupType = Object.keys(popupTypeEnum).find(key => popupTypeEnum[key].key === val.key) * 1 if (['calendar', 'futureCalendar'].includes(val.key)) return this.$refs[val.key]?.open()
this.popupType = Object.keys(EQUITY_POPUP_ENUM).find(key => EQUITY_POPUP_ENUM[key].key === val.key) * 1
this.$refs.orderPopup.open() this.$refs.orderPopup.open()
}, },
onConfirm (val) {
const { chooseContent, popupType } = val,
_typeValue = EQUITY_POPUP_ENUM[popupType]
console.log(_typeValue)
if (_typeValue.key == 'carBrand') {
Object.assign(this.orderObj, chooseContent)
this.$set(this.orderObj, 'carBrandText',
`${chooseContent.vehicleBrandName}/${chooseContent.vehicleSubBrandName}/${chooseContent.vehicleSeriesName}/${chooseContent.vehicleShapeName}`)
return
} else if (_typeValue.options) {
this.$set(this.orderObj, _typeValue.targetIdKey, chooseContent[_typeValue.sourceIdKey || 'optionId'])
this.$set(this.orderObj, _typeValue.targetNameKey, chooseContent[_typeValue.sourceNameKey || 'optionLabel'])
return
}
this.$set(this.orderObj, _typeValue.value, chooseContent)
},
inputBlur (e, val) { inputBlur (e, val) {
this.orderObj[val.value] = this.orderObj[val.value]
}, },
async getServiceInfoDetail () { async getServiceInfoDetail () {
const data = await uni.$api.equityApi.getServiceInfoDetail({ const data = await uni.$api.equityApi.getServiceInfoDetail({
contractNo: 'car998467117191905280' contractNo: 'car998467117191905280'
}) })
if (data.ybAttachmentFlag != 0) this.formList[3] = []
if (data.qsFlag != 1) this.formList[4] = []
this.orderObj.goodInfoList = data.goodInfoList
this.orderObj.tireFlag = data.tireFlag
console.log(data) console.log(data)
this.orderObj = this.orderObj
this.viewKey = Date.now()
}, },
collapseAll (index) { collapseAll (index) {
this.titleList[index].collapseAll = !this.titleList[index].collapseAll this.titleList[index].collapseAll = !this.titleList[index].collapseAll
},
confirmCalendar (e, key) {
this.orderObj[key] = e.fulldate
} }
} }
......
<template>
<view class="equity-tire">
<GlCell
:formList="[formList]"
:formData="serviceInfo"
@inputBlur="inputBlur"
@handleLabelTips="handleLabelTips"
>
<template #tireHtml>
牛牛牛
</template>
</GlCell>
</view>
</template>
<script type='text/ecmascript-6'>
import { TIRE_FORM_LIST } from './contant'
import utils from '@/utils/utils'
import GlCell from '@/components/Form/GlCell.vue'
export default {
name: 'EquityTire',
props: {
externalData: null,
},
components: {
GlCell,
},
data () {
return {
formList: utils.deepClone(TIRE_FORM_LIST),
serviceInfo: {},
}
},
watch: {
externalData: {
handler (val) {
this.serviceInfo = val
},
deep: true,
immediate: true
}
},
mounted () {
console.log(this.formList)
},
methods: {
inputBlur (e, val) {
},
handleLabelTips (item) {
let { tipsUrl } = item
uni.previewImage({
urls: [tipsUrl]
})
}
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file \ No newline at end of file
import dayjs from "dayjs"
const energyProFormList = [
{
label: '服务年限',
value: 'servicePeriod',
type: 'input',
readonly: true,
suffix: '年',
},
{
label: '车辆登记日期',
value: 'vehicleRegistrationDate',
type: 'single-calendar',
endDate: dayjs().subtract(1, 'day').format('YYYY-MM-DD')
},
{
label: '车型排量',
value: 'vehicleDisplacement',
type: 'input',
suffix: 'L',
inputType: 'digit',
inputLimit: {
type: 'digit',
minVal: 0,
maxVal: 100
},
},
{
label: '原厂质保',
value: 'warranty',
cellHtml: 'warranty'
},
{
label: '合同购买时里程数',
value: 'mileage',
type: 'input',
suffix: 'KM',
inputType: 'digit',
inputLimit: {
type: 'digit',
minVal: 0
},
}
]
// 权益表单
const equityProFormList = [
{
label: '服务年限',
value: 'servicePeriod',
type: 'input',
readonly: true,
suffix: '年',
},
{
label: '无忧保障服务费',
value: 'actualSalesPrice',
placeholder: '非必填',
type: 'input',
inputType: 'digit',
inputLimit: {
type: 'digit',
maxVal: 100000,
minVal: 0
},
maxlength: '9',
},
{
label: '无忧卡卡号',
value: 'card',
type: 'input',
maxlength: '6',
noBorder: true,
noCellHeight: true,
isJudgeShow: true,
isShowObj: {
attr: 'entityCardFlag',
list: ['Y']
}
}
]
// 延保配置服务项目
const extendServiceFormList = [
{
label: '服务年限',
value: 'servicePeriod',
type: 'input',
readonly: true,
suffix: '年',
cellStyle: 'height: var(--fontSize90);'
},
{
value: 'displacementPower',
rowHtml: 'displacementPower',
hidden: true
},
{
label: '购车发票日期',
value: 'buyDate',
type: 'single-calendar',
endDate: dayjs().subtract(1, 'day').format('YYYY-MM-DD')
},
{
label: '原厂质保开始日期',
value: 'qualityBeginDate',
type: 'single-calendar',
},
{
label: '原厂质保年限',
value: 'warrantyPeriod',
type: 'input',
},
{
label: '原厂质保公里(万公里)',
value: 'warrantyKm',
type: 'input',
},
{
label: '合同购买时的公里数',
value: 'mileage',
type: 'input',
}
]
// 燃油车4大件
const oilProFormList = [
{
label: '服务年限',
value: 'servicePeriod',
type: 'input',
readonly: true,
suffix: '年',
},
{
label: '车辆登记日期',
value: 'vehicleRegistrationDate',
type: 'single-calendar',
endDate: dayjs().format('YYYY-MM-DD')
},
{
label: '车辆使用性质',
value: 'vehicleNatureName',
type: 'select',
key: 'vehicleNature'
},
{
label: '变速箱类型',
value: 'gearbox',
type: 'select',
key: 'gearbox'
},
{
label: '车型排量',
value: 'vehicleDisplacement',
type: 'input',
suffix: 'L',
inputLimit: {
type: 'digit',
minVal: 0,
maxVal: 100
},
},
{
label: '原厂质保',
value: 'warranty',
},
{
label: '合同购买时里程数',
value: 'mileage',
type: 'input',
suffix: 'KM',
labelWidth: 'var(--fontSize240)',
inputLimit: {
type: 'digit',
minVal: 0
},
}
]
const displacementPowerSwitch = [
{
label: '排量',
value: 0
},
{
label: '功率',
value: 1
}
]
const TIRE_FORM_LIST = [
{
label: '轮胎品牌',
value: 'tireBrand',
maxlength: '20',
type: 'input',
labelTips: '位置示例',
tipsUrl: 'https://img02.glsx.com.cn/weapp/resource/app-zyzs/equity/tire-tips-1.webp'
},
{
hidden:true,
rowHtml:'tireHtml'
}
]
export {
energyProFormList,
equityProFormList,
extendServiceFormList,
oilProFormList,
displacementPowerSwitch,
TIRE_FORM_LIST
}
...@@ -485,6 +485,7 @@ const EQUITY_FORM_LIST = [ ...@@ -485,6 +485,7 @@ const EQUITY_FORM_LIST = [
label: '购车日期', label: '购车日期',
value: 'billingDate', value: 'billingDate',
type: 'select', type: 'select',
key: 'calendar'
}, },
{ {
label: '品牌车系', label: '品牌车系',
...@@ -496,8 +497,9 @@ const EQUITY_FORM_LIST = [ ...@@ -496,8 +497,9 @@ const EQUITY_FORM_LIST = [
[ [
{ {
label: '客户类型', label: '客户类型',
value: 'customerType', value: 'customerTypeName',
type: 'select', type: 'select',
key: 'customerType'
}, },
{ {
label: '姓名', label: '姓名',
...@@ -513,8 +515,9 @@ const EQUITY_FORM_LIST = [ ...@@ -513,8 +515,9 @@ const EQUITY_FORM_LIST = [
}, },
{ {
label: '证件类型', label: '证件类型',
value: 'cardType', value: 'cardTypeName',
type: 'select', type: 'select',
key: 'cardType'
}, },
{ {
label: '证件号码', label: '证件号码',
...@@ -533,7 +536,28 @@ const EQUITY_FORM_LIST = [ ...@@ -533,7 +536,28 @@ const EQUITY_FORM_LIST = [
{ {
hidden: true, hidden: true,
rowHtml: 'goodsHtml' rowHtml: 'goodsHtml'
} },
{
label: '生效日期',
value: 'effectiveDate',
type: 'select',
key: 'futureCalendar'
},
{
hidden:true,
rowHtml:'tireHtml'
},
{
label: '购车类型',
value: 'buyCarTypeName',
type: 'select',
key: 'buyCarType'
},
{
label: '第一受益人',
value: 'compensationName',
type: 'input'
},
], ],
[ [
{ {
...@@ -543,6 +567,12 @@ const EQUITY_FORM_LIST = [ ...@@ -543,6 +567,12 @@ const EQUITY_FORM_LIST = [
], ],
[ [
{ {
hidden: true,
rowHtml: 'conversion'
}
],
[
{
label: '店面名称', label: '店面名称',
value: 'merchantName', value: 'merchantName',
type: 'input', type: 'input',
...@@ -568,7 +598,35 @@ const EQUITY_FORM_TITLE_LIST = [ ...@@ -568,7 +598,35 @@ const EQUITY_FORM_TITLE_LIST = [
{ name: '客户信息', collapseAll: true }, { name: '客户信息', collapseAll: true },
{ name: '产品信息', collapseAll: true }, { name: '产品信息', collapseAll: true },
{ name: '上传资料', collapseAll: true }, { name: '上传资料', collapseAll: true },
{ name: '加改装信息', collapseAll: true },
{ name: '店面信息', collapseAll: true } { name: '店面信息', collapseAll: true }
] ]
const EQUITY_POPUP_ENUM = {
export { FORM_LIST, popupTypeEnum, payTypeList, DEFEAT_FORM_LIST, titleList, UpdateOrderInfo, defeat_titleList, EQUITY_FORM_LIST, EQUITY_FORM_TITLE_LIST } 18: {
value: 'seatesNum',
key: 'seat'
},
21: {
options: true,
key: 'customerType',
targetIdKey: 'customerType',
targetNameKey: 'customerTypeName',
},
22: {
options: true,
key: 'cardType',
targetIdKey: 'cardType',
targetNameKey: 'cardTypeName',
},
23: {
options: true,
key: 'buyCarType',
targetIdKey: 'buyCarType',
targetNameKey: 'buyCarTypeName',
},
25: {
key: 'carBrand'
}
}
export { FORM_LIST, popupTypeEnum, payTypeList, DEFEAT_FORM_LIST, titleList, UpdateOrderInfo, defeat_titleList, EQUITY_FORM_LIST, EQUITY_FORM_TITLE_LIST, EQUITY_POPUP_ENUM }
...@@ -215,7 +215,9 @@ export default { ...@@ -215,7 +215,9 @@ export default {
}, },
rangeValue: { rangeValue: {
type: Object, type: Object,
default: () => { { } } default: () => {
return {}
}
}, },
backgroundColor: { backgroundColor: {
type: String, type: String,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!