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.
 
 
 
 
 

1 lines
18 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-8739f0fc"],{"1a86":function(e,t,a){"use strict";t.a={data:function(){return{isSearch:!1,total:null}},created:function(){},methods:{handleSizeChange:function(e){this.queryInfo.pageSize=e,this.initTable()},handleCurrentChange:function(e){this.queryInfo.pageNum=e,this.initTable()},searchClick:function(){this.isSearch=!this.isSearch}}}},"2e4b":function(e,t,a){"use strict";var r=a("c796");a.n(r).a},"895d":function(e,t,a){"use strict";a.r(t);a("4de4"),a("7db0"),a("4160"),a("a15b"),a("baa5"),a("d81d"),a("b0c0"),a("ac1f"),a("1276"),a("159b"),a("cca6"),a("96cf");var r=a("1da1"),s=a("2909"),o=a("5530"),i=a("2f62"),n=a("35cc"),l={mixins:[a("1a86").a],data:function(){return{type:0,queryForm:{},name2:"",dialogFormVisible:!1,editform:{},name:"",options:[],tableData:[],roleList1:[],passwordDialog:!1,roleList:[],roleType:[],editArr:[],serviceNetWork:[],use:[{id:0,label:"启用"},{id:1,label:"禁用"}],startPagination:"",endPagination:"",total:null,passwordField:{password:""},editFormRules:{userName:[{required:!0,message:"请输入用户名",trigger:"blur"}],email:[{validator:function(e,t,a){if(!t)return a(new Error("不能为空"));if(!/^([A-Za-z0-9_\-.])+@([A-Za-z0-9_\-.])+.([A-Za-z]{2,4})$/.test(t))return a(new Error("邮箱格式不正确"));a()},trigger:"blur",required:!0}],tel:[{validator:function(e,t,a){if(!t)return a(new Error("不能为空"));a()},trigger:"blur",required:!0}],name:[{required:!0,message:"请输入账号",trigger:"blur"}],role:[{required:!0,message:"请选择角色",trigger:"blur"}],inActive:[{required:!0,message:"请选择账号状态",trigger:"blur"}]},queryInfo:{pageSize:10,pageN0:1},searchConditions:{email:"",username:"",orgName:"",pageNo:1,pageSize:10},value:"",delArr:[],dataDialog:!1,tabsActive:"buyType",keywords:"",dataRoleObj:{userId:"",keyword:""},buyTable:[],orgTable:[],dataobj:{dataAuthType:"",corInvType:"",authorizedOrg:"",userId:""},defaultProps:{children:"child",label:"name"},isShowAuthImport:!1,authImportParams:{},importType:"用户授权"}},mounted:function(){this.getUserList(),this.getAllRole(),this.getOrganzitionList()},methods:Object(o.a)(Object(o.a)({},Object(i.b)({getBuyType:"Role/getBuyType",getOrg:"Role/getOrg",updateDataPermission:"Role/updateDataPermission",getDataAuth:"Role/getDataAuth"})),{},{resetClick:function(){},resetPassword:function(e){var t=this;"Administrator"!=e.roleName?Object(n.q)(e.id).then((function(e){200==e.status?t.$message.success(e.message):t.$message.error(e.message)})).catch((function(e){t.$message.error(e.message)})):this.$message.error("无此权限")},confirmDataRoleEdit:function(){var e=this;this.getCheckedKeys();var t=Object.assign({},this.dataobj);this.updateDataPermission(t).then((function(t){e.$message.success(t.message),e.closeDatatDialog()})).catch((function(t){e.$message.error(t.message)}))},getCheckedKeys:function(){var e=Object(s.a)(this.$refs.tree.getCheckedKeys());return this.dataobj.authorizedOrg=e.join(","),e},closeDatatDialog:function(){this.dataDialog=!1,this.dataobj={},this.$refs.tree.setCheckedKeys([]),this.$refs.buyType.clearSelection()},handleBuyTypeChange:function(e){this.dataobj.corInvType=e.map((function(e){return e.id})).join(",")},dataRole:function(e){var t=this;return Object(r.a)(regeneratorRuntime.mark((function a(){var r,s,o,i,n,l,c,u;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return r=e.id,s=Object.assign({},t.dataRoleObj),a.next=4,t.getDataAuth({userId:r});case 4:return o=a.sent,n=[],t.dataobj=o.result,i=""!=t.dataobj.corInvType?t.dataobj.corInvType.split(","):[],n=""!=t.dataobj.authorizedOrg?t.dataobj.authorizedOrg.split(","):[],s.userId=r,t.userId=r,a.prev=11,a.next=14,t.getBuyType(s);case 14:return l=a.sent,t.buyTable=l.result,c=[],i.length>0&&i.forEach((function(e){c.push(t.buyTable.find((function(t){return t.id==e})))})),a.next=20,t.getOrg(s);case 20:u=a.sent,t.orgTable=u.result,t.dataDialog=!0,t.$nextTick((function(){c.forEach((function(e){t.$refs.buyType.toggleRowSelection(e,!0)}))})),t.$nextTick((function(){t.$refs.tree.setCheckedKeys(n)})),a.next=30;break;case 27:a.prev=27,a.t0=a.catch(11),t.$message.error(a.t0.message);case 30:case"end":return a.stop()}}),a,null,[[11,27]])})))()},searchUser:function(){},cancelSetPassword:function(){this.passwordField={password:""},this.passwordDialog=!1},setPassword:function(e){this.passwordDialog=!0,this.scope=e},handleSizeChange:function(e){this.queryInfo.pageSize=e,this.getUserList()},handleCurrentChange:function(e){this.queryInfo.pageNum=e,this.getUserList()},confrimAddRole:function(){var e=this,t=Object.assign({},this.editform);this.$refs.editFormRef.validate(function(){var a=Object(r.a)(regeneratorRuntime.mark((function a(r){var s,o;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(r){a.next=3;break}return e.$message.error("请检查是否存在未填项!"),a.abrupt("return");case 3:if(0!=e.type){a.next=10;break}return a.next=6,Object(n.c)(t);case 6:200==(s=a.sent).status?(e.$message.success("添加用户成功!"),e.dialogFormVisible=!1,e.getUserList()):e.$message.error(s.message),a.next=14;break;case 10:return a.next=12,Object(n.i)(t);case 12:200==(o=a.sent).status?(e.$message.success("修改用户成功!"),e.getUserList(),e.dialogFormVisible=!1):e.$message.error(o.message);case 14:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}())},onSubmit:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(n.p)(e.searchConditions);case 2:a=t.sent,e.tableData=a.result.data,e.total=a.result.pagination.total;case 5:case"end":return t.stop()}}),t)})))()},getUserList:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(n.p)(e.queryInfo);case 3:a=t.sent,e.tableData=a.result.data,e.total=a.result.pagination.total,t.next=10;break;case 8:t.prev=8,t.t0=t.catch(0);case 10:case"end":return t.stop()}}),t,null,[[0,8]])})))()},getAllRole:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(n.o)({});case 3:a=t.sent,e.roleList=a.result.filter((function(e){return 1!=e.id})),t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:case"end":return t.stop()}}),t,null,[[0,7]])})))()},importExcel:function(){this.$refs.fileupload.click()},uploadExcel:function(e){var t=this;if("xlsx"==e.target.files[0].name.substring(e.target.files[0].name.lastIndexOf(".")+1)){var a;a="用户授权"==this.importType?"api/manager/user/uploadOrg":"api/manager/user/uploadApprove";var r=e.target.files[0],s=new FormData;s.append("file",r),this.$file.uploadFile(s,a).then((function(a){200==a.status&&(e.target.value=[],t.$message.success("导入文件成功!"),t.isShowAuthImport=!1)})).catch((function(a){e.target.value=[],t.$message.error(a.message)}))}else this.$message.warning("只支持.xlsx文件")},getOrganzitionList:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(n.n)({});case 3:a=t.sent,e.roleList1=a.result,t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:case"end":return t.stop()}}),t,null,[[0,7]])})))()},delData:function(e){var t=this;return Object(r.a)(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,Object(n.f)(e.id);case 3:if(200!=a.sent.status){a.next=9;break}t.$message.success("删除成功!"),t.getUserList(),a.next=10;break;case 9:throw"删除失败";case 10:a.next=15;break;case 12:a.prev=12,a.t0=a.catch(0),t.$message.error("删除失败");case 15:case"end":return a.stop()}}),a,null,[[0,12]])})))()},handleSelectionChange:function(e){this.editArr=e,this.delArr=[]},editDialog:function(e){this.dialogFormVisible=!0,this.type=1,this.editform=JSON.parse(JSON.stringify(e))},cancleDialog:function(){this.$refs.editFormRef.resetFields(),this.dialogFormVisible=!1},newDialog:function(){this.type=0,this.dialogFormVisible=!0,this.editform={}},authImport:function(){this.isShowAuthImport=!0},resetUpdateRoleForm:function(){this.$refs.editFormRef.resetFields()}})},c=(a("2e4b"),a("fc73"),a("2877")),u=Object(c.a)(l,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"takeDelivery",staticStyle:{padding:"20px"}},[a("div",{staticClass:"selectConditions"},[a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:e.searchConditions}},[a("el-form-item",{attrs:{label:"邮箱"}},[a("el-input",{attrs:{placeholder:"邮箱"},model:{value:e.searchConditions.email,callback:function(t){e.$set(e.searchConditions,"email",t)},expression:"searchConditions.email"}})],1),a("el-form-item",{attrs:{label:"用户名"}},[a("el-input",{attrs:{placeholder:"用户名"},model:{value:e.searchConditions.username,callback:function(t){e.$set(e.searchConditions,"username",t)},expression:"searchConditions.username"}})],1),a("el-form-item",{attrs:{label:"组织"}},[a("el-input",{attrs:{placeholder:"组织"},model:{value:e.searchConditions.orgName,callback:function(t){e.$set(e.searchConditions,"orgName",t)},expression:"searchConditions.orgName"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("查询")])],1)],1)],1),a("div",{staticClass:"location d-flex"},[a("div",{staticClass:"leftLocal d-flex"},[a("div",{staticClass:"d-flex"},[a("FeesButton",{attrs:{text:"新增",icon:"el-icon-circle-plus-outline"},on:{buttonClick:e.newDialog}}),a("FeesButton",{attrs:{text:"授权导入",icon:"el-icon-circle-plus-outline"},on:{buttonClick:e.authImport}})],1)])]),a("div",{staticClass:"bg-fff"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData,stripe:"",border:""}},[a("el-table-column",{attrs:{label:"操作",width:"240",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{staticClass:"text-color cursor",on:{click:function(a){return e.editDialog(t.row)}}},[e._v(" 编辑 ")]),a("span",{staticClass:"link-text-color m-left-1 cursor c-red",on:{click:function(a){return e.delData(t.row)}}},[e._v(" 删除 ")]),a("span",{staticClass:"link-text-color m-left-1 cursor text-color",on:{click:function(a){return e.dataRole(t.row)}}},[e._v(" 数据权限 ")]),a("el-popconfirm",{attrs:{"confirm-button-text":"确定重置","cancel-button-text":"取消",icon:"el-icon-info","icon-color":"red",title:"确定重置密码吗?"},on:{click:e.resetClick,confirm:function(a){return e.resetPassword(t.row)}}},[a("span",{staticClass:"link-text-color m-left-1 cursor",staticStyle:{color:"#909399"},attrs:{slot:"reference"},slot:"reference"},[e._v(" 重置密码 ")])])]}}])}),a("el-table-column",{attrs:{label:"用户名",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.userName))]}}])}),a("el-table-column",{attrs:{label:"账号",width:"180px",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.name))]}}])}),a("el-table-column",{attrs:{label:"邮箱",width:"180px",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.email))]}}])}),a("el-table-column",{attrs:{label:"电话",width:"180px",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e._f("filterTel")(t.row.tel,t.row.tel)))]}}])}),a("el-table-column",{attrs:{label:"组织",width:"180px",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.orgName))]}}])}),a("el-table-column",{attrs:{label:"状态",width:"80",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[0==t.row.inActive?a("div",[e._v("启用")]):a("div",[e._v("禁用")])]}}])}),a("el-table-column",{attrs:{label:"用户角色",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.roleName))]}}])})],1),a("div",{staticClass:"m-y-1"},[a("el-pagination",{attrs:{background:"","current-page":e.queryInfo.pageNo,"page-size":e.queryInfo.pageSize,"page-sizes":[10,20,30,50],layout:" prev, pager, next,total, sizes, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange,"update:currentPage":function(t){return e.$set(e.queryInfo,"pageNo",t)},"update:current-page":function(t){return e.$set(e.queryInfo,"pageNo",t)}}})],1)],1),a("el-dialog",{attrs:{title:0==e.type?"新增":"编辑",visible:e.dialogFormVisible},on:{"update:visible":function(t){e.dialogFormVisible=t},close:e.resetUpdateRoleForm}},[a("el-form",{ref:"editFormRef",attrs:{model:e.editform,"label-width":"100px",rules:e.editFormRules}},[a("el-form-item",{attrs:{label:"用户名",prop:"userName"}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.editform.userName,callback:function(t){e.$set(e.editform,"userName",t)},expression:"editform.userName"}})],1),a("el-form-item",{staticClass:"m-top-2",attrs:{label:"账号",prop:"name"}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.editform.name,callback:function(t){e.$set(e.editform,"name",t)},expression:"editform.name"}})],1),a("el-form-item",{staticClass:"m-top-2",attrs:{label:"手机号",prop:"tel"}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.editform.tel,callback:function(t){e.$set(e.editform,"tel",t)},expression:"editform.tel"}})],1),a("el-form-item",{staticClass:"m-top-2",attrs:{label:"Email",prop:"email"}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.editform.email,callback:function(t){e.$set(e.editform,"email",t)},expression:"editform.email"}})],1),a("el-form-item",{staticClass:"m-top-2",attrs:{label:"角色",prop:"role"}},[a("el-select",{staticClass:"w100",attrs:{placeholder:"请选择",filterable:""},model:{value:e.editform.role,callback:function(t){e.$set(e.editform,"role",t)},expression:"editform.role"}},e._l(e.roleList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{staticClass:"m-top-2",attrs:{label:"组织",prop:"role"}},[a("el-select",{staticClass:"w100",attrs:{placeholder:"请选择",filterable:""},model:{value:e.editform.orgId,callback:function(t){e.$set(e.editform,"orgId",t)},expression:"editform.orgId"}},e._l(e.roleList1,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{staticClass:"m-top-2",attrs:{label:"状态",prop:"inActive"}},[a("el-select",{staticClass:"w100",attrs:{placeholder:"请选择",filterable:""},model:{value:e.editform.inActive,callback:function(t){e.$set(e.editform,"inActive",t)},expression:"editform.inActive"}},e._l(e.use,(function(e){return a("el-option",{key:e.id,attrs:{label:e.label,value:e.id}})})),1)],1)],1),a("div",{staticClass:"dialog-footer d-flex j-fe",attrs:{slot:"footer"},slot:"footer"},[a("FeesButton",{attrs:{text:"取 消",icon:"el-icon-circle-close"},on:{buttonClick:e.cancleDialog}}),a("FeesButton",{directives:[{name:"debounce",rawName:"v-debounce",value:{time:500,methods:e.confrimAddRole},expression:"{ time: 500, methods: confrimAddRole }"}],attrs:{icon:"el-icon-circle-check",text:"确 定"}})],1)],1),a("el-dialog",{attrs:{title:"数据权限",visible:e.dataDialog},on:{"update:visible":function(t){e.dataDialog=t},"before-close":e.closeDatatDialog}},[a("el-tabs",{attrs:{type:"border-card"},model:{value:e.tabsActive,callback:function(t){e.tabsActive=t},expression:"tabsActive"}},[a("el-tab-pane",{attrs:{label:"采购类型",name:"buyType"}},[a("el-table",{ref:"buyType",staticStyle:{width:"100%"},attrs:{data:e.buyTable,"tooltip-effect":"dark"},on:{"selection-change":e.handleBuyTypeChange}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),a("el-table-column",{attrs:{label:"采购类型",prop:"name"}}),a("el-table-column",{attrs:{prop:"desc",label:"描述"}})],1)],1),a("el-tab-pane",{attrs:{label:"组织",name:"center"}},[a("el-tree",{ref:"tree",attrs:{data:e.orgTable,"show-checkbox":"","default-expand-all":"","node-key":"id","highlight-current":"",props:e.defaultProps},on:{getCheckedKeys:e.getCheckedKeys}})],1),a("el-tab-pane",{attrs:{label:"数据范围",name:"all"}},[a("el-radio-group",{model:{value:e.dataobj.dataAuthType,callback:function(t){e.$set(e.dataobj,"dataAuthType",t)},expression:"dataobj.dataAuthType"}},[a("el-radio-button",{attrs:{label:2}},[e._v("我的数据")]),a("el-radio-button",{attrs:{label:1}},[e._v("授权组织数据")]),a("el-radio-button",{attrs:{label:0}},[e._v("全部数据")])],1)],1)],1),a("div",{staticClass:"dialog-footer d-flex j-fe",attrs:{slot:"footer"},slot:"footer"},[a("FeesButton",{attrs:{text:"取 消",icon:"el-icon-circle-close"},on:{buttonClick:e.closeDatatDialog}}),a("FeesButton",{directives:[{name:"debounce",rawName:"v-debounce",value:{time:500,methods:e.confirmDataRoleEdit},expression:"{ time: 500, methods: confirmDataRoleEdit }"}],attrs:{text:"确 定",icon:"el-icon-circle-check"}})],1)],1),a("el-dialog",{attrs:{title:"授权导入",visible:e.isShowAuthImport},on:{"update:visible":function(t){e.isShowAuthImport=t}}},[a("el-form",{attrs:{model:e.authImportParams,"label-width":"100px"}},[a("el-form-item",{staticClass:"m-top-2",attrs:{label:"导入方式",prop:"role"}},[a("el-select",{staticClass:"w100",attrs:{placeholder:"请选择",filterable:""},model:{value:e.importType,callback:function(t){e.importType=t},expression:"importType"}},[a("el-option",{attrs:{label:"用户授权",value:"用户授权"}}),a("el-option",{attrs:{label:"审批权限",value:"审批权限"}})],1)],1),a("el-form-item",{staticClass:"m-top-2",attrs:{label:"",prop:"role"}},[a("el-button",{on:{click:e.importExcel}},[e._v("选择excel")]),a("input",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],ref:"fileupload",attrs:{type:"file",name:""},on:{change:function(t){return e.uploadExcel(t)}}})],1)],1)],1)],1)}),[],!1,null,"402cd912",null);t.default=u.exports},"9f29":function(e,t,a){},c796:function(e,t,a){},fc73:function(e,t,a){"use strict";var r=a("9f29");a.n(r).a}}]);