Explorar o código

费用明细完善

qinbai %!s(int64=3) %!d(string=hai) anos
pai
achega
43fbeac27d

+ 5 - 0
src/components/fee-info/config/feeInfo.json

@@ -13,6 +13,11 @@
   "menuWidth": 130,
   "align":"center",
   "showSummary": true,
+  "lazy": true,
+  "simplePage": true,
+  "dialogWidth": "60%",
+  "tree": true,
+  "dialogClickModal": false,
   "column": [
     {
       "label": "结算单位",

+ 79 - 75
src/components/fee-info/main.vue

@@ -33,13 +33,13 @@
             :disabled="disabled || selectionList.length == 0"
             v-if="selectTab === 1"
           >生成账单</el-button>
-          <el-button
+    <!--      <el-button
             type="info"
             size="small"
             @click.stop="rowAdd"
             :disabled="disabled || selectionList.length == 0"
             v-if="selectTab === 1"
-          >查看生成记录</el-button>
+          >查看生成记录</el-button>-->
           <el-button
             type="warning"
             size="small"
@@ -47,13 +47,13 @@
             :disabled="disabled || selectionList.length == 0"
             v-if="selectTab === 2"
           >申请货款</el-button>
-          <el-button
+     <!--     <el-button
             type="info"
             size="small"
             @click.stop="rowAdd"
             :disabled="disabled || selectionList.length == 0"
             v-if="selectTab === 2"
-          >查看申请记录</el-button>
+          >查看申请记录</el-button>-->
         </template>
         <template slot="menu" slot-scope="{ row, index }">
           <el-button
@@ -208,25 +208,6 @@
       </span>
     </el-dialog>
     <crop-dialog ref="cropDialog" @importCorp="importCorp"></crop-dialog>
-    <el-dialog
-      append-to-body
-      title="账单"
-      class="el-dialogDeep"
-      :visible.sync="applyPaymentDialog"
-      width="70%"
-      :close-on-click-modal="false"
-      :destroy-on-close="true"
-      :close-on-press-escape="false"
-      v-dialog-drag
-    >
-      <apply-payment
-        :billType="billType"
-        :billData="billData"
-        :arrList="arrList"
-        @choceFun="choceFun"
-      >
-      </apply-payment>
-    </el-dialog>
   </div>
 </template>
 
@@ -240,6 +221,7 @@ import { isPercentage, micrometerFormat } from "@/util/validate";
 import cropDialog from "@/components/crop-dialog/main";
 import _ from "lodash";
 import ApplyPayment from "../finance/applyPayment";
+import {applyLoan,paymentApply} from "@/api/financialManagement/paymentRequest";
 
 export default {
   name: "feeInfo",
@@ -287,9 +269,6 @@ export default {
       feeData: [],
       selectionList: [],
       reData: null,
-      billData:{
-        optionType:'JK'
-      },
       currencyList: [],
       breakConfiguration:{
         multipleChoices:false,
@@ -301,6 +280,7 @@ export default {
         placeholder:'请点击右边按钮选择',
         dicData:[]
       },
+      isUpdata:true,//是否需要触发监听
       allData:[],
       data_one:[],
       data_two:[],
@@ -308,9 +288,6 @@ export default {
       activeName:"first",
       tab1:true,
       tab2:false,
-      applyPaymentDialog:false,
-      billType:'',
-      arrList:[],
     };
   },
   props: {
@@ -322,6 +299,9 @@ export default {
     },
     feeUrl: {
       type: String
+    },
+    feeCommit:{
+      type: Boolean
     }
   },
   filters: {
@@ -364,8 +344,7 @@ export default {
 
         this.selectTab = 1
         this.feeData = this.data_one  //切换数据
-        this.selectionList = [];
-        this.arrList = [];
+        // this.selectionList = [];
 
       } else if(tab.name == "second") {
         this.tab1 = false;
@@ -375,8 +354,7 @@ export default {
         }
         this.selectTab = 2
         this.feeData = this.data_two
-        this.selectionList = [];
-        this.arrList = [];
+        // this.selectionList = [];
       }
     },
     cellStyle() {
@@ -567,10 +545,17 @@ export default {
       //保存时  将所出的tab页数据赋值到相应 data上
       if(this.selectTab == 1){
         this.data_one = this.feeData
+        this.data_one.map(item =>{
+          delete item.$cellEdit
+          delete  item.$index
+        })
       }else{
         this.data_two = this.feeData
+        this.data_two.map(item =>{
+          delete item.$cellEdit
+          delete  item.$index
+        })
       }
-
       this.allData.push(...this.data_one,...this.data_two)
 
       return this.allData;
@@ -585,52 +570,69 @@ export default {
               return this.$message.error('批量操作结算单位必须一致')
             }
           }
-          this.billType = type
+          this.isUpdata = false
           if(type === '申请'){
-             this.selectionList.map(item =>{
-              delete item.id
-              item.corpsName = item.corpName
-              item.srcFeesId = item.id
-              item.costType = item.itemId
-              item.itemType = '采购'
-              item.optionType = 'JK'
-              item.srcType = 2   //费用明细申请
-              let form = {
-                form:{
-                  ...item,
-                }
+            this.$confirm("您确定申请货款吗?", "提示", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning",
+            }).then(()=>{
+              this.selectionList.map(item =>{
+                item.srcOrderno = params.srcOrderno
+                item.srcParentId = params.parentId
+                item.corpsName = item.corpName
+                item.srcFeesId = item.id
+                item.costType = item.itemId
+                item.itemType = '采购'
+                item.optionType = 'JK'
+                item.srcType = 2   //费用明细申请
+              })
+              let data = {
+                billType: type,
+                itemsList : this.selectionList
               }
-              this.arrList.push(form)
+              applyLoan(data).then(res=>{
+                if(res.data.success){
+                  this.$message.success("操作成功!")
+                }
+              })
+            }).finally(()=>{
+              this.isUpdata = true
             })
           }else{
-            this.selectionList.map(item =>{
-              delete item.id
-              item.corpsName = item.corpName
-              item.srcFeesId = item.id
-              item.costType = item.itemId
-              item.itemType = '采购'
-              item.optionType = 'JK'
-              item.srcType = 2   //费用明细申请
-              let form = {
-                form:{
-                  ...item,
-                }
+            this.$confirm("您确定生成账单吗?", "提示", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning",
+            }).then(()=>{
+              this.selectionList.map(item =>{
+                item.srcOrderno = params.srcOrderno
+                item.srcParentId = params.parentId
+                item.corpsName = item.corpName
+                item.srcFeesId = item.id
+                item.costType = item.itemId
+                item.itemType = '采购'
+                item.optionType = 'JK'
+                item.srcType = 2   //费用明细申请
+              })
+
+              let data = {
+                billType: type,
+                itemsList : this.selectionList
               }
-              this.arrList.push(form)
+
+              paymentApply(data).then(res=>{
+                if(res.data.success){
+                  this.$message.success("操作成功!")
+                }
+              })
+            }).finally(()=>{
+              this.isUpdata = true
             })
           }
-          this.openApplyPayment()
         }
       })
     },
-    //打开账单
-    openApplyPayment(){
-      this.applyPaymentDialog = true;
-    },
-    //关闭账单
-    choceFun(){
-
-    },
     summaryMethod({ columns, data }) {
       const sums = [];
       if (columns.length > 0) {
@@ -674,13 +676,15 @@ export default {
       if(this.allData.length !=0){
         this.data_one=this.allData.filter(item=>item.feesType === 1)  //应收
         this.data_two=this.allData.filter(item=>item.feesType === 2)  //应付
-
-        if( this.feeData.length != 0){
-          this.feeData = this.data_one
+        if(this.isUpdata){
+          if(this.selectTab == 1){
+            this.feeData = this.data_one
+          }else{
+            this.feeData = this.data_two
+          }
         }
-
       }
-    }
+    },
   }
 };
 </script>

+ 17 - 16
src/components/finance/applyPayment.vue

@@ -361,24 +361,25 @@ export default {
                 if(res.data.success){
                   this.$message.success("操作成功!")
                   this.$emit("choceFun");
-                  //跳转付款申请页面
-                  if(this.$store.getters.pqStatus){
-                    this.$alert("无法自动跳转到付款申请页面,因为页面已存在。", "温馨提示", {
-                      confirmButtonText: "确定",
-                      type: 'warning',
-                      callback: action => {
-                      }
-                    });
-                  }else{
-                    //关闭一下存在的列表页  跳转
-                    this.$router.$avueRouter.closeTag('/financialManagement/paymentRequest/paymentRequest');
-                    this.$router.push({
-                      path: "/financialManagement/paymentRequest/paymentRequest",
-                      query: {params: res.data.data.id},
-                    });
-                  }
                 }
               })
+              //跳转付款申请页面
+              //不在跳转
+              // if(this.$store.getters.pqStatus){
+              //   this.$alert("无法自动跳转到付款申请页面,因为页面已存在。", "温馨提示", {
+              //     confirmButtonText: "确定",
+              //     type: 'warning',
+              //     callback: action => {
+              //     }
+              //   });
+              // }else{
+              //   //关闭一下存在的列表页  跳转
+              //   this.$router.$avueRouter.closeTag('/financialManagement/paymentRequest/paymentRequest');
+              //   this.$router.push({
+              //     path: "/financialManagement/paymentRequest/paymentRequest",
+              //     query: {params: res.data.data.id},
+              //   });
+              // }
             }
             //采购退款结算 销售收款结算  不需申请请核 直接结算  => 结算
             if(this.billType === "收费"){

+ 1 - 0
src/util/contrastData.js

@@ -27,6 +27,7 @@ export function contrastList(newlist, oldlist) {
         if (newitem == olditem) {
           if(!(newlist[i][newitem] instanceof Array)){
             if (newlist[i][newitem] != oldlist[i][olditem]) {
+              console.log(newitem,i,newlist[i][newitem],oldlist[i][olditem])
               return true
             }
           }

+ 2 - 1
src/views/purchase/contract/detailsPage.vue

@@ -832,6 +832,7 @@ export default {
       }else{
         params.valid = true
         params.parentId = this.form.id
+        params.srcOrderno = this.form.orderNo
         callback(params)
       }
     },
@@ -840,7 +841,6 @@ export default {
       this.$refs["form"].validate((valid) => {
         if (valid) {
           let orderFeesList = this.$refs.feeInfo.submitData();
-          console.log(orderFeesList)
           for (let i = 0; i < orderFeesList.length; i++) {
             if (orderFeesList[i].corpId === (null || "")) {
               return this.$message.error(`请输入费用明细第${i + 1}行的结算中心`);
@@ -1022,6 +1022,7 @@ export default {
         currency:this.form.currency,
         exchangeRate:this.form.exchangeRate,
         srcParentId:this.form.id,
+        srcType:1
       }
       if(bool){ //申请货款
         this.billData.srcId = -1