|
|
|
@ -236,6 +236,9 @@ const defaultDefinitionValue = {
|
|
|
|
|
|
|
|
|
|
const ProductInfoQuotation = ({ editable, ...props }) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { id, value = {}, onChange } = props
|
|
|
|
|
|
|
|
|
|
const { t } = useTranslation()
|
|
|
|
|
|
|
|
|
|
const [isQuotationModalOpen, setQuotationModalOpen] = useState(false)
|
|
|
|
@ -243,14 +246,18 @@ const ProductInfoQuotation = ({ editable, ...props }) => {
|
|
|
|
|
const [quotationForm] = Form.useForm()
|
|
|
|
|
const [batchSetupForm] = Form.useForm()
|
|
|
|
|
|
|
|
|
|
// console.info('value: ', value)
|
|
|
|
|
|
|
|
|
|
const datePresets = useDatePresets()
|
|
|
|
|
|
|
|
|
|
const [newEmptyQuotation, appendQuotationList, quotationList, saveOrUpdateQuotation] =
|
|
|
|
|
useProductsStore((state) => [state.newEmptyQuotation, state.appendQuotationList, state.quotationList, state.saveOrUpdateQuotation])
|
|
|
|
|
const [quotationList, newEmptyQuotation, appendQuotationList, saveOrUpdateQuotation] =
|
|
|
|
|
useProductsStore((state) => [state.quotationList, state.newEmptyQuotation, state.appendQuotationList, state.saveOrUpdateQuotation])
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
console.info('quotationList: ', quotationList)
|
|
|
|
|
}, [quotationList])
|
|
|
|
|
const triggerChange = (changedValue) => {
|
|
|
|
|
onChange?.({
|
|
|
|
|
quotationList
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const onQuotationSeleted = async (quotation) => {
|
|
|
|
|
// 把 start, end 转换为 RangePicker 数组格式
|
|
|
|
@ -267,6 +274,7 @@ const ProductInfoQuotation = ({ editable, ...props }) => {
|
|
|
|
|
|
|
|
|
|
const onQuotationFinish = (values) => {
|
|
|
|
|
saveOrUpdateQuotation(values)
|
|
|
|
|
triggerChange(quotationList)
|
|
|
|
|
setQuotationModalOpen(false)
|
|
|
|
|
// .then(() => {
|
|
|
|
|
// setQuotationModalOpen(false)
|
|
|
|
|