MrShi
2024-11-15 30cfb2b836a8a3d609518cc295753b58b17a9bc7
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
<template>
    <GlobalWindow
        :title="title"
        width="100%"
        :withFooter="false"
        :visible.sync="visible"
        :confirm-working="isWorking"
        @confirm="confirm"
    >
<!--        <el-form ref="form" :model="form" label-width="100px" inline>-->
<!--            <el-form-item label="企业名称" prop="name">-->
<!--                <el-input v-model="form.model.name" placeholder="请输入" @keypress.enter.native="getList"></el-input>-->
<!--            </el-form-item>-->
<!--            <el-form-item>-->
<!--                <div style="display: flex; align-items: center;">-->
<!--                    <el-button type="primary" @click="getList">搜索</el-button>-->
<!--                    <el-button @click="reset">重置</el-button>-->
<!--                </div>-->
<!--            </el-form-item>-->
<!--        </el-form>-->
        <el-table
            :data="tableData"
            border
            style="width: 100%">
            <el-table-column label="序号" width="80px" align="center" fixed>
                <template slot-scope="scope">
                    <span>{{scope.$index + 1}}</span>
                </template>
            </el-table-column>
            <el-table-column prop="statusInfo" align="center" fixed label="状态">
                <template slot-scope="{row}">
                    <span :class="'apply-status'+row.status">{{row.statusInfo}}</span>
                </template>
            </el-table-column>
            <el-table-column prop="solutionsName" align="center" fixed label="保险方案" min-width="150"></el-table-column>
            <el-table-column label="类型" fixed  align="center">
                <template slot-scope="{row}">
                    <span style="color: #00BA92" v-if="row.solutionType == 1">委托投保</span>
                    <span style="color: #F95601;"  v-else>直接投保</span>
                </template>
            </el-table-column>
            <el-table-column label="保单号" align="center" fixed>
                <template slot-scope="{row}">
                    <span>{{row.code ? row.code : '-'}}</span>
                </template>
            </el-table-column>
            <el-table-column prop="guaranteeNum"  align="center" label="当前在保人数" width="120">
                <template slot-scope="{row}">
                    <span>{{(row.guaranteeNum||0)}} 人</span>
                </template>
            </el-table-column>
            <el-table-column label="投保时长" align="center">
                <template slot-scope="{row}">
                    <span>{{(row.serviceDays - row.loseEfficacyDays) < 0 ? `-` : (row.serviceDays - row.loseEfficacyDays+'天')}}</span>
                </template>
            </el-table-column>
            <el-table-column prop="fee" label="批改费用合计"  align="center" width="120">
                <template slot-scope="{row}">
                    <span>{{row.changeMoney+' 元'}}</span>
                </template>
            </el-table-column>
            <el-table-column prop="fee" label="总费用"  align="center">
                <template slot-scope="{row}">
                    <span>{{row.fee!=null?row.fee+' 元': '-'}}</span>
                </template>
            </el-table-column>
            <el-table-column prop="createDate" label="提交日期"  align="center" min-width="150"></el-table-column>
            <el-table-column prop="startTime" label="投保生效日期"  align="center" min-width="150"></el-table-column>
            <el-table-column prop="endTime" label="投保失效日期"  align="center" min-width="150"></el-table-column>
            <el-table-column
                fixed="right"
                width="120"
                label="操作">
                <template slot-scope="{row}">
                    <el-button type="text" @click="$refs.factoryChange.open('更换派遣单位申请', { id: row.id })" v-if="isShow(row.status, row.endTime) && type === 2">{{ row.hasDispatchUnit === 1 ? '更换工种' : '更换派遣单位' }}</el-button>
                    <el-button type="text" @click="$refs.additionSubtractionApplication.open('加减保申请', { id: row.id })" v-else-if="isShow(row.status, row.endTime) && type === 1">加减保申请</el-button>
                </template>
            </el-table-column>
        </el-table>
        <div style="width: 100%; height: 15px;"></div>
        <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="form.page"
            :page-sizes="[10, 30, 50, 100]"
            :page-size="form.size"
            layout="total, sizes, prev, pager, next, jumper"
            :total="total">
        </el-pagination>
        <!--    加减保申请    -->
        <additionSubtractionApplication ref="additionSubtractionApplication" @success="selectItem" />
        <!--    更换派遣单位申请    -->
        <factoryChange ref="factoryChange" @success="selectItem" />
    </GlobalWindow>
</template>
 
<script>
  import BaseOpera from '@/components/base/BaseOpera'
  import GlobalWindow from '@/components/common/GlobalWindow'
  import additionSubtractionApplication from '@/components/enterprise/additionSubtractionApplication'
  import factoryChange from '@/components/enterprise/factoryChange'
  import { fetchList } from '@/api/business/insuranceApply'
  export default {
    name: 'selectPolicy',
    extends: BaseOpera,
    components: { GlobalWindow, additionSubtractionApplication, factoryChange },
    data () {
      return {
        model: {},
        tableData: [],
        type: null,
        form: {
          page: 1,
          capacity: 10,
          model: {
            companyId: '',
            status: '5,27',
            timeOut: 3
          }
        },
        total: 0
      }
    },
    methods: {
      // 判断是否显示加减保
      isShow(status, endTime) {
        const currentDate = new Date();
        const specifiedDate = new Date(endTime);
        return [5,27].includes(status) && (currentDate < specifiedDate);
      },
      selectItem() {
        this.$emit('success')
        this.visible = false
      },
      handleSizeChange(e) {
        this.form.capacity = e
        this.getList()
      },
      handleCurrentChange(e) {
        this.form.page = e
        this.getList()
      },
      open (title, id, type) {
        this.title = title
        this.type = type
        this.form.model.companyId = id
        this.form.name = ''
        this.visible = true
        this.form.page = 1
        this.form.capacity = 10
        this.getList()
      },
      reset() {
        this.form.page = 1
        this.form.capacity = 10
        this.form.model.name = ''
        this.getList()
      },
      getList() {
        fetchList(this.form)
          .then(res => {
            this.total = res.total
            this.tableData = res.records
          })
      }
    }
  }
</script>
 
<style lang="scss" scoped>
 
</style>