yangfeng
2023-09-26 7ffe5a313fb55e101ab4f77167847ff456eeb6db
新增模块路由配置
5个文件已添加
4个文件已修改
829 ■■■■■ 已修改文件
src/components/layout/components/appsidebar/index.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/operate/index.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/report/index.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/warehouseManage/index.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/inventoryAdjustment/index.vue 169 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/reportForm/inventoryReport/index.vue 210 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/reportForm/locationReport/index.vue 210 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouseManage/listingRules/index.vue 169 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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>
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 = [
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: "库存调整"
    }
  }
]
src/router/report/index.js
New file
@@ -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
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: "上架规则"
    }
  }
]
src/views/operate/inventoryAdjustment/index.vue
New file
@@ -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>
src/views/reportForm/inventoryReport/index.vue
New file
@@ -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>
src/views/reportForm/locationReport/index.vue
New file
@@ -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>
src/views/warehouseManage/listingRules/index.vue
New file
@@ -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>