Commit 12d2fab9 authored by TZW's avatar TZW

12071017

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