Commit 7834c7c7 authored by alwayOnlie's avatar alwayOnlie

优化代码

parent 758fb93d
...@@ -27,6 +27,7 @@ const Details = (props: any) => { ...@@ -27,6 +27,7 @@ const Details = (props: any) => {
const [contractNo, setcontractNo] = useState(); const [contractNo, setcontractNo] = useState();
/* 合同id */ /* 合同id */
const { location: { query: { contractId, type } } } = props; const { location: { query: { contractId, type } } } = props;
console.log(type)
const [currLink, setCurrLink] = useState(activeAnchorClassName) const [currLink, setCurrLink] = useState(activeAnchorClassName)
/** /**
* 渲染信息 * 渲染信息
...@@ -388,7 +389,7 @@ const Details = (props: any) => { ...@@ -388,7 +389,7 @@ const Details = (props: any) => {
</div> </div>
{ {
type != 'implement' && type && type != 'implement' &&
<div className="btn" style={{ marginRight: "20px" }}> <div className="btn" style={{ marginRight: "20px" }}>
<Button type="primary" onClick={() => submitExamine()}>{type === 'Sign' ? '签订合同' : '审核'}</Button> <Button type="primary" onClick={() => submitExamine()}>{type === 'Sign' ? '签订合同' : '审核'}</Button>
</div> </div>
......
...@@ -13,11 +13,10 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte ...@@ -13,11 +13,10 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import Submit from '@/components/NiceForm/components/Submit' import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix' import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import moment from 'moment'; import moment from 'moment';
import { history } from 'umi'; import { history } from 'umi';
import ExamineFrom from '../../components/examine'
const pageToBeExamineOne = () => { const pageToBeExamineOne = () => {
const ref = useRef<any>({}); const ref = useRef<any>({});
...@@ -117,8 +116,7 @@ const pageToBeExamineOne = () => { ...@@ -117,8 +116,7 @@ const pageToBeExamineOne = () => {
render: (text, record) => { render: (text, record) => {
return ( return (
<div> <div>
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => submitExamine(record.id)}>审核</span> <span style={{ color: '#00B37A', cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/coordination/pageToBeExamineOne/details?contractId=${record.id}&type=levelexamine`)}>审核</span>
<span style={{ color: '#00B37A', cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/coordination/pageToBeExamineOne/details?contractId=${record.id}&type=levelexamine`)}>查看</span>
</div> </div>
) )
} }
...@@ -157,16 +155,6 @@ const pageToBeExamineOne = () => { ...@@ -157,16 +155,6 @@ const pageToBeExamineOne = () => {
setIsModalVisible(!Visible) setIsModalVisible(!Visible)
} }
/* 提交审核的回调 */
const getfetchData = (data) => {
console.log(data)
setIsModalVisible(data.ExamineFlag)
if (data.code === 1000) {
ref.current.reload()
}
}
return ( return (
<PageHeaderWrapper> <PageHeaderWrapper>
<Card> <Card>
...@@ -198,13 +186,6 @@ const pageToBeExamineOne = () => { ...@@ -198,13 +186,6 @@ const pageToBeExamineOne = () => {
}} }}
/> />
</Card> </Card>
<ExamineFrom
ExamineFlag={Visible}
getfetchData={getfetchData}
applyId={id}
type="CoordinationPageToBeExamineOne"
/>
</PageHeaderWrapper> </PageHeaderWrapper>
) )
} }
......
import React, { useRef, useState } from 'react' import React, { useRef } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card } from 'antd'; import { Card } from 'antd';
import statuStyle from '../../common/colorTag' import statuStyle from '../../common/colorTag'
...@@ -13,16 +13,11 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte ...@@ -13,16 +13,11 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import Submit from '@/components/NiceForm/components/Submit' import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix' import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import moment from 'moment'; import moment from 'moment';
import ExamineFrom from '../../components/examine'
import { history } from 'umi'; import { history } from 'umi';
const pageToBeExamineTwo = () => { const pageToBeExamineTwo = () => {
const ref = useRef<any>({}); const ref = useRef<any>({});
const [Visible, setIsModalVisible] = useState<boolean>(false)
const [id, setid] = useState("")
const getdate = (time) => { const getdate = (time) => {
return new Date(Date.parse(time.replace(/-/g, "/"))).getTime() / 1000; return new Date(Date.parse(time.replace(/-/g, "/"))).getTime() / 1000;
} }
...@@ -116,22 +111,13 @@ const pageToBeExamineTwo = () => { ...@@ -116,22 +111,13 @@ const pageToBeExamineTwo = () => {
render: (text, record) => { render: (text, record) => {
return ( return (
<div> <div>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => submitExamine(record.id)}>审核</span>
<span style={{ color: '#00B37A', cursor: 'pointer' }} onClick={() => history.push(`/memberCenter/contract/coordination/pageToBeExamineTwo/details?contractId=${record.id}&type=pageToBeExamineTwo`)}>查看</span> <span style={{ color: '#00B37A', cursor: 'pointer' }} onClick={() => history.push(`/memberCenter/contract/coordination/pageToBeExamineTwo/details?contractId=${record.id}&type=pageToBeExamineTwo`)}>审核</span>
</div> </div>
) )
} }
} }
] ]
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) => { const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数 console.log(params)//可以直接打印参数
...@@ -149,22 +135,6 @@ const pageToBeExamineTwo = () => { ...@@ -149,22 +135,6 @@ const pageToBeExamineTwo = () => {
}) })
}) })
} }
/* 提交表单 */
const submitExamine = (id) => {
setid(id)
setIsModalVisible(!Visible)
}
/* 提交审核的回调 */
const getfetchData = (data) => {
console.log(data)
setIsModalVisible(data.ExamineFlag)
if (data.code === 1000) {
ref.current.reload()
}
}
return ( return (
<PageHeaderWrapper> <PageHeaderWrapper>
<Card> <Card>
...@@ -196,12 +166,6 @@ const pageToBeExamineTwo = () => { ...@@ -196,12 +166,6 @@ const pageToBeExamineTwo = () => {
}} }}
/> />
</Card> </Card>
<ExamineFrom
ExamineFlag={Visible}
getfetchData={getfetchData}
applyId={id}
type="CoordinationExamineStepTwo"
/>
</PageHeaderWrapper> </PageHeaderWrapper>
) )
} }
......
...@@ -9,6 +9,7 @@ import { PlusOutlined } from '@ant-design/icons'; ...@@ -9,6 +9,7 @@ import { PlusOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix' import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { addSchemaBli } from '../schema'; import { addSchemaBli } from '../schema';
import Submit from '@/components/NiceForm/components/Submit'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch' import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const' import { FORM_FILTER_PATH } from '@/formSchema/const'
...@@ -100,7 +101,7 @@ const AddbillList: React.FC<{}> = () => { ...@@ -100,7 +101,7 @@ const AddbillList: React.FC<{}> = () => {
return ( return (
<> <>
{ {
record.status == 1 && <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => Submit(record.id)}>提交</span> record.status == 1 && <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/addbill/Details?applyId=${record.id}&type=submitExamine`)}>提交</span>
} }
{node} {node}
{ {
...@@ -144,22 +145,6 @@ const AddbillList: React.FC<{}> = () => { ...@@ -144,22 +145,6 @@ const AddbillList: React.FC<{}> = () => {
setSelectRow(selectedRows) setSelectRow(selectedRows)
} }
}; };
/* 提交审核的回调 */
const Submit = (applyId) => {
console.log(applyId)
const msg = message.loading({
content: '正在操作',
duration: 0,
});
PublicApi.postContractApplyAmountSubmitExamine({ applyId }).then(res => {
if (res.code === 1000) {
ref.current.reload()
}
}).finally(() => {
msg();
});
}
/**删除 */ /**删除 */
const confirmDel = (recode: any) => { const confirmDel = (recode: any) => {
console.log(recode) console.log(recode)
...@@ -200,10 +185,6 @@ const AddbillList: React.FC<{}> = () => { ...@@ -200,10 +185,6 @@ const AddbillList: React.FC<{}> = () => {
'applyNo', 'applyNo',
FORM_FILTER_PATH, FORM_FILTER_PATH,
); );
// useAsyncSelect(
// "status",
// fetchOptions(PublicApi.getContractApplyAmountGetStatusList)
// )
}, },
components: { components: {
DateRangePickerUnix, DateRangePickerUnix,
......
...@@ -35,7 +35,7 @@ const Bill: React.FC<{}> = () => { ...@@ -35,7 +35,7 @@ const Bill: React.FC<{}> = () => {
return ( return (
<div> <div>
<EyePreview <EyePreview
url={`/memberCenter/contract/funds/bill/details?applyId=${record.id}&type=pageDetailList`} url={`/memberCenter/contract/funds/bill/details?applyId=${record.id}`}
> >
{text} {text}
</EyePreview> </EyePreview>
......
...@@ -103,7 +103,36 @@ const BillDetails = (props: any) => { ...@@ -103,7 +103,36 @@ const BillDetails = (props: any) => {
history.goBack() history.goBack()
}, 2000) }, 2000)
} }
}
/* 显示审核弹出 */
const submitExaminefunds = () => {
const msg = message.loading({
content: '正在操作',
duration: 0,
});
if (type == 'submitExamine') {
PublicApi.postContractApplyAmountSubmitExamine({ applyId }).then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack();
}, 2000);
}
}).finally(() => {
msg();
});
} else if (type == 'PageToBeSubmit') {
PublicApi.postContractApplyAmountSubmit({ applyId }).then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack();
}, 2000);
}
}).finally(() => {
msg();
});
} else {
setExamineFlag(true)
}
} }
/* 作废 */ /* 作废 */
const oninvalid = () => { const oninvalid = () => {
...@@ -139,9 +168,6 @@ const BillDetails = (props: any) => { ...@@ -139,9 +168,6 @@ const BillDetails = (props: any) => {
getDetail() getDetail()
}, []); }, []);
const handleIsAllMemberChange = (v: any) => { const handleIsAllMemberChange = (v: any) => {
setIsAllMember(v.target.value) setIsAllMember(v.target.value)
} }
...@@ -188,10 +214,10 @@ const BillDetails = (props: any) => { ...@@ -188,10 +214,10 @@ const BillDetails = (props: any) => {
</div> </div>
</div> </div>
<div> <div>
{ {
status == 1 && <Button type="primary" style={{ width: 80, marginRight: 16 }} onClick={() => setExamineFlag(!ExamineFlag)}>单据审核 </Button> type && <Button type="primary" style={{ width: 80, marginRight: 16 }} onClick={() => submitExaminefunds()}>{type == 'PageToBeSubmit' ? '提交请款单' : type === 'pageDetailList' ? '作废' : '审核'} </Button>
} }
</div> </div>
</Anchor> </Anchor>
<div id='content' className={style.card}> <div id='content' className={style.card}>
...@@ -253,7 +279,7 @@ const BillDetails = (props: any) => { ...@@ -253,7 +279,7 @@ const BillDetails = (props: any) => {
ExamineFlag={ExamineFlag} ExamineFlag={ExamineFlag}
getfetchData={getfetchData} getfetchData={getfetchData}
applyId={applyId} applyId={applyId}
type="submitExamine" type={type}
/> />
</div> </div>
) )
......
...@@ -2,6 +2,7 @@ import React, { useState, useRef, ReactNode } from 'react' ...@@ -2,6 +2,7 @@ import React, { useState, useRef, ReactNode } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card } from 'antd'; import { Card } from 'antd';
import { SchemaBli } from '../schema'; import { SchemaBli } from '../schema';
import { history } from 'umi';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import { StandardTable } from 'god'; import { StandardTable } from 'god';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch' import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
...@@ -32,7 +33,7 @@ const Levelpayment: React.FC<{}> = () => { ...@@ -32,7 +33,7 @@ const Levelpayment: React.FC<{}> = () => {
return ( return (
<div> <div>
<EyePreview <EyePreview
url={`/memberCenter/contract/funds/levelpayment/details?applyId=${record.id}&type=PageToBeExamineOne`} url={`/memberCenter/contract/funds/levelpayment/details?applyId=${record.id}`}
> >
{text} {text}
</EyePreview> </EyePreview>
...@@ -88,15 +89,12 @@ const Levelpayment: React.FC<{}> = () => { ...@@ -88,15 +89,12 @@ const Levelpayment: React.FC<{}> = () => {
render: (text: any, record: any) => { render: (text: any, record: any) => {
return ( return (
<> <>
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => isModal(record)}>审核</span> <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/levelpayment/details?applyId=${record.id}&type=PageToBeExamineOne`)}>审核</span>
</> </>
) )
} }
}] }]
const isModal = (record) => {
setExamineFlag(!ExamineFlag)
setapplyId(record.id)
}
// 模拟请求 // 模拟请求
const fetchData = (params?: any) => { const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数 console.log(params)//可以直接打印参数
...@@ -113,14 +111,6 @@ const Levelpayment: React.FC<{}> = () => { ...@@ -113,14 +111,6 @@ const Levelpayment: React.FC<{}> = () => {
} }
/* 提交审核的回调 */
const getfetchData = (data) => {
console.log(data)
setExamineFlag(data.ExamineFlag)
if (data.code === 1000) {
ref.current.reload()
}
}
const rowSelection: any = { const rowSelection: any = {
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => { onChange: (selectedRowKeys: any, selectedRows: any) => {
...@@ -173,12 +163,6 @@ const Levelpayment: React.FC<{}> = () => { ...@@ -173,12 +163,6 @@ const Levelpayment: React.FC<{}> = () => {
}} }}
/> />
</Card> </Card>
<Examine
ExamineFlag={ExamineFlag}
getfetchData={getfetchData}
applyId={applyId}
type="PageToBeExamineOne"
/>
</PageHeaderWrapper> </PageHeaderWrapper>
) )
......
...@@ -13,6 +13,7 @@ import Submit from '@/components/NiceForm/components/Submit' ...@@ -13,6 +13,7 @@ import Submit from '@/components/NiceForm/components/Submit'
import SearchSelect from '@/components/NiceForm/components/SearchSelect' import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix' import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import moment from 'moment'; import moment from 'moment';
import { history } from 'umi';
import Examine from '../../components/examine' import Examine from '../../components/examine'
import "../../constants/index.less" import "../../constants/index.less"
...@@ -32,7 +33,7 @@ const Secondpayment: React.FC<{}> = () => { ...@@ -32,7 +33,7 @@ const Secondpayment: React.FC<{}> = () => {
return ( return (
<div> <div>
<EyePreview <EyePreview
url={`/memberCenter/contract/funds/secondpayment/details?applyId=${record.id}&type=ToBeExamineTwo`} url={`/memberCenter/contract/funds/secondpayment/details?applyId=${record.id}`}
> >
{text} {text}
</EyePreview> </EyePreview>
...@@ -85,7 +86,7 @@ const Secondpayment: React.FC<{}> = () => { ...@@ -85,7 +86,7 @@ const Secondpayment: React.FC<{}> = () => {
render: (text: any, record: any) => { render: (text: any, record: any) => {
return ( return (
<> <>
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => isModal(record)}>审核</span> <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/secondpayment/details?applyId=${record.id}&type=ToBeExamineTwo`)}>审核</span>
</> </>
) )
} }
......
...@@ -13,9 +13,8 @@ import Submit from '@/components/NiceForm/components/Submit' ...@@ -13,9 +13,8 @@ import Submit from '@/components/NiceForm/components/Submit'
import SearchSelect from '@/components/NiceForm/components/SearchSelect' import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix' import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import moment from 'moment'; import moment from 'moment';
import Examine from '../../components/examine' import { history } from 'umi';
import "../../constants/index.less" import "../../constants/index.less"
const Submitpayment: React.FC<{}> = () => { const Submitpayment: React.FC<{}> = () => {
const ref = useRef<any>({}); const ref = useRef<any>({});
const [ExamineFlag, setExamineFlag] = useState<boolean>(false); const [ExamineFlag, setExamineFlag] = useState<boolean>(false);
...@@ -29,7 +28,7 @@ const Submitpayment: React.FC<{}> = () => { ...@@ -29,7 +28,7 @@ const Submitpayment: React.FC<{}> = () => {
return ( return (
<div> <div>
<EyePreview <EyePreview
url={`/memberCenter/contract/funds/submitpayment/details?applyId=${record.id}&type=pageToBeSubmit`} url={`/memberCenter/contract/funds/submitpayment/details?applyId=${record.id}`}
> >
{text} {text}
</EyePreview> </EyePreview>
...@@ -82,28 +81,11 @@ const Submitpayment: React.FC<{}> = () => { ...@@ -82,28 +81,11 @@ const Submitpayment: React.FC<{}> = () => {
render: (text: any, record: any) => { render: (text: any, record: any) => {
return ( return (
<> <>
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => ApplyAmountSubmit(record.id)}>提交请款单</span> <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/submitpayment/details?applyId=${record.id}&type=pageToBeSubmit`)}>提交请款单</span>
</> </>
) )
} }
}] }]
const ApplyAmountSubmit = (applyId) => {
const msg = message.loading({
content: '正在操作',
duration: 0,
});
PublicApi.postContractApplyAmountSubmit({ applyId }).then(res => {
if (res.code === 1000) {
getfetchData({
ExamineFlag: false,
code: 1000
})
}
}).finally(() => {
msg();
});
}
// 模拟请求 // 模拟请求
const fetchData = (params?: any) => { const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数 console.log(params)//可以直接打印参数
...@@ -119,13 +101,6 @@ const Submitpayment: React.FC<{}> = () => { ...@@ -119,13 +101,6 @@ const Submitpayment: React.FC<{}> = () => {
}) })
} }
/* 提交审核的回调 */
const getfetchData = (data) => {
setExamineFlag(data.ExamineFlag)
if (data.code === 1000) {
ref.current.reload()
}
}
const rowSelection: any = { const rowSelection: any = {
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => { onChange: (selectedRowKeys: any, selectedRows: any) => {
...@@ -178,12 +153,6 @@ const Submitpayment: React.FC<{}> = () => { ...@@ -178,12 +153,6 @@ const Submitpayment: React.FC<{}> = () => {
}} }}
/> />
</Card> </Card>
<Examine
ExamineFlag={ExamineFlag}
getfetchData={getfetchData}
applyId={applyId}
type="PageToBeSubmit"
/>
</PageHeaderWrapper> </PageHeaderWrapper>
) )
} }
......
...@@ -153,11 +153,14 @@ const addList = () => { ...@@ -153,11 +153,14 @@ const addList = () => {
}] }]
/**删除 */ /**删除 */
const confirmDel = (recode: any) => { const confirmDel = (recode: any) => {
console.log(recode)
// / contract / manage / delete
PublicApi.postContractManageDelete({ contractId: recode.id }).then(res => { PublicApi.postContractManageDelete({ contractId: recode.id }).then(res => {
ref.current.reload() if (res.code === 1000) {
ref.current.reload()
}
}).catch(err => {
console.log(err)
}) })
} }
/* 修改 */ /* 修改 */
...@@ -177,7 +180,9 @@ const addList = () => { ...@@ -177,7 +180,9 @@ const addList = () => {
} }
}).finally(() => { }).finally(() => {
msg(); msg();
}); }).catch(err => {
console.log(err)
})
} }
// 列表数据 // 列表数据
const fetchData = (params?: any) => { const fetchData = (params?: any) => {
......
...@@ -13,7 +13,6 @@ const { Text } = Typography; ...@@ -13,7 +13,6 @@ const { Text } = Typography;
const FormList = (props: any) => { const FormList = (props: any) => {
const { currentRef, Row, sourceType } = props; const { currentRef, Row, sourceType } = props;
console.log(sourceType)
const refs = useRef({}); const refs = useRef({});
/* 显示模态框 */ /* 显示模态框 */
const [isModalVisible, setIsModalVisible] = useState(false);// 显示模态框 const [isModalVisible, setIsModalVisible] = useState(false);// 显示模态框
...@@ -90,13 +89,16 @@ const FormList = (props: any) => { ...@@ -90,13 +89,16 @@ const FormList = (props: any) => {
/* 过滤字段 */ /* 过滤字段 */
const _filter = (sourceType: string, newObj: any, callBackArr: Array) => { const _filter = (sourceType: string, newObj: any, callBackArr: Array) => {
const key = callBackArr[sourceType] const key = callBackArr[sourceType]
console.log(sourceType, newObj, key)
if (!key) { if (!key) {
return ''; return '';
} }
let callBlackString = ''; let callBlackString = '';
if (sourceType == '2') { if (sourceType == '2') {
return newObj.inviteTenderMateriel[key] if (newObj.inviteTenderMateriel[key]) {
return newObj.inviteTenderMateriel[key]
} else {
return newObj[key]
}
} }
callBlackString = newObj[key] callBlackString = newObj[key]
if (callBlackString == null) { if (callBlackString == null) {
...@@ -107,8 +109,6 @@ const FormList = (props: any) => { ...@@ -107,8 +109,6 @@ const FormList = (props: any) => {
/* 处理数组 */ /* 处理数组 */
const _filterArr = (sourceType: string, newObj: any, callBackArr: Array) => { const _filterArr = (sourceType: string, newObj: any, callBackArr: Array) => {
let callBlackString = _filter(sourceType, newObj, callBackArr); let callBlackString = _filter(sourceType, newObj, callBackArr);
console.log(callBlackString, 'callBlackString')
if (Object.getPrototypeOf(callBlackString) === Array.prototype) { if (Object.getPrototypeOf(callBlackString) === Array.prototype) {
callBlackString = callBlackString[0] callBlackString = callBlackString[0]
} }
...@@ -117,10 +117,12 @@ const FormList = (props: any) => { ...@@ -117,10 +117,12 @@ const FormList = (props: any) => {
/* 处理布尔值 */ /* 处理布尔值 */
const _filterFalg = (sourceType: string, newObj: any, callBackArr: Array) => { const _filterFalg = (sourceType: string, newObj: any, callBackArr: Array) => {
let callBlackString = _filter(sourceType, newObj, callBackArr); let callBlackString = _filter(sourceType, newObj, callBackArr);
console.log(callBlackString, 'callBlackString')
if (sourceType !== '1') { if (sourceType !== '1') {
callBlackString = callBlackString ? '1' : '0'; callBlackString = callBlackString ? '1' : '0';
} }
return callBlackString console.log(callBlackString)
return Number(callBlackString)
} }
fn(parmas).then(res => { fn(parmas).then(res => {
...@@ -148,7 +150,7 @@ const FormList = (props: any) => { ...@@ -148,7 +150,7 @@ const FormList = (props: any) => {
// productBrand // productBrand
associatedType: _filter(sourceType, item, ['', '', '', '']), associatedType: _filter(sourceType, item, ['', '', '', '']),
associatedBrand: _filter(sourceType, item, ['', 'productAttributeJson', '', '']), associatedBrand: _filter(sourceType, item, ['', 'productAttributeJson', '', '']),
associatedDataId: _filter(sourceType, item, ['', 'number', 'commodityAttribute']), // 关联商品id associatedDataId: _filter(sourceType, item, ['', 'productId', 'commoditySkuId']), // 关联商品id
associatedMaterielNo: _filter(sourceType, item, ['', 'number', 'commodityAttribute']), // 关联物料编号 associatedMaterielNo: _filter(sourceType, item, ['', 'number', 'commodityAttribute']), // 关联物料编号
associatedMaterielName: _filter(sourceType, item, ['', 'productName', 'commodityName']), // 关联商品名称 associatedMaterielName: _filter(sourceType, item, ['', 'productName', 'commodityName']), // 关联商品名称
associatedGoods: _filter(sourceType, item, ['', 'productAttributeJson', 'commodityBrand']), //关联品牌 associatedGoods: _filter(sourceType, item, ['', 'productAttributeJson', 'commodityBrand']), //关联品牌
...@@ -157,9 +159,10 @@ const FormList = (props: any) => { ...@@ -157,9 +159,10 @@ const FormList = (props: any) => {
rowId: index, rowId: index,
} }
}) })
console.log(data, 'data')
setData(data) setData(data)
} }
}).catch(err => {
console.log(err)
}) })
} }
useEffect(() => { useEffect(() => {
...@@ -337,9 +340,9 @@ const FormList = (props: any) => { ...@@ -337,9 +340,9 @@ const FormList = (props: any) => {
associatedGoods: Object.keys(Row).length === 0 ? '' : item.associatedGoods, associatedGoods: Object.keys(Row).length === 0 ? '' : item.associatedGoods,
associatedDataId: Object.keys(Row).length === 0 ? '' : item.associatedDataId, associatedDataId: Object.keys(Row).length === 0 ? '' : item.associatedDataId,
associatedMaterielNo: Object.keys(Row).length === 0 ? '' : item.associatedMaterielNo, associatedMaterielNo: Object.keys(Row).length === 0 ? '' : item.associatedMaterielNo,
associatedType: Object.keys(Row).length === 0 ? '' : item.type, associatedType: Object.keys(Row).length === 0 ? '' : item.associatedType,
associatedCategory: Object.keys(Row).length === 0 ? '' : item.customerCategory.name, associatedCategory: Object.keys(Row).length === 0 ? '' : item.associatedCategory,
associatedBrand: Object.keys(Row).length === 0 ? '' : item.brand.name, associatedBrand: Object.keys(Row).length === 0 ? '' : item.associatedBrand,
}) })
}) })
resolve({ resolve({
......
...@@ -44,6 +44,8 @@ const ContractText = (props: any) => { ...@@ -44,6 +44,8 @@ const ContractText = (props: any) => {
} }
}) })
setTemplatePage(list) setTemplatePage(list)
}).catch(err => {
console.log(err)
}) })
} }
......
...@@ -139,6 +139,8 @@ const Information = (props: any) => { ...@@ -139,6 +139,8 @@ const Information = (props: any) => {
return new Promise(resolve => { return new Promise(resolve => {
fn({ ...params }, { ctlType: 'none' }).then(res => { fn({ ...params }, { ctlType: 'none' }).then(res => {
resolve(res.data) resolve(res.data)
}).catch(err => {
console.log(err)
}) })
}) })
} }
...@@ -156,7 +158,7 @@ const Information = (props: any) => { ...@@ -156,7 +158,7 @@ const Information = (props: any) => {
} else { } else {
let totalAmount, sourceId, partyBName, partyBMemberId, sourceNo, partyBRoleId; let totalAmount, sourceId, partyBName, partyBMemberId, sourceNo, partyBRoleId;
const selectRow = RowCtl.selectRow[0]; const selectRow = RowCtl.selectRow[0];
console.log(selectRow) // console.log(selectRow)
switch (basicsVO.sourceType) { switch (basicsVO.sourceType) {
case '1': case '1':
totalAmount = selectRow.awardAmount; totalAmount = selectRow.awardAmount;
...@@ -387,10 +389,10 @@ const Information = (props: any) => { ...@@ -387,10 +389,10 @@ const Information = (props: any) => {
> >
<Button onClick={() => setvisible(!visible)} style={{ marginRight: 8 }}> <Button onClick={() => setvisible(!visible)} style={{ marginRight: 8 }}>
取消 取消
</Button> </Button>
<Button type="primary" onClick={() => Confirm()} > <Button type="primary" onClick={() => Confirm()} >
确定 确定
</Button> </Button>
</div> </div>
} }
destroyOnClose destroyOnClose
......
...@@ -106,13 +106,12 @@ const Auction = () => { ...@@ -106,13 +106,12 @@ const Auction = () => {
return ( return (
<div> <div>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => Like(record)}>创建采购竞价合同</span> <span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => Like(record)}>创建采购竞价合同</span>
{/* <span style={{ color: '#00B37A', cursor: 'pointer' }} onClick={() => history.push(`/memberCenter/contract/manage/Auction/details?contractId=${record.id}`)}> 查看 </span> */}
</div> </div>
) )
} }
}] }]
const Like = (record) => { const Like = (record) => {
record.sourceId = record.viePriceId; record.sourceId = record.viePriceId;
record.sourceNo = record.viePriceNO; record.sourceNo = record.viePriceNO;
record.totalAmount = record.awardAmount; record.totalAmount = record.awardAmount;
...@@ -121,8 +120,6 @@ const Auction = () => { ...@@ -121,8 +120,6 @@ const Auction = () => {
record.partyBName = record.awardName; record.partyBName = record.awardName;
record.sourceType = "3"; record.sourceType = "3";
sessionStorage.setItem('record', JSON.stringify(record)); sessionStorage.setItem('record', JSON.stringify(record));
console.log(record);
// return;
history.push(`/memberCenter/contract/manage/add/addList/contracAdd?contractId=${record.id}&sourceType=3`) history.push(`/memberCenter/contract/manage/add/addList/contracAdd?contractId=${record.id}&sourceType=3`)
} }
const getdate = (time) => { const getdate = (time) => {
...@@ -137,6 +134,8 @@ const Auction = () => { ...@@ -137,6 +134,8 @@ const Auction = () => {
...params, ...params,
}).then(res => { }).then(res => {
resolve(res.data) resolve(res.data)
}).catch(err => {
console.log(err)
}) })
}) })
......
...@@ -131,6 +131,8 @@ const BiddingList = () => { ...@@ -131,6 +131,8 @@ const BiddingList = () => {
...params, ...params,
}).then(res => { }).then(res => {
resolve(res.data) resolve(res.data)
}).catch(err => {
console.log(err)
}) })
}) })
......
...@@ -11,7 +11,6 @@ import { ...@@ -11,7 +11,6 @@ import {
const ContractText = (props: any) => { const ContractText = (props: any) => {
const { currentRef, ctText, memberId } = props; const { currentRef, ctText, memberId } = props;
console.log(ctText, '拉拉')
const [TemplatePage, setTemplatePage] = useState<any>([]); const [TemplatePage, setTemplatePage] = useState<any>([]);
const [Templatel, setTemplatel] = useState<any>({}); const [Templatel, setTemplatel] = useState<any>({});
const [checkNick, setCheckNick] = useState(true); const [checkNick, setCheckNick] = useState(true);
...@@ -44,6 +43,8 @@ const ContractText = (props: any) => { ...@@ -44,6 +43,8 @@ const ContractText = (props: any) => {
} }
}) })
setTemplatePage(list) setTemplatePage(list)
}).catch(err => {
console.log(err)
}) })
} }
......
...@@ -27,6 +27,7 @@ const Information = (props: any) => { ...@@ -27,6 +27,7 @@ const Information = (props: any) => {
console.log(res.data) console.log(res.data)
if (res.code === 1000) { if (res.code === 1000) {
basic.contractNo = res.data basic.contractNo = res.data
attrValueForm.setFieldsValue(basic) attrValueForm.setFieldsValue(basic)
} }
}) })
......
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