| | |
| | | </el-dropdown-menu> |
| | | </template> |
| | | </el-dropdown> |
| | | <el-button type="primary" plain @click="handlePrintLabel">打印标签</el-button> |
| | | </div> |
| | | </div> |
| | | <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange" |
| | |
| | | getProcessCard, |
| | | getSalesOrder, |
| | | getSalesInvoices, |
| | | getSalesLabel, |
| | | } from "@/api/salesManagement/salesLedger.js"; |
| | | import { modelList, productTreeList } from "@/api/basicData/product.js"; |
| | | import useFormData from "@/hooks/useFormData.js"; |
| | |
| | | import { printFinishedProcessCard } from "./components/processCardPrint.js"; |
| | | import { printSalesOrder } from "./components/salesOrderPrint.js"; |
| | | import { printSalesDeliveryNote } from "./components/salesDeliveryPrint.js"; |
| | | import { printSalesLabel } from "./components/salesLabelPrint.js"; |
| | | // import { salesLedgerProductSetProcessFlowConfig } from "@/api/salesManagement/salesProcessFlowConfig.js"; |
| | | |
| | | const userStore = useUserStore(); |
| | |
| | | } |
| | | }; |
| | | |
| | | const handlePrintLabel = async () => { |
| | | if (selectedRows.value.length !== 1) { |
| | | proxy.$modal.msgWarning("请选择一条销售台账数据进行标签打印"); |
| | | return; |
| | | } |
| | | |
| | | const selectedId = selectedRows.value[0]?.id; |
| | | if (!selectedId) { |
| | | proxy.$modal.msgWarning("当前选择数据缺少ID,无法打印标签"); |
| | | return; |
| | | } |
| | | |
| | | proxy.$modal.loading("正在获取标签数据,请稍候..."); |
| | | try { |
| | | const res = await getSalesLabel(selectedId); |
| | | const labelList = res?.data ?? []; |
| | | if (!Array.isArray(labelList) || labelList.length === 0) { |
| | | proxy.$modal.msgWarning("暂无可打印标签数据"); |
| | | return; |
| | | } |
| | | printSalesLabel(labelList); |
| | | } catch (error) { |
| | | console.error("打印标签失败:", error); |
| | | proxy.$modal.msgError("打印标签失败,请稍后重试"); |
| | | } finally { |
| | | proxy.$modal.closeLoading(); |
| | | } |
| | | }; |
| | | |
| | | const mathNum = () => { |
| | | console.log("productForm.value", productForm.value); |
| | | if (!productForm.value.taxInclusiveUnitPrice) { |