<template>
  <div id="declareElementsModal">
    <a-modal
      title="审批历史"
      v-model="histiryModVis"
      :confirmLoading="confirmLoading"
      @cancel="handleCancel"
      width="80%"
      style="top:330px;left:100px;"
    >
      <!-- 増行 子表 -->
      <a-card :bordered="false" style="margin:10px 0">
        <!-- 子表 -->
        <a-spin :spinning="confirmLoading">
          <a-form-model ref="formRef">
            <a-table
              v-if="historyData"
              bordered
              rowKey="id"
              :columns="historyColumns"
              :data-source="historyData"
              :loading="loading"
              :pagination="false"
               :scroll="{y: 500}"
            >
            </a-table>
          </a-form-model>
        </a-spin>
      </a-card>

      <!-- 页面底部保存取消 -->
      <div
        :style="{
          position: 'absolute',
          right: 0,
          bottom: 0,
          width: '100%',
          borderTop: '1px solid #e9e9e9',
          padding: '10px 16px',
          background: '#fff',
          textAlign: 'right',
          zIndex: 1
        }"
      >
        <!-- <a-popconfirm title="确定放弃？" @confirm="handleCancel" okText="确定" cancelText="取消"> -->
          <a-button :style="{ marginRight: '8px' }" @click="handleCancel">返回</a-button>
        <!-- </a-popconfirm>
        <a-button type="primary" @click="addSave">
          保存
        </a-button> -->
      </div>
    </a-modal>
  </div>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JEllipsis from '@/components/jeecg/JEllipsis'
import moment from 'moment'
import {historyApproval } from '@api/document/fabricLossesSummary.js'

export default {
  name: 'DeclareElementsModal', // 报关要素
  mixins: [JeecgListMixin],
  components: { JEllipsis, moment },

  data() {
    let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略

    return {
      loading: false, // 表格加载
      pushState: false, //是否推送
      query:'1',//是否查询
      // 子表表头
      historyColumns: [
        {
          title: '序号',
          width: 30,
          dataIndex: 'index',
          customRender: (text, record, index) => `${index + 1}`,
          className: 'replacecolor'
        },
        {
          title: '状态',
          dataIndex: 'stuta',
          width: 250,
          className: 'replacecolor'
        },
        {
          title: '计划号',
          dataIndex: 'planNo',
          width: 250,
          className: 'replacecolor'
        },
        {
          title: '处理人',
          dataIndex: 'processedBy',
          width: 200,

          className: 'replacecolor'
        },

        {
          title: '处理时间',
          dataIndex: 'processingTime',
          width: 200,
          className: 'replacecolor'
        },
        {
          title: '处理意见',
          dataIndex: 'processingOpinion',
          width: 200,
          className: 'replacecolor'
        }
      ],
      declareElements: {}, // 主表信息
      historyData: [], // 子表信息
      confirmLoading: false,
      histiryModVis: false,
    }
  },
  // 接收父组件 方法
  props: {},

  created() {  
  },
  methods: {
    getHistoryList(data){
      historyApproval({code:data}).then(res => {
          if (res.success) {
            this.historyData = res.result
          }else{
            this.$message.error(res.message);
          }
        })
    },
    handleCancel(){
      this.histiryModVis = false 
    }
  },

  computed: {}
}
</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;
}
// th.replacecolor {
// background-color:  #ccc;
// }
// 对话框里的card样式
/deep/ .ant-modal-content {
  background-color: #f0f2f5;
}
/deep/ .ant-modal-body {
  padding: 10px;
}
/deep/.ant-form-item{
  margin-bottom: 0px !important;
}
// /deep/.ant-table-tbody .ant-table-row td{
//   padding-top: 2px;
//     padding-bottom: 2px;
// }

// /deep/ .ant-table-thead > tr > th, .ant-table-tbody > tr > td{
//   padding: 9px 16px
// }
</style>
