Commit 8b6ed132 authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复 资质文件 不存在的问题

parent 02ff7601
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-06-04 17:26:51 * @Date: 2021-06-04 17:26:51
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-07 16:20:40 * @LastEditTime: 2021-06-17 10:37:59
* @Description: 资质上传组件 * @Description: 资质上传组件
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
...@@ -22,7 +22,7 @@ const QualitiesUpload = (props) => { ...@@ -22,7 +22,7 @@ const QualitiesUpload = (props) => {
} = props; } = props;
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const arrValue = value ? [value] : []; const arrValue = value || [];
const handleChange = (info: UploadChangeParam) => { const handleChange = (info: UploadChangeParam) => {
const { file } = info; const { file } = info;
...@@ -33,10 +33,12 @@ const QualitiesUpload = (props) => { ...@@ -33,10 +33,12 @@ const QualitiesUpload = (props) => {
if (file.status === 'done' || file.status === 'error') { if (file.status === 'done' || file.status === 'error') {
setLoading(false); setLoading(false);
} }
mutators.change({ mutators.change([
...rest, {
...(response.data || {}), ...rest,
}); ...(response.data || {}),
}
]);
}; };
const uploadButton = ( const uploadButton = (
...@@ -47,7 +49,7 @@ const QualitiesUpload = (props) => { ...@@ -47,7 +49,7 @@ const QualitiesUpload = (props) => {
); );
const renderFile = () => { const renderFile = () => {
const url = value?.url || ''; const url = value[0]?.url || '';
const imgReg = /\.(png|jpg|gif|jpeg|webp)$/; const imgReg = /\.(png|jpg|gif|jpeg|webp)$/;
const isImg = imgReg.test(url); const isImg = imgReg.test(url);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-06-01 16:13:35 * @Date: 2021-06-01 16:13:35
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-15 11:53:20 * @LastEditTime: 2021-06-17 10:50:41
* @Description: 资质证明上传组件 * @Description: 资质证明上传组件
*/ */
import React from 'react'; import React from 'react';
...@@ -70,6 +70,7 @@ const schema = new Schema({ ...@@ -70,6 +70,7 @@ const schema = new Schema({
type: 'string', type: 'string',
title: '有效期', title: '有效期',
'x-component': 'CheckboxGroup', 'x-component': 'CheckboxGroup',
default: [1],
enum: [ enum: [
{ label: '长期有效', value: 1 }, { label: '长期有效', value: 1 },
] ]
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-05-24 17:01:57 * @Date: 2021-05-24 17:01:57
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-10 16:09:07 * @LastEditTime: 2021-06-17 10:43:24
* @Description: 审核入库资料 * @Description: 审核入库资料
*/ */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
...@@ -88,10 +88,10 @@ const MemberPrVerifyComingDataVerify: React.FC<{}> = () => { ...@@ -88,10 +88,10 @@ const MemberPrVerifyComingDataVerify: React.FC<{}> = () => {
...value, ...value,
depositDetails: comingData, depositDetails: comingData,
qualities: qualifications.map((item) => ({ qualities: qualifications.map((item) => ({
url: item.file[0] ? item.file[0].url : '', url: item.file && item.file[0] ? item.file[0].url : '',
name: item.file[0] ? item.file[0].name : '', name: item.file && item.file[0] ? item.file[0].name : '',
expireDay: item.expireDay, expireDay: item.expireDay || '',
permanent: item.permanent[0] ? item.permanent[0] : 0, permanent: item.permanent && item.permanent[0] ? item.permanent[0] : 0,
})), })),
}; };
const msg = message.loading({ const msg = message.loading({
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-05-26 16:52:48 * @Date: 2021-05-26 16:52:48
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-10 16:06:51 * @LastEditTime: 2021-06-17 10:46:31
* @Description: 申请会员 * @Description: 申请会员
*/ */
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
...@@ -184,10 +184,10 @@ const MemberQueryApplyMember: React.FC = () => { ...@@ -184,10 +184,10 @@ const MemberQueryApplyMember: React.FC = () => {
upperRoleId, upperRoleId,
depositDetails: step3, depositDetails: step3,
qualities: qualities.map((item) => ({ qualities: qualities.map((item) => ({
expireDay: item.expireDay, expireDay: item.expireDay || '',
permanent: item.permanent[0] || 0, permanent: item.permanent && item.permanent[0] || 0,
url: item.file.url, url: item.file && item.file[0] ? item.file[0].url : '',
name: item.file.name, name: item.file && item.file[0] ? item.file[0].name : '',
})), })),
}).then(res => { }).then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
...@@ -204,10 +204,10 @@ const MemberQueryApplyMember: React.FC = () => { ...@@ -204,10 +204,10 @@ const MemberQueryApplyMember: React.FC = () => {
validateId, validateId,
detail: step3, detail: step3,
qualities: qualities.map((item) => ({ qualities: qualities.map((item) => ({
expireDay: item.expireDay, expireDay: item.expireDay || '',
permanent: item.permanent[0] || 0, permanent: item.permanent && item.permanent[0] || 0,
url: item.file.url, url: item.file && item.file[0] ? item.file[0].url : '',
name: item.file.name, name: item.file && item.file[0] ? item.file[0].name : '',
})), })),
}).then(res => { }).then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
......
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