Commit 66c1197b authored by 皮倩雯's avatar 皮倩雯

fix: '事件添加编辑业务类型名称功能'

parent ee75a64b
Pipeline #62445 failed with stages
...@@ -20,6 +20,9 @@ import { ...@@ -20,6 +20,9 @@ import {
notification, notification,
Tree, Tree,
Button, Button,
Modal,
Input,
message,
} from 'antd'; } from 'antd';
import { import {
...@@ -32,12 +35,14 @@ import { ...@@ -32,12 +35,14 @@ import {
OrderedListOutlined, OrderedListOutlined,
ApartmentOutlined, ApartmentOutlined,
DesktopOutlined, DesktopOutlined,
FormOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import { import {
GetCM_Event_LoadEventTable, GetCM_Event_LoadEventTable,
CM_Event_RemoveEventTable, CM_Event_RemoveEventTable,
CM_Event_ReOrder, CM_Event_ReOrder,
GetCM_Event_LoadEventTypeTable, GetCM_Event_LoadEventTypeTable,
CM_Event_EditBusinessType
} from '@/services/standingBook/api'; } from '@/services/standingBook/api';
import classnames from 'classnames'; import classnames from 'classnames';
import styles from './incident.less'; import styles from './incident.less';
...@@ -71,6 +76,8 @@ const incident = () => { ...@@ -71,6 +76,8 @@ const incident = () => {
const [pickItem, setPickItem] = useState(''); const [pickItem, setPickItem] = useState('');
const [hoverItemIndex, setHoverItemIndex] = useState(0); // hover流程索引 const [hoverItemIndex, setHoverItemIndex] = useState(0); // hover流程索引
const [keepIdValue, setKeepIdValue] = useState([]); const [keepIdValue, setKeepIdValue] = useState([]);
const [editBusinessVisible, setEditBusinessVisible] = useState(false);
const [addForm] = Form.useForm();
const columns = [ const columns = [
{ {
...@@ -469,7 +476,42 @@ const incident = () => { ...@@ -469,7 +476,42 @@ const incident = () => {
}); });
} }
}); });
}; };
const editBusiness = () =>{
setEditBusinessVisible(true)
addForm.setFieldsValue({newBusinessType:pickItem})
}
const editOk = () =>{
let aa =addForm.getFieldsValue().newBusinessType;
console.log(aa);
CM_Event_EditBusinessType({
oldBusinessType:pickItem,
newBusinessType:aa
}).then(res=>{
if(res.code===0){
setEditBusinessVisible(false);
setFlag(flag + 1);
notification.success({
message: '提示',
duration: 3,
description: '编辑成功',
});
}else{
notification.error({
message: '提示',
duration: 3,
description: res.msg||'编辑失败',
});
}
}).catch(err => {
message.error(err);
});
}
return ( return (
<div className={styles.incidentContainer}> <div className={styles.incidentContainer}>
<div className={styles.contentContainers}> <div className={styles.contentContainers}>
...@@ -569,6 +611,8 @@ const incident = () => { ...@@ -569,6 +611,8 @@ const incident = () => {
})} })}
> >
<div style={{ height: '50px' }}> <div style={{ height: '50px' }}>
<span className={styles.titleName}>{pickItem}</span>
<span ><Tooltip title="编辑业务类型名称"><FormOutlined className={styles.iconSize} onClick={editBusiness}/></Tooltip></span>
<span style={{ float: 'right', marginRight: '10px' }}> <span style={{ float: 'right', marginRight: '10px' }}>
<Button <Button
icon={<OrderedListOutlined className={styles.icon} />} icon={<OrderedListOutlined className={styles.icon} />}
...@@ -629,6 +673,21 @@ const incident = () => { ...@@ -629,6 +673,21 @@ const incident = () => {
callBackSubmit={onOK} callBackSubmit={onOK}
keepIdValue={keepIdValue} keepIdValue={keepIdValue}
/> />
<Modal
title='编辑业务类型名称'
visible={editBusinessVisible}
onCancel={()=>setEditBusinessVisible(false)}
onOk={()=>editOk()}
>
<Form form={addForm} labelCol={{ span: 3 }}>
<Form.Item name="newBusinessType" label="名称" rules={[{ required: true, message: '不能为空' }]}>
<Input placeholder="请输入名称" style={{ width: '95%' }} allowClear/>
</Form.Item>
<Form.Item name="newBusinessType" label="名称" style={{ display: 'none' }}>
<Input placeholder="请输入名称" style={{ width: '95%' }} />
</Form.Item>
</Form>
</Modal>
</div> </div>
</div> </div>
); );
......
...@@ -404,6 +404,22 @@ ...@@ -404,6 +404,22 @@
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
} }
} }
.iconSize{
font-size: 18px;
color: #1890FF;
svg{
margin-top:-7px;
}
}
.titleName{
font-size: 18px;
color: rgba(0, 114, 255, 1);
font-weight: bold;
display: inline-block;
margin-left: 10px;
line-height: 50px;
}
// .panda-pro-pages-platform-center-bsmanager-work-order-incident-filed_listItem { // .panda-pro-pages-platform-center-bsmanager-work-order-incident-filed_listItem {
// display: flex; // display: flex;
......
...@@ -47,6 +47,10 @@ export const CM_Event_LoadDepartmentAndRoles = query => ...@@ -47,6 +47,10 @@ export const CM_Event_LoadDepartmentAndRoles = query =>
export const CM_Event_EditEventTable = data => export const CM_Event_EditEventTable = data =>
post(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_EditEventTable`, data); post(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_EditEventTable`, data);
// 修改事件业务类型
export const CM_Event_EditBusinessType = data =>
post(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_EditBusinessType`, data);
// 加载事件权限部门角色 // 加载事件权限部门角色
export const GetCM_Event_QueryEventType = query => export const GetCM_Event_QueryEventType = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCM_Event_QueryEventType`, query); get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCM_Event_QueryEventType`, query);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment