| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | 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) |
| | |
| | | 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 = [ |
| | | { |
| | |
| | | title: "仓库管理", |
| | | isAllways: true |
| | | } |
| | | }, |
| | | { |
| | | path: "reportForm", // 报表 |
| | | name: "reportForm", |
| | | component: reportForm, |
| | | children: reportRouter, |
| | | meta: { |
| | | title: "报表", |
| | | isAllways: true |
| | | } |
| | | } |
| | | ] |
| | | export const constantRoutes = [ |
| | |
| | | |
| | | 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 = [ |
| | | { |
| | |
| | | meta: { |
| | | title: "报废单" |
| | | } |
| | | }, |
| | | { |
| | | path: "/operate/inventoryAdjustment", |
| | | name: "inventoryAdjustment", |
| | | component: inventoryAdjustment, |
| | | meta: { |
| | | title: "库存调整" |
| | | } |
| | | } |
| | | ] |
| | | |
New file |
| | |
| | | // 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 |
| | |
| | | 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 = [ |
| | | { |
| | |
| | | meta: { |
| | | title: "业务类型" |
| | | } |
| | | }, |
| | | { |
| | | path: "/warehouseManage/listingRules", |
| | | name: "listingRules", |
| | | component: listingRules, |
| | | meta: { |
| | | title: "上架规则" |
| | | } |
| | | } |
| | | ] |
| | | |
New file |
| | |
| | | <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> |
New file |
| | |
| | | <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> |
New file |
| | |
| | | <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> |
New file |
| | |
| | | <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> |