Commit 6e7c9a6d authored by 前端-许佳敏's avatar 前端-许佳敏

Merge branch 'dev-srm' into v2

parents 0b8d7fca 31580809
...@@ -11,28 +11,28 @@ const InternetError: React.FC<{}> = () => { ...@@ -11,28 +11,28 @@ const InternetError: React.FC<{}> = () => {
const handleReload = () => { const handleReload = () => {
history.go(-1) history.go(-1)
} }
return ( return (
<div className={styles.wrapper}> <div className={styles.wrapper}>
<UserHeader logo={GlobalConfig.global.siteInfo.logo}/> <UserHeader logo={GlobalConfig.global.siteInfo.logo} />
<div className={styles.errorBox}> <div className={styles.errorBox}>
<Row> <Row>
<Col span={12}> <Col span={12}>
<div className={styles.desc}> <div className={styles.desc}>
<h1>哎呀!网络连接出错了</h1> <h1>哎呀!网络连接出错了</h1>
<h4>该错误可能由于如下原因所致:</h4> <h4>该错误可能由于如下原因所致:</h4>
<p>·电脑未连接到网络</p> <p>·电脑未连接到网络</p>
<p>·防火墙或杀毒软件阻止</p> <p>·防火墙或杀毒软件阻止</p>
<Button <Button
type="primary" type="primary"
size="large" size="large"
style={{marginTop: 100}} style={{ marginTop: 100 }}
onClick={handleReload} onClick={handleReload}
>刷新页面试试</Button> >刷新页面试试</Button>
</div> </div>
</Col> </Col>
<Col span={12}> <Col span={12}>
<img className={styles.image} src={Img} alt="数商云服务"/> <img className={styles.image} src={Img} alt="数商云服务" />
</Col> </Col>
</Row> </Row>
</div> </div>
......
import React, { Component } from 'react';
class ModalContainer extends Component {
state = {
visible: false
}
handleCancel = () => {
this.setState({
visible: false
})
}
show = () => {
this.setState({
visible: true
})
}
render() {
const { visible } = this.state;
const { children } = this.props;
return (
children({
visible: visible,
show: this.show,
cancel: this.handleCancel
})
)
}
}
export default ModalContainer;
...@@ -76,6 +76,7 @@ const fetchMemberAbilitySelect = async (params) => { ...@@ -76,6 +76,7 @@ const fetchMemberAbilitySelect = async (params) => {
const MemberDetail: React.FC<{}> = () => { const MemberDetail: React.FC<{}> = () => {
const ref = useRef<any>({}) const ref = useRef<any>({})
const staticData = useRef<any>([])
const [rowSelection, rowCtl] = useRowSelectionTable({customKey: 'memberId'}) const [rowSelection, rowCtl] = useRowSelectionTable({customKey: 'memberId'})
const [realRowSelection, realRowCtl] = useRowSelectionTable({customKey: 'relationId'}) const [realRowSelection, realRowCtl] = useRowSelectionTable({customKey: 'relationId'})
const [memberVisible, setMemberVisible] = useState(false) const [memberVisible, setMemberVisible] = useState(false)
...@@ -113,18 +114,25 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -113,18 +114,25 @@ const MemberDetail: React.FC<{}> = () => {
}).then((res) => { }).then((res) => {
if (res.code === 1000) { if (res.code === 1000) {
formAction.setFieldValue('userId', [res.data]) formAction.setFieldValue('userId', [res.data])
setTableData(res.data.data) // 添加一个remote标识, 带有此标识的 将会调用接口解绑
setTableData(res.data.data.map(v => ({...v, isRemote: true})))
} }
}) })
} }
useEffect(() => { useEffect(() => {
staticData.current = realRowCtl.selectedRowKeys
}, [realRowCtl.selectedRowKeys])
useEffect(() => {
rowCtl.setSelectedRowKeys(tableData.map(v => v.memberId)) rowCtl.setSelectedRowKeys(tableData.map(v => v.memberId))
rowCtl.setSelectRow([...tableData]) rowCtl.setSelectRow([...tableData])
realRowCtl.setSelectedRowKeys(tableData.filter(v => !staticData.current.includes(v)))
}, [tableData]) }, [tableData])
const cacelConnect = (record) => { const cacelConnect = (record) => {
unBindMember(record.relationId) unBindMember(record)
} }
const abilityColumns: any[] = [ const abilityColumns: any[] = [
...@@ -209,8 +217,8 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -209,8 +217,8 @@ const MemberDetail: React.FC<{}> = () => {
title: '操作', title: '操作',
align: 'center', align: 'center',
render: (_, record) => { render: (_, record) => {
return <Popconfirm title='确定要解除吗' onConfirm={() => cacelConnect(record)}> return <Popconfirm disabled={pageStatus === PageStatus.PREVIEW} title='确定要解除吗' onConfirm={() => cacelConnect(record)}>
<Button type='link'>解除绑定关系</Button> <Button type='link' disabled={pageStatus === PageStatus.PREVIEW}>解除绑定关系</Button>
</Popconfirm> </Popconfirm>
} }
} }
...@@ -267,17 +275,38 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -267,17 +275,38 @@ const MemberDetail: React.FC<{}> = () => {
return userInfo && userInfo.length > 0 return userInfo && userInfo.length > 0
} }
const unBindMember = async (relationId?) => { const unBindMember = async (options?) => {
if (pageStatus === PageStatus.ADD) { const relationIds = []
// 新增则无需调用接口 直接删除 if (options) {
if (relationId) { // 单选
const { relationId, isRemote } = options
if (pageStatus === PageStatus.ADD || !isRemote) {
// 新增或者编辑时是未保存状态的渠道业务员则无需调用接口 直接删除
setTableData(d => d.filter(v => v.relationId !== relationId)) setTableData(d => d.filter(v => v.relationId !== relationId))
} else { return false
}
relationIds.push(relationId)
} else {
// 批量
if (pageStatus === PageStatus.ADD) {
// 新增情况下 删除本地数据
setTableData(d => { setTableData(d => {
return d.filter(v => !realRowCtl.selectedRowKeys.includes(v.relationId)) return d.filter(v => !realRowCtl.selectedRowKeys.includes(v.relationId))
}) })
return false
} }
return false
const localRow = realRowCtl.selectRow.filter(v => !v.isRemote)
const localRowKey = localRow.map(v => v.relationId)
const remoteRowKey = realRowCtl.selectRow.filter(v => v.isRemote).map(v => v.relationId)
setTableData(d => {
return d.filter(v => !localRow.find(l => l.relationId === v.relationId))
})
if (remoteRowKey.length === 0) {
clearRealRowCtl(localRowKey)
return false
}
relationIds.push(...remoteRowKey)
} }
if (validateMember()) { if (validateMember()) {
const userInfo = formAction.getFieldValue('userId') const userInfo = formAction.getFieldValue('userId')
...@@ -285,12 +314,13 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -285,12 +314,13 @@ const MemberDetail: React.FC<{}> = () => {
const { code } = await PublicApi.postMemberAbilitySalesChannelUnbind({ const { code } = await PublicApi.postMemberAbilitySalesChannelUnbind({
userId, userId,
relationIds: relationId ? [relationId] : realRowCtl.selectedRowKeys relationIds: relationIds
}) })
if (code === 1000) { if (code === 1000) {
setTableData(d => { setTableData(d => {
return d.filter(v => relationId ? v.relationId !== relationId! : realRowCtl.selectedRowKeys.includes(v.relationId)) clearRealRowCtl(relationIds)
return d.filter(v => !relationIds.includes(v.relationId))
}) })
} }
} else { } else {
...@@ -298,6 +328,11 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -298,6 +328,11 @@ const MemberDetail: React.FC<{}> = () => {
} }
} }
const clearRealRowCtl = (ids: any[]) => {
realRowCtl.setSelectRow([...realRowCtl.selectRow.filter(v => !ids.includes(v.relationId))])
realRowCtl.setSelectedRowKeys([...realRowCtl.selectedRowKeys.filter(v => !ids.includes(v))])
}
const handleSubmit = async () => { const handleSubmit = async () => {
const userInfo = formAction.getFieldValue('userId') const userInfo = formAction.getFieldValue('userId')
if (userInfo && userInfo.length > 0) { if (userInfo && userInfo.length > 0) {
...@@ -455,17 +490,17 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -455,17 +490,17 @@ const MemberDetail: React.FC<{}> = () => {
<TabsItem tab="管理下级渠道" key="2"> <TabsItem tab="管理下级渠道" key="2">
<Row justify='space-between' style={{marginBottom: 20}}> <Row justify='space-between' style={{marginBottom: 20}}>
<Col> <Col>
<Button type='default' onClick={() => unBindMember()}>批量解除绑定关系</Button> <Button type='default' onClick={() => unBindMember()} disabled={pageStatus === PageStatus.PREVIEW}>批量解除绑定关系</Button>
</Col> </Col>
<Col style={{display: 'flex'}}> <Col style={{display: 'flex'}}>
<Input.Search value={keywordName} onChange={e => setKeywordName(e.target.value)} onPressEnter={fetchSaleChannel}/> <Input.Search value={keywordName} onChange={e => setKeywordName(e.target.value)} onPressEnter={fetchSaleChannel}/>
<Button type='default' style={{marginLeft: 20}}>重置</Button> <Button type='default' style={{marginLeft: 20}}>重置</Button>
</Col> </Col>
</Row> </Row>
<Button block type='dashed' onClick={() => setMemberVisible(true)}>选择待绑定渠道会员</Button> <Button block type='dashed' onClick={() => setMemberVisible(true)} disabled={pageStatus === PageStatus.PREVIEW}>选择待绑定渠道会员</Button>
<StandardTable <StandardTable
columns={connectMemberColumns} columns={connectMemberColumns}
rowSelection={realRowSelection} rowSelection={pageStatus !== PageStatus.PREVIEW && realRowSelection}
rowKey='relationId' rowKey='relationId'
tableProps={{ tableProps={{
dataSource: tableData dataSource: tableData
...@@ -484,6 +519,7 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -484,6 +519,7 @@ const MemberDetail: React.FC<{}> = () => {
columns={modalMemberColumns} columns={modalMemberColumns}
fetchTableData={fetchTableData} fetchTableData={fetchTableData}
rowKey={'memberId'} rowKey={'memberId'}
forceRender
formilyProps={{ formilyProps={{
ctx: { ctx: {
schema: { schema: {
......
...@@ -106,6 +106,7 @@ const ChannelMember: React.FC<{}> = () => { ...@@ -106,6 +106,7 @@ const ChannelMember: React.FC<{}> = () => {
formilyLayouts={{ formilyLayouts={{
justify: 'space-between' justify: 'space-between'
}} }}
rowKey='userId'
formilyChilds={{ formilyChilds={{
layouts: { layouts: {
order: 2 order: 2
......
...@@ -57,6 +57,7 @@ const Details = (props: any) => { ...@@ -57,6 +57,7 @@ const Details = (props: any) => {
const [payPlanList, setpayPlanList] = useState<any>([]) const [payPlanList, setpayPlanList] = useState<any>([])
const [contractText, setcontractText] = useState<any>([]) const [contractText, setcontractText] = useState<any>([])
const [signatureLogId, setsignatureLogId] = useState<any>('') // 签署地址id const [signatureLogId, setsignatureLogId] = useState<any>('') // 签署地址id
const [state, setstate] = useState<any>(false);
const [targetOffset, setTargetOffset] = useState<number | undefined>(undefined); const [targetOffset, setTargetOffset] = useState<number | undefined>(undefined);
const [contractAbstract, setcontractAbstract] = useState(''); const [contractAbstract, setcontractAbstract] = useState('');
...@@ -144,7 +145,8 @@ const Details = (props: any) => { ...@@ -144,7 +145,8 @@ const Details = (props: any) => {
if (info.file.response) { if (info.file.response) {
const { code } = info.file.response; const { code } = info.file.response;
console.log(code); console.log(code);
message.info(info.file.response.message); message.info('上传成功');
setstate(true);
} }
; ;
if (info.file.status !== 'uploading') { if (info.file.status !== 'uploading') {
...@@ -193,10 +195,6 @@ const Details = (props: any) => { ...@@ -193,10 +195,6 @@ const Details = (props: any) => {
/* 审核 */ /* 审核 */
const onFinish = (values: any) => { const onFinish = (values: any) => {
values.contractId = contractId; values.contractId = contractId;
let msg = message.loading({
content: '正在操作',
duration: 0,
});
console.log('Success:', values); console.log('Success:', values);
let fn: any; let fn: any;
switch (type) { switch (type) {
...@@ -215,32 +213,42 @@ const Details = (props: any) => { ...@@ -215,32 +213,42 @@ const Details = (props: any) => {
default: default:
break; break;
} }
fn(values).then(res => { if (type === 'Sign' && !state) {
console.log(res); console.log(type, state)
if (res.code === 1000) { message.warning('请先上传合同');
setIsModalVisible(!Visible) return;
setTimeout(() => { } else {
switch (type) { let msg = message.loading({
case 'submitExamine': content: '正在操作',
history.push('/memberCenter/contract/coordination/pageToBeSubmitExamine') duration: 0,
break; });
case 'levelexamine': fn(values).then(res => {
history.push('/memberCenter/contract/coordination/pageToBeExamineOne') console.log(res);
break; if (res.code === 1000) {
case 'pageToBeExamineTwo': setIsModalVisible(!Visible)
history.push('/memberCenter/contract/coordination/pageToBeExamineTwo') setTimeout(() => {
break; switch (type) {
case 'Sign': case 'submitExamine':
history.push('/memberCenter/contract/coordination/Sign') history.push('/memberCenter/contract/coordination/pageToBeSubmitExamine')
break; break;
default: case 'levelexamine':
break; history.push('/memberCenter/contract/coordination/pageToBeExamineOne')
} break;
}, 2000); case 'pageToBeExamineTwo':
} history.push('/memberCenter/contract/coordination/pageToBeExamineTwo')
}).finally(() => { break;
msg(); case 'Sign':
}); history.push('/memberCenter/contract/coordination/Sign')
break;
default:
break;
}
}, 2000);
}
}).finally(() => {
msg();
});
}
}; };
const onFinishFailed = (errorInfo: any) => { const onFinishFailed = (errorInfo: any) => {
......
...@@ -59,10 +59,6 @@ const Add: React.FC<{}> = (props: any) => { ...@@ -59,10 +59,6 @@ const Add: React.FC<{}> = (props: any) => {
basics: basicsVO.data, basics: basicsVO.data,
detailList: detailList, detailList: detailList,
} }
console.log('====================================');
console.log(data);
console.log('====================================');
return;
PublicApi.postContractApplyAmountSave(data).then(res => { PublicApi.postContractApplyAmountSave(data).then(res => {
console.log(res); console.log(res);
if (res.code === 1000) { if (res.code === 1000) {
......
...@@ -162,15 +162,15 @@ const AddbillList: React.FC<{}> = () => { ...@@ -162,15 +162,15 @@ const AddbillList: React.FC<{}> = () => {
}; };
const fetchOptions = (service) => { // const fetchOptions = (service) => {
return async function () { // return async function () {
const res = await service(); // const res = await service();
if (res.code === 1000) { // if (res.code === 1000) {
return res.data.map((item) => { return { label: item.name, value: item.status } }) // return res.data.map((item) => { return { label: item.name, value: item.status } })
} // }
return []; // return [];
} // }
} // }
return ( return (
...@@ -199,10 +199,10 @@ const AddbillList: React.FC<{}> = () => { ...@@ -199,10 +199,10 @@ const AddbillList: React.FC<{}> = () => {
'applyNo', 'applyNo',
FORM_FILTER_PATH, FORM_FILTER_PATH,
); );
useAsyncSelect( // useAsyncSelect(
"status", // "status",
fetchOptions(PublicApi.getContractApplyAmountGetStatusList) // fetchOptions(PublicApi.getContractApplyAmountGetStatusList)
) // )
}, },
components: { components: {
DateRangePickerUnix, DateRangePickerUnix,
...@@ -223,7 +223,7 @@ const AddbillList: React.FC<{}> = () => { ...@@ -223,7 +223,7 @@ const AddbillList: React.FC<{}> = () => {
onClick={handleJumpAdd} onClick={handleJumpAdd}
> >
新建 新建
</Button> </Button>
</Space>, </Space>,
layouts: { layouts: {
span: 8 span: 8
......
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { OrderTypeMap, PurchaseOrderInsideWorkStateTexts, PurchaseOrderOutWorkStateTexts } from '@/constants'; // import { OrderTypeMap, PurchaseOrderInsideWorkStateTexts, PurchaseOrderOutWorkStateTexts } from '@/constants';
export const SchemaBli: any = { export const SchemaBli: any = {
type: 'object', type: 'object',
...@@ -51,14 +51,14 @@ export const SchemaBli: any = { ...@@ -51,14 +51,14 @@ export const SchemaBli: any = {
} }
}, },
}, },
status: { // status: {
type: 'string', // type: 'string',
enum: [], // enum: [],
"x-component-props": { // "x-component-props": {
placeholder: '请选择内部状态' // placeholder: '请选择内部状态'
}, // },
title: '请选择外部状态', // title: '请选择外部状态',
}, // },
submit: { submit: {
'x-component': 'Submit', 'x-component': 'Submit',
'x-component-props': { 'x-component-props': {
...@@ -113,14 +113,14 @@ export const addSchemaBli: ISchema = { ...@@ -113,14 +113,14 @@ export const addSchemaBli: ISchema = {
} }
}, },
}, },
status: { // status: {
type: 'string', // type: 'string',
enum: [], // enum: [],
"x-component-props": { // "x-component-props": {
placeholder: '请选择内部状态' // placeholder: '请选择内部状态'
}, // },
title: '请选择外部状态', // title: '请选择外部状态',
}, // },
submit: { submit: {
'x-component': 'Submit', 'x-component': 'Submit',
'x-component-props': { 'x-component-props': {
......
...@@ -127,7 +127,7 @@ const FormList = (props: any) => { ...@@ -127,7 +127,7 @@ const FormList = (props: any) => {
payRatio: '', payRatio: '',
payAmount: '', payAmount: '',
payWay: '1', payWay: '1',
payParam: '', payParam: '1',
id: 0, id: 0,
}, },
) )
......
...@@ -43,7 +43,7 @@ const List: React.FC<Iprops> = (props: Iprops) => { ...@@ -43,7 +43,7 @@ const List: React.FC<Iprops> = (props: Iprops) => {
) )
} }
} }
], { fetchStatusListApi: PublicApi.getMemberRectifyManageStatusList, key: 'outerStatus' }) ], { fetchStatusListApi: PublicApi.getMemberRectifyStatusList, key: 'outerStatus' })
const handleFetch = async (params) => { const handleFetch = async (params) => {
const result = fetchListData(PublicApi.getMemberRectifyManagePage, params); const result = fetchListData(PublicApi.getMemberRectifyManagePage, params);
......
...@@ -28,7 +28,7 @@ export default function useColumns<T>(columnsList: ColumnsType<T>, actionColumn? ...@@ -28,7 +28,7 @@ export default function useColumns<T>(columnsList: ColumnsType<T>, actionColumn?
const defaultOptions = useMemo(() => options, [options]) const defaultOptions = useMemo(() => options, [options])
const fetchStatusOptions = useCallback(async () => { const fetchStatusOptions = useCallback(async () => {
const defaultApi = defaultOptions && defaultOptions.fetchStatusListApi || PublicApi.getMemberRectifySummaryStatusList const defaultApi = defaultOptions && defaultOptions.fetchStatusListApi || PublicApi.getMemberRectifyStatusList
const { code, data } = await defaultApi(); const { code, data } = await defaultApi();
if (code === 1000) { if (code === 1000) {
const formatedData = data.map((_item) => ({label: _item.message, value: _item.code})); const formatedData = data.map((_item) => ({label: _item.message, value: _item.code}));
......
...@@ -4,17 +4,17 @@ import { unixChangeRender } from "@/pages/procurement/callForBids/addNewBid/cons ...@@ -4,17 +4,17 @@ import { unixChangeRender } from "@/pages/procurement/callForBids/addNewBid/cons
/** 参数字段转换为form数据 */ /** 参数字段转换为form数据 */
export const fieldTransformRender = (params) => { export const fieldTransformRender = (params) => {
let result: any = {} let result: any = {}
result['inviteTenderId'] = params.inviteTender.id result['inviteTenderId'] = params.id
result['inviteTenderCode'] = params.inviteTender.code result['inviteTenderCode'] = params.code
result['remark'] = params.inviteTender.remark result['remark'] = params.remark
result['memberName'] = params.inviteTender.memberName result['memberName'] = params.memberName
result['inviteTenderArea'] = params.inviteTender.inviteTenderAreaList.map(item => item.provinceName + '' + item.cityName).join('/') result['inviteTenderArea'] = params.inviteTenderAreaList.map(item => item.provinceName + '' + item.cityName).join('/')
result['createTime'] = unixChangeRender(params.inviteTender.createTime) result['createTime'] = unixChangeRender(params.createTime)
result['registerStartTime'] = unixChangeRender(params.inviteTender.registerStartTime) result['registerStartTime'] = unixChangeRender(params.registerStartTime)
result['registerEndTime'] = unixChangeRender(params.inviteTender.registerEndTime) result['registerEndTime'] = unixChangeRender(params.registerEndTime)
result['registerRequirement'] = params.inviteTender.registerRequirement result['registerRequirement'] = params.registerRequirement
result['registerNeedFile'] = params.inviteTender.registerFile result['registerNeedFile'] = params.registerFile
result['inviteTenderMember'] = params.memberName result['inviteTenderMember'] = params.submitTenderMemberName
result['submitTenderOutStatus'] = TenderOutStateTexts[params.submitTenderOutStatus] result['submitTenderOutStatus'] = TenderOutStateTexts[params.submitTenderOutStatus]
result['submitTenderInStatus'] = TenderInStateTexts[params.submitTenderInStatus] result['submitTenderInStatus'] = TenderInStateTexts[params.submitTenderInStatus]
......
...@@ -34,7 +34,7 @@ const AddBidRegister:React.FC<AddBidRegisterProps> = (props) => { ...@@ -34,7 +34,7 @@ const AddBidRegister:React.FC<AddBidRegisterProps> = (props) => {
useEffect(() => { useEffect(() => {
if(id) { if(id) {
PublicApi.getPurchaseSubmitTenderGetInviteTender({ inviteTenderId: id }).then(res => { PublicApi.getPurchaseInviteTenderGetInviteTenderRegister({ inviteTenderId: id }).then(res => {
if(res.code === 1000) { if(res.code === 1000) {
// 转换字段渲染 // 转换字段渲染
const fixedData = fieldTransformRender(res.data) const fixedData = fieldTransformRender(res.data)
......
...@@ -80,25 +80,21 @@ const ReadyQualifityCheckedDetail: React.FC = () => { ...@@ -80,25 +80,21 @@ const ReadyQualifityCheckedDetail: React.FC = () => {
itemRender: () => null, itemRender: () => null,
fileList, fileList,
onChange(info) { onChange(info) {
if (info.file.status !== 'uploading') { if (info.file.status === 'error') {
}
if (info.file.status === 'done') {
setFileList(() => info.fileList.map(item => {
if(item?.response) {
return {
...item.response.data,
name: item.response.data.name.split('/').pop()
}
} else {
return {
...item,
}
}
}))
} else if (info.file.status === 'error') {
message.error(`${info.file.name} 上传失败`); message.error(`${info.file.name} 上传失败`);
} }
setFileList(() => info.fileList.map(item => {
if(item?.response) {
return {
...item.response.data,
name: item.response.data.name.split('/').pop()
}
} else {
return {
...item,
}
}
}))
}, },
beforeUpload(file) { beforeUpload(file) {
if(file.name.length > 100) { if(file.name.length > 100) {
......
...@@ -36,7 +36,7 @@ const Message: React.FC<{}> = () => { ...@@ -36,7 +36,7 @@ const Message: React.FC<{}> = () => {
} }
const handleRead = async (id: number, url: string) => { const handleRead = async (id: number, url: string) => {
const { data, code } = await PublicApi.postReportMessageMemberRead({id: id}, {ctlType: 'none'}) const { data, code } = await PublicApi.postMessageMessageMemberRead({id: id}, {ctlType: 'none'})
if(url) { if(url) {
if(/http/.test(url)) { if(/http/.test(url)) {
location.href = url location.href = url
......
...@@ -48,42 +48,6 @@ const Detail = () => { ...@@ -48,42 +48,6 @@ const Detail = () => {
} }
}, [purchaseBiddingMessageSupplier]) }, [purchaseBiddingMessageSupplier])
// const ws = useRef<WebSocket | null>(null);
// const webSocketInit = useCallback(() => {
// if (SOCKET_URL && (!ws.current || ws.current.readyState === 3) && userInfo) {
// const url = `${SOCKET_URL}/message/websocket?memberId=${userInfo.memberId}&roleId=${userInfo.memberRoleId}&token=${userInfo.token}&source=${1}`;
// console.log(url)
// ws.current = new WebSocket(url);
// // ws.current.onopen = (e) => {}
// ws.current.onmessage = (e) => {
// const data = JSON.parse(e.data);
// console.log(data)
// const _data = data.data;
// if(data.action === 'purchase_bidding_message_supplier' && _data.id == onlineId){
// const _obj = {
// ranking: _data.ranking,
// minLowPrice : _data.minPrice,
// quotationDesks : _data.awardProcesss
// }
// fetchDataSource(_obj);
// }
// };
// ws.current.onclose = (e) => {
// console.log("关闭连接")
// }
// ws.current.onerror = (e) => {
// console.log("socket 出错")
// }
// }
// }, [ws]);
// useEffect(() => {
// webSocketInit();
// return () => {
// ws.current?.close();
// };
// }, [ws, webSocketInit]);
const fetchDataSource = async (socketObj?: any) => { const fetchDataSource = async (socketObj?: any) => {
const params = { const params = {
id, id,
......
...@@ -58,51 +58,6 @@ const Management = () => { ...@@ -58,51 +58,6 @@ const Management = () => {
} }
}, [purchaseBiddingMessage]) }, [purchaseBiddingMessage])
// const ws = useRef<WebSocket | null>(null);
// const webSocketInit = useCallback(() => {
// if (SOCKET_URL && (!ws.current || ws.current.readyState === 3) && userInfo) {
// const url = `${SOCKET_URL}/message/websocket?memberId=${userInfo.memberId}&roleId=${userInfo.memberRoleId}&token=${userInfo.token}&source=${1}`;
// console.log(url)
// ws.current = new WebSocket(url);
// // ws.current.onopen = (e) => {}
// ws.current.onmessage = (e) => {
// const data = JSON.parse(e.data);
// console.log(data)
// const _data = data.data;
// if (data.action === 'purchase_bidding_message' && _data.id == id) {
// let _dynamic = { ...dynamic };
// _dynamic.count = _data.count;
// _dynamic.id = _data.id;
// _dynamic.memberName = _data.memberName;
// _dynamic.minPrice = _data.minPrice;
// setDynamic(_dynamic);
// setQueryPriceDynamics(_data.queryPriceDynamics);
// setSignupMembers(_data.sginUpInfos);
// setAwardProcess(_data.awardProcesss);
// setLowestList({
// type: 'min',
// title: '最低价',
// list: _data.awardProcesss ? _data.awardProcesss.map((item) => { return { type: 'min', time: formatTimeString(item.peportTime, 'HH:mm:ss'), value: priceFormat(item.sumPice, 0) } }) : []
// })
// }
// };
// ws.current.onclose = (e) => {
// console.log(e)
// console.log("关闭连接")
// }
// ws.current.onerror = (e) => {
// console.log("socket 出错")
// }
// }
// }, [ws]);
// useEffect(() => {
// webSocketInit();
// return () => {
// ws.current?.close();
// };
// }, [ws, webSocketInit]);
const fetchDataSource = async () => { const fetchDataSource = async () => {
const params = { const params = {
id, id,
......
...@@ -178,12 +178,16 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -178,12 +178,16 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
id id
}).then(res => { }).then(res => {
const { data } = res const { data } = res
const _orderProductRequests = data.orderModel > 30 ? procurementRenderField(data.orderProductRequests) : data.orderProductRequests
setInitFormValue({ setInitFormValue({
...data, ...data,
// 判断是否合同下单 // 判断是否合同下单
orderProductRequests: data.orderModel > 30 ? procurementRenderField(data.orderProductRequests) : data.orderProductRequests, orderProductRequests: [],
deliveryTime: formatTimeString(data.deliveryTime) deliveryTime: formatTimeString(data.deliveryTime)
}) })
// setTimeout(() => {
// addSchemaAction.setFieldValue('orderProductRequests', _orderProductRequests)
// }, 1000)
setFormLoading(false) setFormLoading(false)
}) })
} }
...@@ -652,6 +656,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -652,6 +656,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
} }
}) })
}) })
removeContractColumn()
} else if ( } else if (
value === OrderModalType.PURCHASE_ENQUIRY_CONTRACT_ORDER || value === OrderModalType.PURCHASE_ENQUIRY_CONTRACT_ORDER ||
value === OrderModalType.PURCHASE_BIDDING_CONTRACT_ORDER || value === OrderModalType.PURCHASE_BIDDING_CONTRACT_ORDER ||
...@@ -665,6 +670,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -665,6 +670,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
prefix: editable && pageStatus === PageStatus.ADD ? materialAddButton : '', prefix: editable && pageStatus === PageStatus.ADD ? materialAddButton : '',
} }
}) })
// }, 500) // }, 500)
showContractColumn() showContractColumn()
} else { } else {
...@@ -676,6 +682,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -676,6 +682,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
} }
}) })
// }, 500) // }, 500)
removeContractColumn()
} }
// 选择某种类型时, 需显示对应的订单类型 // 选择某种类型时, 需显示对应的订单类型
ctx.setFieldValue('type', orderTypeLabelMap()[value]) ctx.setFieldValue('type', orderTypeLabelMap()[value])
......
import { PropsConfigType } from './ComponentConfigType'; import { PropsConfigType } from './ComponentConfigType';
import { EffectsCommandMap } from 'dva'; import { EffectsCommandMap } from 'dva';
import { AnyAction } from 'redux'; import { AnyAction } from 'redux';
export interface PropsNodeType { export interface PropsNodeType {
[propName: string]: { [propName: string]: {
childNodes: VirtualDOMType[] childNodes: VirtualDOMType[]
} }
} }
export interface VirtualDOMType { export interface VirtualDOMType {
key: string, key: string,
componentName: string, componentName: string,
props: any, props: any,
addPropsConfig?: PropsConfigType, addPropsConfig?: PropsConfigType,
childNodes?: VirtualDOMType[] | PropsNodeType childNodes?: VirtualDOMType[] | PropsNodeType
} }
export interface SelectedComponentInfoType { export interface SelectedComponentInfoType {
selectedKey: string, selectedKey: string,
style: any, style: any,
parentPath: string, parentPath: string,
componentName: string, componentName: string,
propName?: string, propName?: string,
propPath?: string, propPath?: string,
path: string, path: string,
isContainer?: boolean, isContainer?: boolean,
isOnlyNode?: boolean, isOnlyNode?: boolean,
childNodesRule?: string[], childNodesRule?: string[],
domTreeKeys?: string[], domTreeKeys?: string[],
isRequiredHasChild?: boolean isRequiredHasChild?: boolean
} }
export interface PropsSettingType { export interface PropsSettingType {
props: any, props: any,
propsConfig: PropsConfigType, propsConfig: PropsConfigType,
mergePropsConfig: PropsConfigType, mergePropsConfig: PropsConfigType,
addPropsConfig: PropsConfigType, addPropsConfig: PropsConfigType,
} }
interface DragDataType { interface DragDataType {
defaultProps?: any, defaultProps?: any,
componentName?: string, componentName?: string,
templateData?: VirtualDOMType, templateData?: VirtualDOMType,
dragPath?: string, dragPath?: string,
dragParentPath?: string dragParentPath?: string
} }
export interface TemplateInfoType { export interface TemplateInfoType {
img: string, img: string,
id: string, id: string,
name: string, name: string,
config: string config: string
} }
export interface DropTargetInfoType { export interface DropTargetInfoType {
isContainer: boolean, isContainer: boolean,
propPath: string, propPath: string,
path: string, path: string,
isOnlyNode?: boolean, isOnlyNode?: boolean,
childNodesRule?: string[], childNodesRule?: string[],
componentName: string, componentName: string,
propName: string propName: string
} }
export type PlatformStyleType = number[] | string[] export type PlatformStyleType = number[] | string[]
export interface PlatformInfoType { export interface PlatformInfoType {
isMobile: boolean, isMobile: boolean,
size: PlatformStyleType, size: PlatformStyleType,
} }
export interface StateType { export interface StateType {
componentConfigs: VirtualDOMType[], componentConfigs: VirtualDOMType[],
selectedComponentInfo: SelectedComponentInfoType | {}, selectedComponentInfo: SelectedComponentInfoType | {},
propsSetting: PropsSettingType | {}, propsSetting: PropsSettingType | {},
styleSetting: any, styleSetting: any,
undo: any[], undo: any[],
redo: any[], redo: any[],
templateInfos: TemplateInfoType[], templateInfos: TemplateInfoType[],
hoverKey: null | string, hoverKey: null | string,
dragData: DragDataType | null, dragData: DragDataType | null,
dropTargetInfo: null | DropTargetInfoType, dropTargetInfo: null | DropTargetInfoType,
platformInfo: PlatformInfoType platformInfo: PlatformInfoType
} }
export type Effect = ( export type Effect = (
action: AnyAction, action: AnyAction,
effects: EffectsCommandMap & { select: <T>(func: (state: StateType) => T) => T }, effects: EffectsCommandMap & { select: <T>(func: (state: StateType) => T) => T },
) => void; ) => void;
export type Reducer = (state: StateType, action: AnyAction) => StateType export type Reducer = (state: StateType, action: AnyAction) => StateType
export interface ModelType { export interface ModelType {
namespace: string, namespace: string,
state: StateType, state: StateType,
effects: { effects: {
submitConfigs: Effect, submitConfigs: Effect,
searchTemplate: Effect, searchTemplate: Effect,
getTemplateList: Effect, getTemplateList: Effect,
addTemplateInfo: Effect, addTemplateInfo: Effect,
deleteTemplate: Effect deleteTemplate: Effect
}, },
reducers: { reducers: {
saveTemplateInfos: Reducer; saveTemplateInfos: Reducer;
addComponent: Reducer, addComponent: Reducer,
copyComponent: Reducer, copyComponent: Reducer,
onLayoutSortChange: Reducer, onLayoutSortChange: Reducer,
clearSelectedStatus: Reducer, clearSelectedStatus: Reducer,
selectComponent: Reducer, selectComponent: Reducer,
clearChildNodes: Reducer, clearChildNodes: Reducer,
deleteComponent: Reducer, deleteComponent: Reducer,
addPropsConfig: Reducer, addPropsConfig: Reducer,
deletePropsConfig: Reducer, deletePropsConfig: Reducer,
changeStyles: Reducer, changeStyles: Reducer,
submitProps: Reducer, submitProps: Reducer,
overTarget: Reducer, overTarget: Reducer,
clearHovered: Reducer, clearHovered: Reducer,
getDragData: Reducer, getDragData: Reducer,
getDropTargetInfo: Reducer, getDropTargetInfo: Reducer,
changePlatform: Reducer, changePlatform: Reducer,
undo: Reducer, undo: Reducer,
redo: Reducer, redo: Reducer,
} }
} }
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