ezhizao_zx vor 1 Jahr
Ursprung
Commit
c70a7186aa
1 geänderte Dateien mit 269 neuen und 166 gelöschten Zeilen
  1. 269 166
      src/views/business/socialSecurity/fileListDialog.vue

+ 269 - 166
src/views/business/socialSecurity/fileListDialog.vue

@@ -1,7 +1,14 @@
 <template>
-  <el-dialog title="社保申报信息" v-model="visible" :width="width" append-to-body draggable @close="close">
+  <el-dialog
+    title="社保申报信息"
+    v-model="visible"
+    :width="width"
+    append-to-body
+    draggable
+    @close="close"
+  >
     <!-- 功能按钮 -->
-    <div style="padding: 8px 24px 16px 24px;">
+    <div style="padding: 8px 24px 16px 24px">
       <el-form size="small" label-width="100px" v-model="form">
         <el-row :gutter="30">
           <el-col :span="12">
@@ -17,18 +24,86 @@
           <el-col :span="24" class="details-container">
             <!--操作按钮 开始-->
             <div class="details-head">
-              <div class="title"><i class="fa fa-th-list" aria-hidden="true" /> 文件信息</div>
+              <div class="title">
+                <i class="fa fa-th-list" aria-hidden="true" /> 凭证
+              </div>
             </div>
             <div class="details-body">
               <div>
-                <el-table ref="sourceTable" :data="form.evidenceFiles" size="small" max-height="260px" border
-                  highlight-current-row header-row-class-name="list-header-row" row-class-name="list-row"
-                  @selection-change="handleCheckChange" @current-change="handleCurrentChange">
-                  <el-table-column label="文件名" prop="originalFileName" align="center" show-overflow-tooltip>
+                <el-table
+                  ref="sourceTable"
+                  :data="form.evidenceFiles"
+                  size="small"
+                  max-height="260px"
+                  border
+                  highlight-current-row
+                  header-row-class-name="list-header-row"
+                  row-class-name="list-row"
+                  @selection-change="handleCheckChange"
+                  @current-change="handleCurrentChange"
+                >
+                  <el-table-column
+                    label="文件名"
+                    prop="originalFileName"
+                    align="center"
+                    show-overflow-tooltip
+                  >
                     <template #default="scope">
-                      <el-button size="small" type="text" @click="openFile(scope.row)">{{ scope.row.originalFileName == ''
-                        ?
-                        '打开文件' : scope.row.originalFileName }}</el-button>
+                      <el-button
+                        size="small"
+                        type="text"
+                        @click="openFile(scope.row)"
+                        >{{
+                          scope.row.originalFileName == ""
+                            ? "打开文件"
+                            : scope.row.originalFileName
+                        }}</el-button
+                      >
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </div>
+            </div>
+          </el-col>
+
+          <el-col :span="24" class="details-container">
+            <!--操作按钮 开始-->
+            <div class="details-head">
+              <div class="title">
+                <i class="fa fa-th-list" aria-hidden="true" /> 报表
+              </div>
+            </div>
+            <div class="details-body">
+              <div>
+                <el-table
+                  ref="sourceTable"
+                  :data="form.reportFiles"
+                  size="small"
+                  max-height="260px"
+                  border
+                  highlight-current-row
+                  header-row-class-name="list-header-row"
+                  row-class-name="list-row"
+                  @selection-change="handleCheckChange"
+                  @current-change="handleCurrentChange"
+                >
+                  <el-table-column
+                    label="文件名"
+                    prop="originalFileName"
+                    align="center"
+                    show-overflow-tooltip
+                  >
+                    <template #default="scope">
+                      <el-button
+                        size="small"
+                        type="text"
+                        @click="openFile(scope.row)"
+                        >{{
+                          scope.row.originalFileName == ""
+                            ? "打开文件"
+                            : scope.row.originalFileName
+                        }}</el-button
+                      >
                     </template>
                   </el-table-column>
                 </el-table>
@@ -38,63 +113,65 @@
         </el-row>
       </el-form>
     </div>
-    <div class="form-btns-container" style="height: 40px;">
-    </div>
+    <div class="form-btns-container" style="height: 40px"></div>
     <!-- <print-dialog ref="printDialog" /> -->
   </el-dialog>
 </template>
 <script setup>
 import { getDetail } from "@/api/business/production/socialSecurityDeclare";
-import useUserStore from '@/store/modules/user'
+import useUserStore from "@/store/modules/user";
 import { ref } from "vue";
-const { proxy } = getCurrentInstance()
-const visible = ref(false)
-const width = ref(800)
-const selections = ref([])
-const currentSource = ref(null)
-
-const showViewer = ref(false)
-const currentFileList = ref([])
-const showIndex = ref(0)
-const editStatus = ref(false)
-
-const baseUrl = ref(import.meta.env.VITE_APP_BASE_API)
-
-const permissions = useUserStore().permissions
-const all_permission = "*:*:*"
-
-const feedbackDialogView = ref(null)
-
-const confirmChoices = ref([{
-  label: '是',
-  value: 1
-}, {
-  label: '否',
-  value: 0
-}])
+const { proxy } = getCurrentInstance();
+const visible = ref(false);
+const width = ref(800);
+const selections = ref([]);
+const currentSource = ref(null);
+
+const showViewer = ref(false);
+const currentFileList = ref([]);
+const showIndex = ref(0);
+const editStatus = ref(false);
+
+const baseUrl = ref(import.meta.env.VITE_APP_BASE_API);
+
+const permissions = useUserStore().permissions;
+const all_permission = "*:*:*";
+
+const feedbackDialogView = ref(null);
+
+const confirmChoices = ref([
+  {
+    label: "是",
+    value: 1,
+  },
+  {
+    label: "否",
+    value: 0,
+  },
+]);
 
 const props = defineProps({
   getList: {
     type: Function,
-    default: () => { },
-  }
+    default: () => {},
+  },
 });
 
-const { getList } = toRefs(props)
-const total = ref(0)
+const { getList } = toRefs(props);
+const total = ref(0);
 
 const employeeEmptyData = {
   id: null,
-  title: '',
-  remark: '',
-  employeeName: '',
-  departmentName: '',
-  idCode: '',
-  salaryAmount: '',
-  bonusAmount: '',
-  allowanceAmount: '',
-  subsidyAmount: '',
-  absenceCut: '',
+  title: "",
+  remark: "",
+  employeeName: "",
+  departmentName: "",
+  idCode: "",
+  salaryAmount: "",
+  bonusAmount: "",
+  allowanceAmount: "",
+  subsidyAmount: "",
+  absenceCut: "",
   planSalary: 0,
   actuallySalary: 0,
   endowmentInsurance: 0,
@@ -116,203 +193,229 @@ const employeeEmptyData = {
   cumulativeIndividualIncomeTax: 0,
   cumulativeHasPaidIit: 0,
   currentIndividualIncomeTax: 0,
-  idiograph: '',
+  idiograph: "",
   details: [],
-  editStatus: true
-}
+  editStatus: true,
+};
 
 const form = ref({
   amount: null,
-  details: []
-})
+  details: [],
+});
 
 const emptyForm = {
-  details: []
-}
+  details: [],
+};
 
 function open(detail) {
-  console.log(detail)
-  visible.value = true
-  form.value = detail
-  loadData()
+  console.log(detail);
+  visible.value = true;
+  form.value = detail;
+  loadData();
 }
 
 function loadData() {
-  getDetail(form.value).then(res => {
-    form.value = { ...proxy.deepClone(emptyForm), ...res.data }
-  })
+  getDetail(form.value).then((res) => {
+    form.value = { ...proxy.deepClone(emptyForm), ...res.data };
+  });
 }
 
 function close() {
-  visible.value = false
-  reset()
+  visible.value = false;
+  reset();
 }
 
 function reset() {
-  form.value = proxy.deepClone(emptyForm)
-  total.value = 0
-}
-
-function printSalary() {
-
+  form.value = proxy.deepClone(emptyForm);
+  total.value = 0;
 }
-function exportSalary() {
 
-}
+function printSalary() {}
+function exportSalary() {}
 
 function showVerify() {
-  if (form.value.id == null || form.value.status === 0 || form.value.status === 3) {
-    return false
+  if (
+    form.value.id == null ||
+    form.value.status === 0 ||
+    form.value.status === 3
+  ) {
+    return false;
   } else if (verifiable()) {
-    return true
+    return true;
   } else {
-    return false
+    return false;
   }
 }
 
 function verifiable() {
   // console.log(permissions)
   // console.log(permissions)
-  return permissions.includes(all_permission) || permissions.includes("business:salary:verify")
+  return (
+    permissions.includes(all_permission) ||
+    permissions.includes("business:salary:verify")
+  );
 }
 
 function handleCurrentChange(row) {
-  currentSource.value = row
+  currentSource.value = row;
 }
 
 function handleCheckChange(selection) {
-  selections.value = selection.map((item) => item)
+  selections.value = selection.map((item) => item);
 }
 
 function getSummaries(param) {
-  const { columns, data } = param
-  const sums = []
+  const { columns, data } = param;
+  const sums = [];
   columns.forEach((column, index) => {
     if (index === 0) {
-      sums[index] = '合计'
-      return
+      sums[index] = "合计";
+      return;
     } else if (index === 1) {
-      sums[index] = ''
-      return
+      sums[index] = "";
+      return;
     }
-    const values = data.map(item => Number(item[column.property]))
+    const values = data.map((item) => Number(item[column.property]));
 
-    if (!values.every(value => isNaN(value))) {
-      sums[index] = (values.reduce((prev, curr) => {
-        const value = Number(curr)
+    if (!values.every((value) => isNaN(value))) {
+      sums[index] = values.reduce((prev, curr) => {
+        const value = Number(curr);
         if (!isNaN(value)) {
-          return (Number(prev) + Number(curr)).toFixed(2)
+          return (Number(prev) + Number(curr)).toFixed(2);
         } else {
-          return (Number(prev)).toFixed(2)
+          return Number(prev).toFixed(2);
         }
-      }, 0))
+      }, 0);
     } else {
-      sums[index] = ''
+      sums[index] = "";
     }
-  })
-  return sums
+  });
+  return sums;
 }
 
 function openFile(row) {
-  window.open(`${baseUrl.value}${row.fileUrl}`)
+  window.open(`${baseUrl.value}${row.fileUrl}`);
 }
 
 function handleVerify(status) {
   if (status === 4) {
-    const saveValue = proxy.deepClone(form.value)
-    saveValue.status = status
-    feedbackDialogView.value.open(saveValue)
+    const saveValue = proxy.deepClone(form.value);
+    saveValue.status = status;
+    feedbackDialogView.value.open(saveValue);
   } else {
-    proxy.$modal.confirm('确认审核么?').then(_ => {
-      const saveValue = proxy.deepClone(form.value)
-      saveValue.status = status
-      verify(saveValue)
-    }).catch(_ => {
-      proxy.$modal.msg('已取消审核')
-    })
+    proxy.$modal
+      .confirm("确认审核么?")
+      .then((_) => {
+        const saveValue = proxy.deepClone(form.value);
+        saveValue.status = status;
+        verify(saveValue);
+      })
+      .catch((_) => {
+        proxy.$modal.msg("已取消审核");
+      });
   }
 }
 
 function verify(data) {
-  verifyDetail(data).then(res => {
-    reset()
-    getList.value()
-    close()
-  })
+  verifyDetail(data).then((res) => {
+    reset();
+    getList.value();
+    close();
+  });
 }
 
 function rowChangeSum(row) {
-  let actuallySalary = 0
-  actuallySalary += row.planSalary == null ? 0 : row.planSalary
-  actuallySalary += row.bonusAmount == null ? 0 : row.bonusAmount
-  actuallySalary -= row.endowmentInsurance == null ? 0 : row.endowmentInsurance
-  actuallySalary -= row.medicalInsurance == null ? 0 : row.medicalInsurance
-  actuallySalary -= row.unemploymentBenefit == null ? 0 : row.unemploymentBenefit
-  actuallySalary -= row.seriousIllnessInsurance == null ? 0 : row.seriousIllnessInsurance
-  actuallySalary -= row.housingFund == null ? 0 : row.housingFund
+  let actuallySalary = 0;
+  actuallySalary += row.planSalary == null ? 0 : row.planSalary;
+  actuallySalary += row.bonusAmount == null ? 0 : row.bonusAmount;
+  actuallySalary -= row.endowmentInsurance == null ? 0 : row.endowmentInsurance;
+  actuallySalary -= row.medicalInsurance == null ? 0 : row.medicalInsurance;
+  actuallySalary -=
+    row.unemploymentBenefit == null ? 0 : row.unemploymentBenefit;
+  actuallySalary -=
+    row.seriousIllnessInsurance == null ? 0 : row.seriousIllnessInsurance;
+  actuallySalary -= row.housingFund == null ? 0 : row.housingFund;
   if (form.value.hasIndividualIncomeTax === 1) {
-    actuallySalary -= row.individualIncomeTaxConfirm == null ? 0 : row.individualIncomeTaxConfirm
+    actuallySalary -=
+      row.individualIncomeTaxConfirm == null
+        ? 0
+        : row.individualIncomeTaxConfirm;
   } else {
-    actuallySalary -= row.currentIndividualIncomeTax == null ? 0 : row.currentIndividualIncomeTax
+    actuallySalary -=
+      row.currentIndividualIncomeTax == null
+        ? 0
+        : row.currentIndividualIncomeTax;
   }
-  actuallySalary -= row.otherCut == null ? 0 : row.otherCut
-  row.actuallySalary = actuallySalary
-  computeTotal()
+  actuallySalary -= row.otherCut == null ? 0 : row.otherCut;
+  row.actuallySalary = actuallySalary;
+  computeTotal();
 }
 
 function computeTotal() {
-  let totalSalay = 0
-  form.value.details.forEach(l => {
-    totalSalay += l.actuallySalary == null ? 0 : l.actuallySalary
-  })
-  form.value.amount = totalSalay.toFixed(2)
+  let totalSalay = 0;
+  form.value.details.forEach((l) => {
+    totalSalay += l.actuallySalary == null ? 0 : l.actuallySalary;
+  });
+  form.value.amount = totalSalay.toFixed(2);
 }
 
 function returnStatus(status) {
-  proxy.$modal.confirm('确认退回么?').then(_ => {
-    turnBackDetail(form.value).then(res => {
-      // if (res.data.successStatus = true) {
-      //   reset()
-      //   getList.value()
-      //   close()
-      // } else {
-      //   proxy.$modal.msg(res.data.message)
-      // }
-      reset()
-      getList.value()
-      close()
+  proxy.$modal
+    .confirm("确认退回么?")
+    .then((_) => {
+      turnBackDetail(form.value).then((res) => {
+        // if (res.data.successStatus = true) {
+        //   reset()
+        //   getList.value()
+        //   close()
+        // } else {
+        //   proxy.$modal.msg(res.data.message)
+        // }
+        reset();
+        getList.value();
+        close();
+      });
     })
-  }).catch(_ => {
-    proxy.$modal.msg('已取消退回')
-  })
+    .catch((_) => {
+      proxy.$modal.msg("已取消退回");
+    });
 }
 
 function changeIndividual(arg) {
   // if (arg === 1) {
-  form.value.details.forEach(row => {
-    let actuallySalary = 0
-    actuallySalary += row.planSalary == null ? 0 : row.planSalary
-    actuallySalary += row.bonusAmount == null ? 0 : row.bonusAmount
-    actuallySalary -= row.endowmentInsurance == null ? 0 : row.endowmentInsurance
-    actuallySalary -= row.medicalInsurance == null ? 0 : row.medicalInsurance
-    actuallySalary -= row.unemploymentBenefit == null ? 0 : row.unemploymentBenefit
-    actuallySalary -= row.seriousIllnessInsurance == null ? 0 : row.seriousIllnessInsurance
-    actuallySalary -= row.housingFund == null ? 0 : row.housingFund
+  form.value.details.forEach((row) => {
+    let actuallySalary = 0;
+    actuallySalary += row.planSalary == null ? 0 : row.planSalary;
+    actuallySalary += row.bonusAmount == null ? 0 : row.bonusAmount;
+    actuallySalary -=
+      row.endowmentInsurance == null ? 0 : row.endowmentInsurance;
+    actuallySalary -= row.medicalInsurance == null ? 0 : row.medicalInsurance;
+    actuallySalary -=
+      row.unemploymentBenefit == null ? 0 : row.unemploymentBenefit;
+    actuallySalary -=
+      row.seriousIllnessInsurance == null ? 0 : row.seriousIllnessInsurance;
+    actuallySalary -= row.housingFund == null ? 0 : row.housingFund;
     if (arg === 1) {
-      actuallySalary -= row.individualIncomeTaxConfirm == null ? 0 : row.individualIncomeTaxConfirm
+      actuallySalary -=
+        row.individualIncomeTaxConfirm == null
+          ? 0
+          : row.individualIncomeTaxConfirm;
     } else {
-      actuallySalary -= row.currentIndividualIncomeTax == null ? 0 : row.currentIndividualIncomeTax
+      actuallySalary -=
+        row.currentIndividualIncomeTax == null
+          ? 0
+          : row.currentIndividualIncomeTax;
     }
-    actuallySalary -= row.otherCut == null ? 0 : row.otherCut
-    row.actuallySalary = actuallySalary
-  })
-  computeTotal()
+    actuallySalary -= row.otherCut == null ? 0 : row.otherCut;
+    row.actuallySalary = actuallySalary;
+  });
+  computeTotal();
 }
 
 function passwordCheckHandler(value, field) {
   // console.log(value)
   if (!passwordCheck(form.value[field])) {
-    proxy.$modal.msgError('请输入正确密码')
+    proxy.$modal.msgError("请输入正确密码");
   }
 }
 
@@ -327,8 +430,8 @@ function closeImages() {
 
 // 暴露给父组件的方法
 defineExpose({
-  open
-})
+  open,
+});
 </script>
 <style scoped>
 .img {