|
@@ -1,71 +1,63 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <div v-show="!viewState.show" class="app-container">
|
|
|
- <div>
|
|
|
- <!-- 表格组件 -->
|
|
|
- <el-table ref="multipleTable" v-loading="loading" :data="tableData" style="width: 100%" :max-height="400">
|
|
|
- <el-table-column label="序号" align="center" width="55" fixed="left">
|
|
|
- <template #default="scope">
|
|
|
- {{ (queryParams.page - 1) * queryParams.pageSize + scope.$index + 1 }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="姓名" align="center" prop="name" width="100" fixed="left" />
|
|
|
- <el-table-column label="所属区县" align="center" prop="county" />
|
|
|
- <el-table-column label="专家类型" align="center" prop="expert_type" />
|
|
|
- <el-table-column label="职位" align="center" prop="position" />
|
|
|
- <el-table-column label="单位" align="center" prop="unit" />
|
|
|
- <el-table-column label="联系电话" align="center" prop="phone" />
|
|
|
- <el-table-column label="现在地址" align="center" prop="address" />
|
|
|
- <el-table-column label="状态" align="center" prop="status" />
|
|
|
- <el-table-column label="擅长事故类型" align="center" prop="accident_type" />
|
|
|
- <el-table-column label="救援经历" align="center" prop="rescue_experience" />
|
|
|
- <el-table-column label="出生日期" align="center" prop="birthdate" />
|
|
|
- <el-table-column label="工作日期" align="center" prop="work_date" />
|
|
|
- <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>
|
|
|
- <el-text class="common-btn-text-primary" @click="handleUpdate(scope.row)">修改</el-text>
|
|
|
- <el-text class="common-btn-text-primary" @click="handlePhone(scope.row)">连线</el-text>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <pagination v-show="total > 0" v-model:page="queryParams.page" v-model:limit="queryParams.pageSize" :total="total" @pagination="tableData" />
|
|
|
- </div>
|
|
|
+ <div class="app-container">
|
|
|
+ <div v-show="!materialsDeclarationViewState.show && !materialsDeclarationEidtState.show">
|
|
|
+ <h1>物资储备管理</h1>
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="primary" icon="Plus" @click="handleAdd">新增采购</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <h3>申报列表</h3>
|
|
|
+ <!-- 表格组件 -->
|
|
|
+ <el-table ref="multipleTable" v-loading="loading" :data="tableData" style="width: 100%" :max-height="400">
|
|
|
+ <el-table-column label="序号" align="center" width="55" fixed="left">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ (queryParams.page - 1) * queryParams.pageSize + scope.$index + 1 }}
|
|
|
+ </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" 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>
|
|
|
+ <el-text v-if="scope.row.approval_status === '未审批'" class="common-btn-text-primary" @click="handleUpdate(scope.row)">编辑</el-text>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <pagination v-show="total > 0" v-model:page="queryParams.page" v-model:limit="queryParams.pageSize" :total="total" @pagination="fetchWorkrData" />
|
|
|
</div>
|
|
|
- <View v-if="viewState.show" :event-id="viewState.eventId" @close="handleCancel" />
|
|
|
- <Edit v-if="editState.show" :event-id="editState.eventId" @close="handleCancel" />
|
|
|
</div>
|
|
|
+ <MaterialsDeclarationView v-if="materialsDeclarationViewState.show" :event-id="materialsDeclarationViewState.eventId" @close="handleCancel" />
|
|
|
+ <MaterialsDeclarationEidt v-if="materialsDeclarationEidtState.show" :event-id="materialsDeclarationEidtState.eventId" @close="handleCancel" />
|
|
|
</template>
|
|
|
+
|
|
|
<script setup lang="ts">
|
|
|
import { onMounted, reactive, ref, toRefs } from 'vue';
|
|
|
import { ElTable, ElTableColumn, ElForm, ElFormItem, ElInput, ElButton, ElText } from 'element-plus';
|
|
|
import { ComponentInternalInstance, getCurrentInstance } from 'vue';
|
|
|
-import View from './view.vue';
|
|
|
-import Edit from './edit.vue';
|
|
|
+import Pagination from '@/components/Pagination/index.vue'; // 假设这是分页组件的路径
|
|
|
+import MaterialsDeclarationView from './materialsDeclarationView.vue'; // 查看详情组件
|
|
|
+import MaterialsDeclarationEidt from './materialsDeclarationEidt.vue'; // 编辑组件
|
|
|
const loading = ref(true);
|
|
|
const showSearch = ref(true);
|
|
|
const multiple = ref(true);
|
|
|
const ids = ref<Array<number | string>>([]);
|
|
|
const single = ref(true);
|
|
|
const total = ref(0);
|
|
|
-const tableData = ref<PatrolVO[]>([]);
|
|
|
-const selectedRow = ref<PatrolVO | null>(null);
|
|
|
+const tableData = ref<any[]>([]);
|
|
|
+const selectedRow = ref<any | null>(null);
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
|
const initFormData = reactive({
|
|
|
- name: '',
|
|
|
- county: '',
|
|
|
- expert_type: '',
|
|
|
- position: '',
|
|
|
- unit: '',
|
|
|
- phone: '',
|
|
|
- address: '',
|
|
|
- status: '',
|
|
|
- accident_type: '',
|
|
|
- rescue_experience: '',
|
|
|
- birthdate: '',
|
|
|
- work_date: ''
|
|
|
+ declaration_date: '',
|
|
|
+ amount_declared: '',
|
|
|
+ application_unit: '',
|
|
|
+ declarant: '',
|
|
|
+ approval_status: ''
|
|
|
});
|
|
|
|
|
|
const data = reactive({
|
|
@@ -77,43 +69,35 @@ 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: '张三',
|
|
|
+ approval_status: '未审批'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 2,
|
|
|
+ declaration_date: '2024-10-30 12:23:00',
|
|
|
+ amount_declared: 1001,
|
|
|
+ application_unit: '茂名市应急管理局',
|
|
|
+ declarant: '李四',
|
|
|
+ approval_status: '审批通过'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 3,
|
|
|
+ declaration_date: '2024-10-31 12:23:00',
|
|
|
+ amount_declared: 1002,
|
|
|
+ application_unit: '茂名市应急管理局',
|
|
|
+ declarant: '王五',
|
|
|
+ approval_status: '审批不通过'
|
|
|
+ }
|
|
|
+];
|
|
|
|
|
|
const fetchWorkrData = () => {
|
|
|
loading.value = true;
|
|
|
- const mockData = [
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- name: '张三',
|
|
|
- county: '海淀区',
|
|
|
- expert_type: '技术专家',
|
|
|
- position: '工程师',
|
|
|
- unit: '某科技公司',
|
|
|
- phone: '13800000000',
|
|
|
- address: '北京市海淀区XX路XX号',
|
|
|
- status: '在线',
|
|
|
- accident_type: '网络故障',
|
|
|
- rescue_experience: '5年以上',
|
|
|
- birthdate: '1990-01-01',
|
|
|
- work_date: '2015-01-01'
|
|
|
- },
|
|
|
- {
|
|
|
- id: 2,
|
|
|
- name: '李四',
|
|
|
- county: '朝阳区',
|
|
|
- expert_type: '安全专家',
|
|
|
- position: '高级安全顾问',
|
|
|
- unit: '某安全咨询公司',
|
|
|
- phone: '13800000001',
|
|
|
- address: '北京市朝阳区XX路XX号',
|
|
|
- status: '离线',
|
|
|
- accident_type: '安全事故',
|
|
|
- rescue_experience: '10年以上',
|
|
|
- birthdate: '1985-01-01',
|
|
|
- work_date: '2010-01-01'
|
|
|
- }
|
|
|
- ];
|
|
|
-
|
|
|
tableData.value = mockData;
|
|
|
total.value = mockData.length;
|
|
|
|
|
@@ -129,30 +113,37 @@ const resetQuery = () => {
|
|
|
queryParams.value = { page: 1, pageSize: 10 };
|
|
|
handleQuery();
|
|
|
};
|
|
|
-let viewState = reactive({
|
|
|
+
|
|
|
+let materialsDeclarationViewState = reactive({
|
|
|
show: false,
|
|
|
eventId: ''
|
|
|
});
|
|
|
-let editState = reactive({
|
|
|
+
|
|
|
+let materialsDeclarationEidtState = reactive({
|
|
|
show: false,
|
|
|
eventId: ''
|
|
|
});
|
|
|
-const handleView = () => {
|
|
|
- // viewState.eventId = row.id;
|
|
|
- viewState.show = true;
|
|
|
+
|
|
|
+const handleView = (row: any) => {
|
|
|
+ materialsDeclarationViewState.eventId = row.id;
|
|
|
+ materialsDeclarationViewState.show = true;
|
|
|
};
|
|
|
-const handleUpdate = () => {
|
|
|
- // editState.eventId = row.id;
|
|
|
- editState.show = true;
|
|
|
+
|
|
|
+const handleUpdate = (row: any) => {
|
|
|
+ materialsDeclarationEidtState.eventId = row.id;
|
|
|
+ materialsDeclarationEidtState.show = true;
|
|
|
};
|
|
|
+
|
|
|
const handleCancel = () => {
|
|
|
- viewState.show = false;
|
|
|
- editState.show = false;
|
|
|
+ materialsDeclarationViewState.show = false;
|
|
|
+ materialsDeclarationEidtState.show = false;
|
|
|
};
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
fetchWorkrData();
|
|
|
});
|
|
|
</script>
|
|
|
+
|
|
|
<style scoped>
|
|
|
.app-container {
|
|
|
overflow-x: auto; /* 当内容溢出时允许水平滚动 */
|