Commit 7eb4f6d8 by cwq0219

权益

1 parent b1474b8c
...@@ -3,6 +3,16 @@ import { http, http_brand } from '@/main' ...@@ -3,6 +3,16 @@ import { http, http_brand } from '@/main'
const defaultPath = 'scrm.api.equity.service.package.' const defaultPath = 'scrm.api.equity.service.package.'
const orderPath = 'scrm.api.equity.service.order.' const orderPath = 'scrm.api.equity.service.order.'
const getUserInfoApi = params => {
params.method = 'scrm.api.equity.common.merchant.current.det'
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getListApi = params => { const getListApi = params => {
params.method = `${defaultPath}order.list.get` params.method = `${defaultPath}order.list.get`
return http({ return http({
...@@ -13,6 +23,17 @@ const getListApi = params => { ...@@ -13,6 +23,17 @@ const getListApi = params => {
}) })
} }
// 获取门店
const getMerchantApi = params => {
params.method = 'scrm.api.equity.common.under.merchant.list.det'
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getExportApi = params => { const getExportApi = params => {
params.method = `${defaultPath}order.export.get` params.method = `${defaultPath}order.export.get`
return http({ return http({
...@@ -97,6 +118,17 @@ const updateHotlineApi = params => { ...@@ -97,6 +118,17 @@ const updateHotlineApi = params => {
}) })
} }
// 获取产品名称(套餐名称)
const getProListApi = params => {
params.method = `${defaultPath}select.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 获取无忧卡套餐列表 // 获取无忧卡套餐列表
const getPackageListApi = params => { const getPackageListApi = params => {
params.method = `${defaultPath}list.get` params.method = `${defaultPath}list.get`
...@@ -185,4 +217,16 @@ const uploadImgApi = params => { ...@@ -185,4 +217,16 @@ const uploadImgApi = params => {
}) })
} }
export default { getListApi, getExportApi, getPriteApi, getCarBrandListApi, getCarChildListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, updateHotlineApi, getPackageListApi, getEquityApi, updateEquityApi, createCodeApi, getOrderAttrApi, getOrderValueApi, updateOrderApi, uploadImgApi } // 退保
const backOrderApi = params => {
params.method = `${orderPath}charge.back`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getUserInfoApi, getListApi, getMerchantApi, getExportApi, getPriteApi, getCarBrandListApi, getCarChildListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, updateHotlineApi, getProListApi, getPackageListApi, getEquityApi, updateEquityApi, createCodeApi, getOrderAttrApi, getOrderValueApi, updateOrderApi, uploadImgApi, backOrderApi }
...@@ -53,14 +53,14 @@ ...@@ -53,14 +53,14 @@
<el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" :disabled="item.isDisabled" @change="item.handleRadioChange"> <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 v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio>
</el-radio-group> </el-radio-group>
<el-date-picker v-else-if="item.type === 'datePicker'" :value-format="item.valueFormat" :style="{ width: item.selectWidth || defaultWidth }" v-model="formObj[item.name]" :type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :placeholder="item.placeholder || '请选择' + item.label" :picker-options="pickerOption[item.pickerOptions]" @change="e => handleDateChange(e, item)"></el-date-picker> <el-date-picker v-else-if="item.type === 'datePicker'" :disabled="item.isDisabled" :value-format="item.valueFormat" :style="{ width: item.selectWidth || defaultWidth }" v-model="formObj[item.name]" :type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :placeholder="item.placeholder || '请选择' + item.label" :picker-options="pickerOption[item.pickerOptions]" @change="e => handleDateChange(e, item)"></el-date-picker>
<template v-else-if="item.type === 'uploadBtn'"> <template v-else-if="item.type === 'uploadBtn'">
<el-button type="primary"> <el-button type="primary">
上传 上传
<input type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="upload-img-btn" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleUploadChange(e, item)" /> <input type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="upload-img-btn" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleUploadChange(e, item)" />
</el-button> </el-button>
<!-- <el-button v-show="formObj[item.name]" type="primary">查看</el-button> --> <!-- <el-button v-show="formObj[item.name]" type="primary">查看</el-button> -->
<el-button type="primary">查看{{ formObj }}</el-button> <el-button v-show="formObj[item.name]" type="primary" @click="handleImgLook(formObj[item.name], item)">查看</el-button>
</template> </template>
<template v-else-if="item.type === 'upload'"> <template v-else-if="item.type === 'upload'">
<p class="photo-top-tips">{{ item.topTips }}</p> <p class="photo-top-tips">{{ item.topTips }}</p>
...@@ -411,6 +411,7 @@ export default { ...@@ -411,6 +411,7 @@ export default {
.glsx-combi-form .dialog-look { .glsx-combi-form .dialog-look {
text-align: center; text-align: center;
z-index: 999;
} }
.glsx-combi-form .dialog-video { .glsx-combi-form .dialog-video {
......
...@@ -4,23 +4,23 @@ ...@@ -4,23 +4,23 @@
<div class="container"> <div class="container">
<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" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleBrandId" placeholder="请选择品牌" filterable @change="handleChangeBrand(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;" :disabled="scope.scope.isDisabled">
<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>
<template slot="vehicleSubBrandId"> <template slot="vehicleSubBrandId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleSubBrandId" placeholder="请选择子品牌" filterable @change="getCarSeriesList()" style="width:220px; margin-right: 20px;"> <el-select v-model="editForm.vehicle.vehicleSubBrandId" placeholder="请选择子品牌" filterable @change="getCarSeriesList()" style="width:220px;" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carChildOptions" :key="item.id" :value="item.id" :label="item.name" /> <el-option v-for="item in baseData.carChildOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select> </el-select>
</template> </template>
<template slot="vehicleSeriesId"> <template slot="vehicleSeriesId" slot-scope="scope">
<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;" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carSeriesOptions" :key="item.id" :value="item.id" :label="item.name" /> <el-option v-for="item in baseData.carSeriesOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select> </el-select>
</template> </template>
<template slot="vehicleShapeId"> <template slot="vehicleShapeId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleShapeId" placeholder="请选择车型" style="width:220px;"> <el-select v-model="editForm.vehicle.vehicleShapeId" placeholder="请选择车型" style="width:220px;" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carTypeOptions" :key="item.id" :value="item.id" :label="item.name" /> <el-option v-for="item in baseData.carTypeOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select> </el-select>
</template> </template>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</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="i.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>
</el-popover> </el-popover>
...@@ -74,8 +74,8 @@ ...@@ -74,8 +74,8 @@
</div> </div>
<!-- <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> --> <!-- <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> -->
<div class="footer" :style="{ width: '100%' }"> <div class="footer" :style="{ width: '100%' }">
<el-button type="primary" @click="handleDraft">草稿</el-button> <el-button v-show="!['3', '5'].includes(routeInfo.addOrEdit)" type="primary" @click="handleDraft">草稿</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button> <el-button v-show="routeInfo.addOrEdit != 5" type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button> <el-button type="default" @click="handleCancel">取消</el-button>
</div> </div>
</div> </div>
...@@ -97,8 +97,10 @@ export default { ...@@ -97,8 +97,10 @@ export default {
// footerLeft: '0', // footerLeft: '0',
// footerWidth: '0', // footerWidth: '0',
editCarChildRef: 'editChildRef', editCarChildRef: 'editChildRef',
disabled: false,
successDisable: false,
routeInfo: { routeInfo: {
// 1-新增;2-编辑;3-查看 // 1-新增;2-编辑;3-修改;4-重新提单;5-查看
addOrEdit: 1, addOrEdit: 1,
contractNo: '' contractNo: ''
}, },
...@@ -176,46 +178,49 @@ export default { ...@@ -176,46 +178,49 @@ export default {
maxlength: 32 maxlength: 32
}, },
{ {
label: '座位数',
name: 'seatesNum',
type: 'select',
noFilter: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'seatesNumList'
},
{
label: '开票日期',
name: 'billingDate',
type: 'datePicker',
dateType: 'date',
valueFormat: 'yyyy-MM-dd',
pickerOptions: 'beforeRangePickerOptions',
handleDateChange: (value, targetItem) => {
console.log(value)
console.log(targetItem)
}
},
{
label: '品牌车型', label: '品牌车型',
name: 'vehicleBrandId', name: 'vehicleBrandId',
addHtml: 'vehicleBrandId' addHtml: 'vehicleBrandId'
}, },
{ {
label: '', label: '',
// label: '子品牌',
name: 'vehicleSubBrandId', name: 'vehicleSubBrandId',
addHtml: 'vehicleSubBrandId' addHtml: 'vehicleSubBrandId'
}, },
{ {
label: '', label: '',
// label: '品牌车系',
name: 'vehicleSeriesId', name: 'vehicleSeriesId',
addHtml: 'vehicleSeriesId' addHtml: 'vehicleSeriesId'
}, },
{ {
label: '', label: '',
// label: '品牌车型',
name: 'vehicleShapeId', name: 'vehicleShapeId',
addHtml: 'vehicleShapeId' addHtml: 'vehicleShapeId'
},
{
label: '开票日期',
name: 'billingDate',
type: 'datePicker',
dateType: 'date',
valueFormat: 'yyyy-MM-dd',
pickerOptions: 'beforeRangePickerOptions',
handleDateChange: (value, targetItem) => {
console.log(value)
console.log(targetItem)
}
},
{
label: '座位数',
name: 'seatesNum',
type: 'select',
noFilter: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'seatesNumList'
} }
], ],
// 客户信息 // 客户信息
...@@ -422,22 +427,46 @@ export default { ...@@ -422,22 +427,46 @@ export default {
glsxCombiForm glsxCombiForm
}, },
created() {
this.getAllVehicleBrand()
this.getCarChildList()
},
mounted() { mounted() {
// this.footerLeft = document.querySelector('.base-container-right').offsetLeft // this.footerLeft = document.querySelector('.base-container-right').offsetLeft
// this.footerWidth = document.documentElement.clientWidth - this.footerLeft // this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.params this.routeInfo = this.$route.params
this.disabled = this.routeInfo.addOrEdit == 5
// 提单成功 - 修改
this.successDisable = this.routeInfo.addOrEdit == 3
this.getOptionsList('editFormDataCar', false) this.getOptionsList('editFormDataCar', false)
this.getOptionsList('editFormDataUser', false) this.getOptionsList('editFormDataUser', false)
this.getOptionsList('editFormDataOther', false) this.getOptionsList('editFormDataOther', false)
this.disabled && this.setDisabled()
this.successDisable && this.setDisabled(['invoicePrice', 'billingDate', 'packageCode', 'actualSalesPrice', 'servicePeriod', 'effectiveDate'])
// this.title = this.titleObj[this.routeInfo.addOrEdit] // this.title = this.titleObj[this.routeInfo.addOrEdit]
console.log(this.routeInfo, '-------------') console.log(this.routeInfo, '-------------')
// 获取套餐列表 // 获取套餐列表
this.getPackageList() this.getPackageList()
this.getAllVehicleBrand()
this.getCarChildList()
}, },
methods: { methods: {
setDisabled(partDisabledList = []) {
var list = ['Car', 'User', 'Pro', 'Other']
var flag = true
var errorObjList = []
for (var i = 0; i < list.length; i++) {
this['editFormData' + list[i]].forEach((item, idx) => {
if (!partDisabledList.length) {
this['editFormData' + list[i]][idx].isDisabled = true
} else {
if (partDisabledList.includes(item.name)) {
this['editFormData' + list[i]][idx].isDisabled = true
}
}
})
}
},
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)
...@@ -456,6 +485,15 @@ export default { ...@@ -456,6 +485,15 @@ export default {
} }
this.editForm.vehicle.billingDate = this.editForm.vehicle.billingDate ? new Date(this.editForm.vehicle.billingDate) : '' 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.effectiveDate = this.editForm.effectiveDate ? new Date(this.editForm.effectiveDate) : ''
if (this.editForm.vehicle.vehicleBrandId) {
this.getCarChildList(true)
}
if (this.editForm.vehicle.vehicleSubBrandId) {
this.getCarSeriesList(true)
}
if (this.editForm.vehicle.vehicleSeriesId) {
this.getCarTypeList(true)
}
this.editForm.packageCode && this.packageAttr(true) this.editForm.packageCode && this.packageAttr(true)
}) })
}, },
...@@ -472,7 +510,7 @@ export default { ...@@ -472,7 +510,7 @@ export default {
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) console.log(targetItem)
targetItem.servicePackagePrices.forEach(item => { targetItem && 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)
} }
...@@ -481,7 +519,7 @@ export default { ...@@ -481,7 +519,7 @@ export default {
// console.log(this.editForm) // console.log(this.editForm)
this.editRulePro = {} this.editRulePro = {}
this.editFormPro = {} this.editFormPro = {}
targetItem.groupAttributeList.forEach(item => { targetItem && targetItem.groupAttributeList.forEach(item => {
if (item.attributeList.length == 1) { if (item.attributeList.length == 1) {
this.$set(this.editFormPro, item.attributeList[0].attributeName, '') this.$set(this.editFormPro, item.attributeList[0].attributeName, '')
if (item.attributeList[0].required == 1) { if (item.attributeList[0].required == 1) {
...@@ -518,7 +556,8 @@ export default { ...@@ -518,7 +556,8 @@ export default {
tempList.push({ tempList.push({
label: k.attributeList[0].attributeDesc, label: k.attributeList[0].attributeDesc,
name: k.attributeList[0].attributeName, name: k.attributeList[0].attributeName,
type: k.attributeList[0].attributeType type: k.attributeList[0].attributeType,
isDisabled: this.disabled || this.successDisable
}) })
if (k.attributeList[0].attributeType == 'datePicker') { if (k.attributeList[0].attributeType == 'datePicker') {
tempList[idx].dateType = 'date' tempList[idx].dateType = 'date'
...@@ -539,7 +578,8 @@ export default { ...@@ -539,7 +578,8 @@ export default {
sort: i, sort: i,
attributeGroup: j.attributeGroup, attributeGroup: j.attributeGroup,
required: j.required, required: j.required,
attributeType: j.attributeType attributeType: j.attributeType,
isDisabled: this.disabled || this.successDisable
}) })
}) })
} }
...@@ -596,7 +636,7 @@ export default { ...@@ -596,7 +636,7 @@ export default {
this.baseData.carBrandOptions = res || [] this.baseData.carBrandOptions = res || []
}) })
}, },
handleChangeBrand(brandId) { handleChangeBrand(brandId, isRecovery = false) {
this.editForm.vehicle.vehicleSubBrandId = '' this.editForm.vehicle.vehicleSubBrandId = ''
this.editForm.vehicle.vehicleSeriesId = '' this.editForm.vehicle.vehicleSeriesId = ''
this.editForm.vehicle.vehicleShapeId = '' this.editForm.vehicle.vehicleShapeId = ''
...@@ -605,17 +645,22 @@ export default { ...@@ -605,17 +645,22 @@ export default {
this.baseData.carTypeOptions = [] this.baseData.carTypeOptions = []
}, },
// 获取子品牌 // 获取子品牌
getCarChildList() { getCarChildList(isRecovery = false) {
this.$apis.beforeSale.getCarChildListApi({}).then(res => { this.$apis.beforeSale.getCarChildListApi({}).then(res => {
this.allCarChildList = res || [] this.allCarChildList = res || []
if (isRecovery) {
this.baseData.carChildOptions = this.allCarChildList.find(item => item.id == this.editForm.vehicle.vehicleBrandId).childs
}
}) })
}, },
// 获取车系 // 获取车系
getCarSeriesList() { getCarSeriesList(isRecovery = false) {
if (!isRecovery) {
this.editForm.vehicle.vehicleSeriesId = '' this.editForm.vehicle.vehicleSeriesId = ''
this.editForm.vehicle.vehicleShapeId = '' this.editForm.vehicle.vehicleShapeId = ''
this.baseData.carSeriesOptions = [] this.baseData.carSeriesOptions = []
this.baseData.carTypeOptions = [] this.baseData.carTypeOptions = []
}
const params = { const params = {
brandId: this.editForm.vehicle.vehicleBrandId, brandId: this.editForm.vehicle.vehicleBrandId,
childBrandId: this.editForm.vehicle.vehicleSubBrandId childBrandId: this.editForm.vehicle.vehicleSubBrandId
...@@ -625,11 +670,13 @@ export default { ...@@ -625,11 +670,13 @@ export default {
}) })
}, },
// 获取车型 // 获取车型
getCarTypeList(value) { getCarTypeList(isRecovery = false) {
if (!isRecovery) {
this.editForm.vehicle.vehicleShapeId = '' this.editForm.vehicle.vehicleShapeId = ''
this.baseData.carTypeOptions = [] this.baseData.carTypeOptions = []
}
const params = { const params = {
carSeriesId: value carSeriesId: this.editForm.vehicle.vehicleSeriesId
} }
this.$apis.beforeSale.getCarTypeListApi(params).then(res => { this.$apis.beforeSale.getCarTypeListApi(params).then(res => {
this.baseData.carTypeOptions = res || [] this.baseData.carTypeOptions = res || []
...@@ -651,6 +698,19 @@ export default { ...@@ -651,6 +698,19 @@ export default {
if (this.editForm.actualSalesPrice) { if (this.editForm.actualSalesPrice) {
params.actualSalesPrice = (this.editForm.actualSalesPrice * 100).toFixed(0) params.actualSalesPrice = (this.editForm.actualSalesPrice * 100).toFixed(0)
} }
// 车品牌
if (this.editForm.vehicle.vehicleBrandId) {
params.vehicle.vehicleBrandName = this.baseData.carBrandOptions.find(item => item.id == this.editForm.vehicle.vehicleBrandId).name
}
if (this.editForm.vehicle.vehicleSubBrandId) {
params.vehicle.vehicleSubBrandName = this.baseData.carChildOptions.find(item => item.id == this.editForm.vehicle.vehicleSubBrandId).name
}
if (this.editForm.vehicle.vehicleSeriesId) {
params.vehicle.vehicleSeriesName = this.baseData.carSeriesOptions.find(item => item.id == this.editForm.vehicle.vehicleSeriesId).name
}
if (this.editForm.vehicle.vehicleShapeId) {
params.vehicle.vehicleBrandName = this.baseData.carTypeOptions.find(item => item.id == this.editForm.vehicle.vehicleShapeId).name
}
var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode) var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode)
// console.log(targetItem) // console.log(targetItem)
params.attributeList = [] params.attributeList = []
...@@ -697,12 +757,22 @@ export default { ...@@ -697,12 +757,22 @@ export default {
}, },
updateEquity(params) { updateEquity(params) {
this.$apis.beforeSale.updateEquityApi(params).then(res => { this.$apis.beforeSale.updateEquityApi(params).then(res => {
if (res.code == '0') {
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : '操作失败', message: res.data.code ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error' type: res.data.code ? 'success' : 'error'
}) })
if (res.code == '0') { if (res.data.code) {
this.handleCancel() this.handleCancel()
} else {
this.whereToGo('licensing')
}
} else {
this.whereToGo('licensing')
this.$message({
message: res.message,
type: 'error'
})
} }
}) })
}, },
...@@ -711,22 +781,24 @@ export default { ...@@ -711,22 +781,24 @@ export default {
var flag = true var flag = true
var errorObjList = [] var errorObjList = []
for (var i = 0; i < list.length; i++) { for (var i = 0; i < list.length; i++) {
if(this.$refs['editFormRef' + list[i]]) {
var pRef = list[i] == 'Pro' ? this.$refs['editFormRef' + list[i]][0] : this.$refs['editFormRef' + list[i]] var pRef = list[i] == 'Pro' ? this.$refs['editFormRef' + list[i]][0] : this.$refs['editFormRef' + list[i]]
pRef.$refs['editChildRef' + list[i]].validate((valid, errorObj) => { pRef.$refs['editChildRef' + list[i]].validate((valid, errorObj) => {
!valid && errorObjList.push(errorObj) !valid && errorObjList.push(errorObj)
flag && (flag = valid) flag && (flag = valid)
}) })
} }
}
if (!flag) { if (!flag) {
this.whereToGo(Object.keys(errorObjList[0])[0]) this.whereToGo(Object.keys(errorObjList[0])[0])
return true return true
} }
var params = this.getParams() var params = this.getParams()
if (this.routeInfo.addOrEdit == 2) { // if ([2, 3].includes(this.routeInfo.addOrEdit)) {
params.contractNo = this.routeInfo.contractNo // params.contractNo = this.routeInfo.contractNo
} // }
params.operationType = 1 params.operationType = 1
if (this.routeInfo.addOrEdit == 2) { if ([2, 3].includes(this.routeInfo.addOrEdit)) {
params.contractNo = this.routeInfo.contractNo params.contractNo = this.routeInfo.contractNo
this.updateEquity(params) this.updateEquity(params)
} else { } else {
......
...@@ -18,13 +18,13 @@ ...@@ -18,13 +18,13 @@
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="zoneRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="zoneRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button v-if="[2, 4, 5].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(4, scope.scope)">查看</el-button> <el-button v-if="[2, 4, 5].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(5, scope.scope)">查看</el-button>
<el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handlePdf(scope.scope)">打印</el-button> <el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handlePdf(scope.scope)">打印</el-button>
<el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleUpload(scope.scope)">上传资料</el-button> <el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleUpload(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="[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="handleBack(scope.scope)">退保</el-button>
<el-button v-if="[3, 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="handleEdit(4, scope.scope)">重新提单</el-button>
</div> </div>
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
...@@ -46,9 +46,11 @@ export default { ...@@ -46,9 +46,11 @@ export default {
data() { data() {
return { return {
size: 'small', size: 'small',
userInfo: {},
searchForm: { searchForm: {
queryText: '', queryText: '',
orderStatus: '', orderStatus: '',
packageCode: '',
successDate: [], successDate: [],
effectiveDate: [] effectiveDate: []
}, },
...@@ -82,11 +84,11 @@ export default { ...@@ -82,11 +84,11 @@ export default {
}, },
{ {
label: '产品名称', label: '产品名称',
name: '', name: 'packageCode',
type: 'select', type: 'select',
optionList: [], optionList: [],
optionId: 'confId', optionId: 'packageCode',
optionLabel: 'confName', optionLabel: 'packageName',
optionsName: 'goodsStatusList' optionsName: 'goodsStatusList'
}, },
{ {
...@@ -110,7 +112,38 @@ export default { ...@@ -110,7 +112,38 @@ export default {
optionList: [], optionList: [],
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
optionsName: 'goodsStatusList' optionsName: 'merchantList',
isHide: true
},
{
label: '大区',
name: 'dqtId',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'dqList',
isHide: true
},
{
label: '片区',
name: 'pqId',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'pqList',
isHide: true
},
{
label: '门店',
name: 'mdId',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'mdList',
isHide: true
} }
], ],
// 表格 // 表格
...@@ -128,7 +161,10 @@ export default { ...@@ -128,7 +161,10 @@ export default {
}, },
{ {
label: '合同号', label: '合同号',
prop: '' prop: 'contractNo',
formatter: cellValue => {
return cellValue.contractNo || '-'
}
}, },
{ {
label: '提单成功时间', label: '提单成功时间',
...@@ -201,7 +237,10 @@ export default { ...@@ -201,7 +237,10 @@ export default {
}, },
{ {
label: '服务期限', label: '服务期限',
prop: '' prop: 'servicePeriod',
formatter: cellValue => {
return cellValue.servicePeriod ? '1年' : '-'
}
}, },
{ {
label: '生效时间', label: '生效时间',
...@@ -220,49 +259,54 @@ export default { ...@@ -220,49 +259,54 @@ export default {
}, },
{ {
label: '大区', label: '大区',
prop: '' prop: 'provinceMerchantName',
// formatter: cellValue => { formatter: cellValue => {
// return cellValue.packageName || '-' return cellValue.provinceMerchantName || '-'
// } }
}, },
{ {
label: '片区', label: '片区',
prop: '' prop: 'cityMerchantName',
// formatter: cellValue => { formatter: cellValue => {
// return cellValue.packageName || '-' return cellValue.cityMerchantName || '-'
// } }
}, },
{ {
label: '操作人', label: '操作人',
prop: '' prop: 'updatedBy',
// formatter: cellValue => { formatter: cellValue => {
// return cellValue.packageName || '-' return cellValue.updatedBy || '-'
// } }
} }
] ]
}, },
pageConf: { pageSize: 'pageCount', pageNum: 'pageSize', totalCount: 'total' }, pageConf: { pageSize: 'pageCount', pageNum: 'pageSize', totalCount: 'total' },
// 公共数据 // 公共数据
baseData: { baseData: {
goodsStatusList: [],
merchantList: [],
dqList: [],
pqList: [],
mdList: [],
orderStatusList: [ orderStatusList: [
{ {
confId: '0', confId: 0,
confName: '初始化' confName: '初始化'
}, },
{ {
confId: '2', confId: 2,
confName: '提单成功' confName: '提单成功'
}, },
{ {
confId: '3', confId: 3,
confName: '提单失败' confName: '提单失败'
}, },
{ {
confId: '4', confId: 4,
confName: '已退单' confName: '已退单'
}, },
{ {
confId: '5', confId: 5,
confName: '已过期' confName: '已过期'
} }
] ]
...@@ -277,10 +321,28 @@ export default { ...@@ -277,10 +321,28 @@ export default {
}, },
mounted() { mounted() {
this.$apis.beforeSale.getProListApi({}).then(res => {
this.baseData.goodsStatusList = res
this.getOptionsList('searchFormData') this.getOptionsList('searchFormData')
})
this.$apis.beforeSale.getUserInfoApi({}).then(res => {
console.log(res)
this.userInfo = res
var levelToShow = {
1: 'merchantIds',
2: 'dqtId',
3: 'pqId',
4: 'mdId'
}
})
// this.getMerchantList('', 'merchantIds', 'merchantList')
}, },
methods: { methods: {
getMerchantList(id, attrName, listName) {
var params = {}
// this.$apis.beforeSearchFn.getMerchantApi()
},
getParams() { getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.successDate.length) { if (this.searchForm.successDate.length) {
...@@ -350,8 +412,16 @@ export default { ...@@ -350,8 +412,16 @@ export default {
} }
}) })
}, },
// 1-新增;2-编辑 // 1-新增;2-编辑;3-修改;4-重新提单;5-查看
handleEdit(addOrEdit, row) { handleEdit(addOrEdit, row) {
if (addOrEdit == 3 && new Date(new Date().setDate(new Date().getDate() - 7)) > new Date(row.successDate)) {
const h = this.$createElement
this.$message({
message: h('p', null, [h('p', { style: 'text-align: center; line-height: 20px; color: #F56C6C;' }, '为保障客户权益,请邮件主送:operation@didihu.com.cn,抄送:liuqm@didihu.com.cn,jiangfj@didihu.com.cn提交退单申请 ')]),
type: 'error'
})
return true
}
addOrEdit == 1 ? this.$router.push('/beforeSale/editEquity/' + addOrEdit + '/' + -1) : this.$router.push('/beforeSale/editEquity/' + addOrEdit + '/' + row.contractNo) addOrEdit == 1 ? this.$router.push('/beforeSale/editEquity/' + addOrEdit + '/' + -1) : this.$router.push('/beforeSale/editEquity/' + addOrEdit + '/' + row.contractNo)
}, },
...@@ -361,10 +431,8 @@ export default { ...@@ -361,10 +431,8 @@ export default {
// 打印 // 打印
handlePdf(row) { handlePdf(row) {
// this.pdfUrl = 'C:/Users/zhoujj/AppData/Local/Temp/baiduyunguanjia/onlinedit/cache/39d5d49441f9884a432cb59ed2443ef7/2111189f54f808c9e8946e.pdf'
this.handlePdfClose() this.handlePdfClose()
this.$apis.beforeSale.getPriteApi({ contractNo: row.contractNo }).then(res => { this.$apis.beforeSale.getPriteApi({ contractNo: row.contractNo }).then(res => {
console.log(res)
this.pdfUrl = res this.pdfUrl = res
}) })
}, },
...@@ -377,18 +445,19 @@ export default { ...@@ -377,18 +445,19 @@ export default {
attachmentType: 'IMG' attachmentType: 'IMG'
} }
this.$apis.beforeSale.updateOrderApi(params).then(res => { this.$apis.beforeSale.updateOrderApi(params).then(res => {
// this.uploadForm[targetItem.name] = imgUrl this.$message({
console.log(targetItem) message: res.code == '0' ? '操作成功' : res.message,
this.$set(this.uploadForm, targetItem.name, 'https://img0.baidu.com/it/u=1027006618,1872310278&fm=26&fmt=auto') type: res.code == '0' ? 'success' : 'error'
// this.uploadForm[targetItem.name] = 'https://img0.baidu.com/it/u=1027006618,1872310278&fm=26&fmt=auto' })
console.log(this.uploadForm) if (res.code == '0') {
this.$set(this.uploadForm, targetItem.name, imgUrl)
}
}) })
}, },
// 上传资料 // 上传资料
autoGenerate() { autoGenerate() {
var tempList = [] var tempList = []
this.uploadForm = {}
this.uploadFormData = [] this.uploadFormData = []
this.packageList.forEach(item => { this.packageList.forEach(item => {
// item.groupAttributeList.forEach((k, idx) => { // item.groupAttributeList.forEach((k, idx) => {
...@@ -427,21 +496,29 @@ export default { ...@@ -427,21 +496,29 @@ export default {
handleUpload(row) { handleUpload(row) {
console.log(row) console.log(row)
this.$apis.beforeSale.getOrderAttrApi({ packageCode: row.packageCode }).then(res => { this.$apis.beforeSale.getOrderAttrApi({ packageCode: row.packageCode }).then(res => {
console.log(res)
this.packageList = res this.packageList = res
this.uploadForm.contractNo = row.contractNo this.uploadForm.contractNo = row.contractNo
// this.packageList.forEach(item => { this.packageList.forEach(item => {
// this.$apis.beforeSale.getOrderValueApi({ contractNo: row.contractNo, attachmentCode: item.attachmentCode }).then(res => { this.$apis.beforeSale.getOrderValueApi({ contractNo: row.contractNo, attachmentCode: item.attachmentCode }).then(subRes => {
// console.log(res) this.uploadForm[item.attachmentCode] = subRes || ''
// this.uploadForm[item.attachmentCode] = res })
// }) })
// })
this.autoGenerate() this.autoGenerate()
}) })
}, },
handleDelete(row) { // 退保
this.secondConfirm('删除', '是否确认删除该专区?', 'zoneList', 'deleteZoneApi', { contractNo: row.contractNo }) handleBack(row) {
console.log(row)
if (new Date(new Date().setDate(new Date().getDate() - 7)) > new Date(row.successDate)) {
const h = this.$createElement
this.$message({
message: h('p', null, [h('p', { style: 'text-align: center; line-height: 20px; color: #F56C6C;' }, '为保障客户权益,请邮件主送:operation@didihu.com.cn,抄送:liuqm@didihu.com.cn,jiangfj@didihu.com.cn提交退单申请 ')]),
type: 'error'
})
return true
}
this.secondConfirm('退保', '是否确认退保?', 'beforeSale', 'backOrderApi', { contractNo: row.contractNo, merchantId: row.merchantId })
}, },
// 导出 // 导出
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!