This commit is contained in:
wyw 2025-10-24 11:44:27 +08:00
commit c5643856c0
2 changed files with 53 additions and 49 deletions

View File

@ -1,5 +1,5 @@
import { message } from "antd/lib/index";
import { getPropertyData, extendInclude, extendRule, getDataFieldValue, setDataFieldValue, initFilter, guid } from "../../utils/common";
import { getPropertyData, extendInclude,extendIgnoreDataRule, extendRule, getDataFieldValue, setDataFieldValue, initFilter, guid } from "../../utils/common";
import moment from 'moment';
import { Button, Row, Col, Form, Input, Select, Upload, Icon, Modal, Spin,Table } from 'antd';
/**
@ -15,8 +15,25 @@ export default {
onBeforeEdit(params){
const { isNew, isCopy, dispatch, login, setFieldValue,data, stateData ,getFieldValue} = params ? params : {};
if (isNew) {
if (isNew) {debugger
setFieldValue('MineType', login.currentMineType);
let json = initFilter(login.OrgId);
extendRule(json, 'ID', 1, login.user.DEPARTMENT_ID);
extendInclude(json, 'Nav_Unit')
extendIgnoreDataRule(json)
dispatch({
type: 'app/getDataByPost',
url: 'FM/Department/Get',
payload: json,
onlyData: false,
onComplete: (re) => {
if (re && re.IsSuccessful && re.Data) {
setFieldValue('Nav_ProdutionUnit.NAME', re.Data?.Nav_Unit?.NAME);
setFieldValue('PRODUCTION_UNIT_ID', re.Data.PRODUCTION_UNIT_ID);
setFieldValue('DEPARTMENT_TYPE', re.Data.DEPARTMENT_TYPE);
}
}
})
}
},
@ -108,15 +125,13 @@ export default {
}
},
onChange: ({ colInfo, getFieldValue, setFieldValueByBatch, dispatch,login,updateSubTableData }) => {
if (colInfo.FIELD_NAME === 'MineType' || colInfo.FIELD_NAME === 'Nav_CheckType.NAME' ||colInfo.FIELD_NAME === 'DEPARTMENT_TYPE')
if (colInfo.FIELD_NAME === 'Nav_ProdutionUnit.NAME' || colInfo.FIELD_NAME === 'Nav_CheckType.NAME' ||colInfo.FIELD_NAME === 'DEPARTMENT_TYPE'||colInfo.FIELD_NAME === 'PLANCHECKFREQUENCY')
{
let Parameter1 = getFieldValue('MineType')
let Parameter2 = getFieldValue('CHECK_TYPE_ID')
let Parameter3 = getFieldValue('DEPARTMENT_TYPE')
let json = initFilter(login.OrgId);
json.Parameter1 = Parameter1;
json.Parameter2 = Parameter2;
json.Parameter3 = Parameter3;
json.Parameter1 = getFieldValue('PRODUCTION_UNIT_ID');
json.Parameter2 = getFieldValue('CHECK_TYPE_ID');
json.Parameter3 = getFieldValue('DEPARTMENT_TYPE') ;
json.Parameter4 = getFieldValue('PLANCHECKFREQUENCY') ;
dispatch({
type: 'app/getDataByPost',
url: 'SK/SKSecurityInspectionNotice/GetCheckContentPCs',
@ -138,10 +153,8 @@ export default {
}
},
btnSubAdd: ({row, srcRecord,getSelectedRecords,record,saveRowRecord,colInfo,parentRecord,pageCode, stateData,setState, close, loadData, login, btn, dispatch,props }) => {
let DetailCheck = getSelectedRecords();
if(login.tempContents && login.tempContents.length>0)
{
if(DetailCheck && DetailCheck.length > 0)
{
let tmpDatas=[]
login.tempContents.map((item,i)=>{
@ -150,39 +163,28 @@ export default {
CHECK_CONTENTS_ID:item.ID,
Nav_Contents:item,
CHECKCONTENT:item.CHECKCONTENT,
NUM:i+1
// NUM:i+1
}
tmpDatas.push(tmpData);
});
if (tmpDatas && tmpDatas.length > 0) {
//更新行数据
for (let i = 0; i < DetailCheck.length; i++) {
let iRow = { ...DetailCheck[i] };
if(iRow.Nav_CheckNoticeDetails && iRow.Nav_CheckNoticeDetails.length>0)
if(stateData.Nav_CheckNoticeDetails && stateData.Nav_CheckNoticeDetails.length>0)
{
for (let j = 0; j < tmpDatas.length; j++)
{
iRow.Nav_CheckNoticeDetails.push(tmpDatas[j])
stateData.Nav_CheckNoticeDetails.push(tmpDatas[j])
}
}
else
{
iRow.Nav_CheckNoticeDetails = tmpDatas;
stateData.Nav_CheckNoticeDetails = tmpDatas;
}
saveRowRecord({ record: iRow, editCode: "T_SK_SECURITY_INSPECTION_NOTICE_DETAIL" })
saveRowRecord({ record: stateData, editCode: "T_SK_SECURITY_INSPECTION_NOTICE_DETAIL" })
}
}
}
else
{
login.tempContents =[];
message.error("请先勾选管控措施!");
return;
}
login.tempContents =[];
close();
}
},
},
}

View File

@ -182,6 +182,7 @@ export function initQueryFilter(OrgId, PageIndex, Limit, Sort, Order) {
IncludeCount: 0,
OrderCount: 0,
FilterGroupCount: 0,
IgnoreOrgRule: true,
Include: [],
Orders: [],
FilterGroup: { Rules: [], Groups: [] }
@ -200,6 +201,7 @@ export function initFilter(OrgId, Keyword = "", Sort, Order, PageIndex = 1, Para
OrgId,
PageIndex,
Limit: 10,
IgnoreOrgRule: true,
Start: (PageIndex - 1) * 10,
Sort,
Order: (Order === '' ? 0 : Order),