From 6feabe587b8f79bebdd8b7c5fee654e1b963acf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8A=B2=E9=BE=99?= <2860996570@qq.com> Date: Wed, 9 Aug 2023 14:41:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=A7=E5=93=81=E6=8F=90?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/external/index.js | 2 +- .../components/cosmeticsArchives.vue | 114 +++++++++++------- src/views/productsMsg/components/health.vue | 102 ++++++++++++---- src/views/productsMsg/index.vue | 100 +++++++++++---- 4 files changed, 227 insertions(+), 91 deletions(-) diff --git a/src/api/external/index.js b/src/api/external/index.js index 527f619..ba82bc3 100644 --- a/src/api/external/index.js +++ b/src/api/external/index.js @@ -3,7 +3,7 @@ import request from "@/utils/request"; //获取用户信息 export function getselfInfo() { return request({ - baseURL: location.origin, + // baseURL: location.origin, url: "/api/admin/user/getSelfInfo", method: "GET", }); diff --git a/src/views/productsMsg/components/cosmeticsArchives.vue b/src/views/productsMsg/components/cosmeticsArchives.vue index f502369..0fcba39 100644 --- a/src/views/productsMsg/components/cosmeticsArchives.vue +++ b/src/views/productsMsg/components/cosmeticsArchives.vue @@ -9,28 +9,28 @@ - + - + - + - + - + - + - + - + @@ -117,9 +117,10 @@ @@ -137,23 +138,23 @@ export default { A1: "产品名称", A2: "备案编码", A3: "生产企业", - types: '1', + types: "1", total: 0, options: [ { - value: '1', + value: "1", label: "国产化妆品", }, { - value: '2', + value: "2", label: "国产特殊化妆品", }, { - value: '3', + value: "3", label: "进口化妆品", }, { - value: '4', + value: "4", label: "进口特殊化妆品", }, ], @@ -162,47 +163,67 @@ export default { cpmc: "", name: "", scqy: "", + }, + form: { size: 10, current: 1, }, + jieliuShow: true, }; }, mounted() {}, created() { - this.changeType('1'); + this.changeType("1"); }, methods: { + jieliuFunc() { + if (this.jieliuShow) { + this.getData(this.types); + this.jieliuShow = false; + setTimeout(() => { + this.jieliuShow = true; + }, 3000); + } else { + this.$message("点击过快"); + } + }, //去内嵌页面 toDetail(e) { let data = ""; - if (this.types == '1') { + if (this.types == "1") { data = e.bah; - } else if (this.types == '2') { + } else if (this.types == "2") { data = e.zczh; - } else if (this.types == '3') { + } else if (this.types == "3") { data = e.bah; - } else if (this.types == '4') { + } else if (this.types == "4") { data = e.zczh; } //利用type区分三种档案 //利用flag区分四种化妆品详情 然后分别调用不同的详情接口 this.$router.push({ path: `/cosmeticsDetail`, - query: { type: '1', flag: this.types, data }, + query: { type: "1", flag: this.types, data }, }); }, //搜索 searchList() { - this.getData(this.types); + this.form.current = 1; + + for (let i in this.form1) { + this.form[i] = this.form1[i]; + } + this.jieliuFunc(); }, getPagination(e) { console.log(e); - this.form1.current = e.page; - this.form1.size = e.limit; + this.form.current = e.page; + this.form.size = e.limit; this.chinaCosmetics(); }, //重置 reset() { + this.types = "1"; this.form1 = { babm: "", cpmc: "", @@ -211,75 +232,79 @@ export default { size: 10, current: 1, }; + this.form = { + size: 10, + current: 1, + }; + this.jieliuFunc(); }, //国产化妆品 async chinaCosmetics() { this.loading = true; - let msg1 = await this.$api.cosmetics.domesticList(this.form1); + let msg1 = await this.$api.cosmetics.domesticList(this.form); this.tableData = msg1.data.records; this.total = msg1.data.total; - this.form1.size = msg1.data.size; - this.form1.current = msg1.data.current; + this.form.size = msg1.data.size; + this.form.current = msg1.data.current; this.loading = false; }, //国产特殊化妆品 async chinaSpecialCosmetics() { this.loading = true; - let msg1 = await this.$api.cosmetics.specialList(this.form1); + let msg1 = await this.$api.cosmetics.specialList(this.form); this.tableData = msg1.data.records; this.total = msg1.data.total; - this.form1.size = msg1.data.size; - this.form1.current = msg1.data.current; + this.form.size = msg1.data.size; + this.form.current = msg1.data.current; this.loading = false; }, //进口化妆品 async importCosmetics() { this.loading = true; - let msg1 = await this.$api.cosmetics.importList(this.form1); + let msg1 = await this.$api.cosmetics.importList(this.form); this.tableData = msg1.data.records; this.total = msg1.data.total; - this.form1.size = msg1.data.size; - this.form1.current = msg1.data.current; + this.form.size = msg1.data.size; + this.form.current = msg1.data.current; this.loading = false; }, //进口特殊化妆品 async importSpecialCosmetics() { this.loading = true; - let msg1 = await this.$api.cosmetics.importSpecialList(this.form1); + let msg1 = await this.$api.cosmetics.importSpecialList(this.form); this.tableData = msg1.data.records; this.total = msg1.data.total; - this.form1.size = msg1.data.size; - this.form1.current = msg1.data.current; + this.form.size = msg1.data.size; + this.form.current = msg1.data.current; this.loading = false; }, async getData(e) { - if (e == '1') { + if (e == "1") { this.A2 = "备案编码"; this.A3 = "生产企业"; this.chinaCosmetics(); - } else if (e == '2') { + } else if (e == "2") { this.A2 = "批准日期"; this.A3 = "省份"; this.chinaSpecialCosmetics(); - } else if (e == '3') { + } else if (e == "3") { this.A2 = "备案编码"; this.A3 = "生产企业"; this.importCosmetics(); - } else if (e == '4') { + } else if (e == "4") { this.A2 = "批准日期"; this.A3 = "省份"; this.importSpecialCosmetics(); } }, async changeType(e) { - this.reset(); + // this.reset(); this.getData(e); }, }, }; - \ No newline at end of file +::v-deep.el-table--medium .el-table__cell { + padding: 2.53px 0; +} + diff --git a/src/views/productsMsg/components/health.vue b/src/views/productsMsg/components/health.vue index 557dd81..7c50b41 100644 --- a/src/views/productsMsg/components/health.vue +++ b/src/views/productsMsg/components/health.vue @@ -9,7 +9,7 @@ - + @@ -27,14 +27,14 @@ - + - + @@ -57,24 +57,53 @@
- - - - - - + + + + + + + - +