diff --git a/src/components/mycomponent/dialog/brandAddDialog.vue b/src/components/mycomponent/dialog/brandAddDialog.vue index 952978e..5449e3b 100644 --- a/src/components/mycomponent/dialog/brandAddDialog.vue +++ b/src/components/mycomponent/dialog/brandAddDialog.vue @@ -155,19 +155,15 @@ save() { if (this.title == '新增品牌') { add(this.addInfo).then(res => { - if (!res.code) { - this.close() - this.$emit('refresh') - Message.success('保存成功') - } + this.close() + this.$emit('refresh') + Message.success('保存成功') }) } else { update(this.addInfo).then(res => { - if (!res.code) { - this.close() - this.$emit('refresh') - Message.success('更新成功') - } + this.close() + this.$emit('refresh') + Message.success('更新成功') }) } }, diff --git a/src/components/mycomponent/dialog/brandAddDialog.vue b/src/components/mycomponent/dialog/brandAddDialog.vue index 952978e..5449e3b 100644 --- a/src/components/mycomponent/dialog/brandAddDialog.vue +++ b/src/components/mycomponent/dialog/brandAddDialog.vue @@ -155,19 +155,15 @@ save() { if (this.title == '新增品牌') { add(this.addInfo).then(res => { - if (!res.code) { - this.close() - this.$emit('refresh') - Message.success('保存成功') - } + this.close() + this.$emit('refresh') + Message.success('保存成功') }) } else { update(this.addInfo).then(res => { - if (!res.code) { - this.close() - this.$emit('refresh') - Message.success('更新成功') - } + this.close() + this.$emit('refresh') + Message.success('更新成功') }) } }, diff --git a/src/views/product/brandList.vue b/src/views/product/brandList.vue index 3157cbb..21762ec 100644 --- a/src/views/product/brandList.vue +++ b/src/views/product/brandList.vue @@ -110,7 +110,6 @@ - @@ -123,8 +122,6 @@ import GroupPage from '../../components/mycomponent/groupPage.vue' // element ui Dialog -import ElbrandDialog from '../../components/mycomponent/dialog/ElbrandDialog.vue' -import InfoDialog from '../../components/mycomponent/dialog/InfoDialog.vue' import DetailBrand from '@/views/product/detailBrand' import EditBrand from '@/views/product/editBrand' @@ -138,9 +135,7 @@ components: { DetailBrand, EditBrand, - GroupPage, - ElbrandDialog, - InfoDialog + GroupPage }, mixins: [listMixin, elDataDialog], data() { @@ -203,15 +198,14 @@ console.log(row) const id = row.id Branddelete({ id: id }).then(res => { + debugger console.log(res) // 删除成功跟新数据 - if (res != '') { - this.$message({ - message: '删除成功', - type: 'success' - }) - this.refresh() - } + this.$message({ + message: '删除成功', + type: 'success' + }) + this.refresh() }) }, @@ -224,13 +218,11 @@ ids.push(ele.id) }) batchDelete({ ids: ids }).then(res => { - if (res != '') { - this.$message({ - message: '删除成功', - type: 'success' - }) - this.refresh() - } + this.$message({ + message: '删除成功', + type: 'success' + }) + this.refresh() }) }, // diff --git a/src/components/mycomponent/dialog/brandAddDialog.vue b/src/components/mycomponent/dialog/brandAddDialog.vue index 952978e..5449e3b 100644 --- a/src/components/mycomponent/dialog/brandAddDialog.vue +++ b/src/components/mycomponent/dialog/brandAddDialog.vue @@ -155,19 +155,15 @@ save() { if (this.title == '新增品牌') { add(this.addInfo).then(res => { - if (!res.code) { - this.close() - this.$emit('refresh') - Message.success('保存成功') - } + this.close() + this.$emit('refresh') + Message.success('保存成功') }) } else { update(this.addInfo).then(res => { - if (!res.code) { - this.close() - this.$emit('refresh') - Message.success('更新成功') - } + this.close() + this.$emit('refresh') + Message.success('更新成功') }) } }, diff --git a/src/views/product/brandList.vue b/src/views/product/brandList.vue index 3157cbb..21762ec 100644 --- a/src/views/product/brandList.vue +++ b/src/views/product/brandList.vue @@ -110,7 +110,6 @@ - @@ -123,8 +122,6 @@ import GroupPage from '../../components/mycomponent/groupPage.vue' // element ui Dialog -import ElbrandDialog from '../../components/mycomponent/dialog/ElbrandDialog.vue' -import InfoDialog from '../../components/mycomponent/dialog/InfoDialog.vue' import DetailBrand from '@/views/product/detailBrand' import EditBrand from '@/views/product/editBrand' @@ -138,9 +135,7 @@ components: { DetailBrand, EditBrand, - GroupPage, - ElbrandDialog, - InfoDialog + GroupPage }, mixins: [listMixin, elDataDialog], data() { @@ -203,15 +198,14 @@ console.log(row) const id = row.id Branddelete({ id: id }).then(res => { + debugger console.log(res) // 删除成功跟新数据 - if (res != '') { - this.$message({ - message: '删除成功', - type: 'success' - }) - this.refresh() - } + this.$message({ + message: '删除成功', + type: 'success' + }) + this.refresh() }) }, @@ -224,13 +218,11 @@ ids.push(ele.id) }) batchDelete({ ids: ids }).then(res => { - if (res != '') { - this.$message({ - message: '删除成功', - type: 'success' - }) - this.refresh() - } + this.$message({ + message: '删除成功', + type: 'success' + }) + this.refresh() }) }, // diff --git a/src/views/product/editBrand.vue b/src/views/product/editBrand.vue index 1ae0ac6..af06e33 100644 --- a/src/views/product/editBrand.vue +++ b/src/views/product/editBrand.vue @@ -193,21 +193,12 @@ this.$refs['dataForm'].validate((valid) => { if (valid) { add(this.brandForm).then(response => { - if (response === 200) { - this.$confirm('新增成功,是否继续新增?', '提示', { - confirmButtonText: '是', - cancelButtonText: '否', - type: 'info' - }).then(() => { - this.resetForm() - this.$nextTick(() => { - this.$refs['dataForm'].clearValidate() - }) - }).catch(() => { - this.$emit('refresh') - this.dialogFormVisible = false - }) - } + this.resetForm() + this.$emit('refresh') + this.dialogFormVisible = false + this.$nextTick(() => { + this.$refs['dataForm'].clearValidate() + }) }) } }) @@ -217,11 +208,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 - } + this.$message.success('修改成功') + this.$emit('refresh') + this.dialogFormVisible = false }) } })