Commit fee786c5 authored by TZW's avatar TZW

1111

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