{handleSwitchItemChange(record, value)}}/>
- case "operate":
- return {this.onEdit(record)}}>查看明细
default:
return
}
}
return newColumn;
});
+ newColumns.push({
+ title: "操作",
+ dataIndex: "operate",
+ render: (text, record) => {
+ return (
+ {this.onItemEdit(record)}}>查看明细
+ )
+ }
+ })
return newColumns;
}
@@ -310,7 +331,8 @@ export default class Attendance extends React.Component {
const { attendanceStore: { saveAttendanceField, getAttendanceFieldList }} = this.props;
value.fieldType = value.fieldType == "1" ? "NUMBER" : "TEXT"
saveAttendanceField(value)
- getAttendanceFieldList({fieldName: this.state.fieldName})
+ this.fieldSearch = {fieldName: this.state.fieldName}
+ getAttendanceFieldList(this.fieldSearch)
this.setState({itemMangeVisible: false})
}
@@ -319,7 +341,8 @@ export default class Attendance extends React.Component {
// alert(JSON.stringify(value));
value.fieldType = value.fieldType == "1" ? "NUMBER" : "TEXT"
updateAttendanceField(value)
- getAttendanceFieldList({fieldName: this.state.fieldName})
+ this.fieldSearch = {fieldName: this.state.fieldName}
+ getAttendanceFieldList(this.fieldSearch)
this.setState({itemMangeVisible: false})
}
@@ -384,13 +407,13 @@ export default class Attendance extends React.Component {
}}
/>
-
+ /> */}
:
@@ -406,13 +429,23 @@ export default class Attendance extends React.Component {
/>
+
+
{this.handleFieldPageChange(value)},
+ total: fieldPageInfo.total,
+ current: this.state.fieldCurrent
+ }}
/>
}
rightContent={
diff --git a/pc4mobx/hrmSalary/pages/payroll/index.js b/pc4mobx/hrmSalary/pages/payroll/index.js
index bcc5aaa4..f9dcc14d 100644
--- a/pc4mobx/hrmSalary/pages/payroll/index.js
+++ b/pc4mobx/hrmSalary/pages/payroll/index.js
@@ -360,7 +360,6 @@ export default class Payroll extends React.Component {
onDelete={(record)=> this.handleTemplateListDelete(record)}
/>
}
-
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js
index a7097026..6b3645ea 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js
@@ -2,14 +2,14 @@ import React from 'react';
import { inject, observer } from 'mobx-react';
import { toJS } from 'mobx';
-import { Button, Table, DatePicker, Row, Col, Switch, Modal } from 'antd';
+import { Button, Table, DatePicker, Row, Col, Switch, Modal, Dropdown, Menu } from 'antd';
-import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaInputSearch, WeaSlideModal, WeaSelect } from 'ecCom';
+import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaInputSearch, WeaSlideModal, WeaSelect, WeaTable } from 'ecCom';
import { WeaTableNew } from "comsMobx"
import "./index.less";
-const WeaTable = WeaTableNew.WeaTable;
+const WeaMobxTable = WeaTableNew.WeaTable;
import { renderNoright, getSearchs } from '../../../util'; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
import CustomTab from '../../../components/customTab';
@@ -58,11 +58,14 @@ export default class Programme extends React.Component {
// 增加编辑功能,重写columns绑定事件
getColumns = (columns) => {
- let newColumns = '';
- newColumns = columns.map(column => {
+ let newColumns = columns.filter(item => item.dataIndex !== "id" && item.dataIndex !== "paymentArea")
+ newColumns = newColumns.map(column => {
let newColumn = column;
newColumn.render = (text, record, index) => { //前端元素转义
let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex];
+ if(newColumn.dataIndex == "id") {
+ newColumn.display = false
+ }
switch(newColumn.dataIndex) {
case "operate":
return {this.onEdit(record)}}>编辑
@@ -72,6 +75,34 @@ export default class Programme extends React.Component {
}
return newColumn;
});
+
+ newColumns.push({
+ title: "操作",
+ dataIndex: "operate",
+ render: (text, record) => {
+ return {this.onEdit(record)}}>编辑
+ }
+ })
+ newColumns.push(
+ {
+ title : '',
+ key: "moreOperate",
+ dataIndex: "moreOperate",
+ render: (text, record) => {
+ return (
+
+
+ {
+ this.onCopy(record);
+ }}>复制
+
+ }>
+
+
+
+ );
+ }
+ })
return newColumns;
}
@@ -127,17 +158,6 @@ export default class Programme extends React.Component {
})
}
- onOperatesClick(record, index, operate, flag) {
- switch(operate.text.toString()){
- case '编辑': // 编辑
- this.onEdit(record);
- break;
- case "复制": // 复制
- this.onCopy(record);
- break;
- }
- }
-
onCustomOperatesClick(record, index, operate, flag) {
switch(operate.text.toString()){
case '编辑': // 编辑
@@ -167,7 +187,7 @@ export default class Programme extends React.Component {
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = programmeStore;
const { selectedKey, setSelectedKey, getCustomCategoryList, customTableStore,
customSelectkey, setCustomSelectkey, requestParams, setRequestParams, formCondition,
- setCustomNewVisible, customNewVisible } = programmeStore;
+ setCustomNewVisible, customNewVisible, tableDataSource, tableColumns } = programmeStore;
if (!hasRight && !loading) { // 无权限处理
return renderNoright();
}
@@ -349,7 +369,7 @@ export default class Programme extends React.Component {
selectedKey == "custom" ?
:
+ //
+
+
}
diff --git a/pc4mobx/hrmSalary/stores/attendanceStore.js b/pc4mobx/hrmSalary/stores/attendanceStore.js
index 6f7e2a8f..13ddfdf7 100644
--- a/pc4mobx/hrmSalary/stores/attendanceStore.js
+++ b/pc4mobx/hrmSalary/stores/attendanceStore.js
@@ -25,6 +25,10 @@ export class AttendanceStore {
requestFeildAttendList = []; // 请求数据
requestFeildCustomList = []; // 请求数据
+ // 考勤字段
+ @observable fieldDataSource = []; // 字段列表
+ @observable fieldTableStore = new TableStore(); // new Table
+ @observable fieldPageInfo = {};
@action
searchFieldSettingList = (value) => {
@@ -138,7 +142,9 @@ export class AttendanceStore {
this.loading = true;
API.getAttendanceFieldList(params).then(res => {
if (res.status) { // 接口请求成功/失败处理
- this.tableStore.getDatas(res.data.datas); // table 请求数据
+ this.fieldTableStore.getDatas(res.data.dataKey.datas); // table 请求数据
+ this.fieldDataSource = res.data.pageInfo.list
+ this.fieldPageInfo = res.data.pageInfo
} else {
message.error(res.errormsg || '接口调用失败!')
}
diff --git a/pc4mobx/hrmSalary/stores/programme.js b/pc4mobx/hrmSalary/stores/programme.js
index 35ddd247..a6e48ba9 100644
--- a/pc4mobx/hrmSalary/stores/programme.js
+++ b/pc4mobx/hrmSalary/stores/programme.js
@@ -25,9 +25,13 @@ export class ProgrammeStore {
}
@observable form = new WeaForm();
@observable formCondition = []; // 存储后台得到的form数据
- @observable customNewVisible = false;
+@observable customNewVisible = false;
@observable customRequest = {}
+ // 福利方案列表
+ @observable tableDataSource = [];
+ @observable tableColumns = [];
+
@action
setCustomRequest = customRequest => this.customRequest = customRequest
@@ -89,7 +93,11 @@ export class ProgrammeStore {
params.welfareTypeEnum = selectKey
API.getTable(params).then(action(res => {
if (res.status) { // 接口请求成功/失败处理
- this.tableStore.getDatas(res.data.datas); // table 请求数据
+ // this.tableStore.getDatas(res.data.datas); // table 请求数据
+ this.tableDataSource = res.data.list ? res.data.list : [];
+ this.tableColumns = res.data.columns;
+ console.log("this.tableColumns", this.tableColumns);
+ console.log("this.tableDataSource", this.tableDataSource);
} else {
message.error(res.errormsg || '接口调用失败!')
}
From 08ce3de56426f505c83c2c9ba59ff34a74844313 Mon Sep 17 00:00:00 2001
From: MustangDeng <670124965@qq.com>
Date: Fri, 22 Apr 2022 18:12:16 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E8=B4=A6=E5=A5=97=E5=88=A0=E9=99=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../pages/dataAcquisition/attendance/index.js | 40 ++++++++++++++-----
pc4mobx/hrmSalary/pages/ledger/index.js | 2 +-
pc4mobx/hrmSalary/stores/attendanceStore.js | 10 ++++-
3 files changed, 40 insertions(+), 12 deletions(-)
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js
index f5c2c8f8..7472495f 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js
@@ -59,6 +59,7 @@ export default class Attendance extends React.Component {
fieldCurrent: 1
}
this.fieldSearch = {}
+ this.listSearch = {}
}
componentWillMount() {
@@ -91,17 +92,23 @@ export default class Attendance extends React.Component {
// 字段列表分页
handleFieldPageChange(value) {
- this.setState({fieldCurrent: value})
const { attendanceStore: {getAttendanceFieldList} } = this.props;
this.fieldSearch.current = value
getAttendanceFieldList(this.fieldSearch)
}
+ // 列表
+ handleDataPageChange(value) {
+ const { attendanceStore: { getAttendanceList }} = this.props;
+ this.listSearch.current = value
+ getAttendanceList(this.listSearch)
+ }
+
render() {
const { attendanceStore } = this.props;
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} = attendanceStore
+ const { getAttendanceFieldSettingList, saveAttendanceFieldSetting, fieldDataSource, fieldTableStore, fieldPageInfo, attendanceDataSource, attendanceColumns} = attendanceStore
const selectedRowKeys = toJS(tableStore.selectedRowKeys) || []; // tableStore 右侧选中数组
if (!hasRight && !loading) { // 无权限处理
@@ -167,20 +174,20 @@ export default class Attendance extends React.Component {
this.setState({
startDate: value
})
-
- getAttendanceList({
+ this.listSearch = {
salaryYearMonth: [value, this.state.endDate]
- })
+ }
+ getAttendanceList(this.listSearch)
}}
onEndDateChange={(value) => {
this.setState({
endDate: value
})
- getAttendanceList({
+ this.listSearch = {
salaryYearMonth: [this.state.startDate, value]
- })
-
+ }
+ getAttendanceList(this.listSearch)
}}
/>
}
@@ -278,7 +285,8 @@ export default class Attendance extends React.Component {
this.fieldSearch = {fieldName: this.state.fieldName}
getAttendanceFieldList(this.fieldSearch)
} else if(v == "0") {
- getAttendanceList({})
+ this.listSearch = {}
+ getAttendanceList(this.listSearch)
}
}
@@ -414,6 +422,18 @@ export default class Attendance extends React.Component {
// getColumns={this.getColumns}
// onOperatesClick={this.onOperatesClick.bind(this)}
/> */}
+
+ {this.handleDataPageChange(value)},
+ total: attendancePageInfo.total,
+ current: attendancePageInfo.pageNum
+ }}
+ />
:
@@ -444,7 +464,7 @@ export default class Attendance extends React.Component {
pagination={{
onChange: (value) => {this.handleFieldPageChange(value)},
total: fieldPageInfo.total,
- current: this.state.fieldCurrent
+ current: fieldPageInfo.pageNum
}}
/>
}
diff --git a/pc4mobx/hrmSalary/pages/ledger/index.js b/pc4mobx/hrmSalary/pages/ledger/index.js
index ae951f4c..70c80ef0 100644
--- a/pc4mobx/hrmSalary/pages/ledger/index.js
+++ b/pc4mobx/hrmSalary/pages/ledger/index.js
@@ -135,7 +135,7 @@ export default class Ledger extends React.Component {
case "3": // 关联人员
this.handleItemClick(record, 1)
case "4": // 删除
- ({
+ Modal.confirm({
title: '信息确认',
content: '确认删除',
onOk:() => {
diff --git a/pc4mobx/hrmSalary/stores/attendanceStore.js b/pc4mobx/hrmSalary/stores/attendanceStore.js
index 13ddfdf7..ce0073f8 100644
--- a/pc4mobx/hrmSalary/stores/attendanceStore.js
+++ b/pc4mobx/hrmSalary/stores/attendanceStore.js
@@ -30,6 +30,11 @@ export class AttendanceStore {
@observable fieldTableStore = new TableStore(); // new Table
@observable fieldPageInfo = {};
+ // 考勤数据列表
+ @observable attendanceDataSource = [];
+ @observable attendancePageInfo = {};
+ @observable attendanceColumns = [];
+
@action
searchFieldSettingList = (value) => {
if(value != "") {
@@ -225,7 +230,10 @@ export class AttendanceStore {
this.loading = true;
API.getAttendanceList(params).then(res => {
if (res.status) { // 接口请求成功/失败处理
- this.attendTableStore.getDatas(res.data.datas); // table 请求数据
+ // this.attendTableStore.getDatas(res.data.datas); // table 请求数据
+ this.attendanceDataSource = res.data.list;
+ this.attendancePageInfo = res.data;
+ this.attendanceColumns = res.data.columns
} else {
message.error(res.errormsg || '接口调用失败!')
}