|
@@ -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>
|