You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wkcrm/static/js/chunk-7eaf.7aa1e182.js

1 line
7.4 KiB

4 years ago
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-7eaf"],{"20Z4":function(t,a,e){"use strict";e.r(a);var i=e("QbLZ"),s=e.n(i),n=e("t3Un");var l={name:"AddressBookIndex",components:{XhStructureCell:e("UCfG").a},data:function(){return{bookType:"",initStrucValue:[],listData:[],tableMap:[{label:"手机",key:"mobile"},{label:"部门",key:"structure_name"},{label:"岗位",key:"post"}],tableHeight:0,specialRowArr:[],currentPage:1,pageSizes:[15,30,60],pageSize:10,total:0,loading:!1,params:null}},created:function(){var t=this;this.bookType=this.$route.params.type,this.params=this.getDefaultParams(this.bookType),this.getList(),this.$nextTick(function(){t.tableHeight=document.getElementsByClassName("container-hook")[0].clientHeight-94})},beforeRouteUpdate:function(t,a,e){this.bookType=t.params.type,this.params=this.getDefaultParams(this.bookType),this.initStrucValue=[],this.listData=[],this.getList(),e()},methods:{getList:function(){var t,a=this;this.loading=!0,(t=this.params,Object(n.a)({url:"oa/addresslist/queryList",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})).then(function(t){a.loading=!1,a.total=t.data.totalRow,a.listData=t.data.list||[]}).catch(function(){a.loading=!1})},getDefaultParams:function(t){var a={page:1,limit:15,structure_id:"",search:"",initials:1};return"attention"==this.bookType&&(a.star_type=1),a},formatList:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this.specialRowArr=[],this.listData=[],0===t.length)return[];var a=[],e={structure_id:"",deptName:"",mobile:"",postName:"",realname:""};a.push(s()({},e,{initials:t[0].initials})),this.specialRowArr.push(0),a.push(t[0]);for(var i=1;i<t.length;i++){var n=t[i];n.initials===a[a.length-1].initials?a.push(n):(this.specialRowArr.push(a.length),a.push(s()({},e,{initials:n.initials})),a.push(n))}this.listData=a},getRowClass:function(t){return this.specialRowArr.includes(t.rowIndex)?"special-row":""},sortTableList:function(t){"ascending"===t.order?this.params.initials=1:"descending"===t.order&&(this.params.initials=2),this.getList()},toggleStar:function(t,a){var e,i=this;this.loading=!0,(e={target_id:this.listData[t].id,type:"admin_user"},Object(n.a)({url:"oa/addresslist/userStar",method:"post",data:e})).then(function(){i.loading=!1,i.listData[t].star=0===a?1:0,i.$set(i.listData,t,i.listData[t])}).catch(function(){i.loading=!1})},handleSizeChange:function(t){this.params.limit=t,this.getList()},handleCurrentChange:function(t){this.params.page=t,this.getList()},structureChange:function(t){this.initStrucValue=t.value,this.params.page=1,this.params.structure_id=t.value.length?t.value[0].id:"",this.getList()}}},r=(e("fF07"),e("KHd+")),o=Object(r.a)(l,function(){var t=this,a=t.$createElement,i=t._self._c||a;return i("div",{staticClass:"address-book-index"},[i("div",{staticClass:"header"},[i("flexbox",{staticClass:"title"},[i("img",{staticClass:"pic",attrs:{src:e("r9DG"),alt:""}}),t._v(" "),i("span",{staticClass:"text"},[t._v("通讯录")])]),t._v(" "),i("el-input",{attrs:{placeholder:"请输入员工姓名/手机号"},model:{value:t.params.search,callback:function(a){t.$set(t.params,"search",a)},expression:"params.search"}},[i("el-button",{attrs:{slot:"append",type:"primary"},on:{click:t.getList},slot:"append"},[t._v("\n 搜索\n ")])],1)],1),t._v(" "),i("div",{staticClass:"container container-hook"},[i("flexbox",{staticClass:"filter"},[i("span",{staticClass:"filter__label"},[t._v("选择部门")]),t._v(" "),i("xh-structure-cell",{staticClass:"xh-structure-cell",attrs:{value:t.initStrucValue,radio:""},on:{"value-change":t.structureChange}})],1),t._v(" "),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"n-table--border",attrs:{data:t.listData,height:t.tableHeight,stripe:"",border:""},on:{"sort-change":t.sortTableList}},[i("el-table-column",{attrs:{label:"字母",align:"center",prop:"initials",width:"90"}}),t._v(" "),i("el-table-column",{attrs:{prop:"realname",label:"姓名"},scopedSlots:t._u([{key:"default",fn:function(a){ret