| | |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="采购合同号:" prop="purchaseContractNumber"> |
| | | <el-select |
| | | v-model="form.purchaseContractNumber" |
| | | placeholder="请选择采购合同号" |
| | | clearable |
| | | filterable |
| | | style="width: 100%" |
| | | :disabled="operationType === 'view'" |
| | | > |
| | | <el-option |
| | | v-for="item in purchaseContractOptions" |
| | | :key="item.purchaseContractNumber" |
| | | :label="item.purchaseContractNumber + ' - ' + item.supplierName" |
| | | :value="item.purchaseContractNumber" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="交货日期:" prop="entryDate"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="form.deliveryDate" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="请选择" |
| | | clearable |
| | | :disabled="operationType === 'view'" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="录入人:" prop="entryPerson"> |
| | | <el-select |
| | | v-model="form.entryPerson" |
| | |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="form.entryDate" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="请选择" |
| | | clearable |
| | | :disabled="operationType === 'view'" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="交货日期:" prop="entryDate"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="form.deliveryDate" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="date" |
| | |
| | | prop="taxExclusiveTotalPrice" |
| | | :formatter="formattedNumber" |
| | | /> |
| | | <el-table-column label="是否生产" prop="isProduction" width="150"> |
| | | <!-- 是否生产列已隐藏,默认值为 false --> |
| | | <!-- <el-table-column label="是否生产" prop="isProduction" width="150"> |
| | | <template #default="scope"> |
| | | <el-tag :type="scope.row.isProduction ? 'success' : 'info'"> |
| | | {{ scope.row.isProduction ? "是" : "否" }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table-column> --> |
| | | <el-table-column |
| | | fixed="right" |
| | | label="操作" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <!-- 是否生产字段已隐藏,默认值为 false --> |
| | | <!-- <el-col :span="12"> |
| | | <el-form-item label="是否生产:" prop="isProduction"> |
| | | <el-radio-group v-model="productForm.isProduction"> |
| | | <el-radio label="是" :value="true" /> |
| | | <el-radio label="否" :value="false" /> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-col> --> |
| | | </el-row> |
| | | </el-form> |
| | | </FormDialog> |
| | |
| | | } from "@/api/salesManagement/salesLedger.js"; |
| | | import { getStockInventoryByModelId } from "@/api/inventoryManagement/stockInventory.js"; |
| | | import { modelList, productTreeList } from "@/api/basicData/product.js"; |
| | | import { purchaseList } from "@/api/procurementManagement/procurementLedger.js"; |
| | | import useFormData from "@/hooks/useFormData.js"; |
| | | import dayjs from "dayjs"; |
| | | import FileUpload from "@/components/AttachmentUpload/file/index.vue"; |
| | |
| | | const customerOption = ref([]); |
| | | const productOptions = ref([]); |
| | | const modelOptions = ref([]); |
| | | const purchaseContractOptions = ref([]); |
| | | const tableLoading = ref(false); |
| | | const page = reactive({ |
| | | current: 1, |
| | |
| | | executionDate: "", |
| | | hasProductionRecord: false, |
| | | createTime: "", |
| | | purchaseContractNumber: "", |
| | | }, |
| | | rules: { |
| | | salesman: [{ required: true, message: "请选择", trigger: "change" }], |
| | |
| | | taxInclusiveTotalPrice: "", |
| | | taxExclusiveTotalPrice: "", |
| | | invoiceType: "", |
| | | isProduction: false, |
| | | isProduction: false, // 默认值为 false(否) |
| | | }, |
| | | productRules: { |
| | | productCategory: [{ required: true, message: "请选择", trigger: "change" }], |
| | |
| | | const getDeliveryBatchNoList = async (productModelId) => { |
| | | if (!productModelId) return []; |
| | | const res = await getStockInventoryByModelId(productModelId); |
| | | const rawList = Array.isArray(res?.data) |
| | | ? res.data |
| | | : res?.data?.records || res?.data?.rows || []; |
| | | const rawList = res.data || []; |
| | | const seenIds = new Set(); |
| | | return rawList |
| | | .filter((item) => { |
| | | if (!item?.id || !item?.batchNo || seenIds.has(item.id)) { |
| | | return false; |
| | | } |
| | | seenIds.add(item.id); |
| | | return true; |
| | | }) |
| | | .map((item) => ({ |
| | | ...item, |
| | | deliveryQuantity: 0, |
| | | })); |
| | | }; |
| | | const validateDeliveryShippingCarNumber = (_rule, value, callback) => { |
| | | if (deliveryForm.value.type === "货车" && !value) { |
| | |
| | | listCustomer({ current: -1, size: -1, type: 0 }).then((res) => { |
| | | customerOption.value = res.data.records; |
| | | }); |
| | | // 获取采购合同列表 |
| | | await getPurchaseContractList(); |
| | | form.value.entryPerson = userStore.id; |
| | | if (type === "add") { |
| | | // 新增时设置录入日期为当天 |
| | |
| | | taxInclusiveTotalPrice: taxInclusiveTotalPrice, |
| | | taxExclusiveTotalPrice: taxExclusiveTotalPrice, |
| | | invoiceType: "增普票", |
| | | isProduction: true, |
| | | isProduction: false, // 默认值为 false(否) |
| | | productId: p.productId, |
| | | productModelId: p.productModelId, |
| | | }; |
| | |
| | | productOperationType.value = type; |
| | | productForm.value = {}; |
| | | if (type === "add") { |
| | | productForm.value.isProduction = true; |
| | | productForm.value.isProduction = false; // 默认值为 false(否) |
| | | } |
| | | proxy.resetForm("productFormRef"); |
| | | if (type === "edit") { |
| | |
| | | } |
| | | productFormVisible.value = true; |
| | | }; |
| | | |
| | | // 获取采购合同列表 |
| | | const getPurchaseContractList = async () => { |
| | | try { |
| | | const res = await purchaseList({ current: -1, size: -1 }); |
| | | purchaseContractOptions.value = res.rows; |
| | | } catch (error) { |
| | | console.error("获取采购合同列表失败", error); |
| | | purchaseContractOptions.value = []; |
| | | } |
| | | }; |
| | | // 提交产品表单 |
| | | const submitProduct = () => { |
| | | proxy.$refs["productFormRef"].validate((valid) => { |