Commit d80e190e authored by TZW's avatar TZW

0220

parent a0645d02
export default [ export default [
{ {
"path": "/welcome", path: '/welcome',
"name": "首页", name: '首页',
"icon": "smile", icon: 'smile',
"component": "./Welcome" component: './Welcome',
}, },
{ {
"name": "基础设置", name: '基础设置',
"icon": "setting", icon: 'setting',
"path": "/setting", path: '/setting',
"routes": [ routes: [
{ {
"name": "用户管理", name: '用户管理',
"path": "/setting/users", path: '/setting/users',
"component": "./setting/users" component: './setting/users',
}, },
{ {
"name": "角色管理", name: '角色管理',
"path": "/setting/role", path: '/setting/role',
"component": "./setting/role" component: './setting/role',
}, },
{ {
"name": "组织管理", name: '组织管理',
"path": "/setting/organization", path: '/setting/organization',
"component": "./setting/organization" component: './setting/organization',
}, },
{ {
"name": "工厂管理", name: '工厂管理',
"path": "/setting/factory", path: '/setting/factory',
"component": "./setting/factory" component: './setting/factory',
}, },
{ {
"name": "车间管理", name: '车间管理',
"path": "/setting/workshop", path: '/setting/workshop',
"component": "./setting/workshop" component: './setting/workshop',
}, },
{ {
"name": "工段管理", name: '工段管理',
"path": "/setting/section", path: '/setting/section',
"component": "./setting/section" component: './setting/section',
}, },
{ {
"name": "产线管理", name: '产线管理',
"path": "/setting/production", path: '/setting/production',
"component": "./setting/production" component: './setting/production',
} },
] ],
}, },
{ {
"name": "设备管理", name: '设备管理',
"icon": "bulb", icon: 'bulb',
"path": "/device", path: '/device',
"routes": [ routes: [
{ {
"name": "设备台账", name: '设备台账',
"path": "/device/account", path: '/device/account',
"component": "./device/account" component: './device/account',
}, },
{ {
"name": "设备类型", name: '设备类型',
"path": "/device/type", path: '/device/type',
"component": "./device/type" component: './device/type',
}, },
{ {
"name": "设备型号", name: '设备型号',
"path": "/device/model", path: '/device/model',
"component": "./device/model" component: './device/model',
}, },
{ {
"name": "设备供应商", name: '设备供应商',
"path": "/device/supplier", path: '/device/supplier',
"component": "./device/supplier" component: './device/supplier',
} },
] ],
}, },
{ {
"name": "维修管理", name: '维修管理',
"path": "/repair", path: '/repair',
"icon": "tool", icon: 'tool',
"routes": [ routes: [
{ {
"name": "接单平台", name: '接单平台',
"path": "/repair/platform", path: '/repair/platform',
"icon": "", icon: '',
"component": "./repair/platform" component: './repair/platform',
}, },
{ {
"name": "故障报修", name: '故障报修',
"path": "/repair/failure", path: '/repair/failure',
"icon": "", icon: '',
"component": "./repair/failure" component: './repair/failure',
}, },
{ {
"name": "维修工单", name: '维修工单',
"path": "/repair/order", path: '/repair/order',
"icon": "", icon: '',
"component": "./repair/order" component: './repair/order',
}, },
{ {
"name": "追踪工单", name: '追踪工单',
"path": "/repair/track", path: '/repair/track',
"icon": "", icon: '',
"component": "./repair/track" component: './repair/track',
}, },
{ {
"name": "外协工单", name: '外协工单',
"path": "/repair/outsourcing", path: '/repair/outsourcing',
"icon": "", icon: '',
"component": "./repair/outsourcing" component: './repair/outsourcing',
}, },
{ {
"name": "故障设置", name: '故障设置',
"path": "/repair/fault", path: '/repair/fault',
"icon": "", icon: '',
"component": "./repair/fault" component: './repair/fault',
} },
] ],
}, },
{ {
"name": "系统管理", name: '系统管理',
"path": "/system", path: '/system',
"icon": "desktop", icon: 'desktop',
"routes": [ routes: [
{ {
"name": "数据字典", name: '数据字典',
"path": "/system/dictionary", path: '/system/dictionary',
"icon": "", icon: '',
"component": "./system/dictionary" component: './system/dictionary',
}, },
{ {
"name": "扩展字段", name: '扩展字段',
"path": "/system/field", path: '/system/field',
"icon": "", icon: '',
"component": "./system/field" component: './system/field',
}, },
{ {
"name": "编号规则", name: '编号规则',
"path": "/system/rules", path: '/system/rules',
"icon": "", icon: '',
"component": "./system/rules" component: './system/rules',
}, },
{ {
"name": "推送配置", name: '推送配置',
"path": "/system/pushsetting", path: '/system/pushsetting',
"icon": "", icon: '',
"component": "./system/pushsetting" component: './system/pushsetting',
} },
] ],
}, },
{ {
"name": "备件管理", name: '备件管理',
"path": "/spare", path: '/spare',
"icon": "sliders", icon: 'sliders',
"routes": [ routes: [
{ {
"name": " 备件库存", name: ' 备件库存',
"path": "/spare/stock", path: '/spare/stock',
"icon": "", icon: '',
"component": "./spare/stock" component: './spare/stock',
}, },
{ {
"name": "入库管理", name: '入库管理',
"path": "/spare/instore", path: '/spare/instore',
"icon": "", icon: '',
"component": "./spare/instore" component: './spare/instore',
}, },
{ {
"name": "出库管理", name: '出库管理',
"path": "/spare/outstore", path: '/spare/outstore',
"icon": "", icon: '',
"component": "./spare/outstore" component: './spare/outstore',
}, },
{ {
"name": "出入库记录", name: '出入库记录',
"path": "/spare/record", path: '/spare/record',
"icon": "", icon: '',
"component": "./spare/record" component: './spare/record',
}, },
{ {
"name": "备件领用", name: '备件领用',
"path": "/spare/requisition", path: '/spare/requisition',
"icon": "", icon: '',
"component": "./spare/requisition" component: './spare/requisition',
}, },
{ {
"name": "备件回冲", name: '备件回冲',
"path": "/spare/spareback", path: '/spare/spareback',
"icon": "", icon: '',
"component": "./spare/spareback" component: './spare/spareback',
}, },
{ {
"name": " 线边库存", name: ' 线边库存',
"path": "/spare/edgestore", path: '/spare/edgestore',
"icon": "", icon: '',
"component": "./spare/edgestore" component: './spare/edgestore',
}, },
{ {
"name": "备件供应商", name: '备件供应商',
"path": "/spare/supplier", path: '/spare/supplier',
"icon": "", icon: '',
"component": "./spare/supplier" component: './spare/supplier',
}, },
{ {
"name": " 备件设置", name: '使用记录',
"path": "/spare/setting", path: '/spare/userecord',
"icon": "", icon: '',
"component": "./spare/setting" component: './spare/userecord',
} },
] {
}, name: '备件设置',
{ path: '/spare/setting',
"name": "点检管理", icon: '',
"path": "/check", component: './spare/setting',
"icon": "check-circle", },
"routes": [ ],
{ },
"name": " 点检标准", {
"path": "/check/standard", name: '点检管理',
"icon": "", path: '/check',
"component": "./check/standard" icon: 'check-circle',
}, routes: [
{ {
"name": "点检计划", name: ' 点检标准',
"path": "/check/plan", path: '/check/standard',
"icon": "", icon: '',
"component": "./check/plan" component: './check/standard',
}, },
{ {
"name": "点检接单", name: '点检计划',
"path": "/check/order", path: '/check/plan',
"icon": "", icon: '',
"component": "./check/order" component: './check/plan',
}, },
{ {
"name": "点检工单", name: '点检接单',
"path": "/check/task", path: '/check/order',
"icon": "", icon: '',
"component": "./check/task" component: './check/order',
} },
] {
}, name: '点检工单',
{ path: '/check/task',
"name": "保养管理", icon: '',
"path": "/maintain", component: './check/task',
"icon": "dashboard", },
"routes": [ ],
{ },
"name": "保养接单", {
"path": "/maintain/orders", name: '保养管理',
"icon": "", path: '/maintain',
"component": "./maintain/orders" icon: 'dashboard',
}, routes: [
{ {
"name": "保养工单", name: '保养接单',
"path": "/maintain/workOrder", path: '/maintain/orders',
"icon": "", icon: '',
"component": "./maintain/workOrder" component: './maintain/orders',
}, },
{ {
"name": " 保养标准", name: '保养工单',
"path": "/maintain/criterion", path: '/maintain/workOrder',
"icon": "", icon: '',
"component": "./maintain/criterion" component: './maintain/workOrder',
}, },
{ {
"name": "保养计划", name: ' 保养标准',
"path": "/maintain/plan", path: '/maintain/criterion',
"icon": "", icon: '',
"component": "./maintain/plan" component: './maintain/criterion',
} },
] {
}, name: '保养计划',
{ path: '/maintain/plan',
"name": "寿命件管理", icon: '',
"path": "/lifeparts", component: './maintain/plan',
"icon": "control", },
"routes": [ ],
{ },
"name": "寿命件台账", {
"path": "/lifeparts/count", name: '寿命件管理',
"icon": "", path: '/lifeparts',
"component": "./lifeparts/count" icon: 'control',
}, routes: [
{ {
"name": "寿命件预警", name: '寿命件台账',
"path": "/lifeparts/warning", path: '/lifeparts/count',
"icon": "", icon: '',
"component": "./lifeparts/warning" component: './lifeparts/count',
}, },
{ {
"name": "寿命件标准", name: '寿命件预警',
"path": "/lifeparts/criterion", path: '/lifeparts/warning',
"icon": "", icon: '',
"component": "./lifeparts/criterion" component: './lifeparts/warning',
} },
] {
} name: '寿命件标准',
]; path: '/lifeparts/criterion',
\ No newline at end of file icon: '',
component: './lifeparts/criterion',
},
],
},
];
...@@ -36,14 +36,14 @@ function Warning(props) { ...@@ -36,14 +36,14 @@ function Warning(props) {
const columns = [ const columns = [
{ {
title: '线边库', title: '线边库',
dataIndex: 'sparePartNo', dataIndex: 'stockName',
key: 'sparePartNo', key: 'stockName',
editable: false, editable: false,
}, },
{ {
title: '备件料号', title: '备件料号',
dataIndex: 'sparePartName', dataIndex: 'sparePartNo',
key: 'sparePartName', key: 'sparePartNo',
span: 3, span: 3,
editable: false, editable: false,
}, },
...@@ -56,22 +56,22 @@ function Warning(props) { ...@@ -56,22 +56,22 @@ function Warning(props) {
}, },
{ {
title: '供应商编号', title: '供应商编号',
dataIndex: 'sparePartName', dataIndex: 'supplierNo',
key: 'sparePartName', key: 'supplierNo',
span: 3, span: 3,
editable: false, editable: false,
}, },
{ {
title: '供应商名称', title: '供应商名称',
dataIndex: 'sparePartName', dataIndex: 'supplierName',
key: 'sparePartName', key: 'supplierName',
span: 3, span: 3,
editable: false, editable: false,
}, },
{ {
title: '可用数量', title: '可用数量',
dataIndex: 'sparePartName', dataIndex: 'usedStock',
key: 'sparePartName', key: 'usedStock',
search: false, search: false,
span: 3, span: 3,
editable: false, editable: false,
...@@ -83,8 +83,12 @@ function Warning(props) { ...@@ -83,8 +83,12 @@ function Warning(props) {
</div> </div>
), ),
search: false, search: false,
dataIndex: 'sparePartName', dataIndex: 'operateNum',
key: 'sparePartName', valueType: 'digit',
fieldProps: {
precision: 3,
},
key: 'operateNum',
span: 3, span: 3,
hideInForm: true, hideInForm: true,
}, },
...@@ -109,9 +113,15 @@ function Warning(props) { ...@@ -109,9 +113,15 @@ function Warning(props) {
columns, columns,
hideInSearch: true, hideInSearch: true,
hideInTable: true, hideInTable: true,
path: '/sparepart/sparePartSupplier/queryList', path: '/sparepart/lineStock/queryReplaceStock',
params: { status: 1 }, params: { lifePieceAccountId: drawer?.item?.id },
rowName: 'supplierList', rowName: 'supplierList',
rowSelection: {
type: 'checkbox',
getCheckboxProps: (record) => ({
disabled: record.isAsh == '1',
}),
},
}, },
]; ];
}); });
...@@ -248,7 +258,30 @@ function Warning(props) { ...@@ -248,7 +258,30 @@ function Warning(props) {
} }
}} }}
> >
<InitForm fields={changeColumns} /> <InitForm
fields={changeColumns}
onFinish={(vals) => {
console.log(vals);
if (vals.supplierList?.length == 0) {
return message.warning('请选择线边库存数据');
}
const lineStockUseList = vals?.supplierList?.map((it) => {
return {
lineStockId: it?.id,
operateNum: it?.operateNum,
};
});
for (let i of lineStockUseList) {
if (!i?.operateNum) {
return message.warning('请输入线边库存更换数量');
}
}
run({
url: '/sparepart/lifePieceAccount/replace',
params: { lineStockUseList, id: drawer?.item?.id },
});
}}
/>
</DrawerPro> </DrawerPro>
</div> </div>
); );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2023-02-17 13:36:11 * @Date: 2023-02-17 13:36:11
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2023-02-17 13:50:04 * @Last Modified time: 2023-02-20 13:29:45
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -40,14 +40,14 @@ function Warning(props) { ...@@ -40,14 +40,14 @@ function Warning(props) {
const columns = [ const columns = [
{ {
title: '线边库', title: '线边库',
dataIndex: 'sparePartNo', dataIndex: 'stockName',
key: 'sparePartNo', key: 'stockName',
editable: false, editable: false,
}, },
{ {
title: '备件料号', title: '备件料号',
dataIndex: 'sparePartName', dataIndex: 'sparePartNo',
key: 'sparePartName', key: 'sparePartNo',
span: 3, span: 3,
editable: false, editable: false,
}, },
...@@ -60,22 +60,22 @@ function Warning(props) { ...@@ -60,22 +60,22 @@ function Warning(props) {
}, },
{ {
title: '供应商编号', title: '供应商编号',
dataIndex: 'sparePartName', dataIndex: 'supplierNo',
key: 'sparePartName', key: 'supplierNo',
span: 3, span: 3,
editable: false, editable: false,
}, },
{ {
title: '供应商名称', title: '供应商名称',
dataIndex: 'sparePartName', dataIndex: 'supplierName',
key: 'sparePartName', key: 'supplierName',
span: 3, span: 3,
editable: false, editable: false,
}, },
{ {
title: '可用数量', title: '可用数量',
dataIndex: 'sparePartName', dataIndex: 'usedStock',
key: 'sparePartName', key: 'usedStock',
search: false, search: false,
span: 3, span: 3,
editable: false, editable: false,
...@@ -87,8 +87,12 @@ function Warning(props) { ...@@ -87,8 +87,12 @@ function Warning(props) {
</div> </div>
), ),
search: false, search: false,
dataIndex: 'sparePartName', dataIndex: 'operateNum',
key: 'sparePartName', valueType: 'digit',
fieldProps: {
precision: 3,
},
key: 'operateNum',
span: 3, span: 3,
hideInForm: true, hideInForm: true,
}, },
...@@ -113,9 +117,15 @@ function Warning(props) { ...@@ -113,9 +117,15 @@ function Warning(props) {
columns, columns,
hideInSearch: true, hideInSearch: true,
hideInTable: true, hideInTable: true,
path: '/sparepart/sparePartSupplier/queryList', path: '/sparepart/lineStock/queryReplaceStock',
params: { status: 1 }, params: { lifePieceAccountId: drawer?.item?.id },
rowName: 'supplierList', rowName: 'supplierList',
rowSelection: {
type: 'checkbox',
getCheckboxProps: (record) => ({
disabled: record.isAsh == '1',
}),
},
}, },
]; ];
}); });
...@@ -243,7 +253,30 @@ function Warning(props) { ...@@ -243,7 +253,30 @@ function Warning(props) {
} }
}} }}
> >
<InitForm fields={changeColumns} /> <InitForm
fields={changeColumns}
onFinish={(vals) => {
console.log(vals);
if (vals.supplierList?.length == 0) {
return message.warning('请选择线边库存数据');
}
const lineStockUseList = vals?.supplierList?.map((it) => {
return {
lineStockId: it?.id,
operateNum: it?.operateNum,
};
});
for (let i of lineStockUseList) {
if (!i?.operateNum) {
return message.warning('请输入线边库存更换数量');
}
}
run({
url: '/sparepart/lifePieceAccount/replace',
params: { lineStockUseList, id: drawer?.item?.id },
});
}}
/>
</DrawerPro> </DrawerPro>
</div> </div>
); );
......
function getcolumns(setdrawer) {
return {
columns: [
{
title: '操作时间',
dataIndex: 'operateTime',
key: 'operateTimeList',
valueType: 'dateTimeRange',
fieldProps: {
showTime: {
format: 'HH:mm',
},
format: 'YYYY-MM-DD HH:mm',
},
},
{
title: '操作人',
dataIndex: 'operateUserName',
key: 'operateUserId',
valueType: 'select',
fieldProps: {
dropdownMatchSelectWidth: 120,
showSearch: true,
},
options: {
path: '/auth/sysUser/selection',
params: {},
},
hideInSearch: false,
hideInTable: false,
},
{
title: '备件料号',
dataIndex: 'sparePartNo',
key: 'sparePartNo',
hideInSearch: false,
hideInTable: false,
},
{
title: '备件名称',
dataIndex: 'sparePartName',
key: 'sparePartName',
},
{
title: '供应商编号',
dataIndex: 'supplierNo',
key: 'supplierNo',
},
{
title: '供应商名称',
dataIndex: 'supplierName',
key: 'supplierName',
},
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
},
{
title: '使用数量',
dataIndex: 'operateNum',
key: 'operateNum',
search: false,
},
{
title: '使用类型',
dataIndex: 'operateTypeName',
key: 'operateType',
valueType: 'select',
fieldProps: {
dropdownMatchSelectWidth: 120,
},
options: [
{
value: '1',
label: '寿命件更换',
},
{
value: '2',
label: '维修使用',
},
{
value: '3',
label: '保养使用',
},
],
},
{
title: '相关单号',
dataIndex: 'relationNo',
key: 'relationNo',
},
],
pathconfig: {
enableadd: false,
enableedit: false,
enabledelete: false,
enabledetail: false,
add: '',
edit: '',
list: '/sparepart/lineStockAccess/queryList',
delete: '',
detail: '',
},
};
}
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';
function Record(props) {
let actionRef = useRef(),
formRef = useRef();
const [drawer, setdrawer] = useState({
open: false,
});
const pathconfig = useMemo(() => {
let pathconf = getcolumns(setdrawer)?.pathconfig ?? {};
return pathconf;
}, []);
const { run, loading } = useRequest(doFetch, {
manual: true,
onSuccess: (res, params) => {
if (res?.code == '0000') {
actionRef?.current?.reload();
setdrawer((s) => ({
...s,
open: false,
}));
}
},
});
const detail = (text, row, _, action) => {
return (
<PremButton
btn={{
size: 'small',
type: 'link',
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '详情',
val: 'detail',
title: '详细信息',
}));
},
}}
>
详情
</PremButton>
);
};
const edit = (text, row, _, action) => {
return (
<PremButton
btn={{
size: 'small',
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '编辑',
val: 'edit',
}));
},
}}
>
编辑
</PremButton>
);
};
const remove = (text, row, _, action) => {
return (
<PremButton
pop={{
title: '是否删除?',
okText: '确认',
cancelText: '取消',
onConfirm: () => {
run({ url: pathconfig?.delete || '/delete', params: { id: row?.id } });
},
}}
btn={{
size: 'small',
type: 'danger',
}}
>
删除
</PremButton>
);
};
const columns = useMemo(() => {
let defcolumn = getcolumns(setdrawer)?.columns;
return defcolumn;
}, []);
return (
<div style={{ position: 'relative' }}>
<AutoTable
pagetitle={<h3 className="page-title">使用记录</h3>}
columns={columns}
actionRef={actionRef}
path={pathconfig?.list || '/ngic-auth/sysUser/query/page'}
pageextra={pathconfig?.enableadd ? 'add' : null}
resizeable={false}
addconfig={{
// access: 'sysDepartment_save',
btn: {
disabled: false,
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
item: null,
title: '新增',
val: 'add',
}));
},
},
}}
/>
<DrawerPro
fields={columns}
params={{ id: drawer?.item?.id }}
formRef={formRef}
placement="right"
detailpath={pathconfig?.detail || null}
detailData={drawer?.item}
defaultFormValue={drawer?.item}
onClose={() => {
setdrawer((s) => ({
...s,
open: false,
}));
}}
{...drawer}
onFinish={(vals) => {
if (drawer?.val == 'add') {
run({ url: pathconfig?.add || '/add', params: { ...vals } });
} else if (drawer?.val == 'edit') {
run({ url: pathconfig?.edit || '/edit', params: { ...vals, id: drawer?.item?.id } });
}
}}
/>
</div>
);
}
export default Record;
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