浏览代码

发票详情跳转修改

wengyuwen 4 年之前
父节点
当前提交
656fc60233

+ 6 - 1
src/api/finance/applyForInvoice/invoiceInformation.js

@@ -7,4 +7,9 @@ export function listCorps(query) {
     params: query
   })
 }
-
+export function listDelete(fId) {
+  return request({
+    url: '/financial/invoiceApplyFor/queryRemove/'+ fId,
+    method: 'delete'
+  })
+}

+ 7 - 3
src/views/finance/applyForInvoice/feeDetail/index.vue

@@ -260,7 +260,7 @@
             size="mini"
             type="text"
             icon="el-icon-delete"
-            @click.native.prevent="deleteRow(scope.$index, invoiceList)"
+            @click.native.prevent="deleteRow(scope.$index, feeList)"
           >删除
           </el-button>
         </template>
@@ -328,7 +328,7 @@
             size="mini"
             type="text"
             icon="el-icon-delete"
-            @click.native.prevent="deleteRow(scope.$index, invoiceList)"
+            @click.native.prevent="deleteRoww(scope.$index, invoiceList)"
           >删除
           </el-button>
         </template>
@@ -783,7 +783,8 @@ export default {
         fSrcid:fSrcid,
         fSrcpid:fSrcpid,
         fCorpid:this.queryParams.fCorpidName,
-        billsType:this.queryParams.fBilltype
+        billsType:this.queryParams.fBilltype,
+        fId:this.queryParams.fId
       }
       this.$router.push({
         path:'/finance/generalLedger',
@@ -996,6 +997,9 @@ export default {
     deleteRow(index, rows) {
       rows.splice(index, 1);
     },
+    deleteRoww(index, rows) {
+      rows.splice(index, 1);
+    },
 
   }
 }

+ 13 - 50
src/views/finance/applyForInvoice/invoiceInformation/index.vue

@@ -316,7 +316,7 @@
 </template>
 
 <script>
-import { listCorps } from "@/api/finance/applyForInvoice/invoiceInformation";
+import { listCorps,listDelete } from "@/api/finance/applyForInvoice/invoiceInformation";
 import { listFees } from "@/api/basicdata/fees";
 import AddOrUpdate from "@/views/viewApproval";
 import ApprovalComments from "@/views/startApproval";
@@ -528,7 +528,7 @@ export default {
     this.getRow();
   },
   activated() {
-
+    this.getList();
   },
   methods: {
 
@@ -766,55 +766,18 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const fIds = row.fId || this.ids;
-      let tips = "";
-      if (Cookies.get("sysType") == 1) {
-        //大木
-        delCharge_s(fIds).then((data) => {
-          switch (data.msg) {
-            case "0": {
-              this.$message.error("当前数据已被其他操作员操作请刷新页面");
-              break;
-            }
-            case "1": {
-              tips = "当前主表有数据从表无数据是否删除";
-              this.delete_S(fIds, tips);
-              break;
-            }
-            case "2": {
-              tips = "当前主表有数据从表有数据是否删除";
-              this.delete_S(fIds, tips);
-              break;
-            }
-            default: {
-              return this.$message.error("未知错误,无状态");
-            }
-          }
-        });
-      } else if (Cookies.get("sysType") == 2) {
-        // 车队;
-        delCharge_ss(fIds).then((data) => {
-          switch (data.msg) {
-            case "0": {
-              this.$message.error("当前数据已被其他操作员操作请刷新页面");
-              break;
-            }
-            case "1": {
-              tips = "当前主表有数据从表无数据是否删除";
-              this.delete_S(fIds, tips);
-              break;
-            }
-            case "2": {
-              tips = "当前主表有数据从表有数据是否删除";
-              this.delete_S(fIds, tips);
-              break;
-            }
-            default: {
-              return this.$message.error("未知错误,无状态");
-            }
-          }
+      this.$confirm( '是否删除此条数据',"警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+      .then(function(){
+        return listDelete(row.fId);
+      })
+        .then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
         });
-      }
     },
     delete_S(fIds, tips) {
       this.$confirm(tips, "警告", {

+ 105 - 44
src/views/finance/generalLedger/index.vue

@@ -471,6 +471,8 @@ import Vue from "vue";
 import Cookies from "js-cookie";
 import { addSet, select } from "@/api/system/set";
 import { getVesselName, listChange } from '@/api/finance/applyForInvoice/feeDetail'
+import { MessageBox } from 'element-ui'
+import store from '@/store'
 Vue.directive("dialogDrag", {
   bind(el, binding, vnode, oldVnode) {
     const dialogHeaderEl = el.querySelector(".el-dialog__header");
@@ -787,30 +789,35 @@ export default {
     // this.getRow();
   },
   activated() {
-    this.doNot = true
-    listCorps().then((response) => {
-      this.fMblnoOptions = response;
-      let data = JSON.parse(this.$route.query.data)
-      this.queryParams.fCorpid = data.fCorpid
-      this.queryParams.fSrcidList = data.fSrcid
-      this.queryParams.fSrcpidList = data.fSrcpid
-      this.queryParams.billsType = data.billsType
-      let list = this.queryParams
-      console.log(this.fMblnoOptions)
-      for (let item in this.fMblnoOptions){
-        console.log(data.fCorpid)
-        if (data.fCorpid == this.fMblnoOptions[item].fName){
-          list.fCorpid = this.fMblnoOptions[item].fId
-          console.log('1111')
-          getcontrastList(list).then(response=>{
-            console.log(response)
-            if(response.rows){
-              this.chargeList = response.rows
-            }
-          })
+    if(this.$route.query.data){
+      listCorps().then((response) => {
+        this.fMblnoOptions = response;
+        let data = JSON.parse(this.$route.query.data)
+        let queryParams = {}
+        this.queryParams.fCorpid = data.fCorpid
+        queryParams.fCorpid = data.fCorpid
+        queryParams.fCorpid = data.fCorpid
+        queryParams.fSrcidList = data.fSrcid
+        queryParams.fSrcpidList = data.fSrcpid
+        queryParams.billsType = data.billsType
+        this.queryParams.fId = data.fId
+        // let list = queryParams
+        for (let item in this.fMblnoOptions){
+          if (data.fCorpid == this.fMblnoOptions[item].fName){
+            this.doNot = true
+            queryParams.fCorpid = this.fMblnoOptions[item].fId
+            this.queryParams.fCorpid = this.fMblnoOptions[item].fId
+            console.log(queryParams.fCorpid)
+            getcontrastList(queryParams).then(response=>{
+              console.log(response)
+              if(response.rows){
+                this.chargeList = response.rows
+              }
+            })
+          }
         }
-      }
-    });
+      });
+    }
   },
   methods: {
     //提交按钮
@@ -828,34 +835,84 @@ export default {
           }
           if(value === 1 ){
             for(let item in this.fMblnoOptions){
-              this.queryParams.fCtrlcorpid = this.fMblnoOptions[item].fName
+              if(this.queryParams.fCtrlcorpid == this.fMblnoOptions[item].fId){
+                this.queryParams.fCtrlcorpid = this.fMblnoOptions[item].fName
+              }
+              console.log(this.fMblnoOptions[item].fName)
+            }
+          }
+          let aug = []
+          let bug = []
+          for (let item in this.selection) {
+            for (let li in this.selection) {
+              if (item != li) {
+                if (this.selection[item].fSrcid == this.selection[li].fSrcid) {
+                  console.log(this.selection[item], this.selection[li])
+                  aug.push({
+                    index: this.selection[item].fSrcid,
+                    id: item,
+                    index2: this.selection[li].fSrcid,
+                    id2: li
+                  })
+                }
+              }
             }
           }
-          this.queryParams.tMblno = this.queryParams.fMblno
-          let formData = new window.FormData();
-          formData.append('tFee',JSON.stringify(this.queryParams))
-          formData.append('tFeeDo',JSON.stringify(this.chargeList))
-          formData.append('billsType',this.queryParams.billsType)
-          formData.append('tFeeInvoice','')
-          addPreservation(formData).then(response=>{
-            this.$message.success("操作成功")
-            if(this.queryParams.billsType == 'ApplyFP'){
-              this.$router.push({path:'/finance/invoiceInformation'})
 
-            }else if(this.queryParams.billsType == 'DZ'){
-              this.$router.push({path:'/finance/contrast'})
+          console.log(aug)
+          let add =''
+          let addold =''
+          for(let li in aug){
+            for(let item in aug)
+            if(aug[item].id == aug[li].id2 && aug[item].id2 == aug[li].id){
+              aug.splice(item, 1);
+            }
+          }
+          if(aug.length != 0){
+            for (let item in aug){
+              addold = parseInt(aug[item].id2)+1
+              add += Number(aug[item].id)+1 +'行、'+ addold + '行/'
+            }
+            MessageBox.confirm("第" + add + "重复,请重新选择",{
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+              }
+            ).then(() => {
+              return
+            })
+          }else {
+            this.queryParams.tMblno = this.queryParams.fMblno
+            for(let item in this.fMblnoOptions){
+              if(this.queryParams.fToCorpid == this.fMblnoOptions[item].fId){
+                this.queryParams.fToCorpid = this.fMblnoOptions[item].fName
+              }
+            }
+            let formData = new window.FormData();
+            formData.append('tFee',JSON.stringify(this.queryParams))
+            formData.append('tFeeDo',JSON.stringify(this.selection))
+            formData.append('billsType',this.queryParams.billsType)
+            formData.append('tFeeInvoice','')
+            addPreservation(formData).then(response=>{
+              this.$message.success("操作成功")
+              if(this.queryParams.billsType == 'ApplyFP'){
+                this.$router.push({path:'/finance/invoiceInformation'})
 
-            }else if(this.queryParams.billsType == 'SF'){
-              this.$router.push({path:'/finance/charge'})
+              }else if(this.queryParams.billsType == 'DZ'){
+                this.$router.push({path:'/finance/contrast'})
 
-            }else if(this.queryParams.billsType == 'FF'){
-              this.$router.push({path:'/finance/payment'})
+              }else if(this.queryParams.billsType == 'SF'){
+                this.$router.push({path:'/finance/charge'})
 
-            }else if(this.queryParams.billsType == 'invoiceFP'){
-              this.$router.push({path:'/finance/controlOverInvoices/invoice'})
+              }else if(this.queryParams.billsType == 'FF'){
+                this.$router.push({path:'/finance/payment'})
 
-            }
-          })
+              }else if(this.queryParams.billsType == 'invoiceFP'){
+                this.$router.push({path:'/finance/controlOverInvoices/invoice'})
+
+              }
+            })
+          }
         }
       })
     },
@@ -1060,7 +1117,11 @@ export default {
     getList() {
       this.loading = true;
       getcontrastList(this.queryParams).then((response) => {
+        if(this.doNot == true){
+          this.chargeList = this.chargeList.concat(response.rows)
+        }else {
           this.chargeList = response.rows;
+        }
           this.total = response.total;
           this.loading = false;
         });