text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-17e52ed0"],{"06c5":function(e,t,a){"use strict";a.d(t,"a",(function(){return o}));a("a630"),a("fb6a"),a("b0c0"),a("d3b7"),a("25f0"),a("3ca3");var r=a("6b75");function o(e,t){if(e){if("string"===typeof e)return Object(r["a"])(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Object(r["a"])(e,t):void 0}}},"0ba3":function(e,t,a){},2909:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var r=a("6b75");function o(e){if(Array.isArray(e))return Object(r["a"])(e)}a("a4d3"),a("e01a"),a("d28b"),a("a630"),a("d3b7"),a("3ca3"),a("ddb0");function n(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}var l=a("06c5");function i(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(e){return o(e)||n(e)||Object(l["a"])(e)||i()}},2934:function(e,t,a){"use strict";a.d(t,"b",(function(){return o})),a.d(t,"a",(function(){return n})),a.d(t,"d",(function(){return l})),a.d(t,"c",(function(){return i}));var r=a("b775");function o(){return Object(r["a"])({url:"/v1/village/list",method:"post"})}function n(){return Object(r["a"])({url:"/v1/village/loadAll",method:"post"})}function l(){return Object(r["a"])({url:"/v1/position/query",method:"post"})}function i(e){return Object(r["a"])({url:"/v1/villageGroup/list",method:"post",data:e})}},3742:function(e,t,a){"use strict";var r=a("cf3e"),o=a.n(r);o.a},"462d":function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"account-edit-container"},[a("back"),a("el-card",{staticClass:"box-card"},[a("div",{attrs:{slot:"header"},slot:"header"},[a("span",[e._v("变更账户")])]),a("div",{staticClass:"addAccount-main"},[a("el-card",{staticClass:"box-card-addAccount"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",[e._v("基本信息")])]),a("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{model:e.ruleForm,rules:e.rules,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"账号",prop:"accountNo"}},[a("el-input",{attrs:{placeholder:"请输入账号",disabled:""},model:{value:e.ruleForm.accountNo,callback:function(t){e.$set(e.ruleForm,"accountNo",t)},expression:"ruleForm.accountNo"}})],1),a("el-form-item",{attrs:{label:"姓名",prop:"accountName"}},[a("el-input",{attrs:{placeholder:"请输入姓名"},model:{value:e.ruleForm.accountName,callback:function(t){e.$set(e.ruleForm,"accountName",t)},expression:"ruleForm.accountName"}})],1),a("el-form-item",{attrs:{label:"电话",prop:"phone"}},[a("el-input",{attrs:{placeholder:"请输入电话"},model:{value:e.ruleForm.phone,callback:function(t){e.$set(e.ruleForm,"phone",t)},expression:"ruleForm.phone"}})],1),a("el-form-item",{attrs:{label:"职务",prop:"rule"}},[a("el-input",{attrs:{placeholder:"请输入职务"},model:{value:e.ruleForm.rule,callback:function(t){e.$set(e.ruleForm,"rule",t)},expression:"ruleForm.rule"}})],1),a("el-form-item",{attrs:{label:"邮箱",prop:"email"}},[a("el-input",{attrs:{placeholder:"请输入邮箱"},model:{value:e.ruleForm.email,callback:function(t){e.$set(e.ruleForm,"email",t)},expression:"ruleForm.email"}})],1),a("el-form-item",{attrs:{label:"备注",prop:"description"}},[a("el-input",{attrs:{type:"textarea",placeholder:"请输入备注"},model:{value:e.ruleForm.description,callback:function(t){e.$set(e.ruleForm,"description",t)},expression:"ruleForm.description"}})],1)],1),!e.isModule||e.$hasAuth(17)?a("el-button",{staticClass:"demo-ruleForm",staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary"},on:{click:function(t){return e.submitForm("ruleForm","authForm")}}},[e._v("修改")]):e._e()],1),a("el-card",{staticClass:"box-card-addAccount"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",[e._v("权限设置")])]),a("div",{staticClass:"radio_check"},[a("el-form",{ref:"authForm",attrs:{model:e.authForm,rules:e.rules,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"所辖乡镇",prop:"manageVillages"}},[a("el-checkbox-group",{attrs:{disabled:e.disabled},on:{change:e.changeTown},model:{value:e.authForm.manageVillages,callback:function(t){e.$set(e.authForm,"manageVillages",t)},expression:"authForm.manageVillages"}},e._l(e.townLists,(function(t,r){return a("el-checkbox",{key:"town"+r,attrs:{label:t.townshipId,name:"type"}},[e._v(e._s(t.townshipName))])})),1)],1),a("el-form-item",{attrs:{label:"所辖村庄"}},[a("p",{staticStyle:{margin:"0"}},[e._v("目前共计选中"+e._s(e.villageModel.length)+"个行政村！"),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(t){e.showDrawer=!e.showDrawer,e.viewVillage()}}},[e._v("查看详情")])],1)]),a("el-form-item",{attrs:{label:"组归属",prop:"accountGroupId"}},[a("el-checkbox-group",{attrs:{disabled:e.disabled},model:{value:e.authForm.accountGroupId,callback:function(t){e.$set(e.authForm,"accountGroupId",t)},expression:"authForm.accountGroupId"}},e._l(e.group,(function(t,r){return a("el-checkbox",{key:r,attrs:{label:t.accountGroupId,name:"type"}},[e._v(e._s(t.accountGroupName))])})),1)],1)],1)],1)])],1)]),a("el-drawer",{attrs:{direction:"ltr",modal:!1,visible:e.showDrawer},on:{"update:visible":function(t){e.showDrawer=t}}},[a("p",{attrs:{slot:"title"},slot:"title"},[e._v("所辖村庄")]),a("el-checkbox-group",{staticClass:"custom-check",attrs:{disabled:e.disabled},model:{value:e.villageModel,callback:function(t){e.villageModel=t},expression:"villageModel"}},e._l(e.villageList,(function(t,r){return a("el-checkbox",{key:"town"+r,staticStyle:{width:"80px"},attrs:{label:t.villageId,name:"type"}},[e._v(e._s(t.villageName))])})),1)],1)],1)},o=[],n=(a("99af"),a("d81d"),a("d3b7"),a("3ca3"),a("ddb0"),a("2909")),l=(a("a4d3"),a("e01a"),a("d28b"),a("06c5"));function i(e,t){var a;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(a=Object(l["a"])(e))||t&&e&&"number"===typeof e.length){a&&(e=a);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,i=!0,s=!1;return{s:function(){a=e[Symbol.iterator]()},n:function(){var e=a.next();return i=e.done,e},e:function(e){s=!0,n=e},f:function(){try{i||null==a["return"]||a["return"]()}finally{if(s)throw n}}}}var s=a("5530"),c=a("5723"),u=a("2934"),d=(a("5f87"),a("66b7")),m={name:"AccountAdminEdit",components:{Back:d["a"]},props:{isModule:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hidePassword:{type:Boolean,default:!1}},data:function(){return{tableData:[],townLists:[],villageList:[],group:[],ruleForm:{},authForm:{manageVillages:[],accountGroupId:[]},villageModel:[],rules:{accountNo:[{required:!0,message:"账户名不能为空",trigger:"blur"}],accountName:[{required:!0,message:"姓名不能为空",trigger:"blur"}],phone:[{required:!0,message:"电话不能为空",trigger:"blur"}],manageVillages:[{type:"array",required:!0,message:"请至少选择一个所辖村庄",trigger:"change"}],accountGroupId:[{type:"array",required:!0,message:"请至少选择一个组归属",trigger:"change"}]},isEdit:!1,showDrawer:!1}},created:function(){console.log(this.$store.state),this.getGroupList(),this.getVillageList(),this.isEdit=!!this.isModule||this.$route.query.isEdit;var e=this.isModule?this.$store.state.user.accountId||localStorage.getItem("ai"):this.$route.query.accountid;this.isEdit&&e&&this.getAccountInfo(e)},methods:{submitForm:function(e,t){var a=this,r=new Promise((function(t,r){a.$refs[e].validate((function(e){e&&t()}))})),o=new Promise((function(e,r){a.$refs[t].validate((function(t){t&&e()}))}));Promise.all([r,o]).then((function(){var e=Object(s["a"])(Object(s["a"])(Object(s["a"])({},a.ruleForm),a.authForm),{},{manageVillages:a.villageModel}),t=null;t=a.isEdit?Object(c["i"])(e):Object(c["g"])(e),t.then((function(e){a.isModule?a.$message({message:"操作成功",type:"success"}):history.back()}))}))},addAccountBtn:function(){this.showPage=!1,this.addAccount=!0},getVillageList:function(){var e=this;Object(u["a"])().then((function(t){e.townLists=t.data.townshipInfos||[]}))},viewVillage:function(){var e=this,t=[];this.villageModel=[],console.log(e.authForm.manageVillages),console.log(e.townLists);for(var a=0;a<e.authForm.manageVillages.length;a++)for(var r=0;r<e.townLists.length;r++)e.townLists[r].townshipId==e.authForm.manageVillages[a]&&(t=t.concat(e.townLists[r].villageInfos));this.villageList=t;for(a=0;a<e.villageList.length;a++)e.villageModel.push(e.villageList[a].villageId)},changeTown:function(e){var t=[];this.villageModel=[];var a,r=i(e);try{for(r.s();!(a=r.n()).done;){var o,l=a.value,s=i(this.townLists);try{for(s.s();!(o=s.n()).done;){var c=o.value;if(c.townshipId===l){var u;t.push.apply(t,Object(n["a"])(c.villageInfos||[]));var d=(c.villageInfos||[]).map((function(e){return e.villageId}));(u=this.villageModel).push.apply(u,Object(n["a"])(d));break}}}catch(m){s.e(m)}finally{s.f()}}}catch(m){r.e(m)}finally{r.f()}this.villageList=t},getGroupList:function(){var e=this;Object(c["a"])().then((function(t){e.group=t.data.accountGroupInfos}))},getAccountInfo:function(e){var t=this;Object(c["d"])(e).then((function(e){var a=e.data;a.phone=a.phoneNum,t.ruleForm=a,t.$set(t.authForm,"accountGroupId",a.accountGroupIds),t.$set(t.authForm,"manageVillages",a.manageTownships),t.villageModel=a.manageVillages}))}}},f=m,p=(a("ac56"),a("3742"),a("2877")),h=Object(p["a"])(f,r,o,!1,null,null,null);t["default"]=h.exports},"6b75":function(e,t,a){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}a.d(t,"a",(function(){return r}))},ac56:function(e,t,a){"use strict";var r=a("0ba3"),o=a.n(r);o.a},cf3e:function(e,t,a){}}]);