forked from gzzfw/frontEnd/gzDyh

zhangyongtian
2024-09-03 6276d75443ec3cacf34d11632ed99c90fd35d3d3
feat: 当事人文件删除
3 files modified
34 ■■■■■ changed files
gz-customerSystem/src/components/ArcoUpload/index.jsx 6 ●●●● patch | view | raw | blame | history
gz-customerSystem/src/views/register/visit/component/agentDialog.jsx 13 ●●●●● patch | view | raw | blame | history
gz-customerSystem/src/views/register/visit/component/applyDialog.jsx 15 ●●●●● patch | view | raw | blame | history
gz-customerSystem/src/components/ArcoUpload/index.jsx
@@ -14,6 +14,7 @@
 * handleChangeFile, // 文件上传成功之后的回调
 * label *, // form的label名
 * editData *, // 编辑回显数据
 * handleDelFile *,//删除文件接口
 */
export default function ArcoUpload(props) {
@@ -43,7 +44,6 @@
        }}
        headers={{ Authorization: $$.getSessionStorage('customerSystemToken') }}
        onChange={(fileList, file) => {
          console.log(fileList, myFileList, file);
          const { status, response } = file
          //因为字节upLoad组件有bug,不能区分添加文件还是删除文件,所以用这种办法来判断是不是删除
          const isDel = myFileList && myFileList.length > fileList.length
@@ -62,8 +62,8 @@
            }
          }
          //删除文件
          if (isDel) {
          if (isDel && props.handleDelFile) {
            props.handleDelFile(response.data[0].id)
          }
          setMyFileList(fileList)
        }}
gz-customerSystem/src/views/register/visit/component/agentDialog.jsx
@@ -16,6 +16,10 @@
  return $$.ax.request({ url: `caseUtils/getNewTimeId`, type: 'get', service: 'utils' });
}
function delFile(id) {
  return $$.ax.request({ url: `fileInfo/deleteFileById`, type: 'get', service: 'sys', data: { id } });
}
export default function AgentDialog(props) {
  const formRef = useRef();
  const [visitList, setVisitList] = useState([])
@@ -94,6 +98,14 @@
    }
  }
  //删除文件
  const handleDelFile = async (id) => {
    const res = await delFile(id)
    if (res.type) {
      $$.infoSuccess({ content: '删除成功!' });
    }
  }
  return (
    <div className="applyDialog">
      <div style={{ height: '590px', overflowY: 'scroll' }}>
@@ -117,6 +129,7 @@
                    handleChangeFile={handleChangeFile}
                    label='身份证明材料'
                    editData={props.editData}
                    handleDelFile={handleDelFile}
                  />
                </Col>
                <Col span={24}>
gz-customerSystem/src/views/register/visit/component/applyDialog.jsx
@@ -28,6 +28,10 @@
  return $$.ax.request({ url: `caseUtils/getNewTimeId`, type: 'get', service: 'utils' });
}
function delFile(id) {
  return $$.ax.request({ url: `fileInfo/deleteFileById`, type: 'get', service: 'sys', data: { id } });
}
export default function ApplyDialog(props) {
  const formRef = useRef();
  const [perClass, setPerClass] = useState('09_01001-1');
@@ -79,6 +83,14 @@
    }
  }
  //删除文件
  const handleDelFile = async (id) => {
    const res = await delFile(id)
    if (res.type) {
      $$.infoSuccess({ content: '删除成功!' });
    }
  }
  //页面返回
  const formType = (type) => {
    if (type === '09_01001-1') {
@@ -94,6 +106,7 @@
              handleChangeFile={handleChangeFile}
              label='身份证明材料'
              editData={props.editData}
              handleDelFile={handleDelFile}
            />
          </Col>
          <Col span={12}>
@@ -229,6 +242,7 @@
              field='file'
              label={isLegal ? '企业登记材料' : '机构登记材料'}
              editData={props.editData}
              handleDelFile={handleDelFile}
            />
          </Col>
          <Col span={24}>
@@ -239,6 +253,7 @@
              field='file1'
              label={isLegal ? '法定代表人身份证明材料' : '机构代表人身份证明材料'}
              editData={props.editData}
              handleDelFile={handleDelFile}
            />
          </Col>
          <Col span={12}>