From 1cd64a26daed3e0eb7b4ccf74e50267d79eaef09 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期二, 07 五月 2024 18:21:56 +0800
Subject: [PATCH] 纤度登记表的新增模块 限制数量只能输入整数
---
src/views/employeeSalary/attendanceManage/index.vue | 266 +++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 256 insertions(+), 10 deletions(-)
diff --git a/src/views/employeeSalary/attendanceManage/index.vue b/src/views/employeeSalary/attendanceManage/index.vue
index 18ed369..4187cec 100644
--- a/src/views/employeeSalary/attendanceManage/index.vue
+++ b/src/views/employeeSalary/attendanceManage/index.vue
@@ -1,21 +1,267 @@
<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">
+ <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>
+ </div>
+
+ <div class="body">
+ <div class="body-card">
+ <div class="list-view">
+ <TableCommonView
+ ref="tableListRef"
+ v-loading="loading"
+ :table-list="tableList"
+ @selTableCol="selTableCol"
+ >
+ <template slot="tableButton">
+ <el-table-column label="鎿嶄綔" width="90" fixed="right">
+ <template slot-scope="scope">
+ <el-button @click="delClick(scope.row)" type="text" size="small">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </template>
+ </TableCommonView>
+ </div>
+ <div class="btn-pager">
+ <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
+ </div>
+ </div>
+ </div>
+ <ImportDialog
+ title="涓婁紶鏂囦欢"
+ ref="import"
+ @fileSuccess="fileSuccess"
+ >
+ </ImportDialog>
+ <!-- 瑙勫垯璁剧疆 -->
+ <RuleSettingDialog ref="RuleSettingDialog" :editRow="editRow" @closeClick="getData" />
+ </div>
</template>
<script>
+import { getAttendanceList, deleteAttendanceInfo } from "@/api/employeeSalary/attendanceManage.js"
+import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
+import RuleSettingDialog from "@/views/employeeSalary/attendanceManage/components/RuleSettingDialog"
+import ImportDialog from "@/views/employeeSalary/attendanceManage/components/ImportDialog";
+
export default {
name: "attendanceManage",
- props: {},
- components: {},
- mixins: [],
- computed: {},
- data() {
- return {}
+ props: {
},
- created() {},
- methods: {}
+ mixins: [pageMixin],
+ components: {
+ RuleSettingDialog,
+ ImportDialog
+ },
+ data() {
+ return {
+ tableList: {},
+ loading: false,
+ searchOptions: [],
+ editConfig: {
+ visible: false,
+ title: "鏂板缓",
+ infomation: {}
+ },
+ keyword: '',
+ tableColumn: [
+ { 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: [
+ "鍛樺伐濮撳悕",
+ "涓婄彮鎵撳崱鏃堕棿",
+ "涓嬬彮鎵撳崱鏃堕棿",
+ "鐝",
+ "鐝涓婄彮鏃堕棿",
+ "鐝涓嬬彮鏃堕棿",
+ "娣诲姞鏃堕棿",
+ "娣诲姞浜�",
+ ],
+ editRow:{},
+ }
+ },
+ created() {
+ this.setTable()
+ this.getData(this.keyword)
+ },
+ computed: {
+ },
+ 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: ele.default?true:showCol.includes(ele.label)
+ }
+ })
+ },
+ selTableCol(val) {
+ this.showcol = val
+ this.tableList.tableColumn = this.setColumnVisible(val)
+ },
+ // 璇锋眰鏁版嵁
+ async getData() {
+ this.loading = true
+ 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 && res.data.length > 0) {
+ const list = res.data.map((item) => {
+ return {
+ ...item,
+ }
+ })
+ this.tableList.tableInfomation = list || []
+ this.pagerOptions.totalCount = res.total
+ } else {
+ this.tableList.tableInfomation = []
+ }
+ } else {
+ this.tableList.tableInfomation = []
+ }
+ this.loading = false
+ })
+ .catch((err) => {
+ console.log(err)
+ this.tableList.tableInfomation = []
+ this.loading = false
+ })
+ },
+ // 鎼滅储
+ onFilterSearch(searchText) {
+ this.keyword = searchText ?? ""
+ this.pagerOptions.currPage = 1
+ this.getData()
+ },
+ //瀵煎叆鎴愬姛
+ fileSuccess() {
+ this.getData()
+ },
+ // 瀵煎叆
+ exportClick() {
+ this.$refs.import.isopen=true;
+ },
+ // 鍚屾
+ synchClick(){
+
+ },
+ // 鎵撳嵃
+ ruleSettingClick(){
+ this.$refs.RuleSettingDialog.islook = true;
+ },
+ // 鍒犻櫎
+ delClick(row) {
+ this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning"
+ })
+ .then(() => {
+ deleteAttendanceInfo({ ids: [row.ID] }).then((response) => {
+ if (response.code === 200) {
+ this.$message.success("鍒犻櫎鎴愬姛")
+ this.pagerOptions.currPage = 1
+ this.getData()
+ } else {
+ this.$message.warning("鍒犻櫎澶辫触")
+ }
+ })
+ })
+ .catch(() => {})
+ },
+ }
}
</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% - 92px);
+ .body-card {
+ background-color: #fff;
+ border-radius: 12px;
+ height: 100%;
+ 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