yxk_pc_mdh/gyhl/static/js/338.905e3777b8871faa1308.js

1 line
13 KiB
JavaScript

webpackJsonp([338],{EDQH:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a("BO1k"),s=a.n(l),i=a("d7EF"),o=a.n(i),n=a("//Fk"),r=a.n(n),c=a("mvHQ"),p=a.n(c),h=a("Dd8w"),u=a.n(h),d=a("Dod7"),m=a("NYxO"),f=(a("t4zo"),a("bzuE")),g={data:function(){return{total:0,pageSizes:[10,20,50],search_data:{pageno:1,pagesize:10},tableData:[],prDate:"",uploadAttachment:[],fileDocList:[],uploadUrl:d.a.uploadUrl,auto_upload:!1,fullscreenLoading:!1,tmpLink:"/static/muban/attendance-template.xlsx",selectDeptId:"",depOptions:[],config:f.a,btnDelDisabled:!0,btnOtherDisabled:!0,dialogLoading:!1,columnSetDialogVisible:!1,columnSetDialogTitle:"设置显示字段列表",tableId:"attendanceManagement_index_table",pictLoading:!1,showTableColumnsDefault:[{title:"部门",prop_:"deptName",select:!0},{title:"所属时期",prop_:"period",select:!0},{title:"工号",prop_:"employeeCode",select:!0},{title:"姓名",prop_:"employeeName",select:!0},{title:"出勤(天)",prop_:"attendanceTime",select:!0},{title:"日班(天)",prop_:"dayShiftTime",select:!0},{title:"夜班(天)",prop_:"nightShiftTime",select:!0},{title:"病假(天)",prop_:"sickLeaveTime",select:!0},{title:"事假(天)",prop_:"comLeaveTime",select:!0},{title:"旷工(天)",prop_:"absenteeismTime",select:!0},{title:"迟到(天)",prop_:"lateTime",select:!0},{title:"早退(天)",prop_:"leaveEarlyTime",select:!0},{title:"缺卡(天)",prop_:"lackCardTime",select:!0},{title:"加班(天)",prop_:"overTime",select:!0},{title:"调休(天)",prop_:"compensatoryTime",select:!0},{title:"法定加班(天)",prop_:"legalOverTime",select:!0},{title:"婚丧(天)",prop_:"marriageFuneralTime",select:!0},{title:"产假(天)",prop_:"maternityLeaveTime",select:!0},{title:"护理假(天)",prop_:"nursingLeaveTime",select:!0},{title:"哺乳假(天)",prop_:"lactationLeaveTime",select:!0},{title:"休息(天)",prop_:"restTime",select:!0},{title:"年假(天)",prop_:"annualLeaveTime",select:!0},{title:"值班(天)",prop_:"dutyTime",select:!0}],showTableColumns:[{title:"部门",prop_:"deptName",select:!0},{title:"所属时期",prop_:"period",select:!0},{title:"工号",prop_:"employeeCode",select:!0},{title:"姓名",prop_:"employeeName",select:!0},{title:"出勤(天)",prop_:"attendanceTime",select:!0},{title:"日班(天)",prop_:"dayShiftTime",select:!0},{title:"夜班(天)",prop_:"nightShiftTime",select:!0},{title:"病假(天)",prop_:"sickLeaveTime",select:!0},{title:"事假(天)",prop_:"comLeaveTime",select:!0},{title:"旷工(天)",prop_:"absenteeismTime",select:!0},{title:"加班(天)",prop_:"overTime",select:!0},{title:"调休(天)",prop_:"compensatoryTime",select:!0},{title:"法定加班(天)",prop_:"legalOverTime",select:!0},{title:"婚丧(天)",prop_:"marriageFuneralTime",select:!0},{title:"产假(天)",prop_:"maternityLeaveTime",select:!0},{title:"护理假(天)",prop_:"nursingLeaveTime",select:!0},{title:"哺乳假(天)",prop_:"lactationLeaveTime",select:!0},{title:"休息(天)",prop_:"restTime",select:!0},{title:"年假(天)",prop_:"annualLeaveTime",select:!0},{title:"值班(天)",prop_:"dutyTime",select:!0}],showTableColumnsTemp:[],formTableData:[],totalTransferAmount:0}},computed:u()({},Object(m.c)({userInfo:"user/getUserInfo"})),mounted:function(){this.showTableColumns=JSON.parse(p()(this.showTableColumns)),this.showTableColumnsTemp=JSON.parse(p()(this.showTableColumns)),this.initData(),this.getList(),this.getShowColumns()},methods:{downloadTemplate:function(){this.tmpLink?window.open(this.tmpLink):this.$message.warning("当前页面暂未配置模板链接")},download:function(){var e=this,t={filePath:"/gyhl-file/template/attendance-template.xlsx",fileName:"考勤模板.xlsx"};console.log(t),this.$api.salesAPI.down(t).then(function(t){console.log(t),200==t.status?(window.open(t.request.responseURL),e.$message({message:"下载成功",type:"success"})):e.$message({message:"下载失败",type:"error"})})},search:function(){this.search_data.pageno=1,this.getList()},getList:function(){var e=this;this.pictLoading=!0,this.$api.attendanceManagementAPI.pageList(this.search_data).then(function(t){e.pictLoading=!1,t.data?(e.total=t.data.totalRows,e.tableData=t.data.datas?t.data.datas:[]):(e.total=0,e.tableData=[])}).catch(function(e){console.log(e)})},setDefaultDept:function(){if(this.depOptions.length>0&&this.search_data.deptId){var e=p()(this.search_data.deptId),t=this.treeFindPath(this.depOptions,function(t){return t.id===e});this.selectDeptId=JSON.parse(p()(t))}},handleChange:function(e){this.search_data.deptId=e[e.length-1],this.selectDeptId=e},initData:function(){var e=this;r.a.all([this.$api.dictAPI.getDictsByType("device_type"),this.$api.commonAPI.getDeptsTree(),this.$api.dictAPI.getDictsByType("device_status")]).then(function(t){var a=o()(t,3),l=a[0],s=a[1],i=a[2];0===l.code&&(e.typeList=l.datas),0===i.code&&(console.log(i),e.usingList=i.datas),0===s.code&&(e.depOptions=s.data.children,e.setDeptList(e.depOptions))}).catch(function(e){console.log(e)})},setDeptList:function(e){var t=!0,a=!1,l=void 0;try{for(var i,o=s()(e);!(t=(i=o.next()).done);t=!0){var n=i.value;n.hasChildren?this.setDeptList(n.children):n.children=void 0}}catch(e){a=!0,l=e}finally{try{!t&&o.return&&o.return()}finally{if(a)throw l}}},handleSelectionChange:function(e){console.log(e),this.rowIds=e,this.setBtn(e)},handleSizeChange:function(e){this.search_data.pagesize=e,this.getList()},handleCurrentChange:function(e){this.search_data.pageno=e,this.getList()},setBtn:function(e){var t=!0,a=!0;e.length>0?(a=!1,1==e.length&&(t=!1)):(t=!0,a=!0),this.btnOtherDisabled=a,this.btnDelDisabled=t},httpRequest:function(e,t,a){var l=this,s=this,i=new FormData;i.append("file",e,t),this.$api.attendanceManagementAPI.import(i).then(function(t){s.fullscreenLoading=!1,0==t.code?(s.$message({message:"上传成功",type:"success",duration:2e3}),l.getList(),a?a.filePath=t.filePath:e.filePath=t.filePath,s.uploadAttachment.push({filePath:t.filePath,fileName:t.fileName})):(s.fullscreenLoading=!1,s.$message({dangerouslyUseHTMLString:!0,message:t.msg,type:"error"}),s.$refs.upload.uploadFiles.splice(s.$refs.upload.uploadFiles.length-1,1))})},uploadSuccess:function(e,t){"操作成功"===e.msg&&this.uploadAttachment.push({filePath:e.filePath,fileName:e.fileName})},onChange:function(e,t){if(e.size>1e8)return this.$message.error("上传文件不能超过100M!"),this.$refs.upload.fileList=this.$refs.upload.fileList,this.$refs.upload.uploadFiles.splice(this.$refs.upload.uploadFiles.length-1,1),!1;if(e=e.raw,/image\/\w+/.test(e.type)){this.fullscreenLoading=!0;var a=this;imageConversion.compressAccurately(e,400).then(function(t){t.size?a.httpRequest(t,e.name,e):(a.$message.error("压缩图片失败"),a.fullscreenLoading=!1,a.$refs.upload.uploadFiles.splice(a.$refs.upload.uploadFiles.length-1,1))})}else this.fullscreenLoading=!0,this.httpRequest(e,e.name)},showColumnSetDialog:function(){this.columnSetDialogVisible=!0,this.showTableColumnsTemp=JSON.parse(p()(this.showTableColumns))},toUp:function(e){if(0==e.$index)return!1;for(var t=void 0,a=0;a<this.showTableColumns.length;a++)this.showTableColumns[a].prop_==e.row.prop_&&(t=a);var l=this.showTableColumns[t];this.showTableColumns[t]=this.showTableColumns[t-1],this.showTableColumns[t-1]=l,this.$forceUpdate()},toDown:function(e){if(e.$index==this.showTableColumns.length-1)return!1;for(var t=void 0,a=0;a<this.showTableColumns.length;a++)this.showTableColumns[a].prop_==e.row.prop_&&(t=a);var l=this.showTableColumns[t];this.showTableColumns[t]=this.showTableColumns[t+1],this.showTableColumns[t+1]=l,this.$forceUpdate()},toDefault:function(){this.showTableColumns=JSON.parse(p()(this.showTableColumnsDefault)),this.$forceUpdate()},saveAndCloseColumnSetDialog:function(){var e=this,t=this.tableId,a=p()(this.showTableColumns);this.columnSetDialogVisible=!1,this.$api.tableColumnAPI.saveShowColumns({tableNo:t,tableColumns:a}).then(function(t){var a=JSON.parse(p()(e.showTableColumns));e.formTableData=[];for(var l=0;l<a.length;l++)a[l].select&&e.formTableData.push(a[l])}).catch(function(e){console.log(e)})},handleClose:function(){this.showTableColumns=JSON.parse(p()(this.showTableColumnsTemp)),this.columnSetDialogVisible=!1},getShowColumns:function(){var e=this,t=this.tableId;this.formTableData=[],this.$api.tableColumnAPI.getShowColumns({tableNo:t}).then(function(t){if(0==t.code)if(t.results){e.showTableColumns=JSON.parse(t.results);for(var a=JSON.parse(p()(e.showTableColumns)),l=0;l<a.length;l++)a[l].select&&e.formTableData.push(a[l]);e.$forceUpdate()}else{for(var s=JSON.parse(p()(e.showTableColumnsDefault)),i=0;i<s.length;i++)s[i].select&&e.formTableData.push(s[i]);e.$forceUpdate()}else e.$message({message:t.msg?t.msg:"获取列表信息失败",type:"error"})}).catch(function(t){e.$message({message:t,type:"error"}),console.log(t)})}},watch:{}},b={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"sys-box"},[a("div",{staticClass:"sys-operate"},[a("el-upload",{directives:[{name:"loading",rawName:"v-loading.lock",value:e.fullscreenLoading,expression:"fullscreenLoading",modifiers:{lock:!0}}],ref:"upload",staticClass:"inline-block mr",staticStyle:{float:"left"},attrs:{action:e.uploadUrl,"show-file-list":!1,"on-success":e.uploadSuccess,"before-remove":function(){return!1},"auto-upload":e.auto_upload,"on-change":e.onChange,accept:".xls,.xlsx,"}},[a("el-button",{directives:[{name:"has",rawName:"v-has",value:"attendanceManagement:attendanceManagement:upload",expression:"'attendanceManagement:attendanceManagement:upload'"}],attrs:{size:"small",type:"primary"}},[e._v("导入")])],1),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.downloadTemplate()}}},[e._v("模板下载")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.showColumnSetDialog}},[e._v(e._s(e.config.configureBtnName))])],1),e._v(" "),a("div",{staticClass:"sys-search"},[a("el-form",{staticClass:"form_item_search_out",attrs:{inline:""}},[a("div",{staticClass:"form_item_input_out"},[a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"33%"},attrs:{label:"部门"}},[a("el-cascader",{attrs:{clearable:"",options:e.depOptions,props:{expandTrigger:"hover",label:"text",value:"id",checkStrictly:!0}},on:{change:e.handleChange},model:{value:e.selectDeptId,callback:function(t){e.selectDeptId=t},expression:"selectDeptId"}})],1),e._v(" "),a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"33%"},attrs:{label:"所属时期"}},[a("el-date-picker",{attrs:{type:"month",format:"yyyy-MM","range-separator":"—",placeholder:"选择日期","value-format":"yyyy-MM",clearable:""},model:{value:e.search_data.period,callback:function(t){e.$set(e.search_data,"period",t)},expression:"search_data.period"}})],1)],1),e._v(" "),a("div",{staticClass:"form_item_btn_out"},[a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.search()}}},[e._v("查询")])],1)],1)])],1),e._v(" "),a("div",{staticClass:"sys-table"},[e.formTableData.length>0?a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.pictLoading,expression:"pictLoading"}],ref:"tb",attrs:{border:"",id:"out-table",data:e.tableData,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"}},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),e._v(" "),e._l(e.formTableData,function(e,t){return a("el-table-column",{key:t,attrs:{prop:e.prop_,label:e.title,align:"center","show-overflow-tooltip":""}})})],2):e._e()],1),e._v(" "),a("div",{staticClass:"sys-pagination"},[a("el-pagination",{attrs:{"current-page":e.search_data.pageno,"page-sizes":e.pageSizes,"page-size":e.search_data.pagesize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1),e._v(" "),a("el-dialog",{attrs:{title:e.columnSetDialogTitle,center:"",visible:e.columnSetDialogVisible,width:"531px","before-close":e.handleClose},on:{"update:visible":function(t){e.columnSetDialogVisible=t}}},[a("el-table",{key:Math.random(),staticStyle:{width:"100%"},attrs:{border:"",data:e.showTableColumns,"max-height":"350"}},[a("el-table-column",{attrs:{prop:"title",label:"列表名称",width:"180",fixed:""}}),e._v(" "),a("el-table-column",{attrs:{prop:"select",label:"是否显示",width:"180"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-switch",{model:{value:t.row.select,callback:function(a){e.$set(t.row,"select",a)},expression:"scope.row.select"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.toUp(t)}}},[e._v("前移")]),e._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.toDown(t)}}},[e._v("后移")])]}}])})],1),e._v(" "),a("el-row",{staticClass:"row-bg",staticStyle:{"margin-top":"10px"},attrs:{type:"flex",justify:"center"}},[a("el-col",{attrs:{span:6}},[a("el-button",{attrs:{type:"primary",size:"middle"},on:{click:e.saveAndCloseColumnSetDialog}},[e._v("完成")])],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-button",{attrs:{type:"primary",size:"middle"},on:{click:e.toDefault}},[e._v("恢复默认")])],1)],1)],1)],1)},staticRenderFns:[]};var _=a("VU/8")(g,b,!1,function(e){a("wLPp")},"data-v-72a9b6b6",null);t.default=_.exports},wLPp:function(e,t){}});