Commit a305fa00 authored by 卢均锐's avatar 卢均锐

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

* 'dev-srm' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform: feat: 完善采购计划管理接口接入 抽离详情组件
parents a973143e 8961dd18
......@@ -19,7 +19,7 @@ export const demandPlanRoute = [
{
/** 需求计划查询 - 详情 */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanSearch/preview',
name: '需求计划查询',
name: '需求计划详情',
component: '@/pages/transaction/purchaseAbility/demandPlan/detail',
hideInMenu: true,
noMargin: true,
......@@ -33,7 +33,7 @@ export const demandPlanRoute = [
{
/** 待新增需求计划 - 详情 */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanAdded/preview',
name: '待新增需求计划',
name: '待新增需求计划详情',
component: '@/pages/transaction/purchaseAbility/demandPlan/detail',
hideInMenu: true,
noMargin: true,
......@@ -61,7 +61,7 @@ export const demandPlanRoute = [
{
/** 待审核需求计划(一级) - 详情 */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanOne/preview',
name: '待新增需求计划',
name: '待审核需求计划(一级)详情',
component: '@/pages/transaction/purchaseAbility/demandPlan/detail',
hideInMenu: true,
noMargin: true,
......@@ -69,7 +69,7 @@ export const demandPlanRoute = [
{
/** 待审核需求计划(一级) - 详情 */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanOne/detail',
name: '待新增需求计划',
name: '待审核需求计划(一级)详情',
component: '@/pages/transaction/purchaseAbility/demandPlan/detail',
hideInMenu: true,
noMargin: true,
......@@ -83,7 +83,7 @@ export const demandPlanRoute = [
{
/** 待审核需求计划(二级) - 详情 */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanTwo/preview',
name: '待新增需求计划',
name: '待审核需求计划(二级)详情',
component: '@/pages/transaction/purchaseAbility/demandPlan/detail',
hideInMenu: true,
noMargin: true,
......@@ -91,7 +91,7 @@ export const demandPlanRoute = [
{
/** 待审核需求计划(二级) - 详情 */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanTwo/detail',
name: '待新增需求计划',
name: '待审核需求计划(二级)详情',
component: '@/pages/transaction/purchaseAbility/demandPlan/detail',
hideInMenu: true,
noMargin: true,
......@@ -105,7 +105,7 @@ export const demandPlanRoute = [
{
/** 待提交需求计划 - 详情 */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanSubmit/preview',
name: '待新增需求计划',
name: '待新增需求计划详情',
component: '@/pages/transaction/purchaseAbility/demandPlan/detail',
hideInMenu: true,
noMargin: true,
......
......@@ -19,7 +19,7 @@ export const purchasePlanRoute = [
{
/** 待汇总需求计划 - 详情 */
path: '/memberCenter/procurementAbility/purchasePlan/demandPlanSummary/preview',
name: '待新增需求计划',
name: '待新增需求计划详情',
component: '@/pages/transaction/purchaseAbility/purchasePlan/demand',
hideInMenu: true,
noMargin: true,
......@@ -27,7 +27,7 @@ export const purchasePlanRoute = [
{
/** 待汇总需求计划 - 详情 */
path: '/memberCenter/procurementAbility/purchasePlan/demandPlanSummary/detail',
name: '待新增需求计划',
name: '待新增需求计划详情',
component: '@/pages/transaction/purchaseAbility/purchasePlan/demand',
hideInMenu: true,
noMargin: true,
......@@ -41,7 +41,7 @@ export const purchasePlanRoute = [
{
/** 采购计划查询 - 详情 */
path: '/memberCenter/procurementAbility/purchasePlan/purchasePlanSearch/preview',
name: '采购计划查询',
name: '采购计划详情',
component: '@/pages/transaction/purchaseAbility/purchasePlan/detail',
hideInMenu: true,
noMargin: true,
......@@ -53,24 +53,79 @@ export const purchasePlanRoute = [
component: '@/pages/transaction/purchaseAbility/purchasePlan/purchasePlanSubmit'
},
{
/** 待提交审核采购计划 - 详情 */
path: '/memberCenter/procurementAbility/purchasePlan/purchasePlanSubmit/preview',
name: '待提交审核采购计划详情',
component: '@/pages/transaction/purchaseAbility/purchasePlan/detail',
hideInMenu: true,
noMargin: true,
},
{
/** 待提交审核采购计划 - 详情 */
path: '/memberCenter/procurementAbility/purchasePlan/purchasePlanSubmit/detail',
name: '待提交审核采购计划详情',
component: '@/pages/transaction/purchaseAbility/purchasePlan/detail',
hideInMenu: true,
noMargin: true,
},
{
/** 待审核采购计划(一级) */
path: '/memberCenter/procurementAbility/purchasePlan/purchasePlanOne',
name: '待审核采购计划(一级)',
component: '@/pages/transaction/purchaseAbility/purchasePlan/purchasePlanOne'
},
{
/** 待审核采购计划(一级)详情 */
path: '/memberCenter/procurementAbility/purchasePlan/purchasePlanOne/preview',
name: '待审核采购计划(一级)详情',
component: '@/pages/transaction/purchaseAbility/purchasePlan/detail',
hideInMenu: true,
noMargin: true,
},
{
/** 待审核采购计划(一级)详情 */
path: '/memberCenter/procurementAbility/purchasePlan/purchasePlanOne/detail',
name: '待审核采购计划(一级)详情',
component: '@/pages/transaction/purchaseAbility/purchasePlan/detail',
hideInMenu: true,
noMargin: true,
},
{
/** 待审核采购计划(二级) */
path: '/memberCenter/procurementAbility/purchasePlan/purchasePlanTwo',
name: '待审核采购计划(二级)',
component: '@/pages/transaction/purchaseAbility/purchasePlan/purchasePlanTwo'
},
{
/** 待审核采购计划(二级)详情 */
path: '/memberCenter/procurementAbility/purchasePlan/purchasePlanTwo/preview',
name: '待审核采购计划(二级)详情',
component: '@/pages/transaction/purchaseAbility/purchasePlan/detail',
hideInMenu: true,
noMargin: true,
},
{
/** 待审核采购计划(二级) */
path: '/memberCenter/procurementAbility/purchasePlan/purchasePlanTwo/detail',
name: '待审核采购计划(二级)详情',
component: '@/pages/transaction/purchaseAbility/purchasePlan/detail',
hideInMenu: true,
noMargin: true,
},
{
/** 待执行采购计划 */
path: '/memberCenter/procurementAbility/purchasePlan/purchasePlanPerform',
name: '待执行采购计划',
component: '@/pages/transaction/purchaseAbility/purchasePlan/purchasePlanPerform'
},
{
/** 待执行采购计划 */
path: '/memberCenter/procurementAbility/purchasePlan/purchasePlanPerform/preview',
name: '待执行采购计划详情',
component: '@/pages/transaction/purchaseAbility/purchasePlan/detail',
hideInMenu: true,
noMargin: true,
},
]
}
]
/* 下载合同 */
export const Download = (name, contractUrl) => {
window.location.href = `/api/contract/contractTemplate/downloadContract?contractName=${name}&contractUrl=${contractUrl}`
}
......@@ -41,7 +41,6 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
onClose,
onClick
} = props;
console.log(record)
const [flag, setFlag] = useState<boolean>(false);
const [product, setProduct] = useState<any>({});
const [attribute, setAttribute] = useState<any>([]);
......
......@@ -64,8 +64,6 @@ const SelectProduct: React.FC<Iprops> = (props: any) => {
RowCtl.setSelectRow([]);
RowCtl.setSelectedRowKeys([]);
}
console.log(rowSelection, RowCtl)
return (
<Drawer
visible={visible}
......
import React, { useState, useRef } from 'react';
import {
Radio,
Table,
Typography
} from 'antd';
import { IAntdSchemaFormProps } from '@formily/antd'
import { PublicApi } from '@/services/api';
const { Text } = Typography;
import { StandardTable } from 'god';
export interface Iprops extends IAntdSchemaFormProps {
/* 显示隐藏 */
contractId,
}
const circulation: React.FC<Iprops> = ({
contractId
}) => {
const [listIndex, setlistIndex] = useState('1');
const ref = useRef({});
/* 流转列表 */
const CirculationList: any = [
{ title: '序号', dataIndex: 'name', align: 'center', render: (_, record, index) => index + 1, },
{ title: '操作角色', dataIndex: 'roleName', align: 'center', },
{ title: '状态', dataIndex: 'statusName', align: 'center', },
{ title: '操作', dataIndex: 'operate', align: 'center', },
{ title: '操作时间', dataIndex: 'operateTime', align: 'center', },
{ title: '审核意见', dataIndex: 'opinion', align: 'center', },
]
/* 内部 */
const fetchDataListcolumns: any = [
{ title: '操作人', dataIndex: 'name', align: 'center', render: (_, record, index) => index + 1, },
{ title: '部门', dataIndex: 'department', align: 'center', },
{ title: '职位', dataIndex: 'jobTitle', align: 'center', },
{ title: '状态', dataIndex: 'statusName', align: 'center', },
{ title: '操作', dataIndex: 'operate', align: 'center', },
{ title: '操作时间', dataIndex: 'operateTime', align: 'center', },
{ title: '审核意见', dataIndex: 'opinion', align: 'center', },
]
const handleBatchChange = (e) => {
setlistIndex(e.target.value)
setTimeout(() => {
ref.current.reload();
}, 300);
};
/* 流转记录内部 */
const fetchData = (params) => {
return new Promise((resolve, reject) => {
let fn;
fn = listIndex == '1' ? PublicApi.getContractCoordinationPageOuterRecordList : PublicApi.getContractCoordinationPageInnerRecordList;
fn({
...params,
contractId: contractId
}).then(res => {
console.log(res.data, listIndex)
resolve(res.data)
}).catch(err => {
console.log(err)
})
})
}
return (
<div id='record' className='ant-card ant-card-bordered'>
<div className='ant-card-head'>
<div className='ant-card-head-wrapper'>
<div className='ant-card-head-wrapper'>
流转记录
</div>
<div className='ant-card-extra'>
<Radio.Group defaultValue={listIndex} onChange={(e) => handleBatchChange(e)}>
<Radio.Button value="1">外部流转</Radio.Button>
<Radio.Button value="2">内部流转</Radio.Button>
</Radio.Group>
</div>
</div>
</div>
<div className='ant-card-body'>
<StandardTable
tableProps={{
rowKey: 'id',
}}
currentRef={ref}
columns={listIndex === '1' ? CirculationList : fetchDataListcolumns}
fetchTableData={(params: any) => fetchData(params)}
/>
</div>
</div>
)
}
export default circulation;
import React, { useRef } from 'react';
import { StandardTable } from 'god';
import { IAntdSchemaFormProps } from '@formily/antd'
import EyePreview from '@/components/EyePreview';
import { PublicApi } from '@/services/api';
export interface Iprops extends IAntdSchemaFormProps {
/* 显示隐藏 */
contractId: any,
}
const DetailedList: React.FC<Iprops> = ({
contractId
}) => {
const ref = useRef({});
const columnsList: any = [
{
title: '请款次数', dataIndex: 'name', key: 'name', align: 'center',
render: (text: any, record: any, index: number) => {
return (
<span>{index + 1}</span>
)
},
},
{
title: '请款单号/摘要', dataIndex: 'applyNo', align: 'center',
render: (text: any, record: any) => {
return (
<div>
<EyePreview
url={`/memberCenter/contract/funds/bill/details?applyId=${record.id}&type=pageDetailList`}
>
{text}
</EyePreview>
<p>{record.applyAbstract}</p>
</div>
);
}
},
{ title: '请款时间', dataIndex: 'applyTime', align: 'center', },
{
title: '请款金额', dataIndex: 'applyAmount', align: 'center',
render: (text: any, record: any, index: number) => {
return (
<span>{text}</span>
)
},
},
{ title: '付款时间', dataIndex: 'payTime', align: 'center', },
{
title: '付款金额', dataIndex: 'payAmount', align: 'center',
render: (text: any, record: any, index: number) => {
return (
<span>{text}</span>
)
},
},
{
title: '付款方式', dataIndex: 'payWayName',
align: 'center',
},
];
/* 请款统计 */
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
PublicApi.getContractExecutePageListForSummaryByPartyA({
...params,
contractId,
}).then(res => {
if (res.code === 1000) {
console.log(res, '这个是什么玩意')
resolve(res.data)
} else {
}
})
})
}
return (
<div id='record' className='ant-card ant-card-bordered'>
<div className='ant-card-head'>
<div className='ant-card-head-wrapper'>
<div className='ant-card-head-wrapper'>
请款统计
</div>
</div>
</div>
<div className='ant-card-body'>
<StandardTable
tableProps={{
rowKey: 'id',
}}
currentRef={ref}
columns={columnsList}
fetchTableData={(params: any) => fetchData(params)}
/>
</div>
</div>
)
}
export default DetailedList;
......@@ -144,6 +144,7 @@
align-items: center;
color: #303133;
background-color: #fafbfc;
cursor: pointer;
}
.upload_item .upload_left :global .anticon-file-word {
color: #4279df;
......
......@@ -157,6 +157,7 @@
align-items: center;
color: #303133;
background-color: #fafbfc;
cursor: pointer;
:global {
.anticon-file-word {
color: #4279df;
......
import React, { useState, useEffect } from 'react';
import {
Space,
Table,
Typography,
message,
} from 'antd';
import style from './index.less';
import { IAntdSchemaFormProps } from '@formily/antd'
import { PublicApi } from '@/services/api';
import CrossSellProducts from '../components/modal/crossSellProducts';
const { Text } = Typography;
export interface Iprops extends IAntdSchemaFormProps {
/* 显示隐藏 */
contractId,
type,
Refresh: Function,
}
const purchaseList: React.FC<Iprops> = ({
contractId,
type,
Refresh,
}) => {
const [columns, setcolumns] = useState<any>([]);
const [ListData, setListData] = useState<any>([]);
const [Totalamount, setTotalamount] = useState(0)
const [Numberamount, setNumberamount] = useState(0)
const [listLoading, setListLoading] = useState(false);
const [size, setSize] = useState(8);
const [index, setIndex] = useState<number>();
const [record, setRecord] = useState<any>({});
const [visible, setVisible] = useState<boolean>(false);
const [total, setTotal] = useState(0);
const columnsTab = (Numberamount, Totalamount) => {
const columns: any = [
{
title: '物料编号/名称', dataIndex: 'materielNo', align: 'center',
render: (text, item, index) => {
return (
<div>
<div>{text}</div>
<div>{item.materielName}</div>
</div>
)
}
},
{ title: '规格型号', dataIndex: 'type', align: 'center', },
{ title: '品类', dataIndex: 'category', align: 'center', },
{ title: '品牌', dataIndex: 'brand', align: 'center', },
{ title: '单位', dataIndex: 'unit', align: 'center', },
{ title: '采购数量', dataIndex: 'purchaseCount', align: 'center', },
{ title: '含税', dataIndex: 'isHasTaxName', align: 'center', },
{ title: '税率', dataIndex: 'taxRate', align: 'center', },
{ title: '单价(含税)', dataIndex: 'price', align: 'center', },
{
dataIndex: 'bidCount', align: 'center',
title: (
<Space direction='vertical'>
<Text>授标数量</Text>
<Text>合计:{Numberamount}</Text>
</Space>
),
},
{
dataIndex: 'bidAmount', align: 'center',
title: (
<Space direction='vertical'>
<Text>金额(不含税)</Text>
<Text>合计: ¥{Totalamount}</Text>
</Space>
),
},
];
setcolumns(columns)
}
/* 下拉的子元素 */
const listItem = (record, index) => (
<div className={style.listItem}>
<div className={style.label}>
<p>关联</p>
<p>报价商品</p>
</div>
<div className={style.text}>
<p>商品编号:{record.associatedMaterielNo}</p>
<p>商品名称:{record.associatedGoods}</p>
</div>
<div className={style.text}>
<p>规格型号:{record.associatedType}</p>
<p>品类:{record.associatedCategory}</p>
</div>
<div className={style.text}>
<p>品牌:{record.associatedBrand}</p>
</div>
{
type == 'submitExamine' &&
<div className={style.text}>
<p style={{ color: '#00B37A', textAlign: 'right', lineHeight: '35px', cursor: 'pointer' }}
onClick={() => {
setIndex(index);
setRecord(record);
setVisible(true)
}}>关联报价商品</p>
</div>
}
</div>
)
const fetchListData = (params) => {
setListLoading(true);
PublicApi.getContractCoordinationPagePurchaseMaterielList({
...params,
contractId
}).then(res => {
let Totalamount = 0, Numberamount = 0;
res.data.data.map(item => {
Totalamount += item.bidAmount;
Numberamount += item.bidCount
})
setTotalamount(Totalamount)
setNumberamount(Numberamount)
columnsTab(Totalamount, Numberamount)
setListData(res.data.data)
Refresh(res.data.data)
setTotal(res.data.totalCount)
}).finally(() => {
setListLoading(false);
});
}
/** 确定关联商品 */
const handleConfirm = (params: any) => {
const data = [...ListData];
data[index].associatedCategory = params.product.customerCategoryName;
data[index].associatedBrand = params.product.brandName;
data[index].associatedGoods = params.product.name;
const purchaseMaterielId = data[index].id;
const associatedMaterielNo = data[index].associatedMaterielNo ? data[index].associatedMaterielNo : params.product.code
const associatedMaterielName = data[index].materielName;
const associatedType = data[index].associatedType;
const associatedCategory = data[index].associatedCategory
const associatedBrand = data[index].associatedBrand
const res_data = {
contractId,
purchaseMaterielId,
associatedGoods: params.product.name,
associatedDataId: params.product.id,
associatedMaterielNo,
associatedMaterielName,
associatedType,
associatedCategory,
associatedBrand
}
console.log(params, 10086, res_data)
let msg = message.loading({
content: '正在操作',
duration: 0,
});
PublicApi.postContractCoordinationAssociatedOfferGoods(res_data).then(res => {
if (res.code === 1000) {
let data = {
current: 1,
pageSize: 10
}
fetchListData(data)
}
}).finally(() => {
msg();
})
setListData(data)
setVisible(false);
setRecord({})
}
useEffect(() => {
if (contractId) {
let data = {
current: 1,
pageSize: 8
}
fetchListData(data)
}
}, [contractId])
// 展开/收起的回调
const onExpand = expandedKeys => {
};
const handlePaginationChange = (current: number, pageSize: number) => {
let data = {
current: current,
pageSize: 8
}
fetchListData(data)
};
return (
<div id='materials' className='ant-card ant-card-bordered'>
<div className='ant-card-head'>
<div className='ant-card-head-wrapper'>
<div className='ant-card-head-wrapper'>
采购材料
</div>
</div>
</div>
<div className='ant-card-body' >
<div className={style.box}>
<Table
columns={columns}
rowKey='id'
expandable={{
expandedRowRender: (record, index) => listItem(record, index),
onExpand: record => onExpand(record)
}}
loading={listLoading}
dataSource={ListData}
pagination={
{
pageSize: size,
total,
onChange: handlePaginationChange
}
}
style={{
width: "100%"
}}
/>
</div>
</div>
<CrossSellProducts
visible={visible}
record={record}
onClose={() => setVisible(false)}
onClick={handleConfirm}
/>
</div>
)
}
export default purchaseList;
import React, { useState, useEffect } from 'react';
import {
Radio,
Steps
} from 'antd';
import { IAntdSchemaFormProps } from '@formily/antd'
export interface Iprops extends IAntdSchemaFormProps {
/* 显示隐藏 */
outerTaskStepList?: any,
innerTaskStepList?: any,
}
const { Step } = Steps;
const Record: React.FC<Iprops> = ({
outerTaskStepList,
innerTaskStepList,
}) => {
const [currentBatch, setCurrentBatch] = useState('1');
const [StepList, setStepList] = useState<any>([]);
/**
* 流转进度点击
*/
const handleBatchChange = (e) => {
let StepList = e.target.value == 1 ? outerTaskStepList : innerTaskStepList;
setStepList(StepList)
setCurrentBatch(e.target.value)
};
useEffect(() => {
let StepList = currentBatch === '1' ? outerTaskStepList : innerTaskStepList;
setStepList(StepList)
}, [outerTaskStepList])
return (
<div id='progress' className='ant-card ant-card-bordered'>
<div className='ant-card-head'>
<div className='ant-card-head-wrapper'>
<div className='ant-card-head-wrapper'>
流转进度
</div>
<div className='ant-card-extra'>
<Radio.Group defaultValue={currentBatch} onChange={(e) => handleBatchChange(e)}>
<Radio.Button value="1">外部流转</Radio.Button>
<Radio.Button value="2">内部流转</Radio.Button>
</Radio.Group>
</div>
</div>
</div>
<div className='ant-card-body'>
<Steps progressDot>
{
StepList.map((item: any) => (
<Step
title={item.taskName}
description={item.roleName}
key={item.step}
status={item.isExecute ? 'finish' : 'wait'}
/>
))
}
</Steps>
</div>
</div>
)
}
export default Record;
import React, { useState, useEffect } from 'react';
import {
Button,
Input,
Table,
Typography,
Space
} from 'antd';
import { PublicApi } from '@/services/api';
import style from './index.less';
import { IAntdSchemaFormProps } from '@formily/antd'
import EyePreview from '@/components/EyePreview';
import moment from 'moment';
export interface Iprops extends IAntdSchemaFormProps {
contractId: any
}
const { Text } = Typography;
const situationList: React.FC<Iprops> = ({ contractId }) => {
const [page, setPage] = useState(1);
const [size, setSize] = useState(8);
const [total, setTotal] = useState(0);
const [listLoading, setListLoading] = useState(false);
/* 单据总金额 */
const [orderAmount, setorderAmount] = useState<number>(0);
/* 已付款 */
const [payAmount, setpayAmount] = useState<number>(0);
/* 已请款待付款 */
const [unPayApplyAmount, setunPayApplyAmount] = useState<number>(0)
/* 待请款 */
const [unApplyAmount, setunApplyAmount] = useState<number>(0)
const [data, setdata] = useState<any>([])
/* 执行请款的选中 */
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
/* 搜素 */
const onSearch = (values) => {
const data = {
contractId,
orderNo: values,
orderAbstract: '',
startTime: "",
endTime: "",
current: 1,
pageSize: 5,
}
getContracInfoList(data)
}
/* 执行情况分页 */
const getContracInfoList = (data) => {
setListLoading(true);
PublicApi.getContractExecutePageExecuteInfoList(data).then(res => {
if (res.code === 1000) {
let orderAmount = 0, payAmount = 0, unPayApplyAmount = 0, unApplyAmount = 0;
if (res.data.data) {
let list = res.data.data.map((item: any, index: number) => {
orderAmount += item.orderAmount;
payAmount += item.payAmount;
unApplyAmount += item.unApplyAmount;
unPayApplyAmount += item.unPayApplyAmount;
return {
...item,
keyId: index + 1,
}
})
console.log(list)
setdata(list)
}
setTotal(res.data.totalCount)
setunApplyAmount(unApplyAmount)
setunPayApplyAmount(unPayApplyAmount)
setpayAmount(payAmount)
setorderAmount(orderAmount)
}
}).finally(() => {
setListLoading(false);
});
}
const rowSelection: any = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
console.log(selectedRowKeys, selectedRows)
setSelectedRowKeys(selectedRowKeys)
setSelectRow(selectedRows)
}
};
/* 查看付款明细 */
const columns: any = [
{
title: '单据号/摘要', dataIndex: 'orderNO', align: 'center',
render: (text: any, record: any) => {
return (
<div>
<EyePreview
url={`/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/preview?id=${record.orderId}`}
>
{text}
</EyePreview>
<p>{record.orderAbstract}</p>
</div>
);
},
},
{
title: '单据类型', dataIndex: 'orderTypeName', align: 'center',
},
{ title: '单据状态', dataIndex: 'orderStatusName', align: 'center', },
{
title: '单据时间', dataIndex: 'orderTime', align: 'center',
render: (text: any, record: any) => {
return (
<Text>{moment(Number(text)).format('YYYY-MM-DD')}</Text>
)
}
},
{
dataIndex: 'orderAmount', align: 'center',
title: (
<Space direction='vertical'>
<Text>单据金额</Text>
<Text>合计: ¥{orderAmount}</Text>
</Space>
),
render: (text) => (
<span>{text}</span>
)
},
{
title: '含税/税率', dataIndex: 'taxRate', align: 'center',
render: (text, record) => (
<Space direction='vertical'>
<Text>{record.isHasTax == 1 ? '是' : '否'}</Text>
<Text>%{text}</Text>
</Space>
)
},
{
dataIndex: 'payAmount', align: 'center',
title: (
<Space direction='vertical'>
<Text>已付款</Text>
<Text>合计: ¥{payAmount}</Text>
</Space>
),
render: (text) => (
<span>{text}</span>
)
},
{
title: (
<Space direction='vertical'>
<Text>已请款待付款</Text>
<Text>合计: ¥{unPayApplyAmount}</Text>
</Space>
),
dataIndex: 'unPayApplyAmount', align: 'center',
render: (text) => (
<span>{text}</span>
)
},
{
title: (
<Space direction='vertical'>
<Text>待请款</Text>
<Text>合计: ¥{unApplyAmount}</Text>
</Space>
),
dataIndex: 'unApplyAmount', align: 'center',
render: (text) => (
<span>{text}</span>
)
},
{
title: '操作', dataIndex: 'type', align: 'center',
render: (text, record) => {
// 已付款大于0或已请款待付款大于0的才显示查看付款明细按钮。
return (
<div>
{
// onClick = {() => getPayment(record.id)}
record.payAmount > 0 || record.unPayApplyAmount > 0 && <a className={style.gesture}>查看付款明细</a>
}
</div>
)
}
},
];
const handlePaginationChange = (current: number, pageSize: number) => {
const data = {
contractId,
orderNo: '',
orderAbstract: '',
startTime: "",
endTime: "",
current: current,
pageSize: size,
}
console.log(data)
getContracInfoList(data)
};
return (
<div id='docking' className='ant-card ant-card-bordered'>
<div className='ant-card-head'>
<div className='ant-card-head-wrapper' style={{ display: 'flex', justifyContent: 'space-between' }}>
<div className='ant-card-head-wrapper'>
执行情况
</div>
<div className={style.wrapper}>
<Input.Search
style={{ width: 240 }}
placeholder="搜素"
allowClear
onSearch={onSearch}
/>
<Button style={{ paddingLeft: 10, paddingRight: 10, marginLeft: 10, marginRight: 10 }}> 重置 </Button>
</div>
</div>
</div>
<div className='ant-card-body'>
<Table
rowKey='keyId'
rowSelection={rowSelection}
columns={columns}
dataSource={data}
loading={listLoading}
pagination={
{
pageSize: size,
total,
onChange: handlePaginationChange
}
}
style={{
width: "100%"
}}
/>
</div>
</div>
)
}
export default situationList;
import React, { useRef, useState, useEffect } from 'react';
import { Button, Card, Tabs, Table, Input, Form, Select, Drawer, DatePicker, Modal, InputNumber } from 'antd'
import { Button, Tabs, Table, Input, Form, Select, Drawer, DatePicker, } from 'antd'
import styles from './index.less'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
......@@ -15,6 +15,7 @@ import { StandardTable } from 'god';
import { PublicApi } from '@/services/api';
const { Option } = Select;
import { Schema } from "./schema"
import style from '../../../constants/styles.less'
const AddInfo = (props: any) => {
const { currentRef, getcontractId, sourceType } = props;
......@@ -40,8 +41,8 @@ const AddInfo = (props: any) => {
expectPayTime: '',//预计付款时间(yyyy-MM-dd)
payWay: '',//付款方式,1.现结,2.账期,3.月结
payParam: '',// 付款参数(账期天数请款日)
moneyPayWay: '',//支付方式:2.线下支付
moneyPayChannel: '',//支付渠道:5.线下支付线上确认
moneyPayWay: '2',//支付方式:2.线下支付
moneyPayChannel: '5',//支付渠道:5.线下支付线上确认
remark: '',//备注
})
const [Info, setInfo] = useState<any>({
......@@ -153,6 +154,7 @@ const AddInfo = (props: any) => {
name: item.payWay == 1 ? '账期' : item.payWay == 2 ? '月结' : '现结',
payParam: item.payParam,
Index: index + 1,
payWay: item.payWay,
id: item.id,
})
})
......@@ -232,7 +234,7 @@ const AddInfo = (props: any) => {
}
return (
<div>
<div className={style.revise_info}>
<Form
form={attrValueForm}
name="edit_infomation"
......@@ -305,7 +307,7 @@ const AddInfo = (props: any) => {
>
{
payPlanList.map(item => (
<Option value={item.id}>{item.payStage}</Option>
<Option value={item.id} key={item.id}>{item.payStage}</Option>
))
}
</Select>
......@@ -355,13 +357,14 @@ const AddInfo = (props: any) => {
{
tag.map((item: any) => {
return (
<span className={item.Index == Index ? styles.tative : styles.tag} onClick={() => setBasicsKey(item.id)}>{item.name}</span>
<span className={item.Index == Index ? styles.tative : styles.tag} onClick={() => setBasicsKey(item.id)} key={item.Index}>{item.name}</span>
)
})
}
</Form.Item>
<Form.Item label=" " labelAlign="left" labelCol={{ span: 4 }} wrapperCol={{ span: 18 }} >
<Input addonAfter={Index === 1 ? '天' : Index === 3 ? '号' : null} value={tag[Index - 1].name === '现结' ? '' : tag[Index - 1].payParam} disabled={tag[Index - 1].name === '现结' ? true : false} />
{/* * payWay 1 账期 2 月结 3 现结 */}
<Input addonAfter={Index === 2 ? '天' : Index === 3 ? '号' : null} value={tag[Index - 1].name === '现结' ? '' : tag[Index - 1].payParam} disabled={tag[Index - 1].name === '现结' ? true : false} />
</Form.Item>
</>
}
......@@ -375,6 +378,7 @@ const AddInfo = (props: any) => {
>
<Select
onChange={(e) => onSelectChange(e, 'moneyPayWay')}
value={basics.moneyPayWay}
style={{
width: '290px',
// marginRight: 20,
......@@ -385,6 +389,7 @@ const AddInfo = (props: any) => {
<Select
onChange={(e) => onSelectChange(e, 'moneyPayChannel')}
value={basics.moneyPayChannel}
style={{
width: '290px'
}}
......
......@@ -29,7 +29,7 @@ const table = (props: any) => {
* @param tabcolumns 单据表格
*/
const [visible, setvisible] = useState<boolean>(false);
const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'orderId', type: 'radio' });
// const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'orderId' });
const [toorderAmount, settoorderAmount] = useState<number>(0);
const [topayAmount, settopayAmount] = useState<number>(0);
const [tounPayApplyAmount, settounPayApplyAmount] = useState<number>(0);
......@@ -140,8 +140,17 @@ const table = (props: any) => {
render: (_, item, index) => <a onClick={() => Delete(item, index)}>删除</a>,
}
];
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const rowSelection: any = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows)
setSelectedRowKeys(selectedRowKeys)
console.log(selectedRowKeys, selectedRows, 'rowSelection')
}
};
const onSelectChange = (e, name, idx) => {
let item = [...PlanList];
......@@ -245,19 +254,16 @@ const table = (props: any) => {
params.contractId = id;
return new Promise(resolve => {
PublicApi.getContractApplyAmountContractOrderPageList({ ...params }).then(res => {
console.log(res)
res.data.data.find(item => {
res.data.data.findIndex((item, index) => {
item.orderTime = item.orderTime ? moment().format('YYYY-MM-DD') : '';
item.keyId = index + 1;
})
resolve(res.data)
})
})
}
const Confirm = () => {
let PlanList = [];
PlanList.push(RowCtl.selectRow[0])
setPlanList(PlanList)
console.log(PlanList, RowCtl.selectRow[0])
setPlanList(selectRow)
setvisible(false)
Amount()
}
......@@ -306,7 +312,7 @@ const table = (props: any) => {
<Table
columns={tabcolumns}
dataSource={PlanList}
rowKey="id"
rowKey="keyId"
style={{
width: "100%"
}}
......@@ -337,7 +343,7 @@ const table = (props: any) => {
>
<StandardTable
tableProps={{
rowKey: 'orderId',
rowKey: 'keyId',
}}
columns={columnsList}
currentRef={refs}
......
......@@ -27,7 +27,6 @@ const Materials = (props: any) => {
totalpayAmount: 0,
totalunPayApplyAmount: 0,
totalapplyAmount: 0,
})
// 列表数据
const fetchData = (params?: any) => {
......@@ -76,7 +75,7 @@ const Materials = (props: any) => {
align: 'center',
}, {
title: '单据状态',
dataIndex: 'orderTypeName',
dataIndex: 'statusName',
align: 'center',
},
{
......
......@@ -41,7 +41,10 @@ const FormList = (props: any) => {
const getGoodsList = (params) => {
return new Promise(resolve => {
PublicApi.getProductGoodsGetGoodsList(params).then(res => {
resolve(res.data)
if (res.code === 1000) {
console.log(res.data, 1231321)
resolve(res.data)
}
})
})
}
......@@ -63,6 +66,7 @@ const FormList = (props: any) => {
current: '1',
pageSize: '3',
}
PublicApi.getPurchaseQuotedPriceProductlistListContract(parmas).then(res => {
let data = res.data.data.map(item => {
return {
......@@ -76,12 +80,13 @@ const FormList = (props: any) => {
isHasTax: item.isTax,
taxRate: item.taxProbability,
price: item.taxUnitPrice,
bidCount: item.awardCount,
bidAmount: item.awardPrice,
bidCount: item.awardTaxProbability * item.purchaseCount / 100,
bidAmount: item.awardTaxProbability * item.purchaseCount / 100 * item.taxUnitPrice,
associatedDataId: item.productId,
associatedMaterielNo: item.number,
associatedMaterielName: item.productName,
associatedGoods: item.productAttributeJson
}
})
setData(data)
......@@ -126,6 +131,7 @@ const FormList = (props: any) => {
placeholder=""
onChange={(e) => setInput(e, 'purchaseCount', index)}
defaultValue={record.purchaseCount}
disabled={Object.keys(Row).length != 0 ? true : false}
/>
</Form.Item>
},
......@@ -141,6 +147,7 @@ const FormList = (props: any) => {
style={{ width: 80 }}
defaultValue={text === 0 || text === 1 ? text.toString() : ''}
onChange={(e) => setInput(e, 'isHasTax', index)}
disabled={Object.keys(Row).length != 0 ? true : false}
>
<Option value="0" key={0}></Option>
<Option value="1" key={1}></Option>
......@@ -161,6 +168,7 @@ const FormList = (props: any) => {
defaultValue={text}
onChange={(e) => setInput(e, 'taxRate', index)}
addonAfter="%"
disabled={Object.keys(Row).length != 0 ? true : false}
/>
</Form.Item>
},
......@@ -179,6 +187,7 @@ const FormList = (props: any) => {
onChange={(e) => setInput(e, 'price', index)}
addonBefore="¥"
defaultValue={text}
disabled={Object.keys(Row).length != 0 ? true : false}
/>
</Form.Item>
},
......@@ -196,6 +205,7 @@ const FormList = (props: any) => {
onChange={(e) => setInput(e, 'bidCount', index)}
addonBefore="¥"
defaultValue={text ? text : ''}
disabled={Object.keys(Row).length != 0 ? true : false}
/>
</Form.Item>
},
......
import React, { useRef, useState, useEffect, useImperativeHandle, forwardRef } from 'react';
import { Button, Card, Tabs, Table, Input, Select, DatePicker, Popconfirm, Form, Checkbox, Drawer, Typography, Modal, InputNumber } from 'antd'
import styles from '../index.less'
import React, { useState, useEffect, forwardRef } from 'react';
import { Button, Select, Form, Checkbox, message } from 'antd'
import { PublicApi } from '@/services/api';
import styles from '../index.less'
import {
FileWordFilled,
} from '@ant-design/icons'
const ContractText = (props: any) => {
const { currentRef } = props;
const { currentRef, memberId } = props;
const [TemplatePage, setTemplatePage] = useState<any>([]);
const [Templatel, setTemplatel] = useState<any>({});
const [checkNick, setCheckNick] = useState(true);
const [contractFlag, setcontractFlag] = useState<boolean>(false);
/* 第四个tab */
const onCheckboxChange = (e: { target: { checked: boolean } }) => {
setCheckNick(e.target.checked);
......@@ -44,7 +43,6 @@ const ContractText = (props: any) => {
})
}
})
// console.log(list, res.data.data);
setTemplatePage(list)
})
......@@ -66,6 +64,29 @@ const ContractText = (props: any) => {
useEffect(() => {
contractTemplate();
}, [])
/* 生成电子合同 */
const generate = () => {
if (!Templatel.id) {
message.info('请先选择合同模版')
} else {
const param = {
contractTemplateId: Templatel.id,
memberId,
}
// console.log(Templatel)
PublicApi.postContractSignatureContractCreate(param).then(res => {
console.log(res);
Templatel.name = res.data.contractName
Templatel.fileUrl = res.data.contractUrl
setTemplatel(Templatel)
setcontractFlag(true)
})
}
}
/**下载 */
const onDownload = () => {
window.location.href = `/api/contract/contractTemplate/downloadContract?contractName=${Templatel.name}&contractUrl=${Templatel.contractUrl}`
}
return (
<div
style={{
......@@ -80,13 +101,15 @@ const ContractText = (props: any) => {
onChange={(e) => getTemplate(e)}
>
</Select>
<Button type='link' >生成合同</Button>
{
checkNick && <Button type='link' onClick={() => generate()}>生成合同</Button>
}
</Form.Item>
{
Object.keys(Templatel).length != 0 &&
contractFlag &&
<Form.Item label="合同文本" labelAlign="left" labelCol={{ span: 2 }}>
<div className={styles.upload_item} style={{ width: 680 }}>
<div className={styles.upload_left} style={{ width: 600 }}>
<div className={styles.upload_left} style={{ width: 600 }} onClick={() => onDownload()}>
<FileWordFilled />
<span>{Templatel.name}</span>
</div>
......
......@@ -28,7 +28,7 @@ export interface IProps {
}
const Information = (props: any) => {
const { fetchdata, currentRef, Row, getrow, sourceType } = props;
const { fetchdata, currentRef, Row, getrow, getmemberId, sourceType } = props;
const refs = useRef({});
/**
* @param {{visible}} 显示选择合同弹出
......@@ -105,7 +105,6 @@ const Information = (props: any) => {
basicsVO.partyBMemberId = Row.awardRoleId ? Row.awardMemberId : '';
basicsVO.partyBRoleId = Row.awardRoleId ? Row.awardRoleId : '';
setbasicsVO(basicsVO)
console.log(Row, 1111111111111111111)
attrValueForm.setFieldsValue(basicsVO)
setfalg(Row.sourceNo ? true : false)
setmanual(Row.partyBName ? true : false)
......@@ -147,10 +146,10 @@ const Information = (props: any) => {
basicsVO.partyBMemberId = RowCtl.selectRow[0].memberId;
basicsVO.partyBRoleId = RowCtl.selectRow[0].roleId
basicsVO.sourceType = Change;
console.log(basicsVO)
setfalg(true)
attrValueForm.setFieldsValue(basicsVO);
// getType(true)
getmemberId(basicsVO.partyBMemberId)
} else {
let totalAmount, sourceId, partyBName, partyBMemberId, sourceNo, partyBRoleId;
const selectRow = RowCtl.selectRow[0];
......@@ -174,7 +173,6 @@ const Information = (props: any) => {
default:
break;
}
console.log(totalAmount, sourceId, partyBName, totalAmount, partyBMemberId, sourceNo)
basicsVO.totalAmount = totalAmount;
basicsVO.sourceId = sourceId;
basicsVO.partyBName = partyBName;
......@@ -183,10 +181,10 @@ const Information = (props: any) => {
basicsVO.partyBRoleId = partyBRoleId;
setbasicsVO(basicsVO)
setmanual(true)
// getType(false)
attrValueForm.setFieldsValue(basicsVO);
selectRow.partyBMemberId = selectRow.awardMemberId;
selectRow.partyBRoleId = selectRow.awardRoleId;
getmemberId(selectRow.partyBMemberId)
getrow(selectRow)
}
Choose()
......
......@@ -30,11 +30,16 @@ const Add: React.FC<{}> = (props: any) => {
const [payPlanList, setpayPlanList] = useState<any>([]);
/* 初始值 */
const [Row, setRow] = useState<any>({})
const [memberId, setmemberId] = useState<string>('')
/* 获取下拉框选中的id 查询物料 */
const getrow = (row) => {
// console.log(row, 1111111111111)
setRow(row)
}
/* 获取供应商角色id */
const getmemberId = (memberId) => {
setmemberId(memberId)
}
const TabList = [
{
name: '基本信息',
......@@ -45,6 +50,7 @@ const Add: React.FC<{}> = (props: any) => {
Row={Row}
sourceType={sourceType}
getrow={getrow}
getmemberId={getmemberId}
/>
},
{
......@@ -64,7 +70,7 @@ const Add: React.FC<{}> = (props: any) => {
currentRef={payPlan}
/>
},
{ name: '合同文本', components: <ContractText currentRef={contractText} /> },
{ name: '合同文本', components: <ContractText currentRef={contractText} memberId={memberId} /> },
]
/* 提交*/
......@@ -110,6 +116,8 @@ const Add: React.FC<{}> = (props: any) => {
useEffect(() => {
if (sourceType) {
setRow(JSON.parse(sessionStorage.getItem('record')))
const memberId = JSON.parse(sessionStorage.getItem('record')).partyBMemberId;
setmemberId(memberId)
}
}, [])
return (
......
......@@ -44,6 +44,7 @@
display: flex;
align-items: center;
color: #303133;
cursor: pointer;
background-color: #fafbfc;
}
.upload_item .upload_left :global .anticon-file-word {
......
......@@ -48,6 +48,7 @@
display: flex;
align-items: center;
color: #303133;
cursor: pointer;
background-color: #fafbfc;
:global {
.anticon-file-word {
......
......@@ -49,6 +49,7 @@ const FormList = (props: any) => {
placeholder=""
onChange={(e) => setInput(e, 'purchaseCount', index)}
defaultValue={record.purchaseCount}
disabled
/>
</Form.Item>
},
......@@ -65,6 +66,7 @@ const FormList = (props: any) => {
style={{ width: 80 }}
defaultValue={text === 0 || text === 1 ? text.toString() : ''}
onChange={(e) => setInput(e, 'isHasTax', index)}
disabled
>
<Option value="0" key={0}></Option>
<Option value="1" key={1}></Option>
......@@ -85,6 +87,7 @@ const FormList = (props: any) => {
defaultValue={text}
onChange={(e) => setInput(e, 'taxRate', index)}
addonAfter="%"
disabled
/>
</Form.Item>
},
......@@ -103,6 +106,7 @@ const FormList = (props: any) => {
onChange={(e) => setInput(e, 'price', index)}
addonBefore="¥"
defaultValue={text}
disabled
/>
</Form.Item>
},
......@@ -120,6 +124,7 @@ const FormList = (props: any) => {
onChange={(e) => setInput(e, 'bidCount', index)}
addonBefore="¥"
defaultValue={text ? text : ''}
disabled
/>
</Form.Item>
},
......
......@@ -19,6 +19,7 @@ const Information = (props: any) => {
* */
useEffect(() => {
basic.sourceType = String(basic.sourceType);
console.log(basic)
if (basic.contractNo) {
if (oldContractId) {
let data = { oldContractNo: basic.contractNo }
......@@ -30,9 +31,9 @@ const Information = (props: any) => {
attrValueForm.setFieldsValue(basic)
}
})
} else {
attrValueForm.setFieldsValue(basic)
}
} else {
attrValueForm.setFieldsValue(basic)
}
}, [basic])
......
......@@ -3,6 +3,9 @@
h5 { margin-bottom: 2em; }
.label {
flex: 0 0 25%;
color: #909399;
color: #909399;
}
.content {
flex: 0 0 70%;
}
}
......@@ -9,14 +9,18 @@ import moment from 'moment';
export interface IPROPS {
id?: number,
fetch?: () => Promise<unknown>,
layoutTitle?: string
/** 标题 */
layoutTitle?: string,
/** 需要展示的column */
column?: string
}
const DemandPlanMaterialLayout: React.FC<IPROPS> = (props: any) => {
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const { id, fetch, layoutTitle } = props;
const { id, fetch, layoutTitle, column } = props;
const currentRef = useRef({});
const columns: ColumnType<any>[] = [
......@@ -60,11 +64,13 @@ const DemandPlanMaterialLayout: React.FC<IPROPS> = (props: any) => {
title: '成本价',
key: 'costPrice',
dataIndex: 'costPrice',
render: (text: any) => (<>{ text ? `¥${text.toFixed(2)}` : `¥0` }</>)
},
{
title: '需求金额',
key: 'needPrice',
dataIndex: 'needPrice',
render: (text: any) => (<>{ text ? `¥${text.toFixed(2)}` : `¥0` }</>)
},
{
title: '到货日期',
......
......@@ -46,24 +46,24 @@ const ProgressLayout: React.FC<ProgressProps> = (props: any) => {
context.externalLogStates && context.externalLogStates.map(item => (
<Steps.Step
key={item.state}
title={item.roleName}
description={item.operationalProcess}
title={item.operationalProcess}
description={item.roleName}
status={item.isExecute ? 'finish' : 'wait'}
/>
)) : (logStatesStatus === LOGSTATESTYPE.INTERIORSTATES ?
context.interiorLogStates && context.interiorLogStates.map(item => (
<Steps.Step
key={item.state}
title={item.roleName}
description={item.operationalProcess}
title={item.operationalProcess}
description={item.roleName}
status={item.isExecute ? 'finish' : 'wait'}
/>
)) :
context.examineInteriorLogStates && context.examineInteriorLogStates.map(item => (
<Steps.Step
key={item.state}
title={item.roleName}
description={item.operationalProcess}
title={item.operationalProcess}
description={item.roleName}
status={item.isExecute ? 'finish' : 'wait'}
/>
))
......
import React, { useRef } from 'react';
import { StandardTable } from 'god';
import { Space, Typography, Button } from 'antd';
import Card from '../../../card';
import EyePreview from '@/components/EyePreview';
import { ColumnType } from 'antd/lib/table/interface';
import moment from 'moment';
export interface IPROPS {
id?: number,
fetch?: () => Promise<unknown>,
/** 标题 */
layoutTitle?: string,
/** 需要展示的column */
column?: string
}
const PurchasePlanMaterialLayout: React.FC<IPROPS> = (props: any) => {
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const { id, fetch, layoutTitle, column } = props;
const currentRef = useRef({});
const columns: ColumnType<any>[] = [
{
title: '物料编号/名称',
key: 'number',
dataIndex: 'number',
render: (text: any, record: any) => (
<Space direction='vertical' size={0}>
<EyePreview class type='button'>{text}</EyePreview>
<Typography.Text>{record.name}</Typography.Text>
</Space>
)
},
{
title: '规格型号',
key: 'model',
dataIndex: 'model',
},
{
title: '品类',
key: 'category',
dataIndex: 'category',
},
{
title: '品牌',
key: 'brand',
dataIndex: 'brand',
},
{
title: '单位',
key: 'unit',
dataIndex: 'unit',
},
{
title: '计划采购数量',
key: 'purchaseCount',
dataIndex: 'purchaseCount',
},
{
title: '成本价',
key: 'costPrice',
dataIndex: 'costPrice',
render: (text: any) => (<>{ text ? `¥${text.toFixed(2)}` : `¥0` }</>)
},
{
title: '计划采购金额',
key: 'purchasePrice',
dataIndex: 'purchasePrice',
render: (text: any) => (<>{ text ? `¥${text.toFixed(2)}` : `¥0` }</>)
},
{
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (_t: any) => <Button type='link'>查看需求计划明细</Button>
}
];
const productlist = (params: any) => {
return new Promise(resolve => {
fetch({ id, ...params }).then((res: any) => {
resolve(res.data)
})
})
}
return (
<Card
id='materialLayout'
title={layoutTitle}
>
<StandardTable
currentRef={currentRef}
columns={columns}
tableProps={{ rowKey: 'id' }}
fetchTableData={(params: any) => productlist(params)}
/>
</Card>
)
}
PurchasePlanMaterialLayout.defaultProps = {
layoutTitle: '计划采购材料'
}
export default PurchasePlanMaterialLayout;
......@@ -12,9 +12,9 @@ import moment from 'moment';
import {
OFFTER_INTERNALSTATE_COLOR
} from '../../constants';
import { MinusCircleOutlined } from '@ant-design/icons';
import { CheckCircleOutlined } from '@ant-design/icons';
import ModalOperate from '../../components/modalOperate';
import DemandPlanMaterialLayout from '../../components/detail/components/demandPlanMaterialLayout';
import PurchasePlanMaterialLayout from '../../components/detail/components/purchasePlanMaterialLayout';
const TABLINK = [
{ id: 'progressLayout', title: '流转进度' },
......@@ -34,6 +34,7 @@ const PurchasePlanDetailed = () => {
pathname,
} = history.location;
const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]);
const [pathPci] = useState(pathname.split('/')[pathname.split('/').length - 2]);
const [visible, setVisible] = useState<boolean>(false);
const [dataSource, setDataSource] = useState<any>({});
const [basicEffect, setBasicEffect] = useState<any>([]);
......@@ -41,15 +42,37 @@ const PurchasePlanDetailed = () => {
setBasicEffect([
{
col: [
{ label: '需求计划编号', extra: data.needPlanNo },
{ label: '需求计划摘要', extra: data.summary },
{ label: '采购计划编号', extra: data.purchasePlanNo },
{
label: '采购计划摘要', extra: (
<div style={{ display: 'flex', justifyContent: 'space-between', width: '100%' }}>
<span>{data.summary}</span>
{ (pathPci === 'purchasePlanSubmit' && path === 'detail') && (<span style={{ padding: 0, color: '#00B37A', cursor: 'pointer' }}>修改摘要</span>)}
</div>
)
},
{ label: '内部状态', extra: <Badge status={OFFTER_INTERNALSTATE_COLOR[data.innerStatus]} text={data.innerStatusName} /> },
]
},
{
col: [
{ label: '需求计划开始', extra: format(data.startTime) },
{ label: '需求计划截止', extra: format(data.endTime) },
{
label: '采购计划开始', extra: (
<div style={{ display: 'flex', justifyContent: 'space-between', width: '100%' }}>
<span>{format(data.startTime)}</span>
{(pathPci === 'purchasePlanSubmit' && path === 'detail') && (<span style={{ padding: 0, color: '#00B37A', cursor: 'pointer' }}>修改时间</span>)}
</div>
)
},
{
label: '采购计划截止', extra: (
<div style={{ display: 'flex', justifyContent: 'space-between', width: '100%' }}>
<span>{format(data.endTime)}</span>
{(pathPci === 'purchasePlanSubmit' && path === 'detail') && (<span style={{ padding: 0, color: '#00B37A', cursor: 'pointer' }}>修改时间</span>)}
</div>
)
},
]
},
{
......@@ -112,6 +135,32 @@ const PurchasePlanDetailed = () => {
fetchDataSource();
}, [])
const handleSubmit = () => {
if (pathPci !== 'purchasePlanSubmit') {
setVisible(true);
return
}
PublicApi.postPurchasePurchasePlanSubmitExam({ id }).then(res => {
if (res.code !== 1000) {
return
}
history.goBack();
})
}
const fetchLink = () => {
let fetchSoure: any = null;
switch (pathPci) {
case 'purchasePlanOne':
fetchSoure = PublicApi.postPurchasePurchasePlanFirstExam
break;
case 'purchasePlanTwo':
fetchSoure = PublicApi.postPurchasePurchasePlanSecondExam
break;
}
return fetchSoure
}
return (
<Context.Provider value={dataSource}>
<PeripheralLayout
......@@ -123,33 +172,33 @@ const PurchasePlanDetailed = () => {
{path === 'detail'
&& (
<Button
onClick={() => setVisible(true)}
onClick={handleSubmit}
type='primary'
>
<MinusCircleOutlined />
单据退回
<CheckCircleOutlined />
提交审核
</Button>
)}
</>
}
components={
<Fragment>
<ProgressLayout />
<ProgressLayout logstate={2} />
<BasicLayout effect={basicEffect} />
<DemandPlanMaterialLayout
<PurchasePlanMaterialLayout
id={id}
fetch={PublicApi.getPurchaseNeedPlanNeedPlanDetail}
fetch={PublicApi.getPurchasePurchasePlanPurchasePlanDetail}
/>
<RecordLyout />
<RecordLyout logstate={2} />
</Fragment>
}
/>
<ModalOperate
id={id}
title="单据退回"
modalType="billBack"
title="单据审核"
modalType="planAudit"
visible={visible}
fetch={PublicApi.postPurchaseNeedPlanSendBack}
fetch={fetchLink()}
onCancel={() => setVisible(false)}
onOk={() => history.goBack()}
/>
......
......@@ -22,7 +22,7 @@ const PurchasePlanOne = () => {
dataIndex: 'purchasePlanNo',
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview url={`/memberCenter/procurementAbility/offter/auditOffterOne/view?id=${record.id}&number=${record.quotedPriceNo}&turn=${record.turn}`}>{text}</EyePreview>
<EyePreview url={`/memberCenter/procurementAbility/purchasePlan/purchasePlanOne/preview?id=${record.id}`}>{text}</EyePreview>
<Text>{record.summary}</Text>
</Space>
)
......@@ -62,7 +62,7 @@ const PurchasePlanOne = () => {
<>
<Button
type='link'
onClick={() => history.push(`/memberCenter/procurementAbility/offter/auditOffterOne/detail?id=${record.id}&number=${record.quotedPriceNo}`)}
onClick={() => history.push(`/memberCenter/procurementAbility/purchasePlan/purchasePlanOne/detail?id=${record.id}`)}
>
审核
</Button>
......
......@@ -22,7 +22,7 @@ const PurchasePlanPerform = () => {
dataIndex: 'purchasePlanNo',
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview url={`/memberCenter/procurementAbility/offter/auditOffterOne/view?id=${record.id}&number=${record.quotedPriceNo}&turn=${record.turn}`}>{text}</EyePreview>
<EyePreview url={`/memberCenter/procurementAbility/purchasePlan/purchasePlanPerform/preview?id=${record.id}`}>{text}</EyePreview>
<Text>{record.summary}</Text>
</Space>
)
......@@ -54,21 +54,7 @@ const PurchasePlanPerform = () => {
key: 'innerStatus',
dataIndex: 'innerStatus',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={record.innerStatusName} />
}, {
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (text: any, record: any) => (
<>
<Button
type='link'
onClick={() => history.push(`/memberCenter/procurementAbility/offter/auditOffterOne/detail?id=${record.id}&number=${record.quotedPriceNo}`)}
>
审核
</Button>
</>
)
}];
},];
return (
<Table
......
import React, { useRef } from 'react';
import Table from '../../components/table'
import { history } from 'umi';
import Table from '../../components/table';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import moment from 'moment';
......@@ -23,7 +24,7 @@ const PurchasePlanSubmit = () => {
dataIndex: 'purchasePlanNo',
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview url={`/memberCenter/procurementAbility/offter/auditOffterOne/view?id=${record.id}&number=${record.quotedPriceNo}&turn=${record.turn}`}>{text}</EyePreview>
<EyePreview url={`/memberCenter/procurementAbility/purchasePlan/purchasePlanSubmit/preview?id=${record.id}`}>{text}</EyePreview>
<Text>{record.summary}</Text>
</Space>
)
......@@ -62,11 +63,9 @@ const PurchasePlanSubmit = () => {
render: (text: any, record: any) => (
<>
{ record.innerStatus === DEMANDPLAN_INTERNALSTATE_TYPE.WAITESUBMITAUDIT_TYPE && (
<Popconfirm title="确定要提交吗?" okText="是" cancelText="否">
<Button type='link'>
提交
</Button>
</Popconfirm>
<Button type='link' onClick={() => history.push(`/memberCenter/procurementAbility/purchasePlan/purchasePlanSubmit/detail?id=${record.id}`)}>
提交
</Button>
)}
<Popconfirm title="确定要删除吗?" okText="是" cancelText="否" onConfirm={() => handleDelect(record.id)}>
<Button type='link'>
......
......@@ -22,7 +22,7 @@ const PurchasePlanTwo = () => {
dataIndex: 'purchasePlanNo',
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview url={`/memberCenter/procurementAbility/offter/auditOffterOne/view?id=${record.id}&number=${record.quotedPriceNo}&turn=${record.turn}`}>{text}</EyePreview>
<EyePreview url={`/memberCenter/procurementAbility/purchasePlan/purchasePlanTwo/preview?id=${record.id}`}>{text}</EyePreview>
<Text>{record.summary}</Text>
</Space>
)
......@@ -62,7 +62,7 @@ const PurchasePlanTwo = () => {
<>
<Button
type='link'
onClick={() => history.push(`/memberCenter/procurementAbility/offter/auditOffterOne/detail?id=${record.id}&number=${record.quotedPriceNo}`)}
onClick={() => history.push(`/memberCenter/procurementAbility/purchasePlan/purchasePlanTwo/detail?id=${record.id}`)}
>
审核
</Button>
......
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