require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugin/work_order/create"],{"3b85":function(e,t,n){"use strict";n.r(t);var r=n("afc0"),i=n("93aa");for(var o in i)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(o);n("ca70");var a=n("828b"),u=Object(a["a"])(i["default"],r["b"],r["c"],!1,null,"519de8e4",null,!1,r["a"],void 0);t["default"]=u.exports},"3e57":function(e,t,n){"use strict";(function(e,t){var r=n("47a9");n("4c1a");r(n("3240"));var i=r(n("3b85"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},8563:function(e,t,n){"use strict";(function(e){var r=n("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n("7eb4")),o=r(n("ee10")),a={components:{createForm:function(){n.e("plugin/work_order/components/createForm").then(function(){return resolve(n("d1e4"))}.bind(null,n)).catch(n.oe)}},data:function(){return{currentStep:0,categories:[],form:{category_id:null,title:"",content:"",images:[],mobile:""},submitting:!1,category_title:""}},onLoad:function(){this.getCategoryList()},methods:{getCategoryList:function(){var e=this;this.$util.get("workorder/category/getList").then((function(t){1==t.code&&(e.categories=t.data.list)}))},selectCategory:function(e){this.form.category_id=e.id,this.currentStep=1,this.getFormData()},getFormData:function(){var e=this;this.$util.get("workorder/category/detail",{id:this.form.category_id}).then((function(t){1==t.code&&(e.category_title=t.data.title,e.form={category_id:t.data.id,title:"",content:"",images:[],form:t.data.form.map((function(e){return"images"==e.type&&(e.value=[]),e}))})}))},validate:function(){var t=this;return new Promise((function(n,r){t.form.category_id||r({field:"category_id",message:"请选择问题分类"}),t.form.title.trim()||r({field:"title",message:"请填写工单标题"}),t.form.content.trim()||r({field:"content",message:"请填写问题内容"}),t.form.form.forEach((function(t){t.required&&!t.value&&r({field:t.name,message:t.label+"不能为空"}),"mobile"==t.type&&t.required&&(e.$u.test.mobile(t.value)||r({field:t.name,message:"手机号格式不正确"})),"idcard"==t.type&&t.required&&(e.$u.test.idCard(t.value)||r({field:t.name,message:"身份证格式不正确"}))})),n(!0)}))},submitTicket:function(){var e=this;return(0,o.default)(i.default.mark((function t(){return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.validate().then(function(){var t=(0,o.default)(i.default.mark((function t(n){var r,o;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!n){t.next=19;break}if(!e.submitting){t.next=3;break}return t.abrupt("return");case 3:return e.submitting=!0,t.prev=4,r={category_id:e.form.category_id,title:e.form.title,content:e.form.content,images:e.form.images,form:e.form.form},t.next=8,e.$util.post("workorder/workorder/submit",r);case 8:o=t.sent,1===o.code?e.$util.toast(o.message,1500,(function(){e.$util.backPage("/plugin/work_order/index")})):e.$util.toast(o.message||"提交失败"),t.next=16;break;case 12:t.prev=12,t.t0=t["catch"](4),e.$util.toast("提交失败，请稍后重试");case 16:return t.prev=16,e.submitting=!1,t.finish(16);case 19:case"end":return t.stop()}}),t,null,[[4,12,16,19]])})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$util.toast(t.message||"提交失败")}));case 1:case"end":return t.stop()}}),t)})))()}}};t.default=a}).call(this,n("df3c")["default"])},"8d44":function(e,t,n){},"93aa":function(e,t,n){"use strict";n.r(t);var r=n("8563"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(o);t["default"]=i.a},afc0:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return r}));var r={uSteps:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-steps/u-steps")]).then(n.bind(null,"89d2"))},uStepsItem:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-steps-item/u-steps-item")]).then(n.bind(null,"381b"))},uIcon:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(n.bind(null,"b248"))}},i=function(){var e=this,t=e.$createElement;e._self._c;e._isMounted||(e.e0=function(t){e.currentStep=0})},o=[]},ca70:function(e,t,n){"use strict";var r=n("8d44"),i=n.n(r);i.a}},[["3e57","common/runtime","common/vendor"]]]);