xiaodai2022 2 years ago
parent
commit
486610702d
1 changed files with 8 additions and 10 deletions
  1. 8 10
      src/views/goodStore/sort/addEdit.vue

+ 8 - 10
src/views/goodStore/sort/addEdit.vue

@@ -118,9 +118,7 @@ export default {
       },
       rulesThis: this.rules,
       rules: {
-        cat_name: [
-          { required: true, message: "分类名称不能为空", trigger: "blur" },
-        ],
+        cat_name: [{ required: true, message: "分类名称不能为空", trigger: "blur" }],
         specs_id: [
           {
             type: "array",
@@ -129,9 +127,7 @@ export default {
             trigger: "change",
           },
         ],
-        fund_code: [
-          { required: false, validator: validate_fund_code, trigger: "blur" },
-        ],
+        fund_code: [{ required: false, validator: validate_fund_code, trigger: "blur" }],
 
         cat_desc: [{ required: false, message: "", trigger: "blur" }],
       },
@@ -184,7 +180,7 @@ export default {
           this.$refs.ruleForm.clearValidate();
           const { id, cat_name, cat_desc } = this.sitem;
           this.ruleForm = {
-            pid: this.titleList[this.titleList.length - 1].id || "",
+            pid: this.titleList[this.titleList.length - 1].id || "0",
             id: id || "",
             cat_name: cat_name || "",
             specs_id: [],
@@ -216,15 +212,17 @@ export default {
             specs_id.push(e.id);
           });
         }
-        console.log(specs_id);
+        console.log(pid);
+        console.log(pid ?? "0");
         this.ruleForm = {
-          pid: pid || "",
+          pid: (pid ?? "0") || "0",
           id: id || "",
           cat_name: cat_name || "",
           specs_id: specs_id || [],
           fund_code: fund_code || "",
           cat_desc: cat_desc || "",
         };
+        console.log(this.ruleForm);
         this.$refs.ruleForm.resetFields();
         this.$refs.ruleForm.clearValidate();
       } else if (res && res.code >= 100 && res.code <= 104) {
@@ -272,7 +270,7 @@ export default {
 };
 </script>
 
-   <style lang="scss" scoped>
+<style lang="scss" scoped>
 .sort {
 }
 </style>