Commit 6b908e96 authored by TZW's avatar TZW

11221527

parent 88ce3d55
......@@ -14,7 +14,7 @@ function getcolumns(setdrawer) {
title: '设备名称',
dataIndex: 'equipmentName',
align: 'center',
width: 120,
width: 220,
key: 'equipmentName',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-10 09:39:56
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-21 17:38:29
* @Last Modified time: 2022-11-22 15:20:40
*/
import * as React from 'react';
......@@ -12,233 +12,1093 @@ import AutoTable from '@/components/AutoTable';
import PremButton from '@/components/PremButton';
import getcolumns from './columns';
import { doFetch } from '@/utils/doFetch';
import { message, Dropdown, Menu, Layout, Button, Space, Divider, Tabs } from 'antd';
import { message, Dropdown, Menu, Layout, Button, Image, Space, Divider, Tabs } from 'antd';
import TreeRender from '@/components/TreeRender';
import { ProDescriptions } from '@ant-design/pro-components';
import InitForm from '@/components/InitForm';
const { Sider, Content } = Layout;
function Model(props) {
const actionRef = useRef(),
formRef = useRef();
const [drawer, setDrawer] = useState({
formRef = useRef(),
[drawer, setDrawer] = useState({
visible: false,
}),
[currDrawer, setCurrDrawer] = useState({
visible: false,
}),
currfields = {
1: [
{
title: '操作人',
dataIndex: 'updateUserName',
key: 'updateUserName',
},
{
title: '操作时间',
dataIndex: 'updateTime',
key: 'updateTime',
},
{
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: '上传文件(上限为5个)',
key: 'urlIds ',
valueType: 'uploadDragger',
// colProps: { span: 24 },
fieldProps: {
limit: 5,
},
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
render: (text, row) => {
return row?.urlIds?.map((it) => {
<Image width={70} src={it.url} />;
});
const urlParams = {
},
},
],
2: [
{
title: '操作人',
dataIndex: 'updateUserName',
key: 'updateUserName',
},
{
title: '操作时间',
dataIndex: 'updateTime',
key: 'updateTime',
},
{
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: '此项为必填项',
},
],
},
fieldProps: {
limit: 5,
},
render: (text, row) => {
return row?.urlIds.map((it) => {
<Image width={70} src={it.url} />;
});
},
},
],
3: [
{
title: '操作人',
dataIndex: 'updateUserName',
key: 'updateUserName',
},
{
title: '操作时间',
dataIndex: 'updateTime',
key: 'updateTime',
},
{
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: 'updateUserName',
key: 'updateUserName',
},
{
title: '操作时间',
dataIndex: 'updateTime',
key: 'updateTime',
},
{
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: '操作人',
dataIndex: 'updateUserName',
key: 'updateUserName',
},
{
title: '操作时间',
dataIndex: 'updateTime',
key: 'updateTime',
},
{
title: '接收公司',
dataIndex: 'returnOrganizationId',
key: 'returnOrganizationId',
valueType: 'select',
options: { path: '/auth/sysDepartment/query/organization/selectbox', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '接收部门',
valueType: 'select',
dataIndex: 'returnDepartmentId',
key: 'returnDepartmentId',
options: {
path: '/auth/sysDepartment/query/depart/selectbox',
linkParams: {
returnOrganizationId: 'parentId',
},
},
},
{
title: '接收工厂',
dataIndex: 'returnFactoryId',
key: 'returnFactoryId',
valueType: 'select',
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '接收车间',
dataIndex: 'returnShopId',
valueType: 'select',
options: {
path: '/auth/sysShop/getShopSelectionByFactory',
linkParams: {
returnFactoryId: 'factoryId',
},
},
key: 'returnShopId',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '接收工段',
dataIndex: 'returnSectionId',
key: 'returnSectionId',
valueType: 'select',
options: {
path: '/auth/sysSection/getAllSectionSelectionByShop',
linkParams: {
returnShopId: 'shopId',
},
},
},
{
title: '接收产线',
dataIndex: 'returnProductLineId',
valueType: 'select',
key: 'returnProductLineId',
options: {
path: '/auth/sysProductionLine/getAllProductLineSelectionByShop',
linkParams: {
returnShopId: 'shopId',
},
},
},
{
title: '接收位置号',
dataIndex: 'returnPositionNo',
valueType: 'input',
key: 'returnPositionNo',
},
{
title: '实际归还日期',
dataIndex: 'realReturnDate',
key: 'realReturnDate',
valueType: 'date',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '备注',
dataIndex: 'remark',
key: 'remark',
valueType: 'textarea',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
],
},
urlParams = {
save: '/asset/equipment/save',
remove: '/asset/equipment/deleteById',
list: '/asset/equipment/queryList',
detail: '/asset/equipment/detail',
},
urlParams_childEquipment = {
list: '/asset/equipment/children/queryList',
checked: '/asset/equipment/children/selected/queryList',
save: '/asset/equipmentChildren/save',
},
urlParams_resume = {
save: '/asset/equipmentLog/save',
list: '/asset/equipmentLog/queryEquipmentLogPage',
detail: '/asset/equipmentLog/query/resumeDetail',
},
urlParams_correlation = {
zsb: '/asset/equipment/detail/children/page',
fsb: '/asset/equipment/detail/parent/page',
};
const edit = (text, row, _, action) => {
return (
<PremButton
btn={{
size: 'small',
onClick: () => {
setDrawer((s) => ({
...s,
visible: true,
title: '编辑',
val: 'edit',
detailpath: urlParams.detail,
params: { id: row.id },
onFinish: async (vals) => {
console.log(1);
let params = {
...vals,
id: row.id,
};
let res = await doFetch({
url: urlParams.save,
params,
});
if (res.code === '0000') {
message.success('新增成功!');
setDrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
},
}));
},
}}
>
编辑
</PremButton>
);
};
const remove = (text, row, _, action) => {
return (
<PremButton
pop={{
title: '是否删除该设备?',
okText: '确认',
cancelText: '取消',
onConfirm: async () => {
let res = await doFetch({ url: urlParams.remove, params: { id: row.id } });
if (res.code === '0000') {
message.success('删除成功!');
setDrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
},
}}
btn={{
size: 'small',
type: 'danger',
}}
>
删除
</PremButton>
);
};
const more = (text, row, _, action) => {
const menu = (
<Menu
items={[
{
label: (
<a
onClick={() => {
setDrawer((s) => ({
...s,
visible: true,
type: 'editChildEquipment',
item: {
id: row.id,
},
val: 'only',
title: '编辑子设备',
// onFinish: async (vals) => {
// console.log(1);
// let params = {
// ...vals,
// id: row.id,
// };
// let res = await doFetch({
// url: urlParams.save,
// params,
// });
// if (res.code === '0000') {
// message.success('新增成功!');
// setDrawer((s) => ({
// ...s,
// visible: false,
// }));
// actionRef.current.reload();
// }
// },
}));
}}
>
编辑子设备
</a>
),
key: '0',
},
{
label: (
<a
onClick={() => {
setDrawer((s) => ({
...s,
visible: true,
type: 'resume',
item: {
id: row.id,
},
val: 'only',
title: '履历登记',
// onFinish: async (vals) => {
// console.log(1);
// let params = {
// ...vals,
// id: row.id,
// };
// let res = await doFetch({
// url: urlParams.save,
// params,
// });
// if (res.code === '0000') {
// message.success('新增成功!');
// setDrawer((s) => ({
// ...s,
// visible: false,
// }));
// actionRef.current.reload();
// }
// },
}));
}}
>
履历登记
</a>
),
key: '1',
},
{
label: <a>关联备件(暂缓)</a>,
key: '2',
},
{
label: <a>寿命件台账(暂缓)</a>,
key: '3',
},
]}
/>
);
return (
<Dropdown
overlay={menu}
trigger={['click']}
arrow={true}
getPopupContainer={() => document.getElementsByClassName('ant-table-content')[0]}
>
<Button size="small">更多</Button>
</Dropdown>
);
};
const urlParams_childEquipment = {
list: '/asset/equipment/children/queryList',
checked: '/asset/equipment/children/selected/queryList',
save: '/asset/equipmentChildren/save',
//设备详情
const Detail = () => {
const [activeTab, setactiveTab] = useState(1);
// 基础信息
const BaseInfo = () => {
return (
<>
<ProDescriptions
request={async () => {
const { data } = await doFetch({
url: urlParams.detail,
params: { id: drawer?.item?.id },
});
return {
success: true,
data: data?.data,
};
const urlParams_resume = {
save: '/asset/equipmentLog/save',
}}
columns={[
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
},
{
title: '位置号',
dataIndex: 'positionNo',
key: 'positionNo',
},
{
title: '设备类型',
dataIndex: 'equipmentTypeName',
key: 'equipmentTypeId',
},
{
title: '状态',
dataIndex: 'statusName',
key: 'statusName',
span: 2,
},
{
title: '公司名称',
dataIndex: 'organizationName',
key: 'organizationId',
},
{
title: '部门名称',
dataIndex: 'departmentName',
key: 'departmentId',
},
{
title: '工厂名称',
dataIndex: 'factoryName',
key: 'factoryId',
},
{
title: '车间名称',
dataIndex: 'shopName',
key: 'shopId',
},
{
title: '工段名称',
dataIndex: 'sectionName',
key: 'sectionId',
},
{
title: '产线名称',
dataIndex: 'productLineName',
key: 'productLineName',
},
{
title: '供应商',
dataIndex: 'supplierName',
key: 'supplierId',
},
{
title: '设备原值',
dataIndex: 'equipmentWorth',
key: 'equipmentWorth',
},
{
title: '安装投产日期',
dataIndex: 'productDate',
key: 'productDate',
},
{
title: '图片',
dataIndex: 'pictureUrl',
key: 'pictureUrl',
render: (text, row) => <Image width={70} src={row.pictureUrl} />,
},
{
title: '二维码',
dataIndex: 'qrCodeUrl',
key: 'qrCodeUrl',
render: (text, row) => <Image width={70} src={row.qrCodeUrl} />,
},
]}
/>
<Divider />
<h3 className="page-title">扩展字段</h3>
</>
);
};
const detail = (text, row, _, action) => {
// 相关设备
const Correlation = () => {
return (
<PremButton
btn={{
size: 'small',
type: 'link',
onClick: () => {
setDrawer((s) => ({
...s,
visible: true,
item: row,
title: '详情',
val: 'detail',
title: row.userName + '的详细信息',
}));
<>
<AutoTable
pagetitle="子设备"
columns={[
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
align: 'center',
width: 120,
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '设备名称',
dataIndex: 'equipmentName',
align: 'center',
width: 120,
key: 'equipmentName',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '公司名称',
align: 'center',
dataIndex: 'organizationName',
width: 120,
key: 'organizationId',
valueType: 'select',
options: { path: '/auth/sysDepartment/query/organization/selectbox', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '部门名称',
width: 120,
align: 'center',
valueType: 'select',
dataIndex: 'departmentName',
key: 'departmentId',
options: {
path: '/auth/sysDepartment/query/depart/selectbox',
linkParams: {
organizationId: 'parentId',
},
},
},
{
title: '工厂名称',
dataIndex: 'factoryName',
key: 'factoryId',
width: 120,
align: 'center',
valueType: 'select',
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '车间名称',
dataIndex: 'shopName',
align: 'center',
width: 120,
valueType: 'select',
options: {
path: '/auth/sysShop/getShopSelectionByFactory',
linkParams: {
factoryId: '',
},
},
key: 'shopId',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '工段名称',
width: 120,
dataIndex: 'sectionName',
align: 'center',
key: 'sectionId',
valueType: 'select',
options: {
path: '/auth/sysSection/getAllSectionSelectionByShop',
linkParams: {
shopId: '',
},
},
},
{
title: '产线名称',
width: 120,
dataIndex: 'productLineName',
valueType: 'select',
key: 'productLineName',
align: 'center',
options: {
path: 'auth/sysProductionLine/getAllProductLineSelectionByShop',
linkParams: {
shopId: '',
},
}}
>
详情
</PremButton>
},
},
]}
path={urlParams_correlation.zsb}
params={{ id: drawer?.item?.id }}
resizeable={false}
/>
<Divider />
<AutoTable
pagetitle="父设备"
columns={[
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
align: 'center',
width: 120,
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '设备名称',
dataIndex: 'equipmentName',
align: 'center',
width: 120,
key: 'equipmentName',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '公司名称',
align: 'center',
dataIndex: 'organizationName',
width: 120,
key: 'organizationId',
valueType: 'select',
options: { path: '/auth/sysDepartment/query/organization/selectbox', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '部门名称',
width: 120,
align: 'center',
valueType: 'select',
dataIndex: 'departmentName',
key: 'departmentId',
options: {
path: '/auth/sysDepartment/query/depart/selectbox',
linkParams: {
organizationId: 'parentId',
},
},
},
{
title: '工厂名称',
dataIndex: 'factoryName',
key: 'factoryId',
width: 120,
align: 'center',
valueType: 'select',
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '车间名称',
dataIndex: 'shopName',
align: 'center',
width: 120,
valueType: 'select',
options: {
path: '/auth/sysShop/getShopSelectionByFactory',
linkParams: {
factoryId: '',
},
},
key: 'shopId',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '工段名称',
width: 120,
dataIndex: 'sectionName',
align: 'center',
key: 'sectionId',
valueType: 'select',
options: {
path: '/auth/sysSection/getAllSectionSelectionByShop',
linkParams: {
shopId: '',
},
},
},
{
title: '产线名称',
width: 120,
dataIndex: 'productLineName',
valueType: 'select',
key: 'productLineName',
align: 'center',
options: {
path: 'auth/sysProductionLine/getAllProductLineSelectionByShop',
linkParams: {
shopId: '',
},
},
},
]}
path={urlParams_correlation.fsb}
params={{ id: drawer?.item?.id }}
resizeable={false}
/>
</>
);
};
const edit = (text, row, _, action) => {
//履历查询
const Curritae = () => {
return (
<PremButton
btn={{
size: 'small',
onClick: () => {
setDrawer((s) => ({
...s,
visible: true,
title: '编辑',
val: 'edit',
detailpath: urlParams.detail,
params: { id: row.id },
onFinish: async (vals) => {
console.log(1);
let params = {
...vals,
id: row.id,
};
let res = await doFetch({
url: urlParams.save,
params,
<>
<ProDescriptions
title="设备信息"
request={async () => {
const { data } = await doFetch({
url: urlParams.detail,
params: { id: drawer?.item?.id },
});
if (res.code === '0000') {
message.success('新增成功!');
setDrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
return {
success: true,
data: data?.data,
};
}}
columns={[
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
},
}));
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
},
}}
>
编辑
</PremButton>
);
};
const remove = (text, row, _, action) => {
return (
<PremButton
pop={{
title: '是否删除该设备?',
okText: '确认',
cancelText: '取消',
onConfirm: async () => {
let res = await doFetch({ url: urlParams.remove, params: { id: row.id } });
if (res.code === '0000') {
message.success('删除成功!');
setDrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
{
title: '位置号',
dataIndex: 'positionNo',
key: 'positionNo',
},
}}
btn={{
size: 'small',
type: 'danger',
}}
>
删除
</PremButton>
);
};
const more = (text, row, _, action) => {
const menu = (
<Menu
items={[
{
label: (
<a
onClick={() => {
setDrawer((s) => ({
...s,
visible: true,
type: 'editChildEquipment',
item: {
id: row.id,
title: '公司名称',
dataIndex: 'organizationName',
key: 'organizationId',
},
val: 'only',
title: '编辑子设备',
// onFinish: async (vals) => {
// console.log(1);
// let params = {
// ...vals,
// id: row.id,
// };
// let res = await doFetch({
// url: urlParams.save,
// params,
// });
// if (res.code === '0000') {
// message.success('新增成功!');
// setDrawer((s) => ({
// ...s,
// visible: false,
// }));
// actionRef.current.reload();
// }
// },
}));
}}
>
编辑子设备
</a>
),
key: '0',
{
title: '部门名称',
dataIndex: 'departmentName',
key: 'departmentId',
},
{
title: '工厂名称',
dataIndex: 'factoryName',
key: 'factoryId',
},
{
label: (
title: '车间名称',
dataIndex: 'shopName',
key: 'shopId',
},
{
title: '工段名称',
dataIndex: 'sectionName',
key: 'sectionId',
},
{
title: '产线名称',
dataIndex: 'productLineName',
key: 'productLineName',
},
]}
/>
<Divider />
<AutoTable
pagetitle="履历详情"
columns={[
{
title: '操作时间',
dataIndex: 'createTime',
key: 'createTime',
width: 120,
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '履历类型',
dataIndex: 'logTypeName',
width: 120,
key: 'logTypeName',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '相关单号',
dataIndex: 'relateNo',
width: 120,
key: 'relateNo',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
render: (text, row) => {
return (
<a
onClick={() => {
setDrawer((s) => ({
setCurrDrawer((s) => ({
...s,
visible: true,
type: 'resume',
item: {
id: row.id,
},
item: row,
val: 'only',
title: '履历登记',
// onFinish: async (vals) => {
// console.log(1);
// let params = {
// ...vals,
// id: row.id,
// };
// let res = await doFetch({
// url: urlParams.save,
// params,
// });
// if (res.code === '0000') {
// message.success('新增成功!');
// setDrawer((s) => ({
// ...s,
// visible: false,
// }));
// actionRef.current.reload();
// }
// },
title: `${row.logTypeName}详情`,
}));
}}
>
履历登记
{row.relateNo}
</a>
),
key: '1',
);
},
},
]}
path={urlParams_resume.list}
params={{ equipmentId: drawer?.item?.id }}
resizeable={false}
/>
</>
);
};
return (
<>
<Tabs
activeKey={activeTab}
onChange={setactiveTab}
items={[
{
label: <a>关联备件(暂缓)</a>,
key: '2',
label: '基础信息',
key: 1,
children: <BaseInfo />,
},
{
label: <a>寿命件台账(暂缓)</a>,
key: '3',
label: '相关设备',
key: 2,
children: <Correlation />,
},
{
label: '履历查询',
key: 3,
children: <Curritae />,
},
]}
/>
);
return (
<Dropdown
overlay={menu}
trigger={['click']}
arrow={true}
getPopupContainer={() => document.getElementsByClassName('ant-table-content')[0]}
>
<Button size="small">更多</Button>
</Dropdown>
</>
);
};
......@@ -547,10 +1407,13 @@ function Model(props) {
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '上传文件',
title: '上传文件(上限为5个)',
key: 'urlIds ',
valueType: 'uploadDragger',
// colProps: { span: 24 },
fieldProps: {
limit: 5,
},
formItemProps: {
rules: [
{
......@@ -589,6 +1452,9 @@ function Model(props) {
},
],
},
fieldProps: {
limit: 5,
},
},
],
3: [
......@@ -774,9 +1640,89 @@ function Model(props) {
],
5: [
{
title: '设备1',
dataIndex: 'equipmentId',
key: 'equipment',
title: '接收公司',
dataIndex: 'returnOrganizationId',
key: 'returnOrganizationId',
valueType: 'select',
options: { path: '/auth/sysDepartment/query/organization/selectbox', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '接收部门',
valueType: 'select',
dataIndex: 'returnDepartmentId',
key: 'returnDepartmentId',
options: {
path: '/auth/sysDepartment/query/depart/selectbox',
linkParams: {
returnOrganizationId: 'parentId',
},
},
},
{
title: '接收工厂',
dataIndex: 'returnFactoryId',
key: 'returnFactoryId',
valueType: 'select',
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '接收车间',
dataIndex: 'returnShopId',
valueType: 'select',
options: {
path: '/auth/sysShop/getShopSelectionByFactory',
linkParams: {
returnFactoryId: 'factoryId',
},
},
key: 'returnShopId',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '接收工段',
dataIndex: 'returnSectionId',
key: 'returnSectionId',
valueType: 'select',
options: {
path: '/auth/sysSection/getAllSectionSelectionByShop',
linkParams: {
returnShopId: 'shopId',
},
},
},
{
title: '接收产线',
dataIndex: 'returnProductLineId',
valueType: 'select',
key: 'returnProductLineId',
options: {
path: '/auth/sysProductionLine/getAllProductLineSelectionByShop',
linkParams: {
returnShopId: 'shopId',
},
},
},
{
title: '接收位置号',
dataIndex: 'returnPositionNo',
valueType: 'input',
key: 'returnPositionNo',
},
{
title: '实际归还日期',
dataIndex: 'realReturnDate',
key: 'realReturnDate',
valueType: 'date',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '备注',
dataIndex: 'remark',
key: 'remark',
valueType: 'textarea',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
],
};
......@@ -961,7 +1907,27 @@ function Model(props) {
{
label: '归还',
key: 5,
children: <InitForm fields={fields[activeTab]} />,
children: activeTab == 5 && (
<InitForm
fields={fields[activeTab]}
onFinish={async (vals) => {
console.log(vals);
let res = await doFetch({
url: urlParams_resume.save,
params: { ...vals, type: '5', equipmentId: drawer?.item?.id },
});
if (res.code === '0000') {
message.success('登记成功!');
setDrawer((s) => ({
...s,
visible: false,
item: null,
}));
actionRef.current.reload();
}
}}
/>
),
},
]}
/>
......@@ -1023,11 +1989,9 @@ function Model(props) {
setDrawer((s) => ({
...s,
visible: true,
// item: row,
title: '详情',
val: 'detail',
detailpath: urlParams.detail,
params: { id: row.id },
type: 'detail',
item: row,
val: 'only',
title: row.equipmentName + '的详细信息',
}));
}}
......@@ -1073,6 +2037,8 @@ function Model(props) {
return <EditChildEquipment />;
case 'resume':
return <Resume />;
case 'detail':
return <Detail />;
default:
return null;
}
......@@ -1156,6 +2122,95 @@ function Model(props) {
>
{selectMoreDrawerType(drawer?.type)}
</DrawerPro>
<DrawerPro
placement="right"
onClose={() => {
setCurrDrawer((s) => ({
...s,
visible: false,
item: null,
}));
}}
{...currDrawer}
>
<ProDescriptions
title="设备信息"
request={async () => {
const { data } = await doFetch({
url: urlParams.detail,
params: { id: drawer?.item?.id },
});
return {
success: true,
data: data?.data,
};
}}
columns={[
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
},
{
title: '位置号',
dataIndex: 'positionNo',
key: 'positionNo',
},
{
title: '公司名称',
dataIndex: 'organizationName',
key: 'organizationId',
},
{
title: '部门名称',
dataIndex: 'departmentName',
key: 'departmentId',
},
{
title: '工厂名称',
dataIndex: 'factoryName',
key: 'factoryId',
},
{
title: '车间名称',
dataIndex: 'shopName',
key: 'shopId',
},
{
title: '工段名称',
dataIndex: 'sectionName',
key: 'sectionId',
},
{
title: '产线名称',
dataIndex: 'productLineName',
key: 'productLineName',
},
]}
/>
<Divider />
<ProDescriptions
title={currDrawer?.item?.logTypeName + '信息'}
request={async () => {
const { data } = await doFetch({
url: urlParams_resume.detail,
params: { id: currDrawer?.item?.id },
});
return {
success: true,
data: data?.data?.resume,
};
}}
columns={currfields[currDrawer?.item?.logType]}
/>
</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