Merge branch 'feature/v2-社保福利档案调差退差-1208' into develop

This commit is contained in:
黎永顺 2022-12-06 16:11:41 +08:00
commit 0bd6f6964a
2 changed files with 12 additions and 16 deletions

View File

@ -32,12 +32,11 @@ class AdjustTable extends Component {
};
}
componentDidMount() {
this.getCompensationList().then(r => {
});
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible) {
nextProps.visible && this.getCompensationList().then(r => {
});
}
}
getCompensationList = async () => {
@ -353,7 +352,7 @@ class AdjustTable extends Component {
const { adjustToOptions, categoryTypeOptions, key, target, ...extraParams } = record;
const month = getQueryString("billMonth");
const paymentOrg = getQueryString("paymentOrganization");
const bool = _.every(Object.keys(record), child => !!record[child]);
const bool = _.every(Object.keys({ ...extraParams, target }), child => !!{ ...extraParams, target }[child]);
if (!bool) {
Modal.warning({
title: "信息确认",
@ -370,8 +369,9 @@ class AdjustTable extends Component {
};
compensationSave([payload]).then(({ status, data, errormsg }) => {
if (status) {
const { data: dataMsg } = data;
message.success(dataMsg || "保存成功");
const { data: dataMsg, errorMessage = [] } = data;
const msg = dataMsg + errorMessage.join(",");
message.success(msg || "保存成功");
this.getCompensationList().then(r => {
});
} else {

View File

@ -28,11 +28,6 @@ class AdjustmentSlide extends Component {
this.adjustTableRef = null;
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible) {
}
}
handleSave = () => {
let { dataSource, targetOptions } = this.adjustTableRef.state;
dataSource = _.filter(dataSource, it => !it.id);
@ -69,8 +64,9 @@ class AdjustmentSlide extends Component {
compensationSave(payload).then(({ status, data, errormsg }) => {
this.setState({ loading: false });
if (status) {
const { data: dataMsg } = data;
message.success(dataMsg || "保存成功");
const { data: dataMsg, errorMessage = [] } = data;
const msg = dataMsg + errorMessage.join(",");
message.success(msg || "保存成功");
this.adjustTableRef.getCompensationList().then(r => {
});
} else {
@ -106,7 +102,7 @@ class AdjustmentSlide extends Component {
customOperate={this.renderCustomOperate()}
/>
}
content={<AdjustTable ref={dom => this.adjustTableRef = dom}/>}
content={<AdjustTable ref={dom => this.adjustTableRef = dom} visible={visible}/>}
onClose={onCancel}
/>
);