Commit 0a8ae203 authored by TZW's avatar TZW

寿命件台账

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