gaoluyang
2026-06-22 bc365ef47ae4e01754aeadbae26170e11c9bb80e
src/views/salesManagement/returnOrder/index.vue
@@ -11,8 +11,8 @@
            <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 label="关联批号">
               <el-input v-model="searchForm.shippingNo" placeholder="关联批号" clearable />
            </el-form-item>
            <el-form-item>
               <el-button type="primary" @click="handleQuery">搜索</el-button>
@@ -23,7 +23,7 @@
    <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" :disabled="selectedRows.length === 0 || selectedRows.some(row => row.status !== 0)" @click="handleDelete">删除</el-button>
        <el-button type="danger" :disabled="selectedRows.length === 0 || selectedRows.some(row => row.status !== 0)" @click="handleDelete" v-hasPermi="['salesManagement:returnOrder:remove']">删除</el-button>
      </div>
      <PIMTable
        rowKey="id"
@@ -37,6 +37,11 @@
      >
        <template #status="{ row }">
          <el-tag :type="getStatusType(row.status)">{{ getStatusText(row.status) }}</el-tag>
        </template>
        <template #returnStatus="{ row }">
          <el-tag :type="getReturnStatusType(row.returnStatus)" size="small">
            {{ row.returnStatus || '无退货' }}
          </el-tag>
        </template>
      </PIMTable>
    </div>
@@ -114,11 +119,12 @@
const defaultColumns = [
  { label: "退货单号", prop: "returnNo", minWidth: 160 },
  { label: "单据状态", prop: "status", minWidth: 90, dataType: "slot", slot: "status" },
  { label: "退货状态", prop: "returnStatus", minWidth: 100, dataType: "slot", slot: "returnStatus" },
  { 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: "shippingNo", minWidth: 170 },
  { label: "项目名称", prop: "projectName", minWidth: 180 },
  { label: "制单人", prop: "maker", minWidth: 120 },
  {
@@ -132,7 +138,7 @@
      { 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) },
      { name: "详情", type: "text", clickFun: (row) => openDetail(row) },
      { name: "删除", disabled: (row) => row.status !== 0, type: "text", clickFun: (row) => handleRowDelete(row) },
      { name: "删除", disabled: (row) => row.status !== 0, type: "text", clickFun: (row) => handleRowDelete(row), hasPermi: ['salesManagement:returnOrder:remove'] },
    ],
  },
];
@@ -207,6 +213,15 @@
  return statusMap[status] || "未知";
};
const getReturnStatusType = (returnStatus) => {
  const statusMap = {
    '无退货': 'success',
    '部分退货': 'warning',
    '全部退货': 'danger',
  };
  return statusMap[returnStatus] || 'info';
};
onMounted(() => {
  getList();
});