coys 2 jaren geleden
bovenliggende
commit
afb9ae3ea8
4 gewijzigde bestanden met toevoegingen van 203 en 205 verwijderingen
  1. 11 0
      src/api/drillTask.js
  2. 3 6
      src/views/home/menu.vue
  3. 187 198
      src/views/home/works.vue
  4. 2 1
      vue.config.js

+ 11 - 0
src/api/drillTask.js

@@ -106,3 +106,14 @@ export function registration(data) {
     data
   })
 }
+//获取工作台接口
+export function getPanelList() {
+  return request({
+    url: '/core/panel/list',
+    headers: {
+      isToken: false
+    },
+    method: 'get',
+    
+  })
+}

+ 3 - 6
src/views/home/menu.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="menu-container">
     <top-bar></top-bar>
-    
+
     <div class="menu-list">
       <div class="menu-list-item" v-for="(v, i) in menuList" :key="i">
         <p @click="onclick">{{ v.meta.title }}</p>
@@ -17,7 +17,6 @@
       </div>
     </div>
     <van-dialog v-model="show" title="标题" confirmButtonText="关闭">
-
       <p class="text">
         {{ info }}
       </p>
@@ -45,7 +44,6 @@ export default {
   },
   mounted() {
     this.getMenuList()
-    
   },
   methods: {
     getMenuList() {
@@ -61,8 +59,7 @@ export default {
     //获取天气数据
     getTheWeather() {
       getTheAreaWeather(this.orgId).then(res => {
-
-        this.list = res.data||[]
+        this.list = res.data || []
         this.list.forEach(item => {
           if (item.alarmLevel == '橙色') {
             item.bgc = '#fa8e00'
@@ -84,7 +81,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.text{
+.text {
   padding: 20px;
 }
 .color {

+ 187 - 198
src/views/home/works.vue

@@ -1,40 +1,30 @@
 <template>
   <div class="index-container">
     <top-bar></top-bar>
+   
     <!-- 步骤条 -->
     <van-steps :active="active" active-icon="success" active-color="#38f">
-      <van-step
-        ><van-badge :content="3" color="#1989fa"> <a href="#lz">履职</a> </van-badge>
-      </van-step>
-      <van-step
-        ><van-badge :content="3" color="#1989fa"> <a href="#bf">布防</a> </van-badge>
-      </van-step>
-      <van-step
-        ><van-badge :content="3" color="#1989fa"> <a href="#jc">检查</a> </van-badge>
-      </van-step>
-      <van-step
-        ><van-badge :content="3" color="#1989fa"> <a href="#dy">调阅</a></van-badge>
-      </van-step>
-      
-      <van-step
-        ><van-badge :content="3" color="#1989fa"> <a href="#yl">演练</a> </van-badge>
-      </van-step>
-      <van-step
-        ><van-badge :content="3" color="#1989fa"> <a href="#px">培训</a> </van-badge>
-      </van-step>
-      <van-step
-        ><van-badge :content="0" color="#1989fa"> <a href="#qt">其他</a> </van-badge>
+      <van-step v-for="item in workList" :key="item.taskType"
+        ><van-badge :content="item.nums" color="#1989fa">
+          <a :href="`#${worksLink(1, item.taskType)}`">{{ item.taskTypeText }}</a>
+        </van-badge>
       </van-step>
     </van-steps>
     <div class="big_box" @scroll="scrolling">
-      <!-- 履职列表 -->
-      <div class="cellMargin">
+      <!-- 列表 -->
+      <div class="cellMargin" v-for="item in workList" :key="item.taskType">
         <!-- 标题区域 -->
-        <van-cell value="0" is-link id="lz">
+        <!-- lz -->
+        <van-cell
+          :value="item.nums"
+          is-link
+          :to="{ path: worksLink(3, item.taskType) }"
+          :id="worksLink(1, item.taskType)"
+        >
           <!-- 使用 title 插槽来自定义标题 -->
           <template #title>
             <span class="titleLeft"> </span>
-            <span class="custom-title">履职任务</span>
+            <span class="custom-title">{{ item.taskTypeText }}</span>
           </template>
         </van-cell>
         <!-- 待办区域 -->
@@ -42,201 +32,61 @@
           <!-- <van-empty description="暂无数据" /> -->
           <van-cell-group>
             <van-cell
-              v-for="(i, index) in 6"
+              v-for="(i, index) in item.dataList"
               :key="index"
               class="mainTitle"
-              value="待履职"
-              :title="'检查任务'"
-              :label="'2020-01-01 10:10:23'"
+              :value="worksLink(2, item.taskType, i.status)"
+              :title="i.taskName"
+              :label="i.startTime + '-' + i.endTime"
               is-link
-              :to="{ path: 'path', query: { id: 'v.id', enable: 1 } }"
-              :value-class="`title-orange`"
-            />
-          </van-cell-group>
-        </div>
-      </div>
-      <!-- 布防列表 -->
-      <div class="cellMargin">
-        <!-- 标题区域 -->
-        <van-cell value="0" is-link id="bf">
-          <!-- 使用 title 插槽来自定义标题 -->
-          <template #title>
-            <span class="titleLeft"> </span>
-            <span class="custom-title">布防任务</span>
-          </template>
-        </van-cell>
-        <!-- 待办区域 -->
-        <div class="marginCls">
-          <!-- <van-empty description="暂无数据" /> -->
-          <van-cell-group>
-            <van-cell
-              v-for="(i, index) in 6"
-              :key="index"
-              class="mainTitle"
-              value="待布防"
-              :title="'检查任务'"
-              :label="'2020-01-01 10:10:23'"
-              is-link
-              :to="{ path: 'path', query: { id: 'v.id', enable: 1 } }"
-              :value-class="`title-orange`"
-            />
-          </van-cell-group>
-        </div>
-      </div>
-      <!-- 调阅列表 -->
-      <div class="cellMargin">
-        <!-- 标题区域 -->
-        <van-cell value="0" is-link id="dy">
-          <!-- 使用 title 插槽来自定义标题 -->
-          <template #title>
-            <span class="titleLeft"> </span>
-            <span class="custom-title">监控调阅</span>
-          </template>
-        </van-cell>
-        <!-- 待办区域 -->
-        <div class="marginCls">
-          <van-cell-group>
-            <van-cell
-              v-for="(i, index) in 6"
-              :key="index"
-              class="mainTitle"
-              value="待调阅"
-              :title="'检查任务'"
-              :label="'2020-01-01 10:10:23'"
-              is-link
-              :to="{ path: 'path', query: { id: 'v.id', enable: 1 } }"
-              :value-class="`title-orange`"
-            />
-          </van-cell-group>
-        </div>
-      </div>
-      <!-- 检查列表 -->
-      <div class="cellMargin">
-        <!-- 标题区域 -->
-        <van-cell value="0" is-link id="jc">
-          <!-- 使用 title 插槽来自定义标题 -->
-          <template #title>
-            <span class="titleLeft"> </span>
-            <span class="custom-title">检查任务</span>
-          </template>
-        </van-cell>
-        <!-- 待办区域 -->
-        <div class="marginCls">
-          <van-cell-group>
-            <van-cell
-              v-for="(i, index) in 6"
-              :key="index"
-              class="mainTitle"
-              value="待检查"
-              :title="'检查任务'"
-              :label="'2020-01-01 10:10:23'"
-              is-link
-              :to="{ path: 'path', query: { id: 'v.id', enable: 1 } }"
-              :value-class="`title-orange`"
-            />
-          </van-cell-group>
-        </div>
-      </div>
-      <!-- 演练列表 -->
-      <div class="cellMargin">
-        <!-- 标题区域 -->
-        <van-cell value="0" is-link id="yl">
-          <!-- 使用 title 插槽来自定义标题 -->
-          <template #title>
-            <span class="titleLeft"> </span>
-            <span class="custom-title">演练登记</span>
-          </template>
-        </van-cell>
-        <!-- 待办区域 -->
-        <div class="marginCls">
-          <van-cell-group>
-            <van-cell
-              v-for="(i, index) in 6"
-              :key="index"
-              class="mainTitle"
-              value="待演练"
-              :title="'检查任务'"
-              :label="'2020-01-01 10:10:23'"
-              is-link
-              :to="{ path: 'path', query: { id: 'v.id', enable: 1 } }"
-              :value-class="`title-orange`"
-            />
-          </van-cell-group>
-        </div>
-      </div>
-      <!-- 培训列表 -->
-      <div class="cellMargin">
-        <!-- 标题区域 -->
-        <van-cell value="0" is-link id="px">
-          <!-- 使用 title 插槽来自定义标题 -->
-          <template #title>
-            <span class="titleLeft"> </span>
-            <span class="custom-title">教育培训</span>
-          </template>
-        </van-cell>
-        <!-- 待办区域 -->
-        <div class="marginCls">
-          <van-cell-group>
-            <van-cell
-              v-for="(i, index) in 6"
-              :key="index"
-              class="mainTitle"
-              value="待履职"
-              :title="'检查任务'"
-              :label="'2020-01-01 10:10:23'"
-              is-link
-              :to="{ path: 'path', query: { id: 'v.id', enable: 1 } }"
-              :value-class="`title-orange`"
-            />
-          </van-cell-group>
-        </div>
-      </div>
-      <!-- 其他列表 -->
-      <div class="cellMargin">
-        <!-- 标题区域 -->
-        <van-cell value="0" is-link id="qt">
-          <!-- 使用 title 插槽来自定义标题 -->
-          <template #title>
-            <span class="titleLeft"> </span>
-            <span class="custom-title">其他任务</span>
-          </template>
-        </van-cell>
-        <!-- 待办区域 -->
-        <div class="marginCls">
-          <van-cell-group>
-            <van-cell
-              v-for="(i, index) in 6"
-              :key="index"
-              class="mainTitle"
-              value="待履职"
-              :title="'检查任务'"
-              :label="'2020-01-01 10:10:23'"
-              is-link
-              :to="{ path: 'path', query: { id: 'v.id', enable: 1 } }"
+              @click="isFalgHandler(i, item.taskType, item.id)"
               :value-class="`title-orange`"
             />
           </van-cell-group>
         </div>
       </div>
+      <!-- 扫描弹框 -->
+      <scandialog ref="scandialog" @change="resultImg" @changeNFC="getNFC"></scandialog>
     </div>
   </div>
 </template>
 
 <script>
+import scandialog from '@/components/nfcPopup/alone.vue'
 import TopBar from '@/components/TopBar'
 import { mapGetters } from 'vuex'
-
+import { Toast } from 'vant'
+import { registration } from '@/api/toConsult.js'
+import { upload } from '@/api/public'
+import { getPanelList } from '@/api/drillTask.js'
 export default {
   name: 'works',
-  components: { TopBar },
+  components: { TopBar, scandialog },
   data() {
     return {
       active: 0,
-      oldScrollTop: ''
+      taskId: '', //监控调阅ID
+      workList: [], //工作台列表
+      oldScrollTop: '',
+      falg: false //待调阅的时候 不进行跳转页面单独处理
     }
   },
   mounted() {},
+  created() {
+    this.getList()
+  },
   methods: {
+    isFalgHandler(i, taskType, id) {
+      //如果当前是待调阅任务 当前页面处理之后再跳转 不是则正常跳转
+      if (i.status == 0 && taskType == 3) {
+        this.falg = false
+        this.taskId = i.id
+        this.$refs.scandialog.visible = true
+      } else {
+        this.falg = true
+        this.$router.push({ path: this.worksLink(4, taskType, i.status, i.id) })
+      }
+    },
     scrolling(el) {
       // 滚动条距文档顶部的距离
       let scrollTop = document.querySelector('.big_box').scrollTop || document.body.scrollTop
@@ -270,6 +120,138 @@ export default {
         this.active = 0
       }
       console.log(this.active)
+    },
+    getList() {
+      getPanelList().then(res => {
+        let { data, code, msg } = res
+
+        this.workList = data
+      })
+    },
+    worksLink(type, val, taskType = '', id = '') {
+      //type 列表类型区分 //val 类型值 //taskType 具体列表项区分 //id 任务id
+      let str = ''
+      let strName = ''
+      let path = ''
+      let pathInfo = ''
+      switch (val) {
+        case 0:
+          str = '/lz'
+          strName = '待履职'
+          path = '/resumption'
+          pathInfo = `/resumption_detail?id=${id}&enable=1&taskDate=2023-09-28`
+          break
+        case 3:
+          str = '/dy'
+          strName = '待调阅'
+          path = '/monitoringCall'
+          pathInfo = '/consultInfo_' + id
+          break
+        case '/jc':
+          str = '/jc'
+          break
+        case 4:
+          str = '/yl'
+          strName = '待演练'
+          path = '/rehearsalTask'
+          pathInfo = '/addRehearsalTask/' + id
+          break
+        case 5:
+          str = '/px'
+          strName = '待登记'
+          path = '/training'
+          pathInfo = '/Addtraining/' + id
+          break
+        case '/qt':
+          str = '/qt'
+          break
+      }
+
+      if (type == 1) {
+        return str
+      } else if (type == 2) {
+        //返回跳转文字
+        //监控调阅
+        if (val == 3 && taskType == 1) {
+          strName = '调阅中'
+        }
+        //演练登记
+        if (val == 4 && taskType == 2) {
+          strName = '待评价'
+        } else if (val == 4 && taskType == 1) {
+          strName = '待签名'
+        }
+        //教育培训
+        if (val == 5 && taskType == 0) {
+          strName = '待登记'
+        } else if (val == 5 && taskType == 1) {
+          strName = '待签名'
+        }
+        return strName
+      } else if (type == 3) {
+        //返回列表路径
+        return path
+      } else {
+        //返回详情路径
+        //监控调阅
+        if (val == 3 && taskType == 1) {
+          strName = '调阅中'
+          pathInfo = '/consultInfo/' + id + '_1'
+        }
+        //演练登记评价跳转
+        if (val == 4 && taskType == 2) {
+          pathInfo = '/rehearsalTaskSign/' + id + '_evaluate'
+        }
+        //演练登记签名跳转
+        if (val == 4 && taskType == 1) {
+          pathInfo = '/rehearsalTaskSign/' + id + '_edit'
+        }
+        //教育培训签名跳转
+        if (val == 5 && taskType == 1) {
+          pathInfo = '/personnelSignature/' + id + '_edit'
+        }
+        return pathInfo
+      }
+    },
+    //监控调阅待调阅弹框处理
+    //文件上传
+    resultImg(img) {
+      let obj = base64ToBlob(img.base)
+      let formData = new FormData()
+      obj.name = '调阅.jpg'
+      formData.append('file', base64ToBlob(img.base))
+      upload(formData, 'image')
+        .then(res => {
+          /*上传成功*/
+          let imgUrl = process.env.NODE_ENV === 'development' ? res.data.url : window.origin + res.data.url
+          this.photoHandler(imgUrl)
+
+          // this.$emit("imgUrl", res.data.url);
+        })
+        .catch(err => {
+          /*上传失败*/
+        })
+    },
+    //上传NFC
+    getNFC(nfc) {
+      this.photoHandler('', nfc)
+    },
+    //扫描图片并上传到服务器和后端
+    photoHandler(img = '', nfc = '') {
+      //上传到服务器
+      //开始调阅上传
+      let obj = {
+        startPicture: img,
+        startNfc: nfc,
+        taskId: this.taskId
+      }
+      registration(obj).then(res => {
+        let { code, data, msg } = res
+        if (code == 200) {
+          Toast.success('扫描成功')
+          this.$router.push('/consultInfo/' + this.taskId)
+        }
+      })
     }
   },
   beforeDestroy() {
@@ -296,6 +278,14 @@ export default {
 .van-cell__title {
   color: #1989fa;
 }
+::v-deep.van-cell__value {
+  // width: 20%;
+  float: right;
+  display: -webkit-flex;
+  -webkit-flex: none;
+  flex: none;
+}
+
 .mainTitle {
   .van-cell__title {
     color: black;
@@ -308,7 +298,7 @@ export default {
   overflow: hidden;
 }
 .marginCls {
-  height: 400px;
+  min-height: 400px;
   width: 100%;
   background-color: #fff;
   // overflow-y: scroll;
@@ -332,5 +322,4 @@ a {
   color: inherit;
   margin-right: 10px;
 }
-
 </style>

+ 2 - 1
vue.config.js

@@ -109,7 +109,8 @@ module.exports = defineConfig({
         }
       },
       '/dev': {
-        target: "http://10.87.10.55:8080",
+        // target: "http://10.87.10.55:8080",
+        target: "http://10.87.11.173:8080",
         // ws:true,
         changOrigin:true,
         pathRewrite:{