|
|
|
@ -13,6 +13,7 @@ import {
|
|
|
|
|
DatePicker,
|
|
|
|
|
Space,
|
|
|
|
|
App,
|
|
|
|
|
Popconfirm,
|
|
|
|
|
Tooltip,
|
|
|
|
|
} from "antd";
|
|
|
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
@ -20,7 +21,6 @@ import {
|
|
|
|
|
CloseOutlined,
|
|
|
|
|
StarTwoTone,
|
|
|
|
|
PlusOutlined,
|
|
|
|
|
ExclamationCircleFilled,
|
|
|
|
|
QuestionCircleOutlined,
|
|
|
|
|
} from "@ant-design/icons";
|
|
|
|
|
import { useDatePresets } from "@/hooks/useDatePresets";
|
|
|
|
@ -179,7 +179,7 @@ const ProductInfoQuotation = ({ editable, ...props }) => {
|
|
|
|
|
const [isBatchSetupModalOpen, setBatchSetupModalOpen] = useState(false);
|
|
|
|
|
const [groupAllSize, setGroupAllSize] = useState(false);
|
|
|
|
|
const [groupMaxUnlimit, setGroupMaxUnlimit] = useState(false);
|
|
|
|
|
const { modal, notification } = App.useApp();
|
|
|
|
|
const { notification } = App.useApp();
|
|
|
|
|
const [quotationForm] = Form.useForm();
|
|
|
|
|
const [batchSetupForm] = Form.useForm();
|
|
|
|
|
|
|
|
|
@ -206,6 +206,7 @@ const ProductInfoQuotation = ({ editable, ...props }) => {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onNewQuotation = () => {
|
|
|
|
|
setGroupAllSize(false); // 新报价不分人等
|
|
|
|
|
const emptyQuotation = newEmptyQuotation(defaultUseDates);
|
|
|
|
|
quotationForm.setFieldsValue(emptyQuotation);
|
|
|
|
|
setQuotationModalOpen(true);
|
|
|
|
@ -224,24 +225,6 @@ const ProductInfoQuotation = ({ editable, ...props }) => {
|
|
|
|
|
setBatchSetupModalOpen(false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onDeleteQuotation = (quotation) => {
|
|
|
|
|
modal.confirm({
|
|
|
|
|
title: "请确认",
|
|
|
|
|
icon: <ExclamationCircleFilled />,
|
|
|
|
|
content: "你要删除这条价格吗?",
|
|
|
|
|
onOk() {
|
|
|
|
|
deleteQuotation(quotation).catch((ex) => {
|
|
|
|
|
notification.error({
|
|
|
|
|
message: "Notification",
|
|
|
|
|
description: ex.message,
|
|
|
|
|
placement: "top",
|
|
|
|
|
duration: 4,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const quotationColumns = [
|
|
|
|
|
// { title: 'id', dataIndex: 'id', width: 40, className: 'italic text-gray-400' }, // test: 0
|
|
|
|
|
// { title: 'WPI_SN', dataIndex: 'WPI_SN', width: 40, className: 'italic text-gray-400' }, // test: 0
|
|
|
|
@ -256,10 +239,7 @@ const ProductInfoQuotation = ({ editable, ...props }) => {
|
|
|
|
|
title: (
|
|
|
|
|
<>
|
|
|
|
|
{t("products:unit_name")}{" "}
|
|
|
|
|
<Tooltip
|
|
|
|
|
placement="top"
|
|
|
|
|
title={t("products:FormTooltip.PriceUnit")}
|
|
|
|
|
>
|
|
|
|
|
<Tooltip placement="top" title={t("products:FormTooltip.PriceUnit")}>
|
|
|
|
|
<QuestionCircleOutlined className="text-gray-500" />
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</>
|
|
|
|
@ -282,7 +262,7 @@ const ProductInfoQuotation = ({ editable, ...props }) => {
|
|
|
|
|
{t("products:use_dates")}{" "}
|
|
|
|
|
<Tooltip
|
|
|
|
|
placement="top"
|
|
|
|
|
styles={{ body: {width: "24rem"} }}
|
|
|
|
|
styles={{ body: { width: "24rem" } }}
|
|
|
|
|
title={t("products:FormTooltip.UseDates")}
|
|
|
|
|
>
|
|
|
|
|
<QuestionCircleOutlined className="text-gray-500" />
|
|
|
|
@ -290,7 +270,6 @@ const ProductInfoQuotation = ({ editable, ...props }) => {
|
|
|
|
|
</>
|
|
|
|
|
),
|
|
|
|
|
dataIndex: "use_dates",
|
|
|
|
|
// width: '6rem',
|
|
|
|
|
render: (_, record) =>
|
|
|
|
|
`${record.use_dates_start}-${record.use_dates_end}`,
|
|
|
|
|
},
|
|
|
|
@ -301,25 +280,37 @@ const ProductInfoQuotation = ({ editable, ...props }) => {
|
|
|
|
|
dataIndex: "operation",
|
|
|
|
|
width: "10rem",
|
|
|
|
|
render: (_, quotation) => {
|
|
|
|
|
// const _rowEditable = [-1,3].includes(quotation.audit_state_id);
|
|
|
|
|
const _rowEditable = true; // test: 0
|
|
|
|
|
return (
|
|
|
|
|
<Space>
|
|
|
|
|
<Button
|
|
|
|
|
type="link"
|
|
|
|
|
disabled={!_rowEditable}
|
|
|
|
|
onClick={() => onQuotationSeleted(quotation)}
|
|
|
|
|
>
|
|
|
|
|
{t("Edit")}
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
type="link"
|
|
|
|
|
danger
|
|
|
|
|
disabled={!_rowEditable}
|
|
|
|
|
onClick={() => onDeleteQuotation(quotation)}
|
|
|
|
|
<Popconfirm
|
|
|
|
|
placement="topRight"
|
|
|
|
|
icon={<QuestionCircleOutlined style={{ color: "red" }} />}
|
|
|
|
|
title="请确认"
|
|
|
|
|
description="你要删除这条价格吗?"
|
|
|
|
|
onConfirm={() => {
|
|
|
|
|
deleteQuotation(quotation).catch((ex) => {
|
|
|
|
|
notification.error({
|
|
|
|
|
message: "Notification",
|
|
|
|
|
description: ex.message,
|
|
|
|
|
placement: "top",
|
|
|
|
|
duration: 4,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{t("Delete")}
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
type="link"
|
|
|
|
|
danger
|
|
|
|
|
>
|
|
|
|
|
{t("Delete")}
|
|
|
|
|
</Button>
|
|
|
|
|
</Popconfirm>
|
|
|
|
|
</Space>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|