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

Merge branch 'dev-srm' into v2

parents 0b8d7fca 31580809
......@@ -14,7 +14,7 @@ const InternetError: React.FC<{}> = () => {
return (
<div className={styles.wrapper}>
<UserHeader logo={GlobalConfig.global.siteInfo.logo}/>
<UserHeader logo={GlobalConfig.global.siteInfo.logo} />
<div className={styles.errorBox}>
<Row>
<Col span={12}>
......@@ -26,13 +26,13 @@ const InternetError: React.FC<{}> = () => {
<Button
type="primary"
size="large"
style={{marginTop: 100}}
style={{ marginTop: 100 }}
onClick={handleReload}
>刷新页面试试</Button>
</div>
</Col>
<Col span={12}>
<img className={styles.image} src={Img} alt="数商云服务"/>
<img className={styles.image} src={Img} alt="数商云服务" />
</Col>
</Row>
</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) => {
const MemberDetail: React.FC<{}> = () => {
const ref = useRef<any>({})
const staticData = useRef<any>([])
const [rowSelection, rowCtl] = useRowSelectionTable({customKey: 'memberId'})
const [realRowSelection, realRowCtl] = useRowSelectionTable({customKey: 'relationId'})
const [memberVisible, setMemberVisible] = useState(false)
......@@ -113,18 +114,25 @@ const MemberDetail: React.FC<{}> = () => {
}).then((res) => {
if (res.code === 1000) {
formAction.setFieldValue('userId', [res.data])
setTableData(res.data.data)
// 添加一个remote标识, 带有此标识的 将会调用接口解绑
setTableData(res.data.data.map(v => ({...v, isRemote: true})))
}
})
}
useEffect(() => {
staticData.current = realRowCtl.selectedRowKeys
}, [realRowCtl.selectedRowKeys])
useEffect(() => {
rowCtl.setSelectedRowKeys(tableData.map(v => v.memberId))
rowCtl.setSelectRow([...tableData])
realRowCtl.setSelectedRowKeys(tableData.filter(v => !staticData.current.includes(v)))
}, [tableData])
const cacelConnect = (record) => {
unBindMember(record.relationId)
unBindMember(record)
}
const abilityColumns: any[] = [
......@@ -209,8 +217,8 @@ const MemberDetail: React.FC<{}> = () => {
title: '操作',
align: 'center',
render: (_, record) => {
return <Popconfirm title='确定要解除吗' onConfirm={() => cacelConnect(record)}>
<Button type='link'>解除绑定关系</Button>
return <Popconfirm disabled={pageStatus === PageStatus.PREVIEW} title='确定要解除吗' onConfirm={() => cacelConnect(record)}>
<Button type='link' disabled={pageStatus === PageStatus.PREVIEW}>解除绑定关系</Button>
</Popconfirm>
}
}
......@@ -267,30 +275,52 @@ const MemberDetail: React.FC<{}> = () => {
return userInfo && userInfo.length > 0
}
const unBindMember = async (relationId?) => {
if (pageStatus === PageStatus.ADD) {
// 新增则无需调用接口 直接删除
if (relationId) {
const unBindMember = async (options?) => {
const relationIds = []
if (options) {
// 单选
const { relationId, isRemote } = options
if (pageStatus === PageStatus.ADD || !isRemote) {
// 新增或者编辑时是未保存状态的渠道业务员则无需调用接口 直接删除
setTableData(d => d.filter(v => v.relationId !== relationId))
return false
}
relationIds.push(relationId)
} else {
// 批量
if (pageStatus === PageStatus.ADD) {
// 新增情况下 删除本地数据
setTableData(d => {
return d.filter(v => !realRowCtl.selectedRowKeys.includes(v.relationId))
})
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()) {
const userInfo = formAction.getFieldValue('userId')
const userId = userInfo[0].userId
const { code } = await PublicApi.postMemberAbilitySalesChannelUnbind({
userId,
relationIds: relationId ? [relationId] : realRowCtl.selectedRowKeys
relationIds: relationIds
})
if (code === 1000) {
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 {
......@@ -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 userInfo = formAction.getFieldValue('userId')
if (userInfo && userInfo.length > 0) {
......@@ -455,17 +490,17 @@ const MemberDetail: React.FC<{}> = () => {
<TabsItem tab="管理下级渠道" key="2">
<Row justify='space-between' style={{marginBottom: 20}}>
<Col>
<Button type='default' onClick={() => unBindMember()}>批量解除绑定关系</Button>
<Button type='default' onClick={() => unBindMember()} disabled={pageStatus === PageStatus.PREVIEW}>批量解除绑定关系</Button>
</Col>
<Col style={{display: 'flex'}}>
<Input.Search value={keywordName} onChange={e => setKeywordName(e.target.value)} onPressEnter={fetchSaleChannel}/>
<Button type='default' style={{marginLeft: 20}}>重置</Button>
</Col>
</Row>
<Button block type='dashed' onClick={() => setMemberVisible(true)}>选择待绑定渠道会员</Button>
<Button block type='dashed' onClick={() => setMemberVisible(true)} disabled={pageStatus === PageStatus.PREVIEW}>选择待绑定渠道会员</Button>
<StandardTable
columns={connectMemberColumns}
rowSelection={realRowSelection}
rowSelection={pageStatus !== PageStatus.PREVIEW && realRowSelection}
rowKey='relationId'
tableProps={{
dataSource: tableData
......@@ -484,6 +519,7 @@ const MemberDetail: React.FC<{}> = () => {
columns={modalMemberColumns}
fetchTableData={fetchTableData}
rowKey={'memberId'}
forceRender
formilyProps={{
ctx: {
schema: {
......
......@@ -106,6 +106,7 @@ const ChannelMember: React.FC<{}> = () => {
formilyLayouts={{
justify: 'space-between'
}}
rowKey='userId'
formilyChilds={{
layouts: {
order: 2
......
......@@ -57,6 +57,7 @@ const Details = (props: any) => {
const [payPlanList, setpayPlanList] = useState<any>([])
const [contractText, setcontractText] = useState<any>([])
const [signatureLogId, setsignatureLogId] = useState<any>('') // 签署地址id
const [state, setstate] = useState<any>(false);
const [targetOffset, setTargetOffset] = useState<number | undefined>(undefined);
const [contractAbstract, setcontractAbstract] = useState('');
......@@ -144,7 +145,8 @@ const Details = (props: any) => {
if (info.file.response) {
const { code } = info.file.response;
console.log(code);
message.info(info.file.response.message);
message.info('上传成功');
setstate(true);
}
;
if (info.file.status !== 'uploading') {
......@@ -193,10 +195,6 @@ const Details = (props: any) => {
/* 审核 */
const onFinish = (values: any) => {
values.contractId = contractId;
let msg = message.loading({
content: '正在操作',
duration: 0,
});
console.log('Success:', values);
let fn: any;
switch (type) {
......@@ -215,6 +213,15 @@ const Details = (props: any) => {
default:
break;
}
if (type === 'Sign' && !state) {
console.log(type, state)
message.warning('请先上传合同');
return;
} else {
let msg = message.loading({
content: '正在操作',
duration: 0,
});
fn(values).then(res => {
console.log(res);
if (res.code === 1000) {
......@@ -241,6 +248,7 @@ const Details = (props: any) => {
}).finally(() => {
msg();
});
}
};
const onFinishFailed = (errorInfo: any) => {
......
......@@ -59,10 +59,6 @@ const Add: React.FC<{}> = (props: any) => {
basics: basicsVO.data,
detailList: detailList,
}
console.log('====================================');
console.log(data);
console.log('====================================');
return;
PublicApi.postContractApplyAmountSave(data).then(res => {
console.log(res);
if (res.code === 1000) {
......
......@@ -162,15 +162,15 @@ const AddbillList: React.FC<{}> = () => {
};
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 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 [];
// }
// }
return (
......@@ -199,10 +199,10 @@ const AddbillList: React.FC<{}> = () => {
'applyNo',
FORM_FILTER_PATH,
);
useAsyncSelect(
"status",
fetchOptions(PublicApi.getContractApplyAmountGetStatusList)
)
// useAsyncSelect(
// "status",
// fetchOptions(PublicApi.getContractApplyAmountGetStatusList)
// )
},
components: {
DateRangePickerUnix,
......
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { OrderTypeMap, PurchaseOrderInsideWorkStateTexts, PurchaseOrderOutWorkStateTexts } from '@/constants';
// import { OrderTypeMap, PurchaseOrderInsideWorkStateTexts, PurchaseOrderOutWorkStateTexts } from '@/constants';
export const SchemaBli: any = {
type: 'object',
......@@ -51,14 +51,14 @@ export const SchemaBli: any = {
}
},
},
status: {
type: 'string',
enum: [],
"x-component-props": {
placeholder: '请选择内部状态'
},
title: '请选择外部状态',
},
// status: {
// type: 'string',
// enum: [],
// "x-component-props": {
// placeholder: '请选择内部状态'
// },
// title: '请选择外部状态',
// },
submit: {
'x-component': 'Submit',
'x-component-props': {
......@@ -113,14 +113,14 @@ export const addSchemaBli: ISchema = {
}
},
},
status: {
type: 'string',
enum: [],
"x-component-props": {
placeholder: '请选择内部状态'
},
title: '请选择外部状态',
},
// status: {
// type: 'string',
// enum: [],
// "x-component-props": {
// placeholder: '请选择内部状态'
// },
// title: '请选择外部状态',
// },
submit: {
'x-component': 'Submit',
'x-component-props': {
......
......@@ -127,7 +127,7 @@ const FormList = (props: any) => {
payRatio: '',
payAmount: '',
payWay: '1',
payParam: '',
payParam: '1',
id: 0,
},
)
......
......@@ -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 result = fetchListData(PublicApi.getMemberRectifyManagePage, params);
......
......@@ -28,7 +28,7 @@ export default function useColumns<T>(columnsList: ColumnsType<T>, actionColumn?
const defaultOptions = useMemo(() => options, [options])
const fetchStatusOptions = useCallback(async () => {
const defaultApi = defaultOptions && defaultOptions.fetchStatusListApi || PublicApi.getMemberRectifySummaryStatusList
const defaultApi = defaultOptions && defaultOptions.fetchStatusListApi || PublicApi.getMemberRectifyStatusList
const { code, data } = await defaultApi();
if (code === 1000) {
const formatedData = data.map((_item) => ({label: _item.message, value: _item.code}));
......
......@@ -4,17 +4,17 @@ import { unixChangeRender } from "@/pages/procurement/callForBids/addNewBid/cons
/** 参数字段转换为form数据 */
export const fieldTransformRender = (params) => {
let result: any = {}
result['inviteTenderId'] = params.inviteTender.id
result['inviteTenderCode'] = params.inviteTender.code
result['remark'] = params.inviteTender.remark
result['memberName'] = params.inviteTender.memberName
result['inviteTenderArea'] = params.inviteTender.inviteTenderAreaList.map(item => item.provinceName + '' + item.cityName).join('/')
result['createTime'] = unixChangeRender(params.inviteTender.createTime)
result['registerStartTime'] = unixChangeRender(params.inviteTender.registerStartTime)
result['registerEndTime'] = unixChangeRender(params.inviteTender.registerEndTime)
result['registerRequirement'] = params.inviteTender.registerRequirement
result['registerNeedFile'] = params.inviteTender.registerFile
result['inviteTenderMember'] = params.memberName
result['inviteTenderId'] = params.id
result['inviteTenderCode'] = params.code
result['remark'] = params.remark
result['memberName'] = params.memberName
result['inviteTenderArea'] = params.inviteTenderAreaList.map(item => item.provinceName + '' + item.cityName).join('/')
result['createTime'] = unixChangeRender(params.createTime)
result['registerStartTime'] = unixChangeRender(params.registerStartTime)
result['registerEndTime'] = unixChangeRender(params.registerEndTime)
result['registerRequirement'] = params.registerRequirement
result['registerNeedFile'] = params.registerFile
result['inviteTenderMember'] = params.submitTenderMemberName
result['submitTenderOutStatus'] = TenderOutStateTexts[params.submitTenderOutStatus]
result['submitTenderInStatus'] = TenderInStateTexts[params.submitTenderInStatus]
......
......@@ -34,7 +34,7 @@ const AddBidRegister:React.FC<AddBidRegisterProps> = (props) => {
useEffect(() => {
if(id) {
PublicApi.getPurchaseSubmitTenderGetInviteTender({ inviteTenderId: id }).then(res => {
PublicApi.getPurchaseInviteTenderGetInviteTenderRegister({ inviteTenderId: id }).then(res => {
if(res.code === 1000) {
// 转换字段渲染
const fixedData = fieldTransformRender(res.data)
......
......@@ -80,10 +80,9 @@ const ReadyQualifityCheckedDetail: React.FC = () => {
itemRender: () => null,
fileList,
onChange(info) {
if (info.file.status !== 'uploading') {
if (info.file.status === 'error') {
message.error(`${info.file.name} 上传失败`);
}
if (info.file.status === 'done') {
setFileList(() => info.fileList.map(item => {
if(item?.response) {
return {
......@@ -96,9 +95,6 @@ const ReadyQualifityCheckedDetail: React.FC = () => {
}
}
}))
} else if (info.file.status === 'error') {
message.error(`${info.file.name} 上传失败`);
}
},
beforeUpload(file) {
if(file.name.length > 100) {
......
......@@ -36,7 +36,7 @@ const Message: React.FC<{}> = () => {
}
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(/http/.test(url)) {
location.href = url
......
......@@ -48,42 +48,6 @@ const Detail = () => {
}
}, [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 params = {
id,
......
......@@ -58,51 +58,6 @@ const Management = () => {
}
}, [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 params = {
id,
......
......@@ -178,12 +178,16 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
id
}).then(res => {
const { data } = res
const _orderProductRequests = data.orderModel > 30 ? procurementRenderField(data.orderProductRequests) : data.orderProductRequests
setInitFormValue({
...data,
// 判断是否合同下单
orderProductRequests: data.orderModel > 30 ? procurementRenderField(data.orderProductRequests) : data.orderProductRequests,
orderProductRequests: [],
deliveryTime: formatTimeString(data.deliveryTime)
})
// setTimeout(() => {
// addSchemaAction.setFieldValue('orderProductRequests', _orderProductRequests)
// }, 1000)
setFormLoading(false)
})
}
......@@ -652,6 +656,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}
})
})
removeContractColumn()
} else if (
value === OrderModalType.PURCHASE_ENQUIRY_CONTRACT_ORDER ||
value === OrderModalType.PURCHASE_BIDDING_CONTRACT_ORDER ||
......@@ -665,6 +670,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
prefix: editable && pageStatus === PageStatus.ADD ? materialAddButton : '',
}
})
// }, 500)
showContractColumn()
} else {
......@@ -676,6 +682,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}
})
// }, 500)
removeContractColumn()
}
// 选择某种类型时, 需显示对应的订单类型
ctx.setFieldValue('type', orderTypeLabelMap()[value])
......
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