Commit ce489afc authored by 熊成伟's avatar 熊成伟

debug

parent 64e1bcfb
Pipeline #16373 passed with stages
in 1 minute and 8 seconds
......@@ -129,10 +129,10 @@ const Process = (props) => {
}
}, [basic]);
// const [blyj, setBlyj] = useState();
// console.log(blyj)
const [blyj, setBlyj] = useState();
const optionChange = val => {
// setBlyj(val)
setBlyj(val);
optionBlur()
setDisabled(!(val != null && val !== ''))
};
......@@ -145,6 +145,16 @@ const Process = (props) => {
window.scrollTo(0, document.body.scrollHeight);
optionBlur()
};
const download = (uuid, callback) => {
const developer = localStorage.getItem('developer');
axiosRequest({
method: 'post',
url: `/idtAppServiceV6/oApp/downloadLargeFile`,
body: {uuid, tableId, templateId, developer}
}).then(res => {
callback && callback()
});
}
//tab切换
const tabClick = (name) => {
......@@ -165,7 +175,21 @@ const Process = (props) => {
};
};
const blyjSubmit = () => {
axiosRequest({
method: 'post',
url: `/idtAppServiceV6/oApp/save`,
body: {
tableId,
dealInfo: JSON.stringify({BLYJ: blyj, flowTbId}),
params: JSON.stringify({UUID: uuid})}
}).then(res => {
console.log(res)
});
}
const showActionSheet = () => {
blyjSubmit()
const BUTTON = [];
button.map(item => BUTTON.push(item.button));
const BUTTONS = BUTTON.concat(['取消']);
......@@ -176,8 +200,7 @@ const Process = (props) => {
wrapProps,
},
(buttonIndex) => {
buttonIndex < BUTTONS.length - 1 && subUrl(buttonIndex)
// console.log(buttonIndex)
buttonIndex > -1 && (buttonIndex < BUTTONS.length - 1) && subUrl(buttonIndex)
});
};
const subUrl = key => {
......@@ -242,7 +265,7 @@ const Process = (props) => {
{resultLoading ? <Basic data={basic} attachId={uuid} {...props}/> : <Skeleton/>}
<div id="event-adjunct"/>
<WhiteSpace/>
{resultLoading ? <Adjunct data={adjunctData}/> : <Skeleton/>}
{resultLoading ? <Adjunct download={download} data={adjunctData} tableId={tableId}/> : <Skeleton/>}
<div id="event-flow"/>
<WhiteSpace/>
{resultLoading ? <Flow data={flowData}/> : <Skeleton/>}
......
import React from 'react';
import List from '../../../components/List'
import AdjunctList from '../../../components/Adjunct'
import axiosRequest from "../../../utils/request";
const Adjunct = (props) => {
const {data} = props;
const {data, download} = props;
// const downlaod = (src) => {
// const iframe = document.createElement('iframe');
// iframe.style.display = 'none';
// iframe.src = "javascript: '<script>location.href=\"" + src + "\"<\/script>'";
// document.getElementsByTagName('body')[0].appendChild(iframe);
// }
const download = (uuid) => {
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/downloadLargeFile',
body: {
uuid
},
}).then(res => {
})
const downloadFile = (uuid) => {
download(uuid,)
}
const listData = [
{title: '附件', line: data.length > 0, content:
<div>
{data.length > 0 ? data.map((item, index) => (
<AdjunctList key={index} data={item} onClick={() => download(item.UUID)}/>
<AdjunctList key={index} data={item} onClick={() => downloadFile(item.UUID)}/>
)) : '无'}
</div>
},
......
import React from 'react';
import { createForm } from 'rc-form';
import {List, Picker, InputItem, Button, Modal, TextareaItem} from "antd-mobile";
import {List, Picker, InputItem, Button, Modal, DatePicker} from "antd-mobile";
import './index.less'
const Send = (props) => {
const {visible, onClose, addGoods} = props;
const {visible, onClose, addGoods, columns} = props;
const {getFieldProps, resetFields} = props.form;
const district = [
{label: '111', value: '111'}
];
const handleClose = () => {
resetFields();
onClose()
......@@ -23,7 +19,13 @@ const Send = (props) => {
}
});
}
};
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')
};
return (
<div>
......@@ -36,17 +38,23 @@ const Send = (props) => {
>
<form>
<List className="goods-form">
<InputItem {...getFieldProps('name')}>领取人</InputItem>
<Picker data={district} cols={1} {...getFieldProps('ggf1')}>
<List.Item arrow="horizontal">品名</List.Item>
</Picker>
<InputItem {...getFieldProps('amount')} placeholder={`(库存剩余:${0})`}>申请数量</InputItem>
<TextareaItem
title="内容"
placeholder="请输入内容"
{...getFieldProps('_mail_editor_text')}
rows={4}
/>
{columns && columns.length > 0 && columns.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 {
return <InputItem key={index}{...getFieldProps(item.label)}>{item.label}</InputItem>
}
})}
</List>
</form>
......
......@@ -7,6 +7,7 @@ import Upload from 'rc-upload';
import './index.less'
import moment from 'moment'
import fileRequest from "../../../utils/fileRequest";
import Skeleton from '../../../components/Skeleton'
import AddGood from "./AddGood";
......@@ -20,6 +21,7 @@ const Send = (props) => {
const [loading, setLoading] = useState(false);
const [goodSubmit, setGoodSubmit] = useState(false);
const onSubmit = () => {
props.form.validateFields({ force: true }, (error) => {
if (!error) {
......@@ -44,23 +46,46 @@ const Send = (props) => {
},
}).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)
}
if (res.uuid){
setGoodSubmit(true);
getChildColumns(res.uuid);
upload2.length > 0 && new Promise((resolve => {
res.uuid && uploadFile(upload2, 'fj', res.uuid);
resolve()
})).then(() => {
Toast.success('新增成功');
})
}
})
});
}
});
};
const [childData, setChildData] = useState([])
const getChildColumns = (uuid) => {
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/childDispatcher',
body: {
uuid,
returnJson: true,
templateId: submitData.templateId,
templatePath: 'cgwpxx_list'
},
}).then(res => {
const dataSource = res && res.elementList && 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;
});
setChildData(dataSource)
})
}
const [upload2, setUpload2] = useState([]);
const uploaderProps2 = {
......@@ -102,6 +127,7 @@ const Send = (props) => {
const [formData, setFormData] = useState([]);
const [submitData, setSubmitData] = useState({});
const [loading2, setLoading2] = useState(false)
useEffect(() => {
const menuParams = localStorage.getItem('menu');
const menu = JSON.parse(menuParams);
......@@ -111,7 +137,8 @@ const Send = (props) => {
url: `/idtAppServiceV6/oApp/dispatcher`,
body: {operateId: menu[menuIndex].children[0].id, formType: 'form'}
}).then(res => {
const dataSource = res.elementList.map((item, index) => {
setLoading2(true)
const dataSource = res && res.elementList && res.elementList.map((item, index) => {
const group = {};
group.type = item.colType;
group.type === 'DATE' && (group.dateType = item.dateType);
......@@ -119,7 +146,7 @@ const Send = (props) => {
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)
setSubmitData(res.property);
setFormData(dataSource)
});
}, []);
......@@ -133,17 +160,42 @@ const Send = (props) => {
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);
const checkGood = (id, checked) => {
const newData = JSON.parse(JSON.stringify(sGood));
const Index = sGood.findIndex(item => item.id === id);
const lIndex = goods.findIndex(item => item.id === id);
checked ? newData.push(goods[lIndex]) : 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 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;
});
axiosRequest({
method: 'post',
url: `/idtAppServiceV6/oApp/singleSave`,
body: {
params: JSON.stringify(values),
tableId: submitData.tableId,
}
}).then(res => {
if (res.uuid) {
const newGood = [...goods, {...values, id: res.uuid, checked: false}];
setGoods(newGood)
}
})
};
// const saveGoods = () => {
// const subData = JSON.parse(JSON.stringify(goods));
// subData.map(item => {delete item.id; delete item.checked});
//
// }
const selectAll = (checked) => {
setSGood(checked ? goods : [])
};
......@@ -153,9 +205,21 @@ const Send = (props) => {
{ text: '确认',
onPress: () =>{
const ids = sGood.map(item => item.id);
const result = goods.filter(item => ids.indexOf(item.id) < 0);
setGoods(result);
setSGood([]);
axiosRequest({
method: 'post',
url: `/idtAppServiceV6/oApp/delete`,
body: {
uuids: JSON.stringify(ids),
tableId: submitData.tableId,
}
}).then(res => {
console.log(res)
})
// const result = goods.filter(item => ids.indexOf(item.id) < 0);
// setGoods(result);
// setSGood([]);
}
},
])
......@@ -168,78 +232,89 @@ const Send = (props) => {
newGoods[index].checked = !newGoods[index].checked;
setGoods(newGoods)
};
return (
<div>
<AddGood
columns={childData}
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 {
return <InputItem key={index}{...getFieldProps(item.label)}>{item.label}</InputItem>
}
})}
<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/>
<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>
{loading2 ? (
<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 {
return <InputItem key={index}{...getFieldProps(item.label)}>{item.label}</InputItem>
}
})}
<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/>
{!goodSubmit && (
<WingBlank>
<Button onClick={onSubmit} loading={loading} type="primary">保存并添加办公用品</Button>
</WingBlank>
)}
{goodSubmit && (
<div>
<WhiteSpace/>
<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(child => child.id === item.id) > -1} onChange={(val) => checkGood(item.id, val.target.checked)}>
<div className="good-item-box" onClick={(e) => getGoodInfo(index, e)}>
<div className="good-item-content">
{childData[0].label}{item[childData[0].label] || ''}
<img src="/img/rarrow.png" alt="" className={`icon18 ${item.checked ? 'icon-checked' : 'icon-unchecked'}`}/>
</div>
{item.checked && childData.map((item3, index3) => index3 !== 0 && (
<div key={index3} className="good-item-content">{item3.label}{item[item3.label] || ''}</div>
))}
</div>
</AgreeItem>
))}
<WhiteSpace/>
</div>
</AgreeItem>
))}
<WhiteSpace/>
</div>
)}
</List>
</form>
)}
<WhiteSpace/>
</div>
)}
</List>
</form>
) : <Skeleton/>}
</div>
);
};
......
......@@ -9,6 +9,7 @@ import moment from 'moment'
import fileRequest from "../../../utils/fileRequest";
import MeetInfo from './MeetInfo'
import PeopleInfo from './PeopleInfo'
import Skeleton from '../../../components/Skeleton'
const Send = (props) => {
const {name} = props.match.params;
......@@ -108,6 +109,7 @@ const Send = (props) => {
const [formData, setFormData] = useState([]);
const [submitData, setSubmitData] = useState({});
const [loading2, setLoading2] = useState(false)
useEffect(() => {
const menuParams = localStorage.getItem('menu');
const menu = JSON.parse(menuParams);
......@@ -117,6 +119,7 @@ const Send = (props) => {
url: `/idtAppServiceV6/oApp/dispatcher`,
body: {operateId: menu[menuIndex].children[0].id, formType: 'form'}
}).then(res => {
setLoading2(true);
const dataSource = res.elementList.map((item, index) => {
const group = {};
group.type = item.colType;
......@@ -166,80 +169,83 @@ const Send = (props) => {
peopleData={sP}
onSelect={setSP}
/>
<form>
<List className="send-content">
{loading2 ? (
<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" key={index} 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" key={index} 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>
{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" key={index} 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" key={index} 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 className="event-footer">
{/*<Button type="primary">保存</Button>*/}
<div className={`footer-button ${sP.length > 0 ? '' : 'btn-disabled'}`} onClick={sP.length === 0 ? onSubmit : null}>保存</div>
</div>
)}
</List>
{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>
)}
</form>
</form>
) : <Skeleton/>}
</div>
);
};
......
......@@ -10,11 +10,13 @@ import fileRequest from "../../../utils/fileRequest";
import MeetInfo from './MeetInfo'
import PeopleInfo from './PeopleInfo'
import AddGood from "./AddGood";
import Skeleton from '../../../components/Skeleton'
const alert = Modal.alert;
const Item = Checkbox.CheckboxItem;
const AgreeItem = Checkbox.AgreeItem;
const Send = (props) => {
const {name} = props.match.params;
const {getFieldProps} = props.form;
......@@ -33,6 +35,8 @@ const Send = (props) => {
return null;
});
name === '会议申请' && (values['会议地点'] = HYSDD);
// name === '收文管理' && (values['文号'] = HYSDD);
// name === '发文管理' && (values['编号'] = HYSDD);
setLoading(true);
axiosRequest({
method: 'post',
......@@ -119,15 +123,20 @@ const Send = (props) => {
const [formData, setFormData] = useState([]);
const [submitData, setSubmitData] = useState({});
const [numberData, setNumberData] = useState([]);
const [numberList, setNumberList] = useState([]);
const [loading2, setLoading2] = useState(false);
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 => {
setLoading2(true)
const dataSource = res.elementList.map((item, index) => {
const group = {};
group.type = item.colType;
......@@ -136,7 +145,12 @@ const Send = (props) => {
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)
const numberIndex = dataSource.findIndex(item =>
name === '收文管理' ? (item.label === '来文机关或部门') : (item.label === '发文机关代字')
);
const list = numberIndex > -1 && (dataSource[numberIndex].data.map(item => ({label: item.label, value: item.label,})));
setNumberData(list || []);
setSubmitData(res.property);
setFormData(dataSource)
});
}, []);
......@@ -199,6 +213,26 @@ const Send = (props) => {
newGoods[index].checked = !newGoods[index].checked;
setGoods(newGoods)
};
const checkTitle = () => {
fileRequest({
method: 'post',
url: '/idtAppServiceV6/control/getList',
body: {
script: 'oa_fwgl_jyFwwhbh',
args: JSON.stringify([numberList[0], numberList[1]]),
keys: JSON.stringify([numberList[2]])
}
}).then((res) => {
Toast.success('校验成功');
});
};
const saveNumber = (number1, number2, number3) => {
const result = [...numberList];
number1 && (result[0] = number1);
number2 && (result[1] = number2);
number3 && (result[2] = number3);
setNumberList(result)
};
return (
<div>
......@@ -216,113 +250,143 @@ const Send = (props) => {
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>
}
})}
{loading2 ? (
<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 key={index} 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 key={index} className="auto-flex" extra={
<div>
<div className="meet-select-btn" onClick={getPerson}>选择参会人员</div>
</div>
}>参会人员</List.Item>
)
} else if (name=== '收文管理' && item.label.indexOf('文号') > -1) {
return (
<List.Item key={index} className="line-number">
文号
<div className="pos-aline">
<Picker value={[numberList[0]]} data={numberData} cols={1} onChange={val => saveNumber(val[0])}>
<List.Item className="room-num-2"/>
</Picker>
<div className="pos-aline">[ <input className="room-num-2" onChange={(val) => saveNumber(null, val.target.value)}/> ]</div>
<input className="room-num-2" onChange={(val) => saveNumber(null, null, val.target.value)}/>
<Button className="org-btn" size="small" onClick={checkTitle}>校验</Button>
</div>
</List.Item>
)
} else if (name=== '发文管理' && item.label.indexOf('编号') > -1) {
return (
<List.Item key={index}>
编号
<div className="pos-aline">
<Picker value={[numberList[0]]} data={numberData} cols={1} onChange={val => saveNumber(val[0])}>
<List.Item className="room-num-2"/>
</Picker>
<div className="pos-aline">[ <input className="room-num-2" onChange={(val) => saveNumber(null, val.target.value)}/> ]</div>
<input className="room-num-2" onChange={(val) => saveNumber(null, null, val.target.value)}/>
</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>
{/*正文*/}
<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/>
<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>
<div className="am-textarea-label upload-title">附件:</div>
<WingBlank>
{upload2.length > 0 && upload2.map((item, index) => (
<MailA key={index} data={item} onDelete={uploadDelete2}/>
))}
<WhiteSpace/>
</div>
)}
</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>
)}
</List>
{formData.length > 0 && name !== '办公用品采购' && (
<div className="event-footer">
<div className="event-footer-button" onClick={onSubmit}>发送</div>
</div>
)}
</form>
</form>
) : (<Skeleton/>)}
</div>
);
};
......
......@@ -129,6 +129,17 @@
.ml-40{
margin-left: 30px;
}
.room-num-2{
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);
text-align: center;
}
.room-num{
width: 60px;
height: 29px;
......@@ -152,3 +163,34 @@
.footer-button.btn-disabled{
background: rgba(151, 151, 151, 1) !important;
}
.room-num-2 .am-list-extra, .room-num-2 .am-list-line{
min-width: 80px !important;
text-align: center !important;
padding: 0 !important;
height: 29px !important;
line-height: 29px !important;
}
.room-num-2 .am-list-line:after{
display: none !important;
}
.room-num-2.am-list-item{
min-width: 80px !important;
height: 29px !important;
line-height: 29px !important;
min-height: 29px !important;
}
.am-list-item.room-num-2.am-list-item-middle{
min-width: 80px !important;
padding: 0 !important;
}
.line-number .am-list-content{
display: flex;
flex-direction: column !important;
justify-content: flex-start !important;
align-items: flex-start;
}
.org-btn{
margin-left: 20px;
background: rgba(239, 154, 54, 1);
color: #ffffff;
}
......@@ -50,12 +50,11 @@ export const createAPI = (baseURL) => {
.then(function (response) {
response = response.data || response.tree;
// console.log(!response || !(response.data || response.tree))
if (!response || !(response.data || response.tree)) {
// response.status === 'failure' && (window.location.href = '/login')
response.code === 'idt-jwt-500' && (window.location.href = '/login')
console.log('response出错, 无返回数据!', response);
Toast.fail(response.message)
// return false;
};
if (response.data && response.data.errorMessage) {
......@@ -83,6 +82,7 @@ export const createAPI = (baseURL) => {
} else {
return false;
}
})
.catch(error => {
if (error.response) {
......
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