diff --git a/src/pages/Agency/AgencyManager/index.tsx b/src/pages/Agency/AgencyManager/index.tsx index b693adf..b139694 100644 --- a/src/pages/Agency/AgencyManager/index.tsx +++ b/src/pages/Agency/AgencyManager/index.tsx @@ -1,10 +1,11 @@ import React, { useState, useRef } from 'react'; -import { message, Modal, Input, Form, PageHeader, Button, Spin, Select, Tree } from 'antd'; +import {Radio, message, Modal, Input, Form, PageHeader, Button, Spin, Select, Tree, DatePicker } from 'antd'; import ProTable, { ProColumns, ActionType } from '@ant-design/pro-table'; import { getPage, getDataById, deleteAgency, addAgency, updateAgency,disableAgency } from './service'; // import './styles.less'; import { getDicData } from '@/utils/session'; import TextArea from 'antd/lib/input/TextArea'; +import SelectProvider from './components/SelectProvider'; const agency: React.FC<{}> = () => { //获取字典 @@ -18,6 +19,9 @@ const agency: React.FC<{}> = () => { const dictData = JSON.parse(getDict); const actionRef = useRef(); const [spin, spinSet] = useState(false); + const [selectProviderVisible, setSelectProviderVisible] = useState(false); + const [currentRecord, setCurrentRecord] = useState(null); + const [showEndDate, setShowEndDate] = useState(false); //查询分页数据 const [pageData, pageDataSet] = useState({ pageNo: 1, @@ -56,7 +60,9 @@ const agency: React.FC<{}> = () => { , , , - + ] }, @@ -64,7 +70,7 @@ const agency: React.FC<{}> = () => { // 删除操作 const handleDelete = (id: string) => { Modal.confirm({ - title: '确认删除该角色?', + title: '确认删除该代理机构?', onOk: async () => { await deleteAgency(id).then((r: any) => { if (r?.code == 200) { @@ -77,67 +83,33 @@ const agency: React.FC<{}> = () => { }, }); }; - const handleAdd = async () => { + const handleAdd = async (record: any) => { form.resetFields(); - // const menus = await menuTreeselect(); - // setMenuOptions(menus.data || []); - // setMenuOptions(menu || []); - - // 使用时转换 - setMenuOptions(formatMenuOptions(menu) || []); + form.setFieldsValue({ + ...record, + providerId: record.id + }); + setOpen(true); - setTitle('添加角色'); + setTitle('添加招标代理机构'); }; const [menuOptions, setMenuOptions] = useState([]); - let menu = [{ - "id": '1', "parentId": '0', "label": "系统管理", "weight": 1, - "children": [{ - "id": '101', "parentId": '1', "label": "角色管理", "weight": 2, - "children": [{ "id": '1008', "parentId": '101', "label": "角色查询", "weight": 1 }, - { "id": '1009', "parentId": '101', "label": "角色新增", "weight": 2 }, - { "id": '1010', "parentId": '101', "label": "角色修改", "weight": 3 }, - { "id": '1011', "parentId": '101', "label": "角色删除", "weight": 4 }, - { "id": '1012', "parentId": '101', "label": "角色导出", "weight": 5 }] - }, - { - "id": '105', "parentId": '1', "label": "字典管理", "weight": 6, - "children": [{ "id": '1026', "parentId": '105', "label": "字典查询", "weight": 1 }, - { "id": '1027', "parentId": '105', "label": "字典新增", "weight": 2 }, - { "id": '1028', "parentId": '105', "label": "字典修改", "weight": 3 }, - { "id": '1029', "parentId": '105', "label": "字典删除", "weight": 4 }, - { "id": '1030', "parentId": '105', "label": "字典导出", "weight": 5 }] - }] - }, - { "id": '4', "parentId": '0', "label": "PLUS官网", "weight": 4 }, - { - "id": "1494925781048545281", "parentId": '0', "label": "个人待办", "weight": 18, - "children": [{ "id": "1494926258733633538", "parentId": "1494925781048545281", "label": "待办任务", "weight": 1 }, - { "id": "1494926586677874690", "parentId": "1494925781048545281", "label": "已办任务", "weight": 2 }] - }]; - const formatMenuOptions = (data: any[]) => { - return data.map(item => ({ - title: item.label, - key: item.id, - children: item.children ? formatMenuOptions(item.children) : undefined, - })); - }; + + const handleUpdate = async (record: any) => { form.resetFields(); - const role = await getDataById(record.roleId); + const agencyDetail = await getDataById(record.id); // const menus = await roleMenuTreeselect(record.roleId); // setMenuOptions(menus.data.menus || []); - setMenuOptions(formatMenuOptions(menu) || []); - setCheckedKeys(role.data.menuIds || []); + form.setFieldsValue({ - ...role.data, - menuIds: role.data.menuIds || [], + ...agencyDetail.data }); - // form.setFieldsValue(role.data); - setCurrentRoleId(record.roleId); + setOpen(true); - setTitle('修改角色'); + setTitle('修改代理机构'); }; const closeModal = async () => { @@ -185,40 +157,98 @@ const agency: React.FC<{}> = () => { onOk={handleSubmit} onCancel={() => closeModal()} > + + + +
+ +
+ 供应商名称: + {currentRecord?.name || '-'} +
+ +
+ 供应商类型名称: + {currentRecord?.kindName || '-'} +
+
+ 准入时间: + {currentRecord?.accessTime || '-'} +
+
+ 商品品类: + {currentRecord?.goodsTypeName || '-'} +
+ +
+ +
+
+ 姓名: + {currentRecord?.applyUser || '-'} +
+
+ 工号: + {currentRecord?.name || '-'} +
+
+ 角色: + {currentRecord?.kindCode || '-'} +
+
+ 公司: + {currentRecord?.kindName || '-'} +
+
+ 部门: + {currentRecord?.goodsTypeCode || '-'} +
+ +
-