webpackJsonp([93],{

/***/ "hPw6":
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),

/***/ "wEa3":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });

// EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/json/stringify.js
var stringify = __webpack_require__("mvHQ");
var stringify_default = /*#__PURE__*/__webpack_require__.n(stringify);

// EXTERNAL MODULE: ./src/api/index.js + 5 modules
var api = __webpack_require__("gyMJ");

// EXTERNAL MODULE: ./src/utils/index.js
var utils = __webpack_require__("0xDb");

// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/doorMagnetism/userManagementHouse.vue

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//



/* harmony default export */ var userManagementHouse = ({
	name: "alarmRecord",
	data: function data() {
		return {
			rules: {
				region: [{
					required: true,
					message: '请选择所属单位',
					trigger: 'blur'
				}],
				personname: [{
					required: true,
					message: '请输入姓名',
					trigger: 'blur'
				}],
				phone: [{
					required: true,
					message: '请输入手机号',
					trigger: 'blur'
				}],
				password: [{
					required: true,
					message: '请输入密码',
					trigger: 'blur'
				}]
			},
			rules1: {
				oldPassword: [{
					required: true,
					message: '请输入旧密码',
					trigger: 'blur'
				}],
				newPassword: [{
					required: true,
					message: '请输入新密码',
					trigger: 'blur'
				}],
				confirmPassword: [{
					required: true,
					message: '请输入新密码',
					trigger: 'blur'
				}]
			},
			modifyfrom: {
				oldPassword: '',
				newPassword: '',
				confirmPassword: ''
			},
			titleText: '',
			textarea: '', //批量处理备注
			dialogVisible: false,
			dialogVisible1: false,
			form: {
				personname: '',
				password: '',
				name: '',
				region: '',
				phone: ''
			},
			input: '',
			content: '切换单个/多个查询模式',
			selected: true,
			advancedQueryStatus: false,
			advancedQueryText: '高级查询',
			formInline: {
				enterpriseId: '',
				username: '',
				rolo: '',
				phone: ''
			},
			tableData: [],
			pageTotal: 0,
			rowStyle: {
				background: '#f8f9fa',
				fontSize: '12px'
			},
			multipleSelection: [],
			currentPage: 1,
			pageSize: 10,
			batch: true,
			enterpriselist: [{
				name: '全部',
				id: ''
			}],
			zNodes: [],
			info: '',
			userRow: '',
			tenantId: ''
		};
	},

	computed: {},
	beforeCreate: function beforeCreate() {
		this.$store.commit('updateTenantId', 400);
	},
	created: function created() {
		this.info = JSON.parse(localStorage.getItem('info'));
		this.tenantId = JSON.parse(localStorage.getItem('tenantId'));
		this.getEnterprise();
	},
	mounted: function mounted() {},

	methods: {
		// 保存修改密码
		saveEdit: function saveEdit() {
			var _this = this;

			if (this.modifyfrom.confirmPassword == '' || this.modifyfrom.newPassword == '' || this.modifyfrom.oldPassword == '') {
				this.$message.error("请填写好信息");
			} else if (this.modifyfrom.confirmPassword != this.modifyfrom.newPassword) {
				this.$message.error("确认密码输入错误！");
			} else {
				var data = {
					userId: this.userRow.id,
					new: this.modifyfrom.newPassword,
					old: this.modifyfrom.oldPassword
				};
				Object(api["g" /* httpPost */])(data, this.$api.editPassword).then(function (res) {
					if (res.success) {
						_this.$message.success("修改成功！");
						_this.dialogVisible1 = false;
					} else {
						_this.$message.error("请输入正确的旧密码！");
					}
				});
			}
		},

		// 修改密码
		modifyPassword: function modifyPassword(index, row) {
			this.titleText = row.username;
			this.dialogVisible1 = true;
			this.userRow = row;
			this.modifyfrom = {
				oldPassword: '',
				newPassword: '',
				confirmPassword: ''
			};
		},

		// 判断字段是否有效
		paramsValidate: function paramsValidate(obj) {
			var array = {};
			for (var key in obj) {
				if (obj[key]) {
					array[key] = obj[key];
				}
			}
			return array;
		},

		// 搜索
		searchFun: function searchFun() {
			var _this2 = this;

			var formInline = this.formInline;
			var q = this.paramsValidate(formInline);
			var data = {
				pageNum: this.currentPage,
				pageSize: this.pageSize,
				q: stringify_default()(q)
			};
			Object(api["d" /* httpGet */])(data, this.$api.getUserList).then(function (res) {
				if (res.success) {
					res.data.list.map(function (li) {
						var obj = _this2.enterpriselist.find(function (x) {
							return x.id == li.enterpriseId;
						});
						if (obj) {
							li.enterpriseName = obj.name;
						} else {
							li.enterpriseName = '';
						}
					});
					_this2.tableData = res.data.list;
					_this2.pageTotal = res.data.total;
				} else {
					_this2.$message.error("获取失败");
				}
			});
		},

		// 重置搜索
		reset: function reset() {
			this.formInline = {
				enterpriseId: '',
				username: '',
				rolo: '',
				phone: ''
			};
		},

		// 删除用户操作
		handleDelete: function handleDelete(index, row) {
			var _this3 = this;

			// 二次确认删除
			this.$confirm("确定要删除吗？", "提示", {
				type: "warning"
			}).then(function () {
				var data = [row.id];
				Object(api["g" /* httpPost */])(data, _this3.$api.deleteUser).then(function (res) {
					if (res.success) {
						_this3.$message.success("删除成功");
						_this3.getUserList();
					} else {
						_this3.$message.error("删除失败");
					}
				});
			}).catch(function () {});
		},

		// 人员
		addEnterprise: function addEnterprise() {
			var _this4 = this;

			var form = this.form;
			if (form.region == "") {
				this.$message.error("请选择所属单位");
			} else if (form.phone == "" || form.password == "" || form.personname == "") {
				this.$message.error("请填写完整信息");
			} else {
				var enterpriseName = '';
				this.enterpriselist.map(function (li) {
					if (li.id == form.region) {
						enterpriseName = li.name;
					}
				});
				var addform = {
					username: form.personname,
					phone: form.phone,
					password: form.password,
					enterpriseName: enterpriseName,
					userType: 1,
					tenantId: this.tenantId,
					enterpriseId: form.region
				};
				Object(api["g" /* httpPost */])(addform, this.$api.addUser).then(function (res1) {
					if (res1.success) {
						_this4.$message.success("创建成功");
						_this4.dialogVisible = false;
						_this4.getUserList();
					} else {
						_this4.$message.error("添加失败");
						_this4.dialogVisible = false;
					}
				});
			}
		},

		// 获取单位
		getEnterprise: function getEnterprise() {
			var _this5 = this;

			var data = {
				q: stringify_default()({
					name: this.formInline.name
				})
			};
			Object(api["d" /* httpGet */])(data, this.$api.getEnterprise).then(function (res) {
				if (res.success) {
					_this5.enterpriselist = res.data.list;
					_this5.zNodes = [];
					_this5.zNodes = Object(utils["p" /* ztreeToElementTree */])(res.data.list, {});
					_this5.getUserList();
				} else {
					_this5.$message.error("获取失败");
				}
			});
		},

		// 获取用户列表
		getUserList: function getUserList() {
			var _this6 = this;

			var data = {
				pageNum: this.currentPage,
				pageSize: this.pageSize,
				q: stringify_default()({
					enterpriseId: this.enterpriseId
				})
			};
			Object(api["d" /* httpGet */])(data, this.$api.getUserList).then(function (res) {
				if (res.success) {
					res.data.list.map(function (li) {
						var obj = _this6.enterpriselist.find(function (x) {
							return x.id == li.enterpriseId;
						});
						if (obj) {
							li.enterpriseName = obj.name;
						} else {
							li.enterpriseName = '';
						}
					});
					_this6.tableData = res.data.list;
					_this6.pageTotal = res.data.total;
				} else {
					_this6.$message.error("获取失败");
				}
			});
		},

		// 未处理记录打开
		recordFun: function recordFun() {
			this.dialogVisible1 = true;
		},

		// 未处理记录处理关闭
		handleClose1: function handleClose1(done) {
			done();
		},

		// 批量处理关闭
		handleClose: function handleClose(done) {
			done();
		},

		// 批量处理
		batchProcessing: function batchProcessing() {
			this.dialogVisible = true;
		},

		// 分页
		handleSizeChange: function handleSizeChange(val) {
			console.log("\u6BCF\u9875 " + val + " \u6761");
			this.pageSize = val;
			this.searchFun();
		},
		handleCurrentChange: function handleCurrentChange(val) {
			console.log("\u5F53\u524D\u9875: " + val);
			this.currentPage = val;
			this.searchFun();
		},

		// 表头样式
		rowClass: function rowClass(_ref) {
			var row = _ref.row,
			    rowIndex = _ref.rowIndex;

			return "background:#f8f9fa;color:#333;font-blod:none;font-size:12px;";
		},

		// 表格勾选
		handleSelectionChange: function handleSelectionChange(val) {
			if (val.length > 0) {
				this.batch = false;
			} else {
				this.batch = true;
			}
		},

		// 高级查询显示
		advancedQueryFun: function advancedQueryFun() {
			if (this.advancedQueryStatus) {
				this.advancedQueryText = "高级查询";
				this.advancedQueryStatus = false;
			} else {
				this.advancedQueryText = "同用查询";
				this.advancedQueryStatus = true;
			}
		},

		// 批量处理备注监控
		textareaFun: function textareaFun(e) {
			this.textarea = e;
		},

		// 输入监控
		InputFun: function InputFun(e) {
			console.log(e);
		},

		// 单个/多个查询切换
		switchFun: function switchFun() {
			this.selected = !this.selected;
		}
	}

});
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-04c0b5e1","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/views/doorMagnetism/userManagementHouse.vue
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":"container"}},[_c('div',{staticClass:"alarmrecord"},[_c('el-card',{staticClass:"box-card"},[_c('el-row',{},[_c('div',{staticClass:"search"},[_c('el-form',{staticClass:"demo-form-inline",attrs:{"inline":true,"model":_vm.formInline}},[_c('el-form-item',{attrs:{"label":"用户名称："}},[_c('el-input',{attrs:{"placeholder":"请输入用户名称","size":"small","clearable":true},model:{value:(_vm.formInline.username),callback:function ($$v) {_vm.$set(_vm.formInline, "username", $$v)},expression:"formInline.username"}})],1),_vm._v(" "),_c('el-form-item',{attrs:{"label":"手机号："}},[_c('el-input',{attrs:{"placeholder":"请输入用户手机号","size":"small","clearable":true},model:{value:(_vm.formInline.phone),callback:function ($$v) {_vm.$set(_vm.formInline, "phone", $$v)},expression:"formInline.phone"}})],1),_vm._v(" "),_c('el-form-item',{attrs:{"label":"角色："}},[_c('el-input',{attrs:{"placeholder":"请选择角色","size":"small","clearable":true},model:{value:(_vm.formInline.rolo),callback:function ($$v) {_vm.$set(_vm.formInline, "rolo", $$v)},expression:"formInline.rolo"}})],1),_vm._v(" "),_c('el-form-item',{attrs:{"label":"所属单位："}},[_c('el-select',{staticClass:"w200",attrs:{"size":"small","placeholder":"请选择活动区域","clearable":""},model:{value:(_vm.formInline.enterpriseId),callback:function ($$v) {_vm.$set(_vm.formInline, "enterpriseId", $$v)},expression:"formInline.enterpriseId"}},_vm._l((_vm.enterpriselist),function(item){return _c('el-option',{key:item.id,attrs:{"label":item.name,"value":item.id}})}),1)],1),_vm._v(" "),_c('el-form-item',[_c('el-button',{attrs:{"type":"default","size":"small"},on:{"click":_vm.reset}},[_vm._v("重置")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary","size":"small"},on:{"click":_vm.searchFun}},[_vm._v("查询")])],1)],1)],1)]),_vm._v(" "),_c('el-row',{staticClass:"marginTop"},[_c('div',{staticClass:"tablecell"},[_c('el-row',{staticClass:"floatRight"},[_c('el-button',{attrs:{"type":"primary","size":"mini"},on:{"click":_vm.batchProcessing}},[_vm._v("新增")])],1),_vm._v(" "),_c('el-table',{ref:"multipleTable",staticStyle:{"width":"100%"},attrs:{"data":_vm.tableData,"border":true,"tooltip-effect":"dark","header-cell-style":_vm.rowClass,"cell-style":{fontSize:'12px'},"stripe":"","height":"590"},on:{"selection-change":_vm.handleSelectionChange}},[_c('el-table-column',{attrs:{"type":"index","width":"50","label":"序号"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"username","label":"用户姓名","width":"120"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"enterpriseName","label":"所属单位","width":"120"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"phone","label":"手机号","show-overflow-tooltip":""}}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"操作","width":"300"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_c('el-button',{attrs:{"type":"default","size":"mini","disabled":_vm.info.enterpriseId==scope.row.id?true:false},on:{"click":function($event){return _vm.modifyPassword(scope.$index, scope.row)}}},[_vm._v("密码")]),_vm._v(" "),_c('el-button',{attrs:{"type":"danger","size":"mini","disabled":_vm.info.enterpriseId==scope.row.id?true:false},on:{"click":function($event){return _vm.handleDelete(scope.$index, scope.row)}}},[_vm._v("删除")])]}}])})],1)],1),_vm._v(" "),_c('div',{staticClass:"page"},[_c('el-pagination',{attrs:{"current-page":_vm.currentPage,"page-sizes":[10, 20, 100, 400],"page-size":_vm.pageSize,"layout":"total, sizes, prev, pager, next, jumper","total":_vm.pageTotal},on:{"size-change":_vm.handleSizeChange,"current-change":_vm.handleCurrentChange}})],1)])],1),_vm._v(" "),_c('el-dialog',{attrs:{"title":"添加人员","visible":_vm.dialogVisible,"width":"30%","before-close":_vm.handleClose},on:{"update:visible":function($event){_vm.dialogVisible=$event}}},[_c('el-form',{ref:"form",attrs:{"model":_vm.form,"label-width":"120px","inline":true,"rules":_vm.rules}},[_c('el-form-item',{attrs:{"label":"所属单位","prop":"region"}},[_c('el-select',{staticClass:"w200",attrs:{"placeholder":"请选择所属单位"},model:{value:(_vm.form.region),callback:function ($$v) {_vm.$set(_vm.form, "region", $$v)},expression:"form.region"}},_vm._l((_vm.enterpriselist),function(item){return _c('el-option',{key:item.id,attrs:{"label":item.name,"value":item.id}})}),1)],1),_vm._v(" "),_c('el-form-item',{attrs:{"label":"姓名","prop":"personname"}},[_c('el-input',{staticClass:"w200",attrs:{"clearable":true},model:{value:(_vm.form.personname),callback:function ($$v) {_vm.$set(_vm.form, "personname", $$v)},expression:"form.personname"}})],1),_vm._v(" "),_c('el-form-item',{attrs:{"label":"手机号","prop":"phone"}},[_c('el-input',{staticClass:"w200",attrs:{"clearable":true},model:{value:(_vm.form.phone),callback:function ($$v) {_vm.$set(_vm.form, "phone", $$v)},expression:"form.phone"}})],1),_vm._v(" "),_c('el-form-item',{attrs:{"label":"密码","prop":"password"}},[_c('el-input',{attrs:{"clearable":true},model:{value:(_vm.form.password),callback:function ($$v) {_vm.$set(_vm.form, "password", $$v)},expression:"form.password"}})],1)],1),_vm._v(" "),_c('span',{staticClass:"dialog-footer",attrs:{"slot":"footer"},slot:"footer"},[_c('el-button',{on:{"click":function($event){_vm.dialogVisible = false}}},[_vm._v("取 消")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary"},on:{"click":_vm.addEnterprise}},[_vm._v("添 加")])],1)],1),_vm._v(" "),_c('el-dialog',{staticClass:"dialogcontent",attrs:{"title":_vm.titleText,"visible":_vm.dialogVisible1,"width":"30%","before-close":_vm.handleClose1},on:{"update:visible":function($event){_vm.dialogVisible1=$event}}},[_c('el-form',{ref:"modifyfrom",attrs:{"model":_vm.modifyfrom,"label-width":"120px","rules":_vm.rules1}},[_c('el-form-item',{attrs:{"label":"旧密码","prop":"oldPassword"}},[_c('el-input',{attrs:{"clearable":true,"show-password":""},model:{value:(_vm.modifyfrom.oldPassword),callback:function ($$v) {_vm.$set(_vm.modifyfrom, "oldPassword", $$v)},expression:"modifyfrom.oldPassword"}})],1),_vm._v(" "),_c('el-form-item',{attrs:{"label":"新密码密码","prop":"newPassword"}},[_c('el-input',{attrs:{"clearable":true,"show-password":""},model:{value:(_vm.modifyfrom.newPassword),callback:function ($$v) {_vm.$set(_vm.modifyfrom, "newPassword", $$v)},expression:"modifyfrom.newPassword"}})],1),_vm._v(" "),_c('el-form-item',{attrs:{"label":"确认新密码","prop":"confirmPassword"}},[_c('el-input',{attrs:{"clearable":true,"show-password":""},model:{value:(_vm.modifyfrom.confirmPassword),callback:function ($$v) {_vm.$set(_vm.modifyfrom, "confirmPassword", $$v)},expression:"modifyfrom.confirmPassword"}})],1)],1),_vm._v(" "),_c('span',{staticClass:"dialog-footer",attrs:{"slot":"footer"},slot:"footer"},[_c('el-button',{on:{"click":function($event){_vm.dialogVisible1 = false}}},[_vm._v("取 消")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary"},on:{"click":_vm.saveEdit}},[_vm._v("修 改")])],1)],1)],1)])}
var staticRenderFns = []
var esExports = { render: render, staticRenderFns: staticRenderFns }
/* harmony default export */ var doorMagnetism_userManagementHouse = (esExports);
// CONCATENATED MODULE: ./src/views/doorMagnetism/userManagementHouse.vue
function injectStyle (ssrContext) {
  __webpack_require__("hPw6")
}
var normalizeComponent = __webpack_require__("VU/8")
/* script */


/* template */

/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = "data-v-04c0b5e1"
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  userManagementHouse,
  doorMagnetism_userManagementHouse,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)

/* harmony default export */ var views_doorMagnetism_userManagementHouse = __webpack_exports__["default"] = (Component.exports);


/***/ })

});