Browse Source

Merge branch 'dev' of git.echepei.com:caojunjie/Smart_platform_ui into dev

caojunjie 3 years ago
parent
commit
02012fe922

+ 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
     }
   }

+ 17 - 1
src/views/businessManagement/purchaseOrder/configuration/mainList.json

@@ -18,6 +18,22 @@
   "searchIcon": true,
   "searchIndex": 2,
   "searchSpan": 8,
+  "showSummary": true,
+  "summaryText": "合计",
+  "sumColumnList": [
+    {
+      "name": "oceanFreight",
+      "type": "sum"
+    },
+    {
+      "name": "orderQuantity",
+      "type": "sum"
+    },
+    {
+      "name": "actualQuantity",
+      "type": "sum"
+    }
+  ],
   "column": [
     {
       "label": "采购订单号",
@@ -80,7 +96,7 @@
       "overHidden": true
     },
     {
-      "label": "运费",
+      "label": "预估运费",
       "prop": "oceanFreight",
       "search": false,
       "index": 7,

+ 13 - 0
src/views/businessManagement/salesOrder/configuration/mainList.json

@@ -22,6 +22,7 @@
   "searchSpan": 8,
   "expand": true,
   "expandWidth": 38,
+  "showSummary": true,
   "summaryText": "合计",
   "sumColumnList": [
     {
@@ -35,6 +36,18 @@
     {
       "name": "balanceAmount",
       "type": "sum"
+    },
+    {
+      "name": "grossProfit",
+      "type": "sum"
+    },
+    {
+      "name": "orderQuantity",
+      "type": "sum"
+    },
+    {
+      "name": "actualQuantity",
+      "type": "sum"
     }
   ],
   "column": [

+ 11 - 2
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -122,7 +122,7 @@
                                 value-format="yyyy-MM-dd HH:mm:ss"
                                 :disabled="detailData.seeDisabled"/>
                 <el-input
-                  v-else-if="(item.prop === 'advancePayment') || (item.prop === 'settlmentAmount') || (item.prop === 'overPayment')"
+                  v-else-if="(item.prop === 'advancePayment') || (item.prop === 'orderAmount') || (item.prop === 'settlmentAmount') || (item.prop === 'overPayment')"
                   v-model.trim="form[item.prop]" size="small" autocomplete="off"
                   @change="computedCost"
                   :disabled="detailData.seeDisabled"
@@ -134,6 +134,9 @@
                 <el-input type="age" v-else-if="item.prop === 'grossProfitRate'" v-model.trim="form[item.prop]" size="small" autocomplete="off" placeholder="请输入" :disabled="detailData.seeDisabled" v-input-limit="2">
                   <template   slot="append">%</template>
                 </el-input>
+                <el-input type="age" v-else-if="item.prop === 'specialOfferOf'" v-model.trim="form[item.prop]" size="small" autocomplete="off" placeholder="请输入" :disabled="detailData.seeDisabled" v-input-limit="2">
+                  <template   slot="append">%</template>
+                </el-input>
                 <el-input
                   v-else-if="item.type == 'number'"
                   placeholder="请输入"
@@ -562,6 +565,8 @@
 
     <report-dialog
       :switchDialog="switchDialog"
+      :reportId="form.id"
+      reportName="销售明细(N)"
       @onClose="onClose()"
     ></report-dialog>
   </div>
@@ -992,7 +997,7 @@ export default {
             ]
           }, {
             label: '特价占比',
-            prop: 'a',
+            prop: 'specialOfferOf',
             disabled: false,
             rules: [
               {
@@ -2126,6 +2131,8 @@ export default {
           this.$set(this.form, 'orderAmount', 0)
           // 成本价
           let purchaseAmount = 0
+          // 销售金额
+          this.form.orderAmount = 0;
           // 计算销售金额
           this.contactsData.forEach(item => {
             if (item.purchaseAmount) {
@@ -2133,6 +2140,7 @@ export default {
             }
             this.form.orderAmount = (Number(this.form.orderAmount) + Number(item.amount)).toFixed(2)
           })
+          this.computedCost()
           if (this.form.orderAmount && this.form.settlmentAmount) {
             this.$set(this.form, "balanceAmount", (Number(this.form.orderAmount) - Number(this.form.settlmentAmount)).toFixed(2));
           }
@@ -2208,6 +2216,7 @@ export default {
         overPayment = this.form.overPayment
       }
       this.$set(this.form, "balanceAmount", (Number(orderAmount) - Number(overPayment) - Number(settlmentAmount)).toFixed(2));
+      this.$set(this.form, 'debitAmount', ((Number(orderAmount) - Number(overPayment)).toFixed(2)))
     },
     quantityChange(row) {
       if (!row.orderQuantity) {

+ 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,