暂存
This commit is contained in:
parent
822aeae3d4
commit
2a6d12ed78
@ -127,13 +127,13 @@ export const unbind = () => phoneRequest.get(`/operator/api/user-wx-update-usern
|
|||||||
// APP电子软著接口----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
// APP电子软著接口----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
//获取APP电子软著可买商品展示列表
|
//获取APP电子软著可买商品展示列表
|
||||||
export const appGoodsList = () => aiShopRequest.get(`/aishop/api/data/listbyparentid/71831561-108f-49f0-92c8-f9e4f0483c02`)
|
export const appGoodsList = () => aiShopRequest.get(`/aishop/api/apporder/money-list`)
|
||||||
// 获取运行系统选项
|
// 获取运行系统选项
|
||||||
export const runSystemList = () => aiShopRequest.get(`/aishop/api/data/listbyparentid/9fc8636a-b930-4e82-beb3-db7ca6151e6b`)
|
export const runSystemList = () => aiShopRequest.get(`/aishop/api/data/listbyparentid/9fc8636a-b930-4e82-beb3-db7ca6151e6b`)
|
||||||
// 获取大类选项
|
// 获取大类选项
|
||||||
export const bigClassList = () => aiShopRequest.get(`/aishop/api/data/listbyparentid/8abb5b58-83d2-465c-b164-a189efee28c1`)
|
export const bigClassList = () => aiShopRequest.get(`/aishop/api/data/listbyparentid/8abb5b58-83d2-465c-b164-a189efee28c1`)
|
||||||
// 获取小类
|
// 获取小类
|
||||||
export const smallClassList = (id:string) => aiShopRequest.get(`/aishop/api/data/listbyparentid/8abb5b58-83d2-465c-b164-a189efee28c1/${id}`)
|
export const twoClass = (id:string) => aiShopRequest.get(`/aishop/api/data/listbyparentid/${id}`)
|
||||||
|
|
||||||
// 下单购买APP电子软著
|
// 下单购买APP电子软著
|
||||||
export const buyAppGoods = (orderMoneyId:string) => aiShopRequest.post(`/aishop/api/apporder/pay/${orderMoneyId}`)
|
export const buyAppGoods = (orderMoneyId:string) => aiShopRequest.post(`/aishop/api/apporder/pay/${orderMoneyId}`)
|
||||||
@ -142,7 +142,21 @@ export const appOrderList = (params:any) => aiShopRequest.get(`/aishop/api/appor
|
|||||||
// 获取app电子软著详情
|
// 获取app电子软著详情
|
||||||
export const appOrderDetail = (appOrderId:any) => aiShopRequest.get(`/aishop/api/apporder/get/${appOrderId}`)
|
export const appOrderDetail = (appOrderId:any) => aiShopRequest.get(`/aishop/api/apporder/get/${appOrderId}`)
|
||||||
// 生成授权书word文件
|
// 生成授权书word文件
|
||||||
export const authorizeWord = (appOrderId:any,companyName:string) => aiShopRequest.get(`/aishop/api/apporder/create-file/SHOP04/${appOrderId}?name=${companyName}授权书&companyName=${companyName}`)
|
export const authorizeWord = (appOrderId:string,companyName:string) => aiShopRequest.get(`/aishop/api/apporder/create-file/SHOP04/${appOrderId}?name=${companyName}授权书&companyName=${companyName}`)
|
||||||
// 企业认证
|
// 生成合协议word文件
|
||||||
|
export const agreementWord = (appOrderId:string,appName:string,versionName:string) => aiShopRequest.get(`aishop/api/apporder/create-file/SHOP01/${appOrderId}?name=${appName}合作协议&appName=${appName}&versionName=${versionName}`)
|
||||||
|
// 生成源码文档word文件
|
||||||
|
export const sourceCodeWord = (appOrderId:string,) => aiShopRequest.get(`aishop/api/apporder/create-file/SHOP02/${appOrderId}?name=源码文档示例`)
|
||||||
|
// 生成软件文档word文件
|
||||||
|
export const softwareDocumentWord = (appOrderId:string,) => aiShopRequest.get(`aishop/api/apporder/create-file/SHOP03/${appOrderId}?name=软件文档示例`)
|
||||||
|
|
||||||
|
// 获取文件详细信息
|
||||||
|
export const fileDetail = (fileId:string) => aiShopRequest.get(`aishop/api/file/list?ids=${fileId}`)
|
||||||
|
// 第一步 企业认证
|
||||||
export const companyAuth = (appOrderId:any,params:any) => aiShopRequest.post(`aishop/api/apporder/update/1/${appOrderId}`,params)
|
export const companyAuth = (appOrderId:any,params:any) => aiShopRequest.post(`aishop/api/apporder/update/1/${appOrderId}`,params)
|
||||||
|
// 第二步 软件基本信息填写
|
||||||
|
export const softwareInfo = (appOrderId:any,params:any) => aiShopRequest.post(`aishop/api/apporder/update/2/${appOrderId}`,params)
|
||||||
|
// 第三步 上传鉴别材料
|
||||||
|
export const uploadMaterial = (appOrderId:any,params:any) => aiShopRequest.post(`/aishop/api/apporder/update/3/${appOrderId}`,params)
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
@ -8,7 +8,12 @@ import EditAppFiles from './components/EditAppFiles/EditAppFiles';
|
|||||||
import AppInfo from './components/AppInfo/AppInfo';
|
import AppInfo from './components/AppInfo/AppInfo';
|
||||||
import AppCompany from './components/AppCompany/AppCompany';
|
import AppCompany from './components/AppCompany/AppCompany';
|
||||||
import { useParams } from 'react-router-dom'
|
import { useParams } from 'react-router-dom'
|
||||||
import { runSystemList, bigClassList, smallClassList } from '../../request/api'
|
import {
|
||||||
|
runSystemList, bigClassList,
|
||||||
|
// twoClass,
|
||||||
|
// fileDetail
|
||||||
|
} from '../../request/api'
|
||||||
|
// import { showImage } from '../../request/request'
|
||||||
import './app-edit.css'
|
import './app-edit.css'
|
||||||
import {
|
import {
|
||||||
RightOutlined
|
RightOutlined
|
||||||
@ -25,7 +30,7 @@ export default function AppEdit() {
|
|||||||
const appOrderId = pathParams.appOrderId;
|
const appOrderId = pathParams.appOrderId;
|
||||||
const [systemList, setSystemList] = useState<any[]>([]); // 运行系统选项
|
const [systemList, setSystemList] = useState<any[]>([]); // 运行系统选项
|
||||||
const [bigClass, setBigClass] = useState<any[]>([]); // 软件分类(大类)选项
|
const [bigClass, setBigClass] = useState<any[]>([]); // 软件分类(大类)选项
|
||||||
const [smallClass, setSmallClass] = useState<any[]>([]); // 软件分类(小类)选项
|
// const [smallClass, setSmallClass] = useState<any[]>([]); // 软件分类(小类)选项
|
||||||
// 获取运行系统选项
|
// 获取运行系统选项
|
||||||
const getRunSystemList = async () => {
|
const getRunSystemList = async () => {
|
||||||
try {
|
try {
|
||||||
@ -59,17 +64,17 @@ export default function AppEdit() {
|
|||||||
const getBigClassList = async () => {
|
const getBigClassList = async () => {
|
||||||
try {
|
try {
|
||||||
const res: any = await bigClassList();
|
const res: any = await bigClassList();
|
||||||
console.log('大类选项', res.map((item: any) => {
|
// console.log('大类选项', res.map((item: any) => {
|
||||||
|
// return {
|
||||||
|
// label: item.dataName,
|
||||||
|
// value: item.dataId,
|
||||||
|
// }
|
||||||
|
// }));
|
||||||
|
setBigClass(res.map((item: any) => {
|
||||||
return {
|
return {
|
||||||
label: item.dataName,
|
label: item.dataName,
|
||||||
value: item.dataId,
|
value: item.dataId,
|
||||||
}
|
}
|
||||||
}));
|
|
||||||
setBigClass(res.map((item: any) => {
|
|
||||||
return {
|
|
||||||
label: item.dataId,
|
|
||||||
value: item.dataName,
|
|
||||||
}
|
|
||||||
}))
|
}))
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
|
|
||||||
@ -85,29 +90,29 @@ export default function AppEdit() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 获取小类选项
|
// 获取小类选项
|
||||||
const getSmallClassList = async (id: string) => {
|
// const getSmallClassList = async (id: string) => {
|
||||||
try {
|
// try {
|
||||||
const res: any = await smallClassList(id);
|
// const res: any = await twoClass(id);
|
||||||
console.log(res);
|
// console.log('小类', res);
|
||||||
setSmallClass(res.map((item: any) => {
|
// setSmallClass(res.map((item: any) => {
|
||||||
return {
|
// return {
|
||||||
label: item.dataId,
|
// label: item.dataId,
|
||||||
value: item.dataName,
|
// value: item.dataName,
|
||||||
}
|
// }
|
||||||
}))
|
// }))
|
||||||
} catch (error: any) {
|
// } catch (error: any) {
|
||||||
|
|
||||||
if (error.response) {
|
// if (error.response) {
|
||||||
const data = error.response.data;
|
// const data = error.response.data;
|
||||||
messageApi.open({
|
// messageApi.open({
|
||||||
type: 'error',
|
// type: 'error',
|
||||||
content: data.msg ? data.msg : `${data.path}(${data.status})`,
|
// content: data.msg ? data.msg : `${data.path}(${data.status})`,
|
||||||
});
|
// });
|
||||||
} else {
|
// } else {
|
||||||
console.error(error)
|
// console.error(error)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [editProcess, setEditProcess] = useState(1);
|
const [editProcess, setEditProcess] = useState(1);
|
||||||
@ -132,16 +137,20 @@ export default function AppEdit() {
|
|||||||
projOwnerName: '',//著作权人姓名
|
projOwnerName: '',//著作权人姓名
|
||||||
projOwnerIdentity: '',//著作权人证件号
|
projOwnerIdentity: '',//著作权人证件号
|
||||||
projOwnerId: '',//著作权人信息ID
|
projOwnerId: '',//著作权人信息ID
|
||||||
|
getFile: '',//获取文件
|
||||||
})
|
})
|
||||||
// 材料信息
|
// 材料信息
|
||||||
const [filesInfo, setFilesInfo] = useState<any>({
|
const [filesInfo, setFilesInfo] = useState<any>({
|
||||||
sourceCodeDocFile: '',//源码
|
sourceCodeDocFile: '',//源码
|
||||||
softwareDocFile: '',//软件
|
softwareDocFile: '',//软件
|
||||||
})
|
})
|
||||||
|
// 文件想想请
|
||||||
|
// const [fileList, setFileList] = useState<any[]>([]);
|
||||||
// 获取详情
|
// 获取详情
|
||||||
const getAppOrderDetail = async () => {
|
const getAppOrderDetail = async () => {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
|
|
||||||
const res: any = await appOrderDetail(appOrderId);
|
const res: any = await appOrderDetail(appOrderId);
|
||||||
console.log('详情', res);
|
console.log('详情', res);
|
||||||
setCompanyInfo({
|
setCompanyInfo({
|
||||||
@ -163,12 +172,24 @@ export default function AppEdit() {
|
|||||||
projOwnerName: res.projOwnerName,//著作权人姓名
|
projOwnerName: res.projOwnerName,//著作权人姓名
|
||||||
projOwnerIdentity: res.projOwnerIdentity,//著作权人证件号
|
projOwnerIdentity: res.projOwnerIdentity,//著作权人证件号
|
||||||
projOwnerId: res.projOwnerId,//著作权人信息ID
|
projOwnerId: res.projOwnerId,//著作权人信息ID
|
||||||
|
getFile: res.getFile,//获取文件
|
||||||
})
|
})
|
||||||
setFilesInfo({
|
setFilesInfo({
|
||||||
sourceCodeDocFile: res.sourceCodeDocFile,//源码
|
sourceCodeDocFile: res.sourceCodeDocFile,//源码
|
||||||
softwareDocFile: res.softwareDocFile,//软件
|
softwareDocFile: res.softwareDocFile,//软件
|
||||||
})
|
})
|
||||||
setEditProcess(Number(res.appOrderProgress) + 1)
|
setEditProcess(Number(res.appOrderProgress) + 1)
|
||||||
|
// const fileres: any = await fileDetail(res.getFile)
|
||||||
|
// console.log('文件详情', fileres);
|
||||||
|
|
||||||
|
// setFileList([
|
||||||
|
// {
|
||||||
|
// uid: fileres[0].fileId,
|
||||||
|
// name: fileres[0].fileName,
|
||||||
|
// status: 'done',
|
||||||
|
// url: showImage(fileres[0].fileId)
|
||||||
|
// }
|
||||||
|
// ])
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
|
|
||||||
@ -196,9 +217,9 @@ export default function AppEdit() {
|
|||||||
getRunSystemList()
|
getRunSystemList()
|
||||||
getBigClassList()
|
getBigClassList()
|
||||||
|
|
||||||
if (appInfo.bigClassify) {
|
// if (appInfo.bigClassify) {
|
||||||
getSmallClassList(appInfo.bigClassify)
|
// getSmallClassList(appInfo.bigClassify)
|
||||||
}
|
// }
|
||||||
}, []);
|
}, []);
|
||||||
const height = window.innerHeight - 180;
|
const height = window.innerHeight - 180;
|
||||||
return (
|
return (
|
||||||
@ -327,8 +348,14 @@ export default function AppEdit() {
|
|||||||
appOrderId={appOrderId}
|
appOrderId={appOrderId}
|
||||||
bigClass={bigClass}
|
bigClass={bigClass}
|
||||||
systemList={systemList}
|
systemList={systemList}
|
||||||
smallClass={smallClass}
|
// smallClass={smallClass}
|
||||||
|
// fileList={fileList}
|
||||||
appInfo={appInfo}
|
appInfo={appInfo}
|
||||||
|
setAppInfo={
|
||||||
|
(val: any) => {
|
||||||
|
setAppInfo(val)
|
||||||
|
}
|
||||||
|
}
|
||||||
setEditProcess={
|
setEditProcess={
|
||||||
(num: number) => {
|
(num: number) => {
|
||||||
setEditProcess(num)
|
setEditProcess(num)
|
||||||
@ -346,6 +373,11 @@ export default function AppEdit() {
|
|||||||
<EditAppFiles
|
<EditAppFiles
|
||||||
appOrderId={appOrderId}
|
appOrderId={appOrderId}
|
||||||
filesInfo={filesInfo}
|
filesInfo={filesInfo}
|
||||||
|
setFilesInfo={
|
||||||
|
(val: any) => {
|
||||||
|
setFilesInfo(val)
|
||||||
|
}
|
||||||
|
}
|
||||||
setEditProcess={
|
setEditProcess={
|
||||||
(num: number) => {
|
(num: number) => {
|
||||||
setEditProcess(num)
|
setEditProcess(num)
|
||||||
|
@ -21,6 +21,8 @@ interface DataType {
|
|||||||
appOrderPayMoney: number; //支付金额;
|
appOrderPayMoney: number; //支付金额;
|
||||||
appOrderPayTime: string; //支付时间;
|
appOrderPayTime: string; //支付时间;
|
||||||
gmtCreate: string;
|
gmtCreate: string;
|
||||||
|
bigClassifyName: string; //软件分类(大类)
|
||||||
|
subClassifyName: string; //软件分类(子类)
|
||||||
}
|
}
|
||||||
export default function AppElectron() {
|
export default function AppElectron() {
|
||||||
const nav = useNavigate();
|
const nav = useNavigate();
|
||||||
@ -33,12 +35,14 @@ export default function AppElectron() {
|
|||||||
dataIndex: 'index',
|
dataIndex: 'index',
|
||||||
key: 'index',
|
key: 'index',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
fixed: 'left',
|
||||||
width: 90,
|
width: 90,
|
||||||
render: (_text, _record, index) => (page - 1) * 10 + index + 1, // 显示序号,从1开始
|
render: (_text, _record, index) => (page - 1) * 10 + index + 1, // 显示序号,从1开始
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '项目名称',
|
title: '项目名称',
|
||||||
|
fixed: 'left',
|
||||||
dataIndex: 'appName',
|
dataIndex: 'appName',
|
||||||
key: 'appOrderId',
|
key: 'appOrderId',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
@ -58,13 +62,13 @@ export default function AppElectron() {
|
|||||||
dataIndex: 'bigClassify',
|
dataIndex: 'bigClassify',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
key: 'appOrderId',
|
key: 'appOrderId',
|
||||||
width: 120,
|
width: 200,
|
||||||
ellipsis: {
|
ellipsis: {
|
||||||
showTitle: true,
|
showTitle: true,
|
||||||
},
|
},
|
||||||
render: (text) => (
|
render: (text, record) => (
|
||||||
<span>
|
<span>
|
||||||
{text ? text : '未完善'}
|
{text ? ` ${record.bigClassifyName} / ${record.subClassifyName}` : '未完善'}
|
||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
@ -117,11 +121,15 @@ export default function AppElectron() {
|
|||||||
// dataIndex: 'contractManagementId',
|
// dataIndex: 'contractManagementId',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
key: 'appOrderId',
|
key: 'appOrderId',
|
||||||
width: 80,
|
width: 200,
|
||||||
|
// bordeLeft: true,
|
||||||
|
fixed: 'right',
|
||||||
render: (record) => (
|
render: (record) => (
|
||||||
<div style={{
|
<div style={{
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
color: '#007FFF',
|
color: '#007FFF',
|
||||||
|
|
||||||
|
|
||||||
}} onClick={() => {
|
}} onClick={() => {
|
||||||
nav(`/app-edit/${record.appOrderId}`)
|
nav(`/app-edit/${record.appOrderId}`)
|
||||||
// console.log(record);
|
// console.log(record);
|
||||||
@ -136,8 +144,8 @@ export default function AppElectron() {
|
|||||||
const height = window.innerHeight - 180;
|
const height = window.innerHeight - 180;
|
||||||
const { state } = useLocation()
|
const { state } = useLocation()
|
||||||
const keywords = state ? state.appKeyWords : ''
|
const keywords = state ? state.appKeyWords : ''
|
||||||
const checkStatus = state? state.checkStatus : ''
|
const checkStatus = state ? state.checkStatus : ''
|
||||||
const appOrderStatus = state? state.appOrderStatus : ''
|
const appOrderStatus = state ? state.appOrderStatus : ''
|
||||||
const [page, setPage] = useState(1);
|
const [page, setPage] = useState(1);
|
||||||
// const [total, setTotal] = useState(0);
|
// const [total, setTotal] = useState(0);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
@ -146,7 +154,7 @@ export default function AppElectron() {
|
|||||||
const getAppOrderList = async (page: number) => {
|
const getAppOrderList = async (page: number) => {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
const res: any = await appOrderList({ page, keywords, rows: 10,checkStatus,appOrderStatus })
|
const res: any = await appOrderList({ page, keywords, rows: 10, checkStatus, appOrderStatus })
|
||||||
// console.log(res);
|
// console.log(res);
|
||||||
// setData(res.rows)
|
// setData(res.rows)
|
||||||
// setTotal(res.total)
|
// setTotal(res.total)
|
||||||
@ -174,7 +182,7 @@ export default function AppElectron() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setPage(1)
|
setPage(1)
|
||||||
getAppOrderList(1)
|
getAppOrderList(1)
|
||||||
}, [state,checkStatus,appOrderStatus])
|
}, [state, checkStatus, appOrderStatus])
|
||||||
return (
|
return (
|
||||||
|
|
||||||
<div className='appElectionBox' style={{ height: `${height}px` }}>
|
<div className='appElectionBox' style={{ height: `${height}px` }}>
|
||||||
@ -210,6 +218,7 @@ export default function AppElectron() {
|
|||||||
scroll={{ y: `${height - 150}px` }}
|
scroll={{ y: `${height - 150}px` }}
|
||||||
dataSource={data.rows}
|
dataSource={data.rows}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
bordered
|
||||||
// pagination={{
|
// pagination={{
|
||||||
// defaultPageSize: 10, // 设置默认一页显示 5 条数据
|
// defaultPageSize: 10, // 设置默认一页显示 5 条数据
|
||||||
// }}
|
// }}
|
||||||
|
@ -154,15 +154,43 @@ export default function AppCompany(props: any) {
|
|||||||
form.submit();
|
form.submit();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
function deepCompareObjects(obj1: any, obj2: any): boolean {
|
||||||
|
// 若两个值严格相等,直接返回 true
|
||||||
|
if (obj1 === obj2) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 若其中一个值为 null 或不是对象类型,返回 false
|
||||||
|
if (typeof obj1 !== 'object' || obj1 === null || typeof obj2 !== 'object' || obj2 === null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取两个对象的键数组
|
||||||
|
const keys1 = Object.keys(obj1);
|
||||||
|
const keys2 = Object.keys(obj2);
|
||||||
|
|
||||||
|
// 若键的数量不同,返回 false
|
||||||
|
if (keys1.length !== keys2.length) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 遍历键,递归比较对应的值
|
||||||
|
for (const key of keys1) {
|
||||||
|
if (!keys2.includes(key) || !deepCompareObjects(obj1[key], obj2[key])) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
const onFinish = async (values: any) => {
|
const onFinish = async (values: any) => {
|
||||||
// 处理表单提交逻辑
|
// 处理表单提交逻辑
|
||||||
// console.log('表单提交成功', values);
|
// console.log('表单提交成功', values);
|
||||||
// console.log('发过来的数据', props.companyInfo);
|
// console.log('发过来的数据', props.companyInfo);
|
||||||
if (JSON.stringify(values) !== JSON.stringify(props.companyInfo)) {
|
if (!deepCompareObjects(values, props.companyInfo)) {
|
||||||
try {
|
try {
|
||||||
setDownLoading(true)
|
setDownLoading(true)
|
||||||
const res = await companyAuth(props.appOrderId, {
|
await companyAuth(props.appOrderId, {
|
||||||
appOrderId: props.appOrderId,
|
appOrderId: props.appOrderId,
|
||||||
...values
|
...values
|
||||||
})
|
})
|
||||||
@ -171,7 +199,7 @@ export default function AppCompany(props: any) {
|
|||||||
})
|
})
|
||||||
props.setEditProcess(2);
|
props.setEditProcess(2);
|
||||||
setDownLoading(false)
|
setDownLoading(false)
|
||||||
console.log(res);
|
// console.log(res);
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
setDownLoading(false)
|
setDownLoading(false)
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
@ -186,7 +214,7 @@ export default function AppCompany(props: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
props.setEditProcess(2);
|
props.setEditProcess(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,9 +222,9 @@ export default function AppCompany(props: any) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('认证数据', props.companyInfo);
|
// console.log('认证数据', props.companyInfo);
|
||||||
if (props.companyInfo.companyName) {
|
if (props.companyInfo.companyName) {
|
||||||
console.log('嘻嘻');
|
// console.log('嘻嘻');
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
companyName: props.companyInfo.companyName,
|
companyName: props.companyInfo.companyName,
|
||||||
companyNumber: props.companyInfo.companyNumber,
|
companyNumber: props.companyInfo.companyNumber,
|
||||||
@ -356,7 +384,7 @@ export default function AppCompany(props: any) {
|
|||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
// alert('下载授权书')
|
// alert('下载授权书')
|
||||||
if (form.getFieldValue('companyName')) {
|
if (form.getFieldValue('companyName')) {
|
||||||
// console.log(form.getFieldValue('companyName'));
|
try {
|
||||||
setDownLoading(true)
|
setDownLoading(true)
|
||||||
const res: any = await authorizeWord(
|
const res: any = await authorizeWord(
|
||||||
props.appOrderId,
|
props.appOrderId,
|
||||||
@ -364,7 +392,22 @@ export default function AppCompany(props: any) {
|
|||||||
)
|
)
|
||||||
setDownLoading(false)
|
setDownLoading(false)
|
||||||
window.open(showImage(res.fileId, false));
|
window.open(showImage(res.fileId, false));
|
||||||
console.log(res);
|
} catch (error: any) {
|
||||||
|
setDownLoading(false)
|
||||||
|
if (error.response) {
|
||||||
|
const data = error.response.data;
|
||||||
|
messageApi.open({
|
||||||
|
type: 'error',
|
||||||
|
content: data.msg ? data.msg : `${data.path}(${data.status})`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
setDownLoading(false)
|
||||||
|
}
|
||||||
|
// console.log(form.getFieldValue('companyName'));
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
message.error('请完善企业/机构名称')
|
message.error('请完善企业/机构名称')
|
||||||
|
@ -1,15 +1,64 @@
|
|||||||
import { useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { Button, Form, Upload, message, Modal } from "antd"
|
import { Button, Form, Upload, message, Modal, Spin } from "antd"
|
||||||
import { uploadFileUrl } from '../../../../request/request'
|
import { uploadFileUrl, showImage } from '../../../../request/request'
|
||||||
import { UploadOutlined } from '@ant-design/icons';
|
import { UploadOutlined } from '@ant-design/icons';
|
||||||
|
import { sourceCodeWord, softwareDocumentWord, uploadMaterial, fileDetail } from '../../../../request/api'
|
||||||
import './edit-app-files.css'
|
import './edit-app-files.css'
|
||||||
export default function EditAppFiles(props: any) {
|
export default function EditAppFiles(props: any) {
|
||||||
|
const [messageApi, contextHolder] = message.useMessage();
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
const downCodeWord = async () => {
|
||||||
|
try {
|
||||||
|
setLoading(true)
|
||||||
|
const res: any = await sourceCodeWord(props.appOrderId)
|
||||||
|
window.open(showImage(res.fileId, false));
|
||||||
|
setLoading(false)
|
||||||
|
|
||||||
|
} catch (error: any) {
|
||||||
|
setLoading(false)
|
||||||
|
if (error.response) {
|
||||||
|
const data = error.response.data;
|
||||||
|
messageApi.open({
|
||||||
|
type: 'error',
|
||||||
|
content: data.msg ? data.msg : `${data.path}(${data.status})`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
const downSoftWord = async () => {
|
||||||
|
try {
|
||||||
|
setLoading(true)
|
||||||
|
const res: any = await softwareDocumentWord(props.appOrderId)
|
||||||
|
setLoading(false)
|
||||||
|
|
||||||
|
window.open(showImage(res.fileId, false));
|
||||||
|
|
||||||
|
} catch (error: any) {
|
||||||
|
setLoading(false)
|
||||||
|
if (error.response) {
|
||||||
|
const data = error.response.data;
|
||||||
|
messageApi.open({
|
||||||
|
type: 'error',
|
||||||
|
content: data.msg ? data.msg : `${data.path}(${data.status})`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
// 源码文档弹窗
|
// 源码文档弹窗
|
||||||
const [codeVisible, setCodeVisible] = useState(false)
|
const [codeVisible, setCodeVisible] = useState(false)
|
||||||
// 软件文档弹窗
|
// 软件文档弹窗
|
||||||
const [softVisible, setSoftVisible] = useState(false)
|
const [softVisible, setSoftVisible] = useState(false)
|
||||||
// 定义允许上传的文件格式
|
// 定义允许上传的文件格式
|
||||||
const ALLOWED_FILE_TYPES = ['.pdf', '.doc', '.docx', '.jpg', '.jpeg', '.png'];
|
const ALLOWED_FILE_TYPES = ['.pdf'];
|
||||||
const beforeUpload = (file: File) => {
|
const beforeUpload = (file: File) => {
|
||||||
const fileExt = file.name.slice(file.name.lastIndexOf('.')).toLowerCase();
|
const fileExt = file.name.slice(file.name.lastIndexOf('.')).toLowerCase();
|
||||||
if (!ALLOWED_FILE_TYPES.includes(fileExt)) {
|
if (!ALLOWED_FILE_TYPES.includes(fileExt)) {
|
||||||
@ -26,57 +75,69 @@ export default function EditAppFiles(props: any) {
|
|||||||
};
|
};
|
||||||
// 上传文件源码文档列表
|
// 上传文件源码文档列表
|
||||||
const [upCodeArray, setUpCodeArray] = useState<any>([])
|
const [upCodeArray, setUpCodeArray] = useState<any>([])
|
||||||
const [codeDis, setCodeDis] = useState(false)
|
// const [codeDis, setCodeDis] = useState(false)
|
||||||
const validateCodeFileUpload = (_rule: any, value: any) => {
|
const isUploading = upCodeArray.some((file: any) => file.status === 'uploading');
|
||||||
if (!value || value.fileList.length === 0) {
|
const validateCodeFileUpload = () => {
|
||||||
return Promise.reject('请选择上传文件');
|
// if (!value || value.fileList.length === 0) {
|
||||||
|
// return Promise.reject('请选择上传文件');
|
||||||
|
|
||||||
}
|
// }
|
||||||
const file = value.fileList[0];
|
// const file = value.fileList[0];
|
||||||
if (file.status === 'uploading') {
|
// if (file.status === 'uploading') {
|
||||||
setCodeDis(true)
|
// return Promise.reject('文件上传中,请稍候');
|
||||||
return Promise.reject('文件上传中,请稍候');
|
// } else if (file.status === 'error') {
|
||||||
} else if (file.status === 'error') {
|
// setUpCodeArray([])
|
||||||
setCodeDis(true)
|
// return Promise.reject('文件上传失败,请删除后重新上传');
|
||||||
setUpCodeArray([])
|
|
||||||
return Promise.reject('文件上传失败,请删除后重新上传');
|
|
||||||
|
|
||||||
} else if (file.status !== 'done') {
|
// } else if (file.status !== 'done') {
|
||||||
setCodeDis(true)
|
// setUpCodeArray([])
|
||||||
setUpCodeArray([])
|
|
||||||
|
|
||||||
return Promise.reject('文件上传失败,请删除后重新上传');
|
// return Promise.reject('文件上传失败,请删除后重新上传');
|
||||||
} else if (file.status === 'done') {
|
// } else if (file.status === 'done') {
|
||||||
setCodeDis(true)
|
// return Promise.resolve();
|
||||||
return Promise.resolve();
|
// }
|
||||||
|
// return Promise.resolve();
|
||||||
|
|
||||||
|
|
||||||
|
// 若开发方式为合作开发且未上传文件,则验证失败
|
||||||
|
if ((upCodeArray.length === 0 || isUploading)) {
|
||||||
|
const errorMessage = isUploading ? '文件正在上传中,请等待上传完成' : '请上传源码文档';
|
||||||
|
return Promise.reject(new Error(errorMessage));
|
||||||
}
|
}
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
};
|
};
|
||||||
// 上传文件软件文档列表
|
// 上传文件软件文档列表
|
||||||
const [upSoftArray, setUpSoftArray] = useState<any>([])
|
const [upSoftArray, setUpSoftArray] = useState<any>([])
|
||||||
const [softDis, setSoftDis] = useState(false)
|
const upLodaing = upSoftArray.some((file: any) => file.status === 'uploading');
|
||||||
const validateSoftFileUpload = (_rule: any, value: any) => {
|
|
||||||
if (!value || value.fileList.length === 0) {
|
|
||||||
return Promise.reject('请选择上传文件');
|
|
||||||
|
|
||||||
}
|
// const [softDis, setSoftDis] = useState(false)
|
||||||
const file = value.fileList[0];
|
const validateSoftFileUpload = () => {
|
||||||
if (file.status === 'uploading') {
|
// if (!value || value.fileList.length === 0) {
|
||||||
setSoftDis(true)
|
// return Promise.reject('请选择上传文件');
|
||||||
return Promise.reject('文件上传中,请稍候');
|
|
||||||
} else if (file.status === 'error') {
|
|
||||||
setSoftDis(true)
|
|
||||||
setUpSoftArray([])
|
|
||||||
return Promise.reject('文件上传失败,请删除后重新上传');
|
|
||||||
|
|
||||||
} else if (file.status !== 'done') {
|
// }
|
||||||
setSoftDis(true)
|
// const file = value.fileList[0];
|
||||||
setUpSoftArray([])
|
// if (file.status === 'uploading') {
|
||||||
|
// setSoftDis(true)
|
||||||
|
// return Promise.reject('文件上传中,请稍候');
|
||||||
|
// } else if (file.status === 'error') {
|
||||||
|
// setSoftDis(true)
|
||||||
|
// setUpSoftArray([])
|
||||||
|
// return Promise.reject('文件上传失败,请删除后重新上传');
|
||||||
|
|
||||||
return Promise.reject('文件上传失败,请删除后重新上传');
|
// } else if (file.status !== 'done') {
|
||||||
} else if (file.status === 'done') {
|
// setSoftDis(true)
|
||||||
setSoftDis(true)
|
// setUpSoftArray([])
|
||||||
return Promise.resolve();
|
|
||||||
|
// return Promise.reject('文件上传失败,请删除后重新上传');
|
||||||
|
// } else if (file.status === 'done') {
|
||||||
|
// setSoftDis(true)
|
||||||
|
// return Promise.resolve();
|
||||||
|
// }
|
||||||
|
// return Promise.resolve();
|
||||||
|
if ((upSoftArray.length === 0 || upLodaing)) {
|
||||||
|
const errorMessage = upLodaing ? '文件正在上传中,请等待上传完成' : '请上传软件文档';
|
||||||
|
return Promise.reject(new Error(errorMessage));
|
||||||
}
|
}
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
};
|
};
|
||||||
@ -86,27 +147,150 @@ export default function EditAppFiles(props: any) {
|
|||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
// console.log(form);
|
// console.log(form);
|
||||||
props.setEditProcess(4);
|
// props.setEditProcess(4);
|
||||||
// 调用表单实例的 submit 方法
|
// 调用表单实例的 submit 方法
|
||||||
form.submit();
|
form.submit();
|
||||||
|
|
||||||
};
|
};
|
||||||
const submitInfo = (values: any) => {
|
function deepCompareObjects(obj1: any, obj2: any): boolean {
|
||||||
message.success('提交成功');
|
// 若两个值严格相等,直接返回 true
|
||||||
console.log(values);
|
if (obj1 === obj2) {
|
||||||
props.setEditProcess(3);
|
return true;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
const onFinish = (values: any) => {
|
|
||||||
|
// 若其中一个值为 null 或不是对象类型,返回 false
|
||||||
|
if (typeof obj1 !== 'object' || obj1 === null || typeof obj2 !== 'object' || obj2 === null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取两个对象的键数组
|
||||||
|
const keys1 = Object.keys(obj1);
|
||||||
|
const keys2 = Object.keys(obj2);
|
||||||
|
|
||||||
|
// 若键的数量不同,返回 false
|
||||||
|
if (keys1.length !== keys2.length) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 遍历键,递归比较对应的值
|
||||||
|
for (const key of keys1) {
|
||||||
|
if (!keys2.includes(key) || !deepCompareObjects(obj1[key], obj2[key])) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
const onFinish = async (values: any) => {
|
||||||
// 处理表单提交逻辑
|
// 处理表单提交逻辑
|
||||||
console.log('表单提交成功', values);
|
// console.log('表单提交成功', values);
|
||||||
submitInfo(values)
|
// submitInfo(values)
|
||||||
console.log(upCodeArray);
|
// console.log(upCodeArray);
|
||||||
|
// deepCompareObjects(values, props.filesInfo)
|
||||||
|
// console.log(!deepCompareObjects(values, props.filesInfo));
|
||||||
|
// return
|
||||||
|
if (!deepCompareObjects(values, props.filesInfo)) {
|
||||||
|
try {
|
||||||
|
setLoading(true)
|
||||||
|
await uploadMaterial(props.appOrderId, {
|
||||||
|
...values
|
||||||
|
})
|
||||||
|
props.setFilesInfo(
|
||||||
|
{ ...values }
|
||||||
|
)
|
||||||
|
props.setEditProcess(4);
|
||||||
|
|
||||||
|
|
||||||
|
setLoading(false)
|
||||||
|
} catch (error: any) {
|
||||||
|
setLoading(false)
|
||||||
|
if (error.response) {
|
||||||
|
const data = error.response.data;
|
||||||
|
messageApi.open({
|
||||||
|
type: 'error',
|
||||||
|
content: data.msg ? data.msg : `${data.path}(${data.status})`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
props.setEditProcess(4);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
const getCodeFileDetail = async (id: string) => {
|
||||||
|
try {
|
||||||
|
const res: any = await fileDetail(id)
|
||||||
|
console.log('文件详情', res);
|
||||||
|
setUpCodeArray([
|
||||||
|
{
|
||||||
|
uid: res[0].fileId,
|
||||||
|
name: res[0].fileName,
|
||||||
|
status: 'done',
|
||||||
|
url: showImage(res[0].fileId, false)
|
||||||
|
},
|
||||||
|
|
||||||
|
])
|
||||||
|
} catch (error: any) {
|
||||||
|
if (error.response) {
|
||||||
|
const data = error.response.data;
|
||||||
|
messageApi.open({
|
||||||
|
type: 'error',
|
||||||
|
content: data.msg ? data.msg : `${data.path}(${data.status})`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const getSoftFileDetail = async (id: string) => {
|
||||||
|
try {
|
||||||
|
const res: any = await fileDetail(id)
|
||||||
|
console.log('文件详情', res);
|
||||||
|
setUpSoftArray([
|
||||||
|
{
|
||||||
|
uid: res[0].fileId,
|
||||||
|
name: res[0].fileName,
|
||||||
|
status: 'done',
|
||||||
|
url: showImage(res[0].fileId, false)
|
||||||
|
},
|
||||||
|
|
||||||
|
])
|
||||||
|
} catch (error: any) {
|
||||||
|
if (error.response) {
|
||||||
|
const data = error.response.data;
|
||||||
|
messageApi.open({
|
||||||
|
type: 'error',
|
||||||
|
content: data.msg ? data.msg : `${data.path}(${data.status})`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
useEffect(() => {
|
||||||
|
|
||||||
|
if (props.filesInfo.sourceCodeDocFile) {
|
||||||
|
getCodeFileDetail(props.filesInfo.sourceCodeDocFile)
|
||||||
|
}
|
||||||
|
if (props.filesInfo.softwareDocFile) {
|
||||||
|
getSoftFileDetail(props.filesInfo.softwareDocFile)
|
||||||
|
}
|
||||||
|
form.setFieldsValue({
|
||||||
|
sourceCodeDocFile: props.filesInfo.sourceCodeDocFile,
|
||||||
|
softwareDocFile: props.filesInfo.softwareDocFile,
|
||||||
|
})
|
||||||
|
}, [props.filesInfo])
|
||||||
return (
|
return (
|
||||||
|
<Spin tip="加载中..." size="small" spinning={loading}>
|
||||||
<div>
|
<div>
|
||||||
|
{contextHolder}
|
||||||
<div className='bigLine'></div>
|
<div className='bigLine'></div>
|
||||||
<div className='appInfoFormBox' style={{
|
<div className='appInfoFormBox' style={{
|
||||||
height: height,
|
height: height,
|
||||||
@ -140,7 +324,13 @@ export default function EditAppFiles(props: any) {
|
|||||||
width: '600px',
|
width: '600px',
|
||||||
// background: 'pink'
|
// background: 'pink'
|
||||||
}}>
|
}}>
|
||||||
<div>
|
<div style={{
|
||||||
|
// background:'pink',
|
||||||
|
position: 'relative',
|
||||||
|
// width: '260px',
|
||||||
|
height: '90px',
|
||||||
|
lineHeight: '40px',
|
||||||
|
}}>
|
||||||
<div className='appInfoFormInput' style={{
|
<div className='appInfoFormInput' style={{
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
}}>
|
}}>
|
||||||
@ -149,22 +339,50 @@ export default function EditAppFiles(props: any) {
|
|||||||
<div style={{
|
<div style={{
|
||||||
width: '220px',
|
width: '220px',
|
||||||
}}>
|
}}>
|
||||||
<Form.Item name="ym" label="" rules={[
|
<Form.Item name="sourceCodeDocFile" label="" rules={[
|
||||||
// { required: true, message: '请选上传文件' },
|
// { required: true, message: '请选上传文件' },
|
||||||
{ validator: validateCodeFileUpload }
|
{ validator: validateCodeFileUpload }
|
||||||
]}>
|
]}>
|
||||||
<Upload
|
<Upload
|
||||||
name="file"
|
name="file"
|
||||||
action={uploadFileUrl()}
|
action={uploadFileUrl()}
|
||||||
defaultFileList={upCodeArray}
|
fileList={upCodeArray}
|
||||||
onChange={({ fileList }) => {
|
onChange={(info) => {
|
||||||
console.log(fileList);
|
const { fileList } = info;
|
||||||
|
setUpCodeArray(fileList);
|
||||||
|
if (info.file.status === 'uploading') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (info.file.status === 'done') {
|
||||||
|
// console.log(info.file.response.data);
|
||||||
|
setUpCodeArray([
|
||||||
|
{
|
||||||
|
uid: info.file.response.data.fileId,
|
||||||
|
name: info.file.response.data.fileName,
|
||||||
|
status: 'done',
|
||||||
|
url: showImage(info.file.response.data.fileId, false)
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
form.setFieldsValue({
|
||||||
|
sourceCodeDocFile: info.file.response.data.fileId,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (info.file.status === 'error') {
|
||||||
|
// 显示错误提示
|
||||||
|
message.error(`上传失败`);
|
||||||
|
form.setFieldsValue({
|
||||||
|
sourceCodeDocFile: '', // 清除表单值
|
||||||
|
});
|
||||||
|
}
|
||||||
// console.log(upCodeArray);
|
// console.log(upCodeArray);
|
||||||
|
|
||||||
}}
|
}}
|
||||||
onRemove={() => {
|
onRemove={() => {
|
||||||
setUpCodeArray([])
|
setUpCodeArray([])
|
||||||
setCodeDis(false)
|
form.setFieldsValue({
|
||||||
|
sourceCodeDocFile: '', // 清除表单值
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
beforeUpload={beforeUpload}
|
beforeUpload={beforeUpload}
|
||||||
onPreview={handlePreview}
|
onPreview={handlePreview}
|
||||||
@ -174,27 +392,41 @@ export default function EditAppFiles(props: any) {
|
|||||||
<Button icon={<UploadOutlined />} style={{
|
<Button icon={<UploadOutlined />} style={{
|
||||||
marginTop: '4px'
|
marginTop: '4px'
|
||||||
}}
|
}}
|
||||||
disabled={codeDis}
|
disabled={upCodeArray.length > 0}
|
||||||
>上传附件</Button>
|
>上传附件</Button>
|
||||||
</Upload>
|
</Upload>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</div>
|
</div>
|
||||||
<a style={{
|
<a style={{
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top: '10px',
|
// top: '10px',
|
||||||
left: '260px',
|
left: '260px',
|
||||||
textWrap: 'nowrap'
|
textWrap: 'nowrap'
|
||||||
}}>[ 下载 ]</a>
|
}}
|
||||||
|
onClick={
|
||||||
|
downCodeWord
|
||||||
|
}
|
||||||
|
>[ 下载1 ]</a>
|
||||||
</div>
|
</div>
|
||||||
<a style={{
|
<a style={{
|
||||||
marginLeft: 58,
|
marginLeft: 58,
|
||||||
|
display: 'block',
|
||||||
|
position: 'absolute',
|
||||||
|
// background:'red',
|
||||||
|
top: '80px',
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setCodeVisible(true)
|
setCodeVisible(true)
|
||||||
}}
|
}}
|
||||||
>《应用软件源程序提交注意事项及相关规范》</a>
|
>《应用软件源程序提交注意事项及相关规范》</a>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div style={{
|
||||||
|
// background:'pink',
|
||||||
|
position: 'relative',
|
||||||
|
// width: '260px',
|
||||||
|
height: '90px',
|
||||||
|
lineHeight: '40px',
|
||||||
|
}}>
|
||||||
<div className='appInfoFormInput' style={{
|
<div className='appInfoFormInput' style={{
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
}}>
|
}}>
|
||||||
@ -203,20 +435,50 @@ export default function EditAppFiles(props: any) {
|
|||||||
<div style={{
|
<div style={{
|
||||||
width: '220px',
|
width: '220px',
|
||||||
}}>
|
}}>
|
||||||
<Form.Item name="file" label="" rules={[
|
<Form.Item name="softwareDocFile" label="" rules={[
|
||||||
// { required: true, message: '请上传文件' },
|
// { required: true, message: '请上传文件' },
|
||||||
{ validator: validateSoftFileUpload }
|
{ validator: validateSoftFileUpload }
|
||||||
]}>
|
]}>
|
||||||
<Upload
|
<Upload
|
||||||
name="file"
|
name="file"
|
||||||
action={uploadFileUrl()}
|
action={uploadFileUrl()}
|
||||||
defaultFileList={upSoftArray}
|
fileList={upSoftArray}
|
||||||
onChange={({ fileList }) => {
|
onChange={(info) => {
|
||||||
console.log(fileList);
|
const { fileList } = info;
|
||||||
|
setUpSoftArray(fileList);
|
||||||
|
if (info.file.status === 'uploading') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (info.file.status === 'done') {
|
||||||
|
// console.log(info.file.response.data);
|
||||||
|
setUpSoftArray([
|
||||||
|
{
|
||||||
|
uid: info.file.response.data.fileId,
|
||||||
|
name: info.file.response.data.fileName,
|
||||||
|
status: 'done',
|
||||||
|
url: showImage(info.file.response.data.fileId, false)
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
form.setFieldsValue({
|
||||||
|
softwareDocFile: info.file.response.data.fileId,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (info.file.status === 'error') {
|
||||||
|
// 显示错误提示
|
||||||
|
message.error(`上传失败`);
|
||||||
|
form.setFieldsValue({
|
||||||
|
softwareDocFile: '', // 清除表单值
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}}
|
}}
|
||||||
onRemove={() => {
|
onRemove={() => {
|
||||||
setUpSoftArray([])
|
setUpSoftArray([])
|
||||||
setSoftDis(false)
|
form.setFieldsValue({
|
||||||
|
softwareDocFile: '', // 清除表单值
|
||||||
|
});
|
||||||
|
// setSoftDis(false)
|
||||||
}}
|
}}
|
||||||
beforeUpload={beforeUpload}
|
beforeUpload={beforeUpload}
|
||||||
// onChange={handleUploadChange}
|
// onChange={handleUploadChange}
|
||||||
@ -225,7 +487,7 @@ export default function EditAppFiles(props: any) {
|
|||||||
<Button icon={<UploadOutlined />} style={{
|
<Button icon={<UploadOutlined />} style={{
|
||||||
marginTop: '4px'
|
marginTop: '4px'
|
||||||
}}
|
}}
|
||||||
disabled={softDis}
|
disabled={upSoftArray.length > 0}
|
||||||
>上传附件</Button>
|
>上传附件</Button>
|
||||||
</Upload>
|
</Upload>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
@ -235,11 +497,16 @@ export default function EditAppFiles(props: any) {
|
|||||||
top: '10px',
|
top: '10px',
|
||||||
left: '260px',
|
left: '260px',
|
||||||
textWrap: 'nowrap'
|
textWrap: 'nowrap'
|
||||||
}}>[ 下载 ]</a>
|
}}
|
||||||
|
onClick={downSoftWord}
|
||||||
|
>[ 下载 ]</a>
|
||||||
</div>
|
</div>
|
||||||
<a style={{
|
<a style={{
|
||||||
// background: 'red',
|
marginLeft: 58,
|
||||||
marginLeft: 58
|
display: 'block',
|
||||||
|
position: 'absolute',
|
||||||
|
// background:'red',
|
||||||
|
top: '80px',
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setSoftVisible(true)
|
setSoftVisible(true)
|
||||||
@ -426,6 +693,7 @@ export default function EditAppFiles(props: any) {
|
|||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</Spin>
|
||||||
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,80 @@
|
|||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import BelongPeople from '../../../../components/BelongPeople/BelongPeople.tsx'
|
import BelongPeople from '../../../../components/BelongPeople/BelongPeople.tsx'
|
||||||
import { Button, Form, Input, message, Select, Modal, DatePicker, Upload } from "antd"
|
import { Button, Form, Input, message, Select, Modal, DatePicker, Upload, Spin } from "antd"
|
||||||
import { UploadOutlined } from '@ant-design/icons';
|
import { UploadOutlined } from '@ant-design/icons';
|
||||||
import { uploadFileUrl } from '../../../../request/request'
|
import { uploadFileUrl, showImage } from '../../../../request/request'
|
||||||
|
import { twoClass, agreementWord, softwareInfo, fileDetail } from '../../../../request/api'
|
||||||
import './edit-app-info.css'
|
import './edit-app-info.css'
|
||||||
import locale from 'antd/es/date-picker/locale/zh_CN';
|
import locale from 'antd/es/date-picker/locale/zh_CN';
|
||||||
|
import dayjs, { } from 'dayjs';
|
||||||
export default function EditAppInfo(props: any) {
|
export default function EditAppInfo(props: any) {
|
||||||
|
const [downLoading, setDownLoading] = useState(false)
|
||||||
|
const [messageApi, contextHolder] = message.useMessage();
|
||||||
|
// const [upFileId, setUpFileId] = useState('') //上传文件id
|
||||||
|
// const [upFileName, setUpFileName] = useState('') //上传文件名称
|
||||||
|
// 大类
|
||||||
|
const [bigClass, setBigClass] = useState('')
|
||||||
|
// 小类
|
||||||
|
const [smallClassList, setSmallClassList] = useState([])
|
||||||
|
// 获取小类
|
||||||
|
const getSmallClassList = async (id: string) => {
|
||||||
|
try {
|
||||||
|
const res: any = await twoClass(id)
|
||||||
|
console.log(res);
|
||||||
|
setSmallClassList(res.map((item: any) => {
|
||||||
|
return {
|
||||||
|
label: item.dataName,
|
||||||
|
value: item.dataId,
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
} catch (error: any) {
|
||||||
|
|
||||||
|
if (error.response) {
|
||||||
|
const data = error.response.data;
|
||||||
|
messageApi.open({
|
||||||
|
type: 'error',
|
||||||
|
content: data.msg ? data.msg : `${data.path}(${data.status})`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
useEffect(() => {
|
||||||
|
if (bigClass) {
|
||||||
|
// 获取小类
|
||||||
|
getSmallClassList(bigClass)
|
||||||
|
}
|
||||||
|
}, [bigClass])
|
||||||
|
const [upSoftArray, setUpSoftArray] = useState<any>([
|
||||||
|
// {
|
||||||
|
// uid: '1',
|
||||||
|
// name: 'example.pdf',
|
||||||
|
// status: 'done',
|
||||||
|
// url: 'http://gips3.baidu.com/it/u=3886271102,3123389489&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960'
|
||||||
|
// },
|
||||||
|
])
|
||||||
|
// 检查是否存在上传中的文件
|
||||||
|
const isUploading = upSoftArray.some((file: any) => file.status === 'uploading');
|
||||||
|
const validateFileUpload = () => {
|
||||||
|
// if (upSoftArray.length == 0) {
|
||||||
|
// return Promise.reject(new Error('请上传合作协议'));
|
||||||
|
// }
|
||||||
|
// return Promise.resolve();
|
||||||
|
const values = form.getFieldsValue();
|
||||||
|
const developWay = values.developWay;
|
||||||
|
|
||||||
|
// 若开发方式为合作开发且未上传文件,则验证失败
|
||||||
|
if (developWay === '合作开发' && (upSoftArray.length === 0 || isUploading)) {
|
||||||
|
const errorMessage = isUploading ? '文件正在上传中,请等待上传完成' : '请上传合作协议';
|
||||||
|
return Promise.reject(new Error(errorMessage));
|
||||||
|
}
|
||||||
|
return Promise.resolve();
|
||||||
|
};
|
||||||
const token = sessionStorage.getItem('token')
|
const token = sessionStorage.getItem('token')
|
||||||
const [upShow, setUpShow] = useState(false) //上传合作协议是否显示
|
const [upShow, setUpShow] = useState(false) //上传合作协议是否显示
|
||||||
// 定义允许上传的文件格式
|
// 定义允许上传的文件格式
|
||||||
const ALLOWED_FILE_TYPES = ['.pdf', '.doc', '.docx', '.jpg', '.jpeg', '.png'];
|
const ALLOWED_FILE_TYPES = ['.pdf',];
|
||||||
const beforeUpload = (file: File) => {
|
const beforeUpload = (file: File) => {
|
||||||
const fileExt = file.name.slice(file.name.lastIndexOf('.')).toLowerCase();
|
const fileExt = file.name.slice(file.name.lastIndexOf('.')).toLowerCase();
|
||||||
if (!ALLOWED_FILE_TYPES.includes(fileExt)) {
|
if (!ALLOWED_FILE_TYPES.includes(fileExt)) {
|
||||||
@ -19,8 +84,7 @@ export default function EditAppInfo(props: any) {
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
// 上传文件软件文档列表
|
// 上传文件软件文档列表
|
||||||
const [upSoftArray, setUpSoftArray] = useState<any>([])
|
// const [softDis, setSoftDis] = useState(false)
|
||||||
const [softDis, setSoftDis] = useState(false)
|
|
||||||
// 所属者弹窗
|
// 所属者弹窗
|
||||||
const [belongModal, setBelongModal] = useState(false)
|
const [belongModal, setBelongModal] = useState(false)
|
||||||
const [belongPeopleInfo, setBelongPeopleInfo] = useState({
|
const [belongPeopleInfo, setBelongPeopleInfo] = useState({
|
||||||
@ -37,39 +101,216 @@ export default function EditAppInfo(props: any) {
|
|||||||
|
|
||||||
const setValue = (value: string) => {
|
const setValue = (value: string) => {
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
belongPeople: value
|
projOwnerName: value
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const submitInfo = (values: any) => {
|
// const submitInfo = (values: any) => {
|
||||||
message.success('提交成功');
|
// message.success('提交成功');
|
||||||
console.log(values);
|
// console.log(values);
|
||||||
props.setEditProcess(2);
|
// props.setEditProcess(2);
|
||||||
|
|
||||||
|
|
||||||
}
|
// }
|
||||||
const height = window.innerHeight - 460;
|
const height = window.innerHeight - 460;
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
|
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
// console.log(form);
|
// console.log(form);
|
||||||
props.setEditProcess(3);
|
// props.setEditProcess(3);
|
||||||
// 调用表单实例的 submit 方法
|
// 调用表单实例的 submit 方法
|
||||||
form.submit();
|
form.submit();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
function deepCompareObjects(obj1: any, obj2: any): boolean {
|
||||||
|
// 若两个值严格相等,直接返回 true
|
||||||
|
if (obj1 === obj2) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
const onFinish = (values: any) => {
|
// 若其中一个值为 null 或不是对象类型,返回 false
|
||||||
|
if (typeof obj1 !== 'object' || obj1 === null || typeof obj2 !== 'object' || obj2 === null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取两个对象的键数组
|
||||||
|
const keys1 = Object.keys(obj1);
|
||||||
|
const keys2 = Object.keys(obj2);
|
||||||
|
|
||||||
|
// 若键的数量不同,返回 false
|
||||||
|
if (keys1.length !== keys2.length) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 遍历键,递归比较对应的值
|
||||||
|
for (const key of keys1) {
|
||||||
|
if (!keys2.includes(key) || !deepCompareObjects(obj1[key], obj2[key])) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
const onFinish = async (values: any) => {
|
||||||
// 处理表单提交逻辑
|
// 处理表单提交逻辑
|
||||||
console.log('表单提交成功', values);
|
console.log('表单提交成功', values);
|
||||||
submitInfo(values)
|
console.log(dayjs(values.completeTime).format('YYYY-MM-DD'));
|
||||||
|
// 给表单赋值 time: dayjs(res.goodsGetTime, 'YYYY-MM-DD'),
|
||||||
|
// submitInfo(values)
|
||||||
|
// 给表单赋值
|
||||||
|
const data = {
|
||||||
|
...values,
|
||||||
|
completeTime: dayjs(values.completeTime).format('YYYY-MM-DD'),
|
||||||
|
projOwnerIdentity: belongPeopleInfo.authorIdCard,//著作权人证件号
|
||||||
|
projOwnerId: belongPeopleInfo.authorId,//著作权人信息ID
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('表单数据', data);
|
||||||
|
console.log('传递数据', props.appInfo);
|
||||||
|
// console.log(JSON.stringify(props.appInfo) == JSON.stringify(data));
|
||||||
|
console.log(deepCompareObjects(props.appInfo, data));
|
||||||
|
|
||||||
|
// console.log(props.appInf == data);
|
||||||
|
// return
|
||||||
|
|
||||||
|
if (!deepCompareObjects(props.appInfo, data)) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
setDownLoading(true)
|
||||||
|
await softwareInfo(props.appOrderId, {
|
||||||
|
// appName: values.appName, // 项目名称
|
||||||
|
// subName: values.subName, // 软件简称
|
||||||
|
// versionName: values.versionName, // 版本号
|
||||||
|
// packageName: values.packageName, // 包名APPID
|
||||||
|
// systemName: values.systemName, // 运行系统
|
||||||
|
// bigClassify: values.bigClassify, // 软件分类(大类)
|
||||||
|
// subClassify: values.subClassify, // 软件分类(小类)
|
||||||
|
// developWay: values.developWay, // 开发方式
|
||||||
|
// completeTime: values.completeTime, // 开发完成时期
|
||||||
|
// projOwnerName: values.projOwnerName,//著作权人姓名
|
||||||
|
...values,
|
||||||
|
completeTime: dayjs(values.completeTime).format('YYYY-MM-DD'),
|
||||||
|
projOwnerIdentity: belongPeopleInfo.authorIdCard,//著作权人证件号
|
||||||
|
projOwnerId: belongPeopleInfo.authorId,//著作权人信息ID
|
||||||
|
appOrderId: props.appOrderId,
|
||||||
|
})
|
||||||
|
props.setAppInfo({
|
||||||
|
...values,
|
||||||
|
completeTime: dayjs(values.completeTime).format('YYYY-MM-DD'),
|
||||||
|
getFile: upShow ? form.getFieldValue('getFile') : '',
|
||||||
|
projOwnerIdentity: belongPeopleInfo.authorIdCard,//著作权人证件号
|
||||||
|
projOwnerId: belongPeopleInfo.authorId,//著作权人信息ID
|
||||||
|
})
|
||||||
|
props.setEditProcess(3);
|
||||||
|
setDownLoading(false)
|
||||||
|
} catch (error: any) {
|
||||||
|
setDownLoading(false)
|
||||||
|
if (error.response) {
|
||||||
|
const data = error.response.data;
|
||||||
|
messageApi.open({
|
||||||
|
type: 'error',
|
||||||
|
content: data.msg ? data.msg : `${data.path}(${data.status})`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
setDownLoading(false)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
props.setEditProcess(3);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
const getFileDetail = async (id: string) => {
|
||||||
|
try {
|
||||||
|
const res: any = await fileDetail(id)
|
||||||
|
// console.log('文件详情', res);
|
||||||
|
setUpSoftArray([
|
||||||
|
{
|
||||||
|
uid: res[0].fileId,
|
||||||
|
name: res[0].fileName,
|
||||||
|
status: 'done',
|
||||||
|
url: showImage(res[0].fileId, false)
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// uid: '1',
|
||||||
|
// name: 'example.pdf',
|
||||||
|
// status: 'done',
|
||||||
|
// url: 'http://gips3.baidu.com/it/u=3886271102,3123389489&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960'
|
||||||
|
// },
|
||||||
|
])
|
||||||
|
} catch (error: any) {
|
||||||
|
if (error.response) {
|
||||||
|
const data = error.response.data;
|
||||||
|
messageApi.open({
|
||||||
|
type: 'error',
|
||||||
|
content: data.msg ? data.msg : `${data.path}(${data.status})`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (props.appInfo.getFile) {
|
||||||
|
console.log('嘻嘻', props.appInfo.getFile);
|
||||||
|
getFileDetail(props.appInfo.getFile)
|
||||||
|
}
|
||||||
|
}, [props.appInfo.getFile])
|
||||||
|
|
||||||
},[props.appInfo])
|
useEffect(() => {
|
||||||
|
console.log('传过来的信息', props);
|
||||||
|
if (props.appInfo.appName) {
|
||||||
|
// setSmallClassList(props.smallClass)
|
||||||
|
form.setFieldsValue({
|
||||||
|
appName: props.appInfo.appName,
|
||||||
|
subName: props.appInfo.subName,
|
||||||
|
versionName: props.appInfo.versionName,
|
||||||
|
packageName: props.appInfo.packageName,
|
||||||
|
systemName: props.appInfo.systemName,
|
||||||
|
bigClassify: props.appInfo.bigClassify,
|
||||||
|
subClassify: props.appInfo.subClassify,
|
||||||
|
developWay: props.appInfo.developWay,
|
||||||
|
// completeTime: props.appInfo.completeTime,
|
||||||
|
completeTime: dayjs(props.appInfo.completeTime, 'YYYY-MM-DD'),
|
||||||
|
projOwnerName: props.appInfo.projOwnerName,
|
||||||
|
getFile: props.appInfo.getFile,
|
||||||
|
})
|
||||||
|
setBelongPeopleInfo(prevState => ({
|
||||||
|
...prevState,
|
||||||
|
authorName: props.appInfo.projOwnerName,
|
||||||
|
authorId: props.appInfo.projOwnerId,
|
||||||
|
authorIdCard: props.appInfo.projOwnerIdentity
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
if (props.appInfo.bigClassify != '') {
|
||||||
|
getSmallClassList(props.appInfo.bigClassify)
|
||||||
|
}
|
||||||
|
if (props.appInfo.developWay == '合作开发') {
|
||||||
|
// setUpSoftArray([
|
||||||
|
// {
|
||||||
|
// uid: '1',
|
||||||
|
// name: 'example.pdf',
|
||||||
|
// status: 'done',
|
||||||
|
// url: 'http://gips3.baidu.com/it/u=3886271102,3123389489&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960'
|
||||||
|
// }
|
||||||
|
// ])
|
||||||
|
// getFileDetail(props.appInfo.getFile)
|
||||||
|
setUpShow(true)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}, [props.appInfo])
|
||||||
return (
|
return (
|
||||||
|
<Spin tip='正在加载,请稍后...' size="small" spinning={downLoading} >
|
||||||
<div className='appInfoBox'>
|
<div className='appInfoBox'>
|
||||||
|
{contextHolder}
|
||||||
<div className='bigLine'></div>
|
<div className='bigLine'></div>
|
||||||
<div className='appInfoFormBox' style={{
|
<div className='appInfoFormBox' style={{
|
||||||
height: height
|
height: height
|
||||||
@ -87,8 +328,8 @@ export default function EditAppInfo(props: any) {
|
|||||||
// background: 'pink'
|
// background: 'pink'
|
||||||
}}>
|
}}>
|
||||||
<div className='appInfoFormInput'>
|
<div className='appInfoFormInput'>
|
||||||
<div className='FormInputTitle'>软件全称<span style={{color:'red',}}>*</span>:</div>
|
<div className='FormInputTitle'>软件全称<span style={{ color: 'red', }}>*</span>:</div>
|
||||||
<Form.Item name="name" label="" rules={[{ required: true, message: '请输入软件全称' },
|
<Form.Item name="appName" label="" rules={[{ required: true, message: '请输入软件全称' },
|
||||||
|
|
||||||
]}>
|
]}>
|
||||||
<Input
|
<Input
|
||||||
@ -121,8 +362,8 @@ export default function EditAppInfo(props: any) {
|
|||||||
width: '900px',
|
width: '900px',
|
||||||
}}>
|
}}>
|
||||||
<div className='appInfoFormInput'>
|
<div className='appInfoFormInput'>
|
||||||
<div className='FormInputTitle'>版本号<span style={{color:'red',}}>*</span>:</div>
|
<div className='FormInputTitle'>版本号<span style={{ color: 'red', }}>*</span>:</div>
|
||||||
<Form.Item name="vnum" label="" rules={[{ required: true, message: '请输入版本号' },
|
<Form.Item name="versionName" label="" rules={[{ required: true, message: '请输入版本号' },
|
||||||
|
|
||||||
]}>
|
]}>
|
||||||
<Input
|
<Input
|
||||||
@ -135,8 +376,8 @@ export default function EditAppInfo(props: any) {
|
|||||||
</div>
|
</div>
|
||||||
<div className='appInfoFormInput' style={{
|
<div className='appInfoFormInput' style={{
|
||||||
}}>
|
}}>
|
||||||
<div className='FormInputTitle'>包名(APPID)<span style={{color:'red',}}>*</span>:</div>
|
<div className='FormInputTitle'>包名(APPID)<span style={{ color: 'red', }}>*</span>:</div>
|
||||||
<Form.Item name="appId" label="" rules={[{ required: true, message: '请输入APPID' },
|
<Form.Item name="packageName" label="" rules={[{ required: true, message: '请输入APPID' },
|
||||||
|
|
||||||
]}>
|
]}>
|
||||||
<Input
|
<Input
|
||||||
@ -154,8 +395,8 @@ export default function EditAppInfo(props: any) {
|
|||||||
width: '900px',
|
width: '900px',
|
||||||
}}>
|
}}>
|
||||||
<div className='appInfoFormInput'>
|
<div className='appInfoFormInput'>
|
||||||
<div className='FormInputTitle'>运行系统<span style={{color:'red',}}>*</span>:</div>
|
<div className='FormInputTitle'>运行系统<span style={{ color: 'red', }}>*</span>:</div>
|
||||||
<Form.Item name="runtype" label="" rules={[{ required: true, message: '请选择运行系统' },
|
<Form.Item name="systemName" label="" rules={[{ required: true, message: '请选择运行系统' },
|
||||||
|
|
||||||
]}>
|
]}>
|
||||||
<Select
|
<Select
|
||||||
@ -165,12 +406,7 @@ export default function EditAppInfo(props: any) {
|
|||||||
height: '42px',
|
height: '42px',
|
||||||
}}
|
}}
|
||||||
|
|
||||||
options={[
|
options={props.systemList}
|
||||||
// { value: '', label: '全部项目' },
|
|
||||||
{ value: '1', label: '类型1' },
|
|
||||||
{ value: '2', label: '类型2' },
|
|
||||||
{ value: '3', label: '类型3' },
|
|
||||||
]}
|
|
||||||
// defaultValue=""
|
// defaultValue=""
|
||||||
placeholder={'请选择运行系统'}
|
placeholder={'请选择运行系统'}
|
||||||
/>
|
/>
|
||||||
@ -178,8 +414,8 @@ export default function EditAppInfo(props: any) {
|
|||||||
</div>
|
</div>
|
||||||
<div className='appInfoFormInput'>
|
<div className='appInfoFormInput'>
|
||||||
<div className='FormInputTitle' style={{
|
<div className='FormInputTitle' style={{
|
||||||
}}>软件分类<span style={{color:'red',}}>*</span>:</div>
|
}}>软件分类<span style={{ color: 'red', }}>*</span>:</div>
|
||||||
<Form.Item name="type" label="" rules={[{ required: true, message: '请选择大类' },
|
<Form.Item name="bigClassify" label="" rules={[{ required: true, message: '请选择大类' },
|
||||||
|
|
||||||
]}>
|
]}>
|
||||||
<Select
|
<Select
|
||||||
@ -188,18 +424,26 @@ export default function EditAppInfo(props: any) {
|
|||||||
width: '145px',
|
width: '145px',
|
||||||
height: '42px',
|
height: '42px',
|
||||||
}}
|
}}
|
||||||
|
onChange={(value) => {
|
||||||
options={[
|
console.log(value);
|
||||||
// { value: '', label: '全部项目' },
|
setSmallClassList([]);
|
||||||
{ value: '1', label: '大类1' },
|
form.setFieldsValue({
|
||||||
{ value: '2', label: '大类2' },
|
subClassify: null
|
||||||
{ value: '3', label: '大类3' },
|
});
|
||||||
]}
|
setBigClass(value)
|
||||||
|
if (!value) {
|
||||||
|
setSmallClassList([])
|
||||||
|
form.setFieldsValue({
|
||||||
|
subClassify: null
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
options={props.bigClass}
|
||||||
// defaultValue=""
|
// defaultValue=""
|
||||||
placeholder={'请选择大类'}
|
placeholder={'请选择大类'}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="smalltype" label="" rules={[{ required: true, message: '请选择小类' },
|
<Form.Item name="subClassify" label="" rules={[{ required: true, message: '请选择小类' },
|
||||||
|
|
||||||
]}>
|
]}>
|
||||||
<Select
|
<Select
|
||||||
@ -209,13 +453,8 @@ export default function EditAppInfo(props: any) {
|
|||||||
height: '42px',
|
height: '42px',
|
||||||
marginLeft: 10
|
marginLeft: 10
|
||||||
}}
|
}}
|
||||||
|
disabled={smallClassList.length == 0}
|
||||||
options={[
|
options={smallClassList}
|
||||||
// { value: '', label: '全部项目' },
|
|
||||||
{ value: '1', label: '小类1' },
|
|
||||||
{ value: '2', label: '小类2' },
|
|
||||||
{ value: '3', label: '小类3' },
|
|
||||||
]}
|
|
||||||
// defaultValue=""
|
// defaultValue=""
|
||||||
placeholder={'请选择小类'}
|
placeholder={'请选择小类'}
|
||||||
/>
|
/>
|
||||||
@ -276,8 +515,8 @@ export default function EditAppInfo(props: any) {
|
|||||||
<div className='appInfoFormInput'>
|
<div className='appInfoFormInput'>
|
||||||
<div className='FormInputTitle' style={{
|
<div className='FormInputTitle' style={{
|
||||||
|
|
||||||
}}>开发方式<span style={{color:'red',}}>*</span>:</div>
|
}}>开发方式<span style={{ color: 'red', }}>*</span>:</div>
|
||||||
<Form.Item name="use" label="" rules={[{ required: true, message: '请选择开发方式' },
|
<Form.Item name="developWay" label="" rules={[{ required: true, message: '请选择开发方式' },
|
||||||
|
|
||||||
]}>
|
]}>
|
||||||
<Select
|
<Select
|
||||||
@ -289,17 +528,22 @@ export default function EditAppInfo(props: any) {
|
|||||||
|
|
||||||
options={[
|
options={[
|
||||||
// { value: '', label: '全部项目' },
|
// { value: '', label: '全部项目' },
|
||||||
{ value: '1', label: '独立开发' },
|
{ value: '独立开发', label: '独立开发' },
|
||||||
{ value: '2', label: '合作开发' },
|
{ value: '合作开发', label: '合作开发' },
|
||||||
]}
|
]}
|
||||||
// defaultValue=""
|
// defaultValue=""
|
||||||
placeholder={'请选择小类'}
|
placeholder={'请选择小类'}
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
console.log(value);
|
console.log(value);
|
||||||
if (value == '2') {
|
if (value == '合作开发') {
|
||||||
setUpShow(true)
|
setUpShow(true)
|
||||||
}else{
|
} else {
|
||||||
setUpShow(false)
|
setUpShow(false)
|
||||||
|
// 清空表单上传文件
|
||||||
|
form.setFieldsValue({
|
||||||
|
getFile: ''
|
||||||
|
})
|
||||||
|
setUpSoftArray([])
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@ -307,8 +551,8 @@ export default function EditAppInfo(props: any) {
|
|||||||
</div>
|
</div>
|
||||||
<div className='appInfoFormInput'>
|
<div className='appInfoFormInput'>
|
||||||
<div className='FormInputTitle' style={{
|
<div className='FormInputTitle' style={{
|
||||||
}}>开发完成日期<span style={{color:'red',}}>*</span>:</div>
|
}}>开发完成日期<span style={{ color: 'red', }}>*</span>:</div>
|
||||||
<Form.Item name="date" label="" rules={[{ required: true, message: '请选择开发完成日期' },
|
<Form.Item name="completeTime" label="" rules={[{ required: true, message: '请选择开发完成日期' },
|
||||||
|
|
||||||
]}>
|
]}>
|
||||||
{/* <Input
|
{/* <Input
|
||||||
@ -383,8 +627,8 @@ export default function EditAppInfo(props: any) {
|
|||||||
// background: 'pink',
|
// background: 'pink',
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
}}>
|
}}>
|
||||||
<div className='FormInputTitle'>产权所属者<span style={{color:'red',}}>*</span>:</div>
|
<div className='FormInputTitle'>产权所属者<span style={{ color: 'red', }}>*</span>:</div>
|
||||||
<Form.Item name="belongPeople" label="" rules={[{ required: true, message: '请选择/创建知识产权所属者' },
|
<Form.Item name="projOwnerName" label="" rules={[{ required: true, message: '请选择/创建知识产权所属者' },
|
||||||
|
|
||||||
]}>
|
]}>
|
||||||
<Input
|
<Input
|
||||||
@ -461,23 +705,98 @@ export default function EditAppInfo(props: any) {
|
|||||||
|
|
||||||
}}>
|
}}>
|
||||||
<div className='FormInputTitle' style={{
|
<div className='FormInputTitle' style={{
|
||||||
}}>上传合作协议<span style={{color:'red',}}>*</span>:</div>
|
position: 'relative',
|
||||||
|
// background:'red'
|
||||||
|
}}>上传合作协议<span style={{ color: 'red', }}>*</span>:
|
||||||
|
<div style={{
|
||||||
|
position: 'absolute',
|
||||||
|
top: '25px',
|
||||||
|
left: '25px',
|
||||||
|
fontSize: '12px',
|
||||||
|
color: 'red'
|
||||||
|
|
||||||
|
}}>(请上传PDF格式文件)</div>
|
||||||
|
</div>
|
||||||
<div style={{
|
<div style={{
|
||||||
width: '220px',
|
width: '220px',
|
||||||
}}>
|
}}>
|
||||||
<Form.Item name="upfile" label="" rules={[{ required: true, message: '请上传合作协议' },
|
<Form.Item name="getFile" label="" rules={[
|
||||||
|
// { required: true, message: '请上传合作协议' },
|
||||||
|
{ validator: validateFileUpload }
|
||||||
]}>
|
]}>
|
||||||
<Upload
|
<Upload
|
||||||
|
|
||||||
name="file"
|
name="file"
|
||||||
action={uploadFileUrl()}
|
action={uploadFileUrl()}
|
||||||
defaultFileList={upSoftArray}
|
// fileList={upSoftArray}
|
||||||
onChange={({ fileList }) => {
|
fileList={upSoftArray}
|
||||||
console.log(fileList);
|
onChange={(info) => {
|
||||||
|
const { fileList } = info;
|
||||||
|
setUpSoftArray(fileList); // 更新 upSoftArray 状态
|
||||||
|
|
||||||
|
if (info.file.status === 'uploading') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (info.file.status === 'done') {
|
||||||
|
console.log(info.file.response.data);
|
||||||
|
setUpSoftArray([
|
||||||
|
{
|
||||||
|
uid: info.file.response.data.fileId,
|
||||||
|
name: info.file.response.data.fileName,
|
||||||
|
status: 'done',
|
||||||
|
url: showImage(info.file.response.data.fileId, false)
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
form.setFieldsValue({
|
||||||
|
getFile: info.file.response.data.fileId,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (info.file.status === 'error') {
|
||||||
|
// 显示错误提示
|
||||||
|
message.error(`上传失败`);
|
||||||
|
form.setFieldsValue({
|
||||||
|
getFile: '', // 清除表单值
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (info.file.status === 'uploading') {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// if (info.file.status === 'done') {
|
||||||
|
|
||||||
|
// console.log(info.file.response.data);
|
||||||
|
// setUpSoftArray([
|
||||||
|
// {
|
||||||
|
// uid: info.file.response.data.fileId,
|
||||||
|
// name: info.file.response.data.fileName,
|
||||||
|
// status: 'done',
|
||||||
|
// url: showImage(info.file.response.data.fileId, false)
|
||||||
|
// }
|
||||||
|
// ])
|
||||||
|
|
||||||
|
// form.setFieldsValue({
|
||||||
|
// getFile: info.file.response.data.fileId,
|
||||||
|
// })
|
||||||
|
|
||||||
|
// // setUpFileName(fileName)
|
||||||
|
// }
|
||||||
|
// if (info.file.status === 'error') {
|
||||||
|
// // 显示错误提示
|
||||||
|
// message.error(`上传失败`);
|
||||||
|
// //伤处表单name为ing的值
|
||||||
|
// form.setFieldsValue({
|
||||||
|
// getFile: '', // 将值设置为 undefined 以清除错误状态
|
||||||
|
// })
|
||||||
|
|
||||||
|
// }
|
||||||
}}
|
}}
|
||||||
onRemove={() => {
|
onRemove={() => {
|
||||||
setUpSoftArray([])
|
setUpSoftArray([])
|
||||||
setSoftDis(false)
|
// setSoftDis(false)
|
||||||
|
form.setFieldsValue({
|
||||||
|
getFile: '', // 将值设置为 undefined 以清除错误状态
|
||||||
|
})
|
||||||
}}
|
}}
|
||||||
beforeUpload={beforeUpload}
|
beforeUpload={beforeUpload}
|
||||||
// onChange={handleUploadChange}
|
// onChange={handleUploadChange}
|
||||||
@ -485,8 +804,10 @@ export default function EditAppInfo(props: any) {
|
|||||||
>
|
>
|
||||||
<Button icon={<UploadOutlined />} style={{
|
<Button icon={<UploadOutlined />} style={{
|
||||||
marginTop: '4px'
|
marginTop: '4px'
|
||||||
|
|
||||||
}}
|
}}
|
||||||
disabled={softDis}
|
disabled={upSoftArray.length > 0}
|
||||||
|
|
||||||
>上传附件</Button>
|
>上传附件</Button>
|
||||||
</Upload>
|
</Upload>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
@ -496,7 +817,37 @@ export default function EditAppInfo(props: any) {
|
|||||||
top: '10px',
|
top: '10px',
|
||||||
left: '260px',
|
left: '260px',
|
||||||
textWrap: 'nowrap'
|
textWrap: 'nowrap'
|
||||||
}}>[ 下载协议 ]</a>
|
}}
|
||||||
|
onClick={async () => {
|
||||||
|
form.getFieldValue('appName')
|
||||||
|
if (form.getFieldValue('appName') && form.getFieldValue('versionName')) {
|
||||||
|
try {
|
||||||
|
setDownLoading(true)
|
||||||
|
console.log(form.getFieldValue('appName'), form.getFieldValue('versionName'));
|
||||||
|
const res: any = await agreementWord(props.appOrderId, form.getFieldValue('appName'), form.getFieldValue('versionName'))
|
||||||
|
window.open(showImage(res.fileId, false));
|
||||||
|
setDownLoading(false)
|
||||||
|
} catch (error: any) {
|
||||||
|
setDownLoading(false)
|
||||||
|
if (error.response) {
|
||||||
|
const data = error.response.data;
|
||||||
|
messageApi.open({
|
||||||
|
type: 'error',
|
||||||
|
content: data.msg ? data.msg : `${data.path}(${data.status})`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
setDownLoading(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
message.error('需先填写软件全称和版本号')
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>[ 下载协议 ]</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -565,5 +916,6 @@ export default function EditAppInfo(props: any) {
|
|||||||
<BelongPeople closeModal={() => { setBelongModal(false) }} setBelongPeopleInfo={setBelongPeopleInfo} belongPeopleInfo={belongPeopleInfo} setValue={setValue} isShow={true}></BelongPeople>
|
<BelongPeople closeModal={() => { setBelongModal(false) }} setBelongPeopleInfo={setBelongPeopleInfo} belongPeopleInfo={belongPeopleInfo} setValue={setValue} isShow={true}></BelongPeople>
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
|
</Spin>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1136,7 +1136,7 @@ export default function Correction() {
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* <a style={{
|
<a style={{
|
||||||
display: item.applyStatus == 'APPROVED' && item.type == 'CORRECTION1' && item.projStatus !== 'CLOSE' ? 'unset' : 'none',
|
display: item.applyStatus == 'APPROVED' && item.type == 'CORRECTION1' && item.projStatus !== 'CLOSE' ? 'unset' : 'none',
|
||||||
marginLeft: 10,
|
marginLeft: 10,
|
||||||
// 下划线
|
// 下划线
|
||||||
@ -1158,7 +1158,7 @@ export default function Correction() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
换名
|
换名
|
||||||
</a> */}
|
</a>
|
||||||
<a
|
<a
|
||||||
style={{
|
style={{
|
||||||
display: item.applyStatus == 'APPROVED' && item.type == 'CORRECTION2' ? 'unset' : 'none',
|
display: item.applyStatus == 'APPROVED' && item.type == 'CORRECTION2' ? 'unset' : 'none',
|
||||||
|
@ -3843,15 +3843,15 @@ export default function Index() {
|
|||||||
{appGoodsArray.map((item: any, index: number) => {
|
{appGoodsArray.map((item: any, index: number) => {
|
||||||
return (
|
return (
|
||||||
<div className='appGoodsBox'
|
<div className='appGoodsBox'
|
||||||
key={item.dataId}
|
key={item.id}
|
||||||
style={{
|
style={{
|
||||||
background: item.back == 'black' ? '#F9F9F9 ' : '#DDECFF',
|
background: item.back == 'black' ? '#F9F9F9 ' : '#DDECFF',
|
||||||
border: item.dataId == appGoodsId ? '1px solid #f19e31' : '',
|
border: item.id == appGoodsId ? '1px solid #f19e31' : '',
|
||||||
boxShadow: item.dataId == appGoodsId ? '5px 5px 10px rgb(114, 114, 114)' : '',
|
boxShadow: item.id == appGoodsId ? '5px 5px 10px rgb(114, 114, 114)' : '',
|
||||||
marginTop: item.dataId == appGoodsId ? -20 : 0,
|
marginTop: item.id == appGoodsId ? -20 : 0,
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setAppGoodsId(item.dataId)
|
setAppGoodsId(item.id)
|
||||||
// console.log('item.dataId: ', item.dataId);
|
// console.log('item.dataId: ', item.dataId);
|
||||||
|
|
||||||
}}
|
}}
|
||||||
@ -3863,7 +3863,7 @@ export default function Index() {
|
|||||||
backgroundImage: index !== 1 ? `url(${topblack})` : `url(${topblue})`,
|
backgroundImage: index !== 1 ? `url(${topblack})` : `url(${topblue})`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{item.dataSummary}
|
{item.title}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -3874,7 +3874,7 @@ export default function Index() {
|
|||||||
<span>¥</span>
|
<span>¥</span>
|
||||||
<span style={{
|
<span style={{
|
||||||
fontSize: 42,
|
fontSize: 42,
|
||||||
}}>{item.dataName / 100}</span>
|
}}>{item.money / 100}</span>
|
||||||
<span>元/件</span>
|
<span>元/件</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -3917,6 +3917,8 @@ export default function Index() {
|
|||||||
} else {
|
} else {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
setBuyLoading(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user