From 5d36d46434a7f4d23844dc94c34e7716eae172a8 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期三, 24 四月 2024 11:43:02 +0800
Subject: [PATCH] 员工信息 员工编号调整为不可修改

---
 src/views/employeeSalary/salaryPlan/index.vue |   94 ++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 77 insertions(+), 17 deletions(-)

diff --git a/src/views/employeeSalary/salaryPlan/index.vue b/src/views/employeeSalary/salaryPlan/index.vue
index 3dbae58..df91ded 100644
--- a/src/views/employeeSalary/salaryPlan/index.vue
+++ b/src/views/employeeSalary/salaryPlan/index.vue
@@ -17,9 +17,8 @@
           <template slot="tableButton">
             <el-table-column label="鎿嶄綔" width="180">
               <template slot-scope="scope">
-                <el-button @click.stop="handleClick(scope.row, '鏌ョ湅')" type="text" size="small">鏌ョ湅</el-button>
-                <el-button @click.stop="handleClick(scope.row, '淇敼')" type="text" size="small">淇敼</el-button>
-                <el-button @click.stop="handleClick(scope.row, '鍒犻櫎')" type="text" size="small">鍒犻櫎</el-button>
+                <el-button @click.stop="handleClick(scope.row)" type="text" size="small">淇敼</el-button>
+                <el-button @click.stop="delClick(scope.row)" type="text" size="small">鍒犻櫎</el-button>
                 
               </template>
             </el-table-column>
@@ -27,7 +26,7 @@
         </TableCommonView>
       </div>
       <AddDialog 
-        :editDiaConfig="editConfig"
+      ref="add" :editRow="editRow"  @refresh="refresh" 
       />
       <div class="btn-pager">
         <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
@@ -39,6 +38,7 @@
 <script>
 import AddDialog from "@/views/employeeSalary/salaryPlan/components/addDialog.vue"
 import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
+import { getSalaryPlanList, deleteSalaryPlanInfo } from  "@/api/employeeSalary/salaryPlan.js"
 export default {
   name: "salaryPlan",
   props: {},
@@ -55,24 +55,17 @@
         { label: "宸ョ", prop: "groupNumber",min:100 },
         { label: "钖祫绫诲瀷", prop: "startCarNumber",min:110 },
         { label: "璁¤垂鍛ㄦ湡", prop: "endCarNumber",min:110 },
-        { label: "璁¤垂鍏紡瀹氫箟", prop: "carFlag", },
+        { label: "璁¤垂鍏紡瀹氫箟", prop: "carFlag",min:140  },
         { label: "娣诲姞鏃堕棿", prop: "notes",min:130 },
         { label: "娣诲姞浜�", prop: "notes",min:110 },
       ],
-      editConfig:{
-        visible:false,
-        infomitton:{
-          TabsIndex:0,
-          workshopId:null,
-        }
-      },
-      getDataParams: {
-        keyWord: '',
-      },
+      keyword: '',
+      editRow:{},
     }
   },
   created() {
     this.setTable()
+    this.getData(this.keyword)
   },
   methods: {
     setTable() {
@@ -107,6 +100,34 @@
       this.showcol = val
       this.tableList.tableColumn = this.setColumnVisible(val, this.tableColumn)
     },
+    // 璇锋眰鏁版嵁
+    async getData() {
+      this.loading = true
+      await getSalaryPlanList({
+        keyword: this.keyword,
+        page: this.pagerOptions.currPage,
+        pageSize: this.pagerOptions.pageSize
+      })
+        .then((res) => {
+          if (res.code === 200) {
+            if (res.data) {
+              const list = res.data
+              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
+        })
+    },
     // 鏂板
     addBtnClick() {
       this.editConfig.infomitton={}
@@ -115,13 +136,52 @@
     },
     // 鎼滅储
     onFilterSearch(searchText) {
-      this.getDataParams.keyWord = searchText,
-        this.getData()
+      this.keyword= searchText,
+      this.pagerOptions.currPage = 1
+      this.getData()
+    },
+    refresh(){
+      this.getData()
     },
     // 琛ㄦ牸琛岀偣鍑�
     tableRowClick(row) {
       console.log(row, "row")
     },
+    // 缂栬緫
+    handleClick(row) {
+      let config=JSON.parse(JSON.stringify(row));
+      this.editRow = { ...config, 
+        title:'缂栬緫',
+        type:'edit',
+        shopNameObj:{
+          value:config.shopId,
+          label:config.shopName,
+        },
+        workTypeObj:{
+          value:config.workTypeId,
+          label:config.workType,
+        } 
+      }
+      this.$refs.add.islook = true;
+    },
+    // 鍒犻櫎
+    delClick(row) {
+      this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      })
+        .then(() => {
+          deleteSalaryPlanInfo({ id: row.id }).then((response) => {
+            if (response.code === 200) {
+              this.$message.success("鍒犻櫎鎴愬姛")
+              this.getData()
+            }
+          })
+        })
+        .catch(() => {})
+    },
+
   }
 }
 </script>

--
Gitblit v1.8.0