소스 검색

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

Mr.ding 4 년 전
부모
커밋
1fa5d79c05

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


+ 7 - 7
src/api/api.js

@@ -2,13 +2,13 @@ import fetch from "./request"
 // console.log(fetch,"----fetch")
 
 // 招标信息列表
-export const subscribeList = data => fetch.get('/entdataexport/subscribeList', data);
+export const subscribeList = data => fetch.get('/entdataexport/subscribeList', data,true);
 // 获取招标信息中高级筛选中信息
 export const scribeData = data => fetch.post('/entniche/subscribe/index', data);
 
 // 订阅设置页面接口
 // 订阅与分发开关
-export const subdis = data => fetch.get('/entniche/subscribe/subdis', data);
+export const subdis = data => fetch.get('/entniche/subscribe/subdis', data,true);
 // 获取区域设置
 export const areaGetdata = data => fetch.post('/entniche/subscribe/area/get', data);
 // 修改区域订阅设置
@@ -28,15 +28,15 @@ export const scribeKey = data => fetch.post('/entniche/subscribe/key/get', data)
 // 修改关键词设置
 export const updateKeys = data => fetch.post('/entniche/subscribe/key/update', data);
 // 全员无差别开关
-export const nodiff = data => fetch.get('/entniche/distribute/nodiff', data);
+export const nodiff = data => fetch.get('/entniche/distribute/nodiff', data,true);
 // 分发设置列表
 export const nodiffList = data => fetch.post('/entniche/distribute/list', data);
 // 统一订阅数据导出接口
-export const subscribeExport = data => fetch.get('/entdataexport/subscribeExport', data);
+export const subscribeExport = data => fetch.get('/entdataexport/subscribeExport', data,true);
 // 修改推送设置
-export const updatePush = data => fetch.get('/entniche/subscribe/pushset/update', data);
+export const updatePush = data => fetch.get('/entniche/subscribe/pushset/update', data, true);
 // 修改项目匹配
-export const projectUpdate = data => fetch.get('/entniche/subscribe/projectmatch/update', data);
+export const projectUpdate = data => fetch.get('/entniche/subscribe/projectmatch/update', data, true);
 // 修改采购单位行业设置
 export const buyerUpdate = data => fetch.post('/entniche/subscribe/buyerclass/update', data);
 // 新增分发设置
@@ -44,7 +44,7 @@ export const addDistribute = data => fetch.post('/entniche/distribute/add', data
 // 修改分发规则
 export const updateDistribute = data => fetch.post('/entniche/distribute/update', data);
 // 删除分发规则
-export const deleteDistribute = data => fetch.post('/entniche/distribute/delete', data);
+export const deleteDistribute = data => fetch.get('/entniche/distribute/delete', data, true);
 
 
 

+ 1 - 1
src/api/request.js

@@ -24,7 +24,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 => {

+ 6 - 1
src/components/areaSelect.vue

@@ -228,7 +228,12 @@ export default {
         }
         newArr = newArr.replace(/(.*)、/,'$1');
         if (this.$parent.digIndex == "fenAreas") {
-          this.$parent.tableData[this.$parent.cellIndex].area = newArr;
+          this.$emit('citys',this.citys);
+          if (this.$parent.quType == 'ar') {
+            this.$parent.addForm.area = newArr;
+          } else {
+            this.$parent.tableData[this.$parent.cellIndex].area = newArr;
+          }
         } else {
           areaUpdate(this.citys).then(res =>{
             if(res.data.status == 1){

+ 116 - 29
src/views/bus/components/distribute.vue

@@ -51,17 +51,17 @@
                 <div class="cai_gou btns">
                     <div v-if="chose!=index">
                         <el-button @click="handleExport(index)" type="text" size="small" style="color: #2CB7CA;border:none">编辑</el-button>
-                        <el-button @click="handleDel()" type="text" size="small" style="color: #686868;border:none;margin-left:20px">删除</el-button>
+                        <el-button @click="handleDel(item.id,index)" type="text" size="small" style="color: #686868;border:none;margin-left:20px">删除</el-button>
                     </div>
-                    <button type="primary" size="small" class="add_per" @click="saveFen" v-else>保存</button>
+                    <button type="primary" size="small" class="add_per" @click="saveFen(item.id)" v-else>保存</button>
                 </div>
             </li>
             <li v-if="newFen">
                 <div class="xuan_ze">
-                    <span @click="cellClick(5,5)" style="width:190px">选择分发人员<i class="el-icon-arrow-down"></i></span>
-                    <span @click="cellClick(6,6)" style="width:230px">选择分类名称<i class="el-icon-arrow-down"></i></span>
-                    <span @click="cellClick(1,1)" style="width:230px">选择区域<i class="el-icon-arrow-down"></i></span>
-                    <span @click="cellClick(2,2)" style="width:250px">选择采购单位行业<i class="el-icon-arrow-down"></i></span>
+                    <span @click="cellClick(5,5,'pe')" style="width:190px">{{addForm.people}}<i class="el-icon-arrow-down"></i></span>
+                    <span @click="cellClick(6,6,'na')" style="width:230px">{{addForm.name}}<i class="el-icon-arrow-down"></i></span>
+                    <span @click="cellClick(1,1,'ar')" style="width:230px">{{addForm.area}}<i class="el-icon-arrow-down"></i></span>
+                    <span @click="cellClick(2,2,'in')" style="width:250px">{{addForm.indeus}}<i class="el-icon-arrow-down"></i></span>
                     <span style="width:120px;text-align:center">
                         <button type="primary" size="small" class="add_per" @click="addFen">添加</button>
                     </span>
@@ -72,23 +72,20 @@
             <span @click="newRules">+新增分发规则</span>
         </div>
         <!-- 选择分发人员弹框 -->
-        <v-fenbox ref="fenModel"></v-fenbox>
+        <v-fenbox ref="fenModel" @idPeole="idPeole"></v-fenbox>
         <!-- 选择采购单位行业、信息类型弹框 -->
         <v-edit ref="editModel1" :digs="digs" :boxData="boxData"></v-edit>
         <!-- 区域选择弹框 -->
-        <area-select ref="editArea"></area-select>
+        <area-select ref="editArea" @citys="citys"></area-select>
     </div>
 </template>
 
 <script>
 import vFenbox from './fenBox.vue';
 import vEdit from './editBox.vue';
-import { nodiff, nodiffList } from '@/api/api';
-import areaSelect from "@/components/areaSelect.vue"
+import { nodiff, nodiffList, updateDistribute, deleteDistribute, addDistribute } from '@/api/api';
+import areaSelect from "@/components/areaSelect.vue";
 export default {
-    props: {
-        viewDatas: {}
-    },
     components: {
         vFenbox,
         vEdit,
@@ -105,23 +102,33 @@ export default {
             digs: 1,
             boxData: [],
             cellIndex: 0,
-            digIndex: ''
+            digIndex: '',
+            tCitys: {},
+            nums: Number,
+            quType: '',
+            addForm: {
+                people: '选择分发人员',
+                name: '选择分类名称',
+                area: '选择区域',
+                indeus: '选择采购单位行业'
+            },
+            idArr: []
         }
     },
     created() {
-        let nums = this.viewDatas.nodiff;
-        this.fens = nums == 1 ? true : false;
         nodiffList().then(res => {
             this.tableData1 = res.data.rules;
+            this.fens = res.data.nodiff == 1 ? true : false;
             res.data.rules.forEach((el,i) => {
                 let arr = [];
                 for (let ares in el.area) {
                     arr.push(ares)
                 }
                 this.tableData.push({
+                    id: el.id,
                     area: String(arr.join(",").replace(/,/g, "、")),
                     buyerclass: String(el.buyerclass.join(",").replace(/,/g, "、")),
-                    persons: String(el.persons),
+                    persons: String(el.persons.join(",").replace(/,/g, "、")),
                     items: String(el.items.join(",").replace(/,/g, "、"))
                 })
             });
@@ -139,39 +146,116 @@ export default {
                     });
                 }
             })
-        },
-        handleExport(row) {
-            this.chose = row;
-            this.elBtn = true;
-        },
-        handleDel(data) {
-
         },
         cellClick(indx, index, arr) {
-            this.digs = indx;
+            this.quType = arr;
             this.cellIndex = index;
-            this.boxData = this.tableData1[index]?this.tableData1[index]:[];
             if (indx == 5) {
                 this.$refs.fenModel.centerDialogVisible = true;
-                // this.$refs.fenModel.selectedList = [];
+                this.boxData = this.tableData1[index]?this.tableData1[index]:[];
             } else if (indx == 6) {
+                this.digIndex = 'fenlei';
                 this.$refs.editModel1.boxVisible = true;
+                this.boxData = this.tableData1[index]?this.tableData1[index]:[];
+                this.digs = indx;
             } else if (indx == 2) {
                 this.digIndex = 'distri';
                 this.$refs.editModel1.boxVisible = true;
+                if (arr == 'in') {
+                    this.boxData = {
+                        buyerclass: []
+                    };
+                } else {
+                    this.boxData = this.tableData1[index]?this.tableData1[index]:[];
+                }
+                this.digs = indx;
             } else if (indx == 1) {
                 this.digIndex = 'fenAreas';
                 this.$refs.editArea.boxVisible = true;
+                this.boxData = this.tableData1[index]?this.tableData1[index]:[];
             }
         },
         newRules() {
             this.newFen = true;
         },
-        saveFen() {
+        handleExport(row) {
+            this.chose = row;
+            this.elBtn = true;
+        },
+        delede(data,index) {
+            deleteDistribute(data).then(res => {
+                if (res.data.status == 1) {
+                    this.$message({
+                        message: '删除成功',
+                        type: 'success'
+                    });
+                    this.tableData.splice(index,1);
+                } else {
+                   this.$message.error('删除失败');
+                }
+            })
+        },
+        handleDel(data,index) {
+            this.delede({id:String(data)},index);
+        },
+        citys(val) {
+            console.log(val)
+            this.tCitys = val;
+        },
+        updated(data) {
+            updateDistribute(data).then(res => {
+                if (res.data == 1) {
+                    this.$message({
+                        message: '保存成功',
+                        type: 'success'
+                    });
+                } else {
+                   this.$message.error('保存失败');
+                }
+            })
+        },
+        idPeole(val) {
+            this.idArr = val;
+        },
+        saveFen(ids) {
             this.chose = -1;
-            console.log(this.tableData)
+            let arrData = [];
+            this.tableData.forEach(v => {
+                console.log(v.area)
+                arrData = {
+                    id: ids,
+                    area: this.tCitys?this.tCitys:v.area,
+                    buyerclass: (v.buyerclass).replace(/、/g, ",").split(','),
+                    items: (v.items).replace(/、/g, ",").split(','),
+                    persons: this.idArr
+                }
+            })
+            console.log(arrData)
+            this.updated(arrData);
         },
         addFen() {
+            let obj = {
+                persons: this.idArr,
+                items: this.addForm.name.replace(/、/g, ",").split(','),
+                area: this.tCitys,
+                buyerclass: this.addForm.indeus.replace(/、/g, ",").split(',')
+            }
+            console.log(obj)
+            addDistribute(obj).then(res => {
+                if (res.data.status == 1) {
+                    this.$message({
+                        message: '添加成功',
+                        type: 'success'
+                    });
+                    nodiffList().then(res => {});
+                    this.addForm = {
+                        name: '选择分类名称',
+                        indeus: '选择采购单位行业'
+                    }
+                } else {
+                   this.$message.error('添加失败');
+                }
+            })
             this.newFen = false;
         }
     }
@@ -246,6 +330,9 @@ export default {
         span {
             display: inline-block;
             cursor: pointer;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
             .add_per {
                 padding: 8px 12px;
                 background: #2CB7CA;

+ 15 - 13
src/views/bus/components/editBox.vue

@@ -104,11 +104,7 @@ export default {
             groupData2: [],
             groupData3: [],
             groupData4: [],
-            groupData6: [
-                {s_item: '钢筋混凝土',keys:'钢筋、水泥钢筋、水泥钢筋、水泥钢筋、水泥'},
-                {s_item: '楼房',keys:'钢筋、水泥钢筋、水泥钢筋、水泥钢筋、水泥'},
-                {s_item: '土地',keys:'钢筋、水泥钢筋、水泥钢筋、水泥钢筋、水泥'}
-            ],
+            groupData6: [],
             proMapList: [],
             leiIndex: [],
             arrs: []
@@ -152,9 +148,6 @@ export default {
                 }
             })
         })
-
-        this.checkboxGroup2 = this.boxData.buyerclass;
-        console.log(this.checkboxGroup2);
         scribeKey().then(res => {
             res.data.data.map(v => {
                 let arr1 = [];
@@ -175,13 +168,12 @@ export default {
             let arrIndex = this.leiIndex.indexOf(index);
             if(arrIndex>-1){
                 this.leiIndex.splice(arrIndex,1);
-                this.arr.splice(arrIndex,1);
+                this.arrs.splice(arrIndex,1);
             }else{
                 this.leiIndex.push(index);
-                this.arr.push(title);
+                this.arrs.push(title);
             }
-            console.log(this.arr)
-            // this.$parent.tableData[this.$parent.cellIndex].items = ''
+            console.log(this.arrs)
         },
         //全选
         checkCountry(){
@@ -225,7 +217,17 @@ export default {
                         }
                     })
                 } else if (this.$parent.digIndex == 'distri') {
-                    this.$parent.tableData[this.$parent.cellIndex].buyerclass = String(this.boxData.buyerclass.join(",").replace(/,/g, "、"));
+                    if (this.$parent.quType == 'in') {
+                        this.$parent.addForm.indeus = String(this.boxData.buyerclass.join(",").replace(/,/g, "、"));
+                    } else {
+                        this.$parent.tableData[this.$parent.cellIndex].buyerclass = String(this.boxData.buyerclass.join(",").replace(/,/g, "、"));
+                    }
+                } else if (this.$parent.digIndex == 'fenlei') {
+                    if (this.$parent.quType == 'na') {
+                        this.$parent.addForm.name = String(this.arrs.join(",").replace(/,/g, "、"));
+                    } else {
+                        this.$parent.tableData[this.$parent.cellIndex].items = String(this.arrs.join(",").replace(/,/g, "、"));
+                    }
                 }
             }
             this.boxVisible = false;

+ 0 - 1
src/views/bus/components/export.vue

@@ -52,7 +52,6 @@ export default {
         },
          getData(){
             dataExport({page:this.pageObj.currentPage,limit:this.pageObj.pageSize}).then(res =>{
-                console.log(res.data)
                 this.tableData = res.data;
                 this.pageObj.isSingle = Number(res.data.count) < 10
             })

+ 400 - 353
src/views/bus/components/fenBox.vue

@@ -1,400 +1,447 @@
 <template>
   <div class="ent_powerPerson">
-      <el-dialog
-          :title="titleMsg"
-          :show-close="false"
-          :visible.sync="centerDialogVisible"
-          width="890px"
-          center>
-          <div class="content">
-              <div class="content_left">
-                  <h4>选择</h4>
-                  <div class="search">
-                    <el-input  v-model="searchVal" placeholder="搜索" >
-                      <template slot="prepend"><img src="../../../assets/images/search.jpg" alt=""></template>
-                    </el-input>
-                  </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>
-                      <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> 
-                         </div>
-                      </div>
-                    </div>
-                  </div>
-              </div>
-              <div class="content_right">
-                  <h4>已选</h4>
-                  <ul>
-                    <li v-for="(item,i) in selectedList" :key="item.id">
-                      <span class="userName">{{ item.username }}</span><span>{{ item.phone }}</span><i class="el-icon-error" @click="delChooseUser(i)"></i>
-                    </li>
-                  </ul>
+    <el-dialog
+      :title="titleMsg"
+      :show-close="false"
+      :visible.sync="centerDialogVisible"
+      width="890px"
+      center
+    >
+      <div class="content">
+        <div class="content_left">
+          <h4>选择</h4>
+          <div class="search">
+            <el-input v-model="searchVal" placeholder="搜索">
+              <template slot="prepend">
+                <img src="../../../assets/images/search.jpg" alt />
+              </template>
+            </el-input>
+          </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>
+              <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>
+                </div>
               </div>
+            </div>
           </div>
-          <p v-if="currentIndex == 0">已选择{{ personList.checked }}人共购买{{ personList.quota }}人</p>
-          <span slot="footer" class="dialog-footer btns">
-              <button @click="saveDepart" class="save">保存</button>
-              <button  @click="centerDialogVisible = false" class="cancle">取消</button>
-          </span>
-        </el-dialog>
+        </div>
+        <div class="content_right">
+          <h4>已选</h4>
+          <ul>
+            <li v-for="(item,i) in selectedList" :key="item.id">
+              <span class="userName">{{ item.username }}</span>
+              <span>{{ item.phone }}</span>
+              <i class="el-icon-error" @click="delChooseUser(i)"></i>
+            </li>
+          </ul>
+        </div>
+      </div>
+      <p v-if="currentIndex == 0">已选择{{ personList.checked }}人共购买{{ personList.quota }}人</p>
+      <span slot="footer" class="dialog-footer btns">
+        <button @click="saveDepart" class="save">保存</button>
+        <button @click="centerDialogVisible = false" class="cancle">取消</button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
 
 <script>
-import { user_sjPersonListInter,add_sjPersonInter,user_recordpersonListInter,add_recordpersonListInter } from "@/api/api";
+import {
+  user_sjPersonListInter,
+  add_sjPersonInter,
+  user_recordpersonListInter,
+  add_recordpersonListInter
+} from "@/api/api";
 export default {
-   data(){
-     return{
-       centerDialogVisible:false,
-       searchVal:'',
-       personList:{},
-       selectedList:[],
-       checked:false,
-       titleMsg:'',
-       currentIndex:'0'
-     }
-   },
-   created(){
-      // this.$watch('searchVal', this.debounce((newValue, oldValue) => {
-        this.getData()
-      // }, 500))
-   },
-   computed:{
-      deal_personList:function(){
-         let arr = JSON.parse(JSON.stringify(this.personList));
-          arr.list && arr.list.forEach((items,x) =>{
-              let list = [];
-              items.users.forEach(item =>{
-                this.selectedList.forEach((val,i) =>{
-                  if(item.checked){ return; }
-                  if(item.user_id == val.user_id ){
-                    item.checked = true;
-                  }else{
-                    item.checked = false;
-                  }
-                })
-                if(item.checked){
-                  list.push("1")
-                }
-              }) 
-              if(list.length === items.users.length){
-                items.status = "selectAll";
-              }else if(list.length === 0){
-                items.status = "zero"
-              }else{
-                items.status = "selectHalf";
+  data() {
+    return {
+      centerDialogVisible: false,
+      searchVal: "",
+      personList: {},
+      selectedList: [],
+      checked: false,
+      titleMsg: "",
+      currentIndex: "0"
+    };
+  },
+  created() {
+    // this.$watch('searchVal', this.debounce((newValue, oldValue) => {
+    this.getData();
+    // }, 500))
+  },
+  computed: {
+    deal_personList: function() {
+      let arr = JSON.parse(JSON.stringify(this.personList));
+      arr.list &&
+        arr.list.forEach((items, x) => {
+          let list = [];
+          items.users.forEach(item => {
+            this.selectedList.forEach((val, i) => {
+              if (item.checked) {
+                return;
               }
-          })
-          return  arr.list;
-      }
-   },
-   methods:{
-     debounce (fn, delay) {
-        let timer = null
-        return function () {
-            let arg = arguments
-            clearTimeout(timer)
-            timer = setTimeout(() => {
-                fn.apply(this, arg)
-            }, delay)
-        }
-      },
-     //获取人员列表
-     getData(){
-       if(this.$parent.currentIndex == 0){
-          user_sjPersonListInter({name:this.searchVal}).then(res =>{
-            res.data.list.forEach(v =>{
-              v.toggle = true;
-              v.status = false;
-            })
-            this.personList = res.data;
-            this.selectedList = res.data.checkedList;
-          })
-          return;
-       }
-       user_recordpersonListInter({name:this.searchVal}).then(res =>{
-          res.data.list.forEach(v =>{
+              if (item.user_id == val.user_id) {
+                item.checked = true;
+              } else {
+                item.checked = false;
+              }
+            });
+            if (item.checked) {
+              list.push("1");
+            }
+          });
+          if (list.length === items.users.length) {
+            items.status = "selectAll";
+          } else if (list.length === 0) {
+            items.status = "zero";
+          } else {
+            items.status = "selectHalf";
+          }
+        });
+      return arr.list;
+    }
+  },
+  methods: {
+    debounce(fn, delay) {
+      let timer = null;
+      return function() {
+        let arg = arguments;
+        clearTimeout(timer);
+        timer = setTimeout(() => {
+          fn.apply(this, arg);
+        }, delay);
+      };
+    },
+    //获取人员列表
+    getData() {
+      if (this.$parent.currentIndex == 0) {
+        user_sjPersonListInter({ name: this.searchVal }).then(res => {
+          res.data.list.forEach(v => {
             v.toggle = true;
             v.status = false;
-          })
+          });
           this.personList = res.data;
           this.selectedList = res.data.checkedList;
-       })
-     },
-     //判断添加人员是否重复
-     judgeHeavy(val){
-       let arr = [];
-        val.users ? arr = val.users : arr.push(val);
-        let test = arr.reduce((pre,cur) => {
-              if(this.selectedList.every(item=>item.user_id!==cur.user_id)){
-                  pre.push(cur)
-              }
-              return pre;
-        },[]);
-        return test;
-     },
-     //选择人员
-     chooseUser(val,status){
-        if(status === 'single'){
-          if(this.currentIndex == 0){
-              if(this.selectedList.length >= this.personList.quota){
-                this.$message({ message: '大于购买人数,不可继续添加',type: 'warning'});
-                return;
-              }
-          }
-          
-          let newArr = this.selectedList.filter(x => {
-              return val.user_id == x.user_id
-          })
-          if(newArr.length>0){
-            this.$message({ message: '该人员已添加',type: 'warning'});
+        });
+        return;
+      }
+      user_recordpersonListInter({ name: this.searchVal }).then(res => {
+        res.data.list.forEach(v => {
+          v.toggle = true;
+          v.status = false;
+        });
+        this.personList = res.data;
+        this.selectedList = res.data.checkedList;
+      });
+    },
+    //判断添加人员是否重复
+    judgeHeavy(val) {
+      let arr = [];
+      val.users ? (arr = val.users) : arr.push(val);
+      let test = arr.reduce((pre, cur) => {
+        if (this.selectedList.every(item => item.user_id !== cur.user_id)) {
+          pre.push(cur);
+        }
+        return pre;
+      }, []);
+      return test;
+    },
+    //选择人员
+    chooseUser(val, status) {
+      if (status === "single") {
+        if (this.currentIndex == 0) {
+          if (this.selectedList.length >= this.personList.quota) {
+            this.$message({
+              message: "大于购买人数,不可继续添加",
+              type: "warning"
+            });
             return;
-          }else{
-            this.selectedList.push(val);
           }
-        }else{
-            this.selectedList = this.selectedList.concat(val);
         }
-     },
-     selectGroup(val,i){
+
+        let newArr = this.selectedList.filter(x => {
+          return val.user_id == x.user_id;
+        });
+        if (newArr.length > 0) {
+          this.$message({ message: "该人员已添加", type: "warning" });
+          return;
+        } else {
+          this.selectedList.push(val);
+        }
+      } else {
+        this.selectedList = this.selectedList.concat(val);
+      }
+    },
+    selectGroup(val, i) {
       //  val.status = true;
       let newVal = this.judgeHeavy(val);
       let newSelect = this.selectedList.concat(newVal);
-       if(this.currentIndex == 0){
-         if(val.status == "selectAll"){
-            this.$message({ message: '该人员已添加',type: 'warning'});
-            return;
-         }
-          if(this.selectedList.length >= this.personList.quota){
-            this.$message({ message: '大于购买人数,不可继续添加',type: 'warning'});
-            return;
-          }
-          
-          if(newSelect.length > this.personList.quota){
-            if(newVal.length>1){
-              this.$message({ message: '大于可添加的人数,请单个添加',type: 'warning'});
-            }else{
-              this.$message({ message: '大于购买人数,不可继续添加',type: 'warning'});
-            }
-            return;
-          }
-       }
-        this.personList.list.splice(i,1,val)
-        this.chooseUser(newVal)
-     },
-     //删除人员
-     delChooseUser(i){
-        this.selectedList.splice(i,1);
-     },
-     //添加人员
-     saveDepart(){
-       let delId = '';
-       this.selectedList.forEach((v,i) =>{
-          if(v.user_id){
-            i === 0 ? delId += `${v.user_id}` : delId += `,${v.user_id}`
+      if (this.currentIndex == 0) {
+        if (val.status == "selectAll") {
+          this.$message({ message: "该人员已添加", type: "warning" });
+          return;
+        }
+        if (this.selectedList.length >= this.personList.quota) {
+          this.$message({
+            message: "大于购买人数,不可继续添加",
+            type: "warning"
+          });
+          return;
+        }
+
+        if (newSelect.length > this.personList.quota) {
+          if (newVal.length > 1) {
+            this.$message({
+              message: "大于可添加的人数,请单个添加",
+              type: "warning"
+            });
+          } else {
+            this.$message({
+              message: "大于购买人数,不可继续添加",
+              type: "warning"
+            });
           }
-       })
+          return;
+        }
+      }
+      this.personList.list.splice(i, 1, val);
+      this.chooseUser(newVal);
+    },
+    //删除人员
+    delChooseUser(i) {
+      this.selectedList.splice(i, 1);
+    },
+    //添加人员
+    saveDepart() {
+      let delId = "", idStr = [];
+      this.selectedList.forEach((v, i) => {
+        idStr.push(v.user_id);
+        if (v.user_id) {
+          i === 0 ? (delId += `${v.user_id}`) : (delId += `,${v.user_id}`);
+        }
+      });
       let arr = [];
       this.selectedList.forEach(v => {
         arr.push(v.username);
-      })
+      });
       let i = this.$parent.cellIndex;
       if (arr.length) {
-        this.$parent.tableData[i].persons = String(arr.join(",").replace(/,/g, "、"));
+        if (this.$parent.quType == "pe") {
+          this.$parent.addForm.people = String(
+            arr.join(",").replace(/,/g, "、")
+          );
+        } else {
+          this.$parent.tableData[i].persons = String(
+            arr.join(",").replace(/,/g, "、")
+          );
+        }
+        this.$emit('idPeole',idStr);
+        console.log(idStr)
       }
       this.centerDialogVisible = false;
-     },
-     toggle(val,i){
-       val.toggle = !val.toggle;
-      this.personList.list.splice(i,1,val)
-
-     }
-   }
-}
+    },
+    toggle(val, i) {
+      val.toggle = !val.toggle;
+      this.personList.list.splice(i, 1, val);
+    }
+  }
+};
 </script>
 
 <style lang="scss">
-  .ent_powerPerson{
-      .el-dialog__header{
-          font-size: 26px;
-          color: $weight_color;
+.ent_powerPerson {
+  .el-dialog__header {
+    font-size: 26px;
+    color: $weight_color;
+  }
+  .content {
+    display: flex;
+    justify-content: space-between;
+    .content_left,
+    .content_right {
+      width: 400px;
+      height: 400px;
+      border-radius: 6px;
+      margin: 0 5px;
+      display: flex;
+      flex-direction: column;
+      border: 1px solid #ececec;
+    }
+    .content_left {
+      h4 {
+        padding: 14px 20px;
+        font-size: 14px;
+        color: $weight_color;
       }
-      .content{
-          display: flex;
-          justify-content: space-between;
-          .content_left,.content_right{
-              width: 400px;
-              height: 400px;
-              border-radius: 6px;
-              margin: 0 5px;
-              display: flex;
-              flex-direction: column;
-              border: 1px solid #ECECEC;
+      .search {
+        margin-left: 20px;
+        width: 360px;
+        .el-input-group {
+          width: 100%;
+          border: 1px solid $border_color;
+          border-radius: 18px;
+          .el-input-group__prepend {
+            border-radius: 18px 0 0 18px;
+            background: #fff;
+            border: none;
+            padding: 0 12px;
+            img {
+              width: 24px;
+              margin-top: 6px;
+              cursor: pointer;
+            }
+          }
+          .el-input__inner {
+            border: none;
+            height: 36px;
+            border-radius: 0px 18px 18px 0;
+            padding: 0 4px 0 0;
+          }
+        }
+      }
+      .allList {
+        flex: 1;
+        overflow: auto;
+        > div {
+          h5,
+          .itemList > div {
+            padding: 0 20px;
+            line-height: 40px;
+            box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.05);
           }
-          .content_left{
-            h4{
-              padding: 14px 20px ;
-              font-size: 14px;
-              color: $weight_color;
+          h5 {
+            margin-top: 16px;
+            color: $weight_color;
+            display: flex;
+            align-items: center;
+            > span {
+              flex: 1;
+              margin-left: 10px;
+              cursor: pointer;
             }
-            .search{
-                margin-left: 20px;
-                width: 360px;
-                .el-input-group{
-                    width: 100%;
-                    border: 1px solid $border_color;
-                    border-radius: 18px;
-                    .el-input-group__prepend{
-                        border-radius: 18px 0 0 18px;
-                        background: #fff;
-                        border:none;
-                        padding: 0 12px;
-                        img{
-                            width: 24px;
-                            margin-top: 6px;
-                            cursor: pointer;
-                        }
-                    }
-                    .el-input__inner{
-                        border: none;
-                        height: 36px;
-                        border-radius: 0px  18px 18px 0;
-                        padding: 0 4px 0 0;
-                    }
-                }
+            .seleced {
+              width: 20px;
+              height: 20px;
+              border-radius: 50%;
+              border: 1px solid #e0e0e0;
+              cursor: pointer;
+              position: relative;
             }
-            .allList{
-              flex: 1;
-              overflow: auto;
-              >div{
-                h5,.itemList>div{
-                   padding: 0 20px;
-                   line-height: 40px;
-                   box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.05);
-                }
-                h5{
-                  margin-top: 16px;
-                  color: $weight_color;
-                  display: flex;
-                  align-items: center;
-                  >span{
-                    flex: 1;
-                    margin-left: 10px;
-                    cursor: pointer;
-                  }
-                  .seleced{
-                    width: 20px;
-                    height: 20px;
-                    border-radius: 50%;
-                    border: 1px solid #e0e0e0;
-                    cursor: pointer;
-                    position: relative;
-                  }
-                  .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;
-                  }
-                  .el-icon-arrow-down{
-                    font-size: 16px;
-                     color: #aaa;
-                  }
-                }
-                .itemList{
-                  transition: all  0.5s ;
-                  opacity: 1;
-                  max-height:4000px;
-                  >div{
-                    cursor: pointer;
-                    color: $normal_color;
-                    display: flex;
-                    align-items: center;
-                    span{
-                      padding-right: 20px;
-                    }
-                    .userName{
-                      margin-right: auto;
-                    }
-                    &.active{
-                      background: #F5F5FB;
-                    }
-                  }
-                &.toggle{
-                  max-height: 0px!important;
-                  opacity: 0;
-                  overflow: hidden;
-                }
-                }
-              }
-              
+            .selectAll {
+              border: none;
+              background: url(../../../assets/images/checked.png) no-repeat
+                center center;
+              background-size: 20px;
             }
-          }
-          .content_right{ 
-            h4{
-              padding: 14px 15px;
-              font-size: 14px;
-              color: $weight_color;
+            .selectHalf {
+              border: none;
+              background: url(../../../assets/images/half.png) no-repeat center
+                center;
+              background-size: 20px;
             }
-            ul{
-              flex: 1;
-              overflow: auto;
-              li{
-                float: none;
-                padding: 0 20px;
-                box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.05);
-                line-height: 40px;
-                color: $normal_color;
-                display: flex;
-                align-items: center;
-                span{
-                  padding-right: 20px;
-                }
-                .userName{
-                  margin-right: auto;
-                }
-                i{
-                  cursor: pointer;
-                  font-size: 24px;
-                  color: #AAAAAA;
-                }
-              }
+            .el-icon-arrow-down {
+              font-size: 16px;
+              color: #aaa;
             }
           }
-      }
-      p{
-        color: $light_color;
-        line-height: 24px;
-        padding: 20px 0 0;
-        text-align: center;
-      }
-      button{
-          width: 132px;
-          height: 36px;
-          background: transparent;
-          border-radius: 6px;
-          margin: 0 20px;
-          font-size: 16px;
-          &:active{
-              opacity: 0.8;
+          .itemList {
+            transition: all 0.5s;
+            opacity: 1;
+            max-height: 4000px;
+            > div {
+              cursor: pointer;
+              color: $normal_color;
+              display: flex;
+              align-items: center;
+              span {
+                padding-right: 20px;
+              }
+              .userName {
+                margin-right: auto;
+              }
+              &.active {
+                background: #f5f5fb;
+              }
+            }
+            &.toggle {
+              max-height: 0px !important;
+              opacity: 0;
+              overflow: hidden;
+            }
           }
+        }
       }
-      .save{
-          border: 1px solid $light_color;
-          color: $light_color;
+    }
+    .content_right {
+      h4 {
+        padding: 14px 15px;
+        font-size: 14px;
+        color: $weight_color;
       }
-      .cancle{
-          border: 1px solid #e0e0e0;
+      ul {
+        flex: 1;
+        overflow: auto;
+        li {
+          float: none;
+          padding: 0 20px;
+          box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.05);
+          line-height: 40px;
           color: $normal_color;
+          display: flex;
+          align-items: center;
+          span {
+            padding-right: 20px;
+          }
+          .userName {
+            margin-right: auto;
+          }
+          i {
+            cursor: pointer;
+            font-size: 24px;
+            color: #aaaaaa;
+          }
+        }
       }
+    }
   }
-
+  p {
+    color: $light_color;
+    line-height: 24px;
+    padding: 20px 0 0;
+    text-align: center;
+  }
+  button {
+    width: 132px;
+    height: 36px;
+    background: transparent;
+    border-radius: 6px;
+    margin: 0 20px;
+    font-size: 16px;
+    &:active {
+      opacity: 0.8;
+    }
+  }
+  .save {
+    border: 1px solid $light_color;
+    color: $light_color;
+  }
+  .cancle {
+    border: 1px solid #e0e0e0;
+    color: $normal_color;
+  }
+}
 </style>

+ 2 - 6
src/views/bus/components/subMage.vue

@@ -109,7 +109,7 @@
             <!-- 分发设置 -->
             <h2 style="margin-top:28px">分发设置</h2>
             <el-divider></el-divider>
-            <v-distri :viewDatas="viewDatas"></v-distri>
+            <v-distri></v-distri>
         </div>
         <!-- 开启邮箱提醒 -->
         <v-warn ref="emailed" :exportData="exportData"></v-warn>
@@ -140,7 +140,6 @@ export default {
     },
     data() {
         return {
-            viewDatas: [],
             boxData: {},
             apper: 0,
             bookForm: {
@@ -170,7 +169,6 @@ export default {
     created() {
         // 获取订阅设置首页
         scribeData().then(res => {
-            this.viewDatas = res.data;
             this.bookForm.dispense = res.data.subdis == '1' ? true : false;
             this.boxData = res.data.subscribe;
             this.bookForm.tuiRadio = res.data.subscribe.ratemode;
@@ -200,7 +198,6 @@ export default {
         //获取信息类型
         infotypeData().then(res =>{
             let arr = '';
-            console.log(res.data,"res.data")
             res.data.forEach( v =>{
                 if(v.length>0){
                     arr += `${v}、`
@@ -219,7 +216,7 @@ export default {
     },
     methods: {
         booked(num) {
-            this.apper = num;
+            // this.apper = num;
         },
         dispensed() {// 订阅与分发
             subdis({
@@ -240,7 +237,6 @@ export default {
                 mailpush: this.bookForm.tuiCheck2 ? 1 : 0 ,
                 matchway: this.bookForm.pipeiRadio
             }
-            console.log(obj)
             updatePush(obj).then(res => {
                 if (res.data.status == 1) {
                     this.$message({