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

debug

parent 69652474
Pipeline #16533 canceled with stages
......@@ -47,7 +47,10 @@
"target": "http://124.93.101.8:9988"
},
"/department": {
"target": "http://192.168.1.84:8889"
"target": "http://192.168.2.101:8889"
},
"/demo": {
"target": "http://192.168.2.101:8889"
}
}
}
import React, { useEffect, useState } from 'react';
import {Modal, Accordion, List, Checkbox, Button} from "antd-mobile";
import {Modal, Accordion, List, Radio, Button} from "antd-mobile";
import './index.less'
import axios from "axios";
const CheckboxItem = Checkbox.CheckboxItem;
const RadioItem = Radio.RadioItem;
const Send = (props) => {
const {visible, onClose} = props;
const {visible, onClose, onSelect} = props;
const [data, setData] = useState([]);
useEffect(() => {
axios({
method: 'post',
url: 'http://192.168.1.84:8889/department/tree',
url: '/department/tree',
data: {},
withCredentials: false,
}).then(res => {
......@@ -20,13 +20,10 @@ const Send = (props) => {
})
}, []);
const [checked, setChecked] = useState([])
const [checked, setChecked] = useState({})
const checkChange = (e, val) => {
const newChecked = [...checked];
const index = newChecked.indexOf(val);
e.target.checked ? newChecked.push(val) : newChecked.splice(index, 1);
setChecked(newChecked);
const checkChange = (val, name) => {
setChecked({value: val, name});
};
const getProps = data => (
<Accordion>
......@@ -36,9 +33,9 @@ const Send = (props) => {
{item.userList && item.userList.length > 0 && (
<List key={item.name}>
{item.userList.map((child) => (
<CheckboxItem key={child.uid} onChange={(val) => checkChange(val, child.uid)}>
<RadioItem key={child.uid} checked={checked.value === child.uid} onChange={(val) => checkChange(child.uid, child.name)}>
{child.name}
</CheckboxItem>
</RadioItem>
))}
</List>
)}
......@@ -57,18 +54,13 @@ const Send = (props) => {
transparent
onClose={() => onClose(false)}
>
{/*<List>*/}
{/*<CheckboxItem onChange={(val) => console.log(val)}>*/}
{/*{11111}*/}
{/*</CheckboxItem>*/}
{/*</List>*/}
<div className="test-box-auto">
{getProps(data)}
</div>
<div className="modal-form-footer">
<Button className="date-button mr-12 bg-gray" inline onClick={() => onClose(false)}>取消</Button>
<Button className="date-button" inline type="primary">确认选择</Button>
<Button className="date-button" inline type="primary" onClick={() => {onSelect(checked); onClose(false)}}>确认选择</Button>
</div>
</Modal>
</div>
......
import React, {useEffect} from 'react';
import {WingBlank, List, InputItem, TextareaItem, WhiteSpace, Picker} from 'antd-mobile'
import React, {useEffect, useState} from 'react';
import {WingBlank, List, InputItem, WhiteSpace, Picker, Toast} from 'antd-mobile'
import Document from 'react-document-title';
import moment from 'moment'
import axios from 'axios'
import { createForm } from 'rc-form';
const Send = (props) => {
const Receive = (props) => {
const {id} = props.match.params;
const {getFieldProps} = props.form;
const [defaultV, setDefaultV] = useState({});
useEffect(() => {
axios({
method: 'post',
url: 'http://192.168.1.84:8889/department/tree',
method: 'get',
url: `/demo/leaveForm/${id}`,
data: {},
withCredentials: true,
withCredentials: false,
}).then(res => {
console.log(res)
setDefaultV(res.data.data.result)
})
}, []);
const onSubmit = () => {
props.form.validateFields({ force: true }, (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;
});
if (!error) {
console.log(values)
console.log(values);
axios({
method: 'patch',
url: `/demo/reviewAndApproval`,
params: {status: values.status[0], id},
withCredentials: false,
}).then(res => {
res.data.data.result && Toast.success('审核成功')
})
}
});
};
......@@ -41,18 +45,15 @@ const Send = (props) => {
<WhiteSpace/>
<form>
<List>
<InputItem extra={'1111'}>标题</InputItem>
<InputItem extra={'1111'}>发送人</InputItem>
<InputItem extra={'1111'}>工作日期</InputItem>
<InputItem extra={'1111'}>参会人员</InputItem>
<Picker data={[{label: '是', value: true}, {label: '否', value: false}]} cols={1} {...getFieldProps('xb')}>
<InputItem disabled={true} extra={defaultV.title && defaultV.title}>标题</InputItem>
<InputItem disabled={true} extra={'1111'}>发送人</InputItem>
<InputItem disabled={true} extra={defaultV.startTime && moment(defaultV.startTime).format("YYYY-MM-DD HH:mm:ss")}>请假开始时间</InputItem>
<InputItem disabled={true} extra={defaultV.endTime && moment(defaultV.endTime).format("YYYY-MM-DD HH:mm:ss")}>请假结束时间</InputItem>
{/*<InputItem extra={'1111'}>参会人员</InputItem>*/}
<Picker data={[{label: '审核通过', value: 2}, {label: '审核失败', value: 3}]} cols={1} {...getFieldProps('status')}>
<List.Item arrow="horizontal">办理意见</List.Item>
</Picker>
<TextareaItem
title="内容"
rows={4}
{...getFieldProps('gzdh')}
/>
</List>
</form>
<div className="event-footer">
......@@ -63,4 +64,4 @@ const Send = (props) => {
);
};
export default createForm()(Send);
export default createForm()(Receive);
import React, {useState} from 'react';
import {WingBlank, List, InputItem, WhiteSpace, DatePicker} from 'antd-mobile'
import {WingBlank, List, InputItem, WhiteSpace, DatePicker, Toast} from 'antd-mobile'
import Document from 'react-document-title';
import moment from 'moment'
import axios from 'axios'
......@@ -19,17 +19,19 @@ const Send = (props) => {
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"))
values[item] instanceof Date && ( values[item] = moment(values[item]).valueOf());
return null;
});
if (!error) {
axios.post('http://192.168.1.84:8889/department', {}).then(res => {
console.log(res)
values.toUid = sP.value;
values.uid = '123fd';
axios.patch('/demo/initiateApproval', values).then(res => {
res.data.success && Toast.success('提交成功')
})
}
});
};
const [sP, setSP] = useState([]);
const [sP, setSP] = useState({});
const [personVisible, setPersonVisible] = useState(false);
return (
<Document title="内部邮局">
......@@ -43,18 +45,21 @@ const Send = (props) => {
<WhiteSpace/>
<form>
<List>
<InputItem>标题</InputItem>
<InputItem {...getFieldProps('title')}>标题</InputItem>
<InputItem value={'123fd'}>发送人</InputItem>
<DatePicker mode="date" className="send-date-style"{...getFieldProps('gzrq')}>
<List.Item arrow="horizontal">工作日期</List.Item>
<DatePicker mode="date" className="send-date-style"{...getFieldProps('startTime')}>
<List.Item arrow="horizontal">请假开始时间</List.Item>
</DatePicker>
<DatePicker mode="date" className="send-date-style"{...getFieldProps('entTime')}>
<List.Item arrow="horizontal">请假结束时间</List.Item>
</DatePicker>
<List.Item className="auto-flex" extra={
<div className="pos-aline">
<div className="meet-select-btn" onClick={() => setPersonVisible(true)}>选择参会人员</div>
<div className="ml-40 room-num">{sP.length}</div>
<div>{sP.name}</div>
</div>
}>参会人员</List.Item>
<InputItem {...getFieldProps('gzdh')}>工作电话</InputItem>
{/*<InputItem {...getFieldProps('gzdh')}>工作电话</InputItem>*/}
</List>
</form>
<div className="event-footer">
......
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