yaowanxin
9 小时以前 5747cef7e826014682a02cd00da8769e1fa1e65a
src/views/procurementManagement/procurementLedger/index.vue
@@ -54,6 +54,7 @@
        :summary-method="summarizeMainTable"
        @expand-change="expandChange"
        height="calc(100vh - 18.5em)"
        :row-class-name="tableRowClassName"
      >
        <el-table-column align="center" type="selection" width="55" />
        <el-table-column type="expand">
@@ -112,12 +113,32 @@
          prop="supplierName"
          show-overflow-tooltip
        />
        <el-table-column label="订单状态" width="100" align="center">
          <template #default="scope">
            <el-tag v-if="scope.row.isInvalid" type="danger" size="small">失效</el-tag>
            <el-tag v-else type="success" size="small">正常</el-tag>
          </template>
        </el-table-column>
        <el-table-column
          label="项目名称"
          prop="projectName"
          width="420"
          show-overflow-tooltip
        />
        <el-table-column
            label="审批状态"
            prop="approvalStatus"
            width="200"
            show-overflow-tooltip
        >
          <template #default="scope">
            <el-tag
                size="small"
            >
              {{ approvalStatusText[scope.row.approvalStatus] || '未知状态' }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column
          label="付款方式"
          width="100"
@@ -155,7 +176,6 @@
              type="primary"
              size="small"
              @click="openForm('edit', scope.row)"
                     :disabled="scope.row.receiptPaymentAmount>0 || scope.row.recorderName !== userStore.nickName"
              >编辑</el-button
            >
            <el-button
@@ -226,6 +246,8 @@
                v-model="form.supplierId"
                placeholder="请选择"
                clearable
                filterable
                allow-create
              >
                <el-option
                  v-for="item in supplierList"
@@ -843,6 +865,13 @@
const qrCodeDialogVisible = ref(false);
const qrCodeUrl = ref("");
// 订单审批状态显示文本
const approvalStatusText = {
  0: '审批中',
  1: '审批通过',
  2: '审批失败'
};
// 用户信息表单弹框数据
const operationType = ref("");
const dialogFormVisible = ref(false);
@@ -978,7 +1007,12 @@
  purchaseListPage({ ...rest, ...page })
    .then((res) => {
      tableLoading.value = false;
      tableData.value = res.data.records;
      // tableData.value = res.data.records;
      // 处理数据,添加失效状态标记
      tableData.value = res.data.records.map(record => ({
        ...record,
        isInvalid: record.isWhite === 1
      }));
      tableData.value.map((item) => {
        item.children = [];
      });
@@ -1046,7 +1080,8 @@
    salesContractList.value = res;
  });
  getOptions().then((res) => {
    supplierList.value = res.data;
    // 供应商过滤出isWhite=0 的数据
    supplierList.value = res.data.filter((item) => item.isWhite == 0);
  });
  form.value.recorderId = userStore.id;
  form.value.entryDate = getCurrentDate();
@@ -1598,11 +1633,19 @@
  return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
// 添加行类名方法
const tableRowClassName = ({ row }) => {
  return row.isInvalid ? 'invalid-row' : '';
};
onMounted(() => {
  getList();
});
</script>
<style scoped lang="scss"></style>
<style scoped lang="scss">
.invalid-row {
  opacity: 0.6;
  background-color: #f5f7fa;
}
</style>