feat:再次调整

This commit is contained in:
2025-12-10 23:09:53 +08:00
parent dd7e06d5f6
commit 9d783ea9b5
7 changed files with 200 additions and 265 deletions

View File

@ -3,6 +3,45 @@ const api = "/mosty-api/mosty-gsxt";
// =================== 指令 ==================== // =================== 指令 ====================
/**
* 新增研判报告-指令信息
* @param {Object} data 新增参数
* @param {string} data.zlbt 指令标题
* @param {string} data.zlnr 指令内容
* @param {string[]} data.zpbmList 指派部门编码集合
*/
export const addJudgmentCommandList = (data) => {
return request({
url: api + `/ypbg/zlxx/addEntity`,
method: "post",
data
})
}
/**
* 修改研判指令
* @param {Object} data 修改参数
* @returns {Promise} 请求Promise对象
*/
export const editJudgmentCommand = (data) => {
return request({
url: api + `/ypbg/zlxx/editEntity`,
method: "put",
data
})
}
/**
* 研判指令详情
* @param {string|number} id 指令ID
* @returns {Promise} 请求Promise对象
*/
export const getJudgmentCommandDetail = (id) => {
return request({
url: api + `/ypbg/zlxx/${id}`,
method: "get"
})
}
/** /**
* 研判指令列表 * 研判指令列表
* @param {Object} params 查询参数 * @param {Object} params 查询参数
@ -52,3 +91,19 @@ export const feedbackCommand = (data) => {
data data
}) })
} }
/**
* 删除研判指令
* @param {Object} data 删除参数
* @param {string[]} data.ids ID集合
* @returns {Promise} 请求Promise对象
*/
export const deleteJudgmentCommand = (data) => {
return request({
url: api + `/ypbg/zlxx/deleteEntity`,
method: "delete",
data
})
}

View File

@ -1,4 +1,5 @@
<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>
@ -13,14 +14,14 @@
<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="280" align="center"> <el-table-column label="素材要求" width="280" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-input v-model="row.scyq" :disabled="!isShiQingBaoZhongXin" placeholder="请输入研判素材" /> <el-input v-model="row.scyq" type="textarea" :rows="4" :disabled="isDetail || !isShiQingBaoZhongXin" 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="!isShiQingBaoZhongXin" :limit="1" :isImg="false" <UploadFile v-model="row.fj" :disabled="isDetail || (!isShiQingBaoZhongXin && !isAdd)" :limit="1" :isImg="false"
:isAll="true" /> :isAll="true" />
</template> </template>
</el-table-column> </el-table-column>
@ -98,6 +99,7 @@ import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, watch, co
import { sjzlAddEntity, sjzlEditEntity, sjzlGetInfo, sjzlPerfectlnfo, sjzlFstz, sjzlQryp, sjzlPerfectSorce } from '@//api/yj.js' import { sjzlAddEntity, sjzlEditEntity, sjzlGetInfo, sjzlPerfectlnfo, sjzlFstz, sjzlQryp, sjzlPerfectSorce } from '@//api/yj.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
@ -108,7 +110,11 @@ const dialogForm = ref(false); //弹窗
const formData = ref([ const formData = ref([
]); ]);
const { deptBizType, deptLevel, deptCode } = getItem('deptId')[0] const { deptBizType, deptLevel, deptCode } = getItem('deptId')[0]
const isAdd = ref(true)
/** 当前是否是详情页 */
const isDetail = ref(false)
/** 登录人 */ /** 登录人 */
const sfzh = getItem('idEntityCard') const sfzh = getItem('idEntityCard')
/** 是否市情报指挥中心 */ /** 是否市情报指挥中心 */
@ -144,12 +150,12 @@ const rules = reactive({
watch(() => props.dict, (val) => { watch(() => props.dict, (val) => {
if (val) { if (val) {
formData.value = [ formData.value = [
{ label: "研判议题", prop: "ypyt", type: "input", width: '48%' }, { label: "研判议题", prop: "ypyt", type: "input", width: '48%', disabled: isDetail.value },
{ label: "研判时间", prop: "ypsj", type: "datetime", width: '48%' }, { label: "研判时间", prop: "ypsj", type: "datetime", width: '48%' , disabled: isDetail.value },
{ 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: isDetail.value },
{ 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%' , disabled: isDetail.value },
{ label: "参与研判部门", prop: "jsdxBmDm", type: "department", multiple: true, depMc: 'jsdxBmMc', width: '48%' }, { label: "参与研判部门", prop: "jsdxBmDm", type: "department", multiple: true, depMc: 'jsdxBmMc', width: '48%' , disabled: isDetail.value },
{ label: "研判要求", prop: "ypyq", type: "textarea", width: '100%' }, { label: "研判要求", prop: "ypyq", type: "textarea", width: '100%' , disabled: isDetail.value },
{ label: "列表", prop: "bmList", type: "slot", width: '100%' }, { label: "列表", prop: "bmList", type: "slot", width: '100%' },
] ]
} }
@ -202,6 +208,13 @@ 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" ? "编辑" : "详情";
isAdd.value = type == 'add'
isDetail.value = type != 'add' && type != 'edit'
// 设置禁用
formData.value = formData.value.map(item => {
item.disabled = isDetail.value
return item
})
outRow.value = row || {} outRow.value = row || {}
if (row) { getDataById(row.id) } if (row) { getDataById(row.id) }
}; };

View File

@ -7,275 +7,145 @@
<el-button size="small" @click="close">关闭</el-button> <el-button size="small" @click="close">关闭</el-button>
</div> </div>
</div> </div>
<div style="padding-bottom: 40px;" class="form_cnt"> <div class="form_cnt">
<FormMessage v-model="listQuery" :formList="formData" ref="elform" :rules="rules"> <FormMessage v-model="listQuery" :formList="formData" ref="elform" :rules="rules">
<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">
<template #default="{ row }">
<el-input v-model="row.scyq" :disabled="!isShiQingBaoZhongXin" placeholder="请输入研判素材" />
</template>
</el-table-column>
<el-table-column label="附件" width="200" align="center">
<template #default="{ row }">
<UploadFile v-model="row.fj" :disabled="!isShiQingBaoZhongXin" :limit="1" :isImg="false"
:isAll="true" />
</template>
</el-table-column>
<el-table-column prop="wcqk" label="完成状态" width="120" align="center">
<template #default="{ row }">
<el-tag :type="row.wcqk === '02' ? 'success' : 'warning'">
{{ row.wcqk == '01' ? '准备中' : '已完成' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="200" align="center">
<template #default="{ row }">
<el-button type="text" size="small" @click="updateStatus(row)" :disabled="updateDis(row)">
修改状态
</el-button>
<el-button type="text" size="small" @click="submitMaterial(row)" :disabled="updateDis(row)">
提交素材
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
</FormMessage> </FormMessage>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
import { ref, reactive, computed, watch } from 'vue' import FormMessage from "@/components/aboutTable/FormMessage.vue";
import { ElMessage, ElMessageBox } from 'element-plus' import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, watch, computed } from "vue";
import FormMessage from '@/components/aboutTable/FormMessage.vue' import { addJudgmentCommandList, editJudgmentCommand, getJudgmentCommandDetail } from "@/api/huiShangyp/judgmentCommand.js"
import UploadFile from "@/components/MyComponents/Upload/index.vue"; // import { getItem } from '@//utils/storage.js'
import {
sjzlGetEntityById,
sjzlCreateEntity,
sjzlUpdateEntity,
sjzlSendNotice,
sjzlConfirmJudgment
} from '@/api/yj.js'
//
import { getJudgmentCommandList, signCommand, feedbackCommand } from "@/api/huiShangyp/judgmentCommand.js";
const emit = defineEmits(["updateDate", "getList"]);
const props = defineProps({ const props = defineProps({
dict: { dict: Object
type: Object, });
default: () => ({}) const imgMsg = ref([])
} const { proxy } = getCurrentInstance();
}) const dialogForm = ref(false); //弹窗
const formData = ref([
{ label: "指令标题", prop: "zlbt", type: "input", width: '48%' },
{ label: "指派部门", prop: "zpbmList", type: "department", multiple: true, depMc: 'xfbmMc', width: '48%' },
{ label: "指令内容", prop: "zlnr", type: "textarea", width: '100%' },
]);
// const { deptBizType, deptLevel, deptCode } = getItem('deptId')[0]
const dialogForm = ref(false) const listQuery = ref({}); //表单
const title = ref('新增') const loading = ref(false);
const loading = ref(false) const elform = ref();
const elform = ref() const title = ref("");
const listQuery = ref({}) /** 外面行数据 */
const tableList = ref([]) const outRow = ref({})
// 表单配置 const rules = reactive({
const formData = computed(() => [ zlbt: [{ required: true, message: "请输入标题", trigger: "blur" }],
{ // zlnr: [{ required: true, message: "请输入内容", trigger: "change" }],
label: '研判议题', // zpbmList: [{ required: true, message: "请输选择部门", trigger: "change" }],
prop: 'ypyt', // 可以在这里添加表单验证规则
type: 'input', });
placeholder: '请输入研判议题', // watch(() => listQuery.value, (val) => {
required: true // formData.value = [
}, // { label: "指令标题", prop: "zlbt ", type: "input", width: '48%' },
{ // { label: "指派部门", prop: "zpbmList", type: "department", multiple: true, depMc: 'xfbmMc', width: '48%' },
label: '研判要求', // { label: "指令内容", prop: "zlnr", type: "textarea", width: '100%' },
prop: 'ypyq', // ]
type: 'textarea', // })
placeholder: '请输入研判要求',
required: true
},
{
label: '研判方式',
prop: 'ypfs',
type: 'select',
placeholder: '请选择研判方式',
options: props.dict.D_BZ_YPFS || [],
required: true
},
{
label: '研判时间',
prop: 'ypsj',
type: 'datetime',
placeholder: '请选择研判时间',
required: true
},
{
label: '报告类型',
prop: 'bglx',
type: 'radio',
placeholder: '请选择报告类型',
options: props.dict.D_BZ_YPLX || [],
required: true,
defaultValue: '02'
},
{
label: '部门列表',
prop: 'bmList',
type: 'slot',
slotName: 'bmList'
}
])
// 验证规则
const rules = {
ypyt: [{ required: true, message: '请输入研判议题', trigger: 'blur' }],
ypyq: [{ required: true, message: '请输入研判要求', trigger: 'blur' }],
ypfs: [{ required: true, message: '请选择研判方式', trigger: 'change' }],
ypsj: [{ required: true, message: '请选择研判时间', trigger: 'change' }],
bglx: [{ required: true, message: '请选择报告类型', trigger: 'change' }]
}
const isShiQingBaoZhongXin = computed(() => {
// 这里根据实际情况判断是否是市情报指挥中心
return true
})
// 初始化方法 // 初始化数据
const init = async (type, row, reportType) => { const init = (type, row) => {
title.value = type === 'add' ? '新增' : type === 'edit' ? '编辑' : '详情' dialogForm.value = true;
dialogForm.value = true title.value = type == "add" ? "新增" : type == "edit" ? "编辑" : "详情";
outRow.value = row || {}
if (row) { getDataById(row.id) }
};
// 根据id查询详情
const getDataById = (id) => {
getJudgmentCommandDetail(id).then((res) => {
console.log('res: ', res);
listQuery.value = res || {};
// const cyypList = Array.isArray(res.cyypList) ? res.cyypList : []
// listQuery.value.zpbmList = cyypList.map(item => {
// return item.ypbmdm
// })
// const xfbmMc = res.xfbmMc
});
};
if (type === 'add') {
listQuery.value = {
bglx: reportType,
wjlx: reportType
}
tableList.value = []
} else if (row && row.id) {
try {
const res = await sjzlGetEntityById({ id: row.id })
listQuery.value = res
tableList.value = res.ypbmList || []
} catch (error) {
ElMessage.error('获取详情失败')
}
}
}
// 提交方法 // 提交
const submit = async () => { const submit = () => {
if (!elform.value) return elform.value.submit(async (data) => {
let params = {
try {
await elform.value.validate()
loading.value = true
const data = {
...listQuery.value, ...listQuery.value,
ypbmList: tableList.value xfbmMc: listQuery.value.xfbmMc && listQuery.value.xfbmMc.toString()
} };
try {
if (title.value === '新增') { loading.value = true;
await sjzlCreateEntity(data) let res
ElMessage.success('新增成功') if (title.value == "新增") {
res = await addJudgmentCommandList(params)
} else { } else {
await sjzlUpdateEntity(data) res = await editJudgmentCommand(params)
ElMessage.success('修改成功') }
if (res && res > 0) {
loading.value = false;
proxy.$message({ type: "success", message: title.value + "成功" });
emit("getList");
close();
} }
emit('getList')
close()
} catch (error) { } catch (error) {
console.error('提交失败:', error)
} finally { } finally {
loading.value = false loading.value = false;
} }
} });
};
// 关闭方法
// 关闭
const close = () => { const close = () => {
dialogForm.value = false listQuery.value = {};
listQuery.value = {} dialogForm.value = false;
tableList.value = [] loading.value = false;
} };
// 修改状态 defineExpose({ init });
const updateStatus = (row) => {
ElMessageBox.prompt('请输入状态', '修改状态', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value }) => {
row.wcqk = value
ElMessage.success('修改成功')
})
}
// 提交素材
const submitMaterial = (row) => {
ElMessage.success('提交成功')
}
const updateDis = (row) => {
return !isShiQingBaoZhongXin.value || row.wcqk === '02'
}
const emit = defineEmits(['getList'])
defineExpose({
init
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.dialog { @import "~@/assets/css/layout.scss";
position: fixed; @import "~@/assets/css/element-plus.scss";
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
.head_box { ::v-deep .form-item-box {
display: flex; width: 100% !important;
justify-content: space-between;
align-items: center;
padding: 20px;
background: #fff;
border-bottom: 1px solid #ebeef5;
.title {
font-size: 16px;
font-weight: 600;
}
}
.form_cnt {
background: #fff;
padding: 20px;
max-height: 70vh;
overflow-y: auto;
}
.bottom-actions {
background: #fff;
padding: 20px;
border-top: 1px solid #ebeef5;
text-align: center;
}
} }
.table-box { .bottom-actions {
margin-top: 10px; position: absolute;
bottom: 0;
left: 50%;
display: flex;
justify-content: center;
gap: 10px;
width: 100%;
transform: translateX(-50%);
padding: 10px 20px;
border-radius: 4px;
background: white;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
// z-index: 1000;
} }
</style> </style>

View File

@ -47,8 +47,8 @@ import MyTable from "@/components/aboutTable/MyTable.vue";
import Pages from "@/components/aboutTable/Pages.vue"; import Pages from "@/components/aboutTable/Pages.vue";
import Search from "@/components/aboutTable/Search.vue"; import Search from "@/components/aboutTable/Search.vue";
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { getJudgmentCommandList, signCommand, feedbackCommand } from "@/api/huiShangyp/judgmentCommand.js"; import { getJudgmentCommandList, deleteJudgmentCommand } from "@/api/huiShangyp/judgmentCommand.js";
import { reactive, ref, onMounted, getCurrentInstance, watch,computed } from "vue"; import { reactive, ref, onMounted, getCurrentInstance, watch, computed } from "vue";
import AddForm from "./addForm.vue"; import AddForm from "./addForm.vue";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const { D_BZ_YPFS, D_BZ_YPLX } = proxy.$dict("D_BZ_YPFS", "D_BZ_YPLX") const { D_BZ_YPFS, D_BZ_YPLX } = proxy.$dict("D_BZ_YPFS", "D_BZ_YPLX")
@ -67,7 +67,7 @@ onMounted(() => {
const searchConfiger = ref([ const searchConfiger = ref([
{ label: "研判议题", prop: 'ypyt', placeholder: "请输入研判议题", showType: "input" }, { label: "指令标题", prop: 'zlbt', placeholder: "请输入研判议题", showType: "input" },
// { label: "研判方式", prop: 'ypfs', placeholder: "请输入研判方式", showType: "radio",options:D_BZ_YPFS }, // { label: "研判方式", prop: 'ypfs', placeholder: "请输入研判方式", showType: "radio",options:D_BZ_YPFS },
]); ]);
@ -86,12 +86,9 @@ const pageData = reactive({
}, },
controlsWidth: 240, controlsWidth: 240,
tableColumn: [ tableColumn: [
{ label: "研判议题", prop: "ypyt" }, { label: "指令标题", prop: "zlbt" },
{ label: "研判方式", prop: "ypfs", showSolt: true }, { label: "指令内容", prop: "zlnr", },
{ label: "报告类型", prop: "bglx", showSolt: true }, { label: "部门", prop: "xfbmMc" },
{ label: "研判时间", prop: "ypsj" },
{ label: "研判要求", prop: "ypyq" },
{ label: "发起部门", prop: "ssbm" },
] ]
}); });
const queryFrom = ref({}); const queryFrom = ref({});
@ -119,7 +116,7 @@ const changeSize = (val) => {
// 获取列表 // 获取列表
const getList = () => { const getList = () => {
pageData.tableConfiger.loading = true; pageData.tableConfiger.loading = true;
let data = { ...pageData.pageConfiger, ...queryFrom.value, wjlb: '01' }; let data = { ...pageData.pageConfiger, ...queryFrom.value };
getJudgmentCommandList(data).then(res => { getJudgmentCommandList(data).then(res => {
pageData.tableData = res.records || []; pageData.tableData = res.records || [];
pageData.total = res.total; pageData.total = res.total;
@ -131,7 +128,7 @@ const getList = () => {
// 表格高度计算 // 表格高度计算
const tabHeightFn = () => { const tabHeightFn = () => {
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 250; pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 250;
window.onresize = function () { window.onresize = function() {
tabHeightFn(); tabHeightFn();
}; };
}; };
@ -148,7 +145,7 @@ const deleteFile = (row) => {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
sjzldeleteEntity({ ids: [row.id] }).then(res => { deleteJudgmentCommand({ ids: [row.id] }).then(res => {
proxy.$message.success('删除成功'); proxy.$message.success('删除成功');
getList(); getList();
}).catch(() => { }).catch(() => {

View File

@ -6,7 +6,7 @@
<el-icon style="vertical-align: middle"> <el-icon style="vertical-align: middle">
<CirclePlus /> <CirclePlus />
</el-icon> </el-icon>
<span style="vertical-align: middle">新增</span> <!-- <span style="vertical-align: middle">新增</span> -->
</el-button> </el-button>
</PageTitle> </PageTitle>

View File

@ -13,9 +13,9 @@
<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="280" align="center"> <el-table-column label="研判素材" width="380" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-input v-model="row.scyq" :disabled="!isShiQingBaoZhongXin" placeholder="请输入研判素材" /> <el-input v-model="row.scyq" type="textarea" :rows="3" :disabled="!isShiQingBaoZhongXin" 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">

View File

@ -6,7 +6,7 @@
<el-icon style="vertical-align: middle"> <el-icon style="vertical-align: middle">
<CirclePlus /> <CirclePlus />
</el-icon> </el-icon>
<span style="vertical-align: middle">新增</span> <!-- <span style="vertical-align: middle">新增</span> -->
</el-button> </el-button>
</PageTitle> </PageTitle>