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 lines
6.1 KiB

(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_status,n=t.$util.deepCopy(t.dayList),i.time_text=n,t.$util.showLoading(),e.next=10,t.$api.technician.setTimeConfig(i);case 10:t.$util.hideAll(),t.$util.showToast({title:"保存成功"}),t.updateTechnicianItem({key:"haveOperItem",val:!0}),setTimeout((function(){t.$util.back(),t.$util.goUrl({url:1,openType:"navigateBack"})}),1e3);case 14:case"end":return e.stop()}}),e)})))()}}),filters:{handleStartEndTime:function(t,e){var i="",n=t.start_time,r=t.end_time,a="".concat(e," ").concat(n),o="".concat(e," ").concat(r);return n&&r&&u.default.DateToUnix(a)>=u.default.DateToUnix(o)&&(i="次日"),i}}};e.default=d},"35c1":function(t,e,i){"use strict";(function(t,e){var n=i("47a9");i("7043");n(i("3240"));var r=n(i("ffb1"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(r.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},"8da0":function(t,e,i){},aef1:function(t,e,i){"use strict";i.r(e);var n=i("1634"),r=i.n(n);for(var a in n)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(a);e["default"]=r.a},f0d4:function(t,e,i){"use strict";i.d(e,"b",(function(){return r})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){return n}));var n={wPicker:function(){return i.e("components/w-picker/w-picker").then(i.bind(null,"13f3"))}},r=function(){var t=this,e=t.$createElement,i=(t._self._c,t._f("handleStartEndTime")(t.form,t.toDay)),n=t.dayList.length,r=t.dayList.length,a=r>0?t.__map(t.dayList[t.dayCurrent].sub,(function(e,i){var n=t.__get_orig(e),r=t.isTimes(e.time_str)||1==e.is_order||3==t.form.coach_status,a=3!=t.form.coach_status&&0==e.status&&0==e.is_order&&!t.isTimes(e.time_str),o=0==e.status&&0==e.is_order&&!t.isTimes(e.time_str),s=t.isTimes(e.time_str)||0==e.status;return{$orig:n,m0:r,m1:a,m2:o,m3:s}})):null;t.$mp.data=Object.assign({},{$root:{f0:i,g0:n,g1:r,l0:a}})},a=[]},ffb1:function(t,e,i){"use strict";i.r(e);var n=i("f0d4"),r=i("aef1");for(var a in r)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return r[t]}))}(a);i("14e4");var o=i("828b"),s=Object(o["a"])(r["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);e["default"]=s.exports}},[["35c1","common/runtime","common/vendor"]]]);