diff --git a/pc4mobx/hrmSalary/apis/datapush.js b/pc4mobx/hrmSalary/apis/datapush.js index e348875c..fb26cf9b 100644 --- a/pc4mobx/hrmSalary/apis/datapush.js +++ b/pc4mobx/hrmSalary/apis/datapush.js @@ -40,3 +40,7 @@ export const pushRecords = (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); +}; diff --git a/pc4mobx/hrmSalary/pages/datapush/components/pushRecord/createPushRecordDialog.js b/pc4mobx/hrmSalary/pages/datapush/components/pushRecord/createPushRecordDialog.js index b6de8562..50a46cbc 100644 --- a/pc4mobx/hrmSalary/pages/datapush/components/pushRecord/createPushRecordDialog.js +++ b/pc4mobx/hrmSalary/pages/datapush/components/pushRecord/createPushRecordDialog.js @@ -9,13 +9,14 @@ */ import React, { Component } from "react"; import { WeaDialog, WeaFormItem, WeaLocaleProvider, WeaTable, WeaTools } from "ecCom"; -import { WeaForm, WeaSwitch } from "comsMobx"; -import { Button } from "antd"; -import moment from "moment"; 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; @@ -73,7 +74,16 @@ class CreatePushRecordDialog extends Component { }).catch(() => this.setState({ loading: false })); }; save = (record) => { - console.log(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() { @@ -117,14 +127,18 @@ class CreatePushRecordDialog extends Component { return [{ com: coms, col: 2 }]; } }; - console.log(this.refs.recordRef); - return ({getLabel(111, "取消")} ]}> - ); diff --git a/pc4mobx/hrmSalary/pages/datapush/index.js b/pc4mobx/hrmSalary/pages/datapush/index.js index 49d1d69d..e3da4cb4 100644 --- a/pc4mobx/hrmSalary/pages/datapush/index.js +++ b/pc4mobx/hrmSalary/pages/datapush/index.js @@ -165,7 +165,8 @@ class Index extends Component { this.setState({ pushDetailDialog: { ...pushDetailDialog, visible: false } })}/> - this.setState({ visible: false })}/> + this.setState({ visible: false }, () => callback && callback())}/> ); }