add.js 5.2 KB

1
  1. require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/subPackages/repairDispatch-app/add"],{"37c5":function(e,t,n){"use strict";n.r(t);var i=n("5a66"),o=n.n(i);for(var s in i)["default"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(s);t["default"]=o.a},"43cc":function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return i}));var i={uniEasyinput:function(){return n.e("uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput").then(n.bind(null,"2f62"))}},o=function(){var e=this.$createElement;this._self._c},s=[]},"5a66":function(e,t,n){"use strict";(function(e){var i=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n("2eee")),s=i(n("448a")),c=i(n("c973")),a=n("2679"),r={components:{vanRadio:function(){n.e("common/vendor").then(function(){return resolve(n("2472"))}.bind(null,n)).catch(n.oe)},vanRadioGroup:function(){n.e("common/vendor").then(function(){return resolve(n("a8af"))}.bind(null,n)).catch(n.oe)}},data:function(){return{name:"",dic_SelectList:{},dic_key:["QUICK_SELECTION"],reportTypeSleced:"1",quickSleced:{},quickList:[],positionSleced:"1",showPicker:!1,positionList:[{val:"1",label:"室内"},{val:"2",label:"公区"}],fileUrlList:[],fileUrls:[],form:{groupId:"",companyId:"",companyName:"",type:"1",serviceType:"",description:"",position:"1",fileUrl:"",status:"unAcceptance"},handleUserNames:"",handleUserIds:"",columns:[]}},onLoad:function(){var e=this;this.getByCodes(this.dic_SelectList),this.form.userId=(0,a.getUserLocalStorageInfo)().user.truename+"-"+(0,a.getUserLocalStorageInfo)().user.phone,(0,a.getDispatchToPerson)({groupId:"",name:""}).then((function(t){e.columns=t.data}))},methods:{closePopup:function(){this.showPicker=!1},getSelectValue:function(){for(var e=[],t=[],n=0;n<this.columns.length;n++){var i=this.columns[n];i.checked&&(e.push(i.text),t.push(i.value))}console.log(this.handleUserNames.split(","));var o=Array.from(new Set(e.concat(this.handleUserNames.length>0?this.handleUserNames.split(","):[])));console.log(o);var s=Array.from(new Set(t.concat(this.handleUserIds.length>0?this.handleUserIds.split(","):[])));this.form.handleUserName=o.toString(),this.form.handleUserId=s.toString(),console.log(this.columns),this.$forceUpdate(),this.showPicker=!1},onChange:function(e,t){console.log(e),console.log(t),this.columns[t].checked=e.detail},getByCodes:function(){var e=this;return(0,c.default)(o.default.mark((function t(){var n;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,(0,a.getByCodes)(JSON.stringify(e.dic_key));case 2:n=t.sent,e.dic_SelectList=e.$common.handleDicList(n);case 4:case"end":return t.stop()}}),t)})))()},quickSelect:function(e){this.quickSleced.value&&this.quickSleced.value===e.value?(this.quickSleced={},console.log(123)):(console.log(e),this.quickSleced=e,this.form.description="",this.form.description=this.form.description+e.label)},beforeDelete:function(e,t){var n=this;return n.fileUrlList.splice(t.index,1),function(e,i){var o=i.index;n.fileUrlList[t.index].splice(o,1)}},openPicker:function(){this.showPicker=!0},closePicker:function(){this.showPicker=!1},getName:function(){console.log(123,this.name);var e=this;(0,a.getDispatchToPerson)({name:this.name,groupId:""}).then((function(t){e.columns=t.data,e.$forceUpdate()}))},afterRead:function(t){var n=this,i=t.detail.file;console.log(i),e.uploadFile({url:n.$constant.BASE_URI+"/wx/fileController/upload",filePath:i[0].url,name:"file",formData:{user:"test"},success:function(e){var t=JSON.parse(e.data),i=t.data;console.log(i[0]),n.fileUrlList.push({id:i[0],url:n.$constant.BASE_URI+"/FileController/download/"+i[0],isImage:!0}),n.fileUrlList=(0,s.default)(n.fileUrlList),n.$forceUpdate(),console.log(n.fileUrlList)},fail:function(e){}})},submit:function(){var t=this;if(null!=t.quickSleced.value&&""!==t.quickSleced.value)if(t.form.contact&&0!=t.form.contact.length){var n=(0,a.getUserLocalStorageInfo)().user;t.form.groupId="870261874875170816";var i="";t.fileUrlList&&t.fileUrlList.length>0&&(i=t.fileUrlList.map((function(e){return e.id}))),t.form.fileUrl=i?i.join(","):[],t.form.userId=n.id,t.form.serviceType=this.quickSleced.value,t.form.createdBy=n.id,(0,a.addRepair)(t.form).then((function(n){t.$showToast("填报成功"),e.navigateBack({})}))}else this.$showToast("请输入联系方式");else this.$showToast("请选择服务类型")},changePosition:function(e){}}};t.default=r}).call(this,n("543d")["default"])},7619:function(e,t,n){"use strict";var i=n("fde9"),o=n.n(i);o.a},"8bdf":function(e,t,n){"use strict";n.r(t);var i=n("43cc"),o=n("37c5");for(var s in o)["default"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(s);n("7619"),n("9980");var c=n("f0c5"),a=Object(c["a"])(o["default"],i["b"],i["c"],!1,null,"3cb063b7",null,!1,i["a"],void 0);t["default"]=a.exports},9980:function(e,t,n){"use strict";var i=n("fb71"),o=n.n(i);o.a},fb16:function(e,t,n){"use strict";(function(e,t){var i=n("4ea4");n("eaf5"),n("4a2a");i(n("66fd"));var o=i(n("8bdf"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(o.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},fb71:function(e,t,n){},fde9:function(e,t,n){}},[["fb16","common/runtime","common/vendor"]]]);