feat:战术研判更新一次
This commit is contained in:
@ -8,20 +8,19 @@
|
||||
</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="380" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.scyq" type="textarea" :rows="3" :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,16 +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();
|
||||
@ -146,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%' },
|
||||
@ -175,18 +187,19 @@ 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
|
||||
// sjzlid: null, // 研判战略研判ID
|
||||
/** 部门代码 */
|
||||
ypbmdm: item,
|
||||
ypbmmc: listQuery.value.jsdxBmMc[i],
|
||||
@ -202,13 +215,25 @@ 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) => {
|
||||
console.log('res: ', res);
|
||||
listQuery.value = res || {};
|
||||
/** @type {Array<JudgmentDept>} 参与研判部门数据数组 */
|
||||
const cyypList = Array.isArray(res.cyypList) ? res.cyypList : []
|
||||
listQuery.value.jsdxBmDm = cyypList.map(item => {
|
||||
return item.ypbmdm
|
||||
@ -218,21 +243,23 @@ 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,
|
||||
sjzlid: curr.sjzlid || null, // 研判战术研判ID
|
||||
sjzlid: curr.sjzlid || null, // 研判战略研判ID
|
||||
ypbmdm: item.ypbmdm,
|
||||
ypbmmc: listQuery.value.jsdxBmMc[i],
|
||||
/** 素材要求 */
|
||||
@ -263,9 +290,9 @@ const submit = () => {
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user