Commit 51ed0b35 authored by TZW's avatar TZW

bug

parent e22207dd
......@@ -121,6 +121,7 @@ function getcolumns(setdrawer) {
},
options: {
path: '/auth/sysShop/getAllShopSelection',
params: {},
},
key: 'shopId',
hideInForm: true,
......@@ -157,6 +158,7 @@ function getcolumns(setdrawer) {
valueType: 'select',
options: {
path: '/auth/sysSection/getAllSectionSelection',
params: {},
},
hideInForm: true,
hideInTable: true,
......@@ -192,6 +194,7 @@ function getcolumns(setdrawer) {
key: 'productLineId',
options: {
path: '/auth/sysProductionLine/getAllProductLineSelection',
params: {},
},
hideInForm: true,
hideInTable: true,
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-10 09:39:56
* @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-11 16:49:41
* @Last Modified time: 2023-01-13 09:46:11
*/
import * as React from 'react';
......@@ -1267,6 +1267,7 @@ function Model(props) {
},
options: {
path: '/auth/sysShop/getAllShopSelection',
params: {},
},
key: 'shopId',
hideInForm: true,
......@@ -1304,6 +1305,7 @@ function Model(props) {
valueType: 'select',
options: {
path: '/auth/sysSection/getAllSectionSelection',
params: {},
},
hideInForm: true,
hideInTable: true,
......@@ -1339,6 +1341,7 @@ function Model(props) {
key: 'productLineId',
options: {
path: '/auth/sysProductionLine/getAllProductLineSelection',
params: {},
},
hideInForm: true,
hideInTable: true,
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2023-01-11 10:46:48
* @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-11 13:57:52
* @Last Modified time: 2023-01-13 09:36:16
*/
import * as React from 'react';
......@@ -121,7 +121,7 @@ function Criterion(props) {
},
}}
>
项目明细
保养项目
</PremButton>
);
};
......@@ -143,7 +143,7 @@ function Criterion(props) {
return (
<div style={{ position: 'relative' }}>
<AutoTable
pagetitle=" 保养标准"
pagetitle={<h3 className="page-title">保养标准</h3>}
columns={columns}
actionRef={actionRef}
path={pathconfig?.list || '/ngic-auth/sysUser/query/page'}
......
function getcolumns(setdrawer) {
return {
"pathconfig": {
"enableadd": false,
"enableedit": false,
"enabledelete": false,
"enabledetail": false,
"add": "",
"edit": "",
"list": "/repair/umRepairOrder/queryRepairOrderList",
"delete": "",
"detail": ""
return [
{
tab: '未完成',
key: '1',
columns: [
{
title: '保养计划号',
dataIndex: 'maintainNo',
key: 'maintainNo',
hideInForm: true,
},
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
hideInForm: true,
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
hideInForm: true,
},
{
title: '工厂名称',
dataIndex: 'factoryName',
key: 'factoryId',
valueType: 'select',
fieldProps: {
showSearch: true,
},
mode: 'radio',
options: {
path: '/auth/sysFactory/getAllFactorySelection',
params: {},
},
hideInForm: true,
},
{
title: '车间名称',
dataIndex: 'shopName',
key: 'shopId',
fieldProps: {
showSearch: true,
},
valueType: 'select',
mode: 'radio',
options: {
path: '/auth/sysShop/getAllShopSelection',
params: {},
},
hideInForm: true,
},
{
title: '保养类型',
dataIndex: 'maintainTypeName',
key: 'maintainType',
valueType: 'select',
mode: 'radio',
options: [
{
label: '自主保养',
value: '1',
},
{
label: '专业保养',
value: '2',
},
],
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
},
{
title: '保养频次',
dataIndex: 'maintainFrequencyName',
key: 'maintainFrequency',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
valueType: 'select',
mode: 'radio',
options: [
{
label: '周',
value: '0',
},
{
label: '月度',
value: '1',
},
{
label: '季度',
value: '2',
},
{
label: '半年',
value: '3',
},
{
label: '一年',
value: '4',
},
],
},
"columns": [
{
"title": "维修单号",
"dataIndex": "repairOrderNo",
"key": "repairOrderNo"
title: '计划类型',
dataIndex: 'isCycle',
key: 'isCycle',
valueType: 'select',
mode: 'radio',
options: [
{
label: '单次',
value: '1',
},
{
"title": "设备编号",
"dataIndex": "equipmentNo",
"key": "equipmentNo"
label: '循环',
value: '2',
},
],
hideInForm: false,
formItemProps: {
rules: [
{
"title": "设备名称",
"dataIndex": "equipmentName",
"key": "equipmentName"
required: true,
message: '此项为必填项',
},
],
},
render: (_, row) => {
return row?.isCycle == 1 ? '单次' : '循环';
},
},
{
"title": "故障描述",
"dataIndex": "faultDescription",
"key": "faultDescription"
title: '下次保养日期',
dataIndex: 'nextMaintainDate',
key: 'nextMaintainDateList',
valueType: 'dateRange',
},
{
"title": "报修人员",
"dataIndex": "repairUserName",
"key": "repairUserName"
title: '状态',
dataIndex: 'maintainStatusName',
key: 'maintainStatus',
hideInForm: true,
valueType: 'select',
mode: 'radio',
options: [
{
label: '未开始',
value: '1',
},
{
"title": "报修时间",
"dataIndex": "repairTime",
"key": "repairTimeList",
"valueType": "dateTimeRange"
label: '执行中',
value: '2',
},
],
},
],
pathconfig: {
enableadd: true,
enableedit: true,
enabledelete: true,
enabledetail: true,
add: '/maintain/umMaintainPlan/save',
edit: '/maintain/umMaintainPlan/save',
list: '/maintain/umMaintainPlan/queryList',
delete: '/maintain/umMaintainPlan/enableDeactivate',
detail: '/maintain/umMaintainPlan/queryById',
},
},
{
tab: '已完成',
key: '2',
columns: [
{
"title": "报修单号",
"dataIndex": "repairNo",
"key": "repairNo"
title: '保养计划号',
dataIndex: 'maintainNo',
key: 'maintainNo',
hideInForm: true,
},
{
"title": "工单状态",
"dataIndex": "statusName",
"key": "statusName"
}
]
};
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
hideInForm: true,
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
hideInForm: true,
},
{
title: '工厂名称',
dataIndex: 'factoryName',
key: 'factoryId',
valueType: 'select',
mode: 'radio',
options: {
path: '/auth/sysFactory/getAllFactorySelection',
params: {},
},
hideInForm: true,
},
{
title: '车间名称',
dataIndex: 'shopName',
key: 'shopId',
valueType: 'select',
mode: 'radio',
options: {
path: '/auth/sysShop/getAllShopSelection',
params: {},
},
hideInForm: true,
},
{
title: '保养类型',
dataIndex: 'maintainTypeName',
key: 'maintainType',
valueType: 'select',
mode: 'radio',
options: [
{
label: '自主保养',
value: '1',
},
{
label: '专业保养',
value: '2',
},
],
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
},
{
title: '保养频次',
dataIndex: 'maintainFrequencyName',
key: 'maintainFrequency',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
valueType: 'select',
mode: 'radio',
options: [
{
label: '周',
value: '0',
},
{
label: '月度',
value: '1',
},
{
label: '季度',
value: '2',
},
{
label: '半年',
value: '3',
},
{
label: '一年',
value: '4',
},
],
},
{
title: '计划类型',
dataIndex: 'isCycle',
key: 'isCycle',
valueType: 'select',
mode: 'radio',
options: [
{
label: '单次',
value: '1',
},
{
label: '循环',
value: '2',
},
],
hideInForm: false,
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
},
{
title: '关单日期',
dataIndex: 'customsTime',
key: 'customsTimeList',
valueType: 'dateRange',
},
{
title: '状态',
dataIndex: 'maintainStatusName',
key: 'maintainStatus',
hideInForm: true,
valueType: 'input',
mode: 'radio',
hideInSearch: true,
},
],
pathconfig: {
enableadd: true,
enableedit: true,
enabledelete: true,
enabledetail: true,
add: '/maintain/umMaintainPlan/save',
edit: '/maintain/umMaintainPlan/save',
list: '/maintain/umMaintainPlan/queryList',
delete: '/maintain/umMaintainPlan/enableDeactivate',
detail: '/maintain/umMaintainPlan/queryById',
},
},
];
}
export default getcolumns;
import * as React from 'react';
import { useState, useMemo, useRef } from 'react';
import DrawerPro from '@/components/DrawerPro';
import AutoTable from '@/components/AutoTable';
import PremButton from '@/components/PremButton';
import getcolumns from './columns';
import { useRequest } from 'ahooks';
import { doFetch } from '@/utils/doFetch';
import { useState, useMemo, useRef } from 'react';
import DrawerPro from '@/components/DrawerPro';
import AutoTable from '@/components/AutoTable';
import PremButton from '@/components/PremButton';
import getcolumns from './columns';
import { useRequest } from 'ahooks';
import { doFetch } from '@/utils/doFetch';
function Plan(props) {
function Plan(props) {
const actionRef = useRef(),
formRef = useRef();
const [drawer, setdrawer] = useState({
open: false,
});
const pathconfig = useMemo(() => {
let pathconf = getcolumns(setdrawer)?.pathconfig ?? {};
return pathconf;
}, []);
}),
[activeTabKey, setactiveTabKey] = useState('1');
const { run, loading } = useRequest(doFetch, {
manual: true,
onSuccess: (res, params) => {
......@@ -96,28 +94,34 @@ import * as React from 'react';
};
const columns = useMemo(() => {
let defcolumn = getcolumns(setdrawer)?.columns;
let defcolumn = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.columns;
let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
return defcolumn.concat({
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),
defpath?.enabledetail && detail(text, row, _, action),
defpath?.enableedit && edit(text, row, _, action),
defpath?.enabledelete && remove(text, row, _, action),
],
});
}, []);
}, [activeTabKey]);
const pathconfig = useMemo(() => {
let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
return defpath;
}, [activeTabKey]);
return (
<div style={{ position: 'relative' }}>
<AutoTable
pagetitle="保养计划"
pagetitle={<h3 className="page-title">保养计划</h3>}
columns={columns}
actionRef={actionRef}
path={pathconfig?.list || '/ngic-auth/sysUser/query/page'}
actionRef={actionRef}
pageextra={pathconfig?.enableadd ? 'add' : null}
resizeable={true}
resizeable={false}
addconfig={{
// access: 'sysDepartment_save',
btn: {
......@@ -133,16 +137,21 @@ import * as React from 'react';
},
},
}}
tabList={getcolumns()}
activeTabKey={activeTabKey}
onTabChange={(key) => {
setactiveTabKey(key);
}}
/>
<DrawerPro
fields={columns}
params={{ id: drawer?.item?.id }}
formRef={formRef}
placement="right"
detailpath={pathconfig?.detail || null}
detailData={drawer?.item}
defaultFormValue={drawer?.item}
params={{ id: drawer?.item?.id }}
formRef={formRef}
placement="right"
onClose={() => {
setdrawer((s) => ({
...s,
......@@ -160,7 +169,6 @@ import * as React from 'react';
/>
</div>
);
}
export default Plan;
}
export default Plan;
......@@ -14,6 +14,7 @@ function getcolumns(ifs) {
fieldProps: {
showSearch: true,
},
hideInForm: true,
key: 'factoryId',
width: 180,
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
......@@ -42,7 +43,6 @@ function getcolumns(ifs) {
width: 180,
hideInTable: true,
search: false,
hideInForm: true,
fieldProps: {
disabled: ifs,
},
......@@ -63,7 +63,7 @@ function getcolumns(ifs) {
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select',
options: {
path: '/auth/sysShop/getAllShopSelection',
path: '/auth/sysShop/getShopSelectionByFactory',
linkParams: {
factoryId: '', //key 后面如果存在value 则该value会在调用接口时format
},
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:43:54
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-20 10:48:29
* @Last Modified time: 2023-01-13 09:53:32
*/
import * as React from 'react';
......@@ -157,6 +157,7 @@ function Section(props) {
detailpath: null,
title: '新增',
val: 'add',
fields: getcolumns(false),
onFinish: async (vals) => {
let params = {
...vals,
......
......@@ -66,6 +66,7 @@ function getcolumns(ifs) {
valueType: 'select',
options: {
path: '/auth/sysShop/getAllShopSelection',
params: {},
},
},
];
......
......@@ -260,7 +260,6 @@ function getcolumns(setDrawer, ifs, formRef) {
dataIndex: 'roleNames',
key: 'roleIdList',
valueType: 'select',
search: false,
fieldProps: {
placeholder: '请选择',
showSearch: true,
......@@ -269,7 +268,9 @@ function getcolumns(setDrawer, ifs, formRef) {
options: {
path: '/auth/sysRole/selection',
},
search: false,
},
{
title: '直属领导',
valueType: 'select',
......@@ -282,7 +283,6 @@ function getcolumns(setDrawer, ifs, formRef) {
placeholder: '请选择',
showSearch: true,
},
search: false,
},
{
title: '状态',
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-14 18:27:22
* @Last Modified time: 2023-01-11 19:37:17
*/
import * as React from 'react';
......@@ -66,6 +66,7 @@ function Rules(props) {
title: '编辑',
val: 'edit',
onFinish: async (vals) => {
console.log('编辑', vals);
vals.nrList.other = _.pick(vals.nrList.other, [
'formatType',
'increaseList',
......@@ -179,7 +180,7 @@ function Rules(props) {
title: '新增',
val: 'add',
onFinish: async (vals) => {
console.log('myvals:', vals);
console.log('新增:', vals);
let params = { ...vals };
//console.log('vals:', vals);
// for (let i in vals) {
......
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