| | |
| | | if (type === "add") { |
| | | // 新增时设置录入日期为当天 |
| | | form.value.entryDate = getCurrentDate(); |
| | | // 业务员默认为许红峰(从下拉框选项中查找) |
| | | const xuHongFeng = userList.value.find(item => item.nickName === "许红峰"); |
| | | if (xuHongFeng) { |
| | | form.value.salesman = xuHongFeng.nickName; |
| | | } |
| | | // 签订日期默认为当天 |
| | | form.value.executionDate = getCurrentDate(); |
| | | } else { |
| | | currentId.value = row.id; |
| | | getSalesLedgerWithProducts({ id: row.id, type: 1 }).then((res) => { |
| | |
| | | if (type === "edit") { |
| | | productForm.value = { ...row }; |
| | | productIndex.value = index; |
| | | } else { |
| | | // 新增时设置默认值 |
| | | productForm.value.taxRate = "13"; // 税率默认为13% |
| | | productForm.value.invoiceType = "增专票"; // 发票类型默认为增专票 |
| | | } |
| | | productFormVisible.value = true; |
| | | getProductOptions(); |