Browse Source

🐞 fix(修改很多问题): 修改很多问题

修改很多问题
tags/小炒逻辑变更前
txb 2 years ago
parent
commit
d9743b3743
11 changed files with 99 additions and 132 deletions
  1. +1
    -0
      src/app.jsx
  2. +1
    -42
      src/pages/goods/goodsPractice/components/createRelevanceForm.jsx
  3. +2
    -37
      src/pages/goods/goodsPractice/components/createtypeRelevanceForm.jsx
  4. +72
    -14
      src/pages/goods/goodsPractice/index.jsx
  5. +2
    -2
      src/pages/goods/goodsPracticeInfo/components/createRecordForm.jsx
  6. +2
    -4
      src/pages/goods/goodsPracticeInfo/index.jsx
  7. +3
    -0
      src/pages/store/storeGoodsInfo/components/CreateForm.jsx
  8. +8
    -1
      src/pages/store/storeGoodsInfo/index.jsx
  9. +5
    -22
      src/pages/sys/company/components/CreateForm.jsx
  10. +1
    -9
      src/pages/sys/company/index.jsx
  11. +2
    -1
      src/pages/user/login/index.jsx

+ 1
- 0
src/app.jsx View File

@@ -740,6 +740,7 @@ export const request = {
const errorText = codeMessage[response.status] || response.statusText;
const { status, url } = response;
if (response.status === 401 || response.status === 403) {
console.log("fdsafds",response);
notification.error({
description: '户没有权限(令牌、用户名、密码错误)。',
message: '网络异常',


+ 1
- 42
src/pages/goods/goodsPractice/components/createRelevanceForm.jsx View File

@@ -24,47 +24,6 @@ const createRelevanceForm = (props) => {
<Form.Item name="id" hidden={true}>
<Input />
</Form.Item>
<Form.Item name="relevanceType" >
<Input />
</Form.Item>
<Form.Item label='商品小类' name={'goodsSmallType'} initialValue={props.values.goodsSmallType}>
<Select
showSearch
placeholder="请选择商品类型"
optionFilterProp="children"
filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
style={{ width: '300px' }}
>
{
(props.Support.allSmallType || []).map((item, index) => {
return (
<Option index={index} value={item.id} key={item.id}>
{item.goodsType_Name}
</Option>
);
})
}
</Select>
</Form.Item>
<Form.Item label='做法类别' name={'practiceTypeId'} initialValues={props.values.practiceTypeId}>
<Select

style={{ width: '300px' }}
>
{
(props.Support.allType || []).map((item, index) => {
return (
<Select.Option index={index} value={item.id} key={item.id}>
{item.typeName}
</Select.Option>
);
})

}
</Select>
</Form.Item>
<Form.Item label='商品' name={'goodsId'} initialValue={props.values.goodsId}>
<Select showSearch style={{ width: '300px' }}
>
@@ -88,7 +47,7 @@ const createRelevanceForm = (props) => {
(props.Support.allPractice || []).map((item, index) => {
return (
<Select.Option index={index} value={item.id} key={item.id}>
{item.practiceName}
{item.makeName}
</Select.Option>
);
})


+ 2
- 37
src/pages/goods/goodsPractice/components/createtypeRelevanceForm.jsx View File

@@ -3,7 +3,6 @@ import { Modal, Form, Input, Button, Select, Switch } from 'antd';


const createtypeRelevanceForm = (props) => {
debugger;
return (
<Modal
width={800}
@@ -25,10 +24,7 @@ const createtypeRelevanceForm = (props) => {
<Form.Item name="id" hidden={true}>
<Input />
</Form.Item>
<Form.Item name="relevanceType" >
<Input />
</Form.Item>
<Form.Item label='商品小类' name={'goodsSmallType'} initialValue={props.values.goodsSmallType}>
<Form.Item label='商品类别' name={'goodsSmallType'} initialValue={props.values.goodsSmallType}>
<Select style={{ width: '300px' }}
>
{
@@ -43,7 +39,7 @@ const createtypeRelevanceForm = (props) => {
}
</Select>
</Form.Item>
<Form.Item label='做法类别' name={'practiceTypeId'} initialValues={props.values.practiceTypeId}>
<Form.Item label='做法类别' name={'makeTypeId'} initialValues={props.values.practiceTypeId}>
<Select style={{ width: '300px' }}
>
{
@@ -68,37 +64,6 @@ const createtypeRelevanceForm = (props) => {
}
}
}
<Form.Item label='商品' name={'goodsId'} initialValue={props.values.goodsId}>
<Select style={{ width: '300px' }}
>
{
(props.Support.allGoods || []).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={'practiceIds'} initialValue={props.values.practiceIds || []}>
<Select style={{ width: '300px' }}
mode="multiple"
>
{
(props.Support.allPractice || []).map((item, index) => {
return (
<Select.Option index={index} value={item.id} key={item.id}>
{item.practiceName}
</Select.Option>
);
})

}
</Select>
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit" >
保存


+ 72
- 14
src/pages/goods/goodsPractice/index.jsx View File

@@ -23,13 +23,11 @@ import {
} from './service';

import CreateRelevanceForm from './components/createRelevanceForm';
import CreatetypeRelevanceForm from './components/createtypeRelevanceForm';
const PageIndex = (props) => {
const actionRef = useRef();
const [createTypeModalVisible, handleTypeModalVisible] = useState();
const [createRecordModalVisible, handleRecordModalVisible] = useState();
const [createtypeRelevanceModalVisible, handletypeRelevanceModalVisible] = useState();
const [createRelevanceModalVisible, handleRelevanceModalVisible] = useState();
const [thisItemId, setthisItemId] = useState();
const [TypecurrentRow, setTypecurrentRow] = useState();
const [RecordCurrentRow, setRecordCurrentRow] = useState();
const [RelevanceCurrentRow, setRelevanceCurrentRow] = useState();
@@ -54,7 +52,22 @@ const PageIndex = (props) => {
if (r.data) {
message.success('添加成功');
//刷新数据
actionRef.current.reload();
} else {
message.error('添加失败请重试!');
}
});
return true;
} catch (error) {
message.error('添加失败请重试!');
return false;
}
}
function handletypeRelevanceAdd(fields) {
try {
addPracticeRelevance(fields)
.then((r) => {
if (r.data) {
message.success('添加成功');
} else {
message.error('添加失败请重试!');
}
@@ -93,7 +106,24 @@ const PageIndex = (props) => {
return false;
}
}

function handletypeRelevanceUpdate(fields) {
try {
//
editPracticeRelevance(fields)
.then((r) => {
if (r.data) {
message.success('配置成功');
} else {
message.error('配置失败请重试!');
}
setTypecurrentRow(undefined);
});
return true;
} catch (error) {
message.error('配置失败请重试!');
return false;
}
}


useEffect(() => {
@@ -132,12 +162,12 @@ const PageIndex = (props) => {
hideInTable: true,
},
{
title: '类别',
dataIndex: 'values1Name',
title: '商品类别',
dataIndex: 'goodsTypeName',
},
{
title: '做法',
dataIndex: 'values2Name',
title: '做法类别',
dataIndex: 'makeTypeName',
},
{
title: '操作',
@@ -147,7 +177,7 @@ const PageIndex = (props) => {
<a
key="primary"
onClick={() => {
handleRelevanceModalVisible(true);
handletypeRelevanceModalVisible(true);
setRelevanceCurrentRow(record);
}}
>
@@ -178,11 +208,11 @@ const PageIndex = (props) => {
},
{
title: '商品',
dataIndex: 'values1Name',
dataIndex: 'goodsName',
},
{
title: '做法',
dataIndex: 'values2Name',
dataIndex: 'makeName',
},
{
title: '操作',
@@ -219,6 +249,7 @@ const PageIndex = (props) => {

<CreateRelevanceForm
onFinish={async (value) => {
value.relevanceType=2;
var success = false;
if (value.id) {
success = handleRelevanceUpdate(value);
@@ -243,6 +274,33 @@ const PageIndex = (props) => {
values={RelevanceCurrentRow || {}}
>
</CreateRelevanceForm>
<CreatetypeRelevanceForm
onFinish={async (value) => {
value.relevanceType=1;
var success = false;
if (value.id) {
success = handletypeRelevanceUpdate(value);
} else {
success = handletypeRelevanceAdd(value);
}
if (success) {
handletypeRelevanceModalVisible(false);
setRelevanceCurrentRow(undefined);
if (actionRef.current) {
actionRef.current.reload();
}
}
}}
onCancel={() => {
setRelevanceCurrentRow(undefined);
handletypeRelevanceModalVisible(false);
actionRef.current.reload();
}}
Support={Support}
createModalVisible={createtypeRelevanceModalVisible}
values={RelevanceCurrentRow || {}}
>
</CreatetypeRelevanceForm>
<TabPane tab="出品类别与做法类别关联" key="1" style={{ float: 'left' }} >
<ProTable
actionRef={actionRef}
@@ -255,7 +313,7 @@ const PageIndex = (props) => {
type="primary"
key="primary"
onClick={() => {
handleRelevanceModalVisible(true);
handletypeRelevanceModalVisible(true);
}}
>
<PlusOutlined /> 添加


+ 2
- 2
src/pages/goods/goodsPracticeInfo/components/createRecordForm.jsx View File

@@ -24,10 +24,10 @@ const CreateRecordForm = (props) => {
<Form.Item name="id" hidden={true}>
<Input />
</Form.Item>
<Form.Item label='做法名称' name={'practiceName'} >
<Form.Item label='做法名称' name={'makeName'} >
<Input></Input>
</Form.Item>
<Form.Item label='做法类别' name={'practiceTypeId'} initialValue={props.values.practiceTypeId}>
<Form.Item label='做法类别' name={'makeTypeId'} initialValue={props.values.practiceTypeId}>
<Select style={{ width: '300px' }}
>
{


+ 2
- 4
src/pages/goods/goodsPracticeInfo/index.jsx View File

@@ -48,7 +48,6 @@ const PageIndex = (props) => {
if (r.data) {
message.success('添加成功');
//刷新数据
actionRef.current.reload();
} else {
message.error('添加失败请重试!');
}
@@ -80,7 +79,6 @@ const PageIndex = (props) => {
}
setRecordCurrentRow(undefined);
//刷新数据
actionRef.current.reload();
});
return true;
} catch (error) {
@@ -118,7 +116,7 @@ const PageIndex = (props) => {
},
{
title: '做法名称',
dataIndex: 'practiceName',
dataIndex: 'makeName',
},
{
title: '做法编码',
@@ -126,7 +124,7 @@ const PageIndex = (props) => {
},
{
title: '做法类别',
dataIndex: 'practiceTypeName',
dataIndex: 'makeTypeName',
},
{
title: '加价',


+ 3
- 0
src/pages/store/storeGoodsInfo/components/CreateForm.jsx View File

@@ -57,6 +57,9 @@ const CreateForm = (props) => {
<Form.Item label={'价格'} name="price" rules={[{ required: true }]}>
<InputNumber placeholder="价格" min={0} />
</Form.Item>
<Form.Item label={'价格'} name="vipPrice" rules={[{ required: true }]}>
<InputNumber placeholder="价格" min={0} />
</Form.Item>
<Form.Item label={'状态'} name="status" rules={[{ required: true }]}>
<Select placeholder="状态">
<Option value={1}>下架</Option>


+ 8
- 1
src/pages/store/storeGoodsInfo/index.jsx View File

@@ -129,7 +129,14 @@ const storeGoodsInfo = (props) => {

},
{
title: '制作方式',
title: '商品会员价格',
dataIndex: 'vipPrice',
valueType: 'money',

},

{
title: '是否设备制作',
dataIndex: 'isDevice',
valueEnum: {
0: { text: '店铺', status: 'Processing' },


+ 5
- 22
src/pages/sys/company/components/CreateForm.jsx View File

@@ -28,38 +28,21 @@ const CreateForm = (props) => {
<Form.Item name="name" label="企业名称" rules={[{ required: true, max: 30 }]}>
<Input placeholder="请输入企业名称" />
</Form.Item>
<Form.Item name="adminName" label="管理员名" rules={[{ required: true, max: 20 }]}>
<Input placeholder="请输入管理员名" />
<Form.Item name="adminName" label="管理员名" rules={[{ required: true, max: 20 }]}>
<Input placeholder="请输入管理员名" />
</Form.Item>
<Form.Item name="settlementCycles" label="结算周期" rules={[{ required: true}]}>
<InputNumber step={1} min={1} max={100} defaultValue={1} precision={0} />
<InputNumber step={1} min={1} max={100} precision={0} />
</Form.Item>
<Form.Item name="host" label="主机" rules={[{ max: 100 }]}>
<Input placeholder="请输入主机" />
</Form.Item>


<Form.Item name="email" label="电子邮件" rules={[{ required: true, max: 50 }]}>
<Input placeholder="请输入电子邮件" />
</Form.Item>
<Form.Item name="connection" label="数据库连接" rules={[{ max: 200 }]}>
<Input placeholder="请输入数据库连接" />
<Input placeholder="电子邮件是登录账户" />
</Form.Item>
<Form.Item name="phone" label="电话" rules={[{ max: 20 }]}>
<Input placeholder="请输入电话" />
</Form.Item>
<Form.Item name="schema" label="架构" rules={[{ max: 50 }]}>
<Input placeholder="请输入架构" />
</Form.Item>
<Form.Item name="supplyPlatformId" label="供应商平台key" rules={[{ max: 300 }]}>
<Input placeholder="请输入供应商平台key" />
</Form.Item>

<Form.Item name="realmName" label="请求域名" rules={[{ max: 300 }]}>
<Input placeholder="请求域名" />
</Form.Item>


<Form.Item name="remark" label="备注" rules={[{ max: 100 }]}>
<Input placeholder="请输入备注" />
</Form.Item>


+ 1
- 9
src/pages/sys/company/index.jsx View File

@@ -143,7 +143,7 @@ const companyManage = () => {
dataIndex: 'name',
},
{
title: '管理员名',
title: '管理员名',
dataIndex: 'adminName',
},
{
@@ -158,14 +158,6 @@ const companyManage = () => {
title: '电话',
dataIndex: 'phone',
},
{
title: '供应商平台key',
dataIndex: 'supplyPlatformId',
},
{
title: '域名',
dataIndex: 'realmName',
},
{
title: '备注',
dataIndex: 'remark',


+ 2
- 1
src/pages/user/login/index.jsx View File

@@ -67,12 +67,13 @@ const Login = () => {
return;
} else {
const defaultloginFailureMessage = intl.formatMessage({
id: 'pages.login.failure',
id: 'pages.login.accountLogin.tab',
defaultMessage: '账号密码错误!',
});
message.error(defaultloginFailureMessage);
}
} catch (error) {
console.log("fdsafds",error);
const defaultloginFailureMessage = intl.formatMessage({
id: 'pages.login.failure',
defaultMessage: '登录失败,请重试!',


Loading…
Cancel
Save