From fbe9459ed908eef6c25c3bcd244d0a7e74dfa792 Mon Sep 17 00:00:00 2001 From: songshankun <songshankun@foxmail.com> Date: 星期四, 19 十月 2023 13:45:08 +0800 Subject: [PATCH] feat: 产品列表添加查看编辑按钮;弹窗根据情况展示对应标题 --- src/views/overview/OverviewListView.vue | 36 +++++++++++++++++++++++++++--------- 1 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/views/overview/OverviewListView.vue b/src/views/overview/OverviewListView.vue index b5a8f1e..4f5a945 100644 --- a/src/views/overview/OverviewListView.vue +++ b/src/views/overview/OverviewListView.vue @@ -3,7 +3,7 @@ <div class="top"> <SearchCommonView :add-title="'鏂板缓'" - :placeholder="'璇疯緭鍏ュ崟鍙�'" + :placeholder="'璇疯緭鍏ュ崟鍙�/鏉ユ簮鍗曟嵁'" :amount-view="false" @addCommonClick="addBtnClick" @searchClick="getList" @@ -59,19 +59,35 @@ title: "鏂板缓", infomation: {} }, - workType: this.$route.params.workType + workType: this.$route.params.workType, + keyword: "", + params: {} } }, created() { this.setTable() + var paramsData = sessionStorage.getItem("paramsData") + let params = {} + if (paramsData) { + params = JSON.parse(sessionStorage.getItem("paramsData")) + } else { + params = this.$route.params + sessionStorage.setItem("paramsData", JSON.stringify(params)) + } + this.params = params this.getData() - console.log(this.$route.params.workType) + // console.log(this.$route.params.workType) + }, + // 椤甸潰閿�姣佷箣鍓� + beforeDestroy() { + sessionStorage.removeItem("paramsData") }, methods: { setTable() { this.tableList = { tableInfomation: [], - selectBox: true, + selectBox: false, + selectIndex: true, showcol: this.showcol, allcol: [], tableColumn: this.setTableColumn(this.showcol) @@ -180,13 +196,14 @@ // 璇锋眰鏁版嵁 async getData() { await getOperation({ - operationTypeId: this.$route.params.id, + number: this.keyword, + operationTypeId: this.params.id, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }).then((res) => { - console.log(res.data.data) - if (res.data.code === 200) { - const list = res.data.data.map((item) => { + console.log(res.data) + if (res.code === 200) { + const list = res.data.map((item) => { return { ...item, from: item.fromLocation.name, @@ -194,13 +211,14 @@ } }) this.tableList.tableInfomation = list || [] - this.pagerOptions.totalCount = res.data.total + this.pagerOptions.totalCount = res.total } }) }, // 鎼滅储 getList(val) { console.log(val) + this.keyword = val this.pagerOptions.currPage = 1 this.getData() }, -- Gitblit v1.8.0