wenlele 2 years ago
parent
commit
3e70980eed
  1. 194
      web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx
  2. 8
      web/client/src/sections/workOrder/nav-item.jsx
  3. 10
      web/client/src/sections/workOrder/routes.js
  4. 2
      web/client/src/utils/webapi.js

194
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 { 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 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(() => { useEffect(() => {
EmisRequest.get('process-instance/my-apply-list', backlogData()
{ 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 : ''
// }
// })
});
}, []) }, [])
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 ( return (
<> <>
<div> <div style={{ background: '#FFFFFF', margin: '8px 12px', padding: '20px 20px 0px 20px' }}>
<img src="/assets/images/install/watting.png" alt="" style={{ width: 'calc(100% + 16px)', position: "relative", top: -12, left: -8, }} /> <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ width: 0, height: 20, borderLeft: '3px solid #005ABD', borderTop: '3px solid transparent', borderBottom: '3px solid transparent' }}></div>
<div style={{ fontFamily: "YouSheBiaoTiHei", fontSize: 24, color: '#101531', marginLeft: 8 }}>待办工单</div>
<div style={{ marginLeft: 6, fontSize: 12, color: '#969799', fontFamily: "DINExp", }}>BACKLOG WORKORDER</div>
</div>
<div style={{ marginRight: 20, display: 'flex', alignItems: 'center' }} className='myempush'>
<Form
onSubmit={(values) => console.log(values)}
getFormApi={(formApi) => (form.current = formApi)}
layout="horizontal"
style={{ position: "relative", width: "100%", flex: 1 }}
>
<Form.DatePicker
pure
field="applyTimes"
label="提交时间"
style={{ width: 268 }}
type="dateRange" density="compact"
/>
<Form.Input
suffix={<IconSearch />}
field="keyword"
pure
showClear
style={{ width: 260, marginLeft: 12, marginRight: 12 }}
placeholder="请输入申请人"
/>
</Form>
<Button
theme="solid"
type="primary"
style={{
width: 80,
height: 32,
borderRadius: 2,
marginRight: 32,
background: '#FFFFFF',
color: '#005ABD',
border: '1px solid #005ABD'
}}
onClick={() => {
getPushList({ limit: query.limit, page: 0 })
}}
>
查询
</Button>
</div>
</div>
<div style={{ marginTop: 20 }}>
<Skeleton
loading={loading}
// loading={false}
active={true}
placeholder={SkeletonScreen()}
>
<Table
rowKey="name"
columns={columns}
dataSource={tableData}
bordered={false}
hideExpandedColumn={false}
empty="暂无数据"
pagination={false}
/>
</Skeleton>
<div
style={{
display: "flex",
justifyContent: "space-between",
padding: "20px 20px",
}}
>
<div>
</div>
<div style={{ display: 'flex', }}>
<span style={{ lineHeight: "30px", fontSize: 13, color: 'rgba(0,90,189,0.8)' }}>
{limits}条信息
</span>
<Pagination
className="22"
total={limits}
showSizeChanger
currentPage={query.page + 1}
pageSizeOpts={[10, 20, 30, 40]}
onChange={(currentPage, pageSize) => {
setQuery({ limit: pageSize, page: currentPage - 1 });
page.current = currentPage - 1
setChange(!change)
}}
/>
</div>
</div>
</div>
</div> </div>
</> </>
) )

8
web/client/src/sections/workOrder/nav-item.jsx

@ -20,13 +20,13 @@ export function getNavItem (user, dispatch) {
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconjianshezhong"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconjianshezhong"></iconpark-icon>,
to: '/workOrder/workOrderList/stayDoWorkOrder', to: '/workOrder/workOrderList/stayDoWorkOrder',
items: [{ 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: '抄送我'
}] }]
} }
] ]

10
web/client/src/sections/workOrder/routes.js

@ -20,17 +20,17 @@ export default [{
path: '/stayDoWorkOrder', path: '/stayDoWorkOrder',
key: 'stayDoWorkOrder', key: 'stayDoWorkOrder',
component: StayDoWorkOrder, component: StayDoWorkOrder,
breadcrumb: '办工单', breadcrumb: '办工单',
}, { }, {
path: '/initiated', path: '/initiated',
key: 'initiated', key: 'initiated',
component: Initiated, component: Initiated,
breadcrumb: '发起的', breadcrumb: '发起的',
}, { }, {
path: '/receipt', path: '/already ',
key: 'receipt', key: 'already ',
component: Receipt, component: Receipt,
breadcrumb: '工单回执', breadcrumb: '已办工单',
}, { }, {
path: '/aboutMe', path: '/aboutMe',
key: 'aboutMe', key: 'aboutMe',

2
web/client/src/utils/webapi.js

@ -86,6 +86,8 @@ export const ApiTable = {
export const EmisApiTable = { export const EmisApiTable = {
//通过流程名称查找指定流程 //通过流程名称查找指定流程
getProcessByName: 'workflow/process/name', getProcessByName: 'workflow/process/name',
processInstancemMyApplyList: 'process-instance/my-apply-list',
processInstancemMyAuditList: 'process-instance/my-audit-list?',
} }
export const RouteTable = { export const RouteTable = {

Loading…
Cancel
Save