|
|
@@ -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%; */
|
|
|
}
|
|
|
}
|
|
|
}
|