diff --git a/dist.zip b/dist.zip new file mode 100644 index 0000000..5d67902 Binary files /dev/null and b/dist.zip differ diff --git a/package.json b/package.json index 19f44cc..efce271 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ant-design-pro", - "version": "4.5.26", + "version": "4.5.31", "private": true, "description": "An out-of-box UI solution for enterprise applications", "scripts": { diff --git a/src/pages/basicManage/Brand/serverpart.tsx b/src/pages/basicManage/Brand/serverpart.tsx index 6406f6d..521590e 100644 --- a/src/pages/basicManage/Brand/serverpart.tsx +++ b/src/pages/basicManage/Brand/serverpart.tsx @@ -156,7 +156,7 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) => const [tabList, setTabList] = useState([]);// 选项卡列表 const [showLoading, setShowLoading] = useState(false)// 是否显示加载蒙层 const [showLoading1, setShowLoading1] = useState(false)// 是否显示加载蒙层 - const [showList,setShowList] = useState(false)// 传给在营项目 是否显示列表 + const [showList, setShowList] = useState(false)// 传给在营项目 是否显示列表 const [detailMessage, setDetailMessage] = useState()// 每个品牌的默认值 const [serviceCar, setServiceCar] = useState(false)// 月度车流分析 const [serviceCarList, setServiceCarList] = useState([])// 车流分析的数据 @@ -246,7 +246,7 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) => const planType = useRef()// 判断打开的是年度计划还是月份计划 const planRevenueData = useRef()// 自营计划的数据 const planRevenueDetailList = useRef()// 自营计划的月度明细 - const [contentLoading,setContentLoading] = useState(false)// 显示抽屉加载效果的判断条件 + const [contentLoading, setContentLoading] = useState(false)// 显示抽屉加载效果的判断条件 // 设置页面右侧上面昨日数据里面的时间选择器里的禁用时间用的方法 const disabledDate = (current: any) => { return current && current < moment().subtract(10, 'day') || current > moment().subtract(1, 'day'); @@ -478,12 +478,12 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) => req = { ServerpartId: id, StartDate: `${y}-01-01`, - ShowProjectSplit:false + ShowProjectSplit: false } } else { req = { ServerpartId: id, - ShowProjectSplit:false + ShowProjectSplit: false } } const data = await getBrandReceivablesList(req) @@ -656,8 +656,8 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) => sectionMaxRef.current = Number((sectionMax / 10000).toFixed(2)) entryMaxRef.current = entryMax - console.log('pieLine',pieLine) - console.log('pieList',pieList) + console.log('pieLine', pieLine) + console.log('pieList', pieList) // setServiceCarList(data.data) if (showDrawer) { @@ -717,7 +717,7 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) => // 改变归属地右边城市列表的方法 const getCityList = async (ProvinceName: string, allCount: number, type: number, time: any) => { const req = { - StatisticsMonth: time?moment(time).format('YYYYMM') :moment(moment().subtract(1, 'day').format('YYYY-MM-DD')).format('YYYYMM'), + StatisticsMonth: time ? moment(time).format('YYYYMM') : moment(moment().subtract(1, 'day').format('YYYY-MM-DD')).format('YYYYMM'), Serverpart_ID: serverpartId.current, ProvinceName, isExclude: ProvinceName.indexOf(',') !== -1, @@ -914,6 +914,8 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) => } const data = await getServiceDetail(req) setServiceName(data.SERVERPART_NAME) + console.log('datadatadatadatadatadatadatadatadatadatadatadatadatadatadatadatadatadatadatadatadatadatadatadatadatadatadatadatadatavv', data); + setServiceDetail(data) } const typeObj = { @@ -1194,15 +1196,15 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) =>
在营项目
{ - console.log('val',val) + console.log('val', val) setSelectTab(val.target.value) setTableList(allList[val.target.value]) - console.log('tabs',tabs) + console.log('tabs', tabs) }}> { - tabs && tabs.length>0?tabs.map((item: any) => { + tabs && tabs.length > 0 ? tabs.map((item: any) => { return {item.label}{`(${item.value})`} - }):'' + }) : '' }
@@ -1253,323 +1255,323 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) => : // 平面图不显示的时候 左侧显示的内容 - <> -
- { - serviceDetail?.ImageLits && serviceDetail?.ImageLits.length > 0 && serviceDetail?.ImageLits[0] ? - : - - } -
-
- - {serviceDetail?.ServerpartInfo?.SERVERPART_INFO} - {serviceDetail?.ServerpartInfo?.SERVERPART_INFO} -
-
-
- - 司机之家 -
- -
- - 客房 -
- -
- - 充电桩 -
- -
- - 母婴室 -
-
- + <> +
{ - serviceDetail ? -
-
-
- - 占地面积 -
-
{serviceDetail?.ServerpartInfo?.FLOORAREA ? fmoney(serviceDetail.ServerpartInfo.FLOORAREA, 2) : '-'}m²
-
- -
-
- - 停车场面积 -
-
{serviceDetail?.ServerpartInfo?.SHAREAREA ? fmoney(serviceDetail.ServerpartInfo.SHAREAREA, 2) : '-'}m²
-
- -
-
- - 建筑面积 -
-
{serviceDetail?.ServerpartInfo?.SERVERPART_AREA ? fmoney(serviceDetail.ServerpartInfo.SERVERPART_AREA, 2) : '-'}m²
-
- -
-
- - 取水方式 -
-
{serviceDetail?.ServerpartInfo?.WATERINTAKE_TYPE === 1 ? '自来水' : serviceDetail.ServerpartInfo.WATERINTAKE_TYPE === 2 ? '井水' : ''}
-
- -
-
- - 污水处理 -
-
{serviceDetail?.ServerpartInfo?.SEWAGEDISPOSAL_TYPE === 1 ? '市政' : serviceDetail.ServerpartInfo?.SEWAGEDISPOSAL_TYPE === 2 ? '污水处理设备' : ''}
-
- -
-
- - 市区县镇 -
-
{serviceDetail?.ServerpartInfo?.SERVERPART_ADDRESS ? serviceDetail.ServerpartInfo.SERVERPART_ADDRESS : ''}
-
- -
-
- - 管理单位 -
-
{serviceDetail?.ServerpartInfo?.MANAGERCOMPANY ? serviceDetail.ServerpartInfo.MANAGERCOMPANY : ''}
-
- -
-
- - 产权单位 -
-
{serviceDetail?.ServerpartInfo?.OWNEDCOMPANY ? serviceDetail.ServerpartInfo.OWNEDCOMPANY : ''}
-
-
- : '' + serviceDetail?.ImageLits && serviceDetail?.ImageLits.length > 0 && serviceDetail?.ImageLits[0] ? + : + } -
- { - serviceDetail && serviceDetail.RegionInfo ? - serviceDetail.RegionInfo.map((item: any) => { - return
-
- - {`${item.SERVERPART_REGIONNAME || ''}`} - +
+
+ + {serviceDetail?.ServerpartInfo?.SERVERPART_INFO} + {serviceDetail?.ServerpartInfo?.SERVERPART_INFO} +
+
+
+ + 司机之家 +
+ +
+ + 客房 +
+ +
+ + 充电桩 +
+ +
+ + 母婴室 +
+
+ + { + serviceDetail ? +
+
+
+ + 占地面积 +
+
{serviceDetail?.ServerpartInfo?.FLOORAREA ? fmoney(serviceDetail.ServerpartInfo.FLOORAREA, 2) : '-'}m²
+
+ +
+
+ + 停车场面积 +
+
{serviceDetail?.ServerpartInfo?.SHAREAREA ? fmoney(serviceDetail.ServerpartInfo.SHAREAREA, 2) : '-'}m²
+
+ +
+
+ + 建筑面积 +
+
{serviceDetail?.ServerpartInfo?.SERVERPART_AREA ? fmoney(serviceDetail.ServerpartInfo.SERVERPART_AREA, 2) : '-'}m²
+
+ +
+
+ + 取水方式 +
+
{serviceDetail?.ServerpartInfo?.WATERINTAKE_TYPE === 1 ? '自来水' : serviceDetail.ServerpartInfo.WATERINTAKE_TYPE === 2 ? '井水' : ''}
+
+ +
+
+ + 污水处理 +
+
{serviceDetail?.ServerpartInfo?.SEWAGEDISPOSAL_TYPE === 1 ? '市政' : serviceDetail.ServerpartInfo?.SEWAGEDISPOSAL_TYPE === 2 ? '污水处理设备' : ''}
+
+ +
+
+ + 市区县镇 +
+
{serviceDetail?.ServerpartInfo?.SERVERPART_ADDRESS ? serviceDetail.ServerpartInfo.SERVERPART_ADDRESS : ''}
+
+ +
+
+ + 管理单位 +
+
{serviceDetail?.ServerpartInfo?.MANAGERCOMPANY ? serviceDetail.ServerpartInfo.MANAGERCOMPANY : ''}
+
+ +
+
+ + 产权单位 +
+
{serviceDetail?.ServerpartInfo?.OWNEDCOMPANY ? serviceDetail.ServerpartInfo.OWNEDCOMPANY : ''}
+
+
+ : '' + } +
+ { + serviceDetail && serviceDetail.RegionInfo ? + serviceDetail.RegionInfo.map((item: any) => { + return
+
+ + {`${item.SERVERPART_REGIONNAME || ''}`} + +
+ +
+
+
+ + + 男厕 + { + item.HASPANTRY ? + {`(${item.HASPANTRY || ""})`} : '' + } + +
+
-
-
-
- - - 男厕 - { - item.HASPANTRY ? - {`(${item.HASPANTRY || ""})`} : '' - } - -
- +
+
+ + + 女厕 + { + item.HASWIFI ? + {`(${item.HASWIFI || ""})`} : '' + } +
+
-
-
- - - 女厕 - { - item.HASWIFI ? - {`(${item.HASWIFI || ""})`} : '' - } - -
+
+
+ + + 第三卫生间 + { + item.HASTHIRDTOILETS ? + {`(${item.HASTHIRDTOILETS || ""})`} : '' + } +
+
-
-
- - - 第三卫生间 - { - item.HASTHIRDTOILETS ? - {`(${item.HASTHIRDTOILETS || ""})`} : '' - } - -
+
+
+ + + 潮汐厕位 + { + item.TOILETCOUNT ? + {`(${item.TOILETCOUNT || ""})`} : '' + } +
+
-
-
- - - 潮汐厕位 - { - item.TOILETCOUNT ? - {`(${item.TOILETCOUNT || ""})`} : '' - } - -
+
+
+ + + 开水器 + { + item.HASWATERROOM ? + {`(${item.HASWATERROOM || ""})`} : '' + } +
+
-
-
- - - 开水器 - { - item.HASWATERROOM ? - {`(${item.HASWATERROOM || ""})`} : '' - } - -
+
+
+ + + 车辆加水 + { + item.HASSHOWERROOM ? + {`(${item.HASSHOWERROOM || ""})`} : '' + } +
+
-
-
- - - 车辆加水 - { - item.HASSHOWERROOM ? - {`(${item.HASSHOWERROOM || ""})`} : '' - } - -
+
+
+ + + 车辆维修 + { + item.HASCHILD ? + {`(${item.HASCHILD || ""})`} : '' + } +
+
-
-
- - - 车辆维修 - { - item.HASCHILD ? - {`(${item.HASCHILD || ""})`} : '' - } - -
+
+
+ + + 轿车车位 + { + item.SMALLPARKING ? + {`(${item.SMALLPARKING || ""})`} : '' + } +
+
-
-
- - - 轿车车位 - { - item.SMALLPARKING ? - {`(${item.SMALLPARKING || ""})`} : '' - } - -
+
+
+ + + 客车车位 + { + item.PACKING ? + {`(${item.PACKING || ""})`} : '' + } +
+
-
-
- - - 客车车位 - { - item.PACKING ? - {`(${item.PACKING || ""})`} : '' - } - -
+
+
+ + + 货车车位 + { + item.TRUCKPACKING ? + {`(${item.TRUCKPACKING || ""})`} : '' + } +
+
-
-
- - - 货车车位 - { - item.TRUCKPACKING ? - {`(${item.TRUCKPACKING || ""})`} : '' - } - -
+
+
+ + + 餐饮 + { + item.DININGROOMCOUNT ? + {`(${item.DININGROOMCOUNT || ""})`} : '' + } +
+
-
-
- - - 餐饮 - { - item.DININGROOMCOUNT ? - {`(${item.DININGROOMCOUNT || ""})`} : '' - } - -
+
+
+ + + 便利店 + { + item.HASBACKGROUNDRADIO ? + {`(${item.HASBACKGROUNDRADIO || ""})`} : '' + } +
+
-
-
- - - 便利店 - { - item.HASBACKGROUNDRADIO ? - {`(${item.HASBACKGROUNDRADIO || ""})`} : '' - } - -
+
+
+ + + 住宿 + { + item.HASMESSAGESEARCH ? + {`(${item.HASMESSAGESEARCH || ""})`} : '' + } +
+
-
-
- - - 住宿 - { - item.HASMESSAGESEARCH ? - {`(${item.HASMESSAGESEARCH || ""})`} : '' - } - -
+
+
+ + + 商铺 + { + item.DININGBXCOUNT ? + {`(${item.DININGBXCOUNT || ""})`} : '' + } +
+
-
-
- - - 商铺 - { - item.DININGBXCOUNT ? - {`(${item.DININGBXCOUNT || ""})`} : '' - } - -
-
- -
-
- - - 危化品车位 - { - item.DANPACKING ? - {`(${item.DANPACKING || ""})`} : '' - } - -
+
+
+ + + 危化品车位 + { + item.DANPACKING ? + {`(${item.DANPACKING || ""})`} : '' + } +
- }) : - } -
- +
+ }) : + } +
+ } } @@ -1967,7 +1969,7 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) => {/* giveProjectServiceInfo 拿到商家id和商家名称 handleGetTableList拿到在营项目列表中的列表数据 平面图出现的时候 左侧显示的内容 */} + tableShowBottom={true} /> {/*
*/} {/*
在营项目
*/} @@ -2667,23 +2669,23 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) =>
{ - contentLoading? + contentLoading ?
{'加载中.....'}
-
:'' +
: '' } { selectFun === 1 ? <>
{ - if (val){ + if (val) { setFunTimeDate1([moment(val[0]._d), moment(val[1]._d)]) handleMeetingDetail(serverpartId.current, [moment(val[0]._d), moment(val[1]._d)]) - }else{ + } else { setFunTimeDate1([]) setMeetDetail([]) } @@ -2774,10 +2776,10 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) => <>
{ - if (val){ + if (val) { setFunTimeDate3([moment(val[0]._d), moment(val[1]._d)]) getDailySerach(serverpartId.current, [moment(val[0]._d), moment(val[1]._d)]) - }else{ + } else { setFunTimeDate3([]) setDailyData([]) } @@ -2923,7 +2925,7 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) => <>
- +
@@ -2935,7 +2937,7 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) =>
<> -
+
diff --git a/src/pages/supplier/supplierList/list.tsx b/src/pages/supplier/supplierList/list.tsx index 3920acb..60696de 100644 --- a/src/pages/supplier/supplierList/list.tsx +++ b/src/pages/supplier/supplierList/list.tsx @@ -1,6 +1,6 @@ -import type { CurrentUser} from "umi"; -import {connect} from "umi"; -import type {ConnectState} from "@/models/connect"; +import type { CurrentUser } from "umi"; +import { connect } from "umi"; +import type { ConnectState } from "@/models/connect"; import { Button, Col, DatePicker, @@ -13,8 +13,8 @@ import { Space, Spin, Switch, Tree, Upload } from "antd"; -import React, {useEffect, useRef, useState} from "react"; -import type {ActionType,ProColumns} from "@ant-design/pro-table"; +import React, { useEffect, useRef, useState } from "react"; +import type { ActionType, ProColumns } from "@ant-design/pro-table"; import AddNewShop from "@/pages/supplier/supplierList/components/addNewShop"; import { handleSubmitData, @@ -23,7 +23,7 @@ import { updateQualification, handleDeleteBIDList } from "@/pages/supplier/supplierList/service"; import moment from "moment"; -import {ExclamationCircleOutlined, FilterOutlined, PlusOutlined} from "@ant-design/icons"; +import { ExclamationCircleOutlined, FilterOutlined, PlusOutlined } from "@ant-design/icons"; import ProTable from "@ant-design/pro-table"; import { ModalForm, @@ -34,16 +34,16 @@ import { ProFormUploadButton } from "@ant-design/pro-form"; import useRequest from "@ahooksjs/use-request"; -import {handleSupplierList} from "@/pages/Setting/Roles/service"; -import {deletePicture, uploadPicture} from "@/services/picture"; -import type {QualificationModel} from "@/pages/merchantManagement/supplier/Qualifications/data"; -import {getFieldEnum} from "@/services/options"; -import type {UploadFile} from "antd/es/upload/interface"; -import {getQualificationDetail} from "@/pages/merchantManagement/supplier/Qualifications/service"; -import type {PictureModel} from "@/services/options/typings"; -import type {ProDescriptionsItemProps} from "@ant-design/pro-descriptions"; +import { handleSupplierList } from "@/pages/Setting/Roles/service"; +import { deletePicture, uploadPicture } from "@/services/picture"; +import type { QualificationModel } from "@/pages/merchantManagement/supplier/Qualifications/data"; +import { getFieldEnum } from "@/services/options"; +import type { UploadFile } from "antd/es/upload/interface"; +import { getQualificationDetail } from "@/pages/merchantManagement/supplier/Qualifications/service"; +import type { PictureModel } from "@/services/options/typings"; +import type { ProDescriptionsItemProps } from "@ant-design/pro-descriptions"; import ProDescriptions from "@ant-design/pro-descriptions"; -import {transferImg} from "@/utils/format"; +import { transferImg } from "@/utils/format"; import './list.less' import dealtSelect from '@/assets/supplier/dealtSelect.png' import dealt from '@/assets/supplier/dealt.png' @@ -90,26 +90,26 @@ const customUploadRequest = async (fileList: UploadFile[], tableId: string) => { } -const SupplierList: React.FC<{ currentUser: CurrentUser | undefined }> = ({ currentUser }) =>{ +const SupplierList: React.FC<{ currentUser: CurrentUser | undefined }> = ({ currentUser }) => { const tableRef = useRef() // 子组件的实例对象 const addNewShopRef = useRef() const actionRef = useRef() const actionSupplierRef = useRef() - const [showDetailDrawer,setShowDetailDrawer] = useState(false) - const [currentItem,setCurrentItem] = useState() - const [showAddDrawer,setShowAddDrawer] = useState(false) - const [shopList,setShopList] = useState() // 详情查到的商品列表 - const [qualification,setQualification] = useState(false)// 上传资质的悬浮框 - const [addQualification,setAddQualification] = useState(false)// 新增资质的悬浮框 + const [showDetailDrawer, setShowDetailDrawer] = useState(false) + const [currentItem, setCurrentItem] = useState() + const [showAddDrawer, setShowAddDrawer] = useState(false) + const [shopList, setShopList] = useState() // 详情查到的商品列表 + const [qualification, setQualification] = useState(false)// 上传资质的悬浮框 + const [addQualification, setAddQualification] = useState(false)// 新增资质的悬浮框 const qualificationFormRef = useRef() - const [submitModal,setSubmitModal] = useState(false) - const [submitSupplierID,setSubmitSupplierID] = useState()// 最后提交的时候选择的供应商id + const [submitModal, setSubmitModal] = useState(false) + const [submitSupplierID, setSubmitSupplierID] = useState()// 最后提交的时候选择的供应商id // 最后提交的时候 选择的供应商列表 - const [submitSelectList,setSubmitSelectList] = useState() - const [fileList,setFileList] = useState([]) - const [showCurrentDetail,setShowCurrentDetail] = useState(false)// 资质的详情 - const [currentRow,setCurrentRow] = useState()// 当前选中的资质详情 + const [submitSelectList, setSubmitSelectList] = useState() + const [fileList, setFileList] = useState([]) + const [showCurrentDetail, setShowCurrentDetail] = useState(false)// 资质的详情 + const [currentRow, setCurrentRow] = useState()// 当前选中的资质详情 const { data: supplierLists } = useRequest(async () => { return await handleSupplierList({ ProvinceCode: currentUser?.USER_PROVINCE, @@ -117,11 +117,11 @@ const SupplierList: React.FC<{ currentUser: CurrentUser | undefined }> = ({ curr }) }) // 搜索的业务名称 - const [searchName,setSearchName] = useState() + const [searchName, setSearchName] = useState() // 搜索的查询时间 - const [searchTime,setSearchTime] = useState()// 搜索时间 + const [searchTime, setSearchTime] = useState()// 搜索时间 // 搜索的配送时间 - const [deliveryTime,setDeliveryTime] = useState() + const [deliveryTime, setDeliveryTime] = useState() // 获取供应商列表 const { loading, data: supplierList } = useRequest(async () => { return await handleSupplierList({ @@ -190,7 +190,7 @@ const SupplierList: React.FC<{ currentUser: CurrentUser | undefined }> = ({ curr if (record?.QUALIFICATION_ENDDATE && record?.QUALIFICATION_ENDDATE.toString() !== '') { // 资质到期时间在一个月内,内容标红显示 if (moment().add(1, 'month').diff(moment(record?.QUALIFICATION_ENDDATE)) > 0 && - moment(record?.QUALIFICATION_ENDDATE).diff(moment().format('YYYY/MM/DD')) >= 0) { + moment(record?.QUALIFICATION_ENDDATE).diff(moment().format('YYYY/MM/DD')) >= 0) { return {_} } // 资质已过期,则置灰显示 @@ -248,28 +248,28 @@ const SupplierList: React.FC<{ currentUser: CurrentUser | undefined }> = ({ curr hideInSearch: true, render: (_, record) => { return ( - - { - supplierId?'': { - console.log('record',record) - setCurrentRow(await getDetail(record)) - qualificationFormRef.current?.setFieldsValue({ - ...record - }) - setAddQualification(true) - }} - > - 编辑 - - } - + + { + supplierId ? '' : { + console.log('record', record) + setCurrentRow(await getDetail(record)) + qualificationFormRef.current?.setFieldsValue({ + ...record + }) + setAddQualification(true) + }} + > + 编辑 + + } + ); }, }, ]; // 当前查看供应商资质选中的供应商 - const [supplierId,setSupplierId] = useState() + const [supplierId, setSupplierId] = useState() const { RangePicker } = DatePicker; // 获取详情 const getDetail = async (record: QualificationModel) => { @@ -288,86 +288,86 @@ const SupplierList: React.FC<{ currentUser: CurrentUser | undefined }> = ({ curr return data } // 选项卡列表 - const [tabList,setTabList] = useState(currentUser?.UserPattern === 1000?[ - {label:'待办事项',number:0,value:1,icon:dealt,selectIcon:dealtSelect}, - {label:'我的申请',number:0,value:2,icon:owner,selectIcon:ownerSelect}, - ]:[ - {label:'待办事项',number:0,value:1,icon:dealt,selectIcon:dealtSelect}, - {label:'中标项目',number:0,value:2,icon:owner,selectIcon:ownerSelect}, - {label:'未中标项目',number:0,value:3,icon:owner,selectIcon:ownerSelect}, + const [tabList, setTabList] = useState(currentUser?.UserPattern === 1000 ? [ + { label: '待办事项', number: 0, value: 1, icon: dealt, selectIcon: dealtSelect }, + { label: '我的申请', number: 0, value: 2, icon: owner, selectIcon: ownerSelect }, + ] : [ + { label: '待办事项', number: 0, value: 1, icon: dealt, selectIcon: dealtSelect }, + { label: '中标项目', number: 0, value: 2, icon: owner, selectIcon: ownerSelect }, + { label: '未中标项目', number: 0, value: 3, icon: owner, selectIcon: ownerSelect }, ]) // 选中的标签 - const [selectTab,setSelectTab] = useState(1) + const [selectTab, setSelectTab] = useState(1) // 其他详情信息 - const [navList,setNavList] = useState( - currentUser?.UserPattern === 4000? + const [navList, setNavList] = useState( + currentUser?.UserPattern === 4000 ? [ - {label:'总业务',img:allBussiness,value:0}, - {label:'在招标',img:pendingBusiness,value:0}, - {label:'已完成',img:successBusiness,value:0} - ]: - [ - {label:'总业务',img:allBussiness,value:0}, - {label:'在招标',img:pendingBusiness,value:0}, - {label:'比价中',img:pendingBusiness,value:0}, - {label:'已完成',img:successBusiness,value:0} - ] + { label: '总业务', img: allBussiness, value: 0 }, + { label: '在招标', img: pendingBusiness, value: 0 }, + { label: '已完成', img: successBusiness, value: 0 } + ] : + [ + { label: '总业务', img: allBussiness, value: 0 }, + { label: '在招标', img: pendingBusiness, value: 0 }, + { label: '比价中', img: pendingBusiness, value: 0 }, + { label: '已完成', img: successBusiness, value: 0 } + ] ) // 待办事项的columns const waitColumns = [ { - title:
- + title:
+ 业务名称
, ellipsis: true, - dataIndex:'BID_NAME', + dataIndex: 'BID_NAME', hideInSearch: true, - align:'left', + align: 'left', }, { - title:
- + title:
+ 业务备注
, - dataIndex:'BID_DESC', + dataIndex: 'BID_DESC', ellipsis: true, hideInSearch: true, - align:'left', + align: 'left', }, { - title:
- + title:
+ 发起时间
, - dataIndex:'OPERATE_DATE', - width:180, + dataIndex: 'OPERATE_DATE', + width: 180, hideInSearch: true, - align:'center', + align: 'center', }, { - title:
- + title:
+ 比价时间
, - dataIndex:'compareTime', - width:300, + dataIndex: 'compareTime', + width: 300, hideInSearch: true, - align:'left', - render:(_,record)=>{ + align: 'left', + render: (_, record) => { return
-
+
{`${moment(record?.START_DATE).format('YYYY-MM-DD')}~${moment(record?.END_DATE).format('YYYY-MM-DD')}`} { - record.BID_STATE===9000?'': -
+ record.BID_STATE === 9000 ? '' : +
{ - record?.Remian? + record?.Remian ?
- + 还剩{record?.Remian} -
:'' +
: '' }
} @@ -377,20 +377,20 @@ const SupplierList: React.FC<{ currentUser: CurrentUser | undefined }> = ({ curr } }, { - title:
- + title:
+ 比价进度
, - dataIndex:'compareRate', - width:150, + dataIndex: 'compareRate', + width: 150, hideInSearch: true, - hideInTable: selectTab!==1, - align:'center', - render:(_,record)=>{ + hideInTable: selectTab !== 1, + align: 'center', + render: (_, record) => { return
-
1?100:(record?.BidSupplier/record?.TotalSupplier)*100}%`}}>
+
1 ? 100 : (record?.BidSupplier / record?.TotalSupplier) * 100}%` }}>
{`${record?.BidSupplier}/${record?.TotalSupplier}`}
@@ -398,27 +398,27 @@ const SupplierList: React.FC<{ currentUser: CurrentUser | undefined }> = ({ curr } }, { - title:
- + title:
+ 供应商
, - dataIndex:'SUPPLIER_NAME', + dataIndex: 'SUPPLIER_NAME', hideInSearch: true, - hideInTable: !(currentUser?.UserPattern === 1000 && selectTab===2), - align:'left', - width:320, - render:(_,record)=>{ + hideInTable: !(currentUser?.UserPattern === 1000 && selectTab === 2), + align: 'left', + width: 320, + render: (_, record) => { return
{ - record.BID_STATE===9000? -
-
-
+ record.BID_STATE === 9000 ? +
+
+
{record.WinSupplier}
-
: -
- {record.SUPPLIER_NAME} +
: +
+ {record.SUPPLIER_NAME}
{record.SUPPLIER_NAME}
@@ -428,64 +428,64 @@ const SupplierList: React.FC<{ currentUser: CurrentUser | undefined }> = ({ curr } }, { - title:
- + title:
+ 状态
, - dataIndex:'BID_STATE', - width:100, + dataIndex: 'BID_STATE', + width: 100, hideInSearch: true, - align:'center', + align: 'center', filters: true, onFilter: true, - valueEnum:{ - 2000:'报价中', - 3000:'比价中', + valueEnum: { + 2000: '报价中', + 3000: '比价中', }, - render:(_,record)=>{ + render: (_, record) => { return
-
-
-
- {record.BID_STATE===2000?'报价中':record.BID_STATE===3000?'比价中':'已审结'} +
+
+
+ {record.BID_STATE === 2000 ? '报价中' : record.BID_STATE === 3000 ? '比价中' : '已审结'}
} }, { - title:
- + title:
+ 操作
, - dataIndex:'', + dataIndex: '', hideInSearch: true, - width:100, - align:'center', - render:(_,record)=>{ + width: 100, + align: 'center', + render: (_, record) => { return <> - { + { setShowDetailDrawer(true) setCurrentItem(record) }}>详情 { - selectTab===1 && currentUser?.UserPattern === 1000? + selectTab === 1 && currentUser?.UserPattern === 1000 ? { - const data = await handleDeleteBIDList({BIDId:record.BID_ID}) - if (data.Result_Code===100){ + onConfirm={async () => { + const data = await handleDeleteBIDList({ BIDId: record.BID_ID }) + if (data.Result_Code === 100) { message.success(data.Result_Desc) tableRef.current?.reload() - }else{ + } else { message.error(data.Result_Desc) } }} okText="确认" cancelText="取消" > - 删除 - :'' + 删除 + : '' } } @@ -494,10 +494,10 @@ const SupplierList: React.FC<{ currentUser: CurrentUser | undefined }> = ({ curr // 供应商查看资质的方法 - const handleSearchQualification = (name: string)=>{ - if (supplierList && supplierList.length>0){ - supplierList.forEach((item: any)=>{ - if (item.label===name.split('(未参加)')[0]){ + const handleSearchQualification = (name: string) => { + if (supplierList && supplierList.length > 0) { + supplierList.forEach((item: any) => { + if (item.label === name.split('(未参加)')[0]) { setSupplierId(item.value) } }) @@ -512,48 +512,48 @@ const SupplierList: React.FC<{ currentUser: CurrentUser | undefined }> = ({ curr {/* 搜索的内容 */}
{ + onChange={(e: any) => { setSearchName(e.target.value) }} /> -
+
比价时间: { - if (e){ - setSearchTime([moment(e[0]._d),moment(e[1]._d)]) - }else{ + onChange={(e: any) => { + if (e) { + setSearchTime([moment(e[0]._d), moment(e[1]._d)]) + } else { setSearchTime(null) } }} />
-
+
配送时间: { - if (e){ - setDeliveryTime([moment(e[0]._d),moment(e[1]._d)]) - }else{ + onChange={(e: any) => { + if (e) { + setDeliveryTime([moment(e[0]._d), moment(e[1]._d)]) + } else { setDeliveryTime(null) } }} />
- @@ -565,32 +565,32 @@ const SupplierList: React.FC<{ currentUser: CurrentUser | undefined }> = ({ curr
{ - tabList.map((item: any)=>{ - return
{ + tabList.map((item: any) => { + return
{ setSelectTab(item.value) tableRef.current?.reload() }}> - + {item.label} { - item.number? - ({item.number}):'' + item.number ? + ({item.number}) : '' }
}) }
-
{ - navList.map((item: any)=>{ + navList.map((item: any) => { return
- +
{item.label} {item.value} @@ -603,38 +603,38 @@ const SupplierList: React.FC<{ currentUser: CurrentUser | undefined }> = ({ curr actionRef={tableRef} className={'proTable'} columns={waitColumns} - request={async (params: any)=>{ + request={async (params: any) => { const req = { - SearchParameter:{ - SUPPLIER_IDS: currentUser?.UserPattern === 4000?currentUser?.SupplierID:'', - SERVERPART_IDS:'', - BID_STATES:'', - STAFF_ID: currentUser?.UserPattern === 1000?currentUser?.ID:'', - START_DATE_End:searchTime && searchTime.length>0?moment(searchTime[0]).format('YYYY-MM-DD'):'', - END_DATE_Start:searchTime && searchTime.length>0?moment(searchTime[1]).format('YYYY-MM-DD'):'', - EFFECT_STARTDATE_End:deliveryTime && deliveryTime.length>0?moment(deliveryTime[1]).format('YYYY-MM-DD'):'', - EFFECT_ENDDATE_Start:deliveryTime && deliveryTime.length>0?moment(deliveryTime[0]).format('YYYY-MM-DD'):'', + SearchParameter: { + SUPPLIER_IDS: currentUser?.UserPattern === 4000 ? currentUser?.SupplierID : '', + SERVERPART_IDS: '', + BID_STATES: '', + STAFF_ID: currentUser?.UserPattern === 1000 ? currentUser?.ID : '', + START_DATE_End: searchTime && searchTime.length > 0 ? moment(searchTime[0]).format('YYYY-MM-DD') : '', + END_DATE_Start: searchTime && searchTime.length > 0 ? moment(searchTime[1]).format('YYYY-MM-DD') : '', + EFFECT_STARTDATE_End: deliveryTime && deliveryTime.length > 0 ? moment(deliveryTime[1]).format('YYYY-MM-DD') : '', + EFFECT_ENDDATE_Start: deliveryTime && deliveryTime.length > 0 ? moment(deliveryTime[0]).format('YYYY-MM-DD') : '', // OPERATE_DATE_Start:searchTime && searchTime.length>0?moment(searchTime[0]).format('YYYY-MM-DD'):'', // OPERATE_DATE_End:searchTime && searchTime.length>0?moment(searchTime[1]).format('YYYY-MM-DD'):'', - SELLER_ID:currentUser?.UserPattern === 1000 ?currentUser?.SellerId:'' + SELLER_ID: currentUser?.UserPattern === 1000 ? currentUser?.SellerId : '' }, keyWord: { // , - key:'BID_NAME,SUPPLIER_NAME,BID_DESC,COMMODITY_NAME,SERVERPART_NAME',value:searchName || '', + key: 'BID_NAME,SUPPLIER_NAME,BID_DESC,COMMODITY_NAME,SERVERPART_NAME', value: searchName || '', }, PageIndex: 1, PageSize: 999999, - Province_Code:currentUser?.ProvinceCode, - ShowWholePower:true, - sortStr:'OPERATE_DATE desc' + Province_Code: currentUser?.ProvinceCode, + ShowWholePower: true, + sortStr: 'OPERATE_DATE desc' } const data = await handleBIDList(req) // 接口会返回两个list分别对应两个tab 先用一个数组把两个数组变成一个大数组 然后在里面进行切换就不用再调接口了 let allList = [] - if (currentUser?.UserPattern === 1000){ - allList = [data.bIDInModels,data.bIDMyModels] - }else{ - allList = [data.bIDInModels ,data.bIDWinModels,data.bIDFailModels] + if (currentUser?.UserPattern === 1000) { + allList = [data.bIDInModels, data.bIDMyModels] + } else { + allList = [data.bIDInModels, data.bIDWinModels, data.bIDFailModels] } // // 大数组赋值 // setTableAllList(allList) @@ -642,14 +642,14 @@ const SupplierList: React.FC<{ currentUser: CurrentUser | undefined }> = ({ curr // setTableData(allList[selectTab - 1]) // 拿到一开始有初始数据的tab数组 对他进行赋值 让它括号内的数据可以显示 const newTableList: any = JSON.parse(JSON.stringify(tabList)) - newTableList.forEach((item: any)=>{ - if (item.label==='待办事项'){ + newTableList.forEach((item: any) => { + if (item.label === '待办事项') { item.number = data.bIDInModels?.length || 0 - }else if(item.label === '我的申请'){ + } else if (item.label === '我的申请') { item.number = data.bIDMyModels?.length || 0 - }else if(item.label === '中标项目'){ + } else if (item.label === '中标项目') { item.number = data.bIDWinModels?.length || 0 - }else if(item.label === '未中标项目'){ + } else if (item.label === '未中标项目') { item.number = data.bIDFailModels?.length || 0 } }) @@ -657,24 +657,24 @@ const SupplierList: React.FC<{ currentUser: CurrentUser | undefined }> = ({ curr setTabList(newTableList) // 表格上方那个总览框的初始数据 并对齐进行赋值 const navDetail: any = JSON.parse(JSON.stringify(navList)) - navDetail.forEach((item: any)=>{ - if (item.label==='总业务'){ + navDetail.forEach((item: any) => { + if (item.label === '总业务') { item.value = data.TotalCount - }else if(item.label==='在招标'){ + } else if (item.label === '在招标') { item.value = data.InBidCount - }else if(item.label==='比价中'){ + } else if (item.label === '比价中') { item.value = data.SelectBidCount - }else if(item.label==='已完成'){ + } else if (item.label === '已完成') { item.value = data.CompleteBidCount } }) setNavList(navDetail) - return { data:allList[selectTab - 1],success:true} + return { data: allList[selectTab - 1], success: true } }} search={false} options={false} - scroll={{y:'calc(100vh - 525px)'}} - pagination={{pageSize:10}} + scroll={{ y: 'calc(100vh - 525px)' }} + pagination={{ pageSize: 10 }} >
@@ -691,24 +691,24 @@ const SupplierList: React.FC<{ currentUser: CurrentUser | undefined }> = ({ curr bodyStyle={{ backgroundColor: "#f9f9f9", padding: 0 }} footer={ // 当状态是9000的时候说明已经审结了 就不会显示按钮 - currentItem?.BID_STATE!==9000? - // 当用户为1000时 说明是商户 显示对应的按钮 另一个是4000的情况 - currentUser?.UserPattern === 1000? -
- + currentItem?.BID_STATE !== 9000 ? + // 当用户为1000时 说明是商户 显示对应的按钮 另一个是4000的情况 + currentUser?.UserPattern === 1000 ? +
+ - {/* */} -
: -
- -
- - -
-
- :'' + {/* */} +
: +
+ +
+ + +
+
+ : '' } closable={false} zIndex={99} > {/* 抽屜内显示的东西变为一个组件 往里面传参就可以 */} - + {/* 新增比价申请 */} = ({ curr // 新增只有商户可以 所以直接写死 无需判断
- ] + actions: supplierId ? [] : [ + ] }} /> @@ -927,14 +927,14 @@ const SupplierList: React.FC<{ currentUser: CurrentUser | undefined }> = ({ curr bodyStyle={{ padding: 0 }} width={600} onOk={async () => { - if (submitSupplierID){ + if (submitSupplierID) { const req = { - BID_ID:currentItem.BID_ID, - SUPPLIER_ID:submitSupplierID + BID_ID: currentItem.BID_ID, + SUPPLIER_ID: submitSupplierID } const data = await handleCompareSubmit(req) message.success(data.Result_Desc); - if (data.Result_Code===100){ + if (data.Result_Code === 100) { actionRef.current?.reload() tableRef.current?.reload() setSubmitModal(false) @@ -943,18 +943,18 @@ const SupplierList: React.FC<{ currentUser: CurrentUser | undefined }> = ({ curr setShowDetailDrawer(false); setCurrentItem(null) } - }else{ + } else { message.error('请选择供应商') } }}> -
+

请选择供应商