Commit 861721d3 by 杨北旺

合并代码

2 parents 4ffb4bd1 f5bfd046
This diff could not be displayed because it is too large.
......@@ -41,4 +41,4 @@
"> 1%",
"last 2 versions"
]
}
}
\ No newline at end of file
import { http } from '@/main'
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`
......@@ -12,6 +32,17 @@ const getListApi = params => {
})
}
// 获取门店
const getMerchantApi = params => {
params.method = 'scrm.api.equity.common.under.merchant.list.det'
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getExportApi = params => {
params.method = `${defaultPath}order.export.get`
return http({
......@@ -22,4 +53,189 @@ const getExportApi = params => {
})
}
export default { getListApi, getExportApi }
// 打印合同
const getPriteApi = params => {
params.method = `${defaultPath}order.prite`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: 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`
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 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 updateOrderApi = params => {
params.method = `${orderPath}attachment.update`
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
})
}
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
......@@ -13,7 +13,7 @@
</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)">
<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>
......@@ -53,7 +53,15 @@
<el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio>
</el-radio-group>
<el-date-picker v-else-if="item.type === 'datePicker'" :style="{ width: item.selectWidth || defaultWidth }" v-model="formObj[item.name]" :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-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>
<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'">
<p class="photo-top-tips">{{ item.topTips }}</p>
<div v-if="!item.isDisabled" :style="{ width: item.width || '100%' }">
......@@ -174,6 +182,12 @@ export default {
item.keyFn()
}
},
handleInputBlur(e, targetItem) {
targetItem.inputBlur && targetItem.inputBlur()
},
handleDateChange(value, targetItem) {
targetItem.handleDateChange && targetItem.handleDateChange(value, targetItem)
},
// 图片
handleUploadChange(e, targetItem) {
var reader = new FileReader()
......@@ -241,6 +255,11 @@ export default {
/* .glsx-combi-form .glsx-combi-form-block {
padding: 16px 40px 0;
} */
.glsx-combi-form.clearfix::after {
content: '';
display: inline-block;
clear: both;
}
.glsx-combi-form .isBlock {
display: block !important;
}
......@@ -306,6 +325,14 @@ export default {
/* .glsx-combi-form .tips {
margin: 0;
} */
.glsx-combi-form .upload-img-btn {
width: 62px;
height: 32px;
position: absolute;
left: 0;
top: 0;
cursor: pointer;
}
/* 图片上传 */
.glsx-combi-form .photo-top-tips {
/* height: 36px; */
......@@ -389,6 +416,7 @@ export default {
.glsx-combi-form .dialog-look {
text-align: center;
z-index: 999;
}
.glsx-combi-form .dialog-video {
......
......@@ -18,3 +18,4 @@ Vue.prototype.$apis = apis
start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
export const http_brand = params => Vue.prototype.$http_brand(params)
......@@ -21,11 +21,16 @@ const staticRoutes = Object.freeze([{
},
{
name: 'beforeSale',
path: '/beforeSale/saleList',
path: '/beforeSale/index',
component: resolve => require([`@/views/beforeSale/index.vue`], resolve),
meta: {}
},
{
name: 'editEquity',
path: '/beforeSale/editEquity/:addOrEdit/:contractNo',
component: resolve => require([`@/views/beforeSale/editEquity.vue`], resolve),
meta: {}
}, {
name: 'introduct',
path: '/inSale/introduct',
component: resolve => require([`@/views/inSale/introduct.vue`], resolve),
......
......@@ -16,8 +16,22 @@ import render from './render'
import { routes } from '@/router'
export async function start() {
if (window.__POWERED_BY_QIANKUN__) return
const { response, request, sign, secret } = await fetchConfig()
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: '1112223333444' } })
const { response, request, request_brand, sign, secret } = await fetchConfig()
var urlParams = {}
window.location.href.split('?').length > 1
? window.location.href
.split('?')[1]
.split('&')
.forEach(item => {
urlParams[item.split('=')[0]] = item.split('=')[1]
})
: ''
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_brand = new Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: token } })
Vue.prototype.$common = {
utils: utils
}
Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes)
}
<!-- 编辑权益 -->
<template>
<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">
<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">
<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-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:220px;" :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" placeholder="请选择车系" @change="getCarTypeList(editForm.vehicle.vehicleSeriesId)" style="width:220px;" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carSeriesOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
<template slot="vehicleShapeId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleShapeId" placeholder="请选择车型" style="width:220px;" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carTypeOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
</glsx-combi-form>
</div>
<div class="container">
<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>
</div>
<div class="container">
<p class="edit-title">选择产品</p>
<!-- <glsx-combi-form class="edit-form-container" ref="editFormRefPro" labelWidth="160px" formRef="editChildRefPro" :formObj="editForm" :formData="editFormDataPro" :formRules="editRulePro"> -->
<glsx-combi-form class="edit-form-container" labelWidth="160px" :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>{{ subItem.serviceItems }}</p>
<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">
<template slot="table" slot-scope="scope">
<table 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="160px" formRef="editChildRefOther" :formObj="editForm" :formData="editFormDataOther" :formRules="editRuleOther"></glsx-combi-form>
</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>
<el-button v-show="routeInfo.addOrEdit == '1'" type="primary" @click="handleReset">重置</el-button>
<el-button v-show="!['3', '5'].includes(routeInfo.addOrEdit)" type="primary" @click="handleDraft">草稿</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
</div>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'editEquity',
data() {
return {
size: 'small',
submit: false,
// title: '新增权益',
// titleObj: {
// 1: '新增权益',
// 2: '编辑权益',
// 3: '查看权益'
// },
// footerLeft: '0',
// footerWidth: '0',
editCarChildRef: 'editChildRef',
disabled: false,
successDisable: false,
routeInfo: {
// 1-新增;2-编辑;3-修改;4-重新提单;5-查看
addOrEdit: '1',
contractNo: ''
},
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()
}
},
// 车辆信息
editRuleCar: {
licensing: [{ required: true, message: '请选择是否上牌', trigger: 'change' }],
// licensePlate: [{ required: true, message: '请输入车牌号码', trigger: 'change' }],
vin: [{ required: true, message: '请输入车架号', trigger: 'change' }],
engineNo: [{ required: true, message: '请输入发动机号', 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: 'licensing',
type: 'select',
noFilter: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'licensingList'
},
{
label: '车牌号码',
name: 'licensePlate',
type: 'input',
maxlength: 32
},
{
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',
handleDateChange: (value, targetItem) => {
console.log(value)
console.log(targetItem)
}
},
{
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, message: '请输入身份证', trigger: 'change' }],
customerPhone: [{ required: true, message: '请输入联系号码', 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: 128
},
{
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: 128
}
],
// 选择产品
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' }]
},
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',
customPickerOptions: {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
if (date < yesterday) {
return true
}
return false
}
}
}
],
// 公共数据
baseData: {
licensingList: [
{
confId: 0,
confName: '否'
},
{
confId: 1,
confName: '是'
}
],
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: []
}
},
components: {
glsxCombiForm
},
created() {
this.getAllVehicleBrand()
this.getCarChildList()
},
mounted() {
// this.footerLeft = document.querySelector('.base-container-right').offsetLeft
// this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.params
this.disabled = this.routeInfo.addOrEdit == '5'
// 提单成功 - 修改
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]
console.log(this.routeInfo, '-------------')
// 获取套餐列表
this.getPackageList()
},
methods: {
setDisabled(partDisabledList = []) {
var list = ['Car', 'User', 'Pro', 'Other']
var flag = true
var errorObjList = []
for (var i = 0; i < list.length; i++) {
this['editFormData' + list[i]].forEach((item, idx) => {
if (!partDisabledList.length) {
this['editFormData' + list[i]][idx].isDisabled = true
} else {
if (partDisabledList.includes(item.name)) {
this['editFormData' + list[i]][idx].isDisabled = true
}
}
})
}
},
handleCancelBubble(e) { },
getInfo() {
this.$apis.beforeSale.getEquityApi({ contractNo: this.routeInfo.contractNo }).then(res => {
console.log(res)
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)
}
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 (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.beforeSale.getPackageListApi({}).then(res => {
// console.log(res)
this.packageList = res
this.autoGenerate()
})
},
// 改建议价
packageToPrice() {
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)
// console.log(targetItem)
targetItem && targetItem.servicePackagePrices.forEach(item => {
if (+invoicePrice >= +item.carButtomPrice && +invoicePrice < +item.carHighestPrice) {
this.editForm.suggestedSellingPrice = (item.retailPrice / 100).toFixed(2)
}
})
}
},
packageAttr(recovery = false) {
var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode)
this.packageToPrice()
// console.log(this.editForm)
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)
})
console.log(this.editFormPro)
},
autoGenerate() {
var tempList = []
this.packageList.forEach(item => {
tempList = []
item.groupAttributeList.forEach((k, idx) => {
if (k.attributeList.length == 1) {
tempList.push({
label: k.attributeList[0].attributeDesc,
name: k.attributeList[0].attributeName,
type: k.attributeList[0].attributeType,
isDisabled: this.disabled || this.successDisable,
maxlength: k.attributeList[0].maxLength
})
if (k.attributeList[0].attributeType == 'datePicker') {
tempList[idx].dateType = 'date'
tempList[idx].valueFormat = 'yyyy-MM-dd',
tempList[idx].pickerOptions = 'beforeRangePickerOptions'
}
} else {
// console.log(k)
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)
})
})
console.log(this.editFormDataPro)
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.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.beforeSale.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) {
this.$apis.beforeSale.getCarChildListApi({}).then(res => {
this.allCarChildList = res || []
if (isRecovery) {
this.baseData.carChildOptions = this.allCarChildList.find(item => item.id == this.editForm.vehicle.vehicleBrandId).childs
}
})
},
// 获取车系
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.beforeSale.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.beforeSale.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
}
var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode)
// console.log(targetItem)
params.attributeList = []
if (targetItem) {
targetItem.groupAttributeList.forEach(item => {
if (item.attributeList.length == 1) {
params.attributeList.push({
attributeValue: this.editFormPro[item.attributeList[0].attributeGroup],
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
})
}
})
}
})
}
console.log(params)
return params
},
handleDraft() {
if (this.submit) {
return true
}
this.submit = true
var params = this.getParams()
params.operationType = 0
if (this.routeInfo.addOrEdit == '2') {
params.contractNo = this.routeInfo.contractNo
this.updateEquity(params)
} else {
this.$apis.beforeSale.createCodeApi({}).then(res => {
console.log(res)
params.contractNo = res
this.submit = false
this.updateEquity(params)
}).catch(err => {
this.submit = false
})
}
},
updateEquity(params) {
this.$apis.beforeSale.updateEquityApi(params).then(res => {
this.submit = false
if (res.code == '0') {
this.$message({
message: res.data.code ? '操作成功' : res.data.msg,
type: res.data.code ? 'success' : 'error'
})
if (res.data.code) {
this.handleCancel()
} else {
this.whereToGo('licensing')
}
} else {
this.whereToGo('licensing')
this.$message({
message: res.message,
type: 'error'
})
}
})
},
handleConfirm() {
if (this.submit) {
return true
}
this.submit = true
var list = ['Car', '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()
// if ([2, 3].includes(this.routeInfo.addOrEdit)) {
// params.contractNo = this.routeInfo.contractNo
// }
params.operationType = 1
if (['2', '3'].includes(this.routeInfo.addOrEdit)) {
params.contractNo = this.routeInfo.contractNo
this.updateEquity(params)
} else {
this.$apis.beforeSale.createCodeApi({}).then(res => {
console.log(res)
params.contractNo = res
this.submit = false
this.updateEquity(params)
}).catch(err => {
this.submit = false
})
}
},
handleReset() {
this.editForm = {
packageCode: '',
suggestedSellingPrice: '',
actualSalesPrice: '',
servicePeriod: 1,
vehicle: {
vehicleBrandId: '',
vehicleSubBrandId: '',
vehicleSeriesId: '',
vehicleShapeId: '',
licensing: '',
invoicePrice: '',
seatesNum: 5,
billingDate: new Date()
}
}
},
handleCancel() {
if (this.submit) {
return true
}
this.$router.push({
path: '/beforeSale/index'
})
}
}
}
</script>
<style>
/* 客服 - 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 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 {
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
margin-bottom: 20px;
}
.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 {
/* position: absolute;
bottom: 0; */
width: 100%;
height: 64px;
/* left: 220px; */
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 {
font-size: 16px;
font-weight: bold;
height: 48px;
line-height: 48px;
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;
}
.before-sale .package-code .package-title {
font-size: 16px;
font-weight: bold;
}
.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;
}
/* .no-label.el-form-item--small .el-form-item__content {
width: auto !important;
}
.radio-add-block .el-form-item--small .el-form-item__content {
width: auto !important;
} */
/* 表格 */
/* .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: 50%;
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;
}
/* 表格 */
</style>
<!-- 权益订单列表 -->
<template>
<div class="before-sale">
<div class="m-b-20">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新增权益</el-button>
</div>
<div class="container">
<div>
<glsx-combi-form ref="showSearch" labelWidth="110px" :formObj="searchForm" :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>
<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">
<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)" 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>
<el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleBack(scope.scope)">退保</el-button>
<el-button v-if="[3, 4, 5].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(4, scope.scope)">重新提单</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<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-combi-form labelWidth="300px" isBlock="true" ref="uploadFormRef" formRef="uploadChildRef" :formRules="uploadRule" :formObj.sync="uploadForm" :formData="uploadFormData"></glsx-combi-form>
</glsx-dialog>
</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'
export default {
name: 'equityList',
data() {
return {
size: 'small',
userInfo: {},
countNoData: '',
levelToShow: {
1: 'merchantId',
2: 'dqtId',
3: 'pqId',
4: 'mdId'
},
searchForm: {
queryText: '',
orderStatus: '',
packageCode: '',
merchantId: '',
successDate: [],
effectiveDate: []
},
tableSearchForm: {},
// 合同打印
isPdfVisible: false,
pdfUrl: '',
// 上传资料
isFileVisible: false,
packageList: [],
uploadRule: {},
uploadForm: {},
uploadFormData: [],
// 搜索
searchFormData: [
{
label: '搜索内容',
name: 'queryText',
type: 'input',
placeholder: '输入车主、合同号、车架号',
maxlength: 100
},
{
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,
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,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '车主姓名',
prop: 'customerName',
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: '160px',
formatter: cellValue => {
return cellValue.successDate ? dayjs(cellValue.successDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '新车开票日期',
prop: 'billingDate',
width: '160px',
formatter: cellValue => {
return cellValue.billingDate ? dayjs(cellValue.billingDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '店面名称',
prop: 'merchantName',
width: '160px',
line: 2,
formatter: cellValue => {
return cellValue.merchantName || '-'
}
},
{
label: '车品牌',
prop: 'vehicleBrandName',
width: '160px',
formatter: cellValue => {
return cellValue.vehicleBrandName || '-'
}
},
{
label: '车系',
prop: 'vehicleSeriesName',
formatter: cellValue => {
return cellValue.vehicleSeriesName || '-'
}
},
{
label: '车架',
prop: 'vin',
formatter: cellValue => {
return cellValue.vin || '-'
}
},
{
label: '电话',
prop: 'customerPhone',
width: '160px',
formatter: cellValue => {
return cellValue.customerPhone || '-'
}
},
{
label: '产品名称',
prop: 'packageName',
formatter: cellValue => {
return cellValue.packageName || '-'
}
},
{
label: '实际销售价',
prop: 'actualSalesPrice',
width: '160px',
formatter: cellValue => {
return cellValue.actualSalesPrice ? (cellValue.actualSalesPrice / 100).toFixed(2) : '-'
}
},
{
label: '服务期限',
prop: 'servicePeriod',
formatter: cellValue => {
return cellValue.servicePeriod ? '1年' : '-'
}
},
{
label: '生效时间',
prop: 'effectiveDate',
width: '160px',
formatter: cellValue => {
return cellValue.effectiveDate ? dayjs(cellValue.effectiveDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '状态',
prop: 'orderStatus',
width: '100px',
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: 'provinceMerchantName',
formatter: cellValue => {
return cellValue.provinceMerchantName || '-'
}
},
{
label: '片区',
prop: 'cityMerchantName',
formatter: cellValue => {
return cellValue.cityMerchantName || '-'
}
},
{
label: '操作人',
prop: 'updatedBy',
width: '140px',
formatter: cellValue => {
return cellValue.updatedBy || '-'
}
}
]
},
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: '已过期'
}
]
}
}
},
components: {
glsxCombiForm,
glsxDialog,
pdfDialog
},
mounted() {
this.$apis.beforeSale.getProListApi({}).then(res => {
this.baseData.goodsStatusList = res
this.getOptionsList('searchFormData')
})
this.getCountNoData()
this.$apis.beforeSale.getUserInfoApi({}).then(res => {
this.userInfo = res
var idx = this.searchFormData.findIndex(item => item.name == this.levelToShow[res.merchantAccountLevel])
this.searchFormData[idx].isHide = false
this.baseData[this.searchFormData[idx].optionsName] = [{
merchantNo: this.userInfo.merchantNo,
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)
})
},
methods: {
getCountNoData() {
this.$apis.beforeSale.getCountNoDataApi({}).then(res => {
this.countNoData = res
})
},
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)
})
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.successDate.length) {
params.successStartDate = 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'
}
if (this.searchForm.effectiveDate.length) {
params.effectiveStartDate = 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'
}
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, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
// 1-新增;2-编辑;3-修改;4-重新提单;5-查看
handleEdit(addOrEdit, row) {
if (addOrEdit == 3 && new Date(new Date().setDate(new Date().getDate() - 7)) > new Date(row.successDate)) {
const h = this.$createElement
this.$message({
message: h('p', null, [h('p', { style: 'text-align: center; line-height: 20px; color: #F56C6C;' }, '为保障客户权益,请邮件主送:operation@didihu.com.cn,抄送:liuqm@didihu.com.cn,jiangfj@didihu.com.cn提交退单申请 ')]),
type: 'error'
})
return true
}
if(addOrEdit == 4 && row.orderStatus == 3) {
addOrEdit = 2
}
addOrEdit == 1 ? this.$router.push('/beforeSale/editEquity/' + addOrEdit + '/' + -1) : this.$router.push('/beforeSale/editEquity/' + addOrEdit + '/' + row.contractNo)
},
handlePdfClose() {
this.isPdfVisible = !this.isPdfVisible
},
// 打印
handlePdf(row) {
this.handlePdfClose()
this.$apis.beforeSale.getPriteApi({ contractNo: row.contractNo }).then(res => {
this.pdfUrl = res
})
},
uploadFile(imgUrl, targetItem) {
var params = {
contractNo: this.uploadForm.contractNo,
attachmentCode: targetItem.name,
attachmentFile: imgUrl,
attachmentType: 'IMG'
}
this.$apis.beforeSale.updateOrderApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.$set(this.uploadForm, targetItem.name, imgUrl)
}
})
},
// 上传资料
autoGenerate() {
var tempList = []
this.uploadFormData = []
this.packageList.forEach(item => {
// item.groupAttributeList.forEach((k, idx) => {
// this.uploadForm[item.attachmentCode] = ''
this.$set(this.uploadForm, item.attachmentCode, '')
this.uploadFormData.push({
label: item.attachmentName,
name: item.attachmentCode,
type: 'uploadBtn',
limitSize: 20,
maxPhotoNum: 1,
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
var imgUrl = ''
this.$apis.beforeSale.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
},
handleUpload(row) {
console.log(row)
this.$apis.beforeSale.getOrderAttrApi({ packageCode: row.packageCode }).then(res => {
this.packageList = res
this.uploadForm.contractNo = row.contractNo
this.packageList.forEach(item => {
this.$apis.beforeSale.getOrderValueApi({ contractNo: row.contractNo, attachmentCode: item.attachmentCode }).then(subRes => {
this.uploadForm[item.attachmentCode] = subRes || ''
})
})
this.autoGenerate()
})
},
// 退保
handleBack(row) {
console.log(this.userInfo)
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'
})
return true
}
this.secondConfirm('退保', '是否确认退保?', 'beforeSale', 'backOrderApi', { contractNo: row.contractNo, merchantId: row.merchantId })
},
// 导出
handleExport() {
var params = this.getParams()
this.$apis.beforeSale.getExportApi(params).then(res => {
window.open(res)
})
},
handleSearch() {
this.$refs.equityRef.refreshTable()
},
handleReset() {
this.searchForm = {
queryText: '',
orderStatus: '',
merchantId: '',
successDate: [],
effectiveDate: []
}
this.handleSearch()
}
}
}
</script>
<style 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 .table-top-tips {
/* position: relative; */
box-sizing: border-box;
color: red;
margin-bottom: 10px;
/* width: 100%; */
/* background-color: darkgrey; */
padding: 4px 10px;
}
.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;
}
</style>
<!-- 权益订单列表 -->
<!-- 权益订单 -->
<template>
<div class="before-sale">
<div class="m-b-20">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新增权益</el-button>
</div>
<div class="container">
<div>
<glsx-combi-form ref="showSearch" labelWidth="110px" :formObj="searchForm" :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="zoneRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button v-if="[2, 4, 5].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(4, scope.scope)">查看</el-button>
<el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handlePdf(scope.scope)">打印</el-button>
<el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleUpload(scope.scope)">上传资料</el-button>
<el-button v-if="[0].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(3, scope.scope)">修改</el-button>
<el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleDelete(scope.scope)">退保</el-button>
<el-button v-if="[4, 5].includes(scope.scope.orderStatus)" type="text" @click="handleDelete(scope.scope)">重新提单</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<div class="equity">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="其他权益订单" name="equityList">
<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>
</template>
<script>
import * as dayjs from 'dayjs'
import glsxCombiForm from '@/components/glsx-combi-form'
import equityList from './equityList'
import serviceSet from './serviceSet'
export default {
name: 'beforeSale',
name: 'index',
data() {
return {
size: 'small',
searchForm: {
queryText: '',
orderStatus: '',
successDate: [],
effectiveDate: []
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '搜索内容',
name: 'queryText',
type: 'input',
placeholder: '输入车主、单号、车架号',
maxlength: 100
},
{
label: '服务状态',
name: 'orderStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'orderStatusList'
},
{
label: '产品名称',
name: '',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'goodsStatusList'
},
{
label: '提单成功时间',
name: 'successDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '生效时间',
name: 'effectiveDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '总部',
name: 'merchantIds',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'goodsStatusList'
}
],
// 表格
getListApi: this.$apis.beforeSale.getListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '车主姓名',
prop: 'customerName'
},
{
label: '合同号',
prop: ''
},
{
label: '提单成功时间',
prop: 'successDate',
width: '160px',
formatter: cellValue => {
return dayjs(cellValue.successDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '新车开票日期',
prop: 'expirationDate',
width: '160px',
formatter: cellValue => {
return dayjs(cellValue.expirationDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '店面名称',
prop: 'merchantName',
width: '160px',
line: 2
},
{
label: '车品牌',
prop: 'vehicleBrandName'
},
{
label: '车系',
prop: 'vehicleSeriesName'
},
{
label: '车架',
prop: 'vin'
},
{
label: '电话',
prop: 'customerPhone',
width: '160px'
},
{
label: '产品名称',
prop: 'packageName'
},
{
label: '实际销售价',
prop: 'actualSalesPrice',
width: '160px',
formatter: cellValue => {
return (cellValue.actualSalesPrice / 100).toFixed(2)
}
},
{
label: '服务期限',
prop: ''
},
{
label: '生效时间',
prop: 'expirationDate',
width: '160px',
formatter: cellValue => {
return dayjs(cellValue.expirationDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '状态',
prop: 'orderStatus',
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: ''
},
{
label: '片区',
prop: ''
},
{
label: '操作人',
prop: ''
}
]
},
pageConf: { pageSize: 'pageCount', pageNum: 'pageSize', totalCount: 'total' },
// 公共数据
baseData: {
orderStatusList: [
{
confId: '0',
confName: '初始化'
},
{
confId: '2',
confName: '提单成功'
},
{
confId: '3',
confName: '提单失败'
},
{
confId: '4',
confName: '已退单'
},
{
confId: '5',
confName: '已过期'
}
]
}
activeName: 'equityList'
}
},
components: {
glsxCombiForm
},
mounted() {
this.getOptionsList('searchFormData')
equityList,
serviceSet
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.successDate.length) {
params.successStartDate = 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'
}
if (this.searchForm.effectiveDate.length) {
params.effectiveStartDate = 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'
}
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)
}
}
})
}
},
mounted() {},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
addOrEdit == 1 ? this.$router.push('/zoneList/editZone/' + addOrEdit) : this.$router.push('/zoneList/editZone/' + addOrEdit + '/' + row.id)
},
handleDelete(row) {
this.secondConfirm('删除', '是否确认删除该专区?', 'zoneList', 'deleteZoneApi', { id: row.id })
},
// 导出
handleExport() {
var params = this.getParams()
this.$apis.beforeSale.getExportApi(params).then(res => {
window.open(res)
})
},
handleSearch() {
this.$refs.zoneRef.refreshTable()
},
handleReset() {
this.searchForm = {
queryText: '',
orderStatus: '',
successDate: [],
effectiveDate: []
}
this.handleSearch()
}
}
methods: {}
}
</script>
<style 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 .footer-btns {
float: right;
margin-bottom: 18px;
<style>
.equity .el-tabs__nav-wrap:after {
opacity: 0;
}
.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;
.equity .el-tabs__item {
height: 20px !important;
line-height: 10px !important;
font-weight: 400;
font-size: 16px;
}
</style>
<!-- 查看详情 -->
<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">
<div class="container edit-container">
<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>
</div>
<!-- <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> -->
<div class="footer" :style="{ width: '100%' }">
<el-button type="primary" @click="handleConfirm">确定</el-button>
<!-- <el-button type="default" @click="handleCancel">取消</el-button> -->
</div>
</div>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'serviceSet',
data() {
return {
size: 'small',
title: '店面服务设置',
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
editForm: {
hotline: ''
},
editRule: {
hotline: [{ required: true, message: '请输入服务热线', trigger: 'change' }]
},
editFormData: [
{
label: '服务热线',
name: 'hotline',
width: '320px',
type: 'input',
maxlength: 20
}
]
}
},
components: {
glsxCombiForm
},
mounted() {
this.getHotline()
},
methods: {
getHotline() {
this.$apis.beforeSale.getHotlineApi({}).then(res => {
this.editForm.hotline = res
})
},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.editForm)
this.$apis.beforeSale.updateHotlineApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
})
}
})
}
}
}
</script>
<style 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 .edit-container {
margin-bottom: 84px;
}
.before-sale .edit-form-container {
margin-top: 20px;
}
.before-sale .txt-center {
text-align: center;
}
.before-sale .footer {
position: absolute;
bottom: 0;
width: 100%;
height: 64px;
/* left: 220px; */
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 {
font-size: 16px;
font-weight: bold;
height: 48px;
line-height: 48px;
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;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!