wenmenghao321 2 år sedan
förälder
incheckning
559310e65c

BIN
src/web/staticres/common-module/personDialog/img/checked.png


BIN
src/web/staticres/common-module/personDialog/img/half.png


+ 292 - 0
src/web/staticres/common-module/personDialog/personDialog.scss

@@ -0,0 +1,292 @@
+.ent_powerPerson_dialog{
+  display: flex;
+  align-items: center;
+  .el-dialog{
+    margin: 0 auto 0!important;
+  }
+    .el-dialog__header{
+        font-size: 26px;
+        color: #1D1D1D;
+    }
+    .el-dialog__body{
+      padding: 20px 30px;
+    }
+    .content{
+        display: flex;
+        justify-content: space-between;
+        .content_left,.content_right{
+            width: 400px;
+            height: 400px;
+            // max-height: 400px;
+            // min-height: 300px;
+            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: #1D1D1D;
+          }
+          .search{
+              margin-left: 20px;
+              width: 360px;
+              ::v-deep {
+                .el-input-group{
+                  width: 100%;
+                  border: 1px solid rgba(0,0,0,0.05);
+                  border-radius: 18px;
+                  .el-input-group__prepend{
+                      border-radius: 18px 0 0 18px;
+                      background: #F7F7F7;
+                      border:none;
+                      padding: 0 12px;
+                      img{
+                          width: 20px;
+                          height: 20px;
+                          margin-top: 6px;
+                          cursor: pointer;
+                      }
+                  }
+                }
+                .el-input__icon.el-icon-search {
+                  width: 24px;
+                  height: 24PX;
+                }
+                .el-input__inner{
+                  background: #F7F7F7;
+                  border: 1px solid #ECECEC;
+                  border-radius: 22px;
+                }
+              }
+          }
+          .all {
+            height: 40px;
+            display: flex;
+            align-content: center;
+            align-items: center;
+            margin-top: 10px;
+            padding: 0 20px;
+            box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.05);
+            .seleced{
+              width: 18px;
+              height: 18px;
+              border-radius: 50%;
+              border: 1px solid #e0e0e0;
+              cursor: pointer;
+              margin-right: 10px;
+            }
+            .selectAll{
+              border:none;
+              background: url(/common-module/personDialog/img/checked.png) no-repeat center center;
+              background-size: 20px;
+            }
+            .selectHalf{
+              border:none;
+              background: url(/common-module/personDialog/img/half.png) no-repeat center center;
+              background-size: 20px;
+            }
+          }
+          .allList{
+            flex: 1;
+            overflow: auto;
+            .active {
+              display: flex;
+              justify-content: space-between;
+              align-items: center;
+              padding-right: 20px;
+              height: 40px;
+              box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.05);
+            }
+            /* 滚动条样式 */
+            &::-webkit-scrollbar {
+                /*滚动条整体样式*/
+                width: 8px;
+            }
+            &::-webkit-scrollbar-thumb {
+                /*滚动条里面小方块*/
+                border-radius: 3px;
+                background: #ECECEC;
+                opacity: 0.15;
+            }
+            >div{
+              transition: all 0.5s;
+              h5,.itemList>div{
+                 padding: 0 20px;
+                 line-height: 40px;
+                 h5 {
+                   box-shadow: none;
+                   padding-left: 0;
+                   padding-right: 10px;
+                 }
+              }
+              h5{
+                // margin-top: 16px;
+                color: #1D1D1D;
+                display: flex;
+                align-items: center;
+                >span{
+                  flex: 1;
+                  margin-left: 10px;
+                  cursor: pointer;
+                }
+                i{
+                  cursor: pointer;
+                }
+                .seleced{
+                  width: 18px;
+                  height: 18px;
+                  border-radius: 50%;
+                  border: 1px solid #e0e0e0;
+                  cursor: pointer;
+                  position: relative;
+                }
+                .selectAll{
+                   border:none;
+                   background: url(/common-module/personDialog/img/checked.png) no-repeat center center;
+                   background-size: 20px;
+                }
+                .selectHalf{
+                  border:none;
+                   background: url(/common-module/personDialog/img/half.png) no-repeat center center;
+                   background-size: 20px;
+                }
+                .el-icon-arrow-down{
+                  font-size: 16px;
+                   color: #aaa;
+
+                }
+              }
+               &.toggle{
+                  .el-icon-arrow-down{
+                     transform: rotateZ(180deg);
+                  }
+                  .itemList{
+                      max-height: 0px!important;
+                      opacity: 0;
+                      overflow: hidden;
+                  }
+                }
+              .itemList{
+                // transition: all  0.5s ;
+                opacity: 1;
+                max-height:4000px;
+                >div{
+                  cursor: pointer;
+                  color: #686868;
+                  display: flex;
+                  align-items: center;
+                  span{
+                    padding-right: 20px;
+                  }
+                  .userName{
+                    margin-right: auto;
+                  }
+                  &.active{
+                    background: #F5F5FB;
+                  }
+                  &.selectDisabled {
+                    pointer-events: none;
+                    background: #F5F5FB;
+                  }
+                }
+
+              }
+            }
+
+          }
+        }
+        .content_right{
+          h4{
+            padding: 14px 15px;
+            font-size: 14px;
+            color: #1D1D1D;
+          }
+          ul{
+            flex: 1;
+            overflow: auto;
+            /* 滚动条样式 */
+            &::-webkit-scrollbar {
+                /*滚动条整体样式*/
+                width: 8px;
+            }
+            &::-webkit-scrollbar-thumb {
+                /*滚动条里面小方块*/
+                border-radius: 3px;
+                background: #ECECEC;
+                opacity: 0.15;
+            }
+            li{
+              float: none;
+              padding: 0 20px;
+              box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.05);
+              line-height: 40px;
+              color: #686868;
+              display: flex;
+              align-items: center;
+              span{
+                padding-right: 20px;
+              }
+              .userName{
+                margin-right: auto;
+              }
+              i{
+                cursor: pointer;
+                font-size: 24px;
+                color: #AAAAAA;
+              }
+            }
+          }
+        }
+    }
+    p{
+      color: #2ABED1;
+      line-height: 24px;
+      padding: 20px 0 0;
+      text-align: center;
+      &.rootdialog{
+        color: #686868;
+        >span{
+          color: #2ABED1;
+        }
+      }
+    }
+    button{
+        width: 132px;
+        height: 36px;
+        background: transparent;
+        border-radius: 6px;
+        margin: 0 20px;
+        font-size: 16px;
+        &:active{
+            opacity: 0.8;
+        }
+    }
+    .save{
+        border: 1px solid #2ABED1;
+        color: #2ABED1;
+    }
+    .cancle{
+        border: 1px solid #e0e0e0;
+        color: #686868;
+    }
+    .ent_person_tip{
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      height: 32px;
+      margin-top: 20px;
+      padding: 0;
+      color: #F56500;
+      background: rgba(255, 159, 64, 0.08);
+      border-radius: 4px;
+      .tip_icon{
+        margin: 0 4px 2px 0;
+        width: 18px;
+        height: 18px;
+      }
+    }
+}

+ 4 - 0
src/web/staticres/css/dev2/biddingSearch.css

@@ -820,6 +820,10 @@ position: absolute;
   background: transparent url("/images/biddingSearch/icons-export.png") 10px center no-repeat;
   background-size: 18px 16px;
 }
+#searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn #right-distribute{
+  background: transparent url("/images/biddingSearch/distribute.png") 10px center no-repeat;
+  background-size: 20px;
+}
 #searchInner .tab-detail-list{
   position: relative;
 }

BIN
src/web/staticres/images/biddingSearch/distribute.png


+ 46 - 2
src/web/staticres/js/superSearch.js

@@ -313,7 +313,7 @@ function appendDatas(datas,flag,isNew,onlyUpdateTable){
 		if (!onlyUpdateTable){ //是否仅更新table
 			listHtml += '<li>'
         listHtml +='<div class="liLuceneList" style="border-bottom: 1px solid #EBEBEB;">'
-          listHtml += '<input class="custom-checkbox title-text-checkbox" name="bid-list" type="checkbox" dataid="'+datas[i]._id+'" />'
+          listHtml += '<input class="custom-checkbox title-text-checkbox" name="bid-list" type="checkbox" dataid="'+datas[i]._id+'" data-area="'+ datas[i].area+'"/>'
           listHtml +='<div class="list-container">'
             // 标题、推送时间
             listHtml += '<div class="bid-list-title">'
@@ -635,6 +635,8 @@ function appendDatas(datas,flag,isNew,onlyUpdateTable){
   checkVisited()
   // 生成dom之后再查询是否勾选
   getCheckList()
+
+  distributeInit() // 分发初始化
   /**
    * @date 2022/12/15 山川环境嵌入搜索
    * 更新是否已添加状态
@@ -1583,7 +1585,49 @@ function collectClick() {
     }
   })
 }
-
+function distributeInit(){
+  $.ajax({
+    type: 'get',
+    contentType: "application/json",
+    url: '/bigmember/isAdd',
+    success: function (r) {
+      if (r.data) {
+        if(r.data.entSubscribe == 1){
+          $('#right-distribute').show();
+          $('.line-distribute').show();
+        }  
+      }
+    }
+  })
+  $('#right-distribute').show();
+  $('.line-distribute').show();
+  $('#right-distribute').off('click').bind('click',function(e){
+    e.stopPropagation()
+    let len = $('.custom-checkbox:not(".check-all"):checked').length;
+    let checkedData = [] 
+    $('.custom-checkbox:not(".check-area"):checked').each(function(){
+      if ($(this).attr('data-area')) {
+        checkedData.push($(this).attr('data-area'))
+      }
+    })
+    if(len) {
+      if(checkedData.length !== 0){
+        // 拉起选择人员弹窗 有地区
+  
+      }else{
+        // 无地区
+        
+      }
+      person_Dialog.titleMsg = '选择分发人员'
+      person_Dialog.searchVal = ''
+      person_Dialog.centerDialogVisible = true
+      person_Dialog.selectDataIds = selectDataIds
+      person_Dialog.getData('yes')
+    }else{
+      toastFn('尚未选择公告,请选择', 1000)
+    }
+  })
+}
 /*******参标方法start**********/
 /*
   招标信息是否参标藏接口ajax

+ 405 - 0
src/web/templates/common/personDialog.html

@@ -0,0 +1,405 @@
+<link rel="stylesheet" href='{{Msg "seo" "cdn"}}/common-module/personDialog/personDialog.scss?v={{Msg "seo" "version"}}'>
+<div id="personDialog">
+  <div class="ent_powerPerson">
+    <el-dialog
+        :title="titleMsg"
+        class="ent_powerPerson_dialog"
+        :show-close="false"
+        :lock-scroll="false"
+        :close-on-click-modal="false"
+        :visible.sync="centerDialogVisible"
+        width="890px"
+        center>
+        <div class="content" v-loading="loading">
+            <div class="content_left">
+                <h4>选择</h4>
+                <div class="search">
+                  <el-input prefix-icon="el-icon-search" v-model="searchVal" placeholder="搜索" >
+                    <!-- <template slot="prepend">
+                      <img style="width: 20px;height: 20px" src="@/assets/images/search.png" alt="">
+                    </template> -->
+                  </el-input>
+                </div>
+                <div class="all" v-if="allQuan">
+                  <i class="seleced" :class="allChecked?'selectAll':'selectHalf'" @click="allToggle()" v-if="quan"></i>
+                  <i class="seleced" :class="allChecked?'selectAll':''" @click="allToggle()" v-else></i>
+                  <span class="noselect" @click="allToggle()">全选</span>
+                </div>
+                <div class="allList">
+                  <!-- <div v-for="(item,i) in deal_personList" :key="item.id" :class="{toggle:!item.toggle}">
+                    <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" :id="'up'+i"></i></h5>
+                    <div class="itemList" :id="'plays'+i">
+                       <div v-for="val in deal_personList" :key="val.user_id" @click="chooseUser(val,'single')" :class="{active:val.checked, 'selectDisabled':val.disabled}">
+                          <h5><i class="seleced" :class="{'selectAll':val.checked&&!val.disabled }"></i></h5>
+                          <span class="userName">{{ val.username }}</span> <span> {{ val.phone }}</span>
+                       </div>
+                    </div>
+                  </div> -->
+                  <div v-for="val in deal_personList" :key="val.id" @click="chooseUser(val,'single')" :class="{active:val.toggle, 'selectDisabled':val.disabled}">
+                    <h5>
+                      <i class="seleced" :class="{'selectAll':val.checked&&!val.disabled }"></i>
+                      <span class="userName">@@ val.name @@</span>
+                    </h5>
+                    <span> @@ val.phone @@</span>
+                  </div>
+                </div>
+            </div>
+            <div class="content_right">
+                <h4>已选</h4>
+                <ul>
+                  <li v-for="(item,i) in selectedList" :key="item.id">
+                    <span class="userName">@@ item.name @@</span>
+                    <span>@@ item.phone @@</span>
+                    <i class="el-icon-error" @click="delChooseUser(i)"></i>
+                    <!-- <p v-else style="width:24px;height:24px;"></p> -->
+                  </li>
+                </ul>
+            </div>
+        </div>
+        <!-- <p v-if="currentIndex !== 1 && pagetype!=='manage'">已选择{{ maxLength }}人共购买{{ personList.length }}人</p>
+        <p class="rootdialog" v-else>已选择 <span>{{ selectedList.length }}</span> 人共购买 <span>{{ empower_count }}</span> 人</p> -->
+        <p class="ent_person_tip" v-if="pagetype!==''">
+          <!-- <img class="tip_icon" src="@/assets/images/icon/guanyu.png" alt=""> -->
+          <span>注:同一人员只能拥有1个超级订阅或大会员产品权限,如需添加请删除该人员原有的产品权限</span>
+        </p>
+        <span slot="footer" class="dialog-footer btns">
+            <button :disabled="showBtn" @click="saveDepart" class="save">保存</button>
+            <button  @click="centerCancel" class="cancle">取消</button>
+        </span>
+      </el-dialog>
+</div>
+</div>
+<script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.7.14/vue.min.js></script>
+<script>
+  var person_Dialog = new Vue({
+    el: "#personDialog",
+    delimiters: ["@@", "@@"],
+    // template: temp,
+    data () {
+    return {
+      pagetype:'',
+      selectData:{},
+      userPerson:[],
+      list:[],
+      vt:'',
+      centerDialogVisible: false,
+      searchVal: '',
+      personList: {},
+      personSpareList: {},
+      selectedList: [],
+      checked: false,
+      titleMsg: '',
+      currentIndex: '0',
+      maxLength: '',
+      loading: true,
+      allChecked: false,
+      toggles: true,
+      yer: 0,
+      quan: false,
+      flags: true,
+      allQuan: true,
+      lastTime: '',
+      showBtn: false,
+      empower_count: 0, // 购买人数
+      selectDataIds: [],
+      filterType: false,
+      _scrollTop:''
+    }
+  },
+  created () {
+    this.$watch('searchVal', this.debounce((newValue, oldValue) => {
+      console.log(newValue, oldValue)
+      const searchList = []
+      if (this.personSpareList.length !== 0) {
+        this.personSpareList.forEach((v, i) => {
+          if (v.name.indexOf(newValue) !== -1 || v.phone.indexOf(newValue) !== -1) {
+            searchList.push(v)
+          }
+        })
+        this.personList = searchList
+      }
+      if (newValue === '') {
+        this.personList = this.personSpareList
+      }
+    }, 500))
+    this.$watch('centerDialogVisible', (newValue, oldValue) => {
+      if (newValue) {
+        this.afterOpen()
+      } else {
+        this.beforeClose()
+      }
+    })
+  },
+  watch: {
+    centerDialogVisible (newval) {
+      if (newval) {
+        this.searchVal = ''
+        if (!this.filterType) {
+          this.selectedList = []
+        } else {
+          this.selectedList = this.filterSelectList
+        }
+      }
+    }
+  },
+  computed: {
+    deal_personList: function () {
+      let arr = JSON.parse(JSON.stringify(this.personList))
+      if (arr && Object.keys(arr).length !== 0) {
+        let list = []
+        arr && arr.forEach((items, x) => {
+          this.selectedList.forEach((val, i) => {
+            if (items.checked) {
+              list.push(items.id)
+            } else {
+              if (items.id === val.id) {
+                items.checked = true
+                list.push(items.id)
+              } else {
+                items.checked = false
+              }
+            }
+          })
+          list = this.newArrFn(list)
+          if (list.length === arr.length) {
+            this.allChecked = true
+            this.maxLength = arr.length
+          } else {
+            if (list.length === 0) {
+              this.quan = false
+              this.allChecked = false
+              this.maxLength = 0
+            } else {
+              this.quan = true
+              this.allChecked = false
+              this.maxLength = list.length
+            }
+          }
+        })
+      } else {
+        arr = []
+      }
+      return arr
+    }
+  },
+  methods: {
+    debounce (fn, delay) {
+      let timer = null
+      return function () {
+        const arg = arguments
+        clearTimeout(timer)
+        timer = setTimeout(() => {
+          fn.apply(this, arg)
+        }, delay)
+      }
+    },
+    // 获取人员列表
+    async getData (flag = 'no', num) {
+      this.filterType = !!num
+      this.loading = true
+      const selectAreas = []
+      this.list.forEach((v, i) => {
+        this.selectDataIds.forEach((s, index) => {
+          if (v._id === s) {
+            if (v.area) {
+              selectAreas.push(v.area)
+            }
+          }
+        })
+      })
+      const params = {
+        region: num ? '' : selectAreas.toString(),
+        queryType: num || ''
+      }
+      const res = await getDistributor(this.vt, params)
+      if (res.error_code === 0 && res.data && res) {
+        // this.personList = data
+        this.personList = {}
+        this.loading = false
+        res.data.forEach(v => {
+          v.toggle = true
+          v.status = false
+        })
+        this.personList = res.data
+        this.personSpareList = res.data
+        if (flag === 'yes') {
+          if (this.searchVal) {
+            this.allQuan = false
+          }
+          return
+        }
+        this.maxLength = res.data.checked
+        if (this.pagetype !== 'manage') {
+          this.selectedList = res.data.checkedList
+        }
+        this.allChecked = true
+        if (res.data.checked === 0) {
+          this.quan = false
+        }
+      } else {
+        this.personList = {}
+        this.loading = false
+      }
+      if (this.searchVal === '') {
+        this.allQuan = true
+      }
+    },
+    // 数组去重
+    newArrFn (arr) {
+      if (!arr) return
+      return ([...new Set(arr)])
+    },
+    // 保存
+    saveDepart () {
+      // 设置定时器
+      let timer
+      // 设置现在的时间
+      const now = +new Date()
+      // 当现在的时间减去上次点击的时间小于3s时,给出提示,并结束执行函数
+      if (this.lastTime && now - this.lastTime < 3000) {
+        clearTimeout(timer)
+      } else {
+        // 若大于3s,则把现在的时间赋值个lastTime
+        this.lastTime = now
+        const delId = []
+        this.selectedList.forEach((v, i) => {
+          delId.push(v.id)
+        })
+        this.centerDialogVisible = false
+        if (delId.length !== 0) {
+          if (this.filterType) {
+            console.log('刷新?')
+           
+          } else {
+            getMsgDistributor({ messageId: getCaIndexIds.toString(), staffs: data }).then(res => {
+             if (res.error_code === 0) {
+              if (res.data === 1) {
+               this.$message({ message: '分发成功', type: 'success' })
+              } else {
+                this.$message({ message: res.error_msg, type: 'warning' })
+              }
+            } else {
+              this.$message({ message: res.error_msg, type: 'warning' })
+            }
+           })
+           
+          }
+        } else {
+          if (this.filterType) {
+            this.$message({ message: '请选择', type: 'warning' }) 
+          } else {
+            this.$message({ message: '请选择分发人员', type: 'warning' })
+          }
+        }
+      }
+    },
+    // 取消
+    centerCancel () {
+      this.centerDialogVisible = false
+      this.yer = 0
+      if (this.pagetype === 'manage') {
+        this.selectedList = []
+      }
+    },
+    // 全选
+    allToggle () {
+      this.allChecked = !this.allChecked
+      this.quan = !this.allChecked
+      if (Object.keys(this.personList).length !== 0) {
+        const datas = JSON.parse(JSON.stringify(this.personList))
+        this.selectedList = []
+        datas && datas.forEach((items, x) => {
+          if (this.allChecked) {
+            this.selectedList.push(items)
+          } else {
+            this.selectedList = []
+          }
+        })
+      } else {
+        this.selectedList = []
+      }
+    },
+    // 删除人员
+    delChooseUser (i) {
+      this.selectedList.splice(i, 1)
+      this.allChecked = false
+      console.log(this.selectedList.length)
+      if (this.selectedList.length === 0) {
+        this.quan = false
+      }
+    },
+    // 选择人员
+    chooseUser (val, status) {
+      if (status === 'single') {
+        const newArr = this.selectedList.filter(x => {
+          return val.id === x.id
+        })
+        let lengthId = 0
+        lengthId = this.deal_personList.length
+        if (newArr.length > 0) {
+          this.selectedList.forEach((v, i) => {
+            if (val.id === v.id) {
+              this.selectedList.splice(i, 1)
+            }
+          })
+          if (lengthId === this.selectedList.length) {
+            this.allChecked = true
+          } else {
+            this.allChecked = false
+          }
+          if (this.selectedList.length === 0) {
+            this.quan = false
+          }
+        } else {
+          if (lengthId === this.selectedList.length) {
+            this.allChecked = true
+          } else {
+            this.allChecked = false
+          }
+          this.selectedList.push(val)
+          const yer = []
+          this.deal_personList.forEach(v => {
+            if (v.status === 'selectAll') {
+              yer.push(v.status)
+            }
+          })
+          if (yer.length === this.deal_personList.length) {
+            this.allChecked = true
+          }
+          this.quan = true
+        }
+      } else {
+        this.selectedList = this.selectedList.concat(val)
+        if (this.pagetype === 'manage') {
+          this.selectedList.forEach((sum, k) => {
+            if (this.userPerson && this.userPerson.length !== 0) {
+              this.userPerson.forEach((s) => {
+                if (sum.phone === s.phone) {
+                  this.selectedList.splice(k, 1)
+                }
+              })
+            }
+          })
+        } else {
+          this.selectedList = this.selectedList.concat(val)
+        }
+      }
+    },
+      // popup 显示时调用
+   afterOpen () {
+    this._scrollTop = document.scrollingElement.scrollTop
+    document.body.style.position = 'fixed'
+    document.body.style.width = '100%'
+    document.body.style.top = -_scrollTop + 'px'
+  },
+
+  // popup 关闭时调用
+   beforeClose () {
+    document.body.style.position = ''
+    document.body.style.top = ''
+    // 使 scrollTop 恢复原状
+    document.scrollingElement.scrollTop = this._scrollTop
+  }
+  }
+  });
+</script>

+ 2 - 0
src/web/templates/pc/supsearch.html

@@ -1297,6 +1297,8 @@
             <div class="split-line"></div>
             <button id="bid-collect">标讯收藏</button>
             <div class="bi-report-inject-button" data-id="all">添加</div>
+            <div class="split-line line-distribute" style="display: none;"></div>
+            <button id="right-distribute" style="display: none;">分发</button>
           </div>
         </div>
         <div class="tabContainer" id="fix-tab" style="margin: 0">