Browse Source

Merge branch 'V0.0.4' of http://10.87.21.221:8000/jzyd_yyds/soc_app into V0.0.4

coys 1 year ago
parent
commit
44b88774dd

+ 1 - 1
src/components/DragButton/index.vue

@@ -86,7 +86,7 @@ export default {
   color:#fff;
   border-radius: 50%;
   box-shadow: 0 0 10px #aaa;
-  z-index:9999;
+  z-index:2000;
   >&:active{
     opacity: .9;
   }

+ 9 - 1
src/components/dateCell/index.vue

@@ -55,6 +55,10 @@ export default {
       type: Boolean,
       default: false,
     },
+    isAll:{
+      type: Boolean,
+      default: false,
+    },
     required:{
       type: [Boolean,String],
       default: false,
@@ -80,8 +84,12 @@ export default {
       handler (val) {
         console.log(val,'valllll')
         if(!val){
+          if(this.isAll){
+            this.label = '全部';
+          }else {
+            this.label = '';
+          }
           this.selected = null;
-          this.label = '';
         }else{
           this.selected = dayjs(val).toDate();
           this.label = formatDate(val,this.type[this.dateType].value);

+ 46 - 35
src/views/menu/securityCheckRegister/add.vue

@@ -50,21 +50,24 @@
                       class="nfc-icon"
                       @click="clickNFC(item.nfcList)"
                     />
+<!--                    <van-switch-->
+<!--                      v-if="!item.showSwitch && item.status == null "-->
+<!--                      style="margin-left: 10px"-->
+<!--                      v-model="item.showSwitch"-->
+<!--                      :active-value="true"-->
+<!--                      :inactive-value="false"-->
+<!--                      @change="switchChange(item)"-->
+<!--                      size="20"-->
+<!--                    />-->
                     <van-switch
-                      v-if="enable"
                       style="margin-left: 10px"
                       v-model="item.status"
                       :active-value="1"
                       :inactive-value="0"
                       inactive-color="#4fc08d"
                       active-color="#ee0a24"
-                      @change="switchChange(item)"
                       size="20"
                     />
-                    <span v-else>
-                      <van-tag v-if="item.status" type="warning">隐患</van-tag>
-                      <van-tag v-else type="success">正常</van-tag>
-                    </span>
                   </template>
                 </van-cell>
                 <van-cell-group v-show="item.status" :border="false">
@@ -122,19 +125,14 @@
     </div>
     <!--  按钮   -->
     <div v-if="enable" class="bottom-box">
-      <p>注:未到任务开始时间,不可提交</p>
       <div class="flex-box">
-        <van-button type="default"  plain @click="accredit" v-show="showGrantBtn">授权</van-button>
-        <van-button type="info"  plain hairline @click="saveData">保存</van-button>
-        <van-button type="info"  @click="submitData">提交</van-button>
+        <van-button type="default" plain @click="accredit" v-if="showGrantBtn">授权</van-button>
+        <van-button type="info" :disabled="Boolean(!isSubmit)"  plain hairline @click="saveData">保存</van-button>
+        <van-button type="info" :disabled="Boolean(!isSubmit)" @click="submitData">提交</van-button>
       </div>
+      <p v-show="Boolean(!isSubmit)">注:未到任务开始时间,禁止操作</p>
     </div>
 
-
-    <!--    <van-image-preview v-model="showPreView" :images="preViewImages.images" :startPosition="preViewImages.startPosition">-->
-    <!--      <template v-slot:index>第{{ index }}页</template>-->
-    <!--    </van-image-preview>-->
-
     <!--  nfc弹窗  -->
     <nfc-popup v-if="enable" ref="NfcPopup" @checkNFC="checkNFC" @close="onClose" @change="changeNfcImg"></nfc-popup>
   </div>
@@ -151,10 +149,10 @@ import Uploader from '@/components/upload/gxuploader'
 import NfcPopup from '@/components/nfcPopup/more'
 import AddCheck from './addCheck'
 import { registerDetail, registerSubmit } from './api'
-import { imgUrl } from '@/utils'
+import { imgUrl} from '@/utils'
 import { ImagePreview } from 'vant'
 import { mapGetters } from 'vuex'
-
+import dayjs from 'dayjs'
 export default {
   name: 'securityDetail',
   components: { NavBar, SelectCell, DateCell, Uploader, NfcPopup, AddCheck },
@@ -313,12 +311,12 @@ export default {
       this.NFCList.forEach(v => {
         if(v.nfcCode === nfcCode){
           if(v.status === 1){
-            this.$toast.fail('NFC点位:' + v.nfcName + '已扫描,请勿重复扫描!');
-            throw new Error('NFC点位:' + v.nfcName + '已扫描,请勿重复扫描!');
+            this.$toast.fail('NFC:' + v.nfcName + '已扫描,请勿重复扫描!');
           }
           v.status = 1;
+          v.submitTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss');
           v.scanMethod = 0;
-          this.$toast('NFC点位:' + v.nfcName + '扫描成功!');
+          this.$toast('NFC:' + v.nfcName + '扫描成功!');
           checkOk = true;
         }
       });
@@ -418,7 +416,15 @@ export default {
         this.dateList = this.getDictItem('rectification_deadline');
         //设置默认展开项
         this.activeNames = this.checkList.map(v => v.itemName);
+        //判断是否可提交(在任务时间内)
         this.isSubmit = res.data.inRegisterTime;
+        this.checkList.forEach(v=>{
+          v.pointList.forEach(item=>{
+            if(item.status == null ){
+              item.status = 0
+            }
+          })
+        })
       })
     },
     //保存数据
@@ -446,7 +452,7 @@ export default {
         });
       })
     },
-//:disabled="Boolean(!isSubmit)"
+//
     //提交数据
     submitData() {
       //验证必填项
@@ -516,6 +522,7 @@ export default {
     //切换开关时添加操作时间
     switchChange(item) {
       console.log(item, '666')
+      item.status = 0;
       //item.resTime = formatDate(new Date());
     },
     //添加图片时的回调
@@ -523,15 +530,15 @@ export default {
       console.log(imgItem, this.NFCList, 'imgItem')
       this.NFCList.forEach(v => {
         if (v.nfcCode === imgItem.nfcCode) {
-          v.img = imgItem.url
-          v.status = 1
-          v.scanMethod = 1
-          this.nfcImage.push(v)
+          v.img = imgItem.url;
+          v.status = 1;
+          v.scanMethod = 1;
+          v.submitTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss');
+          this.nfcImage.push(v);
         }
       })
       console.log(this.NFCList, this.nfcImage, 'nfcObj')
     },
-
   }
 }
 </script>
@@ -540,12 +547,14 @@ export default {
   height: 100%;
   overflow: hidden;
   .page-container {
-    height: calc(100vh - 246px);
+    height: calc(100vh - 262px);
     overflow: auto;
     padding: 20px;
+    -border:1px solid red;
   }
   .bottom-box{
-    padding:10px 20px 20px 20px;
+    height: 170px;
+    padding:20px 20px 20px 20px;
     >P{
       padding-left: 10px;
       font-size: 22px;
@@ -553,17 +562,19 @@ export default {
       line-height: 36px;
     }
     .flex-box {
+      width: 100%;
       display: flex;
       justify-content: space-between;
-      align-items: center;
-      > span {
-        margin: 0 20px;
-      }
+
       >button{
-        flex:.45;
+        &:first-child {
+          margin-left: 0;
+        }
+        &:last-child {
+          margin-right: 0;
+        }
+        flex:1;
         margin:0 10px;
-        /* min-width: 30%;
-        max-width: 50%; */
       }
     }
   }

+ 1 - 0
src/views/menu/securityCheckRegister/addCheck.vue

@@ -123,6 +123,7 @@ export default {
           v.isAdd = 1;
           v.checked = false;
           v.pointId = v.id;
+          v.status = 0;
           if(!v.nfcList) v.nfcList = [];
         });
         this.total = res.total;

+ 2 - 3
src/views/menu/visitRecord/index.vue

@@ -12,7 +12,7 @@
           v-model="query.type"
           :data-list="getDictItem('out_in_type')"
           @change="refreshData"/>
-        <date-cell title="日期"  v-model="query.arrivalTime" date-type="date" @change="refreshData"/>
+        <date-cell title="日期" is-all v-model="query.arrivalTime" date-type="date" @change="refreshData"/>
       </div>
       <div class="card-list">
         <Scroll
@@ -92,7 +92,7 @@ export default {
   data() {
     return {
       query:{
-        arrivalTime:`${formatDate(new Date(),'YYYY-MM-DD')}`,
+        arrivalTime:null,
         userName:null,
         pageSize:10,
         pageNum:1,
@@ -130,7 +130,6 @@ export default {
     },
     //初始化数据
     initData(){
-      this.query.arrivalTime = formatDate(new Date(),'YYYY-MM-DD');
       this.getDataList();
     },
     //获取数据列表