feat: 先更新一次研判指令
This commit is contained in:
54
src/api/huiShangyp/judgmentCommand.js
Normal file
54
src/api/huiShangyp/judgmentCommand.js
Normal 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
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -46,19 +46,15 @@
|
|||||||
</template>
|
</template>
|
||||||
</FormMessage>
|
</FormMessage>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, computed, watch } from 'vue'
|
import { ref, reactive, computed, watch } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import FormMessage from '@/components/FormMessage/index.vue'
|
import FormMessage from '@/components/aboutTable/FormMessage.vue'
|
||||||
import UploadFile from '@/components/UploadFile/index.vue'
|
import UploadFile from "@/components/MyComponents/Upload/index.vue";
|
||||||
import {
|
import {
|
||||||
sjzlGetEntityById,
|
sjzlGetEntityById,
|
||||||
sjzlCreateEntity,
|
sjzlCreateEntity,
|
||||||
@ -66,7 +62,9 @@ import {
|
|||||||
sjzlSendNotice,
|
sjzlSendNotice,
|
||||||
sjzlConfirmJudgment
|
sjzlConfirmJudgment
|
||||||
} from '@/api/yj.js'
|
} from '@/api/yj.js'
|
||||||
import { startJudgment, endJudgment } from '@/api/tacticalApi.js'
|
//
|
||||||
|
import { getJudgmentCommandList, signCommand, feedbackCommand } from "@/api/huiShangyp/judgmentCommand.js";
|
||||||
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
dict: {
|
dict: {
|
||||||
@ -149,7 +147,7 @@ const isShiQingBaoZhongXin = computed(() => {
|
|||||||
const init = async (type, row, reportType) => {
|
const init = async (type, row, reportType) => {
|
||||||
title.value = type === 'add' ? '新增' : type === 'edit' ? '编辑' : '详情'
|
title.value = type === 'add' ? '新增' : type === 'edit' ? '编辑' : '详情'
|
||||||
dialogForm.value = true
|
dialogForm.value = true
|
||||||
|
|
||||||
if (type === 'add') {
|
if (type === 'add') {
|
||||||
listQuery.value = {
|
listQuery.value = {
|
||||||
bglx: reportType,
|
bglx: reportType,
|
||||||
@ -170,16 +168,16 @@ const init = async (type, row, reportType) => {
|
|||||||
// 提交方法
|
// 提交方法
|
||||||
const submit = async () => {
|
const submit = async () => {
|
||||||
if (!elform.value) return
|
if (!elform.value) return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await elform.value.validate()
|
await elform.value.validate()
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
...listQuery.value,
|
...listQuery.value,
|
||||||
ypbmList: tableList.value
|
ypbmList: tableList.value
|
||||||
}
|
}
|
||||||
|
|
||||||
if (title.value === '新增') {
|
if (title.value === '新增') {
|
||||||
await sjzlCreateEntity(data)
|
await sjzlCreateEntity(data)
|
||||||
ElMessage.success('新增成功')
|
ElMessage.success('新增成功')
|
||||||
@ -187,7 +185,7 @@ const submit = async () => {
|
|||||||
await sjzlUpdateEntity(data)
|
await sjzlUpdateEntity(data)
|
||||||
ElMessage.success('修改成功')
|
ElMessage.success('修改成功')
|
||||||
}
|
}
|
||||||
|
|
||||||
emit('getList')
|
emit('getList')
|
||||||
close()
|
close()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -220,60 +218,13 @@ const submitMaterial = (row) => {
|
|||||||
ElMessage.success('提交成功')
|
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) => {
|
const updateDis = (row) => {
|
||||||
return !isShiQingBaoZhongXin.value || row.wcqk === '02'
|
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'])
|
const emit = defineEmits(['getList'])
|
||||||
|
|
||||||
@ -327,4 +278,4 @@ defineExpose({
|
|||||||
.table-box {
|
.table-box {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -47,7 +47,7 @@ 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 { 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 { reactive, ref, onMounted, getCurrentInstance, watch,computed } from "vue";
|
||||||
import AddForm from "./addForm.vue";
|
import AddForm from "./addForm.vue";
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
@ -64,11 +64,7 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
getList()
|
getList()
|
||||||
});
|
});
|
||||||
/** 是否市情报指挥中心 */
|
|
||||||
const isShiQingBaoZhongXin = computed(() => {
|
|
||||||
const Jb = deptLevel[0] == '2' ? '01' : deptLevel[0] == '3' ? '02' : '03'
|
|
||||||
return deptBizType == '23' && Jb == '01'
|
|
||||||
})
|
|
||||||
|
|
||||||
const searchConfiger = ref([
|
const searchConfiger = ref([
|
||||||
{ label: "研判议题", prop: 'ypyt', placeholder: "请输入研判议题", showType: "input" },
|
{ label: "研判议题", prop: 'ypyt', placeholder: "请输入研判议题", showType: "input" },
|
||||||
@ -124,7 +120,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, wjlb: '01' };
|
||||||
sjzlGetPageList(data).then(res => {
|
getJudgmentCommandList(data).then(res => {
|
||||||
pageData.tableData = res.records || [];
|
pageData.tableData = res.records || [];
|
||||||
pageData.total = res.total;
|
pageData.total = res.total;
|
||||||
pageData.tableConfiger.loading = false;
|
pageData.tableConfiger.loading = false;
|
||||||
@ -197,4 +193,4 @@ const deleteFile = (row) => {
|
|||||||
height: calc(100% - 50px);
|
height: calc(100% - 50px);
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user