uploadMaterial.vue
4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<template>
<div>
<el-tabs class="tabs" v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="item in tabs" :key="item.name" :label="item.label" :name="item.name">
<span slot="label" :class="[{noPassTab:noPass(item.name,'tab')}]"><span v-if="item.isRequire==1" class="required">*</span>{{item.label}}</span>
<div v-if="curCode && activeName=='detail'" class="second-tabs">
<template v-for="ele in detailImgList">
<span :class="[{ active: curCode == ele.serviceItemCode },{'noPass':noPass(ele)}]" :key="ele.serviceItemCode" v-if="ele.checked" @click="changeSecondTab(ele)">{{ ele.serviceItemName }}</span>
</template>
</div>
<span v-if="isWriteOff && curCode =='SC0002' && activeName=='detail'">无附件资料待上传</span>
<img-list :isWriteOff="isWriteOff" :isCustomerCommit="isCustomerCommit" :curLossType="curLossType" :disabled="disabled" :id="id" :curRouteInfo="curRouteInfo" :curKey="activeName" :curCode="curCode" :list="attachmentList"></img-list>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script type="text/ecmascript-6">
import cameraUrl from '@/assets/camera.png'
import write_off from '@/assets/logo.png'
import url from '../../image/code.png'
import imgList from './imgList'
// import Card from './card.vue'
export default {
name: 'uploadMaterial',
props:{
tabs:{
type: Array
},
detailImgList:{
type: Array
},
id: {
type: Number
},
attachmentList:{
type: Array
},
curCodefromParent:{
type: String,
default: ''
},
curRouteInfo: Object,
disabled:{
type: Boolean,
default: false
},
curLossType:{
type: Array,
default:function(){
return []
}
},
isCustomerCommit:{
type: Boolean,
default: false
},
isWriteOff:{
type: Boolean,
default: false
}
},
computed:{
noPass(){
return function(val, type){
const target = this.attachmentList.find(item =>{
if(type=='tab'){
return (val == item.key && item?.imgObj?.auditStatus===0)
}else{
return (item.serviceItemCode == val.serviceItemCode && item?.imgObj?.auditStatus===0 && val.checked)
}
})
return !!target
}
}
},
data() {
return {
url,
cameraUrl,
curCode: '',
write_off,
activeName: 'base'
}
},
components: {
imgList,
// Card
},
mounted() {
const target = this.detailImgList.find(item => item.checked)
this.curCode = target?.serviceItemCode || ''
},
methods: {
handleClick(){
this.$emit('handleClick',this.activeName)
},
setTab(val){
this.activeName = val
},
changeSecondTab(item){
if(item) this.curCode = item.serviceItemCode
},
setActiveTab(){
const target = this.detailImgList.find(item => item.checked)
this.curCode = target?.serviceItemCode || ''
}
}
}
</script>
<style lang="scss" scoped>
/deep/ .el-tabs {
.el-tabs__nav-wrap::after {
height: 1px;
background-color: #FFFFFF;
}
.el-tabs__item {
height: 45px;
font-size: 16px;
font-weight: 500;
}
}
.second-tabs {
height: 36px;
background: #f8f8f8;
border-radius: 4px;
display: flex;
position: relative;
align-items: center;
padding: 2px;
margin-bottom: 16px;
span {
height: 100%;
display: flex;
align-items: center;
padding: 0 16px;
font-size: 14px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #5850ff;
}
.active {
background-color: #fff;
}
}
.transport-pic {
font-size: 14px;
color: #00a479;
cursor: pointer;
}
.noPass,.noPassTab{
position: relative;
&::before{
content: '';
height: 6px;
width: 6px;
position: absolute;
right: 11px;
background-color: red;
border-radius: 50%;
top: 8px;
}
}
.noPassTab{
&::before{
right: -6px;
top: 0;
}
}
.required {
color: #f56c6c;
margin-right: 4px;
}
</style>