diff --git a/pc4mobx/hrmSalary/apis/attendance.js b/pc4mobx/hrmSalary/apis/attendance.js index 8636296d..3fa34512 100644 --- a/pc4mobx/hrmSalary/apis/attendance.js +++ b/pc4mobx/hrmSalary/apis/attendance.js @@ -210,4 +210,14 @@ export const importAttendQuoteData = (params) => { }).then(res => res.json()) } - +// 查看考勤详情 +export const viewAttendQuote = (ids) => { + return fetch('/api/bs/hrmsalary/attendQuote/view', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(ids) + }).then(res => res.json()) +} diff --git a/pc4mobx/hrmSalary/components/importModal/modalStep3.js b/pc4mobx/hrmSalary/components/importModal/modalStep3.js index 0dbbfde8..b77eb3ca 100644 --- a/pc4mobx/hrmSalary/components/importModal/modalStep3.js +++ b/pc4mobx/hrmSalary/components/importModal/modalStep3.js @@ -1,6 +1,7 @@ import React from "react" import successImg from "./success.svg" import { Button, Table } from "antd" +import { WeaTable } from 'ecCom' export default class ModalStep3 extends React.Component { @@ -24,9 +25,9 @@ export default class ModalStep3 extends React.Component {
数据导入完成
已导入 {importResult.successCount} 条数据,失败 {importResult.errorCount} 条数据
-
+
{ - + } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/editSlideContent.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/editSlideContent.js index ef34b569..16b771ca 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/editSlideContent.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/editSlideContent.js @@ -23,62 +23,40 @@ let emptyItem = { taxDeduction: "0.00" } -@inject('otherDeductStore', "taxAgentStore") +@inject('attendanceStore') @observer export default class EditSlideContent extends React.Component { constructor(props) { super(props); - this.state = { - taxAgentId: "", - startDate: moment(new Date()).format("YYYY-MM"), - endDate: moment(new Date()).format("YYYY-MM"), - editable: this.props.editable === undefined ? "true": this.props.editable - } } componentWillMount() { // 初始化渲染页面 - const { taxAgentStore: { fetchTaxAgentOption } } = this.props; - fetchTaxAgentOption(); + const {attendanceStore: {viewAttendQuote}} = this.props; + viewAttendQuote({attendQuoteId: this.props.id}) } - addItem() { - const { taxRateStore: {setDataSource}} = this.props; - let dataSource = [...this.props.taxRateStore.dataSource]; - let indexNum = 1; - if(dataSource.length > 0) { - indexNum = dataSource[dataSource.length - 1].indexNum + 1 - } - let item = {...emptyItem} - item.indexNum = indexNum - dataSource.push(item); - setDataSource(dataSource) + getColumns(columns) { + let result = [...columns] + return result.filter(item => item.hide == "false") } - fetchCumDeductDetailList(param) { - const { otherDeductStore} = this.props; - const { getOtherDeductDetailList, currentRecord } = otherDeductStore; - getOtherDeductDetailList(currentRecord.id, param); - } - - render() { - const { taxAgentStore: {taxAgentOption}} = this.props; - const { otherDeductStore } = this.props; - const { slideTableStore, currentRecord } = otherDeductStore; - const { startDate, endDate, taxAgentId } = this.state; + const { attendanceStore } = this.props; + const { attendQuoteDetailPageInfo, attendQuoteDetailTableStore} = attendanceStore; return (
-
考勤周期: 2021-01-01至2021-01-31
- + { + this.props.salaryYearMonth != "" && +
考勤周期: {moment(this.props.salaryYearMonth + "-01").startOf("month").format("YYYY-MM-DD")} 至 {moment(this.props.salaryYearMonth + "-01").endOf("month").format("YYYY-MM-DD")}
+ }
-
-
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js index 8e973f84..4b543262 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js @@ -63,6 +63,8 @@ export default class Attendance extends React.Component { } this.fieldSearch = {} this.listSearch = {} + this.recordId = ""; // 考勤数据列表查看选择项 + this.salaryYearMonth = ""; // 考勤数据查看,当前数据的薪资所属月 } componentWillMount() { @@ -145,13 +147,34 @@ export default class Attendance extends React.Component { this.setState({modalVisiable: false}) } + // 考情引用的列 + getColumns(columns) { + let result = [...columns] + result.push({ + title: "操作", + key: "operate", + render: (text, record) => { + return this.handleViewAttendance(record)}>查看 + } + }) + return result; + } + + // 查看考勤详情 + handleViewAttendance(record) { + const { attendanceStore: {setSlideVisiable}} = this.props; + this.recordId = record.id + this.salaryYearMonth = record.salaryYearMonth + setSlideVisiable(true) + } + render() { const { attendanceStore } = this.props; const { modalParam } = this.state; const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = attendanceStore; const { step, setStep, setSlideVisiable, slideVisiable, doBatchDelete, attendTableStore, fieldSettingAttendList, fieldSettingCustomList, setFieldSettingAttendList, setFieldSettingCustomList, searchFieldSettingList } = attendanceStore; const { getAttendanceFieldSettingList, saveAttendanceFieldSetting, fieldDataSource, fieldTableStore, fieldPageInfo, attendanceDataSource, attendanceColumns, attendancePageInfo, importLedgerList, - previewAttendQuoteColumns, previewAttendQuoteDataSource} = attendanceStore + previewAttendQuoteColumns, previewAttendQuoteDataSource, importResult} = attendanceStore const selectedRowKeys = toJS(tableStore.selectedRowKeys) || []; // tableStore 右侧选中数组 if (!hasRight && !loading) { // 无权限处理 @@ -279,7 +302,6 @@ export default class Attendance extends React.Component { } - )} @@ -474,7 +496,7 @@ export default class Attendance extends React.Component { /> */} {this.handleFinish()}} previewImport={(params) => {this.handlePreviewImport(params)}} importFile={(params) => {this.handleImport(params)}} @@ -577,7 +599,7 @@ export default class Attendance extends React.Component { } /> } - content={()} + content={()} onClose={() => setSlideVisiable(false)} showMask={true} closeMaskOnClick={() => setSlideVisiable(false)} /> diff --git a/pc4mobx/hrmSalary/pages/mySalary/index.js b/pc4mobx/hrmSalary/pages/mySalary/index.js index 94715a45..742a1633 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/index.js +++ b/pc4mobx/hrmSalary/pages/mySalary/index.js @@ -2,7 +2,7 @@ import React from 'react'; import { inject, observer } from 'mobx-react'; import { toJS } from 'mobx'; -import { Button, Table, DatePicker } from 'antd'; +import { Button, Table, DatePicker, Spin } from 'antd'; import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaTable, WeaDatePicker } from 'ecCom'; @@ -175,7 +175,8 @@ export default class MySalary extends React.Component { /> { - this.state.selectedKey == '0' && + this.state.selectedKey == '0' && + } { this.state.selectedKey == '1' && diff --git a/pc4mobx/hrmSalary/pages/salaryFile/index.js b/pc4mobx/hrmSalary/pages/salaryFile/index.js index e5aeabe3..9fe2952f 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/index.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/index.js @@ -107,10 +107,14 @@ export default class SalaryFile extends React.Component { getColumns() { const { salaryFileStore: {tableStore}} = this.props; return tableStore.columns.filter(item => item.display == "true").map(item => { + item.width = item.oldWidth if(item.dataIndex == "operate") { item.render = (text, record) => ( this.handleEdit(record)}>查看 ) + item.fixed = 'right' + } else if(item.dataIndex == "username"){ + item.fixed = 'left' } return item }) @@ -304,6 +308,7 @@ export default class SalaryFile extends React.Component { total: pageInfo.total, current: pageInfo.pageNum }} + scroll={{x: 2300}} /> diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index d501d6ae..0639a37d 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -16,6 +16,7 @@ import SlideModalTitle from '../../../components/slideModalTitle' import SocialSecurityForm from './socialSecurityForm'; import AccumulationFundForm from './accumulationFundForm'; import OtherForm from './otherForm'; +import { tempateColumns } from '../../payroll/columns'; const { MonthPicker } = DatePicker; @@ -47,11 +48,7 @@ export default class Archives extends React.Component { let columns = [...tableStore.columns] columns = columns.filter(item => item.hide == "false") columns.map(item => { - item.render = (text, record) => { - return ( -
{text}
- ) - } + item.width = item.oldWidth }) columns.push({ title: "操作", diff --git a/pc4mobx/hrmSalary/stores/attendanceStore.js b/pc4mobx/hrmSalary/stores/attendanceStore.js index 3cf6d2eb..93e80f01 100644 --- a/pc4mobx/hrmSalary/stores/attendanceStore.js +++ b/pc4mobx/hrmSalary/stores/attendanceStore.js @@ -40,6 +40,11 @@ export class AttendanceStore { @observable previewAttendQuoteList = []; // 导入-预览列表 @observable previewAttendQuoteColumns = []; // 导入预览-列表对应列 @observable previewAttendQuoteDataSource = []; // 导入预览-列表 + @observable importResult = {} + + // 考勤数据详情 + @observable attendQuoteDetailPageInfo = {}; // 详情列表分页数据 + @observable attendQuoteDetailTableStore = new TableStore(); // 详情列表表头数据 @action searchFieldSettingList = (value) => { @@ -374,12 +379,23 @@ export class AttendanceStore { importAttendQuoteData = (params) => { API.importAttendQuoteData(params).then(res => { if(res.status) { - + this.importResult = res.data } else { message.error(res.errormsg || "导入失败") } }) } - + // 考勤数据详情 + @action + viewAttendQuote = (ids) => { + API.viewAttendQuote(ids).then(res => { + if(res.status) { + this.attendQuoteDetailPageInfo = res.data.pageInfo + this.attendQuoteDetailTableStore.getDatas(res.data.dataKey.datas) + } else { + message.error(res.errormsg || "获取失败") + } + }) + } } \ No newline at end of file diff --git a/pc4mobx/hrmSalary/stores/mySalary.js b/pc4mobx/hrmSalary/stores/mySalary.js index 54b744f7..86df1e2a 100644 --- a/pc4mobx/hrmSalary/stores/mySalary.js +++ b/pc4mobx/hrmSalary/stores/mySalary.js @@ -95,12 +95,15 @@ export class MySalaryStore { // 我的工资单列表 @action mySalaryBillList = (salaryYearMonth = []) => { + this.loading = true API.mySalaryBillList({salaryYearMonth}).then(res => { if(res.status) { this.myBillDataSource = res.data.datas this.myBillTableStore.getDatas(res.data.dataKey.datas) + this.loading = false } else { message.error(res.errormsg || "获取失败") + this.loading = false } }) }