feaet: 调整报告接口
This commit is contained in:
@ -104,6 +104,19 @@ export const gsxtYpbgAddEntity = (data) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑研判报告
|
||||||
|
* @param {Object} data 研判报告数据
|
||||||
|
* @returns {Promise} 请求Promise对象
|
||||||
|
*/
|
||||||
|
export const gsxtYpbgEditEntity = (data) => {
|
||||||
|
return request({
|
||||||
|
url: api + `/gsxtYpbg/editEntity`,
|
||||||
|
method: "put",
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自建研判报告
|
* 自建研判报告
|
||||||
* @param {Object} data 自建研判数据
|
* @param {Object} data 自建研判数据
|
||||||
|
|||||||
@ -0,0 +1,137 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dialog" v-if="dialogForm">
|
||||||
|
<div class="head_box">
|
||||||
|
<span class="title">创建会议{{ title }} </span>
|
||||||
|
<div>
|
||||||
|
<el-button type="primary" size="small" :loading="loading" @click="submit">保存</el-button>
|
||||||
|
<el-button size="small" @click="close">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form_cnt">
|
||||||
|
<FormMessage v-model="listQuery" :formList="formData" ref="elform" :rules="rules">
|
||||||
|
<!-- <template #glxsmc>
|
||||||
|
<el-input placeholder="请选择关联线索" @click="chooseVisiblexS = true" readonly v-model="listQuery.glxsmc"></el-input>
|
||||||
|
</template> -->
|
||||||
|
<template #chryList>
|
||||||
|
<el-input placeholder="请选择参会人员" @click="openMeetings = true" readonly v-model="listQuery.rymc"></el-input>
|
||||||
|
</template>
|
||||||
|
</FormMessage>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Personnel v-model="openMeetings" />
|
||||||
|
<ChooseUser v-model="chooseVisible" :Single="false" @choosedUsers="handleUserSelected" :roleIds="roleIds" />
|
||||||
|
<Xslist v-model="chooseVisiblexS" @choosed="choosed" :roleIds="roleIdsxs"></Xslist>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import ChooseUser from "@/components/ChooseList/ChooseUser/index.vue";
|
||||||
|
// import Xslist from '@/components/ChooseList/ChooseXs/index.vue'
|
||||||
|
import FormMessage from "@/components/aboutTable/FormMessage.vue";
|
||||||
|
import { qcckGet, qcckPost } from "@/api/qcckApi.js";
|
||||||
|
import Personnel from '@/views/backOfficeSystem/JudgmentHome/MeetingRoom/components/Communications/personnel.vue'
|
||||||
|
import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, } from "vue";
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
|
const emit = defineEmits(["updateDate"]);
|
||||||
|
|
||||||
|
const roleIds = ref([]); //角色id
|
||||||
|
const chooseVisible = ref(false);
|
||||||
|
const roleIdsxs = ref([]); //角色id
|
||||||
|
const chooseVisiblexS = ref(false);
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
|
const dialogForm = ref(false); //弹窗
|
||||||
|
const rules = reactive({
|
||||||
|
hskssj: [{ required: true, message: "请选择会商开始时间", trigger: "change" }],
|
||||||
|
hsjssj: [{ required: true, message: "请选择会商结束时间", trigger: "change" }],
|
||||||
|
hsnr: [{ required: true, message: "请输入会商内容", trigger: "blur" }],
|
||||||
|
hsbt: [{ required: true, message: "请输入会商标题", trigger: "blur" }],
|
||||||
|
// glxsmc: [{ required: true, message: "请选择关联线索", trigger: "change" }],
|
||||||
|
chryList: [{ required: true, message: "请选择参会人员", trigger: "change" }],
|
||||||
|
});
|
||||||
|
const formData = ref([
|
||||||
|
{ label: "会商开始时间", prop: "hskssj", type: "datetime" },
|
||||||
|
{ label: "会商结束时间", prop: "hsjssj", type: "datetime" },
|
||||||
|
{ label: "会商内容", prop: "hsnr", type: "textarea", width: "100%" },
|
||||||
|
// { label: "关联线索", prop: "glxsmc", type: "slot", },
|
||||||
|
{ label: "会商标题", prop: "hsbt", type: "input" },
|
||||||
|
// { label: "参会人员", prop: "chryList", type: "slot" ,width:'100%'},
|
||||||
|
]);
|
||||||
|
const listQuery = ref({}); //表单
|
||||||
|
const loading = ref(false);
|
||||||
|
const elform = ref();
|
||||||
|
const title = ref("");
|
||||||
|
const outRow = ref({})
|
||||||
|
// 初始化数据
|
||||||
|
const init = (type, row, outRowObj = {}) => {
|
||||||
|
outRow.value = outRowObj
|
||||||
|
dialogForm.value = true;
|
||||||
|
title.value = type == "add" ? "新增" : "编辑";
|
||||||
|
if (row) {
|
||||||
|
getDataById(row.id)
|
||||||
|
} else {
|
||||||
|
listQuery.value = {
|
||||||
|
hskssj: dayjs().format("YYYY-MM-DD HH:mm:ss"),
|
||||||
|
hsjssj: dayjs().add(1, "hour").format("YYYY-MM-DD HH:mm:ss"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 根据id查询详情
|
||||||
|
const getDataById = (id) => {
|
||||||
|
qcckGet({ id }, "/mosty-gsxt/wshs/selectByid").then((res) => {
|
||||||
|
res.rymc = res.chryList ? res.chryList.map(v => v.chryxm).join(",") : '';
|
||||||
|
res.chryList = res.chryList ? res.chryList.map(item => item.chryid) : [];
|
||||||
|
roleIds.value = res.chryList;
|
||||||
|
roleIdsxs.value = res.glxsid ? [res.glxsid] : [];
|
||||||
|
listQuery.value = res;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleUserSelected = (userData) => {
|
||||||
|
roleIds.value = userData.map(item => item.id);
|
||||||
|
listQuery.value.chryList = userData.map(item => item.id)
|
||||||
|
listQuery.value.rymc = userData.map(item => item.userName).join("、");
|
||||||
|
};
|
||||||
|
|
||||||
|
const choosed = (data) => {
|
||||||
|
listQuery.value.glxsmc = data[0].xsMc;
|
||||||
|
listQuery.value.glxsid = data[0].id;
|
||||||
|
roleIdsxs.value = data.map(item => item.id);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 提交
|
||||||
|
const submit = () => {
|
||||||
|
elform.value.submit((data) => {
|
||||||
|
let url = title.value == "新增" ? "/mosty-gsxt/wshs/add" : "/mosty-gsxt/wshs/update";
|
||||||
|
let params = {
|
||||||
|
...data,
|
||||||
|
glxsid: outRow.value.id,
|
||||||
|
glxsmc: outRow.value.xsMc,
|
||||||
|
};
|
||||||
|
loading.value = true;
|
||||||
|
qcckPost(params, url).then(() => {
|
||||||
|
loading.value = false;
|
||||||
|
proxy.$message({ type: "success", message: title.value + "成功" });
|
||||||
|
emit("updateDate");
|
||||||
|
close();
|
||||||
|
}).catch(() => { loading.value = false; });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关闭
|
||||||
|
const close = () => {
|
||||||
|
listQuery.value = {};
|
||||||
|
roleIds.value = [];
|
||||||
|
roleIdsxs.value = [];
|
||||||
|
dialogForm.value = false;
|
||||||
|
loading.value = false;
|
||||||
|
};
|
||||||
|
// 选择参会人员
|
||||||
|
const openMeetings = ref(false)
|
||||||
|
|
||||||
|
defineExpose({ init });
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "~@/assets/css/layout.scss";
|
||||||
|
@import "~@/assets/css/element-plus.scss";
|
||||||
|
</style>
|
||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="dialog" v-if="dialogForm">
|
<div class="dialog" v-if="dialogForm">
|
||||||
<div class="head_box">
|
<div class="head_box">
|
||||||
<span class="title">经验分享{{ title }} </span>
|
<span class="title">报告{{ title }} </span>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" size="small" :loading="loading" @click="submit">保存</el-button>
|
<el-button type="primary" size="small" :loading="loading" @click="submit">保存</el-button>
|
||||||
<el-button size="small" @click="close">关闭</el-button>
|
<el-button size="small" @click="close">关闭</el-button>
|
||||||
@ -9,8 +9,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form_cnt">
|
<div class="form_cnt">
|
||||||
<FormMessage :formList="formData" v-model="listQuery" ref="elform" :rules="rules">
|
<FormMessage :formList="formData" v-model="listQuery" ref="elform" :rules="rules">
|
||||||
<template #ypnr>
|
<template #bgnr>
|
||||||
<el-input v-model="listQuery.ypnr" style="width: 100%" placeholder="请输入关键字" class="input-with-select">
|
<el-input v-model="listQuery.bgnr" style="width: 100%" placeholder="请输入关键字" class="input-with-select">
|
||||||
<template #append>
|
<template #append>
|
||||||
<el-button :icon="Search" type="primary">搜索</el-button>
|
<el-button :icon="Search" type="primary">搜索</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -27,7 +27,7 @@
|
|||||||
:mode="mode" @onCreated="handleCreated" @onChange="handChange" />
|
:mode="mode" @onCreated="handleCreated" @onChange="handChange" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex; justify-content: center;">
|
<div v-if="outRow.id" style="display: flex; justify-content: center;">
|
||||||
<!-- <el-button style="display: block;" type="primary" @click="ConsultationShow = true">网上会商</el-button> -->
|
<!-- <el-button style="display: block;" type="primary" @click="ConsultationShow = true">网上会商</el-button> -->
|
||||||
<el-button style="display: block;" type="primary" @click="downloadWithStyles(textContent)">下载</el-button>
|
<el-button style="display: block;" type="primary" @click="downloadWithStyles(textContent)">下载</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -49,9 +49,9 @@ import "@wangeditor/editor/dist/css/style.css";
|
|||||||
// import Consultation from './consultation.vue'
|
// import Consultation from './consultation.vue'
|
||||||
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
|
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
|
||||||
import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, shallowRef, onBeforeUnmount, watch } from "vue";
|
import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, shallowRef, onBeforeUnmount, watch } from "vue";
|
||||||
import { gsxtYpbgAddEntity } from "@/api/huiShangyp/tacticalApi.js"
|
import { gsxtYpbgAddEntity, gsxtYpbgEditEntity } from "@/api/huiShangyp/tacticalApi.js"
|
||||||
|
|
||||||
const emit = defineEmits(["updateDate"]);
|
const emit = defineEmits(["updateDate", 'ok']);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
dic: Object,
|
dic: Object,
|
||||||
});
|
});
|
||||||
@ -109,50 +109,69 @@ const rules = reactive({
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
const formData = ref([
|
const formData = ref([
|
||||||
{ label: "研判标题", prop: "ypbt", type: "input", width: "100%" },
|
{ label: "报告名称", prop: "bgmc", type: "input", width: "100%", blur: setEditorTextContent },
|
||||||
{ label: "研判内容", prop: "ypnr", type: "slot", width: "100%" },
|
{ label: "报告内容", prop: "bgnr", type: "slot", width: "100%", blur: setEditorTextContent },
|
||||||
{ label: "附件内容", prop: "fj", type: "slot", width: "100%" },
|
// { label: "附件内容", prop: "fj", type: "slot", width: "100%" },
|
||||||
]);
|
]);
|
||||||
const listQuery = ref({
|
const listQuery = ref({
|
||||||
ypbt: "",
|
bgmc: "",
|
||||||
ypnr: "",
|
bgnr: "",
|
||||||
fj: ""
|
fj: ""
|
||||||
}); //表单
|
}); //表单
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const elform = ref();
|
const elform = ref();
|
||||||
const title = ref("");
|
const title = ref("");
|
||||||
|
/** 外面行数据 */
|
||||||
const outRow = ref({})
|
const outRow = ref({})
|
||||||
|
|
||||||
|
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
const init = (type, row) => {
|
const init = (type, reportData, row) => {
|
||||||
|
|
||||||
|
listQuery.value = {
|
||||||
|
bgmc: reportData.bgmc,
|
||||||
|
bgnr: reportData.bgnr,
|
||||||
|
id: reportData.id,
|
||||||
|
// fj: reportData.fj
|
||||||
|
}
|
||||||
|
outRow.value = { ...row }
|
||||||
dialogForm.value = true;
|
dialogForm.value = true;
|
||||||
title.value = type == "add" ? "新增" : "编辑";
|
title.value = type == "add" ? "新增" : "编辑";
|
||||||
|
setEditorTextContent()
|
||||||
};
|
};
|
||||||
const getText = (val, row = {}) => {
|
const getText = (val, row = {}) => {
|
||||||
outRow.value = { ...row }
|
|
||||||
listQuery.value.fj = val.text;
|
listQuery.value.fj = val.text;
|
||||||
|
setEditorTextContent()
|
||||||
}
|
}
|
||||||
watch(() => listQuery.value, (val) => {
|
|
||||||
|
function setEditorTextContent() {
|
||||||
let html = dataBt.value;
|
let html = dataBt.value;
|
||||||
html += `<p style="text-align: center;"><span style="font-size: 22px;">${val.ypbt || ''}</span></p>`
|
|
||||||
html += `<p>${val.fj || ''}</p>`
|
|
||||||
|
html += `<p style="text-align: center;"><span style="font-size: 22px;">${listQuery.value.bgmc || ''}</span></p>`
|
||||||
|
html += `<p>${listQuery.value.fj || ''}</p>`
|
||||||
textContent.value = html
|
textContent.value = html
|
||||||
},
|
}
|
||||||
{
|
|
||||||
deep: true, immediate: true
|
// watch(() => listQuery.value, (val) => {
|
||||||
})
|
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// deep: true, immediate: true
|
||||||
|
// })
|
||||||
// 提交
|
// 提交
|
||||||
const submit = () => {
|
const submit = () => {
|
||||||
elform.value.submit((data) => {
|
elform.value.submit((data) => {
|
||||||
// let url = title.value == "新增" ? "/mosty-gsxt/gsxt/jyfx/add" : "/mosty-gsxt/gsxt/jyfx/edit";
|
// let url = title.value == "新增" ? "/mosty-gsxt/gsxt/jyfx/add" : "/mosty-gsxt/gsxt/jyfx/edit";
|
||||||
|
|
||||||
let params = {
|
let params = {
|
||||||
...data,
|
...data,
|
||||||
ypid: outRow.value.id,
|
ypid: outRow.value.id,
|
||||||
ypmc: outRow.value.ypyt
|
ypmc: outRow.value.ypyt
|
||||||
};
|
};
|
||||||
gsxtYpbgAddEntity(params).then(() => {
|
const apiFun = !listQuery.value.id ? gsxtYpbgAddEntity : gsxtYpbgEditEntity
|
||||||
|
if (!listQuery.value.id) delete params.id
|
||||||
|
apiFun(params).then(() => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
proxy.$message({ type: "success", message: title.value + "成功" });
|
proxy.$message({ type: "success", message: title.value + "成功" });
|
||||||
emit("ok");
|
emit("ok");
|
||||||
@ -169,7 +188,7 @@ const handleCreated = (editor) => {
|
|||||||
//内容发生变化
|
//内容发生变化
|
||||||
const handChange = (editor) => {
|
const handChange = (editor) => {
|
||||||
// 判断是否是一个空段落,是空就传空文本
|
// 判断是否是一个空段落,是空就传空文本
|
||||||
console.log(editor.getHtml(), 'editor.getHtml()');
|
|
||||||
|
|
||||||
};
|
};
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
|||||||
@ -29,7 +29,8 @@
|
|||||||
<template #controls="{ row }">
|
<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)">修改</el-link> -->
|
||||||
<el-link size="small" type="primary" @click="getDataById('detail', row)">详情</el-link>
|
<el-link size="small" type="primary" @click="getDataById('detail', row)">详情</el-link>
|
||||||
<el-link size="small" type="primary" @click="createReport(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>
|
<el-link size="small" type="danger" @click="deleteFile(row)">删除</el-link>
|
||||||
</template>
|
</template>
|
||||||
</MyTable>
|
</MyTable>
|
||||||
@ -43,6 +44,8 @@
|
|||||||
|
|
||||||
<!-- 创建报告 -->
|
<!-- 创建报告 -->
|
||||||
<addReport ref="reportTc" :row="currRow" :dic="{ D_GS_BQ_LX }" @ok="getList" />
|
<addReport ref="reportTc" :row="currRow" :dic="{ D_GS_BQ_LX }" @ok="getList" />
|
||||||
|
<!-- 创建报告 -->
|
||||||
|
<addMeeting ref="meetingTc" :row="currRow" @updateDate="getList" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -55,11 +58,14 @@ import { tacticalGet, strategicDelete } from "@/api/huiShangyp/tacticalApi.js";
|
|||||||
import { reactive, ref, onMounted, getCurrentInstance, watch, computed, nextTick } from "vue";
|
import { reactive, ref, onMounted, getCurrentInstance, watch, computed, nextTick } from "vue";
|
||||||
import addReport from "./addReport.vue";
|
import addReport from "./addReport.vue";
|
||||||
import AddForm from "./addForm.vue";
|
import AddForm from "./addForm.vue";
|
||||||
|
import addMeeting from "./addMeeting.vue";
|
||||||
const { proxy } = getCurrentInstance();
|
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 { 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 reportTc = ref();
|
||||||
|
/** 会议弹框 */
|
||||||
|
const meetingTc = ref();
|
||||||
const searchBox = ref(); //搜索框
|
const searchBox = ref(); //搜索框
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
@ -183,9 +189,16 @@ const deleteFile = (row) => {
|
|||||||
const selfCreateResearch = (type = 'add') => {
|
const selfCreateResearch = (type = 'add') => {
|
||||||
addForm.value.init(type, null, '01');
|
addForm.value.init(type, null, '01');
|
||||||
}
|
}
|
||||||
|
/** 创建报告 */
|
||||||
const createReport = (row) => {
|
const createReport = (row) => {
|
||||||
reportTc.value.init('add',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 }
|
// currRow.value = { ...row }
|
||||||
// isShowReport.value = true
|
// isShowReport.value = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user