Merge branch 'release/3.0.1.2504.01-合并业务线' into custom-联特
This commit is contained in:
commit
be57db69da
|
|
@ -32,3 +32,15 @@ export const getPushRecordList = (params) => {
|
|||
export const getPushRecordDetail = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/push/record/detail", params);
|
||||
};
|
||||
// 推送记录-推送
|
||||
export const pushRecords = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/push/record/push", params);
|
||||
};
|
||||
// 推送记录-撤回
|
||||
export const withdrawRecords = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/push/record/withdraw", params);
|
||||
};
|
||||
//创建推送记录
|
||||
export const createPushRecords = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/push/record/create", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaTop } from "ecCom";
|
||||
import { WeaLocaleProvider, WeaTools, WeaTop } from "ecCom";
|
||||
import { WeaForm } from "comsMobx";
|
||||
import { Button, message, Modal } from "antd";
|
||||
import moment from "moment";
|
||||
import CalculateQuery from "./components/calculateQuery";
|
||||
|
|
@ -15,9 +16,15 @@ import CalculateDialog from "./components/calculateDialog";
|
|||
import ProgressModal from "../../components/progressModal";
|
||||
import LogDialog from "../../components/logViewModal";
|
||||
import { backCalculate, deleteSalaryacct, fileSalaryAcct, reAccounting } from "../../apis/calculate";
|
||||
import FormInfo from "../../components/FormInfo";
|
||||
import { queryConditions } from "./config";
|
||||
import { postFetch } from "../../util/request";
|
||||
import cs from "classnames";
|
||||
import "./index.less";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const form = new WeaForm();
|
||||
|
||||
@inject("calculateStore", "taxAgentStore")
|
||||
@observer
|
||||
|
|
@ -31,17 +38,32 @@ class Calculate extends Component {
|
|||
moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
|
||||
moment(new Date()).endOf("year").format("YYYY-MM")
|
||||
]
|
||||
}, isRefresh: false, logDialogVisible: false,
|
||||
}, isRefresh: false, logDialogVisible: false, conditions: [],
|
||||
progressModule: { visible: false, progress: 0, title: getLabel(111, "正在归档中请稍后") },
|
||||
calcDaialog: { visible: false, title: "" }
|
||||
calcDaialog: { visible: false, title: "" }, showAdvance: false
|
||||
};
|
||||
this.timer = null;
|
||||
this.handleDebounce = null;
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" });
|
||||
this.setState({
|
||||
conditions: _.map(queryConditions, item => ({
|
||||
...item, items: _.map(item.items, o => {
|
||||
o = { ...o, label: getLabel(o.lanId, o.label) };
|
||||
if (getKey(o) === "taxAgentIds") {
|
||||
return { ...o, options: _.map(data, k => ({ key: k.id + "", showname: k.name })) };
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
}))
|
||||
}, () => form.initFormFields(this.state.conditions));
|
||||
}
|
||||
|
||||
renderCalculateOpts = () => {
|
||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const { queryParams, isRefresh } = this.state;
|
||||
const { queryParams, isRefresh, showAdvance } = this.state;
|
||||
const admin = PageAndOptAuth.opts.includes("admin");
|
||||
let calculateOpts = [
|
||||
<Button type="primary" onClick={() => this.setState({
|
||||
|
|
@ -50,10 +72,11 @@ class Calculate extends Component {
|
|||
title: getLabel(538780, "核算")
|
||||
}
|
||||
})}>{getLabel(538780, "核算")}</Button>,
|
||||
<CalculateQuery queryParams={queryParams} onChange={v => this.setState({
|
||||
isRefresh: _.keys(v)[0] === "name" ? isRefresh : !isRefresh,
|
||||
queryParams: { ...queryParams, ...v }
|
||||
})} onSearch={() => this.setState({ isRefresh: !isRefresh })}/>
|
||||
<CalculateQuery queryParams={queryParams} onAdvance={() => this.setState({ showAdvance: !showAdvance })}
|
||||
onChange={v => this.setState({
|
||||
isRefresh: _.keys(v)[0] === "name" ? isRefresh : !isRefresh,
|
||||
queryParams: { ...queryParams, ...v }
|
||||
})} onSearch={() => this.setState({ isRefresh: !isRefresh })}/>
|
||||
];
|
||||
return !admin ? calculateOpts.slice(1) : calculateOpts;
|
||||
};
|
||||
|
|
@ -189,7 +212,9 @@ class Calculate extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions } = this.state;
|
||||
const {
|
||||
queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions, conditions, showAdvance
|
||||
} = this.state;
|
||||
return (
|
||||
<WeaTop title={getLabel(538011, "薪资核算")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
buttons={this.renderCalculateOpts()} className="calculate-main-layout" showDropIcon
|
||||
|
|
@ -201,7 +226,18 @@ class Calculate extends Component {
|
|||
}
|
||||
]}>
|
||||
<div className="calculate-body">
|
||||
<CalculateTablelist queryParams={queryParams} isRefresh={isRefresh} onCalcOpts={this.handleCalcOpts}/>
|
||||
<div className={cs("advance-calc", { "show-advance-calc": showAdvance })}>
|
||||
<FormInfo center={false} itemRender={{}} form={form} formFields={conditions} colCount={2}/>
|
||||
<div className="advance-calc-btns">
|
||||
<Button type="primary"
|
||||
onClick={() => this.setState({ isRefresh: !isRefresh })}>{getLabel(111, "搜索")}</Button>
|
||||
<Button type="ghost" onClick={() => form.resetForm()}>{getLabel(111, "重置")}</Button>
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({ showAdvance: !showAdvance })}>{getLabel(111, "取消")}</Button>
|
||||
</div>
|
||||
</div>
|
||||
<CalculateTablelist form={form} queryParams={queryParams} isRefresh={isRefresh}
|
||||
onCalcOpts={this.handleCalcOpts}/>
|
||||
<CalculateDialog {...calcDaialog}
|
||||
onCancel={(bool, id) => this.setState({
|
||||
calcDaialog: { ...calcDaialog, visible: false },
|
||||
|
|
|
|||
|
|
@ -21,11 +21,14 @@ class Index extends Component {
|
|||
<MonthRangePicker dateRange={dateRange} viewAttr={2}
|
||||
onChange={v => this.props.onChange({ dateRange: v })}/>
|
||||
</div>
|
||||
<WeaInputSearch value={name}
|
||||
placeholder={getLabel(543431, "请输入薪资账套名称")}
|
||||
onChange={v => this.props.onChange({ name: v })}
|
||||
onSearch={this.props.onSearch}
|
||||
/>
|
||||
<div className="advance-custom">
|
||||
<WeaInputSearch value={name}
|
||||
placeholder={getLabel(543431, "请输入薪资账套名称")}
|
||||
onChange={v => this.props.onChange({ name: v })}
|
||||
onSearch={this.props.onSearch}
|
||||
/>
|
||||
<a href="javascript:void(0);" onClick={this.props.onAdvance}>{getLabel(111, "高级搜索")}</a>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,12 +29,14 @@ class Index extends Component {
|
|||
}
|
||||
|
||||
getSalaryAcctList = (props) => {
|
||||
const { pageInfo } = this.state;
|
||||
const { queryParams } = props;
|
||||
const { pageInfo } = this.state, { queryParams, form } = props;
|
||||
const { taxAgentIds } = form.getFormParams();
|
||||
const { dateRange, ...extra } = queryParams;
|
||||
const [startMonthStr, endMonthStr] = dateRange || [];
|
||||
const params = { startMonthStr, endMonthStr, ...extra };
|
||||
const payload = { ...pageInfo, ...params };
|
||||
const payload = {
|
||||
...pageInfo, ...params, taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : []
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
getSalaryAcctList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
export const queryConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "SELECT",
|
||||
domkey: ["taxAgentIds"],
|
||||
fieldcol: 14,
|
||||
label: "个税扣缴义务人",
|
||||
lanI: 111,
|
||||
multiple: true,
|
||||
options: [],
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
|
|
@ -62,6 +62,24 @@
|
|||
}
|
||||
}
|
||||
|
||||
.advance-custom {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
& > a {
|
||||
border-radius: 0;
|
||||
height: 28px;
|
||||
position: relative;
|
||||
color: #474747;
|
||||
padding: 4px 15px;
|
||||
background-color: transparent;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border: 1px solid #d9d9d9;
|
||||
border-left: none
|
||||
}
|
||||
}
|
||||
|
||||
.wea-input-focus {
|
||||
margin-top: -4px;
|
||||
}
|
||||
|
|
@ -72,6 +90,32 @@
|
|||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.advance-calc {
|
||||
display: none;
|
||||
background: #FFF;
|
||||
margin-bottom: 8px;
|
||||
|
||||
.advance-calc-btns {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 15px 0;
|
||||
border-top: 1px solid #dadada;
|
||||
|
||||
button {
|
||||
margin-right: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-search-group, .wea-content {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.show-advance-calc {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.calculate-body {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,149 @@
|
|||
/*
|
||||
* 数据推送记录
|
||||
* 创建
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2025/4/15
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDialog, WeaFormItem, WeaLocaleProvider, WeaTable, WeaTools } from "ecCom";
|
||||
import FormInfo from "../../../../components/FormInfo";
|
||||
import { RQconditions } from "../../conditions";
|
||||
import { MonthRangePicker } from "../../../reportView/components/statisticalMicroSettingsSlide";
|
||||
import { getSalaryAcctList } from "../../../../apis/calculate";
|
||||
import { createPushRecords } from "../../../../apis/datapush";
|
||||
import { WeaForm, WeaSwitch } from "comsMobx";
|
||||
import { Button, message } from "antd";
|
||||
import moment from "moment";
|
||||
|
||||
const form = new WeaForm();
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class CreatePushRecordDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dataSource: [], columns: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
conditions: []
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
this.setState({
|
||||
conditions: _.map(RQconditions, item => ({
|
||||
...item,
|
||||
items: _.map(item.items, o => {
|
||||
o = { ...o, label: getLabel(o.lanId, o.label) };
|
||||
if (getKey(o) === "startMonthStr") {
|
||||
return {
|
||||
...o, value: moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM")
|
||||
};
|
||||
} else if (getKey(o) === "endMonthStr") {
|
||||
return {
|
||||
...o, value: moment(new Date()).endOf("year").format("YYYY-MM")
|
||||
};
|
||||
}
|
||||
return o;
|
||||
})
|
||||
}))
|
||||
}, () => {
|
||||
form.initFormFields(this.state.conditions);
|
||||
this.getSalaryAcctList();
|
||||
});
|
||||
} else {
|
||||
form.resetForm();
|
||||
}
|
||||
}
|
||||
|
||||
getSalaryAcctList = () => {
|
||||
const { pageInfo } = this.state, payload = { ...pageInfo, ...form.getFormParams() };
|
||||
this.setState({ loading: true });
|
||||
getSalaryAcctList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
dataSource, pageInfo: { current, pageSize, total },
|
||||
columns: _.filter(columns, it => (it.dataIndex !== "backCalcStatus" && it.dataIndex !== "acctTimes" && it.dataIndex !== "operate"))
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
save = (record) => {
|
||||
this.setState({ loading: true });
|
||||
createPushRecords({ salaryAcctRecordIds: [record.id] }).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.props.onCancel(this.props.onSuccess);
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading, conditions, dataSource, columns, pageInfo } = this.state;
|
||||
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.getSalaryAcctList());
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getSalaryAcctList());
|
||||
}
|
||||
};
|
||||
const itemRender = {
|
||||
name: (field, textAreaProps, form, formParams) => {
|
||||
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}
|
||||
onChange={_.debounce(() => this.getSalaryAcctList(), 500)}/>);
|
||||
},
|
||||
startMonthStr: () => null,
|
||||
endMonthStr: () => null
|
||||
};
|
||||
const childrenComponents = {
|
||||
startMonthStr: () => {
|
||||
const { startMonthStr, endMonthStr } = form.getFormParams();
|
||||
const coms = [], { fieldMap } = form;
|
||||
const dateRange = [startMonthStr, endMonthStr];
|
||||
coms.push(
|
||||
<WeaFormItem label={<span>{fieldMap["startMonthStr"].label}</span>} labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 14 }}>
|
||||
<MonthRangePicker dateRange={dateRange} viewAttr={2} onChange={v => {
|
||||
const [v1, v2] = v;
|
||||
form.updateFields({ startMonthStr: v1, endMonthStr: v2 });
|
||||
this.getSalaryAcctList();
|
||||
}}/>
|
||||
</WeaFormItem>
|
||||
);
|
||||
return [{ com: coms, col: 2 }];
|
||||
}
|
||||
};
|
||||
const scrollHeight = this.refs.recordRef ? this.refs.recordRef.state.height - 162 : 606;
|
||||
|
||||
return (<WeaDialog {...this.props} initLoadCss className="record-dialog" title={getLabel(111, "创建推送记录")}
|
||||
ref="recordRef"
|
||||
style={{
|
||||
width: 1000, height: 580, minHeight: 200, minWidth: 380, maxHeight: "70%", maxWidth: "90%",
|
||||
overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}} buttons={[
|
||||
<Button onClick={() => this.props.onCancel()}>{getLabel(111, "取消")}</Button>
|
||||
]}>
|
||||
<FormInfo className="record-form" center={false} itemRender={itemRender} colCount={2}
|
||||
form={form} formFields={conditions} childrenComponents={childrenComponents}/>
|
||||
<WeaTable className="wea-browser-table-cursor" rowKey="id" scroll={{ y: scrollHeight + "px" }}
|
||||
dataSource={dataSource} loading={loading} pagination={pagination} columns={columns}
|
||||
onRowClick={this.save}/>
|
||||
</WeaDialog>);
|
||||
}
|
||||
}
|
||||
|
||||
export default CreatePushRecordDialog;
|
||||
|
|
@ -27,7 +27,7 @@ class Index extends Component {
|
|||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.setState({ selectedRowKeys: [] });
|
||||
this.setState({ selectedRowKeys: [] }, () => this.props.onChange("rowKey", []));
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
|
|
@ -47,9 +47,11 @@ class Index extends Component {
|
|||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource,
|
||||
columns: [...columns, {
|
||||
title: getLabel(111, "操作"), dataIndex: "opts", width: 120, render: (__, record) => (<React.Fragment>
|
||||
title: getLabel(111, "操作"), dataIndex: "opts", width: 140, render: (__, record) => (<React.Fragment>
|
||||
<a href="javascript: void(0);" style={{ marginRight: 10 }}
|
||||
onClick={() => this.props.onChange("push", record)}>{getLabel(111, "推送")}</a>
|
||||
onClick={_.debounce(() => this.props.onChange("push", record), 300)}>{getLabel(111, "推送")}</a>
|
||||
<a href="javascript: void(0);" style={{ marginRight: 10 }}
|
||||
onClick={_.debounce(() => this.props.onChange("withdraw", record), 300)}>{getLabel(111, "撤回")}</a>
|
||||
<a href="javascript: void(0);"
|
||||
onClick={() => this.props.onChange("view", record)}>{getLabel(111, "查看详情")}</a>
|
||||
</React.Fragment>)
|
||||
|
|
@ -76,9 +78,9 @@ class Index extends Component {
|
|||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: v => this.setState({ selectedRowKeys: v })
|
||||
onChange: v => this.setState({ selectedRowKeys: v }, () => this.props.onChange("rowKey", v))
|
||||
};
|
||||
return (<WeaTable loading={loading} dataSource={dataSource} columns={columns} pagination={pagination}
|
||||
return (<WeaTable rowKey="id" loading={loading} dataSource={dataSource} columns={columns} pagination={pagination}
|
||||
rowSelection={rowSelection} scroll={{ y: `calc(100vh - 182px)` }}/>);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,3 +145,43 @@ export const PDConditions = [
|
|||
defaultshow: true
|
||||
}
|
||||
];// 推送详细配置表单
|
||||
|
||||
|
||||
export const RQconditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "MONTHPICKER",
|
||||
domkey: ["startMonthStr"],
|
||||
fieldcol: 14,
|
||||
label: "薪资所属月",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "MONTHPICKER",
|
||||
domkey: ["endMonthStr"],
|
||||
fieldcol: 14,
|
||||
label: "薪资所属月",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["name"],
|
||||
fieldcol: 14,
|
||||
label: "薪资账套",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
title: "",
|
||||
defaultshow: true
|
||||
}
|
||||
];// 推送记录查询表单
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import PushDetailDialog from "./components/pushRecord/pushDetailDialog";
|
|||
import { Button, message, Modal } from "antd";
|
||||
import cs from "classnames";
|
||||
import "./index.less";
|
||||
import CreatePushRecordDialog from "./components/pushRecord/createPushRecordDialog";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
|
|
@ -27,7 +28,8 @@ class Index extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedKey: "datapush", isQuery: false, query: { name: "" },
|
||||
selectedKey: "pushRecord", isQuery: false, query: { name: "" }, selectedRowKeys: [],
|
||||
loading: { push: false, withdraw: false }, visible: false,
|
||||
DPDialog: { visible: false, title: "", detail: {} }, //数据推送弹框
|
||||
pushDetailDialog: { visible: false, recordId: "" } //数据推送记录查看推送详情弹框
|
||||
};
|
||||
|
|
@ -60,16 +62,77 @@ class Index extends Component {
|
|||
case "view":
|
||||
this.setState({ pushDetailDialog: { visible: true, recordId: detail.id } });
|
||||
break;
|
||||
case "rowKey":
|
||||
this.setState({ selectedRowKeys: detail });
|
||||
break;
|
||||
case "addRecord":
|
||||
this.setState({ visible: true });
|
||||
break;
|
||||
case "push":
|
||||
case "batchpush":
|
||||
if (type === "batchpush" && _.isEmpty(this.state.selectedRowKeys)) {
|
||||
message.warning(getLabel(111, "请选择数据"));
|
||||
return;
|
||||
}
|
||||
this.pushRecords(type === "push" ? [detail.id] : this.state.selectedRowKeys);
|
||||
break;
|
||||
case "withdraw":
|
||||
case "batchwithdraw":
|
||||
if (type === "batchwithdraw" && _.isEmpty(this.state.selectedRowKeys)) {
|
||||
message.warning(getLabel(111, "请选择数据"));
|
||||
return;
|
||||
}
|
||||
this.withdrawRecords(type === "withdraw" ? [detail.id] : this.state.selectedRowKeys);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
pushRecords = (ids) => {
|
||||
this.setState({ loading: { ...this.state.loading, push: true } });
|
||||
API.pushRecords({ ids }).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: { ...this.state.loading, push: false } });
|
||||
if (status) {
|
||||
this.handleAdvanceSearch();
|
||||
message.success(getLabel(111, "推送成功!"));
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
withdrawRecords = (ids) => {
|
||||
this.setState({ loading: { ...this.state.loading, withdraw: true } });
|
||||
API.withdrawRecords({ ids }).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: { ...this.state.loading, withdraw: false } });
|
||||
if (status) {
|
||||
this.handleAdvanceSearch();
|
||||
message.success(getLabel(111, "撤回成功!"));
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { selectedKey, DPDialog, isQuery, query, pushDetailDialog } = this.state;
|
||||
const { selectedKey, DPDialog, isQuery, query, pushDetailDialog, loading, visible } = this.state;
|
||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
|
||||
const tabs = [
|
||||
{
|
||||
title: getLabel(111, "推送记录"), key: "pushRecord", showDropIcon: false, dropMenuDatas: [],
|
||||
buttons: showOperateBtn ? [
|
||||
<Button type="primary" onClick={() => this.handleOperate("addRecord")}
|
||||
loading={loading.add}>{getLabel(111, "创建")}</Button>,
|
||||
<Button type="primary" onClick={() => this.handleOperate("batchpush")}
|
||||
loading={loading.push}>{getLabel(111, "批量推送")}</Button>,
|
||||
<Button type="ghost" loading={loading.withdraw}
|
||||
onClick={() => this.handleOperate("batchwithdraw")}>{getLabel(111, "批量撤回")}</Button>,
|
||||
<WeaInputSearch style={{ top: -3 }} value={query.name} onSearch={this.handleAdvanceSearch}
|
||||
onChange={v => this.setState({ query: { ...query, name: v } })}/>
|
||||
] : [<WeaInputSearch style={{ top: -3 }} value={query.name} onSearch={this.handleAdvanceSearch}
|
||||
onChange={v => this.setState({ query: { ...query, name: v } })}/>],
|
||||
children: <PushRecord isQuery={isQuery} query={query} onChange={this.handleOperate}/>
|
||||
},
|
||||
{
|
||||
title: getLabel(111, "数据推送"), key: "datapush", showDropIcon: false, dropMenuDatas: [],
|
||||
buttons: showOperateBtn ? [
|
||||
|
|
@ -79,16 +142,6 @@ class Index extends Component {
|
|||
] : [<WeaInputSearch style={{ top: -3 }} value={query.name} onSearch={this.handleAdvanceSearch}
|
||||
onChange={v => this.setState({ query: { ...query, name: v } })}/>],
|
||||
children: <DatapushList isQuery={isQuery} query={query} onChange={this.handleOperate}/>
|
||||
},
|
||||
{
|
||||
title: getLabel(111, "推送记录"), key: "pushRecord", showDropIcon: false, dropMenuDatas: [],
|
||||
buttons: showOperateBtn ? [
|
||||
<Button type="primary" onClick={() => this.handleOperate("batchpush")}>{getLabel(111, "批量推送")}</Button>,
|
||||
<WeaInputSearch style={{ top: -3 }} value={query.name} onSearch={this.handleAdvanceSearch}
|
||||
onChange={v => this.setState({ query: { ...query, name: v } })}/>
|
||||
] : [<WeaInputSearch style={{ top: -3 }} value={query.name} onSearch={this.handleAdvanceSearch}
|
||||
onChange={v => this.setState({ query: { ...query, name: v } })}/>],
|
||||
children: <PushRecord isQuery={isQuery} query={query} onChange={this.handleOperate}/>
|
||||
}
|
||||
];
|
||||
return (
|
||||
|
|
@ -112,6 +165,8 @@ class Index extends Component {
|
|||
<PushDetailDialog {...pushDetailDialog} onClose={() => this.setState({
|
||||
pushDetailDialog: { ...pushDetailDialog, visible: false }
|
||||
})}/>
|
||||
<CreatePushRecordDialog visible={visible} onSuccess={this.handleAdvanceSearch}
|
||||
onCancel={(callback) => this.setState({ visible: false }, () => callback && callback())}/>
|
||||
</WeaReqTop>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,3 +167,28 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.record-dialog {
|
||||
.wea-dialog-body {
|
||||
background: #f6f6f6;
|
||||
padding: 8px 16px;
|
||||
|
||||
.record-form {
|
||||
background: #FFF;
|
||||
margin-bottom: 8px;
|
||||
|
||||
.wea-search-group, .wea-content {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.rangePickerBox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,6 +198,10 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wea-new-table.wea-new-table-draggable table {
|
||||
table-layout: fixed
|
||||
}
|
||||
}
|
||||
|
||||
.titleWrapper {
|
||||
|
|
|
|||
|
|
@ -173,8 +173,8 @@
|
|||
|
||||
.ph-switch {
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
.active, .phs-btn:hover {
|
||||
background-color: rgba(0, 0, 0, .15);
|
||||
|
|
@ -184,8 +184,9 @@
|
|||
.phs-btn {
|
||||
height: 50px;
|
||||
min-width: 88px;
|
||||
line-height: 50px;
|
||||
display: inline-block;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #fff;
|
||||
padding: 0 15px;
|
||||
cursor: pointer;
|
||||
|
|
|
|||
Loading…
Reference in New Issue