From 678b15974cf4dd0eb130b2677b8a992358b6152f Mon Sep 17 00:00:00 2001 From: dminyi <1301963064@qq.com> Date: Wed, 11 Sep 2024 11:11:17 +0800 Subject: [PATCH] Merge branch 'master' of http://120.79.193.119:9090/r/gzzfw/frontEnd/gzDyh into master --- gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx | 9 + gz-customerSystem/src/views/register/matterDetail/FileTable.jsx | 79 +++------ gz-customerSystem/src/views/register/visit/preview.jsx | 4 gz-customerSystem/src/api/appUrl.js | 2 gz-customerSystem/src/views/register/visit/index.jsx | 318 +++++++++++++++++++------------------- gz-customerSystem/src/views/register/matterDetail/NewFileCheck.jsx | 4 gz-customerSystem/src/views/register/eventFlow/component/Examine.jsx | 9 + 7 files changed, 211 insertions(+), 214 deletions(-) diff --git a/gz-customerSystem/src/api/appUrl.js b/gz-customerSystem/src/api/appUrl.js index 3740dcd..716b3ee 100644 --- a/gz-customerSystem/src/api/appUrl.js +++ b/gz-customerSystem/src/api/appUrl.js @@ -2,7 +2,7 @@ * @Company: hugeInfo * @Author: ldh * @Date: 2022-02-16 11:25:57 - * @LastEditTime: 2024-09-11 09:07:08 + * @LastEditTime: 2024-09-11 11:09:56 * @LastEditors: dminyi 1301963064@qq.com * @Version: 1.0.0 * @Description: api地址 diff --git a/gz-customerSystem/src/views/register/eventFlow/component/Examine.jsx b/gz-customerSystem/src/views/register/eventFlow/component/Examine.jsx index a93a3b7..4a2727f 100644 --- a/gz-customerSystem/src/views/register/eventFlow/component/Examine.jsx +++ b/gz-customerSystem/src/views/register/eventFlow/component/Examine.jsx @@ -118,7 +118,14 @@ <Col span={24}> <div><div className="title-text">附件材料</div></div> <div style={{ color: '#1A6FB8' }}> - <img src={link} alt="" className="title-file" />{infoData?.file || '-'} + {infoData?.fileInfoList?.map(res => { + return res.fileList.map((result, resIndex) => { + return <a href="your-link-here.html" target="_blank"> + <img src={link} alt="" className="title-file" />{result.trueName} + {resIndex !== res.fileList.length - 1 && <>,</>} + </a> + }) + })} </div> </Col> <Col span={24}> diff --git a/gz-customerSystem/src/views/register/matterDetail/FileTable.jsx b/gz-customerSystem/src/views/register/matterDetail/FileTable.jsx index f311a3b..aea5435 100644 --- a/gz-customerSystem/src/views/register/matterDetail/FileTable.jsx +++ b/gz-customerSystem/src/views/register/matterDetail/FileTable.jsx @@ -111,8 +111,8 @@ 查看 </Link> {!props.isReview && <Link onClick={() => { - if (record.fileInfoList && record.fileInfoList.length != 0) { - let ids = record.fileInfoList?.map(item => item.id).join(',') + if (record.fileList && record.fileList.length != 0) { + let ids = record.fileList?.map(item => item.id).join(',') handleDelete(ids) } else { $$.info({ type: 'warning', content: '还没上传关于该材料的文件!' }); @@ -121,8 +121,8 @@ 删除 </Link>} <Link onClick={() => { - if (record.fileInfoList && record.fileInfoList.length != 0) { - let ids = record.fileInfoList?.map(item => item.id).join(',') + if (record.fileList && record.fileList.length != 0) { + let ids = record.fileList?.map(item => item.id).join(',') handleDownlod(ids) } else { $$.info({ type: 'warning', content: '还没上传关于该材料的文件!' }); @@ -131,11 +131,12 @@ 下载 </Link> {!props.isReview && <Link onClick={() => { + console.log(record); setSourceType(record.ownerType) setUpLoadVisible(true) - setFileInfoList(record.fileInfoList) + setFileInfoList(record.fileList) setTimeout(() => { - formRef.current.setFieldValue('file', record.fileInfoList) + formRef.current.setFieldValue('file', record.fileList) }, 0) }}> 上传 @@ -151,6 +152,7 @@ ] useEffect(() => { + console.log(props.fileInfoList); if (props.fileInfoList && props.fileInfoList.length != 0) { //证明材料 const applyFile = props.fileInfoList.find(item => item.ownerType == "22_00018-101") @@ -167,7 +169,7 @@ size: applyFile.fileList.length, fileNames: applyFile.fileList?.map(item => item.trueName).join(','), updateTime: $$.timeFormat(applyFile.fileList[applyFile.fileList.length - 1].updateTime), - fileInfoList: applyFile.fileList.map(item => { + fileList: applyFile.fileList.map(item => { return { ...item, uid: item.id, @@ -182,7 +184,7 @@ size: evidenceFile.fileList.length, fileNames: evidenceFile.fileList?.map(item => item.trueName).join(','), updateTime: $$.timeFormat(evidenceFile.fileList[evidenceFile.fileList.length - 1].updateTime), - fileInfoList: evidenceFile.fileList.map(item => { + fileList: evidenceFile.fileList.map(item => { return { ...item, uid: item.id, @@ -218,51 +220,30 @@ //上传弹窗完成后的事件 const handleUpload = () => { - const newList = tableData.map(item => { - if (item.ownerType == '22_00018-101') { - const data = fileMap['22_00018-101']; - if (data?.length > 0) { - return { - ...item, - size: data.length, - fileNames: data.map(item => item.trueName).join(','), - updateTime: $$.timeFormat(data[data.length - 1].updateTime), - fileInfoList: data.map(item => { - return { - ...item, - name: item.trueName, - uid: item.id, - } - }), - } - } else { - return item + if (item.ownerType == sourceType) { + const data = fileMap[sourceType] + return { + ...item, + size: data.length, + fileNames: data.map(item => item.trueName).join(','), + updateTime: $$.timeFormat(data[data.length - 1].updateTime), + fileList: data.map(item => { + return { + ...item, + name: item.trueName, + uid: item.id, + } + }), } - - } - if (item.ownerType == '22_00018-102') { - const data = fileMap['22_00018-102'] || []; - if (data?.length > 0) { - return { - ...item, - size: data.length, - fileNames: data.map(item => item.trueName).join(','), - updateTime: $$.timeFormat(data[data.length - 1].updateTime), - fileInfoList: data.map(item => { - return { - ...item, - name: item.trueName, - uid: item.id, - } - }), - } - } else { - return item - } + } else { + return item } }) - + //回传文件数据的时候使用 + if(props.handleSaveList) { + props.handleSaveList(newList) + } setTableData(newList) setUpLoadVisible(false); }; diff --git a/gz-customerSystem/src/views/register/matterDetail/NewFileCheck.jsx b/gz-customerSystem/src/views/register/matterDetail/NewFileCheck.jsx index ebabd3c..3f7d827 100644 --- a/gz-customerSystem/src/views/register/matterDetail/NewFileCheck.jsx +++ b/gz-customerSystem/src/views/register/matterDetail/NewFileCheck.jsx @@ -120,9 +120,9 @@ {props.menuList?.map(item => { return <SubMenu key={item.id} - title={item.ownerTypeName + `(${item.fileInfoList && item.fileInfoList.length || 0})`} + title={item.ownerTypeName + `(${item.fileList && item.fileList.length || 0})`} > - {item.fileInfoList?.map(res => { + {item.fileList?.map(res => { return <MenuItem key={res.id} onClick={() => { clickItem(res) }}>{res.trueName}</MenuItem> })} </SubMenu> diff --git a/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx b/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx index 7459653..b561dac 100644 --- a/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx +++ b/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx @@ -393,7 +393,14 @@ </Space> </Col> <div style={{ marginBottom: '65px' }}> - <FileTable mainId={props.mainId} fileInfoList={props.fileInfoList} isReview={false} /> + <FileTable + mainId={props.mainId} + fileInfoList={props.fileInfoList} + isReview={false} + handleSaveList={(list) => { + props.formRef.current.setFieldValue('fileInfoList', list) + }} + /> </div> <DocumentScanner visible={scanFile} diff --git a/gz-customerSystem/src/views/register/visit/index.jsx b/gz-customerSystem/src/views/register/visit/index.jsx index e17a256..08aa69f 100644 --- a/gz-customerSystem/src/views/register/visit/index.jsx +++ b/gz-customerSystem/src/views/register/visit/index.jsx @@ -38,57 +38,57 @@ const Organization = (props) => { - const formRef = useRef(); - const routeData = useParams(); - const navigate = useNavigate(); - const [isReview, setIsReview] = useState(false);//预览页面控制 - const [current, setCurrent] = useState(1); - const [id, setId] = useState(); - const [editData, setEditData] = useState({});//回显数据 + const formRef = useRef(); + const routeData = useParams(); + const navigate = useNavigate(); + const [isReview, setIsReview] = useState(false);//预览页面控制 + const [current, setCurrent] = useState(1); + const [id, setId] = useState(); + const [editData, setEditData] = useState({});//回显数据 - useEffect(() => { - if (routeData.id) { - getDeatil(routeData.id) - setId(routeData.id) - } else { - getAppId() - } + useEffect(() => { + if (routeData.id) { + getDeatil(routeData.id) + setId(routeData.id) + } else { + getAppId() + } - }, []) + }, []) - //编辑 - const getDeatil = async (id) => { - const res = await getDetailData(id) - if (res.type) { - const { agentList, personList, ...rest } = res.data - const parList = agentList.concat(personList) - const obj = { - ...rest, - fakeData: parList, - myCaseType: [rest.caseTypeFirst, rest.caseType], - myQuesAddress: rest.queRoad ? [rest.queProv, rest.queCity, rest.queArea, rest.queRoad] : undefined - } - formRef.current.setFieldsValue(obj) - setEditData(obj) - } - } + //编辑 + const getDeatil = async (id) => { + const res = await getDetailData(id) + if (res.type) { + const { agentList, personList, ...rest } = res.data + const parList = agentList.concat(personList) + const obj = { + ...rest, + fakeData: parList, + myCaseType: [rest.caseTypeFirst, rest.caseType], + myQuesAddress: rest.queRoad ? [rest.queProv, rest.queCity, rest.queArea, rest.queRoad] : undefined + } + formRef.current.setFieldsValue(obj) + setEditData(obj) + } + } - //获取id - const getAppId = async () => { - const res = await getId() - if (res.type) { - setId(res.data) - } - } + //获取id + const getAppId = async () => { + const res = await getId() + if (res.type) { + setId(res.data) + } + } - //提交信息,需要校验规则 - const handleSubmit = async () => { - if (formRef.current) { - formRef.current.validate(undefined, (errors, values) => { - if (!errors) { - const { myCaseType, myQuesAddress, ...rest } = formRef.current.getFields() - const params = handleData(rest) - $$.modalInfo({ + //提交信息,需要校验规则 + const handleSubmit = async () => { + if (formRef.current) { + formRef.current.validate(undefined, (errors, values) => { + if (!errors) { + const { myCaseType, myQuesAddress, ...rest } = formRef.current.getFields() + const params = handleData(rest) + $$.modalInfo({ title: '提醒', content: '确定提交吗?', cancelText: '我再想想', @@ -101,126 +101,126 @@ }) }, }); - } - }); - } - } + } + }); + } + } - //保存草稿信息,不需要校验规则 - const handleSave = () => { - if (formRef.current) { - const { myCaseType, myQuesAddress, ...rest } = formRef.current.getFields() - const params = handleData(rest) - requestSave(params) - } - } + //保存草稿信息,不需要校验规则 + const handleSave = () => { + if (formRef.current) { + const { myCaseType, myQuesAddress, ...rest } = formRef.current.getFields() + const params = handleData(rest) + requestSave(params) + } + } - //数据处理 - const handleData = (data) => { - const { fakeData, ...newObj } = data - if (data.id) { - return { - ...newObj, - personList: fakeData?.filter(item => item.perType === "15_020008-1" || item.perType === "15_020008-2"), - agentList: fakeData?.filter(item => item.perType === "24_00006-1" || item.perType === "24_00006-2").map(item => { - return { - ...item, - personId: item.personId.join(',') - } - }), - } - } else { - return { - ...newObj, - personList: fakeData?.filter(item => item.perType === "15_020008-1" || item.perType === "15_020008-2"), - agentList: fakeData?.filter(item => item.perType === "24_00006-1" || item.perType === "24_00006-2").map(item => { - return { - ...item, - personId: item.personId.join(',') - } - }), - id: id - } - } - } + //数据处理 + const handleData = (data) => { + const { fakeData, ...newObj } = data + if (data.id) { + return { + ...newObj, + personList: fakeData?.filter(item => item.perType === "15_020008-1" || item.perType === "15_020008-2"), + agentList: fakeData?.filter(item => item.perType === "24_00006-1" || item.perType === "24_00006-2").map(item => { + return { + ...item, + personId: item.personId.join(',') + } + }), + } + } else { + return { + ...newObj, + personList: fakeData?.filter(item => item.perType === "15_020008-1" || item.perType === "15_020008-2"), + agentList: fakeData?.filter(item => item.perType === "24_00006-1" || item.perType === "24_00006-2").map(item => { + return { + ...item, + personId: item.personId.join(',') + } + }), + id: id + } + } + } - //预览信息 - const handleReview = () => { - setIsReview(!isReview) - } + //预览信息 + const handleReview = () => { + setIsReview(!isReview) + } - function selfAcceptance() { - $$.modalInfo({ - title: '自行受理确认', - content: '确定自行受理吗?', - okText: '确定受理', - cancelText: '我再想想', - onOk: async () => { - setCurrent(3); - navigate(`mediate/visit/handleFeedback`, { replace: true }) - }, - }); - } + function selfAcceptance() { + $$.modalInfo({ + title: '自行受理确认', + content: '确定自行受理吗?', + okText: '确定受理', + cancelText: '我再想想', + onOk: async () => { + setCurrent(3); + navigate(`mediate/visit/handleFeedback`, { replace: true }) + }, + }); + } - //保存请求 - const requestSave = async (data) => { - const response = await saveDispute(data) - if (response.type) { - Message.success('保存草稿成功!') - } - } + //保存请求 + const requestSave = async (data) => { + const response = await saveDispute(data) + if (response.type) { + Message.success('保存草稿成功!') + } + } - //提交请求 - const reauestSubmit = async (data) => { - const response = await submitDispute(data) - if (response.type) { - Message.success('提交成功!') - navigate(`/mediate/visit/visitWorkBench`, { replace: true }) - setCurrent(2) - } - } + //提交请求 + const reauestSubmit = async (data) => { + const response = await submitDispute(data) + if (response.type) { + Message.success('提交成功!') + navigate(`/mediate/visit/visitWorkBench`, { replace: true }) + setCurrent(2) + } + } - return ( - <div style={{ position: 'relative' }}> - <NewPage - pageHead={ - { breadcrumbData: [{ title: '工作台' }, { title: '来访登记' }], title: '来访登记' } - } - > - <Fragment> - <div style={{ backgroundColor: '#fff', margin: '12px 16px 0px 16px', paddingTop: '16px', paddingLeft: '91px' }}> - <Steps type='navigation' current={current}> - <Step title='来访登记' disabled /> - <Step title='事件流转' disabled /> - <Step title='办理反馈' disabled /> - <Step title='结案审核' disabled /> - <Step title='当事人评价' disabled /> - <Step title='结案归档' disabled /> - </Steps> - </div> - <div style={{ backgroundColor: '#ffff', margin: '8px 8px 0px 16px', padding: '12px 18px 16px 16px', height: 'calc(100vh - 228px)', overflowY: 'scroll', display: isReview ? '' : 'none' }}> - <Preview style={{ display: isReview ? '' : 'none' }} data={formRef?.current?.getFields()} mainId={id} /> - </div> - <VisitorRegister - formRef={formRef} - style={{ display: isReview ? 'none' : '' }} - mainId={id} - partyList={editData.fakeData} - fileInfoList={editData.fileInfoList} - /> - <div className="dataSync-excel"> - <Space size="large" style={{ margin: '4px 14px' }}> - <Button type="primary" style={{ backgroundColor: '#1A6FB8' }} onClick={handleSave} >保存</Button> - <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }} onClick={handleReview}>{isReview ? '修改' : '预览'}</Button> - <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }} onClick={handleSubmit}>提交</Button> - <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }} onClick={() => selfAcceptance()}>自行受理</Button> - <Button type='secondary' onClick={handleReview}>返回上级页面</Button> - </Space> - </div> - </Fragment> - </NewPage> - </div> - ) + return ( + <div style={{ position: 'relative' }}> + <NewPage + pageHead={ + { breadcrumbData: [{ title: '工作台' }, { title: '来访登记' }], title: '来访登记' } + } + > + <Fragment> + <div style={{ backgroundColor: '#fff', margin: '12px 16px 0px 16px', paddingTop: '16px', paddingLeft: '91px' }}> + <Steps type='navigation' current={current}> + <Step title='来访登记' disabled /> + <Step title='事件流转' disabled /> + <Step title='办理反馈' disabled /> + <Step title='结案审核' disabled /> + <Step title='当事人评价' disabled /> + <Step title='结案归档' disabled /> + </Steps> + </div> + <div style={{ backgroundColor: '#ffff', margin: '8px 8px 0px 16px', padding: '12px 18px 16px 16px', height: 'calc(100vh - 228px)', overflowY: 'scroll', display: isReview ? '' : 'none' }}> + <Preview style={{ display: isReview ? '' : 'none' }} data={formRef?.current?.getFields()} mainId={id} /> + </div> + <VisitorRegister + formRef={formRef} + style={{ display: isReview ? 'none' : '' }} + mainId={id} + partyList={editData.fakeData} + fileInfoList={editData.fileInfoList} + /> + <div className="dataSync-excel"> + <Space size="large" style={{ margin: '4px 14px' }}> + <Button type="primary" style={{ backgroundColor: '#1A6FB8' }} onClick={handleSave} >保存</Button> + <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }} onClick={handleReview}>{isReview ? '修改' : '预览'}</Button> + <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }} onClick={handleSubmit}>提交</Button> + <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }} onClick={() => selfAcceptance()}>自行受理</Button> + <Button type='secondary' onClick={() => { navigate(-1) }}>返回上级页面</Button> + </Space> + </div> + </Fragment> + </NewPage> + </div> + ) } export default Organization; \ No newline at end of file diff --git a/gz-customerSystem/src/views/register/visit/preview.jsx b/gz-customerSystem/src/views/register/visit/preview.jsx index 308a020..a7c160a 100644 --- a/gz-customerSystem/src/views/register/visit/preview.jsx +++ b/gz-customerSystem/src/views/register/visit/preview.jsx @@ -235,7 +235,9 @@ <div className='MediationInfo-subTitle' style={{ marginTop: '-7px' }}></div><h4>事件材料</h4> </Space> </Col> - <FileTable mainId={props.mainId} fileInfoList={props.data?.fileInfoList} isReview={true} /> + <div style={{ marginBottom: '65px' }}> + <FileTable mainId={props.mainId} fileInfoList={props.data?.fileInfoList} isReview={true} /> + </div> </div> ) } -- Gitblit v1.8.0