|
@@ -13,6 +13,8 @@ function DutyRecord() {
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
getDutyRecord();
|
|
getDutyRecord();
|
|
}, []);
|
|
}, []);
|
|
|
|
+ let today = getNowFormatDate()
|
|
|
|
+ let lastmonthday= getlastmonthday()
|
|
const [logList, setLogList] = useState([]);
|
|
const [logList, setLogList] = useState([]);
|
|
const [total, setTotal] = useState(0);
|
|
const [total, setTotal] = useState(0);
|
|
const [visible, setVisible] = useState(false);
|
|
const [visible, setVisible] = useState(false);
|
|
@@ -20,6 +22,8 @@ function DutyRecord() {
|
|
const [current, setCurrent] = useState(1);
|
|
const [current, setCurrent] = useState(1);
|
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
|
const [params, setParams] = useState({
|
|
const [params, setParams] = useState({
|
|
|
|
+ changeTimeEnd:today+" 23:23:59",
|
|
|
|
+ changeTimeStart:lastmonthday+" 00:00:00",
|
|
pages: 1,
|
|
pages: 1,
|
|
current: 1,
|
|
current: 1,
|
|
size: 15
|
|
size: 15
|
|
@@ -30,10 +34,54 @@ function DutyRecord() {
|
|
'2': '职称变更'
|
|
'2': '职称变更'
|
|
};
|
|
};
|
|
let data = {
|
|
let data = {
|
|
|
|
+ changeTimeEnd:today+" 23:23:59",
|
|
|
|
+ changeTimeStart:lastmonthday+" 00:00:00",
|
|
pages: 1,
|
|
pages: 1,
|
|
current: 1,
|
|
current: 1,
|
|
size: size
|
|
size: size
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ function getlastmonthday(){
|
|
|
|
+ var now=new Date();
|
|
|
|
+ var year = now.getFullYear();//getYear()+1900=getFullYear()
|
|
|
|
+ var month = now.getMonth() +1;//0-11表示1-12月
|
|
|
|
+ var day = now.getDate();
|
|
|
|
+ if(parseInt(month)<10){
|
|
|
|
+ month="0"+month;
|
|
|
|
+ }
|
|
|
|
+ if(parseInt(day)<10){
|
|
|
|
+ day="0"+day;
|
|
|
|
+ }
|
|
|
|
+ now =year + '-'+ month + '-' + day;
|
|
|
|
+ if (parseInt(month) ==1) {//如果是1月份,则取上一年的12月份
|
|
|
|
+ return (parseInt(year) - 1) + '-12-' + day;
|
|
|
|
+ }
|
|
|
|
+ var preSize= new Date(year, parseInt(month)-1, 0).getDate();//上月总天数
|
|
|
|
+ if (preSize < parseInt(day)) {//上月总天数<本月日期,比如3月的30日,在2月中没有30
|
|
|
|
+ return year + '-' + month + '-01';
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(parseInt(month) <=10){
|
|
|
|
+ return year + '-0' + (parseInt(month)-1) + '-' + day;
|
|
|
|
+ }else{
|
|
|
|
+ return year + '-' + (parseInt(month)-1) + '-' + day;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ function getNowFormatDate() {
|
|
|
|
+ var date = new Date();
|
|
|
|
+ var seperator1 = "-";
|
|
|
|
+ var year = date.getFullYear();
|
|
|
|
+ var month = date.getMonth() + 1;
|
|
|
|
+ var strDate = date.getDate();
|
|
|
|
+ if (month >= 1 && month <= 9) {
|
|
|
|
+ month = "0" + month;
|
|
|
|
+ }
|
|
|
|
+ if (strDate >= 0 && strDate <= 9) {
|
|
|
|
+ strDate = "0" + strDate;
|
|
|
|
+ }
|
|
|
|
+ var currentdate = year + seperator1 + month + seperator1 + strDate;
|
|
|
|
+ return currentdate;
|
|
|
|
+ }
|
|
//表格数据
|
|
//表格数据
|
|
function getDutyRecord(param) {
|
|
function getDutyRecord(param) {
|
|
post(api.getOfficialCapacityPage, param || params).then((res) => {
|
|
post(api.getOfficialCapacityPage, param || params).then((res) => {
|
|
@@ -88,16 +136,21 @@ function DutyRecord() {
|
|
if (value.changeTime) {
|
|
if (value.changeTime) {
|
|
value.changeTimeStart = moment(value.changeTime[0]).format('YYYY-MM-DD 00:00:00')
|
|
value.changeTimeStart = moment(value.changeTime[0]).format('YYYY-MM-DD 00:00:00')
|
|
value.changeTimeEnd = moment(value.changeTime[1]).format('YYYY-MM-DD 23:23:59')
|
|
value.changeTimeEnd = moment(value.changeTime[1]).format('YYYY-MM-DD 23:23:59')
|
|
|
|
+ }else{
|
|
|
|
+ value.changeTimeStart =lastmonthday+" 00:00:00"
|
|
|
|
+ value.changeTimeEnd =today+" 23:23:59"
|
|
}
|
|
}
|
|
const param = {
|
|
const param = {
|
|
...data,
|
|
...data,
|
|
...value,
|
|
...value,
|
|
}
|
|
}
|
|
|
|
+ setSelectedRowKeys([])
|
|
setCurrent(1)
|
|
setCurrent(1)
|
|
setParams(param)
|
|
setParams(param)
|
|
getDutyRecord(param);
|
|
getDutyRecord(param);
|
|
};
|
|
};
|
|
const onReset = () => {
|
|
const onReset = () => {
|
|
|
|
+ setSelectedRowKeys([])
|
|
setCurrent(1)
|
|
setCurrent(1)
|
|
setParams(data)
|
|
setParams(data)
|
|
form.resetFields();
|
|
form.resetFields();
|
|
@@ -130,22 +183,22 @@ function DutyRecord() {
|
|
>
|
|
>
|
|
<Row gutter={24}>
|
|
<Row gutter={24}>
|
|
<Col span={5} key={0}>
|
|
<Col span={5} key={0}>
|
|
- <Form.Item label="医生姓名" name="doctorName">
|
|
|
|
|
|
+ <Form.Item label="医生姓名" name="doctorName" rules={[{ max: 30, message: '不能超过30个字符' }]}>
|
|
<Input placeholder="请输入" autoComplete='off' allowClear/>
|
|
<Input placeholder="请输入" autoComplete='off' allowClear/>
|
|
</Form.Item>
|
|
</Form.Item>
|
|
</Col>
|
|
</Col>
|
|
<Col span={5} key={1}>
|
|
<Col span={5} key={1}>
|
|
- <Form.Item label="科室" name="deptName">
|
|
|
|
|
|
+ <Form.Item label="科室" name="deptName" rules={[{ max: 30, message: '不能超过30个字符' }]}>
|
|
<Input placeholder="请输入" autoComplete='off' allowClear/>
|
|
<Input placeholder="请输入" autoComplete='off' allowClear/>
|
|
</Form.Item>
|
|
</Form.Item>
|
|
</Col>
|
|
</Col>
|
|
<Col span={5} key={2}>
|
|
<Col span={5} key={2}>
|
|
- <Form.Item label="工号" name="doctorCode">
|
|
|
|
|
|
+ <Form.Item label="工号" name="doctorCode" rules={[{ max: 30, message: '不能超过30个字符' }]}>
|
|
<Input placeholder="请输入" autoComplete='off' allowClear/>
|
|
<Input placeholder="请输入" autoComplete='off' allowClear/>
|
|
</Form.Item>
|
|
</Form.Item>
|
|
</Col>
|
|
</Col>
|
|
<Col span={5} key={3}>
|
|
<Col span={5} key={3}>
|
|
- <Form.Item label="职务/职称名称" name="name">
|
|
|
|
|
|
+ <Form.Item label="职务/职称名称" name="name" rules={[{ max: 30, message: '不能超过30个字符' }]}>
|
|
<Input placeholder="请输入" autoComplete='off' allowClear/>
|
|
<Input placeholder="请输入" autoComplete='off' allowClear/>
|
|
</Form.Item>
|
|
</Form.Item>
|
|
</Col>
|
|
</Col>
|
|
@@ -164,6 +217,7 @@ function DutyRecord() {
|
|
<Col span={7} key={5}>
|
|
<Col span={7} key={5}>
|
|
<Form.Item label="变更时间" name="changeTime">
|
|
<Form.Item label="变更时间" name="changeTime">
|
|
<RangePicker
|
|
<RangePicker
|
|
|
|
+ defaultValue={[moment(lastmonthday), moment(today)]}
|
|
disabledDate={disabledDate}
|
|
disabledDate={disabledDate}
|
|
placeholder={['开始时间', '结束时间']}
|
|
placeholder={['开始时间', '结束时间']}
|
|
/>
|
|
/>
|