| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search-wrapper"> |
| | | <el-form :model="searchForm" class="demo-form-inline"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="4"> |
| | | <el-form-item label="退货单号"> |
| | | <el-input v-model="searchForm.returnNo" placeholder="请输入退货单号" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item label="客户名称"> |
| | | <el-input v-model="searchForm.customerName" placeholder="客户名称" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item label="销售单号"> |
| | | <el-input v-model="searchForm.salesContractNo" placeholder="销售单号" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item label="关联出库单号"> |
| | | <el-input v-model="searchForm.shippingNo" placeholder="关联出库单号" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleQuery">搜索</el-button> |
| | | <el-button @click="handleReset">重置</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="search_form"> |
| | | <el-form :model="searchForm" class="demo-form-inline" :inline="true"> |
| | | <el-form-item label="退货单号"> |
| | | <el-input v-model="searchForm.returnNo" placeholder="请输入退货单号" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="客户名称"> |
| | | <el-input v-model="searchForm.customerName" placeholder="客户名称" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="销售单号"> |
| | | <el-input v-model="searchForm.salesContractNo" placeholder="销售单号" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="关联发货单号"> |
| | | <el-input v-model="searchForm.shippingNo" placeholder="关联发货单号" clearable /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleQuery">搜索</el-button> |
| | | <el-button @click="handleReset">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div class="table_list"> |
| | | <div class="table_header" style="display: flex;justify-content: flex-end;margin-bottom: 10px;"> |
| | | <el-button type="primary" @click="openForm('add')">新建销售退货</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">删除</el-button> |
| | | <el-button type="danger" :disabled="selectedRows.length === 0 || selectedRows.some(row => row.status !== 0)" @click="handleDelete">删除</el-button> |
| | | </div> |
| | | <PIMTable |
| | | rowKey="id" |
| | |
| | | > |
| | | <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> |
| | |
| | | ]); |
| | | |
| | | const defaultColumns = [ |
| | | { label: "退货单号", prop: "returnNo", width: 160 }, |
| | | { label: "单据状态", prop: "status", width: 90, dataType: "slot", slot: "status" }, |
| | | { label: "制单时间", prop: "makeTime", width: 170 }, |
| | | { label: "客户名称", prop: "customerName", width: 220 }, |
| | | { label: "销售单号", prop: "salesContractNo", width: 160 }, |
| | | { label: "业务员", prop: "salesman", width: 120 }, |
| | | { label: "关联出库单号", prop: "shippingNo", width: 170 }, |
| | | { label: "项目名称", prop: "projectName", width: 180 }, |
| | | { label: "制单人", prop: "maker", width: 120 }, |
| | | { 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 }, |
| | | { |
| | | label: "操作", |
| | | prop: "operation", |
| | | dataType: "action", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 240, |
| | | minWidth: 240, |
| | | operation: [ |
| | | { name: "编辑", disabled: (row) => row.status !== 0, type: "text", clickFun: (row) => openForm("edit", row) }, |
| | | { name: "退款处理", disabled: (row) => row.status !== 0, type: "text", clickFun: (row) => handleRowHandle(row) }, |
| | |
| | | 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(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .search-wrapper { |
| | | background: white; |
| | | padding: 1rem 1rem 0 1rem; |
| | | border: 8px; |
| | | border-radius: 16px; |
| | | .table_list { |
| | | margin-top: unset; |
| | | } |
| | | </style> |