From 70475c05f5b952d53d6f5e9a64361615b031bb39 Mon Sep 17 00:00:00 2001 From: 13937891274 <kxc0822> Date: 星期一, 01 八月 2022 15:15:48 +0800 Subject: [PATCH] 数据对接 --- /dev/null | 168 ------------------------------------------ src/views/contingencyManagement/emergencyResources/emergencySupplies/component/maintain.vue | 11 ++ src/views/contingencyManagement/emergencyResources/maintenanceOfEmergencyMaterials/component/openAdd.vue | 10 + src/views/contingencyManagement/emergencyResources/emergencySupplies/component/inspect.vue | 10 + src/components/emergencySupplies/index.vue | 2 src/api/emergencySuppliesInspect/index.ts | 1 src/views/contingencyManagement/emergencyResources/emergencyMaterialsInspection/component/openAdd.vue | 18 ++- 7 files changed, 35 insertions(+), 185 deletions(-) diff --git a/src/api/emergencySuppliesInspect/index.ts b/src/api/emergencySuppliesInspect/index.ts index 76a347d..fbeae9e 100644 --- a/src/api/emergencySuppliesInspect/index.ts +++ b/src/api/emergencySuppliesInspect/index.ts @@ -2,6 +2,7 @@ export function emergencySuppliesInspectApi(){ return{ + // 应急物资检查一览 getEmergencySuppliesInspectList: (params: object) => { return request({ url: '/emergencyTeam/page/list', diff --git a/src/components/emergencySupplies/index.vue b/src/components/emergencySupplies/index.vue index dec3310..de82773 100644 --- a/src/components/emergencySupplies/index.vue +++ b/src/components/emergencySupplies/index.vue @@ -12,7 +12,7 @@ <el-row> <el-form ref="ruleFormRef" :model="ruleForm" :inline="true" status-icon> <el-form-item> - <el-input size="default" v-model="listQuery.searchParams.name" placeholder="物资名称" style="max-width: 215px;"/> + <el-input size="default" v-model="listQuery.searchParams.name" placeholder="物资名称" style="max-width: 215px;margin-right: 12px;"/> </el-form-item> <el-form-item> <el-button size="default" type="primary" @click="onSubmit">查询</el-button> diff --git a/src/components/material/index.vue b/src/components/material/index.vue deleted file mode 100644 index e6db32e..0000000 --- a/src/components/material/index.vue +++ /dev/null @@ -1,168 +0,0 @@ -<template> - <el-dialog - v-model="dialogVisible" - title="选择应急物资" - width="900px" - draggable - :fullscreen="full" - > - <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> - <el-row> - <el-col :span="18"> - <el-row> - <el-form ref="ruleFormRef" :model="ruleForm" :inline="true" status-icon> - <el-form-item> - <el-input size="default" v-model="ruleForm.pass" placeholder="物资名称" style="max-width: 215px;"/> - </el-form-item> - <el-form-item> - <el-button size="default" type="primary" @click="submitForm(ruleFormRef)">查询</el-button> - <el-button size="default" @click="resetForm(ruleFormRef)">重置</el-button> - <el-button size="default" :icon="Delete">清除选择</el-button> - </el-form-item> - </el-form> - </el-row> - <el-table :data="tableData" style="width: 100%;margin-top:20px"> - <el-table-column type="selection" width="55" /> - <el-table-column align="center" prop="name" label="物资名称"/> - </el-table> - <div class="pages"> - <el-pagination - v-model:currentPage="currentPage4" - v-model:page-size="pageSize4" - :page-sizes="[100, 200, 300, 400]" - :small="small" - :disabled="disabled" - :background="background" - layout="total, sizes, prev, pager, next, jumper" - :total="400" - @size-change="handleSizeChange" - @current-change="handleCurrentChange" - /> - </div> - </el-col> - <el-col :span="6"> - <el-tag v-for="tag in dynamicTags" :key="tag" class="mx-1" style="margin:5px" closable :disable-transitions="false" @close="handleClose(tag)"> - {{ tag }} - </el-tag> - </el-col> - </el-row> - <template #footer> - <span class="dialog-footer"> - <el-button @click="dialogVisible = false" size="default">关闭</el-button> - <el-button type="primary" @click="dialogVisible = false" size="default">确定</el-button> - </span> - </template> - </el-dialog> -</template> -<script lang="ts"> -import { - defineComponent, - reactive, - ref -} from 'vue'; -import { - Delete, - FullScreen -} from '@element-plus/icons-vue'; -export default defineComponent({ - setup() { - const dialogVisible = ref<boolean>(false); - const openDailog = () => { - dialogVisible.value = true; - }; - // 搜索条件 - const ruleForm = reactive({ - pass: '', - }); - // 表格 - const tableData = [ - { - name: '应急救援组', - }, - { - name: '工艺抢险组', - }, - { - name: '后勤保障组', - }, - { - name: '应急救援组', - }, - ]; - const pageSize4 = ref(100); - const handleSizeChange = (val: number) => { - console.log(`${val} items per page`); - }; - const handleCurrentChange = (val: number) => { - console.log(`current page: ${val}`); - }; - // 右方点击添加后显示标签 - const dynamicTags = ref(['应急救援组', '工艺抢险组', '后勤保障组']); - const handleClose = (tag: string) => { - dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1); - }; - //全屏 - const full = ref(false); - const toggleFullscreen = () => { - if (full.value == false) { - full.value = true; - } else { - full.value = false; - } - }; - return { - dialogVisible, - openDailog, - ruleForm, - tableData, - pageSize4, - handleSizeChange, - handleCurrentChange, - dynamicTags, - handleClose, - Delete, - toggleFullscreen, - FullScreen, - full, - }; - }, -}); -</script> -<style scoped> -.el-form--inline .el-form-item{ - margin-bottom: 0; - margin-right: 0; -} -/*分页*/ -.pages{ - margin-top: 15px; -} -::v-deep .el-pagination .el-pager li { - margin: 0 5px; - background-color: #f4f4f5; - color: #606266; - min-width: 30px; - border-radius: 2px; -} -::v-deep .el-pagination .el-pager li.is-active { - background-color: #409eff; - color: #fff; -} -::v-deep .el-pagination .btn-prev { - margin: 0 5px; - background-color: #f4f4f5; - color: #606266; - min-width: 30px; - border-radius: 2px; -} -::v-deep .el-pagination button:disabled{ - color: #c0c4cc; -} -::v-deep .el-pagination .btn-next{ - margin: 0 5px; - background-color: #f4f4f5; - color: #606266; - min-width: 30px; - border-radius: 2px; -} -</style> diff --git a/src/views/contingencyManagement/emergencyResources/emergencyMaterialsInspection/component/openAdd.vue b/src/views/contingencyManagement/emergencyResources/emergencyMaterialsInspection/component/openAdd.vue index 1e2b0c7..fb47da5 100644 --- a/src/views/contingencyManagement/emergencyResources/emergencyMaterialsInspection/component/openAdd.vue +++ b/src/views/contingencyManagement/emergencyResources/emergencyMaterialsInspection/component/openAdd.vue @@ -70,7 +70,7 @@ </span> </template> </el-dialog> - <Material ref="showRef"/> + <EmergencySupplies ref="showRef" @SearchUser="onUser"/> <userSelections ref="userRef"/> </div> </template> @@ -90,7 +90,7 @@ Search, FullScreen, } from '@element-plus/icons-vue' -import Material from '/@/components/material/index.vue' +import EmergencySupplies from '/@/components/emergencySupplies/index.vue' import UserSelections from "/@/components/userSelections/index.vue" import {emergencyMaterialsInspectionApi} from "/@/api/emergencyMaterialsInspection"; import {maintenanceEmergencyMaterialsApi} from "/@/api/maintenanceEmergencyMaterials"; @@ -99,7 +99,7 @@ name: 'openAdd', components: { UserSelections, - Material, + EmergencySupplies, }, setup(props, { emit }) { const isShowDialog = ref(false) @@ -145,8 +145,8 @@ await formEl.validate((valid, fields) => { if (valid) { isShowDialog.value = false; - maintenanceEmergencyMaterialsApi() - .addMaintenanceEmergencyMaterials(ruleForm.value) + emergencyMaterialsInspectionApi() + .addEmergencyMaterialsInspection(ruleForm.value) .then((res) => { if (res.data.code == 200) { ElMessage({ @@ -175,8 +175,8 @@ await formEl.validate((valid, fields) => { if (valid) { isShowDialog.value = false; - maintenanceEmergencyMaterialsApi() - .editMaintenanceEmergencyMaterials(ruleForm.value) + emergencyMaterialsInspectionApi() + .editEmergencyMaterialsInspection(ruleForm.value) .then((res) => { if (res.data.code == 200) { ElMessage({ @@ -225,6 +225,9 @@ const daiInpt=()=>{ showRef.value.openDailog() } + const onUser = (e:any) => { + ruleForm.value.suppliesId=e.id + }; // 编写人弹窗 const userRef = ref(); const openUser = () => { @@ -258,6 +261,7 @@ titles, disabled, emit, + onUser, }; }, }); diff --git a/src/views/contingencyManagement/emergencyResources/emergencySupplies/component/inspect.vue b/src/views/contingencyManagement/emergencyResources/emergencySupplies/component/inspect.vue index 9fc029e..0626ae8 100644 --- a/src/views/contingencyManagement/emergencyResources/emergencySupplies/component/inspect.vue +++ b/src/views/contingencyManagement/emergencyResources/emergencySupplies/component/inspect.vue @@ -69,7 +69,7 @@ </span> </template> </el-dialog> - <Material ref="showRef"/> + <EmergencySupplies ref="showRef" @SearchUser="onUser"/> <userSelections ref="userRef"/> </div> </template> @@ -88,7 +88,7 @@ Search, FullScreen } from '@element-plus/icons-vue' -import Material from '/@/components/material/index.vue' +import EmergencySupplies from '/@/components/emergencySupplies/index.vue' import UserSelections from "/@/components/userSelections/index.vue" import {emergencyMaterialsInspectionApi} from "/@/api/emergencyMaterialsInspection"; @@ -96,7 +96,7 @@ name: 'inspect', components: { UserSelections, - Material, + EmergencySupplies, }, setup(props, { emit }) { const isShowDialog = ref(false) @@ -170,6 +170,9 @@ const daiInpt=()=>{ showRef.value.openDailog() } + const onUser = (e:any) => { + ruleForm.value.suppliesId=e.id + }; // 编写人弹窗 const userRef = ref(); const openUser = () => { @@ -193,6 +196,7 @@ value1, daiInpt, showRef, + onUser, ruleFormRef, submitForm, openUser, diff --git a/src/views/contingencyManagement/emergencyResources/emergencySupplies/component/maintain.vue b/src/views/contingencyManagement/emergencyResources/emergencySupplies/component/maintain.vue index 87c4f8f..c29f48e 100644 --- a/src/views/contingencyManagement/emergencyResources/emergencySupplies/component/maintain.vue +++ b/src/views/contingencyManagement/emergencyResources/emergencySupplies/component/maintain.vue @@ -69,7 +69,7 @@ </span> </template> </el-dialog> - <Material ref="showRef"/> + <EmergencySupplies ref="showRef" @SearchUser="onUser"/> <userSelections ref="userRef"/> </div> </template> @@ -88,7 +88,7 @@ Search, FullScreen } from '@element-plus/icons-vue' -import Material from '/@/components/material/index.vue' +import EmergencySupplies from '/@/components/emergencySupplies/index.vue' import UserSelections from "/@/components/userSelections/index.vue" import {maintenanceEmergencyMaterialsApi} from "/@/api/maintenanceEmergencyMaterials"; @@ -96,7 +96,7 @@ name: 'maintain', components: { UserSelections, - Material, + EmergencySupplies, }, setup(props, { emit }) { const isShowDialog = ref(false) @@ -170,6 +170,10 @@ const daiInpt=()=>{ showRef.value.openDailog() } + const onUser = (e:any) => { + ruleForm.value.suppliesId=e.id + }; + // 编写人弹窗 const userRef = ref(); const openUser = () => { @@ -194,6 +198,7 @@ daiInpt, showRef, ruleFormRef, + onUser, submitForm, openUser, userRef, diff --git a/src/views/contingencyManagement/emergencyResources/maintenanceOfEmergencyMaterials/component/openAdd.vue b/src/views/contingencyManagement/emergencyResources/maintenanceOfEmergencyMaterials/component/openAdd.vue index b18de09..20b8938 100644 --- a/src/views/contingencyManagement/emergencyResources/maintenanceOfEmergencyMaterials/component/openAdd.vue +++ b/src/views/contingencyManagement/emergencyResources/maintenanceOfEmergencyMaterials/component/openAdd.vue @@ -70,7 +70,7 @@ </span> </template> </el-dialog> - <Material ref="showRef"/> + <EmergencySupplies ref="showRef" @SearchUser="onUser"/> <userSelections ref="userRef"/> </div> </template> @@ -90,7 +90,7 @@ Search, FullScreen } from '@element-plus/icons-vue' -import Material from '/@/components/material/index.vue' +import EmergencySupplies from '/@/components/emergencySupplies/index.vue' import UserSelections from "/@/components/userSelections/index.vue" import {maintenanceEmergencyMaterialsApi} from "/@/api/maintenanceEmergencyMaterials"; @@ -98,7 +98,7 @@ name: 'openAdd', components: { UserSelections, - Material, + EmergencySupplies, }, setup(props, { emit }) { const isShowDialog = ref(false) @@ -224,6 +224,9 @@ const daiInpt=()=>{ showRef.value.openDailog() } + const onUser = (e:any) => { + ruleForm.value.suppliesId=e.id + }; // 编写人弹窗 const userRef = ref(); const openUser = () => { @@ -245,6 +248,7 @@ ruleForm, maintainTime, daiInpt, + onUser, showRef, ruleFormRef, submitForm, -- Gitblit v1.9.2