Commit d5337983 authored by TZW's avatar TZW

116保养

parent d47a343e
......@@ -518,12 +518,10 @@ let Diyrule = (props) => {
<p style={{ color: '#999', marginBottom: 24 }}>放置在第几个之后</p>
<Select
value={other?.sort}
options={Object.keys(Array.apply(null, { length: value ? value.length : 0 })).map(
(it, i) => ({
options={Array.apply(null, { length: value ? value.length : 0 }).map((it, i) => ({
label: `第${i + 1}个`,
value: i + 1,
}),
)}
value: i + 2,
}))}
onChange={(val) => {
onChange({
value: value,
......
......@@ -71,6 +71,7 @@ function procolumns(id) {
key: 'estimateWorkingHours',
valueType: 'digit',
hideInSearch: true,
precision: 0,
},
{
title: '备注',
......
import dayjs from 'dayjs';
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 [
{
tab: '未完成',
......@@ -9,6 +145,23 @@ function getcolumns(setdrawer) {
dataIndex: 'maintainNo',
key: 'maintainNo',
hideInForm: true,
render: (text, row, _, action) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
val: 'detail',
title: '详细信息',
item: row,
}));
}}
>
{row?.maintainNo}
</a>
);
},
},
{
title: '设备编号',
......@@ -126,7 +279,7 @@ function getcolumns(setdrawer) {
value: '1',
},
{
label: '循环',
label: '周期',
value: '2',
},
],
......@@ -140,7 +293,7 @@ function getcolumns(setdrawer) {
],
},
render: (_, row) => {
return row?.isCycle == 1 ? '单次' : '循环';
return row?.isCycle == 1 ? '单次' : '周期';
},
},
{
......@@ -148,6 +301,7 @@ function getcolumns(setdrawer) {
dataIndex: 'nextMaintainDate',
key: 'nextMaintainDateList',
valueType: 'dateRange',
hideInForm: true,
},
{
title: '状态',
......@@ -155,6 +309,9 @@ function getcolumns(setdrawer) {
key: 'maintainStatus',
hideInForm: true,
valueType: 'select',
fieldProps: {
dropdownMatchSelectWidth: 100,
},
mode: 'radio',
options: [
{
......@@ -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: {
enableadd: true,
......@@ -300,7 +509,7 @@ function getcolumns(setdrawer) {
value: '1',
},
{
label: '循环',
label: '周期',
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