From 4e77a057819df8bcd8eb4218e6d1fcd8ccc8abf6 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期五, 26 四月 2024 18:21:56 +0800
Subject: [PATCH] 应发工资报表的前端开发

---
 src/views/employeeManage/employeeInfo/index.vue |   66 ++++++++++++++++-----------------
 1 files changed, 32 insertions(+), 34 deletions(-)

diff --git a/src/views/employeeManage/employeeInfo/index.vue b/src/views/employeeManage/employeeInfo/index.vue
index 5579c07..7c9d27f 100644
--- a/src/views/employeeManage/employeeInfo/index.vue
+++ b/src/views/employeeManage/employeeInfo/index.vue
@@ -30,7 +30,7 @@
               <el-table-column label="鎿嶄綔" width="90" fixed="right">
                 <template slot-scope="scope">
                   <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button>
-                  <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 +41,12 @@
         </div>
       </div>
     </div>
-    <AddEmployee ref="addEmployee" :editRow="editRow"  @shutdown="shutdown" />
+    <AddEmployee ref="addEmployee" :editRow="editRow"  @refresh="shutdown" />
   </div>
 </template>
 
 <script>
-import { getFollowRecordList, getDeleteFollowRecord } from "@/api/employeeManage/employeeInfo.js"
+import { getWorkerList, getDeleteWorkerInfo } from "@/api/employeeManage/employeeInfo.js"
 import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
 import AddEmployee from  "@/views/employeeManage/employeeInfo/components/AddEmployee"
 export default {
@@ -65,16 +65,16 @@
       editRow: {
         title: "鏂板缓",
       },
-      search_map: {},
+      search_map: '',
       tableColumn: [
-        { label: "鍛樺伐缂栫爜", prop: "topic", min: 120, default: true }, // 涓婚
-        { label: "濮撳悕", prop: "client_name", min: 190, }, // 瀹㈡埛鍚嶇О
-        { label: "鎵嬫満鍙�", prop: "contact_name", min: 130, }, // 鑱旂郴浜哄鍚�
-        { label: "杞﹂棿", prop: "client_status", min: 100 }, // 瀹㈡埛鐘舵��
-        { label: "缁勫埆", prop: "contact_information_name", min: 100 }, // 鑱旂郴鏂瑰紡
-        { label: "宸ョ", prop: "follow_time", min: 130 }, // 鑱旂郴浜烘棩鏈�
-        { label: "娣诲姞鏃堕棿", prop: "next_follow_time", min: 130 }, // 涓嬫鍥炶鏃ユ湡
-        { label: "娣诲姞浜�", prop: "member_name", min: 110 }, // 璐熻矗浜�
+        { label: "鍛樺伐缂栫爜", prop: "id", min: 120, default: true }, // 涓婚
+        { label: "濮撳悕", prop: "name", min: 190, }, // 瀹㈡埛鍚嶇О
+        { label: "鎵嬫満鍙�", prop: "phoneNum", min: 130, }, // 鑱旂郴浜哄鍚�
+        { label: "杞﹂棿", prop: "shopName", min: 100 }, // 瀹㈡埛鐘舵��
+        { label: "缁勫埆", prop: "groupNumber", min: 100 }, // 鑱旂郴鏂瑰紡
+        { label: "宸ョ", prop: "workType", min: 130 }, // 鑱旂郴浜烘棩鏈�
+        { label: "娣诲姞鏃堕棿", prop: "createdAt", min: 150 }, // 涓嬫鍥炶鏃ユ湡
+        { label: "娣诲姞浜�", prop: "addPeople", min: 110 }, // 璐熻矗浜�
       ],
       showCol: [
         "鍛樺伐缂栫爜",
@@ -126,28 +126,17 @@
     // 璇锋眰鏁版嵁
     async getData() {
       this.loading = true
-      await getFollowRecordList({
-        search_map: this.search_map,
+      await getWorkerList({
+        keyWord: this.search_map,
         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) => {
-                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
-                }
-              })
+            if (res.data) {
+              const list = res.data
               this.tableList.tableInfomation = list || []
-              this.pagerOptions.totalCount = res.data.count
+              this.pagerOptions.totalCount = res.total
             } else {
               this.tableList.tableInfomation = []
             }
@@ -164,7 +153,7 @@
     },
     // 鎼滅储
     onFilterSearch(searchText) {
-      this.search_map.client_name = searchText ?? ""
+      this.search_map = searchText ?? ""
       this.pagerOptions.currPage = 1
       this.getData()
     },
@@ -179,23 +168,32 @@
     // 缂栬緫
     handleClick(row) {
       let config=JSON.parse(JSON.stringify(row));
-      this.editRow = { ...config, title:'缂栬緫',type:'add' }
+      this.editRow = { ...config, 
+        title:'缂栬緫',
+        type:'edit',
+        shopNameObj:{
+          value:config.shopId,
+          label:config.shopName,
+        },
+        workTypeObj:{
+          value:config.workTypeId,
+          label:config.workType,
+        } 
+      }
       this.$refs.addEmployee.islook = true;
     },
     // 鍒犻櫎
-    delClick(id) {
+    delClick(row) {
       this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
         confirmButtonText: "纭畾",
         cancelButtonText: "鍙栨秷",
         type: "warning"
       })
         .then(() => {
-          getDeleteFollowRecord({ ids: [id] }).then((response) => {
+          getDeleteWorkerInfo({ id: row.id }).then((response) => {
             if (response.code === 200) {
               this.$message.success("鍒犻櫎鎴愬姛")
               this.getData()
-            } else {
-              this.$message.warning("鍒犻櫎澶辫触")
             }
           })
         })

--
Gitblit v1.8.0