Commit fee786c5 authored by TZW's avatar TZW

1111

parent 911a41cd
...@@ -60,6 +60,7 @@ function getcolumns(equipmentModelId) { ...@@ -60,6 +60,7 @@ function getcolumns(equipmentModelId) {
title: '备注', title: '备注',
dataIndex: 'remark', dataIndex: 'remark',
key: 'remark', key: 'remark',
span: 24,
valueType: 'textarea', valueType: 'textarea',
hideInSearch: true, hideInSearch: true,
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2023-01-16 15:35:00 * @Date: 2023-01-16 15:35:00
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-18 15:20:30 * @Last Modified time: 2023-01-18 16:36:26
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -21,8 +21,8 @@ function Plan(props) { ...@@ -21,8 +21,8 @@ function Plan(props) {
const actionRef = useRef(), const actionRef = useRef(),
formRef = useRef(); formRef = useRef();
const [drawer, setdrawer] = useState({ const [drawer, setdrawer] = useState({
open: false, open: false,
}), }),
[activeTabKey, setactiveTabKey] = useState('1'); [activeTabKey, setactiveTabKey] = useState('1');
const { run, loading, runAsync } = useRequest(doFetch, { const { run, loading, runAsync } = useRequest(doFetch, {
...@@ -460,32 +460,43 @@ function Plan(props) { ...@@ -460,32 +460,43 @@ function Plan(props) {
let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {}; let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
return activeTabKey == 1 return activeTabKey == 1
? defcolumn.concat([ ? defcolumn.concat([
{ {
title: '启用/停用', title: '启用/停用',
dataIndex: 'isStopStatus', dataIndex: 'isStopStatus',
key: 'isStopStatus', key: 'isStopStatus',
hideInForm: true, hideInForm: true,
hideInSearch: true, hideInSearch: true,
valueType: 'switch', valueType: 'switch',
render: (text, row, _, action) => { render: (text, row, _, action) => {
//"1停用 2启用 *" //"1停用 2启用 *"
return row.isStopStatus == 1 ? ( return row.isStopStatus == 1 ? (
<Popconfirm <Popconfirm
title="是否开启或停用?" title="是否开启或停用?"
onConfirm={async () => { onConfirm={async () => {
if (row.isStopStatus == 1) { if (row.isStopStatus == 1) {
await runAsync({ await runAsync({
url: '/maintain/umMaintainPlan/enableDeactivate', url: '/maintain/umMaintainPlan/enableDeactivate',
params: { id: row.id, isStopFlag: 2 }, params: { id: row.id, isStopFlag: 2 },
}); });
}
}}
okText="确定"
cancelText="取消"
disabled={
!(row.maintainStatus == 1 || (row.maintainStatus == 2 && row.isCycle == 2))
} }
}} >
okText="确定" <Switch
cancelText="取消" checked={row.isStopStatus == 1 ? true : false}
disabled={ checkedChildren="开启"
!(row.maintainStatus == 1 || (row.maintainStatus == 2 && row.isCycle == 2)) unCheckedChildren="停用"
} defaultChecked={false}
> disabled={
!(row.maintainStatus == 1 || (row.maintainStatus == 2 && row.isCycle == 2))
}
/>
</Popconfirm>
) : (
<Switch <Switch
checked={row.isStopStatus == 1 ? true : false} checked={row.isStopStatus == 1 ? true : false}
checkedChildren="开启" checkedChildren="开启"
...@@ -494,47 +505,36 @@ function Plan(props) { ...@@ -494,47 +505,36 @@ function Plan(props) {
disabled={ disabled={
!(row.maintainStatus == 1 || (row.maintainStatus == 2 && row.isCycle == 2)) !(row.maintainStatus == 1 || (row.maintainStatus == 2 && row.isCycle == 2))
} }
onChange={(checked) => {
if (checked) {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '调整日期',
val: 'detailaddon',
id: row?.id,
from: 'tq',
}));
}
}}
/> />
</Popconfirm> );
) : ( },
<Switch hideInDescriptions: true,
checked={row.isStopStatus == 1 ? true : false}
checkedChildren="开启"
unCheckedChildren="停用"
defaultChecked={false}
disabled={
!(row.maintainStatus == 1 || (row.maintainStatus == 2 && row.isCycle == 2))
}
onChange={(checked) => {
if (checked) {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '调整日期',
val: 'detailaddon',
id: row?.id,
from: 'tq',
}));
}
}}
/>
);
}, },
hideInDescriptions: true, {
}, title: '操作',
{ valueType: 'option',
title: '操作', width: 150,
valueType: 'option', render: (text, row, _, action) => [
width: 150, (row.maintainStatus == 1 || (row.maintainStatus == 2 && row.isCycle == 2)) &&
render: (text, row, _, action) => [ editDate(text, row, _, action),
(row.maintainStatus == 1 || (row.maintainStatus == 2 && row.isCycle == 2)) && row.maintainStatus == 2 && close(text, row, _, action),
editDate(text, row, _, action), defpath?.enabledelete && row.maintainStatus == 1 && remove(text, row, _, action),
row.maintainStatus == 2 && close(text, row, _, action), ],
defpath?.enabledelete && row.maintainStatus == 1 && remove(text, row, _, action), },
], ])
},
])
: defcolumn; : defcolumn;
}, [activeTabKey]); }, [activeTabKey]);
...@@ -556,6 +556,7 @@ function Plan(props) { ...@@ -556,6 +556,7 @@ function Plan(props) {
// access: 'sysDepartment_save', // access: 'sysDepartment_save',
btn: { btn: {
disabled: false, disabled: false,
type: 'primary',
onClick: () => { onClick: () => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
...@@ -579,8 +580,8 @@ function Plan(props) { ...@@ -579,8 +580,8 @@ function Plan(props) {
drawer?.val == 'detailaddon' drawer?.val == 'detailaddon'
? editDateColumns ? editDateColumns
: drawer?.val == 'detail' : drawer?.val == 'detail'
? detailsColumns ? detailsColumns
: columns : columns
} }
detailpath={pathconfig?.detail || null} detailpath={pathconfig?.detail || null}
// detailData={drawer?.item} // detailData={drawer?.item}
......
...@@ -115,6 +115,13 @@ function getcolumns(setdrawer) { ...@@ -115,6 +115,13 @@ function getcolumns(setdrawer) {
title: '保养人员', title: '保养人员',
dataIndex: 'maintainUserName', dataIndex: 'maintainUserName',
key: 'maintainUserName', key: 'maintainUserName',
valueType: 'select',
fieldProps: {
showSearch: true,
},
options: {
path: '/auth/sysUser/selection',
},
}, },
{ {
title: '状态', title: '状态',
...@@ -266,6 +273,13 @@ function getcolumns(setdrawer) { ...@@ -266,6 +273,13 @@ function getcolumns(setdrawer) {
title: '保养人员', title: '保养人员',
dataIndex: 'maintainUserName', dataIndex: 'maintainUserName',
key: 'maintainUserName', key: 'maintainUserName',
valueType: 'select',
fieldProps: {
showSearch: true,
},
options: {
path: '/auth/sysUser/selection',
},
}, },
{ {
title: '状态', title: '状态',
...@@ -423,6 +437,13 @@ function getcolumns(setdrawer) { ...@@ -423,6 +437,13 @@ function getcolumns(setdrawer) {
title: '保养人员', title: '保养人员',
dataIndex: 'maintainUserName', dataIndex: 'maintainUserName',
key: 'maintainUserName', key: 'maintainUserName',
valueType: 'select',
fieldProps: {
showSearch: true,
},
options: {
path: '/auth/sysUser/selection',
},
}, },
{ {
title: '状态', title: '状态',
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03 * @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-06 14:21:36 * @Last Modified time: 2023-01-18 17:46:04
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -494,6 +494,7 @@ function Failure(props) { ...@@ -494,6 +494,7 @@ function Failure(props) {
url={'/repair/umOtherUnitsOrder/save'} url={'/repair/umOtherUnitsOrder/save'}
setdrawer={setdrawer} setdrawer={setdrawer}
actionRef={actionRef} actionRef={actionRef}
drawer={drawer}
/> />
); );
case 'comouts': case 'comouts':
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-12-05 11:13:26 * @Date: 2022-12-05 11:13:26
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-06 16:28:51 * @Last Modified time: 2023-01-18 17:39:50
*/ */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
...@@ -71,16 +71,18 @@ const App = ({ type, id, actionRef, url, setdrawer }) => { ...@@ -71,16 +71,18 @@ const App = ({ type, id, actionRef, url, setdrawer }) => {
const finishHandle = { const finishHandle = {
wxjd: async (vals) => { wxjd: async (vals) => {
//console.log(vals); //console.log(vals);
vals.repairAssistList = vals?.repairAssistList.map((it) => ({ let params = {};
assistUserId: it, if (vals.repairAssistList) {
})); vals.repairAssistList = vals?.repairAssistList.map((it) => ({
let params = { assistUserId: it,
...vals, }));
id, }
};
let res = await doFetch({ let res = await doFetch({
url, url,
params, params: {
...params,
id,
},
}); });
if (res.code === '0000') { if (res.code === '0000') {
message.success('操作成功!'); message.success('操作成功!');
...@@ -92,19 +94,20 @@ const App = ({ type, id, actionRef, url, setdrawer }) => { ...@@ -92,19 +94,20 @@ const App = ({ type, id, actionRef, url, setdrawer }) => {
} }
}, },
wxpd: async (vals) => { wxpd: async (vals) => {
//console.log(vals); console.log(vals, url);
vals.repairAssistList = vals?.repairAssistList.map((it) => { let params = {};
return { console.log(params);
assistUserId: it, if (vals.repairAssistList) {
}; params.repairAssistList = vals?.repairAssistList.map((it) => {
}); return {
let params = { assistUserId: it,
...vals, };
id, });
}; }
console.log(params);
let res = await doFetch({ let res = await doFetch({
url, url,
params, params: { ...params, id },
}); });
if (res.code === '0000') { if (res.code === '0000') {
message.success('操作成功!'); message.success('操作成功!');
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03 * @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-06 16:09:52 * @Last Modified time: 2023-01-18 17:45:01
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -602,7 +602,12 @@ function Failure(props) { ...@@ -602,7 +602,12 @@ function Failure(props) {
switch (type) { switch (type) {
case 'add': case 'add':
return ( return (
<Addform url={'/repair/umTrackOrder/save'} setdrawer={setdrawer} actionRef={actionRef} /> <Addform
url={'/repair/umTrackOrder/save'}
setdrawer={setdrawer}
actionRef={actionRef}
drawer={drawer}
/>
); );
case 'track': case 'track':
return <TrackForm />; return <TrackForm />;
......
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