From 12e5839f8b2b958cbd3e0047ee5f9873ff65495d Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期五, 15 九月 2023 19:50:33 +0800 Subject: [PATCH] 仓库管理列表页 --- src/assets/style/reset-element.scss | 14 + src/components/layout/components/appsidebar/index.scss | 12 src/views/warehouseManage/warehouse/index.vue | 145 ++++++++++++++++ src/components/layout/components/appsidebar/index.vue | 6 src/views/warehouseManage/bussinessType/index.vue | 139 +++++++++++++++ src/router/warehouseManage/index.js | 29 ++- src/views/warehouseManage/position/index.vue | 139 +++++++++++++++ 7 files changed, 466 insertions(+), 18 deletions(-) diff --git a/src/assets/style/reset-element.scss b/src/assets/style/reset-element.scss index 142ecc7..8ae9ff0 100644 --- a/src/assets/style/reset-element.scss +++ b/src/assets/style/reset-element.scss @@ -25,3 +25,17 @@ padding: 0; } } + +// .el-menu-item { +// margin: 8px; +// border-radius: 6px; +// i { +// color: #fff; +// } +// } +// .el-menu-item:hover, +// .el-menu-item:focus { +// background-color: #0e6ce6; +// background-position: center; +// width: 160px !important; +// } diff --git a/src/components/layout/components/appsidebar/index.scss b/src/components/layout/components/appsidebar/index.scss index 339111c..42ced06 100644 --- a/src/components/layout/components/appsidebar/index.scss +++ b/src/components/layout/components/appsidebar/index.scss @@ -16,10 +16,12 @@ .icon { color: #bfcbd9; } - .el-submenu__title:hover, - .el-menu-item:focus, - .el-menu-item:hover { - background-color: cornflowerblue; - } + // .el-submenu__title:hover, + // .el-menu-item:focus, + // .el-menu-item:hover { + // min-width: 180px; + // color: #fff; + // background-color: #2a78fb !important; + // } } } diff --git a/src/components/layout/components/appsidebar/index.vue b/src/components/layout/components/appsidebar/index.vue index 7c6cca3..1ec6af7 100644 --- a/src/components/layout/components/appsidebar/index.vue +++ b/src/components/layout/components/appsidebar/index.vue @@ -46,9 +46,9 @@ <i class="el-icon-box 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="/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-submenu> </el-menu> diff --git a/src/router/warehouseManage/index.js b/src/router/warehouseManage/index.js index b5b7f6c..5a7379d 100644 --- a/src/router/warehouseManage/index.js +++ b/src/router/warehouseManage/index.js @@ -1,23 +1,32 @@ // const type from '@/router/deployCode' -const product = (resolve) => require(["@/views/productManage/product/index"], resolve) // 浜у搧绠$悊 -const overviewList = (resolve) => require(["@/views/overview/OverviewListView"], resolve) // 姒傝堪鍒楄〃椤� +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 appconfig = [ { - path: "/productManage/product", - name: "product", - component: product, + path: "/warehouseManage/warehouse", + name: "warehouse", + component: warehouse, meta: { - title: "浜у搧绠$悊" + title: "浠撳簱" } }, { - path: "/overview/overviewList", - name: "overviewList", - component: overviewList, + path: "/warehouseManage/position", + name: "position", + component: position, meta: { - title: "閲囪喘鍏ュ簱" + title: "浣嶇疆" + } + }, + { + path: "/warehouseManage/bussinessType", + name: "bussinessType", + component: bussinessType, + meta: { + title: "涓氬姟绫诲瀷" } } ] diff --git a/src/views/warehouseManage/bussinessType/index.vue b/src/views/warehouseManage/bussinessType/index.vue new file mode 100644 index 0000000..7eda06b --- /dev/null +++ b/src/views/warehouseManage/bussinessType/index.vue @@ -0,0 +1,139 @@ +<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> + <!-- 鏂板缓/缂栬緫 --> + <AddScrapDialog v-if="editConfig.visible" :edit-common-config="editConfig" /> + </div> +</template> + +<script> +import pageMixin from "@/components/makepager/pager/mixin/pageMixin" +import { getProductList } from "@/api/product/product" +// import DetailProduct from "@/views/productManage/product/DetailProduct" +import AddScrapDialog from "@/views/operate/scrap/AddScrapDialog" + +export default { + name: "WarehouseView", + props: {}, + components: { AddScrapDialog }, + mixins: [pageMixin], + computed: {}, + data() { + return { + tableList: {}, + searchOptions: [], + editConfig: { + visible: false, + title: "鏂板缓", + infomation: {} + } + } + }, + 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: "id", + isShowColumn: true, + default: true + }, + { + label: "浠撳簱", + prop: "deviceName", + isShowColumn: true, + default: true + } + ] + return tableColumn + }, + selTableCol(val) { + this.showcol = val + this.tableList.tableColumn = this.setTableColumn(val) + }, + // 璇锋眰鏁版嵁 + async getData(val, content) { + await getProductList({ + [val]: content, + page: this.pagerOptions.currPage, + pageSize: this.pagerOptions.pageSize + }).then((res) => { + if (res.data.code === 200) { + const list = res.data.data.list.map((item) => { + return { + ...item, + supplierNumber: item.supplier.number, + status: "鑽夌", + preTime: "2023-09-04 11:20:00" + } + }) + this.tableList.tableInfomation = list || [] + this.pagerOptions.totalCount = res.data.data.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 = "鏂板缓" + } + } +} +</script> + +<!-- Add "scoped" attribute to limit CSS to this component only --> +<style lang="scss" scoped></style> diff --git a/src/views/warehouseManage/position/index.vue b/src/views/warehouseManage/position/index.vue new file mode 100644 index 0000000..eb15f44 --- /dev/null +++ b/src/views/warehouseManage/position/index.vue @@ -0,0 +1,139 @@ +<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> + <!-- 鏂板缓/缂栬緫 --> + <AddScrapDialog v-if="editConfig.visible" :edit-common-config="editConfig" /> + </div> +</template> + +<script> +import pageMixin from "@/components/makepager/pager/mixin/pageMixin" +import { getProductList } from "@/api/product/product" +// import DetailProduct from "@/views/productManage/product/DetailProduct" +import AddScrapDialog from "@/views/operate/scrap/AddScrapDialog" + +export default { + name: "WarehouseView", + props: {}, + components: { AddScrapDialog }, + mixins: [pageMixin], + computed: {}, + data() { + return { + tableList: {}, + searchOptions: [], + editConfig: { + visible: false, + title: "鏂板缓", + infomation: {} + } + } + }, + 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: "id", + isShowColumn: true, + default: true + }, + { + label: "浣嶇疆绫诲瀷", + prop: "deviceName", + isShowColumn: true, + default: true + } + ] + return tableColumn + }, + selTableCol(val) { + this.showcol = val + this.tableList.tableColumn = this.setTableColumn(val) + }, + // 璇锋眰鏁版嵁 + async getData(val, content) { + await getProductList({ + [val]: content, + page: this.pagerOptions.currPage, + pageSize: this.pagerOptions.pageSize + }).then((res) => { + if (res.data.code === 200) { + const list = res.data.data.list.map((item) => { + return { + ...item, + supplierNumber: item.supplier.number, + status: "鑽夌", + preTime: "2023-09-04 11:20:00" + } + }) + this.tableList.tableInfomation = list || [] + this.pagerOptions.totalCount = res.data.data.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 = "鏂板缓" + } + } +} +</script> + +<!-- Add "scoped" attribute to limit CSS to this component only --> +<style lang="scss" scoped></style> diff --git a/src/views/warehouseManage/warehouse/index.vue b/src/views/warehouseManage/warehouse/index.vue new file mode 100644 index 0000000..53637d9 --- /dev/null +++ b/src/views/warehouseManage/warehouse/index.vue @@ -0,0 +1,145 @@ +<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> + <!-- 鏂板缓/缂栬緫 --> + <AddScrapDialog v-if="editConfig.visible" :edit-common-config="editConfig" /> + </div> +</template> + +<script> +import pageMixin from "@/components/makepager/pager/mixin/pageMixin" +import { getProductList } from "@/api/product/product" +// import DetailProduct from "@/views/productManage/product/DetailProduct" +import AddScrapDialog from "@/views/operate/scrap/AddScrapDialog" + +export default { + name: "WarehouseView", + props: {}, + components: { AddScrapDialog }, + mixins: [pageMixin], + computed: {}, + data() { + return { + tableList: {}, + searchOptions: [], + editConfig: { + visible: false, + title: "鏂板缓", + infomation: {} + } + } + }, + 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: "id", + isShowColumn: true, + default: true + }, + { + label: "搴撳瓨浣嶇疆", + prop: "deviceName", + isShowColumn: true, + default: true + }, + { + label: "鍦板潃", + prop: "id", + isShowColumn: true, + default: true + } + ] + return tableColumn + }, + selTableCol(val) { + this.showcol = val + this.tableList.tableColumn = this.setTableColumn(val) + }, + // 璇锋眰鏁版嵁 + async getData(val, content) { + await getProductList({ + [val]: content, + page: this.pagerOptions.currPage, + pageSize: this.pagerOptions.pageSize + }).then((res) => { + if (res.data.code === 200) { + const list = res.data.data.list.map((item) => { + return { + ...item, + supplierNumber: item.supplier.number, + status: "鑽夌", + preTime: "2023-09-04 11:20:00" + } + }) + this.tableList.tableInfomation = list || [] + this.pagerOptions.totalCount = res.data.data.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 = "鏂板缓" + } + } +} +</script> + +<!-- Add "scoped" attribute to limit CSS to this component only --> +<style lang="scss" scoped></style> -- Gitblit v1.8.0