Commit d25d3e34 by 杨北旺

售前

1 parent 6abaf6c8
......@@ -172,7 +172,7 @@ const getPackageListApi = params => {
}
const getEquityApi = params => {
params.method = `${orderPath}detail`
params.method = `scrm.api.equity.service.channel.order.detail`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
......@@ -182,7 +182,7 @@ const getEquityApi = params => {
}
const updateEquityApi = params => {
params.method = `${orderPath}insert.or.update`
params.method = `scrm.api.equity.service.channel.order.insert.or.update`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
......
......@@ -56,7 +56,7 @@
<el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio>
</el-radio-group>
<el-date-picker v-else-if="item.type === 'datePicker'" v-model="formObj[item.name]" :type="item.dateType || 'daterange'" :style="{ width: item.width || defaultWidth }" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOption[item.pickerOptions]"></el-date-picker>
<el-date-picker v-else-if="item.type === 'datePicker'" :disabled="item.isDisabled" v-model="formObj[item.name]" :type="item.dateType || 'daterange'" :style="{ width: item.width || defaultWidth }" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOption[item.pickerOptions]"></el-date-picker>
<template v-else-if="item.type === 'upload'">
<p class="photo-top-tips">{{ item.topTips }}</p>
<div v-if="!item.isDisabled" :style="{ width: item.width || defaultWidth }">
......
......@@ -22,8 +22,8 @@ export async function bootstrap({ history, common, messenger, globalState, route
Vue.prototype.$messageBox = messageBox
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: '0418fc57-bbf6-4e91-b9f4-2c9943ed35f6' } })
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.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: '48b9a3e5-99bc-4b1d-bc7d-d9d9f0ecfbf9' } })
Vue.prototype.$http_brand = new common.Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: '48b9a3e5-99bc-4b1d-bc7d-d9d9f0ecfbf9' } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData)
......
......@@ -39,14 +39,14 @@
<div class="container m-t-10">
<p class="edit-title">选择产品</p>
<div class="edit_product_radio_wrap flex_sc">
<el-radio v-model="equityRadio" label="1">自选权益</el-radio>
<el-radio :disabled="disabled" v-model="equityRadio" :label="1">自选权益</el-radio>
<div style="width: 112px"></div>
<el-radio v-model="equityRadio" label="2">定制权益</el-radio>
<el-radio :disabled="disabled" v-model="equityRadio" :label="2">定制权益</el-radio>
</div>
<!-- 自选权益 -->
<div v-if="equityRadio == '1'" class="auto_widget">
<el-checkbox-group v-model="curSelectPro">
<el-checkbox-group v-model="curSelectPro" :disabled="disabled">
<div v-for="(item, index) in productList" :key="index" class="product_wrapper">
<div style="padding-left: 73px">
<el-checkbox :label="item.packageName"></el-checkbox>
......@@ -61,28 +61,48 @@
</div>
<div class="arrt_pannel">
<template v-if="attr.attributeType == '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>
<el-input class="arrt_pannel" :disabled="disabled" @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 v-if="attr.attributeType == 'select'">
<el-select class="arrt_pannel" size="small" @change="getCurChangeSelect($event, item, attr)" v-model="productModal[item.idName][attr.attributeName]" clearable :placeholder="'请选择' + attr.attributeDesc">
<el-select class="arrt_pannel" :disabled="disabled" 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-select>
</template>
<template v-if="attr.attributeType == 'datePicker'">
<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>
<el-date-picker class="arrt_pannel" :disabled="disabled" @change="getCurChangeDate($event, item, attr)" v-model="productModal[item.idName][attr.attributeName]" size="small" type="date" :placeholder="'请选择' + attr.attributeDesc"></el-date-picker>
</template>
</div>
</div>
</div>
</div>
</template>
<!-- 方案 -->
<div v-if="item.packageName.includes('碰撞') && curSelectPro.includes(item.packageName)" class="table_case_wrap">
<div class="case_title">方案</div>
<div class="case_table">
<div class="table_th flex_sc">
<div class="th_item flex_cc" style="width: 89px">方案</div>
<div class="th_item flex_cc border-lr">车险定损金额</div>
<div class="th_item flex_cc max" style="width: 291px">津贴标准(累计及每次事故赔偿限额)</div>
</div>
<div class="table_tr flex_sc">
<div class="tr_item flex_cc min">方案</div>
<div class="tr_sec_item_wrap">
<div v-for="(caseItem, caseindex) in caseTable" :key="caseindex" class="tr_sec_item flex_sc">
<div class="sec_item flex_sc h9_title" :class="{ noborder: caseindex == caseTable.length - 1 }">{{ caseItem.money_one }}</div>
<div class="sec_item flex_sc max h9_title" :class="{ noborder: caseindex == caseTable.length - 1 }" style="width: 291px">{{ caseItem.money_two }}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</el-checkbox-group>
</div>
<!-- 定制权益 -->
<div v-if="equityRadio == '2'" class="auto_widget">
<el-radio-group v-model="curSelectCustomPro">
<el-radio-group v-model="curSelectCustomPro" :disabled="disabled">
<div v-for="(item, index) in customProductList" :key="index" class="product_wrapper">
<div style="padding-left: 73px">
<el-radio :label="item.packageName"></el-radio>
......@@ -97,15 +117,15 @@
</div>
<div class="arrt_pannel">
<template v-if="attr.attributeType == 'input'">
<el-input class="arrt_pannel" v-model="productModal[item.idName][attr.attributeName]" size="small" :maxlength="attr.maxLength" clearable :placeholder="'请输入' + attr.attributeDesc"></el-input>
<el-input class="arrt_pannel" :disabled="disabled" @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 v-if="attr.attributeType == 'select'">
<el-select class="arrt_pannel" size="small" v-model="productModal[item.idName][attr.attributeName]" clearable :placeholder="'请选择' + attr.attributeDesc">
<el-select class="arrt_pannel" :disabled="disabled" 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-select>
</template>
<template v-if="attr.attributeType == 'datePicker'">
<el-date-picker class="arrt_pannel" v-model="productModal[item.idName][attr.attributeName]" size="small" type="date" :placeholder="'请选择' + attr.attributeDesc"></el-date-picker>
<el-date-picker class="arrt_pannel" :disabled="disabled" @change="getCurChangeDate($event, item, attr)" v-model="productModal[item.idName][attr.attributeName]" size="small" type="date" :placeholder="'请选择' + attr.attributeDesc"></el-date-picker>
</template>
</div>
</div>
......@@ -175,13 +195,13 @@
>
<div class="ma_top"></div>
<div class="flex_cc ma_bot">
<el-button size="small" class="custom_black" @click="handleReset">重置</el-button>
<el-button v-if="![3, 5].includes(routeInfo.addOrEdit)" class="custom_black" @click="handleReset">重置</el-button>
<div class="mar-10"></div>
<el-button class="custom_blue" v-show="!['3', '5'].includes(routeInfo.addOrEdit)" size="small" @click="handleDraft">草稿</el-button>
<el-button class="custom_blue" v-if="![3, 5].includes(routeInfo.addOrEdit)" @click="handleDraft">草稿</el-button>
<div class="mar-10"></div>
<el-button v-show="routeInfo.addOrEdit != '5'" size="small" type="primary" @click="handleConfirm">{{ routeInfo.addOrEdit != '3' ? '提单' : '确定' }}</el-button>
<el-button v-if="routeInfo.addOrEdit != '5'" type="primary" @click="handleConfirm">{{ routeInfo.addOrEdit != '3' ? '提单' : '确定' }}</el-button>
<div class="mar-10"></div>
<el-button size="small" type="default" @click="handleCancel">取消</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
</div>
......@@ -195,6 +215,7 @@ import * as dayjs from 'dayjs'
import { limitPrice } from '@/common/constant'
import glsxCombiForm from '@/components/glsx-combi-form'
import qrCode from '@/components/qr-code'
import { fetchConfig } from '@/config'
export default {
name: 'editEquity',
data() {
......@@ -438,19 +459,19 @@ export default {
packageList: [],
editRulePro: {},
editFormPro: {},
editFormDataPro: [
{
label: '',
name: 'packageCode',
optionList: [],
optionId: 'packageCode',
optionLabel: 'packageName',
addHtml: 'packageCode',
handleRadioChange: val => {
this.packageAttr()
}
}
],
// editFormDataPro: [
// {
// label: '',
// name: 'packageCode',
// optionList: [],
// optionId: 'packageCode',
// optionLabel: 'packageName',
// addHtml: 'packageCode',
// handleRadioChange: val => {
// this.packageAttr()
// }
// }
// ],
curSelectPro: [],
curSelectCustomPro: '',
editProductObj: {},
......@@ -469,17 +490,16 @@ export default {
speAgree: [{ required: false, message: '请输入特别约定', trigger: 'change' }],
speContent: [{ required: false, message: '请输入约定内容', trigger: 'change' }]
},
agreeList: [],
editFormDataOther: [
{
label: '设备号',
name: 'deviceNo',
name: 'sn',
type: 'input',
maxlength: 100
},
{
label: '特别约定',
name: 'speAgree',
name: 'specialAppointId',
type: 'select',
noFilter: true,
optionList: [],
......@@ -489,33 +509,33 @@ export default {
},
{
label: '约定内容',
name: 'speContent',
name: 'specialAppoint',
type: 'input',
inputType: 'textarea'
}
],
// 店面信息
editRuleShop: {
shopName: [{ required: true, message: '店面名称', trigger: 'change' }],
shopPhone: [{ required: true, message: '店铺联系号码', trigger: 'change' }],
shopAddress: [{ required: true, message: '店铺联系地址', trigger: 'change' }]
merchantName: [{ required: true, message: '店面名称', trigger: 'change' }],
merchantPhone: [{ required: true, message: '店铺联系号码', trigger: 'change' }],
merchantAddress: [{ required: true, message: '店铺联系地址', trigger: 'change' }]
},
editFormDataShop: [
{
label: '店面名称',
name: 'shopName',
name: 'merchantName',
type: 'input',
maxlength: 50
},
{
label: '店铺联系号码',
name: 'shopPhone',
name: 'merchantPhone',
type: 'input',
maxlength: 11
},
{
label: '店铺联系地址',
name: 'shopAddress',
name: 'merchantAddress',
type: 'input',
maxlength: 100
}
......@@ -615,15 +635,22 @@ export default {
value: 1,
label: '全款车'
}
]
],
agreeList: [],
},
allCarChildList: [],
qrcodUrl: 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/beforesale_equity_code.png',
// 权益类型
equityRadio: '1',
// 产品属性传参数组
equityRadio: 1,
// 自选权益产品属性传参数组
tempAttributeList: [],
packageCodeList: []
packageCodeList: [],
formatProduct: {},
// 自定权益
autoAttriButeList: [],
autoPackageCodeList: [],
autoFormatProduct: {},
caseTable: []
}
},
......@@ -644,12 +671,11 @@ export default {
qrCode
},
created() {
async created() {
this.getAllVehicleBrand()
this.getCarChildList(false, true)
// 测试时使用
// this.getPackageList()
// this.getSpeAgreeOptions()
this.getSpeAgreeOptions()
},
mounted() {
......@@ -657,7 +683,6 @@ export default {
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
const urlParam = this.$route.params
this.routeInfo = JSON.parse(decodeURIComponent(urlParam.id))
console.log(this.routeInfo)
this.disabled = this.routeInfo.addOrEdit == '5'
// 提单成功 - 修改
if (this.routeInfo.isSuper != 'true') {
......@@ -671,6 +696,12 @@ export default {
},
methods: {
// 获取mock上面配置的方案
async getCase(caseNum) {
caseNum = caseNum || 1
const { caseList } = await fetchConfig()
this.caseTable = caseList[caseNum - 1]
},
// 自选权益产品套餐处理参数--日期选择框
getCurChangeDate(e, pack, attr) {
let temp = e
......@@ -713,23 +744,35 @@ export default {
...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
if (this.equityRadio == 1) {
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)
}
this.packageCodeList.push(pack.packageCode)
this.handleProductArrParam(this.tempAttributeList, this.packageCodeList)
} else {
this.tempAttributeList.push(temp)
let flag = this.autoAttriButeList.findIndex(val => {
return val.attributeName == attr.attributeName && val.packageCode == pack.packageCode
})
if (flag > -1) {
this.autoAttriButeList[flag].attributeValue = e
} else {
this.autoAttriButeList.push(temp)
}
this.autoPackageCodeList.push(pack.packageCode)
this.handleProductArrParam(this.autoAttriButeList, this.autoPackageCodeList)
}
// console.log(this.tempAttributeList)
this.packageCodeList.push(pack.packageCode)
this.handleProductArrParam(this.tempAttributeList)
},
// 处理数据结构对比后台所需的参数
handleProductArrParam(arr) {
handleProductArrParam(arr, codearr) {
let newArr = []
const codeList = Array.from(new Set(this.packageCodeList))
const codeList = Array.from(new Set(codearr))
let blackArr = []
for (let i = 0; i < codeList.length; i++) {
blackArr.push([])
......@@ -761,25 +804,42 @@ export default {
}
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)
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]: this.priceFormat(blackArr[i][j].value.attributeName, blackArr[i][j].value.attributeValue),
[arrt4]: blackArr[i][j].value.sort
}
newParaArr.push(obj)
}
}
console.log(newParaArr)
let concactArr = newParaArr.concat(newArr)
if (this.equityRadio == 1) {
concactArr.forEach(item => {
this.formatProduct = Object.assign(this.formatProduct, item)
})
} else {
concactArr.forEach(item => {
this.autoFormatProduct = Object.assign(this.autoFormatProduct, item)
})
}
},
// 处理传参价格问题
priceFormat(name, value) {
let result = value
if (name.includes('price')) {
result = parseFloat(value) * 100
}
return result
},
// 获取特别约定列表
getSpeAgreeOptions() {
this.$apis.beforeSale.spaAgressData({}).then(res => {
this.agreeList = res || []
this.baseData.agreeList = res || []
})
},
// 获取产品的数据
......@@ -791,6 +851,7 @@ export default {
item.idName = 'tire'
} else if (item.packageName.includes('碰撞无忧')) {
item.idName = 'crash'
this.getCase(item.planId)
} else if (item.packageName.includes('盗抢全损无忧')) {
item.idName = 'stolen'
} else if (item.packageName.includes('尊享版')) {
......@@ -827,12 +888,14 @@ export default {
this.customProductList.push(item)
}
})
this.autoGenerate(this.customProductList, this.productList)
},
setDisabled(partDisabledList = []) {
var list = ['Car', 'User', 'Shop', 'Other']
for (var i = 0; i < list.length; i++) {
this['editFormData' + list[i]].forEach((item, idx) => {
if (!partDisabledList.length) {
console.log(this['editFormData' + list[i]][idx]);
this['editFormData' + list[i]][idx].isDisabled = true
} else {
if (partDisabledList.includes(item.name)) {
......@@ -864,9 +927,8 @@ export default {
}
})
},
getInfo() {
getInfo(productArrData) {
this.$apis.beforeSale.getEquityApi({ contractNo: this.routeInfo.contractNo }).then(res => {
// console.log(res)
this.editForm = {
...res
}
......@@ -880,13 +942,13 @@ export default {
if (this.editForm.actualSalesPrice) {
this.editForm.actualSalesPrice = (this.editForm.actualSalesPrice / 100).toFixed(2)
}
if (this.editForm.attributeList && this.editForm.attributeList.length) {
var idxPrice = this.editForm.attributeList.findIndex(i => i.attributeName == 'additional_price')
this.editForm.attributeList[idxPrice].attributeValue = this.editForm.attributeList[idxPrice].attributeValue ? (this.editForm.attributeList[idxPrice].attributeValue / 100).toFixed(2) : ''
}
// if (this.editForm.attributeList && this.editForm.attributeList.length) {
// var idxPrice = this.editForm.attributeList.findIndex(i => i.attributeName == 'additional_price')
// this.editForm.attributeList[idxPrice].attributeValue = this.editForm.attributeList[idxPrice].attributeValue ? (this.editForm.attributeList[idxPrice].attributeValue / 100).toFixed(2) : ''
// }
this.editForm.vehicle.billingDate = this.editForm.vehicle.billingDate ? new Date(this.editForm.vehicle.billingDate) : ''
this.editForm.effectiveDate = this.editForm.effectiveDate ? new Date(this.editForm.effectiveDate) : ''
if (['2', '3', '4'].includes(this.routeInfo.addOrEdit)) {
if ([2, 3, 4].includes(this.routeInfo.addOrEdit)) {
this.editForm.vehicle.vehicleBrandId = this.editForm.vehicle.vehicleBrandId || this.defaultBrandForm.vehicleBrandId
this.editForm.vehicle.vehicleSubBrandId = this.editForm.vehicle.vehicleSubBrandId || this.defaultBrandForm.vehicleSubBrandId
}
......@@ -903,16 +965,15 @@ export default {
var idx = this.editFormDataUser.findIndex(item => item.name == 'cardNo')
this.editFormDataUser[idx].label = this.baseData.cardTypeList.find(item => item.confId == this.editForm.customerType).confName
}
if (['2', '4'].includes(this.routeInfo.addOrEdit)) {
if ([2, 4].includes(this.routeInfo.addOrEdit)) {
this.editForm.effectiveDate = new Date(new Date().setDate(new Date().getDate() + 1))
}
this.editForm.packageCode && this.packageAttr(true)
this.editForm.packageCode && this.packageAttr(true, productArrData)
})
},
getPackageList() {
this.$apis.beforeSale.getPackageListApi({}).then(res => {
this.toTestProductData(res)
// this.autoGenerate()
})
},
// 改建议价,实际销售价
......@@ -930,39 +991,66 @@ export default {
})
}
},
packageAttr(recovery = false) {
var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode)
this.packageToPrice()
var tempObj = this.$common.utils.deepClone(this.editFormPro)
this.editRulePro = {}
this.editFormPro = {}
var attrName = ''
targetItem &&
targetItem.groupAttributeList.forEach(item => {
if (item.attributeList.length == 1) {
attrName = item.attributeList[0].attributeName
this.$set(this.editFormPro, attrName, tempObj.hasOwnProperty(attrName) ? tempObj[attrName] : '')
if (item.attributeList[0].required == 1) {
this.editRulePro[item.attributeList[0].attributeName] = [
{
required: true,
message: '请输入' + item.attributeList[0].attributeDesc,
trigger: 'change'
}
]
}
} else {
for (var i = 0; i < item.num; i++) {
item.attributeList.forEach(k => {
attrName = k.attributeName
this.$set(this.editFormPro, attrName + i, tempObj.hasOwnProperty(attrName + i) ? tempObj[attrName + i] : '')
})
}
packageAttr(recovery = false, productArrData) {
var targetItem = productArrData.find(item => item.packageCode == this.editForm.packageCode)
if (targetItem.packageType == 1) {
this.equityRadio = 2
this.curSelectCustomPro = targetItem.packageName
this.editForm.attributeList.forEach(item => {
if (item.attributeName == 'service_period') {
item.attributeValue = item.attributeValue + '年'
} else if (item.attributeName == 'buy_car_type') {
item.attributeValue = item.attributeValue == 1 ? '全款车' : '贷款车'
} else if (item.attributeName.includes('price')) {
item.attributeValue = (item.attributeValue / 100).toFixed(2)
}
this.productModal.vip[item.attributeName] = item.attributeValue
})
} else {
this.equityRadio = 1
this.curSelectPro = [targetItem.packageName]
this.editForm.attributeList.forEach(item => {
if (item.attributeName == 'service_period') {
item.attributeValue = item.attributeValue + '年'
} else if (item.attributeName == 'buy_car_type') {
item.attributeValue = item.attributeValue == 1 ? '全款车' : '贷款车'
} else if (item.attributeName.includes('price')) {
item.attributeValue = (item.attributeValue / 100).toFixed(2)
}
this.productModal[targetItem.idName][item.attributeName] = item.attributeValue
})
if (recovery) {
this.recoveryEditFormPro()
}
// this.packageToPrice()
var tempObj = this.$common.utils.deepClone(this.editFormPro)
// this.editRulePro = {}
// this.editFormPro = {}
// var attrName = ''
// targetItem &&
// targetItem.groupAttributeList.forEach(item => {
// if (item.attributeList.length == 1) {
// attrName = item.attributeList[0].attributeName
// this.$set(this.editFormPro, attrName, tempObj.hasOwnProperty(attrName) ? tempObj[attrName] : '')
// if (item.attributeList[0].required == 1) {
// this.editRulePro[item.attributeList[0].attributeName] = [
// {
// required: true,
// message: '请输入' + item.attributeList[0].attributeDesc,
// trigger: 'change'
// }
// ]
// }
// } else {
// for (var i = 0; i < item.num; i++) {
// item.attributeList.forEach(k => {
// attrName = k.attributeName
// this.$set(this.editFormPro, attrName + i, tempObj.hasOwnProperty(attrName + i) ? tempObj[attrName + i] : '')
// })
// }
// }
// })
// if (recovery) {
// this.recoveryEditFormPro()
// }
},
recoveryEditFormPro() {
this.editForm.attributeList.length &&
......@@ -975,70 +1063,70 @@ export default {
})
this.$set(this.editFormPro, hashObj[item.attributeName] != 1 ? item.attributeName + item.sort : item.attributeName, item.attributeValue)
})
// console.log(this.editFormPro)
},
autoGenerate() {
var tempList = []
this.packageList.forEach(item => {
tempList = []
item.groupAttributeList.forEach((k, idx) => {
if (k.attributeList.length == 1) {
tempList.push({
label: k.attributeList[0].attributeDesc,
name: k.attributeList[0].attributeName,
type: k.attributeList[0].attributeType,
isDisabled: this.disabled || this.successDisable,
maxlength: k.attributeList[0].maxLength
})
if (k.attributeList[0].attributeType == 'datePicker') {
tempList[idx].dateType = 'date'
;(tempList[idx].valueFormat = 'yyyy-MM-dd'), (tempList[idx].pickerOptions = 'beforeRangePickerOptions')
}
} else {
var tableList = []
for (var i = 0; i < k.num; i++) {
tableList[i] = []
k.attributeList.forEach((j, index) => {
tableList[i].push({
groupName: j.groupName,
attributeDesc: j.attributeDesc,
attributeName: j.attributeName,
name: j.attributeName + i,
sort: i,
attributeGroup: j.attributeGroup,
maxlength: j.maxLength,
required: j.required,
attributeType: j.attributeType,
isDisabled: this.disabled || this.successDisable
})
})
}
tempList.push({
label: '',
name: '',
addHtml: 'table',
attributeList: k.attributeList,
tableList: tableList
})
}
})
this.editFormDataPro[0].optionList.push({
packageCode: item.packageCode,
packageName: item.packageName,
serviceItems: item.serviceItemsList.length ? item.serviceItemsList.map(k => k.serviceName).join(',') : '',
serviceItemsList: item.serviceItemsList,
groupAttributeList: item.groupAttributeList,
editFormData: this.$common.utils.deepClone(tempList)
})
})
this.routeInfo.addOrEdit != '1' ? this.getInfo() : ''
autoGenerate(arr1, arr2) {
const tempList = arr1.concat(arr2)
this.routeInfo.addOrEdit != '1' ? this.getInfo(tempList) : ''
// var tempList = []
// this.packageList.forEach(item => {
// tempList = []
// item.groupAttributeList.forEach((k, idx) => {
// if (k.attributeList.length == 1) {
// tempList.push({
// label: k.attributeList[0].attributeDesc,
// name: k.attributeList[0].attributeName,
// type: k.attributeList[0].attributeType,
// isDisabled: this.disabled || this.successDisable,
// maxlength: k.attributeList[0].maxLength
// })
// if (k.attributeList[0].attributeType == 'datePicker') {
// tempList[idx].dateType = 'date'
// ;(tempList[idx].valueFormat = 'yyyy-MM-dd'), (tempList[idx].pickerOptions = 'beforeRangePickerOptions')
// }
// } else {
// var tableList = []
// for (var i = 0; i < k.num; i++) {
// tableList[i] = []
// k.attributeList.forEach((j, index) => {
// tableList[i].push({
// groupName: j.groupName,
// attributeDesc: j.attributeDesc,
// attributeName: j.attributeName,
// name: j.attributeName + i,
// sort: i,
// attributeGroup: j.attributeGroup,
// maxlength: j.maxLength,
// required: j.required,
// attributeType: j.attributeType,
// isDisabled: this.disabled || this.successDisable
// })
// })
// }
// tempList.push({
// label: '',
// name: '',
// addHtml: 'table',
// attributeList: k.attributeList,
// tableList: tableList
// })
// }
// })
// this.editFormDataPro[0].optionList.push({
// packageCode: item.packageCode,
// packageName: item.packageName,
// serviceItems: item.serviceItemsList.length ? item.serviceItemsList.map(k => k.serviceName).join(',') : '',
// serviceItemsList: item.serviceItemsList,
// groupAttributeList: item.groupAttributeList,
// editFormData: this.$common.utils.deepClone(tempList)
// })
// })
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
if (hasAll && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
......@@ -1046,13 +1134,15 @@ export default {
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
if (item.optionsName) {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
}
})
......@@ -1198,6 +1288,7 @@ export default {
updateEquity(params) {
this.$apis.beforeSale.updateEquityApi(params).then(res => {
this.submit = false
if (res.errId == 'A1307') {
this.whereToGo('vin')
this.$message({
......@@ -1205,9 +1296,16 @@ export default {
type: 'error'
})
} else {
if (res.code != 0) {
this.$message({
message: res.message,
type: 'error'
})
return
}
this.$router.push({
// path: '/beforeSale/index',
name: 'beforeSale',
path: '/beforeSale/index',
// name: 'beforeSale',
params: res
})
}
......@@ -1237,8 +1335,8 @@ export default {
}
var params = this.getParams()
params.operationType = 1
if (['2', '3', '4'].includes(this.routeInfo.addOrEdit)) {
if (this.routeInfo.addOrEdit == '4' && this.editForm.orderStatus != 3) {
if ([2,3,4].includes(this.routeInfo.addOrEdit)) {
if (this.routeInfo.addOrEdit == 4 && this.editForm.orderStatus != 3) {
params.contractNo = ''
} else {
params.contractNo = this.routeInfo.contractNo
......@@ -1246,26 +1344,36 @@ export default {
} else {
params.contractNo = ''
}
console.log(params, '确定按钮提交的参数')
console.log(this.productModal, '产品的参数')
// this.$apis.beforeSale.checkOrderApi({ vin: this.editForm.vehicle.vin, contractNo: this.routeInfo.contractNo || '' }).then(res => {
// if (res.code == '0') {
// this.updateEquity(params)
// } else {
// this.submit = false
// this.$confirm(res.message, '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning',
// callback: action => {
// if (action == 'confirm') {
// this.submit = true
// this.updateEquity(params)
// }
// }
// })
// }
// })
if (this.equityRadio == 1) {
params = {
...params,
...this.formatProduct
}
} else {
params = {
...params,
...this.autoFormatProduct
}
}
this.$apis.beforeSale.checkOrderApi({ vin: this.editForm.vehicle.vin, contractNo: this.routeInfo.contractNo || '' }).then(res => {
if (res.code == '0') {
this.updateEquity(params)
} else {
this.submit = false
this.$confirm(res.message, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.submit = true
this.updateEquity(params)
}
}
})
}
})
},
handleReset() {
this.editForm = {
......@@ -1411,6 +1519,70 @@ export default {
}
}
}
.table_case_wrap {
display: flex;
.case_title {
width: 160px;
height: 54px;
white-space: nowrap;
text-align: right;
box-sizing: border-box;
padding-right: 12px;
font-size: 14px;
font-weight: 400;
color: #333333;
}
.case_table {
.table_th {
height: 54px;
background: #f4f6fc;
.th_item {
width: 229px;
height: 54px;
font-size: 14px;
font-weight: 600;
color: #333333;
}
.border-lr {
border-right: 1px solid #e8e8ea;
border-left: 1px solid #e8e8ea;
}
}
.table_tr {
border: 1px solid #e8e8ea;
border-right: none;
.tr_item {
width: 88px;
height: 160px;
font-size: 14px;
font-weight: 400;
color: #666;
border-right: 1px solid #e8e8ea;
}
.tr_sec_item_wrap {
.tr_sec_item {
.sec_item {
width: 229px;
height: 54px;
border-right: 1px solid #e8e8ea;
border-bottom: 1px solid #e8e8ea;
box-sizing: border-box;
padding-left: 31px;
}
.noborder {
border-bottom: none;
}
}
}
}
.max {
width: 291px;
}
.min {
width: 88px;
}
}
}
}
}
.before-sale .edit-sub-title {
......@@ -1533,6 +1705,8 @@ export default {
background: #f4f5fa;
}
.ma_bot {
box-sizing: border-box;
padding: 0 20px 0 40px;
height: 78px;
.custom_black {
background: #ffffff;
......
......@@ -7,8 +7,7 @@
</div>
<div class="container">
<div class="find_wrap">
<glsx-combi-form ref="showSearch" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData">
</glsx-combi-form>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData"></glsx-combi-form>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData2">
<span slot="footer" class="footer-btns">
<el-button :size="size" class="resetBtn" @click="handleReset">重置</el-button>
......@@ -188,14 +187,14 @@ export default {
{
label: '车主姓名',
prop: 'customerName',
line:1,
line: 1,
formatter: cellValue => {
return cellValue.customerName || '-'
}
},
{
label: '合同号',
line:1,
line: 1,
prop: 'contractNo',
width: '200px',
formatter: cellValue => {
......@@ -204,7 +203,7 @@ export default {
},
{
label: '提单成功时间',
line:1,
line: 1,
prop: 'successDate',
width: '160px',
formatter: cellValue => {
......@@ -213,7 +212,7 @@ export default {
},
{
label: '购车日期',
line:1,
line: 1,
prop: 'billingDate',
width: '130px',
formatter: cellValue => {
......@@ -222,7 +221,7 @@ export default {
},
{
label: '店面名称',
line:1,
line: 1,
prop: 'merchantName',
width: '160px',
formatter: cellValue => {
......@@ -231,7 +230,7 @@ export default {
},
{
label: '车品牌',
line:1,
line: 1,
prop: 'vehicleBrandName',
width: '160px',
formatter: cellValue => {
......@@ -240,25 +239,25 @@ export default {
},
{
label: '车系',
line:1,
width:"160px",
line: 1,
width: '160px',
prop: 'vehicleSeriesName',
formatter: cellValue => {
return cellValue.vehicleSeriesName || '-'
}
},
{
{
label: '无忧卡卡号',
line:1,
line: 1,
prop: 'cardSeqNo',
width: '200px',
width: '200px',
formatter: cellValue => {
return cellValue.carNo || '-'
}
},
{
label: '车架号',
line:1,
line: 1,
prop: 'vin',
width: '200px',
formatter: cellValue => {
......@@ -267,7 +266,7 @@ export default {
},
{
label: '电话',
line:1,
line: 1,
prop: 'customerPhone',
width: '160px',
formatter: cellValue => {
......@@ -276,15 +275,15 @@ export default {
},
{
label: '产品名称',
line:1,
line: 1,
prop: 'packageName',
formatter: cellValue => {
return cellValue.packageName || '-'
}
},
{
{
label: '无忧保障服务费',
line:1,
line: 1,
prop: 'actualSalesPrice',
width: '160px',
formatter: cellValue => {
......@@ -302,7 +301,7 @@ export default {
// },
{
label: '服务期限',
line:1,
line: 1,
prop: 'servicePeriod',
formatter: cellValue => {
return cellValue.servicePeriod ? '1年' : '-'
......@@ -310,7 +309,7 @@ export default {
},
{
label: '生效时间',
line:1,
line: 1,
prop: 'effectiveDate',
width: '130px',
formatter: cellValue => {
......@@ -319,7 +318,7 @@ export default {
},
{
label: '服务状态',
line:1,
line: 1,
prop: 'orderStatus',
width: '100px',
formatter: cellValue => {
......@@ -367,7 +366,7 @@ export default {
// },
{
label: '省代',
line:1,
line: 1,
prop: 'provinceMerchantName',
formatter: cellValue => {
return cellValue.provinceMerchantName || '-'
......@@ -375,7 +374,7 @@ export default {
},
{
label: '市代',
line:1,
line: 1,
prop: 'cityMerchantName',
formatter: cellValue => {
return cellValue.cityMerchantName || '-'
......@@ -383,7 +382,7 @@ export default {
},
{
label: '操作人',
line:1,
line: 1,
prop: 'updatedBy',
width: '140px',
formatter: cellValue => {
......@@ -458,7 +457,7 @@ export default {
glsxDialog,
pdfDialog
},
mounted() {
this.editNotify = this.$route.params
if (this.isFirst && this.editNotify.hasOwnProperty('code')) {
......@@ -580,13 +579,29 @@ export default {
apiName: apiName,
apiParams: apiParams
}
if (title == '退单') {
this.$confirm('是否确认退单??', '退单', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.handleSecondConfirm()
})
return
}
this.handleSecondCancel()
},
handleSecondConfirm() {
this.$apis[this.secondObj.apiModule][this.secondObj.apiName](this.secondObj.apiParams).then(res => {
this.handleSecondCancel()
this.isTipVisible = true
// this.handleSecondCancel()
// this.isTipVisible = true
if (this.secondObj.title == '退单') {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
}
this.editNotify = res
clearTimeout(this.timer)
this.timer = setTimeout(
......@@ -809,9 +824,9 @@ export default {
margin: 0 20px;
}
}
.table_wrapper{
.table_wrapper {
margin-top: 10px;
background: #ffffff;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
......@@ -860,17 +875,17 @@ export default {
.before-sale .el-table .cell {
line-height: 16px;
}
.before-sale .table-btns{
.before-sale .table-btns {
display: grid;
grid-template-columns: repeat(auto-fill, 33.33%);
grid-row-gap: 10px;
grid-row-gap: 10px;
}
.before-sale .table-btns .el-button {
// padding: 0 0 0 5px;
border-radius: 0;
border: 0;
padding: 0;
margin: 0;
border: 0;
padding: 0;
margin: 0;
}
// .before-sale .table-btns .el-button:first-child {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!