feature/2.19.1.2501.01-套打功能

This commit is contained in:
lys 2025-02-07 14:43:47 +08:00
parent 811083310b
commit 17d29a543b
3 changed files with 39 additions and 2 deletions

View File

@ -232,6 +232,25 @@ export const tempCondition = [
rules: "required|string",
viewAttr: 3
},
{
conditionType: "UPLOAD",
domkey: ["fileId"],
fieldcol: 14,
label: "导出模板",
lanId: 111,
labelcol: 6,
value: "",
datas: [],
multiSelection: false,
showClearAll: false,
showListBottom: true,
showListTop: true,
maxFilesNumber: 1,
limitType: "xlsx",
uploadUrl: "/api/doc/upload/uploadFile",
category: "111",
viewAttr: 2
},
{
conditionType: "SELECT",
domkey: ["sharedType"],

View File

@ -200,6 +200,10 @@ class SalaryDetails extends Component {
};
handelAddTemp = (templateId = "") => {
const { tempDialog, tempPageList } = this.state;
if (_.isEmpty(this.transferRef.state.rightDatas)) {
message.warning(getLabel(111, "请选择设置!"));
return;
}
this.setState({
tempDialog: {
...tempDialog, visible: true, setting: _.map(this.transferRef.state.rightDatas, o => o.id)

View File

@ -57,6 +57,13 @@ class SalaryDetailTempDialog extends Component {
value: id ? template["limitIds"].join(",") : "",
options: _.map(data, o => ({ key: o.id, showname: o.content }))
};
} else if (getKey(o) === "fileId") {
return {
...o, label: getLabel(o.lanId, o.label), value: id ? template[getKey(o)] : "",
datas: id && template[getKey(o)] ? [
{ fileid: template[getKey(o)], filename: template["fileName"], showDelete: true }
] : []
};
}
return { ...o, label: getLabel(o.lanId, o.label), value: id ? template[getKey(o)] : "" };
})
@ -73,12 +80,13 @@ class SalaryDetailTempDialog extends Component {
tempForm.validateForm().then(f => {
if (f.isValid) {
this.setState({ loading: true });
const { limitIds, ...formVal } = tempForm.getFormParams();
const { limitIds, fileId, ...formVal } = tempForm.getFormParams();
const payload = {
page: "salary_details_report", setting, id, ...formVal,
limitIds: !_.isEmpty(limitIds) ? limitIds.split(",") : []
};
API.savePageListTemplate(payload).then(({ status, errormsg }) => {
API.savePageListTemplate(_.assign(payload, fileId ? { fileId } : {})).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(111, "操作成功!"));
this.props.onCancel(this.props.onSuccess());
@ -101,6 +109,12 @@ class SalaryDetailTempDialog extends Component {
...o, hide: value !== "0", viewAttr: value === "0" ? 3 : 1,
rules: value === "0" ? "required|string" : ""
};
} else if (getKey(o) === "fileId") {
return {
...o, value, datas: value ? _.map(field[key].valueSpan, o => ({
fileid: o.fileid, filename: o.filename, showDelete: true
})) : []
};
}
return { ...o };
})