cz před 10 měsíci
rodič
revize
d8c2e64e54

+ 69 - 6
src/components/PDF/SalaryConfirmationPDF.vue

@@ -11,7 +11,7 @@
           <td colspan="1">部门</td>
           <td colspan="2">{{pdfData.deptName}}</td>
           <td colspan="1">入职日期</td>
-          <td colspan="2">{{pdfData.createTime}}</td>
+          <td colspan="2">{{pdfData.entryDate}}</td>
         </tr>
         <tr>
           <td colspan="2">员工姓名</td>
@@ -33,7 +33,10 @@
           <td colspan="2">
             上班时长
           </td>
-          <td :colspan="salaryStructureData.length+3-2" style="text-align:center"></td>
+          <td :colspan="salaryStructureData.length+3-2" style="text-align:left">
+            月休{{pdfData.monthRest}}天,{{pdfData.dailyHours}}小时/天(上午{{pdfData.morningBeginTime}}至{{pdfData.morningEndTime}}
+            ;下午{{pdfData.afternoonBeginTime}}至{{pdfData.afternoonEndTime}}
+            )</td>
         </tr>
         <tr>
           <td rowspan="5" style="width:5%">
@@ -52,7 +55,8 @@
         </tr>
         <tr>
           <td v-for="col in salaryStructureData" :key="col.value" :style="`width:${parseFloat(80/salaryStructureData.length).toFixed(2)}%`">
-            {{col.label}}
+            <el-input-number onmousewheel="return false;" v-model="pdfData.salaryData[col.value+'-10']" placeholder=" " style="width: 100%"
+                             :precision="2" :controls="false" :min="0" @change="changeAmount('10')" />
           </td>
           <td>{{pdfData.amount}}</td>
         </tr>
@@ -65,16 +69,17 @@
         </tr>
         <tr>
           <td v-for="col in salaryStructureData" :key="col.value">
-            {{col.label}}
+            <el-input-number onmousewheel="return false;" v-model="pdfData.salaryData[col.value+'-20']" placeholder=" " style="width: 100%"
+                             :precision="2" :controls="false" :min="0" @change="changeAmount('20')" />
           </td>
-          <td>{{pdfData.amount}}</td>
+          <td>{{pdfData.perfAmount}}</td>
         </tr>
 
         <tr>
           <td colspan="2">
             薪资说明
           </td>
-          <td :colspan="salaryStructureData.length+3-2" style="text-align:center"></td>
+          <td :colspan="salaryStructureData.length+3-2" style="text-align:left">{{pdfData.salaryRemark}}</td>
         </tr>
         <tr>
           <td colspan="2">
@@ -102,6 +107,8 @@
       <el-button type="primary" v-print="printObj" size="default" v-debounce>打印</el-button>
       <el-button type="primary" @click="clickDownload()" size="default" v-debounce>下载PDF</el-button>
       <el-button type="primary" @click="exportExcel()" size="default" v-debounce>导出Excel</el-button>
+      <el-button type="primary" @click="saveData()" size="default" v-debounce>保存</el-button>
+
     </div>
   </div>
 </template>
@@ -137,6 +144,14 @@ const loading = ref(false);
 const getPdfData = (query) => {
   loading.value = true;
   proxy.post("/userSalaryManage/detail", query).then((res) => {
+    res.salaryData = {};
+    if (res.userSalaryDetailList && res.userSalaryDetailList.length > 0) {
+      for (let i = 0; i < res.userSalaryDetailList.length; i++) {
+        const row = res.userSalaryDetailList[i];
+        res.salaryData[row.salaryStructureId + "-" + row.type] = row.money;
+      }
+    }
+    console.log(res.salaryData);
     pdfData.value = res;
     loading.value = false;
   });
@@ -185,6 +200,51 @@ const exportExcel = () => {
     loading.value = false;
   }, 500);
 };
+
+const saveData = () => {
+  let userSalaryDetailList = [];
+  for (const key in pdfData.value.salaryData) {
+    let arr = key.split("-");
+    userSalaryDetailList.push({
+      salaryStructureId: arr[0],
+      type: arr[1],
+      money: pdfData.value.salaryData[key],
+    });
+  }
+  pdfData.value.userSalaryDetailList = userSalaryDetailList;
+  proxy.post("/userSalaryManage/edit", pdfData.value).then((res) => {
+    getPdfData({ userId: props.rowData.id });
+    proxy.msgTip("操作成功", 1);
+    proxy.$emit("getList");
+  });
+};
+
+const changeAmount = (type) => {
+  let userSalaryDetailList = [];
+  for (const key in pdfData.value.salaryData) {
+    let arr = key.split("-");
+    userSalaryDetailList.push({
+      salaryStructureId: arr[0],
+      type: arr[1],
+      money: pdfData.value.salaryData[key],
+    });
+  }
+  pdfData.value.userSalaryDetailList = userSalaryDetailList;
+  let amount = pdfData.value.userSalaryDetailList
+    .filter((x) => x.type == "10")
+    .reduce(
+      (total, x) => Number(parseFloat((total += Number(x.money))).toFixed(2)),
+      0
+    );
+  pdfData.value.amount = amount;
+  let perfAmount = pdfData.value.userSalaryDetailList
+    .filter((x) => x.type == "20")
+    .reduce(
+      (total, x) => Number(parseFloat((total += Number(x.money))).toFixed(2)),
+      0
+    );
+  pdfData.value.perfAmount = perfAmount;
+};
 </script>
 
 <style lang="scss" scoped>
@@ -206,4 +266,7 @@ const exportExcel = () => {
     text-align: right;
   }
 }
+:deep(.el-input__wrapper) {
+  box-shadow: none;
+}
 </style>

+ 197 - 4
src/views/finance/salary/salaryManagement/index.vue

@@ -45,6 +45,53 @@
             </el-table>
           </div>
         </template>
+
+        <template #morning>
+          <div style="width:100%">
+            <el-row>
+              <el-col :span="12">
+                <el-form-item prop="morningBeginTime" label="" label-width="0px" class="margin-b-0 wid100">
+                  <el-time-select v-model="formData.data.morningBeginTime" style="width: 100%" :max-time="formData.data.morningEndTime" class="mr-4"
+                                  placeholder="开始时间" start="08:00" step="00:15" end="12:00" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item prop="morningEndTime" label="" label-width="0px" class="margin-b-0 wid100">
+                  <el-time-select v-model="formData.data.morningEndTime" style="width: 100%" :min-time="formData.data.morningBeginTime" class="mr-4"
+                                  placeholder="结束时间" :start="formData.data.morningBeginTime" step="00:15" end="12:30" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <!-- <el-form-item prop="morning" label="" label-width="0px" class="margin-b-0 wid100">
+              <el-time-picker v-model="formData.data.morning" is-range range-separator="To" start-placeholder="开始时间" end-placeholder="结束时间"
+                              value-format="HH:mm:ss" />
+            </el-form-item> -->
+          </div>
+        </template>
+
+        <template #afternoon>
+          <div style="width:100%">
+            <el-row>
+              <el-col :span="12">
+                <el-form-item prop="afternoonBeginTime" label="" label-width="0px" class="margin-b-0 wid100">
+                  <el-time-select v-model="formData.data.afternoonBeginTime" style="width: 100%" :max-time="formData.data.afternoonEndTime"
+                                  class="mr-4" placeholder="开始时间" start="13:30" step="00:15" end="18:00" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item prop="afternoonEndTime" label="" label-width="0px" class="margin-b-0 wid100">
+                  <el-time-select v-model="formData.data.afternoonEndTime" style="width: 100%" :min-time="formData.data.afternoonBeginTime"
+                                  class="mr-4" placeholder="结束时间" :start="formData.data.afternoonBeginTime" step="00:15" end="18:30" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <!-- <el-form-item prop="afternoon" label="" label-width="0px" class="margin-b-0 wid100">
+              <el-time-picker v-model="formData.data.afternoon" is-range range-separator="To" start-placeholder="开始时间" end-placeholder="结束时间"
+                              value-format="HH:mm:ss" />
+            </el-form-item> -->
+          </div>
+        </template>
+
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="default">取 消</el-button>
@@ -53,7 +100,7 @@
     </el-dialog>
 
     <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="920">
-      <SalaryConfirmationPDF :rowData="rowData"></SalaryConfirmationPDF>
+      <SalaryConfirmationPDF :rowData="rowData" @getList="getList"></SalaryConfirmationPDF>
     </el-dialog>
   </div>
 </template>
@@ -137,10 +184,34 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "合计金额",
+        label: "入职日期",
+        prop: "entryDate",
+      },
+    },
+    {
+      attrs: {
+        label: "生效日期",
+        prop: "effectiveDate",
+      },
+    },
+    {
+      attrs: {
+        label: "转正日期",
+        prop: "fullTimeDate",
+      },
+    },
+    {
+      attrs: {
+        label: "考勤结算金额",
         prop: "amount",
       },
     },
+    {
+      attrs: {
+        label: "记件结算金额",
+        prop: "perfAmount",
+      },
+    },
     // {
     //   attrs: {
     //     label: "修改时间",
@@ -308,7 +379,7 @@ const formConfig = computed(() => {
     {
       type: "date",
       itemType: "date",
-      prop: "documentaryTime",
+      prop: "entryDate",
       label: "入职日期",
       disabled: false,
       itemWidth: 50,
@@ -326,7 +397,8 @@ const formConfig = computed(() => {
       itemType: "date",
       prop: "fullTimeDate",
       label: "转正日期",
-      disabled: false,
+      placeholder: " ",
+      disabled: true,
       itemWidth: 50,
     },
     {
@@ -339,6 +411,75 @@ const formConfig = computed(() => {
       controls: false,
       itemWidth: 50,
     },
+    {
+      type: "number",
+      prop: "monthRest",
+      label: "月休息(天)",
+      precision: 0,
+      min: 0,
+      // max: 12,
+      controls: false,
+      itemWidth: 50,
+    },
+    {
+      type: "number",
+      prop: "dailyHours",
+      label: "日工作时长",
+      precision: 0,
+      min: 0,
+      // max: 12,
+      controls: false,
+      itemWidth: 50,
+    },
+    {
+      type: "slot",
+      label: "上午上班时间段",
+      slotName: "morning",
+    },
+    {
+      type: "slot",
+      label: "下午上班时间段",
+      slotName: "afternoon",
+    },
+    {
+      type: "input",
+      prop: "salaryRemark",
+      label: "薪资说明",
+      itemType: "textarea",
+      itemWidth: 100,
+    },
+    // {
+    //   type: "date",
+    //   itemType: "datetime",
+    //   prop: "morningBeginTime",
+    //   label: "上午开始时间",
+    //   disabled: false,
+    //   itemWidth: 50,
+    // },
+    // {
+    //   type: "date",
+    //   itemType: "datetime",
+    //   prop: "morningEndTime",
+    //   label: "上午结束时间",
+    //   disabled: false,
+    //   itemWidth: 50,
+    // },
+    // {
+    //   type: "date",
+    //   itemType: "datetime",
+    //   prop: "afternoonBeginTime",
+    //   label: "下午开始时间",
+    //   disabled: false,
+    //   itemWidth: 50,
+    // },
+    // {
+    //   type: "date",
+    //   itemType: "datetime",
+    //   prop: "afternoonEndTime",
+    //   label: "下午结束时间",
+    //   disabled: false,
+    //   itemWidth: 50,
+    // },
     // {
     //   type: "number",
     //   prop: "amount",
@@ -375,6 +516,33 @@ const rules = ref({
   money: [{ required: true, message: "请输入金额", trigger: "blur" }],
   fileList: [{ required: true, message: "请上传签字文件", trigger: "change" }],
   // remark: [{ required: true, message: "请输入说明", trigger: "blur" }],
+  entryDate: [{ required: true, message: "请选择入职日期", trigger: "change" }],
+  effectiveDate: [
+    { required: true, message: "请选择生效日期", trigger: "change" },
+  ],
+  probationPeriod: [
+    { required: true, message: "请输入试用期限(月)", trigger: "blur" },
+  ],
+  monthRest: [{ required: true, message: "请输入月休息(天)", trigger: "blur" }],
+  dailyHours: [{ required: true, message: "请输入上班时长", trigger: "blur" }],
+  // morning: [
+  //   { required: true, message: "请选择上午上班时间段", trigger: "change" },
+  // ],
+  // afternoon: [
+  //   { required: true, message: "请选下午上班时间段", trigger: "change" },
+  // ],
+  morningBeginTime: [
+    { required: true, message: "请选择上午开始时间", trigger: "change" },
+  ],
+  morningEndTime: [
+    { required: true, message: "请选择上午结束时间", trigger: "change" },
+  ],
+  afternoonBeginTime: [
+    { required: true, message: "请选择下午开始时间", trigger: "change" },
+  ],
+  afternoonEndTime: [
+    { required: true, message: "请选择下午结束时间", trigger: "change" },
+  ],
 });
 const formData = reactive({
   data: {},
@@ -452,6 +620,14 @@ const submitForm = () => {
     // ) {
     //   return proxy.msgTip("请添加薪资结构", 2);
     // }
+    // if (formData.data.morning && formData.data.morning.length > 0) {
+    //   formData.data.morningBeginTime = formData.data.morning[0];
+    //   formData.data.morningEndTime = formData.data.morning[1];
+    // }
+    // if (formData.data.afternoon && formData.data.afternoon.length > 0) {
+    //   formData.data.afternoonBeginTime = formData.data.afternoon[0];
+    //   formData.data.afternoonEndTime = formData.data.afternoon[1];
+    // }
     loadingDialog.value = true;
     proxy.post("/userSalaryManage/edit", formData.data).then(
       () => {
@@ -498,6 +674,23 @@ const update = (row) => {
   modalType.value = "edit";
   proxy.post("/userSalaryManage/detail", { userId: row.userId }).then((res) => {
     formData.data = res;
+    // if (!res.morningBeginTime) {
+    //   formData.data.morning = [];
+    // } else {
+    //   formData.data.morning = [
+    //     formData.data.morningBeginTime,
+    //     formData.data.morningEndTime,
+    //   ];
+    // }
+    // if (!res.afternoonBeginTime) {
+    //   formData.data.afternoon = [];
+    // } else {
+    //   formData.data.afternoon = [
+    //     formData.data.afternoonBeginTime,
+    //     formData.data.afternoonEndTime,
+    //   ];
+    // }
+
     proxy
       .post("/fileInfo/getList", { businessIdList: [row.userId] })
       .then((fileObj) => {

+ 19 - 3
src/views/systemTenant/tenant/userTenant/index.vue

@@ -445,7 +445,7 @@ const formConfig = computed(() => {
           id: 0,
         },
       ],
-      itemWidth: 50,
+      itemWidth: 100,
     },
     {
       type: "select",
@@ -462,6 +462,7 @@ const formConfig = computed(() => {
           value: "1",
         },
       ],
+      itemWidth: 50,
     },
     {
       type: "select",
@@ -478,9 +479,24 @@ const formConfig = computed(() => {
           value: 20,
         },
       ],
-      itemWidth: 100,
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      prop: "post",
+      label: "岗位",
+      required: true,
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "education",
+      label: "学历",
+      required: true,
+      itemWidth: 50,
+      itemType: "text",
     },
-
     {
       type: "input",
       prop: "phonenumber",