custom/领悦
This commit is contained in:
parent
64c56fc280
commit
2064cc4111
|
|
@ -37,3 +37,12 @@ export const exportSIReport = (params) => {
|
|||
export const genAndPreveiw = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/ly/PZ/genAndPreveiw", params);
|
||||
};
|
||||
export const pushUCAndSave = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/ly/PZ/pushUCAndSave", params);
|
||||
};
|
||||
export const getHistoryVoucherList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/ly/PZ/historyVoucherList", params);
|
||||
};
|
||||
export const getHistoryVoucherDetailList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/ly/PZ/historyVoucherDetailList", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* 自定义浏览框组件
|
||||
* 单选
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/9/3
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import AssociativeSearchMult from "./associativeSearchMult";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class AssociativeSearchSingle extends Component {
|
||||
|
||||
|
||||
render() {
|
||||
return (
|
||||
<AssociativeSearchMult {...this.props}/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default AssociativeSearchSingle;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* 自定义浏览框组件
|
||||
*
|
||||
* 多选
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/29
|
||||
* @Wechat:
|
||||
|
|
@ -38,14 +38,24 @@ class AssociativeSearchMult extends Component {
|
|||
this.getData(value);
|
||||
};
|
||||
getData = (name = "") => {
|
||||
const { completeURL = "/api/bs/hrmsalary/salarysob/listByTaxAgent" } = this.props;
|
||||
const { browserConditionParam } = this.props;
|
||||
const { completeURL, searchParamsKey, convertDatasource } = browserConditionParam;
|
||||
if (_.trim(name)) {
|
||||
postFetch(completeURL, { taxAgentId: "19", name }).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
this.setState({ data: _.map(data, o => ({ ...o, id: String(o.id) })), activeKey: this.getActiveKey(data) });
|
||||
}
|
||||
});
|
||||
postFetch(completeURL, { [searchParamsKey]: name, current: 1, pageSize: 9999 })
|
||||
.then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status && data.list) {
|
||||
this.setState({
|
||||
data: convertDatasource ? convertDatasource(data.list) : data.list,
|
||||
activeKey: this.getActiveKey(convertDatasource ? convertDatasource(data.list) : data.list)
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
data: _.map(data, o => ({ ...o, id: String(o.id), name: o.name })),
|
||||
activeKey: this.getActiveKey(data)
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.setState({ data: [], loading: false, activeKey: "" });
|
||||
}
|
||||
|
|
@ -83,14 +93,34 @@ class AssociativeSearchMult extends Component {
|
|||
const { datas, selectedValues } = this.props;
|
||||
if (this.props.clickCallback) this.props.clickCallback(selectedValues, datas);
|
||||
};
|
||||
isReadOnly = () => {
|
||||
const { viewAttr } = this.props;
|
||||
return viewAttr === 1 || viewAttr === "1";
|
||||
};
|
||||
|
||||
render() {
|
||||
const { data, dropdownWidth } = this.state;
|
||||
const { viewAttr, selectedValues, datas } = this.props;
|
||||
const { viewAttr, selectedValues, datas, isSingle, browserConditionParam = {} } = this.props;
|
||||
const clsname = classNames({
|
||||
"required": (viewAttr === 3 || viewAttr === "3") && _.isEmpty(selectedValues),
|
||||
"mr12": viewAttr === "3" && _.isEmpty(selectedValues)
|
||||
"mr12": viewAttr === "3" && _.isEmpty(selectedValues),
|
||||
"wea-associative-single": (isSingle || browserConditionParam.isSingle),
|
||||
"wea-associative-search-mult": !(isSingle || browserConditionParam.isSingle)
|
||||
});
|
||||
if (this.isReadOnly()) {
|
||||
let arr = [];
|
||||
selectedValues && selectedValues.map(v => {
|
||||
let item = datas[v].name;
|
||||
if (_.isString(item)) {
|
||||
arr.push(<a className="child-item wdb">{item}</a>);
|
||||
} else {
|
||||
arr.push(<a className="child-item wdb" dangerouslySetInnerHTML={{ __html: item }}> </a>);
|
||||
}
|
||||
});
|
||||
return (
|
||||
<span className={`wea-associative-search wea-field-readonly ${clsname} `} ref="searchWrapperMui">{arr}</span>
|
||||
);
|
||||
}
|
||||
let options = data.map(d => <Option key={d.id} title={d.name}>{d.name}</Option>);
|
||||
selectedValues && selectedValues.map((v) => {
|
||||
v && options.unshift(<Option key={v} title={datas[v].name}>{datas[v].name}</Option>);
|
||||
|
|
@ -116,7 +146,7 @@ class AssociativeSearchMult extends Component {
|
|||
{options}
|
||||
</Select>;
|
||||
return (
|
||||
<div className={`wea-associative-search wea-associative-search-mult ${clsname}`} ref="searchWrapperMui">
|
||||
<div className={`wea-associative-search ${clsname}`} ref="searchWrapperMui">
|
||||
{select}
|
||||
<Icon type="loading" style={{ display: this.state.loading ? "block" : "none" }}/>
|
||||
<div className="ant-input-group-wrap">
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll } from "ecCom";
|
||||
import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll, WeaTable } from "ecCom";
|
||||
import { Button, Col, Row, Spin } from "antd";
|
||||
import CustomBrowserMutiLeft from "./customBrowserMutiLeft";
|
||||
import CustomBrowserMutiRight from "./customBrowserMutiRight";
|
||||
|
|
@ -21,60 +21,129 @@ class CustomBrowserDialog extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, listDatas: []
|
||||
loading: false, listDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: []
|
||||
};
|
||||
this.selectedData = {};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible) this.getData();
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getData();
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) this.setState({ selectedRowKeys: nextProps.selectedValues });
|
||||
}
|
||||
|
||||
getData = (query = {}) => {
|
||||
const { completeURL = "/api/bs/hrmsalary/salarysob/listByTaxAgent" } = this.props;
|
||||
const { pageInfo } = this.state;
|
||||
const { dialogType, completeURL, convertDatasource } = this.props;
|
||||
let payload = {};
|
||||
dialogType === "table" && (payload = { ...pageInfo, ...payload, ...query });
|
||||
this.setState({ loading: true });
|
||||
postFetch(completeURL, { taxAgentId: "19", ...query }).then(({ status, data }) => {
|
||||
postFetch(completeURL, payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
this.setState({ listDatas: _.map(data, o => ({ ...o, id: String(o.id) })) });
|
||||
if (status && data.list) {
|
||||
const { pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
listDatas: convertDatasource ? convertDatasource(data.list) : data.list,
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }
|
||||
});
|
||||
} else {
|
||||
this.setState({ listDatas: data });
|
||||
}
|
||||
});
|
||||
};
|
||||
handleRowClick = record => {
|
||||
if (!this.props.isSingle) return;
|
||||
const values = [record.id];
|
||||
const selectedData = { [record["id"]]: record };
|
||||
this.props.onCancel();
|
||||
this.props.onChange && this.props.onChange(values, selectedData);
|
||||
};
|
||||
handleClear = () => {
|
||||
this.props.onCancel();
|
||||
this.props.onChange && this.props.onChange([], {});
|
||||
};
|
||||
handleOk = () => {
|
||||
const { selectedRowKeys } = this.state;
|
||||
this.selectedData = {};
|
||||
selectedRowKeys.forEach((v) => {
|
||||
let item = this.getItemById(v);
|
||||
if (item) this.selectedData[v] = item;
|
||||
});
|
||||
this.props.onChange && this.props.onChange(selectedRowKeys, this.selectedData);
|
||||
this.props.onCancel && this.props.onCancel();
|
||||
};
|
||||
getItemById = (id) => {
|
||||
const { listDatas } = this.state, { datas } = this.props;
|
||||
if (datas[id]) return datas[id];
|
||||
if (!_.isEmpty(listDatas)) {
|
||||
for (let i = 0; i < listDatas.length; i++) {
|
||||
if (id === listDatas[i].id) return listDatas[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading, listDatas } = this.state;
|
||||
const { loading, listDatas, pageInfo, selectedRowKeys } = this.state;
|
||||
const { dialogType, tableProps: { rowKey, columns }, isSingle } = this.props;
|
||||
const sheight = this.dialog ? this.dialog.state.height - 55 : 260;
|
||||
const buttons = [
|
||||
<Button type="primary" onClick={this.handleOk}>{getLabel(111, "确 定")}</Button>,
|
||||
<Button type="ghost" onClick={this.handleClear}>{getLabel(111, "清 除")}</Button>,
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(111, "取 消")}</Button>];
|
||||
let dom = <Spin spinning={loading}>
|
||||
<div style={{ padding: 10, height: "100%" }}>
|
||||
<div className="wea-hr-muti-input-left">
|
||||
<Row style={{ height: 35 }}>
|
||||
<Col span="24"> <WeaInputSearch/> </Col>
|
||||
</Row>
|
||||
<div>
|
||||
<WeaNewScroll height={sheight}>
|
||||
<CustomBrowserMutiLeft
|
||||
datas={listDatas}
|
||||
/>
|
||||
</WeaNewScroll>
|
||||
</div>
|
||||
</div>
|
||||
<div className="wea-transfer-opration">
|
||||
<CustomBrowserOperation/>
|
||||
</div>
|
||||
<div className="wea-hr-muti-input-right">
|
||||
<CustomBrowserMutiRight height={sheight}/>
|
||||
</div>
|
||||
</div>
|
||||
</Spin>;
|
||||
if (dialogType === "table") {
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
}, () => this.getData());
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getData());
|
||||
}
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: selectedRowKeys => this.setState({ selectedRowKeys })
|
||||
};
|
||||
dom = <WeaTable dataSource={listDatas} loading={loading} pagination={pagination} scroll={{ y: sheight }}
|
||||
onRowClick={this.handleRowClick} rowSelection={!isSingle ? rowSelection : null}
|
||||
rowKey={rowKey || "id"} columns={columns}/>;
|
||||
}
|
||||
dialogType === "table" && isSingle && buttons.splice(0, 1);
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} initLoadCss ref={dom => this.dialog = dom} title={getLabel(111, "数据选择")}
|
||||
className="custom_browser_dialog" style={{
|
||||
width: 784, height: 460, minHeight: 200, minWidth: 380,
|
||||
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}} buttons={[
|
||||
<Button type="primary">{getLabel(111, "确 定")}</Button>,
|
||||
<Button type="ghost">{getLabel(111, "清 除")}</Button>,
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(111, "取 消")}</Button>]}>
|
||||
<Spin spinning={loading}>
|
||||
<div style={{ padding: 10, height: "100%" }}>
|
||||
<div className="wea-hr-muti-input-left">
|
||||
<Row style={{ height: 35 }}>
|
||||
<Col span="24"> <WeaInputSearch/> </Col>
|
||||
</Row>
|
||||
<div>
|
||||
<WeaNewScroll height={sheight}>
|
||||
<CustomBrowserMutiLeft
|
||||
datas={listDatas}
|
||||
/>
|
||||
</WeaNewScroll>
|
||||
</div>
|
||||
</div>
|
||||
<div className="wea-transfer-opration">
|
||||
<CustomBrowserOperation/>
|
||||
</div>
|
||||
<div className="wea-hr-muti-input-right">
|
||||
<CustomBrowserMutiRight height={sheight}/>
|
||||
</div>
|
||||
</div>
|
||||
</Spin>
|
||||
}} buttons={buttons}>
|
||||
{dom}
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import AssociativeSearchMult from "./components/associativeSearchMult";
|
||||
import AssociativeSearchSingle from "./components/AssociativeSearchSingle";
|
||||
import CustomBrowserDialog from "./components/customBrowserDialog";
|
||||
import classNames from "classnames";
|
||||
import "./index.less";
|
||||
|
|
@ -27,8 +28,30 @@ class Index extends Component {
|
|||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { value, fieldConfig } = this.props;
|
||||
const { browserConditionParam: { replaceDatas = [] } } = fieldConfig;
|
||||
if (value && replaceDatas.length > 0) {
|
||||
this.setState({
|
||||
searchKeys: value.split(","),
|
||||
selectedData: _.reduce(replaceDatas, (pre, cur) => ({ ...pre, [cur["id"]]: cur }), {})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
renderSingle = () => {
|
||||
return null;
|
||||
const { fieldConfig } = this.props;
|
||||
const { selectedData, searchKeys } = this.state;
|
||||
return (<div>
|
||||
<AssociativeSearchSingle
|
||||
{...fieldConfig}
|
||||
{...this.props}
|
||||
datas={selectedData}
|
||||
selectedValues={searchKeys}
|
||||
onChange={this.onBrowerChangeHandler}
|
||||
clickCallback={this.onBrowerClick}
|
||||
/>
|
||||
</div>);
|
||||
};
|
||||
renderMult = () => {
|
||||
const { fieldConfig } = this.props;
|
||||
|
|
@ -45,12 +68,16 @@ class Index extends Component {
|
|||
</div>);
|
||||
};
|
||||
onBrowerChangeHandler = (values, datas) => {
|
||||
const { form, fieldConfig } = this.props;
|
||||
this.setState({ searchKeys: values, selectedData: datas }, () => {
|
||||
const { form, fieldConfig, isSingle } = this.props;
|
||||
const { browserConditionParam = {} } = fieldConfig || {};
|
||||
this.setState({
|
||||
searchKeys: (isSingle || browserConditionParam.isSingle) ? values.slice(-1) : values,
|
||||
selectedData: ((isSingle || browserConditionParam.isSingle) && !_.isEmpty(values)) ? { [_.last(values)]: datas[_.last(values)] } : datas
|
||||
}, () => {
|
||||
this.props.onChange && this.props.onChange(values.join(","));
|
||||
if (form) {
|
||||
form.updateFields({
|
||||
[getKey(fieldConfig)]: { value: values.join(",") }
|
||||
[getKey(fieldConfig)]: { value: this.state.searchKeys.join(",") }
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -63,7 +90,7 @@ class Index extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { browserDialog } = this.state;
|
||||
const { browserDialog, selectedData, searchKeys } = this.state;
|
||||
const { isSingle, viewAttr, fieldConfig = {} } = this.props;
|
||||
const { browserConditionParam = {} } = fieldConfig || {};
|
||||
const className = classNames({
|
||||
|
|
@ -76,8 +103,9 @@ class Index extends Component {
|
|||
return (<React.Fragment>
|
||||
<div className={`${className} ${this.props.className || ""}`} style={style}>{browser}</div>
|
||||
<CustomBrowserDialog
|
||||
{...browserDialog} {...browserConditionParam} {...this.props}
|
||||
onCancel={() => this.setState({ browserDialog: { visible: false } })}/>
|
||||
{...browserDialog} {...browserConditionParam} {...this.props} onChange={this.onBrowerChangeHandler}
|
||||
onCancel={() => this.setState({ browserDialog: { visible: false } })}
|
||||
datas={selectedData} selectedValues={searchKeys}/>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,13 +3,16 @@ import Route from "react-router/lib/Route";
|
|||
import CustomSalarySummary from "./lingyue/salarySummary";
|
||||
import CustomSocialFundSummary from "./lingyue/socialFundSummary";
|
||||
import VouncherSummary from "./lingyue/vouncherSummary";
|
||||
import HistoryVouncherSummary from "./lingyue/historyVouncherSummary";
|
||||
|
||||
const CustomRoutes = [
|
||||
<Route key="customPage_salarySummary_lingyue" path="customPage_salarySummary_lingyue"
|
||||
component={CustomSalarySummary}/>,
|
||||
<Route key="customPage_socailFundSummary_lingyue" path="customPage_socailFundSummary_lingyue"
|
||||
component={CustomSocialFundSummary}/>,
|
||||
<Route key="customPage_vouchers_lingyue" path="customPage_vouchers_lingyue" component={VouncherSummary}/>
|
||||
<Route key="customPage_vouchers_lingyue" path="customPage_vouchers_lingyue" component={VouncherSummary}/>,
|
||||
<Route key="customPage_historyVouchers_lingyue" path="customPage_historyVouchers_lingyue"
|
||||
component={HistoryVouncherSummary}/>
|
||||
];
|
||||
|
||||
export default CustomRoutes;
|
||||
|
|
|
|||
|
|
@ -26,8 +26,11 @@ class GenerateVouchersDialog extends Component {
|
|||
}
|
||||
|
||||
initLYForm = () => {
|
||||
const { type } = this.props;
|
||||
commonEnumList({ enumClass: "com.engine.salary.enums.ly.LyPZTypeEnum" })
|
||||
.then(({ status, data }) => {
|
||||
type === "salarySum" && (data = data.filter(item => !["SBJTPZ", "SBFFPZ", "GJJJTPZ", "GJJFFPZ"].includes(item.enum)));
|
||||
type === "socialFundSum" && (data = data.filter(item => !["XZJTPZ", "XZFFPZ"].includes(item.enum)));
|
||||
if (status) {
|
||||
this.setState({
|
||||
conditions: _.map(vouchersConditions, item => ({
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class List extends Component {
|
|||
this.state = {
|
||||
dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false,
|
||||
selectedRowKeys: [], sumDataSource: {}, payload: {}, visible: false,
|
||||
voucherDialog: { visible: false, ffgsqcLabel: props.ffgsqcLabel }
|
||||
voucherDialog: { visible: false, ffgsqcLabel: props.ffgsqcLabel, type: props.type }
|
||||
};
|
||||
this.handleDebounce = null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* 领悦汇总标
|
||||
* 历史凭证查看详情列表
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/9/4
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaSlideModal, WeaTable } from "ecCom";
|
||||
import * as API from "../../../../apis/custom-apis/lingyue";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class HistoryVouncherDetail extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dataSource: [], columns: [], loading: false
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getHistoryVoucherDetailList(nextProps.id);
|
||||
}
|
||||
|
||||
getHistoryVoucherDetailList = (id) => {
|
||||
this.setState({ loading: true });
|
||||
API.getHistoryVoucherDetailList({ id }).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) this.setState({
|
||||
dataSource: data.data,
|
||||
columns: _.map(data.columns, o => {
|
||||
if (["fzhsXmqsBrowser", "fzhsXmqsBrowser", "fzhsSllbBrowser", "fzhsKsBrowser"].includes(o.dataIndex)) {
|
||||
return {
|
||||
...o,
|
||||
render: text => (
|
||||
<span>{text && <a className="child-item wdb">{`${text.fzhslx}:${text.bh}/${text.mc}`}</a>}</span>)
|
||||
};
|
||||
} else if (o.dataIndex === "fzhsOtherBrowserList") {
|
||||
return {
|
||||
...o, render: text => {
|
||||
let arr = [];
|
||||
text && text.map(v => {
|
||||
arr.push(<a className="child-item wdb">{`${v.fzhslx}:${v.bh}/${v.mc}`}</a>);
|
||||
});
|
||||
return (<span>{arr}</span>);
|
||||
}
|
||||
};
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
});
|
||||
});
|
||||
};
|
||||
renderTitle = () => {
|
||||
return <div className="titleDialog">
|
||||
<div className="titleCol titleLeftBox">
|
||||
<div className="titleIcon"><i className="icon-coms-fa"/></div>
|
||||
<div className="title">{getLabel(111, "历史凭证明细")}</div>
|
||||
</div>
|
||||
<div className="titleCol titleRightBox"/>
|
||||
</div>;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { dataSource, columns, loading } = this.state;
|
||||
return (
|
||||
<WeaSlideModal
|
||||
className="history_vouncher_detail" {...this.props} top={0} width={100} height={100} measure="%"
|
||||
direction={"right"} title={this.renderTitle()}
|
||||
content={<WeaTable dataSource={dataSource} pagination={false} loading={loading} columns={columns}
|
||||
scroll={{ y: `calc(100vh - 116px)` }}/>}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default HistoryVouncherDetail;
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
/*
|
||||
* 领悦历史凭证汇总
|
||||
* 历史凭证列表
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/9/4
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDatePicker, WeaFormItem, WeaInputSearch, WeaLocaleProvider, WeaTable, WeaTop } from "ecCom";
|
||||
import HistoryVouncherDetail from "./historyVouncherDetail";
|
||||
import * as API from "../../../../apis/custom-apis/lingyue";
|
||||
import moment from "moment";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dataSource: [], columns: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
query: { salaryMonth: moment().format("YYYY-MM"), frzt: "" }, detail: { visible: false, id: "" }
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getHistoryVoucherList();
|
||||
}
|
||||
|
||||
getHistoryVoucherList = () => {
|
||||
const { pageInfo, query } = this.state;
|
||||
const payload = { ...pageInfo, ...query };
|
||||
this.setState({ loading: true });
|
||||
API.getHistoryVoucherList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
dataSource, pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
columns: [
|
||||
...columns, {
|
||||
dataIndex: "options", title: getLabel(111, "操作"), width: 150,
|
||||
render: (__, record) => (<a href="javascript:void(0);" onClick={() => this.setState({
|
||||
detail: { visible: true, id: record.id }
|
||||
})}>{getLabel(111, "查看详情")}</a>)
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { query, dataSource, columns, pageInfo, loading, detail } = this.state;
|
||||
const { salaryMonth, frzt } = query;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
}, () => this.getHistoryVoucherList());
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getHistoryVoucherList());
|
||||
}
|
||||
};
|
||||
return (
|
||||
<WeaTop
|
||||
title={getLabel(111, "历史凭证汇总表")} icon={<i className="icon-coms-fa"/>} showDropIcon={false}
|
||||
iconBgcolor="#F14A2D" className="custom_vouchers_lingyue"
|
||||
buttons={[
|
||||
<WeaFormItem label={getLabel(111, "薪资所属月")} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
|
||||
<WeaDatePicker format="YYYY-MM" value={salaryMonth}
|
||||
onChange={value => this.setState({
|
||||
query: { ...query, salaryMonth: value },
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.getHistoryVoucherList())}/>
|
||||
</WeaFormItem>,
|
||||
<WeaFormItem label={getLabel(111, "法人主体")} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
|
||||
<WeaInputSearch value={frzt} onChange={value => this.setState({ query: { ...query, frzt: value } })}
|
||||
onSearch={() => this.setState({
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.getHistoryVoucherList())}/>
|
||||
</WeaFormItem>
|
||||
]}>
|
||||
<div className="vouchers-body">
|
||||
<WeaTable rowKey="id" dataSource={dataSource} pagination={pagination} loading={loading} columns={columns}
|
||||
scroll={{ y: `calc(100vh - 183px)` }}/>
|
||||
<HistoryVouncherDetail {...detail} onClose={() => this.setState({ detail: { ...detail, visible: false } })}/>
|
||||
</div>
|
||||
</WeaTop>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -25,14 +25,65 @@
|
|||
|
||||
//凭证汇总表
|
||||
.custom_vouchers_lingyue {
|
||||
.wea-new-top {
|
||||
.wea-form-item {
|
||||
min-width: 250px;
|
||||
}
|
||||
}
|
||||
|
||||
.vouchers-body {
|
||||
height: 100%;
|
||||
padding: 16px 16px 0 16px;
|
||||
background: #F6F6F6;
|
||||
overflow-y: hidden;
|
||||
|
||||
.wea-table-edit {
|
||||
.wea-table-edit, .wea-new-table {
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
.history_vouncher_detail {
|
||||
.wea-slide-modal-content {
|
||||
height: 100%;
|
||||
padding: 16px;
|
||||
background: #F6F6F6;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.titleDialog {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 46px 0 16px;
|
||||
background: #FFF;
|
||||
|
||||
.titleCol {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.titleLeftBox {
|
||||
.titleIcon {
|
||||
color: #fff;
|
||||
margin: 0;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-size: 22px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #F14A2D;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
padding-left: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import React, { Component } from "react";
|
|||
import { WeaLocaleProvider } from "ecCom";
|
||||
import Layout from "../layout";
|
||||
import List from "../components/list";
|
||||
import * as API from "../../../../apis/custom-apis/lingyue";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
|
|
@ -18,19 +19,23 @@ class Index extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
query: { salaryMonth: moment().format("YYYY-MM"), ffgsqc: "" }, isQuery: false
|
||||
query: { salaryMonth: moment().format("YYYY-MM"), ffgsqc: "" }, isQuery: false, lyAuth: false
|
||||
};
|
||||
this.listRef = null;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
API.getLYPermission().then(({ status, data }) => this.setState({ lyAuth: !!status && !!data }));
|
||||
}
|
||||
|
||||
handleLayoutChange = ({ isQuery, ...val }) => this.setState({ query: { ...this.state.query, ...val } },
|
||||
() => this.setState({ isQuery }));
|
||||
|
||||
render() {
|
||||
const { query, isQuery } = this.state;
|
||||
const { query, isQuery, lyAuth } = this.state;
|
||||
return (
|
||||
<Layout title={getLabel(111, "社保公积金汇总表")} query={query} onChange={this.handleLayoutChange}
|
||||
listRef={this.listRef} isQuery={isQuery} ffgsqcLabel={getLabel(111, "购买公司全称")}>
|
||||
listRef={this.listRef} isQuery={isQuery} lyAuth={lyAuth} ffgsqcLabel={getLabel(111, "购买公司全称")}>
|
||||
<List query={query} isQuery={isQuery} type="socialFundSum" ref={dom => this.listRef = dom}
|
||||
onInit={() => this.forceUpdate()} ffgsqcLabel={getLabel(111, "购买公司全称")}/>
|
||||
</Layout>
|
||||
|
|
|
|||
|
|
@ -8,19 +8,20 @@
|
|||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaTableEdit, WeaTop } from "ecCom";
|
||||
import { WeaLoadingGlobal, WeaLocaleProvider, WeaTableEdit, WeaTop } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import * as API from "../../../../apis/custom-apis/lingyue";
|
||||
import { getQueryString, getURLParameters } from "../../../../util/url";
|
||||
import CustomBrowser from "../../../../components/CustomBrowser";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const pzlxEnum = ["0", "1", "2"];
|
||||
const pzlxEnum = ["0", "1", "2"];//非计提类型的凭证列表可编辑
|
||||
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
datas: [], columns: []
|
||||
datas: [], columns: [], loading: false
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -30,13 +31,13 @@ class Index extends Component {
|
|||
|
||||
genAndPreveiw = () => {
|
||||
const pzlx = getQueryString("pzlx");
|
||||
this.setState({ loading: true });
|
||||
const payload = {
|
||||
...getURLParameters(window.location.hash),
|
||||
ffgsqc: decodeURI(getURLParameters(window.location.hash).ffgsqc)
|
||||
};
|
||||
WeaLoadingGlobal.start();
|
||||
API.genAndPreveiw(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
WeaLoadingGlobal.destroy();
|
||||
if (status) {
|
||||
const { columns, data: datas } = data;
|
||||
this.setState({
|
||||
|
|
@ -45,11 +46,38 @@ class Index extends Component {
|
|||
com: [
|
||||
{
|
||||
key: col.column, otherParams: { precision: 2 },
|
||||
type: (col.column === "zy" || col.column === "kjkm") ? "INPUT" :
|
||||
type: (col.column === "zy" || col.column === "kjkm") ? "TEXTAREA" :
|
||||
(col.column === "jfValue" || col.column === "dfValue") ? "INPUTNUMBER" : "custom",
|
||||
viewAttr: !pzlxEnum.includes(pzlx) ? 2 : 1,
|
||||
render: (text, record, index, onEdit) => {
|
||||
return <CustomBrowser viewAttr={!pzlxEnum.includes(pzlx) ? 2 : 1}/>;
|
||||
const value = _.isArray(text) ? _.map(text, o => o.bh).join(",") : !_.isNil(text) ? text.bh : "";
|
||||
const replaceDatas = _.isArray(text) ? _.map(text, o => ({
|
||||
...o, id: o.bh, name: `${o.fzhslx}:${o.bh}/${o.mc}`
|
||||
})) : !_.isNil(text) ? [{ ...text, id: text.bh, name: `${text.fzhslx}:${text.bh}/${text.mc}` }] : [];
|
||||
return <CustomBrowser
|
||||
fieldConfig={{
|
||||
viewAttr: !pzlxEnum.includes(pzlx) ? 2 : 1,
|
||||
browserConditionParam: {
|
||||
isSingle: col.column !== "fzhsOther", replaceDatas,
|
||||
dialogType: "table", searchParamsKey: "key",
|
||||
tableProps: {
|
||||
rowKey: "bh", columns: [
|
||||
{ title: getLabel(111, "名称"), dataIndex: "mc" },
|
||||
{ title: getLabel(111, "辅助核算类型"), dataIndex: "fzhslx" },
|
||||
{ title: getLabel(111, "编号"), dataIndex: "bh" }
|
||||
]
|
||||
},
|
||||
convertDatasource: datas => _.map(datas, o => ({
|
||||
...o, id: o.bh, name: `${o.fzhslx}:${o.bh}/${o.mc}`
|
||||
})),
|
||||
completeURL: "/api/bs/hrmsalary/ly/PZ/fzhsBrowserList"
|
||||
}
|
||||
}}
|
||||
value={value}
|
||||
onChange={(value) => onEdit({
|
||||
record: { ...record, [col["column"]]: value }, index
|
||||
})}
|
||||
/>;
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -58,14 +86,42 @@ class Index extends Component {
|
|||
}
|
||||
});
|
||||
};
|
||||
pushNotifications = () => {
|
||||
const { datas } = this.state;
|
||||
const payload = {
|
||||
...getURLParameters(window.location.hash),
|
||||
ffgsqc: decodeURI(getURLParameters(window.location.hash).ffgsqc),
|
||||
dataSource: _.head(datas).dataSource,
|
||||
details: _.map(datas, o => ({
|
||||
zy: o.zy, kjkm: o.kjkm, jfValue: o.jfValue, dfValue: o.dfValue,
|
||||
fzhsXmqs: !o.fzhsXmqs ? "" : _.isString(o.fzhsXmqs) ? o.fzhsXmqs : o.fzhsXmqs.bh,
|
||||
fzhsFwlb: !o.fzhsFwlb ? "" : _.isString(o.fzhsFwlb) ? o.fzhsFwlb : o.fzhsFwlb.bh,
|
||||
fzhsSllb: !o.fzhsSllb ? "" : _.isString(o.fzhsSllb) ? o.fzhsSllb : o.fzhsSllb.bh,
|
||||
fzhsKs: !o.fzhsKs ? "" : _.isString(o.fzhsKs) ? o.fzhsKs : o.fzhsKs.bh,
|
||||
fzhsOtherBmList: !o.fzhsOther ? [] : _.isString(o.fzhsOther) ? o.fzhsOther.split(",") : _.map(o.fzhsOther, o => (o.bh))
|
||||
}))
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
API.pushUCAndSave(payload).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
window.close();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { datas, columns } = this.state;
|
||||
const { datas, columns, loading } = this.state;
|
||||
const pzlx = getQueryString("pzlx");
|
||||
return (
|
||||
<WeaTop
|
||||
title={getLabel(111, "凭证汇总表")} icon={<i className="icon-coms-fa"/>} buttons={[]} showDropIcon={false}
|
||||
iconBgcolor="#F14A2D" className="custom_vouchers_lingyue">
|
||||
title={getLabel(111, "凭证预览汇总表")} icon={<i className="icon-coms-fa"/>} showDropIcon={false}
|
||||
iconBgcolor="#F14A2D" className="custom_vouchers_lingyue"
|
||||
buttons={[<Button type="primary" loading={loading}
|
||||
onClick={this.pushNotifications}>{getLabel(111, "推送")}</Button>]}>
|
||||
<div className="vouchers-body">
|
||||
<WeaTableEdit
|
||||
ref={el => this.tableEdit = el} showCopy={false} deleteConfirm
|
||||
|
|
|
|||
Loading…
Reference in New Issue