(this.webpackJsonp=this.webpackJsonp||[]).push([["chunk-094c"],{RkPV:function(t,e,a){"use strict";a.r(e);var i=a("bS4n"),n=a.n(i),l=a("X4fA"),o=a("t3Un");var s=a("8t5x"),r={name:"authDetail",data:function(){return{userId:"",addAuthDialogVisible:!1,authDialogVisible:!1,authForm:{},authData:[],listLoading:!0,pageSize:10,recordTotal:0,currentPage:1,pageTotal:0,tableKey:0,status:[{id:0,name:"已停用"},{id:1,name:"已启用"}],flagList:[{id:0,name:"标配"},{id:1,name:"无身份证阅读器"},{id:2,name:"无扫码枪"},{id:3,name:"全无"}],contractCode:"",flag:0}},computed:n()({},Object(s.b)(["userType","username"])),methods:{open:function(t){this.userId=t,this.authDialogVisible=!0,this.getAuthDataList()},getAuthDataList:function(){var t=this,e={};e.userId=this.userId,function(t){return Object(o.a)({headers:{Authorization:Object(l.a)()},url:"http://39.104.85.193:4105/auth/list",method:"get",params:t})}(e).then(function(e){var a=e.data;"200"===a.code&&(t.authData=a.result,t.listLoading=!1)})},changStatus:function(t,e){var a=this;(function(t){return Object(o.a)({headers:{Authorization:Object(l.a)()},url:"http://39.104.85.193:4105/auth/status",method:"post",data:t})})({id:t.id,status:e}).then(function(t){"200"===t.data.code&&(a.getAuthDataList(),a.$emit("getinfo"))})},deleteAuth:function(t){var e=this;(function(t){return Object(o.a)({headers:{Authorization:Object(l.a)()},url:"http://39.104.85.193:4105/auth/delete",method:"post",data:t})})({id:t.id}).then(function(t){"200"===t.data.code&&(e.getAuthDataList(),e.$emit("getinfo"))})},createAuthHandle:function(){this.addAuthDialogVisible=!0},createAuth:function(){var t=this;(function(t){return Object(o.a)({headers:{Authorization:Object(l.a)()},url:"http://39.104.85.193:4105/auth/create",method:"post",data:t})})({userId:this.userId,contractCode:this.contractCode,flag:this.flag}).then(function(e){"200"===e.data.code&&(t.getAuthDataList(),t.$emit("getinfo"),t.addAuthDialogVisible=!1)})}}},u=(a("o1xk"),a("ZrdR")),c=Object(u.a)(r,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{attrs:{visible:t.authDialogVisible,"modal-append-to-body":!1,"close-on-click-modal":!1,width:"900px"},on:{"update:visible":function(e){t.authDialogVisible=e}}},[a("div",{staticStyle:{"padding-bottom":"20px"}},[a("el-button",{directives:[{name:"show",rawName:"v-show",value:3!=t.userType,expression:"userType != 3"}],attrs:{type:"primary",plain:""},on:{click:t.createAuthHandle}},[t._v("生成授权码")])],1),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],key:t.tableKey,staticStyle:{width:"100%"},attrs:{data:t.authData,border:"",fit:"","highlight-current-row":""}},[a("el-table-column",{attrs:{type:"index",label:"",align:"center",width:"60"}}),t._v(" "),a("el-table-column",{attrs:{label:"授权码",prop:"authcode",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"合同编号",prop:"contractcode",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"状态",prop:"status",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(t.status,function(i){return a("div",[e.row.status===i.id?a("div",[t._v("\n "+t._s(i.name)+"\n ")]):t._e()])})}}])}),t._v(" "),a("el-table-column",{attrs:{label:"类型",prop:"status",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(t.flagList,function(i){return a("div",[e.row.flag===i.id?a("div",[t._v("\n "+t._s(i.name)+"\n ")]):t._e()])})}}])}),t._v(" "),a("el-table-column",{attrs:{label:"创建时间",prop:"createdat",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"最后登录时间",prop:"lasttime",align:"center"}}),t._v(" "),3!=t.userType?a("el-table-column",{attrs:{label:"操作",align:"center",width:"180","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[1===e.row.status?a("el-button",{attrs:{type:"text"},on:{click:function(a){t.changStatus(e.row,0)}}},[t._v("停用")]):a("el-button",{attrs:{type:"text"},on:{click:function(a){t.changStatus(e.row,1)}}},[t._v("启用")]),t._v(" "),a("el-button",{attrs:{type:"text"},on:{click:function(a){t.deleteAuth(e.row)}}},[t._v("删除")])]}}])}):t._e()],1),t._v(" "),a("el-dialog",{attrs:{visible:t.addAuthDialogVisible,"modal-append-to-body":!1,"close-on-click-modal":!1,width:"400px","append-to-body":""}},[a("el-input",{attrs:{placeholder:"请选择合同编号"},model:{value:t.contractCode,callback:function(e){t.contractCode=e},expression:"contractCode"}}),a("br"),t._v(" "),a("el-select",{attrs:{placeholder:"请选择类型"},model:{value:t.flag,callback:function(e){t.flag=e},expression:"flag"}},t._l(t.flagList,function(t){return a("el-option",{key:t.id,staticClass:"filter-item",attrs:{label:t.name,value:t.id}})})),t._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.addAuthDialogVisible=!1}}},[t._v("取消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:t.createAuth}},[t._v("确认")])],1)],1)],1)},[],!1,null,"6574dd6a",null);c.options.__file="authDetail.vue";e.default=c.exports},o1xk:function(t,e,a){"use strict";var i=a("o74K");a.n(i).a},o74K:function(t,e,a){}}]);
|