|
@@ -12,10 +12,21 @@
|
|
|
</el-form-item>
|
|
|
<el-row :span="24" :gutter="10">
|
|
|
<el-col :span="20" label="预案名称">
|
|
|
- <h2 key="planName" style="font-weight: bolder">{{ detailData.type }}</h2>
|
|
|
- </el-col>
|
|
|
+<!-- <h2 key="planName" style="font-weight: bolder">{{ detailData.type }}</h2>-->
|
|
|
+ <div class="td">
|
|
|
+ <template v-if="detailData.type === '0'">
|
|
|
+ <div>风险源排查</div>
|
|
|
+ </template>
|
|
|
+ <template v-if="detailData.type === '1'">
|
|
|
+ <div>隐患源排查</div>
|
|
|
+ </template>
|
|
|
+ <template v-if="detailData.type === '2'">
|
|
|
+ <div>危险源排查</div>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
<el-col :span="1.5">
|
|
|
- <el-button v-hasPermi="['system:menu:edit']" class="common-btn-text-primary" type="primary" @click="planUpdate()"> 编辑 </el-button>
|
|
|
+ <el-button class="common-btn-text-primary" type="primary" @click="planUpdate()"> 编辑 </el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button type="primary" @click="handlefinal"> 完结任务 </el-button>
|
|
@@ -35,9 +46,15 @@
|
|
|
<el-descriptions-item key="publishDate" label="创建时间:">{{ detailData.create_time }}</el-descriptions-item>
|
|
|
<el-descriptions-item key="organizingUnit" label="创建人:">{{ detailData.create_by }}</el-descriptions-item>
|
|
|
<el-descriptions-item key="publishDate" label="排查时间范围:">{{ detailData.task_time }}</el-descriptions-item>
|
|
|
- <el-descriptions-item key="publishDate" label="排查周期:">{{ detailData.cycle }}</el-descriptions-item>
|
|
|
- <el-descriptions-item key="publishDate" label="排查范围:">{{ detailData.task_range }}</el-descriptions-item>
|
|
|
- <el-descriptions-item key="event_type" label="任务状态:">{{ detailData.task_status }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item key="publishDate" label="排查周期:">
|
|
|
+ <dict-tag :options="risk_cycle" :value="detailData.cycle" style="display: inline-block" />
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item key="publishDate" label="排查范围:">
|
|
|
+ <dict-tag :options="risk_range" :value="detailData.task_range" style="display: inline-block" />
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item key="event_type" label="任务状态:">
|
|
|
+ <dict-tag :options="risk_status" :value="detailData.task_status" style="display: inline-block" />
|
|
|
+ </el-descriptions-item>
|
|
|
</el-descriptions>
|
|
|
</el-card>
|
|
|
<h3>子任务记录</h3>
|
|
@@ -72,36 +89,45 @@
|
|
|
<!-- 修改弹窗 -->
|
|
|
<el-dialog v-model="visible" title="修改任务" width="500px" append-to-body>
|
|
|
<el-form ref="demoFormRef" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-form-item label="风险源类型:" prop="planName">
|
|
|
- <el-input v-model="form.planName" placeholder="请选择风险源排查类型" />
|
|
|
+ <el-form-item label="风险源类型:" prop="type" >
|
|
|
+ <el-select v-model="form.type" placeholder="请选择风险源排查类型">
|
|
|
+ <el-option
|
|
|
+ v-for="item in risk_type"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="排查时间范围:" prop="publish">
|
|
|
+ <el-date-picker v-model="form.start_time" type="date" placeholder="选择开始日期" value-format="YYYY-MM-DD"></el-date-picker>
|
|
|
+ <el-date-picker v-model="form.end_time" type="date" placeholder="选择结束日期" value-format="YYYY-MM-DD"></el-date-picker>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="排查时间范围:" prop="publishDate">
|
|
|
- <el-date-picker v-model="dateRange" type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD"></el-date-picker>
|
|
|
+ <el-form-item label="排查周期:" prop="cycle">
|
|
|
+ <el-radio-group v-model="form.cycle">
|
|
|
+ <el-radio value="0" size="large">每年</el-radio>
|
|
|
+ <el-radio value="1" size="large">每月</el-radio>
|
|
|
+ <el-radio value="2" size="large">每周</el-radio>
|
|
|
+ <el-radio value="3" size="large">每天</el-radio>
|
|
|
+ <el-radio value="4" size="large">一次</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="排查周期:" prop="organizingUnit">
|
|
|
- <el-checkbox-group v-model="form.organizingUnit">
|
|
|
- <el-checkbox label="选项1">每年</el-checkbox>
|
|
|
- <el-checkbox label="选项2">每月</el-checkbox>
|
|
|
- <el-checkbox label="选项3">每周</el-checkbox>
|
|
|
- <el-checkbox label="选项4">每天</el-checkbox>
|
|
|
- <el-checkbox label="选项4">一次</el-checkbox>
|
|
|
- </el-checkbox-group>
|
|
|
+ <el-form-item label="选择时间:" prop="corn_query">
|
|
|
+ <el-date-picker v-model="form.corn_query" type="dates" placeholder="选择日期时间"></el-date-picker>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="排查范围:" prop="organizingUnit">
|
|
|
- <el-checkbox-group v-model="form.organizingUnit">
|
|
|
- <el-checkbox label="选项1">市级</el-checkbox>
|
|
|
- <el-checkbox label="选项2">区县级</el-checkbox>
|
|
|
- <el-checkbox label="选项3">镇街级</el-checkbox>
|
|
|
- <el-checkbox label="选项4">村居量</el-checkbox>
|
|
|
- </el-checkbox-group>
|
|
|
+ <el-form-item label="排查范围:" prop="task_range">
|
|
|
+ <el-radio-group v-model="form.task_range">
|
|
|
+ <el-radio value="0" size="large">市级</el-radio>
|
|
|
+ <el-radio value="1" size="large">区县级</el-radio>
|
|
|
+ <el-radio value="2" size="large">镇街级</el-radio>
|
|
|
+ <el-radio value="3" size="large">村居级</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <template #footer>
|
|
|
- <div class="dialog-footer">
|
|
|
- <el-button :loading="buttonLoading" type="primary" @click="submitForm">确定</el-button>
|
|
|
- <el-button @click="cancel">取消</el-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+ <div class="common-dialog-footer" style="display: flex; justify-content: center">
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -110,7 +136,7 @@
|
|
|
import { to } from 'await-to-js';
|
|
|
import { deletePlan, getPlanDetail} from '@/api/riskPrevention/planManage';
|
|
|
import { ElMessageBox } from 'element-plus';
|
|
|
-import {getRiskDetail, updatetask} from "@/api/inspectionWork/riskManagement";
|
|
|
+import {deleteRisk, getRiskDetail, updatetask} from "@/api/inspectionWork/riskManagement";
|
|
|
const router = useRouter();
|
|
|
|
|
|
const goBack = () => {
|
|
@@ -119,7 +145,7 @@ const goBack = () => {
|
|
|
|
|
|
const route = useRoute();
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
-const { mm_event_type, risk_type } = toRefs<any>(proxy?.useDict('risk_type', 'mm_event_type'));
|
|
|
+const { mm_event_type, risk_type,risk_range,risk_cycle,risk_status } = toRefs<any>(proxy?.useDict('risk_type', 'mm_event_type', 'risk_range','risk_cycle','risk_status'));
|
|
|
|
|
|
//已完成/未完成的页面跳转
|
|
|
const handleClick = (value: number, type: string) => {
|
|
@@ -138,15 +164,13 @@ const handleClick = (value: number, type: string) => {
|
|
|
|
|
|
// 预案编辑
|
|
|
let detailData = ref({
|
|
|
- id: '',
|
|
|
- task_number: '',
|
|
|
+ // id: '',
|
|
|
type: '',
|
|
|
- task_time: '',
|
|
|
+ start_time: '',
|
|
|
+ end_time: '',
|
|
|
cycle: '',
|
|
|
- task_range: '',
|
|
|
- task_status: '',
|
|
|
- create_by: '',
|
|
|
- create_time: ''
|
|
|
+ corn_query: '',
|
|
|
+ task_range: ''
|
|
|
});
|
|
|
let id = ref();
|
|
|
let task_number = ref();
|
|
@@ -168,30 +192,37 @@ let form = ref({
|
|
|
/** 编辑按钮操作 */
|
|
|
const planUpdate = async () => {
|
|
|
resetForm();
|
|
|
- const res = await getRiskDetail(id.value);
|
|
|
+ const res = await getRiskDetail(route.query.id);
|
|
|
form.value = res.data;
|
|
|
visible.value = true;
|
|
|
};
|
|
|
|
|
|
-const handlefinal = () => {
|
|
|
- ElMessageBox.confirm('确定要完结任务吗?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- // 用户点击“确定”时的逻辑
|
|
|
- console.log('任务已完结');
|
|
|
- // 可以在这里添加更多完结任务的逻辑
|
|
|
- }).catch(() => {
|
|
|
- // 用户点击“取消”时的逻辑
|
|
|
- console.log('任务未完结');
|
|
|
- });
|
|
|
+const handlefinal = async () => {
|
|
|
+ try {
|
|
|
+ const confirmed = await ElMessageBox.confirm('确定要完结任务吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ if (confirmed) {
|
|
|
+ try {
|
|
|
+ await updatetask({ id: route.query.id, task_status: '3' });
|
|
|
+ console.log(`任务 ${route.query.id} 已完结`);
|
|
|
+ // getList();
|
|
|
+ } catch (error) {
|
|
|
+ console.error(`任务 ${route.query.id} 完结失败:`, error);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log(`任务 ${route.query.id} 未完结`);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('确认对话框处理失败:', error);
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
const resetForm = () => {
|
|
|
form.value = {
|
|
|
id: '',
|
|
|
- task_number: '',
|
|
|
type: '',
|
|
|
start_time: '',
|
|
|
end_time: '',
|
|
@@ -205,7 +236,7 @@ const resetForm = () => {
|
|
|
const handleDelete = async () => {
|
|
|
const [err] = await to(proxy?.$modal.confirm('是否确认删除该条预案?') as any);
|
|
|
if (!err) {
|
|
|
- await deletePlan([detailData.value.planId]);
|
|
|
+ await deleteRisk([detailData.value.id]);
|
|
|
proxy?.$modal.msgSuccess('删除成功');
|
|
|
router.go(-1);
|
|
|
}
|
|
@@ -224,7 +255,7 @@ const submitForm = () => {
|
|
|
await updatetask(form.value);
|
|
|
proxy?.$modal.msgSuccess('修改成功');
|
|
|
visible.value = false;
|
|
|
- getPlanDetail(task_number.value).then((res) => {
|
|
|
+ getRiskDetail(route.query.id).then((res) => {
|
|
|
detailData.value = res.data;
|
|
|
});
|
|
|
} finally {
|
|
@@ -234,7 +265,6 @@ const submitForm = () => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-const baseUrl = import.meta.env.VITE_APP_BASE_API;
|
|
|
|
|
|
|
|
|
onMounted(() => {
|