chunk-5562ea1c.79ac22cd.js 14 KB

12
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5562ea1c"],{"2b28":function(t,e,i){"use strict";i("68ef"),i("7c7f")},"2dde":function(t,e,i){"use strict";i.r(e);var n,o=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"committee"},[i("div",{staticClass:"committee-title"},[i("div",{staticClass:"committee-title-txt"},[i("span",{staticStyle:{display:"inline-block","max-width":"20%",overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis","vertical-align":"middle"}},[t._v(t._s(t.userInfo?" "+t.userInfo.userName+",":"你好,"))]),i("span",{staticStyle:{display:"inline-block","vertical-align":"middle"}},[t._v("请完善业委会信息")])])]),i("div",{staticClass:"committee-input"},[i("div",{staticStyle:{"font-size":"0.4rem","padding-left":"1rem","margin-bottom":"0.2rem"}},[t._v("请确认您所在的小区")]),t._l(t.keyList,(function(e,n){return i("div",{key:n,staticClass:"committee-input-view"},[i("van-field",{attrs:{readonly:"",clickable:"",placeholder:t.placeholderTxt[n]},on:{click:function(e){return t.select(n)}},model:{value:t.keyValue[n][t.keyName[n]],callback:function(e){t.$set(t.keyValue[n],t.keyName[n],e)},expression:"keyValue[itemIndex][keyName[itemIndex]]"}},[i("van-icon",{attrs:{slot:"right-icon",name:"arrow-down"},slot:"right-icon"})],1)],1)})),i("div",{staticStyle:{padding:"0 1rem"}},[i("van-divider",{style:{backgroundColor:"#505050",height:"1px"}})],1),i("div",{staticStyle:{"font-size":"0.4rem","padding-left":"1rem","margin-bottom":"0.2rem"}},[t._v("业委会组成人员")]),t._l(t.comoitteeList,(function(e,n){return i("div",{key:n,staticClass:"committee-input-code"},[i("van-field",{attrs:{readonly:""},on:{"click-right-icon":function(i){return t.removeCommittee(e,n)}},model:{value:e.strData,callback:function(i){t.$set(e,"strData",i)},expression:"item.strData"}},[i("van-icon",{attrs:{slot:"left-icon",name:"smile-o"},slot:"left-icon"}),i("van-icon",{attrs:{slot:"right-icon",name:"close"},slot:"right-icon"})],1)],1)})),i("div",{staticClass:"committee-input-code"},[i("van-field",{attrs:{placeholder:"添加业委会成员",readonly:""},on:{click:t.addCommittee,"click-right-icon":t.addCommittee}},[i("van-icon",{attrs:{slot:"left-icon",name:"smile-o"},slot:"left-icon"}),i("van-icon",{attrs:{slot:"right-icon",name:"add-o"},slot:"right-icon"})],1)],1)],2),i("div",{staticClass:"committee-btn"},[i("div",{staticStyle:{"text-align":"center",height:"100%"}},[i("van-button",{staticStyle:{height:"70%","margin-right":"0.5rem",padding:"0 1rem"},attrs:{color:"#009688"},on:{click:t.goBack}},[t._v("取 消")]),i("van-button",{staticStyle:{height:"70%","margin-left":"0.5rem",padding:"0 1rem"},attrs:{color:"#009688"},on:{click:t.saveCommittee}},[t._v("完 成")])],1)]),i("van-dialog",{attrs:{title:"新增业委会成员","show-cancel-button":"","close-on-popstate":"","close-on-click-overlay":"","before-close":t.dialogClose},model:{value:t.dialogShow,callback:function(e){t.dialogShow=e},expression:"dialogShow"}},[i("div",{staticStyle:{padding:"0.2rem 0"}},[i("div",{staticClass:"committee-input-dialog"},[i("van-field",{attrs:{clickable:"",placeholder:"姓名(必填)",clearable:""},model:{value:t.committeeName,callback:function(e){t.committeeName=e},expression:"committeeName"}})],1),i("div",{staticClass:"committee-input-dialog"},[i("van-field",{attrs:{readonly:"",clickable:"",placeholder:"职位(可选)"},on:{click:t.selectpPosition},model:{value:t.position,callback:function(e){t.position=e},expression:"position"}},[i("van-icon",{attrs:{slot:"right-icon",name:"arrow-down"},slot:"right-icon"})],1)],1),i("div",{staticClass:"committee-input-dialog"},[i("van-field",{attrs:{type:"tel",clickable:"",placeholder:"联系电话(必填)",clearable:""},model:{value:t.committeePhone,callback:function(e){t.committeePhone=e},expression:"committeePhone"}})],1)])]),i("van-popup",{style:{height:"40%"},attrs:{position:"bottom"},model:{value:t.positionShow,callback:function(e){t.positionShow=e},expression:"positionShow"}},[i("van-picker",{attrs:{"show-toolbar":"",columns:t.positionList},on:{cancel:function(e){t.positionShow=!1},confirm:t.onConfirm}})],1),i("van-popup",{style:{height:"50%"},attrs:{position:"bottom"},model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[i("van-picker",{attrs:{columns:t.setColumns,loading:t.pickLoading,"value-key":t.setValueKey,"show-toolbar":"",title:t.setPickerTitle},on:{cancel:function(e){t.show=!1},confirm:t.pickerConfirm}})],1)],1)},a=[],s=(i("99af"),i("4de4"),i("c740"),i("a15b"),i("d81d"),i("a434"),i("4d63"),i("ac1f"),i("25f0"),i("5319"),i("1276"),i("ade3")),c=(i("68ef"),i("a71a"),i("9d70"),i("3743"),i("4d75"),i("e3b3"),i("bc1b"),i("2fcb"),i("c31d")),l=i("a026"),r=i("d282"),u=i("ea8e"),m=i("b1d2"),d=i("6605"),h=i("b650"),f=Object(r["a"])("dialog"),p=f[0],v=f[1],g=f[2],k=p({mixins:[Object(d["a"])()],props:{title:String,width:[Number,String],message:String,className:null,callback:Function,beforeClose:Function,messageAlign:String,cancelButtonText:String,cancelButtonColor:String,confirmButtonText:String,confirmButtonColor:String,showCancelButton:Boolean,transition:{type:String,default:"van-dialog-bounce"},showConfirmButton:{type:Boolean,default:!0},overlay:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!1}},data:function(){return{loading:{confirm:!1,cancel:!1}}},methods:{onClickOverlay:function(){this.handleAction("overlay")},handleAction:function(t){var e=this;this.$emit(t),this.value&&(this.beforeClose?(this.loading[t]=!0,this.beforeClose(t,(function(i){!1!==i&&e.loading[t]&&e.onClose(t),e.loading.confirm=!1,e.loading.cancel=!1}))):this.onClose(t))},onClose:function(t){this.close(),this.callback&&this.callback(t)},onOpened:function(){this.$emit("opened")},onClosed:function(){this.$emit("closed")},genButtons:function(){var t,e=this,i=this.$createElement,n=this.showCancelButton&&this.showConfirmButton;return i("div",{class:[m["e"],v("footer",{buttons:n})]},[this.showCancelButton&&i(h["a"],{attrs:{size:"large",loading:this.loading.cancel,text:this.cancelButtonText||g("cancel")},class:v("cancel"),style:{color:this.cancelButtonColor},on:{click:function(){e.handleAction("cancel")}}}),this.showConfirmButton&&i(h["a"],{attrs:{size:"large",loading:this.loading.confirm,text:this.confirmButtonText||g("confirm")},class:[v("confirm"),(t={},t[m["c"]]=n,t)],style:{color:this.confirmButtonColor},on:{click:function(){e.handleAction("confirm")}}})])}},render:function(){var t,e=arguments[0];if(this.shouldRender){var i=this.message,n=this.messageAlign,o=this.slots(),a=this.slots("title")||this.title,s=a&&e("div",{class:v("header",{isolated:!i&&!o})},[a]),c=(o||i)&&e("div",{class:v("content")},[o||e("div",{domProps:{innerHTML:i},class:v("message",(t={"has-title":a},t[n]=n,t))})]);return e("transition",{attrs:{name:this.transition},on:{afterEnter:this.onOpened,afterLeave:this.onClosed}},[e("div",{directives:[{name:"show",value:this.value}],attrs:{role:"dialog","aria-labelledby":this.title||i},class:[v(),this.className],style:{width:Object(u["a"])(this.width)}},[s,c,this.genButtons()])])}}}),b=i("a142");function y(t){return document.body.contains(t)}function w(){n&&n.$destroy(),n=new(l["a"].extend(k))({el:document.createElement("div"),propsData:{lazyRender:!1}}),n.$on("input",(function(t){n.value=t}))}function C(t){return b["e"]?Promise.resolve():new Promise((function(e,i){n&&y(n.$el)||w(),Object(c["a"])(n,C.currentOptions,t,{resolve:e,reject:i})}))}C.defaultOptions={value:!0,title:"",width:"",message:"",overlay:!0,className:"",lockScroll:!0,transition:"van-dialog-bounce",beforeClose:null,overlayClass:"",overlayStyle:null,messageAlign:"",getContainer:"body",cancelButtonText:"",cancelButtonColor:null,confirmButtonText:"",confirmButtonColor:null,showConfirmButton:!0,showCancelButton:!1,closeOnPopstate:!1,closeOnClickOverlay:!1,callback:function(t){n["confirm"===t?"resolve":"reject"](t)}},C.alert=C,C.confirm=function(t){return C(Object(c["a"])({showCancelButton:!0},t))},C.close=function(){n&&(n.value=!1)},C.setDefaultOptions=function(t){Object(c["a"])(C.currentOptions,t)},C.resetDefaultOptions=function(){C.currentOptions=Object(c["a"])({},C.defaultOptions)},C.resetDefaultOptions(),C.install=function(){l["a"].use(k)},C.Component=k,l["a"].prototype.$dialog=C;var x,O=C,I=(i("5f5f"),i("f253")),S=(i("2b28"),i("9ed2")),B=(i("c3a6"),i("ad06")),j=(i("db2c"),i("1125")),N=(i("8a58"),i("e41f")),P=(i("e7e5"),i("d399")),L=(i("66b9"),i("be7f"),i("565f")),T=i("a4f5"),$=i("c8ee"),V={components:(x={},Object(s["a"])(x,L["a"].name,L["a"]),Object(s["a"])(x,h["a"].name,h["a"]),Object(s["a"])(x,P["a"].name,P["a"]),Object(s["a"])(x,N["a"].name,N["a"]),Object(s["a"])(x,j["a"].name,j["a"]),Object(s["a"])(x,B["a"].name,B["a"]),Object(s["a"])(x,S["a"].name,S["a"]),Object(s["a"])(x,I["a"].name,I["a"]),Object(s["a"])(x,O.Component.name,O.Component),x),data:function(){return{userInfo:null,province:"",city:"",area:"",street:"",community:"",areaList:T["a"],columnsNum:2,building:"",unit:"",houseNumber:"",contacts:"",needHelpNum:"",contactsPhone:"",comoitteeList:[],dialogShow:!1,positionShow:!1,position:"",positionList:["负责人","组员"],committeePhone:"",committeeName:"",show:!1,pickLoading:!1,pickIndex:0,keyList:["province","city","area"],keyName:["areaName","areaName","uptownName"],keyValue:[{},{},{}],placeholderTxt:["请选择城市","请选择区县","请选择小区"],selectErrTxt:["请先选择城市","请先选择区县","请先选择小区"],apiNames:["selectCityByProvince","selectAreaByCity","selectUptownByArea"],columns:[[],[],[]],params:[{areaId:"420000"},{areaId:""},{areaId:""}]}},mounted:function(){this.userInfo=this.$storage.get("userInfo")},computed:{userId:function(){return this.$store.getters.userId},pickIndexStr:function(){return this.apiNames[this.pickIndex]},setColumns:function(){return this.columns[this.pickIndex]},pickerParams:function(){if(this.pickIndex){var t=this.keyValue[this.pickIndex-1],e={};for(var i in this.params[this.pickIndex])this.params[this.pickIndex].hasOwnProperty(i)&&(e[i]=t[i]);return e}return this.params[this.pickIndex]},setValueKey:function(){return this.keyName[this.pickIndex]},setPickerTitle:function(){return this.placeholderTxt[this.pickIndex]},lstOwner:function(){return this.comoitteeList.map((function(t){var e=t.strData.split(",");return 2===e.length?{linkman:e[0],phone:e[1],type:"0"}:3===e.length?{linkman:e[0],phone:e[2],type:"负责人"===e[1]?"1":"2"}:void 0}))}},methods:{saveCommittee:function(){var t=this,e=this.emptyInput();e?Object(P["a"])(e):this.comoitteeList.length?this.$http.createYWH({userId:this.userId,uptownId:this.keyValue[2].uptownId,lstOwner:this.lstOwner}).then((function(e){e&&"1"==e.data?(Object(P["a"])("保存成功"),setTimeout((function(e){t.goBack()}),2e3)):Object(P["a"])("保存失败,请重试!")})).catch((function(t){Object(P["a"])("保存失败,请重试!")})):Object(P["a"])("请输入业委会信息")},goBack:function(){this.$router.back()},areaConfirm:function(t){if(console.log(t),this.show=!1,2===this.columnsNum){var e=(t||[]).map((function(t){return t.name})).join("/");this.province&&this.province===e||(this.area="",this.province=e)}else 3===this.columnsNum&&(this.province="".concat(t[0].name,"/").concat(t[1].name),this.area=t[2]?t[2].name:"")},addCommittee:function(){this.dialogShow=!0},removeCommittee:function(t,e){this.comoitteeList.splice(e)},selectpPosition:function(){this.positionShow=!0},onConfirm:function(t){this.position=t,this.positionShow=!1},dialogClose:function(t,e){if("confirm"===t){if(!this.committeeName)return Object(P["a"])("请输入姓名"),void e(!1);if(!this.committeePhone)return Object(P["a"])("请输入手机"),void e(!1);if(!new RegExp($["a"].mobile).test(this.committeePhone))return Object(P["a"])("请输入正确的手机号码"),void e(!1);this.comoitteeList.push({strData:[this.committeeName,this.position,this.committeePhone].filter((function(t){return t})).join(",")}),e()}else e()},select:function(t){var e=this,i=this.keyValue.findIndex((function(t,i){return!e.keyValue[i][e.keyName[i]]}));-1===i||i>=t?(this.show=!0,this.pickIndex=t):Object(P["a"])(this.selectErrTxt[i])},emptyInput:function(){var t=this,e=this.keyValue.map((function(e,i){return e[t.keyName[i]]?"":t.placeholderTxt[i].replace(/(请选择)/,"")})).filter((function(t){return t})).join(",");return e&&(e="请选择"+e),e},pickerHttp:function(){var t=this;this.pickLoading=!0,this.$http[this.pickIndexStr](this.pickerParams).then((function(e){console.log(e),t.columns.splice(t.pickIndex,1,e.data),t.pickLoading=!1})).catch((function(e){console.log(e),t.pickLoading=!1}))},pickerConfirm:function(t){var e=this;this.keyValue=this.keyValue.map((function(t,i){return i>e.pickIndex?{}:t})),this.columns=this.columns.map((function(t,i){return i>e.pickIndex?[]:t})),this.keyValue.splice(this.pickIndex,1,t||{}),this.show=!1}},watch:{dialogShow:function(t){t&&(this.committeePhone="",this.committeeName="",this.position="")},show:function(){this.show&&!this.columns[this.pickIndex].length&&this.pickerHttp()}}},_=V,A=(i("2e43"),i("2877")),D=Object(A["a"])(_,o,a,!1,null,null,null);e["default"]=D.exports},"2e43":function(t,e,i){"use strict";var n=i("e131"),o=i.n(n);o.a},"2fcb":function(t,e,i){},"7c7f":function(t,e,i){},"9ed2":function(t,e,i){"use strict";var n=i("2638"),o=i.n(n),a=i("d282"),s=i("ba31"),c=Object(a["a"])("divider"),l=c[0],r=c[1];function u(t,e,i,n){var a;return t("div",o()([{attrs:{role:"separator"},style:{borderColor:e.borderColor},class:r((a={dashed:e.dashed,hairline:e.hairline},a["content-"+e.contentPosition]=i.default,a))},Object(s["b"])(n,!0)]),[i.default&&i.default()])}u.props={dashed:Boolean,hairline:{type:Boolean,default:!0},contentPosition:{type:String,default:"center"}},e["a"]=l(u)},e131:function(t,e,i){}}]);
  2. //# sourceMappingURL=chunk-5562ea1c.79ac22cd.js.map