|
@@ -16,10 +16,14 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="申报日期" align="center" prop="declaration_date" />
|
|
|
- <el-table-column label="申报金额(元)" align="center" prop="amount_declared" />
|
|
|
- <el-table-column label="申报单位" align="center" prop="application_unit" />
|
|
|
- <el-table-column label="申报人" align="center" prop="declarant" />
|
|
|
- <el-table-column label="审批情况" align="center" prop="approval_status" />
|
|
|
+ <el-table-column label="申报金额(元)" align="center" prop="declaration_amount" />
|
|
|
+ <el-table-column label="申报单位" align="center" prop="declaration_unit_name" />
|
|
|
+ <el-table-column label="申报人" align="center" prop="declaration_person_name" />
|
|
|
+ <el-table-column label="审批情况" align="center" prop="declaration_details">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ getApprovalStatusText(scope.row.declaration_details) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="200">
|
|
|
<template #default="scope">
|
|
|
<el-text class="common-btn-text-primary" @click="handleView(scope.row)">详情</el-text>
|
|
@@ -45,10 +49,11 @@
|
|
|
import { onMounted, reactive, ref, toRefs } from 'vue';
|
|
|
import { ElTable, ElTableColumn, ElForm, ElFormItem, ElInput, ElButton, ElText } from 'element-plus';
|
|
|
import { ComponentInternalInstance, getCurrentInstance } from 'vue';
|
|
|
+import { getDeclarationList } from '@/api/comprehensiveGuarantee/MaterialReserveManagement/materialsDeclaration';
|
|
|
import Pagination from '@/components/Pagination/index.vue'; // 假设这是分页组件的路径
|
|
|
import MaterialsDeclarationView from './materialsDeclarationView.vue'; // 查看详情组件
|
|
|
import MaterialsDistributionEdit from './materialsDistributionEdit.vue'; // 编辑组件
|
|
|
-import MaterialsDeclarationAdd from './materialsDeclarationAdd.vue'; // 编辑组件
|
|
|
+import MaterialsDeclarationAdd from './materialsDeclarationAdd.vue';
|
|
|
const loading = ref(true);
|
|
|
const showSearch = ref(true);
|
|
|
const multiple = ref(true);
|
|
@@ -62,10 +67,10 @@ const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
|
const initFormData = reactive({
|
|
|
declaration_date: '',
|
|
|
- amount_declared: '',
|
|
|
- application_unit: '',
|
|
|
- declarant: '',
|
|
|
- approval_status: ''
|
|
|
+ declaration_amount: '',
|
|
|
+ declaration_unit_name: '',
|
|
|
+ declaration_person_name: '',
|
|
|
+ declaration_details: ''
|
|
|
});
|
|
|
|
|
|
const data = reactive({
|
|
@@ -77,39 +82,17 @@ const data = reactive({
|
|
|
});
|
|
|
|
|
|
const { queryParams, form } = toRefs(data);
|
|
|
-const mockData = [
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- declaration_date: '2024-10-29 12:23:00',
|
|
|
- amount_declared: 1000,
|
|
|
- application_unit: '茂名市应急管理局',
|
|
|
- declarant: 'XX',
|
|
|
- approval_status: '未审批'
|
|
|
- },
|
|
|
- {
|
|
|
- id: 2,
|
|
|
- declaration_date: '2024-10-30 12:23:00',
|
|
|
- amount_declared: 1001,
|
|
|
- application_unit: '茂名市应急管理局',
|
|
|
- declarant: 'XX',
|
|
|
- approval_status: '审批通过'
|
|
|
- },
|
|
|
- {
|
|
|
- id: 3,
|
|
|
- declaration_date: '2024-10-31 12:23:00',
|
|
|
- amount_declared: 1002,
|
|
|
- application_unit: '茂名市应急管理局',
|
|
|
- declarant: 'XX',
|
|
|
- approval_status: '审批不通过'
|
|
|
- }
|
|
|
-];
|
|
|
-
|
|
|
+// 获取物资申报列表
|
|
|
const fetchWorkrData = () => {
|
|
|
loading.value = true;
|
|
|
- tableData.value = mockData;
|
|
|
- total.value = mockData.length;
|
|
|
-
|
|
|
- loading.value = false;
|
|
|
+ getDeclarationList(queryParams.value)
|
|
|
+ .then((res) => {
|
|
|
+ tableData.value = res.data;
|
|
|
+ total.value = res.total;
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ loading.value = false;
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const handleQuery = () => {
|
|
@@ -154,7 +137,17 @@ const handleCancel = () => {
|
|
|
materialsDistributionEditState.show = false;
|
|
|
materialsDeclarationAddState.show = false;
|
|
|
};
|
|
|
+// 定义审批状态映射
|
|
|
+const approvalStatusMap = {
|
|
|
+ '1': '未审核',
|
|
|
+ '2': '通过',
|
|
|
+ '3': '不通过'
|
|
|
+};
|
|
|
|
|
|
+// 方法用于将数字转换为对应的审批状态文本
|
|
|
+const getApprovalStatusText = (status: string) => {
|
|
|
+ return approvalStatusMap[status] || '未知';
|
|
|
+};
|
|
|
onMounted(() => {
|
|
|
fetchWorkrData();
|
|
|
});
|