diff --git a/api/app/lib/controllers/data/anspectionNotificationPhone.js b/api/app/lib/controllers/data/anspectionNotificationPhone.js new file mode 100644 index 00000000..cfa46a26 --- /dev/null +++ b/api/app/lib/controllers/data/anspectionNotificationPhone.js @@ -0,0 +1,31 @@ +'use strict'; +const moment = require('moment') + +async function getAnspectionNotificationPhone (ctx) { + try { + const models = ctx.fs.dc.models; + + let findOption = { + where: { + + }, + order: [['id', 'DESC']] + } + const roadRes = await models.AnspectionNotificationPhone.findAll(findOption) + + ctx.status = 200; + ctx.body = roadRes + } catch (error) { + ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); + ctx.status = 400; + ctx.body = { + message: typeof error == 'string' ? error : undefined + } + } +} + + + +module.exports = { + getAnspectionNotificationPhone, +}; \ No newline at end of file diff --git a/api/app/lib/models/inspection_notification_phone.js b/api/app/lib/models/inspection_notification_phone.js new file mode 100644 index 00000000..8ea8b77d --- /dev/null +++ b/api/app/lib/models/inspection_notification_phone.js @@ -0,0 +1,35 @@ +/* eslint-disable*/ +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const AnspectionNotificationPhone = sequelize.define("inspection_notification_phone", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "assess_id_uindex" + }, + phone: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "联系电话", + primaryKey: false, + field: "phone", + autoIncrement: false + }, + + }, { + tableName: "inspection_notification_phone", + comment: "", + indexes: [] + }); + dc.models.AnspectionNotificationPhone = AnspectionNotificationPhone; + return AnspectionNotificationPhone; +}; \ No newline at end of file diff --git a/api/app/lib/routes/data/index.js b/api/app/lib/routes/data/index.js index 913ade65..2064bc5a 100644 --- a/api/app/lib/routes/data/index.js +++ b/api/app/lib/routes/data/index.js @@ -12,6 +12,7 @@ const task = require('../../controllers/data/task') const assess = require('../../controllers/data/assess') const videoCenter = require('../../controllers/data/videoCenter') const appointTask = require('../../controllers/data/appointed') +const anspectionNotificationPhone = require('../../controllers/data/anspectionNotificationPhone') module.exports = function (app, router, opts) { // 数据导出 @@ -206,4 +207,8 @@ module.exports = function (app, router, opts) { app.fs.api.logAttr['PUT/appointTask'] = { content: '指派任务', visible: true }; router.put('/appointTask', appointTask.appoint); // 指派任务 END + + //短信电话anspectionNotificationPhone + app.fs.api.logAttr['GET/anspection/notification/phone'] = { content: '获取短信提醒电话', visible: true }; + router.get('/anspection/notification/phone', anspectionNotificationPhone.getAnspectionNotificationPhone); }; diff --git a/web/client/src/sections/fillion/actions/patrol.js b/web/client/src/sections/fillion/actions/patrol.js index a1befe8a..fa9d51c0 100644 --- a/web/client/src/sections/fillion/actions/patrol.js +++ b/web/client/src/sections/fillion/actions/patrol.js @@ -46,4 +46,17 @@ export function handleReport (reportId, data) { data: data, msg: { option: '处理数据' }, }); +} + + +export function getAnspectionNotificationPhone (query) { + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'GET_REPORT_LIST', + url: ApiTable.getAnspectionNotificationPhone, + query, + msg: { error: '获取巡查数据失败' }, + reducer: { name: 'reportList' } + }); } \ No newline at end of file diff --git a/web/client/src/sections/fillion/components/patrolTable.js b/web/client/src/sections/fillion/components/patrolTable.js index 6e47e36a..20b7a8fc 100644 --- a/web/client/src/sections/fillion/components/patrolTable.js +++ b/web/client/src/sections/fillion/components/patrolTable.js @@ -1,8 +1,8 @@ import { connect } from 'react-redux'; import './protable.less' -import { Card, Button, Popconfirm, Badge, Col, Row, DatePicker, Input, Modal, Spin, Image, message, Popover, Select, Tree } 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 { DownOutlined, RightOutlined, CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons'; +import { DownOutlined, RightOutlined, CaretDownOutlined, CaretRightOutlined, MinusCircleOutlined, PlusOutlined } from '@ant-design/icons'; import { getReportList, getReportDetail, handleReport } from '../actions/patrol'; import React, { useEffect, useState, useMemo } from 'react'; import { getAllDepUsers } from '../actions/allDepUsers' @@ -15,6 +15,9 @@ import styles from './protable.less'; import moment from 'moment'; import NominateModalcopy from './feedback/nominateModalcopy';//指派的模块 + + + export const reportTypeText = (text) => { switch (text) { case 'road': return '道路'; @@ -709,8 +712,11 @@ const PatrolTable = (props) => { const isAnomaly = pathname.includes('anomaly') const isPatrol = !isRoad && !isAnomaly const reportType = isRoad ? 'road' : isAnomaly ? 'anomaly' : 'patrol'; + const [isModalOpen, setIsModalOpen] = useState(false); + const [form] = Form.useForm(); useEffect(() => { queryData(); + console.log(123456789); }, []) useEffect(() => { if (userList && userList instanceof Array && reportDetail && reportDetail instanceof Object) { @@ -807,6 +813,39 @@ const PatrolTable = (props) => { exports(ids, reportType); } } + const showModal = () => { + setIsModalOpen(true); + }; + + const handleOk = () => { + // setIsModalOpen(false); + console.log(form, '====='); + form.validateFields().then(values => { + console.log(values, '----------'); + }).catch(err => { + console.log(err, 'err'); + }) + }; + + const handleCancel = () => { + setIsModalOpen(false); + }; + const formItemLayout = { + labelCol: { + xs: { span: 24 }, + sm: { span: 4 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 20 }, + }, + }; + const formItemLayoutWithOutLabel = { + wrapperCol: { + xs: { span: 24, offset: 0 }, + sm: { span: 20, offset: 4 }, + }, + }; return (