libushang 4 ay önce
ebeveyn
işleme
84179a54fb

+ 9 - 0
src/api/emergencyCommandMap/JointDuty.ts

@@ -85,6 +85,15 @@ export function updateTaskRegistration(data) {
   });
 }
 
+// 领导批示(针对任务)
+export function addLeaderInstruction(data) {
+  return request({
+    url: "/api/taskRegistration/leader_request",
+    method: "post",
+    data: data
+  });
+}
+
 // 查看事业单位
 export function getUnits(params) {
   return request({

+ 43 - 7
src/views/emergencyCommandMap/RightSection/LeaderInstruction.vue

@@ -1,14 +1,21 @@
 <template>
-  <Dialog draggable custom-show type="sm" title="领导批示" height="550px" @close="handleClose" @confirm="handleSubmit">
+  <Dialog draggable custom-show type="sm" title="领导批示" height="780px" @close="handleClose" @confirm="handleSubmit">
     <el-form ref="formRef" :model="form" :rules="rules">
-      <el-form-item label="领导审批" label-width="200px" prop="content">
-        <el-input v-model="form.content" class="custom-input2" clearable placeholder="请输入领导审批意见" />
+      <el-form-item label="领导单位:" label-width="240px" prop="leader_unit">
+        <el-input v-model="form.leader_unit" class="custom-input2" clearable placeholder="请输入领导单位" />
+      </el-form-item>
+      <el-form-item label="领导姓名:" label-width="240px" prop="leader_name">
+        <el-input v-model="form.leader_name" class="custom-input2" clearable placeholder="请输入领导姓名" />
+      </el-form-item>
+      <el-form-item label="领导批示:" label-width="240px" prop="content">
+        <el-input v-model="form.content" class="custom-input2" clearable placeholder="请输入领导批示" />
       </el-form-item>
     </el-form>
   </Dialog>
 </template>
 
 <script lang="ts" setup>
+import { addLeaderInstruction } from '@/api/emergencyCommandMap/JointDuty';
 import { showSuccessMsg } from '@/utils/notification';
 
 const props = defineProps({
@@ -17,15 +24,34 @@ const props = defineProps({
   },
   id: {
     type: String
+  },
+  task_id: {
+    type: String
   }
 });
 const emits = defineEmits(['update:modelValue', 'close', 'confirm']);
+// watch(
+//   () => props.task_id,
+//   (new_task_id) => {
+//     form.value.task_id = new_task_id;
+//     console.log('new_task_id', new_task_id);
+//   },
+//   { immediate: true }
+// );
+
 const formRef = ref();
 
 const form = ref({
-  content: ''
+  task_id: "",
+  content: "",
+  processing_status: "",
+  feeback_type: "1",
+  leader_unit: "",
+  leader_name: ""
 });
 const rules = {
+  leader_unit: [{ required: true, message: '领导单位不能为空', trigger: 'blur' }],
+  leader_name: [{ required: true, message: '领导姓名不能为空', trigger: 'blur' }],
   content: [{ required: true, message: '领导批示不能为空', trigger: 'blur' }]
 };
 // 弹窗关闭后
@@ -37,9 +63,19 @@ const handleClose = () => {
 const handleSubmit = () => {
   formRef.value?.validate((valid) => {
     if (valid) {
-      showSuccessMsg('批示成功');
-      emits('update:modelValue', false);
-      emits('confirm');
+      console.log(form.value);
+      addLeaderInstruction(form.value).then((response)=>{
+        if (response.code === 200) {
+          showSuccessMsg('批示成功');
+          emits('update:modelValue', false);
+          emits('confirm');
+        } else {
+          console.error('批示失败:', response.msg);
+        }
+      })
+      // showSuccessMsg('批示成功');
+      // emits('update:modelValue', false);
+      // emits('confirm');
     }
   });
 };

+ 6 - 4
src/views/emergencyCommandMap/RightSection/RenWuGenZong.vue

@@ -42,7 +42,7 @@
   <!--弹窗-->
   <RenWuGenZongInfo v-if="eventManageState.showListDialog" v-model="eventManageState.showListDialog" :event-id="eventId" />
 
-  <LeaderInstruction v-if="leaderInstructionState.show" v-model="leaderInstructionState.show" :id="leaderInstructionState.id" />
+  <LeaderInstruction v-if="leaderInstructionState.show" v-model="leaderInstructionState.show" :id="leaderInstructionState.id" :task_id="leaderInstructionState.task_id" />
 </template>
 
 <script lang="ts" setup>
@@ -85,7 +85,8 @@ let timer;
 let isMounted = ref(false);
 const leaderInstructionState = ref({
   show: false,
-  id: ''
+  id: '',
+  task_id: ''
 });
 // 请求数据
 const fetchData = (unNeedTimeout?: boolean) => {
@@ -115,10 +116,11 @@ const handleUpdateSuccess = (updatedData) => {
 };
 const handleLeaderInstruction = (item) => {
   // 处理领导批示逻辑
-  console.log('领导批示:', item);
+  console.log('领导批示:', item.task_id);
   leaderInstructionState.value = {
     show: true,
-    id: item.id
+    id: item.id,
+    task_id:item.task_id
   };
 };
 

+ 1 - 1
src/views/emergencyCommandMap/RightSection/RenWuTanChuan.vue

@@ -27,7 +27,7 @@
 
 <script lang="ts" setup>
 import Dialog from '@/components/Dialog/index.vue';
-import { updateTaskRegistration } from '@/api/emergencyCommandMap/JointDuty.ts';
+import { updateTaskRegistration } from '@/api/emergencyCommandMap/JointDuty';
 
 const props = defineProps({
   modelValue: {