Commit 2f016c16 authored by 熊成伟's avatar 熊成伟

debug

parent 2744ec8c
Pipeline #16361 failed with stages
in 36 seconds
...@@ -267,6 +267,19 @@ ...@@ -267,6 +267,19 @@
"rmc-steps": "~1.0.0", "rmc-steps": "~1.0.0",
"rmc-tabs": "~1.2.0", "rmc-tabs": "~1.2.0",
"rmc-tooltip": "~1.0.0" "rmc-tooltip": "~1.0.0"
},
"dependencies": {
"rc-checkbox": {
"version": "2.0.3",
"resolved": "https://registry.npm.taobao.org/rc-checkbox/download/rc-checkbox-2.0.3.tgz?cache=0&sync_timestamp=1594780152378&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frc-checkbox%2Fdownload%2Frc-checkbox-2.0.3.tgz",
"integrity": "sha1-Q2qdUIlI4iSYDwU16nOLSBd6jyU=",
"requires": {
"babel-runtime": "^6.23.0",
"classnames": "2.x",
"prop-types": "15.x",
"rc-util": "^4.0.4"
}
}
} }
}, },
"anymatch": { "anymatch": {
...@@ -9711,14 +9724,12 @@ ...@@ -9711,14 +9724,12 @@
} }
}, },
"rc-checkbox": { "rc-checkbox": {
"version": "2.0.3", "version": "2.3.1",
"resolved": "https://registry.npm.taobao.org/rc-checkbox/download/rc-checkbox-2.0.3.tgz", "resolved": "https://registry.npm.taobao.org/rc-checkbox/download/rc-checkbox-2.3.1.tgz?cache=0&sync_timestamp=1594780152378&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frc-checkbox%2Fdownload%2Frc-checkbox-2.3.1.tgz",
"integrity": "sha1-Q2qdUIlI4iSYDwU16nOLSBd6jyU=", "integrity": "sha1-KmG8QwF8eDvS6fGmdVO/jv56pNM=",
"requires": { "requires": {
"babel-runtime": "^6.23.0", "@babel/runtime": "^7.10.1",
"classnames": "2.x", "classnames": "^2.2.1"
"prop-types": "15.x",
"rc-util": "^4.0.4"
} }
}, },
"rc-collapse": { "rc-collapse": {
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
"postcss-px2rem": "^0.3.0", "postcss-px2rem": "^0.3.0",
"qs": "^6.9.4", "qs": "^6.9.4",
"query-string": "^5.1.1", "query-string": "^5.1.1",
"rc-checkbox": "^2.3.1",
"rc-form": "^2.4.11", "rc-form": "^2.4.11",
"rc-upload": "^3.2.0", "rc-upload": "^3.2.0",
"react": "^16.8.4", "react": "^16.8.4",
......
import React, {useState, useEffect} from 'react';
import {Button, Checkbox, WhiteSpace, WingBlank} from "antd-mobile";
const AgreeItem = Checkbox.AgreeItem;
const TreeData = (props) => {
const {data, onClick, closeModal} = props;
const [treeData, setTreeData] = useState([]);
useEffect(() => {
const newData = JSON.parse(JSON.stringify(data));
newData.map((item, index) => {item.subList = newData.filter(child => item.XH === child.LSID); item.keyIndex = index});
setTreeData(newData);
}, [data]);
const [sGood, setSGood] = useState([])
const checkGood = (keyIndex, checked) => {
const newData = [...sGood];
const Index = sGood.findIndex(item => item === keyIndex);
checked ? newData.push(keyIndex) : newData.splice(Index, 1);
setSGood(newData)
};
const submit = () => {
getAll()
};
const getAll = val => {
const result = data.filter((item, index) => sGood.indexOf(index) > -1);
result.map(item => {
const a = treeFindPath(treeData[0] && treeData[0].subList, item.keyIndex === item);
console.log(a)
})
};
function treeFindPath (tree, func, path = []) {
if (!tree) return []
for (const data of tree) {
// 这里按照你的需求来存放最后返回的内容吧
path.push(data.keyIndex);
if (data.subList) {
const findChildren = treeFindPath(data.subList, func, path)
if (findChildren.length) return findChildren
}
path.pop()
}
return []
}
const getProps = (data) => (
<div className="address-box">
{data && data.length > 0 && data.map((item, index) => (
<div key={index}>
<div onClick={() => onClick(item.keyIndex)} className="address-item">
<div className="address-title">{item.MC || ''}</div>
<img src="/img/rarrow.png" alt="" className={`icon18 ${item.checked ? 'icon-checked' : 'icon-unchecked'}`}/>
</div>
{ item.checked && item.subList && (item.subList.length > 0 ? (
<div className="address-item-box">
{item.subList.map((child, index2) => child.subList.length === 0 ? (
<div className="address-item" key={index2}>
<div className="xm-box pos-aline">
<input checked={sGood.indexOf(child.keyIndex) > -1} className="auto-checkbox" type="checkbox" onChange={val => checkGood(child.keyIndex, val.target.checked)}/>
{child.XM || ''}
</div>
<div className="address-user">
<img alt="" className='smallIco mr-5' src='/img/tel.png' />
<a className="address-phone">{child.YDDH || '无'}</a>
</div>
</div>
) : getProps(child.subList))}
</div>
): (
<div className="address-item" key={item.keyIndex}>
<div className="xm-box pos-aline">
<input checked={sGood.indexOf(item.keyIndex) > -1} className="auto-checkbox" type="checkbox" onChange={val => checkGood(item.keyIndex, val.target.checked)}/>
{item.XM || ''}
</div>
<div className="address-user">
<img alt="" className='smallIco mr-5' src='/img/tel.png' />
<a className="address-phone">{item.YDDH || '无'}</a>
</div>
</div>
))}
</div>
))}
</div>
);
return (
<div>
<WingBlank>
<div className="address-box-auto">
{getProps(treeData[0] && treeData[0].subList)}
</div>
<WhiteSpace/>
<div className="modal-form-footer">
<Button className="date-button mr-12 bg-gray" inline onClick={closeModal}>取消</Button>
<Button className="date-button" inline type="primary" onClick={submit}>确认选择</Button>
</div>
</WingBlank>
</div>
);
};
export default TreeData;
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
transition: transform 350ms; transition: transform 350ms;
} }
.address-item-box .address-item{ .address-item-box .address-item{
padding: 15px 40px; padding: 15px 15px 15px 40px;
} }
.address-empty{ .address-empty{
display: flex; display: flex;
...@@ -46,5 +46,33 @@ ...@@ -46,5 +46,33 @@
background: #ffffff; background: #ffffff;
} }
.address-title{ .address-title{
font-weight: bold; text-align: left !important;
//font-weight: bold;
}
.address-box-auto{
width: 320px;
height: 400px;
overflow: auto;
}
.checkbox-ss{
display: none;
}
input[type=checkbox]{
-moz-appearance:none; /* Firefox */
-webkit-appearance:none; /* Safari 和 Chrome */
//position: relative;
//left: -40px;
display: block;
width: 23px;
height: 23px;
cursor: pointer;
border-radius: 50%;
border: 1px solid #000;
margin-left: -20px;
margin-right: 10px;
}
input[type="checkbox"]:checked{
background-color: green
} }
...@@ -12,7 +12,7 @@ class Index extends PureComponent { ...@@ -12,7 +12,7 @@ class Index extends PureComponent {
this.setState({visible}) this.setState({visible})
}; };
onSelect = (val) => { onSelect = (val) => {
console.log(this.props.id); this.props.onClick();
this.visibleChange(false) this.visibleChange(false)
} }
render() { render() {
......
import React from 'react'; import React from 'react';
import List from '../../../components/List' import List from '../../../components/List'
import AdjunctList from '../../../components/Adjunct' import AdjunctList from '../../../components/Adjunct'
import axiosRequest from "../../../utils/request";
const Adjunct = (props) => { const Adjunct = (props) => {
...@@ -11,11 +12,23 @@ const Adjunct = (props) => { ...@@ -11,11 +12,23 @@ const Adjunct = (props) => {
// iframe.src = "javascript: '<script>location.href=\"" + src + "\"<\/script>'"; // iframe.src = "javascript: '<script>location.href=\"" + src + "\"<\/script>'";
// document.getElementsByTagName('body')[0].appendChild(iframe); // document.getElementsByTagName('body')[0].appendChild(iframe);
// } // }
const download = (uuid) => {
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/downloadLargeFile',
body: {
uuid
},
}).then(res => {
})
}
const listData = [ const listData = [
{title: '附件', line: data.length > 0, content: {title: '附件', line: data.length > 0, content:
<div> <div>
{data.length > 0 ? data.map((item, index) => ( {data.length > 0 ? data.map((item, index) => (
<AdjunctList key={index} data={item}/> <AdjunctList key={index} data={item} onClick={() => download(item.UUID)}/>
)) : '无'} )) : '无'}
</div> </div>
}, },
......
...@@ -2,22 +2,19 @@ import React from 'react'; ...@@ -2,22 +2,19 @@ import React from 'react';
import {WingBlank} from "antd-mobile"; import {WingBlank} from "antd-mobile";
import Document from 'react-document-title' import Document from 'react-document-title'
import Send from './components/Send';
import Receive from './components/Receive';
import Goods from './components/Goods'; import Goods from './components/Goods';
import Meeting from './components/Meeting'; import Meeting from './components/Meet';
import Notice from './components/Notice';
import Normal from './components/Normal'
const Work = (props) => { const Work = (props) => {
const {name} = props.match.params; const {name} = props.match.params
return ( return (
<Document title="新增"> <Document title="新增">
<WingBlank> <WingBlank>
{name.indexOf('发文') > -1 && <Send {...props}/>}
{name.indexOf('收文') > -1 && <Receive {...props}/>}
{name.indexOf('会议') > -1 && <Meeting {...props}/>}
{name.indexOf('办公用品') > -1 && <Goods {...props}/>} {name.indexOf('办公用品') > -1 && <Goods {...props}/>}
{name.indexOf('通知公告') > -1 && <Notice {...props}/>} {name.indexOf('会议申请') > -1 && <Meeting {...props}/>}
{name.indexOf('办公用品') < 0 && name.indexOf('会议申请') < 0 && (<Normal {...props}/>)}
</WingBlank> </WingBlank>
</Document> </Document>
); );
......
...@@ -13,7 +13,7 @@ import './index.less' ...@@ -13,7 +13,7 @@ import './index.less'
const Notice = (props) => { const Notice = (props) => {
const {type, name} = props.match.params; const {type, name} = props.match.params;
const [start, setStart] = useState(true); const [start, setStart] = useState(true);
const [end, setEnd] = useState(true) const [end, setEnd] = useState(true);
const [current, setCurrent] = useState(0); const [current, setCurrent] = useState(0);
const [searchWord, setSearchWord] = useState(); const [searchWord, setSearchWord] = useState();
...@@ -25,7 +25,7 @@ const Notice = (props) => { ...@@ -25,7 +25,7 @@ const Notice = (props) => {
const getData = (scroll) => { const getData = (scroll) => {
const pageMap ={searchWord, page: current + 1, rows: 10, operateId: tab}; const pageMap ={searchWord, page: current + 1, rows: 10, operateId: tab};
setLoading(true); setLoading(true);
scroll && current > 0 && window.scrollTo(0, document.body.scrollHeight) scroll && current > 0 && window.scrollTo(0, document.body.scrollHeight);
tab && axiosRequest({ tab && axiosRequest({
method: 'post', method: 'post',
url: '/idtAppServiceV6/oApp/getGridDataList', url: '/idtAppServiceV6/oApp/getGridDataList',
...@@ -79,12 +79,12 @@ const Notice = (props) => { ...@@ -79,12 +79,12 @@ const Notice = (props) => {
}; };
const tabSearch = val => { const tabSearch = val => {
setCurrent(0); setCurrent(0);
setData([]) setData([]);
setSearchWord(val) setSearchWord(val);
setEnd(true) setEnd(true)
} }
useEffect(() => { useEffect(() => {
window.scrollTo(0, 0) window.scrollTo(0, 0);
getData() getData()
}, []) }, [])
useEffect(() => { useEffect(() => {
......
import React, {useState} from 'react'; import React, {useState, useEffect} from 'react';
import { createForm } from 'rc-form'; import { createForm } from 'rc-form';
import Upload from 'rc-upload';
import {DatePicker, List, WhiteSpace, WingBlank, Picker, Checkbox, Modal} from "antd-mobile";
import axiosRequest from "../../../utils/request"; import axiosRequest from "../../../utils/request";
import {DatePicker, List, WhiteSpace, WingBlank, Picker, InputItem, Toast, Modal, Checkbox, Button} from "antd-mobile";
import MailA from '../../../components/Adjunct/MailA' import MailA from '../../../components/Adjunct/MailA'
import AddGood from './AddGood' import Upload from 'rc-upload';
import './index.less' import './index.less'
import moment from 'moment'
import fileRequest from "../../../utils/fileRequest";
import AddGood from "./AddGood";
const alert = Modal.alert;
const Item = Checkbox.CheckboxItem; const Item = Checkbox.CheckboxItem;
const AgreeItem = Checkbox.AgreeItem; const AgreeItem = Checkbox.AgreeItem;
const alert = Modal.alert;
const Send = (props) => { const Send = (props) => {
const {name} = props.match.params;
const {getFieldProps} = props.form; const {getFieldProps} = props.form;
const [loading, setLoading] = useState(false);
const [goodSubmit, setGoodSubmit] = useState(false);
const onSubmit = () => { const onSubmit = () => {
props.form.validateFields({ force: true }, (error) => { props.form.validateFields({ force: true }, (error) => {
if (!error) { if (!error) {
const values = props.form.getFieldsValue(); const values = props.form.getFieldsValue();
console.log(values); const keys = Object.keys(values);
keys.map(item => {
!values[item] && (delete values[item]);
Array.isArray(values[item]) && values[item].length === 1 && (values[item] = values[item][0]);
values[item] instanceof Date && ( values[item] = moment(values[item]).format("YYYY-MM-DD HH:mm:ss"))
return null;
});
setLoading(true);
axiosRequest({ axiosRequest({
method: 'post', method: 'post',
url: '/idtAppServiceV6/application/interfaces/addCalendar.jsp', url: '/idtAppServiceV6/oApp/save',
body: values, body: {
}).then(res => {}); params: JSON.stringify(values),
dealInfo:JSON.stringify({flowTbId: submitData.flowTbId}),
tableId: submitData.tableId,
operateId: submitData.operateId,
templateId: submitData.templateId
},
}).then(res => {
setLoading(false);
new Promise((resolve => {
res.uuid && uploadFile(upload2, 'fj', res.uuid);
resolve()
})).then(() => {
if (name !== '办公用品采购') {
res.uuid && Toast.success('新增成功');
props.history.goBack()
}else {
setGoodSubmit(true)
}
})
});
} }
}); });
}; };
const district = [ const [upload2, setUpload2] = useState([]);
{label: '111', value: '111'}
];
/*附件*/ const uploaderProps2 = {
const [upload, setUpload] = useState([]);
const uploaderProps = {
multiple: true, multiple: true,
beforeUpload(file) { beforeUpload(file) {
const newUpload = [...upload, file]; const newUpload = [...upload2, file];
setUpload(newUpload); setUpload2(newUpload);
return false return false
} }
}; };
const uploadDelete = uid => { const uploadDelete2 = uid => {
const newData = [...upload]; const newData = [...upload2];
const Index = newData.findIndex(item => item.uid === uid); const Index = newData.findIndex(item => item.uid === uid);
Index > -1 && newData.splice(Index, 1); Index > -1 && newData.splice(Index, 1);
setUpload(newData) setUpload2(newData)
};
const uploadFile = (upload, name, attachId) => {
const formData = new FormData();
upload.length > 0 && upload.forEach(file => {
formData.append('blob', file);
});
upload.length > 0 && fileRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/balanceUploadFile',
body: {
tableId: submitData.tableId,
ATTACH_ID: attachId,
FIELDNAME: name,
FILENAME: 'base64'
},
payload: formData
}).then(res => {
console.log(res)
// Toast.success('发送成功');
});
}
const [formData, setFormData] = useState([]);
const [submitData, setSubmitData] = useState({});
useEffect(() => {
const menuParams = localStorage.getItem('menu');
const menu = JSON.parse(menuParams);
const menuIndex = menu.findIndex(item => item.text === name);
menuIndex > -1 && menu[menuIndex].children.length > 0 && axiosRequest({
method: 'post',
url: `/idtAppServiceV6/oApp/dispatcher`,
body: {operateId: menu[menuIndex].children[0].id, formType: 'form'}
}).then(res => {
const dataSource = res.elementList.map((item, index) => {
const group = {};
group.type = item.colType;
group.type === 'DATE' && (group.dateType = item.dateType);
group.label = item.showName.replace(/\s+/g,"");
item.dict && item.dict.data && item.dict.data.length > 0 && (group.data = item.dict.data.map(item => ({label: item.DISP_VALUE, value: item.REAL_VALUE})));
return group;
});
setSubmitData(res.property)
setFormData(dataSource)
});
}, []);
const getMode = val => {
const date = /^(\w{4})-(\w{2})-(\w{2})$/;
const time = /^(\w{2}):(\w{2}):(\w{2})$/;
return date.test(val) ? 'date' : (time.test(val) ? 'time' : 'datetime')
}; };
/*添加、删除物品*/
const [goods, setGoods] = useState([]); const [goods, setGoods] = useState([]);
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const [sGood, setSGood] = useState([]); const [sGood, setSGood] = useState([]);
...@@ -88,28 +167,56 @@ const Send = (props) => { ...@@ -88,28 +167,56 @@ const Send = (props) => {
const newGoods = [...goods]; const newGoods = [...goods];
newGoods[index].checked = !newGoods[index].checked; newGoods[index].checked = !newGoods[index].checked;
setGoods(newGoods) setGoods(newGoods)
} };
return ( return (
<div> <div>
<AddGood
visible={visible}
onClose={() => setVisible(false)}
addGoods={addGoods}
/>
<form> <form>
<List className="send-content"> <List className="send-content">
<Picker data={district} cols={1} {...getFieldProps('ss1')}> {formData.length > 0 && (
<List.Item arrow="horizontal">申请人</List.Item> <div>
{formData.map((item, index) => {
if (item.type === 'DATE') {
return (
<DatePicker key={index} mode={getMode(item.dateType)} className="send-date-style"{...getFieldProps(item.label)}>
<List.Item arrow="horizontal">{item.label}</List.Item>
</DatePicker>
)
}else if (item.data) {
return (
<Picker key={index} data={item.data} cols={1} {...getFieldProps(item.label)}>
<List.Item arrow="horizontal">{item.label}</List.Item>
</Picker> </Picker>
)
} else {
return <InputItem key={index}{...getFieldProps(item.label)}>{item.label}</InputItem>
}
})}
<DatePicker className="send-date-style"{...getFieldProps('endtime')}> <div className="am-textarea-label upload-title">附件:</div>
<List.Item arrow="horizontal">申请日期</List.Item> <WingBlank>
</DatePicker> {upload2.length > 0 && upload2.map((item, index) => (
<DatePicker className="send-date-style"{...getFieldProps('endtime2')}> <MailA key={index} data={item} onDelete={uploadDelete2}/>
<List.Item arrow="horizontal">申请科室</List.Item> ))}
</DatePicker> </WingBlank>
<Upload className="auto-upload" {...uploaderProps2}>
<a className="auto-upload">上传附件 +</a>
</Upload>
<WhiteSpace/>
<WingBlank>
<Button onClick={onSubmit} loading={loading} type="primary">保存并添加办公用品</Button>
</WingBlank>
<List.Item extra={ <List.Item extra={
<div className="good-btn-content"> <div className="good-btn-content">
<div className="good-btn mr-12 c-primary" onClick={() => setVisible(true)}>添加</div> <div className="good-btn mr-12 c-primary" onClick={() => setVisible(true)}>添加</div>
<div className={`good-btn ${sGood.length > 0 ? 'c-orange' : 'c-gray'}`} onClick={setGoods.length > 0 && deleteGood}>删除</div> <div className={`good-btn ${sGood.length > 0 ? 'c-orange' : 'c-gray'}`} onClick={setGoods.length > 0 && deleteGood}>删除</div>
</div> </div>
}>申请物品</List.Item> }>申请物品</List.Item>
<WhiteSpace/>
{goods.length > 0 && (<Item onChange={(val) => selectAll(val.target.checked)}>全选</Item>)} {goods.length > 0 && (<Item onChange={(val) => selectAll(val.target.checked)}>全选</Item>)}
{goods.length > 0 && goods.map((item, index) => ( {goods.length > 0 && goods.map((item, index) => (
<AgreeItem className="mt-10" key={index} checked={sGood.findIndex(item => item.id === index) > -1} onChange={(val) => checkGood(index, val.target.checked)}> <AgreeItem className="mt-10" key={index} checked={sGood.findIndex(item => item.id === index) > -1} onChange={(val) => checkGood(index, val.target.checked)}>
...@@ -128,24 +235,11 @@ const Send = (props) => { ...@@ -128,24 +235,11 @@ const Send = (props) => {
</div> </div>
</AgreeItem> </AgreeItem>
))} ))}
{/*附件*/}
<div className="am-textarea-label upload-title">附件:</div>
<WingBlank>
{upload.length > 0 && upload.map((item, index) => (
<MailA key={index} data={item} onDelete={uploadDelete}/>
))}
</WingBlank>
<Upload className="auto-upload" {...uploaderProps}>
<a className="auto-upload">上传附件 +</a>
</Upload>
<WhiteSpace/> <WhiteSpace/>
</List>
<div className="event-footer">
<div className="event-footer-button" onClick={onSubmit}>发送</div>
</div> </div>
)}
</List>
</form> </form>
<AddGood visible={visible} onClose={() => setVisible(false)} addGoods={addGoods}/>
</div> </div>
); );
}; };
......
import React, {useState, useEffect} from 'react';
import { createForm } from 'rc-form';
import axiosRequest from "../../../utils/request";
import {DatePicker, List, WhiteSpace, WingBlank, Picker, InputItem, Toast, Button} from "antd-mobile";
import MailA from '../../../components/Adjunct/MailA'
import Upload from 'rc-upload';
import './index.less'
import moment from 'moment'
import fileRequest from "../../../utils/fileRequest";
import MeetInfo from './MeetInfo'
import PeopleInfo from './PeopleInfo'
const Send = (props) => {
const {name} = props.match.params;
const {getFieldProps} = props.form;
const [UUID, setUUID] = useState();
const [meetPerson, setMeetPerson] = useState([])
const onSubmit = () => {
props.form.validateFields({ force: true }, (error) => {
if (!error) {
const values = props.form.getFieldsValue();
const keys = Object.keys(values);
keys.map(item => {
!values[item] && (delete values[item]);
Array.isArray(values[item]) && values[item].length === 1 && (values[item] = values[item][0]);
values[item] instanceof Date && ( values[item] = moment(values[item]).format("YYYY-MM-DD HH:mm:ss"))
return null;
});
values['会议地点'] = HYSDD;
!UUID && axiosRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/save',
body: {
params: JSON.stringify(values),
dealInfo:JSON.stringify({flowTbId: submitData.flowTbId}),
tableId: submitData.tableId,
operateId: submitData.operateId,
templateId: submitData.templateId
},
}).then(res => {
res.uuid && setUUID(res.uuid);
});
UUID && new Promise((resolve => {
uploadFile(upload, 'zw', UUID);
uploadFile(upload2, 'fj', UUID);
resolve()
})).then(() => {
Toast.success('新增成功');
props.history.goBack()
})
}
});
};
const [upload, setUpload] = useState([]);
const [upload2, setUpload2] = 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 uploaderProps2 = {
multiple: true,
beforeUpload(file) {
const newUpload = [...upload2, file];
setUpload2(newUpload);
return false
}
};
const uploadDelete2 = uid => {
const newData = [...upload2];
const Index = newData.findIndex(item => item.uid === uid);
Index > -1 && newData.splice(Index, 1);
setUpload2(newData)
};
const uploadFile = (upload, name, attachId) => {
const formData = new FormData();
upload.length > 0 && upload.forEach(file => {
formData.append('blob', file);
});
upload.length > 0 && fileRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/balanceUploadFile',
body: {
tableId: submitData.tableId,
ATTACH_ID: attachId,
FIELDNAME: name,
FILENAME: 'base64'
},
payload: formData
}).then(res => {
console.log(res)
// Toast.success('发送成功');
});
}
const [formData, setFormData] = useState([]);
const [submitData, setSubmitData] = useState({});
useEffect(() => {
const menuParams = localStorage.getItem('menu');
const menu = JSON.parse(menuParams);
const menuIndex = menu.findIndex(item => item.text === name);
menuIndex > -1 && menu[menuIndex].children.length > 0 && axiosRequest({
method: 'post',
url: `/idtAppServiceV6/oApp/dispatcher`,
body: {operateId: menu[menuIndex].children[0].id, formType: 'form'}
}).then(res => {
const dataSource = res.elementList.map((item, index) => {
const group = {};
group.type = item.colType;
group.type === 'DATE' && (group.dateType = item.dateType);
group.label = item.showName.replace(/\s+/g,"");
item.dict && item.dict.data && item.dict.data.length > 0 && (group.data = item.dict.data.map(item => ({label: item.DISP_VALUE, value: item.REAL_VALUE})));
return group;
});
setSubmitData(res.property)
setFormData(dataSource)
});
}, []);
const getMode = val => {
const date = /^(\w{4})-(\w{2})-(\w{2})$/;
const time = /^(\w{2}):(\w{2}):(\w{2})$/;
return date.test(val) ? 'date' : (time.test(val) ? 'time' : 'datetime')
};
const [placeVisible, setPlaceVisible] = useState(false);
const [personVisible, setPersonVisible] = useState(false);
const getPlace = () => {
setPlaceVisible(true)
};
const getPerson = () => {
setPersonVisible(true)
};
const [HYSDD, setHYSDD] = useState();
const selectRoom = HYSDD => {
setHYSDD(HYSDD);
};
const [sP, setSP] = useState([])
return (
<div>
<MeetInfo
visible={placeVisible}
onClose={setPlaceVisible}
selectR={selectRoom}
/>
<PeopleInfo
visible={personVisible}
onClose={setPersonVisible}
/>
<form>
<List className="send-content">
{formData.length > 0 && (
<div>
{formData.map((item, index) => {
if (item.type === 'DATE') {
return (
<DatePicker key={index} mode={getMode(item.dateType)} className="send-date-style"{...getFieldProps(item.label)}>
<List.Item arrow="horizontal">{item.label}</List.Item>
</DatePicker>
)
}else if (item.data) {
return (
<Picker key={index} data={item.data} cols={1} {...getFieldProps(item.label)}>
<List.Item arrow="horizontal">{item.label}</List.Item>
</Picker>
)
}else if (item.label === '会议地点') {
return (
<List.Item className="auto-flex" extra={
<div className="pos-aline">
<div className="meet-select-btn" onClick={getPlace}>选择会议地点</div>
<div className="ml-40 room-num">{HYSDD}</div>
</div>
}>会议地点</List.Item>
)
} else if (item.label === '参会人员') {
return (
<List.Item className="auto-flex" extra={
<div className="pos-aline">
<div className="meet-select-btn" onClick={getPerson}>选择参会人员</div>
<div className="ml-40 room-num">{sP.length}</div>
</div>
}>参会人员</List.Item>
)
} else {
return <InputItem key={index}{...getFieldProps(item.label)}>{item.label}</InputItem>
}
})}
{/*正文*/}
<div className="am-textarea-label upload-title">正文:</div>
<WingBlank>
{upload.length > 0 && upload.map((item, index) => (
<MailA key={index} data={item} onDelete={uploadDelete}/>
))}
</WingBlank>
<Upload className="auto-upload" {...uploaderProps}>
<a className="auto-upload">上传正文 +</a>
</Upload>
<WhiteSpace/>
<div className="am-textarea-label upload-title">附件:</div>
<WingBlank>
{upload2.length > 0 && upload2.map((item, index) => (
<MailA key={index} data={item} onDelete={uploadDelete2}/>
))}
</WingBlank>
<Upload className="auto-upload" {...uploaderProps2}>
<a className="auto-upload">上传附件 +</a>
</Upload>
<WhiteSpace/>
</div>
)}
</List>
{formData.length > 0 && (
<div className="event-footer">
{/*<Button type="primary">保存</Button>*/}
<div className={`footer-button ${meetPerson.length > 0 ? '' : 'btn-disabled'}`} onClick={meetPerson.length === 0 ? onSubmit : null}>保存</div>
</div>
)}
</form>
</div>
);
};
export default createForm()(Send);
import React, {useState} from 'react'; import React, {useState, useEffect} from 'react';
import {Modal, WhiteSpace, WingBlank} from "antd-mobile"; import {List, Modal, WhiteSpace, WingBlank} from "antd-mobile";
import './index.less' import './index.less'
import axiosRequest from "../../../utils/request";
const alert = Modal.alert;
const Send = (props) => { const Send = (props) => {
const [visible, setVisible] = useState(false); const {visible, onClose, selectR} = props
const data = [{}, {}, {}, {}]; const selectRoom = (HYSDD) => {
onClose(false);
alert('会议室选择', '确定选中此会议室吗', [
{ text: '取消', onPress: () => onClose(true)},
{ text: '确认',
onPress: () =>{
selectR(HYSDD)
}
},
])
};
const [data, setData] = useState([]);
useEffect(() => {
const developer = localStorage.getItem('developer');
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/control/getGrid',
body: {
script: 'getMeetRoom',
replaceMap: JSON.stringify({developer}),
args: JSON.stringify([]),
keys: JSON.stringify([])
},
}).then((res) => {
setData(res.DataList)
})
}, []);
return ( return (
<div> <div>
<WingBlank>
<WhiteSpace/>
<div>
{data.length > 0 && data.map((item, index) => (
<div>
<div>
</div>
<span>{['科兴', '申请中', ''][item]}</span>
</div>
))}
</div>
</WingBlank>
<Modal <Modal
title="选择会议室" title="选择会议室"
className="date-modal" className="date-modal"
visible={visible} visible={visible}
transparent transparent
onClose={() => setVisible(false)} onClose={() => onClose(false)}
> >
<WingBlank className="meet-room">
<List>
{data && data.length > 0 && data.map((item, index) => (
<List.Item className="room-flex" key={index} onClick={() => selectRoom(item.HYSDD)} extra={
<div>{item.ZT}</div>
}> {item.HYSM}{item.HYSDD}</List.Item>
))}
</List>
<WhiteSpace/>
</WingBlank>
</Modal> </Modal>
</div> </div>
); );
......
import React, {useState, useEffect} from 'react';
import { createForm } from 'rc-form';
import axiosRequest from "../../../utils/request";
import {DatePicker, List, TextareaItem, WhiteSpace, WingBlank, Picker, InputItem} from "antd-mobile";
import MailA from '../../../components/Adjunct/MailA'
import Upload from 'rc-upload';
import './index.less'
import queryString from "query-string";
const Send = (props) => {
const [searchValue, setSearchValue] = useState({});
useEffect(() => {
const query = queryString.parse(props.location.search);
let search = {};
if (Object.keys(query).length > 0) {
const data = JSON.parse(localStorage.getItem('search'));
search = {...data, ...query}
}
setSearchValue(search);
localStorage.removeItem('search')
}, []);
const {getFieldProps} = props.form;
const onSubmit = () => {
props.form.validateFields({ force: true }, (error) => {
if (!error) {
const values = props.form.getFieldsValue();
console.log(values);
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/application/interfaces/addCalendar.jsp',
body: values,
}).then(res => {});
}
});
};
const district = [
{label: '111', value: '111'}
];
const [upload2, setUpload2] = useState([]);
const uploaderProps2 = {
multiple: true,
beforeUpload(file) {
const newUpload = [...upload2, file];
setUpload2(newUpload);
return false
}
};
const uploadDelete2 = uid => {
const newData = [...upload2];
const Index = newData.findIndex(item => item.uid === uid);
Index > -1 && newData.splice(Index, 1);
setUpload2(newData)
};
const CustomChildren = ({ extra, onClick }) => (
<div onClick={onClick} className="time-meeting">
<span>{extra}</span>
</div>
);
const getPlace = () => {
// saveValue()
};
const getPeople = () => {
// saveValue()
};
const saveValue = values => {
localStorage.setItem('search', JSON.stringify(values))
}
return (
<div>
<form>
<List className="send-content">
<InputItem {...getFieldProps('s1')}>会议标题</InputItem>
<DatePicker mode="date" className="send-date-style" {...getFieldProps('endtime', {initialValue: setSearchValue.endtime})}>
<List.Item arrow="horizontal">会议日期</List.Item>
</DatePicker>
<List.Item className="auto-flex-2" extra={
<div className="pos-aline auto-time-select">
<DatePicker mode="time" className="send-date-style" {...getFieldProps('endtime', {initialValue: setSearchValue.endtime22})}>
<CustomChildren/>
</DatePicker>
-
<DatePicker mode="time" className="send-date-style" {...getFieldProps('endtime22', {initialValue: setSearchValue.endtime22})}>
<CustomChildren/>
</DatePicker>
</div>
}>会议时间</List.Item>
<List.Item className="auto-flex" extra={
<div>
<div className="meet-select-btn">选择会议地点</div>
</div>
}>会议地点</List.Item>
<InputItem {...getFieldProps('s3')}>参加人数</InputItem>
<Picker data={district} cols={1} {...getFieldProps('ss1', {preserve: true})}>
<List.Item arrow="horizontal">会议类别</List.Item>
</Picker>
<InputItem {...getFieldProps('s3')}>预约单位</InputItem>
<DatePicker mode="date" className="send-date-style" {...getFieldProps('endtime2', {preserve: true})}>
<List.Item arrow="horizontal">预约时间</List.Item>
</DatePicker>
<List.Item extra="11111">预约人</List.Item>
<InputItem {...getFieldProps('s3s')}>联系方式</InputItem>
<List.Item className="auto-flex" extra={
<div>
<div className="meet-select-btn">选择参会人员</div>
</div>
}>参会人员</List.Item>
<TextareaItem
title="备注"
placeholder="请输入备注"
{...getFieldProps('_mail_editor_text')}
rows={4}
/>
{/*附件*/}
<div className="am-textarea-label upload-title">附件:</div>
<WingBlank>
{upload2.length > 0 && upload2.map((item, index) => (
<MailA key={index} data={item} onDelete={uploadDelete2}/>
))}
</WingBlank>
<Upload className="auto-upload" {...uploaderProps2}>
<a className="auto-upload">上传附件 +</a>
</Upload>
<WhiteSpace/>
</List>
<div className="event-footer">
<div className="event-footer-button" onClick={onSubmit}>发送</div>
</div>
</form>
</div>
);
};
export default createForm()(Send);
import React, {useState, useEffect} from 'react';
import { createForm } from 'rc-form';
import axiosRequest from "../../../utils/request";
import {DatePicker, List, WhiteSpace, WingBlank, Picker, InputItem, Toast, Modal, Checkbox, Button} from "antd-mobile";
import MailA from '../../../components/Adjunct/MailA'
import Upload from 'rc-upload';
import './index.less'
import moment from 'moment'
import fileRequest from "../../../utils/fileRequest";
import MeetInfo from './MeetInfo'
import PeopleInfo from './PeopleInfo'
import AddGood from "./AddGood";
const alert = Modal.alert;
const Item = Checkbox.CheckboxItem;
const AgreeItem = Checkbox.AgreeItem;
const Send = (props) => {
const {name} = props.match.params;
const {getFieldProps} = props.form;
const [loading, setLoading] = useState(false);
const [goodSubmit, setGoodSubmit] = useState(false)
const onSubmit = () => {
props.form.validateFields({ force: true }, (error) => {
if (!error) {
const values = props.form.getFieldsValue();
const keys = Object.keys(values);
keys.map(item => {
!values[item] && (delete values[item]);
Array.isArray(values[item]) && values[item].length === 1 && (values[item] = values[item][0]);
values[item] instanceof Date && ( values[item] = moment(values[item]).format("YYYY-MM-DD HH:mm:ss"))
return null;
});
name === '会议申请' && (values['会议地点'] = HYSDD);
setLoading(true);
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/save',
body: {
params: JSON.stringify(values),
dealInfo:JSON.stringify({flowTbId: submitData.flowTbId}),
tableId: submitData.tableId,
operateId: submitData.operateId,
templateId: submitData.templateId
},
}).then(res => {
setLoading(false);
new Promise((resolve => {
res.uuid && uploadFile(upload, 'zw', res.uuid);
res.uuid && uploadFile(upload2, 'fj', res.uuid);
resolve()
})).then(() => {
if (name !== '办公用品采购') {
res.uuid && Toast.success('新增成功');
props.history.goBack()
}else {
setGoodSubmit(true)
}
})
});
}
});
};
const [upload, setUpload] = useState([]);
const [upload2, setUpload2] = 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 uploaderProps2 = {
multiple: true,
beforeUpload(file) {
const newUpload = [...upload2, file];
setUpload2(newUpload);
return false
}
};
const uploadDelete2 = uid => {
const newData = [...upload2];
const Index = newData.findIndex(item => item.uid === uid);
Index > -1 && newData.splice(Index, 1);
setUpload2(newData)
};
const uploadFile = (upload, name, attachId) => {
const formData = new FormData();
upload.length > 0 && upload.forEach(file => {
formData.append('blob', file);
});
upload.length > 0 && fileRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/balanceUploadFile',
body: {
tableId: submitData.tableId,
ATTACH_ID: attachId,
FIELDNAME: name,
FILENAME: 'base64'
},
payload: formData
}).then(res => {
console.log(res)
// Toast.success('发送成功');
});
}
const [formData, setFormData] = useState([]);
const [submitData, setSubmitData] = useState({});
useEffect(() => {
const menuParams = localStorage.getItem('menu');
const menu = JSON.parse(menuParams);
const menuIndex = menu.findIndex(item => item.text === name);
menuIndex > -1 && menu[menuIndex].children.length > 0 && axiosRequest({
method: 'post',
url: `/idtAppServiceV6/oApp/dispatcher`,
body: {operateId: menu[menuIndex].children[0].id, formType: 'form'}
}).then(res => {
const dataSource = res.elementList.map((item, index) => {
const group = {};
group.type = item.colType;
group.type === 'DATE' && (group.dateType = item.dateType);
group.label = item.showName.replace(/\s+/g,"");
item.dict && item.dict.data && item.dict.data.length > 0 && (group.data = item.dict.data.map(item => ({label: item.DISP_VALUE, value: item.REAL_VALUE})));
return group;
});
setSubmitData(res.property)
setFormData(dataSource)
});
}, []);
const getMode = val => {
const date = /^(\w{4})-(\w{2})-(\w{2})$/;
const time = /^(\w{2}):(\w{2}):(\w{2})$/;
return date.test(val) ? 'date' : (time.test(val) ? 'time' : 'datetime')
};
const [placeVisible, setPlaceVisible] = useState(false);
const [personVisible, setPersonVisible] = useState(false);
const getPlace = () => {
setPlaceVisible(true)
};
const getPerson = () => {
setPersonVisible(true)
};
const [HYSDD, setHYSDD] = useState();
const selectRoom = HYSDD => {
setHYSDD(HYSDD);
}
const [goods, setGoods] = useState([]);
const [visible, setVisible] = useState(false);
const [sGood, setSGood] = useState([]);
const checkGood = (index, checked) => {
const newData = [...sGood];
const Index = sGood.findIndex(item => item.id === index);
checked ? newData.push(goods[index]) : newData.splice(Index, 1);
setSGood(newData)
};
const addGoods = (values) => {
const newGood = [...goods, values];
const newGoods = newGood.map((item, index) => ({...item, id: index, checked: false}));
setGoods(newGoods)
};
const selectAll = (checked) => {
setSGood(checked ? goods : [])
};
const deleteGood = () => {
alert('删除记录', '确定删除选中的记录', [
{ text: '取消'},
{ text: '确认',
onPress: () =>{
const ids = sGood.map(item => item.id);
const result = goods.filter(item => ids.indexOf(item.id) < 0);
setGoods(result);
setSGood([]);
}
},
])
};
const getGoodInfo = (index, e) => {
e.preventDefault();
const newGoods = [...goods];
newGoods[index].checked = !newGoods[index].checked;
setGoods(newGoods)
};
return (
<div>
<MeetInfo
visible={placeVisible}
onClose={setPlaceVisible}
selectR={selectRoom}
/>
<PeopleInfo
visible={personVisible}
onClose={setPersonVisible}
/>
<AddGood
visible={visible}
onClose={() => setVisible(false)}
addGoods={addGoods}
/>
<form>
<List className="send-content">
{formData.length > 0 && (
<div>
{formData.map((item, index) => {
if (item.type === 'DATE') {
return (
<DatePicker key={index} mode={getMode(item.dateType)} className="send-date-style"{...getFieldProps(item.label)}>
<List.Item arrow="horizontal">{item.label}</List.Item>
</DatePicker>
)
}else if (item.data) {
return (
<Picker key={index} data={item.data} cols={1} {...getFieldProps(item.label)}>
<List.Item arrow="horizontal">{item.label}</List.Item>
</Picker>
)
}else if (item.label === '会议地点') {
return (
<List.Item className="auto-flex" extra={
<div className="pos-aline">
<div className="meet-select-btn" onClick={getPlace}>选择会议地点</div>
<div id="room-number" className="ml-40 room-num">{HYSDD}</div>
</div>
}>会议地点</List.Item>
)
} else if (item.label === '参会人员') {
return (
<List.Item className="auto-flex" extra={
<div>
<div className="meet-select-btn" onClick={getPerson}>选择参会人员</div>
</div>
}>参会人员</List.Item>
)
} else {
return <InputItem key={index}{...getFieldProps(item.label)}>{item.label}</InputItem>
}
})}
{/*正文*/}
<div className="am-textarea-label upload-title">正文:</div>
<WingBlank>
{upload.length > 0 && upload.map((item, index) => (
<MailA key={index} data={item} onDelete={uploadDelete}/>
))}
</WingBlank>
<Upload className="auto-upload" {...uploaderProps}>
<a className="auto-upload">上传正文 +</a>
</Upload>
<WhiteSpace/>
<div className="am-textarea-label upload-title">附件:</div>
<WingBlank>
{upload2.length > 0 && upload2.map((item, index) => (
<MailA key={index} data={item} onDelete={uploadDelete2}/>
))}
</WingBlank>
<Upload className="auto-upload" {...uploaderProps2}>
<a className="auto-upload">上传附件 +</a>
</Upload>
<WhiteSpace/>
{name === '办公用品采购' && (
<div>
{!goodSubmit && (
<WingBlank>
<Button onClick={onSubmit} loading={loading} type="primary">添加办公用品</Button>
</WingBlank>
)}
<List.Item extra={
<div className="good-btn-content">
<div className="good-btn mr-12 c-primary" onClick={() => setVisible(true)}>添加</div>
<div className={`good-btn ${sGood.length > 0 ? 'c-orange' : 'c-gray'}`} onClick={setGoods.length > 0 && deleteGood}>删除</div>
</div>
}>申请物品</List.Item>
<WhiteSpace/>
{goods.length > 0 && (<Item onChange={(val) => selectAll(val.target.checked)}>全选</Item>)}
{goods.length > 0 && goods.map((item, index) => (
<AgreeItem className="mt-10" key={index} checked={sGood.findIndex(item => item.id === index) > -1} onChange={(val) => checkGood(index, val.target.checked)}>
<div className="good-item-box" onClick={(e) => getGoodInfo(index, e)}>
<div className="good-item-content">
品名:{item.name || ''}
<img src="/img/rarrow.png" alt="" className={`icon18 ${item.checked ? 'icon-checked' : 'icon-unchecked'}`}/>
</div>
{item.checked && (
<div>
<div className="good-item-content">领取人:{item.name || ''}</div>
<div className="good-item-content">申请数量:{item.name || ''}</div>
<div className="good-item-content">实际发放数量:{item.name || ''}</div>
</div>
)}
</div>
</AgreeItem>
))}
<WhiteSpace/>
</div>
)}
</div>
)}
</List>
{formData.length > 0 && name !== '办公用品采购' && (
<div className="event-footer">
<div className="event-footer-button" onClick={onSubmit}>发送</div>
</div>
)}
</form>
</div>
);
};
export default createForm()(Send);
import React, {useState} from 'react';
import { createForm } from 'rc-form';
import axiosRequest from "../../../utils/request";
import {DatePicker, List, TextareaItem, WhiteSpace, WingBlank, Picker} from "antd-mobile";
import MailA from '../../../components/Adjunct/MailA'
import Upload from 'rc-upload';
import './index.less'
const Send = (props) => {
const {getFieldProps} = props.form;
const onSubmit = () => {
props.form.validateFields({ force: true }, (error) => {
if (!error) {
const values = props.form.getFieldsValue();
console.log(values);
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/application/interfaces/addCalendar.jsp',
body: values,
}).then(res => {});
}
});
};
const district = [
{label: '111', value: '111'}
];
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)
};
return (
<div>
<form>
<List className="send-content">
<Picker data={district} cols={1} {...getFieldProps('ss1')}>
<List.Item arrow="horizontal">标题</List.Item>
</Picker>
<DatePicker mode="date" className="send-date-style"{...getFieldProps('endtime')}>
<List.Item arrow="horizontal">登记日期</List.Item>
</DatePicker>
<List.Item extra="11111">登记人</List.Item>
<DatePicker mode="date" className="send-date-style"{...getFieldProps('endtime2')}>
<List.Item arrow="horizontal">发布日期</List.Item>
</DatePicker>
<DatePicker mode="date" className="send-date-style"{...getFieldProps('endtime3')}>
<List.Item arrow="horizontal">有效期</List.Item>
</DatePicker>
<TextareaItem
title="内容"
placeholder="请输入内容"
{...getFieldProps('_mail_editor_text')}
rows={4}
/>
{/*正文*/}
<div className="am-textarea-label upload-title">附件:</div>
<WingBlank>
{upload.length > 0 && upload.map((item, index) => (
<MailA key={index} data={item} onDelete={uploadDelete}/>
))}
</WingBlank>
<Upload className="auto-upload" {...uploaderProps}>
<a className="auto-upload">上传附件 +</a>
</Upload>
<WhiteSpace/>
</List>
<div className="event-footer">
<div className="event-footer-button" onClick={onSubmit}>发送</div>
</div>
</form>
</div>
);
};
export default createForm()(Send);
import React, {useEffect, useState} from 'react';
import {Button, Modal, WhiteSpace, WingBlank} from "antd-mobile";
import './index.less'
import axiosRequest from "../../../utils/request";
import TreeData from '../../../components/AddressList/TreeData'
const Send = (props) => {
const {visible, onClose} = props;
const closeModal = () => {
onClose(false)
};
const [data, setData] = useState([]);
useEffect(() => {
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/exclude/control/getList',
body: {
script: 'hysqTreeAll',
args: JSON.stringify(['47c2c4f9235aa97f01235aa97f7c0000']),
},
}).then((res) => {
res.map(item => {item.ATTACH_ID = ''; item.checked = false} );
setData(res)
})
}, []);
const onClick = (keyIndex) => {
const newData = JSON.parse(JSON.stringify(data));
// const result = newData.findIndex(item => item.XH === XH);
newData[keyIndex].checked = !newData[keyIndex].checked;
setData(newData)
};
const submit = val => {
console.log(val)
}
return (
<div>
<Modal
title="选择参会人员"
className="date-modal"
visible={visible}
transparent
onClose={() => onClose(false)}
>
<TreeData
data={data}
onClick={onClick}
closeModal={closeModal}
/>
</Modal>
</div>
);
};
export default Send;
import React, {useState} from 'react';
import { createForm } from 'rc-form';
import axiosRequest from "../../../utils/request";
import {DatePicker, List, TextareaItem, WhiteSpace, WingBlank, Picker, InputItem} from "antd-mobile";
import MailA from '../../../components/Adjunct/MailA'
import Upload from 'rc-upload';
import './index.less'
const Send = (props) => {
const {getFieldProps} = props.form;
const onSubmit = () => {
props.form.validateFields({ force: true }, (error) => {
if (!error) {
const values = props.form.getFieldsValue();
console.log(values);
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/application/interfaces/addCalendar.jsp',
body: values,
}).then(res => {});
}
});
};
const district = [
{label: '111', value: '111'}
];
const [upload, setUpload] = useState([]);
const [upload2, setUpload2] = 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 uploaderProps2 = {
multiple: true,
beforeUpload(file) {
const newUpload = [...upload2, file];
setUpload2(newUpload);
return false
}
};
const uploadDelete2 = uid => {
const newData = [...upload2];
const Index = newData.findIndex(item => item.uid === uid);
Index > -1 && newData.splice(Index, 1);
setUpload2(newData)
}
return (
<div>
<form>
<List className="send-content">
<Picker data={district} cols={1} {...getFieldProps('ss11')}>
<List.Item arrow="horizontal">来文单位</List.Item>
</Picker>
<InputItem {...getFieldProps('s1111')}>文件字号</InputItem>
<InputItem {...getFieldProps('s2')}>文件标题</InputItem>
<Picker data={district} cols={1} {...getFieldProps('ss1')}>
<List.Item arrow="horizontal">文件类别</List.Item>
</Picker>
<DatePicker className="send-date-style"{...getFieldProps('endtime')}>
<List.Item arrow="horizontal">收文日期</List.Item>
</DatePicker>
<InputItem {...getFieldProps('s121')}>收文编号</InputItem>
<InputItem {...getFieldProps('s1')}>份数</InputItem>
<Picker data={district} cols={1} {...getFieldProps('ss1')}>
<List.Item arrow="horizontal">文件密级</List.Item>
</Picker>
<Picker data={district} cols={1} {...getFieldProps('ss2')}>
<List.Item arrow="horizontal">紧急程度</List.Item>
</Picker>
<Picker data={district} cols={1} {...getFieldProps('ss3')}>
<List.Item arrow="horizontal">经办人</List.Item>
</Picker>
<Picker data={district} cols={1} {...getFieldProps('ss4')}>
<List.Item arrow="horizontal">联系电话</List.Item>
</Picker>
<TextareaItem
title="拟办意见"
placeholder="请输入拟办意见"
{...getFieldProps('_mail_editor_text')}
rows={4}
/>
{/*正文*/}
<div className="am-textarea-label upload-title">正文:</div>
<WingBlank>
{upload.length > 0 && upload.map((item, index) => (
<MailA key={index} data={item} onDelete={uploadDelete}/>
))}
</WingBlank>
<Upload className="auto-upload" {...uploaderProps}>
<a className="auto-upload">上传正文 +</a>
</Upload>
{/*<WhiteSpace/>*/}
{/*附件*/}
<div className="am-textarea-label upload-title">附件:</div>
<WingBlank>
{upload2.length > 0 && upload2.map((item, index) => (
<MailA key={index} data={item} onDelete={uploadDelete2}/>
))}
</WingBlank>
<Upload className="auto-upload" {...uploaderProps2}>
<a className="auto-upload">上传附件 +</a>
</Upload>
<WhiteSpace/>
</List>
<div className="event-footer">
<div className="event-footer-button" onClick={onSubmit}>发送</div>
</div>
</form>
</div>
);
};
export default createForm()(Send);
import React, {useState} from 'react';
import { createForm } from 'rc-form';
import axiosRequest from "../../../utils/request";
import {DatePicker, List, TextareaItem, WhiteSpace, WingBlank, Picker, InputItem, Switch} from "antd-mobile";
import MailA from '../../../components/Adjunct/MailA'
import Upload from 'rc-upload';
import './index.less'
const Send = (props) => {
const {getFieldProps, setFieldsValue} = props.form;
const onSubmit = () => {
props.form.validateFields({ force: true }, (error) => {
if (!error) {
const values = props.form.getFieldsValue();
console.log(values);
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/application/interfaces/addCalendar.jsp',
body: values,
}).then(res => {});
}
});
};
const district = [
{label: '111', value: '111'}
];
const [upload, setUpload] = useState([]);
const [upload2, setUpload2] = 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 uploaderProps2 = {
multiple: true,
beforeUpload(file) {
const newUpload = [...upload2, file];
setUpload2(newUpload);
return false
}
};
const uploadDelete2 = uid => {
const newData = [...upload2];
const Index = newData.findIndex(item => item.uid === uid);
Index > -1 && newData.splice(Index, 1);
setUpload2(newData)
}
return (
<div>
<form>
<List className="send-content">
<InputItem {...getFieldProps('s1')}>标题</InputItem>
<InputItem {...getFieldProps('s2')}>拟稿人</InputItem>
<InputItem {...getFieldProps('s3')}>拟稿电话</InputItem>
<InputItem {...getFieldProps('s4')}>拟稿部门</InputItem>
<DatePicker className="send-date-style"{...getFieldProps('endtime')}>
<List.Item arrow="horizontal">拟稿日期</List.Item>
</DatePicker>
<Picker data={district} cols={1} {...getFieldProps('ss1')}>
<List.Item arrow="horizontal">核稿人</List.Item>
</Picker>
<Picker data={district} cols={1} {...getFieldProps('ss2')}>
<List.Item arrow="horizontal">复核人</List.Item>
</Picker>
<Picker data={district} cols={1} {...getFieldProps('ss3')}>
<List.Item arrow="horizontal">紧急程度</List.Item>
</Picker>
<Picker data={district} cols={1} {...getFieldProps('ss4')}>
<List.Item arrow="horizontal">密级</List.Item>
</Picker>
<Picker data={district} cols={1} {...getFieldProps('ss5')}>
<List.Item arrow="horizontal">公开属性</List.Item>
</Picker>
<List.Item extra={
<Switch
{...getFieldProps('Switch1', {
initialValue: true,
valuePropName: 'checked',
})}
onClick={(checked) => setFieldsValue({Switch1: checked,})}
/>
}>是否解读</List.Item>
<Picker data={district} cols={1} {...getFieldProps('ss6')}>
<List.Item arrow="horizontal">文种</List.Item>
</Picker>
<Picker data={district} cols={1} {...getFieldProps('ss7')}>
<List.Item arrow="horizontal">主送机关</List.Item>
</Picker>
<Picker data={district} cols={1} {...getFieldProps('ss8')}>
<List.Item arrow="horizontal">抄送机关</List.Item>
</Picker>
<TextareaItem
title="拟办意见"
placeholder="请输入拟办意见"
{...getFieldProps('_mail_editor_text')}
rows={4}
/>
{/*正文*/}
<div className="am-textarea-label upload-title">正文:</div>
<WingBlank>
{upload.length > 0 && upload.map((item, index) => (
<MailA key={index} data={item} onDelete={uploadDelete}/>
))}
</WingBlank>
<Upload className="auto-upload" {...uploaderProps}>
<a className="auto-upload">上传正文 +</a>
</Upload>
{/*<WhiteSpace/>*/}
{/*附件*/}
<div className="am-textarea-label upload-title">附件:</div>
<WingBlank>
{upload2.length > 0 && upload2.map((item, index) => (
<MailA key={index} data={item} onDelete={uploadDelete2}/>
))}
</WingBlank>
<Upload className="auto-upload" {...uploaderProps2}>
<a className="auto-upload">上传附件 +</a>
</Upload>
<WhiteSpace/>
</List>
<div className="event-footer">
<div className="event-footer-button" onClick={onSubmit}>发送</div>
</div>
</form>
</div>
);
};
export default createForm()(Send);
...@@ -97,3 +97,58 @@ ...@@ -97,3 +97,58 @@
border: 1px solid rgba(0, 0, 0, 0.12); border: 1px solid rgba(0, 0, 0, 0.12);
border-radius: 5px; border-radius: 5px;
} }
.meet-room-content{
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 10px;
}
.meet-room > .meet-room-content:not(:last-child){
border-bottom: 1px solid rgba(239, 239, 239, 1);
}
.meet-room > .meet-room-content:first-child{
border-top: 1px solid rgba(239, 239, 239, 1);
}
.room-style{
height: 42px;
}
.room-flex .am-list-line .am-list-content{
flex: 2;
}
.goods-before{
height: 50px;
display: flex;
justify-content: center;
align-items: center;
font-size: 17px;
background: @primary;
color: #ffffff;
margin: 10px 15px;
}
.ml-40{
margin-left: 30px;
}
.room-num{
width: 60px;
height: 29px;
border:0 solid rgba(38, 104, 255, 0.2);
border-radius:6px;
display: flex;
justify-content: center;
align-items: center;
background: rgba(255, 249, 249, 1);
}
.footer-button{
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 15px;
background: @primary;
color: #ffffff;
}
.footer-button.btn-disabled{
background: rgba(151, 151, 151, 1) !important;
}
...@@ -20,6 +20,7 @@ import MainInfo from './pages/UnCommon/Mail/Info' ...@@ -20,6 +20,7 @@ import MainInfo from './pages/UnCommon/Mail/Info'
import MainSend from './pages/UnCommon/Mail/Send' import MainSend from './pages/UnCommon/Mail/Send'
import People from './pages/EventProcessing/UnCommon/People' import People from './pages/EventProcessing/UnCommon/People'
import Login from './pages/Login' import Login from './pages/Login'
import MeetInfo from './pages/Work/components/MeetInfo'
import NoFound from './pages/NoFound' import NoFound from './pages/NoFound'
...@@ -49,6 +50,7 @@ const ReactRouter = () => { ...@@ -49,6 +50,7 @@ const ReactRouter = () => {
<Route path="/blank/people/:attachId" component={People}/> <Route path="/blank/people/:attachId" component={People}/>
<Route path="/blank/application/:id/:uuid/:FLOWTBID" component={Application}/> <Route path="/blank/application/:id/:uuid/:FLOWTBID" component={Application}/>
<Route path="/blank/meet/add-room" component={MeetInfo}/>
<Route path="/blank/work/:type/:name" component={WorkDetail}/> <Route path="/blank/work/:type/:name" component={WorkDetail}/>
<Route path="/blank/work-add/:name" component={WorkAdd}/> <Route path="/blank/work-add/:name" component={WorkAdd}/>
<Route path="/blank/submit/:flowNodeId/:uuid/:flowTbId" component={SubmitDetail}/> <Route path="/blank/submit/:flowNodeId/:uuid/:flowTbId" component={SubmitDetail}/>
......
...@@ -69,6 +69,9 @@ export const createAPI = (baseURL) => { ...@@ -69,6 +69,9 @@ export const createAPI = (baseURL) => {
} }
localStorage.setItem("token", response.data.token); localStorage.setItem("token", response.data.token);
} }
if (response && response.data && response.data.developer) {
localStorage.setItem("developer", response.data.developer);
}
if (response && response.data && response.data.leftOperateBar) { if (response && response.data && response.data.leftOperateBar) {
localStorage.removeItem("menu"); localStorage.removeItem("menu");
const menu = response.data.leftOperateBar.map(item => ({ icon: item.imgType, text: item.nodeName, id: item.id, children: item.children })) const menu = response.data.leftOperateBar.map(item => ({ icon: item.imgType, text: item.nodeName, id: item.id, children: item.children }))
......
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