Эх сурвалжийг харах

feat: 隐藏手工发放和发放批次管理相关UI

alphah 1 долоо хоног өмнө
parent
commit
6354284c7b

BIN
frontend/dist.zip


+ 0 - 1
frontend/src/views/module_payment/institution/components/InstitutionForm.vue

@@ -46,7 +46,6 @@
           <el-form-item label="额度发放" prop="grant_mode">
             <el-radio-group v-model="formData.grant_mode">
               <el-radio value="period">按固定周期发放</el-radio>
-              <el-radio value="manual">按手工发放</el-radio>
             </el-radio-group>
           </el-form-item>
         </el-col>

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

@@ -1,14 +1,5 @@
 <template>
   <div class="quota-list">
-    <div class="quota-list__toolbar" style="display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;">
-      <el-button type="success" size="small" @click="showBatchDialog = true">
-        手工发放
-      </el-button>
-      <el-button type="primary" size="small" @click="showBatchListDialog = true; loadBatchList()">
-        发放批次管理
-      </el-button>
-    </div>
-
     <el-table v-loading="loading" :data="list" border stripe size="small" style="width: 100%">
       <template #empty>
         <el-empty :image-size="60" description="暂无额度数据" />
@@ -71,80 +62,6 @@
 
     <QuotaDetailDialog v-model:visible="detailVisible" :quota-id="currentQuotaId" />
 
-    <!-- 手工发放弹窗 -->
-    <el-dialog v-model="showBatchDialog" title="手工发放额度" width="800px" destroy-on-close>
-      <IssueBatchForm ref="batchFormRef" :enterprise-id="enterpriseId" :institution-id="institutionId" />
-      <template #footer>
-        <el-button type="primary" @click="handleBatchSubmit">确认发放</el-button>
-        <el-button @click="showBatchDialog = false">取消</el-button>
-      </template>
-    </el-dialog>
-
-    <!-- 发放批次管理弹窗 -->
-    <el-dialog v-model="showBatchListDialog" title="发放批次管理" width="1000px" destroy-on-close>
-      <div>
-        <div style="margin-bottom: 12px;">
-          <el-button type="primary" size="small" @click="showBatchDialog = true; showBatchListDialog = false">
-            + 新建发放
-          </el-button>
-        </div>
-        <el-table :data="batchList" border max-height="400">
-          <template #empty>
-            <el-empty :image-size="60" description="暂无发放批次" />
-          </template>
-          <el-table-column type="index" label="序号" width="50" />
-          <el-table-column prop="issue_batch_id" label="批次ID" min-width="160" show-overflow-tooltip />
-          <el-table-column prop="batch_no" label="批次号" min-width="120" />
-          <el-table-column prop="issue_name" label="发放名称" width="100" />
-          <el-table-column prop="total_count" label="人数" width="60" align="center" />
-          <el-table-column prop="total_amount" label="总金额" width="100" align="right">
-            <template #default="scope">
-              {{ scope.row.total_amount ? `¥${Number(scope.row.total_amount).toFixed(2)}` : "-" }}
-            </template>
-          </el-table-column>
-          <el-table-column prop="status" label="状态" width="70" align="center">
-            <template #default="scope">
-              <el-tag :type="ISSUE_BATCH_STATUS_TAG[scope.row.status] || 'info'" size="small">
-                {{ ISSUE_BATCH_STATUS_LABEL[scope.row.status] || scope.row.status }}
-              </el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column prop="created_time" label="创建时间" width="140" />
-          <el-table-column label="操作" width="160" align="center" fixed="right">
-            <template #default="scope">
-              <el-button type="primary" size="small" link @click="handleViewRecords(scope.row)">
-                明细
-              </el-button>
-              <el-button
-                v-if="scope.row.status === 'ACTIVE'"
-                type="danger"
-                size="small"
-                link
-                @click="handleCancelBatch(scope.row)"
-              >
-                作废
-              </el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <template #footer>
-        <el-button @click="showBatchListDialog = false">关闭</el-button>
-      </template>
-    </el-dialog>
-
-    <!-- 发放记录弹窗 -->
-    <el-dialog v-model="recordsDialogVisible" title="发放明细" width="800px" destroy-on-close>
-      <IssueBatchDetail
-        :issue-batch-id="currentBatchId"
-        :institution-id="props.institutionId"
-        :batch-info="currentBatchInfo"
-      />
-      <template #footer>
-        <el-button type="primary" @click="recordsDialogVisible = false">关闭</el-button>
-      </template>
-    </el-dialog>
-
     <!-- 调整金额弹窗 -->
     <AdjustAmountDialog
       v-model:visible="adjustDialogVisible"
@@ -165,15 +82,11 @@ import QuotaAPI, {
   STATUS_TAG_TYPE,
   STATUS_LABEL,
   QUOTA_TYPE_OPTIONS,
-  ISSUE_BATCH_STATUS_TAG,
-  ISSUE_BATCH_STATUS_LABEL,
 } from "@/api/module_payment/quota";
 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 { ElMessage } from "element-plus";
 import { onMounted, ref } from "vue";
 import { useEnterpriseStore } from "@/store/modules/enterprise.store";
 
@@ -195,17 +108,6 @@ const loading = ref(false);
 const detailVisible = ref(false);
 const currentQuotaId = ref("");
 
-// 手工发放
-const showBatchDialog = ref(false);
-const batchFormRef = ref();
-
-// 批次管理
-const showBatchListDialog = ref(false);
-const batchList = ref<any[]>([]);
-const recordsDialogVisible = ref(false);
-const currentBatchId = ref("");
-const currentBatchInfo = ref<any>({});
-
 const adjustDialogVisible = ref(false);
 const changesDialogVisible = ref(false);
 const currentAdjustQuota = ref<any>({});
@@ -252,73 +154,6 @@ function handleChanges(row: any) {
   changesDialogVisible.value = true;
 }
 
-async function handleBatchSubmit() {
-  const formValid = await batchFormRef.value?.submitForm();
-  if (!formValid) return;
-
-  const formData = batchFormRef.value?.getFormData();
-  if (!formData) return;
-
-  try {
-    const res = await QuotaAPI.issueBatchCreate(formData);
-    const data = res?.data?.data || res;
-    ElMessage.success("发放成功");
-    showBatchDialog.value = false;
-    if (data?.issue_quota_check_failed_list?.length > 0) {
-      ElMessage.warning(`有 ${data.issue_quota_check_failed_list.length} 条校验失败`);
-    }
-    fetchList();
-  } catch (e: any) {
-    console.error("发放失败", e);
-  }
-}
-
-// ==== 批次管理 ====
-async function loadBatchList() {
-  try {
-    const res = await QuotaAPI.issueBatchList({ page_no: 1, page_size: 200, institution_id: props.institutionId });
-    batchList.value = res?.data?.data?.items || [];
-  } catch (e) {
-    console.error("加载批次列表失败", e);
-  }
-}
-
-function handleViewRecords(row: any) {
-  currentBatchId.value = row.issue_batch_id;
-  currentBatchInfo.value = {
-    issue_batch_id: row.issue_batch_id,
-    batch_no: row.batch_no,
-    issue_name: row.issue_name,
-    institution_id: row.institution_id,
-  };
-  recordsDialogVisible.value = true;
-}
-
-function handleCancelBatch(row: any) {
-  const store = useEnterpriseStore();
-  const eid = store.getCurrentEnterprise?.enterprise_id;
-  if (!eid) { ElMessage.error("企业ID不存在"); return; }
-
-  ElMessageBox.confirm(`确认作废发放批次 "${row.issue_name}"?`, "警告", {
-    confirmButtonText: "确认作废",
-    cancelButtonText: "取消",
-    type: "warning",
-  }).then(async () => {
-    try {
-      await QuotaAPI.issueBatchCancel({
-        enterprise_id: eid,
-        institution_id: row.institution_id,
-        issue_batch_id: row.issue_batch_id,
-      });
-      ElMessage.success("作废成功");
-      loadBatchList();
-      fetchList();
-    } catch (e) {
-      console.error("作废失败", e);
-    }
-  }).catch(() => {});
-}
-
 onMounted(() => {
   fetchList();
 });

+ 1 - 176
frontend/src/views/module_payment/quota/index.vue

@@ -197,72 +197,6 @@
       </EnhancedDialog>
     </template>
 
-    <!-- 手工发放批次管理 -->
-    <template v-if="activeCategory === 'batch'">
-      <div class="batch-section">
-        <div style="margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center;">
-          <h3 style="margin: 0">手工发放批次</h3>
-          <el-button type="primary" @click="handleCreateBatch">
-            <el-icon><Plus /></el-icon> 新建发放
-          </el-button>
-        </div>
-
-        <el-table :data="batchList" border max-height="calc(100vh - 300px)">
-          <template #empty>
-            <el-empty :image-size="80" description="暂无发放批次" />
-          </template>
-          <el-table-column type="index" label="序号" width="60" />
-          <el-table-column prop="issue_batch_id" label="批次ID" min-width="180" show-overflow-tooltip />
-          <el-table-column prop="batch_no" label="批次号" min-width="140" />
-          <el-table-column prop="issue_name" label="发放名称" min-width="120" />
-          <el-table-column prop="institution_id" label="制度ID" min-width="160" show-overflow-tooltip />
-          <el-table-column prop="total_count" label="发放人数" width="80" align="center" />
-          <el-table-column prop="total_amount" label="总金额" width="120" align="right">
-            <template #default="scope">
-              {{ scope.row.total_amount ? `¥${Number(scope.row.total_amount).toFixed(2)}` : "-" }}
-            </template>
-          </el-table-column>
-          <el-table-column prop="status" label="状态" width="80" align="center">
-            <template #default="scope">
-              <el-tag :type="ISSUE_BATCH_STATUS_TAG[scope.row.status] || 'info'" size="small">
-                {{ ISSUE_BATCH_STATUS_LABEL[scope.row.status] || scope.row.status }}
-              </el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column prop="created_time" label="创建时间" width="160" />
-          <el-table-column label="操作" width="180" align="center" fixed="right">
-            <template #default="scope">
-              <el-button type="primary" size="small" link @click="handleViewBatchRecords(scope.row)">
-                发放明细
-              </el-button>
-              <el-button
-                v-if="scope.row.status === 'ACTIVE'"
-                type="danger"
-                size="small"
-                link
-                @click="handleCancelBatch(scope.row)"
-              >
-                作废
-              </el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-    </template>
-
-    <!-- 新建批次弹窗 -->
-    <el-dialog v-model="batchDialogVisible" title="新建手工发放" width="800px" destroy-on-close @close="handleBatchDialogClose">
-      <IssueBatchForm
-        ref="batchFormRef"
-        :enterprise-id="enterpriseIdFromUrl"
-        @success="handleBatchCreateSuccess"
-      />
-      <template #footer>
-        <el-button type="primary" @click="handleBatchSubmit">确认发放</el-button>
-        <el-button @click="batchDialogVisible = false">取消</el-button>
-      </template>
-    </el-dialog>
-
     <!-- 员工发放记录 -->
     <template v-if="activeCategory === 'employee'">
       <div class="employee-records-section">
@@ -319,17 +253,6 @@
       :employee-name="currentEmpName"
     />
 
-    <!-- 发放记录弹窗 -->
-    <el-dialog v-model="recordsDialogVisible" title="发放明细" width="900px" destroy-on-close>
-      <IssueBatchDetail
-        :issue-batch-id="currentBatchId"
-        :institution-id="currentBatchInstitutionId"
-        :batch-info="currentBatchInfo"
-      />
-      <template #footer>
-        <el-button type="primary" @click="recordsDialogVisible = false">关闭</el-button>
-      </template>
-    </el-dialog>
   </div>
 </template>
 
@@ -339,14 +262,11 @@ defineOptions({
   inheritAttrs: false,
 });
 
-import { Plus } from "@element-plus/icons-vue";
 import QuotaAPI, {
   QuotaPageQuery,
   QUOTA_TYPE_OPTIONS,
   STATUS_TAG_TYPE,
   STATUS_LABEL,
-  ISSUE_BATCH_STATUS_TAG,
-  ISSUE_BATCH_STATUS_LABEL,
 } from "@/api/module_payment/quota";
 import CrudToolbarLeft from "@/components/CURD/CrudToolbarLeft.vue";
 import CrudToolbarRight from "@/components/CURD/CrudToolbarRight.vue";
@@ -355,14 +275,12 @@ import PageContent from "@/components/CURD/PageContent.vue";
 import EnhancedDialog from "@/components/CURD/EnhancedDialog.vue";
 import QuotaForm from "./components/QuotaForm.vue";
 import QuotaDetail from "./components/QuotaDetail.vue";
-import IssueBatchForm from "./components/IssueBatchForm.vue";
-import IssueBatchDetail from "./components/IssueBatchDetail.vue";
 import EmployeeQuotaDetailDialog from "./components/EmployeeQuotaDetailDialog.vue";
 import type { ISearchConfig, IContentConfig } from "@/components/CURD/types";
 import { useCrudList } from "@/components/CURD/useCrudList";
 import { useLoadingAction } from "@/composables/useLoadingAction";
 import { useRoute } from "vue-router";
-import { ElMessage, ElMessageBox } from "element-plus";
+import { ElMessage } from "element-plus";
 import EmployeeAPI from "@/api/module_payment/employee";
 import { ref, reactive, computed, onMounted } from "vue";
 import { useEnterpriseStore } from "@/store/modules/enterprise.store";
@@ -381,7 +299,6 @@ const enterpriseIdFromUrl = computed(() => route.query.enterprise_id as string |
 
 const categoryTabs = [
   { key: "quota", label: "额度管理" },
-  { key: "batch", label: "手工发放" },
   { key: "employee", label: "员工发放记录" },
 ];
 const activeCategory = ref((route.query.tab as string) || "quota");
@@ -435,12 +352,10 @@ function handleViewEmployeeRecords(row: any) {
 }
 
 onMounted(() => {
-  if (activeCategory.value === "batch") loadBatchList();
 });
 
 function handleCategoryChange(key: string) {
   activeCategory.value = key;
-  if (key === "batch") loadBatchList();
 }
 
 // ===== 额度管理 =====
@@ -582,94 +497,4 @@ function formatQuotaType(type?: string) {
   return option ? option.label : type;
 }
 
-// ===== 手工发放批次管理 =====
-const batchFormRef = ref();
-const batchDialogVisible = ref(false);
-const recordsDialogVisible = ref(false);
-const batchList = ref<any[]>([]);
-const currentBatchId = ref("");
-const currentBatchInstitutionId = ref("");
-const currentBatchInfo = ref<any>({});
-
-async function loadBatchList() {
-  try {
-    const store = useEnterpriseStore();
-    const eid = store.getCurrentEnterprise?.enterprise_id;
-    const res = await QuotaAPI.issueBatchList({ page_no: 1, page_size: 200, institution_id: institutionIdFromUrl.value });
-    batchList.value = res?.data?.data?.items || [];
-  } catch (e) {
-    console.error("加载批次列表失败", e);
-  }
-}
-
-function handleCreateBatch() {
-  batchFormRef.value?.resetForm();
-  batchDialogVisible.value = true;
-}
-
-async function handleBatchSubmit() {
-  const formValid = await batchFormRef.value?.submitForm();
-  if (!formValid) return;
-
-  const formData = batchFormRef.value?.getFormData();
-  if (!formData) return;
-
-  await loadingExecute({
-    loadingText: "正在发放...",
-    action: () => QuotaAPI.issueBatchCreate(formData),
-    onSuccess: (res: any) => {
-      const data = res?.data?.data || res;
-      ElMessage.success("发放成功");
-      batchDialogVisible.value = false;
-      if (data?.issue_quota_check_failed_list?.length > 0) {
-        ElMessage.warning(`有 ${data.issue_quota_check_failed_list.length} 条校验失败`);
-      }
-      loadBatchList();
-    },
-  });
-}
-
-function handleBatchDialogClose() {
-  batchDialogVisible.value = false;
-}
-
-function handleViewBatchRecords(row: any) {
-  currentBatchId.value = row.issue_batch_id;
-  currentBatchInstitutionId.value = row.institution_id;
-  currentBatchInfo.value = {
-    issue_batch_id: row.issue_batch_id,
-    batch_no: row.batch_no,
-    issue_name: row.issue_name,
-    institution_id: row.institution_id,
-  };
-  recordsDialogVisible.value = true;
-}
-
-function handleCancelBatch(row: any) {
-  ElMessageBox.confirm(`确认作废发放批次 "${row.issue_name}"?作废后已发放的额度将无法使用。`, "警告", {
-    confirmButtonText: "确认作废",
-    cancelButtonText: "取消",
-    type: "warning",
-  }).then(async () => {
-    const store = useEnterpriseStore();
-    const eid = store.getCurrentEnterprise?.enterprise_id;
-    if (!eid) {
-      ElMessage.error("企业ID不存在");
-      return;
-    }
-    await loadingExecute({
-      loadingText: "正在作废...",
-      action: () =>
-        QuotaAPI.issueBatchCancel({
-          enterprise_id: eid,
-          institution_id: row.institution_id,
-          issue_batch_id: row.issue_batch_id,
-        }),
-      onSuccess: () => {
-        ElMessage.success("作废成功");
-        loadBatchList();
-      },
-    });
-  }).catch(() => {});
-}
 </script>