12 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/resident/userAddr"],{137:function(e,n,t){"use strict";(function(e){t(5);r(t(4));var n=r(t(138));function r(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=t,e(n.default)}).call(this,t(1)["createPage"])},138:function(e,n,t){"use strict";t.r(n);var r=t(139),u=t(141);for(var i in u)"default"!==i&&function(e){t.d(n,e,(function(){return u[e]}))}(i);t(143);var o,a=t(11),c=Object(a["default"])(u["default"],r["render"],r["staticRenderFns"],!1,null,null,null,!1,r["components"],o);c.options.__file="pages/resident/userAddr.vue",n["default"]=c.exports},139:function(e,n,t){"use strict";t.r(n);var r=t(140);t.d(n,"render",(function(){return r["render"]})),t.d(n,"staticRenderFns",(function(){return r["staticRenderFns"]})),t.d(n,"recyclableRender",(function(){return r["recyclableRender"]})),t.d(n,"components",(function(){return r["components"]}))},140:function(e,n,t){"use strict";var r;t.r(n),t.d(n,"render",(function(){return u})),t.d(n,"staticRenderFns",(function(){return o})),t.d(n,"recyclableRender",(function(){return i})),t.d(n,"components",(function(){return r}));try{r={uniNoticeBar:function(){return t.e("uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar").then(t.bind(null,145))},uniSection:function(){return t.e("uni_modules/uni-section/components/uni-section/uni-section").then(t.bind(null,152))},uniForms:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uni-forms/components/uni-forms/uni-forms")]).then(t.bind(null,231))},uniFormsItem:function(){return t.e("uni_modules/uni-forms/components/uni-forms-item/uni-forms-item").then(t.bind(null,240))},uniEasyinput:function(){return t.e("uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput").then(t.bind(null,202))},uniDataCheckbox:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox")]).then(t.bind(null,247))},uniDatetimePicker:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker")]).then(t.bind(null,257))},uniDataPicker:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker")]).then(t.bind(null,268))}}}catch(a){if(-1===a.message.indexOf("Cannot find module")||-1===a.message.indexOf(".vue"))throw a;console.error(a.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var u=function(){var e=this,n=e.$createElement;e._self._c},i=!1,o=[];u._withStripped=!0},141:function(e,n,t){"use strict";t.r(n);var r=t(142),u=t.n(r);for(var i in r)"default"!==i&&function(e){t.d(n,e,(function(){return r[e]}))}(i);n["default"]=u.a},142:function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(t(18)),u=i(t(134));function i(e){return e&&e.__esModule?e:{default:e}}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?o(Object(t),!0).forEach((function(n){c(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function c(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function s(e,n,t,r,u,i,o){try{var a=e[i](o),c=a.value}catch(s){return void t(s)}a.done?n(c):Promise.resolve(c).then(r,u)}function l(e){return function(){var n=this,t=arguments;return new Promise((function(r,u){var i=e.apply(n,t);function o(e){s(i,r,u,o,a,"next",e)}function a(e){s(i,r,u,o,a,"throw",e)}o(void 0)}))}}var d={data:function(){return{role:"",residentId:null,formData:{},items:[],pickerMap:{text:"label",value:"interId"},range:[],house:{},building:[],unit:"",sexs:[{text:"男",value:1},{text:"女",value:0}],rules:{name:{rules:[{required:!0,errorMessage:"姓名不能为空"}]},sex:{rules:[{required:!0,errorMessage:"性别不能为空"}]},phone:{rules:[{required:!0,errorMessage:"电话不能为空"}]}}}},mounted:function(){var e=this;return l(r.default.mark((function n(){var t;return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,u.default.addrTreeSelect();case 2:t=n.sent,e.items=t.data,null!==e.residentId&&e.residentId&&e.queryInfo();case 5:case"end":return n.stop()}}),n)})))()},methods:{queryInfo:function(){var e=this;return l(r.default.mark((function n(){var t;return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,u.default.getUser();case 2:t=n.sent,e.formData=t.data,e.setAddr(t.data);case 5:case"end":return n.stop()}}),n)})))()},setAddr:function(e){var n=this;return l(r.default.mark((function t(){var i;return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.estateId||null===e.estateId){t.next=5;break}return t.next=3,u.default.buildingList({estateId:e.estateId});case 3:i=t.sent,n.range=i.rows.map((function(e){return a(a({},e),{},{text:"".concat(e.number,"栋"),value:e.buildingId})}));case 5:if(!e.buildingId||null===e.buildingId){t.next=8;break}return t.next=8,n.villageChange(e.buildingId);case 8:if(!e.unit||null===e.unit){t.next=11;break}return t.next=11,n.unitChange(e.unit);case 11:if(!e.floor||null===e.floor){t.next=14;break}return t.next=14,n.floorChange(e.floor);case 14:if(!e.houseId||null===e.houseId){t.next=17;break}return t.next=17,n.houseChange(e.houseId);case 17:case"end":return t.stop()}}),t)})))()},onchange:function(e){var n=this;return l(r.default.mark((function t(){var i,o;return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e&&""!=e&&!(e.detail.value.length<=0)){t.next=2;break}return t.abrupt("return");case 2:return i=e.detail.value[e.detail.value.length-1].value,t.next=5,u.default.buildingList({estateId:i});case 5:o=t.sent,n.range=o.rows.map((function(e){return a(a({},e),{},{text:"".concat(e.number,"栋"),value:e.buildingId})}));case 7:case"end":return t.stop()}}),t)})))()},villageChange:function(e){var n=this;return l(r.default.mark((function t(){var i,o,c,s,l;return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e&&""!=e&&!(e.detail.value.length<=0)){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,u.default.houseList({buildingId:e.detail.value[0].value});case 4:i=t.sent,n.building=i.rows,o=[],c=[],s=i.rows.filter((function(e){return null!==e.unit})).map((function(e){return a(a({},e),{},{text:"".concat(e.unit,"单元"),value:e.unit})})),l=i.rows.filter((function(e){return null!==e.number})).map((function(e){return a(a({},e),{},{text:"".concat(e.number,"号"),value:e.houseId})})),s.forEach((function(e){var n=o.find((function(n){return n.unit==e.unit}));n||o.push(e)})),n.$set(n.house,"unit",o),l.forEach((function(e){var n=c.find((function(n){return n.number==e.number}));n||c.push(e)})),n.$set(n.house,"number",c);case 14:case"end":return t.stop()}}),t)})))()},unitChange:function(e){var n=this;if(e&&""!=e&&!(e.detail.value.length<=0)){this.unit=e.detail.value[0].value;var t=[],r=this.building.filter((function(e){return e.unit==n.unit})).map((function(e){return a(a({},e),{},{text:"".concat(e.floor,"层"),value:e.floor})}));r.forEach((function(e){var n=t.find((function(n){return n.floor==e.floor}));n||t.push(e)})),this.$set(this.house,"floor",t)}},floorChange:function(e){var n=this;if(e&&""!=e&&!(e.detail.value.length<=0)){var t=[],r=this.building.filter((function(t){return t.floor==e.detail.value[0].value&&t.unit==n.unit})).map((function(e){return a(a({},e),{},{text:"".concat(e.number,"号"),value:e.houseId})}));r.forEach((function(e){var n=t.find((function(n){return n.number==e.number}));n||t.push(e)})),this.$set(this.house,"number",t)}},houseChange:function(e){if(e&&""!=e&&!(e.detail.value.length<=0)){var n=this.house.number.find((function(n){return n.houseId==e.detail.value[0].value}));n&&(this.formData.deptId=n.deptId)}},submit:function(){var n=this;return l(r.default.mark((function t(){var i;return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n.formData.deptId&&n.formData.houseId&&""!=n.formData.houseId){t.next=3;break}return e.showToast({title:"请选择完整信息",icon:"error",duration:2e3}),t.abrupt("return");case 3:return t.next=5,u.default.registerUser(n.formData);case 5:i=n.residentId&&null!==n.residentId?"修改成功":"添加成功",e.showToast({title:i,duration:2e3}),e.navigateBack();case 8:case"end":return t.stop()}}),t)})))()}},onLoad:function(e){this.residentId,e.residentId}};n.default=d}).call(this,t(1)["default"])},143:function(e,n,t){"use strict";t.r(n);var r=t(144),u=t.n(r);for(var i in r)"default"!==i&&function(e){t.d(n,e,(function(){return r[e]}))}(i);n["default"]=u.a},144:function(e,n,t){}},[[137,"common/runtime","common/vendor"]]]);
- //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/resident/userAddr.js.map
|