diff --git a/src/components/mycomponent/dialog/categoryAddDialog.vue b/src/components/mycomponent/dialog/categoryAddDialog.vue index 4e547d4..9b19268 100644 --- a/src/components/mycomponent/dialog/categoryAddDialog.vue +++ b/src/components/mycomponent/dialog/categoryAddDialog.vue @@ -161,13 +161,13 @@ { paramName: '', paramOrder: 0, - paramRequire: false + paramRequire: 0 } ] }, categoryList: [], // 资质列表 - certificationList: [] + certificationList: [], } }, watch: { diff --git a/src/components/mycomponent/dialog/categoryAddDialog.vue b/src/components/mycomponent/dialog/categoryAddDialog.vue index 4e547d4..9b19268 100644 --- a/src/components/mycomponent/dialog/categoryAddDialog.vue +++ b/src/components/mycomponent/dialog/categoryAddDialog.vue @@ -161,13 +161,13 @@ { paramName: '', paramOrder: 0, - paramRequire: false + paramRequire: 0 } ] }, categoryList: [], // 资质列表 - certificationList: [] + certificationList: [], } }, watch: { diff --git a/src/utils/myUtils/exportToExcel.js b/src/utils/myUtils/exportToExcel.js index 9ec5417..d2a221e 100644 --- a/src/utils/myUtils/exportToExcel.js +++ b/src/utils/myUtils/exportToExcel.js @@ -6,7 +6,7 @@ const data = tableAry.map((user, index) => { const userArr = [] for (const key in tableAry[0]) { - const item = user[key] + let item = user[key] // console.log(item,typeof(item)); if(typeof(item)=="object"){ item = JSON.stringify(item) diff --git a/src/components/mycomponent/dialog/categoryAddDialog.vue b/src/components/mycomponent/dialog/categoryAddDialog.vue index 4e547d4..9b19268 100644 --- a/src/components/mycomponent/dialog/categoryAddDialog.vue +++ b/src/components/mycomponent/dialog/categoryAddDialog.vue @@ -161,13 +161,13 @@ { paramName: '', paramOrder: 0, - paramRequire: false + paramRequire: 0 } ] }, categoryList: [], // 资质列表 - certificationList: [] + certificationList: [], } }, watch: { diff --git a/src/utils/myUtils/exportToExcel.js b/src/utils/myUtils/exportToExcel.js index 9ec5417..d2a221e 100644 --- a/src/utils/myUtils/exportToExcel.js +++ b/src/utils/myUtils/exportToExcel.js @@ -6,7 +6,7 @@ const data = tableAry.map((user, index) => { const userArr = [] for (const key in tableAry[0]) { - const item = user[key] + let item = user[key] // console.log(item,typeof(item)); if(typeof(item)=="object"){ item = JSON.stringify(item) diff --git a/src/utils/myUtils/mixins/listPage.js b/src/utils/myUtils/mixins/listPage.js index 9bc028d..b380ba1 100644 --- a/src/utils/myUtils/mixins/listPage.js +++ b/src/utils/myUtils/mixins/listPage.js @@ -45,6 +45,7 @@ computed: { total() { let index = this.tableData.total / this.limit + console.log(this.tableData.total, this.limit) return Math.ceil(index) } }, diff --git a/src/components/mycomponent/dialog/categoryAddDialog.vue b/src/components/mycomponent/dialog/categoryAddDialog.vue index 4e547d4..9b19268 100644 --- a/src/components/mycomponent/dialog/categoryAddDialog.vue +++ b/src/components/mycomponent/dialog/categoryAddDialog.vue @@ -161,13 +161,13 @@ { paramName: '', paramOrder: 0, - paramRequire: false + paramRequire: 0 } ] }, categoryList: [], // 资质列表 - certificationList: [] + certificationList: [], } }, watch: { diff --git a/src/utils/myUtils/exportToExcel.js b/src/utils/myUtils/exportToExcel.js index 9ec5417..d2a221e 100644 --- a/src/utils/myUtils/exportToExcel.js +++ b/src/utils/myUtils/exportToExcel.js @@ -6,7 +6,7 @@ const data = tableAry.map((user, index) => { const userArr = [] for (const key in tableAry[0]) { - const item = user[key] + let item = user[key] // console.log(item,typeof(item)); if(typeof(item)=="object"){ item = JSON.stringify(item) diff --git a/src/utils/myUtils/mixins/listPage.js b/src/utils/myUtils/mixins/listPage.js index 9bc028d..b380ba1 100644 --- a/src/utils/myUtils/mixins/listPage.js +++ b/src/utils/myUtils/mixins/listPage.js @@ -45,6 +45,7 @@ computed: { total() { let index = this.tableData.total / this.limit + console.log(this.tableData.total, this.limit) return Math.ceil(index) } }, diff --git a/src/views/product/brandList.vue b/src/views/product/brandList.vue index 3157cbb..c5b9c07 100644 --- a/src/views/product/brandList.vue +++ b/src/views/product/brandList.vue @@ -60,11 +60,12 @@ type="danger" icon="el-icon-delete-solid" class="btnItem bgred" - @click=" BatchDelete" + @click="BatchDelete" > 删除 - + 导出 + + @@ -109,7 +113,15 @@ - + @@ -121,26 +133,27 @@ diff --git a/src/components/mycomponent/dialog/categoryAddDialog.vue b/src/components/mycomponent/dialog/categoryAddDialog.vue index 4e547d4..9b19268 100644 --- a/src/components/mycomponent/dialog/categoryAddDialog.vue +++ b/src/components/mycomponent/dialog/categoryAddDialog.vue @@ -161,13 +161,13 @@ { paramName: '', paramOrder: 0, - paramRequire: false + paramRequire: 0 } ] }, categoryList: [], // 资质列表 - certificationList: [] + certificationList: [], } }, watch: { diff --git a/src/utils/myUtils/exportToExcel.js b/src/utils/myUtils/exportToExcel.js index 9ec5417..d2a221e 100644 --- a/src/utils/myUtils/exportToExcel.js +++ b/src/utils/myUtils/exportToExcel.js @@ -6,7 +6,7 @@ const data = tableAry.map((user, index) => { const userArr = [] for (const key in tableAry[0]) { - const item = user[key] + let item = user[key] // console.log(item,typeof(item)); if(typeof(item)=="object"){ item = JSON.stringify(item) diff --git a/src/utils/myUtils/mixins/listPage.js b/src/utils/myUtils/mixins/listPage.js index 9bc028d..b380ba1 100644 --- a/src/utils/myUtils/mixins/listPage.js +++ b/src/utils/myUtils/mixins/listPage.js @@ -45,6 +45,7 @@ computed: { total() { let index = this.tableData.total / this.limit + console.log(this.tableData.total, this.limit) return Math.ceil(index) } }, diff --git a/src/views/product/brandList.vue b/src/views/product/brandList.vue index 3157cbb..c5b9c07 100644 --- a/src/views/product/brandList.vue +++ b/src/views/product/brandList.vue @@ -60,11 +60,12 @@ type="danger" icon="el-icon-delete-solid" class="btnItem bgred" - @click=" BatchDelete" + @click="BatchDelete" > 删除 - + 导出 + + @@ -109,7 +113,15 @@ - + @@ -121,26 +133,27 @@ diff --git a/src/views/product/categoryList.vue b/src/views/product/categoryList.vue index d01ea1d..549229d 100644 --- a/src/views/product/categoryList.vue +++ b/src/views/product/categoryList.vue @@ -55,14 +55,16 @@ > 删除 - + + > 导出 - + + @@ -77,9 +79,10 @@ }" :row-style="{ 'text-align': 'center' }" style="width: 100%" + v-loading="loading" > - + @@ -172,7 +175,8 @@ // 搜索框中的数据的数据 categoryCode: '', categoryName: '' - } + }, + loading:false } }, mounted() { @@ -205,16 +209,26 @@ }, // 获取指定页面 getListPage(limit, offset) { + this.loading = true C_listPage(`limit=${limit}&offset=${offset}`, this.queryInfo).then(res => { if (res.code === 200) { // 得到相关数据 this.tableData = res.data.rows + this.loading = false } + }).catch(err => { + this.loading = false }) }, // 删除 Cdelete(row) { - const id = row.id + this.$confirm(`确认删除此品类吗?`, "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + const id = row.id C_delete({ id: id }).then((res) => { // 删除成功 跟新列表 if (res.code === 200) { @@ -225,11 +239,20 @@ this.refresh() } }) + }) + .catch(() => {}); }, // 批量删除 BatchDelete() { - // 得到选中行 - const dle_ary = this.$refs.multipleTable.selection + if(this.$refs.multipleTable.selection.length !== 0){ + this.$confirm(`确认删除选中的这些品类吗?`, "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + // 得到选中行 + const dle_ary = this.$refs.multipleTable.selection const ids = [] dle_ary.forEach((ele) => { ids.push(ele.id) @@ -243,6 +266,15 @@ this.refresh() } }) + }) + .catch(() => {}); + + }else{ + this.$message({ + message: "请先勾选需要删除的品类", + type: "error", + }); + } }, // 编辑 compile(row) { diff --git a/src/components/mycomponent/dialog/categoryAddDialog.vue b/src/components/mycomponent/dialog/categoryAddDialog.vue index 4e547d4..9b19268 100644 --- a/src/components/mycomponent/dialog/categoryAddDialog.vue +++ b/src/components/mycomponent/dialog/categoryAddDialog.vue @@ -161,13 +161,13 @@ { paramName: '', paramOrder: 0, - paramRequire: false + paramRequire: 0 } ] }, categoryList: [], // 资质列表 - certificationList: [] + certificationList: [], } }, watch: { diff --git a/src/utils/myUtils/exportToExcel.js b/src/utils/myUtils/exportToExcel.js index 9ec5417..d2a221e 100644 --- a/src/utils/myUtils/exportToExcel.js +++ b/src/utils/myUtils/exportToExcel.js @@ -6,7 +6,7 @@ const data = tableAry.map((user, index) => { const userArr = [] for (const key in tableAry[0]) { - const item = user[key] + let item = user[key] // console.log(item,typeof(item)); if(typeof(item)=="object"){ item = JSON.stringify(item) diff --git a/src/utils/myUtils/mixins/listPage.js b/src/utils/myUtils/mixins/listPage.js index 9bc028d..b380ba1 100644 --- a/src/utils/myUtils/mixins/listPage.js +++ b/src/utils/myUtils/mixins/listPage.js @@ -45,6 +45,7 @@ computed: { total() { let index = this.tableData.total / this.limit + console.log(this.tableData.total, this.limit) return Math.ceil(index) } }, diff --git a/src/views/product/brandList.vue b/src/views/product/brandList.vue index 3157cbb..c5b9c07 100644 --- a/src/views/product/brandList.vue +++ b/src/views/product/brandList.vue @@ -60,11 +60,12 @@ type="danger" icon="el-icon-delete-solid" class="btnItem bgred" - @click=" BatchDelete" + @click="BatchDelete" > 删除 - + 导出 + + @@ -109,7 +113,15 @@ - + @@ -121,26 +133,27 @@ diff --git a/src/views/product/categoryList.vue b/src/views/product/categoryList.vue index d01ea1d..549229d 100644 --- a/src/views/product/categoryList.vue +++ b/src/views/product/categoryList.vue @@ -55,14 +55,16 @@ > 删除 - + + > 导出 - + + @@ -77,9 +79,10 @@ }" :row-style="{ 'text-align': 'center' }" style="width: 100%" + v-loading="loading" > - + @@ -172,7 +175,8 @@ // 搜索框中的数据的数据 categoryCode: '', categoryName: '' - } + }, + loading:false } }, mounted() { @@ -205,16 +209,26 @@ }, // 获取指定页面 getListPage(limit, offset) { + this.loading = true C_listPage(`limit=${limit}&offset=${offset}`, this.queryInfo).then(res => { if (res.code === 200) { // 得到相关数据 this.tableData = res.data.rows + this.loading = false } + }).catch(err => { + this.loading = false }) }, // 删除 Cdelete(row) { - const id = row.id + this.$confirm(`确认删除此品类吗?`, "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + const id = row.id C_delete({ id: id }).then((res) => { // 删除成功 跟新列表 if (res.code === 200) { @@ -225,11 +239,20 @@ this.refresh() } }) + }) + .catch(() => {}); }, // 批量删除 BatchDelete() { - // 得到选中行 - const dle_ary = this.$refs.multipleTable.selection + if(this.$refs.multipleTable.selection.length !== 0){ + this.$confirm(`确认删除选中的这些品类吗?`, "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + // 得到选中行 + const dle_ary = this.$refs.multipleTable.selection const ids = [] dle_ary.forEach((ele) => { ids.push(ele.id) @@ -243,6 +266,15 @@ this.refresh() } }) + }) + .catch(() => {}); + + }else{ + this.$message({ + message: "请先勾选需要删除的品类", + type: "error", + }); + } }, // 编辑 compile(row) { diff --git a/src/views/product/editBrand.vue b/src/views/product/editBrand.vue index 1ae0ac6..ac15f56 100644 --- a/src/views/product/editBrand.vue +++ b/src/views/product/editBrand.vue @@ -26,7 +26,7 @@ - + { if (valid) { add(this.brandForm).then(response => { - if (response === 200) { this.$confirm('新增成功,是否继续新增?', '提示', { confirmButtonText: '是', cancelButtonText: '否', @@ -207,7 +206,6 @@ this.$emit('refresh') this.dialogFormVisible = false }) - } }) } }) @@ -217,11 +215,9 @@ this.$refs['dataForm'].validate((valid) => { if (valid) { update(this.brandForm).then(response => { - if (response === 200) { this.$message.success('修改成功') this.$emit('refresh') this.dialogFormVisible = false - } }) } })