zx 1 年之前
父節點
當前提交
f7fca46e89

+ 28 - 19
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/product/list.vue

@@ -1022,27 +1022,36 @@ export default {
         updateCategory(row) {
             this.isganttshowCa = true
             this.title = "编辑"
-            this.category = row
+            
+            console.log(row);
+            this.category ={...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() {
             if (this.category.name == null) {

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/team/index.vue

@@ -2600,7 +2600,7 @@ export default {
     updateWorkType(row) {
       this.isganttshowWk = true
       this.title = "编辑工种"
-      this.workType = row
+      this.workType = {...row}
     },
     deleteWorkType(row) {
       this.http.post("/user-work-type/delete", { id: row.id },