From 3e70980eed2f9b924b2554f3e4fa77625bf1e007 Mon Sep 17 00:00:00 2001 From: wenlele Date: Mon, 5 Jun 2023 10:02:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=85=E5=8A=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workOrder/containers/stayDoWorkOrder.jsx | 194 ++++++++++++++++-- .../src/sections/workOrder/nav-item.jsx | 8 +- web/client/src/sections/workOrder/routes.js | 10 +- web/client/src/utils/webapi.js | 2 + 4 files changed, 183 insertions(+), 31 deletions(-) diff --git a/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx b/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx index f3bccd2..c3249ad 100644 --- a/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx +++ b/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx @@ -1,37 +1,187 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import { connect } from 'react-redux'; -import { ApiTable, AxyRequest, EmisRequest } from '$utils' +import { ApiTable, EmisApiTable, EmisRequest } from '$utils' +import { Skeleton, Button, Pagination, Form, Popconfirm, Table, Toast } from '@douyinfe/semi-ui'; +import { IconSearch } from '@douyinfe/semi-icons'; +import { SkeletonScreen, } from "$components"; +import moment from "moment"; + + const Rest = (props) => { - const { dispatch, actions, user, loading, socket } = props + const { dispatch, actions, user, socket } = props + + const form = useRef();//表单 + const [setup, setSetup] = useState(false); //表格设置是否显现 + const [setupp, setSetupp] = useState([]);//实际显示的表格列表 + const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 + const [limits, setLimits] = useState(0)//每页实际条数 + const mylimits = useRef(); //每页实际条数 + const [pushModal, setPushModal] = useState(false) //信鸽弹框 + const [pushEdit, setPushEdit] = useState(false) //是否是修改 + const [change, setChange] = useState(false) //是否改变 + const [allTableData, setAllTableData] = useState([]) //获取到的所有表格信息 + const [editObj, setEditObj] = useState({});//管理员弹框修改内容 + const [projectStatus, setProjectStatus] = useState([]); //获取项目状态列表 + const [tableData, setTableData] = useState([]); //获取项目状态列表 + const [loading, setLoading] = useState(true); //获取项目状态列表 useEffect(() => { - EmisRequest.get('process-instance/my-apply-list', - { userId: 1, offset: 0, limit: 10,businessType:'假勤管理' }) - .then(user => { - // sessionStorage.setItem('pomsUser', JSON.stringify(user)); - // return dispatch({ - // type: LOGIN_SUCCESS, - // payload: { user: user }, - // }); - }, error => { - // let { body } = error.response; - // return dispatch({ - // type: LOGIN_ERROR, - // payload: { - // error: body && body.message ? body.message : '登录失败' - // } - // }) - }); + backlogData() }, []) + let backlogData = () => { + setLoading(true) + EmisRequest.get(EmisApiTable.processInstancemMyAuditList, + { userId: 1, offset: 0, limit: 10, businessType: '' }) + .then(res => { + console.log(111, res); + setTableData(res) + setLimits(res.length || 0) + setLoading(false) + // sessionStorage.setItem('pomsUser', JSON.stringify(user)); + // return dispatch({ + // type: LOGIN_SUCCESS, + // payload: { user: user }, + // }); + }, error => { + Toast.error({ content: '待办工单请求失败', duration: 1, }) + setLoading(false) + + }); + } + + let columns = [{ + title: '序号', + dataIndex: 'index', + render: (text, record, index) => index + 1 + }, { + title: '标题', + dataIndex: 'nae', + }, { + title: '关联项目', + dataIndex: 'nae', + }, { + title: '申请人', + dataIndex: 'applyerName', + }, { + title: '申请部门', + dataIndex: 'applyDepartmentName', + }, { + title: '提交时间', + dataIndex: 'startTime', + render: (text, record, index) => text && moment(text).format('YYYY-MM-DD HH:mm:ss') || '--' + }, { + title: '期望完成时间', + dataIndex: 'nae', + }, { + title: '操作', + dataIndex: 'hadle', + }] return ( <> -
- +
+
+
+
+
待办工单
+
BACKLOG WORKORDER
+
+
+
console.log(values)} + getFormApi={(formApi) => (form.current = formApi)} + layout="horizontal" + style={{ position: "relative", width: "100%", flex: 1 }} + > + + } + field="keyword" + pure + showClear + style={{ width: 260, marginLeft: 12, marginRight: 12 }} + placeholder="请输入申请人" + /> + + + + +
+
+ +
+ + + + +
+
+
+
+ + 共{limits}条信息 + + { + setQuery({ limit: pageSize, page: currentPage - 1 }); + page.current = currentPage - 1 + setChange(!change) + }} + /> +
+
+ ) diff --git a/web/client/src/sections/workOrder/nav-item.jsx b/web/client/src/sections/workOrder/nav-item.jsx index 1cb5326..f74e758 100644 --- a/web/client/src/sections/workOrder/nav-item.jsx +++ b/web/client/src/sections/workOrder/nav-item.jsx @@ -20,13 +20,13 @@ export function getNavItem (user, dispatch) { icon: , to: '/workOrder/workOrderList/stayDoWorkOrder', items: [{ - itemKey: 'stayDoWorkOrder', to: '/workOrder/workOrderList/stayDoWorkOrder', text: '代办工单' + itemKey: 'stayDoWorkOrder', to: '/workOrder/workOrderList/stayDoWorkOrder', text: '待办工单' },{ - itemKey: 'initiated', to: '/workOrder/workOrderList/initiated', text: '我发起的' + itemKey: 'initiated', to: '/workOrder/workOrderList/initiated', text: '由发起的' },{ - itemKey: 'receipt', to: '/workOrder/workOrderList/receipt', text: '工单回执' + itemKey: 'receipt', to: '/workOrder/workOrderList/already ', text: '已办工单' },{ - itemKey: 'aboutMe', to: '/workOrder/workOrderList/aboutMe', text: '与我有关的' + itemKey: 'aboutMe', to: '/workOrder/workOrderList/aboutMe', text: '抄送我' }] } ] diff --git a/web/client/src/sections/workOrder/routes.js b/web/client/src/sections/workOrder/routes.js index 34fc747..8a17cf2 100644 --- a/web/client/src/sections/workOrder/routes.js +++ b/web/client/src/sections/workOrder/routes.js @@ -20,17 +20,17 @@ export default [{ path: '/stayDoWorkOrder', key: 'stayDoWorkOrder', component: StayDoWorkOrder, - breadcrumb: '代办工单', + breadcrumb: '待办工单', }, { path: '/initiated', key: 'initiated', component: Initiated, - breadcrumb: '我发起的', + breadcrumb: '由发起的', }, { - path: '/receipt', - key: 'receipt', + path: '/already ', + key: 'already ', component: Receipt, - breadcrumb: '工单回执', + breadcrumb: '已办工单', }, { path: '/aboutMe', key: 'aboutMe', diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index 2c3261a..23f49b6 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -86,6 +86,8 @@ export const ApiTable = { export const EmisApiTable = { //通过流程名称查找指定流程 getProcessByName: 'workflow/process/name', + processInstancemMyApplyList: 'process-instance/my-apply-list', + processInstancemMyAuditList: 'process-instance/my-audit-list?', } export const RouteTable = {