凉纪 1 жил өмнө
parent
commit
a8c3649da8

+ 4 - 0
src/assets/css/index.scss

@@ -39,6 +39,10 @@ pre{
   -border: 1px solid #008cd6;
 }
 
+.van-field__label{
+  color:#323233;
+}
+
 .van-picker__confirm{
   color: #008cd6;
 }

+ 8 - 9
src/components/Calendar/index.vue

@@ -75,13 +75,16 @@ export default {
     copyMouth(formDate){
       let arr =  [];
       this.attrs.forEach(v=>{
-        v.customData.workTime = formDate.workTime;
         v.customData.isEnable = formDate.isEnable;
+        v.customData.openTime = formDate.openTime;
+        v.customData.closeTime = formDate.closeTime;
+        v.customData.workTime = formDate.workTime;
         v.customData.workOffTime = formDate.workOffTime;
-        arr.push(v.customData)
-      })
+        v.customData.isDuty = formDate.isDuty;
+        arr.push(v.customData);
+      });
       this.$toast.success('复制成功,请点击提交');
-      this.$emit('copy',arr)
+      this.$emit('copy',arr);
     },
     //初始化数据
     initData(){
@@ -132,11 +135,7 @@ export default {
       day.attributes.forEach(v=>{
         if(v.key != 'select-drag'){
           dayInfo = JSON.parse(JSON.stringify(v.customData));
-          if(day.isDisabled){
-            dayInfo.isDisabled = true;
-          }else {
-            dayInfo.isDisabled = false;
-          }
+          dayInfo.isDisabled = !!day.isDisabled;
         }
       })
       this.$emit('change',dayInfo)

+ 10 - 13
src/components/TopBar.vue

@@ -68,7 +68,6 @@ export default {
   },
   data() {
     return {
-      list: [],
       show: false,
       info: '',
       active: this.defaultActive,
@@ -77,11 +76,16 @@ export default {
     }
   },
   computed: {
-    ...mapGetters(['userName', 'orgName','roleList', 'orgId'])
-  },
-  created() {},
-  mounted() {
-    this.getTheWeather();
+    ...mapGetters(['userName', 'orgName','roleList', 'orgId']),
+    //获取天气数据
+    list() {
+      if(!this.orgId)return [];
+      let lists = [];
+      getTheAreaWeather(this.orgId).then(res => {
+       lists = res.data
+      })
+      return lists;
+    }
   },
   methods: {
     onChange(index){
@@ -116,13 +120,6 @@ export default {
       this.info = item.alarmContent
       this.show = true
     },
-
-    //获取天气数据
-    getTheWeather() {
-      getTheAreaWeather(this.orgId).then(res => {
-        this.list = res.data || [];
-      })
-    }
   }
 }
 </script>

+ 13 - 5
src/components/nfcPopup/more.vue

@@ -78,11 +78,18 @@ export default {
   },
   methods:{
     openCameraCallBack(data){
-      let img =  JSON.parse(data);
-      this.content = data;
-      let params = {
-        extension:img.extension,
-        content:img.content,
+      let params = {};
+      try{
+        let img = JSON.parse(data);
+        params = {
+          extension: img.extension,
+          content: img.content,
+        }
+      }catch (e) {
+        params = {
+          extension: data.extension,
+          content: data.content,
+        }
       }
       this.$toast.loading({
         duration: 0, // 持续展示 toast
@@ -118,6 +125,7 @@ export default {
       let parms = {};
       if(actionType){
         parms.actionType = actionType;
+        parms.compressKb = "500";
       }
       let system = this.isAndroidOrIos();
       if(system === 1){

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

@@ -212,7 +212,7 @@ export let routers = [
         path: '/securityCheckRegister',
         name: 'securityCheckRegister',
         component: () => import('@/views/menu/securityCheckRegister/index'),
-        meta: { title: '安全检查登记', keepAlive: false }
+        meta: { title: '安全检查登记', keepAlive: true }
       },
       {
         path: '/securityDetail',
@@ -230,7 +230,7 @@ export let routers = [
         path: '/problemItem',
         name: 'problemItem',
         component: () => import('@/views/menu/problemItem/index'),
-        meta: { title: '隐患问题清单', keepAlive: false }
+        meta: { title: '隐患问题清单', keepAlive: true }
       },
       {
         path: '/problemDetail',
@@ -254,7 +254,7 @@ export let routers = [
         path: '/safetyBook',
         name: 'safetyBook',
         component: () => import('@/views/menu/safetyBook/index.vue'),
-        meta: { title: '安全责任书', keepAlive: false ,hideTabBar:false}
+        meta: { title: '安全责任书', keepAlive: true ,hideTabBar:false}
       },
       {
         path: '/safetyBookDetail',
@@ -266,7 +266,7 @@ export let routers = [
         path: '/visitRegister',
         name: 'visitRegister',
         component: () => import('@/views/menu/visitRegister/index.vue'),
-        meta: { title: '出入事项申请', keepAlive: false ,hideTabBar:false}
+        meta: { title: '出入事项申请', keepAlive: true ,hideTabBar:false}
       },
       {
         path: '/visitAdd',
@@ -284,7 +284,7 @@ export let routers = [
         path: '/visitCheck',
         name: 'visitCheck',
         component: () => import('@/views/menu/visitCheck/index.vue'),
-        meta: { title: '出入审批', keepAlive: false ,hideTabBar:false}
+        meta: { title: '出入审批', keepAlive: true ,hideTabBar:false}
       },
       {
         path: '/visitCheckDetail',
@@ -296,7 +296,7 @@ export let routers = [
         path: '/visitRecord',
         name: 'visitRecord',
         component: () => import('@/views/menu/visitRecord/index.vue'),
-        meta: { title: '出入登记', keepAlive: false ,hideTabBar:false}
+        meta: { title: '出入登记', keepAlive: true ,hideTabBar:false}
       },
       {
         path: '/visitRecordDetail',
@@ -310,7 +310,7 @@ export let routers = [
         component: () => import('@/views/menu/visitRecord/add.vue'),
         meta: { title: '人员登记', keepAlive: false ,hideTabBar:true}
       },
-      
+
     ],
   },
 ]

+ 6 - 5
src/utils/globalMixins.js

@@ -94,19 +94,20 @@ export default {
     },
     //调用NFC
     useNFC() {
+
       let system = this.isAndroidOrIos()
       const parms = {
-        iOS_SessionType: '0'
+        "iOS_SessionType": "0"
       }
       if (system === 1) {
         //android
         // 判断当前环境是是否存在 js桥 'sap'
-        const hasSap = window.hasOwnProperty('sap')
+        const hasSap = window.hasOwnProperty('sap');
         if (hasSap) {
           // 判断是否存在方法 ?preview
-          const fun = sap.hasOwnProperty('openNFCScan')
+          const fun = sap.hasOwnProperty('openNFCScan');
           if (fun) {
-            sap.openNFCScan(JSON.stringify(parms))
+            sap.openNFCScan(JSON.stringify(parms));
           }
         }
       }
@@ -127,7 +128,7 @@ export default {
       let parms = {}
       if (actionType) {
         parms.actionType = actionType
-        parms.compressKb = '500'
+        parms.compressKb = '1024'
       }
       let system = this.isAndroidOrIos()
       if (system === 1) {

+ 32 - 43
src/views/menu/securityCheckRegister/detail.vue

@@ -86,7 +86,7 @@
                     v-model="item.remark"
                     rows="1"
                     autosize
-                    label="情况描述"
+                    label="情况描述"
                     type="textarea"
                     placeholder="请输入(255字以内)"
                   />
@@ -96,7 +96,7 @@
                     is-row
                     title="整改期限"
                     v-model="item.rectificationDeadline"
-                    :data-list="getDictItem('rectification_deadline')"
+                    :data-list="dateList"
                   />
                   <div class="upload-box">
                     <uploader v-if="enable" :maxCount="5" v-model="item.imgData" />
@@ -185,6 +185,7 @@ export default {
       showPreView: false,
       selected: null,
       active: true,
+      dateList:[],
       go: {
         type: 'replace',
         path: '/securityCheckRegister'
@@ -239,19 +240,18 @@ export default {
         return false
       }
     },
+    //获取NFC已扫描数据
     getNfcState(arr){
         arr = arr || [];
-        let num = 0;
-        arr.forEach(v=>{
-          if(v.status === 1){
-            num++
-          }
-        })
-        return num;
+        let nums = arr.filter(v=>{return v.status === 1});
+        return nums.length;
     },
+    //调用nfc
     checkNFC(){
+      //设置nfc调用后的回调
       window.openNFCScanCallBack = this.openNFCScanCallBack;
-      this.useNFC();
+
+      //设置loading弹窗
       this.$toast.loading({
         duration: 0, // 持续展示 toast
         position: 'top',
@@ -271,9 +271,12 @@ export default {
         }
       }, 1000);
 
+      //挂载nfc
+      this.useNFC();
     },
-
+    //调用nfc后的回调
     openNFCScanCallBack(nfcStr){
+      //alert(JSON.stringify(nfcStr))
       clearInterval(this.timer);
       let nfcCode = '';
       try{
@@ -287,44 +290,27 @@ export default {
       //alert(nfcCode)
       this.checkNfcFilter(nfcCode);
     },
-
+    //验证nfc数据
     checkNfcFilter(nfcCode){
-      let areaId = null;
+      //let areaId = null;
       let checkOk =  false;
+      //alert(JSON.stringify(this.NFCList,'NFCList'));
       this.NFCList.forEach(v => {
         if(v.nfcCode === nfcCode){
-          areaId = v.areaId;
-          this.switchArea(areaId);
           if(v.status === 1){
             this.$toast.fail('NFC点位:' + v.nfcName + '已扫描,请勿重复扫描!');
             throw new Error('NFC点位:' + v.nfcName + '已扫描,请勿重复扫描!');
           }
           v.status = 1;
           v.scanMethod = 0;
-          v.submitTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
-          v.submitBy = this.id;
-          this.$toast.success('NFC点位:' + v.nfcName + '扫描成功!');
+          this.$toast('NFC点位:' + v.nfcName + '扫描成功!');
           checkOk = true;
         }
       });
-
-      if(checkOk){
-        this.yesNFCnums++
-        this.resumptionData.yesNFCNums++
-        this.resumptionData.noNFCNums--
-      }else{
-        this.$toast.fail(nfcCode + ",不在本次履职范围内!");
+      if(!checkOk){
+        this.$toast.fail( "扫描结果不在本次检查范围内!");
       }
-      this.validateArea(areaId)
     },
-    switchArea(areaId){
-      this.areas.forEach((area, i) => {
-        if (areaId === area.areaId) {
-          this.activeArea(area, i)
-        }
-      })
-    },
-
 
     //是否显示nfc图标
     nfcState(item){
@@ -335,6 +321,7 @@ export default {
       }
       return false
     },
+
     //格式化时间范围
     formatTime(start,end,format){
       format = format || 'YYYY-MM-DD'
@@ -413,6 +400,7 @@ export default {
         this.taskInfo = res.data;
         this.enable = this.taskInfo.status === 1 || this.taskInfo.status === 2; //是否可编辑
         this.checkList = res.data.checkList;
+        this.dateList = this.getDictItem('rectification_deadline');
         //设置默认展开项
         this.activeNames = this.checkList.map(v => v.itemName);
       })
@@ -444,20 +432,21 @@ export default {
     //提交数据
     submitData() {
       //验证必填项
-      let pointData = []
-      this.checkList.forEach(v => {
-        v.pointList.forEach(item => {
-          pointData.push(item)
-        })
-      })
+      let pointData = this.checkList.flatMap(v => v.pointList);
+      let allNfcList = pointData.flatMap(v=>v.nfcList);
+      let result = allNfcList.some(v=>v.status != 1);
+      //some函数的用法
+      if(result){
+        this.$toast('请先扫描NFC标签');
+        return;
+      }
       let arr = pointData.filter(v => {
         if (v.status === 1) {
           return !v.remark || !v.rectificationDeadline
         }
       })
-      if (arr.length) return this.$toast(`${arr[0].itemName}:该信息不完整请填写`)
-      //console.log( this.taskInfo,' this.taskInfo')
-      this.taskInfo.isSubmit = 1
+      if (arr.length) return this.$toast(`${arr[0].itemName}:该信息不完整请填写`);
+      this.taskInfo.isSubmit = 1;
       registerSubmit(this.taskInfo).then(res => {
         this.$toast('提交成功')
         this.$router.replace({

+ 0 - 24
src/views/menu/workTime/index.vue

@@ -129,30 +129,6 @@ export default {
       this.$refs.calendar.copyMouth(this.formData);
       this.isCopy = true;
     },
-    // //获取机构树
-    // getTreeList(){
-    //   deptTreeList(this.orgId).then(res=>{
-    //     this.options = res.data;
-    //     this.orgInfo.orgId = this.orgId;
-    //     this.orgInfo.orgName = this.orgName;
-    //     console.log(res,'3333')
-    //   })
-    // },
-    // //改变机构后将重新发起请求
-    // changeTree({selectedOptions}){
-    //   console.log(selectedOptions,'aaaaaa')
-    //   this.formData.orgId = selectedOptions[selectedOptions.length-1].id;
-    //   this.formData.orgName = selectedOptions[selectedOptions.length-1].name;
-    // },
-    // 全部选项选择完毕后,会触发 finish 事件
-    // onFinish({ selectedOptions }) {
-    //   this.showOrg = false;
-    //   this.fieldValue = selectedOptions.map((option) => option.text).join('/');
-    // },
-    // //显示机构选择
-    // showPopup() {
-    //   this.showOrg = true;
-    // },
     //提交
     onsubmit(){
       if(!this.formData.orgId) return this.$toast('请选择机构');