Procházet zdrojové kódy

fix: 制度详情额度列表增加调整金额和变更记录按钮+弹窗

alphah před 2 týdny
rodič
revize
ec3d7193a7

binární
frontend/dist.zip


+ 37 - 1
frontend/src/views/module_payment/institution/components/QuotaList.vue

@@ -47,9 +47,11 @@
         </template>
       </el-table-column>
       <el-table-column prop="created_time" label="创建时间" width="160" />
-      <el-table-column v-if="!readonly" label="操作" width="120" align="center" fixed="right">
+      <el-table-column v-if="!readonly" label="操作" width="220" align="center" fixed="right">
         <template #default="scope">
           <el-button type="text" size="small" @click="handleDetail(scope.row)">详情</el-button>
+          <el-button v-if="scope.row.quota_id" type="text" size="small" @click="handleAdjust(scope.row)">调整金额</el-button>
+          <el-button v-if="scope.row.quota_id" type="text" size="small" @click="handleChanges(scope.row)">变更记录</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -142,6 +144,19 @@
         <el-button type="primary" @click="recordsDialogVisible = false">关闭</el-button>
       </template>
     </el-dialog>
+
+    <!-- 调整金额弹窗 -->
+    <AdjustAmountDialog
+      v-model:visible="adjustDialogVisible"
+      :quota-data="currentAdjustQuota"
+      @success="fetchList"
+    />
+
+    <!-- 变更记录弹窗 -->
+    <ChangeHistoryDialog
+      v-model:visible="changesDialogVisible"
+      :quota-id="currentChangeQuotaId"
+    />
   </div>
 </template>
 
@@ -156,6 +171,8 @@ import QuotaAPI, {
 import QuotaDetailDialog from "./QuotaDetailDialog.vue";
 import IssueBatchForm from "@/views/module_payment/quota/components/IssueBatchForm.vue";
 import IssueBatchDetail from "@/views/module_payment/quota/components/IssueBatchDetail.vue";
+import AdjustAmountDialog from "@/views/module_payment/quota/components/AdjustAmountDialog.vue";
+import ChangeHistoryDialog from "@/views/module_payment/quota/components/ChangeHistoryDialog.vue";
 import { ElMessage, ElMessageBox } from "element-plus";
 import { onMounted, ref } from "vue";
 import { useEnterpriseStore } from "@/store/modules/enterprise.store";
@@ -189,6 +206,11 @@ const recordsDialogVisible = ref(false);
 const currentBatchId = ref("");
 const currentBatchInfo = ref<any>({});
 
+const adjustDialogVisible = ref(false);
+const changesDialogVisible = ref(false);
+const currentAdjustQuota = ref<any>({});
+const currentChangeQuotaId = ref("");
+
 async function fetchList() {
   if (!props.institutionId) return;
   loading.value = true;
@@ -216,6 +238,20 @@ function handleDetail(row: any) {
   detailVisible.value = true;
 }
 
+function handleAdjust(row: any) {
+  currentAdjustQuota.value = {
+    quota_id: row.quota_id,
+    available_amount: row.available_amount,
+    total_amount: row.total_amount,
+  };
+  adjustDialogVisible.value = true;
+}
+
+function handleChanges(row: any) {
+  currentChangeQuotaId.value = row.quota_id;
+  changesDialogVisible.value = true;
+}
+
 async function handleBatchSubmit() {
   const formValid = await batchFormRef.value?.submitForm();
   if (!formValid) return;