Commit 2b2b42ce by 杨北旺

提交

1 parent e0b8ebc6
const url = '/rop-scrm-equity/router'
const car_url = '/rop-scrm-carlife/router'
export default {
/**获取员工销售的无忧卡订单列表 */
orderListApi(data) {
......@@ -56,13 +57,33 @@ export default {
},
/**上传图片 */
uploadImageApi(data){
data.method = 'scrm.api.equity.common.upload.image'
// data.method = 'scrm.api.equity.common.upload.image'
data.method = 'scrm.api.carlife.common.uploadImg'
return window.$HTTP({
url,
// url,
url:car_url,
data,
returnAll: true,
sign: true,
noSignAttr: ['file'],
})
}
},
// 核赔资料图片上传列表
claimsClassifyApi(data){
data.method = 'scrm.api.equity.service.attachment.classify.list'
return window.$HTTP({
url,
data,
returnAll: true
})
},
// 核赔资料图片上传
claimsClassifyuploadApi(data){
data.method = 'scrm.api.equity.service.claims.phone.attachment.save'
return window.$HTTP({
url,
data,
returnAll: true
})
},
}
......@@ -56,10 +56,12 @@ const actions = {
},
navigation({ dispatch }) {
dispatch('registerHttp')
state.showWindow = true
},
registerHttp({}, sessionId = '') {
window.$HTTP = new Http({ ...window.$fetchConfig, alert: Notify, headers: { token: sessionId } })
// window.$HTTP = new Http({ ...window.$fetchConfig, alert: Notify, headers: { token: sessionId } })
window.$HTTP = new Http({ ...window.$fetchConfig, alert: Notify, headers: { token: 'scrm-base-39095f3d-5510-41a2-8ac1-f3e26687f426-rop' } })
}
}
const getParams = name => {
......
......@@ -18,24 +18,37 @@
<div v-if="el.tip" class="tip">{{ el.tip }}</div>
</div>
<div class="wrap flex_scb">
<div v-for="(ele, idx) in el.images" :key="idx" style="margin-bottom:10px" class="imageBox flex_ccc">
<img class="icon" :src="imageBase + ele.icon" />
<span class="tips">{{ ele.label }}</span>
<div class="opa_upload" @click="toClickUpoload(ele)">
<div v-for="(ele, idx) in el.images" :key="idx" style="margin-bottom: 10px" class="imageBox flex_ccc">
<template v-if="!ele.url">
<img class="icon" :src="imageBase + ele.icon" />
<span class="tips">{{ ele.label }}</span>
</template>
<template v-if="ele.url">
<img style="width: 100%; height: 100%" :src="ele.url" />
</template>
<div class="opa_upload" @click="toClickUpoload(ele, inx, idx)">
<van-uploader max-count="1" :before-delete="beforeDelete" v-on:click-upload="beforeRead" :before-read="checkRead" :after-read="afterRread"></van-uploader>
</div>
<div v-if="ele.url" class="delete_icon" @click.stop="toDelete(ele, inx, idx)">
<img src="../../../assets/images/claims_delete.png" />
</div>
</div>
</div>
</div>
</template>
<template v-else>
<div class="widget flex_ss flex_wrap">
<div v-for="(img, i) in item.content" :key="i" class="image_wrap" :style="{ width: size, height: size }" :class="[{ mar0: (i + 1) % 3 == 0 }]"></div>
<div v-for="(img, i) in item.content" :key="i" class="image_wrap" :style="{ width: size, height: size }" :class="[{ mar0: (i + 1) % 3 == 0 }]">
<img style="width: 100%; height: 100%" :src="img.url" />
<div class="delete_icon" @click.stop="deleteImg(i)">
<img src="../../../assets/images/claims_delete.png" />
</div>
</div>
<div :style="{ width: size, height: size }" class="upload_area flex_ccc">
<van-icon name="plus" size="20px" color="#999999" />
<span class="text">上传照片</span>
<div class="opa_upload">
<van-uploader max-count="4" :before-delete="beforeDelete" v-on:click-upload="beforeRead" :before-read="checkRead" :after-read="afterRread"></van-uploader>
<van-uploader max-count="9" :before-delete="beforeDelete" v-on:click-upload="beforeRead" :before-read="checkRead" :after-read="otherAfterRread"></van-uploader>
</div>
</div>
</div>
......@@ -44,515 +57,517 @@
</div>
</template>
</div>
<div class="sumbit_btn flex_ccc">传送图片</div>
<div v-if="list.length" @click="sumbitSave" class="sumbit_btn flex_ccc">传送图片</div>
</div>
</template>
<script>
import { upload } from '@/api'
export default {
name: 'cliaims',
data() {
return {
imageBase: '',
list: [
{
title: '基本资料',
content: [
{
name: '身份证照片',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传身份证人像面',
icon: 'claims_icon_1.png'
},
{
prop: 'reverse',
url: '',
label: '上传身份证国徽面',
icon: 'claims_icon_2.png'
}
]
},
{
name: '驾驶证',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传驾驶证',
icon: 'claims_icon_3.png'
}
]
},
{
name: '行驶证',
tip: '正本及副证年审合格页面出险时车辆在年审有效期内',
images: [
{
prop: 'positive',
url: '',
label: '上传行驶证',
icon: 'claims_icon_3.png'
}
]
},
{
name: '人车合照',
tip: '须清晰体现车牌、车辆全貌',
images: [
{
prop: 'positive',
url: '',
label: '上传人车合照',
icon: 'claims_icon_4.png'
}
]
},
{
name: '前挡车架号',
tip: '车架号清晰可见',
images: [
{
prop: 'positive',
url: '',
label: '上传前挡车架号',
icon: 'claims_icon_4.png'
}
]
}
],
spectical: true
},
{
title: '定损细节资料',
content: [
{
name: '商业险保单',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传商业险保单',
icon: 'claims_icon_4.png'
}
]
},
{
name: '购车发票(原件)',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传购车发票(原件)',
icon: 'claims_icon_4.png'
}
]
},
{
name: '全损协议(原件)',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传全损协议(原件)',
icon: 'claims_icon_4.png'
}
]
},
{
name: '车险赔付凭证',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传车险赔付凭证',
icon: 'claims_icon_4.png'
}
]
},
{
name: '购置税完税凭证',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传购置税完税凭证',
icon: 'claims_icon_4.png'
}
]
},
{
name: '登记费票据(原件)',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传登记费票据(原件)',
icon: 'claims_icon_4.png'
}
]
},
{
name: '加装设备凭证',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传加装设备凭证',
icon: 'claims_icon_4.png'
}
]
},
{
name: '火灾事故认定书',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传火灾事故认定书',
icon: 'claims_icon_4.png'
}
]
},
{
name: '车辆维修估损单',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传车辆维修估损单',
icon: 'claims_icon_4.png'
}
]
},
{
name: '仪表台公里数照片',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传仪表台公里数照片',
icon: 'claims_icon_4.png'
}
]
},
{
name: '车辆受损轮胎方位的整车45度角照片',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传45度角照片',
icon: 'claims_icon_4.png'
}
]
},
{
name: '受损轮胎品牌及驾驶证副页照片',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传品牌及驾驶证副页照片',
icon: 'claims_icon_4.png'
}
]
},
{
name: '受损轮胎规格',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传受损轮胎规格',
icon: 'claims_icon_4.png'
},
{
prop: 'positive',
url: '',
label: '上传临牌反面照片',
icon: 'claims_icon_4.png'
}
]
},
{
name: '受损轮胎花纹',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传受损轮胎花纹',
icon: 'claims_icon_4.png'
},
{
prop: 'positive',
url: '',
label: '上传临牌照片',
icon: 'claims_icon_4.png'
}
]
},
{
name: '轮胎受损部位特写照',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传轮胎受损部位特写照',
icon: 'claims_icon_4.png'
},
{
prop: 'positive',
url: '',
label: '上传临牌照片',
icon: 'claims_icon_4.png'
}
]
},
{
name: '受损轮胎DOT号',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传轮胎受损轮胎DOT号',
icon: 'claims_icon_4.png'
},
{
prop: 'positive',
url: '',
label: '上传批次号',
icon: 'claims_icon_4.png'
}
]
},
{
name: '维修估损单/接车单',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传维修估损单',
icon: 'claims_icon_4.png'
},
{
prop: 'positive',
url: '',
label: '上传接车单',
icon: 'claims_icon_4.png'
}
]
},
{
name: '损坏部位特写照片',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传损坏部位特写照片',
icon: 'claims_icon_4.png'
}
]
},
{
name: '修复后照片',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传修复后照片',
icon: 'claims_icon_4.png'
}
]
},
{
name: '定损单',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传定损单',
icon: 'claims_icon_4.png'
}
]
},
{
name: '钥匙',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '丢失情况说明',
icon: 'claims_icon_4.png'
},
{
prop: 'positive',
url: '',
label: '丢失钥匙的解绑',
icon: 'claims_icon_4.png'
},
{
prop: 'positive',
url: '',
label: '注销凭证',
icon: 'claims_icon_4.png'
},
{
prop: 'positive',
url: '',
label: '更换前后钥匙已匹配数量截图',
icon: 'claims_icon_4.png'
},
{
prop: 'positive',
url: '',
label: '系统钥匙匹配截图',
icon: 'claims_icon_4.png'
},
{
prop: 'positive',
url: '',
label: '系统EPC价格截图',
icon: 'claims_icon_4.png'
},
{
prop: 'positive',
url: '',
label: '新钥匙实物照',
icon: 'claims_icon_4.png'
},
{
prop: 'positive',
url: '',
label: '维修估损单',
icon: 'claims_icon_4.png'
},
{
prop: 'positive',
url: '',
label: '接车单',
icon: 'claims_icon_4.png'
},
]
},
{
name: '车牌',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '丢失情况说明',
icon: 'claims_icon_4.png'
},
{
prop: 'positive',
url: '',
label: '车管所收费凭证',
icon: 'claims_icon_4.png'
},
]
},
{
name: '车辆施工过程照片(拆装、磨底)',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '车辆施工过程照片',
icon: 'claims_icon_4.png'
}
]
},
{
name: '代步车协议',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '代步车协议',
icon: 'claims_icon_4.png'
}
]
},
],
spectical: true
},
{
title: '现场照片',
content: [
{
name: '车头外观45度照片',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传车头外观45度照片',
icon: 'claims_icon_4.png'
}
]
},
{
name: '事故现场照片',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传事故现场照片',
icon: 'claims_icon_4.png'
}
]
},
{
name: '损失部位照片',
tip: '',
images: [
{
prop: 'positive',
url: '',
label: '上传损失部位照片',
icon: 'claims_icon_4.png'
}
]
}
],
spectical: true
},
{
title: '其他资料',
content: [],
spectical: false
}
],
currentIndex: 1,
list: [],
// list: [
// {
// title: '基本资料',
// content: [
// {
// name: '身份证照片',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传身份证人像面',
// icon: 'claims_icon_1.png'
// },
// {
// prop: 'reverse',
// url: '',
// label: '上传身份证国徽面',
// icon: 'claims_icon_2.png'
// }
// ]
// },
// {
// name: '驾驶证',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传驾驶证',
// icon: 'claims_icon_3.png'
// }
// ]
// },
// {
// name: '行驶证',
// tip: '正本及副证年审合格页面出险时车辆在年审有效期内',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传行驶证',
// icon: 'claims_icon_3.png'
// }
// ]
// },
// {
// name: '人车合照',
// tip: '须清晰体现车牌、车辆全貌',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传人车合照',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '前挡车架号',
// tip: '车架号清晰可见',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传前挡车架号',
// icon: 'claims_icon_4.png'
// }
// ]
// }
// ],
// spectical: true
// },
// {
// title: '定损细节资料',
// content: [
// {
// name: '商业险保单',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传商业险保单',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '购车发票(原件)',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传购车发票(原件)',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '全损协议(原件)',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传全损协议(原件)',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '车险赔付凭证',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传车险赔付凭证',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '购置税完税凭证',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传购置税完税凭证',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '登记费票据(原件)',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传登记费票据(原件)',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '加装设备凭证',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传加装设备凭证',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '火灾事故认定书',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传火灾事故认定书',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '车辆维修估损单',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传车辆维修估损单',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '仪表台公里数照片',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传仪表台公里数照片',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '车辆受损轮胎方位的整车45度角照片',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传45度角照片',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '受损轮胎品牌及驾驶证副页照片',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传品牌及驾驶证副页照片',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '受损轮胎规格',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传受损轮胎规格',
// icon: 'claims_icon_4.png'
// },
// {
// prop: 'positive',
// url: '',
// label: '上传临牌反面照片',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '受损轮胎花纹',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传受损轮胎花纹',
// icon: 'claims_icon_4.png'
// },
// {
// prop: 'positive',
// url: '',
// label: '上传临牌照片',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '轮胎受损部位特写照',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传轮胎受损部位特写照',
// icon: 'claims_icon_4.png'
// },
// {
// prop: 'positive',
// url: '',
// label: '上传临牌照片',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '受损轮胎DOT号',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传轮胎受损轮胎DOT号',
// icon: 'claims_icon_4.png'
// },
// {
// prop: 'positive',
// url: '',
// label: '上传批次号',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '维修估损单/接车单',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传维修估损单',
// icon: 'claims_icon_4.png'
// },
// {
// prop: 'positive',
// url: '',
// label: '上传接车单',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '损坏部位特写照片',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传损坏部位特写照片',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '修复后照片',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传修复后照片',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '定损单',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传定损单',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '钥匙',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '丢失情况说明',
// icon: 'claims_icon_4.png'
// },
// {
// prop: 'positive',
// url: '',
// label: '丢失钥匙的解绑',
// icon: 'claims_icon_4.png'
// },
// {
// prop: 'positive',
// url: '',
// label: '注销凭证',
// icon: 'claims_icon_4.png'
// },
// {
// prop: 'positive',
// url: '',
// label: '更换前后钥匙已匹配数量截图',
// icon: 'claims_icon_4.png'
// },
// {
// prop: 'positive',
// url: '',
// label: '系统钥匙匹配截图',
// icon: 'claims_icon_4.png'
// },
// {
// prop: 'positive',
// url: '',
// label: '系统EPC价格截图',
// icon: 'claims_icon_4.png'
// },
// {
// prop: 'positive',
// url: '',
// label: '新钥匙实物照',
// icon: 'claims_icon_4.png'
// },
// {
// prop: 'positive',
// url: '',
// label: '维修估损单',
// icon: 'claims_icon_4.png'
// },
// {
// prop: 'positive',
// url: '',
// label: '接车单',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '车牌',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '丢失情况说明',
// icon: 'claims_icon_4.png'
// },
// {
// prop: 'positive',
// url: '',
// label: '车管所收费凭证',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '车辆施工过程照片(拆装、磨底)',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '车辆施工过程照片',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '代步车协议',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '代步车协议',
// icon: 'claims_icon_4.png'
// }
// ]
// }
// ],
// spectical: true
// },
// {
// title: '现场照片',
// content: [
// {
// name: '车头外观45度照片',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传车头外观45度照片',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '事故现场照片',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传事故现场照片',
// icon: 'claims_icon_4.png'
// }
// ]
// },
// {
// name: '损失部位照片',
// tip: '',
// images: [
// {
// prop: 'positive',
// url: '',
// label: '上传损失部位照片',
// icon: 'claims_icon_4.png'
// }
// ]
// }
// ],
// spectical: true
// },
// {
// title: '其他资料',
// content: [],
// spectical: false
// }
// ],
currentIndex: 0,
size: '102px'
}
},
......@@ -560,8 +575,108 @@ export default {
created() {
this.imageBase = window.$imageBase
this.computedWidth()
this.getList()
},
methods: {
// 获取附件列表
getList() {
let para = {
contractNo: '496557746246918144',
writeOffCode:'12274722'
}
this.showLoading()
upload.claimsClassifyApi(para).then(res => {
this.hideLoading()
let result = res.data || []
let tempArr = []
result.forEach(el => {
let obj = {
title: el.firstClassifyName,
spectical: true,
content: this.handleData(el.secondClassifyList)
}
if (el.firstClassifyName.indexOf('其他资料') != -1) {
obj.spectical = false
obj.content = []
obj.secondClassifyList = el.secondClassifyList
}
tempArr.push(obj)
})
this.list = tempArr
})
},
// 根据二级资料数据重构数据
handleData(arr = []) {
let idCardList = []
let idCardObj = {}
let result = []
arr.forEach((el, index) => {
if (el.secondClassifyName.indexOf('身份证人像面') != -1) {
idCardList.push({
url: '',
label: '上传' + el.secondClassifyName,
icon: 'claims_icon_1.png',
...el
})
} else if (el.secondClassifyName.indexOf('身份证国徽面') != -1) {
idCardList.push({
url: '',
label: '上传' + el.secondClassifyName,
icon: 'claims_icon_2.png',
...el
})
} else {
let setting = this.matchDataByName(el.secondClassifyName)
let temp = {
name: el.secondClassifyName,
tip: setting.tip,
images: [
{
url: '',
label: '上传' + el.secondClassifyName,
icon: setting.icon,
...el
}
]
}
result.push(temp)
}
})
if (idCardList.length) {
idCardObj = {
name: '身份证照片',
tip: '',
images: idCardList
}
result.unshift(idCardObj)
}
return result
},
// 根据名称匹配数据---tip和icon
// index 为图片icon的命名索引
// 1.为身份证正面 2.为身份证反面 3.为驾驶证 4.默认
matchDataByName(name) {
let index = 4
let tip = ''
if (name == '驾驶证') {
index = 3
} else if (name == '行驶证') {
index = 3
tip = '正本及副证年审合格页面出险时车辆在年审有效期内'
} else if (name == '人车合照') {
tip = '须清晰体现车牌、车辆全貌'
} else if (name == '前挡车架号') {
tip = '车架号清晰可见'
}
let obj = {
icon: `claims_icon_${index}.png`,
tip
}
return obj
},
computedWidth() {
const screen = window.screen.width
const imageW = (screen - 16 * 4) / 3
......@@ -570,10 +685,19 @@ export default {
openLine(item, index) {
this.currentIndex = index
},
toClickUpoload(current) {
console.log(current)
toClickUpoload(current, fatherIndex, childIndex) {
this.currentElement = current
this.fatherIndex = fatherIndex
this.childIndex = childIndex
},
toDelete(current, fatherIndex, childIndex) {
this.list[this.currentIndex].content[fatherIndex].images[childIndex].url = ''
},
deleteImg(index) {
this.list[this.currentIndex].content.splice(index, 1)
},
beforeRead(e) {},
beforeDelete() {},
checkRead(file) {
if (file.size > 1024) {
this.showLoading()
......@@ -581,15 +705,94 @@ export default {
}
return true
},
// 其他
otherAfterRread(file) {
this.hideLoading()
this.uploadImage(file, true)
},
// 非其他
afterRread(file, e) {
console.log(file)
this.hideLoading()
this.uploadImage(file)
},
uploadImage(file, isOther) {
const imgFile = file.content
let fileName = file.file.name
let index = fileName.lastIndexOf('.')
fileName = fileName.substring(index + 1, fileName.length)
const base64 = fileName + '@' + imgFile.split(',')[1]
let para = {
file: base64,
fileType: 'image'
}
this.showLoading()
upload.uploadImageApi(para).then(res => {
this.hideLoading()
if (res.code == 0) {
if (!isOther) {
this.list[this.currentIndex].content[this.fatherIndex].images[this.childIndex].url = res.data
this.list[this.currentIndex].content[this.fatherIndex].images[this.childIndex].fileType = fileName
} else {
this.list[this.currentIndex].content.push({ url: res.data, fileType: fileName })
}
} else {
this.showToast(res.message)
}
})
},
sumbitSave() {
let files = []
let filters = []
this.list.forEach(item => {
if (!item.spectical) {
let temp = item.secondClassifyList[0]
if (item.content.length) {
item.content.forEach(ele => {
let obj = {
...temp,
...ele
}
filters.push(obj)
})
}
// this.uploadImage(file)
//其他类型
} else {
//非其他类型
item.content.forEach(el => {
el.images.forEach(ele => {
if (ele.url) {
filters.push(ele)
}
})
})
}
})
let para = this.handlerListIndex(filters)
para.writeOffCode = '80154055'
this.showLoading()
upload.claimsClassifyuploadApi(para).then(res=>{
this.hideLoading()
this.showToast('提交成功')
})
},
beforeDelete(file, e) {
// this.currentDelImg = file.url
// this.deleteFile()
/**处理list[index]数据 */
handlerListIndex(arr) {
let obj = {}
arr.forEach((el, index) => {
let fileUrl = `fileList[${index}].fileUrl`
let fileType = `fileList[${index}].fileType`
let classifyId = `fileList[${index}].classifyId`
let fileCode = `fileList[${index}].fileCode`
let temp = {
[fileUrl]: el.url,
[fileType]: el.fileType,
[classifyId]: el.id,
[fileCode]: el.attachmentCode
}
Object.assign(obj, temp)
})
return obj
}
}
}
......@@ -668,6 +871,7 @@ export default {
border-radius: 4px;
margin-right: 16px;
margin-bottom: 16px;
position: relative;
}
.mar0 {
margin-right: 0;
......@@ -698,7 +902,17 @@ export default {
top: 0;
bottom: 0;
opacity: 0;
z-index: 1;
z-index: 10;
}
.delete_icon {
position: absolute;
right: 0;
top: 0;
z-index: 20;
> img {
width: 17px;
height: 16px;
}
}
.flex_scb {
display: flex;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!