检查任务制定 取消 修改为弹窗输入原因后取消

按钮  自定义  添加 子弹窗关闭后可直接关闭当前弹窗的方法
添加 统一的 取消弹窗(不好看因为保持和一般弹窗一致  那么小的功能也是一个全屏弹窗)
This commit is contained in:
wyw 2024-08-06 15:24:06 +08:00
parent 1ff98a57e8
commit ee38efab39
3 changed files with 69 additions and 15 deletions

View File

@ -1562,7 +1562,7 @@ class EditComponent extends EditBaseComponent {
}
this.useCodeRules = null;
if (typeof onSave === 'function') {
onSave(this.state.data, this.clearData,this.setStateData);
onSave(this.state.data, this.clearData, this.setStateData);
}
if (closeType === 1 && this.billStatus === 1 ||//仅编辑时关闭
closeType === 2 && this.billStatus !== 1 ||//仅新增时关闭
@ -1772,6 +1772,7 @@ class EditComponent extends EditBaseComponent {
onCancel: onCancel,
saveHeadRecord: (values, onComplete) => { return this.saveHeadRecord(values, onComplete); },
saveRowRecord: (params) => { this.saveRowRecord(params); },
closeForm: () => { this.props.data.onCancel() },
});
if (btnParam) {
btnParam.disabled = btnParam.isReturn;

View File

@ -1,5 +1,7 @@
import { message, notification } from 'antd'
import { Button, message, notification } from 'antd'
import { extendInclude, extendRule, getDataFieldValue, initFilter, empty, extendOrder, guid, onBeforeSaveHandleRecordLog, auditOptionShow } from "../../utils/common";
import ShowModal from '../../components/common/ShowModal';
import FormPage from '../../components/FormPage';
export default {
onBeforeSaveHandleRecord(params) {
params.record.TaskID = params.data.TaskID //TaskID传递消息表ID
@ -274,18 +276,41 @@ export default {
return '';
}
},
btnCancel: ({ record, onCancel, data, dispatch }) => {
let json = initFilter(record.ORG_ID, record.ID, null, null, null, data.TaskID);
dispatch({
type: 'app/getDataByPost',
url: 'BS/BSSafeCheck/Cancel',
payload: json,
onlyData: false,
onComplete: (ret) => {
if (ret.IsSuccessful == true) {
message.success('执行成功', null, onCancel())
}
}
})
//取消
btnCancel: ({ record, data, closeForm, login, btn }) => {
const data1 = {
content: <FormPage formCode={btn.FORM_CODE} data={{
id: (record ? record.ID : ''),
TaskID: (record ? data.TaskID : ''),
homeReload: true,
rules: [record],
close: () => {
closeForm();
},
onCancel: () => {
//wyw 此方法要有不能被删除 别处会重写
},
}} />,
};
return {
content: <ShowModal data={data1} login={login} title={btn.LABEL}>
<Button type={btn.CSS} icon={btn.ICON}>{btn.LABEL}</Button>
</ShowModal>
}
},
// btnCancel: ({ record, onCancel, data, dispatch }) => {
// let json = initFilter(record.ORG_ID, record.ID, null, null, null, data.TaskID);
// dispatch({
// type: 'app/getDataByPost',
// url: 'BS/BSSafeCheck/Cancel',
// payload: json,
// onlyData: false,
// onComplete: (ret) => {
// if (ret.IsSuccessful == true) {
// message.success('执行成功', null, onCancel())
// }
// }
// })
// },
}

28
src/files/edit/BS078.js Normal file
View File

@ -0,0 +1,28 @@
import ConfirmButton from '../../components/common/ConfirmButton';
import { Button, message } from 'antd'
import storage from '../../utils/storage'
import config from "../../config.js"
import { extendInclude, extendRule, getDataFieldValue, initFilter, empty, extendOrder, guid, getSubTableData, onBeforeSaveHandleRecordLog, auditOptionShow2 } from "../../utils/common";
import Item from 'antd/lib/list/Item';
import styles from '../../components/CustomPages/HI/StepForm.css';
import EditRowShowModal from '../../components/common/EditRowShowModal';
import FormPage from '../../components/FormPage';
export default {
onBeforeEdit: ({ data, setFieldEditable, setFieldValueByBatch }) => {
if (data.rules && data.rules.length > 0) {
// var parentInfo = data.rules[0].value
var parentInfo = data.rules[0]//.value
if (parentInfo != null && parentInfo.ID != null) {
let temps = [];
// temps.push({ field: "ID", value: parentInfo.ID });
// temps.push({ field: "TaskID", value: data.TaskID });
// temps.push({ field: "ORG_ID", value: parentInfo.ORG_ID });
temps.push({ field: "OrgId", value: parentInfo.ORG_ID });
temps.push({ field: "Keyword", value: parentInfo.ID });
temps.push({ field: "Parameter1", value: data.TaskID });
temps.push({ field: "Parameter3", value: parentInfo.ID });
setFieldValueByBatch(temps);
}
}
},
}