Commit 679c377c by cen

Merge branch 'SAAS+V5.5.0' of http://192.168.3.233:8090/glsx/gl_tape into SAAS+V5.5.0

2 parents 13ab8045 4a23aed4
...@@ -73,7 +73,7 @@ ...@@ -73,7 +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" :disabled="item.readonly || item.disabled || false"
/> />
<view <view
v-if="item.valueIcon" v-if="item.valueIcon"
......
...@@ -379,15 +379,11 @@ export default { ...@@ -379,15 +379,11 @@ export default {
} }
}, },
openPop() { openPop() {
// this.messageType = 'system'
// this.$refs.kfRef.open()
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/messageList` url: `/pages/common/messageList`
}) })
}, },
getMessageInfo() { getMessageInfo() {
// this.getMessage()
// this.getMessageCount()
this.getMessagePop() this.getMessagePop()
}, },
jumpPersonCenter() { jumpPersonCenter() {
...@@ -441,13 +437,6 @@ export default { ...@@ -441,13 +437,6 @@ export default {
this.tabs[2].hidden = true this.tabs[2].hidden = true
this.tabs[3].hidden = true this.tabs[3].hidden = true
return return
} else {
// const { directSaleAuth, hmzxAuth, authorizedBusinessList } = res // 当驻店人员为非直营,且非鸿蒙智行延保业务驻店人员情况下。隐藏左侧【学习中心】图标
// const isYb = authorizedBusinessList && authorizedBusinessList.includes(1) // 1.延保 2.轻改 3.权益
// if (directSaleAuth || (hmzxAuth && isYb)) {
// this.tabs[2].hidden = false
// }
} }
} }
}, },
...@@ -456,6 +445,8 @@ export default { ...@@ -456,6 +445,8 @@ export default {
// this.trackInterval = null // this.trackInterval = null
}, },
beforeDestroy() { beforeDestroy() {
// uni.$off('pageBack')
// uni.$off('studyCenter')
uni.$off('ActivityCenter', this.handleActivityCenter); uni.$off('ActivityCenter', this.handleActivityCenter);
// clearInterval(this.trackInterval) // clearInterval(this.trackInterval)
// this.trackInterval = null // this.trackInterval = null
......
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
<!-- 考试次数 --> <!-- 考试次数 -->
<view class="exam-times"> <view class="exam-times">
<text class="times-value">剩余考试次数</text> <text class="times-value">剩余考试次数</text>
<template v-if="!item.examTimes">不限次数</template> <template v-if="!item.examTimes">不限制</template>
<template v-else> <template v-else>
<text>{{ filterValue(item.remainingTimes) }}/{{ filterValue(item.examTimes) }}次</text> <text>{{ filterValue(item.remainingTimes) }}/{{ filterValue(item.examTimes) }}</text>
</template> </template>
</view> </view>
...@@ -164,7 +164,7 @@ export default { ...@@ -164,7 +164,7 @@ export default {
// 跳转北森考试详情页 // 跳转北森考试详情页
async viewExam(item) { async viewExam(item) {
console.log('查看考试', item) console.log('查看考试', item)
if (item.remainingTimes <= 0) return if (item.examTimes && item.remainingTimes <= 0) return
// TODO: 跳转到考试详情页 // TODO: 跳转到考试详情页
this.showStudyPopup = false this.showStudyPopup = false
this.currentExam = item this.currentExam = item
...@@ -193,7 +193,7 @@ export default { ...@@ -193,7 +193,7 @@ export default {
const url = encodeURIComponent(`${baseUrl}?${queryString}#/viewDynamic?1=1`); const url = encodeURIComponent(`${baseUrl}?${queryString}#/viewDynamic?1=1`);
this.jumpUrl = `${tokenUrl}&return_url=${url}`; this.jumpUrl = `${tokenUrl}&return_url=${url}`;
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/studyWebview?url=${encodeURIComponent(this.jumpUrl)}&pageTitle=学习测评` url: `/pages/common/studyWebview?url=${encodeURIComponent(this.jumpUrl)}&pageTitle=学习测评&type=1`
}) })
} else { } else {
throw new Error('获取 token 失败') throw new Error('获取 token 失败')
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<text class="times-value">剩余考试次数</text> <text class="times-value">剩余考试次数</text>
<template v-if="!item.examTimes">不限制</template> <template v-if="!item.examTimes">不限制</template>
<template v-else> <template v-else>
<text>{{ filterValue(item.remainingTimes) }}/{{ filterValue(item.examTimes) }}次</text> <text>{{ filterValue(item.remainingTimes) }}/{{ filterValue(item.examTimes) }}</text>
</template> </template>
</view> </view>
...@@ -166,7 +166,7 @@ export default { ...@@ -166,7 +166,7 @@ export default {
// 跳转北森考试详情页 // 跳转北森考试详情页
async viewExam(item) { async viewExam(item) {
console.log('查看考试', item) console.log('查看考试', item)
if (item.remainingTimes <= 0) return if (item.examTimes && item.remainingTimes <= 0) return
// TODO: 跳转到考试详情页 // TODO: 跳转到考试详情页
this.showStudyPopup = false this.showStudyPopup = false
this.currentExam = item this.currentExam = item
...@@ -195,7 +195,7 @@ export default { ...@@ -195,7 +195,7 @@ export default {
const url = encodeURIComponent(`${baseUrl}?${queryString}#/viewDynamic?1=1`); const url = encodeURIComponent(`${baseUrl}?${queryString}#/viewDynamic?1=1`);
this.jumpUrl = `${tokenUrl}&return_url=${url}`; this.jumpUrl = `${tokenUrl}&return_url=${url}`;
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/studyWebview?url=${encodeURIComponent(this.jumpUrl)}&pageTitle=学习测评` url: `/pages/common/studyWebview?url=${encodeURIComponent(this.jumpUrl)}&pageTitle=学习测评&type=1`
}) })
} else { } else {
throw new Error('获取 token 失败') throw new Error('获取 token 失败')
......
...@@ -188,31 +188,18 @@ export default { ...@@ -188,31 +188,18 @@ export default {
lockReason: 0 lockReason: 0
} }
}, },
created() {
// 在组件创建时就开始监听,确保事件能被捕获
// uni.$on('showExamSubmitPopup', () => {
// console.log('接收到考试提交弹窗事件')
// this.showExamPopup = true
// })
uni.$on('showStudyPopup', obj => {
console.log('接收到学习弹窗事件', obj)
if (obj.type === 'examSubmit') {
this.showExamPopup = true
} else if (obj.type === 'getLevelExamInfo') {
// 查询是否有等级考试
this.getLevelExamInfo()
if (obj.name == 'myCourse') {
this.$refs.pointRef.getMyStudyTime()
}
}
})
},
beforeDestroy() { beforeDestroy() {
// 组件销毁前移除监听 // 组件销毁前移除监听
uni.$off('showStudyPopup') uni.$logger.local.info('levelStudyPopup 移除监听')
uni.$off('levelStudyPopup')
// uni.$off('showStudyPopup') // uni.$off('showStudyPopup')
}, },
mounted() { mounted() {
uni.$logger.local.info('levelStudyPopup 开始监听mounted')
uni.$on('levelStudyPopup', obj => {
uni.$logger.local.info('接收到学习弹窗事件', obj)
this.showExamPopup = true
})
const userInfo = uni.$storage.get('userInfo') || {} const userInfo = uni.$storage.get('userInfo') || {}
this.userInfo = userInfo this.userInfo = userInfo
if (this.checkRecordAudio) permision.requestAndroidPermission('android.permission.RECORD_AUDIO') // 进入界面时检查权限 if (this.checkRecordAudio) permision.requestAndroidPermission('android.permission.RECORD_AUDIO') // 进入界面时检查权限
...@@ -267,7 +254,7 @@ export default { ...@@ -267,7 +254,7 @@ export default {
const url = encodeURIComponent(`${baseUrl}?${queryString}#/viewDynamic?1=1`) const url = encodeURIComponent(`${baseUrl}?${queryString}#/viewDynamic?1=1`)
this.jumpUrl = `${tokenUrl}&return_url=${url}` this.jumpUrl = `${tokenUrl}&return_url=${url}`
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/studyWebview?url=${encodeURIComponent(this.jumpUrl)}&pageTitle=学习测评` url: `/pages/common/studyWebview?url=${encodeURIComponent(this.jumpUrl)}&pageTitle=学习测评&type=0`
}) })
} else { } else {
uni.showToast({ uni.showToast({
......
<template> <template>
<view <view class="car-model-box">
class="car-model-box" <!-- :key="viewKey" -->
:key="viewKey" <scroll-view
> class="scroll-view"
<scroll-view scroll-y
class="scroll-view" :scroll-into-view="letter"
scroll-y >
:scroll-into-view="letter" <template v-if="listData.length">
> <template v-for="(i, index) in listData">
<template v-if="listData.length"> <view
<template v-for="(i, index) in listData"> class="item-box"
<view :key="index"
class="item-box" :id="i.letter"
:key="index" >
:id="i.letter" <view class="letter-title flex">{{i.letter}}</view>
> <template v-for="(c,cindex) in i.list">
<view class="letter-title flex">{{i.letter}}</view> <view
<template v-for="(c,cindex) in i.list"> class="car-model"
<view :key="cindex"
class="car-model" >
:key="cindex" <view class="brand-name">{{c.name}}</view>
> <view class="brand-list">
<view class="brand-name">{{c.name}}</view> <template v-for="(j, jindex) in c.childs_list">
<view class="brand-list"> <view
<template v-for="(j, jindex) in c.childs_list"> :key="jindex"
<view :class="['sub-brand-name',{'hide-border':j.children && j.children.length && j.open}]"
:key="jindex" >
:class="['sub-brand-name']" <view
> class="subtitle subtitle-one flex"
<view @click.stop="chooseSubBrand(j, c , jindex, cindex, index)"
class="subtitle subtitle-one flex" >
@click.stop="chooseSubBrand(j, c , jindex, cindex, index)" {{j.name}}
> <uni-icons
{{j.name}} :type="`${j.children && j.children.length && j.open ?'down':'right'}`"
<uni-icons size="18"
:type="`${j.children && j.children.length?'down':'right'}`" ></uni-icons>
size="18" </view>
></uni-icons>
</view> </view>
</view> <template v-for="(k,kindex) in j.children">
<template v-for="(k,kindex) in j.children"> <view
<view :class="['sub-item flex',{'last':kindex == j.children.length-1}, {hide:!j.open}]"
class="sub-item flex" :key="`${k.id}_${kindex}`"
:key="`${k.id}_${kindex}`" >
> <view
<view :class="['subtitle subtitle-two flex']"
class="subtitle subtitle-two flex" @click.stop="chooseSeries(k,jindex, cindex, index ,kindex)"
@click.stop="chooseSeries(k,jindex, cindex, index ,kindex)" >
> {{k.name}}
{{k.name}} <uni-icons
<uni-icons :type="`${k.children && k.children.length && k.open ?'down':'right'}`"
:type="`${k.children && k.children.length?'down':'right'}`" size="18"
size="18" ></uni-icons>
></uni-icons> </view>
</view> <template v-for="(s,sindex) in k.children">
<template v-for="(s,sindex) in k.children"> <view
<view :class="['item flex',{active: checkActive(s)}]"
:class="['item flex',{active: checkActive(s)}]" :key="`${s.id}_${sindex}`"
:key="`${s.id}_${sindex}`" @click.stop="chooseCarType(s,c)"
@click.stop="chooseCarType(s,c)" v-if="k.open"
> >
{{s.name}} {{s.name}}
<view class="sprite-icon icon-tag-checked"></view> <view class="sprite-icon icon-tag-checked"></view>
</view> </view>
</template> </template>
</view> </view>
</template> </template>
</template> </template>
</view> </view>
</view> </view>
</template> </template>
</view> </view>
</template> </template>
<view class="block"></view> <view class="block"></view>
</template> </template>
</scroll-view> </scroll-view>
<view class="letter-list"> <view class="letter-list">
<template v-for="(i, index) in listData"> <template v-for="(i, index) in listData">
<view <view
class="letter-item" class="letter-item"
:key="index" :key="index"
@click="letter = i.letter" @click="letter = i.letter"
> >
{{i.letter}} {{i.letter}}
</view> </view>
</template> </template>
</view> </view>
<view class="right-box"> <view class="right-box">
</view> </view>
</view> </view>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import popupmixin from './popupmixin' import popupmixin from './popupmixin'
export default { export default {
mixins: [popupmixin], mixins: [popupmixin],
name: 'CarBrand', name: 'CarBrand',
data () { data () {
return { return {
letter: 'A', letter: 'A',
viewKey: Date.now() }
} },
}, mounted () {
mounted () { },
}, methods: {
methods: { async getList (searchValue) {
async getList (searchValue) { const { userInfo, params } = this,
const { userInfo, params } = this, { cacheData } = params
{ cacheData } = params this.currentId = ''
this.currentId = '' if (cacheData && cacheData.length) {
if (cacheData && cacheData.length) { this.initData(cacheData)
this.initData(cacheData) if (searchValue) this.handleSearch(searchValue)
if (searchValue) this.handleSearch(searchValue) return
return }
} const data = await uni.$api.popupApi.getCarBrandList()
const data = await uni.$api.popupApi.getCarBrandList() this.updateParams(params, data || [])
this.updateParams(params, data || []) },
}, initData (carData) {
initData (carData) { let { params: { idKey }, data: { customer, carInfo }, sceneType } = this,
let { params: { idKey }, data: { customer, carInfo }, sceneType } = this, letterList = Array.from(new Set([...carData.map((e) => e.letter)])),
letterList = Array.from(new Set([...carData.map((e) => e.letter)])), carModelList = letterList.map(e => {
carModelList = letterList.map(e => { let list = []
let list = [] carData.map(i => {
carData.map(i => { if (e === i.letter) {
if (e === i.letter) { i.childs_list = i.childs;
i.childs_list = i.childs; list.push(i)
list.push(i) }
} })
}) return {
return { letter: e,
letter: e, list,
list, }
} })
}) this.list = carModelList
this.list = carModelList this.$emit('onComplete')
this.$emit('onComplete') },
}, handleSearch (searchValue) {
handleSearch (searchValue) { if (!searchValue) {
if (!searchValue) { this.searchStatus = false
this.searchStatus = false this.letter = 'A'
this.letter = 'A' } else {
} else { searchValue = searchValue.toUpperCase()
searchValue = searchValue.toUpperCase() let { list } = this,
let { list } = this, carBrand = JSON.parse(JSON.stringify(list))
carBrand = JSON.parse(JSON.stringify(list)) let arr = [];
let arr = []; carBrand.map(c => {
carBrand.map(c => { c.list.map(i => {
c.list.map(i => { let childs_list = [],
let childs_list = [], i_name = i.name.toUpperCase()
i_name = i.name.toUpperCase() i.childs_list.map((k) => {
i.childs_list.map((k) => { let k_name = k.name.toUpperCase()
let k_name = k.name.toUpperCase() if (k_name.indexOf(searchValue) != -1) {
if (k_name.indexOf(searchValue) != -1) { childs_list.push(k);
childs_list.push(k); }
} });
});
if (i_name.indexOf(searchValue) != -1 || childs_list.length > 0) {
if (i_name.indexOf(searchValue) != -1 || childs_list.length > 0) { i.childs_list = childs_list.length > 0 ? childs_list : i.childs_list;
i.childs_list = childs_list.length > 0 ? childs_list : i.childs_list; arr.push(i);
arr.push(i); }
} })
}) })
}) let letterList = Array.from(new Set([...arr.map((e) => e.letter)]));
let letterList = Array.from(new Set([...arr.map((e) => e.letter)])); let searchList = letterList.map((l) => {
let searchList = letterList.map((l) => { let _list = [];
let _list = []; arr.map((i) => {
arr.map((i) => { if (l === i.letter) {
if (l === i.letter) { _list.push(i);
_list.push(i); }
} })
}) return {
return { letter: l,
letter: l, list: _list,
list: _list, }
} })
}) this.searchList = searchList
this.searchList = searchList this.searchStatus = true
this.searchStatus = true
}
} },
}, async chooseSubBrand (that, item, jindex, cindex, index) {
async chooseSubBrand (that, item, jindex, cindex, index) { if (that.children && that.children.length) {
if(that.children && that.children.length) return this.$set(this.listData[index].list[cindex].childs_list[jindex], 'open', !that.open)
uni.showLoading({ return
mask: true }
}) uni.showLoading({
const data = await uni.$api.popupApi.getCarSeriesList({ mask: true
brandId: item.id, })
childBrandId: that.id const data = await uni.$api.popupApi.getCarSeriesList({
}) brandId: item.id,
uni.hideLoading() childBrandId: that.id
this.listData[index].list[cindex].childs_list[jindex].children = data })
this.viewKey = Date.now()
}, // this.listData[index].list[cindex].childs_list[jindex].children = data
async chooseSeries (k, jindex, cindex, index, kindex) { this.$set(this.listData[index].list[cindex].childs_list[jindex], 'children', data)
if (k.children && k.children.length) return this.$set(this.listData[index].list[cindex].childs_list[jindex], 'open', true)
uni.showLoading({ setTimeout(() => {
mask: true uni.hideLoading()
}) }, 200)
const data = await uni.$api.popupApi.getCarTypeList({ // this.viewKey = Date.now()
carSeriesId: k.id },
}) async chooseSeries (k, jindex, cindex, index, kindex) {
uni.hideLoading() if (k.children && k.children.length) {
this.listData[index].list[cindex].childs_list[jindex].children[kindex].children = data this.$set(this.listData[index].list[cindex].childs_list[jindex].children[kindex], 'open', !k.open)
this.viewKey = Date.now()
return
}, }
chooseCarType (s, c) { uni.showLoading({
let chooseItem = { mask: true
vehicleBrandId: c.id, })
vehicleBrandName: c.name, const data = await uni.$api.popupApi.getCarTypeList({
vehicleSubBrandId: s.brandId, carSeriesId: k.id
vehicleSubBrandName: s.brandName, })
vehicleSeriesId: s.seriesId, // this.listData[index].list[cindex].childs_list[jindex].children[kindex].children = data
vehicleSeriesName: s.seriesName, this.$set(this.listData[index].list[cindex].childs_list[jindex].children[kindex], 'children', data)
vehicleShapeId: s.id, this.$set(this.listData[index].list[cindex].childs_list[jindex].children[kindex], 'open', true)
vehicleShapeName: s.name setTimeout(() => {
} uni.hideLoading()
this.currentId = s.id }, 200)
this.$emit('choose', chooseItem) // this.viewKey = Date.now()
},
checkActive (j) { },
let { currentId, data, params } = this chooseCarType (s, c) {
return currentId ? let chooseItem = {
j.id == currentId : j.id == data[params.idKey] vehicleBrandId: c.id,
}, vehicleBrandName: c.name,
} vehicleSubBrandId: s.brandId,
} vehicleSubBrandName: s.brandName,
</script> vehicleSeriesId: s.seriesId,
vehicleSeriesName: s.seriesName,
<style scoped lang='scss'> vehicleShapeId: s.id,
.car-model-box { vehicleShapeName: s.name
position: relative; }
height: 100%; this.currentId = s.id
width: 100%; this.$emit('choose', chooseItem)
.scroll-view { },
height: 100%; checkActive (j) {
} let { currentId, data, params } = this
.letter-list { return currentId ?
position: absolute; j.id == currentId : j.id == data[params.idKey]
top: 50%; },
transform: translateY(-50%); }
right: 0; }
color: #888888; </script>
font-size: toRpx(28);
line-height: toRpx(28); <style scoped lang='scss'>
padding: 0 toRpx(18); .car-model-box {
text-align: center; position: relative;
} height: 100%;
.item-box { width: 100%;
margin-bottom: toRpx(32); .scroll-view {
.letter-title { height: 100%;
color: #888888; }
font-size: toRpx(28); .letter-list {
height: toRpx(40); position: absolute;
background: #f5f7fa; top: 50%;
padding-left: toRpx(48); transform: translateY(-50%);
} right: 0;
.car-model { color: #888888;
margin: 0 toRpx(48); font-size: toRpx(28);
.brand-name { line-height: toRpx(28);
color: #333333; padding: 0 toRpx(18);
font-size: toRpx(32); text-align: center;
line-height: toRpx(44); }
margin: toRpx(16) 0; .item-box {
} margin-bottom: toRpx(32);
.sub-brand-name { .letter-title {
color: #888888; color: #888888;
font-size: toRpx(28); font-size: toRpx(28);
line-height: toRpx(40); height: toRpx(40);
width: 100%; background: #f5f7fa;
flex-shrink: 0; padding-left: toRpx(48);
border-bottom: toRpx(2) solid #888; }
} .car-model {
} margin: 0 toRpx(48);
} .brand-name {
.brand-list { color: #333333;
// display: grid; font-size: toRpx(44);
// grid-template-columns: repeat(4, 1fr); line-height: toRpx(54);
margin: toRpx(24) 0;
display: flex; }
// gap: toRpx(32) 0; .sub-brand-name {
flex-wrap: wrap; color: #888888;
.subtitle { font-size: toRpx(34);
width: 100%; line-height: toRpx(44);
flex-shrink: 0; width: 100%;
} flex-shrink: 0;
.subtitle-one { border-bottom: toRpx(2) solid #eee;
margin: toRpx(10) 0; }
} .hide-border {
.subtitle-two { border-bottom: none;
color: #000; }
font-size: toRpx(36); }
font-weight: 500; }
} .brand-list {
.sub-item { // display: grid;
width: 100%; // grid-template-columns: repeat(4, 1fr);
box-sizing: border-box;
position: relative; display: flex;
color: #333333; // gap: toRpx(32) 0;
font-size: toRpx(32); flex-wrap: wrap;
display: flex; .subtitle {
flex-wrap: wrap; width: 100%;
gap: toRpx(32); flex-shrink: 0;
margin-top: toRpx(20); }
align-items: stretch; .subtitle-one {
} margin: toRpx(30) 0;
.item { }
width: calc((100% - #{toRpx(96)}) / 4); .subtitle-two {
justify-content: center; color: #000;
min-height: toRpx(72); font-size: toRpx(32);
border-radius: toRpx(8); font-weight: 500;
border: toRpx(2) solid #dce0e6; }
box-sizing: border-box; .last {
position: relative; border-bottom: toRpx(2) solid #dce0e6;
color: #333333; padding-bottom: toRpx(40);
font-size: toRpx(32); }
padding: toRpx(10); .hide {
.sprite-icon { visibility: hidden;
display: none; height: 0;
position: absolute; padding-bottom: 0;
top: 0; }
right: 0; .sub-item {
} width: 100%;
} box-sizing: border-box;
.active { position: relative;
border-color: #2c66f7; color: #333333;
background: #ecf1ff; font-size: toRpx(28);
color: #2c66f7; display: flex;
.sprite-icon { flex-wrap: wrap;
display: block; gap: toRpx(32);
} line-height: toRpx(60);
} align-items: stretch;
} box-sizing: border-box;
} }
.block { .item {
width: 100%; width: calc((100% - #{toRpx(96)}) / 4);
height: toRpx(24); 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(28);
padding: toRpx(10);
line-height: toRpx(40);
.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: toRpx(24);
}
</style> </style>
\ No newline at end of file \ No newline at end of file
/** /**
* popupType * popupType
* 0:销售顾问/录单员 * 0:销售顾问/录单员
* 1:交付专员 * 1:交付专员
* 2:二级流量方 * 2:二级流量方
* 3:转化人员 * 3:转化人员
* 4:车品牌 * 4:车品牌
* 5: 礼券 * 5: 礼券
* 6:前档 * 6:前档
* 7:前侧窗玻璃 * 7:前侧窗玻璃
* 8:后侧窗玻璃 * 8:后侧窗玻璃
* 9:后档 * 9:后档
* 10:天窗 * 10:天窗
* 11:套餐 * 11:套餐
* 12:其他精品 * 12:其他精品
* 13:时间选择 * 13:时间选择
* 14: 代保管人员 * 14: 代保管人员
* 15: 商品类目 * 15: 商品类目
* 16: 年龄区间 * 16: 年龄区间
* 17:所在城市 * 17:所在城市
* 18: 座位数 * 18: 座位数
* 19: 客户档案 * 19: 客户档案
* 20: 战败客户档案 * 20: 战败客户档案
* 21: 客户类型 * 21: 客户类型
* 22: 证件类型 * 22: 证件类型
* 23: 购车类型 * 23: 购车类型
* 24: 车辆使用性质 * 24: 车辆使用性质
* 25: 选择品牌车系 * 25: 选择品牌车系
* 26: 变速箱类型 * 26: 变速箱类型
* 27: 权益战败推荐人员 * 27: 权益战败推荐人员
*/ */
const componentConfig = { const componentConfig = {
0: { 0: {
name: 'EmployeeList', name: 'EmployeeList',
title: '销售顾问/录单员', title: '销售顾问/录单员',
placeholder: '请输入姓名', placeholder: '请输入姓名',
idKey: ['referrerId', 'userId'], idKey: ['referrerId', 'userId'],
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
noData: false noData: false
}, },
1: { 1: {
name: 'EmployeeList', name: 'EmployeeList',
title: '交付专员', title: '交付专员',
placeholder: '请输入姓名', placeholder: '请输入姓名',
nullTips: '请选择交付专员', nullTips: '请选择交付专员',
idKey: ['deliveryId', 'deliveryUserId'], idKey: ['deliveryId', 'deliveryUserId'],
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
noData: false noData: false
}, },
2: { 2: {
name: 'DiversionMerchant', name: 'DiversionMerchant',
title: '二级流量方', title: '二级流量方',
hideSearch: true, hideSearch: true,
idKey: 'subShopMerchantId', idKey: 'subShopMerchantId',
cacheData: [], cacheData: [],
loadComplete: false loadComplete: false
}, },
3: { 3: {
name: 'EmployeeList', name: 'EmployeeList',
title: '转化人员', title: '转化人员',
placeholder: '请输入姓名', placeholder: '请输入姓名',
idKey: 'sellerUserId', idKey: 'sellerUserId',
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
noData: false noData: false
}, },
4: { 4: {
name: 'CarModelList', name: 'CarModelList',
title: '选择车型', title: '选择车型',
placeholder: '查找', placeholder: '查找',
idKey: 'carSeriesId', idKey: 'carSeriesId',
nullTips: '请选择车型', nullTips: '请选择车型',
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
noData: false noData: false
}, },
5: { 5: {
name: 'CouponList', name: 'CouponList',
title: '选择礼券', title: '选择礼券',
placeholder: '查找', placeholder: '查找',
idKey: 'customerCouponCode', idKey: 'customerCouponCode',
nullTips: '优惠券不能为空', nullTips: '优惠券不能为空',
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
noData: false noData: false
}, },
6: { 6: {
name: 'GoodsList', name: 'GoodsList',
title: '选择商品(可多选)', title: '选择商品(可多选)',
placeholder: '请输入名称', placeholder: '请输入名称',
idKey: 'goodsId', idKey: 'goodsId',
nullTips: '请勾选商品', nullTips: '请勾选商品',
goodsType: [1], //前档 goodsType: [1], //前档
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
noData: false noData: false
}, },
7: { 7: {
name: 'GoodsList', name: 'GoodsList',
title: '选择商品(可多选)', title: '选择商品(可多选)',
placeholder: '请输入名称', placeholder: '请输入名称',
idKey: 'goodsId', idKey: 'goodsId',
nullTips: '请勾选商品', nullTips: '请勾选商品',
goodsType: [2], // 前侧窗玻璃 goodsType: [2], // 前侧窗玻璃
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
noData: false noData: false
}, },
8: { 8: {
name: 'GoodsList', name: 'GoodsList',
title: '选择商品(可多选)', title: '选择商品(可多选)',
placeholder: '请输入名称', placeholder: '请输入名称',
idKey: 'goodsId', idKey: 'goodsId',
nullTips: '请勾选商品', nullTips: '请勾选商品',
goodsType: [3], // 后侧窗玻璃 goodsType: [3], // 后侧窗玻璃
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
noData: false noData: false
}, },
9: { 9: {
name: 'GoodsList', name: 'GoodsList',
title: '选择商品(可多选)', title: '选择商品(可多选)',
placeholder: '请输入名称', placeholder: '请输入名称',
idKey: 'goodsId', idKey: 'goodsId',
nullTips: '请勾选商品', nullTips: '请勾选商品',
goodsType: [4], // 后档 goodsType: [4], // 后档
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
noData: false noData: false
}, },
10: { 10: {
name: 'GoodsList', name: 'GoodsList',
title: '选择商品(可多选)', title: '选择商品(可多选)',
placeholder: '请输入名称', placeholder: '请输入名称',
idKey: 'goodsId', idKey: 'goodsId',
nullTips: '请勾选商品', nullTips: '请勾选商品',
goodsType: [5, 6, 7], // 天窗 goodsType: [5, 6, 7], // 天窗
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
noData: false noData: false
}, },
11: { 11: {
name: 'PackageList', name: 'PackageList',
title: '选择套餐', title: '选择套餐',
placeholder: '查找', placeholder: '查找',
nullTips: '请勾选套餐', nullTips: '请勾选套餐',
idKey: 'packageCode', idKey: 'packageCode',
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
noData: false noData: false
}, },
12: { 12: {
name: 'SkuGoodsList', name: 'SkuGoodsList',
title: '选择商品', title: '选择商品',
nullTips: '请勾选商品', nullTips: '请勾选商品',
placeholder: '查找', placeholder: '查找',
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
noData: false noData: false
}, },
13: { 13: {
name: 'DateTime', name: 'DateTime',
title: '选择时间', title: '选择时间',
hideSearch: true, hideSearch: true,
loadComplete: false loadComplete: false
}, },
14: { 14: {
name: 'AgreementList', name: 'AgreementList',
title: '代保管人员', title: '代保管人员',
placeholder: '请输入姓名', placeholder: '请输入姓名',
idKey: 'id', idKey: 'id',
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
hideSearch: true, hideSearch: true,
noData: false noData: false
}, },
15: { 15: {
name: 'GoodsCategory', name: 'GoodsCategory',
title: '选择商品类目', title: '选择商品类目',
hideSearch: true, hideSearch: true,
loadComplete: false loadComplete: false
}, },
16: { 16: {
name: 'AgeRange', name: 'AgeRange',
title: '年龄区间', title: '年龄区间',
nullTips: '请选择年龄区间', nullTips: '请选择年龄区间',
idKey: 'ageRange', idKey: 'ageRange',
hideSearch: true, hideSearch: true,
loadComplete: false loadComplete: false
}, },
17: { 17: {
name: 'City', name: 'City',
title: '所在城市', title: '所在城市',
hideSearch: true, hideSearch: true,
loadComplete: false, loadComplete: false,
nullTips: '请选择所在城市', nullTips: '请选择所在城市',
cacheData: [], cacheData: [],
noData: false, noData: false,
idKeys: ['provinceText', 'cityText'] idKeys: ['provinceText', 'cityText']
}, },
18: { 18: {
name: 'Seat', name: 'Seat',
title: '座位数', title: '座位数',
nullTips: '请选择座位数', nullTips: '请选择座位数',
idKey: 'seat', idKey: 'seat',
hideSearch: true, hideSearch: true,
loadComplete: false loadComplete: false
}, },
19: { 19: {
name: 'Customer', name: 'Customer',
title: '客户档案', title: '客户档案',
loadComplete: false, loadComplete: false,
placeholder: '查找', placeholder: '查找',
nullTips: '请选择客户', nullTips: '请选择客户',
idKey: 'customerId', idKey: 'customerId',
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
noData: false noData: false
}, },
20: { 20: {
name: 'Customer', name: 'Customer',
title: '客户档案', title: '客户档案',
loadComplete: false, loadComplete: false,
placeholder: '查找', placeholder: '查找',
nullTips: '请选择客户', nullTips: '请选择客户',
idKey: 'id', idKey: 'id',
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
noData: false, noData: false,
defeat: true defeat: true
}, },
21: { 21: {
name: 'Options', name: 'Options',
title: '客户类型', title: '客户类型',
nullTips: '请选择客户类型', nullTips: '请选择客户类型',
idKey: 'customerType', idKey: 'customerType',
hideSearch: true, hideSearch: true,
loadComplete: false, loadComplete: false,
options: [ options: [
{ {
optionId: 1, optionId: 1,
optionLabel: '个人' optionLabel: '个人'
}, },
{ {
optionId: 2, optionId: 2,
optionLabel: '企业' optionLabel: '企业'
}, },
{ {
optionId: 3, optionId: 3,
optionLabel: '个人(港澳)' optionLabel: '个人(港澳)'
}, },
{ {
optionId: 4, optionId: 4,
optionLabel: '个人(台)' optionLabel: '个人(台)'
}, },
{ {
optionId: 5, optionId: 5,
optionLabel: '个人(军官)' optionLabel: '个人(军官)'
} }
] ]
}, },
22: { 22: {
name: 'Options', name: 'Options',
title: '证件类型', title: '证件类型',
nullTips: '请选择证件类型', nullTips: '请选择证件类型',
idKey: 'cardType', idKey: 'cardType',
hideSearch: true, hideSearch: true,
loadComplete: false, loadComplete: false,
options: [ options: [
{ {
optionId: 1, optionId: 1,
optionLabel: '身份证' optionLabel: '身份证'
}, },
{ {
optionId: 2, optionId: 2,
optionLabel: '统一社会信息代码' optionLabel: '统一社会信息代码'
}, },
{ {
optionId: 3, optionId: 3,
optionLabel: '港澳返乡证' optionLabel: '港澳返乡证'
}, },
{ {
optionId: 4, optionId: 4,
optionLabel: '台胞证' optionLabel: '台胞证'
}, },
{ {
optionId: 5, optionId: 5,
optionLabel: '军官证' optionLabel: '军官证'
}, },
{ {
optionId: 7, optionId: 7,
optionLabel: '护照' optionLabel: '护照'
} }
] ]
}, },
23: { 23: {
name: 'Options', name: 'Options',
title: '购车类型', title: '购车类型',
nullTips: '请选择购车类型', nullTips: '请选择购车类型',
idKey: 'buyCarType', idKey: 'buyCarType',
hideSearch: true, hideSearch: true,
loadComplete: false, loadComplete: false,
options: [ options: [
{ {
optionId: 0, optionId: 0,
optionLabel: '贷款车' optionLabel: '贷款车'
}, },
{ {
optionId: 1, optionId: 1,
optionLabel: '全款车' optionLabel: '全款车'
} }
] ]
}, },
24: { 24: {
name: 'Options', name: 'Options',
title: '车辆使用性质', title: '车辆使用性质',
nullTips: '请选择车辆使用性质', nullTips: '请选择车辆使用性质',
idKey: 'vehicleNature', idKey: 'vehicleNature',
hideSearch: true, hideSearch: true,
loadComplete: false, loadComplete: false,
options: [ options: [
{ {
optionId: 0, optionId: 0,
optionLabel: '营运' optionLabel: '营运'
}, },
{ {
optionId: 1, optionId: 1,
optionLabel: '非营运' optionLabel: '非营运'
} }
] ]
}, },
25: { 25: {
name: 'CarBrand', name: 'CarBrand',
title: '选择品牌车系', title: '选择品牌车系',
placeholder: '查找', placeholder: '查找',
idKey: 'vehicleShapeId', idKey: 'vehicleShapeId',
nullTips: '请选择品牌车系', nullTips: '请选择品牌车系',
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
noData: false, noData: false,
hideSearch: true, hideSearch: true,
popupStyle: 'height:90vh;' popupStyle: 'height:90vh;'
}, },
26: { 26: {
name: 'Gearbox', name: 'Gearbox',
title: '变速箱类型', title: '变速箱类型',
nullTips: '请选择变速箱类型', nullTips: '请选择变速箱类型',
idKey: 'gearbox', idKey: 'gearbox',
hideSearch: true, hideSearch: true,
loadComplete: false loadComplete: false
}, },
27: { 27: {
name: 'EmployeeList', name: 'EmployeeList',
title: '销售顾问/录单员', title: '销售顾问/录单员',
placeholder: '请输入姓名', placeholder: '请输入姓名',
idKey: ['referrerId', 'userId'], idKey: ['referrerId', 'userId'],
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
noData: false, noData: false,
defeat: true defeat: true
} }
} }
export default { componentConfig } export default { componentConfig }
...@@ -79,43 +79,7 @@ export default { ...@@ -79,43 +79,7 @@ export default {
moduleIconEnum, moduleIconEnum,
moduleContentEnum, moduleContentEnum,
topList: [], topList: [],
msgList: [ msgList: []
{
moduleType: 3,
title: '请在06-dfasd',
createdTime: new Date().getTime(),
count: null,
strdate: '2025-06-11'
},
{
moduleType: 4,
title: '请在06-csaf ',
createdTime: new Date().getTime(),
count: 698,
strdate: '2025-06-11'
},
{
moduleType: 0,
title: '#这是通知标题##这是通知标题##这是通知标题##这是通知标题##这是通知标题#',
createdTime: new Date().getTime(),
count: 6,
strdate: '2025-06-11'
},
{
moduleType: 2,
title: 'dfs',
createdTime: new Date().getTime(),
count: 99,
strdate: '2025-06-12'
},
{
moduleType: 1,
title: 'df ',
createdTime: new Date().getTime(),
count: 99,
strdate: '2025-06-12'
}
]
} }
}, },
watch: { watch: {
...@@ -138,10 +102,6 @@ export default { ...@@ -138,10 +102,6 @@ export default {
// 过滤出topList中包含moduleType的对象 // 过滤出topList中包含moduleType的对象
const result = this.msgList.filter(item => this.topList.includes(item.moduleType)); const result = this.msgList.filter(item => this.topList.includes(item.moduleType));
return result return result
// // 按topList中的倒序排列
// return this.topList.slice().reverse().map(type =>
// this.msgList.find(item => item.moduleType === type)
// ).filter(Boolean);
}, },
getList() { getList() {
// 过滤掉topList中包含moduleType的对象 // 过滤掉topList中包含moduleType的对象
...@@ -183,9 +143,6 @@ export default { ...@@ -183,9 +143,6 @@ export default {
}, },
handleClick(item) { handleClick(item) {
this.$emit('handleClick', item) this.$emit('handleClick', item)
// uni.navigateTo({
// url: `/pages/common/serviceDetail/index?moduleType=${moduleType}`
// })
} }
} }
} }
......
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
nothing: false, nothing: false,
total: 0, total: 0,
pageNum: 1, pageNum: 1,
pageSize: 12, pageSize: 16,
scrollTop: 0, scrollTop: 0,
COURSE_TYPE COURSE_TYPE
} }
...@@ -137,11 +137,13 @@ export default { ...@@ -137,11 +137,13 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.completed-course { .completed-course {
height: calc(100% - #{toRpx(100)}); // height: calc(100% - #{toRpx(100)});
height: 100%;
.scroll-view { .scroll-view {
margin-top: toRpx(40); margin-top: toRpx(40);
height: calc(100% - #{toRpx(70)}); // height: calc(100% - #{toRpx(50)});
height: 100%;
.completed-course-list { .completed-course-list {
display: grid; display: grid;
......
...@@ -105,8 +105,6 @@ export default { ...@@ -105,8 +105,6 @@ export default {
if(currentWebview){ if(currentWebview){
currentWebview.close() currentWebview.close()
} }
// 点击返回按钮,触发学习弹窗事件
uni.$emit('showStudyPopup', {name: 'courseDetail', type: 'getLevelExamInfo'})
uni.navigateBack() uni.navigateBack()
}, },
async openCourse(index, item) { async openCourse(index, item) {
......
...@@ -95,8 +95,6 @@ export default { ...@@ -95,8 +95,6 @@ export default {
}, },
methods: { methods: {
back() { back() {
// 点击返回按钮,触发学习弹窗事件
uni.$emit('showStudyPopup', {name: 'leaderboard', type: 'getLevelExamInfo'})
uni.navigateBack() uni.navigateBack()
}, },
switchTab(index) { switchTab(index) {
......
...@@ -74,8 +74,6 @@ export default { ...@@ -74,8 +74,6 @@ export default {
}, },
methods: { methods: {
back() { back() {
// 点击返回按钮,触发学习弹窗事件
uni.$emit('showStudyPopup', {name: 'myCourse', type: 'getLevelExamInfo'})
uni.navigateBack() uni.navigateBack()
}, },
switchTab(index) { switchTab(index) {
...@@ -125,6 +123,7 @@ export default { ...@@ -125,6 +123,7 @@ export default {
position: relative; position: relative;
z-index: 10; z-index: 10;
background: transparent; background: transparent;
height: toRpx(140);
.nav-bar { .nav-bar {
display: flex; display: flex;
...@@ -157,7 +156,7 @@ export default { ...@@ -157,7 +156,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 toRpx(64); padding: 0 toRpx(64);
margin-top: toRpx(52); // margin-top: toRpx(52);
.tab-item { .tab-item {
width: toRpx(208); width: toRpx(208);
height: toRpx(72); height: toRpx(72);
......
...@@ -51,7 +51,7 @@ export default { ...@@ -51,7 +51,7 @@ export default {
}, },
created() { created() {
// 在组件创建时就开始监听,确保事件能被捕获 // 在组件创建时就开始监听,确保事件能被捕获
uni.$on('showStudyPopup', () => { uni.$on('afterStudyPopup', () => {
console.log('接收到考试提交弹窗事件') console.log('接收到考试提交弹窗事件')
if (this.currentTab === 1) { if (this.currentTab === 1) {
this.$refs.failedExam.showExamPopup = true this.$refs.failedExam.showExamPopup = true
...@@ -62,15 +62,13 @@ export default { ...@@ -62,15 +62,13 @@ export default {
}, },
beforeDestroy() { beforeDestroy() {
// 组件销毁前移除监听 // 组件销毁前移除监听
uni.$off('showStudyPopup') uni.$off('afterStudyPopup')
}, },
mounted() { mounted() {
this.getExamStatistics() this.getExamStatistics()
}, },
methods: { methods: {
back() { back() {
// 点击返回按钮,触发学习弹窗事件
uni.$emit('showStudyPopup', {name: 'myExam', type: 'getLevelExamInfo'})
uni.navigateBack() uni.navigateBack()
}, },
switchTab(index) { switchTab(index) {
...@@ -97,7 +95,7 @@ export default { ...@@ -97,7 +95,7 @@ export default {
background-image: url('@/assets/images/common/page-bg.webp'); background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%; background-size: 100%;
box-sizing: border-box; box-sizing: border-box;
padding-top: toRpx(112); padding-top: toRpx(156);
} }
.nav-bar { .nav-bar {
...@@ -132,7 +130,7 @@ export default { ...@@ -132,7 +130,7 @@ export default {
.tab-container { .tab-container {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: toRpx(44); // margin-top: toRpx(44);
margin-bottom: toRpx(28); margin-bottom: toRpx(28);
padding: 0 toRpx(64); padding: 0 toRpx(64);
.tab-item { .tab-item {
......
...@@ -123,8 +123,6 @@ ...@@ -123,8 +123,6 @@
}, },
methods: { methods: {
back() { back() {
// 点击返回按钮,触发学习弹窗事件
uni.$emit('showStudyPopup', {name: 'myTask', type: 'getLevelExamInfo'})
uni.navigateBack() uni.navigateBack()
}, },
goToMyTask() { goToMyTask() {
......
...@@ -37,6 +37,7 @@ export default { ...@@ -37,6 +37,7 @@ export default {
return { return {
webviewUrl: '', webviewUrl: '',
pageTitle: '学习测评', pageTitle: '学习测评',
type: null,
wv: null, wv: null,
hotArea: null, // 存储热区对象 hotArea: null, // 存储热区对象
showLoading: true // 控制 loading 显示 showLoading: true // 控制 loading 显示
...@@ -50,6 +51,9 @@ export default { ...@@ -50,6 +51,9 @@ export default {
// 和 detail.vue 一样,直接使用 URL,不需要 decode // 和 detail.vue 一样,直接使用 URL,不需要 decode
this.webviewUrl = options.url this.webviewUrl = options.url
} }
if (options.type) {
this.type = options.type
}
console.log('📱 学习中心 webview 接收到的 URL (直接使用):', this.webviewUrl) console.log('📱 学习中心 webview 接收到的 URL (直接使用):', this.webviewUrl)
// 提取并解码 return_url 部分以便查看 // 提取并解码 return_url 部分以便查看
...@@ -91,13 +95,6 @@ export default { ...@@ -91,13 +95,6 @@ export default {
this.hotArea = null this.hotArea = null
} }
}, },
onBackPress (options) {
if (options.from === 'backbutton') {
this.back()
return true
}
return false
},
onBackPress(options) { onBackPress(options) {
if (options.from === 'backbutton') { if (options.from === 'backbutton') {
// 阻止默认返回 // 阻止默认返回
...@@ -160,16 +157,24 @@ export default { ...@@ -160,16 +157,24 @@ export default {
}, },
back () { back () {
console.log('触发返回,发送事件') console.log('触发返回,发送事件')
const {type } = this
console.log(type, 'type')
// 先返回上一页 // 先返回上一页
uni.navigateBack({ uni.navigateBack({
success: () => { success: () => {
console.log('返回成功,触发弹窗事件') console.log('返回成功,触发弹窗事件')
uni.$logger.local.info('返回成功,触发弹窗事件', type)
// 延迟触发事件,确保页面已经返回 // 延迟触发事件,确保页面已经返回
setTimeout(() => { setTimeout(() => {
if (type == 0) {
uni.$emit('levelStudyPopup')
} else if (type == 1) {
uni.$emit('afterStudyPopup')
}
// uni.$emit('showExamSubmitPopup') // uni.$emit('showExamSubmitPopup')
uni.$emit('showStudyPopup', { // uni.$emit('showStudyPopup', {
type: 'examSubmit' // type: 'examSubmit'
}) // })
}, 100) }, 100)
} }
}) })
......
<template> <template>
<view class="equity-box"> <view class="equity-box">
<view class="common-title">服务信息录入</view> <view class="common-title">服务信息录入</view>
<template v-if="loadComplete"> <template v-if="loadComplete">
<view class="box"> <view class="box">
<scroll-view <scroll-view
scroll-y scroll-y
class="scroll-view" class="scroll-view"
> >
<view <view
class="box-content" class="box-content"
:key="viewKey" :key="viewKey"
> >
<GlCell <GlCell
:formList="formList" :formList="formList"
:formData="orderObj" :formData="orderObj"
@inputBlur="inputBlur" @inputBlur="inputBlur"
@handleCell="handleCell" @handleCell="handleCell"
:titleList="titleList" :titleList="titleList"
@collapseAll="collapseAll" @collapseAll="collapseAll"
collapseControl collapseControl
@radioChange="radioChange" @radioChange="radioChange"
> >
<template #goodsHtml> <template #goodsHtml>
<EquityGoods <EquityGoods
:externalData="orderObj" :externalData="orderObj"
ref="goodsRef" ref="goodsRef"
/> />
</template> </template>
<template #tireHtml> <template #tireHtml>
<template v-if="orderObj.tireFlag == 1"> <template v-if="orderObj.tireFlag == 1">
<EquityTire <EquityTire
:externalData="orderObj" :externalData="orderObj"
ref="tireRef" ref="tireRef"
/> />
</template> </template>
</template> </template>
<template #uploadHtml> <template #uploadHtml>
<EquityUpload <EquityUpload
:externalData="orderObj" :externalData="orderObj"
ref="uplopdRef" ref="uplopdRef"
/> />
</template> </template>
<template #conversion> <template #conversion>
<template v-if="orderObj.inclueType == 1"> <template v-if="orderObj.inclueType == 1">
<EquityConversion <EquityConversion
:externalData="orderObj" :externalData="orderObj"
ref="conversionRef" ref="conversionRef"
/> />
</template> </template>
</template> </template>
</GlCell> </GlCell>
</view> </view>
<view class="btns flex"> <view class="btns flex">
<view <view
class="btn save" class="btn save"
@click="submit(0)" @click="submit(0)"
>存草稿</view> >存草稿</view>
<view <view
@click="submit(1)" @click="submit(1)"
class="btn" class="btn"
>确认提交</view> >确认提交</view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>
<order-popup <order-popup
ref="orderPopup" ref="orderPopup"
:data="orderObj" :data="orderObj"
@onConfirm="onConfirm" @onConfirm="onConfirm"
:popupType="popupType" :popupType="popupType"
/> />
<uni-calendar <uni-calendar
ref="calendar" ref="calendar"
:insert="false" :insert="false"
:clearDate="false" :clearDate="false"
:endDate="endDate" :endDate="endDate"
@confirm="confirmCalendar($event,'billingDate')" @confirm="confirmCalendar($event,'billingDate')"
:date="orderObj.billingDate" :date="orderObj.billingDate"
showBottomBtn showBottomBtn
/> />
<uni-calendar <uni-calendar
ref="futureCalendar" ref="futureCalendar"
:insert="false" :insert="false"
:clearDate="false" :clearDate="false"
:startDate="endDate" :startDate="endDate"
@confirm="confirmCalendar($event,'effectiveDate')" @confirm="confirmCalendar($event,'effectiveDate')"
:date="orderObj.effectiveDate" :date="orderObj.effectiveDate"
showBottomBtn showBottomBtn
/> />
<NoticePopup <NoticePopup
ref="reportNotice" ref="reportNotice"
:title="noticeObj.title" :title="noticeObj.title"
:text="noticeObj.text" :text="noticeObj.text"
:type="noticeObj.type || 'success'" :type="noticeObj.type || 'success'"
:buttons="noticeObj.buttons" :buttons="noticeObj.buttons"
></NoticePopup> ></NoticePopup>
</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 { import {
EQUITY_FORM_LIST EQUITY_FORM_LIST
, EQUITY_FORM_TITLE_LIST, , EQUITY_FORM_TITLE_LIST,
EQUITY_POPUP_ENUM, EQUITY_POPUP_ENUM,
tireObjList, tireObjList,
EQUITY_FORM_RULE, EQUITY_FORM_RULE,
energyFormRule, energyFormRule,
oilFormRule, oilFormRule,
extendServiceFormRule extendServiceFormRule
} from '../contant' } 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 './EquityForm/EquityGoods.vue' import EquityGoods from './EquityForm/EquityGoods.vue'
import EquityTire from './EquityForm/EquityTire.vue' import EquityTire from './EquityForm/EquityTire.vue'
import EquityUpload from './EquityForm/EquityUpload.vue' import EquityUpload from './EquityForm/EquityUpload.vue'
import EquityConversion from './EquityForm/EquityConversion.vue' import EquityConversion from './EquityForm/EquityConversion.vue'
import NP from 'number-precision' import NP from 'number-precision'
import NoticePopup from '@/components/NoticePopup.vue' import NoticePopup from '@/components/NoticePopup.vue'
import { validateVin, formatVinInput } from '@/utils/vinVaildate' import { validateVin, formatVinInput } from '@/utils/vinVaildate'
const codeToAttr = { const codeToAttr = {
YB0001: 'invoice', YB0001: 'invoice',
YB0003: 'driveFront', YB0003: 'driveFront',
YB0004: 'driveBack', YB0004: 'driveBack',
YB0002: 'contract', YB0002: 'contract',
YB0005: 'other', YB0005: 'other',
QS0001: 'retrofitInvoice', QS0001: 'retrofitInvoice',
QS0002: 'retrofit' QS0002: 'retrofit'
}, },
attrToCode = { attrToCode = {
invoice: 'YB0001', invoice: 'YB0001',
driveFront: 'YB0003', driveFront: 'YB0003',
driveBack: 'YB0004', driveBack: 'YB0004',
contract: 'YB0002', contract: 'YB0002',
other: 'YB0005', other: 'YB0005',
retrofitInvoice: 'QS0001', retrofitInvoice: 'QS0001',
retrofit: 'QS0002' retrofit: 'QS0002'
}, },
ybAttachmentFlagTips = { ybAttachmentFlagTips = {
YB0001: '购车发票', YB0001: '购车发票',
YB0003: '行驶证主页', YB0003: '行驶证主页',
YB0004: '行驶证副页', YB0004: '行驶证副页',
YB0002: '合同购买时里程数', YB0002: '合同购买时里程数',
YB0005: '其他', YB0005: '其他',
}, },
qsFlagTips = { qsFlagTips = {
QS0001: '发票或收据', QS0001: '发票或收据',
QS0002: '加改装部位' QS0002: '加改装部位'
} }
export default { export default {
name: 'CreateEquity', name: 'CreateEquity',
components: { components: {
GlCell, GlCell,
OrderPopup, OrderPopup,
EquityGoods, EquityGoods,
EquityTire, EquityTire,
EquityUpload, EquityUpload,
EquityConversion, EquityConversion,
NoticePopup NoticePopup
}, },
props: { props: {
transmissionOfData: { transmissionOfData: {
type: Object, type: Object,
default: () => null default: () => null
} }
}, },
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'), endDate: dayjs().format('YYYY-MM-DD'),
equityFormRule: utils.deepClone(EQUITY_FORM_RULE), equityFormRule: utils.deepClone(EQUITY_FORM_RULE),
orderObj: {}, orderObj: {},
loadComplete: false, loadComplete: false,
popupType: 0, popupType: 0,
viewKey: Date.now(), viewKey: Date.now(),
conSecondObj: { conSecondObj: {
vin: '' vin: ''
}, },
noticeObj: {}, noticeObj: {},
validateState: true validateState: true
} }
}, },
watch: { watch: {
transmissionOfData: { transmissionOfData: {
handler (val) { handler (val) {
if (val && val.contractNo) this.getServiceInfoDetail({ if (val && val.contractNo) this.getServiceInfoDetail({
contractNo: val.contractNo contractNo: val.contractNo
}, 1) }, 1)
if (val && val.orderId) this.getServiceInfoDetail({ if (val && val.orderId) this.getServiceInfoDetail({
orderId: val.orderId orderId: val.orderId
}, 2) }, 2)
}, },
deep: true, deep: true,
immediate: true immediate: true
} }
}, },
computed: { computed: {
orderPopupRef () { orderPopupRef () {
return this.$refs.orderPopup return this.$refs.orderPopup
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
// 车架号动态校验 // 车架号动态校验
validateVin () { validateVin () {
let carVinVal = this.orderObj.vin; let carVinVal = this.orderObj.vin;
if (carVinVal) { if (carVinVal) {
this.orderObj.carVin = formatVinInput(carVinVal) this.orderObj.carVin = formatVinInput(carVinVal)
validateVin(this.orderObj.carVin).then(result => { validateVin(this.orderObj.carVin).then(result => {
console.log("validateVin", result); console.log("validateVin", result);
let { valid } = result.data; let { valid } = result.data;
this.validateState = valid this.validateState = valid
// 校验成功,所有提示已在公共方法中处理 // 校验成功,所有提示已在公共方法中处理
console.log('车架号校验成功:', result) console.log('车架号校验成功:', result)
}).catch(err => { }).catch(err => {
console.log("validateVinErr", result); console.log("validateVinErr", result);
}) })
} }
}, },
// 单选框change事件 // 单选框change事件
radioChange (e, val) { radioChange (e, val) {
this.$set(this.orderObj, val.value, e.detail.value) this.$set(this.orderObj, val.value, e.detail.value)
this.formList.map(k => { this.formList.map(k => {
k.map(i => { k.map(i => {
if (i.value == val.value) i.current = e.detail.value if (i.value == val.value) i.current = e.detail.value
}) })
}) })
this.viewKey = Date.now() this.viewKey = Date.now()
}, },
handleCell (val) { handleCell (val) {
if (['calendar', 'futureCalendar'].includes(val.key)) return this.$refs[val.key]?.open() 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.popupType = Object.keys(EQUITY_POPUP_ENUM).find(key => EQUITY_POPUP_ENUM[key].key === val.key) * 1
this.orderPopupRef.open() this.orderPopupRef.open()
}, },
onConfirm (val) { onConfirm (val) {
const { chooseContent, popupType } = val, const { chooseContent, popupType } = val,
_typeValue = EQUITY_POPUP_ENUM[popupType] _typeValue = EQUITY_POPUP_ENUM[popupType]
if (_typeValue.key == 'carBrand') { if (_typeValue.key == 'carBrand') {
Object.assign(this.orderObj, chooseContent) Object.assign(this.orderObj, chooseContent)
this.$set(this.orderObj, 'carBrandText', this.$set(this.orderObj, 'carBrandText',
`${chooseContent.vehicleBrandName}/${chooseContent.vehicleSubBrandName}/${chooseContent.vehicleSeriesName}/${chooseContent.vehicleShapeName}`) `${chooseContent.vehicleBrandName}/${chooseContent.vehicleSubBrandName}/${chooseContent.vehicleSeriesName}/${chooseContent.vehicleShapeName}`)
this.viewKey = Date.now() this.viewKey = Date.now()
return return
} else if (_typeValue.options) { } else if (_typeValue.options) {
this.$set(this.orderObj, _typeValue.targetIdKey, chooseContent[_typeValue.sourceIdKey || 'optionId']) this.$set(this.orderObj, _typeValue.targetIdKey, chooseContent[_typeValue.sourceIdKey || 'optionId'])
this.$set(this.orderObj, _typeValue.targetNameKey, chooseContent[_typeValue.sourceNameKey || 'optionLabel']) this.$set(this.orderObj, _typeValue.targetNameKey, chooseContent[_typeValue.sourceNameKey || 'optionLabel'])
this.viewKey = Date.now() this.viewKey = Date.now()
return return
} }
this.$set(this.orderObj, _typeValue.value, chooseContent) this.$set(this.orderObj, _typeValue.value, chooseContent)
this.viewKey = Date.now() this.viewKey = Date.now()
}, },
inputBlur (e, val) { inputBlur (e, val) {
this.orderObj[val.value] = this.orderObj[val.value] this.orderObj[val.value] = this.orderObj[val.value]
// VIN车架号动态校验:车架号字段,动态转换为大写 // VIN车架号动态校验:车架号字段,动态转换为大写
if (val.value === 'vin') this.validateVin() if (val.value === 'vin') this.validateVin()
}, },
async getServiceInfoDetail (paramSdata, type) { async getServiceInfoDetail (paramSdata, type) {
try { try {
uni.showLoading({ uni.showLoading({
title: '加载中...', title: '加载中...',
mask: true mask: true
}) })
let targetApi = type == 1 ? 'getServiceInfoDetail' : 'getEquityOrderByOrderId' let targetApi = type == 1 ? 'getServiceInfoDetail' : 'getEquityOrderByOrderId'
const data = await uni.$api.equityApi[targetApi](paramSdata) const data = await uni.$api.equityApi[targetApi](paramSdata)
if (!data) throw '获取数据失败' if (!data) throw '获取数据失败'
if (data.ybAttachmentFlag != 0) this.formList[3] = [] if (data.ybAttachmentFlag != 0) this.formList[3] = []
if (data.qsFlag != 1) this.formList[4] = [] if (data.qsFlag != 1) this.formList[4] = []
this.orderObj.goodInfoList = data.goodInfoList this.orderObj.goodInfoList = data.goodInfoList
this.orderObj.tireFlag = data.tireFlag this.orderObj.tireFlag = data.tireFlag
let carInfo = {}, let carInfo = {},
params = {} params = {}
if (data.vehicleShapeId) { if (data.vehicleShapeId) {
carInfo = { carInfo = {
carBrandText: `${data.vehicleBrandName}/${data.vehicleSubBrandName}/${data.vehicleSeriesName}/${data.vehicleShapeName}`, carBrandText: `${data.vehicleBrandName}/${data.vehicleSubBrandName}/${data.vehicleSeriesName}/${data.vehicleShapeName}`,
vehicleShapeId: data.vehicleShapeId, vehicleShapeId: data.vehicleShapeId,
vehicleShapeName: data.vehicleShapeName, vehicleShapeName: data.vehicleShapeName,
vehicleSeriesId: data.vehicleSeriesId, vehicleSeriesId: data.vehicleSeriesId,
vehicleSeriesName: data.vehicleSeriesName, vehicleSeriesName: data.vehicleSeriesName,
vehicleBrandId: data.vehicleBrandId, vehicleBrandId: data.vehicleBrandId,
vehicleBrandName: data.vehicleBrandName, vehicleBrandName: data.vehicleBrandName,
vehicleSubBrandId: data.vehicleSubBrandId, vehicleSubBrandId: data.vehicleSubBrandId,
vehicleSubBrandName: data.vehicleSubBrandName, vehicleSubBrandName: data.vehicleSubBrandName,
} }
} }
if (!data.customerType) data.customerType = 1 if (!data.customerType) data.customerType = 1
if (data.customerType) { if (data.customerType) {
const customerTypeEnum = this.orderPopupRef.componentObject[21].options const customerTypeEnum = this.orderPopupRef.componentObject[21].options
params = { params = {
customerType: data.customerType, customerType: data.customerType,
customerTypeName: customerTypeEnum.find(i => i.optionId == data.customerType).optionLabel customerTypeName: customerTypeEnum.find(i => i.optionId == data.customerType).optionLabel
} }
} }
if (data.cardType) { if (data.cardType) {
const cardTypeEnum = this.orderPopupRef.componentObject[22].options const cardTypeEnum = this.orderPopupRef.componentObject[22].options
params.cardType = data.cardType params.cardType = data.cardType
params.cardTypeName = cardTypeEnum.find(i => i.optionId == data.cardType).optionLabel params.cardTypeName = cardTypeEnum.find(i => i.optionId == data.cardType).optionLabel
} }
if (data.buyCarType == null) data.buyCarType = 1 if (data.buyCarType == null) data.buyCarType = 1
if (data.buyCarType != null) { if (data.buyCarType != null) {
const buyCarTypeEnum = this.orderPopupRef.componentObject[23].options const buyCarTypeEnum = this.orderPopupRef.componentObject[23].options
params.buyCarType = data.buyCarType params.buyCarType = data.buyCarType
params.buyCarTypeName = buyCarTypeEnum.find(i => i.optionId == data.buyCarType).optionLabel params.buyCarTypeName = buyCarTypeEnum.find(i => i.optionId == data.buyCarType).optionLabel
} }
let priceList = ['actualSalesPrice'] let priceList = ['actualSalesPrice']
data.goodInfoList.map((item, idx) => { data.goodInfoList.map((item, idx) => {
if (item.actualSalesPrice) item.actualSalesPrice = NP.divide(Number(item.actualSalesPrice), 100).toFixed(2) if (item.actualSalesPrice) item.actualSalesPrice = NP.divide(Number(item.actualSalesPrice), 100).toFixed(2)
// priceList.forEach(k => { // priceList.forEach(k => {
// data.goodInfoList[idx][k] = item[k] === null ? null : (item[k] / 100).toFixed(2) // data.goodInfoList[idx][k] = item[k] === null ? null : (item[k] / 100).toFixed(2)
// }) // })
if (item.vehicleRegistrationDate) { if (item.vehicleRegistrationDate) {
item.vehicleRegistrationDate = dayjs(item.vehicleRegistrationDate).format('YYYY-MM-DD') item.vehicleRegistrationDate = dayjs(item.vehicleRegistrationDate).format('YYYY-MM-DD')
} }
if (item.buyDate) { if (item.buyDate) {
item.buyDate = dayjs(item.buyDate).format('YYYY-MM-DD') item.buyDate = dayjs(item.buyDate).format('YYYY-MM-DD')
} }
if (item.qualityBeginDate) { if (item.qualityBeginDate) {
item.qualityBeginDate = dayjs(item.qualityBeginDate).format('YYYY-MM-DD') item.qualityBeginDate = dayjs(item.qualityBeginDate).format('YYYY-MM-DD')
} }
if (item.itemsCode == 'YB0003') { if (item.itemsCode == 'YB0003') {
item.gearbox = item.gearbox || '' item.gearbox = item.gearbox || ''
item.vehicleNature = typeof item.vehicleNature == 'number' ? item.vehicleNature : 1 item.vehicleNature = typeof item.vehicleNature == 'number' ? item.vehicleNature : 1
let val = constantData.vehicleNatureList.find(k => k.optionId == item.vehicleNature) let val = constantData.vehicleNatureList.find(k => k.optionId == item.vehicleNature)
if (val) { if (val) {
item.vehicleNatureName = val.optionLabel item.vehicleNatureName = val.optionLabel
} }
} }
if (item.printType == 2 && !['YB0001', 'YB0002', 'YB0003'].includes(item.itemsCode)) item.displacementPowerFlag = item.displacementPowerFlag || 0 if (item.printType == 2 && !['YB0001', 'YB0002', 'YB0003'].includes(item.itemsCode)) item.displacementPowerFlag = item.displacementPowerFlag || 0
}) })
// 判断购买商品是否全部是延保allWarrantyFlag // 判断购买商品是否全部是延保allWarrantyFlag
const allWarrantyFlag = data?.goodInfoList?.some(v => v.printType != 2), const allWarrantyFlag = data?.goodInfoList?.some(v => v.printType != 2),
imgObj = {} imgObj = {}
Object.keys(codeToAttr).map(key => { Object.keys(codeToAttr).map(key => {
if (codeToAttr[key] == 'other') imgObj[codeToAttr[key]] = [] if (codeToAttr[key] == 'other') imgObj[codeToAttr[key]] = []
else imgObj[codeToAttr[key]] = '' else imgObj[codeToAttr[key]] = ''
}) })
this.formList.map(i => { this.formList.map(i => {
i.map(e => { i.map(e => {
if (e.value == 'effectiveDate') e.hidden = !allWarrantyFlag //false 显示生效日期 true不显示 if (e.value == 'effectiveDate') e.hidden = !allWarrantyFlag //false 显示生效日期 true不显示
}) })
}) })
/**图片 */ /**图片 */
if ((data.ybAttachmentFlag == 0 || data.qsFlag == 1) && data.attachmentList?.length) { if ((data.ybAttachmentFlag == 0 || data.qsFlag == 1) && data.attachmentList?.length) {
data.attachmentList.forEach(item => { data.attachmentList.forEach(item => {
if (item.attachmentCode == 'YB0005') imgObj[codeToAttr[item.attachmentCode]].push(item.attachmentFile) if (item.attachmentCode == 'YB0005') imgObj[codeToAttr[item.attachmentCode]].push(item.attachmentFile)
else imgObj[codeToAttr[item.attachmentCode]] = item.attachmentFile else imgObj[codeToAttr[item.attachmentCode]] = item.attachmentFile
}) })
} }
if (data.tireFlag == 0) { if (data.tireFlag == 0) {
const list = ['tireBrand', 'tireScale', 'leftFrontDTO', 'leftFrontBatch', 'rightFrontDTO', 'rightFrontBatch', 'leftRearDTO', 'leftRearBatch', 'rightRearDTO', 'rightRearBatch'] const list = ['tireBrand', 'tireScale', 'leftFrontDTO', 'leftFrontBatch', 'rightFrontDTO', 'rightFrontBatch', 'leftRearDTO', 'leftRearBatch', 'rightRearDTO', 'rightRearBatch']
list.map(key => { list.map(key => {
this.equityFormRule[key][0].required = false this.equityFormRule[key][0].required = false
}) })
} }
/**轮胎 */ /**轮胎 */
if (data.attributeList?.length) { if (data.attributeList?.length) {
data.attributeList.map((e, idx) => { data.attributeList.map((e, idx) => {
if (e.attributeValue) data[tireObjList[idx].attr] = e.attributeValue if (e.attributeValue) data[tireObjList[idx].attr] = e.attributeValue
}) })
} }
let inclueType = data.addOnsFlag == 0 ? 2 : 1 let inclueType = data.addOnsFlag == 0 ? 2 : 1
Object.assign(this.orderObj, { Object.assign(this.orderObj, {
...data, ...data,
vin: data.vin, vin: data.vin,
invoicePrice: NP.divide(Number(data.invoicePrice || 0), 100).toFixed(2), invoicePrice: NP.divide(Number(data.invoicePrice || 0), 100).toFixed(2),
seatesNum: data.seatesNum, seatesNum: data.seatesNum,
seat: data.seatesNum, seat: data.seatesNum,
engineNo: data.engineNo, engineNo: data.engineNo,
vehicleColor: data.vehicleColor, vehicleColor: data.vehicleColor,
billingDate: data.billingDate ? dayjs(data.billingDate).format('YYYY-MM-DD') : dayjs().format('YYYY-MM-DD'), billingDate: data.billingDate ? dayjs(data.billingDate).format('YYYY-MM-DD') : dayjs().format('YYYY-MM-DD'),
customerName: data.customerName, customerName: data.customerName,
customerPhone: data.customerPhone, customerPhone: data.customerPhone,
cardNo: data.cardNo, cardNo: data.cardNo,
customerAddress: data.customerAddress, customerAddress: data.customerAddress,
goodInfoList: data.goodInfoList, goodInfoList: data.goodInfoList,
effectiveDate: data.effectiveDate ? dayjs(data.effectiveDate).format('YYYY-MM-DD') : dayjs().add(1, 'day').format('YYYY-MM-DD'), effectiveDate: data.effectiveDate ? dayjs(data.effectiveDate).format('YYYY-MM-DD') : dayjs().add(1, 'day').format('YYYY-MM-DD'),
tireFlag: data.tireFlag, tireFlag: data.tireFlag,
compensationName: data.compensationName || data.customerName, compensationName: data.compensationName || data.customerName,
attachmentList: data.attachmentList || [], attachmentList: data.attachmentList || [],
merchantName: data.merchantName, merchantName: data.merchantName,
merchantPhone: data.merchantPhone, merchantPhone: data.merchantPhone,
merchantAddress: data.merchantAddress, merchantAddress: data.merchantAddress,
imgObj, imgObj,
inclueType, inclueType,
...carInfo, ...carInfo,
...params ...params
}) })
this.formList[4].map(e => { this.formList[4].map(e => {
if (e.value == 'inclueType') e.current = inclueType if (e.value == 'inclueType') e.current = inclueType
}) })
this.viewKey = Date.now() this.viewKey = Date.now()
this.loadComplete = true this.loadComplete = true
uni.hideLoading() uni.hideLoading()
} catch (error) { } catch (error) {
uni.hideLoading() uni.hideLoading()
this.viewKey = Date.now() this.viewKey = Date.now()
this.loadComplete = true this.loadComplete = true
if (error) uni.showToast({ if (error) uni.showToast({
title: error, title: error,
icon: 'none' icon: 'none'
}) })
} }
}, },
collapseAll (index) { collapseAll (index) {
this.titleList[index].collapseAll = !this.titleList[index].collapseAll this.titleList[index].collapseAll = !this.titleList[index].collapseAll
}, },
confirmCalendar (e, key) { confirmCalendar (e, key) {
this.orderObj[key] = e.fulldate this.orderObj[key] = e.fulldate
this.viewKey = Date.now() this.viewKey = Date.now()
}, },
async submit (operationType) { async submit (operationType) {
// VIN车架号-动态校验 // VIN车架号-动态校验
const carVin = this.orderObj.vin const carVin = this.orderObj.vin
if (carVin) { if (carVin) {
// 前置判断 // 前置判断
if (carVin.length !== 17) { if (carVin.length !== 17) {
uni.showToast({ title: '请输入 17 位有效字符(支持大写 A-H/J-N/P-Z、0-9)', icon: 'none' }) uni.showToast({ title: '请输入 17 位有效字符(支持大写 A-H/J-N/P-Z、0-9)', icon: 'none' })
return false return false
} }
// 根据接口校验结果判断 // 根据接口校验结果判断
if (carVin.length === 17 && !this.validateState) { if (carVin.length === 17 && !this.validateState) {
uni.showToast({ title: '车架号校验不匹配,请核对后重新输入', icon: 'none' }) uni.showToast({ title: '车架号校验不匹配,请核对后重新输入', icon: 'none' })
return false return false
} }
} }
uni.showLoading({ uni.showLoading({
title: '提交中...', title: '提交中...',
mask: true mask: true
}) })
const { orderObj, conSecondObj } = this, const { orderObj, conSecondObj } = this,
{ goodsRef, tireRef, uplopdRef, conversionRef } = this.$refs { goodsRef, tireRef, uplopdRef, conversionRef } = this.$refs
let params = utils.deepClone(orderObj), let params = utils.deepClone(orderObj),
attachmentList = [], attachmentList = [],
attributeList = [] attributeList = []
if (tireRef) { if (tireRef) {
let { tireObj } = tireRef let { tireObj } = tireRef
tireObjList.map(item => { tireObjList.map(item => {
if (tireObj[item.attr]) { if (tireObj[item.attr]) {
attributeList.push({ attributeList.push({
attributeValue: tireObj[item.attr], attributeValue: tireObj[item.attr],
sort: item.sort, sort: item.sort,
attributeGroup: item.attributeGroup, attributeGroup: item.attributeGroup,
attributeName: item.attributeName attributeName: item.attributeName
}) })
params[item.attr] = tireObj[item.attr] params[item.attr] = tireObj[item.attr]
} }
}) })
params.attributeList = attributeList params.attributeList = attributeList
params.tireBrand = tireObj.tireBrand params.tireBrand = tireObj.tireBrand
params.tireScale = tireObj.tireScale params.tireScale = tireObj.tireScale
} }
if (goodsRef) { if (goodsRef) {
let goodInfoList = utils.deepClone(goodsRef.goodInfoList) let goodInfoList = utils.deepClone(goodsRef.goodInfoList)
goodInfoList.map(item => { goodInfoList.map(item => {
item.actualSalesPrice = NP.times(Number(item.actualSalesPrice), 100) item.actualSalesPrice = NP.times(Number(item.actualSalesPrice), 100)
}) })
params.goodInfoList = goodInfoList params.goodInfoList = goodInfoList
} }
if (uplopdRef || conversionRef) { if (uplopdRef || conversionRef) {
let imgObj = {} let imgObj = {}
if (uplopdRef) imgObj = uplopdRef.imgObj if (uplopdRef) imgObj = uplopdRef.imgObj
if (conversionRef && params.inclueType == 1) imgObj = { if (conversionRef && params.inclueType == 1) imgObj = {
...imgObj, ...imgObj,
...conversionRef.imgObj ...conversionRef.imgObj
} }
Object.keys(imgObj).map(key => { Object.keys(imgObj).map(key => {
if (Array.isArray(imgObj[key])) { if (Array.isArray(imgObj[key])) {
imgObj[key].map(item => { imgObj[key].map(item => {
attachmentList.push({ attachmentList.push({
attachmentCode: attrToCode[key], attachmentCode: attrToCode[key],
attachmentType: 'IMG', attachmentType: 'IMG',
attachmentFile: item attachmentFile: item
}) })
}) })
} else { } else {
attachmentList.push({ attachmentList.push({
attachmentCode: attrToCode[key], attachmentCode: attrToCode[key],
attachmentType: 'IMG', attachmentType: 'IMG',
attachmentFile: imgObj[key] attachmentFile: imgObj[key]
}) })
} }
}) })
} }
params.invoicePrice = NP.times(Number(params.invoicePrice), 100) params.invoicePrice = NP.times(Number(params.invoicePrice), 100)
params.attachmentList = attachmentList params.attachmentList = attachmentList
if (operationType == 0) { if (operationType == 0) {
this.confirm(params, operationType) this.confirm(params, operationType)
return return
} }
if (!this.checkOrder(params)) return uni.hideLoading() if (!this.checkOrder(params)) return uni.hideLoading()
const { code, message } = await uni.$api.equityApi.checkVinBuyEquityOrder({ const { code, message } = await uni.$api.equityApi.checkVinBuyEquityOrder({
vin: orderObj.vin vin: orderObj.vin
}) })
if (code == 0) { if (code == 0) {
this.confirm(params, operationType) this.confirm(params, operationType)
} else if (code == '-2') { } else if (code == '-2') {
if (conSecondObj.vin == orderObj.vin) { if (conSecondObj.vin == orderObj.vin) {
this.confirm(params, operationType) this.confirm(params, operationType)
this.conSecondObj.vin = '' this.conSecondObj.vin = ''
} else { } else {
this.conSecondObj.vin = orderObj.vin this.conSecondObj.vin = orderObj.vin
this.openNotice(message, params) this.openNotice(message, params)
} }
} else this.openNotice(message, params) } else this.openNotice(message, params)
}, },
checkOrder (params) { checkOrder (params) {
let { equityFormRule } = this let { equityFormRule } = this
try { try {
Object.keys(equityFormRule).map(key => { Object.keys(equityFormRule).map(key => {
let [nullCheck, validatorCheck] = equityFormRule[key] let [nullCheck, validatorCheck] = equityFormRule[key]
if (nullCheck.required) { if (nullCheck.required) {
if (!params[key]) throw equityFormRule[key][0].message if (!params[key]) throw equityFormRule[key][0].message
} else { else {
if (validatorCheck && validatorCheck.validator) { if (validatorCheck && validatorCheck.validator) {
const res = validatorCheck.validator('', params[key]) const res = validatorCheck.validator('', params[key])
if (res && res.message) throw res.message if (res && res.message) throw res.message
} }
} }
}
}) })
params.goodInfoList?.map(item => { params.goodInfoList?.map(item => {
if (item.printType == 2) { if (item.printType == 2) {
if (item.itemsCode == 'YB0003') Object.keys(oilFormRule).map(key => { if (item.itemsCode == 'YB0003') Object.keys(oilFormRule).map(key => {
let [nullCheck, validatorCheck] = oilFormRule[key] let [nullCheck, validatorCheck] = oilFormRule[key]
if (nullCheck.required) { if (nullCheck.required) {
if (!item[key]) throw oilFormRule[key][0].message if (!item[key]) throw oilFormRule[key][0].message
else { else {
if (validatorCheck && validatorCheck.validator) { if (validatorCheck && validatorCheck.validator) {
const res = validatorCheck.validator('', item[key]) const res = validatorCheck.validator('', item[key])
if (res && res.message) throw res.message if (res && res.message) throw res.message
} }
} }
} }
}) })
if (item.itemsCode == 'YB0001' || item.itemsCode == 'YB0002') Object.keys(energyFormRule).map(key => { if (item.itemsCode == 'YB0001' || item.itemsCode == 'YB0002') Object.keys(energyFormRule).map(key => {
let [nullCheck, validatorCheck] = energyFormRule[key] let [nullCheck, validatorCheck] = energyFormRule[key]
if (nullCheck.required) { if (nullCheck.required) {
if (!item[key]) throw energyFormRule[key][0].message if (!item[key]) throw energyFormRule[key][0].message
} else { } else {
if (validatorCheck && validatorCheck.validator) { if (validatorCheck && validatorCheck.validator) {
const res = validatorCheck.validator('', item[key]) const res = validatorCheck.validator('', item[key])
if (res && res.message) throw res.message if (res && res.message) throw res.message
} }
} }
}) })
if (item.itemsCode != 'YB0001' && item.itemsCode != 'YB0002' && item.itemsCode != 'YB0003') Object.keys(extendServiceFormRule).map(key => { if (item.itemsCode != 'YB0001' && item.itemsCode != 'YB0002' && item.itemsCode != 'YB0003') Object.keys(extendServiceFormRule).map(key => {
let [nullCheck, validatorCheck] = extendServiceFormRule[key] let [nullCheck, validatorCheck] = extendServiceFormRule[key]
if (nullCheck.required) { if (nullCheck.required) {
if (!item[key]) throw extendServiceFormRule[key][0].message if (!item[key]) throw extendServiceFormRule[key][0].message
} else { } else {
if (validatorCheck && validatorCheck.validator) { if (validatorCheck && validatorCheck.validator) {
const res = validatorCheck.validator('', item[key]) const res = validatorCheck.validator('', item[key])
if (res && res.message) throw res.message if (res && res.message) throw res.message
} }
} }
}) })
} }
}) })
if (params.ybAttachmentFlag == 0 || params.qsFlag == 1) { if (params.ybAttachmentFlag == 0 || params.qsFlag == 1) {
if (params.ybAttachmentFlag == 0) { if (params.ybAttachmentFlag == 0) {
params.attachmentList.map(e => { params.attachmentList.map(e => {
let item = ybAttachmentFlagTips[e.attachmentCode] let item = ybAttachmentFlagTips[e.attachmentCode]
if (e.attachmentCode != 'YB0005') { if (e.attachmentCode != 'YB0005') {
if (!e.attachmentFile) throw `请上传${item}` if (!e.attachmentFile) throw `请上传${item}`
} }
}) })
} }
if (params.qsFlag == 0 && params.inclueType == 1) { if (params.qsFlag == 0 && params.inclueType == 1) {
params.attachmentList.map(e => { params.attachmentList.map(e => {
let item = qsFlagTips[e.attachmentCode] let item = qsFlagTips[e.attachmentCode]
if (!e.attachmentFile) throw `请上传${item}` if (!e.attachmentFile) throw `请上传${item}`
}) })
} }
} }
} catch (error) { } catch (error) {
uni.showToast({ uni.showToast({
title: error, title: error,
icon: 'none' icon: 'none'
}) })
return false return false
} }
return true return true
}, },
async confirm (paramsData, operationType) { async confirm (paramsData, operationType) {
try { try {
let params = utils.deepClone(paramsData) let params = utils.deepClone(paramsData)
this.$refs.reportNotice.close() this.$refs.reportNotice.close()
// 0草稿,1提单 // 0草稿,1提单
params.operationType = operationType params.operationType = operationType
params.addOnsFlag = params.inclueType == 2 ? 0 : 1 params.addOnsFlag = params.inclueType == 2 ? 0 : 1
params.seatesNum = params.seat params.seatesNum = params.seat
delete params.imgObj delete params.imgObj
delete params.inclueType delete params.inclueType
delete params.seat delete params.seat
uni.showLoading({ uni.showLoading({
mask: true mask: true
}) })
const { code, message } = await uni.$api.equityApi.addEquityOrder(params) const { code, message } = await uni.$api.equityApi.addEquityOrder(params)
if (code == 0) { if (code == 0) {
if (operationType == 0) { if (operationType == 0) {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: '保存成功', title: '保存成功',
icon: 'none', icon: 'none',
mask: true mask: true
}) })
setTimeout(() => { setTimeout(() => {
this.$emit('jump', 'EquityManagement') this.$emit('jump', 'EquityManagement')
}, 1500) }, 1500)
} else { } else {
uni.showLoading({ uni.showLoading({
mask: true mask: true
}) })
setTimeout(async () => { setTimeout(async () => {
// 从URL获取文件名 // 从URL获取文件名
const getFileNameFromUrl = (url) => { const getFileNameFromUrl = (url) => {
return url.split('/').pop().split('?')[0] || '未知文件' return url.split('/').pop().split('?')[0] || '未知文件'
} }
const { contractNo } = params, const { contractNo } = params,
url = await uni.$api.equityApi.printContract({ contractNo }), url = await uni.$api.equityApi.printContract({ contractNo }),
fileName = getFileNameFromUrl(url), fileName = getFileNameFromUrl(url),
type = 3 type = 3
if (!url) throw '获取合同失败' if (!url) throw '获取合同失败'
this.noticeObj = { this.noticeObj = {
title: '提单成功', title: '提单成功',
text: '提单合同支持分享或保存', text: '提单合同支持分享或保存',
type: 'success', type: 'success',
buttons: [ buttons: [
{ {
text: '查看合同', text: '查看合同',
type: 'primary', type: 'primary',
callback: _ => { callback: _ => {
this.$refs.reportNotice.close() this.$refs.reportNotice.close()
this.$emit('jump', 'EquityManagement') this.$emit('jump', 'EquityManagement')
// 跳转到预览页面 // 跳转到预览页面
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/filePreview?fileUrl=${encodeURIComponent(url)}&fileType=${type}&fileName=${encodeURIComponent(fileName)}` url: `/pages/common/filePreview?fileUrl=${encodeURIComponent(url)}&fileType=${type}&fileName=${encodeURIComponent(fileName)}`
}) })
} }
} }
] ]
} }
setTimeout(() => { setTimeout(() => {
uni.hideLoading() uni.hideLoading()
this.$refs.reportNotice.open() this.$refs.reportNotice.open()
}, 100) }, 100)
}, 1500) }, 1500)
} }
} else throw message } else throw message
} catch (error) { } catch (error) {
uni.hideLoading() uni.hideLoading()
if (error) uni.showToast({ if (error) uni.showToast({
title: error, title: error,
icon: 'none' icon: 'none'
}) })
} }
}, },
openNotice (message, params) { openNotice (message, params) {
uni.hideLoading() uni.hideLoading()
let title = '出单失败', let title = '出单失败',
btnText = '重新提单', btnText = '重新提单',
callbackFun = () => { } callbackFun = () => { }
if (message.includes('该车架已经购买过')) { if (message.includes('该车架已经购买过')) {
title = '信息确认' title = '信息确认'
btnText = '继续出单' btnText = '继续出单'
callbackFun = () => { callbackFun = () => {
this.confirm(params, 1) this.confirm(params, 1)
} }
} }
this.noticeObj = { this.noticeObj = {
title, title,
text: message, text: message,
type: 'warning', type: 'warning',
buttons: [ buttons: [
{ {
text: btnText, text: btnText,
type: 'primary', type: 'primary',
callback: callbackFun callback: callbackFun
} }
] ]
} }
this.$nextTick(() => this.$refs.reportNotice.open()) this.$nextTick(() => this.$refs.reportNotice.open())
}, },
} }
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.equity-box { .equity-box {
height: 100%; height: 100%;
position: relative; position: relative;
.box { .box {
height: calc(100% - #{toRpx(120)}); height: calc(100% - #{toRpx(120)});
.scroll-view { .scroll-view {
height: 100%; height: 100%;
} }
&-content { &-content {
padding: 0 toRpx(48); padding: 0 toRpx(48);
} }
} }
.customer-title { .customer-title {
.customer-file { .customer-file {
margin-left: toRpx(20); margin-left: toRpx(20);
color: #347bff; color: #347bff;
font-size: toRpx(24); font-size: toRpx(24);
.sprite-icon { .sprite-icon {
margin-right: toRpx(4); margin-right: toRpx(4);
} }
} }
} }
.btns { .btns {
padding: toRpx(24) toRpx(128); padding: toRpx(24) toRpx(128);
gap: toRpx(32); gap: toRpx(32);
.btn { .btn {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: toRpx(1130); width: toRpx(1130);
height: toRpx(80); height: toRpx(80);
color: #fff; color: #fff;
border-radius: toRpx(48); border-radius: toRpx(48);
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%); background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
} }
.save { .save {
background: #3b73ff1a; background: #3b73ff1a;
color: #4673ff; color: #4673ff;
font-size: toRpx(28); font-size: toRpx(28);
font-weight: 500; font-weight: 500;
} }
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -176,7 +176,7 @@ export default { ...@@ -176,7 +176,7 @@ export default {
watch: { watch: {
externalData: { externalData: {
handler (val) { handler (val) {
this.goodInfoList = val.goodInfoList || [] if (!this.goodInfoList.length) this.goodInfoList = val.goodInfoList || []
}, },
deep: true, deep: true,
immediate: true immediate: true
...@@ -191,7 +191,7 @@ export default { ...@@ -191,7 +191,7 @@ export default {
extendServiceFormList, extendServiceFormList,
oilProFormList, oilProFormList,
cellBoxStyle: 'background: #f5f7fa;', cellBoxStyle: 'background: #f5f7fa;',
goodInfoList:[], goodInfoList: [],
viewKey: Date.now(), viewKey: Date.now(),
currentData: {}, currentData: {},
popupType: 0, popupType: 0,
......
...@@ -64,6 +64,7 @@ export default { ...@@ -64,6 +64,7 @@ export default {
watch: { watch: {
externalData: { externalData: {
handler (val) { handler (val) {
if (Object.keys(this.tireObj).length) return
const keyList = [ const keyList = [
'tireBrand', 'tireScale', 'tireBrand', 'tireScale',
'leftFrontDTO', 'leftFrontBatch', 'leftFrontDTO', 'leftFrontBatch',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!