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 查询参数
@ -52,3 +91,19 @@ export const feedbackCommand = (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>
<!-- 数据整理 -->
<div class="dialog" v-if="dialogForm">
<div class="head_box">
<span class="title">数据整理{{ title }} </span>
@ -13,14 +14,14 @@
<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="280" align="center">
<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>
</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"
<UploadFile v-model="row.fj" :disabled="isDetail || (!isShiQingBaoZhongXin && !isAdd)" :limit="1" :isImg="false"
:isAll="true" />
</template>
</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 { getItem } from '@//utils/storage.js'
const emit = defineEmits(["updateDate", "getList"]);
const props = defineProps({
dict: Object
@ -108,7 +110,11 @@ const dialogForm = ref(false); //弹窗
const formData = ref([
]);
const { deptBizType, deptLevel, deptCode } = getItem('deptId')[0]
const isAdd = ref(true)
/** 当前是否是详情页 */
const isDetail = ref(false)
/** 登录人 */
const sfzh = getItem('idEntityCard')
/** 是否市情报指挥中心 */
@ -144,13 +150,13 @@ const rules = reactive({
watch(() => props.dict, (val) => {
if (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: "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%' },
{ label: "列表", prop: "bmList", type: "slot", width: '100%' },
{ label: "研判议题", prop: "ypyt", type: "input", width: '48%', disabled: isDetail.value },
{ label: "研判时间", prop: "ypsj", type: "datetime", width: '48%' , disabled: isDetail.value },
{ 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%' , disabled: isDetail.value },
{ label: "参与研判部门", prop: "jsdxBmDm", type: "department", multiple: true, depMc: 'jsdxBmMc', width: '48%' , disabled: isDetail.value },
{ label: "研判要求", prop: "ypyq", type: "textarea", width: '100%' , disabled: isDetail.value },
{ label: "列表", prop: "bmList", type: "slot", width: '100%' },
]
}
})
@ -202,6 +208,13 @@ watch(() => listQuery.value.jsdxBmDm, (val) => {
const init = (type, row, wjlb) => {
dialogForm.value = true;
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 || {}
if (row) { getDataById(row.id) }
};

View File

@ -7,275 +7,145 @@
<el-button size="small" @click="close">关闭</el-button>
</div>
</div>
<div style="padding-bottom: 40px;" class="form_cnt">
<div class="form_cnt">
<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>
</div>
</div>
</template>
<script setup>
import { ref, reactive, computed, watch } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import FormMessage from '@/components/aboutTable/FormMessage.vue'
import UploadFile from "@/components/MyComponents/Upload/index.vue";
import {
sjzlGetEntityById,
sjzlCreateEntity,
sjzlUpdateEntity,
sjzlSendNotice,
sjzlConfirmJudgment
} from '@/api/yj.js'
//
import { getJudgmentCommandList, signCommand, feedbackCommand } from "@/api/huiShangyp/judgmentCommand.js";
import FormMessage from "@/components/aboutTable/FormMessage.vue";
import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, watch, computed } from "vue";
import { addJudgmentCommandList, editJudgmentCommand, getJudgmentCommandDetail } from "@/api/huiShangyp/judgmentCommand.js"
// import { getItem } from '@//utils/storage.js'
const emit = defineEmits(["updateDate", "getList"]);
const props = defineProps({
dict: {
type: Object,
default: () => ({})
}
})
dict: Object
});
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 title = ref('新增')
const loading = ref(false)
const elform = ref()
const listQuery = ref({}); //表单
const loading = ref(false);
const elform = ref();
const title = ref("");
const listQuery = ref({})
const tableList = ref([])
/** 外面行数据 */
const outRow = ref({})
// 表单配置
const formData = computed(() => [
{
label: '研判议题',
prop: 'ypyt',
type: 'input',
placeholder: '请输入研判议题',
required: true
},
{
label: '研判要求',
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 = reactive({
zlbt: [{ required: true, message: "请输入标题", trigger: "blur" }],
// zlnr: [{ required: true, message: "请输入内容", trigger: "change" }],
// zpbmList: [{ required: true, message: "请输选择部门", trigger: "change" }],
// 可以在这里添加表单验证规则
});
// watch(() => listQuery.value, (val) => {
// formData.value = [
// { 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 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) => {
title.value = type === 'add' ? '新增' : type === 'edit' ? '编辑' : '详情'
dialogForm.value = true
// 初始化数据
const init = (type, row) => {
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 () => {
if (!elform.value) return
try {
await elform.value.validate()
loading.value = true
const data = {
// 提交
const submit = () => {
elform.value.submit(async (data) => {
let params = {
...listQuery.value,
ypbmList: tableList.value
xfbmMc: listQuery.value.xfbmMc && listQuery.value.xfbmMc.toString()
};
try {
loading.value = true;
let res
if (title.value == "新增") {
res = await addJudgmentCommandList(params)
} else {
res = await editJudgmentCommand(params)
}
if (res && res > 0) {
loading.value = false;
proxy.$message({ type: "success", message: title.value + "成功" });
emit("getList");
close();
}
} catch (error) {
} finally {
loading.value = false;
}
});
};
if (title.value === '新增') {
await sjzlCreateEntity(data)
ElMessage.success('新增成功')
} else {
await sjzlUpdateEntity(data)
ElMessage.success('修改成功')
}
emit('getList')
close()
} catch (error) {
console.error('提交失败:', error)
} finally {
loading.value = false
}
}
// 关闭方法
// 关闭
const close = () => {
dialogForm.value = false
listQuery.value = {}
tableList.value = []
}
listQuery.value = {};
dialogForm.value = false;
loading.value = false;
};
// 修改状态
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
})
defineExpose({ init });
</script>
<style lang="scss" scoped>
.dialog {
position: fixed;
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;
@import "~@/assets/css/layout.scss";
@import "~@/assets/css/element-plus.scss";
.head_box {
display: flex;
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;
}
::v-deep .form-item-box {
width: 100% !important;
}
.table-box {
margin-top: 10px;
.bottom-actions {
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>

View File

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

View File

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

View File

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

View File

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