提示创建项目结尾

This commit is contained in:
xixi 2024-11-19 14:58:17 +08:00
parent c42fb830b6
commit ea49a44c0f
6 changed files with 306 additions and 95 deletions

View File

@ -94,7 +94,7 @@ export default function BelongPeople(props: propsInfo) {
const [authorId, setAuthorId] = useState('') //所属人id
// 设置所属者more你选中的行
// const [selectedRowKeys, setSelectedRowKeys] = useState<BelongDataType[]>([]);
const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([]);
// 所属者搜索关键字
const [keywords, setKeyWords] = useState('')
const [type, setType] = useState('')
@ -111,37 +111,38 @@ export default function BelongPeople(props: propsInfo) {
// 表格相关
// rowSelection object indicates the need for row selection
// 所属者表格选择触发
// const belongRowSelection = {
// onChange: (_selectedRowKeys: React.Key[], selectedRows: BelongDataType[]) => {
// setauthorName(selectedRows[0].name)
// setauthorIdCardType(selectedRows[0].idCardType)
// setauthorIdCard(selectedRows[0].idCardNo)
// setauthorType(selectedRows[0].type)
// setauthorProvinceCity(selectedRows[0].provinceCity)
// setauthorCrcAccount(selectedRows[0].isCrcAccount)
// setAuthorId(selectedRows[0].projOwnerId)
// },
// };
const belongRowSelection = {
// selectedRowKeys: React.Key[]
onChange: (_selectedRowKeys: React.Key[], selectedRows: BelongDataType[]) => {
// console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
setauthorName(selectedRows[0].name)
setauthorIdCardType(selectedRows[0].idCardType)
setauthorIdCard(selectedRows[0].idCardNo)
setauthorType(selectedRows[0].type)
setauthorProvinceCity(selectedRows[0].provinceCity)
setauthorCrcAccount(selectedRows[0].isCrcAccount)
// setauthorCrcAccountPassword(selectedRows[0].crcAccountPassword)
// setauthorCrcAccountUsername(selectedRows[0].crcAccountUsername)
setAuthorId(selectedRows[0].projOwnerId)
// setClom(String(selectedRowKeys))
// setbelongselectedKeys(selectedRowKeys)
// props.setBelongPeopleName(selectedRows[0].name)
// props.setBelongPeopleInfo({
// authorName: selectedRows[0].name,
// authorType: selectedRows[0].type,
// authorIdCardType: selectedRows[0].idCardType,
// authorIdCard: selectedRows[0].idCardNo,
// authorCrcAccount: selectedRows[0].isCrcAccount,
// authorId: selectedRows[0].projOwnerId,
// authorProvinceCity: selectedRows[0].provinceCity
// })
// props.setValue(selectedRows[0].name)
selectedRowKeys,
onChange: (selectedRowKeys: React.Key[], selectedRows: typeof tableBelongData[0][]) => {
setSelectedRowKeys(selectedRowKeys);
if (selectedRows.length > 0) {
setauthorName(selectedRows[0].name);
setauthorIdCardType(selectedRows[0].idCardType);
setauthorIdCard(selectedRows[0].idCardNo);
setauthorType(selectedRows[0].type);
setauthorProvinceCity(selectedRows[0].provinceCity);
setauthorCrcAccount(selectedRows[0].isCrcAccount);
setAuthorId(selectedRows[0].projOwnerId);
}
},
};
// 单行选择触发单选
const handleRowClick = (record: typeof tableBelongData[0]) => {
setSelectedRowKeys([record.projOwnerId]);
belongRowSelection.onChange([record.projOwnerId], [record]);
};
// 所属人表格数据
const [tableBelongData, setTableBelongData] = useState<BelongDataType[]>([])
@ -519,13 +520,28 @@ export default function BelongPeople(props: propsInfo) {
>
<Column
align="center"
title="所属者名称" dataIndex="name" />
title="所属者名称" dataIndex="name"
render={(text, record: any) => (
<div style={{ cursor: 'default' }} onClick={() => {
handleRowClick(record)
}}>
{text}
</div>
)}
/>
<Column
align="center"
title="所属类型"
dataIndex="type"
render={(_text, record: any) => (
record.type === 'PERSONAL' ? '自然人' : '企业/组织'
<div style={{ cursor: 'default' }} onClick={() => {
handleRowClick(record)
}}>
{record.type === 'PERSONAL' ? '自然人' : '企业/组织'}
</div>
)}
/>
<Column
@ -533,10 +549,22 @@ export default function BelongPeople(props: propsInfo) {
title="所属证件类型"
dataIndex="idCardType"
render={(_text, record: any) => (
record.idCardType === 'ID_CARD' ? '身份证' : '营业执照'
<div style={{ cursor: 'default' }} onClick={() => {
handleRowClick(record)
}}>
{record.idCardType === 'ID_CARD' ? '身份证' : '营业执照'}
</div>
)}
/>
<Column align="center" title="所属者身份证号" dataIndex="idCardNo" key="belongCardNo"
render={(text, record: any) => (
<div style={{ cursor: 'default' }} onClick={() => {
handleRowClick(record)
}}>
{text}
</div>
)}
/>
<Column align="center" title="所属者身份证号" dataIndex="idCardNo" key="belongCardNo" />
{/* <Column title="实名认证状态" dataIndex="address" key="key" /> */}
<Column
align="center"
@ -887,10 +915,10 @@ export default function BelongPeople(props: propsInfo) {
disabled={belongTitle == '查看所属者' ? true : false}
/>
</Form.Item>
<div className='prompt'>(:如有多个著作人请用逗号分割)</div>
</div>
</Col>

View File

@ -79,20 +79,31 @@ export default function ContactPeople(props: any) {
}
})
}
const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([]);
// 联系人表格选择触发
const ContantRowSelection = {
// selectedRowKeys: React.Key[]
onChange: (_selectedRowKeys: React.Key[], selectedRows: ContactDataType[]) => {
selectedRowKeys,
onChange: (selectedRowKeys: React.Key[], selectedRows: typeof tableContactData[0][]) => {
setSelectedRowKeys(selectedRowKeys);
// console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
setApplyConcatId(selectedRows[0].projContactId)
setapplyContactCsaNo(selectedRows[0].csaNo)
setapplyContactEmail(selectedRows[0].email)
setapplyContactName(selectedRows[0].name)
setapplyContactPhone(selectedRows[0].phone)
setapplyContactCompany(selectedRows[0].company)
if (selectedRows.length > 0) {
setApplyConcatId(selectedRows[0].projContactId)
setapplyContactCsaNo(selectedRows[0].csaNo)
setapplyContactEmail(selectedRows[0].email)
setapplyContactName(selectedRows[0].name)
setapplyContactPhone(selectedRows[0].phone)
setapplyContactCompany(selectedRows[0].company)
}
},
};
// 单行选择触发单选
const handleRowClick = (record: typeof tableContactData[0]) => {
setSelectedRowKeys([record.projContactId]);
ContantRowSelection.onChange([record.projContactId], [record]);
};
// 点击创建联系热人获取随机客服
const getCas = () => {
get({
@ -253,11 +264,42 @@ export default function ContactPeople(props: any) {
style={{ textAlign: 'center', height: 390 }} // 设置表格内容居中显示
rowKey="projContactId" // 指定数据项的唯一标识符
>
<Column align="center" title="联系人" dataIndex="name" />
<Column align="center" title="联系人手机号" dataIndex="phone" />
<Column align="center" title="平台专属客服" dataIndex="csaNo" />
<Column align="center" title="联系人" dataIndex="name"
render={(text, record: any) => (
<div style={{ cursor: 'default' }} onClick={() => {
handleRowClick(record)
}}>
{text}
</div>
)}
/>
<Column align="center" title="联系人手机号" dataIndex="phone"
render={(text, record: any) => (
<div style={{ cursor: 'default' }} onClick={() => {
handleRowClick(record)
}}>
{text}
</div>
)}
/>
<Column align="center" title="平台专属客服" dataIndex="csaNo"
render={(text, record: any) => (
<div style={{ cursor: 'default' }} onClick={() => {
handleRowClick(record)
}}>
{text}
</div>
)}
/>
<Column align="center" title="所属公司" dataIndex="company"
render={(text) => (text !== '' ? text : '一')}
// render={(text) => (text !== '' ? text : '一')}
render={(text, record: any) => (
<div style={{ cursor: 'default' }} onClick={() => {
handleRowClick(record)
}}>
{text !== '' ? text : '一'}
</div>
)}
/>
{/* <Column title="实名认证状态" dataIndex="address" key="key" /> */}

View File

@ -597,7 +597,7 @@ export default function CardProj(props: any) {
) : <></>
}
</div> */}
<div className='cpbc-bot' style={{ color: '#FFA415' }}>
<div className='cpbc-bot' style={{ color: '#FFA415' }} title={data.apply.authorName}>
:{data.apply.authorName}
</div>

View File

@ -13,6 +13,7 @@
top: 0;
left: 0;
z-index: 999;
}

View File

@ -37,6 +37,9 @@ export default function ProjNew() {
const [messageApi, contextHolder] = message.useMessage();
const [loading, setLoading] = useState<boolean>(false);
const height = window.innerHeight - 180;
// 提示结尾是否带关键字弹窗
// const [hasKeywords, setHasKeywords] = useState<boolean>(false);
// 创建项目弹窗
const [isCreateModalOpen, setIsCreateModalOpen] = useState(false);
const [isEditModalOpen, setIsEditModalOpen] = useState(false);
const [chargePrice, setChargePrice] = useState(0);
@ -124,6 +127,15 @@ export default function ProjNew() {
},
})
}
//判断是否以“软件”、“系统”、“平台”或“APP”结尾
function isEndsWithKeywords(str: string) {
const keywords = ["软件", "系统", "平台", "APP"];
return keywords.some(keyword => str.endsWith(keyword));
}
// 提示信息是否显示
const [showTip, setShowTip] = useState(false)
useEffect(() => {
get({
messageApi: messageApi,
@ -138,7 +150,7 @@ export default function ProjNew() {
switch (pathParams.projChargeType) {
case ProjChargeType.ALL:
// price = charge.proj.all;
price = charge.projTypes[0].price ;
price = charge.projTypes[0].price;
break;
// case ProjChargeType.MATERIAL_AGENT:
// price = charge.proj.materialAgent;
@ -147,7 +159,7 @@ export default function ProjNew() {
// price = charge.proj.materialAgentUrgent;
// break;
case ProjChargeType.MATERIAL:
price = charge.projTypes[1].price ;
price = charge.projTypes[1].price;
break;
case ProjChargeType.FREE:
price = charge.projTypes[2].price;
@ -214,6 +226,12 @@ export default function ProjNew() {
wrapperCol={{ span: 24 }}
style={{ width: '100%' }}
onFinish={(formData) => {
// if(isEndsWithKeywords(formData.projName)){
// setIsCreateModalOpen(true);
// }else{
// setHasKeywords(true);
// }
setIsCreateModalOpen(true);
setProjInfo({
projName: formData.projName,
@ -225,14 +243,39 @@ export default function ProjNew() {
}}
autoComplete="off"
>
<div className='formItemOne'>
<div className='formItem-title oneTitle'>*</div>
<Form.Item<ProjInfo>
name="projName"
rules={[{ required: true, message: '请输入系统全称' }]}
>
<Input style={{ background: '#eeeeee', width: '800px', height: '50px', fontSize: '16px' }} placeholder="请输入系统全称" />
</Form.Item>
<div style={{ position: 'relative' }}>
<div className='formItemOne'>
<div className='formItem-title oneTitle'>*</div>
<Form.Item<ProjInfo>
name="projName"
rules={[
{ required: true, message: '请输入系统全称' },
]}
>
<Input onChange={(e) => {
// 打印值
// console.log(e.target.value);
if (e.target.value) {
if (isEndsWithKeywords(e.target.value)) {
setShowTip(false)
} else {
setShowTip(true)
}
}else{
setShowTip(false)
}
}} style={{ background: '#eeeeee', width: '800px', height: '50px', fontSize: '16px' }} placeholder="请输入系统全称 (注系统全称建议以“软件”、“系统”、“平台”或“APP”结尾)" />
</Form.Item>
</div>
<div style={{
position: 'absolute', left: 185,
display: showTip ? 'unset' : 'none',
color: 'green',
}}>APP</div>
</div>
<div className='formItemOne' style={{ marginTop: 20, position: 'relative' }}>
<div className='formItem-title '>
@ -398,7 +441,7 @@ export default function ProjNew() {
applyContactPhone: concatPeopleInfo.applyContactPhone,
projVersion: 'v1.0',
couponId:couponId?couponId:'',
couponId: couponId ? couponId : '',
},
onBefore() {
setLoading(true);
@ -421,10 +464,10 @@ export default function ProjNew() {
}}
onCancel={() => {
setIsCreateModalOpen(false);
}}>
<div> {(chargePrice / 100 - couponNum)<0?0:chargePrice / 100 - couponNum} 确定操作码</div>
<div> {(chargePrice / 100 - couponNum) < 0 ? 0 : chargePrice / 100 - couponNum} </div>
</Modal>
<Modal title="提示"
okText="确定"
@ -444,6 +487,23 @@ export default function ProjNew() {
}}>
<div></div>
</Modal>
{/* <Modal title=""
okText="更改"
cancelText="继续"
open={hasKeywords}
onOk={() => {
//Form表单的projName变为空
form.resetFields(['projName']);
setHasKeywords(false);
}}
centered
onCancel={() => {
setHasKeywords(false);
setIsCreateModalOpen(true);
}}>
<div>APP</div>
</Modal> */}
<Modal title="选择联系人"
destroyOnClose
@ -488,7 +548,7 @@ export default function ProjNew() {
setCouponId={(value: string) => {
setCouponId(value)
}}
couponNum = {couponNum}
couponNum={couponNum}
setCouponNum={(value: number) => {
setCouponNum(value)
}}

View File

@ -122,40 +122,64 @@ export default function ProjEditStep2(props: any) {
// 表格相关
// rowSelection object indicates the need for row selection
const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([]);
// 所属者表格选择触发
const belongRowSelection = {
selectedRowKeys,
// selectedRowKeys: React.Key[]
onChange: (_selectedRowKeys: React.Key[], selectedRows: BelongDataType[]) => {
onChange: (selectedRowKeys: React.Key[], selectedRows: BelongDataType[]) => {
// console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
setauthorName(selectedRows[0].name)
setauthorIdCardType(selectedRows[0].idCardType)
setauthorIdCard(selectedRows[0].idCardNo)
setauthorType(selectedRows[0].type)
setauthorNameEn(selectedRows[0].nameEn)
setauthorProvinceCity(selectedRows[0].provinceCity)
setauthorCrcAccount(selectedRows[0].isCrcAccount)
setauthorCrcAccountPassword(selectedRows[0].crcAccountPassword)
setauthorCrcAccountUsername(selectedRows[0].crcAccountUsername)
setAuthorId(selectedRows[0].projOwnerId)
setSelectedRowKeys(selectedRowKeys);
if (selectedRows.length > 0) {
setauthorName(selectedRows[0].name)
setauthorIdCardType(selectedRows[0].idCardType)
setauthorIdCard(selectedRows[0].idCardNo)
setauthorType(selectedRows[0].type)
setauthorNameEn(selectedRows[0].nameEn)
setauthorProvinceCity(selectedRows[0].provinceCity)
setauthorCrcAccount(selectedRows[0].isCrcAccount)
setauthorCrcAccountPassword(selectedRows[0].crcAccountPassword)
setauthorCrcAccountUsername(selectedRows[0].crcAccountUsername)
setAuthorId(selectedRows[0].projOwnerId)
}
// setClom(String(selectedRowKeys))
// setbelongselectedKeys(selectedRowKeys)
},
};
// 所属者表格单行选择触发单选
const handleRowClick = (record: typeof tableBelongData[0]) => {
setSelectedRowKeys([record.projOwnerId]);
belongRowSelection.onChange([record.projOwnerId], [record]);
};
const [selectedContantRowKeys, setSelectedContantRowKeys] = useState<React.Key[]>([]);
// 联系人表格选择触发
const ContantRowSelection = {
selectedRowKeys:selectedContantRowKeys,
// selectedRowKeys: React.Key[]
onChange: (_selectedRowKeys: React.Key[], selectedRows: ContactDataType[]) => {
onChange: (selectedRowKeys: React.Key[], selectedRows: ContactDataType[]) => {
setSelectedContantRowKeys(selectedRowKeys);
// console.log(selectedRowKeys);
// console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
setApplyConcatId(selectedRows[0].projContactId)
setapplyContactCsaNo(selectedRows[0].csaNo)
setapplyContactEmail(selectedRows[0].email)
setapplyContactName(selectedRows[0].name)
setapplyContactPhone(selectedRows[0].phone)
setapplyContactCompany(selectedRows[0].company)
if (selectedRows.length > 0) {
setApplyConcatId(selectedRows[0].projContactId)
setapplyContactCsaNo(selectedRows[0].csaNo)
setapplyContactEmail(selectedRows[0].email)
setapplyContactName(selectedRows[0].name)
setapplyContactPhone(selectedRows[0].phone)
setapplyContactCompany(selectedRows[0].company)
}
},
};
// 单行选择触发单选
const handleContantRowClick = (record: typeof tableContactData[0]) => {
setSelectedContantRowKeys([record.projContactId]);
ContantRowSelection.onChange([record.projContactId], [record]);
};
// 所属人表格数据
const [tableBelongData, setTableBelongData] = useState<BelongDataType[]>([])
// 联系人表格数据
@ -741,13 +765,27 @@ export default function ProjEditStep2(props: any) {
style={{ textAlign: 'center' }} // 设置表格内容居中显示
rowKey="projOwnerId" // 指定数据项的唯一标识符
>
<Column title="所属者名称" align="center" dataIndex="name" />
<Column title="所属者名称" align="center" dataIndex="name"
render={(text, record: any) => (
<div style={{ cursor: 'default' }} onClick={() => {
handleRowClick(record)
}}>
{text}
</div>
)}
/>
<Column
title="所属类型"
dataIndex="type"
align="center"
render={(_text, record: any) => (
record.type === 'PERSONAL' ? '自然人' : '企业/组织'
<div style={{ cursor: 'default' }} onClick={() => {
handleRowClick(record)
}}>
{record.type === 'PERSONAL' ? '自然人' : '企业/组织'}
</div>
)}
/>
<Column
@ -755,10 +793,22 @@ export default function ProjEditStep2(props: any) {
align="center"
dataIndex="idCardType"
render={(_text, record: any) => (
record.idCardType === 'ID_CARD' ? '身份证' : '营业执照'
<div style={{ cursor: 'default' }} onClick={() => {
handleRowClick(record)
}}>
{record.idCardType === 'ID_CARD' ? '身份证' : '营业执照'}
</div>
)}
/>
<Column title="所属者证件号" align="center" dataIndex="idCardNo" key="belongCardNo"
render={(text, record: any) => (
<div style={{ cursor: 'default' }} onClick={() => {
handleRowClick(record)
}}>
{text}
</div>
)}
/>
<Column title="所属者证件号" align="center" dataIndex="idCardNo" key="belongCardNo" />
{/* <Column title="实名认证状态" dataIndex="address" key="key" /> */}
<Column
title="操作"
@ -901,11 +951,41 @@ export default function ProjEditStep2(props: any) {
style={{ textAlign: 'center' }} // 设置表格内容居中显示
rowKey="projContactId" // 指定数据项的唯一标识符
>
<Column title="联系人" align="center" dataIndex="name" />
<Column title="联系人手机号" align="center" dataIndex="phone" />
<Column title="平台专属客服" align="center" dataIndex="csaNo" />
<Column title="联系人" align="center" dataIndex="name"
render={(text, record: any) => (
<div style={{ cursor: 'default' }} onClick={() => {
handleContantRowClick(record)
}}>
{text}
</div>
)}
/>
<Column title="联系人手机号" align="center" dataIndex="phone"
render={(text, record: any) => (
<div style={{ cursor: 'default' }} onClick={() => {
handleContantRowClick(record)
}}>
{text}
</div>
)}
/>
<Column title="平台专属客服" align="center" dataIndex="csaNo"
render={(text, record: any) => (
<div style={{ cursor: 'default' }} onClick={() => {
handleContantRowClick(record)
}}>
{text}
</div>
)}
/>
<Column title="所属公司" align="center" dataIndex="company"
render={(text) => (text !== '' ? text : '一')}
render={(text, record: any) => (
<div style={{ cursor: 'default' }} onClick={() => {
handleContantRowClick(record)
}}>
{text !== '' ? text : '一'}
</div>
)}
/>
{/* <Column title="实名认证状态" dataIndex="address" key="key" /> */}
@ -1200,7 +1280,7 @@ export default function ProjEditStep2(props: any) {
disabled={belongTitle == '查看所属者' ? true : false}
/>
</Form.Item>
<div className='prompt'>(:如有多个著作人请用逗号分割)</div>
</div>
@ -1216,12 +1296,12 @@ export default function ProjEditStep2(props: any) {
// rules={[{ required: true, message: belongShow == 'PERSONAL' ? '请输入英文名' : '请输入公司英文名称' }]}
rules={
[
// { required: true, message: belongShow == 'PERSONAL' ? '请输入英文名' : '请输入公司英文名称' },
// {
// pattern: /^[A-Za-z]+$/,
// message: '请输入正确的英文名'
// }
]}
// { required: true, message: belongShow == 'PERSONAL' ? '请输入英文名' : '请输入公司英文名称' },
// {
// pattern: /^[A-Za-z]+$/,
// message: '请输入正确的英文名'
// }
]}
>
<Input placeholder={belongShow == 'ORGANIZATION' ? '请输入公司英文名称' : '请输入英文名'}
style={{ height: '44px', width: '360px', fontSize: '15px', marginTop: '22px' }}