<template>
  <a-modal
    title="采购数量"
    v-model="purchaseAmountModVis"
    :confirmLoading="confirmLoading"
    width="86%"
    style="top:330px;left:100px;"
    :footer="null"
  >
    <!-- tabel 加载 -->
    <a-spin :spinning="confirmLoading">
      <!-- 查询  -->
      <div class="table-page-search-wrapper">
        <a-form layout="inline" @keyup.enter.native="searchQuery">
          <a-row :gutter="24">
            <a-col :md="6" :sm="8">
              <a-form-item label="纱批">
                <a-input placeholder="请输入纱批" v-model="queryParam.yarnNum"></a-input>
              </a-form-item>
            </a-col>

            <a-col :md="6" :sm="8">
              <a-form-item label="采购单价">
                <a-input placeholder="请输入采购单价" v-model="queryParam.purchasePrice"></a-input>
              </a-form-item>
            </a-col>

            <a-col :md="6" :sm="8">
              <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
                <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
                <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
                <a @click="handleToggleSearch" style="margin-left: 8px">
                  {{ toggleSearchStatus ? '收起' : '展开' }}
                  <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
                </a>
              </span>
            </a-col>
          </a-row>
        </a-form>
      </div>

      <!-- table -->
      <div>
        <a-table
          :loading="loading"
          bordered
          :columns="purchaseAmountColumns"
          :data-source="purchaseAmountData"
          :pagination="false"
        >
        </a-table>
        <!-- 导出 打印 返回  -->
        <a-row style="marginTop:20px;">
          <a-col :md="24" :sm="12">
            <span style="float: right;" class="table-operator">
              <a-button type="primary" icon="download" @click="handleExportXls('采购数量')">导出</a-button>
              <a-button type="primary" @click="print" icon="printer" style="margin:0 10px;">打印</a-button>
              <a-button type="primary" @click="backFabricLossTable" icon="rollback">取消</a-button>
            </span>
          </a-col>
        </a-row>
      </div>
    </a-spin>
  </a-modal>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JEllipsis from '@/components/jeecg/JEllipsis'
export default {
  name: 'PurchaseAmountModal', // 采购数量 弹框
  mixins: [JeecgListMixin],
  components: { JEllipsis },
  data() {
    return {
      // 表头
      purchaseAmountColumns: [
        {
          title: '单据号',
          dataIndex: 'orderNum',
          width: 120,
          key: '',
          className: 'replacecolor'
        },
        {
          title: '单据类型',
          dataIndex: 'documentType',
          width: 120,
          key: '',
          className: 'replacecolor'
        },
        {
          title: '入库单数量',
          dataIndex: 'inReceiptQuantity',
          width: 120,
          key: '',
          className: 'replacecolor'
        },
        {
          title: '含税单价',
          dataIndex: 'priceInTax',
          width: 120,
          key: '',
          className: 'replacecolor'
        },
        {
          title: '开票数',
          dataIndex: 'invoicedQuantity',
          width: 120,
          key: '',
          className: 'replacecolor'
        },
        {
          title: '未开票数',
          dataIndex: 'notInvoicedQuantity',
          width: 120,
          key: '',
          className: 'replacecolor'
        },
        {
          title: '结算数量',
          dataIndex: 'isquantity',
          width: 120,
          key: '',
          className: 'replacecolor'
        },
        {
          title: '未结算数量',
          dataIndex: 'notIsquantity',
          width: 120,
          key: '',
          className: 'replacecolor'
        }
      ],
      purchaseAmountData: [{}, {}, {}],
      loading: false, // 表格加载
      // orderDataform: this.$form.createForm(this),
      confirmLoading: false,
      purchaseAmountModVis: false,

      // 查询条件
      queryParam: {
        yarnNum: '', // 纱批
        purchasePrice: '' // 采购单价
      }
    }
  },
  // 接收父组件 方法
  props: {
    father: {
      type: Function,
      default: null
    }
  },
  created() {},
  methods: {
    // 第一行 导出
    // handleExportXls() {},
    // 打印
    print() {},
    // 返回
    backFabricLossTable() {
      console.log('返回到面料损耗表')
      // this.$router.push('fabricLoss-table')
      // this.purchaseAmountModVis = false
      this.close()
    },
    // 弹框查询按钮
    searchQuery() {},
    // 重置
    searchReset() {
      this.queryParam.title = ''
      this.queryParam.isRelease = ''
      // this.getShipmentList()
    },
    close() {
      this.$emit('close')
      this.purchaseAmountModVis = false
    }
  }
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
@import '~@assets/less/overwriter.less';
/deep/ .ant-table-thead > tr > th {
  text-align: center;
  // font-weight: 700;
}

/deep/ .ant-table-tbody {
  text-align: center;
}

// /deep/ th.replacecolor {
//   background-color: #ccc;
// }
</style>
