Просмотр исходного кода

Merge branch 'dev1.2' of http://192.168.3.207:10080/group3/qmx_page_admin into dev1.2

xgwangman 4 лет назад
Родитель
Сommit
0c74585ea6

+ 1 - 1
src/api/request.js

@@ -22,7 +22,7 @@ axios.interceptors.request.use(config => {
 //响应拦截
 axios.interceptors.response.use(response => {
     if (response.data.error_code == 1001) {
-        window.location.href = "/notin/page" //跳登录页
+        // window.location.href = "/notin/page" //跳登录页
     }
     return response.data
 }, error => {

+ 38 - 2
src/assets/js/china_area.js

@@ -2,6 +2,7 @@ const chinaMapJSON = [{
     ProID: 1,
     name: '北京市',
     ProSort: 1,
+    Initials:'B',
     ProRemark: '直辖市',
     city: [{
       CityID: 1,
@@ -13,6 +14,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 2,
     name: '天津市',
+    Initials:'T',
     ProSort: 2,
     ProRemark: '直辖市',
     city: [{
@@ -25,6 +27,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 3,
     name: '河北省',
+    Initials:'H',
     ProSort: 5,
     ProRemark: '省份',
     city: [{
@@ -97,6 +100,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 4,
     name: '山西省',
+    Initials:'S',
     ProSort: 6,
     ProRemark: '省份',
     city: [{
@@ -169,6 +173,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 5,
     name: '内蒙古自治区',
+    Initials:'N',
     ProSort: 32,
     ProRemark: '自治区',
     city: [{
@@ -247,6 +252,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 6,
     name: '辽宁省',
+    Initials:'L',
     ProSort: 8,
     ProRemark: '省份',
     city: [{
@@ -337,6 +343,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 7,
     name: '吉林省',
+    Initials:'J',
     ProSort: 9,
     ProRemark: '省份',
     city: [{
@@ -397,6 +404,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 8,
     name: '黑龙江省',
+    Initials:'H',
     ProSort: 10,
     ProRemark: '省份',
     city: [{
@@ -481,6 +489,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 9,
     name: '上海市',
+    Initials:'S',
     ProSort: 3,
     ProRemark: '直辖市',
     city: [{
@@ -493,6 +502,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 10,
     name: '江苏省',
+    Initials:'J',
     ProSort: 11,
     ProRemark: '省份',
     city: [{
@@ -577,6 +587,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 11,
     name: '浙江省',
+    Initials:'Z',
     ProSort: 12,
     ProRemark: '省份',
     city: [{
@@ -649,6 +660,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 12,
     name: '安徽省',
+    Initials:'A',
     ProSort: 13,
     ProRemark: '省份',
     city: [{
@@ -757,6 +769,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 13,
     name: '福建省',
+    Initials:'F',
     ProSort: 14,
     ProRemark: '省份',
     city: [{
@@ -817,6 +830,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 14,
     name: '江西省',
+    Initials:'J',
     ProSort: 15,
     ProRemark: '省份',
     city: [{
@@ -889,6 +903,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 15,
     name: '山东省',
+    Initials:'S',
     ProSort: 16,
     ProRemark: '省份',
     city: [{
@@ -997,6 +1012,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 16,
     name: '河南省',
+    Initials:'H',
     ProSort: 17,
     ProRemark: '省份',
     city: [{
@@ -1112,6 +1128,7 @@ const chinaMapJSON = [{
     ProID: 17,
     name: '湖北省',
     ProSort: 18,
+    Initials:'H',
     ProRemark: '省份',
     city: [{
       CityID: 159,
@@ -1219,6 +1236,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 18,
     name: '湖南省',
+    Initials:'H',
     ProSort: 19,
     ProRemark: '省份',
     city: [{
@@ -1309,6 +1327,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 19,
     name: '广东省',
+    Initials:'G',
     ProSort: 20,
     ProRemark: '省份',
     city: [{
@@ -1441,6 +1460,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 20,
     name: '海南省',
+    Initials:'H',
     ProSort: 24,
     ProRemark: '省份',
     city: [{
@@ -1561,6 +1581,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 21,
     name: '广西壮族自治区',
+    Initials:'G',
     ProSort: 28,
     ProRemark: '自治区',
     city: [{
@@ -1651,6 +1672,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 22,
     name: '甘肃省',
+    Initials:'G',
     ProSort: 21,
     ProRemark: '省份',
     city: [{
@@ -1741,6 +1763,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 23,
     name: '陕西省',
+    Initials:'S',
     ProSort: 27,
     ProRemark: '省份',
     city: [{
@@ -1807,6 +1830,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 24,
     name: '新疆维吾尔自治区',
+    Initials:'X',
     ProSort: 31,
     ProRemark: '自治区',
     city: [{
@@ -1921,6 +1945,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 25,
     name: '青海省',
+    Initials:'Q',
     ProSort: 26,
     ProRemark: '省份',
     city: [{
@@ -1975,6 +2000,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 26,
     name: '宁夏回族自治区',
+    Initials:'N',
     ProSort: 30,
     ProRemark: '自治区',
     city: [{
@@ -2011,6 +2037,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 27,
     name: '重庆市',
+    Initials:'C',
     ProSort: 4,
     ProRemark: '直辖市',
     city: [{
@@ -2023,6 +2050,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 28,
     name: '四川省',
+    Initials:'S',
     ProSort: 22,
     ProRemark: '省份',
     city: [{
@@ -2155,6 +2183,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 29,
     name: '贵州省',
+    Initials:'G',
     ProSort: 23,
     ProRemark: '省份',
     city: [{
@@ -2215,6 +2244,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 30,
     name: '云南省',
+    Initials:'Y',
     ProSort: 25,
     ProRemark: '省份',
     city: [{
@@ -2317,6 +2347,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 31,
     name: '西藏自治区',
+    Initials:'X',
     ProSort: 29,
     ProRemark: '自治区',
     city: [{
@@ -2365,6 +2396,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 32,
     name: '台湾省',
+    Initials:'T',
     ProSort: 7,
     ProRemark: '省份',
     city: [{
@@ -2377,6 +2409,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 33,
     name: '澳门特别行政区',
+    Initials:'A',
     ProSort: 33,
     ProRemark: '特别行政区',
     city: [{
@@ -2389,6 +2422,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 34,
     name: '香港特别行政区',
+    Initials:'X',
     ProSort: 34,
     ProRemark: '特别行政区',
     city: [{
@@ -2401,6 +2435,7 @@ const chinaMapJSON = [{
   }, {
     ProID: 35,
     name: '钓鱼岛',
+    Initials:'D',
     ProSort: 35,
     ProRemark: '特别行政区',
     city: [{
@@ -2413,13 +2448,14 @@ const chinaMapJSON = [{
   }, {
     ProID: 36,
     name: ' 海外',
+    Initials:'H',
     ProSort: 35,
     ProRemark: '特别行政区',
     city: [{
-      CityID: 372,
+      CityID: 373,
       name: '海外',
       ProID: 35,
-      CitySort: 372,
+      CitySort: 373,
       area: ['美国', '加拿大', '澳大利亚', '新西兰', '英国', '法国', '德国', '捷克', '荷兰', '瑞士', '希腊', '挪威', '瑞典', '丹麦', '芬兰', '爱尔兰', '奥地利', '意大利', '乌克兰', '俄罗斯', '西班牙', '韩国', '新加坡', '马来西亚', '印度', '泰国', '日本', '巴西', '阿根廷', '南非', '埃及', '其他']
     }]
   }]

+ 276 - 1
src/components/areaSelect.vue

@@ -1,13 +1,170 @@
 <template>
    <div class="areaSelect">
       <div class="lists">
+        <h2>选择区域</h2>
+        <div class="content">
+          <div class="search">
+            <el-input v-model="input" placeholder="搜索"></el-input>
+          </div>
           <ul>
-              <li>河南</li>
+            <li><span @click="selectCountry" :class="{active:isCountry}">全国</span></li>
+              <li v-for="(item,x) in filterArea" :key="item.id">
+               <h4> {{item[0].title}}</h4>
+                <div class="proviceList">
+                   <div class="proviceItem" :class="{toggle:v.isToggle}" v-for="(v,y) in item[0].list" :key="v.id">
+                       <h5><span @click="selectALL(v,x,y)" :class="v.checked"></span> <p @click="toggle(v,x,y)"><strong>{{v.name}}</strong> <i v-if="v.data.length>1" class="el-icon-arrow-down"></i></p></h5>
+                       <div class="cityList" v-if="v.data.length >1"  >
+                          <span v-for="(city,i) in v.data" :key="i" :class="{active:city.status}" @click="selectCity(v,x,y,i)">
+                            {{city.name}}
+                          </span>
+                       </div>
+                   </div>
+                </div>
+              </li>
           </ul>
+        </div>
       </div>
    </div>
 </template>
 
+<script>
+import chinaMapJSON from "@/assets/js/china_area.js";
+export default {
+    data(){
+      return{
+          initals:[ 'A','B','C','F','G','H','J','L','N','Q','S','T','X','Y','Z'],
+          newArea:null,
+          input:'',
+          citys:{
+            "安徽省":["合肥市","芜湖市"],
+            "北京市":[],
+          },
+          isCountry:false,
+      }
+    },
+    mounted(){
+      this.getProvince();
+      
+    },
+    computed:{
+        filterArea:function(){
+          let city_arr = JSON.parse(JSON.stringify(this.newArea));
+          if(this.newArea){
+                city_arr.forEach(item =>{
+                    item[0].list.forEach(val =>{
+                      let selectAll = []; //省份下选中的城市
+                      Object.keys(this.citys).forEach(v =>{
+                        if(v === val.name ){//省份名称一样,并且vales值为空
+                           if(this.citys[v].length === 0){
+                             val.isSelectAll = true;
+                             val.data.forEach(city =>{
+                              //遍历该城市改变状态选中
+                               city.status = true;
+                               selectAll.push('1');
+                             })
+                           }else{
+                             val.isSelectAll = false;  
+                              //遍历该城市改变状态选中
+                              val.data.forEach(city =>{
+                                 this.citys[v].forEach(s_city =>{
+                                    if(s_city == city.name){
+                                      city.status = true;
+                                      selectAll.push('1');
+                                    }
+                                 })
+                            })
+                           }
+                        }
+                      })
+                      //判断省会下的城市全部选中、部分选中、没有选中
+                      if(val.data.length === selectAll.length){
+                          val.checked = "selectAll" //全选
+                      }else if(selectAll.length === 0){
+                          val.checked = ""; //没有选中
+                      }else{
+                          val.checked = "selectHalf";//部分选中
+                      }
+                    })
+                })
+          }
+          console.log(city_arr,"sss")
+          return city_arr;
+        }
+    },
+    methods:{
+      //获取省、市
+      getProvince(){
+          let newArea = [];
+          chinaMapJSON.forEach((v,i) =>{
+            this.initals.forEach((inital,x) =>{
+                if(v.Initials === inital){
+                    if(!Array.isArray(newArea[x])){
+                        newArea[x] = [{title:inital,id:x,list:[]}];
+                    }
+                    newArea[x][0].list.push({name:v.name,id:v.ProID,data:v.city,isToggle:false,isSelectAll:false})
+                }
+            })
+          })
+          this.newArea = newArea;
+      },
+      //省市开关
+      toggle(val,x,y){
+        val.isToggle = !val.isToggle;
+        this.newArea[x][0].list.splice(y,1,val);
+      },
+      //选择市
+      selectCity(val,x,y,i){
+           this.isCountry = false;
+           val.data[i].status = !val.data[i].status;
+           this.newArea[x][0].list.splice(y,1,val);
+           this.citys[val.name] = []
+           val.data.forEach(v =>{
+             if(v.status){
+               this.citys[val.name].push(v.name)
+             }
+           })
+           let selectLength = this.citys[val.name].length;
+           if(selectLength === 0){
+                delete this.citys[val.name]
+           }else if( selectLength === val.data.length ){
+              this.citys[val.name] = [];
+           }
+           console.log( this.citys,"选择城市")
+      },
+      //全选
+      selectALL(val,x,y){
+          this.isCountry = false;
+          val.data.forEach(v =>{
+            if(val.isSelectAll){
+               v.status = false;
+                delete this.citys[val.name]
+            }else{
+              this.citys[val.name] = []
+            }
+          })
+          val.isSelectAll = !val.isSelectAll;
+          this.newArea[x][0].list.splice(y,1,val);
+          console.log( this.citys,"选择城市")
+      },
+      //全国
+      selectCountry(){
+         this.isCountry = !this.isCountry;
+         this.citys = {};
+        //  console.log(this.newArea)
+        this.newArea.forEach(item =>{
+          item[0].list.forEach(val =>{
+                val.isSelectAll = false;
+                val.data.forEach(city=>{
+                  city.status = false;
+                })
+          })
+        })
+      }
+
+    }
+}
+</script>
+
 
 <style lang="scss">
 .areaSelect{
@@ -18,6 +175,9 @@
   width: 100%;
   height: 100%;
   background: rgba(0,0,0,.2);
+  display: flex;
+  align-items: center;
+  justify-content: center;
   .lists{
     position: relative;
     width: 460px;
@@ -25,10 +185,125 @@
     background: #FFFFFF;
     box-shadow: 0px 0px 28px rgba(0, 0, 0, 0.16);
     border-radius: 5px;
+    padding: 30px;
+    
+  }
+  .content{
+    height: 100%;
+    border: 1px solid $border_color;
+    border-radius: 5px;
+    display: flex;
+    flex-direction: column;
+    overflow: hidden;
+    .search{
+      width: 360px;
+      height: 40px;
+      margin: 20px auto;
+    }
   }
   ul{
+    flex: 1;
+    overflow: auto;
     li{
       float: none;
+      display: block;
+      text-align: left;
+      h4{
+        text-align: left;
+        padding: 0px 20px ;
+        line-height: 30px;
+        background: #F5F5FB;
+        margin-top: 10px;
+      }
+      >span{
+        display: block;
+        width: 48px;
+        height: 24px;
+        border: 1px solid $border_color;
+        font-weight: bold;
+        margin-left: 20px;
+        text-align: center;
+        line-height: 24px;
+        border-radius: 4px;
+        cursor: pointer;
+        &.active{
+          color: $light_color;
+          border: 1px solid $light_color;
+        }
+      }
+      .proviceList{
+        .proviceItem{
+            h5{
+              line-height: 40px;
+              display: flex;
+              align-items: center;
+              justify-content: space-between;
+              border-bottom: 1px solid $border_color;
+              padding: 0 20px;
+              span{
+                width: 18px;
+                height: 18px;
+                border-radius: 50%;
+                margin-right: 10px;
+                border: 1px solid #e0e0e0;
+                cursor: pointer;
+                 &.selectAll{
+                     border:none;
+                     background: url(../assets/images/checked.png) no-repeat center center;
+                     background-size: 20px;
+                  }
+                  &.selectHalf{
+                    border:none;
+                     background: url(../assets/images/half.png) no-repeat center center;
+                     background-size: 20px;
+                  }
+              }
+              p{
+                flex: 1;
+                display: flex;
+                align-items: center;
+                cursor: pointer;
+                strong{
+                  margin-right: auto;
+                }
+                i{
+                  transition: all 0.2s;
+                }
+              }
+            }
+            .cityList{
+              padding: 8px 14px 0;
+              display: flex;
+              flex-wrap: wrap;
+              display: none;
+              span{
+                margin: 10px 5px;
+                padding: 0 4px;
+                height: 20px;
+                line-height: 20px;
+                border-radius: 4px;
+                font-size: 14px;
+                cursor: pointer;
+                border: 1px solid #fff;
+                &.active{
+                  border: 1px solid $light_color;
+                  color: $light_color;
+                }
+              }
+              
+            }
+            &.toggle{
+              .cityList{
+                display: flex;
+              }
+                h5{
+                  i{
+                    transform: rotateZ(180deg);
+                  }
+                }
+            }
+        }
+      }
     }
   }
 }

+ 12 - 7
src/views/ent/components/author.vue

@@ -157,13 +157,18 @@
         methods:{
             //设置数据导出没人限额
             setLimit(val){
-                console.log(val)
-                setLimit_recordpersonListInter({limitNum:Number(val.data_limit),userId:val.user_id,limitId:val.limit_id}).then(res =>{
-                    if(res.data.status == 1){
-                        this.$message({ message: '设置成功',type: 'success'});
-                        this.record_getDataList();
-                    }
-                })
+                if(val.data_limit && val.data_limit>0){
+                    setLimit_recordpersonListInter({limitNum:Number(val.data_limit),userId:val.user_id,limitId:val.limit_id}).then(res =>{
+                        if(res.data.status == 1){
+                            this.$message({ message: '设置成功',type: 'success'});
+                            this.record_getDataList();
+                        }
+                    })
+                }else{
+                    this.record_getDataList();
+                    this.$message({ message: '请输入大于0的有效数字',type: 'warning'});
+                }
+                
             },
             //商机管理人员使用列表
             sj_getDataList(){

+ 16 - 5
src/views/ent/components/powerPerson.vue

@@ -16,7 +16,7 @@
                   </div>
                   <div class="allList">
                     <div v-for="(item,i) in deal_personList" :key="item.id">
-                      <h5><i class="seleced" @click="selectGroup(item,i)" :class="item.status"></i> <span class="noselect"  @click="toggle(item,i)">{{ item.name }}</span> <i class="el-icon-arrow-down"></i></h5>
+                      <h5><i class="seleced" @click="selectGroup(item,i)" :class="item.status"></i> <span class="noselect"  @click="toggle(item,i)">{{ item.name }}</span> <i @click="toggle(item,i)" class="el-icon-arrow-down"></i></h5>
                       <div class="itemList" :class="{toggle:!item.toggle}" >
                          <div v-for="val in item.users" :key="val.user_id" @click="chooseUser(val,'single')" :class="{active:val.checked}">
                             <span class="userName">{{ val.username }}</span> <span> {{ val.phone }}</span> 
@@ -34,7 +34,7 @@
                   </ul>
               </div>
           </div>
-          <p v-if="currentIndex == 0">已选择{{ personList.checked }}人共购买{{ personList.quota }}人</p>
+          <p v-if="currentIndex == 0">已选择{{ maxLength }}人共购买{{ personList.quota }}人</p>
           <span slot="footer" class="dialog-footer btns">
               <button @click="saveDepart" class="save">保存</button>
               <button  @click="centerDialogVisible = false" class="cancle">取消</button>
@@ -55,12 +55,13 @@ export default {
        selectedList:[],
        checked:false,
        titleMsg:'',
-       currentIndex:'0'
+       currentIndex:'0',
+       maxLength:''
      }
    },
    created(){
       this.$watch('searchVal', this.debounce((newValue, oldValue) => {
-            this.getData()
+            this.getData('yes')
       }, 500))
    },
    computed:{
@@ -104,7 +105,7 @@ export default {
         }
       },
      //获取人员列表
-     getData(){
+     getData(flag='no'){
        if(this.$parent.currentIndex == 0){
           user_sjPersonListInter({name:this.searchVal}).then(res =>{
             res.data.list.forEach(v =>{
@@ -112,6 +113,10 @@ export default {
               v.status = false;
             })
             this.personList = res.data;
+            if(flag == 'yes'){
+               return;
+            }
+            this.maxLength = res.data.checked;
             this.selectedList = res.data.checkedList;
           })
           return;
@@ -122,6 +127,9 @@ export default {
             v.status = false;
           })
           this.personList = res.data;
+          if(flag == 'yes'){
+               return;
+          }
           this.selectedList = res.data.checkedList;
        })
      },
@@ -298,6 +306,9 @@ export default {
                     margin-left: 10px;
                     cursor: pointer;
                   }
+                  i{
+                    cursor: pointer;
+                  }
                   .seleced{
                     width: 20px;
                     height: 20px;