|
@ -3,7 +3,7 @@ import './protable.less' |
|
|
import { Card, Button, Popconfirm, Badge, Col, Row, DatePicker, Input, Modal, Spin, Image, message, Popover, Select, Tree, Form } from 'antd'; |
|
|
import { Card, Button, Popconfirm, Badge, Col, Row, DatePicker, Input, Modal, Spin, Image, message, Popover, Select, Tree, Form } from 'antd'; |
|
|
import ProTable from '@ant-design/pro-table'; |
|
|
import ProTable from '@ant-design/pro-table'; |
|
|
import { DownOutlined, RightOutlined, CaretDownOutlined, CaretRightOutlined, MinusCircleOutlined, PlusOutlined } from '@ant-design/icons'; |
|
|
import { DownOutlined, RightOutlined, CaretDownOutlined, CaretRightOutlined, MinusCircleOutlined, PlusOutlined } from '@ant-design/icons'; |
|
|
import { getReportList, getReportDetail, handleReport } from '../actions/patrol'; |
|
|
import { getReportList, getReportDetail, handleReport, getAnspectionNotificationPhone, addAnspectionNotificationPhone } from '../actions/patrol'; |
|
|
import React, { useEffect, useState, useMemo } from 'react'; |
|
|
import React, { useEffect, useState, useMemo } from 'react'; |
|
|
import { getAllDepUsers } from '../actions/allDepUsers' |
|
|
import { getAllDepUsers } from '../actions/allDepUsers' |
|
|
import { httpDel } from '@peace/utils' |
|
|
import { httpDel } from '@peace/utils' |
|
@ -700,7 +700,7 @@ const PatrolNameList = (props) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const PatrolTable = (props) => { |
|
|
const PatrolTable = (props) => { |
|
|
const { allDepUsers, clientHeight, user, userList, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, pathname } = props; |
|
|
const { allDepUsers, clientHeight, user, userList, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, pathname, anspectionNotificationPhoneList } = props; |
|
|
const [record, setRecord] = useState(1); |
|
|
const [record, setRecord] = useState(1); |
|
|
const [dateRange, setDateRange] = useState(); |
|
|
const [dateRange, setDateRange] = useState(); |
|
|
const [selectProjectType, setSelectProjectType] = useState(''); |
|
|
const [selectProjectType, setSelectProjectType] = useState(''); |
|
@ -716,7 +716,8 @@ const PatrolTable = (props) => { |
|
|
const [form] = Form.useForm(); |
|
|
const [form] = Form.useForm(); |
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
queryData(); |
|
|
queryData(); |
|
|
console.log(123456789); |
|
|
dispatch(getAnspectionNotificationPhone()); |
|
|
|
|
|
|
|
|
}, []) |
|
|
}, []) |
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
if (userList && userList instanceof Array && reportDetail && reportDetail instanceof Object) { |
|
|
if (userList && userList instanceof Array && reportDetail && reportDetail instanceof Object) { |
|
@ -813,17 +814,32 @@ const PatrolTable = (props) => { |
|
|
exports(ids, reportType); |
|
|
exports(ids, reportType); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
console.log(anspectionNotificationPhoneList, '数据'); |
|
|
|
|
|
let phoneList = [] |
|
|
|
|
|
if (anspectionNotificationPhoneList && anspectionNotificationPhoneList.length) { |
|
|
|
|
|
phoneList = anspectionNotificationPhoneList.map(e => { |
|
|
|
|
|
return e.phone |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
console.log(phoneList, '789789789789'); |
|
|
|
|
|
|
|
|
|
|
|
}, [anspectionNotificationPhoneList]) |
|
|
const showModal = () => { |
|
|
const showModal = () => { |
|
|
setIsModalOpen(true); |
|
|
setIsModalOpen(true); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const handleOk = () => { |
|
|
const handleOk = () => { |
|
|
// setIsModalOpen(false);
|
|
|
// setIsModalOpen(false);
|
|
|
console.log(form, '====='); |
|
|
|
|
|
form.validateFields().then(values => { |
|
|
form.validateFields().then(values => { |
|
|
console.log(values, '----------'); |
|
|
console.log(values, '----------'); |
|
|
|
|
|
dispatch(addAnspectionNotificationPhone(values)).then(res => { |
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
setIsModalOpen(false); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
console.log(err, 'err'); |
|
|
console.log(err); |
|
|
}) |
|
|
}) |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
@ -940,11 +956,10 @@ const PatrolTable = (props) => { |
|
|
// },
|
|
|
// },
|
|
|
{ |
|
|
{ |
|
|
validator: async (_, phone) => { |
|
|
validator: async (_, phone) => { |
|
|
console.log(phone,'phone'); |
|
|
|
|
|
let re = /^1((3[\d])|(4[5,6,9])|(5[0-3,5-9])|(6[5-7])|(7[0-8])|(8[1-3,5-8])|(9[1,8,9]))\d{8}$/ |
|
|
let re = /^1((3[\d])|(4[5,6,9])|(5[0-3,5-9])|(6[5-7])|(7[0-8])|(8[1-3,5-8])|(9[1,8,9]))\d{8}$/ |
|
|
if(!re.test(phone)){ |
|
|
if (!re.test(phone)) { |
|
|
return Promise.reject(new Error('请输入正确的手机号!')); |
|
|
return Promise.reject(new Error('请输入正确的手机号!')); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
]} |
|
|
]} |
|
@ -986,7 +1001,7 @@ const PatrolTable = (props) => { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
function mapStateToProps(state) { |
|
|
function mapStateToProps(state) { |
|
|
const { auth, depMessage, userList, reportList, reportDetail, global, allDepUsers } = state; |
|
|
const { auth, depMessage, userList, reportList, reportDetail, global, allDepUsers, anspectionNotificationPhoneList } = state; |
|
|
const pakData = (dep) => { |
|
|
const pakData = (dep) => { |
|
|
return dep.map((d) => { |
|
|
return dep.map((d) => { |
|
|
return { |
|
|
return { |
|
@ -1010,6 +1025,7 @@ function mapStateToProps(state) { |
|
|
reportDetail: reportDetail.data, |
|
|
reportDetail: reportDetail.data, |
|
|
reportDetailLoading: reportDetail.isRequesting, |
|
|
reportDetailLoading: reportDetail.isRequesting, |
|
|
clientHeight: global.clientHeight, |
|
|
clientHeight: global.clientHeight, |
|
|
|
|
|
anspectionNotificationPhoneList: anspectionNotificationPhoneList.data || [] |
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|