|
|
|
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/AddNewCustomer/AddNewCustomer"],{"010e":function(e,n,t){"use strict";(function(e){t("d6ad");o(t("66fd"));var n=o(t("19ea"));function o(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=t,e(n.default)}).call(this,t("543d")["createPage"])},"0f52":function(e,n,t){"use strict";t.r(n);var o=t("3e4e"),r=t.n(o);for(var i in o)"default"!==i&&function(e){t.d(n,e,(function(){return o[e]}))}(i);n["default"]=r.a},"19ea":function(e,n,t){"use strict";t.r(n);var o=t("59b0"),r=t("0f52");for(var i in r)"default"!==i&&function(e){t.d(n,e,(function(){return r[e]}))}(i);t("d88c");var u,s=t("f0c5"),a=Object(s["a"])(r["default"],o["b"],o["c"],!1,null,"6b73d66b",null,!1,o["a"],u);n["default"]=a.exports},"3e4e":function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=i(t("a34a")),r=t("7f93");function i(e){return e&&e.__esModule?e:{default:e}}function u(e,n,t,o,r,i,u){try{var s=e[i](u),a=s.value}catch(c){return void t(c)}s.done?n(a):Promise.resolve(a).then(o,r)}function s(e){return function(){var n=this,t=arguments;return new Promise((function(o,r){var i=e.apply(n,t);function s(e){u(i,o,r,s,a,"next",e)}function a(e){u(i,o,r,s,a,"throw",e)}s(void 0)}))}}var a=function(){Promise.all([t.e("common/vendor"),t.e("components/pick-regions/pick-regions")]).then(function(){return resolve(t("d93e"))}.bind(null,t)).catch(t.oe)},c=function(){t.e("components/NeedsSelect/NeedsSelect").then(function(){return resolve(t("f681"))}.bind(null,t)).catch(t.oe)},d=getApp().globalData.Define,l={address:"",city:"",demand:"",descmsg:"",id:-1,industry:"",name:"",phone:""},m={created:function(){var e=this;console.log("created");var n=getApp().globalData.editingCustomer;console.log("customer",n),null!=n?this.customer=n:l={address:"",city:"",demand:"",descmsg:"",id:-1,industry:"",name:"",phone:""};var t=d.FireKeys.NeedsSelectedCallback;this.$fire.on(t,(function(n){e.isNeedSelectShowing=!1;var t=n["status"];if(t){console.log("更新客户的needs显示。");var o=n["selected"];e.customer.demand="";for(var r=d.UserNeeds,i="",u=0;u<o.length;u++){var s=o[u];s&&(i+=r[u]+";")}""!=i&&(i=i.substr(0,i.length-1)),e.customer.demand=i}}))},destroyed:function(){var e=d.FireKeys.NeedsSelectedCallback;this.$fire.off(e)},components:{pickRegions:a,NeedsSelect:c},data:function(){var n=this;return{isNeedSelectShowing:!1,customer:l,rules:{name:{type:"string",required:!0,message:"请输入姓名",validator:function(e){n.customer.name=e.detail.value}},phone:{type:"string",required:!0,message:"请输入客户电话",validator:function(t){var o=e.$u.test.mobile(t.detail.value);return o?n.customer.phone=t.detail.value:e.$u.toast("请输入正确的电话号码!"),o}},industry:{type:"string",required:!1,message:"请输入客户行业",validator:function(e){n.customer.industry=e.detail.value}},demand:{type:"array",required:!0,message:"请选择客户需求"},city:{type:"string",required:!0,message:"请选择客户所在城市"},address:{type:"string",required:!1,message:"请输入客户详细地址",validator:function(e){n.customer.address=e.detail.value}},descmsg:{type:"string",required:!1,message:"请输入对此客户的详细描述",validator:function(e){n.customer.descmsg=e.detail.value}}},region:[],defaultRegion:["四川省","成都市","武侯区"],form_tile_title:{height:"37rpx",fontSize:"26rpx",fontWeight:400,color:"#666666"}}},methods:{onTouchBack:function(){getApp().globalData.editingCustomer=null,console.log("退出新增用户界面!"),e.navigateBack({})},onClickToSelectNeeds:function(){e.hideKeyboard(),this.isNeedSelectShowing=!0},onClickToSelectCity:function(){e.hideKeyboard()},handleGetRegion:function(e){this.region=e,this.customer.city=this.regionName(),this.$refs.form1.validateField("city")},regionName:function(){return this.region.map((function(e){return e.name})).join(" ")},onConfirm:function(){var n=this;return s(o.default.mark((function t(){var i,u,s,a;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(co
|