Просмотр исходного кода

Merge branch 'V0.0.2' of http://10.87.10.227:4000/jzyd_yyds/soc_app into V0.0.2

coys 2 лет назад
Родитель
Сommit
c6dc0a2831

+ 7 - 1
src/assets/css/index.scss

@@ -13,7 +13,13 @@ body .app {
   background-color: rgb(245, 245, 249);
 
 }
-
+pre{
+  margin:0px;
+  word-wrap: break-word;
+  white-space: break-spaces;
+  font-size: inherit;
+  font-family: inherit;
+}
 .app-container {
   padding-bottom: 100px;
   background-color: rgb(245, 245, 249);

+ 480 - 480
src/views/menu/resumption/detail.vue

@@ -2,7 +2,7 @@
   <div class="page_box">
     <van-form ref="resumption_form">
       <div class="panel">
-        <NavBar :go="{ type: 'push', path: '/resumption' }"/>
+        <NavBar :go="{ type: 'push', path: '/resumption' }" />
         <van-panel :title="resumptionData.taskName">
           <div class="tts">
             <van-row>
@@ -31,15 +31,15 @@
       <div class="progress">
         <van-progress
           :percentage="
-          (
-            ((resumptionData.yesPointNums + resumptionData.yesNFCNums) /
-              (resumptionData.yesPointNums +
-                resumptionData.noPointNums +
-                resumptionData.yesNFCNums +
-                resumptionData.noNFCNums)) *
-            100
-          ).toFixed(2)
-        "
+            (
+              ((resumptionData.yesPointNums + resumptionData.yesNFCNums) /
+                (resumptionData.yesPointNums +
+                  resumptionData.noPointNums +
+                  resumptionData.yesNFCNums +
+                  resumptionData.noNFCNums)) *
+              100
+            ).toFixed(2)
+          "
         />
       </div>
       <!--   检查区域   -->
@@ -50,9 +50,9 @@
               <van-col span="8" v-for="(va, i) in areas" :key="va.areaId">
                 <div :class="{ active: i === 0 }" class="check-area" @click="clickArea(va, i)">
                   <div class="ysj">
-                    <van-icon name="checked" :color="areaColor.complete" v-if="va.areaStatus === '1'"/>
-                    <van-icon name="info" :color="areaColor.loading" v-if="va.areaStatus === '2'"/>
-                    <van-icon name="info" :color="areaColor.noOpen" v-if="va.areaStatus === '0'"/>
+                    <van-icon name="checked" :color="areaColor.complete" v-if="va.areaStatus === '1'" />
+                    <van-icon name="info" :color="areaColor.loading" v-if="va.areaStatus === '2'" />
+                    <van-icon name="info" :color="areaColor.noOpen" v-if="va.areaStatus === '0'" />
                   </div>
                   {{ va.areaName }}
                 </div>
@@ -91,7 +91,7 @@
                 <span style="display: inline-block; color: #26850c">{{ yesNFCnums }}</span>
                 <span style="display: inline-block; color: #0e0e0e">/</span>
                 <span style="display: inline-block; color: #0e0e0e">{{ NFCnums }}</span>
-                <img :src="require('../../../assets/svg/NFC.svg')" class="nfc-icon" @click="clickNFC"/>
+                <img :src="require('../../../assets/svg/NFC.svg')" class="nfc-icon" @click="clickNFC" />
               </template>
             </van-cell>
           </van-col>
@@ -115,10 +115,10 @@
                 :key="v.img"
                 @click="preViewNFC(i)"
               >
-                <img :src="imgUrl(v.img)" alt=""/>
+                <img :src="imgUrl(v.img)" alt="" />
                 <span>{{ v.nfcName }}</span>
                 <div v-if="enable" class="cancel_icon" @click="cancelImg(v)">
-                  <van-icon name="clear"/>
+                  <van-icon name="clear" />
                 </div>
               </div>
             </van-cell>
@@ -134,7 +134,10 @@
             :key="item.areaId"
           >
             <div v-for="(point, index) in item.points">
-              <van-cell :title="point.pointName">
+              <van-cell>
+                <template #title>
+                  <pre>{{ point.pointName }}</pre>
+                </template>
                 <template #right-icon>
                   <van-switch
                     style="margin-left: 10px"
@@ -148,9 +151,9 @@
                     size="18"
                   />
                   <span v-else>
-                  <van-tag v-if="point.resValue === 1" type="warning">异常</van-tag>
-                  <van-tag v-else type="success">正常</van-tag>
-                </span>
+                    <van-tag v-if="point.resValue === 1" type="warning">异常</van-tag>
+                    <van-tag v-else type="success">正常</van-tag>
+                  </span>
                   <van-switch
                     style="margin-left: 10px"
                     v-model="point.dataStatus"
@@ -186,7 +189,7 @@
                   placeholder="请输入情况描述"
                 />
                 <div class="upload-box">
-                  <uploader :maxCount="5" v-if="enable" v-model="point.imgs"/>
+                  <uploader :maxCount="5" v-if="enable" v-model="point.imgs" />
                   <van-cell v-else>
                     <div
                       class="nfc-img van-hairline--surround"
@@ -194,7 +197,7 @@
                       :key="v.imgPath"
                       @click="clickWarnImage(point.imgs, i)"
                     >
-                      <img :src="imgUrl(v.imgPath)" alt=""/>
+                      <img :src="imgUrl(v.imgPath)" alt="" />
                       <span>{{ v.checkName }}</span>
                     </div>
                   </van-cell>
@@ -219,514 +222,511 @@
       <nfc-popup v-if="enable" ref="NfcPopup" @change="changeNfcImg"></nfc-popup>
     </van-form>
   </div>
-
 </template>
 
 <script>
-  import { ImagePreview, Dialog } from 'vant'
-  import NavBar from '@/components/NavBar/index.vue'
-  import Uploader from '@/components/upload/uploader.vue'
-  import SelectCell from '@/components/selectCell/index.vue'
-  import { getDict } from '@/api/toConsult'
-  import { saveTask, taskDetail } from '@/views/menu/resumption/api'
-  import NfcPopup from '@/components/nfcPopup/more'
-  import { imgUrl } from '@/utils'
-  import dayjs from 'dayjs'
-  import { mapGetters } from 'vuex'
-  import {ref} from 'vue'
-
-  export default {
-    components: {
-      SelectCell,
-      Uploader,
-      NavBar,
-      NfcPopup,
-      imgUrl,
-      [Dialog.Component.name]: Dialog.Component
-    },
-    data() {
-      return {
-        areaColor: {
-          // 已完成
-          complete: '#26850c',
-          // 未开始
-          noOpen: '#1989fa',
-          // 进行中
-          loading: '#ffa500'
-        },
-        NFCnums: 0,
-        yesNFCnums: 0,
-        currentImgNFC: [],
-        areaId: null,
-        resumptionData: {},
-        areas: [],
-        checks: [],
-        nfcs: [],
-        selectRadio: 0,
-        total_show: false,
-        enable: false,
-        activeNames: [],
-        dayList: [15, 30, 90, 180],
-        yesList: [],
-        noList: [],
-        loading: false,
-        finished: false,
-        selectArea: null,
-        preViewImages: {
-          images: [],
-          startPosition: 0
-        },
+import { ImagePreview, Dialog } from 'vant'
+import NavBar from '@/components/NavBar/index.vue'
+import Uploader from '@/components/upload/uploader.vue'
+import SelectCell from '@/components/selectCell/index.vue'
+import { getDict } from '@/api/toConsult'
+import { saveTask, taskDetail } from '@/views/menu/resumption/api'
+import NfcPopup from '@/components/nfcPopup/more'
+import { imgUrl } from '@/utils'
+import dayjs from 'dayjs'
+import { mapGetters } from 'vuex'
+import { ref } from 'vue'
+
+export default {
+  components: {
+    SelectCell,
+    Uploader,
+    NavBar,
+    NfcPopup,
+    imgUrl,
+    [Dialog.Component.name]: Dialog.Component
+  },
+  data() {
+    return {
+      areaColor: {
+        // 已完成
+        complete: '#26850c',
+        // 未开始
+        noOpen: '#1989fa',
+        // 进行中
+        loading: '#ffa500'
+      },
+      NFCnums: 0,
+      yesNFCnums: 0,
+      currentImgNFC: [],
+      areaId: null,
+      resumptionData: {},
+      areas: [],
+      checks: [],
+      nfcs: [],
+      selectRadio: 0,
+      total_show: false,
+      enable: false,
+      activeNames: [],
+      dayList: [15, 30, 90, 180],
+      yesList: [],
+      noList: [],
+      loading: false,
+      finished: false,
+      selectArea: null,
+      preViewImages: {
+        images: [],
+        startPosition: 0
       }
+    }
+  },
+  computed: {
+    ...mapGetters(['id'])
+  },
+  mounted() {
+    this.getResumptionData()
+  },
+  created() {
+    getDict('rectification_deadline').then(res => {
+      let { data } = res
+      this.dayList = data
+    })
+  },
+  methods: {
+    preViewNFC(i) {
+      this.preViewImages.images = this.currentImgNFC.map(v => imgUrl(v.img))
+      this.preViewImages.startPosition = i
+      ImagePreview(this.preViewImages)
     },
-    computed: {
-      ...mapGetters(['id'])
-    },
-    mounted() {
-      this.getResumptionData()
-    },
-    created() {
-      getDict('rectification_deadline').then(res => {
-        let { data } = res
-        this.dayList = data
-      })
+    clickWarnImage(arr, i) {
+      this.preViewImages.images = arr.map(v => imgUrl(v.imgPath))
+      this.preViewImages.startPosition = i
+      ImagePreview(this.preViewImages)
     },
-    methods: {
-      preViewNFC(i) {
-        this.preViewImages.images = this.currentImgNFC.map(v => imgUrl(v.img))
-        this.preViewImages.startPosition = i
-        ImagePreview(this.preViewImages)
-      },
-      clickWarnImage(arr, i) {
-        this.preViewImages.images = arr.map(v => imgUrl(v.imgPath))
-        this.preViewImages.startPosition = i
-        ImagePreview(this.preViewImages)
-      },
-      getResumptionData() {
-        let data = {
-          taskId: this.$route.query.id,
-          taskDate: this.$route.query.taskDate
+    getResumptionData() {
+      let data = {
+        taskId: this.$route.query.id,
+        taskDate: this.$route.query.taskDate
+      }
+      taskDetail(data).then(res => {
+        let { taskId, taskName, yesPointNums, noPointNums, yesNFCNums, noNFCNums, status } = res.data
+        this.resumptionData = {
+          taskId,
+          taskName,
+          yesPointNums,
+          noPointNums,
+          yesNFCNums,
+          noNFCNums,
+          status
         }
-        taskDetail(data).then(res => {
-          let { taskId, taskName, yesPointNums, noPointNums, yesNFCNums, noNFCNums, status } = res.data
-          this.resumptionData = {
-            taskId,
-            taskName,
-            yesPointNums,
-            noPointNums,
-            yesNFCNums,
-            noNFCNums,
-            status
-          }
-          this.enable = this.resumptionData.status === 1 || this.resumptionData.status === 2
-          this.checks = res.data.checks
-          this.nfcs = res.data.nfcs
-          this.areas = res.data.areas
-          this.activeArea(this.areas[0], 0)
-
-          if (!this.enable) {
-            this.openCollapseItems()
-          }
-        })
-      },
-      openCollapseItems() {
-        let len = this.checks.length
-        for (let i = 0; i < len; i++) {
-          let title = this.checks[i].itemName
-          this.activeNames.push(title)
+        this.enable = this.resumptionData.status === 1 || this.resumptionData.status === 2
+        this.checks = res.data.checks
+        this.nfcs = res.data.nfcs
+        this.areas = res.data.areas
+        this.activeArea(this.areas[0], 0)
+
+        if (!this.enable) {
+          this.openCollapseItems()
         }
-      },
-      changeSwitch() {
-        let num = 0
-        for (let i = 0; i < this.checks.length; i++) {
-          for (let j = 0; j < this.checks[i].points.length; j++) {
-            this.checks[i].points[j].dataStatus = 2
-            num++
-          }
+      })
+    },
+    openCollapseItems() {
+      let len = this.checks.length
+      for (let i = 0; i < len; i++) {
+        let title = this.checks[i].itemName
+        this.activeNames.push(title)
+      }
+    },
+    changeSwitch() {
+      let num = 0
+      for (let i = 0; i < this.checks.length; i++) {
+        for (let j = 0; j < this.checks[i].points.length; j++) {
+          this.checks[i].points[j].dataStatus = 2
+          num++
         }
-        this.resumptionData.yesPointNums = num
-        this.resumptionData.noPointNums = 0
-        this.areas.forEach((item, index) => {
-          this.validateArea(item.areaId)
-        })
-        this.openCollapseItems()
-      },
-      changeCurrentSwitch(areaId) {
-        this.resumptionData.yesPointNums = this.resumptionData.yesPointNums + 1
-        this.resumptionData.noPointNums = this.resumptionData.noPointNums - 1
-        this.validateArea(areaId)
-      },
-      validateArea(areaId) {
-        let total = 0
-        let yes = 0
-        this.checks.forEach(item => {
-          let pointList = item.points
-
-          pointList.forEach(point => {
-            if (item.areaId === areaId) {
-              total++
-              if (point.dataStatus === 2) {
-                yes++
-              }
+      }
+      this.resumptionData.yesPointNums = num
+      this.resumptionData.noPointNums = 0
+      this.areas.forEach((item, index) => {
+        this.validateArea(item.areaId)
+      })
+      this.openCollapseItems()
+    },
+    changeCurrentSwitch(areaId) {
+      this.resumptionData.yesPointNums = this.resumptionData.yesPointNums + 1
+      this.resumptionData.noPointNums = this.resumptionData.noPointNums - 1
+      this.validateArea(areaId)
+    },
+    validateArea(areaId) {
+      let total = 0
+      let yes = 0
+      this.checks.forEach(item => {
+        let pointList = item.points
+
+        pointList.forEach(point => {
+          if (item.areaId === areaId) {
+            total++
+            if (point.dataStatus === 2) {
+              yes++
             }
-          })
+          }
         })
+      })
 
-        let noNfc = this.nfcs.filter((item, index) => {
-          return item.areaId === areaId && item.status === 0
-        })
+      let noNfc = this.nfcs.filter((item, index) => {
+        return item.areaId === areaId && item.status === 0
+      })
 
-        let areaStatus = '0'
-        if (total === yes && noNfc.length === 0) {
-          areaStatus = '1'
-        } else if (yes === 0 && noNfc.length === this.NFCnums) {
-          areaStatus = '0'
-        } else {
-          areaStatus = '2'
-        }
+      let areaStatus = '0'
+      if (total === yes && noNfc.length === 0) {
+        areaStatus = '1'
+      } else if (yes === 0 && noNfc.length === this.NFCnums) {
+        areaStatus = '0'
+      } else {
+        areaStatus = '2'
+      }
 
-        this.areas.forEach((item, index) => {
-          if (item.areaId === areaId) {
-            this.areas[index].areaStatus = areaStatus
-          }
-        })
-      },
-      clickNFC() {
-        let arr = this.nfcs.filter(item => {
-          return item.areaId === this.areaId && item.status === 0
-        })
+      this.areas.forEach((item, index) => {
+        if (item.areaId === areaId) {
+          this.areas[index].areaStatus = areaStatus
+        }
+      })
+    },
+    clickNFC() {
+      let arr = this.nfcs.filter(item => {
+        return item.areaId === this.areaId && item.status === 0
+      })
 
-        if (arr.length > 0) {
-          let nfcs = []
-          for (const nfc of arr) {
-            let pro = {}
-            pro.checkName = nfc.nfcName
-            pro.nfccdoe = nfc.nfcCode
-            nfcs.push(pro)
-          }
-          this.$refs.NfcPopup.show(nfcs)
+      if (arr.length > 0) {
+        let nfcs = []
+        for (const nfc of arr) {
+          let pro = {}
+          pro.checkName = nfc.nfcName
+          pro.nfccdoe = nfc.nfcCode
+          nfcs.push(pro)
         }
-      },
-      cancelImg(imgItem) {
-        let areaId = null
-        this.nfcs.forEach(v => {
-          if (v.nfcCode === imgItem.nfcCode) {
-            areaId = v.areaId
-            v.img = imgItem.url
-            v.status = 0
-            v.scanMethod = null
-          }
-        })
-        let now = this.currentImgNFC.filter(v => {
-          return v.nfcCode !== imgItem.nfcCode
-        })
-        this.currentImgNFC = now
+        this.$refs.NfcPopup.show(nfcs)
+      }
+    },
+    cancelImg(imgItem) {
+      let areaId = null
+      this.nfcs.forEach(v => {
+        if (v.nfcCode === imgItem.nfcCode) {
+          areaId = v.areaId
+          v.img = imgItem.url
+          v.status = 0
+          v.scanMethod = null
+        }
+      })
+      let now = this.currentImgNFC.filter(v => {
+        return v.nfcCode !== imgItem.nfcCode
+      })
+      this.currentImgNFC = now
 
-        this.yesNFCnums--
-        this.resumptionData.yesNFCNums--
-        this.resumptionData.noNFCNums++
-        this.validateArea(areaId)
-      },
-      changeNfcImg(imgItem) {
-        let areaId = null
-        this.nfcs.forEach(v => {
-          if (v.nfcCode === imgItem.nfcCode) {
-            areaId = v.areaId
-            v.img = imgItem.url
-            v.status = 1
-            v.scanMethod = 1
-            v.submitTime = dayjs().format('YYYY-MM-DD HH:mm:ss')
-            v.submitBy = this.id
-            this.currentImgNFC.push(v)
-          }
+      this.yesNFCnums--
+      this.resumptionData.yesNFCNums--
+      this.resumptionData.noNFCNums++
+      this.validateArea(areaId)
+    },
+    changeNfcImg(imgItem) {
+      let areaId = null
+      this.nfcs.forEach(v => {
+        if (v.nfcCode === imgItem.nfcCode) {
+          areaId = v.areaId
+          v.img = imgItem.url
+          v.status = 1
+          v.scanMethod = 1
+          v.submitTime = dayjs().format('YYYY-MM-DD HH:mm:ss')
+          v.submitBy = this.id
+          this.currentImgNFC.push(v)
+        }
+      })
+      this.yesNFCnums++
+      this.resumptionData.yesNFCNums++
+      this.resumptionData.noNFCNums--
+      this.validateArea(areaId)
+    },
+    showDetail() {
+      this.total_show = true
+    },
+    onLoad() {
+      // 异步更新数据
+      // setTimeout 仅做示例,真实场景中一般为 ajax 请求
+      this.yesList = []
+      this.noList = []
+      this.nfcs.forEach((item, index) => {
+        if (item.status === 1) {
+          this.yesList.push(item)
+        } else {
+          this.noList.push(item)
+        }
+      })
+    },
+    //点击区域
+    clickArea(area, index) {
+      this.activeArea(area, index)
+    },
+    //选中区域时数据变更
+    activeArea(area, index) {
+      //获取当前选中区域
+      this.areaId = area.areaId
+      //设置选中样式
+      this.$nextTick(() => {
+        let doms = document.getElementsByClassName('check-area')
+        Array.prototype.forEach.call(doms, item => {
+          item.classList.remove('active')
         })
-        this.yesNFCnums++
-        this.resumptionData.yesNFCNums++
-        this.resumptionData.noNFCNums--
-        this.validateArea(areaId)
-      },
-      showDetail() {
-        this.total_show = true
-      },
-      onLoad() {
-        // 异步更新数据
-        // setTimeout 仅做示例,真实场景中一般为 ajax 请求
-        this.yesList = []
-        this.noList = []
-        this.nfcs.forEach((item, index) => {
-          if (item.status === 1) {
-            this.yesList.push(item)
-          } else {
-            this.noList.push(item)
+        doms[index].classList.add('active')
+      })
+      let nfcs = 0
+      let yesNfc = 0
+      let current = []
+      for (let i = 0; i < this.nfcs.length; i++) {
+        let nfc = this.nfcs[i]
+        let areaId = nfc.areaId
+        if (areaId === area.areaId) {
+          nfcs++
+          if (nfc.status === 1) {
+            yesNfc++
           }
-        })
-      },
-      //点击区域
-      clickArea(area, index) {
-        this.activeArea(area, index)
-      },
-      //选中区域时数据变更
-      activeArea(area, index) {
-        //获取当前选中区域
-        this.areaId = area.areaId
-        //设置选中样式
-        this.$nextTick(() => {
-          let doms = document.getElementsByClassName('check-area')
-          Array.prototype.forEach.call(doms, item => {
-            item.classList.remove('active')
-          })
-          doms[index].classList.add('active')
-        })
-        let nfcs = 0
-        let yesNfc = 0
-        let current = []
-        for (let i = 0; i < this.nfcs.length; i++) {
-          let nfc = this.nfcs[i]
-          let areaId = nfc.areaId
-          if (areaId === area.areaId) {
-            nfcs++
-            if (nfc.status === 1) {
-              yesNfc++
-            }
-            if (nfc.img) {
-              current.push(nfc)
-            }
+          if (nfc.img) {
+            current.push(nfc)
           }
         }
-        this.currentImgNFC = current
-        this.yesNFCnums = yesNfc
-        this.NFCnums = nfcs
-        this.selectArea = area
-      },
-      //保存数据
-      resumptionDataSave() {
-        //组装数据
-        let data = {}
-        data.taskId = this.resumptionData.taskId
-        data.checks = this.checks
-        data.nfcs = this.nfcs
-        data.subType = 1
-
-        saveTask(data).then(res => {
-          this.$toast('保存成功')
-          this.$router.go(-1)
-        })
-      },
-      submitResumptionData() {
-        //验证数据
-        let noNfc = this.nfcs.filter((item, index) => {
-          return item.status === 0
+      }
+      this.currentImgNFC = current
+      this.yesNFCnums = yesNfc
+      this.NFCnums = nfcs
+      this.selectArea = area
+    },
+    //保存数据
+    resumptionDataSave() {
+      //组装数据
+      let data = {}
+      data.taskId = this.resumptionData.taskId
+      data.checks = this.checks
+      data.nfcs = this.nfcs
+      data.subType = 1
+
+      saveTask(data).then(res => {
+        this.$toast('保存成功')
+        this.$router.go(-1)
+      })
+    },
+    submitResumptionData() {
+      //验证数据
+      let noNfc = this.nfcs.filter((item, index) => {
+        return item.status === 0
+      })
+      if (noNfc.length > 0) {
+        Dialog.alert({
+          message: 'NFC标签还未扫描完成,请完成后提交!'
         })
-        if (noNfc.length > 0) {
-          Dialog.alert({
-            message: 'NFC标签还未扫描完成,请完成后提交!'
-          })
-          return false
-        }
-        let isOk = true
-        this.checks.forEach(item => {
-          let pointList = item.points
-          pointList.forEach(point => {
-            if (point.dataStatus === 1) {
-              Dialog.alert({
-                message: '还有未完成的内容,请先完成再提交?'
-              })
-              throw new Error('有项目未完成')
-            } else {
-              if (point.resValue === 1) {
-                if (!point.rectificationDeadline || !point.resRemark) {
-                  this.changeSwitch();
-                  this.areas.forEach((area, i) => {
-                    if (area.areaId === item.areaId) {
-                      this.activeArea(area, i);
-                      //切换后验证表单
-                      this.$refs.resumption_form.validate();
-                      this.$toast({
-                        message: '请完成异常情况的信息填写!',
-                        position: 'top',
-                      });
-                    }
-                  })
-                  throw new Error('有异常项目未完成')
-                }
-
+        return false
+      }
+      let isOk = true
+      this.checks.forEach(item => {
+        let pointList = item.points
+        pointList.forEach(point => {
+          if (point.dataStatus === 1) {
+            Dialog.alert({
+              message: '还有未完成的内容,请先完成再提交?'
+            })
+            throw new Error('有项目未完成')
+          } else {
+            if (point.resValue === 1) {
+              if (!point.rectificationDeadline || !point.resRemark) {
+                this.changeSwitch()
+                this.areas.forEach((area, i) => {
+                  if (area.areaId === item.areaId) {
+                    this.activeArea(area, i)
+                    //切换后验证表单
+                    this.$refs.resumption_form.validate()
+                    this.$toast({
+                      message: '请完成异常情况的信息填写!',
+                      position: 'top'
+                    })
+                  }
+                })
+                throw new Error('有异常项目未完成')
               }
             }
-          })
+          }
         })
+      })
 
-        let data = {}
-        data.taskId = this.resumptionData.taskId
-        data.checks = this.checks
-        data.nfcs = this.nfcs
-        data.subType = 2
-
-        saveTask(data).then(res => {
-          this.$toast('提交成功')
-          this.$router.go(-1)
-        })
+      let data = {}
+      data.taskId = this.resumptionData.taskId
+      data.checks = this.checks
+      data.nfcs = this.nfcs
+      data.subType = 2
 
-      }
+      saveTask(data).then(res => {
+        this.$toast('提交成功')
+        this.$router.go(-1)
+      })
     }
   }
+}
 </script>
 
 <style lang="scss" scoped>
-  .van-progress {
-    z-index: 999;
-    width: 98%;
-    left: 6px;
-    right: 6px;
+.van-progress {
+  z-index: 999;
+  width: 98%;
+  left: 6px;
+  right: 6px;
+}
+
+.page_box {
+  height: calc(100vh - 60px);
+  overflow: scroll;
+}
+
+.content {
+  padding: 16px 16px 10px;
+}
+
+.panel {
+  background-color: white;
+  border-radius: 10px;
+  border: 1px solid #ffffff;
+  display: flex;
+  flex-direction: column;
+  box-shadow: 0 8px 12px #ebedf0;
+  margin-bottom: 10px;
+
+  .van-cell__title {
+    font-weight: bold;
   }
+}
 
-  .page_box {
-    height: calc(100vh - 60px);
-    overflow: scroll;
-  }
-
-  .content {
-    padding: 16px 16px 10px;
-  }
+.total_panel {
+  text-align: center;
 
-  .panel {
-    background-color: white;
-    border-radius: 10px;
-    border: 1px solid #ffffff;
-    display: flex;
-    flex-direction: column;
-    box-shadow: 0 8px 12px #ebedf0;
-    margin-bottom: 10px;
-
-    .van-cell__title {
-      font-weight: bold;
-    }
+  .title {
+    padding-top: 10px;
   }
 
-  .total_panel {
-    text-align: center;
+  .content {
+    padding-top: 10px;
+    padding-bottom: 10px;
 
-    .title {
-      padding-top: 10px;
+    .con_num {
+      padding: 15px;
     }
 
-    .content {
-      padding-top: 10px;
-      padding-bottom: 10px;
-
-      .con_num {
-        padding: 15px;
-      }
-
-      .ok {
-        color: #26850c;
-      }
-
-      .no {
-        color: #98632d;
-      }
+    .ok {
+      color: #26850c;
     }
-  }
-
-  .card {
-    box-shadow: 0 10px 10px #eaeaea;
-    height: 50px;
-  }
-
-  .van-popup {
-    height: 50%;
-  }
 
-  .check-area {
-    //background-color: #f1f1f1;
-    text-align: center;
-    margin: 10px;
-    padding: 20px;
-    //color: #aaa;
-    border-radius: 6px;
-    justify-content: space-between;
-    align-items: center;
-    box-shadow: 0 2px 6px #ddd;
-    position: relative;
-
-    .ysj {
-      position: absolute;
-      right: 5px;
-      top: 5px;
+    .no {
+      color: #98632d;
     }
   }
-
-  .active {
-    background-color: #bdbdbd;
-    color: #333;
-  }
-
-  .complete {
-    color: #fff;
-    background-color: #1989fa;
+}
+
+.card {
+  box-shadow: 0 10px 10px #eaeaea;
+  height: 50px;
+}
+
+.van-popup {
+  height: 50%;
+}
+
+.check-area {
+  //background-color: #f1f1f1;
+  text-align: center;
+  margin: 10px;
+  padding: 20px;
+  //color: #aaa;
+  border-radius: 6px;
+  justify-content: space-between;
+  align-items: center;
+  box-shadow: 0 2px 6px #ddd;
+  position: relative;
+
+  .ysj {
+    position: absolute;
+    right: 5px;
+    top: 5px;
   }
-
-  .nfc-icon {
-    width: 50px;
-    height: 50px;
-    margin-left: 20px;
+}
+
+.active {
+  background-color: #bdbdbd;
+  color: #333;
+}
+
+.complete {
+  color: #fff;
+  background-color: #1989fa;
+}
+
+.nfc-icon {
+  width: 50px;
+  height: 50px;
+  margin-left: 20px;
+}
+
+.bottomClass {
+  position: fixed;
+  width: 100%;
+  bottom: 0;
+  z-index: 999;
+  background: #ebedf0;
+  text-align: center;
+
+  .van-button {
+    width: 95%;
+    margin-top: 10px;
   }
-
-  .bottomClass {
-    position: fixed;
+}
+
+.okAll {
+  background-color: #fff;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  height: 50px;
+}
+
+.nfc-img {
+  display: inline-block;
+  width: 160px;
+  height: 160px;
+  margin: 0 10px;
+  position: relative;
+
+  > img {
     width: 100%;
-    bottom: 0;
-    z-index: 999;
-    background: #ebedf0;
-    text-align: center;
-
-    .van-button {
-      width: 95%;
-      margin-top: 10px;
-    }
+    height: 100%;
+    border: none;
   }
 
-  .okAll {
-    background-color: #fff;
-    display: flex;
-    justify-content: center;
-    align-items: center;
-    height: 50px;
+  > span {
+    position: absolute;
+    padding: 0 10px;
+    bottom: 0;
+    left: 0;
+    display: block;
+    width: 100%;
+    background-color: rgba(0, 0, 0, 0.2);
+    color: #eaeaea;
+    font-size: 5px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    line-height: 30px;
+    white-space: break-spaces;
+    height: 30px;
   }
 
-  .nfc-img {
-    display: inline-block;
-    width: 160px;
-    height: 160px;
-    margin: 0 10px;
-    position: relative;
-
-    > img {
-      width: 100%;
-      height: 100%;
-      border: none;
-    }
-
-    > span {
-      position: absolute;
-      padding: 0 10px;
-      bottom: 0;
-      left: 0;
-      display: block;
-      width: 100%;
-      background-color: rgba(0, 0, 0, 0.2);
-      color: #eaeaea;
-      font-size: 5px;
-      overflow: hidden;
-      text-overflow: ellipsis;
-      line-height: 30px;
-      white-space: break-spaces;
-      height: 30px;
-    }
-
-    .cancel_icon {
-      position: absolute;
-      font-size: 30px;
-      right: 5px;
-      top: 2px;
-    }
+  .cancel_icon {
+    position: absolute;
+    font-size: 30px;
+    right: 5px;
+    top: 2px;
   }
+}
 </style>

+ 307 - 281
src/views/menu/securityCheckRegister/detail.vue

@@ -7,12 +7,12 @@
         <van-cell-group>
           <van-cell :title="taskInfo.taskName">
             <template #right-icon>
-              <span :style="{color:getState(getDictLabel(taskInfo.status,'safety_check_status'))}">
-                {{getDictLabel(taskInfo.status,'safety_check_status')}}
+              <span :style="{ color: getState(getDictLabel(taskInfo.status, 'safety_check_status')) }">
+                {{ getDictLabel(taskInfo.status, 'safety_check_status') }}
               </span>
             </template>
           </van-cell>
-          <van-cell title="日期时间" :value="rangDate(taskInfo.planstarttime,taskInfo.planendtime)" />
+          <van-cell title="日期时间" :value="rangDate(taskInfo.planstarttime, taskInfo.planendtime)" />
           <van-cell title="受检机构" :value="taskInfo.beCheckedOrgName" />
           <van-field
             :disabled="!enable"
@@ -21,29 +21,39 @@
             rows="2"
             autosize
             type="textarea"
-            placeholder="请输入" />
+            placeholder="请输入"
+          />
         </van-cell-group>
       </div>
       <!--  检查项目    -->
-      <fieldset class="fieldset"  :disabled="!enable">
-        <div class="card" >
+      <fieldset class="fieldset" :disabled="!enable">
+        <div class="card">
           <p class="legend">检查项目 <span v-if="enable" @click="addCheck">添加检查内容</span></p>
           <van-collapse v-model="activeNames" v-for="v in checkList" :key="v.itemId">
-            <van-collapse-item :title="v.itemName" :name="v.itemName" >
-              <div v-for="(item,index) in v.pointList" :key="item.pointId">
-                <van-cell :title="item.pointName">
+            <van-collapse-item :title="v.itemName" :name="v.itemName">
+              <div v-for="(item, index) in v.pointList" :key="item.pointId">
+                <van-cell>
+                  <template #title>
+                    <pre>{{ item.pointName }}</pre>
+                  </template>
                   <template #right-icon>
-                    <img v-if="enable && item.nfcList && item.nfcList.length > 0" :src="require('../../../assets/svg/NFC.svg')" class="nfc-icon" @click="clickNFC(item.nfcList)"/>
+                    <img
+                      v-if="enable && item.nfcList && item.nfcList.length > 0"
+                      :src="require('../../../assets/svg/NFC.svg')"
+                      class="nfc-icon"
+                      @click="clickNFC(item.nfcList)"
+                    />
                     <van-switch
                       v-if="enable"
-                      style="margin-left: 10px;"
+                      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" />
+                      size="20"
+                    />
                     <span v-else>
                       <van-tag v-if="item.status" type="warning">隐患</van-tag>
                       <van-tag v-else type="success">正常</van-tag>
@@ -51,13 +61,25 @@
                   </template>
                 </van-cell>
                 <van-cell-group v-show="item.status">
-                  <van-cell v-if="item.nfcList && item.nfcList.length > 0" :border="false" >
-                    <div v-if="img.img" class="nfc-img" v-for="(img,i) in item.nfcList" :key="img.img" @click="preViewNFC(i)">
-                      <img :src="imgUrl(img.img)" alt="" >
-                      <span>{{img.checkName}}</span>
+                  <van-cell v-if="item.nfcList && item.nfcList.length > 0" :border="false">
+                    <div
+                      v-if="img.img"
+                      class="nfc-img"
+                      v-for="(img, i) in item.nfcList"
+                      :key="img.img"
+                      @click="preViewNFC(i)"
+                    >
+                      <img :src="imgUrl(img.img)" alt="" />
+                      <span>{{ img.checkName }}</span>
                     </div>
                   </van-cell>
-                  <select-cell required :disabled="!enable" title="整改期限" v-model="item.rectificationDeadline"  :data-list="getDictItem('rectification_deadline')" />
+                  <select-cell
+                    required
+                    :disabled="!enable"
+                    title="整改期限"
+                    v-model="item.rectificationDeadline"
+                    :data-list="getDictItem('rectification_deadline')"
+                  />
                   <van-field
                     required
                     v-model="item.remark"
@@ -65,42 +87,47 @@
                     autosize
                     label="情况描述:"
                     type="textarea"
-                    placeholder="请输入"/>
-                  <div class="upload-box" >
-                    <uploader v-if="enable" :maxCount="5"  v-model="item.imgData"/>
+                    placeholder="请输入"
+                  />
+                  <div class="upload-box">
+                    <uploader v-if="enable" :maxCount="5" v-model="item.imgData" />
                     <van-cell v-else-if="item.imgData">
-                      <div class="nfc-img van-hairline--surround" v-for="(v,i) in item.imgData" :key="v.imgPath" @click="clickWarnImage(item.imgData,i)">
-                        <img :src="imgUrl(v.imgPath)" alt="" >
+                      <div
+                        class="nfc-img van-hairline--surround"
+                        v-for="(v, i) in item.imgData"
+                        :key="v.imgPath"
+                        @click="clickWarnImage(item.imgData, i)"
+                      >
+                        <img :src="imgUrl(v.imgPath)" alt="" />
                       </div>
-<!--                      <img class="nfc-img" v-for="v in item.imgData" :src="imgUrl(v.imgPath)" alt="" :key="v.id">-->
+                      <!--                      <img class="nfc-img" v-for="v in item.imgData" :src="imgUrl(v.imgPath)" alt="" :key="v.id">-->
                     </van-cell>
                   </div>
                 </van-cell-group>
-<!--                <date-cell-->
-<!--                  :disabled="!enable"-->
-<!--                  v-if="item.businessType === 1"-->
-<!--                  v-for="(val,ind) in item.protectionVo"-->
-<!--                  :title="val.protectionName"-->
-<!--                  v-model="val.statusUpdateTime"-->
-<!--                  :key="val.id"-->
-<!--                  date-type="datetime" />-->
+                <!--                <date-cell-->
+                <!--                  :disabled="!enable"-->
+                <!--                  v-if="item.businessType === 1"-->
+                <!--                  v-for="(val,ind) in item.protectionVo"-->
+                <!--                  :title="val.protectionName"-->
+                <!--                  v-model="val.statusUpdateTime"-->
+                <!--                  :key="val.id"-->
+                <!--                  date-type="datetime" />-->
               </div>
             </van-collapse-item>
           </van-collapse>
-        </div >
+        </div>
       </fieldset>
     </div>
     <!--  按钮   -->
     <div v-if="enable" class="flex-box">
-      <van-button type="default" style="width: 30%;" plain  @click="accredit">授权</van-button>
-      <van-button type="info" style="width: 30%;" plain hairline @click="saveData">保存</van-button>
-      <van-button type="info" style="width: 30%;"  @click="submitData">提交</van-button>
+      <van-button type="default" style="width: 30%" plain @click="accredit">授权</van-button>
+      <van-button type="info" style="width: 30%" plain hairline @click="saveData">保存</van-button>
+      <van-button type="info" style="width: 30%" @click="submitData">提交</van-button>
     </div>
 
-
-<!--    <van-image-preview v-model="showPreView" :images="preViewImages.images" :startPosition="preViewImages.startPosition">-->
-<!--      <template v-slot:index>第{{ index }}页</template>-->
-<!--    </van-image-preview>-->
+    <!--    <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" @change="changeNfcImg"></nfc-popup>
@@ -111,340 +138,339 @@
 </template>
 
 <script>
-
-import NavBar from '@/components/NavBar';
-import SelectCell from '@/components/selectCell';
-import DateCell from '@/components/dateCell';
-import Uploader from '@/components/upload/uploader';
-import NfcPopup from '@/components/nfcPopup/more';
+import NavBar from '@/components/NavBar'
+import SelectCell from '@/components/selectCell'
+import DateCell from '@/components/dateCell'
+import Uploader from '@/components/upload/uploader'
+import NfcPopup from '@/components/nfcPopup/more'
 import AddCheck from './addCheck'
-import {registerDetail,registerSubmit} from "./api";
-import {imgUrl} from "@/utils";
-import { ImagePreview } from 'vant';
-import {mapGetters} from "vuex";
+import { registerDetail, registerSubmit } from './api'
+import { imgUrl } from '@/utils'
+import { ImagePreview } from 'vant'
+import { mapGetters } from 'vuex'
 
 export default {
-  name:'securityDetail',
-  components:{NavBar,SelectCell,DateCell,Uploader,NfcPopup,AddCheck},
-  data(){
+  name: 'securityDetail',
+  components: { NavBar, SelectCell, DateCell, Uploader, NfcPopup, AddCheck },
+  data() {
     return {
-      id:null,
+      id: null,
       activeNames: ['1'],
       //基本信息
-      taskInfo:[],
-      NFCList:[],
+      taskInfo: [],
+      NFCList: [],
       //区域下检查内容列表
-      checkList:[],
+      checkList: [],
       //检查内容具体项列表
-      checkItemList:[],
+      checkItemList: [],
       //nfc扫描数量
-      NFCNum:0,
+      NFCNum: 0,
       //所有检查项数量
-      allCheckNum:0,
+      allCheckNum: 0,
       //区域下检查项数量
-      checkNum:0,
+      checkNum: 0,
       //nfc图片
-      nfcImage:[],
-      enable:false,
-      stateList:[],
-      dayList:[],
-      preViewImages:{
-        images:[],
-        startPosition:0
-      },
-      dicts:['safety_check_status','rectification_deadline'],
-      showPreView:false,
-      selected:null,
-      active:true,
-      go:{
-        type:'replace',
-        path:'/securityCheckRegister',
+      nfcImage: [],
+      enable: false,
+      stateList: [],
+      dayList: [],
+      preViewImages: {
+        images: [],
+        startPosition: 0
       },
+      dicts: ['safety_check_status', 'rectification_deadline'],
+      showPreView: false,
+      selected: null,
+      active: true,
+      go: {
+        type: 'replace',
+        path: '/securityCheckRegister'
+      }
     }
   },
-  computed:{
+  computed: {
     ...mapGetters(['dictionary'])
   },
   mounted() {
-    this.id = this.$route.query.id;
-    this.getData();
+    this.id = this.$route.query.id
+    this.getData()
   },
-  methods:{
-    addItem(val){
-      console.log(val,'list')
-      if(!val)return
-      let str =  JSON.parse(JSON.stringify(val));
-      str.forEach((valItem) => {
-        console.log(this.checkList,'checkList')
+  methods: {
+    addItem(val) {
+      console.log(val, 'list')
+      if (!val) return
+      let str = JSON.parse(JSON.stringify(val))
+      str.forEach(valItem => {
+        console.log(this.checkList, 'checkList')
         // 查找是否有与 valItem.itemId 相同的项
-        const existingItem = this.checkList.find((checkItem) => checkItem.itemId === valItem.itemId);
+        const existingItem = this.checkList.find(checkItem => checkItem.itemId === valItem.itemId)
         if (existingItem) {
           // // 如果存在相同 itemId 的项,查找 pointList 是否有与 valItem.pointId 相同的项
-          const existingPoint = existingItem.pointList.find((pointItem) => pointItem.pointId === valItem.id);
+          const existingPoint = existingItem.pointList.find(pointItem => pointItem.pointId === valItem.id)
           if (!existingPoint) {
-            console.log(existingItem,'point添加成功')
-            this.$nextTick(()=>{
-              existingItem.pointList.push(valItem);
-              this.active = true;
+            console.log(existingItem, 'point添加成功')
+            this.$nextTick(() => {
+              existingItem.pointList.push(valItem)
+              this.active = true
             })
-          }else {
-            this.$toast(existingPoint.pointName+'已添加');
+          } else {
+            this.$toast(existingPoint.pointName + '已添加')
           }
         } else {
-          console.log(valItem,'item添加成功')
-            this.checkList.push({
-              itemId: valItem.itemId,
-              itemName: valItem.itemName,
-              pointList: [valItem],
-            });
-            this.active = true;
+          console.log(valItem, 'item添加成功')
+          this.checkList.push({
+            itemId: valItem.itemId,
+            itemName: valItem.itemName,
+            pointList: [valItem]
+          })
+          this.active = true
         }
-      });
+      })
     },
-    goBack(){
-      this.active = true;
+    goBack() {
+      this.active = true
     },
-    getState(state){
-       switch (state){
-         case '待检查':
-            return '#bbbbbb';
-         case '进行中':
-            return '#008cd6';
-         case '完成':
-            return '#009240';
-         case '已过期':
-            return '#D7000F';
-       }
+    getState(state) {
+      switch (state) {
+        case '待检查':
+          return '#bbbbbb'
+        case '进行中':
+          return '#008cd6'
+        case '完成':
+          return '#009240'
+        case '已过期':
+          return '#D7000F'
+      }
     },
-    addCheck(){
-      this.active = false;
+    addCheck() {
+      this.active = false
     },
-    clickWarnImage(arr,i){
-      this.preViewImages.images = arr.map(v=>imgUrl(v.imgPath));
-      this.preViewImages.startPosition = i;
+    clickWarnImage(arr, i) {
+      this.preViewImages.images = arr.map(v => imgUrl(v.imgPath))
+      this.preViewImages.startPosition = i
       ImagePreview(this.preViewImages)
     },
-    preViewNFC(i){
-      this.preViewImages.images = this.nfcImage.map(v=>imgUrl(v.img));
-      this.preViewImages.startPosition = i;
+    preViewNFC(i) {
+      this.preViewImages.images = this.nfcImage.map(v => imgUrl(v.img))
+      this.preViewImages.startPosition = i
       ImagePreview(this.preViewImages)
     },
-    getDicts(s){
-      return this.stateList.find(v=> s == v.dictValue).dictLabel;
+    getDicts(s) {
+      return this.stateList.find(v => s == v.dictValue).dictLabel
     },
     //初始化数据
     getData() {
-      let taskId = this.$route.query.id;
-      registerDetail(taskId).then(res=>{
-        console.log(res,'res')
-        this.taskInfo = res.data;
-        this.enable = this.taskInfo.status === 1 || this.taskInfo.status === 2; //是否可编辑
-        this.checkList = res.data.checkList;
+      let taskId = this.$route.query.id
+      registerDetail(taskId).then(res => {
+        console.log(res, 'res')
+        this.taskInfo = res.data
+        this.enable = this.taskInfo.status === 1 || this.taskInfo.status === 2 //是否可编辑
+        this.checkList = res.data.checkList
         //设置默认展开项
-        this.activeNames = this.checkList.map(v=>v.itemName);
+        this.activeNames = this.checkList.map(v => v.itemName)
       })
     },
     //保存数据
-    saveData(){
+    saveData() {
       //验证必填项
-      let pointData = [];
-      this.checkList.forEach(v=>{
-        v.pointList.forEach(item=>{
-          pointData.push(item);
+      let pointData = []
+      this.checkList.forEach(v => {
+        v.pointList.forEach(item => {
+          pointData.push(item)
         })
       })
-      let arr = pointData.filter(v=>{
-        if(v.status === 1 ){
+      let arr = pointData.filter(v => {
+        if (v.status === 1) {
           return !v.remark || !v.rectificationDeadline
         }
       })
-      if(arr.length) return this.$toast(`${arr[0].itemName}:该信息不完整请填写`);
-      this.taskInfo.isSubmit = 0;
-      registerSubmit(this.taskInfo).then(res=>{
-        this.$toast('保存成功');
-        this.$router.replace ({
-          path:'/securityCheckRegister',
-        });
+      if (arr.length) return this.$toast(`${arr[0].itemName}:该信息不完整请填写`)
+      this.taskInfo.isSubmit = 0
+      registerSubmit(this.taskInfo).then(res => {
+        this.$toast('保存成功')
+        this.$router.replace({
+          path: '/securityCheckRegister'
+        })
       })
     },
 
     //提交数据
-    submitData(){
+    submitData() {
       //验证必填项
-      let pointData = [];
-      this.checkList.forEach(v=>{
-        v.pointList.forEach(item=>{
-          pointData.push(item);
+      let pointData = []
+      this.checkList.forEach(v => {
+        v.pointList.forEach(item => {
+          pointData.push(item)
         })
       })
-      let arr = pointData.filter(v=>{
-        if(v.status === 1 ){
+      let arr = pointData.filter(v => {
+        if (v.status === 1) {
           return !v.remark || !v.rectificationDeadline
         }
       })
-      if(arr.length) return this.$toast(`${arr[0].itemName}:该信息不完整请填写`);
+      if (arr.length) return this.$toast(`${arr[0].itemName}:该信息不完整请填写`)
       //console.log( this.taskInfo,' this.taskInfo')
-      this.taskInfo.isSubmit = 1;
-      registerSubmit(this.taskInfo).then(res=>{
-        this.$toast('提交成功');
-        this.$router.replace ({
-          path:'/securityCheckRegister',
-        });
+      this.taskInfo.isSubmit = 1
+      registerSubmit(this.taskInfo).then(res => {
+        this.$toast('提交成功')
+        this.$router.replace({
+          path: '/securityCheckRegister'
+        })
       })
     },
 
     //授权
-    accredit(){
-      let {checkOrgId,ymdDate,planId,beCheckedOrgId,id } = this.taskInfo;
-      console.log(checkOrgId,'checkOrgId')
+    accredit() {
+      let { checkOrgId, ymdDate, planId, beCheckedOrgId, id } = this.taskInfo
+      console.log(checkOrgId, 'checkOrgId')
       this.$router.push({
         path: '/addWorker',
-        query:{
-          orgId:checkOrgId,
+        query: {
+          orgId: checkOrgId,
           ymdDate,
           planId,
           beCheckedOrgId,
-          taskId:id
+          taskId: id
         }
-      });
+      })
     },
     //点击NFC图标
-    clickNFC(arr){
+    clickNFC(arr) {
       //if(arr.length === 0) return;
       // let arr = this.selectArea.nfclist.filter(item=>{
       //   return item.status == 0;
       // })
-      this.$refs.NfcPopup.show(arr);
+      this.$refs.NfcPopup.show(arr)
     },
     //清空数据
-    clearData(){
-      this.areaList = [];
-      this.taskInfo= [];
-      this.selectArea = [];
-      this.NFCList = [];
-      this.checkList = [];
-      this.checkItemList = [];
-      this.NFCNum = 0;
-      this.enable = false;
+    clearData() {
+      this.areaList = []
+      this.taskInfo = []
+      this.selectArea = []
+      this.NFCList = []
+      this.checkList = []
+      this.checkItemList = []
+      this.NFCNum = 0
+      this.enable = false
     },
     //切换开关时添加操作时间
-    switchChange(item){
-      console.log(item,'666')
+    switchChange(item) {
+      console.log(item, '666')
       //item.resTime = formatDate(new Date());
     },
     //添加图片时的回调
-    changeNfcImg(imgItem){
-      console.log(imgItem,this.selectArea.nfclist,'imgItem')
-      this.selectArea.nfclist.forEach(v=>{
-        if(v.nfccdoe === imgItem.nfcCode){
-          v.img = imgItem.url;
-          v.status = 1;
-          v.scanMethod = 1;
-          this.nfcImage.push(v);
+    changeNfcImg(imgItem) {
+      console.log(imgItem, this.selectArea.nfclist, 'imgItem')
+      this.selectArea.nfclist.forEach(v => {
+        if (v.nfccdoe === imgItem.nfcCode) {
+          v.img = imgItem.url
+          v.status = 1
+          v.scanMethod = 1
+          this.nfcImage.push(v)
         }
       })
-      console.log( this.selectArea.nfclist,this.nfcImage,'nfcObj')
-    },
+      console.log(this.selectArea.nfclist, this.nfcImage, 'nfcObj')
+    }
   }
 }
 </script>
 <style lang="scss" scoped>
-  .register-edit{
-    height: 100%;
-    overflow: hidden;
-    .page-container{
-      height: calc(100vh - 220px);
-      overflow: auto;
-      padding: 20px;
-    }
-    .flex-box{
-      padding: 20px;
-      display: flex;
-      justify-content: space-between;
-      align-items: center;
-      >span{
-        margin: 0 20px;
-      }
-    }
-    .legend{
-      background-color: #fff;
-      padding: 0 20px;
-      height: 80px;
-      line-height: 80px;
-      font-size: 30px;
-      display: flex;
-      justify-content: space-between;
-      >span{
-        color: orange;
-      }
-    }
-    .card{
-      margin-bottom: 20px;
-      box-shadow: 0 10px 10px #eaeaea;
-      &:last-child{
-        margin-bottom: 0;
-      }
-    }
-    .check-area{
-      background-color: #f1f1f1;
-      margin: 10px;
-      padding:20px;
-      color:#aaa;
-      border-radius: 6px;
-      display: flex;
-      justify-content: space-between;
-      align-items: center;
-      box-shadow: 0 2px 6px #ddd;
-    }
-    .nfc-icon{
-      width: 50px;
-      height: 50px;
-      margin-left: 20px;
-    }
-    .custom-title {
-      align-self: center;
-      vertical-align: middle;
-    }
-    .upload-box{
-      margin: 30px;
+.register-edit {
+  height: 100%;
+  overflow: hidden;
+  .page-container {
+    height: calc(100vh - 220px);
+    overflow: auto;
+    padding: 20px;
+  }
+  .flex-box {
+    padding: 20px;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    > span {
+      margin: 0 20px;
     }
-    .warning-msg{
+  }
+  .legend {
+    background-color: #fff;
+    padding: 0 20px;
+    height: 80px;
+    line-height: 80px;
+    font-size: 30px;
+    display: flex;
+    justify-content: space-between;
+    > span {
       color: orange;
-      text-align: center;
-      height: 80px;
-      line-height: 80px;
     }
-    .active{
-      color: #fff;
-      background-color: #1989fa;
+  }
+  .card {
+    margin-bottom: 20px;
+    box-shadow: 0 10px 10px #eaeaea;
+    &:last-child {
+      margin-bottom: 0;
     }
-    .nfc-img{
-      display: inline-block;
-      width: 140px;
-      height: 140px;
-      margin: 0 10px;
-      position: relative;
-      >img{
-        width: 100%;
-        height: 100%;
-        border: none;
-      }
-      >span{
-        position: absolute;
-        padding: 0 10px;
-        bottom: 0;
-        left: 0;
-        display: block;
-        width: 100%;
-        background-color: rgba(0,0,0,.2 );
-        color: #eaeaea;
-        font-size: 20px;
-        overflow: hidden;
-        text-overflow: ellipsis;
-        white-space: nowrap;
-        line-height: 30px;
-        height: 30px;
-      }
+  }
+  .check-area {
+    background-color: #f1f1f1;
+    margin: 10px;
+    padding: 20px;
+    color: #aaa;
+    border-radius: 6px;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    box-shadow: 0 2px 6px #ddd;
+  }
+  .nfc-icon {
+    width: 50px;
+    height: 50px;
+    margin-left: 20px;
+  }
+  .custom-title {
+    align-self: center;
+    vertical-align: middle;
+  }
+  .upload-box {
+    margin: 30px;
+  }
+  .warning-msg {
+    color: orange;
+    text-align: center;
+    height: 80px;
+    line-height: 80px;
+  }
+  .active {
+    color: #fff;
+    background-color: #1989fa;
+  }
+  .nfc-img {
+    display: inline-block;
+    width: 140px;
+    height: 140px;
+    margin: 0 10px;
+    position: relative;
+    > img {
+      width: 100%;
+      height: 100%;
+      border: none;
+    }
+    > span {
+      position: absolute;
+      padding: 0 10px;
+      bottom: 0;
+      left: 0;
+      display: block;
+      width: 100%;
+      background-color: rgba(0, 0, 0, 0.2);
+      color: #eaeaea;
+      font-size: 20px;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      line-height: 30px;
+      height: 30px;
     }
   }
+}
 </style>