You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
6.1 KiB

5 months ago
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["technician/pages/time-manage"],{"14e4":function(t,e,i){"use strict";var n=i("8da0"),r=i.n(n);r.a},1634:function(t,e,i){"use strict";var n=i("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(i("7eb4")),a=n(i("ee10")),o=n(i("7ca3")),s=i("8f59"),u=n(i("cd23"));function c(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function f(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?c(Object(i),!0).forEach((function(e){(0,o.default)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):c(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var d={components:{wPicker:function(){i.e("components/w-picker/w-picker").then(function(){return resolve(i("13f3"))}.bind(null,i)).catch(i.oe)},tab:function(){i.e("components/tab").then(function(){return resolve(i("bfa8"))}.bind(null,i)).catch(i.oe)}},data:function(){return{toDay:"",toDayTime:"",showKey:"",showTime:!1,form:{id:0,is_work:0,start_time:"",end_time:"",coach_status:0,time_unit:""},dayList:[],dayCurrent:0}},computed:(0,s.mapState)({primaryColor:function(t){return t.config.configInfo.primaryColor},subColor:function(t){return t.config.configInfo.subColor},userInfo:function(t){return t.user.userInfo}}),onLoad:function(){this.initIndex()},methods:f(f({},(0,s.mapMutations)(["updateTechnicianItem"])),{},{initIndex:function(){var t=this;return(0,a.default)(r.default.mark((function e(){var i,n,a;return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=new Date(Math.ceil((new Date).getTime())),t.toDay=t.$util.formatTime(i,"YY-M-D"),t.toDayTime=t.$util.formatTime(i,"h:m"),e.next=5,t.$api.technician.timeConfig();case 5:for(a in n=e.sent,t.form)t.form[a]=n[a];n.day_list.forEach((function(t,e){t.title=0==e?"今天":t.dat_text,t.sub=[]})),t.form.time_unit=n.time_unit,t.dayList=n.day_list,t.$util.setNavigationBarColor({bg:t.primaryColor}),t.toCount();case 12:case"end":return e.stop()}}),e)})))()},toChangeItem:function(){3!=this.form.coach_status&&(this.form.is_work=1==this.form.is_work?0:1)},toShowTime:function(t){3!=this.form.coach_status&&(this.showKey=t,this.showTime=!0)},onConfirm:function(t){this.form[this.showKey]=t.result,this.toCount()},toCount:function(){var t=this.toDay,e=void 0===t?"":t,i=this.form,n=i.start_time,r=void 0===n?"":n,a=i.end_time,o=void 0===a?"":a;e&&r&&o&&(this.dayList.forEach((function(t){t.sub=[]})),this.getTimeCall())},getTimeCall:function(){var t=this;return(0,a.default)(r.default.mark((function e(){var i,n,a,o,s,u,c,f;return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.$util.showLoading(),i=t.form,n=i.start_time,a=void 0===n?"":n,o=i.end_time,s=void 0===o?"":o,u=t.dayCurrent,c=t.dayList,e.next=5,t.$api.technician.getTime({start_time:a,end_time:s,dat_str:c[u].dat_str});case 5:f=e.sent,t.dayList[u].sub=f,t.$util.hideAll();case 8:case"end":return e.stop()}}),e)})))()},setDate:function(t){this.dayCurrent=t},getDateTime:function(t){if(3!=this.form.coach_status){var e=this.dayCurrent,i=this.dayList[e].sub,n=void 0===i?[]:i,r=n[t],a=r.is_click,o=r.is_order,s=r.status;n&&1==o||(this.dayList[e].sub[t].is_click=0==a?1:0,this.dayList[e].sub[t].status=0==s?1:0)}},handerTabChange:function(t){3!=this.form.coach_status&&(this.dayCurrent=t,this.dayList[t].sub&&this.dayList[t].sub.length||this.getTimeCall())},isTimes:function(t){var e=new Date;return e.getTime()/1e3>t},submit:function(){var t=this;return(0,a.default)(r.default.mark((function e(){var i,n;return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.$util.deepCopy(t.form),i.start_time&&i.end_time){e.next=4;break}return t.$util.showToast({title:i.start_time?"请选择结束时间":"请选择开始时间"}),e.abrupt("return");case 4:return delete i.coach_statu