yxk_pc_mdh/gyhl/static/js/273.373184f4b93f2e4244fa.js

1 line
12 KiB
JavaScript

webpackJsonp([273],{"fS1/":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=a("BO1k"),s=a.n(o),l=a("mvHQ"),n=a.n(l),i=a("Dd8w"),r=a.n(i),c=a("NYxO"),h=(a("t4zo"),a("bzuE")),u={data:function(){return{total:0,pageSizes:[10,20,50],search_data:{pageno:1,pagesize:10},search_data1:{pageno:1,pagesize:1e4,isShowSalaryAccounting:1},tableData:[],month:"",formData:{deptId:""},rulesForm:{monthDate:[{required:!0,message:"请选择所属时期",trigger:"change"}]},pickerOptionsYearMonth:this.banTime(),selectDeptId:"",dialogTitle:"",depOptions:[],totalNum:{},config:h.a,btnDelDisabled:!0,btnOtherDisabled:!0,dialogLoading:!1,dialogVisible:!1,columnSetDialogVisible:!1,columnSetDialogTitle:"设置显示字段列表",tableId:"salaryManagement_salaryAccounting1111_table",pictLoading:!1,showTableColumnsDefault:[],showTableColumns:[],showTableColumnsTemp:[],formTableData:[],totalTransferAmount:0}},computed:r()({},Object(c.c)({userInfo:"user/getUserInfo"})),mounted:function(){this.showTableColumns=JSON.parse(n()(this.showTableColumns)),this.showTableColumnsTemp=JSON.parse(n()(this.showTableColumns)),this.initData(),this.getList(),this.getShowColumns()},methods:{banTime:function(){return{disabledDate:function(t){var e=new Date,a=e.getFullYear(),o=e.getMonth()+1;o>=1&&o<=9&&(o="0"+o);var s=a.toString()+o.toString(),l=t.getFullYear(),n=t.getMonth()+1;return n>=1&&n<=9&&(n="0"+n),s<=l.toString()+n.toString()}}},downLoadRecord:function(){this.$api.salesAPI.downLoadRecord().then(function(t){})},getSummaries:function(t){var e=this,a=t.columns,o=(t.data,[]);return a.forEach(function(t,a){o[0]="合计";for(var s=0;s<e.showTableColumnsDefault.length;s++)t.property==e.showTableColumnsDefault[s].prop_&&(o[a]=e.totalNum[t.property])}),o},entering:function(){this.formData={},this.dialogVisible=!0,this.dialogTitle="选择薪资所属时期",void 0!==this.$refs.form&&this.$refs.form.resetFields()},save:function(t){var e=this;this.$refs[t].validate(function(t){if(!t)return!1;e.$router.push({path:"/salaryManagement/salaryAccounting_entering",query:{monthDate:e.formData.monthDate,t:Date.now()}}),e.dialogVisible=!1})},search:function(){this.search_data.pageno=1,this.getList()},getList:function(){var t=this;this.pictLoading=!0,this.$api.salaryProjectApi.salaryAccountingPageList(this.search_data).then(function(e){t.pictLoading=!1,e.data?(t.total=e.data.totalRows,t.totalNum=e.total?e.total:{},t.tableData=e.data.datas?e.data.datas:[],t.tableData.forEach(function(t){t.monthDate=/\d{4}-\d{1,2}/g.exec(t.monthDate)})):(t.total=0,t.tableData=[])}).catch(function(t){console.log(t)})},setDefaultDept:function(){if(this.depOptions.length>0&&this.search_data.deptId){var t=n()(this.search_data.deptId),e=this.treeFindPath(this.depOptions,function(e){return e.id===t});this.selectDeptId=JSON.parse(n()(e))}},handleChange:function(t){this.search_data.deptId=t[t.length-1],this.selectDeptId=t},initData:function(){var t=this;this.$api.commonAPI.getDeptsTree().then(function(e){0===e.code&&(t.depOptions=e.data.children,t.setDeptList(t.depOptions))}).catch(function(t){console.log(t)}),this.$api.salaryProjectApi.getProjectList(this.search_data1).then(function(e){e.data.forEach(function(e){var a={title:e.name,prop_:e.property,select:!0};t.showTableColumnsDefault.push(a)}),t.showTableColumns=t.showTableColumnsDefault,console.log(t.showTableColumnsDefault)})},setDeptList:function(t){var e=!0,a=!1,o=void 0;try{for(var l,n=s()(t);!(e=(l=n.next()).done);e=!0){var i=l.value;i.hasChildren?this.setDeptList(i.children):i.children=void 0}}catch(t){a=!0,o=t}finally{try{!e&&n.return&&n.return()}finally{if(a)throw o}}},handleSelectionChange:function(t){console.log(t),this.rowIds=t,this.setBtn(t)},handleSizeChange:function(t){this.search_data.pagesize=t,this.getList()},handleCurrentChange:function(t){this.search_data.pageno=t,this.getList()},setBtn:function(t){var e=!0,a=!0;t.length>0?(a=!1,1==t.length&&(e=!1)):(e=!0,a=!0),this.btnOtherDisabled=a,this.btnDelDisabled=e},showColumnSetDialog:function(){this.columnSetDialogVisible=!0,this.showTableColumnsTemp=JSON.parse(n()(this.showTableColumns))},toUp:function(t){if(0==t.$index)return!1;for(var e=void 0,a=0;a<this.showTableColumns.length;a++)this.showTableColumns[a].prop_==t.row.prop_&&(e=a);var o=this.showTableColumns[e];this.showTableColumns[e]=this.showTableColumns[e-1],this.showTableColumns[e-1]=o,this.$forceUpdate()},toDown:function(t){if(t.$index==this.showTableColumns.length-1)return!1;for(var e=void 0,a=0;a<this.showTableColumns.length;a++)this.showTableColumns[a].prop_==t.row.prop_&&(e=a);var o=this.showTableColumns[e];this.showTableColumns[e]=this.showTableColumns[e+1],this.showTableColumns[e+1]=o,this.$forceUpdate()},toDefault:function(){this.showTableColumns=JSON.parse(n()(this.showTableColumnsDefault)),this.$forceUpdate()},saveAndCloseColumnSetDialog:function(){var t=this,e=this.tableId,a=n()(this.showTableColumns);this.columnSetDialogVisible=!1,this.$api.tableColumnAPI.saveShowColumns({tableNo:e,tableColumns:a}).then(function(e){var a=JSON.parse(n()(t.showTableColumns));t.formTableData=[];for(var o=0;o<a.length;o++)a[o].select&&t.formTableData.push(a[o])}).catch(function(t){console.log(t)})},handleClose:function(){this.showTableColumns=JSON.parse(n()(this.showTableColumnsTemp)),this.columnSetDialogVisible=!1},getShowColumns:function(){var t=this,e=this.tableId;this.formTableData=[],this.$api.tableColumnAPI.getShowColumns({tableNo:e}).then(function(e){if(0==e.code)if(e.results){t.showTableColumns=JSON.parse(e.results);for(var a=JSON.parse(n()(t.showTableColumns)),o=0;o<a.length;o++)a[o].select&&t.formTableData.push(a[o]);t.$forceUpdate()}else{for(var s=JSON.parse(n()(t.showTableColumnsDefault)),l=0;l<s.length;l++)s[l].select&&t.formTableData.push(s[l]);t.$forceUpdate()}else t.$message({message:e.msg?e.msg:"获取列表信息失败",type:"error"})}).catch(function(e){t.$message({message:e,type:"error"}),console.log(e)})},addClass:function(t){t.row,t.column;var e=t.rowIndex;t.columnIndex;if(1===this.tableData[e].isThisMonth)return"background-color:#E6F7FF"}},watch:{month:function(t){t?(this.search_data.startTime=t[0],this.search_data.endTime=t[1]):(this.search_data.startTime="",this.search_data.endTime="")}}},m={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"sys-box"},[a("div",{staticClass:"sys-operate"},[a("el-button",{directives:[{name:"has",rawName:"v-has",value:"salaryManagement:salaryArchives:entering",expression:"'salaryManagement:salaryArchives:entering'"}],attrs:{type:"primary"},on:{click:function(e){return t.entering()}}},[t._v("薪资录入")]),t._v(" "),a("el-button",{directives:[{name:"has",rawName:"v-has",value:"salaryManagement:salaryArchives:record",expression:"'salaryManagement:salaryArchives:record'"}],attrs:{type:"primary"},on:{click:function(e){return t.downLoadRecord()}}},[t._v("导出")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:t.showColumnSetDialog}},[t._v(t._s(t.config.configureBtnName))])],1),t._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:t.depOptions,props:{expandTrigger:"hover",label:"text",value:"id",checkStrictly:!0}},on:{change:t.handleChange},model:{value:t.selectDeptId,callback:function(e){t.selectDeptId=e},expression:"selectDeptId"}})],1),t._v(" "),a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"33%"},attrs:{label:"员工姓名"}},[a("el-input",{attrs:{clearable:"",placeholder:"请输入"},model:{value:t.search_data.employeeName,callback:function(e){t.$set(t.search_data,"employeeName",e)},expression:"search_data.employeeName"}})],1),t._v(" "),a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"33%"},attrs:{label:"所属时期"}},[a("el-date-picker",{attrs:{type:"monthrange",format:"yyyy-MM","value-format":"yyyy-MM-dd HH:mm:ss","range-separator":"—","start-placeholder":"开始时间","end-placeholder":"结束时间"},model:{value:t.month,callback:function(e){t.month=e},expression:"month"}})],1)],1),t._v(" "),a("div",{staticClass:"form_item_btn_out"},[a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.search()}}},[t._v("查询")])],1)],1)])],1),t._v(" "),a("div",{staticClass:"sys-table"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.pictLoading,expression:"pictLoading"}],ref:"tb",attrs:{border:"",id:"out-table",data:t.tableData,"summary-method":t.getSummaries,"show-summary":"","cell-style":t.addClass,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"}}},[a("el-table-column",{attrs:{type:"index",width:"55",label:"编号",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"monthDate",align:"center",label:"所属时期"}}),t._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"employeeCode",align:"center",label:"员工工号"}}),t._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"employeeName",align:"center",label:"员工姓名"}}),t._v(" "),t._l(t.formTableData,function(t,e){return a("el-table-column",{key:e,attrs:{prop:t.prop_,label:t.title,align:"center","show-overflow-tooltip":""}})}),t._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"auditSignName",align:"center",label:"审核状态"}})],2)],1),t._v(" "),a("div",{staticClass:"sys-pagination"},[a("el-pagination",{attrs:{"current-page":t.search_data.pageno,"page-sizes":t.pageSizes,"page-size":t.search_data.pagesize,layout:"total, sizes, prev, pager, next, jumper",total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1),t._v(" "),a("el-dialog",{attrs:{title:t.columnSetDialogTitle,center:"",visible:t.columnSetDialogVisible,width:"531px","before-close":t.handleClose},on:{"update:visible":function(e){t.columnSetDialogVisible=e}}},[a("el-table",{key:Math.random(),staticStyle:{width:"100%"},attrs:{border:"",data:t.showTableColumns,"max-height":"350"}},[a("el-table-column",{attrs:{prop:"title",label:"列表名称",width:"180",fixed:""}}),t._v(" "),a("el-table-column",{attrs:{prop:"select",label:"是否显示",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-switch",{model:{value:e.row.select,callback:function(a){t.$set(e.row,"select",a)},expression:"scope.row.select"}})]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.toUp(e)}}},[t._v("前移")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.toDown(e)}}},[t._v("后移")])]}}])})],1),t._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:t.saveAndCloseColumnSetDialog}},[t._v("完成")])],1),t._v(" "),a("el-col",{attrs:{span:6}},[a("el-button",{attrs:{type:"primary",size:"middle"},on:{click:t.toDefault}},[t._v("恢复默认")])],1)],1)],1),t._v(" "),a("el-dialog",{attrs:{title:t.dialogTitle,center:"",visible:t.dialogVisible,width:"480px"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:t.dialogLoading,expression:"dialogLoading"}],ref:"form",staticClass:"company-form",attrs:{"label-width":"120px",model:t.formData,rules:t.rulesForm}},[a("el-form-item",{staticClass:"dialog-form-inline-single",attrs:{prop:"monthDate",label:"所属时期"}},[a("el-date-picker",{attrs:{type:"month",format:"yyyy-MM","range-separator":"—",placeholder:"选择日期","value-format":"yyyy-MM-dd HH:mm:ss","picker-options":t.pickerOptionsYearMonth,clearable:""},model:{value:t.formData.monthDate,callback:function(e){t.$set(t.formData,"monthDate",e)},expression:"formData.monthDate"}})],1)],1),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.dialogVisible=!1}}},[t._v(t._s(t.config.cancelText))]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.save("form")}}},[t._v("保存")])],1)],1)],1)},staticRenderFns:[]};var d=a("VU/8")(u,m,!1,function(t){a("gBZM")},"data-v-df2ad77a",null);e.default=d.exports},gBZM:function(t,e){}});