Jelajahi Sumber

1.罚款记录批量操作
2.退款记录批量操作

GouGengquan 3 bulan lalu
induk
melakukan
0df9eb5ef8

+ 5 - 1
src/api/modules/financeFine.js

@@ -12,8 +12,12 @@ export default {
     update(params) {
         return request.put(`financeFine/update`, params)
     },
-    // 更新罚款记录
+    // 确认罚款记录
     confirm(params) {
         return request.put(`financeFine/confirm/${params}`)
     },
+    // 批量确认罚款记录
+    batchConfirm(params) {
+        return request.put(`financeFine/confirm/batch`, params)
+    },
 }

+ 4 - 0
src/api/modules/financeFineRefund.js

@@ -13,4 +13,8 @@ export default {
     update(params) {
         return request.put(`financeFineRefund/updateStatus`, params)
     },
+    // 批量更新记录状态
+    batchUpdate(params) {
+        return request.put(`financeFineRefund/updateStatus/batch`, params)
+    },
 }

File diff ditekan karena terlalu besar
+ 584 - 545
src/views/finance/fine.vue


+ 52 - 3
src/views/finance/fineRefund.vue

@@ -42,8 +42,11 @@
             <el-button class="filter-item" style="margin-left:20px;float: left;" type="primary" @click="page()" round>搜索</el-button>
             <el-button class="filter-item" style="float: left;" round type="success" @click="resetSearch()">重置</el-button>
             <el-button class="filter-item" style="float: left;" round type="warning" @click="fineRefundListExport()">导出</el-button>
+            <PermissionButton menu-code="_views_finance_fine_refund_returned_batch" class="filter-item" style="float: left;" round type="danger" @click="batchUpdateStatus('RETURNED')" />
+            <PermissionButton menu-code="_views_finance_fine_refund_ignore_batch" class="filter-item" style="float: left;" round type="danger" @click="batchUpdateStatus('IGNORE')" />
           </template>
-          <parentTable ref="table" v-loading="listLoading" :data="pageData.records" slot="table" style="width: 100%;">
+          <parentTable ref="table" v-loading="listLoading" :data="pageData.records" :selectionChange="handleSelectionChange" slot="table" style="width: 100%;">
+            <el-table-column type="selection" align="center" width="40"></el-table-column>
             <el-table-column label="项⽬编号" align="center" width="150">
               <template slot-scope="{row}">
                 <span>{{ row.orderId }}</span>
@@ -166,8 +169,11 @@
             <el-button class="filter-item" style="margin-left:20px;float: left;" type="primary" @click="page()" round>搜索</el-button>
             <el-button class="filter-item" style="float: left;" round type="success" @click="resetSearch()">重置</el-button>
             <el-button class="filter-item" style="float: left;" round type="warning" @click="fineRefundListExport()">导出</el-button>
+            <PermissionButton menu-code="_views_finance_fine_refund_returned_batch" class="filter-item" style="float: left;" round type="danger" @click="batchUpdateStatus('RETURNED')" />
+            <PermissionButton menu-code="_views_finance_fine_refund_ignore_batch" class="filter-item" style="float: left;" round type="danger" @click="batchUpdateStatus('IGNORE')" />
           </template>
-          <parentTable ref="table" v-loading="listLoading" :data="pageData.records" slot="table" style="width: 100%;">
+          <parentTable ref="table" v-loading="listLoading" :data="pageData.records" :selectionChange="handleSelectionChange" slot="table" style="width: 100%;">
+            <el-table-column type="selection" align="center" width="40"></el-table-column>
             <el-table-column label="项⽬编号" align="center" width="120">
               <template slot-scope="{row}">
                 <span>{{ row.orderId }}</span>
@@ -290,8 +296,11 @@
             <el-button class="filter-item" style="margin-left:20px;float: left;" type="primary" @click="page()" round>搜索</el-button>
             <el-button class="filter-item" style="float: left;" round type="success" @click="resetSearch()">重置</el-button>
             <el-button class="filter-item" style="float: left;" round type="warning" @click="fineRefundListExport()">导出</el-button>
+            <PermissionButton menu-code="_views_finance_fine_refund_returned_batch" class="filter-item" style="float: left;" round type="danger" @click="batchUpdateStatus('RETURNED')" />
+            <PermissionButton menu-code="_views_finance_fine_refund_ignore_batch" class="filter-item" style="float: left;" round type="danger" @click="batchUpdateStatus('IGNORE')" />
           </template>
-          <parentTable ref="table" v-loading="listLoading" :data="pageData.records" slot="table" style="width: 100%;">
+          <parentTable ref="table" v-loading="listLoading" :data="pageData.records" :selectionChange="handleSelectionChange" slot="table" style="width: 100%;">
+            <el-table-column type="selection" align="center" width="40"></el-table-column>
             <el-table-column label="项⽬编号" align="center" width="120">
               <template slot-scope="{row}">
                 <span>{{ row.orderId }}</span>
@@ -447,6 +456,7 @@ export default {
         explain: null,
         fineAmount: null,
       },
+      batchUpdateIds: [],
     };
   },
   created() {
@@ -521,6 +531,45 @@ export default {
         this.page();
       });
     },
+    // 多选触发
+    handleSelectionChange(selection) {
+      this.batchUpdateIds = selection.map((item) => item.id);
+    },
+    // 批量更新退款状态
+    batchUpdateStatus(status) {
+      if (this.batchUpdateIds && this.batchUpdateIds.length > 0) {
+        this.$confirm('请仔细确认要进行批量操作的数据, 是否继续?', '警告', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        }).then(() => {
+          let batchUpdateForms = [];
+          for (let index = 0; index < this.batchUpdateIds.length; index++) {
+            this.updateForm = {
+              id: this.batchUpdateIds[index],
+              status: status,
+            };
+            batchUpdateForms.push(this.updateForm);
+          }
+          this.$api.financeFineRefund.batchUpdate(batchUpdateForms).then((res) => {
+            this.$notify({
+              title: '成功',
+              message: '批量请求成功!',
+              type: 'success',
+              duration: 3000,
+            });
+            this.page();
+          });
+        });
+      } else {
+        this.$notify({
+          title: '警告',
+          message: '请至少选择一条退款记录!',
+          type: 'warning',
+          duration: 3000,
+        });
+      }
+    },
   },
 };
 </script>