From 2c530cee872e404e4393f6bf6800d4ed228e9c39 Mon Sep 17 00:00:00 2001 From: jl-zhoujl2 Date: Tue, 11 Oct 2022 10:56:04 +0800 Subject: [PATCH] =?UTF-8?q?10.11=20=E5=A7=94=E6=89=98=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/router.config.ts | 2 +- .../Project/EntrustAssign/manager/index.tsx | 41 +++++++++++-------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/config/router.config.ts b/config/router.config.ts index 46b1726..c401ec1 100644 --- a/config/router.config.ts +++ b/config/router.config.ts @@ -158,7 +158,7 @@ export default [ icon: 'form', path: '/Project/EntrustAssign', routes: [ - {//管理员-代理 + {//管理员-代理 采购经理(查看委托记录) name: 'manager', path: '/Project/EntrustAssign/Manager', component: './Project/EntrustAssign/manager', diff --git a/src/pages/Project/EntrustAssign/manager/index.tsx b/src/pages/Project/EntrustAssign/manager/index.tsx index b21b16d..a0a2cbd 100644 --- a/src/pages/Project/EntrustAssign/manager/index.tsx +++ b/src/pages/Project/EntrustAssign/manager/index.tsx @@ -4,7 +4,7 @@ import ProTable, { ProColumns, ActionType } from '@ant-design/pro-table'; import { multipleTypeTransform, proTableValueEnum, returnDictVal } from '@/utils/CommonUtils'; import { getPage, agreeEntrust, queryEntrust, recallEntrust, refuseEntrust, aginstEntrust, assignEntrust, queryTree } from './service'; import './styles.less'; -import { getDicData, getSessionUserData } from '@/utils/session'; +import { getDicData, getSessionRoleData, getSessionUserData } from '@/utils/session'; import FileDown from '@/utils/Download'; import { btnAuthority } from '@/utils/authority'; import { downloadFile } from '@/utils/DownloadUtils'; @@ -178,6 +178,8 @@ const entrust: React.FC<{}> = () => { pageNo: 1, pageSize: 10 }); + //当前登录人角色 + const roleCode = getSessionRoleData().roleCode; //委托列表 const columns: ProColumns[] = [ @@ -185,7 +187,7 @@ const entrust: React.FC<{}> = () => { { title: '委托方', dataIndex: 'purchaser', width: '10%', search: false }, { title: '项目名称', dataIndex: 'projectName', }, { title: '方案编号', dataIndex: 'projectNumber', width: '10%', search: false }, - { title: '接收时间', dataIndex: 'createDate', width: '10%', valueType: 'dateTime', search: false }, + { title: roleCode == "ebtp-purchase" ? '委托时间' : '接收时间', dataIndex: 'createDate', width: '10%', valueType: 'dateTime', search: false }, { title: '采购方式', dataIndex: 'procurementMode', width: '10%', valueEnum: proTableValueEnum(dictData['procurement_mode=entrust']) }, { title: '标的类型', dataIndex: 'procurementType', width: '10%', hideInTable: typeVisible, search: false, render: (_, record) => multipleTypeTransform(record.procurementType, proTableValueEnum(dictData['procurement_type=entrust'])) }, { @@ -208,6 +210,7 @@ const entrust: React.FC<{}> = () => { { title: '操作', width: '12%', valueType: 'option', + hideInTable: roleCode == "ebtp-purchase",//采购经理无操作列 render: (_, record) => { if (record.status === 1) { return ( @@ -668,7 +671,7 @@ const entrust: React.FC<{}> = () => { } return ( - +
= () => { className='tableSearch' size='small' search={{ labelWidth: 'auto', span: 6 }} - request={(params) => - getPage({ + request={async (params) => { + let params_1 = { ...params, basePageRequest: { pageNo: pageData.pageNo, pageSize: pageData.pageSize }, - agencyCompany: getSessionUserData().organizationId//机构id - }).then((res) => { - const result = { - data: res.data.records, - total: res.data.total, - success: res.success, - pageSize: res.data.size, - current: res.data.current - } - return result; - }) - } + } + if (roleCode == "ebtp-purchase") {//采购经理 + params_1["purchasingManager"] = getSessionUserData().userId;//当前登录账号 + } else if (roleCode == "ebtp-agency-admin") {//代理机构管理员 + params_1["agencyCompany"] = getSessionUserData().organizationId //机构id + } + const res = await getPage(params_1); + const result_1 = { + data: res.data.records, + total: res.data.total, + success: res.success, + pageSize: res.data.size, + current: res.data.current + }; + return result_1; + }} pagination={{ defaultPageSize: 10, showSizeChanger: false,