Browse Source

feat:留资弹框js语法

yangfeng 1 year ago
parent
commit
90f7f62309

+ 9 - 11
src/web/staticres/common-module/pc-dialog/js/pc-collect-user-info.js

@@ -302,18 +302,16 @@ var vm = new Vue({
       if (!value.length) {
         return callback(new Error('行业为必填项'));
       } else {
-        if (value.includes('其他')) {
-          console.log(value, '有值', rule);
-
+        if (value.indexOf('其他') !== -1) {
           if (vm.form.otherIndustry === '') {
             callback(new Error('请输入行业'))
-          } else if (vm.industryData.includes(vm.form.otherIndustry)) {
+          } else if (vm.industryData.indexOf(vm.form.otherIndustry) !== -1) {
             callback(new Error('行业输入重复'))
           } else {
             callback()
           }
         } else {
-          if (vm.industryData.includes(vm.form.otherIndustry)) {
+          if (vm.industryData.indexOf(vm.form.otherIndustry) !== -1) {
             callback(new Error('行业输入重复'))
           } else {
             callback()
@@ -565,7 +563,7 @@ var vm = new Vue({
     onOtherIndustryInput: function (event) {
       var val = event.replace(/\s*/g, '')
       if (val) {
-        if (this.form.industry.includes('其他')) {
+        if (this.form.industry.indexOf('其他') !== -1) {
           // console.log('有');
         } else {
           this.form.industry.push('其他')
@@ -841,7 +839,7 @@ var vm = new Vue({
         const filterIndustry = this.form.industry.filter(function(item) {
           return item !== '其他'
         })
-        if (this.form.industry.includes('其他')) {
+        if (this.form.industry.indexOf('其他') !== -1) {
           filterIndustry.push(this.form.otherIndustry)
         }
         params.industry = filterIndustry.toString()
@@ -1020,11 +1018,11 @@ var vm = new Vue({
         this.form.cooperate = data.cooperate ? data.cooperate : ''
         if (data.industry) {
           var industryArr = data.industry.split(',')
-          var same = [...new Set(industryArr)].filter(item => 
-            this.industryData.includes(item) 
+          var same = industryArr.filter(item => 
+            this.industryData.indexOf(item) !== -1
           )
-          var different = [...new Set(industryArr)].filter(item => 
-            !this.industryData.includes(item) 
+          var different = industryArr.filter(item => 
+            this.industryData.indexOf(item) === -1
           )
           if (same) {
             this.form.industry = same

File diff suppressed because it is too large
+ 0 - 0
src/web/staticres/common-module/pc-dialog/js/pc-collect-user-info.min.js


Some files were not shown because too many files changed in this diff