Browse Source

Merge branch 'master' into groupmealweb

groupmealweb
zhaoy 9 months ago
parent
commit
3319e64454
12 changed files with 96 additions and 257 deletions
  1. +0
    -16
      src/pages/company/account/index.jsx
  2. +19
    -17
      src/pages/database/basic/batching/components/CreateForm.jsx
  3. +0
    -51
      src/pages/database/basic/batching/index.jsx
  4. +24
    -28
      src/pages/database/goods/goodsInfo/index.jsx
  5. +0
    -16
      src/pages/database/goods/goodstypemanage/index.jsx
  6. +5
    -5
      src/pages/database/goods/newgoods/index.jsx
  7. +0
    -10
      src/pages/device/deviceInfo/index.jsx
  8. +2
    -16
      src/pages/device/productmanage/components/CreateAction.jsx
  9. +2
    -1
      src/pages/device/productmanage/components/CreateForm.jsx
  10. +1
    -1
      src/pages/org/orgamange/components/CreateForm.jsx
  11. +1
    -0
      src/pages/org/users/components/RoleAuth.jsx
  12. +42
    -96
      src/pages/org/users/index.jsx

+ 0
- 16
src/pages/company/account/index.jsx View File

@@ -175,22 +175,6 @@ const companyManage = () => {
dataIndex: 'remark',
hideInSearch: true,
},
{
title: '状态',
dataIndex: 'status',
hideInForm: true,
hideInSearch: true,
valueEnum: {
0: {
text: '启用',
status: 'Processing',
},
1: {
text: '禁用',
status: 'Success',
},
},
},
{
title: '创建时间',
dataIndex: 'createAt',


+ 19
- 17
src/pages/database/basic/batching/components/CreateForm.jsx View File

@@ -11,7 +11,7 @@ const fieldLabels = {
specs: '物料规格',
code: '物料编码',
aittribute: '物料属性',
typeID: '物料类',
typeID: '物料类',
status: '物料状态',
price: '成本价',
netrecovery: '净料率(%)',
@@ -41,7 +41,7 @@ const CreateForm = (props) => {
};
useEffect(() => {
getTableInfo();
console.log("props.typeListData",props.typeListData)
console.log("props.uintListData",props.uintListData)
setItems(props.typeListData)
setitemsuity(props.uintListData)
}, [modalVisible,props.typeListData,props.uintListData]);
@@ -176,7 +176,7 @@ const CreateForm = (props) => {
onFinish={props.onFinish}
>
<Row gutter={16}>
<Col lg={8} md={12} sm={24}>
<Col lg={12} md={12} sm={24}>
<ProFormText
label={fieldLabels.code}
name="code"
@@ -192,7 +192,7 @@ const CreateForm = (props) => {
}}
/>
</Col>
<Col lg={8} md={12} sm={24}>
<Col lg={12} md={12} sm={24}>
<ProFormText name="id" hidden={true} />
<ProFormText
label={fieldLabels.name}
@@ -206,7 +206,7 @@ const CreateForm = (props) => {
placeholder="请输入原料名称"
/>
</Col>
<Col lg={8} md={12} sm={24}>
{/* <Col lg={8} md={12} sm={24}>
<ProFormText
label={fieldLabels.specs}
name="specs"
@@ -218,10 +218,10 @@ const CreateForm = (props) => {
]}
placeholder="请输入规格型号"
/>
</Col>
</Col> */}
</Row>
<Row gutter={16}>
{/* <Row gutter={16}>
<Col lg={8} md={12} sm={24}>
<ProFormSelect
label={fieldLabels.aittribute}
@@ -266,21 +266,22 @@ const CreateForm = (props) => {
placeholder="请输入净料率"
/>
</Col>
</Row>
</Row> */}
<Row gutter={16}>
<Col lg={8} md={12} sm={24}>
<Col lg={12} md={12} sm={24}>
<ProFormSelect
label={fieldLabels.typeID}
name="typeID"
style={{width: 235,}}
style={{width: '100%',}}
showSearch
rules={[
{
required: true,
message: '请选择物料类',
message: '请选择物料类',
},
]}
placeholder="请选择物料类"
placeholder="请选择物料类"
fieldProps={{
dropdownRender:(menu) => (
<>
@@ -296,7 +297,7 @@ const CreateForm = (props) => {
}}
>
<Input
placeholder="请输入物料类"
placeholder="请输入物料类"
ref={inputRef}
value={name}
onChange={onNameChange}
@@ -312,18 +313,19 @@ const CreateForm = (props) => {
options={items}
/>
</Col>
<Col lg={8} md={12} sm={24}>
<Col lg={12} md={12} sm={24}>
<ProFormSelect
label={fieldLabels.stockUint}
name="stockUint"
showSearch
rules={[
{
required: true,
message: '请选择单位',
},
]}
style={{width: 235,}}
style={{width: '100%',}}
placeholder="请选择物料单位"
fieldProps={{
dropdownRender:(menu) => (
@@ -370,7 +372,7 @@ const CreateForm = (props) => {
placeholder="请选择出库单位"
/>
</Col> */}
<Col lg={8} md={12} sm={24}>
{/* <Col lg={8} md={12} sm={24}>
<ProFormDigit
label={fieldLabels.proportion}
name="proportion"
@@ -382,7 +384,7 @@ const CreateForm = (props) => {
]}
placeholder="请输入换算比例"
/>
</Col>
</Col> */}
{/* <Col lg={8} md={12} sm={24}>
<ProFormSelect
label={fieldLabels.status}


+ 0
- 51
src/pages/database/basic/batching/index.jsx View File

@@ -179,42 +179,6 @@ const ProductManage = () => {
dataIndex: 'code',
ellipsis: true,
},
// {
// title: '关联外键',
// dataIndex: 'foreignKeyRe',
// hideInSearch: true,
// },
{
title: '物料规格',
dataIndex: 'specs',
hideInSearch: true,
},
{
title: '成本价',
dataIndex: 'price',
hideInSearch: true,
},
{
title: '净料率(%)',
dataIndex: 'netrecovery',
hideInSearch: true,
},
{
title: '物料属性',
dataIndex: 'aittribute',
hideInSearch: true,
valueEnum: {
0: {
text: '成品',
},
1: {
text: '半成品',
},
2: {
text: '易耗品',
},
},
},
{
title: '物料类别',
dataIndex: 'typeID',
@@ -232,21 +196,6 @@ const ProductManage = () => {
options: UintList,
},
},
{
title: '状态',
dataIndex: 'status',
hideInForm: true,
valueEnum: {
0: {
text: '正常',
status: 'Processing',
},
1: {
text: '停用',
status: 'Success',
},
},
},
{
title: '创建时间',
dataIndex: 'createAt',


+ 24
- 28
src/pages/database/goods/goodsInfo/index.jsx View File

@@ -41,6 +41,7 @@ const Advanced = (props) => {
const [BomId, setBomId] = useState();
const [UpdateBomVisible, setUpdateBomVisible] = useState(false);
const [BomBatchingVisible,setBomBatchingVisible]= useState(false);
const [goodsTypeIdvalue, setgoodsTypeIdvalue] = useState();
//事件
const onFinish = async (values) => {
const hide = message.loading('正在执行');
@@ -358,7 +359,11 @@ const Advanced = (props) => {
],
}
]

const onChange = (newValue) => {
setgoodsTypeIdvalue(newValue);
};
const filterOption = (input, option) =>
(option?.label ?? '').toLowerCase().includes(input.toLowerCase());
const contentList = {
basis: (
<Card
@@ -380,6 +385,20 @@ const Advanced = (props) => {
<Form.Item name="id" hidden={true}>
<Input />
</Form.Item>
<Form.Item name="goodsTypeId" label="商品分类" rules={[{ required: true }]}>
<TreeSelect
allowClear
showSearch
style={{ width: '100%' }}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
treeData={treeData}
onChange={onChange}
filterOption={filterOption}
value={goodsTypeIdvalue}
placeholder="请选择商品类型"
treeDefaultExpandAll
/>
</Form.Item>
<Form.Item name="name" label="商品名称" rules={[{ required: true }]}>
<Input />
</Form.Item>
@@ -387,6 +406,9 @@ const Advanced = (props) => {
<Select
style={{width: 400}}
placeholder="请选择单位"
showSearch
allowClear
filterOption={filterOption}
options={goodsUnit}
dropdownRender={(menu) => (
<>
@@ -411,33 +433,7 @@ const Advanced = (props) => {
<Form.Item name="price" label="商品价格" rules={[{ required: true }]}>
<InputNumber style={{ width: '100%' }} placeholder="价格" min={0} />
</Form.Item>
<Form.Item name="goodsTypeId" label="商品类型" rules={[{ required: true }]}>
<TreeSelect
allowClear
showSearch
style={{ width: '100%' }}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
treeData={treeData}
placeholder="请选择商品类型"
treeDefaultExpandAll
/>
</Form.Item>
{/* <Form.Item name="defaultMate" label="默认原料" rules={[{ required: false }]}>
<Select mode="multiple" allowClear>
{
matedata == undefined ? '' : (
matedata.map((item, index) => {
return (
<Select.Option index={index} value={item.id} key={item.id}>
{item.name}
</Select.Option>
);
})
)
}
</Select>
</Form.Item> */}
<Form.Item label="是否称重" name="isWeigh" valuePropName="checked" >
<Switch checkedChildren="是" unCheckedChildren="否" defaultChecked={false} />
</Form.Item>


+ 0
- 16
src/pages/database/goods/goodstypemanage/index.jsx View File

@@ -158,22 +158,6 @@ const handleAdd = async (fields) => {
hideInForm: true,
hideInSearch: true,
},
{
title: '状态',
dataIndex: 'status',
hideInForm: true,
hideInSearch: true,
valueEnum: {
0: {
text: '正常',
status: 'Processing',
},
1: {
text: '停用',
status: 'Success',
},
},
},
{
title: '排序',
dataIndex: 'goodsType_Sort',


+ 5
- 5
src/pages/database/goods/newgoods/index.jsx View File

@@ -148,11 +148,11 @@ const GoodsManage = () => {
hideInTable: true,
hideInSearch: true,
},
{
title: '编码',
dataIndex: 'code',
valueType: 'textarea',
},
// {
// title: '编码',
// dataIndex: 'code',
// valueType: 'textarea',
// },
{
title: '名称',
dataIndex: 'name',


+ 0
- 10
src/pages/device/deviceInfo/index.jsx View File

@@ -166,16 +166,6 @@ const GoodsTypeManage = () => {
dataIndex: 'deviceTypeId',
valueEnum: storeType,
},

{
title: '状态',
dataIndex: 'status',
valueEnum: {
0: { text: '启用', status: 'Processing' },
1: { text: '禁用', status: 'Success' },
},
hideInSearch: true,
},
{
title: '设备唯一key',
dataIndex: 'autoKey',


+ 2
- 16
src/pages/device/productmanage/components/CreateAction.jsx View File

@@ -80,6 +80,7 @@ const handleChange=(value)=>{
dataIndex: 'list',
valueType: 'formList',
initialValue:optionitem,
style:{paddingTop:'20px'},
columns: [
{
valueType: 'group',
@@ -140,22 +141,6 @@ const handleChange=(value)=>{
}
},
]
// const handleChange=(value)=>{

// }
// const onNameChange = (event) => {
// settypename(event.target.value);
// };
// const addItem = async (e) => {
// e.preventDefault();
// setItems([...items, {label:typename,value:index++} || `New item ${index++}`]);
// settypename('');
// setTimeout(() => {
// inputRef.current?.focus();
// }, 0);
// console.log(items)
// }
return (
<>
<Modal
@@ -209,6 +194,7 @@ const handleChange=(value)=>{
visible={modalVisit}
modalProps={{
forceRender: true,//切换显示模式后强制渲染其他模式表单
onCancel:()=>setModalVisit(false)
}}
onVisibleChange={(vis)=>{


+ 2
- 1
src/pages/device/productmanage/components/CreateForm.jsx View File

@@ -91,7 +91,8 @@ const CreateForm = (props) => {
setarttue(0)
onChangedataType("digit")
form.setFieldsValue({
type: 0
type: 0,
dataType:'digit'
});
}
},[props?.values])


+ 1
- 1
src/pages/org/orgamange/components/CreateForm.jsx View File

@@ -57,7 +57,7 @@ const CreateForm = (props) => {
<Input placeholder="请输入联系电话" />
</Form.Item>
<Form.Item name="sort" label="排序">
<InputNumber min={1} step={1} />
<InputNumber style={{width:'100%'}} min={1} step={1} />
</Form.Item>
<Form.Item name="remark" label="备注">
<TextArea rows={4} rules={[{ max: 500 }]} />


+ 1
- 0
src/pages/org/users/components/RoleAuth.jsx View File

@@ -7,6 +7,7 @@ const RoleForm = (props) => {
title={'角色授权'}
width={640}
visible={props.roleVisible}
maskClosable={false}
bodyStyle={{ padding: '32px 40px 1px 48px' }}
footer={null}
onCancel={() => {


+ 42
- 96
src/pages/org/users/index.jsx View File

@@ -1,5 +1,5 @@
import { PlusOutlined } from '@ant-design/icons';
import { Button, message, Select } from 'antd';
import { Button, message, Select,Popconfirm } from 'antd';
import React, { useState, useRef } from 'react';
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table';
@@ -68,29 +68,7 @@ const handleUpdate = async (fields) => {
return false;
}
};
/**
* 删除节点
*
* @param selectedRows
*/

const handleRemove = async (selectedRows) => {
if (!selectedRows) return true;
try {
await api.RemoveUser(selectedRows.map((row) => row.id)).then((r) => {
if (r.data) {
message.success('删除成功,即将刷新');
return true;
} else {
message.error('删除失败,请重试');
}
});
return true;
} catch (error) {
message.error('删除失败,请重试');
return false;
}
};
const Prefix = "User";
const userManager = () => {
/** 新建窗口的弹窗 */
@@ -121,6 +99,28 @@ const userManager = () => {

})
}
const handleRemove = async (selectedRows) => {
console.log(selectedRows)
if (!selectedRows){
message.error('请选择数据');
} else{
await api.RemoveUser(selectedRows.map((row) => row.id)).then((r) => {
if (r.data) {
message.success('删除成功,即将刷新');
actionRef.current.reload();
} else {
message.error('删除失败,请重试');
}
});
}
};
const cancel = (e) => {
};
const handleResetPwd=(record)=>{
api.ResetPwd(record.id).then(r => {
r.data ? message.success("重置成功") : message.error("重置失败");
})
}
const Btn = (record) => {
var arr = [];
arr.push(<a
@@ -133,53 +133,26 @@ const userManager = () => {
>
修改
</a>);
if (record.status == 1) {
arr.push(<a
disabled={record.adminType == 2}
style={{ pointerEvents: record.adminType == 2 ? 'none' : 'auto' }}
onClick={() => {
api.Enable(record.id).then(r => {
actionRef.current.reload();
})
}}
>
启用
</a>);
}
if (record.status == 0) {
arr.push(<a
disabled={record.adminType == 2}
style={{ pointerEvents: record.adminType == 2 ? 'none' : 'auto' }}
onClick={() => {
api.Disable(record.id).then(r => {
actionRef.current.reload();
})
}}
>
禁用
</a>);
}
arr.push(<a
arr.push( <Popconfirm
title="确认删除吗?"
onConfirm={() => {handleRemove([record])}}
onCancel={cancel}
okText="确定"
cancelText="取消"
><a
disabled={record.adminType == 2}
style={{ pointerEvents: record.adminType == 2 ? 'none' : 'auto' }}
onClick={() => {
api.RemoveUser([record.id]).then(r => {
r.data ? message.success("删除成功") : message.error("删除失败");
actionRef.current.reload();
})
}}
>
删除
</a>);
arr.push(<a
onClick={() => {
api.ResetPwd(record.id).then(r => {
r.data ? message.success("重置成功") : message.error("重置失败");
})
}}
>
重置密码
</a>);
</a></Popconfirm>);
arr.push(<Popconfirm
title="确认重置密码吗?"
onConfirm={() => {handleResetPwd(record)}}
onCancel={cancel}
okText="确定"
cancelText="取消"
><a>重置密码</a></Popconfirm>);
arr.push(<a
onClick={() => {
setpwdVisible(true);
@@ -230,41 +203,14 @@ const userManager = () => {
dataIndex: 'account'
},
{
title: '状态',
dataIndex: 'status',
hideInSearch: true,
valueEnum: {
0: {
text: '启用',
status: 'Processing',
},
1: {
text: '禁用',
status: 'Success',
},
},
title: '所属加盟商',
dataIndex: 'companyName'
},
{
title: '是否删除',
dataIndex: 'isDeleted',
hideInSearch: true,
valueEnum: {
0: {
text: '正常',
status: 'Processing',
},
1: {
text: '删除',
status: 'Success',
},
},
},

{
title: '创建时间',
dataIndex: 'createAt',
hideInSearch: true,
sorter: true,
sorter: false,
},
{
title: '操作',


Loading…
Cancel
Save