custom/路维光电(业务线)

This commit is contained in:
lys 2025-10-09 14:16:22 +08:00
parent 949456387e
commit b78cee94b0
3 changed files with 44 additions and 13 deletions

View File

@ -211,11 +211,12 @@ class Index extends Component {
}
<SalaryArchiveEditAdjLogRecord
{...adjLogRecordDialog}
onCancel={() => this.setState({
onSuccess={() => this.props.onClose(false)}
onCancel={(callback) => this.setState({
adjLogRecordDialog: {
...adjLogRecordDialog, visible: false, title: "", salaryArchiveId: ""
}
})}
}, () => callback && callback())}
/>
</div>}
/>

View File

@ -75,6 +75,17 @@ export const adjCondition = [
labelcol: 6,
value: "",
viewAttr: 2
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["sumVal"],
fieldcol: 18,
label: "工资总额",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 1
}
],
title: "调薪信息",

View File

@ -16,7 +16,8 @@ import {
} from "../../apis/archive";
import { inject, observer } from "mobx-react";
import { adjCondition } from "./columns";
import { getDomkes, getSearchs, toDecimal_n } from "../../util";
import { getDomkes, toDecimal_n } from "../../util";
import FormInfo from "../../components/FormInfo";
import moment from "moment";
const { getLabel } = WeaLocaleProvider;
@ -52,17 +53,20 @@ class SalaryArchiveEditAdjLogRecordDialog extends Component {
getSingleSalaryItemInfo = (props) => {
const { salaryFileStore: { adjForm }, id, salaryArchiveId: salaryArchiveItemId } = props;
this.setState({ loading: true });
APIFox[id ? "editForm" : "saveForm"](id ? { id } : { salaryArchiveItemId })
APIFox[id ? "editForm" : "saveForm"](id ? { id } : { salaryArchiveItemId, salaryArchiveId: salaryArchiveItemId })
.then(({ status, data }) => {
this.setState({ loading: false });
if (status) {
const { salaryArchiveItemForm, salaryArchiveItemDetail, canOperator } = data;
const { salaryArchiveItemForm, salaryArchiveItemDetail, currentEffectiveList, sumVal, canOperator } = data;
const { adjustReasonList } = salaryArchiveItemForm;
const datas = id ? salaryArchiveItemDetail.list : _.map(currentEffectiveList, o => ({
salaryItem: String(o.id), salaryBefore: o.value, adjustAfter: o.value
}));
this.setState({
canOperator,
salaryArchiveItemDetail: {
...salaryArchiveItemDetail,
list: _.map(salaryArchiveItemDetail.list, o => ({
list: _.map(datas, o => ({
...o, dataType: _.find(salaryArchiveItemDetail.salaryItemList, g => g.id === o.salaryItem).dataType,
pattern: _.find(salaryArchiveItemDetail.salaryItemList, g => g.id === o.salaryItem).pattern
}))
@ -78,16 +82,22 @@ class SalaryArchiveEditAdjLogRecordDialog extends Component {
options: _.map(adjustReasonList, it => ({ key: it.id, showname: it.content }))
};
}
return { ...o };
return { ...o, hide: id && getKey(o) === "sumVal" };
})
};
})
}, () => {
adjForm.initFormFields(this.state.conditions);
_.map(getDomkes(this.state.conditions), domkey => {
adjForm.updateFields({
[domkey]: salaryArchiveItemForm[domkey] || ""
});
if (domkey !== "sumVal") {
adjForm.updateFields({
[domkey]: salaryArchiveItemForm[domkey] || ""
});
} else {
adjForm.updateFields({
sumVal: sumVal || ""
});
}
});
});
}
@ -121,7 +131,7 @@ class SalaryArchiveEditAdjLogRecordDialog extends Component {
});
};
handleChangeAdjustAfter = (record, v) => {
const { salaryArchiveItemDetail } = this.state;
const { salaryArchiveItemDetail } = this.state, { salaryFileStore: { adjForm } } = this.props;
const { list } = salaryArchiveItemDetail;
this.setState({
salaryArchiveItemDetail: {
@ -135,6 +145,13 @@ class SalaryArchiveEditAdjLogRecordDialog extends Component {
return { ...o };
})
}
}, () => {
const { salaryArchiveItemDetail } = this.state;
adjForm.updateFields({
sumVal: _.reduce(salaryArchiveItemDetail.list, (pre, cur) => {
return pre + parseFloat(cur.adjustAfter || 0);
}, 0).toString()
});
});
};
save = () => {
@ -162,7 +179,7 @@ class SalaryArchiveEditAdjLogRecordDialog extends Component {
this.setState({ saveLoading: false });
if (status) {
message.success(getLabel(22619, "保存成功!"));
this.props.onCancel();
this.props.onCancel(this.props.onSuccess);
fetchSingleSalaryItemList({ salaryArchiveId });
getArchiveForm(salaryArchiveId);
} else {
@ -209,6 +226,7 @@ class SalaryArchiveEditAdjLogRecordDialog extends Component {
width: "30%"
}
];
const itemRender = {};
return (
<WeaDialog
{...this.props}
@ -228,7 +246,8 @@ class SalaryArchiveEditAdjLogRecordDialog extends Component {
<div className="adjLogRecordDialogContent">
{
!loading ? <React.Fragment>
{getSearchs(adjForm, conditions, 1)}
{/*{getSearchs(adjForm, conditions, 1)}*/}
<FormInfo center={false} itemRender={itemRender} form={adjForm} formFields={conditions}/>
<WeaSearchGroup title={getLabel(543333, "调薪明细")} showGroup needTigger={false}>
<WeaTableEdit
ref={dom => this.tableEdit = dom} deleteConfirm