Commit 0e9a640b by 杨北旺

提交延保提单内容

1 parent 9bce928c
......@@ -53,5 +53,19 @@ const pictureUpload = params => {
noSignAttr: ['file']
})
}
const uploadFileApi = (params, callback) => {
params.method = 'scrm.api.equity.common.upload.common.multiple'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file'],
returnAll: true,
onUploadProgress: res => {
callback(res)
}
})
}
export { getGoodsList, uploadImg, getMerchantList, getZoneList, pictureUpload }
export { getGoodsList, uploadImg, getMerchantList, getZoneList, pictureUpload,uploadFileApi }
<template>
<div class="element">
<label class="element_label">
<span v-if="isRequire" class="require">*</span>
{{ title }}:
</label>
<div class="wrapper">
<div class="upload_wrap">
<!-- 0 是默认上传类型 -->
<template v-if="uploadType == 0">
<template v-if="imagesList.length">
<div v-for="(imgItem, i) in imagesList" :key="i" class="imagBox">
<img class="imgItem" :src="imgItem" alt="" />
<div class="img_mask">
<i @click="handlePictureCardPreview(imgItem)" class="el-icon-zoom-in"></i>
<i v-if="!disabled" @click="toDeleteImg(index, i)" class="el-icon-delete"></i>
</div>
</div>
</template>
<div v-if="!(imagesList.length == limitNum)" class="upload-value">
<el-upload :disabled="disabled" list-type="picture" class="upload_item" action="#" :before-upload="e => beforeAvatarUpload(e)" :on-remove="e => handleRemove(e, index)" :http-request="e => httpRequest(e, index)">
<img class="img" slot="default" :src="upload_img" alt="" />
</el-upload>
</div>
</template>
<!-- 1 代表的是身份证、驾驶证等类型 -->
<template v-if="uploadType == 1">
<template v-for="count in 2">
<div v-if="(count == 1 && cardImg.font) || (count == 2 && cardImg.reverse)" :key="count" class="imagBox wid180">
<img class="imgItem wid180" :src="count == 2 ? cardImg.reverse : cardImg.font" alt="" />
<div class="img_mask wid180">
<i @click="handlePictureCardPreview(count == 2 ? cardImg.reverse : cardImg.font)" class="el-icon-zoom-in"></i>
<i v-if="!disabled" @click="removeCard(count)" class="el-icon-delete"></i>
</div>
</div>
</template>
<template v-for="count in 2">
<div v-if="(count == 1 && !cardImg.font&&!disabled) || (count == 2 && !cardImg.reverse&&!disabled)" :key="count" class="upload-value upload-value-max marRight-13">
<el-upload :disabled="disabled" list-type="picture" class="upload_item" action="#" :before-upload="e => beforeAvatarUpload(e)" :on-remove="e => handleRemove(e, index)" :http-request="e => httpRequest(e, count)">
<img class="img" slot="default" :src="count == 2 ? idCardBack_img : idCard_img" alt="" />
</el-upload>
</div>
</template>
</template>
</div>
<div class="tip">
图片格式为jpg,jpeg,png,大小10M以内
<span v-if="limitNum > 8 && uploadType == 0">,最多可上传{{ limitNum }}张</span>
</div>
</div>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="" />
</el-dialog>
</div>
</template>
<script type="text/ecmascript-6">
import upload_img from '@/assets/beforeSale/upload.png'
import idCard_img from '@/assets/beforeSale/idCard.png'
import idCardBack_img from '@/assets/beforeSale/idCardBack.png'
import { uploadFileApi } from '@/api/modules/common'
export default {
name: 'uploadHandler',
props: {
title: {
type: String,
default: '其他'
},
imagesList: Array,
uploadType: {
type: Number,
default: 0
},
limitNum: {
type: Number,
default: 100
},
cardImg: Object,
disabled:Boolean,
isRequire:Boolean
},
data() {
return {
upload_img,
idCard_img,
idCardBack_img,
dialogVisible: false,
hideUpload: false
}
},
mounted() {},
methods: {
toDeleteImg(index, i) {
this.imagesList.splice(i, 1)
this.$emit('getImages', this.imagesList)
},
removeCard(count) {
if (count == 1) {
this.cardImg.font = ''
} else {
this.cardImg.reverse = ''
}
this.$emit('getCardImg', {detail:this.cardImg,type:count})
},
handlePictureCardPreview(url) {
this.dialogImageUrl = url
this.dialogVisible = true
},
beforeAvatarUpload(e) {
return new Promise((resolve, reject) => {
let AllImgExt = '.png|.jpg|.jpeg'
let extName = e.name.substring(e.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return reject(false)
}
const size = e.size / 1024 / 1024
let maxSize = 10
let filetype = this.getFileType(e.type)
if (filetype == 'image') {
maxSize = 10
} else {
maxSize = 30
}
if (size > maxSize) {
this.$message.error(`上传文件不可超过${maxSize}M`)
return reject(false)
}
return resolve(true)
})
},
httpRequest({ file: e }, count) {
let size = e.size / 1024 / 1024
let loading = null
// 大于2给loading
if (size > 2) {
loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
}
// // 转码base64
const reader = new FileReader()
reader.readAsDataURL(e)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const targetNameList = e.name.split('.')
const fileInfo = targetNameList[targetNameList.length - 1] + '@' + arrBase64[1]
const fileType = this.getFileType(e.type)
const paramObj = { file: fileInfo, fileType: fileType }
let param = {}
param.fileList = [paramObj]
uploadFileApi(param, res => {
if (loading != null) {
loading.close()
loading = null
}
// let progress = ((res.loaded / res.total) * 100).toFixed(2)
// if (progress > 90) {
// progress = 90
// }
}).then(res => {
if (res.code == 0) {
const url = res.data[0]
if (this.uploadType == 0) {
this.imagesList.push(url)
this.$emit('getImages', this.imagesList)
} else if (this.uploadType == 1) {
if (count == 1) {
this.cardImg.font = url
} else {
this.cardImg.reverse = url
}
this.$emit('getCardImg', {detail:this.cardImg,type:count})
}
}
})
}
},
handleRemove(e, fieldName) {
if (e.status == 'ready') return
},
getFileType(type) {
if (!type) return 'doc'
if (type.indexOf('image') > -1) {
return 'image'
} else {
return 'doc'
}
}
}
}
</script>
<style lang="scss" scoped>
.element {
display: flex;
margin-bottom: 20px;
.element_label {
width: 154px;
font-weight: 400;
font-size: 14px;
color: #333333;
text-align: right;
.require {
color: red;
}
}
.wrapper {
width: 650px;
.upload_wrap {
display: flex;
flex-wrap: wrap;
.imagBox {
position: relative;
.imgItem {
width: 104px;
height: 104px;
border-radius: 4px;
margin-right: 10px;
margin-bottom: 10px;
border: 1px dashed #00000026;
}
.img_mask {
display: none;
}
}
.imagBox:hover {
.img_mask {
display: block;
width: 104px;
height: 104px;
border-radius: 4px;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.4);
transition: opacity 0.3s;
display: flex;
align-items: center;
justify-content: center;
i {
color: white;
cursor: pointer;
font-weight: 400;
font-size: 21px;
}
i:first-child {
margin-right: 12px;
}
i:last-child {
margin-right: 0;
}
}
}
}
.upload-value {
width: 104px;
height: 104px;
border: 1px dashed #00000026;
border-radius: 4px;
.upload_item {
width: 104px;
height: 104px;
.img {
width: 104px;
height: 104px;
border-radius: 4px;
}
/deep/.el-upload-list--picture {
display: none;
}
}
}
.upload-value-max {
width: 180px;
.upload_item {
width: 180px;
.img {
width: 180px;
}
}
}
.wid180 {
width: 180px !important;
margin-right: 13px;
}
.marRight-13 {
margin-right: 13px;
}
.tip {
font-weight: 400;
font-size: 14px;
color: #999999;
margin-top: 8px;
}
}
}
</style>
......@@ -39,120 +39,133 @@
<div class="container m-t-10" id="productInfo">
<p class="edit-title">选择产品</p>
<div class="edit_product_radio_wrap flex_sc">
<label class="radio_label">
<span class="require">*</span>
选择类型:
</label>
<el-radio v-if="productList.length" :disabled="disabled || leftDisable" v-model="equityRadio" :label="1">自选权益</el-radio>
<div style="width: 112px"></div>
<el-radio v-if="customProductList.length" :disabled="disabled || rightDisable" v-model="equityRadio" :label="2">定制权益</el-radio>
</div>
<!-- 自选权益 -->
<div v-if="equityRadio == '1'" class="auto_widget">
<el-checkbox-group v-model="curSelectPro" :disabled="disabled || dataSourceDisable">
<div v-for="(item, index) in productList" :key="index" class="product_wrapper">
<div style="padding-left: 73px">
<!-- <el-checkbox @change="changeCheckBox($event, item, index)" :disabled="item.disabled" :label="errGlassName&&item.idName=='glass'?item.packageName+`(${errGlassName})`:item.packageName"> -->
<el-checkbox @change="changeCheckBox($event, item, index)" :label="item.packageName" :disabled="item.disabled">
<div v-if="errGlassName && item.idName == 'glass'">
{{ item.packageName }}
<span style="color: red; font-weight: normal">({{ errGlassName }})</span>
</div>
<div v-else>{{ item.packageName }}</div>
</el-checkbox>
</div>
<div class="customer-form">
<!-- 属性 -->
<template v-for="(ele, indexs) in curSelectPro">
<div v-if="ele == item.packageName" :key="indexs" class="child_wrap">
<div class="child_wrap_pannel" v-for="(attr, attrindex) in item.groupAttributeList" :key="attrindex">
<div class="attr_wrapper flex_sc">
<div class="attr_label h13_title">
<span v-if="attr.required == 1" style="color: red">*</span>
{{ attr.attributeDesc }}
</div>
<div class="arrt_pannel">
<template v-if="attr.attributeType == 'input'">
<el-input class="arrt_pannel" :disabled="disabled || attr.disabled || (attr.attributeName == 'compensation_name' && compensationNameDisable)" @input="getCurChangeInput($event, item, attr, index, attrindex, 1)" v-model="productModal[item.idName][attr.attributeName]" size="small" :maxlength="attr.maxLength" clearable :placeholder="'请输入' + attr.attributeDesc"></el-input>
</template>
<template v-if="attr.attributeType == 'select'">
<el-select class="arrt_pannel" :disabled="disabled || attr.disabled" size="small" @change="getCurChangeSelect($event, item, attr)" v-model="productModal[item.idName][attr.attributeName]" clearable :placeholder="'请选择' + attr.attributeDesc">
<el-option v-for="option in attr.optionList" :key="option.value" :label="option.label" :value="option.value"></el-option>
</el-select>
</template>
<template v-if="attr.attributeType == 'datePicker'">
<el-date-picker class="arrt_pannel" :picker-options="attr.attributeName == 'additional_date' ? pickerOptions2 : pickerOptions" :disabled="disabled || attr.disabled" @change="getCurChangeDate($event, item, attr)" v-model="productModal[item.idName][attr.attributeName]" size="small" type="date" :placeholder="'请选择' + attr.attributeDesc"></el-date-picker>
</template>
<div class="check_box_wrapper">
<label class="check_label">
<span class="require">*</span>
选择产品:
</label>
<!-- 自选权益 -->
<div v-if="equityRadio == '1'" class="auto_widget">
<el-checkbox-group v-model="curSelectPro" :disabled="disabled || dataSourceDisable">
<div v-for="(item, index) in productList" :key="index" class="product_wrapper">
<div>
<!-- <el-checkbox @change="changeCheckBox($event, item, index)" :disabled="item.disabled" :label="errGlassName&&item.idName=='glass'?item.packageName+`(${errGlassName})`:item.packageName"> -->
<el-checkbox @change="changeCheckBox($event, item, index)" :label="item.packageName" :disabled="item.disabled">
<div v-if="errGlassName && item.idName == 'glass'">
{{ item.packageName }}
<span style="color: red; font-weight: normal">({{ errGlassName }})</span>
</div>
<div v-else>{{ item.packageName }}</div>
</el-checkbox>
</div>
<div class="customer-form">
<!-- 属性 -->
<template v-for="(ele, indexs) in curSelectPro">
<div v-if="ele == item.packageName" :key="indexs" class="child_wrap">
<div class="child_wrap_pannel" v-for="(attr, attrindex) in item.groupAttributeList" :key="attrindex">
<div class="attr_wrapper flex_sc">
<div class="attr_label h13_title">
<span v-if="attr.required == 1" style="color: red">*</span>
{{ attr.attributeDesc }}
</div>
<div class="arrt_pannel">
<template v-if="attr.attributeType == 'input'">
<el-input class="arrt_pannel" :disabled="disabled || attr.disabled || (attr.attributeName == 'compensation_name' && compensationNameDisable)" @input="getCurChangeInput($event, item, attr, index, attrindex, 1)" v-model="productModal[item.idName][attr.attributeName]" size="small" :maxlength="attr.maxLength" clearable :placeholder="'请输入' + attr.attributeDesc"></el-input>
</template>
<template v-if="attr.attributeType == 'select'">
<el-select class="arrt_pannel" :disabled="disabled || attr.disabled" size="small" @change="getCurChangeSelect($event, item, attr)" v-model="productModal[item.idName][attr.attributeName]" clearable :placeholder="'请选择' + attr.attributeDesc">
<el-option v-for="option in attr.optionList" :key="option.value" :label="option.label" :value="option.value"></el-option>
</el-select>
</template>
<template v-if="attr.attributeType == 'datePicker'">
<el-date-picker class="arrt_pannel" :picker-options="limitData.includes(attr.attributeName) ? pickerOptions2 : pickerOptions" :disabled="disabled || attr.disabled" @change="getCurChangeDate($event, item, attr)" v-model="productModal[item.idName][attr.attributeName]" size="small" type="date" :placeholder="'请选择' + attr.attributeDesc"></el-date-picker>
</template>
</div>
</div>
</div>
</div>
</div>
</template>
</template>
<!-- 方案 -->
<div v-if="item.packageName.includes('碰撞') && curSelectPro.includes(item.packageName)" class="table_case_wrap">
<div class="case_title">方案</div>
<div class="case_table">
<div class="table_th flex_sc">
<div class="th_item flex_cc" style="width: 89px">方案</div>
<div class="th_item flex_cc border-lr">车险定损金额</div>
<div class="th_item flex_cc max" style="width: 291px">津贴标准(累计及每次事故赔偿限额)</div>
</div>
<div class="table_tr flex_sc">
<div class="tr_item flex_cc min">方案</div>
<div class="tr_sec_item_wrap">
<div v-for="(caseItem, caseindex) in caseTable" :key="caseindex" class="tr_sec_item flex_sc">
<div class="sec_item flex_sc h9_title" :class="{ noborder: caseindex == caseTable.length - 1 }">{{ caseItem.money_one }}</div>
<div class="sec_item flex_sc max h9_title" :class="{ noborder: caseindex == caseTable.length - 1 }" style="width: 291px">{{ caseItem.money_two }}</div>
<!-- 方案 -->
<div v-if="item.packageName.includes('碰撞') && curSelectPro.includes(item.packageName)" class="table_case_wrap">
<div class="case_title">方案</div>
<div class="case_table">
<div class="table_th flex_sc">
<div class="th_item flex_cc" style="width: 89px">方案</div>
<div class="th_item flex_cc border-lr">车险定损金额</div>
<div class="th_item flex_cc max" style="width: 291px">津贴标准(累计及每次事故赔偿限额)</div>
</div>
<div class="table_tr flex_sc">
<div class="tr_item flex_cc min">方案</div>
<div class="tr_sec_item_wrap">
<div v-for="(caseItem, caseindex) in caseTable" :key="caseindex" class="tr_sec_item flex_sc">
<div class="sec_item flex_sc h9_title" :class="{ noborder: caseindex == caseTable.length - 1 }">{{ caseItem.money_one }}</div>
<div class="sec_item flex_sc max h9_title" :class="{ noborder: caseindex == caseTable.length - 1 }" style="width: 291px">{{ caseItem.money_two }}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</el-checkbox-group>
</div>
</el-checkbox-group>
</div>
<!-- 定制权益 -->
<div v-if="equityRadio == '2'" class="auto_widget">
<el-checkbox-group v-model="curSelectCustomPro" :disabled="disabled || dataSourceDisable">
<div v-for="(item, index) in customProductList" :key="index" class="product_wrapper">
<div style="padding-left: 73px">
<el-checkbox @change="changeRaido($event, item, index)" :label="item.packageName" :disabled="item.disabled">
<div>{{ item.packageName }}</div>
</el-checkbox>
<p class="h20_title product_intro">包括服务项目:{{ item.serviceItems }}</p>
</div>
<div class="customer-form">
<template v-for="(ele, indexs) in curSelectCustomPro">
<div v-if="ele == item.packageName" :key="indexs" class="child_wrap">
<div class="child_wrap_pannel" v-for="(attr, attrindex) in item.groupAttributeList" :key="attrindex">
<div class="attr_wrapper flex_sc">
<div class="attr_label h13_title">
<span v-if="attr.required == 1" style="color: red">*</span>
{{ attr.attributeDesc }}
</div>
<div class="arrt_pannel">
<template v-if="attr.attributeType == 'input'">
<el-input class="arrt_pannel" :disabled="disabled || attr.disabled || (attr.attributeName == 'compensation_name' && compensationNameDisable)" @input="getCurChangeInput($event, item, attr, index, attrindex, 2)" v-model="productModal[item.idName][attr.attributeName]" size="small" :maxlength="attr.maxLength" clearable :placeholder="'请输入' + attr.attributeDesc"></el-input>
</template>
<template v-if="attr.attributeType == 'select'">
<el-select class="arrt_pannel" :disabled="disabled || attr.disabled" size="small" @change="getCurChangeSelect($event, item, attr)" v-model="productModal[item.idName][attr.attributeName]" clearable :placeholder="'请选择' + attr.attributeDesc">
<el-option v-for="option in attr.optionList" :key="option.value" :label="option.label" :value="option.value"></el-option>
</el-select>
</template>
<template v-if="attr.attributeType == 'datePicker'">
<el-date-picker class="arrt_pannel" :picker-options="attr.attributeName == 'additional_date' ? pickerOptions2 : pickerOptions" :disabled="disabled || attr.disabled" @change="getCurChangeDate($event, item, attr)" v-model="productModal[item.idName][attr.attributeName]" size="small" type="date" :placeholder="'请选择' + attr.attributeDesc"></el-date-picker>
</template>
<!-- 定制权益 -->
<div v-if="equityRadio == '2'" class="auto_widget">
<el-checkbox-group v-model="curSelectCustomPro" :disabled="disabled || dataSourceDisable">
<div v-for="(item, index) in customProductList" :key="index" class="product_wrapper">
<div>
<el-checkbox @change="changeRaido($event, item, index)" :label="item.packageName" :disabled="item.disabled">
<div>{{ item.packageName }}</div>
</el-checkbox>
<p class="h20_title product_intro">包括服务项目:{{ item.serviceItems }}</p>
</div>
<div class="customer-form">
<template v-for="(ele, indexs) in curSelectCustomPro">
<div v-if="ele == item.packageName" :key="indexs" class="child_wrap">
<div class="child_wrap_pannel" v-for="(attr, attrindex) in item.groupAttributeList" :key="attrindex">
<div class="attr_wrapper flex_sc">
<div class="attr_label h13_title">
<span v-if="attr.required == 1" style="color: red">*</span>
{{ attr.attributeDesc }}
</div>
<div class="arrt_pannel">
<template v-if="attr.attributeType == 'input'">
<el-input class="arrt_pannel" :disabled="disabled || attr.disabled || (attr.attributeName == 'compensation_name' && compensationNameDisable)" @input="getCurChangeInput($event, item, attr, index, attrindex, 2)" v-model="productModal[item.idName][attr.attributeName]" size="small" :maxlength="attr.maxLength" clearable :placeholder="'请输入' + attr.attributeDesc"></el-input>
</template>
<template v-if="attr.attributeType == 'select'">
<el-select :allow-create="attr.attributeName == 'gearbox'" :remote="attr.attributeName == 'gearbox'" :filterable="attr.attributeName == 'gearbox'" class="arrt_pannel" :disabled="disabled || attr.disabled" size="small" @change="getCurChangeSelect($event, item, attr)" v-model="productModal[item.idName][attr.attributeName]" clearable :placeholder="'请选择' + attr.attributeDesc">
<el-option v-for="option in attr.optionList" :key="option.value" :label="option.label" :value="option.value"></el-option>
</el-select>
</template>
<template v-if="attr.attributeType == 'datePicker'">
<el-date-picker class="arrt_pannel" :picker-options="limitData.includes(attr.attributeName) ? pickerOptions2 : pickerOptions" :disabled="disabled || attr.disabled" @change="getCurChangeDate($event, item, attr)" v-model="productModal[item.idName][attr.attributeName]" size="small" type="date" :placeholder="'请选择' + attr.attributeDesc"></el-date-picker>
</template>
</div>
</div>
</div>
</div>
</div>
</template>
</template>
</div>
</div>
</div>
</el-checkbox-group>
</el-checkbox-group>
</div>
</div>
</div>
<!-- 上传资料 -->
<template v-if="showUploadInfo">
<uploadInfo :imgsQuery="attachmentListQuery" :disabled="disabled" :cardImg="cardImg" :uploadMessage="uploadMessage" @getAttachmentList="getAttachmentList"></uploadInfo>
</template>
<!-- 其他信息 -->
<div class="container m-t-10" id="otherInfo">
<p class="edit-title">其他信息</p>
......@@ -195,6 +208,7 @@ import glsxCombiForm from '@/components/glsx-combi-form'
import qrCode from '@/components/qr-code'
import { fetchConfig } from '@/config'
import utils from '../../util/util'
import uploadInfo from './uploadInfo.vue'
export default {
name: 'editEquity',
data() {
......@@ -669,7 +683,54 @@ export default {
hotline: '',
compensationNameDisable: false,
errGlassName: '',
dataSourceDisable: false
dataSourceDisable: false,
showUploadInfo: false,
// 日期限制属性
limitData: ['vehicle_registration_date', 'additional_date'],
// 上传资料默认属性
uploadMessage: {
buyCar: [],
mileage: [],
others: []
},
cardImg: {
font: '',
reverse: ''
},
attachmentListQuery: [],
// 延保变速箱
gearboxOptions: [
{
value: 'MT变速箱',
label: 'MT变速箱'
},
{
value: 'AMT变速箱',
label: 'AMT变速箱'
},
{
value: 'AT变速箱',
label: 'AT变速箱'
},
{
value: 'CVT变速箱',
label: 'CVT变速箱'
},
{
value: 'DCT变速箱',
label: 'DCT变速箱'
}
],
operationalOptions: [
{
value: 1,
label: '非营运'
},
{
value: 0,
label: '营运'
}
]
}
},
......@@ -693,7 +754,8 @@ export default {
components: {
glsxCombiForm,
qrCode
qrCode,
uploadInfo
},
async created() {
......@@ -939,6 +1001,9 @@ export default {
attributeName: 'planId'
}
this.commonPart(this.productModal[`vip${item.packageCode}`]['planId'], item, customAttr)
if (item.printType == 2) {
this.showUploadInfo = true
}
} else {
this.checkCodeList = this.checkCodeList.filter(t => t != item.packageCode)
this.autoPackageCodeList = this.autoPackageCodeList.filter(t => t != item.packageCode)
......@@ -949,6 +1014,9 @@ export default {
}
})
}
if (item.printType == 2) {
this.showUploadInfo = false
}
}
},
// 获取店铺信息
......@@ -1026,7 +1094,8 @@ export default {
attributeName: attr.attributeName,
attributeValue: e,
sort: 0,
packageCode: pack.packageCode
packageCode: pack.packageCode,
printType: pack.printType
}
this.productModal[pack.idName] = {
...temp,
......@@ -1080,7 +1149,8 @@ export default {
},
// 处理数据结构对比后台所需的参数
handleProductArrParam(arr, codearr) {
let newArr = [],filterList = []
let newArr = [],
filterList = []
const codeList = Array.from(new Set(codearr))
this.checkCodeList = codeList
let blackArr = []
......@@ -1092,10 +1162,10 @@ export default {
filterList = this.unique(arr)
}
arr = filterList
arr.forEach(el=>{
arr.forEach(els=>{
if(el.packageCode==els.packageCode){
if(el.contractNo){
arr.forEach(el => {
arr.forEach(els => {
if (el.packageCode == els.packageCode) {
if (el.contractNo) {
els.contractNo = el.contractNo
}
}
......@@ -1118,9 +1188,11 @@ export default {
// 2023 7月底版本 多商品
let attrStr = `attributes[${j}].packageCode`
let contractNoStr = `attributes[${j}].contractNo`
let printType = `attributes[${j}].printType`
let temp = {
[attrStr]: codeList[j],
[contractNoStr]: arr[i].contractNo
[contractNoStr]: arr[i].contractNo,
[printType]: arr[i].printType
}
newArr.push(temp)
}
......@@ -1218,11 +1290,11 @@ export default {
e.optionList = [...arr]
this.serviceObj[item.packageCode] = item.servicePeriod
// this.productModal[item.idName][e.attributeName] = '1'
this.$set(this.productModal[item.idName],`${e.attributeName}`,'1')
this.$set(this.productModal[item.idName], `${e.attributeName}`, '1')
} else if (e.attributeDesc == '购车类型') {
e.optionList = this.baseData.buyCarTypeList
// this.productModal[item.idName][e.attributeName] = '0'
this.$set(this.productModal[item.idName],`${e.attributeName}`,'0')
this.$set(this.productModal[item.idName], `${e.attributeName}`, '0')
} else if ((item.idName == 'tire' || item.idName == 'crash' || item.idName == `vip${item.packageCode}` || item.idName == 'glass') && e.attributeDesc == '服务期限') {
if (item.idName == 'tire' || item.idName == 'crash') {
e.optionList = this.baseData.servicePeriodList
......@@ -1235,19 +1307,33 @@ export default {
if (item.idName == `vip${item.packageCode}` && !isOld) {
e.disabled = false
e.optionList = this.baseData.servicePeriodList
// 延保
if (item.printType == 2) {
const _servicePeriodList = item.servicePeriod.split('')
let _optis = []
_servicePeriodList.forEach(itm => {
let _objj = { value: itm, label: `${itm}年` }
_optis.push(_objj)
})
e.optionList = _optis
}
}
// this.productModal[item.idName][e.attributeName] = '1'
this.$set(this.productModal[item.idName],`${e.attributeName}`,'1')
this.$set(this.productModal[item.idName], `${e.attributeName}`, e.optionList[0].value)
} else if (e.attributeDesc == '生效日期') {
let nextDay = new Date().getTime() + 24 * 60 * 60 * 1000
// this.productModal[item.idName][e.attributeName] = utils.dateFormat(nextDay)
this.$set(this.productModal[item.idName],`${e.attributeName}`,utils.dateFormat(nextDay))
this.$set(this.productModal[item.idName], `${e.attributeName}`, utils.dateFormat(nextDay))
if (item.idName == 'glass') {
let tAdd2 = new Date().getTime() + 24 * 60 * 60 * 1000 * 2
// this.productModal[item.idName][e.attributeName] = utils.dateFormat(tAdd2)
this.$set(this.productModal[item.idName],`${e.attributeName}`,utils.dateFormat(tAdd2))
this.$set(this.productModal[item.idName], `${e.attributeName}`, utils.dateFormat(tAdd2))
e.disabled = true
}
} else if (e.attributeName === 'gearbox') {
e.optionList = this.gearboxOptions
}else if (e.attributeName==='vehicle_nature'){
e.optionList = this.operationalOptions
this.$set(this.productModal[item.idName], `${e.attributeName}`, e.optionList[0].value)
}
ele.tempobj = { ...e }
})
......@@ -1399,7 +1485,7 @@ export default {
let targetItem = productArrData.find(k => k.packageCode == item.packageCode)
const defalutAttr = this.handleDefaultValue(targetItem, item.attributeDTOList)
if (defalutAttr.length) {
item.attributeDTOList = this.handlerAttrSetValue(this.unique(defalutAttr),item.attributeDTOList)
item.attributeDTOList = this.handlerAttrSetValue(this.unique(defalutAttr), item.attributeDTOList)
}
if (targetItem.packageType == 1) {
this.equityRadio = 2
......@@ -1422,13 +1508,13 @@ export default {
this.customProductList.map(c => {
c.disabled = true
c.groupAttributeList.map(ele => {
if (ele.attributeName == 'service_period' &&(this.routeInfo.addOrEdit >2)) {
if (ele.attributeName == 'service_period' && this.routeInfo.addOrEdit > 2) {
ele.disabled = true
}
if (ele.attributeName == 'card') {
ele.disabled = true
}
if (ele.attributeName == 'effective_date'&&this.routeInfo.addOrEdit==3) {
if (ele.attributeName == 'effective_date' && this.routeInfo.addOrEdit == 3) {
ele.disabled = true
}
})
......@@ -1470,13 +1556,13 @@ export default {
this.productList.map(d => {
d.disabled = true
d.groupAttributeList.map(elee => {
if (elee.attributeName == 'service_period' &&(this.routeInfo.addOrEdit >2)) {
if (elee.attributeName == 'service_period' && this.routeInfo.addOrEdit > 2) {
elee.disabled = true
}
if (elee.attributeName == 'card') {
elee.disabled = true
}
if (elee.attributeName == 'effective_date'&&this.routeInfo.addOrEdit==3) {
if (elee.attributeName == 'effective_date' && this.routeInfo.addOrEdit == 3) {
elee.disabled = true
}
if (elee.attributeName == 'buy_car_type' && elee.attributeValue == 1) {
......@@ -1499,13 +1585,17 @@ export default {
})
}
}
if (targetItem.printType == 2) {
this.showUploadInfo = true
}
packCode.push(item.packageCode)
item.attributeDTOList.forEach(el => {
attrList.push({
...el,
packageCode: item.packageCode,
contractNo: item.contractNo
contractNo: item.contractNo,
printType: item.printType
})
})
})
......@@ -1518,22 +1608,51 @@ export default {
}
this.checkCodeList = packCode
this.handleProductArrParam(attrList, packCode)
this.handlerImagesFile(detailInfo)
},
// 处理延保图片资料
handlerImagesFile(detailInfo) {
if (this.showUploadInfo) {
const { attachmentList } = detailInfo
let _temArr = []
attachmentList.forEach(el => {
if (el.attachmentCode === 'YB0001') {
this.uploadMessage.buyCar.push(el.attachmentFile)
} else if (el.attachmentCode === 'YB0002') {
this.uploadMessage.mileage.push(el.attachmentFile)
} else if (el.attachmentCode === 'YB0003') {
this.cardImg.font = el.attachmentFile
} else if (el.attachmentCode === 'YB0004') {
this.cardImg.reverse = el.attachmentFile
} else if (el.attachmentCode === 'YB0005') {
this.uploadMessage.others.push(el.attachmentFile)
}
let obj = {
attachmentCode: el.attachmentCode,
attachmentFile: el.attachmentFile,
attachmentType: el.attachmentType
}
_temArr.push(obj)
})
this.attachmentListQuery = _temArr
}
},
// 处理详情属性值赋值
handlerAttrSetValue(defaultList,targetList){
let arr = [],nameList = [],result = []
targetList.forEach(el=>{
handlerAttrSetValue(defaultList, targetList) {
let arr = [],
nameList = [],
result = []
targetList.forEach(el => {
nameList.push(el.attributeName)
})
defaultList.forEach(el=>{
if(nameList.includes(el.attributeName)){
}else{
defaultList.forEach(el => {
if (nameList.includes(el.attributeName)) {
} else {
arr.push(el)
}
})
result = [...arr,...targetList]
return result
result = [...arr, ...targetList]
return result
},
// 处理默认值赋值
handleDefaultValue(targetItem, attributeDTOList) {
......@@ -1738,6 +1857,9 @@ export default {
if (!params.attributes) {
params.attributes = []
}
if (this.showUploadInfo) {
params.attachmentList = this.attachmentList
}
params = Object.assign(params, vaidObj)
this.updateEquity(params)
},
......@@ -1745,6 +1867,7 @@ export default {
if (!params.sn) {
delete params.sn
}
params.dataSource = this.editForm.dataSource || ''
this.$apis.beforeSale.updateEquityApi(params).then(res => {
this.submit = false
......@@ -1836,6 +1959,15 @@ export default {
...params,
...vaidObj
}
if (this.showUploadInfo) {
const _check = this.checkAttachmentList()
if (_check) {
this.submit = false
this.$message({ message: '请补充全部资料', type: 'error' })
return
}
params.attachmentList = this.attachmentList
}
this.$apis.beforeSale.checkOrderApi({ vin: this.editForm.vehicle.vin, contractNo: this.routeInfo.contractNo || '' }).then(res => {
if (res.code == '0') {
this.updateEquity(params)
......@@ -1912,13 +2044,27 @@ export default {
}
// }
})
},
// 附件资料
getAttachmentList(e) {
this.attachmentList = e
},
// 校验附件资料是否上传
checkAttachmentList() {
let _code = [],
_typeCode = ['YB0001', 'YB0002', 'YB0003', 'YB0004'],
flag = false
this.attachmentList.forEach(el => {
if (_typeCode.includes(el.attachmentCode)) {
_code.push(el.attachmentCode)
}
})
_code = Array.from(new Set(_code))
if (_code.length < 4) {
flag = true
}
return flag
}
// handleCancel() {
// // if (this.submit) {
// // return true
// // }
// this.$router.back()
// }
},
beforeDestroy() {
window.removeEventListener('scroll', this.handleScroll)
......@@ -1931,6 +2077,7 @@ export default {
// }
.before-sale .container {
background: #ffffff;
box-sizing: border-box;
// box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
}
.container /deep/ .el-radio__label {
......@@ -2009,16 +2156,42 @@ export default {
margin: 0 0;
}
.edit_product_radio_wrap {
padding: 32px 0 0 73px;
padding: 26px 0 0 73px;
.radio_label {
font-weight: 400;
font-size: 14px;
color: #333333;
text-align: right;
.require {
color: red;
margin-right: 4px;
}
}
/deep/ .el-radio {
margin-right: 24px;
}
}
.check_box_wrapper {
padding: 26px 0 32px 73px;
display: flex;
.check_label {
font-weight: 400;
font-size: 14px;
color: #333333;
text-align: right;
.require {
color: red;
margin-right: 4px;
}
}
}
.auto_widget {
padding: 0 0 32px 0px;
.product_wrapper {
margin-top: 16px;
.customer-form {
background: #f9f9f9;
width: fit-content;
margin-left: 73px;
// margin-left: 73px;
}
.product_intro {
margin-top: 5px;
......@@ -2028,6 +2201,7 @@ export default {
padding: 20px 50px 20px 20px;
display: flex;
flex-direction: column;
margin-top: 8px;
.child_wrap_pannel {
position: relative;
// display: block;
......@@ -2132,6 +2306,9 @@ export default {
}
}
}
.product_wrapper:first-child {
margin-top: 0;
}
}
.before-sale .edit-sub-title {
position: relative;
......
<template>
<div class="upload-contianer">
<div class="title">上传资料</div>
<div class="widget">
<uploadHandler :isRequire="true" :disabled="disabled" @getImages="getImages($event, 'YB0001')" title="购车发票" limitNum="1" :imagesList="uploadMessage.buyCar"></uploadHandler>
<uploadHandler :isRequire="true" :disabled="disabled" @getImages="getImages($event, 'YB0002')" title="合同购买时里程数" limitNum="1" :imagesList="uploadMessage.mileage"></uploadHandler>
<uploadHandler :isRequire="true" :disabled="disabled" @getCardImg="getCardImg" uploadType="1" title="行驶证" :cardImg="cardImg"></uploadHandler>
<uploadHandler :disabled="disabled" @getImages="getImages($event, 'YB0005')" title="其他" limitNum="9" :imagesList="uploadMessage.others"></uploadHandler>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import upload_img from '@/assets/beforeSale/upload.png'
import uploadHandler from './components/UploadHandler.vue'
export default {
name: 'uploadInfo',
components: {
uploadHandler
},
data() {
return {
upload_img,
dialogVisible: false,
attachmentList: [],
license: [{}, {}]
}
},
props: {
uploadMessage: Object,
cardImg: Object,
disabled: Boolean,
imgsQuery: Array
},
mounted() {},
methods: {
getImages(e, code) {
this.handlerData()
if (code === 'YB0005') {
this.others = []
} else if (code === 'YB0001' && !e.length) {
this.buyCar = []
} else if (code === 'YB0002' && !e.length) {
this.mileage = []
}
e.forEach(url => {
let obj = {
attachmentCode: code,
attachmentFile: url,
attachmentType: 'IMG'
}
if (code === 'YB0001') {
this.buyCar = [obj]
} else if (code === 'YB0002') {
this.mileage = [obj]
} else if (code === 'YB0005') {
this.others.push(obj)
}
})
this.getAllImages()
},
getCardImg(e) {
this.handlerData()
const _value = e.detail,
type = e.type
const _attachmentCode = type == 1 ? 'YB0003' : 'YB0004'
const _attachmentFile = type == 1 ? _value.font : _value.reverse
const _obj = {
attachmentCode: _attachmentCode,
attachmentFile: _attachmentFile,
attachmentType: 'IMG'
}
if (!_attachmentFile && type == 1) {
this.license[0] = {}
} else if (!_attachmentFile && type == 2) {
this.license[1] = {}
} else {
this.license[type - 1] = _obj
}
this.getAllImages()
},
getAllImages() {
let attachmentList = [],
_tempArr1 = [],
_tempArr2 = [],
_tempArr3 = [],
_tempArr4 = []
if (this.buyCar) {
this.buyCar.forEach(e => {
_tempArr1.push(e)
})
}
if (this.mileage) {
this.mileage.forEach(e => {
_tempArr2.push(e)
})
}
if (this.others) {
this.others.forEach(e => {
_tempArr3.push(e)
})
}
if (this.license) {
this.license.forEach(e => {
if (e.attachmentFile) {
_tempArr4.push(e)
}
})
}
attachmentList = [..._tempArr1, ..._tempArr2, ..._tempArr3, ..._tempArr4]
this.$emit('getAttachmentList', attachmentList)
},
handlerData() {
if (this.imgsQuery.length && !this.active) {
this.buyCar = []
this.mileage = []
this.license = [{}, {}]
this.others = []
this.imgsQuery.forEach(el => {
if (el.attachmentCode === 'YB0001') {
this.buyCar = [el]
} else if (el.attachmentCode === 'YB0002') {
this.mileage = [el]
} else if (el.attachmentCode === 'YB0003') {
this.license[0] = el
} else if (el.attachmentCode === 'YB0004') {
this.license[1] = el
} else if (el.attachmentCode === 'YB0005') {
this.others.push(el)
}
})
this.active = true
}
}
}
}
</script>
<style lang="scss" scoped>
.upload-contianer {
background: white;
margin: 10px 0 0;
.title {
font-size: 16px;
font-weight: 600;
padding: 15px 20px;
border-bottom: 1px solid #e7eaec;
margin: 0 0;
}
.widget {
padding: 32px 0px;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!