myrecordedit.js 5.6 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/cust/myrecordedit"],{"06bb":function(e,t,n){"use strict";(function(e,t){var u=n("4ea4");n("2ab2");u(n("66fd"));var r=u(n("7bca"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(r.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},"267b":function(e,t,n){},"5e7b":function(e,t,n){"use strict";(function(e){var u=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n("448a")),i=n("66f6"),o={data:function(){return{actionSelectShow:!1,groupTypeSelectList:[],estateList:[],areaTypeObj:{},userInfo2:{},curEstateName:"",propertySelectShow:!1,imgArr:[],form:{estate_id:"",estate_name:"",remind:"",record_remark:null},customer_id:null,rules:{record_remark:[{required:!0,message:"备注不能为空",trigger:["change"]}],remind:[{required:!0,message:"提醒时间不能为空",trigger:["blur","change"]}]},remarkTips:"请输入"}},onLoad:function(t){var n=this;this.customer_id=t.id;var u=this.userInfo2=e.getStorageSync("MD_userInfo2"),r=e.getStorageSync("MD_dict");this.areaTypeObj=(0,i.arrToObj)(r.area_type),this.getEstateList(),this.form.action=u.record_estate_action||"";var o=r.record_estate_action||[],a=[];o.forEach((function(e){e.val==u.record_estate_action&&(n.form.recordEstateActionName=e.key),a.push({value:e.val,label:e.key})})),this.groupTypeSelectList=[].concat(a)},created:function(){},onReady:function(){this.$refs.uForm.setRules(this.rules)},methods:{groupTypeSelectConfirm:function(e){var t=this;e.map((function(e,n){t.form.action=e.value,t.form.recordEstateActionName=e.label}))},getEstateList:function(){var t=this;e.api.estate.apiestatelist({page_size:100,report_open:1,estate_name:this.curEstateName}).then((function(e){var n=e.list||[];t.estateList=(0,r.default)(n)}))},listItemHandle:function(e){this.form.estate_id=e.estate_id,this.form.estate_name=e.estate_name},addImg:function(){var e=this;this.uploadComImg((function(t){var n=[].concat((0,r.default)(e.imgArr),(0,r.default)(t));e.imgArr=(0,r.default)(n)}),9)},uploadComImg:function(t,n,u){var r=this;e.chooseImage({count:n||1,sizeType:["compressed"],sourceType:["album","camera"],success:function(e){var n=e.tempFilePaths;if(n.length>0){var i=[];n.forEach((function(e,o){r.diyUploadFile(e,u).then((function(e){i.push(e),t&&i.length===n.length&&t(i)}))}))}}})},diyUploadFile:function(t,n){return new Promise((function(n,u){var r=e.getStorageSync("MD_token"),i=e.baseUrl+"api/upload/cloud";e.uploadFile({url:i,filePath:t,name:"upload",formData:{token:r},success:function(e){var t=JSON.parse(e.data),u=t.data.url||"";n(u)}})}))},delImg:function(e){var t=(0,r.default)(this.imgArr);t.splice(e,1),this.imgArr=(0,r.default)(t)},previewImageHandle:function(t,n){e.previewImage({current:t,urls:this.imgArr})},submitHandle:function(){var t=this;this.$refs.uForm.validate((function(n){if(n){var u="apiprivaterecordadd",r={record_remark:t.form.record_remark,estate_id:t.form.estate_id,estate_name:t.form.estate_name,action:t.form.action,remind:t.form.remind,customer_id:t.customer_id};t.imgArr&&(r.record_img=t.imgArr.join(",")),t.isEdit&&(u="apiprivaterecordedit",r.id=t.form.id),e.api.cust[u](r).then((function(n){t.isEdit?e.$msgConfirm("编辑成功",(function(){e.reLaunch({url:"/pages/cust/my"})}),(function(){e.reLaunch({url:"/pages/cust/my"})})):e.$msgConfirm("添加跟进记录成功,是否前往列表?",(function(){e.navigateBack()}),(function(){t.imgArr=[],t.form={record_remark:null}}))}))}else console.log("验证失败")}))}}};t.default=o}).call(this,n("543d")["default"])},"61b8":function(e,t,n){"use strict";n.r(t);var u=n("5e7b"),r=n.n(u);for(var i in u)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return u[e]}))}(i);t["default"]=r.a},"7bca":function(e,t,n){"use strict";n.r(t);var u=n("c3eb"),r=n("61b8");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i);n("bbaa");var o=n("f0c5"),a=Object(o["a"])(r["default"],u["b"],u["c"],!1,null,null,null,!1,u["a"],void 0);t["default"]=a.exports},bbaa:function(e,t,n){"use strict";var u=n("267b"),r=n.n(u);r.a},c3eb:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return u}));var u={uForm:function(){return n.e("uni_modules/vk-uview-ui/components/u-form/u-form").then(n.bind(null,"e893"))},uFormItem:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/vk-uview-ui/components/u-form-item/u-form-item")]).then(n.bind(null,"a81d"))},uInput:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/vk-uview-ui/components/u-input/u-input")]).then(n.bind(null,"830c"))},uImage:function(){return n.e("uni_modules/vk-uview-ui/components/u-image/u-image").then(n.bind(null,"9340"))},uGap:function(){return n.e("uni_modules/vk-uview-ui/components/u-gap/u-gap").then(n.bind(null,"9db7"))},uButton:function(){return n.e("uni_modules/vk-uview-ui/components/u-button/u-button").then(n.bind(null,"51b1b"))},uToast:function(){return n.e("uni_modules/vk-uview-ui/components/u-toast/u-toast").then(n.bind(null,"9568"))},uSelect:function(){return n.e("uni_modules/vk-uview-ui/components/u-select/u-select").then(n.bind(null,"17bf"))},uPopup:function(){return n.e("uni_modules/vk-uview-ui/components/u-popup/u-popup").then(n.bind(null,"7401"))},uTag:function(){return n.e("uni_modules/vk-uview-ui/components/u-tag/u-tag").then(n.bind(null,"e7ff"))}},r=function(){var e=this,t=e.$createElement;e._self._c;e._isMounted||(e.e0=function(t){e.actionSelectShow=!0},e.e1=function(t){e.propertySelectShow=!0},e.e2=function(t){e.propertySelectShow=!1},e.e3=function(t){e.propertySelectShow=!1})},i=[]}},[["06bb","common/runtime","common/vendor"]]]);