|
|
|
@ -236,8 +236,7 @@ const defaultDefinitionValue = {
|
|
|
|
|
|
|
|
|
|
const ProductInfoQuotation = ({ editable, ...props }) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { id, value = {}, onChange } = props
|
|
|
|
|
const { onChange } = props
|
|
|
|
|
|
|
|
|
|
const { t } = useTranslation()
|
|
|
|
|
|
|
|
|
@ -246,17 +245,15 @@ const ProductInfoQuotation = ({ editable, ...props }) => {
|
|
|
|
|
const [quotationForm] = Form.useForm()
|
|
|
|
|
const [batchSetupForm] = Form.useForm()
|
|
|
|
|
|
|
|
|
|
// console.info('value: ', value)
|
|
|
|
|
|
|
|
|
|
const datePresets = useDatePresets()
|
|
|
|
|
|
|
|
|
|
const [quotationList, newEmptyQuotation, appendQuotationList, saveOrUpdateQuotation] =
|
|
|
|
|
useProductsStore((state) => [state.quotationList, state.newEmptyQuotation, state.appendQuotationList, state.saveOrUpdateQuotation])
|
|
|
|
|
const [quotationList, newEmptyQuotation, appendQuotationList, saveOrUpdateQuotation, deleteQuotation] =
|
|
|
|
|
useProductsStore((state) => [state.quotationList, state.newEmptyQuotation, state.appendQuotationList, state.saveOrUpdateQuotation, state.deleteQuotation])
|
|
|
|
|
|
|
|
|
|
const triggerChange = (changedValue) => {
|
|
|
|
|
onChange?.({
|
|
|
|
|
quotationList
|
|
|
|
|
})
|
|
|
|
|
onChange?.(
|
|
|
|
|
changedValue
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const onQuotationSeleted = async (quotation) => {
|
|
|
|
@ -273,20 +270,9 @@ const ProductInfoQuotation = ({ editable, ...props }) => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const onQuotationFinish = (values) => {
|
|
|
|
|
saveOrUpdateQuotation(values)
|
|
|
|
|
triggerChange(quotationList)
|
|
|
|
|
const newList = saveOrUpdateQuotation(values)
|
|
|
|
|
triggerChange(newList)
|
|
|
|
|
setQuotationModalOpen(false)
|
|
|
|
|
// .then(() => {
|
|
|
|
|
// setQuotationModalOpen(false)
|
|
|
|
|
// })
|
|
|
|
|
// .catch(ex => {
|
|
|
|
|
// notification.error({
|
|
|
|
|
// message: 'Notification',
|
|
|
|
|
// description: ex.message,
|
|
|
|
|
// placement: 'top',
|
|
|
|
|
// duration: 4,
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const onBatchSetupFinish = () => {
|
|
|
|
@ -356,7 +342,7 @@ const ProductInfoQuotation = ({ editable, ...props }) => {
|
|
|
|
|
icon: <ExclamationCircleFilled />,
|
|
|
|
|
content: '你要删除这条价格吗?',
|
|
|
|
|
onOk() {
|
|
|
|
|
console.log('OK');
|
|
|
|
|
deleteQuotation(quotation.id)
|
|
|
|
|
},
|
|
|
|
|
onCancel() {
|
|
|
|
|
console.log('Cancel');
|
|
|
|
|