coys há 2 anos atrás
pai
commit
dda7eb741d

+ 9 - 5
src/components/nfcPopup/alone.vue

@@ -4,17 +4,17 @@
       <div class="nfc-panel">
         <div>
           <p  class="top-text">将手机背部靠近NFC标签扫描</p>
-          <div class="image-box">
-            <img class="nfc-image" v-show="nfcImage" :src="nfcImage" alt="">
+          <div class="image-box" >
+            <img class="nfc-image"  v-show="nfcImage" :src="nfcImage" alt="">
           </div>
           <div  class="bottom-box">
-            <div>
+            <div @click="submitNFC">
               <img :src="require('../../assets/img/icon/NFC扫描-01.png')" />
               <span>NFC</span>
             </div>
-            <div>
+            <div @click="nfcTakePhotos">
               <img :src="require('../../assets/img/icon/camera.png')" />
-              <span @click="nfcTakePhotos">拍照</span>
+              <span >拍照</span>
             </div>
           </div>
         </div>
@@ -96,6 +96,10 @@ export default {
     nfcTakePhotos(){
       this.$refs.upload.click();
     },
+    submitNFC(){
+      let NFCurl='ssssssssss'
+      this.$emit('changeNFC',NFCurl)
+    }
   }
 }
 </script>

+ 1 - 1
src/config/env.development.js

@@ -2,7 +2,7 @@
 module.exports = {
   title: 'soc-app-dev',
   baseUrl: 'http://localhost:9018', // 项目地址
-  baseApi: '/chao', // 本地api请求地址,注意:如果你使用了代理,请设置成'/'
+  baseApi: '/luowei', // 本地api请求地址,注意:如果你使用了代理,请设置成'/'
   APPID: 'xxx',
   APPSECRET: 'xxx',
   $cdn: 'https://www.sunniejs.cn/static'  //静态资源

+ 2 - 2
src/router/router.config.js

@@ -19,7 +19,7 @@ export let routers = [
     path: '/consultInfo/:id',
     name: 'consultInfo',
     component: () => import('@/views/menu/monitoringCall/components/consultInfo'),
-    meta: { title: '监控调阅', keepAlive: false }
+    meta: { title: '监控调阅', keepAlive: true }
   },
   {
     path: '/addInfo/:id',
@@ -124,7 +124,7 @@ export let routers = [
         path: '/monitoringCall',
         name: 'monitoringCall',
         component: () => import('@/views/menu/monitoringCall/index'),
-        meta: { title: '监控调阅', keepAlive: false }
+        meta: { title: '监控调阅', keepAlive: true }
       },
       {
         path: '/educationStatistics',

+ 9 - 2
src/views/menu/monitoringCall/components/addInfo.vue

@@ -90,7 +90,7 @@
             <van-collapse-item :name="item.dictValue" v-for="item in dataList" :key="item.dictValue">
               <template #title>
                 <div>
-                  <van-checkbox :disabled="disabled" v-model="item.isChecked" shape="square">{{
+                  <van-checkbox :disabled="disabled" @change="checkHandler($event, item)"  v-model="item.isChecked" shape="square">{{
                     item.dictLabel
                   }}</van-checkbox>
                 </div>
@@ -109,7 +109,7 @@
                 </van-col>
               </van-row>
               <van-form>
-                <van-row v-show="item.situation == '1'">
+                <van-row v-if="item.situation == '1'">
                   <van-col span="24">
                     <van-field
                       v-model="item.abnormalIllustrate"
@@ -312,10 +312,17 @@ export default {
       this.falg = true
     },
     changeHandler(val, item) {
+      
       if (val == '0') {
         item.abnormalIllustrate = ''
       }
     },
+    checkHandler(val,item){
+      if (!val) {
+        item.abnormalIllustrate = ''
+        item.situation = '0'
+      }
+    },
     onCancel() {
       Toast('取消')
     },

+ 68 - 7
src/views/menu/monitoringCall/components/consultInfo.vue

@@ -19,7 +19,7 @@
       </div>
 
       <!-- 底部按钮 -->
-      <div class="bottomClass" v-if="this.$route.params.id.split('_')[1]!=2">
+      <div class="bottomClass" v-if="this.$route.params.id.split('_')[1] != 2">
         <van-row>
           <van-col span="24">
             <van-button type="info" @click="addInfoHandler">添加调阅记录</van-button>
@@ -32,15 +32,19 @@
         </van-row>
       </div>
     </div>
+    <!-- 扫描弹框 -->
+    <scandialog ref="scandialog" @change="resultImg" @changeNFC="getNFC"></scandialog>
   </div>
 </template>
 <script>
 import NavBar from '@/components/NavBar'
+
 // 主机列表组件
 import MonitoingList from './monitoringList.vue'
-import { Col, Row, Dialog, Icon, Picker } from 'vant'
-import { registrationList, getEndInfo, login } from '@/api/toConsult.js'
-
+import { Col, Row, Dialog, Toast, Icon, Picker } from 'vant'
+import { registrationList, getEndInfo, login, registration } from '@/api/toConsult.js'
+import scandialog from '@/components/nfcPopup/alone.vue'
+import { base64ToBlob } from '@/utils/base64TurnImg.js'
 export default {
   data() {
     return {
@@ -48,6 +52,7 @@ export default {
     }
   },
   components: {
+    scandialog,
     NavBar,
     Dialog,
     Icon,
@@ -77,17 +82,73 @@ export default {
     },
     //结束调阅
     endMontor() {
+      //没有记录的时候不能结束调阅
+      if(this.taskData?.coreMonitoringTaskRegistrationMonitorVOList.length==0){
+        Dialog({ message: '该调阅没有记录不能进行结束操作!' })
+        return 
+      }
+
+
       let startDate = JSON.parse(JSON.stringify(this.taskData.taskStartTime))
-      
+
       startDate = Date.parse(new Date(startDate))
       let endDate = Date.parse(new Date())
       if (endDate - startDate <= 3600000) {
         Dialog({ message: '该调阅未满一个小时请确认' })
-      }
+        //未满一小时不能结束调阅
+      } else {
+      this.$refs.scandialog.visible = true
+
       startDate = new Date(startDate)
+      }
+    },
+    //文件上传
+    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 => {
+          console.log(process.env.NODE_ENV)
+          /*上传成功*/
+          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 = {
+        endPicture: img,
+        endNfc: nfc,
+        taskId: this.$route.params.id.split('_')[0]
+      }
+      registration(obj).then(res => {
+        let { code, data, msg } = res
+        if (code == 200) {
+          Toast.success('扫描成功')
+          //结束调阅
+          this.endHandler()
+        }
+      })
+    },
+    endHandler() {
       getEndInfo({
         id: this.taskData.id,
-        taskId: this.$route.params.id
+        taskId: this.$route.params.id.split('_')[0]
       }).then(res => {
         this.$router.push('/monitoringCall')
       })

+ 13 - 8
src/views/menu/monitoringCall/index.vue

@@ -27,7 +27,7 @@
       </van-col>
     </van-row>
     <van-row>
-      <van-col span="9"
+      <van-col span="12"
         ><van-field
           v-model="fieldValue"
           label-width="3em"
@@ -46,7 +46,7 @@
             :close-on-click-overlay="false"
           /> </van-popup
       ></van-col>
-      <van-col span="9">
+      <van-col span="12">
         <van-field
           v-model="currentDate"
           clearable
@@ -106,7 +106,7 @@
     </div>
 
     <!-- 扫描弹框 -->
-    <scandialog ref="scandialog" @change="resultImg"></scandialog>
+    <scandialog ref="scandialog" @change="resultImg" @changeNFC="getNFC"></scandialog>
   </div>
 </template>
 <script>
@@ -198,7 +198,7 @@ export default {
         this.pageNum = 2
       }
 
-      this.selectListAppHandler(() => {
+      this.selectListAppHandler(1,() => {
         this.loading = false
         this.pageNum++
       })
@@ -243,7 +243,7 @@ export default {
         if (code == 200) {
           if (type) {
             this.taskList.push(...rows)
-            if (rows.length == 0) {
+            if (rows.length == 0||rows.length <10) {
               //已加载完全部数据
               this.finished = true
             }
@@ -277,11 +277,12 @@ export default {
       })
     },
     //扫描图片并上传到服务器和后端
-    photoHandler(img) {
+    photoHandler(img='',nfc='') {
       //上传到服务器
-
+      //开始调阅上传
       let obj = {
-        picture: img,
+        startPicture: img,
+        startNfc: nfc,
         taskId: this.taskId
       }
       registration(obj).then(res => {
@@ -314,6 +315,10 @@ export default {
           /*上传失败*/
         })
     },
+    //上传NFC
+    getNFC(nfc){
+      this.photoHandler('',nfc)
+    },
     //关闭弹框事件
     closeDialog() {
       this.show = false

+ 4 - 3
src/views/menu/training/components/addTraining.vue

@@ -78,11 +78,11 @@
       />
 
       <!-- 参与人员 -->
-     
+ 
       <!-- 必填 -->
       <CheckPeople ref="checkPeople" :userList="userPeopleList" :organizationId="trainingData.orgId" :isRequired="true" @userList="userListHandler"></CheckPeople>
       <!-- 缺席人员 -->
-      <CheckPeople ref="checkPeople" :userList="lackPeopleList" :inpitLabel="'缺席人员'" :organizationId="trainingData.orgId" :isRequired="true" @userList="lackUserListHandler"></CheckPeople>
+      <CheckPeople ref="checkPeople" :userList="lackPeopleList" :inpitLabel="'缺席人员'" :organizationId="trainingData.orgId" :isRequired="false" @userList="lackUserListHandler"></CheckPeople>
       <!-- 上传 -->
       <van-field readonly clickable name="uploader" label="上传图片">
         <template #input>
@@ -289,8 +289,9 @@ export default {
       let obj = JSON.parse(JSON.stringify(this.form))
       
       obj.imageList = obj.imageList.map(item => item.imgPath).join(',')
-
+      obj.taskUserList=[]
       obj.taskUserList.push(...this.userPeopleList, ...this.lackPeopleList)
+      
       edittrainingInfo({
         id: this.trainingData.id,
         type: this.trainingData.type,

+ 1 - 1
src/views/menu/training/index.vue

@@ -353,7 +353,7 @@ export default {
         if (code == 200) {
           if (type) {
             this.taskList.push(...rows)
-            if (rows.length == 0) {
+            if (rows.length == 0||rows.length <10) {
               //已加载完全部数据
               this.finished = true
             }