Commit 7219878d authored by TZW's avatar TZW

11.9下午

parent 2e168ae0
......@@ -25,12 +25,31 @@ export default [
path: '/setting/factory',
component: './setting/factory',
},
{
name: '车间管理',
path: '/setting/workshop',
component: './setting/workshop',
},
{
name: '工段管理',
path: '/setting/section',
component: './setting/section',
},
{
name: '产线管理',
path: '/setting/production',
component: './setting/production',
},
],
},
{
name: "设备管理",
icon: 'BulbOutlined',
path: '/device',
routes: [{
name: '设备台账',
path: '/setting/account',
component: './setting/account',
}]
}
];
/* 工厂管理
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-09 14:44:44
*/
import * as React from 'react';
import { useState, useMemo, useRef } from 'react';
import DrawerPro from '@/components/DrawerPro';
......@@ -95,7 +102,7 @@ function Factory(props) {
let res = await doFetch({ url: urlParams.remove, params: { id: row.id } });
if (res.code === '0000') {
message.success('删除成功!');
setDraw((s) => ({
setDrawer((s) => ({
...s,
visible: false,
}));
......
function getcolumns(setdrawer) {
return [
{ title: '产线代码', dataIndex: 'productionLineCode', key: 'productionLineCode' },
{
title: '基础信息',
valueType: 'split',
title: '产线名称',
dataIndex: 'productionLineName',
key: 'productionLineName',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '用户名',
dataIndex: 'accountName',
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
initialValue: '默认值',
hideInForm: false,
search: false,
render: (text, row) => {
return (
<a
onClick={() => {
setdrawer?.((s) => ({
...s,
visible: true,
item: null,
title: '新增',
val: 'add',
}));
}}
>
{text}
</a>
);
},
title: '所属工厂',
dataIndex: 'factoryName',
key: 'factoryId',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select',
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
},
{
title: '姓名',
dataIndex: 'userName',
key: 'userId',
hideInForm: {
accountName: {
reverse: ['1', '2', '5'],
},
remark: ['3'],
},
search: false,
},
{
title: '额外信息',
valueType: 'split',
},
{
title: '联系电话',
dataIndex: 'telephone',
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
search: false,
},
{
title: '邮箱',
dataIndex: 'mailNo',
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
search: false,
},
{
title: '备注',
dataIndex: 'remark',
valueType: 'editor',
search: false,
colProps: { span: 24 },
initialValue: '<p>Hello <b>World!</b></p>',
},
{
title: '上传样式-图片',
dataIndex: 'uploadImage',
key: 'uploadImage',
valueType: 'uploadImage',
fieldProps: {
limit: 2,
},
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
title: '所属车间',
dataIndex: 'shopName',
key: 'shopName',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select',
options: { path: '/auth/sysShop/getShopSelectionByFactory', params: {} },
},
];
}
......
/* 产线管理
* @Author: Li Hanlin
* @Date: 2022-11-09 14:43:54
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-09 16:47:41
*/
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 { doFetch } from '@/utils/doFetch';
import { message } from 'antd';
function Production(props) {
function Section(props) {
const actionRef = useRef(),
formRef = useRef();
const [drawer, setdrawer] = useState({
visible: false,
});
const urlParams = {
save: '/auth/sysProductionLine/saveOrUpdate',
remove: '/auth/sysProductionLine/delete',
list: '/auth/sysProductionLine/queryPage',
detail: '/auth/sysProductionLine/getById',
};
const detail = (text, row, _, action) => {
return (
<PremButton
......@@ -44,9 +60,28 @@ function Production(props) {
setdrawer((s) => ({
...s,
visible: true,
item: row,
title: '编辑',
params: { id: row.id },
detailpath: urlParams.detail,
val: 'edit',
onFinish: async (vals) => {
let params = {
...vals,
};
let res = await doFetch({
url: urlParams.save,
params,
id: row.id,
});
if (res.code === '0000') {
message.success('新增成功!');
setdrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
},
}));
},
}}
......@@ -63,8 +98,16 @@ function Production(props) {
title: '是否删除该用户?',
okText: '确认',
cancelText: '取消',
onConfirm: () => {
alert(0);
onConfirm: async () => {
let res = await doFetch({ url: urlParams.remove, params: { id: row.id } });
if (res.code === '0000') {
message.success('删除成功!');
setdrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
},
}}
btn={{
......@@ -83,23 +126,19 @@ function Production(props) {
title: '操作',
valueType: 'option',
width: 150,
render: (text, row, _, action) => [
detail(text, row, _, action),
edit(text, row, _, action),
remove(text, row, _, action),
],
render: (text, row, _, action) => [edit(text, row, _, action), remove(text, row, _, action)],
});
}, []);
return (
<div style={{ position: 'relative' }}>
<AutoTable
pagetitle="产线管理"
pagetitle={<h3 className="page-title">产线管理</h3>}
columns={columns}
path="/ngic-auth/sysUser/query/page"
path={urlParams.list}
actionRef={actionRef}
pageextra={'add'}
resizeable={true}
resizeable={false}
addconfig={{
// access: 'sysDepartment_save',
btn: {
......@@ -111,6 +150,23 @@ function Production(props) {
item: null,
title: '新增',
val: 'add',
onFinish: async (vals) => {
let params = {
...vals,
};
let res = await doFetch({
url: urlParams.save,
params,
});
if (res.code === '0000') {
message.success('新增成功!');
setDraw((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
},
}));
},
},
......@@ -119,8 +175,9 @@ function Production(props) {
<DrawerPro
fields={columns}
detailpath="/ngic-auth/sysUser/query/detail"
params={{ id: drawer?.item?.id }}
// detailpath={urlParams.detail}
// params={{ id: drawer?.item?.id }}
defaultFormValue={drawer?.item ?? {}}
formRef={formRef}
placement="right"
onClose={() => {
......@@ -135,4 +192,4 @@ function Production(props) {
);
}
export default Production;
\ No newline at end of file
export default Section;
......@@ -18,10 +18,15 @@ function getcolumns(setdrawer) {
{
title: '所属车间',
dataIndex: 'shopName',
key: 'shopName',
key: 'shopId',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select',
options: { path: '/auth/sysShop/getShopSelectionByFactory', params: {} },
options: {
path: '/auth/sysShop/getShopSelectionByFactory',
linkParams: {
factoryId: 'factoryId', //key 后面如果存在value 则该value会在调用接口时format
},
},
},
];
}
......
/* 工段管理
* @Author: Li Hanlin
* @Date: 2022-11-09 14:43:54
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-09 16:48:08
*/
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 { doFetch } from '@/utils/doFetch';
import { message } from 'antd';
function Factory(props) {
function Section(props) {
const actionRef = useRef(),
formRef = useRef();
const [drawer, setdrawer] = useState({
......@@ -13,10 +22,10 @@ function Factory(props) {
});
const urlParams = {
save: '/auth/sysShop/saveOrUpdate',
remove: '/auth/sysShop/delete',
list: '/auth/sysShop/queryPage',
detail: '/auth/sysShop/getById',
save: '/auth/sysSection/saveOrUpdate',
remove: '/auth/sysSection/delete',
list: '/auth/sysSection/queryPage',
detail: '/auth/sysSection/getById',
};
const detail = (text, row, _, action) => {
......@@ -51,9 +60,28 @@ function Factory(props) {
setdrawer((s) => ({
...s,
visible: true,
item: row,
title: '编辑',
params: { id: row.id },
detailpath: '/auth/sysSection/getById',
val: 'edit',
onFinish: async (vals) => {
let params = {
...vals,
};
let res = await doFetch({
url: urlParams.save,
params,
id: row.id,
});
if (res.code === '0000') {
message.success('新增成功!');
setdrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
},
}));
},
}}
......@@ -74,7 +102,7 @@ function Factory(props) {
let res = await doFetch({ url: urlParams.remove, params: { id: row.id } });
if (res.code === '0000') {
message.success('删除成功!');
setDraw((s) => ({
setdrawer((s) => ({
...s,
visible: false,
}));
......@@ -105,7 +133,7 @@ function Factory(props) {
return (
<div style={{ position: 'relative' }}>
<AutoTable
pagetitle="车间管理"
pagetitle={<h3 className="page-title">工段管理</h3>}
columns={columns}
path={urlParams.list}
actionRef={actionRef}
......@@ -147,8 +175,9 @@ function Factory(props) {
<DrawerPro
fields={columns}
detailpath={urlParams.detail}
params={{ id: drawer?.item?.id }}
// detailpath={urlParams.detail}
// params={{ id: drawer?.item?.id }}
defaultFormValue={drawer?.item ?? {}}
formRef={formRef}
placement="right"
onClose={() => {
......@@ -163,4 +192,4 @@ function Factory(props) {
);
}
export default Factory;
export default Section;
......@@ -15,9 +15,9 @@ function getcolumns(setdrawer) {
{
title: '所属工厂名称',
dataIndex: 'factoryName',
key: 'factoryCode',
key: 'factoryId',
valueType: 'select',
options: { path: '/auth/sysShop/queryPage', params: {} },
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
];
......
/* 车间管理
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:18
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-09 14:44:18
*/
import * as React from 'react';
import { useState, useMemo, useRef } from 'react';
import DrawerPro from '@/components/DrawerPro';
......@@ -56,6 +63,24 @@ function Factory(props) {
item: row,
title: '编辑',
val: 'edit',
onFinish: async (vals) => {
let params = {
...vals,
id: row.id,
};
let res = await doFetch({
url: urlParams.save,
params,
});
if (res.code === '0000') {
message.success('编辑成功!');
setdrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
},
}));
},
}}
......@@ -69,14 +94,14 @@ function Factory(props) {
return (
<PremButton
pop={{
title: '是否删除该用户?',
title: '是否删除该车间?',
okText: '确认',
cancelText: '取消',
onConfirm: async () => {
let res = await doFetch({ url: urlParams.remove, params: { id: row.id } });
if (res.code === '0000') {
message.success('删除成功!');
setDraw((s) => ({
setdrawer((s) => ({
...s,
visible: false,
}));
......@@ -151,6 +176,7 @@ function Factory(props) {
fields={columns}
// detailpath={urlParams.detail}
// params={{ id: drawer?.item?.id }}
defaultFormValue={drawer?.item ?? {}}
formRef={formRef}
placement="right"
onClose={() => {
......
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