From f13d1d01c3c3cbb075e63ae02be54bbb023c13d0 Mon Sep 17 00:00:00 2001
From: charles <981744753@qq.com>
Date: 星期三, 24 七月 2024 16:50:22 +0800
Subject: [PATCH] feat:薪资薪酬核算模块

---
 src/views/productManage/silkRegisterForm/addPage.vue                      |    9 +
 src/views/systemSetting/dataDictionary/components/addDataDictionaries.vue |   12 +-
 src/components/makepager/TableCommonView.vue                              |    2 
 src/router/employeeSalary/index.js                                        |   13 +
 src/views/systemSetting/dataDictionary/index.vue                          |   26 ++--
 vue.config.js                                                             |    2 
 src/views/employeeSalary/payroll/index.vue                                |  246 +++++++++++++++++++++++++++++++++++++++++
 src/api/employeeSalary/payroll.js                                         |    9 +
 src/components/makepager/CommonSearch.vue                                 |    1 
 src/components/layout/components/appsidebar/index.vue                     |    1 
 src/views/productManage/productRegisterForm/addProductRegisterPage.vue    |    4 
 11 files changed, 297 insertions(+), 28 deletions(-)

diff --git a/src/api/employeeSalary/payroll.js b/src/api/employeeSalary/payroll.js
new file mode 100644
index 0000000..beefefe
--- /dev/null
+++ b/src/api/employeeSalary/payroll.js
@@ -0,0 +1,9 @@
+import request from "@/common/untils/request.js"
+// 钖祫鏍哥畻鍒楄〃
+export function getPayrollSalaryPlanListApi(params) {
+    return request({
+        url: "/api-jl/v1/salary/getPayrollSalaryPlanList",
+        method: "get",
+        params
+    })
+}
\ No newline at end of file
diff --git a/src/components/layout/components/appsidebar/index.vue b/src/components/layout/components/appsidebar/index.vue
index a3e7064..6c3deaf 100644
--- a/src/components/layout/components/appsidebar/index.vue
+++ b/src/components/layout/components/appsidebar/index.vue
@@ -52,6 +52,7 @@
           <el-menu-item index="/employeeSalary/attendanceManage">鑰冨嫟绠$悊</el-menu-item>
           <el-menu-item index="/employeeSalary/attendanceStatistics">鑰冨嫟缁熻</el-menu-item>
           <el-menu-item index="/employeeSalary/salaryPlan">钖祫鏂规</el-menu-item>
+          <el-menu-item index="/employeeSalary/payroll">钖祫鏍哥畻</el-menu-item>
           <el-menu-item index="/employeeSalary/apprenticeshipManage">甯﹀緬绠$悊</el-menu-item>
           <el-menu-item index="/employeeSalary/machineManage">鏈哄彴绠$悊</el-menu-item>
         </el-submenu>
diff --git a/src/components/makepager/CommonSearch.vue b/src/components/makepager/CommonSearch.vue
index 3381b56..21791f1 100644
--- a/src/components/makepager/CommonSearch.vue
+++ b/src/components/makepager/CommonSearch.vue
@@ -59,6 +59,7 @@
             style="width: 410px"
             clearable
             @change="searchClick"
+            @blur="searchClick"
             @clear="clearClick"
           >
             <i slot="suffix" class="el-icon-search" style="cursor: pointer" @click="searchClick"></i>
diff --git a/src/components/makepager/TableCommonView.vue b/src/components/makepager/TableCommonView.vue
index 8799c8f..b551d67 100644
--- a/src/components/makepager/TableCommonView.vue
+++ b/src/components/makepager/TableCommonView.vue
@@ -201,7 +201,7 @@
     <div class="styleBtn">
       <i @click="checkCol()" class="label">...</i>
       <el-checkbox-group v-model="showcol" v-show="iscolopen" class="checkbox-group" @change="selectCheckBoxList">
-        <el-checkbox v-for="item in tableList.allcol" :label="item" :key="item">{{ item }} </el-checkbox>
+        <el-checkbox v-for="item in tableList.allcol"  :label="item" :key="item">{{ item }} </el-checkbox>
       </el-checkbox-group>
     </div>
   </div>
diff --git a/src/router/employeeSalary/index.js b/src/router/employeeSalary/index.js
index ea49080..cb42bd8 100644
--- a/src/router/employeeSalary/index.js
+++ b/src/router/employeeSalary/index.js
@@ -5,7 +5,7 @@
 const salaryPlan = (resolve) => require(["@/views/employeeSalary/salaryPlan/index"], resolve) // 钖祫鏂规
 const apprenticeshipManage = (resolve) => require(["@/views/employeeSalary/apprenticeshipManage/index"], resolve) // 甯﹀緬绠$悊
 const machineManage = (resolve) => require(["@/views/employeeSalary/machineManage/index"], resolve) // 鏈哄彴绠$悊
-
+const payroll=(resolve)=>require(["@/views/employeeSalary/payroll/index"], resolve)
 const appconfig = [
   {
     path: "/employeeSalary/attendanceManage",
@@ -35,6 +35,15 @@
     }
   },
   {
+      path: "/employeeSalary/payroll",
+      name: "payroll",
+      component: payroll,
+      meta: {
+        title: "钖祫鏍哥畻",
+        requireAuth: true
+      }
+   },
+  {
     path: "/employeeSalary/apprenticeshipManage",
     name: "apprenticeshipManage",
     component: apprenticeshipManage,
@@ -52,6 +61,6 @@
       requireAuth: true
     }
   }
-]
+];
 
 export default appconfig
diff --git a/src/views/employeeSalary/payroll/index.vue b/src/views/employeeSalary/payroll/index.vue
new file mode 100644
index 0000000..0570499
--- /dev/null
+++ b/src/views/employeeSalary/payroll/index.vue
@@ -0,0 +1,246 @@
+<template>
+    <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">
+                        <div class="margin_right_20px" style="width:200px;">
+                            <el-date-picker v-model="object.cycle" style="width:100%"
+                                            @change="changeDate"
+                                            :clearable="false" type="month" placeholder="閫夋嫨鏃ユ湡"
+                                            :picker-options="pickerOptions"
+                                            value-format="yyyy-MM">
+                            </el-date-picker>
+                        </div>
+                        <div>
+                            <el-select placeholder="璇烽�夋嫨宸ョ" v-model="object.workTypeCode" filterable
+                                @change="changeWorkTypeCode"
+                                clearable
+                            >
+                                <el-option v-for="workTypeCode in workTypeCodeList"   :label="workTypeCode.label" :value="workTypeCode.value" />
+                            </el-select>
+                        </div>
+                    </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"
+                    >
+                    </TableCommonView>
+                </div>
+                 <div class="btn-pager">
+                  <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
+                </div>
+            </div>
+        </div>
+
+    </div>
+</template>
+
+<script>
+    import { getPayrollSalaryPlanListApi } from  "@/api/employeeSalary/payroll.js"
+    import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
+    import NewDate from "@/api/date";
+    const { getPreviousMonth } = NewDate;
+    export default {
+        name: "attendanceStatistics",
+        props: {
+        },
+        mixins: [pageMixin],
+        components: {},
+        data() {
+            return {
+                tableList: {},
+                loading: false,
+                searchOptions:[],
+                pickerOptions: {
+                    disabledDate(time) {
+                        return time.getTime() > new Date().getTime() - 86400000;
+                    },
+                },
+                object:{
+                    cycle:getPreviousMonth(),
+                    workTypeCode:''
+                },
+                workTypeCodeList:[],
+                keyword: "",
+                tableColumn: [],
+                showCol: [],
+
+            }
+        },
+        created() {
+            this.setTable();
+            this.initData();
+        },
+        computed: {
+        },
+        methods: {
+            initTable(){
+                this.showcol=[ '宸ョ','濮撳悕','鐢熶骇宸ヨ祫','婊″嫟',
+                    '瓒呮椂宸ヨ祫','鍔犵彮宸ヨ祫','浜ら�氳ˉ璐�',
+                    '甯﹀緬琛ヨ创','宀椾綅琛ヨ创','绀句繚琛ヨ创' ,'宸ラ緞琛ヨ创',
+                    '涓嶈揪淇濆簳','璐ㄩ噺濂�','濂栫綒1','濂栫綒2/娓呭噳琛ヨ创',
+                    '鏃ュ父妫�鏌�/濂栫綒3','鍋滄満琛ヨ创','搴斿彂宸ヨ祫','澶囨敞'
+                ];
+                this.tableColumn=[
+                    { label: "宸ョ", prop: "workTypeName",default:true,fixed:true},
+                    { label: "濮撳悕", prop: "workerName",default:true,fixed:true},
+                    { label: "搴斿彂宸ヨ祫", prop: "amount",default:true,fixed:true},
+                    { label: "鐢熶骇宸ヨ祫", prop: "productionAmount" ,default:true},
+                    { label: "瓒呮椂宸ヨ祫", prop: "timeoutAmount",default:true},
+                    { label: "鍔犵彮宸ヨ祫", prop: "overtimeAmount",default:true},
+                    { label: "浜ら�氳ˉ璐�", prop: "trafficAmount" ,default:true},
+                    { label: "甯﹀緬琛ヨ创", prop: "masterApprenticeAmount",default:true },
+                    { label: "宀椾綅琛ヨ创", prop: "positionAmount",default:true},
+                    { label: "绀句繚琛ヨ创", prop: "socialSecurityAmount",default:true},
+                    { label: "宸ラ緞琛ヨ创", prop: "seniorityAmount",default:true },
+                    { label: "涓嶈揪淇濆簳", prop: "baseSalaryAmount",default:true},
+                    { label: "璐ㄩ噺濂�", prop: "qualityStandardsAmount" ,default:true},
+                    { label: "濂栫綒1", prop: "substandardQualityAmount",default:true},
+                    { label: "濂栫綒2/娓呭噳琛ヨ创", prop: "heatAmount",default:true},
+                    { label: "鏃ュ父妫�鏌�/濂栫綒3", prop: "dailyInspectionAmount",default:true},
+                    { label: "鍋滄満琛ヨ创", prop: "downtimeAmount",default:true},
+                    { label: "澶囨敞", prop: "remark",default:true},
+                ]
+            },
+            initData(){
+              this.workTypeCodeList=[
+                  {label:'鎸¤溅宸�',value:'weavers'},
+                  {label:'杞﹀ご宸�',value:'car_head'},
+                  {label:'淇濆叏宸�',value:'maintenance'},
+                  {label:'鐓導宸�',value:'boiled'},
+                  {label:'鑸�鑼у伐',value:'scoop'},
+                  {label:'閫佽導宸�',value:'transport'},
+                  {label:'娓呮磥宸�',value:'cleaner'},
+                  {label:'鎰熺煡鍣ㄦ竻娲楀伐',value:'machine_cleaner'},
+                  {label:'鍏ㄨ兘鏈哄姩',value:'all-powerful'},
+                  {label:'鐝暱',value:'monitor'}
+              ];
+              this.getData();
+            },
+            changeWorkTypeCode(){
+              this.pagerOptions.currPage = 1;
+              this.getData()
+            },
+            setTable() {
+                this.initTable();
+                this.tableList = {
+                    selectIndex: true,
+                    isFixed:true,
+                    tableInfomation: [],
+                    allcol: [],
+                    showcol: this.showcol,
+                    headerHeight:'47px',
+                    tableColumn: this.setColumnVisible(this.showcol)
+                }
+                this.tableList.allcol = this.tableList.tableColumn.filter(item=>!item.fixed).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:showCol.includes(ele.label)
+                    }
+                })
+            },
+            selTableCol(val) {
+                this.showcol = val;
+                this.tableList.tableColumn = this.setColumnVisible(val);
+            },
+            // 璇锋眰鏁版嵁
+            async getData() {
+                this.loading = true
+                const {code,data,total}=await getPayrollSalaryPlanListApi({
+                    ...this.object,
+                    page: this.pagerOptions.currPage,
+                    pageSize: this.pagerOptions.pageSize,
+                    keyword:this.keyword
+                });
+                if(code===200){
+                    this.tableList.tableInfomation=data;
+                    this.pagerOptions.totalCount=total;
+                }
+                this.loading=false;
+            },
+            changeDate(){
+                this.pagerOptions.currPage = 1
+                this.getData()
+            },
+            // 鎼滅储
+            onFilterSearch(searchText) {
+                this.keyword = searchText ?? ""
+                this.pagerOptions.currPage = 1
+                this.getData()
+            }
+        }
+    }
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<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% - 100px);
+                overflow: hidden;
+            }
+            .btn-pager {
+                display: flex;
+                margin-top: 10px;
+                .page {
+                    margin-left: auto;
+                }
+            }
+        }
+    }
+</style>
diff --git a/src/views/productManage/productRegisterForm/addProductRegisterPage.vue b/src/views/productManage/productRegisterForm/addProductRegisterPage.vue
index a4c0478..1ad3274 100644
--- a/src/views/productManage/productRegisterForm/addProductRegisterPage.vue
+++ b/src/views/productManage/productRegisterForm/addProductRegisterPage.vue
@@ -987,7 +987,7 @@
     getSelectDataList() {
       //杞﹂棿
       getDictList({
-        dictType: 1,
+        dictType: 2,
       }).then((res) => {
         if (res.code == 200) {
           this.nameList = res.data || [];
@@ -1004,7 +1004,7 @@
       });
       //搴勫彛
       getDictList({
-        dictType: 0,
+        dictType: 1,
       }).then((res) => {
         if (res.code == 200) {
           this.marketList = res.data || [];
diff --git a/src/views/productManage/silkRegisterForm/addPage.vue b/src/views/productManage/silkRegisterForm/addPage.vue
index d6402c4..df2b635 100644
--- a/src/views/productManage/silkRegisterForm/addPage.vue
+++ b/src/views/productManage/silkRegisterForm/addPage.vue
@@ -770,7 +770,7 @@
     getSelectDataList() {
       //杞﹂棿
       getDictList({
-        dictType: 1,
+        dictType: 2,
       }).then((res) => {
         if (res.code == 200) {
           this.nameList = res.data || [];
@@ -792,7 +792,7 @@
       // });
       //搴勫彛
       getDictList({
-        dictType: 0,
+        dictType: 1,
       }).then((res) => {
         if (res.code == 200) {
           this.marketList = res.data || [];
@@ -1025,7 +1025,10 @@
                     message: "淇濆瓨鎴愬姛锛�",
                     type: "success",
                   });
-                  this.activeName = "second"
+                    if(res.data.ID){
+                        this.registerId=res.data.ID;
+                    }
+                  this.activeName = "second";
                     this.getDetailsData();
                   // this.$router.push({
                   //   path: "/productManage/silkRegisterForm",
diff --git a/src/views/systemSetting/dataDictionary/components/addDataDictionaries.vue b/src/views/systemSetting/dataDictionary/components/addDataDictionaries.vue
index a2c0156..1f27b92 100644
--- a/src/views/systemSetting/dataDictionary/components/addDataDictionaries.vue
+++ b/src/views/systemSetting/dataDictionary/components/addDataDictionaries.vue
@@ -4,7 +4,7 @@
       :before-close="handleClose">
       <el-form :inline="true" label-width="20%" style="width: 100%;" :model="editConfig.infomitton" :rules="rules"
         ref="ruleForm">
-        <template v-if="editConfig.infomitton.TabsIndex === 0 || editConfig.infomitton.TabsIndex === 1">
+        <template v-if="editConfig.infomitton.TabsIndex === 1 || editConfig.infomitton.TabsIndex === 2">
           <el-form-item prop="number" label="缂栫爜" style="width: 100%;">
             <el-input :disabled="editConfig.dialogTitle != '鏂板'" v-model="editConfig.infomitton.number"
               placeholder="璇疯緭鍏�"></el-input>
@@ -15,14 +15,14 @@
           </el-form-item>
         </template>
 
-        <template v-if="editConfig.infomitton.TabsIndex === 2">
+        <template v-if="editConfig.infomitton.TabsIndex === 3">
           <el-form-item prop="name" label="甯﹀彿棰滆壊" style="width: 100%;">
             <el-input :disabled="editConfig.dialogTitle === '鏌ョ湅'" v-model="editConfig.infomitton.name"
               placeholder="璇疯緭鍏ュ瓧姣嶆垨鏁板瓧锛屼笉鍏佽鏈夌┖鏍笺�佷腑鏂�"></el-input>
           </el-form-item>
         </template>
 
-        <template v-if="editConfig.infomitton.TabsIndex === 3">
+        <template v-if="editConfig.infomitton.TabsIndex === 4">
           <el-form-item prop="name" label="瑙勬牸" style="width: 100%;">
             <el-input :disabled="editConfig.dialogTitle === '鏌ョ湅'" v-model="editConfig.infomitton.name"
               placeholder="璇疯緭鍏ュ瓧姣嶆垨鏁板瓧锛屼笉鍏佽鏈夌┖鏍笺�佷腑鏂�"></el-input>
@@ -97,20 +97,20 @@
     },
     saveParams(type) {
       let params = {}
-      if (type === 0 || type === 1) {
+      if (type === 1 || type === 2) {
         params = {
           dictType: this.editConfig.infomitton.TabsIndex,
           name: this.editConfig.infomitton.name,
           number: this.editConfig.infomitton.number,
           remark: this.editConfig.infomitton.remark,
         }
-      } else if (type === 2) {
+      } else if (type === 3) {
         params = {
           dictType: this.editConfig.infomitton.TabsIndex,
           name: this.editConfig.infomitton.name,
           remark: this.editConfig.infomitton.remark,
         }
-      } else if (type === 3) {
+      } else if (type === 4) {
         params = {
           dictType: this.editConfig.infomitton.TabsIndex,
           name: this.editConfig.infomitton.name,
diff --git a/src/views/systemSetting/dataDictionary/index.vue b/src/views/systemSetting/dataDictionary/index.vue
index a1c12dc..f7d4cfc 100644
--- a/src/views/systemSetting/dataDictionary/index.vue
+++ b/src/views/systemSetting/dataDictionary/index.vue
@@ -11,27 +11,27 @@
     <div class="body-card">
       <div class="list-view">
         <div class="bottom-tabs" >
-          <div class="tab-pane" @click="getTab(0)" :style="{
-            background: TabsIndex == 0 ? '#2a78fb' : '#F1F3F8',
-            color: TabsIndex == 0 ? '#fff' : '#666'
-          }">
-            搴勫彛绠$悊
-          </div>
           <div class="tab-pane" @click="getTab(1)" :style="{
             background: TabsIndex == 1 ? '#2a78fb' : '#F1F3F8',
             color: TabsIndex == 1 ? '#fff' : '#666'
           }">
-            杞﹂棿绠$悊
+            搴勫彛绠$悊
           </div>
           <div class="tab-pane" @click="getTab(2)" :style="{
             background: TabsIndex == 2 ? '#2a78fb' : '#F1F3F8',
             color: TabsIndex == 2 ? '#fff' : '#666'
           }">
-            甯﹀彿棰滆壊
+            杞﹂棿绠$悊
           </div>
           <div class="tab-pane" @click="getTab(3)" :style="{
             background: TabsIndex == 3 ? '#2a78fb' : '#F1F3F8',
             color: TabsIndex == 3 ? '#fff' : '#666'
+          }">
+            甯﹀彿棰滆壊
+          </div>
+          <div class="tab-pane" @click="getTab(4)" :style="{
+            background: TabsIndex == 4 ? '#2a78fb' : '#F1F3F8',
+            color: TabsIndex == 4 ? '#fff' : '#666'
           }">
             瑙勬牸
           </div>
@@ -73,7 +73,7 @@
   computed: {},
   data() {
     return {
-      TabsIndex:0,
+      TabsIndex:1,
       loading: false,
       productTableList: {},
       editConfig:{
@@ -166,26 +166,26 @@
     },
     async getProductOrderInfo() {
         this.getData()
-        if (this.TabsIndex == 0) {
+        if (this.TabsIndex == 1) {
           // 搴勫彛绠$悊
           this.editConfig.dialogTitleType="搴勫彛"
           this.tableBottomColumn = this.tableColumn // 琛ㄥご
           this.showBottomCol = this.showCol  // 鍔ㄦ�佽〃澶�
           this.setBottomList()
-        }else if (this.TabsIndex == 1) {
+        }else if (this.TabsIndex == 2) {
           // 杞﹂棿绠$悊
           this.editConfig.dialogTitleType="杞﹂棿"
           this.tableBottomColumn = this.workshopTableColumn
           this.showBottomCol = this.showWorkshopCol
           this.setBottomList()
-        } else if (this.TabsIndex == 2) {
+        } else if (this.TabsIndex == 3) {
           // 甯﹀彿棰滆壊
           this.editConfig.dialogTitleType="甯﹀彿棰滆壊"
           this.tableBottomColumn = this.colorTableColumn
           this.showBottomCol = this.showColorCol
           this.setBottomList()
 
-        } else if (this.TabsIndex == 3) {
+        } else if (this.TabsIndex == 4) {
           // 瑙勬牸
           this.editConfig.dialogTitleType="瑙勬牸"
           this.tableBottomColumn = this.specsTableColumn
diff --git a/vue.config.js b/vue.config.js
index ead979c..4e94e61 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -5,7 +5,7 @@
   return path.join(__dirname, dir)
 }
 const ipNum=105;
-const serverPath='http://192.168.0.105:8008';
+const serverPath=`http://192.168.0.${ipNum}:8008`;
 // 璁剧疆涓嶅弬涓庢瀯寤虹殑搴�
 const externals = {};
 module.exports = {

--
Gitblit v1.8.0