现场人员
This commit is contained in:
@ -1,15 +1,18 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Form, Input, Modal, Spin, Button, Tooltip, Radio, RadioChangeEvent } from 'antd';
|
import { Form, Input, Modal, Spin, Select, Button, Radio, RadioChangeEvent } from 'antd';
|
||||||
import { getSessionUserData } from '@/utils/session';
|
import ExtendUpload from "@/utils/ExtendUpload";
|
||||||
|
import { getFileListByBid } from '@/utils/DownloadUtils';
|
||||||
|
|
||||||
|
|
||||||
interface SitePersonModalProps {
|
interface SitePersonModalProps {
|
||||||
title: any;
|
title: any;
|
||||||
modalVisible: boolean;
|
modalVisible: boolean;
|
||||||
|
formDisabled: boolean;
|
||||||
values: any;
|
values: any;
|
||||||
onSubmit: any;
|
onSubmit: any;
|
||||||
type: string;
|
type: string;
|
||||||
onCancel: () => void;
|
onCancel: () => void;
|
||||||
|
placeList: any[];
|
||||||
}
|
}
|
||||||
const layout = {
|
const layout = {
|
||||||
labelCol: { span: 7 },
|
labelCol: { span: 7 },
|
||||||
@ -17,12 +20,11 @@ const layout = {
|
|||||||
};
|
};
|
||||||
const SitePersonModal: React.FC<SitePersonModalProps> = (props) => {
|
const SitePersonModal: React.FC<SitePersonModalProps> = (props) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const { title, modalVisible, type, values, onSubmit: handleUpdate, onCancel } = props;
|
// const weboffice = useRef<Weboffice>(null);
|
||||||
|
const { title, modalVisible, formDisabled, type, values, onSubmit: handleUpdate, onCancel, placeList } = props;
|
||||||
//loading
|
//loading
|
||||||
const [loading, setLoading] = useState<boolean>(false);
|
const [loading, setLoading] = useState<boolean>(false);
|
||||||
const organizationId = getSessionUserData().organizationId;
|
const [value, setValue] = useState<string>("1");
|
||||||
const organizationName = getSessionUserData().organizationName;
|
|
||||||
const [value, setValue] = useState<string>("0");
|
|
||||||
|
|
||||||
const onChange = (e: RadioChangeEvent) => {
|
const onChange = (e: RadioChangeEvent) => {
|
||||||
console.log('radio checked', e.target.value);
|
console.log('radio checked', e.target.value);
|
||||||
@ -30,31 +32,15 @@ const SitePersonModal: React.FC<SitePersonModalProps> = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (JSON.stringify(values) !== "{}") {
|
if (JSON.stringify(values) !== "{}") {
|
||||||
setValue(values.bankFlag);
|
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
"id": values.id,
|
"id": values.id,
|
||||||
"accountName": values.accountName,
|
"evalPlaceId": {label: values.eroomName,value: values.evalPlaceId},
|
||||||
"cardNumber": values.cardNumber,
|
"facePic": values.facePic,
|
||||||
"bank": values.bank,
|
"sex": values.sex,
|
||||||
"bankOutlets": values.bankOutlets,
|
"personName": values.personName,
|
||||||
"bankUnionNumber": values.bankUnionNumber,
|
"identityCard": values.identityCard
|
||||||
"bankFlag": values.bankFlag,
|
|
||||||
"companyId": values.companyId,
|
|
||||||
"companyName": values.companyName,
|
|
||||||
"type": values.type,
|
|
||||||
"contactName": values.contactName,
|
|
||||||
"contactPhone": values.contactPhone,
|
|
||||||
"contactMail": values.contactMail,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
form.setFieldsValue({
|
|
||||||
"accountName": organizationName,
|
|
||||||
"companyId": organizationId,
|
|
||||||
"companyName": organizationName,
|
|
||||||
"type": "0",
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [values])
|
}, [values])
|
||||||
@ -64,13 +50,14 @@ const SitePersonModal: React.FC<SitePersonModalProps> = (props) => {
|
|||||||
const onOk = async () => {
|
const onOk = async () => {
|
||||||
const fieldsValue = await form.validateFields();
|
const fieldsValue = await form.validateFields();
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
let tzsState = {
|
fieldsValue["evalPlaceId"] = fieldsValue.evalPlaceId.value
|
||||||
state: "1"
|
console.log(fieldsValue)
|
||||||
}
|
|
||||||
if (form.getFieldValue('bankFlag') == "0") {
|
await getFileListByBid(fieldsValue.facePic).then(res => {
|
||||||
fieldsValue["bank"] = "中信银行"
|
fieldsValue["facePicName"] = res[0].name
|
||||||
}
|
})
|
||||||
await handleUpdate({ ...fieldsValue, ...tzsState }).finally(() => {
|
console.log(fieldsValue)
|
||||||
|
await handleUpdate({ ...fieldsValue }).finally(() => {
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -113,86 +100,76 @@ const SitePersonModal: React.FC<SitePersonModalProps> = (props) => {
|
|||||||
<Form.Item name="id" label="id" hidden>
|
<Form.Item name="id" label="id" hidden>
|
||||||
<Input hidden />
|
<Input hidden />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="companyId" label="公司id" hidden>
|
<Form.Item name="evalPlaceId" label="选择评标场所" >
|
||||||
<Input hidden />
|
<Select placeholder="请选择评标场所" labelInValue disabled={formDisabled}>
|
||||||
</Form.Item>
|
{
|
||||||
<Form.Item name="companyName" label="公司名称" hidden>
|
placeList.map((item: any, index: any) => {
|
||||||
<Input hidden />
|
return (
|
||||||
</Form.Item>
|
<Select.Option value={item.id}>{item.placeName}</Select.Option>
|
||||||
<Form.Item name="type" label="账户类型:0-基本账户" hidden>
|
)
|
||||||
<Input hidden />
|
})
|
||||||
|
}
|
||||||
|
</Select>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="账号名称"
|
label="人员姓名"
|
||||||
name="accountName"
|
name="personName"
|
||||||
rules={[{ required: true, message: '当前项不可为空', },]}
|
rules={[
|
||||||
>
|
{
|
||||||
<Input disabled />
|
required: true,
|
||||||
</Form.Item>
|
message: '当前项不可为空',
|
||||||
<Form.Item
|
},
|
||||||
label="银行账号"
|
]}
|
||||||
name="cardNumber"
|
|
||||||
rules={[{ required: true, message: '当前项不可为空', }, { pattern: /^\d{12,20}$/, message: '请输入正确的银行账号' }]}
|
|
||||||
>
|
>
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="是否中信银行账号"
|
label="身份证号"
|
||||||
name="bankFlag"
|
name="identityCard"
|
||||||
rules={[{ required: true, message: '当前项不可为空', }]}
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '当前项不可为空',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
|
||||||
|
message: '输入的身份证号不正确',
|
||||||
|
},
|
||||||
|
]}
|
||||||
>
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label="性别"
|
||||||
|
name="sex"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '当前项不可为空',
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
{/* 1-男性,2-女性 */}
|
||||||
<Radio.Group onChange={onChange} value={value}>
|
<Radio.Group onChange={onChange} value={value}>
|
||||||
<Radio value="0">中信银行</Radio>
|
<Radio value="1">男性</Radio>
|
||||||
<Radio value="1">其他银行</Radio>
|
<Radio value="2">女性 </Radio>
|
||||||
</Radio.Group>
|
</Radio.Group>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{value == "1" ?
|
|
||||||
<Form.Item
|
|
||||||
label="开户银行"
|
|
||||||
name="bank"
|
|
||||||
rules={[{ required: true, message: '当前项不可为空', },]}
|
|
||||||
>
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
: null}
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="开户网点"
|
label="人脸照片"
|
||||||
name="bankOutlets"
|
name="facePic"
|
||||||
rules={[{ required: true, message: '当前项不可为空', },]}
|
extra="请上传清晰人脸正面照片,要求.jpg格式图片,文件大下不得超过60kb"
|
||||||
>
|
rules={[
|
||||||
<Input />
|
{
|
||||||
</Form.Item>
|
required: true,
|
||||||
<Form.Item
|
message: '当前项不可为空',
|
||||||
label="开户行银联号"
|
},
|
||||||
name="bankUnionNumber"
|
|
||||||
rules={[{ required: true, message: '当前项不可为空', }]}// , { pattern: /^\d{12}$/, message: '请输入正确的开户行银联号' }
|
|
||||||
>
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
|
||||||
label="联系人名称"
|
|
||||||
name="contactName"
|
|
||||||
>
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
|
||||||
label="联系电话"
|
|
||||||
name="contactPhone"
|
|
||||||
rules={[{ required: true },
|
|
||||||
{ pattern: /^[1][3,4,5,6,7,8,9][0-9]{9}$/, message: '请输入正确的电话号码' }
|
|
||||||
]}
|
]}
|
||||||
extra="仅支持联通号段,其他运营商号段暂不支持"
|
|
||||||
>
|
>
|
||||||
<Input />
|
<ExtendUpload bid={values.facePic} btnName="上传" maxCount={1} maxSize={0.057} uploadProps={{ accept: ".jpg" }}>
|
||||||
</Form.Item>
|
{/* maxSize={0.057} */}
|
||||||
|
</ExtendUpload>
|
||||||
<Form.Item
|
|
||||||
label="邮箱"
|
|
||||||
name="contactMail"
|
|
||||||
rules={[{ type: 'email', message: '请输入正确的邮箱格式' }]}
|
|
||||||
>
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
</Spin>
|
</Spin>
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import ProTable, { ActionType } from '@ant-design/pro-table';
|
import ProTable, { ActionType } from '@ant-design/pro-table';
|
||||||
import { getList, saveSitePerson, delAccount } from './service';
|
import { getList, saveSitePerson, delSitePerson, getPlaceList } from './service';
|
||||||
import { Button, Card, Form, message, Spin, Popconfirm } from 'antd';
|
import { Button, Card, Form, message, Spin, Popconfirm } from 'antd';
|
||||||
import { getSessionUserData } from '@/utils/session';
|
|
||||||
import SitePersonModal from './components/SitePersonModal';
|
import SitePersonModal from './components/SitePersonModal';
|
||||||
|
import { downloadFileObjectId } from '@/utils/DownloadUtils';
|
||||||
|
|
||||||
|
|
||||||
const SitePersonList: React.FC<{}> = () => {
|
const SitePersonList: React.FC<{}> = () => {
|
||||||
@ -14,11 +14,10 @@ const SitePersonList: React.FC<{}> = () => {
|
|||||||
//单条数据
|
//单条数据
|
||||||
const [editForm, setEditForm] = useState<any>({});
|
const [editForm, setEditForm] = useState<any>({});
|
||||||
const [spinning, setSping] = useState<boolean>(false);//加载遮罩
|
const [spinning, setSping] = useState<boolean>(false);//加载遮罩
|
||||||
const [accountList, setAccountList] = useState<any>([]); //账号信息
|
const [placeList, setPlaceList] = useState<any>([]); //省分公司信息
|
||||||
//是否可以新增
|
//下拉框是否可编辑
|
||||||
const [insertDisabled, setInsertDisabled] = useState<any>(true);
|
const [placeFormDisabled, setPlaceFormDisabled] = useState<any>(false);
|
||||||
const [type, setType] = useState<any>('cease');//弹窗类型
|
const [type, setType] = useState<any>('cease');//弹窗类型
|
||||||
const organizationId = getSessionUserData().organizationId;
|
|
||||||
let typename = "新增";
|
let typename = "新增";
|
||||||
|
|
||||||
|
|
||||||
@ -27,6 +26,7 @@ const SitePersonList: React.FC<{}> = () => {
|
|||||||
title: '序号',
|
title: '序号',
|
||||||
valueType: 'index',
|
valueType: 'index',
|
||||||
width: 80,
|
width: 80,
|
||||||
|
search: false,
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// title: '评标场所编号',
|
// title: '评标场所编号',
|
||||||
@ -35,6 +35,7 @@ const SitePersonList: React.FC<{}> = () => {
|
|||||||
{
|
{
|
||||||
title: '评标场所名称',
|
title: '评标场所名称',
|
||||||
dataIndex: 'eroomName',
|
dataIndex: 'eroomName',
|
||||||
|
search: false,
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// title: '人员类型',
|
// title: '人员类型',
|
||||||
@ -52,7 +53,15 @@ const SitePersonList: React.FC<{}> = () => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '人脸照片',
|
title: '人脸照片',
|
||||||
dataIndex: 'facePic',
|
dataIndex: 'facePicName',
|
||||||
|
search: false,
|
||||||
|
render: (text: any, record: any) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<a onClick={() => downloadFileObjectId(record.facePic)}>{record.facePicName}</a>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
@ -61,21 +70,20 @@ const SitePersonList: React.FC<{}> = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<a onClick={() => setFormVals(record)}>编辑</a>
|
<a onClick={() => setFormVals(record)}>编辑</a>
|
||||||
<Popconfirm placement="topRight" title={"确定删除么?"} onConfirm={async () => { delSitePerson(record.id); }} okText="确定" cancelText="取消" ><a > 删除 </a></Popconfirm>
|
<Popconfirm placement="topRight" title={"确定删除么?"} onConfirm={async () => { delPerson(record.id); }} okText="确定" cancelText="取消" ><a > 删除 </a></Popconfirm>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const delSitePerson = (id: any) => { // 删除
|
const delPerson = (id: any) => { // 删除
|
||||||
setSping(true);
|
setSping(true);
|
||||||
delAccount(id).then(res => {
|
delSitePerson(id).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
setSping(false);
|
setSping(false);
|
||||||
message.success('删除成功');
|
message.success('删除成功');
|
||||||
setAccountList(null)
|
checkRelationRef.current?.reload();
|
||||||
setInsertDisabled(false)
|
|
||||||
} else {
|
} else {
|
||||||
setSping(false);
|
setSping(false);
|
||||||
form.resetFields()
|
form.resetFields()
|
||||||
@ -101,29 +109,20 @@ const SitePersonList: React.FC<{}> = () => {
|
|||||||
setSping(false);
|
setSping(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取页面数据
|
|
||||||
const getSitePerson = () => {
|
|
||||||
getList(organizationId).then(res => {
|
|
||||||
if (res.code === 200) {
|
|
||||||
if (res.data.length == 0) {
|
|
||||||
setInsertDisabled(false)
|
|
||||||
}
|
|
||||||
setAccountList(res.data)
|
|
||||||
} else {
|
|
||||||
setAccountList(null)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// getSitePerson();
|
//查询当前人员权限下所有评标场所
|
||||||
|
getPlaceList().then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
setPlaceList(res.data)
|
||||||
|
}
|
||||||
|
});
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Spin spinning={spinning}>
|
<Spin spinning={spinning}>
|
||||||
<Card title="银行账号信息维护">
|
<Card title="评标场所人员管理">
|
||||||
|
|
||||||
<ProTable
|
<ProTable
|
||||||
actionRef={checkRelationRef}
|
actionRef={checkRelationRef}
|
||||||
@ -171,18 +170,19 @@ const SitePersonList: React.FC<{}> = () => {
|
|||||||
{
|
{
|
||||||
isEditModalVisible ?
|
isEditModalVisible ?
|
||||||
<SitePersonModal
|
<SitePersonModal
|
||||||
title={typename+"银行账号信息维护"}
|
title={typename+"人员信息"}
|
||||||
type={type}
|
type={type}
|
||||||
modalVisible={isEditModalVisible}
|
modalVisible={isEditModalVisible}
|
||||||
|
formDisabled={placeFormDisabled}
|
||||||
|
placeList={placeList}
|
||||||
values={editForm}
|
values={editForm}
|
||||||
onSubmit={async (value: any) => {
|
onSubmit={async (value: any) => {
|
||||||
await saveSitePerson(value).then((res: any) => {
|
await saveSitePerson(value).then((res: any) => {
|
||||||
if (res.success === true) {
|
if (res.success === true) {
|
||||||
message.success("保存成功!");
|
message.success("保存成功!");
|
||||||
setInsertDisabled(true)
|
|
||||||
setIsEditModalVisible(false);
|
setIsEditModalVisible(false);
|
||||||
setEditForm({});
|
setEditForm({});
|
||||||
getSitePerson();
|
// getSitePerson();
|
||||||
checkRelationRef.current?.reload();
|
checkRelationRef.current?.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -10,12 +10,19 @@ export async function getList(params?: any) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export async function getPlaceList() { // 列表
|
||||||
|
return request('/api/biz-service-ebtp-evaluation/v1/elec/eval/place/userlimit/list', {
|
||||||
|
method: 'get',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export async function saveSitePerson(data?: any) {
|
export async function saveSitePerson(data?: any) {
|
||||||
return request('/api/biz-service-ebtp-expenses//v1/bank/account/save', {
|
return request('/api/biz-service-ebtp-evaluation/v1/eval/room/site/person/save', {
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
@ -25,8 +32,8 @@ export async function saveSitePerson(data?: any) {
|
|||||||
* 删除
|
* 删除
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export async function delAccount(id?: any) {
|
export async function delSitePerson(id?: any) {
|
||||||
return request('/api/biz-service-ebtp-expenses//v1/bank/account/del/'+id, {
|
return request('/api/biz-service-ebtp-evaluation/v1/eval/room/site/person/delete?id='+id, {
|
||||||
method: 'post',
|
method: 'post',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user