From 91039aa769d33b6c588fd9bb2cae994abd8aa954 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期二, 07 五月 2024 18:01:05 +0800 Subject: [PATCH] 机台管理模块 修改搜索的默认文字+调整纤度检验详情的样式 --- src/views/employeeSalary/attendanceManage/index.vue | 89 ++++++++++++++++++++++++++------------------ 1 files changed, 52 insertions(+), 37 deletions(-) diff --git a/src/views/employeeSalary/attendanceManage/index.vue b/src/views/employeeSalary/attendanceManage/index.vue index 1b5873a..4187cec 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,12 +42,22 @@ </div> </div> </div> + <ImportDialog + title="涓婁紶鏂囦欢" + ref="import" + @fileSuccess="fileSuccess" + > + </ImportDialog> + <!-- 瑙勫垯璁剧疆 --> + <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" +import ImportDialog from "@/views/employeeSalary/attendanceManage/components/ImportDialog"; export default { name: "attendanceManage", @@ -54,6 +65,8 @@ }, mixins: [pageMixin], components: { + RuleSettingDialog, + ImportDialog }, data() { return { @@ -65,22 +78,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 +100,13 @@ "鐝涓嬬彮鏃堕棿", "娣诲姞鏃堕棿", "娣诲姞浜�", - ] + ], + editRow:{}, } }, created() { this.setTable() - this.getData(this.search_map) + this.getData(this.keyword) }, computed: { }, @@ -117,9 +129,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 +143,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 +175,38 @@ }, // 鎼滅储 onFilterSearch(searchText) { - this.search_map.client_name = searchText ?? "" + this.keyword = searchText ?? "" this.pagerOptions.currPage = 1 this.getData() }, - // 鏂板缓 - exportClick() { - + //瀵煎叆鎴愬姛 + fileSuccess() { + this.getData() }, - // 鎵撳嵃 + // 瀵煎叆 + exportClick() { + this.$refs.import.isopen=true; + }, + // 鍚屾 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