|
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
|
|
|
import { InputNumber, Popover, Divider, Table, message } from 'antd';
|
|
|
|
|
|
function WorkList(props) {
|
|
|
- const { list, onAuth, onSave, allType } = props;
|
|
|
+ const { list, onAuth, onSave, onDelete, allType } = props;
|
|
|
const [expandedRowKeys, setExpandedRowKeys] = useState([]);
|
|
|
const [dataSource, setDataSource] = useState([]);
|
|
|
let workHour = {};
|
|
@@ -10,7 +10,7 @@ function WorkList(props) {
|
|
|
{
|
|
|
title: '分类',
|
|
|
dataIndex: 'type_id',
|
|
|
- width: '25%',
|
|
|
+ width: '20%',
|
|
|
render: type_id => allType[type_id]?.name,
|
|
|
},
|
|
|
{
|
|
@@ -50,10 +50,11 @@ function WorkList(props) {
|
|
|
},
|
|
|
{
|
|
|
title: '操作',
|
|
|
- width: '15%',
|
|
|
+ width: '20%',
|
|
|
render: item => {
|
|
|
if (item.zIndex === 0) return '';
|
|
|
- if (item.audit_state == 1 || item.audit_state == 2) return;
|
|
|
+ if (item.audit_state == 2) return;
|
|
|
+ if (item.audit_state == 1) return <a onClick={() => handleDelete(item)}>删除</a>;
|
|
|
return (
|
|
|
<>
|
|
|
<a
|
|
@@ -71,6 +72,8 @@ function WorkList(props) {
|
|
|
>
|
|
|
上报审批
|
|
|
</a>
|
|
|
+ <Divider type="vertical"></Divider>
|
|
|
+ <a onClick={() => handleDelete(item)}>删除</a>
|
|
|
</>
|
|
|
);
|
|
|
},
|
|
@@ -106,6 +109,10 @@ function WorkList(props) {
|
|
|
onSave(item, data);
|
|
|
};
|
|
|
|
|
|
+ const handleDelete = item => {
|
|
|
+ onDelete(item);
|
|
|
+ };
|
|
|
+
|
|
|
const getList = () => {
|
|
|
let data = {},
|
|
|
expandedRowKeys = [];
|