liu
7 天以前 5c124cdf26e4d749eae1e7fc9df366e9a5f4d259
src/views/crm/receivable/index.vue
@@ -15,7 +15,7 @@
  deleteReceivable,
  exportReceivable,
  getReceivablePage,
  submitReceivable,
  updateReceivableStatus,
} from '#/api/crm/receivable';
import { $t } from '#/locales';
@@ -76,15 +76,18 @@
  }
}
/** 提交审核 */
async function handleSubmit(row: CrmReceivableApi.Receivable) {
/** 更新回款状态(审核/反审核) */
async function handleUpdateStatus(
  row: CrmReceivableApi.Receivable,
  status: number,
) {
  const hideLoading = message.loading({
    content: '提交审核中...',
    content: '更新状态中...',
    duration: 0,
  });
  try {
    await submitReceivable(row.id!);
    message.success('提交审核成功');
    await updateReceivableStatus(row.id!, status);
    message.success('更新状态成功');
    handleRefresh();
  } finally {
    hideLoading();
@@ -106,12 +109,9 @@
  push({ name: 'CrmContractDetail', params: { id: row.contractId } });
}
/** 查看审批详情 */
function handleProcessDetail(row: CrmReceivableApi.Receivable) {
  push({
    name: 'BpmProcessInstanceDetail',
    query: { id: row.processInstanceId },
  });
/** 查看开票详情 */
function handleInvoiceDetail(row: CrmReceivableApi.Receivable) {
  push({ name: 'CrmInvoiceDetail', params: { id: row.invoiceId } });
}
const [Grid, gridApi] = useVbenVxeGrid({
@@ -186,6 +186,18 @@
          {{ row.customerName }}
        </Button>
      </template>
      <template #invoiceNo="{ row }">
        <template v-if="row.invoice">
          <Button type="link" @click="handleInvoiceDetail(row)">
            {{ row.invoice.no }}
          </Button>
          <span class="mx-1">/</span>
          <span>{{ row.invoice.invoiceNo ?? '-' }}</span>
          <span class="mx-1">/</span>
          <span>¥{{ row.invoice.price ?? 0 }}</span>
        </template>
        <span v-else>--</span>
      </template>
      <template #contractNo="{ row }">
        <Button
          v-if="row.contract"
@@ -204,21 +216,24 @@
              type: 'link',
              icon: ACTION_ICON.EDIT,
              auth: ['crm:receivable:update'],
              ifShow: row.auditStatus === 10,
              onClick: handleEdit.bind(null, row),
            },
            {
              label: '提交审核',
              label: '审核',
              type: 'link',
              icon: ACTION_ICON.AUDIT,
              auth: ['crm:receivable:update'],
              onClick: handleSubmit.bind(null, row),
              ifShow: row.auditStatus === 0,
              ifShow: row.auditStatus === 10,
              onClick: handleUpdateStatus.bind(null, row, 20),
            },
            {
              label: '查看审批',
              label: '反审核',
              type: 'link',
              icon: ACTION_ICON.VIEW,
              auth: ['crm:receivable:update'],
              onClick: handleProcessDetail.bind(null, row),
              ifShow: row.auditStatus !== 0,
              ifShow: row.auditStatus === 20,
              onClick: handleUpdateStatus.bind(null, row, 10),
            },
            {
              label: $t('common.delete'),