Commit f1aeb5c8 by 杨北旺

延保

1 parent b15b78f5
......@@ -12,9 +12,9 @@ let instance = null
Vue.use(GLTable).use(GLCombiForm).use(GLTableButton).use(GLDialog)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
let { response, request, request_brand, sign, secret } = await fetchConfig(common)
// request.baseURL = 'https://scrm.dev.glsx.com.cn'
// request_brand.baseURL = 'https://scrm.dev.glsx.com.cn'
// globalState.session.token = 'scrm-base-6358b874-c112-4753-ac00-ec0cce769751-rop'
request.baseURL = 'https://scrm.dev.glsx.com.cn'
request_brand.baseURL = 'https://scrm.dev.glsx.com.cn'
globalState.session.token = 'scrm-base-863badf1-ab6d-4c0a-af86-50b8a7c19398-rop'
// request.baseURL = 'http://192.168.1.53:7226'
// request_brand.baseURL = 'http://192.168.1.53:7226'
Vue.prototype.$history = history
......
<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'
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]
this.$apis.common.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>
......@@ -78,7 +78,7 @@
</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>
<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>
......@@ -134,12 +134,12 @@
<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-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="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>
<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>
......@@ -152,6 +152,11 @@
</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">
<p class="edit-title">其他信息</p>
......@@ -183,6 +188,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() {
......@@ -664,7 +670,53 @@ export default {
hotline: '',
compensationNameDisable: false,
errGlassName: '',
dataSourceDisable: false
dataSourceDisable: 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: '营运'
}
]
}
},
......@@ -688,7 +740,8 @@ export default {
components: {
glsxCombiForm,
qrCode
qrCode,
uploadInfo
},
async created() {
......@@ -899,6 +952,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)
......@@ -909,6 +965,9 @@ export default {
}
})
}
if (item.printType == 2) {
this.showUploadInfo = false
}
}
},
// 获取店铺信息
......@@ -986,7 +1045,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,9 +1140,11 @@ export default {
blackArr[j].push(obj)
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)
}
......@@ -1194,27 +1256,39 @@ export default {
e.optionList = this.baseData.servicePeriodList2
}
e.disabled = true
if(this.routeInfo.addOrEdit==3){
e.disabled = false
if (this.routeInfo.addOrEdit == 3) {
e.disabled = false
}
// v3.1.2--新版的定制权益-服务期限--改为1,2,3年---旧版的依然是一年
let isOld = item.packageName.includes('尊享版') || item.packageName.includes('舒享版') || item.packageName.includes('优享版')
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))
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))
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 }
})
......@@ -1377,7 +1451,7 @@ export default {
if (ele.attributeName == 'service_period' && this.routeInfo.addOrEdit == 4) {
ele.disabled = true
}
if (ele.attributeName == 'card'&& this.routeInfo.addOrEdit == 4) {
if (ele.attributeName == 'card' && this.routeInfo.addOrEdit == 4) {
ele.disabled = true
}
if (ele.attributeName == 'effective_date' && this.routeInfo.addOrEdit == 4) {
......@@ -1425,7 +1499,7 @@ export default {
if (elee.attributeName == 'service_period' && this.routeInfo.addOrEdit == 4) {
elee.disabled = true
}
if (elee.attributeName == 'card'&& this.routeInfo.addOrEdit == 4) {
if (elee.attributeName == 'card' && this.routeInfo.addOrEdit == 4) {
elee.disabled = true
}
if (elee.attributeName == 'effective_date' && this.routeInfo.addOrEdit == 4) {
......@@ -1451,13 +1525,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
})
})
})
......@@ -1470,35 +1548,34 @@ export default {
}
this.checkCodeList = packCode
this.handleProductArrParam(attrList, packCode)
// 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()
// }
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
}
},
recoveryEditFormPro() {
this.editForm.attributeList.length &&
......@@ -1786,6 +1863,9 @@ export default {
if (!params.attributes) {
params.attributes = []
}
if (this.showUploadInfo) {
params.attachmentList = this.attachmentList
}
params = Object.assign(params, vaidObj)
this.updateEquity(params)
},
......@@ -1888,6 +1968,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)
......@@ -1972,6 +2061,29 @@ export default {
this.$router.push({
path: '/beforeSale/checkSet'
})
},
// 附件资料
getAttachmentList(e) {
this.attachmentList = e
},
// 校验附件资料是否上传
checkAttachmentList() {
let _code = [],
_typeCode = ['YB0001', 'YB0002', 'YB0003', 'YB0004'],
flag = false
if ((!this.attachmentList || !this.attachmentList.length) && this.attachmentListQuery.length) {
this.attachmentList = this.attachmentListQuery || []
}
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
}
}
}
......
<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>
<template>
<div class="warning-contianer">
<div class="title">预警信息</div>
<div class="widget">
<template v-for="(item, index) in list">
<div :key="index" class="element">
<label class="label">风险预警{{ index + 1 }}:</label>
<div class="wrap">
<div class="cell">
<label class="cell-label">预警原因:</label>
<div class="cell-value">{{ item.reason }}</div>
</div>
<div class="cell">
<label class="cell-label">具体描述:</label>
<div class="cell-value">{{ item.descption }}</div>
</div>
<div class="cell">
<label class="cell-label">核实情况说明:</label>
<el-input class="input-value" v-model="item.explain" type="textarea" placeholder="请输入核实后的情况说明" show-word-limit maxlength="100"></el-input>
</div>
<div class="cell">
<label class="cell-label">核实资料补充:</label>
<div class="inner">
<div class="image_group">
<template v-if="item.imgs.length">
<div v-for="(imgItem, i) in item.imgs" :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 @click="toDeleteImg(index, i)" class="el-icon-delete"></i>
</div>
</div>
</template>
<div class="upload-value">
<el-upload 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>
</div>
<p class="tips">图片格式为jpg,jpeg,png,大小10M以内</p>
</div>
</div>
</div>
</div>
</template>
</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/images/upload.png'
export default {
name: 'wraning',
components: {},
data() {
return {
upload_img,
wraningList: [
{
reason: '支付账号异常',
descption: '此个人收款账号已累计赔付≥3次',
imgs: [],
explain: ''
}
],
dialogVisible:false
}
},
props: {
list:Array
},
mounted() {},
methods: {
toDeleteImg(index, i) {
this.wraningList[index].imgs.splice(i, 1)
},
handlePictureCardPreview(url) {
this.dialogImageUrl = url
this.dialogVisible = true
},
beforeAvatarUpload(e) {
console.log(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 }, index) {
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]
this.$apis.common
.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]
this.wraningList[index].imgs.push(url)
}
})
}
},
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>
.warning-contianer {
background: white;
margin: 20px 0 0;
.title {
padding: 0 20px;
font-size: 16px;
font-weight: bold;
height: 58px;
line-height: 58px;
border-bottom: 1px solid #d8d8d8;
margin: 0 0;
color: #333;
}
.widget {
padding: 32px 20px;
.element {
display: flex;
margin-bottom: 20px;
.label {
width: 154px;
text-align: right;
font-weight: 400;
font-size: 14px;
color: #333333;
}
.wrap {
width: 792px;
background: #f9f9f9;
box-sizing: border-box;
padding: 20px;
.cell {
display: flex;
margin-bottom: 20px;
.cell-label {
width: 134px;
font-weight: 400;
font-size: 14px;
color: #666666;
text-align: right;
}
.cell-value {
font-weight: 400;
font-size: 14px;
color: #333333;
}
.input-value {
width: 580px;
}
.inner {
.image_group {
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;
}
}
}
}
.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;
}
}
}
.tips {
font-weight: 400;
font-size: 14px;
color: #999999;
margin-top: 8px;
}
}
}
.cell:last-child {
margin-bottom: 0;
}
}
}
.element:last-child {
margin-bottom: 0;
}
}
}
</style>
......@@ -16,7 +16,7 @@
<GLCombiForm :rowNumber="1" ref="showSearch" :formObj="searchForm" :formData="searchFormData" @handleOk="handleOkFn" @handleRest="handleRestFn()"></GLCombiForm>
</div>
<div class="table_widget">
<el-button plain style="float:right;margin-bottom:10px;" size="small" @click="exportList">导出</el-button>
<el-button plain style="float: right; margin-bottom: 10px" size="small" @click="exportList">导出</el-button>
<GLTable ref="equityRef" :pageSizes="sizeList" :getListApi="getListApi" :searchForm="searchParams" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" :pageConf="batchPageConf">
<div class="table-btns" slot="table-btns" slot-scope="scope">
<!-- <GLButton v-if="[0].includes(scope.scope.status)" fn="去处理" type="text" @click="handleEdit(4, scope.scope)">去处理</GLButton>
......@@ -54,7 +54,31 @@ const statusList = [
{
confId: 4,
confName: '支付失败'
}
},
{
confId: 19,
confName: '待核实'
},
{
confId: 21,
confName: '待运营经理审核'
},
{
confId: 22,
confName: '运营经理审核不通过'
},
{
confId: 23,
confName: '待核赔'
},
// {
// confId: 24,
// confName: '核赔通过'
// },
{
confId: 25,
confName: '核赔不通过'
},
]
export default {
name: 'index',
......@@ -68,7 +92,7 @@ export default {
return '去处理'
},
condition: row => {
return [0].includes(row.scope.status)
return [0,19,22,25].includes(row.scope.status)
},
attrs: {
type: 'text',
......@@ -84,7 +108,7 @@ export default {
return '查看'
},
condition: row => {
return [1, 3, 4].includes(row.scope.status)
return [1, 3, 4,21,24].includes(row.scope.status)
},
attrs: {
type: 'text',
......@@ -109,6 +133,38 @@ export default {
listeners: {
click: row => this.handleEdit(3, row.scope)
}
},
{
type: 'GLButton',
name: row => {
return '运营经理审核'
},
condition: row => {
return [21].includes(row.scope.status)
},
attrs: {
type: 'text',
fn: '运营经理审核'
},
listeners: {
click: row => this.handleEdit(4, row.scope)
}
},
{
type: 'GLButton',
name: row => {
return '核赔审核'
},
condition: row => {
return [23].includes(row.scope.status)
},
attrs: {
type: 'text',
fn: '核赔审核'
},
listeners: {
click: row => this.handleEdit(4, row.scope)
}
}
],
getListApi: this.$apis.claims.getclaimsList,
......@@ -263,7 +319,6 @@ export default {
{
label: '操作',
prop: '',
width: 100,
fixed: 'right',
addHtml: 'table-btns'
}
......
<!-- 权益订单 -->
<template>
<div>
<div class="fail_status_widget">
<i class="el-icon-warning"></i>
<span>核赔不通过:订单支付金额异常</span>
</div>
<report @toSearchOrderDetail="toSearchOrderDetail" ref="reportRef" :isGH="routeInfo.isGH" :pageType="pageType" :editForm.sync="editForm"></report>
<repair ref="repairRef" @changeObjectType="changeObjectType" :isGH="routeInfo.isGH" :pageType="pageType" :serviceItemsList.sync="serviceItemsList" :totalPrice.sync="totalPrice" :accountForm.sync="accountForm"></repair>
<material ref="materialRef" :pageType="pageType" :materialForm.sync="materialForm"></material>
<wraning v-if="accountMatchResultList.length" :list="accountMatchResultList"></wraning>
<div class="page-btm-btn" v-if="pageType != 2">
<el-button type="primary" @click="confirmSubmit(1)">提交</el-button>
<el-button type="primary" plain @click="confirmSubmit(2)">草稿</el-button>
</div>
<el-dialog title="风险预警" width="720px" :visible.sync="dialogVisible">
<div class="warning_body">
<div class="header">
<i class="el-icon-warning"></i>
<span class="title">风险预警</span>
<span class="cont">请核实情况,并在系统上提交说明或上传资料。</span>
</div>
<div class="main">
<template v-for="(item, index) in accountMatchResultList">
<div class="element" :key="index">
<div class="e_title">风险预警{{ index + 1 }}:支付账号异常</div>
<div class="e_desc">具体描述:{{ item.matchResultDesc }}</div>
</div>
</template>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button :size="size" @click="cancelWarning">取 消</el-button>
<el-button :size="size" type="primary" @click="handleWarning">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
......@@ -15,12 +41,14 @@ import report from './components/report.vue'
import repair from './components/repair.vue'
import material from './components/material.vue'
import util from '@/util/util'
import wraning from './components/wraning/index.vue'
export default {
name: 'order',
components: {
report,
repair,
material
material,
wraning
},
data() {
return {
......@@ -61,7 +89,9 @@ export default {
billInfo: [],
otherInfo: []
},
serviceItemsList: []
serviceItemsList: [],
dialogVisible: false,
accountMatchResultList: []
}
},
created() {
......@@ -79,14 +109,13 @@ export default {
},
computed: {
totalPrice() {
let total = this.serviceItemsList.reduce(function(prev, cur) {
let total = this.serviceItemsList.reduce(function (prev, cur) {
return prev + +(cur.approveAmount * 100).toFixed(0)
}, 0)
return total / 100
}
},
mounted() {
console.log('更新')
},
methods: {
......@@ -140,6 +169,10 @@ export default {
this.materialForm.otherInfo.push(obj)
}
})
if (res.status == 19) {
this.dangerWran()
}
this.accountMatchResultList = res.accountMatchResultList
})
},
// 新增的时候,输入合同号,带出信息
......@@ -292,11 +325,41 @@ export default {
},
handleCancel() {
this.$router.push({ path: '/claims/index' })
},
// 风险预警
dangerWran() {
this.dialogVisible = true
},
cancelWarning() {
this.dialogVisible = false
},
handleWarning() {
this.dialogVisible = false
}
}
}
</script>
<style lang="scss" scoped>
.fail_status_widget {
width: 100%;
height: 40px;
background: #ffeed9;
border-radius: 4px;
margin-bottom: 12px;
display: flex;
align-items: center;
box-sizing: border-box;
padding-left: 16px;
i {
color: #fdb757;
}
span {
font-weight: 400;
font-size: 14px;
color: #000000a6;
margin-left: 8px;
}
}
.footer {
width: 100%;
position: fixed;
......@@ -307,4 +370,55 @@ export default {
line-height: 64px;
background: #ffffff;
}
.warning_body {
.header {
display: flex;
flex-direction: column;
align-items: center;
i {
color: #fdb757;
font-size: 48px;
}
.title {
font-weight: 500;
font-size: 16px;
color: #333333;
line-height: 24px;
margin: 8px 0 4px 0;
}
.cont {
font-weight: 400;
font-size: 14px;
color: #666666;
margin-bottom: 20px;
}
}
.main {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.element {
width: 335px;
background: #f9f9f9;
box-sizing: border-box;
padding: 12px 19px 12px 16px;
margin-bottom: 10px;
.e_title {
font-weight: 400;
font-size: 14px;
color: #333333;
margin-bottom: 4px;
}
.e_desc {
font-weight: 400;
font-size: 14px;
color: #999999;
line-height: 20px;
}
}
}
}
/deep/ .el-dialog__footer {
text-align: center;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!