From 44dae1108f8bc7134fbbc39a09c581bf3c4e0bb2 Mon Sep 17 00:00:00 2001
From: 13937891274 <kxc0822>
Date: Thu, 04 Aug 2022 16:47:42 +0800
Subject: [PATCH] 数据对接
---
src/views/contingencyManagement/emergencyDrill/drillImplementationEvaluation/component/rectificationDialog.vue | 364 +++++++++++++++++++++++++++++++++++++--------------
1 files changed, 263 insertions(+), 101 deletions(-)
diff --git a/src/views/contingencyManagement/emergencyDrill/drillImplementationEvaluation/component/rectificationDialog.vue b/src/views/contingencyManagement/emergencyDrill/drillImplementationEvaluation/component/rectificationDialog.vue
index 706e24d..9ce663a 100644
--- a/src/views/contingencyManagement/emergencyDrill/drillImplementationEvaluation/component/rectificationDialog.vue
+++ b/src/views/contingencyManagement/emergencyDrill/drillImplementationEvaluation/component/rectificationDialog.vue
@@ -1,31 +1,34 @@
<template>
<div class="system-edit-user-container">
<el-dialog
- title="新建待整改"
+ :title="titles"
v-model="isShowDialog"
width="769px"
draggable
+ :fullscreen="full"
>
+ <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button>
<el-form
ref="ruleFormRef"
:model="ruleForm"
size="default"
label-width="120px"
+ :disabled="disabled"
>
<el-row :gutter="35">
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
- <el-form-item label="整改标题" prop="teamName">
- <el-input v-model="ruleForm.teamName" placeholder="请填写队伍名称"></el-input>
+ <el-form-item label="整改标题" prop="emergencyPlanName">
+ <el-input v-model="ruleForm.emergencyPlanName" placeholder="请填写队伍名称"></el-input>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="整改单编号" prop="teamName">
- <el-input v-model="ruleForm.teamName" disabled placeholder="请填写队伍名称"></el-input>
+ <el-input v-model="ruleForm.teamName" placeholder="请填写队伍名称"></el-input>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="整改来源" prop="teamLeader">
- <el-select v-model="ruleForm.teamLevel" class="w100" disabled placeholder="请选择">
+ <el-select v-model="ruleForm.teamLevel" class="w100" placeholder="请选择">
<el-option label="演练评价等" value="admin"></el-option>
<el-option label="现场处置方案" value="common"></el-option>
<el-option label="专项应急预案" value="common"></el-option>
@@ -51,21 +54,21 @@
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="隐患等级" prop="teamLeader">
<el-select v-model="ruleForm.teamLevel" class="w100" placeholder="请选择">
- <el-option label="一般" value="admin"></el-option>
- <el-option label="重大" value="common"></el-option>
+ <el-option label="一般">一般</el-option>
+ <el-option label="重大">重大</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="隐患后果" prop="teamLeader">
<el-select v-model="ruleForm.teamLevel" class="w100" placeholder="请选择">
- <el-option label="死亡" value="admin"></el-option>
- <el-option label="重伤" value="common"></el-option>
- <el-option label="轻伤" value="admin"></el-option>
- <el-option label="火灾" value="common"></el-option>
- <el-option label="交通事故" value="admin"></el-option>
- <el-option label="财产损失" value="common"></el-option>
- <el-option label="其它" value="common"></el-option>
+ <el-option label="死亡">死亡</el-option>
+ <el-option label="重伤">重伤</el-option>
+ <el-option label="轻伤">轻伤</el-option>
+ <el-option label="火灾">火灾</el-option>
+ <el-option label="交通事故">交通事故</el-option>
+ <el-option label="财产损失">财产损失</el-option>
+ <el-option label="其它">其它</el-option>
</el-select>
</el-form-item>
</el-col>
@@ -88,7 +91,6 @@
v-model="ruleForm.teamLeader"
placeholder="请选择"
class="input-with-select"
- disabled
>
<template #append>
<el-button :icon="Search" @click="regionsDialog"/>
@@ -96,20 +98,20 @@
</el-input>
</el-form-item>
</el-col>
- <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
- <el-form-item label="隐患照片" prop="telephone">
- <el-upload
- class="avatar-uploader"
- action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
- :show-file-list="false"
- :on-success="handleAvatarSuccess"
- :before-upload="beforeAvatarUpload"
- >
- <img v-if="imageUrl" :src="imageUrl" class="avatar" />
- <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
- </el-upload>
- </el-form-item>
- </el-col>
+<!-- <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">-->
+<!-- <el-form-item label="隐患照片" prop="telephone">-->
+<!-- <el-upload-->
+<!-- class="avatar-uploader"-->
+<!-- action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"-->
+<!-- :show-file-list="false"-->
+<!-- :on-success="handleAvatarSuccess"-->
+<!-- :before-upload="beforeAvatarUpload"-->
+<!-- >-->
+<!-- <img v-if="imageUrl" :src="imageUrl" class="avatar" />-->
+<!-- <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>-->
+<!-- </el-upload>-->
+<!-- </el-form-item>-->
+<!-- </el-col>-->
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="发现人" prop="telephone" >
<el-input
@@ -180,58 +182,58 @@
placeholder="请选择"/>
</el-form-item>
</el-col>
- <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
- <el-tab-pane label="组织整改" name="first">
- <el-row style="margin: 0">
- <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" style="padding-left: 17.5px;padding-right: 17.5px;">
- <el-form-item label="整改意见" prop="teamLevel">
- <el-input v-model="ruleForm.name" class="textarea" type="textarea" disabled placeholder="请填写整改意见"></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" style="padding-left: 17.5px;padding-right: 17.5px;">
- <el-form-item label="整改期限" prop="telephone">
- <el-date-picker
- v-model="value1"
- class="w100"
- type="datetime"
- placeholder="选择日期时间"
- disabled
- />
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" style="padding-left: 17.5px;padding-right: 17.5px;">
- <el-form-item label="填报人" prop="telephone" >
- <el-input
- v-model="ruleForm.teamLeader"
- placeholder="请选择"
- class="input-with-select"
- disabled
- >
- <template #append>
- <el-button :icon="Search" disabled @click="openUser"/>
- </template>
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" style="padding-left: 17.5px;padding-right: 17.5px;">
- <el-form-item label="填报日期" prop="telephone">
- <el-date-picker
- v-model="value1"
- class="w100"
- type="datetime"
- placeholder="选择日期时间"
- disabled
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-tab-pane>
- </el-tabs>
+ <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
+ <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
+ <el-tab-pane label="组织整改" name="first">
+ <el-row style="margin: 0">
+ <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" style="padding-left: 17.5px;padding-right: 17.5px;">
+ <el-form-item label="整改意见" prop="teamLevel">
+ <el-input v-model="ruleForm.name" class="textarea" type="textarea" placeholder="请填写整改意见"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" style="padding-left: 17.5px;padding-right: 17.5px;">
+ <el-form-item label="整改期限" prop="telephone">
+ <el-date-picker
+ v-model="value1"
+ class="w100"
+ type="datetime"
+ placeholder="选择日期时间"
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" style="padding-left: 17.5px;padding-right: 17.5px;">
+ <el-form-item label="填报人" prop="telephone" >
+ <el-input
+ v-model="ruleForm.teamLeader"
+ placeholder="请选择"
+ class="input-with-select"
+ >
+ <template #append>
+ <el-button :icon="Search" @click="openUser"/>
+ </template>
+ </el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" style="padding-left: 17.5px;padding-right: 17.5px;">
+ <el-form-item label="填报日期" prop="telephone">
+ <el-date-picker
+ v-model="value1"
+ class="w100"
+ type="datetime"
+ placeholder="选择日期时间"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-tab-pane>
+ </el-tabs>
+ </el-col>
</el-row>
</el-form>
<template #footer>
<span class="dialog-footer">
- <el-button @click="onCancel" size="default">关闭</el-button>
+ <el-button @click="resetForm(ruleFormRef)" size="default">关闭</el-button>
+ <el-button size="default" v-if="disabled == true ? false : true" type="primary" @click="submitForm(titles, ruleFormRef)">确定</el-button>
</span>
</template>
</el-dialog>
@@ -258,11 +260,14 @@
} from 'element-plus'
import {
Search,
- Plus
+ Plus,
+ FullScreen
} from '@element-plus/icons-vue'
import UserSelections from "/@/components/userSelections/index.vue"
import CheckTemplate from '/@/components/checkTemplate/index.vue'
import RegionsDialog from '/@/components/regionsDialog/index.vue'
+import {releaseDrillPlanApi} from "/@/api/emergencyDrillPlan";
+import {emergencyDrillEvaluationApi} from "/@/api/emergencyDrillEvaluation";
export default defineComponent({
name: 'rectificationDialog',
@@ -271,22 +276,60 @@
UserSelections,
RegionsDialog,
},
- setup() {
+ setup(props, { emit }) {
const isShowDialog = ref(false)
const ruleFormRef = ref<FormInstance>()
//定义表单
const ruleForm = reactive({
- teamName: '', // 队伍名称
- teamLeader: '', //队伍负责人
- department: [], // 负责人部门
- phone: '', // 负责人手机
- telephone: '', // 固定电话
+ id: '',
+ drillPlanId: '',
+ suitable: '',
+ sufficient: '',
+ arrival: '',
+ supplies: '',
+ protection: '',
+ whole: '',
+ division: '',
+ effect: '',
+ report: '',
+ safety: '',
+ rescue: '',
+ evacuate: '',
+ needModify: '',
+ questionAndImprove: '',
+ modifyContent: '',
+ fileList: [
+ {
+ fileName: 'name',
+ fileUrl: 'url',
+ }
+ ],
+ userList: [
+ {
+ userUid: ''
+ },
+ {
+ userUid: ''
+ }
+ ]
});
+ const titles = ref();
+ const disabled = ref();
// 打开弹窗
- const openDialog = () => {
- // state.ruleForm = row;
+ const openDialog = (title: string, id: number, type: boolean) => {
isShowDialog.value = true;
+ titles.value = title;
+ disabled.value = type;
+ // if (title == '查看演练实施评价' || title == '修改演练实施评价') {
+ // releaseDrillPlanApi()
+ // .seeReleaseDrillPlan(id)
+ // .then((res) => {
+ // if (res.data.code == 200) {
+ // ruleForm.value = res.data.data;
+ // }
+ // });
+ // }
};
// 关闭弹窗
const closeDialog = () => {
@@ -306,11 +349,11 @@
label: 'Level one 1',
children: [
{
- value: '1-1',
+ value: '11',
label: 'Level two 1-1',
children: [
{
- value: '1-1-1',
+ value: '111',
label: 'Level three 1-1-1',
},
],
@@ -322,21 +365,21 @@
label: 'Level one 2',
children: [
{
- value: '2-1',
+ value: '21',
label: 'Level two 2-1',
children: [
{
- value: '2-1-1',
+ value: '211',
label: 'Level three 2-1-1',
},
],
},
{
- value: '2-2',
+ value: '22',
label: 'Level two 2-2',
children: [
{
- value: '2-2-1',
+ value: '221',
label: 'Level three 2-2-1',
},
],
@@ -348,21 +391,21 @@
label: 'Level one 3',
children: [
{
- value: '3-1',
+ value: '31',
label: 'Level two 3-1',
children: [
{
- value: '3-1-1',
+ value: '311',
label: 'Level three 3-1-1',
},
],
},
{
- value: '3-2',
+ value: '32',
label: 'Level two 3-2',
children: [
{
- value: '3-2-1',
+ value: '321',
label: 'Level three 3-2-1',
},
],
@@ -378,7 +421,7 @@
label: '广汇能源综合物流发展有限责任公司',
children: [
{
- value: '1-1',
+ value: '11',
label: '经营班子',
children: [],
},
@@ -389,12 +432,12 @@
label: '生产运行部',
children: [
{
- value: '2-1',
+ value: '21',
label: '灌装一班',
children: []
},
{
- value: '2-2',
+ value: '22',
label: '工艺四班',
children: [],
},
@@ -405,12 +448,12 @@
label: '设备部',
children: [
{
- value: '3-1',
+ value: '31',
label: '仪表班',
children: [],
},
{
- value: '3-2',
+ value: '32',
label: '机修班',
children: [],
},
@@ -463,6 +506,108 @@
// ],
// })
// 应急队伍弹窗
+ // 表单提交验证必填项
+ const submitForm = async (title: string, formEl: FormInstance | undefined) => {
+ if (title == '查看演练实施评价') {
+ if (!formEl) return;
+ await formEl.validate((valid, fields) => {
+ if (valid) {
+ isShowDialog.value = false;
+ emergencyDrillEvaluationApi()
+ .addEmergencyDrillEvaluation(ruleForm.value)
+ .then((res) => {
+ if (res.data.code == 200) {
+ ElMessage({
+ showClose: true,
+ message: res.data.msg,
+ type: 'success',
+ });
+ emit('myAdd', true);
+ } else {
+ ElMessage({
+ showClose: true,
+ message: res.data.msg,
+ type: 'error',
+ });
+ emit('myAdd', true);
+ }
+ formEl.resetFields();
+ });
+ } else {
+ console.log('error submit!', fields);
+ }
+ });
+ }
+ else if (title == '修改演练实施评价') {
+ if (!formEl) return;
+ await formEl.validate((valid, fields) => {
+ if (valid) {
+ isShowDialog.value = false;
+ emergencyDrillEvaluationApi()
+ .editEmergencyDrillEvaluation(ruleForm.value)
+ .then((res) => {
+ if (res.data.code == 200) {
+ ElMessage({
+ showClose: true,
+ message: '修改成功',
+ type: 'success',
+ });
+ emit('myAdd', true);
+ } else {
+ ElMessage({
+ showClose: true,
+ message: res.data.msg,
+ type: 'error',
+ });
+ emit('myAdd', true);
+ }
+ formEl.resetFields();
+ });
+ } else {
+ console.log('error submit!', fields);
+ }
+ });
+ formEl.resetFields();
+ ruleForm.value = {
+ id: '',
+ drillPlanId: '',
+ suitable: '',
+ sufficient: '',
+ arrival: '',
+ supplies: '',
+ protection: '',
+ whole: '',
+ division: '',
+ effect: '',
+ report: '',
+ safety: '',
+ rescue: '',
+ evacuate: '',
+ needModify: '',
+ questionAndImprove: '',
+ modifyContent: '',
+ fileList: [
+ {
+ fileName: 'name',
+ fileUrl: 'url',
+ }
+ ],
+ userList: [
+ {
+ userUid: ''
+ },
+ {
+ userUid: ''
+ }
+ ]
+ };
+ }
+ }
+ const resetForm = (formEl: FormInstance | undefined) => {
+ isShowDialog.value = false;
+ if (!formEl) return;
+ formEl.resetFields();
+ };
const Shows=ref()
const daiInpt=()=>{
Shows.value.openDailog()
@@ -502,6 +647,15 @@
}
return true
}
+ //全屏
+ const full = ref(false);
+ const toggleFullscreen = () => {
+ if (full.value == false) {
+ full.value = true;
+ } else {
+ full.value = false;
+ }
+ };
return {
openDialog,
closeDialog,
@@ -527,6 +681,14 @@
handleAvatarSuccess,
beforeAvatarUpload,
Plus,
+ toggleFullscreen,
+ FullScreen,
+ full,
+ submitForm,
+ emit,
+ titles,
+ disabled,
+ resetForm,
};
},
});
--
Gitblit v1.9.2