Browse Source

修改bug

QuKatie 3 years ago
parent
commit
e60806704c

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

@@ -132,4 +132,15 @@ export const getPricebank = (current, size, params) => {
       size,
     }
   })
+}
+//商品类别列表查询
+export const getGoodstype = (current, size) => {
+  return request({
+    url: '/api/blade-client/goodstype/page',
+    method: 'get',
+    params: {
+      current,
+      size,
+    }
+  })
 }

+ 11 - 0
src/api/maintenance/priceLibrary.js

@@ -121,3 +121,14 @@ export function gainUser(query) {
     params: query
   })
 }
+//商品类别列表查询
+export const getGoodstype = (current, size) => {
+  return request({
+    url: '/api/blade-client/goodstype/page',
+    method: 'get',
+    params: {
+      current,
+      size,
+    }
+  })
+}

+ 18 - 0
src/enums/tax-rate.js

@@ -0,0 +1,18 @@
+//税率
+export const taxRates = [{
+  code: 3,
+  name: '3%'
+}, {
+  code: 6,
+  name: '6%'
+}, {
+  code: 9,
+  name: '9%'
+}, {
+  code: 13,
+  name: '13%'
+}]
+// 订单状态过滤器
+export const taxRateFormat = (num) => {
+  return Number(num?num:0)+'%'
+}

+ 98 - 18
src/views/exportTrade/customerInquiry/config/priceLibrary.json

@@ -1,17 +1,20 @@
 {
   "border": true,
+  "searchMenuSpan": 8,
   "index": true,
   "viewBtn": false,
   "editBtn": false,
   "delBtn": false,
   "addBtn": false,
-  "menu":false,
+  "menu": false,
   "align": "center",
   "menuWidth": "180",
   "selection": true,
-  "tip":false,
+  "tip": false,
   "column": [{
       "label": "商品名称",
+      "search": true,
+      "searchSpan": 8,
       "prop": "cname",
       "index": 1,
       "width": 100,
@@ -33,7 +36,7 @@
     },
     {
       "label": "供应商",
-      "prop": "corpName",
+      "prop": "corpId",
       "index": 4,
       "width": 100,
       "overHidden": true
@@ -46,86 +49,163 @@
       "overHidden": true
     },
     {
+      "label": "汇率",
+      "prop": "exchangeRate",
+      "width": 100,
+      "index": 6,
+      "overHidden": true
+    },
+    {
       "label": "FOB系数",
       "prop": "coefficient",
-      "index": 6,
+      "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": 7,
+      "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": 8,
+      "index": 16,
       "width": 100,
       "overHidden": true
     },
     {
-      "label": "历史价格1日期",
+      "label": "历史日期1",
       "prop": "priceOneTime",
-      "index": 9,
+      "index": 17,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "历史价格2",
       "prop": "priceTwo",
-      "index": 10,
+      "index": 18,
       "width": 100,
       "overHidden": true
     },
     {
-      "label": "历史价格2日期",
+      "label": "历史日期2",
       "prop": "priceTwoTime",
-      "index": 11,
+      "index": 19,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "历史价格3",
       "prop": "priceThree",
-      "index": 12,
+      "index": 20,
       "width": 100,
       "overHidden": true
     },
     {
-      "label": "历史价格3日期",
+      "label": "历史日期3",
       "prop": "priceThreeTime",
-      "index": 13,
+      "index": 21,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "备注",
       "prop": "remarks",
-      "index": 14,
+      "index": 22,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "有效期开始",
       "prop": "startTime",
-      "index": 15,
+      "index": 23,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "有效期结束",
       "prop": "endTime",
-      "index": 16,
+      "index": 24,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "业务员",
       "prop": "person",
-      "index": 17,
+      "index": 25,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "状态",
+      "prop": "status",
+      "index": 26,
       "width": 100,
       "overHidden": true
     }

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

@@ -1248,7 +1248,6 @@ export default {
     //返回列表
     backToList() {
       let orderFeesList = this.$refs.feeInfo.submitData();
-      console.log(this.data, this.olddata);
       if (
         contrastObj(this.form, this.oldform) ||
         contrastList(this.data, this.olddata) ||

+ 0 - 19
src/views/exportTrade/customerInquiry/index.vue

@@ -159,25 +159,6 @@ export default {
       this.findObject(this.option.column, "orderStatus").dicData =
         res.data.data;
     });
-    let _this = this;
-    this.option.column.forEach(e => {
-      if (e.prop == "exchangeRate") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.exchangeRate ? row.exchangeRate : 0) / 100,
-            "0.00%"
-          );
-        };
-      }
-      if (e.prop == "creditAmount") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.creditAmount ? row.creditAmount : 0),
-            "#,##0.00"
-          );
-        };
-      }
-    });
     gainUser().then(res => {
       this.findObject(this.option.column, "createUser").dicData = res.data.data;
     });

+ 50 - 13
src/views/exportTrade/customerInquiry/priceLibrary.vue

@@ -15,6 +15,8 @@
           :data="data"
           :option="tableOption"
           :page.sync="page"
+          :search.sync="search"
+          @search-change="searchChange"
           @current-change="currentChange"
           @size-change="sizeChange"
           @refresh-change="refreshChange"
@@ -24,11 +26,22 @@
           :cell-style="cellStyle"
           :table-loading="loading"
         >
+          <template slot="cnameSearch">
+            <goods-select
+              v-model="search.cname"
+              :configuration="goodsConfiguration"
+            />
+          </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>
+        <el-button
+          type="primary"
+          @click="importData"
+          :disabled="selectionList.length == 0"
+          >导 入</el-button
+        >
       </span>
     </el-dialog>
   </div>
@@ -36,7 +49,7 @@
 
 <script>
 import option from "./config/priceLibrary.json";
-import { getPricebank } from "@/api/basicData/customerInquiry";
+import { getPricebank, getGoodstype } from "@/api/basicData/customerInquiry";
 import { dateFormat } from "@/util/date";
 import _ from "lodash";
 export default {
@@ -45,6 +58,7 @@ export default {
       visible: false,
       loading: true,
       data: [],
+      search: {},
       tableOption: option,
       height: window.innerHeight - 500,
       page: {
@@ -52,23 +66,36 @@ export default {
         total: 0,
         pageSize: 10
       },
-      selectionList: []
+      selectionList: [],
+      goodsConfiguration: {
+        multipleChoices: false,
+        multiple: false,
+        collapseTags: false,
+        placeholder: "请点击右边按钮选择",
+        dicData: [],
+        clearable: true
+      }
     };
   },
   props: {},
   filters: {},
-  created() {},
+  created() {
+    getGoodstype(1, 500).then(res => {
+      this.findObject(this.tableOption.column, "goodsTypeName").dicData =
+        res.data.data.records;
+    });
+  },
   methods: {
     init() {
       this.visible = true;
-      this.getList();
+      this.getList(this.page, this.search);
     },
     cellStyle() {
       return "padding:0;height:40px;";
     },
     importData() {
       this.visible = false;
-      this.$emit('importLibray',this.selectionList)
+      this.$emit("importLibray", this.selectionList);
     },
     currentChange(val) {
       this.page.currentPage = val;
@@ -77,17 +104,27 @@ export default {
       this.page.currentPage = 1;
       this.page.pageSize = val;
     },
-    getList() {
+    //点击搜索按钮触发
+    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(this.page.currentPage, this.page.pageSize, data)
+      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;
-          console.log(this.page.total);
           if (this.page.total > 0) {
             this.tableOption.height = window.innerHeight - 500;
           }
@@ -96,11 +133,11 @@ export default {
           this.loading = false;
         });
     },
-    selectionChange(list){
-      this.selectionList=list
+    selectionChange(list) {
+      this.selectionList = list;
     },
-    closed(){
-       this.$refs.crud.toggleSelection();
+    closed() {
+      this.$refs.crud.toggleSelection();
     }
   },
   watch: {}

+ 0 - 19
src/views/exportTrade/invoice/detailsPage.vue

@@ -491,29 +491,10 @@ export default {
     if (this.detailData.status == 1) {
       this.option.disabled = true;
     }
-    let _this = this;
     this.getWorkDicts("product_properties").then(res => {
       this.findObject(this.tableOption.column, "itemProp").dicData =
         res.data.data;
     });
-    this.tableOption.column.forEach(e => {
-      if (e.prop == "taxRate") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.taxRate ? row.taxRate : 0) / 100,
-            "0.00%"
-          );
-        };
-      }
-      if (e.prop == "contractAmount" || e.prop == "price") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.contractAmount ? row.contractAmount : 0),
-            "#,##0.00"
-          );
-        };
-      }
-    });
     this.getWorkDicts("unit").then(res => {
       this.findObject(this.tableOption.column, "unit").dicData = res.data.data;
     });

+ 0 - 19
src/views/exportTrade/invoice/index.vue

@@ -148,25 +148,6 @@ export default {
     if (this.$route.query.pageType == "Generate") {
       this.newAdd();
     }
-    let _this = this;
-    this.option.column.forEach(e => {
-      if (e.prop == "exchangeRate") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.exchangeRate ? row.exchangeRate : 0) / 100,
-            "0.00%"
-          );
-        };
-      }
-      if (e.prop == "creditAmount") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.creditAmount ? row.creditAmount : 0),
-            "#,##0.00"
-          );
-        };
-      }
-    });
     gainUser().then(res => {
       this.findObject(this.option.column, "createUser").dicData = res.data.data;
     });

+ 0 - 19
src/views/exportTrade/purchaseContract/detailsPage.vue

@@ -595,25 +595,6 @@ export default {
       this.insuranceOption.disabled = true;
       this.markOption.disabled = true;
     }
-    let _this = this;
-    this.tableOption.column.forEach(e => {
-      if (e.prop == "taxRate") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.taxRate ? row.taxRate : 0) / 100,
-            "0.00%"
-          );
-        };
-      }
-      if (e.prop == "amount" || e.prop == "price") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.amount ? row.amount : 0),
-            "#,##0.00"
-          );
-        };
-      }
-    });
     this.getWorkDicts("product_properties").then(res => {
       this.findObject(this.tableOption.column, "itemProp").dicData =
         res.data.data;

+ 0 - 19
src/views/exportTrade/purchaseContract/index.vue

@@ -147,25 +147,6 @@ export default {
   components: { detailPage },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(2), option);
-    let _this = this;
-    this.option.column.forEach(e => {
-      if (e.prop == "exchangeRate") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.exchangeRate ? row.exchangeRate : 0) / 100,
-            "0.00%"
-          );
-        };
-      }
-      if (e.prop == "creditAmount") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.creditAmount ? row.creditAmount : 0),
-            "#,##0.00"
-          );
-        };
-      }
-    });
     this.getWorkDicts("payment_term").then(res => {
       this.findObject(this.option.column, "paymentType").dicData =
         res.data.data;

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

@@ -446,25 +446,6 @@ export default {
     if (this.detailData.status == 1) {
       this.option.disabled = true;
     }
-    let _this = this;
-    this.tableOption.column.forEach(e => {
-      if (e.prop == "taxRate") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.taxRate ? row.taxRate : 0) / 100,
-            "0.00%"
-          );
-        };
-      }
-      if (e.prop == "amount" || e.prop == "price") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.amount ? row.amount : 0),
-            "#,##0.00"
-          );
-        };
-      }
-    });
     this.getWorkDicts("product_properties").then(res => {
       this.findObject(this.tableOption.column, "itemProp").dicData =
         res.data.data;

+ 0 - 19
src/views/exportTrade/purchaseInquiry/index.vue

@@ -134,25 +134,6 @@ export default {
   components: { detailPage },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(10), option);
-    let _this = this;
-    this.option.column.forEach(e => {
-      if (e.prop == "exchangeRate") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.exchangeRate ? row.exchangeRate : 0) / 100,
-            "0.00%"
-          );
-        };
-      }
-      if (e.prop == "creditAmount") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.creditAmount ? row.creditAmount : 0),
-            "#,##0.00"
-          );
-        };
-      }
-    });
     getPorts().then(res => {
       this.findObject(this.option.column, "portOfLoad").dicData = res.data;
       this.findObject(this.option.column, "portOfDestination").dicData =

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

@@ -502,25 +502,6 @@ export default {
     if (this.detailData.status == 1) {
       this.option.disabled = true;
     }
-    let _this = this;
-    this.tableOption.column.forEach(e => {
-      if (e.prop == "taxRate") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.taxRate ? row.taxRate : 0) / 100,
-            "0.00%"
-          );
-        };
-      }
-      if (e.prop == "contractAmount" || e.prop == "price") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.contractAmount ? row.contractAmount : 0),
-            "#,##0.00"
-          );
-        };
-      }
-    });
     this.getWorkDicts("product_properties").then(res => {
       this.findObject(this.tableOption.column, "itemProp").dicData =
         res.data.data;

+ 0 - 19
src/views/exportTrade/receipt/index.vue

@@ -132,25 +132,6 @@ export default {
     if (this.$route.query.pageType == "Generate") {
       this.newAdd();
     }
-    let _this = this;
-    this.option.column.forEach(e => {
-      if (e.prop == "exchangeRate") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.exchangeRate ? row.exchangeRate : 0) / 100,
-            "0.00%"
-          );
-        };
-      }
-      if (e.prop == "creditAmount") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.creditAmount ? row.creditAmount : 0),
-            "#,##0.00"
-          );
-        };
-      }
-    });
     gainUser().then(res => {
       this.findObject(this.option.column, "createUser").dicData = res.data.data;
     });

+ 0 - 19
src/views/exportTrade/salesContract/detailsPage.vue

@@ -841,25 +841,6 @@ export default {
       this.insuranceOption.disabled = true;
       this.markOption.disabled = true;
     }
-    let _this = this;
-    this.tableOption.column.forEach(e => {
-      if (e.prop == "taxRate") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.taxRate ? row.taxRate : 0) / 100,
-            "0.00%"
-          );
-        };
-      }
-      if (e.prop == "amount" || e.prop == "price") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.amount ? row.amount : 0),
-            "#,##0.00"
-          );
-        };
-      }
-    });
     getPorts().then(res => {
       this.findObject(this.option.column, "portOfLoad").dicData = res.data;
       this.findObject(this.option.column, "portOfDestination").dicData =

+ 0 - 19
src/views/exportTrade/salesContract/index.vue

@@ -151,25 +151,6 @@ export default {
   components: { detailPage },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(4), option);
-    let _this = this;
-    this.option.column.forEach(e => {
-      if (e.prop == "exchangeRate") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.exchangeRate ? row.exchangeRate : 0) / 100,
-            "0.00%"
-          );
-        };
-      }
-      if (e.prop == "creditAmount") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.creditAmount ? row.creditAmount : 0),
-            "#,##0.00"
-          );
-        };
-      }
-    });
     getPorts().then(res => {
       this.findObject(this.option.column, "portOfLoad").dicData = res.data;
       this.findObject(this.option.column, "portOfDestination").dicData =

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

@@ -365,25 +365,6 @@ export default {
       this.getColumnName(32),
       goodsOption
     );
-    let _this = this;
-    this.tableOption.column.forEach(e => {
-      if (e.prop == "taxRate") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.taxRate ? row.taxRate : 0) / 100,
-            "0.00%"
-          );
-        };
-      }
-      if (e.prop == "amount" || e.prop == "price") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.amount ? row.amount : 0),
-            "#,##0.00"
-          );
-        };
-      }
-    });
     getPorts().then(res => {
       this.findObject(this.option.column, "portOfLoad").dicData = res.data;
       this.findObject(this.option.column, "portOfDestination").dicData =

+ 0 - 19
src/views/exportTrade/shippingInquiry/index.vue

@@ -122,25 +122,6 @@ export default {
   components: { detailPage },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(12), option);
-    let _this = this;
-    this.option.column.forEach(e => {
-      if (e.prop == "exchangeRate") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.exchangeRate ? row.exchangeRate : 0) / 100,
-            "0.00%"
-          );
-        };
-      }
-      if (e.prop == "creditAmount") {
-        e.formatter = function(row) {
-          return _this.textFormat(
-            Number(row.creditAmount ? row.creditAmount : 0),
-            "#,##0.00"
-          );
-        };
-      }
-    });
     getPorts().then(res => {
       this.findObject(this.option.column, "portOfLoad").dicData = res.data;
       this.findObject(this.option.column, "portOfDestination").dicData =

+ 0 - 136
src/views/maintenance/priceLibrary/config/commodity.json

@@ -1,136 +0,0 @@
-
-{
-  "calcHeight": 80,
-  "tip": false,
-  "addBtn": false,
-  "searchShow": false,
-  "searchShowBtn": false,
-  "menu": false,
-  "searchMenuSpan": 6,
-  "border": true,
-  "index": true,
-  "selection": true,
-  "viewBtn": true,
-  "dialogClickModal": false,
-  "column": [
-    {
-      "label": "商品编码",
-      "prop": "code",
-      "search": true,
-      "width": 100,
-      "rules": [
-        {
-          "required": true,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
-    },
-    {
-      "label": "商品名称",
-      "prop": "cname",
-      "slot": true,
-      "width": 100,
-      "rules": [
-        {
-          "required": true,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
-    },
-    {
-      "label": "商品类别",
-      "prop": "goodsTypeId",
-      "dicData": [],
-      "type": "tree",
-      "hide": true,
-      "addDisabled": false,
-      "multiple": true,
-      "width": 100,
-      "props": {
-        "label": "title"
-      },
-      "rules": [{
-        "required": true,
-        "message": " ",
-        "trigger": "click"
-      }]
-    },
-    {
-      "label": "规格编码",
-      "prop": "typeno",
-      "search": true,
-      "width": 100
-    },
-    {
-      "label": "品牌",
-      "prop": "brand",
-      "slot": true,
-      "width": 100
-    },
-    {
-      "label": "花纹",
-      "prop": "brandItem",
-      "slot": true,
-      "width": 100
-    },
-    {
-      "label": "规格尺寸",
-      "prop": "specs",
-      "slot": true,
-      "width": 100
-    },
-    {
-      "label": "产品类别",
-      "prop": "category",
-      "slot": true,
-      "width": 100
-    },
-    {
-      "label": "产品分类",
-      "prop": "categoryitem",
-      "slot": true,
-      "width": 100
-    },
-    {
-      "label": "供应商",
-      "prop": "providers",
-      "slot": true,
-      "width": 100
-    },
-    {
-      "label": "计量单位",
-      "prop": "unit",
-      "slot": true,
-      "width": 100
-    },
-    {
-      "label": "包装单位",
-      "prop": "packgeunit",
-      "slot": true,
-      "width": 100
-    },
-    {
-      "label": "商品图片",
-      "prop": "url",
-      "type": "upload",
-      "listType": "picture-img",
-      "dataType": "string",
-      "action": "/api/blade-resource/oss/endpoint/put-file",
-      "propsHttp": {
-        "res": "data",
-        "url": "link"
-      },
-      "hide": true,
-      "span": 24,
-      "width": 100
-    },
-    {
-      "label": "备注",
-      "prop": "remarks",
-      "slot": true,
-      "width": 100
-    }
-  ]
-}

+ 0 - 178
src/views/maintenance/priceLibrary/config/customerContact.json

@@ -1,178 +0,0 @@
-{
-  "searchShow": true,
-  "searchMenuSpan": 6,
-  "border": true,
-  "index": true,
-  "viewBtn": false,
-  "editBtn": false,
-  "addBtn": false,
-  "delBtn": false,
-  "align": "center",
-  "menuWidth": 150,
-  "refreshBtn": false,
-  "showSummary": true,
-  "column": [{
-      "label": "产品类别",
-      "prop": "priceCategory",
-      "index": 1,
-      "width": 100,
-      "overHidden": true
-    },
-    {
-      "label": "产品编号",
-      "prop": "code",
-      "index": 2,
-      "width": 100,
-      "overHidden": true
-    },
-    {
-      "label": "产品名称",
-      "prop": "cname",
-      "index": 3,
-      "width": 200,
-      "overHidden": true
-    },
-    {
-      "label": "产品属性",
-      "prop": "itemProp",
-      "index": 4,
-      "width": 100,
-      "overHidden": true,
-      "cell": true,
-      "type": "select",
-      "dicData": [],
-      "props": {
-        "label": "dictValue",
-        "value": "dictKey"
-      }
-    },
-    {
-      "label": "产品描述",
-      "prop": "itemDescription",
-      "index": 5,
-      "width": 100,
-      "overHidden": true,
-      "cell": true
-    },
-    {
-      "label": "产品型号",
-      "prop": "itemType",
-      "index": 6,
-      "width": 100
-    },
-    {
-      "label": "采购单价",
-      "prop": "purchaseAmount",
-      "index": 7,
-      "width": 100,
-      "overHidden": true
-    },
-    {
-      "label": "配件信息",
-      "prop": "partsList",
-      "index": 7,
-      "width": 100,
-      "overHidden": true
-    },
-    {
-      "label": "配件价格",
-      "prop": "partsPrice",
-      "index": 7,
-      "width": 100,
-      "overHidden": true
-    },
-    {
-      "label": "供应商",
-      "prop": "corpId",
-      "index": 8,
-      "width": 100,
-      "overHidden": true
-    },
-    {
-      "label": "重点推荐",
-      "prop": "priorityReferrer",
-      "index": 9,
-      "width": 100,
-      "overHidden": true
-    },
-    {
-      "label": "推荐理由",
-      "prop": "referrerReason",
-      "index": 10,
-      "width": 100,
-      "overHidden": true,
-      "cell": true
-    },
-    {
-      "label": "销售价",
-      "prop": "price",
-      "index": 11,
-      "width": 100,
-      "overHidden": true
-    },
-    {
-      "label": "计价单位",
-      "prop": "unit",
-      "index": 12,
-      "width": 100,
-      "overHidden": true,
-      "cell": true,
-      "type": "select",
-      "dicData": [],
-      "props": {
-        "label": "dictValue",
-        "value": "dictValue"
-      }
-    },
-    {
-      "label": "数量",
-      "prop": "orderQuantity",
-      "index": 13,
-      "width": 100,
-      "overHidden": true
-    },
-    {
-      "label": "保险",
-      "prop": "insurance",
-      "index": 14,
-      "width": 100,
-      "overHidden": true
-    },
-    {
-      "label": "运费",
-      "prop": "freight",
-      "index": 15,
-      "width": 100,
-      "overHidden": true
-    },
-    {
-      "label": "折扣",
-      "prop": "discount",
-      "index": 16,
-      "width": 100,
-      "overHidden": true
-    },
-    {
-      "label": "金额",
-      "prop": "amount",
-      "index": 17,
-      "width": 100,
-      "overHidden": true
-    },
-    {
-      "label": "税率",
-      "prop": "taxRate",
-      "index": 18,
-      "width": 100,
-      "overHidden": true
-    },
-    {
-      "label": "备注",
-      "prop": "remarks",
-      "index": 19,
-      "width": 100,
-      "overHidden": true,
-      "cell": true
-    }
-  ]
-}

+ 21 - 1
src/views/maintenance/priceLibrary/config/mainList.json

@@ -1,6 +1,6 @@
 {
   "searchShow": true,
-  "searchMenuSpan": 24,
+  "searchMenuSpan": 8,
   "border": true,
   "index": true,
   "viewBtn": false,
@@ -110,8 +110,17 @@
     {
       "label": "商品类别",
       "prop": "goodsTypeName",
+      "search": true,
+      "searchSpan": 8,
       "index": 13,
       "width": 100,
+      "type": "select",
+      "filterable": true,
+      "dicData": [],
+      "props": {
+        "value": "cname",
+        "label": "cname"
+      },
       "overHidden": true
     },
     {
@@ -192,6 +201,17 @@
       "overHidden": true
     },
     {
+      "label": "有效日期",
+      "prop": "dateValidity",
+      "index": 25,
+      "width": 100,
+      "search": true,
+      "searchSpan": 8,
+      "hide": true,
+      "showColumn": false,
+      "overHidden": true
+    },
+    {
       "label": "业务员",
       "prop": "person",
       "index": 25,

+ 0 - 436
src/views/maintenance/priceLibrary/detailsPage.vue

@@ -1,436 +0,0 @@
-<template>
-  <div class="borderless" v-loading="pageLoading">
-    <div class="customer-head">
-      <div class="customer-back">
-        <!--        <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
-        <el-button
-          type="danger"
-          style="border: none;background: none;color: red"
-          icon="el-icon-arrow-left"
-          @click="backToList"
-          >返回列表
-        </el-button>
-      </div>
-      <div class="add-customer-btn" v-if="showBut">
-        <el-button
-          type="primary"
-          :disabled="disabled"
-          @click="editCustomer"
-          size="small"
-          :loading="subLoading"
-          v-if="detailData.status != 1"
-          >{{ form.id ? "确认修改" : "确认新增" }}
-        </el-button>
-      </div>
-    </div>
-    <div style="margin-top: 60px;margin-bottom:35px">
-      <containerTitle title="基础信息"></containerTitle>
-      <basic-container style="margin-bottom: 10px">
-        <avue-form ref="form" v-model="form" :option="option">
-          <template slot="corpId">
-            <select-component
-              v-model="form.corpId"
-              :configuration="configuration"
-              :disabled="detailData.status == 1"
-            ></select-component>
-          </template>
-          <template slot="cname">
-            <goods-select
-              v-model="form.cname"
-              :configuration="goodsConfiguration"
-              @getRow="getGoodsRow"
-              @returnRow="returnRow"
-              :disabled="detailData.status == 1"
-            />
-          </template>
-        </avue-form>
-      </basic-container>
-    </div>
-  </div>
-</template>
-
-<script>
-import { detail, submit } from "@/api/maintenance/priceLibrary";
-import { contrastObj } from "@/util/contrastData";
-import { orderStates } from "@/enums/order-stauts";
-import _ from "lodash";
-export default {
-  name: "detailsPageEdit",
-  data() {
-    return {
-      goodsConfiguration: {
-        multipleChoices: false,
-        multiple: false,
-        collapseTags: false,
-        placeholder: "请点击右边按钮选择",
-        dicData: [],
-        clearable: true
-      },
-      configuration: {
-        multipleChoices: false,
-        multiple: false,
-        collapseTags: false,
-        placeholder: "请点击右边按钮选择",
-        dicData: []
-      },
-      form: {},
-      option: {
-        menuBtn: false,
-        labelWidth: 100,
-        column: [
-          {
-            label: "商品名称",
-            prop: "cname",
-            rules: [
-              {
-                required: true,
-                message: "",
-                trigger: "blur"
-              }
-            ],
-            span: 8
-          },
-          {
-            label: "规格",
-            prop: "specs",
-            disabled: true,
-            span: 8
-          },
-          {
-            label: "产品属性",
-            prop: "goodNature",
-            span: 8
-          },
-          {
-            label: "供应商",
-            prop: "corpId",
-            rules: [
-              {
-                required: true,
-                message: "",
-                trigger: "blur"
-              }
-            ],
-            span: 8
-          },
-          {
-            label: "币别",
-            prop: "currency",
-            type: "select",
-            dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
-            props: {
-              label: "dictValue",
-              value: "dictValue"
-            },
-            rules: [
-              {
-                required: true,
-                message: "",
-                trigger: "blur"
-              }
-            ],
-            change: ({ value }) => {
-              if (value == "CNY") {
-                this.form.exchangeRate = 1;
-              }
-              if (value == "USD") {
-                this.form.exchangeRate = 6.3843;
-              }
-            },
-            span: 8
-          },
-          {
-            label: "汇率",
-            prop: "exchangeRate",
-            disabled: true,
-            span: 8
-          },
-          {
-            label: "FOB系数",
-            prop: "coefficient",
-            rules: [
-              {
-                required: true,
-                message: "",
-                trigger: "blur"
-              }
-            ],
-            span: 8
-          },
-          {
-            label: "价格类型",
-            prop: "billType",
-            rules: [
-              {
-                required: true,
-                message: "",
-                trigger: "blur"
-              }
-            ],
-            type: "select",
-            dicUrl: "/api/blade-system/dict-biz/dictionary?code=billType",
-            props: {
-              label: "dictValue",
-              value: "dictKey"
-            },
-            span: 8
-          },
-          {
-            label: "最新价格",
-            prop: "price",
-            rules: [
-              {
-                required: true,
-                message: "",
-                trigger: "blur"
-              }
-            ],
-            span: 8
-          },
-          {
-            label: "美元价格",
-            prop: "greenback",
-            span: 8
-          },
-          { 
-            label: "采购价格",
-            prop: "purchaseAmount",
-            span: 8
-          },
-          {
-            label: "税率",
-            prop: "taxRate",
-            span: 8
-          },
-          {
-            label: "商品类别",
-            prop: "goodsTypeName",
-            span: 8
-          },
-          {
-            label: "状态",
-            prop: "status",
-            type: "select",
-            dicData: orderStates,
-            props: {
-              label: "name",
-              value: "code"
-            },
-            rules: [
-              {
-                required: true,
-                message: "",
-                trigger: "blur"
-              }
-            ],
-            span: 8
-          },
-          {
-            label: "有效期开始",
-            prop: "startTime",
-            type: "date",
-            format: "yyyy-MM-dd",
-            valueFormat: "yyyy-MM-dd 00:00:00",
-            rules: [
-              {
-                required: true,
-                message: "",
-                trigger: "blur"
-              }
-            ],
-            span: 8
-          },
-          {
-            label: "有效期结束",
-            prop: "endTime",
-            type: "date",
-            format: "yyyy-MM-dd",
-            valueFormat: "yyyy-MM-dd 23:59:59",
-            rules: [
-              {
-                required: true,
-                message: "",
-                trigger: "blur"
-              }
-            ],
-            span: 8
-          },
-          {
-            label: "业务员",
-            prop: "person",
-            span: 8,
-            row: true
-          },
-          {
-            label: "历史价格1",
-            prop: "priceOne",
-            span: 8,
-            disabled: true
-          },
-          {
-            label: "历史日期1",
-            prop: "priceOneTime",
-            type: "datetime",
-            format: "yyyy-MM-dd hh:mm:ss",
-            valueFormat: "yyyy-MM-dd hh:mm:ss",
-            span: 8,
-            disabled: true
-          },
-          {
-            label: "历史价格2",
-            prop: "priceTwo",
-            span: 8,
-            disabled: true
-          },
-          {
-            label: "历史日期2",
-            prop: "priceTwoTime",
-            type: "datetime",
-            format: "yyyy-MM-dd hh:mm:ss",
-            valueFormat: "yyyy-MM-dd hh:mm:ss",
-            span: 8,
-            disabled: true
-          },
-          {
-            label: "历史价格3",
-            prop: "priceThree",
-            span: 8,
-            disabled: true
-          },
-          {
-            label: "历史日期3",
-            prop: "priceThreeTime",
-            type: "datetime",
-            format: "yyyy-MM-dd hh:mm:ss",
-            valueFormat: "yyyy-MM-dd hh:mm:ss",
-            span: 8,
-            disabled: true
-          },
-          {
-            label: "备注",
-            prop: "remarks",
-            type: "textarea",
-            minRows: 2,
-            span: 24
-          }
-        ]
-      },
-      oldform: {},
-      loading: false,
-      subLoading: false,
-      pageLoading: false,
-      showBut: true
-    };
-  },
-  props: {
-    detailData: {
-      type: Object
-    }
-  },
-  created() {
-    if (this.detailData.id) {
-      this.getDetail(this.detailData.id);
-    }
-    if (this.detailData.status == 1) {
-      this.option.disabled = true;
-    }
-  },
-  filters: {},
-  methods: {
-    getDetail(id) {
-      this.loading = true;
-      this.showBut = false;
-      this.pageLoading = true;
-      detail(id)
-        .then(res => {
-          this.form = res.data.data;
-          this.oldform = res.data.data;
-        })
-        .finally(() => {
-          this.loading = false;
-          this.showBut = true;
-          this.pageLoading = false;
-        });
-    },
-    //修改提交触发
-    editCustomer(status) {
-      this.$refs["form"].validate((valid, done) => {
-        done();
-        if (valid) {
-          this.subLoading = true;
-          this.form.tradeType = "CK";
-          this.configuration.dicData.forEach(e => {
-            if (this.form.corpId == e.id) {
-              this.form.corpName = e.cname;
-            }
-          });
-          submit({
-            ...this.form
-          })
-            .then(res => {
-              if (res.data.code == 200) {
-                this.$message.success(this.form.id ? "修改成功" : "提交成功");
-                this.form = res.data.data;
-                this.oldform = res.data.data;
-                if (status == "goBack") {
-                  this.$emit("goBack");
-                }
-              }
-            })
-            .finally(() => {
-              this.subLoading = false;
-            });
-        } else {
-          return false;
-        }
-      });
-    },
-    //返回列表
-    backToList() {
-      if (contrastObj(this.form, this.oldform)) {
-        this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
-          .then(() => {
-            this.editCustomer("goBack");
-          })
-          .catch(() => {
-            this.$emit("goBack");
-          });
-      } else {
-        this.$emit("goBack");
-      }
-    },
-    openReport() {
-      this.switchDialog = !this.switchDialog;
-    },
-    onClose(val) {
-      this.switchDialog = val;
-    },
-    getGoodsRow(row) {
-      this.form.itemId = row.id;
-      this.form.code = row.code;
-      this.form.specs = row.specs;
-    },
-    returnRow(rows) {
-      this.form.itemId = rows[0].id;
-      this.form.code = rows[0].code;
-      this.form.specs = rows[0].specs;
-    }
-  }
-};
-</script>
-
-<style lang="scss" scoped>
-::v-deep .el-form-item {
-  margin-bottom: 8px;
-}
-::v-deep .el-form-item__error {
-  display: none;
-}
-::v-deep .select-component {
-  display: flex;
-}
-</style>

+ 49 - 31
src/views/maintenance/priceLibrary/index.vue

@@ -55,6 +55,18 @@
             :configuration="configuration"
           ></select-component>
         </template>
+        <template slot="dateValiditySearch">
+          <el-date-picker
+            v-model="search.dateValidity"
+            type="daterange"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            format="yyyy-MM-dd"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            :default-time="['00:00:00', '23:59:59']"
+          >
+          </el-date-picker>
+        </template>
         <template slot-scope="scope" slot="corpId">
           {{ scope.row.corpName }}
         </template>
@@ -64,13 +76,16 @@
         <template slot-scope="scope" slot="status">
           {{ scope.row.status | orderStateFormat }}
         </template>
+        <template slot-scope="scope" slot="taxRate">
+          {{ scope.row.taxRate | taxRateFormat }}
+        </template>
         <template slot-scope="scope" slot="menu">
           <el-button
             type="text"
             icon="el-icon-edit"
             size="small"
             @click.stop="editOpen(scope.row, 2)"
-            >编辑
+            >修改
           </el-button>
           <el-button
             type="text"
@@ -91,6 +106,7 @@
           :option="excelOption"
           v-model="excelForm"
           :upload-after="uploadAfter"
+          class="excelUpload"
         />
       </el-dialog>
     </basic-container>
@@ -100,10 +116,11 @@
 <script>
 import option from "./config/mainList.json";
 import { getToken } from "@/util/auth";
-import { getList, remove } from "@/api/maintenance/priceLibrary";
+import { getList, remove, getGoodstype } from "@/api/maintenance/priceLibrary";
 import { defaultDate } from "@/util/date";
 import { micrometerFormat } from "@/util/validate";
 import { orderStateFormat } from "@/enums/order-stauts";
+import { taxRateFormat } from "@/enums/tax-rate";
 import _ from "lodash";
 export default {
   name: "customerInformation",
@@ -146,9 +163,7 @@ export default {
         dicData: [],
         clearable: true
       },
-      search: {
-        businesDate: defaultDate()
-      },
+      search: {},
       form: {},
       option: {},
       parentId: 0,
@@ -173,10 +188,17 @@ export default {
     this.getWorkDicts("billType").then(res => {
       this.findObject(this.option.column, "billType").dicData = res.data.data;
     });
+    getGoodstype(1, 500).then(res => {
+      this.findObject(this.option.column, "goodsTypeName").dicData =
+        res.data.data.records;
+    });
   },
   filters: {
     orderStateFormat(val) {
       return orderStateFormat(val);
+    },
+    taxRateFormat(val) {
+      return taxRateFormat(val);
     }
   },
   methods: {
@@ -184,6 +206,9 @@ export default {
       return "padding:0;height:40px;";
     },
     uploadAfter(res, done, loading, column) {
+      if (res != "导入成功") {
+        this.$message.error(res);
+      }
       this.excelBox = false;
       this.page.currentPage = 1;
       this.onLoad(this.page);
@@ -222,11 +247,16 @@ export default {
       });
     },
     editOpen(row, status) {
+      this.$message.warning("暂不支持修改");
       console.log(row, status);
     },
     //点击搜索按钮触发
     searchChange(params, done) {
-      this.page.currentPage = 1;
+      if (params.dateValidity) {
+        params.dateValidityStart = params.dateValidity[0];
+        params.dateValidityEnd = params.dateValidity[1];
+      }
+      delete params.dateValidity;
       this.onLoad(this.page, params);
       done();
     },
@@ -260,30 +290,20 @@ export default {
       if (columns.length > 0) {
         columns.forEach((item, index) => {
           sums[0] = "合计";
-          if (
-            item.property == "orderQuantity" ||
-            item.property == "amount" ||
-            item.property == "purchaseAmount"
-          ) {
-            let qtySum = 0;
-            let instoreSum = 0;
-            let totalSum = 0;
+          if (item.property == "price" || item.property == "purchaseAmount") {
+            let priceSum = 0;
+            let amountSum = 0;
             data.forEach(e => {
-              qtySum = _.add(qtySum, Number(e.orderQuantity));
-              instoreSum = _.add(instoreSum, Number(e.amount));
-              totalSum = _.add(totalSum, Number(e.purchaseAmount));
+              priceSum = _.add(priceSum, Number(e.price));
+              amountSum = _.add(amountSum, Number(e.purchaseAmount));
             });
-            //数量总计
-            if (item.property == "orderQuantity") {
-              sums[index] = qtySum ? qtySum.toFixed(2) : "0.00";
+            //最新价格
+            if (item.property == "price") {
+              sums[index] = micrometerFormat(priceSum);
             }
-            //入库金额总计
-            if (item.property == "amount") {
-              sums[index] = micrometerFormat(instoreSum);
-            }
-            //金额总计
+            //采购价格
             if (item.property == "purchaseAmount") {
-              sums[index] = micrometerFormat(totalSum);
+              sums[index] = micrometerFormat(amountSum);
             }
           }
         });
@@ -294,11 +314,6 @@ export default {
       this.onLoad(this.page, this.search);
     },
     async saveColumn() {
-      /**
-       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
-       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
-       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
-       */
       const inSave = await this.saveColumnData(
         this.getColumnName(50),
         this.option
@@ -320,4 +335,7 @@ export default {
 .page-crad ::v-deep .basic-container__card {
   height: 94.2vh;
 }
+.excelUpload ::v-deep .el-upload-list {
+  display: none;
+}
 </style>