@@ -0,0 +1,133 @@ | |||
import { request } from '@umijs/max'; | |||
// 工艺 | |||
export default { | |||
/** | |||
* 新增 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Add(parms: CraftsTypes.Info) { | |||
return request('/api/craftsinfo/add', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 删除 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Del(parms: CraftsTypes.craftsInfoDelInput) { | |||
return request(`/api/craftsinfo/del`, { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 修改 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Update(parms: CraftsTypes.Info) { | |||
return request('/api/craftsinfo/update', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 详情 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Detail(id: string) { | |||
return request(`/api/craftsinfo/detail?id=${id}`, { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 获取列表 | |||
* @param parms | |||
* @returns | |||
*/ | |||
List() { | |||
return request('/api/craftsinfo/list', { | |||
method: 'POST' | |||
}); | |||
}, | |||
/** | |||
* 未绑定的设备列表 | |||
* @param parms | |||
* @returns | |||
*/ | |||
UnBindList() { | |||
return request('/api/craftsinfo/UnBindList', { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 分页查询 | |||
* @param parms | |||
* @returns | |||
*/ | |||
PagedList(parms: CraftsTypes.Page) { | |||
return request('/api/craftsinfo/pagedlist', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 批量更新 | |||
* @param parms | |||
* @returns | |||
*/ | |||
BatchUpdate(parms: CraftsTypes.BatchAdd) { | |||
return request('/api/craftsrecipe/batchupdate', { | |||
method: 'POST', | |||
data: parms | |||
}); | |||
}, | |||
/** | |||
* 根据设备Id查询配方信息 | |||
* @param parms | |||
* @returns | |||
*/ | |||
RecipeList(id: string) { | |||
return request(' api/craftsrecipe/list', { | |||
method: 'POST', | |||
data: { | |||
craftsId: id | |||
} | |||
}); | |||
}, | |||
// 根据桶id查询桶的物料记录 | |||
materialtrecored(parms: CraftsTypes.craftsMaterialsRecordQueryPageInput) { | |||
return request('/api/craftsmaterialsrecord/pagedlist', { | |||
method: 'POST', | |||
data: { ...parms } | |||
}) | |||
}, | |||
// 下拉 | |||
selectlist() { | |||
return request('/api/craftssteps/selectlist', { | |||
method: 'GET', | |||
}) | |||
} | |||
} | |||
@@ -2,7 +2,7 @@ import { request } from '@umijs/max'; | |||
export default { | |||
//创建 | |||
//创建分组 | |||
Add(parms: GroupInfoTypes.Info) { | |||
return request('/api/groupinfo/add', { | |||
method: 'POST', | |||
@@ -50,7 +50,9 @@ export default { | |||
method:'GET' | |||
}) | |||
}, | |||
/** | |||
* 分页查询 | |||
* @param parms | |||
@@ -0,0 +1,60 @@ | |||
import { request } from '@umijs/max'; | |||
export default { | |||
//创建产线 | |||
Add(parms: ProductlineTypes.Info) { | |||
return request('/api/productline/add', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//删除 | |||
Del(parms: ProductlineTypes.Info) { | |||
return request(`/api/productline/del`, { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//修改 | |||
Update(parms: ProductlineTypes.Info) { | |||
return request('/api/productline/update', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//列表 | |||
List() { | |||
return request('/api/productline/list', { | |||
method: 'GET', | |||
}); | |||
}, | |||
/** | |||
* 分页查询 | |||
* @param parms | |||
* @returns | |||
*/ | |||
PagedList(parms: ProductlineTypes.Page) { | |||
return request('/api/productline/pagedlist', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
// 下拉列表 | |||
selectlist() { | |||
return request('/api/productline/selectlist', { | |||
method: 'GET', | |||
}); | |||
} | |||
} | |||
@@ -78,6 +78,13 @@ export default { | |||
method: 'POST', | |||
data: parms | |||
}); | |||
}, | |||
// 下拉 | |||
selectlist() { | |||
return request('/api/recipesinfo/selectlist', { | |||
method: 'GET', | |||
}) | |||
} | |||
} | |||
@@ -47,11 +47,13 @@ const bucket = () => { | |||
tip: '规则名称是唯一的 key', | |||
hideInSearch: true, | |||
hideInTable: true, | |||
}, | |||
{ | |||
title: '桶名称', | |||
dataIndex: 'name', | |||
ellipsis: true, | |||
align:'center', | |||
}, | |||
{ | |||
@@ -59,18 +61,19 @@ const bucket = () => { | |||
dataIndex: 'code', | |||
hideInSearch: true, | |||
ellipsis: true, | |||
align:'center', | |||
}, | |||
{ | |||
title: '当前原料', | |||
dataIndex: 'des', | |||
ellipsis: true, | |||
hideInSearch: true, | |||
align:'center', | |||
}, | |||
{ | |||
title: '桶二维码', | |||
dataIndex: 'type', | |||
align:'center', | |||
ellipsis: true, | |||
hideInSearch: true, | |||
width:160, | |||
@@ -451,7 +454,7 @@ const bucket = () => { | |||
</div> | |||
<div className='right'> | |||
<div id="myqrcode" > | |||
<QRCode value={information.code} style={{ border: 'none' }} /> | |||
<QRCode value={information?.code} style={{ border: 'none' }} /> | |||
</div> | |||
</div> | |||
@@ -3,11 +3,14 @@ | |||
import type { ActionType, ProColumns } from '@ant-design/pro-components'; | |||
import { ProTable } from '@ant-design/pro-components'; | |||
import { Button, Modal, Form, Input, message, Popconfirm, TreeSelect, Select, Tag, Dropdown, Space, MenuProps } from 'antd'; | |||
import { useRef, useState } from 'react'; | |||
import { useEffect, useRef, useState } from 'react'; | |||
import finalInfoAPI from '@/api/finalService'; | |||
import { DownOutlined } from '@ant-design/icons'; | |||
import FormItem from 'antd/lib/form/FormItem'; | |||
import { ItemType } from 'rc-menu/lib/interface'; | |||
import craftsinfoAPI from '@/api/craftsinfo'; | |||
// 配方服务 | |||
import recipeAPI from '@/api/recipeService'; | |||
const final = () => { | |||
@@ -79,13 +82,13 @@ const final = () => { | |||
> | |||
编辑 | |||
</Button>, | |||
<Popconfirm | |||
key="del" | |||
title="确定要删除此条数据吗?" | |||
onConfirm={() => { | |||
const EnablejsonData: FinalTypes.Info = { | |||
const EnablejsonData: FinalTypes.FinalInfoDelInput = { | |||
id: record.id, | |||
// name: '', | |||
// code: '' | |||
@@ -109,6 +112,26 @@ const final = () => { | |||
], | |||
}, | |||
]; | |||
// eslint-disable-next-line react-hooks/rules-of-hooks | |||
useEffect(() => { | |||
// 下拉列表信息 | |||
const areasList = async () => { | |||
const data = await recipeAPI.selectlist(); | |||
console.log(data); | |||
// eslint-disable-next-line @typescript-eslint/no-use-before-define | |||
setareas(data.data); | |||
}; | |||
areasList(); | |||
}, []); | |||
const OnSubmit = async (values: FinalTypes.Info) => { | |||
if (values.id) { | |||
@@ -118,7 +141,7 @@ const final = () => { | |||
actionRef.current?.reload(); | |||
setIsModalOpen(false); | |||
} else { | |||
message.error(JSON.stringify(response.errors) || '修改失败'); | |||
message.error(JSON.stringify(response.errors) || '修改失败'); | |||
} | |||
} else { | |||
const response = await finalInfoAPI.Add(values); | |||
@@ -128,32 +151,26 @@ const final = () => { | |||
actionRef.current?.reload(); | |||
setIsModalOpen(false); | |||
} else { | |||
message.error(JSON.stringify(response.errors) || '添加失败'); | |||
message.error(JSON.stringify(response.errors) || '添加失败'); | |||
} | |||
} | |||
}; | |||
// 定义工艺列表 | |||
// const areas = [ | |||
// { label: '工艺1', value: '工艺1' }, | |||
// { label: '工艺2', value: '工艺1' }, | |||
// ]; | |||
// 定义配方列表的数据 | |||
// const item: MenuProps['items'] = [ | |||
// { | |||
// label: 'hini', | |||
// key: '1', | |||
// }, | |||
// { | |||
// label: 'eer ', | |||
// key: '2', | |||
// } | |||
// 定义配方列表 | |||
const [areas, setareas] = useState([]) | |||
// const formula = [ | |||
// { label: '配方1', value: '配方1' }, | |||
// { label: '配方2', value: '配方1' }, | |||
// ]; | |||
// 定义工艺列表 | |||
const areas = [ | |||
{ label: '工艺1', value: '工艺1' }, | |||
{ label: '工艺2', value: '工艺1' }, | |||
]; | |||
// 定义配方列表 | |||
const formula = [ | |||
{ label: '配方1', value: '配方1' }, | |||
{ label: '配方2', value: '配方1' }, | |||
]; | |||
return ( | |||
<> | |||
<ProTable<FinalTypes.Info> | |||
@@ -206,8 +223,8 @@ const formula = [ | |||
</Button>, | |||
]} | |||
/> | |||
{/* 新增成品的model弹窗 */} | |||
@@ -256,22 +273,28 @@ const formula = [ | |||
> | |||
<Input /> | |||
</Form.Item> | |||
<Form.Item name="name" label="成品名称" rules={[{ required: true, message: 'Missing area' }]}> | |||
<Input /> | |||
<Input /> | |||
</Form.Item> | |||
{/* 工艺列表 */} | |||
<Form.Item name="craftId" label="成品工艺" rules={[{ required: true, message: 'Missing area' }]}> | |||
<Select options={areas} /> | |||
{/* <Select options={areas} /> */} | |||
<Select placeholder="请选择工艺"> | |||
</Select> | |||
</Form.Item> | |||
{/* 配方列表 */} | |||
<Form.Item name="recipeId" label="成品配方" rules={[{ required: true, message: 'Missing area' }]}> | |||
<Select options={formula} /> | |||
<Form.Item name="recipeId" label="成品配方" rules={[{ required: true, message: 'Missing area' }]}> | |||
{/* <Select options={formula} /> */} | |||
<Select placeholder="请选择配方" | |||
options={areas} | |||
/> | |||
</Form.Item> | |||
@@ -4,7 +4,7 @@ import { ProTable } from '@ant-design/pro-components'; | |||
import { Button, Modal, Form, Input, message, Popconfirm, Tag, QRCode, Table } from 'antd'; | |||
import { useRef, useState } from 'react'; | |||
import type { ColumnsType } from 'antd/es/table'; | |||
import DeviceInfoAPI from '@/api/DeviceInfo'; | |||
import groupInfoAPI from '@/api/groupService'; | |||
const group = () => { | |||
// 4.定义编辑/新增的弹窗 | |||
// eslint-disable-next-line react-hooks/rules-of-hooks | |||
@@ -21,7 +21,7 @@ const group = () => { | |||
const [typeForm] = Form.useForm(); | |||
// 1.定义列 | |||
const columns: ProColumns<DeviceTypes.Info>[] = [ | |||
const columns: ProColumns<GroupInfoTypes.Info>[] = [ | |||
{ | |||
title: 'id', | |||
dataIndex: 'id', | |||
@@ -39,7 +39,7 @@ const group = () => { | |||
{ | |||
title: '分组描述', | |||
dataIndex: 'code', | |||
dataIndex: 'des', | |||
hideInSearch: true, | |||
ellipsis: true, | |||
align: 'center' | |||
@@ -75,13 +75,13 @@ const group = () => { | |||
title="确定要删除此条数据吗?" | |||
onConfirm={() => { | |||
const EnablejsonData: DeviceTypes.Info = { | |||
const EnablejsonData: GroupInfoTypes.Info = { | |||
id: record.id, | |||
name: '', | |||
code: '' | |||
}; | |||
DeviceInfoAPI.Del(EnablejsonData).then((r) => { | |||
groupInfoAPI.Del(EnablejsonData).then((r) => { | |||
if (r.statusCode === 200) { | |||
message.success(r.statusCode === 200 ? '删除成功' : r.message); | |||
actionRef.current?.reload(); | |||
@@ -104,10 +104,10 @@ const group = () => { | |||
// 7.定义表单提交 | |||
// 表单提交 | |||
const OnSubmit = async (values: DeviceTypes.Info) => { | |||
const OnSubmit = async (values: GroupInfoTypes.Info) => { | |||
if (values.id) { | |||
const response = await DeviceInfoAPI.Update(values); | |||
const response = await groupInfoAPI.Update(values); | |||
if (response.statusCode === 200) { | |||
message.success('修改成功'); | |||
actionRef.current?.reload(); | |||
@@ -116,7 +116,7 @@ const group = () => { | |||
message.error(JSON.stringify(response.errors) || '修改失败'); | |||
} | |||
} else { | |||
const response = await DeviceInfoAPI.Add(values); | |||
const response = await groupInfoAPI.Add(values); | |||
console.log('response', response); | |||
if (response.statusCode === 200) { | |||
message.success('添加成功'); | |||
@@ -132,7 +132,7 @@ const group = () => { | |||
return ( | |||
<> | |||
{/* 2.列的展现 */} | |||
<ProTable<DeviceTypes.Info> | |||
<ProTable<GroupInfoTypes.Info> | |||
key="myTable" | |||
columns={columns} | |||
@@ -140,14 +140,14 @@ const group = () => { | |||
cardBordered | |||
// 3.调用列接口 | |||
request={async (params = {}) => { | |||
const jsonData: DeviceTypes.Page = { | |||
const jsonData: GroupInfoTypes.Page = { | |||
pageIndex: params.current || 1, | |||
pageSize: params.pageSize || 10, | |||
name: params.name || '', | |||
id: '', | |||
code: '' | |||
}; | |||
const response = await DeviceInfoAPI.PagedList(jsonData); | |||
const response = await groupInfoAPI.PagedList(jsonData); | |||
if (response.statusCode === 200) { | |||
return { | |||
data: response.data.items, | |||
@@ -231,7 +231,7 @@ const group = () => { | |||
> | |||
<Input /> | |||
</Form.Item> | |||
<Form.Item label="分组描述" name="code" rules={[{ required: true, message: '此项为必填项!' }]} > | |||
<Form.Item label="分组描述" name="des" rules={[{ required: true, message: '此项为必填项!' }]} > | |||
<Input /> | |||
</Form.Item> | |||
@@ -1,3 +1,4 @@ | |||
/* eslint-disable array-callback-return */ | |||
// 产线管理 | |||
import { ActionType, EditableFormInstance, EditableProTable, ProCard, ProColumns } from '@ant-design/pro-components'; | |||
@@ -7,11 +8,18 @@ import { useEffect, useRef, useState } from 'react'; | |||
import RecipeInfoAPI from '@/api/recipeService' | |||
// import MaterialsInfoAPI from '@/api/materialService' | |||
import GroupInfoAPI from '@/api/groupService' | |||
import DeviceInfoAPI from '@/api/DeviceInfo' | |||
import StockInfoAPI from '@/api/StockService'; | |||
import ProductlineInfoAPI from '@/api/productlineService' | |||
import { LoadingOutlined, RedoOutlined, PlusSquareOutlined, EditOutlined } from '@ant-design/icons'; | |||
// import { RcFile, UploadChangeParam, UploadFile } from 'antd/es/upload'; | |||
// import { history } from '@umijs/max'; | |||
import styles from './index.less' | |||
const { Option } = Select; | |||
const { Option } = Select; | |||
const Index = () => { | |||
//表单 | |||
@@ -34,10 +42,12 @@ const Index = () => { | |||
const [isModalGroupFormOpen, setIsModalGroupFormOpen] = useState(false); | |||
const [selectGroup, setSelectGroup] = useState(0) | |||
const [recipeparams, setRecipeparams] = useState<any>(); | |||
const [GroupList, setGroupList] = useState<GroupInfoTypes.Info[]>([{ | |||
const [GroupList, setGroupList] = useState<ProductlineTypes.Info[]>([{ | |||
id: '-1', | |||
name: '全部', | |||
des: '全部' | |||
describe: '全部', | |||
code:'ff' | |||
}]); | |||
// const [selectRowItem, setSelectRowItem] = useState<any>(); | |||
// const [materiallist, setMateriallist] = useState<RecipeMaterialTypes.Info[]>([]); | |||
@@ -49,12 +59,12 @@ const Index = () => { | |||
// const editactionformRef = useRef<EditableFormInstance>(); | |||
// const editactionRef = useRef<ActionType>(); | |||
const [groupForm] = Form.useForm(); | |||
const [GroupEditForm] = Form.useForm(); | |||
const [ProductlineEditForm] = Form.useForm(); | |||
//设备成功方法 | |||
const OnSubmit = async (values: RecipeTypes.Info) => { | |||
const OnSubmit = async (values: DeviceTypes.DeviceInfoOutput) => { | |||
// values.picUrl = imageUrl!; | |||
if (values.id) { | |||
const response = await RecipeInfoAPI.Update(values); | |||
const response = await DeviceInfoAPI.Update(values); | |||
if (response.statusCode === 200) { | |||
message.success('修改成功'); | |||
actionRef.current?.reload(); | |||
@@ -63,10 +73,10 @@ const Index = () => { | |||
message.error(response.errors || '修改失败'); | |||
} | |||
} else { | |||
const response = await RecipeInfoAPI.Add(values); | |||
const response = await DeviceInfoAPI.Add(values); | |||
if (response.statusCode === 200) { | |||
message.success('添加成功'); | |||
actionRef.current?.reload(); | |||
setIsModalOpen(false); | |||
} else { | |||
@@ -77,20 +87,20 @@ const Index = () => { | |||
// 料仓成功 | |||
const submission = async (values: RecipeTypes.Info) => { | |||
const submission = async (values: StockTypes.StockInfoOutput) => { | |||
// values.picUrl = imageUrl!; | |||
if (values.id) { | |||
const response = await RecipeInfoAPI.Update(values); | |||
const response = await StockInfoAPI.Update(values); | |||
if (response.statusCode === 200) { | |||
message.success('修改成功'); | |||
actionRef.current?.reload(); | |||
setbinModelopen(false); | |||
} else { | |||
message.error(response.errors || '修改失败'); | |||
} | |||
} else { | |||
const response = await RecipeInfoAPI.Add(values); | |||
const response = await StockInfoAPI.Add(values); | |||
if (response.statusCode === 200) { | |||
message.success('添加成功'); | |||
actionRef.current?.reload(); | |||
@@ -130,10 +140,17 @@ const Index = () => { | |||
// </div> | |||
// ) | |||
//表单名 | |||
const columns: ProColumns<RecipeTypes.Info>[] = [ | |||
const columns: ProColumns<DeviceTypes.DeviceInfoOutput>[] = [ | |||
{ | |||
title: 'id', | |||
dataIndex: 'id', | |||
tip: '规则名称是唯一的 key', | |||
hideInSearch: true, | |||
hideInTable: true, | |||
}, | |||
{ | |||
title: '设备名称', | |||
dataIndex: 'code', | |||
dataIndex: 'name', | |||
width: 200, | |||
align: 'center', | |||
hideInSearch: true, | |||
@@ -145,7 +162,7 @@ const Index = () => { | |||
{ | |||
title: '设备功能', | |||
width: 200, | |||
dataIndex: 'name', | |||
dataIndex: 'gn', | |||
align: 'center', | |||
}, | |||
{ | |||
@@ -160,7 +177,7 @@ const Index = () => { | |||
}, | |||
{ | |||
title: '设备类型', | |||
dataIndex: 'code', | |||
dataIndex: 'deviceType', | |||
align: 'center', | |||
width: 100, | |||
hideInSearch: true | |||
@@ -170,7 +187,7 @@ const Index = () => { | |||
align: 'center', | |||
width: 40, | |||
valueType: 'option', | |||
key: 'option', | |||
render: (_, record) => [ | |||
@@ -251,14 +268,15 @@ const Index = () => { | |||
key="del" | |||
title="确定要删除此条数据吗?" | |||
onConfirm={() => { | |||
const delData: RecipeTypes.Info = { | |||
const delData: ProductlineTypes.Info = { | |||
id: record.id, | |||
name: '', | |||
code: '', | |||
picUrl: '', | |||
groupId: '' | |||
// picUrl: '', | |||
// groupId: '' | |||
describe:'', | |||
}; | |||
RecipeInfoAPI.Del(delData).then((r) => { | |||
ProductlineInfoAPI.Del(delData).then((r) => { | |||
if (r.statusCode === 200) { | |||
message.success(r.statusCode === 200 ? '删除成功' : r.message); | |||
actionRef.current?.reload(); | |||
@@ -279,10 +297,17 @@ const Index = () => { | |||
]; | |||
// 料仓列表 | |||
const list: ProColumns<RecipeTypes.Info>[] = [ | |||
const list: ProColumns<StockTypes.Info>[] = [ | |||
{ | |||
title: 'id', | |||
dataIndex: 'id', | |||
tip: '规则名称是唯一的 key', | |||
hideInSearch: true, | |||
hideInTable: true, | |||
}, | |||
{ | |||
title: '料仓名称', | |||
dataIndex: 'code', | |||
dataIndex: 'name', | |||
width: 200, | |||
align: 'center', | |||
// hideInSearch: true, | |||
@@ -294,7 +319,7 @@ const Index = () => { | |||
{ | |||
title: '料仓剩余', | |||
width: 200, | |||
dataIndex: 'name', | |||
dataIndex: 'des', | |||
align: 'center', | |||
hideInSearch: true, | |||
@@ -433,15 +458,15 @@ const Index = () => { | |||
// 获取分组数据 | |||
// 获取产线的数据 | |||
const GetGroupList = () => { | |||
GroupInfoAPI.List().then((res: MyResponse.Content) => { | |||
ProductlineInfoAPI.List().then((res: MyResponse.Content) => { | |||
if (res.statusCode === 200) { | |||
res.data.unshift( | |||
{ | |||
id: '-1', | |||
code: '', | |||
name: '全部', | |||
des: '全部' | |||
describe: '' | |||
} | |||
) | |||
setGroupList(res.data) | |||
@@ -467,7 +492,7 @@ const Index = () => { | |||
// 修改分组数据 | |||
const OnGroupEditSubmit = (value: GroupInfoTypes.Info) => { | |||
if (value.id) { | |||
GroupInfoAPI.Update(value).then((res: MyResponse.Content) => { | |||
ProductlineInfoAPI.Update(value).then((res: MyResponse.Content) => { | |||
if (res.statusCode) { | |||
message.success("修改成功"); | |||
setIsModalGroupFormOpen(false); | |||
@@ -477,7 +502,7 @@ const Index = () => { | |||
} | |||
}) | |||
} else { | |||
GroupInfoAPI.Add(value).then((res: MyResponse.Content) => { | |||
ProductlineInfoAPI.Add(value).then((res: MyResponse.Content) => { | |||
if (res.statusCode) { | |||
message.success("新增成功"); | |||
setIsModalGroupFormOpen(false); | |||
@@ -488,7 +513,7 @@ const Index = () => { | |||
} | |||
}) | |||
} | |||
GroupEditForm.resetFields(); | |||
ProductlineEditForm.resetFields(); | |||
} | |||
useEffect(() => { | |||
GetGroupList(); | |||
@@ -620,7 +645,7 @@ const Index = () => { | |||
<Button type='primary' | |||
onClick={() => { | |||
setIsModalGroupFormOpen(true) | |||
GroupEditForm.resetFields(); | |||
ProductlineEditForm.resetFields(); | |||
}}><PlusSquareOutlined /> 新增产线</Button> | |||
<Button onClick={() => { | |||
GetGroupList() | |||
@@ -640,7 +665,7 @@ const Index = () => { | |||
{item.id === "-1" ? '' : <div className={styles.tag_item_editicon}><EditOutlined style={{ fontSize: '20px' }} title='修改名称' onClick={(e) => { | |||
e.stopPropagation(); | |||
const copyFormData = JSON.parse(JSON.stringify(GroupList[index])); | |||
GroupEditForm.setFieldsValue(copyFormData); | |||
ProductlineEditForm.setFieldsValue(copyFormData); | |||
setIsModalGroupFormOpen(true) | |||
}} twoToneColor="#eb2f96"></EditOutlined></div>} | |||
</Space> | |||
@@ -652,7 +677,7 @@ const Index = () => { | |||
</Col> | |||
<Col flex={4} > | |||
{/* 设备列表 */} | |||
<ProTable<RecipeTypes.Info> | |||
<ProTable<DeviceTypes.Info> | |||
key="myTable" | |||
columns={columns} | |||
actionRef={actionRef} | |||
@@ -663,7 +688,7 @@ const Index = () => { | |||
request={async (params = {}) => { | |||
console.log('params', params); | |||
const jsonData: RecipeTypes.Page = { | |||
const jsonData: DeviceTypes.Page = { | |||
pageIndex: params.current || 1, | |||
pageSize: params.pageSize || 4, | |||
name: params.name || '', | |||
@@ -672,7 +697,7 @@ const Index = () => { | |||
picUrl: '', | |||
groupId: params.groupId | |||
}; | |||
const response = await RecipeInfoAPI.PagedList(jsonData); | |||
const response = await DeviceInfoAPI.PagedList(jsonData); | |||
if (response.statusCode === 200) { | |||
return { | |||
data: response.data.items, | |||
@@ -710,7 +735,7 @@ const Index = () => { | |||
/> | |||
<Col style={{ height: 20 }}></Col> | |||
{/* 料仓列表 */} | |||
<ProTable<RecipeTypes.Info> | |||
<ProTable<StockTypes.Info> | |||
key="myTable2" | |||
columns={list} | |||
actionRef={actionRef} | |||
@@ -719,7 +744,7 @@ const Index = () => { | |||
request={async (params = {}) => { | |||
console.log('params', params); | |||
const jsonData: RecipeTypes.Page = { | |||
const jsonData: StockTypes.Page = { | |||
pageIndex: params.current || 1, | |||
pageSize: params.pageSize || 4, | |||
name: params.name || '', | |||
@@ -728,7 +753,7 @@ const Index = () => { | |||
picUrl: '', | |||
groupId: params.groupId | |||
}; | |||
const response = await RecipeInfoAPI.PagedList(jsonData); | |||
const response = await StockInfoAPI.PagedList(jsonData); | |||
if (response.statusCode === 200) { | |||
return { | |||
data: response.data.items, | |||
@@ -758,7 +783,7 @@ const Index = () => { | |||
onClick={() => { | |||
binForm.resetFields(); | |||
setbinModelopen(true); | |||
}} | |||
> | |||
@@ -794,7 +819,7 @@ const Index = () => { | |||
> | |||
返回 | |||
</Button>, | |||
<Button key="submit" form="myForm" type="primary" htmlType="submit"> | |||
<Button key="submit" form="manufacturingForm" type="primary" htmlType="submit"> | |||
提交 | |||
</Button>, | |||
]} | |||
@@ -807,9 +832,9 @@ const Index = () => { | |||
wrapperCol={{ span: 12 }} | |||
onFinish={OnSubmit} | |||
autoComplete="off" | |||
> | |||
<Form.Item label="id" name="id" hidden> | |||
<Input /> | |||
@@ -895,12 +920,12 @@ const Index = () => { | |||
{/* 料仓绑定 */} | |||
{/* 料仓绑定 */} | |||
<Modal | |||
key="02" | |||
width={600} | |||
title={<Tag color="#cd201f">料仓绑定</Tag>} | |||
open={binModelopen} | |||
onCancel={() => { | |||
setbinModelopen(false); | |||
@@ -910,14 +935,14 @@ const Index = () => { | |||
key="back2" | |||
onClick={() => { | |||
setbinModelopen(false); | |||
}} | |||
> | |||
返回 | |||
</Button>, | |||
<Button key="submit" form="binForm" type="primary" htmlType="submit"> | |||
提交 | |||
</Button>, | |||
]} | |||
> | |||
@@ -940,7 +965,7 @@ const Index = () => { | |||
> | |||
<Input /> | |||
</Form.Item> | |||
<Form.Item name="groupId" label="当前产线" > | |||
<Select | |||
@@ -967,9 +992,9 @@ const Index = () => { | |||
{ | |||
/* | |||
* 配置物料与工艺的弹框 | |||
*/} | |||
/* | |||
* 配置物料与工艺的弹框 | |||
*/} | |||
{/* <Modal | |||
key="02" | |||
width={1200} | |||
@@ -1066,7 +1091,7 @@ const Index = () => { | |||
destroyOnClose | |||
title={<Tag color='#cd201f'>新增产线</Tag>} | |||
onCancel={() => { | |||
GroupEditForm.resetFields(); | |||
ProductlineEditForm.resetFields(); | |||
setIsModalGroupFormOpen(false) | |||
}} | |||
footer={[ | |||
@@ -1074,13 +1099,13 @@ const Index = () => { | |||
key="del" | |||
title="确定要删除此条数据吗?" | |||
onConfirm={() => { | |||
console.log('sss', GroupEditForm.getFieldValue('id')); | |||
const delJosnData: GroupInfoTypes.Info = { | |||
id: GroupEditForm.getFieldValue('id'), | |||
console.log('sss', ProductlineEditForm.getFieldValue('id')); | |||
const delJosnData: ProductlineTypes.ProductlineInfoDelInput = { | |||
id: ProductlineEditForm.getFieldValue('id'), | |||
name: '', | |||
des: '' | |||
}; | |||
GroupInfoAPI.Del(delJosnData).then((res: MyResponse.Content) => { | |||
ProductlineInfoAPI.Del(delJosnData).then((res: MyResponse.Content) => { | |||
if (res.statusCode === 200) { | |||
message.success("删除成功!"); | |||
setIsModalGroupFormOpen(false); | |||
@@ -1099,16 +1124,16 @@ const Index = () => { | |||
删除分组 | |||
</Button> | |||
</Popconfirm>, | |||
<Button key="submit2" form="groupEditForm" type="primary" htmlType="submit"> | |||
<Button key="submit2" form="ProductlineEditForm" type="primary" htmlType="submit"> | |||
提交 | |||
</Button>, | |||
]} | |||
> | |||
{/* 新增产线的表单 */} | |||
<Form | |||
form={GroupEditForm} | |||
form={ProductlineEditForm} | |||
name="basic" | |||
id="groupEditForm" | |||
id="ProductlineEditForm" | |||
labelCol={{ span: 4 }} | |||
wrapperCol={{ span: 12 }} | |||
onFinish={OnGroupEditSubmit} | |||
@@ -1126,14 +1151,14 @@ const Index = () => { | |||
</Form.Item> | |||
<Form.Item | |||
label="产线描述" | |||
name="des" | |||
name="describe" | |||
rules={[{ required: true, message: '此项必填!' }]} | |||
> | |||
<Input /> | |||
</Form.Item> | |||
<Form.Item | |||
label="产线分组" | |||
name="fz" | |||
name="code" | |||
rules={[{ required: true, message: '此项必填!' }]} | |||
> | |||
<Input /> | |||
@@ -1176,7 +1201,7 @@ const Index = () => { | |||
</Form.Item> | |||
<Form.Item name="groupId" rules={[{ required: true, message: '此项为必填项!' }]}> | |||
<Select placeholder='请选择分类'> | |||
{GroupList.map((item, index) => { | |||
{GroupList.map((item) => { | |||
if (item.id !== '-1') { | |||
return <Select.Option value={item.id} key={item.id}> | |||
<span>{item.name}</span> | |||
@@ -29,6 +29,7 @@ export default () => { | |||
//编辑/新增弹窗 | |||
const [isModalOpen, setIsModalOpen] = useState(false); | |||
const actionRef = useRef<ActionType>(); | |||
// 下拉的状态变量 | |||
const [RegionData, setRegionData] = useState([]); | |||
const columns: ProColumns<StockTypes.Info>[] = [ | |||
@@ -127,7 +128,10 @@ export default () => { | |||
useEffect(() => { | |||
// 下拉列表信息 | |||
const RegionDataList = async () => { | |||
const data = await materialAPI.selectlist(); | |||
// console.log(data); | |||
setRegionData(data.data); | |||
}; | |||
RegionDataList(); | |||
@@ -0,0 +1,132 @@ | |||
/** | |||
* 工艺管理 | |||
* @export | |||
* @interface CraftsInfo | |||
*/ | |||
declare namespace CraftsTypes { | |||
interface Info{ | |||
id: any; | |||
name: string, | |||
code: string, | |||
// craftsType:string, | |||
// describe:string, | |||
// repairDate: any | |||
} | |||
interface Page { | |||
pageIndex:number, | |||
pageSize:number | |||
name:string, | |||
code:string | |||
} | |||
interface BatchAdd { | |||
craftsId:string, | |||
recipesIds:string[] | |||
} | |||
interface craftsMaterialsRecordQueryPageInput { | |||
/** | |||
* 页码 | |||
* @type {number} | |||
* @memberof craftsInfoQueryPageInput | |||
*/ | |||
pageIndex?: number; | |||
/** | |||
* 页大小 | |||
* @type {number} | |||
* @memberof craftsInfoQueryPageInput | |||
*/ | |||
pageSize?: number; | |||
/** | |||
* 桶Id | |||
* @type {number} | |||
* @memberof craftsInfoQueryPageInput | |||
*/ | |||
craftsId:string; | |||
} | |||
/** | |||
* 删除入参 | |||
* @export | |||
* @interface craftsInfoDelInput | |||
*/ | |||
export interface craftsInfoDelInput { | |||
/** | |||
* 主键 | |||
* @type {string} | |||
* @memberof craftsInfoDelInput | |||
*/ | |||
id?: string | null; | |||
} | |||
/** | |||
* 添加入参 | |||
* @export | |||
* @interface craftsInfoAddInput | |||
*/ | |||
export interface craftsInfoAddInput extends Info { | |||
id:string | |||
} | |||
/** | |||
* 名 称 :设备基础信息 | |||
* 创 建 人 :ranyuqi | |||
* 创建时间 :2022/10/28 17:19:13 | |||
* 描 述 :设备基础信息返回值 | |||
* @export | |||
* @interface craftsInfoOutput | |||
*/ | |||
export interface craftsInfoOutput extends Info { | |||
id:string, | |||
} | |||
/** | |||
* 分页查询入参 | |||
* @export | |||
* @interface craftsInfoQueryPageInput | |||
*/ | |||
export interface craftsInfoQueryPageInput { | |||
/** | |||
* 名称 | |||
* @type {string} | |||
* @memberof craftsInfoQueryPageInput | |||
*/ | |||
name?: string | null; | |||
/** | |||
* 编码 | |||
* @type {string} | |||
* @memberof craftsInfoQueryPageInput | |||
*/ | |||
code:string|null | |||
/** | |||
* 页码 | |||
* @type {number} | |||
* @memberof craftsInfoQueryPageInput | |||
*/ | |||
pageIndex?: number; | |||
/** | |||
* 页大小 | |||
* @type {number} | |||
* @memberof craftsInfoQueryPageInput | |||
*/ | |||
pageSize?: number; | |||
/** | |||
* 主键 | |||
* @type {string} | |||
* @memberof craftsInfoQueryPageInput | |||
*/ | |||
id?: string | null; | |||
} | |||
/** | |||
* 修改入参 | |||
* @export | |||
* @interface craftsInfoUpdateInput | |||
*/ | |||
export interface craftsInfoUpdateInput extends Info { | |||
/** | |||
* 主键 | |||
* @type {string} | |||
* @memberof craftsInfoUpdateInput | |||
*/ | |||
id?: string | null; | |||
} | |||
} |
@@ -6,11 +6,12 @@ | |||
declare namespace FinalTypes { | |||
interface Info{ | |||
id: string | null | undefined; | |||
name: string, | |||
code: string, | |||
createTime:string, | |||
craftId:string, | |||
recipeId: any | |||
recipeId: string | |||
} | |||
interface Page { | |||
pageIndex:number, | |||
@@ -1,4 +1,4 @@ | |||
// 分组管理 | |||
declare namespace GroupInfoTypes { | |||
// 角色类型 | |||
interface Info { | |||
@@ -6,8 +6,107 @@ declare namespace GroupInfoTypes { | |||
name: string, | |||
des:string, | |||
} | |||
interface Page extends Info{ | |||
// interface Page extends Info{ | |||
// pageIndex:number, | |||
// pageSize:number, | |||
// name: string, | |||
// } | |||
interface Page { | |||
pageIndex:number, | |||
pageSize:number | |||
pageSize:number, | |||
name: string, | |||
} | |||
} | |||
interface BatchAdd { | |||
groupId:string, | |||
recipesIds:string[] | |||
} | |||
/** | |||
* 删除入参 | |||
* @export | |||
* @interface GroupInfoDelInput | |||
*/ | |||
export interface GroupInfoDelInput { | |||
/** | |||
* 主键 | |||
* @type {string} | |||
* @memberof GroupInfoDelInput | |||
*/ | |||
id?: string | null; | |||
} | |||
/** | |||
* 添加入参 | |||
* @export | |||
* @interface GroupInfoAddInput | |||
*/ | |||
export interface GroupInfoAddInput extends Info { | |||
id:string | |||
} | |||
/** | |||
* 名 称 :设备基础信息 | |||
* 创 建 人 :ranyuqi | |||
* 创建时间 :2022/10/28 17:19:13 | |||
* 描 述 :设备基础信息返回值 | |||
* @export | |||
* @interface GroupInfoOutput | |||
*/ | |||
export interface GroupInfoOutput extends Info { | |||
id:string, | |||
} | |||
/** | |||
* 分页查询入参 | |||
* @export | |||
* @interface GroupInfoQueryPageInput | |||
*/ | |||
export interface GroupInfoQueryPageInput { | |||
/** | |||
* 名称 | |||
* @type {string} | |||
* @memberof GroupInfoQueryPageInput | |||
*/ | |||
name?: string | null; | |||
/** | |||
* 编码 | |||
* @type {string} | |||
* @memberof GroupInfoQueryPageInput | |||
*/ | |||
code:string|null | |||
/** | |||
* 页码 | |||
* @type {number} | |||
* @memberof GroupInfoQueryPageInput | |||
*/ | |||
pageIndex?: number; | |||
/** | |||
* 页大小 | |||
* @type {number} | |||
* @memberof GroupInfoQueryPageInput | |||
*/ | |||
pageSize?: number; | |||
/** | |||
* 主键 | |||
* @type {string} | |||
* @memberof GroupInfoQueryPageInput | |||
*/ | |||
id?: string | null; | |||
} | |||
/** | |||
* 修改入参 | |||
* @export | |||
* @interface GroupInfoUpdateInput | |||
*/ | |||
export interface GroupInfoUpdateInput extends Info { | |||
/** | |||
* 主键 | |||
* @type {string} | |||
* @memberof GroupInfoUpdateInput | |||
*/ | |||
id?: string | null; | |||
} | |||
} | |||
@@ -5,7 +5,7 @@ declare namespace MyResponse { | |||
statusCode: number, | |||
data: any, | |||
errors: any, | |||
succeeded:boolean | |||
succeeded: boolean | |||
} | |||
} | |||
declare enum MyMethod { | |||
@@ -18,4 +18,4 @@ declare namespace MySelectType { | |||
key:string, | |||
value:string | |||
} | |||
} | |||
} |
@@ -0,0 +1,111 @@ | |||
/** | |||
* 产线管理 | |||
* @export | |||
* @interface ProductlineInfo | |||
*/ | |||
declare namespace ProductlineTypes { | |||
interface Info{ | |||
name: string, | |||
code: string, | |||
id:string, | |||
describe:string, | |||
} | |||
interface Page { | |||
pageIndex:number, | |||
pageSize:number | |||
name:string, | |||
code:string | |||
} | |||
interface BatchAdd { | |||
productlineId:string, | |||
recipesIds:string[] | |||
} | |||
/** | |||
* 删除入参 | |||
* @export | |||
* @interface ProductlineInfoDelInput | |||
*/ | |||
export interface ProductlineInfoDelInput { | |||
/** | |||
* 主键 | |||
* @type {string} | |||
* @memberof ProductlineInfoDelInput | |||
*/ | |||
id?: string | null; | |||
} | |||
/** | |||
* 添加入参 | |||
* @export | |||
* @interface ProductlineInfoAddInput | |||
*/ | |||
export interface ProductlineInfoAddInput extends Info { | |||
id:string | |||
} | |||
/** | |||
* 名 称 :产线基础信息 | |||
* 创 建 人 :ranyuqi | |||
* 创建时间 :2022/10/28 17:19:13 | |||
* 描 述 :产线基础信息返回值 | |||
* @export | |||
* @interface ProductlineInfoOutput | |||
*/ | |||
export interface ProductlineInfoOutput extends Info { | |||
id:string, | |||
} | |||
/** | |||
* 分页查询入参 | |||
* @export | |||
* @interface ProductlineInfoQueryPageInput | |||
*/ | |||
export interface ProductlineInfoQueryPageInput { | |||
/** | |||
* 名称 | |||
* @type {string} | |||
* @memberof ProductlineInfoQueryPageInput | |||
*/ | |||
name?: string | null; | |||
/** | |||
* 编码 | |||
* @type {string} | |||
* @memberof ProductlineInfoQueryPageInput | |||
*/ | |||
code:string|null | |||
/** | |||
* 页码 | |||
* @type {number} | |||
* @memberof ProductlineInfoQueryPageInput | |||
*/ | |||
pageIndex?: number; | |||
/** | |||
* 页大小 | |||
* @type {number} | |||
* @memberof ProductlineInfoQueryPageInput | |||
*/ | |||
pageSize?: number; | |||
/** | |||
* 主键 | |||
* @type {string} | |||
* @memberof ProductlineInfoQueryPageInput | |||
*/ | |||
id?: string | null; | |||
} | |||
/** | |||
* 修改入参 | |||
* @export | |||
* @interface ProductlineInfoUpdateInput | |||
*/ | |||
export interface ProductlineInfoUpdateInput extends Info { | |||
/** | |||
* 主键 | |||
* @type {string} | |||
* @memberof ProductlineInfoUpdateInput | |||
*/ | |||
id?: string | null; | |||
} | |||
} |