|
@@ -1022,27 +1022,36 @@ export default {
|
|
updateCategory(row) {
|
|
updateCategory(row) {
|
|
this.isganttshowCa = true
|
|
this.isganttshowCa = true
|
|
this.title = "编辑"
|
|
this.title = "编辑"
|
|
- this.category = row
|
|
|
|
|
|
+
|
|
|
|
+ console.log(row);
|
|
|
|
+ this.category ={...row}
|
|
},
|
|
},
|
|
deleteCategory(row) {
|
|
deleteCategory(row) {
|
|
- this.http.post("/prod-category/delete", { id: row.id },
|
|
|
|
- res => {
|
|
|
|
- console.log("=======", res.code)
|
|
|
|
- if (res.code === 'ok') {
|
|
|
|
- this.getCategoryList()
|
|
|
|
- this.$message({
|
|
|
|
- showClose: true,
|
|
|
|
- message: '删除成功',
|
|
|
|
- type: 'success'
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- this.$message({
|
|
|
|
- showClose: true,
|
|
|
|
- message: '已有产品为此分类,无法删除',
|
|
|
|
- type: 'warning'
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ this.$confirm("确定要删除产品分类[" + row.name + "]" + this.$t('ma'), '删除产品分类', {
|
|
|
|
+ confirmButtonText: this.$t('btn.determine'),
|
|
|
|
+ cancelButtonText: this.$t('btn.cancel'),
|
|
|
|
+ type: "warning"
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.http.post("/prod-category/delete", { id: row.id },
|
|
|
|
+ res => {
|
|
|
|
+ console.log("=======", res.code)
|
|
|
|
+ if (res.code === 'ok') {
|
|
|
|
+ this.getCategoryList()
|
|
|
|
+ this.$message({
|
|
|
|
+ showClose: true,
|
|
|
|
+ message: '删除成功',
|
|
|
|
+ type: 'success'
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ showClose: true,
|
|
|
|
+ message: res.msg,
|
|
|
|
+ type: 'warning'
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+
|
|
},
|
|
},
|
|
saveCategory() {
|
|
saveCategory() {
|
|
if (this.category.name == null) {
|
|
if (this.category.name == null) {
|