Browse Source

产品下拉 供应商中文改英文

Qukatie 2 days ago
parent
commit
033bf341b1

+ 115 - 91
src/views/exportTrade/EcommerceStocking/components/goodsInfo.vue

@@ -83,9 +83,25 @@
       //产品名称
       //产品名称
       <template slot="cnameForm" slot-scope="{ type, disabled }">
       <template slot="cnameForm" slot-scope="{ type, disabled }">
         <span style="display:flex">
         <span style="display:flex">
-          <el-select v-model="goodsForm.itemId" placeholder="请选择" size="small" filterable @change="cnameChange(goodsForm)">
+          <!-- <el-select v-model="goodsForm.itemId" placeholder="请选择" size="small" filterable @change="cnameChange(goodsForm)">
             <el-option v-for="item in goodsoptions" :key="item.itemId" :label="item.cname" :value="item.itemId"> </el-option>
             <el-option v-for="item in goodsoptions" :key="item.itemId" :label="item.cname" :value="item.itemId"> </el-option>
           </el-select>
           </el-select>
+          <el-button icon="el-icon-search" size="small" @click="pickGoods"></el-button> -->
+          <dic-select
+            v-model="goodsForm.cname"
+            placeholder="产品名称"
+            key="id"
+            label="cname"
+            res="records"
+            style="width: 100%;"
+            :url="'/blade-mocha-item/pricebank/pageListAllV1?current=1&size=30&billType=CG&statusTime=' + statusTime"
+            :filterable="true"
+            :remote="true"
+            dataName="cname"
+            :slotRight="true"
+            rightLabel="corpCode"
+            @selectChange="cnameChange('cname', $event)"
+          ></dic-select>
           <el-button icon="el-icon-search" size="small" @click="pickGoods"></el-button>
           <el-button icon="el-icon-search" size="small" @click="pickGoods"></el-button>
         </span>
         </span>
       </template>
       </template>
@@ -354,11 +370,13 @@ import {
 } from "@/api/basicData/salesContract";
 } from "@/api/basicData/salesContract";
 import { sum, multiply, partSum, productCal, sellingCal, amountCal, grossProfitCal, costCal, addPrice, divide } from "@/util/calculate";
 import { sum, multiply, partSum, productCal, sellingCal, amountCal, grossProfitCal, costCal, addPrice, divide } from "@/util/calculate";
 import _ from "lodash";
 import _ from "lodash";
+import dicSelect from "@/components/dicSelect/main";
 import { getPricebankAll } from "@/api/basicData/customerInquiry";
 import { getPricebankAll } from "@/api/basicData/customerInquiry";
 export default {
 export default {
   name: "customerInformation",
   name: "customerInformation",
   data() {
   data() {
     return {
     return {
+      statusTime: dateFormat(new Date(), "yyyy-MM-dd"),
       fudaSatus: null,
       fudaSatus: null,
       pickerValue: "",
       pickerValue: "",
       dialog: false,
       dialog: false,
@@ -775,7 +793,7 @@ export default {
             disabled: true,
             disabled: true,
             overHidden: true,
             overHidden: true,
             hide: true,
             hide: true,
-            display: false,
+            display: false
             // showColumn: false
             // showColumn: false
           },
           },
           {
           {
@@ -894,10 +912,11 @@ export default {
     partLibrary,
     partLibrary,
     propertyDialog,
     propertyDialog,
     priceLibrary,
     priceLibrary,
-    reportDialog
+    reportDialog,
+    dicSelect
   },
   },
   async created() {
   async created() {
-       this.tableOption = await this.getColumnData(this.getColumnName(5.1), this.tableOptionBack);
+    this.tableOption = await this.getColumnData(this.getColumnName(5.1), this.tableOptionBack);
     this.goodsOption = await this.getColumnData(this.getColumnName(28), goodsOption);
     this.goodsOption = await this.getColumnData(this.getColumnName(28), goodsOption);
 
 
     if (localStorage.getItem("roleName").indexOf("贸易") == -1 && localStorage.getItem("roleName").indexOf("运营") == -1) {
     if (localStorage.getItem("roleName").indexOf("贸易") == -1 && localStorage.getItem("roleName").indexOf("运营") == -1) {
@@ -1056,93 +1075,98 @@ export default {
       }
       }
       this.$refs.crud.rowAdd();
       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.partsValveName = null;
-          row.partsValveValue = null;
-          row.partsValveCostPrice = 0;
-          row.partsValveSalePrice = 0;
-          row.partsCapName = null;
-          row.partsCapValue = null;
-          row.partsCapCostPrice = 0;
-          row.partsCapSalePrice = 0;
-          row.partsHandleName = null;
-          row.partsHandleValue = null;
-          row.partsHandleCostPrice = 0;
-          row.partsHandleSalePrice = 0;
-          row.partsColourName = null;
-          row.partsColourValue = null;
-          row.partsColourCostPrice = 0;
-          row.partsColourSalePrice = 0;
-          row.partsModeName = null;
-          row.partsModeValue = null;
-          row.partsModeCostPrice = 0;
-          row.partsModeSalePrice = 0;
-          row.partsAuthenticationName = null;
-          row.partsAuthenticationValue = null;
-          row.partsAuthenticationCostPrice = 0;
-          row.partsAuthenticationSalePrice = 0;
-          row.partsOtherName = null;
-          row.partsOtherValue = null;
-          row.partsOtherCostPrice = 0;
-          row.partsOtherSalePrice = 0;
-          row.partsCost = 0;
-          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.internationalAmount = 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 = e.unit;
-          row.itemMargin = grossProfitCal(
-            e.purchaseAmount,
-            0,
-            sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate),
-            this.form.exchangeRate
-          );
-          // 处理单品毛利率是 -00.00 的问题
-          if (Number(row.itemMargin) === 0) {
-            row.itemMargin = Number(row.itemMargin) + "";
-          }
-          row.partsDescribe = null;
-          row.remarks = null;
-          row.exchangeRate = this.form.exchangeRate;
-          row.productRemark = e.ename;
-          (row.attributeList = this.getAttribute(e.goodsSpecificationList)), (row.referrerReason = e.referrerReason);
-        }
-      });
+    cnameChange(name, row)  {
+     this.upDataOption();
+      this.goodsForm.itemId = row.itemId;
+      this.goodsForm.code = row.code;
+      this.goodsForm.cname = row.cname;
+      this.goodsForm.ename = row.ename;
+      this.goodsForm.priceCategory = row.goodsTypeName;
+      this.goodsForm.purchaseCost = costCal(row.price, row.taxRate);
+      this.goodsForm.purchaseAmount = row.purchaseAmount;
+      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.partsValveName = null;
+      this.goodsForm.partsValveValue = null;
+      this.goodsForm.partsValveCostPrice = 0;
+      this.goodsForm.partsValveSalePrice = 0;
+      this.goodsForm.partsCapName = null;
+      this.goodsForm.partsCapValue = null;
+      this.goodsForm.partsCapCostPrice = 0;
+      this.goodsForm.partsCapSalePrice = 0;
+      this.goodsForm.partsHandleName = null;
+      this.goodsForm.partsHandleValue = null;
+      this.goodsForm.partsHandleCostPrice = 0;
+      this.goodsForm.partsHandleSalePrice = 0;
+      this.goodsForm.partsColourName = null;
+      this.goodsForm.partsColourValue = null;
+      this.goodsForm.partsColourCostPrice = 0;
+      this.goodsForm.partsColourSalePrice = 0;
+      this.goodsForm.partsModeName = null;
+      this.goodsForm.partsModeValue = null;
+      this.goodsForm.partsModeCostPrice = 0;
+      this.goodsForm.partsModeSalePrice = 0;
+      this.goodsForm.partsAuthenticationName = null;
+      this.goodsForm.partsAuthenticationValue = null;
+      this.goodsForm.partsAuthenticationCostPrice = 0;
+      this.goodsForm.partsAuthenticationSalePrice = 0;
+      this.goodsForm.partsOtherName = null;
+      this.goodsForm.partsOtherValue = null;
+      this.goodsForm.partsOtherCostPrice = 0;
+      this.goodsForm.partsOtherSalePrice = 0;
+      this.goodsForm.partsCost = 0;
+      this.goodsForm.corpId = row.corpId;
+      this.goodsForm.corpName = row.corpCode;
+      this.goodsForm.itemDescription = row.cnameDescription;
+      this.goodsForm.partsPrice = 0;
+      this.goodsForm.itemType = row.specs;
+      this.goodsForm.tradeTerms = null;
+      this.goodsForm.productPrice = productCal(row.purchaseAmount, 0, this.form.coefficient);
+      this.goodsForm.outFactoryPrice = sellingCal(productCal(row.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate, 3);
+      this.goodsForm.shareAmount = 0;
+      this.goodsForm.internationalAmount = 0;
+      this.goodsForm.totalValue = sellingCal(productCal(row.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
+      this.goodsForm.orderQuantity = 1;
+      this.goodsForm.insurance = 0;
+      this.goodsForm.freight = 0;
+      this.goodsForm.discount = null;
+      this.goodsForm.price = sellingCal(productCal(row.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
+      this.goodsForm.amount = sellingCal(productCal(row.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
+      this.goodsForm.taxRate = 0;
+      this.goodsForm.unit = row.unit;
+      this.goodsForm.itemMargin = grossProfitCal(
+        row.purchaseAmount,
+        0,
+        sellingCal(productCal(row.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate),
+        this.form.exchangeRate
+      );
+      this.goodsForm.goodsGrossProfit = goodsGrossProfitCal(
+        row.purchaseAmount,
+        0,
+        sellingCal(productCal(row.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate),
+        this.form.exchangeRate
+      );
+      this.goodsForm.partsDescribe = null;
+      this.goodsForm.remarks = null;
+      this.goodsForm.exchangeRate = this.form.exchangeRate;
+      this.goodsForm.productRemark = row.ename;
+      (this.goodsForm.attributeList = this.getAttribute(row.goodsSpecificationList)), (this.goodsForm.referrerReason = row.referrerReason);
+         // 处理单品毛利率是 -00.00 的问题
+      if (Number(this.goodsForm.itemMargin) === 0) {
+        this.goodsForm.itemMargin = Number(this.goodsForm.itemMargin) + "";
+      }
+      if (Number(this.goodsForm.goodsGrossProfit) == 0) {
+        this.goodsForm.goodsGrossProfit = Number(this.goodsForm.goodsGrossProfit);
+      }
     },
     },
     importLibray(rows) {
     importLibray(rows) {
       this.upDataOption();
       this.upDataOption();

+ 1 - 1
src/views/exportTrade/customerInquiry/components/goodsInfo.vue

@@ -132,7 +132,7 @@
             dataName="cname"
             dataName="cname"
             style="width: 100%;"
             style="width: 100%;"
             :slotRight="true"
             :slotRight="true"
-            rightLabel="corpName"
+            rightLabel="corpCode"
             @selectChange="cnameChange('cname', $event)"
             @selectChange="cnameChange('cname', $event)"
           ></dic-select>
           ></dic-select>
           <el-button icon="el-icon-search" size="small" @click="pickGoods"></el-button>
           <el-button icon="el-icon-search" size="small" @click="pickGoods"></el-button>

+ 1 - 1
src/views/exportTrade/salesContract/components/goodsInfo.vue

@@ -148,7 +148,7 @@
             :remote="true"
             :remote="true"
             dataName="cname"
             dataName="cname"
             :slotRight="true"
             :slotRight="true"
-            rightLabel="corpName"
+            rightLabel="corpCode"
             @selectChange="cnameChange('cname', $event)"
             @selectChange="cnameChange('cname', $event)"
           ></dic-select>
           ></dic-select>
           <el-button icon="el-icon-search" size="small" @click="pickGoods"></el-button>
           <el-button icon="el-icon-search" size="small" @click="pickGoods"></el-button>