Commit 8d347143 by 杨北旺

添加服务类型区别/空状态

1 parent ed5bb009
...@@ -12,7 +12,17 @@ ...@@ -12,7 +12,17 @@
<!-- 内容区域 --> <!-- 内容区域 -->
<div v-if="currentIndex == index" class="main"> <div v-if="currentIndex == index" class="main">
<template v-if="item.spectical"> <template v-if="item.spectical">
<div v-if="item.title.indexOf('细节') != -1" class="tab_wrapper">
<template v-for="(serName, serIndex) in item.services">
<div @click.stop="toChangeServices(serIndex)" class="tabItem" :class="[{ tabItem_active: currentServices == serIndex }]" :key="serName">
<span>{{ serName }}</span>
<div v-if="currentServices == serIndex" class="line"></div>
</div>
</template>
</div>
<template v-if="item.title.indexOf('细节') != -1">
<div v-for="(el, inx) in item.content" :key="inx" class="widget"> <div v-for="(el, inx) in item.content" :key="inx" class="widget">
<template v-if="el.serviceItemName == item.services[currentServices]">
<div class="label flex_ss"> <div class="label flex_ss">
<div class="til">{{ el.name }}</div> <div class="til">{{ el.name }}</div>
<div v-if="el.tip" class="tip">{{ el.tip }}</div> <div v-if="el.tip" class="tip">{{ el.tip }}</div>
...@@ -27,16 +37,59 @@ ...@@ -27,16 +37,59 @@
<img style="width: 100%; height: 100%" :src="ele.url" /> <img style="width: 100%; height: 100%" :src="ele.url" />
</template> </template>
<div class="opa_upload" @click="toClickUpoload(ele, inx, idx)"> <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> <van-uploader
style="width: 100%; height: 100%"
class="uploadWidget"
max-count="1"
:before-delete="beforeDelete"
v-on:click-upload="beforeRead"
:before-read="checkRead"
:after-read="afterRread"
></van-uploader>
</div> </div>
<div v-if="ele.url" class="delete_icon" @click.stop="toDelete(ele, inx, idx)"> <div v-if="ele.url" class="delete_icon" @click.stop="toDelete(ele, inx, idx)">
<img src="../../../assets/images/claims_delete.png" /> <img src="../../../assets/images/claims_delete.png" />
</div> </div>
</div> </div>
</div> </div>
</template>
</div> </div>
</template> </template>
<template v-else> <template v-else>
<div v-for="(el, inx) in item.content" :key="inx" class="widget">
<div class="label flex_ss">
<div class="til">{{ el.name }}</div>
<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">
<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
style="width: 100%; height: 100%"
class="uploadWidget"
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>
<template v-else>
<div class="widget flex_ss flex_wrap"> <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 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" /> <img style="width: 100%; height: 100%" :src="img.url" />
...@@ -48,7 +101,15 @@ ...@@ -48,7 +101,15 @@
<van-icon name="plus" size="20px" color="#999999" /> <van-icon name="plus" size="20px" color="#999999" />
<span class="text">上传照片</span> <span class="text">上传照片</span>
<div class="opa_upload"> <div class="opa_upload">
<van-uploader max-count="9" :before-delete="beforeDelete" v-on:click-upload="beforeRead" :before-read="checkRead" :after-read="otherAfterRread"></van-uploader> <van-uploader
style="width: 100%; height: 100%"
class="otherUpload"
max-count="9"
:before-delete="beforeDelete"
v-on:click-upload="beforeRead"
:before-read="checkRead"
:after-read="otherAfterRread"
></van-uploader>
</div> </div>
</div> </div>
</div> </div>
...@@ -57,6 +118,7 @@ ...@@ -57,6 +118,7 @@
</div> </div>
</template> </template>
</div> </div>
<van-empty image="error" v-if="!list.length" :description="errMsg" />
<div v-if="list.length" @click="sumbitSave" class="sumbit_btn flex_ccc">传送图片</div> <div v-if="list.length" @click="sumbitSave" class="sumbit_btn flex_ccc">传送图片</div>
</div> </div>
</template> </template>
...@@ -68,8 +130,10 @@ export default { ...@@ -68,8 +130,10 @@ export default {
return { return {
imageBase: '', imageBase: '',
list: [], list: [],
currentIndex: 0, currentIndex: 1,
size: '102px' size: '102px',
currentServices: 0,
errMsg: ''
} }
}, },
props: {}, props: {},
...@@ -79,16 +143,29 @@ export default { ...@@ -79,16 +143,29 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
toChangeServices(index) {
this.currentServices = index
},
// 获取附件列表 // 获取附件列表
getList() { getList() {
const {contractNo,writeOffCode,damage} = window.vm.$route.query const { contractNo, writeOffCode, damage, sessionId } = window.vm.$route.query
let para = { let para = {
contractNo, contractNo,
writeOffCode, writeOffCode,
type:damage type: damage
}
if (!sessionId) {
this.errMsg = '链接缺少sessionId'
return
}
if (!contractNo) {
this.errMsg = '链接缺少合同号'
return
}
if (!writeOffCode) {
this.errMsg = '链接缺少核销码'
return
} }
if(!contractNo)return
if(!writeOffCode)return
this.showLoading() this.showLoading()
this.writeOffCode = writeOffCode this.writeOffCode = writeOffCode
upload.claimsClassifyApi(para).then(res => { upload.claimsClassifyApi(para).then(res => {
...@@ -96,16 +173,24 @@ export default { ...@@ -96,16 +173,24 @@ export default {
let result = res.data || [] let result = res.data || []
let tempArr = [] let tempArr = []
result.forEach(el => { result.forEach(el => {
let services = []
let obj = { let obj = {
title: el.firstClassifyName, title: el.firstClassifyName,
spectical: true, spectical: true,
content: this.handleData(el.secondClassifyList) content: this.handleData(el.secondClassifyList),
services: []
} }
if (el.firstClassifyName.indexOf('其他资料') != -1) { if (el.firstClassifyName.indexOf('其他资料') != -1) {
obj.spectical = false obj.spectical = false
obj.content = [] obj.content = []
obj.secondClassifyList = el.secondClassifyList obj.secondClassifyList = el.secondClassifyList
} }
if (el.firstClassifyName.indexOf('细节') != -1) {
el.secondClassifyList.forEach(ser => {
services.push(ser.serviceItemName)
})
}
obj.services = [...new Set(services)]
tempArr.push(obj) tempArr.push(obj)
}) })
this.list = tempArr this.list = tempArr
...@@ -137,6 +222,7 @@ export default { ...@@ -137,6 +222,7 @@ export default {
let temp = { let temp = {
name: el.secondClassifyName, name: el.secondClassifyName,
tip: setting.tip, tip: setting.tip,
serviceItemName: el.serviceItemName,
images: [ images: [
{ {
url: '', url: '',
...@@ -277,7 +363,7 @@ export default { ...@@ -277,7 +363,7 @@ export default {
let para = this.handlerListIndex(filters) let para = this.handlerListIndex(filters)
para.writeOffCode = this.writeOffCode para.writeOffCode = this.writeOffCode
this.showLoading() this.showLoading()
upload.claimsClassifyuploadApi(para).then(res=>{ upload.claimsClassifyuploadApi(para).then(res => {
this.hideLoading() this.hideLoading()
this.showToast('提交成功') this.showToast('提交成功')
}) })
...@@ -318,6 +404,38 @@ export default { ...@@ -318,6 +404,38 @@ export default {
.main { .main {
padding: 16px; padding: 16px;
background: #f8f8f8; background: #f8f8f8;
.tab_wrapper {
width: 100%;
height: 36px;
overflow: hidden;
white-space: nowrap;
overflow-x: auto;
margin-bottom: 16px;
.tabItem {
display: inline-block;
height: 36px;
line-height: 36px;
text-align: center;
margin-right: 30px;
font-size: 14px;
font-weight: 400;
color: #666666;
position: relative;
}
.tabItem_active {
color: #00a77b;
font-weight: 500;
}
.line {
position: absolute;
left: 0;
right: 0;
bottom: 4px;
height: 2px;
background: #00a77b;
border-radius: 4px;
}
}
.widget { .widget {
margin-bottom: 16px; margin-bottom: 16px;
.label { .label {
...@@ -410,6 +528,18 @@ export default { ...@@ -410,6 +528,18 @@ export default {
opacity: 0; opacity: 0;
z-index: 10; z-index: 10;
} }
.uploadWidget {
/deep/ .van-uploader__upload {
width: 166.5px !important;
height: 104px !important;
}
}
.otherUpload {
/deep/ .van-uploader__upload {
width: 104pxpx !important;
height: 104px !important;
}
}
.delete_icon { .delete_icon {
position: absolute; position: absolute;
right: 0; right: 0;
......
<template> <template>
<div class="contaienr"> <div class="contaienr">
<cliaims v-if="type == 'claims'"></cliaims> <cliaims v-if="type == 'claims'"></cliaims>
<!-- <div class="upload_box_wrapper"> <van-empty image="error" v-if="showError" description="链接缺少type参数" />
<div class="title flex_scb">
<span class="require">*</span>
<span>基础资料</span>
</div>
<div class="main_pannel" @click="toClickUpoload()">
<van-uploader
:before-delete="beforeDelete"
v-on:click-upload="beforeRead"
:before-read="checkRead"
:after-read="afterRread"
:preview-size="size"
max-count="4"
>
<div class="box_wrap flex_ccc" :style="{ width: size, height: size }">
<van-icon name="add-o" size="20px" color="#999999" />
<p>添加</p>
</div>
</van-uploader>
</div>
</div> -->
</div> </div>
</template> </template>
<script> <script>
...@@ -37,7 +17,8 @@ export default { ...@@ -37,7 +17,8 @@ export default {
uploadList: [], uploadList: [],
fileURL: {}, fileURL: {},
loadingFinish: false, loadingFinish: false,
type: '' type: '',
showError:false
} }
}, },
created() { created() {
...@@ -48,6 +29,7 @@ export default { ...@@ -48,6 +29,7 @@ export default {
getQuery() { getQuery() {
const { type } = window.vm.$route.query const { type } = window.vm.$route.query
this.type = type this.type = type
this.showError = type?false:true
}, },
// 获取当前点击的位置 // 获取当前点击的位置
toClickUpoload() {}, toClickUpoload() {},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!