Commit 7effb3e1 authored by alwayOnlie's avatar alwayOnlie

修改路由

parent 6f4be60b
......@@ -42,6 +42,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
onClick
} = props;
const [flag, setFlag] = useState<boolean>(false);
console.log(record)
const [product, setProduct] = useState<any>({});
const [attribute, setAttribute] = useState<any>([]);
const handleAnchorClick = (e) => {
......@@ -63,11 +64,13 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
setProduct(params);
GetCommodityAttribute(params.id);
setFlag(false);
}
/** 关闭 */
const handleClose = () => {
onClose()
setProduct({})
}
/** 确定 */
const handleConfirm = () => {
......@@ -75,6 +78,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
product,
attribute
})
setProduct({})
}
return (
<>
......
......@@ -17,25 +17,16 @@ const { TabPane } = Tabs;
const Add: React.FC<{}> = (props: any) => {
const { location: { query: { sourceType, paymentId, type } } } = props;
console.log(sourceType)
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)
console.log(data)
}
// useEffect(() => {
// PublicApi.getContractApplyAmountGetDetail({ applyId: paymentId }).then((res) => {
// console.log(res)
// }).catch((err) => {
// });
// }, [])
const TabList = [
{
name: '基本信息', components:
......@@ -78,7 +69,7 @@ const Add: React.FC<{}> = (props: any) => {
return (
<PageHeaderWrapper
title={type ? '修改请款单' : '新建请款单'}
title="新建请款单"
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
extra={[
......
......@@ -87,7 +87,7 @@ const AddbillList: React.FC<{}> = () => {
// 状态, 1.待提交审核, 2.待审核(一级), 3.审核不通过(一级), 4.待审核(二级), 5.审核不通过(二级), 6.待提交财务付款, 7.待付款, 8.已付款, 9.已作废
// 删除:只有内部状态为待提交审核状态且从未提交审核的才可以删除,删除前需要提示,确认后才能删除
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) {
case 1:
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) => {
parmas.submitTenderId = Row.bidId;
fn = PublicApi.getPurchaseSubmitTenderMaterielGetSubmitTenderMaterielList
} else {
fn = PublicApi.getProductGoodsGetGoodsList
parmas.id = Row.viePriceId
fn = PublicApi.getPurchaseBiddingPrizeMaterielPage
}
console.log(sourceType)
......@@ -87,21 +89,22 @@ const FormList = (props: any) => {
if (res.code === 1000) {
let data = res.data.data.map(item => {
return {
code: sourceType == '1' ? item.number : sourceType == '2' ? item.inviteTenderMateriel.code : '', // 物料编号
name: sourceType == '1' ? item.name : sourceType == '2' ? item.inviteTenderMateriel.name : '', // 物料名称
type: sourceType == '1' ? item.model : sourceType == '2' ? item.inviteTenderMateriel.type : '', // 物料规格
customerCategory: {
code: sourceType == '1' ? item.number : sourceType == '2' ? item.inviteTenderMateriel.code : item.number, // 物料编号
name: sourceType == '1' ? item.name : sourceType == '2' ? item.inviteTenderMateriel.name : item.name, // 物料名称
type: sourceType == '1' ? item.model : sourceType == '2' ? item.inviteTenderMateriel.type : item.model, // 物料规格
customerCategory: { // 品类
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 : '' },
unitName: sourceType == '1' ? item.unit : sourceType == '2' ? item.inviteTenderMateriel.unitName : '', //单位
purchaseCount: sourceType == '1' ? item.purchaseCount : sourceType == '2' ? item.inviteTenderMateriel.count : '', // 数量
isHasTax: sourceType == '1' ? item.isTax : sourceType == '2' ? item.isTax ? 1 : 0 : '',
taxRate: sourceType == '1' ? item.taxProbability : sourceType == '2' ? item.taxRate : '',
price: sourceType == '1' ? item.taxUnitPrice : sourceType == '2' ? item.price : '',
bidCount: sourceType == '1' ? item.awardTaxProbability * item.purchaseCount / 100 : sourceType == '2' ? item.awardTenderRatio * item.inviteTenderMateriel.count / 100 : '',
bidAmount: sourceType == '1' ? item.awardTaxProbability * item.purchaseCount / 100 * item.taxUnitPrice : sourceType == '2' ? item.awardTenderRatio * item.inviteTenderMateriel.count / 100 * item.price : '',
brand: { name: sourceType == '1' ? item.brand : sourceType == '2' ? item.inviteTenderMateriel.categoryName : item.brand }, // 品牌
unitName: sourceType == '1' ? item.unit : sourceType == '2' ? item.inviteTenderMateriel.unitName : item.unitPrice, //单位
purchaseCount: sourceType == '1' ? item.purchaseCount : sourceType == '2' ? item.inviteTenderMateriel.count : item.purchaseCount, // 数量
isHasTax: sourceType == '1' ? item.isTax : sourceType == '2' ? item.isTax ? 1 : 0 : item.isTax ? 1 : 0, // 是否函税
taxRate: sourceType == '1' ? item.taxProbability : sourceType == '2' ? item.taxRate : item.taxRate, //税率
price: sourceType == '1' ? item.taxUnitPrice : item.price, // 单价
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 : item.price,
associatedDataId: sourceType == '1' ? item.productId : sourceType == '2' ? item.commodityId : '', // 关联商品id
associatedMaterielNo: sourceType == '1' ? item.number : sourceType == '2' ? item.inviteTenderMateriel.code : '', // 关联物料编号
associatedMaterielName: sourceType == '1' ? item.productName : sourceType == '2' ? item.commodityName : '', // 关联商品名称
......@@ -127,7 +130,7 @@ const FormList = (props: any) => {
{
title: '品类', dataIndex: 'customerCategory', align: 'center',
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',
......
......@@ -105,12 +105,26 @@ const Auction = () => {
render: (_, record) => {
return (
<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> */}
</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) => {
return new Date(Date.parse(time.replace(/-/g, "/"))).getTime() / 1000;
}
......
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