瀏覽代碼

fix 办结

wenhongquan 3 年之前
父節點
當前提交
278b969953

+ 9 - 0
src/api/incident.ts

@@ -49,6 +49,12 @@ export const getIncidentList = (params: GetIncidentListParams) =>
     url: '/zhdd/incident/list',
     params: params,
   });
+/** 事件处置办结 */
+  export const putbackLog = (params: IncidentItemDetailProcessItem) =>
+    request<IncidentListResponse>('POST', {
+      url: '/zhdd/cdeiinnt/backLogFinish',
+      params: params,
+    });
 
 export interface IncidentItemDetailProcessItem {
   id?: string;
@@ -57,6 +63,7 @@ export interface IncidentItemDetailProcessItem {
   status?: null;
   createTime?: string;
   createBy?: null;
+  taskId?: string;
 }
 export interface IncidentItemDetailTaskItem {
   id?: string;
@@ -88,6 +95,7 @@ export interface IncidentItemTaskItem {
   delFlag?: string; // 必须
   createTime?: string; // 必须
   createBy?: null; // 必须
+  backLogFlag?:string;
   taskCommandVos: {
     id?: string;
     incidentTaskId?: string;
@@ -161,6 +169,7 @@ export const deleteIncidentTask = (ids: string) =>
 export interface IncidentProcessParam {
   incidentId?: string; // 事件id
   des?: string; // 处置内容
+  taskId?: string;
 }
 
 /** 添加处置过程 */

+ 14 - 0
src/store/useIncidentStore.ts

@@ -1,5 +1,6 @@
 import {
   getIncidentList,
+  putbackLog,
   getIncidentItem,
   GetIncidentListParams,
   IncidentItemDetail,
@@ -38,6 +39,7 @@ export interface IncidentActionsType {
     params: IncidentPlanTaskParam,
   ): Promise<boolean | null | undefined>;
   deleteIncidentTask(id: string): Promise<boolean | null | undefined>;
+  putbackLog(taskid:string):void;
 }
 
 export default defineStore<
@@ -85,6 +87,18 @@ export default defineStore<
         this.toggleLoading();
       }
     },
+    async putbackLog(taskid) {
+      try {
+        this.toggleLoading();
+        await putbackLog({ taskId: taskid });
+        ElMessage.success({ message: '成功' });
+        return true;
+      } catch {
+        ElMessage.fail({ message: '失败!' });
+      } finally {
+        this.toggleLoading();
+      }
+    },
 
     async postIncidentItem(params) {
       try {

+ 24 - 0
src/views/IncidentManagementDetail/index.scss

@@ -1,3 +1,7 @@
+.van-nav-bar--fixed {
+    z-index: 2;
+}
+
 .incident-detail-container {
     position: relative;
     margin-top: 46px;
@@ -10,6 +14,16 @@
         padding: 12px 15px;
         margin-bottom: 10px;
     }
+    .bjbtn {
+        font-size: 14px;
+        font-weight: 500;
+        color: #ffffff;
+        font-size: 13px;
+        font-weight: 500;
+        background: #bb0000;
+        padding: 3px 8px;
+        border-radius: 2px;
+    }
     .icon-i {
         width: 20px;
         height: 20px;
@@ -19,6 +33,9 @@
         background: #F6F7FB;
         border-radius: 8px;
         margin-bottom: 15px;
+        font-size: 16px;
+        color: #0B33A8;
+        padding: 10px;
         .van-cell__title {
             font-size: 16px;
             color: #0B33A8;
@@ -41,6 +58,7 @@
         font-size: 14px;
         font-weight: 400;
         text-align: left;
+        color: #666666;
         .cz-yuan {
             width: 10px;
             height: 10px;
@@ -69,6 +87,12 @@
             padding-bottom: 16px;
         }
     }
+    .active {
+        background-color: #F6F7FB !important;
+        padding: 10px;
+        border-radius: 5px;
+        margin-top: 4px;
+    }
     .van-field {
         background: #ffffff;
         border: 1px solid #dcdfe6;

+ 153 - 41
src/views/IncidentManagementDetail/index.tsx

@@ -1,4 +1,11 @@
-import { ref, defineComponent, onMounted, computed, onUnmounted } from 'vue';
+import {
+  ref,
+  defineComponent,
+  onMounted,
+  computed,
+  onUnmounted,
+  watch,
+} from 'vue';
 import { useRouter, useRoute } from 'vue-router';
 import './index.scss';
 import { useCommonStore, useIncidentStore } from '@/store';
@@ -16,7 +23,9 @@ import {
   Button,
   Loading,
   Toast,
-  Step, Steps 
+  Step,
+  Steps,
+  Dialog,
 } from 'vant';
 /** @ts-ignore */
 import icon_communication from '@/assets/icons/incident/communication@2x.png';
@@ -30,12 +39,7 @@ import icon_plan from '@/assets/icons/incident/plan@2x.png';
 import icon_yjck from '@/assets/icons/incident/yjck@2x.png';
 /** @ts-ignore */
 import icon_yjya from '@/assets/icons/incident/yjya@2x.png';
-
-
-
-
-
-
+import { cloneDeep, take } from 'lodash';
 
 
 
@@ -50,9 +54,17 @@ export default defineComponent({
 
     const commonStore = useCommonStore();
 
-    const activeNames = ref([]);
-    const activeoplanNames = ref([]);
-    const message = ref("");
+    const activeNames = ref([
+      '事件信息',
+      '应急预案',
+      '处置方案',
+      '处置详情',
+      '融合通信',
+    ]);
+    const activeoplanNames = ref([
+      
+    ]);
+    const message = ref('');
     const dosubmitdata = () => { 
       if (!store.incidentDetail.baseInfo?.id || message.value == "") {
         Toast.fail('信息不完整');
@@ -60,6 +72,7 @@ export default defineComponent({
         store.addIncidentProcess({
           incidentId: store.incidentDetail.baseInfo?.id,
           des: message.value,
+          taskId:currenttaskid.value,
         }).then(() => { 
           message.value = "";
             store.getIncidentItem(store.incidentDetail.baseInfo?.id ?? '');
@@ -108,13 +121,65 @@ export default defineComponent({
           )?.desc,
     );
 
+    const currenttaskid = ref('');
+
+    const process = ref([]);
+
+    watch(
+      () => store.incidentDetail.process,
+      () => {
+        var mkdtemp = {};
+        store.incidentDetail.process?.map((i) => {
+          var list = mkdtemp[i.taskId] ?? [];
+          list.push(i);
+          mkdtemp[i.taskId] = list;
+        });
+         console.log(mkdtemp);
+        process.value = [];
+        store.incidentDetail.process?.map((i) => {
+          var list = cloneDeep(mkdtemp[i.taskId] ?? []);
+          if (i.taskId && list.length > 0 && list[0].id === i.id) {
+            list.splice(0, 1);
+            process.value.push({
+              ...i,
+              child: list,
+            });
+          } else {
+            if (!i.taskId) {
+              process.value.push({
+                ...i,
+              });
+            }
+          }
+        });
+
+      },
+    );
+
     onMounted(() => {
       commonStore.getGlobalDict('zhdd_incident_level');
       commonStore.getGlobalDict('zhdd_incident_type');
       commonStore.getGlobalDict('zhdd_incident_source');
 
       route.query.id && store.getIncidentItem(route.query.id as string);
+
+      if (route.query.taskid) { 
+         currenttaskid.value = route.query.taskid as string; 
+      } 
     });
+
+    const getisbj = () => { 
+      if (currenttaskid.value == "")
+        return true;
+      var isok = false;
+      store.incidentDetail.task?.map(ii => {
+        if (ii.id == currenttaskid.value && ii.backLogFlag == "1") {
+          isok = true;
+        }
+      })
+      return isok;
+    }
+
     onUnmounted(() => {
       store.incidentDetail = {};
     });
@@ -125,13 +190,37 @@ export default defineComponent({
           title="应急处置"
           left-arrow
           fixed
-          onClick-left={() => { 
+          onClick-left={() => {
             try {
               uni.navigateBack();
             } catch (E) {}
+            window.history.back();
+          }}
+          onClick-right={() => {
+            if (getisbj()) {
+              return;
+            }
+            Dialog.confirm({
+              title: '提示',
+              confirmButtonText: '办结',
+              message: '点击办结按钮后,将无法继续反馈,请确认好是否完成!',
+            })
+              .then(() => {
+                // on confirm
+                store.putbackLog(currenttaskid.value);
+                try {
+                  uni.navigateBack();
+                } catch (E) {}
+              })
+              .catch(() => {
+                // on cancel
+              });
+          }}
+          v-slots={{
+            right: () => (getisbj() ? '' : <span class={'bjbtn'}>已办结</span>),
           }}
         />
-        <Sticky>
+        <Sticky offsetTop={'46px'}>
           <div class="title">{store.incidentDetail?.baseInfo?.name}</div>
         </Sticky>
         <Collapse v-model={activeNames.value}>
@@ -190,7 +279,8 @@ export default defineComponent({
             <Collapse v-model={activeoplanNames.value}>
               {store.incidentDetail.task?.map((i) => (
                 <div class="cz-item">
-                  <CollapseItem title={i.taskName} name={i.taskName}>
+                  {i.taskName}
+                  {/* <CollapseItem title={i.taskName} name={i.taskName}>
                     <div class="cz-zh">
                       {i.taskPersonVos
                         ?.map((p) => {
@@ -206,7 +296,7 @@ export default defineComponent({
                         </div>
                       ))}
                     </div>
-                  </CollapseItem>
+                  </CollapseItem> */}
                 </div>
               ))}
             </Collapse>
@@ -216,43 +306,65 @@ export default defineComponent({
             name="处置详情"
             v-slots={{ icon: <img class="icon-i" src={icon_detail} /> }}>
             <div>
-              {store.incidentDetail.process?.map((i, index) => (
+              {process.value?.map((i, index) => (
                 <div class="czxq-item">
                   <div class="cz-yuan"></div>
                   <div
                     class="cz-line"
                     style={`display:${
-                      index == (store.incidentDetail.process?.length ?? 0) - 1
+                      index == (process.value?.length ?? 0) - 1
                         ? 'none'
                         : 'block'
                     }`}></div>
                   <div class="cz-time"> {i.createTime}</div>
-                  <div class="cz-des"> {i.des}</div>
+                  <div class="cz-des">
+                    {' '}
+                    {i.des}
+                    <div
+                      class={i.taskId == currenttaskid.value ? 'active' : ''}>
+                      {(i.child ?? [])?.map((ii, index) => (
+                        <div class="czxq-item">
+                          <div class="cz-yuan"></div>
+                          <div
+                            class="cz-line"
+                            style={`display:${
+                              index == ((i.child ?? [])?.length ?? 0) - 1
+                                ? 'none'
+                                : 'block'
+                            }`}></div>
+                          <div class="cz-time"> {ii.createTime}</div>
+                          <div class="cz-des"> {ii.des}</div>
+                        </div>
+                      ))}
+                    </div>
+                  </div>
                 </div>
               ))}
-              <Field
-                v-model={message.value}
-                autosize
-                type="textarea"
-                placeholder="请输入"
-              />
-              <div class="cz-action">
-                <Button
-                  size="small"
-                  type="primary"
-                  onClick={() => {
-                    dosubmitdata();
-                  }}>
-                  保存
-                </Button>
-                <Button
-                  size="small"
-                  type="default"
-                  onClick={() => {
-                    message.value = '';
-                  }}>
-                  取消
-                </Button>
+              <div style={getisbj() ? 'display:none' : ''}>
+                <Field
+                  v-model={message.value}
+                  autosize
+                  type="textarea"
+                  placeholder="请输入"
+                />
+                <div class="cz-action">
+                  <Button
+                    size="small"
+                    type="primary"
+                    onClick={() => {
+                      dosubmitdata();
+                    }}>
+                    保存
+                  </Button>
+                  <Button
+                    size="small"
+                    type="default"
+                    onClick={() => {
+                      message.value = '';
+                    }}>
+                    取消
+                  </Button>
+                </div>
               </div>
             </div>
           </CollapseItem>