Ver código fonte

feat:订阅设置,信息类型选择

Mr.ding 4 anos atrás
pai
commit
6666bc7a0e

+ 0 - 0
public/index34.html → public/index2.html


+ 1 - 1
src/api/api.js

@@ -19,7 +19,7 @@ export const updateBuyerclass = data => fetch.post('/entniche/subscribe/buyercla
 // 获取信息类型设置
 export const infotypeData = data => fetch.post('/entniche/subscribe/infotype/get', data);
 // 修改信息类型设置
-export const updateInfotype = data => fetch.post('/entniche/subscribe/infotype/get', data);
+export const updateInfotype = data => fetch.post('/entniche/subscribe/infotype/update', data);
 // 获取推送设置(关键词匹配方式)
 export const pushset = data => fetch.post('/entniche/subscribe/pushset/get', data);
 // 获取关键词设置

+ 7 - 9
src/assets/js/industry_data.js

@@ -173,15 +173,13 @@ export const industryData3 = [
     {title: '拟建项目'},
     {title: '招标预告'},
     {title: '招标公告',list: [
-        {name: '招标'},
-        {name: '邀标'},
-        {name: '询价'},
-        {name: '竞谈'},
-        {name: '单一'},
-        {name: '竞价'},
-        {name: '变更'},
-        {name: '其他'}
+         '招标','邀标','询价','竞谈', '单一','竞价', '变更','其他'
+    ]},
+    {title: '招标结果',list:[
+        '中标','成交','废标','流标'
+    ]},
+    {title: '招标信用信息',list:[
+        '合同','验收','违规'
     ]},
-    {title: '招标结果'},
 ]
 

+ 138 - 14
src/views/bus/components/editBox.vue

@@ -12,11 +12,14 @@
                         class="sear"
                         placeholder="搜索"
                         prefix-icon="el-icon-search"
+                        v-if="digs == 3 ?false : true"
                         v-model="input1">
                     </el-input>
                     <div class="industy_lis">
                         <div class="quan_bu" v-if="digs != 6">
                             <el-checkbox-button 
+                               @change="checkCountry"
+                               v-model="Country"
                                 :label="digs == 1?'全国':digs == 2?'全部行业':'全部类型'"
                                 :class="{c_active:digs != 2}"
                             >
@@ -39,12 +42,10 @@
                         <!-- 信息类型 -->
                         <div class="lists msg_type" v-if="digs == 3">
                             <ul>
-                                <li v-for="item in groupData3" :key="item.title" class="li_data">
-                                    <el-checkbox-group v-model="checkboxGroup3">
-                                        <el-checkbox-button class="titles" :label="item.title">{{item.title}}</el-checkbox-button>
-                                    </el-checkbox-group>
-                                    <el-checkbox-group v-model="checkboxGroup3">
-                                        <el-checkbox-button v-for="ite in item.list" :key="ite.name" :label="ite.name">{{ite.name}}</el-checkbox-button>
+                                <li v-for="(item,i) in groupData3" :key="item.title" class="li_data">
+                                    <el-checkbox class="titles"  v-model="selectcheckboxGroup3.status[i]" @change="handleCheckAllChange(item,i)">{{ item.title }}</el-checkbox>
+                                    <el-checkbox-group v-model="selectcheckboxGroup3.list[i]"  @change="handleCheckedCitiesChange(item,i)">
+                                        <el-checkbox-button v-for="ite in item.list" :key="ite" :label="ite">{{ite}}</el-checkbox-button>
                                     </el-checkbox-group>
                                 </li>
                             </ul>
@@ -73,7 +74,7 @@
 </template>
 
 <script>
-import { scribeKey } from '@/api/api';
+import { scribeKey,updateInfotype } from '@/api/api';
 import { industryData2, industryData3 } from'@/assets/js/industry_data';
 
 export default {
@@ -84,6 +85,7 @@ export default {
     },
     data() {
         return {
+            Country:false,
             boxVisible: false,
             care: 1,
             mails: false,
@@ -91,7 +93,12 @@ export default {
             input1: '',
             checkboxGroup1: ['c21'],
             checkboxGroup2: [''],
-            checkboxGroup3: ['招标'],
+            checkboxGroup3: [],
+            InformatioType:[],
+            selectcheckboxGroup3:{
+                status:[],
+                list:[]
+            },
             checkboxGroup4: ['b1'],
             activeNames: ['1'],
             groupData1: [],
@@ -122,8 +129,41 @@ export default {
     created() {
         this.groupData2 = industryData2;
         this.groupData3 = industryData3;
-        // this.checkboxGroup2 = this.boxData;
-        console.log(this.groupData6);
+        //信息类型数据处理
+        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] = [];
+                }
+                this.selectcheckboxGroup3.status[i] = false;
+                if(v.list){
+                    v.list.forEach((item,x) =>{
+                            let current = this.InformatioType.find(n =>n === item);
+                            if(current !== undefined){
+                            this.selectcheckboxGroup3.list[i].push(current);
+                            }
+                    })
+                    if(this.selectcheckboxGroup3.list[i].length === v.list.length){
+                        this.selectcheckboxGroup3.status[i] = true
+                    }
+                }else{
+                    let current = this.InformatioType.find(n =>n === v.title);
+                    if(current !== undefined){
+                            this.selectcheckboxGroup3.list[i].push(current);
+                            this.selectcheckboxGroup3.status[i] = true;
+                    }
+                    
+                }
+            })
+        })
+        
+
         for (const key in this.provinceData) {
             this.groupData1.push(key);
             this.proMapList[key] =this.provinceData[key].map(v => {
@@ -133,11 +173,68 @@ export default {
         scribeKey().then(res => {
             this.groupData6 = res.data;
         })
+        
     },
     methods: {
+        //全选
+        checkCountry(){
+            if(this.digs ==3){
+                this.InformatioType = []
+            }
+        },
+        //保存
         confirmed() {
+            if(this.digs ==3){
+                let arr = '';
+                if(this.Country){
+                    this.selectcheckboxGroup3.list.forEach( v =>{
+                        if(v.length>0){
+                            arr += `${v.join('、')}、`
+                        }
+                    })
+                }else{
+                    arr = '全部类型'
+                }
+                arr = arr.replace(/(.*)、/,'$1');
+                let  newArr = arr.split('、');
+                this.$parent.bookForm.mesge = arr;
+                updateInfotype({msg:newArr}).then(res =>{
+                    if(res.data.status == 1){
+                       this.$message({ message: '设置成功',type: 'success'});
+                    }else{
+                       this.$message({ message: '设置失败',type: 'warning'});
+                    return;
+                    }
+                })
+            }
             this.boxVisible = false;
-            console.log()
+        },
+        //信息类型全部选择
+        handleCheckAllChange(val,i){
+            console.log(val)
+            if(val.list){
+                if(this.selectcheckboxGroup3.list[i].length == 0){
+                    this.selectcheckboxGroup3.list.splice(i,1,val.list)
+                }else{
+                    this.selectcheckboxGroup3.list.splice(i,1,[])
+                } 
+                let checkedCount = val.list.length;
+                let status = checkedCount === this.selectcheckboxGroup3.list[i].length;
+                this.selectcheckboxGroup3.status.splice(i,1,status)
+            }else{
+                if(this.selectcheckboxGroup3.list[i].length == 0){
+                    this.selectcheckboxGroup3.list[i].push(val.title)
+                }else{
+                     this.selectcheckboxGroup3.list.splice(i,1,[])
+                }
+                
+            }
+        },
+        //单个选择
+        handleCheckedCitiesChange(value,i) {
+            let checkedCount = value.list.length;
+            let status = checkedCount === this.selectcheckboxGroup3.list[i].length;
+            this.selectcheckboxGroup3.status.splice(i,1,status)
         }
     }
 }
@@ -167,6 +264,16 @@ export default {
                         display: flex;
                         padding: 8px 20px;
                         box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.05);
+                        /deep/.el-checkbox-button__inner{
+                            color: #1d1d1d;
+                        }
+                        /deep/.el-checkbox-button.is-checked .el-checkbox-button__inner{
+                            color: #2ABED1!important;
+                            border: 1px solid $light_color !important;
+                        }
+                        /deep/.el-checkbox-button__inner:hover{
+                            color: $light_color;
+                        }
                     }
                     .lists {
                         .li_data {
@@ -175,7 +282,7 @@ export default {
                             text-align: left;
                             width: 100%;
                             min-height: 40px;
-                            margin-top: 10px;
+                            margin-top: 14px;
                             box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.05);
                             h3 {
                                 font-size: 12px;
@@ -185,8 +292,25 @@ export default {
                                 background: #F5F5FB;
                             }
                             .el-checkbox-group {
-                                padding: 0 20px 8px 20px;
-                                
+                                padding: 0 20px 14px 20px; 
+                            }
+                            /deep/.titles{
+                                .el-checkbox__input{
+                                    display: none;
+                                }
+                                .el-checkbox__label{
+                                    box-sizing: border-box;
+                                   padding: 2px 10px;
+                                    font-weight: bold;
+                                    color: #1d1d1d;
+                                    margin-left: 20px;
+                                    border-radius: 4px!important;
+                                    border: 1px solid #DCDFE6;
+                                }
+                                .el-checkbox__input.is-checked + .el-checkbox__label{
+                                    color: #2ABED1!important;
+                                    border: 1px solid $light_color !important;
+                                }
                             }
                         }
                         .li_fen {

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

@@ -121,7 +121,7 @@
 </template>
 
 <script>
-import { scribeData, subdis, updateArea, updateBuyerclass, updateInfotype, pushset, updatePush, projectUpdate,areaGetdata } from '@/api/api';
+import { scribeData, subdis, updateArea, updateBuyerclass, updateInfotype, pushset, updatePush, projectUpdate,areaGetdata,infotypeData} from '@/api/api';
 import vKey from './antistop.vue';
 import vDistri from './distribute.vue';
 import vWarn from './warnBox.vue';
@@ -190,9 +190,23 @@ export default {
               newArr += `${key} (${res.data.area[key].join('、')})、`
             }
           }
+          this.$refs.editArea.citys = res.data.area
           newArr = newArr.replace(/(.*)、/,'$1');
           this.bookForm.areas = newArr;
         })
+        //获取信息类型
+        infotypeData().then(res =>{
+            let arr = '';
+            console.log(res.data,"res.data")
+            res.data.forEach( v =>{
+                if(v.length>0){
+                    arr += `${v}、`
+                }
+            })
+            this.$refs.editModel.InformatioType = res.data;
+            arr = arr.replace(/(.*)、/,'$1');
+            this.bookForm.mesge = arr;
+        })
     },
     methods: {
         booked(num) {
@@ -228,12 +242,12 @@ export default {
             })
         },
         decMsg(nums) {// 弹框
-        if(nums == 1){
-             this.$refs.editArea.boxVisible = true;
-        }else{
-            this.$refs.editModel.boxVisible = true;
-            this.digs = nums;
-        }   
+            if(nums == 1){
+                this.$refs.editArea.boxVisible = true;
+            }else {
+                this.$refs.editModel.boxVisible = true;
+                this.digs = nums;
+            }   
         },
         tuiChecked(val) {// 推送时间
             this.ratemodes = val;

+ 3 - 3
vue.config.js

@@ -19,7 +19,7 @@ module.exports = {
         // target: "https://app2-jytest.jianyu360.cn",
         // target: "http://127.0.0.1:812",
         // target:'http://192.168.20.214:815',//任
-        target:'http://192.168.20.241:815',
+        target:'http://192.168.20.175:815',
         changeOrigin: true,
         ws: true,
         pathRewrite: {
@@ -28,7 +28,7 @@ module.exports = {
       },
       "/entniche": {
         // target: "https://app2-jytest.jianyu360.cn",
-        target: "http://192.168.20.241:812",
+        target: "http://192.168.20.175:812",
         // target: "http://127.0.0.1:812",
         // target:'http://192.168.20.214:812',//任
         changeOrigin: true,
@@ -44,7 +44,7 @@ module.exports = {
         // target: "http://127.0.0.1:813",
         // target:'http://192.168.20.51:815/entbase',
         // target:'http://192.168.20.51:813/entdataexport',
-        target:'http://192.168.20.241:813',
+        target:'http://192.168.20.175:813',
         // target:'http://192.168.20.241:812',
         changeOrigin: true,
         ws: true,