From 7ffe5a313fb55e101ab4f77167847ff456eeb6db Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期二, 26 九月 2023 10:14:57 +0800
Subject: [PATCH] 新增模块路由配置

---
 src/views/reportForm/inventoryReport/index.vue        |  210 +++++++++++++++
 src/views/warehouseManage/listingRules/index.vue      |  169 ++++++++++++
 src/router/report/index.js                            |   25 +
 src/router/operate/index.js                           |    9 
 src/components/layout/components/appsidebar/index.vue |   16 
 src/views/reportForm/locationReport/index.vue         |  210 +++++++++++++++
 src/router/index.js                                   |   12 
 src/views/operate/inventoryAdjustment/index.vue       |  169 ++++++++++++
 src/router/warehouseManage/index.js                   |    9 
 9 files changed, 826 insertions(+), 3 deletions(-)

diff --git a/src/components/layout/components/appsidebar/index.vue b/src/components/layout/components/appsidebar/index.vue
index 1ec6af7..23152d4 100644
--- a/src/components/layout/components/appsidebar/index.vue
+++ b/src/components/layout/components/appsidebar/index.vue
@@ -36,8 +36,8 @@
             <i class="el-icon-setting icon"></i>
             <span>鎿嶄綔</span>
           </template>
-          <!-- <el-menu-item index="/productManage/product">琛ヨ揣</el-menu-item>
-          <el-menu-item index="/productManage/product">搴撳瓨璋冩暣</el-menu-item> -->
+          <!-- <el-menu-item index="/productManage/product">琛ヨ揣</el-menu-item> -->
+          <el-menu-item index="/operate/inventoryAdjustment">搴撳瓨璋冩暣</el-menu-item>
           <el-menu-item index="/operate/allot">璋冩嫧</el-menu-item>
           <el-menu-item index="/operate/scrap">鎶ュ簾</el-menu-item>
         </el-submenu>
@@ -49,7 +49,17 @@
           <el-menu-item index="/warehouseManage/warehouse">浠撳簱</el-menu-item>
           <el-menu-item index="/warehouseManage/position">浣嶇疆</el-menu-item>
           <el-menu-item index="/warehouseManage/bussinessType">涓氬姟绫诲瀷</el-menu-item>
-          <!-- <el-menu-item index="/productManage/product">涓婃灦瑙勫垯</el-menu-item> -->
+          <el-menu-item index="/warehouseManage/listingRules">涓婃灦瑙勫垯</el-menu-item>
+        </el-submenu>
+        <el-submenu index="5">
+          <template slot="title">
+            <i class="el-icon-box icon"></i>
+            <span>鎶ヨ〃</span>
+          </template>
+          <el-menu-item index="/reportForm/inventoryReport">搴撳瓨鎶ヨ〃</el-menu-item>
+          <el-menu-item index="/reportForm/locationReport">浣嶇疆鎶ヨ〃</el-menu-item>
+          <!-- <el-menu-item index="/warehouseManage/bussinessType">鏌愭棩搴撳瓨</el-menu-item> -->
+          <!-- <el-menu-item index="/productManage/product">鍑哄叆搴撴槑缁嗘姤琛�</el-menu-item> -->
         </el-submenu>
       </el-menu>
     </div>
diff --git a/src/router/index.js b/src/router/index.js
index 555c9e5..0802d27 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -5,6 +5,7 @@
 import productRouter from "./product/index.js" // 浜у搧
 import operateRouter from "./operate/index.js" // 鎿嶄綔
 import warehouseManageRouter from "./warehouseManage/index.js" // 浠撳簱绠$悊
+import reportRouter from "./report/index.js" // 鎶ヨ〃
 
 Vue.use(Router)
 const login = (resolve) => require(["@/views/other/login/index"], resolve)
@@ -12,6 +13,7 @@
 const productManage = (resolve) => require(["@/views/productManage/index"], resolve) // 浜у搧
 const operate = (resolve) => require(["@/views/operate/index"], resolve) // 鎿嶄綔
 const warehouseManage = (resolve) => require(["@/views/warehouseManage/index"], resolve) // 浠撳簱绠$悊
+const reportForm = (resolve) => require(["@/views/reportForm/index"], resolve) // 鎶ヨ〃
 
 export const routes = [
   {
@@ -52,6 +54,16 @@
       title: "浠撳簱绠$悊",
       isAllways: true
     }
+  },
+  {
+    path: "reportForm", // 鎶ヨ〃
+    name: "reportForm",
+    component: reportForm,
+    children: reportRouter,
+    meta: {
+      title: "鎶ヨ〃",
+      isAllways: true
+    }
   }
 ]
 export const constantRoutes = [
diff --git a/src/router/operate/index.js b/src/router/operate/index.js
index 855d0d0..59f8d89 100644
--- a/src/router/operate/index.js
+++ b/src/router/operate/index.js
@@ -2,6 +2,7 @@
 
 const allot = (resolve) => require(["@/views/operate/allot/index"], resolve) // 璋冩嫧
 const scrap = (resolve) => require(["@/views/operate/scrap/index"], resolve) // 鎶ュ簾
+const inventoryAdjustment = (resolve) => require(["@/views/operate/inventoryAdjustment/index"], resolve) // 搴撳瓨璋冩暣
 
 const appconfig = [
   {
@@ -19,6 +20,14 @@
     meta: {
       title: "鎶ュ簾鍗�"
     }
+  },
+  {
+    path: "/operate/inventoryAdjustment",
+    name: "inventoryAdjustment",
+    component: inventoryAdjustment,
+    meta: {
+      title: "搴撳瓨璋冩暣"
+    }
   }
 ]
 
diff --git a/src/router/report/index.js b/src/router/report/index.js
new file mode 100644
index 0000000..2ee2f53
--- /dev/null
+++ b/src/router/report/index.js
@@ -0,0 +1,25 @@
+// const type from '@/router/deployCode'
+
+const inventoryReport = (resolve) => require(["@/views/reportForm/inventoryReport/index"], resolve) // 搴撳瓨鎶ヨ〃
+const locationReport = (resolve) => require(["@/views/reportForm/locationReport/index"], resolve) // 浣嶇疆鎶ヨ〃
+
+const appconfig = [
+  {
+    path: "/reportForm/inventoryReport",
+    name: "inventoryReport",
+    component: inventoryReport,
+    meta: {
+      title: "搴撳瓨鎶ヨ〃"
+    }
+  },
+  {
+    path: "/reportForm/locationReport",
+    name: "locationReport",
+    component: locationReport,
+    meta: {
+      title: "浣嶇疆鎶ヨ〃"
+    }
+  }
+]
+
+export default appconfig
diff --git a/src/router/warehouseManage/index.js b/src/router/warehouseManage/index.js
index 5a7379d..c7a3d31 100644
--- a/src/router/warehouseManage/index.js
+++ b/src/router/warehouseManage/index.js
@@ -3,6 +3,7 @@
 const warehouse = (resolve) => require(["@/views/warehouseManage/warehouse/index"], resolve) // 浠撳簱
 const position = (resolve) => require(["@/views/warehouseManage/position/index"], resolve) // 浣嶇疆
 const bussinessType = (resolve) => require(["@/views/warehouseManage/bussinessType/index"], resolve) // 涓氬姟绫诲瀷
+const listingRules = (resolve) => require(["@/views/warehouseManage/listingRules/index"], resolve) // 涓婃灦瑙勫垯
 
 const appconfig = [
   {
@@ -28,6 +29,14 @@
     meta: {
       title: "涓氬姟绫诲瀷"
     }
+  },
+  {
+    path: "/warehouseManage/listingRules",
+    name: "listingRules",
+    component: listingRules,
+    meta: {
+      title: "涓婃灦瑙勫垯"
+    }
   }
 ]
 
diff --git a/src/views/operate/inventoryAdjustment/index.vue b/src/views/operate/inventoryAdjustment/index.vue
new file mode 100644
index 0000000..7d52d43
--- /dev/null
+++ b/src/views/operate/inventoryAdjustment/index.vue
@@ -0,0 +1,169 @@
+<template>
+  <div class="rightContent">
+    <div class="top">
+      <SearchCommonView
+        :add-title="'鏂板缓'"
+        :placeholder="'璇疯緭鍏ュ崟鍙�'"
+        :amount-view="false"
+        @addCommonClick="addBtnClick"
+        @searchClick="getList"
+      />
+    </div>
+    <div class="list-view">
+      <div class="table">
+        <TableCommonView
+          ref="tableListRef"
+          :table-list="tableList"
+          :show-checkcol="false"
+          @tableRowClick="tableRowClick"
+        ></TableCommonView>
+      </div>
+      <div class="btn-pager">
+        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
+      </div>
+    </div>
+    <!-- 鏂板缓/缂栬緫 -->
+    <AddDialog
+      v-if="editConfig.visible"
+      @refresh="refresh"
+      :positionList="tableList.tableInfomation"
+      :edit-common-config="editConfig"
+    />
+  </div>
+</template>
+
+<script>
+import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
+import { getLocationList } from "@/api/warehouseManage/warehouse"
+import AddDialog from "@/views/warehouseManage/position/AddDialog"
+import { getDataByType } from "@/api/data"
+export default {
+  name: "InventoryAdjustment",
+  props: {},
+  components: { AddDialog },
+  mixins: [pageMixin],
+  computed: {},
+  data() {
+    return {
+      tableList: {},
+      searchOptions: [],
+      editConfig: {
+        visible: false,
+        title: "鏂板缓",
+        infomation: {}
+      },
+      positionTypeList: getDataByType("positionType")
+    }
+  },
+  created() {
+    this.setTable()
+    this.getData()
+  },
+  methods: {
+    setTable() {
+      this.tableList = {
+        tableInfomation: [],
+        selectBox: true,
+        showcol: this.showcol,
+        allcol: [],
+        tableColumn: this.setTableColumn(this.showcol)
+      }
+      let allcol = []
+      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
+        if (!this.tableList.tableColumn[i].default) {
+          const label = this.tableList.tableColumn[i].label
+          allcol.push(label)
+        }
+      }
+      this.tableList.allcol = allcol
+    },
+    setTableColumn(showcol) {
+      console.log(showcol)
+      let tableColumn = [
+        {
+          label: "浣嶇疆",
+          prop: "jointName",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "浣嶇疆绫诲瀷",
+          prop: "type",
+          isShowColumn: true,
+          default: true,
+          conversion: true,
+          getStatus: this.getTypesList
+        }
+      ]
+      return tableColumn
+    },
+    getTypesList(val) {
+      let string = "--"
+      if (val) {
+        for (let i in this.positionTypeList) {
+          if (this.positionTypeList[i].id == val) {
+            return this.positionTypeList[i].name
+          }
+        }
+      }
+      return string
+    },
+    selTableCol(val) {
+      this.showcol = val
+      this.tableList.tableColumn = this.setTableColumn(val)
+    },
+    // 璇锋眰鏁版嵁
+    async getData() {
+      await getLocationList({
+        keyword: this.keyword,
+        page: this.pagerOptions.currPage,
+        pageSize: this.pagerOptions.pageSize
+      }).then((res) => {
+        if (res.code === 200) {
+          const list = res.data ? res.data : []
+          this.tableList.tableInfomation = list
+          this.pagerOptions.totalCount = res.total
+        }
+      })
+    },
+    refresh() {
+      this.pagerOptions.currPage = 1
+      this.getData()
+    },
+    // 鎼滅储
+    getList(val) {
+      this.keyword = val
+      this.pagerOptions.currPage = 1
+      this.getData()
+    },
+    // 琛岀偣鍑�
+    tableRowClick(row) {
+      console.log(row)
+      this.editConfig.title = "缂栬緫"
+      this.editConfig.infomation = { ...row }
+      this.editConfig.infomation.parentId = Number(this.editConfig.infomation.parentId)
+      this.editConfig.visible = true
+    },
+    // 鏂板缓
+    addBtnClick() {
+      this.editConfig.infomation = {
+        name: "",
+        parentId: null,
+        type: 3,
+        isScrapLocation: null,
+        isReturnLocation: null,
+        replenishLocation: null,
+        countFrequency: 0,
+        recentlyCount: "",
+        nextCount: "",
+        notes: ""
+      }
+      this.editConfig.visible = true
+      this.editConfig.title = "鏂板缓"
+    }
+  }
+}
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style lang="scss" scoped></style>
diff --git a/src/views/reportForm/inventoryReport/index.vue b/src/views/reportForm/inventoryReport/index.vue
new file mode 100644
index 0000000..d65260c
--- /dev/null
+++ b/src/views/reportForm/inventoryReport/index.vue
@@ -0,0 +1,210 @@
+<template>
+  <div class="rightContent">
+    <div class="top">
+      <SearchCommonView
+        :add-title="'鏂板缓'"
+        :showAdd="false"
+        :placeholder="'璇疯緭鍏ュ弬鑰�'"
+        :amount-view="false"
+        @addCommonClick="addBtnClick"
+        @searchClick="getList"
+      />
+    </div>
+    <div class="list-view">
+      <TableCommonView
+        ref="tableListRef"
+        :table-list="tableList"
+        @selTableCol="selTableCol"
+        @tableRowClick="tableRowClick"
+      ></TableCommonView>
+      <div class="btn-pager">
+        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
+      </div>
+    </div>
+    <!-- 缂栬緫 -->
+    <AddOverviewDialog v-if="editConfig.visible" :edit-common-config="editConfig" :add-name="this.$route.params.name" />
+  </div>
+</template>
+
+<script>
+import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
+import { getProductOperatonList } from "@/api/product/product"
+import AddOverviewDialog from "@/views/overview/AddOverviewDialog"
+
+export default {
+  name: "InboundOutboundDetail",
+  props: {},
+  components: { AddOverviewDialog },
+  mixins: [pageMixin],
+  computed: {},
+  data() {
+    return {
+      tableList: {},
+      showcol: ["鐘舵��"],
+      searchOptions: [],
+      commonDetail: {
+        visible: false,
+        title: "鏂板缓",
+        infomation: {}
+      },
+      editConfig: {
+        visible: false,
+        title: "鏂板缓",
+        infomation: {}
+      },
+      productId: this.$route.params.id,
+      productName: this.$route.params.name
+    }
+  },
+  created() {
+    this.setTable()
+    this.getData()
+  },
+  methods: {
+    setTable() {
+      this.tableList = {
+        tableInfomation: [],
+        selectBox: true,
+        showcol: this.showcol,
+        allcol: [],
+        tableColumn: this.setTableColumn(this.showcol)
+      }
+      let allcol = []
+      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
+        if (!this.tableList.tableColumn[i].default) {
+          const label = this.tableList.tableColumn[i].label
+          allcol.push(label)
+        }
+      }
+      this.tableList.allcol = allcol
+    },
+    setTableColumn(showcol) {
+      let tableColumn = [
+        {
+          label: "鏃ユ湡",
+          prop: "operationDate",
+          isShowColumn: true,
+          default: true,
+          date: true
+        },
+        {
+          label: "鍗曞彿",
+          prop: "number",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "浜у搧",
+          prop: "productName",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "浠�",
+          prop: "from",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "鑷�",
+          prop: "to",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "鏁伴噺",
+          prop: "amount",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "鍗曚綅",
+          prop: "unit",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "鐘舵��",
+          prop: "status",
+          width: 120,
+          isShowColumn: showcol.includes("鐘舵��"),
+          default: false,
+          status: true,
+          isCallMethod: true,
+          getCallMethod: this.getStatus
+        },
+        {
+          label: "瀹屾垚鑰�",
+          prop: "admin",
+          isShowColumn: showcol.includes("瀹屾垚鑰�"),
+          default: false
+        }
+      ]
+      return tableColumn
+    },
+    selTableCol(val) {
+      this.showcol = val
+      this.tableList.tableColumn = this.setTableColumn(val)
+    },
+    // 璇锋眰鏁版嵁
+    async getData() {
+      await getProductOperatonList({
+        productId: this.productId,
+        page: this.pagerOptions.currPage,
+        pageSize: this.pagerOptions.pageSize
+      }).then((res) => {
+        if (res.code === 200) {
+          const list = res.data.map((item) => {
+            return {
+              ...item,
+              from: item.fromLocation.name,
+              to: item.toLocation.name,
+              productName: this.productName
+            }
+          })
+          this.tableList.tableInfomation = list || []
+          this.pagerOptions.totalCount = res.total
+        }
+      })
+    },
+    // 鎼滅储
+    getList(val) {
+      console.log(val)
+    },
+    // 琛岀偣鍑�
+    tableRowClick(row) {
+      console.log(row)
+      this.editConfig.visible = true
+      this.editConfig.title = "鏌ョ湅"
+      this.editConfig.infomation = { ...row }
+    },
+    // 鏂板缓
+    addBtnClick() {
+      this.editConfig.visible = true
+      this.editConfig.title = "鏂板缓"
+    },
+    // 鐘舵��
+    getStatus(val) {
+      return val === 1 ? "鑽夌" : val === 3 ? "灏辩华" : "瀹屾垚"
+    }
+  }
+}
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style lang="scss" scoped>
+// .rightContent {
+//   height: 100%;
+//   background: #e6ecf2;
+//   padding: 10px;
+//   .top {
+//     margin-bottom: 20px;
+//     height: 60px;
+//     background: #fff;
+//     border-radius: 8px;
+//   }
+//   .list-view {
+//     height: calc(100% - 120px);
+//   }
+// }
+</style>
diff --git a/src/views/reportForm/locationReport/index.vue b/src/views/reportForm/locationReport/index.vue
new file mode 100644
index 0000000..39736e4
--- /dev/null
+++ b/src/views/reportForm/locationReport/index.vue
@@ -0,0 +1,210 @@
+<template>
+  <div class="rightContent">
+    <div class="top">
+      <SearchCommonView
+        :add-title="'鏂板缓'"
+        :showAdd="false"
+        :placeholder="'璇疯緭鍏ュ弬鑰�'"
+        :amount-view="false"
+        @addCommonClick="addBtnClick"
+        @searchClick="getList"
+      />
+    </div>
+    <div class="list-view">
+      <TableCommonView
+        ref="tableListRef"
+        :table-list="tableList"
+        @selTableCol="selTableCol"
+        @tableRowClick="tableRowClick"
+      ></TableCommonView>
+      <div class="btn-pager">
+        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
+      </div>
+    </div>
+    <!-- 缂栬緫 -->
+    <AddOverviewDialog v-if="editConfig.visible" :edit-common-config="editConfig" :add-name="this.$route.params.name" />
+  </div>
+</template>
+
+<script>
+import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
+import { getProductOperatonList } from "@/api/product/product"
+import AddOverviewDialog from "@/views/overview/AddOverviewDialog"
+
+export default {
+  name: "InventoryReport",
+  props: {},
+  components: { AddOverviewDialog },
+  mixins: [pageMixin],
+  computed: {},
+  data() {
+    return {
+      tableList: {},
+      showcol: ["鐘舵��"],
+      searchOptions: [],
+      commonDetail: {
+        visible: false,
+        title: "鏂板缓",
+        infomation: {}
+      },
+      editConfig: {
+        visible: false,
+        title: "鏂板缓",
+        infomation: {}
+      },
+      productId: this.$route.params.id,
+      productName: this.$route.params.name
+    }
+  },
+  created() {
+    this.setTable()
+    this.getData()
+  },
+  methods: {
+    setTable() {
+      this.tableList = {
+        tableInfomation: [],
+        selectBox: true,
+        showcol: this.showcol,
+        allcol: [],
+        tableColumn: this.setTableColumn(this.showcol)
+      }
+      let allcol = []
+      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
+        if (!this.tableList.tableColumn[i].default) {
+          const label = this.tableList.tableColumn[i].label
+          allcol.push(label)
+        }
+      }
+      this.tableList.allcol = allcol
+    },
+    setTableColumn(showcol) {
+      let tableColumn = [
+        {
+          label: "鏃ユ湡",
+          prop: "operationDate",
+          isShowColumn: true,
+          default: true,
+          date: true
+        },
+        {
+          label: "鍗曞彿",
+          prop: "number",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "浜у搧",
+          prop: "productName",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "浠�",
+          prop: "from",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "鑷�",
+          prop: "to",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "鏁伴噺",
+          prop: "amount",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "鍗曚綅",
+          prop: "unit",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "鐘舵��",
+          prop: "status",
+          width: 120,
+          isShowColumn: showcol.includes("鐘舵��"),
+          default: false,
+          status: true,
+          isCallMethod: true,
+          getCallMethod: this.getStatus
+        },
+        {
+          label: "瀹屾垚鑰�",
+          prop: "admin",
+          isShowColumn: showcol.includes("瀹屾垚鑰�"),
+          default: false
+        }
+      ]
+      return tableColumn
+    },
+    selTableCol(val) {
+      this.showcol = val
+      this.tableList.tableColumn = this.setTableColumn(val)
+    },
+    // 璇锋眰鏁版嵁
+    async getData() {
+      await getProductOperatonList({
+        productId: this.productId,
+        page: this.pagerOptions.currPage,
+        pageSize: this.pagerOptions.pageSize
+      }).then((res) => {
+        if (res.code === 200) {
+          const list = res.data.map((item) => {
+            return {
+              ...item,
+              from: item.fromLocation.name,
+              to: item.toLocation.name,
+              productName: this.productName
+            }
+          })
+          this.tableList.tableInfomation = list || []
+          this.pagerOptions.totalCount = res.total
+        }
+      })
+    },
+    // 鎼滅储
+    getList(val) {
+      console.log(val)
+    },
+    // 琛岀偣鍑�
+    tableRowClick(row) {
+      console.log(row)
+      this.editConfig.visible = true
+      this.editConfig.title = "鏌ョ湅"
+      this.editConfig.infomation = { ...row }
+    },
+    // 鏂板缓
+    addBtnClick() {
+      this.editConfig.visible = true
+      this.editConfig.title = "鏂板缓"
+    },
+    // 鐘舵��
+    getStatus(val) {
+      return val === 1 ? "鑽夌" : val === 3 ? "灏辩华" : "瀹屾垚"
+    }
+  }
+}
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style lang="scss" scoped>
+// .rightContent {
+//   height: 100%;
+//   background: #e6ecf2;
+//   padding: 10px;
+//   .top {
+//     margin-bottom: 20px;
+//     height: 60px;
+//     background: #fff;
+//     border-radius: 8px;
+//   }
+//   .list-view {
+//     height: calc(100% - 120px);
+//   }
+// }
+</style>
diff --git a/src/views/warehouseManage/listingRules/index.vue b/src/views/warehouseManage/listingRules/index.vue
new file mode 100644
index 0000000..1b6f8c0
--- /dev/null
+++ b/src/views/warehouseManage/listingRules/index.vue
@@ -0,0 +1,169 @@
+<template>
+  <div class="rightContent">
+    <div class="top">
+      <SearchCommonView
+        :add-title="'鏂板缓'"
+        :placeholder="'璇疯緭鍏ュ崟鍙�'"
+        :amount-view="false"
+        @addCommonClick="addBtnClick"
+        @searchClick="getList"
+      />
+    </div>
+    <div class="list-view">
+      <div class="table">
+        <TableCommonView
+          ref="tableListRef"
+          :table-list="tableList"
+          :show-checkcol="false"
+          @tableRowClick="tableRowClick"
+        ></TableCommonView>
+      </div>
+      <div class="btn-pager">
+        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
+      </div>
+    </div>
+    <!-- 鏂板缓/缂栬緫 -->
+    <AddDialog
+      v-if="editConfig.visible"
+      @refresh="refresh"
+      :positionList="tableList.tableInfomation"
+      :edit-common-config="editConfig"
+    />
+  </div>
+</template>
+
+<script>
+import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
+import { getLocationList } from "@/api/warehouseManage/warehouse"
+import AddDialog from "@/views/warehouseManage/position/AddDialog"
+import { getDataByType } from "@/api/data"
+export default {
+  name: "ListingRules",
+  props: {},
+  components: { AddDialog },
+  mixins: [pageMixin],
+  computed: {},
+  data() {
+    return {
+      tableList: {},
+      searchOptions: [],
+      editConfig: {
+        visible: false,
+        title: "鏂板缓",
+        infomation: {}
+      },
+      positionTypeList: getDataByType("positionType")
+    }
+  },
+  created() {
+    this.setTable()
+    this.getData()
+  },
+  methods: {
+    setTable() {
+      this.tableList = {
+        tableInfomation: [],
+        selectBox: true,
+        showcol: this.showcol,
+        allcol: [],
+        tableColumn: this.setTableColumn(this.showcol)
+      }
+      let allcol = []
+      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
+        if (!this.tableList.tableColumn[i].default) {
+          const label = this.tableList.tableColumn[i].label
+          allcol.push(label)
+        }
+      }
+      this.tableList.allcol = allcol
+    },
+    setTableColumn(showcol) {
+      console.log(showcol)
+      let tableColumn = [
+        {
+          label: "浣嶇疆",
+          prop: "jointName",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "浣嶇疆绫诲瀷",
+          prop: "type",
+          isShowColumn: true,
+          default: true,
+          conversion: true,
+          getStatus: this.getTypesList
+        }
+      ]
+      return tableColumn
+    },
+    getTypesList(val) {
+      let string = "--"
+      if (val) {
+        for (let i in this.positionTypeList) {
+          if (this.positionTypeList[i].id == val) {
+            return this.positionTypeList[i].name
+          }
+        }
+      }
+      return string
+    },
+    selTableCol(val) {
+      this.showcol = val
+      this.tableList.tableColumn = this.setTableColumn(val)
+    },
+    // 璇锋眰鏁版嵁
+    async getData() {
+      await getLocationList({
+        keyword: this.keyword,
+        page: this.pagerOptions.currPage,
+        pageSize: this.pagerOptions.pageSize
+      }).then((res) => {
+        if (res.code === 200) {
+          const list = res.data ? res.data : []
+          this.tableList.tableInfomation = list
+          this.pagerOptions.totalCount = res.total
+        }
+      })
+    },
+    refresh() {
+      this.pagerOptions.currPage = 1
+      this.getData()
+    },
+    // 鎼滅储
+    getList(val) {
+      this.keyword = val
+      this.pagerOptions.currPage = 1
+      this.getData()
+    },
+    // 琛岀偣鍑�
+    tableRowClick(row) {
+      console.log(row)
+      this.editConfig.title = "缂栬緫"
+      this.editConfig.infomation = { ...row }
+      this.editConfig.infomation.parentId = Number(this.editConfig.infomation.parentId)
+      this.editConfig.visible = true
+    },
+    // 鏂板缓
+    addBtnClick() {
+      this.editConfig.infomation = {
+        name: "",
+        parentId: null,
+        type: 3,
+        isScrapLocation: null,
+        isReturnLocation: null,
+        replenishLocation: null,
+        countFrequency: 0,
+        recentlyCount: "",
+        nextCount: "",
+        notes: ""
+      }
+      this.editConfig.visible = true
+      this.editConfig.title = "鏂板缓"
+    }
+  }
+}
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style lang="scss" scoped></style>

--
Gitblit v1.8.0