Commit 51ed0b35 authored by TZW's avatar TZW

bug

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