| <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> |