Commit 2705deba authored by XieZhiXiong's avatar XieZhiXiong

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

parents 88ab4be7 f60b8ef0
......@@ -200,6 +200,22 @@ const contracRoute = {
hideInMenu: true,
component: '@/pages/contract/funds/details',
},
{
path: '/memberCenter/contract/funds/levelpayment',
name: '待审核合同(一级)',
component: '@/pages/contract/funds/levelpayment',
},
{
path: '/memberCenter/contract/funds/secondpayment',
name: '待审核合同(二级)',
component: '@/pages/contract/funds/secondpayment',
},
{
path: '/memberCenter/contract/funds/submitpayment',
name: '待提交请款单',
component: '@/pages/contract/funds/submitpayment',
},
],
},
/* 合同协同 */
......
......@@ -12,107 +12,138 @@ import StatusTag from '@/components/StatusTag';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import moment from 'moment';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { PublicApi } from '@/services/api'
const contractexecutionList = () => {
const ref = useRef<any>({});
//表头
const columns: ColumnType<any>[] = [{
title: '合同编号/摘要',
dataIndex: 'No',
dataIndex: 'contractNo',
align: 'center',
render: (text, record) =>
<div>
<EyePreview
url={`/memberCenter/contract/contractexecution/contractexecutionList/details?id=${record.id}`}
url={`/memberCenter/contract/contractexecution/contractexecutionList/details?contractId=${record.id}`}
>
{text}
</EyePreview>
<p>{record.name}</p>
<p>{record.contractAbstract}</p>
</div>
}, {
title: '合同生效/失效时间',
dataIndex: 'number',
dataIndex: 'startTime',
align: 'center',
render: (text, record) =>
<div>
<p>{text}</p>
<p>{record.endTime}</p>
</div>
}, {
title: '合同乙方',
dataIndex: 'memberName',
dataIndex: 'partyBName',
align: 'center',
},
{
title: '合同总金额',
dataIndex: 'time',
dataIndex: 'totalAmount',
align: 'center',
defaultSortOrder: 'descend',
sorter: (a, b) => a.age - b.age,
sorter: (a, b) => a.totalAmount - b.totalAmount,
render: (text) => {
return (
<div>
<p>{text}</p>
</div>
)
}
},
{
title: '已执行金额',
dataIndex: 'Price',
dataIndex: 'executeAmount',
align: 'center',
render: (text) => {
return (
<div>
<p>{text}</p>
</div>
)
}
},
{
title: '已付款',
dataIndex: 'Price',
dataIndex: 'payAmount',
align: 'center',
render: (text) => {
return (
<div>
<p>{text}</p>
</div>
)
}
},
{
title: '已请款待付款',
dataIndex: 'Price',
dataIndex: 'unPayApplyAmount',
align: 'center',
render: (text) => {
return (
<div>
<p>{text}</p>
</div>
)
}
},
{
title: '未请款',
dataIndex: 'Price',
dataIndex: 'unApplyAmount',
align: 'center',
render: (text) => {
return (
<div>
<p>{text}</p>
</div>
)
}
},
{
title: '外部状态',
dataIndex: 'state',
dataIndex: 'outerStatusName',
align: 'center',
render: (record) => {
render: (text) => {
return (
<span style={statuStyle.success}>已完成签约</span>
<span style={statuStyle.success}>{text}</span>
)
}
}]
const fetchOptions = (service) => {
return async function () {
const res = await service();
if (res.code === 1000) {
return res.data.map((item) => { return { label: item.name, value: item.status } })
}
return [];
}
}
// 列表数据
const fetchData = (params?: any) => {
params.status = params.status ? params.status : 0;
params.startTime = params.startTime ? moment().format('YYYY-MM-DD') : '';
params.endTime = params.endTime ? moment().format('YYYY-MM-DD') : '';
params.outerStatus = params.outerStatus ? params.outerStatus : 0
console.log(params)//可以直接打印参数
return new Promise((resolve, reject) => {
let data = {
totalCount: 1,
data: [
{
id: '1',
No: 'ZPTY12',
name: '进口头层黄牛皮荔枝纹',
number: 'ZPTY12',
memberName: '温州龙昌手袋有限公司',
time: '2020-12-25 09:00',
Price: '¥50,000.00',
status: 1,
insidestatus: 1,
addText: '创建采购招标合同',
state: '',
},
{
id: '2',
No: 'ZPTY12',
name: '进口头层黄牛皮荔枝纹',
number: 'ZPTY12',
memberName: '温州龙昌手袋有限公司',
time: '2020-12-25 09:00',
Price: '¥50,000.00',
status: 1,
insidestatus: 1,
addText: '创建采购招标合同',
state: '',
}
]
}
resolve(data)
PublicApi.getContractExecutePageListByPartyA({
...params,
}).then(res => {
resolve(res.data)
})
})
}
return (
......@@ -133,9 +164,13 @@ const contractexecutionList = () => {
useStateFilterSearchLinkageEffect(
$,
actions,
'orderNo',
'contractNo',
FORM_FILTER_PATH,
);
useAsyncSelect(
"outerStatus",
fetchOptions(PublicApi.getContractExecuteGetOuterStatusList)
)
},
components: {
DateRangePickerUnix,
......
......@@ -8,12 +8,12 @@ import { OrderTypeMap, PurchaseOrderInsideWorkStateTexts, PurchaseOrderOutWorkSt
export const tableListSchema: ISchema = {
type: 'object',
properties: {
orderNo: {
contractNo: {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入订单编号',
align: 'flex-end',
placeholder: '请输入合同编号',
align: 'start',
},
},
[FORM_FILTER_PATH]: {
......@@ -26,54 +26,26 @@ export const tableListSchema: ISchema = {
}
},
properties: {
orderThe: {
contractAbstract: {
type: 'string',
'x-component-props': {
placeholder: '请输入订单摘要',
placeholder: '请输入合同摘要',
}
},
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
}
},
"type": {
type: 'string',
"x-component-props": {
placeholder: '请选择订单类型'
},
enum: Object.keys(OrderTypeMap).map(item => ({
label: OrderTypeMap[item],
value: item,
}))
},
// "externalState": {
// type: 'string',
// "x-component-props": {
// placeholder: '请选择外部状态'
// },
// enum: Object.keys(PurchaseOrderOutWorkStateTexts).map(item => ({
// label: PurchaseOrderOutWorkStateTexts[item],
// value: item,
// }))
// },
// "interiorState": {
// type: 'string',
// "x-component-props": {
// placeholder: '请选择内部状态'
// },
// enum: Object.keys(PurchaseOrderInsideWorkStateTexts).map(item => ({
// label: PurchaseOrderInsideWorkStateTexts[item],
// value: item,
// }))
// },
"[startCreateTime,endCreateTime]": {
"[startTime,endTime]": {
type: 'array',
"x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
placeholder: ['开始时间', '结束时间'],
},
},
outerStatus: {
type: 'string',
enum: [],
"x-component-props": {
placeholder: '请选择外部状态'
},
title: '请选择外部状态',
},
submit: {
'x-component': 'Submit',
......
......@@ -99,7 +99,7 @@ const Sign = () => {
</div>
},
{
title: '外部状态',
title: '外部状态1',
dataIndex: 'outerStatusName',
align: 'center',
render: (text) => {
......@@ -171,12 +171,9 @@ const Sign = () => {
);
useAsyncSelect(
"outerStatus",
fetchOptions(PublicApi.getContractCoordinationGetOuterStatusList)
)
useAsyncSelect(
"innerStatus",
fetchOptions(PublicApi.getContractCoordinationGetInnerStatusList)
fetchOptions(PublicApi.getContractExecuteGetOuterStatusList)
)
},
components: {
DateRangePickerUnix,
......
......@@ -6,7 +6,7 @@ import { OrderTypeMap, PurchaseOrderInsideWorkStateTexts, PurchaseOrderOutWorkSt
* 请款
*/
export const CoordinationSchema: any = {
export const CoordinationSchema: ISchema = {
type: 'object',
properties: {
contractNo: {
......@@ -27,16 +27,10 @@ export const CoordinationSchema: any = {
}
},
properties: {
"contractAbstract": {
contractAbstract: {
type: 'string',
"x-component-props": {
placeholder: '请输入合同摘要'
}
},
"partyAName": {
type: 'string',
"x-component-props": {
placeholder: '请输入合同甲方'
'x-component-props': {
placeholder: '请输入合同摘要',
}
},
"[startTime,endTime]": {
......@@ -44,12 +38,8 @@ export const CoordinationSchema: any = {
"x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间', '结束时间'],
disabledDate: current => {
// return current && current < moment().startOf('day')
}
},
},
outerStatus: {
type: 'string',
enum: [],
......@@ -58,14 +48,6 @@ export const CoordinationSchema: any = {
},
title: '请选择外部状态',
},
innerStatus: {
type: 'string',
enum: [],
"x-component-props": {
placeholder: '请选择内部状态'
},
title: '请选择外部状态',
},
submit: {
'x-component': 'Submit',
'x-component-props': {
......
......@@ -17,11 +17,14 @@ const { TabPane } = Tabs;
const Add: React.FC<{}> = () => {
const currentBasic = useRef<any>({});
const [basic, setbasic] = useState<any>({});
const [flag, setflag] = useState<any>(false)
const [flag, setflag] = useState<any>(false);
const [id, setid] = useState('');
/* 判断是不是手工单 */
const getflag = (flag) => {
setflag(flag)
const getflag = (data) => {
setflag(data.flag)
setid(data.selectRow.id)
console.log(data)
}
const TabList = [
{
......@@ -31,7 +34,7 @@ const Add: React.FC<{}> = () => {
getcontractId={getflag}
/>
},
{ name: '采购物料', components: <InfoTable flag={flag} /> },
{ name: '请款明细', components: <InfoTable flag={flag} id={id} /> },
]
const submit = async () => {
const basicsVO = await currentBasic.current.get();
......
......@@ -92,6 +92,10 @@ const AddInfo = (props: any) => {
title: '合同剩余金额',
dataIndex: 'totalAmount',
align: 'center',
render: (text) =>
<div>
<p>{text}</p>
</div>
},
{
title: '对应单据/寻源类型',
......@@ -136,7 +140,7 @@ const AddInfo = (props: any) => {
// basicsData.applyAmount = res.data.payPlanList[0].applyAmount;
setpayPlanList(res.data.payPlanList)
setInfo(info)
getcontractId(true)
getcontractId({ flag: true, selectRow })
const auth = JSON.parse(localStorage.getItem('auth'));
setaccount(auth.account);
setBasics(basicsData)
......@@ -388,6 +392,7 @@ const AddInfo = (props: any) => {
tableProps={{
rowKey: 'id',
}}
rowKey="id"
columns={columnsList}
currentRef={refs}
rowSelection={rowSelection}
......
......@@ -18,7 +18,7 @@ import { PublicApi } from '@/services/api';
const { Text } = Typography;
const table = (props: any) => {
const { flag } = props;
const { flag, id } = props;
const refs = useRef({});
const [visible, setvisible] = useState<boolean>(false);
const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'id', type: 'radio' });
......@@ -105,9 +105,9 @@ const table = (props: any) => {
* @function fetchData 请求表格数据
**/
const fetchData = (params: any) => {
params.applyId = 0;
params.contractId = id;
return new Promise(resolve => {
PublicApi.getContractApplyAmountPageDetailList({ ...params }).then(res => {
PublicApi.getContractApplyAmountContractOrderPageList({ ...params }).then(res => {
console.log(res)
// resolve(res.data)
})
......
......@@ -12,7 +12,7 @@ import { PlusOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api'
const formActions = createFormActions();
import moment from 'moment';
;
const Addbilldetails: React.FC<{}> = () => {
const ref = useRef<any>({});
......
import React, { useState, useRef, ReactNode } from 'react'
import { history, Link } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Anchor, Radio, Steps, Row, Col, Input, message, Modal, Card } from 'antd';
import statuStyle from '../../common/colorTag'
import { ColumnType } from 'antd/lib/table/interface';
import { StandardTable } from 'god';
import { SchemaBli } from '../schema';
import EyePreview from '@/components/EyePreview';
import { PublicApi } from '@/services/api'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit'
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import moment from 'moment';
const { TextArea } = Input;
const Levelpayment: React.FC<{}> = () => {
const ref = useRef<any>({});
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
const [id, setId] = useState('');
const [isModalVisible, setIsModalVisible] = useState(false);
const today = moment(); // 当天日期
const [isAllMember, setIsAllMember] = useState(true)
const [reason, setDatareason] = useState('')
;
//表头
const columns: ColumnType<any>[] = [{
title: '请款单号/摘要',
dataIndex: 'applyNo',
align: 'center',
render: (text: any, record: any) => {
return (
<div>
<EyePreview
type="button"
>
{text}
</EyePreview>
<p>{record.applyAbstract}</p>
</div>
);
},
}, {
title: '单据时间',
align: 'center',
dataIndex: 'orderTime',
}, {
title: '收款方',
align: 'center',
dataIndex: 'payeeMemberName',
},
{
title: '合同编号',
align: 'center',
dataIndex: 'contractNo',
render: (text: any, record: any) => <EyePreview
type="button"
>
{text}
</EyePreview>
},
{
title: '合同总金额',
align: 'center',
dataIndex: 'contractAmount',
render: (text: any, record: any) =>
<span>{text}</span>
},
{
title: '请款金额',
dataIndex: 'applyAmount',
align: 'center',
render: (text: any, record: any) =>
<span>{text}</span>
},
{
title: '内部状态',
dataIndex: 'statusName',
align: 'center',
render: (text: any, record: any) => {
let component: ReactNode = null
component = (
<>
<span style={statuStyle.success}>已完成签约</span>
</>
)
return component
}
}, {
title: '操作',
dataIndex: 'action',
align: 'center',
render: (text: any, record: any) => {
// 作废:待付款、已付款、待提交审核状态的不能作废
return (
<>
{
record.status != 9 || record.status != 7 || record.status != 8 || record.status != 1 && <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => invalid(record.id)}>作废</span>
}
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/bill/details?applyId=${record.id}&type=1`)}>查看</span>
</>
)
}
}]
const handleIsAllMemberChange = (v: any) => {
setIsAllMember(v.target.value)
}
const invalid = (id) => {
setId(id)
setIsModalVisible(!isModalVisible)
}
// 模拟请求
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
params.status = params.status ? params.status : 0;
params.startTime = params.startTime ? moment().format('YYYY-MM-DD') : '';
params.endTime = params.endTime ? moment().format('YYYY-MM-DD') : '';
return new Promise((resolve, reject) => {
PublicApi.getContractApplyAmountPageList({
...params,
}).then(res => {
resolve(res.data)
})
})
}
const fetchOptions = (service) => {
return async function () {
const res = await service();
if (res.code === 1000) {
return res.data.map((item) => { return { label: item.name, value: item.status } })
}
return [];
}
}
const rowSelection: any = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectedRowKeys(selectedRowKeys)
setSelectRow(selectedRows)
}
};
/* 作废 */
const oninvalid = () => {
let res_data: any = {
applyId: id,
reason,
}
if (isAllMember) {
const msg = message.loading({
content: '正在操作',
duration: 0,
});
PublicApi.postContractApplyAmountInvalid(res_data).then(res => {
if (res.code === 1000) {
handleCancel()
ref.current.reload();
}
}).finally(() => {
msg();
})
} else {
handleCancel()
}
}
const setreason = (e) => {
setDatareason(e.target.value);
}
const handleCancel = () => {
setIsModalVisible(!isModalVisible);
};
return (
<PageHeaderWrapper>
<Card>
<StandardTable
tableProps={{
rowKey: 'id',
}}
columns={columns}
currentRef={ref}
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchData(params)}
formilyProps={{
ctx: {
inline: false,
schema: SchemaBli,
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'applyNo',
FORM_FILTER_PATH,
);
useAsyncSelect(
"status",
fetchOptions(PublicApi.getContractApplyAmountGetStatusList)
)
},
components: {
DateRangePickerUnix,
Submit,
SearchSelect
}
}
}}
/>
</Card>
<Modal title="单据作废" visible={isModalVisible} onCancel={handleCancel} onOk={oninvalid}>
<Radio.Group onChange={handleIsAllMemberChange} defaultValue={isAllMember} value={isAllMember}>
<Radio value={true}>作废</Radio>
<Radio value={false}>不作废</Radio>
</Radio.Group>
<p style={{ padding: 10, margin: 0 }}>单据作废原因 <span style={{ color: 'red' }}>*</span></p>
<TextArea placeholder="在此输入你的原因,最多60个汉字" maxLength={120} onChange={(e) => setreason(e)} />
</Modal>
</PageHeaderWrapper>
)
}
export default Levelpayment
import React, { useState, useRef, ReactNode } from 'react'
import { history, Link } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Anchor, Radio, Steps, Row, Col, Input, message, Modal, Card } from 'antd';
import statuStyle from '../../common/colorTag'
import { ColumnType } from 'antd/lib/table/interface';
import { StandardTable } from 'god';
import { SchemaBli } from '../schema';
import EyePreview from '@/components/EyePreview';
import { PublicApi } from '@/services/api'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit'
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import moment from 'moment';
const { TextArea } = Input;
const Secondpayment: React.FC<{}> = () => {
const ref = useRef<any>({});
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
const [id, setId] = useState('');
const [isModalVisible, setIsModalVisible] = useState(false);
const today = moment(); // 当天日期
const [isAllMember, setIsAllMember] = useState(true)
const [reason, setDatareason] = useState('')
;
//表头
const columns: ColumnType<any>[] = [{
title: '请款单号/摘要',
dataIndex: 'applyNo',
align: 'center',
render: (text: any, record: any) => {
return (
<div>
<EyePreview
type="button"
>
{text}
</EyePreview>
<p>{record.applyAbstract}</p>
</div>
);
},
}, {
title: '单据时间',
align: 'center',
dataIndex: 'orderTime',
}, {
title: '收款方',
align: 'center',
dataIndex: 'payeeMemberName',
},
{
title: '合同编号',
align: 'center',
dataIndex: 'contractNo',
render: (text: any, record: any) => <EyePreview
type="button"
>
{text}
</EyePreview>
},
{
title: '合同总金额',
align: 'center',
dataIndex: 'contractAmount',
render: (text: any, record: any) =>
<span>{text}</span>
},
{
title: '请款金额',
dataIndex: 'applyAmount',
align: 'center',
render: (text: any, record: any) =>
<span>{text}</span>
},
{
title: '内部状态',
dataIndex: 'statusName',
align: 'center',
render: (text: any, record: any) => {
let component: ReactNode = null
component = (
<>
<span style={statuStyle.success}>已完成签约</span>
</>
)
return component
}
}, {
title: '操作',
dataIndex: 'action',
align: 'center',
render: (text: any, record: any) => {
// 作废:待付款、已付款、待提交审核状态的不能作废
return (
<>
{
record.status != 9 || record.status != 7 || record.status != 8 || record.status != 1 && <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => invalid(record.id)}>作废</span>
}
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/bill/details?applyId=${record.id}&type=1`)}>查看</span>
</>
)
}
}]
const handleIsAllMemberChange = (v: any) => {
setIsAllMember(v.target.value)
}
const invalid = (id) => {
setId(id)
setIsModalVisible(!isModalVisible)
}
// 模拟请求
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
params.status = params.status ? params.status : 0;
params.startTime = params.startTime ? moment().format('YYYY-MM-DD') : '';
params.endTime = params.endTime ? moment().format('YYYY-MM-DD') : '';
return new Promise((resolve, reject) => {
PublicApi.getContractApplyAmountPageList({
...params,
}).then(res => {
resolve(res.data)
})
})
}
const fetchOptions = (service) => {
return async function () {
const res = await service();
if (res.code === 1000) {
return res.data.map((item) => { return { label: item.name, value: item.status } })
}
return [];
}
}
const rowSelection: any = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectedRowKeys(selectedRowKeys)
setSelectRow(selectedRows)
}
};
/* 作废 */
const oninvalid = () => {
let res_data: any = {
applyId: id,
reason,
}
if (isAllMember) {
const msg = message.loading({
content: '正在操作',
duration: 0,
});
PublicApi.postContractApplyAmountInvalid(res_data).then(res => {
if (res.code === 1000) {
handleCancel()
ref.current.reload();
}
}).finally(() => {
msg();
})
} else {
handleCancel()
}
}
const setreason = (e) => {
setDatareason(e.target.value);
}
const handleCancel = () => {
setIsModalVisible(!isModalVisible);
};
return (
<PageHeaderWrapper>
<Card>
<StandardTable
tableProps={{
rowKey: 'id',
}}
columns={columns}
currentRef={ref}
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchData(params)}
formilyProps={{
ctx: {
inline: false,
schema: SchemaBli,
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'applyNo',
FORM_FILTER_PATH,
);
useAsyncSelect(
"status",
fetchOptions(PublicApi.getContractApplyAmountGetStatusList)
)
},
components: {
DateRangePickerUnix,
Submit,
SearchSelect
}
}
}}
/>
</Card>
<Modal title="单据作废" visible={isModalVisible} onCancel={handleCancel} onOk={oninvalid}>
<Radio.Group onChange={handleIsAllMemberChange} defaultValue={isAllMember} value={isAllMember}>
<Radio value={true}>作废</Radio>
<Radio value={false}>不作废</Radio>
</Radio.Group>
<p style={{ padding: 10, margin: 0 }}>单据作废原因 <span style={{ color: 'red' }}>*</span></p>
<TextArea placeholder="在此输入你的原因,最多60个汉字" maxLength={120} onChange={(e) => setreason(e)} />
</Modal>
</PageHeaderWrapper>
)
}
export default Secondpayment
import React, { useState, useRef, ReactNode } from 'react'
import { history, Link } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Anchor, Radio, Steps, Row, Col, Input, message, Modal, Card } from 'antd';
import statuStyle from '../../common/colorTag'
import { ColumnType } from 'antd/lib/table/interface';
import { StandardTable } from 'god';
import { SchemaBli } from '../schema';
import EyePreview from '@/components/EyePreview';
import { PublicApi } from '@/services/api'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit'
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import moment from 'moment';
const { TextArea } = Input;
const Submitpayment: React.FC<{}> = () => {
const ref = useRef<any>({});
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
const [id, setId] = useState('');
const [isModalVisible, setIsModalVisible] = useState(false);
const today = moment(); // 当天日期
const [isAllMember, setIsAllMember] = useState(true)
const [reason, setDatareason] = useState('')
;
//表头
const columns: ColumnType<any>[] = [{
title: '请款单号/摘要',
dataIndex: 'applyNo',
align: 'center',
render: (text: any, record: any) => {
return (
<div>
<EyePreview
type="button"
>
{text}
</EyePreview>
<p>{record.applyAbstract}</p>
</div>
);
},
}, {
title: '单据时间',
align: 'center',
dataIndex: 'orderTime',
}, {
title: '收款方',
align: 'center',
dataIndex: 'payeeMemberName',
},
{
title: '合同编号',
align: 'center',
dataIndex: 'contractNo',
render: (text: any, record: any) => <EyePreview
type="button"
>
{text}
</EyePreview>
},
{
title: '合同总金额',
align: 'center',
dataIndex: 'contractAmount',
render: (text: any, record: any) =>
<span>{text}</span>
},
{
title: '请款金额',
dataIndex: 'applyAmount',
align: 'center',
render: (text: any, record: any) =>
<span>{text}</span>
},
{
title: '内部状态',
dataIndex: 'statusName',
align: 'center',
render: (text: any, record: any) => {
let component: ReactNode = null
component = (
<>
<span style={statuStyle.success}>已完成签约</span>
</>
)
return component
}
}, {
title: '操作',
dataIndex: 'action',
align: 'center',
render: (text: any, record: any) => {
// 作废:待付款、已付款、待提交审核状态的不能作废
return (
<>
{
record.status != 9 || record.status != 7 || record.status != 8 || record.status != 1 && <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => invalid(record.id)}>作废</span>
}
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/bill/details?applyId=${record.id}&type=1`)}>查看</span>
</>
)
}
}]
const handleIsAllMemberChange = (v: any) => {
setIsAllMember(v.target.value)
}
const invalid = (id) => {
setId(id)
setIsModalVisible(!isModalVisible)
}
// 模拟请求
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
params.status = params.status ? params.status : 0;
params.startTime = params.startTime ? moment().format('YYYY-MM-DD') : '';
params.endTime = params.endTime ? moment().format('YYYY-MM-DD') : '';
return new Promise((resolve, reject) => {
PublicApi.getContractApplyAmountPageList({
...params,
}).then(res => {
resolve(res.data)
})
})
}
const fetchOptions = (service) => {
return async function () {
const res = await service();
if (res.code === 1000) {
return res.data.map((item) => { return { label: item.name, value: item.status } })
}
return [];
}
}
const rowSelection: any = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectedRowKeys(selectedRowKeys)
setSelectRow(selectedRows)
}
};
/* 作废 */
const oninvalid = () => {
let res_data: any = {
applyId: id,
reason,
}
if (isAllMember) {
const msg = message.loading({
content: '正在操作',
duration: 0,
});
PublicApi.postContractApplyAmountInvalid(res_data).then(res => {
if (res.code === 1000) {
handleCancel()
ref.current.reload();
}
}).finally(() => {
msg();
})
} else {
handleCancel()
}
}
const setreason = (e) => {
setDatareason(e.target.value);
}
const handleCancel = () => {
setIsModalVisible(!isModalVisible);
};
return (
<PageHeaderWrapper>
<Card>
<StandardTable
tableProps={{
rowKey: 'id',
}}
columns={columns}
currentRef={ref}
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchData(params)}
formilyProps={{
ctx: {
inline: false,
schema: SchemaBli,
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'applyNo',
FORM_FILTER_PATH,
);
useAsyncSelect(
"status",
fetchOptions(PublicApi.getContractApplyAmountGetStatusList)
)
},
components: {
DateRangePickerUnix,
Submit,
SearchSelect
}
}
}}
/>
</Card>
<Modal title="单据作废" visible={isModalVisible} onCancel={handleCancel} onOk={oninvalid}>
<Radio.Group onChange={handleIsAllMemberChange} defaultValue={isAllMember} value={isAllMember}>
<Radio value={true}>作废</Radio>
<Radio value={false}>不作废</Radio>
</Radio.Group>
<p style={{ padding: 10, margin: 0 }}>单据作废原因 <span style={{ color: 'red' }}>*</span></p>
<TextArea placeholder="在此输入你的原因,最多60个汉字" maxLength={120} onChange={(e) => setreason(e)} />
</Modal>
</PageHeaderWrapper>
)
}
export default Submitpayment
......@@ -12,11 +12,18 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { PublicApi } from '@/services/api';
import { PlayCircleOutlined, PoweroffOutlined } from '@ant-design/icons'
import { history } from 'umi';
import moment from 'moment';
const QueryList = () => {
const ref = useRef<any>({});
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
const getdate = (time) => {
return new Date(Date.parse(time.replace(/-/g, "/"))).getTime() / 1000;
}
//表头
const columns: ColumnType<any>[] = [{
title: '合同编号/摘要',
......@@ -25,7 +32,7 @@ const QueryList = () => {
render: (text, record) =>
<div>
<EyePreview
type="button"
url={`/memberCenter/contract/manage/QueryList/QueryListdetails?contractId=${record.id}`}
>
{text}
</EyePreview>
......@@ -35,20 +42,29 @@ const QueryList = () => {
title: '合同生效/失效时间',
dataIndex: 'startTime',
align: 'center',
sorter: {
compare: (a, b) => getdate(a.startTime) - getdate(b.startTime),
multiple: 1,
},
render: (text, record) =>
<div>
<p>{text}</p>
<p>{record.endTime}</p>
<p><PlayCircleOutlined /> &nbsp;{text}</p>
<p><PoweroffOutlined /> &nbsp;{record.endTime}</p>
</div>
}, {
title: '合同乙方',
dataIndex: 'partyBName',
align: 'center',
},
{
title: '合同总金额',
dataIndex: 'totalAmount',
align: 'center',
sorter: {
compare: (a, b) => a.totalAmount - b.totalAmount,
multiple: 1,
},
render: (text) =>
<div>
<p>{text}</p>
......@@ -67,7 +83,8 @@ const QueryList = () => {
return (
<div>
<EyePreview
url={`/memberCenter/contract/manage/QueryList/QueryListdetails`}
type={record.sourceId ? 'link' : 'button'}
url={`/memberCenter/procurementAbility/offter/view?id${record.sourceId}&number${record.sourceNo}`}
>
{text}
</EyePreview>
......@@ -102,7 +119,7 @@ const QueryList = () => {
}, {
title: '操作',
dataIndex: 'state',
align: 'center',
align: 'left',
render: (text, record) => {
return (
<div>
......@@ -110,15 +127,29 @@ const QueryList = () => {
record.outerStatus != 7 ? <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => invalid(record.id)}>作废</span> : <span> </span>
}
{
record.outerStatus == 6 ? <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }}>合同变更</span> : <span> </span>
record.outerStatus == 6 ? <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => like(record)}>合同变更</span> : <span> </span>
}
{/* 已完成签约 */}
{/* url={} */}
<span style={{ color: '#00B37A', cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/manage/QueryList/QueryListdetails?contractId=${record.id}`)}>查看</span>
</div>
)
}
}]
const rowSelection: any = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectedRowKeys(selectedRowKeys)
setSelectRow(selectedRows)
}
};
const like = (record) => {
record.sourceId = record.demandId;
record.sourceNo = record.sourceNo;
record.totalAmount = record.totalAmount;
record.partyBMemberId = record.awardMemberId;
record.partyBRoleId = record.awardRoleId;
record.partyBName = record.awardName;
sessionStorage.setItem('record', JSON.stringify(record));
history.push(`/memberCenter/contract/manage/add/addList/contracAdd?contractId=${record.id}&sourceType=1`)
};
const [form] = Form.useForm();
const [id, setId] = useState('');
const [isModalVisible, setIsModalVisible] = useState(false);
......@@ -174,6 +205,7 @@ const QueryList = () => {
rowKey: 'id',
}}
columns={columns}
rowSelection={rowSelection}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
formilyProps={{
......
......@@ -15,10 +15,14 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { PublicApi } from '@/services/api';
import { PlusCircleOutlined } from '@ant-design/icons'
import { PlusCircleOutlined, PlayCircleOutlined, PoweroffOutlined } from '@ant-design/icons'
import moment from 'moment';
const addList = () => {
const ref = useRef<any>({});
const getdate = (time) => {
return new Date(Date.parse(time.replace(/-/g, "/"))).getTime() / 1000;
}
//表头
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
......@@ -40,13 +44,13 @@ const addList = () => {
dataIndex: 'startTime',
align: 'center',
sorter: {
compare: (a, b) => a.demandPublishTime - b.demandPublishTime,
compare: (a, b) => getdate(a.startTime) - getdate(b.startTime),
multiple: 1,
},
render: (text, record) =>
<div>
<p>{text}</p>
<p>{record.endTime}</p>
<p><PlayCircleOutlined /> &nbsp;{text}</p>
<p><PoweroffOutlined /> &nbsp;{record.endTime}</p>
</div>
}, {
title: '合同乙方',
......@@ -58,7 +62,7 @@ const addList = () => {
dataIndex: 'totalAmount',
align: 'center',
sorter: {
compare: (a, b) => a.demandPublishTime - b.demandPublishTime,
compare: (a, b) => a.totalAmount - b.totalAmount,
multiple: 1,
},
render: (text) =>
......@@ -70,11 +74,6 @@ const addList = () => {
title: '对应单据/寻源类型',
dataIndex: 'sourceNo',
align: 'center',
filters: [
{ text: '采购询价', value: 1 },
{ text: '采购招标', value: 2 },
{ text: '采购竞价', value: 3 },
],
render: (text, record) => {
let sourceTypeList = [
"",
......@@ -98,10 +97,10 @@ const addList = () => {
title: '外部状态',
dataIndex: 'outerStatus',
align: 'center',
filters: [
{ text: 'Joe', value: 'Joe' },
{ text: 'Jim', value: 'Jim' },
],
// filters: [
// { text: 'Joe', value: 'Joe' },
// { text: 'Jim', value: 'Jim' },
// ],
render: (text, record) => {
return (
<StatusTag type="warning" title={record.outerStatusName} />
......@@ -112,10 +111,10 @@ const addList = () => {
title: '内部状态',
dataIndex: 'innerStatus',
align: 'center',
filters: [
{ text: 'Joe', value: 'Joe' },
{ text: 'Jim', value: 'Jim' },
],
// filters: [
// { text: 'Joe', value: 'Joe' },
// { text: 'Jim', value: 'Jim' },
// ],
render: (text, record) => {
return (
......@@ -144,7 +143,6 @@ const addList = () => {
record.innerStatus == '1' ? <span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }}>删除</span> : ''
}
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => submit(record.id)}>提交</span>
<span style={{ color: '#00B37A', cursor: 'pointer' }}>修改</span>
</div >
)
}
......@@ -166,6 +164,8 @@ const addList = () => {
// 列表数据
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
params.startTime = params.startTime ? moment().format('YYYY-MM-DD') : '';
params.endTime = params.endTime ? moment().format('YYYY-MM-DD') : '';
return new Promise((resolve, reject) => {
PublicApi.getContractManagePageToBeAdd({
...params,
......
......@@ -232,6 +232,11 @@ const FormList = (props: any) => {
price: item.taxUnitPrice,
bidCount: item.awardCount,
bidAmount: item.awardPrice,
associatedDataId: item.productId,
associatedMaterielNo: item.number,
associatedMaterielName: item.name,
associatedGoods: item.productName
}
})
setData(data)
......@@ -265,8 +270,10 @@ const FormList = (props: any) => {
price: Number(item.price),
bidCount: item.bidCount,
bidAmount: item.bidCount && item.price ? Number(item.bidCount) * Number(item.price) : '',
associatedMaterielNo: item.id ? item.id : '',
associatedMaterielName: item.name ? item.name : '',
associatedMaterielName: item.associatedMaterielName ? item.associatedMaterielName : '',
associatedGoods: item.associatedGoods ? item.associatedGoods : '',
associatedDataId: item.associatedDataId ? item.associatedDataId : '',
associatedMaterielNo: item.associatedMaterielNo ? item.associatedMaterielNo : '',
associatedType: item.type ? item.type : '',
associatedCategory: item.customerCategory != null ? item.customerCategory.name : '',
associatedBrand: item.brand != null ? item.brand.name : '',
......@@ -292,8 +299,8 @@ const FormList = (props: any) => {
<p>报价商品</p>
</div>
<div className={styles.text}>
<p>商品ID:{record.customerCategory.id}</p>
<p>商品名称:{record.name}</p>
<p>商品ID:{record.associatedDataId}</p>
<p>商品名称:{record.associatedMaterielName}</p>
</div>
<div className={styles.text}>
<p>规格:{record.type}</p>
......
......@@ -92,7 +92,7 @@ const Information = (props: any) => {
/* 获取传入组建的值 */
useEffect(() => {
basicsVO.contractNo = basicsVO.contractNo ? basicsVO.contractNo : '';
basicsVO.sourceType = Row.sourceType ? Row.sourceType : '1';
basicsVO.sourceType = Row.sourceType ? Row.sourceType + '' : '1';
basicsVO.contractId = Row.contractId ? Row.contractId : 0;
basicsVO.partyBName = Row.partyBName ? Row.partyBName : '';
basicsVO.sourceNo = Row.sourceNo ? Row.sourceNo : '';
......
.anchorWrap :global .ant-anchor {
display: flex;
align-items: center;
}
.anchorWrap :global .ant-anchor .ant-anchor-ink {
display: none;
......
......@@ -2,6 +2,7 @@
:global {
.ant-anchor {
display: flex;
align-items: center;
.ant-anchor-ink {
display: none;
}
......
import React, { useEffect, useState, useRef } from 'react';
import { Anchor, Radio, Steps, Row, Col, Table, Space, Typography } from 'antd';
import { Anchor, Radio, Steps, Row, Col, Form, Input, Table, message, Space, Typography, Button, Modal } from 'antd';
import style from './index.less';
import { ArrowLeftOutlined } from '@ant-design/icons';
import { StandardTable } from 'god';
......@@ -12,6 +12,7 @@ import {
FileWordFilled
} from '@ant-design/icons'
const { TextArea } = Input;
const { Link } = Anchor;
const { Step } = Steps;
......@@ -20,9 +21,11 @@ const activeAnchorClassName = 'ant-anchor-link-active'
const Details = (props: any) => {
/* 合同id */
const { location: { query: { contractId } } } = props;
const { location: { query: { contractId, type } } } = props;
const ref = useRef({});
const [currLink, setCurrLink] = useState(activeAnchorClassName)
const [form] = Form.useForm();
const [isPass, setIsAllMember] = useState()
/**
* 渲染信息
* @param basics 基础信息
......@@ -47,7 +50,8 @@ const Details = (props: any) => {
const [outerTaskStepList, setouterTaskStepList] = useState<any>([])
const [innerTaskStepList, setinnerTaskStepList] = useState<any>([]);
const [currentBatch, setCurrentBatch] = useState('1');
const [listIndex, setlistIndex] = useState('1');;
const [listIndex, setlistIndex] = useState('1');
const [Visible, setIsModalVisible] = useState<boolean>(false)
const [ListData, setListData] = useState<any>([])
const [payPlanList, setpayPlanList] = useState<any>([])
const [contractText, setcontractText] = useState<any>([])
......@@ -99,6 +103,9 @@ const Details = (props: any) => {
}
})
}
const onDownload = (file: any) => {
window.location.href = `/api/contract/contractTemplate/downloadContract?contractName=${file.contractName}&contractUrl=${file.contractUrl}`
}
/**
* 流转进度点击
*/
......@@ -244,7 +251,37 @@ const Details = (props: any) => {
{ title: '操作时间', dataIndex: 'operateTime', align: 'center', },
{ title: '审核意见', dataIndex: 'opinion', align: 'center', },
]
/* 提交 */
const onFinish = (values: any) => {
let fn;
switch (type) {
case 'examine':
fn = PublicApi.postContractManageSubmitExamine
break;
}
values.contractId = contractId;
const msg = message.loading({
content: '正在操作',
duration: 0,
});
console.log('Success:', values);
fn(values).then(res => {
console.log(res);
if (res.code === 1000) {
history.goBack()
setIsModalVisible(!Visible)
}
}).finally(() => {
msg();
});
};
/* 选中的值 */
const handleIsAllMemberChange = (v: any) => {
setIsAllMember(v.target.value)
}
const onFinishFailed = (errorInfo: any) => {
console.log('Failed:', errorInfo);
};
return (
<div className={style.anchorWrap}>
<Anchor
......@@ -261,8 +298,10 @@ const Details = (props: any) => {
}}
>
<ArrowLeftOutlined
onClick={() => history.goBack()}
style={{
fontSize: '14px',
cursor: 'pointer',
color: '#909399',
}}
/>
......@@ -272,6 +311,7 @@ const Details = (props: any) => {
color: '#303133',
fontWeight: 500,
marginLeft: '8px',
}}
>
{contractAbstract}
......@@ -286,6 +326,12 @@ const Details = (props: any) => {
</div>
</div>
<div>
{
type && <Button type="primary" style={{ width: 80, marginRight: 16 }} onClick={() => setIsModalVisible(!Visible)}>审核 </Button>
}
</div>
</Anchor>
<div id='content' className={style.card}>
{/* 流转进度 */}
......@@ -447,7 +493,7 @@ const Details = (props: any) => {
<div className='ant-card-head-wrapper'>
电子合同
</div>
<div className={style.upload_left} style={{ width: 600 }}>
<div className={style.upload_left} onClick={() => onDownload(contractText)} style={{ width: 600, cursor: 'pointer' }}>
<FileWordFilled />
<span>{contractText.contractName}.pdf</span>
</div>
......@@ -481,6 +527,32 @@ const Details = (props: any) => {
</div>
</div>
</div>
<Modal footer={null} title="提交审核" visible={Visible} onOk={() => setIsModalVisible(!Visible)} onCancel={() => setIsModalVisible(!Visible)}>
<Form
name="basic"
form={form}
initialValues={{ remember: true }}
onFinish={onFinish}
onFinishFailed={onFinishFailed}
>
<Form.Item name="isPass" label="" rules={[{ required: true, message: '请选择作废日期' }]} initialValue={isPass} >
<Radio.Group onChange={handleIsAllMemberChange}>
<Radio value={1}>通过</Radio>
<Radio value={0}>不通过</Radio>
</Radio.Group>
</Form.Item>
<Form.Item label={isPass ? '审核通过原因' : '审不核通过原因'} rules={[{ required: true, message: '请选择作废日期' }]}>
</Form.Item>
<Form.Item label='' name="opinion" rules={[{ required: true, message: '审核通过意见' }]}>
<TextArea placeholder="在此输入你的原因,最多60个汉字" maxLength={120} />
</Form.Item>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<Button onClick={() => setIsModalVisible(!Visible)} style={{ marginRight: 10 }}>取消</Button>
<Button type="primary" htmlType="submit">保存</Button>
</div>
</Form>
</Modal>
</div>
)
}
......
......@@ -14,6 +14,7 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { PublicApi } from '@/services/api';
import { PlayCircleOutlined, PoweroffOutlined } from '@ant-design/icons'
const { TextArea } = Input;
const Examine = () => {
const ref = useRef<any>({});
......@@ -23,6 +24,9 @@ const Examine = () => {
const [isPass, setIsAllMember] = useState()
const [form] = Form.useForm();
const [id, setid] = useState("")
const getdate = (time) => {
return new Date(Date.parse(time.replace(/-/g, "/"))).getTime() / 1000;
}
//表头
const columns: ColumnType<any>[] = [{
title: '合同编号/摘要',
......@@ -31,7 +35,7 @@ const Examine = () => {
render: (text, record) =>
<div>
<EyePreview
type="button"
url={`/memberCenter/contract/manage/examine/details?contractId=${record.id}&type=examine`}
>
{text}
</EyePreview>
......@@ -42,13 +46,13 @@ const Examine = () => {
dataIndex: 'startTime',
align: 'center',
sorter: {
compare: (a, b) => a.demandPublishTime - b.demandPublishTime,
compare: (a, b) => getdate(a.startTime) - getdate(b.startTime),
multiple: 1,
},
render: (text, record) =>
<div>
<p>{text}</p>
<p>{record.endTime}</p>
<p><PlayCircleOutlined /> &nbsp;{text}</p>
<p><PoweroffOutlined /> &nbsp;{record.endTime}</p>
</div>
}, {
title: '合同乙方',
......@@ -60,7 +64,7 @@ const Examine = () => {
dataIndex: 'totalAmount',
align: 'center',
sorter: {
compare: (a, b) => a.demandPublishTime - b.demandPublishTime,
compare: (a, b) => a.totalAmount - b.totalAmount,
multiple: 1,
},
render: (text) =>
......@@ -72,11 +76,6 @@ const Examine = () => {
title: '对应单据/寻源类型',
dataIndex: 'sourceNo',
align: 'center',
filters: [
{ text: '采购询价', value: 1 },
{ text: '采购招标', value: 2 },
{ text: '采购竞价', value: 3 },
],
render: (text, record) => {
let sourceTypeList = [
"",
......@@ -86,7 +85,8 @@ const Examine = () => {
return (
<div>
<EyePreview
type="button"
type={record.sourceId ? 'link' : 'button'}
url={`/memberCenter/procurementAbility/offter/view?id${record.sourceId}&number${record.sourceNo}`}
>
{text}
</EyePreview>
......@@ -100,10 +100,6 @@ const Examine = () => {
title: '外部状态',
dataIndex: 'outerStatus',
align: 'center',
filters: [
{ text: 'Joe', value: 'Joe' },
{ text: 'Jim', value: 'Jim' },
],
render: (text, record) => {
return (
<StatusTag type="warning" title={record.outerStatusName} />
......@@ -114,12 +110,7 @@ const Examine = () => {
title: '内部状态',
dataIndex: 'innerStatus',
align: 'center',
filters: [
{ text: 'Joe', value: 'Joe' },
{ text: 'Jim', value: 'Jim' },
],
render: (text, record) => {
return (
<div>
<span style={statuStyle.point}> </span>
......@@ -134,10 +125,8 @@ const Examine = () => {
render: (text, record) => {
return (
<div>
{/* /memberCenter/contract/manage/examine/details */}
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => submitExamine(record.id)}>提交审核</span>
<span style={{ color: '#00B37A', cursor: 'pointer' }}>查看</span>
</div >
</div>
)
}
}]
......
......@@ -13,12 +13,15 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { PublicApi } from '@/services/api';
import { PlayCircleOutlined, PoweroffOutlined } from '@ant-design/icons'
const { TextArea } = Input;
const Levelexamine = () => {
const ref = useRef<any>({});
const getdate = (time) => {
return new Date(Date.parse(time.replace(/-/g, "/"))).getTime() / 1000;
}
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const [Visible, setIsModalVisible] = useState<boolean>(false)
const [id, setid] = useState("")
......@@ -33,7 +36,7 @@ const Levelexamine = () => {
render: (text, record) =>
<div>
<EyePreview
type="button"
url={`/memberCenter/contract/manage/levelexamine/details?contractId=${record.id}&type=levelexamine`}
>
{text}
</EyePreview>
......@@ -44,13 +47,13 @@ const Levelexamine = () => {
dataIndex: 'startTime',
align: 'center',
sorter: {
compare: (a, b) => a.demandPublishTime - b.demandPublishTime,
multiple: 1,
compare: (a, b) => getdate(a.startTime) - getdate(b.startTime),
multiple: 2,
},
render: (text, record) =>
<div>
<p>{text}</p>
<p>{record.endTime}</p>
<p><PlayCircleOutlined /> &nbsp;{text}</p>
<p><PoweroffOutlined /> &nbsp;{record.endTime}</p>
</div>
}, {
title: '合同乙方',
......@@ -62,7 +65,7 @@ const Levelexamine = () => {
dataIndex: 'totalAmount',
align: 'center',
sorter: {
compare: (a, b) => a.demandPublishTime - b.demandPublishTime,
compare: (a, b) => a.totalAmount - b.totalAmount,
multiple: 1,
},
render: (text) =>
......@@ -74,11 +77,6 @@ const Levelexamine = () => {
title: '对应单据/寻源类型',
dataIndex: 'sourceNo',
align: 'center',
filters: [
{ text: '采购询价', value: 1 },
{ text: '采购招标', value: 2 },
{ text: '采购竞价', value: 3 },
],
render: (text, record) => {
let sourceTypeList = [
"",
......@@ -102,10 +100,6 @@ const Levelexamine = () => {
title: '外部状态',
dataIndex: 'outerStatus',
align: 'center',
filters: [
{ text: 'Joe', value: 'Joe' },
{ text: 'Jim', value: 'Jim' },
],
render: (text, record) => {
return (
<StatusTag type="warning" title={record.outerStatusName} />
......@@ -116,10 +110,6 @@ const Levelexamine = () => {
title: '内部状态',
dataIndex: 'innerStatus',
align: 'center',
filters: [
{ text: 'Joe', value: 'Joe' },
{ text: 'Jim', value: 'Jim' },
],
render: (text, record) => {
return (
......@@ -136,8 +126,7 @@ const Levelexamine = () => {
render: (text, record) => {
return (
<div>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => submitExamine(record.id)}>提交审核</span>
<span style={{ color: '#00B37A', cursor: 'pointer', }}>查看</span>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => submitExamine(record.id)}>审核</span>
</div>
)
}
......
......@@ -37,7 +37,7 @@ const PurchaseList = () => {
dataIndex: 'demandPublishTime',
align: 'center',
sorter: {
compare: (a, b) => a.demandPublishTime - b.demandPublishTime,
compare: (a, b) => getdate(a.demandPublishTime) - getdate(b.demandPublishTime),
multiple: 1,
},
}, {
......@@ -50,7 +50,7 @@ const PurchaseList = () => {
dataIndex: 'awardTime',
align: 'center',
sorter: {
compare: (a, b) => a.awardTime - b.awardTime,
compare: (a, b) => getdate(a.awardTime) - getdate(b.awardTime),
multiple: 1,
},
},
......@@ -114,6 +114,9 @@ const PurchaseList = () => {
setSelectRow(selectedRows)
}
};
const getdate = (time) => {
return new Date(Date.parse(time.replace(/-/g, "/"))).getTime() / 1000;
}
const like = (record) => {
record.sourceId = record.demandId;
......
......@@ -385,7 +385,7 @@ export const addListSchema: ISchema = {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入订单编号',
placeholder: '请输入合同编号',
align: 'flex-end',
},
},
......
......@@ -250,7 +250,7 @@ const Signacontract = () => {
<Radio value={0}>不同意签订</Radio>
</Radio.Group>
</Form.Item>
<Form.Item label={isPass ? '不同意签订原因' : '同意签订原因'} rules={[{ required: true, message: '请选择作废日期' }]}>
<Form.Item label={isPass ? '同意签订原因' : '不同意签订原因'} rules={[{ required: true, message: '请选择作废日期' }]}>
</Form.Item>
<Form.Item label='' name="opinion" rules={[{ required: true, message: '审核通过意见' }]}>
......
......@@ -126,7 +126,8 @@ const AddContract: React.FC<parmas> = (props) => {
/**下载 */
const onDownload = (file: any) => {
window.location.href = `/api/order/contractTemplate/downloadContract?contractName=${file.contractName}&contractUrl=${file.contractUrl}`
// contract/contractTemplate/downloadContract
window.location.href = `/api/contract/contractTemplate/downloadContract?contractName=${file.contractName}&contractUrl=${file.contractUrl}`
}
/**预览 */
const onView = async (file: any) => {
......
......@@ -13,6 +13,7 @@ export interface Params {
dialogVisible: boolean;
onCancel: Function;
onOK?: Function;
taxRate?: any,
freightPrice?: any;
dontReceive?: boolean; //默认展示
}
......@@ -25,9 +26,9 @@ const comfirmDialog: React.FC<Params> = (props) => {
const handletOk = (values: any) => {
let value = { ...values }
value.id = props.id
if(props.freightPrice) {
value.freightPrice = props.freightPrice
}
value.freightPrice = props.freightPrice
value.taxRate = props.taxRate
value.taxInclusive = 1
PublicApi.postLogisticsOrderWaitConfirmConfirm(value).then(res => {
if (res.code === 1000) {
props.onOK()
......
import React, { useEffect, useState, ReactNode, useRef } from 'react';
import { Row, Col, Table, Input, Button, Tag, Badge, Steps, message } from 'antd'
import React, { useEffect, useState, ReactNode, useRef, Fragment } from 'react';
import { Row, Col, Table, Input, Button, Tag, Badge, Steps, message, Form, Checkbox } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { CheckSquareOutlined } from '@ant-design/icons'
import { ColumnType } from 'antd/lib/table/interface'
......@@ -11,9 +11,18 @@ import style from './index.less'
import statuStyle from '../colorTag'
const { Step } = Steps
const layout: any = {
colon: false,
labelCol: { style: { width: '150px' } },
wrapperCol: { style: { width: '500px' } },
labelAlign: "left"
}
const detailInfo: React.FC<{}> = () => {
const ref = useRef<any>({})
const [form] = Form.useForm();
const [freightPrice, setfreightPrice] = useState<any>(null);
const [ taxRate ,setTaxRate] = useState<any>(null);
let [isextraOption, setIsextraOption] = useState(false)
let [dataInfo, setdataInfo] = useState<any>({
status: '',
......@@ -74,8 +83,9 @@ const detailInfo: React.FC<{}> = () => {
freight: {
title: '运费',
leftElem: [
{ title: '是否含税:', key: 'taxRate', value: '' },
{ title: '运费:', key: 'freight', value: dataInfo.freightPrice || '' },
{ title: '结算方式:', key: '', value: dataInfo.settlementWay || '' }
{ title: '结算方式:', key: 'settlement', value: dataInfo.settlementWay || '' }
]
}
}
......@@ -245,11 +255,14 @@ const detailInfo: React.FC<{}> = () => {
setfreightPrice(value);
}
const handleAudit = () => {
if(freightPrice) {
setvisible(true)
} else {
message.error('请输入运费')
const handleAudit = async () => {
try {
const value = await form.validateFields();
setfreightPrice(value.freight);
setTaxRate(value.taxRate);
setvisible(true);
} catch {
message.error('请下拉到运费模块输入税率和运费!')
}
}
......@@ -419,35 +432,43 @@ const detailInfo: React.FC<{}> = () => {
{infoTem['freight'].leftElem.map(
(item: any, index: number) => {
return (
<div className={style['cols-main']} key={`freight${index + 1}`}>
<div className={style['cols-main-options']}>
{item.title}
</div>
{
item.key === 'freight' ?
<>
{type === 'option' ?
<div className={style['cols-main-options']}>
<Input
value={freightPrice}
addonBefore="¥"
onChange={inputOnchange}
type='number'
maxLength={25}
style={{ width: '300px' }}
/>
</div>
:
<div className={style['cols-main-options']}>
{dataInfo.status < 3 ? '未报价' : item.value}
</div>
}
</>
: <div className={style['cols-main-options']}>
{item.value}
<Form {...layout} form={form}>
{item.key === 'taxRate' &&
<Form.Item label={item.title} style={{ marginBottom: 0, position: 'relative' }}>
<div style={{
position: 'absolute',
top: '7px',
}}>
<Checkbox checked></Checkbox>
</div>
}
</div>
<Form.Item
label='税率'
name='taxRate'
rules={[{ required: true, message: '请输入税率' }]}
style={{ paddingLeft: '60px' }}
>
<Input
type='number'
addonAfter='%'
maxLength={25}
style={{ width: '200px' }}
/>
</Form.Item>
</Form.Item>}
{item.key === 'freight' &&
<Form.Item label={item.title} name={item.key} rules={[{ required: true, message: '请输入运费' }]}>
<Input
type='number'
addonBefore="¥"
maxLength={25}
style={{ width: '300px' }}
/>
</Form.Item>}
{item.key === 'settlement' &&
<Form.Item label={item.title} name={item.key}>
<span>{item.value}</span>
</Form.Item>}
</Form>
);
},
)}
......@@ -470,6 +491,7 @@ const detailInfo: React.FC<{}> = () => {
<ConfirmModal
id={id}
dialogVisible={visible}
taxRate={taxRate}
freightPrice={freightPrice}
onCancel={() => setvisible(false)}
onOK={() => handleModalOK()}
......
import React, { useContext, useEffect, useState } from 'react';
import { Space, Button, Tabs, Divider, Skeleton, Typography, message, Row, Col } from 'antd';
import React, { useContext, useEffect, useState, useRef } from 'react';
import { Space, Button, Tabs, Divider, Skeleton, Typography, message, Row, Col, Tooltip } from 'antd';
import { StandardTable } from 'god';
import { history } from 'umi';
import moment from 'moment';
......@@ -10,9 +10,9 @@ import EyePreview from '@/components/EyePreview';
import { PublicApi } from '@/services/api';
import BidTable from '../bidTable';
import { Context, BidDetailContext } from '../context';
import { useBidTable } from '../../../effects/useBidTable';
import { FilePdfOutlined } from '@ant-design/icons';
import ModalOperate from '../../../modalOperate';
import { useBidTable } from '../../../effects/useBidTable';
export interface ContrastProps {
effect?: any,
......@@ -20,6 +20,18 @@ export interface ContrastProps {
preview?: boolean
}
const chNum: { [key: number]: string } = {
1: '一',
2: '二',
3: '三',
4: '四',
5: '五',
6: '六',
7: '七',
8: '八',
9: '九',
}
const ContrastLyout: React.FC<ContrastProps> = (props: any) => {
const {
effect: {
......@@ -35,11 +47,17 @@ const ContrastLyout: React.FC<ContrastProps> = (props: any) => {
ctl: { setDataSource }
}
} = useBidTable();
const ref = useRef<any>({});
const context = useContext(Context);
const [loading, setLoading] = useState<boolean>(false);
const [disabled, setDisabled] = useState<boolean>(false);
const [type, setType] = useState<string>('');
const [visible, setVisible] = useState<boolean>(false);
const [iturn, setTurn] = useState<Array<number>>([]);
const [isDecrypt, setIsDecrypt] = useState<number>();
/** 当前的轮次 */
const [count, setCount] = useState<number>(turn);
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
......@@ -50,8 +68,8 @@ const ContrastLyout: React.FC<ContrastProps> = (props: any) => {
dataIndex: 'quotedPriceNo',
render: (text: any, record: any) => (
<Space direction='vertical'>
{ context.priceContrast === PRICECONTRAST_TYPE.UNENCRYPTED && <EyePreview url={`/memberCenter/procurementAbility/confirmOffer/quote/detail?id=${record.id}&number=${record.quotedPriceNo}`}>{text}</EyePreview> }
{ context.priceContrast === PRICECONTRAST_TYPE.UNDECRYPTED && <Typography.Text type='success'>{text}</Typography.Text> }
{ record.isDecrypt === PRICECONTRAST_TYPE.UNENCRYPTED && <EyePreview url={`/memberCenter/procurementAbility/confirmOffer/quote/detail?id=${record.id}&number=${record.quotedPriceNo}&turn=${record.turn}`}>{text}</EyePreview>}
{ record.isDecrypt === PRICECONTRAST_TYPE.UNDECRYPTED && <Tooltip placement="topLeft" title='当前报价为密封报价,请先解密报价单'><Typography.Text type='success'>{text}</Typography.Text></Tooltip>}
<Typography.Text>{record.details}</Typography.Text>
</Space>
)
......@@ -89,17 +107,29 @@ const ContrastLyout: React.FC<ContrastProps> = (props: any) => {
title: '解密状态',
key: 'isDecrypt',
dataIndex: 'isDecrypt',
render: (text: any, record: any) => (
<Typography.Text>{text === 1 ? '未加密' : '未解密'}</Typography.Text>
render: (text: any) => (
<Typography.Text>{text === 1 ? '已解密' : '未解密'}</Typography.Text>
)
},
]
/** 轮次 */
const handleTurn = (num: number) => {
let isTurn: Array<number> = [];
for (let i = 0; i < num; i += 1) {
isTurn.push(i + 1)
}
setTurn(isTurn.reverse());
}
const fetchTableData = (params: any) => {
return new Promise(resolve => {
PublicApi.getPurchaseConfirmQuotedPriceQuotedPriceInfo({ ...params, id, turn }).then(res => {
PublicApi.getPurchaseConfirmQuotedPriceQuotedPriceInfo({ ...params, id, turn: count }).then(res => {
if (res.code === 1000) {
resolve(res.data)
if (res.data.data.length > 0) {
setIsDecrypt(res.data.data[0].isDecrypt);
}
}
})
})
......@@ -158,19 +188,20 @@ const ContrastLyout: React.FC<ContrastProps> = (props: any) => {
setDataSource(params);
if (preview) {
redux(params)
console.log(params, data)
}
}
/** 立即比价 */
const atonceContrast = () => {
const PRICECONTRAST = context.priceContrast;
const atonceContrast = async () => {
const PRICECONTRAST = isDecrypt;
if (PRICECONTRAST === PRICECONTRAST_TYPE.UNENCRYPTED) {
setBoolean(true);
const params = {
id,
turn
turn: count.toString()
}
PublicApi.getPurchaseConfirmQuotedPriceRightOffContrastPrice({...params}, { ctrlType: 'none' }).then((res: any) => {
await PublicApi.getPurchaseConfirmQuotedPriceRightOffContrastPrice({ ...params }, { ctrlType: 'none' }).then((res: any) => {
if (res.code === 1000) {
const { data } = res;
if (data.length > 0) {
......@@ -198,17 +229,23 @@ const ContrastLyout: React.FC<ContrastProps> = (props: any) => {
useEffect(() => {
if (preview && Object.keys(context).length > 0) {
if (context.priceContrast === PRICECONTRAST_TYPE.UNENCRYPTED) {
if (isDecrypt === PRICECONTRAST_TYPE.UNENCRYPTED) {
atonceContrast()
}
handleTurn(turn)
}
}, [context])
}, [context, isDecrypt])
const handleSubmit = (type: string) => {
setVisible(true)
setType(type)
}
const handleOnChang = (e: any) => {
console.log(ref.current)
setCount(e)
}
return (
<BidDetailContext.Provider value={dataSource}>
<Card
......@@ -218,7 +255,7 @@ const ContrastLyout: React.FC<ContrastProps> = (props: any) => {
preview ? null :
<Space>
<Button onClick={() => handleSubmit('next')}>发起下轮报价</Button>
{context.priceContrast === PRICECONTRAST_TYPE.UNDECRYPTED &&
{isDecrypt === PRICECONTRAST_TYPE.UNDECRYPTED &&
<Button onClick={() => handleSubmit('key')}>
解密报价单
</Button>}
......@@ -232,37 +269,43 @@ const ContrastLyout: React.FC<ContrastProps> = (props: any) => {
</Space>
}
>
<Tabs>
<Tabs.TabPane
key='1'
tab='第一轮'
>
<div className={style.divider}>
<Divider type='vertical' className={style.vertical} />
供应商信息
</div>
<StandardTable
columns={columns}
tableProps={{ rowKew: 'id' }}
fetchTableData={(params: any) => fetchTableData(params)}
/>
<Skeleton
active
loading={loading}
/>
{dataSource.length > 0
&& (
<>
<div className={style.divider}>
<Divider type='vertical' className={style.vertical} />
<Tabs onChange={handleOnChang}>
{iturn.map((item: any) => (
<Tabs.TabPane
key={item}
tab={`第${chNum[item]}轮`}
>
<div className={style.divider}>
<Divider
type='vertical'
className={style.vertical}
/>
供应商信息
</div>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
fetchTableData={(params: any) => fetchTableData(params)}
/>
<Skeleton
active
loading={loading}
/>
{dataSource.length > 0
&& (
<>
<div className={style.divider}>
<Divider type='vertical' className={style.vertical} />
比价信息
</div>
<BidTable preview={preview} redux={reduxFetch} />
</>
)}
</Tabs.TabPane>
<BidTable preview={preview} redux={reduxFetch} />
</>
)}
</Tabs.TabPane>
))}
</Tabs>
{ preview &&
{preview &&
<Row gutter={[0, 4]} style={{ marginTop: '1em' }}>
<Col span={24}>
<div className={style['card-list']}>
......@@ -296,7 +339,7 @@ const ContrastLyout: React.FC<ContrastProps> = (props: any) => {
visible={visible}
fetch={
type === 'next' ? PublicApi.postPurchaseConfirmQuotedPriceLaunchTurnQuotedPrice :
PublicApi.postPurchaseConfirmQuotedPriceDecryptQuotedPrice
PublicApi.postPurchaseConfirmQuotedPriceDecryptQuotedPrice
}
onCancel={() => setVisible(false)}
onOk={() => history.goBack()}
......
......@@ -25,7 +25,7 @@ const QuoteDetails = () => {
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const { query: { id, number }, pathname } = history.location;
const { query: { id, number, turn }, pathname } = history.location;
const [dataSource, setDataSource] = useState<any>({});
const [basicEffect, setBasicEffect] = useState<any>([]);
const [otherEffect, setOtherEffect] = useState<any>([]);
......@@ -107,7 +107,7 @@ const QuoteDetails = () => {
<BasicLayout effect={basicEffect} />
<BidInfoLayout
fetch={PublicApi.getPurchaseConfirmQuotedPriceMaterielDetailed}
effect={{turn: dataSource.count, id }}
effect={{turn, id }}
/>
<OtherLayout effect={otherEffect} />
</Fragment>
......
......@@ -294,7 +294,7 @@ export const OFFTER_CONFIRMINTERIORSTATE_COLOR = {
export enum PRICECONTRAST_TYPE {
/** 未解密 */
UNDECRYPTED = 1,
/** 未加密 */
UNDECRYPTED = 0,
/** 已解密 */
UNENCRYPTED
}
......@@ -21,7 +21,7 @@ const AddForm = () => {
/** 基本信息 */
const [basic, setbasic] = useState<any>({});
/** 报价信息 */
const [offer, setoffer] = useState<any>([]);
const [offer, setoffer] = useState<any>({});
/** 报价说明 */
const [explain, setexplain] = useState<any>({});
/** 附件 */
......@@ -62,7 +62,8 @@ const AddForm = () => {
basicInfo.createTime = params.createTime;
basicInfo.externalState = params.externalState;
basicInfo.interiorState = params.interiorState;
offerInfo.count = params.count || 1;
offerInfo.count = params.count || 0;
offerInfo.id = params.id;
if (params.count) {
offerInfo.materiels = params.quotedPriceProducts;
} else {
......
......@@ -13,6 +13,7 @@ import {
import { CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons';
import style from './index.less';
import CrossSellProducts from '../modal/crossSellProducts';
import { PublicApi } from '@/services/api';
const { Text } = Typography;
const { Option } = Select;
......@@ -34,23 +35,27 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
const [visible, setVisible] = useState<boolean>(false);
const [record, setRecord] = useState<any>({});
const [index, setIndex] = useState<number>();
const [dataSource, setDataSource] = useState<any>(fetchdata.materiels)
const [data, setData] = useState<any>({});
const [dataSource, setDataSource] = useState<any>([]);
const [idx, setIdx] = useState<number>(0);
/** 修改税率&单价 */
const handleEdit = (e, name, idx) => {
const data = [...dataSource];
const handleEdit = (e, name, index) => {
const params = { ...data }
const query = [...params[idx]];
switch (name) {
case 'isTax':
data[idx].isTax = Number(e)
query[index].isTax = Number(e)
break;
case 'taxProbability':
data[idx].taxProbability = e.target.value;
query[index].taxProbability = e.target.value;
break;
case 'taxUnitPrice':
data[idx].taxUnitPrice = e.target.value;
query[index].taxUnitPrice = e.target.value;
break;
}
setDataSource(data)
params[idx] = [...query];
setData(params)
}
/** 用于展示有第几轮的TABS */
const [count, setCount] = useState<number>()
......@@ -108,7 +113,7 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
<Select
style={{ width: 100 }}
onChange={(e) => handleEdit(e, 'isTax', index)}
disabled={fetchdata && (fetchdata.count !== tabs[0])}
disabled={fetchdata && (count !== tabs[0])}
>
<Option value={1}></Option>
<Option value={0}></Option>
......@@ -129,7 +134,7 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
>
<Input
onChange={(e) => handleEdit(e, 'taxProbability', index)}
disabled={fetchdata && (fetchdata.count !== tabs[0])}
disabled={fetchdata && (count !== tabs[0])}
addonAfter="%"
/>
</Form.Item>
......@@ -149,7 +154,7 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
>
<Input
onChange={(e) => handleEdit(e, 'taxUnitPrice', index)}
disabled={fetchdata && (fetchdata.count !== tabs[0])}
disabled={fetchdata && (count !== tabs[0])}
addonBefore="¥"
/>
</Form.Item>
......@@ -182,29 +187,59 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
/** 确定关联商品 */
const handleConfirm = (params: any) => {
console.log(params, 10086)
const productAttributeJson = params.product.name.split('/').filter((_item, index) => index !== 0).join('/');
const data = [...dataSource];
data[index].productId = params.product.id;
data[index].customerCategoryName = params.product.customerCategoryName;
data[index].productName = params.product.name;
data[index].productBrand = params.product.brandName;
data[index].productAttributeJson = productAttributeJson;
data[index].enclosureUrls = params.files;
setDataSource(data)
const param = { ...data };
const query = [...param[idx]];
query[index].productId = params.product.id;
query[index].customerCategoryName = params.product.customerCategoryName;
query[index].productName = params.product.name;
query[index].productBrand = params.product.brandName;
query[index].productAttributeJson = productAttributeJson;
query[index].enclosureUrls = params.files;
param[idx] = [...query];
setData(param)
setVisible(false);
}
const fetchTableData = (turn: any, index: number) => {
const params = {
id: fetchdata.id,
turn,
current: '1',
pageSize: '100',
}
PublicApi.getPurchaseQuotedPriceMaterielDetailed({ ...params }).then((res: any) => {
if (res.code !== 1000) {
return
}
const param = { ...data };
param[index] = [...res.data.data];
console.log(param, 10086)
setData({ ...param });
setDataSource(res.data.data)
})
}
useEffect(() => {
if (fetchdata.materiels) {
setDataSource(fetchdata.materiels)
if (fetchdata.id) {
const isTurn = fetchdata.count ? fetchdata.count : 1;
fetchTableData(isTurn, 0)
}
if (fetchdata.count) {
console.log(fetchdata.count, 10086)
if (fetchdata.count || fetchdata.count === 0) {
let aCount = 0;
if (name === 'edit') {
aCount = fetchdata.count ? (fetchdata.count + 1) : 1;
} else if (name === 'quote') {
aCount = fetchdata.count ? (fetchdata.count + 1) : 1;
}
form.setFieldsValue({
count: fetchdata.count
count: aCount
})
setCount(fetchdata.count)
handleTabs( fetchdata.count || 1)
setCount(aCount);
handleTabs(aCount);
}
}, [fetchdata])
......@@ -213,7 +248,7 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
get: () => new Promise((resolve: any) => {
form.validateFields().then(res => {
const detailss: any = [];
dataSource.forEach(item => {
data[0].forEach(item => {
console.log(item, 10086)
detailss.push({
purchaseInquiryDetailsId: name === 'quote' ? item.id : item.purchaseInquiryDetailsId,
......@@ -224,7 +259,7 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
productId: item.productId,
goodsId: item.goodsId,
productBrand: item.productBrand,
productAttributeJson: '',
productAttributeJson: item.productAttributeJson,
})
})
resolve({
......@@ -239,7 +274,19 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
})
})
}
}, [dataSource])
}, [data])
const handleRadioGroup = (e) => {
const params = { ...data };
const { value } = e.target;
const index = e.target['data-index']
setCount(value);
setIdx(index);
if (!params[index]) {
const isTurn = value === 1 ? 1 : value - 1
fetchTableData(isTurn, index)
}
}
return (
<Form
......@@ -247,17 +294,17 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
className={style.offerStyle}
>
<Form.Item name='count'>
<Radio.Group>
{tabs.length > 0 && tabs.map(item => {
<Radio.Group onChange={handleRadioGroup}>
{tabs.length > 0 && tabs.map((item, index: any) => {
return (
<Radio.Button key={item} value={item}>{item}</Radio.Button>
<Radio.Button key={item} value={item} data-index={index}>{item}</Radio.Button>
)
})}
</Radio.Group>
</Form.Item>
<Table
columns={columns}
dataSource={dataSource}
dataSource={data[idx]}
rowClassName={style.editableRow}
pagination={{ size: "small" }}
rowKey='id'
......
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