QuKatie 3 лет назад
Родитель
Сommit
326ded15fd

+ 1 - 1
src/api/basicData/customerInquiry.js

@@ -124,7 +124,7 @@ export function gainUser(query) {
 //价格库列表页
 export const getPricebank = (current, size, params) => {
   return request({
-    url: '/api/blade-mocha-item/pricebank/list',
+    url: '/api/blade-mocha-item/pricebank/page',
     method: 'get',
     params: {
       ...params,

+ 4 - 6
src/components/part-dialog/main.vue

@@ -110,7 +110,6 @@ export default {
       return "padding:0;height:40px;";
     },
     rePick(row, index) {
-      console.log();
       this.$emit("partReData", {
         ...row,
         index: index
@@ -136,8 +135,8 @@ export default {
     rowAdd() {
       this.$emit("partOpen", true);
     },
-    init(rows, index) {
-      this.data = rows;
+    init(index) {
+      // this.data = rows;
       this.goodsIndex = index;
       this.partVisible = true;
     },
@@ -177,9 +176,9 @@ export default {
             let amountSum = 0;
             this.amoutSum = 0;
             data.forEach(e => {
-              qtySum = _.add(qtySum, Number(e.goodNumber));
+              qtySum =_.add(qtySum, Number(e.goodNumber));
               amountSum = _.add(amountSum, Number(e.amout));
-              this.amoutSum = amountSum;
+              this.amoutSum = Number(amountSum).toFixed(2);
             });
             //数量总计
             if (item.property == "goodNumber") {
@@ -197,7 +196,6 @@ export default {
   },
   watch: {
     partList: function(arr) {
-      console.log(arr);
       this.data = arr;
     }
   }

+ 213 - 0
src/components/price-Library/configuration/mainList.json

@@ -0,0 +1,213 @@
+{
+  "border": true,
+  "searchMenuSpan": 8,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "addBtn": false,
+  "menu": false,
+  "align": "center",
+  "menuWidth": "180",
+  "selection": true,
+  "tip": false,
+  "column": [{
+      "label": "商品名称",
+      "search": true,
+      "searchSpan": 8,
+      "prop": "cname",
+      "index": 1,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "规格",
+      "prop": "specs",
+      "index": 2,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "产品属性",
+      "prop": "goodNature",
+      "index": 3,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "供应商",
+      "prop": "corpId",
+      "index": 4,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "币别",
+      "prop": "currency",
+      "index": 5,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "汇率",
+      "prop": "exchangeRate",
+      "width": 100,
+      "index": 6,
+      "overHidden": true
+    },
+    {
+      "label": "FOB系数",
+      "prop": "coefficient",
+      "index": 7,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "价格类型",
+      "prop": "billType",
+      "index": 8,
+      "width": 100,
+      "overHidden": true,
+      "dicData": [],
+      "props": {
+        "label": "dictValue",
+        "value": "dictKey"
+      }
+    },
+    {
+      "label": "最新价格",
+      "prop": "price",
+      "index": 9,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "美元价格",
+      "prop": "greenback",
+      "index": 10,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "采购价格",
+      "prop": "purchaseAmount",
+      "index": 11,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "税率",
+      "prop": "taxRate",
+      "index": 12,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "商品类别",
+      "prop": "goodsTypeName",
+      "search": true,
+      "searchSpan": 8,
+      "index": 13,
+      "width": 100,
+      "type": "select",
+      "filterable": true,
+      "dicData": [],
+      "props": {
+        "value": "cname",
+        "label": "cname"
+      },
+      "overHidden": true
+    },
+    {
+      "label": "是否重点推荐",
+      "prop": "priorityReferrer",
+      "index": 14,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "推荐理由",
+      "prop": "referrerReason",
+      "index": 15,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "历史价格1",
+      "prop": "priceOne",
+      "index": 16,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "历史日期1",
+      "prop": "priceOneTime",
+      "index": 17,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "历史价格2",
+      "prop": "priceTwo",
+      "index": 18,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "历史日期2",
+      "prop": "priceTwoTime",
+      "index": 19,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "历史价格3",
+      "prop": "priceThree",
+      "index": 20,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "历史日期3",
+      "prop": "priceThreeTime",
+      "index": 21,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "备注",
+      "prop": "remarks",
+      "index": 22,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "有效期开始",
+      "prop": "startTime",
+      "index": 23,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "有效期结束",
+      "prop": "endTime",
+      "index": 24,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "业务员",
+      "prop": "person",
+      "index": 25,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "状态",
+      "prop": "status",
+      "index": 26,
+      "width": 100,
+      "overHidden": true
+    }
+  ]
+}

+ 160 - 0
src/components/price-Library/main.vue

@@ -0,0 +1,160 @@
+<template>
+  <div>
+    <el-dialog
+      title="出口价格库"
+      class="el-dialogDeep"
+      :visible.sync="visible"
+      width="60%"
+      append-to-body
+      @closed="closed"
+      v-dialog-drag
+    >
+      <span>
+        <avue-crud
+          ref="crud"
+          :data="data"
+          :option="tableOption"
+          :page.sync="page"
+          :search.sync="search"
+          @search-change="searchChange"
+          @current-change="currentChange"
+          @size-change="sizeChange"
+          @refresh-change="refreshChange"
+          @on-load="getList"
+          @saveColumn="saveColumn"
+          @selection-change="selectionChange"
+          :cell-style="cellStyle"
+          :table-loading="loading"
+        >
+          <template slot="cnameSearch">
+            <goods-select
+              v-model="search.cname"
+              :configuration="goodsConfiguration"
+            />
+          </template>
+          <template slot="corpId" slot-scope="{ row }">
+            <span>{{ row.corpName }}</span>
+          </template>
+        </avue-crud>
+      </span>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="visible = false">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="importData"
+          :disabled="selectionList.length == 0"
+          >导 入</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import option from "./configuration/mainList.json";
+import { getPricebank, getGoodstype } from "@/api/basicData/customerInquiry";
+import { dateFormat } from "@/util/date";
+import _ from "lodash";
+export default {
+  data() {
+    return {
+      visible: false,
+      loading: true,
+      data: [],
+      search: {},
+      tableOption: option,
+      height: window.innerHeight - 500,
+      page: {
+        currentPage: 1,
+        total: 0,
+        pageSize: 10
+      },
+      selectionList: [],
+      goodsConfiguration: {
+        multipleChoices: false,
+        multiple: false,
+        collapseTags: false,
+        placeholder: "请点击右边按钮选择",
+        dicData: [],
+        clearable: true
+      },
+      partType: false,
+      partreData: false
+    };
+  },
+  props: {},
+  filters: {},
+  created() {
+    getGoodstype(1, 500).then(res => {
+      this.findObject(this.tableOption.column, "goodsTypeName").dicData =
+        res.data.data.records;
+    });
+  },
+  methods: {
+    init(status, partreData) {
+      this.partType = status;
+      this.partreData = partreData;
+      this.visible = true;
+      this.getList(this.page, this.search);
+    },
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    importData() {
+      if (this.partreData) {
+        if (this.selectionList.length != 1) {
+          return this.$message.error("重新选择的时候只能选择一条数据");
+        }
+      }
+      this.visible = false;
+      this.$emit("importLibray", this.selectionList, this.partType);
+    },
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+    sizeChange(val) {
+      this.page.currentPage = 1;
+      this.page.pageSize = val;
+    },
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      if (params.dateValidity) {
+        params.dateValidityStart = params.dateValidity[0];
+        params.dateValidityEnd = params.dateValidity[1];
+      }
+      delete params.dateValidity;
+      this.getList(this.page, params);
+      done();
+    },
+    getList(page, params) {
+      const data = {
+        ...params,
+        billType: "CG",
+        statusTime: dateFormat(new Date(), "yyyy-MM-dd")
+      };
+      this.loading = true;
+      getPricebank(page.currentPage, page.pageSize, data)
+        .then(res => {
+          this.data = res.data.data.records ? res.data.data.records : [];
+          this.page.total = res.data.data.total;
+          if (this.page.total > 0) {
+            this.tableOption.height = window.innerHeight - 500;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    closed() {
+      this.partreData = null;
+      this.$refs.crud.toggleSelection();
+    }
+  },
+  watch: {}
+};
+</script>
+
+<style scoped lang="scss"></style>

+ 3 - 1
src/util/contrastData.js

@@ -1,8 +1,10 @@
 //比较对象的值
 export function contrastObj(newval, oldval) {
+  console.log(newval, oldval)
   let reg = /^[A-Za-z]+$/;
   for (let key in newval) {
-    if (reg.test(key) && (newval[key] != oldval[key] && (newval[key] || oldval[key]))) {
+    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
     }
   }

+ 2 - 4
src/views/exportTrade/customerInquiry/config/customerContact.json

@@ -79,8 +79,7 @@
       "prop": "partsDescribe",
       "index": 9,
       "width": 120,
-      "overHidden": true,
-      "cell": true
+      "overHidden": true
     },
     {
       "label": "配件价格",
@@ -94,8 +93,7 @@
       "prop": "partsPriceDescribe",
       "index": 11,
       "width": 120,
-      "overHidden": true,
-      "cell": true
+      "overHidden": true
     },
     {
       "label": "供应商",

+ 96 - 70
src/views/exportTrade/customerInquiry/detailsPage.vue

@@ -54,6 +54,7 @@
               v-model="form.corpId"
               :configuration="configuration"
               :disabled="detailData.status == 1"
+              @getRow="rowCorpdata"
             ></select-component>
           </template>
           <template slot="boxNumber">
@@ -429,7 +430,7 @@ import {
   saveSell
 } from "@/api/basicData/customerInquiry";
 import reportDialog from "@/components/report-dialog/main";
-import priceLibrary from "./priceLibrary.vue";
+import priceLibrary from "@/components/price-Library/main";
 import { isDiscount, isPercentage, micrometerFormat } from "@/util/validate";
 import { contrastObj, contrastList } from "@/util/contrastData";
 import _ from "lodash";
@@ -798,7 +799,13 @@ export default {
       return "padding:0;height:40px;";
     },
     addLibrary() {
-      this.$refs.library.init();
+      if (!this.form.corpId) {
+        return this.$message.error("请选择客户名称");
+      }
+      this.$refs.library.init(this.partType, this.partreData != null);
+    },
+    rowCorpdata(row) {
+      this.form.coefficient = row.coefficient;
     },
     cnameChange(row) {
       this.goodsoptions.forEach(e => {
@@ -835,7 +842,7 @@ export default {
     },
     partOpen() {
       this.partType = true;
-      this.newDetails();
+      this.addLibrary();
     },
     rePick(row, index) {
       this.reData = {
@@ -846,16 +853,27 @@ export default {
     },
     partrePick(row, index) {
       this.partList = row.partsList;
-      this.$refs.part.init(row.partsList, index);
+      this.$refs.part.init(index);
     },
     importPart(rows, sum, index) {
       this.data[index].partsList = rows;
       this.data[index].partsPrice = sum;
+      const names = [];
+      const namePrices = [];
+      rows.map(e => {
+        names.push(e.goodName);
+        namePrices.push(e.goodName + ":" + e.price);
+      });
+      this.data[index].partsDescribe = names.join(",");
+      this.data[index].partsPriceDescribe = namePrices.join(";");
       this.priceChange(this.data[index]);
     },
     partClosed() {
       this.partList = [];
       this.partreData = null;
+      if (this.partType) {
+        this.partType = false;
+      }
     },
     getcorpId(row) {
       this.data[row.index].corpId = row.id;
@@ -1006,41 +1024,7 @@ export default {
       });
     },
     importGoods() {
-      if (this.partType) {
-        if (this.partreData) {
-          if (this.selectionList.length != 1) {
-            return this.$message.error("重新选择的时候只能选择一条数据");
-          } else {
-            this.selectionList.forEach(e => {
-              this.partList.forEach((item, index) => {
-                if (index == this.partreData.index) {
-                  item.goodId = e.id;
-                  item.goodTypeId = e.goodsTypeId;
-                  item.goodTypeName = e.goodsTypeName;
-                  item.goodName = e.cname;
-                  item.price = this.partreData.goodNumber;
-                  item.goodNumber = this.partreData.goodNumber;
-                  item.amout = this.partreData.amout;
-                  item.$cellEdit = true;
-                }
-              });
-            });
-          }
-        } else {
-          this.selectionList.forEach(e => {
-            this.partList.push({
-              goodId: e.id,
-              goodTypeId: e.goodsTypeId,
-              goodTypeName: e.goodsTypeName,
-              goodName: e.cname,
-              price: e.price,
-              goodNumber: 0,
-              amout: 0,
-              $cellEdit: true
-            });
-          });
-        }
-      } else if (this.reData) {
+      if (this.reData) {
         if (this.selectionList.length != 1) {
           return this.$message.error("重新选择的时候只能选择一条数据");
         } else {
@@ -1105,9 +1089,6 @@ export default {
       this.selectionList = [];
       this.treeDeptId = "";
       this.reData = null;
-      if (this.partType) {
-        this.partType = false;
-      }
     },
     selectionChange(list) {
       this.selectionList = list;
@@ -1138,37 +1119,83 @@ export default {
           this.loading = false;
         });
     },
-    importLibray(rows) {
-      rows.forEach(e => {
-        this.data.push({
-          itemId: e.id,
-          code: e.code,
-          cname: e.cname,
-          priceCategory: e.goodsTypeName,
-          purchaseAmount: e.price,
-          itemProp: e.goodNature,
-          corpId: e.corpId,
-          corpName: e.corpName,
-          itemDescription: null,
-          partsList: [],
-          partsPrice: 0,
-          itemType: null,
-          tradeTerms: null,
-          price: 0,
-          orderQuantity: 0,
-          insurance: 0,
-          freight: 0,
-          discount: null,
-          amount: 0,
-          taxRate: 0,
-          unit: e.unit,
-          remarks: null,
-          $cellEdit: true
+    importLibray(rows, status) {
+      if (status) {
+        if (this.partreData) {
+          rows.forEach(e => {
+            this.partList.forEach((item, index) => {
+              if (index == this.partreData.index) {
+                item.goodId = e.id;
+                item.goodTypeId = e.goodTypeId;
+                item.goodTypeName = e.goodsTypeName;
+                item.goodName = e.cname;
+                item.price = e.purchaseAmount;
+                item.goodNumber = this.partreData.goodNumber;
+                item.amout = _.multiply(
+                  Number(
+                    this.partreData.goodNumber ? this.partreData.goodNumber : 0
+                  ),
+                  Number(e.purchaseAmount ? e.purchaseAmount : 0)
+                );
+                this.partreData.amout;
+                item.$cellEdit = true;
+              }
+            });
+          });
+        } else {
+          rows.forEach(e => {
+            this.partList.push({
+              goodId: e.id,
+              goodTypeId: e.goodTypeId,
+              goodTypeName: e.goodsTypeName,
+              goodName: e.cname,
+              price: e.purchaseAmount,
+              goodNumber: 0,
+              amout: 0,
+              $cellEdit: true
+            });
+          });
+        }
+      } else {
+        rows.forEach(e => {
+          this.data.push({
+            itemId: e.id,
+            code: e.code,
+            cname: e.cname,
+            priceCategory: e.goodsTypeName,
+            purchaseAmount: e.purchaseAmount,
+            itemProp: e.goodNature,
+            corpId: e.corpId,
+            corpName: e.corpName,
+            itemDescription: null,
+            partsList: [],
+            partsPrice: 0,
+            itemType: null,
+            tradeTerms: null,
+            price: Number(
+              _.multiply(
+                Number(e.purchaseAmount),
+                Number(_.add(1, _.divide(Number(this.form.coefficient), 100)))
+              )
+            ).toFixed(2),
+            orderQuantity: 0,
+            insurance: 0,
+            freight: 0,
+            discount: null,
+            amount: 0,
+            taxRate: 0,
+            unit: e.unit,
+            remarks: null,
+            $cellEdit: true
+          });
         });
-      });
+      }
     },
     //商品明细导入
     newDetails() {
+      if (!this.form.corpId) {
+        return this.$message.error("请选择客户名称");
+      }
       this.dialogVisible = !this.dialogVisible;
     },
     getDetail(id) {
@@ -1180,7 +1207,6 @@ export default {
           this.form = res.data.data;
           this.data = res.data.data.orderItemsList;
           this.orderFeesList = res.data.data.orderFeesList;
-          this.configuration.dicData = this.form.corpName;
           this.oldform = res.data.data;
           this.olddata = this.deepClone(res.data.data.orderItemsList);
           this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);

+ 16 - 3
src/views/exportTrade/customerInquiry/priceLibrary.vue

@@ -32,6 +32,9 @@
               :configuration="goodsConfiguration"
             />
           </template>
+          <template slot="corpId" slot-scope="{ row }">
+            <span>{{ row.corpName }}</span>
+          </template>
         </avue-crud>
       </span>
       <span slot="footer" class="dialog-footer">
@@ -74,7 +77,9 @@ export default {
         placeholder: "请点击右边按钮选择",
         dicData: [],
         clearable: true
-      }
+      },
+      partType: false,
+      partreData: false
     };
   },
   props: {},
@@ -86,7 +91,9 @@ export default {
     });
   },
   methods: {
-    init() {
+    init(status, partreData) {
+      this.partType = status;
+      this.partreData = partreData;
       this.visible = true;
       this.getList(this.page, this.search);
     },
@@ -94,8 +101,13 @@ export default {
       return "padding:0;height:40px;";
     },
     importData() {
+      if (this.partreData) {
+        if (this.selectionList.length != 1) {
+          return this.$message.error("重新选择的时候只能选择一条数据");
+        }
+      }
       this.visible = false;
-      this.$emit("importLibray", this.selectionList);
+      this.$emit("importLibray", this.selectionList, this.partType);
     },
     currentChange(val) {
       this.page.currentPage = val;
@@ -137,6 +149,7 @@ export default {
       this.selectionList = list;
     },
     closed() {
+      this.partreData = null;
       this.$refs.crud.toggleSelection();
     }
   },

+ 1 - 1
src/views/exportTrade/invoice/config/customerContact.json

@@ -58,7 +58,7 @@
     },
     {
       "label": "产品描述",
-      "prop": "itemDescription",
+      "prop": "productDesc",
       "index": 7,
       "width": 100,
       "overHidden": true,

+ 2 - 4
src/views/exportTrade/invoice/detailsPage.vue

@@ -592,7 +592,7 @@ export default {
                 item.priceCategory = e.goodsTypeName;
                 item.itemUrl = e.url;
                 item.itemProp = this.reData.itemProp;
-                item.itemDescription = e.cnameDescription;
+                item.productDesc = e.cnameDescription;
                 item.itemType = this.reData.itemType;
                 item.tradeTerms = this.reData.tradeTerms;
                 item.price = this.reData.price;
@@ -618,7 +618,7 @@ export default {
             priceCategory: e.goodsTypeName,
             itemUrl: e.url,
             itemProp: null,
-            itemDescription: e.cnameDescription,
+            productDesc: e.cnameDescription,
             itemType: null,
             tradeTerms: null,
             price: 0,
@@ -681,7 +681,6 @@ export default {
           this.data = res.data.data.deliveryItemsList;
           this.orderFeesList = res.data.data.deliveryFeesList;
           this.orderFilesList = res.data.data.deliveryFilesList;
-          this.configuration.dicData = this.form.corpName;
           this.oldform = res.data.data;
           this.olddata = this.deepClone(res.data.data.deliveryItemsList);
           this.oldorderFeesList = this.deepClone(
@@ -701,7 +700,6 @@ export default {
       this.form = data;
       this.data = data.orderItemsList;
       this.orderFeesList = data.deliveryFeesList;
-      this.configuration.dicData = data.corpName;
     },
     //修改提交触发
     editCustomer(status, status2) {

+ 1 - 2
src/views/exportTrade/purchaseContract/detailsPage.vue

@@ -790,7 +790,6 @@ export default {
           this.orderFilesList = res.data.data.orderFilesList
             ? res.data.data.orderFilesList
             : [];
-          this.configuration.dicData = this.form.corpsName;
           this.oldform = res.data.data;
           this.olddata = this.deepClone(
             res.data.data.itemsVOList ? res.data.data.itemsVOList : []
@@ -935,7 +934,7 @@ export default {
         e.srcId = e.id;
         e.packageRemarks = e.itemProp;
         e.productDesc = e.itemDescription;
-        e.specificationAndModele = e.itemType;
+        e.specificationAndModel = e.itemType;
         delete e.id;
         delete e.version;
         delete e.status;

+ 0 - 3
src/views/exportTrade/purchaseInquiry/detailsPage.vue

@@ -622,7 +622,6 @@ export default {
           this.data = res.data.data.orderItemsList
             ? res.data.data.orderItemsList
             : [];
-          this.configuration.dicData = this.form.corpsName;
           this.oldform = res.data.data;
           this.olddata = this.deepClone(
             res.data.data.orderItemsList ? res.data.data.orderItemsList : []
@@ -649,7 +648,6 @@ export default {
                 this.data = res.data.data.orderItemsList
                   ? res.data.data.orderItemsList
                   : [];
-                this.configuration.dicData = this.form.corpsName;
                 this.$message.success("修改成功");
                 this.oldform = res.data.data;
                 this.olddata = this.deepClone(
@@ -674,7 +672,6 @@ export default {
               this.data = res.data.data.orderItemsList
                 ? res.data.data.orderItemsList
                 : [];
-              this.configuration.dicData = this.form.corpsName;
               this.$message.success("提交成功");
               this.oldform = res.data.data;
               this.olddata = this.deepClone(

+ 0 - 5
src/views/exportTrade/receipt/detailsPage.vue

@@ -525,7 +525,6 @@ export default {
       this.form = data;
       this.data = data.orderItemsList;
       this.orderFeesList = data.deliveryFeesList ? data.deliveryFeesList : [];
-      this.configuration.dicData = data.corpName;
     },
     itemTypeFocus(row) {
       this.itemtypeList = [];
@@ -696,7 +695,6 @@ export default {
           this.data = res.data.data.deliveryItemsList;
           this.orderFeesList = res.data.data.deliveryFeesList;
           this.orderFilesList = res.data.data.deliveryFilesList;
-          this.configuration.dicData = this.form.corpName;
           this.oldform = res.data.data;
           this.olddata = this.deepClone(res.data.data.deliveryItemsList);
           this.oldorderFeesList = this.deepClone(
@@ -750,7 +748,6 @@ export default {
                 this.oldorderFilesList = this.deepClone(
                   res.data.data.deliveryFilesList
                 );
-                this.configuration.dicData = this.form.corpName;
                 this.$message.success(this.form.id ? "修改成功" : "提交成功");
                 if (status2 == "goBack") {
                   this.$emit("goBack");
@@ -776,7 +773,6 @@ export default {
                 this.data = res.data.data.deliveryItemsList;
                 this.orderFeesList = res.data.data.deliveryFeesList;
                 this.orderFilesList = res.data.data.deliveryFilesList;
-                this.configuration.dicData = this.form.corpName;
                 this.$message.success("提交成功");
                 this.oldform = res.data.data;
                 this.olddata = this.deepClone(res.data.data.deliveryItemsList);
@@ -805,7 +801,6 @@ export default {
                 this.data = res.data.data.deliveryItemsList;
                 this.orderFeesList = res.data.data.deliveryFeesList;
                 this.orderFilesList = res.data.data.deliveryFilesList;
-                this.configuration.dicData = this.form.corpName;
                 this.$message.success("撤销成功");
                 this.oldform = res.data.data;
                 this.olddata = this.deepClone(res.data.data.deliveryItemsList);

+ 2 - 4
src/views/exportTrade/salesContract/config/customerContact.json

@@ -81,8 +81,7 @@
       "prop": "partsDescribe",
       "index": 9,
       "width": 120,
-      "overHidden": true,
-      "cell": true
+      "overHidden": true
     },
     {
       "label": "配件价格",
@@ -96,8 +95,7 @@
       "prop": "partsPriceDescribe",
       "index": 11,
       "width": 120,
-      "overHidden": true,
-      "cell": true
+      "overHidden": true
     },
     {
       "label": "供应商",

+ 111 - 42
src/views/exportTrade/salesContract/detailsPage.vue

@@ -54,6 +54,7 @@
               v-model="form.corpId"
               :configuration="configuration"
               :disabled="detailData.status == 1"
+              @getRow="rowCorpdata"
             ></select-component>
           </template>
           <template slot="boxNumber">
@@ -286,6 +287,14 @@
                 >新增明细</el-button
               >
               <el-button
+                type="primary"
+                icon="el-icon-plus"
+                size="small"
+                @click.stop="addLibrary"
+                :disabled="detailData.status == 1"
+                >出口价格库</el-button
+              >
+              <el-button
                 type="info"
                 icon="el-icon-printer"
                 size="small"
@@ -434,6 +443,7 @@
       @partClosed="partClosed"
       @partReData="partReData"
     />
+    <price-library ref="library" @importLibray="importLibray" />
   </div>
 </template>
 
@@ -459,6 +469,7 @@ import partDialog from "@/components/part-dialog/main";
 import { micrometerFormat } from "@/util/validate";
 import { contrastObj, contrastList } from "@/util/contrastData";
 import customerDialog from "@/components/customer-dialog/main";
+import priceLibrary from "@/components/price-Library/main";
 export default {
   name: "detailsPageEdit",
   data() {
@@ -821,7 +832,8 @@ export default {
     feeInfo,
     uploadFile,
     customerDialog,
-    partDialog
+    partDialog,
+    priceLibrary
   },
   async created() {
     if (this.detailData.id) {
@@ -861,6 +873,9 @@ export default {
     cellStyle() {
       return "padding:0;height:40px;";
     },
+    rowCorpdata(row) {
+      this.form.coefficient = row.coefficient;
+    },
     cnameChange(row) {
       this.goodsoptions.forEach(e => {
         if (e.cname == row.cname) {
@@ -879,20 +894,37 @@ export default {
     },
     partOpen() {
       this.partType = true;
-      this.newDetails();
+      this.addLibrary();
+    },
+    addLibrary() {
+      if (!this.form.corpId) {
+        return this.$message.error("请选择客户名称");
+      }
+      this.$refs.library.init(this.partType, this.partreData != null);
     },
     partrePick(row, index) {
       this.partList = row.partsList;
-      this.$refs.part.init(row.partsList, index);
+      this.$refs.part.init(index);
     },
     importPart(rows, sum, index) {
       this.data[index].partsList = rows;
       this.data[index].partsPrice = sum;
+      const names = [];
+      const namePrices = [];
+      rows.map(e => {
+        names.push(e.goodName);
+        namePrices.push(e.goodName + ":" + e.price);
+      });
+      this.data[index].partsDescribe = names.join(",");
+      this.data[index].partsPriceDescribe = namePrices.join(";");
       this.priceChange(this.data[index]);
     },
     partClosed() {
       this.partList = [];
       this.partreData = null;
+      if (this.partType) {
+        this.partType = false;
+      }
     },
     saveSell() {
       if (!this.form.id) {
@@ -1034,41 +1066,7 @@ export default {
       });
     },
     importGoods() {
-      if (this.partType) {
-        if (this.partreData) {
-          if (this.selectionList.length != 1) {
-            return this.$message.error("重新选择的时候只能选择一条数据");
-          } else {
-            this.selectionList.forEach(e => {
-              this.partList.forEach((item, index) => {
-                if (index == this.partreData.index) {
-                  item.goodId = e.id;
-                  item.goodTypeId = e.goodsTypeId;
-                  item.goodTypeName = e.goodsTypeName;
-                  item.goodName = e.cname;
-                  item.price = this.partreData.goodNumber;
-                  item.goodNumber = this.partreData.goodNumber;
-                  item.amout = this.partreData.amout;
-                  item.$cellEdit = true;
-                }
-              });
-            });
-          }
-        } else {
-          this.selectionList.forEach(e => {
-            this.partList.push({
-              goodId: e.id,
-              goodTypeId: e.goodsTypeId,
-              goodTypeName: e.goodsTypeName,
-              goodName: e.cname,
-              price: e.price,
-              goodNumber: 0,
-              amout: 0,
-              $cellEdit: true
-            });
-          });
-        }
-      } else if (this.reData) {
+      if (this.reData) {
         if (this.selectionList.length != 1) {
           return this.$message.error("重新选择的时候只能选择一条数据");
         } else {
@@ -1133,9 +1131,6 @@ export default {
       this.selectionList = [];
       this.treeDeptId = "";
       this.reData = null;
-      if (this.partType) {
-        this.partType = false;
-      }
     },
     goodsSelectionChange(list) {
       this.orderItemIds = [];
@@ -1169,8 +1164,82 @@ export default {
         }
       });
     },
+    importLibray(rows, status) {
+      if (status) {
+        if (this.partreData) {
+          rows.forEach(e => {
+            this.partList.forEach((item, index) => {
+              if (index == this.partreData.index) {
+                item.goodId = e.id;
+                item.goodTypeId = e.goodTypeId;
+                item.goodTypeName = e.goodsTypeName;
+                item.goodName = e.cname;
+                item.price = e.purchaseAmount;
+                item.goodNumber = this.partreData.goodNumber;
+                item.amout = _.multiply(
+                  Number(
+                    this.partreData.goodNumber ? this.partreData.goodNumber : 0
+                  ),
+                  Number(e.purchaseAmount ? e.purchaseAmount : 0)
+                );
+                item.$cellEdit = true;
+              }
+            });
+          });
+        } else {
+          rows.forEach(e => {
+            this.partList.push({
+              goodId: e.id,
+              goodTypeId: e.goodTypeId,
+              goodTypeName: e.goodsTypeName,
+              goodName: e.cname,
+              price: e.purchaseAmount,
+              goodNumber: 0,
+              amout: 0,
+              $cellEdit: true
+            });
+          });
+        }
+      } else {
+        rows.forEach(e => {
+          this.data.push({
+            itemId: e.id,
+            code: e.code,
+            cname: e.cname,
+            priceCategory: e.goodsTypeName,
+            purchaseAmount: e.purchaseAmount,
+            itemProp: e.goodNature,
+            corpId: e.corpId,
+            corpName: e.corpName,
+            itemDescription: null,
+            partsList: [],
+            partsPrice: 0,
+            itemType: null,
+            tradeTerms: null,
+            price: Number(
+              _.multiply(
+                Number(e.purchaseAmount),
+                Number(_.add(1, _.divide(Number(this.form.coefficient), 100)))
+              )
+            ).toFixed(2),
+            orderQuantity: 0,
+            insurance: 0,
+            freight: 0,
+            discount: null,
+            amount: 0,
+            taxRate: 0,
+            unit: e.unit,
+            remarks: null,
+            $cellEdit: true
+          });
+        });
+      }
+    },
     //商品明细导入
     newDetails() {
+      if (!this.form.corpId) {
+        return this.$message.error("请选择客户名称");
+      }
       this.dialogVisible = !this.dialogVisible;
     },
     getDetail(id) {
@@ -1182,7 +1251,6 @@ export default {
           this.data = res.data.data.orderItemsList;
           this.orderFeesList = res.data.data.orderFeesList;
           this.orderFilesList = res.data.data.orderFilesList;
-          this.configuration.dicData = this.form.corpName;
           this.oldform = res.data.data;
           this.olddata = this.deepClone(res.data.data.orderItemsList);
           this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
@@ -1307,6 +1375,7 @@ export default {
               e.contractAmount = e.amount;
               e.srcId = e.id;
               e.specificationAndModel = e.itemType;
+              e.productDesc=e.itemDescription
               delete e.id;
               delete e.version;
               delete e.status;

+ 0 - 3
src/views/exportTrade/shippingInquiry/detailsPage.vue

@@ -480,7 +480,6 @@ export default {
           this.freightData = res.data.data.orderFreightList
             ? res.data.data.orderFreightList
             : [];
-          this.configuration.dicData = this.form.corpsName;
           this.oldform = res.data.data;
           this.olddata = this.deepClone(
             res.data.data.itemsVOList ? res.data.data.itemsVOList : []
@@ -517,7 +516,6 @@ export default {
                 this.freightData = res.data.data.orderFreightList
                   ? res.data.data.orderFreightList
                   : [];
-                this.configuration.dicData = this.form.corpsName;
                 this.oldform = res.data.data;
                 this.olddata = this.deepClone(
                   res.data.data.itemsVOList ? res.data.data.itemsVOList : []
@@ -548,7 +546,6 @@ export default {
               this.freightData = res.data.data.orderFreightList
                 ? res.data.data.orderFreightList
                 : [];
-              this.configuration.dicData = this.form.corpsName;
               this.oldform = res.data.data;
               this.olddata = this.deepClone(
                 res.data.data.itemsVOList ? res.data.data.itemsVOList : []

+ 1 - 1
src/views/maintenance/priceLibrary/index.vue

@@ -278,7 +278,7 @@ export default {
           this.dataList = res.data.data.records ? res.data.data.records : [];
           this.page.total = res.data.data.total;
           if (this.page.total) {
-            this.option.height = window.innerHeight - 300;
+            this.option.height = window.innerHeight - 260;
           }
         })
         .finally(() => {