<template>
  <div>
    <el-dialog
      :title="title"
      :close-on-click-modal="false"
	  draggable
      width="90%"
      height="500px"
      @close="close"
      append-to-body
      v-model="visible">
		<!--报告        -->
		<div>
			<el-form size="large" :inline="true" class="query-form" ref="searchForm" :model="searchForm"
					 @submit.native.prevent>
				<!-- 搜索框-->
				<el-form-item label="项目名称" prop="projectName">
					<el-input size="large" v-model="searchForm.projectName" placeholder="请输入项目名称" clearable></el-input>
				</el-form-item>
				<el-form-item label="报告号" prop="reportNo">
					<el-input size="large" v-model="searchForm.reportNo" placeholder="请输入报告号" clearable></el-input>
				</el-form-item>
				<el-form-item label="报告创建时间" prop="createDates">
					<el-date-picker
						placement="bottom-start"
						format="YYYY-MM-DD HH:mm:ss"
						value-format="YYYY-MM-DD HH:mm:ss"
						v-model="searchForm.createDates"
						type="datetimerange"
						range-separator="至"
						start-placeholder="开始日期"
						end-placeholder="结束日期">
					</el-date-picker>
				</el-form-item>

				<el-form-item>
					<el-button type="primary" @click="list()" size="large" icon="el-icon-search">查询</el-button>
					<el-button @click="resetSearch1()" size="large" icon="el-icon-refresh-right">重置</el-button>
				</el-form-item>
			</el-form>

			<vxe-table
				border="inner"
				auto-resize
				resizable
				height="550px"
				:loading="loading"
				size="large"
				ref="projectTable1"
				show-header-overflow
				show-overflow
				highlight-hover-row
				:menu-config="{}"
				:print-config="{}"
				@sort-change=""
				:sort-config="{remote:true}"
				:data="dataList1"
				:row-config="{isCurrent: true}"
				:checkbox-config="{trigger: 'row'}"
			>
				<vxe-column type="seq" width="60" title="序号"></vxe-column>
				<vxe-column min-width="230" align="center" title="项目名称" field="projectName" show-overflow="title"></vxe-column>
				<vxe-column min-width="230" align="center" title="项目编号" field="projectNumber"></vxe-column>
				<vxe-column min-width="230" align="center" title="报告文号" field="reportNo">
					<template #default="scope">
						<el-link  type="primary" :underline="false"  @click="view(scope.row.id)">{{scope.row.documentNo}}</el-link>
					</template>
				</vxe-column>
				<vxe-column min-width="230" align="center" title="审定金额(含税/元)" field="approvedIncludingTax"></vxe-column>
				<vxe-column min-width="230" align="center" title="审定金额(不含税/元)" field="approvedNoIncludingTax"></vxe-column>
				<vxe-column min-width="160" align="center" title="合同名称" field="contractName"></vxe-column>
				<vxe-column min-width="160" align="center" title="报告创建人" field="userName"></vxe-column>
				<vxe-column min-width="160" align="center" title="报告创建时间" field="createTime"></vxe-column>

			</vxe-table>
			<vxe-pager
				background
				size="large"
				:current-page="tablePage1.currentPage"
				:page-size="tablePage1.pageSize"
				:total="tablePage1.total"
				:page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
				:layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
				@page-change="currentChangeHandle1">
			</vxe-pager>
		</div>
    </el-dialog>
  </div>
</template>

<script>
  import projectRecordsService from '@/api/cw/projectRecords/ProjectRecordsService'
  export default {
    data () {
      return {
        title: '',
        method: '',
        visible: false,
        loading: false,
        tablePage: {
          total: 0,
          currentPage: 1,
          pageSize: 10,
          orders: []
        },
	    tablePage1: {
		  total: 0,
		  currentPage: 1,
		  pageSize: 10,
		  orders: []
	    },
		  tablePage2: {
			  total: 0,
			  currentPage: 1,
			  pageSize: 10,
			  orders: []
		  },
        dataList: [],
        dataList1: [],
        dataList2: [],
        searchForm: {
          name: '',
          no: '',
          createBy: '',
		  signatureAnnotator1: '',
          projectMasterName: '',
          projectNumber: '',
          projectName: '',
          createDates: [],
		  reportNo: '',
          status: ''
        },
        detail: '',
		reportType:''
      }
    },
    created () {
    },
    components: {
    },
    methods: {
      init (userId) {
      	this.searchForm.signatureAnnotator1 = userId
        this.visible = true
        this.list()
      },
      list () {
        this.loading = true
        projectRecordsService.getSignatureScribeList({
          'current': this.tablePage1.currentPage,
          'size': this.tablePage1.pageSize,
          'orders': this.tablePage1.orders,
          ...this.searchForm
        }).then((data) => {
          this.dataList1 = data.records
          this.tablePage1.total = data.total
          this.loading = false
        })
      },
      // 当前页
      currentChangeHandle ({currentPage, pageSize}) {
        this.tablePage1.currentPage = currentPage
        this.tablePage1.pageSize = pageSize
        this.list()
      },
      resetSearch () {
        this.$refs.searchForm.resetFields()
        this.list()
      },
	  currentChangeHandle1 ({currentPage, pageSize}) {
		this.tablePage1.currentPage = currentPage
		this.tablePage1.pageSize = pageSize
		this.list()
	  },
		// 查看
		view (id) {
			this.$refs.reportManagementForm.init('view', id, '报告审核单下载')
		},
	  resetSearch1 () {
		this.$refs.searchForm.resetFields()
		this.list()
	  },
      close () {
        this.detail = ''
        this.visible = false
      }
    }
  }
</script>
<style>
  .messageZindex {
    z-index:9999 !important;
  }
</style>
