diff --git a/config/router.ts b/config/router.ts index 252e620..736d098 100644 --- a/config/router.ts +++ b/config/router.ts @@ -85,9 +85,19 @@ export default [ }, { path: '/ComplaintForwardingProcess/index', - name: '投诉转发流程', + name: '投诉受理', component: "@/pages/ComplaintForwardingProcess/index", }, + { + path: '/ComplaintForwardingProcess/ComplaintForwardingProcessReview', + name: '投诉审核', + component: "@/pages/ComplaintForwardingProcess/ComplaintForwardingProcessReview", + }, + { + path: '/ComplaintForwardingProcess/ComplaintForwardingProcessList', + name: '投诉台账', + component: "@/pages/ComplaintForwardingProcess/ComplaintForwardingProcessList", + }, { path: '/BusinessConfiguration/index', name: '业务配置', diff --git a/src/21/~$打印表单.docx b/src/21/~$打印表单.docx deleted file mode 100644 index 8e3f656..0000000 Binary files a/src/21/~$打印表单.docx and /dev/null differ diff --git a/src/models/user.ts b/src/models/user.ts index 390e335..073ab8f 100644 --- a/src/models/user.ts +++ b/src/models/user.ts @@ -314,9 +314,21 @@ const UserModel: UserModelType = { { path: '/ComplaintForwardingProcess/index', redirect: '', - name: '投诉转发流程', + name: '投诉受理', component: "@/pages/ComplaintForwardingProcess/index", }, + { + path: '/ComplaintForwardingProcess/ComplaintForwardingProcessReview', + redirect: '', + name: '投诉审核', + component: "@/pages/ComplaintForwardingProcess/ComplaintForwardingProcessReview", + }, + { + path: '/ComplaintForwardingProcess/ComplaintForwardingProcessList', + redirect: '', + name: '投诉台账', + component: "@/pages/ComplaintForwardingProcess/ComplaintForwardingProcessList", + }, { path: '/BusinessConfiguration/index', redirect: '', @@ -408,6 +420,8 @@ const UserModel: UserModelType = { "/realEstate/index", "/ComplaintApproval/index", "/ComplaintForwardingProcess/index", + "/ComplaintForwardingProcess/ComplaintForwardingProcessReview", + "/ComplaintForwardingProcess/ComplaintForwardingProcessList", "/BusinessConfiguration/index", // '/examine/index', // '/examine/modal', diff --git a/src/pages/BusinessConfiguration/components/ChosePlayers.tsx b/src/pages/BusinessConfiguration/components/ChosePlayers.tsx index 8fb6d3d..83a48f3 100644 --- a/src/pages/BusinessConfiguration/components/ChosePlayers.tsx +++ b/src/pages/BusinessConfiguration/components/ChosePlayers.tsx @@ -106,7 +106,7 @@ const ChosePlayers = ({ actionRef, onRef, defaultPerson }: { actionRef?: any, on useEffect(() => { getUserTypeTree({ UserTypePattern: 1000, ShowStatus: true }).then((res: any) => { console.log('fdsklfja', res); - setTreeView(res[0].children) + setTreeView(res) }) }, []) diff --git a/src/pages/BusinessConfiguration/index.tsx b/src/pages/BusinessConfiguration/index.tsx index e476c53..e6af18b 100644 --- a/src/pages/BusinessConfiguration/index.tsx +++ b/src/pages/BusinessConfiguration/index.tsx @@ -463,15 +463,17 @@ const BusinessConfiguration = () => { }} onOk={(e) => { setShowChosePlayer(false) - let detailList: any = chosePlayerRef.current.selectedRowDetail + let detailList: any = chosePlayerRef?.current?.selectedRowDetail + console.log('detailListdetailList', detailList); + let list: any = [] if (detailList && detailList.length > 0) { detailList.forEach((item: any) => { - list.push({ label: item.USER_NAME, value: item.USER_ID }) + list.push({ label: item?.USER_NAME, value: item.USER_ID }) }) } setPlayerList(list) - modalFormRef.current?.setFieldsValue({ APPROVALSTAFF_ID: chosePlayerRef.current.selectedRowKeys }) + modalFormRef.current?.setFieldsValue({ APPROVALSTAFF_ID: chosePlayerRef?.current?.selectedRowKeys }) }} onCancel={(e) => { setShowChosePlayer(false) diff --git a/src/pages/ComplaintForwardingProcess/ComplaintForwardingProcessList.tsx b/src/pages/ComplaintForwardingProcess/ComplaintForwardingProcessList.tsx new file mode 100644 index 0000000..69ca0e6 --- /dev/null +++ b/src/pages/ComplaintForwardingProcess/ComplaintForwardingProcessList.tsx @@ -0,0 +1,1203 @@ +// 投诉台账 +import { ActionType, FormInstance, ProForm, ProFormSelect, ProFormText, ProFormTextArea, ProFormTreeSelect, ProFormUploadButton, ProTable } from "@ant-design/pro-components"; +import "./index.less"; +import { useRef, useState } from "react"; +import { Button, Col, message, Modal, Row, Image, Space, Popconfirm, Steps, Tooltip, Popover } from "antd"; +import { ExclamationCircleOutlined, PlusOutlined } from "@ant-design/icons"; +import { getFieldEnum, getFieldEnumTreeNoSession, handleDeletePicture, handleDeleteSUGGESTION, handleGetAPPLYAPPROVEList, handleGetAPPROVALROUTEList, handleGetPictureList, handleGetServerpartDDL, handleGetSUGGESTIONList, handleSynchroAPPLYAPPROVE, handleSynchroSUGGESTION, uploadAHYDPicture } from "../serverpartAssets/service"; +import moment from "moment"; +import { resizeImageHalf } from "./resizeImageHalf"; +import { handleGetPassportInfoById } from "../DigitalElectronics/service"; +import { Attachment1, Attachment2, Attachment3, handlePrintByIframe } from "./downFile"; +import { request } from "express"; + + +const beforeUpload = (file: any) => { + const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'; + if (!isJpgOrPng) { + message.error('请上传JPEG、jpg、png格式的图片文件!'); + } + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + message.error('图片大小不超过 2MB!'); + } + return isJpgOrPng && isLt2M; +} + +const ComplaintForwardingProcessList = () => { + const { confirm } = Modal; + const actionRef = useRef(); + const formRef = useRef(); + // 悬浮框的表单实例 + const modalRef = useRef(); + // 显示新增记录的悬浮框 + const [modalVisible, setModalVisible] = useState(false) + // 新增记录的悬浮框 + const [confirmLoading, setConfirmLoading] = useState(false) + // 拿到服务区列表 + const [serverPartList, setServerPartList] = useState() + // 文件列表 + const [fileList, setFileList] = useState([]) + // 预览图片 + const [imagePreviewVisible, setImagePreviewVisible] = useState(false) + // 当前行数据 + const [currentRow, setCurrentRow] = useState() + // 当前用户信息 + const [currentUser, setCurrentUser] = useState(); + // 拿到受理状态的list + const [SUGGESTIONSTATELIST, setSUGGESTIONSTATELIST] = useState(); + // 拿到当前 流程配置的最后流程 + const [lastApprovalRoute, setLastApprovalRoute] = useState(); + // 下一步配置流程的信息 或上一步驳回的信息 + const [nextApprovalRoute, setNextApprovalRoute] = useState(); + // 当前环节的配置信息 + const [currentApprovalRoute, setCurrentApprovalRoute] = useState(); + // 完整的整个流程记录 + const [allProcessRecord, setAllProcessRecord] = useState(); + // 流程进度 + const [progressList, setProgressList] = useState(); + + // 判断是审核通过还是 驳回审核 1 审核通过 2 驳回 3 受理 + const [reviewType, setReviewType] = useState() + + const columns: any = [ + { + title: "类型", + width: 120, + dataIndex: "SUGGESTION_TYPE", + valueType: "select", + align: 'center', + valueEnum: { + "0": "全部", + "1000": "投诉", + "1050": "表扬", + "4000": "咨询/建议" + }, + initialValue: "0" + }, + { + title: "投诉渠道", + width: 120, + dataIndex: "SUGGESTION_CHANNEL", + valueType: "select", + align: 'center', + hideInSearch: true, + request: async () => { + const taxRateLabel: any = await getFieldEnumTreeNoSession({ FieldExplainField: 'SUGGESTION_CHANNEL', notformate: true }) + console.log('taxRateLabel', taxRateLabel); + + return taxRateLabel + }, + }, + { + title: "服务区", + width: 120, + align: 'center', + dataIndex: "SERVERPART_NAME", + hideInSearch: true, + ellipsis: true, + }, + { + title: "人员名称", + width: 150, + align: 'center', + dataIndex: "SUGGESTION_NAME", + hideInSearch: true, + ellipsis: true, + }, + { + title: "联系电话", + width: 120, + align: 'center', + dataIndex: "PHONE_NUMBER", + hideInSearch: true, + ellipsis: true, + }, + { + title: "处理状态", + width: 120, + align: 'center', + dataIndex: "SUGGESTION_STATE", + valueType: "select", + request: async () => { + const req: any = { + SearchParameter: { + PROVINCE_CODE: '530000', + OPERATION_TYPES: '30', + APPROVALROUTE_VALID: 1 + }, + + PageIndex: 1, + PageSize: 999999 + } + const data = await handleGetAPPROVALROUTEList(req) + console.log('dsjakdjaslkd', data); + setSUGGESTIONSTATELIST(data) + setLastApprovalRoute(data[data.length - 1]) + if (data && data.length > 0) { + let list: any = [] + data.forEach((item: any) => { + list.push({ label: item.APPROVALROUTE_NAME, value: item.APPROVALROUTE_STATE }) + }) + list.push({ label: "已审结", value: 3000 }) + list.push({ label: "已审结", value: 2000 }) + list.push({ label: "已审结", value: 9000 }) + return list + } else { + return [] + } + }, + hideInTable: true, + ellipsis: true + }, + { + title: "处理状态", + width: 120, + align: 'center', + dataIndex: "SUGGESTION_STATE", + valueType: "select", + request: async () => { + const req: any = { + SearchParameter: { + PROVINCE_CODE: '530000', + OPERATION_TYPES: '30', + APPROVALROUTE_VALID: 1 + }, + + PageIndex: 1, + PageSize: 999999 + } + const data = await handleGetAPPROVALROUTEList(req) + console.log('dsjakdjaslkd', data); + setSUGGESTIONSTATELIST(JSON.parse(JSON.stringify(data))) + setLastApprovalRoute(data[data.length - 1]) + if (data && data.length > 0) { + let list: any = [] + data.forEach((item: any) => { + list.push({ label: item.APPROVALROUTE_NAME, value: item.APPROVALROUTE_STATE }) + }) + list.unshift({ label: "待受理", value: 1000 }) + list.push({ label: "已审结", value: 9000 }) + return list + } else { + return [] + } + }, + hideInSearch: true, + ellipsis: true, + initialValue: "0" + }, + { + title:
详细描述
, + width: 300, + dataIndex: "SUGGESTION_REASON", + hideInSearch: true, + ellipsis: true, + render: (_, record) => { + return record?.SUGGESTION_REASON ? + { + setCurrentRow(record) + setModalVisible(true) + }}>{record?.SUGGESTION_REASON} : "" + } + }, + { + title:
发起时间
, + width: 150, + align: 'center', + dataIndex: "SUGGESTION_CREATEDATE", + hideInSearch: true, + ellipsis: true, + render: (_, record) => { + return record?.SUGGESTION_CREATEDATE ? moment(record?.SUGGESTION_CREATEDATE).format('YYYY-MM-DD HH:mm:ss') : "" + } + }, + { + title: "操作", + width: 150, + align: 'center', + dataIndex: "option", + hideInSearch: true, + render: (_, record) => { + return + { + record?.SUGGESTION_STATE === 1000 ? + // { + // setCurrentRow(record) + // setModalVisible(true) + // setReviewType(3) + // }}> + // 受理 + // + "" : + // lastApprovalRoute 为当前配置流程的 最后配置流程 那一整个 配置对象 可以拿到当前配置 和下一环节配置 下一环节配置 为最终的 + // 若 最后的配置流程的当前配置 大于等于 当前数据的配置 那么就出现审核通过 和 驳回审核 + lastApprovalRoute && lastApprovalRoute.APPROVALROUTE_STATE >= record.SUGGESTION_STATE ? + <> + {/* { + setCurrentRow(record) + setModalVisible(true) + setReviewType(1) + }}>审核通过 + { + record?.SUGGESTION_STATE > 1010 ? + { + setCurrentRow(record) + setModalVisible(true) + setReviewType(2) + }}>驳回审核 : "" + } */} + + : + // 若当前记录流程 为最审结状态 那么就出现下载附件下载 + lastApprovalRoute && lastApprovalRoute.NEXT_STATE === record.SUGGESTION_STATE ? + { + handleDownloadFile(record) + }}> + 下载附件 + : + "" + } + {/* 一般情况下注释掉 */} + {/* { + const req = { + SUGGESTIONId: record.SUGGESTION_ID + } + const res: any = await handleDeleteSUGGESTION(req) + if (res.Result_Code === 100) { + message.success("删除成功") + actionRef.current?.reload() + } else { + message.error(res.Result_Desc) + } + }}>删除 */} + + } + } + ] + + // 处理树形数据 + const addDisabledIfHasChildren = (list: any) => { + if (!Array.isArray(list)) return list; + return list.map(item => { + const hasChildren = Array.isArray(item.children) && item.children.length > 0; + const newItem = { + ...item, + ...(hasChildren ? { disabled: true } : {}) + }; + if (hasChildren) { + newItem.children = addDisabledIfHasChildren(item.children); + } + return newItem; + }); + } + + // 预览上传后的图片 + const handlePreview = async () => { + setFileList(fileList) + setImagePreviewVisible(true) + }; + + // 新增或同步记录的方法 + const handleAddUpdateRecord = async (res: any) => { + let req: any = {} + if (currentRow) { + req = { + ...currentRow, + ...res, + OPERATE_DATE: moment().format("YYYY-MM-DD HH:mm:ss"), + } + } else { + req = { + SUGGESTION_CHANNEL: res.SUGGESTION_CHANNEL, + SUGGESTION_TYPE: res.SUGGESTION_TYPE, + SERVERPART_ID: res.SERVERPART_ID, + PROVINCE_CODE: "530000", + MEMBERSHIP_ID: currentUser?.ID || "", + ENUM_LABEL: res.ENUM_LABEL ? res.ENUM_LABEL.toString() : "", + SUGGESTION_NAME: res.SUGGESTION_NAME, + PHONE_NUMBER: res.PHONE_NUMBER, + SUGGESTION_REASON: res.SUGGESTION_REASON, + SERVERPART_NAME: res.SERVERPART_NAME, + SUGGESTION_CREATEDATE: moment().format("YYYY-MM-DD HH:mm:ss"), + SUGGESTION_STATE: 1000, // 1000 为待受理状态 + OPERATE_DATE: moment().format("YYYY-MM-DD HH:mm:ss"), + DISPOSITION_PERSON: res?.DISPOSITION_PERSON || "", + CHAIRMAN_STAFFID: currentUser?.ID || "", + } + } + setConfirmLoading(true) + console.log('reqreq', req); + + const data = await handleSynchroSUGGESTION(req) + if (data.Result_Code === 100) { + // 上传图片 + if (res.LOCALEPHOTO && res.LOCALEPHOTO.length > 0) { + for (const file of res.LOCALEPHOTO) { + const formData = new FormData(); + const originalFile = file.originFileObj || file; + try { + // 压缩图片 + const compressedFile = await resizeImageHalf(originalFile); + // 使用压缩后的文件 + formData.append('files[]', compressedFile); + formData.append('ImageName', compressedFile.name); + } catch (err) { + // 如果压缩失败,使用原图 + formData.append('files[]', originalFile); + formData.append('ImageName', originalFile.name); + } + + formData.append('TableId', data.Result_Data.SUGGESTION_ID); + formData.append('TableType', "1302"); + formData.append('ImageType', "1000"); // 1000 为 上传材料 2000的话 是 处理的附件资料 + await uploadAHYDPicture(formData) + } + + setConfirmLoading(false) + } + await handleUpdateAddAPPLYAPPROVE('add', data.Result_Data.SUGGESTION_ID) + setConfirmLoading(false) + message.success("同步成功") + actionRef.current?.reload() + setModalVisible(false) + // modalRef?.current?.resetFields() + setReviewType(null) + setFileList([]) + setNextApprovalRoute(null) + setCurrentApprovalRoute(null) + setAllProcessRecord([]) + setProgressList([]) + } else { + setConfirmLoading(false) + message.error(data.Result_Desc) + } + } + + // 获取当前用户信息 + const handleGetUserInfo = async (id: string) => { + const req: any = { + UserIdEncrypted: id + } + const data = await handleGetPassportInfoById(req) + setCurrentUser(data) + return data + } + + // 修改受理状态 即改变status + const handleUpdateStatus = async (record: any) => { + // 审核通过走这个 + if (reviewType === 1 || reviewType === 3) { + console.log('下一环节信息', nextApprovalRoute); + console.log('当前表单数据', record); + + let newOtherDetail: any = {} + if (currentRow?.SUGGESTION_STATE === 1010) { + newOtherDetail = { + FEEDBACK_DATE: moment().format("YYYY-MM-DD HH:mm:ss"), + LEADERSHIP_STAFFID: record.nextPerson, + LEADERSHIP_NAME: record.nextPersonName + } + } + + const req: any = { + ...currentRow, + ...newOtherDetail, + MANAGER_NAME: record?.MANAGER_NAME, + SUGGESTION_INFO: record?.SUGGESTION_INFO, + CHAIRMAN_ID: record?.nextPerson, + CHAIRMAN_NAME: record?.nextPersonName, + SUGGESTION_STATE: currentApprovalRoute?.NEXT_STATE === 9000 ? 9000 : nextApprovalRoute?.APPROVALROUTE_STATE, + LEADERSHIP_INFO: record?.LEADERSHIP_INFO || "", + FEEDBACK_INFO: record?.FEEDBACK_INFO || "", + CHAIRMAN_STAFFID: record?.nextPerson, + } + setConfirmLoading(true) + const data: any = await handleSynchroSUGGESTION(req) + setConfirmLoading(false) + if (data.Result_Code === 100) { + if (record?.ATTACHED_MATERIALS && record?.ATTACHED_MATERIALS.length > 0 && currentRow?.SUGGESTION_STATE === 1010) { + for (const file of record?.ATTACHED_MATERIALS) { + const formData = new FormData(); + const originalFile = file.originFileObj || file; + try { + // 压缩图片 + const compressedFile = await resizeImageHalf(originalFile); + // 使用压缩后的文件 + formData.append('files[]', compressedFile); + formData.append('ImageName', compressedFile.name); + } catch (err) { + // 如果压缩失败,使用原图 + formData.append('files[]', originalFile); + formData.append('ImageName', originalFile.name); + } + + formData.append('TableId', currentRow?.SUGGESTION_ID); + formData.append('TableType', "1302"); + formData.append('ImageType', "2000"); // 1000 为 上传材料 2000的话 是 处理的附件资料 + await uploadAHYDPicture(formData) + } + + } + + await handleUpdateAddAPPLYAPPROVE() + message.success(reviewType === 1 ? '审核成功' : reviewType === 2 ? '驳回成功!' : reviewType === 3 ? "受理成功!" : "") + setModalVisible(false) + setCurrentRow(undefined) + setReviewType(null) + setFileList([]) + setNextApprovalRoute(null) + setCurrentApprovalRoute(null) + // modalRef?.current?.resetFields() + + actionRef.current?.reload() + } else { + message.error(data.Result_Desc) + } + } else if (reviewType === 2) { + // 驳回审核走这个 + // 因为这个data是整个流程最完整的过程数组 所以只能驳回到上一步去 + // 取到上一步的状态 + let lastStepDetail: any = allProcessRecord[allProcessRecord.length - 1] + const newStepReq: any = { + ...currentRow, + CHAIRMAN_ID: lastStepDetail?.STAFF_ID, + CHAIRMAN_NAME: lastStepDetail?.STAFF_NAME, + SUGGESTION_STATE: lastStepDetail?.APPLYAPPROVE_TYPE, + } + setConfirmLoading(true) + const newStepData: any = await handleSynchroSUGGESTION(newStepReq) + setConfirmLoading(false) + if (newStepData.Result_Code === 100) { + // 传入reject 里面的APPLYAPPROVE_INFO 就会是9999 就代表驳回 + await handleUpdateAddAPPLYAPPROVE('reject', '', record) + + message.success('驳回成功!') + setModalVisible(false) + setCurrentRow(undefined) + setReviewType(null) + setFileList([]) + setNextApprovalRoute(null) + setCurrentApprovalRoute(null) + // modalRef?.current?.resetFields() + + actionRef.current?.reload() + } else { + message.error(data.Result_Desc) + } + } + } + + // 请求当前流程的完整审核过程 + const handleGetAllProcessRecord = async () => { + const req: any = { + SearchParameter: { + TABLE_ID: currentRow?.SUGGESTION_ID, + TABLE_NAME: "MOBILESERVICE_PLATFORM.T_SUGGESTION", + }, + PageIndex: 1, + PageSize: 999999 + } + const data: any = await handleGetAPPLYAPPROVEList(req) + console.log('当前已经走过的流程', data); + + setAllProcessRecord(data) + let list: any = [] + // 当前的流程 + let currentStatus: number = 0 + if (data && data.length > 0) { + data.forEach((item: any) => { + list.push({ + title: ( + + {item.APPLYAPPROVE_NAME} + + ), + description: item?.APPLYAPPROVE_DATE, + status: "finish" + // description: item?.APPLYAPPROVE_INFO, + // status: item?.APPLYAPPROVE_TYPE === 1 ? 'process' : item?.APPLYAPPROVE_TYPE === 2 ? 'wait' : 'finish', + }) + currentStatus = item.APPLYAPPROVE_TYPE + }) + } + + let newSUGGESTIONSTATELIST = JSON.parse(JSON.stringify(SUGGESTIONSTATELIST)) + // 若有两个1000 的话 去掉 监控受理中心的1000 + if (newSUGGESTIONSTATELIST && newSUGGESTIONSTATELIST.length > 0) { + newSUGGESTIONSTATELIST.forEach((item: any) => { + if (item.APPROVALROUTE_STATE === 1000 && currentRow?.SUGGESTION_STATE !== 1000) { + newSUGGESTIONSTATELIST.splice(newSUGGESTIONSTATELIST.indexOf(item), 1) + } + }) + } + console.log('SUGGESTIONSTATELISTSUGGESTIONSTATELIST2', newSUGGESTIONSTATELIST); + // 拿到还没到的流程 和当前的流程数据 + let currentList: any = [] + if (newSUGGESTIONSTATELIST && newSUGGESTIONSTATELIST.length > 0) { + newSUGGESTIONSTATELIST.forEach((item: any) => { + + if (currentStatus === 1000) { + if (item.APPROVALROUTE_STATE >= currentStatus) { + currentList.push({ + title: item?.APPROVALROUTE_NAME, + description: "", + status: "finish" + }) + } + } else { + if (item.APPROVALROUTE_STATE > currentStatus) { + currentList.push({ + title: item?.APPROVALROUTE_NAME, + description: "", + status: "finish" + }) + } + } + + }) + } + + if (currentList && currentList.length > 0) { + currentList.forEach((item: any, index: number) => { + list.push({ + title: item.title, + description: item.description, + status: index === 0 ? 'process' : "wait" + }) + }) + } + + setProgressList(list) + } + + // 同步审批意见 + const handleUpdateAddAPPLYAPPROVE = async (type?: string, id?: string, record?: any) => { + // type 可能为 add 的时候 说明是新增的 reject 是驳回 + // id 是新增的时候同步 需要id + // record 是驳回的时候需要 需要拿到实际的表单数据 + const req: any = { + TABLE_ID: type === 'add' ? id : currentRow?.SUGGESTION_ID, + TABLE_NAME: "MOBILESERVICE_PLATFORM.T_SUGGESTION", + // APPLYAPPROVE_TYPE: reviewType,// 意见类型 1 审核 2 驳回 3 受理 + APPLYAPPROVE_TYPE: type === 'reject' ? 9999 : type === 'add' ? 1000 : currentApprovalRoute?.APPROVALROUTE_STATE,// 新增为1000 + APPLYAPPROVE_NAME: type === 'reject' ? '驳回流程' : type === 'add' ? '新增流程记录' : currentApprovalRoute?.APPROVALROUTE_NAME || "",// 环节名称 + APPLYAPPROVE_INFO: type === 'reject' ? record?.rejectionOpinion : "",// 审批意见 + APPLYAPPROVE_DATE: moment().format("YYYY-MM-DD HH:mm:ss"),// 审批时间 + STAFF_ID: currentUser?.ID,// 审批人ID + STAFF_NAME: currentUser?.Name,// 审批人姓名 + } + const data = await handleSynchroAPPLYAPPROVE(req) + } + + // 下载附件的方法 + const handleDownloadFile = async (record: any) => { + console.log('recordrecord', record); + if (record?.SUGGESTION_CHANNEL === 1000 || record?.SUGGESTION_CHANNEL === 4000 || record?.SUGGESTION_CHANNEL === 5000) { + // 附件1 + handlePrintByIframe(Attachment1, record) + } else if (record?.SUGGESTION_CHANNEL === 2000) { + // 附件2 + handlePrintByIframe(Attachment2, record) + } else if (record?.SUGGESTION_CHANNEL === 3000) { + // 附件3 + handlePrintByIframe(Attachment3, record) + } + } + + return ( +
+ { + let userInfo: any = {} + if (!currentUser) { + const search = window.location.search; + const addressParams = Object.fromEntries(new URLSearchParams(search).entries()); + userInfo = await handleGetUserInfo(addressParams.UserIdEncrypted) + } + + console.log('paramsparamsparams', params); + const req: any = { + SearchParameter: { + SUGGESTION_TYPES: params?.SUGGESTION_TYPE === "0" ? '1000,1050,4000' : params?.SUGGESTION_TYPE,// 类型 + SUGGESTION_STATES: params?.SUGGESTION_STATE === "0" || !params?.SUGGESTION_STATE ? '' : params?.SUGGESTION_STATE,// 状态 + // CHAIRMAN_STAFFID: currentUser?.ID || userInfo.ID + }, + SortStr: "SUGGESTION_CREATEDATE desc", + PageIndex: 1, + PageSize: "999999" + } + const data = await handleGetSUGGESTIONList(req) + if (data && data.length > 0) { + return { data, success: true } + } + return { data: [], success: true } + }} + toolbar={{ + actions: [ + + ] + }} + /> + + {fileList && fileList.length > 0 &&
+ { + setImagePreviewVisible(vis) + } + + }}> + { + fileList.map((n) => + + ) + } + + +
} + + + { + setModalVisible(false) + modalRef.current?.validateFields().then((res) => { + modalRef.current?.submit() + }) + }} + onCancel={(e) => { + setModalVisible(false) + setCurrentRow(undefined) + setReviewType(null) + setFileList([]) + setNextApprovalRoute(null) + setCurrentApprovalRoute(null) + setAllProcessRecord([]) + setProgressList([]) + // modalRef?.current?.resetFields() + }} + footer={
+ { + currentRow ? + <> + { + reviewType === 1 || reviewType === 3 ? + { + modalRef.current?.validateFields().then((res) => { + handleUpdateStatus(res) + }) + }} + > + + : + reviewType === 2 ? + { + modalRef.current?.validateFields().then((res) => { + handleUpdateStatus(res) + }) + }} + > + + + : '' + } + + : + <> + + + + } +
} + > + { + await handleAddUpdateRecord(res) + }} + request={async () => { + if (currentRow?.SUGGESTION_ID) { + // 拿图片信息 + const req: any = { + TableId: currentRow?.SUGGESTION_ID, + TableType: 1302, + ImageType: "1000" // 1000 为 上传材料 2000的话 是 处理的附件资料 + } + const data = await handleGetPictureList(req) + let list: any = [] + if (data.List && data.List.length > 0) { + data.List.forEach((n: any) => { + list.push({ + url: n.ImageUrl, + name: n.ImageName, + uid: String(n.ImageId), + status: 'done' + }) + }) + setFileList(list) + } + console.log('curr', currentRow); + let attachedMaterialsList: any = [] + if (currentRow?.SUGGESTION_STATE >= 1010) { + const req: any = { + TableId: currentRow?.SUGGESTION_ID, + TableType: 1302, + ImageType: "2000" // 1000 为 上传材料 2000的话 是 处理的附件资料 + } + const data = await handleGetPictureList(req) + if (data.List && data.List.length > 0) { + data.List.forEach((n: any) => { + attachedMaterialsList.push({ + url: n.ImageUrl, + name: n.ImageName, + uid: String(n.ImageId), + status: 'done' + }) + }) + } + } + console.log('attachedMaterialsList', attachedMaterialsList); + + await handleGetAllProcessRecord() + + return { + ...currentRow, + ENUM_LABEL: currentRow?.ENUM_LABEL.split(',').map((item: any) => Number(item)), + SERVERPART_ID: currentRow?.SERVERPART_ID ? String(currentRow?.SERVERPART_ID) : "", + SUGGESTION_TYPE: currentRow?.SUGGESTION_TYPE ? String(currentRow?.SUGGESTION_TYPE) : "", + LOCALEPHOTO: list, + ATTACHED_MATERIALS: attachedMaterialsList + } + } else { + return {} + } + }} + > + + + { + if (serverPartList && serverPartList.length > 0) { + return serverPartList + } else { + const req: any = { + ProvinceCode: "530000", + } + let list: any = [] + const data = await handleGetServerpartDDL(req) + if (data && data.length > 0) { + list = data + setServerPartList(list) + } else { + setServerPartList([]) + } + return list + } + }} + fieldProps={{ + showSearch: true, + filterOption: (input, option) => + (option?.label ?? '').toLowerCase().includes(input.toLowerCase()), + optionFilterProp: 'label', + onChange: async (value: any, option: any) => { + modalRef.current?.setFieldsValue({ SERVERPART_NAME: option.title }) + } + }} + rules={[{ + required: true, + message: '请选择服务区!' + }]} + readonly={reviewType} + /> + + + + + + + { + const taxRateLabel: any = await getFieldEnumTreeNoSession({ FieldExplainField: 'SUGGESTION_CHANNEL', notformate: true }) + console.log('taxRateLabel', taxRateLabel); + + return taxRateLabel + }} + rules={[{ + required: true, + message: '请选择投诉渠道!' + }]} + readonly={reviewType} + /> + + + + { + return [ + { + label: "投诉", + value: "1000" + }, + { + label: "表扬", + value: "1050" + }, + { + label: "咨询/建议", + value: "4000" + } + ] + }} + rules={[{ + required: true, + message: '请选择投诉类型!' + }]} + readonly={reviewType && currentRow?.SUGGESTION_STATE !== 1000} + /> + + + + { + const taxRateLabel: any = await getFieldEnumTreeNoSession({ FieldExplainField: 'BUSINESS_TARGET', notformate: true }) + let list: any = addDisabledIfHasChildren(taxRateLabel) + return list + }} + fieldProps={{ + treeDefaultExpandAll: true, + multiple: true, + }} + rules={[ + { + required: true, + message: '请选择标签', + }, + ]} + readonly={reviewType} + /> + + + + + + + + + + + + + + + + + + + { + // if (info.file.status === 'removed') { + // confirm({ + // title: '确认删除该图片吗?', + // icon: , + // async onOk() { + + + // const req: any = { + // ImagePath: info.file.path, + // TableType: '5000', + // } + // const data = await handleDeletePicture(req) + // if (data) { + // message.success('删除成功!') + // let list: any = JSON.parse(JSON.stringify(fileList)) + // let res: any = [] + // if (list && list.length > 0) { + // list.forEach((item: any) => { + // if (item.url === info.file.url) { + + // } else { + // res.push(item) + // } + // }) + // } + // setFileList(res) + // } + // } + // }); + // } + } + }} + /> + + + {/* 状态1010 即 项目管理单元安全员 的时候 出现 核实情况,处置结果,附件资料 */} + { + currentRow?.SUGGESTION_STATE >= 1010 ? + <> + + 1010} + /> + + + 1010} + /> + + + 1010} + /> + + + 1010} + /> + + + 1010} + fieldProps={{ + maxCount: 9 + }} + /> + + : "" + } + + { + reviewType !== 2 && currentRow && currentRow?.SUGGESTION_STATE !== 9000 && currentApprovalRoute?.NEXT_STATE !== 9000 ? + + { + console.log('SUGGESTIONSTATELIST', SUGGESTIONSTATELIST); + console.log('currentRow', currentRow); + let currentObj: any = {} // 当前环节的配置信息 + let nextStausId: any = "" + let nextStatusObj: any = "" + if (SUGGESTIONSTATELIST && SUGGESTIONSTATELIST.length > 0) { + SUGGESTIONSTATELIST.forEach((item: any) => { + if (Number(item.APPROVALROUTE_STATE) === Number(currentRow?.SUGGESTION_STATE)) { + nextStausId = Number(item.NEXT_STATE) + currentObj = item + } + + }) + + SUGGESTIONSTATELIST.forEach((item: any) => { + if (item.APPROVALROUTE_STATE === nextStausId) { + nextStatusObj = item + } + }) + console.log('下一环节配置', nextStatusObj); + console.log('当前环节配置', currentObj); + setNextApprovalRoute(nextStatusObj) + setCurrentApprovalRoute(currentObj) + let idList: any = nextStatusObj?.APPROVALSTAFF_ID ? nextStatusObj?.APPROVALSTAFF_ID.split(',') : [] + let nameList: any = nextStatusObj?.APPROVALSTAFF_NAME ? nextStatusObj?.APPROVALSTAFF_NAME.split(',') : [] + let list: any = [] + if (idList && idList.length > 0 && nameList && nameList.length > 0) { + let count: number = idList.length + for (let i = 0; i < count; i++) { + list.push({ label: nameList[i], value: idList[i] }) + } + } + console.log('listlistlist', list); + + return list + } else { + return [] + } + }} + fieldProps={{ + showSearch: true, + filterOption: (input, option) => + (option?.label ?? '').toLowerCase().includes(input.toLowerCase()), + optionFilterProp: 'label', + onChange: (e, option: any) => { + modalRef.current?.setFieldsValue({ nextPersonName: option.title }) + } + }} + /> + : "" + } + + {/* 出现驳回意见 */} + { + (currentRow?.SUGGESTION_STATE > 1010 && reviewType === 2) ? + + + : "" + } + + + + + + { + currentRow ? +
+
流程进度
+
+ + +
+
: "" + } +
+
+
+ ); +}; + +export default ComplaintForwardingProcessList; diff --git a/src/pages/ComplaintForwardingProcess/ComplaintForwardingProcessReview.tsx b/src/pages/ComplaintForwardingProcess/ComplaintForwardingProcessReview.tsx new file mode 100644 index 0000000..ef48465 --- /dev/null +++ b/src/pages/ComplaintForwardingProcess/ComplaintForwardingProcessReview.tsx @@ -0,0 +1,1213 @@ +// 审核页面 +import { ActionType, FormInstance, ProForm, ProFormSelect, ProFormText, ProFormTextArea, ProFormTreeSelect, ProFormUploadButton, ProTable } from "@ant-design/pro-components"; +import "./index.less"; +import { useRef, useState } from "react"; +import { Button, Col, message, Modal, Row, Image, Space, Popconfirm, Steps, Tooltip, Popover } from "antd"; +import { ExclamationCircleOutlined, PlusOutlined } from "@ant-design/icons"; +import { getFieldEnum, getFieldEnumTreeNoSession, handleDeletePicture, handleDeleteSUGGESTION, handleGetAPPLYAPPROVEList, handleGetAPPROVALROUTEList, handleGetPictureList, handleGetServerpartDDL, handleGetSUGGESTIONList, handleSynchroAPPLYAPPROVE, handleSynchroSUGGESTION, uploadAHYDPicture } from "../serverpartAssets/service"; +import moment from "moment"; +import { resizeImageHalf } from "./resizeImageHalf"; +import { handleGetPassportInfoById } from "../DigitalElectronics/service"; +import { Attachment1, Attachment2, Attachment3, handlePrintByIframe } from "./downFile"; +import { request } from "express"; + + +const beforeUpload = (file: any) => { + const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'; + if (!isJpgOrPng) { + message.error('请上传JPEG、jpg、png格式的图片文件!'); + } + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + message.error('图片大小不超过 2MB!'); + } + return isJpgOrPng && isLt2M; +} + +const ComplaintForwardingProcessReview = () => { + const { confirm } = Modal; + const actionRef = useRef(); + const formRef = useRef(); + // 悬浮框的表单实例 + const modalRef = useRef(); + // 显示新增记录的悬浮框 + const [modalVisible, setModalVisible] = useState(false) + // 新增记录的悬浮框 + const [confirmLoading, setConfirmLoading] = useState(false) + // 拿到服务区列表 + const [serverPartList, setServerPartList] = useState() + // 文件列表 + const [fileList, setFileList] = useState([]) + // 预览图片 + const [imagePreviewVisible, setImagePreviewVisible] = useState(false) + // 当前行数据 + const [currentRow, setCurrentRow] = useState() + // 当前用户信息 + const [currentUser, setCurrentUser] = useState(); + // 拿到受理状态的list + const [SUGGESTIONSTATELIST, setSUGGESTIONSTATELIST] = useState(); + // 拿到当前 流程配置的最后流程 + const [lastApprovalRoute, setLastApprovalRoute] = useState(); + // 下一步配置流程的信息 或上一步驳回的信息 + const [nextApprovalRoute, setNextApprovalRoute] = useState(); + // 当前环节的配置信息 + const [currentApprovalRoute, setCurrentApprovalRoute] = useState(); + // 完整的整个流程记录 + const [allProcessRecord, setAllProcessRecord] = useState(); + // 流程进度 + const [progressList, setProgressList] = useState(); + + // 判断是审核通过还是 驳回审核 1 审核通过 2 驳回 3 受理 + const [reviewType, setReviewType] = useState() + + const columns: any = [ + { + title: "类型", + width: 120, + dataIndex: "SUGGESTION_TYPE", + valueType: "select", + align: 'center', + valueEnum: { + "0": "全部", + "1000": "投诉", + "1050": "表扬", + "4000": "咨询/建议" + }, + initialValue: "0" + }, + { + title: "投诉渠道", + width: 120, + dataIndex: "SUGGESTION_CHANNEL", + valueType: "select", + align: 'center', + hideInSearch: true, + request: async () => { + const taxRateLabel: any = await getFieldEnumTreeNoSession({ FieldExplainField: 'SUGGESTION_CHANNEL', notformate: true }) + console.log('taxRateLabel', taxRateLabel); + + return taxRateLabel + }, + }, + { + title: "服务区", + width: 120, + align: 'center', + dataIndex: "SERVERPART_NAME", + hideInSearch: true, + ellipsis: true, + }, + { + title: "人员名称", + width: 150, + align: 'center', + dataIndex: "SUGGESTION_NAME", + hideInSearch: true, + ellipsis: true, + }, + { + title: "联系电话", + width: 120, + align: 'center', + dataIndex: "PHONE_NUMBER", + hideInSearch: true, + ellipsis: true, + }, + { + title: "处理状态", + width: 120, + align: 'center', + dataIndex: "SUGGESTION_STATE", + valueType: "select", + request: async () => { + const req: any = { + SearchParameter: { + PROVINCE_CODE: '530000', + OPERATION_TYPES: '30', + APPROVALROUTE_VALID: 1 + }, + + PageIndex: 1, + PageSize: 999999 + } + const data = await handleGetAPPROVALROUTEList(req) + console.log('dsjakdjaslkd', data); + setSUGGESTIONSTATELIST(data) + setLastApprovalRoute(data[data.length - 1]) + if (data && data.length > 0) { + let list: any = [] + data.forEach((item: any) => { + if (item.APPROVALROUTE_STATE !== 1000) { + list.push({ label: item.APPROVALROUTE_NAME, value: item.APPROVALROUTE_STATE }) + } + }) + list.push({ label: "已审结", value: 9000 }) + return list + } else { + return [] + } + }, + hideInTable: true, + ellipsis: true + }, + { + title: "处理状态", + width: 120, + align: 'center', + dataIndex: "SUGGESTION_STATE", + valueType: "select", + request: async () => { + const req: any = { + SearchParameter: { + PROVINCE_CODE: '530000', + OPERATION_TYPES: '30', + APPROVALROUTE_VALID: 1 + }, + + PageIndex: 1, + PageSize: 999999 + } + const data = await handleGetAPPROVALROUTEList(req) + console.log('dsjakdjaslkd', data); + setSUGGESTIONSTATELIST(data) + setLastApprovalRoute(data[data.length - 1]) + if (data && data.length > 0) { + let list: any = [] + data.forEach((item: any) => { + if (item.APPROVALROUTE_STATE !== 1000) { + list.push({ label: item.APPROVALROUTE_NAME, value: item.APPROVALROUTE_STATE }) + } + }) + list.push({ label: "已审结", value: 3000 }) + list.push({ label: "已审结", value: 2000 }) + list.push({ label: "已审结", value: 9000 }) + return list + } else { + return [] + } + }, + hideInSearch: true, + ellipsis: true + }, + { + title:
详细描述
, + width: 300, + dataIndex: "SUGGESTION_REASON", + hideInSearch: true, + ellipsis: true, + render: (_, record) => { + return record?.SUGGESTION_REASON ? + { + setCurrentRow(record) + setModalVisible(true) + }}>{record?.SUGGESTION_REASON} : "" + } + }, + { + title:
发起时间
, + width: 150, + align: 'center', + dataIndex: "SUGGESTION_CREATEDATE", + hideInSearch: true, + ellipsis: true, + render: (_, record) => { + return record?.SUGGESTION_CREATEDATE ? moment(record?.SUGGESTION_CREATEDATE).format('YYYY-MM-DD HH:mm:ss') : "" + } + }, + { + title: "操作", + width: 150, + align: 'center', + dataIndex: "option", + hideInSearch: true, + render: (_, record) => { + return + { + record?.SUGGESTION_STATE === 1000 ? + { + setCurrentRow(record) + setModalVisible(true) + setReviewType(3) + }}> + 受理 + : + // lastApprovalRoute 为当前配置流程的 最后配置流程 那一整个 配置对象 可以拿到当前配置 和下一环节配置 下一环节配置 为最终的 + // 若 最后的配置流程的当前配置 大于等于 当前数据的配置 那么就出现审核通过 和 驳回审核 + lastApprovalRoute && lastApprovalRoute.APPROVALROUTE_STATE >= record.SUGGESTION_STATE ? + <> + { + setCurrentRow(record) + setModalVisible(true) + setReviewType(1) + }}>审核通过 + { + record?.SUGGESTION_STATE > 1010 ? + { + setCurrentRow(record) + setModalVisible(true) + setReviewType(2) + }}>驳回审核 : "" + } + + : + // 若当前记录流程 为最审结状态 那么就出现下载附件下载 + lastApprovalRoute && lastApprovalRoute.NEXT_STATE === record.SUGGESTION_STATE ? + { + handleDownloadFile(record) + }}> + 下载附件 + : + "" + } + {/* 一般情况下注释掉 */} + {/* { + const req = { + SUGGESTIONId: record.SUGGESTION_ID + } + const res: any = await handleDeleteSUGGESTION(req) + if (res.Result_Code === 100) { + message.success("删除成功") + actionRef.current?.reload() + } else { + message.error(res.Result_Desc) + } + }}>删除 */} + + } + } + ] + + // 处理树形数据 + const addDisabledIfHasChildren = (list: any) => { + if (!Array.isArray(list)) return list; + return list.map(item => { + const hasChildren = Array.isArray(item.children) && item.children.length > 0; + const newItem = { + ...item, + ...(hasChildren ? { disabled: true } : {}) + }; + if (hasChildren) { + newItem.children = addDisabledIfHasChildren(item.children); + } + return newItem; + }); + } + + // 预览上传后的图片 + const handlePreview = async () => { + setFileList(fileList) + setImagePreviewVisible(true) + }; + + // 新增或同步记录的方法 + const handleAddUpdateRecord = async (res: any) => { + let req: any = {} + if (currentRow) { + req = { + ...currentRow, + ...res, + OPERATE_DATE: moment().format("YYYY-MM-DD HH:mm:ss"), + } + } else { + req = { + SUGGESTION_CHANNEL: res.SUGGESTION_CHANNEL, + SUGGESTION_TYPE: res.SUGGESTION_TYPE, + SERVERPART_ID: res.SERVERPART_ID, + PROVINCE_CODE: "530000", + MEMBERSHIP_ID: currentUser?.ID || "", + ENUM_LABEL: res.ENUM_LABEL ? res.ENUM_LABEL.toString() : "", + SUGGESTION_NAME: res.SUGGESTION_NAME, + PHONE_NUMBER: res.PHONE_NUMBER, + SUGGESTION_REASON: res.SUGGESTION_REASON, + SERVERPART_NAME: res.SERVERPART_NAME, + SUGGESTION_CREATEDATE: moment().format("YYYY-MM-DD HH:mm:ss"), + SUGGESTION_STATE: 1000, // 1000 为待受理状态 + OPERATE_DATE: moment().format("YYYY-MM-DD HH:mm:ss"), + DISPOSITION_PERSON: res?.DISPOSITION_PERSON || "", + CHAIRMAN_STAFFID: currentUser?.ID || "", + } + } + setConfirmLoading(true) + console.log('reqreq', req); + + const data = await handleSynchroSUGGESTION(req) + if (data.Result_Code === 100) { + // 上传图片 + if (res.LOCALEPHOTO && res.LOCALEPHOTO.length > 0) { + for (const file of res.LOCALEPHOTO) { + const formData = new FormData(); + const originalFile = file.originFileObj || file; + try { + // 压缩图片 + const compressedFile = await resizeImageHalf(originalFile); + // 使用压缩后的文件 + formData.append('files[]', compressedFile); + formData.append('ImageName', compressedFile.name); + } catch (err) { + // 如果压缩失败,使用原图 + formData.append('files[]', originalFile); + formData.append('ImageName', originalFile.name); + } + + formData.append('TableId', data.Result_Data.SUGGESTION_ID); + formData.append('TableType', "1302"); + formData.append('ImageType', "1000"); // 1000 为 上传材料 2000的话 是 处理的附件资料 + await uploadAHYDPicture(formData) + } + + setConfirmLoading(false) + } + await handleUpdateAddAPPLYAPPROVE('add', data.Result_Data.SUGGESTION_ID) + setConfirmLoading(false) + message.success("同步成功") + actionRef.current?.reload() + setModalVisible(false) + // modalRef?.current?.resetFields() + setReviewType(null) + setFileList([]) + setNextApprovalRoute(null) + setCurrentApprovalRoute(null) + setAllProcessRecord([]) + setProgressList([]) + } else { + setConfirmLoading(false) + message.error(data.Result_Desc) + } + } + + // 获取当前用户信息 + const handleGetUserInfo = async (id: string) => { + const req: any = { + UserIdEncrypted: id + } + const data = await handleGetPassportInfoById(req) + setCurrentUser(data) + return data + } + + // 修改受理状态 即改变status + const handleUpdateStatus = async (record: any) => { + // 审核通过走这个 + if (reviewType === 1 || reviewType === 3) { + console.log('下一环节信息', nextApprovalRoute); + console.log('当前表单数据', record); + + let newOtherDetail: any = {} + if (currentRow?.SUGGESTION_STATE === 1010) { + newOtherDetail = { + FEEDBACK_DATE: moment().format("YYYY-MM-DD HH:mm:ss"), + LEADERSHIP_STAFFID: record.nextPerson, + LEADERSHIP_NAME: record.nextPersonName + } + } + + const req: any = { + ...currentRow, + ...newOtherDetail, + MANAGER_NAME: record?.MANAGER_NAME, + SUGGESTION_INFO: record?.SUGGESTION_INFO, + CHAIRMAN_STAFFID: record?.nextPerson, + CHAIRMAN_NAME: record?.nextPersonName, + SUGGESTION_STATE: currentApprovalRoute?.NEXT_STATE === 9000 ? 9000 : nextApprovalRoute?.APPROVALROUTE_STATE, + LEADERSHIP_INFO: record?.LEADERSHIP_INFO || "", + FEEDBACK_INFO: record?.FEEDBACK_INFO || "", + } + setConfirmLoading(true) + const data: any = await handleSynchroSUGGESTION(req) + setConfirmLoading(false) + if (data.Result_Code === 100) { + if (record?.ATTACHED_MATERIALS && record?.ATTACHED_MATERIALS.length > 0 && currentRow?.SUGGESTION_STATE === 1010) { + for (const file of record?.ATTACHED_MATERIALS) { + const formData = new FormData(); + const originalFile = file.originFileObj || file; + try { + // 压缩图片 + const compressedFile = await resizeImageHalf(originalFile); + // 使用压缩后的文件 + formData.append('files[]', compressedFile); + formData.append('ImageName', compressedFile.name); + } catch (err) { + // 如果压缩失败,使用原图 + formData.append('files[]', originalFile); + formData.append('ImageName', originalFile.name); + } + + formData.append('TableId', currentRow?.SUGGESTION_ID); + formData.append('TableType', "1302"); + formData.append('ImageType', "2000"); // 1000 为 上传材料 2000的话 是 处理的附件资料 + await uploadAHYDPicture(formData) + } + + } + + await handleUpdateAddAPPLYAPPROVE() + message.success(reviewType === 1 ? '审核成功' : reviewType === 2 ? '驳回成功!' : reviewType === 3 ? "受理成功!" : "") + setModalVisible(false) + setCurrentRow(undefined) + setReviewType(null) + setFileList([]) + setNextApprovalRoute(null) + setCurrentApprovalRoute(null) + // modalRef?.current?.resetFields() + + actionRef.current?.reload() + } else { + message.error(data.Result_Desc) + } + } else if (reviewType === 2) { + // 驳回审核走这个 + // 因为这个data是整个流程最完整的过程数组 所以只能驳回到上一步去 + // 取到上一步的状态 + let lastStepDetail: any = allProcessRecord[allProcessRecord.length - 1] + const newStepReq: any = { + ...currentRow, + CHAIRMAN_STAFFID: lastStepDetail?.STAFF_ID, + CHAIRMAN_NAME: lastStepDetail?.STAFF_NAME, + SUGGESTION_STATE: lastStepDetail?.APPLYAPPROVE_TYPE, + } + setConfirmLoading(true) + const newStepData: any = await handleSynchroSUGGESTION(newStepReq) + setConfirmLoading(false) + if (newStepData.Result_Code === 100) { + // 传入reject 里面的APPLYAPPROVE_INFO 就会是9999 就代表驳回 + await handleUpdateAddAPPLYAPPROVE('reject', '', record) + + message.success('驳回成功!') + setModalVisible(false) + setCurrentRow(undefined) + setReviewType(null) + setFileList([]) + setNextApprovalRoute(null) + setCurrentApprovalRoute(null) + // modalRef?.current?.resetFields() + + actionRef.current?.reload() + } else { + message.error(data.Result_Desc) + } + } + } + + // 请求当前流程的完整审核过程 + const handleGetAllProcessRecord = async () => { + const req: any = { + SearchParameter: { + TABLE_ID: currentRow?.SUGGESTION_ID, + TABLE_NAME: "MOBILESERVICE_PLATFORM.T_SUGGESTION", + }, + PageIndex: 1, + PageSize: 999999 + } + const data: any = await handleGetAPPLYAPPROVEList(req) + console.log('当前已经走过的流程', data); + + setAllProcessRecord(data) + let list: any = [] + // 当前的流程 + let currentStatus: number = 0 + if (data && data.length > 0) { + data.forEach((item: any) => { + list.push({ + title: ( + + {item.APPLYAPPROVE_NAME} + + ), + description: item?.APPLYAPPROVE_DATE, + status: "finish" + // description: item?.APPLYAPPROVE_INFO, + // status: item?.APPLYAPPROVE_TYPE === 1 ? 'process' : item?.APPLYAPPROVE_TYPE === 2 ? 'wait' : 'finish', + }) + currentStatus = item.APPLYAPPROVE_TYPE + }) + } + + console.log('SUGGESTIONSTATELISTSUGGESTIONSTATELIST', SUGGESTIONSTATELIST); + + let newSUGGESTIONSTATELIST = JSON.parse(JSON.stringify(SUGGESTIONSTATELIST)) + if (newSUGGESTIONSTATELIST && newSUGGESTIONSTATELIST.length > 0) { + newSUGGESTIONSTATELIST.forEach((item: any) => { + if (item.APPROVALROUTE_STATE === 1000) { + newSUGGESTIONSTATELIST.splice(newSUGGESTIONSTATELIST.indexOf(item), 1) + } + }) + } + console.log('SUGGESTIONSTATELISTSUGGESTIONSTATELIST2', newSUGGESTIONSTATELIST); + // 拿到还没到的流程 和当前的流程数据 + let currentList: any = [] + if (newSUGGESTIONSTATELIST && newSUGGESTIONSTATELIST.length > 0) { + newSUGGESTIONSTATELIST.forEach((item: any) => { + if (currentStatus === 1000) { + if (item.APPROVALROUTE_STATE >= currentStatus) { + currentList.push({ + title: item?.APPROVALROUTE_NAME, + // title: ( + // + // {item.APPLYAPPROVE_NAME} + // + // ), + description: "", + status: "finish" + }) + } + } else { + if (item.APPROVALROUTE_STATE > currentStatus) { + currentList.push({ + title: item?.APPROVALROUTE_NAME, + // title: ( + // + // {item.APPLYAPPROVE_NAME} + // + // ), + description: "", + status: "finish" + }) + } + } + + }) + } + + if (currentList && currentList.length > 0) { + currentList.forEach((item: any, index: number) => { + list.push({ + title: item.title, + description: item.description, + status: index === 0 ? 'process' : "wait" + }) + }) + } + + setProgressList(list) + } + + // 同步审批意见 + const handleUpdateAddAPPLYAPPROVE = async (type?: string, id?: string, record?: any) => { + // type 可能为 add 的时候 说明是新增的 reject 是驳回 + // id 是新增的时候同步 需要id + // record 是驳回的时候需要 需要拿到实际的表单数据 + const req: any = { + TABLE_ID: type === 'add' ? id : currentRow?.SUGGESTION_ID, + TABLE_NAME: "MOBILESERVICE_PLATFORM.T_SUGGESTION", + // APPLYAPPROVE_TYPE: reviewType,// 意见类型 1 审核 2 驳回 3 受理 + APPLYAPPROVE_TYPE: type === 'reject' ? 9999 : type === 'add' ? 1000 : currentApprovalRoute?.APPROVALROUTE_STATE,// 新增为1000 + APPLYAPPROVE_NAME: type === 'reject' ? '驳回流程' : type === 'add' ? '新增流程记录' : currentApprovalRoute?.APPROVALROUTE_NAME || "",// 环节名称 + APPLYAPPROVE_INFO: type === 'reject' ? record?.rejectionOpinion : "",// 审批意见 + APPLYAPPROVE_DATE: moment().format("YYYY-MM-DD HH:mm:ss"),// 审批时间 + STAFF_ID: currentUser?.ID,// 审批人ID + STAFF_NAME: currentUser?.Name,// 审批人姓名 + } + const data = await handleSynchroAPPLYAPPROVE(req) + } + + // 下载附件的方法 + const handleDownloadFile = async (record: any) => { + console.log('recordrecord', record); + if (record?.SUGGESTION_CHANNEL === 1000 || record?.SUGGESTION_CHANNEL === 4000 || record?.SUGGESTION_CHANNEL === 5000) { + // 附件1 + handlePrintByIframe(Attachment1, record) + } else if (record?.SUGGESTION_CHANNEL === 2000) { + // 附件2 + handlePrintByIframe(Attachment2, record) + } else if (record?.SUGGESTION_CHANNEL === 3000) { + // 附件3 + handlePrintByIframe(Attachment3, record) + } + } + + return ( +
+ { + let userInfo: any = {} + if (!currentUser) { + const search = window.location.search; + const addressParams = Object.fromEntries(new URLSearchParams(search).entries()); + userInfo = await handleGetUserInfo(addressParams.UserIdEncrypted) + } + + console.log('paramsparamsparams', params); + const req: any = { + SearchParameter: { + SUGGESTION_TYPES: params?.SUGGESTION_TYPE === "0" ? '1000,1050,4000' : params?.SUGGESTION_TYPE,// 类型 + SUGGESTION_STATES: params?.SUGGESTION_TYPE === "0" ? '' : params?.SUGGESTION_TYPE,// 状态 + CHAIRMAN_STAFFID: currentUser?.ID || userInfo.ID + }, + SortStr: "SUGGESTION_CREATEDATE desc", + PageIndex: 1, + PageSize: "999999" + } + const data = await handleGetSUGGESTIONList(req) + if (data && data.length > 0) { + return { data, success: true } + } + return { data: [], success: true } + }} + toolbar={{ + actions: [ + + ] + }} + /> + + {fileList && fileList.length > 0 &&
+ { + setImagePreviewVisible(vis) + } + + }}> + { + fileList.map((n) => + + ) + } + + +
} + + + { + setModalVisible(false) + modalRef.current?.validateFields().then((res) => { + modalRef.current?.submit() + }) + }} + onCancel={(e) => { + setModalVisible(false) + setCurrentRow(undefined) + setReviewType(null) + setFileList([]) + setNextApprovalRoute(null) + setCurrentApprovalRoute(null) + setAllProcessRecord([]) + setProgressList([]) + // modalRef?.current?.resetFields() + }} + footer={
+ { + currentRow ? + <> + { + reviewType === 1 || reviewType === 3 ? + { + modalRef.current?.validateFields().then((res) => { + handleUpdateStatus(res) + }) + }} + > + + : + reviewType === 2 ? + { + modalRef.current?.validateFields().then((res) => { + handleUpdateStatus(res) + }) + }} + > + + + : '' + } + + : + <> + + + + } +
} + > + { + await handleAddUpdateRecord(res) + }} + request={async () => { + if (currentRow?.SUGGESTION_ID) { + // 拿图片信息 + const req: any = { + TableId: currentRow?.SUGGESTION_ID, + TableType: 1302, + ImageType: "1000" // 1000 为 上传材料 2000的话 是 处理的附件资料 + } + const data = await handleGetPictureList(req) + let list: any = [] + if (data.List && data.List.length > 0) { + data.List.forEach((n: any) => { + list.push({ + url: n.ImageUrl, + name: n.ImageName, + uid: String(n.ImageId), + status: 'done' + }) + }) + setFileList(list) + } + console.log('curr', currentRow); + let attachedMaterialsList: any = [] + if (currentRow?.SUGGESTION_STATE >= 1010) { + const req: any = { + TableId: currentRow?.SUGGESTION_ID, + TableType: 1302, + ImageType: "2000" // 1000 为 上传材料 2000的话 是 处理的附件资料 + } + const data = await handleGetPictureList(req) + if (data.List && data.List.length > 0) { + data.List.forEach((n: any) => { + attachedMaterialsList.push({ + url: n.ImageUrl, + name: n.ImageName, + uid: String(n.ImageId), + status: 'done' + }) + }) + } + } + console.log('attachedMaterialsList', attachedMaterialsList); + + await handleGetAllProcessRecord() + + return { + ...currentRow, + ENUM_LABEL: currentRow?.ENUM_LABEL.split(',').map((item: any) => Number(item)), + SERVERPART_ID: currentRow?.SERVERPART_ID ? String(currentRow?.SERVERPART_ID) : "", + SUGGESTION_TYPE: currentRow?.SUGGESTION_TYPE ? String(currentRow?.SUGGESTION_TYPE) : "", + LOCALEPHOTO: list, + ATTACHED_MATERIALS: attachedMaterialsList + } + } else { + return {} + } + }} + > + + + { + if (serverPartList && serverPartList.length > 0) { + return serverPartList + } else { + const req: any = { + ProvinceCode: "530000", + } + let list: any = [] + const data = await handleGetServerpartDDL(req) + if (data && data.length > 0) { + list = data + setServerPartList(list) + } else { + setServerPartList([]) + } + return list + } + }} + fieldProps={{ + showSearch: true, + filterOption: (input, option) => + (option?.label ?? '').toLowerCase().includes(input.toLowerCase()), + optionFilterProp: 'label', + onChange: async (value: any, option: any) => { + modalRef.current?.setFieldsValue({ SERVERPART_NAME: option.title }) + } + }} + rules={[{ + required: true, + message: '请选择服务区!' + }]} + readonly={reviewType} + /> + + + + + + + { + const taxRateLabel: any = await getFieldEnumTreeNoSession({ FieldExplainField: 'SUGGESTION_CHANNEL', notformate: true }) + console.log('taxRateLabel', taxRateLabel); + + return taxRateLabel + }} + rules={[{ + required: true, + message: '请选择投诉渠道!' + }]} + readonly={reviewType} + /> + + + + { + return [ + { + label: "投诉", + value: "1000" + }, + { + label: "表扬", + value: "1050" + }, + { + label: "咨询/建议", + value: "4000" + } + ] + }} + rules={[{ + required: true, + message: '请选择投诉类型!' + }]} + readonly={reviewType} + /> + + + + { + const taxRateLabel: any = await getFieldEnumTreeNoSession({ FieldExplainField: 'BUSINESS_TARGET', notformate: true }) + let list: any = addDisabledIfHasChildren(taxRateLabel) + return list + }} + fieldProps={{ + treeDefaultExpandAll: true, + multiple: true, + }} + rules={[ + { + required: true, + message: '请选择标签', + }, + ]} + readonly={reviewType} + /> + + + + + + + + + + + + + + + + + + + { + // if (info.file.status === 'removed') { + // confirm({ + // title: '确认删除该图片吗?', + // icon: , + // async onOk() { + + + // const req: any = { + // ImagePath: info.file.path, + // TableType: '5000', + // } + // const data = await handleDeletePicture(req) + // if (data) { + // message.success('删除成功!') + // let list: any = JSON.parse(JSON.stringify(fileList)) + // let res: any = [] + // if (list && list.length > 0) { + // list.forEach((item: any) => { + // if (item.url === info.file.url) { + + // } else { + // res.push(item) + // } + // }) + // } + // setFileList(res) + // } + // } + // }); + // } + } + }} + /> + + + {/* 状态1010 即 项目管理单元安全员 的时候 出现 核实情况,处置结果,附件资料 */} + { + currentRow?.SUGGESTION_STATE >= 1010 ? + <> + + 1010} + /> + + + 1010} + /> + + + 1010} + /> + + + 1010} + /> + + + 1010} + fieldProps={{ + maxCount: 9 + }} + /> + + : "" + } + + { + reviewType !== 2 && currentRow && currentRow?.SUGGESTION_STATE !== 9000 && currentApprovalRoute?.NEXT_STATE !== 9000 ? + + { + console.log('SUGGESTIONSTATELIST', SUGGESTIONSTATELIST); + console.log('currentRow', currentRow); + let currentObj: any = {} // 当前环节的配置信息 + let nextStausId: any = "" + let nextStatusObj: any = "" + if (SUGGESTIONSTATELIST && SUGGESTIONSTATELIST.length > 0) { + SUGGESTIONSTATELIST.forEach((item: any) => { + if (Number(item.APPROVALROUTE_STATE) === Number(currentRow?.SUGGESTION_STATE)) { + nextStausId = Number(item.NEXT_STATE) + currentObj = item + } + + }) + + SUGGESTIONSTATELIST.forEach((item: any) => { + if (item.APPROVALROUTE_STATE === nextStausId) { + nextStatusObj = item + } + }) + console.log('下一环节配置', nextStatusObj); + console.log('当前环节配置', currentObj); + setNextApprovalRoute(nextStatusObj) + setCurrentApprovalRoute(currentObj) + let idList: any = nextStatusObj?.APPROVALSTAFF_ID ? nextStatusObj?.APPROVALSTAFF_ID.split(',') : [] + let nameList: any = nextStatusObj?.APPROVALSTAFF_NAME ? nextStatusObj?.APPROVALSTAFF_NAME.split(',') : [] + let list: any = [] + if (idList && idList.length > 0 && nameList && nameList.length > 0) { + let count: number = idList.length + for (let i = 0; i < count; i++) { + list.push({ label: nameList[i], value: idList[i] }) + } + } + console.log('listlistlist', list); + + return list + } else { + return [] + } + }} + fieldProps={{ + showSearch: true, + filterOption: (input, option) => + (option?.label ?? '').toLowerCase().includes(input.toLowerCase()), + optionFilterProp: 'label', + onChange: (e, option: any) => { + modalRef.current?.setFieldsValue({ nextPersonName: option.title }) + } + }} + /> + : "" + } + + {/* 出现驳回意见 */} + { + (currentRow?.SUGGESTION_STATE > 1010 && reviewType === 2) ? + + + : "" + } + + + + + + { + currentRow ? +
+
流程进度
+
+ + +
+
: "" + } +
+
+
+ ); +}; + +export default ComplaintForwardingProcessReview; diff --git a/src/pages/ComplaintForwardingProcess/downFile.tsx b/src/pages/ComplaintForwardingProcess/downFile.tsx new file mode 100644 index 0000000..e90520f --- /dev/null +++ b/src/pages/ComplaintForwardingProcess/downFile.tsx @@ -0,0 +1,287 @@ +import moment from 'moment'; +import React from 'react'; +import ReactDOM from 'react-dom'; + +let SUGGESTION_TYPEOBJ: any = { + 1000: "小程序", + 2000: "12328交通运输", + 3000: "网络舆情", + 4000: "监控中心值班电话", + 5000: "话务转办", +} + +// 附件1 结构 +export const Attachment1 = ({ record }: { record: any }) => { + // 根据 record 数据处理显示逻辑 + return ( +
+
附件1:投诉受理工单
+
编号:{record?.SUGGESTION_CODE || ''}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
投诉人{record?.SUGGESTION_NAME || ''}联系电话{record?.PHONE_NUMBER || ''}
受理部门{record?.DISPOSITION_PERSON || ''}受理时间{record?.OPERATE_DATE ? moment(record?.OPERATE_DATE).format('YYYY-MM-DD HH:mm:ss') : ''}
转办部门{record?.MANAGER_NAME || ''}来电类别{record?.SUGGESTION_TYPE ? SUGGESTION_TYPEOBJ[Number(record?.SUGGESTION_TYPE)] : ''}
来电内容{record?.SUGGESTION_REASON || ''}
转办要求{record?.SUGGESTION_INFO || ''}
处理反馈结果(可附页) +
+
{record?.FEEDBACK_INFO || ''}
+
+ 反馈人:{record?.LEADERSHIP_NAME || ''} 时间:{record?.FEEDBACK_DATE ? moment(record?.FEEDBACK_DATE).format('YYYY年MM月DD日 HH时mm分') : ''} +
+
+
+
备注:投诉受理工单根据全年投诉发生的时间先后排序,并以彩云驿CYY、投诉GY、年份、工单编号(0001以此类推)。
+
+ ); +}; + +// 附件2 结构 +export const Attachment2 = ({ record }: { record: any }) => ( +
+
“12328”交通运输服务监督电话话务转办单
+
编号:{record?.SUGGESTION_CODE || ''}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
来电人{record?.SUGGESTION_NAME || ''}联系电话{record?.PHONE_NUMBER || ''}
受理部门{record?.SERVERPART_NAME || ''}受理时间{record?.SUGGESTION_CREATEDATE || ''}
转办单位{record?.MANAGER_NAME || ''}来电类别{record?.SUGGESTION_TYPE ? SUGGESTION_TYPEOBJ[Number(record?.SUGGESTION_TYPE)] : ''}
来电内容 +
+
{record?.SUGGESTION_REASON || ''}
+
+
转办要求 +
+
{record?.SUGGESTION_INFO || ''}
+
+ 转办人:{record?.DISPOSITION_PERSON || ''} 时间:{record?.OPERATE_DATE ? moment(record?.OPERATE_DATE).format('YYYY年MM月DD日 HH时mm分') : ''} +
+
+
处理反馈结果(可附页) +
+
{record?.FEEDBACK_INFO || ''}
+
+ 反馈人:{record?.LEADERSHIP_NAME || ''} 时间:{record?.FEEDBACK_DATE ? moment(record?.FEEDBACK_DATE).format('YYYY年MM月DD日 HH时mm分') : ''} +
+
+
+
+); + +// 附件3 结构 +export const Attachment3 = ({ record }: { record: any }) => ( +
+
网络舆情处置报告书
+
反馈时间:{record?.SUGGESTION_CREATEDATE ? moment(record?.SUGGESTION_CREATEDATE).format('YYYY年MM月DD日 HH时mm分') : ''}
+ + + + + + + + + + + + + + + + + + + + + + + + + +
反馈单位(加盖公章){record?.MANAGER_NAME || ''}
签发人{record?.LEADERSHIP_NAME || ''}
联系人{record?.LEADERSHIP_NAME || ''}手机号码{record?.PHONE_NUMBER || ''}
舆情概况 +
+
{record?.SUGGESTION_REASON || ''}
+
+
核实及处置情况(可另附页) +
+
{record?.SUGGESTION_INFO || ''}
+
+
+
+); + +// 打印函数 +export const handlePrintByIframe = (AttachmentComponent: React.ComponentType, record: any) => { + const iframe = document.createElement('iframe'); + iframe.style.position = 'fixed'; + iframe.style.right = '0'; + iframe.style.bottom = '0'; + iframe.style.width = '0'; + iframe.style.height = '0'; + iframe.style.border = '0'; + document.body.appendChild(iframe); + + const iframeDoc = iframe.contentWindow?.document; + if (!iframeDoc) return; + + iframeDoc.open(); + iframeDoc.write(` + + + 打印预览 + + + + + + + `); + iframeDoc.close(); + + const printRoot = iframeDoc.getElementById('print-root'); + if (printRoot) { + ReactDOM.render(React.createElement(AttachmentComponent, { record }), printRoot); + } + + setTimeout(() => { + iframe.contentWindow?.focus(); + iframe.contentWindow?.print(); + setTimeout(() => { + document.body.removeChild(iframe); + }, 1000); + }, 300); +}; diff --git a/src/pages/ComplaintForwardingProcess/index.less b/src/pages/ComplaintForwardingProcess/index.less index a91e7e4..a2dd9eb 100644 --- a/src/pages/ComplaintForwardingProcess/index.less +++ b/src/pages/ComplaintForwardingProcess/index.less @@ -5,10 +5,8 @@ */ .custom-steps { - .ant-steps { - display: flex !important; - flex-wrap: wrap !important; - } + display: flex !important; + flex-wrap: wrap !important; .ant-steps-item { flex: none !important; diff --git a/src/pages/ComplaintForwardingProcess/index.tsx b/src/pages/ComplaintForwardingProcess/index.tsx index 8cd01dd..24deb2f 100644 --- a/src/pages/ComplaintForwardingProcess/index.tsx +++ b/src/pages/ComplaintForwardingProcess/index.tsx @@ -1,12 +1,15 @@ +// 受理页面 import { ActionType, FormInstance, ProForm, ProFormSelect, ProFormText, ProFormTextArea, ProFormTreeSelect, ProFormUploadButton, ProTable } from "@ant-design/pro-components"; import "./index.less"; import { useRef, useState } from "react"; -import { Button, Col, message, Modal, Row, Image, Space, Popconfirm, Steps, Tooltip } from "antd"; +import { Button, Col, message, Modal, Row, Image, Space, Popconfirm, Steps, Tooltip, Popover } from "antd"; import { ExclamationCircleOutlined, PlusOutlined } from "@ant-design/icons"; import { getFieldEnum, getFieldEnumTreeNoSession, handleDeletePicture, handleDeleteSUGGESTION, handleGetAPPLYAPPROVEList, handleGetAPPROVALROUTEList, handleGetPictureList, handleGetServerpartDDL, handleGetSUGGESTIONList, handleSynchroAPPLYAPPROVE, handleSynchroSUGGESTION, uploadAHYDPicture } from "../serverpartAssets/service"; import moment from "moment"; import { resizeImageHalf } from "./resizeImageHalf"; import { handleGetPassportInfoById } from "../DigitalElectronics/service"; +import { Attachment1, Attachment2, Attachment3, handlePrintByIframe } from "./downFile"; +import { request } from "express"; const beforeUpload = (file: any) => { @@ -72,6 +75,20 @@ const ComplaintForwardingProcess = () => { }, initialValue: "0" }, + { + title: "投诉渠道", + width: 120, + dataIndex: "SUGGESTION_CHANNEL", + valueType: "select", + align: 'center', + hideInSearch: true, + request: async () => { + const taxRateLabel: any = await getFieldEnumTreeNoSession({ FieldExplainField: 'SUGGESTION_CHANNEL', notformate: true }) + console.log('taxRateLabel', taxRateLabel); + + return taxRateLabel + }, + }, { title: "服务区", width: 120, @@ -96,6 +113,20 @@ const ComplaintForwardingProcess = () => { hideInSearch: true, ellipsis: true, }, + { + title: "处理状态", + width: 120, + align: 'center', + dataIndex: "SUGGESTION_STATE", + valueType: "select", + valueEnum: { + "0": "全部", + "1000": "待受理", + }, + hideInTable: true, + ellipsis: true, + initialValue: "0" + }, { title: "处理状态", width: 120, @@ -115,7 +146,7 @@ const ComplaintForwardingProcess = () => { } const data = await handleGetAPPROVALROUTEList(req) console.log('dsjakdjaslkd', data); - setSUGGESTIONSTATELIST(data) + setSUGGESTIONSTATELIST(JSON.parse(JSON.stringify(data))) setLastApprovalRoute(data[data.length - 1]) if (data && data.length > 0) { let list: any = [] @@ -123,14 +154,15 @@ const ComplaintForwardingProcess = () => { list.push({ label: item.APPROVALROUTE_NAME, value: item.APPROVALROUTE_STATE }) }) list.unshift({ label: "待受理", value: 1000 }) - list.push({ label: "已审结", value: 2000 }) - list.push({ label: "已审结", value: 3000 }) + list.push({ label: "已审结", value: 9000 }) return list } else { return [] } }, - ellipsis: true + hideInSearch: true, + ellipsis: true, + initialValue: "0" }, { title:
详细描述
, @@ -138,6 +170,13 @@ const ComplaintForwardingProcess = () => { dataIndex: "SUGGESTION_REASON", hideInSearch: true, ellipsis: true, + render: (_, record) => { + return record?.SUGGESTION_REASON ? + { + setCurrentRow(record) + setModalVisible(true) + }}>{record?.SUGGESTION_REASON} : "" + } }, { title:
发起时间
, @@ -189,14 +228,14 @@ const ComplaintForwardingProcess = () => { // 若当前记录流程 为最审结状态 那么就出现下载附件下载 lastApprovalRoute && lastApprovalRoute.NEXT_STATE === record.SUGGESTION_STATE ? { - + handleDownloadFile(record) }}> 下载附件 : "" } {/* 一般情况下注释掉 */} - { + {/* { const req = { SUGGESTIONId: record.SUGGESTION_ID } @@ -207,7 +246,7 @@ const ComplaintForwardingProcess = () => { } else { message.error(res.Result_Desc) } - }}>删除 + }}>删除 */} } } @@ -246,8 +285,8 @@ const ComplaintForwardingProcess = () => { } } else { req = { + SUGGESTION_CHANNEL: res.SUGGESTION_CHANNEL, SUGGESTION_TYPE: res.SUGGESTION_TYPE, - SUGGESTION_CHANNEL: "1", // 小程序上应该是空 后台我就写 1 SERVERPART_ID: res.SERVERPART_ID, PROVINCE_CODE: "530000", MEMBERSHIP_ID: currentUser?.ID || "", @@ -259,6 +298,8 @@ const ComplaintForwardingProcess = () => { SUGGESTION_CREATEDATE: moment().format("YYYY-MM-DD HH:mm:ss"), SUGGESTION_STATE: 1000, // 1000 为待受理状态 OPERATE_DATE: moment().format("YYYY-MM-DD HH:mm:ss"), + DISPOSITION_PERSON: res?.DISPOSITION_PERSON || "", + CHAIRMAN_STAFFID: currentUser?.ID || "", } } setConfirmLoading(true) @@ -296,7 +337,7 @@ const ComplaintForwardingProcess = () => { message.success("同步成功") actionRef.current?.reload() setModalVisible(false) - modalRef.current?.resetFields() + // modalRef?.current?.resetFields() setReviewType(null) setFileList([]) setNextApprovalRoute(null) @@ -325,13 +366,27 @@ const ComplaintForwardingProcess = () => { if (reviewType === 1 || reviewType === 3) { console.log('下一环节信息', nextApprovalRoute); console.log('当前表单数据', record); + + let newOtherDetail: any = {} + if (currentRow?.SUGGESTION_STATE === 1010) { + newOtherDetail = { + FEEDBACK_DATE: moment().format("YYYY-MM-DD HH:mm:ss"), + LEADERSHIP_STAFFID: record.nextPerson, + LEADERSHIP_NAME: record.nextPersonName + } + } + const req: any = { ...currentRow, + ...newOtherDetail, + MANAGER_NAME: record?.MANAGER_NAME, + SUGGESTION_INFO: record?.SUGGESTION_INFO, CHAIRMAN_ID: record?.nextPerson, CHAIRMAN_NAME: record?.nextPersonName, - SUGGESTION_STATE: nextApprovalRoute?.APPROVALROUTE_STATE, + SUGGESTION_STATE: currentApprovalRoute?.NEXT_STATE === 9000 ? 9000 : nextApprovalRoute?.APPROVALROUTE_STATE, LEADERSHIP_INFO: record?.LEADERSHIP_INFO || "", - FEEDBACK_INFO: record?.FEEDBACK_INFO || "" + FEEDBACK_INFO: record?.FEEDBACK_INFO || "", + CHAIRMAN_STAFFID: record?.nextPerson, } setConfirmLoading(true) const data: any = await handleSynchroSUGGESTION(req) @@ -369,7 +424,7 @@ const ComplaintForwardingProcess = () => { setFileList([]) setNextApprovalRoute(null) setCurrentApprovalRoute(null) - modalRef.current?.resetFields() + // modalRef?.current?.resetFields() actionRef.current?.reload() } else { @@ -400,7 +455,7 @@ const ComplaintForwardingProcess = () => { setFileList([]) setNextApprovalRoute(null) setCurrentApprovalRoute(null) - modalRef.current?.resetFields() + // modalRef?.current?.resetFields() actionRef.current?.reload() } else { @@ -429,7 +484,11 @@ const ComplaintForwardingProcess = () => { if (data && data.length > 0) { data.forEach((item: any) => { list.push({ - title: item?.APPLYAPPROVE_NAME, + title: ( + + {item.APPLYAPPROVE_NAME} + + ), description: item?.APPLYAPPROVE_DATE, status: "finish" // description: item?.APPLYAPPROVE_INFO, @@ -439,18 +498,39 @@ const ComplaintForwardingProcess = () => { }) } - console.log('SUGGESTIONSTATELISTSUGGESTIONSTATELIST', SUGGESTIONSTATELIST); + let newSUGGESTIONSTATELIST = JSON.parse(JSON.stringify(SUGGESTIONSTATELIST)) + // 若有两个1000 的话 去掉 监控受理中心的1000 + if (newSUGGESTIONSTATELIST && newSUGGESTIONSTATELIST.length > 0) { + newSUGGESTIONSTATELIST.forEach((item: any) => { + if (item.APPROVALROUTE_STATE === 1000 && currentRow?.SUGGESTION_STATE !== 1000) { + newSUGGESTIONSTATELIST.splice(newSUGGESTIONSTATELIST.indexOf(item), 1) + } + }) + } + console.log('SUGGESTIONSTATELISTSUGGESTIONSTATELIST2', newSUGGESTIONSTATELIST); // 拿到还没到的流程 和当前的流程数据 let currentList: any = [] - if (SUGGESTIONSTATELIST && SUGGESTIONSTATELIST.length > 0) { - SUGGESTIONSTATELIST.forEach((item: any) => { - if (item.APPROVALROUTE_STATE > currentStatus) { - currentList.push({ - title: item?.APPROVALROUTE_NAME, - description: "", - status: "finish" - }) + if (newSUGGESTIONSTATELIST && newSUGGESTIONSTATELIST.length > 0) { + newSUGGESTIONSTATELIST.forEach((item: any) => { + + if (currentStatus === 1000) { + if (item.APPROVALROUTE_STATE >= currentStatus) { + currentList.push({ + title: item?.APPROVALROUTE_NAME, + description: "", + status: "finish" + }) + } + } else { + if (item.APPROVALROUTE_STATE > currentStatus) { + currentList.push({ + title: item?.APPROVALROUTE_NAME, + description: "", + status: "finish" + }) + } } + }) } @@ -464,7 +544,6 @@ const ComplaintForwardingProcess = () => { }) } - console.log('currentList', currentList); setProgressList(list) } @@ -487,6 +566,21 @@ const ComplaintForwardingProcess = () => { const data = await handleSynchroAPPLYAPPROVE(req) } + // 下载附件的方法 + const handleDownloadFile = async (record: any) => { + console.log('recordrecord', record); + if (record?.SUGGESTION_CHANNEL === 1000 || record?.SUGGESTION_CHANNEL === 4000 || record?.SUGGESTION_CHANNEL === 5000) { + // 附件1 + handlePrintByIframe(Attachment1, record) + } else if (record?.SUGGESTION_CHANNEL === 2000) { + // 附件2 + handlePrintByIframe(Attachment2, record) + } else if (record?.SUGGESTION_CHANNEL === 3000) { + // 附件3 + handlePrintByIframe(Attachment3, record) + } + } + return (
{ headerTitle={'流程审批'} search={{ span: 6 }} request={async (params) => { + let userInfo: any = {} if (!currentUser) { const search = window.location.search; const addressParams = Object.fromEntries(new URLSearchParams(search).entries()); - await handleGetUserInfo(addressParams.UserIdEncrypted) + userInfo = await handleGetUserInfo(addressParams.UserIdEncrypted) } console.log('paramsparamsparams', params); const req: any = { SearchParameter: { SUGGESTION_TYPES: params?.SUGGESTION_TYPE === "0" ? '1000,1050,4000' : params?.SUGGESTION_TYPE,// 类型 - SUGGESTION_STATES: params?.SUGGESTION_TYPE === "0" ? '' : params?.SUGGESTION_TYPE,// 状态 + SUGGESTION_STATES: params?.SUGGESTION_STATE === "0" || !params?.SUGGESTION_STATE ? '1000' : params?.SUGGESTION_STATE,// 状态 + // CHAIRMAN_STAFFID: currentUser?.ID || userInfo.ID }, SortStr: "SUGGESTION_CREATEDATE desc", PageIndex: 1, @@ -585,7 +681,7 @@ const ComplaintForwardingProcess = () => { setCurrentApprovalRoute(null) setAllProcessRecord([]) setProgressList([]) - modalRef.current?.resetFields() + // modalRef?.current?.resetFields() }} footer={
{ @@ -622,7 +718,7 @@ const ComplaintForwardingProcess = () => {