diff --git a/src/pages/ElecEvaluation/EvalSiteManage/PersonReport/components/PersonReportModal.tsx b/src/pages/ElecEvaluation/EvalSiteManage/PersonReport/components/PersonReportModal.tsx index 6aece9f..4af3bfb 100644 --- a/src/pages/ElecEvaluation/EvalSiteManage/PersonReport/components/PersonReportModal.tsx +++ b/src/pages/ElecEvaluation/EvalSiteManage/PersonReport/components/PersonReportModal.tsx @@ -1,6 +1,7 @@ -import React, { useEffect, useState } from 'react'; -import { Form, Input, Modal, Spin, Button, Radio, RadioChangeEvent } from 'antd'; - +import React, { useEffect, useRef, useState } from 'react'; +import { Modal, Button, Descriptions, message } from 'antd'; +import { getUserList } from '../service'; +import ProTable, { ActionType } from '@ant-design/pro-table'; interface PersonReportModalProps { title: any; @@ -8,45 +9,73 @@ interface PersonReportModalProps { values: any; onCancel: () => void; } -const layout = { - labelCol: { span: 7 }, - wrapperCol: { span: 12 }, -}; const PersonReportModal: React.FC = (props) => { - const [form] = Form.useForm(); - // const weboffice = useRef(null); - const { title, modalVisible, values, onCancel, } = props; - //loading - const [loading, setLoading] = useState(false); - const [value, setValue] = useState("1"); + const checkRelationRef = useRef(); //操作数据后刷新列表 + const { title, modalVisible, values, onCancel, } = props; + const [userForm, setUserForm] = useState({}); - const onChange = (e: RadioChangeEvent) => { - console.log('radio checked', e.target.value); - setValue(e.target.value); - }; + const columns: any = [ + { + title: '序号', + valueType: 'index', + width: 80, + search: false, + }, + { + title: '人员', + dataIndex: 'userName', + }, + { + title: '报道状态', + dataIndex: 'status', + search: false, + valueEnum: { + 0: { text: '未报道' }, + 1: { text: '已报道' }, + }, + }, + { + title: '报道时间', + dataIndex: 'signDate', + valueType: 'dateTime', + search: false, + }, + { + title: '签到状态', + dataIndex: 'loginStatus', + valueEnum: { + 1: { text: '未签到' }, + 2: { text: '已签到' }, + 3: { text: '已申请回避' }, + }, + }, + { + title: '签到时间', + dataIndex: 'loginDate', + valueType: 'dateTime', + search: false, + }, + ] useEffect(() => { - if (JSON.stringify(values) !== "{}") { - form.setFieldsValue({ - "id": values.id, - "evalPlaceId": {label: values.eroomName,value: values.evalPlaceId}, - "facePic": values.facePic, - "sex": values.sex, - "personName": values.personName, - "identityCard": values.identityCard - }); - } + getUserList(values.id).then(res => { + if (res.code == 200) { + setUserForm(res?.data) + } else { + message.error("数据错误请联系管理员") + } + }) }, [values]) const renderFooter = () => { - return ( - <> - - - ); + return ( + <> + + + ); } return ( @@ -59,63 +88,31 @@ const PersonReportModal: React.FC = (props) => { centered footer={renderFooter()} > - -
- + + {values.projectNum} + {values.packageNames} + {values.areaName} + {values.reserveBy} + {values.reserveContactNumber} + {values.reserveStartDate} + {values.reserveEndDate} + {values.realStartDate} + {values.realEndDate} + {userForm.expertAmount} + {userForm.purchaseExpertAmount} + {userForm.manageAmount} + - - - - - - - - {/* 1-男性,2-女性 */} - - 男性 - 女性 - - -
-
+

报道信息

+ ); }; diff --git a/src/pages/ElecEvaluation/EvalSiteManage/PersonReport/index.tsx b/src/pages/ElecEvaluation/EvalSiteManage/PersonReport/index.tsx index 430f889..7aff0ed 100644 --- a/src/pages/ElecEvaluation/EvalSiteManage/PersonReport/index.tsx +++ b/src/pages/ElecEvaluation/EvalSiteManage/PersonReport/index.tsx @@ -1,13 +1,12 @@ import React, { useEffect, useRef, useState } from 'react'; import ProTable, { ActionType } from '@ant-design/pro-table'; import { getList } from './service'; -import { Button, Card, Form, message, Spin } from 'antd'; +import { Card, Spin } from 'antd'; import PersonReportModal from './components/PersonReportModal'; const PersonReport: React.FC<{}> = () => { const checkRelationRef = useRef(); //操作数据后刷新列表 const [isEditModalVisible, setIsEditModalVisible] = useState(false) //控制新增或编辑模态框是否显示 - // const [editForm] = Form.useForm();//编辑模块form //单条数据 const [editForm, setEditForm] = useState({}); const [spinning, setSping] = useState(false);//加载遮罩 @@ -23,25 +22,31 @@ const PersonReport: React.FC<{}> = () => { { title: '项目名称', dataIndex: 'projectName', + width: '20%', }, { title: '项目编号', dataIndex: 'projectNum', + width: '12%', search: false, }, { title: '标段名称', dataIndex: 'packageNames', + width: '20%', + ellipsis: true, search: false, }, { title: '评审室名称', dataIndex: 'areaName', + width: '12%', search: false, }, { title: '评审室状态', dataIndex: 'status', + width: 90, valueEnum: { 0: { text: '未开启' }, 1: { text: '进行中' }, @@ -54,28 +59,31 @@ const PersonReport: React.FC<{}> = () => { title: '预约开始时间', dataIndex: 'reserveStartDate', valueType: 'dateTime', + width: '9.5%', search: false, }, { title: '预约结束时间', dataIndex: 'reserveEndDate', valueType: 'dateTime', + width: '9.5%', search: false, }, { title: '报道状态', dataIndex: 'reportStatus', search: false, - // render: (text: any, record: any) => { - // return ( - // <> - // - // ) - // } + width: 75, + valueEnum: { + "all": { text: '全部报道' }, + "half": { text: '部分报道' }, + "none": { text: '未报道' }, + }, }, { title: '操作', search: false, + width: 80, render: (text: any, record: any) => { return ( <> @@ -101,52 +109,51 @@ const PersonReport: React.FC<{}> = () => { return ( <> - - - [ - ...dom.reverse(), - ], - }} + - request={(params) => { - let trueParams = { - ...params, - pageNo: params.current, - } - return new Promise((resolve, reject) => { - getList(trueParams).then(res => { - if (res.code === 200) { - resolve({ - data: res.data.records, - success: res.success, - total: res.data.total, - }) - } else { - resolve({ - data: [], - success: false, - total: 0, - }) + [ + ...dom.reverse(), + ], + }} + + request={(params) => { + let trueParams = { + ...params, + pageNo: params.current, } - }) - }); - }} - pagination={{ defaultPageSize: 10, showSizeChanger: false }}//默认显示条数 - /> + return new Promise((resolve, reject) => { + getList(trueParams).then(res => { + if (res.code === 200) { + resolve({ + data: res.data.records, + success: res.success, + total: res.data.total, + }) + } else { + resolve({ + data: [], + success: false, + total: 0, + }) + } + }) + }); + }} + pagination={{ defaultPageSize: 10, showSizeChanger: false }}//默认显示条数 + /> - {/* 新增及编辑银行账号Modal */} + {/* 报道详情Modal */} { isEditModalVisible ? { diff --git a/src/pages/ElecEvaluation/EvalSiteManage/PersonReport/service.ts b/src/pages/ElecEvaluation/EvalSiteManage/PersonReport/service.ts index 7f940ab..549f26e 100644 --- a/src/pages/ElecEvaluation/EvalSiteManage/PersonReport/service.ts +++ b/src/pages/ElecEvaluation/EvalSiteManage/PersonReport/service.ts @@ -11,30 +11,8 @@ export async function getList(params?: any) { } -export async function getPlaceList() { // 列表 - return request('/api/biz-service-ebtp-evaluation/v1/elec/eval/place/userlimit/list', { +export async function getUserList(reserveId?: string) { // 根据预约ID查询预约人员列表报道列表及预约人员分类及数量 + return request('/api/biz-service-ebtp-evaluation/v1/eleceval/expert/number/report/'+reserveId, { method: 'get', }); } - -/** - * 新增 - * @param params - */ -export async function saveSitePerson(data?: any) { - return request('/api/biz-service-ebtp-evaluation/v1/eval/room/site/person/save', { - method: 'post', - data: data - }); -} - -/** - * 删除 - * @param params - */ -export async function delSitePerson(id?: any) { - return request('/api/biz-service-ebtp-evaluation/v1/eval/room/site/person/delete?id='+id, { - method: 'post', - }); -} - diff --git a/src/pages/ElecEvaluation/EvalSiteManage/SitePerson/components/SitePersonModal.tsx b/src/pages/ElecEvaluation/EvalSiteManage/SitePerson/components/SitePersonModal.tsx index 9d40bbc..975df92 100644 --- a/src/pages/ElecEvaluation/EvalSiteManage/SitePerson/components/SitePersonModal.tsx +++ b/src/pages/ElecEvaluation/EvalSiteManage/SitePerson/components/SitePersonModal.tsx @@ -1,7 +1,6 @@ import React, { useEffect, useState } from 'react'; import { Form, Input, Modal, Spin, Select, Button, Radio, RadioChangeEvent } from 'antd'; -import ExtendUpload from "@/utils/ExtendUpload"; -import { getFileListByBid } from '@/utils/DownloadUtils'; +import ExpertPhotoUpload from '@/components/ElecBidEvaluation/ExpertPhotoUpload'; interface SitePersonModalProps { @@ -20,7 +19,6 @@ const layout = { }; const SitePersonModal: React.FC = (props) => { const [form] = Form.useForm(); - // const weboffice = useRef(null); const { title, modalVisible, formDisabled, type, values, onSubmit: handleUpdate, onCancel, placeList } = props; //loading const [loading, setLoading] = useState(false); @@ -36,7 +34,7 @@ const SitePersonModal: React.FC = (props) => { if (JSON.stringify(values) !== "{}") { form.setFieldsValue({ "id": values.id, - "evalPlaceId": {label: values.eroomName,value: values.evalPlaceId}, + "evalPlaceId": { label: values.eroomName, value: values.evalPlaceId }, "facePic": values.facePic, "sex": values.sex, "personName": values.personName, @@ -52,10 +50,11 @@ const SitePersonModal: React.FC = (props) => { setLoading(true) fieldsValue["evalPlaceId"] = fieldsValue.evalPlaceId.value console.log(fieldsValue) - - await getFileListByBid(fieldsValue.facePic).then(res => { - fieldsValue["facePicName"] = res[0].name - }) + fieldsValue["facePicName"] = fieldsValue.personName + + // await getFileListByBid(fieldsValue.facePic).then(res => { + // fieldsValue["facePicName"] = res[0].name + // }) console.log(fieldsValue) await handleUpdate({ ...fieldsValue }).finally(() => { setLoading(false) @@ -100,7 +99,14 @@ const SitePersonModal: React.FC = (props) => { - +