Browse Source

no message

ly 1 year ago
parent
commit
e446b3ead8
1 changed files with 253 additions and 247 deletions
  1. 253 247
      src/views/business/production/receiveTicket/view.vue

+ 253 - 247
src/views/business/production/receiveTicket/view.vue

@@ -1,5 +1,6 @@
 <template>
-  <el-dialog title="收票信息" v-model="visible" :width="width" append-to-body draggable @close="close" :close-on-click-modal = "false">
+  <el-dialog title="收票信息" v-model="visible" :width="width" append-to-body draggable @close="close"
+    :close-on-click-modal="false">
     <!-- 功能按钮 -->
     <div style="padding: 8px 24px 16px 24px">
       <el-form size="small" label-width="100px" v-model="form">
@@ -57,9 +58,9 @@
               <div v-if="form.status === 3">{{ form.salaryTicket }}</div>
               <div v-else>
                 {{
-                  salaryDetail == null
-                  ? "未开始"
-                  : getStatusOfSalary(salaryDetail)
+                salaryDetail == null
+                ? "未开始"
+                : getStatusOfSalary(salaryDetail)
                 }}
               </div>
             </el-form-item>
@@ -189,7 +190,7 @@
       <el-button v-if="showVerify()" type="primary" size="small" icon="check" style="float: right; margin-left: 12px"
         @click="handleVerify(3, 1)">
         审核通过并反馈</el-button>
-      <el-button v-if="verifiable() && form.status === 3" type="warning" size="small" icon="back"
+      <el-button v-if="showVerifyDeleted() && form.status === 3" type="warning" size="small" icon="back"
         style="float: right; margin-left: 12px" @click="returnStatus()">
         退回</el-button>
     </div>
@@ -198,277 +199,282 @@
   </el-dialog>
 </template>
 <script setup>
-import {
-  getDetail,
-  verifyDetail,
-  turnBackDetail,
-  getSalaryDetail,
-} from "@/api/business/production/receiveTicket";
-import feedbackDialog from "../feedbackDialog.vue";
-import { salaryStatusTypes } from "@/utils/default";
-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);
+  import {
+    getDetail,
+    verifyDetail,
+    turnBackDetail,
+    getSalaryDetail,
+  } from "@/api/business/production/receiveTicket";
+  import feedbackDialog from "../feedbackDialog.vue";
+  import { salaryStatusTypes } from "@/utils/default";
+  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 permissions = useUserStore().permissions;
-const all_permission = "*:*:*";
+  const permissions = useUserStore().permissions;
+  const all_permission = "*:*:*";
 
-const feedbackDialogView = ref(null);
+  const feedbackDialogView = ref(null);
 
-const props = defineProps({
-  getList: {
-    type: Function,
-    default: () => { },
-  },
-});
+  const props = defineProps({
+    getList: {
+      type: Function,
+      default: () => { },
+    },
+  });
 
-const { getList } = toRefs(props);
-const total = ref(0);
+  const { getList } = toRefs(props);
+  const total = ref(0);
 
-const data = reactive({
-  confirmChoices: [
-    {
-      label: "有",
-      value: 1,
-    },
-    {
-      label: "无",
-      value: 0,
-    },
-  ],
-  salaryDetail: null,
-  selectStatus: [
-    {
-      label: "未开始",
-      value: 0,
-      color: "#fff",
-    },
-    {
-      label: "待确认",
-      value: 1,
-      color: "#fcd080",
-    },
-    {
-      label: "待审核",
-      value: 2,
-      color: "#80a7fc",
-    },
-    {
-      label: "已完成",
-      value: 3,
-      color: "#57e63e",
-    },
-    {
-      label: "驳回待处理",
-      value: 4,
-      color: "#e63e3e",
-    },
-  ],
-});
+  const data = reactive({
+    confirmChoices: [
+      {
+        label: "有",
+        value: 1,
+      },
+      {
+        label: "无",
+        value: 0,
+      },
+    ],
+    salaryDetail: null,
+    selectStatus: [
+      {
+        label: "未开始",
+        value: 0,
+        color: "#fff",
+      },
+      {
+        label: "待确认",
+        value: 1,
+        color: "#fcd080",
+      },
+      {
+        label: "待审核",
+        value: 2,
+        color: "#80a7fc",
+      },
+      {
+        label: "已完成",
+        value: 3,
+        color: "#57e63e",
+      },
+      {
+        label: "驳回待处理",
+        value: 4,
+        color: "#e63e3e",
+      },
+    ],
+  });
 
-const { confirmChoices, salaryDetail, selectStatus } = toRefs(data);
+  const { confirmChoices, salaryDetail, selectStatus } = toRefs(data);
 
-const employeeEmptyData = {
-  id: null,
-  title: "",
-  remark: "",
-  employeeName: "",
-  departmentName: "",
-  idCode: "",
-  salaryAmount: "",
-  bonusAmount: "",
-  allowanceAmount: "",
-  subsidyAmount: "",
-  absenceCut: "",
-  planSalary: 0,
-  actuallySalary: 0,
-  endowmentInsurance: 0,
-  medicalInsurance: 0,
-  unemploymentBenefit: 0,
-  seriousIllnessInsurance: 0,
-  housingFund: 0,
-  otherCut: 0,
-  cumulativeIncome: 0,
-  cumulativeSpecialCut: 0,
-  cumulativeChildEduCut: 0,
-  cumulativeHouseLoanInterestCut: 0,
-  cumulativeHouseRentCut: 0,
-  cumulativeSupportElderCut: 0,
-  cumulativeContinuingEduCut: 0,
-  cumulativeBabyCareCut: 0,
-  sumSpecialCumulativeCut: 0,
-  cumulativeOtherCut: 0,
-  cumulativeIndividualIncomeTax: 0,
-  cumulativeHasPaidIit: 0,
-  currentIndividualIncomeTax: 0,
-  idiograph: "",
-  details: [],
-  editStatus: true,
-};
+  const employeeEmptyData = {
+    id: null,
+    title: "",
+    remark: "",
+    employeeName: "",
+    departmentName: "",
+    idCode: "",
+    salaryAmount: "",
+    bonusAmount: "",
+    allowanceAmount: "",
+    subsidyAmount: "",
+    absenceCut: "",
+    planSalary: 0,
+    actuallySalary: 0,
+    endowmentInsurance: 0,
+    medicalInsurance: 0,
+    unemploymentBenefit: 0,
+    seriousIllnessInsurance: 0,
+    housingFund: 0,
+    otherCut: 0,
+    cumulativeIncome: 0,
+    cumulativeSpecialCut: 0,
+    cumulativeChildEduCut: 0,
+    cumulativeHouseLoanInterestCut: 0,
+    cumulativeHouseRentCut: 0,
+    cumulativeSupportElderCut: 0,
+    cumulativeContinuingEduCut: 0,
+    cumulativeBabyCareCut: 0,
+    sumSpecialCumulativeCut: 0,
+    cumulativeOtherCut: 0,
+    cumulativeIndividualIncomeTax: 0,
+    cumulativeHasPaidIit: 0,
+    currentIndividualIncomeTax: 0,
+    idiograph: "",
+    details: [],
+    editStatus: true,
+  };
 
-const form = ref({
-  amount: null,
-  details: [],
-});
+  const form = ref({
+    amount: null,
+    details: [],
+  });
 
-const emptyForm = {
-  details: [],
-};
+  const emptyForm = {
+    details: [],
+  };
 
-function open(detail) {
-  console.log(detail);
-  visible.value = true;
-  form.value = detail;
-  loadData();
-}
+  function open(detail) {
+    console.log(detail);
+    visible.value = true;
+    form.value = detail;
+    loadData();
+  }
 
-function loadData() {
-  Promise.all([
-    getDetail(form.value),
-    getSalaryDetail({
-      companyId: form.value.companyId,
-      year: form.value.year,
-      month: form.value.month,
-    }),
-  ]).then((res) => {
-    form.value = { ...proxy.deepClone(emptyForm), ...res[0].data };
-    salaryDetail.value = res[1].data;
-  });
-}
+  function loadData() {
+    Promise.all([
+      getDetail(form.value),
+      getSalaryDetail({
+        companyId: form.value.companyId,
+        year: form.value.year,
+        month: form.value.month,
+      }),
+    ]).then((res) => {
+      form.value = { ...proxy.deepClone(emptyForm), ...res[0].data };
+      salaryDetail.value = res[1].data;
+    });
+  }
 
-function close() {
-  visible.value = false;
-  reset();
-}
+  function close() {
+    visible.value = false;
+    reset();
+  }
 
-function reset() {
-  form.value = proxy.deepClone(emptyForm);
-  total.value = 0;
-}
+  function reset() {
+    form.value = proxy.deepClone(emptyForm);
+    total.value = 0;
+  }
 
-function printSalary() { }
-function exportSalary() { }
+  function printSalary() { }
+  function exportSalary() { }
+
+  function showVerify() {
+    if (salaryDetail.value == null || salaryDetail.value.status !== 3) {
+      return false;
+    }
+    if (
+      form.value.id == null ||
+      form.value.status === 0 ||
+      form.value.status === 1 ||
+      form.value.status === 3 ||
+      form.value.status === 4
+    ) {
+      return false;
+    } else if (verifiable()) {
+      return true;
+    } else {
+      return false;
+    }
+  }
+  function showVerifyDeleted() {
+    return (
+      permissions.includes(all_permission) ||
+      permissions.includes("business:salary:return")
+    );
+  }
+  function verifiable() {
+    return (
+      permissions.includes(all_permission) ||
+      permissions.includes("business:salary:verify")
+      // permissions.includes("business:salary:return")
+    );
+  }
 
-function showVerify() {
-  if (salaryDetail.value == null || salaryDetail.value.status !== 3) {
-    return false;
+  function handleCurrentChange(row) {
+    currentSource.value = row;
   }
-  if (
-    form.value.id == null ||
-    form.value.status === 0 ||
-    form.value.status === 1 ||
-    form.value.status === 3 ||
-    form.value.status === 4
-  ) {
-    return false;
-  } else if (verifiable()) {
-    return true;
-  } else {
-    return false;
+
+  function handleCheckChange(selection) {
+    selections.value = selection.map((item) => item);
   }
-}
 
-function verifiable() {
-  return (
-    permissions.includes(all_permission) || 
-    // permissions.includes("business:salary:verify")
-    permissions.includes("business:salary:return")
-  );
-}
+  function handleVerify(status, feedbackStatus) {
+    if (status === 4) {
+      const saveValue = proxy.deepClone(form.value);
+      saveValue.status = status;
+      saveValue.feedbackStatus = 1;
+      feedbackDialogView.value.open(saveValue);
+    } else if (status === 3 && feedbackStatus === 1) {
+      const saveValue = proxy.deepClone(form.value);
+      saveValue.status = status;
+      saveValue.feedbackStatus = feedbackStatus;
+      feedbackDialogView.value.open(saveValue);
+    } else {
+      proxy.$modal
+        .confirm("确认审核么?")
+        .then((_) => {
+          const saveValue = proxy.deepClone(form.value);
+          saveValue.status = status;
+          verify(saveValue);
+        })
+        .catch((_) => {
+          proxy.$modal.msg("已取消审核");
+        });
+    }
+  }
 
-function handleCurrentChange(row) {
-  currentSource.value = row;
-}
+  function verify(data) {
+    verifyDetail(data).then((res) => {
+      reset();
+      getList.value();
+      close();
+    });
+  }
 
-function handleCheckChange(selection) {
-  selections.value = selection.map((item) => item);
-}
+  function computeTotal() {
+    let totalSalay = 0;
+    form.value.details.forEach((l) => {
+      totalSalay += l.actuallySalary == null ? 0 : l.actuallySalary;
+    });
+    form.value.amount = totalSalay.toFixed(2);
+  }
 
-function handleVerify(status, feedbackStatus) {
-  if (status === 4) {
-    const saveValue = proxy.deepClone(form.value);
-    saveValue.status = status;
-    saveValue.feedbackStatus = 1;
-    feedbackDialogView.value.open(saveValue);
-  } else if (status === 3 && feedbackStatus === 1) {
-    const saveValue = proxy.deepClone(form.value);
-    saveValue.status = status;
-    saveValue.feedbackStatus = feedbackStatus;
-    feedbackDialogView.value.open(saveValue);
-  } else {
+  function returnStatus(status) {
     proxy.$modal
-      .confirm("确认审核么?")
+      .confirm("确认退回么?")
       .then((_) => {
-        const saveValue = proxy.deepClone(form.value);
-        saveValue.status = status;
-        verify(saveValue);
+        turnBackDetail(form.value).then((res) => {
+          reset();
+          getList.value();
+          close();
+        });
       })
       .catch((_) => {
-        proxy.$modal.msg("已取消审核");
+        proxy.$modal.msg("已取消退回");
       });
   }
-}
-
-function verify(data) {
-  verifyDetail(data).then((res) => {
-    reset();
-    getList.value();
-    close();
-  });
-}
-
-function computeTotal() {
-  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) => {
-        reset();
-        getList.value();
-        close();
-      });
-    })
-    .catch((_) => {
-      proxy.$modal.msg("已取消退回");
-    });
-}
 
-function getStatusLabel(status) {
-  const index = selectStatus.value.findIndex((v) => v.value === status);
-  return index < 0 ? "未开始" : selectStatus.value[index].label;
-}
+  function getStatusLabel(status) {
+    const index = selectStatus.value.findIndex((v) => v.value === status);
+    return index < 0 ? "未开始" : selectStatus.value[index].label;
+  }
 
-function ticketNumberChange() {
-  let amount = 0;
-  amount += form.value.incomeTicket;
-  amount += form.value.costTicket;
-  amount += form.value.feeTicketNumber;
-  amount += form.value.bankCopyNumber;
-  amount += form.value.bankSlipsNumber;
-  amount += form.value.salaryTicket;
-  amount += form.value.ssafTicket;
-  amount += form.value.otherTicket;
+  function ticketNumberChange() {
+    let amount = 0;
+    amount += form.value.incomeTicket;
+    amount += form.value.costTicket;
+    amount += form.value.feeTicketNumber;
+    amount += form.value.bankCopyNumber;
+    amount += form.value.bankSlipsNumber;
+    amount += form.value.salaryTicket;
+    amount += form.value.ssafTicket;
+    amount += form.value.otherTicket;
 
-  form.value.sumNumber = amount;
-}
+    form.value.sumNumber = amount;
+  }
 
-function getStatusOfSalary(arg) {
-  const index = salaryStatusTypes.findIndex((v) => v.value === arg.status);
-  return index <= 0 ? "未开始" : salaryStatusTypes[index].label;
-}
-// 暴露给父组件的方法
-defineExpose({
-  open,
-});
+  function getStatusOfSalary(arg) {
+    const index = salaryStatusTypes.findIndex((v) => v.value === arg.status);
+    return index <= 0 ? "未开始" : salaryStatusTypes[index].label;
+  }
+  // 暴露给父组件的方法
+  defineExpose({
+    open,
+  });
 </script>