QuKatie 3 лет назад
Родитель
Сommit
3255cdb976

+ 20 - 18
src/components/selectComponent/customerSelect.vue

@@ -1,18 +1,20 @@
 <template>
   <span class="select-component" style="display:inline-flex;width: 100%;">
     <el-select
-        v-model.trim="value"
-        size="small"
-        :placeholder="configuration.placeholder"
-        style="border-right: none;width: 100%"
-        :disabled="disabled?disabled:false"
-        :multiple="configuration.multiple?configuration.multiple:false"
-        :clearable="configuration.clearable?configuration.clearable:false"
-        :collapse-tags="configuration.collapseTags?configuration.collapseTags:false"
-        filterable
-        remote
-        @change="changeName"
-        :remote-method="remoteMethod"
+      v-model.trim="value"
+      size="small"
+      :placeholder="configuration.placeholder"
+      style="border-right: none;width: 100%"
+      :disabled="disabled ? disabled : false"
+      :multiple="configuration.multiple ? configuration.multiple : false"
+      :clearable="configuration.clearable ? configuration.clearable : false"
+      :collapse-tags="
+        configuration.collapseTags ? configuration.collapseTags : false
+      "
+      filterable
+      remote
+      @change="changeName"
+      :remote-method="remoteMethod"
     >
       <el-option
         v-for="item in configuration.dicData.length !== 0
@@ -137,7 +139,7 @@ export default {
   },
   data() {
     return {
-      corpType:null,
+      corpType: null,
       dialogFull: false,
       form: {},
       dicData: [],
@@ -279,8 +281,8 @@ export default {
     },
     //点击搜索按钮触发
     searchChange(params, done) {
-      console.log(params)
-      this.treeDeptId = '';
+      console.log(params);
+      this.treeDeptId = "";
       this.page.currentPage = 1;
       this.onLoad(this.page, params);
       done();
@@ -311,7 +313,7 @@ export default {
       if (this.typeData == "KH") {
         this.corpType = customerParameter;
       }
-      if (this.typeData== "GYS") {
+      if (this.typeData == "GYS") {
         this.corpType = supplierParameter;
       }
       if (this.typeData == "GS") {
@@ -354,7 +356,7 @@ export default {
           size: 10,
           current: 1,
           cname: query,
-          corpType: this.corpType ? this.corpType : "KH"
+          corpType: this.typeData ? this.corpType : "KH"
         };
         customerList(this.queryParams).then(res => {
           this.dicData = res.data.data.records;
@@ -365,7 +367,7 @@ export default {
         this.queryParams = {
           size: 10,
           current: 1,
-          corpType: this.corpType ? this.corpType : "KH"
+          corpType: this.typeData ? this.typeData : "KH"
         };
         customerList(this.queryParams).then(res => {
           this.dicData = [];

+ 0 - 1
src/util/contrastData.js

@@ -4,7 +4,6 @@ export function contrastObj(newval, oldval) {
   let reg = /^[A-Za-z]+$/;
   for (let key in newval) {
     if (reg.test(key)&&!(newval[key] instanceof Array) && (newval[key] != oldval[key] && (newval[key] || oldval[key]))) {
-      console.log(newval[key],key,oldval[key])
       return true
     }
   }

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

@@ -118,16 +118,23 @@
       "cell": true
     },
     {
+      "label": "产品价格",
+      "prop": "productPrice",
+      "index": 15,
+      "width": 100,
+      "overHidden": true
+    },
+    {
       "label": "销售价",
       "prop": "price",
-      "index": 15,
+      "index": 16,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "计价单位",
       "prop": "unit",
-      "index": 16,
+      "index": 17,
       "width": 100,
       "overHidden": true,
       "cell": true,
@@ -141,49 +148,49 @@
     {
       "label": "数量",
       "prop": "orderQuantity",
-      "index": 17,
+      "index": 18,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "保险",
       "prop": "insurance",
-      "index": 18,
+      "index": 19,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "运费",
       "prop": "freight",
-      "index": 19,
+      "index": 20,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "折扣",
       "prop": "discount",
-      "index": 20,
+      "index": 21,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "金额",
       "prop": "amount",
-      "index": 21,
+      "index": 22,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "税率",
       "prop": "taxRate",
-      "index": 22,
+      "index": 23,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "备注",
       "prop": "remarks",
-      "index": 23,
+      "index": 24,
       "width": 100,
       "overHidden": true,
       "cell": true

+ 58 - 20
src/views/exportTrade/customerInquiry/detailsPage.vue

@@ -484,7 +484,9 @@ export default {
       switchDialog: false,
       form: {
         orderStatus: "录入",
-        businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
+        businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00",
+        currency: "CNY",
+        exchangeRate: "1"
       },
       disabled: false,
       dialogVisible: false,
@@ -766,7 +768,9 @@ export default {
       orderFeesList: [],
       oldform: {
         orderStatus: "录入",
-        businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
+        businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00",
+        currency: "CNY",
+        exchangeRate: "1"
       },
       olddata: [],
       oldorderFeesList: [],
@@ -866,6 +870,9 @@ export default {
       if (!this.form.corpId) {
         return this.$message.error("请选择客户名称");
       }
+      if (!this.form.currency) {
+        return this.$message.error("请选择币别");
+      }
       this.$refs.library.init(this.partType, this.partreData != null);
     },
     rowCorpdata(row) {
@@ -922,6 +929,29 @@ export default {
     importPart(rows, sum, index) {
       this.data[index].partsList = rows;
       this.data[index].partsPrice = sum;
+      // 销售价=(配件采购价格+产品价格)/汇率 *(1+客户FOB系数/100)
+      // this.data[index].price=_.multiply(multiplier, multiplicand)
+
+      this.data[index].price = Number(
+        _.multiply(
+          _.divide(
+            _.add(
+              Number(sum),
+              Number(
+                this.data[index].partsPrice ? this.data[index].partsPrice : 0
+              )
+            ),
+            Number(this.form.exchangeRate ? this.form.exchangeRate : 1)
+          ),
+          _.add(
+            1,
+            _.divide(
+              Number(this.form.coefficient ? this.form.coefficient : 0),
+              100
+            )
+          )
+        )
+      ).toFixed(2);
       const names = [];
       const namePrices = [];
       rows.map(e => {
@@ -959,21 +989,18 @@ export default {
     priceChange(row) {
       const sum = _.multiply(
         _.add(
-          _.add(
-            Number(
-              _.multiply(
-                row.price ? row.price : 0,
-                row.orderQuantity ? row.orderQuantity : 0
-              )
-            ),
-            Number(
-              _.add(
-                Number(row.insurance ? row.insurance : 0),
-                Number(row.freight ? row.freight : 0)
-              )
+          Number(
+            _.multiply(
+              row.price ? row.price : 0,
+              row.orderQuantity ? row.orderQuantity : 0
             )
           ),
-          Number(row.partsPrice ? row.partsPrice : 0)
+          Number(
+            _.add(
+              Number(row.insurance ? row.insurance : 0),
+              Number(row.freight ? row.freight : 0)
+            )
+          )
         ),
         _.divide(row.discount ? row.discount : 10, 10)
       );
@@ -1214,8 +1241,8 @@ export default {
               goodTypeName: e.goodsTypeName,
               goodName: e.cname,
               price: e.purchaseAmount,
-              goodNumber: 0,
-              amout: 0,
+              goodNumber: 1,
+              amout: e.purchaseAmount,
               $cellEdit: true
             });
           });
@@ -1231,22 +1258,33 @@ export default {
             itemProp: e.goodNature,
             corpId: e.corpId,
             corpName: e.corpName,
-            itemDescription:e.cnameDescription,
+            itemDescription: e.cnameDescription,
             partsList: [],
             partsPrice: 0,
             itemType: e.specs,
             tradeTerms: null,
+            productPrice: Number(
+              _.multiply(
+                Number(e.purchaseAmount),
+                Number(_.add(1, _.divide(Number(this.form.coefficient), 100)))
+              )
+            ).toFixed(2),
             price: Number(
               _.multiply(
                 Number(e.purchaseAmount),
                 Number(_.add(1, _.divide(Number(this.form.coefficient), 100)))
               )
             ).toFixed(2),
-            orderQuantity: 0,
+            orderQuantity: 1,
             insurance: 0,
             freight: 0,
             discount: null,
-            amount: 0,
+            amount: Number(
+              _.multiply(
+                Number(e.purchaseAmount),
+                Number(_.add(1, _.divide(Number(this.form.coefficient), 100)))
+              )
+            ).toFixed(2),
             taxRate: 0,
             unit: e.unit,
             remarks: null,