Mr.ding 4 роки тому
батько
коміт
18813c4564

+ 15 - 14
src/api/api.js

@@ -1,4 +1,5 @@
 import fetch from "./request"
+// console.log(fetch,"----fetch")
 
 // 招标信息列表
 export const subscribeList = data => fetch.get('/entdataexport/subscribeList', data);
@@ -58,22 +59,22 @@ export const entinfo = data => fetch.get('/entbase/ent/entinfo', data);
 export const componyMsg = data => fetch.get("/entbase/ent/mySelectent",data);
 
 //企业列表
-export const componyList = data => fetch.get("/entbase/person/pcManager",data);
+export const componyList = data => fetch.post("/entbase/person/pcManager",data,true);
 
 //添加部门
-export const addDepartInter = data => fetch.get("/entbase/department/add",data);
+export const addDepartInter = data => fetch.post("/entbase/department/add",data,true);
 
 //删除部门
-export const delDepartInter = data => fetch.get("/entbase/department/delete",data);
+export const delDepartInter = data => fetch.post("/entbase/department/delete",data,true);
 
 //获取部门信息
-export const departDetail = data => fetch.get("/entbase/department/detail",data);
+export const departDetail = data => fetch.post("/entbase/department/detail",data,true);
 
 //更新部门信息
-export const departUpdata = data => fetch.get("/entbase/department/update",data);
+export const departUpdata = data => fetch.post("/entbase/department/update",data,true);
 
 //查询部门下的子部门
-export const findDepart = data => fetch.get("/entbase/department/childrens",data);
+export const findDepart = data => fetch.post("/entbase/department/childrens",data,true);
 
 //部门管理员列表
 export const userList = data => fetch.get("/entbase/department/pcPersons",data);
@@ -85,16 +86,16 @@ export const personInter = data => fetch.get("/entbase/power/pcPersons",data);
 export const departsAll = data => fetch.get("/entbase/power/pcSearchDepartment",data);
 
 //新增人员
-export const personAddInter = data => fetch.get("/entbase/person/add",data);
+export const personAddInter = data => fetch.post("/entbase/person/add",data,true);
 
 //人员信息修改
-export const personUpdateInter = data => fetch.get("/entbase/person/update",data);
+export const personUpdateInter = data => fetch.post("/entbase/person/update",data,true);
 
 //人员详细信息
-export const personDetailInter = data => fetch.get("/entbase/person/detail",data);
+export const personDetailInter = data => fetch.post("/entbase/person/detail",data,true);
 
 //人员删除
-export const personDelInter = data => fetch.get("/entbase/person/delete",data);
+export const personDelInter = data => fetch.post("/entbase/person/delete",data,true);
 
 //商机管理人员
 export const sjPersonListInter = data => fetch.get("/entniche/entExportAuth/entPersonList",data);
@@ -103,7 +104,7 @@ export const sjPersonListInter = data => fetch.get("/entniche/entExportAuth/entP
 export const user_sjPersonListInter = data => fetch.get("/entniche/entExportAuth/entPersons",data);
 
 //商机管理添加人员
-export const add_sjPersonInter = data => fetch.get("/entbase/power/set",data);
+export const add_sjPersonInter = data => fetch.post("/entbase/power/set",data,true);
 
 //商机管理列表删除                                         
 export const del_sjPersonListInter = data => fetch.get("/entniche/entExportAuth/entDeletePerson",data);
@@ -115,13 +116,13 @@ export const recordPersonListInter = data => fetch.get("/entniche/entExportAuth/
 export const user_recordpersonListInter = data => fetch.get("/entniche/entExportAuth/persons",data);
 
 //数据导出设置限额
-export const setLimit_recordpersonListInter = data => fetch.get("/entniche/entExportAuth/setLimit",data);
+export const setLimit_recordpersonListInter = data => fetch.post("/entniche/entExportAuth/setLimit",data,true);
 
 //数据导出人员使用列表删除
-export const del_recordpersonListInter = data => fetch.get("/entniche/entExportAuth/deletePerson",data);
+export const del_recordpersonListInter = data => fetch.post("/entniche/entExportAuth/deletePerson",data,true);
 
 //数据导出人员添加
-export const add_recordpersonListInter = data => fetch.get("/entniche/entExportAuth/set",data);
+export const add_recordpersonListInter = data => fetch.post("/entniche/entExportAuth/set",data,true);
 
 //是否有菜单权限
 export const hasPower = data => fetch.get("/entniche/entExportAuth/getAuth",data);

+ 13 - 3
src/api/request.js

@@ -1,8 +1,10 @@
 import axios from 'axios'
 
+
 //设置默认请求头
 axios.defaults.headers = {
-    'Content-Type': 'application/json',
+    // 'Content-Type': 'multipart/form-data',
+    // 'Content-Type':'application/x-www-form-urlencoded'
 }
 axios.defaults.timeout = 10000
 
@@ -44,12 +46,20 @@ export default {
     },
 
     //post请求
-    post(url, data) {
+    post(url, data,flag=false) {
+        let newData = new FormData();
+        if(flag){
+            for(let key in data){
+                newData.append(key,data[key])
+            }
+        }else{
+            newData = data;
+        }
         return new Promise((resolve) => {
             axios({
                 method: 'post',
                 url,
-                data:data
+                data:newData
             }).then(res => {
                 resolve(res)
             })

+ 240 - 0
src/components/citySelect.vue

@@ -0,0 +1,240 @@
+<template>
+  <div class="citySelect" ref="citySelect">
+     <header>
+        <ul>
+          <li v-for="item in selectCitys" :key="item.id"><span>{{item.name | shortName}}</span> <i class="el-icon-close"></i></li>
+        </ul>
+     </header>
+      <div class="citySelectList">
+         
+         <ul>
+           <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 @click="toggle(v,x,y)">{{v.name | shortName}}</h5>
+                </div>
+              </div>
+            </li>
+         </ul>
+         <div class="cityList" :class="curentCitys.class " >
+              <div class="contentlist">
+                <span>全省</span>
+                <span v-for="(city,i) in curentCitys.list" :key="i" :class="{active:city.status}" @click="selectCity(city,i)">
+                  {{city.name}}
+                </span>
+              </div>
+              <div class="btns">
+                <button>确定</button>
+                <button @click="cancel">取消</button>
+              </div>
+          </div>
+      </div>
+  </div>
+</template>
+
+<script>
+import chinaMapJSON from "@/assets/js/china_area.js";
+export default {
+    data(){
+      return{
+          isCountry:false,
+          newArea:{},
+          initals:[ 'A','B','C','F','G','H','J','L','N','Q','S','T','X','Y','Z'],
+          curentCitys:{
+            class:'',
+            list:[]
+          },
+          selectCitys:[],
+      }
+    },
+    mounted(){
+      this.getProvince();
+    },
+    computed:{
+        filterArea:function(){
+            let city_arr = JSON.parse(JSON.stringify(this.newArea));
+            return city_arr;
+        }
+    },
+    filters:{
+        shortName(val){
+          let reg = /[省,市,壮族,维吾尔,特别行政区,自治区,回族]/g
+          return val.replace(reg,'')
+        }
+    },
+    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,searchId:`#provice${v.ProID}`})
+                }
+            })
+          })
+          this.newArea = newArea;
+      },
+      selectCountry(){
+         this.isCountry = true;
+         this.citys = {};
+        this.newArea.forEach(item =>{
+          item[0].list.forEach(val =>{
+                val.isSelectAll = false;
+                val.data.forEach(city=>{
+                  city.status = false;
+                })
+          })
+        })
+      },
+      //城市弹窗初始化
+      cityPop(){
+        this.curentCitys.class = "";
+        this.$refs.citySelect.style.paddingBottom = "0px";
+      },
+      toggle(val,x,y){
+        console.log(val.name )
+          this.cityPop();
+          if(val.data.length>1){
+              this.curentCitys.list = val.data;
+              if(x>0 && x<6){
+                this.curentCitys.class = 'topCity';
+                this.$refs.citySelect.style.paddingBottom = "40px"
+              }else if(x>6 && x<12){
+                this.curentCitys.class = 'centerCity';
+                this.$refs.citySelect.style.paddingBottom = "70px"
+              }else{
+                this.curentCitys.class = 'bottomCity';
+                this.$refs.citySelect.style.paddingBottom = "100px"
+              }
+          }else{
+              this.selectCitys.push({name:val.name,id:(val.id*1234)})
+          }
+      },
+      //城市选择
+      selectCity(val,index){
+        let newArr = [];
+          let isSame = this.selectCitys.findIndex( item =>{
+             return item.name == val.name;
+          })
+          console.log(isSame,"---isSame---")
+          if(isSame == -1){
+              this.selectCitys.push({name:val.name,id:(val.CityID*12)})
+          }else{
+              this.selectCitys.splice(isSame,1)
+          }
+        console.log(val,this.selectCitys)
+      },
+      //取消
+      cancel(){
+          this.cityPop();
+      }
+    }
+}
+</script>
+
+<style lang="scss">
+  .citySelect{
+     display: block;
+     header{
+       text-align: left;
+       padding-bottom: 6px;
+       ul{
+         li{
+           display: inline-flex;
+           float: none;
+           padding: 0 16px;
+           height: 36px;
+           margin: 0 4px;
+          //  line-height: 36px;
+           border: 1px solid $light_color;
+           border-radius: 4px;
+           color: $light_color;
+           align-items: center;
+           span{
+             display: inline;
+           }
+           i{
+             margin-left: 12px;
+             font-size: 18px;
+             position: relative;
+             top: -1px;
+           }
+         }
+       }
+     }
+    .citySelectList{
+      position: relative;
+      ul{
+        display: flex;
+        flex-wrap: wrap;
+        li{
+          display: inline-flex;
+          margin: 4px 2px 0;
+          align-items: center;
+          h4{
+            margin: 0 4px;
+          }
+          .proviceList{
+            display: inline-flex;
+            align-items: center;
+            .proviceItem{
+              display: inline-flex;
+              align-items: center;
+              
+              h5{
+                padding: 0 4px;
+                margin: 0 3px;
+                height: 28px;
+                line-height: 28px;
+                cursor: pointer;
+              }
+            }
+          }
+        }
+      }
+      .cityList{
+          display: none;
+          position: absolute;
+          top: 34px;
+          width: 100%;
+          height: 100px;
+          background: #F5F5FB;
+          border: 1px solid #e0e0e0;
+          flex-direction: column;
+          justify-content: space-around;
+          &.topCity{
+            display: flex;
+          }
+          &.centerCity{
+            display: flex;
+            top:66px;
+          }
+          &.bottomCity{
+            display: flex;
+            top: 100px;
+          }
+          .btns{
+            display: flex;
+            width: 100%;
+            justify-content: center;
+            button{
+              margin: 0 10px;
+              border-radius: 4px;
+              width: 66px;
+              height: 28px;
+              &:first-child{
+                background: $light_color;
+                color: #fff;
+              }
+            }
+          }
+      }
+    }
+  }
+</style>

+ 5 - 3
src/views/bus/components/bidMsg.vue

@@ -67,7 +67,8 @@
             <div class="money area_msg">
                 <label>区域:</label>
                 <div class="right_msg">
-                    <div class="arr_data" v-if="arrData">
+                    <city-select></city-select>
+                    <!-- <div class="arr_data" v-if="arrData">
                         <span v-for="(item,index) in checkedVal">{{item}}<i class="el-icon-close" @click="delChecked(index)"></i></span>
                     </div>
                     <div class="are_lis">
@@ -81,7 +82,7 @@
                                 </div>
                             </li>
                         </ul>
-                    </div>
+                    </div> -->
                 </div>
             </div>
         </div>
@@ -122,13 +123,14 @@
 import { subscribeList, scribeData, subscribeExport } from '@/api/api';
 import { ChangeDate, ChangeDate1 } from '@/assets/js/time';
 import { industryData } from'@/assets/js/industry_data';
+import citySelect from "@/components/citySelect"
 import vWarn from './warnBox.vue';
 export default {
     props: {
         entData: {}
     },
     components: {
-        vWarn
+        vWarn,citySelect
     },
     data() {
         return {

+ 47 - 25
src/views/bus/components/editBox.vue

@@ -121,10 +121,6 @@ export default {
         this.$watch('InformatioType', () =>{
             this.selectcheckboxGroup3.status = [];
             this.selectcheckboxGroup3.list = [];
-            this.Country = false;
-            if(this.InformatioType[0] =='全部类型'){
-                this.Country = true;
-            }
             this.groupData3.forEach( (v,i) =>{
                 if(!Array.isArray(this.selectcheckboxGroup3.list[i])){
                     this.selectcheckboxGroup3.list[i] = [];
@@ -141,30 +137,36 @@ export default {
                         this.selectcheckboxGroup3.status[i] = true
                     }
                 }else{
-                    let current = this.InformatioType.find(n =>n === v.title);
+                    
+                    let current = this.InformatioType.find(n =>{
+                        let reg = new RegExp(n);
+                        console.log(reg,"ddddd")
+                        if(v.title.match(reg)){
+                            return n
+                        }
+                    });
                     if(current !== undefined){
                             this.selectcheckboxGroup3.list[i].push(current);
                             this.selectcheckboxGroup3.status[i] = true;
-                    }
-                    
+                    } 
                 }
             })
         })
 
         this.checkboxGroup2 = this.boxData.buyerclass;
         console.log(this.checkboxGroup2);
-        // scribeKey().then(res => {
-        //     res.data.data.map(v => {
-        //         let arr1 = [];
-        //         for(let i=0; i<v.a_key.length;i++) {
-        //             arr1.push(v.a_key[i].key)
-        //         }
-        //         this.groupData6.push({
-        //             s_item: v.s_item,
-        //             keys: String(arr1.join(",").replace(/,/g, "、"))
-        //         })
-        //     })
-        // })
+        scribeKey().then(res => {
+            res.data.data.map(v => {
+                let arr1 = [];
+                for(let i=0; i<v.a_key.length;i++) {
+                    arr1.push(v.a_key[i].key)
+                }
+                this.groupData6.push({
+                    s_item: v.s_item,
+                    keys: String(arr1.join(",").replace(/,/g, "、"))
+                })
+            })
+        })
     },
 
     methods: {
@@ -192,13 +194,13 @@ export default {
             if(this.digs ==3){
                 let arr = '';
                 if(this.Country){
+                    arr = '全部类型'
+                }else{
                     this.selectcheckboxGroup3.list.forEach( v =>{
                         if(v.length>0){
                             arr += `${v.join('、')}、`
                         }
                     })
-                }else{
-                    arr = '全部类型'
                 }
                 arr = arr.replace(/(.*)、/,'$1');
                 let  newArr = arr.split('、');
@@ -230,6 +232,13 @@ export default {
         },
         //信息类型全部选择
         handleCheckAllChange(val,i){
+            let newVal;
+            if(val.title == '招标预告'){
+                newVal = '预告'
+            }
+            if(val.title == '拟建项目'){
+                newVal = '拟建'
+            }
             if(val.list){
                 if(this.selectcheckboxGroup3.list[i].length == 0){
                     this.selectcheckboxGroup3.list.splice(i,1,val.list)
@@ -241,18 +250,31 @@ export default {
                 this.selectcheckboxGroup3.status.splice(i,1,status)
             }else{
                 if(this.selectcheckboxGroup3.list[i].length == 0){
-                    this.selectcheckboxGroup3.list[i].push(val.title)
+                    this.selectcheckboxGroup3.list[i].push(newVal)
                 }else{
                      this.selectcheckboxGroup3.list.splice(i,1,[])
-                }
-                
+                } 
             }
+            this.computerAll();
         },
         //单个选择
         handleCheckedCitiesChange(value,i) {
             let checkedCount = value.list.length;
             let status = checkedCount === this.selectcheckboxGroup3.list[i].length;
-            this.selectcheckboxGroup3.status.splice(i,1,status)
+            this.selectcheckboxGroup3.status.splice(i,1,status);
+            this.computerAll();
+        },
+        //计算是否是全选
+        computerAll(){
+            let nums = 0;
+            this.selectcheckboxGroup3.list.forEach(v =>{
+                nums += v.length;
+            })
+            if(nums == 0){
+                this.Country = true;
+            }else{
+                this.Country = false;
+            }
         }
     }
 }

+ 7 - 1
src/views/bus/components/subMage.vue

@@ -206,7 +206,13 @@ export default {
                     arr += `${v}、`
                 }
             })
-            this.$refs.editModel.InformatioType = res.data;
+            if(res.data[0] =='全部类型'){
+                this.$refs.editModel.Country = true;
+                this.$refs.editModel.InformatioType = [];
+            }else{
+                this.$refs.editModel.InformatioType = res.data;
+            }
+            
             arr = arr.replace(/(.*)、/,'$1');
             this.bookForm.mesge = arr;
         })