Commit 12d2fab9 authored by TZW's avatar TZW

12071017

parent fb99850b
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-29 14:03:07
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-01 11:06:20
* @Last Modified time: 2022-12-07 10:11:53
*/
import { doFetch } from '@/utils/doFetch';
......@@ -84,8 +84,8 @@ const App = ({ setDrawer, onFinish, drawer, actionRef, columns, urlParams, formI
<>
<InitForm
extendField={selectextendField(formId)}
detailpath={urlParams.detail}
params={{ id: drawer?.item?.id }}
detailpath={urlParams?.detail || null}
params={{ id: drawer?.item?.id || null }}
fields={fieldscolumns}
onFinish={onFinish}
/>
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-06 20:03:01
* @Last Modified time: 2022-12-07 10:00:30
*/
import * as React from 'react';
......@@ -62,14 +62,62 @@ function Failure(props) {
);
};
// 完成外协
const CompleteOuts = () => {
// 重新指派
const Reassig = () => {
return (
<>
<InitForm
fields={[
{
title: '外协单位',
title: '最新追踪人员',
dataIndex: 'causeFailure',
valueType: 'textarea',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
key: 'causeFailure',
},
{
title: '追踪人员',
dataIndex: 'trackAssistList',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
key: 'trackAssistList',
valueType: 'select',
options: {
path: '/repair/umTrackOrder/selectionAgain',
params: { id: drawer?.item.id },
},
},
]}
onFinish={async (vals) => {
let params = {
trackAssistList: vals,
id: drawer?.item?.id,
};
let res = await doFetch({
url: '/repair/umTrackTraceinfo/queryByTrackOrderId',
params,
});
if (res.code === '0000') {
message.success('重新追踪成功!');
setdrawer((s) => ({
...s,
open: false,
}));
actionRef.current.reload();
}
}}
/>
</>
);
};
// 追踪
const TrackForm = () => {
return (
<>
<InitForm
fields={[
{
title: '计划追踪日期',
dataIndex: 'otherUnitsId',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
key: 'otherUnitsId',
......@@ -80,34 +128,50 @@ function Failure(props) {
},
},
{
title: '故障原因',
dataIndex: 'causeFailure',
valueType: 'textarea',
title: '追踪结果',
dataIndex: 'trackResult',
valueType: 'radio',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
key: 'causeFailure',
options: [
{
value: '1',
label: '正常',
},
{
value: '2',
label: '异常',
},
],
colProps: { span: 24 },
key: 'trackResult',
},
{
title: '维修内容',
dataIndex: 'repairContent',
valueType: 'textarea',
title: '是否完成追踪',
dataIndex: 'isFinishTrack',
valueType: 'radio',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
key: 'repairContent',
},
{
title: '外协时长',
dataIndex: 'otherUnitsHours',
key: 'otherUnitsHours',
// valueType: 'number',
colProps: { span: 24 },
key: 'isFinishTrack',
options: [
{
value: '1',
label: '是',
},
{
value: '2',
label: '否',
},
],
},
{
title: '外协费用',
dataIndex: 'otherUnitsCost',
key: 'otherUnitsCost',
title: '追踪周期',
dataIndex: 'trackCycle',
key: 'trackCycle',
},
{
title: '备注',
dataIndex: 'remark',
key: 'remark',
title: '追踪内容',
dataIndex: 'trackContents',
key: 'trackContents',
valueType: 'textarea',
},
]}
......@@ -134,29 +198,82 @@ function Failure(props) {
);
};
// 重新指派
const Reassig = () => {
// 验证
const CheckForm = () => {
return (
<>
<InitForm
fields={[
{
title: '最新外协人员',
dataIndex: 'causeFailure',
title: '追踪人员',
dataIndex: 'trackerName',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
key: 'trackerName',
fieldProps: {
placeholder: '请选择',
disabled: true,
},
},
{
title: '计划追踪日期',
dataIndex: 'planTrackTime',
key: 'planTrackTime',
fieldProps: {
placeholder: '请选择',
disabled: true,
},
},
{
title: '实际追踪日期',
dataIndex: 'actualTrackTime',
fieldProps: {
placeholder: '请选择',
disabled: true,
},
key: 'actualTrackTime',
},
{
title: '追踪结果',
dataIndex: 'trackResults',
fieldProps: {
placeholder: '请选择',
disabled: true,
},
key: 'trackResults',
},
{
title: '追踪内容',
dataIndex: 'trackContents',
valueType: 'textarea',
key: 'trackContents',
fieldProps: {
placeholder: '请选择',
disabled: true,
},
},
{
title: '验证结果',
dataIndex: 'reviewerResult',
valueType: 'radio',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
key: 'causeFailure',
options: [
{
value: 1,
label: '通过',
},
{
value: 2,
label: '不通过',
},
],
key: 'reviewerResult',
},
{
title: '外协人员',
dataIndex: 'otherUnitsAssistList',
title: '备注',
dataIndex: 'causeFailure',
valueType: 'textarea',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
key: 'otherUnitsAssistList',
valueType: 'select',
options: {
path: '/repair/umOtherUnitsOrder/selectionAgain',
params: { otherUnitsOrderId: drawer?.item.id },
},
key: 'causeFailure',
},
]}
onFinish={async (vals) => {
......@@ -265,20 +382,43 @@ function Failure(props) {
setdrawer((s) => ({
...s,
open: true,
type: 'comouts',
type: 'track',
item: {
id: row.id,
},
val: 'only',
title: '完成外协',
title: '追踪信息',
}));
}}
>
完成外协
追踪
</a>
),
key: '1',
},
{
label: (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
// item: {
// id: row.id,
// },
val: 'only',
title: '验证',
detailpath: '/repair/umTrackTraceinfo/queryByTrackOrderId',
params: { trackOrderId: row?.id },
type: 'check',
}));
}}
>
验证
</a>
),
key: '2',
},
]}
/>
);
......@@ -295,7 +435,7 @@ function Failure(props) {
};
// 未完成按钮
const unfinishBtn = (text, row, _, action) => {
if (row?.status == 1) {
if (row?.status == 1 || row?.status == 2) {
return (
<PremButton
pop={{
......@@ -314,7 +454,7 @@ function Failure(props) {
删除
</PremButton>
);
} else if (row?.status == 2) {
} else if (row?.status == 3) {
return (
<PremButton
onClick={() => {
......@@ -372,8 +512,10 @@ function Failure(props) {
switch (type) {
case 'add':
return <Addform />;
case 'comouts':
return <CompleteOuts />;
case 'track':
return <TrackForm />;
case 'check':
return <CheckForm />;
case 'Reassig':
return <Reassig />;
default:
......
......@@ -385,6 +385,7 @@ function getcolumns(setdrawer) {
hideInTable: true,
dataIndex: 'statusName',
key: 'status',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'radio',
options: [
{
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-01 15:10:22
* @Last Modified time: 2022-12-07 10:15:25
*/
import * as React from 'react';
......@@ -63,41 +63,41 @@ function User(props) {
...s,
visible: true,
item: row,
type: 'add',
type: 'edit',
title: '编辑',
val: 'only',
onFinish: async (vals) => {
let userCharReqList = [];
console.log('id:', row.id);
for (let i in vals) {
if (!isNaN(Number(i))) {
userCharReqList.push({
fieldId: i,
fieldRealValue: vals[i],
});
delete vals[i];
}
}
let params = {
...vals,
id: row?.id,
shopIdList: vals.shopId,
userCharReqList,
};
delete params.shopId;
let res = await doFetch({
url: urlParams.save,
params,
});
if (res.code === '0000') {
message.success('编辑成功!');
setDrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
},
// onFinish: async (vals) => {
// let userCharReqList = [];
// console.log('id:', row.id);
// for (let i in vals) {
// if (!isNaN(Number(i))) {
// userCharReqList.push({
// fieldId: i,
// fieldRealValue: vals[i],
// });
// delete vals[i];
// }
// }
// let params = {
// ...vals,
// id: row?.id,
// shopIdList: vals.shopId,
// userCharReqList,
// };
// delete params.shopId;
// let res = await doFetch({
// url: urlParams.save,
// params,
// });
// if (res.code === '0000') {
// message.success('编辑成功!');
// setDrawer((s) => ({
// ...s,
// visible: false,
// }));
// actionRef.current.reload();
// }
// },
}));
},
}}
......@@ -146,6 +146,108 @@ function User(props) {
});
}, []);
function selectType(type) {
switch (type) {
case 'add':
return (
<ExtendField
setDrawer={setDrawer}
drawer={drawer}
actionRef={actionRef}
columns={columns}
formId={'1'}
// urlParams={urlParams}
onFinish={async (vals) => {
let userCharReqList = [];
for (let i in vals) {
if (!isNaN(Number(i))) {
userCharReqList.push({
fieldId: i,
fieldRealValue: vals[i],
});
delete vals[i];
}
}
let params = {
...vals,
id: drawer?.title == '编辑' ? drawer?.item?.id : '',
userCharReqList,
};
delete params.shopId;
console.log(params, '!!!!');
let res = await doFetch({
url: urlParams.save,
params,
});
if (res.code === '0000') {
if (drawer?.title == '编辑') {
message.success('编辑成功!');
} else {
message.success('新增成功!');
}
setDrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
}}
/>
);
case 'edit':
return (
<ExtendField
setDrawer={setDrawer}
drawer={drawer}
actionRef={actionRef}
columns={columns}
formId={'1'}
urlParams={urlParams}
onFinish={async (vals) => {
let userCharReqList = [];
for (let i in vals) {
if (!isNaN(Number(i))) {
userCharReqList.push({
fieldId: i,
fieldRealValue: vals[i],
});
delete vals[i];
}
}
let params = {
...vals,
id: drawer?.title == '编辑' ? drawer?.item?.id : '',
userCharReqList,
};
delete params.shopId;
console.log(params, '!!!!');
let res = await doFetch({
url: urlParams.save,
params,
});
if (res.code === '0000') {
if (drawer?.title == '编辑') {
message.success('编辑成功!');
} else {
message.success('新增成功!');
}
setDrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
}}
/>
);
break;
default:
return null;
}
}
return (
<div style={{ position: 'relative' }}>
<AutoTable
......@@ -193,51 +295,7 @@ function User(props) {
}}
{...drawer}
>
{drawer?.type == 'add' ? (
<ExtendField
setDrawer={setDrawer}
drawer={drawer}
actionRef={actionRef}
columns={columns}
formId={'1'}
urlParams={urlParams}
onFinish={async (vals) => {
let userCharReqList = [];
for (let i in vals) {
if (!isNaN(Number(i))) {
userCharReqList.push({
fieldId: i,
fieldRealValue: vals[i],
});
delete vals[i];
}
}
let params = {
...vals,
id: drawer?.title == '编辑' ? drawer?.item?.id : '',
userCharReqList,
};
delete params.shopId;
console.log(params, '!!!!');
let res = await doFetch({
url: urlParams.save,
params,
});
if (res.code === '0000') {
if (drawer?.title == '编辑') {
message.success('编辑成功!');
} else {
message.success('新增成功!');
}
setDrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
}}
/>
) : null}
{selectType(drawer?.type)}
</DrawerPro>
</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