<template>
  <j-modal :key="key" :title="title" :width="width" :visible="visible" :maskClosable="false" :keyboard="false"
    :forceRender="true" @cancel="handleCancel" wrapClassName="ant-modal-cust-warp"
    style="top:5%;height: 100%;overflow-y: hidden">
    <template slot="footer">
      <a-button v-if="billPrintFlag" @click="handlePrint">打印设置</a-button>
      <!--此处为解决缓存问题-->
      <a-button v-if="billType === '零售出库'" v-print="'#retailOutPrint'">普通打印</a-button>
      <a-button v-if="billType === '零售退货入库'" v-print="'#retailBackPrint'">普通打印</a-button>
      <a-button v-if="billType === '采购订单'" v-print="'#purchaseOrderPrint'">普通打印</a-button>
      <a-button v-if="billType === '采购入库'" v-print="'#purchaseInPrint'">普通打印</a-button>
      <a-button v-if="billType === '采购退货出库'" v-print="'#purchaseBackPrint'">普通打印</a-button>
      <a-button v-if="billType === '销售订单'" v-print="'#saleOrderPrint'">普通打印</a-button>
      <a-button v-if="billType === '销售出库'" v-print="'#saleOutPrint'">普通打印</a-button>
      <a-button v-if="billType === '销售退货入库'" v-print="'#saleBackPrint'">普通打印</a-button>
      <a-button v-if="billType === '其它入库'" v-print="'#otherInPrint'">普通打印</a-button>
      <a-button v-if="billType === '其它出库'" v-print="'#otherOutPrint'">普通打印</a-button>
      <a-button v-if="billType === '调拨出库'" v-print="'#allocationOutPrint'">普通打印</a-button>
      <a-button v-if="billType === '组装单'" v-print="'#assemblePrint'">普通打印</a-button>
      <a-button v-if="billType === '拆卸单'" v-print="'#disassemblePrint'">普通打印</a-button>
      <a-button v-if="billType === '盘点复盘'" v-print="'#stockCheckReplayPrint'">普通打印</a-button>
      <a-modal title="打印设置" :width="888" :visible="threeVisible" :confirm-loading="confirmLoading" centered
        @ok="threeOk" @cancel="threeCancel">
        <h2 style="font-weight:400;margin-bottom:0;">1、自定义列表项
          <a-checkbox :indeterminate="indeterminate1"
            :checked="checkAll1" @change="onCheckAllChange1" style="float:right;font-size: 16px;">
            全选
          </a-checkbox>
        </h2>
        <hr style="border:0.5px solid gainsboro;" />
        <a-checkbox-group v-model="checkedTableList" :options="tableOptions" @change="onChange" />
        <h2 style="font-weight:400;margin-bottom:0;margin-top:20px;">2、自定义明细列
          <a-checkbox :indeterminate="indeterminate2"
            :checked="checkAll2" @change="onCheckAllChange2" style="float:right;font-size: 16px;">
            全选
          </a-checkbox>
        </h2>
        <hr style="border:0.5px solid gainsboro;" />
        <a-checkbox-group v-model="checkedOtherList" :options="otherOptions" @change="onChange" />
        <h2 style="font-weight:400;margin-bottom:0;margin-top:20px;">3、自定义行数</h2>
        <hr style="border:0.5px solid gainsboro;" />
        <a-radio-group v-model="printStatus" default-value="one" button-style="solid" style="margin-top:10px;">
          <a-radio-button value="one">
            一等分
          </a-radio-button>
          <a-radio-button value="two">
            二等分
          </a-radio-button>
          <a-radio-button value="three">
            三等分
          </a-radio-button>
        </a-radio-group>
        <span style="color:gainsboro">(请以虚线为界设置行数，超出将影响打印效果)</span>
        <a-row :gutter="24" style="margin-top:15px">
          <a-col :span="12">
            <div style="text-align:left;font-size: 16px;font-weight: 300;margin-bottom: 10px;">第一页行数:</div>
            <a-input v-model="firstRow" type="text" placeholder="三等分行数≤6,二等分行数≤11,一等分≤26" />
          </a-col>
          <a-col :span="12">
            <div style="text-align:left;font-size: 16px;font-weight: 300;margin-bottom: 10px;">后续页行数:</div>
            <a-input v-model="nextRow" type="text" placeholder="三等分行数≤8,二等分行数≤13,一等分≤28" />
          </a-col>
        </a-row>
      </a-modal>
      <a-button key="back" @click="handleCancel">取消</a-button>
    </template>
    <a-form :form="form">
      <!--零售出库-->
      <div style="position:relative;">
          <hr v-for="(item,index) in dataSource" :key="index" class="hr-line" :style="getTopHeight(index)"/>
      </div>
      <template v-if="billType === '零售出库'">
        <section ref="print" id="retailOutPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="24">
              <a-input :default-value="billType + '单'" type="text"
                style="border:0;text-align:center;color:black;font-size:24px;font-weight: 400;" />
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24" style="padding-bottom:5px;">
            <a-col :span="8">
              会员卡号：{{ model.organName }}
            </a-col>
            <a-col :span="8">
              单据日期：{{ model.operTimeStr }}
            </a-col>
            <a-col :span="8">
              单据编号：{{ model.number }}
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="18" :md="12" :sm="24">
              <div :style="tableWidthRetail">
                <div v-for="(item, index) in dataSource" :key="index"
                  :class="printStatus == 'one' ? 'one' : printStatus == 'two' ? 'two' : 'three'">
                  <a-table ref="table" size="middle" bordered class="tb-style" rowKey="id" :pagination="false"
                    :columns="columns" :dataSource="item.arr1">
                    <template v-if="index === dataSource.length - 1" slot="footer" class="ft-style">
                      大写金额:&nbsp;&nbsp;{{ convertCurrency(model.totalPrice) }}
                      <span style="float:right;margin-right: 20px;">合计金额：¥{{ model.totalPrice }}</span>
                    </template>
                  </a-table>
                </div>
              </div>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="24" :md="6" :sm="6" style="text-align:left;padding:15px;">
              备注：&nbsp;&nbsp;&nbsp;&nbsp;{{ model.remark }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('制单人')" :span="6" style="text-align:left;padding-left: 15px;">
              制单人：{{ model.userName }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('收款账户')" :span="6" style="text-align:left;padding-left: 15px;">
              收款账户：{{ model.accountName }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('收款金额')" :span="6" style="text-align:left;padding-left: 15px;">
              收款金额：{{ model.getAmount }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('找零')" :span="6" style="text-align:left;padding-left: 15px;">
              找零：{{ model.backAmount }}
            </a-col>
          </a-row>
        </section>
      </template>
      <!--零售退货-->
      <template v-else-if="billType === '零售退货入库'">
        <section ref="print" id="retailBackPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="24">
              <a-input :default-value="billType + '单'" type="text"
                style="border:0;text-align:center;color:black;font-size:24px;font-weight: 400;" />
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24" style="padding-bottom:5px;">
            <a-col :span="8">
              会员卡号：{{ model.organName }}
            </a-col>
            <a-col :span="8">
              单据日期：{{ model.operTimeStr }}
            </a-col>
            <a-col :span="8">
              单据编号：{{ model.number }}
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="18" :md="12" :sm="24">
              <div :style="tableWidthRetail">
                <div v-for="(item, index) in dataSource" :key="index"
                  :class="printStatus == 'one' ? 'one' : printStatus == 'two' ? 'two' : 'three'">
                  <a-table ref="table" size="middle" bordered class="tb-style" rowKey="id" :pagination="false"
                    :columns="columns" :dataSource="item.arr1">
                    <template v-if="index === dataSource.length - 1" slot="footer" class="ft-style">
                      大写金额:&nbsp;&nbsp;{{ convertCurrency(model.totalPrice) }}
                      <span style="float:right;margin-right: 20px;">合计金额：¥{{ model.totalPrice }}</span>
                    </template>
                  </a-table>
                </div>
              </div>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="24" :md="6" :sm="6" style="text-align:left;padding:15px;">
              备注：&nbsp;&nbsp;&nbsp;&nbsp;{{ model.remark }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('制单人')" :span="6" style="text-align:left;padding-left: 15px;">
              制单人：{{ model.userName }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('付款账户')" :span="6" style="text-align:left;padding-left: 15px;">
              付款账户：{{ model.accountName }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('关联单据')" :span="6">
              关联单据：<a @click="myHandleDetail(model.number)">{{ model.number }}</a>
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('付款金额')" :span="6" style="text-align:left;padding-left: 15px;">
              付款金额：{{ model.getAmount }}
            </a-col>
          </a-row>
        </section>
      </template>
      <!--采购订单-->
      <template v-else-if="billType === '采购订单'">
        <section ref="print" id="purchaseOrderPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="24">
              <a-input :default-value="billType + '单'" type="text"
                style="border:0;text-align:center;color:black;font-size:24px;font-weight: 400;" />
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24" style="padding-bottom:5px;">
            <a-col :span="8">
              供应商：{{ model.organName }}
            </a-col>
            <a-col :span="8">
              单据日期：{{ model.operTimeStr }}
            </a-col>
            <a-col :span="8">
              单据编号：{{ model.number }}
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="18" :md="12" :sm="24">
              <div :style="tableWidthRetail">
                <div v-for="(item, index) in dataSource" :key="index"
                  :class="printStatus == 'one' ? 'one' : printStatus == 'two' ? 'two' : 'three'">
                  <a-table ref="table" size="middle" bordered class="tb-style" rowKey="id" :pagination="false"
                    :columns="columns" :dataSource="item.arr1">
                    <template v-if="index === dataSource.length - 1" slot="footer" class="ft-style">
                      大写金额:&nbsp;&nbsp;{{ convertCurrency(model.discountLastMoney) }}
                      <span style="float:right;margin-right: 20px;">合计金额：¥{{ model.discountLastMoney }}</span>
                    </template>
                  </a-table>
                </div>
              </div>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="24" :md="6" :sm="6" style="text-align:left;padding:15px;">
              备注：&nbsp;&nbsp;&nbsp;&nbsp;{{ model.remark }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('制单人')" :span="6" style="text-align:left;padding-left: 15px;">
              制单人：{{ model.userName }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('结算账户')" :span="6" style="text-align:left;padding-left: 15px;">
              结算账户：{{ model.accountName }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('优惠率')" :span="6" style="text-align:left;padding-left: 15px;">
              优惠率：{{ model.discount }}%
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('付款优惠')" :span="6" style="text-align:left;padding-left: 15px;">
              付款优惠：{{ model.discountMoney }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('优惠后金额')" :span="6" style="text-align:left;padding-left: 15px;">
              优惠后金额：{{ model.discountLastMoney }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('其他费用')" :span="6" style="text-align:left;padding-left: 15px;">
              其他费用：{{ model.otherMoney }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('关联单据')" :span="6">
              关联单据：<a @click="myHandleDetail(model.linkNumber)">{{ model.linkNumber }}</a>
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('支付定金')" :span="6" style="text-align:left;padding-left: 15px;">
              支付定金：{{ model.changeAmount }}
            </a-col>
          </a-row>
        </section>
      </template>
      <!--采购入库-->
      <template v-else-if="billType === '采购入库'">
        <section ref="print" id="purchaseInPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="24">
              <a-input :default-value="billType + '单'" type="text"
                style="border:0;text-align:center;color:black;font-size:24px;font-weight: 400;" />
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24" style="padding-bottom:5px;">
            <a-col :span="8">
              供应商：{{ model.organName }}
            </a-col>
            <a-col :span="8">
              单据日期：{{ model.operTimeStr }}
            </a-col>
            <a-col :span="8">
              单据编号：{{ model.number }}
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="18" :md="12" :sm="24">
              <div :style="tableWidthRetail">
                <div v-for="(item, index) in dataSource" :key="index"
                  :class="printStatus == 'one' ? 'one' : printStatus == 'two' ? 'two' : 'three'">
                  <a-table ref="table" size="middle" bordered class="tb-style" rowKey="id" :pagination="false"
                    :columns="columns" :dataSource="item.arr1">
                    <template v-if="index === dataSource.length - 1" slot="footer" class="ft-style">
                      大写金额:&nbsp;&nbsp;{{ convertCurrency(model.discountLastMoney) }}
                      <span style="float:right;margin-right: 20px;">合计金额：¥{{ model.discountLastMoney }}</span>
                    </template>
                  </a-table>
                </div>
              </div>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="24" :md="6" :sm="6" style="text-align:left;padding:15px;">
              备注：&nbsp;&nbsp;&nbsp;&nbsp;{{ model.remark }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('制单人')" :span="6" style="text-align:left;padding-left: 15px;">
              制单人：{{ model.userName }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('结算账户')" :span="6" style="text-align:left;padding-left: 15px;">
              结算账户：{{ model.accountName }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('优惠率')" :span="6" style="text-align:left;padding-left: 15px;">
              优惠率：{{ model.discount }}%
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('付款优惠')" :span="6" style="text-align:left;padding-left: 15px;">
              付款优惠：{{ model.discountMoney }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('优惠后金额')" :span="6" style="text-align:left;padding-left: 15px;">
              优惠后金额：{{ model.discountLastMoney }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('其他费用')" :span="6" style="text-align:left;padding-left: 15px;">
              其他费用：{{ model.otherMoney }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('关联单据')" :span="6">
              关联单据：<a @click="myHandleDetail(model.linkNumber)">{{ model.linkNumber }}</a>
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('扣除定金')" :span="6" style="text-align:left;padding-left: 15px;">
              扣除定金：{{ model.deposit }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('本次付款')" :span="6" style="text-align:left;padding-left: 15px;">
              本次付款：{{ model.changeAmount }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('本次欠款')" :span="6" style="text-align:left;padding-left: 15px;">
              本次欠款：{{ model.debt }}
            </a-col>
            <!-- <a-col v-if="financialBillNoList.length" :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款单号">
                <template v-for="item in financialBillNoList">
                  付款单号：<a @click="myHandleFinancialDetail(item.billNo)">{{ item.billNo }}</a>
                </template>
              </a-form-item>
            </a-col> -->
          </a-row>
        </section>
      </template>
      <!--采购退货-->
      <template v-else-if="billType === '采购退货出库'">
        <section ref="print" id="purchaseBackPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="24">
              <a-input :default-value="billType + '单'" type="text"
                style="border:0;text-align:center;color:black;font-size:24px;font-weight: 400;" />
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24" style="padding-bottom:5px;">
            <a-col :span="8">
              供应商：{{ model.organName }}
            </a-col>
            <a-col :span="8">
              单据日期：{{ model.operTimeStr }}
            </a-col>
            <a-col :span="8">
              单据编号：{{ model.number }}
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="18" :md="12" :sm="24">
              <div :style="tableWidthRetail">
                <div v-for="(item, index) in dataSource" :key="index"
                  :class="printStatus == 'one' ? 'one' : printStatus == 'two' ? 'two' : 'three'">
                  <a-table ref="table" size="middle" bordered class="tb-style" rowKey="id" :pagination="false"
                    :columns="columns" :dataSource="item.arr1">
                    <template v-if="index === dataSource.length - 1" slot="footer" class="ft-style">
                      大写金额:&nbsp;&nbsp;{{ convertCurrency(model.discountLastMoney) }}
                      <span style="float:right;margin-right: 20px;">合计金额：¥{{ model.discountLastMoney }}</span>
                    </template>
                  </a-table>
                </div>
              </div>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="24" :md="6" :sm="6" style="text-align:left;padding:15px;">
              备注：&nbsp;&nbsp;&nbsp;&nbsp;{{ model.remark }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('制单人')" :span="6" style="text-align:left;padding-left: 15px;">
              制单人：{{ model.userName }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('结算账户')" :span="5" style="text-align:left;padding-left: 15px;">
              结算账户：{{ model.accountName }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('优惠率')" :span="6" style="text-align:left;padding-left: 15px;">
              优惠率：{{ model.discount }}%
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('退款优惠')" :span="6" style="text-align:left;padding-left: 15px;">
              退款优惠：{{ model.discountMoney }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('优惠后金额')" :span="6" style="text-align:left;padding-left: 15px;">
              优惠后金额：{{ model.discountLastMoney }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('其他费用')" :span="6" style="text-align:left;padding-left: 15px;">
              其他费用：{{ model.otherMoney }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('关联单据')" :span="7">
              关联单据：<a @click="myHandleDetail(model.linkNumber)">{{ model.linkNumber }}</a>
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('本次退款')" :span="6" style="text-align:left;padding-left: 15px;">
              本次退款：{{ model.changeAmount }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('本次欠款')" :span="6" style="text-align:left;padding-left: 15px;">
              本次欠款：{{ model.debt }}
            </a-col>
          </a-row>
        </section>
      </template>
      <!--销售订单-->
      <template v-else-if="billType === '销售订单'">
        <section ref="print" id="saleOrderPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="24">
              <a-input :default-value="billType + '单'" type="text"
                style="border:0;text-align:center;color:black;font-size:24px;font-weight: 400;" />
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24" style="padding-bottom:5px;">
            <a-col :span="8">
              客户名称：{{ model.organName }}
            </a-col>
            <a-col :span="8">
              单据日期：{{ model.operTimeStr }}
            </a-col>
            <a-col :span="8">
              单据编号：{{ model.number }}
            </a-col>
            <!-- <a-col :span="12">
              销售人员：{{model.salesManStr}}
            </a-col> -->
            <a-col :span="5">
              联系人：{{ model.contacts }}
            </a-col>
            <a-col :span="6">
              客户电话：{{ model.telephone }}
            </a-col>
            <a-col :span="13">
              客户地址：{{ model.address }}
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="18" :md="12" :sm="24">
              <div :style="tableWidthRetail">
                <div v-for="(item, index) in dataSource" :key="index"
                  :class="printStatus == 'one' ? 'one' : printStatus == 'two' ? 'two' : 'three'">
                  <a-table ref="table" size="middle" bordered class="tb-style" rowKey="id" :pagination="false"
                    :columns="columns" :dataSource="item.arr1">
                    <template v-if="index === dataSource.length - 1" slot="footer" class="ft-style">
                      大写金额:&nbsp;&nbsp;{{ convertCurrency(model.discountLastMoney) }}
                      <span style="float:right;margin-right: 20px;">合计金额：¥{{ model.discountLastMoney }}</span>
                    </template>
                  </a-table>
                </div>
              </div>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="24" :md="6" :sm="6" style="text-align:left;padding:15px;">
              备注：&nbsp;&nbsp;&nbsp;&nbsp;{{ model.remark }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('制单人')" :span="6" style="text-align:left;padding-left: 15px;">
              制单人：{{ model.userName }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('结算账户')" :span="6" style="text-align:left;padding-left: 15px;">
              结算账户：{{ model.accountName }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('优惠率')" :span="6" style="text-align:left;padding-left: 15px;">
              优惠率：{{ model.discount }}%
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('付款优惠')" :span="6" style="text-align:left;padding-left: 15px;">
              付款优惠：{{ model.discountMoney }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('优惠后金额')" :span="6" style="text-align:left;padding-left: 15px;">
              优惠后金额：{{ model.discountLastMoney }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('其他费用')" :span="6" style="text-align:left;padding-left: 15px;">
              其他费用：{{ model.otherMoney }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('收取定金')" :span="6" style="text-align:left;padding-left: 15px;">
              收取定金：{{ model.changeAmount }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('销售人员')" :span="6" style="text-align:left;padding-left: 15px;">
              销售人员：{{ model.salesManStr }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('客户签字')" :span="6" style="text-align:left;padding-left: 15px;">
              客户签字：
            </a-col>
          </a-row>
        </section>
      </template>
      <!--销售出库-->
      <template v-else-if="billType === '销售出库'">
        <section ref="print" id="saleOutPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="24">
              <a-input :default-value="billType + '单'" type="text"
                style="border:0;text-align:center;color:black;font-size:24px;font-weight: 400;" />
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24" style="padding-bottom:5px;">
            <a-col :span="8">
              客户名称：{{ model.organName }}
            </a-col>
            <a-col :span="8">
              单据日期：{{ model.operTimeStr }}
            </a-col>
            <a-col :span="8">
              单据编号：{{ model.number }}
            </a-col>
            <!-- <a-col :span="12">
              销售人员：{{model.salesManStr}}
            </a-col> -->
            <a-col :span="5">
              联系人：{{ model.contacts }}
            </a-col>
            <a-col :span="6">
              客户电话：{{ model.telephone }}
            </a-col>
            <a-col :span="13">
              客户地址：{{ model.address }}
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="18" :md="12" :sm="24">
              <div :style="tableWidthRetail">
                <div v-for="(item, index) in dataSource" :key="index"
                  :class="printStatus == 'one' ? 'one' : printStatus == 'two' ? 'two' : 'three'">
                  <a-table ref="table" size="middle" bordered class="tb-style" rowKey="id" :pagination="false"
                    :columns="columns" :dataSource="item.arr1">
                    <template v-if="index === dataSource.length - 1" slot="footer" class="ft-style">
                      大写金额:&nbsp;&nbsp;{{ convertCurrency(model.discountLastMoney) }}
                      <span style="float:right;margin-right: 20px;">合计金额：¥{{ model.discountLastMoney }}</span>
                    </template>
                  </a-table>
                </div>
              </div>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="24" :md="6" :sm="6" style="text-align:left;padding:15px;">
              备注：&nbsp;&nbsp;&nbsp;&nbsp;{{ model.remark }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('制单人')" :span="6" style="text-align:left;padding-left: 15px;">
              制单人：{{ model.userName }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('结算账户')" :span="6" style="text-align:left;padding-left: 15px;">
              结算账户：{{ model.accountName }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('优惠率')" :span="6" style="text-align:left;padding-left: 15px;">
              优惠率：{{ model.discount }}%
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('收款优惠')" :span="6" style="text-align:left;padding-left: 15px;">
              收款优惠：{{ model.discountMoney }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('优惠后金额')" :span="6" style="text-align:left;padding-left: 15px;">
              优惠后金额：{{ model.discountLastMoney }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('其他费用')" :span="6" style="text-align:left;padding-left: 15px;">
              其他费用：{{ model.otherMoney }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('关联单据')" :span="6">
              关联单据：<a @click="myHandleDetail(model.linkNumber)">{{ model.linkNumber }}</a>
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('结算账户')" :span="6" style="text-align:left;padding-left: 15px;">
              结算账户：{{ model.accountName }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('扣除定金')" :span="6" style="text-align:left;padding-left: 15px;">
              扣除定金：{{ model.deposit }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('本次收款')" :span="6" style="text-align:left;padding-left: 15px;">
              本次收款：{{ model.changeAmount }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('本次欠款')" :span="6" style="text-align:left;padding-left: 15px;">
              本次欠款：{{ model.debt }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('销售人员')" :span="6" style="text-align:left;padding-left: 15px;">
              销售人员：{{ model.salesManStr }}
            </a-col>
            <!-- <a-col v-if="financialBillNoList.length" :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收款单号">
                <template v-for="(item, index) in financialBillNoList">
                  收款单号：<a @click="myHandleFinancialDetail(item.billNo)">{{ item.billNo }}</a>
                </template>
              </a-form-item>
            </a-col> -->
            <a-col v-if="this.checkedOtherList.includes('客户签字')" :span="6" style="text-align:left;padding-left: 15px;">
              客户签字：
            </a-col>
          </a-row>
        </section>
      </template>
      <!--销售退货-->
      <template v-else-if="billType === '销售退货入库'">
        <section ref="print" id="saleBackPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="24">
              <a-input :default-value="billType + '单'" type="text"
                style="border:0;text-align:center;color:black;font-size:24px;font-weight: 400;" />
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24" style="padding-bottom:5px;">
            <a-col :span="8">
              客户名称：{{ model.organName }}
            </a-col>
            <a-col :span="8">
              单据日期：{{ model.operTimeStr }}
            </a-col>
            <a-col :span="8">
              单据编号：{{ model.number }}
            </a-col>
            <!-- <a-col :span="12">
              销售人员：{{model.salesManStr}}
            </a-col> -->
            <a-col :span="5">
              联系人：{{ model.contacts }}
            </a-col>
            <a-col :span="6">
              客户电话：{{ model.telephone }}
            </a-col>
            <a-col :span="13">
              客户地址：{{ model.address }}
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="18" :md="12" :sm="24">
              <div :style="tableWidthRetail">
                <div v-for="(item, index) in dataSource" :key="index"
                  :class="printStatus == 'one' ? 'one' : printStatus == 'two' ? 'two' : 'three'">
                  <a-table ref="table" size="middle" bordered class="tb-style" rowKey="id" :pagination="false"
                    :columns="columns" :dataSource="item.arr1">
                    <template v-if="index === dataSource.length - 1" slot="footer" class="ft-style">
                      大写金额:&nbsp;&nbsp;{{ convertCurrency(model.discountLastMoney) }}
                      <span style="float:right;margin-right: 20px;">合计金额：¥{{ model.discountLastMoney }}</span>
                    </template>
                  </a-table>
                </div>
              </div>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="24" :md="6" :sm="6" style="text-align:left;padding:15px;">
              备注：&nbsp;&nbsp;&nbsp;&nbsp;{{ model.remark }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('制单人')" :span="6" style="text-align:left;padding-left: 15px;">
              制单人：{{ model.userName }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('结算账户')" :span="6" style="text-align:left;padding-left: 15px;">
              结算账户：{{ model.accountName }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('优惠率')" :span="6" style="text-align:left;padding-left: 15px;">
              优惠率：{{ model.discount }}%
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('退款优惠')" :span="6" style="text-align:left;padding-left: 15px;">
              退款优惠：{{ model.discountMoney }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('优惠后金额')" :span="6" style="text-align:left;padding-left: 15px;">
              优惠后金额：{{ model.discountLastMoney }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('其他费用')" :span="6" style="text-align:left;padding-left: 15px;">
              其他费用：{{ model.otherMoney }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('本次退款')" :span="6" style="text-align:left;padding-left: 15px;">
              本次退款：{{ model.changeAmount }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('销售人员')" :span="6" style="text-align:left;padding-left: 15px;">
              销售人员：{{ model.salesManStr }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('客户签名')" :span="6" style="text-align:left;padding-left: 15px;">
              客户签名：
            </a-col>
          </a-row>
        </section>
      </template>
      <!--其它入库-->
      <template v-else-if="billType === '其它入库'">
        <section ref="print" id="otherInPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="24">
              <a-input :default-value="billType + '单'" type="text"
                style="border:0;text-align:center;color:black;font-size:24px;font-weight: 400;" />
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24" style="padding-bottom:5px;">
            <a-col :span="8">
              供应商：{{ model.organName }}
            </a-col>
            <a-col :span="8">
              单据日期：{{ model.operTimeStr }}
            </a-col>
            <a-col :span="8">
              单据编号：{{ model.number }}
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="18" :md="12" :sm="24">
              <div :style="tableWidthRetail">
                <div v-for="(item, index) in dataSource" :key="index"
                  :class="printStatus == 'one' ? 'one' : printStatus == 'two' ? 'two' : 'three'">
                  <a-table ref="table" size="middle" bordered class="tb-style" rowKey="id" :pagination="false"
                    :columns="columns" :dataSource="item.arr1">
                    <template v-if="index === dataSource.length - 1" slot="footer" class="ft-style">
                      大写金额:&nbsp;&nbsp;{{ convertCurrency(model.totalPrice) }}
                      <span style="float:right;margin-right: 20px;">合计金额：¥{{ model.totalPrice }}</span>
                    </template>
                  </a-table>
                </div>
              </div>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="24" :md="6" :sm="6" style="text-align:left;padding:15px;">
              备注：&nbsp;&nbsp;&nbsp;&nbsp;{{ model.remark }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('制单人')" :span="6" style="text-align:left;padding-left: 15px;">
              制单人：{{ model.userName }}
            </a-col>
          </a-row>
        </section>
      </template>
      <!--其它出库-->
      <template v-else-if="billType === '其它出库'">
        <section ref="print" id="otherOutPrint">
          <a-col :span="24">
            <a-input :default-value="billType + '单'" type="text"
              style="border:0;text-align:center;color:black;font-size:24px;font-weight: 400;" />
          </a-col>
          <a-row class="form-row" :gutter="24" style="padding-bottom:5px;">
            <a-col :span="8">
              客户：{{ model.organName }}
            </a-col>
            <a-col :span="8">
              单据日期：{{ model.operTimeStr }}
            </a-col>
            <a-col :span="8">
              单据编号：{{ model.number }}
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="18" :md="12" :sm="24">
              <div :style="tableWidthRetail">
                <div v-for="(item, index) in dataSource" :key="index"
                  :class="printStatus == 'one' ? 'one' : printStatus == 'two' ? 'two' : 'three'">
                  <a-table ref="table" size="middle" bordered class="tb-style" rowKey="id" :pagination="false"
                    :columns="columns" :dataSource="item.arr1">
                    <template v-if="index === dataSource.length - 1" slot="footer" class="ft-style">
                      大写金额:&nbsp;&nbsp;{{ convertCurrency(model.totalPrice) }}
                      <span style="float:right;margin-right: 20px;">合计金额：¥{{ model.totalPrice }}</span>
                    </template>
                  </a-table>
                </div>
              </div>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="24" :md="6" :sm="6" style="text-align:left;padding:15px;">
              备注：&nbsp;&nbsp;&nbsp;&nbsp;{{ model.remark }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('制单人')" :span="6" style="text-align:left;padding-left: 15px;">
              制单人：{{ model.userName }}
            </a-col>
          </a-row>
        </section>
      </template>
      <!--调拨出库-->
      <template v-else-if="billType === '调拨出库'">
        <section ref="print" id="allocationOutPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="24">
              <a-input :default-value="billType + '单'" type="text"
                style="border:0;text-align:center;color:black;font-size:24px;font-weight: 400;" />
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24" style="padding-bottom:5px;">
            <a-col :span="12">
              单据日期：{{ model.operTimeStr }}
            </a-col>
            <a-col :span="12">
              单据编号：{{ model.number }}
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="18" :md="12" :sm="24">
              <div :style="tableWidthRetail">
                <div v-for="(item, index) in dataSource" :key="index"
                  :class="printStatus == 'one' ? 'one' : printStatus == 'two' ? 'two' : 'three'">
                  <a-table ref="table" size="middle" bordered class="tb-style" rowKey="id" :pagination="false"
                    :columns="columns" :dataSource="item.arr1">
                    <template v-if="index === dataSource.length - 1" slot="footer" class="ft-style">
                      大写金额:&nbsp;&nbsp;{{ convertCurrency(model.totalPrice) }}
                      <span style="float:right;margin-right: 20px;">合计金额：¥{{ model.totalPrice }}</span>
                    </template>
                  </a-table>
                </div>
              </div>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="24" :md="6" :sm="6" style="text-align:left;padding:15px;">
              备注：&nbsp;&nbsp;&nbsp;&nbsp;{{ model.remark }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('制单人')" :span="6" style="text-align:left;padding-left: 15px;">
              制单人：{{ model.userName }}
            </a-col>
          </a-row>
        </section>
      </template>
      <!--组装单-->
      <template v-else-if="billType === '组装单'">
        <section ref="print" id="assemblePrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="24">
              <a-input :default-value="billType + '单'" type="text"
                style="border:0;text-align:center;color:black;font-size:24px;font-weight: 400;" />
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24" style="padding-bottom:5px;">
            <a-col :span="12">
              单据日期：{{ model.operTimeStr }}
            </a-col>
            <a-col :span="12">
              单据编号：{{ model.number }}
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="18" :md="12" :sm="24">
              <div :style="tableWidthRetail">
                <div v-for="(item, index) in dataSource" :key="index"
                  :class="printStatus == 'one' ? 'one' : printStatus == 'two' ? 'two' : 'three'">
                  <a-table ref="table" size="middle" bordered class="tb-style" rowKey="id" :pagination="false"
                    :columns="columns" :dataSource="item.arr1">
                    <template v-if="index === dataSource.length - 1" slot="footer" class="ft-style">
                      大写金额:&nbsp;&nbsp;{{ convertCurrency(model.totalPrice) }}
                      <span style="float:right;margin-right: 20px;">合计金额：¥{{ model.totalPrice }}</span>
                    </template>
                  </a-table>
                </div>
              </div>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="24" :md="6" :sm="6" style="text-align:left;padding:15px;">
              备注：&nbsp;&nbsp;&nbsp;&nbsp;{{ model.remark }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('制单人')" :span="6" style="text-align:left;padding-left: 15px;">
              制单人：{{ model.userName }}
            </a-col>
          </a-row>
        </section>
      </template>
      <!--拆卸单-->
      <template v-else-if="billType === '拆卸单'">
        <section ref="print" id="disassemblePrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="24">
              <a-input :default-value="billType + '单'" type="text"
                style="border:0;text-align:center;color:black;font-size:24px;font-weight: 400;" />
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24" style="padding-bottom:5px;">
            <a-col :span="12">
              单据日期：{{ model.operTimeStr }}
            </a-col>
            <a-col :span="12">
              单据编号：{{ model.number }}
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="18" :md="12" :sm="24">
              <div :style="tableWidthRetail">
                <div v-for="(item, index) in dataSource" :key="index"
                  :class="printStatus == 'one' ? 'one' : printStatus == 'two' ? 'two' : 'three'">
                  <a-table ref="table" size="middle" bordered class="tb-style" rowKey="id" :pagination="false"
                    :columns="columns" :dataSource="item.arr1">
                    <template v-if="index === dataSource.length - 1" slot="footer" class="ft-style">
                      大写金额:&nbsp;&nbsp;{{ convertCurrency(model.totalPrice) }}
                      <span style="float:right;margin-right: 20px;">合计金额：¥{{ model.totalPrice }}</span>
                    </template>
                  </a-table>
                </div>
              </div>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="24" :md="6" :sm="6" style="text-align:left;padding:15px;">
              备注：&nbsp;&nbsp;&nbsp;&nbsp;{{ model.remark }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('制单人')" :span="6" style="text-align:left;padding-left: 15px;">
              制单人：{{ model.userName }}
            </a-col>
          </a-row>
        </section>
      </template>
      <!--盘点复盘-->
      <template v-else-if="billType === '盘点复盘'">
        <section ref="print" id="stockCheckReplayPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="24">
              <a-input :default-value="billType + '单'" type="text"
                style="border:0;text-align:center;color:black;font-size:24px;font-weight: 400;" />
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24" style="padding-bottom:5px;">
            <a-col :span="12">
              单据日期：{{ model.operTimeStr }}
            </a-col>
            <a-col :span="12">
              单据编号：{{ model.number }}
            </a-col>
            <a-col v-if="model.linkNumber != null" :span="12">
              关联单据：{{ model.linkNumber }}
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="18" :md="12" :sm="24">
              <div :style="tableWidthRetail">
                <div v-for="(item, index) in dataSource" :key="index"
                  :class="printStatus == 'one' ? 'one' : printStatus == 'two' ? 'two' : 'three'">
                  <a-table ref="table" size="middle" bordered class="tb-style" rowKey="id" :pagination="false"
                    :columns="columns" :dataSource="item.arr1">
                    <template v-if="index === dataSource.length - 1" slot="footer" class="ft-style">
                      大写金额:&nbsp;&nbsp;{{ convertCurrency(model.totalPrice) }}
                      <span style="float:right;margin-right: 20px;">合计金额：¥{{ model.totalPrice }}</span>
                    </template>
                  </a-table>
                </div>
              </div>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="24" :md="6" :sm="6" style="text-align:left;padding:15px;">
              备注：&nbsp;&nbsp;&nbsp;&nbsp;{{ model.remark }}
            </a-col>
            <a-col v-if="this.checkedOtherList.includes('制单人')" :span="6" style="text-align:left;padding-left: 15px;">
              制单人：{{ model.userName }}
            </a-col>
          </a-row>
        </section>
      </template>
      <template v-if="fileList && fileList.length > 0">
        <a-row class="form-row" :gutter="24">
          <a-col :span="10">
            <a-form-item style="margin-top:5px;margin-left: 4px;" :labelCol="{ xs: { span: 24 }, sm: { span: 3 } }"
              :wrapperCol="{ xs: { span: 24 }, sm: { span: 21 } }" label="附件">
              <j-upload v-model="fileList" bizPath="bill" :disabled="true" :buttonVisible="false"></j-upload>
            </a-form-item>
          </a-col>
          <a-col :span="14"></a-col>
        </a-row>
      </template>
    </a-form>
    <bill-print-iframe ref="modalDetail"></bill-print-iframe>
    <financial-detail ref="financialDetailModal"></financial-detail>
  </j-modal>
</template>

<script>
import pick from 'lodash.pick'
import { getAction } from '@/api/manage'
import { findBillDetailByNumber, findFinancialDetailByNumber, getPlatformConfigByKey, getCurrentSystemConfig } from '@/api/api'
import { getMpListShort } from "@/utils/util"
import BillPrintIframe from './BillPrintIframe'
import FinancialDetail from '../../financial/dialog/FinancialDetail'
import JUpload from '@/components/jeecg/JUpload'
import Vue from 'vue'
import content from '@/api/content.js';
import { def } from '@vue/shared'
import { now } from 'lodash'

Vue.prototype.$myContent = content;
const tableOptions = ['序号', '仓库名称', '名称', '条码', '规格', '型号', '颜色', '扩展信息', '库存', '序列号', '批号', '有效期', '多属性', '数量', '单位', '单价', '金额', '税率(%)', '税额', '价税合计', '备注'];
const otherOptions = ['制单人', '结算账户', '销售员', '收款金额', '找零', '优惠率', '付款优惠', '优惠后金额', '其他费用', '支付金', '本次付款', '本次收款', '销售人员', '本次欠款', '退款优惠', '本次退款', '收取定金', '扣除定金', '关联单据', '客户签字'];
const tableDefaultList = ['序号', '仓库名称', '名称', '条码', '规格', '颜色', '数量', '单位', '单价', '金额', '税率(%)', '税额', '价税合计', '备注'];
const otherDefaultList = ['制单人', '销售员', '收款金额', '找零', '优惠率', '付款优惠', '优惠后金额', '支付金', '本次付款', '本次收款', '本次欠款', '退款优惠', '本次退款', '收取定金', '客户签字'];
export default {
  name: 'BillDetail',
  components: {
    BillPrintIframe,
    FinancialDetail,
    JUpload
  },
  data() {
    return {
      key: 0,
      title: "详情",
      width: '1600px',
      visible: false,
      model: {},
      billType: '',
      billPrintFlag: false,
      fileList: [],
      purchaseBySaleFlag: false,
      financialBillNoList: [],
      // plainOptions : ['Apple', 'Pear', 'Orange'],
      // defaultCheckedList : ['Apple', 'Orange'],
      tableWidth: {
        'width': '1500px'
      },
      tableWidthRetail: {
        'width': '1150px'
      },
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 },
      },
      form: this.$form.createForm(this),
      loading: false,
      dataSource: [],
      url: {
        detailList: '/depotItem/getDetailList'
      },
      //表头
      columns: [],
      //列定义
      defColumns: [],
      //打印设置
      checkedTableList: tableDefaultList,
      checkedOtherList: otherDefaultList,
      indeterminate1: true,
      indeterminate2: true,
      checkAll1: true,
      checkAll2: true,
      tableOptions:[],
      otherOptions:[],
      ModalText: '打印设置',
      threeVisible: false,
      confirmLoading: false,
      printStatus: 'one',
      firstRow: 26,
      nextRow: 28,
      retailOutColumns: [
        {
          title: "序号",
          dataIndex: 'soure', width: 60,
          className: 'column-style',
        },
        { title: '仓库名称', dataIndex: 'depotName', },
        { title: '条码', dataIndex: 'barCode' },
        { title: '名称', dataIndex: 'name' },
        { title: '规格', dataIndex: 'standard' },
        { title: '型号', dataIndex: 'model' },
        { title: '颜色', dataIndex: 'color' },
        { title: '扩展信息', dataIndex: 'materialOther' },
        { title: '库存', dataIndex: 'stock' },
        { title: '序列号', dataIndex: 'snList' },
        { title: '批号', dataIndex: 'batchNumber' },
        { title: '有效期', dataIndex: 'expirationDate' },
        { title: '多属性', dataIndex: 'sku' },
        { title: '数量', dataIndex: 'operNumber' },
        { title: '单位', dataIndex: 'unit' },
        { title: '单价', dataIndex: 'unitPrice' },
        { title: '金额', dataIndex: 'allPrice' },
        { title: '备注', dataIndex: 'remark' }
      ],
      retailBackColumns: [
        {
          title: "序号",
          dataIndex: 'soure', width: 60,
          className: 'column-style',
        },
        { title: '仓库名称', dataIndex: 'depotName' },
        { title: '条码', dataIndex: 'barCode' },
        { title: '名称', dataIndex: 'name' },
        { title: '规格', dataIndex: 'standard' },
        { title: '型号', dataIndex: 'model' },
        { title: '颜色', dataIndex: 'color' },
        { title: '扩展信息', dataIndex: 'materialOther' },
        { title: '库存', dataIndex: 'stock' },
        { title: '单位', dataIndex: 'unit' },
        { title: '序列号', dataIndex: 'snList' },
        { title: '批号', dataIndex: 'batchNumber' },
        { title: '有效期', dataIndex: 'expirationDate' },
        { title: '多属性', dataIndex: 'sku' },
        { title: '数量', dataIndex: 'operNumber' },
        { title: '单价', dataIndex: 'unitPrice' },
        { title: '金额', dataIndex: 'allPrice' },
        { title: '备注', dataIndex: 'remark' }
      ],
      purchaseOrderColumns: [
        {
          title: "序号",
          dataIndex: 'soure', width: 60,
          className: 'column-style',
        },
        { title: '条码', dataIndex: 'barCode' },
        { title: '名称', dataIndex: 'name' },
        { title: '规格', dataIndex: 'standard' },
        { title: '型号', dataIndex: 'model' },
        { title: '颜色', dataIndex: 'color' },
        { title: '扩展信息', dataIndex: 'materialOther' },
        { title: '库存', dataIndex: 'stock' },
        { title: '单位', dataIndex: 'unit' },
        { title: '多属性', dataIndex: 'sku' },
        { title: '数量', dataIndex: 'operNumber' },
        { title: '已入库', dataIndex: 'finishNumber' },
        { title: '单价', dataIndex: 'unitPrice' },
        { title: '金额', dataIndex: 'allPrice' },
        { title: '税率(%)', dataIndex: 'taxRate' },
        { title: '税额', dataIndex: 'taxMoney' },
        { title: '价税合计', dataIndex: 'taxLastMoney' },
        { title: '备注', dataIndex: 'remark' }
      ],
      purchaseInColumns: [
        {
          title: "序号",
          dataIndex: 'soure', width: 60,
          className: 'column-style',
        },
        { title: '仓库名称', dataIndex: 'depotName' },
        { title: '条码', dataIndex: 'barCode' },
        { title: '名称', dataIndex: 'name' },
        { title: '规格', dataIndex: 'standard' },
        { title: '型号', dataIndex: 'model' },
        { title: '颜色', dataIndex: 'color' },
        { title: '扩展信息', dataIndex: 'materialOther' },
        { title: '库存', dataIndex: 'stock' },
        { title: '单位', dataIndex: 'unit' },
        { title: '序列号', dataIndex: 'snList' },
        { title: '批号', dataIndex: 'batchNumber' },
        { title: '有效期', dataIndex: 'expirationDate' },
        { title: '多属性', dataIndex: 'sku' },
        { title: '数量', dataIndex: 'operNumber' },
        { title: '单价', dataIndex: 'unitPrice' },
        { title: '金额', dataIndex: 'allPrice' },
        { title: '税率(%)', dataIndex: 'taxRate' },
        { title: '税额', dataIndex: 'taxMoney' },
        { title: '价税合计', dataIndex: 'taxLastMoney' },
        { title: '备注', dataIndex: 'remark' }
      ],
      purchaseBackColumns: [
        {
          title: "序号",
          dataIndex: 'soure', width: 60,
          className: 'column-style',
        },
        { title: '仓库s名称', dataIndex: 'depotName', },
        { title: '条码', dataIndex: 'barCode' },
        { title: '名称', dataIndex: 'name' },
        { title: '规格', dataIndex: 'standard' },
        { title: '型号', dataIndex: 'model' },
        { title: '颜色', dataIndex: 'color' },
        { title: '扩展信息', dataIndex: 'materialOther' },
        { title: '库存', dataIndex: 'stock' },
        { title: '单位', dataIndex: 'unit' },
        { title: '序列号', dataIndex: 'snList' },
        { title: '批号', dataIndex: 'batchNumber' },
        { title: '有效期', dataIndex: 'expirationDate' },
        { title: '多属性', dataIndex: 'sku' },
        { title: '数量', dataIndex: 'operNumber' },
        { title: '单价', dataIndex: 'unitPrice' },
        { title: '金额', dataIndex: 'allPrice' },
        { title: '税率(%)', dataIndex: 'taxRate' },
        { title: '税额', dataIndex: 'taxMoney' },
        { title: '价税合计', dataIndex: 'taxLastMoney' },
        { title: '备注', dataIndex: 'remark' }
      ],
      saleOrderColumns: [
        {
          title: "序号",
          dataIndex: 'soure', width: 60,
          className: 'column-style',
        },
        { title: '条码', dataIndex: 'barCode' },
        { title: '名称', dataIndex: 'name' },
        { title: '规格', dataIndex: 'standard' },
        { title: '型号', dataIndex: 'model' },
        { title: '颜色', dataIndex: 'color' },
        { title: '扩展信息', dataIndex: 'materialOther' },
        { title: '库存', dataIndex: 'stock' },
        { title: '单位', dataIndex: 'unit' },
        { title: '多属性', dataIndex: 'sku' },
        { title: '数量', dataIndex: 'operNumber' },
        { title: '已出库', dataIndex: 'finishNumber' },
        { title: '单价', dataIndex: 'unitPrice' },
        { title: '金额', dataIndex: 'allPrice' },
        { title: '税率(%)', dataIndex: 'taxRate' },
        { title: '税额', dataIndex: 'taxMoney' },
        { title: '价税合计', dataIndex: 'taxLastMoney' },
        { title: '备注', dataIndex: 'remark' }
      ],
      saleOutColumns: [
        {
          title: "序号",
          dataIndex: 'soure', width: 60,
          className: 'column-style',
        },
        { title: '仓库名称', dataIndex: 'depotName' },
        { title: '条码', dataIndex: 'barCode' },
        { title: '名称', dataIndex: 'name' },
        { title: '规格', dataIndex: 'standard' },
        { title: '型号', dataIndex: 'model' },
        { title: '颜色', dataIndex: 'color' },
        { title: '扩展信息', dataIndex: 'materialOther' },
        { title: '库存', dataIndex: 'stock' },
        { title: '单位', dataIndex: 'unit' },
        { title: '序列号', dataIndex: 'snList' },
        { title: '批号', dataIndex: 'batchNumber' },
        { title: '有效期', dataIndex: 'expirationDate' },
        { title: '多属性', dataIndex: 'sku' },
        { title: '数量', dataIndex: 'operNumber' },
        { title: '单价', dataIndex: 'unitPrice' },
        { title: '金额', dataIndex: 'allPrice' },
        { title: '税率(%)', dataIndex: 'taxRate' },
        { title: '税额', dataIndex: 'taxMoney' },
        { title: '价税合计', dataIndex: 'taxLastMoney' },
        { title: '备注', dataIndex: 'remark' }
      ],
      saleBackColumns: [
        {
          title: "序号",
          dataIndex: 'soure', width: 60,
          className: 'column-style',
        },
        { title: '仓库名称', dataIndex: 'depotName' },
        { title: '条码', dataIndex: 'barCode' },
        { title: '名称', dataIndex: 'name' },
        { title: '规格', dataIndex: 'standard' },
        { title: '型号', dataIndex: 'model' },
        { title: '颜色', dataIndex: 'color' },
        { title: '扩展信息', dataIndex: 'materialOther' },
        { title: '库存', dataIndex: 'stock' },
        { title: '单位', dataIndex: 'unit' },
        { title: '序列号', dataIndex: 'snList' },
        { title: '批号', dataIndex: 'batchNumber' },
        { title: '有效期', dataIndex: 'expirationDate' },
        { title: '多属性', dataIndex: 'sku' },
        { title: '数量', dataIndex: 'operNumber' },
        { title: '单价', dataIndex: 'unitPrice' },
        { title: '金额', dataIndex: 'allPrice' },
        { title: '税率(%)', dataIndex: 'taxRate' },
        { title: '税额', dataIndex: 'taxMoney' },
        { title: '价税合计', dataIndex: 'taxLastMoney' },
        { title: '备注', dataIndex: 'remark' }
      ],
      otherInColumns: [
        {
          title: "序号",
          dataIndex: 'soure', width: 60,
          className: 'column-style',
        },
        { title: '仓库名称', dataIndex: 'depotName' },
        { title: '条码', dataIndex: 'barCode' },
        { title: '名称', dataIndex: 'name' },
        { title: '规格', dataIndex: 'standard' },
        { title: '型号', dataIndex: 'model' },
        { title: '颜色', dataIndex: 'color' },
        { title: '扩展信息', dataIndex: 'materialOther' },
        { title: '库存', dataIndex: 'stock' },
        { title: '单位', dataIndex: 'unit' },
        { title: '序列号', dataIndex: 'snList' },
        { title: '批号', dataIndex: 'batchNumber' },
        { title: '有效期', dataIndex: 'expirationDate' },
        { title: '多属性', dataIndex: 'sku' },
        { title: '数量', dataIndex: 'operNumber' },
        { title: '单价', dataIndex: 'unitPrice' },
        { title: '金额', dataIndex: 'allPrice' },
        { title: '备注', dataIndex: 'remark' }
      ],
      otherOutColumns: [
        {
          title: "序号",
          dataIndex: 'soure', width: 60,
          className: 'column-style',
        },
        { title: '仓库名称', dataIndex: 'depotName' },
        { title: '条码', dataIndex: 'barCode' },
        { title: '名称', dataIndex: 'name' },
        { title: '规格', dataIndex: 'standard' },
        { title: '型号', dataIndex: 'model' },
        { title: '颜色', dataIndex: 'color' },
        { title: '扩展信息', dataIndex: 'materialOther' },
        { title: '库存', dataIndex: 'stock' },
        { title: '单位', dataIndex: 'unit' },
        { title: '序列号', dataIndex: 'snList' },
        { title: '批号', dataIndex: 'batchNumber' },
        { title: '有效期', dataIndex: 'expirationDate' },
        { title: '多属性', dataIndex: 'sku' },
        { title: '数量', dataIndex: 'operNumber' },
        { title: '单价', dataIndex: 'unitPrice' },
        { title: '金额', dataIndex: 'allPrice' },
        { title: '备注', dataIndex: 'remark' }
      ],
      allocationOutColumns: [
        {
          title: "序号",
          dataIndex: 'soure', width: 60,
          className: 'column-style',
        },
        { title: '仓库名称', dataIndex: 'depotName' },
        { title: '条码', dataIndex: 'barCode' },
        { title: '名称', dataIndex: 'name' },
        { title: '规格', dataIndex: 'standard' },
        { title: '型号', dataIndex: 'model' },
        { title: '颜色', dataIndex: 'color' },
        { title: '扩展信息', dataIndex: 'materialOther' },
        { title: '库存', dataIndex: 'stock' },
        { title: '调入仓库', dataIndex: 'anotherDepotName' },
        { title: '单位', dataIndex: 'unit' },
        { title: '多属性', dataIndex: 'sku' },
        { title: '数量', dataIndex: 'operNumber' },
        { title: '单价', dataIndex: 'unitPrice' },
        { title: '金额', dataIndex: 'allPrice' },
        { title: '备注', dataIndex: 'remark' }
      ],
      assembleColumns: [
        {
          title: "序号",
          dataIndex: 'soure', width: 60,
          className: 'column-style',
        },
        { title: '商品类型', dataIndex: 'mType' },
        { title: '仓库名称', dataIndex: 'depotName' },
        { title: '条码', dataIndex: 'barCode' },
        { title: '名称', dataIndex: 'name' },
        { title: '规格', dataIndex: 'standard' },
        { title: '型号', dataIndex: 'model' },
        { title: '颜色', dataIndex: 'color' },
        { title: '扩展信息', dataIndex: 'materialOther' },
        { title: '库存', dataIndex: 'stock' },
        { title: '单位', dataIndex: 'unit' },
        { title: '多属性', dataIndex: 'sku' },
        { title: '数量', dataIndex: 'operNumber' },
        { title: '单价', dataIndex: 'unitPrice' },
        { title: '金额', dataIndex: 'allPrice' },
        { title: '备注', dataIndex: 'remark' }
      ],
      disassembleColumns: [
        {
          title: "序号",
          dataIndex: 'soure', width: 60,
          className: 'column-style',
        },
        { title: '商品类型', dataIndex: 'mType' },
        { title: '仓库名称', dataIndex: 'depotName' },
        { title: '条码', dataIndex: 'barCode' },
        { title: '名称', dataIndex: 'name' },
        { title: '规格', dataIndex: 'standard' },
        { title: '型号', dataIndex: 'model' },
        { title: '颜色', dataIndex: 'color' },
        { title: '扩展信息', dataIndex: 'materialOther' },
        { title: '库存', dataIndex: 'stock' },
        { title: '单位', dataIndex: 'unit' },
        { title: '多属性', dataIndex: 'sku' },
        { title: '数量', dataIndex: 'operNumber' },
        { title: '单价', dataIndex: 'unitPrice' },
        { title: '金额', dataIndex: 'allPrice' },
        { title: '备注', dataIndex: 'remark' }
      ],
      stockCheckReplayColumns: [
        {
          title: "序号",
          dataIndex: 'soure', width: 60,
          className: 'column-style',
        },
        { title: '仓库名称', dataIndex: 'depotName' },
        { title: '条码', dataIndex: 'barCode' },
        { title: '名称', dataIndex: 'name' },
        { title: '规格', dataIndex: 'standard' },
        { title: '型号', dataIndex: 'model' },
        { title: '扩展信息', dataIndex: 'materialOther' },
        { title: '库存', dataIndex: 'stock' },
        { title: '单位', dataIndex: 'unit' },
        { title: '多属性', dataIndex: 'sku' },
        { title: '数量', dataIndex: 'operNumber' },
        { title: '单价', dataIndex: 'unitPrice' },
        { title: '金额', dataIndex: 'allPrice' },
        { title: '备注', dataIndex: 'remark' }
      ]
    }
  },
  created() {
    let realScreenWidth = window.screen.width
    this.width = realScreenWidth < 1500 ? '1300px' : '1550px'
    this.tableWidth = {
      'width': realScreenWidth < 1500 ? '1250px' : '1500px'
    }
    this.tableWidthRetail = {
      'width': realScreenWidth < 1500 ? '900px' : '1100px'
    }
  },
  methods: {
    getTopHeight(index){
      console.log(index)
      if(this.printStatus=='one'){
        return {'border':'1px dashed grey','position':'relative','top': 40+42.5*index + 'cm'}
      }
      else if(this.printStatus=='two'){
        return {'border':'1px dashed grey','position':'relative','top': 20+21*index + 'cm'}
      }
      else{
        return {'border':'1px dashed grey','position':'relative','top': 13.75+14*index + 'cm'}
      }
    },
    initSetting(record, type, ds) {
      if (type === '零售出库') {
        this.defColumns = this.retailOutColumns
        this.tableOptions = ['序号', '仓库名称', '条码', '名称', '规格', '型号', '颜色', '扩展信息', '库存', '序列号', '批号', '有效期', '多属性', '数量', '单价', '单位', '金额', '备注']
        this.otherOptions=['制单人','收款账户','收款金额','找零']
      } else if (type === '零售退货入库') {
        this.defColumns = this.retailBackColumns
        this.tableOptions = ['序号', '仓库名称', '条码', '名称', '规格', '型号', '颜色', '扩展信息', '库存', '序列号', '批号', '有效期', '多属性', '数量', '单价', '单位', '金额', '备注']
        this.otherOptions=['制单人','付款账户','关联单据','付款金额']
      } else if (type === '采购订单') {
        this.defColumns = this.purchaseOrderColumns
        this.tableOptions = ['序号', '条码', '名称', '规格', '型号', '颜色', '扩展信息', '库存', '多属性', '数量', '单价', '单位', '金额', '税率(%)', '税额', '价税合计', '备注']
        this.otherOptions=['制单人','结算账户','优惠率','付款优惠','优惠后金额','其他费用','关联单据','支付定金']
      } else if (type === '采购入库') {
        this.defColumns = this.purchaseInColumns
        this.tableOptions = ['序号', '仓库名称', '条码', '名称', '规格', '型号', '颜色', '扩展信息', '库存', '序列号', '批号', '有效期', '多属性', '数量', '单价', '单位', '金额', '税率(%)', '税额', '价税合计', '备注']
        this.otherOptions=['制单人','结算账户','优惠率','付款优惠','优惠后金额','其他费用','关联单据','扣除定金','本次付款','本次欠款']
      } else if (type === '采购退货出库') {
        this.defColumns = this.purchaseBackColumns
        this.tableOptions = ['序号', '仓库s名称', '条码', '名称', '规格', '型号', '颜色', '扩展信息', '库存', '序列号', '批号', '有效期', '多属性', '数量', '单价', '单位', '金额', '税率(%)', '税额', '价税合计', '备注']
        this.otherOptions=['制单人','结算账户','优惠率','退款优惠','优惠后金额','其他费用','关联单据','本次退款','本次欠款']
      } else if (type === '销售订单') {
        this.defColumns = this.saleOrderColumns
        this.tableOptions = ['序号', '条码', '名称', '规格', '型号', '颜色', '扩展信息', '库存', '多属性', '数量', '单价', '单位', '金额', '税率(%)', '税额', '价税合计', '备注']
        this.otherOptions=['制单人','结算账户','优惠率','付款优惠','优惠后金额','其他费用','收取定金','销售人员','客户签字']
      } else if (type === '销售出库') {
        this.defColumns = this.saleOutColumns
        this.tableOptions = ['序号', '仓库名称', '条码', '名称', '规格', '型号', '颜色', '扩展信息', '库存', '序列号', '批号', '有效期', '多属性', '数量', '单价', '单位', '金额', '税率(%)', '税额', '价税合计', '备注']
        this.otherOptions=['制单人','结算账户','优惠率','收款优惠','优惠后金额','其他费用','关联单据','扣除定金','本次收款','本次欠款','销售人员','客户签字']
      } else if (type === '销售退货入库') {
        this.defColumns = this.saleBackColumns
        this.tableOptions = ['序号', '仓库名称', '条码', '名称', '规格', '型号', '颜色', '扩展信息', '库存', '序列号', '批号', '有效期', '多属性', '数量', '单价', '单位', '金额', '税率(%)', '税额', '价税合计', '备注']
        this.otherOptions=['制单人','结算账户','优惠率','退款优惠','优惠后金额','其他费用','本次退款','销售人员','客户签名']
      } else if (type === '其它入库') {
        this.defColumns = this.otherInColumns
        this.tableOptions = ['序号', '仓库名称', '条码', '名称', '规格', '型号', '颜色', '扩展信息', '库存', '序列号', '批号', '有效期', '多属性', '数量', '单价', '单位', '金额', '备注']
        this.otherOptions=['制单人','关联单据','结算账户']
      } else if (type === '其它出库') {
        this.defColumns = this.otherOutColumns
        this.tableOptions = ['序号', '仓库名称', '条码', '名称', '规格', '型号', '颜色', '扩展信息', '库存', '序列号', '批号', '有效期', '多属性', '数量', '单价', '单位', '金额', '备注']
        this.otherOptions=['制单人','结算账户']
      } else if (type === '调拨出库') {
        this.defColumns = this.allocationOutColumns
        this.tableOptions = ['序号', '仓库名称', '条码', '名称', '规格', '型号', '颜色', '扩展信息', '库存', '调入仓库', '多属性', '数量', '单价', '单位', '金额', '备注']
        this.otherOptions=['制单人']
      } else if (type === '组装单') {
        this.defColumns = this.assembleColumns
        this.tableOptions = ['序号', '商品类型', '仓库名称', '条码', '名称', '规格', '型号', '颜色', '扩展信息', '库存', '多属性', '数量', '单价', '单位', '金额', '备注']
        this.otherOptions=['制单人']
      } else if (type === '拆卸单') {
        this.defColumns = this.disassembleColumns
        this.tableOptions = ['序号', '商品类型', '仓库名称', '条码', '名称', '规格', '型号', '颜色', '扩展信息', '库存', '多属性', '数量', '单价', '单位', '金额', '备注']
        this.otherOptions=['制单人','付款账户','关联单据','付款金额']
      } else if (type === '盘点复盘') {
        this.defColumns = this.stockCheckReplayColumns
        this.tableOptions = ['序号', '仓库名称', '条码', '名称', '规格', '型号', '颜色', '扩展信息', '库存', '调入仓库', '多属性', '数量', '单价', '单位', '金额', '备注']
        this.otherOptions=['制单人']
      }
      let nowColumns = []
      let list = this.checkedTableList
      this.defColumns.forEach(function (item, index) {
        if (list.includes(item.title)) {
          nowColumns.push(item)
        }
      })
      this.defColumns = nowColumns
      //判断序列号、批号、有效期、多属性是否有值
      let needAddkeywords = []
      for (let i = 0; i < ds.length; i++) {
        if (ds[i].snList) {
          needAddkeywords.push('snList')
        }
        if (ds[i].batchNumber) {
          needAddkeywords.push('batchNumber')
        }
        if (ds[i].expirationDate) {
          needAddkeywords.push('expirationDate')
        }
        if (ds[i].sku) {
          needAddkeywords.push('sku')
        }
      }
      if (record.status === '3') {
        //部分采购|部分销售的时候显示全部列
        this.columns = this.defColumns
      } else if (record.purchaseStatus === '3') {
        //将已出库的标题转为已采购，针对销售订单转采购订单的场景
        let currentCol = []
        for (let i = 0; i < this.defColumns.length; i++) {
          let info = {}
          info.title = this.defColumns[i].title
          info.dataIndex = this.defColumns[i].dataIndex
          info.width = this.defColumns[i].width
          if (this.defColumns[i].dataIndex === 'finishNumber') {
            info.title = '已采购'
          }
          currentCol.push(info)
        }
        this.columns = currentCol
      } else {
        let currentCol = []
        for (let i = 0; i < this.defColumns.length; i++) {
          //移除列
          let needRemoveKeywords = []
          if (needRemoveKeywords.indexOf(this.defColumns[i].dataIndex) === -1) {
            let info = {}
            info.title = this.defColumns[i].title
            info.dataIndex = this.defColumns[i].dataIndex
            info.width = this.defColumns[i].width
            currentCol.push(info)
          }
          //添加有数据的列
          if (needAddkeywords.indexOf(this.defColumns[i].dataIndex) > -1) {
            let info = {}
            info.title = this.defColumns[i].title
            info.dataIndex = this.defColumns[i].dataIndex
            info.width = this.defColumns[i].width
            currentCol.push(info)
          }
        }
        this.columns = currentCol
      }
    },
    initPlatform() {
      getPlatformConfigByKey({ "platformKey": "bill_print_flag" }).then((res) => {
        if (res && res.code === 200) {
          if (this.billType === '零售出库' || this.billType === '零售退货入库' ||
            this.billType === '采购订单' || this.billType === '采购入库' || this.billType === '采购退货出库' ||
            this.billType === '销售订单' || this.billType === '销售出库' || this.billType === '销售退货入库') {
            this.billPrintFlag = res.data.platformValue === '1' ? true : false
          }
        }
      })
    },
    getSystemConfig() {
      getCurrentSystemConfig().then((res) => {
        if (res.code === 200 && res.data) {
          this.purchaseBySaleFlag = res.data.purchaseBySaleFlag === '1' ? true : false
        }
      })
    },
    getFinancialBillNoByBillId(billId) {
      getAction('/accountHead/getFinancialBillNoByBillId', { billId: billId }).then(res => {
        if (res && res.code === 200) {
          this.financialBillNoList = res.data
        }
      })
    },
    show(record, type) {
      this.billType = type
      //附件下载
      this.fileList = record.fileName
      this.visible = true;
      this.model = Object.assign({}, record);
      if (this.model.backAmount) {
        this.model.getAmount = (this.model.changeAmount + this.model.backAmount).toFixed(2)
      } else {
        this.model.getAmount = this.model.changeAmount
      }
      this.model.debt = (this.model.discountLastMoney + this.model.otherMoney - (this.model.deposit + this.model.changeAmount)).toFixed(2)
      this.$nextTick(() => {
        this.form.setFieldsValue(pick(this.model, 'id'))
      });
      let showType = 'basic'
      if (record.status === '3') {
        showType = 'basic'
      } else if (record.purchaseStatus === '3') {
        showType = 'purchase'
      }
      let params = {
        headerId: this.model.id,
        mpList: getMpListShort(Vue.ls.get('materialPropertyList')),  //扩展属性
        linkType: showType,
        isReadOnly: '1'
      }
      let url = this.readOnly ? this.url.detailList : this.url.detailList;
      this.requestSubTableData(record, type, url, params);
      this.initPlatform()
      this.getSystemConfig()
      this.getFinancialBillNoByBillId(this.model.id)
    },
    requestSubTableData(record, type, url, params, success) {
      this.loading = true
      getAction(url, params).then(res => {
        if (res && res.code === 200) {
          let arr = []
          this.dataSource = res.data.rows
          let sum = 0
          for (let i of this.dataSource) {
            sum++
            i.soure = sum
          }
          var fRow = new Number(this.$myContent.firstRow);
          var nRow = new Number(this.$myContent.nextRow);
          for (let i = 0; i < this.dataSource.length; i++) {
            if (i == 0) {
              let arr1 = this.dataSource.slice(i, i + fRow)
              arr.push({ arr1 })
            }
            if ((i - fRow) % nRow == 0) {
              let arr1 = this.dataSource.slice(i, i + nRow)
              arr.push({ arr1 })
            }
          }
          this.dataSource = arr
          this.initSetting(record, type, this.dataSource)
          typeof success === 'function' ? success(res) : ''
        }
      }).finally(() => {
        this.loading = false
      })
    },
    handleCancel() {
      this.close()
    },
    close() {
      this.$emit('close');
      this.visible = false;
    },
    myHandleDetail(billNumber) {
      findBillDetailByNumber({ number: billNumber }).then((res) => {
        if (res && res.code === 200) {
          let type = res.data.type === "其它" ? "" : res.data.type
          this.show(res.data, res.data.subType + type);
          this.title = res.data.subType + type + "-详情";
        }
      })
    },
    myHandleFinancialDetail(billNo) {
      let that = this
      findFinancialDetailByNumber({ billNo: billNo }).then((res) => {
        if (res && res.code === 200) {
          if (that.$refs.financialDetailModal) {
            that.$refs.financialDetailModal.show(res.data, res.data.type);
            that.$refs.financialDetailModal.title = res.data.type + "-详情";
          }
        }
      })
    },
    //打印设置
    onChange(checkedValues) {
      this.indeterminate1 = !!checkedTableList.length && checkedTableList.length < tableOptions.length;
      this.checkAll1 = this.checkedTableList.length === tableOptions.length;
      this.indeterminate2 = !!checkedOtherList.length && checkedOtherList.length < otherOptions.length;
      this.checkAll2 = this.checkedOtherList.length === otherOptions.length;
    },
    onCheckAllChange1(e) {
      Object.assign(this, {
        checkedTableList: e.target.checked ? tableOptions : [],
        indeterminate1: false,
        checkAll1: e.target.checked,
      });
    },
    onCheckAllChange2(e) {
      Object.assign(this, {
        checkedOtherList: e.target.checked ? otherOptions : [],
        indeterminate2: false,
        checkAll2: e.target.checked,
      });
    },
    handlePrint() {
      this.threeVisible = true;
    },
    threeOk(e) {
      this.$myContent.setNow(this.printStatus);
      this.$myContent.setFirst(this.firstRow);
      this.$myContent.setNext(this.nextRow);
      this.confirmLoading = true;

      this.show(this.model, this.model.subType + this.model.type)
      setTimeout(() => {
        this.threeVisible = false;
        this.confirmLoading = false;
      }, 100);
    },
    threeCancel(e) {
      this.threeVisible = false;
    },
    //数字大写
    convertCurrency(money) {
      // 汉字的数字
      let cnNums = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
      // 基本单位
      let cnIntRadice = ['', '拾', '佰', '仟'];
      // 对应整数部分扩展单位
      let cnIntUnits = ['', '万', '亿', '兆'];
      // 对应小数部分单位
      let cnDecUnits = ['角', '分', '毫', '厘'];
      // 整数金额时后面跟的字符
      let cnInteger = '整';
      // 整型完以后的单位
      let cnIntLast = '元';
      // 最大处理的数字
      let maxNum = 999999999999999.9999;
      // 金额整数部分
      let integerNum;
      // 金额小数部分
      let decimalNum;
      // 输出的中文金额字符串
      let chineseStr = '';
      // 分离金额后用的数组，预定义
      let parts;
      if (money == '') {
        return '';
      }
      money = parseFloat(money);
      if (money >= maxNum) {
        // 超出最大处理数字
        return '';
      }
      if (money == 0) {
        chineseStr = cnNums[0] + cnIntLast + cnInteger;
        return chineseStr;
      }
      // 转换为字符串
      money = money.toString();
      if (money.indexOf('.') == -1) {
        integerNum = money;
        decimalNum = '';
      } else {
        parts = money.split('.');
        integerNum = parts[0];
        decimalNum = parts[1].substr(0, 4);
      }
      // 获取整型部分转换
      if (parseInt(integerNum, 10) > 0) {
        let zeroCount = 0;
        let IntLen = integerNum.length;
        for (let i = 0; i < IntLen; i++) {
          let n = integerNum.substr(i, 1);
          let p = IntLen - i - 1;
          let q = p / 4;
          let m = p % 4;
          if (n == '0') {
            zeroCount++;
          } else {
            if (zeroCount > 0) {
              chineseStr += cnNums[0];
            }
            // 归零
            zeroCount = 0;
            chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
          }
          if (m == 0 && zeroCount < 4) {
            chineseStr += cnIntUnits[q];
          }
        }
        chineseStr += cnIntLast;
      }
      // 小数部分
      if (decimalNum != '') {
        let decLen = decimalNum.length;
        for (let i = 0; i < decLen; i++) {
          let n = decimalNum.substr(i, 1);
          if (n != '0') {
            chineseStr += cnNums[Number(n)] + cnDecUnits[i];
          }
        }
      }
      if (chineseStr == '') {
        chineseStr += cnNums[0] + cnIntLast + cnInteger;
      } else if (decimalNum == '') {
        chineseStr += cnInteger;
      }
      return chineseStr;
    },
  }
}

</script>

<style lang="less" scoped>
/deep/table,
/deep/table th,
/deep/.ft-style {
  border-radius: 0;
  text-align: center;
  font-size: 18px;
  background: white;
  font-weight: normal;
  border: 2px solid black;
  border-top: 0;
  color: black;
}

/deep/table td {
  color: black;
  font-size: 16px;
  border: 2px solid black;
  border-top: 0;
}

/deep/table td:first-child,
/deep/table th:first-child {
  border-left: 0;
}

/deep/.tb-style {
  border: 2px solid black;
  border-bottom: 0;
}

/deep/.ant-form-item label,
.ant-row,
/deep/.ant-table-footer {
  font-size: 18px;
  border-radius: 0;
  color: black;
  text-align: left;
}

/deep/.ant-table.ant-table-bordered .ant-table-footer {
  border-bottom: 2px solid black;
}

/deep/.ant-col {
  text-align: left;
}

// /deep/.ant-col-12,
// /deep/.ant-col-24 {
//   text-align: center;
// }

/deep/.three {
  width: 97%;
  min-height: 540px;
}

/deep/.three:first-child {
  min-height: 440px;
}

/deep/.three:last-child {
  min-height: 0;
}

/deep/.two {
  width: 97%;
  min-height: 800px;
}

/deep/.two:first-child {
  min-height: 700px;
}

/deep/.two:last-child {
  min-height: 0;
}

/deep/.one {
  width: 97%;
  min-height: 1580px;
}

/deep/.one:first-child {
  min-height: 1520px;
}

/deep/.one:last-child {
  min-height: 0;
}

/deep/.ant-checkbox-group-item {
  width: 150px;
  font-size: 16px;
  margin: 5px;
}
</style>