Commit b4e75df9 by cwq0219

编辑

1 parent 203f866b
...@@ -34,6 +34,17 @@ const getCarBrandListApi = params => { ...@@ -34,6 +34,17 @@ const getCarBrandListApi = params => {
}) })
} }
const getCarChildListApi = params => {
// params.method = 'dj.api.car.series.list'
params.method = 'scrm.api.carlife.common.getOnlyCarBrandList'
return http_brand({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getCarSeriesListApi = params => { const getCarSeriesListApi = params => {
params.method = 'scrm.api.carlife.common.getCarSeriesList' params.method = 'scrm.api.carlife.common.getCarSeriesList'
return http_brand({ return http_brand({
...@@ -118,4 +129,4 @@ const createCodeApi = params => { ...@@ -118,4 +129,4 @@ const createCodeApi = params => {
}) })
} }
export default { getListApi, getExportApi, getCarBrandListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, updateHotlineApi, getPackageListApi, getEquityApi, updateEquityApi, createCodeApi } export default { getListApi, getExportApi, getCarBrandListApi, getCarChildListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, updateHotlineApi, getPackageListApi, getEquityApi, updateEquityApi, createCodeApi }
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</span> </span>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<div v-else-if="item.type === 'input'"> <div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)"> <el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)" @blur="e => handleInputBlur(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span> <span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="append">{{ item.append }}</span> <span v-if="item.append" slot="append">{{ item.append }}</span>
</el-input> </el-input>
...@@ -174,6 +174,9 @@ export default { ...@@ -174,6 +174,9 @@ export default {
item.keyFn() item.keyFn()
} }
}, },
handleInputBlur(e, targetItem) {
targetItem.inputBlur && targetItem.inputBlur()
},
handleDateChange(value, targetItem) { handleDateChange(value, targetItem) {
targetItem.handleDateChange && targetItem.handleDateChange(value, targetItem) targetItem.handleDateChange && targetItem.handleDateChange(value, targetItem)
}, },
......
...@@ -5,14 +5,23 @@ ...@@ -5,14 +5,23 @@
<p class="edit-title">车辆信息</p> <p class="edit-title">车辆信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRefCar" labelWidth="140px" formRef="editChildRefCar" :formObj.sync="editForm.vehicle" :formData="editFormDataCar" :formRules="editRuleCar"> <glsx-combi-form class="edit-form-container" ref="editFormRefCar" labelWidth="140px" formRef="editChildRefCar" :formObj.sync="editForm.vehicle" :formData="editFormDataCar" :formRules="editRuleCar">
<template slot="vehicleBrandId"> <template slot="vehicleBrandId">
<el-select v-model="editForm.vehicle.vehicleBrandId" placeholder="请选择品牌" filterable @change="getCarSeriesList(editForm.vehicle.vehicleBrandId)" style="width:220px; margin-right: 20px;"> <el-select v-model="editForm.vehicle.vehicleBrandId" placeholder="请选择品牌" filterable @change="handleChangeBrand(editForm.vehicle.vehicleBrandId)" style="width:220px; margin-right: 20px;">
<el-option v-for="item in baseData.carBrandOptions" :key="item.id" :value="item.id" :label="item.name" /> <el-option v-for="item in baseData.carBrandOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select> </el-select>
</template>
<template slot="vehicleSubBrandId">
<el-select v-model="editForm.vehicle.vehicleSubBrandId" placeholder="请选择子品牌" filterable @change="getCarSeriesList()" style="width:220px; margin-right: 20px;">
<el-option v-for="item in baseData.carChildOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
<template slot="vehicleSeriesId">
<el-select v-model="editForm.vehicle.vehicleSeriesId" placeholder="请选择车系" @change="getCarTypeList(editForm.vehicle.vehicleSeriesId)" style="width:220px; margin-right: 20px;"> <el-select v-model="editForm.vehicle.vehicleSeriesId" placeholder="请选择车系" @change="getCarTypeList(editForm.vehicle.vehicleSeriesId)" style="width:220px; margin-right: 20px;">
<el-option v-for="item in baseData.carSeriesOptions" :key="item.carChildsBrandId" :value="item.carChildsBrandId" :label="item.carChildsBrandName" /> <el-option v-for="item in baseData.carSeriesOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select> </el-select>
</template>
<template slot="vehicleShapeId">
<el-select v-model="editForm.vehicle.vehicleShapeId" placeholder="请选择车型" style="width:220px;"> <el-select v-model="editForm.vehicle.vehicleShapeId" placeholder="请选择车型" style="width:220px;">
<el-option v-for="item in baseData.carTypeOptions" :key="item.carSeriesId" :value="item.carSeriesId" :label="item.carSeriesName" /> <el-option v-for="item in baseData.carTypeOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select> </el-select>
</template> </template>
</glsx-combi-form> </glsx-combi-form>
...@@ -23,7 +32,8 @@ ...@@ -23,7 +32,8 @@
</div> </div>
<div class="container"> <div class="container">
<p class="edit-title">选择产品</p> <p class="edit-title">选择产品</p>
<glsx-combi-form class="edit-form-container" ref="editFormRefPro" labelWidth="140px" formRef="editChildRefPro" :formObj="editForm" :formData="editFormDataPro" :formRules="editRulePro"> <!-- <glsx-combi-form class="edit-form-container" ref="editFormRefPro" labelWidth="140px" formRef="editChildRefPro" :formObj="editForm" :formData="editFormDataPro" :formRules="editRulePro"> -->
<glsx-combi-form class="edit-form-container" labelWidth="140px" :formObj="editForm" :formData="editFormDataPro">
<template slot="packageCode" slot-scope="scope"> <template slot="packageCode" slot-scope="scope">
<el-radio-group class="package-code-box" v-model="editForm[scope.scope.name]" :disabled="scope.scope.isDisabled" @change="scope.scope.handleRadioChange"> <el-radio-group class="package-code-box" v-model="editForm[scope.scope.name]" :disabled="scope.scope.isDisabled" @change="scope.scope.handleRadioChange">
<el-radio class="package-code" v-for="subItem in scope.scope.optionList" :key="subItem[scope.scope.optionId]" :label="subItem[scope.scope.optionId]"> <el-radio class="package-code" v-for="subItem in scope.scope.optionList" :key="subItem[scope.scope.optionId]" :label="subItem[scope.scope.optionId]">
...@@ -31,15 +41,15 @@ ...@@ -31,15 +41,15 @@
<div class="radio-add-block"> <div class="radio-add-block">
<p>{{ subItem.serviceItems }}</p> <p>{{ subItem.serviceItems }}</p>
<div v-if="editForm.packageCode == subItem[scope.scope.optionId]"> <div v-if="editForm.packageCode == subItem[scope.scope.optionId]">
<glsx-combi-form class="edit-form-container" ref="editFormRefPro" labelWidth="140px" :formRef="editChildRefPro" :isBlock="true" :formObj="editFormPro" :formData="subItem.editFormData" :formRules="editRulePro"> <glsx-combi-form class="edit-form-container" ref="editFormRefPro" labelWidth="140px" formRef="editChildRefPro" :isBlock="true" :formObj="editFormPro" :formData="subItem.editFormData" :formRules="editRulePro">
<template slot="table" slot-scope="scope"> <template slot="table" slot-scope="scope">
<table class="table-style"> <table class="table-style">
<tbody> <tbody>
<tr> <tr>
<td v-for="(m, n) in scope.scope.attributeList" :key="n" :style="{ width: (100 / scope.scope.attributeList.length) + '%'}">{{ m.attributeDesc }}</td> <td v-for="(m, n) in scope.scope.attributeList" :key="n" :style="{ width: 100 / scope.scope.attributeList.length + '%' }">{{ m.attributeDesc }}</td>
</tr> </tr>
<tr v-for="(m, n) in scope.scope.tableList" :key="n"> <tr v-for="(m, n) in scope.scope.tableList" :key="n">
<td v-for="(i, j) in m" :key="j" :style="{ width: (100 / scope.scope.attributeList.length) + '%'}"> <td v-for="(i, j) in m" :key="j" :style="{ width: 100 / scope.scope.attributeList.length + '%' }">
<el-input :disabled="isDisabled" :class="{ 'border-red': !editFormPro[i.name] }" placeholder="请输入" v-model="editFormPro[i.name]"> <el-input :disabled="isDisabled" :class="{ 'border-red': !editFormPro[i.name] }" placeholder="请输入" v-model="editFormPro[i.name]">
<el-popover v-show="!editFormPro[i.name]" slot="suffix" placement="top" title="" width="90" trigger="hover" :content="i.attributeDesc + '是必填项'"> <el-popover v-show="!editFormPro[i.name]" slot="suffix" placement="top" title="" width="90" trigger="hover" :content="i.attributeDesc + '是必填项'">
<i class="el-icon-warning color-red" slot="reference"></i> <i class="el-icon-warning color-red" slot="reference"></i>
...@@ -98,6 +108,7 @@ export default { ...@@ -98,6 +108,7 @@ export default {
actualSalesPrice: '', actualSalesPrice: '',
vehicle: { vehicle: {
vehicleBrandId: '', vehicleBrandId: '',
vehicleSubBrandId: '',
vehicleSeriesId: '', vehicleSeriesId: '',
vehicleShapeId: '', vehicleShapeId: '',
licensing: '', licensing: '',
...@@ -108,9 +119,14 @@ export default { ...@@ -108,9 +119,14 @@ export default {
editRuleCar: { editRuleCar: {
licensing: [{ required: true, message: '请选择是否上牌', trigger: 'change' }], licensing: [{ required: true, message: '请选择是否上牌', trigger: 'change' }],
licensePlate: [{ required: true, message: '请输入车牌号码', trigger: 'change' }], licensePlate: [{ required: true, message: '请输入车牌号码', trigger: 'change' }],
vin: [{ required: true, message: '请输入车架号', trigger: 'change' }],
engineNo: [{ required: true, message: '请输入发动机号', trigger: 'change' }], engineNo: [{ required: true, message: '请输入发动机号', trigger: 'change' }],
invoicePrice: [{ required: true, message: '请输入发票价格', trigger: 'change' }], invoicePrice: [{ required: true, message: '请输入发票价格', trigger: 'change' }],
vehicleColor: [{ required: true, message: '请输入车身颜色', trigger: 'change' }], vehicleColor: [{ required: true, message: '请输入车身颜色', trigger: 'change' }],
vehicleBrandId: [{ required: true, message: '请选择车品牌', trigger: 'change' }],
vehicleSubBrandId: [{ required: true, message: '请选择车子品牌', trigger: 'change' }],
vehicleSeriesId: [{ required: true, message: '请选择车系', trigger: 'change' }],
// vehicleShapeId: [{ required: true, message: '请选择车型', trigger: 'change' }],
billingDate: [{ required: true, message: '请选择开票日期', trigger: 'change' }], billingDate: [{ required: true, message: '请选择开票日期', trigger: 'change' }],
seatesNum: [{ required: true, message: '请选择座位数', trigger: 'change' }] seatesNum: [{ required: true, message: '请选择座位数', trigger: 'change' }]
}, },
...@@ -132,6 +148,12 @@ export default { ...@@ -132,6 +148,12 @@ export default {
maxlength: 32 maxlength: 32
}, },
{ {
label: '车架号',
name: 'vin',
type: 'input',
maxlength: 19
},
{
label: '发动机号', label: '发动机号',
name: 'engineNo', name: 'engineNo',
type: 'input', type: 'input',
...@@ -142,7 +164,10 @@ export default { ...@@ -142,7 +164,10 @@ export default {
name: 'invoicePrice', name: 'invoicePrice',
type: 'input', type: 'input',
append: '元', append: '元',
maxlength: 11 maxlength: 11,
inputBlur: () => {
this.packageAttr()
}
}, },
{ {
label: '车身颜色', label: '车身颜色',
...@@ -153,10 +178,22 @@ export default { ...@@ -153,10 +178,22 @@ export default {
{ {
label: '品牌车型', label: '品牌车型',
name: 'vehicleBrandId', name: 'vehicleBrandId',
addHtml: 'vehicleBrandId', addHtml: 'vehicleBrandId'
style: { },
display: 'block' {
} label: '',
name: 'vehicleSubBrandId',
addHtml: 'vehicleSubBrandId'
},
{
label: '',
name: 'vehicleSeriesId',
addHtml: 'vehicleSeriesId'
},
{
label: '',
name: 'vehicleShapeId',
addHtml: 'vehicleShapeId'
}, },
{ {
label: '开票日期', label: '开票日期',
...@@ -259,7 +296,8 @@ export default { ...@@ -259,7 +296,8 @@ export default {
suggestedSellingPrice: [{ required: true, message: '请输入建议销售价', trigger: 'change' }], suggestedSellingPrice: [{ required: true, message: '请输入建议销售价', trigger: 'change' }],
actualSalesPrice: [ actualSalesPrice: [
{ required: true, message: '请输入实际销售价', trigger: 'change' }, { required: true, message: '请输入实际销售价', trigger: 'change' },
{ validator: (rule, value, callback) => { {
validator: (rule, value, callback) => {
return +this.editForm.suggestedSellingPrice > +value ? callback(new Error('输入价格有误')) : callback() return +this.editForm.suggestedSellingPrice > +value ? callback(new Error('输入价格有误')) : callback()
}, },
trigger: 'change' trigger: 'change'
...@@ -300,77 +338,83 @@ export default { ...@@ -300,77 +338,83 @@ export default {
type: 'datePicker', type: 'datePicker',
dateType: 'date', dateType: 'date',
valueFormat: 'yyyy-MM-dd', valueFormat: 'yyyy-MM-dd',
pickerOptions: 'beforeRangePickerOptions' pickerOptions: 'afterRangePickerOptions'
} }
], ],
// 公共数据 // 公共数据
baseData: { baseData: {
licensingList: [ licensingList: [
{ {
confId: '0', confId: 0,
confName: '否' confName: '否'
}, },
{ {
confId: '1', confId: 1,
confName: '是' confName: '是'
} }
], ],
seatesNumList: [ seatesNumList: [
{ {
confId: '2', confId: 1,
confName: '1'
},
{
confId: 2,
confName: '2' confName: '2'
}, },
{ {
confId: '3', confId: 3,
confName: '3' confName: '3'
}, },
{ {
confId: '4', confId: 4,
confName: '4' confName: '4'
}, },
{ {
confId: '5', confId: 5,
confName: '5' confName: '5'
}, },
{ {
confId: '6', confId: 6,
confName: '6' confName: '6'
}, },
{ {
confId: '7', confId: 7,
confName: '7' confName: '7'
} }
], ],
customerTypeList: [ customerTypeList: [
{ {
confId: '1', confId: 1,
confName: '个人' confName: '个人'
}, },
{ {
confId: '2', confId: 2,
confName: '企业' confName: '企业'
} }
], ],
cardTypeList: [ cardTypeList: [
{ {
confId: '1', confId: 1,
confName: '身份证' confName: '身份证'
}, },
{ {
confId: '2', confId: 2,
confName: '统一社会信息代码' confName: '统一社会信息代码'
} }
], ],
servicePeriodList: [ servicePeriodList: [
{ {
confId: '1', confId: 1,
confName: '1年' confName: '1年'
} }
], ],
carBrandOptions: [], carBrandOptions: [],
carChildOptions: [],
carSeriesOptions: [], carSeriesOptions: [],
carTypeOptions: [] carTypeOptions: []
} },
allCarChildList: []
} }
}, },
...@@ -390,19 +434,29 @@ export default { ...@@ -390,19 +434,29 @@ export default {
// 获取套餐列表 // 获取套餐列表
this.getPackageList() this.getPackageList()
this.getAllVehicleBrand() this.getAllVehicleBrand()
this.routeInfo.addOrEdit != 1 ? this.getInfo() : '' this.getCarChildList()
}, },
methods: { methods: {
getInfo() { getInfo() {
this.$apis.beforeSale.getEquityApi({ contractNo: this.routeInfo.contractNo }).then(res => { this.$apis.beforeSale.getEquityApi({ contractNo: this.routeInfo.contractNo }).then(res => {
console.log(res) console.log(res)
// this.editForm.zoneName = res.zoneName this.editForm = {
// this.editForm.zoneImg = res.zoneImg ...res
// this.editForm.merchantList = res.merchantRefList }
// this.editForm.merchantList.forEach(item => { // 格式化价格
// item.merchantNo = item.merchantId if (this.editForm.vehicle.invoicePrice) {
// }) this.editForm.vehicle.invoicePrice = (this.editForm.vehicle.invoicePrice / 100).toFixed(2)
}
if (this.editForm.suggestedSellingPrice) {
this.editForm.suggestedSellingPrice = (this.editForm.suggestedSellingPrice / 100).toFixed(2)
}
if (this.editForm.actualSalesPrice) {
this.editForm.actualSalesPrice = (this.editForm.actualSalesPrice / 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) : ''
this.editForm.packageCode && this.packageAttr(true)
}) })
}, },
getPackageList() { getPackageList() {
...@@ -412,11 +466,12 @@ export default { ...@@ -412,11 +466,12 @@ export default {
this.autoGenerate() this.autoGenerate()
}) })
}, },
packageAttr() { packageAttr(recovery = false) {
var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode) var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode)
this.editForm.suggestedSellingPrice = '' this.editForm.suggestedSellingPrice = ''
if (this.editForm.vehicle.invoicePrice) { if (this.editForm.vehicle.invoicePrice) {
var invoicePrice = (this.editForm.vehicle.invoicePrice * 100).toFixed(2) var invoicePrice = (this.editForm.vehicle.invoicePrice * 100).toFixed(2)
console.log(targetItem)
targetItem.servicePackagePrices.forEach(item => { targetItem.servicePackagePrices.forEach(item => {
if (invoicePrice > item.carButtomPrice && invoicePrice < item.carHighestPrice) { if (invoicePrice > item.carButtomPrice && invoicePrice < item.carHighestPrice) {
this.editForm.suggestedSellingPrice = (item.retailPrice / 100).toFixed(2) this.editForm.suggestedSellingPrice = (item.retailPrice / 100).toFixed(2)
...@@ -440,6 +495,19 @@ export default { ...@@ -440,6 +495,19 @@ export default {
} }
} }
}) })
if (recovery) {
this.recoveryEditFormPro()
}
},
recoveryEditFormPro() {
this.editForm.attributeList.length && this.editForm.attributeList.forEach((item, idx) => {
let hashObj = {}
this.editForm.attributeList.map(i => i.attributeName).forEach((i, subIdx) => {
Object.keys(hashObj).includes(i) ? (hashObj[i] = hashObj[i] + 1) : (hashObj[i] = 1)
})
this.$set(this.editFormPro, hashObj[item.attributeName] != 1 ? (item.attributeName + item.sort) : item.attributeName, item.attributeValue)
})
console.log(this.editFormPro)
}, },
autoGenerate() { autoGenerate() {
var tempList = [] var tempList = []
...@@ -454,8 +522,8 @@ export default { ...@@ -454,8 +522,8 @@ export default {
}) })
if (k.attributeList[0].attributeType == 'datePicker') { if (k.attributeList[0].attributeType == 'datePicker') {
tempList[idx].dateType = 'date' tempList[idx].dateType = 'date'
tempList[idx].valueFormat = 'yyyy-MM-dd' tempList[idx].valueFormat = 'yyyy-MM-dd',
// tempList[idx].pickerOptions = 'beforeRangePickerOptions' tempList[idx].pickerOptions = 'beforeRangePickerOptions'
} }
} else { } else {
// console.log(k) // console.log(k)
...@@ -494,6 +562,7 @@ export default { ...@@ -494,6 +562,7 @@ export default {
}) })
}) })
console.log(this.editFormDataPro) console.log(this.editFormDataPro)
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
}, },
getOptionsList(formName, hasAll = true, refreshSigle) { getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
...@@ -521,16 +590,35 @@ export default { ...@@ -521,16 +590,35 @@ export default {
} }
}, },
// 获取品牌车型 // 获取品牌车型
getAllVehicleBrand(fn = () => { }) { getAllVehicleBrand(fn = () => {}) {
const params = {} const params = {}
this.$apis.beforeSale.getCarBrandListApi(params).then(res => { this.$apis.beforeSale.getCarBrandListApi(params).then(res => {
this.baseData.carBrandOptions = res || [] this.baseData.carBrandOptions = res || []
}) })
}, },
handleChangeBrand(brandId) {
this.editForm.vehicle.vehicleSubBrandId = ''
this.editForm.vehicle.vehicleSeriesId = ''
this.editForm.vehicle.vehicleShapeId = ''
this.baseData.carChildOptions = this.allCarChildList.find(item => item.id == brandId).childs
this.baseData.carSeriesOptions = []
this.baseData.carTypeOptions = []
},
// 获取子品牌
getCarChildList() {
this.$apis.beforeSale.getCarChildListApi({}).then(res => {
this.allCarChildList = res || []
})
},
// 获取车系 // 获取车系
getCarSeriesList(brandId) { getCarSeriesList() {
this.editForm.vehicle.vehicleSeriesId = ''
this.editForm.vehicle.vehicleShapeId = ''
this.baseData.carSeriesOptions = []
this.baseData.carTypeOptions = []
const params = { const params = {
brandId: brandId brandId: this.editForm.vehicle.vehicleBrandId,
childBrandId: this.editForm.vehicle.vehicleSubBrandId
} }
this.$apis.beforeSale.getCarSeriesListApi(params).then(res => { this.$apis.beforeSale.getCarSeriesListApi(params).then(res => {
this.baseData.carSeriesOptions = res || [] this.baseData.carSeriesOptions = res || []
...@@ -538,6 +626,8 @@ export default { ...@@ -538,6 +626,8 @@ export default {
}, },
// 获取车型 // 获取车型
getCarTypeList(value) { getCarTypeList(value) {
this.editForm.vehicle.vehicleShapeId = ''
this.baseData.carTypeOptions = []
const params = { const params = {
carSeriesId: value carSeriesId: value
} }
...@@ -545,6 +635,10 @@ export default { ...@@ -545,6 +635,10 @@ export default {
this.baseData.carTypeOptions = res || [] this.baseData.carTypeOptions = res || []
}) })
}, },
// 跳转
whereToGo(id) {
document.getElementById(id).scrollIntoView()
},
getParams() { getParams() {
var params = this.$common.utils.deepClone(this.editForm) var params = this.$common.utils.deepClone(this.editForm)
// 格式化价格 // 格式化价格
...@@ -615,31 +709,33 @@ export default { ...@@ -615,31 +709,33 @@ export default {
handleConfirm() { handleConfirm() {
var list = ['Car', 'User', 'Pro', 'Other'] var list = ['Car', 'User', 'Pro', 'Other']
var flag = true var flag = true
var errorObjList = []
for (var i = 0; i < list.length; i++) { for (var i = 0; i < list.length; i++) {
this.$refs['editFormRef' + list[i]].$refs['editChildRef' + list[i]].validate(valid => { var pRef = list[i] == 'Pro' ? this.$refs['editFormRef' + list[i]][0] : this.$refs['editFormRef' + list[i]]
flag = valid pRef.$refs['editChildRef' + list[i]].validate((valid, errorObj) => {
!valid && errorObjList.push(errorObj)
flag && (flag = valid)
}) })
} }
if (!flag) { if (!flag) {
this.whereToGo(Object.keys(errorObjList[0])[0])
return true return true
} }
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { var params = this.getParams()
if (valid) {
var params = this.$common.utils.deepClone(this.editForm)
if (this.routeInfo.addOrEdit == 2) { if (this.routeInfo.addOrEdit == 2) {
params.contractNo = this.routeInfo.contractNo params.contractNo = this.routeInfo.contractNo
} }
// this.$apis.zoneList.insertZoneApi(params).then(res => { params.operationType = 1
// this.$message({ if (this.routeInfo.addOrEdit == 2) {
// message: res.code == '0' ? '操作成功' : '操作失败', params.contractNo = this.routeInfo.contractNo
// type: res.code == '0' ? 'success' : 'error' this.updateEquity(params)
// }) } else {
// if (res.code == '0') { this.$apis.beforeSale.createCodeApi({}).then(res => {
// this.handleCancel() console.log(res)
// } params.contractNo = res
// }) this.updateEquity(params)
}
}) })
}
}, },
handleCancel() { handleCancel() {
this.$router.push({ this.$router.push({
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<el-button v-if="[0].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(2, scope.scope)">编辑</el-button> <el-button v-if="[0].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(3, scope.scope)">修改</el-button> <el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(3, scope.scope)">修改</el-button>
<el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleDelete(scope.scope)">退保</el-button> <el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleDelete(scope.scope)">退保</el-button>
<el-button v-if="[4, 5].includes(scope.scope.orderStatus)" type="text" @click="handleDelete(scope.scope)">重新提单</el-button> <el-button v-if="[3, 4, 5].includes(scope.scope.orderStatus)" type="text" @click="handleDelete(scope.scope)">重新提单</el-button>
</div> </div>
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
...@@ -106,7 +106,10 @@ export default { ...@@ -106,7 +106,10 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '车主姓名', label: '车主姓名',
prop: 'customerName' prop: 'customerName',
formatter: cellValue => {
return cellValue.customerName || '-'
}
}, },
{ {
label: '合同号', label: '合同号',
...@@ -117,7 +120,7 @@ export default { ...@@ -117,7 +120,7 @@ export default {
prop: 'successDate', prop: 'successDate',
width: '160px', width: '160px',
formatter: cellValue => { formatter: cellValue => {
return dayjs(cellValue.successDate).format('YYYY-MM-DD HH:mm:ss') return cellValue.successDate ? dayjs(cellValue.successDate).format('YYYY-MM-DD HH:mm:ss') : '-'
} }
}, },
{ {
...@@ -125,42 +128,60 @@ export default { ...@@ -125,42 +128,60 @@ export default {
prop: 'expirationDate', prop: 'expirationDate',
width: '160px', width: '160px',
formatter: cellValue => { formatter: cellValue => {
return dayjs(cellValue.expirationDate).format('YYYY-MM-DD HH:mm:ss') return cellValue.expirationDate ? dayjs(cellValue.expirationDate).format('YYYY-MM-DD HH:mm:ss') : '-'
} }
}, },
{ {
label: '店面名称', label: '店面名称',
prop: 'merchantName', prop: 'merchantName',
width: '160px', width: '160px',
line: 2 line: 2,
formatter: cellValue => {
return cellValue.merchantName || '-'
}
}, },
{ {
label: '车品牌', label: '车品牌',
prop: 'vehicleBrandName' prop: 'vehicleBrandName',
formatter: cellValue => {
return cellValue.vehicleBrandName || '-'
}
}, },
{ {
label: '车系', label: '车系',
prop: 'vehicleSeriesName' prop: 'vehicleSeriesName',
formatter: cellValue => {
return cellValue.vehicleSeriesName || '-'
}
}, },
{ {
label: '车架', label: '车架',
prop: 'vin' prop: 'vin',
formatter: cellValue => {
return cellValue.vin || '-'
}
}, },
{ {
label: '电话', label: '电话',
prop: 'customerPhone', prop: 'customerPhone',
width: '160px' width: '160px',
formatter: cellValue => {
return cellValue.customerPhone || '-'
}
}, },
{ {
label: '产品名称', label: '产品名称',
prop: 'packageName' prop: 'packageName',
formatter: cellValue => {
return cellValue.packageName || '-'
}
}, },
{ {
label: '实际销售价', label: '实际销售价',
prop: 'actualSalesPrice', prop: 'actualSalesPrice',
width: '160px', width: '160px',
formatter: cellValue => { formatter: cellValue => {
return (cellValue.actualSalesPrice / 100).toFixed(2) return cellValue.actualSalesPrice ? (cellValue.actualSalesPrice / 100).toFixed(2) : '-'
} }
}, },
{ {
...@@ -172,7 +193,7 @@ export default { ...@@ -172,7 +193,7 @@ export default {
prop: 'expirationDate', prop: 'expirationDate',
width: '160px', width: '160px',
formatter: cellValue => { formatter: cellValue => {
return dayjs(cellValue.expirationDate).format('YYYY-MM-DD HH:mm:ss') return cellValue.expirationDate ? dayjs(cellValue.expirationDate).format('YYYY-MM-DD HH:mm:ss') : '-'
} }
}, },
{ {
...@@ -185,14 +206,23 @@ export default { ...@@ -185,14 +206,23 @@ export default {
{ {
label: '大区', label: '大区',
prop: '' prop: ''
// formatter: cellValue => {
// return cellValue.packageName || '-'
// }
}, },
{ {
label: '片区', label: '片区',
prop: '' prop: ''
// formatter: cellValue => {
// return cellValue.packageName || '-'
// }
}, },
{ {
label: '操作人', label: '操作人',
prop: '' prop: ''
// formatter: cellValue => {
// return cellValue.packageName || '-'
// }
} }
] ]
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!