Quellcode durchsuchen

Merge branch 'master' of http://10.2.1.24:10244/bpa/BPA.KitChen.Web

tags/小炒逻辑变更前
txb vor 2 Jahren
Ursprung
Commit
1213b79b99
4 geänderte Dateien mit 107 neuen und 35 gelöschten Zeilen
  1. +97
    -14
      src/pages/activity/activityInfo/components/CreateForm.jsx
  2. +5
    -6
      src/pages/activity/activityInfo/index.jsx
  3. +0
    -10
      src/pages/crm/coupon/coupon-Batch/index.jsx
  4. +5
    -5
      src/pages/crm/coupon/couponInfo/components/CreateForm.jsx

+ 97
- 14
src/pages/activity/activityInfo/components/CreateForm.jsx Datei anzeigen

@@ -3,6 +3,7 @@ import {
InputNumber,
Row,
Col,
Switch,
Checkbox,
Space,
Steps,
@@ -123,6 +124,7 @@ const CreateForm = (props) => {
result = quantityLimit[key].limit;
}
}
console.log(result);
return result;
};
const uploadProp = {
@@ -151,7 +153,17 @@ const CreateForm = (props) => {
let fileData = null;
GetCosRequestURL({ directory: "activity", fileExtension: ext, method: "PUT" }).then((r) => {
action = r.allUrl;
var index = file.name.lastIndexOf(".");
//获取后缀
var ext = file.name.substr(index + 1);
const reader = new FileReader();

if (['png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp', 'psd', 'svg', 'tiff'].indexOf(ext) == -1)
{
message.error(`${file.name} 不是图片文件`);
return;
}

reader.readAsArrayBuffer(file);
reader.onload = (e) => {
fileData = e.target.result;
@@ -252,25 +264,89 @@ const CreateForm = (props) => {
{'买满赠送(商品)'}
</Option>
<Option key={6} value={6}>
{'消费次数换购(阶梯)'}
{'累计消费换购(阶梯)'}
</Option>
<Option key={7} value={7}>
{'消费次数换购(循环)'}
{'累计消费换购(循环)'}
</Option >
<Option key={8} value={8}>
{'加价换购'}
</Option>
</Select >
</Form.Item >

<Form.Item
noStyle
shouldUpdate={(prevValues, currentValues) =>
prevValues.activityType !== currentValues.activityType
}
>
} >
{({ getFieldValue }) =>
(getFieldValue('activityType') == '6' || getFieldValue('activityType') == '7') ? (
<Form.Item>
<Form.Item
name="isGiftGoodsParticipate"
label="赠送商品是否参与活动"
rules={[
{
required: true,
},
]}
>
<Select
showSearch
optionFilterProp="children"
filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
placeholder="请选活动消费类型"
>
<Option key={1} value={1}>
{'是'}
</Option>
<Option key={0} value={0}>
{'否'}
</Option>
</Select >
</Form.Item>
<Form.Item
name="consumptionType"
label="活动消费类型"
rules={[
{
required: true,
},
]}
>
<Select
showSearch
optionFilterProp="children"
filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
placeholder="请选活动消费类型"
>
<Option key={1} value={1}>
{'钱(元)'}
</Option>
<Option key={2} value={2}>
{'数量(杯/碗/盒/个/.....)'}
</Option>
</Select >
</Form.Item>
</Form.Item>

) : null
}
</Form.Item>



<Form.Item
noStyle
shouldUpdate={(prevValues, currentValues) =>
prevValues.activityType !== currentValues.activityType
} >
{({ getFieldValue }) =>
// (getFieldValue('activityType') == '6' || getFieldValue('activityType') == '7') ? (

// <Form.Item label="消费次数">
@@ -376,12 +452,12 @@ const CreateForm = (props) => {
})}
</Select>) :
(getFieldValue('activityType') == '5' || getFieldValue('activityType') == '8') ? (
<Select style={{ width: 200 }}
showSearch
optionFilterProp="children"
filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
} >
<Select style={{ width: 200 }}
showSearch
optionFilterProp="children"
filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
} >
{goodsInfo.map((item, index) => {
return (
<Option index={index} value={item.id} key={item.id}>
@@ -533,7 +609,7 @@ const CreateForm = (props) => {
type: 'number',
min: 0,
max: parseInt(
getFieldValue('activityType') == 4 ? 999999999 : canUseCountOrlimit(key, props.values.activityRewards, 2),
getFieldValue('activityType') == 4 ? 999999999 : canUseCountOrlimit(key, props.values.activityRewards, 1),
),
message: '超出领取限制',
},
@@ -541,7 +617,7 @@ const CreateForm = (props) => {
>
<InputNumber
min={0}
max={getFieldValue('activityType') == 4 ? 999999999 : canUseCountOrlimit(key, props.values.activityRewards, 2)}
max={getFieldValue('activityType') == 4 ? 999999999 : canUseCountOrlimit(key, props.values.activityRewards, 1)}
placeholder={getFieldValue('activityType') == 4 ? "兑换值" : "每次领取数量"}
/>
</Form.Item>
@@ -571,7 +647,10 @@ const CreateForm = (props) => {
style={{ float: 'left' }}
rules={[{ required: true }]}
>
<DatePicker placeholder="开始时间" />
<DatePicker placeholder="开始时间"
disabledDate={(current) => {
return current && current > form.getFieldValue('activityEndTime');
}} />
</Form.Item>
<Form.Item
name="activityEndTime"
@@ -579,7 +658,11 @@ const CreateForm = (props) => {
style={{ float: 'left', marginLeft: 20 }}
rules={[{ required: true }]}
>
<DatePicker placeholder="结束时间" />
<DatePicker placeholder="结束时间"
disabledDate={(current) => {

return current && current < form.getFieldValue('activityStartTime');
}} />
</Form.Item>
</Form.Item>
</Form.Item>


+ 5
- 6
src/pages/activity/activityInfo/index.jsx Datei anzeigen

@@ -86,9 +86,8 @@ const activityInfManage = () => {
const handleUpdate = async (fields) => {
message.loading('正在修改...', key);
try {
debugger
if(fields.activityType==3){
debugger
fields.activityRewards.forEach(element => {
element.value=`[${element.value.join()}]`
});
@@ -164,8 +163,8 @@ const activityInfManage = () => {
3: { text: '商品促销', status: 'Success' },
4: { text: '买满赠送(优惠券)', status: 'Success' },
5: { text: '买满赠送(商品)', status: 'Success' },
6: { text: '消费次数换购(阶梯)', status: 'Success' },
7: { text: '消费次数换购(循环)', status: 'Success' },
6: { text: '累计消费换购(阶梯)', status: 'Success' },
7: { text: '累计消费换购(循环)', status: 'Success' },
8: { text: '加价换购', status: 'Success' },
},
},
@@ -203,8 +202,8 @@ const activityInfManage = () => {
title: '是否后台计算',
dataIndex: 'isAutoSend',
valueEnum: {
0: { text: '不显示', status: 'Processing' },
1: { text: '显示', status: 'Error' },
0: { text: '点击参与', status: 'Processing' },
1: { text: '后台计算', status: 'Error' },
},
render: (_, record) => (
<>


+ 0
- 10
src/pages/crm/coupon/coupon-Batch/index.jsx Datei anzeigen

@@ -33,16 +33,6 @@ const CouponBatch = () => {
dataIndex: 'couponTitle',
valueType: 'textarea',
},
{
title: '使用范围',
key: 'rangeType',
dataIndex: 'rangeType',
valueEnum: {
1: { text: '店铺' },
2: { text: '加盟商' },
3: { text: '区域' },
},
},
{
title: '发放数量',
dataIndex: 'sendNum',


+ 5
- 5
src/pages/crm/coupon/couponInfo/components/CreateForm.jsx Datei anzeigen

@@ -77,9 +77,9 @@ const CreateForm = (props) => {
</Select>
</Form.Item>
<Form.Item {...tailFormItemLayout} style={{ height: 32 }}>
<Form.Item label="优惠金额" style={{ float: 'left' }} rules={[{ required: true }]}>
<Form.Item label="优惠金额" style={{ float: 'left' }} rules={[{ required: true }]}>
<Form.Item name="couponValue" noStyle>
<InputNumber placeholder="金额" min={0} />
<InputNumber placeholder="金额" min={0} precision={2} />
</Form.Item>
</Form.Item>
<Form.Item
@@ -88,7 +88,7 @@ const CreateForm = (props) => {
rules={[{ required: true }]}
>
<Form.Item name="condition" noStyle>
<InputNumber placeholder="使用条件" min={0} />
<InputNumber placeholder="使用条件" min={0} precision={2} />
</Form.Item>
</Form.Item>
<Form.Item
@@ -97,7 +97,7 @@ const CreateForm = (props) => {
rules={[{ required: true }]}
>
<Form.Item name="getLimit" noStyle>
<InputNumber placeholder="可领数量" min={0} decimalSeparator='0' />
<InputNumber placeholder="可领数量" min={0} decimalSeparator='0' precision={2} />
</Form.Item>
<span style={{ color: '#FFCC52' }}> 0 为不限制</span>
</Form.Item>
@@ -120,7 +120,7 @@ const CreateForm = (props) => {
getFieldValue('timeType') == '2' ? (
<Form.Item label="固定时间" rules={[{ required: true }]}>
<Form.Item name="validFixedTerm" noStyle>
<InputNumber placeholder="" min={0} />
<InputNumber placeholder="" precision={0} min={0} />
</Form.Item>
</Form.Item>
) : (


Laden…
Abbrechen
Speichern