Commit 1f03b585 authored by TZW's avatar TZW

000

parent b077a8ab
...@@ -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-08 19:39:12 * @Last Modified time: 2022-12-09 09:48:49
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -13,7 +13,7 @@ import PremButton from '@/components/PremButton'; ...@@ -13,7 +13,7 @@ import PremButton from '@/components/PremButton';
import getcolumns from './columns'; import getcolumns from './columns';
import { useRequest } from 'ahooks'; import { useRequest } from 'ahooks';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
import { Dropdown, Menu, Button } from 'antd'; import { Dropdown, Menu, Button, message } from 'antd';
import InitForm from '@/components/InitForm'; import InitForm from '@/components/InitForm';
function Failure(props) { function Failure(props) {
...@@ -190,19 +190,87 @@ function Failure(props) { ...@@ -190,19 +190,87 @@ function Failure(props) {
key: '2', key: '2',
}, },
{ {
label: <a>转外协</a>, label: (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
type: 'zwx',
item: {
id: row.id,
},
val: 'only',
title: '转外协',
}));
}}
>
转外协
</a>
),
key: '3', key: '3',
}, },
{ {
label: <a>转单</a>, label: (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
type: 'zd',
item: {
id: row.id,
},
val: 'only',
title: '转单',
}));
}}
>
转单
</a>
),
key: '4', key: '4',
}, },
{ {
label: <a>退单</a>, label: (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
type: 'td',
item: {
id: row.id,
},
val: 'only',
title: '退单',
}));
}}
>
退单
</a>
),
key: '5', key: '5',
}, },
{ {
label: <a>效果验证</a>, label: (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
type: 'xgyz',
item: {
id: row.id,
},
val: 'only',
title: '效果验证',
}));
}}
>
效果验证
</a>
),
key: '6', key: '6',
}, },
{ {
...@@ -365,14 +433,14 @@ function Failure(props) { ...@@ -365,14 +433,14 @@ function Failure(props) {
repairContent: vals.repairContent, repairContent: vals.repairContent,
}, },
id: row.id, id: drawer?.item.id,
}; };
let res = await doFetch({ let res = await doFetch({
url: '/repair/umRepairOrder/completeRepair', url: '/repair/umRepairOrder/completeRepair',
params, params,
}); });
if (res.code === '0000') { if (res.code === '0000') {
message.success('新增成功!'); message.success('操作成功!');
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: false, open: false,
...@@ -395,6 +463,7 @@ function Failure(props) { ...@@ -395,6 +463,7 @@ function Failure(props) {
title: '申请追踪原因', title: '申请追踪原因',
dataIndex: 'reason', dataIndex: 'reason',
key: 'reason', key: 'reason',
valueType: 'textarea',
formItemProps: { formItemProps: {
rules: [ rules: [
{ {
...@@ -405,10 +474,31 @@ function Failure(props) { ...@@ -405,10 +474,31 @@ function Failure(props) {
}, },
}, },
]} ]}
onFinish={async (vals) => {
console.log(vals);
let params = {
repairInfo: { ...vals },
id: drawer?.item.id,
};
let res = await doFetch({
url: '/repair/umRepairOrder/transferTracking',
params,
});
if (res.code === '0000') {
message.success('操作成功!');
setdrawer((s) => ({
...s,
open: false,
}));
actionRef.current.reload();
}
}}
{...drawer}
/> />
</> </>
); );
}; };
// 转外协
const Toout = () => { const Toout = () => {
return ( return (
<> <>
...@@ -418,6 +508,7 @@ function Failure(props) { ...@@ -418,6 +508,7 @@ function Failure(props) {
title: '申请外协原因', title: '申请外协原因',
dataIndex: 'reason', dataIndex: 'reason',
key: 'reason', key: 'reason',
valueType: 'textarea',
formItemProps: { formItemProps: {
rules: [ rules: [
{ {
...@@ -428,16 +519,183 @@ function Failure(props) { ...@@ -428,16 +519,183 @@ function Failure(props) {
}, },
}, },
]} ]}
onFinish={async (vals) => {
let params = {
repairInfo: { ...vals },
id: drawer?.item.id,
};
let res = await doFetch({
url: '/repair/umRepairOrder/transferOutsourcing',
params,
});
if (res.code === '0000') {
message.success('操作成功!');
setdrawer((s) => ({
...s,
open: false,
}));
actionRef.current.reload();
}
}}
{...drawer}
/>
</>
);
};
// 转单
const Transfer = () => {
return (
<>
<InitForm
fields={[
{
title: '转单类型',
dataIndex: 'reviewerType',
key: 'reviewerType',
valueType: 'select',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
},
{
title: '转单原因',
dataIndex: 'reason',
key: 'reason',
valueType: 'textarea',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
},
]}
onFinish={async (vals) => {
let params = {
repairInfo: { ...vals },
id: drawer?.item.id,
};
let res = await doFetch({
url: '/repair/umRepairOrder/documentTransfer',
params,
});
if (res.code === '0000') {
message.success('操作成功!');
setdrawer((s) => ({
...s,
open: false,
}));
actionRef.current.reload();
}
}}
{...drawer}
/>
</>
);
};
// 退单
const Singelback = () => {
return (
<>
<InitForm
fields={[
{
title: '退单原因',
dataIndex: 'reason',
key: 'reason',
valueType: 'textarea',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
},
]}
onFinish={async (vals) => {
let params = {
repairInfo: { ...vals },
id: drawer?.item.id,
};
let res = await doFetch({
url: '/repair/umRepairOrder/chargeback',
params,
});
if (res.code === '0000') {
message.success('操作成功!');
setdrawer((s) => ({
...s,
open: false,
}));
actionRef.current.reload();
}
}}
{...drawer}
/>
</>
);
};
// 效果验证
const EffectCheck = () => {
return (
<>
<InitForm
fields={[
{
title: '退单原因',
dataIndex: 'reason',
key: 'reason',
valueType: 'textarea',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
},
]}
onFinish={async (vals) => {
let params = {
repairInfo: { ...vals },
id: drawer?.item.id,
};
let res = await doFetch({
url: '/repair/umRepairOrder/chargeback',
params,
});
if (res.code === '0000') {
message.success('操作成功!');
setdrawer((s) => ({
...s,
open: false,
}));
actionRef.current.reload();
}
}}
{...drawer}
/> />
</> </>
); );
}; };
const selectType = { const selectType = {
jd: <Recevive />, jd: <Recevive />,
wcwx: <Finishrepair />, wcwx: <Finishrepair />,
zzz: <Toracking />, zzz: <Toracking />,
zzzong: <Toout />, zwx: <Toout />,
zd: <Transfer />,
td: <Singelback />,
xgyz: <EffectCheck />,
}; };
const columns = useMemo(() => { const columns = useMemo(() => {
......
...@@ -316,7 +316,7 @@ function getcolumns(setdrawer) { ...@@ -316,7 +316,7 @@ function getcolumns(setdrawer) {
}, },
}, },
key: 'shopIdList', key: 'shopIdList',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, formItemProps: { rules: [{ required: false, message: '此项为必填项' }] },
}, },
{ {
title: '负责工段', title: '负责工段',
......
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