qinbai 3 years ago
parent
commit
fba4bc1c2d

+ 14 - 13
src/components/finance/applyPayment.vue

@@ -109,7 +109,7 @@
             menuSpan: 8,
             column: [
               {
-                label: '合同号',
+                label: '订单号',
                 prop: 'srcOrderno',
                 span: 8,
                 disabled:true,
@@ -133,18 +133,18 @@
                   }
                 ]
               },
-              {
-                label: '提单号',
-                prop: 'billNo',
-                span: 8,
-                rules: [
-                  {
-                    required: true,
-                    message: ' ',
-                    trigger: 'blur'
-                  }
-                ]
-              },
+              // {
+              //   label: '提单号',
+              //   prop: 'billNo',
+              //   span: 8,
+              //   rules: [
+              //     {
+              //       required: true,
+              //       message: ' ',
+              //       trigger: 'blur'
+              //     }
+              //   ]
+              // },
               {
                 label: '费用名称',
                 prop: 'costType',
@@ -334,6 +334,7 @@
           if (result.some(item => item)) {
             const itemsList =  this.list.map(item =>{ item.form.corpId = this.corpId; return item.form})
             const params = {
+              billNo:"0000001",
               billType : this.billType,
               itemsList: itemsList
             }

+ 76 - 2
src/views/businessManagement/purchaseOrder/detailsPageEdit.vue

@@ -11,7 +11,17 @@
         <el-button
           size="small"
           class="el-button--small-yh"
-          type="success" style="right: 140px;" @click="copyOrder"
+          :disabled="detailData.seeDisabled || !this.form.id"
+          type="warning" style="right: 140px;"
+          @click="applyPayment"
+        >
+          申请货款
+        </el-button>
+        <el-button
+          size="small"
+          class="el-button--small-yh"
+          type="success" style="right: 140px;"
+          @click="copyOrder"
           :disabled="detailData.seeDisabled || !this.form.id"
         >
           复制新单
@@ -346,6 +356,25 @@
                      :disabled="tableDataCost.length !== 1">导入</el-button>
         </span>
     </el-dialog>
+
+    <el-dialog
+      title="账单"
+      append-to-body
+      class="el-dialogDeep"
+      :visible.sync="applyPaymentDialog"
+      width="60%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      v-dialog-drag
+    >
+      <apply-payment
+        :billType="billType"
+        :billData="billData"
+        @choceFun="choceFun"
+      >
+      </apply-payment>
+    </el-dialog>
   </div>
 </template>
 
@@ -369,6 +398,8 @@ import optionTwoCost from "./configuration/mainListCost.json"
 import {getDeptLazyTree, customerList} from "@/api/basicData/basicFeesDesc";
 import {selectGoodsNum} from "@/api/basicData/inventoryAccount"
 import { contrastObj, contrastList } from "@/util/contrastData";
+//账单组件
+import ApplyPayment from "../../../components/finance/applyPayment";
 
 export default {
   name: "detailsPage",
@@ -380,6 +411,9 @@ export default {
       }
     }
   },
+  components:{
+    ApplyPayment
+  },
   data() {
     return {
       configuration: {
@@ -471,6 +505,9 @@ export default {
           children: 'children'
         }
       },
+      billType:"申请",  //账单类型
+      billData:{},     //账单需要数据
+      applyPaymentDialog:false,//生成账单组件
       dialogVisible: false,
       advantageProjectForm: {},
       bankOfDepositForm: {},
@@ -685,7 +722,7 @@ export default {
         delete this.form.itemsVOList
         delete this.form.orderFeesList
         delete this.form.orderFilesList
-        delete this.form.corpsName
+        // delete this.form.corpsName
         // 获取最大值
         let num = []
         this.advantageProjectData.forEach(item => {
@@ -1211,6 +1248,43 @@ export default {
         }
       });
     },
+    beforeBillData(type){
+      //采购明细提单号 list
+      this.billData = {
+        srcOrderno:this.form.srcOrderNo,
+        itemType:"采购",
+        corpsName:this.form.corpsName,
+        corpId:this.form.corpId,
+      }
+      if(type){ //申请货款
+        this.billData.srcId = -1
+      }
+      console.log(this.billData )
+    },
+    //申请货款
+    applyPayment(){
+      // if (contrastObj(this.form, this.oldForm) ||
+      //   contrastList(this.contactsData, this.oldGoodsList) ||
+      //   contrastList(this.advantageProjectData, this.oldFeesList) ||
+      //   contrastList(this.bankOfDepositData, this.oldUploadList)
+      // ) {
+      //   this.$confirm("您已改动数据,是否先保存在进行操作!", {
+      //     confirmButtonText: "保存",
+      //     cancelButtonText: "取消",
+      //     type: "warning"
+      //   }).then(() => {
+      //     this.editCustomer();
+      //   })
+      // }else{
+        this.beforeBillData(true);
+        this.applyPaymentDialog = true;
+      // }
+
+    },
+    //关闭账单
+    choceFun(){
+      this.applyPaymentDialog  = false
+    },
     //返回列表
     backToList() {
       if (contrastObj(this.form, this.oldForm) ||

+ 51 - 4
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -10,11 +10,11 @@
       <div class="add-customer-btn">
         <el-button
           class="el-button--small-yh"
-          type="primary"
+          type="warning"
           :disabled="detailData.seeDisabled"
           size="small"
           @click="applySettlement"
-        >申请结算</el-button>
+        >生成账单</el-button>
         <el-button
           class="el-button--small-yh"
           type="primary"
@@ -466,6 +466,24 @@
         </span>
     </el-dialog>
 
+    <el-dialog
+      title="账单"
+      append-to-body
+      class="el-dialogDeep"
+      :visible.sync="applySettlementDialog"
+      width="60%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      v-dialog-drag
+    >
+      <apply-payment
+        :billType="billType"
+        :billData="billData"
+        @choceFun="choceFun"
+      >
+      </apply-payment>
+    </el-dialog>
   </div>
 </template>
 
@@ -501,6 +519,8 @@ import _ from "lodash";
 import option from "./configuration/mainList.json";
 import { contrastObj, contrastList } from "@/util/contrastData";
 import { getMarketPrice, getPurchasePrice } from "@/api/basicData/fees"
+//账单组件
+import ApplyPayment from "../../../components/finance/applyPayment";
 
 export default {
   name: "detailsPage",
@@ -509,11 +529,17 @@ export default {
       type: Object
     }
   },
+  components:{
+    ApplyPayment
+  },
   data() {
     return {
       saveLoading: false,
       disabled: false,
       form: {},
+      billType:"销售",  //账单类型
+      billData:{},     //账单需要数据
+      applySettlementDialog:false,//生成账单组件
       configuration: {
         multipleChoices: false,
         multiple: false,
@@ -1139,7 +1165,7 @@ export default {
         delete this.form.orderItemsList
         delete this.form.orderFeesList
         delete this.form.orderFilesList
-        delete this.form.corpName
+        // delete this.form.corpName
         delete this.form.belongToCorpList
         // 获取最大值
         let num = []
@@ -1343,7 +1369,28 @@ export default {
           this.editCustomer(true)
         }).catch(() => {
         })
-      } else {}
+      } else {
+        this.beforeBillData(true)
+        this.applySettlementDialog = true;
+      }
+    },
+    //生成账单 拿到主表信息
+    beforeBillData(type){
+      this.billData = {
+        srcOrderno:this.form.orgOrderNo,
+        itemType:"销售",
+        corpsName:this.form.corpName,
+        corpId:this.form.corpId,
+      }
+      console.log(this.form)
+      console.log(this.billData )
+      if(type){ //申请货款
+        this.billData.srcId = -1
+      }
+    },
+    //关闭账单
+    choceFun(){
+      this.applySettlementDialog  = false
     },
     //商品选中触发
     productSelection(selection) {

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

@@ -39,6 +39,7 @@
         </el-button>
       </div>
     </div>
+    </div>
     <div class="customer-main">
       <el-form :model="form" ref="form" label-width="130px">
         <containerTitle title="基础信息"></containerTitle>
@@ -297,7 +298,6 @@
       </apply-payment>
     </el-dialog>
   </div>
-  </div>
 </template>
 
 <script>