|
@@ -197,72 +197,6 @@
|
|
|
</EnhancedDialog>
|
|
</EnhancedDialog>
|
|
|
</template>
|
|
</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'">
|
|
<template v-if="activeCategory === 'employee'">
|
|
|
<div class="employee-records-section">
|
|
<div class="employee-records-section">
|
|
@@ -319,17 +253,6 @@
|
|
|
:employee-name="currentEmpName"
|
|
: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>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -339,14 +262,11 @@ defineOptions({
|
|
|
inheritAttrs: false,
|
|
inheritAttrs: false,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-import { Plus } from "@element-plus/icons-vue";
|
|
|
|
|
import QuotaAPI, {
|
|
import QuotaAPI, {
|
|
|
QuotaPageQuery,
|
|
QuotaPageQuery,
|
|
|
QUOTA_TYPE_OPTIONS,
|
|
QUOTA_TYPE_OPTIONS,
|
|
|
STATUS_TAG_TYPE,
|
|
STATUS_TAG_TYPE,
|
|
|
STATUS_LABEL,
|
|
STATUS_LABEL,
|
|
|
- ISSUE_BATCH_STATUS_TAG,
|
|
|
|
|
- ISSUE_BATCH_STATUS_LABEL,
|
|
|
|
|
} from "@/api/module_payment/quota";
|
|
} from "@/api/module_payment/quota";
|
|
|
import CrudToolbarLeft from "@/components/CURD/CrudToolbarLeft.vue";
|
|
import CrudToolbarLeft from "@/components/CURD/CrudToolbarLeft.vue";
|
|
|
import CrudToolbarRight from "@/components/CURD/CrudToolbarRight.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 EnhancedDialog from "@/components/CURD/EnhancedDialog.vue";
|
|
|
import QuotaForm from "./components/QuotaForm.vue";
|
|
import QuotaForm from "./components/QuotaForm.vue";
|
|
|
import QuotaDetail from "./components/QuotaDetail.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 EmployeeQuotaDetailDialog from "./components/EmployeeQuotaDetailDialog.vue";
|
|
|
import type { ISearchConfig, IContentConfig } from "@/components/CURD/types";
|
|
import type { ISearchConfig, IContentConfig } from "@/components/CURD/types";
|
|
|
import { useCrudList } from "@/components/CURD/useCrudList";
|
|
import { useCrudList } from "@/components/CURD/useCrudList";
|
|
|
import { useLoadingAction } from "@/composables/useLoadingAction";
|
|
import { useLoadingAction } from "@/composables/useLoadingAction";
|
|
|
import { useRoute } from "vue-router";
|
|
import { useRoute } from "vue-router";
|
|
|
-import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
|
|
|
|
+import { ElMessage } from "element-plus";
|
|
|
import EmployeeAPI from "@/api/module_payment/employee";
|
|
import EmployeeAPI from "@/api/module_payment/employee";
|
|
|
import { ref, reactive, computed, onMounted } from "vue";
|
|
import { ref, reactive, computed, onMounted } from "vue";
|
|
|
import { useEnterpriseStore } from "@/store/modules/enterprise.store";
|
|
import { useEnterpriseStore } from "@/store/modules/enterprise.store";
|
|
@@ -381,7 +299,6 @@ const enterpriseIdFromUrl = computed(() => route.query.enterprise_id as string |
|
|
|
|
|
|
|
|
const categoryTabs = [
|
|
const categoryTabs = [
|
|
|
{ key: "quota", label: "额度管理" },
|
|
{ key: "quota", label: "额度管理" },
|
|
|
- { key: "batch", label: "手工发放" },
|
|
|
|
|
{ key: "employee", label: "员工发放记录" },
|
|
{ key: "employee", label: "员工发放记录" },
|
|
|
];
|
|
];
|
|
|
const activeCategory = ref((route.query.tab as string) || "quota");
|
|
const activeCategory = ref((route.query.tab as string) || "quota");
|
|
@@ -435,12 +352,10 @@ function handleViewEmployeeRecords(row: any) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- if (activeCategory.value === "batch") loadBatchList();
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
function handleCategoryChange(key: string) {
|
|
function handleCategoryChange(key: string) {
|
|
|
activeCategory.value = key;
|
|
activeCategory.value = key;
|
|
|
- if (key === "batch") loadBatchList();
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// ===== 额度管理 =====
|
|
// ===== 额度管理 =====
|
|
@@ -582,94 +497,4 @@ function formatQuotaType(type?: string) {
|
|
|
return option ? option.label : type;
|
|
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>
|
|
</script>
|