1 line
17 KiB
JavaScript
1 line
17 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-188cd158"],{"833a":function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("el-form",{directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryForm",attrs:{model:e.queryParams,size:"small",inline:!0,"label-width":"68px"}},[a("el-form-item",{attrs:{label:"名称",prop:"groupName"}},[a("el-input",{staticStyle:{width:"240px"},attrs:{placeholder:"请输入名称",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.groupName,callback:function(t){e.$set(e.queryParams,"groupName",t)},expression:"queryParams.groupName"}})],1),a("el-form-item",{attrs:{label:"部门名称",prop:"orgName"}},[a("el-input",{staticStyle:{width:"240px"},attrs:{placeholder:"请输入部门名称",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.orgName,callback:function(t){e.$set(e.queryParams,"orgName",t)},expression:"queryParams.orgName"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("搜索")]),a("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:e.resetQuery}},[e._v("重置")])],1)],1),a("el-row",{staticClass:"mb8",attrs:{gutter:10}},[a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["att:group:add"],expression:"['att:group:add']"}],attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:e.handleAdd}},[e._v("新增")])],1),a("el-col",{attrs:{span:1.5}},[a("el-button",{attrs:{type:"warning",plain:"",icon:"el-icon-download",size:"mini"},on:{click:e.handleExport}},[e._v("导出")])],1),a("right-toolbar",{attrs:{showSearch:e.showSearch},on:{"update:showSearch":function(t){e.showSearch=t},"update:show-search":function(t){e.showSearch=t},queryTable:e.getList}})],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.userList},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{label:"序号",align:"center",width:"80",type:"index"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s((e.queryParams.pageNum-1)*e.queryParams.pageSize+t.$index+1))])]}}])}),a("el-table-column",{attrs:{label:"名称",align:"center",prop:"groupName"}}),a("el-table-column",{attrs:{label:"考勤时间",align:"center",prop:"attDay","show-overflow-tooltip":!0},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v("每周")]),1==t.row.attDay.split(",")[0]?a("span",[e._v("一、")]):e._e(),1==t.row.attDay.split(",")[1]?a("span",[e._v("二、")]):e._e(),1==t.row.attDay.split(",")[2]?a("span",[e._v("三、")]):e._e(),1==t.row.attDay.split(",")[3]?a("span",[e._v("四、")]):e._e(),1==t.row.attDay.split(",")[4]?a("span",[e._v("五、")]):e._e(),1==t.row.attDay.split(",")[5]?a("span",[e._v("六、")]):e._e(),1==t.row.attDay.split(",")[6]?a("span",[e._v("日")]):e._e()]}}])}),a("el-table-column",{attrs:{label:"上班时间",align:"center",prop:"toWorkTime","show-overflow-tooltip":!0}}),a("el-table-column",{attrs:{label:"下班时间",align:"center",prop:"offWorkTime","show-overflow-tooltip":!0}}),a("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["att:group:edit"],expression:"['att:group:edit']"}],attrs:{size:"mini",type:"primary"},on:{click:function(a){return e.handleUpdate(t.row)}}},[e._v("编辑")]),a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["att:group:remove"],expression:"['att:group:remove']"}],attrs:{size:"mini",type:"danger"},on:{click:function(a){return e.handleDelete(t.row)}}},[e._v("删除")])]}}])})],1),a("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],attrs:{total:e.total,page:e.queryParams.pageNum,limit:e.queryParams.pageSize},on:{"update:page":function(t){return e.$set(e.queryParams,"pageNum",t)},"update:limit":function(t){return e.$set(e.queryParams,"pageSize",t)},pagination:e.getList}}),a("el-dialog",{attrs:{title:e.title,visible:e.open,width:"900px","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"130px"}},[a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"考勤组名称:",prop:"groupName"}},[a("el-input",{attrs:{placeholder:"请输入考勤组名称",maxlength:"30"},model:{value:e.form.groupName,callback:function(t){e.$set(e.form,"groupName",t)},expression:"form.groupName"}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"参与考勤人员:",prop:"checkList"}},[a("treeselect",{attrs:{multiple:!0,flat:!0,options:e.personOptions,normalizer:e.normalizer,placeholder:"选择部门负责人"},on:{input:e.handleSelect},model:{value:e.form.checkList,callback:function(t){e.$set(e.form,"checkList",t)},expression:"form.checkList"}})],1)],1)],1),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"考勤类型:",prop:"attType"}},[a("el-radio-group",{on:{change:e.changeRadio},model:{value:e.form.attType,callback:function(t){e.$set(e.form,"attType",t)},expression:"form.attType"}},e._l(e.typeList,(function(t){return a("el-radio",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.label))])})),1)],1)],1)],1),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"考勤时间:",prop:"attDays"}},[a("el-checkbox-group",{model:{value:e.form.attDays,callback:function(t){e.$set(e.form,"attDays",t)},expression:"form.attDays"}},e._l(e.attDayList,(function(t){return a("el-checkbox",{key:t.id,attrs:{label:t.id}},[e._v(e._s(t.label))])})),1)],1)],1)],1),1==e.form.attType?a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"上班时间:",prop:"toWorkTime"}},[a("el-time-select",{attrs:{"picker-options":{start:"00:00",step:"00:15",end:"23:59"},placeholder:"选择时间"},model:{value:e.form.toWorkTime,callback:function(t){e.$set(e.form,"toWorkTime",t)},expression:"form.toWorkTime"}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"下班时间:",prop:"offWorkTime"}},[a("el-time-select",{attrs:{"picker-options":{start:"00:00",step:"00:15",end:"23:59"},placeholder:"选择时间"},model:{value:e.form.offWorkTime,callback:function(t){e.$set(e.form,"offWorkTime",t)},expression:"form.offWorkTime"}})],1)],1)],1):e._e(),1==e.form.attType?a("el-row",[a("el-col",{attrs:{span:10}},[a("el-form-item",{attrs:{label:"迟到、早退设置:",prop:"lateMinute"}},[e._v(" 迟到"),a("el-input",{staticStyle:{width:"100px"},attrs:{maxlength:"4"},model:{value:e.form.lateMinute,callback:function(t){e.$set(e.form,"lateMinute",e._n(t))},expression:"form.lateMinute"}}),e._v("分钟不计迟到, ")],1)],1),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"","label-width":"0",prop:"leaveMinute"}},[e._v(" 早退"),a("el-input",{staticStyle:{width:"100px"},attrs:{maxlength:"4"},model:{value:e.form.leaveMinute,callback:function(t){e.$set(e.form,"leaveMinute",e._n(t))},expression:"form.leaveMinute"}}),e._v("分钟不计早退 ")],1)],1)],1):e._e(),1==e.form.attType?a("el-row",[a("el-col",{attrs:{span:10}},[a("el-form-item",{attrs:{label:"旷工设置:",prop:"absenteeismLateMinute"}},[e._v(" 迟到"),a("el-input",{staticStyle:{width:"100px"},attrs:{maxlength:"4"},model:{value:e.form.absenteeismLateMinute,callback:function(t){e.$set(e.form,"absenteeismLateMinute",e._n(t))},expression:"form.absenteeismLateMinute"}}),e._v("分钟即为旷工, ")],1)],1),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"","label-width":"0",prop:"absenteeismLeaveMinute"}},[e._v(" 早退"),a("el-input",{staticStyle:{width:"100px"},attrs:{maxlength:"4"},model:{value:e.form.absenteeismLeaveMinute,callback:function(t){e.$set(e.form,"absenteeismLeaveMinute",e._n(t))},expression:"form.absenteeismLeaveMinute"}}),e._v("分钟即为旷工 ")],1)],1)],1):e._e(),1==e.form.attType?a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"出入异常设置:",prop:"entryAbnormalMinute"}},[a("el-input",{staticStyle:{width:"100px"},attrs:{maxlength:"4"},model:{value:e.form.entryAbnormalMinute,callback:function(t){e.$set(e.form,"entryAbnormalMinute",e._n(t))},expression:"form.entryAbnormalMinute"}}),e._v("分钟内连续打卡进出即为出入异常 ")],1)],1)],1):e._e(),2==e.form.attType?a("el-row",[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"每天打卡:",prop:"todayClockNum"}},[a("el-input",{staticStyle:{width:"100px"},attrs:{maxlength:"1"},on:{input:e.clockNum},model:{value:e.form.todayClockNum,callback:function(t){e.$set(e.form,"todayClockNum",e._n(t))},expression:"form.todayClockNum"}}),e._v("次 ")],1)],1),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"应出勤时长:",prop:"attendanceDuration"}},[a("el-input",{staticStyle:{width:"100px"},attrs:{maxlength:"4"},model:{value:e.form.attendanceDuration,callback:function(t){e.$set(e.form,"attendanceDuration",e._n(t))},expression:"form.attendanceDuration"}}),e._v("分钟 ")],1)],1)],1):e._e(),2==e.form.todayClockNum?a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"实际出勤不满足:",prop:"absenteeismLateMinute"}},[a("el-input",{staticStyle:{width:"100px"},attrs:{maxlength:"4"},model:{value:e.form.absenteeismLateMinute,callback:function(t){e.$set(e.form,"absenteeismLateMinute",e._n(t))},expression:"form.absenteeismLateMinute"}}),e._v("分钟记录为早退 "),a("span",[e._v("注:早退时长=应出勤时长-实际出勤时长")])],1)],1)],1):e._e(),2==e.form.todayClockNum?a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"实际出勤不满足:",prop:"absenteeismLeaveMinute"}},[a("el-input",{staticStyle:{width:"100px"},attrs:{maxlength:"4"},model:{value:e.form.absenteeismLeaveMinute,callback:function(t){e.$set(e.form,"absenteeismLeaveMinute",e._n(t))},expression:"form.absenteeismLeaveMinute"}}),e._v("分钟记录为旷工 "),a("span",[e._v("注:旷工时长=应出勤时长-实际出勤时长")])],1)],1)],1):e._e()],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("确 定")]),a("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1)],1)},o=[],n=(a("a15b"),a("d81d"),a("14d9"),a("b0c0"),a("d3b7"),a("159b"),a("d327")),i=a("ca17"),s=a.n(i),l=(a("542c"),{name:"rules",dicts:["sys_normal_disable"],components:{Treeselect:s.a},data:function(){return{loading:!0,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,userList:[],title:"",open:!1,dateRange:[],queryParams:{pageNum:1,pageSize:10,groupName:void 0,orgName:void 0},personOptions:[],typeList:[{value:"1",label:"固定班制"},{value:"2",label:"自由工时"}],attDayList:[{id:0,label:"周一"},{id:1,label:"周二"},{id:2,label:"周三"},{id:3,label:"周四"},{id:4,label:"周五"},{id:5,label:"周六"},{id:6,label:"周日"}],form:{},rules:{groupName:[{required:!0,message:"名称不能为空",trigger:"blur"}],attDays:[{required:!0,message:"考勤时间不能为空",trigger:"blur"}],checkList:[{required:!0,message:"考勤人员不能为空",trigger:"change"}],toWorkTime:[{required:!0,message:"上班时间不能为空",trigger:"blur"}],offWorkTime:[{required:!0,message:"下班时间不能为空",trigger:"blur"}],lateMinute:[{required:!0,message:"时间不能为空",trigger:"blur"},{type:"number",message:"必须为数字值",trigger:"change"}],leaveMinute:[{required:!0,message:"时间不能为空",trigger:"blur"},{type:"number",message:"必须为数字值",trigger:"change"}],absenteeismLateMinute:[{required:!0,message:"时间不能为空",trigger:"blur"},{type:"number",message:"必须为数字值",trigger:"change"}],absenteeismLeaveMinute:[{required:!0,message:"时间不能为空",trigger:"blur"},{type:"number",message:"必须为数字值",trigger:"change"}],entryAbnormalMinute:[{required:!0,message:"出入异常时间不能为空",trigger:"blur"},{type:"number",message:"必须为数字值",trigger:"change"}],todayClockNum:[{required:!0,message:"每天打卡次数不能为空",trigger:"change"},{pattern:/^[1|2]\d{0}$/,message:"每天打卡次数必须为 1 或 2",trigger:"change"}],attendanceDuration:[{required:!0,message:"应出勤时长不能为空",trigger:"blur"},{type:"number",message:"必须为数字值",trigger:"change"}]}}},created:function(){this.getList()},methods:{selectOrgList:function(){var e=this;Object(n["e"])().then((function(t){console.log(t),e.personOptions=e.changeData(t.data)}))},changeData:function(e){var t=this;return e.map((function(e){e.disabled?e.isChecked?e.isDisabled=!1:e.isDisabled=!0:e.disabled||(e.isDisabled=!1),e.children&&e.children.length>0&&t.changeData(e.children)})),e},handleSelect:function(e,t){console.log("Selected:",e)},normalizer:function(e){return e.children&&!e.children.length&&delete e.children,{id:e.id,label:e.name,children:e.children}},changeRadio:function(e){console.log(e),1==e&&(this.form.attDays=[0,1,2,3,4],this.form.toWorkTime="08:30:00",this.form.offWorkTime="17:30:00",this.form.lateMinute=void 0,this.form.leaveMinute=void 0,this.form.todayClockNum=void 0,this.form.absenteeismLateMinute=void 0,this.form.absenteeismLeaveMinute=void 0,this.form.entryAbnormalMinute=void 0),2==e&&(this.form.attDays=[0,1,2,3,4,5,6],this.form.todayClockNum=1,this.form.attendanceDuration=360,this.form.absenteeismLateMinute=void 0,this.form.absenteeismLeaveMinute=void 0)},clockNum:function(e){},getList:function(){var e=this;this.loading=!0,Object(n["d"])(this.queryParams).then((function(t){e.userList=t.rows,e.total=t.total,e.loading=!1}))},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={groupName:void 0,attType:"1",checkList:[],attDays:[0,1,2,3,4],attDay:void 0,toWorkTime:"08:30:00",offWorkTime:"17:30:00",lateMinute:void 0,leaveMinute:void 0,absenteeismLateMinute:void 0,absenteeismLeaveMinute:void 0,entryAbnormalMinute:void 0,todayClockNum:void 0,attendanceDuration:void 0},this.resetForm("form")},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.dateRange=[],this.resetForm("queryForm"),this.handleQuery()},handleAdd:function(){this.selectOrgList(),this.reset(),this.open=!0,this.title="新增"},handleSelectionChange:function(e){this.ids=e.map((function(e){return e.groupId})),this.single=1!=e.length,this.multiple=!e.length},handleUpdate:function(e){var t=this;this.reset();var a=e.groupId;Object(n["c"])(a).then((function(e){t.form=e.data;var a=[];t.form.attDay.split(",").forEach((function(e,t){"1"==e&&a.push(t)})),t.$set(t.form,"attDays",a),t.personOptions=t.changeData(t.form.treeList),t.form.checkList=[],t.setCheck(t.form.treeList),t.open=!0,t.title="编辑"}))},setCheck:function(e){var t=this;e.map((function(e){e.isChecked&&t.form.checkList.push(e.id),e.children&&e.children.length>0&&t.setCheck(e.children)}))},submitForm:function(){var e=this;console.log(this.form),this.$refs["form"].validate((function(t){if(t){var a=[0,0,0,0,0,0,0];e.form.attDays.forEach((function(e){a[e]=1})),e.form.attDay=a.join(",");var r=[];e.form.checkList.forEach((function(e){var t={orgId:e.split("|")[1],userId:e.split("|")[0]};r.push(t)})),e.form.checkOrgList=r,console.log(e.form),void 0!=e.form.groupId?(e.form.checkOrgList.forEach((function(t){t.groupId=e.form.groupId})),Object(n["f"])(e.form).then((function(t){e.$modal.msgSuccess("修改成功"),e.open=!1,e.getList()}))):Object(n["a"])(e.form).then((function(t){e.$modal.msgSuccess("新增成功"),e.open=!1,e.getList()}))}}))},handleDelete:function(e){var t=this,a=e.groupId||this.ids;this.$modal.confirm('是否确认删除编号为"'+a+'"的数据项?').then((function(){return Object(n["b"])(a)})).then((function(){t.getList(),t.$modal.msgSuccess("删除成功")})).catch((function(){}))},handleExport:function(){}}}),u=l,m=a("2877"),c=Object(m["a"])(u,r,o,!1,null,null,null);t["default"]=c.exports},d327:function(e,t,a){"use strict";a.d(t,"d",(function(){return o})),a.d(t,"c",(function(){return n})),a.d(t,"e",(function(){return i})),a.d(t,"a",(function(){return s})),a.d(t,"f",(function(){return l})),a.d(t,"b",(function(){return u}));var r=a("b775");a("0afd");function o(e){return Object(r["a"])({url:"/system/attGroup/list",method:"get",params:e})}function n(e){return Object(r["a"])({url:"/system/attGroup/"+e,method:"get"})}function i(e){return Object(r["a"])({url:"/system/attGroup/selectOrgList",method:"post",data:e})}function s(e){return Object(r["a"])({url:"/system/attGroup",method:"post",data:e})}function l(e){return Object(r["a"])({url:"/system/attGroup",method:"put",data:e})}function u(e){return Object(r["a"])({url:"/system/attGroup/"+e,method:"delete"})}}}]); |