Commit 4417fe36 by 杨北旺

修复bug

1 parent 746dfc14
......@@ -19,7 +19,7 @@
<div v-if="item.serviceItemCode == 'SC0006'" style="height: 36px" class="messag flex_sc">
<div class="ms flex_sc">
<span>服务类型:</span>
<el-checkbox-group v-model="item.lossTypeList">
<el-checkbox-group v-model="item.lossTypeList" @change="changeType">
<el-checkbox label="3">钥匙</el-checkbox>
<el-checkbox label="4">车牌重置</el-checkbox>
</el-checkbox-group>
......@@ -28,11 +28,11 @@
<div class="messag" :class="[{ pad20: item.serviceItemCode != 'SC0003' && item.serviceItemCode != 'SC0006' }]">
<div class="ms flex_sc">
<div class="ms_lab">预估损失金额/元:</div>
<el-input v-model="item.applyAmount" size="mini" class="w432" maxlength="10"></el-input>
<el-input @input="validPrice($event, index, 'applyAmount')" @blur="changePrice($event, index, 'applyAmount')" v-model="item.applyAmount" size="mini" class="w432" maxlength="10"></el-input>
</div>
<div class="ms flex_sc ma20">
<div class="ms_lab">定损批准金额/元:</div>
<el-input v-model="item.approveAmount" size="mini" class="w432" maxlength="10"></el-input>
<el-input @input="validPrice($event, index, 'approveAmount')" @blur="changePrice($event, index, 'approveAmount')" v-model="item.approveAmount" size="mini" class="w432" maxlength="10"></el-input>
</div>
</div>
</div>
......@@ -68,11 +68,11 @@
</div>
</div>
<div>
<uploadMaterial :insuranceAttachmentConfigs.sync="insuranceAttachmentConfigs"></uploadMaterial>
<uploadMaterial :isClaims="true" :lossTypeList.sync="lossTypeList" :insuranceAttachmentConfigs.sync="insuranceAttachmentConfigs"></uploadMaterial>
</div>
<div class="widget ma16">
<div class="title">寄回原件说明</div>
<div class="content pad20 ">
<div class="content pad20">
<div class="flex_sc" v-for="(first, ind) in repotData.claimsAttachmentConfigs2" :key="ind">
<div v-for="(img, i) in first.secondClassifyList" :key="i" class="img_box">
<div class="title_tip flex_sc">
......@@ -109,6 +109,7 @@ export default {
accountRule: {
accountType: [{ required: true, message: '请选择账户类型', trigger: 'change' }],
branchBankCode: [{ required: true, message: '请选择开户行名称', trigger: 'change' }],
openBankCode: [{ required: true, message: '请选择开户行名称', trigger: 'change' }],
accountName: [{ required: true, message: '请输入账户名称', trigger: 'change' }],
accountNo: [
{
......@@ -127,9 +128,12 @@ export default {
}
],
bankCity: [{ required: true, message: '请选择收款账号所在省市', trigger: 'change' }],
accountCityCode: [{ required: true, message: '请选择收款账号所在省市', trigger: 'change' }],
payeeIDCardType: [{ required: true, message: '请选择收款人证件类型', trigger: 'change' }],
cardTypeCode: [{ required: true, message: '请选择收款人证件类型', trigger: 'change' }],
handlerName: [{ required: true, message: '请输入经办人', trigger: 'change' }],
payeeIDCardNo: [{ required: true, message: '请输入收款人证件号码', trigger: 'change' }],
cardNo: [{ required: true, message: '请输入收款人证件号码', trigger: 'change' }],
payeePhone: [{ required: true, message: '请输入联系号码', trigger: 'change' }],
handlerPhone: [
{
......@@ -146,6 +150,21 @@ export default {
trigger: 'change'
}
],
phone: [
{
required: true,
validator: (rule, value, callback) => {
if (!value) {
callback(new Error('请输入手机号'))
} else if (phoneReg.test(value)) {
callback()
} else {
callback(new Error('请输入正确的手机号'))
}
},
trigger: 'change'
}
],
reimbursementDesc: [{ required: true, message: '请输入出险经过描述', trigger: 'change' }]
},
accountData: [
......@@ -231,7 +250,8 @@ export default {
repotData: Object,
accountForm: Object,
itemsList: Array,
insuranceAttachmentConfigs: Array
insuranceAttachmentConfigs: Array,
lossTypeList: Array
},
watch: {
'accountForm.objectType': {
......@@ -248,6 +268,10 @@ export default {
this.getBankList()
},
methods: {
changeType(e) {
this.lossTypeList = e
this.$emit('getCurrentLoosType', e)
},
changeObjectType(newVal) {
this.$emit('changeObjectType', newVal)
},
......@@ -261,6 +285,47 @@ export default {
const IDCardTypeList = this.accountData.find(item => item.name === 'cardTypeCode')
IDCardTypeList.optionList = res.cardType
})
},
validPrice(e, id, type) {
let checkPlan = '' + this.itemsList[id][type]
checkPlan = checkPlan
.replace(/[^\d.]/g, '')
.replace(/\.{2,}/g, '.')
.replace(/^\./g, '')
.replace('.', '$#$')
.replace(/\./g, '')
.replace('$#$', '.')
if (checkPlan.indexOf('.') < 0 && checkPlan !== '') {
checkPlan = parseFloat(checkPlan) + ''
} else if (checkPlan.indexOf('.') >= 0) {
checkPlan = checkPlan.replace(/^()*(\d+)\.(\d\d).*$/, '$1$2.$3') // 只能输入两个小数
}
this.$set(this.itemsList[id], type, checkPlan)
this.getTotal(type)
},
changePrice(e, id, type) {
if (!e.target.value) return
const len = e.target.value.length
let lastStr = e.target.value.charAt(len - 1)
if (lastStr === '.') {
this.$set(this.itemsList[id], type, e.target.value.substr(0, len - 1))
}
const minPrice = 1
if (Number(e.target.value) < minPrice) {
this.$set(this.itemsList[id], type, 1)
}
const maxPrice = 200000
if (Number(e.target.value) > maxPrice) {
this.$set(this.itemsList[id], type, maxPrice)
}
this.getTotal(type)
},
getTotal(type) {
let total = this.itemsList.reduce(function (prev, cur) {
let curPrice = cur.checked ? cur[type] : 0
return prev + +(curPrice * 100).toFixed(0)
}, 0)
this.repotData[type] = (total / 100).toFixed(2)
}
}
}
......@@ -305,16 +370,16 @@ export default {
position: relative;
border-radius: 4px;
.egTag {
position: absolute;
right: 8px;
top: 8px;
width: 36px;
height: 18px;
color: #666;
font-size: 12px;
border-radius: 2px;
background: #e5e5e5;
}
position: absolute;
right: 8px;
top: 8px;
width: 36px;
height: 18px;
color: #666;
font-size: 12px;
border-radius: 2px;
background: #e5e5e5;
}
}
}
</style>
......@@ -25,7 +25,7 @@
</div>
<div v-if="item.firstClassifyName.indexOf('细节') != -1" class="image_container">
<template v-for="(img, i) in insuranceAttachmentConfigs[currentIndx].secondClassifyList">
<div v-if="img.serviceItemName == '钥匙及车牌重置服务' && img.serviceItemName == item.services[currentServicesIndex] ? lossTypeList.includes(img.lossType) : img.serviceItemName == item.services[currentServicesIndex]" :key="i" class="img_box">
<div v-if="!isClaims && img.serviceItemName == '钥匙及车牌重置服务' && img.serviceItemName == item.services[currentServicesIndex] ? lossTypeList.includes(img.lossType) : img.serviceItemName == item.services[currentServicesIndex]" :key="i" class="img_box">
<div class="title flex_sc">
<i v-if="img.attachmentList.length && img.attachmentList[0].auditStatus == 1" class="el-icon-success success"></i>
<i v-else-if="img.attachmentList.length && img.attachmentList[0].auditStatus == 0" class="el-icon-error error"></i>
......@@ -172,7 +172,8 @@ export default {
props: {
insuranceAttachmentConfigs: Array,
isDisabled: Boolean,
lossTypeList: Array
lossTypeList: Array,
isClaims: Boolean
},
mounted() {},
methods: {
......@@ -197,15 +198,14 @@ export default {
},
// type 1通过 0不通过 2 上传
toHandlerImage(img, index, type, isOther = false) {
if(!img.attachmentList.length){
if (!isOther && !img.attachmentList.length) {
img.attachmentList[0] = {
...img,
attachmentFile:'',
auditStatus:null,
reasonForFailure:''
attachmentFile: '',
auditStatus: null,
reasonForFailure: ''
}
}
// if (!img.attachmentList.length && !isOther) return
this.uploadObj = {
img,
index
......@@ -223,6 +223,7 @@ export default {
} else {
img.attachmentList[0].auditStatus = type
}
this.$forceUpdate()
return
}
if (type == 0) {
......@@ -233,15 +234,21 @@ export default {
}
this.showNoPassDialog = true
}
this.$set(this.insuranceAttachmentConfigs[this.currentIndx].secondClassifyList[index], img)
// this.$set(this.insuranceAttachmentConfigs[this.currentIndx].secondClassifyList[index], img)
},
touploadOther() {
this.isUploadOther = true
this.otherUploadIndex = null
},
upload(e) {
let otherObj = {}
let copy = null
if (this.isUploadOther) {
Object.assign(otherObj, this.insuranceAttachmentConfigs[this.currentIndx].allImages[0])
if(this.uploadObj){
copy = this.uploadObj.img
}
this.classifyId = this.insuranceAttachmentConfigs[this.currentIndx].secondClassifyList[0].id
Object.assign(otherObj, copy?copy:this.insuranceAttachmentConfigs[this.currentIndx].allImages[0])
}
const file = e.target.files[0]
const reader = new FileReader()
......@@ -255,10 +262,19 @@ export default {
otherObj.attachmentFile = res
otherObj.auditStatus = null
otherObj.attachmentType = file.name.split('.').pop()
console.log(otherObj);
if (this.otherUploadIndex != null) {
this.insuranceAttachmentConfigs[this.currentIndx].allImages[this.otherUploadIndex] = otherObj
this.$forceUpdate()
} else [this.insuranceAttachmentConfigs[this.currentIndx].allImages.push(otherObj)]
} else {
otherObj.id = null
otherObj.attachmentName = null
otherObj.auditStatus = null
otherObj.reasonForFailure = null
otherObj.auditBy = null
otherObj.classifyId = this.classifyId
this.insuranceAttachmentConfigs[this.currentIndx].allImages.push(otherObj)
}
return
}
this.uploadObj.img.attachmentList[0].attachmentFile = res
......@@ -275,8 +291,8 @@ export default {
} else {
this.uploadObj.img.attachmentList[0].auditStatus = 0
this.uploadObj.img.attachmentList[0].reasonForFailure = this.imgPassObj.desc
this.$set(this.insuranceAttachmentConfigs[this.currentIndx].secondClassifyList[this.uploadObj.index], this.uploadObj.img)
}
this.$set(this.insuranceAttachmentConfigs[this.currentIndx].secondClassifyList[this.uploadObj.index], this.uploadObj.img)
this.cancelDialog()
},
cancelDialog() {
......
......@@ -221,7 +221,7 @@
</div>
<div v-if="item.firstClassifyName.indexOf('细节') != -1" class="image_container">
<template v-for="(img, i) in images[currentIndx].secondClassifyList">
<div v-if="img.serviceItemName == item.services[currentServicesIndex]" :key="i" class="img_box">
<div v-if="!isClaims && img.serviceItemName == '钥匙及车牌重置服务' && img.serviceItemName == item.services[currentServicesIndex] ? lossTypeList.includes(img.lossType) : img.serviceItemName == item.services[currentServicesIndex]" :key="i" class="img_box">
<div class="title_tip flex_sc">
<i v-if="img.attachmentList.length && img.attachmentList[0].auditStatus == 1" class="el-icon-success success"></i>
<i v-else-if="img.attachmentList.length && img.attachmentList[0].auditStatus == 0" class="el-icon-error error"></i>
......@@ -331,7 +331,8 @@ export default {
itemsList: Array,
images: Array,
images2: Array,
otherInfoData: Object
otherInfoData: Object,
lossTypeList:Array
},
mounted() {},
methods: {
......
<template>
<div class="order-container-page">
<template v-if="pageType == 2">
<WatchData :otherInfoData.sync="otherInfoData" :images="insuranceAttachmentConfigs" :images2="claimsAttachmentConfigs" :itemsList.sync="itemList" :repotData.sync="repotData" :accountList.sync="accountList" :watchData.sync="watchData"></WatchData>
<WatchData :lossTypeList.sync="lossTypeList" :otherInfoData.sync="otherInfoData" :images="insuranceAttachmentConfigs" :images2="claimsAttachmentConfigs" :itemsList.sync="itemList" :repotData.sync="repotData" :accountList.sync="accountList" :watchData.sync="watchData"></WatchData>
</template>
<template v-else-if="pageType == 5 && routeInfo.status < 11">
<CheckData @getCurrentLoosType="getLossType" :lossTypeList.sync="lossTypeList" :otherInfoData.sync="otherInfoData" :itemList.sync="itemList" :insuranceAttachmentConfigs.sync="insuranceAttachmentConfigs" :repotData.sync="repotData"></CheckData>
......@@ -10,10 +10,10 @@
<div class="tab_wrap">
<el-tabs v-model="activeName">
<el-tab-pane class="bg" label="核赔信息" name="first">
<CheckClaims @changeObjectType="changeObjectType" :insuranceAttachmentConfigs.sync="claimsAttachmentConfigs" :repotData.sync="repotData" :itemsList.sync="itemList" :accountForm.sync="accountForm"></CheckClaims>
<CheckClaims @getCurrentLoosType="getLossType" :lossTypeList.sync="lossTypeList" @changeObjectType="changeObjectType" :insuranceAttachmentConfigs.sync="claimsAttachmentConfigs" :repotData.sync="repotData" :itemsList.sync="itemList" :accountForm.sync="accountForm"></CheckClaims>
</el-tab-pane>
<el-tab-pane class="bg" label="定损信息" name="second">
<CheckData :lossTypeList.sync="lossTypeList" :isDisabled="true" :otherInfoData.sync="otherInfoData" :itemList.sync="itemList" :insuranceAttachmentConfigs.sync="insuranceAttachmentConfigs" :repotData.sync="repotData"></CheckData>
<CheckData @getCurrentLoosType="getLossType" :lossTypeList.sync="lossTypeList" :isDisabled="true" :otherInfoData.sync="otherInfoData" :itemList.sync="itemList" :insuranceAttachmentConfigs.sync="insuranceAttachmentConfigs" :repotData.sync="repotData"></CheckData>
</el-tab-pane>
</el-tabs>
</div>
......@@ -133,7 +133,7 @@ export default {
inputType: 'textarea',
rows: 3,
isClear: true,
maxlength: 200,
maxlength: 200
}
],
testServiceList: [],
......@@ -141,7 +141,7 @@ export default {
itemList: [],
otherInfoData: {},
claimsAttachmentConfigs: [],
lossTypeList:[]
lossTypeList: []
}
},
mounted() {
......@@ -218,9 +218,9 @@ export default {
}
if (item.firstClassifyName.indexOf('定损细节照片') != -1) {
item.secondClassifyList.forEach(el => {
if(el.secondClassifyName.indexOf('钥匙')!=-1&&el.serviceItemCode=='SC0006'){
if (el.secondClassifyName.indexOf('钥匙') != -1 && el.serviceItemCode == 'SC0006') {
el.lossType = '3'
}else if(el.secondClassifyName.indexOf('车牌')!=-1&&el.serviceItemCode=='SC0006'){
} else if (el.secondClassifyName.indexOf('车牌') != -1 && el.serviceItemCode == 'SC0006') {
el.lossType = '4'
}
services.push(el.serviceItemName)
......@@ -242,6 +242,11 @@ export default {
}
if (item.firstClassifyName.indexOf('核赔细节照') != -1) {
item.secondClassifyList.forEach(el => {
if (el.secondClassifyName.indexOf('钥匙') != -1 && el.serviceItemCode == 'SC0006') {
el.lossType = '3'
} else if (el.secondClassifyName.indexOf('车牌') != -1 && el.serviceItemCode == 'SC0006') {
el.lossType = '4'
}
services.push(el.serviceItemName)
})
item.services = [...new Set(services)]
......@@ -420,7 +425,7 @@ export default {
})
return pass
},
handleJieGpu(type,isNopass=true) {
handleJieGpu(type, isNopass = true) {
let target = {}
let arr = []
if (type == 3) {
......@@ -511,19 +516,18 @@ export default {
para.auditStatus = 0
para.reasonForFailureCode = this.noPassObj.reason
para.reasonForFailure = this.noPassObj.desc
console.log(para);
// let loading = this.createLoading()
// this.$apis.claims.checkOrderApi(para).then(res => {
// loading.close()
// if (res) {
// this.$message({
// message: '操作成功',
// type: 'success'
// })
// this.$router.push({ path: '/claims/ghIndex' })
// }
// this.cancleNoPass()
// })
let loading = this.createLoading()
this.$apis.claims.checkOrderApi(para).then(res => {
loading.close()
if (res) {
this.$message({
message: '操作成功',
type: 'success'
})
this.$router.push({ path: '/claims/ghIndex' })
}
this.cancleNoPass()
})
},
cancleNoPass() {
this.showNoPassDialog = false
......@@ -601,32 +605,53 @@ export default {
let serviceImgs = []
if (this.orderMsg.status == 12 || this.orderMsg.status == 2) {
this.claimsAttachmentConfigs.forEach((item, index) => {
item.secondClassifyList.forEach(el => {
el.attachmentList.forEach(ele => {
ele.secondClassifyName = el.secondClassifyName
imgs.push(ele)
if (item.firstClassifyName.indexOf('其他') != -1) {
item.secondClassifyList.forEach(el => {
el.attachmentList = item.allImages
el.attachmentList.forEach(ele => {
ele.attachmentCode = el.attachmentCode
ele.secondClassifyName = el.secondClassifyName
imgs.push(ele)
})
})
})
} else {
item.secondClassifyList.forEach(el => {
el.attachmentList.forEach(ele => {
ele.secondClassifyName = el.secondClassifyName
imgs.push(ele)
})
})
}
})
} else {
this.insuranceAttachmentConfigs.forEach((item, index) => {
item.secondClassifyList.forEach(el => {
if(el.serviceItemName=='钥匙及车牌重置服务'&&this.lossTypeList.includes(el.lossType)){
if (item.firstClassifyName.indexOf('其他') != -1) {
item.secondClassifyList.forEach(el => {
el.attachmentList = item.allImages
el.attachmentList.forEach(ele => {
ele.secondClassifyName = el.secondClassifyName
serviceImgs.push(ele)
})
}else{
el.attachmentList.forEach(ele => {
ele.secondClassifyName = el.secondClassifyName
imgs.push(ele)
})
}
})
})
} else {
item.secondClassifyList.forEach(el => {
if (el.serviceItemName == '钥匙及车牌重置服务' && this.lossTypeList.includes(el.lossType)) {
el.attachmentList.forEach(ele => {
ele.secondClassifyName = el.secondClassifyName
serviceImgs.push(ele)
})
} else {
el.attachmentList.forEach(ele => {
ele.secondClassifyName = el.secondClassifyName
imgs.push(ele)
})
}
})
}
})
}
if(serviceImgs.length){
imgs = [...serviceImgs,...imgs]
if (serviceImgs.length) {
imgs = [...serviceImgs, ...imgs]
}
let obj = {}
let type = this.orderMsg.status == 12 || this.orderMsg.status == 2 ? 2 : 1
......@@ -660,7 +685,7 @@ export default {
return obj
},
// 获取车牌钥匙选择类型
getLossType(e){
getLossType(e) {
this.lossTypeList = e
},
// 服务项目数据处理
......@@ -725,9 +750,10 @@ export default {
...explainObj,
...this.orderMsg,
attachments3: this.handleJieGpu(3),
attachments2: this.handleJieGpu(2),
// attachments2: this.handleJieGpu(2),
bankAccount: this.handleJieGpu(4),
writeOffCode: this.repotData.writeOffCode
writeOffCode: this.repotData.writeOffCode,
...imgObj
}
return this.orderMsg.status == 12 || this.orderMsg.status == 2 ? claims : para
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!