电子--用章统计

<template>
  <div class="projectBox project_list">
    <!-- 项目列表 -->
    <basic-container class="projectManange">
      <div class="search-head">
        <el-input v-model="keywork" size="small" class="select-law" placeholder="文件名称/编号/申请人"></el-input>
        <el-date-picker
          v-model="searchDate"
          class="select-date"
          size="small"
          type="daterange"
          range-separator="~"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          value-format="yyyy-MM-dd">
        </el-date-picker>
        <el-button
          size="small"
          type="primary"
          @click="search"
          >搜索</el-button>
      </div>
      <div class="statistics-table">
        <el-table
          :data="tableData"
          style="width: 100%">
          <el-table-column
            label="文件名称"
            show-overflow-tooltip>
            <template slot-scope="scope">
              <div class="file_name">{{scope.row.FileName}}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="FileCode"
            label="编号">
          </el-table-column>
          <el-table-column
            prop="CreateName"
            label="申请人">
          </el-table-column>
           <el-table-column
            prop="CreateDate"
            label="日期">
          </el-table-column>
        </el-table>
        <div class="fenye-page clearfix">
          <div class="left">
            <span>份数:{{printInfo.SignNum}}</span>
            <span>金额:{{printInfo.SignNum * printInfo.Price}}(元)</span>
          </div>
          <div class="right">
            <el-pagination
            background
            layout="total, sizes, prev, pager, next"
            :page-size.sync="page.pageSize"
            :page-sizes=[10,20,50]
            @size-change="changeSize"
            @current-change="changeCurrent"
            :total="page.total">
            </el-pagination>
          </div>
        </div>
      </div>
    </basic-container>
  </div>
</template>

<script>
import * as Api from "@/api/signature/index";
import { encryptionObject } from "@/util/util";
export default {
  name:"statistics",
  data(){
    return{
      keywork:'',
      searchDate:[],
      options: [{
          value: '选项1',
          label: '黄金糕'
        }, {
          value: '选项2',
          label: '双皮奶'
        }],
      tableData:[],
      page: {
        total: 0,
        pageSize: 20,
        currentPage: 1
      },
      printInfo:{}
    }
  },
  created(){
    this.getSignList();
    this.getPrintInfo();
  },
  methods:{
    getSignList(){
      const Begin = this.searchDate[0] ? new Date(this.searchDate[0]).toISOString() : "";
      const End = this.searchDate[1] ? new Date(this.searchDate[1]).toISOString() : "";
      const pageData = {
        pageNo: this.page.currentPage - 1,
        pageSize: this.page.pageSize,
        Keywork: this.keywork,
        Begin,
        End
      };
      const dataObj = encryptionObject({
        data: pageData,
        type: "Base64",
        key: "avue"
      });
      const param = {
        param: dataObj
      };
      Api.SignListOld(param).then((res )=> {
        if(res.data.Code == 200){
          this.tableData = res.data.Data.Items;
          this.page.total = res.data.Data.Count;   
        }else{
          this.$alert(res.data.ShowData, '提示', {
            confirmButtonText: '确定',
            type: 'error'
          });
        }         
      }).catch((error)=>{
        if(error.data.Code == 400){
          this.$alert(error.data.ShowData, '提示', {
            confirmButtonText: '确定',
            type: 'error'
          });
        }
      });
    },
    getPrintInfo(){
      Api.LawSign().then((res )=> {
        if(res.data.Code == 200){
          this.printInfo = res.data.Data;
        }else{
          this.$alert(res.data.ShowData, '提示', {
            confirmButtonText: '确定',
            type: 'error'
          });
        }         
      }).catch((error)=>{
        if(error.data.Code == 400){
          this.$alert(error.data.ShowData, '提示', {
            confirmButtonText: '确定',
            type: 'error'
          });
        }
      });
    },
    changeSize(value){
      this.page.currentPage = 1;
      this.page.pageSize = value;
      this.getSignList();
    },
    changeCurrent(value){
      this.page.currentPage = value;
      this.getSignList();
    },
    search(){
      this.getSignList();
    }
  }
}
</script>

<style lang="scss">
.search-head{
  .select-law{
    width: 160px;
  }
  .select-date{
    width: 260px;
    margin: 0 30px;
  }
}
.statistics-table{
  margin-top: 24px;
  .fenye-page{
    margin-top: 30px;
    line-height: 32px;
    .left{
      float: left;
      color: #666666;
      font-size: 13px;
      span{
        margin-right: 80px;
        &:last-child{
          margin-right: 0;
        }
      }
    }
    .right{
      float: right;
    }
  }
}
</style>
posted @ 2020-05-06 14:12  xiaoxiao95  阅读(144)  评论(0编辑  收藏  举报