Commit dc862921 by 前端

Merge branch 'develop' into 'master'

合并线上版本代码到主干

See merge request !3
2 parents ea71e2c8 df7b0fa0
This diff could not be displayed because it is too large.
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-common": "^1.4.6", "glsx-common": "^1.4.6",
"glsx-components": "^1.2.5", "glsx-components": "^1.3.7",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
......
...@@ -44,7 +44,7 @@ const getMerchantApi = params => { ...@@ -44,7 +44,7 @@ const getMerchantApi = params => {
} }
const getExportApi = params => { const getExportApi = params => {
params.method = `${defaultPath}order.export.get` params.method = `scrm.api.equity.service.package.dj.order.export.get`
return http({ return http({
url: 'rop-scrm-equity/router', url: 'rop-scrm-equity/router',
method: 'GET', method: 'GET',
...@@ -55,7 +55,7 @@ const getExportApi = params => { ...@@ -55,7 +55,7 @@ const getExportApi = params => {
// 打印合同 // 打印合同
const getPriteApi = params => { const getPriteApi = params => {
params.method = `${defaultPath}order.prite` params.method = `scrm.api.equity.service.package.dj.order.print`
return http({ return http({
url: 'rop-scrm-equity/router', url: 'rop-scrm-equity/router',
method: 'GET', method: 'GET',
...@@ -107,7 +107,18 @@ const getCarTypeListApi = params => { ...@@ -107,7 +107,18 @@ const getCarTypeListApi = params => {
} }
const getHotlineApi = params => { const getHotlineApi = params => {
params.method = `${defaultPath}merchant.hotline.get` // params.method = `${defaultPath}merchant.hotline.get`
params.method = `scrm.api.equity.service.package.merchant.config.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getDefaultCarbrandApi = params => {
params.method = 'scrm.api.equity.service.merchant.vehicle.default.detail'
return http({ return http({
url: 'rop-scrm-equity/router', url: 'rop-scrm-equity/router',
method: 'POST', method: 'POST',
...@@ -127,6 +138,17 @@ const updateHotlineApi = params => { ...@@ -127,6 +138,17 @@ const updateHotlineApi = params => {
}) })
} }
const updateCarBrandApi = params => {
params.method = 'scrm.api.equity.service.merchant.vehicle.default.insert.or.update'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取产品名称(套餐名称) // 获取产品名称(套餐名称)
const getProListApi = params => { const getProListApi = params => {
params.method = `${defaultPath}select.get` params.method = `${defaultPath}select.get`
...@@ -140,7 +162,8 @@ const getProListApi = params => { ...@@ -140,7 +162,8 @@ const getProListApi = params => {
// 获取无忧卡套餐列表 // 获取无忧卡套餐列表
const getPackageListApi = params => { const getPackageListApi = params => {
params.method = `${defaultPath}list.get` params.method = `scrm.api.equity.service.package.dj.list.get`
// params.method = `scrm.api.equity.service.package.list.get`
return http({ return http({
url: 'rop-scrm-equity/router', url: 'rop-scrm-equity/router',
method: 'GET', method: 'GET',
...@@ -150,7 +173,7 @@ const getPackageListApi = params => { ...@@ -150,7 +173,7 @@ const getPackageListApi = params => {
} }
const getEquityApi = params => { const getEquityApi = params => {
params.method = `${orderPath}detail` params.method = `scrm.api.equity.service.channel.order.detail`
return http({ return http({
url: 'rop-scrm-equity/router', url: 'rop-scrm-equity/router',
method: 'POST', method: 'POST',
...@@ -160,7 +183,7 @@ const getEquityApi = params => { ...@@ -160,7 +183,7 @@ const getEquityApi = params => {
} }
const updateEquityApi = params => { const updateEquityApi = params => {
params.method = `${orderPath}insert.or.update` params.method = `scrm.api.equity.service.channel.order.insert.or.update`
return http({ return http({
url: 'rop-scrm-equity/router', url: 'rop-scrm-equity/router',
method: 'POST', method: 'POST',
...@@ -193,8 +216,17 @@ const getOrderAttrApi = params => { ...@@ -193,8 +216,17 @@ const getOrderAttrApi = params => {
} }
// 获取套菜附件属性 // 获取套菜附件属性
const getOrderValueApi = params => { // const getOrderValueApi = params => {
params.method = `${defaultPath}order.attachment.value.get` // params.method = `${defaultPath}order.attachment.value.get`
// return http({
// url: 'rop-scrm-equity/router',
// method: 'GET',
// data: params,
// sign: true
// })
// }
const getAllOrderValueApi = params => {
params.method = `${defaultPath}order.attachments.value.get`
return http({ return http({
url: 'rop-scrm-equity/router', url: 'rop-scrm-equity/router',
method: 'GET', method: 'GET',
...@@ -203,6 +235,30 @@ const getOrderValueApi = params => { ...@@ -203,6 +235,30 @@ const getOrderValueApi = params => {
}) })
} }
// 校验
const verifyOrderApi = params => {
params.method = 'scrm.api.equity.service.order.verify'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 车架号
const checkOrderApi = params => {
params.method = 'scrm.api.equity.service.order.check'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 更新套菜附件属性 // 更新套菜附件属性
const updateOrderApi = params => { const updateOrderApi = params => {
params.method = `${orderPath}attachment.update` params.method = `${orderPath}attachment.update`
...@@ -228,7 +284,19 @@ const uploadImgApi = params => { ...@@ -228,7 +284,19 @@ const uploadImgApi = params => {
// 退保 // 退保
const backOrderApi = params => { const backOrderApi = params => {
params.method = `${orderPath}charge.back` params.method = `scrm.api.equity.service.channel.order.charge.back`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 审核
const aduitOrderApi = params => {
params.method = `${orderPath}aduit`
return http({ return http({
url: 'rop-scrm-equity/router', url: 'rop-scrm-equity/router',
method: 'POST', method: 'POST',
...@@ -238,4 +306,69 @@ const backOrderApi = params => { ...@@ -238,4 +306,69 @@ const backOrderApi = params => {
}) })
} }
export default { getUserInfoApi, getCountNoDataApi, getListApi, getMerchantApi, getExportApi, getPriteApi, getCarBrandListApi, getCarChildListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, updateHotlineApi, getProListApi, getPackageListApi, getEquityApi, updateEquityApi, createCodeApi, getOrderAttrApi, getOrderValueApi, updateOrderApi, uploadImgApi, backOrderApi }
\ No newline at end of file \ No newline at end of file
// 是否开通配置
const judgeSetting = params => {
params.method = 'scrm.api.equity.service.merchant.config.get'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取特别约定
const spaAgressData = params => {
params.method = 'scrm.api.equity.service.spa.list.get'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
})
}
// 店铺信息
const merchantInfo = params => {
params.method = 'scrm.api.equity.common.merchant.detail.det'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
})
}
// 卡号---获取期限
const dateBycarNo = params => {
params.method = 'scrm.api.equity.service.cfc.get.by.seqno'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
})
}
// 获取活码列表-
const activeCodeList = params => {
params.method = 'entmicro.api.code.getFreeChannelCode'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true,
})
}
// 更新活码
const updateActiveCode = params => {
params.method = 'scrm.api.equity.service.merchant.qrcode.update'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
})
}
export default { getUserInfoApi, getCountNoDataApi, getListApi, getMerchantApi, getExportApi, getPriteApi, getCarBrandListApi, getCarChildListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, getDefaultCarbrandApi, updateHotlineApi, updateCarBrandApi, getProListApi, getPackageListApi, getEquityApi, updateEquityApi, createCodeApi, getOrderAttrApi, getAllOrderValueApi, verifyOrderApi, checkOrderApi, updateOrderApi, uploadImgApi, backOrderApi, aduitOrderApi, judgeSetting, spaAgressData, merchantInfo, dateBycarNo,activeCodeList,updateActiveCode }
\ No newline at end of file \ No newline at end of file
import { http, http_brand } from '@/main'
const defaultPath = 'scrm.api.equity.service.package.'
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 getCountNoDataApi = params => {
params.method = `${defaultPath}count.unDataEffective`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getListApi = params => {
params.method = `${defaultPath}order.list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 获取门店
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 => {
params.method = `${defaultPath}order.export.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 打印合同
const getPriteApi = params => {
params.method = `${defaultPath}order.prite`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true,
returnAll:true
})
}
const getCarBrandListApi = params => {
// params.method = 'dj.api.car.series.list'
params.method = 'scrm.api.carlife.common.getCarBrandList'
return http_brand({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
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 => {
params.method = 'scrm.api.carlife.common.getCarSeriesList'
return http_brand({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getCarTypeListApi = params => {
params.method = 'scrm.api.carlife.common.getCarTypeList'
return http_brand({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getHotlineApi = params => {
//params.method = `${defaultPath}merchant.hotline.get`
params.method = `${defaultPath}merchant.config.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getDefaultCarbrandApi = params => {
params.method = 'scrm.api.equity.service.merchant.vehicle.default.detail'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const updateHotlineApi = params => {
params.method = `${defaultPath}merchant.hotline.update`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const updateCarBrandApi = params => {
params.method = 'scrm.api.equity.service.merchant.vehicle.default.insert.or.update'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const getSalesPersonApi = params => {
params.method = 'entmicro.api.staff.findStaffByMerchantId'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取产品名称(套餐名称)
const getProListApi = params => {
params.method = `${defaultPath}select.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 获取无忧卡套餐列表
const getPackageListApi = params => {
params.method = `${defaultPath}list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getEquityApi = params => {
params.method = `${orderPath}detail`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const updateEquityApi = params => {
params.method = `${orderPath}insert.or.update`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取合同号
const createCodeApi = params => {
params.method = `${orderPath}code.create`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取套菜附件属性
const getOrderAttrApi = params => {
params.method = `${defaultPath}order.attachment.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 获取套菜附件属性
// const getOrderValueApi = params => {
// params.method = `${defaultPath}order.attachment.value.get`
// return http({
// url: 'rop-scrm-equity/router',
// method: 'GET',
// data: params,
// sign: true
// })
// }
const getAllOrderValueApi = params => {
params.method = `${defaultPath}order.attachments.value.get.multiple`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 校验
const verifyOrderApi = params => {
params.method = 'scrm.api.equity.service.order.verify'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 车架号
const checkOrderApi = params => {
params.method = 'scrm.api.equity.service.order.check'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 更新套菜附件属性
const updateOrderApi = params => {
params.method = `${orderPath}attachment.add`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
//删除图片
const delImgApi = params => {
params.method = `${orderPath}attachment.delete`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const uploadImgApi = params => {
params.method = 'scrm.api.equity.common.upload.image'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
// 退保
const backOrderApi = params => {
params.method = `${orderPath}charge.back`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 审核
const aduitOrderApi = params => {
params.method = `${orderPath}aduit`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const judgeSetting = params => {
params.method = `scrm.api.equity.service.merchant.config.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const failHttpByAdmin = params => {
params.method = `scrm.api.equity.service.order.resend.ero.transmission`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: false
})
}
export default { getUserInfoApi, getCountNoDataApi, getListApi, getMerchantApi, getExportApi, getPriteApi, getCarBrandListApi, getCarChildListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, getDefaultCarbrandApi, updateHotlineApi, updateCarBrandApi, getProListApi, getPackageListApi, getEquityApi, updateEquityApi, createCodeApi, getOrderAttrApi, getAllOrderValueApi, verifyOrderApi, checkOrderApi, updateOrderApi, uploadImgApi, backOrderApi, aduitOrderApi, delImgApi, getSalesPersonApi,judgeSetting,failHttpByAdmin }
...@@ -160,3 +160,21 @@ ...@@ -160,3 +160,21 @@
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
} }
.el-message{
z-index: 3000!important;
}
.customConfirm{
.el-message-box__btns button:nth-child(2) {
margin-left: 20px;
}
}
.el-message.el-message--error.customMessage{
&>p{
&>p{
white-space: nowrap;
}
}
}
\ No newline at end of file \ No newline at end of file
...@@ -18,3 +18,13 @@ export const afterRangePickerOptions = { ...@@ -18,3 +18,13 @@ export const afterRangePickerOptions = {
return false return false
} }
} }
export const afterTodayRangePickerOptions = {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
if (date < yesterday) {
return true
}
return false
}
}
<!-- 搜索 --> <!-- 搜索 -->
<template> <template>
<div class="glsx-combi-form"> <div class="glsx-combi-form">
<el-form :ref="formRef" :inline="true" :model="formObj" :label-width="labelWidth" :rules="formRules" size="small" class="glsx-combi-form-block"> <el-form :ref="formRef" :inline="true" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<template v-for="(item, index) in formData"> <template v-for="(item, index) in formData">
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ ...item.style }" :label="item.label ? item.label + ':' : ''" :prop="item.name"> <el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '144px' : labelWidth" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px': '30px', ...item.style }" :label="item.label" :prop="item.name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label"> <span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
<span class="tips-label">{{ item.label }}</span> <span class="tips-label">{{ item.label }}</span>
<el-tooltip popper-class="tooltip-class" effect="dark" :content="item.tips" :placement="item.placement || 'top'"> <el-tooltip popper-class="tooltip-class" effect="dark" :content="item.tips" :placement="item.placement || 'top'">
<span class="tips-icon"></span> <span class="tips-icon"></span>
</el-tooltip> </el-tooltip>
{{ item.label ? ':' : '' }} {{ item.label }}
</span>
<span v-else-if="!item.isHide && item.label" slot="label">
<span class="combi-form-label" :style="{ width: item.labelWidth ? (item.labelWidth + labelPaddingRight) + 'px' : '', 'padding-right': isEdit ? '12px' : (labelPaddingRight + 'px') }">{{ item.label }}</span>
</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'">
...@@ -20,28 +23,28 @@ ...@@ -20,28 +23,28 @@
<slot :name="item.suffixSlot" :scope="item"></slot> <slot :name="item.suffixSlot" :scope="item"></slot>
</div> </div>
<!-- 选择-输入框 --> <!-- 选择-输入框 -->
<el-input v-else-if="item.type === 'selectInput'" :placeholder="'请输入' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label" :maxlength="item.maxlength" v-model.trim="searchSelectObj[item.selectName].value" :clearable="item.isClear || false" :style="{ width: item.inputWidth || '130px' }" class="input-with-select"> <el-input v-else-if="item.type === 'selectInput'" :placeholder="'请输入' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label" :maxlength="item.maxlength" v-model.trim="searchSelectObj[item.selectName].value" :clearable="item.isClear || false" :style="{ width: item.inputWidth || defaultWidth }" class="input-with-select">
<el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || '130px' }" slot="prepend" placeholder="请选择" @change="item.handleSelectChange"> <el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || (labelWidth + 'px') }" slot="prepend" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option> <el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select> </el-select>
</el-input> </el-input>
<!-- 选择-时间选择框 --> <!-- 选择-时间选择框 -->
<template v-else-if="item.type === 'selectDatePicker'"> <!-- <template v-else-if="item.type === 'selectDatePicker'">
<el-select v-model="searchSelectObj[item.selectName].attr" style="width: 130px" placeholder="请选择" @change="item.handleSelectChange"> <el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || (labelWidth + 'px') }" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option> <el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select> </el-select>
<el-date-picker v-model="searchSelectObj[item.selectName].value" style="width: calc(100% - 130px)" :type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOption[item.pickerOptions]"></el-date-picker> <el-date-picker v-model="searchSelectObj[item.selectName].value" :style="{ width: item.width || defaultWidth }" :type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOption[item.pickerOptions]"></el-date-picker>
</template> </template> -->
<!-- 双选择框 --> <!-- 双选择框 -->
<template v-else-if="item.type === 'selectDouble'"> <!-- <template v-else-if="item.type === 'selectDouble'">
<el-select v-model="searchSelectObj[item.selectName].attr" style="width: 130px" placeholder="请选择" @change="item.handleSelectChange"> <el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || (labelWidth + 'px') }" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option> <el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select> </el-select>
<el-select v-model="searchSelectObj[item.selectName].value" style="width: calc(100% - 130px)" :placeholder="'请选择' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label"> <el-select v-model="searchSelectObj[item.selectName].value" :style="{ width: item.width || defaultWidth }" :placeholder="'请选择' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label">
<el-option label="全部" value=""></el-option> <el-option label="全部" value=""></el-option>
<el-option v-for="subItem in item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]"></el-option> <el-option v-for="subItem in item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]"></el-option>
</el-select> </el-select>
</template> </template> -->
<!-- 选择框 --> <!-- 选择框 -->
<div v-else-if="item.type === 'select'"> <div v-else-if="item.type === 'select'">
<el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="'请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)"> <el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="'请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
...@@ -53,21 +56,13 @@ ...@@ -53,21 +56,13 @@
<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'" :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="item.customPickerOptions || pickerOption[item.pickerOptions]" @change="e => handleDateChange(e, item)"></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 === 'uploadBtn'">
<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)" />
</el-button>
<!-- <el-button v-show="formObj[item.name]" type="primary">查看</el-button> -->
<el-button v-show="formObj[item.name]" type="primary" @click="handleImgLook(formObj[item.name], item)">查看</el-button>
</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>
<div v-if="!item.isDisabled" :style="{ width: item.width || '100%' }"> <div v-if="!item.isDisabled" :style="{ width: item.width || defaultWidth }">
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]" class="activity-img img-w-h"> <div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]" class="activity-img img-w-h">
<div class="add">+</div> <div class="add" :style="{ top: item.maxPhotoNum == 1 ? '50%' : '40%' }">+</div>
<span class="number">{{ formObj[item.name].length }} / {{ item.maxPhotoNum }}</span> <span v-if="item.maxPhotoNum > 1" class="number">{{ formObj[item.name].length }} / {{ item.maxPhotoNum }}</span>
<input v-if="item.uploadType == 'video'" type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="video/mp4" @change="e => handleUploadChange(e, item)" /> <input v-if="item.uploadType == 'video'" type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="video/mp4" @change="e => handleUploadChange(e, item)" />
<input v-else type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleUploadChange(e, item)" /> <input v-else type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleUploadChange(e, item)" />
</div> </div>
...@@ -98,29 +93,33 @@ ...@@ -98,29 +93,33 @@
</span> </span>
</div> </div>
</template> </template>
<slot :name="item.suffixSlot" :scope="item"></slot>
</template> </template>
</el-form-item> </el-form-item>
</template> </template>
<slot name="footer"></slot> <slot name="footer"></slot>
</el-form> </el-form>
<el-dialog :visible.sync="isImgVisible" class="dialog-look"> <el-dialog v-if="isImgVisible" :append-to-body="true" :modal-append-to-body="true" title="查看" :visible.sync="isImgVisible">
<div class="dialog-look">
<video v-if="dialogObj.uploadType == 'video'" class="dialog-video" controls> <video v-if="dialogObj.uploadType == 'video'" class="dialog-video" controls>
<source :src="dialogObj.url" type="video/mp4" /> <source :src="dialogObj.url" type="video/mp4">
</video> </video>
<img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" /> <img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" />
</div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { beforeRangePickerOptions, afterRangePickerOptions } from './common' import { beforeRangePickerOptions, afterRangePickerOptions,afterTodayRangePickerOptions } from './common'
export default { export default {
name: 'glsx-combi-form', name: 'glsx-combi-form',
data() { data() {
return { return {
pickerOption: { pickerOption: {
beforeRangePickerOptions: beforeRangePickerOptions, beforeRangePickerOptions: beforeRangePickerOptions,
afterRangePickerOptions: afterRangePickerOptions afterRangePickerOptions: afterRangePickerOptions,
afterTodayRangePickerOptions
}, },
isImgVisible: false, isImgVisible: false,
dialogObj: { dialogObj: {
...@@ -137,15 +136,24 @@ export default { ...@@ -137,15 +136,24 @@ export default {
}, },
defaultWidth: { defaultWidth: {
type: String, type: String,
default: '220px' default: '215px'
}, },
formRef: { formRef: {
type: String, type: String,
default: 'formRef' default: 'formRef'
}, },
isEdit: {
type: Boolean,
default: false
},
labelWidth: { labelWidth: {
type: String, type: Number,
default: '85px' // 默认是四个字符长度
default: 56
},
labelPaddingRight: {
type: Number,
default: 15
}, },
formData: { formData: {
type: Array, type: Array,
...@@ -177,16 +185,16 @@ export default { ...@@ -177,16 +185,16 @@ export default {
selectAddAttr(value, targetItem) { selectAddAttr(value, targetItem) {
targetItem.changeAttr && targetItem.changeAttr(value, targetItem) targetItem.changeAttr && targetItem.changeAttr(value, targetItem)
}, },
remoteMethod(value){
console.log(value,111)
},
handleInputDown(e, item) { handleInputDown(e, item) {
if (e.keyCode === 13 && item.hasOwnProperty('keyFn')) { if (e.keyCode === 13 && item.hasOwnProperty('keyFn')) {
item.keyFn() item.keyFn()
} }
}, },
handleInputBlur(e, targetItem) { handleInputBlur(e, item) {
targetItem.inputBlur && targetItem.inputBlur() item.inputBlur && item.inputBlur(e, item)
},
handleDateChange(value, targetItem) {
targetItem.handleDateChange && targetItem.handleDateChange(value, targetItem)
}, },
// 图片 // 图片
handleUploadChange(e, targetItem) { handleUploadChange(e, targetItem) {
...@@ -201,16 +209,19 @@ export default { ...@@ -201,16 +209,19 @@ export default {
const maxPhotoNum = targetItem.maxPhotoNum || 1 const maxPhotoNum = targetItem.maxPhotoNum || 1
const wdithLt = targetItem.wdithLt || 300 const wdithLt = targetItem.wdithLt || 300
const heightLt = targetItem.heightLt || 300 const heightLt = targetItem.heightLt || 300
if (maxPhotoNum == this.formObj[targetItem.name].length) { if (Array.isArray(this.formObj[targetItem.name]) && maxPhotoNum == this.formObj[targetItem.name].length) {
this.$message.error('只能上传' + maxPhotoNum + (uploadType == 'img' ? '张图片' : '个视频')) this.$message.error('只能上传' + maxPhotoNum + (uploadType == 'img' ? '张图片' : '个视频'))
document.getElementById(targetItem.name + 'file').value = ''
return true return true
} }
if (!isType) { if (!isType) {
this.$message.error(uploadType == 'img' ? '上传图片不是jpg、jpeg或png的格式!' : '上传视频不是MP4的格式!') this.$message.error(uploadType == 'img' ? '上传图片不是jpg、jpeg或png的格式!' : '上传视频不是MP4的格式!')
document.getElementById(targetItem.name + 'file').value = ''
return true return true
} }
if (!isLt) { if (!isLt) {
this.$message.error('上传' + (uploadType == 'img' ? '图片' : '视频') + '大小不能超过' + limitSize + 'MB!') this.$message.error('上传' + (uploadType == 'img' ? '图片' : '视频') + '大小不能超过' + limitSize + 'MB!')
document.getElementById(targetItem.name + 'file').value = ''
return true return true
} }
reader.readAsDataURL(file) reader.readAsDataURL(file)
...@@ -231,11 +242,13 @@ export default { ...@@ -231,11 +242,13 @@ export default {
targetItem.handleUpload(e, file, targetItem) targetItem.handleUpload(e, file, targetItem)
} }
} }
document.getElementById(targetItem.name + 'file').value = ''
}, },
// 图片删除 // 图片删除
handleImgDelete(targetItem, subIndex = -1) { handleImgDelete(targetItem, subIndex = -1) {
const imgUrl = this.formObj[targetItem.name][subIndex]
Array.isArray(this.formObj[targetItem.name]) ? this.formObj[targetItem.name].splice(subIndex, 1) : (this.formObj[targetItem.name] = '') Array.isArray(this.formObj[targetItem.name]) ? this.formObj[targetItem.name].splice(subIndex, 1) : (this.formObj[targetItem.name] = '')
this.$emit('handleImgDelete', targetItem) this.$emit('handleImgDelete', targetItem, imgUrl)
}, },
// 图片查看 // 图片查看
handleImgLook(src, targetItem) { handleImgLook(src, targetItem) {
...@@ -255,21 +268,24 @@ export default { ...@@ -255,21 +268,24 @@ export default {
/* .glsx-combi-form .glsx-combi-form-block { /* .glsx-combi-form .glsx-combi-form-block {
padding: 16px 40px 0; padding: 16px 40px 0;
} */ } */
.glsx-combi-form.clearfix::after {
content: '';
display: inline-block;
clear: both;
}
.glsx-combi-form .isBlock { .glsx-combi-form .isBlock {
display: block !important; display: block !important;
} }
/* .glsx-combi-form .el-form-item { /* .glsx-combi-form .el-form-item {
width: 65%; width: 65%;
} */ } */
.glsx-combi-form .no-label.el-form-item--small .el-form-item__content, .glsx-combi-form .no-label.el-form-item--small .el-form-item__content {
.el-form-item--small .el-form-item__label {
width: 100%; width: 100%;
} }
.glsx-combi-form .el-form-item--small.el-form-item {
margin: 0 30px 20px 0;
}
.glsx-combi-form .el-form-item--small .el-form-item__label {
padding: 0;
}
/* .glsx-combi-form .el-form-item--small .el-form-item__content { /* .glsx-combi-form .el-form-item--small .el-form-item__content {
width: calc(100% - 85px); width: calc(100% - 85px);
} */ } */
...@@ -310,7 +326,7 @@ export default { ...@@ -310,7 +326,7 @@ export default {
right: 14px; right: 14px;
margin-right: 4px; margin-right: 4px;
cursor: pointer; cursor: pointer;
border: 1px solid #7f7f7f; border: 1px dotted #7f7f7f;
border-radius: 50%; border-radius: 50%;
} }
.glsx-combi-form .tips-icon::before { .glsx-combi-form .tips-icon::before {
...@@ -325,13 +341,9 @@ export default { ...@@ -325,13 +341,9 @@ export default {
/* .glsx-combi-form .tips { /* .glsx-combi-form .tips {
margin: 0; margin: 0;
} */ } */
.glsx-combi-form .upload-img-btn { .glsx-combi-form .combi-form-label {
width: 62px; display: inline-block;
height: 32px; box-sizing: border-box;
position: absolute;
left: 0;
top: 0;
cursor: pointer;
} }
/* 图片上传 */ /* 图片上传 */
.glsx-combi-form .photo-top-tips { .glsx-combi-form .photo-top-tips {
...@@ -346,7 +358,8 @@ export default { ...@@ -346,7 +358,8 @@ export default {
.glsx-combi-form .activity-img { .glsx-combi-form .activity-img {
position: relative; position: relative;
color: #999999; color: #999999;
border: 1px dashed #d9d9d9; background-color: #F7F7F7;
border: 1px dotted #d9d9d9;
cursor: pointer; cursor: pointer;
} }
...@@ -416,7 +429,6 @@ export default { ...@@ -416,7 +429,6 @@ 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 {
...@@ -424,4 +436,18 @@ export default { ...@@ -424,4 +436,18 @@ export default {
height: 50%; height: 50%;
} }
/* 图片上传 */ /* 图片上传 */
.glsx-combi-form .el-tag.el-tag--info .el-tag__close {
color: #E8E8EA;
background-color: #5850ff !important;
}
.glsx-combi-form .el-tag.el-tag--info {
border-color: #5850ff;
}
.glsx-combi-form .el-tag--plain.el-tag--info .el-tag__close:hover {
background-color: #E8E8EA;
}
.glsx-combi-form .el-tag.el-tag--info .el-tag__close:hover {
background-color: #E8E8EA;
}
</style> </style>
<template> <template>
<div class="qr-code-components"> <div class="qr-code-components">
<div :style="[{bottom:bottom+'px'}]" @mouseenter="show = true" @mouseleave="show = false" class="right_btn flex_ccc"> <div :style="[{ bottom: bottom + 'px' }]" @mousedown="move" @mouseup="moveEnd" ref="callCenter" @mouseenter="show = true" @mouseleave="show = false" class="right_btn flex_ccc">
<img src="../../assets/contact_icon.png" /> <img src="../../assets/contact_icon.png" />
<div class="contact_text">联系我们</div> <div class="contact_text">联系我们</div>
</div> <div v-if="show" class="left_code flex_ccc">
<div :style="[{bottom:bottom+'px'}]" v-if="show" class="left_code flex_ccc">
<img :src="codeUrl" /> <img :src="codeUrl" />
<div style="height: 16px"></div> <div style="height: 16px"></div>
<span class="h18_title">服务热线</span> <span class="h18_title">{{phoneTitle}}</span>
<span class="h18_title">{{phone}}</span> <span class="h18_title">{{ phone }}</span>
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -21,13 +21,17 @@ export default { ...@@ -21,13 +21,17 @@ export default {
type: Number, type: Number,
default: 64 default: 64
}, },
codeUrl:{ codeUrl: {
type:String, type: String,
default:'https://img01.glsx.com.cn/weapp/resource/equity-h5-new/qrcode2.jpg' default: 'https://img01.glsx.com.cn/weapp/resource/equity-h5-new/qrcode2.jpg'
},
phone: {
type: String,
default: '189 0000 1234'
}, },
phone:{ phoneTitle:{
type:String, type:String,
default:'189 0000 1234' default:'服务热线'
} }
}, },
data() { data() {
...@@ -35,15 +39,57 @@ export default { ...@@ -35,15 +39,57 @@ export default {
show: false show: false
} }
}, },
methods: {} methods: {
// 拖动窗口,鼠标按下
move(event) {
// 给对应div添加拖拽属性
let callCenter = this.$refs.callCenter
callCenter.style.cursor = 'move'
var distanceX = event.clientX - callCenter.offsetLeft
var distanceY = event.clientY - callCenter.offsetTop
// 获取按下时对应的坐标
this.startX = event.pageX
this.startY = event.pageY
document.onmousemove = function (ev) {
var oevent = ev || event
// 加入判断,让浮窗在限定的页面内可拖动
if (ev.clientX < 40 || ev.clientX > document.body.clientWidth - 30) {
return
}
if (ev.clientY < 40 || ev.clientY > document.body.clientHeight - 30) {
return
}
callCenter.style.left = oevent.clientX - distanceX + 'px'
callCenter.style.top = oevent.clientY - distanceY + 'px'
}
document.onmouseup = function () {
document.onmousemove = null
document.onmouseup = null
callCenter.style.cursor = 'default'
}
},
// 鼠标抬起触发
moveEnd(event) {
// 获取鼠标抬起时的坐标
this.endX = event.pageX
this.endY = event.pageY
// 计算按下与抬起位置差值
var d = Math.sqrt((this.startX - this.endX) * (this.startX - this.endX) + (this.startY - this.endY) * (this.startY - this.endY))
if (d === 0 || d < 7) {
// console.log('执行了点击事件')
} else {
// console.log('执行了拖拽事件')
}
}
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.qr-code-components { .qr-code-components {
.left_code { .left_code {
position: fixed; position: absolute;
right: 77px; right: 57px;
bottom: 64px; bottom: 0px;
width: 144px; width: 144px;
height: 201px; height: 201px;
background: #ffffff; background: #ffffff;
......
...@@ -20,15 +20,15 @@ const staticRoutes = Object.freeze([{ ...@@ -20,15 +20,15 @@ const staticRoutes = Object.freeze([{
meta: {} meta: {}
}, },
{ {
name: 'beforeSale', name: 'serviceSet',
path: '/beforeSale/index', path: '/beforeSale/serviceSet',
component: resolve => require([`@/views/beforeSale/index.vue`], resolve), component: resolve => require([`@/views/beforeSale/serviceSet.vue`], resolve),
meta: {} meta: {}
}, },
{ {
name: 'editEquity', name: 'equityList',
path: '/beforeSale/editEquity/:addOrEdit/:contractNo', path: '/beforeSale/equityList',
component: resolve => require([`@/views/beforeSale/editEquity.vue`], resolve), component: resolve => require([`@/views/beforeSale/equityList.vue`], resolve),
meta: {} meta: {}
}, { }, {
name: 'introduct', name: 'introduct',
...@@ -41,10 +41,28 @@ const staticRoutes = Object.freeze([{ ...@@ -41,10 +41,28 @@ const staticRoutes = Object.freeze([{
component: resolve => require([`@/views/afterSales/index.vue`], resolve), component: resolve => require([`@/views/afterSales/index.vue`], resolve),
meta: {} meta: {}
}, { }, {
name: 'introduct', name: 'index',
path: '/beforeSale/introduct', path: '/beforeSale/index',
component: resolve => require([`@/views/beforeSale/introduct.vue`], resolve), component: resolve => require([`@/views/beforeSale/index.vue`], resolve),
meta: {} meta: {}
} },
{
name: 'editEquity',
path: '/beforeSale/editEquity/:id',
component: resolve => require([`@/views/beforeSale/editEquity.vue`], resolve),
meta: {}
},
{
name: 'checkSet',
path: '/beforeSale/checkSet',
component: resolve => require([`@/views/beforeSale/checkSet.vue`], resolve),
meta: {}
},
{
name: 'index',
path: '/ghPreSale/index',
component: resolve => require([`@/views/ghPreSale/index.vue`], resolve),
meta: {}
},
]) ])
export default staticRoutes export default staticRoutes
\ No newline at end of file \ No newline at end of file
...@@ -10,10 +10,13 @@ let routes = [] ...@@ -10,10 +10,13 @@ let routes = []
let router = null let router = null
let instance = null let instance = null
Vue.use(GLTable) Vue.use(GLTable)
// Vue.use(Table) // Vue.use(Table)
// Vue.use(TableColumn) // Vue.use(TableColumn)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) { export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, sign, secret } = await fetchConfig() const { response, request, request_brand, sign, secret } = await fetchConfig()
// 本地切换域名,不需要Mock上面改动 const => let
// request.baseURL = 'https://scrm.dev.glsx.com.cn'
// request_brand.baseURL = 'https://scrm.dev.glsx.com.cn'
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
...@@ -22,6 +25,9 @@ export async function bootstrap({ history, common, messenger, globalState, route ...@@ -22,6 +25,9 @@ export async function bootstrap({ history, common, messenger, globalState, route
Vue.prototype.$messageBox = messageBox Vue.prototype.$messageBox = messageBox
Vue.prototype.$defaultStartDate = '2021-07-01' Vue.prototype.$defaultStartDate = '2021-07-01'
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_brand = new common.Http({ response, request: request_brand, 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: '3c50d4be-7211-45c1-a2c6-9792bbb3c0d9' } })
// Vue.prototype.$http_brand = new common.Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: '3c50d4be-7211-45c1-a2c6-9792bbb3c0d9' } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState // Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
const routesData = common.utils.deepClone(globalState.routers) const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData) routes = getRoutes(routesData)
......
...@@ -18,14 +18,14 @@ export async function start() { ...@@ -18,14 +18,14 @@ export async function start() {
if (window.__POWERED_BY_QIANKUN__) return if (window.__POWERED_BY_QIANKUN__) return
const { response, request, request_brand, sign, secret } = await fetchConfig() const { response, request, request_brand, sign, secret } = await fetchConfig()
var urlParams = {} var urlParams = {}
window.location.href.split('?').length > 1 window.location.href.split('?').length > 1 ?
? window.location.href window.location.href
.split('?')[1] .split('?')[1]
.split('&') .split('&')
.forEach(item => { .forEach(item => {
urlParams[item.split('=')[0]] = item.split('=')[1] urlParams[item.split('=')[0]] = item.split('=')[1]
}) }) :
: '' ''
var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : '1112223333444' var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : '1112223333444'
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } }) Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } })
Vue.prototype.$http_brand = new Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: token } }) Vue.prototype.$http_brand = new Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: token } })
......
...@@ -69,4 +69,13 @@ util.getExplorer = function() { ...@@ -69,4 +69,13 @@ util.getExplorer = function() {
} }
return browserType return browserType
} }
util.debounce=(fn,timer)=> {
let timeout = null;
return function () {
clearTimeout(timeout);
timeout = setTimeout(() => {
fn.apply(this, arguments);
}, timer);
};
}
export default util export default util
\ No newline at end of file \ No newline at end of file
...@@ -148,8 +148,8 @@ ...@@ -148,8 +148,8 @@
</div> </div>
</div> </div>
<qrCode :codeUrl="code" phone="189 2340 8808"></qrCode> <qrCode :codeUrl="code" phone="189 2340 8808"></qrCode>
<el-dialog :visible.sync="videoShow" width="50%" :before-close="handleClose"> <el-dialog class="video-dialog" :visible.sync="videoShow" width="50%" :before-close="handleClose">
<div slot="title" style="height: 18px"></div> <div slot="title" style="height: 25px"></div>
<video v-if="videoShow" width="100%" height="100%" autoplay controls src="https://img02.glsx.com.cn/scrm/video/afterSale.mp4"></video> <video v-if="videoShow" width="100%" height="100%" autoplay controls src="https://img02.glsx.com.cn/scrm/video/afterSale.mp4"></video>
</el-dialog> </el-dialog>
</div> </div>
...@@ -182,7 +182,7 @@ export default { ...@@ -182,7 +182,7 @@ export default {
tip: '秒杀、抽奖、满减等' tip: '秒杀、抽奖、满减等'
}, },
{ {
title: '直播间直播', title: '直播间准备',
tip: '地点、灯光、布景等' tip: '地点、灯光、布景等'
} }
], ],
...@@ -532,4 +532,18 @@ export default { ...@@ -532,4 +532,18 @@ export default {
z-index: 2; z-index: 2;
} }
} }
::v-deep .video-dialog{
.el-dialog__header{
border-bottom: none;
background-color: #000;
.el-dialog__headerbtn{
top:15px;
font-size: 24px;
}
}
.el-dialog__body{
padding: 0;
display: flex;
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
<!-- 权益订单 -->
<template>
<div class="equity">
<open v-if="status == 1"></open>
<not-open v-if="status == 2"></not-open>
</div>
</template>
<script>
import equityList from './equityList.vue'
import introduct from './introduct.vue'
export default {
name: 'index',
components: {
open: equityList,
'not-open': introduct
},
data() {
return {
activeName: 'equityList',
status: 0
}
},
created() {
this.isOpenSettin()
// this.$router.push('/beforeSale/equityList')
},
mounted() {},
methods: {
// 判断是否开通
isOpenSettin() {
localStorage.removeItem('preSetStatus')
const { merchantId } = this.$globalState.session
this.$apis.beforeSale.judgeSetting({ merchantId }).then(res => {
// data != null 且data.openFlag == 1 为开通,其他的都是未开通
const { code, data } = res
if (code == 0 && data != null && data.openFlag == 1) {
this.status = 1
} else {
this.status = 2
}
localStorage.setItem('preSetStatus', this.status)
})
}
}
}
</script>
<style>
</style>
\ No newline at end of file \ No newline at end of file
<!-- 编辑权益 --> <!-- 编辑权益 -->
<template> <template>
<div class="before-sale edit-equity"> <div class="before-sale edit-equity">
<div class="help-service"> <!-- 车辆信息 -->
<img class="service-img" src="./image/code.png"/>
<p>扫码关注,在线咨询</p>
<!-- <p>在线客服随时咨询</p> -->
<p class="service-hotline">服务热线</p>
<p class="service-phone">18938907441</p>
</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="editFormRefCar" labelWidth="160px" formRef="editChildRefCar" :formObj.sync="editForm.vehicle" :formData="editFormDataCar" :formRules="editRuleCar"> <glsx-combi-form class="edit-form-container" ref="editFormRefCar" :isEdit="true" defaultWidth="320px" formRef="editChildRefCar" :formObj.sync="editForm.vehicle" :formData="editFormDataCar.slice(0, 7)" :formRules="editRuleCar"></glsx-combi-form>
<glsx-combi-form ref="editFormRefBrand" :isEdit="true" defaultWidth="215px" formRef="editChildRefBrand" :formObj.sync="editForm.vehicle" :formData="editFormDataCar.slice(7)" :formRules="editRuleCar">
<template slot="vehicleBrandId" slot-scope="scope"> <template slot="vehicleBrandId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleBrandId" placeholder="请选择品牌" filterable @change="handleChangeBrand(editForm.vehicle.vehicleBrandId)" style="width:220px;" :disabled="scope.scope.isDisabled"> <el-select v-model="editForm.vehicle.vehicleBrandId" class="m-r-10" placeholder="请选择品牌" filterable @change="handleChangeBrand(editForm.vehicle.vehicleBrandId)" style="width: 160px" :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" slot-scope="scope"> <template slot="vehicleSubBrandId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleSubBrandId" placeholder="请选择子品牌" filterable @change="getCarSeriesList()" style="width:220px;" :disabled="scope.scope.isDisabled"> <el-select v-model="editForm.vehicle.vehicleSubBrandId" class="m-r-10" placeholder="请选择子品牌" filterable @change="getCarSeriesList()" style="width: 160px" :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" slot-scope="scope"> <template slot="vehicleSeriesId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleSeriesId" placeholder="请选择车系" @change="getCarTypeList(editForm.vehicle.vehicleSeriesId)" style="width:220px;" :disabled="scope.scope.isDisabled"> <el-select v-model="editForm.vehicle.vehicleSeriesId" class="m-r-10" filterable placeholder="请选择车系" @change="getCarTypeList(editForm.vehicle.vehicleSeriesId)" style="width: 215px" :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" slot-scope="scope"> <template slot="vehicleShapeId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleShapeId" placeholder="请选择车型" style="width:220px;" :disabled="scope.scope.isDisabled"> <el-select v-model="editForm.vehicle.vehicleShapeId" filterable placeholder="请选择车型" style="width: 215px" :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>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<div class="container">
<!-- 客户信息 -->
<div class="container m-t-10">
<p class="edit-title">客户信息</p> <p class="edit-title">客户信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRefUser" labelWidth="160px" formRef="editChildRefUser" :formObj="editForm" :formData="editFormDataUser" :formRules="editRuleUser"></glsx-combi-form> <glsx-combi-form class="edit-form-container" ref="editFormRefUser" :isEdit="true" defaultWidth="320px" formRef="editChildRefUser" :formObj="editForm" :formData="editFormDataUser" :formRules="editRuleUser"></glsx-combi-form>
</div> </div>
<div class="container">
<!-- 选择产品 -->
<div class="container m-t-10">
<p class="edit-title">选择产品</p> <p class="edit-title">选择产品</p>
<!-- <glsx-combi-form class="edit-form-container" ref="editFormRefPro" labelWidth="160px" formRef="editChildRefPro" :formObj="editForm" :formData="editFormDataPro" :formRules="editRulePro"> --> <div class="edit_product_radio_wrap flex_sc">
<glsx-combi-form class="edit-form-container" labelWidth="160px" :formObj="editForm" :formData="editFormDataPro"> <el-radio v-if="productList.length" :disabled="disabled || leftDisable" v-model="equityRadio" :label="1">自选权益</el-radio>
<div style="width: 112px"></div>
<el-radio v-if="customProductList.length" :disabled="disabled || rightDisable" v-model="equityRadio" :label="2">定制权益</el-radio>
</div>
<!-- 自选权益 -->
<div v-if="equityRadio == '1'" class="auto_widget">
<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 @change="changeCheckBox($event, item)" :disabled="item.disabled" :label="item.packageName"></el-checkbox>
</div>
<!-- 属性 -->
<template v-for="(ele, indexs) in curSelectPro">
<div v-if="ele == item.packageName" :key="indexs" class="child_wrap">
<div class="child_wrap_pannel" v-for="(attr, attrindex) in item.groupAttributeList" :key="attrindex">
<div class="attr_wrapper flex_sc">
<div class="attr_label h13_title">
<span v-if="attr.required == 1" style="color: red">*</span>
{{ attr.attributeDesc }}
</div>
<div class="arrt_pannel">
<template v-if="attr.attributeType == 'input'">
<el-input class="arrt_pannel" :disabled="disabled || attr.disabled || (attr.attributeName == 'compensation_name' && compensationNameDisable)" @input="getCurChangeInput($event, item, attr, index, attrindex)" 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" :disabled="disabled || attr.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" :picker-options="attr.attributeName == 'additional_date' ? pickerOptions2 : pickerOptions" :disabled="disabled || attr.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" :disabled="disabled">
<div v-for="(item, index) in customProductList" :key="index" class="product_wrapper">
<div style="padding-left: 73px">
<el-radio @change="changeRaido($event, item)" :disabled="item.disabled" :label="item.packageName"></el-radio>
<p class="h20_title product_intro">包括服务项目:{{ item.serviceItems }}</p>
</div>
<div v-if="curSelectCustomPro == item.packageName" :key="indexs" class="child_wrap">
<div class="child_wrap_pannel" v-for="(attr, attrindex) in item.groupAttributeList" :key="attrindex">
<div class="attr_wrapper flex_sc">
<div class="attr_label h13_title">
<span v-if="attr.required == 1" style="color: red">*</span>
{{ attr.attributeDesc }}
</div>
<div class="arrt_pannel">
<template v-if="attr.attributeType == 'input'">
<el-input class="arrt_pannel" :disabled="disabled || attr.disabled || (attr.attributeName == 'compensation_name' && compensationNameDisable)" @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" :disabled="disabled || attr.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" :picker-options="attr.attributeName == 'additional_date' ? pickerOptions2 : pickerOptions" :disabled="disabled || attr.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>
</div>
</el-radio-group>
</div>
<!-- <div v-if="equityRadio == '2'" class="auto_widget">
<glsx-combi-form class="edit-form-container" :isEdit="true" defaultWidth="320px" :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]">
<span class="package-title">{{ subItem[scope.scope.optionLabel] }}</span> <span class="package-title">{{ subItem[scope.scope.optionLabel] }}</span>
<div class="radio-add-block" @click.stop.prevent="e => handleCancelBubble(e)"> <div class="radio-add-block" @click.stop.prevent="e => handleCancelBubble(e)">
<p>{{ subItem.serviceItems }}</p> <p class="package-subtitle">{{ 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="160px" formRef="editChildRefPro" :isBlock="true" :formObj="editFormPro" :formData="subItem.editFormData" :formRules="editRulePro"> <glsx-combi-form class="edit-form-container" ref="editFormRefPro" :isEdit="true" defaultWidth="320px" formRef="editChildRefPro" :isBlock="isBlock" :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>
...@@ -74,37 +172,65 @@ ...@@ -74,37 +172,65 @@
</el-radio-group> </el-radio-group>
</template> </template>
</glsx-combi-form> </glsx-combi-form>
</div> -->
</div> </div>
<div class="container">
<!-- 其他信息 -->
<div class="container m-t-10">
<p class="edit-title">其他信息</p> <p class="edit-title">其他信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRefOther" labelWidth="160px" formRef="editChildRefOther" :formObj="editForm" :formData="editFormDataOther" :formRules="editRuleOther"></glsx-combi-form> <glsx-combi-form class="edit-form-container" ref="editFormRefOther" :isEdit="true" defaultWidth="320px" formRef="editChildRefOther" :formObj="editForm" :formData="editFormDataOther" :formRules="editRuleOther"></glsx-combi-form>
</div> </div>
<!-- <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> -->
<div class="footer" :style="{ width: '100%' }"> <!-- 店面信息 -->
<el-button v-show="routeInfo.addOrEdit != '5'" type="primary" @click="handleConfirm">提单</el-button> <div class="container m-t-10">
<el-button v-show="routeInfo.addOrEdit == '1'" type="primary" @click="handleReset">重置</el-button> <p class="edit-title">店面信息</p>
<el-button v-show="!['3', '5'].includes(routeInfo.addOrEdit)" type="primary" @click="handleDraft">草稿</el-button> <glsx-combi-form class="edit-form-container" ref="editFormRefShop" :isEdit="true" defaultWidth="320px" formRef="editChildRefShop" :formObj="editForm" :formData="editFormDataShop" :formRules="editRuleShop"></glsx-combi-form>
<el-button type="default" @click="handleCancel">取消</el-button>
</div> </div>
<!-- 底部固定按钮 -->
<div style="height: 78px"></div>
<div
class="fixed_bottom"
:style="{
left: footerLeft + 'px',
width: footerWidth + 'px'
}"
>
<div class="ma_top"></div>
<div class="flex_cc ma_bot">
<el-button v-if="![3, 5].includes(routeInfo.addOrEdit)" size="small" class="custom_black" @click="handleReset">重置</el-button>
<div class="mar-10"></div>
<el-button class="custom_blue" v-if="![3, 5].includes(routeInfo.addOrEdit)" size="small" @click="handleDraft">草稿</el-button>
<div class="mar-10"></div>
<el-button v-if="routeInfo.addOrEdit != '5'" type="primary" size="small" @click="handleConfirm">{{ routeInfo.addOrEdit != '3' ? '提单' : '确定' }}</el-button>
<div class="mar-10"></div>
<el-button v-if="routeInfo.addOrEdit != 5" size="small" @click="handleCancel">返回</el-button>
<el-button v-else size="small" type="primary" @click="handleCancel">返回</el-button>
</div>
</div>
<!-- 二维码 -->
<qrCode :bottom="320" phone="400 6123 886" phoneTitle="提单及服务咨询" :codeUrl="qrcodUrl"></qrCode>
</div> </div>
</template> </template>
<script> <script>
import * as dayjs from 'dayjs'
import { limitPrice } from '@/common/constant'
import glsxCombiForm from '@/components/glsx-combi-form' import glsxCombiForm from '@/components/glsx-combi-form'
import qrCode from '@/components/qr-code'
import { fetchConfig } from '@/config'
import utils from '../../util/util'
export default { export default {
name: 'editEquity', name: 'editEquity',
data() { data() {
return { return {
size: 'small', size: 'small',
submit: false, submit: false,
// title: '新增权益', isBlock: true,
// titleObj: {
// 1: '新增权益', footerLeft: '0',
// 2: '编辑权益', footerWidth: '0',
// 3: '查看权益'
// },
// footerLeft: '0',
// footerWidth: '0',
editCarChildRef: 'editChildRef', editCarChildRef: 'editChildRef',
disabled: false, disabled: false,
successDisable: false, successDisable: false,
...@@ -113,6 +239,10 @@ export default { ...@@ -113,6 +239,10 @@ export default {
addOrEdit: '1', addOrEdit: '1',
contractNo: '' contractNo: ''
}, },
defaultBrandForm: {
vehicleBrandId: '',
vehicleSubBrandId: ''
},
editForm: { editForm: {
packageCode: '', packageCode: '',
suggestedSellingPrice: '', suggestedSellingPrice: '',
...@@ -121,12 +251,16 @@ export default { ...@@ -121,12 +251,16 @@ export default {
effectiveDate: new Date(new Date().setDate(new Date().getDate() + 1)), effectiveDate: new Date(new Date().setDate(new Date().getDate() + 1)),
customerType: 1, customerType: 1,
cardType: 1, cardType: 1,
merchantName: '',
merchantPhone: '',
merchantAddress: '',
specialAppoint: '',
vehicle: { vehicle: {
vehicleBrandId: '', vehicleBrandId: '',
vehicleSubBrandId: '', vehicleSubBrandId: '',
vehicleSeriesId: '', vehicleSeriesId: '',
vehicleShapeId: '', vehicleShapeId: '',
licensing: '', // licensing: '',
invoicePrice: '', invoicePrice: '',
seatesNum: 5, seatesNum: 5,
billingDate: new Date() billingDate: new Date()
...@@ -134,35 +268,47 @@ export default { ...@@ -134,35 +268,47 @@ export default {
}, },
// 车辆信息 // 车辆信息
editRuleCar: { editRuleCar: {
licensing: [{ required: true, message: '请选择是否上牌', trigger: 'change' }], licensePlate: [
// licensePlate: [{ required: true, message: '请输入车牌号码', trigger: 'change' }], {
vin: [{ required: true, message: '请输入车架号', trigger: 'change' }], validator: (rule, value, callback) => {
engineNo: [{ required: true, message: '请输入发动机号', trigger: 'change' }], return value ? (/.{7,8}/.test(value) ? callback() : callback(new Error('请输入7位或8位车牌号码'))) : callback()
invoicePrice: [{ required: true, message: '请输入发票价格', trigger: 'change' }], },
trigger: 'change'
}
],
vin: [
{ required: true, message: '请输入车架号', trigger: 'change' },
{
validator: (rule, value, callback) => {
return /^[a-zA-Z0-9]{17}$/.test(value) ? callback() : callback(new Error('请输入17位数字和字母'))
},
trigger: 'change'
}
],
engineNo: [
{ required: true, message: '请输入发动机号', trigger: 'change' },
{
validator: (rule, value, callback) => {
return /^[a-zA-Z0-9]{6,16}$/.test(value) ? callback() : callback(new Error('请输入6-16位数字和字母组合'))
},
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' }], vehicleBrandId: [{ required: true, message: '请选择车品牌', trigger: 'change' }],
vehicleSubBrandId: [{ required: true, message: '请选择车子品牌', trigger: 'change' }], vehicleSubBrandId: [{ required: true, message: '请选择车子品牌', trigger: 'change' }],
vehicleSeriesId: [{ required: true, message: '请选择车系', trigger: 'change' }], vehicleSeriesId: [{ required: true, message: '请选择车系', trigger: 'change' }],
// vehicleShapeId: [{ 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' }]
}, },
editFormDataCar: [ editFormDataCar: [
{ {
label: '是否上牌',
name: 'licensing',
type: 'select',
noFilter: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'licensingList'
},
{
label: '车牌号码', label: '车牌号码',
name: 'licensePlate', name: 'licensePlate',
type: 'input', type: 'input',
maxlength: 32 maxlength: 8
}, },
{ {
label: '车架号', label: '车架号',
...@@ -177,7 +323,7 @@ export default { ...@@ -177,7 +323,7 @@ export default {
maxlength: 16 maxlength: 16
}, },
{ {
label: '发票价格', label: '车辆价格',
name: 'invoicePrice', name: 'invoicePrice',
type: 'input', type: 'input',
append: '元', append: '元',
...@@ -203,16 +349,12 @@ export default { ...@@ -203,16 +349,12 @@ export default {
optionsName: 'seatesNumList' optionsName: 'seatesNumList'
}, },
{ {
label: '开票日期', label: '购车日期',
name: 'billingDate', name: 'billingDate',
type: 'datePicker', type: 'datePicker',
dateType: 'date', dateType: 'date',
valueFormat: 'yyyy-MM-dd', valueFormat: 'yyyy-MM-dd',
pickerOptions: 'beforeRangePickerOptions', pickerOptions: 'beforeRangePickerOptions'
handleDateChange: (value, targetItem) => {
// console.log(value)
// console.log(targetItem)
}
}, },
{ {
label: '品牌车型', label: '品牌车型',
...@@ -243,8 +385,31 @@ export default { ...@@ -243,8 +385,31 @@ export default {
customerType: [{ required: true, message: '请选择客户类型', trigger: 'change' }], customerType: [{ required: true, message: '请选择客户类型', trigger: 'change' }],
customerName: [{ required: true, message: '请输入客户姓名', trigger: 'change' }], customerName: [{ required: true, message: '请输入客户姓名', trigger: 'change' }],
cardType: [{ required: true, message: '请选择证件类型', trigger: 'change' }], cardType: [{ required: true, message: '请选择证件类型', trigger: 'change' }],
cardNo: [{ required: true, message: '请输入身份证', trigger: 'change' }], cardNo: [
customerPhone: [{ required: true, message: '请输入联系号码', trigger: 'change' }], {
required: true,
validator: (rule, value, callback) => {
return value ? callback() : callback(new Error('请输入' + (this.editForm.cardType == '1' ? '身份证' : '统一社会信息代码')))
},
trigger: 'change'
},
{
validator: (rule, value, callback) => {
return /[a-zA-Z0-9]{18}/.test(value) ? callback() : callback(new Error('请输入18位数字或字母'))
},
trigger: 'change'
}
],
customerPhone: [
{ required: true, message: '请输入联系号码', trigger: 'change' },
{
validator: (rule, value, callback) => {
let phoneReg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
return phoneReg.test(value) ? callback() : callback(new Error('请输入正确的联系号码'))
},
trigger: 'change'
}
],
customerAddress: [{ required: true, message: '请输入联系地址', trigger: 'change' }] customerAddress: [{ required: true, message: '请输入联系地址', trigger: 'change' }]
}, },
editFormDataUser: [ editFormDataUser: [
...@@ -267,7 +432,7 @@ export default { ...@@ -267,7 +432,7 @@ export default {
label: '客户姓名', label: '客户姓名',
name: 'customerName', name: 'customerName',
type: 'input', type: 'input',
maxlength: 128 maxlength: 100
}, },
{ {
label: '证件类型', label: '证件类型',
...@@ -296,96 +461,102 @@ export default { ...@@ -296,96 +461,102 @@ export default {
label: '联系地址', label: '联系地址',
name: 'customerAddress', name: 'customerAddress',
type: 'input', type: 'input',
maxlength: 128 maxlength: 55
} }
], ],
// 选择产品 // 选择产品
packageList: [], packageList: [],
editRulePro: {}, editRulePro: {},
editFormPro: {}, editFormPro: {},
editFormDataPro: [ // editFormDataPro: [
{ // {
label: '', // label: '',
name: 'packageCode', // name: 'packageCode',
optionList: [], // optionList: [],
optionId: 'packageCode', // optionId: 'packageCode',
optionLabel: 'packageName', // optionLabel: 'packageName',
addHtml: 'packageCode', // addHtml: 'packageCode',
handleRadioChange: val => { // handleRadioChange: val => {
this.packageAttr() // this.packageAttr()
} // }
} // }
], // ],
curSelectPro: [],
curSelectCustomPro: '',
editProductObj: {},
productList: [],
customProductList: [],
productModal: {
car: {},
crash: {},
stolen: {},
tire: {},
vip: {}
},
// 其他信息 // 其他信息
editRuleOther: { editRuleOther: {
suggestedSellingPrice: [{ required: true, message: '请输入建议销售价', trigger: 'change' }], deviceNo: [{ required: false, message: '请输入设备号', trigger: 'change' }],
actualSalesPrice: [ speAgree: [{ required: false, message: '请输入特别约定', trigger: 'change' }],
{ required: true, message: '请输入实际销售价', trigger: 'change' }, speContent: [{ required: false, message: '请输入约定内容', trigger: 'change' }]
{
validator: (rule, value, callback) => {
return +this.editForm.suggestedSellingPrice > +value ? callback(new Error('输入价格有误')) : callback()
},
trigger: 'change'
}
],
servicePeriod: [{ required: true, message: '请选择服务期限', trigger: 'change' }],
effectiveDate: [{ required: true, message: '请选择生效日期', trigger: 'change' }]
}, },
editFormDataOther: [ editFormDataOther: [
{ {
label: '建议销售价', label: '设备号',
name: 'suggestedSellingPrice', name: 'sn',
type: 'input', type: 'input',
append: '元', maxlength: 100
isDisabled: true,
maxlength: 11
},
{
label: '实际销售价',
name: 'actualSalesPrice',
type: 'input',
append: '元',
maxlength: 11
}, },
{ {
label: '服务期限', label: '特别约定',
name: 'servicePeriod', name: 'specialAppointId',
type: 'select', type: 'select',
noFilter: true, noFilter: false,
optionList: [], optionList: [],
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
optionsName: 'servicePeriodList' optionsName: 'agreeList',
changeAttr: value => {
const spaItem = this.baseData.agreeList.find(item => item.id == value)
this.editForm.specialAppoint = spaItem.spaContent
}
}, },
{ {
label: '生效日期', label: '约定内容',
name: 'effectiveDate', name: 'specialAppoint',
type: 'datePicker', type: 'input',
dateType: 'date', inputType: 'textarea',
valueFormat: 'yyyy-MM-dd', isDisabled: true,
customPickerOptions: { rows: 6
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
if (date < yesterday) {
return true
}
return false
}
}
} }
], ],
// 公共数据 // 店面信息
baseData: { editRuleShop: {
licensingList: [ merchantName: [{ required: true, message: '店面名称', trigger: 'change' }],
merchantPhone: [{ required: true, message: '店面联系号码', trigger: 'change' }],
merchantAddress: [{ required: true, message: '店面联系地址', trigger: 'change' }]
},
editFormDataShop: [
{ {
confId: 0, label: '店面名称',
confName: '否' name: 'merchantName',
type: 'input',
maxlength: 50
}, },
{ {
confId: 1, label: '店面联系号码',
confName: '是' name: 'merchantPhone',
type: 'input',
maxlength: 11
},
{
label: '店面联系地址',
name: 'merchantAddress',
type: 'input',
maxlength: 55
} }
], ],
// 公共数据
baseData: {
seatesNumList: [ seatesNumList: [
{ {
confId: 1, confId: 1,
...@@ -424,6 +595,18 @@ export default { ...@@ -424,6 +595,18 @@ export default {
{ {
confId: 2, confId: 2,
confName: '企业' confName: '企业'
},
{
confId: 3,
confName: '个人(港澳)'
},
{
confId: 4,
confName: '个人(台)'
},
{
confId: 5,
confName: '个人(军官)'
} }
], ],
cardTypeList: [ cardTypeList: [
...@@ -434,55 +617,471 @@ export default { ...@@ -434,55 +617,471 @@ export default {
{ {
confId: 2, confId: 2,
confName: '统一社会信息代码' confName: '统一社会信息代码'
},
{
confId: 3,
confName: '港澳返乡证'
},
{
confId: 4,
confName: '台胞证'
},
{
confId: 5,
confName: '军官证'
} }
], ],
servicePeriodList: [ servicePeriodList: [
{ {
confId: 1, value: '1',
confName: '1年' label: '1年'
},
{
value: '2',
label: '2年'
},
{
value: '3',
label: '3年'
}
],
servicePeriodList2: [
{
value: '1',
label: '1年'
} }
], ],
carBrandOptions: [], carBrandOptions: [],
carChildOptions: [], carChildOptions: [],
carSeriesOptions: [], carSeriesOptions: [],
carTypeOptions: [] carTypeOptions: [],
buyCarTypeList: [
{
value: '0',
label: '贷款车'
},
{
value: '1',
label: '全款车'
}
],
agreeList: []
},
allCarChildList: [],
qrcodUrl: 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/preSale_qrCode.png' + '?time=' + new Date(),
// 权益类型
equityRadio: 1,
// 自选权益产品属性传参数组
tempAttributeList: [],
packageCodeList: [],
formatProduct: {},
// 自定权益
autoAttriButeList: [],
autoPackageCodeList: [],
autoFormatProduct: {},
caseTable: [],
checkCodeList: [],
rightDisable: false,
leftDisable: false,
pickerOptions: {},
pickerOptions2: {},
hotline: '',
compensationNameDisable: false
}
}, },
allCarChildList: []
watch: {
'editForm.vehicle.invoicePrice'(newValue, oldValue) {
this.editForm.vehicle.invoicePrice = limitPrice(newValue, oldValue, 7, 2, 0, 2000000)
},
'editForm.actualSalesPrice'(newValue, oldValue) {
this.editForm.actualSalesPrice = limitPrice(newValue, oldValue, 7, 2)
},
'editFormPro.additional_price'(newValue, oldValue) {
this.editFormPro.additional_price = limitPrice(newValue, oldValue, 6, 2)
} }
// 'editForm.customerName'(newValue,oldValue){
// this.compensationNameDisable = newValue?true:false
// }
}, },
components: { components: {
glsxCombiForm glsxCombiForm,
qrCode
}, },
created() { async created() {
this.getAllVehicleBrand() this.getAllVehicleBrand()
this.getCarChildList() this.getCarChildList(false, true)
this.getSpeAgreeOptions()
this.pickerOptions = this.setDateLimit()
this.pickerOptions2 = this.setDateLimit2()
this.getHotline()
}, },
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 const urlParam = this.$route.params
this.routeInfo = JSON.parse(decodeURIComponent(urlParam.id))
this.disabled = this.routeInfo.addOrEdit == '5' this.disabled = this.routeInfo.addOrEdit == '5'
// 提单成功 - 修改 // 提单成功 - 修改
if (this.routeInfo.isSuper != 'true') {
this.successDisable = this.routeInfo.addOrEdit == '3' 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.disabled && this.setDisabled()
this.successDisable && this.setDisabled(['invoicePrice', 'billingDate', 'packageCode', 'actualSalesPrice', 'servicePeriod', 'effectiveDate']) this.successDisable && this.setDisabled(['invoicePrice', 'billingDate', 'packageCode', 'actualSalesPrice', 'servicePeriod', 'effectiveDate', 'merchantName', 'merchantPhone', 'merchantAddress'])
// this.title = this.titleObj[this.routeInfo.addOrEdit]
// console.log(this.routeInfo, '-------------')
// 获取套餐列表
this.getPackageList()
}, },
methods: { methods: {
// 查找服务热线
getHotline() {
if (this.routeInfo.addOrEdit == 3) {
return
}
this.$apis.beforeSale.getHotlineApi({}).then(res => {
this.hotline = res.serviceHotline
this.getStoreInfo()
})
},
// 设置日期组件时间范围---今天之后
setDateLimit() {
let obj = {
disabledDate(time) {
return time.getTime() == Date.now() || time.getTime() < new Date().getTime()
}
}
return obj
},
// 设置日期组件时间范围---今天之前
setDateLimit2() {
let obj = {
disabledDate(time) {
return time.getTime() > Date.now()
}
}
return obj
},
// 卡号获取期限
getDateList(seqNo, pack, attr) {
this.$apis.beforeSale.dateBycarNo({ seqNo }).then(res => {
this.productModal[pack.idName]['service_period'] = `${res.servicePeriod}`
pack.groupAttributeList.map(el => {
if (el.attributeName == 'service_period') {
this.commonPart(res.servicePeriod, pack, el)
el.disabled = true
return el
}
})
})
},
// 切换套餐---赋默认值
changeCheckBox(e, item) {
if (e) {
this.checkCodeList.push(item.packageCode)
this.packageCodeList.push(item.packageCode)
this.checkCodeList = Array.from(new Set(this.checkCodeList))
this.packageCodeList = Array.from(new Set(this.packageCodeList))
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[item.idName][key], item, attr)
}
})
}
if (item.idName == 'crash') {
const customAttr = {
attributeGroup: 'planId',
attributeName: 'planId'
}
this.commonPart(this.productModal[item.idName]['planId'], item, customAttr)
}
} else {
this.checkCodeList = this.checkCodeList.filter(t => t != item.packageCode)
this.packageCodeList = this.packageCodeList.filter(t => t != item.packageCode)
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[item.idName][key], item, attr)
}
})
}
}
},
changeRaido(e, item) {
if (e) {
this.checkCodeList = []
this.autoPackageCodeList = []
this.checkCodeList.push(item.packageCode)
this.autoPackageCodeList.push(item.packageCode)
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[item.idName][key], item, attr)
}
})
}
const customAttr = {
attributeGroup: 'planId',
attributeName: 'planId'
}
this.commonPart(this.productModal['vip']['planId'], item, customAttr)
}
},
// 获取店铺信息
getStoreInfo() {
const { merchantId } = this.$globalState.session
let para = {
merchantId
}
this.$apis.beforeSale.merchantInfo(para).then(res => {
this.editForm.merchantName = res.merchantName
this.editForm.merchantPhone = this.hotline
this.editForm.merchantAddress = res.merchantAddress
})
},
// 获取mock上面配置的方案
async getCase(caseNum) {
caseNum = caseNum || 1
const { caseList } = await fetchConfig()
this.caseTable = caseList[caseNum - 1]
},
// 自选权益产品套餐处理参数--日期选择框
getCurChangeDate(e, pack, attr) {
let temp = e
if (e) {
temp = dayjs(e).format('YYYY-MM-DD')
}
this.commonPart(temp, pack, attr)
},
// 自选权益产品套餐处理参数--选择框
getCurChangeSelect(e, pack, attr) {
this.commonPart(e, pack, attr)
if (attr.attributeName == 'buy_car_type' && e == 1) {
// 购车类型为全款车--带入客户姓名
const Newattr = {
attributeName: 'compensation_name',
attributeGroup: 'compensation_name'
}
this.compensationNameDisable = this.editForm.customerName ? true : false
this.productModal[pack.idName]['compensation_name'] = this.editForm.customerName
this.commonPart(this.editForm.customerName, pack, Newattr)
return
}
this.compensationNameDisable = false
},
// 自选权益产品套餐处理参数---输入框
getCurChangeInput(e, pack, attr, faIndex, childIndex) {
if (!e) {
return
}
if (attr.attributeName.includes('price')) {
var numReg = /^[0-9]*$/
var numRe = new RegExp(numReg)
if (!numRe.test(e)) {
this.productModal[pack.idName][attr.attributeName] = this.productModal[pack.idName]['last']
return
}
}
if (attr.attributeName == 'card') {
this.productList[faIndex].groupAttributeList.map(el => {
if (el.attributeName == 'service_period') {
el.disabled = true
return el
}
})
this.getDateList(e, pack, attr)
}
this.commonPart(e, pack, attr)
},
// 公共部分
commonPart(e, pack, attr) {
let orgin = this.$common.utils.deepClone(this.productModal[pack.idName])
let temp = {
attributeGroup: attr.attributeGroup,
attributeName: attr.attributeName,
attributeValue: e,
sort: 0,
packageCode: pack.packageCode
}
this.productModal[pack.idName] = {
...temp,
...orgin,
last: e
}
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 {
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)
}
},
// 处理数据结构对比后台所需的参数
handleProductArrParam(arr, codearr) {
let newArr = []
const codeList = Array.from(new Set(codearr))
this.checkCodeList = codeList
let blackArr = []
for (let i = 0; i < codeList.length; i++) {
blackArr.push([])
}
const newParaArr = []
codeList.forEach((item, index) => {
let attrStr = `attributes[${index}].packageCode`
let obj = {
[attrStr]: item
}
newArr.push(obj)
})
for (let i = 0; i < arr.length; i++) {
for (let j = 0; j < codeList.length; j++) {
if (arr[i].packageCode == codeList[j]) {
let obj = {
name: codeList[j],
index: j,
value: {
attributeGroup: arr[i].attributeGroup,
attributeName: arr[i].attributeName,
attributeValue: arr[i].attributeValue,
sort: arr[i].sort
}
}
blackArr[j].push(obj)
}
}
}
for (let i = 0; i < blackArr.length; i++) {
for (let j = 0; j < blackArr[i].length; j++) {
let arrt1 = `attributes[${blackArr[i][j].index}].attributeDTOList[${j}].attributeGroup`
let arrt2 = `attributes[${blackArr[i][j].index}].attributeDTOList[${j}].attributeName`
let arrt3 = `attributes[${blackArr[i][j].index}].attributeDTOList[${j}].attributeValue`
let arrt4 = `attributes[${blackArr[i][j].index}].attributeDTOList[${j}].sort`
let obj = {
[arrt1]: blackArr[i][j].value.attributeGroup,
[arrt2]: blackArr[i][j].value.attributeName,
[arrt3]: this.priceFormat(blackArr[i][j].value.attributeName, blackArr[i][j].value.attributeValue),
[arrt4]: blackArr[i][j].value.sort
}
newParaArr.push(obj)
}
}
let concactArr = newParaArr.concat(newArr)
if (this.equityRadio == 1) {
this.formatProduct = {}
concactArr.forEach(item => {
this.formatProduct = Object.assign(this.formatProduct, item)
})
// console.log(this.formatProduct, '自选权益')
} else {
concactArr.forEach(item => {
this.autoFormatProduct = Object.assign(this.autoFormatProduct, item)
})
// console.log(this.autoFormatProduct, '定制权益')
}
},
// 处理传参价格问题
priceFormat(name, value) {
let result = value
if (name.includes('price')) {
result = parseFloat(value) * 100
}
return result
},
// 获取特别约定列表
getSpeAgreeOptions() {
this.$apis.beforeSale.spaAgressData({}).then(res => {
this.baseData.agreeList = res || []
this.baseData.agreeList.map(item => {
item.confId = item.id
item.confName = item.spaName
return item
})
this.getOptionsList('editFormDataOther', false, 'specialAppointId')
})
},
// 获取产品的数据
toTestProductData(arr) {
arr.forEach(item => {
if (item.packageName.includes('整车全损')) {
item.idName = 'car'
} else if (item.packageName.includes('轮胎')) {
item.idName = 'tire'
} else if (item.packageName.includes('碰撞')) {
item.idName = 'crash'
this.productModal[item.idName]['planId'] = item.planId
this.productModal['vip']['planId'] = item.planId
this.getCase(item.planId)
} else if (item.packageName.includes('盗抢')) {
item.idName = 'stolen'
} else if (item.packageName.includes('尊享版')) {
item.idName = 'vip'
} else if (item.packageName.includes('舒享版')) {
item.idName = 'vip'
} else if (item.packageName.includes('优享版')) {
item.idName = 'vip'
}
item.disabled = false
item.serviceItems = item.serviceItemsList.length ? item.serviceItemsList.map(k => k.serviceName).join(',') : ''
let newArr = []
item.groupAttributeList.map(ele => {
ele.attributeList.map(e => {
if ((item.idName == 'stolen' || item.idName == 'car') && e.attributeDesc == '服务期限') {
e.optionList = this.baseData.servicePeriodList
this.productModal[item.idName][e.attributeName] = '1'
} else if (e.attributeDesc == '购车类型') {
e.optionList = this.baseData.buyCarTypeList
this.productModal[item.idName][e.attributeName] = '0'
} else if ((item.idName == 'tire' || item.idName == 'crash' || item.idName == 'vip') && e.attributeDesc == '服务期限') {
e.optionList = this.baseData.servicePeriodList2
this.productModal[item.idName][e.attributeName] = '1'
e.disabled = true
} else if (e.attributeDesc == '生效日期') {
let nextDay = new Date().getTime() + 24 * 60 * 60 * 1000
this.productModal[item.idName][e.attributeName] = utils.dateFormat(nextDay)
}
ele.tempobj = { ...e }
})
let newAttr = {
...ele.tempobj,
groupName: ele.groupName,
attributeList: ele.attributeList,
num: ele.num
}
newArr.push(newAttr)
})
item.groupAttributeList = newArr
if (item.packageType == 2) {
this.productList.push(item)
} else {
this.customProductList.push(item)
}
})
this.autoGenerate(this.customProductList, this.productList)
},
setDisabled(partDisabledList = []) { setDisabled(partDisabledList = []) {
var list = ['Car', 'User', 'Pro', 'Other'] var list = ['Car', 'User', 'Shop', 'Other']
var flag = true
var errorObjList = []
for (var i = 0; i < list.length; i++) { for (var i = 0; i < list.length; i++) {
this['editFormData' + list[i]].forEach((item, idx) => { this['editFormData' + list[i]].forEach((item, idx) => {
if (!partDisabledList.length) { if (!partDisabledList.length) {
...@@ -495,10 +1094,30 @@ export default { ...@@ -495,10 +1094,30 @@ export default {
}) })
} }
}, },
handleCancelBubble(e) { }, // handleCancelBubble(e) {},
getInfo() { // 获取默认车牌
getDefaultCarbrand() {
this.$apis.beforeSale.getDefaultCarbrandApi({}).then(res => {
// 获取套餐列表
this.getPackageList()
if (res) {
this.defaultBrandForm.vehicleBrandId = res.vehicleBrandId
this.defaultBrandForm.vehicleSubBrandId = res.vehicleSubBrandId
if (this.routeInfo.addOrEdit == '1') {
this.editForm.vehicle.vehicleBrandId = res.vehicleBrandId
this.editForm.vehicle.vehicleSubBrandId = res.vehicleSubBrandId
if (this.editForm.vehicle.vehicleBrandId) {
this.baseData.carChildOptions = this.allCarChildList.find(item => item.id == this.editForm.vehicle.vehicleBrandId).childs
}
if (this.editForm.vehicle.vehicleSubBrandId) {
this.getCarSeriesList(true)
}
}
}
})
},
getInfo(productArrData) {
this.$apis.beforeSale.getEquityApi({ contractNo: this.routeInfo.contractNo }).then(res => { this.$apis.beforeSale.getEquityApi({ contractNo: this.routeInfo.contractNo }).then(res => {
// console.log(res)
this.editForm = { this.editForm = {
...res ...res
} }
...@@ -512,8 +1131,17 @@ export default { ...@@ -512,8 +1131,17 @@ export default {
if (this.editForm.actualSalesPrice) { if (this.editForm.actualSalesPrice) {
this.editForm.actualSalesPrice = (this.editForm.actualSalesPrice / 100).toFixed(2) 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) : ''
// }
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 ([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
}
if (this.editForm.vehicle.vehicleBrandId) { if (this.editForm.vehicle.vehicleBrandId) {
this.getCarChildList(true) this.getCarChildList(true)
} }
...@@ -523,146 +1151,236 @@ export default { ...@@ -523,146 +1151,236 @@ export default {
if (this.editForm.vehicle.vehicleSeriesId) { if (this.editForm.vehicle.vehicleSeriesId) {
this.getCarTypeList(true) this.getCarTypeList(true)
} }
if(this.editForm.customerType) { if (this.editForm.customerType) {
var idx = this.editFormDataUser.findIndex(item => item.name == 'cardNo') var idx = this.editFormDataUser.findIndex(item => item.name == 'cardNo')
this.editFormDataUser[idx].label = this.baseData.cardTypeList.find(item => item.confId == this.editForm.customerType).confName 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.effectiveDate = new Date(new Date().setDate(new Date().getDate() + 1))
} }
this.editForm.packageCode && this.packageAttr(true) this.editForm.packageCode && this.packageAttr(true, productArrData, res)
const spaItem = this.baseData.agreeList.find(item => item.id == this.editForm.specialAppointId)
if(spaItem){
this.editForm.specialAppoint = spaItem.spaContent
}
}) })
}, },
getPackageList() { getPackageList() {
this.$apis.beforeSale.getPackageListApi({}).then(res => { this.$apis.beforeSale.getPackageListApi({}).then(res => {
// console.log(res) this.toTestProductData(res)
this.packageList = res
this.autoGenerate()
}) })
}, },
// 改建议价 // 改建议价,实际销售价
packageToPrice() { packageToPrice() {
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 &&
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)
this.editForm.actualSalesPrice = (item.retailPrice / 100).toFixed(2)
} }
}) })
} }
}, },
packageAttr(recovery = false) { packageAttr(recovery = false, productArrData, detailInfo) {
var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode) var targetItem = productArrData.find(item => item.packageCode == this.editForm.packageCode)
this.packageToPrice() if (targetItem.packageType == 1) {
// console.log(this.editForm) this.equityRadio = 2
var tempObj = this.$common.utils.deepClone(this.editFormPro) this.curSelectCustomPro = targetItem.packageName
this.editRulePro = {} this.editForm.attributeList.forEach(item => {
this.editFormPro = {} if (item.attributeName.includes('price')) {
var attrName = '' item.attributeValue = item.attributeValue / 100
targetItem && targetItem.groupAttributeList.forEach(item => { }
if (item.attributeList.length == 1) { if(item.attributeName=="buy_car_type"&&item.attributeValue==1){
attrName = item.attributeList[0].attributeName this.compensationNameDisable = true
this.$set(this.editFormPro, attrName, tempObj.hasOwnProperty(attrName) ? tempObj[attrName] : '') }
if (item.attributeList[0].required == 1) { this.productModal.vip[item.attributeName] = item.attributeValue
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 (this.routeInfo.addOrEdit == 3) {
this.leftDisable = true
this.customProductList.map(item => {
item.disabled = true
item.groupAttributeList.map(ele => {
if (ele.attributeName == 'service_period') {
ele.disabled = true
} }
if (ele.attributeName == 'card') {
ele.disabled = true
} }
}) if (ele.attributeName == 'effective_date') {
if (recovery) { ele.disabled = true
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) return item
},
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 { } else {
// console.log(k) this.equityRadio = 1
var tableList = [] this.curSelectPro = [targetItem.packageName]
for (var i = 0; i < k.num; i++) { this.editForm.attributeList.forEach(item => {
tableList[i] = [] if (item.attributeName.includes('price')) {
k.attributeList.forEach((j, index) => { item.attributeValue = item.attributeValue / 100
tableList[i].push({ } else if (item.attributeName == 'planId') {
groupName: j.groupName, this.getCase(parseInt(item.attributeValue))
attributeDesc: j.attributeDesc, }
attributeName: j.attributeName, if(item.attributeName=="buy_car_type"&&item.attributeValue==1){
name: j.attributeName + i, this.compensationNameDisable = true
sort: i, }
attributeGroup: j.attributeGroup, this.productModal[targetItem.idName][item.attributeName] = item.attributeValue
maxlength: j.maxLength,
required: j.required,
attributeType: j.attributeType,
isDisabled: this.disabled || this.successDisable
})
}) })
if (this.routeInfo.addOrEdit == 3) {
this.rightDisable = true
this.productList.map(item => {
item.disabled = true
item.groupAttributeList.map(ele => {
if (ele.attributeName == 'service_period') {
ele.disabled = true
} }
tempList.push({ if (ele.attributeName == 'card') {
label: '', ele.disabled = true
name: '', }
addHtml: 'table', if (ele.attributeName == 'effective_date') {
attributeList: k.attributeList, ele.disabled = true
tableList: tableList }
if (ele.attributeName == 'buy_car_type'&&ele.attributeValue==1) {
ele.disabled = true
}
})
return item
}) })
} }
}
// this.packageToPrice()
// var tempObj = this.$common.utils.deepClone(this.editFormPro)
let attrList = []
detailInfo.attributeList.forEach(item => {
attrList.push({
...item,
packageCode: detailInfo.packageCode
}) })
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)
}) })
if (this.equityRadio == 1) {
this.tempAttributeList = attrList
this.packageCodeList = [detailInfo.packageCode]
} else {
this.autoAttriButeList = attrList
this.autoPackageCodeList = [detailInfo.packageCode]
}
this.checkCodeList = [detailInfo.packageCode]
this.handleProductArrParam(attrList, [detailInfo.packageCode])
// 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 &&
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.editFormDataPro) },
this.routeInfo.addOrEdit != '1' ? this.getInfo() : '' autoGenerate(arr1, arr2) {
const tempList = arr1.concat(arr2)
if (this.reset) {
return
}
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) { getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle) var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(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])) 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 = {} const temp = {}
temp[this[formName][index].optionId] = '' temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部' temp[this[formName][index].optionLabel] = '全部'
...@@ -670,6 +1388,7 @@ export default { ...@@ -670,6 +1388,7 @@ export default {
} }
} else { } else {
this[formName].forEach((item, index) => { this[formName].forEach((item, index) => {
if (item.optionsName) {
if (item.type === 'select' && this.baseData[item.optionsName].length) { if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName])) 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].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
...@@ -679,6 +1398,7 @@ export default { ...@@ -679,6 +1398,7 @@ export default {
this[formName][index].optionList.unshift(temp) this[formName][index].optionList.unshift(temp)
} }
} }
}
}) })
} }
}, },
...@@ -698,12 +1418,13 @@ export default { ...@@ -698,12 +1418,13 @@ export default {
this.baseData.carTypeOptions = [] this.baseData.carTypeOptions = []
}, },
// 获取子品牌 // 获取子品牌
getCarChildList(isRecovery = false) { getCarChildList(isRecovery = false, isDefault = false) {
this.$apis.beforeSale.getCarChildListApi({}).then(res => { this.$apis.beforeSale.getCarChildListApi({}).then(res => {
this.allCarChildList = res || [] this.allCarChildList = res || []
if (isRecovery) { if (isRecovery) {
this.baseData.carChildOptions = this.allCarChildList.find(item => item.id == this.editForm.vehicle.vehicleBrandId).childs this.baseData.carChildOptions = this.allCarChildList.find(item => item.id == this.editForm.vehicle.vehicleBrandId).childs
} }
isDefault && this.getDefaultCarbrand()
}) })
}, },
// 获取车系 // 获取车系
...@@ -764,14 +1485,19 @@ export default { ...@@ -764,14 +1485,19 @@ export default {
if (this.editForm.vehicle.vehicleShapeId) { if (this.editForm.vehicle.vehicleShapeId) {
params.vehicle.vehicleShapeName = this.baseData.carTypeOptions.find(item => item.id == this.editForm.vehicle.vehicleShapeId).name params.vehicle.vehicleShapeName = this.baseData.carTypeOptions.find(item => item.id == this.editForm.vehicle.vehicleShapeId).name
} }
if (this.editForm.vehicle.billingDate) {
params.vehicle.billingDate = dayjs(this.editForm.vehicle.billingDate).format('YYYY-MM-DD')
}
if (this.editForm.effectiveDate) {
params.effectiveDate = dayjs(this.editForm.effectiveDate).format('YYYY-MM-DD')
}
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)
params.attributeList = [] params.attributeList = []
if (targetItem) { if (targetItem) {
targetItem.groupAttributeList.forEach(item => { targetItem.groupAttributeList.forEach(item => {
if (item.attributeList.length == 1) { if (item.attributeList.length == 1) {
params.attributeList.push({ params.attributeList.push({
attributeValue: this.editFormPro[item.attributeList[0].attributeGroup], attributeValue: item.attributeList[0].attributeGroup == 'additional_price' ? (this.editFormPro[item.attributeList[0].attributeGroup] ? (this.editFormPro[item.attributeList[0].attributeGroup] * 100).toFixed(0) : '') : this.editFormPro[item.attributeList[0].attributeGroup],
attributeGroup: item.attributeList[0].attributeGroup, attributeGroup: item.attributeList[0].attributeGroup,
attributeName: item.attributeList[0].attributeName, attributeName: item.attributeList[0].attributeName,
sort: 0 sort: 0
...@@ -791,63 +1517,95 @@ export default { ...@@ -791,63 +1517,95 @@ export default {
} }
}) })
} }
// console.log(params)
return params return params
}, },
// 草稿
handleDraft() { handleDraft() {
const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct
if (this.submit) { if (this.submit) {
return true return true
} }
if (!this.editForm.customerName) {
this.$refs.editFormRefUser.$refs.editChildRefUser.validateField('customerName')
this.whereToGo('customerName')
return true
}
this.submit = true this.submit = true
var params = this.getParams() var params = this.getParams()
params.operationType = 0 params.operationType = 0
if (this.routeInfo.addOrEdit == '2') { if (this.routeInfo.addOrEdit == '2') {
params.contractNo = this.routeInfo.contractNo params.contractNo = this.routeInfo.contractNo
this.updateEquity(params)
} else { } else {
this.$apis.beforeSale.createCodeApi({}).then(res => { params.contractNo = ''
// console.log(res) }
params.contractNo = res if (!params.attributes) {
this.submit = false params.attributes = []
this.updateEquity(params)
}).catch(err => {
this.submit = false
})
} }
params = Object.assign(params, vaidObj)
this.updateEquity(params)
}, },
updateEquity(params) { updateEquity(params) {
if (!params.sn) {
delete params.sn
}
this.$apis.beforeSale.updateEquityApi(params).then(res => { this.$apis.beforeSale.updateEquityApi(params).then(res => {
this.submit = false this.submit = false
if (res.code == '0') {
if (res.errId == 'A1307') {
this.whereToGo('vin')
this.$message({ this.$message({
message: res.data.code ? '操作成功' : res.data.msg, message: res.message,
type: res.data.code ? 'success' : 'error' type: 'error'
}) })
if (res.data.code) {
this.handleCancel()
} else { } else {
this.whereToGo('licensing') if (res.code != 0) {
}
} else {
this.whereToGo('licensing')
this.$message({ this.$message({
message: res.message, message: res.message,
type: 'error' type: 'error'
}) })
return
}
this.$router.push({
path: '/beforeSale/checkSet',
// name: 'beforeSale',
params: res
})
} }
}) })
}, },
vaidProduct() {
const vaidArr = this.equityRadio == 1 ? this.productList : this.customProductList
for (let i = 0; i < vaidArr.length; i++) {
for (let j = 0; j < vaidArr[i].groupAttributeList.length; j++) {
if (vaidArr[i].groupAttributeList[j].required == 1) {
let packcode = vaidArr[i].packageCode
if (!this.productModal[vaidArr[i].idName][vaidArr[i].groupAttributeList[j].attributeName] && this.checkCodeList.includes(packcode)) {
let str = `请填写${vaidArr[i].packageName}的${vaidArr[i].groupAttributeList[j].attributeDesc}`
this.$message({ message: str, type: 'error' })
this.submit = false
return true
}
}
}
}
},
handleConfirm() { handleConfirm() {
const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct
const isEmptyObj = JSON.stringify(vaidObj) == '{}'
if (isEmptyObj) {
this.$message({ message: '请选择产品信息', type: 'error' })
return
}
if (this.submit) { if (this.submit) {
return true return true
} }
this.submit = true this.submit = true
var list = ['Car', 'User', 'Pro', 'Other'] var list = ['Car', 'Brand', 'User', 'Shop', 'Other']
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]]) { if (this.$refs['editFormRef' + list[i]]) {
var pRef = list[i] == 'Pro' ? this.$refs['editFormRef' + list[i]][0] : this.$refs['editFormRef' + list[i]] var pRef = 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)
...@@ -860,23 +1618,42 @@ export default { ...@@ -860,23 +1618,42 @@ export default {
return true return true
} }
var params = this.getParams() var params = this.getParams()
// if ([2, 3].includes(this.routeInfo.addOrEdit)) {
// params.contractNo = this.routeInfo.contractNo
// }
params.operationType = 1 params.operationType = 1
if (['2', '3'].includes(this.routeInfo.addOrEdit)) { 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 params.contractNo = this.routeInfo.contractNo
}
} else {
params.contractNo = ''
}
const productflag = this.vaidProduct()
if (productflag) {
return
}
params = {
...params,
...vaidObj
}
this.$apis.beforeSale.checkOrderApi({ vin: this.editForm.vehicle.vin, contractNo: this.routeInfo.contractNo || '' }).then(res => {
if (res.code == '0') {
this.updateEquity(params) this.updateEquity(params)
} else { } else {
this.$apis.beforeSale.createCodeApi({}).then(res => {
// console.log(res)
params.contractNo = res
this.submit = false this.submit = false
this.$confirm(res.message, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.submit = true
this.updateEquity(params) this.updateEquity(params)
}).catch(err => { }
this.submit = false }
}) })
} }
})
}, },
handleReset() { handleReset() {
this.editForm = { this.editForm = {
...@@ -884,69 +1661,83 @@ export default { ...@@ -884,69 +1661,83 @@ export default {
suggestedSellingPrice: '', suggestedSellingPrice: '',
actualSalesPrice: '', actualSalesPrice: '',
servicePeriod: 1, servicePeriod: 1,
effectiveDate: new Date(new Date().setDate(new Date().getDate() + 1)),
customerType: 1,
cardType: 1,
merchantName: '',
merchantPhone: '',
merchantAddress: '',
specialAppoint: '',
vehicle: { vehicle: {
vehicleBrandId: '', vehicleBrandId: '',
vehicleSubBrandId: '', vehicleSubBrandId: '',
vehicleSeriesId: '', vehicleSeriesId: '',
vehicleShapeId: '', vehicleShapeId: '',
licensing: '', // licensing: '',
invoicePrice: '', invoicePrice: '',
seatesNum: 5, seatesNum: 5,
billingDate: new Date() billingDate: new Date()
} }
} }
this.formatProduct = {}
this.autoFormatProduct = {}
this.equityRadio = 1
this.curSelectPro = []
this.curSelectCustomPro = ''
this.productModal = {
car: {},
crash: {},
stolen: {},
tire: {},
vip: {}
}
this.customProductList = []
this.productList = []
this.getPackageList()
this.reset = true
this.getHotline()
this.$apis.beforeSale.getDefaultCarbrandApi({}).then(res => {
if (res) {
this.defaultBrandForm.vehicleBrandId = res.vehicleBrandId
this.defaultBrandForm.vehicleSubBrandId = res.vehicleSubBrandId
// if(this.routeInfo.addOrEdit == '1') {
this.editForm.vehicle.vehicleBrandId = res.vehicleBrandId
this.editForm.vehicle.vehicleSubBrandId = res.vehicleSubBrandId
if (this.editForm.vehicle.vehicleBrandId) {
this.baseData.carChildOptions = this.allCarChildList.find(item => item.id == this.editForm.vehicle.vehicleBrandId).childs
}
if (this.editForm.vehicle.vehicleSubBrandId) {
this.getCarSeriesList(true)
}
}
// }
})
}, },
handleCancel() { handleCancel() {
if (this.submit) { // if (this.submit) {
return true // return true
} // }
this.$router.push({ this.$router.push({
path: '/beforeSale/index' path: '/beforeSale/checkSet'
}) })
} }
} }
} }
</script> </script>
<style> <style lang="scss" scoped>
/* 客服 - start */ .edit-equity {
.before-sale .help-service { margin-top: 17px;
position: fixed;
z-index: 9999;
font-size: 14px;
color: #333333;
top: 10%;
right: 10px;
width: 144px;
height: 268px;
text-align: center;
background: #FFFFFF;
border: 1px solid rgb(220, 223, 230, 0.5);
box-shadow: 0px 3px 6px -4px rgba(0,0,0,0.12);
}
.help-service .service-img {
width: 124px;
height: 124px;
margin: 16px 0;
}
.help-service p {
margin: 0;
}
.help-service .service-hotline {
margin: 16px 0 5px;
font-size: 16px;
font-weight: bold;
} }
.help-service .service-phone {
color: #5850FF;
}
/* 客服 - end */
.before-sale .container { .before-sale .container {
background: #ffffff; background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1); box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
margin-bottom: 20px;
} }
.container /deep/ .el-radio__label {
font-weight: 600;
}
.container /deep/ .el-checkbox__label {
font-weight: 600;
}
.before-sale .edit-container { .before-sale .edit-container {
margin-bottom: 84px; margin-bottom: 84px;
} }
...@@ -964,7 +1755,7 @@ export default { ...@@ -964,7 +1755,7 @@ export default {
bottom: 0; */ bottom: 0; */
width: 100%; width: 100%;
height: 64px; height: 64px;
/* left: 220px; */ /* left: 320px; */
text-align: center; text-align: center;
line-height: 64px; line-height: 64px;
background: #ffffff; background: #ffffff;
...@@ -982,13 +1773,119 @@ export default { ...@@ -982,13 +1773,119 @@ export default {
.before-sale .edit-title { .before-sale .edit-title {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: 600;
height: 48px; padding: 15px 20px;
line-height: 48px; // height: 48px;
// line-height: 48px;
border-bottom: 1px solid #e7eaec; border-bottom: 1px solid #e7eaec;
margin: 0 0; margin: 0 0;
} }
.edit_product_radio_wrap {
padding: 32px 0 0 73px;
}
.auto_widget {
padding: 0 0 32px 0px;
.product_wrapper {
margin-top: 16px;
.product_intro {
margin-top: 5px;
margin-left: 24px;
}
.child_wrap {
padding: 16px 0 0 0px;
display: flex;
flex-wrap: wrap;
.child_wrap_pannel {
position: relative;
.err_message {
position: absolute;
left: 160px;
bottom: 14px;
font-size: 12px;
color: #f56c6c;
}
}
.attr_wrapper {
margin-bottom: 28px;
margin-right: 30px;
.attr_label {
width: 160px;
white-space: nowrap;
text-align: right;
box-sizing: border-box;
padding-right: 12px;
}
.arrt_pannel {
width: 320px;
}
}
}
.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 { .before-sale .edit-sub-title {
position: relative; position: relative;
font-size: 13px; font-size: 13px;
...@@ -1025,6 +1922,11 @@ export default { ...@@ -1025,6 +1922,11 @@ export default {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
} }
.before-sale .package-code .package-subtitle {
white-space: normal;
line-height: 20px;
padding-left: 20px;
}
.before-sale .package-code-box ::v-deep .el-radio__label { .before-sale .package-code-box ::v-deep .el-radio__label {
width: 100% !important; width: 100% !important;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -1082,4 +1984,44 @@ export default { ...@@ -1082,4 +1984,44 @@ export default {
cursor: pointer; cursor: pointer;
} }
/* 表格 */ /* 表格 */
.m-t-10 {
margin-top: 10px;
}
.m-r-10 {
margin-right: 10px;
}
.fixed_bottom {
position: fixed;
width: 100%;
bottom: 0px;
height: 82px;
// display: flex;
// align-items: center;
// justify-content: center;
background: #ffffff;
z-index: 999;
// box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
.ma_top {
height: 4px;
background: #f4f5fa;
}
.ma_bot {
box-sizing: border-box;
padding: 0 20px 0 40px;
height: 78px;
.custom_black {
background: #ffffff;
color: #333333;
border: 1px solid #333333;
}
.custom_blue {
background: #ffffff;
color: #5850ff;
border: 1px solid #5850ff;
}
.mar-10 {
width: 20px;
}
}
}
</style> </style>
<!-- 权益订单列表 --> <!-- 权益订单列表 -->
<template> <template>
<div class="before-sale"> <div class="before-sale">
<div class="m-b-20"> <div class="flex m-b-10">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新增权益</el-button> <!-- <el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新增权益</el-button> -->
<GLButton :size="size" fn="新增权益" icon="el-icon-plus" type="primary" @click="handleEdit(1)">新增权益</GLButton>
<!-- <div class="table-top-tips"><span class="el-icon-warning"></span>请注意:订单列表还有{{countNoData}}单未上传客户凭证等资料,若发生事故无法获得补偿,请尽快在列表操作-上传资料中完善。</div> -->
</div> </div>
<div class="container"> <div class="container">
<div> <div class="find_wrap">
<glsx-combi-form ref="showSearch" labelWidth="110px" :formObj="searchForm" :formData="searchFormData"> <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"> <span slot="footer" class="footer-btns">
<el-button :size="size" @click="handleReset">重置</el-button> <el-button :size="size" class="resetBtn" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button> <el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleExport">导出</el-button> <el-button :size="size" @click="handleExport">导出</el-button>
</span> </span>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<div class="table-top-tips">请注意:订单列表还有{{countNoData}}单未上传客户凭证等资料,若发生事故无法获得补偿,请尽快在列表操作-上传资料中完善。</div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="equityRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table_wrapper">
<el-button v-if="[2, 4, 5].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(5, scope.scope)">查看</el-button> <GLTable ref="equityRef" :pageSizes="sizeList" :paginationattrs="paginationattrs" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="table-btns" slot-scope="scope">
<GLButton v-if="[2, 4, 5].includes(scope.scope.orderStatus)" fn="查看" type="text" @click="handleEdit(5, scope.scope)">查看</GLButton>
<!-- <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)" style="position: relative;" type="text" @click="handleUpload(scope.scope)">上传资料<span v-show="scope.scope.dataPerfection == 0" class="circule-tips"></span></el-button> <GLButton v-if="[0].includes(scope.scope.orderStatus)" fn="编辑" type="text" @click="handleEdit(2, scope.scope)">编辑</GLButton>
<el-button v-if="[0].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(2, scope.scope)">编辑</el-button> <GLButton v-if="[2].includes(scope.scope.orderStatus)" fn="修改" type="text" @click="handleEdit(3, scope.scope)">修改</GLButton>
<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="handleBack(scope.scope)">退单</el-button>
<el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleBack(scope.scope)">退保</el-button> <GLButton v-if="[3, 4, 5].includes(scope.scope.orderStatus)" fn="重新提单" type="text" @click="handleEdit(4, scope.scope)">重新提单</GLButton>
<el-button v-if="[3, 4, 5].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(4, scope.scope)">重新提单</el-button>
</div> </div>
</GLTable> </GLTable>
</div>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
<pdf-dialog :isVisible="isPdfVisible" title="合同" :pdfUrl="pdfUrl" @closeDialog="handlePdfClose"></pdf-dialog> <pdf-dialog :isVisible="isPdfVisible" title="合同" :pdfUrl="pdfUrl" @closeDialog="handlePdfClose"></pdf-dialog>
<glsx-dialog title="上传资料" :isVisible.sync="isFileVisible" width="70%" noCancel="true" btnOkLabel="关闭" @confirmDialog="handleUploadFileClose" @closeDialog="handleUploadFileClose"> <!-- <glsx-dialog title="上传资料" :isVisible.sync="isFileVisible" width="547px" :noCancel="noCancel" btnOkLabel="关闭" @confirmDialog="handleUploadFileClose" @closeDialog="handleUploadFileClose">
<glsx-combi-form labelWidth="300px" isBlock="true" ref="uploadFormRef" formRef="uploadChildRef" :formRules="uploadRule" :formObj.sync="uploadForm" :formData="uploadFormData"></glsx-combi-form> <div style="height: 284px; overflow-y: scroll">
</glsx-dialog> <glsx-combi-form labelWidth="300px" :isBlock="isBlock" ref="uploadFormRef" formRef="uploadChildRef" :formRules="uploadRule" :formObj.sync="uploadForm" :formData="uploadFormData"></glsx-combi-form>
</div>
</glsx-dialog> -->
<el-dialog :visible.sync="isTipVisible" width="400px" class="tips-dialog" top="30%" title="提示">
<div class="f-size">
<i v-show="editNotify.code == '0'" class="el-icon-success"></i>
<i v-show="editNotify.code != '0'" class="el-icon-error"></i>
<span>{{ editNotify.code == '0' ? '操作成功' : editNotify.message }}</span>
</div>
</el-dialog>
<el-dialog :visible.sync="isSecondVisible" width="400px" class="tips-dialog" top="30%" :title="secondObj.title">
<div class="f-size">
<i class="el-icon-warning"></i>
<span>{{ secondObj.txt }}</span>
</div>
<span slot="footer" class="dialog-footer">
<el-button :size="size" @click="handleSecondCancel">取 消</el-button>
<el-button :size="size" type="primary" @click="handleSecondConfirm">确 定</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
...@@ -42,11 +65,27 @@ import * as dayjs from 'dayjs' ...@@ -42,11 +65,27 @@ import * as dayjs from 'dayjs'
import glsxCombiForm from '@/components/glsx-combi-form' import glsxCombiForm from '@/components/glsx-combi-form'
import glsxDialog from '@/components/glsx-dialog' import glsxDialog from '@/components/glsx-dialog'
import pdfDialog from './pdfDialog' import pdfDialog from './pdfDialog'
import utils from '../../util/util'
export default { export default {
name: 'equityList', name: 'equityList',
data() { data() {
return { return {
// :page-size="100"
paginationattrs:{
'page-size':5
},
size: 'small', size: 'small',
noCancel: true,
isBlock: true,
isTipVisible: false,
isFirst: true,
showClose: false,
editNotify: {},
isSecondVisible: false,
secondObj: {
title: '',
txt: ''
},
userInfo: {}, userInfo: {},
countNoData: '', countNoData: '',
levelToShow: { levelToShow: {
...@@ -60,6 +99,11 @@ export default { ...@@ -60,6 +99,11 @@ export default {
orderStatus: '', orderStatus: '',
packageCode: '', packageCode: '',
merchantId: '', merchantId: '',
dqtId: '',
pqId: '',
mdId: '',
auditStatus: '',
dataPerfection: '',
successDate: [], successDate: [],
effectiveDate: [] effectiveDate: []
}, },
...@@ -74,13 +118,36 @@ export default { ...@@ -74,13 +118,36 @@ export default {
uploadForm: {}, uploadForm: {},
uploadFormData: [], uploadFormData: [],
// 搜索 // 搜索
searchSelectObj: {
nameOrNoOrVin: {
attr: 'customerName',
value: ''
}
},
searchFormData: [ searchFormData: [
{ {
label: '搜索内容', type: 'selectInput',
name: 'queryText', selectName: 'nameOrNoOrVin',
type: 'input', isClear: true,
placeholder: '输入车主、合同号、车架号', inputWidth: '325px',
maxlength: 100 selectWidth: '110px',
selectOption: [
{
label: '车主姓名',
name: 'customerName'
},
{
label: '合同号',
name: 'contractNo'
},
{
label: '车架号',
name: 'vin'
}
],
handleSelectChange: value => {
this.searchSelectObj.nameOrNoOrVin.value = ''
}
}, },
{ {
label: '服务状态', label: '服务状态',
...@@ -99,11 +166,14 @@ export default { ...@@ -99,11 +166,14 @@ export default {
optionId: 'packageCode', optionId: 'packageCode',
optionLabel: 'packageName', optionLabel: 'packageName',
optionsName: 'goodsStatusList' optionsName: 'goodsStatusList'
}, }
],
searchFormData2: [
{ {
label: '提单成功时间', label: '提单成功时间',
name: 'successDate', name: 'successDate',
type: 'datePicker', type: 'datePicker',
labelWidth: 95,
isClear: true, isClear: true,
pickerOptions: 'beforeRangePickerOptions' pickerOptions: 'beforeRangePickerOptions'
}, },
...@@ -111,65 +181,20 @@ export default { ...@@ -111,65 +181,20 @@ export default {
label: '生效时间', label: '生效时间',
name: 'effectiveDate', name: 'effectiveDate',
type: 'datePicker', type: 'datePicker',
isClear: true, isClear: true
pickerOptions: 'afterRangePickerOptions'
},
{
label: '总部',
name: 'merchantId',
type: 'select',
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'merchantList',
isHide: true,
changeAttr: val => {
// console.log(val)
var idx = this.searchFormData.findIndex(item => item.name == this.levelToShow['2'])
this.searchFormData[idx].isHide = false
this.getMerchantList(val, 2, this.searchFormData[idx].name, this.searchFormData[idx].optionsName)
}
},
{
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
} }
], ],
// 表格 // 表格
getListApi: this.$apis.beforeSale.getListApi, getListApi: this.$apis.beforeSale.getListApi,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: true, tableOption: false,
tableColumns: [ tableColumns: [
{ {
label: '车主姓名', label: '车主姓名',
prop: 'customerName', prop: 'customerName',
line: 1,
width: '200px',
formatter: cellValue => { formatter: cellValue => {
return cellValue.customerName || '-' return cellValue.customerName || '-'
} }
...@@ -179,36 +204,37 @@ export default { ...@@ -179,36 +204,37 @@ export default {
prop: 'contractNo', prop: 'contractNo',
width: '200px', width: '200px',
formatter: cellValue => { formatter: cellValue => {
return [2, 4, 5].includes(cellValue.orderStatus) ? (cellValue.contractNo || '-') : '-' return [2, 4, 5].includes(cellValue.orderStatus) ? cellValue.contractNo || '-' : '-'
} }
}, },
{ {
label: '提单成功时间', label: '提单成功时间',
width: '200px',
prop: 'successDate', prop: 'successDate',
width: '160px',
formatter: cellValue => { formatter: cellValue => {
return cellValue.successDate ? dayjs(cellValue.successDate).format('YYYY-MM-DD HH:mm:ss') : '-' return cellValue.successDate ? dayjs(cellValue.successDate).format('YYYY-MM-DD HH:mm:ss') : '-'
} }
}, },
{ {
label: '新车开票日期', label: '购车日期',
prop: 'billingDate', prop: 'billingDate',
width: '160px', width: '200px',
formatter: cellValue => { formatter: cellValue => {
return cellValue.billingDate ? dayjs(cellValue.billingDate).format('YYYY-MM-DD HH:mm:ss') : '-' return cellValue.billingDate ? dayjs(cellValue.billingDate).format('YYYY-MM-DD') : '-'
} }
}, },
{ {
label: '店面名称', label: '店面名称',
line: 1,
prop: 'merchantName', prop: 'merchantName',
width: '160px', width: '160px',
line: 2,
formatter: cellValue => { formatter: cellValue => {
return cellValue.merchantName || '-' return cellValue.merchantName || '-'
} }
}, },
{ {
label: '车品牌', label: '车品牌',
line: 1,
prop: 'vehicleBrandName', prop: 'vehicleBrandName',
width: '160px', width: '160px',
formatter: cellValue => { formatter: cellValue => {
...@@ -217,14 +243,25 @@ export default { ...@@ -217,14 +243,25 @@ export default {
}, },
{ {
label: '车系', label: '车系',
line: 1,
width: '160px',
prop: 'vehicleSeriesName', prop: 'vehicleSeriesName',
formatter: cellValue => { formatter: cellValue => {
return cellValue.vehicleSeriesName || '-' return cellValue.vehicleSeriesName || '-'
} }
}, },
{ {
label: '车架', label: '无忧卡卡号',
prop: 'cardSeqNo',
width: '200px',
formatter: cellValue => {
return cellValue.cardSeqNo || '-'
}
},
{
label: '车架号',
prop: 'vin', prop: 'vin',
width: '200px',
formatter: cellValue => { formatter: cellValue => {
return cellValue.vin || '-' return cellValue.vin || '-'
} }
...@@ -240,50 +277,102 @@ export default { ...@@ -240,50 +277,102 @@ export default {
{ {
label: '产品名称', label: '产品名称',
prop: 'packageName', prop: 'packageName',
width: '200px',
formatter: cellValue => { formatter: cellValue => {
return cellValue.packageName || '-' return cellValue.packageName || '-'
} }
}, },
{ {
label: '实际销售价', label: '无忧保障服务费',
prop: 'actualSalesPrice', prop: 'actualSalesPrice',
width: '160px', width: '200px',
formatter: cellValue => { formatter: cellValue => {
return cellValue.actualSalesPrice ? (cellValue.actualSalesPrice / 100).toFixed(2) : '-' return cellValue.actualSalesPrice ? (cellValue.actualSalesPrice / 100).toFixed(2) : '-'
} }
}, },
// {
// label: '实际销售价',
// prop: 'actualSalesPrice',
// width: '160px',
// line: 1,
// formatter: cellValue => {
// return cellValue.actualSalesPrice ? (cellValue.actualSalesPrice / 100).toFixed(2) : '-'
// }
// },
{ {
label: '服务期限', label: '服务期限',
width: '200px',
prop: 'servicePeriod', prop: 'servicePeriod',
formatter: cellValue => { formatter: cellValue => {
return cellValue.servicePeriod ? '1年' : '-' return cellValue.servicePeriod ? `${cellValue.servicePeriod}年` : '-'
} }
}, },
{ {
label: '生效时间', label: '生效时间',
prop: 'effectiveDate', prop: 'effectiveDate',
width: '160px', width: '200px',
formatter: cellValue => { formatter: cellValue => {
return cellValue.effectiveDate ? dayjs(cellValue.effectiveDate).format('YYYY-MM-DD HH:mm:ss') : '-' return cellValue.effectiveDate ? dayjs(cellValue.effectiveDate).format('YYYY-MM-DD') : '-'
} }
}, },
{ {
label: '状态', label: '服务状态',
prop: 'orderStatus', prop: 'orderStatus',
width: '100px', width: '100px',
formatter: cellValue => { formatter: cellValue => {
return this.baseData.orderStatusList.map(item => item.confId).includes(cellValue.orderStatus) ? this.baseData.orderStatusList.find(item => item.confId == cellValue.orderStatus).confName : '-' return this.baseData.orderStatusList.map(item => item.confId).includes(cellValue.orderStatus) ? this.baseData.orderStatusList.find(item => item.confId == cellValue.orderStatus).confName : '-'
} }
}, },
{ // {
label: '大区', // label: '审核状态',
// prop: 'auditStatus',
// width: '100px',
// line: 1,
// formatter: cellValue => {
// var auditStatusTxt = '-'
// if ([2, 4, 5].includes(cellValue.orderStatus)) {
// auditStatusTxt = this.baseData.auditStatusList.map(item => item.confId).includes(cellValue.auditStatus) ? this.baseData.auditStatusList.find(item => item.confId == cellValue.auditStatus).confName : '-'
// }
// return auditStatusTxt
// }
// },
// {
// label: '审核人',
// prop: 'auditBy',
// width: '140px',
// line: 1,
// formatter: cellValue => {
// return cellValue.auditBy || '-'
// }
// },
// {
// label: '门店编码',
// prop: 'sap',
// line: 1,
// formatter: cellValue => {
// return cellValue.sap || '-'
// }
// },
// {
// label: '实际销售人员',
// prop: 'actualSalesPerson',
// width: '160',
// line: 1,
// formatter: cellValue => {
// return cellValue.actualSalesPerson || '-'
// }
// },
{
label: '省代',
prop: 'provinceMerchantName', prop: 'provinceMerchantName',
width: '200px',
formatter: cellValue => { formatter: cellValue => {
return cellValue.provinceMerchantName || '-' return cellValue.provinceMerchantName || '-'
} }
}, },
{ {
label: '片区', label: '市代',
width: '200px',
prop: 'cityMerchantName', prop: 'cityMerchantName',
formatter: cellValue => { formatter: cellValue => {
return cellValue.cityMerchantName || '-' return cellValue.cityMerchantName || '-'
...@@ -291,14 +380,23 @@ export default { ...@@ -291,14 +380,23 @@ export default {
}, },
{ {
label: '操作人', label: '操作人',
line: 1,
prop: 'updatedBy', prop: 'updatedBy',
width: '140px', width: '140px',
formatter: cellValue => { formatter: cellValue => {
return cellValue.updatedBy || '-' return cellValue.updatedBy || '-'
} }
},
{
label: '操作',
prop: '',
width: '200px',
fixed: 'right',
addHtml: 'table-btns'
} }
] ]
}, },
sizeList:[5,10,20,30,40],
pageConf: { pageSize: 'pageCount', pageNum: 'pageSize', totalCount: 'total' }, pageConf: { pageSize: 'pageCount', pageNum: 'pageSize', totalCount: 'total' },
// 公共数据 // 公共数据
baseData: { baseData: {
...@@ -328,6 +426,26 @@ export default { ...@@ -328,6 +426,26 @@ export default {
confId: 5, confId: 5,
confName: '已过期' confName: '已过期'
} }
],
dataPerfectionList: [
{
confId: 1,
confName: '已完成'
},
{
confId: 0,
confName: '未完成'
}
],
auditStatusList: [
{
confId: 0,
confName: '待审核'
},
{
confId: 1,
confName: '已审核'
}
] ]
} }
} }
...@@ -335,11 +453,24 @@ export default { ...@@ -335,11 +453,24 @@ export default {
components: { components: {
glsxCombiForm, glsxCombiForm,
glsxDialog, // glsxDialog,
pdfDialog pdfDialog
}, },
mounted() { mounted() {
this.editNotify = this.$route.params
// if (this.isFirst && this.editNotify.hasOwnProperty('code')) {
// this.isFirst = false
// this.isTipVisible = true
// clearTimeout(this.timer)
// this.timer = setTimeout(
// () => {
// this.isTipVisible = false
// },
// this.editNotify.code == '0' ? 1500 : 3000
// )
// }
this.$refs.equityRef.page.pageSize = 5
this.$apis.beforeSale.getProListApi({}).then(res => { this.$apis.beforeSale.getProListApi({}).then(res => {
this.baseData.goodsStatusList = res this.baseData.goodsStatusList = res
this.getOptionsList('searchFormData') this.getOptionsList('searchFormData')
...@@ -347,14 +478,11 @@ export default { ...@@ -347,14 +478,11 @@ export default {
this.getCountNoData() this.getCountNoData()
this.$apis.beforeSale.getUserInfoApi({}).then(res => { this.$apis.beforeSale.getUserInfoApi({}).then(res => {
this.userInfo = res this.userInfo = res
var idx = this.searchFormData.findIndex(item => item.name == this.levelToShow[res.merchantAccountLevel]) // if (res.merchantAccountLevel != 4) {
this.searchFormData[idx].isHide = false // var idx = this.searchFormData.findIndex(item => item.name == this.levelToShow[this.userInfo.admin ? res.merchantAccountLevel : res.merchantAccountLevel + 1])
this.baseData[this.searchFormData[idx].optionsName] = [{ // this.searchFormData[idx].isHide = false
merchantNo: this.userInfo.merchantNo, // this.getMerchantList('', '', this.searchFormData[idx].name, this.searchFormData[idx].optionsName)
merchantName: this.userInfo.merchantName // }
}]
this.getOptionsList('searchFormData', false, this.searchFormData[idx].name)
// this.getMerchantList(this.userInfo.merchantNo, this.userInfo.merchantAccountLevel, this.searchFormData[idx].name, this.searchFormData[idx].optionsName)
}) })
}, },
...@@ -374,15 +502,36 @@ export default { ...@@ -374,15 +502,36 @@ export default {
this.getOptionsList('searchFormData', false, attrName) this.getOptionsList('searchFormData', false, attrName)
}) })
}, },
getSelectInputParams() {
const list = Object.keys(this.searchSelectObj)
var params = {}
list.forEach(i => {
const item = this.searchSelectObj[i]
item.value && (params[item.attr] = item.value)
})
return params
},
getParams() { getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
const tempParams = this.getSelectInputParams()
params = {
...params,
...tempParams
}
// 商户-merchantId
for (var i = 1; i <= 4; i++) {
if (this.searchForm[this.levelToShow[i]]) {
params.merchantId = this.searchForm[this.levelToShow[i]]
params.accountLevel = i
}
}
if (this.searchForm.successDate.length) { if (this.searchForm.successDate.length) {
params.successStartDate = new Date(this.searchForm.successDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00' params.successStartDates = new Date(this.searchForm.successDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.successEndDate = new Date(this.searchForm.successDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59' params.successEndDates = new Date(this.searchForm.successDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
} }
if (this.searchForm.effectiveDate.length) { if (this.searchForm.effectiveDate.length) {
params.effectiveStartDate = new Date(this.searchForm.effectiveDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00' params.effectiveStartDates = new Date(this.searchForm.effectiveDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.effectiveEndDate = new Date(this.searchForm.effectiveDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59' params.effectiveEndDates = new Date(this.searchForm.effectiveDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
} }
delete params.successDate delete params.successDate
delete params.effectiveDate delete params.effectiveDate
...@@ -422,41 +571,75 @@ export default { ...@@ -422,41 +571,75 @@ export default {
} }
}, },
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) { secondConfirm(title, txt, apiModule, apiName, apiParams) {
this.$confirm(txt, title, { this.secondObj = {
title: title,
txt: txt,
apiModule: apiModule,
apiName: apiName,
apiParams: apiParams
}
if (title == '退单') {
this.$confirm('是否确认退单?', '退单', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
callback: action => { customClass: 'customConfirm'
if (action == 'confirm') { }).then(() => {
this.$apis[apiModule][apiName](apiParams).then(res => { 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.$message({ this.$message({
message: res.code == '0' ? '操作成功' : res.message, message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
}) })
this.editNotify = res
// clearTimeout(this.timer)
// this.timer = setTimeout(
// () => {
// this.isTipVisible = false
// },
// this.editNotify.code == '0' ? 1500 : 3000
// )
if (res.code == '0') { if (res.code == '0') {
fn && fn()
this.handleSearch() this.handleSearch()
} }
}) })
}
}
})
}, },
handleSecondCancel() {
this.isSecondVisible = !this.isSecondVisible
},
// 1-新增;2-编辑;3-修改;4-重新提单;5-查看 // 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)) { if (addOrEdit == 3 && !this.userInfo.admin && new Date(new Date().setDate(new Date().getDate() - 7)) > new Date(row.successDate)) {
const h = this.$createElement const h = this.$createElement
const tip = addOrEdit==3?'修改申请':'退单申请'
this.$message({ 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提交退单申请 ')]), 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提交'+tip)]),
type: 'error' type: 'error',
customClass: 'customMessage'
}) })
return true return true
} }
if(addOrEdit == 4 && row.orderStatus == 3) { let paraFormat = {
addOrEdit = 2 addOrEdit,
contractNo: addOrEdit == 1 ? -1 : row.contractNo,
isSuper: this.userInfo.admin
} }
addOrEdit == 1 ? this.$router.push('/beforeSale/editEquity/' + addOrEdit + '/' + -1) : this.$router.push('/beforeSale/editEquity/' + addOrEdit + '/' + row.contractNo) const title = this.jumpTitle(addOrEdit)
const urlpara = encodeURIComponent(JSON.stringify(paraFormat))
this.$router.push({path:'/beforeSale/editEquity/' + urlpara,query:{$title:title}})
// addOrEdit == 1 ? this.$router.push('/beforeSale/editEquity/' + urlpara) : this.$router.push('/beforeSale/editEquity/' + urlpara)
}, },
handlePdfClose() { handlePdfClose() {
...@@ -465,9 +648,32 @@ export default { ...@@ -465,9 +648,32 @@ export default {
// 打印 // 打印
handlePdf(row) { handlePdf(row) {
this.handlePdfClose() // if (!row.auditStatus) {
// const h = this.$createElement
// this.isTipVisible = true
// this.editNotify = {
// code: '-1',
// message: '财务未审核,合同无法打印'
// }
// clearTimeout(this.timer)
// this.timer = setTimeout(
// () => {
// this.isTipVisible = false
// },
// this.editNotify.code == '0' ? 1500 : 3000
// )
// return true
// }
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
this.$apis.beforeSale.getPriteApi({ contractNo: row.contractNo }).then(res => { this.$apis.beforeSale.getPriteApi({ contractNo: row.contractNo }).then(res => {
this.pdfUrl = res this.pdfUrl = res
this.handlePdfClose()
loading.close();
}) })
}, },
...@@ -494,8 +700,6 @@ export default { ...@@ -494,8 +700,6 @@ export default {
var tempList = [] var tempList = []
this.uploadFormData = [] this.uploadFormData = []
this.packageList.forEach(item => { this.packageList.forEach(item => {
// item.groupAttributeList.forEach((k, idx) => {
// this.uploadForm[item.attachmentCode] = ''
this.$set(this.uploadForm, item.attachmentCode, '') this.$set(this.uploadForm, item.attachmentCode, '')
this.uploadFormData.push({ this.uploadFormData.push({
label: item.attachmentName, label: item.attachmentName,
...@@ -505,7 +709,8 @@ export default { ...@@ -505,7 +709,8 @@ export default {
maxPhotoNum: 1, maxPhotoNum: 1,
handleUpload: (e, file, targetItem) => { handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1] const targetNameList = file.name.split('.')
const base64 = targetNameList[targetNameList.length-1] + '@' + imgFile.split(',')[1]
var imgUrl = '' var imgUrl = ''
this.$apis.beforeSale.uploadImgApi({ file: base64, fileType: 'image' }).then(res => { this.$apis.beforeSale.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
this.uploadFile(res, targetItem) this.uploadFile(res, targetItem)
...@@ -528,38 +733,48 @@ export default { ...@@ -528,38 +733,48 @@ export default {
this.isFileVisible = !this.isFileVisible this.isFileVisible = !this.isFileVisible
}, },
handleUpload(row) { handleUpload(row) {
// console.log(row)
this.$apis.beforeSale.getOrderAttrApi({ packageCode: row.packageCode }).then(res => { this.$apis.beforeSale.getOrderAttrApi({ packageCode: row.packageCode }).then(res => {
this.packageList = res this.packageList = res
this.uploadForm.contractNo = row.contractNo this.uploadForm.contractNo = row.contractNo
this.$apis.beforeSale.getAllOrderValueApi({ contractNo: row.contractNo }).then(subRes => {
var idx = ''
this.packageList.forEach(item => { this.packageList.forEach(item => {
this.$apis.beforeSale.getOrderValueApi({ contractNo: row.contractNo, attachmentCode: item.attachmentCode }).then(subRes => { idx = subRes.findIndex(i => i.attachmentCode == item.attachmentCode)
this.uploadForm[item.attachmentCode] = subRes || '' this.uploadForm[item.attachmentCode] = idx != -1 ? subRes[idx].attachmentFile : ''
}) })
}) })
this.autoGenerate() this.autoGenerate()
}) })
}, },
// 退保 // 退单
handleBack(row) { handleBack(row) {
// console.log(this.userInfo)
if (!this.userInfo.admin && new Date(new Date().setDate(new Date().getDate() - 7)) > new Date(row.successDate)) { if (!this.userInfo.admin && new Date(new Date().setDate(new Date().getDate() - 7)) > new Date(row.successDate)) {
const h = this.$createElement const h = this.$createElement
this.$message({ 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提交退单申请 ')]), 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' type: 'error',
customClass: 'customMessage'
}) })
return true return true
} }
this.secondConfirm('退保', '是否确认退保?', 'beforeSale', 'backOrderApi', { contractNo: row.contractNo, merchantId: row.merchantId }) this.secondConfirm('退单', '是否确认退单?', 'beforeSale', 'backOrderApi', { contractNo: row.contractNo, merchantId: row.merchantId })
}, },
// 导出 // 导出
handleExport() { handleExport() {
var params = this.getParams() var params = this.getParams()
this.$apis.beforeSale.getExportApi(params).then(res => { this.$apis.beforeSale.getExportApi(params).then(res => {
// window.open(res)
let tempaa = utils.getExplorer()
if (tempaa == 'QQ') {
window.open(res) window.open(res)
} else {
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = res
document.body.appendChild(iframe)
}
}) })
}, },
...@@ -572,35 +787,108 @@ export default { ...@@ -572,35 +787,108 @@ export default {
queryText: '', queryText: '',
orderStatus: '', orderStatus: '',
merchantId: '', merchantId: '',
dqtId: '',
pqId: '',
mdId: '',
auditStatus: '',
dataPerfection: '',
successDate: [], successDate: [],
effectiveDate: [] effectiveDate: []
} }
this.searchSelectObj = {
nameOrNoOrVin: {
attr: 'customerName',
value: ''
}
}
var tempIdx = ''
// var addNum = this.userInfo.admin ? 1 : 2
// if (this.userInfo.merchantAccountLevel != 4) {
// for (var i = this.userInfo.merchantAccountLevel + addNum; i <= 4; i++) {
// tempIdx = this.searchFormData.findIndex(item => item.name == this.levelToShow[i + ''])
// this.searchFormData[tempIdx].isHide = true
// this.searchForm[this.levelToShow[i + '']] = ''
// }
// }
this.handleSearch() this.handleSearch()
},
// 页面跳转标题判断
jumpTitle(addOrEdit) {
let title = '新增权益'
switch (addOrEdit) {
case 1:
title = '新增权益'
break;
case 2:
title = '编辑'
break;
case 3:
title = '修改'
break;
case 4:
title = '重新提单'
break;
case 5:
title = '查看'
break;
default:
title = '新增权益'
break;
}
return title
} }
} }
} }
</script> </script>
<style scoped> <style lang="scss" scoped>
.before-sale .container { .before-sale {
padding: 0px 20px 20px 40px; margin-top: 17px;
}
.before-sale .flex {
display: flex;
}
.find_wrap {
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px 20px 2px 20px;
.resetBtn {
background: #ffffff;
color: #5850ff;
border: 1px solid #5850ff;
}
.m-r-l-20 {
margin: 0 20px;
}
}
.table_wrapper {
// margin-top: 10px;
background: #ffffff; background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1); box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px; padding: 20px;
} }
.before-sale .m-b-20 { .before-sale .m-b-10 {
margin-bottom: 20px; margin-bottom: 10px;
} }
.before-sale .table-top-tips { .before-sale .table-top-tips {
/* position: relative; */
box-sizing: border-box; box-sizing: border-box;
color: red; margin-left: 10px;
margin-bottom: 10px; width: 100%;
/* width: 100%; */ height: 32px;
/* background-color: darkgrey; */ line-height: 30px;
padding: 4px 10px; font-size: 12px;
background-color: #fff0bb;
border: 1px solid #ffca78;
padding: 0 10px;
border-radius: 2px;
}
.before-sale .table-top-tips .el-icon-warning {
font-size: 12px;
color: #f77315;
margin-right: 8px;
} }
.before-sale .circule-tips { .before-sale .circule-tips {
...@@ -616,24 +904,52 @@ export default { ...@@ -616,24 +904,52 @@ export default {
.before-sale .footer-btns { .before-sale .footer-btns {
float: right; float: right;
/* display: block; */ /* display: block;
/* text-align: right; */ text-align: right; */
margin-bottom: 18px; /* margin-bottom: 18px; */
} }
.before-sale .el-table .cell { .before-sale .el-table .cell {
line-height: 16px; line-height: 16px;
} }
.before-sale .table-btns {
display: grid;
grid-template-columns: repeat(auto-fill, 33.33%);
grid-row-gap: 10px;
}
.before-sale .table-btns .el-button { .before-sale .table-btns .el-button {
padding: 0 0 0 5px; // padding: 0 0 0 5px;
margin-left: 5px;
border-left: 1px solid #dcdfe6;
border-radius: 0; border-radius: 0;
border: 0;
padding: 0;
margin: 0;
} }
.before-sale .table-btns .el-button:first-child { // .before-sale .table-btns .el-button:first-child {
padding: 0; // padding: 0;
border: 0; // border: 0;
// }
.tips-dialog .el-icon-success {
margin-right: 10px;
font-size: 22px;
color: #228b22;
}
.tips-dialog .el-icon-warning {
margin-right: 10px;
font-size: 22px;
color: #f77315;
}
.tips-dialog .el-icon-error {
margin-right: 10px;
font-size: 22px;
color: #f56c6c;
}
.f-size {
font-size: 14px;
display: flex;
/* text-align: center; */
}
.tips-dialog .el-dialog__body {
padding: 10px 15px 20px !important;
} }
</style> </style>
<!-- 财务 - 权益订单列表 -->
<template>
<div class="before-sale">
<div class="container">
<div>
<glsx-combi-form ref="showSearch" labelWidth="110px" defaultWidth="210px" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData">
<span slot="footer" class="footer-btns">
<el-button :size="size" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleExport">导出</el-button>
</span>
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="equityRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="table-btns" slot-scope="scope">
<!-- <el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleAudit(scope.scope)">{{scope.scope.auditStatus ? '撤销' : '财务已收款'}}</el-button> -->
<el-button v-if="[2].includes(scope.scope.orderStatus) && !scope.scope.auditStatus" type="text" @click="handleAudit(scope.scope)">财务已收款</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<el-dialog :visible.sync="isTipVisible" width="400px" class="tips-dialog" top="30%" title="提示">
<div class="f-size">
<i v-show="editNotify.code == '0'" class="el-icon-success"></i>
<i v-show="editNotify.code != '0'" class="el-icon-error"></i>
<span>{{editNotify.code == '0' ? '操作成功' : editNotify.message}}</span>
</div>
</el-dialog>
<el-dialog :visible.sync="isSecondVisible" width="400px" class="tips-dialog" top="30%" :title="secondObj.title">
<div class="f-size">
<i class="el-icon-warning"></i>
<span>{{secondObj.txt}}</span>
</div>
<span slot="footer" class="dialog-footer">
<el-button :size="size" @click="handleSecondCancel">取 消</el-button>
<el-button :size="size" type="primary" @click="handleSecondConfirm">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'financeIndex',
data() {
return {
size: 'small',
isTipVisible: false,
editNotify: {},
isSecondVisible: false,
secondObj: {
title: '',
txt: ''
},
userInfo: {},
levelToShow: {
1: 'merchantId',
2: 'dqtId',
3: 'pqId',
4: 'mdId'
},
searchForm: {
queryText: '',
orderStatus: '',
packageCode: '',
merchantId: '',
dqtId: '',
pqId: '',
mdId: '',
auditStatus: '',
successDate: [],
effectiveDate: []
},
tableSearchForm: {},
// 合同打印
isPdfVisible: false,
pdfUrl: '',
// 上传资料
isFileVisible: false,
packageList: [],
uploadRule: {},
uploadForm: {},
uploadFormData: [],
// 搜索
searchSelectObj: {
nameOrNoOrVin: {
attr: 'customerName',
value: ''
}
},
searchFormData: [
{
type: 'selectInput',
selectName: 'nameOrNoOrVin',
isClear: true,
inputWidth: '320px',
selectWidth: '110px',
selectOption: [{
label: '客户姓名',
name: 'customerName'
}, {
label: '合同号',
name: 'contractNo'
}, {
label: '车架号',
name: 'vin'
}],
handleSelectChange: (value) => {
this.searchSelectObj.nameOrNoOrVin.value = ''
}
},
{
label: '服务状态',
name: 'orderStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'orderStatusList'
},
{
label: '产品名称',
name: 'packageCode',
type: 'select',
optionList: [],
optionId: 'packageCode',
optionLabel: 'packageName',
optionsName: 'goodsStatusList'
},
{
label: '提单成功时间',
name: 'successDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '生效时间',
name: 'effectiveDate',
type: 'datePicker',
isClear: true
},
{
label: '财务审核状态',
name: 'auditStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'auditStatusList'
},
{
label: '总部',
name: 'merchantId',
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'merchantList',
isHide: true,
changeAttr: (val, targetItem) => {
var idx = this.searchFormData.findIndex(item => item.name == this.levelToShow['2'])
this.searchFormData[idx].isHide = false
this.searchForm[this.levelToShow['2']] = ''
var tempIdx = ''
for(var i = 3; i <= 4; i++) {
tempIdx = this.searchFormData.findIndex(item => item.name == this.levelToShow[i + ''])
this.searchFormData[tempIdx].isHide = true
this.searchForm[this.levelToShow[i + '']] = ''
}
this.getMerchantList(val, 2, this.searchFormData[idx].name, this.searchFormData[idx].optionsName)
}
},
{
label: '大区',
name: 'dqtId',
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'dqList',
isHide: true,
changeAttr: (val, targetItem) => {
var idx = this.searchFormData.findIndex(item => item.name == this.levelToShow['3'])
this.searchFormData[idx].isHide = false
this.searchForm[this.levelToShow['3']] = ''
var tempIdx = this.searchFormData.findIndex(item => item.name == this.levelToShow['4'])
this.searchFormData[tempIdx].isHide = true
this.searchForm[this.levelToShow['4']] = ''
this.getMerchantList(val, 3, this.searchFormData[idx].name, this.searchFormData[idx].optionsName)
}
},
{
label: '片区',
name: 'pqId',
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'pqList',
isHide: true,
changeAttr: (val, targetItem) => {
var idx = this.searchFormData.findIndex(item => item.name == this.levelToShow['4'])
this.searchFormData[idx].isHide = false
this.searchForm[this.levelToShow['4']] = ''
this.getMerchantList(val, 4, this.searchFormData[idx].name, this.searchFormData[idx].optionsName)
}
},
{
label: '门店',
name: 'mdId',
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'mdList',
isHide: true
}
],
// 表格
getListApi: this.$apis.beforeSale.getListApi,
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '车主姓名',
prop: 'customerName',
line: 1,
formatter: cellValue => {
return cellValue.customerName || '-'
}
},
{
label: '合同号',
prop: 'contractNo',
width: '200px',
line: 1,
formatter: cellValue => {
return [2, 4, 5].includes(cellValue.orderStatus) ? (cellValue.contractNo || '-') : '-'
}
},
{
label: '提单成功时间',
prop: 'successDate',
width: '160px',
line: 1,
formatter: cellValue => {
return cellValue.successDate ? dayjs(cellValue.successDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '新车开票日期',
prop: 'billingDate',
width: '130px',
line: 1,
formatter: cellValue => {
return cellValue.billingDate ? dayjs(cellValue.billingDate).format('YYYY-MM-DD') : '-'
}
},
{
label: '店面名称',
prop: 'merchantName',
width: '160px',
line: 1,
formatter: cellValue => {
return cellValue.merchantName || '-'
}
},
{
label: '车品牌',
prop: 'vehicleBrandName',
width: '160px',
line: 1,
formatter: cellValue => {
return cellValue.vehicleBrandName || '-'
}
},
{
label: '车系',
prop: 'vehicleSeriesName',
line: 1,
formatter: cellValue => {
return cellValue.vehicleSeriesName || '-'
}
},
{
label: '车架',
prop: 'vin',
line: 1,
width: '200px',
formatter: cellValue => {
return cellValue.vin || '-'
}
},
{
label: '电话',
prop: 'customerPhone',
width: '160px',
line: 1,
formatter: cellValue => {
return cellValue.customerPhone || '-'
}
},
{
label: '产品名称',
prop: 'packageName',
line: 1,
formatter: cellValue => {
return cellValue.packageName || '-'
}
},
{
label: '实际销售价',
prop: 'actualSalesPrice',
width: '160px',
line: 1,
formatter: cellValue => {
return cellValue.actualSalesPrice ? (cellValue.actualSalesPrice / 100).toFixed(2) : '-'
}
},
{
label: '服务期限',
prop: 'servicePeriod',
line: 1,
formatter: cellValue => {
return cellValue.servicePeriod ? '1年' : '-'
}
},
{
label: '生效时间',
prop: 'effectiveDate',
width: '130px',
line: 1,
formatter: cellValue => {
return cellValue.effectiveDate ? dayjs(cellValue.effectiveDate).format('YYYY-MM-DD') : '-'
}
},
{
label: '状态',
prop: 'orderStatus',
width: '100px',
line: 1,
formatter: cellValue => {
return this.baseData.orderStatusList.map(item => item.confId).includes(cellValue.orderStatus) ? this.baseData.orderStatusList.find(item => item.confId == cellValue.orderStatus).confName : '-'
}
},
{
label: '审核状态',
prop: 'auditStatus',
width: '100px',
line: 1,
formatter: cellValue => {
var auditStatusTxt = '-'
if([2, 4, 5].includes(cellValue.orderStatus)) {
auditStatusTxt = this.baseData.auditStatusList.map(item => item.confId).includes(cellValue.auditStatus) ? this.baseData.auditStatusList.find(item => item.confId == cellValue.auditStatus).confName : '-'
}
return auditStatusTxt
}
},
{
label: '审核人',
prop: 'auditBy',
width: '140px',
line: 1,
formatter: cellValue => {
return cellValue.auditBy || '-'
}
},
{
label: '门店编码',
prop: 'sap',
line: 1,
formatter: cellValue => {
return cellValue.sap || '-'
}
},
{
label: '实际销售人员',
prop: 'actualSalesPerson',
width: '160',
line: 1,
formatter: cellValue => {
return cellValue.actualSalesPerson || '-'
}
},
{
label: '大区',
prop: 'provinceMerchantName',
line: 1,
formatter: cellValue => {
return cellValue.provinceMerchantName || '-'
}
},
{
label: '片区',
prop: 'cityMerchantName',
line: 1,
formatter: cellValue => {
return cellValue.cityMerchantName || '-'
}
},
{
label: '操作人',
prop: 'updatedBy',
width: '140px',
line: 1,
formatter: cellValue => {
return cellValue.updatedBy || '-'
}
},
{
label: '操作',
prop: '',
width: '100px',
fixed: 'right',
addHtml: 'table-btns'
}
]
},
pageConf: { pageSize: 'pageCount', pageNum: 'pageSize', totalCount: 'total' },
// 公共数据
baseData: {
goodsStatusList: [],
merchantList: [],
dqList: [],
pqList: [],
mdList: [],
orderStatusList: [
{
confId: 0,
confName: '待提单'
},
{
confId: 2,
confName: '提单成功'
},
{
confId: 3,
confName: '提单失败'
},
{
confId: 4,
confName: '已退单'
},
{
confId: 5,
confName: '已过期'
}
],
auditStatusList: [
{
confId: 0,
confName: '待审核'
},
{
confId: 1,
confName: '已审核'
}
]
}
}
},
components: {
glsxCombiForm
},
mounted() {
this.$apis.beforeSale.getProListApi({}).then(res => {
this.baseData.goodsStatusList = res
this.getOptionsList('searchFormData')
})
this.$apis.beforeSale.getUserInfoApi({}).then(res => {
this.userInfo = res
if(res.merchantAccountLevel != 4) {
var idx = this.searchFormData.findIndex(item => item.name == this.levelToShow[this.userInfo.admin ? res.merchantAccountLevel : res.merchantAccountLevel + 1])
this.searchFormData[idx].isHide = false
this.getMerchantList('', '', this.searchFormData[idx].name, this.searchFormData[idx].optionsName)
}
})
},
methods: {
getMerchantList(merchantId, accountLevel, attrName, listName) {
var params = {
merchantId: merchantId,
accountLevel: accountLevel
}
this.$apis.beforeSale.getMerchantApi(params).then(res => {
this.baseData[listName] = res
this.getOptionsList('searchFormData', false, attrName)
})
},
getSelectInputParams() {
const list = Object.keys(this.searchSelectObj)
var params = {}
list.forEach(i => {
const item = this.searchSelectObj[i]
item.value && (params[item.attr] = item.value)
})
return params
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
const tempParams = this.getSelectInputParams()
params = {
...params,
...tempParams
}
// 商户-merchantId
for(var i = 1; i <= 4; i++) {
if(this.searchForm[this.levelToShow[i]]) {
params.merchantId = this.searchForm[this.levelToShow[i]]
params.accountLevel = i
}
}
if (this.searchForm.successDate.length) {
params.successStartDates = new Date(this.searchForm.successDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.successEndDates = new Date(this.searchForm.successDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
if (this.searchForm.effectiveDate.length) {
params.effectiveStartDates = new Date(this.searchForm.effectiveDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.effectiveEndDates = new Date(this.searchForm.effectiveDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.successDate
delete params.effectiveDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
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] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} 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)
}
}
})
}
},
secondConfirm(title, txt, apiModule, apiName, apiParams) {
this.secondObj = {
title: title,
txt: txt,
apiModule: apiModule,
apiName: apiName,
apiParams: apiParams
}
this.handleSecondCancel()
},
handleSecondConfirm() {
this.$apis[this.secondObj.apiModule][this.secondObj.apiName](this.secondObj.apiParams).then(res => {
this.handleSecondCancel()
this.isTipVisible = true
this.editNotify = res
clearTimeout(this.timer)
this.timer = setTimeout(() => {
this.isTipVisible = false
}, this.editNotify.code == '0' ? 1500 : 3000)
if (res.code == '0') {
this.handleSearch()
}
})
},
handleSecondCancel() {
this.isSecondVisible = !this.isSecondVisible
},
// 审核
handleAudit(row) {
var txt = row.auditStatus ? '撤销' : '审核通过'
// this.isTipVisible = !this.isTipVisible
this.secondConfirm(txt, '是否确认'+ txt +'?', 'beforeSale', 'aduitOrderApi', { contractNo: row.contractNo, auditStatus: row.auditStatus ? 0 : 1 })
},
// 导出
handleExport() {
var params = this.getParams()
this.$apis.beforeSale.getExportApi(params).then(res => {
// window.open(res)
let tempaa = utils.getExplorer()
if (tempaa == 'QQ') {
window.open(res)
} else {
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = res
document.body.appendChild(iframe)
}
})
},
handleSearch() {
this.$refs.equityRef.refreshTable()
},
handleReset() {
this.searchForm = {
queryText: '',
orderStatus: '',
merchantId: '',
dqtId: '',
pqId: '',
mdId: '',
auditStatus: '',
successDate: [],
effectiveDate: []
}
this.searchSelectObj = {
nameOrNoOrVin: {
attr: 'customerName',
value: ''
}
}
var tempIdx = ''
var addNum = this.userInfo.admin ? 1 : 2
if(this.userInfo.merchantAccountLevel != 4) {
for(var i = this.userInfo.merchantAccountLevel + addNum; i <= 4; i++) {
tempIdx = this.searchFormData.findIndex(item => item.name == this.levelToShow[i + ''])
this.searchFormData[tempIdx].isHide = true
this.searchForm[this.levelToShow[i + '']] = ''
}
}
this.handleSearch()
}
}
}
</script>
<style>
.before-sale .container {
padding: 0px 20px 20px 40px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.before-sale .m-b-20 {
margin-bottom: 20px;
}
.before-sale .table-top-tips {
/* position: relative; */
box-sizing: border-box;
/* margin: 36px 0 10px; */
margin-bottom: 10px;
width: calc(100% - 210px);
height: 30px;
font-size: 12px;
background-color: #FFF0BB;
border: 1px solid #FFCA78;
padding: 4px 10px;
border-radius: 2px;
}
.before-sale .table-top-tips .el-icon-warning {
font-size: 12px;
color: #f77315;
margin-right: 8px;
}
.before-sale .circule-tips {
position: absolute;
top: 0;
right: -6px;
display: inline-block;
height: 6px;
width: 6px;
border-radius: 100%;
background-color: red;
}
.before-sale .footer-btns {
float: right;
/* display: block;
text-align: right; */
/* margin-bottom: 18px; */
}
.before-sale .el-table .cell {
line-height: 16px;
}
.before-sale .table-btns .el-button {
padding: 0 0 0 5px;
margin-left: 5px;
border-left: 1px solid #dcdfe6;
border-radius: 0;
}
.before-sale .table-btns .el-button:first-child {
padding: 0;
border: 0;
}
.tips-dialog .el-icon-success {
margin-right: 10px;
font-size: 22px;
color: #228b22;
}
.tips-dialog .el-icon-warning {
margin-right: 10px;
font-size: 22px;
color: #f77315;
}
.tips-dialog .el-icon-error {
margin-right: 10px;
font-size: 22px;
color: #f56c6c;
}
.f-size {
font-size: 14px;
display: flex;
/* text-align: center; */
}
.tips-dialog .el-dialog__body {
padding: 10px 15px 20px !important;
}
</style>
<!-- 权益订单 --> <!-- 权益订单 -->
<template> <template>
<div class="equity"> <div class="equity">
<el-tabs v-model="activeName" @tab-click="handleClick"> <!-- <open v-if="status==1"></open>
<el-tab-pane label="其他权益订单" name="equityList"> <not-open v-if="status==2"></not-open> -->
<equity-list v-if="activeName == 'equityList'"></equity-list>
</el-tab-pane>
<el-tab-pane label="店面服务设置" name="serviceSet">
<service-set v-if="activeName == 'serviceSet'"></service-set>
</el-tab-pane>
</el-tabs>
</div> </div>
</template> </template>
<script> <script>
import equityList from './equityList' // import equityList from './equityList.vue'
import serviceSet from './serviceSet' // import introduct from './introduct.vue'
export default { export default {
name: 'index', name: 'index',
// components: {
// open: equityList,
// 'not-open': introduct
// },
data() { data() {
return { return {
activeName: 'equityList' activeName: 'equityList',
status: 0
} }
}, },
created() {
components: { this.isOpenSettin()
equityList,
serviceSet
}, },
mounted() {}, mounted() {},
methods: {
methods: {} // 判断是否开通
isOpenSettin() {
localStorage.removeItem('preSetStatus')
const { merchantId } = this.$globalState.session
this.$apis.beforeSale.judgeSetting({ merchantId }).then(res => {
// data != null 且data.openFlag == 1 为开通,其他的都是未开通
const { code, data } = res
if (code == 0 && data != null && data.openFlag == 1) {
this.status = 1
} else {
this.status = 2
}
localStorage.setItem('preSetStatus', this.status)
this.$router.push('/beforeSale/checkSet')
})
}
// 页面跳转
// handleEdit(path,title) {
// this.$router.push({
// path,
// query: {
// $title: encodeURI(title)
// }
// })
// }
}
} }
</script> </script>
<style> <style>
.equity .el-tabs__nav-wrap:after {
opacity: 0;
}
.equity .el-tabs__item {
height: 20px !important;
line-height: 10px !important;
font-weight: 400;
font-size: 16px;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -60,8 +60,8 @@ ...@@ -60,8 +60,8 @@
</div> </div>
</div> </div>
<qrCode :codeUrl="code" :phone="phone"></qrCode> <qrCode :codeUrl="code" :phone="phone"></qrCode>
<el-dialog :visible.sync="videoShow" width="50%" :before-close="handleClose"> <el-dialog class="video-dialog" :visible.sync="videoShow" width="50%" :before-close="handleClose">
<div slot="title" style="height: 18px"></div> <div slot="title" style="height: 25px"></div>
<video v-if="videoShow" width="100%" height="100%" autoplay controls src="https://img02.glsx.com.cn/scrm/video/beforeSale.mp4"></video> <video v-if="videoShow" width="100%" height="100%" autoplay controls src="https://img02.glsx.com.cn/scrm/video/beforeSale.mp4"></video>
</el-dialog> </el-dialog>
</div> </div>
...@@ -135,9 +135,9 @@ export default { ...@@ -135,9 +135,9 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
// .introduct_container { .introduct_container {
// margin-top: 17px; margin-top: 17px;
// } }
.top_play_wrap { .top_play_wrap {
height: 360px; height: 360px;
background: #ffffff; background: #ffffff;
...@@ -319,4 +319,18 @@ export default { ...@@ -319,4 +319,18 @@ export default {
} }
} }
} }
::v-deep .video-dialog{
.el-dialog__header{
border-bottom: none;
background-color: #000;
.el-dialog__headerbtn{
top:15px;
font-size: 24px;
}
}
.el-dialog__body{
padding: 0;
display: flex;
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
<!-- 查看详情 --> <!-- 查看详情 -->
<template> <template>
<div class="pdfDialog"> <div class="pdfDialog">
<el-dialog <el-dialog :visible.sync="isVisible" :title="title" :before-close="handleClose" :close-on-click-modal="false" width="860px">
:visible.sync="isVisible"
:title="title"
:before-close="handleClose"
:close-on-click-modal="false"
width="860px"
>
<iframe width="100%" height="700px" scrolling="yes" frameborder="0" :src="pdfUrl"></iframe> <iframe width="100%" height="700px" scrolling="yes" frameborder="0" :src="pdfUrl"></iframe>
</el-dialog> </el-dialog>
</div> </div>
...@@ -17,8 +11,7 @@ ...@@ -17,8 +11,7 @@
export default { export default {
name: 'pdfDialog', name: 'pdfDialog',
data() { data() {
return { return {}
}
}, },
props: { props: {
...@@ -38,21 +31,20 @@ export default { ...@@ -38,21 +31,20 @@ export default {
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.pdfDialog{ .pdfDialog {
.el-dialog__header { .el-dialog__header {
padding: 10px 16px 4px; padding: 10px 16px 4px;
background-color: #141516; background-color: #141516;
.el-dialog__title{ .el-dialog__title {
color: #fff; color: #fff;
font-size: 16px; font-size: 16px;
} }
} }
.el-dialog__body { .el-dialog__body {
padding: 0; padding: 0;
background-color: #202223 background-color: #202223;
} }
} }
</style> </style>
<!-- 店面服务设置 --> <!-- 店面服务设置 -->
<template> <template>
<div class="before-sale edit-equity"> <div class="edit-equity">
<div class="container edit-container"> <template v-if="showPage == 1">
<div class="edit-container">
<p class="edit-title">{{ title }}</p> <p class="edit-title">{{ title }}</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsx-combi-form> <glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsx-combi-form>
<glsx-combi-form ref="editFormRefBrand" labelWidth="140px" defaultWidth="320px" formRef="editChildRefBrand" :formObj.sync="editForm" :formData="editFormDataCar">
<template slot="vehicleBrandId">
<el-select v-model="editForm.vehicleBrandId" placeholder="请选择品牌" filterable @change="handleChangeBrand(editForm.vehicleBrandId)" style="width: 320px" clearable>
<el-option v-for="item in baseData.carBrandOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
<template slot="vehicleSubBrandId">
<el-select v-model="editForm.vehicleSubBrandId" placeholder="请选择子品牌" filterable style="width: 320px" clearable>
<el-option v-for="item in baseData.carChildOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
</glsx-combi-form>
<!-- v1.1.0新增活码 -->
<div class="new_container">
<p class="title">针对包含“车主生活权益服务”的服务套餐,提供两种领取该服务的方式供门店选择。</p>
<div class="point_title">
<span class="point_icon"></span>
<span class="point_text">方式1:小程序领取。(车主直接登录小程序领取)</span>
</div>
<div style="height: 8px"></div>
<div class="point_title">
<span class="point_icon"></span>
<span class="point_text">方式2:加企微领取。(创建自动回复配有领取链接的活码,客户扫码加企微,自动回复小程序领取)</span>
</div>
<div class="radio_wrap">
<div class="box">
<div class="radio_title">
<el-radio v-model="wayRadio" :label="1">小程序领取</el-radio>
</div>
<div class="radio_panel">
<el-image :class="wayRadio == 2 ? 'opcaSty' : ''" style="width: 88px; height: 88px" :src="settingData.qrcodeUrl" :preview-src-list="[settingData.qrcodeUrl]"></el-image>
</div>
</div>
<div v-if="!settingData.liveCodeUrl" class="box">
<div class="radio_title">
<el-radio v-model="wayRadio" :label="2">加企微领取</el-radio>
</div>
<el-button :disabled="wayRadio==1" size="small" @click="openActiveModal" class="custom_blue">选择活码</el-button>
</div>
<div v-if="settingData.liveCodeUrl || this.activeId" class="box">
<div class="radio_title">
<el-radio v-model="wayRadio" :label="2" @change="selectActivedRadio">加企微领取</el-radio>
</div>
<div class="radio_panel">
<el-image :class="wayRadio == 1 ? 'opcaSty' : ''" style="width: 88px; height: 88px" :src="settingData.liveCodeUrl" :preview-src-list="[settingData.liveCodeUrl]"></el-image>
</div>
<div class="radio_tip">{{ settingData.liveCodeName }}</div>
<div v-show="wayRadio==2" class="radio_edit" @click="toEditActived">修改</div>
</div>
</div>
</div>
</div>
<div
class="fixed_bottom"
:style="{
left: footerLeft + 'px',
width: footerWidth + 'px'
}"
>
<el-button size="small" type="primary" @click="handleConfirm">确定</el-button>
</div>
</template>
<template v-if="showPage == 2">
<div class="nodata_widget">
<div :style="[{ height: nodataHeight + 'px' }]" class="wrapper">
<img src="../../assets/nodata_icon.png" />
<span class="nodata_tip_1">您暂未开通售前权益服务</span>
<span class="nodata_tip_2">合作开通后,您方可在此页设置店面的服务热线和默认提单车辆品牌等。</span>
</div>
</div>
</template>
<el-dialog width="60%" height="50%" :visible.sync="dialogTableVisible">
<div slot="title" class="customTitle">
<div class="title1">选择渠道活码</div>
<span class="h9_title">仅查询自动回复中活动类型为“无忧服务”的活码</span>
</div>
<GLTable ref="table1" max-height="500" :tableTotal="tableTotal" layout="prev, pager, next" :hasNum="false" :tableData="tableData" :tableParams="tableParams">
<div slot="qrCode" slot-scope="scope">
<el-radio v-model="activeId" :label="scope.scope.qrCode" @change="selectActived($event, scope.scope)">&nbsp;</el-radio>
</div>
<div slot="tagging" slot-scope="scope" class="tag-panel">
<el-popover trigger="hover" placement="top" v-if="scope.scope.taggingList && scope.scope.taggingList.length > 3">
<div :title="item.name" class="accountType-row accountType-row-tag" v-for="(item, index) in scope.scope.taggingList" :key="index">
{{ item ? item.name : '' }}
</div> </div>
<!-- <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> --> <div slot="reference" class="name-wrapper">
<div class="footer" :style="{ width: '100%' }"> <div v-for="(item, index) in scope.scope.taggingList" :key="index" v-show="index < 4">
<el-button type="primary" @click="handleConfirm">确定</el-button> <div :title="item.name" class="accountType-row accountType-row-tag">{{ index == 3 && scope.scope.taggingList.length > 3 ? '...(' + scope.scope.taggingList.length + ')' : item ? item.name : '' }}</div>
<!-- <el-button type="default" @click="handleCancel">取消</el-button> -->
</div> </div>
</div> </div>
</el-popover>
<template v-if="scope.scope.taggingList && scope.scope.taggingList.length <= 3 && scope.scope.taggingList.length > 0">
<div v-for="(item, index) in scope.scope.taggingList" :key="index">
<div :title="item.name" class="accountType-row accountType-row-tag">{{ item ? item.name : '' }}</div>
</div>
</template>
<div v-if="!scope.scope.taggingList || (scope.scope.taggingList && scope.scope.taggingList.length == 0)">--</div>
</div>
</GLTable>
<span slot="footer" class="dialog-footer flex_cc">
<span v-if="!tableData.length" @click="jumpToCreated" class="created_btn">创建活码</span>
<el-button size="mini" @click="dialogTableVisible = false">取消</el-button>
<el-button size="mini" type="primary" @click="toConfimActived">确定</el-button>
</span>
</el-dialog>
</div>
</template> </template>
<script> <script>
...@@ -20,15 +121,18 @@ export default { ...@@ -20,15 +121,18 @@ export default {
data() { data() {
return { return {
size: 'small', size: 'small',
isBlock: true,
title: '店面服务设置', title: '店面服务设置',
footerLeft: '0', footerLeft: '0',
footerWidth: '0', footerWidth: '0',
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
editForm: { editForm: {
hotline: '' hotline: '',
vehicleBrandId: '',
vehicleSubBrandId: ''
}, },
editRule: { editRule: {
hotline: [{ required: true, message: '请输入服务热线', trigger: 'change' }] // hotline: [{ required: true, message: '请输入服务热线', trigger: 'change' }]
}, },
editFormData: [ editFormData: [
{ {
...@@ -38,91 +142,321 @@ export default { ...@@ -38,91 +142,321 @@ export default {
type: 'input', type: 'input',
maxlength: 20 maxlength: 20
} }
],
editFormDataCar: [
{
label: '品牌',
name: 'vehicleBrandId',
addHtml: 'vehicleBrandId'
},
{
label: '',
// label: '子品牌',
name: 'vehicleSubBrandId',
addHtml: 'vehicleSubBrandId'
}
],
// 公共数据
baseData: {
carBrandOptions: [],
carChildOptions: []
},
showPage: 0,
nodataHeight: 0,
wayRadio: 1,
dialogTableVisible: false,
tabletotal: 0,
tableData: [],
tableParams: {
tableOption: false,
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '',
prop: 'qrCode',
width: '40px',
addHtml: 'qrCode'
},
{
label: '渠道名称',
prop: 'codeName'
},
{
label: '使用专员',
prop: 'staffName',
width: '130px',
},
{
label: '标签',
prop: 'tagging',
addHtml: 'tagging',
width: '150px'
},
{
label: '回复活动',
prop: 'marketingName',
formatter: (cellValue) => {
return `【${cellValue.marketingName}】`
}
}
] ]
},
activeId: '',
settingData: {}
} }
}, },
components: { components: {
glsxCombiForm glsxCombiForm
}, },
watch: {
// wayRadio(newValue, oldValue) {
// if (newValue == 2) {
// if (this.tableData.length) {
// this.tableData.forEach(item => {
// if (item.id == this.settingData.liveCodeId) {
// this.activeId = item.qrCode
// this.activeInfo = {
// codeName: item.codeName,
// id: item.id
// }
// }
// })
// }
// }
// }
},
created() {
let clientHeight = document.documentElement.clientHeight
this.nodataHeight = clientHeight * 0.8
const openStatus = localStorage.getItem('preSetStatus')
if (openStatus == 2) {
this.showPage = 2
return
}
this.showPage = 1
this.getAllVehicleBrand()
this.getCarChildList()
},
mounted() { mounted() {
this.getHotline() this.getHotline()
this.getActiveCode()
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
}, },
methods: { methods: {
getHotline() { getHotline() {
this.$apis.beforeSale.getHotlineApi({}).then(res => { this.$apis.beforeSale.getHotlineApi({}).then(res => {
this.editForm.hotline = res this.editForm.hotline = res.serviceHotline
this.wayRadio = res.codeType?res.codeType:1
this.settingData = res
})
},
getDefaultCarbrand() {
this.$apis.beforeSale.getDefaultCarbrandApi({}).then(res => {
// console.log(res)
if (res) {
this.editForm.id = res.id
this.editForm.vehicleBrandId = res.vehicleBrandId
this.editForm.vehicleSubBrandId = res.vehicleSubBrandId
this.handleChangeBrand(this.editForm.vehicleBrandId, true)
}
})
},
// 获取品牌车型
getAllVehicleBrand(fn = () => {}) {
const params = {}
this.$apis.beforeSale.getCarBrandListApi(params).then(res => {
// console.log(res)
this.baseData.carBrandOptions = res || []
})
},
handleChangeBrand(brandId, isRecovery = false) {
!isRecovery && (this.editForm.vehicleSubBrandId = '')
this.baseData.carChildOptions = brandId ? this.allCarChildList.find(item => item.id == brandId).childs : []
},
// 获取子品牌
getCarChildList(isRecovery = false) {
this.$apis.beforeSale.getCarChildListApi({}).then(res => {
this.allCarChildList = res || []
if (isRecovery) {
this.baseData.carChildOptions = this.allCarChildList.find(item => item.id == this.editForm.vehicleBrandId).childs
}
this.getDefaultCarbrand()
}) })
}, },
handleConfirm() { handleConfirm() {
if(this.wayRadio==1 || (this.activeId&&this.wayRadio==2)){
this.comfimSelect()
}
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) { if (valid) {
var params = this.$common.utils.deepClone(this.editForm) var params = this.$common.utils.deepClone(this.editForm)
this.$apis.beforeSale.updateHotlineApi(params).then(res => { Promise.all([this.$apis.beforeSale.updateHotlineApi(params), this.$apis.beforeSale.updateCarBrandApi(params)]).then(([hotlineRes, carBrandRes]) => {
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : '操作失败', message: hotlineRes.code == '0' && carBrandRes.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error' type: hotlineRes.code == '0' && carBrandRes.code == '0' ? 'success' : 'error'
})
this.getHotline()
this.getDefaultCarbrand()
})
}
})
},
// 获取活码
getActiveCode() {
let para = {
pageNum: this.dialogTableVisible ? this.$refs.table1.page.pageNum : 1,
pageSize: this.dialogTableVisible ? this.$refs.table1.page.pageSize : 10
}
this.$apis.beforeSale.activeCodeList(para).then(res => {
this.tableData = res.data
this.tableData.forEach(item => {
item.tagging = item.tagging || []
this.$set(item, 'taggingList', [])
const tagging = eval(item.tagging)
tagging.forEach(itm => {
let name = itm.name.split(',')
name.forEach((tag, index) => {
item.taggingList.push({ name: tag })
})
}) })
}) })
})
},
openActiveModal() {
if (this.wayRadio == 1) {
return
}
this.dialogTableVisible = true
},
// 列表确定活码
toConfimActived(){
this.comfimSelect()
},
comfimSelect() {
if (this.activeId == -1 && this.wayRadio == 2) {
return
}
if(!this.tableData.length&&this.dialogTableVisible){
this.dialogTableVisible = false
return
}
const { session } = this.$globalState
let para = {}
if (this.wayRadio == 1) {
para = {
merchantId: session.merchantId,
codeType: this.wayRadio
}
} else {
para = {
merchantId: session.merchantId,
liveCodeUrl: this.activeId,
codeType: this.wayRadio,
liveCodeName: this.activeInfo.codeName,
liveCodeId: this.activeInfo.id
}
} }
this.$apis.beforeSale.updateActiveCode(para).then(res => {
this.dialogTableVisible = false
this.settingData.liveCodeUrl = this.activeId
this.getHotline()
}) })
},
// 修改活码
toEditActived() {
this.tableData.forEach(item => {
if (item.id == this.settingData.liveCodeId) {
this.activeId = item.qrCode
this.activeInfo = {
codeName: item.codeName,
id: item.id
}
}
})
this.dialogTableVisible = true
},
// 选择活码
selectActived(e, item) {
this.activeInfo = item
},
// 跳转到新建活码渠道
jumpToCreated(){
this.$history.push('/drainage/channel/addCode')
},
// 选择企微
selectActivedRadio(e){
if(this.settingData.liveCodeUrl){
this.activeId = this.settingData.liveCodeUrl
this.activeInfo = {
codeName: this.settingData.liveCodeName,
id: this.settingData.liveCodeId
}
}
} }
} }
} }
</script> </script>
<style scoped> <style lang="scss" scoped>
.before-sale .container { .edit-equity {
padding: 0px 20px 20px 40px; margin-top: 17px;
width: 100%;
height: calc(100% - 108px);
min-height: 600px;
}
.edit-container {
width: 100%;
height: 100%;
background: #ffffff; background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1); box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
} }
.edit-container /deep/ .el-form--inline .el-form-item {
.before-sale .edit-container { margin-right: 10px;
margin-bottom: 84px; }
/* .before-sale .edit-equity{
height: 100vh;
}
.before-sale .container {
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
} }
.before-sale .edit-form-container { .before-sale .edit-form-container {
margin-top: 20px; margin-top: 20px;
} } */
.before-sale .txt-center {
text-align: center;
}
.before-sale .footer { /* .before-sale .footer {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
height: 64px; height: 64px;
/* left: 220px; */
text-align: center; text-align: center;
line-height: 64px; line-height: 64px;
background: #ffffff; background: #ffffff;
z-index: 999; z-index: 999;
} } */
.before-sale .flex { /* .before-sale .flex {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.before-sale .flex-grow { .before-sale .flex-grow {
flex: 1; flex: 1;
} } */
.before-sale .edit-title { .edit-title {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: 600;
height: 48px; border-bottom: 1px solid #e7eaec;
line-height: 48px; padding: 15px 20px;
border-bottom: 1px solid #E7EAEC; margin-bottom: 32px;
margin: 0 0;
} }
.before-sale .edit-sub-title { /* .before-sale .edit-sub-title {
position: relative; position: relative;
font-size: 13px; font-size: 13px;
font-weight: 700; font-weight: 700;
...@@ -132,21 +466,197 @@ export default { ...@@ -132,21 +466,197 @@ export default {
margin-bottom: 20px; margin-bottom: 20px;
padding-left: 8px; padding-left: 8px;
background-color: rgba(242, 242, 242, 1); background-color: rgba(242, 242, 242, 1);
} } */
.before-sale .message-Z-zinde { /* .before-sale .message-Z-zinde {
z-index: 3000 !important; z-index: 3000 !important;
} } */
.before-sale .txt-red { /* .before-sale .txt-red {
color: red; color: red;
} } */
.one-line-ellipsis { /* .one-line-ellipsis {
display: -webkit-box; display: -webkit-box;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
-webkit-line-clamp: 1; -webkit-line-clamp: 1;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} */
.new_container {
box-sizing: border-box;
padding-left: 76px;
margin-top: 36px;
.title {
// width: 594px;
height: 22px;
font-size: 16px;
font-weight: 500;
color: #333333;
line-height: 22px;
margin-bottom: 16px;
}
.point_title {
display: flex;
align-items: center;
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 20px;
.point_icon {
width: 5px;
height: 5px;
background: #5850ff;
border-radius: 50%;
margin-right: 4px;
}
}
.radio_wrap {
margin-top: 28px;
display: flex;
.box {
margin-right: 122px;
.radio_panel {
margin-top: 10px;
width: 88px;
height: 88px;
border-radius: 2px;
border: 1px solid #dbdbdb;
> img {
width: 88px;
height: 88px;
}
.opcaSty {
opacity: 0.2;
}
}
.radio_tip {
font-size: 12px;
font-weight: 400;
color: #333333;
line-height: 17px;
margin: 4px 0;
}
.radio_edit {
font-size: 12px;
font-weight: 400;
color: #5850ff;
line-height: 17px;
cursor: pointer;
}
.custom_blue {
margin-top: 10px;
width: 96px;
background: #ffffff;
color: #5850ff;
border: 1px solid #5850ff;
}
}
}
}
.fixed_bottom {
position: fixed;
width: 100%;
bottom: 0px;
height: 78px;
display: flex;
align-items: center;
justify-content: center;
background: #ffffff;
z-index: 999;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
.nodata_widget {
margin-top: 17px;
.wrapper {
width: 100%;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
.nodata_tip_1 {
font-size: 18px;
font-weight: 500;
color: #3a3a3a;
margin-top: 48px;
}
.nodata_tip_2 {
font-size: 14px;
font-weight: 400;
color: #3a3a3a;
margin-top: 9px;
}
}
}
.customTitle {
display: flex;
align-items: center;
.title1 {
font-size: 20px;
font-weight: 600;
color: #333333;
line-height: 28px;
margin-right: 8px;
}
}
.accountType-row {
text-align: left;
position: relative;
font-size: 14px;
line-height: 14px;
padding-left: 15px;
border-radius: 4px;
border: 1px solid #e8e8ea;
padding: 6px;
display: inline-block;
margin-bottom: 5px;
margin-right: 5px;
&-tag {
display: inline-block;
border: 1px solid #e8e8ea;
background: #fafbfe;
text-align: center;
font-size: 14px;
font-weight: 400;
color: #666;
max-width: 150px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
i {
color: #75acff;
}
// &::before {
// content: '';
// position: absolute;
// width: 6px;
// height: 6px;
// background: #5850ff;
// border-radius: 8px;
// left: 0px;
// top: 7px;
// }
}
.dialog-footer{
position: relative;
.created_btn{
position: absolute;
left: 0px;
height: 50%;
transform: translate(0,-50%);
cursor: pointer;
font-size: 16px;
font-weight: 600;
text-decoration: underline;
color: #5850ff;
line-height: 26px;
}
}
.edit-equity /deep/ .el-dialog__body {
height: 520px;
} }
</style> </style>
<!-- 编辑权益 -->
<template>
<div class="before-sale edit-equity edit-order">
<div style="padding: 17px 0 55px;">
<!-- <div class="help-service">
<img class="service-img" src="./image/code.png" />
<p>提单及服务咨询</p>
<p class="service-hotline">服务热线</p>
<p class="service-phone">18938907441</p>
</div> -->
<div class="container">
<p class="edit-title">车辆信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRefCar" labelWidth="144px" defaultWidth="320px" formRef="editChildRefCar" :formObj.sync="editForm.vehicle" :formData="editFormDataCar.slice(0, 7)" :formRules="editRuleCar">
</glsx-combi-form>
<glsx-combi-form ref="editFormRefBrand" labelWidth="144px" defaultWidth="215px" formRef="editChildRefBrand" :formObj.sync="editForm.vehicle" :formData="editFormDataCar.slice(7)" :formRules="editRuleCar">
<template slot="vehicleBrandId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleBrandId" placeholder="请选择品牌" filterable @change="handleChangeBrand(editForm.vehicle.vehicleBrandId)" style="width:144px;" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carBrandOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
<template slot="vehicleSubBrandId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleSubBrandId" placeholder="请选择子品牌" filterable @change="getCarSeriesList()" style="width:144px;" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carChildOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
<template slot="vehicleSeriesId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleSeriesId" filterable placeholder="请选择车系" @change="getCarTypeList(editForm.vehicle.vehicleSeriesId)" style="width:215px;" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carSeriesOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
<template slot="vehicleShapeId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleShapeId" filterable placeholder="请选择车型" style="width:215px;" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carTypeOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
</glsx-combi-form>
</div>
<div class="container">
<p class="edit-title">客户信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRefUser" labelWidth="144px" defaultWidth="320px" formRef="editChildRefUser" :formObj="editForm" :formData="editFormDataUser" :formRules="editRuleUser"></glsx-combi-form>
</div>
<div class="container select-product">
<p class="edit-title">选择产品</p>
<!-- <glsx-combi-form class="edit-form-container" ref="editFormRefPro" labelWidth="144px" formRef="editChildRefPro" :formObj="editForm" :formData="editFormDataPro" :formRules="editRulePro"> -->
<glsx-combi-form class="edit-form-container" labelWidth="144px" defaultWidth="320px" :formObj="editForm" :formData="editFormDataPro">
<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 class="package-code" v-for="subItem in scope.scope.optionList" :key="subItem[scope.scope.optionId]" :label="subItem[scope.scope.optionId]">
<span class="package-title">{{ subItem[scope.scope.optionLabel] }}</span>
<div class="radio-add-block" @click.stop.prevent="e => handleCancelBubble(e)">
<p class="package-subtitle">{{ subItem.serviceItems }}</p>
<div class="sub-el-form" v-if="editForm.packageCode == subItem[scope.scope.optionId]">
<glsx-combi-form class="edit-form-container" ref="editFormRefPro" labelWidth="160px" defaultWidth="320px" formRef="editChildRefPro" :isBlock="isBlock" :formObj="editFormPro" :formData="subItem.editFormData" :formRules="editRulePro">
<template slot="table" slot-scope="scope">
<table style="marginLeft: 160px" class="table-style">
<tbody>
<tr>
<td v-for="(m, n) in scope.scope.attributeList" :key="n" :style="{ width: 100 / scope.scope.attributeList.length + '%' }">{{ m.attributeDesc }}</td>
</tr>
<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 + '%' }">
<el-input :disabled="i.isDisabled" :class="{ 'border-red': !editFormPro[i.name] }" placeholder="请输入" v-model="editFormPro[i.name]" :maxlength="i.maxlength">
<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>
</el-popover>
</el-input>
</td>
</tr>
</tbody>
</table>
</template>
</glsx-combi-form>
</div>
</div>
</el-radio>
</el-radio-group>
</template>
</glsx-combi-form>
</div>
<div class="container">
<p class="edit-title">其他信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRefOther" labelWidth="144px" defaultWidth="320px" formRef="editChildRefOther" :formObj="editForm" :formData="editFormDataOther" :formRules="editRuleOther"></glsx-combi-form>
</div>
</div>
<!-- <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> -->
<div class="footer operate-btn">
<el-button size="small" class="reset-btn" v-show="routeInfo.addOrEdit == '1'" @click="handleReset">重置</el-button>
<el-button size="small" v-show="!['3', '5'].includes(routeInfo.addOrEdit)" class="plain" @click="handleDraft">草稿</el-button>
<el-button size="small" v-show="routeInfo.addOrEdit != '5'" type="primary" @click="handleConfirm">{{routeInfo.addOrEdit != '3' ? '提单' : '确定'}}</el-button>
<el-button v-if="routeInfo.addOrEdit != 5" size="small" @click="handleCancel">返回</el-button>
<el-button v-else size="small" type="primary" @click="handleCancel">返回</el-button>
</div>
<qrCode :bottom="320" :codeUrl="qrcodUrl" phoneTitle="提单及服务咨询" phone="189 3890 7441"></qrCode>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import { limitPrice } from '@/common/constant'
import glsxCombiForm from '@/components/glsx-combi-form'
import qrCode from '../../components/qr-code/index.vue'
import utils from '../../util/util'
export default {
name: 'editEquity',
data() {
return {
qrcodUrl: 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/preSale_qrCode.png' + '?time=' + new Date(),
size: 'small',
submit: false,
isBlock: true,
// title: '新增权益',
// titleObj: {
// 1: '新增权益',
// 2: '编辑权益',
// 3: '查看权益'
// },
// footerLeft: '0',
// footerWidth: '0',
editCarChildRef: 'editChildRef',
disabled: false,
successDisable: false,
routeInfo: {
// 1-新增;2-编辑;3-修改;4-重新提单;5-查看
addOrEdit: '1',
contractNo: ''
},
defaultBrandForm: {
vehicleBrandId: '',
vehicleSubBrandId: ''
},
editForm: {
packageCode: '',
suggestedSellingPrice: '',
actualSalesPrice: '',
servicePeriod: 1,
effectiveDate: new Date(new Date().setDate(new Date().getDate() + 1)),
customerType: 1,
cardType: 1,
vehicle: {
vehicleBrandId: '',
vehicleSubBrandId: '',
vehicleSeriesId: '',
vehicleShapeId: '',
// licensing: '',
invoicePrice: '',
seatesNum: 5,
billingDate: new Date()
},
actualSalesPerson:'',
actualSalesPersonId:'',
insuranceType: 'i'
},
// 车辆信息
editRuleCar: {
// licensing: [{ required: true, message: '请选择是否上牌', trigger: 'change' }],
licensePlate: [{
validator: (rule, value, callback) => {
return value ? ((/.{7,8}/).test(value) ? callback() : callback(new Error('请输入7位或8位车牌号码'))) : callback()
}, trigger: 'change'
}],
vin: [{ required: true, message: '请输入车架号', trigger: 'change' },
{
validator: (rule, value, callback) => {
return (/^[a-zA-Z0-9]{17}$/).test(value) ? callback() : callback(new Error('请输入17位数字和字母'))
}, trigger: 'change'
}],
engineNo: [{ required: true, message: '请输入发动机号', trigger: 'change' },
{
validator: (rule, value, callback) => {
return (/^[a-zA-Z0-9]{6,16}$/).test(value) ? callback() : callback(new Error('请输入6-16位数字和字母组合'))
}, trigger: 'change'
}],
invoicePrice: [{ 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' }],
seatesNum: [{ required: true, message: '请选择座位数', trigger: 'change' }]
},
editFormDataCar: [
{
label: '车牌号码',
name: 'licensePlate',
type: 'input',
maxlength: 8
},
{
label: '车架号',
name: 'vin',
type: 'input',
maxlength: 17
},
{
label: '发动机号',
name: 'engineNo',
type: 'input',
maxlength: 16
},
{
label: '发票价格',
name: 'invoicePrice',
type: 'input',
append: '元',
maxlength: 11,
inputBlur: () => {
this.packageToPrice()
}
},
{
label: '车身颜色',
name: 'vehicleColor',
type: 'input',
maxlength: 5
},
{
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'
},
{
label: '品牌车型',
name: 'vehicleBrandId',
addHtml: 'vehicleBrandId'
},
{
label: '',
// label: '子品牌',
name: 'vehicleSubBrandId',
addHtml: 'vehicleSubBrandId'
},
{
label: '',
// label: '品牌车系',
name: 'vehicleSeriesId',
addHtml: 'vehicleSeriesId'
},
{
label: '',
// label: '品牌车型',
name: 'vehicleShapeId',
addHtml: 'vehicleShapeId'
}
],
// 客户信息
editRuleUser: {
customerType: [{ required: true, message: '请选择客户类型', trigger: 'change' }],
customerName: [{ required: true, message: '请输入客户姓名', trigger: 'change' }],
cardType: [{ required: true, message: '请选择证件类型', trigger: 'change' }],
cardNo: [{
required: true,
validator: (rule, value, callback) => {
return value ? callback() : callback(new Error('请输入' + (this.editForm.cardType == '1' ? '身份证' : '统一社会信息代码')))
}, trigger: 'change'
},
{
validator: (rule, value, callback) => {
return (/[a-zA-Z0-9]{18}/).test(value) ? callback() : callback(new Error('请输入18位数字或字母'))
}, trigger: 'change'
}],
customerPhone: [{ required: true, message: '请输入联系号码', trigger: 'change' },
{
validator: (rule, value, callback) => {
let phoneReg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/;
return phoneReg.test(value) ? callback() : callback(new Error('请输入正确的联系号码'))
}, trigger: 'change'
}],
customerAddress: [{ required: true, message: '请输入联系地址', trigger: 'change' }]
},
editFormDataUser: [
{
label: '客户类型',
name: 'customerType',
type: 'select',
noFilter: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'customerTypeList',
changeAttr: (value, targetItem) => {
this.editForm.cardType = value
var idx = this.editFormDataUser.findIndex(item => item.name == 'cardNo')
this.editFormDataUser[idx].label = this.baseData.cardTypeList.find(item => item.confId == value).confName
}
},
{
label: '客户姓名',
name: 'customerName',
type: 'input',
maxlength: 100
},
{
label: '证件类型',
name: 'cardType',
type: 'select',
noFilter: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'cardTypeList',
isDisabled: true
},
{
label: '身份证',
name: 'cardNo',
type: 'input',
maxlength: 18
},
{
label: '联系号码',
name: 'customerPhone',
type: 'input',
maxlength: 11
},
{
label: '联系地址',
name: 'customerAddress',
type: 'input',
maxlength: 100
}
],
// 选择产品
packageList: [],
editRulePro: {},
editFormPro: {},
editFormDataPro: [
{
label: '',
name: 'packageCode',
optionList: [],
optionId: 'packageCode',
optionLabel: 'packageName',
addHtml: 'packageCode',
handleRadioChange: val => {
this.packageAttr()
}
}
],
// 其他信息
editRuleOther: {
suggestedSellingPrice: [{ required: true, message: '请输入建议销售价', trigger: 'change' }],
actualSalesPrice: [
{ required: true, message: '请输入实际销售价', trigger: 'change' },
{
validator: (rule, value, callback) => {
return +this.editForm.suggestedSellingPrice > +value ? callback(new Error('输入价格有误')) : callback()
},
trigger: 'change'
}
],
servicePeriod: [{ required: true, message: '请选择服务期限', trigger: 'change' }],
effectiveDate: [{ required: true, message: '请选择生效日期', trigger: 'change' }],
actualSalesPersonId: [{ required: true, message: '请输入实际销售人', trigger: 'change' }]
},
editFormDataOther: [
{
label: '建议销售价',
name: 'suggestedSellingPrice',
type: 'input',
append: '元',
isDisabled: true,
maxlength: 11
},
{
label: '实际销售价',
name: 'actualSalesPrice',
type: 'input',
append: '元',
maxlength: 11
},
{
label: '服务期限',
name: 'servicePeriod',
type: 'select',
noFilter: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'servicePeriodList'
},
{
label: '生效日期',
name: 'effectiveDate',
type: 'datePicker',
dateType: 'date',
valueFormat: 'yyyy-MM-dd',
pickerOptions: 'afterTodayRangePickerOptions',
customPickerOptions: {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
if (date < yesterday) {
return true
}
return false
}
}
},
{
label: '实际销售人员',
name: 'actualSalesPersonId',
type: 'select',
noFilter: false,
isRemote: true,
optionList: [],
optionId: 'userOneid',
optionLabel: 'staffName',
changeAttr: (userOneid,targetItem)=>{
const target = targetItem.optionList.find(item => {
return item.userOneid == userOneid
})
this.editForm.actualSalesPerson = target.staffName
}
},
{
label: '首续保',
name: 'insuranceType',
type: 'radio',
optionList: [
{
confLabel:'无忧卡首保',
confId:'i'
},
{
confLabel:'无忧卡续保',
confId:'c'
}
],
optionId: 'confId',
optionLabel: 'confLabel',
isDisabled: false
}
],
// 公共数据
baseData: {
seatesNumList: [
{
confId: 1,
confName: '1'
},
{
confId: 2,
confName: '2'
},
{
confId: 3,
confName: '3'
},
{
confId: 4,
confName: '4'
},
{
confId: 5,
confName: '5'
},
{
confId: 6,
confName: '6'
},
{
confId: 7,
confName: '7'
}
],
customerTypeList: [
{
confId: 1,
confName: '个人'
},
{
confId: 2,
confName: '企业'
}
],
cardTypeList: [
{
confId: 1,
confName: '身份证'
},
{
confId: 2,
confName: '统一社会信息代码'
}
],
servicePeriodList: [
{
confId: 1,
confName: '1年'
}
],
carBrandOptions: [],
carChildOptions: [],
carSeriesOptions: [],
carTypeOptions: []
},
allCarChildList: []
}
},
watch: {
'editForm.vehicle.invoicePrice'(newValue, oldValue) {
this.editForm.vehicle.invoicePrice = limitPrice(newValue, oldValue, 7, 2, 0, 2000000)
},
'editForm.actualSalesPrice'(newValue, oldValue) {
this.editForm.actualSalesPrice = limitPrice(newValue, oldValue, 7, 2)
},
'editFormPro.additional_price'(newValue, oldValue) {
this.editFormPro.additional_price = limitPrice(newValue, oldValue, 6, 2)
}
},
components: {
glsxCombiForm,
qrCode
},
created() {
this.getAllVehicleBrand()
this.getCarChildList(false, true)
this.getSalePeople()
},
mounted() {
// this.footerLeft = document.querySelector('.base-container-right').offsetLeft
// this.footerWidth = document.documentElement.clientWidth - this.footerLeft
// this.routeInfo = this.$route.params
const urlParam = this.$route.params
this.routeInfo = JSON.parse(decodeURIComponent(urlParam.id))
//为了兼容迁移过来的代码,addOrEdit需要处理为字符串
this.routeInfo.addOrEdit = `${this.routeInfo.addOrEdit}`
this.disabled = this.routeInfo.addOrEdit == '5'
// 提单成功 - 修改
if (!this.routeInfo.isSuper) {
this.successDisable = this.routeInfo.addOrEdit == '3'
}
this.getOptionsList('editFormDataCar', false)
this.getOptionsList('editFormDataUser', 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.getPackageList()
},
methods: {
getSalePeople(val){
const params = {
staffName: val ? val.trim() : ''
// departmentId: ''
}
this.$apis.ghBeforeSale.getSalesPersonApi(params).then(res => {
if(res.code==='0') {
const id = this.editFormDataOther.findIndex((item)=>{
return item.name == 'actualSalesPersonId'
})
this.$nextTick(() =>{
this.editFormDataOther[id].optionList = res.data
})
}
})
},
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
}
}
})
}
},
handleCancelBubble(e) { },
getDefaultCarbrand() {
this.$apis.ghBeforeSale.getDefaultCarbrandApi({}).then(res => {
// 获取套餐列表
this.getPackageList()
if (res) {
this.defaultBrandForm.vehicleBrandId = res.vehicleBrandId
this.defaultBrandForm.vehicleSubBrandId = res.vehicleSubBrandId
if (this.routeInfo.addOrEdit == '1') {
this.editForm.vehicle.vehicleBrandId = res.vehicleBrandId
this.editForm.vehicle.vehicleSubBrandId = res.vehicleSubBrandId
if (this.editForm.vehicle.vehicleBrandId) {
this.baseData.carChildOptions = this.allCarChildList.find(item => item.id == this.editForm.vehicle.vehicleBrandId).childs
}
if (this.editForm.vehicle.vehicleSubBrandId) {
this.getCarSeriesList(true)
}
}
}
})
},
getInfo() {
this.$apis.ghBeforeSale.getEquityApi({ contractNo: this.routeInfo.contractNo }).then(res => {
if(this.routeInfo.isSuper){ //超管不能修改以及不能获取到全部员工的列表
const id = this.editFormDataOther.findIndex((item)=>{
return item.name == 'actualSalesPersonId'
})
this.editFormDataOther[id].optionList = [{userOneid: res?.actualSalesPersonId ,staffName: res?.actualSalesPerson}]
this.editFormDataOther[id].isDisabled = true
}
this.editForm = {
...res
}
// 格式化价格
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)
}
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 : ''
}
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)) {
this.editForm.vehicle.vehicleBrandId = this.editForm.vehicle.vehicleBrandId || this.defaultBrandForm.vehicleBrandId
this.editForm.vehicle.vehicleSubBrandId = this.editForm.vehicle.vehicleSubBrandId || this.defaultBrandForm.vehicleSubBrandId
}
if (this.editForm.vehicle.vehicleBrandId) {
this.getCarChildList(true)
}
if (this.editForm.vehicle.vehicleSubBrandId) {
this.getCarSeriesList(true)
}
if (this.editForm.vehicle.vehicleSeriesId) {
this.getCarTypeList(true)
}
if (this.editForm.customerType) {
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)) {
this.editForm.effectiveDate = new Date(new Date().setDate(new Date().getDate() + 1))
}
this.editForm.packageCode && this.packageAttr(true)
})
},
getPackageList() {
this.$apis.ghBeforeSale.getPackageListApi({}).then(res => {
this.packageList = res
this.autoGenerate()
})
},
// 改建议价,实际销售价
packageToPrice(recovery = false) {
var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode)
this.editForm.suggestedSellingPrice = ''
if (this.editForm.vehicle.invoicePrice) {
var invoicePrice = (this.editForm.vehicle.invoicePrice * 100).toFixed(2)
targetItem && targetItem.servicePackagePrices.forEach(item => {
if (+invoicePrice >= +item.carButtomPrice && +invoicePrice < +item.carHighestPrice) {
this.editForm.suggestedSellingPrice = (item.retailPrice / 100).toFixed(2)
this.editForm.actualSalesPrice = recovery ? (this.editForm.actualSalesPrice || (item.retailPrice / 100).toFixed(2)) : (item.retailPrice / 100).toFixed(2)
}
})
}
},
// 舒享版只能续保,'尊享版', '优享版'只能首保
setInsuranceType(targetItem){
const targetNameList = ['尊享版', '优享版', '舒享版']
if(targetNameList.includes(targetItem.packageName)){
if(targetItem.packageName==='舒享版'){
this.editForm.insuranceType = 'c'
}else{
this.editForm.insuranceType = 'i'
}
const id = this.editFormDataOther.findIndex((item)=>{
return item.name == 'insuranceType'
})
this.editFormDataOther[id].isDisabled = true
}
},
packageAttr(recovery = false) {
var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode)
this.setInsuranceType(targetItem)
this.packageToPrice(recovery)
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 && 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)
})
},
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() : ''
},
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] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
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)
}
}
}
})
}
},
// 获取品牌车型
getAllVehicleBrand(fn = () => { }) {
const params = {}
this.$apis.ghBeforeSale.getCarBrandListApi(params).then(res => {
this.baseData.carBrandOptions = res || []
})
},
handleChangeBrand(brandId, isRecovery = false) {
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(isRecovery = false, isDefault = false) {
this.$apis.ghBeforeSale.getCarChildListApi({}).then(res => {
this.allCarChildList = res || []
if (isRecovery) {
this.baseData.carChildOptions = this.allCarChildList.find(item => item.id == this.editForm.vehicle.vehicleBrandId).childs
}
isDefault && this.getDefaultCarbrand()
})
},
// 获取车系
getCarSeriesList(isRecovery = false) {
if (!isRecovery) {
this.editForm.vehicle.vehicleSeriesId = ''
this.editForm.vehicle.vehicleShapeId = ''
this.baseData.carSeriesOptions = []
this.baseData.carTypeOptions = []
}
const params = {
brandId: this.editForm.vehicle.vehicleBrandId,
childBrandId: this.editForm.vehicle.vehicleSubBrandId
}
this.$apis.ghBeforeSale.getCarSeriesListApi(params).then(res => {
this.baseData.carSeriesOptions = res || []
})
},
// 获取车型
getCarTypeList(isRecovery = false) {
if (!isRecovery) {
this.editForm.vehicle.vehicleShapeId = ''
this.baseData.carTypeOptions = []
}
const params = {
carSeriesId: this.editForm.vehicle.vehicleSeriesId
}
this.$apis.ghBeforeSale.getCarTypeListApi(params).then(res => {
this.baseData.carTypeOptions = res || []
})
},
// 跳转
whereToGo(id) {
document.getElementById(id).scrollIntoView()
},
getParams() {
var params = this.$common.utils.deepClone(this.editForm)
// 格式化价格
if (this.editForm.vehicle.invoicePrice) {
params.vehicle.invoicePrice = (this.editForm.vehicle.invoicePrice * 100).toFixed(0)
}
if (this.editForm.suggestedSellingPrice) {
params.suggestedSellingPrice = (this.editForm.suggestedSellingPrice * 100).toFixed(0)
}
if (this.editForm.actualSalesPrice) {
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.vehicleShapeName = this.baseData.carTypeOptions.find(item => item.id == this.editForm.vehicle.vehicleShapeId).name
}
if (this.editForm.vehicle.billingDate) {
params.vehicle.billingDate = dayjs(this.editForm.vehicle.billingDate).format('YYYY-MM-DD')
}
if (this.editForm.effectiveDate) {
params.effectiveDate = dayjs(this.editForm.effectiveDate).format('YYYY-MM-DD')
}
var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode)
params.attributeList = []
if (targetItem) {
targetItem.groupAttributeList.forEach(item => {
if (item.attributeList.length == 1) {
let targetAttributeValue = ''
if(item.attributeList[0].attributeGroup == 'additional_price'){
targetAttributeValue = this.editFormPro[item.attributeList[0].attributeGroup] ? (this.editFormPro[item.attributeList[0].attributeGroup] * 100).toFixed(0) : ''
}else if(item.attributeList[0].attributeGroup == 'additional_date'){
targetAttributeValue = this.editFormPro[item.attributeList[0].attributeGroup] ? utils.dateFormat(this.editFormPro[item.attributeList[0].attributeGroup]) : ''
}else{
targetAttributeValue = this.editFormPro[item.attributeList[0].attributeGroup] ? this.editFormPro[item.attributeList[0].attributeGroup] : ''
}
params.attributeList.push({
// attributeValue: item.attributeList[0].attributeGroup == 'additional_price' ? (this.editFormPro[item.attributeList[0].attributeGroup] ? (this.editFormPro[item.attributeList[0].attributeGroup] * 100).toFixed(0) : '') : this.editFormPro[item.attributeList[0].attributeGroup],
attributeValue: targetAttributeValue,
attributeGroup: item.attributeList[0].attributeGroup,
attributeName: item.attributeList[0].attributeName,
sort: 0
})
} else {
// var tableList = []
item.attributeList.forEach((j, index) => {
for (var i = 0; i < item.num; i++) {
params.attributeList.push({
attributeValue: this.editFormPro[j.attributeName + i],
attributeGroup: j.attributeGroup,
attributeName: j.attributeName,
sort: i
})
}
})
}
})
}
return params
},
handleDraft() {
if (this.submit) {
return true
}
if (!this.editForm.customerName) {
this.$refs.editFormRefUser.$refs.editChildRefUser.validateField('customerName')
this.whereToGo('customerName')
return true
}
this.submit = true
var params = this.getParams()
params.operationType = 0
if (this.routeInfo.addOrEdit == '2') {
params.contractNo = this.routeInfo.contractNo
} else {
params.contractNo = ''
}
this.updateEquity(params)
},
updateEquity(params) {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
this.$apis.ghBeforeSale.updateEquityApi(params).then(res => {
loading.close();
this.submit = false
if (res.errId == 'A1307') {
this.whereToGo('vin')
this.$message({
message: res.message,
type: 'error'
})
} else {
this.$router.push({
path: '/ghPreSale/equityList',
// name: 'beforeSale',
params: res
})
}
})
},
handleConfirm() {
if (this.submit) {
return true
}
this.submit = true
var list = ['Car', 'Brand', 'User', 'Pro', 'Other']
var flag = true
var errorObjList = []
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]]
pRef.$refs['editChildRef' + list[i]].validate((valid, errorObj) => {
!valid && errorObjList.push(errorObj)
flag && (flag = valid)
})
}
}
if (!flag) {
this.whereToGo(Object.keys(errorObjList[0])[0])
this.submit = false
return true
}
var params = this.getParams()
params.operationType = 1
if (['2', '3', '4'].includes(this.routeInfo.addOrEdit)) {
if (this.routeInfo.addOrEdit == '4' && this.editForm.orderStatus != 3) {
params.contractNo = ''
params.oldContractNo = this.routeInfo.contractNo
} else {
params.contractNo = this.routeInfo.contractNo
}
} else {
params.contractNo = ''
}
this.$apis.ghBeforeSale.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 = {
packageCode: '',
suggestedSellingPrice: '',
actualSalesPrice: '',
servicePeriod: 1,
effectiveDate: new Date(new Date().setDate(new Date().getDate() + 1)),
customerType: 1,
cardType: 1,
vehicle: {
vehicleBrandId: '',
vehicleSubBrandId: '',
vehicleSeriesId: '',
vehicleShapeId: '',
// licensing: '',
invoicePrice: '',
seatesNum: 5,
billingDate: new Date()
},
actualSalesPerson:'',
actualSalesPersonId:'',
insuranceType: 'i'
}
this.$apis.ghBeforeSale.getDefaultCarbrandApi({}).then(res => {
if (res) {
this.defaultBrandForm.vehicleBrandId = res.vehicleBrandId
this.defaultBrandForm.vehicleSubBrandId = res.vehicleSubBrandId
// if(this.routeInfo.addOrEdit == '1') {
this.editForm.vehicle.vehicleBrandId = res.vehicleBrandId
this.editForm.vehicle.vehicleSubBrandId = res.vehicleSubBrandId
if (this.editForm.vehicle.vehicleBrandId) {
this.baseData.carChildOptions = this.allCarChildList.find(item => item.id == this.editForm.vehicle.vehicleBrandId).childs
}
if (this.editForm.vehicle.vehicleSubBrandId) {
this.getCarSeriesList(true)
}
}
// }
})
},
handleCancel() {
if (this.submit) {
return true
}
this.$router.push({
path: '/ghPreSale/equityList'
})
}
}
}
</script>
<style lang="scss" scoped>
/* 客服 - start */
.before-sale .help-service {
position: fixed;
z-index: 9999;
font-size: 14px;
color: #333333;
top: 10%;
right: 10px;
width: 144px;
height: 268px;
text-align: center;
background: #ffffff;
border: 1px solid rgba(220, 223, 230, 0.5);
box-shadow: 0px 3px 6px -4px rgba(0, 0, 0, 0.12);
}
.edit-order{
padding-top: 0!important;
height:100%;
overflow-y:auto;
}
.help-service .service-img {
width: 124px;
height: 124px;
margin: 16px 0;
}
.help-service p {
margin: 0;
}
.help-service .service-hotline {
margin: 16px 0 5px;
font-size: 16px;
font-weight: bold;
}
.help-service .service-phone {
color: #5850ff;
}
/* 客服 - end */
.edit-order .container {
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 0!important;
margin-bottom: 10px;
}
.before-sale .edit-container {
margin-bottom: 84px;
}
.before-sale .txt-center {
text-align: center;
}
.before-sale .footer {
width: 100%;
position: absolute;
bottom: 0;
height: 64px;
left: 0;
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 999;
}
/* .operate-btn .el-button{
width: 88px;
margin-left: 20px;
} */
.before-sale .edit-form-container {
margin-top: 20px;
}
.before-sale .flex {
display: flex;
justify-content: space-between;
}
.before-sale .flex-grow {
flex: 1;
}
.edit-order .edit-title {
padding: 0 20px;
font-size: 16px;
font-weight: bold;
height: 58px;
line-height: 58px;
border-bottom: 1px solid #e7eaec;
margin: 0 0;
}
.before-sale .edit-sub-title {
position: relative;
font-size: 13px;
font-weight: 700;
height: 32px;
line-height: 32px;
color: #333333;
margin-bottom: 20px;
padding-left: 8px;
background-color: rgba(242, 242, 242, 1);
}
.before-sale .message-Z-zinde {
z-index: 3000 !important;
}
.before-sale .txt-red {
color: red;
}
.one-line-ellipsis {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
/* 选择套餐产品 */
.before-sale .package-code {
display: block;
margin-bottom: 20px;
}
/deep/ .select-product{
.package-code>.el-radio__input{
margin-left: 73px;
}
.package-code>.el-radio__label>.radio-add-block>.package-subtitle{
margin-left: 76px;
}
}
.select-product .el-radio__label{
padding-left: 7px;
}
.select-product .package-title{
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 600;
}
.select-product .package-subtitle{
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
white-space: normal;
line-height: 20px;
padding-left: 20px;
}
.before-sale .package-code-box ::v-deep .el-radio__label {
width: 100% !important;
text-overflow: ellipsis;
white-space: normal;
line-height: 18px;
}
.before-sale .package-code-box .radio-add-block {
color: #606266;
}
/deep/ .no-label.el-form-item--small .el-form-item__content {
width: auto;
}
/* 表格 */
/* .edit-equity .spesc-label {
padding: 1px 10px;
box-sizing: border-box;
width: 110px;
color: #666;
text-align: right;
padding-right: 12px;
} */
.edit-equity .table-style {
width: 600px;
text-align: center;
margin-bottom: 0;
}
.edit-equity .table-style tbody tr {
border: 1px solid #e7e7e7;
/* border-bottom: 1px solid rgb(235, 235, 235); */
}
.edit-equity .table-style tbody td {
display: inline-block;
box-sizing: border-box;
border: none;
padding: 2px 6px;
vertical-align: center;
text-align: center;
}
.edit-equity .table-style .el-input--small .el-input__inner {
text-align: center !important;
}
/* .edit-equity .w-320 {
width: 320px;
} */
.edit-equity .table-style .el-input--small.border-red .el-input__inner {
border: 1px solid #eb4e4e;
}
.color-red {
color: #eb4e4e;
cursor: pointer;
}
.plain{
border: 1px solid #5850ff;
color: #5850ff;
}
.reset-btn{
border: 1px solid #909090;
color: #333333;
}
.sub-el-form{
margin-left: 50px;
}
/* 表格 */
</style>
<!-- 权益订单列表 -->
<template>
<div class="before-sale" :class="{noPaddngTop:showPage==2}">
<template v-if="showPage==2">
<introduct></introduct>
</template>
<template v-if="showPage==1">
<div class="add-benefit">
<!-- <el-button fn="新增权益" :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新增权益</el-button> -->
<GLButton :size="size" fn="新增权益" icon="el-icon-plus" type="primary" @click="handleEdit(1)">新增权益</GLButton>
<div class="top-tips"><span class="el-icon-warning"></span>请注意:订单列表还有{{countNoData}}单未上传客户凭证等资料,若发生事故无法获得补偿,请尽快在列表操作-上传资料中完善。</div>
</div>
<div class="container">
<div class="number">
<glsx-combi-form ref="showSearch" labelWidth="100px" defaultWidth="210px" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData">
<span slot="footer" class="footer-btns">
<el-button :size="size" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleExport">导出</el-button>
</span>
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="equityRef" :pageSizes="sizeList" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="table-btns" slot-scope="scope">
<GLButton v-if="[2, 4, 5,7,8,9,10,11].includes(scope.scope.orderStatus)" fn="查看" type="text" @click="handleEdit(5, scope.scope)">查看</GLButton>
<!-- <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,8,10,11].includes(scope.scope.orderStatus)" type="text" @click="handlePdf(scope.scope)">打印</el-button>
<el-button v-if="[2,8,10,11].includes(scope.scope.orderStatus)" style="position: relative;" type="text" @click="handleUpload(scope.scope)">上传资料<span v-show="scope.scope.dataPerfection == 0" class="circule-tips"></span></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> -->
<GLButton v-if="[0].includes(scope.scope.orderStatus)" fn="编辑" type="text" @click="handleEdit(2, scope.scope)">编辑</GLButton>
<GLButton v-if="[2,8,10,11].includes(scope.scope.orderStatus)&&(!scope.scope.hasPrint)" fn="修改" type="text" @click="handleEdit(3, scope.scope)">修改</GLButton>
<el-button v-if="[2,8,10,11].includes(scope.scope.orderStatus)" type="text" @click="handleBack(scope.scope)">退单</el-button>
<GLButton v-if="[1,3, 4, 5].includes(scope.scope.orderStatus)" fn="重新提单" type="text" @click="handleEdit(4, scope.scope)">重新提单</GLButton>
<el-button v-if="userInfo.admin" type="text" @click="showFailModal(scope.scope)">失败</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<pdf-dialog :isVisible="isPdfVisible" title="合同" :pdfUrl="pdfUrl" @closeDialog="handlePdfClose"></pdf-dialog>
<glsx-dialog class="upload-dialog" title="上传资料" :isVisible.sync="isFileVisible" width="750px" :noCancel="noCancel" btnOkLabel="关闭" @confirmDialog="handleUploadFileClose" @closeDialog="handleUploadFileClose">
<div class="upload-wrap" style="height: 284px; overflow-y: scroll;">
<glsx-combi-form labelWidth="300px" :isBlock="isBlock" @handleImgDelete="handleDelImg(arguments)" ref="uploadFormRef" formRef="uploadChildRef" :formRules="uploadRule" :formObj.sync="uploadForm" :formData="uploadFormData">
<span class="upload-slot" slot="uploadSlot" slot-scope="item">
上传
<input class="upload-input" type="file" :id="item.scope.name + 'file'" :ref="item.scope.name+'file'" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleUploadChange(e, item)" />
</span>
</glsx-combi-form>
</div>
</glsx-dialog>
<el-dialog :visible.sync="isTipVisible" width="400px" class="tips-dialog" top="30%" title="提示">
<div class="f-size">
<i v-show="editNotify.code == '0'" class="el-icon-success"></i>
<i v-show="editNotify.code != '0'" class="el-icon-error"></i>
<span>{{editNotify.code == '0' ? '操作成功' : editNotify.message}}</span>
</div>
</el-dialog>
<el-dialog :visible.sync="isSecondVisible" width="400px" class="tips-dialog" top="30%" :title="secondObj.title">
<div class="f-size">
<i class="el-icon-warning"></i>
<span>{{secondObj.txt}}</span>
</div>
<span slot="footer" class="dialog-footer">
<el-button :size="size" @click="handleSecondCancel">取 消</el-button>
<el-button :size="size" type="primary" @click="handleSecondConfirm">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="isShowFail" width="400px" class="tips-dialog" title="失败原因">
<div class="dialog_modal">
<span class="dialog_title">失败原因</span>
<el-select v-model="failValue" clearable placeholder="请选择">
<el-option
v-for="item in failList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
<span slot="footer" class="dialog-footer">
<el-button :size="size" @click="handleFailCancel">取 消</el-button>
<el-button :size="size" type="primary" @click="handleFailConfirm">确 定</el-button>
</span>
</el-dialog>
</template>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import glsxCombiForm from '@/components/glsx-combi-form'
import glsxDialog from '@/components/glsx-dialog'
import pdfDialog from './pdfDialog'
import utils from '../../util/util'
import introduct from "./introduct.vue"
export default {
name: 'equityList',
data() {
return {
failValue:'',
failList:[{
value: 1,
label: 'ERP出单失败'
},{
value: 2,
label: 'ERP修改失败'
},{
value: 3,
label: 'ERP退单失败'
},],
isShowFail:false,
showPage:0,
openCostPrice:0,//是否展示门店成本
size: 'small',
noCancel: true,
isBlock: true,
isTipVisible: false,
isFirst: true,
showClose: false,
editNotify: {},
isSecondVisible: false,
secondObj: {
title: '',
txt: ''
},
userInfo: {},
countNoData: '',
levelToShow: {
1: 'merchantId',
2: 'dqtId',
3: 'pqId',
4: 'mdId'
},
searchForm: {
queryText: '',
orderStatus: '',
packageCode: '',
merchantId: '',
dqtId: '',
pqId: '',
mdId: '',
auditStatus: '',
dataPerfection: '',
successDate: [],
effectiveDate: []
},
tableSearchForm: {},
// 合同打印
isPdfVisible: false,
pdfUrl: '',
// 上传资料
isFileVisible: false,
packageList: [],
uploadRule: {},
uploadForm: {},
uploadFormData: [],
// 搜索
searchSelectObj: {
nameOrNoOrVin: {
attr: 'customerName',
value: ''
}
},
searchFormData: [
{
type: 'selectInput',
selectName: 'nameOrNoOrVin',
isClear: true,
inputWidth: '320px',
selectWidth: '110px',
selectOption: [{
label: '客户姓名',
name: 'customerName'
}, {
label: '合同号',
name: 'contractNo'
}, {
label: '车架号',
name: 'vin'
}],
handleSelectChange: (value) => {
this.searchSelectObj.nameOrNoOrVin.value = ''
}
},
{
label: '服务状态',
name: 'orderStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'orderStatusList'
},
{
label: '产品名称',
name: 'packageCode',
type: 'select',
optionList: [],
optionId: 'packageCode',
optionLabel: 'packageName',
optionsName: 'goodsStatusList'
},
{
label: '提单成功时间',
name: 'successDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '生效时间',
name: 'effectiveDate',
type: 'datePicker',
isClear: true
},
{
label: '财务审核状态',
name: 'auditStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'auditStatusList'
},
{
label: '上传资料',
name: 'dataPerfection',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'dataPerfectionList'
},
{
label: '总部',
name: 'merchantId',
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'merchantList',
isHide: true,
changeAttr: (val, targetItem) => {
var idx = this.searchFormData.findIndex(item => item.name == this.levelToShow['2'])
this.searchFormData[idx].isHide = false
this.searchForm[this.levelToShow['2']] = ''
var tempIdx = ''
for(var i = 3; i <= 4; i++) {
tempIdx = this.searchFormData.findIndex(item => item.name == this.levelToShow[i + ''])
this.searchFormData[tempIdx].isHide = true
this.searchForm[this.levelToShow[i + '']] = ''
}
this.getMerchantList(val, 2, this.searchFormData[idx].name, this.searchFormData[idx].optionsName)
}
},
{
label: '大区',
name: 'dqtId',
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'dqList',
isHide: true,
changeAttr: (val, targetItem) => {
var idx = this.searchFormData.findIndex(item => item.name == this.levelToShow['3'])
this.searchFormData[idx].isHide = false
this.searchForm[this.levelToShow['3']] = ''
var tempIdx = this.searchFormData.findIndex(item => item.name == this.levelToShow['4'])
this.searchFormData[tempIdx].isHide = true
this.searchForm[this.levelToShow['4']] = ''
this.getMerchantList(val, 3, this.searchFormData[idx].name, this.searchFormData[idx].optionsName)
}
},
{
label: '片区',
name: 'pqId',
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'pqList',
isHide: true,
changeAttr: (val, targetItem) => {
var idx = this.searchFormData.findIndex(item => item.name == this.levelToShow['4'])
this.searchFormData[idx].isHide = false
this.searchForm[this.levelToShow['4']] = ''
this.getMerchantList(val, 4, this.searchFormData[idx].name, this.searchFormData[idx].optionsName)
}
},
{
label: '门店',
name: 'mdId',
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'mdList',
isHide: true
}
],
// 表格
getListApi: this.$apis.ghBeforeSale.getListApi,
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: []
},
sizeList: [5, 10, 20, 30, 40],
pageConf: { pageSize: 'pageCount', pageNum: 'pageSize', totalCount: 'total' },
// 公共数据
baseData: {
goodsStatusList: [],
merchantList: [],
dqList: [],
pqList: [],
mdList: [],
orderStatusList: [
{
confId: 0,
confName: '待提单'
},
{
confId: 1,
confName: 'ERP出单失败'
},
{
confId: 2,
confName: '提单成功'
},
{
confId: 3,
confName: '提单失败'
},
{
confId: 4,
confName: '已退单'
},
{
confId: 5,
confName: '已过期'
},
{
confId: 7,
confName: '退单审核中'
},
{
confId: 8,
confName: 'ERP退单失败'
},
{
confId: 9,
confName: 'ERP修改审核中'
},
{
confId: 10,
confName: '修改成功'
},
{
confId: 11,
confName: 'ERP修改失败'
},
],
dataPerfectionList: [
{
confId: 1,
confName: '已完成'
},
{
confId: 0,
confName: '未完成'
}
],
auditStatusList: [
{
confId: 0,
confName: '待审核'
},
{
confId: 1,
confName: '已审核'
}
]
},
isAdmin:false
}
},
components: {
glsxCombiForm,
glsxDialog,
pdfDialog,
introduct
},
created(){
this.isOpenSettin()
},
mounted() {
// this.editNotify = this.$route.params
// if(this.isFirst && this.editNotify.hasOwnProperty('code')) {
// this.isFirst = false
// this.isTipVisible = true
// clearTimeout(this.timer)
// this.timer = setTimeout(() => {
// this.isTipVisible = false
// }, this.editNotify.code == '0' ? 1500 : 3000)
// }
// this.$apis.ghBeforeSale.getProListApi({}).then(res => {
// this.baseData.goodsStatusList = res
// this.getOptionsList('searchFormData')
// })
// this.getCountNoData()
// this.$apis.ghBeforeSale.getUserInfoApi({}).then(res => {
// this.userInfo = res
// if(res.merchantAccountLevel != 4) {
// var idx = this.searchFormData.findIndex(item => item.name == this.levelToShow[this.userInfo.admin ? res.merchantAccountLevel : res.merchantAccountLevel + 1])
// this.searchFormData[idx].isHide = false
// this.getMerchantList('', '', this.searchFormData[idx].name, this.searchFormData[idx].optionsName)
// }
// })
},
methods: {
// 根据是否开通配置来是否请求数据
controlHttp(){
if(this.showPage==2){
return
}
this.editNotify = this.$route.params
if(this.isFirst && this.editNotify.hasOwnProperty('code')) {
this.isFirst = false
this.isTipVisible = true
clearTimeout(this.timer)
this.timer = setTimeout(() => {
this.isTipVisible = false
}, this.editNotify.code == '0' ? 1500 : 3000)
}
this.$apis.ghBeforeSale.getProListApi({}).then(res => {
this.baseData.goodsStatusList = res
this.getOptionsList('searchFormData')
})
this.getCountNoData()
this.$apis.ghBeforeSale.getUserInfoApi({}).then(res => {
this.userInfo = res
if(res.merchantAccountLevel != 4) {
var idx = this.searchFormData.findIndex(item => item.name == this.levelToShow[this.userInfo.admin ? res.merchantAccountLevel : res.merchantAccountLevel + 1])
this.searchFormData[idx].isHide = false
this.getMerchantList('', '', this.searchFormData[idx].name, this.searchFormData[idx].optionsName)
}
})
},
handleUploadChange(e, item){
this.$refs.uploadFormRef.handleUploadChange(e, item.scope)
},
handleDelImg(event){
const params = {
contractNo: this.uploadForm.contractNo,
attachmentFile : event[1]
}
this.$apis.ghBeforeSale.delImgApi(params).then(res => {
this.$message({
message: res.code == '0' ? '删除成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if(event[0].name && this.$refs[event[0].name+'file']){
this.$refs[event[0].name+'file'].value = null;
}
})
},
getCountNoData() {
this.$apis.ghBeforeSale.getCountNoDataApi({}).then(res => {
this.countNoData = res
})
},
getMerchantList(merchantId, accountLevel, attrName, listName) {
var params = {
merchantId: merchantId,
accountLevel: accountLevel
}
this.$apis.ghBeforeSale.getMerchantApi(params).then(res => {
this.baseData[listName] = res
this.getOptionsList('searchFormData', false, attrName)
})
},
getSelectInputParams() {
const list = Object.keys(this.searchSelectObj)
var params = {}
list.forEach(i => {
const item = this.searchSelectObj[i]
item.value && (params[item.attr] = item.value)
})
return params
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
const tempParams = this.getSelectInputParams()
params = {
...params,
...tempParams
}
// 商户-merchantId
for(var i = 1; i <= 4; i++) {
if(this.searchForm[this.levelToShow[i]]) {
params.merchantId = this.searchForm[this.levelToShow[i]]
params.accountLevel = i
}
}
if (this.searchForm.successDate.length) {
params.successStartDates = new Date(this.searchForm.successDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.successEndDates = new Date(this.searchForm.successDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
if (this.searchForm.effectiveDate.length) {
params.effectiveStartDates = new Date(this.searchForm.effectiveDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.effectiveEndDates = new Date(this.searchForm.effectiveDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.successDate
delete params.effectiveDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
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] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} 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)
}
}
})
}
},
secondConfirm(title, txt, apiModule, apiName, apiParams) {
this.secondObj = {
title: title,
txt: txt,
apiModule: apiModule,
apiName: apiName,
apiParams: apiParams
}
if (title == '退单') {
this.$confirm('是否确认退单?', '退单', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
customClass: 'customConfirm'
}).then(() => {
this.handleSecondConfirm()
})
return
}
this.handleSecondCancel()
},
handleSecondConfirm() {
this.$apis.ghBeforeSale[this.secondObj.apiName](this.secondObj.apiParams).then(res => {
// this.handleSecondCancel()
// this.isTipVisible = true
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
this.editNotify = res
// clearTimeout(this.timer)
// this.timer = setTimeout(() => {
// this.isTipVisible = false
// }, this.editNotify.code == '0' ? 1500 : 3000)
if (res.code == '0') {
this.handleSearch()
}
})
},
handleSecondCancel() {
this.isSecondVisible = !this.isSecondVisible
},
// 1-新增;2-编辑;3-修改;4-重新提单;5-查看
handleEdit(addOrEdit, row) {
if (addOrEdit == 3 && !this.userInfo.admin && new Date(new Date().setDate(new Date().getDate() - 7)) > new Date(row.successDate)) {
const h = this.$createElement
const tip = addOrEdit==3?'修改申请':'退单申请'
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提交'+tip)]),
type: 'error',
customClass: 'customMessage'
})
return true
}
let paraFormat = {
addOrEdit,
contractNo: addOrEdit == 1 ? -1 : row.contractNo,
isSuper: this.userInfo.admin
}
const title = this.jumpTitle(addOrEdit)
const urlpara = encodeURIComponent(JSON.stringify(paraFormat))
// this.$router.push('/ghPreSale/editEquity/' + urlpara)
this.$router.push({path:'/ghPreSale/editEquity/' + urlpara,query:{$title:title}})
},
handlePdfClose() {
this.isPdfVisible = !this.isPdfVisible
},
// 打印
handlePdf(row) {
if (!row.auditStatus) {
// const h = this.$createElement
// this.isTipVisible = true
// this.editNotify = {
// code: '-1',
// message: '财务未审核,合同无法打印'
// }
// clearTimeout(this.timer)
// this.timer = setTimeout(() => {
// this.isTipVisible = false
// }, this.editNotify.code == '0' ? 1500 : 3000)
// return true
this.$confirm('财务未审核,合同无法打印', {
confirmButtonText: '确定',
showCancelButton:false
})
return true
}
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
this.$apis.ghBeforeSale.getPriteApi({ contractNo: row.contractNo }).then(res => {
const {code,data,message} = res
if(code==0){
this.pdfUrl = data
this.handlePdfClose()
this.handleSearch()
}else{
this.$message({
message:message,
type: 'error'
})
}
loading.close();
})
},
uploadFile(imgUrl, targetItem) {
var params = {
contractNo: this.uploadForm.contractNo,
attachmentCode: targetItem.name,
attachmentFile: imgUrl,
attachmentType: 'IMG'
}
this.$apis.ghBeforeSale.updateOrderApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if(this.$refs[targetItem.name+'file']){
this.$refs[targetItem.name+'file'].value = null;
}
if (res.code == '0') {
this.uploadForm[targetItem.name].push(imgUrl)
//this.$set(this.uploadForm, targetItem.name, imgUrl)
}
})
},
// 上传资料
autoGenerate() {
var tempList = []
this.uploadFormData = []
this.packageList.forEach(item => {
this.$set(this.uploadForm, item.attachmentCode, [])
this.uploadFormData.push({
label: item.attachmentName+':',
name: item.attachmentCode,
type: 'upload',
limitSize: 20,
maxPhotoNum: 4,
suffixSlot:'uploadSlot',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const targetNameList = file.name.split('.')
const base64 = targetNameList[targetNameList.length-1] + '@' + imgFile.split(',')[1]
var imgUrl = ''
this.$apis.ghBeforeSale.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
this.uploadFile(res, targetItem)
})
}
})
if (item.required == 1) {
this.uploadRule[item.attachmentCode] = [
{
required: true,
message: '请选择' + item.attachmentName,
trigger: 'change'
}
]
}
})
this.handleUploadFileClose()
},
handleUploadFileClose() {
this.isFileVisible = !this.isFileVisible
if(!this.isFileVisible){
this.handleSearch()
}
},
handleUpload(row) {
this.$apis.ghBeforeSale.getOrderAttrApi({ packageCode: row.packageCode }).then(res => {
this.packageList = res
this.uploadForm.contractNo = row.contractNo
this.$apis.ghBeforeSale.getAllOrderValueApi({ contractNo: row.contractNo }).then(subRes => {
var idx = ''
this.packageList.forEach(item => {
idx = subRes.findIndex(i => i.attachmentCode == item.attachmentCode)
this.uploadForm[item.attachmentCode] = idx != -1 ? subRes[idx].attachmentFiles : []
})
})
this.autoGenerate()
})
},
// 退单
handleBack(row) {
if (!this.userInfo.admin && 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',
customClass: 'customMessage'
})
return true
}
this.secondConfirm('退单', '是否确认退单?', 'ghBeforeSale', 'backOrderApi', { contractNo: row.contractNo, merchantId: row.merchantId })
},
// 导出
handleExport() {
var params = this.getParams()
this.$apis.ghBeforeSale.getExportApi(params).then(res => {
// window.open(res)
let tempaa = utils.getExplorer()
if (tempaa == 'QQ') {
window.open(res)
} else {
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = res
document.body.appendChild(iframe)
}
})
},
handleSearch() {
this.$refs.equityRef.refreshTable()
},
handleReset() {
this.searchForm = {
queryText: '',
orderStatus: '',
merchantId: '',
dqtId: '',
pqId: '',
mdId: '',
auditStatus: '',
dataPerfection: '',
successDate: [],
effectiveDate: []
}
this.searchSelectObj = {
nameOrNoOrVin: {
attr: 'customerName',
value: ''
}
}
var tempIdx = ''
var addNum = this.userInfo.admin ? 1 : 2
if(this.userInfo.merchantAccountLevel != 4) {
for(var i = this.userInfo.merchantAccountLevel + addNum; i <= 4; i++) {
tempIdx = this.searchFormData.findIndex(item => item.name == this.levelToShow[i + ''])
this.searchFormData[tempIdx].isHide = true
this.searchForm[this.levelToShow[i + '']] = ''
}
}
this.handleSearch()
},
// 页面跳转标题判断
jumpTitle(addOrEdit) {
let title = '新增权益'
switch (addOrEdit) {
case 1:
title = '新增权益'
break;
case 2:
title = '编辑'
break;
case 3:
title = '修改'
break;
case 4:
title = '重新提单'
break;
case 5:
title = '查看'
break;
default:
title = '新增权益'
break;
}
return title
},
// 判断是否开通
isOpenSettin() {
localStorage.removeItem('preSetStatus')
const { merchantId } = this.$globalState.session
this.$apis.ghBeforeSale.judgeSetting({ merchantId,channel:2 }).then(res => {
// data != null 且data.openFlag == 1 为开通,其他的都是未开通
const { code, data } = res
if (code == 0 && data != null && data.openFlag == 1) {
this.tableColData(data.openCostPrice)
this.showPage = 1
} else {
this.showPage = 2
}
this.controlHttp(this.showPage)
localStorage.setItem('preSetStatus', this.showPage)
})
},
// 表格列的数据
tableColData(status){
const tableColumns = [
{
label: '车主姓名',
prop: 'customerName',
line: 1,
width: '200px',
formatter: cellValue => {
return cellValue.customerName || '-'
}
},
{
label: '合同号',
prop: 'contractNo',
width: '200px',
formatter: cellValue => {
return [2, 4, 5,7,8,9,10,11].includes(cellValue.orderStatus) ? (cellValue.contractNo || '-') : '-'
}
},
{
label: '提单成功时间',
prop: 'successDate',
width: '200px',
line: 1,
formatter: cellValue => {
return cellValue.successDate ? dayjs(cellValue.successDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '新车开票日期',
prop: 'billingDate',
width: '160px',
line: 1,
formatter: cellValue => {
return cellValue.billingDate ? dayjs(cellValue.billingDate).format('YYYY-MM-DD') : '-'
}
},
{
label: '店面名称',
prop: 'merchantName',
width: '200px',
formatter: cellValue => {
return cellValue.merchantName || '-'
}
},
{
label: '车品牌',
prop: 'vehicleBrandName',
width: '160px',
line: 1,
formatter: cellValue => {
return cellValue.vehicleBrandName || '-'
}
},
{
label: '车系',
prop: 'vehicleSeriesName',
line: 1,
width: '160px',
formatter: cellValue => {
return cellValue.vehicleSeriesName || '-'
}
},
{
label: '车架',
prop: 'vin',
line: 1,
width: '200px',
formatter: cellValue => {
return cellValue.vin || '-'
}
},
{
label: '电话',
prop: 'customerPhone',
width: '160px',
line: 1,
formatter: cellValue => {
return cellValue.customerPhone || '-'
}
},
{
label: '产品名称',
prop: 'packageName',
line: 1,
width: '200px',
formatter: cellValue => {
return cellValue.packageName || '-'
}
},
{
label: '实际销售价',
prop: 'actualSalesPrice',
width: '160px',
formatter: cellValue => {
return cellValue.actualSalesPrice ? (cellValue.actualSalesPrice / 100).toFixed(2) : '-'
}
},
{
label: '服务期限',
prop: 'servicePeriod',
line: 1,
width: '200px',
formatter: cellValue => {
return cellValue.servicePeriod ? '1年' : '-'
}
},
{
label: '生效时间',
prop: 'effectiveDate',
width: '200px',
line: 1,
formatter: cellValue => {
return cellValue.effectiveDate ? dayjs(cellValue.effectiveDate).format('YYYY-MM-DD') : '-'
}
},
{
label: '状态',
prop: 'orderStatus',
width: '120px',
formatter: cellValue => {
return this.baseData.orderStatusList.map(item => item.confId).includes(cellValue.orderStatus) ? this.baseData.orderStatusList.find(item => item.confId == cellValue.orderStatus).confName : '-'
}
},
{
label: '状态描述',
prop: 'erpErrorMsg',
width: '300px',
formatter: cellValue => {
return cellValue.erpErrorMsg ? cellValue.erpErrorMsg: '-'
}
},
{
label: '审核状态',
prop: 'auditStatus',
width: '100px',
line: 1,
formatter: cellValue => {
var auditStatusTxt = '-'
if([2, 4, 5,7,8,9,10,11].includes(cellValue.orderStatus)) {
auditStatusTxt = this.baseData.auditStatusList.map(item => item.confId).includes(cellValue.auditStatus) ? this.baseData.auditStatusList.find(item => item.confId == cellValue.auditStatus).confName : '-'
}
return auditStatusTxt
}
},
{
label: '审核日期',
prop: 'auditDate',
width: '200px',
formatter: cellValue => {
return cellValue.auditDate ? dayjs(cellValue.auditDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '审核人',
prop: 'auditBy',
width: '140px',
line: 1,
formatter: cellValue => {
return cellValue.auditBy || '-'
}
},
{
label: '首续保',
prop: 'insuranceType',
width: '110px',
formatter: cellValue => {
return cellValue.insuranceType=='i'?'无忧卡首保':'无忧卡续保'
}
},
{
label: '价格区间',
prop: 'pricePeriod',
width: '160px',
formatter: cellValue => {
return cellValue.pricePeriod ? cellValue.pricePeriod : '-'
}
},
{
label: '门店编码',
prop: 'sap',
line: 1,
formatter: cellValue => {
return cellValue.sap || '-'
}
},
{
label: '实际销售人员',
prop: 'actualSalesPerson',
width: '160',
line: 1,
formatter: cellValue => {
return cellValue.actualSalesPerson || '-'
}
},
{
label: '大区',
prop: 'provinceMerchantName',
width: '200',
formatter: cellValue => {
return cellValue.provinceMerchantName || '-'
}
},
{
label: '片区',
prop: 'cityMerchantName',
width: '200',
formatter: cellValue => {
return cellValue.cityMerchantName || '-'
}
},
{
label: '操作人',
prop: 'updatedBy',
width: '140px',
line: 1,
formatter: cellValue => {
return cellValue.updatedBy || '-'
}
},
{
label: '操作',
prop: '',
width: '200px',
fixed: 'right',
addHtml: 'table-btns'
}
]
const tableColumnsCost = [
{
label: '车主姓名',
prop: 'customerName',
line: 1,
width: '200px',
formatter: cellValue => {
return cellValue.customerName || '-'
}
},
{
label: '合同号',
prop: 'contractNo',
width: '200px',
formatter: cellValue => {
return [2, 4, 5,7,8,9,10,11].includes(cellValue.orderStatus) ? (cellValue.contractNo || '-') : '-'
}
},
{
label: '提单成功时间',
prop: 'successDate',
width: '200px',
line: 1,
formatter: cellValue => {
return cellValue.successDate ? dayjs(cellValue.successDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '新车开票日期',
prop: 'billingDate',
width: '160px',
line: 1,
formatter: cellValue => {
return cellValue.billingDate ? dayjs(cellValue.billingDate).format('YYYY-MM-DD') : '-'
}
},
{
label: '店面名称',
prop: 'merchantName',
width: '200px',
formatter: cellValue => {
return cellValue.merchantName || '-'
}
},
{
label: '车品牌',
prop: 'vehicleBrandName',
width: '160px',
line: 1,
formatter: cellValue => {
return cellValue.vehicleBrandName || '-'
}
},
{
label: '车系',
prop: 'vehicleSeriesName',
line: 1,
width: '160px',
formatter: cellValue => {
return cellValue.vehicleSeriesName || '-'
}
},
{
label: '车架',
prop: 'vin',
line: 1,
width: '200px',
formatter: cellValue => {
return cellValue.vin || '-'
}
},
{
label: '电话',
prop: 'customerPhone',
width: '160px',
line: 1,
formatter: cellValue => {
return cellValue.customerPhone || '-'
}
},
{
label: '产品名称',
prop: 'packageName',
line: 1,
width: '200px',
formatter: cellValue => {
return cellValue.packageName || '-'
}
},
{
label: '实际销售价',
prop: 'actualSalesPrice',
width: '160px',
formatter: cellValue => {
return cellValue.actualSalesPrice ? (cellValue.actualSalesPrice / 100).toFixed(2) : '-'
}
},
{
label: '门店成本',
prop: 'costPrice',
width: '160px',
formatter: cellValue => {
return cellValue.costPrice ? (cellValue.costPrice / 100).toFixed(2) : '-'
}
},
{
label: '服务期限',
prop: 'servicePeriod',
line: 1,
width: '200px',
formatter: cellValue => {
return cellValue.servicePeriod ? '1年' : '-'
}
},
{
label: '生效时间',
prop: 'effectiveDate',
width: '200px',
line: 1,
formatter: cellValue => {
return cellValue.effectiveDate ? dayjs(cellValue.effectiveDate).format('YYYY-MM-DD') : '-'
}
},
{
label: '状态',
prop: 'orderStatus',
width: '120px',
formatter: cellValue => {
return this.baseData.orderStatusList.map(item => item.confId).includes(cellValue.orderStatus) ? this.baseData.orderStatusList.find(item => item.confId == cellValue.orderStatus).confName : '-'
}
},
{
label: '状态描述',
prop: 'erpErrorMsg',
width: '200px',
formatter: cellValue => {
return cellValue.erpErrorMsg ? cellValue.erpErrorMsg: '-'
}
},
{
label: '审核状态',
prop: 'auditStatus',
width: '100px',
line: 1,
formatter: cellValue => {
var auditStatusTxt = '-'
if([2, 4, 5,7,8,9,10,11].includes(cellValue.orderStatus)) {
auditStatusTxt = this.baseData.auditStatusList.map(item => item.confId).includes(cellValue.auditStatus) ? this.baseData.auditStatusList.find(item => item.confId == cellValue.auditStatus).confName : '-'
}
return auditStatusTxt
}
},
{
label: '审核日期',
prop: 'auditDate',
width: '200px',
formatter: cellValue => {
return cellValue.auditDate ? dayjs(cellValue.auditDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '审核人',
prop: 'auditBy',
width: '140px',
line: 1,
formatter: cellValue => {
return cellValue.auditBy || '-'
}
},
{
label: '首续保',
prop: 'insuranceType',
width: '110px',
formatter: cellValue => {
return cellValue.insuranceType=='i'?'无忧卡首保':'无忧卡续保'
}
},
{
label: '价格区间',
prop: 'pricePeriod',
width: '160px',
formatter: cellValue => {
return cellValue.pricePeriod ? cellValue.pricePeriod : '-'
}
},
{
label: '门店编码',
prop: 'sap',
line: 1,
formatter: cellValue => {
return cellValue.sap || '-'
}
},
{
label: '实际销售人员',
prop: 'actualSalesPerson',
width: '160',
line: 1,
formatter: cellValue => {
return cellValue.actualSalesPerson || '-'
}
},
{
label: '大区',
prop: 'provinceMerchantName',
width: '200',
formatter: cellValue => {
return cellValue.provinceMerchantName || '-'
}
},
{
label: '片区',
prop: 'cityMerchantName',
width: '200',
formatter: cellValue => {
return cellValue.cityMerchantName || '-'
}
},
{
label: '操作人',
prop: 'updatedBy',
width: '140px',
line: 1,
formatter: cellValue => {
return cellValue.updatedBy || '-'
}
},
{
label: '操作',
prop: '',
width: '200px',
fixed: 'right',
addHtml: 'table-btns'
}
]
this.tableParams = {
listName: 'list',
tableOption: false,
tableColumns: status==1?tableColumnsCost:tableColumns
}
},
// 展示失败弹框选择
showFailModal(row){
this.currentContractNo = row.contractNo
this.isShowFail = true
},
handleFailConfirm(){
if(!this.failValue){
this.$message({
message:'请选择失败原因',
type: 'error'
})
return
}
let para = {
contractNo:this.currentContractNo,
businessType:this.failValue
}
this.$apis.ghBeforeSale.failHttpByAdmin(para).then(res => {
this.isShowFail = false
this.handleSearch()
})
},
handleFailCancel(){
this.isShowFail = false
}
},
}
</script>
<style lang="scss" scoped>
.before-sale{
padding-top: 17px;
}
.before-sale .flex {
display: flex;
}
/deep/ .add-benefit .el-button span{
margin-left: 5px;
}
/deep/ .number{
.el-form-item:first-child{
.input-with-select{
width: 286px!important;
margin-left: 24px;
}
.el-select--small{
width: 120px!important;
}
}
.footer-btns{
float: none!important;
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
.el-button:first-child{
border: 1px solid #5850ff;
color: #5850ff;
}
}
}
.before-sale .container {
padding: 0px 20px 20px 40px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.before-sale .top-tips {
box-sizing: border-box;
margin: 10px 0;
width: 100%;
height: 40px;
display: flex;
align-items: center;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
background-color: #E6E9FF;
border: 1px solid #5850FF;
padding: 0 10px;
border-radius: 4px;
}
.before-sale .top-tips .el-icon-warning {
font-size: 16px;
color: #5850FF;
margin-right: 8px;
}
.before-sale .circule-tips {
position: absolute;
top: 0;
right: -6px;
display: inline-block;
height: 6px;
width: 6px;
border-radius: 100%;
background-color: red;
}
.before-sale .footer-btns {
float: right;
/* display: block;
text-align: right; */
/* margin-bottom: 18px; */
}
.before-sale .el-table .cell {
line-height: 16px;
}
.before-sale .table-btns {
display: grid;
grid-template-columns: repeat(auto-fill, 33.33%);
grid-row-gap: 10px;
}
.before-sale .table-btns .el-button {
// padding: 0 0 0 5px;
border-radius: 0;
border: 0;
padding: 0;
margin: 0;
}
.tips-dialog .el-icon-success {
margin-right: 10px;
font-size: 22px;
color: #228b22;
}
.tips-dialog .el-icon-warning {
margin-right: 10px;
font-size: 22px;
color: #f77315;
}
.tips-dialog .el-icon-error {
margin-right: 10px;
font-size: 22px;
color: #f56c6c;
}
.f-size {
font-size: 14px;
display: flex;
line-height: 22px;
/* text-align: center; */
}
.tips-dialog .el-dialog__body {
padding: 10px 15px 20px !important;
}
/deep/ .upload-dialog{
.upload-wrap{
.glsx-combi-form .isBlock {
display: flex !important;
}
.el-form-item__label{
height: 32px;
white-space: nowrap;
}
.el-form-item__content{
padding-left: 60px;
.activity-img{
display: none;
}
&:last-child{
width: 330px;
.img-btns, img{
width: 64px;
height: 64px;
}
}
}
.upload-slot{
position: absolute;
top: 0;
height: 32px;
left: 0;
color: #5f5efb;
white-space: nowrap;
cursor: pointer;
.upload-input{
opacity: 0;
position: absolute;
width: 100%;
left: 0;
height: 100%;
cursor: pointer;
}
}
}
.el-dialog__footer{
&>div{
display: flex;
justify-content: center;
}
}
}
// .dialog_modal{
// height: 150px;
// }
.dialog_title{
margin-right:15px;
}
.noPaddngTop{
padding-top: 0;
}
</style>
<!-- 财务 - 权益订单列表 -->
<template>
<div class="before-sale" :class="{noPaddngTop:showPage==2}">
<template v-if="showPage==1">
<div class="container finance">
<div class="number">
<glsx-combi-form ref="showSearch" labelWidth="100px" defaultWidth="210px" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData">
<span slot="footer" class="footer-btns">
<el-button :size="size" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleExport">导出</el-button>
</span>
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="equityRef" :pageSizes="sizeList" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="table-btns" slot-scope="scope">
<!-- <el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleAudit(scope.scope)">{{scope.scope.auditStatus ? '撤销' : '财务已收款'}}</el-button> -->
<el-button v-if="[2].includes(scope.scope.orderStatus) && !scope.scope.auditStatus" type="text" @click="handleAudit(scope.scope)">财务已收款</el-button>
<el-button v-else type="text">-</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</template>
<template v-if="showPage==2">
<introduct></introduct>
</template>
<el-dialog :visible.sync="isTipVisible" width="400px" class="tips-dialog" top="30%" title="提示">
<div class="f-size">
<i v-show="editNotify.code == '0'" class="el-icon-success"></i>
<i v-show="editNotify.code != '0'" class="el-icon-error"></i>
<span>{{editNotify.code == '0' ? '操作成功' : editNotify.message}}</span>
</div>
</el-dialog>
<el-dialog :visible.sync="isSecondVisible" width="400px" class="tips-dialog" top="30%" :title="secondObj.title">
<div class="f-size">
<i class="el-icon-warning"></i>
<span>{{secondObj.txt}}</span>
</div>
<span slot="footer" class="dialog-footer">
<el-button :size="size" @click="handleSecondCancel">取 消</el-button>
<el-button :size="size" type="primary" @click="handleSecondConfirm">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import glsxCombiForm from '@/components/glsx-combi-form'
import utils from '../../util/util'
import introduct from './introduct.vue'
export default {
name: 'financeIndex',
data() {
return {
size: 'small',
isTipVisible: false,
editNotify: {},
isSecondVisible: false,
secondObj: {
title: '',
txt: ''
},
userInfo: {},
levelToShow: {
1: 'merchantId',
2: 'dqtId',
3: 'pqId',
4: 'mdId'
},
searchForm: {
queryText: '',
orderStatus: '',
packageCode: '',
merchantId: '',
dqtId: '',
pqId: '',
mdId: '',
auditStatus: '',
successDate: [],
effectiveDate: []
},
tableSearchForm: {},
// 合同打印
isPdfVisible: false,
pdfUrl: '',
// 上传资料
isFileVisible: false,
packageList: [],
uploadRule: {},
uploadForm: {},
uploadFormData: [],
// 搜索
searchSelectObj: {
nameOrNoOrVin: {
attr: 'customerName',
value: ''
}
},
searchFormData: [
{
type: 'selectInput',
selectName: 'nameOrNoOrVin',
isClear: true,
inputWidth: '320px',
selectWidth: '110px',
selectOption: [{
label: '客户姓名',
name: 'customerName'
}, {
label: '合同号',
name: 'contractNo'
}, {
label: '车架号',
name: 'vin'
}],
handleSelectChange: (value) => {
this.searchSelectObj.nameOrNoOrVin.value = ''
}
},
{
label: '服务状态',
name: 'orderStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'orderStatusList'
},
{
label: '产品名称',
name: 'packageCode',
type: 'select',
optionList: [],
optionId: 'packageCode',
optionLabel: 'packageName',
optionsName: 'goodsStatusList'
},
{
label: '提单成功时间',
name: 'successDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '生效时间',
name: 'effectiveDate',
type: 'datePicker',
isClear: true
},
{
label: '财务审核状态',
name: 'auditStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'auditStatusList'
},
{
label: '总部',
name: 'merchantId',
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'merchantList',
isHide: true,
changeAttr: (val, targetItem) => {
var idx = this.searchFormData.findIndex(item => item.name == this.levelToShow['2'])
this.searchFormData[idx].isHide = false
this.searchForm[this.levelToShow['2']] = ''
var tempIdx = ''
for(var i = 3; i <= 4; i++) {
tempIdx = this.searchFormData.findIndex(item => item.name == this.levelToShow[i + ''])
this.searchFormData[tempIdx].isHide = true
this.searchForm[this.levelToShow[i + '']] = ''
}
this.getMerchantList(val, 2, this.searchFormData[idx].name, this.searchFormData[idx].optionsName)
}
},
{
label: '大区',
name: 'dqtId',
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'dqList',
isHide: true,
changeAttr: (val, targetItem) => {
var idx = this.searchFormData.findIndex(item => item.name == this.levelToShow['3'])
this.searchFormData[idx].isHide = false
this.searchForm[this.levelToShow['3']] = ''
var tempIdx = this.searchFormData.findIndex(item => item.name == this.levelToShow['4'])
this.searchFormData[tempIdx].isHide = true
this.searchForm[this.levelToShow['4']] = ''
this.getMerchantList(val, 3, this.searchFormData[idx].name, this.searchFormData[idx].optionsName)
}
},
{
label: '片区',
name: 'pqId',
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'pqList',
isHide: true,
changeAttr: (val, targetItem) => {
var idx = this.searchFormData.findIndex(item => item.name == this.levelToShow['4'])
this.searchFormData[idx].isHide = false
this.searchForm[this.levelToShow['4']] = ''
this.getMerchantList(val, 4, this.searchFormData[idx].name, this.searchFormData[idx].optionsName)
}
},
{
label: '门店',
name: 'mdId',
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'mdList',
isHide: true
}
],
// 表格
getListApi: this.$apis.ghBeforeSale.getListApi,
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '车主姓名',
prop: 'customerName',
line: 1,
width: '200px',
formatter: cellValue => {
return cellValue.customerName || '-'
}
},
{
label: '合同号',
prop: 'contractNo',
width: '200px',
formatter: cellValue => {
return [2, 4, 5].includes(cellValue.orderStatus) ? (cellValue.contractNo || '-') : '-'
}
},
{
label: '提单成功时间',
prop: 'successDate',
width: '200px',
line: 1,
formatter: cellValue => {
return cellValue.successDate ? dayjs(cellValue.successDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '新车开票日期',
prop: 'billingDate',
width: '160px',
line: 1,
formatter: cellValue => {
return cellValue.billingDate ? dayjs(cellValue.billingDate).format('YYYY-MM-DD') : '-'
}
},
{
label: '店面名称',
prop: 'merchantName',
width: '200px',
formatter: cellValue => {
return cellValue.merchantName || '-'
}
},
{
label: '车品牌',
prop: 'vehicleBrandName',
width: '160px',
line: 1,
formatter: cellValue => {
return cellValue.vehicleBrandName || '-'
}
},
{
label: '车系',
prop: 'vehicleSeriesName',
line: 1,
width: '160px',
formatter: cellValue => {
return cellValue.vehicleSeriesName || '-'
}
},
{
label: '车架',
prop: 'vin',
line: 1,
width: '200px',
formatter: cellValue => {
return cellValue.vin || '-'
}
},
{
label: '电话',
prop: 'customerPhone',
width: '160px',
line: 1,
formatter: cellValue => {
return cellValue.customerPhone || '-'
}
},
{
label: '产品名称',
prop: 'packageName',
line: 1,
formatter: cellValue => {
return cellValue.packageName || '-'
}
},
{
label: '实际销售价',
prop: 'actualSalesPrice',
width: '160px',
line: 1,
formatter: cellValue => {
return cellValue.actualSalesPrice ? (cellValue.actualSalesPrice / 100).toFixed(2) : '-'
}
},
{
label: '服务期限',
prop: 'servicePeriod',
line: 1,
width: '200px',
formatter: cellValue => {
return cellValue.servicePeriod ? '1年' : '-'
}
},
{
label: '生效时间',
prop: 'effectiveDate',
width: '200px',
line: 1,
formatter: cellValue => {
return cellValue.effectiveDate ? dayjs(cellValue.effectiveDate).format('YYYY-MM-DD') : '-'
}
},
{
label: '状态',
prop: 'orderStatus',
width: '100px',
line: 1,
formatter: cellValue => {
return this.baseData.orderStatusList.map(item => item.confId).includes(cellValue.orderStatus) ? this.baseData.orderStatusList.find(item => item.confId == cellValue.orderStatus).confName : '-'
}
},
{
label: '审核状态',
prop: 'auditStatus',
width: '100px',
line: 1,
formatter: cellValue => {
var auditStatusTxt = '-'
if([2, 4, 5].includes(cellValue.orderStatus)) {
auditStatusTxt = this.baseData.auditStatusList.map(item => item.confId).includes(cellValue.auditStatus) ? this.baseData.auditStatusList.find(item => item.confId == cellValue.auditStatus).confName : '-'
}
return auditStatusTxt
}
},
{
label: '审核人',
prop: 'auditBy',
width: '140px',
line: 1,
formatter: cellValue => {
return cellValue.auditBy || '-'
}
},
{
label: '门店编码',
prop: 'sap',
line: 1,
formatter: cellValue => {
return cellValue.sap || '-'
}
},
{
label: '实际销售人员',
prop: 'actualSalesPerson',
width: '160',
line: 1,
formatter: cellValue => {
return cellValue.actualSalesPerson || '-'
}
},
{
label: '大区',
prop: 'provinceMerchantName',
width: '200',
formatter: cellValue => {
return cellValue.provinceMerchantName || '-'
}
},
{
label: '片区',
prop: 'cityMerchantName',
width: '200',
formatter: cellValue => {
return cellValue.cityMerchantName || '-'
}
},
{
label: '操作人',
prop: 'updatedBy',
width: '140px',
line: 1,
formatter: cellValue => {
return cellValue.updatedBy || '-'
}
},
{
label: '操作',
prop: '',
width: '100px',
fixed: 'right',
addHtml: 'table-btns'
}
]
},
sizeList: [5, 10, 20, 30, 40],
pageConf: { pageSize: 'pageCount', pageNum: 'pageSize', totalCount: 'total' },
// 公共数据
baseData: {
goodsStatusList: [],
merchantList: [],
dqList: [],
pqList: [],
mdList: [],
orderStatusList: [
{
confId: 0,
confName: '待提单'
},
{
confId: 2,
confName: '提单成功'
},
{
confId: 3,
confName: '提单失败'
},
{
confId: 4,
confName: '已退单'
},
{
confId: 5,
confName: '已过期'
}
],
auditStatusList: [
{
confId: 0,
confName: '待审核'
},
{
confId: 1,
confName: '已审核'
}
]
},
showPage:0
}
},
components: {
glsxCombiForm,
introduct
},
mounted() {
if(this.showPage==2){
return
}
this.$apis.ghBeforeSale.getProListApi({}).then(res => {
this.baseData.goodsStatusList = res
this.getOptionsList('searchFormData')
})
this.$apis.ghBeforeSale.getUserInfoApi({}).then(res => {
this.userInfo = res
if(res.merchantAccountLevel != 4) {
var idx = this.searchFormData.findIndex(item => item.name == this.levelToShow[this.userInfo.admin ? res.merchantAccountLevel : res.merchantAccountLevel + 1])
this.searchFormData[idx].isHide = false
this.getMerchantList('', '', this.searchFormData[idx].name, this.searchFormData[idx].optionsName)
}
})
},
created(){
const openStatus = localStorage.getItem('preSetStatus')
if (openStatus == 2) {
this.showPage = 2
return
}
this.showPage = 1
},
methods: {
getMerchantList(merchantId, accountLevel, attrName, listName) {
var params = {
merchantId: merchantId,
accountLevel: accountLevel
}
this.$apis.ghBeforeSale.getMerchantApi(params).then(res => {
this.baseData[listName] = res
this.getOptionsList('searchFormData', false, attrName)
})
},
getSelectInputParams() {
const list = Object.keys(this.searchSelectObj)
var params = {}
list.forEach(i => {
const item = this.searchSelectObj[i]
item.value && (params[item.attr] = item.value)
})
return params
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
const tempParams = this.getSelectInputParams()
params = {
...params,
...tempParams
}
// 商户-merchantId
for(var i = 1; i <= 4; i++) {
if(this.searchForm[this.levelToShow[i]]) {
params.merchantId = this.searchForm[this.levelToShow[i]]
params.accountLevel = i
}
}
if (this.searchForm.successDate.length) {
params.successStartDates = new Date(this.searchForm.successDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.successEndDates = new Date(this.searchForm.successDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
if (this.searchForm.effectiveDate.length) {
params.effectiveStartDates = new Date(this.searchForm.effectiveDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.effectiveEndDates = new Date(this.searchForm.effectiveDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.successDate
delete params.effectiveDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
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] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} 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)
}
}
})
}
},
secondConfirm(title, txt, apiModule, apiName, apiParams) {
this.secondObj = {
title: title,
txt: txt,
apiModule: apiModule,
apiName: apiName,
apiParams: apiParams
}
if (title) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
customClass: 'customConfirm'
}).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.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
this.editNotify = res
// clearTimeout(this.timer)
// this.timer = setTimeout(() => {
// this.isTipVisible = false
// }, this.editNotify.code == '0' ? 1500 : 3000)
if (res.code == '0') {
this.handleSearch()
}
})
},
handleSecondCancel() {
this.isSecondVisible = !this.isSecondVisible
},
// 审核
handleAudit(row) {
var txt = row.auditStatus ? '撤销' : '审核通过'
// this.isTipVisible = !this.isTipVisible
this.secondConfirm(txt, '是否确认'+ txt +'?', 'ghBeforeSale', 'aduitOrderApi', { contractNo: row.contractNo, auditStatus: row.auditStatus ? 0 : 1 })
},
// 导出
handleExport() {
var params = this.getParams()
this.$apis.ghBeforeSale.getExportApi(params).then(res => {
// window.open(res)
let tempaa = utils.getExplorer()
if (tempaa == 'QQ') {
window.open(res)
} else {
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = res
document.body.appendChild(iframe)
}
})
},
handleSearch() {
this.$refs.equityRef.refreshTable()
},
handleReset() {
this.searchForm = {
queryText: '',
orderStatus: '',
merchantId: '',
dqtId: '',
pqId: '',
mdId: '',
auditStatus: '',
successDate: [],
effectiveDate: []
}
this.searchSelectObj = {
nameOrNoOrVin: {
attr: 'customerName',
value: ''
}
}
var tempIdx = ''
var addNum = this.userInfo.admin ? 1 : 2
if(this.userInfo.merchantAccountLevel != 4) {
for(var i = this.userInfo.merchantAccountLevel + addNum; i <= 4; i++) {
tempIdx = this.searchFormData.findIndex(item => item.name == this.levelToShow[i + ''])
this.searchFormData[tempIdx].isHide = true
this.searchForm[this.levelToShow[i + '']] = ''
}
}
this.handleSearch()
}
}
}
</script>
<style lang="scss" scoped>
.before-sale .container {
padding: 0px 20px 20px 40px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.before-sale .m-b-20 {
margin-bottom: 20px;
}
.before-sale{
padding-top: 17px;
}
.before-sale .table-top-tips {
/* position: relative; */
box-sizing: border-box;
/* margin: 36px 0 10px; */
margin-bottom: 10px;
width: calc(100% - 210px);
height: 30px;
font-size: 12px;
background-color: #FFF0BB;
border: 1px solid #FFCA78;
padding: 4px 10px;
border-radius: 2px;
}
.before-sale .table-top-tips .el-icon-warning {
font-size: 12px;
color: #f77315;
margin-right: 8px;
}
.before-sale .circule-tips {
position: absolute;
top: 0;
right: -6px;
display: inline-block;
height: 6px;
width: 6px;
border-radius: 100%;
background-color: red;
}
.before-sale .footer-btns {
float: right;
/* display: block;
text-align: right; */
/* margin-bottom: 18px; */
}
.before-sale .el-table .cell {
line-height: 16px;
}
.before-sale .finance .table-btns .el-button {
padding: 0 0 0 5px;
margin-left: 5px;
border-left: 1px solid #dcdfe6;
border-radius: 0;
}
.before-sale .table-btns .el-button:first-child {
padding: 0;
border: 0;
}
.tips-dialog .el-icon-success {
margin-right: 10px;
font-size: 22px;
color: #228b22;
}
.tips-dialog .el-icon-warning {
margin-right: 10px;
font-size: 22px;
color: #f77315;
}
.tips-dialog .el-icon-error {
margin-right: 10px;
font-size: 22px;
color: #f56c6c;
}
.f-size {
font-size: 14px;
display: flex;
/* text-align: center; */
}
.tips-dialog .el-dialog__body {
padding: 10px 15px 20px !important;
}
/deep/ .number{
.el-form-item:first-child{
.input-with-select{
width: 286px!important;
margin-left: 24px;
}
.el-select--small{
width: 120px!important;
}
}
.footer-btns{
float: none!important;
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
.el-button:first-child{
border: 1px solid #5850ff;
color: #5850ff;
}
}
}
.noPaddngTop{
padding-top: 0;
}
</style>
<!-- 权益订单 -->
<template>
<div class="equity">
<!-- <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="其他权益订单" name="equityList">
<equity-list v-show="activeName == 'equityList'"></equity-list>
</el-tab-pane>
<el-tab-pane label="店面服务设置" name="serviceSet">
<service-set v-show="activeName == 'serviceSet'"></service-set>
</el-tab-pane>
</el-tabs> -->
</div>
</template>
<script>
import equityList from './equityList'
import serviceSet from './serviceSet'
export default {
name: 'index',
data() {
return {
activeName: 'equityList'
}
},
// components: {
// equityList,
// serviceSet
// },
created() {
this.$router.push('/ghPreSale/equityList')
},
methods: {
handleClick() { }
}
}
</script>
<style>
.equity .el-tabs__nav-wrap:after {
opacity: 0;
}
.equity .el-tabs__item {
height: 20px !important;
line-height: 10px !important;
font-weight: 400;
font-size: 16px;
}
</style>
<template>
<div class="introduct_container">
<div class="top_play_wrap flex_scb">
<div class="text_wrap">
<span class="maxTitle">售前权益服务</span>
<span class="maxTitle">一套可变现的权益服务系统</span>
<span class="midTitle">帮您实现客户线上化闭环</span>
<span>车生活权益促活跃,养车权益促返厂,赚钱锁客两不误</span>
</div>
<div class="bg_wrap flex_cc">
<img class="max_icon" src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/before_intro.png" />
<img @click="videoShow = true" class="play_icon" src="../../assets/play_icon.png" />
</div>
</div>
<div class="mid_wrapper">
<div class="content_one flex_sc">
<div class="title left">
<span>您提供的</span>
<i class="el-icon-caret-right"></i>
</div>
<div class="title right">
<span>您将获得的</span>
<div class="icon_point"></div>
</div>
</div>
<div class="content_two flex_scb">
<template v-for="(item, index) in localList">
<div :key="index" class="box_item_wrap flex_cc">
<img :src="item.icon" />
<div class="box_title">{{ item.title }}</div>
</div>
</template>
</div>
<div class="label_title">无忧案例</div>
<div class="content_three">
<template v-for="(item, index) in localList2">
<div :key="index" class="box_new_item_wrapper" :class="[{ noborder: index == 1 }]">
<div class="left_wrap">
<img class="image_wrap" :src="item.icon" />
<div class="new_title">{{ item.title }}</div>
<div class="con_wrap">
<div class="point flex_cc">
<div class="icon_po"></div>
</div>
<div class="point_content">{{ item.desc1 }}</div>
</div>
<div style="height: 15px"></div>
<div class="con_wrap">
<div class="point flex_cc">
<div class="icon_po"></div>
</div>
<div class="point_content">{{ item.desc2 }}</div>
</div>
</div>
<div class="right_wrap">
<img :src="item.img" />
</div>
</div>
</template>
</div>
</div>
<qrCode :codeUrl="code" :phone="phone"></qrCode>
<el-dialog class="video-dialog" :visible.sync="videoShow" width="50%" :before-close="handleClose">
<div slot="title" style="height: 25px"></div>
<video v-if="videoShow" width="100%" height="100%" autoplay controls src="https://img02.glsx.com.cn/scrm/video/beforeSale.mp4"></video>
</el-dialog>
</div>
</template>
<script>
import qrCode from '../../components/qr-code/index.vue'
export default {
components: {
qrCode
},
data() {
return {
videoShow: false,
code: 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/wangdy.png',
phone:'134 8079 2980',
localList: [
{
icon: 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/before_icon_1.png',
title: '车生活权益、养车权益、自店权益'
},
{
icon: 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/before_icon_2.png',
title: '客户线上化、赚钱锁客促返厂'
},
{
icon: 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/before_icon_3.png',
title: '权益提单一键配置续费策略、提升门店权益续费增营收'
}
],
localList2: [
{
icon: 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/before_icon_4.png',
img: 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/before_case1.png',
title: '碰撞维修无忧案例',
desc1: '2020年12月3日,张先生驾驶日产轩逸经过葫芦岛时与前车发生碰撞,车头几乎全部报废;张先生购车环节选购了“数字化无忧卡尊享版套餐”,里面包含了维修补偿服务。',
desc2: '通过嘀加SCRM平台触发预警推送消息到门店,门店及时联系车主进行救援并送修,为门店带来40000元回厂产值。'
},
{
icon: 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/before_icon_5.png',
img: 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/before_case2.png',
title: '整车全损无忧案例',
desc1: '2021年1月9日,李女生驾驶奔驰C级途径湖南张家界市出差,当晚留宿在朋友家小区,隔天早饭后想驾车回公司,发现车辆被盗了,报警后一直未找到爱车。李女士购车环节选购了“数字化无忧卡舒享版套餐”,里面包含了车辆置换补偿服务。',
desc2: '李女士发起补偿申请,经核定,根据权益服务合同协议,最终合计补偿李女士365800元。'
},
{
icon: 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/before_icon_6.png',
img: 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/before_case3.png',
title: '轮胎置换无忧案例',
desc1: '2021年6月15日,赵先生驾驶本田雅阁在路上正常行驶,右侧前轮胎突然出现问题,因质量问题导致无法正常行驶,只好送4S店换胎。赵先生购车环节选购了4S店推荐的“数字化无忧卡优享版套餐”,里面包含了轮胎更换补偿服务。',
desc2: '赵先生发起补偿申请,经核定,根据权益服务合同协议,补偿赵先生600元费用。'
}
]
}
},
mounted() {
// let [href] = window.location.href.split('/#/')
// let href = window.location.host;
// 从域名判断是不是广汇的
// let gxurl1 = 'http://scrm.cgacar.com'
// let gxurl2 = 'https://scrm.cgacar.com'
// if (href == gxurl1 || href == gxurl2) {
// this.code = 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/wangQiang.png'
// this.phone = '137 6013 7906'
// }
this.code = 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/wangQiang.png'
this.phone = '137 6013 7906'
},
methods: {
handleClose() {
this.videoShow = false
}
}
}
</script>
<style lang="scss" scoped>
.introduct_container {
margin-top: 17px;
}
.top_play_wrap {
height: 360px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
box-sizing: border-box;
padding-right: 50px;
.text_wrap {
box-sizing: border-box;
padding-left: 50px;
display: flex;
flex-direction: column;
justify-content: center;
position: relative;
> span {
font-size: 16px;
font-weight: 400;
color: #666666;
}
.maxTitle {
font-size: 42px;
font-weight: 600;
color: #000000;
line-height: 60px;
}
.midTitle {
font-size: 24px;
font-weight: 600;
color: #000000;
line-height: 33px;
margin: 15px 0;
}
}
.bg_wrap {
width: 480px;
height: 270px;
position: relative;
.max_icon {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 1;
}
.play_icon {
position: relative;
z-index: 2;
cursor: pointer;
}
}
}
.mid_wrapper {
background: #ffffff;
margin-top: 20px;
box-sizing: border-box;
padding: 20px;
.content_one {
box-sizing: border-box;
padding: 20px 0 14px 0;
border-bottom: 1px solid #e8e8e8;
.title {
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 18px;
position: relative;
}
.left {
width: 376px;
> i {
color: #5850ff;
width: 6px;
height: 6px;
position: absolute;
bottom: -11px;
left: -7px;
}
}
.right {
// width: calc(100% - 376px);
.icon_point {
width: 7px;
height: 7px;
background: #5850ff;
border-radius: 50%;
position: absolute;
bottom: -18px;
left: 0px;
}
}
}
.content_two {
margin-top: 15px;
.box_item_wrap {
width: 32%;
height: 80px;
background: #f7f6fd;
box-sizing: border-box;
padding: 19px 20px;
> img {
width: 42px;
height: 42px;
}
.box_title {
width: calc(100% - 82px);
font-size: 14px;
font-weight: 400;
color: #3a3a3a;
line-height: 20px;
margin-left: 10px;
}
}
}
.label_title {
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 18px;
margin-top: 40px;
margin-bottom: 10px;
}
.content_three {
.box_new_item_wrapper {
display: flex;
justify-content: space-between;
box-sizing: border-box;
padding: 20px 40px;
border: 1px solid #e8e8e8;
.left_wrap {
width: calc(100% - 330px);
height: 100%;
box-sizing: border-box;
// padding-right: 100px;
.image_wrap {
width: 42px;
height: 42px;
}
.new_title {
font-size: 14px;
font-weight: 600;
color: #333333;
line-height: 20px;
margin: 15px 0;
}
.con_wrap {
display: flex;
.point {
margin-right: 5px;
height: 17px;
width: 5px;
.icon_po {
background: #5850ff;
width: 5px;
height: 5px;
background: #5850ff;
border-radius: 50%;
}
}
.point_content {
width: calc(100% - 111px);
font-size: 12px;
font-weight: 400;
color: #666666;
line-height: 17px;
}
}
}
.right_wrap {
width: 330px;
}
}
.noborder {
border-top: 0;
border-bottom: 0;
}
}
}
::v-deep .video-dialog{
.el-dialog__header{
border-bottom: none;
background-color: #000;
.el-dialog__headerbtn{
top:15px;
font-size: 24px;
}
}
.el-dialog__body{
padding: 0;
display: flex;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 查看详情 -->
<template>
<div class="pdfDialog">
<el-dialog :visible.sync="isVisible" :title="title" :before-close="handleClose" :close-on-click-modal="false" width="860px">
<iframe width="100%" height="700px" scrolling="yes" frameborder="0" :src="pdfUrl"></iframe>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'pdfDialog',
data() {
return {}
},
props: {
isVisible: {
type: Boolean,
default: false
},
title: String,
pdfUrl: String
},
mounted() {},
methods: {
handleClose() {
this.$emit('closeDialog')
}
}
}
</script>
<style lang="scss">
.pdfDialog {
.el-dialog__header {
padding: 10px 16px 4px;
background-color: #141516;
.el-dialog__title {
color: #fff;
font-size: 16px;
}
}
.el-dialog__body {
padding: 0;
background-color: #202223;
}
}
</style>
<!-- 店面服务设置 -->
<template>
<div class="before-sale edit-equity mall-server">
<template v-if="showPage==1">
<div class="container edit-container mall-server-box">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="144px" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsx-combi-form>
<glsx-combi-form ref="editFormRefBrand" labelWidth="144px" defaultWidth="215px" formRef="editChildRefBrand" :formObj.sync="editForm" :formData="editFormDataCar">
<template slot="vehicleBrandId">
<el-select v-model="editForm.vehicleBrandId" placeholder="请选择品牌" filterable @change="handleChangeBrand(editForm.vehicleBrandId)" style="width:320px;" clearable>
<el-option v-for="item in baseData.carBrandOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
<template slot="vehicleSubBrandId">
<el-select v-model="editForm.vehicleSubBrandId" placeholder="请选择子品牌" filterable style="width:320px;" clearable>
<el-option v-for="item in baseData.carChildOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
</glsx-combi-form>
<div style="margin-left: 140px">
<p>针对包含“车主生活权益服务”的服务套餐,提供通过扫描小程序码进行领取“车主生活权益服务”。</p>
<img style="margin-top: 20px;" class="qrcodeImg" :src="qrcodeUrl" />
</div>
</div>
<!-- <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> -->
<div class="footer">
<el-button size="small" type="primary" @click="handleConfirm">确定</el-button>
</div>
</template>
<template v-if="showPage==2">
<div class="nodata_widget">
<div :style="[{ height: nodataHeight + 'px' }]" class="wrapper">
<img src="../../assets/nodata_icon.png" />
<span class="nodata_tip_1">您暂未开通售前权益服务</span>
<span class="nodata_tip_2">合作开通后,您方可在此页设置店面的服务热线和默认提单车辆品牌等。</span>
</div>
</div>
</template>
</div>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'serviceSet',
data() {
return {
size: 'small',
isBlock: true,
title: '店面服务设置',
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
qrcodeUrl: '',
editForm: {
hotline: '',
vehicleBrandId: '',
vehicleSubBrandId: ''
},
editRule: {
// hotline: [{ required: true, message: '请输入服务热线', trigger: 'change' }]
},
editFormData: [
{
label: '服务热线',
name: 'hotline',
width: '320px',
type: 'input',
maxlength: 20
}
],
editFormDataCar: [
{
label: '主营品牌',
name: 'vehicleBrandId',
addHtml: 'vehicleBrandId'
},
{
label: '',
// label: '子品牌',
name: 'vehicleSubBrandId',
addHtml: 'vehicleSubBrandId'
}
],
// 公共数据
baseData: {
carBrandOptions: [],
carChildOptions: []
},
showPage:0,
nodataHeight: 0,
}
},
components: {
glsxCombiForm
},
created() {
let clientHeight = document.documentElement.clientHeight
this.nodataHeight = clientHeight * 0.8
const openStatus = localStorage.getItem('preSetStatus')
if (openStatus == 2) {
this.showPage = 2
return
}
this.showPage = 1
this.getAllVehicleBrand()
this.getCarChildList()
},
mounted() {
if(this.showPage==2){
return
}
this.getHotline()
// this.getDefaultCarbrand()
},
methods: {
getHotline() {
this.$apis.ghBeforeSale.getHotlineApi({}).then(res => {
this.editForm.hotline = res.serviceHotline
this.qrcodeUrl = res.qrcodeUrl
})
},
getDefaultCarbrand() {
this.$apis.ghBeforeSale.getDefaultCarbrandApi({}).then(res => {
// console.log(res)
if (res) {
this.editForm.id = res.id
this.editForm.vehicleBrandId = res.vehicleBrandId
this.editForm.vehicleSubBrandId = res.vehicleSubBrandId
this.handleChangeBrand(this.editForm.vehicleBrandId, true)
}
})
},
// 获取品牌车型
getAllVehicleBrand(fn = () => {}) {
const params = {}
this.$apis.ghBeforeSale.getCarBrandListApi(params).then(res => {
// console.log(res)
this.baseData.carBrandOptions = res || []
})
},
handleChangeBrand(brandId, isRecovery = false) {
!isRecovery && (this.editForm.vehicleSubBrandId = '')
this.baseData.carChildOptions = brandId ? this.allCarChildList.find(item => item.id == brandId).childs : []
},
// 获取子品牌
getCarChildList(isRecovery = false) {
this.$apis.ghBeforeSale.getCarChildListApi({}).then(res => {
this.allCarChildList = res || []
if (isRecovery) {
this.baseData.carChildOptions = this.allCarChildList.find(item => item.id == this.editForm.vehicleBrandId).childs
}
this.getDefaultCarbrand()
})
},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.editForm)
Promise.all([this.$apis.ghBeforeSale.updateHotlineApi(params), this.$apis.ghBeforeSale.updateCarBrandApi(params)]).then(([hotlineRes, carBrandRes]) => {
this.$message({
message: hotlineRes.code == '0' && carBrandRes.code == '0' ? '操作成功' : '操作失败',
type: hotlineRes.code == '0' && carBrandRes.code == '0' ? 'success' : 'error'
})
this.getHotline()
this.getDefaultCarbrand()
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.before-sale .container {
padding: 0 !important;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.before-sale{
padding-top: 17px;
}
.before-sale .edit-container {
margin-bottom: 84px;
}
.before-sale .edit-form-container {
margin-top: 20px;
}
.before-sale .txt-center {
text-align: center;
}
.before-sale .footer {
width: calc(100% + 40px);
position: absolute;
bottom: 0;
height: 64px;
left: -40px;
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 999;
}
.before-sale .flex {
display: flex;
justify-content: space-between;
}
.before-sale .flex-grow {
flex: 1;
}
.before-sale .edit-title {
padding: 0 20px;
font-size: 16px;
font-weight: bold;
height: 58px;
line-height: 58px;
border-bottom: 1px solid #e7eaec;
margin: 0 0;
color: #333333;
}
.before-sale .edit-sub-title {
position: relative;
font-size: 13px;
font-weight: 700;
height: 32px;
line-height: 32px;
color: #333333;
margin-bottom: 20px;
padding-left: 8px;
background-color: rgba(242, 242, 242, 1);
}
.before-sale .message-Z-zinde {
z-index: 3000 !important;
}
.before-sale .txt-red {
color: red;
}
.one-line-ellipsis {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.before-sale .qrcodeImg {
width: 160px;
height: 160px;
}
.mall-server{
height: calc(100% - 94px);
}
.mall-server-box{
height: 100%;
}
.nodata_widget {
margin-top: 17px;
.wrapper {
width: 100%;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
.nodata_tip_1 {
font-size: 18px;
font-weight: 500;
color: #3a3a3a;
margin-top: 48px;
}
.nodata_tip_2 {
font-size: 14px;
font-weight: 400;
color: #3a3a3a;
margin-top: 9px;
}
}
}
</style>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<span v-if="index" class="tip_text" @click="showTable(item.show, index)">{{ item.show ? '收缩详情' : '点击查看详情' }}</span> <span v-if="index" class="tip_text" @click="showTable(item.show, index)">{{ item.show ? '收缩详情' : '点击查看详情' }}</span>
</div> </div>
<div v-if="item.show" class="table_con"> <div v-if="item.show" class="table_con">
<rule-table :bankData="bankInfo" :division="item.divisionRule" :settle="item.settleRule"></rule-table> <rule-table :bankData="item.bankInfo" :division="item.divisionRule" :settle="item.settleRule"></rule-table>
</div> </div>
</el-timeline-item> </el-timeline-item>
</template> </template>
...@@ -259,6 +259,9 @@ export default { ...@@ -259,6 +259,9 @@ export default {
} }
let str = newArr.join(',') let str = newArr.join(',')
division.inCludeStr = str division.inCludeStr = str
if(!newArr.length){
division.inCludeStr = '无'
}
return division return division
}, },
// 获取分账记录 // 获取分账记录
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</div> </div>
</div> </div>
<div class="table_widget"> <div class="table_widget">
<GLTable ref="table" :hasPage="false" :tableData="productValueInfo" :tableParams="tableParams"></GLTable> <GLTable ref="table" :hasPage="false" max-height="270" :tableData="productValueInfo" :tableParams="tableParams"></GLTable>
</div> </div>
</div> </div>
<div v-if="!show" class="openBtn h18_title" @click="showContainer"> <div v-if="!show" class="openBtn h18_title" @click="showContainer">
...@@ -181,8 +181,8 @@ export default { ...@@ -181,8 +181,8 @@ export default {
height: 9px; height: 9px;
} }
} }
.bloc-chart-container /deep/ .el-table__body-wrapper { // .bloc-chart-container /deep/ .el-table__body-wrapper {
height: 270px; // height: 270px;
overflow-y: scroll; // overflow-y: scroll;
} // }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -35,9 +35,10 @@ ...@@ -35,9 +35,10 @@
</div> </div>
</div> </div>
<div v-if="!showNewLine" class="right_widget"> <div v-if="!showNewLine" class="right_widget">
<div class="cell_wrapper flex_sc"> <div class="cell_wrapper flex_sc flex_esc">
<el-button size="mini" @click="toshowDialog">查看礼券</el-button> <el-button size="mini" @click="toshowDialog">查看礼券</el-button>
<el-button size="mini" @click="toExport">导出数据</el-button> <!-- <el-button size="mini" @click="toExport">导出数据</el-button> -->
<GLButton size="mini" fn="导出礼券" @click="toExport">导出数据</GLButton>
</div> </div>
<div style="height: 2px"></div> <div style="height: 2px"></div>
<div class="cell_wrapper flex_sc"> <div class="cell_wrapper flex_sc">
...@@ -304,6 +305,14 @@ export default { ...@@ -304,6 +305,14 @@ export default {
...params ...params
} }
converterApi(para).then(res => { converterApi(para).then(res => {
this.httpParam = {
currentPage: this.$refs.table.page.pageNum,
pageSize: this.$refs.table.page.pageSize,
...params
}
if(!res){
return
}
this.tableData = res.list.map(item => { this.tableData = res.list.map(item => {
item.createdDate = utils.dateFormat(item.createdDate, 'YYYY-MM-DD HH:mm:ss') item.createdDate = utils.dateFormat(item.createdDate, 'YYYY-MM-DD HH:mm:ss')
item.usedTime = item.usedTime ? utils.dateFormat(item.usedTime, 'YYYY-MM-DD HH:mm:ss') : '--' item.usedTime = item.usedTime ? utils.dateFormat(item.usedTime, 'YYYY-MM-DD HH:mm:ss') : '--'
...@@ -313,11 +322,6 @@ export default { ...@@ -313,11 +322,6 @@ export default {
return item return item
}) })
this.tableTotal = res.total this.tableTotal = res.total
this.httpParam = {
currentPage: this.$refs.table.page.pageNum,
pageSize: this.$refs.table.page.pageSize,
...params
}
}) })
}, },
toOpenCoupons() { toOpenCoupons() {
...@@ -410,6 +414,10 @@ export default { ...@@ -410,6 +414,10 @@ export default {
width: 156px; width: 156px;
} }
} }
.flex_esc{
display: flex;
justify-content: flex-end;
}
.customselect /deep/ .el-select .el-input--mini .el-input__inner { .customselect /deep/ .el-select .el-input--mini .el-input__inner {
// border-left: none; // border-left: none;
border-top-left-radius: 0; border-top-left-radius: 0;
...@@ -465,10 +473,10 @@ export default { ...@@ -465,10 +473,10 @@ export default {
} }
} }
.table_wrap /deep/ .el-table--enable-row-hover .el-table__body tr:hover{ // .table_wrap /deep/ .el-table--enable-row-hover .el-table__body tr:hover{
background: #f4f3ff !important; // background: #f4f3ff !important;
} // }
.table_wrap /deep/ .el-table tbody tr:hover >td{ // .table_wrap /deep/ .el-table tbody tr:hover >td{
background: #f4f3ff !important; // background: #f4f3ff !important;
} // }
</style> </style>
...@@ -109,8 +109,8 @@ ...@@ -109,8 +109,8 @@
</div> </div>
</div> </div>
<qrCode :codeUrl="code" phone="188 2423 1191"></qrCode> <qrCode :codeUrl="code" phone="188 2423 1191"></qrCode>
<el-dialog :visible.sync="videoShow" width="50%" :before-close="handleClose"> <el-dialog class="video-dialog" :visible.sync="videoShow" width="50%" :before-close="handleClose">
<div slot="title" style="height:18px"></div> <div slot="title" style="height:25px"></div>
<video v-if="videoShow" width="100%" height="100%" autoplay controls src="https://img02.glsx.com.cn/scrm/video/totalSale.mp4"></video> <video v-if="videoShow" width="100%" height="100%" autoplay controls src="https://img02.glsx.com.cn/scrm/video/totalSale.mp4"></video>
</el-dialog> </el-dialog>
</div> </div>
...@@ -569,4 +569,18 @@ export default { ...@@ -569,4 +569,18 @@ export default {
} }
} }
} }
::v-deep .video-dialog{
.el-dialog__header{
border-bottom: none;
background-color: #000;
.el-dialog__headerbtn{
top:15px;
font-size: 24px;
}
}
.el-dialog__body{
padding: 0;
display: flex;
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -51,6 +51,10 @@ ...@@ -51,6 +51,10 @@
</div> </div>
<div class="right_widget"> <div class="right_widget">
<div class="cell_wrapper flex_sc"> <div class="cell_wrapper flex_sc">
<!-- <el-button class="cell_btn_max" size="mini" @click="toExport">导出数据</el-button> -->
<GLButton class="cell_btn_max" size="mini" fn="导出分账订单" @click="toExport">导出数据</GLButton>
</div>
<div class="cell_wrapper flex_sc">
<el-button class="cell_btn" size="mini" @click="clearFind">重置</el-button> <el-button class="cell_btn" size="mini" @click="clearFind">重置</el-button>
<el-button class="cell_btn" size="mini" type="primary" @click="handlerParams">查询</el-button> <el-button class="cell_btn" size="mini" type="primary" @click="handlerParams">查询</el-button>
</div> </div>
...@@ -106,7 +110,6 @@ ...@@ -106,7 +110,6 @@
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { mydivision, exportMydivision, myAccountTotalNumOfJT } from '../../api/modules/rules' import { mydivision, exportMydivision, myAccountTotalNumOfJT } from '../../api/modules/rules'
import { converterApi } from '../../api/modules/converter' import { converterApi } from '../../api/modules/converter'
...@@ -406,7 +409,7 @@ export default { ...@@ -406,7 +409,7 @@ export default {
delete params.successDateStartDate delete params.successDateStartDate
delete params.successDateEndDate delete params.successDateEndDate
} }
if(!this.divisionTime&&!this.payTime){ if (!this.divisionTime && !this.payTime) {
params = this.resetTime() params = this.resetTime()
} }
if (this.divisionTypeStatus) { if (this.divisionTypeStatus) {
...@@ -508,13 +511,20 @@ export default { ...@@ -508,13 +511,20 @@ export default {
let method = exportMydivision() let method = exportMydivision()
let para = { let para = {
routerMethod: method, routerMethod: method,
currentPage: this.$refs.table.page.pageNum,
pageSize: this.$refs.table.page.pageSize,
...this.httpParam ...this.httpParam
} }
converterApi(para).then(res => { converterApi(para).then(res => {
let tempaa = utils.getExplorer()
if (tempaa == 'QQ') {
window.open(res)
} else {
let iframe = document.createElement('iframe') let iframe = document.createElement('iframe')
iframe.style.display = 'none' iframe.style.display = 'none'
iframe.src = res iframe.src = res
document.body.appendChild(iframe) document.body.appendChild(iframe)
}
}) })
} }
} }
...@@ -607,10 +617,10 @@ export default { ...@@ -607,10 +617,10 @@ export default {
margin-bottom: 20px; margin-bottom: 20px;
} }
// 表格悬浮样式 // 表格悬浮样式
.table_wrap /deep/ .el-table--enable-row-hover .el-table__body tr:hover { // .table_wrap /deep/ .el-table--enable-row-hover .el-table__body tr:hover {
background: #f4f3ff !important; // background: #f4f3ff !important;
} // }
.table_wrap /deep/ .el-table tbody tr:hover > td { // .table_wrap /deep/ .el-table tbody tr:hover > td {
background: #f4f3ff !important; // background: #f4f3ff !important;
} // }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -79,8 +79,23 @@ ...@@ -79,8 +79,23 @@
</div> </div>
</template> </template>
</div> </div>
<el-dialog :visible.sync="videoShow" width="50%" :before-close="handleClose"> <div class="step_wrap">
<div slot="title" style="height:18px"></div> <span class="nodata_tip_3">精品合作升级流程</span>
<div class="step flex_scb">
<div class="stepIcon flex_cc">1</div>
<div class="stepLine"></div>
<div class="stepIcon flex_cc">2</div>
<div class="stepLine"></div>
<div class="stepIcon flex_cc">3</div>
</div>
<div class="step_content flex_scb">
<span class="h13_title">联系嘀加精品业务经理,开通此业务</span>
<span class="h13_title">确定合作细则,销售专员转发精品礼券</span>
<span class="h13_title">车主完成精品升级,您获得分账收益</span>
</div>
</div>
<el-dialog class="video-dialog" :visible.sync="videoShow" width="50%" :before-close="handleClose">
<div slot="title" style="height: 25px"></div>
<video v-if="videoShow" width="100%" height="100%" autoplay controls src="https://img02.glsx.com.cn/scrm/video/upgrade.mp4"></video> <video v-if="videoShow" width="100%" height="100%" autoplay controls src="https://img02.glsx.com.cn/scrm/video/upgrade.mp4"></video>
</el-dialog> </el-dialog>
<qrCode phone="138 2651 0577" :codeUrl="code"></qrCode> <qrCode phone="138 2651 0577" :codeUrl="code"></qrCode>
...@@ -335,4 +350,66 @@ export default { ...@@ -335,4 +350,66 @@ export default {
margin-top: 25px; margin-top: 25px;
} }
} }
.step_wrap {
width: 100%;
padding: 20px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
margin-top: 10px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.nodata_tip_3 {
width: 100%;
height: 25px;
font-size: 18px;
font-weight: 600;
color: #000000;
line-height: 25px;
margin-bottom: 40px;
text-align: left;
}
.step,
.step_content {
width: 100%;
box-sizing: border-box;
padding: 0 50px;
}
.step {
padding: 0 146px;
}
.step_content {
margin-top: 22px;
}
.stepLine {
width: 40%;
height: 1px;
background: #5850ff;
}
.stepIcon {
width: 32px;
height: 32px;
background: #5850ff;
font-size: 14px;
font-weight: 400;
color: #ffffff;
border-radius: 50%;
}
}
::v-deep .video-dialog{
.el-dialog__header{
border-bottom: none;
background-color: #000;
.el-dialog__headerbtn{
top:15px;
font-size: 24px;
}
}
.el-dialog__body{
padding: 0;
display: flex;
}
}
</style> </style>
...@@ -378,7 +378,9 @@ export default { ...@@ -378,7 +378,9 @@ export default {
'merchantAccountLevelList[0]': temp 'merchantAccountLevelList[0]': temp
} }
get4SList(para).then(res => { get4SList(para).then(res => {
if(res){
this.storeList = res.list || [] this.storeList = res.list || []
}
}) })
} }
} }
......
...@@ -20,7 +20,12 @@ ...@@ -20,7 +20,12 @@
</div> --> </div> -->
</div> </div>
<div class="table_widget"> <div class="table_widget">
<el-table :data="tableData" height="350" style="100%" highlight-current-row> <el-table :data="tableData" class="hightline" height="350" style="100%" highlight-current-row>
<el-table-column fixed="left" width="5">
<template slot-scope="scope">
<span :scope="scope"></span>
</template>
</el-table-column>
<el-table-column label="排名" width="100" align="center" type="index" :index="index => index + 1"></el-table-column> <el-table-column label="排名" width="100" align="center" type="index" :index="index => index + 1"></el-table-column>
<el-table-column prop="merchantName" label="门店名称" align="center"></el-table-column> <el-table-column prop="merchantName" label="门店名称" align="center"></el-table-column>
<el-table-column label="总产值" width="500"> <el-table-column label="总产值" width="500">
...@@ -178,10 +183,10 @@ export default { ...@@ -178,10 +183,10 @@ export default {
} }
} }
} }
.table_widget /deep/ .el-table--enable-row-hover .el-table__body tr:hover{ // .table_widget /deep/ .el-table--enable-row-hover .el-table__body tr:hover{
background: #f4f3ff !important; // background: #f4f3ff !important;
} // }
.table_widget /deep/ .el-table tbody tr:hover >td{ // .table_widget /deep/ .el-table tbody tr:hover >td{
background: #f4f3ff !important; // background: #f4f3ff !important;
} // }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -51,17 +51,24 @@ ...@@ -51,17 +51,24 @@
</div> </div>
<div class="table_four flex_scb border_all"> <div class="table_four flex_scb border_all">
<div class="h9_title"> <div class="h9_title">
<span>收款账户:{{ division.realityShopMerchantName }}</span> <span v-if="division.inCludeStr!='无'">收款账户:{{ division.realityShopMerchantName || '无'}}</span>
<span v-if="division.inCludeStr=='无'">收款账户:无</span>
</div> </div>
</div> </div>
</div> </div>
<div class="min_widget"> <div class="min_widget">
<div class="title h7_title">对公账户信息</div> <div class="title h7_title">对公账户信息</div>
<div v-if="bankData" class="info_widget"> <div v-if="bankData&&division.inCludeStr!='无'" class="info_widget">
<span class="h9_title">开户账户户行:{{ bankData.bankName }}</span> <span class="h9_title">开户账户户行:{{ bankData.bankName || '无'}}</span>
<span class="h9_title">开户支行:{{ bankData.openAccBankName }}</span> <span class="h9_title">开户支行:{{ bankData.openAccBankName || '无'}}</span>
<span class="h9_title">账户号:{{ bankData.bankAccountNo }}</span> <span class="h9_title">账户号:{{ bankData.bankAccountNo || '无'}}</span>
<span class="h9_title">账户名称:{{ bankData.bankAccountName }}</span> <span class="h9_title">账户名称:{{ bankData.bankAccountName || '无'}}</span>
</div>
<div v-if="division.inCludeStr=='无'" class="info_widget">
<span class="h9_title">开户账户户行:无</span>
<span class="h9_title">开户支行:无</span>
<span class="h9_title">账户号:无</span>
<span class="h9_title">账户名称:无</span>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -60,7 +60,8 @@ ...@@ -60,7 +60,8 @@
<!-- :style="'flex:'+flexWidth" --> <!-- :style="'flex:'+flexWidth" -->
<div class="right_widget"> <div class="right_widget">
<div class="cell_wrapper flex_sc"> <div class="cell_wrapper flex_sc">
<el-button class="cell_btn_max" size="mini" @click="toExport">导出数据</el-button> <!-- <el-button class="cell_btn_max" size="mini" @click="toExport">导出数据</el-button> -->
<GLButton class="cell_btn_max" size="mini" fn="导出精品升级订单" @click="toExport">导出数据</GLButton>
</div> </div>
<div class="cell_wrapper flex_sc"> <div class="cell_wrapper flex_sc">
<el-button class="cell_btn" size="mini" @click="clearFind">重置</el-button> <el-button class="cell_btn" size="mini" @click="clearFind">重置</el-button>
...@@ -70,7 +71,7 @@ ...@@ -70,7 +71,7 @@
</div> </div>
<div v-if="accountLevel < 3" class="find_wrap new_find_wrapper"> <div v-if="accountLevel < 3" class="find_wrap new_find_wrapper">
<div class="left_widget"> <div class="left_widget">
<div class="cell_wrapper flex_sc" style="margin-right:5px"> <div class="cell_wrapper flex_sc" style="margin-right: 5px">
<div class="cell_label h13_title">商户名</div> <div class="cell_label h13_title">商户名</div>
<!-- <div v-if="accountLevel == 2" class="cell_label h13_title">商户名</div> --> <!-- <div v-if="accountLevel == 2" class="cell_label h13_title">商户名</div> -->
<!-- <div v-if="accountLevel == 1 && !isAdmin" class="cell_label h13_title">省级经销商</div> <!-- <div v-if="accountLevel == 1 && !isAdmin" class="cell_label h13_title">省级经销商</div>
...@@ -169,7 +170,13 @@ ...@@ -169,7 +170,13 @@
</div> </div>
</div> </div>
<div class="table_wrap"> <div class="table_wrap">
<el-table id="initTable" :data="tableData"> <el-table id="initTable" class="hightline" :data="tableData">
<!-- //实现高亮竖线 -->
<el-table-column fixed="left" width="5">
<template slot-scope="scope">
<span :scope="scope"></span>
</template>
</el-table-column>
<el-table-column label="序号" align="center" width="100px" type="index" :index="index => index + (currentPage - 1) * pageSize + 1"></el-table-column> <el-table-column label="序号" align="center" width="100px" type="index" :index="index => index + (currentPage - 1) * pageSize + 1"></el-table-column>
<el-table-column label="订单信息" align="center"> <el-table-column label="订单信息" align="center">
<template v-for="(ele, index) in tableCoulumList"> <template v-for="(ele, index) in tableCoulumList">
...@@ -363,6 +370,7 @@ import { converterApi } from '../../api/modules/converter' ...@@ -363,6 +370,7 @@ import { converterApi } from '../../api/modules/converter'
import utils from '../../util/util' import utils from '../../util/util'
const logTypeList = ['预录用户', '用户下单', '用户付款', '完成服务'] const logTypeList = ['预录用户', '用户下单', '用户付款', '完成服务']
const orderStatusList = ['待升级', '未升级', '待支付', '已支付', '已退款', '已完成'] const orderStatusList = ['待升级', '未升级', '待支付', '已支付', '已退款', '已完成']
export default { export default {
name: '', name: '',
components: { components: {
...@@ -888,7 +896,8 @@ export default { ...@@ -888,7 +896,8 @@ export default {
this.detailImageList.push(this.detailImage) this.detailImageList.push(this.detailImage)
this.dialogVisible = true this.dialogVisible = true
}) })
} },
} }
} }
</script> </script>
...@@ -948,9 +957,9 @@ export default { ...@@ -948,9 +957,9 @@ export default {
right: 15px; right: 15px;
} }
} }
.new_find_wrapper{ .new_find_wrapper {
// padding: 9px 0 9px 15px; // padding: 9px 0 9px 15px;
padding:0 0 0 15px; padding: 0 0 0 15px;
} }
.tipper { .tipper {
width: 100%; width: 100%;
...@@ -1058,62 +1067,10 @@ export default { ...@@ -1058,62 +1067,10 @@ export default {
.right_select /deep/ .el-select .el-tag__close.el-icon-close { .right_select /deep/ .el-select .el-tag__close.el-icon-close {
display: none; display: none;
} }
// .table_wrap /deep/ .el-table__body-wrapper::-webkit-scrollbar { .table_wrap /deep/ .el-table__row>td{
// /*width: 0;宽度为0隐藏*/ border-right: none;
// width: 2px !important; }
// border: none; .table_wrap /deep/ .el-table th.is-leaf:first-child{
// } border-right: none;
// .table_wrap /deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb { }
// border-radius: 6px;
// height: 2px !important;
// background: #E9E8FF; //滚动条颜色
// border: none;
// }
// .table_wrap /deep/ .el-table__body-wrapper::-webkit-scrollbar-track {
// // box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
// border-radius: 6px;
// background: white; //滚动条背景色
// border: none;
// }
// .table_wrap /deep/ .el-table__body-wrapper::-webkit-scrollbar {
// width: 10px;
// height: 10px;
// /* display: none; */
// }
// /*正常情况下滑块的样式*/
// .table_wrap /deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb {
// background-color: rgba(0, 0, 0, 0.05);
// border-radius: 10px;
// box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
// }
// /*鼠标悬浮在该类指向的控件上时滑块的样式*/
// .table_wrap /deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb {
// /* background-color: rgba(0, 0, 0, 0.2); */
// background: #e9e8ff;
// border-radius: 10px;
// box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
// }
// /*鼠标悬浮在滑块上时滑块的样式*/
// /* &::-webkit-scrollbar-thumb:hover {
// background-color: rgba(0, 0, 0, 0.4);
// box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
// } */
// /*正常时候的主干部分*/
// .table_wrap /deep/ .el-table__body-wrapper::-webkit-scrollbar-track {
// border-radius: 10px;
// box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
// background-color: white;
// }
</style> </style>
...@@ -3,11 +3,12 @@ const packageName = require('./package.json').name ...@@ -3,11 +3,12 @@ const packageName = require('./package.json').name
const node_env = process.env.NODE_ENV === 'production' const node_env = process.env.NODE_ENV === 'production'
const publicPath = node_env ? `/child/${packageName}/` : '/' const publicPath = node_env ? `/child/${packageName}/` : '/'
const resolve = dir => path.join(__dirname, dir) const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://cdn.bootcdn.net/' // const CDN_DOMAIN = 'https://cdn.bootcdn.net/'
const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const cdn = { const cdn = {
//css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`], css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.13.0/theme-chalk/index.css`], // css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.13.0/theme-chalk/index.css`],
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.13.0/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`] js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`]
} }
module.exports = { module.exports = {
outputDir: `../dist/${packageName}`, outputDir: `../dist/${packageName}`,
...@@ -46,6 +47,7 @@ module.exports = { ...@@ -46,6 +47,7 @@ module.exports = {
'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头 'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头
} }
}, },
lintOnSave: false,
chainWebpack: config => { chainWebpack: config => {
config.plugin('html').tap(args => { config.plugin('html').tap(args => {
// args[0].minify.removeComments = false; // args[0].minify.removeComments = false;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!