소스 검색

OW费用修改审核和新加生成应收应付

Qukatie 2 주 전
부모
커밋
d2b56255ec
2개의 변경된 파일120개의 추가작업 그리고 18개의 파일을 삭제
  1. 37 13
      src/views/ow/owPut/detailsPage.vue
  2. 83 5
      src/views/ow/owTask/detailsPage.vue

+ 37 - 13
src/views/ow/owPut/detailsPage.vue

@@ -525,12 +525,7 @@
                 <el-button type="primary" plain size="small" :disabled="selectionfeedList.length == 0" @click="allClick('D发票申请')"
                   >发票申请</el-button
                 >
-                <el-button
-                  type="primary"
-                  plain
-                  size="small"
-                  :disabled="selectionfeedList.length == 0 && selectionfeecList.length == 0"
-                  @click="allClick('D费用申请')"
+                <el-button type="primary" plain size="small" :disabled="selectionfeedList.length == 0" @click="allClick('D费用申请')"
                   >请核费用</el-button
                 >
                 <el-button type="danger" plain size="small" :disabled="disabled || selectionfeecList.length == 0" @click="allClick('D撤销请核')"
@@ -707,7 +702,9 @@
                 <el-button type="primary" plain size="small" :disabled="selectionfeecList.length == 0" @click="allClick('C付费申请')"
                   >付费申请</el-button
                 >
-                <el-button type="primary" plain size="small" :disabled="selectionfeedList.length" @click="allClick('C费用申请')">请核费用</el-button>
+                <el-button type="primary" plain size="small" :disabled="selectionfeecList.length == 0" @click="allClick('C费用申请')"
+                  >请核费用</el-button
+                >
                 <el-button type="danger" plain size="small" :disabled="disabled || selectionfeecList.length == 0" @click="allClick('C撤销请核')"
                   >撤销请核</el-button
                 >
@@ -1153,6 +1150,7 @@ import containerNumber from "@/components/dicSelect/containerNumber";
 import checkSchedule from "@/components/checkH/checkSchedule.vue";
 import businessReports from "@/components/boxManagement/businessReports.vue";
 import reports from "@/components/boxManagement/reports.vue";
+import { isProcurement } from "@/api/basicData/configuration";
 import { dateFormat } from "@/util/date";
 import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
 import { getToken } from "@/util/auth";
@@ -1162,6 +1160,7 @@ export default {
   name: "detailsPage",
   data() {
     return {
+      userId: JSON.parse(localStorage.getItem("saber-userInfo")).content.user_id,
       saberUserInfo: JSON.parse(localStorage.getItem("saber-userInfo")).content, // 当前登录人个人信息
       selecPickList: [],
       selecPerList: [],
@@ -2866,6 +2865,7 @@ export default {
             cell: true,
             type: "number",
             controls: false,
+            precision: 0,
             overHidden: true
           },
           {
@@ -2874,6 +2874,7 @@ export default {
             cell: true,
             type: "number",
             controls: false,
+            precision: 0,
             overHidden: true
           },
           {
@@ -2917,7 +2918,8 @@ export default {
       updateStationKey: new Date().getTime(),
       containerNumberKey: new Date().getTime(),
       deptId: JSON.parse(localStorage.getItem("sysitemData")).deptId,
-      fixData: true
+      fixData: true,
+      expenseApplication:0,
     };
   },
   components: {
@@ -2949,6 +2951,11 @@ export default {
     if (this.detailData.copyId) {
       this.getCopydate(this.detailData.copyId);
     }
+     isProcurement({ param: "expense.application" }).then(res => {
+      if (res.data.data) {
+        this.expenseApplication = res.data.data;
+      }
+    });
     this.saveLocalCurrency(this.deptId);
   },
   methods: {
@@ -4017,8 +4024,7 @@ export default {
         });
       }
       if (name == "D费用申请") {
-        let selecList = [...this.selectionfeedList, ...this.selectionfeecList];
-        for (let row of selecList) {
+        for (let row of this.selectionfeedList) {
           if (!row.id) {
             return this.$message.error("请保存费用明细");
           }
@@ -4029,6 +4035,15 @@ export default {
             return this.$message.error("已申请费用,不允许重复申请");
           }
         }
+        if (
+          this.form.id &&
+          !(
+            this.selectionfeedList.filter(e => e.createUser == 0 || e.createUser == this.userId).length > 0 ||
+            this.roleName.indexOf("允许修改他人费用") >= 0
+          )
+        ) {
+          return this.$message.error("不允许申请他人费用");
+        }
         this.$confirm("确定申请费用?", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
@@ -4038,7 +4053,7 @@ export default {
           obj = {
             srcId: this.form.id,
             srcType: this.form.type,
-            feeCenterList: selecList,
+            feeCenterList: this.selectionfeedList,
             url: "/ow/owPut/index",
             pageStatus: "",
             pageLabel: "OW(放)"
@@ -4117,6 +4132,15 @@ export default {
             return this.$message.error("已申请费用,不允许重复申请");
           }
         }
+        if (
+          this.form.id &&
+          !(
+            this.selectionfeecList.filter(e => e.createUser == 0 || e.createUser == this.userId).length > 0 ||
+            this.roleName.indexOf("允许修改他人费用") >= 0
+          )
+        ) {
+          return this.$message.error("不允许申请他人费用");
+        }
         this.$confirm("确定申请费用?", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
@@ -4155,7 +4179,7 @@ export default {
           if (row.auditStatus == 0) {
             return this.$message.error("未申请费用,不允许撤销");
           }
-          if (row.auditStatus > 2) {
+          if (row.auditStatus > 2 && this.expenseApplication == 1) {
             return this.$message.error("费用已经审核通过,请使用申请修改和删除功能!");
           }
         }
@@ -4198,7 +4222,7 @@ export default {
           if (row.auditStatus == 0) {
             return this.$message.error("未申请费用,不允许撤销");
           }
-          if (row.auditStatus > 2) {
+          if (row.auditStatus > 2 && this.expenseApplication == 1) {
             return this.$message.error("费用已经审核通过,请使用申请修改和删除功能!");
           }
         }

+ 83 - 5
src/views/ow/owTask/detailsPage.vue

@@ -559,10 +559,15 @@
                   >批量删除</el-button
                 >
                 <!-- <el-button type="primary" plain size="small" :disabled="editDisabled">计算超期箱使费</el-button> -->
+                <el-button type="primary" plain size="small" :disabled="selectionfeedList.length == 0" @click="allClick('生成应付')"
+                  >生成应付</el-button
+                >
                 <el-button type="primary" plain size="small" :disabled="selectionfeedList.length == 0" @click="allClick('D发票申请')"
                   >发票申请</el-button
                 >
-                <el-button type="primary" plain size="small" :disabled="selectionfeedList.length" @click="allClick('D费用申请')">请核费用</el-button>
+                <el-button type="primary" plain size="small" :disabled="selectionfeedList.length == 0" @click="allClick('D费用申请')"
+                  >请核费用</el-button
+                >
                 <el-button type="danger" plain size="small" :disabled="disabled || selectionfeecList.length == 0" @click="allClick('D撤销请核')"
                   >撤销请核</el-button
                 >
@@ -733,10 +738,15 @@
                 <el-button type="danger" plain size="small" :disabled="selectionfeecList.length == 0" @click="allClick('C费用批量删除')"
                   >批量删除</el-button
                 >
+                <el-button type="primary" plain size="small" :disabled="selectionfeecList.length == 0" @click="allClick('生成应收')"
+                  >生成应收</el-button
+                >
                 <el-button type="primary" plain size="small" :disabled="selectionfeecList.length == 0" @click="allClick('C付费申请')"
                   >付费申请</el-button
                 >
-                <el-button type="primary" plain size="small" :disabled="selectionfeedList.length" @click="allClick('C费用申请')">请核费用</el-button>
+                <el-button type="primary" plain size="small" :disabled="selectionfeecList.length == 0" @click="allClick('C费用申请')"
+                  >请核费用</el-button
+                >
                 <el-button type="danger" plain size="small" :disabled="disabled || selectionfeecList.length == 0" @click="allClick('C撤销请核')"
                   >撤销请核</el-button
                 >
@@ -1209,6 +1219,7 @@ import dicSelect from "@/components/dicSelect/main";
 import checkSchedule from "@/components/checkH/checkSchedule.vue";
 import businessReports from "@/components/boxManagement/businessReports.vue";
 import reports from "@/components/boxManagement/reports.vue";
+import { isProcurement } from "@/api/basicData/configuration";
 import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
 import { getToken } from "@/util/auth";
 import { dateFormat } from "@/util/date";
@@ -1219,6 +1230,7 @@ export default {
   data() {
     return {
       owhyDialog: false,
+      userId: JSON.parse(localStorage.getItem("saber-userInfo")).content.user_id,
       saberUserInfo: JSON.parse(localStorage.getItem("saber-userInfo")).content, // 当前登录人个人信息
       selecPickList: [],
       selecPerList: [],
@@ -3092,6 +3104,7 @@ export default {
             cell: true,
             type: "number",
             controls: false,
+            precision: 0,
             overHidden: true
           },
           {
@@ -3100,6 +3113,7 @@ export default {
             cell: true,
             type: "number",
             controls: false,
+            precision: 0,
             overHidden: true
           },
           {
@@ -3142,7 +3156,8 @@ export default {
       updateFormKey: new Date().getTime(),
       updateStationKey: new Date().getTime(),
       deptId: JSON.parse(localStorage.getItem("sysitemData")).deptId,
-      fixData: true
+      fixData: true,
+      expenseApplication: 0
     };
   },
   components: {
@@ -3173,6 +3188,11 @@ export default {
     if (this.detailData.copyId) {
       this.getCopydate(this.detailData.copyId);
     }
+    isProcurement({ param: "expense.application" }).then(res => {
+      if (res.data.data) {
+        this.expenseApplication = res.data.data;
+      }
+    });
     this.saveLocalCurrency(this.deptId);
   },
   methods: {
@@ -4146,6 +4166,27 @@ export default {
           }
         });
       }
+      if (name == "生成应付") {
+        for (let item of this.selectionfeedList) {
+          let obj = {};
+          obj.pid = this.form.id;
+          obj.feesType = 1;
+          obj.dc = "D";
+          obj.feeId = item.feeId;
+          obj.feeCnName = item.feeCnName;
+          obj.feeCode = item.feeCode;
+          obj.unitNo = item.unitNo;
+          obj.curCode = item.curCode;
+          obj.exrate = item.exrate;
+          obj.quantity = item.quantity;
+          obj.price = item.price;
+          obj.amount = item.amount;
+          obj.amountCNY = item.amountCNY;
+          obj.amountUSD = item.amountUSD;
+          obj.remarks = item.remarks;
+          this.feeCenterListC.push({ $cellEdit: true, ...obj });
+        }
+      }
       if (name == "C费用一键保存") {
         if (!this.feeCenterListC.length) {
           return this.$message.error("请添加数据");
@@ -4228,6 +4269,25 @@ export default {
           }
         });
       }
+      if (name == "生成应收") {
+        for (let item of this.selectionfeecList) {
+          let obj = {};
+          obj.pid = this.form.id;
+          obj.feeId = item.feeId;
+          obj.feeCnName = item.feeCnName;
+          obj.feeCode = item.feeCode;
+          obj.unitNo = item.unitNo;
+          obj.curCode = item.curCode;
+          obj.exrate = item.exrate;
+          obj.quantity = item.quantity;
+          obj.price = item.price;
+          obj.amount = item.amount;
+          obj.amountCNY = item.amountCNY;
+          obj.amountUSD = item.amountUSD;
+          obj.remarks = item.remarks;
+          this.feeCenterListD.push({ $cellEdit: true, ...obj });
+        }
+      }
       if (name == "生成箱使费") {
         let date = null;
         if (this.form.tradingBoxItemsList.length > 0 && this.form.tradingBoxItemsList[0].rentEndDate) {
@@ -4357,6 +4417,15 @@ export default {
             return this.$message.error("已申请费用,不允许重复申请");
           }
         }
+        if (
+          this.form.id &&
+          !(
+            this.selectionfeedList.filter(e => e.createUser == 0 || e.createUser == this.userId).length > 0 ||
+            this.roleName.indexOf("允许修改他人费用") >= 0
+          )
+        ) {
+          return this.$message.error("不允许申请他人费用");
+        }
         this.$confirm("确定申请费用?", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
@@ -4445,6 +4514,15 @@ export default {
             return this.$message.error("已申请费用,不允许重复申请");
           }
         }
+        if (
+          this.form.id &&
+          !(
+            this.selectionfeecList.filter(e => e.createUser == 0 || e.createUser == this.userId).length > 0 ||
+            this.roleName.indexOf("允许修改他人费用") >= 0
+          )
+        ) {
+          return this.$message.error("不允许申请他人费用");
+        }
         this.$confirm("确定申请费用?", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
@@ -4483,7 +4561,7 @@ export default {
           if (row.auditStatus == 0) {
             return this.$message.error("未申请费用,不允许撤销");
           }
-          if (row.auditStatus > 2) {
+          if (row.auditStatus > 2 && this.expenseApplication == 1) {
             return this.$message.error("费用已经审核通过,请使用申请修改和删除功能!");
           }
         }
@@ -4525,7 +4603,7 @@ export default {
           if (row.auditStatus == 0) {
             return this.$message.error("未申请费用,不允许撤销");
           }
-          if (row.auditStatus > 2) {
+          if (row.auditStatus > 2 && this.expenseApplication == 1) {
             return this.$message.error("费用已经审核通过,请使用申请修改和删除功能!");
           }
         }