From 5e9b4920000a4d02eef3b207218e3ce8d68935be Mon Sep 17 00:00:00 2001
From: charles <981744753@qq.com>
Date: 星期四, 11 七月 2024 17:47:05 +0800
Subject: [PATCH] feat:纤度登记表重构
---
src/views/reportManage/payableSalaryReport/index.vue | 257 +++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 246 insertions(+), 11 deletions(-)
diff --git a/src/views/reportManage/payableSalaryReport/index.vue b/src/views/reportManage/payableSalaryReport/index.vue
index 67cd691..347c747 100644
--- a/src/views/reportManage/payableSalaryReport/index.vue
+++ b/src/views/reportManage/payableSalaryReport/index.vue
@@ -1,21 +1,256 @@
<template>
- <div class="container"></div>
+ <div class="silkRegister-form">
+ <div class="filter">
+ <div class="filter-card">
+ <CommonSearch
+ :show-add="false"
+ :show-download="false"
+ :amount-view="false"
+ :show-action-btn="false"
+ placeholder="璇疯緭鍏ュ叧閿瘝"
+ @searchClick="onFilterSearch"
+ >
+ <template slot="leftButton">
+ <div class="margin_right_20px" >
+ <el-date-picker v-model="object.date"
+ style="width:200px;"
+ class="margin_right_20px"
+ @change="onFilterSearch(object.date,'date')"
+ :clearable="false" type="month" placeholder="閫夋嫨鏃ユ湡"
+ :picker-options="pickerOptions"
+ value-format="yyyy-MM">
+ </el-date-picker>
+ <el-button size="small" type="primary" @click="exportBtnClick">瀵煎嚭</el-button>
+ </div>
+ </template>
+ </CommonSearch>
+ </div>
+ </div>
+
+ <div class="body">
+ <div class="body-card">
+ <div class="list-view">
+ <TableCommonView
+ ref="tableListRef"
+ v-loading="loading"
+ :table-list="tableList"
+ @selTableCol="selTableCol"
+ @inputContent="inputContent"
+ >
+ </TableCommonView>
+ </div>
+ <div class="btn-pager">
+ <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
+ </div>
+ </div>
+ </div>
+ </div>
</template>
<script>
+import { salaryReportForms } from "@/api/reportManage/report.js"
+import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
+import NewDate from "@/api/date";
+const { getCurrentMonth } = NewDate;
export default {
- name: "payableSalaryReport",
- props: {},
- components: {},
- mixins: [],
- computed: {},
- data() {
- return {}
+ name: "attendanceStatistics",
+ props: {
},
- created() {},
- methods: {}
+ mixins: [pageMixin],
+ components: {
+ },
+ data() {
+ return {
+ tableList: {},
+ loading: false,
+ pickerOptions: {
+ disabledDate(time) {
+ return time.getTime() > new Date().getTime() - 86400000;
+ },
+ },
+ object:{
+ date:getCurrentMonth()
+ },
+ searchOptions: [],
+ keyword: "",
+ tableColumn: [
+ { label: "濮撳悕", prop: "workerName", min: 120, default: true },
+ { label: "浜哄憳id", prop: "workerId", min: 190,default: true},
+ { label: "鎵嬫満鍙�", prop: "phone" },
+ { label: "宸ョ", prop: "workType", min: 100, },
+ { label: "搴斿彂宸ヨ祫", prop: "issueSalary", min: 110 },
+ { label: "澶囨敞", prop: "remark", min: 110 },
+ ],
+ showCol: [
+ "鎵嬫満鍙�",
+ "宸ョ",
+ "搴斿彂宸ヨ祫",
+ "澶囨敞",
+ ]
+ }
+ },
+ created() {
+ this.setTable()
+ this.getData(this.keyword)
+ },
+ computed: {
+ },
+ methods: {
+ setTable() {
+ this.tableList = {
+ selectIndex: true,
+ isFixed: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:ele.default?true:showCol.includes(ele.label)
+ }
+ })
+ },
+ selTableCol(val) {
+ this.showcol = val;
+ this.tableList.tableColumn = this.setColumnVisible(val);
+ },
+ // 璇锋眰鏁版嵁
+ async getData() {
+ this.loading = true
+ await salaryReportForms({
+ keyword: this.keyword,
+ month:this.object.date,
+ page: this.pagerOptions.currPage,
+ pageSize: this.pagerOptions.pageSize
+ })
+ .then((res) => {
+ if (res.code == 200) {
+ if (res.data && res.data.length > 0) {
+ let tableColumn1= [
+ { label: "濮撳悕", prop: "workerName", min: 120,default: true,fixed:'left' },
+ { label: "浜哄憳ID", prop: "workerId", min: 120,default: true,fixed:'left'},
+ { label: "鎵嬫満鍙�", prop: "client_level" },
+ { label: "宸ョ", prop: "workType", min: 100,fixed:'left' },
+ ];
+ let tableColumn3=[
+ { label: "澶囨敞", prop: "actualAttendanceDays", min: 110 },
+ ]
+ let tableColumn2=[]
+ let headerList=res.data.details?res.data.details:[]
+ if(headerList&&headerList.length>0){
+ for(let i in headerList){
+ tableColumn2.push({
+ label:headerList[i].salaryType+'',
+ prop:'header&'+headerList[i].salaryType+'&'+headerList[i].salaryTypeId,
+ min:150,
+ default:true,
+ isEditTd:true,
+ })
+ }
+ }
+
+ let tableColumn=tableColumn1.concat(tableColumn2).concat(tableColumn3)
+ this.tableColumn=tableColumn;
+ this.setTable()
+ const list = res.data.map((item) => {
+ let headerItem={}
+ let details=item.details?item.details:[]
+ for(let i in details){
+ headerItem['header&'+details[i].salaryType+'&'+details[i].salaryTypeId]=details[i].amount
+ }
+ return {
+ ...item,
+ ...headerItem,
+ }
+ })
+ this.tableList.tableInfomation = list || []
+ this.pagerOptions.totalCount = res.total||0
+ } else {
+ this.tableList.tableInfomation = []
+ }
+ } else {
+ this.tableList.tableInfomation = []
+ }
+ this.loading = false
+ })
+ .catch((err) => {
+ console.log(err)
+ this.tableList.tableInfomation = []
+ this.loading = false
+ })
+ },
+ // 鎼滅储
+ onFilterSearch(searchText,val) {
+ if(val!='date'){
+ this.keyword = searchText ?? ""
+ }
+ this.pagerOptions.currPage = 1
+ this.getData()
+ },
+ inputContent( prop, row, scope){
+ console.log(prop,'---',row,'---',scope)
+ },
+ // 瀵煎嚭
+ exportBtnClick() {}
+ }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.silkRegister-form {
+ height: 100%;
+ overflow: hidden;
+ .filter {
+ height: 80px;
+ display: flex;
+ align-items: center;
+ padding: 12px 20px 0 20px;
+ &-card {
+ height: 80px;
+ display: flex;
+ align-items: center;
+ box-sizing: border-box;
+ padding: 10px 20px;
+ flex: 1;
+ border-radius: 12px;
+ background-color: #fff;
+ }
+ }
+ .body {
+ box-sizing: border-box;
+ padding: 10px 20px;
+ border-radius: 12px;
+ height: calc(100% - 102px);
+ .body-card {
+ background-color: #fff;
+ border-radius: 12px;
+ height: 100%;
+ box-sizing: border-box;
+ overflow: hidden;
+ }
+ .list-view {
+ height: calc(100% - 60px);
+ overflow: hidden;
+ }
+ .btn-pager {
+ display: flex;
+ margin-top: 10px;
+ .page {
+ margin-left: auto;
+ }
+ }
+ }
+}
+</style>
--
Gitblit v1.8.0