mycreate.js 5.2 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/cust/mycreate"],{"454c":function(e,n,t){"use strict";t.r(n);var u=t("fb3a"),o=t.n(u);for(var r in u)["default"].indexOf(r)<0&&function(e){t.d(n,e,(function(){return u[e]}))}(r);n["default"]=o.a},"7fc4":function(e,n,t){"use strict";var u=t("d3eb"),o=t.n(u);o.a},"9a99":function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"c",(function(){return r})),t.d(n,"a",(function(){return u}));var u={uForm:function(){return t.e("uni_modules/vk-uview-ui/components/u-form/u-form").then(t.bind(null,"a0c0"))},uFormItem:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/vk-uview-ui/components/u-form-item/u-form-item")]).then(t.bind(null,"470d"))},uInput:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/vk-uview-ui/components/u-input/u-input")]).then(t.bind(null,"f017"))},uRadioGroup:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/vk-uview-ui/components/u-radio-group/u-radio-group")]).then(t.bind(null,"7bda"))},uRadio:function(){return t.e("uni_modules/vk-uview-ui/components/u-radio/u-radio").then(t.bind(null,"3c65"))},uGap:function(){return t.e("uni_modules/vk-uview-ui/components/u-gap/u-gap").then(t.bind(null,"2bea"))},uButton:function(){return t.e("uni_modules/vk-uview-ui/components/u-button/u-button").then(t.bind(null,"479c"))},uSelect:function(){return t.e("uni_modules/vk-uview-ui/components/u-select/u-select").then(t.bind(null,"2911"))},uModal:function(){return t.e("uni_modules/vk-uview-ui/components/u-modal/u-modal").then(t.bind(null,"5dae"))},uToast:function(){return t.e("uni_modules/vk-uview-ui/components/u-toast/u-toast").then(t.bind(null,"d498"))}},o=function(){var e=this.$createElement;this._self._c},r=[]},d3eb:function(e,n,t){},dded:function(e,n,t){"use strict";t.r(n);var u=t("9a99"),o=t("454c");for(var r in o)["default"].indexOf(r)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(r);t("7fc4");var i=t("f0c5"),a=Object(i["a"])(o["default"],u["b"],u["c"],!1,null,null,null,!1,u["a"],void 0);n["default"]=a.exports},f1e7:function(e,n,t){"use strict";(function(e,n){var u=t("4ea4");t("b159");u(t("66fd"));var o=u(t("dded"));e.__webpack_require_UNI_MP_PLUGIN__=t,n(o.default)}).call(this,t("bc2e")["default"],t("543d")["createPage"])},fb3a:function(e,n,t){"use strict";(function(e,t){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var u={data:function(){return{isEdit:!1,form:{name:null,phone:null,sex:"male",record_level:"",remark:null,estate_id:null,estate_name:null,saler_id:null,saler_name:null},customer_id:null,submitButtonDisabled:!0,rules:{record_level:[{required:!0,message:"客户级别不得为空",trigger:["change","blur"]}],name:[{required:!0,message:"姓名不得为空",trigger:["change","blur"]}],phone:[{required:!0,message:"手机号不得为空",trigger:["change","blur"]},{len:11,message:"手机号格式不正确",trigger:["change","blur"]}],remark:[{required:!0,message:"备注不能为空",trigger:["change"]}]},recordLevelList:[],propertySelectShow:!1,propertySelectList:[],salerSelectShow:!1,salerSelectList:[],submitModalShow:!1,modalShow:!1,modalContent:""}},onLoad:function(n){var t=this,u=t.getOpenerEventChannel();u.on&&u.on("data",(function(n){n&&(t.form.name=n.info.name,t.form.phone=n.info.phone,t.form.sex=n.info.sex,t.form.record_level=n.info.record_level,t.form.remark=n.info.remark,t.form.id=n.info.id,t.isEdit=!0,e.setNavigationBarTitle({title:"编辑客户-"+n.info.name}))}))},created:function(){var e=t.getStorageSync("MD_dict");this.recordLevelList=e.record_level||[]},onReady:function(){this.$refs.uForm.setRules(this.rules)},methods:{propertySelectConfirm:function(e){var n=this;e.map((function(e,t){n.form.estate_id=e.value,n.form.estate_name=e.label}))},submitHandle:function(){var e=this,n=this;this.$refs.uForm.validate((function(u){if(u){var o="apiprivatecustomeradd",r={name:n.form.name,phone:n.form.phone,sex:n.form.sex,record_level:n.form.record_level,remark:n.form.remark};n.isEdit&&(o="apiprivatecustomeredit",r.id=n.form.id),t.api.cust[o](r).then((function(u){n.isEdit?t.$msgConfirm("编辑成功",(function(){t.reLaunch({url:"/pages/cust/my"})}),(function(){t.reLaunch({url:"/pages/cust/my"})})):t.$msgConfirm("添加成功,是否前往客户列表?",(function(){t.reLaunch({url:"/pages/cust/my"})}),(function(){e.form={name:null,phone:null,sex:"male",record_level:"",remark:null,estate_id:null,estate_name:null}}))}))}else console.log("验证失败")}))},getPhoneNumber:function(n){var t=this;if("getPhoneNumber:fail user deny"==n.detail.errMsg)return t.$refs.uToast.show({title:"您可以在个人设置中再次绑定",type:"warning"}),void setTimeout((function(){t.reLunchUser()}),1500);console.log(n.detail.errMsg),console.log(n.detail.iv),console.log(n.detail.encryptedData);var u=n.detail.iv,o=n.detail.encryptedData;e.login({success:function(e){e.code?t.setUserPhoneNumber(o,u,e.code):(this.$refs.uToast.show({title:e.errMsg,type:"warning"}),console.log("登录失败!"+e.errMsg))}})},hideKeyboard:function(){t.hideKeyboard()},getFormatDate:function(e){if(void 0==e||""==e)return"";var n=e;return parseInt(e)<10&&(n="0"+e),n}}};n.default=u}).call(this,t("bc2e")["default"],t("543d")["default"])}},[["f1e7","common/runtime","common/vendor"]]]);