zuozhengqing
2024-04-07 12b5feba10e8f30553999d77205eb25ec0598f90
src/views/reportManage/payableSalaryReport/index.vue
@@ -1,21 +1,154 @@
<template>
  <div class="container"></div>
  <div class="payableSalaryReport-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>
          <el-button size="small" type="primary" @click="refreshBtnClick">刷新</el-button>
        </template>
      </CommonSearch>
    </div>
    <div class="body-card">
      <div class="list-view">
        <TableCommonView
          ref="tableListRef"
          v-loading="loading"
          :colOpenShow="false"
          :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: "payableSalaryReport",
  props: {},
  components: {},
  mixins: [],
  mixins: [pageMixin],
  computed: {},
  data() {
    return {}
    return {
      loading: false,
      tableList: {},
      tableColumn: [
        { label: "姓名", prop: "name", default: true, fixed: true },
        { label: "人员id", 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" },
        { label: "质量奖", prop: "contact_phone" },
        { label: "奖罚1", prop: "client_level" },
        { label: "奖罚2/清凉补", prop: "next_visit_time", width: "110" },
        { label: "日常检查/奖罚3", prop: "detail_address", width: "110" },
        { label: "停机补贴", prop: "client_status" },
        { label: "应发工资", prop: "contact_name" },
        { label: "备注", prop: "contact_phone", width: "140" }
      ],
      showCol: [
        "姓名",
        "人员id",
        "手机号",
        "工种",
        "生产工资",
        "满勤",
        "超时工资",
        "加班工资",
        "交通补贴",
        "带徒补贴",
        "岗位补贴",
        "社保补贴",
        "工龄补贴",
        "不达保底",
        "质量奖",
        "奖罚1",
        "奖罚2/清凉补",
        "日常检查/奖罚3",
        "停机补贴",
        "应发工资",
        "备注"
      ]
    }
  },
  created() {},
  methods: {}
  created() {
    this.setTable()
  },
  methods: {
    setTable() {
      this.tableList = {
        selectIndex: true,
        fixed: true,
        tableInfomation: [{ name: "张三" }, { name: "lisi" }, { name: "王五" }],
        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() {},
    // 刷新
    refreshBtnClick() {}
  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped></style>
<style lang="scss" scoped>
.payableSalaryReport-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>