Commit 0a8ae203 authored by TZW's avatar TZW

寿命件台账

parent 711de023
...@@ -128,7 +128,6 @@ function getcolumns(setdrawer) { ...@@ -128,7 +128,6 @@ function getcolumns(setdrawer) {
searchValueType: 'input', searchValueType: 'input',
title: '安装数量', title: '安装数量',
key: 'installNum', key: 'installNum',
hideInDescriptions: true,
hideInSearch: false, hideInSearch: false,
hideInTable: false, hideInTable: false,
fieldProps: { fieldProps: {
...@@ -164,6 +163,22 @@ function getcolumns(setdrawer) { ...@@ -164,6 +163,22 @@ function getcolumns(setdrawer) {
}, },
], ],
}, },
render: (text, row, _, action) => {
return (
<span
style={{
color: `${
dayjs(row.nextReplaceDate).valueOf() <
dayjs(dayjs().format('YYYY-MM-DD')).valueOf()
? '#f50'
: 'rgba(0, 0, 0, 0.85)'
}`,
}}
>
{row.nextReplaceDate}
</span>
);
},
}, },
], ],
pathconfig: { pathconfig: {
...@@ -173,7 +188,7 @@ function getcolumns(setdrawer) { ...@@ -173,7 +188,7 @@ function getcolumns(setdrawer) {
enabledetail: false, enabledetail: false,
add: '/sparepart/lifePieceAccount/initialization', add: '/sparepart/lifePieceAccount/initialization',
edit: '/sparepart/lifePieceAccount/initialization', edit: '/sparepart/lifePieceAccount/initialization',
list: '/sparepart/lifePieceAccount/queryWarning', list: '/sparepart/lifePieceAccount/queryList',
delete: '/sparepart/lifePieceAccount/deleteById', delete: '/sparepart/lifePieceAccount/deleteById',
detail: '', detail: '',
}, },
......
...@@ -7,7 +7,7 @@ import getcolumns from './columns'; ...@@ -7,7 +7,7 @@ import getcolumns from './columns';
import { useRequest } from 'ahooks'; import { useRequest } from 'ahooks';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
import InitForm from '@/components/InitForm'; import InitForm from '@/components/InitForm';
import { message } from 'antd';
function Warning(props) { function Warning(props) {
const actionRef = useRef(), const actionRef = useRef(),
formRef = useRef(); formRef = useRef();
...@@ -22,6 +22,7 @@ function Warning(props) { ...@@ -22,6 +22,7 @@ function Warning(props) {
manual: true, manual: true,
onSuccess: (res, params) => { onSuccess: (res, params) => {
if (res?.code == '0000') { if (res?.code == '0000') {
message.success('操作成功!', 2);
actionRef?.current?.reload(); actionRef?.current?.reload();
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
...@@ -31,6 +32,89 @@ function Warning(props) { ...@@ -31,6 +32,89 @@ function Warning(props) {
}, },
}); });
const changeColumns = useMemo(() => {
const columns = [
{
title: '线边库',
dataIndex: 'sparePartNo',
key: 'sparePartNo',
editable: false,
},
{
title: '备件料号',
dataIndex: 'sparePartName',
key: 'sparePartName',
span: 3,
editable: false,
},
{
title: '备件名称',
dataIndex: 'sparePartName',
key: 'sparePartName',
span: 3,
editable: false,
},
{
title: '供应商编号',
dataIndex: 'sparePartName',
key: 'sparePartName',
span: 3,
editable: false,
},
{
title: '供应商名称',
dataIndex: 'sparePartName',
key: 'sparePartName',
span: 3,
editable: false,
},
{
title: '可用数量',
dataIndex: 'sparePartName',
key: 'sparePartName',
search: false,
span: 3,
editable: false,
},
{
title: (
<div>
更换数量 <span style={{ color: 'red' }}>* </span>
</div>
),
search: false,
dataIndex: 'sparePartName',
key: 'sparePartName',
span: 3,
hideInForm: true,
},
];
return [
{
title: (
<div>
<span style={{ color: 'red' }}>* </span> 持有寿命件信息
</div>
),
valueType: 'split',
},
{
dataIndex: 'supplierList',
key: 'supplierList',
valueType: 'formSelectList',
colProps: {
span: 24,
},
span: 3,
columns,
hideInSearch: true,
hideInTable: true,
path: '/sparepart/sparePartSupplier/queryList',
params: { status: 1 },
rowName: 'supplierList',
},
];
});
const detail = (text, row, _, action) => { const detail = (text, row, _, action) => {
return ( return (
<PremButton <PremButton
...@@ -64,7 +148,7 @@ function Warning(props) { ...@@ -64,7 +148,7 @@ function Warning(props) {
...s, ...s,
open: true, open: true,
item: row, item: row,
title: '编辑', title: '更换寿命件',
val: 'detailaddon', val: 'detailaddon',
})); }));
}, },
...@@ -164,7 +248,7 @@ function Warning(props) { ...@@ -164,7 +248,7 @@ function Warning(props) {
} }
}} }}
> >
<InitForm /> <InitForm fields={changeColumns} />
</DrawerPro> </DrawerPro>
</div> </div>
); );
......
function getcolumns(setdrawer) { function getcolumns(setdrawer) {
return { return {
"columns": [ columns: [
{ {
"dataIndex": "equipmentNo", dataIndex: 'equipmentNo',
"valueType": "input", valueType: 'input',
"title": "设备编号", title: '设备编号',
"key": "equipmentNo", key: 'equipmentNo',
"hideInForm": true hideInForm: true,
}, },
{ {
"dataIndex": "equipmentName", dataIndex: 'equipmentName',
"valueType": "input", valueType: 'input',
"title": "设备名称", title: '设备名称',
"key": "equipmentName", key: 'equipmentName',
"hideInForm": true hideInForm: true,
}, },
{ {
"dataIndex": "installPosition", dataIndex: 'installPosition',
"valueType": "input", valueType: 'input',
"title": "安装部位", title: '安装部位',
"key": "installPosition", key: 'installPosition',
"hideInForm": true hideInForm: true,
}, },
{ {
"dataIndex": "sparePartNo", dataIndex: 'sparePartNo',
"valueType": "input", valueType: 'input',
"title": "备件料号", title: '备件料号',
"key": "sparePartNo", key: 'sparePartNo',
"hideInForm": true hideInForm: true,
}, },
{ {
"dataIndex": "sparePartName", dataIndex: 'sparePartName',
"valueType": "input", valueType: 'input',
"title": "备件名称", title: '备件名称',
"key": "sparePartName", key: 'sparePartName',
"hideInForm": true hideInForm: true,
}, },
{ {
"dataIndex": "supplierNo", dataIndex: 'supplierNo',
"valueType": "input", valueType: 'input',
"title": "供应商编号", title: '供应商编号',
"key": "supplierNo", key: 'supplierNo',
"hideInForm": true hideInForm: true,
}, },
{ {
"dataIndex": "supplierName", dataIndex: 'supplierName',
"valueType": "input", valueType: 'input',
"title": "供应商名称", title: '供应商名称',
"key": "supplierName", key: 'supplierName',
"hideInForm": true hideInForm: true,
}, },
{ {
"dataIndex": "equipmentId", dataIndex: 'equipmentId',
"valueType": "select", valueType: 'select',
"title": "选择设备", title: '选择设备',
"key": "equipmentId", key: 'equipmentId',
"hideInDescriptions": true, hideInDescriptions: true,
"hideInSearch": true, hideInSearch: true,
"hideInTable": true, hideInTable: true,
"mode": "radio", mode: 'radio',
"options": { options: {
"path": "/asset/equipment/selection/user/shop", path: '/asset/equipment/selection/user/shop',
"params": {} params: {},
}, },
"formItemProps": { formItemProps: {
"rules": [ rules: [
{ {
"required": true, required: true,
"message": "此项为必填项" message: '此项为必填项',
} },
] ],
} },
}, },
{ {
"dataIndex": "lifePieceStandardId", dataIndex: 'lifePieceStandardId',
"valueType": "select", valueType: 'select',
"title": "选择部位-寿命件", title: '选择部位-寿命件',
"key": "lifePieceStandardId", key: 'lifePieceStandardId',
"hideInDescriptions": true, hideInDescriptions: true,
"hideInSearch": true, hideInSearch: true,
"hideInTable": true, hideInTable: true,
"mode": "radio", mode: 'radio',
"options": { options: {
"path": "/sparepart/lifePieceStandard/querySelectByEquipmentId", path: '/sparepart/lifePieceStandard/querySelectByEquipmentId',
"linkParams": {} linkParams: {},
}, },
"formItemProps": { formItemProps: {
"rules": [ rules: [
{ {
"required": true, required: true,
"message": "此项为必填项" message: '此项为必填项',
} },
] ],
} },
}, },
{ {
"dataIndex": "supplierId", dataIndex: 'supplierId',
"valueType": "select", valueType: 'select',
"title": "选择供应商", title: '选择供应商',
"key": "supplierId", key: 'supplierId',
"hideInDescriptions": true, hideInDescriptions: true,
"hideInSearch": true, hideInSearch: true,
"hideInTable": true, hideInTable: true,
"mode": "radio", mode: 'radio',
"options": { options: {
"path": "/sparepart/sparePartSupplier/queryOnSelect", path: '/sparepart/sparePartSupplier/queryOnSelect',
"params": {} params: {},
}, },
"formItemProps": { formItemProps: {
"rules": [ rules: [
{ {
"required": true, required: true,
"message": "此项为必填项" message: '此项为必填项',
} },
] ],
} },
}, },
{ {
"dataIndex": "installNum", dataIndex: 'installNum',
"valueType": "digit", valueType: 'digit',
"title": "安装数量", title: '安装数量',
"key": "installNum", key: 'installNum',
"hideInDescriptions": true, hideInSearch: false,
"hideInSearch": false, hideInTable: false,
"hideInTable": false, formItemProps: {
"formItemProps": { rules: [
"rules": [ {
{ required: true,
"required": true, message: '此项为必填项',
"message": "此项为必填项" },
} ],
] },
} },
}, {
{ dataIndex: 'nextReplaceDate',
"dataIndex": "nextReplaceDate", valueType: 'date',
"valueType": "date", title: '下次更换日期',
"title": "下次更换日期", searchValueType: 'dateRange',
"key": "nextReplaceDateList", key: 'nextReplaceDateList',
"hideInDescriptions": true, hideInSearch: false,
"hideInSearch": false, hideInTable: false,
"hideInTable": false, formItemProps: {
"formItemProps": { rules: [
"rules": [ {
{ required: true,
"required": true, message: '此项为必填项',
"message": "此项为必填项" },
} ],
] },
} },
} ],
], pathconfig: {
"pathconfig": { enableadd: false,
"enableadd": true, enableedit: true,
"enableedit": false, enabledelete: false,
"enabledelete": false, enabledetail: false,
"enabledetail": false, add: '',
"add": "/sparepart/lifePieceAccount/initialization", edit: '',
"edit": "", list: '/sparepart/lifePieceAccount/queryWarning',
"list": "/sparepart/lifePieceAccount/queryWarning", delete: '',
"delete": "", detail: '',
"detail": "" },
} };
}; }
} export default getcolumns;
export default getcolumns;
\ No newline at end of file
/* 寿命件预警
* @Author: Li Hanlin
* @Date: 2023-02-17 13:36:11
* @Last Modified by: Li Hanlin
* @Last Modified time: 2023-02-17 13:50:04
*/
import * as React from 'react'; import * as React from 'react';
import { useState, useMemo, useRef } from 'react'; import { useState, useMemo, useRef } from 'react';
import DrawerPro from '@/components/DrawerPro'; import DrawerPro from '@/components/DrawerPro';
...@@ -6,7 +13,7 @@ import PremButton from '@/components/PremButton'; ...@@ -6,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 InitForm from '@/components/InitForm';
function Warning(props) { function Warning(props) {
const actionRef = useRef(), const actionRef = useRef(),
formRef = useRef(); formRef = useRef();
...@@ -29,7 +36,89 @@ function Warning(props) { ...@@ -29,7 +36,89 @@ function Warning(props) {
} }
}, },
}); });
const changeColumns = useMemo(() => {
const columns = [
{
title: '线边库',
dataIndex: 'sparePartNo',
key: 'sparePartNo',
editable: false,
},
{
title: '备件料号',
dataIndex: 'sparePartName',
key: 'sparePartName',
span: 3,
editable: false,
},
{
title: '备件名称',
dataIndex: 'sparePartName',
key: 'sparePartName',
span: 3,
editable: false,
},
{
title: '供应商编号',
dataIndex: 'sparePartName',
key: 'sparePartName',
span: 3,
editable: false,
},
{
title: '供应商名称',
dataIndex: 'sparePartName',
key: 'sparePartName',
span: 3,
editable: false,
},
{
title: '可用数量',
dataIndex: 'sparePartName',
key: 'sparePartName',
search: false,
span: 3,
editable: false,
},
{
title: (
<div>
更换数量 <span style={{ color: 'red' }}>* </span>
</div>
),
search: false,
dataIndex: 'sparePartName',
key: 'sparePartName',
span: 3,
hideInForm: true,
},
];
return [
{
title: (
<div>
<span style={{ color: 'red' }}>* </span> 持有寿命件信息
</div>
),
valueType: 'split',
},
{
dataIndex: 'supplierList',
key: 'supplierList',
valueType: 'formSelectList',
colProps: {
span: 24,
},
span: 3,
columns,
hideInSearch: true,
hideInTable: true,
path: '/sparepart/sparePartSupplier/queryList',
params: { status: 1 },
rowName: 'supplierList',
},
];
});
const detail = (text, row, _, action) => { const detail = (text, row, _, action) => {
return ( return (
<PremButton <PremButton
...@@ -63,13 +152,13 @@ function Warning(props) { ...@@ -63,13 +152,13 @@ function Warning(props) {
...s, ...s,
open: true, open: true,
item: row, item: row,
title: '编辑', title: '更换寿命件',
val: 'edit', val: 'detailaddon',
})); }));
}, },
}} }}
> >
编辑 更换寿命件
</PremButton> </PremButton>
); );
}; };
...@@ -101,11 +190,7 @@ function Warning(props) { ...@@ -101,11 +190,7 @@ function Warning(props) {
title: '操作', title: '操作',
valueType: 'option', valueType: 'option',
width: 150, width: 150,
render: (text, row, _, action) => [ render: (text, row, _, action) => [pathconfig?.enableedit && edit(text, row, _, action)],
pathconfig?.enabledetail && detail(text, row, _, action),
pathconfig?.enableedit && edit(text, row, _, action),
pathconfig?.enabledelete && remove(text, row, _, action),
],
}); });
}, []); }, []);
...@@ -117,7 +202,7 @@ function Warning(props) { ...@@ -117,7 +202,7 @@ function Warning(props) {
actionRef={actionRef} actionRef={actionRef}
path={pathconfig?.list || '/ngic-auth/sysUser/query/page'} path={pathconfig?.list || '/ngic-auth/sysUser/query/page'}
pageextra={pathconfig?.enableadd ? 'add' : null} pageextra={pathconfig?.enableadd ? 'add' : null}
resizeable={true} resizeable={false}
addconfig={{ addconfig={{
// access: 'sysDepartment_save', // access: 'sysDepartment_save',
btn: { btn: {
...@@ -157,7 +242,9 @@ function Warning(props) { ...@@ -157,7 +242,9 @@ function Warning(props) {
run({ url: pathconfig?.edit || '/edit', params: { ...vals, id: drawer?.item?.id } }); run({ url: pathconfig?.edit || '/edit', params: { ...vals, id: drawer?.item?.id } });
} }
}} }}
/> >
<InitForm fields={changeColumns} />
</DrawerPro>
</div> </div>
); );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2023-01-19 09:53:59 * @Date: 2023-01-19 09:53:59
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2023-02-09 18:53:53 * @Last Modified time: 2023-02-17 11:32:56
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -520,7 +520,6 @@ function WorkOrder(props) { ...@@ -520,7 +520,6 @@ function WorkOrder(props) {
type: 'primary', type: 'primary',
loading, loading,
onClick: () => { onClick: () => {
console.log(drawer);
let maintainTaskItemList = drawer?.item?.maintainTaskItemList?.map((it) => { let maintainTaskItemList = drawer?.item?.maintainTaskItemList?.map((it) => {
if (it.judgeType == 1) { if (it.judgeType == 1) {
return { return {
......
...@@ -463,27 +463,19 @@ function getcolumns(setdrawer) { ...@@ -463,27 +463,19 @@ function getcolumns(setdrawer) {
format: 'YYYY-MM-DD HH:mm', format: 'YYYY-MM-DD HH:mm',
}, },
hideInForm: true, hideInForm: true,
span: 3,
valueType: 'dateRange', valueType: 'dateRange',
render: (text, row) => { render: (text, row) => {
return <span>{row?.completeTime}</span>; return <span>{row?.completeTime}</span>;
}, },
}, },
{ {
title: '状态', title: '工单状态',
dataIndex: 'statusName', dataIndex: 'statusName',
key: 'status', key: 'statusName',
hideInSearch: true,
hideInTable: true,
hideInForm: true, hideInForm: true,
hideInDescriptions: true, span: 2,
valueType: 'select',
fieldProps: {
dropdownMatchSelectWidth: 120,
},
width: 120,
options: [
{ label: '已入库', value: 2 },
{ label: '已关单', value: 3 },
],
}, },
{ {
title: ( title: (
...@@ -529,27 +521,7 @@ function getcolumns(setdrawer) { ...@@ -529,27 +521,7 @@ function getcolumns(setdrawer) {
return row?.status == 2 ? '入库信息' : '关单信息'; return row?.status == 2 ? '入库信息' : '关单信息';
}, },
}, },
{
dataIndex: 'statusName',
valueType: 'select',
fieldProps: {
dropdownMatchSelectWidth: 120,
},
title: '状态',
span: 1,
key: 'status',
options: [
{
label: '已出库',
value: 2,
},
{
label: '已关单',
value: 3,
},
],
hideInForm: true,
},
{ {
title: '操作人', title: '操作人',
dataIndex: 'operateUserName', dataIndex: 'operateUserName',
......
...@@ -468,6 +468,27 @@ function getcolumns(setdrawer) { ...@@ -468,6 +468,27 @@ function getcolumns(setdrawer) {
}, },
hideInForm: true, hideInForm: true,
}, },
{
dataIndex: 'statusName',
valueType: 'select',
fieldProps: {
dropdownMatchSelectWidth: 120,
},
title: '状态',
key: 'status',
options: [
{
label: '已出库',
value: 2,
},
{
label: '已关单',
value: 3,
},
],
hideInForm: true,
hideInDescriptions: true,
},
{ {
title: '工单状态', title: '工单状态',
dataIndex: 'statusName', dataIndex: 'statusName',
...@@ -475,7 +496,7 @@ function getcolumns(setdrawer) { ...@@ -475,7 +496,7 @@ function getcolumns(setdrawer) {
hideInSearch: true, hideInSearch: true,
hideInTable: true, hideInTable: true,
hideInForm: true, hideInForm: true,
span: 2, span: 3,
}, },
{ {
...@@ -527,32 +548,14 @@ function getcolumns(setdrawer) { ...@@ -527,32 +548,14 @@ function getcolumns(setdrawer) {
return row?.status == 2 ? '出库信息' : '关单信息'; return row?.status == 2 ? '出库信息' : '关单信息';
}, },
}, },
{
dataIndex: 'statusName',
valueType: 'select',
fieldProps: {
dropdownMatchSelectWidth: 120,
},
title: '状态',
key: 'status',
options: [
{
label: '已出库',
value: 2,
},
{
label: '已关单',
value: 3,
},
],
hideInForm: true,
},
{ {
title: '操作人', title: '操作人',
dataIndex: 'operateUserName', dataIndex: 'operateUserName',
key: 'operateUserName', key: 'operateUserName',
hideInSearch: true, hideInSearch: true,
hideInTable: true, hideInTable: true,
span: 1,
hideInForm: true, hideInForm: true,
}, },
{ {
......
...@@ -500,7 +500,7 @@ function getcolumns(setdrawer, type, fullName) { ...@@ -500,7 +500,7 @@ function getcolumns(setdrawer, type, fullName) {
value: 3, value: 3,
}, },
{ {
label: '处理失败 ', label: '出库失败',
value: 4, value: 4,
}, },
{ {
......
import AutoTable from '@/components/AutoTable/mtable'; import AutoTable from '@/components/AutoTable/mtable';
function getcolumns(setdrawer,type, fullName) { function getcolumns(setdrawer, type, fullName) {
const columns = [ const columns = [
{ {
title: '备件料号', title: '备件料号',
...@@ -475,7 +475,7 @@ function getcolumns(setdrawer,type, fullName) { ...@@ -475,7 +475,7 @@ function getcolumns(setdrawer,type, fullName) {
value: 3, value: 3,
}, },
{ {
label: '处理失败 ', label: '出库失败 ',
value: 4, value: 4,
}, },
{ {
......
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