Commit 67c49371 authored by 武广's avatar 武广

fix: 修改样式

parent 05e6425b
const isProduction = process.env.NODE_ENV === 'production'; const isProduction = process.env.NODE_ENV === 'production';
const isPre = process.env.PRE_ENV === 'pre'; const isPre = process.env.PRE_ENV === 'pre';
const environment = 'sc1'; const environment = 'yxm2';
const envAPi = { const envAPi = {
api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net', api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net',
kdspOpApi: `https://sc-merchant-api-${environment}.liangkebang.net`, kdspOpApi: `https://sc-merchant-api-${environment}.liangkebang.net`,
......
import React from 'react'; import React from 'react';
import { Modal, Form, Input } from 'antd'; import { Modal, Form, InputNumber } from 'antd';
import styles from '../../style.less';
const MinimumPurchase = options => { const MinimumPurchase = options => {
const [form] = Form.useForm(); const [form] = Form.useForm();
...@@ -36,12 +37,9 @@ const MinimumPurchase = options => { ...@@ -36,12 +37,9 @@ const MinimumPurchase = options => {
<Form.Item <Form.Item
label="最少购买/份" label="最少购买/份"
name="minPurchaseNum" name="minPurchaseNum"
rules={[ rules={[{ required: true, message: '请输入最少购买数量!' }]}
{ required: true, message: '请输入最少购买数量!' },
{ min: 1, message: '最小输入1' },
]}
> >
<Input maxLength={6} type="number" /> <InputNumber min={1} max={999999} className={styles.inputWdith} />
</Form.Item> </Form.Item>
</Form> </Form>
</Modal> </Modal>
......
...@@ -22,7 +22,8 @@ const Takeaway = options => { ...@@ -22,7 +22,8 @@ const Takeaway = options => {
const [shopId, setShopId] = useState(0); const [shopId, setShopId] = useState(0);
const [groupId, setGroupId] = useState(0); const [groupId, setGroupId] = useState(0);
const [pageNo, setPageNo] = useState(1); const [pageNo, setPageNo] = useState(1);
const [pageSize, setPageSize] = useState(50); const [pageSize, setPageSize] = useState(30);
const [total, setTotal] = useState(0);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [actionLoading, setActionLoading] = useState(false); const [actionLoading, setActionLoading] = useState(false);
const [visibleWeekTime, setVisibleWeekTime] = useState(false); const [visibleWeekTime, setVisibleWeekTime] = useState(false);
...@@ -36,12 +37,12 @@ const Takeaway = options => { ...@@ -36,12 +37,12 @@ const Takeaway = options => {
onChange: setSelectedRowKeys, onChange: setSelectedRowKeys,
}; };
const getDataList = async () => { const getDataList = async (page, size) => {
setLoading(true); setLoading(true);
const params = Object.assign({}, options.searchValue, { const params = Object.assign({}, options.searchValue, {
pageNo, pageNo: page || pageNo,
productType: 5, productType: 5,
pageSize, pageSize: size || pageSize,
storageRackId: groupId, storageRackId: groupId,
}); });
const productCategoryId = options.searchValue?.productCategoryId || []; const productCategoryId = options.searchValue?.productCategoryId || [];
...@@ -51,6 +52,7 @@ const Takeaway = options => { ...@@ -51,6 +52,7 @@ const Takeaway = options => {
setLoading(false); setLoading(false);
if (res && res.data) { if (res && res.data) {
setTableData(res.data.records); setTableData(res.data.records);
setTotal(res.data.total);
} }
}; };
const onPageChange = (page, size) => { const onPageChange = (page, size) => {
...@@ -58,7 +60,7 @@ const Takeaway = options => { ...@@ -58,7 +60,7 @@ const Takeaway = options => {
setPageNo(page); setPageNo(page);
setPageSize(size); setPageSize(size);
}); });
getDataList(); getDataList(page, size);
}; };
const onSortEnd = async ({ oldIndex, newIndex }) => { const onSortEnd = async ({ oldIndex, newIndex }) => {
...@@ -66,7 +68,7 @@ const Takeaway = options => { ...@@ -66,7 +68,7 @@ const Takeaway = options => {
const newData = arrayMoveImmutable(tableData.slice(), oldIndex, newIndex).filter(el => !!el); const newData = arrayMoveImmutable(tableData.slice(), oldIndex, newIndex).filter(el => !!el);
const skuSorts = newData.map((item, index) => ({ const skuSorts = newData.map((item, index) => ({
skuId: item.skuId, skuId: item.skuId,
sort: index + 1, sort: pageSize * pageNo + index + 1,
})); }));
const params = { const params = {
storageRackId: groupId, storageRackId: groupId,
...@@ -107,6 +109,8 @@ const Takeaway = options => { ...@@ -107,6 +109,8 @@ const Takeaway = options => {
}; };
setActionLoading(true); setActionLoading(true);
const res = await apiGoodsActionBatch(Object.assign({}, json, params)); const res = await apiGoodsActionBatch(Object.assign({}, json, params));
if (res.businessCode === '0000' && res.code === '0000') {
message.success('处理成功!');
unstable_batchedUpdates(() => { unstable_batchedUpdates(() => {
setActionLoading(false); setActionLoading(false);
setVisibleWeekTime(false); setVisibleWeekTime(false);
...@@ -116,8 +120,6 @@ const Takeaway = options => { ...@@ -116,8 +120,6 @@ const Takeaway = options => {
setVisibleSend(false); setVisibleSend(false);
}); });
getDataList(); getDataList();
if (res.businessCode === '0000' && res.code === '0000') {
message.success('处理成功!');
} }
}; };
...@@ -188,7 +190,7 @@ const Takeaway = options => { ...@@ -188,7 +190,7 @@ const Takeaway = options => {
columns={takeawayColumn(actions)} columns={takeawayColumn(actions)}
rowKey={record => record.skuId} rowKey={record => record.skuId}
pagination={false} pagination={false}
scroll={{ x: '100%', y: 1000 }} scroll={{ x: '100%', y: 500 }}
rowSelection={rowSelection} rowSelection={rowSelection}
components={{ components={{
body: { body: {
...@@ -202,8 +204,8 @@ const Takeaway = options => { ...@@ -202,8 +204,8 @@ const Takeaway = options => {
<Pagination <Pagination
className={styles['takeawayBox--page']} className={styles['takeawayBox--page']}
onChange={onPageChange} onChange={onPageChange}
total={tableData.total} total={total}
showTotal={total => `共${total}条`} showTotal={o => `共${o}条`}
current={pageNo} current={pageNo}
pageSize={pageSize} pageSize={pageSize}
showSizeChanger showSizeChanger
......
...@@ -288,3 +288,6 @@ ...@@ -288,3 +288,6 @@
width: 100%; width: 100%;
} }
} }
.inputWdith {
width: 100%;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment