1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ae38c9cc"],{"0e8f":function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return i})),r.d(t,"e",(function(){return s})),r.d(t,"c",(function(){return l})),r.d(t,"d",(function(){return o}));var a=r("b775");function n(e){return Object(a["a"])({url:"/department/addDepartment",method:"post",data:e})}function i(e){return Object(a["a"])({url:"/department/deleteDepartment/"+e,method:"delete"})}function s(e){return Object(a["a"])({url:"/department/updateDepartment",method:"post",data:e})}function l(e){return Object(a["a"])({url:"/department/getDepartment/",method:"get",params:e})}function o(e){return Object(a["a"])({url:"/department/getDepartmentList",method:"post",data:e})}},"342f":function(e,t,r){},cec7:function(e,t,r){"use strict";var a=r("342f"),n=r.n(a);n.a},e382:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"app-container"},[r("div",{staticClass:"filter-container-child"},[r("el-input",{staticClass:"filter-item",staticStyle:{width:"150px"},attrs:{placeholder:"用户名..."},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleFilter(t)}},model:{value:e.filterQuery.queryUserName,callback:function(t){e.$set(e.filterQuery,"queryUserName",t)},expression:"filterQuery.queryUserName"}}),r("el-input",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{placeholder:"用户手机号..."},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleFilter(t)}},model:{value:e.filterQuery.userPhone,callback:function(t){e.$set(e.filterQuery,"userPhone",t)},expression:"filterQuery.userPhone"}}),r("el-input",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{placeholder:"身份证号码..."},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleFilter(t)}},model:{value:e.filterQuery.queryUserIdentityCard,callback:function(t){e.$set(e.filterQuery,"queryUserIdentityCard",t)},expression:"filterQuery.queryUserIdentityCard"}}),r("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.handleFilter}},[e._v("搜索")]),r("el-button",{directives:[{name:"show",rawName:"v-show",value:e.isShow,expression:"isShow"}],staticClass:"filter-item",attrs:{type:"success",icon:"el-icon-edit"},on:{click:e.handleCreate}},[e._v("添加用户")]),r("el-button",{staticClass:"filter-item",attrs:{type:"success",icon:"el-icon-edit"},on:{click:e.handleDowmExcel}},[e._v("导出Excel")]),r("el-button",{staticClass:"filter-item",attrs:{type:"success",icon:"el-icon-edit"},on:{click:e.handleDowmDemoExcel}},[e._v("导出样表")]),r("el-upload",{staticClass:"inline-block",attrs:{action:"","on-change":e.handleChange,"on-remove":e.handleRemove,"on-exceed":e.handleExceed,limit:e.limitUpload,accept:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel","auto-upload":!1}},[r("el-button",{directives:[{name:"show",rawName:"v-show",value:e.isShow,expression:"isShow"}],staticClass:"filter-item",attrs:{type:"warning",icon:"el-icon-edit"}},[e._v("导入Excel")])],1)],1),r("div",{staticClass:"filter-container-child"},[r("el-select",{staticStyle:{width:"150px"},attrs:{clearable:"",placeholder:"请选择所属部门"},model:{value:e.filterQuery.departmentId,callback:function(t){e.$set(e.filterQuery,"departmentId",t)},expression:"filterQuery.departmentId"}},e._l(e.departmentList,(function(e){return r("el-option",{key:e.departmentId,attrs:{label:e.departmentName,value:e.departmentId}})})),1),r("el-input",{staticClass:"filter-item",staticStyle:{width:"150px"},attrs:{placeholder:"用户备注信息..."},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleFilter(t)}},model:{value:e.filterQuery.userDescript,callback:function(t){e.$set(e.filterQuery,"userDescript",t)},expression:"filterQuery.userDescript"}}),r("el-select",{staticClass:"filter-item",staticStyle:{width:"150px"},model:{value:e.filterQuery.descOption,callback:function(t){e.$set(e.filterQuery,"descOption",t)},expression:"filterQuery.descOption"}},[r("el-option",{attrs:{value:"1",label:"降序"}}),r("el-option",{attrs:{value:"0",label:"升序",selected:"true"}})],1)],1),r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{data:e.list,"element-loading-text":"Loading",border:"",fit:"","highlight-current-row":""}},[r("el-table-column",{attrs:{align:"center",label:"ID",width:"70",type:"index"}}),r("el-table-column",{attrs:{"class-name":"status-col",label:"用户姓名",width:"100",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[null==t.row.userName||""==t.row.userName?r("span",[e._v("暂无信息")]):r("span",[e._v(" "+e._s(t.row.userName))])]}}])}),r("el-table-column",{attrs:{label:"所属部门名称",width:"150",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[null==t.row.departmentIdEntity.departmentName||""==t.row.departmentIdEntity.departmentName?r("span",[e._v("暂无信息")]):r("span",[e._v(" "+e._s(t.row.departmentIdEntity.departmentName))])]}}])}),r("el-table-column",{attrs:{label:"用户身份证号",width:"230",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[null==t.row.userIdentityCard||""==t.row.userIdentityCard?r("span",[e._v("暂无信息")]):r("span",[e._v(" "+e._s(t.row.userIdentityCard))])]}}])}),r("el-table-column",{attrs:{label:"用户备注信息",width:"150",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[null==t.row.userDescript||""==t.row.userDescript?r("span",[e._v("暂无信息")]):r("span",[e._v(" "+e._s(t.row.userDescript))])]}}])}),r("el-table-column",{attrs:{align:"center",prop:"created_at",label:"用户创建时间",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[null==t.row.userCreateTime||""==t.row.userCreateTime?r("span",[e._v("暂无信息")]):r("span",[e._v(" "+e._s(t.row.userCreateTime))])]}}])}),r("el-table-column",{attrs:{align:"center",prop:"created_at",label:"用户最近修改时间",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[null==t.row.userLastTime||""==t.row.userLastTime?r("span",[e._v("暂无信息")]):r("span",[e._v(" "+e._s(t.row.userLastTime))])]}}])}),r("el-table-column",{attrs:{align:"center",prop:"created_at",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-button",{directives:[{name:"show",rawName:"v-show",value:e.isShow,expression:"isShow"}],attrs:{type:"primary",size:"small"},on:{click:function(r){return e.handleUpdate(t.row)}}},[e._v("编辑")]),r("el-button",{directives:[{name:"show",rawName:"v-show",value:e.isShow,expression:"isShow"}],attrs:{type:"danger",size:"small"},on:{click:function(r){return e.deleteDate(t.row)}}},[e._v("删除")]),r("el-button",{directives:[{name:"show",rawName:"v-show",value:!e.isShow,expression:"!isShow"}],attrs:{type:"danger",size:"small"}},[e._v("暂无操作")])]}}])})],1),r("div",{staticStyle:{float:"right","margin-top":"30px"}},[r("el-pagination",{attrs:{background:"","current-page":e.currentPage,"page-sizes":[10,20,30,40],"page-size":10,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1),r("el-dialog",{attrs:{title:e.textMap[e.dialogStatus],visible:e.dialogFormVisible},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[r("el-form",{ref:"dataForm",attrs:{model:e.form,rules:e.rules}},[r("el-form-item",{staticClass:"dialogShow",attrs:{label:"用户真实姓名:",prop:"userName","label-width":e.formLabelWidth}},[r("el-input",{attrs:{placeholder:"请输入用户真实姓名",autocomplete:"off"},model:{value:e.form.userName,callback:function(t){e.$set(e.form,"userName",t)},expression:"form.userName"}})],1),r("el-form-item",{staticClass:"dialogShow",attrs:{label:"用户身份证号:",prop:"userIdentityCard","label-width":e.formLabelWidth}},[r("el-input",{attrs:{placeholder:"请输入用户身份证号",autocomplete:"off"},model:{value:e.form.userIdentityCard,callback:function(t){e.$set(e.form,"userIdentityCard",t)},expression:"form.userIdentityCard"}})],1),r("el-form-item",{attrs:{label:"所属部门名称:","label-width":"200px"}},[r("el-select",{staticStyle:{width:"150px"},attrs:{placeholder:"请选择所属部门"},on:{change:function(t){return e.$forceUpdate()}},model:{value:e.form.departmentId,callback:function(t){e.$set(e.form,"departmentId",t)},expression:"form.departmentId"}},e._l(e.departmentList,(function(e){return r("el-option",{key:e.departmentId,attrs:{label:e.departmentName,value:e.departmentId}})})),1)],1),r("el-form-item",{staticClass:"dialogShow",attrs:{label:"用户备注信息","label-width":e.formLabelWidth}},[r("el-input",{attrs:{placeholder:"请输入用户备注信息",autocomplete:"off"},model:{value:e.form.userDescript,callback:function(t){e.$set(e.form,"userDescript",t)},expression:"form.userDescript"}})],1)],1),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:e.handleCancle}},[e._v("取 消")]),r("el-button",{attrs:{type:"primary"},on:{click:function(t){"create"==e.dialogStatus?e.createData():e.updateData()}}},[e._v("确 定")])],1)],1)],1)},n=[],i=(r("5ab2"),r("6d57"),r("e10e"),r("47e7"),r("88d6")),s=r("c24f"),l=r("0e8f"),o=r("52c1");function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){Object(i["a"])(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d={data:function(){return{list:null,tempList:{},tempArr:[],tempUserWX:{},key:"",tempIndex:0,departmentList:{},feedTypeParentName:"",listLoading:!0,dialogFormVisible:!1,dialogStatus:"",textMap:{create:"添加用户信息",update:"修改用户信息"},form:{userName:"",phone:"",userDescript:"",departmentId:0},formLabelWidth:"150px",total:0,isShow:!0,downTime:"",currentPage:1,filterQuery:{userType:2,pageNum:1,pageSize:10},limitUpload:1,excelQuery:{},excelList:{},rules:{userName:[{required:!0,message:"真实姓名不能为空",trigger:"blur"},{pattern:/^[\u4e00-\u9fa5]{2,4}$/,message:"姓名长度在 2 到 4 个字符"}],userIdentityCard:[{required:!0,message:"身份证号码不能为空",trigger:"blur"},{min:15,max:18,message:"请输入正确的身份证号码"},{pattern:/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,message:"请输入正确的用户身份证号码"}]}}},computed:c({},Object(o["b"])(["orgId"])),created:function(){this.getList(),this.isShow=!(null===this.orgId)},methods:{getList:function(){var e=this;this.listLoading=!0,this.clearDialogData(),this.listLoading=!1,this.filterQuery.orgId=this.orgId,Object(s["e"])(this.filterQuery).then((function(t){e.total=t.data.total,e.list=t.data.list,e.total=t.data.total,Object(l["d"])({orgId:e.orgId}).then((function(t){e.departmentList=t.data.list})),e.listLoading=!1}))},handleCreate:function(){var e=this;this.clearDialogData(),this.form.departmentId=this.departmentList[0].departmentId,this.dialogFormVisible=!0,this.dialogStatus="create",this.$nextTick((function(){e.$refs["dataForm"].clearValidate()}))},handleUpdate:function(e){var t=this;this.dialogStatus="update",Object(s["d"])({userId:e.userId}).then((function(e){t.form=e.data})),this.dialogFormVisible=!0},handleFilter:function(){this.getList()},handleCancle:function(){this.clearDialogData(),this.dialogFormVisible=!1},clearDialogData:function(){this.form={}},createData:function(){var e=this;this.$refs["dataForm"].validate((function(t){t&&(e.form.orgId=e.orgId,e.form.userType=2,Object(s["a"])(e.form).then((function(t){e.$notify({title:"用户添加",message:t.msg,type:"success",duration:2e3}),200===t.status&&(e.dialogFormVisible=!1,e.getList())})))}))},deleteDate:function(e){var t=this;this.$confirm("此操作将永久删除该文件, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(s["b"])(e.userId).then((function(e){t.$notify({title:"删除用户",message:e.msg,type:200===e.status?"success":"error",duration:2e3}),200===e.status&&t.getList()}))})).catch((function(){t.$message({type:"info",message:"已取消删除"})}))},updateData:function(){var e=this;this.$refs["dataForm"].validate((function(t){t&&Object(s["g"])(e.form).then((function(t){e.dialogFormVisible=!1,e.clearDialogData(),e.$notify({title:"更新部门",message:t.msg,type:200===t.status?"success":"error",duration:2e3}),e.getList()}))}))},handleSizeChange:function(e){this.filterQuery.pageSize=e,this.getList()},handleCurrentChange:function(e){this.filterQuery.pageNum=e,this.getList()},handleDowmDemoExcel:function(){var e=this;this.$confirm("此操作将导出excel模板文件, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.downloadLoading=!0,e.downTime=e.moment(new Date).format("YYYY年MM月DD日 HH时mm分ss秒"),Promise.resolve().then(r.bind(null,"39a0")).then((function(t){var r=["用户姓名","所属部门名称","用户身份证号码","用户备注信息"],a="";t.export_json_to_excel({header:r,data:a,filename:"用户信息模板"+e.downTime}),e.downloadLoading=!1}))})).catch((function(){}))},handleDowmExcel:function(){var e=this;this.$confirm("此操作将导出excel文件, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.downloadLoading=!0,e.excelQuery.queryUserName=e.filterQuery.queryUserName,e.excelQuery.queryUserIdentityCard=e.filterQuery.queryUserIdentityCard,e.excelQuery.userPhone=e.filterQuery.userPhone,e.excelQuery.userIdentityCard=e.filterQuery.userIdentityCard,e.excelQuery.userDescript=e.filterQuery.userDescript,e.excelQuery.orgId=e.filterQuery.orgId,e.excelQuery.userType=e.filterQuery.userType,e.excelQuery.departmentId=e.filterQuery.departmentId,Object(s["e"])(e.excelQuery).then((function(t){e.excelList=t.data.list;for(var a=0;a<e.excelList.length;a++)e.excelList[a].departmentName=t.data.list[a].departmentIdEntity.departmentName;Promise.resolve().then(r.bind(null,"39a0")).then((function(t){var r=["用户姓名","所属部门名称","用户身份证号码","用户备注信息","用户创建时间","用户最近一次修改时间"],a=["userName","departmentName","userIdentityCard","userDescript","userCreateTime","userLastTime"],n=e.formatJson(a,e.excelList);e.downTime=e.moment(new Date).format("YYYY年MM月DD日 HH时mm分ss秒"),t.export_json_to_excel({header:r,data:n,filename:"用户信息表_"+e.downTime}),e.downloadLoading=!1}))})).catch((function(){}))}))},formatJson:function(e,t){return t.map((function(t){return e.map((function(e){return t[e]}))}))},handleChange:function(e,t){this.fileTemp=e.raw,this.fileTemp?"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"===this.fileTemp.type||"application/vnd.ms-excel"===this.fileTemp.type?this.importfxx(this.fileTemp):this.$message({type:"warning",message:"附件格式错误,请删除后重新上传!"}):this.$message({type:"warning",message:"请上传附件!"})},importfxx:function(e){var t=this;this.file=event.currentTarget.files[0];var a=!1,n=this.file,i=new FileReader;FileReader.prototype.readAsBinaryString=function(e){var a,n,i="",l=!1,o=new FileReader;o.onload=function(e){for(var u=new Uint8Array(o.result),c=u.byteLength,d=0;d<c;d++)i+=String.fromCharCode(u[d]);var m=r("f16e");a=l?m.read(btoa(fixdata(i)),{type:"base64"}):m.read(i,{type:"binary"}),n=m.utils.sheet_to_json(a.Sheets[a.SheetNames[0]]);var p=[];return n.map((function(e){var t={};t.userName=e["用户姓名"],t.departmentName=e["所属部门名称"],t.userIdentityCard=e["用户身份证号码"],t.userDescript=e["用户备注信息"],p.push(t)})),t.da=p,t.dalen=p.length,p.forEach((function(e){e.orgId=t.filterQuery.orgId,e.userType=t.filterQuery.userType,Object(s["a"])(e).then((function(e){t.getList()}))})),p},o.readAsArrayBuffer(e)},a?i.readAsArrayBuffer(n):i.readAsBinaryString(n)},handleExceed:function(){this.$message({type:"warning",message:"一次最多只能上传一个附件!"})},handleRemove:function(e,t){this.fileTemp=null}}},m=d,p=(r("cec7"),r("4023")),f=Object(p["a"])(m,a,n,!1,null,null,null);t["default"]=f.exports}}]);
|