feat:战术研判更新一次

This commit is contained in:
2025-12-19 10:07:00 +08:00
parent 9c179c71ca
commit c1fc037cdf

View File

@ -8,20 +8,19 @@
</div> </div>
</div> </div>
<div style="padding-bottom: 0px;" class="form_cnt"> <div style="padding-bottom: 0px;" class="form_cnt">
<FormMessage v-model="listQuery" :formList="formData" ref="elform" :rules="rules"> <FormMessage v-model="listQuery" :formList="formData" ref="elform" :rules="rules" :disabled="title === '详情'">
<template #bmList> <template #bmList>
<div class="table-box"> <div class="table-box">
<el-table :data="tableList" border style="width: 100%"> <el-table :data="tableList" border style="width: 100%">
<el-table-column prop="ypbmmc" label="部门" width="150" align="center" /> <el-table-column prop="ypbmmc" label="部门" width="150" align="center" />
<el-table-column label="研判素材" width="380" align="center"> <el-table-column label="研判素材" width="380" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-input v-model="row.scyq" type="textarea" :rows="3" :disabled="true" placeholder="请输入研判素材" /> <el-input v-model="row.scyq" placeholder="请输入研判素材" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="附件" width="200" align="center"> <el-table-column label="附件" width="200" align="center">
<template #default="{ row }"> <template #default="{ row }">
<UploadFile v-model="row.fj" :disabled="true" :limit="1" :isImg="false" <UploadFile v-model="row.fj" :limit="1" :isImg="false" :isAll="true" />
:isAll="true" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="wcqk" label="完成状态" width="120" align="center"> <el-table-column prop="wcqk" label="完成状态" width="120" align="center">
@ -91,16 +90,29 @@
</template> </template>
<script setup> <script setup>
/**
* @typedef {Object} JudgmentDept 研判部门对象
* @property {string} ypbmdm - 研判部门代码
* @property {string} ypbmmc - 研判部门名称
* @property {string} scyq - 素材要求
* @property {Array} fj - 附件数组
* @property {string} wcqk - 完成情况01 准备中、02 已完成)
*/
import FormMessage from "@/components/aboutTable/FormMessage.vue"; import FormMessage from "@/components/aboutTable/FormMessage.vue";
import UploadFile from "@/components/MyComponents/Upload/index.vue"; import UploadFile from "@/components/MyComponents/Upload/index.vue";
// import ChooseUser from "@/components/ChooseList/ChooseUser/index.vue" // import ChooseUser from "@/components/ChooseList/ChooseUser/index.vue"
import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, watch, computed } from "vue"; import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, watch, computed } from "vue";
import { sjzlAddEntity, sjzlEditEntity, sjzlGetInfo, sjzlPerfectlnfo, sjzlFstz, sjzlQryp, sjzlPerfectSorce } from '@//api/yj.js' import { sjzlGetInfo, sjzlPerfectlnfo, sjzlFstz, sjzlQryp, sjzlPerfectSorce } from '@//api/yj.js'
import { selfBuildJudgment } from "@/api/huiShangyp/tacticalApi.js"
// import { tacticalGet, strategicDelete } from "@/api/huiShangyp/strategicApi.js";
import { getItem } from '@//utils/storage.js' import { getItem } from '@//utils/storage.js'
const emit = defineEmits(["updateDate", "getList"]); const emit = defineEmits(["updateDate", "getList"]);
const props = defineProps({ const props = defineProps({
dict: Object dict: Object,
/** 报告类型 01 战术研判 02战略研判 */
bglx: String,
}); });
const imgMsg = ref([]) const imgMsg = ref([])
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
@ -146,7 +158,7 @@ watch(() => props.dict, (val) => {
formData.value = [ formData.value = [
{ label: "研判议题", prop: "ypyt", type: "input", width: '48%' }, { label: "研判议题", prop: "ypyt", type: "input", width: '48%' },
{ label: "研判时间", prop: "ypsj", type: "datetime", width: '48%' }, { label: "研判时间", prop: "ypsj", type: "datetime", width: '48%' },
{ label: "报告类型", prop: "bglx", type: "radio", options: props.dict.D_BZ_YPLX, width: '48%' }, { label: "报告类型", prop: "bglx", type: "radio", options: props.dict.D_BZ_YPLX, width: '48%', disabled: true },
{ label: "研判方式", prop: "ypfs", type: "radio", options: props.dict.D_BZ_YPFS, width: '48%' }, { label: "研判方式", prop: "ypfs", type: "radio", options: props.dict.D_BZ_YPFS, width: '48%' },
{ label: "参与研判部门", prop: "jsdxBmDm", type: "department", multiple: true, depMc: 'jsdxBmMc', width: '48%' }, { label: "参与研判部门", prop: "jsdxBmDm", type: "department", multiple: true, depMc: 'jsdxBmMc', width: '48%' },
{ label: "研判要求", prop: "ypyq", type: "textarea", width: '100%' }, { label: "研判要求", prop: "ypyq", type: "textarea", width: '100%' },
@ -175,18 +187,19 @@ function getFjArr(fj) {
return fjArr return fjArr
} }
watch(() => listQuery.value.jsdxBmDm, (val) => { watch(() => listQuery.value.jsdxBmDm, (val) => {
/** @type {Array<{ypbmdm: string, ypbmmc: string, scyq: string, fj: Array, wcqk: string}>} 参与研判部门数据数组 */ /** @type {Array<JudgmentDept>} 参与研判部门数据数组 */
const arr = Array.isArray(val) ? val : [] const arr = Array.isArray(val) ? val : []
/** @type {Array} 参与研判部门*/
const cyypList = Array.isArray(listQuery.value.cyypList) ? listQuery.value.cyypList : [] const cyypList = Array.isArray(listQuery.value.cyypList) ? listQuery.value.cyypList : []
tableList.value = arr.map((item, i) => { tableList.value = arr.map((item, i) => {
/** 找原来的对象 */ /** 找原来的对象 */
const curr = cyypList.find(item2 => item2.ypbmdm == item) || {} const curr = cyypList.find(item2 => item2.ypbmdm == item) || {}
/** 是否是新增 */ /** 是否是新增 */
const isAddForm = !listQuery.value.id const isAddForm = !listQuery.value?.id
return { return {
// id: null, // id: null,
// sjzlid: null, // 研判战研判ID // sjzlid: null, // 研判战研判ID
/** 部门代码 */ /** 部门代码 */
ypbmdm: item, ypbmdm: item,
ypbmmc: listQuery.value.jsdxBmMc[i], ypbmmc: listQuery.value.jsdxBmMc[i],
@ -202,13 +215,25 @@ watch(() => listQuery.value.jsdxBmDm, (val) => {
const init = (type, row, wjlb) => { const init = (type, row, wjlb) => {
dialogForm.value = true; dialogForm.value = true;
title.value = type == "add" ? "新增" : type == "edit" ? "编辑" : "详情"; title.value = type == "add" ? "新增" : type == "edit" ? "编辑" : "详情";
outRow.value = row || {} outRow.value = row
if (row) { getDataById(row.id) } if (row) {
getDataById(row.id)
} else {
listQuery.value = {
bglx: props.bglx, // 报告类型 01 战术研判 02战略研判
ypfs: undefined, // 研判方式
ypsj: undefined, // 研判时间
ypyq: undefined, // 研判要求
cyypList: [], // 参与研判部门数据数组
}
}
}; };
// 根据id查询详情 // 根据id查询详情
const getDataById = (id) => { const getDataById = (id) => {
sjzlGetInfo(id).then((res) => { sjzlGetInfo(id).then((res) => {
console.log('res: ', res);
listQuery.value = res || {}; listQuery.value = res || {};
/** @type {Array<JudgmentDept>} 参与研判部门数据数组 */
const cyypList = Array.isArray(res.cyypList) ? res.cyypList : [] const cyypList = Array.isArray(res.cyypList) ? res.cyypList : []
listQuery.value.jsdxBmDm = cyypList.map(item => { listQuery.value.jsdxBmDm = cyypList.map(item => {
return item.ypbmdm return item.ypbmdm
@ -218,21 +243,23 @@ const getDataById = (id) => {
}) })
}); });
}; };
/** 获取附件json字符串 */
function getFjString(arr) { function getFjString(arr) {
arr = Array.isArray(arr) ? arr : [] arr = Array.isArray(arr) ? arr : []
return JSON.stringify(arr) return JSON.stringify(arr)
} }
/**获取下发部门数据 */ /**获取下发部门数据 */
const getXfbmList = () => { const getXfbmList = () => {
/** @type {Array<JudgmentDept>} 参与研判部门数据数组 */
const cyypList = Array.isArray(listQuery.value.cyypList) ? listQuery.value.cyypList : [] const cyypList = Array.isArray(listQuery.value.cyypList) ? listQuery.value.cyypList : []
return tableList.value.map((item, i) => { return tableList.value.map((item, i) => {
/** 找原来的对象 */ /** @type {JudgmentDept} 找原来的对象 */
const curr = cyypList.find(item => item.ypbmdm == item.ypbmdm) || {} const curr = cyypList.find(item => item.ypbmdm == item.ypbmdm) || {}
return { return {
id: curr.id || null, id: curr.id || null,
sjzlid: curr.sjzlid || null, // 研判战研判ID sjzlid: curr.sjzlid || null, // 研判战研判ID
ypbmdm: item.ypbmdm, ypbmdm: item.ypbmdm,
ypbmmc: listQuery.value.jsdxBmMc[i], ypbmmc: listQuery.value.jsdxBmMc[i],
/** 素材要求 */ /** 素材要求 */
@ -263,9 +290,9 @@ const submit = () => {
loading.value = true; loading.value = true;
let res let res
if (title.value == "新增") { if (title.value == "新增") {
res = await sjzlAddEntity(params) res = await selfBuildJudgment(params)
} else { } else {
res = await sjzlEditEntity(params) // res = await sjzlEditEntity(params)// 目前没有修改
} }
if (res && res > 0) { if (res && res > 0) {
loading.value = false; loading.value = false;