Commit 88ce3d55 authored by TZW's avatar TZW

1121

parent 1f33056e
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-10 09:39:56
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-18 17:29:28
* @Last Modified time: 2022-11-21 17:38:29
*/
import * as React from 'react';
......@@ -38,6 +38,10 @@ function Model(props) {
save: '/asset/equipmentChildren/save',
};
const urlParams_resume = {
save: '/asset/equipmentLog/save',
};
const detail = (text, row, _, action) => {
return (
<PremButton
......@@ -511,12 +515,264 @@ function Model(props) {
const fields = {
1: [
{
title: '设备',
dataIndex: 'equipmentId',
key: 'equipment',
title: '改造日期',
dataIndex: 'reformDate',
key: 'reformDate',
valueType: 'date',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '改造承包商',
dataIndex: 'supplierId',
key: 'supplierId',
valueType: 'select',
options: {
path: '/asset/equipmentSupplier/query/selection',
params: {},
},
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
},
{
title: '改造内容',
dataIndex: 'reformContent',
key: 'reformContent',
valueType: 'textarea',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '上传文件',
key: 'urlIds ',
valueType: 'uploadDragger',
// colProps: { span: 24 },
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
},
],
2: [
{
title: '报废日期',
dataIndex: 'scrapDate',
key: 'scrapDate',
valueType: 'date',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '报废原因',
dataIndex: 'scrapReason',
key: 'scrapReason',
valueType: 'textarea',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '上传文件',
key: 'urlIds ',
valueType: 'uploadDragger',
// colProps: { span: 24 },
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
},
],
3: [
{
title: '调入公司',
dataIndex: 'organizationName',
key: 'toOrganizationId',
valueType: 'select',
options: { path: '/auth/sysDepartment/query/organization/selectbox', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '调入部门',
valueType: 'select',
dataIndex: 'departmentName',
key: 'toDepartmentId',
options: {
path: '/auth/sysDepartment/query/depart/selectbox',
linkParams: {
toOrganizationId: 'parentId',
},
},
},
{
title: '调入工厂',
dataIndex: 'factoryName',
key: 'toFactoryId',
valueType: 'select',
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '调入车间',
dataIndex: 'shopName',
valueType: 'select',
options: {
path: '/auth/sysShop/getShopSelectionByFactory',
linkParams: {
toFactoryId: 'factoryId',
},
},
key: 'toShopId',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '调入工段',
dataIndex: 'sectionName',
key: 'toSectionId',
valueType: 'select',
options: {
path: '/auth/sysSection/getAllSectionSelectionByShop',
linkParams: {
toShopId: 'shopId',
},
},
},
{
title: '调入产线',
dataIndex: 'productionLines',
valueType: 'select',
key: 'toProductLineId',
options: {
path: '/auth/sysProductionLine/getAllProductLineSelectionByShop',
linkParams: {
toShopId: 'shopId',
},
},
},
{
title: '调入位置号',
dataIndex: 'toPositionNo',
valueType: 'input',
key: 'toPositionNo',
},
{
title: '调拨日期',
dataIndex: 'transferDate',
key: 'transferDate',
valueType: 'date',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '调拨原因',
dataIndex: 'transferReason',
key: 'transferReason',
valueType: 'textarea',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
],
4: [
{
title: '借用公司',
dataIndex: 'organizationName',
key: 'toOrganizationId',
valueType: 'select',
options: { path: '/auth/sysDepartment/query/organization/selectbox', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '借用部门',
valueType: 'select',
dataIndex: 'departmentName',
key: 'toDepartmentId',
options: {
path: '/auth/sysDepartment/query/depart/selectbox',
linkParams: {
toOrganizationId: 'parentId',
},
},
},
{
title: '借用工厂',
dataIndex: 'factoryName',
key: 'toFactoryId',
valueType: 'select',
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '借用车间',
dataIndex: 'shopName',
valueType: 'select',
options: {
path: '/auth/sysShop/getShopSelectionByFactory',
linkParams: {
toFactoryId: 'factoryId',
},
},
key: 'toShopId',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '借用工段',
dataIndex: 'sectionName',
key: 'toSectionId',
valueType: 'select',
options: {
path: '/auth/sysSection/getAllSectionSelectionByShop',
linkParams: {
toShopId: 'shopId',
},
},
},
{
title: '借用产线',
dataIndex: 'productionLines',
valueType: 'select',
key: 'toProductLineId',
options: {
path: '/auth/sysProductionLine/getAllProductLineSelectionByShop',
linkParams: {
toShopId: 'shopId',
},
},
},
{
title: '借用位置号',
dataIndex: 'toPositionNo',
valueType: 'input',
key: 'toPositionNo',
},
{
title: '借用日期',
dataIndex: 'borrowDate',
key: 'borrowDate',
valueType: 'date',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '预计归还日期',
dataIndex: 'planReturnDate',
key: 'planReturnDate',
valueType: 'date',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '借用原因',
dataIndex: 'borrowReason',
key: 'borrowReason',
valueType: 'textarea',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
],
5: [
{
title: '设备1',
dataIndex: 'equipmentId',
......@@ -605,11 +861,106 @@ function Model(props) {
{
label: '改造',
key: 1,
children: <InitForm fields={fields[activeTab]} />,
children: activeTab == 1 && (
<InitForm
fields={fields[activeTab]}
onFinish={async (vals) => {
console.log(vals);
let res = await doFetch({
url: urlParams_resume.save,
params: { ...vals, type: '1', equipmentId: drawer?.item?.id },
});
if (res.code === '0000') {
message.success('登记成功!');
setDrawer((s) => ({
...s,
visible: false,
item: null,
}));
actionRef.current.reload();
}
}}
/>
),
}, // remember to pass the key prop
{
label: 'Tab 2',
label: '报废',
key: 2,
children: activeTab == 2 && (
<InitForm
fields={fields[activeTab]}
onFinish={async (vals) => {
console.log(vals);
let res = await doFetch({
url: urlParams_resume.save,
params: { ...vals, type: '2', equipmentId: drawer?.item?.id },
});
if (res.code === '0000') {
message.success('登记成功!');
setDrawer((s) => ({
...s,
visible: false,
item: null,
}));
actionRef.current.reload();
}
}}
/>
),
},
{
label: '调拨',
key: 3,
children: activeTab == 3 && (
<InitForm
fields={fields[activeTab]}
onFinish={async (vals) => {
console.log(vals);
let res = await doFetch({
url: urlParams_resume.save,
params: { ...vals, type: '3', equipmentId: drawer?.item?.id },
});
if (res.code === '0000') {
message.success('登记成功!');
setDrawer((s) => ({
...s,
visible: false,
item: null,
}));
actionRef.current.reload();
}
}}
/>
),
},
{
label: '借用',
key: 4,
children: activeTab == 4 && (
<InitForm
fields={fields[activeTab]}
onFinish={async (vals) => {
console.log(vals);
let res = await doFetch({
url: urlParams_resume.save,
params: { ...vals, type: '4', equipmentId: drawer?.item?.id },
});
if (res.code === '0000') {
message.success('登记成功!');
setDrawer((s) => ({
...s,
visible: false,
item: null,
}));
actionRef.current.reload();
}
}}
/>
),
},
{
label: '归还',
key: 5,
children: <InitForm fields={fields[activeTab]} />,
},
]}
......
......@@ -14,13 +14,6 @@ function getcolumns(setdrawer) {
},
{ title: '手机号', dataIndex: 'telephone', key: 'telephone' },
{ title: '邮箱', dataIndex: 'mailNo', key: 'mailNo' },
{
title: '公司名称',
dataIndex: 'organizationName',
key: 'organizationId',
valueType: 'select',
options: { path: '/emspro', params: {} },
},
{
title: '公司名称',
align: 'center',
......
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