浏览代码

预案管理

zhangyihao 1 年之前
父节点
当前提交
c16616a00a

+ 0 - 10
src/views/riskPrevention/planManage/drill.vue

@@ -188,16 +188,6 @@ const cancel = () => {
   reset();
 };
 
-/** 删除预案按钮操作 */
-const drillDelete = async (row?: DrillVO) => {
-  const drillIds = row?.drillId || ids.value;
-  const [err] = await to(proxy?.$modal.confirm('是否确认删除记录编号为"' + drillIds + '"的数据项?') as any);
-  if (!err) {
-    await api.delDrill(drillIds);
-    await getList();
-    proxy?.$modal.msgSuccess('删除成功');
-  }
-};
 /**
  * 关闭用户弹窗
  */

+ 11 - 24
src/views/riskPrevention/planManage/index.vue

@@ -20,8 +20,7 @@
             <el-button v-has-permi="['system:plan:delete']" type="danger" plain icon="Delete" @click="planDelete()"> 删除预案 </el-button>
           </el-col>
         </el-row>
-        <plan v-model="dialog0.visible" title="新建预案" />
-        <plan v-model="dialog1.visible" title="编辑预案" />
+        <plan :id="dialog0.id" v-model="dialog0.visible" />
         <div class="line" style="background: #e7e7e7; width: auto; height: 0.6px; position: relative"></div>
         <h3>基础信息</h3>
         <div style="white-space: nowrap">
@@ -184,7 +183,7 @@
             </el-row>
             <drill :id="dialog3.id" v-model="dialog3.visible" @getlist="getDrillList" />
           </template>
-          <el-table v-loading="loading" :data="drillList" @selection-change="handleSelectionChangePlan">
+          <el-table v-loading="loading" :data="drillList" @selection-change="handleSelectionChangeDrill">
             <el-table-column type="selection" width="50" align="center" />
             <el-table-column v-if="columns0[0].visible" key="drillId" label="演练编号" align="center" prop="drillId" />
             <el-table-column
@@ -258,7 +257,7 @@
             v-model:page="queryParams.pageNum"
             v-model:limit="queryParams.pageSize"
             :total="total"
-            @pagination="getList"
+            @pagination="getDrillList"
           />
         </el-card>
       </el-col>
@@ -266,7 +265,7 @@
         <!-- 响应记录 -->
         <h3>响应记录</h3>
         <el-card shadow="hover">
-          <el-table v-loading="loading" @selection-change="handleSelectionChange">
+          <el-table v-loading="loading" @selection-change="handleSelectionChangeResponse">
             <el-table-column type="selection" width="50" align="center" />
             <el-table-column v-if="columns1[0].visible" key="eventId" label="事件编号" align="center" prop="eventId" />
             <el-table-column
@@ -325,7 +324,7 @@
             v-model:page="queryParams.pageNum"
             v-model:limit="queryParams.pageSize"
             :total="total"
-            @pagination="getList"
+            @pagination="getListResponse"
           />
         </el-card>
       </el-col>
@@ -647,21 +646,12 @@ const dialog = reactive<DialogOption>({
 });
 const dialog0 = reactive<DialogOption>({
   visible: false,
-  title: ''
-});
-const dialog1 = reactive<DialogOption>({
-  visible: false,
-  title: ''
+  id: ''
 });
 const dialog3 = reactive<DialogOption>({
   visible: false,
   id: ''
 });
-/*查询演练列表*/
-const getDrillList = (row) => {
-  dialog3.visible = true;
-  dialog3.id = row.drillId;
-};
 
 const initFormData: UserForm = {
   textId: undefined,
@@ -785,13 +775,6 @@ const handleSelectionChange = (selection: UserVO[]) => {
   single.value = selection.length != 1;
   multiple.value = !selection.length;
 };
-
-const handleSelectionChangePlan = (selection: PlanVO[]) => {
-  ids.value = selection.map((item) => item.planId);
-  single.value = selection.length != 1;
-  multiple.value = !selection.length;
-};
-
 const handleSelectionChangeDrill = (selection: DrillVO[]) => {
   ids.value = selection.map((item) => item.drillId);
   single.value = selection.length != 1;
@@ -942,7 +925,11 @@ const planDelete = async (row?: PlanVO) => {
     proxy?.$modal.msgSuccess('删除成功');
   }
 };
-
+/** 查询演练列表 */
+const getDrillList = (row) => {
+  dialog3.visible = true;
+  dialog3.id = row.drillId;
+};
 /** 新增演练按钮操作 */
 const drillAdd = () => {
   dialog3.visible = true;

+ 3 - 2
src/views/riskPrevention/planManage/plan.vue

@@ -44,7 +44,7 @@ const planList = ref<PlanVO[]>();
 const loading = ref(true);
 const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const emits = defineEmits(['update:modelValue']);
+const emits = defineEmits(['update:modelValue', 'getList']);
 const total = ref(0);
 import { to } from 'await-to-js';
 
@@ -155,7 +155,7 @@ const resetForm = () => {
   userFormRef.value?.resetFields();
   userFormRef.value?.clearValidate();
 
-  form.value.id = undefined;
+  form.value.planId = undefined;
 };
 
 /**提交按钮 */
@@ -165,6 +165,7 @@ const submitForm = () => {
       form.value.planId ? await api.updatePlan(form.value) : await api.addPlan(form.value);
       proxy?.$modal.msgSuccess('操作成功');
       emits('update:modelValue', true);
+      emits('getList');
     }
   });
 };