Jelajahi Sumber

开票申请调整

huangguoce 3 minggu lalu
induk
melakukan
92f22e5433
1 mengubah file dengan 15 tambahan dan 6 penghapusan
  1. 15 6
      src/views/cw/invoice/InvoiceList.vue

+ 15 - 6
src/views/cw/invoice/InvoiceList.vue

@@ -1048,11 +1048,18 @@ export default {
     batchInvoicePush() {
       let selectedRows = this.$refs.invoiceTable.getCheckboxRecords()
       // 校验
-      for (const row of selectedRows) {
-        if ((row.status != '0' && row.status != '1' && row.status != '3')) {
-          this.$message.error('所选数据中存在已发起开票申请流程的数据,请重新选择')
-          return
-        }
+      // for (const row of selectedRows) {
+      //   if ((row.status != '0' && row.status != '1' && row.status != '3')) {
+      //     this.$message.error('所选数据中存在已发起开票申请流程的数据,请重新选择')
+      //     return
+      //   }
+      // }
+      // selectedRows筛选掉row.status != '0' && row.status != '1' && row.status != '3'
+      selectedRows = selectedRows.filter(row => row.status === '0' || row.status === '1' || row.status === '3')
+      let startLength = selectedRows.length
+      if (selectedRows.length === 0) {
+        this.$message.error('所选数据不可发起开票申请流程,请重新选择')
+        return
       }
       ElMessageBox.confirm(
         '确定批量发起开票申请吗?',
@@ -1067,7 +1074,8 @@ export default {
           financeInvoiceService.batchInvoicePush(selectedRows).then((data) => {
             if (data) {
               if (data.length > 0) {
-                let message = '操作完成</br>';
+                let resLength = startLength - data.length
+                let message = '操作完成,成功发起' + resLength + '条数据的开票申请流程</br>以下数据发起失败:</br>';
                 data.forEach((item) => {
                   message += item + '</br>';
                 });
@@ -1083,6 +1091,7 @@ export default {
                 this.refreshList()
               }
             } else {
+              this.$message.success('操作成功,已全部发起开票申请流程')
               this.refreshList()
             }
           }).catch((e) => {