forked from gzzfw/frontEnd/gzDyh

zhangyongtian
2024-09-05 65c8026eaeff3d769a1d168933e13035708233e0
gz-customerSystem/src/views/register/handleFeedback/component/handle.jsx
@@ -9,15 +9,15 @@
import { scan } from '@/assets/images/icon'
import DocumentScanner from './FileUpLoad'
import * as $$ from '@/utils/utility';
import {
  IconLink,
} from '@arco-design/web-react/icon';
import CaseResult from './CaseResult'
import ArcoUpload from '@/components/ArcoUpload';
const InputSearch = Input.Search;
const FormItem = Form.Item;
const TabPane = Tabs.TabPane;
const appUrl = $$.appUrl;
const style = {
  textAlign: 'center',
@@ -80,10 +80,23 @@
  return $$.ax.request({ url: 'ctUser/getByIdRole?id=' + id, type: 'get', service: 'cust' });
}
function choosePrincipalApi(id) {
  return $$.ax.request({ url: 'caseInfoUnfold/choosePrincipal?caseId=24083010062110001&userId=' + id, type: 'get', service: 'mediate' });
}
function delFile(id) {
  return $$.ax.request({ url: `fileInfo/deleteFileById`, type: 'get', service: 'sys', data: { id } });
}
function getNewTimeIdApi(id) {
  return $$.ax.request({ url: `caseUtils/getNewTimeId`, type: 'get', service: 'utils' });
}
const Handle = () => {
  const formRef = useRef();
  const [selectedTab, setSelectedTab] = useState('1'); // 默认选中第一个 tab
  const [wantUser, setWantUser] = useState({});
  const [formView, setFormView] = useState(false);
@@ -97,12 +110,15 @@
  ];
  const [isModalVisible, setIsModalVisible] = useState(false);
  const [id, setId] = useState('')
  const handleTabChange = (newTabIndex) => {
    setSelectedTab(newTabIndex);
  };
  const handleCheckedKeys = (userId) => {
    choosePrincipal(userId)
  }
  const [records, setRecords] = useState([
    {
@@ -211,16 +227,50 @@
  }
  const choosePrincipal = async (id) => {
    console.log(id, 'choosePrincipalId')
    const res = await choosePrincipalApi(id)
    if (res.type) {
      let data = res.data
      console.log(data, 'choosePrincipalchoosePrincipal')
    }
  }
  //删除文件
  const handleDelFile = async (id) => {
    const res = await delFile(id)
    if (res.type) {
      $$.infoSuccess({ content: '删除成功!' });
    }
  }
  const getNewTimeId = async () => {
    const res = await getNewTimeIdApi()
    if (res.type) {
      setId(res.data)
    }
  }
  const addMark = () => {
    setFormView(!formView);
    getNewTimeId()
  }
  const handleFinish = () => {
    console.log(formRef.current.getFields(), formRef, 'formRef.current.getFields()', 'formRef')
  }
  const Supervising = () => {
  }
  useEffect(() => {
    getByIdRole()
  }, [])
  return (
@@ -344,6 +394,14 @@
                      </Space>
                    </Col>
                    <Col span={24}>
                      <Form
                        ref={formRef}
                        layout='vertical'
                        requiredSymbol={false}
                        scrollToFirstError={true}
                      >
                        <Row gutter={[32, 0]}>
                          <Col  span={24}>
                      <FormItem
                        label={<div style={{ display: 'flex' }}>
                          办理意见
@@ -362,6 +420,7 @@
                          wrapperStyle={{ width: '100%' }}
                        />
                      </FormItem>
                    </Col>
                    <Col span={24}>
                      <FormItem
@@ -372,22 +431,24 @@
                        field='caseDes'
                        rules={[{ message: '请填写事项概况', required: true }]}
                      >
                        <Upload
                          drag
                          multiple
                          accept='image/*'
                          action='/'
                          onDrop={(e) => {
                              <ArcoUpload
                                params={{
                                  action: `${appUrl.fileUrl}/${appUrl.sys}/api/web/fileInfo/upload?mainId='24083010062110001'&&ownerId=${id}&ownerType=22_00018-102`,
                          }}
                          tip='支持png、jpg、pdf格式的图片上传,每次上传大小不超过10M'
                          showUploadList={{
                            fileIcon: <IconLink style={{ color: '#1D2129' }} />,
                          }}
                                field='file1'
                                // handleChangeFile={handleChangeFile}
                                label=''
                                // editData={props.editData}
                                handleDelFile={handleDelFile}
                        />
                      </FormItem>
                    </Col>
                        </Row>
                      </Form>
                    </Col>
                    <Space size='middle'>
                      <Button type='primary'>保存</Button>
                      <Button type='primary' onClick={() => handleFinish()}>保存</Button>
                      <Button type='secondary'>取消添加</Button>
                    </Space>
                  </div>
@@ -396,9 +457,10 @@
              </Col>
            </Form>
            <Space style={{ marginTop: '38px', bottom: '4px' }}>
              <Button type="primary" style={{ backgroundColor: '#1A6FB8' }} onClick={() => setFormView(!formView)}>添加办理记录</Button>
              <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }} onClick={() => SetCaseResult(!caseResult)}>结案申请</Button>
              <Button type="primary" style={{ backgroundColor: '#1A6FB8' }} onClick={() => addMark()}>添加办理记录</Button>
              <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }}>联合处置申请</Button>
              <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }} onClick={() => SetCaseResult(!caseResult)}>结案申请</Button>
              <Button type='outline' style={{ color: '#EF6C24', border: '1px solid #EF6C24' }} onClick={() => Supervising(!caseResult)}>督办</Button>
              <Button type='secondary'>返回上级页面</Button>
            </Space>
          </div>
@@ -457,8 +519,10 @@
          visible={isModalVisible}
          checkKeys={wantUser.wantUserId ? [{ label: wantUser.wantUserName, value: wantUser.wantUserId }] : undefined}
          onOk={(value) => {
            console.log(value.key, value, 'value.key', 'value')
            setIsModalVisible(false);
            setWantUser({ wantUserId: value.keys[0], wantUserName: value.items[0].name });
            handleCheckedKeys(value.keys?.[0])
          }}
          onClose={() => setIsModalVisible(false)}
        />