<template>
    <div class="all">
        <el-form ref="form" :model="form" label-width="82px" label-position="left" :inline="true" v-loading="loadingRight">
            <!-- <el-row style="min-height: calc(100vh - 45vh)"> -->
            <div style="display: flex">
                <div class="left" style="width: 60%">
                    <!-- <el-col style="width: 45%;" class="left"> -->
                    <div style="padding: 12px">
                        <!-- <el-card shadow="never"> -->
                        <el-tabs v-model="searchData" @tab-click="feiyong">
                            <el-tab-pane label="费用明细" name="two">
                                <div style="margin-bottom: 10px">
                                    <div>
                                        <span style="margin-right: 10px">筛选</span>
                                        <el-select v-model="selectval" placeholder="请选择" @change="selectshaixuan" style="width: 150px">
                                            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
                                        </el-select>
                                        <el-input v-model="selectvalue" placeholder="请输入内容" style="width: 150px" @keyup.enter.native="select_sx"></el-input>
                                    </div>
                                </div>
                                <div style="position: absolute; top: 0px; right: 10px; z-index: 2"><el-button @click="regetfree()" type="danger">重新获取费用清单</el-button></div>
                                <el-table
                                    v-loading="loading2"
                                    ref="multipleTable"
                                    class="eltable"
                                    :data="listfees"
                                    style="width: 100%"
                                    height="50vh"
                                    :header-cell-style="{ background: '#5490ff', color: 'white' }"
                                    :cell-style="styleBack"
                                    element-loading-text="拼命加载中"
                                >
                                    <el-table-column align="center" property="yyxmmc" label="项目名称" width="200"></el-table-column>
                                    <el-table-column align="center" property="yyxmbm" label="国标码"></el-table-column>
                                    <el-table-column align="center" property="dj" label="单价"></el-table-column>
                                    <el-table-column align="center" property="sl" label="数量"></el-table-column>
                                    <el-table-column align="center" property="zje" label="总金额"></el-table-column>
                                    <el-table-column align="center" property="fysfsj" label="费用发生时间" width="160"></el-table-column>
                                    <el-table-column fixed="right" align="center" label="自付比例" width="100">
                                        <template slot-scope="scope">
                                            <div>
                                                <el-input v-model="scope.row.sxzfbl" type="number" ref="zifu" @focus="savefocus(scope.row)" @blur="biliBlur(scope.row)"></el-input>
                                                <el-button size="mini" type="primary" v-if="seemodel == scope.row.id" @click.stop="savebtn(scope.row)">保存</el-button>
                                            </div>
                                        </template>
                                    </el-table-column>
                                    <el-table-column fixed="right" align="center" label="操作">
                                        <template slot-scope="scope">
                                            <el-button type="primary" @click="getProp(scope.row)" size="small">比例</el-button>
                                        </template>
                                    </el-table-column>
                                </el-table>
                            </el-tab-pane>
                            <el-tab-pane label="预交金记录" name="one">
                                <el-table
                                    v-loading="loading"
                                    class="eltable"
                                    :data="list"
                                    style="width: 100%"
                                    :header-cell-style="{ background: '#EEF5FD', color: '#18518B' }"
                                    element-loading-text="拼命加载中"
                                >
                                    <el-table-column align="center" property="inprepayDate" label="缴费日期" width="200"></el-table-column>
                                    <el-table-column align="center" property="prepayCost" label="缴费金额"></el-table-column>
                                    <!-- <el-table-column align="center" property="type" label="方式"></el-table-column> -->
                                    <el-table-column align="center" property="bankTranno" label="银行流水号"></el-table-column>
                                    <el-table-column align="center" property="operCode" label="工号"></el-table-column>
                                    <el-table-column align="center" property="operName" label="操作员姓名"></el-table-column>
                                </el-table>
                            </el-tab-pane>
                            <el-tab-pane label="医保个账MIS" name="three">
                                <el-table
                                    :data="Advancepayment_list"
                                    tooltip-effect="dark"
                                    style="width: 100%; height: 630px; overflow-y: auto"
                                    :header-cell-style="{ background: '#EEF5FD', color: '#18518B' }"
                                    element-loading-text="拼命加载中"
                                >
                                    <el-table-column prop="type.name" label="类型"> </el-table-column>
                                    <el-table-column prop="amount" label="金额"> </el-table-column>
                                    <el-table-column prop="bank_data.bankTradeNo" align="center" label="流水号"> </el-table-column>
                                    <el-table-column prop="bank_data.referNo" align="center" label="参考号"> </el-table-column>
                                    <el-table-column fixed="right" align="center" label="操作">
                                        <template slot-scope="scope" v-if="scope.row.type.value == 'RECHARGE'">
                                            <el-button type="primary" @click="prefree(scope.row)" v-if="scope.row.refund == true" size="small">退款</el-button>
                                            <span v-else>已退款</span>
                                        </template>
                                    </el-table-column>
                                </el-table>
                            </el-tab-pane>
                        </el-tabs>
                        <div class="downleft" style="margin-top: 10px">
                            <div class="downcontent">
                                <!-- <el-input placeholder="0" v-model="total_amount">
                                    <template slot="prepend">合计</template>
                                </el-input> -->
                                <div style="margin-left: 20px">
                                    <span style="font-size: 20px; font-weight: 550">合计：</span>
                                    <span style="font-size: 20px; font-weight: 550; color: red">￥{{ total_amount }}</span>
                                </div>
                                <div>
                                    <!-- <el-button type="primary" @click="Match()"
                                        :disabled="loading2==true" v-if="this.patientform.his_patient_type.value != 'ZF'">匹配自付比例</el-button> -->
                                    <el-button @click="prereturn()" type="success" :disabled="this.patientform.his_patient_type.value == 'ZF'">上传费用清单</el-button>
                                </div>
                            </div>
                            <!-- <div class="downmessage">提示消息:</div> -->
                        </div>
                        <!-- </el-card> -->
                    </div>
                    <!-- </el-col> -->
                </div>
                <div class="right" style="width: 40%">
                    <!-- <el-col style="width: 45%;" class="right"> -->
                    <div class="bigpa">
                        <div class="bigpa_top">住院结算凭证</div>
                        <div class="bigpa_down">东营市人民医院</div>
                        <div class="littlepa">出院</div>
                    </div>
                    <div class="main">
                        <!-- <div class="title" v-if="patientform">
                            <div>住院号：{{ patientform.his_inpatient_no }}</div>
                            <div>姓名：{{ patientform.p_xm }}</div>
                            <div>个人编号：{{ patientform.p_grbh }}</div>
                        </div> -->
                        <div class="tou">
                            <div>患者信息</div>
                            <div class="touinside"></div>
                            <div class="toutop"></div>
                        </div>
                        <div class="commonflex_three">
                            <el-form-item label="姓名:" label-width="81px;">
                                <span>{{ patientform.p_xm }}</span>
                            </el-form-item>
                            <el-form-item label="住院号:" label-width="81px;">
                                <span>{{ patientform.his_inpatient_no }}</span>
                            </el-form-item>
                            <el-form-item label="患者类型:" label-width="81px;">
                                <span>{{ patientform.his_patient_type.name }}</span>
                            </el-form-item>
                        </div>
                        <div class="commonflex_two">
                            <el-form-item label="身份证号:" label-width="81px;">
                                <span id="IDcard" @click="copy()">{{ patientform.p_grbh }}</span>
                            </el-form-item>
                            <el-form-item label="电话号码:" label-width="81px;">
                                <span>{{ patientform.p_lxdh == '' ? '--' : patientform.p_lxdh }}</span>
                            </el-form-item>
                        </div>
                        <div class="install">
                            <div class="tou">
                                <div>结算金额</div>
                                <div class="touinside"></div>
                                <div class="toutop"></div>
                            </div>
                            <div class="commonflex_three">
                                <el-form-item label="优惠后费用" label-width="81px;">
                                    <el-input v-model="jiesuan.zje" readonly></el-input>
                                </el-form-item>
                                <el-form-item label="预交款" label-width="54px;">
                                    <el-input v-model="jiesuan.his_amount.in_prepay" readonly></el-input>
                                </el-form-item>
                                <el-form-item label="应付" label-width="40px;">
                                    <el-input v-model="jiesuan.yf" readonly></el-input>
                                </el-form-item>
                                <el-form-item label="医保报销">
                                    <el-input v-model="jiesuan.ybfdje" readonly></el-input>
                                </el-form-item>
                            </div>
                            <div class="commonflex_two">
                                <el-form-item label="自付金额">
                                    <el-input v-model="jiesuan.brfdje" readonly></el-input>
                                </el-form-item>
                                <el-form-item label="省异地个人账户支付" label-width="150px">
                                    <el-input v-model="jiesuan.sydgrzhzf" readonly></el-input>
                                </el-form-item>
                                <el-form-item label="医保账户已扣款" label-width="120px">
                                    <el-input v-model="mis_amount" readonly></el-input>
                                </el-form-item>
                            </div>
                            <div class="commonflex_two"></div>

                            <div class="tou">
                                <div>待补交金额</div>
                                <div class="touinside"></div>
                            </div>
                            <div class="commonflex_two">
                                <el-form-item label="支付金额" label-width="96px">
                                    <el-input v-model="form.zfje" :disabled="disablebtn"></el-input>
                                </el-form-item>
                                <el-form-item label="缴款方式" prop="region">
                                    <el-select v-model="feelist.channel" placeholder="请选择" style="width: 160px">
                                        <el-option label="微信" value="1"></el-option>
                                        <el-option label="支付宝" value="2"></el-option>
                                        <el-option label="银行卡" value="3"></el-option>
                                        <el-option label="现金" value="4"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item label="医保账户扣款" label-width="96px">
                                    <el-input
                                        v-model="jiesuan.grzhzf"
                                        @input="ybzhifu()"
                                        :disabled="disablebtn || patientform.his_patient_type.value == 'YT_ZG' || patientform.his_patient_type.value == 'YT_SY'"
                                    ></el-input>
                                </el-form-item>
                            </div>
                            <div class="commonflex_two">
                                <el-form-item label="共济账户扣款" label-width="110px">
                                    <el-input v-model="jiesuan.gjzhzf" @input="gjzhifu()" :disabled="disablebtn"></el-input>
                                </el-form-item>
                                <el-form-item label="医保账户余额：" label-width="110px">
                                    <el-input v-model="jiesuan.zhye" readonly></el-input>
                                </el-form-item>
                                <el-form-item label="共济账户余额：" label-width="110px">
                                    <el-input v-model="jiesuan.gjzhye" readonly></el-input>
                                </el-form-item>
                            </div>
                            <div class="commonflex_two">
                                <el-checkbox v-model="gjchick" v-if="patientform.his_patient_type.value == 'ZF'" style="margin-left: 50px">共济账户支付</el-checkbox>
                            </div>
                            <!-- <div class="commonflex_two">
                            <div class="ln24">
                                医保账户余额：<span class="cred">{{ jiesuan.zhye }}</span>
                            </div>
                            <div class="ln24">
                                共济账户余额：<span class="cred">{{ jiesuan.gjzhye }}</span>
                            </div>
                            <div class="ln24 cred"></div>
                        </div> -->
                            <!-- <div style="margin-top: 20px;">
                            <el-checkbox v-model="formcheck.gjzh">共济账户支付</el-checkbox>
                            <el-checkbox v-model="formcheck.grzh">医保个账支付</el-checkbox>
                        </div> -->
                            <div class="tou">
                                <div>找回金额</div>
                                <div class="touinside"></div>
                            </div>
                            <div class="commonflex_two">
                                <el-form-item label="金额">
                                    <el-input v-model="zhje" :disabled="disablebtn" readonly></el-input>
                                </el-form-item>
                            </div>
                        </div>
                        <div style="display: flex; justify-content: space-between; margin-top: 70px">
                            <div class="commonflex_button" style="">
                                <!-- <el-button @click="print()">打印</el-button> -->
                                <el-button @click="selectcard()" v-if="retryparamdata.retry == false && disablebtn != true">①预结算</el-button>
                                <!-- <el-button @click="prejiesuan()">②医保结算</el-button> -->
                                <el-button @click="uploadfee()" v-if="form.zfje * 1 > 0" :loading="bujiaoloding">③补交</el-button>
                                <el-button @click="feecancel()" v-if="zhje * 1 < 0 && tuishow == 'SUCCESS'">③退款</el-button>
                                <el-button type="primary" @click="leavehospitalFun()" v-if="disablebtn != true">④出院</el-button>
                            </div>
                            <div class="commonflex_button">
                                <el-button type="danger" @click="firstblod()" v-if="blodshow">用血报销</el-button>
                                <el-button type="success" @click="tongchou()">统筹单</el-button>
                                <el-button type="warning" @click="fapiao()">发票</el-button>
                            </div>
                        </div>
                        <div style="margin-left: -65px; margin-top: 10px"></div>
                    </div>
                    <!-- </el-col> -->
                </div>
            </div>
            <!-- </el-row> -->
        </el-form>
        <SelectCard v-if="dialogFormVisible" :visible.sync="dialogFormVisible" :flag="flag" @getyibaoinfo="getyibaoinfo" :xzbz="xzbz" :patientcard="patientform" />
        <el-dialog title="付款方式" :visible.sync="uploadfeeshow">
            <el-form :model="feelist" :inline="true" @submit.native.prevent>
                <div>
                    <div style="text-align: center">
                        <!-- <div style="margin-bottom: 30px" v-if="feelist.channel == ''">
                            <span class="feetexts">付款方式——<span class="feetext" >请选择缴款方式</span>付款</span>
                        </div> -->
                        <div style="margin-bottom: 30px" v-if="feelist.channel == '1'">
                            <span class="feetexts">付款方式——<span class="feetext">微信</span>付款</span>
                        </div>
                        <div style="margin-bottom: 30px" v-if="feelist.channel == '2'">
                            <span class="feetexts">付款方式——<span class="feetext">支付宝</span>付款</span>
                        </div>
                        <div style="margin-bottom: 30px" v-if="feelist.channel == '3'">
                            <span class="feetexts">付款方式——<span class="feetext">银行卡</span>付款</span>
                        </div>
                        <div style="margin-bottom: 30px" v-if="feelist.channel == '4'">
                            <span class="feetexts">付款方式——<span class="feetext">现金</span>付款</span>
                        </div>
                        <div style="text-align: center">
                            <el-input
                                v-if="feelist.channel == '1'"
                                v-model="fee.weixin"
                                type="text"
                                placeholder="请刷微信付款码"
                                @keyup.enter.native="feesure(1)"
                                ref="input"
                                style="width: 300px"
                            ></el-input>
                            <el-input
                                v-if="feelist.channel == '2'"
                                v-model="fee.zhifubao"
                                type="text"
                                placeholder="请刷支付宝付款码"
                                @keyup.enter.native="feesure(2)"
                                ref="input"
                                style="width: 300px"
                            ></el-input>
                            <span v-if="feelist.channel == '3'" style="font-size: 30px; color: red">请插入卡片</span>
                        </div>
                    </div>
                </div>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="uploadfeeshow = false">取 消</el-button>
                <el-button type="primary" @click="feesure(feelist.channel)" :loading="jfloadshow">确 定</el-button>
            </div>
        </el-dialog>
        <el-dialog title="预结算信息" :visible.sync="yujiesuanshow" width="700">
            <el-form :model="printform" :inline="true">
                <div style="width: 100%; margin: 0 auto; font-size: 19px">
                    <el-row :gutter="20">
                        <el-col :span="6">
                            <div class="grid-content">患者姓名：{{ patientform.p_xm }}</div>
                        </el-col>
                        <el-col :span="9">
                            <div class="grid-content">住院号码：{{ patientform.his_patient_no }}</div>
                        </el-col>
                        <el-col :span="9">
                            <div class="grid-content">性质：{{ patientform.his_patient_type.name }}</div>
                        </el-col>
                        <el-col :span="6">
                            <div class="grid-content">确诊医生：{{ patientform.p_qzysxm }}</div>
                        </el-col>
                        <el-col :span="9">
                            <div class="grid-content">入院时间：{{ patientform.p_zyrq }}</div>
                        </el-col>
                        <el-col :span="9">
                            <div class="grid-content">出院时间：{{ patientform.p_cyrq }}</div>
                        </el-col>
                        <el-col :span="24">
                            <div class="grid-content">出院诊断：</div>
                        </el-col>
                        <el-col :span="24">
                            <!-- <div class="grid-content">{{ patientform ? patientform.p_cyzd.diagName : patientform }}#{{ patientform ? patientform.p_cyzd.icdCode : patientform }}</div> -->
                            <el-form-item label="疾病名称" class="w200" style="margin-left: 10px">
                                    <el-select
                                        v-model="patientform.p_jbmc"
                                        placeholder="请选择"
                                        filterable
                                        remote
                                        reserve-keyword
                                        :remote-method="diseasefun"
                                        :loading="loading"
                                        @change="selectChange"
                                    >
                                        <el-option :value="item.jbmc" v-for="item in decise" :key="item.jbbm" id="doc">{{ item.jbmc }}</el-option>
                                    </el-select>
                                    <!-- <el-input v-model="form.p_jbmc" readonly></el-input> -->
                                    <!-- <span>疾病编码：{{ form.p_jbbm }}</span> -->
                                </el-form-item>
                                <el-form-item label="疾病编码" class="w200" style="margin-left: 10px">
                                    <el-input v-model="patientform.p_jbbm" readonly></el-input>
                                </el-form-item>
                        </el-col>
                    </el-row>

                    <div style="margin-top: 40px">
                        <el-form-item label="治疗方式">
                            <el-select v-model="typeinfo.des" placeholder="请选择" style="width: 160px">
                                <el-option :label="item.value_name" :value="item.code" v-for="(item, index) in zhiliaolist" :key="index"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="出院方式">
                            <el-select v-model="typeinfo.hosp" placeholder="请选择" style="width: 160px">
                                <el-option :label="item.value_name" :value="item.code" v-for="(item, index) in chuyuanlist" :key="index"> </el-option>
                            </el-select>
                        </el-form-item>
                        <br>
                        <el-form-item :label="patientform.his_patient_type.value == 'YT_SY'?'生育胎次':'生育孩次'" v-if="patientform.his_patient_type.value == 'YT_SY' || patientform.his_patient_type.value == 'DY_JM'">
                            <el-select v-model="typeinfo.djhz" placeholder="请选择" style="width: 160px">
                                <el-option label="1" value="1"></el-option>
                                <el-option label="2" value="2"></el-option>
                                <el-option label="3" value="3"></el-option>
                                <el-option label="4" value="4"></el-option>
                                <el-option label="5" value="5"></el-option>
                                <el-option label="6" value="6"></el-option>
                            </el-select>
                        </el-form-item>


                        <el-form-item label="分娩方式" v-if="patientform.his_patient_type.value == 'YT_SY' || patientform.his_patient_type.value == 'DY_JM'">
                            <el-select v-model="typeinfo.fmfs" placeholder="请选择" style="width: 160px">
                                <el-option :label="item.value_name" :value="item.code" v-for="(item, index) in fmfslist" :key="index"> </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="参保地" v-if="gjchick == true">
                            <el-select v-model="typeinfo.cbd" placeholder="请选择">
                                <el-option label="东营市本地" value="local"></el-option>
                                <el-option label="东营市油田" value="oil"></el-option>
                                <el-option label="省内异地" value="offsite"></el-option>
                            </el-select>
                        </el-form-item>

                    </div>
                </div>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="yujiesuanshow = false">取 消</el-button>
                <el-button type="primary" @click="yutrue()">确 定</el-button>
            </div>
        </el-dialog>
        <el-dialog title="退款列表" :visible.sync="deletefree">
            <el-table
                :data="tuifeilist"
                tooltip-effect="dark"
                style="width: 100%; height: 630px; overflow-y: auto"
                :header-cell-style="{ background: '#49ABF5', color: '#FFFFFF' }"
                v-loading="tuikuanloading"
                element-loading-text="拼命加载中"
            >
                <!-- <el-table-column prop="chequeName" label="支付渠道" width="110">
                </el-table-column> -->
                <el-table-column label="支付渠道" width="110">
                    <template slot-scope="scope">
                        <span v-if="scope.row.chequeName == 'ALI'"> 支付宝 </span>
                        <span v-if="scope.row.chequeName == 'CASH'"> 现金 </span>
                        <span v-if="scope.row.chequeName == 'BANK'"> 银行卡 </span>
                        <span v-if="scope.row.chequeName == 'WX'"> 微信 </span>
                    </template>
                </el-table-column>
                <el-table-column prop="bk_card_no" label="银行卡号"> </el-table-column>
                <el-table-column prop="couldRefundAmount" label="退款金额"> </el-table-column>
                <el-table-column prop="outTradeNo" align="center" label="充值交易流水号"> </el-table-column>
                <el-table-column prop="ck_no" align="center" label="参考号"> </el-table-column>
                <el-table-column prop="trade_time" align="center" label="充值交易时间"> </el-table-column>
            </el-table>
            <div style="text-align: center">
                <el-button type="primary" @click="tuikuansure()" :loading="tuikuanshow">确 定</el-button>
            </div>
        </el-dialog>
        <edit-prop1 :visible.sync="showEditProp" :data="currentData" isHospital="1" @proportion="proportion" :infor="infor" :his_patient_no="patientform.his_patient_no"></edit-prop1>
        <el-dialog title="选择就诊介质" :visible.sync="jeizhishow" width="489px" :close-on-click-modal="false">
            <el-form :model="yibaoinfo" :inline="true" @submit.native.prevent>
                <div style="text-align: center">
                    <el-form-item label="介质类型">
                        <el-radio-group v-model="jiezhi">
                            <el-radio label="A">医保电子凭证</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </div>
                <div style="text-align: center">
                    <el-input v-if="jiezhi == 'A'" v-model="pingzhengma" type="text" placeholder="请输入患者卡号" @keyup.enter.native="cardjiesuan" ref="input" style="width: 300px"></el-input>
                </div>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <!-- <el-button @click="jeizhishow = false">取 消</el-button> -->
                <!-- <el-button type="primary" @click="cardjiesuan">确
                    定</el-button> -->
            </div>
        </el-dialog>
        <el-dialog title="用血报销" :visible.sync="sprice_show" width="660px" top="20vh !important"  class="tanchaung">
            <div class="tabin">
                <el-form ref="form" :model="form">
                    <div style="display: flex; justify-content: space-between">
                        <el-form-item label="总血费" label-width="100px">
                            <el-input v-model="blod_data.blood_zje" readonly></el-input>
                        </el-form-item>
                        <el-form-item label="医保报销" label-width="100px">
                            <el-input v-model="blod_data.ybblod" readonly></el-input>
                        </el-form-item>
                    </div>
                    <div style="display: flex; justify-content: space-between">
                        <el-form-item label="血站报销" label-width="100px">
                            <el-input v-model="blod_data.blood_amount" readonly></el-input>
                        </el-form-item>
                    </div>
                </el-form>
            </div>

            <span slot="footer" class="dialog-footer" style="text-align: center">
                <el-button type="primary" @click="sprice_show = false">明白</el-button>
            </span>
        </el-dialog>
    </div>
</template>
<script src="../../assets/js/jquery-3.6.0.js"></script>
<script>
import editProp1 from './components/editProp' //修改自付比例
import {
    preSettlementGetPatientInfo,
    preSettlement,
    jiesuanlist,
    invoice,
    feelist,
    prereturn,
    freemoney,
    query_dict,
    zy_mis,
    retry_params,
    blood,
    get_serial_number,
    tuikuanlist,
    refund,
    editProp,
    zfbl,
    recharge_refund,
} from '@/api/jiesuan'
import {  disease } from '@/api/patient'
import { mzxx, mzxxs } from '@/api/mz'
import Cookies from 'js-cookie'
import SelectCard from '@/components/SelectCard'
import printProof from '../../utils/print_proof'
export default {
    components: {
        SelectCard,
        editProp1,
    },
    data() {
        return {
            decise: [],
            jfloadshow:false,
            bujiaoloding:false,
            resorderID: '',
            bank_record_id: '',
            blod_data: {
                ybblod: '0',
                blood_zje: '0',
                blood_amount: '0',
            },
            blodshow: false,
            inform: {
                xzbz: '',
            },
            tuikuanshow: false,
            sprice_show: false,
            gjchick: false,
            open_ewm: false,
            zlfshow: '',
            retryparamdata: {
                retry: true,
            },
            selectvalue: '',
            options: [
                {
                    value: 'all',
                    label: '全部',
                },
                {
                    value: 'success',
                    label: '成功',
                },
                {
                    value: 'error',
                    label: '失败',
                },
                {
                    value: 'more',
                    label: '多比例',
                },
            ],
            selectval: 'all',
            yibaoinfo: {},
            pingzhengma: '',
            jiezhi: 'A',
            jeizhishow: false,
            zhje: 0,
            total_amount: '',
            tuikuanloading: false,
            formcheck: {
                gjzh: false,
                grzh: false,
            },
            amount_total: '',
            deletefree: false,
            typeinfo: {
                hosp: '',
                des: '',
                cbd: '',
                fmfs: '',
                sytc: '',
            },
            zhiliaolist: [], //治疗方式
            chuyuanlist: [], //出院方式
            fmfslist: [],
            jmfmfslist: [],
            yujiesuanshow: false,
            fee: {
                weixin: '',
                zhifubao: '',
            },
            uploadfeeshow: false,
            printform: {
                channel: '',
            },
            feelist: {
                channel: '',
            },
            printVisible: false,
            xzbz: '',
            idcard: '',
            flag: 'two',
            dialogFormVisible: false,
            yibaodata: {},
            total: 100,
            total2: 100,
            pageInfo1: {
                page: 1,
                limit: 999,
            },
            pageInfo: {
                page: 1,
                limit: 999,
                sort: undefined,
                order: undefined,
            },
            pageInfo2: {
                page: 1,
                limit: 999,
                sort: undefined,
                order: undefined,
            },
            loading: false,
            loading2: false,
            searchData: 'two',
            patientform: {
                p_cyzd: {
                    diagName: '',
                    icdCode: '',
                },
                p_xm: '',
                his_patient_no: '',
                his_patient_type: {
                    value: '',
                },
                p_zyrq: '',
            },
            form: {
                xjje: 0,
                ylje: 0,
                zfje: 0,
            },
            zhform: {
                xjje: 0,
                ylje: 0,
                zfbje: 0,
                wxje: 0,
            },
            listfees: [],
            Advancepayment_list: [],
            list: [],
            mis_amount: 0,
            jiesuan: {
                mis_amount: 0,
                zje: 0,
                yf: 0,
                ybfdje: 0,
                brfdje: 0,
                sydgrzhzf: 0,
                zfje: 0,
                grzhzf: 0,
                gjzhzf: 0,
                zhye: 0,
                gjzhye: 0,
                zhje: 0,
                his_amount: {
                    in_prepay: 0,
                },
            },
            loginForm: {
                username: '',
                password: '',
                is_keeplogin: true,
                code: '',
                key: '',
                token: '',
            },
            ybkmiss: {},
            tuifeilist: [],
            banlist: {},
            seemodel: '', // 是否显示按钮
            infor: [], //自付比例数组
            showEditProp: false, //详情蒙层
            currentData: {}, //当前选中行数据-右侧
            loadingRight: false, //右侧结算按钮点击加载中
            // retryparamdata:{}
            tuishow: '',
            disablebtn: false,
            jshid: '',
        }
    },
    created() {
        this.getQueryString('token')
        // this.allin()
        this.preSettlementGetPatientInfo()
        // this.banksocketInit()
        // this.ws = new WebSocket('ws://127.0.0.1:9000/')
    },
    watch: {
        //开始监听返回该对象属性值计算属性
        infoa: function (newVal, oldVal) {
            if (this.round(this.round(this.jiesuan.brfdje - newVal, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) + this.jiesuan.gjzhzf * 1, 2), 2) > 0) {
                this.zhje = 0
                this.form.zfje = this.round(this.round(this.jiesuan.brfdje - newVal, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) + this.jiesuan.gjzhzf * 1, 2), 2)
            }
            if (this.round(this.round(this.jiesuan.brfdje - newVal, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) + this.jiesuan.gjzhzf * 1, 2), 2) < 0) {
                this.form.zfje = 0
                this.zhje = this.round(
                    this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) + this.jiesuan.gjzhzf * 1, 2),
                    2,
                )
            }
            if (
                this.round(
                    this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) + this.jiesuan.gjzhzf * 1, 2),
                    2,
                ) == 0
            ) {
                this.zhje = 0
                this.form.zfje = 0
            }
        },
    },
    mounted() {
        // this.banksocketInit()
        this.socketInit()
    },
    computed: {
        infoa() {
            return this.jiesuan.his_amount.in_prepay
        },
        dialogFormVisible: {
            get() {
                return this.visible
            },
            set(val) {
                this.$emit('update:visible', val)
            },
        },
    },
    methods: {
        firstblod() {
            blood({
                jshid: this.jshid,
            }).then(response => {
                this.blod_data = response.data
                this.blod_data.ybblod = this.round(this.blod_data.blood_zje - this.blod_data.blood_amount, 2)
                this.jiesuan.brfdje = response.data.brfdje
                this.zhje = this.round(
                    this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) + this.jiesuan.gjzhzf * 1, 2),
                    2,
                )
                this.sprice_show = true
                console.log(this.blod_data, '+++++++++++++++')
            })
        },
        retryparams() {
            retry_params({
                his_inpatient_no: this.idcard,
            }).then(response => {
                this.retryparamdata = response.data
                this.tuishow = response.data.params.status
                this.jshid = response.data.params.jshid
                if (response.data.params.blood_status) {
                    this.blodshow = true
                }
                if (response.data.retry == true) {
                    this.$alert(
                        '<b style="color:red">此患者曾经进行过出院结算，但是没有成功。</b><br>当前页面上的个人账户余额和共济账户余额是出院失败时的余额，<span style="color:red">并不是该患者现在的真实余额。</span>直接点击出院即可！',
                        '请注意',
                        {
                            confirmButtonText: '确定',
                            dangerouslyUseHTMLString: true,
                        },
                    )
                    this.jiesuan.grzhzf = response.data.params.grzhzf
                    this.jiesuan.zje = response.data.params.zje
                    this.jiesuan.brfdje = response.data.params.brfdje
                    this.jiesuan.ybfdje = response.data.params.ybfdje
                    this.mis_amount = response.data.params.mis_amount
                    this.jiesuan.gjzhzf = response.data.params.gjzhzf
                    this.jiesuan.sydgrzhzf = response.data.params.sydgrzhzf
                    this.jiesuan.his_amount.in_prepay = response.data.params.in_prepay
                    this.jiesuan.gjzhye = response.data.params.gjzhye
                    this.jiesuan.zhye = response.data.params.zhye
                    this.yibaodata.cache_uuid = 'not'
                    this.typeinfo.des = response.data.params.patient.p_zlfs
                    this.typeinfo.hosp = response.data.params.patient.p_cyfs
                    this.typeinfo.sytc = response.data.params.patient.p_sytc
                    this.typeinfo.fmfs = response.data.params.patient.p_fmfs
                    this.jiesuan.id = response.data.params.pre_id
                    this.jiesuan.yf = this.round(this.jiesuan.zje - this.jiesuan.his_amount.in_prepay, 2)
                    if (response.data.ewm == true) {
                        this.patientform.channel = 'local'
                        this.yibaodata.card_type = 'YBEWM'
                        this.open_ewm = true
                    }
                } else {
                    if (response.data.params.status != 'SUCCESS') {
                        this.mis_amount = response.data.params.mis_amount
                    } else {
                        //当已出院状态在此进入结算退款时判断是否可以修改
                        this.jiesuan.grzhzf = response.data.params.grzhzf
                        this.mis_amount = response.data.params.mis_amount
                        this.jiesuan.zje = response.data.params.zje
                        this.jiesuan.brfdje = response.data.params.brfdje
                        this.jiesuan.ybfdje = response.data.params.ybfdje
                        this.mis_amount = response.data.params.mis_amount
                        this.jiesuan.gjzhzf = response.data.params.gjzhzf
                        this.jiesuan.sydgrzhzf = response.data.params.sydgrzhzf
                        this.jiesuan.his_amount.in_prepay = response.data.params.in_prepay
                        this.jiesuan.gjzhye = response.data.params.gjzhye
                        this.jiesuan.zhye = response.data.params.zhye
                        this.yibaodata.cache_uuid = 'not'
                        this.typeinfo.des = response.data.params.patient.p_zlfs
                        this.typeinfo.hosp = response.data.params.patient.p_cyfs
                        this.typeinfo.sytc = response.data.params.patient.p_sytc
                        this.typeinfo.fmfs = response.data.params.patient.p_fmfs
                        this.jiesuan.id = response.data.params.pre_id
                        this.jiesuan.yf = this.round(this.jiesuan.zje - this.jiesuan.his_amount.in_prepay, 2)
                        if (response.data.params.status == 'SUCCESS') {
                            this.disablebtn = true
                        }
                    }

                    // this.zhje=response.data.params
                }
            })
        },
        feiyong(tab, event) {
            if (tab.name == 'three') {
                this.getList3()
            }
        },
        prefree(e) {
            zy_mis({
                his_inpatient_no: this.idcard,
                amount: e.amount,
                mis_data: {
                    bankCardNo: e.bank_data.bankCardNo,
                    bankTradeNo: e.bank_data.bankTradeNo,
                    referNo: e.bank_data.referNo,
                },
                type: 'PRE_REFUND',
            }).then(response => {
                get_serial_number({
                    type: 'MIS',
                })
                    .then(response => {
                        this.mis_amount = response.data.mis_amount
                        const _this = this
                        let x =
                            'Trans&15|00|' +
                            e.amount +
                            '|' +
                            e.bank_data.bankCardNo +
                            '|' +
                            e.bank_data.referNo +
                            '||' +
                            e.bank_data.tradeTime +
                            '|{"patientInfo":{"patientId":"' +
                            _this.patientform.patientId +
                            '","patientName":"' +
                            _this.patientform.name +
                            '","cardNo":"' +
                            _this.patientform.idCard +
                            '","accountType":"02","visitId":"","ywlx":"REFUND","transType":"social","cardType":"01","source":"窗口住院医保卡退款","operatorId":"' +
                            localStorage.getItem('userbh') +
                            '","operatorName":"' +
                            localStorage.getItem('usernames') +
                            '","orderId":"' +
                            response.data.value +
                            '","id_card_no":"' +
                            _this.patientform.idCard +
                            '"}}'
                        this.resorderID = response.data.value
                        var wsImpl = window.WebSocket || window.MozWebSocket
                        _this.ws = new wsImpl('ws://127.0.0.1:50000/')
                        _this.ws.onopen = function () {
                            _this.ws.send(x)
                        }
                        _this.ws.onmessage = _this.YBKerrormessage
                        _this.ws.onclose = function () {}
                        _this.uploadfeeshow = false
                    })
                    .finally(() => {
                        this.uploadfeeshow = false
                    })
            })
        },
        select_sx() {
            const qypara = {
                search: this.selectvalue,
                cost_type: this.selelist,
                limit: 9999,
                his_inpatient_no: this.patientform.his_inpatient_no,
            }
            feelist(qypara)
                .then(response => {
                    this.total_amount = response.meta.total_amount
                    this.listfees = response.data
                    this.total2 = response.data.total
                })
                .finally(() => {
                    this.loading2 = false
                })
        },
        fapiao() {
            invoice({
                his_inpatient_no: this.idcard,
            })
                .then(response => {
                    window.open(response.data.url)
                })
                .finally(() => {})
        },
        tongchou() {
            window.open(process.env.VUE_APP_BASE_URL + '/invoice/tcd?his_inpatient_no=' + this.idcard)
        },
        cardjiesuan() {
            this.param = {
                p_xzbz: this.patientform.p_xzbz,
                channel: this.patientform.channel,
                p_ewm: this.pingzhengma,
                p_dzpzywm: '301',
                card_type: '01',
                from_web: '1',
            }
            mzxxs(this.param)
                .then(response => {
                    this.dialogFormVisible = false
                    preSettlement({
                        refund_amount: Math.abs(this.zhje),
                        patient_id: this.idcard,
                        is_pre: '0',
                        cache_uuid: response.data.cache_uuid,
                        p_yecssj: '',
                        gjzhzf: this.jiesuan.gjzhzf,
                        grzhzf: this.jiesuan.grzhzf,
                        pre_id: this.jiesuan.id,
                        p_zlfs: this.typeinfo.des,
                        p_cyfs: this.typeinfo.hosp,
                        p_djhz: this.typeinfo.djhz,
                        p_fmfs: this.typeinfo.fmfs,
                        p_jbmc:this.patientform.p_jbmc,
                        p_jbbm:this.patientform.p_jbbm,
                        is_zf: this.patientform.his_patient_type.value == 'ZF' ? '1' : '0',
                    })
                        .then(response => {
                            this.loadingRight = false
                            this.jeizhishow = false
                            this.tuishow = response.data.status.name
                            this.jshid = response.data.jshid
                            this.$alert('出院成功', '出院成功', {
                                confirmButtonText: '确定',
                                callback: action => {
                                    this.$message({
                                        type: 'success',
                                        message: '出院成功',
                                    })
                                },
                            })
                            if (response.data.status.name == 'SUCCESS') {
                                this.disablebtn = true
                            }
                            // this.printcard()
                        })
                        .catch(e => {
                            this.loadingRight = false
                        })
                        .finally(e => {
                            this.loadingRight = false
                        })
                })
                .finally(() => {
                    this.loading = false
                    this.jeizhishow = false
                })
        },
        diseasefun(query) {
            console.log(this.patientform.channel,'oooooooooooooooo')
            if (query !== '') {
                this.loading = true
                setTimeout(() => {
                    this.loading = false
                    disease({
                        keyword: query,
                        is_oil: this.patientform.channel == 'oil' ? '1' : '0',
                    })
                        .then(response => {
                            this.decise = response.data
                        })
                        .finally(() => {})
                }, 200)
            } else {
                this.decise = []
            }
        },
        selectChange(event) {
            let choosenItem = this.decise.filter(item => item.jbmc === event)[0]
            this.patientform.p_jbbm = choosenItem.jbbm
        },
        ybzhifu() {
            // this.form.zfje = this.round(this.round(this.jiesuan.brfdje*1 - this.jiesuan.his_amount.in_prepay*1, 2) - this.round(this.jiesuan.grzhzf * 1 + this.jiesuan.gjzhzf * 1, 2), 2)
            // this.jiesuan.yf = this.round(this.jiesuan.zje - this.jiesuan.his_amount.in_prepay, 2)
            // if (this.round(this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.jiesuan.grzhzf - this.jiesuan.gjzhzf, 2), 2) > 0) {
            //     this.form.zfje = this.round(this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.jiesuan.grzhzf - this.jiesuan.gjzhzf, 2), 2)
            //     this.zhje = 0
            // }
            // if (this.round(this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.jiesuan.grzhzf * 1 - this.jiesuan.gjzhzf * 1, 2), 2) < 0) {
            //     this.zhje = this.round(this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.jiesuan.grzhzf * 1 - this.jiesuan.gjzhzf * 1, 2), 2)
            //     this.form.zfje = 0
            // }
            // if (this.round(this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.jiesuan.grzhzf * 1 - this.jiesuan.gjzhzf * 1, 2), 2) == 0) {
            //     this.zhje = 0
            //     this.form.zfje = 0
            // }
            if (
                this.round(
                    this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) + this.jiesuan.gjzhzf * 1, 2),
                    2,
                ) > 0
            ) {
                this.zhje = 0
                this.form.zfje = this.round(
                    this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) + this.jiesuan.gjzhzf * 1, 2),
                    2,
                )
            }
            if (
                this.round(
                    this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) + this.jiesuan.gjzhzf * 1, 2),
                    2,
                ) < 0
            ) {
                this.form.zfje = 0
                this.zhje = this.round(
                    this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) + this.jiesuan.gjzhzf * 1, 2),
                    2,
                )
            }
            if (
                this.round(
                    this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) + this.jiesuan.gjzhzf * 1, 2),
                    2,
                ) == 0
            ) {
                this.zhje = 0
                this.form.zfje = 0
            }
        },
        gjzhifu() {
            // this.zhje = this.round(this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.jiesuan.grzhzf * 1 + this.jiesuan.gjzhzf * 1, 2), 2)
            if (
                this.round(
                    this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) + this.jiesuan.gjzhzf * 1, 2),
                    2,
                ) > 0
            ) {
                this.zhje = 0
                this.form.zfje = this.round(
                    this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) + this.jiesuan.gjzhzf * 1, 2),
                    2,
                )
            }
            if (
                this.round(
                    this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) + this.jiesuan.gjzhzf * 1, 2),
                    2,
                ) < 0
            ) {
                this.form.zfje = 0
                this.zhje = this.round(
                    this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) + this.jiesuan.gjzhzf * 1, 2),
                    2,
                )
            }
            if (
                this.round(
                    this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) + this.jiesuan.gjzhzf * 1, 2),
                    2,
                ) == 0
            ) {
                this.zhje = 0
                this.form.zfje = 0
            }
        },
        selectshaixuan(e) {
            this.selelist = e
            this.listfees = []
            const qypara = {
                search: this.selectvalue,
                cost_type: e,
                limit: 9999,
                his_inpatient_no: this.patientform.his_inpatient_no,
            }
            feelist(qypara)
                .then(response => {
                    this.total_amount = response.meta.total_amount
                    this.listfees = response.data
                    this.total2 = response.data.total
                })
                .finally(() => {
                    this.loading2 = false
                })
        },
           // 复制文本内容方法一
           copy (content) {
    var copyCon = document.getElementById("IDcard").innerHTML;
    // 复制结果
    let copyResult = true
    // 设置想要复制的文本内容
    const text = copyCon
    // 判断是否支持clipboard方式
    if (!!window.navigator.clipboard) {
      // 利用clipboard将文本写入剪贴板（这是一个异步promise）
      window.navigator.clipboard.writeText(text).then((res) => {
        console.log('复制成功');
        this.$message({
          message: '复制成功！',
          type: 'success'
        });
        // 返回复制操作的最终结果
        return copyResult;
      }).catch((err) => {
        console.log('复制失败--采取第二种复制方案', err);
        // clipboard方式复制失败 则采用document.execCommand()方式进行尝试
        copyContent2(text)
      })
    } else {
      // 不支持clipboard方式 则采用document.execCommand()方式
      copyContent2(text)
    }
  },
  // 复制文本内容方法二
   copyContent2 (content) {
      // 复制结果
      let copyResult = true
      // 创建一个input元素
      let inputDom = document.createElement('textarea');
      // 设置为只读 防止移动端手机上弹出软键盘
      inputDom.setAttribute('readonly', 'readonly');
      // 给input元素赋值
      inputDom.value = text;
      // 将创建的input添加到body
      document.body.appendChild(inputDom);
      // 选中input元素的内容
      inputDom.select();
      // 执行浏览器复制命令
      // 复制命令会将当前选中的内容复制到剪切板中（这里就是创建的input标签中的内容）
      // Input要在正常的编辑状态下原生复制方法才会生效
      const result = document.execCommand('copy')
      // 判断是否复制成功
      if (result) {
        console.log('复制成功');
        this.$message({
          message: '复制成功！',
          type: 'success'
        });
      } else {
        console.log('复制失败');
        copyResult = false
      }
      // 复制操作后再将构造的标签 移除
      document.body.removeChild(inputDom);
      // 返回复制操作的最终结果
      return copyResult;
  },
        Match() {
            this.loading2 = true
            if (this.patientform.p_rqlb != 'A' && this.patientform.p_rqlb != 'B') {
                this.$message.error('该患者未登记人群类别，请先进行登记！')
                return false
            }
            this.listfees.forEach((element, index) => {
                zfbl({
                    is_self: this.patientform.his_patient_type.value == 'ZF' ? '1' : '0',
                    yyxmbm: element.yyxmbm,
                    rqlb: this.patientform.p_rqlb,
                    id: element.id,
                    fyfssj: element.fysfsj,
                    channel: this.patientform.channel,
                })
                    .then(response => {
                        if (response.data.length == 1 && element.sxzfbl * 1 < 0) {
                            element.sxzfbl = response.data[0].zfbl
                            this.resave(element.id, element.sxzfbl)
                        }
                        if (response.data.length > 1) {
                            element.many = '1'
                        }
                        if (index == this.listfees.length - 1) {
                            this.loading2 = false
                            this.$message({
                                message: '匹配成功',
                                type: 'success',
                            })
                        }
                    })

                    .finally(() => {
                        this.loading = false
                    })
            })
        },
        regetfree() {
            this.loading2 = true
            prereturn({
                his_inpatient_no: this.idcard,
                upload: '0',
                download: '1',
                time: 'all',
            })
                .then(response => {
                    this.getList2()
                })
                .finally(() => {})
        },
        //打印
        printcard() {
            const _this = this
            printmis({
                jshid: this.jiesuan.jshid,
                is_zy: '1',
            })
                .then(response => {
                    this.$message({
                        message: response.message,
                        type: 'success',
                    })
                    let time = new Date()
                    let nowTime = time.toLocaleString('sv-SE')
                    let user =
                        `<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<style>
		* {padding: 0px;margin: 0px;}
		.feiyong {font-size: 18px;display: flex;justify-content: space-between;}
		.zhong {text-align: center;}
	</style><body>
        <div style=" width: 270px;">
            <div style="display:` +
                        display +
                        `">
				<div class="zhong"><b style="font-size: 22px;">东营市人民医院</b></div>
				<div class="zhong"><b style="font-size: 22px;">门诊取药窗口</b></div>
				<div class="zhong"><span style="font-size: 22px;">姓名：` +
                        response.data.brxm +
                        `</span></div>
				<div class="zhong"><b style="font-size: 22px;">打印时间：` +
                        nowTime +
                        `</b></div>
				<div class="zhong"><span style="font-size: 22px;">` +
                        response.data.drug_window_name +
                        `取药窗口号</span></div>
				<div class="zhong"><b style="font-size: 50px;">` +
                        response.data.drug_window +
                        `</b></div>
			</div></div><div style=" width: 270px;margin-top: 50px;">
			<div class="zhong"><b style="font-size: 22px;">东营市人民医院</b></div>
			<div class="zhong"><b style="font-size: 22px;">住院结算电子票据指引单</b></div>
			<div class="zhong" style="margin-top: -5px;"><span>———————————————</span></div>
			<div style="margin-top: -5px;">
				<div style="display: flex; justify-content: space-between;">
					<div><span>姓名:</span><span>` +
                        response.data.brxm +
                        `</span></div></div>
				<div style="display: flex; justify-content: space-between;">

					<div><span>性别:</span><span>` +
                        response.data.brxb +
                        `</span></div>
					<div><span>患者类型</span>:</span><span>` +
                        response.data.brxz +
                        `</span></div>
				</div>
				<span>票据代码:</span><span>` +
                        response.data.placecode +
                        `</span><br>
				<span>票据号码:</span><span>` +
                        response.data.billno +
                        `</span><br>
                <span>校验码:</span><span>` +
                        response.data.random +
                        `</span><br>
			</div>
			<div class="zhong"><span>----------------------------------</span></div>
			<div style="display: flex;">
				<div style="width: 50%;">
					<span>微信退款：</span><span>` +
                        response.data.zjje +
                        `</span><br>
                    <span>支付宝退款：</span><span>` +
                        response.data.zjje +
                        `</span><br>
					<span>费用合计：</span><span>` +
                        response.data.zjje +
                        `</span><br>
					<span>医保个账：</span><span>` +
                        response.data.grzhzf +
                        `</span><br>
					<span>账户余额：</span><span>` +
                        response.data.grzhye +
                        `</span><br>
					<span>医疗减免：</span><span>` +
                        response.data.yljmje +
                        `</span><br>
					<span>病人负担：</span><span>` +
                        response.data.brfdje +
                        `</span><br>
					<span>院内扣款：</span><span>` +
                        response.data.hisykt +
                        `</span><br>
					<span>医院担负：</span><span>` +
                        response.data.yyfdje +
                        `</span><br>
                    <span>本次起付线：</span><span>` +
                        response.data.bcqfx +
                        `</span><br>

				</div>
				<div>
                    <span>现金退款：</span><span>` +
                        response.data.zjje +
                        `</span><br>
                    <span>银行卡退款：</span><span>` +
                        response.data.zjje +
                        `</span><br>
					<span>开票人：</span><span>` +
                        response.data.czgh +
                        `</span><br>
					<span>统筹支付：</span><span>` +
                        response.data.ybzfje +
                        `</span><br>
					<span>共济金额：</span><span>` +
                        response.data.gjzhxf +
                        `</span><br>
					<span>现金金额：</span><span>` +
                        response.data.xjje +
                        `</span><br>
					<span>累计个人：</span><span>` +
                        response.data.ljgrzf +
                        `</span><br>
					<span>累计统筹：</span><span>` +
                        response.data.ljtczf +
                        `</span><br>
					<span>累计起付线：</span><span>` +
                        response.data.ljqfx +
                        `</span><br>
				</div>
			</div>
			<div><span>结算类型：</span><span>` +
                        response.data.ybjislx +
                        `</span><br></div>
			<div><span>收费日期：</span><span>` +
                        response.data.sfrq +
                        `</span></div>
			<div><span>打印日期：</span><span>` +
                        nowTime +
                        `</span></div>
			<div class="zhong"><span>----------------------------------</span></div>
			<div class="zhong">
				<img src="data:image/png;base64, " alt="" width="100" style="margin-right: 10px;">
				<img src="data:image/png;base64,` +
                        response.data.qr_code +
                        `" alt="" width="100">
			</div>
			<div>
				<span>(一)扫描上方右边发票领取二维码</span><br>
				<span>(二)扫描上方左边微信小程序二维码查看领取,领取后查看路径:(微信)我卡包-票证-发票</span><br>
				<span>(三)登录财政查验网站查询，网址如下http://pjcy.sdcz.gov.cn/billcheck/</span><br>
				<!-- <span>本院已实行电子发票，如需正式发票，请五分钟后进入微信“扫一扫”，扫描上方二维码，“领取票据-完成-保存至微信卡包”</span> -->
			</div></div></body></html>`
                    printProof(user)
                })
                .finally(() => {})
        },
        //银行退款
        async tuibank(e) {
            return new Promise((resolve, reject) => {
                ;(this.bank_record_id = ''), (this.banlist = e)
                let dates = e.trade_time.split(' ')[0].replace(/-/g, '')
                const _this = this
                //预退款
                // await
                refund({
                    jshid: this.jshid,
                    his_in_prepay: this.jiesuan.his_amount.in_prepay,
                    payment_type: this.banlist.chequeName,
                    old_amount: this.banlist.amount,
                    refund_amount: this.banlist.couldRefundAmount,
                    his_inpatient_no: this.patientform.his_inpatient_no,
                    patient_name: this.patientform.p_xm,
                    non_preliminary: false,
                    out_charge_no: this.banlist.outTradeNo,
                })
                    .then(response => {
                        this.bank_record_id = response.data.bank_record_id
                        // this.tuikuanloading = false
                        this.jiesuan.his_amount.in_prepay = response.data.in_prepay
                        if (response.data.status == true) {
                            let x =
                                'Trans&15|00|' +
                                e.couldRefundAmount +
                                '|' +
                                e.bk_card_no +
                                '|' +
                                e.ck_no +
                                '||' +
                                dates +
                                '|{"patientInfo":{"patientId":"' +
                                _this.patientform.his_inpatient_no +
                                '","patientName":"' +
                                _this.patientform.p_xm +
                                '","cardNo":"' +
                                _this.patientform.p_grbh +
                                '","accountType":"02","visitId":"","ywlx":"REFUND","transType":"bank","cardType":"01","source":"窗口住院银行卡退款","operatorId":"' +
                                localStorage.getItem('userbh') +
                                '","operatorName":"' +
                                localStorage.getItem('usernames') +
                                '","orderId":"' +
                                e.outTradeNo +
                                '"}}'
                            setTimeout(() => {
                                this.fullscreenLoading = false
                            }, 2000)
                            var wsImpl = window.WebSocket || window.MozWebSocket
                            _this.ws = new wsImpl('ws://127.0.0.1:50000/')
                            _this.ws.onopen = function () {
                                _this.ws.send(x)
                            }
                            // _this.ws.onmessage = this.refundMessage
                            _this.ws.onmessage = function (evt) {
                                _this.tuikuanloading = false
                                const ret = JSON.parse(evt.data)
                                if (ret && ret.TrandeCode == '00') {
                                    _this.banlist.ck_no = ret.TradeRef
                                    _this.banlist.bank_flow_no = ret.TraceNo
                                    _this.tkall()
                                    _this.deletefree = false
                                    _this.$message({
                                        message: ret.TrandeMsg,
                                        type: 'success',
                                    })
                                    resolve(true)
                                } else {
                                    _this.tuikuanloading = false
                                    _this.$message({
                                        message: ret.TrandeMsg,
                                        type: 'error',
                                    })
                                    resolve(true)
                                }
                            }
                            _this.ws.onclose = function () {}
                            _this.uploadfeeshow = false
                        } else {
                            this.$notify({
                                title: '提示',
                                message: response.data.message,
                                duration: 0,
                            })
                            this.tuikuanloading = false
                        }
                    })
                    .finally(() => {})
            })
        },
        //退款方法
        async tkall(e) {
            // if (e) {
            //     await refund({
            //         jshid: this.jshid,
            //         his_in_prepay: this.jiesuan.his_amount.in_prepay,
            //         payment_type: e.chequeName,
            //         old_amount: e.amount,
            //         refund_amount: e.couldRefundAmount,
            //         his_inpatient_no: this.patientform.his_inpatient_no,
            //         out_charge_no: e.outTradeNo,
            //         bk_card_no: e.bk_card_no,
            //         patient_name: this.patientform.p_xm,
            //     })
            //         .then(response => {
            //             this.tuikuanloading = false
            //             this.jiesuan.his_amount.in_prepay = response.data.in_prepay
            //             if (response.data.status == true) {
            //                 this.$message({
            //                     message: response.message,
            //                     type: 'success',
            //                 })
            //             } else {
            //                 this.$notify({
            //                     title: '提示',
            //                     message: response.data.message,
            //                     duration: 0,
            //                 })
            //             }
            //         })
            //         .finally(() => {})
            // } else {
            await refund({
                jshid: this.jshid,
                his_in_prepay: this.jiesuan.his_amount.in_prepay,
                payment_type: this.banlist.chequeName,
                old_amount: this.banlist.amount,
                refund_amount: this.banlist.couldRefundAmount,
                his_inpatient_no: this.patientform.his_inpatient_no,
                out_charge_no: this.banlist.outTradeNo,
                bk_card_no: this.banlist.bk_card_no,
                patient_name: this.patientform.p_xm,
                mis_rs_no: this.banlist.ck_no,
                mis_flow_no: this.banlist.bank_flow_no,
                non_preliminary: true,
                bank_record_id: this.bank_record_id,
            })
                .then(response => {
                    this.tuikuanloading = false
                    // this.jiesuan.his_amount.in_prepay = response.data.in_prepay
                    if (response.data.status == 'true') {
                        this.$message({
                            message: response.message,
                            type: 'success',
                        })
                    } else {
                        this.$notify({
                            title: '提示',
                            message: response.data.message,
                            duration: 0,
                        })
                        this.tuikuanloading = false
                    }
                })
                .finally(() => {
                    this.tuikuanloading = false
                })
            // }
        },
        //弹窗确定退款
        async tuikuansure() {
            this.tuikuanshow = true
            var _this = this
            this.tuikuanloading = true
            // for (const iterator of this.tuifeilist) {
            //     const element = iterator
            // }
            for (let index = 0; index < this.tuifeilist.length; index++) {
                const element = this.tuifeilist[index]
                //银行卡
                if (element.chequeName == 'BANK') {
                    await _this.tuibank(element)
                } else {
                    //微信/支付宝/现金
                    // _this. tkall(element)
                    await refund({
                        jshid: this.jshid,
                        his_in_prepay: this.jiesuan.his_amount.in_prepay,
                        payment_type: element.chequeName,
                        old_amount: element.amount,
                        refund_amount: element.couldRefundAmount,
                        his_inpatient_no: this.patientform.his_inpatient_no,
                        out_charge_no: element.outTradeNo,
                        bk_card_no: element.bk_card_no,
                        patient_name: this.patientform.p_xm,
                    })
                        .then(response => {
                            this.tuikuanloading = false
                            this.jiesuan.his_amount.in_prepay = response.data.in_prepay
                            if (response.data.status == true) {
                                this.$message({
                                    message: response.message,
                                    type: 'success',
                                })

                                this.deletefree = false
                            } else {
                                this.$notify({
                                    title: '提示',
                                    message: response.data.message,
                                    duration: 0,
                                })
                                this.tuikuanshow = false
                            }
                        })
                        .finally(() => {})
                }
            }
            // this.tuifeilist.forEach((element,index) => {

            //     // if (index== this.tuifeilist-1) {
            //       this.deletefree=false
            //     // }
            //     setTimeout(function ()  {
            //          //银行卡
            //     if (element.chequeName == 'BANK') {
            //         _this.tuibank(element)
            //     } else {
            //         //微信/支付宝/现金
            //         _this. tkall(element)

            //     }
            //     }, 2000);
            // })
        },
        //退款
        refundMessage(evt) {
            this.tuikuanloading = false
            const ret = JSON.parse(evt.data)
            if (ret && ret.TrandeCode == '00') {
                this.deletefree = false
                this.$message({
                    message: ret.TrandeMsg,
                    type: 'success',
                })
                this.banlist.ck_no = ret.TradeRef
                this.banlist.bank_flow_no = ret.TraceNo
                this.tkall()
                resolve()
            } else {
                this.$message({
                    message: ret.TrandeMsg,
                    type: 'error',
                })
                this.tuikuanloading = false
                resolve()
            }
        },
        socketInit() {
            this.wj = new WebSocket('ws://127.0.0.1:9000/')
            this.wj.onopen
            let self = this
            this.wj.onmessage = function (evt) {
                let res = JSON.parse(evt.data)
                // 赋值调接口
                if (res.MethodName == 'ReadIDCard' && res.RespCode == 0) {
                    // 身份证读取
                    self.yibaoinfo.cardno = res.RespData.CardId
                    self.getmzxx('1')
                    // self.getmzxx()
                } else if (res.MethodName == 'ReadSSSECard' && res.RespCode == 0) {
                    // 社保卡读取
                    self.yibaoinfo.p_sbm = res.RespData.ksbm
                    self.yibaoinfo.idcard = res.RespData.CardNo
                    self.yibaoinfo.sfzhm = res.RespData.sfzh
                    self.getmzxx('2')
                } else {
                    return false
                }
                // self.getpdxx()
            }
        },
        //mis交易
        get_serial_numbers(e) {
            get_serial_number({
                type: 'MIS',
            })
                .then(response => {
                    const _this = this
                    this.mistype = e
                    var input = this.form.zfje
                    //0门诊
                    let x =
                        'Trans&00|00|' +
                        input +
                        '|||||{"patientInfo":{"patientId":"' +
                        this.patientform.his_inpatient_no +
                        '","patientName":"' +
                        this.patientform.p_xm +
                        '","cardNo":"' +
                        this.patientform.p_grbh +
                        '","accountType":"03","visitId":"","ywlx":"SUCCESS","transType":"bank","cardType":"01","source":"窗口住院银行卡充值","operatorId":"' +
                        localStorage.getItem('userbh') +
                        '","operatorName":"' +
                        localStorage.getItem('usernames') +
                        '","orderId":"' +
                        response.data.value +
                        '"}}'
                    this.resorderID = response.data.value
                    get_serial_number({
                            type: 'MIS',
                            value: x,
                            valtp:'zy_ylmiss'
                        }).then(response => {})
                    var wsImpl = window.WebSocket || window.MozWebSocket
                    _this.ws = new wsImpl('ws://127.0.0.1:50000/')
                    _this.ws.onopen = function () {
                        _this.ws.send(x)
                    }
                    _this.ws.onmessage = this.bankMessage

                    _this.ws.onclose = function () {}
                })
                .finally(() => {
                    this.uploadfeeshow = false
                })
        },
        //银行卡交易
        bankMessage(evt) {
            const ret = JSON.parse(evt.data)
            if (ret && ret.TrandeCode == '00') {
                freemoney({
                    bank_card: ret.BankNo,
                    payment_type: 'MIS_BANK',
                    amount: this.form.zfje,
                    auth_code: 'null',
                    his_patient_id: this.patientform.his_patient_id,
                    patient_type: 'zy',
                    mis_no: this.resorderID,
                    mis_rs_no: ret.TradeRef,
                    mis_flow_no: ret.TraceNo,
                    his_inpatient_no: this.jiesuan.his_inpatient_no,
                })
                    .then(response => {
                        this.loadingRight = false
                        this.form.zfje = 0
                        this.uploadfeeshow = false
                        this.jiesuan.his_amount.in_prepay = response.data.his_in_prepay
                        // this.leavehospital('1') // 调取出院接口
                        this.leavehospitalFun()
                    })
                    .catch(e => {
                        this.loadingRight = false
                    })
                    .finally(e => {
                        this.loadingRight = false
                    })
            } else {
                if (this.banlist != {}) {
                    this.$message.error('银行卡交易失败！')
                }
                this.loadingRight = false
            }
            this.fullscreenLoading = false
            this.jfloadshow=false
        },
        //退款方法
        // refundMess() {
        //     const ret = JSON.parse(evt.data)
        //     if (ret && ret.TrandeCode == '00') {
        //         this.$message({
        //             message: ret.TrandeMsg,
        //             type: 'success',
        //         })
        //         this.fullscreenLoading = false
        //     } else {
        //         this.$message({
        //             message: ret.TrandeMsg,
        //             type: 'error',
        //         })
        //         this.fullscreenLoading = false
        //         this.dialogVisible = false
        //     }
        // },
        //mis交易
        get_serial_number_yb(e) {
            //预刷mis通知
            zy_mis({
                his_inpatient_no: this.idcard,
                amount: this.jiesuan.grzhzf,
                mis_data: {
                    bankCardNo: '',
                    bankTradeNo: '',
                    referNo: '',
                },
                type: 'PRE_RECHARGE',
            }).then(response => {
                //获取流水号
                get_serial_number({
                    type: 'MIS',
                })
                    .then(response => {
                        const _this = this
                        this.mistype = e
                        var input = this.jiesuan.grzhzf
                        //0门诊
                        let x =
                            'Trans&07|01|' +
                            input +
                            '|||||{"patientInfo":{"patientId":"' +
                            this.patientform.his_inpatient_no +
                            '","patientName":"' +
                            this.patientform.p_xm +
                            '","cardNo":"' +
                            this.patientform.p_grbh +
                            '","accountType":"02","visitId":"","ywlx":"SUCCESS","transType":"social","cardType":"01","source":"窗口住院医保卡消费","operatorId":"' +
                            localStorage.getItem('userbh') +
                            '","operatorName":"' +
                            localStorage.getItem('usernames') +
                            '","orderId":"' +
                            response.data.value +
                            '"}}'
                        this.resorderID = response.data.value
                        get_serial_number({
                            type: 'MIS',
                            value: x,
                            valtp:'zy_ybmiss'
                        }).then(response => {})
                        var wsImpl = window.WebSocket || window.MozWebSocket
                        _this.ws = new wsImpl('ws://127.0.0.1:50000/')
                        _this.ws.onopen = function () {
                            _this.ws.send(x)
                        }
                        _this.ws.onmessage = this.yibaoCard

                        _this.ws.onclose = function () {}
                    })
                    .finally(() => {
                        this.uploadfeeshow = false
                    })
            })
        },
        //医保卡
        yibaoCard(evt) {
            const ret = JSON.parse(evt.data)
            if (ret && ret.TrandeCode == '00') {
                // this.leavehospital('1') // 调取出院接口
                //通知mis消费成功
                zy_mis({
                    his_inpatient_no: this.idcard,
                    amount: this.jiesuan.grzhzf,
                    mis_data: {
                        bankCardNo: ret.BankNo,
                        bankTradeNo: ret.TraceNo,
                        referNo: ret.TradeRef,
                        order_no: this.resorderID,
                    },
                    type: 'RECHARGE',
                }).then(response => {
                    this.ybkmiss = ret
                    this.jiesuan.grzhzf = 0
                    this.mis_amount = response.data.mis_amount
                    this.lsatlave(ret)
                })
            } else {
                this.$message({
                    message: ret.TrandeMsg,
                    type: 'error',
                })
            }
        },
        lsatlave(e) {
            preSettlement({
                refund_amount: Math.abs(this.zhje),
                patient_id: this.idcard,
                is_pre: '0',
                cache_uuid: this.yibaodata.cache_uuid,
                p_yecssj: '',
                gjzhzf: this.jiesuan.gjzhzf,
                grzhzf: this.jiesuan.grzhzf,
                pre_id: this.jiesuan.id,
                p_zlfs: this.typeinfo.des,
                p_cyfs: this.typeinfo.hosp,
                p_djhz: this.typeinfo.djhz,
                p_fmfs: this.typeinfo.fmfs,
                p_jbmc:this.patientform.p_jbmc,
                p_jbbm:this.patientform.p_jbbm,
                is_zf: this.patientform.his_patient_type.value == 'ZF' ? '1' : '0',
                mis_rs_no: e.TradeRef,
                mis_no: this.resorderID,
            })
                .then(response => {
                    this.loadingRight = false
                    this.tuishow = response.data.status.name
                    this.jshid = response.data.jshid
                    console.log(this.tuishow, this.zhje * 1, this.zhje * 1 < 0 && this.tuishow == 'SUCCESS', '显示退款按钮')
                    this.$alert('出院成功', '出院成功', {
                        confirmButtonText: '确定',
                        callback: action => {
                            this.$message({
                                type: 'success',
                                message: '出院成功',
                            })
                        },
                    })
                    if (response.data.status.name == 'SUCCESS') {
                        this.disablebtn = true
                    }
                    // this.printcard()
                })
                .catch(e => {
                    this.loadingRight = false
                })
            //     .catch(e => {
            //         const _this = this
            // let x =
            //     'Trans&15|00|' +
            //     +_this.ybkmiss.Amount +
            //     '|' + _this.ybkmiss.BankNo + '|' + _this.ybkmiss.TradeRef + '||' + _this.ybkmiss.TradeDate + '|{"patientInfo":{"patientId":"' +
            //     _this.patientform.patientId +
            //     '","patientName":"' +
            //     _this.patientform.name +
            //     '","cardNo":"' +
            //     _this.patientform.idCard +
            //     '","accountType":"02","visitId":"","ywlx":"REFUND","transType":"social","cardType":"01","source":"00","operatorId":"'
            //     + localStorage.getItem('usernames') +
            //     '","operatorName":"'
            //     + localStorage.getItem('userbh') +
            //     '","orderId":"' +
            //     _this.resorderID +
            //     '","id_card_no":"' +
            //     _this.patientform.idCard +
            //     '"}}'
            // var wsImpl = window.WebSocket || window.MozWebSocket
            // _this.ws = new wsImpl('ws://127.0.0.1:50000/')
            // _this.ws.onopen = function () {
            //     _this.ws.send(x)
            // }
            // _this.ws.onmessage = _this.YBKerrormessage
            // _this.ws.onclose = function () {}
            // _this.uploadfeeshow = false
            //     })
        },
        YBKerrormessage(evt) {
            //退款结果
            const ret = JSON.parse(evt.data)
            if (ret && ret.TrandeCode == '00') {
                zy_mis({
                    his_inpatient_no: this.idcard,
                    amount: ret.Amount,
                    mis_data: {
                        bankCardNo: ret.BankNo,
                        bankTradeNo: ret.TraceNo,
                        referNo: ret.TradeRef,
                        order_no: this.resorderID,
                    },
                    type: 'REFUND',
                })
                    .then(response => {})
                    .finally(() => {
                        this.$message({
                            message: ret.TrandeMsg,
                            type: 'success',
                        })
                    })
            } else {
                this.$message({
                    message: ret.TrandeMsg,
                    type: 'error',
                })
            }
        },
        //失败展示
        setOnmessageError(evt) {
            const ret = JSON.parse(evt.data)
            if (ret && ret.TrandeCode == '00') {
                this.$message({
                    message: ret.TrandeMsg,
                    type: 'success',
                })
                this.fullscreenLoading = false
            } else {
                this.$message({
                    message: ret.TrandeMsg,
                    type: 'error',
                })
                this.fullscreenLoading = false
                this.dialogVisible = false
            }
        },
        //
        //支付确认
        feesure(e) {
            this.jfloadshow=true
            this.bujiaoloding=false
            this.feeYe(e)
        },
        //交余额
        feeYe(e) {
            var that = this
            var obj = {}
            // if (that.form.zfje <= 0) {
            //     // that.leavehospital() // 调取出院接口
            //     return false
            // }
            if (e == '1') {
                obj = {
                    payment_type: 'WX_BAR',
                    amount: this.form.zfje,
                    auth_code: this.fee.weixin,
                    his_patient_id: this.patientform.his_patient_id,
                    patient_type: 'zy',
                    his_inpatient_no: this.jiesuan.his_inpatient_no,
                }
            } else if (e == '2') {
                var obj = {
                    payment_type: 'ALI_BAR',
                    amount: this.form.zfje,
                    auth_code: this.fee.zhifubao,
                    his_patient_id: this.patientform.his_patient_id,
                    patient_type: 'zy',
                    his_inpatient_no: this.jiesuan.his_inpatient_no,
                }
            } else if (e == '4') {
                obj = {
                    payment_type: 'CASH',
                    amount: this.form.zfje,
                    auth_code: 'not',
                    his_patient_id: this.patientform.his_patient_id,
                    patient_type: 'zy',
                    his_inpatient_no: this.jiesuan.his_inpatient_no,
                }
            }

            if (e != '3') {
                this.loadingRight = true
                freemoney(obj)
                    .then(response => {
                        this.$message({
                            message: response.message,
                            type: 'success',
                        })
                        this.jfloadshow=false
                        this.form.zfje = 0
                        this.uploadfeeshow = false
                        this.jiesuan.his_amount.in_prepay = response.data.his_in_prepay
                        // that.leavehospital('1') // 调取出院接口
                        that.leavehospitalFun()
                    })
                    .finally(() => {
                        this.uploadfeeshow = false
                        this.fullscreenLoading = false
                        this.loadingRight = false
                        this.jfloadshow=false
                    })
            } else {
                //银行卡
                this.loadingRight = true
                this.get_serial_numbers()
            }
        },

        banksocketInit() {
            var wsImpl = window.WebSocket || window.MozWebSocket
            window.wj = new wsImpl('ws://127.0.0.1:50000/')
            wj.onmessage = function (evt) {}
            wj.onopen = function () {}
            wj.onclose = function () {}
        },
        uploadfee() {
            this.bujiaoloding=true
            if (this.feelist.channel == '') {
                this.$message({
                    message: '请选择缴款方式！',
                    type: 'error',
                })
                this.bujiaoloding=false
                return false
            }
            this.uploadfeeshow = true
        },
        //his获取地址token
        getQueryString(name) {
            var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
            var r = window.location.search.substr(1).match(reg)
            if (r != null) {
                this.loginForm.token = unescape(r[2])
                Cookies.set('Admin-Token', unescape(r[2]), {
                    path: '/',
                    SameSite: 'None',
                    Secure: true,
                })
                this.$store.dispatch('Login', this.loginForm)
            }
            return null
        },
        print() {
            this.printVisible = true
        },
        printsure() {
            const _this = this
            printmis({
                jshid: e,
                is_zy: '1',
            })
                .then(response => {
                    this.$message({
                        message: response.message,
                        type: 'success',
                    })
                    let time = new Date()
                    let nowTime = time.toLocaleString('sv-SE')
                    let display = response.data.drug_window == null ? 'none' : ''
                    let user =
                        `<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<style>
		* {padding: 0px;margin: 0px;}
		.feiyong {font-size: 18px;display: flex;justify-content: space-between;}
		.zhong {text-align: center;}
	</style><body>
        <div style=" width: 270px;" >
            <div style="display:` +
                        display +
                        `">
				<div class="zhong"><b style="font-size: 22px;">东营市人民医院</b></div>
				<div class="zhong"><b style="font-size: 22px;">门诊取药窗口</b></div>
				<div class="zhong"><span style="font-size: 22px;">姓名：` +
                        response.data.brxm +
                        `</span></div>
				<div class="zhong"><b style="font-size: 22px;">打印时间：` +
                        nowTime +
                        `</b></div>
				<div class="zhong"><span style="font-size: 22px;">` +
                        response.data.drug_window_name +
                        `取药窗口号</span></div>
				<div class="zhong"><b style="font-size: 50px;">` +
                        response.data.drug_window +
                        `</b></div>
			</div>

            <div style=" width: 270px;margin-top: 50px;">
			<div class="zhong"><b style="font-size: 22px;">东营市人民医院</b></div>
			<div class="zhong"><b style="font-size: 22px;">住院结算电子票据指引单</b></div>
			<div class="zhong" style="margin-top: -5px;"><span>———————————————</span></div>
			<div style="margin-top: -5px;">
				<div style="display: flex; justify-content: space-between;">
					<div><span>姓名:</span><span>` +
                        response.data.brxm +
                        `</span></div></div>
				<div style="display: flex; justify-content: space-between;">

					<div><span>性别:</span><span>` +
                        response.data.brxb +
                        `</span></div>
					<div><span>患者类型</span>:</span><span>` +
                        response.data.brxz +
                        `</span></div>
				</div>
				<span>票据代码:</span><span>` +
                        response.data.placecode +
                        `</span><br>
				<span>票据号码:</span><span>` +
                        response.data.billno +
                        `</span><br>
                <span>校验码:</span><span>` +
                        response.data.random +
                        `</span><br>
			</div>
			<div class="zhong"><span>----------------------------------</span></div>
			<div style="display: flex;">
				<div style="width: 50%;">

					<span>费用合计：</span><span>` +
                        response.data.zjje +
                        `</span><br>
					<span>医保个账：</span><span>` +
                        response.data.grzhzf +
                        `</span><br>
					<span>账户余额：</span><span>` +
                        response.data.grzhye +
                        `</span><br>
					<span>医疗减免：</span><span>` +
                        response.data.yljmje +
                        `</span><br>
					<span>病人负担：</span><span>` +
                        response.data.brfdje +
                        `</span><br>
					<span>院内扣款：</span><span>` +
                        response.data.hisykt +
                        `</span><br>
					<span>医院担负：</span><span>` +
                        response.data.yyfdje +
                        `</span><br>
                    <span>本次起付线：</span><span>` +
                        response.data.bcqfx +
                        `</span><br>

				</div>
				<div>
					<span>开票人：</span><span>` +
                        response.data.czgh +
                        `</span><br>
					<span>统筹支付：</span><span>` +
                        response.data.ybzfje +
                        `</span><br>
					<span>共济金额：</span><span>` +
                        response.data.gjzhxf +
                        `</span><br>
					<span>现金金额：</span><span>` +
                        response.data.xjje +
                        `</span><br>
					<span>累计个人：</span><span>` +
                        response.data.ljgrzf +
                        `</span><br>
					<span>累计统筹：</span><span>` +
                        response.data.ljtczf +
                        `</span><br>
					<span>累计起付线：</span><span>` +
                        response.data.ljqfx +
                        `</span><br>
				</div>
			</div>
			<div><span>结算类型：</span><span>` +
                        response.data.ybjislx +
                        `</span><br></div>
			<div><span>收费日期：</span><span>` +
                        response.data.sfrq +
                        `</span></div>
			<div><span>打印日期：</span><span>` +
                        nowTime +
                        `</span></div>
			<div class="zhong"><span>----------------------------------</span></div>
			<div class="zhong">
				<img src="data:image/png;base64, " alt="" width="100" style="margin-right: 10px;">
				<img src="data:image/png;base64,` +
                        response.data.qr_code +
                        `" alt="" width="100">
			</div>
			<div>
				<span>(一)扫描上方右边发票领取二维码</span><br>
				<span>(二)扫描上方左边微信小程序二维码查看领取,领取后查看路径:(微信)我卡包-票证-发票</span><br>
				<span>(三)登录财政查验网站查询，网址如下http://pjcy.sdcz.gov.cn/billcheck/</span><br>
				<!-- <span>本院已实行电子发票，如需正式发票，请五分钟后进入微信“扫一扫”，扫描上方二维码，“领取票据-完成-保存至微信卡包”</span> -->
			</div>
		</div>
	</body>
</html>
`
                    printProof(user)
                })
                .finally(() => {})
        },
        //费用退款弹窗
        feecancel() {
            this.tuikuanshow = false
            this.tuikuanloading = true
            this.deletefree = true
            tuikuanlist({
                opt: {
                    optInfo: localStorage.getItem('userbh'),
                    // optInfo:'zjjs01'
                },
                patient: {
                    // patientName:'刘前坤',
                    // patientId:'00000015001',
                    // accountType:'02',
                    // refundAmount:"0.01"
                    patientName: this.patientform.p_xm,
                    patientId: this.patientform.his_inpatient_no,
                    accountType: '02',
                    refundAmount: Math.abs(this.zhje),
                },
            })
                .then(response => {
                    if (response.code != 200) {
                        this.$message.error(response.msg)
                    }
                    this.tuifeilist = response.data.refundQueue
                    this.tuikuanloading = false
                })
                .finally(() => {})
        },
        //医保信息查询弹窗显示
        selectcard() {
            if (this.patientform.his_patient_type.value == 'ZF') {
                this.yujiesuanshow = true
                this.prejiesuan()
            } else {
                this.dialogFormVisible = true
            }
        },
        //刷卡获取患者信息
        getyibaoinfo(item) {
            this.yibaodata = item
            this.prejiesuan()
        },
        //页面一进来请求患者信息
        async preSettlementGetPatientInfo() {
            this.gjchick = false
            if (location.search.slice(1) != '') {
                console.log(location.search.slice(1).split('='))
                if (location.search.slice(1).split('=').length == 4 || location.search.slice(1).split('=').length == 3) {
                    this.idcard = location.search.slice(1).split('&')[0]
                    this.idcard = this.idcard.split('=')[1]
                } else {
                    this.idcard = location.search.slice(1)
                }
            }
            await preSettlementGetPatientInfo({
                his_inpatient_no: this.idcard, //身份证号、社保卡号
            })
                .then(response => {
                    this.patientform = response.data
                    this.retryparams()
                    this.getList()
                    this.getList2()
                    this.getList3()
                })
                .finally(() => {})
        },
        //预结算弹窗显示治疗方式内容
        async yutrue() {
            this.loadingRight = false
            this.yujiesuanshow = false
            if (this.gjchick == true) {
                this.param = {
                    p_xzbz: 'C',
                    grbh: this.patientform.p_grbh,
                    yltclb: '0',
                    channel: this.typeinfo.cbd,
                    card_type: '02',
                    from_web: '1',
                }
                await mzxx(this.param)
                    .then(response => {
                        this.yibaodata = response.data
                    })
                    .catch(() => {
                        return false
                    })
            }
            await preSettlement({
                patient_id: this.idcard,
                is_pre: '1',
                cache_uuid: this.yibaodata.cache_uuid,
                p_yecssj: '',
                pre_id: '',
                gjzf: this.gjchick == true ? 1 : 0,
                p_cyfs: this.typeinfo.hosp,
                p_zlfs: this.typeinfo.des,
                p_jbmc:this.patientform.p_jbmc,
                p_jbbm:this.patientform.p_jbbm,
                p_djhz: this.typeinfo.djhz,
                p_fmfs: this.typeinfo.fmfs,
                is_zf: this.patientform.his_patient_type.value == 'ZF' ? '1' : '0',
                // cash_amount: form.xjje,
            })
                .then(response => {
                    // response.data.mis_amount=this.jiesuan.mis_amount
                    this.jiesuan = response.data
                    // this.jiesuan.mis_amount=this.jiesuan.mis_amount
                    this.jiesuan.gjzhzf = 0
                    if (this.patientform.his_patient_type.value != 'YT_ZG' && this.patientform.his_patient_type.value == 'YT_SY') {
                        this.jiesuan.grzhzf = 0
                    }

                    this.jiesuan.yf = this.round(this.jiesuan.zje - this.jiesuan.his_amount.in_prepay, 2)
                    if (
                        this.round(
                            this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) - this.jiesuan.gjzhzf, 2),
                            2,
                        ) > 0
                    ) {
                        this.form.zfje = this.round(
                            this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) - this.jiesuan.gjzhzf, 2),
                            2,
                        )
                    }
                    if (
                        this.round(
                            this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) - this.jiesuan.gjzhzf, 2),
                            2,
                        ) < 0
                    ) {
                        this.zhje = this.round(
                            this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) - this.jiesuan.gjzhzf, 2),
                            2,
                        )
                    }
                    if (
                        this.round(
                            this.round(this.jiesuan.brfdje - this.jiesuan.his_amount.in_prepay, 2) - this.round(this.round(this.jiesuan.grzhzf * 1 + this.mis_amount * 1, 2) - this.jiesuan.gjzhzf, 2),
                            2,
                        ) == 0
                    ) {
                        this.zhje = 0
                        this.form.zfje = 0
                    }
                    this.$message({
                        message: '预结算成功',
                        type: 'success',
                    })
                })
                .finally(() => {})
        },
        //金额计算方法
        round(num, decimals) {
            const factor = Math.pow(10, decimals)
            return Math.round(num * factor) / factor
        },
        //医保结算预结算
        prejiesuan() {
            this.yujiesuanshow = true
            //出院方式
            query_dict({
                type: 'CYFS',
            })
                .then(response => {
                    this.chuyuanlist = response.data
                })
                .finally(() => {})
            //治疗方式
            query_dict({
                type: 'ZLFS',
            })
                .then(response => {
                    this.zhiliaolist = response.data
                })
                .finally(() => {})
            //分娩方式
            if (this.patientform.his_patient_type.value == 'YT_SY') {
                query_dict({
                type: 'FMFS',
                is_oil: '1',
            })
                .then(response => {
                    this.fmfslist = response.data
                })
                .finally(() => {})
            }else{
                query_dict({
                type: 'FMFS',
                is_oil: '0',
            })
                .then(response => {
                    this.fmfslist = response.data
                })
                .finally(() => {})
            }

        },
        //出院接口
        leavehospitalFun() {
            this.loadingRight = true
            // if ( this.form.yf*1 >0) {
            //     this.$message.error('请先充值后出院')
            //     return false
            // }
            //    if (this.yibaodata.cache_uuid=='' ||this.yibaodata.cache_uuid==undefined) {
            //     this.$message.error('请先预结算后出院')
            //     this.loadingRight=false
            //     return false
            //    }
            let inzh = this.round(this.jiesuan.his_amount.in_prepay * 1 + this.jiesuan.grzhzf * 1, 2)
            let ingj = this.round(inzh + this.jiesuan.gjzhzf * 1, 2)
            let zong = this.round(ingj + this.mis_amount * 1, 2)
            if (zong < this.jiesuan.brfdje * 1) {
                this.$message.error('请先充值后出院')
                this.loadingRight = false
                return false
            }
            if (this.patientform.channel == 'local' && this.yibaodata.card_type == 'YBEWM' && this.jiesuan.grzhzf > 0) {
                this.jeizhishow = true
                return false
            }
            if (this.open_ewm) {
                this.jeizhishow = true
                this.open_ewm = false
                return false
            }
            if (this.patientform.channel == 'local' && this.jiesuan.grzhzf > 0 && this.yibaodata.card_type != 'YBEWM') {
                this.get_serial_number_yb()
                return false
            }
            // if (this.yibaodata.card_type=='01') {
            //     this.param = {
            //         channel: 'local',
            //         p_ewm: this.pingzhengma,
            //         p_dzpzywm: '201',
            //         card_type: '01',
            //     }
            //     mzxxs(this.param)
            //         .then(response => {
            //             this.dialogFormVisible = false
            //             preSettlement({
            //     patient_id: this.idcard,
            //     is_pre: '0',
            //     cache_uuid: response.data.cache_uuid,
            //     p_yecssj: '',
            //     gjzhzf: this.jiesuan.gjzhzf,
            //     grzhzf: this.jiesuan.grzhzf,
            //     pre_id: this.jiesuan.id,
            //     p_zlfs: this.typeinfo.des,
            //     p_cyfs: this.typeinfo.hosp,
            //     is_zf: this.patientform.his_patient_type.value == 'ZF' ? '1' : '0',
            // })
            //     .then(response => {
            //         this.$message({
            //             message: '出院成功',
            //             type: 'success',
            //         })
            //         this.printcard()
            //     })
            //     .finally(e => {
            //     })
            //         })
            //         .finally(() => {
            //             this.loading = false
            //         })
            // }
            // else{
            // if(this.typeinfo.des==''|| this.typeinfo.hosp==''){
            //     this.yujiesuanshow=true
            //     this.prejiesuan()
            //     return false
            // }
            let index = {
                gjzf: this.gjchick == true ? 1 : 0,
                refund_amount: Math.abs(this.zhje),
                patient_id: this.idcard,
                is_pre: '0',
                cache_uuid: this.yibaodata.cache_uuid,
                p_yecssj: '',
                gjzhzf: this.jiesuan.gjzhzf,
                grzhzf: this.jiesuan.grzhzf,
                pre_id: this.jiesuan.id,
                p_zlfs: this.typeinfo.des,
                p_jbmc:this.patientform.p_jbmc,
                p_jbbm:this.patientform.p_jbbm,
                p_cyfs: this.typeinfo.hosp,
                p_djhz: this.typeinfo.djhz,
                p_fmfs: this.typeinfo.fmfs,
                is_zf: this.patientform.his_patient_type.value == 'ZF' ? '1' : '0',
            }
            if (this.retryparamdata.retry == true) {
                index.retry = '1'
            }
            preSettlement(index)
                .then(response => {
                    this.tuishow = response.data.status.name
                    this.jshid = response.data.jshid
                    console.log(this.tuishow, this.zhje * 1, this.zhje * 1 < 0 && this.tuishow == 'SUCCESS', '显示退款按钮')
                    this.$alert('出院成功', '出院成功', {
                        confirmButtonText: '确定',
                        callback: action => {
                            this.$message({
                                type: 'success',
                                message: '出院成功',
                            })
                            this.tuishow = response.data.status.name
                            this.loadingRight = false
                            if (this.zhje < 0) {
                                this.$confirm('该患者需要退费' + this.zhje + ', 是否继续?', '提示', {
                                    confirmButtonText: '退费',
                                    cancelButtonText: '取消',
                                    type: 'warning',
                                })
                                    .then(() => {
                                        this.feecancel()
                                    })
                                    .catch(() => {})
                            }
                        },
                    })
                    if (response.data.status.name == 'SUCCESS') {
                        this.disablebtn = true
                    }
                    // this.printcard()
                })
                .catch(err => {
                    this.$message({
                        type: 'success',
                        message: err,
                    })
                    this.loadingRight = false
                })

                .finally(response => {
                    this.loadingRight = false
                })
            // }
        },
        //结算列表
        getList() {
            this.loading = true
            const qyparams = {
                his_inpatient_no: this.patientform.his_inpatient_no,
            }
            jiesuanlist(qyparams)
                .then(response => {
                    this.costs = 0
                    for (const iterator of response.data) {
                        this.costs += iterator.cost
                    }
                    this.amount_total = Math.floor(this.costs * 100) / 100
                    this.list = response.data
                    this.total = response.data.total
                    this.loading = false
                })
                .finally(() => {
                    this.loading = false
                })
        },
        //缴退列表
        getList3() {
            this.Advancepayment_list = []
            const qyparams = {
                his_inpatient_no: this.patientform.his_inpatient_no,
                ...this.pageInfo1,
            }
            recharge_refund(qyparams)
                .then(response => {
                    this.loading = false
                    this.Advancepayment_list = response.data

                    this.$forceUpdate()
                })
                .finally(() => {
                    this.loading = false
                })
        },
        //重新上传所有费用清单
        prereturn() {
            this.loading2 = true
            prereturn({
                his_inpatient_no: this.idcard,
                upload: '1',
                time: 'all',
                download: '0',
            })
                .then(response => {})
                .finally(() => {
                    this.loading2 = false
                })
        },
        //费用列表
        getList2() {
            this.loading2 = true
            const qypara = {
                limit: 9999,
                his_inpatient_no: this.patientform.his_inpatient_no,
            }
            feelist(qypara)
                .then(response => {
                    this.total_amount = response.meta.total_amount
                    this.listfees = response.data
                    this.total2 = response.data.total
                })
                .finally(() => {
                    this.loading2 = false
                })
        },
        styleBack({ row, column, rowIndex, columnIndex }) {
            if (row.more_zfbl == '1') {
                return { backgroundColor: '#fdf5e6' }
            }
            if (row.sxzfbl == '-1.0000' || row.sxzfbl == '-1') {
                return { backgroundColor: '#fef0f0' }
            }
        },
        savebtn(e) {
            this.resave(e.id, e.sxzfbl)
            this.seemodel = ''
        },
        //保存显示按钮
        savefocus(e) {
            this.seemodel = e.id
        },
        //
        biliBlur(row) {
            if (row.sxzfbl > 1) {
                this.$message({
                    message: '自付比例最大值为1',
                    type: 'warning',
                })
                row.sxzfbl = 1
                return false
            }
        },
        //保存自付比例
        resave(e, x) {
            editProp({
                is_zy: '1', //1住院 0门诊
                his_patient_no: this.patientform.his_patient_no,
                column: 'sxzfbl', //his_patient_type结算类型 sxzfbl自付比例
                value: x * 1,
                med_cost_id: e,
            })
                .then(response => {
                    this.getList2()
                })
                .finally(() => {
                    this.loading = false
                })
        },
        //获取自付比例
        getProp(row) {
            zfbl({
                is_zy: '1',
                yyxmbm: row.yyxmbm,
                rqlb: this.patientform.p_rqlb,
                fyfssj: row.fysfsj,
                channel: this.patientform.channel,
            })
                .then(response => {
                    if (response.data.length > 1) {
                        // TODO: 接口修改完毕那参数
                        this.infor = response.data
                        if (response.data.length > 1) {
                            row.many = '1'
                            var min = response.data[0].zfbl
                            for (let i = 0; i < response.data.length; i++) {
                                if (min > response.data[i].zfbl) {
                                    min = response.data[i].zfbl
                                }
                            }
                            row.sxzfbl = min
                            this.$forceUpdate()
                        } else {
                            row.sxzfbl = response.data[0].zfbl
                            this.$forceUpdate()
                        }
                        this.showEditProp = true
                        this.currentData = row
                    } else {
                        // TODO: 接口修改完毕那参数
                        this.resave(row.id, row.sxzfbl)
                    }
                    //     element.sxzfbl=response.data.sxzfbl
                    //    this.resave(element.id,response.data.sxzfbl)
                })
                .finally(() => {
                    this.loading = false
                })
        },
        //修改自付比例
        proportion(id, e) {
            this.showEditProp = false
            this.listfees.forEach(element => {
                if (element.id == id) {
                    element.sxzfbl = e
                    this.$forceUpdate()
                    return false
                }
            })
        },
    },
}
</script>

<style lang="scss" scoped>
.boxmain {
    display: flex;
    justify-content: space-between;
}

.all {
    padding: 12px;
    font-size: 14px;
    background-color: #fff;
}

.left {
    // min-width: 706px;
    // height: 744px;

    .el-input {
        width: 230px;
    }

    ::v-deep .el-table-column--selection {
        .cell {
            padding: 0 14px;
        }
    }

    position: relative;

    ::v-deep .el-input-group__prepend {
        background-color: #eef5fd;
    }
}
.install {
    ::v-deep .el-form-item {
        margin-bottom: 2px;
        display: inline-grid;
        text-align: left;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
        justify-items: start;
    }
}
.right {
    min-width: 566px;
    // min-height: 750px;
    padding-top: 30px;
    background-color: #eef5fd;
    color: #666666;

    ::v-deep .el-input__inner {
        height: 28px;
    }
    ::v-deep .el-form-item {
        margin-bottom: 2px;
    }

    ::v-deep .el-form-item__label {
        line-height: 24px;
    }

    ::v-deep .el-form-item__content {
        line-height: 24px;
    }

    ::v-deep label {
        font-weight: normal;
    }
}

.bg-purple {
    height: 500px;
    background: #d3dce6;
}

.bg-purple-light {
    background: #e5e9f2;
}

.grid-content {
    border-radius: 4px;
    min-height: 36px;
}

.downleft {
    // position: absolute;
    // bottom: 0;
    // width: 90%;
}

.downcontent {
    // padding-top: 20px;
    display: flex;
    justify-content: space-between;

    ::v-deep .el-input-group__prepend {
        background-color: #1890ff;
        color: #fff;
    }
}

.downmessage {
    height: 60px;
    line-height: 60px;
    padding: 0 8px;
    background-color: #f6faff;
}

.bigpa {
    position: relative;
    width: 200px;
    margin: 0 auto;
    text-align: center;
    color: #000;
}

.littlepa {
    position: absolute;
    right: -80px;
    top: 20%;
    color: #f04a4a;
    border: 1px solid #000000;
    padding: 2px 7px;
}

.bigpa_top {
    letter-spacing: 5px;
    font-size: 24px;
}

.bigpa_down {
    font-size: 14px;
}

.main {
    width: 90%;
    margin: 0 auto;
    margin-top: 30px;

    .title {
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid #9299a0;
        line-height: 30px;
        margin-bottom: 20px;
    }

    .tou {
        display: flex;
        justify-items: center;
        line-height: 20px;
        position: relative;
        margin-top: 15px;
        color: #4991fd;

        .touinside {
            height: 1px;
            border-top: 1px solid #bedcff;
            position: absolute;
            top: 45%;
            width: 85%;
            left: 80px;
        }

        .toutop {
            position: absolute;
            right: 10px;
            top: -15px;
            display: flex;
            justify-content: flex-start;

            .toutopleft {
                color: #000;
            }

            .toutopright {
                min-width: 80px;
                border-bottom: 1px solid #9299a0;
            }
        }
    }

    .commonflex_three {
        display: flex;
        justify-content: space-between;

        .el-input {
            width: 96px;
        }
    }

    .commonflex_two {
        display: flex;
        justify-content: space-between;

        .el-input {
            width: 160px;
        }

        .ln24 {
            line-height: 24px;
        }

        .ln24left {
            width: 84px;
        }

        .ln24right {
            width: 160px;
        }

        .commonflex_two_value {
            width: 160px;
        }

        .cred {
            color: red;
        }
    }

    .commonflex_right {
        display: flex;
        justify-content: flex-end;
    }

    .commonflex_button {
        display: flex;
        justify-content: center;
        padding-top: 10px;
    }
}

.el-tab-pane {
    position: relative;
    // height: 648px;

    .pagination-container {
        position: absolute;
        bottom: 15px;
        right: 0;
        width: 90%;
    }
}

.el-table {
    overflow-y: auto !important;
    height: calc(100vh - 250px) !important;
}

// .el-input--medium .el-input__icon{
//     line-height: 50px;
// }
.feetext {
    font-size: 24px;
    font-weight: 700;
    color: red;
}

.feetexts {
    font-size: 24px;
    font-weight: 700;
    color: rgb(0, 140, 255);
}
.eltable {
    .el-input {
        width: 90px;
    }
}
.main {
    .commonflex_three {
        .el-input {
            width: 110px;
        }
    }
}
.tanchaung {
    ::v-deep.el-dialog__title {
        font-size: 16px;
        font-family: PingFang SC-Semibold, PingFang SC;
        font-weight: 600;
        color: #333333;
    }
    ::v-deep.el-dialog__body {
        background: #f2f2f2;
        padding: 12px;
    }
}
.tabin {
    padding: 12px;
    background: #ffffff;
    border-radius: 3px 3px 3px 3px;
    opacity: 1;

    ::v-deep.el-form-item {
        margin-bottom: 5px;
    }
    ::v-deep.el-form-item__label {
        background-color: #f2f2f2;
        text-align: center;
    }
}
</style>
