Files
sgxt_web/src/views/backOfficeSystem/JudgmentHome/strategicResearch/index.vue
2025-12-19 14:11:16 +08:00

242 lines
7.1 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div>
<div class="titleBox">
<PageTitle title="战略研判">
<el-button type="primary" @click="selfCreateResearch('add')">
<el-icon style="vertical-align: middle">
<CirclePlus />
</el-icon>
<span style="vertical-align: middle">自建研判</span>
</el-button>
</PageTitle>
</div>
<!-- 搜索 -->
<div ref="searchBox">
<Search :searchArr="searchConfiger" @submit="onSearch" :key="pageData.keyCount" />
</div>
<!-- 表格 -->
<div class="tabBox">
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth">
<template #bglx="{ row }">
<DictTag :tag="false" :value="row.bglx" :options="D_BZ_YPLX" />
</template>
<template #ypfs="{ row }">
<DictTag :tag="false" :value="row.ypfs" :options="D_BZ_YPFS" />
</template>
<!-- 操作 -->
<template #controls="{ row }">
<!-- <el-link size="small" type="primary" @click="getDataById('edit', row)">修改</el-link> -->
<el-link size="small" type="primary" @click="getDataById('detail', row)">详情</el-link>
<el-link size="small" type="primary" @click="createReport(row)">{{ row.ypbg?.id ? '编辑' : '创建' }}报告</el-link>
<el-link size="small" type="success" @click="createMeeting(row)">创建会议</el-link>
<el-link size="small" type="danger" @click="deleteFile(row)">删除</el-link>
</template>
</MyTable>
<Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
...pageData.pageConfiger,
total: pageData.total
}"></Pages>
</div>
</div>
<AddForm ref="addForm" :bglx="bglx" @getList="getList" :dict="{ D_BZ_YPFS, D_BZ_YPLX }" />
<!-- 创建报告 -->
<addReport ref="reportTc" :row="currRow" :dic="{ D_GS_BQ_LX }" @ok="getList" />
<!-- 创建报告 -->
<addMeeting ref="meetingTc" :row="currRow" @updateDate="getList" />
</template>
<script setup>
import PageTitle from "@/components/aboutTable/PageTitle.vue";
import MyTable from "@/components/aboutTable/MyTable.vue";
import Pages from "@/components/aboutTable/Pages.vue";
import Search from "@/components/aboutTable/Search.vue";
import { useRoute, useRouter } from 'vue-router'
import { tacticalGet, strategicDelete } from "@/api/huiShangyp/tacticalApi.js";
import { reactive, ref, onMounted, getCurrentInstance, watch, computed, nextTick } from "vue";
import addReport from "./addReport.vue";
import AddForm from "./addForm.vue";
import addMeeting from "./addMeeting.vue";
const { proxy } = getCurrentInstance();
const { D_BZ_YPFS, D_BZ_YPLX, D_GS_BQ_LX } = proxy.$dict("D_BZ_YPFS", "D_BZ_YPLX", "D_GS_BQ_LX")
/** 报告弹框 */
const reportTc = ref();
/** 会议弹框 */
const meetingTc = ref();
const searchBox = ref(); //搜索框
const router = useRouter();
const route = useRoute();
onMounted(() => {
tabHeightFn()
if (route.query.id) {
nextTick(() => {
addForm.value && addForm.value.init('edit', {
id: route.query.id
});
router.replace({ path: '/tacticalResearch' })// 移除id 避免刷新一直带参数
})
}
getList()
});
/** 是否市情报指挥中心 */
const isShiQingBaoZhongXin = computed(() => {
const Jb = deptLevel[0] == '2' ? '01' : deptLevel[0] == '3' ? '02' : '03'
return deptBizType == '23' && Jb == '01'
})
const searchConfiger = ref([
{ label: "研判议题", prop: 'ypyt', placeholder: "请输入研判议题", showType: "input" },
// { label: "研判方式", prop: 'ypfs', placeholder: "请输入研判方式", showType: "radio",options:D_BZ_YPFS },
]);
const pageData = reactive({
tableData: [],
keyCount: 0,
tableConfiger: {
rowHieght: 61,
showSelectType: "checkBox",
loading: false
},
total: 0,
pageConfiger: {
pageSize: 20,
pageCurrent: 1
},
controlsWidth: 240,
tableColumn: [
{ label: "研判议题", prop: "ypyt" },
{ label: "研判方式", prop: "ypfs", showSolt: true },
{ label: "报告类型", prop: "bglx", showSolt: true },
{ label: "研判时间", prop: "ypsj" },
{ label: "研判要求", prop: "ypyq" },
{ label: "发起部门", prop: "ssbm" },
]
});
const isShowReport = ref(false)
const currRow = ref({})
const queryFrom = ref({});
/** 报告类型 01 战术研判 02 战略研判*/
const bglx = ref('02')
// 搜索
const onSearch = (val) => {
const promes = {
...val,
...pageData.pageConfiger,
}
queryFrom.value = { ...promes }
pageData.pageConfiger.pageCurrent = 1;
getList()
}
const changeNo = (val) => {
pageData.pageConfiger.pageCurrent = val;
getList()
}
const changeSize = (val) => {
pageData.pageConfiger.pageSize = val;
getList()
}
// 获取列表
const getList = () => {
pageData.tableConfiger.loading = true;
// bglx 报告类型01 战术研判 02 战略研判)
let data = { ...pageData.pageConfiger, ...queryFrom.value, bglx: '02' };
tacticalGet(data).then(res => {
pageData.tableData = res.records || [];
pageData.total = res.total;
pageData.tableConfiger.loading = false;
}).catch(() => { pageData.tableConfiger.loading = false; })
}
// 表格高度计算
const tabHeightFn = () => {
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 250;
window.onresize = function() {
tabHeightFn();
};
};
// const route = useRoute()
const addForm = ref(null)
const getDataById = (type, row) => {
addForm.value.init(type, row, '01');
}
const deleteFile = (row) => {
proxy.$confirm('确定删除选中数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
strategicDelete({ ids: [row.id] }).then(res => {
proxy.$message.success('删除成功');
getList();
}).catch(() => {
proxy.$message.error('删除失败');
});
}).catch(() => {
proxy.$message.info('已取消删除');
});
}
const selfCreateResearch = (type = 'add') => {
addForm.value.init(type, null, '01');
}
/** 创建报告 */
const createReport = (row) => {
const type = !row.id ? 'add' : 'edit'
reportTc.value.init(type, row?.ypbg || {}, row)
// currRow.value = { ...row }
// isShowReport.value = true
}
/** 创建会议 */
const createMeeting = (row) => {
meetingTc.value.init('add', null, row)
// currRow.value = { ...row }
// isShowReport.value = true
}
</script>
<style lang="scss" scoped>
.label-pop {
position: relative;
&::before {
position: absolute;
content: '*';
top: 0;
left: -7px;
color: red;
}
}
</style>
<style>
.el-loading-mask {
background: rgba(0, 0, 0, 0.5) !important;
}
:v-deep .el-dialog {
width: 90% !important;
}
.zdy-model-dialogs {
/* background-color: rgb(50, 148, 214); */
background: url("~@/assets/images/bg46.png") no-repeat center center;
background-size: 100% 100%;
padding: 8px 10px;
box-sizing: border-box;
pointer-events: auto !important;
height: calc(100% - 50px);
overflow: auto;
}
</style>