Commit 77d78f62 authored by wzy's avatar wzy

Merge branch 'v2-220618' of…

parents f52ad5e4 b35dbd4d
......@@ -136,7 +136,13 @@ export const initProblemData = (message:any) => {
component: 'TextArea',
editable: true,
},
{
title: '组长',
key: 'isGroupLeader',
dataIndex: 'isGroupLeader',
component: 'Switch',
editable: true,
},
]
......@@ -180,4 +186,31 @@ export const initProblemData = (message:any) => {
message.error('文件规格不正确');
}
return isLt20M;
}
\ No newline at end of file
}
export const verifyColumns = [
{
title: '序号',
render: (text, record, index)=> { return index + 1}
},
{
title: '操作角色',
key: 'roleName',
dataIndex: 'roleName',
},
{
title: '操作',
key: 'operationName',
dataIndex: 'operationName',
},
{
title: '操作时间',
key: 'createTime',
dataIndex: 'createTime',
},
{
title: '审核意见',
key: 'auditOpinion',
dataIndex: 'auditOpinion',
}
];
\ No newline at end of file
......@@ -14,7 +14,7 @@ import { EditOutlined, TagsOutlined, UploadOutlined } from '@ant-design/icons'
import { postOrderEightDRectificationEnumOuters } from '@/services/OrderNewV2Api'
import { UPLOAD_TYPE } from '@/constants'
import { getIntl } from 'umi';
import { beforeDocUpload, groupColumnsDesc, initBasicData, initProblemData, temporaryColumnsDesc, userListColumns } from './contentFn'
import { beforeDocUpload, groupColumnsDesc, initBasicData, initProblemData, temporaryColumnsDesc, userListColumns, verifyColumns } from './contentFn'
import DrawerTable from '@/components/DrawerTable'
import MellowCard from '@/components/MellowCard'
import { postMemberUserEightList } from '@/services/MemberV2Api'
......@@ -56,8 +56,6 @@ const ICAOrPCAContent = (props: ICAOrPCAContentType, ref) => {
const [loading, setloading] = useState(false); // 附件上传加载中
const [temaMemberModal, setTemaMemberModal] = useState(false); // 显示小组成员弹窗
const [selectRowVOSItem, setSelectRowVOSItem] = useState<any>({}); // 选中更换的实施人列
const [urls, setUrls] = useState<any>([]); // 附件
const [descriptionUrls, setDescriptionUrls] = useState<any>([]); // 临时遏制措施附件
const [rootCauseUrls, setRootCauseUrls] = useState<any>([]); // 根本原因附件
......@@ -81,7 +79,7 @@ const ICAOrPCAContent = (props: ICAOrPCAContentType, ref) => {
setRootCauseUrls([...message.correctionInformation?.rootCauseUrls])
}
if (message.correctionInformation?.measuresVOS) {
message.correctionInformation?.measuresVOS?.map((item)=>{
message.correctionInformation?.measuresVOS?.map((item) => {
item.completionDate = moment(item.completionDate)
})
......@@ -109,9 +107,11 @@ const ICAOrPCAContent = (props: ICAOrPCAContentType, ref) => {
const handleChange = ({ file }, type: string) => {
let arr: any = [];
if (type === 'urls') { arr = urls };
if (type === 'descriptionUrls') { arr = descriptionUrls };
if (type === 'rootCauseUrls') { arr = rootCauseUrls };
switch (type) {
case 'urls': { arr = urls; break };
case 'descriptionUrls': { arr = descriptionUrls; break };
case 'rootCauseUrls': { arr = rootCauseUrls; break };
}
setloading(true)
if (file.response) {
if (file.response.code === 1000) {
......@@ -124,9 +124,11 @@ const ICAOrPCAContent = (props: ICAOrPCAContentType, ref) => {
}
}
const arrDesc = [...arr];
if (type === 'urls') { setUrls(arrDesc); };
if (type === 'descriptionUrls') { setDescriptionUrls(arrDesc); };
if (type === 'rootCauseUrls') { setRootCauseUrls(arrDesc) };
switch (type) {
case 'urls': { setUrls(arrDesc); break };
case 'descriptionUrls': { setDescriptionUrls(arrDesc); break };
case 'rootCauseUrls': { setRootCauseUrls(arrDesc); };
}
}
/**
......@@ -157,32 +159,14 @@ const ICAOrPCAContent = (props: ICAOrPCAContentType, ref) => {
</div>
)
}
</div>, colon: true, hiddenLabel: true
},
]
setAttachment([...attachmentDesc]);
}
// 遏制措施描述
const fnChangeContainmentDescriptionOrRootCause = (e, type: string) => {
handleLeave(true);
if (type === 'containmentDescription') {
setContainmentDescription(e.target.value)
} else {
setRootCause(e.target.value)
}
}
const fnInitTemporaryAttachment = () => {
const problemDescribeDesc = [
// {
// label: <span className={canEdit ? style.hasRequired : ''}>遏制措施描述</span>, extra: <>
// {
// canEdit ? <Form.Item name="containmentDescription" rules={[{ required: true, message: '请输入' }]}><TextArea rows={4} placeholder="遏制措施描述" /> </Form.Item> : containmentDescription
// }
// </>
// },
{
label: '附件', extra: <div>
<Space>
......@@ -206,21 +190,11 @@ const ICAOrPCAContent = (props: ICAOrPCAContentType, ref) => {
</div>
)
}
</div>
},
]
const rootCauseDesc = [
// {
// label: <span className={canEdit ? style.hasRequired : ''}>根本原因</span>, extra: <div>
// {
// // canEdit ? <TextArea rows={4}
// // placeholder="根本原因" onChange={(e) => { fnChangeContainmentDescriptionOrRootCause(e, 'rootCause') }} /> : rootCause
// canEdit ? <Form.Item name="rootCause" rules={[{ required: true, message: '请输入' }]}><TextArea rows={4} placeholder="根本原因" /> </Form.Item> : rootCause
// }
// </div>
// },
{
label: '附件', extra: <div>
<Space>
......@@ -313,21 +287,8 @@ const ICAOrPCAContent = (props: ICAOrPCAContentType, ref) => {
}
const stateColor = ['red', 'gold', 'orange', 'lime', 'blue', 'purple',]
const columns: ColumnType<any>[] = [
{
title: '序号',
render: (text, record, index) => {
return <span>{index + 1}</span>
}
},
{
title: '操作角色',
key: 'roleName',
dataIndex: 'roleName',
},
...verifyColumns,
{
title: '状态',
key: 'stateName',
......@@ -336,21 +297,7 @@ const ICAOrPCAContent = (props: ICAOrPCAContentType, ref) => {
return <Tag color={stateColor[record.state]}>{text}</Tag>
}
},
{
title: '操作',
key: 'operationName',
dataIndex: 'operationName',
},
{
title: '操作时间',
key: 'createTime',
dataIndex: 'createTime',
},
{
title: '审核意见',
key: 'auditOpinion',
dataIndex: 'auditOpinion',
}
]
const fnCanConfig = (configItem: any) => {
const userIdArr = message.qualityOrderProductVOS?.map((item) => {
......@@ -361,7 +308,10 @@ const ICAOrPCAContent = (props: ICAOrPCAContentType, ref) => {
}
return false;
}
/**
*
* @param selectItem 删除小组小城
*/
const fnDeleteItemGroup = (selectItem: any) => {
let indexNumber = 0;
temaList.forEach((item, index: number) => {
......@@ -382,14 +332,6 @@ const ICAOrPCAContent = (props: ICAOrPCAContentType, ref) => {
// 小组成员
const groupColumns: any[] = [
...groupColumnsDesc,
{
title: '组长',
key: 'isGroupLeader',
dataIndex: 'isGroupLeader',
component: 'Switch',
editable: true,
},
userInfo.memberRoleType === 2 && {
title: '供应商可见',
key: 'isVisible',
......
......@@ -580,7 +580,7 @@ const MeasureContent = (props: MeasureContentType, ref) => {
return { ...item, ...message.correctionInformation?.correctiveActionVerify[index] };
})
console.log(message.correctionInformation?.prevention, 'correctiveActionDesccorrectiveActionDesccorrectiveActionDesc')
const preventionDesc = message.correctionInformation?.prevention.map((item)=>{
const preventionDesc = message.correctionInformation?.prevention?.map((item)=>{
item.completionDate = moment(item.completionDate).format('YYYY-MM-DD')
return item
}) || []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment