Commit 8cb08eb2 authored by GuanHua's avatar GuanHua

Merge branch 'dev-srm' into v2

parents 4cd9f946 7effb3e1
...@@ -42,6 +42,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -42,6 +42,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
onClick onClick
} = props; } = props;
const [flag, setFlag] = useState<boolean>(false); const [flag, setFlag] = useState<boolean>(false);
console.log(record)
const [product, setProduct] = useState<any>({}); const [product, setProduct] = useState<any>({});
const [attribute, setAttribute] = useState<any>([]); const [attribute, setAttribute] = useState<any>([]);
const handleAnchorClick = (e) => { const handleAnchorClick = (e) => {
...@@ -63,11 +64,13 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -63,11 +64,13 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
setProduct(params); setProduct(params);
GetCommodityAttribute(params.id); GetCommodityAttribute(params.id);
setFlag(false); setFlag(false);
} }
/** 关闭 */ /** 关闭 */
const handleClose = () => { const handleClose = () => {
onClose() onClose()
setProduct({})
} }
/** 确定 */ /** 确定 */
const handleConfirm = () => { const handleConfirm = () => {
...@@ -75,6 +78,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -75,6 +78,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
product, product,
attribute attribute
}) })
setProduct({})
} }
return ( return (
<> <>
...@@ -94,10 +98,10 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -94,10 +98,10 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
> >
<Button onClick={handleClose} style={{ marginRight: 8 }}> <Button onClick={handleClose} style={{ marginRight: 8 }}>
取消 取消
</Button> </Button>
<Button onClick={handleConfirm} type="primary"> <Button onClick={handleConfirm} type="primary">
确定 确定
</Button> </Button>
</div> </div>
} }
> >
...@@ -148,7 +152,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -148,7 +152,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
}} }}
> >
基本信息 基本信息
</span> </span>
</> </>
} }
/> />
...@@ -183,7 +187,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -183,7 +187,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
<div className={cx(style.box, style.boxBlue)}> <div className={cx(style.box, style.boxBlue)}>
<div className={cx(style.title, style.tagBlue)}> <div className={cx(style.title, style.tagBlue)}>
报价商品 报价商品
<Text type='danger'>*</Text> <Text type='danger'>*</Text>
</div> </div>
<div className={style.content}> <div className={style.content}>
{Object.keys(product).length > 0 {Object.keys(product).length > 0
...@@ -206,7 +210,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -206,7 +210,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
<Button onClick={() => setFlag(true)} block type="dashed" style={{ margin: '16px 0px' }}> <Button onClick={() => setFlag(true)} block type="dashed" style={{ margin: '16px 0px' }}>
<PlusSquareOutlined /> <PlusSquareOutlined />
选择商品 选择商品
</Button> </Button>
</div> </div>
</div> </div>
</div> </div>
...@@ -271,7 +275,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -271,7 +275,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
}} }}
> >
附件 附件
</span> </span>
</> </>
} }
/> />
......
...@@ -17,25 +17,16 @@ const { TabPane } = Tabs; ...@@ -17,25 +17,16 @@ const { TabPane } = Tabs;
const Add: React.FC<{}> = (props: any) => { const Add: React.FC<{}> = (props: any) => {
const { location: { query: { sourceType, paymentId, type } } } = props; const { location: { query: { sourceType, paymentId, type } } } = props;
console.log(sourceType) console.log(type)
const currentBasic = useRef<any>({}); const currentBasic = useRef<any>({});
const detailData = useRef<any>({}); const detailData = useRef<any>({});
const [flag, setflag] = useState<any>(false); const [flag, setflag] = useState<any>(false);
const [id, setid] = useState(''); const [id, setid] = useState('');
/* 判断是不是手工单 */ /* 判断是不是手工单 */
const getflag = (data) => { const getflag = (data) => {
setflag(data.flag) setflag(data.flag)
setid(data.selectRow.id) setid(data.selectRow.id)
console.log(data)
} }
// useEffect(() => {
// PublicApi.getContractApplyAmountGetDetail({ applyId: paymentId }).then((res) => {
// console.log(res)
// }).catch((err) => {
// });
// }, [])
const TabList = [ const TabList = [
{ {
name: '基本信息', components: name: '基本信息', components:
...@@ -78,7 +69,7 @@ const Add: React.FC<{}> = (props: any) => { ...@@ -78,7 +69,7 @@ const Add: React.FC<{}> = (props: any) => {
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
title={type ? '修改请款单' : '新建请款单'} title="新建请款单"
onBack={() => history.goBack()} onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />} backIcon={<ReutrnEle description="返回" />}
extra={[ extra={[
......
...@@ -87,7 +87,7 @@ const AddbillList: React.FC<{}> = () => { ...@@ -87,7 +87,7 @@ const AddbillList: React.FC<{}> = () => {
// 状态, 1.待提交审核, 2.待审核(一级), 3.审核不通过(一级), 4.待审核(二级), 5.审核不通过(二级), 6.待提交财务付款, 7.待付款, 8.已付款, 9.已作废 // 状态, 1.待提交审核, 2.待审核(一级), 3.审核不通过(一级), 4.待审核(二级), 5.审核不通过(二级), 6.待提交财务付款, 7.待付款, 8.已付款, 9.已作废
// 删除:只有内部状态为待提交审核状态且从未提交审核的才可以删除,删除前需要提示,确认后才能删除 // 删除:只有内部状态为待提交审核状态且从未提交审核的才可以删除,删除前需要提示,确认后才能删除
let node; let node;
let edit = <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/addbill/Add?paymentId=${record.id}&type=edit`)}>修改</span>; let edit = <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/editbill/edit?paymentId=${record.id}&type=edit`)}>修改</span>;
switch (record.status) { switch (record.status) {
case 1: case 1:
node = edit; node = edit;
......
.tag {
padding: 10px 15px;
border: 1px solid #E4E6EB;
cursor: pointer;
}
.tative {
padding: 10px 15px;
background: #6B778C;
color: #fff;
cursor: pointer;
}
.point {
width: 10px;
height: 10ox;
background: '#41CC9E';
display: 'inline-block';
border-radius: '50%';
margin-right: 10px;
}
.tag{
padding: 10px 15px;
border: 1px solid #E4E6EB;
cursor:pointer;
}
.tative{
padding: 10px 15px;
background: #6B778C;
color: #fff;
cursor:pointer;
}
.point {
width: 10px;
height: 10ox;
background: '#41CC9E';
display: 'inline-block';
border-radius: '50%';
margin-right: 10px;
}
This diff is collapsed.
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const Schema: any = {
type: 'object',
properties: {
contractNo: {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入搜索合同编号',
align: 'start',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
inline: true,
colStyle: {
marginRight: 20
}
},
properties: {
"contractAbstract": {
type: 'string',
"x-component-props": {
placeholder: '请款单摘要'
}
},
"[startTime,endTime]": {
type: 'array',
"x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间', '结束时间'],
format: 'YYYY-MM-DD HH:mm:ss',
// disabledDate: current => {
// console.log(current);
// return current && current < moment().startOf('day')
// }
},
},
"awardName": {
type: 'string',
"x-component-props": {
placeholder: '请输入收款方'
}
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
},
},
},
},
}
}
This diff is collapsed.
import React, { useState, useRef, useEffect } from 'react'
import { history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Tabs, Button } from 'antd';
import { createFormActions } from '@formily/antd';
import {
SaveOutlined,
} from '@ant-design/icons'
import AddInfo from './components/info'
import ReutrnEle from '@/components/ReturnEle';
import InfoTable from './components/table'
import { PublicApi } from '@/services/api';
const formActions = createFormActions();
const { TabPane } = Tabs;
const Editbill: React.FC<{}> = (props: any) => {
const { location: { query: { sourceType, paymentId, type } } } = props;
console.log(type)
const currentBasic = useRef<any>({});
const detailData = useRef<any>({});
const [flag, setflag] = useState<any>(false);
const [id, setid] = useState('');
/* 判断是不是手工单 */
const getflag = (data) => {
setflag(data.flag)
setid(data.selectRow.id)
}
const TabList = [
{
name: '基本信息', components:
<AddInfo
currentRef={currentBasic}
getcontractId={getflag}
sourceType={sourceType}
paymentId={paymentId}
type={type}
/>
},
{
name: '请款明细', components:
<InfoTable
flag={flag}
id={id}
currentRef={detailData}
sourceType={sourceType}
/>
},
]
const submit = async () => {
const basicsVO = await currentBasic.current.get();
const detailList = await Object.keys(detailData.current).length != 0 ? await detailData.current.get() : [];
basicsVO.data.sourceType = sourceType ? sourceType : 3;
let data = {
basics: basicsVO.data,
detailList: detailList,
}
PublicApi.postContractApplyAmountSave(data).then(res => {
console.log(res);
if (res.code === 1000) {
history.push('/memberCenter/contract/funds/addbill')
}
})
}
return (
<PageHeaderWrapper
title="修改请款单"
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
extra={[
<Button key="1" type="primary" icon={<SaveOutlined />} onClick={() => submit()} > 保存</Button>
]}
>
<Card>
<Tabs defaultActiveKey="0" type="card" size="small">
{
TabList.map((item, index) => (
<TabPane tab={item.name} key={index}>
{item.components}
</TabPane>
))
}
</Tabs>
</Card>
</PageHeaderWrapper>
)
}
export default Editbill
...@@ -77,7 +77,9 @@ const FormList = (props: any) => { ...@@ -77,7 +77,9 @@ const FormList = (props: any) => {
parmas.submitTenderId = Row.bidId; parmas.submitTenderId = Row.bidId;
fn = PublicApi.getPurchaseSubmitTenderMaterielGetSubmitTenderMaterielList fn = PublicApi.getPurchaseSubmitTenderMaterielGetSubmitTenderMaterielList
} else { } else {
fn = PublicApi.getProductGoodsGetGoodsList
parmas.id = Row.viePriceId
fn = PublicApi.getPurchaseBiddingPrizeMaterielPage
} }
console.log(sourceType) console.log(sourceType)
...@@ -87,21 +89,22 @@ const FormList = (props: any) => { ...@@ -87,21 +89,22 @@ const FormList = (props: any) => {
if (res.code === 1000) { if (res.code === 1000) {
let data = res.data.data.map(item => { let data = res.data.data.map(item => {
return { return {
code: sourceType == '1' ? item.number : sourceType == '2' ? item.inviteTenderMateriel.code : '', // 物料编号 code: sourceType == '1' ? item.number : sourceType == '2' ? item.inviteTenderMateriel.code : item.number, // 物料编号
name: sourceType == '1' ? item.name : sourceType == '2' ? item.inviteTenderMateriel.name : '', // 物料名称 name: sourceType == '1' ? item.name : sourceType == '2' ? item.inviteTenderMateriel.name : item.name, // 物料名称
type: sourceType == '1' ? item.model : sourceType == '2' ? item.inviteTenderMateriel.type : '', // 物料规格 type: sourceType == '1' ? item.model : sourceType == '2' ? item.inviteTenderMateriel.type : item.model, // 物料规格
customerCategory: { customerCategory: { // 品类
name: sourceType == '1' ? item.category : sourceType == '2' ? item.inviteTenderMateriel.brandName : '', name: sourceType == '1' ? item.category : sourceType == '2' ? item.inviteTenderMateriel.brandName : '',
id: sourceType == '1' ? item.goodsId : sourceType == '2' ? item.inviteTenderMateriel.categoryId[0] : '' category: item.category ? item.category : '',
id: sourceType == '1' ? item.goodsId : sourceType == '2' ? item.inviteTenderMateriel.categoryId[0] : item.ids[0],
}, },
brand: { name: sourceType == '1' ? item.brand : sourceType == '2' ? item.inviteTenderMateriel.categoryName : '' }, brand: { name: sourceType == '1' ? item.brand : sourceType == '2' ? item.inviteTenderMateriel.categoryName : item.brand }, // 品牌
unitName: sourceType == '1' ? item.unit : sourceType == '2' ? item.inviteTenderMateriel.unitName : '', //单位 unitName: sourceType == '1' ? item.unit : sourceType == '2' ? item.inviteTenderMateriel.unitName : item.unitPrice, //单位
purchaseCount: sourceType == '1' ? item.purchaseCount : sourceType == '2' ? item.inviteTenderMateriel.count : '', // 数量 purchaseCount: sourceType == '1' ? item.purchaseCount : sourceType == '2' ? item.inviteTenderMateriel.count : item.purchaseCount, // 数量
isHasTax: sourceType == '1' ? item.isTax : sourceType == '2' ? item.isTax ? 1 : 0 : '', isHasTax: sourceType == '1' ? item.isTax : sourceType == '2' ? item.isTax ? 1 : 0 : item.isTax ? 1 : 0, // 是否函税
taxRate: sourceType == '1' ? item.taxProbability : sourceType == '2' ? item.taxRate : '', taxRate: sourceType == '1' ? item.taxProbability : sourceType == '2' ? item.taxRate : item.taxRate, //税率
price: sourceType == '1' ? item.taxUnitPrice : sourceType == '2' ? item.price : '', price: sourceType == '1' ? item.taxUnitPrice : item.price, // 单价
bidCount: sourceType == '1' ? item.awardTaxProbability * item.purchaseCount / 100 : sourceType == '2' ? item.awardTenderRatio * item.inviteTenderMateriel.count / 100 : '', bidCount: sourceType == '1' ? item.awardTaxProbability * item.purchaseCount / 100 : sourceType == '2' ? item.awardTenderRatio * item.inviteTenderMateriel.count / 100 : item.purchaseCount,
bidAmount: sourceType == '1' ? item.awardTaxProbability * item.purchaseCount / 100 * item.taxUnitPrice : sourceType == '2' ? item.awardTenderRatio * item.inviteTenderMateriel.count / 100 * item.price : '', bidAmount: sourceType == '1' ? item.awardTaxProbability * item.purchaseCount / 100 * item.taxUnitPrice : sourceType == '2' ? item.awardTenderRatio * item.inviteTenderMateriel.count / 100 * item.price : item.price,
associatedDataId: sourceType == '1' ? item.productId : sourceType == '2' ? item.commodityId : '', // 关联商品id associatedDataId: sourceType == '1' ? item.productId : sourceType == '2' ? item.commodityId : '', // 关联商品id
associatedMaterielNo: sourceType == '1' ? item.number : sourceType == '2' ? item.inviteTenderMateriel.code : '', // 关联物料编号 associatedMaterielNo: sourceType == '1' ? item.number : sourceType == '2' ? item.inviteTenderMateriel.code : '', // 关联物料编号
associatedMaterielName: sourceType == '1' ? item.productName : sourceType == '2' ? item.commodityName : '', // 关联商品名称 associatedMaterielName: sourceType == '1' ? item.productName : sourceType == '2' ? item.commodityName : '', // 关联商品名称
...@@ -127,7 +130,7 @@ const FormList = (props: any) => { ...@@ -127,7 +130,7 @@ const FormList = (props: any) => {
{ {
title: '品类', dataIndex: 'customerCategory', align: 'center', title: '品类', dataIndex: 'customerCategory', align: 'center',
render: (text, item) => render: (text, item) =>
<span>{item.customerCategory.name ? item.customerCategory.name : ''}</span> <span>{item.customerCategory.name ? item.customerCategory.name : item.customerCategory.category}</span>
}, },
{ {
title: '品牌', dataIndex: 'brand', align: 'center', title: '品牌', dataIndex: 'brand', align: 'center',
......
...@@ -105,12 +105,26 @@ const Auction = () => { ...@@ -105,12 +105,26 @@ const Auction = () => {
render: (_, record) => { render: (_, record) => {
return ( return (
<div> <div>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => history.push(`/memberCenter/contract/manage/add/addList/contracAdd?contractId=${record.id}&sourceType=3`)}>创建采购竞价合同</span> <span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => Like(record)}>创建采购竞价合同</span>
{/* <span style={{ color: '#00B37A', cursor: 'pointer' }} onClick={() => history.push(`/memberCenter/contract/manage/Auction/details?contractId=${record.id}`)}> 查看 </span> */} {/* <span style={{ color: '#00B37A', cursor: 'pointer' }} onClick={() => history.push(`/memberCenter/contract/manage/Auction/details?contractId=${record.id}`)}> 查看 </span> */}
</div> </div>
) )
} }
}] }]
const Like = (record) => {
record.sourceId = record.viePriceId;
record.sourceNo = record.viePriceNO;
record.totalAmount = record.awardAmount;
record.partyBMemberId = record.awardMemberId;
record.partyBRoleId = record.awardRoleId;
record.partyBName = record.awardName;
record.sourceType = "3";
sessionStorage.setItem('record', JSON.stringify(record));
console.log(record);
// return;
history.push(`/memberCenter/contract/manage/add/addList/contracAdd?contractId=${record.id}&sourceType=3`)
}
const getdate = (time) => { const getdate = (time) => {
return new Date(Date.parse(time.replace(/-/g, "/"))).getTime() / 1000; return new Date(Date.parse(time.replace(/-/g, "/"))).getTime() / 1000;
} }
......
...@@ -12,6 +12,7 @@ import { SubmitDataType } from '../../types'; ...@@ -12,6 +12,7 @@ import { SubmitDataType } from '../../types';
type EditInititalValueType = Omit<SubmitDataType,"deliveryDate" | "source1" > & { type EditInititalValueType = Omit<SubmitDataType,"deliveryDate" | "source1" > & {
deliveryDate: Moment, deliveryDate: Moment,
id: number, id: number,
source1: 1 | 0 | number | {},
} }
type OtherTypes = { type OtherTypes = {
...@@ -111,6 +112,7 @@ const useFormatData = () => { ...@@ -111,6 +112,7 @@ const useFormatData = () => {
receiverAddressId, receiverAddressId,
receivefullAddress: receiverAddressId, receivefullAddress: receiverAddressId,
source, source,
source1: source,
productList, productList,
orderList, orderList,
...descValue, ...descValue,
......
...@@ -88,12 +88,30 @@ const schema: ISchema = { ...@@ -88,12 +88,30 @@ const schema: ISchema = {
processNum: { processNum: {
type: 'string', type: 'string',
title: '加工数量', title: '加工数量',
required: true 'x-rules': [
{
required: true,
message: '请填写加工数量'
},
{
pattern: /^[1-9][0-9]*(\.[0-9]{1,3})?$/,
message: '请填写整数或保留三位小数'
}
]
}, },
processUnitPrice: { processUnitPrice: {
title: "单价", title: "单价",
type: 'string', type: 'string',
required: true 'x-rules': [
{
required: true,
message: '请填写加工单价'
},
{
pattern: /^[1-9][0-9]*(\.[0-9]{1,3})?$/,
message: '请填写整数或保留三位小数'
}
]
}, },
isHasTax: { isHasTax: {
title: "是否含税", title: "是否含税",
...@@ -107,11 +125,43 @@ const schema: ISchema = { ...@@ -107,11 +125,43 @@ const schema: ISchema = {
label: '否', label: '否',
value: 0, value: 0,
} }
],
required: true,
"x-linkages": [
{
type: 'value:schema',
target: 'taxRate',
condition: `{{ $value === 1 }}`,
schema: {
"x-rules": [
{
required: true,
}
]
},
otherwise: {
"x-rules": [
{
required: false,
}
]
}
}
] ]
}, },
taxRate: { taxRate: {
title: '税率', title: '税率',
type: 'string' type: 'string',
"x-component-props": {
addonAfter: "%"
},
'x-rules': [
{
pattern: /^[1-9][0-9]*(\.[0-9]{1,2})?$/,
message: '请填写整数或保留两位小数'
}
],
}, },
}, },
}, },
......
import React, { useCallback, useEffect, useMemo, useState } from 'react'; import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { Button, Cascader, message, Space, Table } from 'antd'; import { Button, Cascader, message, Space, Table, Modal } from 'antd';
import { LinkOutlined, PlusOutlined, SaveOutlined } from '@ant-design/icons'; import { LinkOutlined, PlusOutlined, SaveOutlined } from '@ant-design/icons';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import creataSchema from './schema'; import creataSchema from './schema';
...@@ -33,8 +33,10 @@ import { history } from 'umi'; ...@@ -33,8 +33,10 @@ import { history } from 'umi';
import moment from 'moment'; import moment from 'moment';
import useFormatData from './common/hooks/useFormatData'; import useFormatData from './common/hooks/useFormatData';
const { confirm } = Modal;
const formActions = createFormActions(); const formActions = createFormActions();
const { onFieldInit$, onFieldValueChange$ } = FormEffectHooks const { onFieldInit$, onFieldValueChange$, onFieldInputChange$ } = FormEffectHooks
registerVirtualBox('MellowCardBox', (_props) => { registerVirtualBox('MellowCardBox', (_props) => {
const { children, props: outerProps } = _props; const { children, props: outerProps } = _props;
...@@ -108,6 +110,7 @@ const Create = () => { ...@@ -108,6 +110,7 @@ const Create = () => {
/** 订单数据 */ /** 订单数据 */
const [fetchedOrderData, setFetchOrderData] = useState<GetOrderProcessingOrderListResponseDetail[]>([]) const [fetchedOrderData, setFetchOrderData] = useState<GetOrderProcessingOrderListResponseDetail[]>([])
const [productActionType, setProductActionType] = useState<"view" | "edit">("view"); const [productActionType, setProductActionType] = useState<"view" | "edit">("view");
const [submitLoading, setSubmitLoading] = useState<boolean>(false);
useEffect(() => { useEffect(() => {
if (!isEdit) { if (!isEdit) {
...@@ -449,11 +452,13 @@ const Create = () => { ...@@ -449,11 +452,13 @@ const Create = () => {
const productList = isOrderSource ? formActions.getFieldValue('detail.layout1.orderList') : formActions.getFieldValue('detail.layout1.productList'); const productList = isOrderSource ? formActions.getFieldValue('detail.layout1.orderList') : formActions.getFieldValue('detail.layout1.productList');
// const productList = formActions.getFieldValue('detail.layout1.productList'); // const productList = formActions.getFieldValue('detail.layout1.productList');
const { isHasTax, taxRate, processNum, processUnitPrice, enclosure, productProps } = values; const { isHasTax, taxRate, processNum, processUnitPrice, enclosure, productProps } = values;
let shouldShowConfirmMsg = false;
const newData = productList.map((_item) => { const newData = productList.map((_item) => {
/** 加工商品的时候用sku, 如果是加工订单商品的话用orderid */ /** 加工商品的时候用sku, 如果是加工订单商品的话用orderid */
if ((!isOrderSource && _item.skuid === values.skuid) || (isOrderSource && _item.id === values.id)) { if ((!isOrderSource && _item.skuid === values.skuid) || (isOrderSource && _item.id === values.id)) {
const other = isOrderSource ? { surplusAndProcessNum: `${_item.surplusProcessNum}/${processNum}` } : {} const other = isOrderSource ? { surplusAndProcessNum: `${_item.surplusProcessNum}/${processNum}` } : {};
shouldShowConfirmMsg = _item.surplusProcessNum < processNum;
return { return {
..._item, ..._item,
...other, ...other,
...@@ -473,8 +478,20 @@ const Create = () => { ...@@ -473,8 +478,20 @@ const Create = () => {
} }
return _item; return _item;
}) })
if (shouldShowConfirmMsg) {
confirm({
title: '加工商品大于剩余加工商品',
content: '加工商品大于剩余加工商品, 是否确认提交?',
onOk() {
formActions.setFieldValue(source === ORDER_SOURCE ? 'detail.layout1.orderList' : 'detail.layout1.productList', newData);
productDrawerToggle(false);
},
});
return;
}
formActions.setFieldValue(source === ORDER_SOURCE ? 'detail.layout1.orderList' : 'detail.layout1.productList', newData); formActions.setFieldValue(source === ORDER_SOURCE ? 'detail.layout1.orderList' : 'detail.layout1.productList', newData);
productDrawerToggle(false); productDrawerToggle(false);
} }
/** -------------- 加工商品相关结束 --------------- */ /** -------------- 加工商品相关结束 --------------- */
...@@ -629,6 +646,7 @@ const Create = () => { ...@@ -629,6 +646,7 @@ const Create = () => {
}, []) }, [])
const onSubmit = async (value: SubmitDataType) => { const onSubmit = async (value: SubmitDataType) => {
setSubmitLoading(true)
const { const {
receivefullAddress, receivefullAddress,
source, source,
...@@ -747,6 +765,7 @@ const Create = () => { ...@@ -747,6 +765,7 @@ const Create = () => {
const service = isEdit ? PublicApi.postEnhanceSupplierToBeAddUpdate : PublicApi.postEnhanceSupplierToBeAddAdd const service = isEdit ? PublicApi.postEnhanceSupplierToBeAddUpdate : PublicApi.postEnhanceSupplierToBeAddAdd
const withId = isEdit ? { id: cacheInitialValue.id, ...postData}: postData; const withId = isEdit ? { id: cacheInitialValue.id, ...postData}: postData;
const { data, code } = await service(withId as any) const { data, code } = await service(withId as any)
setSubmitLoading(false)
if (code === 1000) { if (code === 1000) {
history.goBack() history.goBack()
} }
...@@ -762,6 +781,7 @@ const Create = () => { ...@@ -762,6 +781,7 @@ const Create = () => {
icon={<SaveOutlined />} icon={<SaveOutlined />}
type="primary" type="primary"
onClick={() => formActions.submit()} onClick={() => formActions.submit()}
loading={submitLoading}
> >
提交 提交
</Button> </Button>
...@@ -772,7 +792,7 @@ const Create = () => { ...@@ -772,7 +792,7 @@ const Create = () => {
value={cacheInitialValue} value={cacheInitialValue}
effects={($, actions) => { effects={($, actions) => {
useAsyncSelect('receivefullAddress', fetchReceiveAddress) useAsyncSelect('receivefullAddress', fetchReceiveAddress)
onFieldValueChange$(`*(source,source1)`).subscribe((state) => { onFieldInputChange$(`*(source,source1)`).subscribe((state) => {
const reverseName = state.name === 'source' ? 'source1' : 'source'; const reverseName = state.name === 'source' ? 'source1' : 'source';
formActions.setFieldValue(reverseName, state.value) formActions.setFieldValue(reverseName, state.value)
}); });
......
...@@ -44,15 +44,25 @@ const AllQuery = () => { ...@@ -44,15 +44,25 @@ const AllQuery = () => {
title: '操作', title: '操作',
render: (text, record) => { render: (text, record) => {
const loading = submitLoadingID.includes(record.id); const loading = submitLoadingID.includes(record.id);
const IS_TO_BE_SUBMIT_EXAM = record.supplierInnerStatus === 1
return ( return (
<Space> <Space>
<Spin spinning={loading}> {
<a onClick={() => handleSingleReviewOrDelete("exam", {id: record.id})}>提交</a> IS_TO_BE_SUBMIT_EXAM && (
</Spin> <Spin spinning={loading}>
<a onClick={() => handleSingleReviewOrDelete("exam", {id: record.id})}>提交</a>
</Spin>
) || null
}
<Link to={`/memberCenter/handling/assign/tobeAddQuery/edit?id=${record.id}`}>编辑</Link> <Link to={`/memberCenter/handling/assign/tobeAddQuery/edit?id=${record.id}`}>编辑</Link>
<Popconfirm title="确定删除吗?" onConfirm={() => handleSingleReviewOrDelete("delete", {id: record.id})}> {
<Button type="link" loading={loading} >删除</Button> IS_TO_BE_SUBMIT_EXAM && (
</Popconfirm> <Popconfirm title="确定删除吗?" onConfirm={() => handleSingleReviewOrDelete("delete", {id: record.id})}>
<Button type="link" loading={loading} >删除</Button>
</Popconfirm>
) || null
}
</Space> </Space>
) )
} }
......
...@@ -12,8 +12,12 @@ import { useCallback, useState } from "react"; ...@@ -12,8 +12,12 @@ import { useCallback, useState } from "react";
prev.push(params.id); prev.push(params.id);
return prev; return prev;
}) })
const res = await api(params) let res;
setSubmitLoadingID((prev: number[]) => prev.filter((_item) => _item !== params.id)) try {
res = await api(params)
} finally {
setSubmitLoadingID((prev: number[]) => prev.filter((_item) => _item !== params.id))
}
return res return res
} }
return { submitLoadingID, onSingleAction } return { submitLoadingID, onSingleAction }
......
...@@ -51,6 +51,7 @@ const ProductModal:React.FC<ProductModalProps> = (props) => { ...@@ -51,6 +51,7 @@ const ProductModal:React.FC<ProductModalProps> = (props) => {
...params, ...params,
type: shopInfo[0]["type"], type: shopInfo[0]["type"],
environment: shopInfo[0].environment, environment: shopInfo[0].environment,
shopId,
// priceTypeList: [1, 2], // priceTypeList: [1, 2],
}) })
return res.data return res.data
......
...@@ -74,7 +74,7 @@ export const EditableCell: React.FC<EditableCellProps> = ({ ...@@ -74,7 +74,7 @@ export const EditableCell: React.FC<EditableCellProps> = ({
onPressEnter={save} onPressEnter={save}
onBlur={save} onBlur={save}
type="number" type="number"
disabled={!record['editable']} // disabled={!record['editable']}
/> />
</Form.Item> </Form.Item>
} }
......
...@@ -171,8 +171,8 @@ const Repositories: React.FC<{}> = () => { ...@@ -171,8 +171,8 @@ const Repositories: React.FC<{}> = () => {
message: '请填写仓位库存', message: '请填写仓位库存',
}, },
{ {
pattern: PATTERN_MAPS.weight, pattern: /^[+-]?\d*(\.\d{0,3})?$/,
message: '请填写正数,最多保留3位小数', message: '请填写数值,最多保留3位小数',
}, },
], ],
}, },
......
...@@ -27,8 +27,8 @@ const QuotationDesk: React.FC<QuotationDeskProps> = (props: any) => { ...@@ -27,8 +27,8 @@ const QuotationDesk: React.FC<QuotationDeskProps> = (props: any) => {
_obj[`${item.type}`] = item.title; _obj[`${item.type}`] = item.title;
}); });
return { return {
value: { min: 0, alias: '', type: 'linear-strict' }, value: { min: 0 },
ear: { range: [0, 1] }, // time: { range: [0, 1] },
type: { type: {
formatter: v => { formatter: v => {
return _obj[v] return _obj[v]
...@@ -72,10 +72,9 @@ const QuotationDesk: React.FC<QuotationDeskProps> = (props: any) => { ...@@ -72,10 +72,9 @@ const QuotationDesk: React.FC<QuotationDeskProps> = (props: any) => {
> >
<Axis <Axis
title={{ text: '金额(元)' }} title={{ text: '金额(元)' }}
// visible={false} visible={true}
name='value' name='value'
// line={{ style: { stroke: "#ff0000" } }} tickLine={{ style: { lineWidth: 1 } }}
tickLine={{ style: { lineWidth: 1 }, length: 5 }}
/> />
<Line position="time*value" color={['type', ['#5B8FF9', '#00B37A']]} /> <Line position="time*value" color={['type', ['#5B8FF9', '#00B37A']]} />
<Point position="time*value" color={['type', ['#5B8FF9', '#00B37A']]} shape='circle' /> <Point position="time*value" color={['type', ['#5B8FF9', '#00B37A']]} shape='circle' />
...@@ -91,4 +90,4 @@ QuotationDesk.defaultProps = { ...@@ -91,4 +90,4 @@ QuotationDesk.defaultProps = {
title: '报价台' title: '报价台'
} }
export default QuotationDesk; export default QuotationDesk;
\ No newline at end of file
...@@ -19,6 +19,7 @@ interface HistoryItemProps { ...@@ -19,6 +19,7 @@ interface HistoryItemProps {
const HistoryItem: React.FC<HistoryItemProps> = (props: any) => { const HistoryItem: React.FC<HistoryItemProps> = (props: any) => {
const { detail } = props; const { detail } = props;
const mapData = detail.offerLogs ? [...detail.offerLogs].splice(0, 3) : []; const mapData = detail.offerLogs ? [...detail.offerLogs].splice(0, 3) : [];
const firstData = mapData[0];
const _returnBadge = () => { const _returnBadge = () => {
if (!detail.isOpenRanking) { if (!detail.isOpenRanking) {
return null; return null;
...@@ -36,7 +37,7 @@ const HistoryItem: React.FC<HistoryItemProps> = (props: any) => { ...@@ -36,7 +37,7 @@ const HistoryItem: React.FC<HistoryItemProps> = (props: any) => {
} }
} }
} }
return ( return (
<div className={styles.history}> <div className={styles.history}>
<div className={styles.historyHeader}> <div className={styles.historyHeader}>
...@@ -44,13 +45,13 @@ const HistoryItem: React.FC<HistoryItemProps> = (props: any) => { ...@@ -44,13 +45,13 @@ const HistoryItem: React.FC<HistoryItemProps> = (props: any) => {
<div className={styles.box}> <div className={styles.box}>
{_returnBadge()} {_returnBadge()}
<div className={styles.rightPosition}> <div className={styles.rightPosition}>
{detail?.offerRatio ? <TrendTag ratio={detail?.offerRatio} /> : ''} {firstData?.offerRatio ? <TrendTag ratio={firstData?.offerRatio} /> : ''}
</div> </div>
<p>本次报价金额</p> <p>本次报价金额</p>
<p className={styles.currentPrice}><span>¥</span>{detail?.offerPrice ? priceFormat(detail?.offerPrice) : '-'}</p> <p className={styles.currentPrice}><span>¥</span>{firstData?.offerPrice ? priceFormat(firstData?.offerPrice) : '-'}</p>
<div className={styles.row}> <div className={styles.row}>
<div className={styles.col} style={{ borderRight: '1px solid #EBECF0' }}>当前最低价:<span>{detail.isOpenPurchase ? (detail?.minLowPrice ? `¥${priceFormat(detail?.minLowPrice)}` : '-') : '不公开'}</span></div> <div className={styles.col} style={{ borderRight: '1px solid #EBECF0' }}>当前最低价:<span>{detail.isOpenPurchase ? (detail?.minLowPrice ? `¥${priceFormat(detail?.minLowPrice)}` : '-') : '不公开'}</span></div>
<div className={styles.col}>报价次数:<span>{detail?.offerCount ? detail?.offerCount : '-'}</span></div> <div className={styles.col}>报价次数:<span>{firstData?.offerCount ? firstData?.offerCount : '-'}</span></div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -69,7 +69,14 @@ const Detail = () => { ...@@ -69,7 +69,14 @@ const Detail = () => {
data.minLowPrice = socketObj.minLowPrice; data.minLowPrice = socketObj.minLowPrice;
} }
data.onlineId = Number(onlineId); data.onlineId = Number(onlineId);
setDataSource(data); let _data : any = {...data};
_data?.offerLogs.forEach((item,index,arr) => {
const _arrLength = arr.length;
if (index != _arrLength - 1 && _arrLength > 2) {
_data.offerLogs[index].offerRatio = Number(((item.offerPrice - arr[index + 1].offerPrice) / arr[index + 1].offerPrice * 100).toFixed(2))
}
})
setDataSource(_data);
let _list = []; let _list = [];
let _offerList = []; let _offerList = [];
let _minList = []; let _minList = [];
......
...@@ -64,8 +64,8 @@ const ConfirmBidResultModal: React.FC<ConfirmBidResultModalProps> = (props: any) ...@@ -64,8 +64,8 @@ const ConfirmBidResultModal: React.FC<ConfirmBidResultModalProps> = (props: any)
const _returnDefaultAwardResults = useMemo(() => { const _returnDefaultAwardResults = useMemo(() => {
return record ? `${record?.purchaseMemberName ?? record?.createMemberName}${record.details}》竞价工作已经结束,中标人已经确定。现将中标结果公布如下: return record ? `${record?.purchaseMemberName ?? record?.createMemberName}${record.details}》竞价工作已经结束,中标人已经确定。现将中标结果公布如下:
中标供应商:${record.memberName}(中标总金额(含税):${priceFormat(record.sumAwardPrice)})。 中标供应商:${record.memberName}(中标总金额(含税):¥${priceFormat(record.sumAwardPrice)})。
中标理由:价格最低` : ''; 中标理由:${record.signUpIdea}` : '';
}, [record]) }, [record])
const _returnDefaultContent = useMemo(() => { const _returnDefaultContent = useMemo(() => {
...@@ -147,4 +147,4 @@ const ConfirmBidResultModal: React.FC<ConfirmBidResultModalProps> = (props: any) ...@@ -147,4 +147,4 @@ const ConfirmBidResultModal: React.FC<ConfirmBidResultModalProps> = (props: any)
) )
} }
export default ConfirmBidResultModal export default ConfirmBidResultModal
\ No newline at end of file
...@@ -187,7 +187,7 @@ const AddForm = () => { ...@@ -187,7 +187,7 @@ const AddForm = () => {
setCondition(conditionInfo); setCondition(conditionInfo);
demandInfo.type = params.type; demandInfo.type = params.type;
demandInfo.shopIds = params.shopIds; demandInfo.shopIds = params.shopIds;
demandInfo.demandMembers = params.demandMembers; demandInfo.demandMembers = params.members;
setDemand(demandInfo); setDemand(demandInfo);
setfile([...params.urls]); setfile([...params.urls]);
} }
...@@ -267,4 +267,4 @@ const AddForm = () => { ...@@ -267,4 +267,4 @@ const AddForm = () => {
</PageHeaderWrapper> </PageHeaderWrapper>
) )
} }
export default AddForm export default AddForm
\ No newline at end of file
...@@ -184,23 +184,25 @@ const DetailBottomDrawer: React.FC<DetailBottomDrawerProps> = (props: any) => { ...@@ -184,23 +184,25 @@ const DetailBottomDrawer: React.FC<DetailBottomDrawerProps> = (props: any) => {
className={styles.drawer} className={styles.drawer}
closeIcon={<div>取消报价</div>} closeIcon={<div>取消报价</div>}
> >
<Row gutter={[8, 8]} style={{ marginBottom: '10px' }}> <div style={{ width: '100%', overflowX: 'auto' }}>
<Col span={7} key={'BtnItem_0'} onClick={() => { chooseItem() }}> <Row gutter={[8, 8]} style={{ marginBottom: '10px' }} wrap={false}>
<BtnItem btnType={3} detail={{ sumPice: _calcCurrentTotal, peportPriceSum: offerCount + 1 }} active={!activeItem} onOk={bidOk} onCancle={onClose} btnLoading={btnLoading} /> <Col span={7} key={'BtnItem_0'} onClick={() => { chooseItem() }}>
</Col> <BtnItem btnType={3} detail={{ sumPice: _calcCurrentTotal, peportPriceSum: offerCount + 1 }} active={!activeItem} onOk={bidOk} onCancle={onClose} btnLoading={btnLoading} />
{awardProcess?.map((item, index, arr) => { </Col>
let _ratio = 0; {awardProcess?.map((item, index, arr) => {
const _arrLength = arr.length; let _ratio = 0;
if (index != _arrLength - 1 && _arrLength > 2) { const _arrLength = arr.length;
_ratio = Number(((item.sumPice - arr[index + 1].sumPice) / arr[index + 1].sumPice * 100).toFixed(2)) if (index != _arrLength - 1 && _arrLength > 2) {
} _ratio = Number(((item.sumPice - arr[index + 1].sumPice) / arr[index + 1].sumPice * 100).toFixed(2))
return ( }
<Col span={7} key={`${item.id}_${item.peportTime}`} onClick={() => { chooseItem(item, index) }}> return (
<BtnItem btnType={2} detail={{ ...item, isOpenPurchase, isOpenRanking, ratio: _ratio, selfRanking: index + 1 }} active={index === activeIndex} /> <Col span={7} key={`${item.id}_${item.peportTime}`} onClick={() => { chooseItem(item, index) }}>
</Col> <BtnItem btnType={2} detail={{ ...item, isOpenPurchase, isOpenRanking, ratio: _ratio, selfRanking: index + 1 }} active={index === activeIndex} />
) </Col>
})} )
</Row> })}
</Row>
</div>
<Form form={form}> <Form form={form}>
<Table dataSource={dataSource} columns={columns} pagination={false} />; <Table dataSource={dataSource} columns={columns} pagination={false} />;
</Form> </Form>
...@@ -208,4 +210,4 @@ const DetailBottomDrawer: React.FC<DetailBottomDrawerProps> = (props: any) => { ...@@ -208,4 +210,4 @@ const DetailBottomDrawer: React.FC<DetailBottomDrawerProps> = (props: any) => {
) )
} }
export default DetailBottomDrawer; export default DetailBottomDrawer;
\ No newline at end of file
...@@ -542,7 +542,7 @@ export const materialInfoColumns: any[] = [ ...@@ -542,7 +542,7 @@ export const materialInfoColumns: any[] = [
dataIndex: 'relevanceProductId', dataIndex: 'relevanceProductId',
align: 'center', align: 'center',
key: 'relevanceProductId', key: 'relevanceProductId',
render: (t, r) => `${t}/${r.relevanceProductName}/${r.relevanceProductCategory}/${r.relevanceProductBrand}` render: (t, r) => `${t}/${r.relevanceProductName || ''}/${r.relevanceProductCategory || ''}/${r.relevanceProductBrand || ''}`
}, },
{ {
title: '单价(元)', title: '单价(元)',
......
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