From 9bae9d56d662e7341a81ff094551f4a907f48154 Mon Sep 17 00:00:00 2001 From: dengyinhuan Date: Tue, 28 Feb 2023 15:55:38 +0800 Subject: [PATCH] Merge branch 'master' of https://gitea.anxinyun.cn/free-sun/Inspection --- .../controllers/patrolManage/patrolRecord.js | 52 +++- api/app/lib/index.js | 5 +- .../lib/models/patrol_record_issue_handle.js | 161 ++++++++++ api/app/lib/models/user.js | 2 +- .../lib/routes/patrolManage/patrolRecord.js | 8 + .../8.create_patrol_record_issue_handle.sql | 60 ++++ web/client/src/app.js | 3 +- .../src/sections/auth/containers/login.js | 1 + .../src/sections/issueHandle/actions/index.js | 11 + .../sections/issueHandle/actions/record.js | 32 ++ .../components/isuue-handle-mdal.js | 280 ++++++++++++++++++ .../sections/issueHandle/containers/index.js | 5 + .../issueHandle/containers/patrolRecord.js | 234 +++++++++++++++ web/client/src/sections/issueHandle/index.js | 15 + .../src/sections/issueHandle/nav-item.js | 18 ++ .../sections/issueHandle/reducers/index.js | 5 + .../sections/issueHandle/reducers/record.js | 32 ++ web/client/src/sections/issueHandle/routes.js | 13 + .../src/sections/issueHandle/style.less | 13 + web/client/src/utils/webapi.js | 4 +- web/log/development.txt | 6 + 21 files changed, 955 insertions(+), 5 deletions(-) create mode 100644 api/app/lib/models/patrol_record_issue_handle.js create mode 100644 script/1.0.3/schema/8.create_patrol_record_issue_handle.sql create mode 100644 web/client/src/sections/issueHandle/actions/index.js create mode 100644 web/client/src/sections/issueHandle/actions/record.js create mode 100644 web/client/src/sections/issueHandle/components/isuue-handle-mdal.js create mode 100644 web/client/src/sections/issueHandle/containers/index.js create mode 100644 web/client/src/sections/issueHandle/containers/patrolRecord.js create mode 100644 web/client/src/sections/issueHandle/index.js create mode 100644 web/client/src/sections/issueHandle/nav-item.js create mode 100644 web/client/src/sections/issueHandle/reducers/index.js create mode 100644 web/client/src/sections/issueHandle/reducers/record.js create mode 100644 web/client/src/sections/issueHandle/routes.js create mode 100644 web/client/src/sections/issueHandle/style.less diff --git a/api/app/lib/controllers/patrolManage/patrolRecord.js b/api/app/lib/controllers/patrolManage/patrolRecord.js index 4c4b15b..f78d5f3 100644 --- a/api/app/lib/controllers/patrolManage/patrolRecord.js +++ b/api/app/lib/controllers/patrolManage/patrolRecord.js @@ -10,7 +10,11 @@ async function findPatrolRecord(ctx, next) { let generalInclude = [{ model: models.PatrolPlan, attributes: ['name'] - }] + }, + { + model: models.PatrolRecordIssueHandle + } + ] if (patrolPlanId == 'all') { /* 如果有startTime && endTime,查询所有符合条件的数据 */ if (startTime !== 'null' && endTime !== 'null') { @@ -146,6 +150,7 @@ async function addPatrolRecord(ctx, next) { const curPlanRecord = await models.PatrolRecord.findAndCountAll({ where: { patrolPlanId } }); + const patrolCount = curPlanRecord.count; await models.PatrolPlan.update({ patrolCount }, { where: { id: patrolPlanId }, @@ -165,7 +170,52 @@ async function addPatrolRecord(ctx, next) { } } +// 新建维修处理计划成功 +function addPatrolRecordIssueHandle(opts) { + return async function (ctx, next) { + + const models = ctx.fs.dc.models; + try { + let rslt = ctx.request.body; + await models.PatrolRecordIssueHandle.create(Object.assign({}, rslt)) + ctx.status = 204; + ctx.body = { message: '新建维修处理计划成功' } + } catch (error) { + ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); + ctx.status = 400; + ctx.body = { message: '新建修处理计划失败' } + } + } +} + + +// 修改维修处理计划 +function editPatrolRecordIssueHandle(opts) { + return async function (ctx, next) { + + try { + const models = ctx.fs.dc.models; + const { id } = ctx.params; + const body = ctx.request.body; + await models.PatrolRecordIssueHandle.update( + body, + { where: { id: id, } } + ) + ctx.status = 204; + ctx.body = { message: '修改维修处理计划成功' } + } catch (error) { + ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); + ctx.status = 400; + ctx.body = { message: '修改维修处理计划失败' } + } + } +} + + module.exports = { findPatrolRecord, addPatrolRecord, + addPatrolRecordIssueHandle, + editPatrolRecordIssueHandle + } \ No newline at end of file diff --git a/api/app/lib/index.js b/api/app/lib/index.js index faf68b5..6f6cb92 100644 --- a/api/app/lib/index.js +++ b/api/app/lib/index.js @@ -56,12 +56,15 @@ module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Seq const { Department, User, UserResource, Resource, Project, Point, PatrolPlan, PatrolRecord, CheckItems, CheckItemsGroup, - PatrolTemplate, PatrolTemplateCheckItems + PatrolTemplate, PatrolTemplateCheckItems, PatrolRecordIssueHandle } = dc.models; PatrolRecord.belongsTo(PatrolPlan, { foreignKey: 'patrolPlanId', targetKey: 'id' }); PatrolPlan.hasMany(PatrolRecord, { foreignKey: 'patrolPlanId', sourceKey: 'id' }); + PatrolRecordIssueHandle.belongsTo(PatrolRecord, { foreignKey: 'patrolRecordId', targetKey: 'id' }); + PatrolRecord.hasMany(PatrolRecordIssueHandle, { foreignKey: 'patrolRecordId', sourceKey: 'id' }); + UserResource.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' }); User.hasMany(UserResource, { foreignKey: 'userId', sourceKey: 'id' }); diff --git a/api/app/lib/models/patrol_record_issue_handle.js b/api/app/lib/models/patrol_record_issue_handle.js new file mode 100644 index 0000000..af565e1 --- /dev/null +++ b/api/app/lib/models/patrol_record_issue_handle.js @@ -0,0 +1,161 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const PatrolRecordIssueHandle = sequelize.define("patrolRecordIssueHandle", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "patrol_record_issue_handle_id_uindex" + }, + patrolRecordId: { + type: DataTypes.INTEGER, + allowNull: true, + defaultValue: null, + comment: "巡检记录id", + primaryKey: false, + field: "patrol_record_id", + autoIncrement: false + }, + repairPerson: { + type: DataTypes.JSONB, + allowNull: true, + defaultValue: null, + comment: "维修人", + primaryKey: false, + field: "repair_person", + autoIncrement: false + }, + repairUnit: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "维修单位", + primaryKey: false, + field: "repair_unit", + autoIncrement: false + }, + startTime: { + type: DataTypes.DATE, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "start_time", + autoIncrement: false + }, + endTime: { + type: DataTypes.DATE, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "end_time", + autoIncrement: false + }, + repairAsk: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "维修要求", + primaryKey: false, + field: "repair_ask", + autoIncrement: false + }, + checkPerson: { + type: DataTypes.JSONB, + allowNull: true, + defaultValue: null, + comment: "质检验收人", + primaryKey: false, + field: "check_person", + autoIncrement: false + }, + state: { + type: DataTypes.INTEGER, + allowNull: true, + defaultValue: null, + comment: "流程状态 \n1 制定计划 待审核\n2 \n3\n4\n5\n6\n7", + primaryKey: false, + field: "state", + autoIncrement: false + }, + approvePerson: { + type: DataTypes.JSONB, + allowNull: true, + defaultValue: null, + comment: "审批人", + primaryKey: false, + field: "approve_person", + autoIncrement: false + }, + approveDate: { + type: DataTypes.DATE, + allowNull: true, + defaultValue: null, + comment: "审批日期", + primaryKey: false, + field: "approve_date", + autoIncrement: false + }, + approveOpinion: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "审批意见", + primaryKey: false, + field: "approve_opinion", + autoIncrement: false + }, + repairDesc: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "维修情况描述", + primaryKey: false, + field: "repair_desc", + autoIncrement: false + }, + repairImage: { + type: DataTypes.JSONB, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "repair_image", + autoIncrement: false + }, + creator: { + type: DataTypes.JSONB, + allowNull: true, + defaultValue: null, + comment: "审批人", + primaryKey: false, + field: "creator", + autoIncrement: false + }, + createTime: { + type: DataTypes.DATE, + allowNull: true, + defaultValue: null, + comment: "制定日期", + primaryKey: false, + field: "create_time", + autoIncrement: false + }, + }, { + tableName: "patrol_record_issue_handle", + comment: "", + indexes: [] + }); + dc.models.PatrolRecordIssueHandle = PatrolRecordIssueHandle; + return PatrolRecordIssueHandle; +}; \ No newline at end of file diff --git a/api/app/lib/models/user.js b/api/app/lib/models/user.js index 02245a9..311f40a 100644 --- a/api/app/lib/models/user.js +++ b/api/app/lib/models/user.js @@ -110,7 +110,7 @@ module.exports = dc => { comment: "", indexes: [] }); - + dc.models.User = User; return User; }; \ No newline at end of file diff --git a/api/app/lib/routes/patrolManage/patrolRecord.js b/api/app/lib/routes/patrolManage/patrolRecord.js index 0e82885..376cad3 100644 --- a/api/app/lib/routes/patrolManage/patrolRecord.js +++ b/api/app/lib/routes/patrolManage/patrolRecord.js @@ -9,4 +9,12 @@ module.exports = function (app, router, opts) { app.fs.api.logAttr['POST/patrolRecord/add'] = { content: '新增巡检记录', visible: true } router.post('/patrolRecord/add', patrolRecord.addPatrolRecord); + + app.fs.api.logAttr['POST/patrolRecord/issue/handle'] = { content: '增加维修处理计划', visible: true }; + router.post('/patrolRecord/issue/handle', patrolRecord.addPatrolRecordIssueHandle(opts)) + + + // 修改维修处理计划 + app.fs.api.logAttr['PUT/patrolRecord/issue/handle/:id'] = { content: '修改维修处理计划', visible: true }; + router.put('/patrolRecord/issue/handle/:id', patrolRecord.editPatrolRecordIssueHandle(opts)) }; \ No newline at end of file diff --git a/script/1.0.3/schema/8.create_patrol_record_issue_handle.sql b/script/1.0.3/schema/8.create_patrol_record_issue_handle.sql new file mode 100644 index 0000000..abf36fc --- /dev/null +++ b/script/1.0.3/schema/8.create_patrol_record_issue_handle.sql @@ -0,0 +1,60 @@ +DROP TABLE IF EXISTS "public"."patrol_record_issue_handle"; +create table patrol_record_issue_handle +( + id serial + constraint patrol_record_issue_handle_pk + primary key, + patrol_record_id integer, + repair_person jsonb, + repair_unit varchar(255), + start_time timestamp(6) with time zone, + end_time timestamp(6) with time zone, + repair_ask varchar(255), + check_person jsonb, + state integer, + approve_person jsonb, + approve_date timestamp(6) with time zone, + approve_opinion varchar(255), + repair_desc varchar(255), + repair_image jsonb, + creator jsonb, + create_time timestamp(6) with time zone, +); + +comment on column patrol_record_issue_handle.patrol_record_id is '巡检记录id'; + +comment on column patrol_record_issue_handle.repair_person is '维修人'; + +comment on column patrol_record_issue_handle.repair_unit is '维修单位'; + +comment on column patrol_record_issue_handle.repair_ask is '维修要求'; + +comment on column patrol_record_issue_handle.check_person is '质检验收人'; + +comment on column patrol_record_issue_handle.state is '流程状态 +1 待制定计划 +2 待审核 +3 计划驳回 +4 待维修 +5 待验收 +6 验收通过 +7 验收不通过'; + +comment on column patrol_record_issue_handle.approve_person is '审批人'; + +comment on column patrol_record_issue_handle.approve_date is '审批日期'; + +comment on column patrol_record_issue_handle.approve_opinion is '审批意见'; + +comment on column patrol_record_issue_handle.repair_desc is '维修情况描述'; + +comment on column patrol_record_issue_handle.creator is '制定人'; + +comment on column patrol_record_issue_handle.create_time is '制定日期'; + +alter table patrol_record_issue_handle + owner to "FashionAdmin"; + +create unique index patrol_record_issue_handle_id_uindex + on patrol_record_issue_handle (id); + diff --git a/web/client/src/app.js b/web/client/src/app.js index 98d351d..1597273 100644 --- a/web/client/src/app.js +++ b/web/client/src/app.js @@ -7,6 +7,7 @@ import Safetymanage from './sections/safetymanage'; import ProjectRegime from './sections/projectRegime'; import Organization from './sections/organization'; import PatrolManage from './sections/patrolManage'; +import IssueHandle from './sections/issueHandle' const App = props => { const { projectName } = props @@ -18,7 +19,7 @@ const App = props => { return ( ) diff --git a/web/client/src/sections/auth/containers/login.js b/web/client/src/sections/auth/containers/login.js index 63bbe0c..dcba5df 100644 --- a/web/client/src/sections/auth/containers/login.js +++ b/web/client/src/sections/auth/containers/login.js @@ -11,6 +11,7 @@ import { login, LOGIN_ERROR } from '../actions/auth'; import { ExclamationCircleOutlined } from '@ant-design/icons'; import { Uploads } from '$components' import { LockOutlined, UserOutlined } from '@ant-design/icons'; + import '../style.less'; const FormItem = Form.Item; diff --git a/web/client/src/sections/issueHandle/actions/index.js b/web/client/src/sections/issueHandle/actions/index.js new file mode 100644 index 0000000..c7277cb --- /dev/null +++ b/web/client/src/sections/issueHandle/actions/index.js @@ -0,0 +1,11 @@ +'use strict'; + + +import * as record from './record' + + +export default { + + ...record, + +} \ No newline at end of file diff --git a/web/client/src/sections/issueHandle/actions/record.js b/web/client/src/sections/issueHandle/actions/record.js new file mode 100644 index 0000000..1a75b63 --- /dev/null +++ b/web/client/src/sections/issueHandle/actions/record.js @@ -0,0 +1,32 @@ +'use strict'; + +import { basicAction } from '@peace/utils' +import { ApiTable } from '$utils' + + +export function addPatrolRecordIssueHandle(params) { + return (dispatch) => basicAction({ + type: 'post', + data: params, + dispatch, + actionType: 'ADD_PatrolRecordIssueHandle_REPORT', + url: ApiTable.addPatrolRecordIssueHandle, + msg: { + option: '维修计划新增', + }, + }); +} + +export function modifyPatrolRecordIssueHandle(id, params, msg) { + return (dispatch) => basicAction({ + type: 'put', + data: params, + dispatch, + actionType: 'MODIFY_PatrolRecordIssueHandle_REPORT', + url: ApiTable.modifyPatrolRecordIssueHandle.replace('{id}', id), + msg: { + option: msg || '维修计划审批', + }, + }); +} + diff --git a/web/client/src/sections/issueHandle/components/isuue-handle-mdal.js b/web/client/src/sections/issueHandle/components/isuue-handle-mdal.js new file mode 100644 index 0000000..69c0613 --- /dev/null +++ b/web/client/src/sections/issueHandle/components/isuue-handle-mdal.js @@ -0,0 +1,280 @@ +import React, { useState, useRef } from 'react'; +import { Button, Form, Row, Col, Table, Popconfirm, Input, message } from 'antd'; +import { + ModalForm, + ProFormText, + ProFormSelect, + ProFormTextArea, + ProFormDatePicker, + ProFormDateRangePicker +} from '@ant-design/pro-form'; +import Uploads from '$components/Uploads'; +import moment from 'moment'; +const FormItem = Form.Item; +//state: 1下发未上报 2已上报待审批 3整改完成 上报结果result: status 0 已上报未审批 1 审批通过 2 审批驳回 +export default (props) => { + const { title, triggerRender, editData = null, onFinish, readOnly, companyList, user } = props; + const formItemLayout = { labelCol: { span: 7 }, wrapperCol: { span: 16 } }; + const formRef = useRef(); + + const initialValues = editData ? { + ...editData, + ...editData?.patrolRecordIssueHandles[0], + + } : {}; + if (editData?.patrolRecordIssueHandles?.length > 0) { + initialValues.dateRange = [editData?.patrolRecordIssueHandles[0]?.startTime, editData?.patrolRecordIssueHandles[0]?.endTime] + } + const [reason, setReason] = useState('') + + + const approve = async (approve) => { + formRef.current.validateFields().then(async (values) => { + + onFinish && await onFinish({ + msg: approve ? '计划同意' : '计划驳回', + state: approve ? 4 : 3, + approveOpinion: values?.approveOpinion, + approvePerson: user, + approveDate: moment() + }, editData) + return true; + }) + .catch((errors) => { + if (errors) { + + } + }); + + } + + const renderPlanInfo = () => { + return <> + {/* */} +
{"巡检信息"}
+
+ + + + + + + + + + + + + + + + + + + +
+ +
{"问题详情"}
+ + + + + + + + + { + Object.keys(editData?.points?.inspectContent).map(key => { + if (editData?.points?.inspectContent[key]?.isNormal == false) { + return + + + + + + + + + + + + + + + { + let nextV = [] + for (let s of (editData?.points?.inspectContent[key].imgs || [])) { + if (s) { + nextV.push({ + storageUrl: s + }) + } + } + return nextV + })() + } + /> + + + + + } + }) + } + + + } + + return ( + + {title || ''} + + } + width={1200} + layout="horizontal" + // grid={true} + {...formItemLayout} + modalProps={{ + destroyOnClose: true, + // onCancel: () => { }, + bodyStyle: { height: 720, overflowY: 'auto' } + }} + onFinish={async (values) => { + values.startTime = values?.dateRange[0]; + values.endTime = values?.dateRange[1]; + onFinish && await onFinish(values, editData) + //message.success('提交成功'); + return true; + }} + + submitter={editData?.patrolRecordIssueHandles[0]?.state === 2 ? { + render: (props, defaultDoms) => { + return [ + , + + ]; + } + } : !readOnly} + > +
+ {/*问题记录信息*/} + {renderPlanInfo()} + + {/*维修处理计划表单*/} + { + ((editData?.patrolRecordIssueHandles?.length == 0 && !readOnly) || editData?.patrolRecordIssueHandles?.length > 0) && + <> +
{"维修计划信息"}
+ + + + + + + + + + + + + + + + + + + + } + + { + editData?.patrolRecordIssueHandles[0]?.state === 2 && + <> +
{"维修计划审批"}
+
+ +
+ + } +
+ + + + + ); +}; \ No newline at end of file diff --git a/web/client/src/sections/issueHandle/containers/index.js b/web/client/src/sections/issueHandle/containers/index.js new file mode 100644 index 0000000..2a7741e --- /dev/null +++ b/web/client/src/sections/issueHandle/containers/index.js @@ -0,0 +1,5 @@ +'use strict'; + +import PatrolReocrd from './patrolRecord'; + +export { PatrolReocrd }; \ No newline at end of file diff --git a/web/client/src/sections/issueHandle/containers/patrolRecord.js b/web/client/src/sections/issueHandle/containers/patrolRecord.js new file mode 100644 index 0000000..a7bb93f --- /dev/null +++ b/web/client/src/sections/issueHandle/containers/patrolRecord.js @@ -0,0 +1,234 @@ + +'use strict' + +import React, { useEffect, useState } from 'react'; +import { connect } from 'react-redux'; +import { Form, Input, Select, Button, Table, Modal, DatePicker, Checkbox, Row, Col, Collapse } from 'antd'; +import moment from "moment"; +import Uploads from '$components/Uploads'; +import IssueHandleModal from '../components/isuue-handle-mdal' +import '../style.less' + +const { Panel } = Collapse; +const ISSUEHANDLE_STATE = [1, 2, 3, 4, 5, 6, 7] +const STATE_TEXT = { 1: '待制定计划', 2: '待审核', 3: '计划驳回', 4: '待维修', 5: '待验收', 6: '验收通过', 7: '验收不通过', } + +const PatrolRecord = (props) => { + const { dispatch, actions, user } = props + const { patrolManage, issueHandle } = actions + const [tableList, settableList] = useState([]) + const [name, setName] = useState(''); + const [curState, setCurState] = useState('null'); + const format = 'YYYY-MM-DD HH:mm:ss' + const times = [moment().subtract(70, 'years').format(format), moment().format(format)] + const [search, setSearch] = useState({ name: null, time: [times[0], times[1]], state: 'null' }) + + useEffect(() => { + queryData() + }, []) + + const queryData = () => { + dispatch(patrolManage.records(`patrolRecord/all/${times[0]}/${times[1]}/true/null`)).then(res => { + if (res.success) { + settableList(name != null ? res.payload.data?.filter(v => + (v.points.user.name.indexOf(name) != -1 || v.points.project.name.indexOf(name) != -1)) + .map(v => ({ ...v, key: v.id })) : res.payload.data?.map(v => ({ ...v, key: v.id }))) + } + }) + } + const onFinish = async (values, editData) => { + const dataToSave = { ...values }; + if (editData?.patrolRecordIssueHandles?.length > 0) { + let msg = ''; + if (editData?.patrolRecordIssueHandles[0]?.state == 3) { + dataToSave.state = 2; + msg = '维修计划修改'; + } + return dispatch( + issueHandle.modifyPatrolRecordIssueHandle(editData?.patrolRecordIssueHandles[0]?.id, dataToSave, + values?.msg || msg), + ).then(() => { + queryData(); + }); + } + let state = ISSUEHANDLE_STATE[1]; + + return dispatch(issueHandle.addPatrolRecordIssueHandle({ + ...dataToSave, + state, + patrolRecordId: editData?.id, + creator: user, + createTime: moment() + })).then(() => { + queryData(); + }); + }; + + const renderOptionText = (currentState) => { + let text = '查看' + + return STATE_TEXT[currentState] || text + } + + const columns = [ + { + title: '结构物名称', + dataIndex: 'name', + key: 'name', + width: '10%', + showInDetail: true, + render: (text, record, index) => { + return !record.points?.project ? '' :
{record.points.project.name}
+ } + }, + { + title: '上报人', + dataIndex: 'type', + key: 'type', + showInDetail: true, + width: '10%', + render: (text, record, index) => { + return !record.points?.user ? '' :
{record.points.user.name}
+ } + }, + { + title: '上报时间', + dataIndex: 'time', + key: 'time', + showInDetail: true, + render: (text, record, index) => moment(record.inspectionTime).format('YYYY-MM-DD HH:mm:ss') || '--' + }, { + title: '点位名称', + dataIndex: 'station', + key: 'station', + showInDetail: true, + render: (text, record, index) => record?.points?.itemData?.name + }, + { + title: '问题来源', + dataIndex: 'source', + key: 'source', + showInDetail: true, + render: (text, record, index) => '巡检上报' //暂定巡检上报 后续会增加平台录入 + }, + { + title: '严重等级', + dataIndex: 'level', + key: 'level', + showInDetail: true, + render: (text, record, index) => { + const LEVELS_ = ['严重', '中度', '轻微']; + const recordLevels = [] + Object.keys(record?.points?.inspectContent).map(key => { + recordLevels.push(record?.points?.inspectContent[key]?.level) + }) + const level = LEVELS_.find(s => recordLevels.find(x => x == s)) + return level; + } + }, + { + title: '当前状态', + dataIndex: 'state', + key: 'name', + width: '10%', + showInDetail: true, + render: (text, record, index) => { + return !record?.patrolRecordIssueHandles || record?.patrolRecordIssueHandles?.length == 0 ? '待制定计划' : + renderOptionText(record?.patrolRecordIssueHandles[0]?.state) + } + }, + { + title: '操作', + dataIndex: 'operation', + key: 'operation', + render: (text, record, index) => { + const options = []; + if (!record?.patrolRecordIssueHandles || record?.patrolRecordIssueHandles?.length == 0) { + options.push({renderOptionText(1)}} + user={user} + onFinish={onFinish} />) + } + if (record?.patrolRecordIssueHandles[0]?.state == 2) { + options.push({renderOptionText(2)}} + user={user} + onFinish={onFinish} />) + } + + if (record?.patrolRecordIssueHandles[0]?.state == 3) { + options.push(修改计划} + user={user} + onFinish={onFinish} />) + } + + options.push(查看详情} + user={user} + onFinish={onFinish} />) + + return options; + } + } + ] + + return ( +
+
+ { setName(e.target.value) }} + placeholder="请输入结构物名称或上报人" allowClear /> +