zuozhengqing
2024-04-07 12b5feba10e8f30553999d77205eb25ec0598f90
src/views/reportManage/productionReport/index.vue
@@ -1,21 +1,130 @@
<template>
  <div class="container"></div>
  <div class="productionRreport-container">
    <div class="filter-card">
      <CommonSearch :show-add="false" :amount-view="false" placeholder="请输入关键词" @searchClick="onFilterSearch">
        <template slot="leftButton">
          <el-button size="small" type="primary" @click="exportBtnClick">导出</el-button>
        </template>
      </CommonSearch>
    </div>
    <div class="body-card">
      <div class="list-view">
        <TableCommonView ref="tableListRef" v-loading="loading" :table-list="tableList" @selTableCol="selTableCol">
        </TableCommonView>
      </div>
      <!-- <div class="btn-pager">
        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
      </div> -->
    </div>
  </div>
</template>
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
export default {
  name: "productionReport",
  props: {},
  components: {},
  mixins: [],
  mixins: [pageMixin],
  computed: {},
  data() {
    return {}
    return {
      loading: false,
      tableList: {},
      tableColumn: [
        { label: "车间", prop: "name", default: true },
        { label: "机组", prop: "member_name" },
        { label: "Ⅱ度", prop: "client_level" },
        { label: "清洁", prop: "next_visit_time" },
        { label: "洁净", prop: "detail_address" },
        { label: "最大纤度", prop: "client_status" },
        { label: "最小纤度", prop: "contact_name" },
        { label: "平均纤度", prop: "contact_phone" },
        { label: "公量纤度", prop: "client_level" },
        { label: "最大偏差", prop: "next_visit_time" },
        { label: "纤度偏差", prop: "detail_address" },
        { label: "日产量", prop: "client_status" },
        { label: "等级", prop: "contact_name" },
        { label: "综合等级", prop: "contact_phone" }
      ],
      showCol: [
        "车间",
        "机组",
        "Ⅱ度",
        "清洁",
        "洁净",
        "最大纤度",
        "最小纤度",
        "平均纤度",
        "公量纤度",
        "最大偏差",
        "纤度偏差",
        "日产量",
        "等级",
        "综合等级"
      ]
    }
  },
  created() {},
  methods: {}
  created() {
    this.setTable()
  },
  methods: {
    setTable() {
      this.tableList = {
        selectIndex: true,
        tableInfomation: [],
        allcol: [],
        showcol: this.showCol,
        tableColumn: this.setColumnVisible(this.showCol)
      }
      this.tableList.allcol = this.tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
      this.searchOptions = []
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        const label = this.tableList.tableColumn[i].label
        const value = this.tableList.tableColumn[i].prop
        this.searchOptions.push({ value: value, label: label })
      }
    },
    setColumnVisible(showCol) {
      return this.tableColumn.map((ele) => {
        return {
          ...ele,
          isShowColumn: showCol.includes(ele.label)
        }
      })
    },
    selTableCol(val) {
      this.showcol = val
      this.tableList.tableColumn = this.setColumnVisible(val)
    },
    // 搜索
    onFilterSearch(searchText) {
      console.log(searchText)
    },
    // 导出
    exportBtnClick() {}
  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped></style>
<style lang="scss" scoped>
.productionRreport-container {
  height: 100%;
  .filter-card {
    margin: 20px 30px;
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 20px 0 20px;
    border-radius: 12px;
    background-color: #fff;
  }
  .body-card {
    margin: 0 30px;
    background-color: #fff;
    padding: 10px 15px;
    height: calc(100% - 180px);
  }
}
</style>