diff --git a/prerelease.bat b/prerelease.bat
new file mode 100644
index 0000000..f418442
--- /dev/null
+++ b/prerelease.bat
@@ -0,0 +1 @@
+npm version prerelease
\ No newline at end of file
diff --git a/src/views/account/Management.jsx b/src/views/account/Management.jsx
index f495de5..4740326 100644
--- a/src/views/account/Management.jsx
+++ b/src/views/account/Management.jsx
@@ -356,7 +356,6 @@ function Management() {
showSizeChanger: true,
showTotal: (total) => { return t('Total') + `:${total}` }
}}
- onChange={(pagination) => { onSearchClick(pagination.current) }}
columns={accountListColumns} dataSource={accountList}
/>
diff --git a/src/views/products/Detail.jsx b/src/views/products/Detail.jsx
index af0ee47..5939a51 100644
--- a/src/views/products/Detail.jsx
+++ b/src/views/products/Detail.jsx
@@ -380,7 +380,7 @@ function Detail() {
};
fetchData();
}, [productsTypes, travel_agency_id, use_year, audit_state, agencyProducts]);
-
+
const flattenTreeData = (tree) => {
let flatList = [];
const flatten = (nodes) => {
@@ -1169,7 +1169,6 @@ function Detail() {
}
{
- !isCanEditable &&
}
diff --git a/src/views/products/Detail/BatchImportPrice.jsx b/src/views/products/Detail/BatchImportPrice.jsx
index 0b35796..723d481 100644
--- a/src/views/products/Detail/BatchImportPrice.jsx
+++ b/src/views/products/Detail/BatchImportPrice.jsx
@@ -1,13 +1,14 @@
-import React, { useState } from 'react';
-import { Button, Card, Checkbox, Col, DatePicker, Form, Input, Row, Select, Space, Tag, Table, InputNumber } from 'antd';
+import { useEffect, useState } from 'react';
+import { Button, Card, Checkbox, Col, DatePicker, Typography, Form, Input, Row, Select, Space, Tag, Table, InputNumber } from 'antd';
import { CloseOutlined } from '@ant-design/icons';
-import dayjs from 'dayjs';
import { useDatePresets } from '@/hooks/useDatePresets';
const { Option } = Select;
const { RangePicker } = DatePicker;
const BatchImportPrice = ({ onBatchImportData }) => {
const [form] = Form.useForm();
+ const [peopleForm] = Form.useForm();
+
const [tags, setTags] = useState([]);
const [minPeople, setMinPeople] = useState('');
const [maxPeople, setMaxPeople] = useState('');
@@ -16,6 +17,35 @@ const BatchImportPrice = ({ onBatchImportData }) => {
const [sendData, setSendData] = useState(null);
const presets = useDatePresets();
+ useEffect(() => {
+ peopleForm.setFieldValue({
+ "items": [
+ {
+ "weekend": [
+ "5",
+ "6",
+ "7"
+ ],
+ "peopleList": [
+ {
+ "peoplePrice": "22",
+ "numberStart": "1",
+ "numberEnd": "2",
+ "audultPrice": "23",
+ "childrenPrice": "44"
+ },
+ {
+ "numberStart": "3",
+ "numberEnd": "5",
+ "audultPrice": "24",
+ "childrenPrice": "12"
+ }
+ ]
+ }
+ ]
+ })
+ })
+
const handleTagClose = (removedTag) => {
setTags(tags.filter(tag => tag !== removedTag));
};
@@ -237,63 +267,228 @@ const BatchImportPrice = ({ onBatchImportData }) => {
...generatePeopleColumns(),
];
+ const PriceInput = (props) => {
+ const { id, value = {}, onChange } = props
+ const [numberStart, setNumberStart] = useState(0)
+ const [numberEnd, setNumberEnd] = useState(0)
+ const [audultPrice, setAudultPrice] = useState(0)
+ const [childrenPrice, setChildrenPrice] = useState(0)
+ const triggerChange = (changedValue) => {
+ onChange?.({
+ numberStart,
+ numberEnd,
+ audultPrice,
+ childrenPrice,
+ ...value,
+ ...changedValue,
+ })
+ }
+ const onNumberStartChange = (e) => {
+ const newNumber = parseInt(e.target.value || '0', 10)
+ if (Number.isNaN(numberStart)) {
+ return
+ }
+ if (!('numberStart' in value)) {
+ setNumberStart(newNumber);
+ }
+ triggerChange({
+ numberStart: newNumber,
+ })
+ }
+ const onNumberEndChange = (e) => {
+ const newNumber = parseInt(e.target.value || '0', 10)
+ if (Number.isNaN(numberEnd)) {
+ return
+ }
+ if (!('numberEnd' in value)) {
+ setNumberEnd(newNumber)
+ }
+ triggerChange({
+ numberEnd: newNumber,
+ });
+ };
+ const onAudultPriceChange = (e) => {
+ const newNumber = parseInt(e.target.value || '0', 10)
+ if (Number.isNaN(audultPrice)) {
+ return
+ }
+ if (!('audultPrice' in value)) {
+ setAudultPrice(newNumber)
+ }
+ triggerChange({
+ audultPrice: newNumber,
+ })
+ }
+ const onChildrenPriceChange = (e) => {
+ const newNumber = parseInt(e.target.value || '0', 10)
+ if (Number.isNaN(childrenPrice)) {
+ return
+ }
+ if (!('childrenPrice' in value)) {
+ setChildrenPrice(newNumber)
+ }
+ triggerChange({
+ childrenPrice: newNumber,
+ })
+ };
+ return (
+
{JSON.stringify(peopleForm.getFieldsValue(), null, 2)}+
{JSON.stringify(form.getFieldsValue(), null, 2)}+