Commit d5337983 authored by TZW's avatar TZW

116保养

parent d47a343e
...@@ -518,12 +518,10 @@ let Diyrule = (props) => { ...@@ -518,12 +518,10 @@ let Diyrule = (props) => {
<p style={{ color: '#999', marginBottom: 24 }}>放置在第几个之后</p> <p style={{ color: '#999', marginBottom: 24 }}>放置在第几个之后</p>
<Select <Select
value={other?.sort} value={other?.sort}
options={Object.keys(Array.apply(null, { length: value ? value.length : 0 })).map( options={Array.apply(null, { length: value ? value.length : 0 }).map((it, i) => ({
(it, i) => ({
label: `第${i + 1}个`, label: `第${i + 1}个`,
value: i + 1, value: i + 2,
}), }))}
)}
onChange={(val) => { onChange={(val) => {
onChange({ onChange({
value: value, value: value,
......
...@@ -71,6 +71,7 @@ function procolumns(id) { ...@@ -71,6 +71,7 @@ function procolumns(id) {
key: 'estimateWorkingHours', key: 'estimateWorkingHours',
valueType: 'digit', valueType: 'digit',
hideInSearch: true, hideInSearch: true,
precision: 0,
}, },
{ {
title: '备注', title: '备注',
......
import dayjs from 'dayjs';
function getcolumns(setdrawer) { function getcolumns(setdrawer) {
const disabledDateOfDay = (current) => {
// Can not select days before today and today
return current && current < dayjs().endOf('day');
};
const disabledDateOfMonth = (current) => {
// Can not select days before today and today
return current && current < dayjs().startOf('month');
};
const columns_day = [
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
editable: false,
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
editable: false,
},
{
title: '工厂名称',
dataIndex: 'factoryName',
key: 'factoryId',
hideInForm: true,
valueType: 'select',
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
options: {
path: '/auth/sysFactory/getAllFactorySelection',
params: {},
},
editable: false,
},
{
title: '车间名称',
dataIndex: 'shopName',
key: 'shopId',
hideInForm: true,
valueType: 'select',
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
options: {
path: '/auth/sysShop/getAllShopSelection',
params: {},
},
editable: false,
},
{
title: '下次保养日期',
dataIndex: 'nextMaintainDate',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
fieldProps: {
disabledDate: disabledDateOfDay,
},
valueType: 'date',
hideInSearch: true,
},
];
const columns_month = [
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
editable: false,
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
editable: false,
},
{
title: '工厂名称',
dataIndex: 'factoryName',
key: 'factoryId',
hideInForm: true,
valueType: 'select',
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
options: {
path: '/auth/sysFactory/getAllFactorySelection',
params: {},
},
editable: false,
},
{
title: '车间名称',
dataIndex: 'shopName',
key: 'shopId',
hideInForm: true,
valueType: 'select',
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
options: {
path: '/auth/sysShop/getAllShopSelection',
params: {},
},
editable: false,
},
{
title: '下次保养日期',
dataIndex: 'nextMaintainDate',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
fieldProps: {
disabledDate: disabledDateOfMonth,
},
valueType: 'dateMonth',
hideInSearch: true,
},
];
return [ return [
{ {
tab: '未完成', tab: '未完成',
...@@ -9,6 +145,23 @@ function getcolumns(setdrawer) { ...@@ -9,6 +145,23 @@ function getcolumns(setdrawer) {
dataIndex: 'maintainNo', dataIndex: 'maintainNo',
key: 'maintainNo', key: 'maintainNo',
hideInForm: true, hideInForm: true,
render: (text, row, _, action) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
val: 'detail',
title: '详细信息',
item: row,
}));
}}
>
{row?.maintainNo}
</a>
);
},
}, },
{ {
title: '设备编号', title: '设备编号',
...@@ -126,7 +279,7 @@ function getcolumns(setdrawer) { ...@@ -126,7 +279,7 @@ function getcolumns(setdrawer) {
value: '1', value: '1',
}, },
{ {
label: '循环', label: '周期',
value: '2', value: '2',
}, },
], ],
...@@ -140,7 +293,7 @@ function getcolumns(setdrawer) { ...@@ -140,7 +293,7 @@ function getcolumns(setdrawer) {
], ],
}, },
render: (_, row) => { render: (_, row) => {
return row?.isCycle == 1 ? '单次' : '循环'; return row?.isCycle == 1 ? '单次' : '周期';
}, },
}, },
{ {
...@@ -148,6 +301,7 @@ function getcolumns(setdrawer) { ...@@ -148,6 +301,7 @@ function getcolumns(setdrawer) {
dataIndex: 'nextMaintainDate', dataIndex: 'nextMaintainDate',
key: 'nextMaintainDateList', key: 'nextMaintainDateList',
valueType: 'dateRange', valueType: 'dateRange',
hideInForm: true,
}, },
{ {
title: '状态', title: '状态',
...@@ -155,6 +309,9 @@ function getcolumns(setdrawer) { ...@@ -155,6 +309,9 @@ function getcolumns(setdrawer) {
key: 'maintainStatus', key: 'maintainStatus',
hideInForm: true, hideInForm: true,
valueType: 'select', valueType: 'select',
fieldProps: {
dropdownMatchSelectWidth: 100,
},
mode: 'radio', mode: 'radio',
options: [ options: [
{ {
...@@ -167,6 +324,58 @@ function getcolumns(setdrawer) { ...@@ -167,6 +324,58 @@ function getcolumns(setdrawer) {
}, },
], ],
}, },
{
title: '选择设备',
dataIndex: 'paramList',
key: 'paramList',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
hideInSearch: true,
hideInTable: true,
hideInForm: {
maintainFrequency: {
reverse: ['0'],
},
},
valueType: 'formSelectList',
colProps: {
span: 24,
},
path: '/asset/equipment/list/user/shop',
columns: columns_day,
hideInDescriptions: true,
},
{
title: '选择设备',
dataIndex: 'paramList',
key: 'paramList',
hideInForm: {
maintainFrequency: ['0'],
},
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
hideInSearch: true,
hideInTable: true,
valueType: 'formSelectList',
colProps: {
span: 24,
},
path: '/asset/equipment/list/user/shop',
columns: columns_month,
hideInDescriptions: true,
},
], ],
pathconfig: { pathconfig: {
enableadd: true, enableadd: true,
...@@ -300,7 +509,7 @@ function getcolumns(setdrawer) { ...@@ -300,7 +509,7 @@ function getcolumns(setdrawer) {
value: '1', value: '1',
}, },
{ {
label: '循环', label: '周期',
value: '2', value: '2',
}, },
], ],
......
This diff is collapsed.
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