Quellcode durchsuchen

Merge branch 'master' into dev1.1.6

lianbingjie vor 3 Jahren
Ursprung
Commit
6d4754815a
2 geänderte Dateien mit 55 neuen und 19 gelöschten Zeilen
  1. 14 10
      src/assets/js/selector.js
  2. 41 9
      src/components/collect-info/CollectInfo.vue

+ 14 - 10
src/assets/js/selector.js

@@ -480,16 +480,12 @@ export const industryJson = [
 
 // 职位
 export const jobJson = [
-  '总裁/总经理/总监',
-  '市场经理/主管',
-  '销售经理/主管',
-  '渠道经理/主管',
-  '投标经理/专员',
-  '采购经理/专员',
-  '数据分析师',
-  '招标师',
-  '项目经理',
-  '其他'
+  '总裁', 
+  '总经理',
+  '总监',
+  '经理',
+  '主管',
+  '职员'
 ]
 
 // 公司规模
@@ -500,4 +496,12 @@ export const companyScaleJson = [
   '500-999人',
   '1000-9999人',
   '100000人以上'
+]
+
+// 部门
+export const branchJson = [
+  '市场',
+  '产品',
+  '销售',
+  '渠道'
 ]

+ 41 - 9
src/components/collect-info/CollectInfo.vue

@@ -85,9 +85,17 @@
                       <el-option v-for="item in jobData" :key="item.value" :label="item.label" :value="item.value">
                       </el-option>
                     </el-select>
-                    <el-input v-if="showOtherJob" v-model.trim="form.otherJob" class="data-short-input item-input job-name-iput"
+                    <!-- <el-input v-if="showOtherJob" v-model.trim="form.otherJob" class="data-short-input item-input job-name-iput"
                       @focus="otherFocus" placeholder="请输入职位名称">
-                    </el-input>
+                    </el-input> -->
+                    <el-select
+                      style="margin-left:12px;"
+                      v-if="showBranch"
+                      popper-class="custom-select"
+                      v-model="form.branch" placeholder="请选择部门" class="data-short-input item-input job-input" clearable>
+                      <el-option v-for="item in branchData" :key="item.value" :label="item.label" :value="item.value">
+                      </el-option>
+                    </el-select>
                   </el-form-item>
                 </div>
                 <div class="long-control" v-if="moduleShow.scale">
@@ -134,7 +142,7 @@
   </div>
 </template>
 <script>
-import { industryJson, jobJson, companyScaleJson } from '@/assets/js/selector.js'
+import { industryJson, jobJson, companyScaleJson, branchJson } from '@/assets/js/selector.js'
 import { Form, FormItem, Button, CheckboxGroup, Checkbox, Select, Input, Option, Cascader } from 'element-ui'
 import { mapState } from 'vuex'
 import { debounce } from '@/utils/'
@@ -199,8 +207,8 @@ export default {
       if (value === '') {
         return callback(new Error('职位不能为空'))
       } else {
-        if (value === '其他' && this.form.otherJob === '') {
-          return callback(new Error('请输入职位'))
+        if ((value.indexOf('总裁') === -1 || value.indexOf('总经理') === -1) && this.showBranch && !this.form.branch) {
+          return callback(new Error('部门不能为空'))
         } else {
           callback()
         }
@@ -212,6 +220,7 @@ export default {
       industryData: [], // 行业数据
       jobData: [], // 职位数据
       scaleData: [], // 公司规模数据
+      branchData: [], // 部门数据
       moldData: [{ // 公司类型数据
         label: '公司',
         value: '公司'
@@ -236,7 +245,8 @@ export default {
         scale: '', // 公司规模
         business: '', // 业务范围
         need: '', // 合作需求
-        agreeChecked: true
+        agreeChecked: true,
+        branch: '' // 部门
       },
       rules: {
         name: [{
@@ -302,6 +312,15 @@ export default {
     },
     showCompany: function () {
       return this.form.mold === '公司'
+    },
+    showBranch: function () {
+      // 切换到总裁或总经理之后 把之前选择的部门清空
+      if (this.form.job.indexOf('总裁') > -1 || this.form.job.indexOf('总经理') > -1) {
+        this.form.branch = ''
+      }
+      var zc = this.form.job.indexOf('总裁') > -1
+      var zjl = this.form.job.indexOf('总经理') > -1
+      return !(zc || zjl) && this.form.job
     }
   },
   created () {
@@ -328,6 +347,12 @@ export default {
         label: item
       }
     })
+    this.branchData = branchJson.map((item) => {
+      return {
+        value: item,
+        label: item
+      }
+    })
   },
   mounted () {},
   methods: {
@@ -421,7 +446,8 @@ export default {
         position: this.form.job === '其他' ? ('其他/' + this.form.otherJob) : this.form.job,
         workScope: this.form.business,
         partnerNeeds: this.form.need,
-        agree: this.form.agreeChecked
+        agree: this.form.agreeChecked,
+        branch: this.form.branch.indexOf('总裁') > -1 || this.form.branch.indexOf('总经理') > -1 ?  '' : this.form.branch
       }
       var _this = this
       $.ajax({
@@ -465,8 +491,10 @@ export default {
             _this.form.companyType = res.data.companyType ? res.data.companyType.split(',') : []
             if (res.data.position) {
               if (jobJson.indexOf(res.data.position) === -1) {
-                _this.form.job = '其他'
-                _this.form.otherJob = res.data.position.replace('其他/', '')
+                // _this.form.job = '其他'
+                // _this.form.otherJob = res.data.position.replace('其他/', '')
+                _this.form.job = ''
+                _this.form.otherJob = ''
               } else {
                 _this.form.job = res.data.position
               }
@@ -477,6 +505,7 @@ export default {
             _this.form.business = res.data.workScope ? res.data.workScope : ''
             _this.form.need = res.data.partnerNeeds ? res.data.partnerNeeds : ''
             _this.form.agreeChecked = res.data.agree === undefined ? true : res.data.agree
+            _this.form.branch = res.data.branch
           }
         }
       })
@@ -690,6 +719,9 @@ export default {
   .el-popper[x-placement^=bottom] .popper__arrow {
     display: none;
   }
+  .el-select-dropdown__item.selected{
+    color: #2CB7CA!important;
+  }
 }
 .collect-info{
   .mask {