Commit 8e53c628 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

Merge branch 'dev-srm' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform into dev-srm

parents ba38a461 a831cc6d
...@@ -24,12 +24,13 @@ const Search = props => { ...@@ -24,12 +24,13 @@ const Search = props => {
const justifyAlign = align || 'flex-end'; const justifyAlign = align || 'flex-end';
const changeFilterVisible = () => { const changeFilterVisible = () => {
if (state.filterSearch) { /** 隐藏的时候没必要清除, 隐藏下 提交值默认为undefined, 这里如果对niceForm下做初始值的时候,隐藏了即重置了高级筛选下的字段会把初始值也去掉了 */
props.form.reset({ // if (state.filterSearch) {
// 清除FILTER_PARAMS下所有字段 // props.form.reset({
selector: `*.${FORM_FILTER_PATH}.*`, // // 清除FILTER_PARAMS下所有字段
}); // selector: `*.${FORM_FILTER_PATH}.*`,
} // });
// }
setState({ setState({
filterSearch: !state.filterSearch, filterSearch: !state.filterSearch,
}); });
......
...@@ -16,7 +16,7 @@ const useSetSearchValueInTable = () => { ...@@ -16,7 +16,7 @@ const useSetSearchValueInTable = () => {
return {} return {}
} }
return { return {
initialValues: cacheData value: cacheData
} }
}, [cacheData]) }, [cacheData])
...@@ -24,8 +24,6 @@ const useSetSearchValueInTable = () => { ...@@ -24,8 +24,6 @@ const useSetSearchValueInTable = () => {
setSearchData(null); setSearchData(null);
}, []) }, [])
return { return {
searchData: cacheData, searchData: cacheData,
formatInitialValue, formatInitialValue,
......
...@@ -59,7 +59,6 @@ const SettlementList = () => { ...@@ -59,7 +59,6 @@ const SettlementList = () => {
...searchParams, ...searchParams,
status: searchParams.status || '0', status: searchParams.status || '0',
orderType: searchParams.orderType || '0', orderType: searchParams.orderType || '0',
} }
const { data } = await PublicApi.getSettleAccountsMemberSettlementPagePayableSettlement(postData); const { data } = await PublicApi.getSettleAccountsMemberSettlementPagePayableSettlement(postData);
return data return data
......
...@@ -22,6 +22,7 @@ import Voucher from '../../components/Voucher'; ...@@ -22,6 +22,7 @@ import Voucher from '../../components/Voucher';
import ConfirmAccount from '../../components/ConfirmAccount'; import ConfirmAccount from '../../components/ConfirmAccount';
import { usePageStatus } from '@/hooks/usePageStatus'; import { usePageStatus } from '@/hooks/usePageStatus';
import useSetSearchValueInTable from '@/hooks/useSetSearchValueInTable'; import useSetSearchValueInTable from '@/hooks/useSetSearchValueInTable';
import { Moment } from 'moment';
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
...@@ -30,8 +31,8 @@ const formActions = createFormActions(); ...@@ -30,8 +31,8 @@ const formActions = createFormActions();
type requestDataType = { type requestDataType = {
status: number, status: number,
orderType: string | number, orderType: string | number,
startTime: string, startTime?: Moment,
endTime: string, endTime?: Moment,
settlementName: string, settlementName: string,
payName: string, payName: string,
settlementNo: number, settlementNo: number,
...@@ -41,18 +42,21 @@ type requestDataType = { ...@@ -41,18 +42,21 @@ type requestDataType = {
const SettlementList = () => { const SettlementList = () => {
const ref = useRef<any>({}) const ref = useRef<any>({})
const { searchData, formatInitialValue } = useSetSearchValueInTable(); const { searchData, formatInitialValue, clear } = useSetSearchValueInTable();
const [files, setFiles] = useState<any>([]); const [files, setFiles] = useState<any>([]);
const { columns, confirmPayInfo, confirmPayVisible, reconciliationInfo, reconciliationVisible, viewVisible, payVoucherInfo, viewModalonCancel, confirmPayOnCancel, reconciliationOnCancel } = useFetchColumns("receiveable") const { columns, confirmPayInfo, confirmPayVisible, reconciliationInfo, reconciliationVisible, viewVisible, payVoucherInfo, viewModalonCancel, confirmPayOnCancel, reconciliationOnCancel } = useFetchColumns("receiveable")
const fetchListData = async (params: requestDataType) => { const fetchListData = async (params: requestDataType) => {
const searchParams = { const searchParams = {
...params,
orderType: params.orderType || '0',
status: params.status || '0',
...searchData, ...searchData,
...params,
} }
const { data } = await PublicApi.getSettleAccountsMemberSettlementPageReceivableSettlement(searchParams as any); const postData = {
...searchParams,
status: searchParams.status || '0',
orderType: searchParams.orderType || '0',
}
const { data } = await PublicApi.getSettleAccountsMemberSettlementPageReceivableSettlement(postData as any);
return data return data
} }
...@@ -93,7 +97,7 @@ const SettlementList = () => { ...@@ -93,7 +97,7 @@ const SettlementList = () => {
/** /**
* 搜索 * 搜索
*/ */
const handleSearch = (values: any) => { const handleSearch = (values: requestDataType) => {
const format = 'YYYY-MM-DD' const format = 'YYYY-MM-DD'
const startTime = values.startTime?.format(format); const startTime = values.startTime?.format(format);
const endTime = values.endTime ? values.endTime.endOf("day").format('YYYY-MM-DD HH:mm:ss') : ""; const endTime = values.endTime ? values.endTime.endOf("day").format('YYYY-MM-DD HH:mm:ss') : "";
...@@ -129,6 +133,9 @@ const SettlementList = () => { ...@@ -129,6 +133,9 @@ const SettlementList = () => {
}} }}
schema={schema} schema={schema}
onSubmit={handleSearch} onSubmit={handleSearch}
onReset={() => {
clear()
}}
{...formatInitialValue} {...formatInitialValue}
/> />
} }
......
...@@ -27,6 +27,7 @@ import useFetchColumns from '../../hooks/useFetchColumns'; ...@@ -27,6 +27,7 @@ import useFetchColumns from '../../hooks/useFetchColumns';
import { STATUS_TEXT } from '@/constants/balance'; import { STATUS_TEXT } from '@/constants/balance';
import { numFormat, priceFormat } from '@/utils/numberFomat'; import { numFormat, priceFormat } from '@/utils/numberFomat';
import useSetSearchValueInTable from '@/hooks/useSetSearchValueInTable'; import useSetSearchValueInTable from '@/hooks/useSetSearchValueInTable';
import { GetSettleAccountsPlatformSettlementPageReceivableSettlementRequest } from '@/services/SettleV2Api';
const formActions = createFormActions(); const formActions = createFormActions();
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
...@@ -103,11 +104,14 @@ const AccountReceivable = () => { ...@@ -103,11 +104,14 @@ const AccountReceivable = () => {
const { retColumn } = useIsExistBrokerage(columns, ["brokerage"]); const { retColumn } = useIsExistBrokerage(columns, ["brokerage"]);
const fetchListData = async (params) => { const fetchListData = async (params: GetSettleAccountsPlatformSettlementPageReceivableSettlementRequest) => {
const postData = { const searchParams = {
...searchData,
...params, ...params,
status: params.status || 0, }
...searchData const postData = {
...searchParams,
status: searchParams.status || '0',
} }
const { data } = await PublicApi.getSettleAccountsPlatformSettlementPageReceivableSettlement(postData); const { data } = await PublicApi.getSettleAccountsPlatformSettlementPageReceivableSettlement(postData);
return data return data
......
...@@ -25,6 +25,7 @@ import ConfirmAccount from '../../components/ConfirmAccount'; ...@@ -25,6 +25,7 @@ import ConfirmAccount from '../../components/ConfirmAccount';
import { COMPLETED, TO_BE_COLLECTED, TO_BE_RECONCILED } from '../../common/constants'; import { COMPLETED, TO_BE_COLLECTED, TO_BE_RECONCILED } from '../../common/constants';
import { STATUS_TEXT } from '@/constants/balance'; import { STATUS_TEXT } from '@/constants/balance';
import useSetSearchValueInTable from '@/hooks/useSetSearchValueInTable'; import useSetSearchValueInTable from '@/hooks/useSetSearchValueInTable';
import { GetSettleAccountsPlatformScoreSettlementPageReceivableSettlementRequest } from '@/services/SettleV2Api';
const formActions = createFormActions(); const formActions = createFormActions();
const Integral: React.FC = () => { const Integral: React.FC = () => {
...@@ -44,7 +45,7 @@ const Integral: React.FC = () => { ...@@ -44,7 +45,7 @@ const Integral: React.FC = () => {
handleViewPayModal handleViewPayModal
} = useFetchColumns("receiveable"); } = useFetchColumns("receiveable");
const [files, setFiles] = useState([]); const [files, setFiles] = useState([]);
const { searchData, formatInitialValue } = useSetSearchValueInTable(); const { searchData, formatInitialValue, clear } = useSetSearchValueInTable();
const columns = [ const columns = [
{ {
...@@ -101,11 +102,14 @@ const Integral: React.FC = () => { ...@@ -101,11 +102,14 @@ const Integral: React.FC = () => {
} }
] ]
const fetchListData = async (params) => { const fetchListData = async (params: GetSettleAccountsPlatformScoreSettlementPageReceivableSettlementRequest) => {
const postData = { const searchParams = {
...params,
status: params.status || 0,
...searchData, ...searchData,
...params,
}
const postData = {
...searchParams,
status: searchParams.status || '0',
} }
// /settle/accounts/platform/score/settlement/pageReceivableSettlement // /settle/accounts/platform/score/settlement/pageReceivableSettlement
const { data } = await PublicApi.getSettleAccountsPlatformScoreSettlementPageReceivableSettlement(postData); const { data } = await PublicApi.getSettleAccountsPlatformScoreSettlementPageReceivableSettlement(postData);
...@@ -114,7 +118,6 @@ const Integral: React.FC = () => { ...@@ -114,7 +118,6 @@ const Integral: React.FC = () => {
/** /**
* 确认对账 * 确认对账
* @param {cancel: function, id: number} cancel 为关闭回调函数
*/ */
const handleConfirm = async (params: {id: number}) => { const handleConfirm = async (params: {id: number}) => {
const { code } = await PublicApi.postSettleAccountsPlatformScoreSettlementConfirmAccountComplete({settlementId: params.id}) const { code } = await PublicApi.postSettleAccountsPlatformScoreSettlementConfirmAccountComplete({settlementId: params.id})
...@@ -182,8 +185,9 @@ const Integral: React.FC = () => { ...@@ -182,8 +185,9 @@ const Integral: React.FC = () => {
schema={schema} schema={schema}
onSubmit={handleSearch} onSubmit={handleSearch}
onReset={() => { onReset={() => {
formActions.setFieldValue('startTime', null); clear()
formActions.setFieldValue('endTime', null); // formActions.setFieldValue('startTime', null);
// formActions.setFieldValue('endTime', null);
}} }}
{...formatInitialValue} {...formatInitialValue}
/> />
......
import React, { useState, useEffect, useRef, ReactNode } from 'react' import React, { useState, useEffect, useRef, ReactNode, useMemo } from 'react'
import { history } from 'umi' import { history } from 'umi'
import { Button, Form, Card, Modal, Result, Progress, Select, Tooltip, Checkbox, Row, Col, Dropdown, Input, Menu, Space, message, InputNumber } from 'antd' import { Button, Form, Card, Modal, Result, Progress, Select, Tooltip, Checkbox, Row, Col, Dropdown, Input, Menu, Space, message, InputNumber } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
...@@ -24,6 +24,7 @@ import NiceForm from '@/components/NiceForm' ...@@ -24,6 +24,7 @@ import NiceForm from '@/components/NiceForm'
import { createFormActions, FormEffectHooks } from '@formily/antd' import { createFormActions, FormEffectHooks } from '@formily/antd'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch' import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { searchBrandOptionEffect, searchCustomerCategoryOptionEffect } from './effect' import { searchBrandOptionEffect, searchCustomerCategoryOptionEffect } from './effect'
import useSetSearchValueInTable from '@/hooks/useSetSearchValueInTable'
const { Option } = Select; const { Option } = Select;
const { confirm } = Modal; const { confirm } = Modal;
...@@ -62,6 +63,21 @@ const Products: React.FC<{}> = () => { ...@@ -62,6 +63,21 @@ const Products: React.FC<{}> = () => {
const [isDisabledOKbtn, setIsDisabledOKbtn] = useState<boolean>(false) const [isDisabledOKbtn, setIsDisabledOKbtn] = useState<boolean>(false)
const [shopId, setShopId] = useState<any>() const [shopId, setShopId] = useState<any>()
/** 带参数查询,给表单带默认值 */
const { searchData, formatInitialValue, clear } = useSetSearchValueInTable();
const formatedFormValue = useMemo(() => {
const value = formatInitialValue?.value || {};
if (value && "statusList" in value) {
return {
value: {
...value,
statusList: +value.statusList
}
}
}
return value
}, [formatInitialValue])
const columns: ColumnType<any>[] = [ const columns: ColumnType<any>[] = [
{ {
...@@ -237,8 +253,16 @@ const Products: React.FC<{}> = () => { ...@@ -237,8 +253,16 @@ const Products: React.FC<{}> = () => {
} }
const fetchData = (params: any) => { const fetchData = (params: any) => {
const searchParams = {
...searchData,
...params,
}
const postData = {
...searchParams,
statusList: searchParams?.statusList || '',
}
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
PublicApi.getProductCommodityGetCommodityList(params).then(res => { PublicApi.getProductCommodityGetCommodityList(postData).then(res => {
const { data } = res const { data } = res
resolve(data) resolve(data)
}) })
...@@ -600,6 +624,10 @@ const Products: React.FC<{}> = () => { ...@@ -600,6 +624,10 @@ const Products: React.FC<{}> = () => {
}) })
}} }}
schema={productSchema} schema={productSchema}
{ ...formatedFormValue }
onReset={() => {
clear()
}}
/> />
} }
/> />
......
...@@ -21,7 +21,7 @@ const ADD_REPOSITORIES = '/memberCenter/commodityAbility/repositories/add'; ...@@ -21,7 +21,7 @@ const ADD_REPOSITORIES = '/memberCenter/commodityAbility/repositories/add';
// 3、设置库存:判断当前用户是否有仓位库存管理权限,有则显示设置库存按钮,点击跳转能力中心-商品能力-仓位管理--新增仓位库存 // 3、设置库存:判断当前用户是否有仓位库存管理权限,有则显示设置库存按钮,点击跳转能力中心-商品能力-仓位管理--新增仓位库存
const ProductCenter: React.FC<Iprops> = () => { const ProductCenter: React.FC<Iprops> = () => {
const { loading, responseData, isError, ref } = useViewRequest<GetReportMemberHomeGetCommodityTallyResponse, any>(PublicApi.getReportMemberHomeGetCommodityTally, {}) const { loading, responseData, isError, ref, withQueryParams } = useViewRequest<GetReportMemberHomeGetCommodityTallyResponse, any>(PublicApi.getReportMemberHomeGetCommodityTally, {})
const { userAuth, hasAbilityFunc } = useGetAuth(); const { userAuth, hasAbilityFunc } = useGetAuth();
const hasAbility = hasAbilityFunc('commodityAbility'); const hasAbility = hasAbilityFunc('commodityAbility');
...@@ -39,6 +39,30 @@ const ProductCenter: React.FC<Iprops> = () => { ...@@ -39,6 +39,30 @@ const ProductCenter: React.FC<Iprops> = () => {
authUrl: ADD_REPOSITORIES authUrl: ADD_REPOSITORIES
}, },
], []) ], [])
/** @review 就离谱, 搜索状态值拼接到链接上,后端不做交给了前端。坑啊 */
const withParamsList = useMemo(() => {
const status = {
"商品总数": "",
"品牌总数": "",
"待提交审核商品": "statusList=1",
"待上架商品": "statusList=2",
"待提交审核品牌": "status=1",
}
return status
}, [])
const formatDataWithLink = useMemo(() => {
// const newData = [...responseData];
const newData = responseData?.map((_item) => {
return {
..._item,
link: `${_item.link}?${withParamsList[_item.name]}`
}
})
return newData
}, [responseData, withParamsList])
return ( return (
<Layout <Layout
hasAuth={hasAbility} hasAuth={hasAbility}
...@@ -70,7 +94,7 @@ const ProductCenter: React.FC<Iprops> = () => { ...@@ -70,7 +94,7 @@ const ProductCenter: React.FC<Iprops> = () => {
<span className={styles.rowTitle}>商品</span> <span className={styles.rowTitle}>商品</span>
<div className={styles.rowValues}> <div className={styles.rowValues}>
{ {
responseData && responseData.map((item: GetReportMemberHomeGetCommodityTallyResponse[0], key) => { formatDataWithLink?.map((item: GetReportMemberHomeGetCommodityTallyResponse[0], key) => {
return ( return (
<div className={styles.wrapCol} key={key}> <div className={styles.wrapCol} key={key}>
<div className={styles.colTitle}>{item.name}</div> <div className={styles.colTitle}>{item.name}</div>
......
...@@ -73,6 +73,8 @@ function useViewRequest<T, P>(fn: (postData: P) => Promise<ResponseDataType & { ...@@ -73,6 +73,8 @@ function useViewRequest<T, P>(fn: (postData: P) => Promise<ResponseDataType & {
return filterEmptyList && Object.keys(filterEmptyList).length === 0; return filterEmptyList && Object.keys(filterEmptyList).length === 0;
}, [filterEmptyList]) }, [filterEmptyList])
/** 商品中心不适用, 就不直接兼容了 */
const withQueryParams = useCallback((withParamsList: { [key: string]: { [name: string]: string } }) => { const withQueryParams = useCallback((withParamsList: { [key: string]: { [name: string]: string } }) => {
const newData = {...filterEmptyList} const newData = {...filterEmptyList}
Object.keys(withParamsList).forEach((_item) => { Object.keys(withParamsList).forEach((_item) => {
......
import React, { useEffect, useMemo, useState } from 'react'; import React, { useEffect, useMemo, useState } from 'react';
import { Card, Button } from 'antd'; import { Card, Button, message } from 'antd';
import { history } from 'umi'; import { history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { LinkOutlined, PlusOutlined, SaveOutlined } from '@ant-design/icons'; import { LinkOutlined, PlusOutlined, SaveOutlined } from '@ant-design/icons';
...@@ -98,8 +98,11 @@ const EvaluateAdd = (props) => { ...@@ -98,8 +98,11 @@ const EvaluateAdd = (props) => {
const onSubmit = async (values: SubmitDataType) => { const onSubmit = async (values: SubmitDataType) => {
const { items, appraisalDayStart, appraisalDayEnd, attachments, selectedProject, verifySteps, history: anyHistory, currentStep, ...rest } = values const { items, appraisalDayStart, appraisalDayEnd, attachments, selectedProject, verifySteps, history: anyHistory, currentStep, ...rest } = values
// 计算权重
let totalScoreWeight = 0
const projectList = items.map((_item) => { const projectList = items.map((_item) => {
const { sendAppraisal, memberName, score, templates, reports, type, ...otherProps } = _item; const { sendAppraisal, memberName, score, templates, reports, type, ...otherProps } = _item;
totalScoreWeight += +_item.scoreWeight;
return { return {
userId: _item.memberName.userId, userId: _item.memberName.userId,
userName: _item.memberName.name, userName: _item.memberName.name,
...@@ -116,6 +119,10 @@ const EvaluateAdd = (props) => { ...@@ -116,6 +119,10 @@ const EvaluateAdd = (props) => {
...otherProps ...otherProps
} }
}) })
if (totalScoreWeight > 100) {
message.error(`添加的评估项目的权重和为${totalScoreWeight}, 大于100, 请修改`);
return
}
const tempPostData = { const tempPostData = {
...rest, ...rest,
...@@ -186,7 +193,6 @@ const EvaluateAdd = (props) => { ...@@ -186,7 +193,6 @@ const EvaluateAdd = (props) => {
})) || [] })) || []
// const withProjectId = new Set(tempData.map((_item) => _item.id)); // const withProjectId = new Set(tempData.map((_item) => _item.id));
const dataSource = formActions.getFieldValue('tabs.tab-2.items') || []; const dataSource = formActions.getFieldValue('tabs.tab-2.items') || [];
console.log("dataSource", dataSource);
// 对比两个数据, 如果dataSource 中 有 tempData 的值, 那么保留,如果没有择去除(没有id项) // 对比两个数据, 如果dataSource 中 有 tempData 的值, 那么保留,如果没有择去除(没有id项)
const dataSourceKey = new Set(Array.from(dataSource?.map((_item) => _item.type)).filter(Boolean)); const dataSourceKey = new Set(Array.from(dataSource?.map((_item) => _item.type)).filter(Boolean));
// 获取新增组 // 获取新增组
...@@ -215,9 +221,10 @@ const EvaluateAdd = (props) => { ...@@ -215,9 +221,10 @@ const EvaluateAdd = (props) => {
const numberIndex = FormPath.transform(name, /\d/, $1 => { const numberIndex = FormPath.transform(name, /\d/, $1 => {
return `${$1}` return `${$1}`
}); });
const scoreWeight = formActions.getFieldValue(`items.${numberIndex}.grade`) || 0 const scoreWeight = formActions.getFieldValue(`items.${numberIndex}.scoreWeight`) || 0
const grade = formActions.getFieldValue(`items.${numberIndex}.scoreWeight`) || 0; const grade = formActions.getFieldValue(`items.${numberIndex}.grade`) || 0;
formActions.setFieldValue(`items.${numberIndex}.score`, scoreWeight * grade / 100); console.log(scoreWeight)
formActions.setFieldValue(`items.${numberIndex}.score`, +scoreWeight !== 0 ? scoreWeight * grade / 100 : grade);
}) })
} }
...@@ -261,7 +268,6 @@ const EvaluateAdd = (props) => { ...@@ -261,7 +268,6 @@ const EvaluateAdd = (props) => {
type: _row.type, type: _row.type,
} }
}) })
console.log(itmesList)
return { return {
appraisalDayStart: moment(appraisalDayEnd, 'YYYY-MM-DD'), appraisalDayStart: moment(appraisalDayEnd, 'YYYY-MM-DD'),
appraisalDayEnd: moment(appraisalDayEnd, 'YYYY-MM-DD'), appraisalDayEnd: moment(appraisalDayEnd, 'YYYY-MM-DD'),
......
...@@ -92,9 +92,8 @@ export const evaluateAddSchema: ISchema = { ...@@ -92,9 +92,8 @@ export const evaluateAddSchema: ISchema = {
}, },
attachments: { attachments: {
title: '附件', title: '附件',
type: 'object', type: 'array',
'x-component': 'FormilyUploadFiles', 'x-component': 'FormilyUploadFiles',
required: true,
} }
} }
} }
......
...@@ -39,7 +39,7 @@ const BasicInfo: React.FC<IBasicInfo> = ({ title }) => { ...@@ -39,7 +39,7 @@ const BasicInfo: React.FC<IBasicInfo> = ({ title }) => {
span: 8, span: 8,
fieldList: [ fieldList: [
{ title: '招标项目:', name: 'projectName' }, { title: '招标项目:', name: 'projectName' },
{ title: '项目预算:', name: 'budget' }, { title: '项目预算:', name: 'budget', render: (t) => `¥${t}` },
{ title: '采购类型:', name: 'purchaseType', render: (text) => PURCHASE_TYPE[text] }, { title: '采购类型:', name: 'purchaseType', render: (text) => PURCHASE_TYPE[text] },
{ title: '招标会员:', name: 'memberName' }, { title: '招标会员:', name: 'memberName' },
] ]
......
...@@ -39,7 +39,7 @@ const BasicInfo: React.FC<IBasicInfo> = ({ title }) => { ...@@ -39,7 +39,7 @@ const BasicInfo: React.FC<IBasicInfo> = ({ title }) => {
span: 8, span: 8,
fieldList: [ fieldList: [
{ title: '招标项目:', name: 'projectName' }, { title: '招标项目:', name: 'projectName' },
{ title: '项目预算:', name: 'budget' }, { title: '项目预算:', name: 'budget', render: (t) => `¥${t}` },
{ title: '采购类型:', name: 'purchaseType', render: (text) => PURCHASE_TYPE[text] }, { title: '采购类型:', name: 'purchaseType', render: (text) => PURCHASE_TYPE[text] },
{ title: '招标会员:', name: 'memberName' }, { title: '招标会员:', name: 'memberName' },
] ]
......
...@@ -39,7 +39,7 @@ const BasicInfo: React.FC<IBasicInfo> = ({ title }) => { ...@@ -39,7 +39,7 @@ const BasicInfo: React.FC<IBasicInfo> = ({ title }) => {
span: 8, span: 8,
fieldList: [ fieldList: [
{ title: '招标项目:', name: 'projectName' }, { title: '招标项目:', name: 'projectName' },
{ title: '项目预算:', name: 'budget' }, { title: '项目预算:', name: 'budget', render: (t) => `¥${t}` },
{ title: '采购类型:', name: 'purchaseType', render: (text) => PURCHASE_TYPE[text] }, { title: '采购类型:', name: 'purchaseType', render: (text) => PURCHASE_TYPE[text] },
{ title: '招标会员:', name: 'memberName' }, { title: '招标会员:', name: 'memberName' },
] ]
......
...@@ -39,7 +39,7 @@ const BasicInfo: React.FC<IBasicInfo> = ({ title }) => { ...@@ -39,7 +39,7 @@ const BasicInfo: React.FC<IBasicInfo> = ({ title }) => {
span: 8, span: 8,
fieldList: [ fieldList: [
{ title: '招标项目:', name: 'projectName' }, { title: '招标项目:', name: 'projectName' },
{ title: '项目预算:', name: 'budget' }, { title: '项目预算:', name: 'budget', render: (t) => `¥${t}` },
{ title: '采购类型:', name: 'purchaseType', render: (text) => PURCHASE_TYPE[text] }, { title: '采购类型:', name: 'purchaseType', render: (text) => PURCHASE_TYPE[text] },
{ title: '招标会员:', name: 'memberName' }, { title: '招标会员:', name: 'memberName' },
] ]
......
...@@ -57,7 +57,7 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => { ...@@ -57,7 +57,7 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => {
span: 8, span: 8,
fieldList: [ fieldList: [
{ title: '招标项目:', name: 'projectName' }, { title: '招标项目:', name: 'projectName' },
{ title: '项目预算:', name: 'budget' }, { title: '项目预算:', name: 'budget', render: (t) => `¥${t}` },
{ title: '采购类型:', name: 'purchaseType', render: (text) => PURCHASE_TYPE[text] }, { title: '采购类型:', name: 'purchaseType', render: (text) => PURCHASE_TYPE[text] },
{ title: '招标会员:', name: 'memberName' }, { title: '招标会员:', name: 'memberName' },
{ title: '招标摘要:', name: 'remark' }, { title: '招标摘要:', name: 'remark' },
...@@ -157,7 +157,7 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => { ...@@ -157,7 +157,7 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => {
span: 8, span: 8,
fieldList: [ fieldList: [
{ title: '期望交付日期:', name: 'hopeDate', render: (text) => formatTimeString(text) }, { title: '期望交付日期:', name: 'hopeDate', render: (text) => formatTimeString(text) },
{ title: '目标价:', name: 'targetPrice' }, { title: '目标价:', name: 'targetPrice', render: (t) => `¥${t}` },
] ]
}, },
{ {
...@@ -440,8 +440,8 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => { ...@@ -440,8 +440,8 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => {
/** 类型数据映射 */ /** 类型数据映射 */
const Type_Data_Map = { const Type_Data_Map = {
// 当详情模式为投标详情并且投标外部状态投完标才有对应的投标基本信息显示 // 招标大类显示招标信息 投标大类显示投标信息
'basicInfo': apiType[apiType.length-1] === 'r' ? basicTenderColumnList : basicColumnList, 'basicInfo': apiType[0] === 'c' ? basicColumnList : basicTenderColumnList,
'bidNeed': callForNeedList, 'bidNeed': callForNeedList,
'registerNeed': registerNeedList, 'registerNeed': registerNeedList,
'checkNeed': checkNeedList, 'checkNeed': checkNeedList,
......
...@@ -115,6 +115,9 @@ export const formSchema: ISchema = { ...@@ -115,6 +115,9 @@ export const formSchema: ISchema = {
type: 'string', type: 'string',
title: '目标价', title: '目标价',
readOnly: true, readOnly: true,
'x-component-props': {
addonBefore: "¥",
},
}, },
inviteTenderRequirement: { inviteTenderRequirement: {
type: 'string', type: 'string',
......
import React, { ReactNode, useRef, useEffect } from 'react' import React, { ReactNode, useRef, useEffect, useMemo } from 'react'
import { history } from 'umi' import { history } from 'umi'
import { Button, Popconfirm, Card, message, Dropdown, Menu, Modal, Space } from 'antd' import { Button, Popconfirm, Card, message, Dropdown, Menu, Modal, Space } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
...@@ -19,6 +19,7 @@ import { createFormActions } from '@formily/antd' ...@@ -19,6 +19,7 @@ import { createFormActions } from '@formily/antd'
import { FORM_FILTER_PATH } from '@/formSchema/const' import { FORM_FILTER_PATH } from '@/formSchema/const'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch' import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import Submit from '@/components/NiceForm/components/Submit' import Submit from '@/components/NiceForm/components/Submit'
import useSetSearchValueInTable from '@/hooks/useSetSearchValueInTable'
const { confirm } = Modal const { confirm } = Modal
...@@ -26,10 +27,34 @@ const formActions = createFormActions(); ...@@ -26,10 +27,34 @@ const formActions = createFormActions();
const Trademark: React.FC<{}> = () => { const Trademark: React.FC<{}> = () => {
const ref = useRef<any>({}) const ref = useRef<any>({})
/** 带参数查询,给表单带默认值 */
const { searchData, formatInitialValue, clear } = useSetSearchValueInTable();
const formatedFormValue = useMemo(() => {
const value = formatInitialValue?.value || {};
if (value && "status" in value) {
return {
value: {
...value,
status: +value.status
}
}
}
return value
}, [formatInitialValue])
const fetchData = (params: any) => { const fetchData = (params: any) => {
const searchParams = {
...searchData,
...params,
}
const postData = {
...searchParams,
name: searchParams?.name || '',
status: searchParams?.status || 0,
}
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
PublicApi.getProductBrandGetBrandList({ ...params, name: params.name || '', status: params.status || 0 }).then(res => { PublicApi.getProductBrandGetBrandList(postData).then(res => {
const { data } = res const { data } = res
resolve(data) resolve(data)
}) })
...@@ -286,6 +311,10 @@ const Trademark: React.FC<{}> = () => { ...@@ -286,6 +311,10 @@ const Trademark: React.FC<{}> = () => {
} }
}} }}
onSubmit={values => ref.current.reload(values)} onSubmit={values => ref.current.reload(values)}
onReset={() => {
clear()
}}
{...formatedFormValue}
/> />
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment