彭宇 2 лет назад
Родитель
Сommit
5d513a8f5a
2 измененных файлов с 259 добавлено и 24 удалено
  1. 34 0
      src/api/forest.js
  2. 225 24
      src/views/eventdetailsdialog.vue

+ 34 - 0
src/api/forest.js

@@ -191,3 +191,37 @@ export function uploadBase64(param) {
     data:param
   })
 }
+
+// 通过事件code查询事件责任部门
+export function centereventtdepteventList(param) {
+  return request({
+    url: '/center-fire/VisuForestCloudMapController/centereventtdepteventList',
+    method: 'post',
+    data:param
+  })
+}
+// 通过责任部门查询责任人
+export function dutysystemList(param) {
+  return request({
+    url: '/center-fire/VisuForestCloudMapController/dutysystemList',
+    method: 'post',
+    data:param
+  })
+}
+
+// 事件责任制添加联系人
+export function dutysystemAdd(param) {
+  return request({
+    url: '/center-fire/VisuForestCloudMapController/dutysystemAdd',
+    method: 'post',
+    data:param
+  })
+}
+// 事件责任制删除联系人
+export function dutysystemRemove(param) {
+  return request({
+    url: '/center-fire/VisuForestCloudMapController/dutysystemRemove',
+    method: 'get',
+    params:param
+  })
+}

+ 225 - 24
src/views/eventdetailsdialog.vue

@@ -352,20 +352,68 @@
 		<div style="clear: both;"></div>
       </el-form>
     </el-dialog>
-    <el-dialog title="责任制" :visible.sync="showResponsibilityDialog" v-if="showResponsibilityDialog" width="80%"
-               class="top-dialog tz_tk">
-      <el-form label-width="150px">
-        <el-form-item label="关联预案">
-          <el-select v-model="sendGuanLianYuAn" placeholder="请选择关联预案!" clearable>
-            <el-option
-              v-for="item in guanLianYuAnList"
-              :key="item.id"
-              :label="item.resTitle"
-              :value="item.id"
-            />
-          </el-select>
-        </el-form-item>
-        <el-button size="mini" type="primary" class="fr_button" @click="updateResponsibility">确定
+    <el-dialog title="责任制" :visible.sync="showResponsibilityDialog" v-if="showResponsibilityDialog" width="65%" @close="closeResponsibilityDialog()">
+      <el-form label-width="1500px">
+        <div class="bottom">
+          <!-- 左侧菜单栏 -->
+          <div class="bottomLeft">
+            <div class="leftItem d-l-con padding-box nowrap" v-for="(item,index) in depteventList">
+              <div class="bgt-info">
+                <div class="bgt-info-name" :class="{on:iconCurrentIndex==item.deptId}" @click="dutysystemSelect(item.deptId,item.deptName,item.id)">{{item.deptName}}</div>
+              </div>
+            </div>
+          </div>
+          <!-- 左侧菜单栏对应的右侧的内容 -->
+          <div class="bottomRight" ref="wrapper">
+            <el-button
+              size="mini"
+              type="danger"
+              v-if="depteventId!=null&&depteventId!=''"
+              @click="addLine">添加
+            </el-button>
+              <el-table
+                :data="dutysystemTableData"
+                style="width: 100%">
+                <el-table-column prop="id"  label="主键" v-if="false">
+                  <template slot-scope="scope" hidden>
+                    <el-input  v-model="scope.row.id" readonly  placeholder="主键" ></el-input>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="name" label="姓名" >
+                  <template slot-scope="scope">
+                    <el-input  v-model="scope.row.name" placeholder="姓名" ></el-input>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="post" label="岗位">
+                  <template slot-scope="scope">
+                    <el-input v-model="scope.row.post" placeholder="岗位"></el-input>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="telphone" label="手机号码">
+                  <template slot-scope="scope">
+                    <el-input v-model="scope.row.telphone" placeholder="手机号码"></el-input>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="bookbuytime" label="操作">
+                  <template slot-scope="scope">
+                    <el-button
+                      size="mini"
+                      type="danger"
+                      icon="el-icon-delete"
+                      @click="handleDelete(scope.$index, scope.row)">删除
+                    </el-button>
+                    <el-button
+                      size="mini"
+                      type="danger"
+                      icon="el-icon-save"
+                      @click="handleSave(scope.$index, scope.row)">保存
+                    </el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+          </div>
+        </div>
+        <el-button size="mini" type="primary" class="fr_button" @click="closeResponsibilityDialog">确定
         </el-button>
         <div style="clear: both;"></div>
       </el-form>
@@ -902,7 +950,11 @@ import {
   sendTask,
   listResourceByWz,
   updateYjYuAn,
-  uploadBase64
+  uploadBase64,
+  centereventtdepteventList,
+  dutysystemList,
+  dutysystemAdd,
+  dutysystemRemove
 } from '@/api/forest'
 import {
   treeselectAll as deptTreeselect
@@ -1068,6 +1120,11 @@ export default {
       visuForestCloudYuAnBo: null,
       eventDialog: false,
       showResponsibilityDialog: false,//责任制弹窗
+      depteventList: [],//责任制部门列表
+      iconCurrentIndex:'',
+      dutysystemDeptName:'',
+      depteventId:'',
+      dutysystemTableData:[],
       radius: 50,//资源搜索半径
       resourcesList: [
         {
@@ -1128,6 +1185,71 @@ export default {
     calendarDay: null//首页日历选择
   },
   methods: {
+    /************************************责任制-开始****************************************/
+    addLine:function(){//添加负责人行数
+      var newValue = {
+        id:"",//主键
+        dept:"",//部门名称
+        depteventId:"",//事件部门关联责任人
+        name:"",//姓名
+        post:"",//岗位
+        telphone:"",//手机号
+      };
+      //添加新的行数
+      this.dutysystemTableData.push(newValue);
+    },
+    handleDelete:function(index,row){//删除负责人行数
+      let param = { ids: row.id }
+      dutysystemRemove(param).then(res => {
+        // this.dutysystemTableData.splice(index, 1)
+        this.$message.success(`删除成功!`)
+        this.dutysystemSelect(this.iconCurrentIndex,this.dutysystemDeptName,this.depteventId)
+      })
+    },
+    handleSave:function(index,rowData){//保存负责人行数
+      rowData.dept=this.dutysystemDeptName
+      rowData.depteventId=this.depteventId
+      dutysystemAdd(rowData).then(res => {
+        this.$message.success(`保存成功!`)
+        this.dutysystemSelect(this.iconCurrentIndex,this.dutysystemDeptName,this.depteventId)
+      })
+    },
+    dutysystemSelect:function(deptId,dutysystemDeptName,depteventId){//通过部门查询负责人信息
+      this.dutysystemDeptName=dutysystemDeptName
+      this.depteventId=depteventId
+      this.iconCurrentIndex=deptId
+      let param = { depteventId: depteventId }
+      dutysystemList(param).then(res => {
+        if(res.data!=null&&res.data.length>0){
+          this.dutysystemTableData=res.data
+        }else{
+          this.dutysystemTableData=[{
+            id:"",//主键
+            dept:this.dutysystemDeptName,//部门名称
+            depteventId:this.depteventId,//事件部门关联责任人
+            name:"",//姓名
+            post:"",//岗位
+            telphone:"",//手机号
+          }]
+        }
+      })
+
+    },
+    showResponsibility () {//弹出责任制弹窗
+      let param={eventCode:this.eventCode}
+      centereventtdepteventList(param).then(res => {
+        this.depteventList=res.data
+        this.showResponsibilityDialog = true
+      })
+    },
+    closeResponsibilityDialog () {//责任制关闭
+      this.dutysystemTableData = []
+      this.dutysystemDeptName = ''
+      this.depteventId = ''
+      this.iconCurrentIndex = ''
+      this.showResponsibilityDialog = false
+    },
+    /************************************责任制-结束****************************************/
     showheatPlotting(){
       if(!this.$refs.supermapDialog.isheatPlotting){
         this.$refs.supermapDialog.showheatPlotting(this.latitude,this.longitude)
@@ -1579,12 +1701,6 @@ export default {
     showEventLogUpload() {
       this.$refs.eventLogUpload.eventLogUpload(this.eventCode)
     },
-    showResponsibility () {
-      this.showResponsibilityDialog = true
-    },
-    updateResponsibility () {
-      alert("责任制提交")
-    },
     cancelEventShow() {
       console.log('关闭事件弹窗')
       this.eventLogList = []
@@ -1788,7 +1904,6 @@ export default {
       html2canvas(canvasBox, options).then((canvas) => {
         // toDataURL 图片格式转成 base64
         let dataBase64 = canvas.toDataURL('image/png')
-        console.log(dataBase64)
         this.uploadBase64(dataBase64)
       })
       canvasBox.appendChild(toolbar)
@@ -1807,7 +1922,6 @@ export default {
       this.regionalFlagOpen = true
     },
     showAreaLatLng: function(latlng) {//获取火灾区域经纬度
-      console.log(latlng)
       this.regionalFlagObj.array = latlng
       this.$modal.msgSuccess('获取坐标成功!')
     },
@@ -1924,7 +2038,6 @@ export default {
         cbConnectClose: function(bNormalClose) {
           // 异常断开:bNormalClose = false
           // JS_Disconnect正常断开:bNormalClose = true
-          console.log('cbConnectClose')
           that.oWebControl = null
         }
       })
@@ -2230,5 +2343,93 @@ table tr td input:hover {
 	padding: 0.5rem 1.5rem;
 }
 
+.bottom {
+  width: 100%;
+  height: calc(100% - 80px);
+  display: flex;
+
+  .bottomLeft {
+    width: 288px;
+    height: 500px;
+    overflow-y: auto;
+
+    .leftItem {
+      width: 100%;
+      height: 50px;
+      line-height: 50px;
+      text-align: center;
+      cursor: pointer;
+    }
+  }
+
+  .bottomRight {
+    width: calc(100% - 288px);
+    height: 500px;
+    box-sizing: border-box;
+    padding: 36px 36px 0 36px;
+    overflow-y: auto;
 
+    .bottomRightContent {
+      width: 100%;
+      box-sizing: border-box;
+      padding-bottom: 36px;
+
+      .bottomRightContentHead {
+        height: 25px;
+        font-family: PingFang SC;
+        font-style: normal;
+        font-weight: 600;
+        font-size: 24px;
+        line-height: 25px;
+        text-transform: capitalize;
+        color: rgba(0, 0, 0, 0.85);
+        margin-bottom: 32px;
+      }
+
+      .bottomRightContentBody {
+        .el-col {
+          position: relative;
+          margin-bottom: 18px;
+
+          .circle {
+            display: inline-block;
+            width: 6px;
+            height: 6px;
+            background: #4677f6;
+            border-radius: 50%;
+            position: absolute;
+            top: 8px;
+            left: 0;
+          }
+
+          .word {
+            margin-left: 12px;
+            font-family: PingFang SC;
+            font-style: normal;
+            font-weight: normal;
+            font-size: 14px;
+            color: #4677f6;
+            cursor: pointer;
+          }
+
+          .word:hover {
+            text-decoration: underline;
+          }
+
+          .topPlace {
+            position: absolute;
+            top: 1px;
+            margin-left: 8px;
+          }
+        }
+      }
+
+      .bottomRightContentFooter {
+        height: 1px;
+        width: 100%;
+        margin-top: 14px;
+      }
+    }
+  }
+}
 </style>