Sfoglia il codice sorgente

Merge branch 'master' into kitchenmanage

tmp
zhaoy 8 mesi fa
parent
commit
00a4422b9a
12 ha cambiato i file con 312 aggiunte e 61 eliminazioni
  1. +7
    -1
      config/routes.js
  2. +8
    -6
      src/pages/company/account/components/CreateForm.jsx
  3. +1
    -0
      src/pages/company/account/index.jsx
  4. +53
    -0
      src/pages/database/bom/index.css
  5. +135
    -0
      src/pages/database/bom/index.jsx
  6. +11
    -0
      src/pages/database/bom/services.js
  7. +6
    -6
      src/pages/database/goods/goodsInfo/index.jsx
  8. +21
    -18
      src/pages/database/goods/goodstypemanage/index.jsx
  9. +21
    -18
      src/pages/org/orgamange/index.jsx
  10. +22
    -10
      src/pages/org/users/components/CreateForm.jsx
  11. +16
    -1
      src/pages/org/users/index.jsx
  12. +11
    -1
      src/pages/org/users/service.js

+ 7
- 1
config/routes.js Vedi File

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


+ 8
- 6
src/pages/company/account/components/CreateForm.jsx Vedi File

@@ -17,7 +17,7 @@ const CreateForm = (props) => {
>
<Form
layout="horizontal"
labelCol={{ span: 4 }}
labelCol={{ span: 6 }}
preserve={false}
initialValues={props.values}
onFinish={props.onFinish}
@@ -33,9 +33,11 @@ const CreateForm = (props) => {
<Input placeholder="请输入管理员姓名" />
</Form.Item>
<Form.Item name="email" label="邮箱账号" rules={[{ required: true, max: 50,message:"请输入邮箱账号"},{pattern: /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/,
message: '邮箱格式不正确', }]}>
<Input placeholder="电子邮件是登录账户" disabled={props.values.id?true:false} />
<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>
{/* <Form.Item name="type" label="所属平台" rules={[{ required: true }]}>
<Select placeholder='请选择所属平台' allowClear options={[
@@ -53,10 +55,10 @@ message: '邮箱格式不正确', }]}>
},
]}/>
</Form.Item> */}
<Form.Item name="phone" label="电话" rules={[{ max: 20,pattern: /0?(13|14|15|18|17)[0-9]{9}$/,
{/* <Form.Item name="phone" label="电话" rules={[{ max: 20,pattern: /0?(13|14|15|18|17)[0-9]{9}$/,
message: '手机号格式不正确' }]}>
<Input placeholder="请输入电话" />
</Form.Item>
</Form.Item> */}
<Form.Item name="remark" label="备注" rules={[{ max: 100 }]}>
<Input placeholder="请输入备注" />
</Form.Item>


+ 1
- 0
src/pages/company/account/index.jsx Vedi File

@@ -338,6 +338,7 @@ const companyManage = () => {
if (value.id) {
success = await handleUpdate(value);
} else {
value.phone=value.email;
success = await handleAdd(value);
}
if (success) {


+ 53
- 0
src/pages/database/bom/index.css Vedi File

@@ -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 Vedi File

@@ -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 Vedi File

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



+ 6
- 6
src/pages/database/goods/goodsInfo/index.jsx Vedi File

@@ -148,7 +148,7 @@ const Advanced = (props) => {
initGoodsUnit();
initGoodsType();
initGetbomType();
//intBatching();//默认原料
intBatching();//默认原料
//}
}, [tabStatus])
@@ -192,11 +192,11 @@ const Advanced = (props) => {
})
}
// function intBatching(){
// getproductpage().then((r) => {
// setMatedata(r.data);
// });
// }
function intBatching(){
getproductpage().then((r) => {
setMatedata(r.data);
});
}
function initTypeList(){
initGetbomType();
}


+ 21
- 18
src/pages/database/goods/goodstypemanage/index.jsx Vedi File

@@ -172,6 +172,9 @@ const handleAdd = async (fields) => {
<a
key="config"
onClick={() => {
if(record.pid=="0"){
record.pid=null;
}
handleModalVisible(true);
setCurrentRow(record);
}}
@@ -292,24 +295,24 @@ const handleAdd = async (fields) => {
)}

<CreateForm
treeDatas={
[
{
key: '0',
parentId: '0',
title: '顶级',
value: '0',
children: treeData,
},
] || [
{
id: '0',
parentId: '0',
title: '顶级',
value: '0',
children: [],
},
]
treeDatas={treeData
// [
// {
// key: '0',
// parentId: '0',
// title: '顶级',
// value: '0',
// children: treeData,
// },
// ] || [
// {
// id: '0',
// parentId: '0',
// title: '顶级',
// value: '0',
// children: [],
// },
// ]
}
onFinish={async (value) => {
var success = false;


+ 21
- 18
src/pages/org/orgamange/index.jsx Vedi File

@@ -145,6 +145,9 @@ const TableList = () => {
<a
key="primary3"
onClick={() => {
if(record.pid==0){
record.pid=null;
}
setStepFormValues(record);
handleModalVisible(true);
}}
@@ -310,24 +313,24 @@ const TableList = () => {
)}
{
createModalVisible && <CreateForm
treeDatas={
[
{
key: '0',
parentId: '0',
title: '顶级',
value: '0',
children: treeData,
},
] || [
{
id: '0',
parentId: '0',
title: '顶级',
value: '0',
children: [],
},
]
treeDatas={treeData
// [
// {
// key: '0',
// parentId: '0',
// title: '顶级',
// value: '0',
// children: treeData,
// },
// ] || [
// {
// id: '0',
// parentId: '0',
// title: '顶级',
// value: '0',
// children: [],
// },
// ]
}
onFinish={async (value) => {
var success = false;


+ 22
- 10
src/pages/org/users/components/CreateForm.jsx Vedi File

@@ -1,5 +1,5 @@
import React,{useEffect,useState} from 'react';
import { Modal, Form, Input, Button, Select } from 'antd';
import { Modal, Form, Input, Button, Select,TreeSelect } from 'antd';
import api from './service'

const CreateForm = (props) => {
@@ -32,7 +32,7 @@ const CreateForm = (props) => {
preserve={false}
layout="horizontal"
labelCol={{
span: 4,
span: 6,
}}
initialValues={props.values}
onFinish={props.onFinish}
@@ -40,21 +40,33 @@ const CreateForm = (props) => {
<Form.Item name="id" hidden={true}>
<Input />
</Form.Item>
<Form.Item name="account" label="登录账户" rules={[{ required: true, max: 255 }]}>
<Form.Item name="sysOrgId" label="所属组织" rules={[{ required: true }]}>
{/* <Select placeholder="请选择所属组织">
{orgData}
</Select> */}
<TreeSelect
style={{ width: '100%' }}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
treeData={props.treeDatas}
placeholder="请选择上级名称"
treeDefaultExpandAll
/>
</Form.Item>

<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>
<Form.Item name="name" label="用户姓名" rules={[{ required: true, max: 255 }]}>
<Input placeholder="请输入用户姓名" />
</Form.Item>
<Form.Item name="phone" label="用户手机" rules={[{ required: true,max: 20,pattern: /0?(13|14|15|18|17)[0-9]{9}$/,
{/* <Form.Item name="phone" label="用户手机" rules={[{ required: true,max: 20,pattern: /0?(13|14|15|18|17)[0-9]{9}$/,
message: '手机号格式不正确' }]}>
<Input placeholder="请输入用户手机" />
</Form.Item>
<Form.Item name="sysOrgId" label="所属组织" rules={[{ required: true }]}>
<Select placeholder="请选择所属组织">
{orgData}
</Select>
</Form.Item>
</Form.Item> */}
<Form.Item>
<Button htmlType="button" style={{float:'right',left:10}} onClick={props.onCancel} >
取消


+ 16
- 1
src/pages/org/users/index.jsx Vedi File

@@ -1,6 +1,6 @@
import { PlusOutlined } from '@ant-design/icons';
import { Button, message, Select,Popconfirm } from 'antd';
import React, { useState, useRef } from 'react';
import React, { useState, useRef,useEffect } from 'react';
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table';
import CreateForm from './components/CreateForm'
@@ -84,6 +84,7 @@ const userManager = () => {
const [selectDatas, SetselectData] = useState();
const [sysUserId, SetSysUserId] = useState();
const [account, setaccount] = useState();
const [treeData, setTreeData] = useState();
const InitRole = (id) => {
SetSysUserId(id);
api.GetRoleDic().then(r => {
@@ -221,6 +222,18 @@ const userManager = () => {
render: (_, record) => Btn(record)
},
];

useEffect(() => {
initfranchiseeType();
}, []);
function initfranchiseeType() {
api.gettree2().then((r) => {
debugger
setTreeData(r.data);
});api
}

return (
<PageContainer host header={{
title: '',
@@ -298,6 +311,7 @@ const userManager = () => {
if (value.id) {
success = await handleUpdate(value);
} else {
value.phone= value.account;
success = await handleAdd(value);
}
if (success) {
@@ -314,6 +328,7 @@ const userManager = () => {
handleModalVisible(false);
setStepFormValues({});
}}
treeDatas={treeData}
modalVisible={createModalVisible}
values={stepFormValues || {}}
/>


+ 11
- 1
src/pages/org/users/service.js Vedi File

@@ -85,6 +85,15 @@ function gettree(params) {
});
}

function gettree2(params) {
return request(getDataBaseUrl()+'​/api​/organize/tree', {
method: 'GET',
data: {
...params,
},
});
}

export default {
Page,
Enable,
@@ -99,5 +108,6 @@ export default {
AddUserRole,
UpdateUserRole,
SetDataRole,
gettree
gettree,
gettree2
};

Caricamento…
Annulla
Salva