Browse Source

修改bug

Qukatie 3 years ago
parent
commit
605b6a6a5e

+ 8 - 0
src/api/basicData/salesContract.js

@@ -167,4 +167,12 @@ export const getPricebank = (current, size, params) => {
       size,
     }
   })
+}
+//树形
+export const calculationDomesticFees = (data) => {
+  return request({
+    url: '/api/blade-purchase-sales/exportEnquiry/calculationDomesticFees',
+    method: 'post',
+    data: data
+  })
 }

+ 18 - 2
src/util/calculate.js

@@ -1,4 +1,12 @@
 import _ from "lodash";
+//分摊费用额
+export function shareAmountFees(num, num2, num3) {
+  const val = Number(num ? num : 0)
+  const val2 = Number(num2 ? num2 : 0)
+  const val3 = Number(num3 ? num3 : 0)
+  const sum = _.multiply(_.add(val, val2),val3)
+  return Number(sum).toFixed(2)
+}
 //计算费用
 export function calculationFees(num, num2, num3) {
   const val = Number(num ? num : 0)
@@ -65,7 +73,7 @@ export function costsCal(num, num2, num3) {
   const sum = _.add(price1, _.multiply(price2, Num))
   return Number(sum).toFixed(2)
 }
-//产品价格/汇率 计算出销售价格
+//产品价格/汇率 计算出出厂价格
 export function sellingCal(num, num2) {
   //产品价格
   const product = Number(num ? num : 0)
@@ -74,7 +82,7 @@ export function sellingCal(num, num2) {
   const sum = _.divide(product, exchangeRate)
   return Number(sum).toFixed(2)
 }
-//销售价格乘以数量加运费加保险乘以(折扣除以10) 计算出金额
+//出厂价格乘以数量加运费加保险乘以(折扣除以10) 计算出金额
 export function amountCal(num, num2, num3, num4, num5) {
   //销售价
   const sell = Number(num ? num : 0)
@@ -152,3 +160,11 @@ export function addAllsalary2(num, num2, num3, num4) {
   const sum = _.add(_.add(Sum1, Sum2), _.add(Sum3, Sum4))
   return Number(sum)
 }
+
+//销售=出厂价+分摊价格
+export function addPrice(num, num2) {
+  const Sum1 = Number(num ? num : 0)
+  const Sum2 = Number(num2 ? num2 : 0)
+  const sum = _.add(Sum1, Sum2)
+  return Number(sum).toFixed(2)
+}

+ 62 - 45
src/views/exportTrade/customerInquiry/components/goodsInfo.vue

@@ -99,7 +99,8 @@
             </template>
             //产品属性
             <template slot="itemPropForm" slot-scope="{type,disabled}">
-                <el-input type="textarea" :rows="2" v-model="goodsForm.itemProp" size="small" placeholder="" @change="editChange(goodsForm)">
+                <el-input type="textarea" :rows="2" v-model="goodsForm.itemProp" size="small" placeholder=""
+                    @change="editChange(goodsForm)">
                 </el-input>
             </template>
             //阀门配件
@@ -202,6 +203,18 @@
                 <el-input v-model="goodsForm.purchaseAmount" size="small" placeholder="请输入"
                     @change="purchaseAmountChange(goodsForm)" :disabled="disabled"></el-input>
             </template>
+            //出厂费用
+            <template slot="outFactoryPriceForm" slot-scope="{type,disabled}">
+                <el-input v-model="goodsForm.outFactoryPrice" size="small"
+                    oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
+                    @change="priceChange(goodsForm)"></el-input>
+            </template>
+            //分摊金额
+            <template slot="shareAmountForm" slot-scope="{type,disabled}">
+                <el-input v-model="goodsForm.shareAmount" size="small"
+                    oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
+                    @change="priceChange(goodsForm)"></el-input>
+            </template>
             //单价
             <template slot="priceForm" slot-scope="{type,disabled}">
                 <el-input v-model="goodsForm.price" size="small"
@@ -281,20 +294,13 @@ import priceLibrary from "@/components/price-Library/main";
 import propertyDialog from "@/components/property-dialog/main";
 import { dateFormat } from "@/util/date";
 import {
-    detail,
-    submit,
     delItem,
     getDeptLazyTree,
     getGoods,
     savePurchase,
     saveShipping,
-    getPorts,
     getSpecification,
     getPricebank,
-    saveSell,
-    getPricedetail,
-    getParities,
-    getCode,
     calculationDomesticFees
 } from "@/api/basicData/customerInquiry";
 import {
@@ -304,13 +310,9 @@ import {
     productCal,
     sellingCal,
     amountCal,
-    transformCal,
     grossProfitCal,
-    STGPCal,
-    numCal,
-    costsCal,
     costCal,
-    calculationFees
+    addPrice
 } from "@/util/calculate";
 import _ from "lodash";
 export default {
@@ -527,7 +529,7 @@ export default {
                     row.cname = e.cname;
                     row.ename = e.ename;
                     row.priceCategory = e.goodsTypeName;
-                    row.purchaseCost = costCal(e.price, e.taxRate);
+                    row.purchaseCost = costCal(e.outFactoryPrice, e.taxRate);
                     row.purchaseAmount = e.purchaseAmount;
                     row.itemProp = null;
                     row.remarksOne = null;
@@ -547,11 +549,13 @@ export default {
                     row.itemType = e.specs;
                     row.tradeTerms = null;
                     row.productPrice = productCal(e.purchaseAmount, 0, this.form.coefficient);
-                    row.price = sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
+                    row.outFactoryPrice = sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
+                    row.shareAmount = 0;
                     row.orderQuantity = 1;
                     row.insurance = 0;
                     row.freight = 0;
                     row.discount = null;
+                    row.price = sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
                     row.amount = sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
                     row.taxRate = 0;
                     row.unit = 'PCS';
@@ -573,7 +577,7 @@ export default {
                     cname: e.cname,
                     ename: e.ename,
                     priceCategory: e.goodsTypeName,
-                    purchaseCost: costCal(e.price, e.taxRate),
+                    purchaseCost: costCal(e.outFactoryPrice, e.taxRate),
                     purchaseAmount: e.purchaseAmount,
                     itemProp: null,
                     remarksOne: null,
@@ -593,14 +597,19 @@ export default {
                     itemType: e.specs,
                     tradeTerms: null,
                     productPrice: productCal(e.purchaseAmount, 0, this.form.coefficient),
-                    price: sellingCal(
+                    outFactoryPrice: sellingCal(
                         productCal(e.purchaseAmount, 0, this.form.coefficient),
                         this.form.exchangeRate
                     ),
+                    shareAmount: 0,
                     orderQuantity: 1,
                     insurance: 0,
                     freight: 0,
                     discount: null,
+                    price: sellingCal(
+                        productCal(e.purchaseAmount, 0, this.form.coefficient),
+                        this.form.exchangeRate
+                    ),
                     amount: sellingCal(
                         productCal(e.purchaseAmount, 0, this.form.coefficient),
                         this.form.exchangeRate
@@ -691,14 +700,33 @@ export default {
             });
         },
         calculate() {
+            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)
+            })
             calculationDomesticFees({ ...this.form, orderItemsList: this.data, }).then(res => {
-                this.$confirm("单件运费为" + res.data.data + "元,是否继续更新?", {
+                this.$confirm("总费用为:"+res.data.data.amount+",单项运费为" + res.data.data.amountF + ",是否继续更新?", {
                     confirmButtonText: "确定",
                     cancelButtonText: "取消",
                     type: "warning"
                 }).then(() => {
                     this.data.forEach(e => {
-                        e.amount = calculationFees(res.data.data, e.price, e.orderQuantity)
+                        e.shareAmount =multiply(res.data.data.amountF,e.outFactoryPrice) 
+                        e.price = addPrice(e.outFactoryPrice, multiply(res.data.data.amountF,e.outFactoryPrice))
+                        e.amount = amountCal(
+                            addPrice(e.outFactoryPrice, res.data.data.amountF),
+                            e.orderQuantity,
+                            e.freight,
+                            e.insurance,
+                            e.discount
+                        );
+                        e.itemMargin = grossProfitCal(
+                            e.purchaseAmount,
+                            e.partsPrice,
+                            e.outFactoryPrice,
+                            this.form.exchangeRate
+                        );
                     })
                 });
             })
@@ -743,33 +771,17 @@ export default {
         moveDown(row, index) {
             this.data[index] = this.data.splice(index + 1, 1, row)[0]
         },
-        transition(rows) {
-            let data = []
-            rows.forEach(e => {
-                data.push({
-                    goodId: e.itemId,
-                    goodTypeId: e.goodTypeId,
-                    goodTypeName: e.goodsTypeName,
-                    ename: e.ename,
-                    corpId: e.corpId,
-                    corpName: e.corpName,
-                    goodName: e.cname,
-                    price: e.purchaseAmount,
-                    goodNumber: 1,
-                    amout: e.purchaseAmount,
-                    partsCost: costCal(e.price, e.taxRate),
-                    $cellEdit: true
-                })
-            })
-            return data
-        },
         purchaseAmountChange(row) {
             row.productPrice = productCal(
                 row.purchaseAmount,
                 row.partsPrice,
                 this.form.coefficient
             );
-            row.price = sellingCal(row.productPrice, this.form.exchangeRate);
+            row.outFactoryPrice = sellingCal(row.productPrice, this.form.exchangeRate);
+            row.price = addPrice(
+                row.outFactoryPrice,
+                row.shareAmount
+            );
             row.amount = amountCal(
                 row.price,
                 row.orderQuantity,
@@ -780,13 +792,14 @@ export default {
             row.itemMargin = grossProfitCal(
                 row.purchaseAmount,
                 row.partsPrice,
-                row.price,
+                row.outFactoryPrice,
                 this.form.exchangeRate
             );
         },
         priceChange(row) {
+            row.price = addPrice(row.outFactoryPrice, row.shareAmount)
             row.amount = amountCal(
-                row.price,
+                addPrice(row.outFactoryPrice, row.shareAmount),
                 row.orderQuantity,
                 row.freight,
                 row.insurance,
@@ -795,7 +808,7 @@ export default {
             row.itemMargin = grossProfitCal(
                 row.purchaseAmount,
                 row.partsPrice,
-                row.price,
+                row.outFactoryPrice,
                 this.form.exchangeRate
             );
         },
@@ -964,10 +977,14 @@ export default {
                 this.goodsForm.partsPrice,
                 this.form.coefficient
             );
-            this.goodsForm.price = sellingCal(
+            this.goodsForm.outFactoryPrice = sellingCal(
                 this.goodsForm.productPrice,
                 this.form.exchangeRate
             );
+            this.goodsForm.price = addPrice(
+                this.goodsForm.outFactoryPrice,
+                this.goodsForm.shareAmount
+            );
             this.goodsForm.amount = amountCal(
                 this.goodsForm.price,
                 this.goodsForm.orderQuantity,
@@ -978,7 +995,7 @@ export default {
             this.goodsForm.itemMargin = grossProfitCal(
                 this.goodsForm.purchaseAmount,
                 this.goodsForm.partsPrice,
-                this.goodsForm.price,
+                this.goodsForm.outFactoryPrice,
                 this.form.exchangeRate
             );
             const names = [this.goodsForm.partsValveName, this.goodsForm.partsCapName, this.goodsForm.partsHandleName, this.goodsForm.partsColourName, this.goodsForm.partsModeName, this.goodsForm.partsAuthenticationName, this.goodsForm.partsOtherName];

+ 34 - 16
src/views/exportTrade/customerInquiry/config/customerContact.json

@@ -228,9 +228,27 @@
             }
         },
         {
+            "label": "出厂价格",
+            "prop": "outFactoryPrice",
+            "index": 22,
+            "width": 100,
+            "align": "right",
+            "span": 6,
+            "overHidden": true
+        },
+        {
+            "label": "分摊金额",
+            "prop": "shareAmount",
+            "index": 23,
+            "width": 100,
+            "align": "right",
+            "span": 6,
+            "overHidden": true
+        },
+        {
             "label": "销售价",
             "prop": "price",
-            "index": 22,
+            "index": 24,
             "width": 100,
             "span": 6,
             "align": "right",
@@ -239,7 +257,7 @@
         {
             "label": "金额",
             "prop": "amount",
-            "index": 23,
+            "index": 25,
             "width": 100,
             "span": 6,
             "align": "right",
@@ -248,7 +266,7 @@
         {
             "label": "产品型号",
             "prop": "itemType",
-            "index": 24,
+            "index": 26,
             "width": 100,
             "span": 6,
             "overHidden": true
@@ -256,7 +274,7 @@
         {
             "label": "采购成本",
             "prop": "purchaseCost",
-            "index": 25,
+            "index": 27,
             "width": 100,
             "align": "right",
             "span": 6,
@@ -266,7 +284,7 @@
         {
             "label": "采购单价",
             "prop": "purchaseAmount",
-            "index": 26,
+            "index": 28,
             "width": 100,
             "align": "right",
             "span": 6,
@@ -276,7 +294,7 @@
         {
             "label": "配件成本",
             "prop": "partsCost",
-            "index": 27,
+            "index": 29,
             "width": 100,
             "align": "right",
             "span": 6,
@@ -286,7 +304,7 @@
         {
             "label": "配件价格",
             "prop": "partsPrice",
-            "index": 28,
+            "index": 30,
             "width": 100,
             "align": "right",
             "span": 6,
@@ -296,7 +314,7 @@
         {
             "label": "配件价格描述",
             "prop": "partsPriceDescribe",
-            "index": 29,
+            "index": 31,
             "width": 120,
             "span": 6,
             "disabled": true,
@@ -305,7 +323,7 @@
         {
             "label": "供应商",
             "prop": "corpName",
-            "index": 30,
+            "index": 32,
             "width": 200,
             "span": 6,
             "disabled": true,
@@ -314,7 +332,7 @@
         {
             "label": "重点推荐",
             "prop": "priorityReferrer",
-            "index": 31,
+            "index": 33,
             "width": 100,
             "span": 6,
             "overHidden": true
@@ -322,7 +340,7 @@
         {
             "label": "推荐理由",
             "prop": "referrerReason",
-            "index": 32,
+            "index": 34,
             "width": 100,
             "overHidden": true,
             "span": 6
@@ -330,7 +348,7 @@
         {
             "label": "产品价格",
             "prop": "productPrice",
-            "index": 33,
+            "index": 35,
             "width": 100,
             "align": "right",
             "span": 6,
@@ -340,7 +358,7 @@
         {
             "label": "单品毛利率",
             "prop": "itemMargin",
-            "index": 34,
+            "index": 36,
             "width": 100,
             "align": "right",
             "span": 6,
@@ -350,7 +368,7 @@
         {
             "label": "折扣",
             "prop": "discount",
-            "index": 35,
+            "index": 37,
             "width": 100,
             "align": "right",
             "span": 6,
@@ -359,7 +377,7 @@
         {
             "label": "税率",
             "prop": "taxRate",
-            "index": 36,
+            "index": 38,
             "width": 100,
             "align": "right",
             "span": 6,
@@ -370,7 +388,7 @@
             "prop": "remarks",
             "type": "textarea",
             "minRows": 2,
-            "index": 37,
+            "index": 39,
             "width": 100,
             "overHidden": true,
             "span": 12

+ 17 - 6
src/views/exportTrade/customerInquiry/detailsPage.vue

@@ -387,7 +387,10 @@ import {
   STGPCal,
   numCal,
   costsCal,
-  costCal
+  costCal,
+  sum,
+  addPrice,
+  multiply 
 } from "@/util/calculate";
 import goodsInfo from "./components/goodsInfo.vue";
 import _ from "lodash";
@@ -540,7 +543,7 @@ export default {
               label: "dictValue",
               value: "dictValue"
             },
-            row:true
+            row: true
           },
           {
             label: "日期条款",
@@ -963,6 +966,7 @@ export default {
       this.$emit("copyOrder", this.form.id);
     },
     getParities(status) {
+      this.oldExchange = this.form.exchangeRate;
       getParities({
         currency: this.form.currency,
         businesDate: this.form.businesDate
@@ -971,7 +975,6 @@ export default {
           const data = res.data.data;
           this.form.exchangeRate = data.receivableParities;
           this.oldform.exchangeRate = data.receivableParities;
-          this.oldExchange = this.deepClone(data.receivableParities);
         })
         .finally(() => {
           if (this.data.length > 0 && status == "currency") {
@@ -986,7 +989,11 @@ export default {
                 this.oldExchange,
                 this.form.exchangeRate
               );
-              e.price = sellingCal(e.productPrice, this.form.exchangeRate);
+              e.shareAmount = transformCal(e.shareAmount, this.oldExchange, this.form.exchangeRate);
+              console.log(e.shareAmount)
+              e.outFactoryPrice = sellingCal(e.productPrice, this.form.exchangeRate);
+              e.price = addPrice(e.outFactoryPrice, e.shareAmount);
+              // e.price = sellingCal(e.productPrice, this.form.exchangeRate);
               e.amount = amountCal(
                 e.price,
                 e.orderQuantity,
@@ -1003,6 +1010,7 @@ export default {
               e.exchangeRate = this.form.exchangeRate;
             });
           }
+          // this.oldExchange = this.deepClone(this.form.businesDate);
         });
     },
     refreshChange() {
@@ -1365,7 +1373,9 @@ export default {
         this.data.forEach(e => {
           e.freight = transformCal(e.freight, this.oldExchange, row);
           e.insurance = transformCal(e.insurance, this.oldExchange, row);
-          e.price = sellingCal(e.productPrice, row);
+          e.shareAmount = transformCal(e.shareAmount, this.oldExchange, row);
+          e.outFactoryPrice = sellingCal(e.productPrice, row);
+          e.price = addPrice(e.outFactoryPrice, e.shareAmount);
           e.amount = amountCal(
             e.price,
             e.orderQuantity,
@@ -1674,7 +1684,6 @@ export default {
     },
     importLibray(rows) {
       rows.forEach(e => {
-        console.log(e);
         this.data.push({
           itemId: e.itemId,
           code: e.code,
@@ -1916,8 +1925,10 @@ export default {
             costSum,
             paySum
           );
+          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.subLoading = true;
 

+ 882 - 840
src/views/exportTrade/salesContract/components/goodsInfo.vue

@@ -12,6 +12,8 @@
             :disabled="detailData.status == 1 || orderItemIds.length == 0" @click="getInvoice">生成发货单
           </el-button>
           <el-button type="info" size="small" @click="cnameData">刷新基础资料</el-button>
+          <el-button type="info" size="small" @click="calculate" :disabled="detailData.status == 1">计算国内费用
+          </el-button>
         </el-row>
       </template>
       <template slot="headerSerial">
@@ -183,6 +185,18 @@
         <el-input v-model="goodsForm.purchaseAmount" size="small" placeholder="请输入"
           @change="purchaseAmountChange(goodsForm)" :disabled="disabled"></el-input>
       </template>
+      //出厂费用
+      <template slot="outFactoryPriceForm" slot-scope="{type,disabled}">
+        <el-input v-model="goodsForm.outFactoryPrice" size="small"
+          oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
+          @change="priceChange(goodsForm)"></el-input>
+      </template>
+      //分摊金额
+      <template slot="shareAmountForm" slot-scope="{type,disabled}">
+        <el-input v-model="goodsForm.shareAmount" size="small"
+          oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
+          @change="priceChange(goodsForm)"></el-input>
+      </template>
       //单价
       <template slot="priceForm" slot-scope="{type,disabled}">
         <el-input v-model="goodsForm.price" size="small"
@@ -252,153 +266,412 @@
 </template>
 
 <script>
-  import goodsOption from "../config/commodity.json";
-  import tableOption from "../config/customerContact.json";
-  import reportDialog from "@/components/report-dialog/main";
-  import partLibrary from "@/components/part-library/main";
-  import priceLibrary from "@/components/price-Library/main";
-  import propertyDialog from "@/components/property-dialog/main";
-  import {
-    dateFormat
-  } from "@/util/date";
-  import {
-    detail,
-    submit,
-    delItem,
-    getDeptLazyTree,
-    getGoods,
-    deliverGoods,
-    getPorts,
-    getSpecification,
-    saveSell,
-    getPricedetail,
-    pleaseCheck,
-    getParities,
-    getCode,
-    getPricebank
-  } from "@/api/basicData/salesContract";
-  import {
-    sum,
-    multiply,
-    partSum,
-    productCal,
-    sellingCal,
-    amountCal,
-    transformCal,
-    grossProfitCal,
-    STGPCal,
-    numCal,
-    costsCal,
-    costCal
-  } from "@/util/calculate";
-  import _ from "lodash";
-  export default {
-    name: "customerInformation",
-    data() {
-      return {
-        switchDialog: false,
-        loading: false,
-        itemtypeList: [],
-        goodsForm: {},
-        tableOption: {},
-        goodsoptions: [],
-        partList: [],
-        ThreadList: [],
-        mediumList: [],
-        colorList: [],
-        stencilList: [],
-        selectionList: [],
-        orderItemIds: [],
-        dialogVisible: false,
-        treeDeptId: null,
-        treeStyle: "height:" + (window.innerHeight - 315) + "px",
-        goodsOption: {},
-        goodsList: [],
-        page: {
-          pageSize: 10,
-          currentPage: 1,
-          total: 0
+import goodsOption from "../config/commodity.json";
+import tableOption from "../config/customerContact.json";
+import reportDialog from "@/components/report-dialog/main";
+import partLibrary from "@/components/part-library/main";
+import priceLibrary from "@/components/price-Library/main";
+import propertyDialog from "@/components/property-dialog/main";
+import {
+  dateFormat
+} from "@/util/date";
+import {
+  delItem,
+  getDeptLazyTree,
+  getGoods,
+  getSpecification,
+  getPricebank,
+  calculationDomesticFees
+} from "@/api/basicData/salesContract";
+import {
+  sum,
+  multiply,
+  partSum,
+  productCal,
+  sellingCal,
+  amountCal,
+  grossProfitCal,
+  costCal,
+  addPrice
+} from "@/util/calculate";
+import _ from "lodash";
+export default {
+  name: "customerInformation",
+  data() {
+    return {
+      switchDialog: false,
+      loading: false,
+      itemtypeList: [],
+      goodsForm: {},
+      tableOption: {},
+      goodsoptions: [],
+      partList: [],
+      ThreadList: [],
+      mediumList: [],
+      colorList: [],
+      stencilList: [],
+      selectionList: [],
+      orderItemIds: [],
+      dialogVisible: false,
+      treeDeptId: null,
+      treeStyle: "height:" + (window.innerHeight - 315) + "px",
+      goodsOption: {},
+      goodsList: [],
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
+      treeOption: {
+        nodeKey: "id",
+        lazy: true,
+        treeLoad: function (node, resolve) {
+          const parentId = node.level === 0 ? 0 : node.data.id;
+          getDeptLazyTree(parentId).then(res => {
+            resolve(
+              res.data.data.map(item => {
+                return {
+                  ...item,
+                  leaf: !item.hasChildren
+                };
+              })
+            );
+          });
         },
-        treeOption: {
-          nodeKey: "id",
-          lazy: true,
-          treeLoad: function(node, resolve) {
-            const parentId = node.level === 0 ? 0 : node.data.id;
-            getDeptLazyTree(parentId).then(res => {
-              resolve(
-                res.data.data.map(item => {
-                  return {
-                    ...item,
-                    leaf: !item.hasChildren
-                  };
-                })
-              );
+        addBtn: false,
+        menu: false,
+        size: "small",
+        props: {
+          label: "title",
+          value: "value",
+          children: "children"
+        }
+      },
+    };
+  },
+  props: {
+    data: {
+      type: Array
+    },
+    detailData: {
+      type: Object
+    },
+    form: {
+      type: Object
+    }
+  },
+  components: {
+    partLibrary,
+    propertyDialog,
+    priceLibrary,
+    reportDialog
+  },
+  async created() {
+    this.tableOption = await this.getColumnData(
+      this.getColumnName(5),
+      tableOption
+    );
+    this.goodsOption = await this.getColumnData(
+      this.getColumnName(28),
+      goodsOption
+    );
+    this.getWorkDicts("Thread").then(res => {
+      this.ThreadList = res.data.data;
+    });
+    this.getWorkDicts("medium").then(res => {
+      this.mediumList = res.data.data;
+    });
+    this.getWorkDicts("property_color").then(res => {
+      this.colorList = res.data.data;
+    });
+    this.getWorkDicts("stencil").then(res => {
+      this.stencilList = res.data.data;
+    });
+    this.getWorkDicts("unit").then(res => {
+      this.findObject(this.tableOption.column, "unit").dicData = res.data.data;
+    });
+    getPricebank(1, 10, {
+      billType: "CG",
+      statusTime: dateFormat(new Date(), "yyyy-MM-dd")
+    }).then(res => {
+      if (res.data.data.total > 0) {
+        this.goodsoptions = res.data.data.records;
+        if (Math.ceil(res.data.data.total / 10) > 1) {
+          for (let i = 2; i <= Math.ceil(res.data.data.total / 10); i++) {
+            getPricebank(i, 10, {
+              billType: "CG",
+              statusTime: dateFormat(new Date(), "yyyy-MM-dd")
+            }).then(e => {
+              this.goodsoptions = this.goodsoptions.concat(e.data.data.records);
             });
-          },
-          addBtn: false,
-          menu: false,
-          size: "small",
-          props: {
-            label: "title",
-            value: "value",
-            children: "children"
           }
-        },
-      };
+        }
+      }
+    });
+  },
+  methods: {
+    cellStyle() {
+      return "padding:0;height:40px;";
     },
-    props: {
-      data: {
-        type: Array
-      },
-      detailData: {
-        type: Object
-      },
-      form: {
-        type: Object
+    goodsSelectionChange(list) {
+      this.orderItemIds = [];
+      list.map(e => {
+        this.orderItemIds.push(e.id);
+      });
+    },
+    pickGoods() {
+      // this.dialogVisible = !this.dialogVisible;
+      this.$refs.library.init(false);
+    },
+    nodeClick(data) {
+      this.treeDeptId = data.id;
+      this.page.currentPage = 1;
+      this.onLoad(this.page);
+    },
+    //费用查询
+    onLoad(page, params = {}) {
+      let obj = this.deepClone(Object.assign(params, this.search));
+      this.loading = true;
+      getGoods(page.currentPage, page.pageSize, this.treeDeptId, obj)
+        .then(res => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.goodsList = data.records;
+          if (this.page.total) {
+            this.goodsOption.height = window.innerHeight - 350;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    rowClick(row) {
+      this.$refs.goodsCrud.toggleSelection([this.goodsList[row.$index]]);
+    },
+    // importGoods() {
+    //     this.upDataOption()
+    //     this.selectionList.forEach(e => {
+    //         this.goodsForm.itemId = e.id;
+    //         this.goodsForm.ename = e.ename;
+    //         this.goodsForm.code = e.code;
+    //         this.goodsForm.cname = e.cname;
+    //         this.goodsForm.corpId = e.corpId;
+    //         this.goodsForm.corpName = e.corpCode;
+    //         this.goodsForm.priceCategory = e.goodsTypeName;
+    //         this.goodsForm.itemUrl = e.url;
+    //         this.goodsForm.itemProp = null;
+    //         this.goodsForm.remarksOne = null;
+    //         this.goodsForm.customTwo = null;
+    //         this.goodsForm.customThree = null;
+    //         this.goodsForm.customFour = null;
+    //         this.goodsForm.customFive = null;
+    //         this.goodsForm.customSix = null;
+    //         this.goodsForm.customSeven = null;
+    //         this.goodsForm.customEight = null;
+    //         this.goodsForm.customNine = null;
+    //         this.goodsForm.customTen = null;
+    //         this.goodsForm.itemDescription = e.cnameDescription;
+    //         this.goodsForm.partsList = [];
+    //         this.goodsForm.partsPrice = 0;
+    //         this.goodsForm.itemType = null;
+    //         this.goodsForm.tradeTerms = null;
+    //         this.goodsForm.purchaseCost = 0;
+    //         this.goodsForm.purchaseAmount = 0;
+    //         this.goodsForm.price = 0;
+    //         this.goodsForm.orderQuantity = 0;
+    //         this.goodsForm.insurance = 0;
+    //         this.goodsForm.freight = 0;
+    //         this.goodsForm.discount = null;
+    //         this.goodsForm.amount = 0;
+    //         this.goodsForm.taxRate = 0;
+    //         this.goodsForm.unit = e.unit;
+    //         this.goodsForm.itemMargin = 0;
+    //         this.goodsForm.remarks = null;
+    //         this.goodsForm.exchangeRate = this.form.exchangeRate;
+    //         this.goodsForm.partsDescribe = null;
+    //         this.goodsForm.productRemark = e.ename;
+    //         this.goodsForm.attributeList = this.getAttribute(e.goodsSpecificationList);
+    //     })
+    //     this.dialogVisible = false
+    // },
+    closeGoods() {
+      this.selectionList = [];
+      this.treeDeptId = "";
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    refreshTable() {
+      this.$refs.crud.refreshTable();
+    },
+    openpart(val, list) {
+      this.$refs.partLibrary.init(val, list)
+    },
+    addRow() {
+      if (!this.form.corpId) {
+        return this.$message.error("请选择客户名称");
       }
+      this.$refs.crud.rowAdd()
     },
-    components: {
-      partLibrary,
-      propertyDialog,
-      priceLibrary,
-      reportDialog
+    cnameChange(row) {
+      this.upDataOption()
+      this.goodsoptions.forEach(e => {
+        if (e.itemId == row.itemId) {
+          row.itemId = e.itemId;
+          row.code = e.code;
+          row.cname = e.cname;
+          row.ename = e.ename;
+          row.priceCategory = e.goodsTypeName;
+          row.purchaseCost = costCal(e.outFactoryPrice, e.taxRate);
+          row.purchaseAmount = e.purchaseAmount;
+          row.itemProp = null;
+          row.remarksOne = null;
+          row.customTwo = null;
+          row.customThree = null;
+          row.customFour = null;
+          row.customFive = null;
+          row.customSix = null;
+          row.customSeven = null;
+          row.customEight = null;
+          row.customNine = null;
+          row.customTen = null;
+          row.corpId = e.corpId;
+          row.corpName = e.corpCode;
+          row.itemDescription = e.cnameDescription;
+          row.partsPrice = 0;
+          row.itemType = e.specs;
+          row.tradeTerms = null;
+          row.productPrice = productCal(e.purchaseAmount, 0, this.form.coefficient);
+          row.outFactoryPrice = sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
+          row.shareAmount = 0;
+          row.totalValue = sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
+          row.orderQuantity = 1;
+          row.insurance = 0;
+          row.freight = 0;
+          row.discount = null;
+          row.price = sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
+          row.amount = sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
+          row.taxRate = 0;
+          row.unit = 'PCS';
+          row.itemMargin = grossProfitCal(e.purchaseAmount, 0, sellingCal(productCal(e.purchaseAmount, 0, this
+            .form.coefficient), this.form.exchangeRate), this.form.exchangeRate);
+          row.partsDescribe = null;
+          row.remarks = null;
+          row.exchangeRate = this.form.exchangeRate;
+          row.productRemark = e.ename;
+          row.attributeList = this.getAttribute(e.goodsSpecificationList)
+        }
+      })
     },
-    async created() {
-      this.tableOption = await this.getColumnData(
-        this.getColumnName(5),
-        tableOption
-      );
-      this.goodsOption = await this.getColumnData(
-        this.getColumnName(28),
-        goodsOption
-      );
-      this.getWorkDicts("Thread").then(res => {
-        this.ThreadList = res.data.data;
-      });
-      this.getWorkDicts("medium").then(res => {
-        this.mediumList = res.data.data;
-      });
-      this.getWorkDicts("property_color").then(res => {
-        this.colorList = res.data.data;
-      });
-      this.getWorkDicts("stencil").then(res => {
-        this.stencilList = res.data.data;
-      });
-      this.getWorkDicts("unit").then(res => {
-        this.findObject(this.tableOption.column, "unit").dicData = res.data.data;
+    importLibray(rows) {
+      this.upDataOption()
+      rows.forEach(e => {
+        this.goodsForm = {
+          itemId: e.itemId,
+          code: e.code,
+          cname: e.cname,
+          ename: e.ename,
+          priceCategory: e.goodsTypeName,
+          purchaseCost: costCal(e.outFactoryPrice, e.taxRate),
+          purchaseAmount: e.purchaseAmount,
+          itemProp: null,
+          remarksOne: null,
+          customTwo: null,
+          customThree: null,
+          customFour: null,
+          customFive: null,
+          customSix: null,
+          customSeven: null,
+          customEight: null,
+          customNine: null,
+          customTen: null,
+          corpId: e.corpId,
+          corpName: e.corpCode,
+          itemDescription: e.cnameDescription,
+          partsPrice: 0,
+          itemType: e.specs,
+          tradeTerms: null,
+          productPrice: productCal(e.purchaseAmount, 0, this.form.coefficient),
+          outFactoryPrice: sellingCal(
+            productCal(e.purchaseAmount, 0, this.form.coefficient),
+            this.form.exchangeRate
+          ),
+          shareAmount: 0,
+          totalValue: sellingCal(
+            productCal(e.purchaseAmount, 0, this.form.coefficient),
+            this.form.exchangeRate
+          ),
+          orderQuantity: 1,
+          insurance: 0,
+          freight: 0,
+          discount: null,
+          price: sellingCal(
+            productCal(e.purchaseAmount, 0, this.form.coefficient),
+            this.form.exchangeRate
+          ),
+          amount: sellingCal(
+            productCal(e.purchaseAmount, 0, this.form.coefficient),
+            this.form.exchangeRate
+          ),
+          taxRate: 0,
+          unit: 'PCS',
+          itemMargin: grossProfitCal(
+            e.purchaseAmount,
+            0,
+            sellingCal(
+              productCal(e.purchaseAmount, 0, this.form.coefficient),
+              this.form.exchangeRate
+            ),
+            this.form.exchangeRate
+          ),
+          partsDescribe: null,
+          remarks: null,
+          exchangeRate: this.form.exchangeRate,
+          productRemark: e.ename,
+          attributeList: this.getAttribute(e.goodsSpecificationList)
+        }
       });
-      getPricebank(1, 10, {
-        billType: "CG",
-        statusTime: dateFormat(new Date(), "yyyy-MM-dd")
-      }).then(res => {
+      this.$refs.crud.rowAdd()
+    },
+    openProperty(row) {
+      this.$refs.property.init(row);
+    },
+    addLibrary() {
+      if (!this.form.corpId) {
+        return this.$message.error("请选择客户名称");
+      }
+      if (!this.form.currency) {
+        return this.$message.error("请选择币别");
+      }
+      this.$refs.library.init(false);
+    },
+    openReport() {
+      this.switchDialog = !this.switchDialog;
+    },
+    onClose(val) {
+      this.switchDialog = val;
+    },
+    getInvoice() {
+      if (this.$store.getters.outStatus) {
+        this.$alert("出口发货单存在,请保存发货单再进行操作", "温馨提示", {
+          confirmButtonText: "确定",
+          type: "warning",
+          callback: action => {
+            console.log(action);
+          }
+        });
+      } else {
+        this.inInvoice();
+      }
+    },
+    cnameData() {
+      this.goodsoptions = []
+      getGoods(1, 10).then(res => {
         if (res.data.data.total > 0) {
           this.goodsoptions = res.data.data.records;
           if (Math.ceil(res.data.data.total / 10) > 1) {
             for (let i = 2; i <= Math.ceil(res.data.data.total / 10); i++) {
-              getPricebank(i, 10, {
-                billType: "CG",
-                statusTime: dateFormat(new Date(), "yyyy-MM-dd")
-              }).then(e => {
+              getGoods(i, 10).then(e => {
                 this.goodsoptions = this.goodsoptions.concat(e.data.data.records);
               });
             }
@@ -406,738 +679,507 @@
         }
       });
     },
-    methods: {
-      cellStyle() {
-        return "padding:0;height:40px;";
-      },
-      goodsSelectionChange(list) {
-        this.orderItemIds = [];
-        list.map(e => {
-          this.orderItemIds.push(e.id);
-        });
-      },
-      pickGoods() {
-        // this.dialogVisible = !this.dialogVisible;
-        this.$refs.library.init(false);
-      },
-      nodeClick(data) {
-        this.treeDeptId = data.id;
-        this.page.currentPage = 1;
-        this.onLoad(this.page);
-      },
-      //费用查询
-      onLoad(page, params = {}) {
-        let obj = this.deepClone(Object.assign(params, this.search));
-        this.loading = true;
-        getGoods(page.currentPage, page.pageSize, this.treeDeptId, obj)
-          .then(res => {
-            const data = res.data.data;
-            this.page.total = data.total;
-            this.goodsList = data.records;
-            if (this.page.total) {
-              this.goodsOption.height = window.innerHeight - 350;
-            }
-          })
-          .finally(() => {
-            this.loading = false;
-          });
-      },
-      rowClick(row) {
-        this.$refs.goodsCrud.toggleSelection([this.goodsList[row.$index]]);
-      },
-      // importGoods() {
-      //     this.upDataOption()
-      //     this.selectionList.forEach(e => {
-      //         this.goodsForm.itemId = e.id;
-      //         this.goodsForm.ename = e.ename;
-      //         this.goodsForm.code = e.code;
-      //         this.goodsForm.cname = e.cname;
-      //         this.goodsForm.corpId = e.corpId;
-      //         this.goodsForm.corpName = e.corpCode;
-      //         this.goodsForm.priceCategory = e.goodsTypeName;
-      //         this.goodsForm.itemUrl = e.url;
-      //         this.goodsForm.itemProp = null;
-      //         this.goodsForm.remarksOne = null;
-      //         this.goodsForm.customTwo = null;
-      //         this.goodsForm.customThree = null;
-      //         this.goodsForm.customFour = null;
-      //         this.goodsForm.customFive = null;
-      //         this.goodsForm.customSix = null;
-      //         this.goodsForm.customSeven = null;
-      //         this.goodsForm.customEight = null;
-      //         this.goodsForm.customNine = null;
-      //         this.goodsForm.customTen = null;
-      //         this.goodsForm.itemDescription = e.cnameDescription;
-      //         this.goodsForm.partsList = [];
-      //         this.goodsForm.partsPrice = 0;
-      //         this.goodsForm.itemType = null;
-      //         this.goodsForm.tradeTerms = null;
-      //         this.goodsForm.purchaseCost = 0;
-      //         this.goodsForm.purchaseAmount = 0;
-      //         this.goodsForm.price = 0;
-      //         this.goodsForm.orderQuantity = 0;
-      //         this.goodsForm.insurance = 0;
-      //         this.goodsForm.freight = 0;
-      //         this.goodsForm.discount = null;
-      //         this.goodsForm.amount = 0;
-      //         this.goodsForm.taxRate = 0;
-      //         this.goodsForm.unit = e.unit;
-      //         this.goodsForm.itemMargin = 0;
-      //         this.goodsForm.remarks = null;
-      //         this.goodsForm.exchangeRate = this.form.exchangeRate;
-      //         this.goodsForm.partsDescribe = null;
-      //         this.goodsForm.productRemark = e.ename;
-      //         this.goodsForm.attributeList = this.getAttribute(e.goodsSpecificationList);
-      //     })
-      //     this.dialogVisible = false
-      // },
-      closeGoods() {
-        this.selectionList = [];
-        this.treeDeptId = "";
-      },
-      selectionChange(list) {
-        this.selectionList = list;
-      },
-      refreshTable() {
-        this.$refs.crud.refreshTable();
-      },
-      openpart(val, list) {
-        this.$refs.partLibrary.init(val, list)
-      },
-      addRow() {
-        if (!this.form.corpId) {
-          return this.$message.error("请选择客户名称");
-        }
-        this.$refs.crud.rowAdd()
-      },
-      cnameChange(row) {
-        this.upDataOption()
-        this.goodsoptions.forEach(e => {
-          if (e.itemId == row.itemId) {
-            row.itemId = e.itemId;
-            row.code = e.code;
-            row.cname = e.cname;
-            row.ename = e.ename;
-            row.priceCategory = e.goodsTypeName;
-            row.purchaseCost = costCal(e.price, e.taxRate);
-            row.purchaseAmount = e.purchaseAmount;
-            row.itemProp = null;
-            row.remarksOne = null;
-            row.customTwo = null;
-            row.customThree = null;
-            row.customFour = null;
-            row.customFive = null;
-            row.customSix = null;
-            row.customSeven = null;
-            row.customEight = null;
-            row.customNine = null;
-            row.customTen = null;
-            row.corpId = e.corpId;
-            row.corpName = e.corpCode;
-            row.itemDescription = e.cnameDescription;
-            row.partsPrice = 0;
-            row.itemType = e.specs;
-            row.tradeTerms = null;
-            row.productPrice = productCal(e.purchaseAmount, 0, this.form.coefficient);
-            row.price = sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
-            row.orderQuantity = 1;
-            row.insurance = 0;
-            row.freight = 0;
-            row.discount = null;
-            row.amount = sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
-            row.taxRate = 0;
-            row.unit = 'PCS';
-            row.itemMargin = grossProfitCal(e.purchaseAmount, 0, sellingCal(productCal(e.purchaseAmount, 0, this
-              .form.coefficient), this.form.exchangeRate), this.form.exchangeRate);
-            row.partsDescribe = null;
-            row.remarks = null;
-            row.exchangeRate = this.form.exchangeRate;
-            row.productRemark = e.ename;
-            row.attributeList = this.getAttribute(e.goodsSpecificationList)
-          }
-        })
-      },
-      importLibray(rows) {
-        this.upDataOption()
-        rows.forEach(e => {
-          this.goodsForm = {
-            itemId: e.itemId,
-            code: e.code,
-            cname: e.cname,
-            ename: e.ename,
-            priceCategory: e.goodsTypeName,
-            purchaseCost: costCal(e.price, e.taxRate),
-            purchaseAmount: e.purchaseAmount,
-            itemProp: null,
-            remarksOne: null,
-            customTwo: null,
-            customThree: null,
-            customFour: null,
-            customFive: null,
-            customSix: null,
-            customSeven: null,
-            customEight: null,
-            customNine: null,
-            customTen: null,
-            corpId: e.corpId,
-            corpName: e.corpCode,
-            itemDescription: e.cnameDescription,
-            partsPrice: 0,
-            itemType: e.specs,
-            tradeTerms: null,
-            productPrice: productCal(e.purchaseAmount, 0, this.form.coefficient),
-            price: sellingCal(
-              productCal(e.purchaseAmount, 0, this.form.coefficient),
-              this.form.exchangeRate
-            ),
-            orderQuantity: 1,
-            insurance: 0,
-            freight: 0,
-            discount: null,
-            amount: sellingCal(
-              productCal(e.purchaseAmount, 0, this.form.coefficient),
-              this.form.exchangeRate
-            ),
-            taxRate: 0,
-            unit: 'PCS',
-            itemMargin: grossProfitCal(
-              e.purchaseAmount,
-              0,
-              sellingCal(
-                productCal(e.purchaseAmount, 0, this.form.coefficient),
-                this.form.exchangeRate
-              ),
-              this.form.exchangeRate
-            ),
-            partsDescribe: null,
-            remarks: null,
-            exchangeRate: this.form.exchangeRate,
-            productRemark: e.ename,
-            attributeList: this.getAttribute(e.goodsSpecificationList)
-          }
-        });
-        this.$refs.crud.rowAdd()
-      },
-      openProperty(row) {
-        this.$refs.property.init(row);
-      },
-      addLibrary() {
-        if (!this.form.corpId) {
-          return this.$message.error("请选择客户名称");
-        }
-        if (!this.form.currency) {
-          return this.$message.error("请选择币别");
-        }
-        this.$refs.library.init(false);
-      },
-      openReport() {
-        this.switchDialog = !this.switchDialog;
-      },
-      onClose(val) {
-        this.switchDialog = val;
-      },
-      getInvoice() {
-        if (this.$store.getters.outStatus) {
-          this.$alert("出口发货单存在,请保存发货单再进行操作", "温馨提示", {
-            confirmButtonText: "确定",
-            type: "warning",
-            callback: action => {
-              console.log(action);
-            }
-          });
-        } else {
-          this.inInvoice();
-        }
-      },
-      cnameData() {
-        this.goodsoptions = []
-        getGoods(1, 10).then(res => {
-          if (res.data.data.total > 0) {
-            this.goodsoptions = res.data.data.records;
-            if (Math.ceil(res.data.data.total / 10) > 1) {
-              for (let i = 2; i <= Math.ceil(res.data.data.total / 10); i++) {
-                getGoods(i, 10).then(e => {
-                  this.goodsoptions = this.goodsoptions.concat(e.data.data.records);
+    calculate() {
+      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)
+      })
+      calculationDomesticFees({ ...this.form, orderItemsList: this.data, }).then(res => {
+                this.$confirm("总费用为:"+res.data.data.amount+",单项运费为" + res.data.data.amountF + ",是否继续更新?", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning"
+                }).then(() => {
+                    this.data.forEach(e => {
+                        e.shareAmount =multiply(res.data.data.amountF,e.outFactoryPrice) 
+                        e.price = addPrice(e.outFactoryPrice, multiply(res.data.data.amountF,e.outFactoryPrice))
+                        e.amount = amountCal(
+                            addPrice(e.outFactoryPrice, res.data.data.amountF),
+                            e.orderQuantity,
+                            e.freight,
+                            e.insurance,
+                            e.discount
+                        );
+                        e.itemMargin = grossProfitCal(
+                            e.purchaseAmount,
+                            e.partsPrice,
+                            e.outFactoryPrice,
+                            this.form.exchangeRate
+                        );
+                    })
                 });
-              }
-            }
-          }
-        });
-      },
-      khEdit(status) {
-        if (status == 'cname') {
-          this.$router.push({
-            path: '/basicData/commodityType/index'
-          })
-        }
-      },
-      rowCell(row, index) {
-        this.getAttribute(JSON.parse(row.attributeList))
-        this.$refs.crud.rowEdit(row, index)
-      },
-      rowDel(row) {
-        this.$confirm("确定删除数据?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          if (row.id) {
-            delItem(row.id).then(res => {
-              this.$message({
-                type: "success",
-                message: "删除成功!"
-              });
-              this.data.splice(row.$index, 1);
-            });
-          } else {
+            })
+    },
+    khEdit(status) {
+      if (status == 'cname') {
+        this.$router.push({
+          path: '/basicData/commodityType/index'
+        })
+      }
+    },
+    rowCell(row, index) {
+      this.getAttribute(JSON.parse(row.attributeList))
+      this.$refs.crud.rowEdit(row, index)
+    },
+    rowDel(row) {
+      this.$confirm("确定删除数据?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        if (row.id) {
+          delItem(row.id).then(res => {
             this.$message({
               type: "success",
               message: "删除成功!"
             });
             this.data.splice(row.$index, 1);
-          }
-        });
-      },
-      moveUp(row, index) {
-        this.data[index] = this.data.splice(index - 1, 1, row)[0]
-      },
-      moveDown(row, index) {
-        this.data[index] = this.data.splice(index + 1, 1, row)[0]
-      },
-      transition(rows) {
-        let data = []
-        rows.forEach(e => {
-          data.push({
-            goodId: e.itemId,
-            goodTypeId: e.goodTypeId,
-            goodTypeName: e.goodsTypeName,
-            ename: e.ename,
-            corpId: e.corpId,
-            corpName: e.corpName,
-            goodName: e.cname,
-            price: e.purchaseAmount,
-            goodNumber: 1,
-            amout: e.purchaseAmount,
-            partsCost: costCal(e.price, e.taxRate),
-            $cellEdit: true
-          })
-        })
-        return data
-      },
-      purchaseAmountChange(row) {
-        row.productPrice = productCal(
-          row.purchaseAmount,
-          row.partsPrice,
-          this.form.coefficient
-        );
-        row.price = sellingCal(row.productPrice, this.form.exchangeRate);
-        row.amount = amountCal(
-          row.price,
-          row.orderQuantity,
-          row.freight,
-          row.insurance,
-          row.discount
-        );
-        row.itemMargin = grossProfitCal(
-          row.purchaseAmount,
-          row.partsPrice,
-          row.price,
-          this.form.exchangeRate
-        );
-      },
-      priceChange(row) {
-        row.amount = amountCal(
-          row.price,
-          row.orderQuantity,
-          row.freight,
-          row.insurance,
-          row.discount
-        );
-        row.itemMargin = grossProfitCal(
-          row.purchaseAmount,
-          row.partsPrice,
-          row.price,
-          this.form.exchangeRate
-        );
-      },
-      itemTypeFocus(row) {
-        this.itemtypeList = [];
-        getSpecification({
-          goodId: row.itemId
-        }).then(res => {
-          const data = res.data.data;
-          this.itemtypeList = data.map(item => ({
-            value: item
-          }));
-        });
-      },
-      getAttribute(rows) {
-        let data = []
-        rows.forEach(e => {
-          if (e.attributeNo == 'Thread' && e.status == 0) {
-            this.findObject(this.tableOption.column, "remarksOne").disabled = false;
-          }
-          if (e.attributeNo == 'medium' && e.status == 0) {
-            this.findObject(this.tableOption.column, "customTwo").disabled = false;
-          }
-          if (e.attributeNo == 'property_color' && e.status == 0) {
-            this.findObject(this.tableOption.column, "customThree").disabled = false;
-          }
-          if (e.attributeNo == 'stencil' && e.status == 0) {
-            this.findObject(this.tableOption.column, "customFour").disabled = false;
-          }
-          if (e.attributeName == '阀门配件' && e.status == 0) {
-            this.findObject(this.tableOption.column, "partsValveName").disabled = false;
-          }
-          if (e.attributeName == '瓶帽配件' && e.status == 0) {
-            this.findObject(this.tableOption.column, "partsCapName").disabled = false;
-          }
-          if (e.attributeName == '特殊处理' && e.status == 0) {
-            this.findObject(this.tableOption.column, "partsHandleName").disabled = false;
-          }
-          if (e.attributeName == '包装方式' && e.status == 0) {
-            this.findObject(this.tableOption.column, "partsColourName").disabled = false;
-          }
-          if (e.attributeName == '特殊颜色' && e.status == 0) {
-            this.findObject(this.tableOption.column, "partsModeName").disabled = false;
-          }
-          if (e.attributeName == '认证' && e.status == 0) {
-            this.findObject(this.tableOption.column, "partsAuthenticationName").disabled = false;
-          }
-          if (e.attributeName == '其他' && e.status == 0) {
-            this.findObject(this.tableOption.column, "partsOtherName").disabled = false;
-          }
-          data.push({
-            type: e.type,
-            attributeName: e.attributeName,
-            attributeNo: e.attributeNo,
-            status: e.status,
-          })
-        })
-        return JSON.stringify(data);
-      },
-      // importProperty(row) {
-      //     const arr = [];
-      //     for (let key in row) {
-      //         if (row[key]) {
-      //             arr.push(row[key]);
-      //         }
-      //     }
-      //     this.goodsForm.itemProp = arr.join(" ");
-      //     this.goodsForm.remarksOne = row.remarksOne;
-      //     this.goodsForm.customTwo = row.customTwo;
-      //     this.goodsForm.customThree = row.customThree;
-      //     this.goodsForm.customFour = row.customFour;
-      //     this.goodsForm.customFive = row.customFive;
-      //     this.goodsForm.customSix = row.customSix;
-      //     this.goodsForm.customSeven = row.customSeven;
-      //     this.goodsForm.customEight = row.customEight;
-      //     this.goodsForm.customNine = row.customNine;
-      //     this.goodsForm.customTen = row.customTen;
-      //     this.goodsForm.productRemark = this.getproductRemark(this.goodsForm)
-      // },
-      importPart(rows, type) {
-        if (type == 0) {
-          this.goodsForm.partsValveCostPrice = 0
-          this.goodsForm.partsValveSalePrice = 0
-          let names = []
-          rows.forEach(e => {
-            names.push(e.goodName)
-            this.goodsForm.partsValveCostPrice = sum(this.goodsForm.partsValveCostPrice, multiply(e.partsCost, e
-              .goodNumber));
-            this.goodsForm.partsValveSalePrice = sum(this.goodsForm.partsValveSalePrice, e.amout);
-          })
-          this.goodsForm.partsValveName = names.join(" ")
-          this.goodsForm.partsValveValue = JSON.stringify(rows)
+          });
+        } else {
+          this.$message({
+            type: "success",
+            message: "删除成功!"
+          });
+          this.data.splice(row.$index, 1);
         }
-        if (type == 1) {
-          this.goodsForm.partsCapCostPrice = 0
-          this.goodsForm.partsCapSalePrice = 0
-          let names = []
-          rows.forEach(e => {
-            names.push(e.goodName)
-            this.goodsForm.partsCapCostPrice = sum(this.goodsForm.partsCapCostPrice, multiply(e.partsCost, e
-              .goodNumber));
-            this.goodsForm.partsCapSalePrice = sum(this.goodsForm.partsCapSalePrice, e.amout);
-          })
-          this.goodsForm.partsCapName = names.join(" ")
-          this.goodsForm.partsCapValue = JSON.stringify(rows)
+      });
+    },
+    moveUp(row, index) {
+      this.data[index] = this.data.splice(index - 1, 1, row)[0]
+    },
+    moveDown(row, index) {
+      this.data[index] = this.data.splice(index + 1, 1, row)[0]
+    },
+    purchaseAmountChange(row) {
+      row.productPrice = productCal(
+        row.purchaseAmount,
+        row.partsPrice,
+        this.form.coefficient
+      );
+      row.outFactoryPrice = sellingCal(row.productPrice, this.form.exchangeRate);
+      row.totalValue = multiply(row.outFactoryPrice, row.orderQuantity)
+      row.price = addPrice(
+        row.outFactoryPrice,
+        row.shareAmount
+      );
+      row.amount = amountCal(
+        row.price,
+        row.orderQuantity,
+        row.freight,
+        row.insurance,
+        row.discount
+      );
+      row.itemMargin = grossProfitCal(
+        row.purchaseAmount,
+        row.partsPrice,
+        row.outFactoryPrice,
+        this.form.exchangeRate
+      );
+    },
+    priceChange(row) {
+      row.totalValue = multiply(row.outFactoryPrice, row.orderQuantity)
+      row.price = addPrice(row.outFactoryPrice, row.shareAmount)
+      row.amount = amountCal(
+        addPrice(row.outFactoryPrice, row.shareAmount),
+        row.orderQuantity,
+        row.freight,
+        row.insurance,
+        row.discount
+      );
+      row.itemMargin = grossProfitCal(
+        row.purchaseAmount,
+        row.partsPrice,
+        row.outFactoryPrice,
+        this.form.exchangeRate
+      );
+    },
+    itemTypeFocus(row) {
+      this.itemtypeList = [];
+      getSpecification({
+        goodId: row.itemId
+      }).then(res => {
+        const data = res.data.data;
+        this.itemtypeList = data.map(item => ({
+          value: item
+        }));
+      });
+    },
+    getAttribute(rows) {
+      let data = []
+      rows.forEach(e => {
+        if (e.attributeNo == 'Thread' && e.status == 0) {
+          this.findObject(this.tableOption.column, "remarksOne").disabled = false;
         }
-        if (type == 2) {
-          this.goodsForm.partsHandleCostPrice = 0
-          this.goodsForm.partsHandleSalePrice = 0
-          let names = []
-          rows.forEach(e => {
-            names.push(e.goodName)
-            this.goodsForm.partsHandleCostPrice = sum(this.goodsForm.partsHandleCostPrice, multiply(e.partsCost, e
-              .goodNumber));
-            this.goodsForm.partsHandleSalePrice = sum(this.goodsForm.partsHandleSalePrice, e.amout);
-          })
-          this.goodsForm.partsHandleName = names.join(" ")
-          this.goodsForm.partsHandleValue = JSON.stringify(rows)
+        if (e.attributeNo == 'medium' && e.status == 0) {
+          this.findObject(this.tableOption.column, "customTwo").disabled = false;
         }
-        if (type == 3) {
-          this.goodsForm.partsColourCostPrice = 0
-          this.goodsForm.partsColourSalePrice = 0
-          let names = []
-          rows.forEach(e => {
-            names.push(e.goodName)
-            this.goodsForm.partsColourCostPrice = sum(this.goodsForm.partsColourCostPrice, multiply(e.partsCost, e
-              .goodNumber));
-            this.goodsForm.partsColourSalePrice = sum(this.goodsForm.partsColourSalePrice, e.amout);
-          })
-          this.goodsForm.partsColourName = names.join(" ")
-          this.goodsForm.partsColourValue = JSON.stringify(rows)
+        if (e.attributeNo == 'property_color' && e.status == 0) {
+          this.findObject(this.tableOption.column, "customThree").disabled = false;
         }
-        if (type == 4) {
-          this.goodsForm.partsModeCostPrice = 0
-          this.goodsForm.partsModeSalePrice = 0
-          let names = []
-          rows.forEach(e => {
-            names.push(e.goodName)
-            this.goodsForm.partsModeCostPrice = sum(this.goodsForm.partsModeCostPrice, multiply(e.partsCost, e
-              .goodNumber));
-            this.goodsForm.partsModeSalePrice = sum(this.goodsForm.partsModeSalePrice, e.amout);
-          })
-          this.goodsForm.partsModeName = names.join(" ")
-          this.goodsForm.partsModeValue = JSON.stringify(rows)
+        if (e.attributeNo == 'stencil' && e.status == 0) {
+          this.findObject(this.tableOption.column, "customFour").disabled = false;
         }
-        if (type == 5) {
-          this.goodsForm.partsAuthenticationCostPrice = 0
-          this.goodsForm.partsAuthenticationSalePrice = 0
-          let names = []
-          rows.forEach(e => {
-            names.push(e.goodName)
-            this.goodsForm.partsAuthenticationCostPrice = sum(this.goodsForm.partsAuthenticationCostPrice, multiply(
-              e.partsCost, e.goodNumber));
-            this.goodsForm.partsAuthenticationSalePrice = sum(this.goodsForm.partsAuthenticationSalePrice, e.amout);
-          })
-          this.goodsForm.partsAuthenticationName = names.join(" ")
-          this.goodsForm.partsAuthenticationValue = JSON.stringify(rows)
+        if (e.attributeName == '阀门配件' && e.status == 0) {
+          this.findObject(this.tableOption.column, "partsValveName").disabled = false;
         }
-        if (type == 6) {
-          this.goodsForm.partsOtherCostPrice = 0
-          this.goodsForm.partsOtherSalePrice = 0
-          let names = []
-          rows.forEach(e => {
-            names.push(e.goodName)
-            this.goodsForm.partsOtherCostPrice = sum(this.goodsForm.partsOtherCostPrice, multiply(e.partsCost, e
-              .goodNumber));
-            this.goodsForm.partsOtherSalePrice = sum(this.goodsForm.partsOtherSalePrice, e.amout);
-          })
-          this.goodsForm.partsOtherName = names.join(" ")
-          this.goodsForm.partsOtherValue = JSON.stringify(rows)
+        if (e.attributeName == '瓶帽配件' && e.status == 0) {
+          this.findObject(this.tableOption.column, "partsCapName").disabled = false;
         }
-        this.goodsForm.partsCost = partSum(this.goodsForm.partsValveCostPrice, this.goodsForm.partsCapCostPrice, this
-          .goodsForm.partsHandleCostPrice, this.goodsForm.partsColourCostPrice, this.goodsForm.partsModeCostPrice,
-          this.goodsForm.partsAuthenticationCostPrice, this.goodsForm.partsOtherCostPrice)
-        this.goodsForm.partsPrice = partSum(this.goodsForm.partsValveSalePrice, this.goodsForm.partsCapSalePrice, this
-          .goodsForm.partsHandleSalePrice, this.goodsForm.partsColourSalePrice, this.goodsForm.partsModeSalePrice,
-          this.goodsForm.partsAuthenticationSalePrice, this.goodsForm.partsOtherSalePrice)
-        // 销售价=(配件采购价格+产品价格)/汇率 *(1+客户FOB系数/100)
-        this.goodsForm.productPrice = productCal(
-          this.goodsForm.purchaseAmount,
-          this.goodsForm.partsPrice,
-          this.form.coefficient
-        );
-        this.goodsForm.price = sellingCal(
-          this.goodsForm.productPrice,
-          this.form.exchangeRate
-        );
-        this.goodsForm.amount = amountCal(
-          this.goodsForm.price,
-          this.goodsForm.orderQuantity,
-          this.goodsForm.freight,
-          this.goodsForm.insurance,
-          this.goodsForm.discount
-        );
-        this.goodsForm.itemMargin = grossProfitCal(
-          this.goodsForm.purchaseAmount,
-          this.goodsForm.partsPrice,
-          this.goodsForm.price,
-          this.form.exchangeRate
-        );
-        const names = [this.goodsForm.partsValveName, this.goodsForm.partsCapName, this.goodsForm.partsHandleName, this
-          .goodsForm.partsColourName, this.goodsForm.partsModeName, this.goodsForm.partsAuthenticationName, this
-          .goodsForm.partsOtherName
-        ];
-        const name = []
-        names.forEach(e => {
-          if (e) {
-            name.push(e)
-          }
-        })
-        this.goodsForm.partsDescribe = name.join(" ");
-        // this.data[index].partsPriceDescribe = namePrices.join(";");
-        this.goodsForm.productRemark = this.getproductRemark(this.goodsForm)
-        this.priceChange(this.goodsForm);
-      },
-      propsChange(row) {
-        const data = {
-          remarksOne: row.remarksOne,
-          customTwo: row.customTwo,
-          customThree: row.customThree,
-          customFour: row.customFour,
-          customFive: row.customFive,
-          customSix: row.customSix,
-          customSeven: row.customSeven,
-          customEight: row.customEight,
-          customNine: row.customNine,
-          customTen: row.customTen,
-        };
-        const arr = []
-        for (let key in data) {
-          if (row[key]) {
-            arr.push(row[key]);
-          }
+        if (e.attributeName == '特殊处理' && e.status == 0) {
+          this.findObject(this.tableOption.column, "partsHandleName").disabled = false;
         }
-        this.goodsForm.itemProp = arr.join(' ')
-      },
-      editChange(row) {
-        row.productRemark = this.getproductRemark(row)
-      },
-      getproductRemark(row) {
-        console.log(row)
-        const ename = row.ename ? row.ename : "";
-        const itemDescription = row.itemDescription ?
-          row.itemDescription :
-          "";
-        const itemProp = row.itemProp ? row.itemProp : "";
-        const partsDescribe = row.partsDescribe ? (' ' + row.partsDescribe) : "";
-        const productRemark =
-          ename +
-          "\n" +
-          itemProp +
-          " " +
-          itemDescription +
-          " " +
-          partsDescribe;
-        return productRemark
-      },
-      beforeClose(done) {
-        this.upDataOption()
-        done();
-      },
-      upDataOption() {
-        this.findObject(this.tableOption.column, "remarksOne").disabled = true;
-        this.findObject(this.tableOption.column, "customTwo").disabled = true;
-        this.findObject(this.tableOption.column, "customThree").disabled = true;
-        this.findObject(this.tableOption.column, "customFour").disabled = true;
-        this.findObject(this.tableOption.column, "partsValveName").disabled = true;
-        this.findObject(this.tableOption.column, "partsCapName").disabled = true;
-        this.findObject(this.tableOption.column, "partsHandleName").disabled = true;
-        this.findObject(this.tableOption.column, "partsColourName").disabled = true;
-        this.findObject(this.tableOption.column, "partsModeName").disabled = true;
-        this.findObject(this.tableOption.column, "partsAuthenticationName").disabled = true;
-        this.findObject(this.tableOption.column, "partsOtherName").disabled = true;
-      },
-      discountChange(row) {
-        if (row.discount >= 10) {
-          row.discount = null;
-          this.$message.error("请正确输入折扣");
+        if (e.attributeName == '包装方式' && e.status == 0) {
+          this.findObject(this.tableOption.column, "partsColourName").disabled = false;
         }
-        this.priceChange(row);
-      },
-      taxRateChange(row) {
-        if (row.taxRate > 100) {
-          row.taxRate = 0;
-          this.$message.error("请正确输入税率");
+        if (e.attributeName == '特殊颜色' && e.status == 0) {
+          this.findObject(this.tableOption.column, "partsModeName").disabled = false;
         }
-      },
-      handleRowSave(row, done, loading) {
-        this.data.push(row)
-        loading()
-        done()
-      },
-      handleRowUpdate(row, index, done, loading) {
-        this.data[index] = row
-        // this.$refs.crud.rowUpdate()
-        loading()
-        done()
-      },
-      async saveColumn() {
-        const inSave = await this.saveColumnData(
-          this.getColumnName(5),
-          this.tableOption
-        );
-        if (inSave) {
-          this.$nextTick(() => {
-            this.$refs.crud.doLayout();
-          });
-          this.getWorkDicts("cargo_type").then(res => {
-            this.findObject(this.tableOption.column, "cargoType").dicData =
-              res.data.data;
-          });
-          this.$message.success("保存成功");
-          //关闭窗口
-          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        if (e.attributeName == '认证' && e.status == 0) {
+          this.findObject(this.tableOption.column, "partsAuthenticationName").disabled = false;
         }
-      },
-      async resetColumn() {
-        this.tableOption = tableOption;
-        const inSave = await this.delColumnData(
-          this.getColumnName(5),
-          tableOption
-        );
-        if (inSave) {
-          this.$nextTick(() => {
-            this.$refs.crud.doLayout();
-          });
-          this.$message.success("重置成功");
-          //关闭窗口
-          setTimeout(() => {
-            this.$refs.crud.$refs.dialogColumn.columnBox = false;
-          }, 1000);
+        if (e.attributeName == '其他' && e.status == 0) {
+          this.findObject(this.tableOption.column, "partsOtherName").disabled = false;
         }
-      },
-      async saveGoodsColumn() {
-        const inSave = await this.saveColumnData(
-          this.getColumnName(28),
-          this.goodsOption
-        );
-        if (inSave) {
-          this.$nextTick(() => {
-            this.$refs.goodsCrud.doLayout();
-          });
-          this.$message.success("保存成功");
-          //关闭窗口
-          this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
+        data.push({
+          type: e.type,
+          attributeName: e.attributeName,
+          attributeNo: e.attributeNo,
+          status: e.status,
+        })
+      })
+      return JSON.stringify(data);
+    },
+    // importProperty(row) {
+    //     const arr = [];
+    //     for (let key in row) {
+    //         if (row[key]) {
+    //             arr.push(row[key]);
+    //         }
+    //     }
+    //     this.goodsForm.itemProp = arr.join(" ");
+    //     this.goodsForm.remarksOne = row.remarksOne;
+    //     this.goodsForm.customTwo = row.customTwo;
+    //     this.goodsForm.customThree = row.customThree;
+    //     this.goodsForm.customFour = row.customFour;
+    //     this.goodsForm.customFive = row.customFive;
+    //     this.goodsForm.customSix = row.customSix;
+    //     this.goodsForm.customSeven = row.customSeven;
+    //     this.goodsForm.customEight = row.customEight;
+    //     this.goodsForm.customNine = row.customNine;
+    //     this.goodsForm.customTen = row.customTen;
+    //     this.goodsForm.productRemark = this.getproductRemark(this.goodsForm)
+    // },
+    importPart(rows, type) {
+      if (type == 0) {
+        this.goodsForm.partsValveCostPrice = 0
+        this.goodsForm.partsValveSalePrice = 0
+        let names = []
+        rows.forEach(e => {
+          names.push(e.goodName)
+          this.goodsForm.partsValveCostPrice = sum(this.goodsForm.partsValveCostPrice, multiply(e.partsCost, e
+            .goodNumber));
+          this.goodsForm.partsValveSalePrice = sum(this.goodsForm.partsValveSalePrice, e.amout);
+        })
+        this.goodsForm.partsValveName = names.join(" ")
+        this.goodsForm.partsValveValue = JSON.stringify(rows)
+      }
+      if (type == 1) {
+        this.goodsForm.partsCapCostPrice = 0
+        this.goodsForm.partsCapSalePrice = 0
+        let names = []
+        rows.forEach(e => {
+          names.push(e.goodName)
+          this.goodsForm.partsCapCostPrice = sum(this.goodsForm.partsCapCostPrice, multiply(e.partsCost, e
+            .goodNumber));
+          this.goodsForm.partsCapSalePrice = sum(this.goodsForm.partsCapSalePrice, e.amout);
+        })
+        this.goodsForm.partsCapName = names.join(" ")
+        this.goodsForm.partsCapValue = JSON.stringify(rows)
+      }
+      if (type == 2) {
+        this.goodsForm.partsHandleCostPrice = 0
+        this.goodsForm.partsHandleSalePrice = 0
+        let names = []
+        rows.forEach(e => {
+          names.push(e.goodName)
+          this.goodsForm.partsHandleCostPrice = sum(this.goodsForm.partsHandleCostPrice, multiply(e.partsCost, e
+            .goodNumber));
+          this.goodsForm.partsHandleSalePrice = sum(this.goodsForm.partsHandleSalePrice, e.amout);
+        })
+        this.goodsForm.partsHandleName = names.join(" ")
+        this.goodsForm.partsHandleValue = JSON.stringify(rows)
+      }
+      if (type == 3) {
+        this.goodsForm.partsColourCostPrice = 0
+        this.goodsForm.partsColourSalePrice = 0
+        let names = []
+        rows.forEach(e => {
+          names.push(e.goodName)
+          this.goodsForm.partsColourCostPrice = sum(this.goodsForm.partsColourCostPrice, multiply(e.partsCost, e
+            .goodNumber));
+          this.goodsForm.partsColourSalePrice = sum(this.goodsForm.partsColourSalePrice, e.amout);
+        })
+        this.goodsForm.partsColourName = names.join(" ")
+        this.goodsForm.partsColourValue = JSON.stringify(rows)
+      }
+      if (type == 4) {
+        this.goodsForm.partsModeCostPrice = 0
+        this.goodsForm.partsModeSalePrice = 0
+        let names = []
+        rows.forEach(e => {
+          names.push(e.goodName)
+          this.goodsForm.partsModeCostPrice = sum(this.goodsForm.partsModeCostPrice, multiply(e.partsCost, e
+            .goodNumber));
+          this.goodsForm.partsModeSalePrice = sum(this.goodsForm.partsModeSalePrice, e.amout);
+        })
+        this.goodsForm.partsModeName = names.join(" ")
+        this.goodsForm.partsModeValue = JSON.stringify(rows)
+      }
+      if (type == 5) {
+        this.goodsForm.partsAuthenticationCostPrice = 0
+        this.goodsForm.partsAuthenticationSalePrice = 0
+        let names = []
+        rows.forEach(e => {
+          names.push(e.goodName)
+          this.goodsForm.partsAuthenticationCostPrice = sum(this.goodsForm.partsAuthenticationCostPrice, multiply(
+            e.partsCost, e.goodNumber));
+          this.goodsForm.partsAuthenticationSalePrice = sum(this.goodsForm.partsAuthenticationSalePrice, e.amout);
+        })
+        this.goodsForm.partsAuthenticationName = names.join(" ")
+        this.goodsForm.partsAuthenticationValue = JSON.stringify(rows)
+      }
+      if (type == 6) {
+        this.goodsForm.partsOtherCostPrice = 0
+        this.goodsForm.partsOtherSalePrice = 0
+        let names = []
+        rows.forEach(e => {
+          names.push(e.goodName)
+          this.goodsForm.partsOtherCostPrice = sum(this.goodsForm.partsOtherCostPrice, multiply(e.partsCost, e
+            .goodNumber));
+          this.goodsForm.partsOtherSalePrice = sum(this.goodsForm.partsOtherSalePrice, e.amout);
+        })
+        this.goodsForm.partsOtherName = names.join(" ")
+        this.goodsForm.partsOtherValue = JSON.stringify(rows)
+      }
+      this.goodsForm.partsCost = partSum(this.goodsForm.partsValveCostPrice, this.goodsForm.partsCapCostPrice, this
+        .goodsForm.partsHandleCostPrice, this.goodsForm.partsColourCostPrice, this.goodsForm.partsModeCostPrice,
+        this.goodsForm.partsAuthenticationCostPrice, this.goodsForm.partsOtherCostPrice)
+      this.goodsForm.partsPrice = partSum(this.goodsForm.partsValveSalePrice, this.goodsForm.partsCapSalePrice, this
+        .goodsForm.partsHandleSalePrice, this.goodsForm.partsColourSalePrice, this.goodsForm.partsModeSalePrice,
+        this.goodsForm.partsAuthenticationSalePrice, this.goodsForm.partsOtherSalePrice)
+      // 销售价=(配件采购价格+产品价格)/汇率 *(1+客户FOB系数/100)
+      this.goodsForm.productPrice = productCal(
+        this.goodsForm.purchaseAmount,
+        this.goodsForm.partsPrice,
+        this.form.coefficient
+      );
+      this.goodsForm.outFactoryPrice = sellingCal(
+        this.goodsForm.productPrice,
+        this.form.exchangeRate
+      );
+      this.goodsForm.totalValue = sellingCal(
+        this.goodsForm.outFactoryPrice,
+        this.goodsForm.orderQuantity,
+      );
+      this.goodsForm.price = addPrice(
+        this.goodsForm.outFactoryPrice,
+        this.goodsForm.shareAmount
+      );
+      this.goodsForm.amount = amountCal(
+        this.goodsForm.price,
+        this.goodsForm.orderQuantity,
+        this.goodsForm.freight,
+        this.goodsForm.insurance,
+        this.goodsForm.discount
+      );
+      this.goodsForm.itemMargin = grossProfitCal(
+        this.goodsForm.purchaseAmount,
+        this.goodsForm.partsPrice,
+        this.goodsForm.outFactoryPrice,
+        this.form.exchangeRate
+      );
+      const names = [this.goodsForm.partsValveName, this.goodsForm.partsCapName, this.goodsForm.partsHandleName, this
+        .goodsForm.partsColourName, this.goodsForm.partsModeName, this.goodsForm.partsAuthenticationName, this
+          .goodsForm.partsOtherName
+      ];
+      const name = []
+      names.forEach(e => {
+        if (e) {
+          name.push(e)
         }
-      },
-      async resetGoodsColumn() {
-        this.goodsOption = goodsOption;
-        const inSave = await this.delColumnData(
-          this.getColumnName(28),
-          goodsOption
-        );
-        if (inSave) {
-          this.$nextTick(() => {
-            this.$refs.goodsCrud.doLayout();
-          });
-          this.$message.success("重置成功");
-          //关闭窗口
-          setTimeout(() => {
-            this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
-          }, 1000);
+      })
+      this.goodsForm.partsDescribe = name.join(" ");
+      // this.data[index].partsPriceDescribe = namePrices.join(";");
+      this.goodsForm.productRemark = this.getproductRemark(this.goodsForm)
+      this.priceChange(this.goodsForm);
+    },
+    propsChange(row) {
+      const data = {
+        remarksOne: row.remarksOne,
+        customTwo: row.customTwo,
+        customThree: row.customThree,
+        customFour: row.customFour,
+        customFive: row.customFive,
+        customSix: row.customSix,
+        customSeven: row.customSeven,
+        customEight: row.customEight,
+        customNine: row.customNine,
+        customTen: row.customTen,
+      };
+      const arr = []
+      for (let key in data) {
+        if (row[key]) {
+          arr.push(row[key]);
         }
       }
+      this.goodsForm.itemProp = arr.join(' ')
+    },
+    editChange(row) {
+      row.productRemark = this.getproductRemark(row)
+    },
+    getproductRemark(row) {
+      console.log(row)
+      const ename = row.ename ? row.ename : "";
+      const itemDescription = row.itemDescription ?
+        row.itemDescription :
+        "";
+      const itemProp = row.itemProp ? row.itemProp : "";
+      const partsDescribe = row.partsDescribe ? (' ' + row.partsDescribe) : "";
+      const productRemark =
+        ename +
+        "\n" +
+        itemProp +
+        " " +
+        itemDescription +
+        " " +
+        partsDescribe;
+      return productRemark
+    },
+    beforeClose(done) {
+      this.upDataOption()
+      done();
+    },
+    upDataOption() {
+      this.findObject(this.tableOption.column, "remarksOne").disabled = true;
+      this.findObject(this.tableOption.column, "customTwo").disabled = true;
+      this.findObject(this.tableOption.column, "customThree").disabled = true;
+      this.findObject(this.tableOption.column, "customFour").disabled = true;
+      this.findObject(this.tableOption.column, "partsValveName").disabled = true;
+      this.findObject(this.tableOption.column, "partsCapName").disabled = true;
+      this.findObject(this.tableOption.column, "partsHandleName").disabled = true;
+      this.findObject(this.tableOption.column, "partsColourName").disabled = true;
+      this.findObject(this.tableOption.column, "partsModeName").disabled = true;
+      this.findObject(this.tableOption.column, "partsAuthenticationName").disabled = true;
+      this.findObject(this.tableOption.column, "partsOtherName").disabled = true;
+    },
+    discountChange(row) {
+      if (row.discount >= 10) {
+        row.discount = null;
+        this.$message.error("请正确输入折扣");
+      }
+      this.priceChange(row);
+    },
+    taxRateChange(row) {
+      if (row.taxRate > 100) {
+        row.taxRate = 0;
+        this.$message.error("请正确输入税率");
+      }
+    },
+    handleRowSave(row, done, loading) {
+      this.data.push(row)
+      loading()
+      done()
+    },
+    handleRowUpdate(row, index, done, loading) {
+      this.data[index] = row
+      // this.$refs.crud.rowUpdate()
+      loading()
+      done()
+    },
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(5),
+        this.tableOption
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.getWorkDicts("cargo_type").then(res => {
+          this.findObject(this.tableOption.column, "cargoType").dicData =
+            res.data.data;
+        });
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      this.tableOption = tableOption;
+      const inSave = await this.delColumnData(
+        this.getColumnName(5),
+        tableOption
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.$message.success("重置成功");
+        //关闭窗口
+        setTimeout(() => {
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }, 1000);
+      }
+    },
+    async saveGoodsColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(28),
+        this.goodsOption
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.goodsCrud.doLayout();
+        });
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
+      }
     },
-    watch: {}
-  };
+    async resetGoodsColumn() {
+      this.goodsOption = goodsOption;
+      const inSave = await this.delColumnData(
+        this.getColumnName(28),
+        goodsOption
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.goodsCrud.doLayout();
+        });
+        this.$message.success("重置成功");
+        //关闭窗口
+        setTimeout(() => {
+          this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
+        }, 1000);
+      }
+    }
+  },
+  watch: {}
+};
 </script>
 
 <style scoped>
-  ::v-deep .select-component {
-    display: flex;
-  }
+::v-deep .select-component {
+  display: flex;
+}
 
-  .page-crad ::v-deep .basic-container__card {
-    height: 94.2vh;
-  }
+.page-crad ::v-deep .basic-container__card {
+  height: 94.2vh;
+}
 
-  .itemTable ::v-deep .el-table {
-    width: 738px;
-  }
+.itemTable ::v-deep .el-table {
+  width: 738px;
+}
 
 /*  ::v-deep .el-input-group__append,
   .el-input-group__prepend {

+ 410 - 392
src/views/exportTrade/salesContract/config/customerContact.json

@@ -1,394 +1,412 @@
 {
-  "searchShow": true,
-  "searchMenuSpan": 6,
-  "border": true,
-  "index": true,
-  "viewBtn": false,
-  "editBtn": false,
-  "addBtn": false,
-  "delBtn": false,
-  "headerAlign": "center",
-  "menuWidth": 150,
-  "refreshBtn": false,
-  "showSummary": true,
-  "selection": true,
-  "indexSlot":true,
-  "tip": false,
-  "summaryText": "合计",
-  "sumColumnList": [
-      {
-          "name": "orderQuantity",
-          "type": "sum"
-      },
-      {
-          "name": "amount",
-          "type": "sum"
-      },
-      {
-          "name": "partsCost",
-          "type": "sum"
-      },
-      {
-          "name": "partsPrice",
-          "type": "sum"
-      },
-      {
-          "name": "productPrice",
-          "type": "sum"
-      },
-      {
-          "name": "actualQuantity",
-          "type": "sum"
-      }
-  ],
-  "column": [
-    {
-        "label": "产品名称",
-        "prop": "cname",
-        "index": 1,
-        "width": 200,
-        "span": 8,
-        "overHidden": true
-    },
-    {
-        "label": "产品编号",
-        "prop": "code",
-        "index": 2,
-        "width": 100,
-        "span": 8,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "产品类别",
-        "prop": "priceCategory",
-        "index": 3,
-        "width": 100,
-        "span": 8,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "英文名称",
-        "prop": "ename",
-        "index": 4,
-        "width": 200,
-        "span": 12,
-        "overHidden": true
-    },
-    {
-        "label": "产品描述",
-        "prop": "itemDescription",
-        "index": 5,
-        "width": 100,
-        "span": 12,
-        "overHidden": true
-    },
-    {
-        "label": "螺纹",
-        "prop": "remarksOne",
-        "index": 6,
-        "width": 100,
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "介质",
-        "prop": "customTwo",
-        "index": 7,
-        "width": 100,
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "颜色",
-        "prop": "customThree",
-        "index": 8,
-        "width": 100,
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "电压",
-        "prop": "customFour",
-        "index": 9,
-        "width": 100,
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "产品属性",
-        "prop": "itemProp",
-        "index": 10,
-        "width": 200,
-        "span": 24,
-        "overHidden": true
-    },
-    {
-        "label": "阀门配件",
-        "prop": "partsValveName",
-        "index": 11,
-        "width": 200,
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "瓶帽配件",
-        "prop": "partsCapName",
-        "index": 12,
-        "width": 200,
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "特殊处理",
-        "prop": "partsHandleName",
-        "index": 13,
-        "width": 200,
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "包装方式",
-        "prop": "partsColourName",
-        "index": 14,
-        "width": 200,
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "特殊颜色",
-        "prop": "partsModeName",
-        "index": 15,
-        "width": 200,
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "认证",
-        "prop": "partsAuthenticationName",
-        "index": 16,
-        "width": 200,
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "其他",
-        "prop": "partsOtherName",
-        "index": 17,
-        "width": 200,
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "配件信息",
-        "prop": "partsDescribe",
-        "index": 18,
-        "width": 200,
-        "span": 24,
-        "overHidden": true
-    },
-    {
-        "label": "商品信息",
-        "prop": "productRemark",
-        "type": "textarea",
-        "index": 19,
-        "width": 100,
-        "overHidden": true,
-        "minRows": 2,
-        "span": 24
-    },
-    {
-        "label": "数量",
-        "prop": "orderQuantity",
-        "index": 20,
-        "width": 100,
-        "align": "right",
-        "span": 6,
-        "overHidden": true
-    },
-    {
-        "label": "计价单位",
-        "prop": "unit",
-        "index": 21,
-        "width": 100,
-        "overHidden": true,
-        "span": 6,
-        "type": "select",
-        "dicData": [],
-        "props": {
-            "label": "dictValue",
-            "value": "dictValue"
+    "searchShow": true,
+    "searchMenuSpan": 6,
+    "border": true,
+    "index": true,
+    "viewBtn": false,
+    "editBtn": false,
+    "addBtn": false,
+    "delBtn": false,
+    "headerAlign": "center",
+    "menuWidth": 150,
+    "refreshBtn": false,
+    "showSummary": true,
+    "selection": true,
+    "indexSlot": true,
+    "tip": false,
+    "summaryText": "合计",
+    "sumColumnList": [
+        {
+            "name": "orderQuantity",
+            "type": "sum"
+        },
+        {
+            "name": "amount",
+            "type": "sum"
+        },
+        {
+            "name": "partsCost",
+            "type": "sum"
+        },
+        {
+            "name": "partsPrice",
+            "type": "sum"
+        },
+        {
+            "name": "productPrice",
+            "type": "sum"
+        },
+        {
+            "name": "actualQuantity",
+            "type": "sum"
         }
-    },
-    {
-        "label": "销售价",
-        "prop": "price",
-        "index": 22,
-        "width": 100,
-        "span": 6,
-        "align": "right",
-        "overHidden": true
-    },
-    {
-        "label": "金额",
-        "prop": "amount",
-        "index": 23,
-        "width": 100,
-        "span": 6,
-        "align": "right",
-        "overHidden": true
-    },
-    {
-        "label": "产品型号",
-        "prop": "itemType",
-        "index": 24,
-        "width": 100,
-        "span": 6,
-        "overHidden": true
-    },
-    {
-        "label": "采购成本",
-        "prop": "purchaseCost",
-        "index": 25,
-        "width": 100,
-        "align": "right",
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "采购单价",
-        "prop": "purchaseAmount",
-        "index": 26,
-        "width": 100,
-        "align": "right",
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "配件成本",
-        "prop": "partsCost",
-        "index": 27,
-        "width": 100,
-        "align": "right",
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "配件价格",
-        "prop": "partsPrice",
-        "index": 28,
-        "width": 100,
-        "align": "right",
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "配件价格描述",
-        "prop": "partsPriceDescribe",
-        "index": 29,
-        "width": 120,
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "供应商",
-        "prop": "corpName",
-        "index": 30,
-        "width": 200,
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "重点推荐",
-        "prop": "priorityReferrer",
-        "index": 31,
-        "width": 100,
-        "span": 6,
-        "overHidden": true
-    },
-    {
-        "label": "推荐理由",
-        "prop": "referrerReason",
-        "index": 32,
-        "width": 100,
-        "overHidden": true,
-        "span": 6
-    },
-    {
-        "label": "产品价格",
-        "prop": "productPrice",
-        "index": 33,
-        "width": 100,
-        "align": "right",
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "单品毛利率",
-        "prop": "itemMargin",
-        "index": 34,
-        "width": 100,
-        "align": "right",
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "发货数量",
-        "prop": "actualQuantity",
-        "index": 35,
-        "width": 100,
-        "align": "right",
-        "span": 6,
-        "disabled": true,
-        "overHidden": true
-    },
-    {
-        "label": "折扣",
-        "prop": "discount",
-        "index": 36,
-        "width": 100,
-        "align": "right",
-        "span": 6,
-        "overHidden": true
-    },
-    {
-        "label": "税率",
-        "prop": "taxRate",
-        "index": 37,
-        "width": 100,
-        "align": "right",
-        "span": 6,
-        "overHidden": true
-    },
-    {
-        "label": "备注",
-        "prop": "remarks",
-        "type": "textarea",
-        "minRows": 2,
-        "index": 38,
-        "width": 100,
-        "overHidden": true,
-        "span": 12
-    }
-]
-}
+    ],
+    "column": [
+        {
+            "label": "产品名称",
+            "prop": "cname",
+            "index": 1,
+            "width": 200,
+            "span": 8,
+            "overHidden": true
+        },
+        {
+            "label": "产品编号",
+            "prop": "code",
+            "index": 2,
+            "width": 100,
+            "span": 8,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "产品类别",
+            "prop": "priceCategory",
+            "index": 3,
+            "width": 100,
+            "span": 8,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "英文名称",
+            "prop": "ename",
+            "index": 4,
+            "width": 200,
+            "span": 12,
+            "overHidden": true
+        },
+        {
+            "label": "产品描述",
+            "prop": "itemDescription",
+            "index": 5,
+            "width": 100,
+            "span": 12,
+            "overHidden": true
+        },
+        {
+            "label": "螺纹",
+            "prop": "remarksOne",
+            "index": 6,
+            "width": 100,
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "介质",
+            "prop": "customTwo",
+            "index": 7,
+            "width": 100,
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "颜色",
+            "prop": "customThree",
+            "index": 8,
+            "width": 100,
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "电压",
+            "prop": "customFour",
+            "index": 9,
+            "width": 100,
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "产品属性",
+            "prop": "itemProp",
+            "index": 10,
+            "width": 200,
+            "span": 24,
+            "overHidden": true
+        },
+        {
+            "label": "阀门配件",
+            "prop": "partsValveName",
+            "index": 11,
+            "width": 200,
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "瓶帽配件",
+            "prop": "partsCapName",
+            "index": 12,
+            "width": 200,
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "特殊处理",
+            "prop": "partsHandleName",
+            "index": 13,
+            "width": 200,
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "包装方式",
+            "prop": "partsColourName",
+            "index": 14,
+            "width": 200,
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "特殊颜色",
+            "prop": "partsModeName",
+            "index": 15,
+            "width": 200,
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "认证",
+            "prop": "partsAuthenticationName",
+            "index": 16,
+            "width": 200,
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "其他",
+            "prop": "partsOtherName",
+            "index": 17,
+            "width": 200,
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "配件信息",
+            "prop": "partsDescribe",
+            "index": 18,
+            "width": 200,
+            "span": 24,
+            "overHidden": true
+        },
+        {
+            "label": "商品信息",
+            "prop": "productRemark",
+            "type": "textarea",
+            "index": 19,
+            "width": 100,
+            "overHidden": true,
+            "minRows": 2,
+            "span": 24
+        },
+        {
+            "label": "数量",
+            "prop": "orderQuantity",
+            "index": 20,
+            "width": 100,
+            "align": "right",
+            "span": 6,
+            "overHidden": true
+        },
+        {
+            "label": "计价单位",
+            "prop": "unit",
+            "index": 21,
+            "width": 100,
+            "overHidden": true,
+            "span": 6,
+            "type": "select",
+            "dicData": [],
+            "props": {
+                "label": "dictValue",
+                "value": "dictValue"
+            }
+        },
+        {
+            "label": "出厂价格",
+            "prop": "outFactoryPrice",
+            "index": 22,
+            "width": 100,
+            "align": "right",
+            "span": 6,
+            "overHidden": true
+        },
+        {
+            "label": "分摊金额",
+            "prop": "shareAmount",
+            "index": 23,
+            "width": 100,
+            "align": "right",
+            "span": 6,
+            "overHidden": true
+        },
+        {
+            "label": "销售价",
+            "prop": "price",
+            "index": 24,
+            "width": 100,
+            "span": 6,
+            "align": "right",
+            "overHidden": true
+        },
+        {
+            "label": "金额",
+            "prop": "amount",
+            "index": 25,
+            "width": 100,
+            "span": 6,
+            "align": "right",
+            "overHidden": true
+        },
+        {
+            "label": "产品型号",
+            "prop": "itemType",
+            "index": 26,
+            "width": 100,
+            "span": 6,
+            "overHidden": true
+        },
+        {
+            "label": "采购成本",
+            "prop": "purchaseCost",
+            "index": 27,
+            "width": 100,
+            "align": "right",
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "采购单价",
+            "prop": "purchaseAmount",
+            "index": 28,
+            "width": 100,
+            "align": "right",
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "配件成本",
+            "prop": "partsCost",
+            "index": 29,
+            "width": 100,
+            "align": "right",
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "配件价格",
+            "prop": "partsPrice",
+            "index": 30,
+            "width": 100,
+            "align": "right",
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "配件价格描述",
+            "prop": "partsPriceDescribe",
+            "index": 31,
+            "width": 120,
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "供应商",
+            "prop": "corpName",
+            "index": 32,
+            "width": 200,
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "重点推荐",
+            "prop": "priorityReferrer",
+            "index": 33,
+            "width": 100,
+            "span": 6,
+            "overHidden": true
+        },
+        {
+            "label": "推荐理由",
+            "prop": "referrerReason",
+            "index": 34,
+            "width": 100,
+            "overHidden": true,
+            "span": 6
+        },
+        {
+            "label": "产品价格",
+            "prop": "productPrice",
+            "index": 35,
+            "width": 100,
+            "align": "right",
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "单品毛利率",
+            "prop": "itemMargin",
+            "index": 36,
+            "width": 100,
+            "align": "right",
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "发货数量",
+            "prop": "actualQuantity",
+            "index": 37,
+            "width": 100,
+            "align": "right",
+            "span": 6,
+            "disabled": true,
+            "overHidden": true
+        },
+        {
+            "label": "折扣",
+            "prop": "discount",
+            "index": 38,
+            "width": 100,
+            "align": "right",
+            "span": 6,
+            "overHidden": true
+        },
+        {
+            "label": "税率",
+            "prop": "taxRate",
+            "index": 39,
+            "width": 100,
+            "align": "right",
+            "span": 6,
+            "overHidden": true
+        },
+        {
+            "label": "备注",
+            "prop": "remarks",
+            "type": "textarea",
+            "minRows": 2,
+            "index": 40,
+            "width": 100,
+            "overHidden": true,
+            "span": 12
+        }
+    ]
+}

+ 16 - 7
src/views/exportTrade/salesContract/detailsPage.vue

@@ -155,7 +155,7 @@
         </avue-form>
       </trade-card>
       <goods-info ref="goodsInfo" :form="form" :data="data" :detailData="detailData"></goods-info>
-    <!--  <trade-card title="商品信息">
+      <!--  <trade-card title="商品信息">
         <avue-crud ref="crud" :data="data" :option="tableOption" @row-del="rowDel"
           @selection-change="goodsSelectionChange" @saveColumn="saveColumn" @resetColumn="resetColumn"
           :summary-method="summaryMethod" :cell-style="cellStyle" @row-dblclick="handleRowDBLClick">
@@ -455,7 +455,10 @@ import {
   STGPCal,
   numCal,
   costsCal,
-  costCal
+  costCal,
+  multiply,
+  sum,
+  addPrice
 } from "@/util/calculate";
 import {
   getCorpsattn
@@ -600,7 +603,7 @@ export default {
             label: "dictValue",
             value: "dictValue"
           },
-          row:true
+          row: true
         },
         {
           label: "价格条款",
@@ -1098,6 +1101,7 @@ export default {
       });
     },
     getParities(status) {
+      this.oldExchange = this.form.exchangeRate;
       getParities({
         currency: this.form.currency,
         businesDate: this.form.businesDate
@@ -1106,7 +1110,6 @@ export default {
           const data = res.data.data;
           this.form.exchangeRate = data.receivableParities;
           this.oldform.exchangeRate = data.receivableParities;
-          this.oldExchange = this.deepClone(data.receivableParities);
         })
         .finally(() => {
           if (this.data.length > 0 && status == "currency") {
@@ -1121,7 +1124,9 @@ export default {
                 this.oldExchange,
                 this.form.exchangeRate
               );
-              e.price = sellingCal(e.productPrice, this.form.exchangeRate);
+               e.shareAmount = transformCal(e.shareAmount, this.oldExchange, this.form.exchangeRate);
+                            e.outFactoryPrice = sellingCal(e.productPrice, this.form.exchangeRate);
+                            e.price = addPrice(e.outFactoryPrice, e.shareAmount);
               e.amount = amountCal(
                 e.price,
                 e.orderQuantity,
@@ -1491,7 +1496,9 @@ export default {
         this.data.forEach(e => {
           e.freight = transformCal(e.freight, this.oldExchange, row);
           e.insurance = transformCal(e.insurance, this.oldExchange, row);
-          e.price = sellingCal(e.productPrice, row);
+          e.shareAmount = transformCal(e.shareAmount, this.oldExchange, row);
+                    e.outFactoryPrice = sellingCal(e.productPrice, row);
+                    e.price = addPrice(e.outFactoryPrice, e.shareAmount);
           e.amount = amountCal(
             e.price,
             e.orderQuantity,
@@ -2012,8 +2019,10 @@ export default {
             costSum,
             paySum
           );
+          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.subLoading = true;
           submit({
@@ -2251,7 +2260,7 @@ export default {
                 this.findObject(this.option.column, "cargoType").dicData =
                   res.data.data;
               });
-                  // this.$refs.crud.refreshTable();
+              // this.$refs.crud.refreshTable();
               this.$refs.goodsInfo.refreshTable();
             }
           });

+ 10 - 7
src/views/maintenance/landFreight/detailsPage.vue

@@ -35,13 +35,13 @@
             </breakdown-select>
             <span v-else>{{ row.feesName }}</span>
           </template>
-          <template slot="currency" slot-scope="{ row,index }">
+          <!-- <template slot="currency" slot-scope="{ row,index }">
             <el-select size="small" v-if="row.$cellEdit" v-model="row.currency" placeholder="请选择" clearable>
               <el-option v-for="item in currencyList" :key="item.id" :label="item" :value="item">
               </el-option>
             </el-select>
             <span v-else>{{ row.currency}}</span>
-          </template>
+          </template> -->
           <template slot="menu" slot-scope="{ row, index }">
             <el-button size="small" type="text" @click="rowCell(row, index)">{{
             row.$cellEdit ? "保存" : "修改" }}</el-button>
@@ -112,7 +112,7 @@ export default {
         clearable: true,
         placeholder: "请点击右边按钮选择",
         dicData: [],
-        currencyList: []
+        // currencyList: []
       },
     };
   },
@@ -132,9 +132,9 @@ export default {
     if (this.detailData.status == 1) {
       this.option.disabled = true;
     }
-    getCode().then(res => {
-      this.currencyList = res.data.data;
-    });
+    // getCode().then(res => {
+    //   this.currencyList = res.data.data;
+    // });
     this.getAllWorkDicts()
   },
   methods: {
@@ -167,7 +167,7 @@ export default {
       this.form.corpName = row.cname
     },
     addRow() {
-      this.dataList.push({ currency: 'CYN',type:1, $cellEdit: true });
+      this.dataList.push({ currency: 'CNY',type:1, $cellEdit: true });
     },
     rowCell(row, index) {
       this.$refs.crud.rowCell(row, index)
@@ -206,6 +206,9 @@ export default {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
+          this.dataList.forEach(e=>{
+            e.departure=e.departureId?e.departureId.replace(/,/g,"/"):''
+          })
           this.loadingBtn = true;
           submit({ ...this.form, feesType: 1, orderCostItemList: this.dataList })
             .then(res => {

+ 1 - 2
src/views/maintenance/landFreight/js/optionList.js

@@ -57,10 +57,9 @@ export const optionList = {
       overHidden: true,
       dicData:[],
       type: "cascader",
-      dataType: "number",
       props: {
         label: 'name',
-        value: 'code'
+        value: 'name'
       },
       cell: true,
       width: 350,