| <div class="layui-card"> |
| <div class="layui-card-header"> |
| <h2 class="header-title">操作员管理</h2> |
| <span class="layui-breadcrumb pull-right"> |
| <a href="#">系统中心</a> |
| <a><cite>操作员管理</cite></a> |
| </span> |
| </div> |
| <div class="layui-card-body"> |
| <div id="operatorapp"> |
| <el-form :inline="true" ref="operatorform" :model="operatorform" data-parsley-validate class="form-horizontal form-label-left"> |
| |
| <div class="col-md-4"> |
| <div class="form-group"> |
| <label class="control-label col-md-4 col-sm-12 col-xs-12" style="font-size: 14px;">操作员编号:</span> |
| </label> |
| <div class="col-md-8 col-sm-12 col-xs-12"> |
| <el-input v-model="operatorform.operid"></el-input> |
| </div> |
| </div> |
| </div> |
| |
| <div class="col-md-4"> |
| <div class="form-group"> |
| <label class="control-label col-md-4 col-sm-12 col-xs-12" style="font-size: 14px;">姓名:</span> |
| </label> |
| <div class="col-md-8 col-sm-12 col-xs-12"> |
| <el-input v-model="operatorform.realname"></el-input> |
| </div> |
| </div> |
| </div> |
| <div class="col-md-3"> |
| <div class="form-group"> |
| <button type="button" class="btn btn-info" @click="query" id="oper_qrybtn">查 询</button> |
| <button class="btn btn-primary" type="button" @click="addOperator">添加操作员</button> |
| </div> |
| </div> |
| </el-form> |
| |
| <template> |
| <el-table |
| ref="singletable" |
| :data="tableData" |
| highlight-current-row |
| @current-change="currRowChange" |
| stripe |
| max-height="2000" |
| border |
| style="width: 100%"> |
| <el-table-column |
| prop="operid" |
| label="操作员号" |
| width="140"> |
| </el-table-column> |
| <el-table-column |
| prop="realname" |
| label="姓名" |
| width="140"> |
| </el-table-column> |
| <el-table-column |
| prop="opercode" |
| label="登录名" |
| width="160"> |
| </el-table-column> |
| <el-table-column |
| prop="opername" |
| label="操作员名称" |
| width="140"> |
| </el-table-column> |
| <el-table-column |
| prop="opertype" |
| label="操作员类别" |
| sortable |
| width="130"> |
| <template scope="scope"> |
| <el-tag type="success" v-if="scope.row.opertype=='楼栋管理员'">{{scope.row.opertype}}</el-tag> |
| <el-tag type="info" v-if="scope.row.opertype=='区域管理员'">{{scope.row.opertype}}</el-tag> |
| <el-tag type="warning" v-if="scope.row.opertype=='系统管理员'">{{scope.row.opertype}}</el-tag> |
| <el-tag type="danger" v-if="scope.row.opertype=='超级管理员'">{{scope.row.opertype}}</el-tag> |
| </template> |
| </el-table-column> |
| <el-table-column |
| prop="rolename" |
| label="角色" |
| width="140"> |
| </el-table-column> |
| <el-table-column |
| prop="status" |
| sortable |
| label="状态" |
| width="90"> |
| <template scope="scope"> |
| <el-tag :type="scope.row.status === '有效' ? 'success' : 'danger'" close-transition> |
| {{scope.row.status}} |
| </el-tag> |
| </template> |
| </el-table-column> |
| <el-table-column |
| prop="regionname" |
| label="管辖区域" |
| width="180"> |
| </el-table-column> |
| <el-table-column |
| prop="mobile" |
| label="联系电话" |
| width="180"> |
| </el-table-column> |
| <el-table-column |
| prop="companyname" |
| label="所属公司" |
| width="180"> |
| </el-table-column> |
| <el-table-column |
| prop="deptname" |
| label="所属部门" |
| width="180"> |
| </el-table-column> |
| <el-table-column |
| prop="email" |
| label="邮箱" |
| width="180"> |
| </el-table-column> |
| <el-table-column |
| prop="foperid" |
| label="创建人" |
| width="140"> |
| </el-table-column> |
| <el-table-column |
| fixed="right" |
| label="操作" |
| width="179"> |
| <template scope="scope"> |
| <button type="button" class="btn btn-info btn-xs" title="编辑操作员" @click="editOperator(scope.row.operid)" v-if="scope.row.opertype!='系统管理员'">编辑</button> |
| <button type="button" class="btn btn-success btn-xs" title="重置密码" @click="resetPwd(scope.row.operid)" v-if="scope.row.opertype!='系统管理员'" >重置</button> |
| <button type="button" class="btn btn-danger btn-xs" title="删除操作员" @click="delOperator(scope.row.operid)" v-if="scope.row.opertype!='系统管理员' && scope.row.opertype!='超级管理员' && scope.row.status=='有效'">删除</button> |
| <button type="button" class="btn btn-info btn-xs" title="分配楼栋" |
| @click="allotBuilding(scope.row.operid,scope.row.opername)" v-if="scope.row.opertype=='楼栋管理员'">分配楼栋 |
| </button> |
| </template> |
| </el-table-column> |
| </el-table> |
| <div class="clearfix"></div> |
| <el-pagination |
| @size-change="handleSizeChange" |
| @current-change="currPageChange" |
| :current-page="currPage" |
| :page-sizes="[10, 20, 50, 100]" |
| :page-size="pageSize" |
| layout="prev, pager, next,sizes, jumper,total" |
| :total="totSize"> |
| </el-pagination> |
| </template> |
| |
| <el-dialog :title="operatortitile" :visible.sync="dialogFormVisible" :modal-append-to-body='false' @close="closeDialog('operatorDiaForm')"> |
| <el-form ref="operatorDiaForm" :model="operatorDiaForm" :rules="rules" label-width="36%" > |
| <el-form-item label="操作员编号:" prop="operid"> |
| <div class="el-col el-col-15"> |
| <div class="el-input" style="width: 187px;"> |
| <el-input v-model="operatorDiaForm.operid"> |
| <i class="el-icon-edit el-input__icon" slot="icon" ></i> |
| </el-input> |
| </div> |
| </div> |
| </el-form-item> |
| |
| <el-form-item label="登录名:" prop="opercode"> |
| <div class="el-col el-col-18"> |
| <div class="el-input" style="width: 187px;"> |
| <el-input v-model="operatorDiaForm.opercode"> |
| <i class="el-icon-edit el-input__icon" slot="icon" ></i> |
| </el-input> |
| </div> |
| </div> |
| </el-form-item> |
| |
| <el-form-item label="操作员名称:" prop="opername"> |
| <div class="el-col el-col-18"> |
| <div class="el-input" style="width: 187px;"> |
| <el-input v-model="operatorDiaForm.opername"> |
| <i class="el-icon-edit el-input__icon" slot="icon" ></i> |
| </el-input> |
| </div> |
| </div> |
| </el-form-item> |
| |
| <el-form-item label="操作员类别:" prop="opertype"> |
| <el-col :span="18"> |
| <el-select v-model="operatorDiaForm.opertype" style="width: 187px;" |
| filterable |
| @Change="opertypeChange" |
| placeholder="请选择"> |
| <el-option |
| v-for="opertype in opertypes" |
| :key="opertype.value" |
| :label="opertype.label" |
| :value="opertype.value"> |
| </el-option> |
| </el-select> |
| </el-col> |
| </el-form-item> |
| |
| <el-form-item label="角色:" prop="roleid"> |
| <el-col :span="18"> |
| <el-select v-model="operatorDiaForm.roleid" |
| style="width: 187px;" clearable |
| filterable |
| placeholder="请选择"> |
| <el-option |
| v-for="roleid in roles" |
| :key="roleid.value" |
| :label="roleid.label" |
| :value="roleid.value"> |
| </el-option> |
| </el-select> |
| </el-col> |
| </el-form-item> |
| |
| <el-form-item label="管辖区域:" prop="regionid"> |
| <el-col :span="18"> |
| <el-select v-model="operatorDiaForm.regionid" |
| style="width: 187px;" clearable |
| filterable |
| :disabled="regionDis" |
| placeholder="请选择"> |
| <el-option |
| v-for="regionid in regions" |
| :key="regionid.value" |
| :label="regionid.label" |
| :value="regionid.value"> |
| </el-option> |
| </el-select> (注:区域管理员类别必选) |
| </el-col> |
| </el-form-item> |
| |
| <el-form-item label="联系方式:" prop="mobile"> |
| <el-col :span="18"> |
| <el-input v-model.number="operatorDiaForm.mobile" style="width: 187px;" maxlength="11"> |
| <i class="el-icon-edit el-input__icon" slot="icon" ></i> |
| </el-input> |
| </el-col> |
| </el-form-item> |
| |
| <el-form-item label="邮箱:" prop="email"> |
| <el-col :span="18"> |
| <el-input v-model="operatorDiaForm.email" style="width: 187px;" maxlength="60"> |
| <i class="el-icon-edit el-input__icon" slot="icon" ></i> |
| </el-input> |
| </el-col> |
| </el-form-item> |
| |
| <el-form-item label="姓名:" prop="realname"> |
| <el-col :span="18"> |
| <el-input v-model.number="operatorDiaForm.realname" style="width: 187px;" maxlength="16"> |
| <i class="el-icon-edit el-input__icon" slot="icon" ></i> |
| </el-input> |
| </el-col> |
| </el-form-item> |
| |
| <el-form-item label="所属公司:" prop="companyId"> |
| <el-col :span="18"> |
| <el-select v-model="operatorDiaForm.companyId" style="width: 187px;" |
| filterable |
| placeholder="请选择"> |
| <el-option |
| v-for="companyId in companys" |
| :key="companyId.value" |
| :label="companyId.label" |
| :value="companyId.value"> |
| </el-option> |
| </el-select> |
| </el-col> |
| </el-form-item> |
| |
| <el-form-item label="所属部门:" prop="deptcode"> |
| <el-col :span="18"> |
| <el-select v-model="operatorDiaForm.deptcode" style="width: 187px;" |
| filterable |
| placeholder="请选择"> |
| <el-option |
| v-for="deptcode in depts" |
| :key="deptcode.value" |
| :label="deptcode.label" |
| :value="deptcode.value"> |
| </el-option> |
| </el-select> |
| </el-col> |
| </el-form-item> |
| |
| </el-form> |
| <div slot="footer" class="dialog-footer"> |
| <el-button @click="resetForm('operatorDiaForm') ">取 消</el-button> |
| <el-button type="primary" @click="saveOperator('operatorDiaForm')">确 定</el-button> |
| </div> |
| </el-dialog> |
| |
| |
| <!--分配楼栋--> |
| <el-dialog :title="buildingTitle" :visible.sync="dlgAllotBuildingVisible" size="mini"top="80px" :modal-append-to-body='false' @close="closeOperBuildingDialog('operBuildingDiaform')"> |
| <el-form ref="operBuildingDiaform" :model="operBuildingDiaform" :rules="rules" label-width="100px" > |
| <el-form-item label="操作员:" prop="operid"> |
| <el-col :span="24"> |
| <el-select v-model="operBuildingDiaform.operid"> |
| <el-option |
| v-for="operid in operlist" |
| :key="operid.value" |
| :label="operid.label" |
| :value="operid.value" |
| > |
| </el-option> |
| </el-select> |
| </el-col> |
| </el-form-item> |
| <el-form-item label="选择楼栋:" prop="buildings"> |
| <template> |
| <el-transfer |
| v-model="allotbuilding" |
| :data="buildingList" |
| :target-keys="selectBuildingList" |
| :list-style="listStyle" |
| :operations="['移除','选择']" |
| :titles="['待选楼栋','已选楼栋']" |
| filterable |
| @on-change="buildingChange"> |
| </el-transfer> |
| </template> |
| </el-form-item> |
| </el-form> |
| |
| <div slot="footer" class="dialog-footer"> |
| <el-button @click="cancelBuildingOper('operBuildingDiaform')">取 消</el-button> |
| <el-button type="primary" @click="saveBuildingOper">确 定</el-button> |
| </div> |
| </el-dialog> |
| </div> |
| </div> |
| </div> |
| |
| <script> |
| var oper_validateOpercode = function (rule, value, callback) { |
| //console.log(value) |
| if (!value) { |
| return callback(new Error('请输入登录名')); |
| } |
| if (!(/^[0-9a-zA-Z]*$/.test(value))) { |
| callback(new Error('账号非法,请填入字母、数字或它们的组合')); |
| } |
| callback(); |
| }; |
| var oper_validateMobile = function (rule, value, callback) { |
| if (null != value && value.length > 0 && !(/^1\d{10}$/.test(value))) { |
| callback(new Error('请输出正确的手机号')); |
| } |
| callback(); |
| }; |
| var oper_validateEmail = function (rule, value, callback) { |
| if (null != value && value.length > 0 && !(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(value))) { |
| callback(new Error('邮箱格式不正确')); |
| } |
| callback(); |
| }; |
| |
| var oper_vue = new Vue({ |
| el:'#operatorapp', |
| data:{ |
| tableData:[], |
| currPage: 1, |
| pageSize:10, |
| totSize:0, |
| currentRow: null, |
| regionDis:true, |
| operatorform:{ |
| operid:'', |
| realname:'' |
| }, |
| roles:[], |
| dialogFormVisible: false, |
| regions:[], |
| opertypes:[], |
| companys:[], |
| depts:[], |
| operatorDiaForm:{ |
| operid:'', |
| opercode:'', |
| opername:'', |
| opertype:'', |
| roleid:'', |
| regionid:'', |
| mobile:'', |
| email:'', |
| realname:'', |
| companyId:'', |
| deptcode:'' |
| }, |
| buildingTitle:'', |
| dlgAllotBuildingVisible:false, |
| allotbuilding:[], |
| buildingList:[], |
| selectBuildingList:[], |
| listStyle: { |
| width: '318px', |
| height: '400px' |
| }, |
| operBuildingDiaform:{ |
| operid:'', |
| buildingids:[] |
| }, |
| operlist:[], |
| |
| rules:{ |
| operid:[ |
| {required:true,message:'请输入操作员编号',trigger:'blur'}, |
| { min: 1, max: 20, message: '长度在 1 到 32 个字符', trigger: 'blur' } |
| ], |
| opercode:[ |
| {required:true,message:'请输入登陆名',trigger:'blur'}, |
| { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }, |
| {validator: oper_validateOpercode, trigger: 'blur'} |
| ], |
| opername:[ |
| {required:true,message:'请输入操作员名称',trigger:'blur'}, |
| { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' } |
| ], |
| opertype: [ |
| {required: true, message: '请选择操作员类别', trigger: 'blur'} |
| ], |
| roleid: [ |
| {required: true, message: '请选择角色', trigger: 'blur'} |
| ], |
| mobile:[ |
| {validator: oper_validateMobile, trigger: 'blur'} |
| ], |
| email:[ |
| {validator: oper_validateEmail, trigger: 'blur'} |
| ], |
| companyId: [ |
| {required: true, message: '请选择所属公司', trigger: 'blur'} |
| ], |
| deptcode: [ |
| {required: true, message: '请选择所属部门', trigger: 'blur'} |
| ] |
| |
| }, |
| operatortitile:'添加操作员(默认密码为123456)', |
| }, |
| methods:{ |
| handleSizeChange:function(val) { |
| this.pageSize=val; |
| oper_commonQuery(this,this.operatorform.operid,this.operatorform.realname,this.currPage,val); |
| //console.log('每页条'+val); |
| }, |
| currPageChange:function(val) { |
| this.currPage=val; |
| oper_commonQuery(this,this.operatorform.operid,this.operatorform.realname,this.currPage,this.pageSize); |
| //console.log('当前页:'+val); |
| }, |
| currRowChange:function(val) { |
| this.currentRow = val; |
| }, |
| query:function(){ |
| this.pagesize=10; |
| this.currPage=1; |
| oper_commonQuery(this,this.operatorform.operid,this.operatorform.realname,this.currPage,this.pageSize); |
| }, |
| addOperator:function () { |
| oper_getFillData(this,"-1"); |
| this.dialogFormVisible = true; |
| this.operatortitile="添加操作员(默认密码为123456)" |
| }, |
| delOperator:function(operid){ |
| oper_deletedata(operid); |
| }, |
| editOperator:function(operid){ |
| oper_getFillData(this,operid); |
| this.dialogFormVisible = true; |
| this.operatortitile="修改操作员(默认密码为123456)" |
| }, |
| resetForm: function (formName) { |
| this.$refs[formName].resetFields(); |
| this.dialogFormVisible = false; |
| }, |
| closeDialog: function (formName) { |
| this.$refs[formName].resetFields(); |
| this.dialogFormVisible = false; |
| }, |
| saveOperator:function (formName) { |
| var _that=this; |
| var vali = false; |
| this.$refs[formName].validate( |
| function(valid){ |
| if (valid){ |
| vali = true; |
| }else{ |
| vali=false; |
| } |
| }); |
| if (vali==true){ |
| oper_saveData(_that,_that.operatorDiaForm,formName); |
| } |
| }, |
| opertypeChange: function (value) { |
| if (value == 'H') { |
| this.regionDis = false; |
| } else { |
| this.regionDis = true; |
| } |
| }, |
| resetPwd:function (operid) { |
| oper_resetpwd(operid); |
| }, |
| allotBuilding:function (operid,opername) { |
| this.buildingTitle="正在为["+opername+"]分配设备" |
| this.operlist.push({ |
| value: operid, |
| label: opername |
| }) |
| this.operBuildingDiaform.operid = operid |
| oper_getBuildingData(this,operid); |
| this.dlgAllotBuildingVisible=true; |
| |
| }, |
| buildingChange:function (newTargetKeys) { |
| this.selectBuildingList=newTargetKeys; |
| }, |
| cancelBuildingOper:function () { |
| this.allotbuilding=[]; |
| this.buildingList=[]; |
| this.operlist=[]; |
| this.dlgAllotBuildingVisible=false; |
| }, |
| closeOperBuildingDialog:function () { |
| this.allotbuilding=[]; |
| this.buildingList=[]; |
| this.operlist=[]; |
| this.dlgAllotBuildingVisible=false; |
| }, |
| saveBuildingOper:function () { |
| var _that = this; |
| var token=$("meta[name='_csrf_token']").attr("value"); |
| var operid = this.operBuildingDiaform.operid; |
| $.ajax({ |
| type: "POST", |
| url: "[[@{/system/saveOperBuildingBind?operid=}]]" + operid, |
| dataType: "json", |
| contentType: "application/json", |
| headers: { |
| 'Accept': 'application/json', |
| 'Content-Type': 'application/json', |
| 'X-CSRF-TOKEN':token, |
| }, |
| data: JSON.stringify(_that.allotbuilding), |
| success: function (data) { |
| if (data.okFlag==1){ |
| _that.dlgAllotBuildingVisible=false; |
| layer.msg(data.result, {icon: 1,time:2000}); |
| _that.selectBuildingList=[]; |
| }else{ |
| layer.msg(data.result, {icon: 2,time:2000}); |
| } |
| } |
| }); |
| } |
| }, |
| created:function(){ |
| var _self=this; |
| $.ajax({ |
| type:"get", |
| dataType:"json", |
| url:encodeURI("[[@{/operator/loadOperatorList}]]"), |
| success:function(ret){ |
| //console.log(ret); |
| _self.totSize=ret.PageResult.totalCount; |
| _self.tableData=ret.PageResult.list; |
| } |
| }) |
| } |
| }) |
| |
| function oper_refreshThisTable(){ |
| oper_commonQuery(oper_vue,oper_vue.operatorform.operid,oper_vue.operatorform.realname,oper_vue.currPage,oper_vue.pageSize); |
| }; |
| |
| function oper_commonQuery(_self,operid,realname,pageno,pagesize){ |
| $.ajax({ |
| type: "get", |
| dataType: "json", |
| url: encodeURI("[[@{/operator/loadOperatorList?operid=}]]"+operid+"&realname=" + realname + "&pageNo=" + pageno + "&pageSize=" + pagesize), |
| success: function (ret) { |
| _self.totSize = ret.PageResult.totalCount; |
| _self.tableData = ret.PageResult.list; |
| if (_self.totSize == 0) { |
| layer.msg("暂无数据", {icon: 2, time: 1000}); |
| } |
| } |
| }) |
| } |
| |
| function oper_deletedata(operid){ |
| layer.confirm('是否删除该操作员', {icon: 3, title:'请确认',offset:'30%'},function(index){ |
| $.ajax({ |
| type:"get", |
| dataType:"json", |
| url:"[[@{/operator/deleteOperator?operid=}]]"+operid, |
| success:function(ret){ |
| if(ret.message == undefined){ |
| layer.msg('用户认证已过期,请重新登录', {icon:2,time:1000}); |
| window.location="login"; |
| return; |
| } |
| if (ret.message != "") { |
| layer.msg(ret.message, {icon: 2, time: 1000}); |
| } else { |
| layer.msg('删除成功', {icon: 1, time: 1000}); |
| oper_refreshThisTable(); |
| } |
| } |
| }) |
| }) |
| } |
| |
| |
| function oper_getFillData(_self, id) { |
| $.ajax({ |
| type: "get", |
| dataType: "json", |
| url: encodeURI("[[@{/operator/loadOperatorForUpdate?operid=}]]" + id), |
| success: function (ret) { |
| var opertypelist = []; |
| var opertypes = ret.opertypes; |
| for (var i = 0; i < opertypes.length; i++) { |
| opertypelist.push({ |
| value: opertypes[i]["dictval"], |
| label: opertypes[i]["dictcaption"] |
| }); |
| } |
| _self.opertypes = opertypelist; |
| |
| if (ret.operator != null) { |
| _self.operatorDiaForm.operid = ret.operator.operid; |
| _self.operatorDiaForm.opercode = ret.operator.opercode; |
| _self.operatorDiaForm.opername = ret.operator.opername; |
| _self.operatorDiaForm.opertype = ret.operator.opertype; |
| _self.operatorDiaForm.roleid = ret.operator.roleid; |
| _self.operatorDiaForm.mobile = ret.operator.mobile; |
| _self.operatorDiaForm.email = ret.operator.email; |
| _self.operatorDiaForm.realname = ret.operator.realname; |
| _self.operatorDiaForm.regionid = ret.operator.regionid; |
| _self.operatorDiaForm.companyId = ret.operator.companyId; |
| _self.operatorDiaForm.deptcode = ret.operator.deptcode; |
| if (ret.operator.opertype == 'H') { |
| _self.regionDis = false; |
| } |
| } |
| |
| var rolelist = []; |
| var roles = ret.roles; |
| for (var j=0;j<roles.length;j++){ |
| rolelist.push({ |
| value:roles[j]["roleId"], |
| label:roles[j]["roleName"] |
| }); |
| } |
| _self.roles = rolelist; |
| |
| var regionlist = []; |
| var regions = ret.regions; |
| for (var z=0;z<regions.length;z++){ |
| regionlist.push({ |
| value:regions[z]["regionid"], |
| label:regions[z]["regionname"] |
| }); |
| } |
| _self.regions = regionlist; |
| |
| |
| var companylist = []; |
| var companys = ret.companys; |
| for (var k=0;k<companys.length;k++){ |
| companylist.push({ |
| value:companys[k]["companyId"], |
| label:companys[k]["companyName"] |
| }); |
| } |
| _self.companys = companylist; |
| |
| var deptlist=[]; |
| var depts = ret.depts; |
| deptlist.push({ |
| value:"0", |
| label:"全部" |
| }); |
| for (var k=0;k<depts.length;k++){ |
| deptlist.push({ |
| value:depts[k]["deptcode"], |
| label:depts[k]["deptname"] |
| }); |
| } |
| |
| _self.depts = deptlist; |
| |
| } |
| }) |
| } |
| |
| |
| |
| function oper_saveData(_that,formdata,formName){ |
| if (formdata.opertype=='H' && formdata.regionid==''){ |
| layer.msg('区域管理员请选择管辖区域!', {icon: 2, time: 1000}); |
| return; |
| } |
| var url = null; |
| if(oper_vue.operatortitile == "添加操作员(默认密码为123456)"){ |
| url = encodeURI("[[@{/operator/addOperator}]]"); |
| } |
| if(oper_vue.operatortitile == "修改操作员(默认密码为123456)"){ |
| url = encodeURI("[[@{/operator/updateOperator}]]") |
| } |
| var token=$("meta[name='_csrf_token']").attr("value"); |
| $.ajax({ |
| type: "POST", |
| url: url, |
| dataType: "json", |
| contentType: "application/json", |
| headers: { |
| 'Accept': 'application/json', |
| 'Content-Type': 'application/json', |
| 'X-CSRF-TOKEN':token, |
| }, |
| data: JSON.stringify(formdata), |
| success: function (data) { |
| if (data.errStr != "") { |
| layer.msg(data.errStr, {icon: 2,time:1000}); |
| } else { |
| layer.msg('保存信息成功!', {icon: 1,time:1000}); |
| oper_refreshThisTable(); |
| _that.$refs[formName].resetFields(); |
| _that.dialogFormVisible = false; |
| } |
| } |
| }); |
| } |
| |
| |
| function oper_resetpwd(operid){ |
| layer.confirm('是否重置该操作员密码?', {icon: 3, title:'请确认'}, function(index){ |
| $.ajax({ |
| type:"get", |
| dataType:"json", |
| url:"[[@{/operator/resetpwd?operid=}]]"+operid, |
| success:function(ret){ |
| //console.log(ret); |
| if(ret.code == undefined){ |
| layer.msg('用户认证已过期,请重新登录', {icon:2,time:1000}); |
| window.location="login"; |
| return; |
| } |
| if (ret.code != 200) { |
| layer.msg(ret.message, {icon:2,time:1000}); |
| }else{ |
| layer.msg("操作成功,密码重置为123456", {icon: 1,time:1000}); |
| |
| } |
| } |
| }) |
| }); |
| }; |
| |
| function oper_getBuildingData(_that,operid) { |
| $.ajax({ |
| type:"get", |
| dataType:"json", |
| url:encodeURI("[[@{/system/getBuildingList?operid=}]]"+operid), |
| success:function(ret){ |
| if (ret.flag==1){ |
| layer.msg(ret.result, {icon: 2,time:1000}); |
| return; |
| }else{ |
| var srcdata = []; |
| var trgdata=[]; |
| var buildinglist = ret.buildinglist; |
| |
| for (var i = 0; i < buildinglist.length; i++) { |
| srcdata.push({ |
| key: buildinglist[i].regionid+'#'+buildinglist[i].buildingid, |
| label: buildinglist[i].regionname+'->'+buildinglist[i].buildingname, |
| |
| }); |
| } |
| var buildinglisted = ret.buildinglisted; |
| for (var i = 0; i < buildinglisted.length; i++) { |
| trgdata.push(buildinglisted[i].regionid+'#'+buildinglisted[i].buildingid); |
| } |
| |
| _that.buildingList=srcdata; |
| _that.allotbuilding=trgdata; |
| } |
| } |
| }) |
| |
| } |
| |
| |
| |
| </script> |
| <style lang="scss"> |
| .el-checkbox-group.el-transfer-panel__list{ |
| height:277px; |
| } |
| |
| .el-dialog { |
| width: 900px; |
| } |
| .el-transfer-panel{ |
| width:347px; |
| } |
| .el-transfer-panel__body{ |
| height:360px; |
| width:345px; |
| } |
| |
| </style> |