Commit 51d403ca by 前端

Merge branch 'develop' into 'master'

Develop=》master

See merge request !17
2 parents b3ea87d0 5490fd23
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
"dayjs": "^1.10.7", "dayjs": "^1.10.7",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-common": "^1.4.6", "glsx-common": "^2.0.4",
"glsx-components": "^1.5.2", "glsx-components": "^1.5.2",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"vue": "^2.6.10", "vue": "^2.6.10",
......
...@@ -26,6 +26,7 @@ export async function bootstrap({ history, common, messenger, globalState, route ...@@ -26,6 +26,7 @@ export async function bootstrap({ history, common, messenger, globalState, route
// request_merchant.baseURL = 'http://rop-merchant.test.glsx.com.cn' // request_merchant.baseURL = 'http://rop-merchant.test.glsx.com.cn'
// request.baseURL = 'http://192.168.1.78:8064' // request.baseURL = 'http://192.168.1.78:8064'
// request_brand.baseURL = 'http://192.168.1.78:8064' // request_brand.baseURL = 'http://192.168.1.78:8064'
// globalState.session.token = 'scrm-base-bb848580-e5e2-48d2-8fcc-2cf3d8bbc3bd-rop'
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
......
...@@ -49,7 +49,14 @@ ...@@ -49,7 +49,14 @@
<el-checkbox-group v-model="curSelectPro" :disabled="disabled"> <el-checkbox-group v-model="curSelectPro" :disabled="disabled">
<div v-for="(item, index) in productList" :key="index" class="product_wrapper"> <div v-for="(item, index) in productList" :key="index" class="product_wrapper">
<div style="padding-left: 73px"> <div style="padding-left: 73px">
<el-checkbox @change="changeCheckBox($event, item)" :disabled="item.disabled" :label="item.packageName"></el-checkbox> <!-- <el-checkbox @change="changeCheckBox($event, item, index)" :disabled="item.disabled" :label="errGlassName&&item.idName=='glass'?item.packageName+`(${errGlassName})`:item.packageName"> -->
<el-checkbox @change="changeCheckBox($event, item, index)" :label="item.packageName" :disabled="item.disabled">
<div v-if="errGlassName && item.idName == 'glass'">
{{ item.packageName }}
<span style="color: red; font-weight: normal">({{ errGlassName }})</span>
</div>
<div v-else>{{ item.packageName }}</div>
</el-checkbox>
</div> </div>
<div class="customer-form"> <div class="customer-form">
<!-- 属性 --> <!-- 属性 -->
...@@ -502,7 +509,8 @@ export default { ...@@ -502,7 +509,8 @@ export default {
crash: {}, crash: {},
stolen: {}, stolen: {},
tire: {}, tire: {},
vip: {} vip: {},
glass: {}
}, },
// 其他信息 // 其他信息
editRuleOther: { editRuleOther: {
...@@ -705,13 +713,17 @@ export default { ...@@ -705,13 +713,17 @@ export default {
pickerOptions: {}, pickerOptions: {},
pickerOptions2: {}, pickerOptions2: {},
hotline: '', hotline: '',
compensationNameDisable: false compensationNameDisable: false,
errGlassName: ''
} }
}, },
watch: { watch: {
'editForm.vehicle.invoicePrice'(newValue, oldValue) { 'editForm.vehicle.invoicePrice'(newValue, oldValue) {
this.editForm.vehicle.invoicePrice = limitPrice(newValue, oldValue, 7, 2, 0, 2000000) this.editForm.vehicle.invoicePrice = limitPrice(newValue, oldValue, 7, 2, 0, 2000000)
if (this.currentVaildItem) {
this.vailGlassPackage(this.currentVaildItem, this.currentVaildIndex)
}
}, },
'editForm.actualSalesPrice'(newValue, oldValue) { 'editForm.actualSalesPrice'(newValue, oldValue) {
this.editForm.actualSalesPrice = limitPrice(newValue, oldValue, 7, 2) this.editForm.actualSalesPrice = limitPrice(newValue, oldValue, 7, 2)
...@@ -819,8 +831,8 @@ export default { ...@@ -819,8 +831,8 @@ export default {
// item.optionList.push({ value: '5', label: '5年' }) // item.optionList.push({ value: '5', label: '5年' })
// } // }
let optionObj = { let optionObj = {
'4': { value: '4', label: '4年' }, 4: { value: '4', label: '4年' },
'5': { value: '5', label: '5年' } 5: { value: '5', label: '5年' }
} }
if (res.servicePeriod == '4' || res.servicePeriod == '5') { if (res.servicePeriod == '4' || res.servicePeriod == '5') {
const Target = item.optionList.find(item => { const Target = item.optionList.find(item => {
...@@ -855,8 +867,72 @@ export default { ...@@ -855,8 +867,72 @@ export default {
} }
}) })
}, },
// 轮胎玻璃验证车辆价格不能大于50w
vailGlassPackage(item, index) {
this.currentVaildItem = item
this.currentVaildIndex = index
let glassNameFlag = this.curSelectPro.includes(this.vailGlassName)
if (item.idName == 'glass') this.vailIndex = index
if (glassNameFlag) {
let vaild = this.editForm.vehicle.invoicePrice && Number(this.editForm.vehicle.invoicePrice) > 500000
if (vaild) {
this.productList[this.vailIndex].groupAttributeList.forEach((el, i) => {
if (el.groupName == 'actual_sales_price') this.vail_sale_price_index = i
})
this.$set(this.productList[this.vailIndex], 'disabled', true)
this.$set(this.productList[this.vailIndex].groupAttributeList[this.vail_sale_price_index], 'disabled', true)
this.errGlassName = '车辆价格超过50万,无法购买'
this.vaildGlassParams()
// if(this.tempAttributeList.length&&this.packageCodeList.length){
// if( this.packageCodeList.indexOf(this.vailGlassCode)!=-1){
// let arr1 = []
// let arr2 = []
// this.tempAttributeList.forEach(ele=>{
// if(ele.packageCode!=this.vailGlassCode){
// arr1.push(ele)
// }
// })
// this.packageCodeList.forEach(ele=>{
// if(ele!=this.vailGlassCode){
// arr2.push(ele)
// }
// })
// this.handleProductArrParam(arr1, arr2)
// }
// }
} else {
this.errGlassName = ''
if (this.vailIndex !=undefined) this.$set(this.productList[this.vailIndex], 'disabled', false)
if (this.vail_sale_price_index) this.$set(this.productList[this.vailIndex].groupAttributeList[this.vail_sale_price_index], 'disabled', false)
}
} else {
if (this.vailIndex) this.$set(this.productList[this.vailIndex], 'disabled', false)
if (this.vail_sale_price_index) this.$set(this.productList[this.vailIndex].groupAttributeList[this.vail_sale_price_index], 'disabled', false)
}
},
// 轮胎玻璃提单参数处理
vaildGlassParams(){
if(this.equityRadio == 1&&this.tempAttributeList.length&&this.packageCodeList.length&&this.errGlassName){
if( this.packageCodeList.indexOf(this.vailGlassCode)!=-1){
let arr1 = []
let arr2 = []
this.tempAttributeList.forEach(ele=>{
if(ele.packageCode!=this.vailGlassCode){
arr1.push(ele)
}
})
this.packageCodeList.forEach(ele=>{
if(ele!=this.vailGlassCode){
arr2.push(ele)
}
})
this.handleProductArrParam(arr1, arr2)
}
}
},
// 切换套餐---赋默认值 // 切换套餐---赋默认值
changeCheckBox(e, item) { changeCheckBox(e, item, index) {
this.vailGlassPackage(item, index)
if (e) { if (e) {
this.checkCodeList.push(item.packageCode) this.checkCodeList.push(item.packageCode)
this.packageCodeList.push(item.packageCode) this.packageCodeList.push(item.packageCode)
...@@ -1073,7 +1149,6 @@ export default { ...@@ -1073,7 +1149,6 @@ export default {
concactArr.forEach(item => { concactArr.forEach(item => {
this.autoFormatProduct = Object.assign(this.autoFormatProduct, item) this.autoFormatProduct = Object.assign(this.autoFormatProduct, item)
}) })
// console.log(this.autoFormatProduct, '定制权益')
} }
}, },
// 处理传参价格问题 // 处理传参价格问题
...@@ -1097,7 +1172,7 @@ export default { ...@@ -1097,7 +1172,7 @@ export default {
}) })
}, },
// 获取产品的数据 // 获取产品的数据
toTestProductData(arr) { toGetProductData(arr) {
arr.forEach(item => { arr.forEach(item => {
if (item.packageName.includes('整车全损')) { if (item.packageName.includes('整车全损')) {
item.idName = 'car' item.idName = 'car'
...@@ -1110,12 +1185,12 @@ export default { ...@@ -1110,12 +1185,12 @@ export default {
this.getCase(item.planId) this.getCase(item.planId)
} else if (item.packageName.includes('盗抢')) { } else if (item.packageName.includes('盗抢')) {
item.idName = 'stolen' item.idName = 'stolen'
} else if (item.packageName.includes('尊享版')) { } else if (item.packageType == 1) {
item.idName = 'vip'
} else if (item.packageName.includes('舒享版')) {
item.idName = 'vip'
} else if (item.packageName.includes('优享版')) {
item.idName = 'vip' item.idName = 'vip'
} else if (item.packageName.includes('玻璃')) {
this.vailGlassName = item.packageName // 备用
this.vailGlassCode = item.packageCode
item.idName = 'glass'
} }
item.disabled = false item.disabled = false
item.serviceItems = item.serviceItemsList.length ? item.serviceItemsList.map(k => k.serviceName).join(',') : '' item.serviceItems = item.serviceItemsList.length ? item.serviceItemsList.map(k => k.serviceName).join(',') : ''
...@@ -1138,17 +1213,29 @@ export default { ...@@ -1138,17 +1213,29 @@ export default {
} else if (e.attributeDesc == '购车类型') { } else if (e.attributeDesc == '购车类型') {
e.optionList = this.baseData.buyCarTypeList e.optionList = this.baseData.buyCarTypeList
this.productModal[item.idName][e.attributeName] = '0' this.productModal[item.idName][e.attributeName] = '0'
} else if ((item.idName == 'tire' || item.idName == 'crash' || item.idName == 'vip') && e.attributeDesc == '服务期限') { } else if ((item.idName == 'tire' || item.idName == 'crash' || item.idName == 'vip' || item.idName == 'glass') && e.attributeDesc == '服务期限') {
if (item.idName == 'tire' || item.idName == 'crash') { if (item.idName == 'tire' || item.idName == 'crash') {
e.optionList = this.baseData.servicePeriodList e.optionList = this.baseData.servicePeriodList
} else { } else {
e.optionList = this.baseData.servicePeriodList2 e.optionList = this.baseData.servicePeriodList2
} }
this.productModal[item.idName][e.attributeName] = '1'
e.disabled = true e.disabled = true
// v3.1.2--新版的定制权益-服务期限--改为1,2,3年---旧版的依然是一年
let isOld = item.packageName.includes('尊享版') || item.packageName.includes('舒享版') || item.packageName.includes('优享版')
if(item.idName == 'vip' && !isOld){
e.disabled = false
e.optionList = this.baseData.servicePeriodList
}
this.productModal[item.idName][e.attributeName] = '1'
} else if (e.attributeDesc == '生效日期') { } else if (e.attributeDesc == '生效日期') {
let nextDay = new Date().getTime() + 24 * 60 * 60 * 1000 let nextDay = new Date().getTime() + 24 * 60 * 60 * 1000
this.productModal[item.idName][e.attributeName] = utils.dateFormat(nextDay) this.productModal[item.idName][e.attributeName] = utils.dateFormat(nextDay)
if (item.idName == 'glass') {
let tAdd2 = new Date().getTime() + 24 * 60 * 60 * 1000 * 2
this.productModal[item.idName][e.attributeName] = utils.dateFormat(tAdd2)
e.disabled = true
}
} }
ele.tempobj = { ...e } ele.tempobj = { ...e }
}) })
...@@ -1273,7 +1360,7 @@ export default { ...@@ -1273,7 +1360,7 @@ export default {
}) })
if (id > -1) item.groupAttributeList.splice(id + 1, 0, obj) if (id > -1) item.groupAttributeList.splice(id + 1, 0, obj)
}) })
this.toTestProductData(res) this.toGetProductData(res)
}) })
}, },
// 改建议价,实际销售价 // 改建议价,实际销售价
...@@ -1633,6 +1720,7 @@ export default { ...@@ -1633,6 +1720,7 @@ export default {
}, },
// 草稿 // 草稿
handleDraft() { handleDraft() {
this.vaildGlassParams()
const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct
if (this.submit) { if (this.submit) {
return true return true
...@@ -1702,6 +1790,7 @@ export default { ...@@ -1702,6 +1790,7 @@ export default {
} }
}, },
handleConfirm() { handleConfirm() {
this.vaildGlassParams()
const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct
const isEmptyObj = JSON.stringify(vaidObj) == '{}' const isEmptyObj = JSON.stringify(vaidObj) == '{}'
if (isEmptyObj) { if (isEmptyObj) {
...@@ -1801,7 +1890,8 @@ export default { ...@@ -1801,7 +1890,8 @@ export default {
crash: {}, crash: {},
stolen: {}, stolen: {},
tire: {}, tire: {},
vip: {} vip: {},
glass: {}
} }
this.customProductList = [] this.customProductList = []
this.productList = [] this.productList = []
......
...@@ -329,7 +329,7 @@ export default { ...@@ -329,7 +329,7 @@ export default {
label: '店面名称', label: '店面名称',
line: 1, line: 1,
prop: 'merchantName', prop: 'merchantName',
width: '160px', width: '200px',
formatter: cellValue => { formatter: cellValue => {
return cellValue.merchantName || '-' return cellValue.merchantName || '-'
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!