feat:战略研判修改
This commit is contained in:
@ -1,27 +1,26 @@
|
||||
<template>
|
||||
<div class="dialog" v-if="dialogForm">
|
||||
<div class="head_box">
|
||||
<span class="title">战略研判{{ title }} </span>
|
||||
<span class="title">战术研判{{ title }} </span>
|
||||
<div>
|
||||
<el-button type="primary" size="small" v-if="title != '详情'" :loading="loading" @click="submit">保存</el-button>
|
||||
<el-button size="small" @click="close">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<div class="table-box">
|
||||
<el-table :data="tableList" border style="width: 100%">
|
||||
<el-table-column prop="ypbmmc" label="部门" width="150" align="center" />
|
||||
<el-table-column label="研判素材" width="280" align="center">
|
||||
<el-table-column label="研判素材" width="380" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.scyq" :disabled="true" placeholder="请输入研判素材" />
|
||||
<el-input v-model="row.scyq" placeholder="请输入研判素材" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="附件" width="200" align="center">
|
||||
<template #default="{ row }">
|
||||
<UploadFile v-model="row.fj" :disabled="true" :limit="1" :isImg="false"
|
||||
:isAll="true" />
|
||||
<UploadFile v-model="row.fj" :limit="1" :isImg="false" :isAll="true" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="wcqk" label="完成状态" width="120" align="center">
|
||||
@ -91,17 +90,29 @@
|
||||
</template>
|
||||
|
||||
<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 UploadFile from "@/components/MyComponents/Upload/index.vue";
|
||||
// import ChooseUser from "@/components/ChooseList/ChooseUser/index.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'
|
||||
|
||||
const emit = defineEmits(["updateDate", "getList"]);
|
||||
const props = defineProps({
|
||||
dict: Object
|
||||
dict: Object,
|
||||
/** 报告类型 01 战术研判 02战略研判 */
|
||||
bglx: String,
|
||||
});
|
||||
const imgMsg = ref([])
|
||||
const { proxy } = getCurrentInstance();
|
||||
@ -147,7 +158,7 @@ watch(() => props.dict, (val) => {
|
||||
formData.value = [
|
||||
{ label: "研判议题", prop: "ypyt", type: "input", 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: "jsdxBmDm", type: "department", multiple: true, depMc: 'jsdxBmMc', width: '48%' },
|
||||
{ label: "研判要求", prop: "ypyq", type: "textarea", width: '100%' },
|
||||
@ -165,6 +176,8 @@ function updateDis(row) {
|
||||
const isFinish = row.wcqk === '02'
|
||||
return isShiQingBaoZhongXin.value || !iscjr || isFinish
|
||||
}
|
||||
|
||||
/** 获取附件数组 */
|
||||
function getFjArr(fj) {
|
||||
if (typeof fj !== 'string' || !fj) return []
|
||||
let fjArr = []
|
||||
@ -176,15 +189,16 @@ function getFjArr(fj) {
|
||||
return fjArr
|
||||
}
|
||||
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 : []
|
||||
/** @type {Array} 参与研判部门*/
|
||||
const cyypList = Array.isArray(listQuery.value.cyypList) ? listQuery.value.cyypList : []
|
||||
|
||||
tableList.value = arr.map((item, i) => {
|
||||
/** 找原来的对象 */
|
||||
const curr = cyypList.find(item2 => item2.ypbmdm == item) || {}
|
||||
/** 是否是新增 */
|
||||
const isAddForm = !listQuery.value.id
|
||||
const isAddForm = !listQuery.value?.id
|
||||
return {
|
||||
// id: null,
|
||||
// sjzlid: null, // 研判战略研判ID
|
||||
@ -203,13 +217,24 @@ watch(() => listQuery.value.jsdxBmDm, (val) => {
|
||||
const init = (type, row, wjlb) => {
|
||||
dialogForm.value = true;
|
||||
title.value = type == "add" ? "新增" : type == "edit" ? "编辑" : "详情";
|
||||
outRow.value = row || {}
|
||||
if (row) { getDataById(row.id) }
|
||||
outRow.value = row
|
||||
if (row) {
|
||||
getDataById(row.id)
|
||||
} else {
|
||||
listQuery.value = {
|
||||
bglx: props.bglx, // 报告类型 01 战术研判 02战略研判
|
||||
ypfs: undefined, // 研判方式
|
||||
ypsj: undefined, // 研判时间
|
||||
ypyq: undefined, // 研判要求
|
||||
cyypList: [], // 参与研判部门数据数组
|
||||
}
|
||||
}
|
||||
};
|
||||
// 根据id查询详情
|
||||
const getDataById = (id) => {
|
||||
sjzlGetInfo(id).then((res) => {
|
||||
listQuery.value = res || {};
|
||||
/** @type {Array<JudgmentDept>} 参与研判部门数据数组 */
|
||||
const cyypList = Array.isArray(res.cyypList) ? res.cyypList : []
|
||||
listQuery.value.jsdxBmDm = cyypList.map(item => {
|
||||
return item.ypbmdm
|
||||
@ -219,17 +244,17 @@ const getDataById = (id) => {
|
||||
})
|
||||
});
|
||||
};
|
||||
/** 获取附件json字符串 */
|
||||
function getFjString(arr) {
|
||||
arr = Array.isArray(arr) ? arr : []
|
||||
return JSON.stringify(arr)
|
||||
}
|
||||
/**获取下发部门数据 */
|
||||
const getXfbmList = () => {
|
||||
/** @type {Array<JudgmentDept>} 参与研判部门数据数组 */
|
||||
const cyypList = Array.isArray(listQuery.value.cyypList) ? listQuery.value.cyypList : []
|
||||
|
||||
return tableList.value.map((item, i) => {
|
||||
|
||||
/** 找原来的对象 */
|
||||
/** @type {JudgmentDept} 找原来的对象 */
|
||||
const curr = cyypList.find(item => item.ypbmdm == item.ypbmdm) || {}
|
||||
return {
|
||||
id: curr.id || null,
|
||||
@ -252,21 +277,14 @@ const submit = () => {
|
||||
let params = {
|
||||
...listQuery.value,
|
||||
cyypList: xfbmList,
|
||||
// cyypList: listQuery.value.jsdxBmDm.map((item, index) => {
|
||||
// return {
|
||||
// ypbmdm: item,
|
||||
// ypbmmc: listQuery.value.jsdxBmMc[index],
|
||||
// ypcylx: '01'
|
||||
// }
|
||||
// })
|
||||
};
|
||||
try {
|
||||
loading.value = true;
|
||||
let res
|
||||
if (title.value == "新增") {
|
||||
res = await sjzlAddEntity(params)
|
||||
res = await selfBuildJudgment(params)
|
||||
} else {
|
||||
res = await sjzlEditEntity(params)
|
||||
// res = await sjzlEditEntity(params)// 目前没有修改
|
||||
}
|
||||
if (res && res > 0) {
|
||||
loading.value = false;
|
||||
@ -358,7 +376,7 @@ const submitMaterialAction = async () => {
|
||||
closeMaterialDialog()
|
||||
if (outRow.value.id) { getDataById(outRow.value.id) }
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
|
||||
} finally {
|
||||
materialLoading.value = false
|
||||
}
|
||||
@ -384,7 +402,7 @@ const sendNotice = () => {
|
||||
proxy.$message({ type: "success", message: "下发通知成功" });
|
||||
close();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
} finally {
|
||||
noticeLoading.value = false;
|
||||
}
|
||||
@ -405,7 +423,7 @@ const confirmJudgment = () => {
|
||||
proxy.$message({ type: "success", message: "确认研判成功" });
|
||||
close();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
} finally {
|
||||
confirmLoading.value = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user