Compare commits
10 Commits
e7d241cdba
...
8109230b3e
| Author | SHA1 | Date |
|---|---|---|
|
|
8109230b3e | |
|
|
e01ee211d8 | |
|
|
334a7660a9 | |
|
|
e9d301927f | |
|
|
dee1059ca7 | |
|
|
4ecde5921e | |
|
|
5c02dc876c | |
|
|
4ca0a4b756 | |
|
|
9a50947d8a | |
|
|
d652b2cdc6 |
|
|
@ -166,7 +166,7 @@ class SalaryDetails extends Component {
|
|||
this.postMessageToChild({
|
||||
dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, sumRow,
|
||||
columns: _.map(columns, (it, idx) => ({
|
||||
dataIndex: it.column || it.dataIndex, title: it.text || it.title, calcDetail: true,
|
||||
dataIndex: it.column || it.dataIndex, title: it.text || it.title, calcDetail: true, showSee: false,
|
||||
width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : (it.width || it.oldWidth),
|
||||
fixed: (idx === 1 || idx === 0 || idx === 2) ? "left" : "",
|
||||
ellipsis: true
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ class AttendanceDataEditSlide extends Component {
|
|||
this.getAttendQuoteData(nextProps);
|
||||
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
form.resetForm();
|
||||
this.setState({ conditions: [], loading: false });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -92,7 +93,8 @@ class AttendanceDataEditSlide extends Component {
|
|||
render() {
|
||||
const { record } = this.props, { username } = record, { conditions, loading } = this.state;
|
||||
const btns = [
|
||||
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(111, "保存")}</Button>
|
||||
<Button type="primary" disabled={_.isEmpty(conditions)} onClick={this.save}
|
||||
loading={loading}>{getLabel(111, "保存")}</Button>
|
||||
];
|
||||
return (<WeaSlideModal {...this.props} className="editAttendanceSlide" top={0} height={100} width={1000}
|
||||
measureX="px" measureT="%" measureY="%" direction="right"
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@
|
|||
* Date: 2023/3/7
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaInputSearch, WeaLocaleProvider, WeaSlideModal, WeaTable, WeaTop } from "ecCom";
|
||||
import { WeaInputSearch, WeaLocaleProvider, WeaSlideModal, WeaTop } from "ecCom";
|
||||
import { viewAttendQuote } from "../../../../apis/attendance";
|
||||
import AttendanceDataEditSlide from "./attendanceDataEditSlide";
|
||||
import { Button } from "antd";
|
||||
import { Button, Spin } from "antd";
|
||||
import "./index.less";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
|
@ -17,11 +17,35 @@ class AttendanceDataViewSlide extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: { query: false }, keyword: "", dataSource: [], columns: [],
|
||||
loading: { query: false }, keyword: "", dataSource: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }, attendanceSlide: { visible: false, record: {} }
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
handleReceive = async ({ data }) => {
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
if (type === "turn") {
|
||||
switch (id) {
|
||||
case "PAGEINFO":
|
||||
this.setState({ pageInfo: { ...this.state.pageInfo, ...params } }, () => this.viewAttendQuote());
|
||||
break;
|
||||
case "EDIT":
|
||||
this.setState({ attendanceSlide: { visible: true, record: params } });
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
document.querySelector(".attendanceRefWrapper").classList.add("zIndex0-attendance");
|
||||
|
|
@ -34,27 +58,35 @@ class AttendanceDataViewSlide extends Component {
|
|||
|
||||
viewAttendQuote = (extraPayload = {}, props) => {
|
||||
const { loading, pageInfo, keyword } = this.state;
|
||||
const { attendQuoteId } = props;
|
||||
const { attendQuoteId } = props || this.props;
|
||||
this.setState({ loading: { ...loading, query: true } });
|
||||
viewAttendQuote({ ...pageInfo, attendQuoteId, keyword, ...extraPayload }).then(({ status, data }) => {
|
||||
this.setState({ loading: { ...loading, query: false } });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data.pageInfo;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource,
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource
|
||||
}, () => this.postMessageToChild({
|
||||
pageInfo: this.state.pageInfo, dataSource, showRowSelection: false, unitTableType: "attendanceView",
|
||||
columns: [
|
||||
..._.map(columns, (o, i) => ({ ...o, width: 150, fixed: i === 0 ? "left" : null })),
|
||||
..._.map(columns, (o, i) => ({ ...o, width: 150, fixed: i === 0 ? "left" : false })),
|
||||
{
|
||||
title: getLabel(111, "操作"), dataIndex: "operate", width: 80,
|
||||
render: (__, record) => (<a href="JavaScript:void(0);" onClick={() => this.setState({
|
||||
attendanceSlide: { visible: true, record }
|
||||
})}>{getLabel(111, "编辑")}</a>)
|
||||
title: getLabel(111, "操作"), dataIndex: "operate", fixed: "right",
|
||||
operateType: [{ key: "EDIT", label: getLabel(111, "编辑") }]
|
||||
}
|
||||
]
|
||||
});
|
||||
}));
|
||||
}
|
||||
}).catch(() => this.setState({ loading: { ...loading, query: false } }));
|
||||
};
|
||||
postMessageToChild = (payload = {}) => {
|
||||
const i18n = {
|
||||
"操作": getLabel(30585, "操作"), "编辑": getLabel(111, "编辑"), "共": getLabel(18609, "共"),
|
||||
"条": getLabel(18256, "条")
|
||||
};
|
||||
const childFrameObj = document.getElementById("attendanceViewTable");
|
||||
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
handleExportAttendQuote = () => {
|
||||
if (!this.handleDebounce) {
|
||||
this.handleDebounce = _.debounce(() => {
|
||||
|
|
@ -69,24 +101,7 @@ class AttendanceDataViewSlide extends Component {
|
|||
|
||||
render() {
|
||||
const { showOperateBtn, salaryYearMonth, ...extra } = this.props;
|
||||
const { columns, dataSource, loading, pageInfo, keyword, attendanceSlide } = this.state;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
}, () => this.viewAttendQuote({}, this.props));
|
||||
},
|
||||
onChange: (current) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current }
|
||||
}, () => this.viewAttendQuote({}, this.props));
|
||||
}
|
||||
};
|
||||
const { loading, keyword, attendanceSlide } = this.state;
|
||||
const btns = [
|
||||
<Button type="primary" onClick={this.handleExportAttendQuote}>{getLabel(81272, "导出全部")}</Button>,
|
||||
<WeaInputSearch
|
||||
|
|
@ -108,9 +123,16 @@ class AttendanceDataViewSlide extends Component {
|
|||
<div>{getLabel(543376, "考勤周期")}:{salaryYearMonth}</div>
|
||||
<div></div>
|
||||
</div>
|
||||
<WeaTable
|
||||
columns={columns} dataSource={dataSource} bordered pagination={pagination}
|
||||
loading={loading.query} scroll={{ x: 1200, y: `calc(100vh - 240px)` }}/>
|
||||
<div style={{ height: `calc(100% - 40px)` }}>
|
||||
<Spin spinning={loading.query}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
// src="http://localhost:7607/#/unitTable"
|
||||
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/unitTable"
|
||||
id="attendanceViewTable"
|
||||
/>
|
||||
</Spin>
|
||||
</div>
|
||||
<AttendanceDataEditSlide {...attendanceSlide}
|
||||
onSuccess={() => this.viewAttendQuote({}, this.props)}
|
||||
onClose={() => this.setState({
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@
|
|||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
.ant-spin-nested-loading, .ant-spin-container {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,9 +73,14 @@ class CustomTreeSelect extends Component {
|
|||
const { itemName } = detail;
|
||||
return (
|
||||
<TreeSelect dropdownStyle={{ maxHeight: 320, overflow: "auto" }} defaultValue={itemName}
|
||||
dropdownMatchSelectWidth className="custom_item_treeselect"
|
||||
dropdownMatchSelectWidth className="custom_item_treeselect" showSearch
|
||||
loadData={(node) => this.getSourceItem(node.props.value)}
|
||||
onSelect={this.handleSelect}>
|
||||
onSelect={this.handleSelect}
|
||||
treeNodeFilterProp="title"
|
||||
filterTreeNode={(inputValue, treeNode) => {
|
||||
const title = treeNode.props.title.props ? treeNode.props.title.props.children[0].props.children : treeNode.props.title;
|
||||
return title.toLowerCase().indexOf(inputValue.toLowerCase()) >= 0;
|
||||
}}>
|
||||
{
|
||||
_.map(sourceList, o => (
|
||||
<TreeNode title={o.value} key={o.key} value={o.key} isLeaf={o.isLeaf} selectable={false}>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class Index extends Component {
|
|||
return (
|
||||
<div className="salary-btn-flex">
|
||||
<div className="mounth-range">
|
||||
<span className="label">{getLabel(543549, "薪资所属月:")}</span>
|
||||
<span className="label">{getLabel(111, "税款所属期:")}</span>
|
||||
<MonthRangePicker dateRange={dateRange} viewAttr={2}
|
||||
onChange={v => this.props.onChange({ dateRange: v })}/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import React, { Component } from "react";
|
|||
import { WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import { Dropdown, Menu, message, Modal } from "antd";
|
||||
import { getDeclareList, withDrawTaxDeclaration } from "../../../../apis/declare";
|
||||
import { sysConfCodeRule } from "../../../../apis/ruleconfig";
|
||||
import { sysConfCodeRule, sysinfo } from "../../../../apis/ruleconfig";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
|
|
@ -35,18 +35,19 @@ class Index extends Component {
|
|||
if (status && data === "1") this.setState({ showWithDrawBtn: data === "1" });
|
||||
});
|
||||
};
|
||||
getDeclareList = (props) => {
|
||||
const { pageInfo } = this.state;
|
||||
const { queryParams } = props;
|
||||
getDeclareList = async (props) => {
|
||||
const { data: sysData } = await sysinfo();
|
||||
const { pageInfo } = this.state, { queryParams } = props;
|
||||
const { dateRange, ...extra } = queryParams;
|
||||
const [fromSalaryMonthStr, endSalaryMonthStr] = dateRange || [];
|
||||
const params = { fromSalaryMonthStr, endSalaryMonthStr, ...extra };
|
||||
const [fromSalaryMonth, endSalaryMonth] = dateRange || [];
|
||||
const params = { fromSalaryMonth: fromSalaryMonth + "-01", endSalaryMonth: endSalaryMonth + "-01", ...extra };
|
||||
const payload = { ...pageInfo, ...params };
|
||||
this.setState({ loading: true });
|
||||
getDeclareList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageNum, pageSize, total } = data;
|
||||
let { columns, list: dataSource, pageNum, pageSize, total } = data;
|
||||
sysData["TAX_DECLARATION_DATE_TYPE"] === "1" && (columns = _.filter(columns, o => o.dataIndex !== "salaryMonth"));
|
||||
this.setState({
|
||||
dataSource, pageInfo: { ...pageInfo, pageNum, pageSize, total },
|
||||
columns: _.map(columns, o => {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ class PersonalScopeModal extends Component {
|
|||
...scopeSelectLinkageDatas[cur],
|
||||
browserConditionParam: {
|
||||
...scopeSelectLinkageDatas[cur].browserConditionParam,
|
||||
isSingle: true,
|
||||
replaceDatas: !_.isEmpty(record) ? [{
|
||||
id: String(record.targetId),
|
||||
name: record.targetName
|
||||
|
|
|
|||
Loading…
Reference in New Issue