Ver Fonte

修改了判断

bding há 3 semanas atrás
pai
commit
0b5d3daa01
1 ficheiros alterados com 6 adições e 9 exclusões
  1. 6 9
      src/views/rai_manage/components/addChoiceness.vue

+ 6 - 9
src/views/rai_manage/components/addChoiceness.vue

@@ -384,9 +384,7 @@ export default {
           this.industryList.forEach((item) => {
             if (item.ChartPermissionId == this.chartPermissionId) {
               if (item.List.length > 0) {
-                console.log(item, "------");
-
-                var isNext = res.Data.ThirdName ? item.List.some((item) => item.ThirdName == res.Data.ThirdName) : item.List.some((item) => item.IndustrialSubjectName == arr.SubjectName);
+                var isNext = item.List.some((item) => item.ShowName == (arr ? arr.ShowName : res.Data.ThirdName));
               }
               if (isNext) return this.$message.error("标的重复!");
               item.List.push({
@@ -396,7 +394,7 @@ export default {
                 IndustrialManagementName: arr ? arr.IndustryName : "",
                 IndustrialSubjectId: arr ? arr.IndustrialSubjectId + "" : "",
                 IndustrialSubjectName: arr ? arr.SubjectName : "",
-                ShowName: arr ? arr.ShowName : res.Data.ThirdName,
+                ShowName: arr ? arr.ShowName || arr.IndustryName : res.Data.ThirdName,
                 ThirdId: res.Data.ThirdId || "",
                 ThirdName: res.Data.ThirdName || "",
                 CompanyLabel: [{ name: "", value: item.List.length + 1 }],
@@ -429,8 +427,7 @@ export default {
           this.industryList.forEach((item) => {
             if (item.ChartPermissionId == this.chartPermissionId) {
               if (item.List.length > 0) {
-                console.log(arr, "------");
-                var isNext = item.List.some((item) => item.IndustrialSubjectName == (arr ? arr.SubjectName : res.Data.ThirdName));
+                var isNext = item.List.some((item) => item.ShowName == (arr ? arr.ShowName : res.Data.ThirdName));
               }
               if (isNext) return this.$message.error("标的重复!");
               const obj = {
@@ -440,7 +437,7 @@ export default {
                 IndustrialManagementName: arr ? arr.IndustryName : "",
                 IndustrialSubjectId: arr ? arr.IndustrialSubjectId + "" : "",
                 IndustrialSubjectName: arr ? arr.SubjectName : "",
-                ShowName: arr ? arr.ShowName : "",
+                ShowName: arr ? arr.ShowName || arr.IndustryName : res.Data.ThirdName,
                 ThirdId: res.Data.ThirdId || "",
                 ThirdName: res.Data.ThirdName || "",
                 CompanyLabel:
@@ -450,7 +447,7 @@ export default {
                 IsShowOverviewArticle: overviewList.IsShowOverviewArticle || 0,
               };
               item.List.splice(this.editNum, 1, obj);
-              this.industrialSubjectName = arr.IndustryName || "";
+              this.industrialSubjectName = arr ? arr.IndustryName : res.Data.ThirdName || "";
             }
           });
         }
@@ -499,7 +496,7 @@ export default {
               clearInterval(this.timeInterval);
               sessionStorage.removeItem("addChoicenessQY");
               this.$message.success("操作成功!");
-              this.init();
+              type != "保存" && this.init();
               this.$router.back();
             }
           }