hurx 2 months ago
parent
commit
854ff08c69

+ 11 - 0
src/api/pc/enterprise/statement.ts

@@ -86,3 +86,14 @@ export function getStatementInvoiceList(params?: any) {
     params: params
     params: params
   });
   });
 }
 }
+
+/**
+ * 申请开票
+ */
+export function applyForInvoice(data: any) {
+  return request({
+    url: '/bill/pcStatementInvoice',
+    method: 'post',
+    data: data
+  });
+}

+ 10 - 1
src/views/reconciliation/invoiceManage/index.vue

@@ -45,7 +45,7 @@
 import { reactive, ref, computed, onMounted, watch } from 'vue';
 import { reactive, ref, computed, onMounted, watch } from 'vue';
 import { ElMessage, ElMessageBox } from 'element-plus';
 import { ElMessage, ElMessageBox } from 'element-plus';
 import { PageTitle, SearchBar, TablePagination } from '@/components';
 import { PageTitle, SearchBar, TablePagination } from '@/components';
-import { getStatementList } from '@/api/pc/enterprise/statement';
+import { getStatementList, applyForInvoice } from '@/api/pc/enterprise/statement';
 import type { StatementOrder } from '@/api/pc/enterprise/statementTypes';
 import type { StatementOrder } from '@/api/pc/enterprise/statementTypes';
 import { get } from 'http';
 import { get } from 'http';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@@ -57,6 +57,9 @@ const searchForm = reactive({
   dateRange: [],
   dateRange: [],
   invoiceStatus: ''
   invoiceStatus: ''
 });
 });
+const form = reactive({
+  statementOrderIds: []
+});
 
 
 const invoiceStatusOptions = ref([{ label: '全部', value: '' }]);
 const invoiceStatusOptions = ref([{ label: '全部', value: '' }]);
 
 
@@ -166,6 +169,11 @@ const handleView = (row: any) => {
 
 
 const handleApplyInvoice = async () => {
 const handleApplyInvoice = async () => {
   try {
   try {
+    form.statementOrderIds = selectedRows.value.map((row) => row.id);
+    if (!form.statementOrderIds) {
+      ElMessage.warning('请选择要申请的对账单');
+      return;
+    }
     const billNos = selectedRows.value.map((row) => row.billNo).join('、');
     const billNos = selectedRows.value.map((row) => row.billNo).join('、');
     await ElMessageBox.confirm(`确定要为以下对账单申请开票吗?\n${billNos}`, '提示', {
     await ElMessageBox.confirm(`确定要为以下对账单申请开票吗?\n${billNos}`, '提示', {
       confirmButtonText: '确定',
       confirmButtonText: '确定',
@@ -174,6 +182,7 @@ const handleApplyInvoice = async () => {
     });
     });
 
 
     // TODO: 调用申请开票接口
     // TODO: 调用申请开票接口
+    await applyForInvoice(form);
     ElMessage.success('申请开票成功');
     ElMessage.success('申请开票成功');
     loadStatementList();
     loadStatementList();
   } catch (error) {
   } catch (error) {