QuKatie 3 rokov pred
rodič
commit
dd8a1cd9c2

+ 28 - 14
src/components/fee-info/main.vue

@@ -14,9 +14,19 @@
       >
         <template slot="menuLeft">
           <el-tabs v-model="activeName" @tab-click="tabHandle">
-            <el-tab-pane label="应收" name="first" :key="'first'" v-if="tabShow == 1 || tabShow == 2">
+            <el-tab-pane
+              label="应收"
+              name="first"
+              :key="'first'"
+              v-if="tabShow == 1 || tabShow == 2"
+            >
             </el-tab-pane>
-            <el-tab-pane label="应付" name="second" :key="'second'" v-if="tabShow == 1 || tabShow == 3">
+            <el-tab-pane
+              label="应付"
+              name="second"
+              :key="'second'"
+              v-if="tabShow == 1 || tabShow == 3"
+            >
             </el-tab-pane>
           </el-tabs>
           <el-button
@@ -281,7 +291,8 @@ import {
 import { contrastList } from "@/util/contrastData";
 import { allCropList } from "@/api/basicData/customerInformation";
 import { getCustomerCode, getCustomerName } from "@/enums/management-type";
-
+import { getParities } from "@/api/basicData/customerInquiry";
+import { dateFormat } from "@/util/date";
 export default {
   name: "feeInfo",
   data() {
@@ -392,8 +403,8 @@ export default {
     // 1.显示全部 2.收费 3.付费
     tabShow: {
       type: Number,
-      default: 1,
-    },
+      default: 1
+    }
   },
   filters: {
     isPercentage(val) {
@@ -411,7 +422,8 @@ export default {
   },
   async created() {
     // 判断tabShow的activeName默认的显示
-    this.activeName = this.tabShow == 1? 'first': this.tabShow == 2? 'first': 'second';
+    this.activeName =
+      this.tabShow == 1 ? "first" : this.tabShow == 2 ? "first" : "second";
     this.feeOption = await this.getColumnData(
       this.getColumnName(33),
       feeOption
@@ -444,8 +456,8 @@ export default {
     ApplyPayment
   },
   watch: {
-    disabled:function(){
-       this.$refs.feeCrud.refreshTable()
+    disabled: function() {
+      this.$refs.feeCrud.refreshTable();
     },
     orderFeesList(newVla, oldVal) {
       if (newVla !== oldVal) {
@@ -531,10 +543,12 @@ export default {
     },
     //带出汇率
     currencyChange(row) {
-      this.currencyList.forEach(item => {
-        if (item.dictValue === row.currency) {
-          this.$set(row, "exchangeRate", item.remark);
-        }
+      getParities({
+        currency: row.currency,
+        businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
+      }).then(res => {
+        const data = res.data.data;
+        row.exchangeRate = data.receivableParities;
       });
     },
     rowDel(row, index) {
@@ -629,8 +643,8 @@ export default {
         this.$refs.feeCrud.rowCellAdd(params);
       }
     },
-    addRow(){
-     this.rowAdd()
+    addRow() {
+      this.rowAdd();
     },
     onLoad(page) {
       this.loading = true;

+ 24 - 0
src/enums/column-name.js

@@ -501,6 +501,30 @@ const columnName = [{
     code: 130,
     name: '统计分析销售人员提成'
   },
+  {
+    code: 131,
+    name: '贸易客户列表'
+  },
+  {
+    code: 132,
+    name: '贸易客户明细'
+  },
+  {
+    code: 133,
+    name: '贸易供应商列表'
+  },
+  {
+    code: 134,
+    name: '贸易供应商明细'
+  },
+  {
+    code: 135,
+    name: '贸易所属公司列表'
+  },
+  {
+    code: 136,
+    name: '贸易所属公司明细'
+  },
 ]
 export const getColumnName = (key) => {
   for (let index = 0; index < columnName.length; index++) {

+ 33 - 6
src/views/basicData/customerInformation/index.vue

@@ -34,6 +34,8 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
+              @saveColumn="saveColumn"
+              @resetColumn="resetColumn"
               @on-load="onLoad"
               @tree-load="treeLoad"
               @search-criteria-switch="searchCriteriaSwitch"
@@ -186,7 +188,7 @@ export default {
         pageSize: 20,
         currentPage: 1,
         total: 0,
-        pageSizes: [10,20,30,40,50, 100, 200, 300, 400, 500]
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
       },
       excelBox: false,
       excelLoading: false,
@@ -276,9 +278,9 @@ export default {
       })
         .then(() => {
           return deleteDetails({
-            id:row.id,
-            corpsTypeId:row.corpsTypeId,
-            corpType:'KH'
+            id: row.id,
+            corpsTypeId: row.corpsTypeId,
+            corpType: "KH"
           });
         })
         .then(() => {
@@ -335,7 +337,7 @@ export default {
       this.show = false;
       this.detailData = {
         treeDeptId: this.treeDeptId
-      }
+      };
     },
     editOpen(row, status) {
       this.detailData = {
@@ -381,7 +383,7 @@ export default {
         size: page.pageSize,
         current: page.currentPage,
         corpsTypeId: this.treeDeptId,
-        corpType: customerParameter.code,
+        corpType: customerParameter.code
       });
       customerList(queryParams).then(res => {
         this.dataList = res.data.data.records;
@@ -415,6 +417,31 @@ export default {
     onClose(val) {
       this.switchDialog = val;
     },
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(108),
+        this.option
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      this.option = option;
+      const inSave = await this.delColumnData(this.getColumnName(108), option);
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.$message.success("重置成功");
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
     goBack() {
       this.detailData = this.$options.data().detailData;
       this.show = true;

+ 2 - 4
src/views/dealer/stock/config/mainList.json

@@ -22,8 +22,7 @@
   "searchSpan": 8,
   "showSummary": true,
   "summaryText": "合计",
-  "sumColumnList": [
-    {
+  "sumColumnList": [{
       "name": "balanceQuantity",
       "type": "sum",
       "decimals": 0
@@ -34,8 +33,7 @@
       "decimals": 0
     }
   ],
-  "column": [
-    {
+  "column": [{
       "label": "品号",
       "prop": "code",
       "search": true,

+ 189 - 4
src/views/dealer/stock/detailsPage.vue

@@ -12,9 +12,39 @@
       </div>
     </div>
     <div class="customer-main">
+      <container-title title="基础资料"></container-title>
+      <basic-container>
+        <avue-form :option="option" v-model="form"> </avue-form>
+      </basic-container>
       <container-title title="库存账明细"></container-title>
       <basic-container>
-        <avue-crud :option="option" :data="data"></avue-crud>
+        <avue-crud
+          ref="crud"
+          :option="optionList"
+          :data="dataList"
+          v-model="form"
+          :page.sync="page"
+          :search.sync="search"
+          @search-change="searchChange"
+          @current-change="currentChange"
+          @size-change="sizeChange"
+          @refresh-change="refreshChange"
+        >
+          <template slot="dateSearch">
+            <el-date-picker
+              v-model="search.date"
+              type="daterange"
+              align="right"
+              unlink-panels
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              :picker-options="pickerOptions"
+            >
+            </el-date-picker>
+            <!-- <crop-select v-model="search.date" ></crop-select> -->
+          </template>
+        </avue-crud>
       </basic-container>
     </div>
   </div>
@@ -25,9 +55,77 @@ export default {
   name: "detailsPage",
   data() {
     return {
+      form: {},
+      search: {},
       option: {
+        menuBtn: false,
+        labelWidth: 80,
+        column: [
+          {
+            label: "商品编码",
+            prop: "a",
+            span: 6
+          },
+          {
+            label: "图号",
+            prop: "b",
+            span: 6
+          },
+          {
+            label: "仓库名称",
+            prop: "c",
+            span: 6
+          },
+          {
+            label: "商品名称",
+            prop: "d",
+            span: 6
+          },
+          {
+            label: "公司",
+            prop: "e",
+            span: 6
+          },
+          {
+            label: "商品车型",
+            prop: "f",
+            span: 6
+          },
+          {
+            label: "产地",
+            prop: "g",
+            span: 6
+          },
+          {
+            label: "本仓库存",
+            prop: "h",
+            span: 6
+          },
+          {
+            label: "商品类别",
+            prop: "i",
+            span: 6
+          },
+          {
+            label: "品牌",
+            prop: "j",
+            span: 6
+          },
+          {
+            label: "商品车型",
+            prop: "k",
+            span: 6
+          },
+          {
+            label: "库存数量",
+            prop: "l",
+            span: 6
+          }
+        ]
+      },
+      optionList: {
         searchShow: true,
-        searchMenuSpan: 18,
+        searchMenuSpan: 6,
         border: true,
         index: true,
         addBtn: false,
@@ -36,12 +134,26 @@ export default {
         menu: false,
         column: [
           {
+            label: "仓库名称",
+            prop: "a1",
+            search: true,
+            hide: true,
+            showColumn: false
+          },
+          {
             label: "日期",
-            prop: "a",
+            prop: "date",
             search: true,
             overHidden: true
           },
           {
+            label: "排序规则",
+            prop: "a2",
+            search: true,
+            hide: true,
+            showColumn: false
+          },
+          {
             label: "摘要",
             prop: "b",
             overHidden: true
@@ -134,7 +246,66 @@ export default {
           }
         ]
       },
-      data: []
+      dataList: [],
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      pickerOptions: {
+        shortcuts: [
+          {
+            text: "今天",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              picker.$emit("pick", [start, end]);
+            }
+          },
+          {
+            text: "昨天",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24);
+              end.setTime(end.getTime() - 3600 * 1000 * 24);
+              picker.$emit("pick", [start, end]);
+            }
+          },
+          {
+            text: "本月",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(new Date(start.getFullYear(), start.getMonth(), 1));
+              end.setTime(new Date(end.getFullYear(), end.getMonth()+1, 0));
+              picker.$emit("pick", [start, end]);
+            }
+          },
+          {
+            text: "上月",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(
+                new Date(start.getFullYear(), start.getMonth() - 1, 1)
+              );
+              end.setTime(new Date(end.getFullYear(), end.getMonth(), 0));
+              picker.$emit("pick", [start, end]);
+            }
+          },
+          {
+            text: "一年内",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 365);
+              picker.$emit("pick", [start, end]);
+            }
+          }
+        ]
+      }
     };
   },
   props: {
@@ -144,6 +315,20 @@ export default {
   },
   async created() {},
   methods: {
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+    sizeChange(val) {
+      this.page.currentPage = 1;
+      this.page.pageSize = val;
+    },
+    refreshChange() {},
     backToList() {
       this.$emit("goBack");
     }

+ 14 - 0
src/views/dealer/stock/index.vue

@@ -13,6 +13,20 @@
         @row-update="rowUpdate"
         :cell-style="cellStyle"
       >
+        <template slot-scope="{ row }" slot="code">
+          <span
+            style="color: #409EFF;cursor: pointer"
+            @click.stop="editOpen(row, 1)"
+            >{{ row.code }}
+          </span>
+        </template>
+        <template slot-scope="{ row }" slot="cname">
+          <span
+            style="color: #409EFF;cursor: pointer"
+            @click.stop="editOpen(row, 1)"
+            >{{ row.cname }}
+          </span>
+        </template>
         <template slot-scope="scope" slot="lockingQuantity">
           <span
             v-if="Number(scope.row.lockingQuantity) > 0"