(window["webpackJsonp_smart-attendance"]=window["webpackJsonp_smart-attendance"]||[]).push([["chunk-ef8dd552"],{2308:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("CwMainLayout",{staticClass:"sch-kind",attrs:{loading:t.loading},scopedSlots:t._u([{key:"op-header",fn:function(){return[n("CwHeaderLayout",{attrs:{showHeaderBottomLine:!1},scopedSlots:t._u([{key:"op",fn:function(){return[n("CwOp",{attrs:{items:t.opItems}})]},proxy:!0}])})]},proxy:!0}])},[n("InTable",{attrs:{query:t.searchList,data:t.tableData,columns:t.columns,paginationAttrs:t.paginationAttrs},on:{"pagination-change":function(e){return t.getList(!1)}}}),n("AddEdit",{key:t.modalKey+"addedit",ref:"refAddEdit",on:{getList:t.getList}})],1)},a=[],i=(n("d3b7"),n("4ae1"),n("25f0"),n("96cf"),n("c964")),o=n("276c"),s=n("e954"),c=n("920b"),u=n("e1a7"),d=n("f20d"),l=n("9ab4"),f=n("4d8e"),p=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("CwModal",{ref:"infoModal",staticClass:"addedit-modal",class:{add_modal:t.typeObj.add},attrs:{width:"520px",title:t.ops.title,submitLoading:t.loading,showFooter:!t.typeObj.view},on:{confirm:t.submitFrom,closes:t.close}},[n("CwForm",{ref:"cwform",attrs:{formAttrs:t.formAttrs,formItems:t.formItems,options:t.options,rules:t.rules,ruleForm:t.addList},scopedSlots:t._u([{key:"endWorkTime",fn:function(){return[n("div",{staticClass:"time-wrap"},[n("el-time-picker",{staticStyle:{width:"100%"},attrs:{"value-format":"HH:mm:ss",placeholder:"请选择下班时间"},model:{value:t.addList.endWorkTime,callback:function(e){t.$set(t.addList,"endWorkTime",e)},expression:"addList.endWorkTime"}}),n("el-checkbox",{model:{value:t.addList.isNextDay,callback:function(e){t.$set(t.addList,"isNextDay",e)},expression:"addList.isNextDay"}},[t._v("次日")])],1)]},proxy:!0},{key:"timeR",fn:function(){return[n("div",{staticClass:"timer-wrap"},[n("el-time-picker",{attrs:{"value-format":"HH:mm:ss",placeholder:"适用开始"},model:{value:t.addList.startAdaptTime,callback:function(e){t.$set(t.addList,"startAdaptTime",e)},expression:"addList.startAdaptTime"}}),n("span",{staticClass:"text"},[t._v(" 至 ")]),n("el-time-picker",{attrs:{"value-format":"HH:mm:ss",placeholder:"适用结束"},model:{value:t.addList.endAdaptTime,callback:function(e){t.$set(t.addList,"endAdaptTime",e)},expression:"addList.endAdaptTime"}})],1)]},proxy:!0}])})],1)},h=[],m=(n("a9e3"),n("ac1f"),n("1276"),n("f3f3")),y=n("48b1"),b=n("60a3");function v(t){function e(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}return function(){var n,r=Object(d["a"])(t);if(e()){var a=Object(d["a"])(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(u["a"])(this,n)}}var g=function(t){Object(c["a"])(n,t);var e=v(n);function n(){var t;return Object(o["a"])(this,n),t=e.apply(this,arguments),t.addList={shiftName:"",startWorkTime:"",endWorkTime:"",startAdaptTime:"",endAdaptTime:"",isNextDay:!1,attendDays:void 0,timeR:"121"},t.options={shiftType:t.GFgetTypeConfig("ATD_TYPE",{type:"select"})},t.rules={shiftName:[{required:!0,message:"请输入班种名称",trigger:"blur"}],shiftType:[{required:!0,message:"请输入考勤类型",trigger:"blur"}],timeR:[{required:!0,message:"请选择适用时段",trigger:"blur"}],workDays:[{required:!0,message:"请输入考勤时长",trigger:"blur"}],attendDays:[{required:!0,message:"请输入考勤时长",trigger:"blur"}],startWorkTime:[{required:!0,message:"请选择上班时间",trigger:"blur"}],endWorkTime:[{required:!0,message:"请选择下班时间",trigger:"blur"}]},t}return Object(s["a"])(n,[{key:"getDetail",value:function(t,e){this.addList.isNextDay=1===this.addList.isNextDay}},{key:"validate",value:function(){if(!this.isRest){var t=this.addList,e=t.isNextDay,n=t.startWorkTime,r=t.endWorkTime,a=t.startAdaptTime,i=t.endAdaptTime;if(!n||!i)return this.$message.warning("请选择适用时间段"),!1;if(!e&&this.timeToNum(n)>=this.timeToNum(r))return this.$message.warning("上班开始时间不能大于结束时间"),!1;if(this.timeToNum(n)this.timeToNum(i))return this.$message.warning("适用结束时间不能小于下班时间"),!1}return!0}},{key:"timeToNum",value:function(t){var e=t.split(":");return 3!==e.length?0:Number(60*e[0]*60+60*e[1]+e[2])}},{key:"submitFrom",value:function(){var t=this;this.formRef.validate().then((function(e){if(t.validate()){var n=t.typeObj.add?"/api/attend/shift/add":"/api/attend/shift/edit",r=Object(m["a"])({},t.addList,{isNextDay:t.addList.isNextDay?1:0});delete r.timeR,t.$ajax(n,r,{loading:"loading"}).then((function(){t.closeModal()}))}}))}},{key:"isRest",get:function(){return!1}},{key:"formItems",get:function(){var t=this.isRest;return[{type:"input",name:"shiftName",colAttrs:{span:24},itemAttrs:{label:"班种名称"},contentAttrs:{placeholder:"请输入班种名称"}},{type:"timePicker",name:"startWorkTime",hidden:t,colAttrs:{span:24},itemAttrs:{label:"上班时间"},contentAttrs:{"value-format":"HH:mm:ss",style:"width:100%;",placeholder:"请选择上班时间"}},{type:"slotItem",name:"endWorkTime",hidden:t,itemAttrs:{label:"下班时间"}},{type:"slotItem",name:"timeR",hidden:t,itemAttrs:{label:"适用时段"}},{type:"inputNumber",name:"attendDays",colAttrs:{span:24},itemAttrs:{label:"考勤时长"},contentAttrs:{class:"no-btn",style:"width:90%",placeholder:"请输入考勤时长",min:0,max:3,step:1,precision:0},append:{style:"padding-left:20px",text:"天"}}]}}]),n}(Object(b["c"])(Object(y["a"])()));g=Object(l["a"])([Object(b["a"])({components:{}})],g);var j=g,O=j,k=(n("6a47"),n("2877")),w=Object(k["a"])(O,p,h,!1,null,"2ae03db2",null),T=w.exports,x=n("42b6");function A(t){function e(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}return function(){var n,r=Object(d["a"])(t);if(e()){var a=Object(d["a"])(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(u["a"])(this,n)}}var R=function(t){Object(c["a"])(n,t);var e=A(n);function n(){var t;return Object(o["a"])(this,n),t=e.apply(this,arguments),t.tableData=[],t.searchList={},t.options={},t}return Object(s["a"])(n,[{key:"created",value:function(){this.getList()}},{key:"getData",value:function(){var t=Object(i["a"])(regeneratorRuntime.mark((function t(e){var n,r,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,x["a"].page(e,{_this:this,loading:"loading"});case 2:n=t.sent,r=n.total,a=n.datas,this.paginationAttrs.total=r,this.tableData=a;case 7:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()},{key:"addClick",value:function(){this.refAddEdit.showModal({title:"添加班种",type:"add"})}},{key:"editClick",value:function(t){var e=t.row;this.refAddEdit.showModal({title:"编辑种类",type:"edit"},e)}},{key:"onoffClick",value:function(t){var e=this,n=t.row,r=1===n.isEnable?0:1;x["a"].onoff({shiftId:n.shiftId,id:n.id,isEnable:r}).then((function(t){e.getList()}))}},{key:"delClick",value:function(t){var e=this,n=t.row;n.id;this.GFdc({content:"删除后数据无法恢复,请确认是否删除?"}).then((function(){x["a"].delete({shiftId:n.id}).then((function(t){e.delPage()}))}))}},{key:"opItems",get:function(){return[{type:"button",command:"add",label:"添加班种",btnAttrs:{type:"primary"}}]}},{key:"formItems",get:function(){return[{type:"selectday",name:"timeRange",itemAttrs:{label:"日期选择"},colAttrs:{style:"width:auto"},contentAttrs:{disabledDateStart:365}},{type:"input",name:"personName",itemAttrs:{label:"人员名称"},contentAttrs:{clearable:!0,placeholder:"请输入人员名称"}}]}},{key:"columns",get:function(){return[{type:"text",column:{prop:"shiftName",label:"班种名称"}},{type:"text",column:{prop:"startWorkTime",label:"上班时间"}},{type:"text",column:{prop:"endWorkTimeStr",label:"下班时间"}},{type:"text",column:{prop:"adaptTimeStr",label:"适用时段"}},{type:"text",column:{prop:"attendDaysStr",label:"考勤时长"}},{type:"text",column:{prop:"shiftTypeStr",label:"考勤类型"}},{type:"colorTextDot",column:{prop:"isEnable",label:"考勤状态",width:120},actions:this.GFgetTypeConfig("ATD_STSTUS",{type:"colorText"})},{type:"actions",column:{width:"150",label:"操作"},actions:function(t){var e=2===t.shiftType,n=1===t.isEnable;return e?[]:[{type:"button",label:n?"停用":"启用",command:"onoff"},{type:"button",label:"编辑",command:"edit"},{type:"button",label:"删除",command:"del"}]}}]}}]),n}(Object(b["c"])(Object(f["tableMixin"])()));Object(l["a"])([Object(b["g"])()],R.prototype,"refAddEdit",void 0),R=Object(l["a"])([Object(b["a"])({components:{AddEdit:T}})],R);var D=R,L=D,N=Object(k["a"])(L,r,a,!1,null,null,null);e["default"]=N.exports},"42b6":function(t,e,n){"use strict";n("99af"),n("d3b7"),n("4ae1"),n("25f0");var r=n("f3f3"),a=(n("96cf"),n("c964")),i=n("276c"),o=n("e954"),s=n("920b"),c=n("e1a7"),u=n("f20d"),d=n("2ff6");function l(t){function e(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}return function(){var n,r=Object(u["a"])(t);if(e()){var a=Object(u["a"])(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c["a"])(this,n)}}var f={page:"/api/attend/shift/query/page",query:"/api/attend/shift/query",onoff:"/api/attend/shift/enable",delete:"/api/attend/shift/delete"},p=function(t){Object(s["a"])(n,t);var e=l(n);function n(){var t;return Object(i["a"])(this,n),t=e.apply(this,arguments),t.ATD_TYPE=t.GFgetTypeConfig("ATD_TYPE",{type:"colorText"}),t}return Object(o["a"])(n,[{key:"page",value:function(){var t=Object(a["a"])(regeneratorRuntime.mark((function t(){var e,n,a,i,o=this,s=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=s.length>0&&void 0!==s[0]?s[0]:{},n=s.length>1&&void 0!==s[1]?s[1]:{},a=Object.assign({},e),t.next=5,this.$ajax(f.page,a,Object(r["a"])({},n));case 5:return i=t.sent,t.abrupt("return",this.rPage(i.data,(function(t){var e,n="";return t.startAdaptTime&&t.endAdaptTime&&(n=1===t.isNextDay?"".concat(t.startAdaptTime,"~次日").concat(t.endAdaptTime):"".concat(t.startAdaptTime,"~").concat(t.endAdaptTime)),{id:null===t||void 0===t?void 0:t.shiftId,endWorkTimeStr:t.endWorkTime&&(1===t.isNextDay?"次日":"")+t.endWorkTime,adaptTimeStr:n,attendDaysStr:t.attendDays+"天",shiftTypeStr:null===(e=o.ATD_TYPE[t.shiftType])||void 0===e?void 0:e.label}})));case 7:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"query",value:function(){var t=Object(a["a"])(regeneratorRuntime.mark((function t(){var e,n,a,i,o=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=o.length>0&&void 0!==o[0]?o[0]:{},n=o.length>1&&void 0!==o[1]?o[1]:{},a=Object.assign({isEnable:1},e),t.next=5,this.$ajax(f.query,a,Object(r["a"])({},n));case 5:return i=t.sent,t.abrupt("return",this.rQuery(i.data,(function(t){return{id:t.shiftId,name:t.shiftName,isRest:t.shiftType}})));case 7:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"onoff",value:function(){var t=Object(a["a"])(regeneratorRuntime.mark((function t(){var e,n,a,i,o=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=o.length>0&&void 0!==o[0]?o[0]:{},n=o.length>1&&void 0!==o[1]?o[1]:{},a=Object.assign({},e),t.next=5,this.$ajax(f.onoff,a,Object(r["a"])({},n));case 5:return i=t.sent,t.abrupt("return",i.data);case 7:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"delete",value:function(){var t=Object(a["a"])(regeneratorRuntime.mark((function t(e){var n,a,i,o=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},a=Object.assign({},e),t.next=4,this.$ajax(f.delete,a,Object(r["a"])({},n));case 4:return i=t.sent,t.abrupt("return",i.data);case 6:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()}]),n}(d["a"]);e["a"]=new p},"48b1":function(t,e,n){"use strict";n("4160"),n("d3b7"),n("4ae1"),n("25f0"),n("3ca3"),n("159b"),n("ddb0");var r=n("f3f3"),a=(n("96cf"),n("c964")),i=n("276c"),o=n("e954"),s=n("2c4c"),c=n("920b"),u=n("e1a7"),d=n("f20d"),l=n("9ab4"),f=n("a53c"),p=n("144b"),h=n("3c4e"),m=n.n(h),y=n("60a3");function b(t){function e(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}return function(){var n,r=Object(d["a"])(t);if(e()){var a=Object(d["a"])(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(u["a"])(this,n)}}var v=function(t,e,n){return e},g=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.modal,n=void 0===e?"infoModal":e,s=t.getDetail,u=void 0===s?"getDetail":s,d=t.addList,f=void 0===d?"addList":d,h=t.changeData,g=void 0===h?"changeData":h,j=function(t){Object(c["a"])(s,t);var e=b(s);function s(){var t;return Object(i["a"])(this,s),t=e.apply(this,arguments),t.loading=!1,t.ops={},t.oldList={},t.addList={},t.showFooter=!0,t.mixinHidden=null,t}return Object(o["a"])(s,[{key:"mounted",value:function(){this.oldList=Object(r["a"])({},this[f])}},{key:"loadingChange",value:function(t){this.$emit("update:loading",t),this.$emit("loading",t)}},{key:"dealOther",value:function(t,e){}},{key:"showModal",value:function(){var t=Object(a["a"])(regeneratorRuntime.mark((function t(){var e,r,a,i,o,s,c=this,d=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e=d.length>0&&void 0!==d[0]?d[0]:{},r=d.length>1&&void 0!==d[1]?d[1]:{},a=d.length>2?d[2]:void 0,this.mixinHidden=a,i=Object.assign({cover:!0},e),this.ops=i,o=this[g]?this[g](r,i):r,this.addList=i.cover?m()(this.oldList,o,{arrayMerge:v}):m()(this.oldList,o),this.$nextTick((function(){c[u]&&c[u](c.addList,i)})),this.dealOther&&this.dealOther(this.addList,i),s=this.$refs[n],s&&s.show();case 12:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"closeModal",value:function(){var t=this,e=this.$refs[n];e.hide().then((function(){t.loading=!1,t.mixinHidden&&t.mixinHidden()}))}}]),s}(y["h"]);return Object(l["a"])([Object(y["i"])("loading")],j.prototype,"loadingChange",null),j=Object(l["a"])([Object(y["a"])({components:{CwModal:p["a"]}})],j),j};function j(t){function e(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}return function(){var n,r=Object(d["a"])(t);if(e()){var a=Object(d["a"])(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(u["a"])(this,n)}}e["a"]=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({modal:"infoModal"},t),n=e.modal,u=void 0===n?"infoModal":n,d=e.form,p=void 0===d?"cwform":d,h=e.formItems,m=void 0===h?"formItems":h,b=function(){var t={};return"string"===typeof m?t[m]=function(t){this.delPlaceholderData(t)}:Array.isArray(m)&&m.forEach((function(e){t[e]=function(t){this.delPlaceholderData(t)}})),t},v=function(t){Object(c["a"])(n,t);var e=j(n);function n(){var t;return Object(i["a"])(this,n),t=e.apply(this,arguments),t.p1=Object(s["a"])(t),t.ops={},t.formAttrsW={},t}return Object(o["a"])(n,[{key:"dealOther",value:function(){var t=this;this.typeObj.view&&(this.showFooter=!1),"string"===typeof m?this.delPlaceholder(m):Array.isArray(m)&&m.forEach((function(e){t.delPlaceholder(e)}))}},{key:"delPlaceholder",value:function(t){this[t]&&"view"===this.ops.type&&this[t].forEach((function(t){t.contentAttrs&&t.contentAttrs.placeholder&&(t.contentAttrs.placeholder="")}))}},{key:"delPlaceholderData",value:function(t){t&&"view"===this.ops.type&&t.forEach((function(t){t.contentAttrs&&t.contentAttrs.placeholder&&(t.contentAttrs.placeholder="")}))}},{key:"getData",value:function(t){return this.typeObj.add?t[0]:this.typeObj.edit?t[1]:this.typeObj.view?t[2]:void 0}},{key:"validateForm",value:function(){var t=Object(a["a"])(regeneratorRuntime.mark((function t(e){var n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,n=this.$refs[e],t.next=4,n&&n.validate();case 4:return r=t.sent,t.abrupt("return",r);case 8:throw t.prev=8,t.t0=t["catch"](0),t.t0;case 11:case"end":return t.stop()}}),t,this,[[0,8]])})));function e(e){return t.apply(this,arguments)}return e}()},{key:"validateFormAll",value:function(){var t=this;if(Array.isArray(p)){var e=[];return p.forEach((function(n){e.push(t.validateForm(n))})),Promise.all(e)}return this.validateForm(p)}},{key:"closeModal",value:function(t){var e=this;this.modalRef.hide().then((function(){e.loading=!1,e.resetForm(),e.$emit("getList"),setTimeout((function(){e.mixinHidden&&e.mixinHidden()}),500),t&&t()}))}},{key:"close",value:function(){var t=this;setTimeout((function(){t.resetForm(),t.mixinHidden&&t.mixinHidden()}),500)}},{key:"resetForm",value:function(){var t=this;Array.isArray(p)?p.forEach((function(e){var n=t.$refs[e];n&&n.resetForm()})):this.formRef&&this.formRef.resetForm()}},{key:"typeObj",get:function(){var t=this.ops.type;return{add:"add"===t,edit:"edit"===t,view:"view"===t,o1:"o1"===t,o2:"o2"===t,o3:"o3"===t}}},{key:"formAttrs",get:function(){return Object(r["a"])({disabled:this.typeObj.view,inline:!1},this.formAttrsW||{})}}]),n}(Object(y["c"])(g(Object(r["a"])({},e))));return Object(l["a"])([Object(y["f"])("p")],v.prototype,"p1",void 0),Object(l["a"])([Object(y["b"])({default:{}})],v.prototype,"p",void 0),Object(l["a"])([Object(y["g"])(u)],v.prototype,"modalRef",void 0),Object(l["a"])([Object(y["g"])(p)],v.prototype,"formRef",void 0),v=Object(l["a"])([Object(y["a"])({components:{CwForm:f["a"]},watch:Object(r["a"])({},b())})],v),v}},"6a47":function(t,e,n){"use strict";var r=n("ac35"),a=n.n(r);a.a},ac35:function(t,e,n){}}]);