|  |  |  | 
|---|
|  |  |  | <GlobalWindow | 
|---|
|  |  |  | :title="title" | 
|---|
|  |  |  | width="100%" | 
|---|
|  |  |  | text="加减保申请" | 
|---|
|  |  |  | text="提交" | 
|---|
|  |  |  | :visible.sync="visible" | 
|---|
|  |  |  | :confirm-working="isWorking" | 
|---|
|  |  |  | @confirm="confirm" | 
|---|
|  |  |  | 
|---|
|  |  |  | <el-form-item label=" " prop="unionApplyId" > | 
|---|
|  |  |  | <div style=" display: flex; flex-direction: column;"> | 
|---|
|  |  |  | <el-button type="primary" size="small" @click="selectBaoxiandan"> 选择保险单</el-button> | 
|---|
|  |  |  | <span style="color: #F95601; font-size: 14px;">(1. 请选择保险单后进行操作)</span> | 
|---|
|  |  |  | <span style="color: orange; font-size: 14px;"><i class="el-icon-warning"></i>1. 请选择保险单后进行操作</span> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="批单生效起期:" prop="applyDate" style="margin-left: 40px"> | 
|---|
|  |  |  | <div style="display: flex; flex-direction: column;"> | 
|---|
|  |  |  | <el-date-picker | 
|---|
|  |  |  | v-model="form.applyDate" | 
|---|
|  |  |  | placeholder="前选择日期" | 
|---|
|  |  |  | placeholder="请选择日期" | 
|---|
|  |  |  | :picker-options="pickerOptions" | 
|---|
|  |  |  | type="date" | 
|---|
|  |  |  | format="yyyy-MM-dd" | 
|---|
|  |  |  | value-format="yyyy-MM-dd" /> | 
|---|
|  |  |  | <span style="color: #F95601; font-size: 14px;">(2. 次日生效投保请于17:30前提交,超时提交以保险单为准)</span> | 
|---|
|  |  |  | <span style="color: orange; font-size: 14px;"> | 
|---|
|  |  |  | <i class="el-icon-warning"></i>2. 次日生效投保请于17:30前提交,超时提交以保险单为准</span> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="费用" v-if="model"> | 
|---|
|  |  |  | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | </el-table> | 
|---|
|  |  |  | <div style="color: #F95601; font-size: 14px;width: 100%;text-align: left">(3. 请先选择至少一条申请后提交投保申请)</div> | 
|---|
|  |  |  | <div style="color: orange; font-size: 14px;width: 100%;text-align: left"><i class="el-icon-warning"></i>3. 请先选择至少一条申请后提交投保申请</div> | 
|---|
|  |  |  | <div class="info" v-if="model"> | 
|---|
|  |  |  | <span v-if="model.specialAgreement">{{model.specialAgreement}}</span> | 
|---|
|  |  |  | <span v-if="model.specialInfo">{{model.specialInfo}}</span> | 
|---|
|  |  |  | <span v-if="model.ortherInfo">{{model.ortherInfo}}</span> | 
|---|
|  |  |  | <span v-if="model.specialAgreement" v-html="model.specialAgreement"></span> | 
|---|
|  |  |  | <span v-if="model.specialInfo" v-html="model.specialInfo"> </span> | 
|---|
|  |  |  | <span v-if="model.ortherInfo" v-html="model.ortherInfo"> </span> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <!--    选择申请单    --> | 
|---|
|  |  |  | <ApplyChangeDetails ref="ApplyChangeDetails" @success="getValue" /> | 
|---|
|  |  |  | 
|---|
|  |  |  | append-to-body | 
|---|
|  |  |  | center> | 
|---|
|  |  |  | <div class="desc_item_from"> | 
|---|
|  |  |  | <div style="width: 100%;  text-align: right; align-items: center;margin-bottom: 10px"> | 
|---|
|  |  |  | <span class="tip-warn"  style="color: orange; font-size: 14px; margin-right: 20px ;text-align: left"> | 
|---|
|  |  |  | <i class="el-icon-warning"></i>注:只能选择申请单数大于0的申请记录进行操作 | 
|---|
|  |  |  | </span> | 
|---|
|  |  |  | <el-checkbox :true-label="2" :false-label="0"   v-model="hasApplying" style="font-size: 12px;" @change="handleCurrentChange(1)">只显示有申请单记录</el-checkbox> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <el-table | 
|---|
|  |  |  | border | 
|---|
|  |  |  | ref="multipleTable1" | 
|---|
|  |  |  | v-loading="isWorking.search" | 
|---|
|  |  |  | :data="tableData.list" | 
|---|
|  |  |  | @row-click="rowselect1" | 
|---|
|  |  |  | :data="tableData" | 
|---|
|  |  |  | row-key="id" | 
|---|
|  |  |  | @selection-change="handleSelectionChange1" | 
|---|
|  |  |  | stripe | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="code" label="保单号" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="solutionName" label="保险方案" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="insureNum" label="投保人数" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="changeApplyNum" label="申请单数" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="insureNum" label="投保人数" min-width="90px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="guaranteeNum" label="在保人数" min-width="90px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="changeApplyNum" label="申请单数" min-width="90px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="fee" label="总费用(元)" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="createDate" label="提交时间" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="createDate" label="提交时间" min-width="180px"></el-table-column> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | label="操作" | 
|---|
|  |  |  | min-width="100" | 
|---|
|  |  |  | fixed="right" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <el-button v-if="row.changeApplyNum >0" type="primary"   @click="selectDo(row)">选择</el-button> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | </el-table> | 
|---|
|  |  |  | <div class="desc_item_from_page"> | 
|---|
|  |  |  | <el-pagination | 
|---|
|  |  |  | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <span slot="footer" class="dialog-footer"> | 
|---|
|  |  |  | <!-- | 
|---|
|  |  |  | <el-button type="primary" @click="selectDo()">确  定</el-button> | 
|---|
|  |  |  | --> | 
|---|
|  |  |  | <el-button @click="model=null;visibleSelect=false">取 消</el-button> | 
|---|
|  |  |  | </span> | 
|---|
|  |  |  | </el-dialog> | 
|---|
|  |  |  | 
|---|
|  |  |  | import { merge } from '@/api/business/unionChange' | 
|---|
|  |  |  | import ApplyChangeDetails from '@/components/business/ApplyChangeUnitDetails' | 
|---|
|  |  |  | import { fetchList as pageUnionList } from '@/api/business/unionApply' | 
|---|
|  |  |  | import {getDetail} from "@/api/business/insuranceApply"; | 
|---|
|  |  |  | import { getDetail } from '@/api/business/insuranceApply' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'add_subtract_entrust', | 
|---|
|  |  |  | extends: BaseOpera, | 
|---|
|  |  |  | components: { GlobalWindow, ApplyChangeDetails,selectApplicationForm }, | 
|---|
|  |  |  | components: { GlobalWindow, ApplyChangeDetails, selectApplicationForm }, | 
|---|
|  |  |  | data () { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | form: { | 
|---|
|  |  |  | 
|---|
|  |  |  | applyDate: null, | 
|---|
|  |  |  | businessType: 1 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | visibleSelect:false, | 
|---|
|  |  |  | visibleSelect: false, | 
|---|
|  |  |  | solutions: [], | 
|---|
|  |  |  | currentPage:0, | 
|---|
|  |  |  | currentPage: 0, | 
|---|
|  |  |  | list: [], | 
|---|
|  |  |  | pickerOptions: {}, | 
|---|
|  |  |  | tableData:[], | 
|---|
|  |  |  | tableTotal:0, | 
|---|
|  |  |  | tableData: [], | 
|---|
|  |  |  | hasApplying: 0, | 
|---|
|  |  |  | tableTotal: 0, | 
|---|
|  |  |  | endTime: '', | 
|---|
|  |  |  | item: null, | 
|---|
|  |  |  | model: null, | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | rowselect(row){ | 
|---|
|  |  |  | this.$refs.multipleTable.toggleRowSelection(row,true); | 
|---|
|  |  |  | rowselect (row) { | 
|---|
|  |  |  | this.$refs.multipleTable.toggleRowSelection(row, true) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | rowselect1(row){ | 
|---|
|  |  |  | this.$refs.multipleTable1.toggleRowSelection(row,true); | 
|---|
|  |  |  | rowselect1 (row) { | 
|---|
|  |  |  | this.$refs.multipleTable1.toggleRowSelection(row, true) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | checkDetial(row){ | 
|---|
|  |  |  | checkDetial (row) { | 
|---|
|  |  |  | getDetail(row.applyId).then(res => { | 
|---|
|  |  |  | // this.apply = res | 
|---|
|  |  |  | this.$refs.ApplyChangeDetails.open('更换派遣单位人员',res, row,2) | 
|---|
|  |  |  | this.$refs.ApplyChangeDetails.open('更换派遣单位人员', res, row, 2) | 
|---|
|  |  |  | }).catch(err => { | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | handleSelectionChange(rows){ | 
|---|
|  |  |  | handleSelectionChange (rows) { | 
|---|
|  |  |  | this.form.applyIds = [] | 
|---|
|  |  |  | // 假设取出 id 字段 | 
|---|
|  |  |  | rows.forEach(item => { | 
|---|
|  |  |  | const id = item.id | 
|---|
|  |  |  | if ( this.form.applyIds.indexOf(id) === -1) { | 
|---|
|  |  |  | if (this.form.applyIds.indexOf(id) === -1) { | 
|---|
|  |  |  | this.form.applyIds.push(id) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 
|---|
|  |  |  | console.log(rows) | 
|---|
|  |  |  | if (rows.length > 1) { | 
|---|
|  |  |  | // clearSelection 用于多选表格,清空用户的选择 | 
|---|
|  |  |  | this.$refs.multipleTable1.clearSelection(); | 
|---|
|  |  |  | this.$refs.multipleTable1.toggleRowSelection(rows[rows.length-1]); | 
|---|
|  |  |  | this.$refs.multipleTable1.clearSelection() | 
|---|
|  |  |  | this.$refs.multipleTable1.toggleRowSelection(rows[rows.length - 1]) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (rows.length >= 1) { | 
|---|
|  |  |  | if (rows.length >= 1) { | 
|---|
|  |  |  | // 选中的行对像放进数组,方便后续对数据进行操作 | 
|---|
|  |  |  | this.model =rows[rows.length-1] | 
|---|
|  |  |  | this.model = rows[rows.length - 1] | 
|---|
|  |  |  | } else if (rows.length === 0) { | 
|---|
|  |  |  | this.model = null | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | selectDo(){ | 
|---|
|  |  |  | if(!this.model){ | 
|---|
|  |  |  | selectDo (row){ | 
|---|
|  |  |  | this.model =row | 
|---|
|  |  |  | if (!this.model) { | 
|---|
|  |  |  | this.$tip.apiFailed({ | 
|---|
|  |  |  | type: 'error', | 
|---|
|  |  |  | message: '请选择至少一条申请记录进行操作' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.visibleSelect=false | 
|---|
|  |  |  | this.visibleSelect = false | 
|---|
|  |  |  | this.form.unionApplyId = this.model.id | 
|---|
|  |  |  | var that =this | 
|---|
|  |  |  | var that = this | 
|---|
|  |  |  | this.pickerOptions = { | 
|---|
|  |  |  | disabledDate (time) { | 
|---|
|  |  |  | var start = new Date(that.model.startTime) | 
|---|
|  |  |  | start.setDate(start.getDate() + 1); | 
|---|
|  |  |  | start.setDate(start.getDate() + 1) | 
|---|
|  |  |  | var end = new Date(that.model.endTime) | 
|---|
|  |  |  | return ( time.getTime() < start.getTime() ||  time.getTime()>end.getTime()) | 
|---|
|  |  |  | return (time.getTime() < start.getTime() || time.getTime() > end.getTime()) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.getList(); | 
|---|
|  |  |  | this.getList() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | selectDo1 () { | 
|---|
|  |  |  | if (!this.model) { | 
|---|
|  |  |  | this.$tip.apiFailed({ | 
|---|
|  |  |  | type: 'error', | 
|---|
|  |  |  | message: '请选择至少一条申请记录进行操作' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.visibleSelect = false | 
|---|
|  |  |  | this.form.unionApplyId = this.model.id | 
|---|
|  |  |  | var that = this | 
|---|
|  |  |  | this.pickerOptions = { | 
|---|
|  |  |  | disabledDate (time) { | 
|---|
|  |  |  | var start = new Date(that.model.startTime) | 
|---|
|  |  |  | start.setDate(start.getDate() + 1) | 
|---|
|  |  |  | var end = new Date(that.model.endTime) | 
|---|
|  |  |  | return (time.getTime() < start.getTime() || time.getTime() > end.getTime()) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.getList() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | confirm () { | 
|---|
|  |  |  | this.$refs.form.validate((valid) => { | 
|---|
|  |  |  | 
|---|
|  |  |  | if (!valid) { | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(this.form.applyIds == null || this.form.applyIds.length ===0){ | 
|---|
|  |  |  | if (this.form.applyIds == null || this.form.applyIds.length === 0) { | 
|---|
|  |  |  | this.$tip.apiFailed({ | 
|---|
|  |  |  | type: 'error', | 
|---|
|  |  |  | message: '请选择至少一条申请记录进行投保申请!!' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.$confirm('确认提交,请仔细核对信息。', '提示', { | 
|---|
|  |  |  | confirmButtonText: '确定', | 
|---|
|  |  |  | 
|---|
|  |  |  | center: true | 
|---|
|  |  |  | }).then(() => { | 
|---|
|  |  |  | merge(this.form) | 
|---|
|  |  |  | .then(response => { | 
|---|
|  |  |  | this.$message({ | 
|---|
|  |  |  | type: 'success', | 
|---|
|  |  |  | message: '提交成功!' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.visible = false | 
|---|
|  |  |  | this.$emit('success') | 
|---|
|  |  |  | }).catch(err => { | 
|---|
|  |  |  | this.$tip.apiFailed(err) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .then(response => { | 
|---|
|  |  |  | this.$message({ | 
|---|
|  |  |  | type: 'success', | 
|---|
|  |  |  | message: '提交成功!' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.visible = false | 
|---|
|  |  |  | this.$emit('success') | 
|---|
|  |  |  | }).catch(err => { | 
|---|
|  |  |  | this.$tip.apiFailed(err) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }).catch(() => { | 
|---|
|  |  |  | this.$message({ | 
|---|
|  |  |  | type: 'info', | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | open (title, target) { | 
|---|
|  |  |  | this.title = title | 
|---|
|  |  |  | this.model= null | 
|---|
|  |  |  | this.list= [] | 
|---|
|  |  |  | this.visibleSelect=false | 
|---|
|  |  |  | this.tableData=[] | 
|---|
|  |  |  | this.tableTotal=0 | 
|---|
|  |  |  | this.item= null | 
|---|
|  |  |  | this.model = null | 
|---|
|  |  |  | this.list = [] | 
|---|
|  |  |  | this.visibleSelect = false | 
|---|
|  |  |  | this.hasApplying= 0 | 
|---|
|  |  |  | this.tableData = [] | 
|---|
|  |  |  | this.tableTotal = 0 | 
|---|
|  |  |  | this.item = null | 
|---|
|  |  |  | if (target) { | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|
|  |  |  | this.$refs.form.resetFields() | 
|---|
|  |  |  | 
|---|
|  |  |  | // this.getUnionApplyList() | 
|---|
|  |  |  | this.visible = true | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getValue(){ | 
|---|
|  |  |  | getValue () { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | selectBaoxiandan(){ | 
|---|
|  |  |  | selectBaoxiandan () { | 
|---|
|  |  |  | this.currentPage = 1 | 
|---|
|  |  |  | this.visibleSelect=true | 
|---|
|  |  |  | this.$refs.multipleTable.clearSelection(); | 
|---|
|  |  |  | this.visibleSelect = true | 
|---|
|  |  |  | this.$refs.multipleTable.clearSelection() | 
|---|
|  |  |  | this.getUnionApplyList() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getUnionApplyList(){ | 
|---|
|  |  |  | getUnionApplyList () { | 
|---|
|  |  |  | pageUnionList({ | 
|---|
|  |  |  | capacity: 10, | 
|---|
|  |  |  | page: this.currentPage, | 
|---|
|  |  |  | model: { | 
|---|
|  |  |  | queryFlag:2, | 
|---|
|  |  |  | status: 3, | 
|---|
|  |  |  | hasApplying:this.hasApplying, | 
|---|
|  |  |  | queryFlag: 2, | 
|---|
|  |  |  | status: 3 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }).then(res => { | 
|---|
|  |  |  | this.tableData.list = res.records | 
|---|
|  |  |  | this.tableData = res.records | 
|---|
|  |  |  | this.tableTotal = res.total | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|
|  |  |  | console.log(this.$refs.multipleTable1) | 
|---|
|  |  |  | if (this.$refs.multipleTable1 && this.$refs.multipleTable1.doLayout) { | 
|---|
|  |  |  | this.$refs.multipleTable1.doLayout() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getList () { | 
|---|
|  |  |  | listAll({ | 
|---|
|  |  |  | solutionType:1, | 
|---|
|  |  |  | type:1, | 
|---|
|  |  |  | unionApplyId: this.model.id, | 
|---|
|  |  |  | status: 7 | 
|---|
|  |  |  | solutionType: 1, | 
|---|
|  |  |  | type: 1, | 
|---|
|  |  |  | unionApplyId: this.model.id, | 
|---|
|  |  |  | status: 7 | 
|---|
|  |  |  | }).then(res => { | 
|---|
|  |  |  | this.list = res | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|