Commit 6abaf6c8 by 杨北旺

售前权益

1 parent ec4308f9
...@@ -22,8 +22,8 @@ export async function bootstrap({ history, common, messenger, globalState, route ...@@ -22,8 +22,8 @@ export async function bootstrap({ history, common, messenger, globalState, route
Vue.prototype.$messageBox = messageBox Vue.prototype.$messageBox = messageBox
Vue.prototype.$defaultStartDate = '2021-07-01' Vue.prototype.$defaultStartDate = '2021-07-01'
// Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) // Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: '781f08c5-c443-46fd-80e1-f98d94673a73' } }) Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: '0418fc57-bbf6-4e91-b9f4-2c9943ed35f6' } })
Vue.prototype.$http_brand = new common.Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: '781f08c5-c443-46fd-80e1-f98d94673a73' } }) Vue.prototype.$http_brand = new common.Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: '0418fc57-bbf6-4e91-b9f4-2c9943ed35f6' } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState // Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
const routesData = common.utils.deepClone(globalState.routers) const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData) routes = getRoutes(routesData)
......
...@@ -61,19 +61,18 @@ ...@@ -61,19 +61,18 @@
</div> </div>
<div class="arrt_pannel"> <div class="arrt_pannel">
<template v-if="attr.attributeType == 'input'"> <template v-if="attr.attributeType == 'input'">
<el-input class="arrt_pannel" v-model="productModal[item.idName][attr.groupName]" size="small" :maxlength="attr.maxLength" clearable :placeholder="'请输入' + attr.attributeDesc"></el-input> <el-input class="arrt_pannel" @input="getCurChangeInput($event, item, attr)" v-model="productModal[item.idName][attr.attributeName]" size="small" :maxlength="attr.maxLength" clearable :placeholder="'请输入' + attr.attributeDesc"></el-input>
</template> </template>
<template v-if="attr.attributeType == 'select'"> <template v-if="attr.attributeType == 'select'">
<el-select class="arrt_pannel" size="small" v-model="productModal[item.idName][attr.groupName]" clearable :placeholder="'请选择' + attr.attributeDesc"> <el-select class="arrt_pannel" size="small" @change="getCurChangeSelect($event, item, attr)" v-model="productModal[item.idName][attr.attributeName]" clearable :placeholder="'请选择' + attr.attributeDesc">
<el-option v-for="option in attr.optionList" :key="option.value" :label="option.label" :value="option.value"></el-option> <el-option v-for="option in attr.optionList" :key="option.value" :label="option.label" :value="option.value"></el-option>
</el-select> </el-select>
</template> </template>
<template v-if="attr.attributeType == 'datePicker'"> <template v-if="attr.attributeType == 'datePicker'">
<el-date-picker class="arrt_pannel" v-model="productModal[item.idName][attr.groupName]" size="small" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> <el-date-picker class="arrt_pannel" @change="getCurChangeDate($event, item, attr)" v-model="productModal[item.idName][attr.attributeName]" size="small" type="date" :placeholder="'请选择' + attr.attributeDesc"></el-date-picker>
</template> </template>
</div> </div>
</div> </div>
<!-- <div class="err_message">请输入******</div> -->
</div> </div>
</div> </div>
</template> </template>
...@@ -87,7 +86,7 @@ ...@@ -87,7 +86,7 @@
<div v-for="(item, index) in customProductList" :key="index" class="product_wrapper"> <div v-for="(item, index) in customProductList" :key="index" class="product_wrapper">
<div style="padding-left: 73px"> <div style="padding-left: 73px">
<el-radio :label="item.packageName"></el-radio> <el-radio :label="item.packageName"></el-radio>
<p class="h20_title product_intro">包括服务项目:{{item.serviceItems}}</p> <p class="h20_title product_intro">包括服务项目:{{ item.serviceItems }}</p>
</div> </div>
<div v-if="curSelectCustomPro == item.packageName" :key="indexs" class="child_wrap"> <div v-if="curSelectCustomPro == item.packageName" :key="indexs" class="child_wrap">
<div class="child_wrap_pannel" v-for="(attr, attrindex) in item.groupAttributeList" :key="attrindex"> <div class="child_wrap_pannel" v-for="(attr, attrindex) in item.groupAttributeList" :key="attrindex">
...@@ -98,15 +97,15 @@ ...@@ -98,15 +97,15 @@
</div> </div>
<div class="arrt_pannel"> <div class="arrt_pannel">
<template v-if="attr.attributeType == 'input'"> <template v-if="attr.attributeType == 'input'">
<el-input class="arrt_pannel" v-model="productModal[item.idName][attr.groupName]" size="small" :maxlength="attr.maxLength" clearable :placeholder="'请输入' + attr.attributeDesc"></el-input> <el-input class="arrt_pannel" v-model="productModal[item.idName][attr.attributeName]" size="small" :maxlength="attr.maxLength" clearable :placeholder="'请输入' + attr.attributeDesc"></el-input>
</template> </template>
<template v-if="attr.attributeType == 'select'"> <template v-if="attr.attributeType == 'select'">
<el-select class="arrt_pannel" size="small" v-model="productModal[item.idName][attr.groupName]" clearable :placeholder="'请选择' + attr.attributeDesc"> <el-select class="arrt_pannel" size="small" v-model="productModal[item.idName][attr.attributeName]" clearable :placeholder="'请选择' + attr.attributeDesc">
<el-option v-for="option in attr.optionList" :key="option.value" :label="option.label" :value="option.value"></el-option> <el-option v-for="option in attr.optionList" :key="option.value" :label="option.label" :value="option.value"></el-option>
</el-select> </el-select>
</template> </template>
<template v-if="attr.attributeType == 'datePicker'"> <template v-if="attr.attributeType == 'datePicker'">
<el-date-picker class="arrt_pannel" v-model="productModal[item.idName][attr.groupName]" size="small" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> <el-date-picker class="arrt_pannel" v-model="productModal[item.idName][attr.attributeName]" size="small" type="date" :placeholder="'请选择' + attr.attributeDesc"></el-date-picker>
</template> </template>
</div> </div>
</div> </div>
...@@ -153,8 +152,6 @@ ...@@ -153,8 +152,6 @@
</div> --> </div> -->
</div> </div>
<!-- 其他信息 --> <!-- 其他信息 -->
<div class="container m-t-10"> <div class="container m-t-10">
<p class="edit-title">其他信息</p> <p class="edit-title">其他信息</p>
...@@ -167,9 +164,6 @@ ...@@ -167,9 +164,6 @@
<glsx-combi-form class="edit-form-container" ref="editFormRefShop" :isEdit="true" defaultWidth="320px" formRef="editChildRefShop" :formObj="editForm" :formData="editFormDataShop" :formRules="editRuleShop"></glsx-combi-form> <glsx-combi-form class="edit-form-container" ref="editFormRefShop" :isEdit="true" defaultWidth="320px" formRef="editChildRefShop" :formObj="editForm" :formData="editFormDataShop" :formRules="editRuleShop"></glsx-combi-form>
</div> </div>
<!-- 底部固定按钮 --> <!-- 底部固定按钮 -->
<div style="height: 78px"></div> <div style="height: 78px"></div>
<div <div
...@@ -191,8 +185,6 @@ ...@@ -191,8 +185,6 @@
</div> </div>
</div> </div>
<!-- 二维码 --> <!-- 二维码 -->
<qrCode :bottom="320" phone="189 3890 7441" :codeUrl="qrcodUrl"></qrCode> <qrCode :bottom="320" phone="189 3890 7441" :codeUrl="qrcodUrl"></qrCode>
</div> </div>
...@@ -460,7 +452,7 @@ export default { ...@@ -460,7 +452,7 @@ export default {
} }
], ],
curSelectPro: [], curSelectPro: [],
curSelectCustomPro:'', curSelectCustomPro: '',
editProductObj: {}, editProductObj: {},
productList: [], productList: [],
customProductList: [], customProductList: [],
...@@ -469,7 +461,7 @@ export default { ...@@ -469,7 +461,7 @@ export default {
crash: {}, crash: {},
stolen: {}, stolen: {},
tire: {}, tire: {},
vip: {}, vip: {}
}, },
// 其他信息 // 其他信息
editRuleOther: { editRuleOther: {
...@@ -614,18 +606,24 @@ export default { ...@@ -614,18 +606,24 @@ export default {
carChildOptions: [], carChildOptions: [],
carSeriesOptions: [], carSeriesOptions: [],
carTypeOptions: [], carTypeOptions: [],
buyCarTypeList:[{ buyCarTypeList: [
value:0, {
label:'贷款车' value: 0,
},{ label: '贷款车'
value:1, },
label:'全款车' {
},] value: 1,
label: '全款车'
}
]
}, },
allCarChildList: [], allCarChildList: [],
qrcodUrl: 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/beforesale_equity_code.png', qrcodUrl: 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/beforesale_equity_code.png',
// 权益类型 // 权益类型
equityRadio: '1' equityRadio: '1',
// 产品属性传参数组
tempAttributeList: [],
packageCodeList: []
} }
}, },
...@@ -673,13 +671,118 @@ export default { ...@@ -673,13 +671,118 @@ export default {
}, },
methods: { methods: {
// 自选权益产品套餐处理参数--日期选择框
getCurChangeDate(e, pack, attr) {
let temp = e
if (e) {
temp = dayjs(e).format('YYYY-MM-DD')
}
this.commonPart(temp, pack, attr)
},
// 自选权益产品套餐处理参数--选择框
getCurChangeSelect(e, pack, attr) {
this.commonPart(e, pack, attr)
},
// 自选权益产品套餐处理参数---输入框
getCurChangeInput(e, pack, attr) {
if (!e) {
return
}
if (attr.attributeName.includes('price')) {
var numReg = /^[0-9]*$/
var numRe = new RegExp(numReg)
if (!numRe.test(e)) {
this.productModal[pack.idName][attr.attributeName] = this.productModal[pack.idName]['last']
return
}
}
this.commonPart(e, pack, attr)
},
// 公共部分
commonPart(e, pack, attr) {
let orgin = this.$common.utils.deepClone(this.productModal[pack.idName])
let temp = {
attributeGroup: attr.attributeGroup,
attributeName: attr.attributeName,
attributeValue: e,
sort: 0,
packageCode: pack.packageCode
}
this.productModal[pack.idName] = {
...temp,
...orgin,
last: e
}
let flag = this.tempAttributeList.findIndex(val => {
return val.attributeName == attr.attributeName && val.packageCode == pack.packageCode
})
if (flag > -1) {
this.tempAttributeList[flag].attributeValue = e
} else {
this.tempAttributeList.push(temp)
}
// console.log(this.tempAttributeList)
this.packageCodeList.push(pack.packageCode)
this.handleProductArrParam(this.tempAttributeList)
},
// 处理数据结构对比后台所需的参数
handleProductArrParam(arr) {
let newArr = []
const codeList = Array.from(new Set(this.packageCodeList))
let blackArr = []
for (let i = 0; i < codeList.length; i++) {
blackArr.push([])
}
const newParaArr = []
codeList.forEach((item, index) => {
let attrStr = `attributes[${index}].packageCode`
let obj = {
[attrStr]: item
}
newArr.push(obj)
})
for (let i = 0; i < arr.length; i++) {
for (let j = 0; j < codeList.length; j++) {
if (arr[i].packageCode == codeList[j]) {
let obj = {
name: codeList[j],
index: j,
value: {
attributeGroup: arr[i].attributeGroup,
attributeName: arr[i].attributeName,
attributeValue: arr[i].attributeValue,
sort: arr[i].sort
}
}
blackArr[j].push(obj)
}
}
}
for (let i = 0; i < blackArr.length; i++) {
for (let j = 0; j < blackArr[i].length; j++) {
let arrt1 = `attributes[${blackArr[i][j].index}].attributeDTOList[${j}].attributeGroup`
let arrt2 = `attributes[${blackArr[i][j].index}].attributeDTOList[${j}].attributeName`
let arrt3 = `attributes[${blackArr[i][j].index}].attributeDTOList[${j}].attributeValue`
let arrt4 = `attributes[${blackArr[i][j].index}].attributeDTOList[${j}].sort`
let obj = {
[arrt1]: blackArr[i][j].value.attributeGroup,
[arrt2]: blackArr[i][j].value.attributeName,
[arrt3]: blackArr[i][j].value.attributeValue,
[arrt4]: blackArr[i][j].value.sort
}
newParaArr.push(obj)
}
}
console.log(newParaArr)
},
// 获取特别约定列表 // 获取特别约定列表
getSpeAgreeOptions(){ getSpeAgreeOptions() {
this.$apis.beforeSale.spaAgressData({}).then(res => { this.$apis.beforeSale.spaAgressData({}).then(res => {
this.agreeList= res || [] this.agreeList = res || []
}) })
}, },
// 模拟获取产品的数据 // 获取产品的数据
toTestProductData(arr) { toTestProductData(arr) {
arr.forEach(item => { arr.forEach(item => {
if (item.packageName.includes('整车全损无忧')) { if (item.packageName.includes('整车全损无忧')) {
...@@ -697,13 +800,13 @@ export default { ...@@ -697,13 +800,13 @@ export default {
} else if (item.packageName.includes('优享版')) { } else if (item.packageName.includes('优享版')) {
item.idName = 'vip' item.idName = 'vip'
} }
item.serviceItems=item.serviceItemsList.length ? item.serviceItemsList.map(k => k.serviceName).join(',') : '' item.serviceItems = item.serviceItemsList.length ? item.serviceItemsList.map(k => k.serviceName).join(',') : ''
let newArr = [] let newArr = []
item.groupAttributeList.map(ele => { item.groupAttributeList.map(ele => {
ele.attributeList.map(e => { ele.attributeList.map(e => {
if(e.attributeDesc=='服务期限'){ if (e.attributeDesc == '服务期限') {
e.optionList = this.baseData.servicePeriodList e.optionList = this.baseData.servicePeriodList
}else if(e.attributeDesc=="购车类型"){ } else if (e.attributeDesc == '购车类型') {
e.optionList = this.baseData.buyCarTypeList e.optionList = this.baseData.buyCarTypeList
} }
ele.tempobj = { ...e } ele.tempobj = { ...e }
...@@ -1143,8 +1246,8 @@ export default { ...@@ -1143,8 +1246,8 @@ export default {
} else { } else {
params.contractNo = '' params.contractNo = ''
} }
console.log(params,'确定按钮提交的参数'); console.log(params, '确定按钮提交的参数')
console.log(this.productModal,'产品的参数'); console.log(this.productModal, '产品的参数')
// this.$apis.beforeSale.checkOrderApi({ vin: this.editForm.vehicle.vin, contractNo: this.routeInfo.contractNo || '' }).then(res => { // this.$apis.beforeSale.checkOrderApi({ vin: this.editForm.vehicle.vin, contractNo: this.routeInfo.contractNo || '' }).then(res => {
// if (res.code == '0') { // if (res.code == '0') {
// this.updateEquity(params) // this.updateEquity(params)
...@@ -1220,10 +1323,10 @@ export default { ...@@ -1220,10 +1323,10 @@ export default {
background: #ffffff; background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1); box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
} }
.container /deep/ .el-radio__label{ .container /deep/ .el-radio__label {
font-weight: 600; font-weight: 600;
} }
.container /deep/ .el-checkbox__label{ .container /deep/ .el-checkbox__label {
font-weight: 600; font-weight: 600;
} }
.before-sale .edit-container { .before-sale .edit-container {
...@@ -1275,7 +1378,7 @@ export default { ...@@ -1275,7 +1378,7 @@ export default {
padding: 0 0 32px 0px; padding: 0 0 32px 0px;
.product_wrapper { .product_wrapper {
margin-top: 16px; margin-top: 16px;
.product_intro{ .product_intro {
margin-top: 5px; margin-top: 5px;
margin-left: 24px; margin-left: 24px;
} }
...@@ -1283,18 +1386,18 @@ export default { ...@@ -1283,18 +1386,18 @@ export default {
padding: 16px 0 0 0; padding: 16px 0 0 0;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
.child_wrap_pannel{ .child_wrap_pannel {
position: relative; position: relative;
.err_message{ .err_message {
position: absolute; position: absolute;
left: 160px; left: 160px;
bottom: 0px; bottom: 14px;
font-size: 12px; font-size: 12px;
color: #f56c6c; color: #f56c6c;
} }
} }
.attr_wrapper { .attr_wrapper {
margin-bottom: 16px; margin-bottom: 28px;
margin-right: 30px; margin-right: 30px;
.attr_label { .attr_label {
width: 160px; width: 160px;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</div> </div>
</div> </div>
<div class="table_widget"> <div class="table_widget">
<GLTable ref="table" :hasPage="false" :tableData="productValueInfo" :tableParams="tableParams"></GLTable> <GLTable ref="table" :hasPage="false" max-height="270" :tableData="productValueInfo" :tableParams="tableParams"></GLTable>
</div> </div>
</div> </div>
<div v-if="!show" class="openBtn h18_title" @click="showContainer"> <div v-if="!show" class="openBtn h18_title" @click="showContainer">
...@@ -181,8 +181,8 @@ export default { ...@@ -181,8 +181,8 @@ export default {
height: 9px; height: 9px;
} }
} }
.bloc-chart-container /deep/ .el-table__body-wrapper { // .bloc-chart-container /deep/ .el-table__body-wrapper {
height: 270px; // height: 270px;
overflow-y: scroll; // overflow-y: scroll;
} // }
</style> </style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!