1 line
4.4 KiB
JavaScript
1 line
4.4 KiB
JavaScript
require('../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesA/punchclock/clockrules/clockPeriod"],{"42b8":function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={data:function(){return{noClick:!0,timeArr:[]}},onLoad:function(){this.timeArr=t.getStorageSync("timeArr"),console.log(this.timeArr,"====")},methods:{changeGoto:function(e,i){var r=e.detail.value,n=this.timeArr[i];if(n.start_time=r,1!=n.end_next){var s=n.start_time.split(":"),a=n.end_time.split(":"),o=new Date;if(o.setHours(s[0],s[1])>o.setHours(a[0],a[1])?(t.showToast({title:"上班时间应该早于下班时间",icon:"none"}),this.isProblem=!0,this.problemTit="上班时间应该早于下班时间"):(this.isProblem=!1,this.problemTit=""),0!=i){var c=this.timeArr[i-1];r<c.end_time&&(n.start_next=1,n.end_next=1)}}else if(1==n.end_next&&i>0){var l=this.timeArr[i-1],u=n.start_time.split(":"),h=l.end_time.split(":"),m=new Date;m.setHours(u[0],u[1])<m.setHours(h[0],h[1])?(t.showToast({title:"上班时间应该大于上一段的下班时间",icon:"none"}),this.isProblem=!0,this.problemTit="上班时间应该大于上一段的下班时间"):(n.start_next=0,this.isProblem=!0,this.problemTit="")}this.$set(this.timeArr,i,n)},changeGotoStart:function(t,e){var i=t.detail.value,r=this.timeArr[e];r.ustart_time=i,this.$set(this.timeArr,e,r)},changeGotoEnd:function(t,e){var i=t.detail.value,r=this.timeArr[e];r.uend_time=i,this.$set(this.timeArr,e,r)},changeStart:function(t,e){console.log(t,"=====");var i=t.detail.value?0:1,r=this.timeArr[e];r.start_status=i,this.$set(this.timeArr,e,r)},changeGoOff:function(e,i){var r=this,n=e.detail.value,s=this.timeArr[i];s.end_time=n;var a=s.start_time.split(":"),o=s.end_time.split(":"),c=new Date;if(0==s.start_next&&0==s.end_next&&c.setHours(a[0],a[1])>c.setHours(o[0],o[1])&&(s.end_next=1),(1==s.start_next&&1==s.end_next||0==s.start_next&&0==s.end_next)&&(c.setHours(a[0],a[1])>c.setHours(o[0],o[1])?(t.showToast({title:"上班时间应该早于下班时间",icon:"none"}),this.isProblem=!0,this.problemTit="上班时间应该早于下班时间"):(this.isProblem=!1,this.problemTit="")),1==s.end_next&&0==this.timeArr[0].start_next){var l=this.timeArr[0].start_time,u=n;this.handleSameday(l,u)||t.showModal({title:"提示",content:"最早上班时间与最晚下班时间跨度不能超过24小时",showCancel:!1,complete:function(t){t.confirm&&(r.isProblem=!0,r.problemTit="最早上班时间与最晚下班时间跨度不能超过24小时")}})}this.$set(this.timeArr,i,s)},handleSameday:function(t,e){if(!t||!e)return"";var i=t.split(":"),r=parseInt(60*i[0])+parseInt(i[1]),n=e.split(":"),s=parseInt(60*n[0])+parseInt(n[1]),a=1440-r+s;return!(a>1440)},changeGoOffStart:function(t,e){var i=t.detail.value,r=this.timeArr[e];r.dstart_time=i,this.$set(this.timeArr,e,r)},changeGoOffEnd:function(e,i){var r=e.detail.value,n=this.timeArr[i];n.dend_time=r,this.$set(this.timeArr,i,n),1==n.end_next&&0==this.timeArr[0].start_next&&(this.handleSameday(this.timeArr[0].ustart_time,r)||t.showModal({title:"提示",content:"上班打卡时间和下班打卡时间须在24小时之内",complete:function(t){}}))},changeEnd:function(t,e){var i=t.detail.value?0:1,r=this.timeArr[e];r.end_status=i,this.$set(this.timeArr,e,r)},toSave:function(){t.setStorageSync("timeArr",this.timeArr),t.navigateBack({delta:1})}}};e.default=i}).call(this,i("543d")["default"])},"63c5":function(t,e,i){"use strict";i.r(e);var r=i("42b8"),n=i.n(r);for(var s in r)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return r[t]}))}(s);e["default"]=n.a},"68a8":function(t,e,i){},"72fb":function(t,e,i){"use strict";i.d(e,"b",(function(){return r})),i.d(e,"c",(function(){return n})),i.d(e,"a",(function(){}));var r=function(){var t=this.$createElement;this._self._c},n=[]},"9acb":function(t,e,i){"use strict";var r=i("68a8"),n=i.n(r);n.a},ece9:function(t,e,i){"use strict";i.r(e);var r=i("72fb"),n=i("63c5");for(var s in n)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(s);i("9acb");var a=i("f0c5"),o=Object(a["a"])(n["default"],r["b"],r["c"],!1,null,"3e0d3134",null,!1,r["a"],void 0);e["default"]=o.exports},fc27:function(t,e,i){"use strict";(function(t,e){var r=i("4ea4");i("8886");r(i("66fd"));var n=r(i("ece9"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(n.default)}).call(this,i("bc2e")["default"],i("543d")["createPage"])}},[["fc27","common/runtime","common/vendor"]]]); |