feat: 对比价格是否有修改

perf/export-docx
Jimmy Liow 11 months ago
parent 8e6db3bf85
commit e6af8c1e1e

@ -184,10 +184,16 @@ export const useProductsStore = create(
const prevList = quotationList.filter(q => q.id === formValues.id)
console.info(prevList)
if (prevList.length > 0) {
formValues.use_dates_start = formValues.use_dates[0].format('YYYY-MM-DD')
formValues.use_dates_end = formValues.use_dates[1].format('YYYY-MM-DD')
const prevQuotation = prevList[0]
console.info('formValues: ', formValues)
console.info('prevQuotation: ', prevQuotation)
// 对比报价前后是否有改动
for (const [key, value] of Object.entries(formValues)) {
if (key === 'use_dates') continue
const prevValue = prevQuotation[key]
const hasChanged = prevValue === value
console.log(`${key}: ${prevValue} - ${value} (${hasChanged})`)

Loading…
Cancel
Save