Commit 8b58f3d1 authored by 熊成伟's avatar 熊成伟

debug

parent 6b7d7290
Pipeline #16384 passed with stages
in 1 minute and 5 seconds
......@@ -150,7 +150,7 @@ const Process = (props) => {
const developer = localStorage.getItem('developer');
downloadFile({
method: 'post',
url: `/idtAppServiceV6/oApp/downloadLargeFile`,
url: `/idtAppServiceV6/oApp/downloadLargeFileForword`,
body: {uuid, tableId, developer},
}).then(res => {
var downloadElement = document.createElement('a');
......
import React, {useState} from 'react';
import {WingBlank, List, InputItem, TextareaItem, WhiteSpace, Toast, DatePicker, Picker} from 'antd-mobile'
import {WingBlank, List, InputItem, ImagePicker, WhiteSpace, Toast, DatePicker, Picker} from 'antd-mobile'
import Document from 'react-document-title';
import '../index.less';
import './index.less';
import moment from 'moment'
import fileRequest from '../../utils/fileRequest';
import Upload from 'rc-upload';
import { createForm } from 'rc-form';
......@@ -12,58 +11,66 @@ import { createForm } from 'rc-form';
const Send = (props) => {
const {getFieldProps} = props.form;
const [loading, setLoading] = useState(false);
const uploadPng = () => {
const formData = new FormData();
upload.length > 0 && formData.append('file', upload[0].file);
fileRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/uploadPhoto',
payload: formData
}).then(res => {
});
};
const onSubmit = () => {
props.form.validateFields({ force: true }, (error) => {
const values = props.form.getFieldsValue();
const jsonParam = {...values, _mail_option: 'send', _mail_has_blob: upload.length > 0};
setLoading(true);
const formData = new FormData();
upload.length > 0 && upload.forEach(file => {
formData.append('blob', file);
});
values.gzrq = moment(values.gzrq).format("YYYY-MM-DD");
values.csrq = moment(values.csrq).format("YYYY-MM-DD");
if (!error) {
uploadPng();
fileRequest({
method: 'post',
url: '/idtAppServiceV6/jspmail/sendMail',
body: {jsonParam: JSON.stringify(jsonParam)},
payload: formData
url: '/idtAppServiceV6/oApp/changeUserInfo',
body: {...values},
}).then(res => {
Toast.success('发送成功');
props.history.push('/blank/mail');
setLoading(true)
});
}else {
Toast.fail('请输入完整的主题、收件人、内容')
}
});
};
const [upload, setUpload] = useState([]);
const uploaderProps = {
multiple: true,
beforeUpload(file) {
const newUpload = [...upload, file];
setUpload(newUpload);
return false
}
};
const uploadDelete = uid => {
const newData = [...upload];
const Index = newData.findIndex(item => item.uid === uid);
Index > -1 && newData.splice(Index, 1);
setUpload(newData)
};
const uploadChange = (files, type, index) => {
console.log(files, type, index)
setUpload(files)
}
const userInfo = JSON.parse(localStorage.getItem('userInfo'));
const userInfo = localStorage.getItem('userInfo')
return (
<Document title="内部邮局">
<WingBlank>
<WhiteSpace/>
<form>
<List>
<div className="user-img">
头像设置
<ImagePicker
length={1}
files={upload}
onChange={uploadChange}
selectable={upload.length < 1}
/>
</div>
{/*<WingBlank>*/}
{/*{upload.length > 0 && upload.map((item, index) => (*/}
{/*<div>1111</div>*/}
......@@ -73,21 +80,21 @@ const Send = (props) => {
{/*<a className="auto-upload">上传附件 +</a>*/}
{/*</Upload>*/}
<InputItem disabled={true} value="11111">姓名</InputItem>
<InputItem disabled={true} value="11111">账号</InputItem>
<Picker data={[{label: '男', value: '男'}, {label: '女', value: '女'}]} cols={1} {...getFieldProps('xb')}>
<InputItem disabled={true} value={userInfo.userealname}>姓名</InputItem>
<InputItem disabled={true} value={userInfo.useName}>账号</InputItem>
<Picker data={[{label: '男', value: '男'}, {label: '女', value: '女'}]} cols={1} {...getFieldProps('xb', {initialValue: userInfo.xb})}>
<List.Item arrow="horizontal">性别</List.Item>
</Picker>
<DatePicker mode="date" className="send-date-style"{...getFieldProps('gzrq')}>
<DatePicker mode="date" className="send-date-style"{...getFieldProps('gzrq', {initialValue: new Date(userInfo.gzrq)})}>
<List.Item arrow="horizontal">工作日期</List.Item>
</DatePicker>
<DatePicker mode="date" className="send-date-style"{...getFieldProps('csrq')} onChange={val => console.log(val)}>
<DatePicker mode="date" className="send-date-style"{...getFieldProps('csrq', {initialValue: new Date(userInfo.csrq)})} onChange={val => console.log(val)}>
<List.Item arrow="horizontal">出生日期</List.Item>
</DatePicker>
<InputItem{...getFieldProps('gzdh')}>工作电话</InputItem>
<InputItem{...getFieldProps('yddh')}>手机号码</InputItem>
<InputItem{...getFieldProps('sjxh')}>手机小号</InputItem>
<InputItem{...getFieldProps('email')}>邮箱地址</InputItem>
<InputItem{...getFieldProps('gzdh', {initialValue: userInfo.gzdh})}>工作电话</InputItem>
<InputItem{...getFieldProps('yddh', {initialValue: userInfo.yddh})}>手机号码</InputItem>
<InputItem{...getFieldProps('sjxh', {initialValue: userInfo.sjxh})}>手机小号</InputItem>
<InputItem{...getFieldProps('email', {initialValue: userInfo.email})}>邮箱地址</InputItem>
</List>
</form>
<div className="event-footer">
......
.user-img{
display: flex;
justify-content: flex-start;
align-items: center;
border-bottom: 1px solid rgba(239, 239, 239, 1);
font-size: 17px;
padding: 0 15px;
height: 100px;
}
.am-image-picker{
margin-left: 20px;
width: 100px;
height: 100px;
}
......@@ -106,11 +106,11 @@ const Send = (props) => {
const uploadFile = (upload, name, attachId) => {
const formData = new FormData();
upload.length > 0 && upload.forEach(file => {
formData.append('blob', file);
formData.append('file', file);
});
upload.length > 0 && fileRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/balanceUploadFile',
url: '/idtAppServiceV6/oApp/balanceUploadFileAdapt',
body: {
tableId: submitData.tableId,
ATTACH_ID: attachId,
......
......@@ -42,9 +42,9 @@ const Send = (props) => {
}).then(res => {
res.uuid && setUUID(res.uuid);
});
UUID && upload.length > 0 && upload2.length > 0 && new Promise((resolve => {
uploadFile(upload, 'zw', UUID);
uploadFile(upload2, 'fj', UUID);
UUID && new Promise((resolve => {
upload.length > 0 && uploadFile(upload, 'zw', UUID);
upload2.length > 0 && uploadFile(upload2, 'fj', UUID);
resolve()
})).then(() => {
Toast.success('新增成功');
......@@ -88,11 +88,11 @@ const Send = (props) => {
const uploadFile = (upload, name, attachId) => {
const formData = new FormData();
upload.length > 0 && upload.forEach(file => {
formData.append('blob', file);
formData.append('file', file);
});
upload.length > 0 && fileRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/balanceUploadFile',
url: '/idtAppServiceV6/oApp/balanceUploadFileAdapt',
body: {
tableId: submitData.tableId,
ATTACH_ID: attachId,
......@@ -239,7 +239,7 @@ const Send = (props) => {
{formData.length > 0 && (
<div className="event-footer">
{/*<Button type="primary">保存</Button>*/}
<div className={`footer-button ${sP.length > 0 ? '' : 'btn-disabled'}`} onClick={sP.length === 0 ? onSubmit : null}>保存</div>
<div className={`footer-button ${sP.length > 0 ? '' : 'btn-disabled'}`} onClick={sP.length > 0 ? onSubmit : null}>保存</div>
</div>
)}
......
......@@ -54,8 +54,9 @@ const Send = (props) => {
res.uuid && uploadFile(upload, 'zw', res.uuid);
res.uuid && uploadFile(upload2, 'fj', res.uuid);
resolve()
})).then((res) => {
})).then(() => {
if (name !== '办公用品采购') {
console.log(res)
res && res.uuid && Toast.success('新增成功');
res && res.uuid && props.history.goBack()
}else {
......@@ -102,11 +103,11 @@ const Send = (props) => {
const uploadFile = (upload, name, attachId) => {
const formData = new FormData();
upload.length > 0 && upload.forEach(file => {
formData.append('blob', file);
formData.append('file', file);
});
upload.length > 0 && fileRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/balanceUploadFile',
url: '/idtAppServiceV6/oApp/balanceUploadFileAdapt',
body: {
tableId: submitData.tableId,
ATTACH_ID: attachId,
......
......@@ -38,17 +38,25 @@ const Send = (props) => {
onClose(false)
};
const peopleSubmit = (data) => {
console.log(data)
// axiosRequest({
// method: 'post',
// url: '/idtAppServiceV6/exclude/control/getList',
// body: {
// script: 'hysqTreeAll',
// args: JSON.stringify(['47c2c4f9235aa97f01235aa97f7c0000']),
// },
// }).then((res) => {
//
// })
const developer = localStorage.getItem('developer');
const newData = data.map(item => {
delete item.checked;
delete item.LEVEL;
delete item.BH;
item.ATTACH_ID = UUID;
return item
});
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/saveChRyInfo.jsp',
body: {
ATTACH_ID: UUID,
paramsList: JSON.stringify(newData),
developer
},
}).then((res) => {
})
}
return (
......
......@@ -67,8 +67,8 @@ export const createAPI = (baseURL) => {
userealname: response.data.userealname,
useName: response.data.userName,
xb: response.data.xb,
gzrq: new Date(response.data.gzrq),
csrq: new Date(response.data.csrq),
gzrq: response.data.gzrq,
csrq: response.data.csrq,
gzdh: response.data.gzdh,
yddh: response.data.yddh,
sjxh: response.data.sjxh,
......
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