Commit d432285b authored by TZW's avatar TZW

12051115

parent 84cba1fd
/* 接单、派单窗口
* @Author: Li Hanlin
* @Date: 2022-12-05 11:13:26
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-05 11:15:35
*/
import React, { useState, useEffect } from 'react';
function getcolumns(setdrawer) { function getcolumns(setdrawer) {
return [ return [
{ {
"tab": "维修工单", "tab": "维修工单",
......
/* 接单平台
* @Author: Li Hanlin
* @Date: 2022-12-05 10:13:42
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-05 11:09:28
*/
import * as React from 'react'; import * as React from 'react';
import { useState, useMemo, useRef } from 'react'; import { useState, useMemo, useRef } from 'react';
import DrawerPro from '@/components/DrawerPro'; import DrawerPro from '@/components/DrawerPro';
...@@ -51,44 +58,48 @@ function Platform(props) { ...@@ -51,44 +58,48 @@ function Platform(props) {
); );
}; };
const edit = (text, row, _, action) => { // 接单按钮
const receiveBtn = (text, row, _, action) => {
return ( return (
<PremButton <PremButton
btn={{ btn={{
size: 'small', size: 'small',
type: 'primary',
onClick: () => { onClick: () => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: true, open: true,
item: row, item: row,
title: '编辑', title: '接单',
val: 'edit', val: 'add',
})); }));
}, },
}} }}
> >
编辑 接单
</PremButton> </PremButton>
); );
}; };
const remove = (text, row, _, action) => { // 派单按钮
const dispatchBtn = (text, row, _, action) => {
return ( return (
<PremButton <PremButton
pop={{
title: '是否删除?',
okText: '确认',
cancelText: '取消',
onConfirm: () => {
run({ url: pathconfig?.delete || '/delete', params: { id: row?.id } });
},
}}
btn={{ btn={{
size: 'small', size: 'small',
type: 'danger', type: 'primary',
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '派单',
val: 'add',
}));
},
}} }}
> >
删除 派单
</PremButton> </PremButton>
); );
}; };
...@@ -100,11 +111,13 @@ function Platform(props) { ...@@ -100,11 +111,13 @@ function Platform(props) {
title: '操作', title: '操作',
valueType: 'option', valueType: 'option',
width: 150, width: 150,
render: (text, row, _, action) => [ render: (text, row, _, action) => {
defpath?.enabledetail && detail(text, row, _, action), if (row?.status == 0 || row?.status == 1) {
defpath?.enableedit && edit(text, row, _, action), return [receiveBtn(text, row, _, action)];
defpath?.enabledelete && remove(text, row, _, action), } else {
], return [dispatchBtn(text, row, _, action)];
}
},
}); });
}, [activeTabKey]); }, [activeTabKey]);
...@@ -113,6 +126,16 @@ function Platform(props) { ...@@ -113,6 +126,16 @@ function Platform(props) {
return defpath; return defpath;
}, [activeTabKey]); }, [activeTabKey]);
function selectType(type) {
switch (type) {
case 'rec':
return;
break;
default:
break;
}
}
return ( return (
<div style={{ position: 'relative' }}> <div style={{ position: 'relative' }}>
<AutoTable <AutoTable
...@@ -165,7 +188,9 @@ function Platform(props) { ...@@ -165,7 +188,9 @@ function Platform(props) {
run({ url: pathconfig?.edit || '/edit', params: { ...vals, id: drawer?.item?.id } }); run({ url: pathconfig?.edit || '/edit', params: { ...vals, id: drawer?.item?.id } });
} }
}} }}
/> >
{selectType(drawer?.type)}
</DrawerPro>
</div> </div>
); );
} }
......
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