Parcourir la source

提交

master
gwbvipvip il y a 10 mois
Parent
révision
b27a3811dd
6 fichiers modifiés avec 212 ajouts et 3 suppressions
  1. +7
    -1
      config/routes.js
  2. +3
    -1
      src/pages/company/account/components/CreateForm.jsx
  3. +53
    -0
      src/pages/database/bom/index.css
  4. +135
    -0
      src/pages/database/bom/index.jsx
  5. +11
    -0
      src/pages/database/bom/services.js
  6. +3
    -1
      src/pages/org/users/components/CreateForm.jsx

+ 7
- 1
config/routes.js Voir le fichier

@@ -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',


+ 3
- 1
src/pages/company/account/components/CreateForm.jsx Voir le fichier

@@ -33,7 +33,9 @@ const CreateForm = (props) => {
<Input placeholder="请输入管理员姓名" />
</Form.Item>
<Form.Item name="email" label="登陆账号(手机号)" rules={[{ required: true, max: 50,message:"请输入手机号"},{pattern: /^1[3-9][0-9]{9}$/,
<Form.Item name="email" label="登陆账号(手机号)"
tooltip="初始密码为:123456"
rules={[{ required: true, max: 50,message:"请输入手机号"},{pattern: /^1[3-9][0-9]{9}$/,
message: '手机号格式不正确', }]}>
<Input placeholder="手机号是登录账户" disabled={props.values.id?true:false} />
</Form.Item>


+ 53
- 0
src/pages/database/bom/index.css Voir le fichier

@@ -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;
}

+ 135
- 0
src/pages/database/bom/index.jsx Voir le fichier

@@ -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) => [
<a
key="primary"
type="primary"
onClick={() => {
setUpdateBomVisible(true);
setBomId(record.bomId)
}}
>
更新
</a>,
<a
key="primary"
type="primary"
onClick={() => {
setBomBatchingVisible(true);
setBomId(record.bomId)
}}
>
配方详情
</a>,
<Popconfirm
type="primary"
key="primary"
title="确认删除吗?"
okText="是"
cancelText="否"
onConfirm={async () => {
}}
onCancel={() => { }}
>
<a href="#">删除</a>
</Popconfirm>,
],
}
]


return (
<PageContainer header={{
title: '',
breadcrumb: {},
}}>
<ProTable
columns={columns}
actionRef={actionRef}
rowKey="id"
toolBarRender={() => [
<Button
type="primary"
key="primary"
onClick={() => {
setModalVisible(true);
}}
>
<PlusOutlined /> 新建
</Button>,
]}

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),
}}
/>
</PageContainer>
);
};

export default GoodsBomsManage;

+ 11
- 0
src/pages/database/bom/services.js Voir le fichier

@@ -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,
});
}



+ 3
- 1
src/pages/org/users/components/CreateForm.jsx Voir le fichier

@@ -53,7 +53,9 @@ const CreateForm = (props) => {
/>
</Form.Item>

<Form.Item name="account" label="登录账户(手机号)" rules={[{ required: true, max: 255,pattern: /0?(13|14|15|18|17)[0-9]{9}$/,
<Form.Item name="account" label="登录账户(手机号)"
tooltip="初始密码为:123456"
rules={[{ required: true, max: 255,pattern: /0?(13|14|15|18|17)[0-9]{9}$/,
message: '手机号格式不正确'}]}>
<Input placeholder="请输入登录账户" disabled={props.values.id?true:false} />
</Form.Item>


Chargement…
Annuler
Enregistrer