You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
7.4 KiB
2 lines
7.4 KiB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/AddNewCustomer/AddNewCustomer"],{234:function(e,n,t){"use strict";(function(e){t(3);o(t(2));var n=o(t(235));function o(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=t,e(n.default)}).call(this,t(0)["createPage"])},235:function(e,n,t){"use strict";t.r(n);var o=t(62),r=t(34);for(var i in r)"default"!==i&&function(e){t.d(n,e,(function(){return r[e]}))}(i);t(236);var u,s=t(1),a=Object(s["a"])(r["default"],o["b"],o["c"],!1,null,"92f949b4",null,!1,o["a"],u);a.options.__file="pages/AddNewCustomer/AddNewCustomer.vue",n["default"]=a.exports},236:function(e,n,t){"use strict";var o=t(36),r=t.n(o);r.a},34:function(e,n,t){"use strict";t.r(n);var o=t(35),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},35:function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=i(t(5)),r=t(4);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(278))}.bind(null,t)).catch(t.oe)},c=function(){t.e("components/NeedsSelect/NeedsSelect").then(function(){return resolve(t(282))}.bind(null,t)).catch(t.oe)},l=getApp().globalData.Define,d={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:d={address:"",city:"",demand:"",descmsg:"",id:-1,industry:"",name:"",phone:""};var t=l.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=l.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=l.FireKeys.NeedsSelectedCallback;this.$fire.off(e)},components:{pickRegions:a,NeedsSelect:c},data:function(){var n=this;return{isNeedSelectShowing:!1,customer:d,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(console.log(n.customer),e.showLoading({}),i=null,u=n.customer.id,-1==u){t.next=10;break}return t.next=7,(0,r.post)("customer/updatecustomerinfo",n.customer);case 7:i=t.sent,t.next=13;break;case 10:return t.next=12,(0,r.post)("customer/addcustomer",n.customer);case 12:i=t.sent;case 13:if(e.hideLoading(),s=l.onNetMessage(i),s){t.next=17;break}return t.abrupt("return",!1);case 17:a=l.FireKeys.AddNewCustomerSuccess,n.$fire.fire(a,n.customer.phone),n.onTouchBack();case 20:case"end":return t.stop()}}),t)})))()},onNeedsSelectClose:function(){this.isNeedSelectShowing=!1},getNeedSelecedViewProps:function(){for(var e=[],n=l.UserNeeds,t=0;t<n.length;t++)e.push(!1);var o=this.customer.demand;if(""==o)return e;var r=o.split(";");console.log("对用户需求进行分割:",r);for(t=0;t<r.length;t++){var i=r[t],u=n.indexOf(i);-1!=u&&(e[u]=!0)}return e},getConfirmButtonText:function(){var e=this.customer,n=e.id;return-1!=n?"更新":"提交"},getPageTitle:function(){var e=this.customer,n=e.id;return-1!=n?"更新客户":"新增客户"},getTopicImageUrl:function(){return getApp().globalData.mainPageData.keHuToppic.toppicadd.picurl}}};n.default=m}).call(this,t(0)["default"])},36:function(e,n,t){},62:function(e,n,t){"use strict";var o;t.d(n,"b",(function(){return r})),t.d(n,"c",(function(){return i})),t.d(n,"a",(function(){return o}));try{o={uNavbar:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uview-ui/components/u-navbar/u-navbar")]).then(t.bind(null,505))},uForm:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uview-ui/components/u-form/u-form")]).then(t.bind(null,507))},uFormItem:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uview-ui/components/u-form-item/u-form-item")]).then(t.bind(null,508))},uIcon:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(t.bind(null,512))},pickRegions:function(){return Promise.all([t.e("common/vendor"),t.e("components/pick-regions/pick-regions")]).then(t.bind(null,278))},uGap:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uview-ui/components/u-gap/u-gap")]).then(t.bind(null,509))},uPopup:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uview-ui/components/u-popup/u-popup")]).then(t.bind(null,516))},NeedsSelect:function(){return t.e("components/NeedsSelect/NeedsSelect").then(t.bind(null,282))}}}catch(u){if(-1===u.message.indexOf("Cannot find module")||-1===u.message.indexOf(".vue"))throw u;console.error(u.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var r=function(){var e=this,n=e.$createElement,t=(e._self._c,e.getPageTitle()),o=e.getTopicImageUrl(),r=e.getConfirmButtonText(),i=e.getNeedSelecedViewProps();e._isMounted||(e.e0=e.rules["name"].validator,e.e1=e.rules["phone"].validator,e.e2=e.rules["industry"].validator,e.e3=e.rules["address"].validator,e.e4=e.rules["descmsg"].validator),e.$mp.data=Object.assign({},{$root:{m0:t,m1:o,m2:r,m3:i}})},i=[];r._withStripped=!0}},[[234,"common/runtime","common/vendor"]]]);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/AddNewCustomer/AddNewCustomer.js.map
|