|
@@ -1,264 +1,342 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="safety-platform-container">
|
|
|
|
|
- <header class="safety-platform-container__header">
|
|
|
|
|
- <div class="breadcrumb-title"> 物品库存管理 </div>
|
|
|
|
|
- </header>
|
|
|
|
|
- <main class="safety-platform-container__main">
|
|
|
|
|
- <div class="search-table-container">
|
|
|
|
|
- <header>
|
|
|
|
|
- <div style="position: relative">
|
|
|
|
|
- <el-button type="primary" class="search-table-container--button" @click="handleCreate">
|
|
|
|
|
- 添加
|
|
|
|
|
- </el-button>
|
|
|
|
|
- <el-button plain class="search-table-container--button" @click="handleImport">
|
|
|
|
|
- 导入
|
|
|
|
|
- </el-button>
|
|
|
|
|
- <el-button plain class="search-table-container--button" @click="handleDownload">
|
|
|
|
|
- 导出
|
|
|
|
|
- </el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="act-search">
|
|
|
|
|
- <section class="select-box">
|
|
|
|
|
- <div class="select-box--item">
|
|
|
|
|
- <span>物品名称:</span>
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="tableQuery.queryParam.stuffName"
|
|
|
|
|
- placeholder="搜索物品名称"
|
|
|
|
|
- class="act-search-input"
|
|
|
|
|
- />
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="select-box--item">
|
|
|
|
|
- <span>状态:</span>
|
|
|
|
|
- <el-select
|
|
|
|
|
- v-model="tableQuery.queryParam.status"
|
|
|
|
|
- placeholder="请选择状态"
|
|
|
|
|
- clearable
|
|
|
|
|
- >
|
|
|
|
|
- <el-option label="启用" :value="true" />
|
|
|
|
|
- <el-option label="禁用" :value="false" />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </div>
|
|
|
|
|
- </section>
|
|
|
|
|
- <section class="search-btn">
|
|
|
|
|
- <el-button type="primary" @click="handleSearch">查询</el-button>
|
|
|
|
|
- <el-button @click="handleReset">重置</el-button>
|
|
|
|
|
- </section>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div class="safety-platform-container">
|
|
|
|
|
+ <header class="safety-platform-container__header">
|
|
|
|
|
+ <div class="breadcrumb-title"> 教育培训计划管理</div>
|
|
|
</header>
|
|
</header>
|
|
|
|
|
+ <main class="safety-platform-container__main">
|
|
|
|
|
+ <div class="search-table-container">
|
|
|
|
|
+ <header>
|
|
|
|
|
+ <div style="position: relative">
|
|
|
|
|
+ <el-button type="primary" class="search-table-container--button" @click="handleCreate">
|
|
|
|
|
+ 添加
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <!-- <el-button plain class="search-table-container--button" @click="handleImport">
|
|
|
|
|
+ 导入
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button plain class="search-table-container--button" @click="handleDownload">
|
|
|
|
|
+ 导出
|
|
|
|
|
+ </el-button> -->
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="act-search">
|
|
|
|
|
+ <section class="select-box">
|
|
|
|
|
+ <div class="select-box--item">
|
|
|
|
|
+ <span>培训内容/计划名称:</span>
|
|
|
|
|
+ <el-input v-model="tableQuery.queryParam.keyword" placeholder="搜索培训内容或计划名称"
|
|
|
|
|
+ class="act-search-input" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="select-box--item">
|
|
|
|
|
+ <span>状态:</span>
|
|
|
|
|
+ <el-select v-model="tableQuery.queryParam.status" placeholder="请选择状态" clearable>
|
|
|
|
|
+ <el-option v-for="item in STATUS_OPTIONS" :key="item.value" :label="item.label"
|
|
|
|
|
+ :value="item.value" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="select-box--item">
|
|
|
|
|
+ <span>分类名称:</span>
|
|
|
|
|
+ <el-select v-model="tableQuery.queryParam.categoryName" placeholder="请选择分类名称" filterable
|
|
|
|
|
+ clearable>
|
|
|
|
|
+ <el-option v-for="item in classifyNameOptions" :key="item.value" :label="item.label"
|
|
|
|
|
+ :value="item.value" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <span>计划日期范围:</span>
|
|
|
|
|
+ <el-date-picker v-model="dateRange" type="daterange" range-separator="至"
|
|
|
|
|
+ start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD"
|
|
|
|
|
+ format="YYYY-MM-DD" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </section>
|
|
|
|
|
+ <section class="search-btn">
|
|
|
|
|
+ <el-button type="primary" @click="handleSearch">查询</el-button>
|
|
|
|
|
+ <el-button @click="handleReset">重置</el-button>
|
|
|
|
|
+ </section>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </header>
|
|
|
|
|
|
|
|
- <div class="batch-table">
|
|
|
|
|
- <BasicTable
|
|
|
|
|
- ref="basicTableRef"
|
|
|
|
|
- :tableData="tableData"
|
|
|
|
|
- :tableConfig="tableConfig"
|
|
|
|
|
- @update:pageSize="handleSizeChange"
|
|
|
|
|
- @update:pageNumber="handleCurrentChange"
|
|
|
|
|
- >
|
|
|
|
|
- <template #status="scope">
|
|
|
|
|
- <span>
|
|
|
|
|
- {{ scope.row.statusName || (scope.row.status === true || scope.row.status === 'true' ? '启用' : scope.row.status === false || scope.row.status === 'false' ? '禁用' : '-') }}
|
|
|
|
|
- </span>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template #action="scope">
|
|
|
|
|
- <div class="action-container--div" style="justify-content: left">
|
|
|
|
|
- <ActionButton text="编辑" @click="handleEdit(scope.row.id)" />
|
|
|
|
|
- <ActionButton
|
|
|
|
|
- text="删除"
|
|
|
|
|
- :popconfirm="{
|
|
|
|
|
- title: '确定要删除?',
|
|
|
|
|
- }"
|
|
|
|
|
- @confirm="handleDelete(scope.row.id)"
|
|
|
|
|
- />
|
|
|
|
|
- <ActionButton text="查看" @click="handleView(scope.row.id)" />
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
- </BasicTable>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </main>
|
|
|
|
|
- <BatchImport
|
|
|
|
|
- v-if="batchImportVisible"
|
|
|
|
|
- :visible="batchImportVisible"
|
|
|
|
|
- :import-api-url="importApiUrl"
|
|
|
|
|
- :template-url="templateUrl"
|
|
|
|
|
- template-name="下载模板"
|
|
|
|
|
- :show-template="false"
|
|
|
|
|
- @close="batchImportVisible = false"
|
|
|
|
|
- @update="handleUpdate"
|
|
|
|
|
- />
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div class="batch-table">
|
|
|
|
|
+ <BasicTable ref="basicTableRef" :tableData="tableData" :tableConfig="tableConfig"
|
|
|
|
|
+ @update:pageSize="handleSizeChange" @update:pageNumber="handleCurrentChange">
|
|
|
|
|
+ <template #status="scope">
|
|
|
|
|
+ <span>
|
|
|
|
|
+ {{
|
|
|
|
|
+ scope.row.statusName ||
|
|
|
|
|
+ (scope.row.status === true || scope.row.status === 'true'
|
|
|
|
|
+ ? '启用'
|
|
|
|
|
+ : scope.row.status === false || scope.row.status === 'false'
|
|
|
|
|
+ ? '禁用'
|
|
|
|
|
+ : '-')
|
|
|
|
|
+ }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #action="scope">
|
|
|
|
|
+ <div class="action-container--div" style="justify-content: left">
|
|
|
|
|
+ <!-- 状态:1-未下发 2-进行中 3-已完成 4-已作废 -->
|
|
|
|
|
+ <!-- 1-未下发 -->
|
|
|
|
|
+ <template v-if="scope.row.status === 1">
|
|
|
|
|
+ <ActionButton text="编辑" @click="handleEdit(scope.row.id)" />
|
|
|
|
|
+ <ActionButton text="查看" @click="handleView(scope.row.id)" />
|
|
|
|
|
+ <ActionButton text="删除" :popconfirm="{
|
|
|
|
|
+ title: '确定要删除?',
|
|
|
|
|
+ }" @confirm="handleDelete(scope.row.id)" />
|
|
|
|
|
+ <ActionButton text="下发" @click="handleIssue(scope.row)" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <!-- 2-进行中 -->
|
|
|
|
|
+ <template v-else-if="scope.row.status === 2">
|
|
|
|
|
+ <ActionButton text="查看" @click="handleView(scope.row.id)" />
|
|
|
|
|
+ <ActionButton text="作废" :popconfirm="{
|
|
|
|
|
+ title: '确定要作废?',
|
|
|
|
|
+ }" @confirm="handleCancel(scope.row.id)" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <!-- 3-已完成 -->
|
|
|
|
|
+ <template v-else-if="scope.row.status === 3">
|
|
|
|
|
+ <ActionButton text="查看" @click="handleView(scope.row.id)" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <!-- 其他 -->
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ <ActionButton text="查看" @click="handleView(scope.row.id)" />
|
|
|
|
|
+ <ActionButton text="删除" :popconfirm="{
|
|
|
|
|
+ title: '确定要删除?',
|
|
|
|
|
+ }" @confirm="handleDelete(scope.row.id)" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </BasicTable>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </main>
|
|
|
|
|
+ <IssueEducationTrainingPlan v-model:visible="issueWorkPlanDialogVisible" v-model:data="issueWorkPlanParams"
|
|
|
|
|
+ @confirm="handleConfirmIssue" />
|
|
|
|
|
+ <BatchImport v-if="batchImportVisible" :visible="batchImportVisible" :import-api-url="importApiUrl"
|
|
|
|
|
+ :template-url="templateUrl" template-name="下载模板" :show-template="false" @close="batchImportVisible = false"
|
|
|
|
|
+ @update="handleUpdate" />
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
- import { onMounted, reactive, ref } from 'vue';
|
|
|
|
|
- import { ElMessage } from 'element-plus';
|
|
|
|
|
- import BasicTable from '@/components/BasicTable.vue';
|
|
|
|
|
- import useTableConfig from '@/hooks/useTableConfigHook';
|
|
|
|
|
- import ActionButton from '@/components/ActionButton.vue';
|
|
|
|
|
- import { TABLE_OPTIONS, INVENTORY_TABLE_COLUMNS } from './configs/tables';
|
|
|
|
|
- import { useRouter } from 'vue-router';
|
|
|
|
|
- import type { QueryPageRequest } from '@/types/basic-query';
|
|
|
|
|
- import { queryInventoryManage, deleteInventory, exportInventory } from '@/api/inventory';
|
|
|
|
|
- import { downloadByData } from '@/utils/file/download';
|
|
|
|
|
- import BatchImport from '@/components/batch-import/BatchImport.vue';
|
|
|
|
|
- import { useGlobSetting } from '@/hooks/setting';
|
|
|
|
|
- import urlJoin from 'url-join';
|
|
|
|
|
-
|
|
|
|
|
- const router = useRouter();
|
|
|
|
|
-
|
|
|
|
|
- // 表格
|
|
|
|
|
- const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
|
|
|
|
|
+import { onMounted, reactive, ref } from 'vue';
|
|
|
|
|
+import { ElMessage } from 'element-plus';
|
|
|
|
|
+import BasicTable from '@/components/BasicTable.vue';
|
|
|
|
|
+import useTableConfig from '@/hooks/useTableConfigHook';
|
|
|
|
|
+import ActionButton from '@/components/ActionButton.vue';
|
|
|
|
|
+import { TABLE_OPTIONS, TABLE_COLUMNS, STATUS_OPTIONS } from './configs/tables';
|
|
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
|
|
+import type { QueryPageRequest } from '@/types/basic-query';
|
|
|
|
|
+import { getEducationAndTrainingProgramList, issueEducationAndTrainingProgram, cancelEducationAndTrainingProgram, deleteEducationAndTrainingProgram } from '@/api/production-education-training-plan';
|
|
|
|
|
+import { downloadByData } from '@/utils/file/download';
|
|
|
|
|
+import BatchImport from '@/components/batch-import/BatchImport.vue';
|
|
|
|
|
+import { useGlobSetting } from '@/hooks/setting';
|
|
|
|
|
+import urlJoin from 'url-join';
|
|
|
|
|
+import IssueEducationTrainingPlan from './components/issueEducationTrainingPlan.vue';
|
|
|
|
|
+const router = useRouter();
|
|
|
|
|
|
|
|
- const { tableConfig, pagination } = useTableConfig(INVENTORY_TABLE_COLUMNS, TABLE_OPTIONS);
|
|
|
|
|
|
|
+// 表格
|
|
|
|
|
+const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
|
|
|
|
|
|
- const tableData = ref<any[]>([]);
|
|
|
|
|
|
|
+const { tableConfig, pagination } = useTableConfig(TABLE_COLUMNS, TABLE_OPTIONS);
|
|
|
|
|
|
|
|
- const tableQuery = reactive<QueryPageRequest<any>>({
|
|
|
|
|
|
|
+const tableData = ref<any[]>([]);
|
|
|
|
|
+// 日期范围
|
|
|
|
|
+const dateRange = ref<[string, string] | null>(null);
|
|
|
|
|
+// 分类名称选项
|
|
|
|
|
+const classifyNameOptions = ref<Array<{ label: string; value: string }>>([
|
|
|
|
|
+ { label: '全部', value: '全部' },
|
|
|
|
|
+ { label: '全员安全培训', value: '全员安全培训' },
|
|
|
|
|
+ { label: '新员工培训', value: '新员工培训' },
|
|
|
|
|
+ { label: '岗位资质培训', value: '岗位资质培训' },
|
|
|
|
|
+ { label: '生产作业安全培训', value: '生产作业安全培训' },
|
|
|
|
|
+ { label: '安全管理人员培训', value: '安全管理人员培训' },
|
|
|
|
|
+]);
|
|
|
|
|
+const tableQuery = reactive<QueryPageRequest<any>>({
|
|
|
pageNumber: pagination.pageNumber,
|
|
pageNumber: pagination.pageNumber,
|
|
|
pageSize: pagination.pageSize,
|
|
pageSize: pagination.pageSize,
|
|
|
queryParam: {
|
|
queryParam: {
|
|
|
- stuffName: '', // 物品名称
|
|
|
|
|
- status: true, // 状态,默认启用
|
|
|
|
|
- ids: [], // 选择数据的ID
|
|
|
|
|
|
|
+ keyword: "",
|
|
|
|
|
+ status: "",
|
|
|
|
|
+ categoryName: "",
|
|
|
|
|
+ startDate: "",
|
|
|
|
|
+ endDate: "",
|
|
|
},
|
|
},
|
|
|
- });
|
|
|
|
|
|
|
+});
|
|
|
|
|
|
|
|
- const handleSizeChange = (value: number) => {
|
|
|
|
|
|
|
+const handleSizeChange = (value: number) => {
|
|
|
pagination.pageSize = value;
|
|
pagination.pageSize = value;
|
|
|
tableQuery.pageSize = value;
|
|
tableQuery.pageSize = value;
|
|
|
getTableData();
|
|
getTableData();
|
|
|
- };
|
|
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- const handleCurrentChange = (value: number) => {
|
|
|
|
|
|
|
+const handleCurrentChange = (value: number) => {
|
|
|
pagination.pageNumber = value;
|
|
pagination.pageNumber = value;
|
|
|
tableQuery.pageNumber = value;
|
|
tableQuery.pageNumber = value;
|
|
|
getTableData();
|
|
getTableData();
|
|
|
- };
|
|
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- async function getTableData() {
|
|
|
|
|
|
|
+async function getTableData() {
|
|
|
tableConfig.loading = true;
|
|
tableConfig.loading = true;
|
|
|
try {
|
|
try {
|
|
|
- const res = await queryInventoryManage(tableQuery);
|
|
|
|
|
- if (res) {
|
|
|
|
|
- // 映射返回数据字段到表格字段
|
|
|
|
|
- tableData.value = res.records.map((item) => ({
|
|
|
|
|
- id: item.id,
|
|
|
|
|
- itemName: item.stuffName, // 物品名称
|
|
|
|
|
- warehouseDate: item.inStoreTime, // 入库日期
|
|
|
|
|
- itemQuantity: item.stuffQty, // 物品数量
|
|
|
|
|
- handler: item.createdUserName, // 经办人
|
|
|
|
|
- remarks: item.remark, // 备注
|
|
|
|
|
- status: item.status, // 状态:true-启用,false-禁用
|
|
|
|
|
- statusName: item.statusName, // 状态名称
|
|
|
|
|
- }));
|
|
|
|
|
- pagination.total = res.totalRow;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ tableQuery.queryParam.startDate = dateRange.value ? dateRange.value[0] : '';
|
|
|
|
|
+ tableQuery.queryParam.endDate = dateRange.value ? dateRange.value[1] : '';
|
|
|
|
|
+ const res = await getEducationAndTrainingProgramList(tableQuery);
|
|
|
|
|
+ if (res) {
|
|
|
|
|
+ // 映射返回数据字段到表格字段
|
|
|
|
|
+ tableData.value = res.records
|
|
|
|
|
+ pagination.total = res.totalRow;
|
|
|
|
|
+ }
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
- console.error('获取物品库存列表失败:', e);
|
|
|
|
|
- tableData.value = [];
|
|
|
|
|
- pagination.total = 0;
|
|
|
|
|
|
|
+ console.error('获取列表失败:', e);
|
|
|
|
|
+ tableData.value = [];
|
|
|
|
|
+ pagination.total = 0;
|
|
|
} finally {
|
|
} finally {
|
|
|
- tableConfig.loading = false;
|
|
|
|
|
|
|
+ tableConfig.loading = false;
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- const handleSearch = () => {
|
|
|
|
|
|
|
+const handleSearch = () => {
|
|
|
pagination.pageNumber = 1;
|
|
pagination.pageNumber = 1;
|
|
|
tableQuery.pageNumber = 1;
|
|
tableQuery.pageNumber = 1;
|
|
|
getTableData();
|
|
getTableData();
|
|
|
- };
|
|
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- const handleReset = () => {
|
|
|
|
|
- tableQuery.queryParam.stuffName = '';
|
|
|
|
|
- tableQuery.queryParam.status = true; // 重置为默认启用状态
|
|
|
|
|
- tableQuery.queryParam.ids = [];
|
|
|
|
|
|
|
+const handleReset = () => {
|
|
|
|
|
+ pagination.pageNumber = 1;
|
|
|
|
|
+ Object.assign(tableQuery, {
|
|
|
|
|
+ pageNumber: 1,
|
|
|
|
|
+ pageSize: pagination.pageSize,
|
|
|
|
|
+ queryParam: {
|
|
|
|
|
+ keyword: "",
|
|
|
|
|
+ status: "",
|
|
|
|
|
+ categoryName: "",
|
|
|
|
|
+ startDate: "",
|
|
|
|
|
+ endDate: "",
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+ dateRange.value = null
|
|
|
handleSearch();
|
|
handleSearch();
|
|
|
- };
|
|
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- // 批量导入
|
|
|
|
|
- const batchImportVisible = ref(false);
|
|
|
|
|
- const { urlPrefix } = useGlobSetting();
|
|
|
|
|
- const importApiUrl = ref(urlJoin(urlPrefix, '/inventory/importInventory'));
|
|
|
|
|
- const templateUrl = ref('./skyeye-file-upload/sfysecurity/TEMPLATE/import-inventory-template.xlsx');
|
|
|
|
|
|
|
+// 批量导入
|
|
|
|
|
+const batchImportVisible = ref(false);
|
|
|
|
|
+const { urlPrefix } = useGlobSetting();
|
|
|
|
|
+const importApiUrl = ref(urlJoin(urlPrefix, '/inventory/importInventory'));
|
|
|
|
|
+const templateUrl = ref('./skyeye-file-upload/sfysecurity/TEMPLATE/import-inventory-template.xlsx');
|
|
|
|
|
|
|
|
- const handleImport = () => {
|
|
|
|
|
|
|
+const handleImport = () => {
|
|
|
batchImportVisible.value = true;
|
|
batchImportVisible.value = true;
|
|
|
- };
|
|
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- const handleUpdate = () => {
|
|
|
|
|
|
|
+const handleUpdate = () => {
|
|
|
batchImportVisible.value = false;
|
|
batchImportVisible.value = false;
|
|
|
getTableData();
|
|
getTableData();
|
|
|
- };
|
|
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- const handleDownload = async () => {
|
|
|
|
|
|
|
+const handleDownload = async () => {
|
|
|
try {
|
|
try {
|
|
|
- const exportParams = {
|
|
|
|
|
- stuffName: tableQuery.queryParam.stuffName || undefined,
|
|
|
|
|
- status: tableQuery.queryParam.status,
|
|
|
|
|
- ids: tableQuery.queryParam.ids.length > 0 ? tableQuery.queryParam.ids : undefined,
|
|
|
|
|
- };
|
|
|
|
|
- const response = await exportInventory(exportParams);
|
|
|
|
|
- if (response) {
|
|
|
|
|
- const fileName = `物品库存管理_${new Date().toISOString().split('T')[0]}.xlsx`;
|
|
|
|
|
- downloadByData(response, fileName);
|
|
|
|
|
- ElMessage.success('导出成功');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const exportParams = {
|
|
|
|
|
+ stuffName: tableQuery.queryParam.stuffName || undefined,
|
|
|
|
|
+ status: tableQuery.queryParam.status,
|
|
|
|
|
+ ids: tableQuery.queryParam.ids.length > 0 ? tableQuery.queryParam.ids : undefined,
|
|
|
|
|
+ };
|
|
|
|
|
+ // const response = await exportInventory(exportParams);
|
|
|
|
|
+ // if (response) {
|
|
|
|
|
+ // const fileName = `物品库存管理_${new Date().toISOString().split('T')[0]}.xlsx`;
|
|
|
|
|
+ // downloadByData(response, fileName);
|
|
|
|
|
+ // ElMessage.success('导出成功');
|
|
|
|
|
+ // }
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
- console.error('导出物品库存失败:', e);
|
|
|
|
|
- ElMessage.error('导出失败,请重试');
|
|
|
|
|
|
|
+ console.error('导出物品库存失败:', e);
|
|
|
|
|
+ ElMessage.error('导出失败,请重试');
|
|
|
}
|
|
}
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- const handleCreate = () => {
|
|
|
|
|
|
|
+};
|
|
|
|
|
+/**
|
|
|
|
|
+ * @description: 下发
|
|
|
|
|
+ * @param {*} id
|
|
|
|
|
+ * @return {*}
|
|
|
|
|
+ */
|
|
|
|
|
+const issueWorkPlanDialogVisible = ref<boolean>(false)
|
|
|
|
|
+const issueWorkPlanParams = reactive<any>({})
|
|
|
|
|
+const handleIssue = async (value) => {
|
|
|
|
|
+ issueWorkPlanDialogVisible.value = true
|
|
|
|
|
+ Object.assign(issueWorkPlanParams, value)
|
|
|
|
|
+};
|
|
|
|
|
+// 格式化时间
|
|
|
|
|
+const formatDate = (date) => {
|
|
|
|
|
+ if (!date) return '';
|
|
|
|
|
+ const year = date.getFullYear();
|
|
|
|
|
+ const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
|
|
|
+ const day = String(date.getDate()).padStart(2, '0');
|
|
|
|
|
+ return `${year}-${month}-${day}`; // 输出:2026-02-11
|
|
|
|
|
+}
|
|
|
|
|
+const handleConfirmIssue = async (value) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ await issueEducationAndTrainingProgram({
|
|
|
|
|
+ ...value,
|
|
|
|
|
+ startTime: formatDate(value.startTime),
|
|
|
|
|
+ endTime: formatDate(value.endTime),
|
|
|
|
|
+ });
|
|
|
|
|
+ ElMessage.success('下发成功');
|
|
|
|
|
+ getTableData();
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('下发工作计划失败:', e);
|
|
|
|
|
+ ElMessage.error('下发失败,请重试');
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+const handleCreate = () => {
|
|
|
router.push({
|
|
router.push({
|
|
|
- name: 'educationTrainingPlanManagementItem',
|
|
|
|
|
- query: {
|
|
|
|
|
- operate: 'education-training-plan-management-create',
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ name: 'educationTrainingPlanManagementItem',
|
|
|
|
|
+ query: {
|
|
|
|
|
+ operate: 'education-training-plan-management-create',
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|
|
|
- };
|
|
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- const handleEdit = (id: number) => {
|
|
|
|
|
|
|
+const handleEdit = (id: number) => {
|
|
|
router.push({
|
|
router.push({
|
|
|
- name: 'educationTrainingPlanManagementItem',
|
|
|
|
|
- query: {
|
|
|
|
|
- id,
|
|
|
|
|
- operate: 'education-training-plan-management-edit',
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ name: 'educationTrainingPlanManagementItem',
|
|
|
|
|
+ query: {
|
|
|
|
|
+ id,
|
|
|
|
|
+ operate: 'education-training-plan-management-edit',
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|
|
|
- };
|
|
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- const handleDelete = async (id: number) => {
|
|
|
|
|
|
|
+const handleDelete = async (id: number) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ await deleteEducationAndTrainingProgram(id);
|
|
|
|
|
+ ElMessage.success('删除成功');
|
|
|
|
|
+ getTableData();
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('删除物品库存失败:', e);
|
|
|
|
|
+ ElMessage.error('删除失败,请重试');
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+const handleCancel = async (id: number) => {
|
|
|
try {
|
|
try {
|
|
|
- await deleteInventory(id);
|
|
|
|
|
- ElMessage.success('删除成功');
|
|
|
|
|
- getTableData();
|
|
|
|
|
|
|
+ await cancelEducationAndTrainingProgram({ id });
|
|
|
|
|
+ ElMessage.success('作废成功');
|
|
|
|
|
+ getTableData();
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
- console.error('删除物品库存失败:', e);
|
|
|
|
|
- ElMessage.error('删除失败,请重试');
|
|
|
|
|
|
|
+ console.error('作废失败:', e);
|
|
|
|
|
+ ElMessage.error('作废失败,请重试');
|
|
|
}
|
|
}
|
|
|
- };
|
|
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- const handleView = (id: number) => {
|
|
|
|
|
|
|
+const handleView = (id: number) => {
|
|
|
router.push({
|
|
router.push({
|
|
|
- name: 'educationTrainingPlanManagementItem',
|
|
|
|
|
- query: {
|
|
|
|
|
- id,
|
|
|
|
|
- operate: 'education-training-plan-management-view',
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ name: 'educationTrainingPlanManagementItem',
|
|
|
|
|
+ query: {
|
|
|
|
|
+ id,
|
|
|
|
|
+ operate: 'education-training-plan-management-view',
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|
|
|
- };
|
|
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- onMounted(() => {
|
|
|
|
|
|
|
+onMounted(() => {
|
|
|
getTableData();
|
|
getTableData();
|
|
|
- });
|
|
|
|
|
|
|
+});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
- @use '@/styles/page-details-layout.scss' as *;
|
|
|
|
|
- @use '@/styles/page-main-layout.scss' as *;
|
|
|
|
|
- @use '@/styles/basic-table-action.scss' as *;
|
|
|
|
|
- @use '@/views/traffic/violation/style/act-search-table.scss' as *;
|
|
|
|
|
-</style>
|
|
|
|
|
|
|
+@use '@/styles/page-details-layout.scss' as *;
|
|
|
|
|
+@use '@/styles/page-main-layout.scss' as *;
|
|
|
|
|
+@use '@/styles/basic-table-action.scss' as *;
|
|
|
|
|
+@use '@/views/traffic/violation/style/act-search-table.scss' as *;
|
|
|
|
|
+</style>
|