Browse Source

修改bug

Qukatie 3 years ago
parent
commit
4e4fe4fe28

+ 7 - 0
src/api/basicData/shippingInquiry.js

@@ -108,4 +108,11 @@ export function gainUser(query) {
     method: 'get',
     params: query
   })
+}
+export const calculationDomesticFees = (data) => {
+  return request({
+    url: '/api/blade-purchase-sales/exportEnquiry/calculationDomesticFees',
+    method: 'post',
+    data: data
+  })
 }

+ 4 - 4
src/enums/column-name.js

@@ -876,10 +876,10 @@ const columnName = [{
   name: '客户(Y)-列表页'
 }, {
   code: 208,
-  name: '客户(Y)-明细表'
+  name: '客户-客户地址'
 }, {
   code: 208.4,
-  name: '客户(Y)-明细表2'
+  name: '客户-物流地址'
 }, {
   code: 208.1,
   name: '客户(Y)-销售记录'
@@ -888,10 +888,10 @@ const columnName = [{
   name: '供应商(Y)-列表页'
 }, {
   code: 210,
-  name: '供应商(Y)-明细表'
+  name: '供应商-供应商地址'
 }, {
   code: 210.4,
-  name: '供应商(Y)-明细表2'
+  name: '供应商-物流地址'
 }, {
   code: 210.1,
   name: '供应商(Y)-采购记录'

+ 9 - 0
src/util/calculate.js

@@ -35,6 +35,15 @@ export function sum(num, num2) {
   const sum = _.add(val, val2)
   return Number(sum).toFixed(2)
 }
+//金额相除
+export function divide(num, num2,num3) {
+  //最新价格
+  const val = Number(num ? num : 0)
+  const val2 = Number(num2 ? num2 : 0)
+  const val3 = Number(num3 ? num3 : 2)
+  const divide = _.divide(val, val2)
+  return Number(divide).toFixed(val3)
+}
 //金额相乘
 export function multiply(num, num2,num3) {
   //最新价格

+ 8 - 11
src/views/client/detailsPage.vue

@@ -199,14 +199,10 @@ export default {
     }
   },
   async created() {
-    this.option2 = await this.getColumnData(
-      this.getColumnName(208),
-      option2
-    );
-    this.option3 = await this.getColumnData(
-      this.getColumnName(208.4),
-      option3
-    );
+    console.log(await this.getColumnData(this.getColumnName(208), option2))
+    this.option2 = await this.getColumnData(this.getColumnName(208), option2);
+    console.log(this.option2)
+    this.option3 = await this.getColumnData(this.getColumnName(208.4), option3);
     if (this.detailData.id) {
       this.getDetail(this.detailData.id);
     }
@@ -221,9 +217,10 @@ export default {
       customerList({ corpType: "KH" }).then(res => {
         this.findObject(this.option4.column, "parentId").dicData = res.data.data.records
       });
-      this.getWorkDicts("abbreviation").then(res => {
-        this.findObject(this.option2.column, "abbreviation").dicData = res.data.data;
-      });
+      // this.getWorkDicts("abbreviation").then(res => {
+      //   this.findObject(this.option2.column, "abbreviation").dicData = res.data.data;
+      // });
+      this.$refs.crud.init();
     },
     cellStyle() {
       return "padding:0;height:40px;";

+ 1 - 1
src/views/client/js/optionList.js

@@ -149,7 +149,7 @@ export const option2 = {
       type: "select",
       props: {
         label: "dictValue",
-        value: "dictKey"
+        value: "dictValue"
       },
       // dicUrl: "/api/blade-system/dict-biz/dictionary?code=abbreviation",
       dicData:[],

+ 79 - 56
src/views/exportTrade/customerInquiry/components/goodsInfo.vue

@@ -31,7 +31,7 @@
                     :disabled="detailData.status == 1" circle></el-button>
             </template>
             <template slot="codeHeader" slot-scope="{column}">
-                <span style="color: #409EFF;cursor: pointer" @click.stop="khEdit('cname')">{{column.label}}</span>
+                <span style="color: #409EFF;cursor: pointer" @click.stop="khEdit('cname')">{{ column.label }}</span>
             </template>
             //操作栏
             <template slot="menu" slot-scope="{ row, index }">
@@ -111,10 +111,10 @@
             <template slot="partsValveNameForm" slot-scope="{type,disabled}">
                 <div style="display:flex;">
                     <el-input v-model="goodsForm.partsValveName" size="small" placeholder="" :disabled="disabled">
-                        <template
-                            slot="append">{{goodsForm.partsValveSalePrice?goodsForm.partsValveSalePrice:0}}</template>
+                        <template slot="append">{{ goodsForm.partsValveSalePrice ? goodsForm.partsValveSalePrice : 0
+                        }}</template>
                     </el-input>
-                    <el-button icon="el-icon-edit" size="mini" @click="openpart(0,goodsForm.partsValveValue)"
+                    <el-button icon="el-icon-edit" size="mini" @click="openpart(0, goodsForm.partsValveValue)"
                         :disabled="disabled"></el-button>
                 </div>
             </template>
@@ -122,9 +122,10 @@
             <template slot="partsCapNameForm" slot-scope="{type,disabled}">
                 <div style="display:flex;">
                     <el-input v-model="goodsForm.partsCapName" size="small" placeholder="" :disabled="disabled">
-                        <template slot="append">{{goodsForm.partsCapSalePrice?goodsForm.partsCapSalePrice:0}}</template>
+                        <template slot="append">{{ goodsForm.partsCapSalePrice ? goodsForm.partsCapSalePrice : 0
+                        }}</template>
                     </el-input>
-                    <el-button icon="el-icon-edit" size="mini" @click="openpart(1,goodsForm.partsCapValue)"
+                    <el-button icon="el-icon-edit" size="mini" @click="openpart(1, goodsForm.partsCapValue)"
                         :disabled="disabled"></el-button>
                 </div>
             </template>
@@ -132,10 +133,10 @@
             <template slot="partsHandleNameForm" slot-scope="{type,disabled}">
                 <div style="display:flex;">
                     <el-input v-model="goodsForm.partsHandleName" size="small" placeholder="" :disabled="disabled">
-                        <template
-                            slot="append">{{goodsForm.partsHandleSalePrice?goodsForm.partsHandleSalePrice:0}}</template>
+                        <template slot="append">{{ goodsForm.partsHandleSalePrice ? goodsForm.partsHandleSalePrice : 0
+                        }}</template>
                     </el-input>
-                    <el-button icon="el-icon-edit" size="mini" @click="openpart(2,goodsForm.partsHandleValue)"
+                    <el-button icon="el-icon-edit" size="mini" @click="openpart(2, goodsForm.partsHandleValue)"
                         :disabled="disabled"></el-button>
                 </div>
             </template>
@@ -143,10 +144,10 @@
             <template slot="partsColourNameForm" slot-scope="{type,disabled}">
                 <div style="display:flex;">
                     <el-input v-model="goodsForm.partsColourName" size="small" placeholder="" :disabled="disabled">
-                        <template
-                            slot="append">{{goodsForm.partsColourSalePrice?goodsForm.partsColourSalePrice:0}}</template>
+                        <template slot="append">{{ goodsForm.partsColourSalePrice ? goodsForm.partsColourSalePrice : 0
+                        }}</template>
                     </el-input>
-                    <el-button icon="el-icon-edit" size="mini" @click="openpart(3,goodsForm.partsColourValue)"
+                    <el-button icon="el-icon-edit" size="mini" @click="openpart(3, goodsForm.partsColourValue)"
                         :disabled="disabled"></el-button>
                 </div>
             </template>
@@ -154,10 +155,10 @@
             <template slot="partsModeNameForm" slot-scope="{type,disabled}">
                 <div style="display:flex;">
                     <el-input v-model="goodsForm.partsModeName" size="small" placeholder="" :disabled="disabled">
-                        <template
-                            slot="append">{{goodsForm.partsModeSalePrice?goodsForm.partsModeSalePrice:0}}</template>
+                        <template slot="append">{{ goodsForm.partsModeSalePrice ? goodsForm.partsModeSalePrice : 0
+                        }}</template>
                     </el-input>
-                    <el-button icon="el-icon-edit" size="mini" @click="openpart(4,goodsForm.partsModeValue)"
+                    <el-button icon="el-icon-edit" size="mini" @click="openpart(4, goodsForm.partsModeValue)"
                         :disabled="disabled"></el-button>
                 </div>
             </template>
@@ -166,10 +167,11 @@
                 <div style="display:flex;">
                     <el-input v-model="goodsForm.partsAuthenticationName" size="small" placeholder=""
                         :disabled="disabled">
-                        <template
-                            slot="append">{{goodsForm.partsAuthenticationSalePrice?goodsForm.partsAuthenticationSalePrice:0}}</template>
+                        <template slot="append">{{ goodsForm.partsAuthenticationSalePrice ?
+                                goodsForm.partsAuthenticationSalePrice : 0
+                        }}</template>
                     </el-input>
-                    <el-button icon="el-icon-edit" size="mini" @click="openpart(5,goodsForm.partsAuthenticationValue)"
+                    <el-button icon="el-icon-edit" size="mini" @click="openpart(5, goodsForm.partsAuthenticationValue)"
                         :disabled="disabled">
                     </el-button>
                 </div>
@@ -178,10 +180,10 @@
             <template slot="partsOtherNameForm" slot-scope="{type,disabled}">
                 <div style="display:flex;">
                     <el-input v-model="goodsForm.partsOtherName" size="small" placeholder="" :disabled="disabled">
-                        <template
-                            slot="append">{{goodsForm.partsOtherSalePrice?goodsForm.partsOtherSalePrice:0}}</template>
+                        <template slot="append">{{ goodsForm.partsOtherSalePrice ? goodsForm.partsOtherSalePrice : 0
+                        }}</template>
                     </el-input>
-                    <el-button icon="el-icon-edit" size="mini" @click="openpart(6,goodsForm.partsOtherValue)"
+                    <el-button icon="el-icon-edit" size="mini" @click="openpart(6, goodsForm.partsOtherValue)"
                         :disabled="disabled"></el-button>
                 </div>
             </template>
@@ -320,7 +322,8 @@ import {
     amountCal,
     grossProfitCal,
     costCal,
-    addPrice
+    addPrice,
+    divide
 } from "@/util/calculate";
 import _ from "lodash";
 export default {
@@ -777,35 +780,31 @@ export default {
                 e.sort = Number(index) + 1
                 this.form.totalValue = sum(multiply(e.outFactoryPrice, e.orderQuantity), this.form.totalValue)
             })
-            this.calculateLoading = true
-            calculationDomesticFees({ ...this.form, domesticAbroad: val, orderItemsList: this.data, }).then(res => {
-                this.$confirm("总运费:" + res.data.data.amount + ",单价分摊运费:" + res.data.data.amountF + ",是否继续更新?", {
+            if (val == 1) {
+                let numSum = 0
+                this.orderFeesList.forEach(e => {
+                    if (e.feesType == 2 && e.currency == "CNY") {
+                        console.log(sum, e.amount)
+                        numSum = sum(numSum, e.amount)
+                    }
+                })
+                let num = 0;
+                num = divide(divide(numSum, this.form.totalValue,10), this.form.exchangeRate,10)
+                this.$confirm("总运费:" + divide(numSum, this.form.exchangeRate) + ",单价分摊运费:" + num + ",是否继续更新?", {
                     confirmButtonText: "确定",
                     cancelButtonText: "取消",
                     type: "warning"
                 }).then(() => {
                     this.data.forEach(e => {
-                        if (val == 1) {
-                            e.shareAmount = multiply(res.data.data.amountF, e.outFactoryPrice, 10)
-                            e.price = addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.internationalAmount)
-                            e.amount = amountCal(
-                                addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.internationalAmount),
-                                e.orderQuantity,
-                                e.freight,
-                                e.insurance,
-                                e.discount
-                            );
-                        } else {
-                            e.internationalAmount = multiply(res.data.data.amountF, e.outFactoryPrice, 10)
-                            e.price = addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.shareAmount)
-                            e.amount = amountCal(
-                                addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.shareAmount),
-                                e.orderQuantity,
-                                e.freight,
-                                e.insurance,
-                                e.discount
-                            );
-                        }
+                        e.shareAmount = multiply(num, e.outFactoryPrice, 10)
+                        e.price = addPrice(e.outFactoryPrice, multiply(num, e.outFactoryPrice, 10), e.internationalAmount)
+                        e.amount = amountCal(
+                            addPrice(e.outFactoryPrice, multiply(num, e.outFactoryPrice, 10), e.internationalAmount),
+                            e.orderQuantity,
+                            e.freight,
+                            e.insurance,
+                            e.discount
+                        );
                         e.itemMargin = grossProfitCal(
                             e.purchaseAmount,
                             e.partsPrice,
@@ -813,17 +812,41 @@ export default {
                             this.form.exchangeRate
                         );
                     })
-                    let arr = []
-                    res.data.data.fees.forEach(e => {
-                        // this.orderFeesList.push({ feesType: 2, ...e, corpId: this.form.corpId, corpName: this.form.corpsName, amount: multiply(e.price, e.quantity) })
-                        arr.push({ feesType: 2, ...e, corpId: this.form.corpId, corpName: this.form.corpsName, amount: multiply(e.price, e.quantity), srcType: val == 1 ? '国内费用' : '国外费用' })
+                })
+
+            } else {
+                let numSum = 0
+                this.orderFeesList.forEach(e => {
+                    if (e.feesType == 2 && e.currency == "USD") {
+                        numSum = sum(numSum, e.amount)
+                    }
+                })
+                let num = 0;
+                num = divide(numSum, this.form.totalValue,10)
+                this.$confirm("总运费:" + numSum + ",单价分摊运费:" + num + ",是否继续更新?", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning"
+                }).then(() => {
+                    this.data.forEach(e => {
+                        e.internationalAmount = multiply(num, e.outFactoryPrice, 10)
+                        e.price = addPrice(e.outFactoryPrice, multiply(num, e.outFactoryPrice, 10), e.shareAmount)
+                        e.amount = amountCal(
+                            addPrice(e.outFactoryPrice, multiply(num, e.outFactoryPrice, 10), e.shareAmount),
+                            e.orderQuantity,
+                            e.freight,
+                            e.insurance,
+                            e.discount
+                        );
+                        e.itemMargin = grossProfitCal(
+                            e.purchaseAmount,
+                            e.partsPrice,
+                            e.outFactoryPrice,
+                            this.form.exchangeRate
+                        );
                     })
-                    this.$emit('formGoodstoFees', arr, val == 1 ? '国内费用' : '国外费用')
-                });
-            })
-                .finally(() => {
-                    this.calculateLoading = false;
-                });
+                })
+            }
         },
         khEdit(status) {
             if (status == 'cname') {

+ 10 - 3
src/views/exportTrade/customerInquiry/config/mainList.json

@@ -225,9 +225,16 @@
       "format": "yyyy-MM-dd"
     },
     {
+      "label": "船务状态",
+      "prop": "ifShipping",
+      "index": 23,
+      "minWidth": 80,
+      "overHidden": true
+    },
+    {
       "label": "备注",
       "prop": "orderRemark",
-      "index": 23,
+      "index": 24,
       "minWidth": 80,
       "search": true,
       "overHidden": true,
@@ -236,14 +243,14 @@
     {
       "label": "采购备注",
       "prop": "purchaseRemark",
-      "index": 24,
+      "index": 25,
       "minWidth": 80,
       "overHidden": true
     },
     {
       "label": "销售备注",
       "prop": "shippingRemark",
-      "index": 25,
+      "index": 26,
       "minWidth": 80,
       "overHidden": true
     }

+ 15 - 7
src/views/exportTrade/customerInquiry/detailsPage.vue

@@ -126,8 +126,8 @@
           </template>
         </avue-form>
       </trade-card>
-      <goods-info ref="goodsInfo" :form="form" :data="data" :orderFeesList.sync="orderFeesList"
-        :detailData="detailData" @formGoodstoFees="formGoodstoFees"></goods-info>
+      <goods-info ref="goodsInfo" :form="form" :data="data" :orderFeesList.sync="orderFeesList" :detailData="detailData"
+        @formGoodstoFees="formGoodstoFees"></goods-info>
       <!-- <trade-card title="商品信息">
         <avue-crud ref="crud" :data="data" :option="tableOption" @row-del="rowDel" :summary-method="summaryMethod"
           @saveColumn="saveColumn" @resetColumn="resetColumn" :cell-style="cellStyle" @row-dblclick="handleRowDBLClick">
@@ -408,6 +408,7 @@ export default {
       switchDialog: false,
       form: {
         orderStatus: "录入",
+        ifShipping:"录入",
         cargoType: "普货",
         businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00",
         currency: "USD"
@@ -729,7 +730,12 @@ export default {
           {
             label: "起订量",
             prop: "minOrder",
-            row: true,
+            span: 6
+          },
+          {
+            label: "船务状态",
+            prop: "ifShipping",
+            disabled: true,
             span: 6
           },
           {
@@ -852,6 +858,7 @@ export default {
       orderFilesList: [],
       oldform: {
         orderStatus: "录入",
+        ifShipping:"录入",
         cargoType: "普货",
         businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00",
         currency: "USD"
@@ -981,8 +988,8 @@ export default {
     cellStyle() {
       return "padding:0;height:40px;";
     },
-    formGoodstoFees(rows,type){
-      this.$refs.feeInfo.imporData(rows,type)
+    formGoodstoFees(rows, type) {
+      this.$refs.feeInfo.imporData(rows, type)
     },
     khEdit(staus) {
       if (staus == 'KH') {
@@ -1050,7 +1057,7 @@ export default {
                 this.form.exchangeRate
               );
               e.shareAmount = transformCal(e.shareAmount, this.oldExchange, this.form.exchangeRate);
-              e.internationalAmount= transformCal(e.internationalAmount, this.oldExchange, this.form.exchangeRate);
+              e.internationalAmount = transformCal(e.internationalAmount, this.oldExchange, this.form.exchangeRate);
               e.outFactoryPrice = sellingCal(e.productPrice, this.form.exchangeRate);
               e.price = addPrice(e.outFactoryPrice, e.shareAmount, e.internationalAmount);
               // e.price = sellingCal(e.productPrice, this.form.exchangeRate);
@@ -1436,7 +1443,7 @@ export default {
           e.insurance = transformCal(e.insurance, this.oldExchange, row);
           e.shareAmount = transformCal(e.shareAmount, this.oldExchange, row);
           e.outFactoryPrice = sellingCal(e.productPrice, row);
-          e.internationalAmount= transformCal(e.internationalAmount, this.oldExchange,row);
+          e.internationalAmount = transformCal(e.internationalAmount, this.oldExchange, row);
           e.price = addPrice(e.outFactoryPrice, e.shareAmount, e.internationalAmount);
           e.amount = amountCal(
             e.price,
@@ -1839,6 +1846,7 @@ export default {
             delete res.data.data.ifEnquiry;
             delete res.data.data.ifShipping;
             res.data.data.orderStatus = "录入";
+            res.data.data.ifShipping = "录入";
             res.data.data.cargoType = "普货",
               res.data.data.orderItemsList.forEach(e => {
                 delete e.id;

+ 71 - 49
src/views/exportTrade/salesContract/components/goodsInfo.vue

@@ -300,7 +300,8 @@ import {
   amountCal,
   grossProfitCal,
   costCal,
-  addPrice
+  addPrice,
+  divide
 } from "@/util/calculate";
 import _ from "lodash";
 export default {
@@ -753,57 +754,78 @@ export default {
     },
     calculate(val) {
       this.form.totalValue = 0
-      this.data.forEach((e, index) => {
-        e.sort = Number(index) + 1
-        this.form.totalValue = sum(multiply(e.outFactoryPrice, e.orderQuantity), this.form.totalValue)
-      })
-      this.calculateLoading = true
-      calculationDomesticFees({ ...this.form, domesticAbroad: val, orderItemsList: this.data, }).then(res => {
-        this.$confirm("总运费:" + res.data.data.amount + ",单价分摊运费:" + res.data.data.amountF + ",是否继续更新?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          this.data.forEach(e => {
+            this.data.forEach((e, index) => {
+                e.sort = Number(index) + 1
+                this.form.totalValue = sum(multiply(e.outFactoryPrice, e.orderQuantity), this.form.totalValue)
+            })
             if (val == 1) {
-              e.shareAmount = multiply(res.data.data.amountF, e.outFactoryPrice, 10)
-              e.price = addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.internationalAmount)
-              e.amount = amountCal(
-                addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.internationalAmount),
-                e.orderQuantity,
-                e.freight,
-                e.insurance,
-                e.discount
-              );
+                let numSum = 0
+                this.orderFeesList.forEach(e => {
+                    if (e.feesType == 2 && e.currency == "CNY") {
+                        console.log(sum, e.amount)
+                        numSum = sum(numSum, e.amount)
+                    }
+                })
+                let num = 0;
+                num = divide(divide(numSum, this.form.totalValue,10), this.form.exchangeRate,10)
+                this.$confirm("总运费:" + divide(numSum, this.form.exchangeRate) + ",单价分摊运费:" + num + ",是否继续更新?", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning"
+                }).then(() => {
+                    this.data.forEach(e => {
+                        e.shareAmount = multiply(num, e.outFactoryPrice, 10)
+                        e.price = addPrice(e.outFactoryPrice, multiply(num, e.outFactoryPrice, 10), e.internationalAmount)
+                        e.amount = amountCal(
+                            addPrice(e.outFactoryPrice, multiply(num, e.outFactoryPrice, 10), e.internationalAmount),
+                            e.orderQuantity,
+                            e.freight,
+                            e.insurance,
+                            e.discount
+                        );
+                        e.itemMargin = grossProfitCal(
+                            e.purchaseAmount,
+                            e.partsPrice,
+                            e.outFactoryPrice,
+                            this.form.exchangeRate
+                        );
+                    })
+                })
+
             } else {
-              e.internationalAmount = multiply(res.data.data.amountF, e.outFactoryPrice, 10)
-              e.price = addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.shareAmount)
-              e.amount = amountCal(
-                addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.shareAmount),
-                e.orderQuantity,
-                e.freight,
-                e.insurance,
-                e.discount
-              );
+              let numSum = 0
+                this.orderFeesList.forEach(e => {
+                    if (e.feesType == 2 && e.currency == "USD") {
+                        console.log(sum, e.amount)
+                        numSum = sum(numSum, e.amount)
+                    }
+                })
+                let num = 0;
+                num =divide(numSum, this.form.totalValue,10)
+                this.$confirm("总运费:" + numSum + ",单价分摊运费:" + num + ",是否继续更新?", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning"
+                }).then(() => {
+                    this.data.forEach(e => {
+                        e.internationalAmount = multiply(num, e.outFactoryPrice, 10)
+                        e.price = addPrice(e.outFactoryPrice, multiply(num, e.outFactoryPrice, 10), e.shareAmount)
+                        e.amount = amountCal(
+                            addPrice(e.outFactoryPrice, multiply(num, e.outFactoryPrice, 10), e.shareAmount),
+                            e.orderQuantity,
+                            e.freight,
+                            e.insurance,
+                            e.discount
+                        );
+                        e.itemMargin = grossProfitCal(
+                            e.purchaseAmount,
+                            e.partsPrice,
+                            e.outFactoryPrice,
+                            this.form.exchangeRate
+                        );
+                    })
+                })
             }
-            e.itemMargin = grossProfitCal(
-              e.purchaseAmount,
-              e.partsPrice,
-              e.outFactoryPrice,
-              this.form.exchangeRate
-            );
-          })
-          let arr = []
-          res.data.data.fees.forEach(e => {
-            // this.orderFeesList.push({ feesType: 2, ...e, corpId: this.form.corpId, corpName: this.form.corpsName, amount: multiply(e.price, e.quantity) })
-            arr.push({ feesType: 2, ...e, corpId: this.form.corpId, corpName: this.form.corpsName, amount: multiply(e.price, e.quantity), srcType: val == 1 ? '国内费用' : '国外费用' })
-          })
-          this.$emit('formGoodstoFees', arr, val == 1 ? '国内费用' : '国外费用')
-        });
-      })
-        .finally(() => {
-          this.calculateLoading = false;
-        });
     },
     khEdit(status) {
       if (status == 'cname') {

+ 16 - 0
src/views/exportTrade/shippingInquiry/config/customerContact.json

@@ -76,6 +76,22 @@
       "align": "right",
       "overHidden":true,
       "cell": true
+    },
+    {
+      "label": "供应商",
+      "prop": "corpName",
+      "index": 9,
+      "width": 120,
+      "overHidden":true,
+      "cell": true
+    },
+    {
+      "label": "供应商地址",
+      "prop": "corpAddress",
+      "index": 10,
+      "minWidth": 120,
+      "overHidden":true,
+      "cell": true
     }
   ]
 }

+ 11 - 2
src/views/exportTrade/shippingInquiry/config/mainList.json

@@ -1,6 +1,6 @@
 {
   "searchShow": true,
-  "searchMenuSpan": 8,
+  "searchMenuSpan": 24,
   "border": true,
   "index": true,
   "viewBtn": false,
@@ -13,7 +13,16 @@
   "searchIndex": 2,
   "selection": true,
   "tip": false,
-  "column": [{
+  "column": [
+    {
+      "label": "订单号",
+      "prop": "orderNo",
+      "search": true,
+      "overHidden": true,
+      "minWidth": 100,
+      "index": 1,
+      "span": 8
+    },{
       "label": "询价日期",
       "prop": "businesDate",
       "search": true,

+ 92 - 6
src/views/exportTrade/shippingInquiry/detailsPage.vue

@@ -126,8 +126,16 @@ import {
   getGoods,
   getPorts,
   delItem,
-  commit
+  commit,
+  calculationDomesticFees
 } from "@/api/basicData/shippingInquiry";
+import {
+  amountCal,
+  grossProfitCal,
+  sum,
+  addPrice,
+  multiply
+} from "@/util/calculate";
 import reportDialog from "@/components/report-dialog/main";
 import { micrometerFormat, IntegerFormat } from "@/util/validate";
 import { contrastObj, contrastList } from "@/util/contrastData";
@@ -192,6 +200,48 @@ export default {
             valueFormat: "yyyy-MM-dd 00:00:00"
           },
           {
+            label: "报价日期",
+            prop: "businesDate",
+            type: "date",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd 00:00:00",
+            span: 8,
+            disabled: true
+          },
+          {
+            label: "报价日期",
+            prop: "businesDate",
+            type: "date",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd 00:00:00",
+            span: 8,
+            disabled: true
+          },
+          {
+            label: "货物类型",
+            prop: "cargoType",
+            span: 8,
+            disabled: true
+          },
+          {
+            label: "价格条款",
+            prop: "priceTerms",
+            span: 8,
+            disabled: true
+          },
+          {
+            label: "币别",
+            prop: "currency",
+            span: 8,
+            disabled: true
+          },
+          {
+            label: "汇率",
+            prop: "exchangeRate",
+            span: 8,
+            disabled: true
+          },
+          {
             label: "船务状态",
             prop: "ifShipping",
             disabled: true,
@@ -268,10 +318,12 @@ export default {
       oldform: {},
       olddata: [],
       oldfreightData: [],
+      oldorderFeesList: [],
       subLoading: false,
       pageLoading: false,
       showBut: true,
-      search: {}
+      search: {},
+      calculateLoading: false,
     };
   },
   props: {
@@ -432,6 +484,9 @@ export default {
           this.freightData = res.data.data.orderFreightList
             ? res.data.data.orderFreightList
             : [];
+          this.orderFeesList = res.data.data.orderFeesList
+            ? res.data.data.orderFeesList
+            : [];
           this.oldform = res.data.data;
           this.olddata = this.deepClone(
             res.data.data.itemsVOList ? res.data.data.itemsVOList : []
@@ -439,6 +494,9 @@ export default {
           this.oldfreightData = this.deepClone(
             res.data.data.orderFreightList ? res.data.data.orderFreightList : []
           );
+          this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList
+            ? res.data.data.orderFeesList
+            : []);
         })
         .finally(() => {
           this.showBut = true;
@@ -448,8 +506,24 @@ export default {
     addFreight() {
       this.freightData.push({ $cellEdit: true });
     },
-    calculate(val){
-      console.log(val)
+    calculate(val) {
+      this.form.totalValue = 0
+      this.data.forEach((e, index) => {
+        e.sort = Number(index) + 1
+        this.form.totalValue = sum(multiply(e.outFactoryPrice, e.orderQuantity), this.form.totalValue)
+      })
+      this.calculateLoading = true
+      calculationDomesticFees({ ...this.form, corpsName: '', domesticAbroad: val, orderItemsList: this.data, }).then(res => {
+        let arr = []
+        res.data.data.fees.forEach(e => {
+          // this.orderFeesList.push({ feesType: 2, ...e, corpId: this.form.corpId, corpName: this.form.corpsName, amount: multiply(e.price, e.quantity) })
+          arr.push({ feesType: 2, ...e, corpId: this.form.corpId, corpName: this.form.corpCName, amount: multiply(e.price, e.quantity), srcType: val == 1 ? '国内费用' : '国外费用' })
+        })
+        this.$refs.feeInfo.imporData(arr, val == 1 ? '国内费用' : '国外费用')
+      })
+        .finally(() => {
+          this.calculateLoading = false;
+        });
     },
     //修改提交触发
     editCustomer(status, status2) {
@@ -457,10 +531,12 @@ export default {
         done();
         if (valid) {
           if (status == "submit") {
+            let orderFeesList = this.$refs.feeInfo.submitData();
             this.subLoading = true;
             submit({
               id: this.form.id,
-              orderFreightList: this.freightData
+              orderFreightList: this.freightData,
+              orderFeesList: orderFeesList
             })
               .then(res => {
                 this.$message.success("修改成功");
@@ -498,9 +574,11 @@ export default {
               });
           }
           if (status == "fix") {
+            let orderFeesList = this.$refs.feeInfo.submitData();
             commit({
               id: this.form.id,
-              orderFreightList: this.freightData
+              orderFreightList: this.freightData,
+              orderFeesList: orderFeesList
             }).then(res => {
               this.$message.success("提交成功");
               this.form = res.data.data;
@@ -510,6 +588,9 @@ export default {
               this.freightData = res.data.data.orderFreightList
                 ? res.data.data.orderFreightList
                 : [];
+              this.orderFeesList = res.data.data.orderFeesList
+                ? res.data.data.orderFeesList
+                : [];
               this.oldform = res.data.data;
               this.olddata = this.deepClone(
                 res.data.data.orderItemsList ? res.data.data.orderItemsList : []
@@ -519,6 +600,11 @@ export default {
                   ? res.data.data.orderFreightList
                   : []
               );
+              this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList
+                ? res.data.data.orderFeesList
+                : []
+              );
+              this.detailData.status = 1
             });
           }
         } else {

+ 8 - 1
src/views/exportTrade/shippingInquiry/index.vue

@@ -21,6 +21,13 @@
         <template slot="menuLeft">
           <el-button type="info" size="small">报表打印</el-button>
         </template>
+        <template slot-scope="scope" slot="orderNo">
+          <span
+            style="color: #409EFF;cursor: pointer"
+            @click.stop="editOpen(scope.row, 1)"
+            >{{ scope.row.orderNo }}
+          </span>
+        </template>
         <template slot="portOfLoadSearch">
           <port-info v-model="search.portOfLoad" />
         </template>
@@ -71,7 +78,7 @@
             type="text"
             icon="el-icon-edit"
             size="small"
-            @click.stop="editOpen(scope.row, 2)"
+            @click.stop="editOpen(scope.row, 1)"
             >编辑
           </el-button>
         </template>

+ 6 - 6
src/views/supplier/detailsInfo.vue

@@ -17,7 +17,7 @@
         <containerTitle title="基础信息" style="margin-top: 60px"></containerTitle>
         <basic-container v-loading="loading">
             <span style="font-size: 18px;font-weight: 600;">{{ form.cname }}</span>
-            <containerTitle title="应款项" style="margin-top:5px"></containerTitle>
+            <containerTitle title="应款项" style="margin-top:5px"></containerTitle>
             <table border="0" width="100%" v-loading="loading">
                 <tr>
                     <td class="stat-td">
@@ -47,7 +47,7 @@
                                 <span style="font-size:20px;">¥</span>
                                 <avue-count-up :end="form.advancePayment"></avue-count-up>
                             </div>
-                            <div class="title">预款</div>
+                            <div class="title">预款</div>
                         </div>
                     </td>
                     <td class="stat-td">
@@ -57,7 +57,7 @@
                                 <span style="font-size:20px;">¥</span>
                                 <avue-count-up :end="form.balanceAmount"></avue-count-up>
                             </div>
-                            <div class="title">未款</div>
+                            <div class="title">未款</div>
                         </div>
                     </td>
                     <td class="stat-td">
@@ -67,7 +67,7 @@
                                 <span style="font-size:20px;">¥</span>
                                 <avue-count-up :end="form.settlmentAmount"></avue-count-up>
                             </div>
-                            <div class="title">已款</div>
+                            <div class="title">已款</div>
                         </div>
                     </td>
                 </tr>
@@ -85,7 +85,7 @@
                         <template slot="menuLeft">
                             <!-- <el-button type="primary" size="mini">新建销售单
                             </el-button> -->
-                            <el-button size="mini">
+                            <el-button size="mini">
                             </el-button>
                             <el-button size="mini">送货
                             </el-button>
@@ -113,7 +113,7 @@
                         :table-loading="loading2" @saveColumn="saveColumn2" @resetColumn="resetColumn2"
                         :cell-style="cellStyle" @search-criteria-switch="searchCriteriaSwitch2">
                         <template slot="menuLeft">
-                            <el-button size="mini">
+                            <el-button size="mini">
                             </el-button>
                         </template>
                     </avue-crud>

+ 2 - 8
src/views/supplier/detailsPage.vue

@@ -199,14 +199,8 @@ export default {
     }
   },
   async created() {
-    this.option2 = await this.getColumnData(
-      this.getColumnName(210),
-      option2
-    );
-    this.option3 = await this.getColumnData(
-      this.getColumnName(210.4),
-      option3
-    );
+    this.option2 = await this.getColumnData(this.getColumnName(210), option2);
+    this.option3 = await this.getColumnData(this.getColumnName(210.4), option3);
     if (this.detailData.id) {
       this.getDetail(this.detailData.id);
     }

+ 4 - 4
src/views/supplier/index.vue

@@ -30,8 +30,8 @@
                 <span style="font-size:20px;">¥</span>
                 <avue-count-up :end="form.advancePayment"></avue-count-up>
               </div>
-              <div class="title">预款</div>
-              <div class="title">(积累预:)</div>
+              <div class="title">预款</div>
+              <div class="title">(积累预:)</div>
             </div>
           </td>
           <td class="stat-td">
@@ -41,7 +41,7 @@
                 <span style="font-size:20px;">¥</span>
                 <avue-count-up :end="form.balanceAmount"></avue-count-up>
               </div>
-              <div class="title">未款</div>
+              <div class="title">未款</div>
               <div class="title">(积累欠款:)</div>
             </div>
           </td>
@@ -52,7 +52,7 @@
                 <span style="font-size:20px;">¥</span>
                 <avue-count-up :end="form.settlmentAmount"></avue-count-up>
               </div>
-              <div class="title">已款</div>
+              <div class="title">已款</div>
             </div>
           </td>
         </tr>

+ 18 - 19
src/views/supplier/js/optionList.js

@@ -17,13 +17,13 @@ export const option = {
   searchIndex: 2,
   column: [
     {
-      label: "客户名称",
+      label: "供应商名称",
       prop: "cname",
       overHidden: true,
       index: 1
     },
     {
-      label: "客户名称",
+      label: "供应商名称",
       prop: "ids",
       type: 'select',
       hide: true,
@@ -51,19 +51,19 @@ export const option = {
       index: 5
     },
     {
-      label: "预款",
+      label: "预款",
       prop: "advancePayment",
       overHidden: true,
       index: 6
     },
     {
-      label: "未款",
+      label: "未款",
       prop: "balanceAmount",
       overHidden: true,
       index: 7
     },
     {
-      label: "已款",
+      label: "已款",
       prop: "settlmentAmount",
       overHidden: true,
       index: 8
@@ -107,7 +107,7 @@ export const optionList = {
       dicData: [
         {
           type: 0,
-          name: '客户地址'
+          name: '供应商地址'
         },
         {
           type: 1,
@@ -149,9 +149,8 @@ export const option2 = {
       type: "select",
       props: {
         label: "dictValue",
-        value: "dictKey"
+        value: "dictValue"
       },
-      // dicUrl: "/api/blade-system/dict-biz/dictionary?code=abbreviation",
       dicData:[],
       cell: true,
       minWidth:200,
@@ -299,17 +298,17 @@ export const sellOptionList = {
       overHidden: true
     },
     {
-      label: "未款",
+      label: "未款",
       prop: "e",
       overHidden: true
     },
     {
-      label: "已款",
+      label: "已款",
       prop: "f",
       overHidden: true
     },
     {
-      label: "款状态",
+      label: "款状态",
       prop: "g",
       search: true,
       overHidden: true
@@ -347,7 +346,7 @@ export const sellOption = {
       index: 1
     },
     {
-      label: "客户名称",
+      label: "供应商名称",
       prop: "corpId",
       type: 'select',
       dicData: [],
@@ -385,21 +384,21 @@ export const sellOption = {
       index: 6
     },
     {
-      label: "未款",
+      label: "未款",
       prop: "balanceAmount",
       overHidden: true,
       search: true,
       index: 7
     },
     {
-      label: "已款",
+      label: "已款",
       prop: "settlmentAmount",
       overHidden: true,
       search: true,
       index: 8
     },
     {
-      label: "款状态",
+      label: "款状态",
       prop: "status",
       type: 'select',
       index: 9
@@ -425,7 +424,7 @@ export const sellOption = {
       index: 11
     },
     {
-      label: "客户分类",
+      label: "供应商分类",
       prop: "corpType",
       type: "tree",
       dicData: [],
@@ -479,7 +478,7 @@ export const capitalOption = {
       overHidden: true
     },
     {
-      label: "款日期",
+      label: "款日期",
       prop: "b",
       search: true,
       overHidden: true
@@ -491,13 +490,13 @@ export const capitalOption = {
       overHidden: true
     },
     {
-      label: "款金额",
+      label: "款金额",
       prop: "d",
       search: true,
       overHidden: true
     },
     {
-      label: "款账户",
+      label: "款账户",
       prop: "e",
       search: true,
       overHidden: true