feat: 先更新一次研判指令
This commit is contained in:
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
Reference in New Issue
Block a user