Commit 0fa678aa by 张权

核赔简易版

1 parent 3e21eee1
......@@ -163,7 +163,7 @@ const getProListApi = params => {
// 获取无忧卡套餐列表
const getPackageListApi = params => {
params.method = `scrm.api.equity.service.package.dj.list.get`
// params.method = `scrm.api.equity.service.package.list.get`
// params.method = `scrm.api.equity.service.package.list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
......@@ -325,50 +325,106 @@ const spaAgressData = params => {
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
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,
})
}
// 卡号---获取期限
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
})
}
const getWriteOffList = params => {
params.method = `scrm.api.equity.service.claims.list`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 导出核赔列表
const exportWriteOffData = params => {
params.method = `scrm.api.equity.service.claims.list.export`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: 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
// 核赔判断并获取服务
const getWriteOffService = params => {
params.method = `scrm.api.equity.service.claims.create.before.init`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取核赔订单详情
const getWriteOffDetail = params => {
params.method = `scrm.api.equity.service.claims.detail`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 保存核赔订单
const saveWriteOff = params => {
params.method = `scrm.api.equity.service.claims.save`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: 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, getWriteOffList, exportWriteOffData, getWriteOffService, getWriteOffDetail, saveWriteOff }
......@@ -7,7 +7,7 @@
::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 4px;
background-color: rgba(144, 147, 153, .3);
background-color: rgba(144, 147, 153, 0.3);
}
.h1_title {
......@@ -44,7 +44,7 @@
.h6_title {
font-size: 16px;
font-weight: 500;
color: #3A3A3A;
color: #3a3a3a;
}
.h7_title {
......@@ -56,7 +56,7 @@
.h8_title {
font-size: 24px;
font-weight: 600;
color: #3A3A3A;
color: #3a3a3a;
}
.h9_title {
......@@ -68,7 +68,7 @@
.h10_title {
font-size: 12px;
font-weight: 400;
color: #3A3A3A;
color: #3a3a3a;
}
.h11_title {
......@@ -92,19 +92,19 @@
.h14_title {
font-size: 14px;
font-weight: 400;
color: #37383A;
color: #37383a;
}
.h15_title {
font-size: 14px;
font-weight: 500;
color: #5850FF;
color: #5850ff;
}
.h16_title {
font-size: 12px;
font-weight: 500;
color: #5850FF;
color: #5850ff;
}
.h17_title {
......@@ -161,20 +161,32 @@
flex-direction: column;
}
.el-message{
z-index: 3000!important;
.el-message {
z-index: 3000 !important;
}
.customConfirm{
.customConfirm {
.el-message-box__btns button:nth-child(2) {
margin-left: 20px;
}
}
.el-message.el-message--error.customMessage{
&>p{
&>p{
.el-message.el-message--error.customMessage {
& > p {
& > p {
white-space: nowrap;
}
}
}
\ No newline at end of file
}
.my-footer {
width: 100%;
position: fixed;
bottom: 0;
height: 64px;
left: 0;
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 0;
}
<!-- 搜索 -->
<template>
<div class="glsx-combi-form">
<el-form :ref="formRef" :inline="true" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<el-form @submit.native.prevent :ref="formRef" :inline="true" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<template v-for="(item, index) in formData">
<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">
<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 class="tips-label">{{ item.label }}</span>
<el-tooltip popper-class="tooltip-class" effect="dark" :content="item.tips" :placement="item.placement || 'top'">
......@@ -12,11 +12,11 @@
{{ 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 class="combi-form-label" :style="{ width: item.labelWidth ? item.labelWidth + labelPaddingRight + 'px' : '', 'padding-right': isEdit ? '12px' : labelPaddingRight + 'px' }">{{ item.label }}</span>
</span>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)" @blur="e => handleInputBlur(e, item)">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)" @blur="e => handleInputBlur(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="append">{{ item.append }}</span>
</el-input>
......@@ -24,7 +24,7 @@
</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 || defaultWidth }" class="input-with-select">
<el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || (labelWidth + 'px') }" 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-select>
</el-input>
......@@ -57,6 +57,11 @@
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio>
</el-radio-group>
<el-date-picker v-else-if="item.type === 'datePicker'" :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>
<!-- 当存在range-separato,start-placeholder,end-placeholder这几个属性时,日期可以限制,时间不可以限制 -->
<el-date-picker v-else-if="item.type === 'limitDatePicker'" :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" :placeholder="item.placeholder || '请选择' + item.label" :picker-options="item.customPickerOptions || pickerOption[item.pickerOptions]" @change="e => handleDateChange(e, item)" @focus="e => item.focus(e)"></el-date-picker>
<el-checkbox-group v-else-if="item.type === 'checkbox'" v-model="formObj[item.name]">
<el-checkbox v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionId]" :border="item.border">{{ subItem[item.optionLabel] }}</el-checkbox>
</el-checkbox-group>
<template v-else-if="item.type === 'upload'">
<p class="photo-top-tips">{{ item.topTips }}</p>
<div v-if="!item.isDisabled" :style="{ width: item.width || defaultWidth }">
......@@ -99,10 +104,10 @@
</template>
<slot name="footer"></slot>
</el-form>
<el-dialog v-if="isImgVisible" :append-to-body="true" :modal-append-to-body="true" title="查看" :visible.sync="isImgVisible">
<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>
<source :src="dialogObj.url" type="video/mp4">
<source :src="dialogObj.url" type="video/mp4" />
</video>
<img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" />
</div>
......@@ -111,7 +116,7 @@
</template>
<script>
import { beforeRangePickerOptions, afterRangePickerOptions,afterTodayRangePickerOptions } from './common'
import { beforeRangePickerOptions, afterRangePickerOptions, afterTodayRangePickerOptions } from './common'
export default {
name: 'glsx-combi-form',
data() {
......@@ -185,8 +190,8 @@ export default {
selectAddAttr(value, targetItem) {
targetItem.changeAttr && targetItem.changeAttr(value, targetItem)
},
remoteMethod(value){
console.log(value,111)
remoteMethod(value) {
console.log(value, 111)
},
handleInputDown(e, item) {
if (e.keyCode === 13 && item.hasOwnProperty('keyFn')) {
......@@ -358,7 +363,7 @@ export default {
.glsx-combi-form .activity-img {
position: relative;
color: #999999;
background-color: #F7F7F7;
background-color: #f7f7f7;
border: 1px dotted #d9d9d9;
cursor: pointer;
}
......@@ -438,16 +443,16 @@ export default {
/* 图片上传 */
.glsx-combi-form .el-tag.el-tag--info .el-tag__close {
color: #E8E8EA;
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;
background-color: #e8e8ea;
}
.glsx-combi-form .el-tag.el-tag--info .el-tag__close:hover {
background-color: #E8E8EA;
background-color: #e8e8ea;
}
</style>
......@@ -72,6 +72,24 @@ const staticRoutes = Object.freeze([
meta: {}
},
{
name: 'writeOffList',
path: '/ghPreSale/index',
component: resolve => require([`@/views/ghPreSale/writeOff/writeOffList`], resolve),
meta: {}
},
{
name: 'addwriteOff',
path: '/ghPreSale/writeOff/addwriteOff',
component: resolve => require([`@/views/ghPreSale/writeOff/addwriteOff`], resolve),
meta: {}
},
{
name: 'writeOffDetail',
path: '/ghPreSale/writeOff/writeOffDetail/:id',
component: resolve => require([`@/views/ghPreSale/writeOff/writeOffDetail`], resolve),
meta: {}
},
{
name: 'index',
path: '/expert/index',
component: resolve => require([`@/views/expert/index.vue`], resolve),
......
<!-- 编辑权益 -->
<template>
<div class="before-sale edit-equity edit-order">
<div style="padding: 17px 0 55px;">
<!-- <div class="help-service">
<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 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>
</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>
</el-radio>
</el-radio-group>
</template>
</glsx-combi-form>
</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 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>
......@@ -148,30 +147,39 @@ export default {
seatesNum: 5,
billingDate: new Date()
},
actualSalesPerson:'',
actualSalesPersonId:'',
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'
}],
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' }],
......@@ -263,24 +271,31 @@ export default {
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'
}],
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: [
......@@ -420,7 +435,7 @@ export default {
optionList: [],
optionId: 'userOneid',
optionLabel: 'staffName',
changeAttr: (userOneid,targetItem)=>{
changeAttr: (userOneid, targetItem) => {
const target = targetItem.optionList.find(item => {
return item.userOneid == userOneid
})
......@@ -433,12 +448,12 @@ export default {
type: 'radio',
optionList: [
{
confLabel:'无忧卡首保',
confId:'i'
confLabel: '无忧卡首保',
confId: 'i'
},
{
confLabel:'无忧卡续保',
confId:'c'
confLabel: '无忧卡续保',
confId: 'c'
}
],
optionId: 'confId',
......@@ -560,17 +575,17 @@ export default {
},
methods: {
getSalePeople(val){
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)=>{
if (res.code === '0') {
const id = this.editFormDataOther.findIndex(item => {
return item.name == 'actualSalesPersonId'
})
this.$nextTick(() =>{
this.$nextTick(() => {
this.editFormDataOther[id].optionList = res.data
})
}
......@@ -592,7 +607,7 @@ export default {
})
}
},
handleCancelBubble(e) { },
handleCancelBubble(e) {},
getDefaultCarbrand() {
this.$apis.ghBeforeSale.getDefaultCarbrandApi({}).then(res => {
// 获取套餐列表
......@@ -615,14 +630,15 @@ export default {
},
getInfo() {
this.$apis.ghBeforeSale.getEquityApi({ contractNo: this.routeInfo.contractNo }).then(res => {
if(this.routeInfo.isSuper){ //超管不能修改以及不能获取到全部员工的列表
const id = this.editFormDataOther.findIndex((item)=>{
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].optionList = [{ userOneid: res?.actualSalesPersonId, staffName: res?.actualSalesPerson }]
this.editFormDataOther[id].isDisabled = true
}
this.editForm = {
...res
}
......@@ -677,25 +693,26 @@ export default {
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)
}
})
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){
setInsuranceType(targetItem) {
const targetNameList = ['尊享版', '优享版', '舒享版']
if(targetNameList.includes(targetItem.packageName)){
if(targetItem.packageName==='舒享版'){
if (targetNameList.includes(targetItem.packageName)) {
if (targetItem.packageName === '舒享版') {
this.editForm.insuranceType = 'c'
}else{
} else {
this.editForm.insuranceType = 'i'
}
const id = this.editFormDataOther.findIndex((item)=>{
const id = this.editFormDataOther.findIndex(item => {
return item.name == 'insuranceType'
})
this.editFormDataOther[id].isDisabled = true
......@@ -709,41 +726,45 @@ export default {
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] : '')
})
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.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)
})
this.$set(this.editFormPro, hashObj[item.attributeName] != 1 ? (item.attributeName + item.sort) : item.attributeName, item.attributeValue)
})
},
autoGenerate() {
var tempList = []
......@@ -760,8 +781,7 @@ export default {
})
if (k.attributeList[0].attributeType == 'datePicker') {
tempList[idx].dateType = 'date'
tempList[idx].valueFormat = 'yyyy-MM-dd',
tempList[idx].pickerOptions = 'beforeRangePickerOptions'
;(tempList[idx].valueFormat = 'yyyy-MM-dd'), (tempList[idx].pickerOptions = 'beforeRangePickerOptions')
}
} else {
var tableList = []
......@@ -815,8 +835,8 @@ export default {
}
} else {
this[formName].forEach((item, index) => {
if(item.optionsName){
if (item.type === 'select' && this.baseData[item.optionsName].length) {
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 = {}
......@@ -830,7 +850,7 @@ export default {
}
},
// 获取品牌车型
getAllVehicleBrand(fn = () => { }) {
getAllVehicleBrand(fn = () => {}) {
const params = {}
this.$apis.ghBeforeSale.getCarBrandListApi(params).then(res => {
this.baseData.carBrandOptions = res || []
......@@ -924,11 +944,11 @@ export default {
targetItem.groupAttributeList.forEach(item => {
if (item.attributeList.length == 1) {
let targetAttributeValue = ''
if(item.attributeList[0].attributeGroup == 'additional_price'){
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'){
} else if (item.attributeList[0].attributeGroup == 'additional_date') {
targetAttributeValue = this.editFormPro[item.attributeList[0].attributeGroup] ? utils.dateFormat(this.editFormPro[item.attributeList[0].attributeGroup]) : ''
}else{
} else {
targetAttributeValue = this.editFormPro[item.attributeList[0].attributeGroup] ? this.editFormPro[item.attributeList[0].attributeGroup] : ''
}
params.attributeList.push({
......@@ -982,7 +1002,7 @@ export default {
background: 'rgba(0, 0, 0, 0.3)'
})
this.$apis.ghBeforeSale.updateEquityApi(params).then(res => {
loading.close();
loading.close()
this.submit = false
if (res.errId == 'A1307') {
this.whereToGo('vin')
......@@ -1071,8 +1091,8 @@ export default {
seatesNum: 5,
billingDate: new Date()
},
actualSalesPerson:'',
actualSalesPersonId:'',
actualSalesPerson: '',
actualSalesPersonId: '',
insuranceType: 'i'
}
this.$apis.ghBeforeSale.getDefaultCarbrandApi({}).then(res => {
......@@ -1120,10 +1140,10 @@ export default {
box-shadow: 0px 3px 6px -4px rgba(0, 0, 0, 0.12);
}
.edit-order{
padding-top: 0!important;
height:100%;
overflow-y:auto;
.edit-order {
padding-top: 0 !important;
height: 100%;
overflow-y: auto;
}
.help-service .service-img {
......@@ -1146,7 +1166,7 @@ export default {
.edit-order .container {
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 0!important;
padding: 0 !important;
margin-bottom: 10px;
}
......@@ -1160,14 +1180,14 @@ export default {
.before-sale .footer {
width: 100%;
position: absolute;
position: fixed;
bottom: 0;
height: 64px;
left: 0;
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 999;
z-index: 0;
}
/* .operate-btn .el-button{
......@@ -1179,7 +1199,6 @@ export default {
margin-top: 20px;
}
.before-sale .flex {
display: flex;
justify-content: space-between;
......@@ -1232,25 +1251,25 @@ export default {
margin-bottom: 20px;
}
/deep/ .select-product{
.package-code>.el-radio__input{
/deep/ .select-product {
.package-code > .el-radio__input {
margin-left: 73px;
}
.package-code>.el-radio__label>.radio-add-block>.package-subtitle{
.package-code > .el-radio__label > .radio-add-block > .package-subtitle {
margin-left: 76px;
}
}
}
.select-product .el-radio__label{
.select-product .el-radio__label {
padding-left: 7px;
}
.select-product .package-title{
.select-product .package-title {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 600;
}
.select-product .package-subtitle{
.select-product .package-subtitle {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
......@@ -1271,7 +1290,7 @@ export default {
}
/deep/ .no-label.el-form-item--small .el-form-item__content {
width: auto;
}
}
/* 表格 */
/* .edit-equity .spesc-label {
padding: 1px 10px;
......@@ -1314,16 +1333,16 @@ export default {
cursor: pointer;
}
.plain{
.plain {
border: 1px solid #5850ff;
color: #5850ff;
}
.reset-btn{
.reset-btn {
border: 1px solid #909090;
color: #333333;
}
.sub-el-form{
.sub-el-form {
margin-left: 50px;
}
/* 表格 */
......
<template>
<div id="writeOff" class="writeOff">
<template v-if="!isSavePage">
<div class="header">客户信息</div>
<div class="main box">
<glsx-combi-form ref="writeOff" :formRules="checkRule" labelWidth="128px" defaultWidth="308px" :formObj="batchListSearch" :formData="writeOffForm"></glsx-combi-form>
<div class="signal-img">
<p>核销码示意图</p>
<img :src="url" alt="" />
</div>
</div>
</template>
<template v-if="isSavePage">
<div class="custom box">
<div class="header">报案信息(客户提交)</div>
<div class="custom-info">
<span class="code label">核销码:</span>
<span class="code">{{ customObj.writeOffCode }}</span>
<glsx-combi-form ref="customRef" :formRules="customRule" labelWidth="160px" defaultWidth="300px" :formObj="customObj" :formData="customForm"></glsx-combi-form>
</div>
</div>
<div class="handler box" style="margin-top: 10px">
<div class="header">报案信息(店面补充)</div>
<div class="handler-info">
<glsx-combi-form ref="handlerRef" :formRules="customRule" labelWidth="160px" defaultWidth="300px" :formObj="customObj" :formData="handlerForm"></glsx-combi-form>
</div>
</div>
</template>
<div class="my-footer btn-box box">
<el-button v-if="!isSavePage" size="small" type="primary" @click="handleNextStep">下一步</el-button>
<el-button v-else size="small" type="primary" @click="handleSave">提交</el-button>
<el-button type="default" size="small" @click="handleCancel">取消</el-button>
</div>
<qrCode :bottom="320" :codeUrl="serviceImg" phoneTitle="提单及服务咨询" phone="189 3890 7441"></qrCode>
</div>
</template>
<script type="text/ecmascript-6">
import glsxCombiForm from '@/components/glsx-combi-form'
import util from '@/util/util'
import url from '@/assets/write_off.png'
import serviceImg from '../image/code.png'
import qrCode from '@/components/qr-code/index.vue'
const 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}$/
export default {
name: 'addwriteOff',
data() {
return {
url,
serviceImg,
isSavePage: false,
batchListSearch: {
writeOffCode: ''
},
errMeg: '',
checkRule: {
writeOffCode: [
{
validator: (rule, value, callback) => {
let writeOffCodeReg = /^[0-9]{8}$/
return writeOffCodeReg.test(value) ? callback() : callback(new Error('请输入正确的核销码'))
},
trigger: 'change'
},
{
required: true,
validator: (rule, value, callback) => {
if (!value) {
callback(new Error('核销码不能为空'))
} else if (this.errMeg) {
callback(new Error(this.errMeg))
} else {
callback()
}
},
trigger: 'blur'
}
]
},
writeOffForm: [
{
label: '核销码',
name: 'writeOffCode',
type: 'input',
maxlength: 8,
placeholder: '请输入核销码',
isClear: true
}
],
customObj: {
writeOffCode: '',
reporterName: '',
reporterPhone: '',
reporterDate: '',
reimbursementDate: '',
handlerName: '',
handlerPhone: '',
serviceCodes: []
},
customRule: {
reporterName: [{ required: true, message: '请输入报案人', trigger: 'change' }],
handlerName: [{ required: true, message: '请输入经办人', trigger: 'change' }],
reporterDate: [{ required: true, message: '请选择报案日期', trigger: 'change' }],
reimbursementDate: [
{ required: true, message: '请选择出险日期', trigger: 'change' }
// {
// required: true,
// validator: (rule, value, callback) => {
// if (!value) {
// callback(new Error('请选择出险日期'))
// } else {
// if(new Date(value).getTime() > new Date(this.customObj.reporterDate).getTime()){
// callback(new Error('出险日期不能大于报案日期'))
// }else{
// callback()
// }
// }
// },
// trigger: 'change'
// }
],
reporterPhone: [
{
required: true,
validator: (rule, value, callback) => {
if (!value) {
callback(new Error('请输入手机号'))
} else if (phoneReg.test(value)) {
callback()
} else {
callback(new Error('请输入正确的手机号'))
}
},
trigger: 'change'
}
],
handlerPhone: [
{
required: true,
validator: (rule, value, callback) => {
if (!value) {
callback(new Error('请输入手机号'))
} else if (phoneReg.test(value)) {
callback()
} else {
callback(new Error('请输入正确的手机号'))
}
},
trigger: 'change'
}
],
serviceCodes: [
{
type: 'array',
required: true,
message: '请选择最少一项核赔服务',
trigger: 'change'
}
]
},
customForm: [
{
label: '报案人',
name: 'reporterName',
type: 'input',
isClear: true
},
{
label: '报案人联系号码',
name: 'reporterPhone',
type: 'input',
maxlength: 11,
isClear: true
},
{
label: '报案日期',
name: 'reporterDate',
type: 'limitDatePicker',
dateType: 'datetime',
isClear: true,
customPickerOptions: {
disabledDate(date) {
return date > new Date();
},
selectableRange: ''
},
focus:(e)=>{
if(e.value){
this.updateTimeLimit(e.value, 'reporterDate')
}
}
},
{
label: '出险日期',
name: 'reimbursementDate',
type: 'limitDatePicker',
dateType: 'datetime',
isClear: true,
customPickerOptions: {
disabledDate:(date)=> {
// if(this.customObj.reporterDate){
// return date > new Date(this.customObj.reporterDate);
// }else{
// return date > new Date();
// }
return date > new Date();
},
selectableRange: ''
},
focus:(e)=>{
if(e.value){
this.updateTimeLimit(e.value, 'reimbursementDate')
}
}
}
],
handlerForm: [
{
label: '经办人',
name: 'handlerName',
type: 'input',
isClear: true
},
{
label: '经办人联系号码',
name: 'handlerPhone',
type: 'input',
maxlength: 11,
isClear: true
},
{
label: '申请核赔服务',
name: 'serviceCodes',
type: 'checkbox',
border: true,
optionList: [],
optionId: 'serviceItemCode',
optionLabel: 'serviceItemName'
}
]
}
},
components: {
glsxCombiForm,
qrCode
},
mounted() {},
watch:{
'customObj.reporterDate'(newVal, oldVal){
if(newVal){
this.updateTimeLimit(newVal,'reporterDate')
}
},
'customObj.reimbursementDate'(newVal, oldVal){
if(newVal){
this.updateTimeLimit(newVal, 'reimbursementDate')
}
}
},
methods: {
updateTimeLimit(newVal,key){
let limitTime = '';
// 当报案时间存在或者是报案日期,结束时间是当前时间,否则结束时间是报案时间
// let endTime = (key === 'reporterDate' || !this.customObj.reporterDate) ? new Date().getTime() : new Date(this.customObj.reporterDate).getTime();
// 当不是同一天,时间限制为'00:00:00 - 23:59:59',否则'00:00:00 - endTime'
let endTime = new Date().getTime();
if(util.dateFormat(endTime) === util.dateFormat(new Date(newVal))){
limitTime = `00:00:00 - ${util.dateFormat(endTime,'HH:mm:ss')}`
}else{
limitTime = '00:00:00 - 23:59:59'
}
const Item = this.customForm.find(item => item.name === key)
this.$set(Item.customPickerOptions,'selectableRange',limitTime)
},
handleNextStep() {
this.$refs.writeOff.$refs.formRef.validate(valid => {
if (valid) {
const { writeOffCode } = this.batchListSearch
this.$apis.beforeSale.getWriteOffService({ writeOffCode }).then(res => {
if (res.code == '0') {
this.isSavePage = true
const { writeOffCode, reporterName, reporterPhone, serviceItemsList } = res.data
const reporterDate = new Date();
const reimbursementDate = new Date();
this.customObj = { ...this.customObj, writeOffCode, reporterName, reporterPhone, reporterDate, reimbursementDate }
const id = this.handlerForm.findIndex(item => {
return item.name === 'serviceCodes'
})
this.$nextTick(() => {
this.handlerForm[id].optionList = serviceItemsList
})
} else {
this.errMeg = res.message
this.$refs.writeOff.$refs.formRef.validate(valid => {
this.gotoValidView('writeOffCode')
this.errMeg = ''
})
}
})
} else {
this.gotoValidView('writeOffCode')
}
})
},
handleSave() {
this.$refs.customRef.$refs.formRef.validate(valid => {
if (valid) {
this.$refs.handlerRef.$refs.formRef.validate(secondValid => {
if (secondValid) {
let params = {...this.customObj}
params.reimbursementDate = util.dateFormat(this.customObj.reimbursementDate, 'YYYY-MM-DD HH:mm:ss')
params.reporterDate = util.dateFormat(this.customObj.reporterDate, 'YYYY-MM-DD HH:mm:ss')
this.$apis.beforeSale.saveWriteOff({ ...params }).then(res => {
if (res.code == '0') {
this.$message({
message: '保存成功',
type: 'success'
})
this.$router.push({
path: '/ghPreSale/writeOff/writeOffList'
})
} else {
this.gotoValidView('writeOff')
this.$message({
message: res.message,
type: 'error'
})
}
})
} else {
this.gotoValidView('reporterName')
}
})
} else {
this.gotoValidView('reporterName')
}
})
},
gotoValidView(id) {
document.getElementById(id) && document.getElementById(id).scrollIntoView()
},
handleCancel() {
this.$router.push({
path: '/ghPreSale/writeOff/writeOffList'
})
}
}
}
</script>
<style lang="scss" scoped>
.writeOff {
margin-top: 17px;
height: calc(100vh - 206px);
background-color: #fff;
.header {
height: 60px;
line-height: 60px;
padding: 0 20px;
border-bottom: 1px solid #eeeeee;
font-family: PingFangSC-Medium;
font-size: 14px;
color: #333333;
font-weight: 700;
}
/deep/ .el-form-item__label {
padding: 0;
}
/deep/ .el-form-item {
margin-right: 0;
}
.custom-info {
padding: 30px 0;
box-sizing: border-box;
.code {
color: #666;
font-size: 14px;
display: inline-block;
width: 160px;
height: 32px;
line-height: 32px;
margin-bottom: 10px;
box-sizing: border-box;
}
.label {
text-align: right;
}
}
.handler-info {
height: 437px;
padding: 30px 0;
box-sizing: border-box;
/deep/ #serviceCodes {
display: block;
.el-form-item__content {
max-width: 800px;
}
}
/deep/ .el-checkbox {
width: 240px;
margin-right: 20px;
margin-left: 0;
display: inline-block;
}
}
.main {
padding: 30px 0 15px;
.signal-img {
margin-left: 128px;
p {
height: 18px;
font-size: 14px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #5850ff;
line-height: 20px;
}
img {
width: 824px;
height: 568px;
}
}
}
// .btn-box {
// display: flex;
// justify-content: center;
// align-items: center;
// }
}
</style>
<template>
<div class="writeOff">
<div class="box">
<div class="header title" style="height: 53px; line-height: 53px">
<span style="height: 53px; cursor: pointer; display: flex; align-items: center" @click="back">
<i class="el-icon-arrow-left" style="font-size: 18px"></i>
返回
</span>
</div>
<div class="custom-info">
<p class="title" style="margin-bottom: 20px">报案信息(客户提交)</p>
<div class="info">
<span class="item" v-for="(val, key) in customObj" :key="key">
<span class="label">{{ val ? val + ':' : '' }}</span>
{{ info[key] }}
</span>
</div>
</div>
</div>
<div class="box" style="margin-top: 10px">
<div class="header title">报案信息(店面补充)</div>
<div class="handler-info">
<span class="item" v-for="(val, key) in handlerObj" :key="key">
<span class="label">{{ val ? val + ':' : '' }}</span>
{{ info[key] }}
</span>
<div class="item service">
<span class="label">申请核赔服务:</span>
<div class="sevice-box">
<div v-for="(item, index) in info.serviceItemsList" :key="index" class="service-item">
{{ item.serviceItemName }}
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import util from '@/util/util'
export default {
name: 'writeOffDetail',
data() {
return {
info: {},
customObj: {
writeOffCode: '核销码',
nullval: '',
reporterName: '报案人',
reporterPhone: '报案人联系号码',
reporterDate: '报案日期',
reimbursementDate: '出险日期'
},
handlerObj: {
handlerName: '经办人',
handlerPhone: '经办人联系号码'
}
}
},
mounted() {
this.getDetail(this.$route.params)
},
methods: {
getDetail({ id }) {
this.$apis.beforeSale.getWriteOffDetail({ writeOffCode: id }).then(res => {
if (res.code == '0') {
this.info = res.data
}
})
},
back() {
this.$router.push({
path: '/ghPreSale/writeOff/writeOffList'
})
}
}
}
</script>
<style lang="scss" scoped>
.writeOff {
margin-top: 17px;
.box {
background-color: #fff;
}
p {
margin: 0;
}
.item {
width: 350px;
padding: 15px 0;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #6c6f71;
line-height: 17px;
display: inline-block;
margin-right: 120px;
.label {
width: 140px;
text-align: right;
display: inline-block;
}
}
.service {
margin-right: 0 !important;
display: flex;
width: 100%;
.label {
height: 36px;
line-height: 36px;
white-space: nowrap;
}
.sevice-box {
width: 800px;
.service-item {
width: 240px;
height: 36px;
background: #f7f7f7;
border: 1px solid #e9e9e9;
display: inline-flex;
align-items: center;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #6c6f71;
line-height: 17px;
padding: 0 12px;
box-sizing: border-box;
margin: 0 20px 20px 0;
}
}
}
.title {
font-family: PingFangSC-Medium;
font-size: 14px;
color: #333333;
font-weight: 700;
}
.header {
border-bottom: 1px solid #eeeeee;
height: 60px;
background-color: #fff;
line-height: 60px;
padding: 0 20px;
}
.custom-info {
height: 220px;
padding: 20px;
box-sizing: border-box;
.info {
width: 950px;
}
}
.handler-info {
padding: 20px;
}
}
</style>
<template>
<div class="writeOff">
<div class="contain equity-wrap">
<GLButton size="small" fn="新增核赔" class="el-icon-plus" type="primary" @click="addWriteOff(1)">新增核赔</GLButton>
<div class="search-wrap">
<glsx-combi-form ref="showSearch" labelWidth="120px" defaultWidth="230px" :formObj="batchListSearch" :formData="writeOffForm">
<span slot="footer" class="footer-btns"></span>
</glsx-combi-form>
</div>
<div>
<div>
<el-button size="small" type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
<el-button size="small" icon="el-icon-refresh" @click="handleReset('reset')">重置</el-button>
</div>
</div>
</div>
<div class="contain equity-wrap" style="margin-top: 10px">
<el-button type="primary" size="small" @click="handleExport" style="float: right; margin-right: 0; margin-bottom: 20px" class="selectBtn">导出Excel</el-button>
<GLTable ref="writeOffTable" :pageSizes="sizeList" :searchForm="searchForm" :tableParams="batchTableParams" :getListApi="getListApi" :pageConf="batchPageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="table-btns" slot-scope="scope">
<el-button type="text" @click="handleView(scope.scope)">查看</el-button>
</div>
</GLTable>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import glsxCombiForm from '@/components/glsx-combi-form'
import util from '@/util/util'
export default {
name: 'writeOffList',
data() {
return {
sizeList: [5, 10, 20, 30, 40],
getListApi: this.$apis.beforeSale.getWriteOffList,
batchListSearch: {
searchText: '',
activeTime: []
},
searchForm: {},
writeOffForm: [
{
label: '搜索内容',
name: 'searchText',
type: 'input',
placeholder: '请输入车主姓名、核销码、合同号',
isClear: true
},
{
label: '提交时间',
name: 'activeTime',
type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
pickerOptions: 'beforeRangePickerOptions',
isClear: true
}
],
// 序号、核销码、客户名、合同号、价格区间、门店提交时间、服务名称、操作
batchTableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '核销码',
prop: 'writeOffCode',
width: 120,
formatter: cellValue => {
return cellValue.writeOffCode || '-'
}
},
{
label: '客户名',
prop: 'reporterName',
width: 200,
formatter: cellValue => {
return cellValue.reporterName || '-'
}
},
{
label: '合同号',
prop: 'contractNo',
width: 200,
formatter: cellValue => {
return cellValue.contractNo || '-'
}
},
{
label: '价格区间',
prop: 'priceSection',
width: 200,
formatter: cellValue => {
return cellValue.priceSection || '-'
}
},
{
label: '门店提交时间',
prop: 'commitTime',
width: 200,
formatter: cellValue => {
return cellValue.commitTime ? util.dateFormat(cellValue.commitTime, 'YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '服务名称',
prop: 'serviceName',
formatter: cellValue => {
return cellValue.serviceName || '-'
}
},
{
label: '操作',
prop: '',
width: '100px',
fixed: 'right',
addHtml: 'table-btns'
}
]
},
batchPageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
}
},
components: {
glsxCombiForm
},
mounted() {},
methods: {
handleView({ writeOffCode }) {
this.$router.push(`/ghPreSale/writeOff/writeOffDetail/${writeOffCode}`)
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchForm = { ...this.setParams() }
console.log(this.searchForm, 963)
resolve()
})
},
setParams() {
const params = {}
if (Array.isArray(this.batchListSearch.activeTime) && this.batchListSearch.activeTime.length > 0) {
params.commitTimeStart = util.dateFormat(this.batchListSearch.activeTime[0]) + ' 00:00:00'
params.commitTimeEnd = util.dateFormat(this.batchListSearch.activeTime[1]) + ' 23:59:59'
}
params.searchText = this.batchListSearch.searchText
return params
},
handleExport() {
const parmas = { ...this.setParams() }
this.$apis.beforeSale.exportWriteOffData(parmas).then(({ code, data, message }) => {
if (code == '0') {
var a = document.createElement('a')
a.setAttribute('id', 'exportToExport')
a.setAttribute('href', data)
a.setAttribute('target', '_blank')
document.body.appendChild(a)
a.click()
} else {
this.$message.error(message)
}
})
},
handleSearch() {
this.$refs.writeOffTable.refreshTable()
},
handleReset(type) {
this.batchListSearch = {
searchText: '',
activeTime: []
}
if (type === 'reset') {
this.handleSearch()
}
},
addWriteOff(type) {
this.$router.push('/ghPreSale/writeOff/addwriteOff')
}
}
}
</script>
<style lang="scss" scoped>
.writeOff {
margin-top: 17px;
.equity-wrap {
background-color: #fff;
padding: 20px;
.search-wrap {
margin-top: 20px;
// padding: 20px 20px 0;
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!