|
|
|
|
@ -242,14 +242,14 @@ const ProductInfoQuotation = ({ editable, ...props }) => {
|
|
|
|
|
|
|
|
|
|
const [isQuotationModalOpen, setQuotationModalOpen] = useState(false)
|
|
|
|
|
const [isBatchSetupModalOpen, setBatchSetupModalOpen] = useState(false)
|
|
|
|
|
const { modal } = App.useApp();
|
|
|
|
|
const { modal, notification } = App.useApp();
|
|
|
|
|
const [quotationForm] = Form.useForm()
|
|
|
|
|
const [batchSetupForm] = Form.useForm()
|
|
|
|
|
|
|
|
|
|
const datePresets = useDatePresets()
|
|
|
|
|
|
|
|
|
|
const [quotationList, newEmptyQuotation, appendQuotationList, saveOrUpdateQuotation, deleteQuotation] =
|
|
|
|
|
useProductsStore((state) => [state.quotationList, state.newEmptyQuotation, state.appendQuotationList, state.saveOrUpdateQuotation, state.deleteQuotation])
|
|
|
|
|
const [quotationList, newEmptyQuotation, appendQuotationList, saveOrUpdateQuotation, deleteQuotationById] =
|
|
|
|
|
useProductsStore((state) => [state.quotationList, state.newEmptyQuotation, state.appendQuotationList, state.saveOrUpdateQuotation, state.deleteQuotationById])
|
|
|
|
|
|
|
|
|
|
const triggerChange = (changedValue) => {
|
|
|
|
|
onChange?.(
|
|
|
|
|
@ -284,6 +284,26 @@ const ProductInfoQuotation = ({ editable, ...props }) => {
|
|
|
|
|
setBatchSetupModalOpen(false)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const onDeleteQuotation = (quotationId) => {
|
|
|
|
|
modal.confirm({
|
|
|
|
|
title: '请确认',
|
|
|
|
|
icon: <ExclamationCircleFilled />,
|
|
|
|
|
content: '你要删除这条价格吗?',
|
|
|
|
|
onOk() {
|
|
|
|
|
deleteQuotationById(quotationId)
|
|
|
|
|
.catch(ex => {
|
|
|
|
|
console.info(ex.message)
|
|
|
|
|
notification.error({
|
|
|
|
|
message: 'Notification',
|
|
|
|
|
description: ex.message,
|
|
|
|
|
placement: 'top',
|
|
|
|
|
duration: 4,
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const quotationColumns = [
|
|
|
|
|
{ title: t('products:adultPrice'), dataIndex: 'adult_cost', width: '4rem' },
|
|
|
|
|
{ title: t('products:childrenPrice'), dataIndex: 'child_cost', width: '4rem' },
|
|
|
|
|
@ -317,16 +337,7 @@ const ProductInfoQuotation = ({ editable, ...props }) => {
|
|
|
|
|
return (
|
|
|
|
|
<Space>
|
|
|
|
|
<Button type='link' onClick={() => onQuotationSeleted(quotation)}>{t('Edit')}</Button>
|
|
|
|
|
<Button type='link' danger onClick={() => {
|
|
|
|
|
modal.confirm({
|
|
|
|
|
title: '请确认',
|
|
|
|
|
icon: <ExclamationCircleFilled />,
|
|
|
|
|
content: '你要删除这条价格吗?',
|
|
|
|
|
onOk() {
|
|
|
|
|
deleteQuotation(quotation.id)
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
}}>{t('Delete')}</Button>
|
|
|
|
|
<Button type='link' danger onClick={() => onDeleteQuotation(quotation.id)}>{t('Delete')}</Button>
|
|
|
|
|
</Space>
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
|