From b27a3811dd56c00bb543338946440ed8c5a65017 Mon Sep 17 00:00:00 2001 From: gwbvipvip Date: Mon, 19 Feb 2024 10:05:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/routes.js | 8 +- .../company/account/components/CreateForm.jsx | 4 +- src/pages/database/bom/index.css | 53 +++++++ src/pages/database/bom/index.jsx | 135 ++++++++++++++++++ src/pages/database/bom/services.js | 11 ++ src/pages/org/users/components/CreateForm.jsx | 4 +- 6 files changed, 212 insertions(+), 3 deletions(-) create mode 100644 src/pages/database/bom/index.css create mode 100644 src/pages/database/bom/index.jsx create mode 100644 src/pages/database/bom/services.js diff --git a/config/routes.js b/config/routes.js index f2a56e3..557381e 100644 --- a/config/routes.js +++ b/config/routes.js @@ -118,7 +118,13 @@ export default [ component: './database/basic/batching', access: 'k7', }, - + { + name: '配方管理', + icon: 'smile', + path: '/database/bom', + component: './database/bom', + access: 'k7', + }, { name: '商品管理', icon: 'smile', diff --git a/src/pages/company/account/components/CreateForm.jsx b/src/pages/company/account/components/CreateForm.jsx index 1fb047b..a6c9c50 100644 --- a/src/pages/company/account/components/CreateForm.jsx +++ b/src/pages/company/account/components/CreateForm.jsx @@ -33,7 +33,9 @@ const CreateForm = (props) => { - diff --git a/src/pages/database/bom/index.css b/src/pages/database/bom/index.css new file mode 100644 index 0000000..128076e --- /dev/null +++ b/src/pages/database/bom/index.css @@ -0,0 +1,53 @@ +.form-list-item { + display: flex; + align-items: center; +} + +.form-list-copy { + display: flex; + justify-content: flex-end; + margin-bottom: 10px; +} + +.form-input-label { + width: 50px; + flex-shrink: 0; +} + +.form-list-detail { + display: flex; + align-items: center; + justify-content: space-between; + margin: 10px 0; +} + +.form-detail-card { + display: flex; + align-items: center; +} + +.formmual-name input { + width: 200px; + margin-right: 10px; +} +.clickRowStyl{background-color:antiquewhite} +.ant-tree-switcher{ + width: 1px; +} +.ant-tree-switcher-noop{ + display: none; +} +.ant-tree .ant-tree-treenode{ + height: 40px; +} +.ant-tree .ant-tree-node-content-wrapper{ + line-height: 40px; + height: 40px; +} + +.ant-tree .ant-tree-treenode-draggable .ant-tree-draggable-icon{ + line-height: 40px; +} +.ant-tree .ant-tree-treenode:focus{ + background-color: #ffd8bf; +} \ No newline at end of file diff --git a/src/pages/database/bom/index.jsx b/src/pages/database/bom/index.jsx new file mode 100644 index 0000000..564af0a --- /dev/null +++ b/src/pages/database/bom/index.jsx @@ -0,0 +1,135 @@ +import { PlusOutlined } from '@ant-design/icons'; +import { Button, message, Input, Drawer, Modal, Space, Tag,Popconfirm } from 'antd'; +import React, { useState, useRef, useEffect } from 'react'; +import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; +import ProTable from '@ant-design/pro-table'; +import {bomPage} from './services'; + +const GoodsBomsManage = (props) => { + const actionRef = useRef(); + const [modalVisible, setModalVisible] = useState(false); + + useEffect(() => { + + }, []); + + + const columns = [ + { + title: '主键', + dataIndex: 'id', + key: 'id', + hideInTable: true, + hideInSearch: true, + tip: '规则名称是唯一的 key', + }, + { + title: '配方名称', + key: 'name', + dataIndex: 'name', + valueType: 'textarea', + }, + { + title: '配方类型', + dataIndex: 'isMain', + hideInForm: true, + valueEnum: { + false: { + text: '辅料', + status: 'Processing', + }, + true: { + text: '主料', + status: 'Success', + }, + }, + }, + { + title: '操作', + dataIndex: 'option', + valueType: 'option', + render: (_, record) => [ + { + setUpdateBomVisible(true); + setBomId(record.bomId) + }} + > + 更新 + , + { + setBomBatchingVisible(true); + setBomId(record.bomId) + }} + > + 配方详情 + , + { + + }} + onCancel={() => { }} + > + 删除 + , + ], + } + ] + + + return ( + + [ + , + ]} + + request={async (params) => { + var total = 0; + var data=[]; + const res = await bomPage(params); + if(res.statusCode==200){ + data=res.data.data; + total=res.data.total; + } + return { + data: data, + success: true, + total: total, + }; + + }} + rowSelection={{ + onChange: (_, selectedRows) => setSelectedRows(selectedRows), + }} + /> + + + ); +}; + +export default GoodsBomsManage; diff --git a/src/pages/database/bom/services.js b/src/pages/database/bom/services.js new file mode 100644 index 0000000..d6df3e0 --- /dev/null +++ b/src/pages/database/bom/services.js @@ -0,0 +1,11 @@ +import { request } from 'umi'; +import { getDataBaseUrl } from '@/global_data'; + +export async function bomPage(data) { + return request(getDataBaseUrl()+'/api/bom/BomPage', { + method: 'POST', + data:data, + }); + } + + diff --git a/src/pages/org/users/components/CreateForm.jsx b/src/pages/org/users/components/CreateForm.jsx index af8dbaf..c6715a1 100644 --- a/src/pages/org/users/components/CreateForm.jsx +++ b/src/pages/org/users/components/CreateForm.jsx @@ -53,7 +53,9 @@ const CreateForm = (props) => { /> -