gaoluyang
9 小时以前 10a8da68d9db10313c67e0f193c160e9740d95cd
src/views/salesManagement/deliveryLedger/index.vue
@@ -40,31 +40,22 @@
        <el-table-column label="发货车牌号" prop="shippingCarNumber" show-overflow-tooltip />
        <el-table-column label="快递公司" prop="expressCompany" show-overflow-tooltip />
        <el-table-column label="快递单号" prop="expressNumber" show-overflow-tooltip />
        <el-table-column label="审核状态" prop="status" align="center" width="120">
          <template #default="scope">
            <el-tag :type="getApprovalStatusType(scope.row.status)">
              {{ getApprovalStatusText(scope.row.status) }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column fixed="right" label="操作" width="200" align="center">
        <el-table-column fixed="right" label="操作" width="220" align="center">
          <template #default="scope">
            <el-button 
              link 
              type="primary"
              size="small"
              :disabled="!isApproved(scope.row.status)"
              type="primary"
              :disabled="!canSupplement(scope.row)"
              @click="openForm('edit', scope.row)">补充发货信息</el-button>
            <el-button
              link
              type="primary"
              size="small"
                     style="color: #67C23A"
              @click="openDetail(scope.row)"
            >详情</el-button>
            <el-button 
              link 
              type="danger"
              size="small"
              type="danger"
              :disabled="isApproving(scope.row.status)"
              @click="handleDeleteSingle(scope.row)">删除</el-button>
          </template>
@@ -83,6 +74,7 @@
                v-model="form.type"
                placeholder="请选择发货类型"
                style="width: 100%"
                disabled
                @change="handleShippingTypeChange"
              >
                <el-option label="货车" value="货车" />
@@ -356,12 +348,6 @@
// 打开弹框
const openForm = async (type, row) => {
  // 补充发货信息:仅“审核通过”允许编辑
  if (type === 'edit' && row && !isApproved(row.status)) {
    proxy.$modal.msgWarning("只有审核通过的数据才可以补充发货信息");
    return;
  }
  operationType.value = type;
  const baseUrl = import.meta.env.VITE_APP_BASE_API;
  
@@ -412,7 +398,6 @@
    };
    deliveryFileList.value = [];
  }
  dialogFormVisible.value = true;
};
@@ -639,6 +624,7 @@
    '审核中': '审核中',
    '审核拒绝': '审核拒绝',
    '审核通过': '审核通过',
    '已发货': '已发货',
    '0': '待审核',
    '1': '审核中',
    '2': '审核拒绝',
@@ -669,6 +655,7 @@
    '审核中': 'warning',
    '审核拒绝': 'danger',
    '审核通过': 'success',
    '已发货': 'success',
    '0': 'info',
    '1': 'warning',
    '2': 'danger',
@@ -691,6 +678,15 @@
  return statusStr === '审核通过' || statusStr === '3';
};
// 检查是否可以补充发货信息(审核通过且没有发货车牌号或快递单号)
const canSupplement = (row) => {
  // 如果有发货车牌号或快递单号,则不能补充
  if (row?.shippingCarNumber || row?.expressNumber) {
    return false;
  }
  return true;
};
// 检查审核状态是否为"审核中"
const isApproving = (status) => {
  if (status === null || status === undefined || status === '') {