diff --git a/api/app/lib/controllers/patrolManage/patrolRecord.js b/api/app/lib/controllers/patrolManage/patrolRecord.js
index 2f57216..f78d5f3 100644
--- a/api/app/lib/controllers/patrolManage/patrolRecord.js
+++ b/api/app/lib/controllers/patrolManage/patrolRecord.js
@@ -150,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 },
diff --git a/api/app/lib/models/patrol_record_issue_handle.js b/api/app/lib/models/patrol_record_issue_handle.js
index 7f592bd..af565e1 100644
--- a/api/app/lib/models/patrol_record_issue_handle.js
+++ b/api/app/lib/models/patrol_record_issue_handle.js
@@ -148,7 +148,7 @@ module.exports = dc => {
defaultValue: null,
comment: "制定日期",
primaryKey: false,
- field: "approve_date",
+ field: "create_time",
autoIncrement: false
},
}, {
diff --git a/api/app/lib/models/user.js b/api/app/lib/models/user.js
index 9d7999a..0e1c4c6 100644
--- a/api/app/lib/models/user.js
+++ b/api/app/lib/models/user.js
@@ -96,15 +96,15 @@ module.exports = dc => {
field: "post",
autoIncrement: false
},
- structure: {
- type: DataTypes.STRING,
- allowNull: true,
- defaultValue: null,
- comment: "结构物",
- primaryKey: false,
- field: "structure",
- autoIncrement: false
- }
+ // structure: {
+ // type: DataTypes.STRING,
+ // allowNull: true,
+ // defaultValue: null,
+ // comment: "结构物",
+ // primaryKey: false,
+ // field: "structure",
+ // autoIncrement: false
+ // }
}, {
tableName: "user",
comment: "",
diff --git a/web/client/src/sections/issueHandle/actions/checkItems.js b/web/client/src/sections/issueHandle/actions/checkItems.js
deleted file mode 100644
index f7a2666..0000000
--- a/web/client/src/sections/issueHandle/actions/checkItems.js
+++ /dev/null
@@ -1,78 +0,0 @@
-'use strict';
-
-import { basicAction } from '@peace/utils'
-import { ApiTable } from '$utils'
-
-export function getCheckItemsGroup() {
- return dispatch => basicAction({
- type: 'get',
- dispatch: dispatch,
- actionType: 'GET_CHECK_ITEMS_GRROUP',
- url: ApiTable.checkItemsGroup,
- msg: { error: '获取检查项分组失败' },
- reducer:{name:'checkItemsGroup'}
- });
-}
-
-export function createCheckItemsGroup(data) {
- return dispatch => basicAction({
- type: 'post',
- data,
- dispatch: dispatch,
- actionType: 'CREATE_CHECK_ITEMS_GRROUP',
- url: ApiTable.checkItemsGroup,
- msg: { option: '创建检查项分组' },
- });
-}
-
-export function getCheckItems(query) {
- return dispatch => basicAction({
- type: 'get',
- dispatch: dispatch,
- query: query,
- actionType: 'GET_CHECK_ITEMS',
- url: ApiTable.checkItems,
- msg: { error: '获取检查项失败' }
- });
-}
-
-export function createCheckItems(data) {
- return dispatch => basicAction({
- type: 'post',
- data,
- dispatch: dispatch,
- actionType: 'CREATE_CHECK_ITEMS',
- url: ApiTable.checkItems,
- msg: { option: '新建检查项' },
- });
-}
-
-export function updateCheckItems(id, data) {
- return dispatch => basicAction({
- type: 'put',
- data,
- dispatch: dispatch,
- actionType: 'UPDATE_CHECK_ITEMS',
- url: ApiTable.updateCheckItems.replace('{id}', id),
- msg: { option: '修改检查项' },
- });
-}
-
-export function delCheckItems(ids) {
- return dispatch => basicAction({
- type: 'del',
- dispatch: dispatch,
- actionType: 'DEL_CHECK_ITEMS',
- url: ApiTable.delCheckItems.replace('{ids}', ids),
- msg: { option: '删除检查项' },
- });
-}
-
-export default {
- getCheckItemsGroup,
- createCheckItemsGroup,
- getCheckItems,
- createCheckItems,
- updateCheckItems,
- delCheckItems,
-}
\ No newline at end of file
diff --git a/web/client/src/sections/issueHandle/actions/index.js b/web/client/src/sections/issueHandle/actions/index.js
index d6e7974..c7277cb 100644
--- a/web/client/src/sections/issueHandle/actions/index.js
+++ b/web/client/src/sections/issueHandle/actions/index.js
@@ -1,13 +1,11 @@
'use strict';
-import * as plan from './plan'
+
import * as record from './record'
-import * as template from './template'
-import * as checkItems from './checkItems'
+
export default {
- ...plan,
+
...record,
- ...template,
- ...checkItems,
+
}
\ No newline at end of file
diff --git a/web/client/src/sections/issueHandle/actions/plan.js b/web/client/src/sections/issueHandle/actions/plan.js
deleted file mode 100644
index 6b94bca..0000000
--- a/web/client/src/sections/issueHandle/actions/plan.js
+++ /dev/null
@@ -1,80 +0,0 @@
-'use strict';
-
-import { basicAction } from '@peace/utils'
-import { ApiTable } from '$utils'
-
-export function getPatrolPlan() {
- return dispatch => basicAction({
- type: 'get',
- dispatch: dispatch,
- actionType: 'GET_PATROL_PLAN',
- url: ApiTable.patrolPlan,
- msg: { error: '获取巡检计划失败' },
- });
-}
-
-export function createPatrolPlan(data) {
- return dispatch => basicAction({
- type: 'post',
- data,
- dispatch: dispatch,
- actionType: 'CREATE_PATROL_PLAN',
- url: ApiTable.patrolPlan,
- msg: { error: '新增巡检计划失败' },
- });
-}
-
-export function delPatrolPlan(id) {
- return dispatch => basicAction({
- type: 'del',
- dispatch: dispatch,
- actionType: 'DEL_PATROL_PLAN',
- url: ApiTable.delPatrolPlan.replace('{id}', id),
- msg: { error: '删除巡检计划失败' },
- });
-}
-
-export function updatePatrolPlan(data) {
- return dispatch => basicAction({
- type: 'put',
- data,
- dispatch: dispatch,
- actionType: 'UPDATE_PATROL_PLAN',
- url: ApiTable.patrolPlan,
- msg: { error: '修改巡检计划失败' },
- });
-}
-
-export function getUserList() {
- return dispatch => basicAction({
- type: 'get',
- dispatch: dispatch,
- actionType: 'GET_USER_LIST',
- url: ApiTable.getDepUser.replace('{depId}', null),
- msg: { error: '获取人员列表失败' },
- reducer: { name: 'userList' }
- });
-}
-
-export function getProjectList(query) {
- return (dispatch) => basicAction({
- type: 'get',
- query,
- dispatch,
- actionType: 'GET_PROJEECT_LIST',
- url: ApiTable.getProjectList,
- msg: { error: '获取结构物列表失败', },
- reducer: { name: 'structureList' }
- });
-}
-
-export function positionList(query) {
- return (dispatch) => basicAction({
- type: 'get',
- query,
- dispatch,
- actionType: 'POSITION_LIST',
- url: ApiTable.position,
- msg: { error: '获取点位列表失败', },
- });
-}
\ 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
index a6ae77e..1a75b63 100644
--- a/web/client/src/sections/issueHandle/actions/record.js
+++ b/web/client/src/sections/issueHandle/actions/record.js
@@ -1,17 +1,32 @@
'use strict';
import { basicAction } from '@peace/utils'
+import { ApiTable } from '$utils'
-export const GET_PATROL_RECORD_LIST = 'GET_PATROL_RECORD_LIST';
-export const GET_PATROL_RECORD_LIST_SUCCESS = 'GET_PATROL_RECORD_LIST_SUCCESS';
-export const GET_PATROL_RECORD_LIST_ERROR = 'GET_PATROL_RECORD_LIST_ERROR';
-export function records(url) {
+
+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: 'get',
+ type: 'put',
+ data: params,
dispatch,
- actionType: GET_PATROL_RECORD_LIST,
- url: url,
- msg: { error: '获取巡检记录失败', },
- reducer: { name: 'record' }
+ actionType: 'MODIFY_PatrolRecordIssueHandle_REPORT',
+ url: ApiTable.modifyPatrolRecordIssueHandle.replace('{id}', id),
+ msg: {
+ option: msg || '维修计划审批',
+ },
});
-}
\ No newline at end of file
+}
+
diff --git a/web/client/src/sections/issueHandle/actions/template.js b/web/client/src/sections/issueHandle/actions/template.js
deleted file mode 100644
index 0442191..0000000
--- a/web/client/src/sections/issueHandle/actions/template.js
+++ /dev/null
@@ -1,47 +0,0 @@
-'use strict';
-
-import { basicAction } from '@peace/utils'
-import { ApiTable } from '$utils'
-
-export function getPatrolTemplate () {
- return dispatch => basicAction({
- type: 'get',
- dispatch: dispatch,
- actionType: 'GET_PATROL_TEMPLATE',
- url: ApiTable.patrolTemplate,
- msg: { error: '获取巡检模板失败' },
- reducer: { name: 'patrolTemplate' }
- });
-}
-
-export function createPatrolTemplate (data) {
- return dispatch => basicAction({
- type: 'post',
- data,
- dispatch: dispatch,
- actionType: 'CREATE_PATROL_TEMPLATE',
- url: ApiTable.patrolTemplate,
- msg: { option: '新增巡检模板' },
- });
-}
-
-export function delPatrolTemplate (id) {
- return dispatch => basicAction({
- type: 'del',
- dispatch: dispatch,
- actionType: 'DEL_PATROL_TEMPLATE',
- url: ApiTable.delPatrolTemplate.replace('{id}', id),
- msg: { option: '删除巡检模板' },
- });
-}
-
-export function updatePatrolTemplate (data) {
- return dispatch => basicAction({
- type: 'put',
- data,
- dispatch: dispatch,
- actionType: 'UPDATE_PATROL_TEMPLATE',
- url: ApiTable.patrolTemplate,
- msg: { option: '修改巡检模板' },
- });
-}
\ No newline at end of file
diff --git a/web/client/src/sections/issueHandle/components/isuue-handle-mdal.js b/web/client/src/sections/issueHandle/components/isuue-handle-mdal.js
index 4c14b5b..69c0613 100644
--- a/web/client/src/sections/issueHandle/components/isuue-handle-mdal.js
+++ b/web/client/src/sections/issueHandle/components/isuue-handle-mdal.js
@@ -5,7 +5,8 @@ import {
ProFormText,
ProFormSelect,
ProFormTextArea,
- ProFormDatePicker
+ ProFormDatePicker,
+ ProFormDateRangePicker
} from '@ant-design/pro-form';
import Uploads from '$components/Uploads';
import moment from 'moment';
@@ -13,81 +14,129 @@ 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: 6 }, wrapperCol: { span: 16 } };
+ const formItemLayout = { labelCol: { span: 7 }, wrapperCol: { span: 16 } };
+ const formRef = useRef();
+
const initialValues = editData ? {
- ...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 columns = [
- {
- title: '序号',
- dataIndex: 'index',
- key: 'index',
- render: (text, record, index) => index + 1
- },
- {
- title: '提交时间',
- dataIndex: 'time',
- key: 'time',
- },
- {
- title: '整改附件',
- dataIndex: 'file',
- key: 'file',
- render: (text, record) => {
- return