detail.js 8.1 KB

1
  1. require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/subPackages/repairprocessing-app/detail"],{1048:function(e,t,n){},"2a9f":function(e,t,n){"use strict";var a=n("bba2"),i=n.n(a);i.a},"726c":function(e,t,n){"use strict";(function(e,t){var a=n("4ea4");n("eaf5"),n("4a2a");a(n("66fd"));var i=a(n("f669"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(i.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},"7bdc":function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return a}));var a={uniEasyinput:function(){return n.e("uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput").then(n.bind(null,"2f62"))}},i=function(){var e=this.$createElement,t=(this._self._c,this.detail.contact&&this.detail.contact.length>0);this.$mp.data=Object.assign({},{$root:{g0:t}})},r=[]},"857e":function(e,t,n){"use strict";var a=n("1048"),i=n.n(a);i.a},bb40:function(e,t,n){"use strict";(function(e,a){var i=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n("2eee")),s=i(n("448a")),l=i(n("9523")),o=i(n("c973")),c=n("2679"),d=n("2679");function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,l.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var h={components:{TelNum:function(){n.e("pages/subPackages/components/tel-number/index").then(function(){return resolve(n("58c3"))}.bind(null,n)).catch(n.oe)},vanRate:function(){n.e("common/vendor").then(function(){return resolve(n("94f4"))}.bind(null,n)).catch(n.oe)}},data:function(){return{handleUserId2:"",userId2:"",dispatchUserId2:"",dic_key:["QUICK_SELECTION","REPAIR_STATUS"],dic_SelectList:{},detailId:"",handleUrlList:[],fileUrls:[],handleUrls:[],detailStatus:"1",explainAnnexList:[],processedAnnexList:[],stepActive:0,processSteps:[{id:1,status:1,text:"上报"},{id:2,status:1,text:"已受理"},{id:3,status:1,text:"已处理"},{id:4,status:0,text:"已确认"}],evaluateVal:0,id:"",detail:{},fileUrlList:[],params:{id:"",handleUrl:"",handleTime:"",status:"processed"}}},onLoad:function(e){this.id=e.id,this.getByCodes()},methods:{deleteRYXXZP:function(e){console.log(e.detail.file.id);var t=this.handleUrlList.findIndex((function(t){return t.id==e.detail.file.id}));console.log("deleteRYXXZP",t);var n=JSON.parse(JSON.stringify(this.handleUrlList));n.splice(t,1),this.handleUrlList=n},orderOut:function(){var t=this;return(0,o.default)(r.default.mark((function n(){var i;return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:i=t,console.log(i.detail.reportRepairId),e.showModal({title:"提示",confirmText:"退回",content:"是否退回到派单阶段?",success:function(){var e=(0,o.default)(r.default.mark((function e(t){var n,s;return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.confirm){e.next=8;break}return n={id:i.id,reportRepairId:i.detail.reportRepairId,userId:(0,c.getUserLocalStorageInfo)().user.id},e.next=4,(0,c.handleReportBack)(n);case 4:s=e.sent,200==s.code&&(i.$showToast("退回成功"),a.navigateBack({})),e.next=9;break;case 8:t.cancel&&console.log("用户点击取消");case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()});case 3:case"end":return n.stop()}}),n)})))()},getByCodes:function(){var e=this;return(0,o.default)(r.default.mark((function t(){var n;return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,(0,c.getByCodes)(JSON.stringify(e.dic_key));case 2:n=t.sent,e.dic_SelectList=e.$common.handleDicList(n),e.getDetailById();case 5:case"end":return t.stop()}}),t)})))()},onSelect:function(e){this.value=e.text,this.params.handleUserId=e.value+"-"+e.text,this.showPicker=!1},onConfirm:function(e){var t=this;a.showModal({title:"提示",content:"是否确认提交",success:function(e){if(e.confirm){if(!t.params.remark||0==t.params.remark.length)return void t.$showToast("请填写处理说明");t.params.id=t.id,t.params.handleTime=t.detail.handleTime;var n=[];if(t.handleUrlList&&t.handleUrlList.length>0&&(n=t.handleUrlList.map((function(e){return e.id}))),t.params.handleExplain=t.detail.handleExplain,t.params.updatedBy=(0,c.getUserLocalStorageInfo)().user.id,t.params.handleUrl=n.join(","),t.params.userId=(0,c.getUserLocalStorageInfo)().user.id,2==t.detail.status){var i=f({},t.params);delete i.status,(0,d.editReportInfo)(i).then((function(e){t.$showToast("结案成功"),a.switchTab({url:"/pages/index/index"})}))}else{var r=f({},t.params);delete r.status,(0,c.editRepair)(r).then((function(e){t.$showToast("结案成功"),a.switchTab({url:"/pages/index/index"})}))}}else e.cancel&&console.log("用户点击取消")}})},getDetailById:function(){var e=this,t=this;(0,c.getHandleInfoById)(t.id).then((function(n){if(console.log(n.data),n.data){var a=t.getItemJson(n.data);if(e.detail=a,e.detail.handleExplain=a.handleExplain,null!=a.dispatchUserId&&""!==a.dispatchUserId){var i=a.dispatchUserId.split("-");console.log(i),e.dispatchUserId2=i[1]+"-"+i[2]}null!=a.handleUserId&&""!==a.handleUserId&&(e.handleUserId2=a.handleUserName),console.log("det.handleUrlList",a.handleUrlList),e.handleUrlList=a.handleUrlList,a.fileUrl&&a.fileUrl.length>0&&(e.explainAnnexList=a.fileUrl.split(",").map((function(t){return{url:e.$constant.BASE_URI+"/wx/fileController/download/"+t,id:t,isImage:!0,deletable:!1}}))),console.log("asodmqowndonq",e.explainAnnexList),e.detailStatus=a.status,e.params.remark=a.remark}}))},getItemJson:function(e){var t=this;e.handleTime||(e.handleTime=this.$common.transServDate(new Date));var n=e.handleUrl?e.handleUrl.split(","):[],a=[];switch(null!==n&&n.length>0&&n.forEach((function(e){a.push({url:t.$constant.BASE_URI+"/wx/fileController/download/"+e,isImage:!0,id:e})})),e.handleUrlList=a,console.log(e.handleUrlList),e.serviceType=this.dic_SelectList.QUICK_SELECTION[e.serviceType-1].label,e.status){case"0":this.stepActive=0;break;case"1":this.stepActive=1;break;case"2":this.stepActive=2;break;case"3":this.stepActive=3;break;case"4":this.stepActive=0;break;case"5":this.stepActive=5;break}return e},afterRead:function(e){var t=this,n=e.detail.file;try{a.uploadFile({url:t.$constant.BASE_URI+"/wx/fileController/upload",filePath:n.url,name:"file",formData:{user:"test"},success:function(e){var n=JSON.parse(e.data),a=n.data;console.log(a[0]),t.handleUrlList.push({id:a[0],url:t.$constant.BASE_URI+"/FileController/download/"+a[0],isImage:!0}),t.handleUrlList=(0,s.default)(t.handleUrlList),t.$forceUpdate(),console.log(t.fileUrlList)},fail:function(e){}})}catch(i){}},beforeDelete:function(e,t){var n=this;return n.handleUrls.splice(t.index,1),function(e,a){var i=a.index;n.handleUrls[t.index].splice(i,1)}},uploadImg:function(e){var t=this,n=new FormData;n.append("file",e.file),console.log(n.get("file"));var a={headers:{"Content-Type":"multipart/form-data","MVVM-Key":String((new Date).getTime()),xx:"anything"}};return new Promise((function(e,i){axios.post("/smartParkH5Server/wx/fileController/upload",n,a).then((function(e){var n=e.data.data.substring(1,e.data.data.length);n=n.substring(0,n.length-1),t.handleUrls.push(t.$common.castEval(n))})).catch((function(e,t){i(e,t)}))}))}}};t.default=h}).call(this,n("bc2e")["default"],n("543d")["default"])},bba2:function(e,t,n){},d010:function(e,t,n){"use strict";n.r(t);var a=n("bb40"),i=n.n(a);for(var r in a)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(r);t["default"]=i.a},f669:function(e,t,n){"use strict";n.r(t);var a=n("7bdc"),i=n("d010");for(var r in i)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(r);n("857e"),n("2a9f");var s=n("f0c5"),l=Object(s["a"])(i["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],void 0);t["default"]=l.exports}},[["726c","common/runtime","common/vendor"]]]);