From 9ad048e36bef6d735bf0ef0c12698696e7d5100b Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期二, 23 四月 2024 18:36:35 +0800 Subject: [PATCH] 考勤统计的列表联调+表头动态数据重组的逻辑处理+详情数据的重组问题+更新考勤的接口联调 --- src/views/employeeSalary/attendanceManage/index.vue | 74 +++++++++++++++++++------------------ 1 files changed, 38 insertions(+), 36 deletions(-) diff --git a/src/views/employeeSalary/attendanceManage/index.vue b/src/views/employeeSalary/attendanceManage/index.vue index 1b5873a..bc9c870 100644 --- a/src/views/employeeSalary/attendanceManage/index.vue +++ b/src/views/employeeSalary/attendanceManage/index.vue @@ -13,6 +13,7 @@ <template slot="leftButton"> <el-button size="small" type="primary" @click="exportClick">瀵煎叆</el-button> <el-button size="small" type="primary" @click="synchClick">鍚屾</el-button> + <el-button size="small" type="primary" @click="ruleSettingClick">瑙勫垯璁剧疆</el-button> </template> </CommonSearch> </div> @@ -30,7 +31,7 @@ <template slot="tableButton"> <el-table-column label="鎿嶄綔" width="90" fixed="right"> <template slot-scope="scope"> - <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> + <el-button @click="delClick(scope.row)" type="text" size="small">鍒犻櫎</el-button> </template> </el-table-column> </template> @@ -41,19 +42,22 @@ </div> </div> </div> + <!-- 瑙勫垯璁剧疆 --> + <RuleSettingDialog ref="RuleSettingDialog" :editRow="editRow" @closeClick="getData" /> </div> </template> <script> -import { getFollowRecordList, getDeleteFollowRecord } from "@/api/productManage/silkRegisterForm.js" +import { getAttendanceList, deleteAttendanceInfo } from "@/api/employeeSalary/attendanceManage.js" import pageMixin from "@/components/makepager/pager/mixin/pageMixin" - +import RuleSettingDialog from "@/views/employeeSalary/attendanceManage/components/RuleSettingDialog" export default { name: "attendanceManage", props: { }, mixins: [pageMixin], components: { + RuleSettingDialog }, data() { return { @@ -65,22 +69,20 @@ title: "鏂板缓", infomation: {} }, - search_map: {}, + keyword: '', tableColumn: [ - { label: "鏃ユ湡", prop: "topic", min: 120, default: true }, - { label: "鍛樺伐缂栧彿", prop: "client_name", min: 190,default: true}, - { label: "鍛樺伐濮撳悕", prop: "contact_name", min: 100, }, - { label: "涓婄彮鎵撳崱鏃堕棿", prop: "client_status", min: 100 }, - { label: "涓嬬彮鎵撳崱鏃堕棿", prop: "contact_information_name", min: 100 }, - { label: "鐝", prop: "follow_time", min: 100 }, - { label: "鐝涓婄彮鏃堕棿", prop: "next_follow_time", min: 110 }, - { label: "鐝涓嬬彮鏃堕棿", prop: "member_name", min: 110 }, - { label: "娣诲姞鏃堕棿", prop: "next_follow_time", min: 130 }, - { label: "娣诲姞浜�", prop: "member_name", min: 110 }, + { label: "鏃ユ湡", prop: "date", min: 120, default: true }, + { label: "鍛樺伐缂栧彿", prop: "workerId", min: 190,default: true}, + { label: "鍛樺伐濮撳悕", prop: "workerName", min: 100, }, + { label: "涓婄彮鎵撳崱鏃堕棿", prop: "startWorkTime", min: 100 }, + { label: "涓嬬彮鎵撳崱鏃堕棿", prop: "endWorkTime", min: 100 }, + { label: "鐝", prop: "classes", min: 100 }, + { label: "鐝涓婄彮鏃堕棿", prop: "classesStartTime", min: 110 }, + { label: "鐝涓嬬彮鏃堕棿", prop: "classesEndTime", min: 110 }, + { label: "娣诲姞鏃堕棿", prop: "createTime", min: 130 }, + { label: "娣诲姞浜�", prop: "addPeople", min: 110 }, ], showCol: [ - "鏃ユ湡", - "鍛樺伐缂栧彿", "鍛樺伐濮撳悕", "涓婄彮鎵撳崱鏃堕棿", "涓嬬彮鎵撳崱鏃堕棿", @@ -89,12 +91,13 @@ "鐝涓嬬彮鏃堕棿", "娣诲姞鏃堕棿", "娣诲姞浜�", - ] + ], + editRow:{}, } }, created() { this.setTable() - this.getData(this.search_map) + this.getData(this.keyword) }, computed: { }, @@ -117,9 +120,10 @@ }, setColumnVisible(showCol) { return this.tableColumn.map((ele) => { + return { ...ele, - isShowColumn: showCol.includes(ele.label) + isShowColumn: ele.default?true:showCol.includes(ele.label) } }) }, @@ -130,28 +134,22 @@ // 璇锋眰鏁版嵁 async getData() { this.loading = true - await getFollowRecordList({ - search_map: this.search_map, + await getAttendanceList({ + keyword: this.keyword, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }) .then((res) => { console.log(res) if (res.code === 200) { - if (res.data.list && res.data.list.length > 0) { - const list = res.data.list.map((item) => { + if (res.data && res.data.length > 0) { + const list = res.data.map((item) => { return { ...item, - client_name: item.client.name, - contact_name: item.contact.name, - client_status: item.client_status.name, - phone: item.contact.phone, - member_name: item.member.username, - contact_information_name: item.contact_information.name } }) this.tableList.tableInfomation = list || [] - this.pagerOptions.totalCount = res.data.count + this.pagerOptions.totalCount = res.total } else { this.tableList.tableInfomation = [] } @@ -168,30 +166,34 @@ }, // 鎼滅储 onFilterSearch(searchText) { - this.search_map.client_name = searchText ?? "" + this.keyword = searchText ?? "" this.pagerOptions.currPage = 1 this.getData() }, - // 鏂板缓 + // 瀵煎叆 exportClick() { }, - // 鎵撳嵃 + // 鍚屾 synchClick(){ }, - + // 鎵撳嵃 + ruleSettingClick(){ + this.$refs.RuleSettingDialog.islook = true; + }, // 鍒犻櫎 - delClick(id) { + delClick(row) { this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { confirmButtonText: "纭畾", cancelButtonText: "鍙栨秷", type: "warning" }) .then(() => { - getDeleteFollowRecord({ ids: [id] }).then((response) => { + deleteAttendanceInfo({ ids: [row.ID] }).then((response) => { if (response.code === 200) { this.$message.success("鍒犻櫎鎴愬姛") + this.pagerOptions.currPage = 1 this.getData() } else { this.$message.warning("鍒犻櫎澶辫触") -- Gitblit v1.8.0