lcw
This commit is contained in:
@ -10,15 +10,30 @@
|
||||
<div class="form_cnt">
|
||||
<FormMessage v-model="listQuery" :formList="formData" ref="elform" :rules="rules">
|
||||
</FormMessage>
|
||||
<div class="report-section">
|
||||
<div class="section-title">报告</div>
|
||||
<MyTable :tableData="reportTableData" :tableColumn="reportTableColumn" :tableConfiger="reportTableConfiger"
|
||||
:tableHeight="'400px'" :controlsWidth="120">
|
||||
<template #controls="{ row }">
|
||||
<el-link size="small" type="primary" @click="viewReport(row)">查看</el-link>
|
||||
</template>
|
||||
</MyTable>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 报告详情弹窗 -->
|
||||
<ReportDialog ref="reportDialogRef" v-model="reportDialogVisible" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import FormMessage from "@/components/aboutTable/FormMessage.vue";
|
||||
import MyTable from "@/components/aboutTable/MyTable.vue";
|
||||
import ReportDialog from "./components/ReportDialog.vue";
|
||||
import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, watch, computed } from "vue";
|
||||
import { addJudgmentCommandList, editJudgmentCommand, getJudgmentCommandDetail } from "@/api/huiShangyp/judgmentCommand.js"
|
||||
|
||||
|
||||
// import { getItem } from '@//utils/storage.js'
|
||||
import { useRouter } from 'vue-router'
|
||||
const emit = defineEmits(["updateDate", "getList"]);
|
||||
@ -44,6 +59,28 @@ const title = ref("");
|
||||
/** 外面行数据 */
|
||||
const outRow = ref({})
|
||||
|
||||
// 报告表格配置
|
||||
const reportTableData = computed(() => Array.isArray(listQuery.value.xfbmList) ? listQuery.value.xfbmList : []);
|
||||
const reportTableColumn = [
|
||||
{ label: "下发部门", prop: "ssbm" },
|
||||
{ label: "操作人", prop: "xtCjr" },
|
||||
];
|
||||
const reportTableConfiger = {
|
||||
showSelectType: "null",
|
||||
showIndex: false,
|
||||
haveControls: true,
|
||||
controls: "操作",
|
||||
loading: false
|
||||
};
|
||||
|
||||
// 报告详情弹窗
|
||||
const reportDialogVisible = ref(false);
|
||||
const reportDialogRef = ref();
|
||||
|
||||
const viewReport = (row) => {
|
||||
reportDialogRef.value.open(row.ypid);
|
||||
};
|
||||
|
||||
const rules = reactive({
|
||||
zlbt: [{ required: true, message: "请输入标题", trigger: "blur" }],
|
||||
// zlnr: [{ required: true, message: "请输入内容", trigger: "change" }],
|
||||
@ -79,6 +116,7 @@ const getDataById = (id) => {
|
||||
// const xfbmMc = res.xfbmMc
|
||||
});
|
||||
};
|
||||
// http://localhost:9530/mosty-api/mosty-gsxt/gsxtYpbg/0aeb4f6b814b4b05a49f472dd1234935
|
||||
|
||||
|
||||
// 提交
|
||||
@ -149,4 +187,16 @@ defineExpose({ init });
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
||||
// z-index: 1000;
|
||||
}
|
||||
|
||||
.report-section {
|
||||
margin-top: 20px;
|
||||
|
||||
.section-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 10px;
|
||||
padding-left: 10px;
|
||||
border-left: 3px solid #409eff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -13,11 +13,7 @@
|
||||
<!-- 研判报告选择 -->
|
||||
<div class="form-item">
|
||||
<label class="form-label">研判报告:</label>
|
||||
<ReportSelectInput
|
||||
v-model="formData.ypmc"
|
||||
:bglx="formData.bglx"
|
||||
@change="handleReportChange"
|
||||
/>
|
||||
<ReportSelectInput v-model="formData.ypmc" :bglx="formData.bglx" @change="handleReportChange" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<el-dialog v-model="visible" title="报告详情" width="80%" destroy-on-close @closed="handleClosed">
|
||||
<div v-loading="loading" class="report-content">
|
||||
<div v-if="reportDetail" v-html="reportDetail.bgnr"></div>
|
||||
<el-empty v-else-if="!loading" description="暂无报告内容" />
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="visible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { qcckGet } from '@/api/qcckApi.js';
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'closed']);
|
||||
|
||||
const visible = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (val) => emit('update:modelValue', val)
|
||||
});
|
||||
|
||||
const reportDetail = ref(null);
|
||||
const loading = ref(false);
|
||||
|
||||
const open = (ypbgid) => {
|
||||
visible.value = true;
|
||||
loading.value = true;
|
||||
reportDetail.value = null;
|
||||
qcckGet({}, '/mosty-gsxt/gsxtYpbg/' + ypbgid).then((res) => {
|
||||
reportDetail.value = res || {};
|
||||
}).finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
const handleClosed = () => {
|
||||
reportDetail.value = null;
|
||||
emit('closed');
|
||||
};
|
||||
|
||||
defineExpose({ open });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.report-content {
|
||||
min-height: 45vh;
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
@ -68,7 +68,7 @@ const handleConfirm = () => {
|
||||
return
|
||||
}
|
||||
|
||||
inputValue.value = selectedReport.value.ypyt || selectedReport.value.zlbt || ''
|
||||
inputValue.value = selectedReport.value.bgmc || selectedReport.value.ypyt || selectedReport.value.zlbt || ''
|
||||
emit('update:modelValue', inputValue.value)
|
||||
emit('change', selectedReport.value)
|
||||
showDialog.value = false
|
||||
|
||||
@ -19,10 +19,10 @@
|
||||
</el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="研判议题" prop="ypyt" />
|
||||
<el-table-column label="研判要求" prop="ypyq" />
|
||||
<el-table-column label="研判时间" prop="ypsj" />
|
||||
<el-table-column label="研判议题" prop="bgmc" />
|
||||
<el-table-column label="研判时间" prop="scsj" />
|
||||
<el-table-column label="发起部门" prop="ssbm" />
|
||||
<el-table-column label="创建人" prop="cjrxm" />
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
<script setup>
|
||||
import { ref, watch, onMounted } from 'vue'
|
||||
import { tacticalGet } from '@/api/huiShangyp/tacticalApi.js'
|
||||
|
||||
import { qcckGet } from '@/api/qcckApi'
|
||||
const props = defineProps({
|
||||
bglx: {
|
||||
type: String,
|
||||
@ -87,10 +87,14 @@ const loadData = async () => {
|
||||
pageSize: pageSize.value,
|
||||
pageCurrent: currentPage.value
|
||||
}
|
||||
// / gsxtYpbg / getPageList
|
||||
// const res = await tacticalGet(params)
|
||||
|
||||
qcckGet(params, '/mosty-gsxt/gsxtYpbg/getPageList').then(res => {
|
||||
tableData.value = res.records || []
|
||||
total.value = res.total || 0
|
||||
})
|
||||
|
||||
const res = await tacticalGet(params)
|
||||
tableData.value = res.records || []
|
||||
total.value = res.total || 0
|
||||
} catch (error) {
|
||||
tableData.value = []
|
||||
total.value = 0
|
||||
|
||||
@ -29,11 +29,11 @@
|
||||
</template>
|
||||
<!-- 操作 -->
|
||||
<template #controls="{ row }">
|
||||
<el-link size="small" type="primary" @click="getDataById('edit', row)">修改</el-link>
|
||||
<el-link size="small" type="primary" @click="getDataById('edit', row)" :disabled="!canEdit(row)">修改</el-link>
|
||||
<el-link size="small" type="primary" @click="getDataById('detail', row)">详情</el-link>
|
||||
<el-link size="small" type="danger" @click="deleteFile(row)">删除</el-link>
|
||||
<el-link v-if="showBtn(row) == 'sign'" size="small" type="success" @click="sign(row)">签收</el-link>
|
||||
<el-link v-if="showBtn(row) == 'feedback'" size="small" type="warning" @click="feedback(row)">反馈</el-link>
|
||||
<el-link size="small" type="danger" @click="deleteFile(row)" :disabled="!canDelete(row)">删除</el-link>
|
||||
<el-link v-if="canSign(row)" size="small" type="success" @click="sign(row)">签收</el-link>
|
||||
<el-link v-if="canFeedback(row)" size="small" type="warning" @click="feedback(row)">反馈</el-link>
|
||||
</template>
|
||||
</MyTable>
|
||||
<Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
|
||||
@ -198,25 +198,46 @@ const handleFeedbackSuccess = () => {
|
||||
|
||||
|
||||
// 权限控制
|
||||
// 显示签收
|
||||
// 获取当前用户在xfbmList中的部门项
|
||||
const getMyDeptItem = (row) => {
|
||||
return row.xfbmList?.find(v => v.ssbmdm == userInfo.value?.deptCode)
|
||||
}
|
||||
|
||||
// 显示签收状态
|
||||
const showSign = (row) => {
|
||||
let item = row.xfbmList.find(v => v.ssbmdm == userInfo.value.deptCode)
|
||||
const item = getMyDeptItem(row)
|
||||
if (item) {
|
||||
return item.zlzt == '01' ? '未签收' : item.zlzt == '02' ? '已签收' : '已反馈'
|
||||
} else {
|
||||
return row.zlzt == '01' ? '未签收' : row.zlzt == '02' ? '已签收' : '已反馈'
|
||||
}
|
||||
return row.zlzt == '01' ? '未签收' : row.zlzt == '02' ? '已签收' : '已反馈'
|
||||
}
|
||||
// sign--签收
|
||||
// feedback--反馈
|
||||
// 显示按钮
|
||||
const showBtn = (row) => {
|
||||
let item = row.xfbmList.find(v => v.ssbmdm == userInfo.value.deptCode)
|
||||
if (item) {
|
||||
return item.zlzt == '01' ? 'sign' : item.zlzt == '02' ? 'feedback' : ''
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
|
||||
// 删除权限:JS_666666/JS_777777可删除所有,其余只能删除自己的
|
||||
const canDelete = (row) => {
|
||||
const roleList = getItem('roleList') || []
|
||||
const roleCodes = roleList.map(r => r.roleCode)
|
||||
|
||||
if (roleCodes.includes('JS_666666') || roleCodes.includes('JS_777777')) return true
|
||||
return row.ssbmdm == userInfo.value?.deptCode
|
||||
}
|
||||
|
||||
// 修改权限:只能自己修改,且未签收未反馈
|
||||
const canEdit = (row) => {
|
||||
const item = getMyDeptItem(row)
|
||||
if (!item) return false
|
||||
return item.zlzt == '01'
|
||||
}
|
||||
|
||||
// 签收权限:当前部门在列表中且未签收
|
||||
const canSign = (row) => {
|
||||
const item = getMyDeptItem(row)
|
||||
return item?.zlzt == '01'
|
||||
}
|
||||
|
||||
// 反馈权限:当前部门在列表中且已签收或已反馈(可多次反馈)
|
||||
const canFeedback = (row) => {
|
||||
const item = getMyDeptItem(row)
|
||||
return item && (item.zlzt == '02' || item.zlzt == '03')
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -3,30 +3,21 @@
|
||||
<div class="head_box">
|
||||
<span class="title">报告{{ title }} </span>
|
||||
<div>
|
||||
<el-button type="primary" size="small" :loading="loading" @click="submit" v-if="title!='详情'">保存</el-button>
|
||||
<el-button type="primary" size="small" :loading="loading" @click="submit" v-if="title != '详情'">保存</el-button>
|
||||
<el-button size="small" @click="close">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form_cnt">
|
||||
<FormMessage :formList="formData" :disabled="title=='详情'" v-model="listQuery" ref="elform" :rules="rules">
|
||||
<FormMessage :formList="formData" :disabled="title == '详情'" v-model="listQuery" ref="elform" :rules="rules">
|
||||
<template #fj><el-button type="primary" @click="showText = true">附件上传</el-button></template>
|
||||
</FormMessage>
|
||||
<div class="cntBox">
|
||||
<!-- 工具栏 -->
|
||||
<Toolbar
|
||||
style="border-bottom: 1px solid #ccc"
|
||||
:editor="editorRef"
|
||||
:defaultConfig="toolbarConfig"
|
||||
<Toolbar style="border-bottom: 1px solid #ccc" :editor="editorRef" :defaultConfig="toolbarConfig"
|
||||
:mode="mode" />
|
||||
<!-- 编辑器 -->
|
||||
<Editor
|
||||
:style="`height: 480px; overflow-y: hidden`"
|
||||
v-model="textContent"
|
||||
:defaultConfig="editorConfig"
|
||||
:mode="mode"
|
||||
@onCreated="handleCreated"
|
||||
@onChange="handChange"
|
||||
/>
|
||||
<Editor :style="`height: 480px; overflow-y: hidden`" v-model="textContent" :defaultConfig="editorConfig"
|
||||
:mode="mode" @onCreated="handleCreated" @onChange="handChange" />
|
||||
</div>
|
||||
<div v-if="listQuery.id" style="display: flex; justify-content: center;">
|
||||
<!-- <el-button style="display: block;" type="primary" @click="ConsultationShow = true">网上会商</el-button> -->
|
||||
@ -120,7 +111,7 @@ const title = ref("");
|
||||
// 初始化数据
|
||||
const init = (type, row) => {
|
||||
dialogForm.value = true;
|
||||
title.value = type == "add" ? "新增" :type == "edit"? "编辑" : "详情";
|
||||
title.value = type == "add" ? "新增" : type == "edit" ? "编辑" : "详情";
|
||||
|
||||
|
||||
if (row) {
|
||||
@ -132,8 +123,9 @@ const init = (type, row) => {
|
||||
};
|
||||
// 根据id查询详情
|
||||
const getDataById = (id) => {
|
||||
qcckGet({},'/mosty-gsxt/gsxtYpbg/'+id).then((res) => {
|
||||
qcckGet({}, '/mosty-gsxt/gsxtYpbg/' + id).then((res) => {
|
||||
listQuery.value = res || {};
|
||||
textContent.value = res.bgnr
|
||||
// /** @type {Array<JudgmentDept>} 参与研判部门数据数组 */
|
||||
// const cyypList = Array.isArray(res.cyypList) ? res.cyypList : []
|
||||
// listQuery.value.jsdxBmDm = cyypList.map(item => {
|
||||
@ -150,18 +142,18 @@ const getText = (val) => {
|
||||
setEditorTextContent()
|
||||
}
|
||||
|
||||
function stripReportHeader(html) {
|
||||
const source = typeof html === "string" ? html : "";
|
||||
if (!source) return "";
|
||||
const hrMatch = source.match(/<hr\b[^>]*\/?>/i);
|
||||
if (hrMatch && typeof hrMatch.index === "number") {
|
||||
return source.slice(hrMatch.index + hrMatch[0].length).trim();
|
||||
}
|
||||
if (typeof dataBt.value === "string" && source.startsWith(dataBt.value)) {
|
||||
return source.slice(dataBt.value.length).trim();
|
||||
}
|
||||
return source.trim();
|
||||
}
|
||||
// function stripReportHeader(html) {
|
||||
// const source = typeof html === "string" ? html : "";
|
||||
// if (!source) return "";
|
||||
// const hrMatch = source.match(/<hr\b[^>]*\/?>/i);
|
||||
// if (hrMatch && typeof hrMatch.index === "number") {
|
||||
// return source.slice(hrMatch.index + hrMatch[0].length).trim();
|
||||
// }
|
||||
// if (typeof dataBt.value === "string" && source.startsWith(dataBt.value)) {
|
||||
// return source.slice(dataBt.value.length).trim();
|
||||
// }
|
||||
// return source.trim();
|
||||
// }
|
||||
|
||||
function setEditorTextContent() {
|
||||
let html = dataBt.value;
|
||||
@ -172,11 +164,11 @@ function setEditorTextContent() {
|
||||
|
||||
// 提交
|
||||
const submit = () => {
|
||||
elform.value.submit( async (data) => {
|
||||
elform.value.submit(async (data) => {
|
||||
loading.value = true;
|
||||
const params = {
|
||||
...data,
|
||||
bgnr: stripReportHeader(textContent.value)
|
||||
bgnr: textContent.value
|
||||
};
|
||||
const apiFun = !listQuery.value.id ? gsxtYpbgAddEntity : gsxtYpbgEditEntity;
|
||||
if (!listQuery.value.id) delete params.id;
|
||||
@ -211,7 +203,7 @@ const close = () => {
|
||||
loading.value = false;
|
||||
dialogForm.value = false;
|
||||
listQuery.value = {}
|
||||
router.replace({ path: '/strategicResearchs' })// 移除id 避免刷新一直带参数
|
||||
router.replace({ path: '/strategicResearchs' })// 移除id 避免刷新一直带参数
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="form_cnt">
|
||||
<EarlyWarning v-if="item.mxlx == YJGZ" ref="regulationRef"
|
||||
:dict="{D_BB_AJLB,D_BZ_WPLX}"
|
||||
:dict="{/* D_BB_AJLB, */ D_BZ_WPLX}"
|
||||
:defaultData="defaultData" :disabled="false" />
|
||||
<Regulation v-if="item.mxlx ==SSYJ" ref="regulationRef" :dict="{D_BZ_RYBQ}"
|
||||
:defaultData="defaultData" :disabled="false" />
|
||||
@ -34,7 +34,7 @@ const props = defineProps({
|
||||
|
||||
})
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { D_BB_AJLB,D_BZ_WPLX,D_BZ_RYBQ} = proxy.$dict("D_BB_AJLB","D_BZ_WPLX","D_BZ_RYBQ")
|
||||
const { /* D_BB_AJLB, */ D_BZ_WPLX, D_BZ_RYBQ } = proxy.$dict(/* "D_BB_AJLB", */ "D_BZ_WPLX", "D_BZ_RYBQ")
|
||||
const title = ref("新增")
|
||||
const emit = defineEmits(['getList'])
|
||||
const listQuery = ref()
|
||||
|
||||
@ -46,7 +46,7 @@ const props = defineProps({
|
||||
})
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { D_BB_AJLB,D_BZ_WPLX} = proxy.$dict("D_BB_AJLB","D_BZ_WPLX")
|
||||
const { /* D_BB_AJLB, */ D_BZ_WPLX } = proxy.$dict(/* "D_BB_AJLB", */ "D_BZ_WPLX")
|
||||
const regulation = ref(null)
|
||||
const queryFrom = ref({})
|
||||
const searchBox = ref(); //搜索框
|
||||
|
||||
@ -14,7 +14,7 @@ import WarningList from "./components/AddModel/warningList.vue"
|
||||
const { proxy } = getCurrentInstance();
|
||||
import emitter from "@/utils/eventBus.js";
|
||||
import { onMounted, ref, getCurrentInstance } from "vue";
|
||||
const { D_BZ_TPYJLX,D_BZ_YJLX ,D_BZ_JQLY} = proxy.$dict("D_BZ_TPYJLX","D_BZ_YJLX","D_BZ_JQLY")
|
||||
const { /* D_BZ_TPYJLX, */D_BZ_YJLX /* ,D_BZ_JQLY */} = proxy.$dict(/* "D_BZ_TPYJLX", */"D_BZ_YJLX"/* ,"D_BZ_JQLY" */)
|
||||
|
||||
const showModel = ref('研判首页')
|
||||
const itemData = ref({})
|
||||
|
||||
Reference in New Issue
Block a user