lichao vor 3 Jahren
Ursprung
Commit
08a53d7cec

+ 1 - 1
src/views/businessManagement/deliveryNotice/configuration/advantageProject.json

@@ -16,7 +16,7 @@
   "index": false,
   "refreshBtn": false,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "showSummary": true,
   "sumText": "合计",

+ 1 - 1
src/views/businessManagement/deliveryNotice/configuration/bankOfDeposit.json

@@ -11,7 +11,7 @@
   "border": true,
   "index": true,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "addBtn":false,
   "editBtn":false,

+ 1 - 1
src/views/businessManagement/deliveryNotice/configuration/customerContact.json

@@ -16,7 +16,7 @@
   "border": true,
   "index": false,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "showSummary": true,
   "summaryText": "合计",

+ 1 - 1
src/views/businessManagement/purchaseOrder/configuration/advantageProject.json

@@ -16,7 +16,7 @@
   "index": false,
   "refreshBtn": false,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "showSummary": true,
   "sumText": "合计",

+ 1 - 1
src/views/businessManagement/purchaseOrder/configuration/bankOfDeposit.json

@@ -11,7 +11,7 @@
   "border": true,
   "index": true,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "addBtn":false,
   "editBtn":false,

+ 1 - 1
src/views/businessManagement/purchaseOrder/configuration/customerContact.json

@@ -16,7 +16,7 @@
   "border": true,
   "index": false,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "showSummary": true,
   "summaryText": "合计",

+ 8 - 4
src/views/businessManagement/purchaseOrder/detailsPageEdit.vue

@@ -603,7 +603,7 @@ export default {
               }
             ]
           }, {
-            label: '运费',
+            label: '预估运费',
             prop: 'oceanFreight',
             type: 'number',
             rules: [
@@ -626,7 +626,8 @@ export default {
             ]
           }, {
             label: '已付金额',
-            prop: 'a',
+            prop: 'settlmentAmount',
+            type: 'number',
             rules: [
               {
                 required: false,
@@ -1232,7 +1233,6 @@ export default {
     },
     //修改提交触发
     editCustomer(isBack = false) {
-      console.log(this.form)
       this.$refs["form"].validate((valid) => {
         if (valid) {
           for (let item in this.contactsData) {
@@ -1247,6 +1247,7 @@ export default {
           if (typeof this.form.corpsTypeId == 'object') {
             this.form.corpsTypeId = this.form.corpsTypeId.join(",")
           }
+
           this.saveLoading = true
           this.form.billType = 'CG'
           this.$set(this.form, 'tradeType', 'GN')
@@ -1273,11 +1274,14 @@ export default {
         corpsName:this.form.corpsName,
         corpId:this.form.corpId,
         srcParentId: this.form.id,
+        currency: 'CNY',
+        exchangeRate: '1',
+        taxRate: '0',
+        accDate: this.form.businesDate,
       }
       if(type){ //申请货款
         this.billData.srcId = -1
       }
-      console.log(this.billData )
     },
     //申请货款
     applyPayment(){

+ 78 - 2
src/views/businessManagement/purchaseOrder/index.vue

@@ -21,8 +21,9 @@
                  @tree-load="treeLoad"
                  @saveColumn="saveColumn">
         <template slot="menuLeft" slot-scope="{size}">
-          <el-button type="success" :size="size" @click="copyOrder" :disabled="single">复制新单</el-button>
+          <el-button type="success" :size="size" icon="el-icon-copy-document" @click="copyOrder" :disabled="single">复制新单</el-button>
           <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
+          <el-button type="warning" :size="size" icon="el-icon-thumb" :disabled="multiple" @click="applyPayment">申请货款</el-button>
         </template>
         <template slot-scope="scope" slot="orgOrderNo">
           <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.orgOrderNo }}</span>
@@ -71,6 +72,27 @@
       :detailData="detailData"
       v-else
     ></detail-page>
+
+    <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
+        v-if="applyPaymentDialog"
+        :billType="billType"
+        :billData="billData"
+        :arrList="applyPaymentList"
+        @choceFun="choceFun"
+      >
+      </apply-payment>
+    </el-dialog>
   </div>
 </template>
 
@@ -79,6 +101,7 @@ import option from "./configuration/mainList.json";
 import {customerList, deleteDetails} from "@/api/basicData/purchaseOrder"
 import detailPage from "./detailsPageEdit";
 import { defaultDate } from "@/util/date";
+import ApplyPayment from "@/components/finance/applyPayment";
 
 export default {
   name: "customerInformation",
@@ -88,7 +111,8 @@ export default {
     }
   },
   components: {
-    detailPage
+    detailPage,
+    ApplyPayment,
   },
   data() {
     return {
@@ -119,6 +143,10 @@ export default {
       selection: [],
       isShow: true,
       detailData: {},
+      billType:"申请",  //账单类型
+      billData:{},     //账单需要数据
+      applyPaymentDialog:false,//生成账单组件
+      applyPaymentList: [],
     }
   },
   async created() {
@@ -257,8 +285,11 @@ export default {
       console.log('1')
     },
     selectionChange(list) {
+      console.log(list)
+      this.selection = []
       this.selection = list;
       this.single = list.length !== 1;
+      this.multiple = list.length == 0
     },
     currentChange() {
       console.log('1')
@@ -300,6 +331,10 @@ export default {
       });
     },
     goBack() {
+      this.selection = []
+      this.applyPaymentList = []
+      this.single = true
+      this.multiple = true
       this.detailData=this.$options.data().detailData
       this.isShow = true;
     },
@@ -320,6 +355,47 @@ export default {
         this.$refs.crud.$refs.dialogColumn.columnBox = false;
       }
     },
+    // 申请货款
+    applyPayment() {
+      this.applyPaymentList = []
+      if (this.selection.length > 1) {
+        for (let item in this.selection) {
+          if (this.selection[0].corpId !== this.selection[item].corpId) {
+            return this.$message.error('批量结算供应商必须一致')
+          }
+        }
+      }
+      let a = []
+      console.log(this.selection)
+      this.selection.forEach(item => {
+        let form = {
+          form: {
+            srcOrderno:item.orderNo,
+            itemType:"采购",
+            corpsName:item.strCorpName,
+            corpId:item.corpId,
+            srcParentId: item.id,
+            currency: 'CNY',
+            exchangeRate: '1',
+            taxRate: '0',
+            accDate: item.businesDate,
+          }
+        }
+        a.push(form)
+      })
+      this.applyPaymentList = [...a]
+      // this.beforeBillData(true);
+      this.applyPaymentDialog = true;
+    },
+    beforeBillData(type) {
+      if(type){ //申请货款
+        // this.billData.srcId = -1
+      }
+    },
+    //关闭账单
+    choceFun(){
+      this.applyPaymentDialog  = false
+    },
   }
 }
 </script>

+ 1 - 1
src/views/businessManagement/receipt/configuration/advantageProject.json

@@ -16,7 +16,7 @@
   "index": false,
   "refreshBtn": false,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "showSummary": true,
   "sumText": "合计",

+ 1 - 1
src/views/businessManagement/receipt/configuration/bankOfDeposit.json

@@ -11,7 +11,7 @@
   "border": true,
   "index": true,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "addBtn":false,
   "editBtn":false,

+ 1 - 1
src/views/businessManagement/receipt/configuration/customerContact.json

@@ -16,7 +16,7 @@
   "border": true,
   "index": false,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "showSummary": true,
   "summaryText": "合计",

+ 1 - 1
src/views/businessManagement/salesOrder/configuration/advantageProject.json

@@ -16,7 +16,7 @@
   "index": false,
   "refreshBtn": false,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "showSummary": true,
   "sumText": "合计",

+ 1 - 1
src/views/businessManagement/salesOrder/configuration/bankOfDeposit.json

@@ -11,7 +11,7 @@
   "border": true,
   "index": true,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "addBtn":false,
   "editBtn":false,

+ 1 - 1
src/views/businessManagement/salesOrder/configuration/customerContact.json

@@ -16,7 +16,7 @@
   "border": true,
   "index": false,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "showSummary": true,
   "summaryText": "合计",

+ 13 - 16
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -1111,7 +1111,7 @@ export default {
             prop: 'packageRemarks',
             rules: [
               {
-                required: true,
+                required: false,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -1601,6 +1601,10 @@ export default {
         corpsName:this.form.corpName,
         corpId:this.form.corpId,
         srcParentId: this.form.id,
+        currency: 'CNY',
+        exchangeRate: '1',
+        taxRate: '0',
+        accDate: this.form.businesDate,
       }
       if(type){ //申请货款
         this.billData.srcId = -1
@@ -2081,8 +2085,15 @@ export default {
               return this.$message.error('商品信息第'+ (parseInt(item) + 1) + '行订货数量不能小于发货数量')
             }
           }
+          let packFee;
+          if (this.form.packageRemarks) {
+            packFee = this.advantageProjectData.findIndex(item => item.feeName == '包装费')
+          }
+          console.log(packFee)
+          if (packFee == -1) {
+            return this.$message.error('费用明细未有包装费')
+          }
           // 计算毛利额
-          // this.$set(this.form, 'grossProfit', 0)
           this.$set(this.form, 'orderAmount', 0)
           // 成本价
           let purchaseAmount = 0
@@ -2091,25 +2102,11 @@ export default {
             if (item.purchaseAmount) {
               purchaseAmount += (Number(item.purchaseAmount) * Number(item.orderQuantity)).toFixed(2)
             }
-            // this.form.grossProfit += Number(item.amount)
             this.form.orderAmount = (Number(this.form.orderAmount) + Number(item.amount)).toFixed(2)
           })
-          // this.form.grossProfit = (Number(this.form.orderAmount) - Number(purchaseAmount)).toFixed(2)
-          // if (this.form.orderAmount && this.form.overPayment) {
-          //   this.form.debitAmount = Number(this.form.orderAmount) - Number(this.form.overPayment)
-          // }
           if (this.form.orderAmount && this.form.settlmentAmount) {
             this.$set(this.form, "balanceAmount", (Number(this.form.orderAmount) - Number(this.form.settlmentAmount)).toFixed(2));
           }
-          // 计算毛利率
-          // if (this.form.orderAmount) {
-          //   this.form.grossProfitRate = ((Number(this.form.grossProfit) / Number(this.form.orderAmount)) * 100).toFixed(2)
-          // }
-          // 计算应收账款
-          // this.$set(this.form, 'debitAmount', 0)
-          // this.contactsData.forEach(item => {
-          //   this.form.debitAmount += Number(item.amount)
-          // })
           //商品信息
           this.form.orderItemsList = this.contactsData
           this.form.orderFeesList = this.advantageProjectData