Commit cede7f9c authored by TZW's avatar TZW

11141510

parent a25bf5e8
......@@ -14,6 +14,27 @@ function getcolumns(setdrawer) {
],
},
},
{
title: '上级类型',
// dataIndex: 'parentId',
dataIndex: 'parentKey',
key: 'parentKey',
hideInTable: true,
// hideInForm: true,
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
fieldProps: {
placeholder: '请输入',
disabled: true,
},
search: false,
},
{
title: '备注',
dataIndex: 'remark',
......@@ -25,6 +46,7 @@ function getcolumns(setdrawer) {
},
],
},
search: false,
},
];
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-14 13:31:02
* @Last Modified time: 2022-11-14 14:19:53
*/
import * as React from 'react';
......@@ -60,16 +60,21 @@ function Type(props) {
setDrawer((s) => ({
...s,
visible: true,
detailpath: urlParams.detail,
params: { id: drawer?.item?.id },
detailpath: null,
item: {
title: row.title,
remark: row.remark,
},
title: '编辑',
val: 'edit',
onFinish: async (vals) => {
console.log(1);
let params = {
...vals,
id: row.id,
id: row.key,
parentId: row.parentKey,
};
console.log(params);
let res = await doFetch({
url: urlParams.save,
params,
......@@ -84,6 +89,7 @@ function Type(props) {
}
},
}));
console.log(row);
},
}}
>
......@@ -102,21 +108,27 @@ function Type(props) {
...s,
visible: true,
detailpath: null,
// params: { id: drawer?.item?.id },
item: {
parentKey: row.title,
},
title: '新增子级',
val: 'add',
onFinish: async (vals) => {
console.log(1);
let params = {
...vals,
id: row.id,
parentId: row.key,
equipmentTypeName: vals.title,
};
delete params.title;
delete params.parentKey;
console.log(params);
let res = await doFetch({
url: urlParams.save,
params,
});
if (res.code === '0000') {
message.success('编辑成功!');
message.success('新增子级成功!');
setDrawer((s) => ({
...s,
visible: false,
......@@ -125,6 +137,7 @@ function Type(props) {
}
},
}));
console.log(drawer.item);
},
}}
>
......@@ -137,11 +150,11 @@ function Type(props) {
return (
<PremButton
pop={{
title: '是否删除该供应商?',
title: '是否删除该设备类型?',
okText: '确认',
cancelText: '取消',
onConfirm: async () => {
let res = await doFetch({ url: urlParams.remove, params: { id: row.id } });
let res = await doFetch({ url: urlParams.remove, params: { id: row.key } });
if (res.code === '0000') {
message.success('删除成功!');
setDrawer((s) => ({
......@@ -201,8 +214,9 @@ function Type(props) {
let params = {
...vals,
parentId: 0,
equipmentTypeName: vals.
equipmentTypeName: vals.title,
};
delete params.title;
let res = await doFetch({
url: urlParams.save,
params,
......
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