feat: 先更新一次研判指令

This commit is contained in:
2025-12-10 20:08:10 +08:00
parent b9396bb37f
commit 22a8381247
3 changed files with 71 additions and 70 deletions

View File

@ -0,0 +1,54 @@
import request from "@/utils/request";
const api = "/mosty-api/mosty-gsxt";
// =================== 指令 ====================
/**
* 研判指令列表
* @param {Object} params 查询参数
* @param {number} [params.pageSize] 每页显示数量
* @param {number} [params.pageCurrent] 页码
* @param {string} [params.zlbt] 指令标题
* @param {string} [params.zlnr] 指令内容
* @param {string} [params.fqrxm] 发起人姓名
* @returns {Promise} 请求Promise对象
*/
export const getJudgmentCommandList = (params) => {
return request({
url: api + `/ypbg/zlxx/getPageList`,
method: "get",
params
})
}
/**
* 指令签收
* @param {Object} data 签收数据
* @param {string|number} data.zlid 指令ID签收必传
* @param {string} [data.bglx] 报告类型01 战术报告 02 战略报告
* @param {string} [data.ypid] 研判业务ID(研判报告ID)
* @returns {Promise} 请求Promise对象
*/
export const signCommand = (data) => {
return request({
url: api + `/ypbg/zlxx/zlqs`,
method: "post",
data
})
}
/**
* 指令反馈
* @param {Object} data 反馈数据
* @param {string|number} data.zlid 指令ID反馈必传
* @param {string} data.bglx 报告类型01 战术报告 02 战略报告(反馈必传)
* @param {string} data.ypid 研判业务ID(研判报告ID)(反馈必传)
* @returns {Promise} 请求Promise对象
*/
export const feedbackCommand = (data) => {
return request({
url: api + `/ypbg/zlxx/zlfk`,
method: "post",
data
})
}

View File

@ -46,19 +46,15 @@
</template>
</FormMessage>
</div>
<!-- 底部按钮 -->
<div class="bottom-actions" v-if="title !== '新增' && listQuery.id">
<el-button type="primary" size="small" @click="handleStartJudgment" :disabled="statusDis('开始研判')">开始研判</el-button>
<el-button type="primary" size="small" @click="handleEndJudgment" :disabled="statusDis('结束研判')">结束研判</el-button>
</div>
</div>
</template>
<script setup>
import { ref, reactive, computed, watch } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import FormMessage from '@/components/FormMessage/index.vue'
import UploadFile from '@/components/UploadFile/index.vue'
import FormMessage from '@/components/aboutTable/FormMessage.vue'
import UploadFile from "@/components/MyComponents/Upload/index.vue";
import {
sjzlGetEntityById,
sjzlCreateEntity,
@ -66,7 +62,9 @@ import {
sjzlSendNotice,
sjzlConfirmJudgment
} from '@/api/yj.js'
import { startJudgment, endJudgment } from '@/api/tacticalApi.js'
//
import { getJudgmentCommandList, signCommand, feedbackCommand } from "@/api/huiShangyp/judgmentCommand.js";
const props = defineProps({
dict: {
@ -149,7 +147,7 @@ const isShiQingBaoZhongXin = computed(() => {
const init = async (type, row, reportType) => {
title.value = type === 'add' ? '新增' : type === 'edit' ? '编辑' : '详情'
dialogForm.value = true
if (type === 'add') {
listQuery.value = {
bglx: reportType,
@ -170,16 +168,16 @@ const init = async (type, row, reportType) => {
// 提交方法
const submit = async () => {
if (!elform.value) return
try {
await elform.value.validate()
loading.value = true
const data = {
...listQuery.value,
ypbmList: tableList.value
}
if (title.value === '新增') {
await sjzlCreateEntity(data)
ElMessage.success('新增成功')
@ -187,7 +185,7 @@ const submit = async () => {
await sjzlUpdateEntity(data)
ElMessage.success('修改成功')
}
emit('getList')
close()
} catch (error) {
@ -220,60 +218,13 @@ const submitMaterial = (row) => {
ElMessage.success('提交成功')
}
// 判断按钮是否禁用
const statusDis = (action) => {
if (!listQuery.value.zt) return true
if (action === '开始研判') {
return listQuery.value.zt !== '01'
} else if (action === '结束研判') {
return listQuery.value.zt !== '02'
}
return false
}
const updateDis = (row) => {
return !isShiQingBaoZhongXin.value || row.wcqk === '02'
}
// 开始研判
const handleStartJudgment = async () => {
try {
await ElMessageBox.confirm('确定要开始研判吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
await startJudgment(listQuery.value.id)
ElMessage.success('开始研判成功')
emit('getList')
close()
} catch (error) {
if (error !== 'cancel') {
ElMessage.error('开始研判失败')
}
}
}
// 结束研判
const handleEndJudgment = async () => {
try {
await ElMessageBox.confirm('确定要结束研判吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
await endJudgment(listQuery.value.id)
ElMessage.success('结束研判成功')
emit('getList')
close()
} catch (error) {
if (error !== 'cancel') {
ElMessage.error('结束研判失败')
}
}
}
const emit = defineEmits(['getList'])
@ -327,4 +278,4 @@ defineExpose({
.table-box {
margin-top: 10px;
}
</style>
</style>

View File

@ -47,7 +47,7 @@ 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 { sjzlGetPageList, sjzldeleteEntity } from "@/api/yj.js";
import { getJudgmentCommandList, signCommand, feedbackCommand } from "@/api/huiShangyp/judgmentCommand.js";
import { reactive, ref, onMounted, getCurrentInstance, watch,computed } from "vue";
import AddForm from "./addForm.vue";
const { proxy } = getCurrentInstance();
@ -64,11 +64,7 @@ onMounted(() => {
}
getList()
});
/** 是否市情报指挥中心 */
const isShiQingBaoZhongXin = computed(() => {
const Jb = deptLevel[0] == '2' ? '01' : deptLevel[0] == '3' ? '02' : '03'
return deptBizType == '23' && Jb == '01'
})
const searchConfiger = ref([
{ label: "研判议题", prop: 'ypyt', placeholder: "请输入研判议题", showType: "input" },
@ -124,7 +120,7 @@ const changeSize = (val) => {
const getList = () => {
pageData.tableConfiger.loading = true;
let data = { ...pageData.pageConfiger, ...queryFrom.value, wjlb: '01' };
sjzlGetPageList(data).then(res => {
getJudgmentCommandList(data).then(res => {
pageData.tableData = res.records || [];
pageData.total = res.total;
pageData.tableConfiger.loading = false;
@ -197,4 +193,4 @@ const deleteFile = (row) => {
height: calc(100% - 50px);
overflow: auto;
}
</style>
</style>