Browse Source

任务领取拒绝

彭宇 2 năm trước cách đây
mục cha
commit
79d0cdfb9a
3 tập tin đã thay đổi với 106 bổ sung52 xóa
  1. 17 1
      src/api/forest.js
  2. 1 1
      src/components/v-fastmenu.vue
  3. 88 50
      src/components/vBottomMenu.vue

+ 17 - 1
src/api/forest.js

@@ -151,7 +151,7 @@ export function listResourceByWz(param) {
     data:param
   })
 }
-// 任务领取部门
+// 任务领取部门列表
 export function selectTaskDtpts(param) {
   return request({
     url: '/center-fire/VisuForestCloudMapController/selectTaskDtpts',
@@ -159,3 +159,19 @@ export function selectTaskDtpts(param) {
     data:param
   })
 }
+// 任务领取
+export function receiveTask(param) {
+  return request({
+    url: '/center-fire/VisuForestCloudMapController/receiveTask',
+    method: 'post',
+    data:param
+  })
+}
+// 任务拒绝
+export function refusedTask(param) {
+  return request({
+    url: '/center-fire/VisuForestCloudMapController/refusedTask',
+    method: 'post',
+    data:param
+  })
+}

+ 1 - 1
src/components/v-fastmenu.vue

@@ -30,7 +30,7 @@
 				</div>
 			</el-popover>
 		</div>
-    <el-dialog title="修改密码" :visible.sync="isResetPwd" v-if="isResetPwd" width="50%" append-to-body>
+    <el-dialog title="修改密码" :visible.sync="isResetPwd" v-if="isResetPwd" width="30%" append-to-body>
       <resetPwd :user="user" />
     </el-dialog>
 	</div>

+ 88 - 50
src/components/vBottomMenu.vue

@@ -215,7 +215,7 @@
           </el-col>
           <!-- 左侧end -->
           <!-- 右侧 -->
-          <el-col :span="6" class="dia-right" >
+          <el-col :span="6" class="dia-right">
             <div class="e-right" style="height: 75vh;!important;">
               <div class="forthis" style="height: 75vh;!important;">
                 <dv-border-box-7 backgroundColor="#040b1f" :color="['#25335d', '#5baffd']"
@@ -223,7 +223,7 @@
                   <div class="i-list-con" style="height: 75vh;!important;">
                     <div class="this-con" style="height: 75vh;!important;">
                       <div class="z-info-list" style="margin-top: 0;height: 75vh;!important;">
-                        <el-timeline  style="height: 75vh;!important;">
+                        <el-timeline style="height: 75vh;!important;">
                           <el-timeline-item color="#2bacf7" :timestamp="item.createTime"
                                             placement="top" v-for="(item,index) in eventLogList">
                             <el-card style="width: 40vh">
@@ -258,32 +258,32 @@
                   </div>
                 </dv-border-box-7>
               </div>
-<!--              <div class="forthis">-->
-<!--                <dv-border-box-7 backgroundColor="#040b1f" :color="['#25335d', '#5baffd']">-->
-<!--                  <div class="i-list-con">-->
-<!--                    <div class="this-con h-25 no-padding">-->
-<!--                      <div class="z-info-list" style="margin-top: 0;">-->
-<!--                        <div class="z-info-btm-grp">-->
-<!--                          <div class="z-info-btm-grp-top">-->
-<!--                            <div class="z-info-btm-grp-left">-->
-<!--                              &lt;!&ndash;                                <el-button size="small" icon="el-icon-s-flag">责任制&ndash;&gt;-->
-<!--                              &lt;!&ndash;                                </el-button>&ndash;&gt;-->
-<!--                              <el-button size="small" icon="el-icon-upload" @click="showEventLogUpload()">上传-->
-<!--                              </el-button>-->
-<!--                              <el-button size="small" icon="el-icon-download" @click="toImage()">保存-->
-<!--                              </el-button>-->
-<!--                            </div>-->
-<!--                            <div class="z-info-btm-grp-right">-->
-<!--                              <el-button size="small" icon="el-icon-mic">会议-->
-<!--                              </el-button>-->
-<!--                            </div>-->
-<!--                          </div>-->
-<!--                        </div>-->
-<!--                      </div>-->
-<!--                    </div>-->
-<!--                  </div>-->
-<!--                </dv-border-box-7>-->
-<!--              </div>-->
+              <!--              <div class="forthis">-->
+              <!--                <dv-border-box-7 backgroundColor="#040b1f" :color="['#25335d', '#5baffd']">-->
+              <!--                  <div class="i-list-con">-->
+              <!--                    <div class="this-con h-25 no-padding">-->
+              <!--                      <div class="z-info-list" style="margin-top: 0;">-->
+              <!--                        <div class="z-info-btm-grp">-->
+              <!--                          <div class="z-info-btm-grp-top">-->
+              <!--                            <div class="z-info-btm-grp-left">-->
+              <!--                              &lt;!&ndash;                                <el-button size="small" icon="el-icon-s-flag">责任制&ndash;&gt;-->
+              <!--                              &lt;!&ndash;                                </el-button>&ndash;&gt;-->
+              <!--                              <el-button size="small" icon="el-icon-upload" @click="showEventLogUpload()">上传-->
+              <!--                              </el-button>-->
+              <!--                              <el-button size="small" icon="el-icon-download" @click="toImage()">保存-->
+              <!--                              </el-button>-->
+              <!--                            </div>-->
+              <!--                            <div class="z-info-btm-grp-right">-->
+              <!--                              <el-button size="small" icon="el-icon-mic">会议-->
+              <!--                              </el-button>-->
+              <!--                            </div>-->
+              <!--                          </div>-->
+              <!--                        </div>-->
+              <!--                      </div>-->
+              <!--                    </div>-->
+              <!--                  </div>-->
+              <!--                </dv-border-box-7>-->
+              <!--              </div>-->
             </div>
 
           </el-col>
@@ -292,24 +292,25 @@
       </div>
     </el-dialog>
     <!-- 任务选择领取部门弹层 -->
-    <el-dialog title="选择部门" :visible.sync="showDeptConfirm" v-if="showDeptConfirm" width="80%" append-to-body
+    <el-dialog title="选择部门" :visible.sync="showDeptConfirm" v-if="showDeptConfirm" width="30%" append-to-body
                @close="cancelEventConfirm()">
       <el-form label-width="80px">
         <el-form-item label="选择部门">
-          <el-select v-model="sendDeptName" clearable placeholder="请选择部门" class="m-r-1rem" @change="setValue">
+          <el-select v-model="deptName" multiple placeholder="请选择部门" class="m-r-1rem" @change="setValue">
             <el-option
               v-for="item in deptOptions"
-              :key="item.deptId"
-              :label="item.deptName"
-              :value="{value:item.deptId,label:item.deptName}"><!--:disabled="item.eventStatus=='未处理' ? false:true"-->
+              :key="item.taskDeptId"
+              :label="item.taskDeptName"
+              :value="{value:item.taskDeptId,label:item.taskDeptName}">
+              <!--:disabled="item.eventStatus=='未处理' ? false:true"-->
             </el-option>
           </el-select>
         </el-form-item>
         <el-button size="mini" type="primary" v-if="taskStatusButton=='lq'"
-                   @click="updateCentereventTEventcatalogueStatus('ld',true)">领取
+                   @click="receiveTask(taskId)">领取
         </el-button>
         <el-button size="mini" type="primary" v-if="taskStatusButton=='jj'"
-                   @click="updateCentereventTEventcatalogueStatus('ld',true)">拒绝
+                   @click="refusedTask(taskId)">拒绝
         </el-button>
       </el-form>
     </el-dialog>
@@ -318,7 +319,7 @@
 
 <script>
 import {
-  selectTaskBO,getEventDetail,selectTaskDtpts
+  selectTaskBO, getEventDetail, selectTaskDtpts, receiveTask, refusedTask
 } from '@/api/forest'
 import supermapTaskDialog from '@/components/supermap' //超图
 
@@ -336,11 +337,11 @@ export default {
       eventDialog: false,//事件详情弹层
       taskStatusButton: null,//任务按钮
 
-      showDeptConfirm:false,//任务领取选择部门弹窗
-      deptOptions: [],//任务领取部门
-      sendDeptId: null,//任务领取部门
-      sendDeptName: null,//任务领取部门
-
+      taskId: null,//任务ID
+      showDeptConfirm: false,//任务领取选择部门弹窗
+      deptOptions: [],//任务领取部门列表
+      centerTaskTaskDepts: [],//任务领取部门
+      deptName: [],//任务领取部门
 
       taskCount: 0,//任务数量
       taskList: 0,//任务列表
@@ -432,17 +433,54 @@ export default {
   },
   methods: {
     setValue(event) {
+      this.centerTaskTaskDepts = []
       //签收选择部门
-      this.sendDeptName = event.label
-      this.sendDeptId = event.value
+      if (event != null && event.length > 0) {
+        for (let i = 0; i < event.length; i++) {
+          if (event[i].label != undefined && event[i].value != undefined) {
+            this.centerTaskTaskDepts.push({ taskDeptId: event[i].value, taskDeptName: event[i].label })
+          }
+        }
+      }
+    },
+    receiveTask(taskId) {
+      let param = { taskId: taskId, centerTaskTaskDepts: this.centerTaskTaskDepts }
+      receiveTask(param).then(res => {
+        //任务领取
+        if (res.code == 200) {
+          this.$message.success(`任务领取成功!`)
+          this.deptOptions = []
+          this.deptName = []
+          this.centerTaskTaskDepts = []
+          //刷新任务列表
+          this.selectTaskList()
+          this.showDeptConfirm = false
+        }
+      })
+    },
+    refusedTask(taskId) {
+      let param = { taskId: taskId, centerTaskTaskDepts: this.centerTaskTaskDepts }
+      refusedTask(param).then(res => {
+        //任务拒绝
+        if (res.code == 200) {
+          this.$message.success(`任务拒绝成功!`)
+          this.deptOptions = []
+          this.deptName = []
+          this.centerTaskTaskDepts = []
+          //刷新任务列表
+          this.selectTaskList()
+          this.showDeptConfirm = false
+        }
+      })
     },
-    selectTaskDtpts(taskId,state){
-      selectTaskDtpts({taskId: taskId}).then(res => {
-        //任务领取部门
+    selectTaskDtpts(taskId, state) {
+      this.taskId = taskId
+      selectTaskDtpts({ taskId: taskId }).then(res => {
+        //任务领取部门列表
         if (res.code == 200) {
           this.deptOptions = res.data
-          this.taskStatusButton=state
-          this.showDeptConfirm=true
+          this.taskStatusButton = state
+          this.showDeptConfirm = true
         }
       })
     },
@@ -453,8 +491,8 @@ export default {
     cancelEventConfirm() {
       console.log('关闭任务选择部门')
       this.deptOptions = []
-      this.sendDeptId = null
-      this.sendDeptName = null
+      this.deptName = []
+      this.centerTaskTaskDepts = []
     },
     showEventDialog(eventCode) {
       this.eventCode = eventCode