hz-zhhq-app/unpackage/dist/build/wit-rear/static/js/pages-washcar-washCarReserv...

1 line
86 KiB
JavaScript
Raw Normal View History

2025-01-22 10:53:47 +08:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-washcar-washCarReservation"],{2331:function(e,t,a){"use strict";a.r(t);var n=a("e915"),i=a("424f");for(var o in i)"default"!==o&&function(e){a.d(t,e,(function(){return i[e]}))}(o);a("97fe");var r,c=a("f0c5"),s=Object(c["a"])(i["default"],n["b"],n["c"],!1,null,"8769d7e0",null,!1,n["a"],r);t["default"]=s.exports},"2ef5":function(e,t,a){"use strict";var n=a("ee27");a("99af"),a("d3b7"),a("4d63"),a("ac1f"),a("25f0"),a("5319"),a("1276"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(a("d0ff")),o=a("b742"),r=a("37f6"),c=n(a("8e28")),s=n(a("bd50")),u=n(a("2331")),d={components:{loadMore:c.default,contentNone:s.default,inputAutocomplete:u.default},data:function(){return{page:1,pageSize:10,loadingType:0,contentText:{contentdown:"上拉加载更多",contentrefresh:"正在加载...",contentnomore:"没有更多数据了"},userId:(0,o.getStorage)("userInfo").id,currentTabIndex:0,date:(0,o.getDate)(),chooseDateIndex:0,times:[],chooseTimeIndex:null,deptList:[],places:[],placeIndex:0,departmentIndex:0,applyPersonName:(0,o.getStorage)("userInfo").username,applyPersonMobile:(0,o.getStorage)("userInfo").telnumber,carId:"",commentList:[],reservationList:[],formatDate:o.formatDate,licensePlateList:[],licensePlateListIndex:0}},onLoad:function(e){this.currentTabIndex=e.currentTabIndex||0},onShow:function(){this.getCalendar(),this.getDepartment(),0==this.currentTabIndex?this.initData():(this.page=1,this.loadingType=0,this.getReservationRecord())},watch:{currentTabIndex:function(e,t){1==e?(this.page=1,this.loadingType=0,this.getReservationRecord()):this.initData()}},methods:{getCalendar:function(e){var t=this,a={method:"greenCalendar/getCalendarList",data:{date_name:this.date[0].tiems}};(0,o.callbackRequest)(a).then((function(e){if(1==e.data.returnCode)for(var a=e.data.returnData,n=0;n<t.date.length;n++){for(var i=!0,o=0;o<a.length;o++)a[o].date_name==t.date[n].tiems&&(t.$set(t.date[n],"isholiday",a[o].isholiday),i=!1);i&&t.$set(t.date[n],"isholiday","0")}}))},compareTime:function(e){var t=e.split("-")[0],a=this.date[this.chooseDateIndex].tiems+" "+t;a=a.replace(/-/g,"/");var n=new Date(a).getTime(),i=(new Date).getTime();return n>i},compareTimeForRecord:function(e,t){var a=t.split("-")[1],n=e+" "+a;n=n.replace(/-/g,"/");var i=new Date(n).getTime(),o=(new Date).getTime();return i<o},loadAutocompleteData:function(e){this.$root;return Promise.resolve(this.licensePlateList)},selectItemD:function(e){console.log("收到数据了:",e)},initData:function(){var e=this,t={method:r.initWashCar,data:{applyDate:this.date[this.chooseDateIndex].tiems,userId:this.userId}};(0,o.callbackRequest)(t).then((function(t){if(1==t.data.returnCode){e.times=t.data.returnData.timeList;for(var a=0;a<e.times.length;a++){var n=e.compareTime(e.times[a].time);e.times[a].compareTime=n}var i=t.data.returnData.placeList;e.places=[];for(a=0;a<i.length;a++)e.places.push(i[a].data_value);var o=t.data.returnData.licensePlateList;e.licensePlateList=[];for(a=0;a<o.length;a++)e.licensePlateList.push(o[a].licenseplate)}}))},getDepartment:function(){var e=this,t={method:r.getAllDept,data:{}};(0,o.callbackRequest)(t).then((function(t){1==t.data.returnCode&&(e.deptList=t.data.returnData)}))},getReservationRecord:function(){var e=this,t={method:r.getMyWashCarList,data:{pageSize:this.pageSize,pageNum:this.page,userId:this.userId}};(0,o.callbackRequest)(t).then((function(t){if(1==t.data.returnCode){1==e.page?e.reservationList=t.data.returnData:t.data.returnData.length>0?(e.reservationList=[].concat((0,i.default)(e.reservationList),(0,i.default)(t.data.returnData)),e.loadingType=0):e.loadingType=2;for(var a=0;a<e.reservationList.length;a++){var n=e.compareTimeForRecord(e.reservationList[a].apply_date,e.reservationList[a].apply_time_interval);e.reservationList[a].compareTime=n}console.log(e.reservationList)}}))},switchTab:function(e){this.chooseDateIndex=e,this.initData()},chooseTime:function(e,t){if(0==t)return(0,o.alertTip)("该时间段已约满,请选择其它时间段"),this.chooseTimeIndex=null,!1;