jiangping
2024-06-20 09da100729793848bc01b51f7b05ca3f1e7ec64f
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
<template>
    <GlobalWindow
        :title="title"
        width="100%"
        :visible.sync="visible"
        :confirm-working="isWorking"
        @confirm="confirm"
    >
        <div class="box">
          <div class="top">
            {{title}}
          </div>
          <div class="box_table">
            <div class="box_table_head">
              <div class="box_table_head_item">投保人</div>
              <div class="box_table_head_item">保险方案</div>
              <div class="box_table_head_item">保险生效起期</div>
              <div class="box_table_head_item">保险生效止期</div>
              <div class="box_table_head_item">保单号</div>
              <div class="box_table_head_item">换厂</div>
              <div class="box_table_head_item">批单生效期</div>
            </div>
            <div class="box_table_content "  >
              <div class="box_table_content_item box_table_content_header">{{ model.shopName }}</div>
              <div class="box_table_content_item box_table_content_header">{{ model.solutionsName }}</div>
              <div class="box_table_content_item box_table_content_header">{{ model.startTime }}</div>
              <div class="box_table_content_item box_table_content_header">{{ model.endTime }}</div>
              <div class="box_table_content_item box_table_content_header">{{ model.applyCode }}</div>
              <div class="box_table_content_item box_table_content_header">{{ model.changeNum}}</div>
              <div class="box_table_content_item box_table_content_header">{{ model.applyStartTime}}</div>
            </div>
          </div>
          <div class="box_table">
            <div class="box_table_head box_table_content">
              <div class="box_table_head_item" style=" flex: 1;border-bottom: 0px">被保险人</div>
              <div class="box_table_content_item box_table_content_header" style=" flex: 6;">
                <p v-for="(item, index) in companyList" :key="index" >
                  {{index>0?',':''}} {{ item[1]}}
                </p>
               </div>
              </div>
          </div>
            <div class="box_table" v-if="addList && addList.length>0">
                <div class="box_table_head">
                    <div class="box_table_head_item">序号</div>
                    <div class="box_table_head_item">员工姓名</div>
                  <div class="box_table_head_item">性别</div>
                  <div class="box_table_head_item">身份证号</div>
                  <div class="box_table_head_item">被保险人</div>
                    <div class="box_table_head_item">原派遣单位</div>
                    <div class="box_table_head_item">原所属工种</div>
                    <div class="box_table_head_item">更换后派遣单位</div>
                    <div class="box_table_head_item">更换后所属工种</div>
                </div>
                <div class="box_table_content" v-for="(item, index) in addList" :key="index">
                  <div class="box_table_content_item">{{(index + 1)}}</div>
                  <div class="box_table_content_item" >{{ item.memberName }}</div>
                  <div class="box_table_content_item">{{  item.sex==0?"男":(item.sex===1?"女":"" )}}</div>
                  <div class="box_table_content_item">{{ item.memberIdcardNo }}</div>
                  <div class="box_table_content_item">{{ item.companyName }}</div>
                  <div class="box_table_content_item">{{ item.oldDuName }}</div>
                  <div class="box_table_content_item">{{item.oldWorkTypeName}}</div>
                  <div class="box_table_content_item">{{ item.duName }}</div>
                  <div class="box_table_content_item">{{item.workTypeName}}</div>
                </div>
            </div>
          <div class="box_table" v-if="type==1" style="border-top: 0px solid #b4bbc5;" >
            <div class="box_table_head">
              <div class="box_table_head_item5">备注</div>
              <div class="box_table_head_item5">
                <input v-model="form.checkInfo" style="width: 100%;height: 45px;border: 0px;outline: none;" placeholder="请输入" v-trim/>
              </div>
            </div>
          </div>
        </div>
        <template v-if="type==1" v-slot:footer>
            <el-button type="primary"  :loading="isWorking.export" @click="check(0)">提交通过</el-button>
<!--            <el-button type="danger"  :loading="isWorking.export" @click="check(1)">审核不通过</el-button>-->
            <el-button @click="visible=false">取消</el-button>
        </template>
        <template v-else-if="type==2" v-slot:footer>
            <el-button @click="visible=false">返回</el-button>
        </template>
        <template v-else v-slot:footer>
            <el-button type="primary"  :loading="isWorking.export" @click="exportDetail">导出详单</el-button>
            <el-button @click="visible=false">取消</el-button>
        </template>
    </GlobalWindow>
</template>
 
<script>
    import BaseOpera from '@/components/base/BaseOpera'
    import GlobalWindow from '@/components/common/GlobalWindow'
    import {getChangeDetailList} from "@/api/business/insuranceApply";
    import {check } from "@/api/business/applyChange";
    import {exportDetailExcel} from "@/api/business/unionChange";
    export default {
        name: 'ApplyChangeDetails',
        extends: BaseOpera,
        components: { GlobalWindow },
        data () {
            return {
                model:{},
                apply:{},
              type:0,
              delList:[],
              addList:[],
              companyList:new Map(),
                // 表单数据
                form: {
                    id: null,
                    dealBackApply:0,
                    checkInfo: ''
                },
                // 验证规则
                rules: {
                },
                reverse: false,
                tableData: []
            }
        },
        created () {
            this.config({
                api: '/business/insuranceApply',
                'field.id': 'id'
            })
        },
        methods: {
            open(title,target,target2){
              this.title=title
              this.visible=true
              this.model = target
              this.form.id=target.id
              this.type=target2
              this.getDetailListDo()
            },
           check (type) {
            this.form.dealBackApply = type
            this.$dialog.messageConfirm('确认进行该操作吗?')
                .then(() => {
                  this.isWorking = true
                  check(this.form)
                      .then(response => {
                        this.visible = false
                        this.$emit('success')
                      }).catch(err => {
                    this.$tip.apiFailed(err)
                  })
                })
                .catch(() => {
                })
          },
           getDetailListDo() {
             this.delList=[]
             this.addList=[]
             getChangeDetailList({unionChangeId: this.model.id})
                 .then(res => {
                   var index =0
                   res.forEach(item1 => {
                     this.companyList.set(item1.companyId, item1.companyName)
                     if (item1.type == 1) {
                       this.delList.push(item1);
                     } else {
                       this.addList.push(item1);
                     }
                   })
 
                 }).catch(err => {})
           },
          exportDetail(){
            this.$dialog.exportConfirm('确认导出详单吗?')
                .then(() => {
                  this.isWorking = true
                  exportDetailExcel({ id: this.model.id })
                      .then(response => {
                        this.download(response)
                      })
                      .catch(e => {
                        console.log(e)
                        this.$message.error('数据下载失败!')
                      })
                      .finally(() => {
                        this.isWorking = false
                      })
                })
                .catch(() => {
                })
          },
            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);
            },
            handleCurrentChange(val) {
                console.log(`当前页: ${val}`);
            },
            handleClick(tab, event) {
                console.log(tab, event);
            },
            onSubmit() {
 
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .box {
        width: 100%;
       .top{
           width: 100%;
           align-items: center;
           flex-wrap: wrap;
           border-top: 1px solid #b4bbc5;
           border-left: 1px solid #b4bbc5;
            font-size: 14px;
            font-weight: bold;
            text-align: center;
          padding: 15px;
           box-sizing: border-box;
         }
        .box_header {
            width: 100%;
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            border-top: 1px solid #b4bbc5;
            border-left: 1px solid #b4bbc5;
            box-sizing: border-box;
            .box_header_item {
                width: 50%;
                height: 50px;
                display: flex;
                align-items: center;
                border-right: 1px solid #b4bbc5;
                border-bottom: 1px solid #b4bbc5;
                box-sizing: border-box;
 
                .box_header_item_label {
                    flex: 1;
                    height: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    font-size: 14px;
                    color: black;
                    background: #f2f2f2;
                    border-right: 1px solid #b4bbc5;
                    box-sizing: border-box;
                }
                .box_header_item_val {
                    flex: 1;
                    height: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    font-size: 14px;
                    color: black;
                }
            }
        }
        .box_table {
            width: 100%;
            border-top: 1px solid #b4bbc5;
            border-left: 1px solid #b4bbc5;
            box-sizing: border-box;
            .box_table_head {
                width: 100%;
                display: flex;
                align-items: center;
                .box_table_head_item1 {
                    flex: 1;
                    height: 50px;
                    background: #f2f2f2;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    font-size: 14px;
                    color: black;
                    border-right: 1px solid #b4bbc5;
                    border-bottom: 1px solid #b4bbc5;
                    box-sizing: border-box;
                    }
                .box_table_head_item {
                    flex: 1;
                    height: 50px;
                    background: #f2f2f2;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    font-size: 14px;
                    color: black;
                    border-right: 1px solid #b4bbc5;
                    border-bottom: 1px solid #b4bbc5;
                    box-sizing: border-box;
                  &:nth-child(3) {
                  }
                  &:nth-child(9) {
                  }
                }
              .box_table_head_item5 {
                flex: 1;
                height: 50px;
                background: #f2f2f2;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 14px;
                color: black;
                border-right: 1px solid #b4bbc5;
                border-bottom: 1px solid #b4bbc5;
                box-sizing: border-box;
                &:nth-child(2) {
                }
              }
              .box_form_item {
                flex: 1;
                height: 50px;
                background: #ffffff;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 14px;
                color: black;
                border-right: 1px solid #b4bbc5;
                border-bottom: 1px solid #b4bbc5;
                box-sizing: border-box;
                &:nth-child(1) {
                }
              }
            }
            .box_table_content {
                width: 100%;
                display: flex;
                align-items: center;
                .box_table_content_header{
                  border-bottom: 0px solid #b4bbc5 !important;
                }
              .box_table_content_item {
                //white-space: nowrap;
                overflow: hidden;
                //text-overflow: ellipsis;
                flex: 1;
                height: 50px;
                padding: 10px;
                    background: #ffffff;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    font-size: 14px;
                    color: black;
                    border-right: 1px solid #b4bbc5;
                    border-bottom: 1px solid #b4bbc5;
                    box-sizing: border-box;
                &:nth-child(3) {
                }
                &:nth-child(9) {
                }
                span{
                  width: 100%;
                  white-space: nowrap;
                  word-wrap: break-word;
                  text-overflow: ellipsis;
                  overflow: hidden;
                }
                }
            }
        }
    }
</style>