From 04489cc3864aa38fde8b539aee6c4c9eed6ab1d4 Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期四, 28 九月 2023 14:35:35 +0800 Subject: [PATCH] 解决产品列表报错 --- src/views/reportForm/inboundOutboundDetail/index.vue | 79 +++++++++++++++++++++++++-------------- 1 files changed, 50 insertions(+), 29 deletions(-) diff --git a/src/views/reportForm/inboundOutboundDetail/index.vue b/src/views/reportForm/inboundOutboundDetail/index.vue index 8ac2cc1..31bd7f2 100644 --- a/src/views/reportForm/inboundOutboundDetail/index.vue +++ b/src/views/reportForm/inboundOutboundDetail/index.vue @@ -21,18 +21,20 @@ <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 { getProductList } from "@/api/product/product" -// import DetailProduct from "@/views/productManage/product/DetailProduct" +import { getProductOperatonList } from "@/api/product/product" +import AddOverviewDialog from "@/views/overview/AddOverviewDialog" export default { name: "InboundOutboundDetail", props: {}, - components: {}, + components: { AddOverviewDialog }, mixins: [pageMixin], computed: {}, data() { @@ -49,11 +51,23 @@ visible: false, title: "鏂板缓", infomation: {} - } + }, + params: {} } }, created() { this.setTable() + console.log(this.$route.params) + var paramsData = sessionStorage.getItem("paramsList") + let params = {} + if (paramsData) { + params = JSON.parse(sessionStorage.getItem("paramsList")) + } else { + params = this.$route.params + sessionStorage.setItem("paramsList", JSON.stringify(params)) + } + this.params = params + console.log(this.params) this.getData() }, methods: { @@ -78,43 +92,44 @@ let tableColumn = [ { label: "鏃ユ湡", - prop: "id", + prop: "operationDate", isShowColumn: true, - default: true + default: true, + date: true }, { - label: "鍙傝��", - prop: "id", + label: "鍗曞彿", + prop: "number", isShowColumn: true, default: true }, { label: "浜у搧", - prop: "id", + prop: "productName", isShowColumn: true, default: true }, { label: "浠�", - prop: "deviceName", + prop: "from", isShowColumn: true, default: true }, { label: "鑷�", - prop: "id", + prop: "to", isShowColumn: true, default: true }, { - label: "鍏徃", - prop: "shopName", - isShowColumn: showcol.includes("鍏徃"), - default: false + label: "鏁伴噺", + prop: "amount", + isShowColumn: true, + default: true }, { - label: "鏁伴噺", - prop: "deviceId", + label: "鍗曚綅", + prop: "unit", isShowColumn: true, default: true }, @@ -124,11 +139,13 @@ width: 120, isShowColumn: showcol.includes("鐘舵��"), default: false, - status: true + status: true, + isCallMethod: true, + getCallMethod: this.getStatus }, { label: "瀹屾垚鑰�", - prop: "preTime", + prop: "admin", isShowColumn: showcol.includes("瀹屾垚鑰�"), default: false } @@ -140,23 +157,23 @@ this.tableList.tableColumn = this.setTableColumn(val) }, // 璇锋眰鏁版嵁 - async getData(val, content) { - await getProductList({ - [val]: content, + async getData() { + await getProductOperatonList({ + productId: this.params.id, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }).then((res) => { - if (res.data.code === 200) { - const list = res.data.data.list.map((item) => { + if (res.code === 200) { + const list = res.data.map((item) => { return { ...item, - supplierNumber: item.supplier.number, - status: "灏辩华", - preTime: "2023-09-04 11:20:00" + from: item.fromLocation.name, + to: item.toLocation.name, + productName: this.params.name } }) this.tableList.tableInfomation = list || [] - this.pagerOptions.totalCount = res.data.data.total + this.pagerOptions.totalCount = res.total } }) }, @@ -168,13 +185,17 @@ tableRowClick(row) { console.log(row) this.editConfig.visible = true - this.editConfig.title = "缂栬緫" + this.editConfig.title = "鏌ョ湅" this.editConfig.infomation = { ...row } }, // 鏂板缓 addBtnClick() { this.editConfig.visible = true this.editConfig.title = "鏂板缓" + }, + // 鐘舵�� + getStatus(val) { + return val === 1 ? "鑽夌" : val === 3 ? "灏辩华" : "瀹屾垚" } } } -- Gitblit v1.8.0