Merge branch 'dev_NEW_pro' into dev_pro_山西长治
| | |
| | | method: "delete", |
| | | }); |
| | | } |
| | | |
| | | /** 根据客户id查询开票申请台账 */ |
| | | export function getAccountInvoiceApplicationList(query) { |
| | | return request({ |
| | | url: '/accountInvoiceApplication/getAccountInvoiceApplicationList', |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | |
| | | params: query, |
| | | }); |
| | | } |
| | | // 采购退货可选采购台账 |
| | | export function purchaseReturnableList(query) { |
| | | return request({ |
| | | url: "/purchase/ledger/returnableList", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | // 查询合同号 |
| | | export function getSalesNo(query) { |
| | | return request({ |
| | |
| | | size: paramPage.value.size, |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | filteredParamList.value = res.data?.records || []; |
| | | const existingParamIds = new Set( |
| | | (props.paramList || []) |
| | | .map(item => Number(item.paramId || item.technologyOperationParamId)) |
| | | .filter(id => Number.isFinite(id) && id > 0) |
| | | ); |
| | | filteredParamList.value = (res.data?.records || []).filter( |
| | | item => !existingParamIds.has(Number(item.id)) |
| | | ); |
| | | paramPage.value.total = res.data.total || 0; |
| | | } else { |
| | | ElMessage.error(res.msg || "查询失败"); |
| | |
| | | addProcessRouteItemParamOrder({ |
| | | productionOrderId: Number(props.orderId), |
| | | productionOrderRoutingOperationId: props.process.id, |
| | | technologyRoutingOperationParamId: props.process.id, |
| | | paramId: selectedParam.value.id, |
| | | standardValue: selectedParam.value.standardValue || "", |
| | | isRequired: selectedParam.value.isRequired || 0, |
| | |
| | | { label: "退货单号", prop: "returnNo", minWidth: "150" }, |
| | | { label: "供应商", prop: "supplierName", minWidth: "180" }, |
| | | { label: "关联入库单号", prop: "inboundBatches", minWidth: "150" }, |
| | | { |
| | | label: "发货类型", |
| | | prop: "shippingType", |
| | | minWidth: "110", |
| | | formatData: (val) => ({ 1: "货车", 2: "快递" }[String(val)] || "--"), |
| | | }, |
| | | { |
| | | label: "发货车牌号", |
| | | prop: "truckPlateNo", |
| | | minWidth: "140", |
| | | formatData: (_val, row) => (String(row?.shippingType) === "1" ? row?.truckPlateNo || "--" : "--"), |
| | | }, |
| | | { |
| | | label: "快递公司", |
| | | prop: "expressCompany", |
| | | minWidth: "140", |
| | | formatData: (_val, row) => (String(row?.shippingType) === "2" ? row?.expressCompany || "--" : "--"), |
| | | }, |
| | | { |
| | | label: "快递单号", |
| | | prop: "expressNo", |
| | | minWidth: "150", |
| | | formatData: (_val, row) => (String(row?.shippingType) === "2" ? row?.expressNo || "--" : "--"), |
| | | }, |
| | | { label: "退货日期", prop: "preparedAt", minWidth: "170" }, |
| | | { |
| | | label: "退款总额", |
| | |
| | | <div class="actions"> |
| | | <div></div> |
| | | <div> |
| | | <!-- <el-button type="primary" @click="add" icon="Plus">录入发票</el-button> --> |
| | | <el-button type="primary" @click="add" icon="Plus">录入发票</el-button> |
| | | <el-button type="success" @click="handleExport" icon="Download">导出</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | @confirm="submitForm" |
| | | @cancel="closeDialog" |
| | | > |
| | | <el-form :model="form" :rules="rules" ref="formRef" label-width="120px"> |
| | | <el-form :model="form" :rules="rules" ref="formRef" label-width="100px"> |
| | | <el-row v-if="isView" :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="状态"> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客户" prop="customerId"> |
| | | <el-select v-model="form.customerId" placeholder="请选择客户" style="width: 100%;" :disabled="isView"> |
| | | <el-select @change="checkCustomer" v-model="form.customerId" placeholder="请选择客户" style="width: 100%;" :disabled="isView"> |
| | | <el-option v-for="item in customerList" :key="item.id" :label="item.customerName" :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="关联开票申请" prop="accountInvoiceApplicationId"> |
| | | <el-select v-model="form.accountInvoiceApplicationId" |
| | | placeholder="请先选择客户" |
| | | readonly |
| | | @change="selectionApply" |
| | | :disabled="!form.customerId || isView" |
| | | class="outbound-batch-select"> |
| | | <el-option v-for="(item,index) in applyList" :key="index" :label="item.invoiceApplicationNo" :value="item.id"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="开票日期" prop="invoiceDate"> |
| | | <el-date-picker |
| | |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="发票类型" prop="invoiceType"> |
| | | <el-select |
| | |
| | | placeholder="请选择发票类型" |
| | | style="width: 100%;" |
| | | :disabled="isView" |
| | | @change="handleInvoiceTypeChange" |
| | | > |
| | | <el-option label="增值税专用发票" value="增值税专用发票" /> |
| | | <el-option label="增值税普通发票" value="增值税普通发票" /> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="税率" prop="taxRate"> |
| | | <el-select |
| | |
| | | placeholder="请选择税率" |
| | | style="width: 100%;" |
| | | :disabled="isView" |
| | | @change="calculateTax" |
| | | @change="handleTaxRateChange" |
| | | > |
| | | <el-option |
| | | v-for="dict in tax_rate" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-col :span="10"> |
| | | <el-form-item label="金额(不含税)" prop="amount"> |
| | | <el-input-number |
| | | v-model="form.amount" |
| | |
| | | :precision="2" |
| | | style="width: 100%;" |
| | | :disabled="isView" |
| | | @change="calculateTax" |
| | | @change="handleTaxRateChange" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-col :span="7"> |
| | | <el-form-item label="税额"> |
| | | <el-input v-model="form.taxAmount" disabled /> |
| | | <el-input v-model="form.taxAmount" style="width: 100%;" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-col :span="7"> |
| | | <el-form-item label="价税合计"> |
| | | <el-input v-model="form.totalAmount" disabled /> |
| | | <el-input v-model="form.totalAmount" style="width: 100%;" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | cancelAccountSalesInvoice, |
| | | deleteAccountSalesInvoice, |
| | | } from "@/api/financialManagement/accountSalesInvoice.js"; |
| | | import {getAccountInvoiceApplicationList} from "@/api/financialManagement/invoiceApply.js"; |
| | | |
| | | const FileList = defineAsyncComponent(() => import("@/components/Dialog/FileList.vue")); |
| | | |
| | |
| | | const fileDialogVisible = ref(false); |
| | | const currentRecordId = ref(0); |
| | | |
| | | const applySelectVisible = ref(false); |
| | | const applyList = ref([]); |
| | | |
| | | const openFileDialog = (row) => { |
| | | if (!row.accountInvoiceApplicationId) { |
| | | ElMessage.warning("未关联开票申请,无法查看附件"); |
| | |
| | | totalAmount: 0, |
| | | content: "", |
| | | remark: "", |
| | | deptId: undefined, |
| | | accountInvoiceApplicationId: undefined, |
| | | storageAttachmentId: undefined, |
| | | }); |
| | | |
| | | const rules = { |
| | | invoiceNo: [{ required: true, message: "请输入发票号码", trigger: "blur" }], |
| | | accountInvoiceApplicationId: [{ required: true, message: "请选择开票申请", trigger: "change" }], |
| | | customerId: [{ required: true, message: "请选择客户", trigger: "change" }], |
| | | invoiceDate: [{ required: true, message: "请选择开票日期", trigger: "change" }], |
| | | invoiceType: [{ required: true, message: "请选择发票类型", trigger: "change" }], |
| | | taxRate: [{ required: true, message: "请选择税率", trigger: "change" }], |
| | | amount: [{ required: true, message: "请输入金额", trigger: "blur" }], |
| | | }; |
| | | |
| | | // 选择客户 |
| | | const checkCustomer = (val) =>{ |
| | | loadApplyList(val); |
| | | } |
| | | |
| | | //查询开票申请列表 |
| | | const loadApplyList = (customerId) => { |
| | | if (!customerId) { |
| | | applyList.value = []; |
| | | return Promise.resolve(); |
| | | } |
| | | return getAccountInvoiceApplicationList({ customerId }) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | const list = res.data?.records ?? res.data ?? []; |
| | | applyList.value = Array.isArray(list) ? list : []; |
| | | } else { |
| | | applyList.value = []; |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | applyList.value = []; |
| | | }) |
| | | }; |
| | | |
| | | const selectionApply = (val)=>{ |
| | | const applyObj = applyList.value.find(item=>item.id === val); |
| | | if(!applyObj){ |
| | | ElMessage.warning("请选择关联的开票申请"); |
| | | return; |
| | | } |
| | | form.remark = applyObj.remark; |
| | | form.content = applyObj.invoiceContent; |
| | | form.invoiceDate = applyObj.applyDate; |
| | | form.invoiceType = applyObj.invoiceType; |
| | | form.deptId = applyObj.deptId; |
| | | form.taxRate = applyObj.taxRate; |
| | | form.totalAmount = applyObj.invoiceAmount |
| | | handleTaxRateChange(); |
| | | } |
| | | |
| | | /** 价税合计变更:按税率反算不含税金额、税额 */ |
| | | const calculateTaxFromInclusive = (inclusiveTotal) => { |
| | | const total = Number(inclusiveTotal ?? form.totalAmount ?? 0); |
| | | if (total <= 0) { |
| | | form.amount = 0; |
| | | form.taxAmount = 0; |
| | | form.totalAmount = 0; |
| | | return; |
| | | } |
| | | const rate = Number(form.taxRate) / 100; |
| | | form.totalAmount = Number(total.toFixed(2)); |
| | | form.amount = Number((form.totalAmount / (1 + rate)).toFixed(2)); |
| | | form.taxAmount = Number((form.totalAmount - form.amount).toFixed(2)); |
| | | }; |
| | | |
| | | const calculateTaxFromExclusive = () => { |
| | | form.taxAmount = Number((form.amount * form.taxRate / 100).toFixed(2)); |
| | | form.totalAmount = Number((form.amount + form.taxAmount).toFixed(2)); |
| | | }; |
| | | |
| | | const handleTaxRateChange = () => { |
| | | if (form.totalAmount > 0) { |
| | | calculateTaxFromInclusive(form.totalAmount); |
| | | } else { |
| | | calculateTaxFromExclusive(); |
| | | } |
| | | }; |
| | | |
| | | const getSummaries = ({ columns, data }) => { |
| | |
| | | const formatMoney = (value) => { |
| | | if (value === undefined || value === null) return "0.00"; |
| | | return Number(value).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ","); |
| | | }; |
| | | |
| | | const calculateTax = () => { |
| | | form.taxAmount = Number((form.amount * form.taxRate / 100).toFixed(2)); |
| | | form.totalAmount = Number((form.amount + form.taxAmount).toFixed(2)); |
| | | }; |
| | | |
| | | const handleInvoiceTypeChange = () => { |
| | | calculateTax(); |
| | | }; |
| | | |
| | | const normalizeTableRow = (row) => ({ |
| | |
| | | |
| | | const closeDialog = () => { |
| | | dialogVisible.value = false; |
| | | applySelectVisible.value = false; |
| | | isView.value = false; |
| | | isView.value = false; |
| | | }; |
| | | |
| | |
| | | prop="amount"> |
| | | <el-input-number v-model="form.amount" |
| | | :min="0" |
| | | :max="collectionAmountInputMax" |
| | | :precision="2" |
| | | style="width: 100%;" |
| | | :disabled="isView" |
| | | placeholder="根据关联单据自动汇总,可修改" /> |
| | | :disabled="isView" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | const isEdit = ref(false); |
| | | const isView = ref(false); |
| | | const currentId = ref(null); |
| | | const originalReceiptAmount = ref(0); |
| | | const submitLoading = ref(false); |
| | | |
| | | const customerList = ref([]); |
| | |
| | | }, |
| | | }); |
| | | |
| | | const maxCollectionAmount = computed(() => { |
| | | const selected = form.stockOutRecordIds || []; |
| | | const editAmount = isEdit.value ? Number(originalReceiptAmount.value) || 0 : 0; |
| | | if (!selected.length) return isEdit.value ? editAmount : undefined; |
| | | const selectedValueSet = new Set(selected.map(id => String(id))); |
| | | const selectedOptions = outboundBatchOptions.value.filter( |
| | | opt => opt.amountLimitAvailable && selectedValueSet.has(String(opt.value)) |
| | | ); |
| | | if (selectedOptions.length !== selectedValueSet.size) { |
| | | return isEdit.value ? Number(editAmount.toFixed(2)) : undefined; |
| | | } |
| | | const sum = selectedOptions.reduce( |
| | | (acc, opt) => acc + (Number(opt.outboundAmount) || 0), |
| | | 0 |
| | | ); |
| | | return Number((sum + editAmount).toFixed(2)); |
| | | }); |
| | | |
| | | const collectionAmountInputMax = computed( |
| | | () => maxCollectionAmount.value ?? Number.MAX_SAFE_INTEGER |
| | | ); |
| | | |
| | | const validateCollectionAmount = (rule, value, callback) => { |
| | | if (value === undefined || value === null || value === "") { |
| | | callback(); |
| | | return; |
| | | } |
| | | const amount = Number(value); |
| | | if (Number.isNaN(amount)) { |
| | | callback(new Error("请输入收款金额")); |
| | | return; |
| | | } |
| | | const max = maxCollectionAmount.value; |
| | | if (max !== undefined && amount - max > 0.000001) { |
| | | callback(new Error(`收款金额不能超过${max.toFixed(2)}`)); |
| | | return; |
| | | } |
| | | callback(); |
| | | }; |
| | | |
| | | const rules = { |
| | | customerId: [{ required: true, message: "请选择客户", trigger: "change" }], |
| | | stockOutRecordIds: [ |
| | |
| | | receiptDate: [ |
| | | { required: true, message: "请选择收款日期", trigger: "change" }, |
| | | ], |
| | | amount: [{ required: true, message: "请输入收款金额", trigger: "blur" }], |
| | | amount: [ |
| | | { required: true, message: "请输入收款金额", trigger: "blur" }, |
| | | { validator: validateCollectionAmount, trigger: ["blur", "change"] }, |
| | | ], |
| | | receiptMethod: [ |
| | | { required: true, message: "请选择收款方式", trigger: "change" }, |
| | | ], |
| | |
| | | return list.map((item, index) => { |
| | | if (typeof item === "string" || typeof item === "number") { |
| | | const text = String(item); |
| | | return { label: text, value: text, outboundAmount: 0 }; |
| | | return { |
| | | label: text, |
| | | value: text, |
| | | outboundAmount: 0, |
| | | amountLimitAvailable: false, |
| | | }; |
| | | } |
| | | const label = |
| | | item.outboundBatches ?? |
| | |
| | | item.label ?? |
| | | `出库单${index + 1}`; |
| | | const value = item.id ?? item.stockOutRecordId ?? label; |
| | | const outboundAmount = Number(item.outboundAmount) || 0; |
| | | const amountReceived = Number(item.amountReceived) || 0; |
| | | const availableAmount = outboundAmount - amountReceived; |
| | | return { |
| | | label: String(label), |
| | | value, |
| | | outboundAmount: (Number(item.outboundAmount)-Number(item.amountReceived)) || 0, |
| | | outboundAmount: |
| | | availableAmount > 0 ? Number(availableAmount.toFixed(2)) : 0, |
| | | amountLimitAvailable: true, |
| | | }; |
| | | }); |
| | | }; |
| | |
| | | label: String(id), |
| | | value: id, |
| | | outboundAmount: 0, |
| | | amountLimitAvailable: false, |
| | | }); |
| | | }); |
| | | }; |
| | |
| | | outboundSelectVisible.value = false; |
| | | syncCollectionAmount(); |
| | | formRef.value?.validateField("stockOutRecordIds"); |
| | | formRef.value?.validateField("amount"); |
| | | }; |
| | | |
| | | const handleOutboundDialogClosed = () => { |
| | |
| | | outboundSelectVisible.value = false; |
| | | isView.value = false; |
| | | isEdit.value = false; |
| | | originalReceiptAmount.value = 0; |
| | | }; |
| | | |
| | | const handleExport = () => { |
| | |
| | | isEdit.value = false; |
| | | isView.value = false; |
| | | dialogTitle.value = "新增收款"; |
| | | originalReceiptAmount.value = 0; |
| | | Object.assign(form, { |
| | | receiptCode: "", |
| | | customerId: "", |
| | |
| | | currentId.value = row.id; |
| | | dialogTitle.value = "编辑收款"; |
| | | fillFormFromRow(row); |
| | | originalReceiptAmount.value = Number(form.amount || 0); |
| | | dialogVisible.value = true; |
| | | loadOutboundBatches(form.customerId, true); |
| | | }; |
| | | |
| | | const view = row => { |
| | | isView.value = true; |
| | | isEdit.value = false; |
| | | dialogTitle.value = "查看收款"; |
| | | originalReceiptAmount.value = 0; |
| | | fillFormFromRow(row); |
| | | dialogVisible.value = true; |
| | | }; |
| | |
| | | { label: "退货单号", prop: "returnNo", minWidth: "150" }, |
| | | { label: "客户名称", prop: "customerName", minWidth: "180" }, |
| | | { label: "关联发货单号", prop: "shippingNo", minWidth: "150" }, |
| | | { |
| | | label: "发货类型", |
| | | prop: "shippingType", |
| | | minWidth: "110", |
| | | formatData: (val) => ({ 1: "货车", 2: "快递" }[String(val)] || "--"), |
| | | }, |
| | | { |
| | | label: "发货车牌号", |
| | | prop: "truckPlateNo", |
| | | minWidth: "140", |
| | | formatData: (_val, row) => (String(row?.shippingType) === "1" ? row?.truckPlateNo || "--" : "--"), |
| | | }, |
| | | { |
| | | label: "快递公司", |
| | | prop: "expressCompany", |
| | | minWidth: "140", |
| | | formatData: (_val, row) => (String(row?.shippingType) === "2" ? row?.expressCompany || "--" : "--"), |
| | | }, |
| | | { |
| | | label: "快递单号", |
| | | prop: "expressNo", |
| | | minWidth: "150", |
| | | formatData: (_val, row) => (String(row?.shippingType) === "2" ? row?.expressNo || "--" : "--"), |
| | | }, |
| | | { label: "退货日期", prop: "makeTime", minWidth: "170" }, |
| | | { |
| | | label: "退款总额", |
| | |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div> |
| | | <div style="display: flex; gap: 10px; flex-wrap: nowrap;"> |
| | | <el-button type="primary" |
| | | @click="isShowNewModal = true">新增库存</el-button> |
| | | <el-button type="info" |
| | |
| | | <el-descriptions-item label="发货订单号">{{ detailData.shippingInfo.shippingNo || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="客户名称">{{ detailData.shippingInfo.customerName || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="发货类型">{{ detailData.shippingInfo.type || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="发货日期">{{ detailData.shippingInfo.shippingDateDate || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="发货日期">{{ detailData.shippingInfo.shippingDate || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="审核状态">{{ detailData.shippingInfo.status || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="发货车牌号">{{ detailData.shippingInfo.shippingCarNumber || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="快递公司">{{ detailData.shippingInfo.expressCompany || "--" }}</el-descriptions-item> |
| | |
| | | else if (row.businessType === 5) { |
| | | const purchaseContractNumber = row?.purchaseContractNumber; |
| | | if (purchaseContractNumber) { |
| | | const res = await getPurchaseByCode({ purchaseContractNumber }); |
| | | const res = await getPurchaseByCode({ |
| | | purchaseContractNumber, |
| | | approvalInstanceId: row?.id, |
| | | }); |
| | | detailData.value = res || {}; |
| | | } |
| | | } |
| | |
| | | else if (row.businessType === 5) { |
| | | const purchaseContractNumber = row?.purchaseContractNumber; |
| | | if (purchaseContractNumber) { |
| | | const res = await getPurchaseByCode({ purchaseContractNumber }); |
| | | const res = await getPurchaseByCode({ |
| | | purchaseContractNumber, |
| | | approvalInstanceId: row?.id, |
| | | }); |
| | | detailData.value = res || {}; |
| | | } |
| | | } |
| | |
| | | prop="paymentAmount" |
| | | show-overflow-tooltip |
| | | :formatter="formattedNumber" /> |
| | | <el-table-column label="退货金额(元)" |
| | | prop="returnAmount" |
| | | show-overflow-tooltip |
| | | :formatter="formattedNumber" /> |
| | | <el-table-column label="应付金额(元)" |
| | | prop="payableAmount" |
| | | show-overflow-tooltip> |
| | |
| | | }, |
| | | }, |
| | | { |
| | | label: "退货金额(元)", |
| | | prop: "returnAmount", |
| | | width: 200, |
| | | formatData: params => { |
| | | return params ? parseFloat(params).toFixed(2) : 0; |
| | | }, |
| | | }, |
| | | { |
| | | label: "应付金额(元)", |
| | | dataType: "slot", |
| | | width: 200, |
| | |
| | | const summarizeMainTable = param => { |
| | | return proxy.summarizeTable( |
| | | param, |
| | | ["contractAmounts", "paymentAmount", "payableAmount"], |
| | | ["contractAmounts", "paymentAmount", "returnAmount", "payableAmount"], |
| | | { |
| | | ticketsNum: { noDecimal: true }, // 不保留小数 |
| | | futureTickets: { noDecimal: true }, // 不保留小数 |
| | |
| | | const summarizeMainTable1 = param => { |
| | | let summarizeTable = proxy.summarizeTable( |
| | | param, |
| | | ["contractAmount", "invoiceAmount", "paymentAmount"], |
| | | ["contractAmount", "invoiceAmount", "paymentAmount", "returnAmount"], |
| | | { |
| | | ticketsNum: { noDecimal: true }, // 不保留小数 |
| | | futureTickets: { noDecimal: true }, // 不保留小数 |
| | |
| | | </el-table-column> |
| | | <el-table-column label="数量" |
| | | prop="quantity" /> |
| | | <el-table-column label="销售发货数量" |
| | | prop="shippedQuantity" /> |
| | | <el-table-column label="可用数量" |
| | | prop="availableQuality" /> |
| | | <el-table-column label="退货数量" |
| | |
| | | <el-button link |
| | | type="primary" |
| | | @click="openForm('edit', scope.row)" |
| | | :disabled="scope.row.stockInStatus === '完全入库'">编辑 |
| | | :disabled="scope.row.approvalStatus === 3">编辑 |
| | | </el-button> |
| | | <el-button link |
| | | type="primary" |
| | |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | label="发货类型" |
| | | prop="shippingType" |
| | | :rules="[ |
| | | { |
| | | required: true, |
| | | message: '请选择发货类型', |
| | | trigger: 'change', |
| | | } |
| | | ]" |
| | | > |
| | | <el-select |
| | | v-model="formState.shippingType" |
| | | placeholder="请选择发货类型" |
| | | style="width: 240px" |
| | | @change="handleShippingTypeChange" |
| | | > |
| | | <el-option label="货车" :value="1" /> |
| | | <el-option label="快递" :value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | v-if="formState.shippingType === 1" |
| | | label="发货车牌号" |
| | | prop="truckPlateNo" |
| | | > |
| | | <el-input |
| | | v-model="formState.truckPlateNo" |
| | | placeholder="请输入发货车牌号" |
| | | style="width: 240px" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <template v-else-if="formState.shippingType === 2"> |
| | | <el-form-item |
| | | label="快递公司" |
| | | prop="expressCompany" |
| | | > |
| | | <el-input |
| | | v-model="formState.expressCompany" |
| | | placeholder="请输入快递公司" |
| | | style="width: 240px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | label="快递单号" |
| | | prop="expressNo" |
| | | > |
| | | <el-input |
| | | v-model="formState.expressNo" |
| | | placeholder="请输入快递单号" |
| | | style="width: 240px" |
| | | /> |
| | | </el-form-item> |
| | | </template> |
| | | |
| | | <el-form-item |
| | | label="供应商名称" |
| | | prop="supplierId" |
| | | :rules="[ |
| | |
| | | <el-table-column label="数量" |
| | | prop="stockInNum" |
| | | width="100" /> |
| | | <el-table-column label="销售发货数量" |
| | | prop="saleOutQuantity" |
| | | width="120" /> |
| | | <el-table-column label="可退货数量" |
| | | prop="unQuantity" |
| | | width="130" /> |
| | | <el-table-column label="已退货数量" |
| | | width="130"> |
| | | <template #default="scope"> |
| | | {{ calcAlreadyReturned(scope.row) }} |
| | | {{ formattedNumber(scope.row, null, scope.row.totalReturnNum || 0) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="退货数量" |
| | |
| | | <script setup> |
| | | import {ref, computed, getCurrentInstance, watch, defineAsyncComponent} from "vue"; |
| | | import {createPurchaseReturnOrder} from "@/api/procurementManagement/purchase_return_order.js"; |
| | | import {getOptions, purchaseList} from "@/api/procurementManagement/procurementLedger.js"; |
| | | import {getOptions, purchaseReturnableList} from "@/api/procurementManagement/procurementLedger.js"; |
| | | import {userListNoPageByTenantId} from "@/api/system/user.js"; |
| | | const ProductList = defineAsyncComponent(() => import("@/views/procurementManagement/purchaseReturnOrder/ProductList.vue")); |
| | | const props = defineProps({ |
| | |
| | | no: '', |
| | | isDefaultNo: true, |
| | | returnType: 0, |
| | | shippingType: undefined, |
| | | truckPlateNo: '', |
| | | expressCompany: '', |
| | | expressNo: '', |
| | | incomeType: undefined, |
| | | remark: '', |
| | | supplierId: undefined, |
| | |
| | | // 是否展示产品列表数据 |
| | | const isShowProductsModal = ref(false) |
| | | |
| | | const handleShippingTypeChange = (val) => { |
| | | if (val === 1) { |
| | | formState.value.expressCompany = ''; |
| | | formState.value.expressNo = ''; |
| | | } else if (val === 2) { |
| | | formState.value.truckPlateNo = ''; |
| | | } else { |
| | | formState.value.truckPlateNo = ''; |
| | | formState.value.expressCompany = ''; |
| | | formState.value.expressNo = ''; |
| | | } |
| | | }; |
| | | |
| | | const isShow = computed({ |
| | | get() { |
| | | return props.visible; |
| | |
| | | const toNumber = (val) => { |
| | | const num = Number(val) |
| | | return Number.isNaN(num) ? 0 : num |
| | | } |
| | | |
| | | /** 已退货数量 = 入库行总数量 − 当前可退货数量(剩余) */ |
| | | const calcAlreadyReturned = (row) => { |
| | | const total = Number(row?.stockInNum ?? row?.totalQuantity ?? row?.quantity ?? 0) |
| | | const un = Number(row?.unQuantity ?? 0) |
| | | if (!Number.isFinite(total) || !Number.isFinite(un)) return 0 |
| | | return Math.max(total - un, 0) |
| | | } |
| | | |
| | | const getReturnTotal = (row) => { |
| | |
| | | } |
| | | |
| | | const closeModal = () => { |
| | | formState.value.shippingType = undefined; |
| | | formState.value.truckPlateNo = ''; |
| | | formState.value.expressCompany = ''; |
| | | formState.value.expressNo = ''; |
| | | isShow.value = false; |
| | | }; |
| | | |
| | |
| | | const fetchPurchaseLedgerOptions = () => { |
| | | purchaseLedgerOptions.value = [] |
| | | if (formState.value.supplierId) { |
| | | purchaseList({supplierId: formState.value.supplierId,approvalStatus:3}).then((res) => { |
| | | purchaseReturnableList({ supplierId: formState.value.supplierId }).then((res) => { |
| | | purchaseLedgerOptions.value = res.rows; |
| | | }); |
| | | } |
| | |
| | | <el-table-column label="数量" |
| | | prop="stockInNum" |
| | | width="70" /> |
| | | <el-table-column label="销售发货数量" |
| | | prop="saleOutQuantity" |
| | | width="120" /> |
| | | <el-table-column label="可退货数量" |
| | | prop="unQuantity" |
| | | width="130" /> |
| | | <el-table-column label="已退货数量" |
| | | width="130"> |
| | | <template #default="scope"> |
| | | {{ calcAlreadyReturned(scope.row) }} |
| | | {{ formattedNumber(scope.row, null, scope.row.totalReturnNum || 0) }} |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="库存预警数量" |
| | |
| | | const formattedNumber = (row, column, cellValue) => { |
| | | return parseFloat(cellValue).toFixed(2); |
| | | }; |
| | | |
| | | /** 已退货数量 = 入库行总数量 − 当前可退货数量(剩余) */ |
| | | const calcAlreadyReturned = (row) => { |
| | | const total = Number(row?.stockInNum ?? row?.totalQuantity ?? row?.quantity ?? 0) |
| | | const un = Number(row?.unQuantity ?? 0) |
| | | if (!Number.isFinite(total) || !Number.isFinite(un)) return 0 |
| | | return Math.max(total - un, 0) |
| | | } |
| | | |
| | | const handleChangeSelection = (val) => { |
| | | selectedRows.value = val; |
| | |
| | | @click="handleDetail(row)" |
| | | >详情</el-button |
| | | > |
| | | <el-button link size="small" @click="handleDelete(row)" |
| | | >删除</el-button |
| | | <el-button |
| | | link |
| | | size="small" |
| | | :disabled="row.stockOutApproved" |
| | | :style="{ color: row.stockOutApproved ? '#c0c4cc' : undefined }" |
| | | @click="handleDelete(row)" |
| | | >{{ row.stockOutApproved }}</el-button |
| | | > |
| | | </template> |
| | | </PIMTable> |
| | |
| | | <el-descriptions-item label="退料人">{{ |
| | | detailData.returnUserName || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="发货类型">{{ |
| | | getShippingTypeLabel(detailData.shippingType) |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item v-if="String(detailData.shippingType) === '1'" label="发货车牌号">{{ |
| | | detailData.truckPlateNo || "--" |
| | | }}</el-descriptions-item> |
| | | <template v-else-if="String(detailData.shippingType) === '2'"> |
| | | <el-descriptions-item label="快递公司">{{ |
| | | detailData.expressCompany || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="快递单号">{{ |
| | | detailData.expressNo || "--" |
| | | }}</el-descriptions-item> |
| | | </template> |
| | | <el-descriptions-item label="整单折扣额">{{ |
| | | formatAmount(detailData.totalDiscountAmount) |
| | | }}</el-descriptions-item> |
| | |
| | | /> |
| | | <el-table-column label="单位" prop="unit" width="80" /> |
| | | <el-table-column label="数量" prop="stockInNum" width="80" /> |
| | | <el-table-column label="销售发货数量" prop="saleOutQuantity" width="110" /> |
| | | <el-table-column label="可退货数量" |
| | | prop="unQuantity" |
| | | width="100" /> |
| | | <el-table-column label="已退货数量" |
| | | width="100"> |
| | | <template #default="scope"> |
| | | {{ calcAlreadyReturned(scope.row) }} |
| | | {{ formatAmount(scope.row.totalReturnNum || 0) }} |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="库存预警数量" prop="warnNum" width="120" /> --> |
| | |
| | | prop: "returnUserName", |
| | | width: 110, |
| | | }, |
| | | { |
| | | label: "发货类型", |
| | | prop: "shippingType", |
| | | width: 100, |
| | | formatData: (val) => getShippingTypeLabel(val), |
| | | }, |
| | | { label: "发货车牌号", prop: "truckPlateDisplay", width: 140 }, |
| | | { label: "快递公司", prop: "expressCompanyDisplay", width: 140 }, |
| | | { label: "快递单号", prop: "expressNoDisplay", width: 150 }, |
| | | |
| | | { |
| | | label: "整单折扣额", |
| | |
| | | }, |
| | | { |
| | | name: "删除", |
| | | disabled: (row) => !!row.stockOutApproved, |
| | | clickFun: (row) => { |
| | | handleDelete(row); |
| | | }, |
| | |
| | | findPurchaseReturnOrderListPage({ ...searchForm.value, ...page }) |
| | | .then((res) => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records; |
| | | tableData.value = (res.data.records || []).map((row) => ({ |
| | | ...row, |
| | | truckPlateDisplay: String(row?.shippingType) === "1" ? (row?.truckPlateNo || "--") : "--", |
| | | expressCompanyDisplay: String(row?.shippingType) === "2" ? (row?.expressCompany || "--") : "--", |
| | | expressNoDisplay: String(row?.shippingType) === "2" ? (row?.expressNo || "--") : "--", |
| | | })); |
| | | page.total = res.data.total; |
| | | }) |
| | | .catch(() => { |
| | |
| | | ); |
| | | }; |
| | | |
| | | const getShippingTypeLabel = (value) => { |
| | | const shippingTypeMap = { |
| | | 1: "货车", |
| | | 2: "快递", |
| | | }; |
| | | return shippingTypeMap[String(value)] || shippingTypeMap[value] || "--"; |
| | | }; |
| | | |
| | | const formatAmount = (value) => { |
| | | if (value === null || value === undefined || value === "") { |
| | | return "--"; |
| | |
| | | return num.toFixed(2); |
| | | }; |
| | | |
| | | /** 已退货数量 = 入库行总数量 − 当前可退货数量(剩余) */ |
| | | const calcAlreadyReturned = (row) => { |
| | | const total = Number(row?.stockInNum ?? row?.totalQuantity ?? row?.quantity ?? 0); |
| | | const un = Number(row?.unQuantity ?? 0); |
| | | if (!Number.isFinite(total) || !Number.isFinite(un)) return 0; |
| | | return Math.max(total - un, 0); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | |
| | | margin-top: unset; |
| | | } |
| | | </style> |
| | | |
| | |
| | | show-overflow-tooltip |
| | | :formatter="formattedNumber" |
| | | width="200" /> |
| | | <el-table-column label="退货金额(元)" |
| | | prop="returnAmount" |
| | | show-overflow-tooltip |
| | | :formatter="formattedNumber" |
| | | width="200" /> |
| | | <el-table-column label="应收金额(元)" |
| | | prop="receiptableAmount" |
| | | show-overflow-tooltip |
| | |
| | | width="200" /> |
| | | <el-table-column label="回款金额(元)" |
| | | prop="receiptPaymentAmount" |
| | | show-overflow-tooltip |
| | | :formatter="formattedNumber" |
| | | width="200" /> |
| | | <el-table-column label="退货金额(元)" |
| | | prop="returnAmount" |
| | | show-overflow-tooltip |
| | | :formatter="formattedNumber" |
| | | width="200" /> |
| | |
| | | const summarizeMainTable = param => { |
| | | return proxy.summarizeTable( |
| | | param, |
| | | ["invoiceTotal", "receiptPaymentAmount", "unReceiptPaymentAmount"], |
| | | ["invoiceTotal", "receiptPaymentAmount", "returnAmount", "unReceiptPaymentAmount"], |
| | | { |
| | | ticketsNum: { noDecimal: true }, // 不保留小数 |
| | | futureTickets: { noDecimal: true }, // 不保留小数 |
| | |
| | | const summarizeMainTable1 = param => { |
| | | var summarizeTable = proxy.summarizeTable( |
| | | param, |
| | | ["contractAmount", "receiptPaymentAmount", "receiptableAmount"], |
| | | ["contractAmount", "receiptPaymentAmount", "returnAmount", "receiptableAmount"], |
| | | { |
| | | ticketsNum: { noDecimal: true }, // 不保留小数 |
| | | futureTickets: { noDecimal: true }, // 不保留小数 |
| | |
| | | <el-descriptions-item label="销售单号">{{ detail.salesContractNo }}</el-descriptions-item> |
| | | <el-descriptions-item label="业务员">{{ detail.salesman }}</el-descriptions-item> |
| | | <el-descriptions-item label="关联发货单号">{{ detail.shippingNo }}</el-descriptions-item> |
| | | <el-descriptions-item label="发货类型">{{ getShippingTypeText(detail.shippingType) }}</el-descriptions-item> |
| | | <el-descriptions-item v-if="String(detail.shippingType) === '1'" label="发货车牌号">{{ detail.truckPlateNo || "--" }}</el-descriptions-item> |
| | | <template v-else-if="String(detail.shippingType) === '2'"> |
| | | <el-descriptions-item label="快递公司">{{ detail.expressCompany || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="快递单号">{{ detail.expressNo || "--" }}</el-descriptions-item> |
| | | </template> |
| | | <!-- <el-descriptions-item label="项目名称">{{ detail.projectName }}</el-descriptions-item> --> |
| | | <el-descriptions-item label="制单人">{{ detail.maker }}</el-descriptions-item> |
| | | <el-descriptions-item label="制单时间">{{ detail.makeTime }}</el-descriptions-item> |
| | |
| | | <div style="padding-top: 20px"> |
| | | <span class="descriptions">产品列表</span> |
| | | <PIMTable :isShowPagination="false" rowKey="id" :column="tableColumn" :tableData="tableData"> |
| | | <template #totalReturnNum="{ row }"> |
| | | {{ calcAlreadyReturned(row) }} |
| | | </template> |
| | | </PIMTable> |
| | | </div> |
| | | </div> |
| | |
| | | const detail = ref({}); |
| | | const tableData = ref([]); |
| | | const availableProducts = ref([]); |
| | | const shippingTypeMap = { |
| | | 1: "货车", |
| | | 2: "快递", |
| | | }; |
| | | |
| | | const sameKey = (a, b) => a != null && b != null && String(a) === String(b); |
| | | |
| | |
| | | if (!Number.isFinite(total) || !Number.isFinite(un)) return 0; |
| | | return Math.max(total - un, 0); |
| | | }; |
| | | |
| | | const getShippingTypeText = (value) => shippingTypeMap[String(value)] || shippingTypeMap[value] || "--"; |
| | | |
| | | /** 详情表用 productName / model;合并时勿让空串盖掉出库行字段 */ |
| | | const mergeDetailProductRow = (product, normalized) => { |
| | |
| | | {align: "center", label: "规格型号", prop: "model"}, |
| | | {align: "center", label: "单位", prop: "unit", width: 80}, |
| | | {align: "center", label: "总数量", prop: "stockOutNum", width: 120}, |
| | | {align: "center", label: "已退货数量", prop: "totalReturnNum", width: 120, dataType: "slot", slot: "totalReturnNum"}, |
| | | {align: "center", label: "已退货数量", prop: "totalReturnNum", width: 120}, |
| | | {align: "center", label: "未退货数量", prop: "unQuantity", width: 120}, |
| | | {align: "center", label: "待处理退货数量", prop: "pendingReturnNum", width: 120}, |
| | | {align: "center", label: "退货数量", prop: "returnQuantity", width: 120}, |
| | | {align: "center", label: "退货产品单价", prop: "price", width: 120}, |
| | | {align: "center", label: "退货产品金额", prop: "amount", width: 120}, |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item label="发货类型:" prop="shippingType"> |
| | | <el-select v-model="form.shippingType" placeholder="请选择发货类型" @change="handleShippingTypeChange"> |
| | | <el-option label="货车" :value="1" /> |
| | | <el-option label="快递" :value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4" v-if="form.shippingType === 1"> |
| | | <el-form-item label="发货车牌号:" prop="truckPlateNo"> |
| | | <el-input v-model="form.truckPlateNo" placeholder="请输入发货车牌号" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <template v-else-if="form.shippingType === 2"> |
| | | <el-col :span="4"> |
| | | <el-form-item label="快递公司:" prop="expressCompany"> |
| | | <el-input v-model="form.expressCompany" placeholder="请输入快递公司" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item label="快递单号:" prop="expressNo"> |
| | | <el-input v-model="form.expressNo" placeholder="请输入快递单号" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </template> |
| | | <el-col :span="4"> |
| | | <el-form-item label="退款总额:" prop="refundAmount"> |
| | | <el-input v-model="form.refundAmount" disabled placeholder="自动计算" /> |
| | | </el-form-item> |
| | |
| | | <el-button type="primary" @click="openProductSelection" :disabled="!form.shippingId">添加产品</el-button> |
| | | </div> |
| | | <PIMTable :isShowPagination="false" rowKey="id" :column="tableColumn" :tableData="tableData"> |
| | | <template #totalReturnNum="{ row }"> |
| | | {{ calcAlreadyReturned(row) }} |
| | | </template> |
| | | <template #returnQuantity="{ row }"> |
| | | <el-input |
| | | v-model="row.returnQuantity" |
| | |
| | | <el-table-column align="center" prop="specificationModel" label="规格型号" /> |
| | | <el-table-column align="center" prop="unit" label="单位" /> |
| | | <el-table-column align="center" prop="stockOutNum" label="总数量" /> |
| | | <el-table-column align="center" label="已退货数量" prop="totalReturnNum"></el-table-column> |
| | | <el-table-column align="center" prop="unQuantity" label="未退货数量" /> |
| | | <el-table-column align="center" label="已退货数量"> |
| | | <template #default="{ row }">{{ calcAlreadyReturned(row) }}</template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column align="center" prop="pendingReturnNum" label="待处理退货数量" /> |
| | | </el-table> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | |
| | | returnNo: "", |
| | | customerId: "", |
| | | shippingId: "", |
| | | shippingType: "", |
| | | truckPlateNo: "", |
| | | expressCompany: "", |
| | | expressNo: "", |
| | | projectId: "", |
| | | maker: "", |
| | | makeTime: "", |
| | |
| | | }], |
| | | customerId: [{ required: true, message: "请选择客户", trigger: "change" }], |
| | | shippingId: [{ required: true, message: "请选择关联出库单号", trigger: "change" }], |
| | | shippingType: [{ required: true, message: "请选择发货类型", trigger: "change" }], |
| | | } |
| | | }); |
| | | const { form, rules } = toRefs(data); |
| | |
| | | {align: "center", label: "规格型号", prop: "specificationModel" }, |
| | | {align: "center", label: "单位", prop: "unit", width: 80 }, |
| | | {align: "center", label: "总数量", prop: "stockOutNum", width: 120 }, |
| | | {align: "center", label: "已退货数量", prop: "totalReturnNum", width: 120, dataType: "slot", slot: "totalReturnNum" }, |
| | | {align: "center", label: "已退货数量", prop: "totalReturnNum", width: 120 }, |
| | | {align: "center", label: "待处理退货数量", prop: "pendingReturnNum", width: 120 }, |
| | | {align: "center", label: "未退货数量", prop: "unQuantity", width: 120 }, |
| | | {align: "center", label: "退货数量", prop: "returnQuantity", dataType: "slot", slot: "returnQuantity", width: 120 }, |
| | | {align: "center", label: "退货产品单价", prop: "price", dataType: "slot", slot: "price", width: 120 }, |
| | |
| | | returnNo: "", |
| | | customerId: "", |
| | | shippingId: "", |
| | | shippingType: "", |
| | | truckPlateNo: "", |
| | | expressCompany: "", |
| | | expressNo: "", |
| | | projectId: "", |
| | | maker: "", |
| | | makeTime: "", |
| | |
| | | const payload = { ...form.value, returnSaleProducts }; |
| | | delete payload.returnNoCheckbox; |
| | | if (operationType.value === "add" && form.value.returnNoCheckbox) delete payload.returnNo; |
| | | if (payload.shippingType !== 1) payload.truckPlateNo = ""; |
| | | if (payload.shippingType !== 2) { |
| | | payload.expressCompany = ""; |
| | | payload.expressNo = ""; |
| | | } |
| | | if (operationType.value === "add") { |
| | | returnManagementAdd(payload).then(() => { |
| | | proxy.$modal.msgSuccess("新增成功"); |
| | |
| | | proxy.resetForm("formRef"); |
| | | dialogFormVisible.value = false; |
| | | emit('close'); |
| | | data.form = { |
| | | returnNoCheckbox: true, |
| | | returnNo: "", |
| | | customerId: "", |
| | | shippingId: "", |
| | | shippingType: "", |
| | | truckPlateNo: "", |
| | | expressCompany: "", |
| | | expressNo: "", |
| | | projectId: "", |
| | | maker: "", |
| | | makeTime: "", |
| | | status: 0, |
| | | returnReason: "", |
| | | refundAmount: "", |
| | | } |
| | | }; |
| | | |
| | | const initCustomers = async () => { |
| | |
| | | const handleReturnNoCheckboxChange = (checked) => { |
| | | if (checked) form.value.returnNo = ""; |
| | | formRef.value?.validateField('returnNo'); |
| | | }; |
| | | |
| | | const handleShippingTypeChange = (val) => { |
| | | if (val === 1) { |
| | | form.value.expressCompany = ""; |
| | | form.value.expressNo = ""; |
| | | } else if (val === 2) { |
| | | form.value.truckPlateNo = ""; |
| | | } else { |
| | | form.value.truckPlateNo = ""; |
| | | form.value.expressCompany = ""; |
| | | form.value.expressNo = ""; |
| | | } |
| | | }; |
| | | |
| | | const customerNameChange = async (val, clearDownstream = true) => { |
| | |
| | | |
| | | const handleReturnQuantityChange = (val, row) => { |
| | | if (val === "" || val === null) return; |
| | | const max = row.unQuantity === undefined || row.unQuantity === null ? Infinity : Number(row.unQuantity || 0); |
| | | const unQuantity = row.unQuantity === undefined || row.unQuantity === null ? Infinity : Number(row.unQuantity || 0);//未退货数量 |
| | | const pendingReturnNum = row.pendingReturnNum === undefined || row.pendingReturnNum === null ? Infinity : Number(row.pendingReturnNum || 0);//待处理退货数量 |
| | | //最大退货数量,如果为编辑状态加上待处理退货数量 |
| | | const max = operationType.value === 'edit' ? unQuantity + pendingReturnNum : unQuantity |
| | | const current = Number(val); |
| | | |
| | | if (current > max) { |
| | |
| | | <template #status="{ row }"> |
| | | <el-tag :type="getStatusType(row.status)">{{ getStatusText(row.status) }}</el-tag> |
| | | </template> |
| | | <template #stockInApprovalStatus="{ row }"> |
| | | <el-tag :type="getStockInApprovalStatusType(row.stockInApprovalStatus)">{{ getStockInApprovalStatusText(row.stockInApprovalStatus) }}</el-tag> |
| | | </template> |
| | | </PIMTable> |
| | | </div> |
| | | <form-dia ref="formDia" @close="handleQuery" /> |
| | |
| | | const defaultColumns = [ |
| | | { label: "退货单号", prop: "returnNo", minWidth: 160 }, |
| | | { label: "单据状态", prop: "status", minWidth: 90, dataType: "slot", slot: "status" }, |
| | | { label: "入库审批状态", prop: "stockInApprovalStatus", minWidth: 120, dataType: "slot", slot: "stockInApprovalStatus" }, |
| | | { label: "制单时间", prop: "makeTime", minWidth: 170 }, |
| | | { label: "客户名称", prop: "customerName", minWidth: 220 }, |
| | | { label: "销售单号", prop: "salesContractNo", minWidth: 160 }, |
| | | { label: "业务员", prop: "salesman", minWidth: 120 }, |
| | | { label: "关联发货单号", prop: "shippingNo", minWidth: 170 }, |
| | | { |
| | | label: "发货类型", |
| | | prop: "shippingType", |
| | | minWidth: 100, |
| | | formatData: (val) => ({ 1: "货车", 2: "快递" }[String(val)] || "--"), |
| | | }, |
| | | { label: "发货车牌号", prop: "truckPlateDisplay", minWidth: 140 }, |
| | | { label: "快递公司", prop: "expressCompanyDisplay", minWidth: 140 }, |
| | | { label: "快递单号", prop: "expressNoDisplay", minWidth: 150 }, |
| | | { label: "项目名称", prop: "projectName", minWidth: 180 }, |
| | | { label: "制单人", prop: "maker", minWidth: 120 }, |
| | | { |
| | |
| | | tableLoading.value = true; |
| | | returnManagementList({ ...searchForm.value, ...page }).then(res => { |
| | | tableLoading.value = false; |
| | | tableData.value = res?.data?.records || []; |
| | | tableData.value = (res?.data?.records || []).map((row) => ({ |
| | | ...row, |
| | | truckPlateDisplay: String(row?.shippingType) === "1" ? (row?.truckPlateNo || "--") : "--", |
| | | expressCompanyDisplay: String(row?.shippingType) === "2" ? (row?.expressCompany || "--") : "--", |
| | | expressNoDisplay: String(row?.shippingType) === "2" ? (row?.expressNo || "--") : "--", |
| | | })); |
| | | page.total = res?.data?.total || 0; |
| | | }).finally(() => tableLoading.value = false); |
| | | }; |
| | |
| | | return statusMap[status] || "未知"; |
| | | }; |
| | | |
| | | const getStockInApprovalStatusType = (status) => { |
| | | const statusMap = { |
| | | 0: "", |
| | | 1: "success", |
| | | 2: "warning" |
| | | }; |
| | | return statusMap[status] || "info"; |
| | | }; |
| | | |
| | | const getStockInApprovalStatusText = (status) => { |
| | | const statusMap = { |
| | | 0: "未审批", |
| | | 1: "已审批", |
| | | 2: "审批中" |
| | | }; |
| | | return statusMap[status] || "未知"; |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |