Browse Source

员工店铺

tags/小炒逻辑变更前
gwbvipvip 2 years ago
parent
commit
0021fffdb4
2 changed files with 58 additions and 4 deletions
  1. +10
    -2
      src/pages/store/storeStaff/components/CreateForm.jsx
  2. +48
    -2
      src/pages/store/storeStaff/index.jsx

+ 10
- 2
src/pages/store/storeStaff/components/CreateForm.jsx View File

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

const CreateForm = (props) => {
const { Option, OptGroup } = Select;
@@ -31,7 +31,15 @@ const CreateForm = (props) => {
<Form.Item label={"工号"} name="number" rules={[{ required: true}]} >
<Input />
</Form.Item>

<Form.Item name="shopId" label="门店" rules={[{ required: true }]}>
<TreeSelect
style={{ width: '100%' }}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
treeData={props.OrgData}
placeholder="门店"
treeDefaultExpandAll
/>
</Form.Item>

<Form.Item name="status" label="状态"
rules={[{ required: true, message: '请选择状态' }]} >


+ 48
- 2
src/pages/store/storeStaff/index.jsx View File

@@ -1,13 +1,13 @@
import { PlusOutlined } from '@ant-design/icons';
import { Modal,Button, message, Input, Drawer } 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 QRCode from 'qrcode.react';
import ProDescriptions from '@ant-design/pro-descriptions';
import CreateForm from './components/CreateForm';
import { Getstorestaffpage, Addstorestaff, Updatestorestaff, Delstorestaff, } from "./services"
import { gettree } from '../../sys/org/service';
const key = 'message';

//添加
@@ -85,8 +85,47 @@ const GoodsTypeManage = () => {
const actionRef = useRef();
const [currentRow, setCurrentRow] = useState();
const [selectedRowsState, setSelectedRows] = useState([]);
const [OrgList, setOrgList] = useState([]);
const [OrgListArray, setOrgListArray] = useState([]);
/** 国际化配置 */

//初始化数据
useEffect(() => {
function initOrgList() {
gettree().then((r) => {
inittree(r.data);
function inittree(datas) {
for (var i in datas) {
if( datas[i]['type']==2|| datas[i]['type']==3){
datas[i]['disabled']=false;
}else{
datas[i]['disabled']=true;
}
if (datas[i].children) {
inittree(datas[i].children);
}
}
}
setOrgList(r.data);
let list = {};
formateData(r.data);
function formateData(datas) {
for (var i in datas) {
list[datas[i]['disabled']]=true;
list[datas[i]['value']] = { text: datas[i]['title'] };
if (datas[i].children) {
formateData(datas[i].children);
}
}
}
setOrgListArray(list);
});
}
initOrgList();
}, []);

const columns = [
{
title: '主键',
@@ -114,6 +153,12 @@ const GoodsTypeManage = () => {
valueType: 'textarea',
search: false,
},
{
title: '归属门店',
dataIndex: 'shopId',
search: false,
valueEnum: OrgListArray,
},
{
title: '状态',
dataIndex: 'status',
@@ -237,6 +282,7 @@ const GoodsTypeManage = () => {
setCurrentRow(undefined);
}}
createModalVisible={createModalVisible}
OrgData={OrgList}
values={currentRow || {}}
/>
</PageContainer>


Loading…
Cancel
Save