QuKatie 3 éve
szülő
commit
6f3017228f

+ 12 - 0
src/api/basicData/customerInquiry.js

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

+ 133 - 0
src/views/exportTrade/customerInquiry/config/priceLibrary.json

@@ -0,0 +1,133 @@
+{
+  "border": true,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "addBtn": false,
+  "menu":false,
+  "align": "center",
+  "menuWidth": "180",
+  "selection": true,
+  "tip":false,
+  "column": [{
+      "label": "商品名称",
+      "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": "corpName",
+      "index": 4,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "币别",
+      "prop": "currency",
+      "index": 5,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "FOB系数",
+      "prop": "coefficient",
+      "index": 6,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "最新价格",
+      "prop": "price",
+      "index": 7,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "历史价格1",
+      "prop": "priceOne",
+      "index": 8,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "历史价格1日期",
+      "prop": "priceOneTime",
+      "index": 9,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "历史价格2",
+      "prop": "priceTwo",
+      "index": 10,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "历史价格2日期",
+      "prop": "priceTwoTime",
+      "index": 11,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "历史价格3",
+      "prop": "priceThree",
+      "index": 12,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "历史价格3日期",
+      "prop": "priceThreeTime",
+      "index": 13,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "备注",
+      "prop": "remarks",
+      "index": 14,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "有效期开始",
+      "prop": "startTime",
+      "index": 15,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "有效期结束",
+      "prop": "endTime",
+      "index": 16,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "业务员",
+      "prop": "person",
+      "index": 17,
+      "width": 100,
+      "overHidden": true
+    }
+  ]
+}

+ 44 - 1
src/views/exportTrade/customerInquiry/detailsPage.vue

@@ -121,6 +121,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"
@@ -389,6 +397,7 @@
       @partClosed="partClosed"
       @partReData="partReData"
     />
+    <price-library ref="library" @importLibray="importLibray" />
   </div>
 </template>
 
@@ -411,6 +420,7 @@ import {
   saveSell
 } from "@/api/basicData/customerInquiry";
 import reportDialog from "@/components/report-dialog/main";
+import priceLibrary from "./priceLibrary.vue";
 import { isDiscount, isPercentage, micrometerFormat } from "@/util/validate";
 import { contrastObj, contrastList } from "@/util/contrastData";
 import _ from "lodash";
@@ -728,7 +738,8 @@ export default {
     reportDialog,
     feeInfo,
     customerDialog,
-    partDialog
+    partDialog,
+    priceLibrary
   },
   async created() {
     this.tableOption = await this.getColumnData(
@@ -773,6 +784,9 @@ export default {
     }
   },
   methods: {
+    addLibrary() {
+      this.$refs.library.init();
+    },
     cnameChange(row) {
       this.goodsoptions.forEach(e => {
         if (e.cname == row.cname) {
@@ -1111,6 +1125,35 @@ 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
+        });
+      });
+    },
     //商品明细导入
     newDetails() {
       this.dialogVisible = !this.dialogVisible;

+ 109 - 0
src/views/exportTrade/customerInquiry/priceLibrary.vue

@@ -0,0 +1,109 @@
+<template>
+  <div>
+    <el-dialog
+      title="出口价格库"
+      :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"
+          @current-change="currentChange"
+          @size-change="sizeChange"
+          @refresh-change="refreshChange"
+          @on-load="getList"
+          @saveColumn="saveColumn"
+          @selection-change="selectionChange"
+          :cell-style="cellStyle"
+          :table-loading="loading"
+        >
+        </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 "./config/priceLibrary.json";
+import { getPricebank } from "@/api/basicData/customerInquiry";
+import { dateFormat } from "@/util/date";
+import _ from "lodash";
+export default {
+  data() {
+    return {
+      visible: false,
+      loading: true,
+      data: [],
+      tableOption: option,
+      height: window.innerHeight - 500,
+      page: {
+        currentPage: 1,
+        total: 0,
+        pageSize: 10
+      },
+      selectionList: []
+    };
+  },
+  props: {},
+  filters: {},
+  created() {},
+  methods: {
+    init() {
+      this.visible = true;
+      this.getList();
+    },
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    importData() {
+      this.visible = false;
+    },
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+    sizeChange(val) {
+      this.page.currentPage = 1;
+      this.page.pageSize = val;
+    },
+    getList() {
+      const data = {
+        billType: "CG",
+        statusTime: dateFormat(new Date(), "yyyy-MM-dd")
+      };
+      this.loading = true;
+      getPricebank(this.page.currentPage, this.page.pageSize, data)
+        .then(res => {
+          this.data = res.data.data.records ? res.data.data.records : [];
+          this.page.total = res.data.data.total;
+          console.log(this.page.total);
+          if (this.page.total > 0) {
+            this.tableOption.height = window.innerHeight - 500;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    selectionChange(list){
+      this.$emit('importLibray',list)
+      this.selectionList=list
+    },
+    closed(){
+       this.$refs.crud.toggleSelection();
+    }
+  },
+  watch: {}
+};
+</script>
+
+<style scoped lang="scss"></style>