| | |
| | | delProduct, |
| | | delLedgerFile, getProductInventory, cancelDelivery, |
| | | } from "@/api/salesManagement/salesLedger.js"; |
| | | import { modelList, productTreeList } from "@/api/basicData/product.js"; |
| | | import { modelList } from "@/api/basicData/product.js"; |
| | | import useFormData from "@/hooks/useFormData.js"; |
| | | import dayjs from "dayjs"; |
| | | import { getCurrentDate } from "@/utils/index.js"; |
| | |
| | | const productSelectVisible = ref(false); |
| | | const productFormData = reactive({ |
| | | productForm: { |
| | | productId: "", |
| | | productModelId: "", |
| | | productCategory: "", |
| | | material: "", |
| | | specificationModel: "", |
| | |
| | | // 获取产品大类tree数据 |
| | | const getProductOptions = () => { |
| | | // 返回 Promise,便于在编辑产品时等待加载完成 |
| | | return productTreeList().then((res) => { |
| | | productOptions.value = convertIdToValue(res); |
| | | return productOptions.value; |
| | | }); |
| | | productOptions.value = []; |
| | | return Promise.resolve(productOptions.value); |
| | | }; |
| | | const formattedNumber = (row, column, cellValue) => { |
| | | return parseFloat(cellValue).toFixed(2); |
| | |
| | | const taxExclusiveTotalPrice = proxy.calculateTaxExclusiveTotalPrice(taxInclusiveTotalPrice, taxRate); |
| | | return { |
| | | // 台账字段 |
| | | productId: p.productId || "", |
| | | productModelId: p.productModelId || p.specificationId || "", |
| | | productCategory: p.product || p.productName || "", |
| | | material: p.material || "", |
| | | specificationModel: p.specification || "", |
| | |
| | | const handleProductSelect = (selectedProducts) => { |
| | | if (selectedProducts && selectedProducts.length > 0) { |
| | | const product = selectedProducts[0]; |
| | | productForm.value.productId = product.productId; |
| | | productForm.value.productModelId = product.id; |
| | | productForm.value.productCategory = product.productName; |
| | | productForm.value.material = product.material || ""; |
| | | productForm.value.specificationModel = product.model; |