2 커밋 0f4c0a074d ... e11d25ab63

작성자 SHA1 메시지 날짜
  tianxinyu e11d25ab63 Merge branch '15189标准版' of http://119.23.210.103:3000/WuYi/zdqy_firm_former into 15189标准版 2 주 전
  tianxinyu 632a3a18c2 设备状态文案全局调整 2 주 전

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 4 - 4
src/utils/query.js


+ 6 - 4
src/views/component/device/deviceDialog.vue

@@ -1297,7 +1297,7 @@ export default {
     stateList: {
       type: Object,
       default: function () {
-        return { 停用: '停用', 报废: '报废', 合格: '合格' }
+        return { 正常使用: '正常使用', 暂停使用: '暂停使用', 停止使用: '停止使用' }
       }
     },
     hideSysDeviceNo: {
@@ -1600,6 +1600,7 @@ export default {
       return []
     },
     showState() {
+      console.log('this.form.sheBeiZhuangTa', this.form.sheBeiZhuangTa, this.stateList, this.stateList[this.form.sheBeiZhuangTa])
       return (
         this.stateList[this.form.sheBeiZhuangTa] || this.form.sheBeiZhuangTa
       )
@@ -1629,10 +1630,10 @@ export default {
       handler(val, old) {
         if (!old) return
         if (val === '否') {
-          this.form.sheBeiZhuangTa = '合格'
+          this.form.sheBeiZhuangTa = '正常使用'
         } else if (val === '是') {
           this.form.caiGouHeTong = ''
-          this.form.sheBeiZhuangTa = '用'
+          this.form.sheBeiZhuangTa = '暂停使用'
         }
       }
     },
@@ -1695,6 +1696,7 @@ export default {
 
   mounted() {
     this.init()
+    console.log('showState', this.showState)
   },
   methods: {
     changeGuanLiRen(key, data) {
@@ -1944,7 +1946,7 @@ export default {
         this.form.bianZhiShiJian = dayjs().format('YYYY-MM-DD HH:mm')
         this.form.shiFouGuoShen = '已完成'
         this.form.sheBeiLeiXing = '检验系统'
-        this.form.sheBeiZhuangTa = '合格'
+        this.form.sheBeiZhuangTa = '正常使用'
         this.form.shiFouXiaoZhun = '是'
         this.form.jianKongYiJu = '否'
         this.form.shiFouWeiHu = '是'

+ 20 - 32
src/views/component/device/index.vue

@@ -63,7 +63,7 @@
 
           <template slot="deviceStateSlot" slot-scope="{ row }">
             <span>{{
-              stateList[row.sheBeiZhuangTa] || row.sheBeiZhuangTa || ''
+              row.sheBeiZhuangTa || ''
             }}</span>
           </template>
           <template slot="deviceTypeSlot" slot-scope="{ row }">
@@ -425,7 +425,6 @@
       def-id="1120718364969271296"
       @close="(visible) => (npmDialogFormVisible = visible)"
     />
-    <!-- <DeviceTagWeiNing v-if="tagName==='deviceTagWeiNing'" :scan-visible="printVisible" :obj="printObj" :state-list="stateList" @scanOff="scanOff" /> -->
     <DeviceTagTemplateTwo
       v-if="tagName === 'deviceTagTemplateTwo'"
       :tag-data="tagData"
@@ -442,13 +441,6 @@
       :state-list="stateList"
       @scanOff="scanOff"
     />
-    <DeviceTagTemplateHengSheng
-      v-else-if="tagName === 'hengsheng'"
-      :scan-visible="printVisible"
-      :obj="printObj"
-      :state-list="stateList"
-      @scanOff="scanOff"
-    />
     <DeviceTag
       v-else
       :scan-visible="printVisible"
@@ -503,16 +495,12 @@ import {
 import CustomDialog from '@/business/platform/data/templaterender/custom-dialog/dialog'
 import dayjs from 'dayjs'
 import DeviceTag from '@/views/system/jbdScan/goods/deviceTag.vue'
-// import DeviceTagWeiNing from '@/views/system/jbdScan/goods/deviceTagWeiNing.vue'
 import DeviceTagTemplateTwo from '@/views/system/jbdScan/goods/deviceTagTemplateTwo'
-import DeviceTagTemplateHengSheng from '@/views/system/jbdScan/goods/deviceTag-hengsheng'
 import DeviceTagTemplateThree from '@/views/system/jbdScan/goods/deviceTagTemplateThree'
 export default {
   components: {
     DeviceTag,
-    // DeviceTagWeiNing,
     DeviceTagTemplateTwo,
-    DeviceTagTemplateHengSheng,
     DeviceTagTemplateThree,
     DataTemplateFormrenderDialog,
     DeviceDialog,
@@ -817,7 +805,7 @@ export default {
         yuanSheBeiBian: setting?.device?.hideSysDeviceNo
           ? '设备编号(必填,且不可重复)'
           : '原设备编号(必填,且不可重复)',
-        sheBeiZhuangTa: '设备状态(合格/停用/限用)',
+        sheBeiZhuangTa: '设备状态(正常使用/暂停使用/停止使用)',
         sheBeiLeiXing: setting?.syatem?.isJYB ?  '设备类型(检验系统/通用设备/软件/信息系统)' : '设备类型(检测设备/辅助仪器设备/信息系统/环境监测设备)',
         shiFouWeiHu: '是否维护(是/否)',
         shiFouXiaoZhun: '是否校准(是/否)',
@@ -898,7 +886,7 @@ export default {
       validationRules: {
         设备状态: {
           field: 'sheBeiZhuangTa',
-          range: ['合格', '停用', '限用', '报废']
+          range: ['正常使用','暂停使用','停止使用']
         },
         设备类型: {
           field: 'sheBeiLeiXing',
@@ -954,7 +942,7 @@ export default {
         年保养: this.generateRule(12, `每年第`, `个月`),
         按需保养: ['/']
       },
-      stateList: { 停用: '停用', 报废: '报废', 合格: '合格' },
+      stateList: { 正常使用: '正常使用', 暂停使用: '暂停使用', 停止使用: '停止使用' },
       hideSysDeviceNo: false,
       hidefuJianShang: false,
       hasFuZeRenDianHua: false,
@@ -979,7 +967,7 @@ export default {
   async mounted() {
     const res = await getSetting()
     const {
-      stateList,
+      // stateList,
       hideSysDeviceNo,
       hidefuJianShang,
       tabList,
@@ -1001,10 +989,10 @@ export default {
       this.hasRole =
         isSuper || role.some((r) => hasDeviceRole.includes(r.alias))
     }
-    if (stateList) {
-      console.debug('stateList', stateList)
-      this.stateList = stateList
-    }
+    // if (stateList) {
+    //   console.debug('stateList', stateList)
+    //   this.stateList = stateList
+    // }
     if (typeList) {
       console.debug('typeList', typeList)
       this.typeList = typeList
@@ -1390,7 +1378,7 @@ export default {
     },
     // 导入
     handleCustomImport() {
-      this.$confirm('请选择导入的类型', '提示', {
+      this.$confirm('请选择导入的类型', '提示', {
         confirmButtonText: '导入设备',
         cancelButtonText: '导入维护项目',
         closeOnClickModal: false,
@@ -1517,9 +1505,9 @@ export default {
           item.shiYongKeShi = this.switchGYSIdToName(item.shiYongKeShi, gysData)
         }
 
-        if (this.stateList[item.sheBeiZhuangTa]) {
-          item.sheBeiZhuangTa = this.stateList[item.sheBeiZhuangTa]
-        }
+        // if (this.stateList[item.sheBeiZhuangTa]) {
+        //   item.sheBeiZhuangTa = this.stateList[item.sheBeiZhuangTa]
+        // }
         if (this.typeList[item.sheBeiLeiXing]) {
           item.sheBeiLeiXing = this.typeList[item.sheBeiLeiXing]
         }
@@ -2067,13 +2055,13 @@ export default {
       }) // 这个t用于兼容老版本的模板
       importData.forEach((i) => {
         delete i.sheBeiShiBieH // 设备编号需自动生成
-        // i.sheBeiZhuangTa = '合格'
-        const keyFound = Object.entries(this.stateList).find(
-          ([key, value]) => value === i.sheBeiZhuangTa
-        )
-        if (keyFound) {
-          i.sheBeiZhuangTa = keyFound[0]
-        }
+        // // i.sheBeiZhuangTa = '合格'
+        // const keyFound = Object.entries(this.stateList).find(
+        //   ([key, value]) => value === i.sheBeiZhuangTa
+        // )
+        // if (keyFound) {
+        //   i.sheBeiZhuangTa = keyFound[0]
+        // }
         const keyFound2 = Object.entries(this.typeList).find(
           ([key, value]) => value === i.sheBeiLeiXing
         )

+ 0 - 2543
src/views/component/device/indexChuanBei.vue

@@ -1,2543 +0,0 @@
-<template>
-  <div class="main-container">
-    <ibps-container class="page">
-      <template>
-        <ibps-crud
-          key="istree"
-          ref="crud"
-          :data="listData"
-          :toolbars="
-            readOnly
-              ? listConfig.toolbars.filter((obj) => {
-                  return obj.key == 'search'
-                })
-              : config
-              ? listConfig.toolbars.filter((obj) => {
-                  return obj.key !== 'customSetting'
-                })
-              : listConfig.toolbars
-          "
-          :search-form="listConfig.searchForm"
-          :pk-key="pkKey"
-          :columns="listConfig.columns"
-          :loading="loading"
-          :pagination="pagination"
-          :display-field="tableTitle"
-          :index-row="false"
-          @sort-change="handleSortChange"
-          @action-event="handleAction"
-          @pagination-change="handlePaginationChange"
-        >
-          <template slot="posSlot" slot-scope="{ row }">
-            <ibps-user-selector
-              v-model="row.bianZhiBuMen"
-              type="position"
-              readonly-text="text"
-              :multiple="false"
-              :disabled="true"
-            />
-          </template>
-          <template slot="userSlot" slot-scope="{ row }">
-            <ibps-user-selector
-              v-model="row.guanLiRen"
-              type="user"
-              readonly-text="text"
-              :multiple="true"
-              :disabled="true"
-            />
-          </template>
-
-          <template slot="deviceSlot" slot-scope="{ row }">
-            <ibps-custom-dialog
-              v-model="row.weiHuFangShi"
-              size="mini"
-              :template-key="config ? 'gwzzdhkrcwh' : 'sbbqdhk'"
-              multiple
-              :disabled="true"
-              type="dialog"
-              class="custom-dialog"
-              placeholder="请选择"
-              icon="el-icon-search"
-            />
-          </template>
-
-          <template slot="deviceStateSlot" slot-scope="{ row }">
-            <span>{{
-              stateList[row.sheBeiZhuangTa] || row.sheBeiZhuangTa || ''
-            }}</span>
-          </template>
-          <template slot="deviceTypeSlot" slot-scope="{ row }">
-            <span>{{
-              typeList[row.sheBeiLeiXing] || row.sheBeiLeiXing || ''
-            }}</span>
-          </template>
-
-          <template slot="placeSlot" slot-scope="{ row }">
-            <ibps-custom-dialog
-              v-model="row.cunFangWeiZhi"
-              size="mini"
-              template-key="fjxzkdd"
-              multiple
-              :disabled="true"
-              type="dialog"
-              class="custom-dialog"
-              placeholder="请选择"
-              icon="el-icon-search"
-            />
-          </template>
-
-          <template slot="customButton" slot-scope="{ row }">
-            <el-button
-              type="text"
-              :icon="
-                hasRole && !readOnly ? 'el-icon-edit-outline' : 'ibps-icon-eye'
-              "
-              @click="goEdit(row)"
-              >{{ hasRole && !readOnly ? '修改' : '查阅' }}</el-button
-            >
-            <!-- <el-button type="text" icon="el-icon-view" @click="goLook(row)">查阅</el-button> -->
-            <el-button
-              type="text"
-              icon="ibps-icon-table"
-              @click="goLookForm(row)"
-              >表单</el-button
-            >
-          </template>
-          <template slot="expandSlot" slot-scope="{ row }">
-            <el-row
-              :gutter="20"
-              style="height: 145px; padding: 0 20px 0 0"
-              type="flex"
-              align="middle"
-            >
-              <el-col :span="5" :push="2">
-                <el-row>
-                  <el-col :span="3">
-                    <el-image
-                      class="icon-image"
-                      :src="images[0]"
-                      fit="contain"
-                    />
-                  </el-col>
-                  <el-col :span="21">
-                    <div class="title">验收信息</div>
-                    <div class="ctx">
-                      <div class="item">
-                        接收日期:{{ row.jieShouRiQi || '/' }}
-                      </div>
-                      <div class="item">
-                        验收日期:{{ row.yanShouRiQi || '/' }}
-                      </div>
-                      <div class="item">
-                        核查日期:{{ row.biXuSheShi || '/' }}
-                      </div>
-                    </div>
-                  </el-col>
-                </el-row>
-              </el-col>
-              <el-col :span="5" :push="2">
-                <el-row>
-                  <el-col :span="3">
-                    <el-image
-                      class="icon-image"
-                      :src="images[1]"
-                      fit="contain"
-                    />
-                  </el-col>
-                  <el-col :span="21">
-                    <div class="title">建档信息</div>
-                    <div class="ctx">
-                      <div class="item">
-                        <div class="cusitem">
-                          <span class="span">建档人:</span>
-                          <ibps-user-selector
-                            :value="row.bianZhiRen"
-                            type="user"
-                            readonly-text="text"
-                            :multiple="true"
-                            :disabled="true"
-                            size="mini"
-                            style="width: 100px"
-                          />
-                        </div>
-                      </div>
-                      <div class="item">
-                        <div class="cusitem">
-                          <span class="span">建档部门:</span>
-                          <ibps-user-selector
-                            :value="row.bianZhiBuMen"
-                            type="position"
-                            readonly-text="text"
-                            :disabled="true"
-                            :multiple="false"
-                            size="mini"
-                            style="width: 100px"
-                          />
-                        </div>
-                      </div>
-                      <div class="item">
-                        建档时间:{{ row.bianZhiShiJian || '/' }}
-                      </div>
-                    </div>
-                  </el-col>
-                </el-row>
-              </el-col>
-              <el-col :span="5" :push="2">
-                <el-row>
-                  <el-col :span="3">
-                    <el-image
-                      class="icon-image"
-                      :src="images[2]"
-                      fit="contain"
-                    />
-                  </el-col>
-                  <el-col :span="21">
-                    <div class="title">维护信息</div>
-                    <div class="ctx">
-                      <div class="item">
-                        是否维护:{{ row.shiFouWeiHu || '/' }}
-                      </div>
-                      <div class="item">
-                        是否24H开机:{{ row.jianKongYiJu || '/' }}
-                      </div>
-                      <div class="item">
-                        是否限用:{{ row.xiaoZhunWuCha || '/' }}
-                      </div>
-                    </div>
-                  </el-col>
-                </el-row>
-              </el-col>
-              <el-col :span="5" :push="2">
-                <el-row>
-                  <el-col :span="3">
-                    <el-image
-                      class="icon-image"
-                      :src="images[3]"
-                      fit="contain"
-                    />
-                  </el-col>
-                  <el-col :span="21">
-                    <div class="title">校准信息</div>
-                    <div class="ctx">
-                      <div class="item">
-                        是否校准:{{ row.shiFouXiaoZhun || '/' }}
-                      </div>
-                      <div class="item">
-                        校准周期:{{
-                          row.xiaoZhunZQ ? `${row.xiaoZhunZQ}月` : '/'
-                        }}
-                      </div>
-                      <div class="item">
-                        最近校准时间:{{ row.yiXiaoRiQi || '/' }}
-                      </div>
-                      <div class="item">
-                        校准有效期至:{{ row.xiaoZhunYouXia || '/' }}
-                      </div>
-                    </div>
-                  </el-col>
-                </el-row>
-              </el-col>
-              <el-col :span="4" :push="1">
-                <el-row>
-                  <el-col :span="24">
-                    <el-image
-                      class="device-image"
-                      :src="ImageUrl(row)"
-                      fit="fill"
-                      :preview-src-list="ImageAllUrl(row)"
-                      :title="`[${row.sheBeiMingCheng}]设备首图,点击查看更多`"
-                    >
-                      <div slot="error" class="image-slot">
-                        <el-empty
-                          class="device-image"
-                          description="暂无图片"
-                          :image-size="70"
-                        />
-                      </div>
-                    </el-image>
-                  </el-col>
-                </el-row>
-              </el-col>
-            </el-row>
-          </template>
-          <!-- 搜索条件 -->
-          <template slot="pos">
-            <ibps-user-selector
-              v-model="search.pos"
-              type="position"
-              :multiple="true"
-              size="mini"
-              :filter="filter"
-              :disabled="showDeptSeach"
-              filtrate
-            />
-          </template>
-          <template slot="time">
-            <el-date-picker
-              v-model="search.time"
-              size="mini"
-              type="daterange"
-              :picker-options="pickerOptions"
-              range-separator="至"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              align="right"
-              value-format="yyyy-MM-dd"
-            />
-          </template>
-          <template slot="validity">
-            <el-date-picker
-              v-model="search.validity"
-              size="mini"
-              type="daterange"
-              :picker-options="pickerOptions"
-              range-separator="至"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              align="right"
-              value-format="yyyy-MM-dd"
-            />
-          </template>
-          <template slot="nowNumber">
-            <el-input v-model="search.nowNumber" size="mini" />
-          </template>
-          <template slot="preNumber">
-            <el-input v-model="search.preNumber" size="mini" />
-          </template>
-          <template slot="deviceName">
-            <el-input v-model="search.deviceName" size="mini" />
-          </template>
-          <template slot="deviceType">
-            <el-select
-              v-model="search.deviceType"
-              placeholder="请选择"
-              size="mini"
-              :clearable="true"
-            >
-              <el-option
-                v-for="(v, k) in typeList"
-                :key="k"
-                :label="v"
-                :value="k"
-              />
-            </el-select>
-          </template>
-          <template slot="deviceStatus">
-            <el-select
-              v-model="search.deviceStatus"
-              placeholder="请选择"
-              size="mini"
-              :clearable="true"
-            >
-              <el-option
-                v-for="(v, k) in stateList"
-                :key="k"
-                :label="v"
-                :value="k"
-              />
-            </el-select>
-          </template>
-          <!-- <template slot="place">
-                        <el-input v-model="search.place" size="mini" />
-                    </template> -->
-          <template slot="place">
-            <ibps-custom-dialog
-              v-model="search.place"
-              size="mini"
-              template-key="fjxzkdd"
-              multiple
-              :disabled="false"
-              type="dialog"
-              class="custom-dialog"
-              placeholder="请选择"
-              icon="el-icon-search"
-            />
-          </template>
-          <template slot="managePeople">
-            <ibps-user-selector
-              v-model="search.managePeople"
-              type="user"
-              readonly-text="text"
-              :multiple="true"
-              size="mini"
-              :filter="filter"
-              filtrate
-            />
-          </template>
-          <template slot="deviceClass">
-            <ibps-custom-dialog
-              v-model="search.deviceClass"
-              size="mini"
-              :template-key="config ? 'gwzzdhkrcwh' : 'sbbqdhk'"
-              multiple
-              :disabled="false"
-              type="dialog"
-              class="custom-dialog"
-              placeholder="请选择"
-              icon="el-icon-search"
-            />
-          </template>
-          <template slot="renKeXiangMuSlot">
-            <el-select
-              v-model="search.renKeXiangMu"
-              placeholder="请选择"
-              size="mini"
-              :clearable="true"
-            >
-              <el-option
-                v-for="item in renKeXiangMuOptions"
-                :label="item"
-                :value="item"
-              />
-            </el-select>
-          </template>
-          <template slot="yanShouRiQi">
-            <el-date-picker
-              v-model="search.yanShouRiQi"
-              size="mini"
-              type="daterange"
-              :picker-options="pickerOptions"
-              range-separator="至"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              align="right"
-              value-format="yyyy-MM-dd"
-            />
-          </template>
-        </ibps-crud>
-
-      </template>
-    </ibps-container>
-    <DeviceDialog
-      v-if="deviceDialogShow"
-      :params="params"
-      :state-list="stateList"
-      :type-list="typeList"
-      :tab-list="tabList"
-      :hide-sys-device-no="hideSysDeviceNo"
-      :has-fu-ze-ren-dian-hua="hasFuZeRenDianHua"
-      :has-chang-jia-lian-xi-ren="hasChangJiaLianXiRen"
-      :readonly="!hasRole || readOnly"
-      :actionDialog="actionDialog"
-      :hidefu-jian-shang="hidefuJianShang"
-      @close="close"
-    />
-    <input
-      id=""
-      ref="file1"
-      type="file"
-      name=""
-      accept=".xlsx,.xls"
-      @change="handleUploadChange1"
-    />
-    <input
-      id=""
-      ref="file2"
-      type="file"
-      name=""
-      accept=".xlsx,.xls"
-      @change="handleUploadChange2"
-    />
-
-    <custom-dialog
-      :visible="customDialogVisible"
-      :value="[]"
-      template-key="sbfzpz"
-      :dynamic-params="{}"
-      @close="(visible) => (customDialogVisible = visible)"
-    />
-
-    <bpmn-formrender
-      :visible="npmDialogFormVisible"
-      def-id="1120718364969271296"
-      @close="(visible) => (npmDialogFormVisible = visible)"
-    />
-    <!-- <DeviceTagWeiNing v-if="tagName==='deviceTagWeiNing'" :scan-visible="printVisible" :obj="printObj" :state-list="stateList" @scanOff="scanOff" /> -->
-    <DeviceTagTemplateTwo
-      v-if="tagName === 'deviceTagTemplateTwo'"
-      :tag-data="tagData"
-      :scan-visible="printVisible"
-      :obj="printObj"
-      :state-list="stateList"
-      @scanOff="scanOff"
-    />
-    <DeviceTagTemplateThree
-      v-else-if="tagName === 'deviceTagTemplateThree'"
-      :tag-data="tagData"
-      :scan-visible="printVisible"
-      :obj="printObj"
-      :state-list="stateList"
-      @scanOff="scanOff"
-    />
-    <DeviceTagTemplateHengSheng
-      v-else-if="tagName === 'hengsheng'"
-      :scan-visible="printVisible"
-      :obj="printObj"
-      :state-list="stateList"
-      @scanOff="scanOff"
-    />
-    <DeviceTag
-      v-else
-      :scan-visible="printVisible"
-      :obj="printObj"
-      :tag-data="tagData"
-      :state-list="stateList"
-      @scanOff="scanOff"
-    />
-    <el-dialog
-      :close-on-click-modal="false"
-      :close-on-press-escape="false"
-      :top="'3vh'"
-      :width="'90%'"
-      class="js-custom-dialog"
-      append-to-body
-      :fullscreen="false"
-      :visible.sync="iframeVisible"
-    >
-      <iframe
-        :src="srcUrl"
-        :height="'100%'"
-        :width="'100%'"
-        frameborder="0"
-        scrolling="no"
-      />
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { getSetting } from '@/utils/query'
-import image01 from '@/assets/images/device/01.png'
-import image02 from '@/assets/images/device/02.png'
-import image03 from '@/assets/images/device/03.png'
-import image04 from '@/assets/images/device/04.png'
-import { getImage } from '@/api/platform/file/attachment'
-import { download } from '@/api/platform/file/attachment'
-
-import xlsx from 'xlsx'
-import fs from 'file-saver'
-import DataTemplateFormrenderDialog from '@/business/platform/data/templaterender/form/dialog.vue'
-import ActionUtils from '@/utils/action'
-import FixHeight from '@/mixins/height'
-import ibpsUserSelector from '@/business/platform/org/selector'
-import DeviceDialog from './deviceDialog.vue'
-import {
-  queryequipmentCard,
-  removeEquipmentCard,
-  getequipmentCard,
-  saveEquipmentCard
-} from '@/api/platform/device/device'
-import CustomDialog from '@/business/platform/data/templaterender/custom-dialog/dialog'
-import dayjs from 'dayjs'
-import DeviceTag from '@/views/system/jbdScan/goods/deviceTag.vue'
-// import DeviceTagWeiNing from '@/views/system/jbdScan/goods/deviceTagWeiNing.vue'
-import DeviceTagTemplateTwo from '@/views/system/jbdScan/goods/deviceTagTemplateTwo'
-import DeviceTagTemplateHengSheng from '@/views/system/jbdScan/goods/deviceTag-hengsheng'
-import DeviceTagTemplateThree from '@/views/system/jbdScan/goods/deviceTagTemplateThree'
-export default {
-  components: {
-    DeviceTag,
-    // DeviceTagWeiNing,
-    DeviceTagTemplateTwo,
-    DeviceTagTemplateHengSheng,
-    DeviceTagTemplateThree,
-    DataTemplateFormrenderDialog,
-    DeviceDialog,
-    ibpsUserSelector,
-    CustomDialog,
-    IbpsCustomDialog: () =>
-      import('@/business/platform/data/templaterender/custom-dialog')
-  },
-  mixins: [FixHeight],
-  data() {
-    const {
-      userId,
-      level = {},
-      position,
-      setting,
-      deptList = []
-    } = this.$store.getters || {}
-    const mainPositionId = this.$store.getters?.mainPosition?.id || ''
-    const isHighLevel = deptList
-      .filter((i) => i.depth === 3)
-      .some((i) => mainPositionId.includes(i.positionId))
-
-    return {
-      config: setting?.postJob?.allocation || false,
-      filter: [
-        {
-          descVal: '1',
-          includeSub: true,
-          old: 'position',
-          partyId: this.$store.getters.userInfo.employee.positions,
-          partyName: '',
-          scriptContent: '',
-          type: 'user',
-          userType: 'position'
-        }
-      ],
-      images: [image01, image02, image03, image04],
-      ImportDeviceType: '',
-      iframeVisible: false,
-      srcUrl: '',
-      printObj: [],
-      printVisible: false,
-      DialogVisible: true,
-      npmDialogFormVisible: false,
-      customDialogVisible: false,
-      renKeXiangMuOptions: ['认可','非认可'],
-      pickerOptions: {
-        shortcuts: [
-          {
-            text: '最近一周',
-            onClick(picker) {
-              const end = new Date()
-              const start = new Date()
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
-              picker.$emit('pick', [start, end])
-            }
-          },
-          {
-            text: '最近一个月',
-            onClick(picker) {
-              const end = new Date()
-              const start = new Date()
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
-              picker.$emit('pick', [start, end])
-            }
-          },
-          {
-            text: '最近三个月',
-            onClick(picker) {
-              const end = new Date()
-              const start = new Date()
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
-              picker.$emit('pick', [start, end])
-            }
-          }
-        ]
-      },
-      params: {},
-      deviceDialogShow: false,
-      actionDialog: '',
-      position: position,
-      level: level.second || level.first,
-      userId: userId,
-      display:
-        setting?.dept?.default &&
-        !(isHighLevel || this.$route.fullPath === '/xxgl/sbda'),
-      search: {
-        pos: setting?.dept?.default
-          ? isHighLevel || this.$route.fullPath === '/xxgl/sbda'
-            ? ''
-            : mainPositionId
-          : '',
-        time: [],
-        nowNumber: '',
-        preNumber: '',
-        deviceName: '',
-        deviceType: '',
-        deviceStatus: '',
-        place: '',
-        managePeople: '',
-        deviceClass: '',
-        renKeXiangMu: '',
-        validity: '',
-        yanShouRiQi: ''
-      },
-      showDeptSeach: false, //部门选择搜索是否禁用
-      loading: false,
-      pkKey: 'id', // 主键  如果主键不是pk需要传主键
-      pkValue: '',
-      templateKey: '',
-      visible: false,
-      categoryKey: '',
-      tableTitle: '设备基本信息列表', // 标题
-      listData: [],
-      selectListData: [], // 全部数据
-      bianlistData: {
-        dataResult: [],
-        pageResult: {
-          limit: 0,
-          page: 0,
-          totalCount: 0,
-          totalPages: 0
-        }
-      },
-      listConfig: {
-        // 工具栏
-        toolbars: [
-          { key: 'search' },
-          {
-            key: 'customAdd',
-            label: '设备建档',
-            icon: 'ibps-icon-plus',
-            type: 'success'
-          },
-          {
-            key: 'customBpm',
-            label: '设备管理台账',
-            icon: 'ibps-icon-file-text',
-            type: 'info'
-          },
-          // todo 待开发
-          {
-            key: 'customPrint',
-            label: '打印标签',
-            icon: 'ibps-icon-cog',
-            type: 'warning'
-          },
-          {
-            key: 'customExport',
-            label: '导出数据',
-            icon: 'ibps-icon-sign-in',
-            type: 'primary'
-          },
-          {
-            key: 'customImport',
-            label: '导入数据',
-            icon: 'ibps-icon-sign-in',
-            type: 'primary'
-          },
-          {
-            key: 'customSetting',
-            label: '岗位/分组配置',
-            icon: 'ibps-icon-cogs',
-            type: 'info'
-          },
-          {
-            key: 'customRemove',
-            label: '删除',
-            icon: 'ibps-icon-close',
-            type: 'danger',
-            hidden: () => {
-              return !this.hasRole
-            }
-          }
-        ],
-        // 查询条件
-        searchForm: {
-          forms: [
-            { prop: '', label: '部门', fieldType: 'slot', slotName: 'pos' }, // user 插槽
-            {
-              prop: '',
-              label: '建档时间',
-              fieldType: 'slot',
-              slotName: 'time'
-            },
-            {
-              prop: '',
-              label: '设备编号',
-              fieldType: 'slot',
-              slotName: 'nowNumber'
-            },
-            {
-              prop: '',
-              label: '原设备编号',
-              fieldType: 'slot',
-              slotName: 'preNumber'
-            },
-            {
-              prop: '',
-              label: '设备名称',
-              fieldType: 'slot',
-              slotName: 'deviceName'
-            },
-            {
-              prop: '',
-              label: '设备类型',
-              fieldType: 'slot',
-              slotName: 'deviceType'
-            },
-            {
-              prop: '',
-              label: '设备状态',
-              fieldType: 'slot',
-              slotName: 'deviceStatus'
-            },
-            {
-              prop: '',
-              label: '放置地点',
-              fieldType: 'slot',
-              slotName: 'place'
-            },
-            {
-              prop: '',
-              label: '保管人',
-              fieldType: 'slot',
-              slotName: 'managePeople'
-            },
-            {
-              prop: '',
-              label: '岗位/分组',
-              fieldType: 'slot',
-              slotName: 'deviceClass'
-            },
-            {
-              prop: '',
-              label: '类别',
-              fieldType: 'slot',
-              slotName: 'renKeXiangMuSlot'
-            },
-            {
-              prop: '',
-              label: '验收日期',
-              fieldType: 'slot',
-              slotName: 'yanShouRiQi'
-            }
-            // {
-            //   prop: '',
-            //   label: '校准有效期',
-            //   fieldType: 'slot',
-            //   slotName: 'validity'
-            // }
-          ]
-        },
-        // 表格字段配置
-        columns: [
-          { type: 'expand', slotName: 'expandSlot' },
-          {
-            prop: 'bianZhiBuMen',
-            label: '部门',
-            slotName: 'posSlot',
-            sortable: true
-          },
-          {
-            prop: 'bianZhiShiJian',
-            label: '建档时间',
-            sortable: true,
-            width: 130
-          },
-          { prop: 'sheBeiShiBieH', label: '设备编号', sortable: true },
-          { prop: 'yuanSheBeiBian', label: '原设备编号', sortable: true },
-          { prop: 'sheBeiMingCheng', label: '设备名称', sortable: true },
-          {
-            prop: 'sheBeiLeiXing',
-            label: '设备类型',
-            sortable: true,
-            slotName: 'deviceTypeSlot'
-          },
-          {
-            prop: 'sheBeiZhuangTa',
-            label: '设备状态',
-            sortable: true,
-            slotName: 'deviceStateSlot'
-          },
-          {
-            prop: 'cunFangWeiZhi',
-            label: '放置地点',
-            slotName: 'placeSlot',
-            sortable: true
-          },
-          {
-            prop: 'guanLiRen',
-            label: '保管人',
-            slotName: 'userSlot',
-            sortable: true
-          },
-          {
-            prop: 'weiHuFangShi',
-            label: '岗位/分组',
-            slotName: 'deviceSlot',
-            sortable: true
-          },
-          { prop: 'guiGeXingHao', label: '规格型号', sortable: true },
-          {
-            prop: 'renKeXiangMu',
-            label: '类别',
-            width: 90,
-            sortable: false
-          },
-          { prop: '', label: '操作', width: 130, slotName: 'customButton' }
-        ]
-      },
-      pagination: {
-        limit: 20,
-        page: 1
-      },
-      sorts: [{ field: 'BIAN_ZHI_SHI_JIAN', order: 'desc' }],
-      sqlWhere: {},
-      searchWhere: {},
-      deviceColumns: {
-        bianZhiBuMen: '部门',
-        sheBeiMingCheng: '设备名称',
-        // sheBeiShiBieH: '设备编号(导入无需填写)',
-        yuanSheBeiBian: setting?.device?.hideSysDeviceNo
-          ? '设备编号(必填,且不可重复)'
-          : '原设备编号(必填,且不可重复)',
-        sheBeiZhuangTa: '设备状态(合格/停用/限用)',
-        sheBeiLeiXing: '设备类型(检验系统/通用设备/软件/信息系统)',
-        shiFouWeiHu: '是否维护(是/否)',
-        shiFouXiaoZhun: '是否校准(是/否)',
-        weiHuFangShi: '岗位/分组',
-        guiGeXingHao: '规格型号',
-        cunFangDiDian: '存放地点(格式:房间号+空格+房间名)',
-        guanLiRen: '保管人',
-        ziChanBianHao: '资产编号',
-        ziChanYuanZhi: '资产原值(元)',
-        gongYingShang: '供应商',
-        lianXiFangShi: '联系方式',
-        changShang: '厂商',
-        jiShenXuHao: '机身序号',
-        zhuCeZhengHao: '注册证号',
-        heChaXiaoZhun: '使用年限(年)',
-        chuChangRiQi: '出厂日期',
-        yanShouRiQi: '验收日期',
-        jieShouRiQi: '接收日期',
-        qiYongRiQi: '投入日期',
-        yiXiaoRiQi: '已校日期',
-        xiaoZhunZQ: '检定/校准周期(以月为单位)',
-        xiaoZhunYouXia: '校准有效期至',
-        shiYongKeShi: '检定/校准单位',
-        ceLiangGongZuo: '预期测量范围',
-        huanJingYaoQiu: '环境要求',
-        dianYuanYaoQiu: '电源要求',
-        jieShouZhuangTai: '接收时状态(新设备/二手或翻新设备)',
-        jianDingXiao: '检定/校准参数',
-        zuiDaYunCha: 'U/精确度/最大允差',
-        zhengShuBianHa: '证书编号',
-        xiuZhengZhiXiu: '修正值/修正因子',
-        wenDuYingYong: '温度应用修正值',
-        shiDuYingYong: '湿度应用修正值',
-        // biXuDeHuanJin: '核查人',
-        // biXuSheShi: '核查日期',
-        jianKongYiJu: '是否24H开机(是/否)',
-        kaiShiShiYong: '开机时间(时间格式,时分秒)',
-        shiJiShiYongF: '关机时间(时间格式,时分秒)'
-      },
-      projectColums: {
-        yuanSheBeiBian: setting?.device?.hideSysDeviceNo
-          ? '设备编号*'
-          : '原设备编号*',
-        sheBeiMingCheng: '设备名称*',
-        weiHuLeiXing:
-          '维护类型*(日保养/周保养/月保养/季度保养/半年保养/年保养/按需保养)',
-        weiHuRiQi: '维护日期*',
-        weiHuXiangMuC: '维护项目*'
-      },
-      dateFieldRange: [
-        'chuChangRiQi',
-        'yanShouRiQi',
-        'jieShouRiQi',
-        'qiYongRiQi',
-        'yiXiaoRiQi',
-        'xiaoZhunYouXia'
-      ],
-      requiredFieldMap: {
-        bianZhiBuMen: '部门',
-        sheBeiMingCheng: '设备名称',
-        yuanSheBeiBian: setting?.device?.hideSysDeviceNo
-          ? '设备编号'
-          : '原设备编号',
-        sheBeiZhuangTa: '设备状态',
-        sheBeiLeiXing: '设备类型',
-        shiFouWeiHu: '是否维护',
-        shiFouXiaoZhun: '是否校准'
-      },
-      dateFieldsMap: {
-        chuChangRiQi: '出厂日期',
-        yanShouRiQi: '验收日期',
-        jieShouRiQi: '接收日期',
-        qiYongRiQi: '投入日期',
-        yiXiaoRiQi: '已校日期',
-        xiaoZhunYouXia: '校准有效期至'
-        // 'biXuSheShi': '核查日期'
-      },
-      validationRules: {
-        设备状态: {
-          field: 'sheBeiZhuangTa',
-          range: ['合格', '停用', '限用', '报废']
-        },
-        设备类型: {
-          field: 'sheBeiLeiXing',
-          range: ['检验系统', '通用设备', '软件', '信息系统']
-        },
-        接收时状态: {
-          field: 'jieShouZhuangTai',
-          range: ['新设备', '二手或翻新设备']
-        },
-        是否校准: {
-          field: 'shiFouXiaoZhun',
-          range: ['是', '否']
-        },
-        是否维护: {
-          field: 'shiFouWeiHu',
-          range: ['是', '否']
-        }
-      },
-      numberFieldsMap: {
-        xiaoZhunZQ: '检定/校准周期(以月为单位)',
-        heChaXiaoZhun: '使用年限(年)',
-        ziChanYuanZhi: '资产原值(元)'
-      },
-      maintenanceRequiredFieldMap: {
-        yuanSheBeiBian: setting?.device?.hideSysDeviceNo
-          ? '设备编号'
-          : '原设备编号',
-        sheBeiMingCheng: '设备名称',
-        weiHuLeiXing: '维护类型',
-        weiHuRiQi: '维护日期',
-        weiHuXiangMuC: '维护项目'
-      },
-      maintenanceValidationRules: {
-        维护类型: {
-          field: 'weiHuLeiXing',
-          range: [
-            '日保养',
-            '周保养',
-            '月保养',
-            '季度保养',
-            '半年保养',
-            '年保养',
-            '按需保养'
-          ]
-        }
-      },
-      maintenanceDateValidationRules: {
-        日保养: this.generateDayRule(),
-        周保养: this.generateRule(7, `每周`, ``),
-        月保养: this.generateRule(28, `每月第`, `日`),
-        半年保养: this.generateRule(6, `每半年第`, `个月`),
-        季度保养: this.generateRule(3, `每季度第`, `个月`),
-        年保养: this.generateRule(12, `每年第`, `个月`),
-        按需保养: ['/']
-      },
-      stateList: { 停用: '停用', 报废: '报废', 合格: '合格' },
-      hideSysDeviceNo: false,
-      hidefuJianShang: false,
-      hasFuZeRenDianHua: false,
-      hasChangJiaLianXiRen: false,
-      showLeiBie: false, // 川北 是否显示类别字段
-      tabList: {},
-      hasRole: true,
-      readOnly: this.$route.fullPath === '/xxgl/sbda',
-      typeList: {
-        检验系统: '检验系统',
-        通用设备: '通用设备',
-        软件: '软件',
-        信息系统: '信息系统'
-      },
-      tagName: '',
-      tagData: {},
-      config: setting?.postJob?.allocation || false
-    }
-  },
-  async mounted() {
-    const res = await getSetting()
-    const {
-      stateList,
-      hideSysDeviceNo,
-      hidefuJianShang,
-      tabList,
-      hasDeviceRole,
-      typeList,
-      hasFuZeRenDianHua,
-      hasChangJiaLianXiRen,
-      showLeiBie
-    } = res.device || {}
-    const { tagData, tagName } = res.deviceTag || {}
-    if (tagName) {
-      console.debug('tagName', tagName)
-      this.tagName = tagName
-      this.tagData = tagData
-    }
-    if (hasDeviceRole) {
-      console.debug('hasDeviceRole', hasDeviceRole)
-      const { role, isSuper } = this.$store.getters || {}
-      this.hasRole =
-        isSuper || role.some((r) => hasDeviceRole.includes(r.alias))
-    }
-    if (stateList) {
-      console.debug('stateList', stateList)
-      this.stateList = stateList
-    }
-    if (typeList) {
-      console.debug('typeList', typeList)
-      this.typeList = typeList
-    }
-    if (showLeiBie) {
-      console.debug('showLeiBie', showLeiBie)
-      this.showLeiBie = showLeiBie
-    }
-    if (hideSysDeviceNo) {
-      this.hideSysDeviceNo = hideSysDeviceNo
-      // 列表隐藏设备编号 将原设备编号改为设备编号
-      this.listConfig.columns = this.listConfig.columns.filter(
-        (i) => i.prop !== 'sheBeiShiBieH'
-      )
-      this.listConfig.columns.find((i) => i.prop === 'yuanSheBeiBian').label =
-        '设备编号'
-      // 查询条件隐藏设备编号 将原设备编号改为设备编号
-      this.listConfig.searchForm.forms =
-        this.listConfig.searchForm.forms.filter(
-          (i) => i.slotName !== 'nowNumber'
-        )
-      this.listConfig.searchForm.forms.find(
-        (i) => i.slotName === 'preNumber'
-      ).label = '设备编号'
-    }
-    if (hidefuJianShang) {
-      this.hidefuJianShang = hidefuJianShang
-    }
-    if (hasFuZeRenDianHua) {
-      this.hasFuZeRenDianHua = hasFuZeRenDianHua
-    }
-    if (hasChangJiaLianXiRen) {
-      this.hasChangJiaLianXiRen = hasChangJiaLianXiRen
-    }
-    if (tabList) {
-      console.debug('tabList', tabList)
-      this.tabList = tabList
-    }
-    this.getDatas()
-  },
-  methods: {
-    ImageAllUrl(row) {
-      if (row && row.buMen) {
-        const imgId = row.buMen.split(',')
-        return imgId.map((item) => getImage(item))
-      }
-      return []
-    },
-    ImageUrl(row) {
-      if (row && row.buMen) {
-        const imgId = row.buMen.split(',')[0]
-        return getImage(imgId)
-      }
-      return ''
-    },
-    async getDatas() {
-      this.loading = true
-      const parameters = {
-        relation: 'AND',
-        parameters: []
-      }
-      // 增加地点过滤
-      const obj = { relation: 'AND', parameters: [] }
-      obj.parameters.push({
-        key: 'Q^di_dian_^S',
-        value: this.level,
-        param: this.$utils.guid()
-      })
-      parameters.parameters.push(obj)
-
-      // 部门搜索(可多选)
-      if (this.search.pos) {
-        const obj = { relation: 'OR', parameters: [] }
-        this.search.pos.split(',').forEach((item) => {
-          obj.parameters.push({
-            key: 'Q^bian_zhi_bu_men_^S',
-            value: item,
-            param: this.$utils.guid()
-          })
-        })
-
-        if (this.display) {
-          this.showDeptSeach = true
-        }
-        parameters.parameters.push(obj)
-      } else {
-        this.showDeptSeach = false
-      }
-      // 建档时间搜索
-      if (this.search.time && this.search.time.length === 2) {
-        const obj = { relation: 'AND', parameters: [] }
-        obj.parameters.push({
-          key: 'Q^bian_zhi_shi_jian^DL^yyyy-MM-dd',
-          value: this.search.time[0],
-          param: this.$utils.guid()
-        })
-        obj.parameters.push({
-          key: 'Q^bian_zhi_shi_jian^DG^yyyy-MM-dd',
-          value: this.search.time[1],
-          param: this.$utils.guid()
-        })
-        parameters.parameters.push(obj)
-      }
-      
-      if (this.search.yanShouRiQi && this.search.yanShouRiQi.length === 2) {
-        const obj = { relation: 'AND', parameters: [] }
-        obj.parameters.push({
-          key: 'Q^yan_shou_ri_qi_^DL^yyyy-MM-dd',
-          value: this.search.yanShouRiQi[0],
-          param: this.$utils.guid()
-        })
-        obj.parameters.push({
-          key: 'Q^yan_shou_ri_qi_^DG^yyyy-MM-dd',
-          value: this.search.yanShouRiQi[1],
-          param: this.$utils.guid()
-        })
-        parameters.parameters.push(obj)
-      }
-      if (this.search.validity && this.search.validity.length === 2) {
-        const obj = { relation: 'AND', parameters: [] }
-        obj.parameters.push({
-          key: 'Q^xiao_zhun_you_xia^DL^yyyy-MM-dd',
-          value: this.search.validity[0],
-          param: this.$utils.guid()
-        })
-        obj.parameters.push({
-          key: 'Q^xiao_zhun_you_xia^DG^yyyy-MM-dd',
-          value: this.search.validity[1],
-          param: this.$utils.guid()
-        })
-        parameters.parameters.push(obj)
-      }
-      // 设备编号搜索
-      if (this.search.nowNumber) {
-        const obj = { relation: 'AND', parameters: [] }
-        obj.parameters.push({
-          key: 'Q^she_bei_shi_bie_h^SL',
-          value: this.search.nowNumber,
-          param: this.$utils.guid()
-        })
-        parameters.parameters.push(obj)
-      }
-      // 原设备编号搜索
-      if (this.search.preNumber) {
-        const obj = { relation: 'AND', parameters: [] }
-        obj.parameters.push({
-          key: 'Q^yuan_she_bei_bian^SL',
-          value: this.search.preNumber,
-          param: this.$utils.guid()
-        })
-        parameters.parameters.push(obj)
-      }
-      // 设备名称搜索
-      if (this.search.deviceName) {
-        const obj = { relation: 'AND', parameters: [] }
-        obj.parameters.push({
-          key: 'Q^she_bei_ming_cheng_^SL',
-          value: this.search.deviceName,
-          param: this.$utils.guid()
-        })
-        parameters.parameters.push(obj)
-      }
-      // 类别搜索
-      if (this.search.renKeXiangMu) {
-        const obj = { relation: 'AND', parameters: [] }
-        obj.parameters.push({
-          key: 'Q^ren_ke_xiang_mu_^S',
-          value: this.search.renKeXiangMu,
-          param: this.$utils.guid()
-        })
-        parameters.parameters.push(obj)
-      }
-      // 设备类型搜索
-      if (this.search.deviceType) {
-        const obj = { relation: 'AND', parameters: [] }
-        obj.parameters.push({
-          key: 'Q^she_bei_lei_xing_^S',
-          value: this.search.deviceType,
-          param: this.$utils.guid()
-        })
-        parameters.parameters.push(obj)
-      }
-      // 设备状态搜索
-      if (this.search.deviceStatus) {
-        const obj = { relation: 'AND', parameters: [] }
-        obj.parameters.push({
-          key: 'Q^she_bei_zhuang_ta^S',
-          value: this.search.deviceStatus,
-          param: this.$utils.guid()
-        })
-        parameters.parameters.push(obj)
-      }
-      // 放置地点搜索
-      // if (this.search.place) {
-      //     const obj = { relation: 'AND', parameters: [] }
-      //     obj.parameters.push({ key: 'Q^cun_fang_di_dian_^SL', value: this.search.place, param: this.$utils.guid() })
-      //     parameters.parameters.push(obj)
-      // }
-      if (this.search.place) {
-        const obj = { relation: 'OR', parameters: [] }
-        this.search.place.split(',').forEach((item) => {
-          obj.parameters.push({
-            key: 'Q^cun_fang_wei_zhi_^S',
-            value: item,
-            param: this.$utils.guid()
-          })
-        })
-        parameters.parameters.push(obj)
-      }
-      // 保管人搜索(可多选)
-      if (this.search.managePeople) {
-        const obj = { relation: 'OR', parameters: [] }
-        this.search.managePeople.split(',').forEach((item) => {
-          obj.parameters.push({
-            key: 'Q^guan_li_ren_^S',
-            value: item,
-            param: this.$utils.guid()
-          })
-        })
-        parameters.parameters.push(obj)
-      }
-      // 岗位/分组搜索(可多选)
-      if (this.search.deviceClass) {
-        const obj = { relation: 'OR', parameters: [] }
-        this.search.deviceClass.split(',').forEach((item) => {
-          obj.parameters.push({
-            key: 'Q^wei_hu_fang_shi_^SL',
-            value: item,
-            param: this.$utils.guid()
-          })
-        })
-        parameters.parameters.push(obj)
-      }
-      const params = {
-        requestPage: {
-          pageNo: this.pagination.page,
-          limit: this.pagination.limit
-        },
-        sorts: this.sorts
-      }
-      if (parameters.parameters.length > 0) {
-        params.parameters = [parameters]
-      }
-
-      const {
-        data: { dataResult, pageResult }
-      } = await queryequipmentCard(params)
-
-      this.bianlistData.pageResult = pageResult
-      this.bianlistData.dataResult = dataResult
-      ActionUtils.handleListData(this, this.bianlistData) // 调用内置方法
-      this.loading = false
-    },
-    // 查看表单
-    goLookForm(row) {
-      const { first, second } = this.$store.getters.level || {}
-      const didian = second || first
-      this.srcUrl =
-        this.$reportPath.replace('show', 'pdf') +
-        '设备/设备档案卡.rpx&id_=' +
-        row.id +
-        '&org_=' +
-        first +
-        '&second_=' +
-        didian
-      this.iframeVisible = true
-    },
-    // 按钮事件处理
-    handleAction(command, position, selection, data, index, button) {
-      switch (command) {
-        case 'search': // 查询
-          this.getDatas()
-          break
-        case 'customAdd':
-          this.handleCustomAdd('customAdd')
-          break
-        case 'customSetting':
-          this.handleCustomSetting()
-          break
-        case 'customRemove':
-          this.handleCustomRemove(selection)
-          break
-        case 'customExport':
-          this.handleCustomExport(selection, data)
-          break
-        case 'customImport':
-          this.handleCustomImport()
-          break
-        case 'customBpm':
-          this.handleCustomBpm()
-          break
-        case 'customPrint':
-          this.handleCustomPrint(selection)
-          break
-        default:
-          break
-      }
-    },
-    // 打印标签
-    handleCustomPrint(selection = []) {
-      if (selection.length === 0) {
-        return this.$message.warning('请先选择需要打印标签的数据!')
-      }
-      this.printObj = selection
-      this.printVisible = true
-    },
-    // 关闭标签
-    scanOff() {
-      this.printVisible = false
-    },
-    // 设备台账
-    handleCustomBpm() {
-      this.npmDialogFormVisible = true
-    },
-    // 处理分页事件
-    async handlePaginationChange(page) {
-      ActionUtils.setPagination(this.pagination, page)
-      this.getDatas()
-    },
-    // 处理排序
-    handleSortChange(sort) {
-      function removeUnderscores(str) {
-        return str.replace(/^_+|_+$/g, '')
-      }
-      const { order, sortBy } = sort
-      let s = ''
-      switch (sortBy) {
-        case 'BIAN_ZHI_SHI_JIAN_':
-        case 'SHE_BEI_SHI_BIE_H_':
-        case 'YUAN_SHE_BEI_BIAN_':
-        case 'SHE_BEI_ZHUANG_TA_':
-          s = removeUnderscores(sortBy)
-          break
-        default:
-          s = sortBy
-      }
-      let o = null
-      if (order === 'descending') {
-        o = 'desc'
-      } else if (order === 'ascending') {
-        o = 'asc'
-      }
-      this.sorts = [{ field: s, order: o }]
-      this.getDatas()
-    },
-    handleCustomAdd(action) {
-      this.params = {}
-      this.deviceDialogShow = true
-      this.actionDialog = action
-    },
-    close() {
-      this.deviceDialogShow = false
-      this.actionDialog = ''
-      this.getDatas()
-    },
-    goEdit(row) {
-      this.params = row
-      this.deviceDialogShow = true
-    },
-    handleCustomSetting() {
-      this.customDialogVisible = true
-    },
-    handleCustomRemove(selection) {
-      if (!this.hasRole) return
-      console.log('selection', selection)
-      if (!selection || selection.length === 0) {
-        return this.$message.warning('请选择要删除的数据!')
-      }
-      this.$confirm(
-        `此操作将永久删除已选中的${selection.length}条数据, 是否确定? `,
-        '提示',
-        {
-          confirmButtonText: '继续',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }
-      )
-        .then(async () => {
-          await removeEquipmentCard({
-            ids: selection + ''
-          })
-          // 删除后刷新
-          await this.getDatas()
-          this.$message.success('删除成功!')
-        })
-        .catch(() => {})
-    },
-    // 导出
-    handleCustomExport(selection, data) {
-      this.$confirm('请选择导出的类型', '提示', {
-        confirmButtonText: '导出设备',
-        cancelButtonText: '导出维护项目',
-        closeOnClickModal: false,
-        closeOnPressEscape: false,
-        distinguishCancelAndClose: true,
-        type: 'info'
-      })
-        .then(() => {
-          this.ExportDevice(selection, data)
-        })
-        .catch((action) => {
-          if (action === 'close') return
-          if (action === 'cancel') {
-            this.ExportProject(selection, data)
-          }
-        })
-    },
-    // 导入
-    handleCustomImport() {
-      this.$confirm('确请选择导入的类型', '提示', {
-        confirmButtonText: '导入设备',
-        cancelButtonText: '导入维护项目',
-        closeOnClickModal: false,
-        closeOnPressEscape: false,
-        distinguishCancelAndClose: true,
-        type: 'info'
-      })
-        .then(() => {
-          this.ImportDevice()
-        })
-        .catch((action) => {
-          if (action === 'close') return
-          if (action === 'cancel') {
-            this.$confirm('请选择设备维护项目导入类型', '提示', {
-              confirmButtonText: '增量添加',
-              cancelButtonText: '全量替换',
-              closeOnClickModal: false,
-              closeOnPressEscape: false,
-              distinguishCancelAndClose: true,
-              type: 'info'
-            })
-              .then(() => {
-                this.ImportDeviceType = '增量添加'
-                this.ImportProject()
-              })
-              .catch((action) => {
-                if (action === 'close') return
-                if (action === 'cancel') {
-                  this.ImportDeviceType = '全量替换'
-                  this.ImportProject()
-                }
-              })
-          }
-        })
-    },
-    // 导入设备
-    ImportDevice() {
-      this.$refs.file1.click()
-      console.log('导入设备')
-    },
-    // 导入维护项目
-    ImportProject() {
-      this.$refs.file2.click()
-      console.log('导入维护项目')
-    },
-    getTimeStamp() {
-      return dayjs().format('YYYYMMDDHHmmss')
-    },
-    xlsx(json, fields, filename = '.xlsx') {
-      // 导出xlsx
-      json.forEach((item) => {
-        for (const i in item) {
-          if (fields.hasOwnProperty(i)) {
-            item[fields[i]] = item[i]
-          }
-          delete item[i] // 删除原先的对象属性
-        }
-      })
-      const sheetName = filename // excel的文件名称
-      const wb = xlsx.utils.book_new() // 工作簿对象包含一SheetNames数组,以及一个表对象映射表名称到表对象。XLSX.utils.book_new实用函数创建一个新的工作簿对象。
-      const ws = xlsx.utils.json_to_sheet(json, {
-        header: Object.values(fields)
-      }) // 将JS对象数组转换为工作表。
-      wb.SheetNames.push(sheetName)
-      wb.Sheets[sheetName] = ws
-      const defaultCellStyle = {
-        font: { name: 'Verdana', sz: 13, color: 'FF00FF88' },
-        fill: { fgColor: { rgb: 'FFFFAA00' } }
-      } // 设置表格的样式
-      const wopts = {
-        bookType: 'xlsx',
-        bookSST: false,
-        type: 'binary',
-        cellStyles: true,
-        defaultCellStyle: defaultCellStyle,
-        showGridLines: false
-      } // 写入的样式
-      const wbout = xlsx.write(wb, wopts)
-      const blob = new Blob([this.s2ab(wbout)], {
-        type: 'application/octet-stream'
-      })
-      fs.saveAs(blob, filename + '.xlsx')
-    },
-    s2ab(s) {
-      let buf
-      if (typeof ArrayBuffer !== 'undefined') {
-        buf = new ArrayBuffer(s.length)
-        const view = new Uint8Array(buf)
-        for (let i = 0; i !== s.length; ++i) view[i] = s.charCodeAt(i) & 0xff
-        return buf
-      } else {
-        buf = new Array(s.length)
-        for (let i = 0; i !== s.length; ++i) buf[i] = s.charCodeAt(i) & 0xff
-        return buf
-      }
-    },
-    async switchExportData(data) {
-      // const deviceGroupSql = `select id_, wei_hu_gang_wei_ from t_sbwhgwpzb where di_dian_ = '${second || first}'` // 岗位/分组信息
-      // const supplierSql = `select id_, gong_ying_shang_m from t_gysxxb where di_dian_ = '${second || first}'` // 供应商信息
-      const { first, second } = this.$store.getters.level || {}
-      const {
-        variables: { data: deviceGroupData }
-      } = await this.$common.request('query', {
-        key: this.config ? 'gwzzzha' : 'getPositionList',
-        params: [second || first]
-      })
-      const {
-        variables: { data: gysData }
-      } = await this.$common.request('query', {
-        key: 'getSupplierList',
-        params: [second || first]
-      })
-      const exportData = JSON.parse(JSON.stringify(data))
-      for (let i = 0; i < exportData.length; i++) {
-        const item = exportData[i]
-        item.bianZhiBuMen = this.switchIdToDept(item.bianZhiBuMen.split(',')[0])
-        item.guanLiRen = this.switchIdToUserName(item.guanLiRen.split(',')[0])
-        // item.biXuDeHuanJin = this.switchIdToUserName(item.biXuDeHuanJin.split(',')[0])
-        item.weiHuFangShi = this.switchDeviceIdToName(
-          item.weiHuFangShi,
-          deviceGroupData
-        )
-        item.shiYongKeShi = this.switchGYSIdToName(item.shiYongKeShi, gysData)
-        if (this.stateList[item.sheBeiZhuangTa]) {
-          item.sheBeiZhuangTa = this.stateList[item.sheBeiZhuangTa]
-        }
-        if (this.typeList[item.sheBeiLeiXing]) {
-          item.sheBeiLeiXing = this.typeList[item.sheBeiLeiXing]
-        }
-      }
-      return exportData
-    },
-    // 岗位/分组id 转 岗位/分组名称
-    switchDeviceIdToName(val, deviceGroupList) {
-      const result = []
-      const valList = val?.split(',') || []
-      valList.forEach((item) =>
-        result.push(
-          deviceGroupList?.find((i) => i.positionId === item)?.positionName ||
-            ''
-        )
-      )
-      return result.join(',')
-    },
-    // 供应商id 转 供应商名称 检定/校准单位
-    switchGYSIdToName(val, gysList) {
-      const result =
-        gysList.find((item) => item.id_ === val)?.gong_ying_shang_m || ''
-      return result
-    },
-    // 部门id 转 部门名称
-    switchIdToDept(id) {
-      const { deptList } = this.$store.getters
-      const temp = deptList.find((item) => item.positionId === id)
-      return temp ? temp.positionName : ''
-    },
-    // 部门名称 转 部门id
-    switchDeptToId(dep) {
-      const { deptList } = this.$store.getters
-      const temp = deptList.find((item) => item.positionName === dep)
-      return temp ? temp.positionId : ''
-    },
-    // 人员id 转人员名称
-    switchIdToUserName(id) {
-      const { userList } = this.$store.getters
-      const temp = userList.find((item) => item.userId === id)
-      return temp ? temp.userName : ''
-    },
-    // 人员名称 转 人员id
-    switchUserNameToId(name) {
-      const { userList } = this.$store.getters
-      const temp = userList.find((item) => item.userName === name)
-      return temp ? temp.userId : ''
-    },
-    // 导出设备
-    async ExportDevice(selection, data = []) {
-      const exportData = await this.switchExportData(data)
-      this.xlsx(
-        exportData,
-        this.deviceColumns,
-        '设备档案卡基本数据' + this.getTimeStamp()
-      )
-      this.$message.success('导出设备成功!')
-    },
-    // 导出维护项目
-    async ExportProject(selection = []) {
-      let exportData = []
-      console.log('导出维护项目')
-      if (selection.length > 0) {
-        // const sql = `select b.yuan_she_bei_bian as yuanSheBeiBian,b.she_bei_ming_cheng_ as sheBeiMingCheng,a.parent_id_,a.wei_hu_xiang_mu_c as weiHuXiangMuC,a.wei_hu_ri_qi_ as weiHuRiQi,a.wei_hu_lei_xing_ as weiHuLeiXing,a.ri_qi_shu_zi_ as riQiShuZi from t_whzqjxm a,t_sbdj b where a.parent_id_=b.id_ and find_in_set(a.parent_id_, '${selection.join(',')}')`
-        const {
-          variables: { data }
-        } = await this.$common.request('query', {
-          key: 'getDeviceProject',
-          params: [selection.join(',')]
-        })
-        exportData = data
-        this.xlsx(
-          exportData,
-          this.projectColums,
-          '设备维护项目数据' + this.getTimeStamp()
-        )
-      } else {
-        let attachmentId = 'device_maintainProject'
-        if (this.hideSysDeviceNo) {
-          attachmentId = 'device_maintainProject_new'
-        }
-        const res = await download({ attachmentId })
-
-        // 判断 ArrayBuffer 的大小,主要用于兼容没有文件的情况
-        if (res.data?.byteLength === 0) {
-          this.xlsx(
-            [],
-            this.projectColums,
-            '设备维护项目模板' + this.getTimeStamp()
-          )
-        } else {
-          // const blob = new Blob([res.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
-          const a = document.createElement('a')
-          a.style.display = 'none'
-          // a.href = URL.createObjectURL(blob)
-          a.href = res.request.responseURL
-          // a.download = '设备维护项目导入模板'
-          document.body.appendChild(a)
-          a.click()
-          document.body.removeChild(a)
-        }
-      }
-      this.$message.success('导出维护项目成功!')
-    },
-    // value 转 key
-    switchV2K(value, obj) {
-      const key = Object.keys(obj).find((key) => obj[key] === value)
-      return key || ''
-    },
-    // 转换对象的key
-    switchDeviceObj(data, originalObj) {
-      const result = []
-      // data.forEach(item => {
-      //     const obj = {}
-      //     for (const key in item) {
-      //         obj[this.switchV2K(key, originalObj)] = item[key]
-      //     }
-      //     result.push(obj)
-      // })
-      data.forEach((item) => {
-        const obj = {}
-        for (const key in originalObj) {
-          // 对日期格式的数据做兼容处理
-          if (item[originalObj[key]] instanceof Date) {
-            //时间格式被xlsx识别为日期格式需单独拿出来处理
-            if (
-              originalObj[key] == '开机时间(时间格式,时分秒)' ||
-              originalObj[key] == '关机时间(时间格式,时分秒)'
-            ) {
-              obj[key] = dayjs(item[originalObj[key]]).format('HH:mm:ss') || ''
-            } else {
-              obj[key] =
-                dayjs(item[originalObj[key]])
-                  .add(8, 'hour')
-                  .format('YYYY-MM-DD') || ''
-            }
-          } else {
-            obj[key] = String(item[originalObj[key]] || '')
-          }
-        }
-        result.push(obj)
-      })
-      return result
-    },
-    /* 读取文件 将文件转换为二进制 */
-    readFile(file) {
-      return new Promise((resolve) => {
-        const reader = new FileReader()
-        reader.readAsBinaryString(file)
-        reader.onload = (ev) => {
-          resolve(ev.target.result)
-        }
-      })
-    },
-    checkDeviceRequiredFieldsIfEmpty(list, requiredMap) {
-      const msgList = []
-      list.forEach((item, index) => {
-        const invalidFieldNames = []
-        Object.entries(requiredMap).forEach(([field, name]) => {
-          if (item.weiHuLeiXing === '按需保养' && field === 'weiHuRiQi') {
-            console.log('按需pass1')
-          } else {
-            if (!item[field]) {
-              invalidFieldNames.push(name)
-            }
-          }
-        })
-        if (invalidFieldNames.length > 0) {
-          msgList.push({ row: index + 2, field: invalidFieldNames })
-        }
-      })
-      return msgList
-    },
-    /**
-     * 专门发送提示
-     * @param {*} allResult
-     * @returns
-     */
-    sendWarningMessages(allResult, mark = 'range') {
-      if (allResult.length < 1) {
-        return
-      }
-      console.log(
-        '%c Msg Obj %c',
-        'background:#FF5733; padding: 1px; border-radius: 0 3px 3px 0; color: #fff;',
-        'background:transparent',
-        allResult
-      )
-      const item = allResult[0]
-      switch (mark) {
-        case 'required':
-          this.$message.warning(
-            `第${item.row}行,字段【${item.field.join(',')}】的值不能为空!`
-          )
-          break
-        case 'range':
-          this.$message.warning(
-            `第${item.row}行,字段【${item.field}】的值【${item.value}】不在限定范围内!`
-          )
-          break
-        case 'dateFormat':
-          this.$message.warning(
-            `第${item.row}行,字段【${item.field}】日期格式错误!格式支持【2024-01-01】、【2024/01/01】,请检查您的数据!`
-          )
-          break
-        case 'duplicateOriginalDevice':
-          this.$message.warning(`${item.field}!`)
-          break
-        default:
-          throw new Error(`${mark}类型未定义!`)
-      }
-    },
-    /**
-     * 根据规则校验字段的限定范围
-     * @param {*} list
-     */
-    checkFieldsRange(list, rules) {
-      const msgList = []
-      for (const ruleKey in rules) {
-        const rule = rules[ruleKey]
-        const fieldName = ruleKey
-        list.forEach((item, index) => {
-          const fieldValue = item[rule.field]
-          if (fieldValue && !rule.range.includes(fieldValue)) {
-            msgList.push({
-              row: index + 2,
-              field: fieldName,
-              value: fieldValue
-            })
-          }
-        })
-      }
-      return msgList
-    },
-    /**
-     * 校验日期字段填写的格式
-     * @param {*} list
-     * @returns
-     */
-    checkDateFields(list) {
-      const dateRegex = /^(\d{4})[-/](0[1-9]|1[0-2])[-/](0[1-9]|[12]\d|3[01])$/
-      for (let i = 0; i < list.length; i++) {
-        const row = list[i]
-        for (const field in this.dateFieldsMap) {
-          if (row[field] && !dateRegex.test(row[field])) {
-            console.error('error field:', row[field])
-            return [{ row: i + 2, field: this.dateFieldsMap[field] }]
-          }
-        }
-      }
-      return []
-    },
-    checkDuplicateOriginalDeviceNo(arr) {
-      const occurrences = {}
-      arr.forEach((item, index) => {
-        const key = item.yuanSheBeiBian
-        if (occurrences[key]) {
-          occurrences[key].push(index + 2)
-        } else {
-          occurrences[key] = [index + 2]
-        }
-      })
-      // 检查是否有重复项(数组长度大于1)
-      for (const [key, indices] of Object.entries(occurrences)) {
-        if (indices.length > 1) {
-          return [
-            {
-              field: `发现重复的${
-                this.hideSysDeviceNo ? '设备编号' : '原设备编号'
-              }:${key} 在第 ${indices.join(', ')} 行`
-            }
-          ]
-        }
-      }
-      return []
-    },
-    /**
-     * 负责导入设备数据的第一部分校验,全部成功则返回true
-     * @param {*} data
-     * @returns
-     */
-    deviceInvalidPartOne(data) {
-      // 校验必填信息
-      const invalidResult = this.checkDeviceRequiredFieldsIfEmpty(
-        data,
-        this.requiredFieldMap
-      )
-      if (invalidResult.length > 0) {
-        this.sendWarningMessages(invalidResult, 'required')
-        return false
-      }
-      // 根据规则校验字段的限定范围
-      const allResult = this.checkFieldsRange(data, this.validationRules)
-      if (allResult.length > 0) {
-        this.sendWarningMessages(allResult, 'range')
-        return false
-      }
-      // 校验日期字段是否符合要求
-      const dateResult = this.checkDateFields(data)
-      if (dateResult.length > 0) {
-        this.sendWarningMessages(dateResult, 'dateFormat')
-        return false
-      }
-      // 校验是否存在重复的原设备编号
-      const duplicateOriginalDeviceResult =
-        this.checkDuplicateOriginalDeviceNo(data)
-      if (duplicateOriginalDeviceResult.length > 0) {
-        this.sendWarningMessages(
-          duplicateOriginalDeviceResult,
-          'duplicateOriginalDevice'
-        )
-        return false
-      }
-      return true
-    },
-    /**
-     * 将日期字段信息格式化为 yyyy-MM-dd
-     * @param {*} list
-     * @returns
-     */
-    formatDateFieldsToReal(list) {
-      list.forEach((item) => {
-        this.dateFieldRange.forEach((field) => {
-          item[field] = item[field]?.replace(/\//g, '-')
-        })
-      })
-      return list
-    },
-    getNextAlias() {
-      return new Promise((resolve, reject) => {
-        this.$common
-          .getNextIdByAlias({
-            alias: 'sbbh'
-          })
-          .then((response) => {
-            resolve(response.data)
-          })
-          .catch((error) => {
-            reject(error)
-          })
-      })
-    },
-    /**
-     * 过滤出来excel 的原设备编号存在当前数据库中的数据
-     * @param {*} list 导入的数据
-     */
-    async filterOriginalDeviceNo(list, currentPosition) {
-      const uniqueArr = Array.from(
-        new Set(list.map((i) => i.yuanSheBeiBian.trim()))
-      )
-      // const sql = `select id_,yuan_she_bei_bian from t_sbdj where find_in_set(yuan_she_bei_bian,'${uniqueArr.join(',')}')and di_dian_ = '${currentPosition}'`
-      const res = await this.$common.request('query', {
-        key: 'getExistDeviceWithImport',
-        params: [uniqueArr.join(','), currentPosition]
-      })
-      const { data = [] } = res.variables || {}
-      const originalDeviceNoList = data.map((i) => i.yuan_she_bei_bian.trim())
-      // 给要更新的数据加上id (接口需要!!!)
-      data.forEach((item) => {
-        const temp = list.find(
-          (i) => i.yuanSheBeiBian === item.yuan_she_bei_bian
-        )
-        temp.id = item.id_
-      })
-      return originalDeviceNoList || ''
-    },
-    /**
-     *
-     * @param {*} list excel数据
-     * @param {*} currentTime 当前时间
-     * @param {*} currentApartment 当前部门ID
-     * @param {*} currentUser 当前用户ID
-     * @param {*} currentPosition 当前地点ID
-     */
-    async handleBasicData(
-      list,
-      currentTime,
-      currentApartment,
-      currentUser,
-      currentPosition,
-      deptList
-    ) {
-      // 使用map生成一个异步操作的数组
-      const promises = list.map(async (element) => {
-        element.bianZhiShiJian = currentTime
-        element.bianZhiRen = currentUser
-        element.diDian = currentPosition
-        element.shiFouGuoShen = '已完成'
-        const o = deptList?.find(
-          (i) => i.positionName === element.bianZhiBuMen.trim()
-        )
-        const { positionId = currentApartment } = o || {}
-        element.bianZhiBuMen = positionId
-        if (!element.id) {
-          // 获取下一个编号
-          element.sheBeiShiBieH = await this.getNextAlias()
-        }
-      })
-      // 使用Promise.all并发执行所有异步操作
-      await Promise.all(promises)
-    },
-
-    /**
-     *
-     * @param {*} list excel数据
-     * @param {*} positionList 现有房间信息
-     * @param {*} supplierList 现有供应商信息
-     * @param {*} employeeList 现有人员信息
-     * @returns
-     */
-    handleExcelData(
-      list,
-      positionList,
-      supplierList,
-      employeeList,
-      deviceGroupList
-    ) {
-      if (list.length < 1) {
-        return
-      }
-      this.handleSupplierInfo(list, supplierList)
-      this.handlePositionInfo(list, positionList)
-      this.handlePersonInfo(list, employeeList)
-      this.handleDeviceGroupInfo(list, deviceGroupList)
-    },
-    /**
-     *
-     * @param {*} list excel数据
-     * @param {*} supplierList 现有供应商信息
-     */
-    handleSupplierInfo(list, supplierList) {
-      list.forEach((element) => {
-        if (element.gongYingShang.trim()) {
-          const supplier = supplierList.find(
-            (i) => i.gong_ying_shang_m === element.gongYingShang.trim()
-          )
-          if (supplier) {
-            element.shiFouQiJianH = supplier.id_
-          } else {
-            element.shiFouQiJianH = ''
-            element.gongYingShang = ''
-          }
-        } else {
-          element.shiFouQiJianH = ''
-        }
-
-        if (element.shiYongKeShi.trim()) {
-          const supplier = supplierList.find(
-            (i) => i.gong_ying_shang_m === element.shiYongKeShi.trim()
-          )
-          if (supplier) {
-            element.shiYongKeShi = supplier.id_
-          } else {
-            element.shiYongKeShi = ''
-          }
-        } else {
-          element.shiYongKeShi = ''
-        }
-      })
-    },
-    /**
-     *
-     * @param {*} list excel数据
-     * @param {*} positionList 现有房间信息
-     */
-    handlePositionInfo(list, positionList) {
-      list.forEach((element) => {
-        if (element.cunFangDiDian !== '') {
-          const postion = positionList.find(
-            (i) =>
-              (i.fang_jian_ming_ha.trim() || '') ===
-              element.cunFangDiDian.trim()
-          )
-          if (postion) {
-            const positionId = postion.id_
-            element.cunFangWeiZhi = positionId
-          } else {
-            element.cunFangWeiZhi = ''
-            element.cunFangDiDian = ''
-          }
-        } else {
-          element.cunFangWeiZhi = ''
-        }
-      })
-    },
-    handlePersonInfo(list, employeeList) {
-      list.forEach((element) => {
-        // 处理保管人
-        if (element.guanLiRen !== '') {
-          const person = employeeList.find(
-            (i) => i.userName === element.guanLiRen.trim()
-          )
-          if (person) {
-            const personId = person.userId
-            element.guanLiRen = personId
-          } else {
-            element.guanLiRen = ''
-          }
-        } else {
-          element.guanLiRen = ''
-        }
-        // 处理核查人
-        // if (element.biXuDeHuanJin !== '') {
-        //     const checkPerson = employeeList.find(i => i.userName === element.biXuDeHuanJin.trim())
-        //     if (checkPerson) {
-        //         const checkPersonId = checkPerson.userId
-        //         element.biXuDeHuanJin = checkPersonId
-        //     } else {
-        //         element.biXuDeHuanJin = ''
-        //     }
-        // } else {
-        //     element.biXuDeHuanJin = ''
-        // }
-      })
-    },
-    handleDeviceGroupInfo(list, deviceGroupList) {
-      list.forEach((element) => {
-        const result = []
-        const { weiHuFangShi } = element
-        const valList = weiHuFangShi.trim()?.split(',')
-        valList.forEach((item) =>
-          result.push(
-            deviceGroupList?.find((i) => i.positionName === item)?.positionId ||
-              ''
-          )
-        )
-        element.weiHuFangShi = result.join(',')
-      })
-    },
-    async handleUploadChange1(file) {
-      const dataBinary = await this.readFile(file.target.files[0])
-      file.target.value = null // 注意上传后要将input的值设为空
-      const workBook = xlsx.read(dataBinary, {
-        type: 'binary',
-        cellDates: true
-      })
-      const workSheet = workBook.Sheets[workBook.SheetNames[0]]
-      const data = xlsx.utils.sheet_to_json(workSheet)
-      let importData = this.switchDeviceObj(data, {
-        ...this.deviceColumns,
-        t: '设备分组'
-      }) // 这个t用于兼容老版本的模板
-      importData.forEach((i) => {
-        delete i.sheBeiShiBieH // 设备编号需自动生成
-        // i.sheBeiZhuangTa = '合格'
-        const keyFound = Object.entries(this.stateList).find(
-          ([key, value]) => value === i.sheBeiZhuangTa
-        )
-        if (keyFound) {
-          i.sheBeiZhuangTa = keyFound[0]
-        }
-        const keyFound2 = Object.entries(this.typeList).find(
-          ([key, value]) => value === i.sheBeiLeiXing
-        )
-        if (keyFound2) {
-          i.sheBeiLeiXing = keyFound2[0]
-        }
-      })
-      const isNewVersion = importData.some((i) => i.weiHuFangShi) // 判断是否是最新模板
-      if (isNewVersion) {
-        // 使用岗位/分组
-        importData.forEach((i) => {
-          delete i.t
-        })
-      } else {
-        // 使用设备分组
-        importData.forEach((i) => {
-          i.weiHuFangShi = i.t
-          delete i.t
-        })
-      }
-      const currentPosition = this.level
-      const { userList = [], deptList = [] } = this.$store.getters || {}
-      // const positionSql = `select id_,fang_jian_ming_ha from t_jjqfjb where di_dian_ = ${currentPosition}` // 房间信息
-      // const supplierSql = `select id_,gong_ying_shang_m from t_gysxxb where di_dian_ = ${currentPosition}` // 供应商信息
-      // const deviceGroupSql = `select id_,suo_shu_bu_men_,wei_hu_gang_wei_ from t_sbwhgwpzb where di_dian_ =  ${currentPosition}` // 岗位/分组信息
-      const currentTime = dayjs().format('YYYY-MM-DD HH:mm')
-      const currentApartment =
-        this.$store.getters.userInfo.employee.positions.split(',').at(-1) || ''
-      const currentUser = this.userId
-
-      const partOneInvalidResult = this.deviceInvalidPartOne(importData)
-      if (!partOneInvalidResult) return
-
-      importData = this.formatDateFieldsToReal(importData)
-      console.log(
-        '%c partOne doCheck is completed! %c the result is %c',
-        'background:#35495E; padding: 1px; border-radius: 3px 0 0 3px; color: #fff;',
-        'background:#FF5733; padding: 1px; border-radius: 0 3px 3px 0; color: #fff;',
-        'background:transparent',
-        importData
-      )
-      this.loading = true
-      Promise.all([
-        this.$common.request('query', {
-          key: 'getRoomData',
-          params: [currentPosition]
-        }),
-        this.$common.request('query', {
-          key: 'getSupplierList',
-          params: [currentPosition]
-        }),
-        this.$common.request('query', {
-          key: this.config ? 'gwzzzha' : 'getPositionList',
-          params: [currentPosition]
-        })
-      ])
-        .then(async ([res1, res2, res3]) => {
-          const { data: positionList = [] } = res1.variables || {}
-          const { data: supplierList = [] } = res2.variables || {}
-          const { data: deviceGroupList = [] } = res3.variables || {}
-          // 根据原设备编号去重,检验原设备编号是否在数据库中存在
-          const originalDeviceNoList = await this.filterOriginalDeviceNo(
-            importData,
-            currentPosition
-          )
-          await this.handleBasicData(
-            importData,
-            currentTime,
-            currentApartment,
-            currentUser,
-            currentPosition,
-            deptList
-          )
-          this.handleExcelData(
-            importData,
-            positionList,
-            supplierList,
-            userList,
-            deviceGroupList
-          )
-          // 分离出 已存在的设备,和新设备
-          const newDeviceList = importData.filter(
-            (i) => !originalDeviceNoList.includes(i.yuanSheBeiBian.trim())
-          )
-          const existDeviceList = importData.filter((i) =>
-            originalDeviceNoList.includes(i.yuanSheBeiBian.trim())
-          )
-          console.log(
-            '%c new device %c',
-            'background:#FF5733; padding: 1px; border-radius: 0 3px 3px 0; color: #fff;',
-            'background:transparent',
-            newDeviceList
-          )
-          console.log(
-            '%c already exist device %c',
-            'background:#43f80c; padding: 1px; border-radius: 0 3px 3px 0; color: #fff;',
-            'background:transparent',
-            existDeviceList
-          )
-          this.loading = false
-          this.$confirm(
-            `<span style="color:#f56c6c; font-size: 18px; font-weight: 600;">
-                                        经系统判定</span><br>1.预期新导入设备的数量为 ${newDeviceList.length} 台!<br>
-                                        2.预期更新已存在的设备数量为 ${existDeviceList.length} 台!<br>
-                                        <span style="color:#f56c6c;">Tips:请确认数据无误再点击确定进行导入</span><br><span style="color:#f56c6c; font-size: 18px; font-weight: 600;">请谨慎操作!</span>`,
-            '提示',
-            {
-              confirmButtonText: '确定',
-              cancelButtonText: '取消',
-              dangerouslyUseHTMLString: true,
-              type: 'warning'
-            }
-          )
-            .then(async () => {
-              await this.doImportDevice(importData)
-              this.loading = true
-              setTimeout(() => {
-                this.loading = false
-                this.$message.success('设备数据导入成功!')
-                this.getDatas()
-              }, 1000)
-            })
-            .catch(() => {})
-        })
-        .catch(() => {
-          this.loading = false
-        })
-    },
-    async doImportDevice(existDeviceList, currentPosition) {
-      this.loading = true
-      const allRequests = []
-      for (let index = 0; index < existDeviceList.length; index++) {
-        const item = existDeviceList[index]
-        let params = {}
-        if (item.id) {
-          // 获取设备数据
-          const { data: itemData } = await getequipmentCard({ id: item.id })
-          params = { ...itemData, ...item } // 合并数据
-        } else {
-          params = item // 直接使用当前 item
-        }
-        console.log(params)
-        // 将每个 saveEquipmentCard 请求加入到 allRequests 数组中
-        allRequests.push(saveEquipmentCard(params))
-      }
-      // 等待所有异步请求完成
-      await Promise.all(allRequests)
-      this.loading = false
-    },
-    generateDayRule() {
-      const days = [
-        '每周1',
-        '每周2',
-        '每周3',
-        '每周4',
-        '每周5',
-        '每周6',
-        '每周7'
-      ]
-      let combinations = []
-      for (let length = 1; length <= days.length; length++) {
-        this.generateCombinations([], days, combinations)
-      }
-      combinations = combinations.map(
-        (comb) => '每周' + comb.map((item) => item.slice(2)).join(',')
-      )
-      combinations.push('每天')
-      return combinations
-    },
-    generateRule(num, prefix, suffix) {
-      return Array.from({ length: num }, (_, i) => prefix + `${i + 1}` + suffix)
-    },
-    generateCombinations(current, remaining, results) {
-      if (remaining.length === 0) {
-        results.push(current)
-        return
-      }
-      const first = remaining[0]
-      const rest = remaining.slice(1)
-      // 包括当前数字和不包括当前数字两种情况
-      this.generateCombinations(current.concat([first]), rest, results)
-      this.generateCombinations(current, rest, results)
-    },
-    /**
-     * 负责导入设备维护项目数据的第一部分校验,全部成功则返回true
-     * @param {*} data
-     * @returns
-     */
-    maintenanceInvalidPartOne(data) {
-      // 1、对数据进行清洗校验(设备编号不能为空,维护周期、维护项目亦不可为空)
-      const invalidResult = this.checkDeviceRequiredFieldsIfEmpty(
-        data,
-        this.maintenanceRequiredFieldMap
-      )
-      if (invalidResult.length > 0) {
-        this.sendWarningMessages(invalidResult, 'required')
-        return false
-      }
-      // 根据规则校验字段的限定范围
-      const allResult = this.checkFieldsRange(
-        data,
-        this.maintenanceValidationRules
-      )
-      if (allResult.length > 0) {
-        this.sendWarningMessages(allResult, 'range')
-        return false
-      }
-      // 根据规则校验维护周期对应的维护日期的限定范围
-      const result = this.checkMaintenanceDateRange(
-        data,
-        this.maintenanceDateValidationRules
-      )
-      if (result.length > 0) {
-        this.sendWarningMessages(result, 'range')
-        return false
-      }
-      return true
-    },
-    /**
-     * 根据规则校验维护周期对应的维护日期的限定范围
-     */
-    checkMaintenanceDateRange(list, rules) {
-      const msgList = []
-      list.forEach(({ weiHuLeiXing: type, weiHuRiQi: exactDate }, index) => {
-        if (type === '按需保养') {
-          console.log('按需pass2')
-        } else {
-          if (!rules[type].includes(exactDate)) {
-            msgList.push({
-              row: index + 2,
-              field: '维护日期',
-              value: exactDate
-            })
-          }
-        }
-      })
-      return msgList
-    },
-    async handleUploadChange2(file) {
-      const dataBinary = await this.readFile(file.target.files[0])
-      file.target.value = null // 注意上传后要将input的值设为空
-      const workBook = xlsx.read(dataBinary, {
-        type: 'binary',
-        cellDates: true
-      })
-      const workSheet = workBook.Sheets[workBook.SheetNames[0]]
-      const data = xlsx.utils.sheet_to_json(workSheet)
-      const importData = this.switchDeviceObj(data, this.projectColums)
-      console.log(importData)
-      importData.forEach((item) => {
-        if (item.weiHuLeiXing === '按需保养') {
-          item.weiHuRiQi = '/'
-        }
-        if (
-          item.weiHuLeiXing === '日保养' &&
-          item.weiHuRiQi === '每周1,2,3,4,5,6,7'
-        ) {
-          item.weiHuRiQi = '每天'
-        }
-      })
-      const currentPosition = this.level
-      const { userList = [], deptList = [] } = this.$store.getters || {}
-      const positionSql = `select id_,fang_jian_ming_ha from t_jjqfjb where di_dian_ = ${currentPosition}` // 房间信息
-      const supplierSql = `select id_,gong_ying_shang_m from t_gysxxb where di_dian_ = ${currentPosition}` // 供应商信息
-      const deviceGroupSql = `select id_,suo_shu_bu_men_,wei_hu_gang_wei_ from t_sbwhgwpzb where di_dian_ =  ${currentPosition}` // 岗位/分组信息
-      const currentTime = dayjs().format('YYYY-MM-DD HH:mm')
-      const currentApartment = this.$store.getters.userInfo.employee.positions
-      const currentUser = this.userId
-
-      const partOneInvalidResult = this.maintenanceInvalidPartOne(importData)
-      if (!partOneInvalidResult) return
-
-      // 2、根据原设备编号去重,检验原设备编号是否在数据库中存在,如有不存在的数据,不进行导入,并提示用户
-      const uniqueArr = Array.from(
-        new Set(importData.map((i) => i.yuanSheBeiBian.trim()))
-      )
-      /* 3、根据去重的设备编号去查对应的设备ID,然后拼接data数据,赋值设备ID*/
-      // const sql = `select id_,yuan_she_bei_bian from t_sbdj where find_in_set(yuan_she_bei_bian,'${uniqueArr.join(',')}')and di_dian_ = ${currentPosition}`
-      this.$common
-        .request('query', {
-          key: 'getExistDeviceWithImport',
-          params: [uniqueArr.join(','), currentPosition]
-        })
-        .then(async (res) => {
-          const deviceNoWithIdlist = res.variables.data
-          console.log(deviceNoWithIdlist, ' <=> ', uniqueArr)
-          const deviceNoSet = new Set(
-            deviceNoWithIdlist.map((i) => i.yuan_she_bei_bian)
-          )
-          const missStr =
-            uniqueArr.filter((i) => !deviceNoSet.has(i)).join(',') || ''
-          if (missStr !== '') {
-            this.$message.error(
-              `设备维护项目数据中包含不存在于设备档案的原设备编号!具体原设备编号为:${missStr}`
-            )
-            return
-          }
-          importData.forEach((item) => {
-            item.id = deviceNoWithIdlist.find(
-              (i) => i.yuan_she_bei_bian === item.yuanSheBeiBian
-            ).id_
-          })
-
-          const resultList = []
-          importData.forEach((item) => {
-            const flag = item.weiHuLeiXing === '日保养'
-            const match = item.weiHuRiQi?.match(/\d+/g)
-            const o = {
-              id: item.id,
-              weiHuLeiXing: item.weiHuLeiXing.trim(),
-              weiHuRiQi: item.weiHuRiQi?.trim() || '',
-              weiHuXiangMuC: item.weiHuXiangMuC.trim(),
-              riQiShuZi: match ? (flag ? match.join(',') : match[0]) : ''
-            }
-            if (o.weiHuLeiXing === '日保养' && o.weiHuRiQi === '每天')
-              o.riQiShuZi = '1,2,3,4,5,6,7'
-            resultList.push(o)
-          })
-          // 4、根据用户选择 进行全量替换|增量添加
-          await this.doProjectImport(
-            deviceNoWithIdlist,
-            resultList,
-            this.ImportDeviceType
-          )
-          this.$message.success(
-            '维护项目数据' + this.ImportDeviceType + '成功!'
-          )
-        })
-    },
-    async doProjectImport(deviceNoWithIdlist, resultList, type) {
-      this.loading = true
-      const allRequests = []
-      deviceNoWithIdlist.forEach(async (item) => {
-        const { data: itemData } = await getequipmentCard({ id: item.id_ })
-        const temp = resultList
-          .filter((i) => i.id === item.id_)
-          .map((ii) => {
-            delete ii.id
-            return ii
-          })
-        let params = {}
-        if (type === '增量添加') {
-          // 增量
-          params = {
-            ...itemData,
-            maintenanceItemPoList: [...itemData.maintenanceItemPoList, ...temp]
-          }
-        } else if (type === '全量替换') {
-          // 全量
-          params = {
-            ...itemData,
-            maintenanceItemPoList: temp
-          }
-        }
-        console.log('params', params)
-        allRequests.push(saveEquipmentCard(params))
-      })
-      await Promise.all(allRequests)
-      this.loading = false
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-.icon-image {
-  width: 36px;
-}
-.device-image {
-  width: 152px;
-  height: 110px;
-}
-.title {
-  font-size: 12px;
-  font-weight: 900;
-  color: #333;
-  margin: 0 0 14px 20px;
-}
-.ctx {
-  margin: 0 0 0 20px;
-  .item {
-    .cusitem {
-      margin: -8px 0;
-      display: flex;
-      align-items: center;
-    }
-    .span {
-      min-width: 60px;
-    }
-    margin: 6px 0;
-    color: #999;
-  }
-}
-::v-deep {
-  .el-form-item__label {
-    text-align: left;
-    font-size: 12px !important;
-  }
-  .el-form-item__ctx {
-    font-size: 12px !important;
-  }
-}
-</style>

+ 0 - 2430
src/views/component/device/indexV2.vue

@@ -1,2430 +0,0 @@
-<template>
-  <div class="main-container">
-    <ibps-container class="page">
-      <template>
-        <ibps-crud
-          key="istree"
-          ref="crud"
-          :data="listData"
-          :toolbars="
-            readOnly
-              ? listConfig.toolbars.filter((obj) => {
-                  return obj.key == 'search'
-                })
-              : config
-              ? listConfig.toolbars.filter((obj) => {
-                  return obj.key !== 'customSetting'
-                })
-              : listConfig.toolbars
-          "
-          :search-form="listConfig.searchForm"
-          :pk-key="pkKey"
-          :columns="listConfig.columns"
-          :loading="loading"
-          :pagination="pagination"
-          :display-field="tableTitle"
-          :index-row="false"
-          @sort-change="handleSortChange"
-          @action-event="handleAction"
-          @pagination-change="handlePaginationChange"
-        >
-          <template slot="posSlot" slot-scope="{ row }">
-            <ibps-user-selector
-              v-model="row.bianZhiBuMen"
-              type="position"
-              readonly-text="text"
-              :multiple="false"
-              :disabled="true"
-            />
-          </template>
-          <template slot="userSlot" slot-scope="{ row }">
-            <ibps-user-selector
-              v-model="row.guanLiRen"
-              type="user"
-              readonly-text="text"
-              :multiple="true"
-              :disabled="true"
-            />
-          </template>
-
-          <template slot="deviceSlot" slot-scope="{ row }">
-            <ibps-custom-dialog
-              v-model="row.weiHuFangShi"
-              size="mini"
-              :template-key="config ? 'gwzzdhkrcwh' : 'sbbqdhk'"
-              multiple
-              :disabled="true"
-              type="dialog"
-              class="custom-dialog"
-              placeholder="请选择"
-              icon="el-icon-search"
-            />
-          </template>
-
-          <template slot="deviceStateSlot" slot-scope="{ row }">
-            <span>{{
-              stateList[row.sheBeiZhuangTa] || row.sheBeiZhuangTa || ''
-            }}</span>
-          </template>
-          <template slot="deviceTypeSlot" slot-scope="{ row }">
-            <span>{{
-              typeList[row.sheBeiLeiXing] || row.sheBeiLeiXing || ''
-            }}</span>
-          </template>
-
-          <template slot="placeSlot" slot-scope="{ row }">
-            <ibps-custom-dialog
-              v-model="row.cunFangWeiZhi"
-              size="mini"
-              template-key="fjxzkdd"
-              multiple
-              :disabled="true"
-              type="dialog"
-              class="custom-dialog"
-              placeholder="请选择"
-              icon="el-icon-search"
-            />
-          </template>
-
-          <template slot="customButton" slot-scope="{ row }">
-            <el-button
-              type="text"
-              :icon="
-                hasRole && !readOnly ? 'el-icon-edit-outline' : 'ibps-icon-eye'
-              "
-              @click="goEdit(row)"
-              >{{ hasRole && !readOnly ? '修改' : '查阅' }}</el-button
-            >
-            <!-- <el-button type="text" icon="el-icon-view" @click="goLook(row)">查阅</el-button> -->
-            <el-button
-              type="text"
-              icon="ibps-icon-table"
-              @click="goLookForm(row)"
-              >表单</el-button
-            >
-          </template>
-          <template slot="expandSlot" slot-scope="{ row }">
-            <el-row
-              :gutter="20"
-              style="height: 145px; padding: 0 20px 0 0"
-              type="flex"
-              align="middle"
-            >
-              <el-col :span="5" :push="2">
-                <el-row>
-                  <el-col :span="3">
-                    <el-image
-                      class="icon-image"
-                      :src="images[0]"
-                      fit="contain"
-                    />
-                  </el-col>
-                  <el-col :span="21">
-                    <div class="title">验收信息</div>
-                    <div class="ctx">
-                      <div class="item">
-                        接收日期:{{ row.jieShouRiQi || '/' }}
-                      </div>
-                      <div class="item">
-                        验收日期:{{ row.yanShouRiQi || '/' }}
-                      </div>
-                      <div class="item">
-                        核查日期:{{ row.biXuSheShi || '/' }}
-                      </div>
-                    </div>
-                  </el-col>
-                </el-row>
-              </el-col>
-              <el-col :span="5" :push="2">
-                <el-row>
-                  <el-col :span="3">
-                    <el-image
-                      class="icon-image"
-                      :src="images[1]"
-                      fit="contain"
-                    />
-                  </el-col>
-                  <el-col :span="21">
-                    <div class="title">建档信息</div>
-                    <div class="ctx">
-                      <div class="item">
-                        <div class="cusitem">
-                          <span class="span">建档人:</span>
-                          <ibps-user-selector
-                            :value="row.bianZhiRen"
-                            type="user"
-                            readonly-text="text"
-                            :multiple="true"
-                            :disabled="true"
-                            size="mini"
-                            style="width: 100px"
-                          />
-                        </div>
-                      </div>
-                      <div class="item">
-                        <div class="cusitem">
-                          <span class="span">建档部门:</span>
-                          <ibps-user-selector
-                            :value="row.bianZhiBuMen"
-                            type="position"
-                            readonly-text="text"
-                            :disabled="true"
-                            :multiple="false"
-                            size="mini"
-                            style="width: 100px"
-                          />
-                        </div>
-                      </div>
-                      <div class="item">
-                        建档时间:{{ row.bianZhiShiJian || '/' }}
-                      </div>
-                    </div>
-                  </el-col>
-                </el-row>
-              </el-col>
-              <el-col :span="5" :push="2">
-                <el-row>
-                  <el-col :span="3">
-                    <el-image
-                      class="icon-image"
-                      :src="images[2]"
-                      fit="contain"
-                    />
-                  </el-col>
-                  <el-col :span="21">
-                    <div class="title">维护信息</div>
-                    <div class="ctx">
-                      <div class="item">
-                        是否维护:{{ row.shiFouWeiHu || '/' }}
-                      </div>
-                      <div class="item">
-                        是否24H开机:{{ row.jianKongYiJu || '/' }}
-                      </div>
-                      <div class="item">
-                        是否限用:{{ row.xiaoZhunWuCha || '/' }}
-                      </div>
-                    </div>
-                  </el-col>
-                </el-row>
-              </el-col>
-              <el-col :span="5" :push="2">
-                <el-row>
-                  <el-col :span="3">
-                    <el-image
-                      class="icon-image"
-                      :src="images[3]"
-                      fit="contain"
-                    />
-                  </el-col>
-                  <el-col :span="21">
-                    <div class="title">校准信息</div>
-                    <div class="ctx">
-                      <div class="item">
-                        是否校准:{{ row.shiFouXiaoZhun || '/' }}
-                      </div>
-                      <div class="item">
-                        校准周期:{{
-                          row.xiaoZhunZQ ? `${row.xiaoZhunZQ}月` : '/'
-                        }}
-                      </div>
-                      <div class="item">
-                        最近校准时间:{{ row.yiXiaoRiQi || '/' }}
-                      </div>
-                      <div class="item">
-                        校准有效期至:{{ row.xiaoZhunYouXia || '/' }}
-                      </div>
-                    </div>
-                  </el-col>
-                </el-row>
-              </el-col>
-              <el-col :span="4" :push="1">
-                <el-row>
-                  <el-col :span="24">
-                    <el-image
-                      class="device-image"
-                      :src="ImageUrl(row)"
-                      fit="fill"
-                      :preview-src-list="ImageAllUrl(row)"
-                      :title="`[${row.sheBeiMingCheng}]设备首图,点击查看更多`"
-                    >
-                      <div slot="error" class="image-slot">
-                        <el-empty
-                          class="device-image"
-                          description="暂无图片"
-                          :image-size="70"
-                        />
-                      </div>
-                    </el-image>
-                  </el-col>
-                </el-row>
-              </el-col>
-            </el-row>
-          </template>
-          <!-- 搜索条件 -->
-          <template slot="pos">
-            <ibps-user-selector
-              v-if="showDeptSeach"
-              v-model="search.pos"
-              type="position"
-              readonly-text="text"
-              :multiple="true"
-              size="mini"
-              :filter="filter"
-              filtrate
-            />
-            <el-input
-              v-else
-              :value="
-                search.pos
-                  ? search.pos
-                      .split(',')
-                      .map((id) => switchIdToDept(id))
-                      .join(', ')
-                  : '无'
-              "
-              readonly
-              size="mini"
-            />
-          </template>
-          <template slot="time">
-            <el-date-picker
-              v-model="search.time"
-              size="mini"
-              type="daterange"
-              :picker-options="pickerOptions"
-              range-separator="至"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              align="right"
-              value-format="yyyy-MM-dd"
-            />
-          </template>
-          <template slot="validity">
-            <el-date-picker
-              v-model="search.validity"
-              size="mini"
-              type="daterange"
-              :picker-options="pickerOptions"
-              range-separator="至"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              align="right"
-              value-format="yyyy-MM-dd"
-            />
-          </template>
-          <template slot="nowNumber">
-            <el-input v-model="search.nowNumber" size="mini" />
-          </template>
-          <template slot="preNumber">
-            <el-input v-model="search.preNumber" size="mini" />
-          </template>
-          <template slot="deviceName">
-            <el-input v-model="search.deviceName" size="mini" />
-          </template>
-          <template slot="deviceType">
-            <el-select
-              v-model="search.deviceType"
-              placeholder="请选择"
-              size="mini"
-              :clearable="true"
-            >
-              <el-option
-                v-for="(v, k) in typeList"
-                :key="k"
-                :label="v"
-                :value="k"
-              />
-            </el-select>
-          </template>
-          <template slot="deviceStatus">
-            <el-select
-              v-model="search.deviceStatus"
-              placeholder="请选择"
-              size="mini"
-              :clearable="true"
-            >
-              <el-option
-                v-for="(v, k) in stateList"
-                :key="k"
-                :label="v"
-                :value="k"
-              />
-            </el-select>
-          </template>
-          <!-- <template slot="place">
-                        <el-input v-model="search.place" size="mini" />
-                    </template> -->
-          <template slot="place">
-            <ibps-custom-dialog
-              v-model="search.place"
-              size="mini"
-              template-key="fjxzkdd"
-              multiple
-              :disabled="false"
-              type="dialog"
-              class="custom-dialog"
-              placeholder="请选择"
-              icon="el-icon-search"
-            />
-          </template>
-          <template slot="managePeople">
-            <ibps-user-selector
-              v-model="search.managePeople"
-              type="user"
-              readonly-text="text"
-              :multiple="true"
-              size="mini"
-              :filter="filter"
-              filtrate
-            />
-          </template>
-          <template slot="deviceClass">
-            <ibps-custom-dialog
-              v-model="search.deviceClass"
-              size="mini"
-              :template-key="config ? 'gwzzdhkrcwh' : 'sbbqdhk'"
-              multiple
-              :disabled="false"
-              type="dialog"
-              class="custom-dialog"
-              placeholder="请选择"
-              icon="el-icon-search"
-            />
-          </template>
-        </ibps-crud>
-      </template>
-    </ibps-container>
-    <DeviceDialog
-      v-if="deviceDialogShow"
-      :params="params"
-      :state-list="stateList"
-      :type-list="typeList"
-      :tab-list="tabList"
-      :hide-sys-device-no="hideSysDeviceNo"
-      :has-fu-ze-ren-dian-hua="hasFuZeRenDianHua"
-      :has-chang-jia-lian-xi-ren="hasChangJiaLianXiRen"
-      :readonly="!hasRole || readOnly"
-      @close="close"
-    />
-    <input
-      id=""
-      ref="file1"
-      type="file"
-      name=""
-      accept=".xlsx,.xls"
-      @change="handleUploadChange1"
-    />
-    <input
-      id=""
-      ref="file2"
-      type="file"
-      name=""
-      accept=".xlsx,.xls"
-      @change="handleUploadChange2"
-    />
-
-    <custom-dialog
-      :visible="customDialogVisible"
-      :value="[]"
-      template-key="sbfzpz"
-      :dynamic-params="{}"
-      @close="(visible) => (customDialogVisible = visible)"
-    />
-
-    <bpmn-formrender
-      :visible="npmDialogFormVisible"
-      def-id="1120718364969271296"
-      @close="(visible) => (npmDialogFormVisible = visible)"
-    />
-    <!-- <DeviceTagWeiNing v-if="tagName==='deviceTagWeiNing'" :scan-visible="printVisible" :obj="printObj" :state-list="stateList" @scanOff="scanOff" /> -->
-    <DeviceTagTemplateTwo
-      v-if="tagName === 'deviceTagTemplateTwo'"
-      :tag-data="tagData"
-      :scan-visible="printVisible"
-      :obj="printObj"
-      :state-list="stateList"
-      @scanOff="scanOff"
-    />
-    <DeviceTagTemplateThree
-      v-else-if="tagName === 'deviceTagTemplateThree'"
-      :tag-data="tagData"
-      :scan-visible="printVisible"
-      :obj="printObj"
-      :state-list="stateList"
-      @scanOff="scanOff"
-    />
-    <DeviceTag
-      v-else
-      :scan-visible="printVisible"
-      :obj="printObj"
-      :tag-data="tagData"
-      :state-list="stateList"
-      @scanOff="scanOff"
-    />
-    <el-dialog
-      :close-on-click-modal="false"
-      :close-on-press-escape="false"
-      :top="'3vh'"
-      :width="'90%'"
-      class="js-custom-dialog"
-      append-to-body
-      :fullscreen="false"
-      :visible.sync="iframeVisible"
-    >
-      <iframe
-        :src="srcUrl"
-        :height="'100%'"
-        :width="'100%'"
-        frameborder="0"
-        scrolling="no"
-      />
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { getSetting } from '@/utils/query'
-import image01 from '@/assets/images/device/01.png'
-import image02 from '@/assets/images/device/02.png'
-import image03 from '@/assets/images/device/03.png'
-import image04 from '@/assets/images/device/04.png'
-import { getImage } from '@/api/platform/file/attachment'
-import { download } from '@/api/platform/file/attachment'
-
-import xlsx from 'xlsx'
-import fs from 'file-saver'
-import DataTemplateFormrenderDialog from '@/business/platform/data/templaterender/form/dialog.vue'
-import ActionUtils from '@/utils/action'
-import FixHeight from '@/mixins/height'
-import ibpsUserSelector from '@/business/platform/org/selector'
-import DeviceDialog from './deviceDialog.vue'
-import {
-  queryequipmentCard,
-  removeEquipmentCard,
-  getequipmentCard,
-  saveEquipmentCard
-} from '@/api/platform/device/device'
-import CustomDialog from '@/business/platform/data/templaterender/custom-dialog/dialog'
-import dayjs from 'dayjs'
-import DeviceTag from '@/views/system/jbdScan/goods/deviceTag.vue'
-// import DeviceTagWeiNing from '@/views/system/jbdScan/goods/deviceTagWeiNing.vue'
-import DeviceTagTemplateTwo from '@/views/system/jbdScan/goods/deviceTagTemplateTwo'
-import DeviceTagTemplateThree from '@/views/system/jbdScan/goods/deviceTagTemplateThree'
-export default {
-  components: {
-    DeviceTag,
-    // DeviceTagWeiNing,
-    DeviceTagTemplateTwo,
-    DeviceTagTemplateThree,
-    DataTemplateFormrenderDialog,
-    DeviceDialog,
-    ibpsUserSelector,
-    CustomDialog,
-    IbpsCustomDialog: () =>
-      import('@/business/platform/data/templaterender/custom-dialog')
-  },
-  mixins: [FixHeight],
-  data() {
-    const { userId, level = {}, position, setting } = this.$store.getters || {}
-
-    return {
-      config: setting?.postJob?.allocation || false,
-      filter: [
-        {
-          descVal: '1',
-          includeSub: true,
-          old: 'position',
-          partyId: this.$store.getters.userInfo.employee.positions,
-          partyName: '',
-          scriptContent: '',
-          type: 'user',
-          userType: 'position'
-        }
-      ],
-      images: [image01, image02, image03, image04],
-      ImportDeviceType: '',
-      iframeVisible: false,
-      srcUrl: '',
-      printObj: [],
-      printVisible: false,
-      DialogVisible: true,
-      npmDialogFormVisible: false,
-      customDialogVisible: false,
-      pickerOptions: {
-        shortcuts: [
-          {
-            text: '最近一周',
-            onClick(picker) {
-              const end = new Date()
-              const start = new Date()
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
-              picker.$emit('pick', [start, end])
-            }
-          },
-          {
-            text: '最近一个月',
-            onClick(picker) {
-              const end = new Date()
-              const start = new Date()
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
-              picker.$emit('pick', [start, end])
-            }
-          },
-          {
-            text: '最近三个月',
-            onClick(picker) {
-              const end = new Date()
-              const start = new Date()
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
-              picker.$emit('pick', [start, end])
-            }
-          }
-        ]
-      },
-      params: {},
-      deviceDialogShow: false,
-      position: position,
-      level: level.second || level.first,
-      userId: userId,
-      search: {
-        pos: '',
-        time: [],
-        nowNumber: '',
-        preNumber: '',
-        deviceName: '',
-        deviceType: '',
-        deviceStatus: '',
-        place: '',
-        managePeople: '',
-        deviceClass: '',
-        validity: ''
-      },
-      loading: false,
-      pkKey: 'id', // 主键  如果主键不是pk需要传主键
-      pkValue: '',
-      templateKey: '',
-      visible: false,
-      categoryKey: '',
-      tableTitle: '设备基本信息列表', // 标题
-      listData: [],
-      selectListData: [], // 全部数据
-      bianlistData: {
-        dataResult: [],
-        pageResult: {
-          limit: 0,
-          page: 0,
-          totalCount: 0,
-          totalPages: 0
-        }
-      },
-      showDeptSeach: true,
-      listConfig: {
-        // 工具栏
-        toolbars: [
-          { key: 'search' },
-          {
-            key: 'customAdd',
-            label: '设备建档',
-            icon: 'ibps-icon-plus',
-            type: 'success'
-          },
-          {
-            key: 'customBpm',
-            label: '设备管理台账',
-            icon: 'ibps-icon-file-text',
-            type: 'info'
-          },
-          // todo 待开发
-          {
-            key: 'customPrint',
-            label: '打印标签',
-            icon: 'ibps-icon-cog',
-            type: 'warning'
-          },
-          {
-            key: 'customExport',
-            label: '导出数据',
-            icon: 'ibps-icon-sign-in',
-            type: 'primary'
-          },
-          {
-            key: 'customImport',
-            label: '导入数据',
-            icon: 'ibps-icon-sign-in',
-            type: 'primary'
-          },
-          {
-            key: 'customSetting',
-            label: '岗位/分组配置',
-            icon: 'ibps-icon-cogs',
-            type: 'info'
-          },
-          {
-            key: 'customRemove',
-            label: '删除',
-            icon: 'ibps-icon-close',
-            type: 'danger',
-            hidden: () => {
-              return !this.hasRole
-            }
-          }
-        ],
-        // 查询条件
-        searchForm: {
-          itemWidth: 200,
-          labelWidth: 100,
-          forms: [
-            { prop: '', label: '部门', fieldType: 'slot', slotName: 'pos' }, // user 插槽
-            {
-              prop: '',
-              label: '建档时间',
-              fieldType: 'slot',
-              slotName: 'time'
-            },
-            {
-              prop: '',
-              label: '设备编号',
-              fieldType: 'slot',
-              slotName: 'nowNumber'
-            },
-            {
-              prop: '',
-              label: '原设备编号',
-              fieldType: 'slot',
-              slotName: 'preNumber'
-            },
-            {
-              prop: '',
-              label: '设备名称',
-              fieldType: 'slot',
-              slotName: 'deviceName'
-            },
-            {
-              prop: '',
-              label: '设备类型',
-              fieldType: 'slot',
-              slotName: 'deviceType'
-            },
-            {
-              prop: '',
-              label: '设备状态',
-              fieldType: 'slot',
-              slotName: 'deviceStatus'
-            },
-            {
-              prop: '',
-              label: '放置地点',
-              fieldType: 'slot',
-              slotName: 'place'
-            },
-            {
-              prop: '',
-              label: '保管人',
-              fieldType: 'slot',
-              slotName: 'managePeople'
-            },
-            {
-              prop: '',
-              label: '岗位/分组',
-              fieldType: 'slot',
-              slotName: 'deviceClass'
-            }
-            // {
-            //   prop: '',
-            //   label: '校准有效期',
-            //   fieldType: 'slot',
-            //   slotName: 'validity'
-            // }
-          ]
-        },
-        // 表格字段配置
-        columns: [
-          { type: 'expand', slotName: 'expandSlot' },
-          {
-            prop: 'bianZhiBuMen',
-            label: '部门',
-            slotName: 'posSlot',
-            sortable: true
-          },
-          {
-            prop: 'bianZhiShiJian',
-            label: '建档时间',
-            sortable: true,
-            width: 130
-          },
-          { prop: 'sheBeiShiBieH', label: '设备编号', sortable: true },
-          { prop: 'yuanSheBeiBian', label: '原设备编号', sortable: true },
-          { prop: 'sheBeiMingCheng', label: '设备名称', sortable: true },
-          {
-            prop: 'sheBeiLeiXing',
-            label: '设备类型',
-            sortable: true,
-            slotName: 'deviceTypeSlot'
-          },
-          {
-            prop: 'sheBeiZhuangTa',
-            label: '设备状态',
-            sortable: true,
-            slotName: 'deviceStateSlot'
-          },
-          {
-            prop: 'cunFangWeiZhi',
-            label: '放置地点',
-            slotName: 'placeSlot',
-            sortable: true
-          },
-          {
-            prop: 'guanLiRen',
-            label: '保管人',
-            slotName: 'userSlot',
-            sortable: true
-          },
-          {
-            prop: 'weiHuFangShi',
-            label: '岗位/分组',
-            slotName: 'deviceSlot',
-            sortable: true
-          },
-          { prop: 'guiGeXingHao', label: '规格型号', sortable: true },
-          { prop: '', label: '操作', width: 130, slotName: 'customButton' }
-        ]
-      },
-      pagination: {
-        limit: 20,
-        page: 1
-      },
-      sorts: [{ field: 'BIAN_ZHI_SHI_JIAN', order: 'desc' }],
-      sqlWhere: {},
-      searchWhere: {},
-      deviceColumns: {
-        bianZhiBuMen: '部门',
-        sheBeiMingCheng: '设备名称',
-        // sheBeiShiBieH: '设备编号(导入无需填写)',
-        yuanSheBeiBian: '原设备编号(必填,且不可重复)',
-        sheBeiZhuangTa: '设备状态(合格/停用/限用)',
-        sheBeiLeiXing: '设备类型(检验系统/通用设备/软件/信息系统)',
-        shiFouWeiHu: '是否维护(是/否)',
-        shiFouXiaoZhun: '是否校准(是/否)',
-        weiHuFangShi: '岗位/分组',
-        guiGeXingHao: '规格型号',
-        cunFangDiDian: '存放地点(格式:房间号+空格+房间名)',
-        guanLiRen: '保管人',
-        ziChanBianHao: '资产编号',
-        ziChanYuanZhi: '资产原值(元)',
-        gongYingShang: '供应商',
-        lianXiFangShi: '联系方式',
-        changShang: '厂商',
-        jiShenXuHao: '机身序号',
-        zhuCeZhengHao: '注册证号',
-        heChaXiaoZhun: '使用年限(年)',
-        chuChangRiQi: '出厂日期',
-        yanShouRiQi: '验收日期',
-        jieShouRiQi: '接收日期',
-        qiYongRiQi: '投入日期',
-        yiXiaoRiQi: '已校日期',
-        xiaoZhunZQ: '检定/校准周期(以月为单位)',
-        xiaoZhunYouXia: '校准有效期至',
-        shiYongKeShi: '检定/校准单位',
-        ceLiangGongZuo: '预期测量范围',
-        huanJingYaoQiu: '环境要求',
-        dianYuanYaoQiu: '电源要求',
-        jieShouZhuangTai: '接收时状态(新设备/二手或翻新设备)',
-        jianDingXiao: '检定/校准参数',
-        zuiDaYunCha: 'U/精确度/最大允差',
-        zhengShuBianHa: '证书编号',
-        xiuZhengZhiXiu: '修正值/修正因子',
-        wenDuYingYong: '温度应用修正值',
-        shiDuYingYong: '湿度应用修正值'
-        // biXuDeHuanJin: '核查人',
-        // biXuSheShi: '核查日期',
-      },
-      projectColums: {
-        yuanSheBeiBian: '原设备编号*',
-        sheBeiMingCheng: '设备名称*',
-        weiHuLeiXing:
-          '维护类型*(日保养/周保养/月保养/季度保养/半年保养/年保养/按需保养)',
-        weiHuRiQi: '维护日期*',
-        weiHuXiangMuC: '维护项目*'
-      },
-      dateFieldRange: [
-        'chuChangRiQi',
-        'yanShouRiQi',
-        'jieShouRiQi',
-        'qiYongRiQi',
-        'yiXiaoRiQi',
-        'xiaoZhunYouXia'
-      ],
-      requiredFieldMap: {
-        bianZhiBuMen: '部门',
-        sheBeiMingCheng: '设备名称',
-        yuanSheBeiBian: '原设备编号',
-        sheBeiZhuangTa: '设备状态',
-        sheBeiLeiXing: '设备类型',
-        shiFouWeiHu: '是否维护',
-        shiFouXiaoZhun: '是否校准'
-      },
-      dateFieldsMap: {
-        chuChangRiQi: '出厂日期',
-        yanShouRiQi: '验收日期',
-        jieShouRiQi: '接收日期',
-        qiYongRiQi: '投入日期',
-        yiXiaoRiQi: '已校日期',
-        xiaoZhunYouXia: '校准有效期至'
-        // 'biXuSheShi': '核查日期'
-      },
-      validationRules: {
-        设备状态: {
-          field: 'sheBeiZhuangTa',
-          range: ['合格', '停用', '限用', '报废']
-        },
-        设备类型: {
-          field: 'sheBeiLeiXing',
-          range: ['检验系统', '通用设备', '软件', '信息系统']
-        },
-        接收时状态: {
-          field: 'jieShouZhuangTai',
-          range: ['新设备', '二手或翻新设备']
-        },
-        是否校准: {
-          field: 'shiFouXiaoZhun',
-          range: ['是', '否']
-        },
-        是否维护: {
-          field: 'shiFouWeiHu',
-          range: ['是', '否']
-        }
-      },
-      numberFieldsMap: {
-        xiaoZhunZQ: '检定/校准周期(以月为单位)',
-        heChaXiaoZhun: '使用年限(年)',
-        ziChanYuanZhi: '资产原值(元)'
-      },
-      maintenanceRequiredFieldMap: {
-        yuanSheBeiBian: '原设备编号',
-        sheBeiMingCheng: '设备名称',
-        weiHuLeiXing: '维护类型',
-        weiHuRiQi: '维护日期',
-        weiHuXiangMuC: '维护项目'
-      },
-      maintenanceValidationRules: {
-        维护类型: {
-          field: 'weiHuLeiXing',
-          range: [
-            '日保养',
-            '周保养',
-            '月保养',
-            '季度保养',
-            '半年保养',
-            '年保养',
-            '按需保养'
-          ]
-        }
-      },
-      maintenanceDateValidationRules: {
-        日保养: this.generateDayRule(),
-        周保养: this.generateRule(7, `每周`, ``),
-        月保养: this.generateRule(28, `每月第`, `日`),
-        半年保养: this.generateRule(6, `每半年第`, `个月`),
-        季度保养: this.generateRule(3, `每季度第`, `个月`),
-        年保养: this.generateRule(12, `每年第`, `个月`),
-        按需保养: ['/']
-      },
-      stateList: { 停用: '停用', 报废: '报废', 合格: '合格' },
-      hideSysDeviceNo: false,
-      hasFuZeRenDianHua: false,
-      hasChangJiaLianXiRen: false,
-      tabList: {},
-      hasRole: true,
-      readOnly: this.$route.fullPath === '/xxgl/sbda',
-      typeList: {
-        检验系统: '检验系统',
-        通用设备: '通用设备',
-        软件: '软件',
-        信息系统: '信息系统'
-      },
-      tagName: '',
-      tagData: {},
-      config: setting?.postJob?.allocation || false
-    }
-  },
-  async mounted() {
-    const {
-      stateList,
-      hideSysDeviceNo,
-      tabList,
-      hasDeviceRole,
-      typeList,
-      hasFuZeRenDianHua,
-      hasChangJiaLianXiRen
-    } = (await getSetting('device')) || {}
-    const { tagData, tagName } = (await getSetting('deviceTag')) || {}
-    if (tagName) {
-      console.debug('tagName', tagName)
-      this.tagName = tagName
-      this.tagData = tagData
-    }
-    if (hasDeviceRole) {
-      console.debug('hasDeviceRole', hasDeviceRole)
-      const { role, isSuper } = this.$store.getters || {}
-      this.hasRole =
-        isSuper || role.some((r) => hasDeviceRole.includes(r.alias))
-    }
-    if (stateList) {
-      console.debug('stateList', stateList)
-      this.stateList = stateList
-    }
-    if (typeList) {
-      console.debug('typeList', typeList)
-      this.typeList = typeList
-    }
-    if (hideSysDeviceNo) {
-      this.hideSysDeviceNo = hideSysDeviceNo
-      // 列表隐藏设备编号 将原设备编号改为设备编号
-      this.listConfig.columns = this.listConfig.columns.filter(
-        (i) => i.prop !== 'sheBeiShiBieH'
-      )
-      this.listConfig.columns.find((i) => i.prop === 'yuanSheBeiBian').label =
-        '设备编号'
-      // 查询条件隐藏设备编号 将原设备编号改为设备编号
-      this.listConfig.searchForm.forms =
-        this.listConfig.searchForm.forms.filter(
-          (i) => i.slotName !== 'nowNumber'
-        )
-      this.listConfig.searchForm.forms.find(
-        (i) => i.slotName === 'preNumber'
-      ).label = '设备编号'
-    }
-    if (hasFuZeRenDianHua) {
-      this.hasFuZeRenDianHua = hasFuZeRenDianHua
-    }
-    if (hasChangJiaLianXiRen) {
-      this.hasChangJiaLianXiRen = hasChangJiaLianXiRen
-    }
-    if (tabList) {
-      console.debug('tabList', tabList)
-      this.tabList = tabList
-    }
-    this.getDatas()
-  },
-  methods: {
-    ImageAllUrl(row) {
-      if (row && row.buMen) {
-        const imgId = row.buMen.split(',')
-        return imgId.map((item) => getImage(item))
-      }
-      return []
-    },
-    ImageUrl(row) {
-      if (row && row.buMen) {
-        const imgId = row.buMen.split(',')[0]
-        return getImage(imgId)
-      }
-      return ''
-    },
-    async getDatas() {
-      this.loading = true
-      const parameters = {
-        relation: 'AND',
-        parameters: []
-      }
-      // 增加地点过滤
-      const obj = { relation: 'AND', parameters: [] }
-      obj.parameters.push({
-        key: 'Q^di_dian_^S',
-        value: this.level,
-        param: this.$utils.guid()
-      })
-      parameters.parameters.push(obj)
-
-      //设备管理组组长能看到所有设备,其他人仅能查看所在专业组的设备
-      const userRoleList = this.$store.getters.userInfo.role
-      let flag = true
-      userRoleList.forEach((item) => {
-        if (item.alias === 'xtgljs' || item.alias === 'sbglxzfzr') {
-          //设备管理组组长、系统管理员
-          flag = false
-        }
-      })
-      const bumen = this.$store.getters.userInfo.employee.positions
-      if (flag) {
-        //增加部门过滤条件
-        //const bumen = this.$store.getters.userInfo
-        this.search.pos = bumen
-        this.showDeptSeach = false
-      }
-
-      // 部门搜索(可多选)
-      if (this.search.pos) {
-        const obj = { relation: 'OR', parameters: [] }
-        this.search.pos.split(',').forEach((item) => {
-          obj.parameters.push({
-            key: 'Q^bian_zhi_bu_men_^S',
-            value: item,
-            param: this.$utils.guid()
-          })
-        })
-        parameters.parameters.push(obj)
-      }
-      // 建档时间搜索
-      if (this.search.time && this.search.time.length === 2) {
-        const obj = { relation: 'AND', parameters: [] }
-        obj.parameters.push({
-          key: 'Q^bian_zhi_shi_jian^DL^yyyy-MM-dd',
-          value: this.search.time[0],
-          param: this.$utils.guid()
-        })
-        obj.parameters.push({
-          key: 'Q^bian_zhi_shi_jian^DG^yyyy-MM-dd',
-          value: this.search.time[1],
-          param: this.$utils.guid()
-        })
-        parameters.parameters.push(obj)
-      }
-      if (this.search.validity && this.search.validity.length === 2) {
-        const obj = { relation: 'AND', parameters: [] }
-        obj.parameters.push({
-          key: 'Q^xiao_zhun_you_xia^DL^yyyy-MM-dd',
-          value: this.search.validity[0],
-          param: this.$utils.guid()
-        })
-        obj.parameters.push({
-          key: 'Q^xiao_zhun_you_xia^DG^yyyy-MM-dd',
-          value: this.search.validity[1],
-          param: this.$utils.guid()
-        })
-        parameters.parameters.push(obj)
-      }
-      // 设备编号搜索
-      if (this.search.nowNumber) {
-        const obj = { relation: 'AND', parameters: [] }
-        obj.parameters.push({
-          key: 'Q^she_bei_shi_bie_h^SL',
-          value: this.search.nowNumber,
-          param: this.$utils.guid()
-        })
-        parameters.parameters.push(obj)
-      }
-      // 原设备编号搜索
-      if (this.search.preNumber) {
-        const obj = { relation: 'AND', parameters: [] }
-        obj.parameters.push({
-          key: 'Q^yuan_she_bei_bian^SL',
-          value: this.search.preNumber,
-          param: this.$utils.guid()
-        })
-        parameters.parameters.push(obj)
-      }
-      // 设备名称搜索
-      if (this.search.deviceName) {
-        const obj = { relation: 'AND', parameters: [] }
-        obj.parameters.push({
-          key: 'Q^she_bei_ming_cheng_^SL',
-          value: this.search.deviceName,
-          param: this.$utils.guid()
-        })
-        parameters.parameters.push(obj)
-      }
-      // 设备类型搜索
-      if (this.search.deviceType) {
-        const obj = { relation: 'AND', parameters: [] }
-        obj.parameters.push({
-          key: 'Q^she_bei_lei_xing_^S',
-          value: this.search.deviceType,
-          param: this.$utils.guid()
-        })
-        parameters.parameters.push(obj)
-      }
-      // 设备状态搜索
-      if (this.search.deviceStatus) {
-        const obj = { relation: 'AND', parameters: [] }
-        obj.parameters.push({
-          key: 'Q^she_bei_zhuang_ta^S',
-          value: this.search.deviceStatus,
-          param: this.$utils.guid()
-        })
-        parameters.parameters.push(obj)
-      }
-      // 放置地点搜索
-      // if (this.search.place) {
-      //     const obj = { relation: 'AND', parameters: [] }
-      //     obj.parameters.push({ key: 'Q^cun_fang_di_dian_^SL', value: this.search.place, param: this.$utils.guid() })
-      //     parameters.parameters.push(obj)
-      // }
-      if (this.search.place) {
-        const obj = { relation: 'OR', parameters: [] }
-        this.search.place.split(',').forEach((item) => {
-          obj.parameters.push({
-            key: 'Q^cun_fang_wei_zhi_^S',
-            value: item,
-            param: this.$utils.guid()
-          })
-        })
-        parameters.parameters.push(obj)
-      }
-      // 保管人搜索(可多选)
-      if (this.search.managePeople) {
-        const obj = { relation: 'OR', parameters: [] }
-        this.search.managePeople.split(',').forEach((item) => {
-          obj.parameters.push({
-            key: 'Q^guan_li_ren_^S',
-            value: item,
-            param: this.$utils.guid()
-          })
-        })
-        parameters.parameters.push(obj)
-      }
-      // 岗位/分组搜索(可多选)
-      if (this.search.deviceClass) {
-        const obj = { relation: 'OR', parameters: [] }
-        this.search.deviceClass.split(',').forEach((item) => {
-          obj.parameters.push({
-            key: 'Q^wei_hu_fang_shi_^SL',
-            value: item,
-            param: this.$utils.guid()
-          })
-        })
-        parameters.parameters.push(obj)
-      }
-      const params = {
-        requestPage: {
-          pageNo: this.pagination.page,
-          limit: this.pagination.limit
-        },
-        sorts: this.sorts
-      }
-      if (parameters.parameters.length > 0) {
-        params.parameters = [parameters]
-      }
-
-      const {
-        data: { dataResult, pageResult }
-      } = await queryequipmentCard(params)
-
-      this.bianlistData.pageResult = pageResult
-      this.bianlistData.dataResult = dataResult
-      ActionUtils.handleListData(this, this.bianlistData) // 调用内置方法
-      this.loading = false
-    },
-    // 查看表单
-    goLookForm(row) {
-      const { first, second } = this.$store.getters.level || {}
-      const didian = second || first
-      this.srcUrl =
-        this.$reportPath.replace('show', 'pdf') +
-        '设备/设备档案卡.rpx&id_=' +
-        row.id +
-        '&org_=' +
-        first +
-        '&second_=' +
-        didian
-      this.iframeVisible = true
-    },
-    // 按钮事件处理
-    handleAction(command, position, selection, data, index, button) {
-      switch (command) {
-        case 'search': // 查询
-          this.getDatas()
-          break
-        case 'customAdd':
-          this.handleCustomAdd()
-          break
-        case 'customSetting':
-          this.handleCustomSetting()
-          break
-        case 'customRemove':
-          this.handleCustomRemove(selection)
-          break
-        case 'customExport':
-          this.handleCustomExport(selection, data)
-          break
-        case 'customImport':
-          this.handleCustomImport()
-          break
-        case 'customBpm':
-          this.handleCustomBpm()
-          break
-        case 'customPrint':
-          this.handleCustomPrint(selection)
-          break
-        default:
-          break
-      }
-    },
-    // 打印标签
-    handleCustomPrint(selection = []) {
-      if (selection.length === 0) {
-        return this.$message.warning('请先选择需要打印标签的数据!')
-      }
-      this.printObj = selection
-      this.printVisible = true
-    },
-    // 关闭标签
-    scanOff() {
-      this.printVisible = false
-    },
-    // 设备台账
-    handleCustomBpm() {
-      this.npmDialogFormVisible = true
-    },
-    // 处理分页事件
-    async handlePaginationChange(page) {
-      ActionUtils.setPagination(this.pagination, page)
-      this.getDatas()
-    },
-    // 处理排序
-    handleSortChange(sort) {
-      function removeUnderscores(str) {
-        return str.replace(/^_+|_+$/g, '')
-      }
-      const { order, sortBy } = sort
-      let s = ''
-      switch (sortBy) {
-        case 'BIAN_ZHI_SHI_JIAN_':
-        case 'SHE_BEI_SHI_BIE_H_':
-        case 'YUAN_SHE_BEI_BIAN_':
-        case 'SHE_BEI_ZHUANG_TA_':
-          s = removeUnderscores(sortBy)
-          break
-        default:
-          s = sortBy
-      }
-      let o = null
-      if (order === 'descending') {
-        o = 'desc'
-      } else if (order === 'ascending') {
-        o = 'asc'
-      }
-      this.sorts = [{ field: s, order: o }]
-      this.getDatas()
-    },
-    handleCustomAdd() {
-      this.params = {}
-      this.deviceDialogShow = true
-    },
-    close() {
-      this.deviceDialogShow = false
-      this.getDatas()
-    },
-    goEdit(row) {
-      this.params = row
-      this.deviceDialogShow = true
-    },
-    handleCustomSetting() {
-      this.customDialogVisible = true
-    },
-    handleCustomRemove(selection) {
-      if (!this.hasRole) return
-      console.log('selection', selection)
-      if (!selection || selection.length === 0) {
-        return this.$message.warning('请选择要删除的数据!')
-      }
-      this.$confirm(
-        `此操作将永久删除已选中的${selection.length}条数据, 是否确定? `,
-        '提示',
-        {
-          confirmButtonText: '继续',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }
-      )
-        .then(async () => {
-          await removeEquipmentCard({
-            ids: selection + ''
-          })
-          // 删除后刷新
-          await this.getDatas()
-          this.$message.success('删除成功!')
-        })
-        .catch(() => {})
-    },
-    // 导出
-    handleCustomExport(selection, data) {
-      this.$confirm('请选择导出的类型', '提示', {
-        confirmButtonText: '导出设备',
-        cancelButtonText: '导出维护项目',
-        closeOnClickModal: false,
-        closeOnPressEscape: false,
-        distinguishCancelAndClose: true,
-        type: 'info'
-      })
-        .then(() => {
-          this.ExportDevice(selection, data)
-        })
-        .catch((action) => {
-          if (action === 'close') return
-          if (action === 'cancel') {
-            this.ExportProject(selection, data)
-          }
-        })
-    },
-    // 导入
-    handleCustomImport() {
-      this.$confirm('确请选择导入的类型', '提示', {
-        confirmButtonText: '导入设备',
-        cancelButtonText: '导入维护项目',
-        closeOnClickModal: false,
-        closeOnPressEscape: false,
-        distinguishCancelAndClose: true,
-        type: 'info'
-      })
-        .then(() => {
-          this.ImportDevice()
-        })
-        .catch((action) => {
-          if (action === 'close') return
-          if (action === 'cancel') {
-            this.$confirm('请选择设备维护项目导入类型', '提示', {
-              confirmButtonText: '增量添加',
-              cancelButtonText: '全量替换',
-              closeOnClickModal: false,
-              closeOnPressEscape: false,
-              distinguishCancelAndClose: true,
-              type: 'info'
-            })
-              .then(() => {
-                this.ImportDeviceType = '增量添加'
-                this.ImportProject()
-              })
-              .catch((action) => {
-                if (action === 'close') return
-                if (action === 'cancel') {
-                  this.ImportDeviceType = '全量替换'
-                  this.ImportProject()
-                }
-              })
-          }
-        })
-    },
-    // 导入设备
-    ImportDevice() {
-      this.$refs.file1.click()
-      console.log('导入设备')
-    },
-    // 导入维护项目
-    ImportProject() {
-      this.$refs.file2.click()
-      console.log('导入维护项目')
-    },
-    getTimeStamp() {
-      return dayjs().format('YYYYMMDDHHmmss')
-    },
-    xlsx(json, fields, filename = '.xlsx') {
-      // 导出xlsx
-      json.forEach((item) => {
-        for (const i in item) {
-          if (fields.hasOwnProperty(i)) {
-            item[fields[i]] = item[i]
-          }
-          delete item[i] // 删除原先的对象属性
-        }
-      })
-      const sheetName = filename // excel的文件名称
-      const wb = xlsx.utils.book_new() // 工作簿对象包含一SheetNames数组,以及一个表对象映射表名称到表对象。XLSX.utils.book_new实用函数创建一个新的工作簿对象。
-      const ws = xlsx.utils.json_to_sheet(json, {
-        header: Object.values(fields)
-      }) // 将JS对象数组转换为工作表。
-      wb.SheetNames.push(sheetName)
-      wb.Sheets[sheetName] = ws
-      const defaultCellStyle = {
-        font: { name: 'Verdana', sz: 13, color: 'FF00FF88' },
-        fill: { fgColor: { rgb: 'FFFFAA00' } }
-      } // 设置表格的样式
-      const wopts = {
-        bookType: 'xlsx',
-        bookSST: false,
-        type: 'binary',
-        cellStyles: true,
-        defaultCellStyle: defaultCellStyle,
-        showGridLines: false
-      } // 写入的样式
-      const wbout = xlsx.write(wb, wopts)
-      const blob = new Blob([this.s2ab(wbout)], {
-        type: 'application/octet-stream'
-      })
-      fs.saveAs(blob, filename + '.xlsx')
-    },
-    s2ab(s) {
-      let buf
-      if (typeof ArrayBuffer !== 'undefined') {
-        buf = new ArrayBuffer(s.length)
-        const view = new Uint8Array(buf)
-        for (let i = 0; i !== s.length; ++i) view[i] = s.charCodeAt(i) & 0xff
-        return buf
-      } else {
-        buf = new Array(s.length)
-        for (let i = 0; i !== s.length; ++i) buf[i] = s.charCodeAt(i) & 0xff
-        return buf
-      }
-    },
-    async switchExportData(data) {
-      // const deviceGroupSql = `select id_, wei_hu_gang_wei_ from t_sbwhgwpzb where di_dian_ = '${second || first}'` // 岗位/分组信息
-      // const supplierSql = `select id_, gong_ying_shang_m from t_gysxxb where di_dian_ = '${second || first}'` // 供应商信息
-      const { first, second } = this.$store.getters.level || {}
-      const {
-        variables: { data: deviceGroupData }
-      } = await this.$common.request('query', {
-        key: this.config ? 'gwzzzha' : 'getPositionList',
-        params: [second || first]
-      })
-      const {
-        variables: { data: gysData }
-      } = await this.$common.request('query', {
-        key: 'getSupplierList',
-        params: [second || first]
-      })
-      const exportData = JSON.parse(JSON.stringify(data))
-      for (let i = 0; i < exportData.length; i++) {
-        const item = exportData[i]
-        item.bianZhiBuMen = this.switchIdToDept(item.bianZhiBuMen.split(',')[0])
-        item.guanLiRen = this.switchIdToUserName(item.guanLiRen.split(',')[0])
-        // item.biXuDeHuanJin = this.switchIdToUserName(item.biXuDeHuanJin.split(',')[0])
-        item.weiHuFangShi = this.switchDeviceIdToName(
-          item.weiHuFangShi,
-          deviceGroupData
-        )
-        item.shiYongKeShi = this.switchGYSIdToName(item.shiYongKeShi, gysData)
-        if (this.stateList[item.sheBeiZhuangTa]) {
-          item.sheBeiZhuangTa = this.stateList[item.sheBeiZhuangTa]
-        }
-        if (this.typeList[item.sheBeiLeiXing]) {
-          item.sheBeiLeiXing = this.typeList[item.sheBeiLeiXing]
-        }
-      }
-      return exportData
-    },
-    // 岗位/分组id 转 岗位/分组名称
-    switchDeviceIdToName(val, deviceGroupList) {
-      const result = []
-      const valList = val?.split(',') || []
-      valList.forEach((item) =>
-        result.push(
-          deviceGroupList?.find((i) => i.positionId === item)?.positionName ||
-            ''
-        )
-      )
-      return result.join(',')
-    },
-    // 供应商id 转 供应商名称 检定/校准单位
-    switchGYSIdToName(val, gysList) {
-      const result =
-        gysList.find((item) => item.id_ === val)?.gong_ying_shang_m || ''
-      return result
-    },
-    // 部门id 转 部门名称
-    switchIdToDept(id) {
-      const { deptList } = this.$store.getters
-      const temp = deptList.find((item) => item.positionId === id)
-      return temp ? temp.positionName : ''
-    },
-    // 部门名称 转 部门id
-    switchDeptToId(dep) {
-      const { deptList } = this.$store.getters
-      const temp = deptList.find((item) => item.positionName === dep)
-      return temp ? temp.positionId : ''
-    },
-    // 人员id 转人员名称
-    switchIdToUserName(id) {
-      const { userList } = this.$store.getters
-      const temp = userList.find((item) => item.userId === id)
-      return temp ? temp.userName : ''
-    },
-    // 人员名称 转 人员id
-    switchUserNameToId(name) {
-      const { userList } = this.$store.getters
-      const temp = userList.find((item) => item.userName === name)
-      return temp ? temp.userId : ''
-    },
-    // 导出设备
-    async ExportDevice(selection, data = []) {
-      const exportData = await this.switchExportData(data)
-      this.xlsx(
-        exportData,
-        this.deviceColumns,
-        '设备档案卡基本数据' + this.getTimeStamp()
-      )
-      this.$message.success('导出设备成功!')
-    },
-    // 导出维护项目
-    async ExportProject(selection = []) {
-      let exportData = []
-      console.log('导出维护项目')
-      if (selection.length > 0) {
-        // const sql = `select b.yuan_she_bei_bian as yuanSheBeiBian,b.she_bei_ming_cheng_ as sheBeiMingCheng,a.parent_id_,a.wei_hu_xiang_mu_c as weiHuXiangMuC,a.wei_hu_ri_qi_ as weiHuRiQi,a.wei_hu_lei_xing_ as weiHuLeiXing,a.ri_qi_shu_zi_ as riQiShuZi from t_whzqjxm a,t_sbdj b where a.parent_id_=b.id_ and find_in_set(a.parent_id_, '${selection.join(',')}')`
-        const {
-          variables: { data }
-        } = await this.$common.request('query', {
-          key: 'getDeviceProject',
-          params: [selection.join(',')]
-        })
-        exportData = data
-        this.xlsx(
-          exportData,
-          this.projectColums,
-          '设备维护项目数据' + this.getTimeStamp()
-        )
-      } else {
-        const attachmentId = 'device_maintainProject'
-        const res = await download({ attachmentId })
-        // 判断 ArrayBuffer 的大小,主要用于兼容没有文件的情况
-        if (res.data?.byteLength === 0) {
-          this.xlsx(
-            [],
-            this.projectColums,
-            '设备维护项目模板' + this.getTimeStamp()
-          )
-        } else {
-          // const blob = new Blob([res.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
-          const a = document.createElement('a')
-          a.style.display = 'none'
-          // a.href = URL.createObjectURL(blob)
-          a.href = res.request.responseURL
-          // a.download = '设备维护项目导入模板'
-          document.body.appendChild(a)
-          a.click()
-          document.body.removeChild(a)
-        }
-      }
-      this.$message.success('导出维护项目成功!')
-    },
-    // value 转 key
-    switchV2K(value, obj) {
-      const key = Object.keys(obj).find((key) => obj[key] === value)
-      return key || ''
-    },
-    // 转换对象的key
-    switchDeviceObj(data, originalObj) {
-      const result = []
-      // data.forEach(item => {
-      //     const obj = {}
-      //     for (const key in item) {
-      //         obj[this.switchV2K(key, originalObj)] = item[key]
-      //     }
-      //     result.push(obj)
-      // })
-      data.forEach((item) => {
-        const obj = {}
-        for (const key in originalObj) {
-          // 对日期格式的数据做兼容处理
-          if (item[originalObj[key]] instanceof Date) {
-            obj[key] =
-              dayjs(item[originalObj[key]])
-                .add(8, 'hour')
-                .format('YYYY-MM-DD') || ''
-          } else {
-            obj[key] = String(item[originalObj[key]] || '')
-          }
-        }
-        result.push(obj)
-      })
-      return result
-    },
-    /* 读取文件 将文件转换为二进制 */
-    readFile(file) {
-      return new Promise((resolve) => {
-        const reader = new FileReader()
-        reader.readAsBinaryString(file)
-        reader.onload = (ev) => {
-          resolve(ev.target.result)
-        }
-      })
-    },
-    checkDeviceRequiredFieldsIfEmpty(list, requiredMap) {
-      const msgList = []
-      list.forEach((item, index) => {
-        const invalidFieldNames = []
-        Object.entries(requiredMap).forEach(([field, name]) => {
-          if (item.weiHuLeiXing === '按需保养' && field === 'weiHuRiQi') {
-            console.log('按需pass1')
-          } else {
-            if (!item[field]) {
-              invalidFieldNames.push(name)
-            }
-          }
-        })
-        if (invalidFieldNames.length > 0) {
-          msgList.push({ row: index + 2, field: invalidFieldNames })
-        }
-      })
-      return msgList
-    },
-    /**
-     * 专门发送提示
-     * @param {*} allResult
-     * @returns
-     */
-    sendWarningMessages(allResult, mark = 'range') {
-      if (allResult.length < 1) {
-        return
-      }
-      console.log(
-        '%c Msg Obj %c',
-        'background:#FF5733; padding: 1px; border-radius: 0 3px 3px 0; color: #fff;',
-        'background:transparent',
-        allResult
-      )
-      const item = allResult[0]
-      switch (mark) {
-        case 'required':
-          this.$message.warning(
-            `第${item.row}行,字段【${item.field.join(',')}】的值不能为空!`
-          )
-          break
-        case 'range':
-          this.$message.warning(
-            `第${item.row}行,字段【${item.field}】的值【${item.value}】不在限定范围内!`
-          )
-          break
-        case 'dateFormat':
-          this.$message.warning(
-            `第${item.row}行,字段【${item.field}】日期格式错误!格式支持【2024-01-01】、【2024/01/01】,请检查您的数据!`
-          )
-          break
-        case 'duplicateOriginalDevice':
-          this.$message.warning(`${item.field}!`)
-          break
-        default:
-          throw new Error(`${mark}类型未定义!`)
-      }
-    },
-    /**
-     * 根据规则校验字段的限定范围
-     * @param {*} list
-     */
-    checkFieldsRange(list, rules) {
-      const msgList = []
-      for (const ruleKey in rules) {
-        const rule = rules[ruleKey]
-        const fieldName = ruleKey
-        list.forEach((item, index) => {
-          const fieldValue = item[rule.field]
-          if (fieldValue && !rule.range.includes(fieldValue)) {
-            msgList.push({
-              row: index + 2,
-              field: fieldName,
-              value: fieldValue
-            })
-          }
-        })
-      }
-      return msgList
-    },
-    /**
-     * 校验日期字段填写的格式
-     * @param {*} list
-     * @returns
-     */
-    checkDateFields(list) {
-      const dateRegex = /^(\d{4})[-/](0[1-9]|1[0-2])[-/](0[1-9]|[12]\d|3[01])$/
-      for (let i = 0; i < list.length; i++) {
-        const row = list[i]
-        for (const field in this.dateFieldsMap) {
-          if (row[field] && !dateRegex.test(row[field])) {
-            console.error('error field:', row[field])
-            return [{ row: i + 2, field: this.dateFieldsMap[field] }]
-          }
-        }
-      }
-      return []
-    },
-    checkDuplicateOriginalDeviceNo(arr) {
-      const occurrences = {}
-      arr.forEach((item, index) => {
-        const key = item.yuanSheBeiBian
-        if (occurrences[key]) {
-          occurrences[key].push(index + 2)
-        } else {
-          occurrences[key] = [index + 2]
-        }
-      })
-      // 检查是否有重复项(数组长度大于1)
-      for (const [key, indices] of Object.entries(occurrences)) {
-        if (indices.length > 1) {
-          return [
-            {
-              field: `发现重复的原设备编号:${key} 在第 ${indices.join(
-                ', '
-              )} 行`
-            }
-          ]
-        }
-      }
-      return []
-    },
-    /**
-     * 负责导入设备数据的第一部分校验,全部成功则返回true
-     * @param {*} data
-     * @returns
-     */
-    deviceInvalidPartOne(data) {
-      // 校验必填信息
-      const invalidResult = this.checkDeviceRequiredFieldsIfEmpty(
-        data,
-        this.requiredFieldMap
-      )
-      if (invalidResult.length > 0) {
-        this.sendWarningMessages(invalidResult, 'required')
-        return false
-      }
-      // 根据规则校验字段的限定范围
-      const allResult = this.checkFieldsRange(data, this.validationRules)
-      if (allResult.length > 0) {
-        this.sendWarningMessages(allResult, 'range')
-        return false
-      }
-      // 校验日期字段是否符合要求
-      const dateResult = this.checkDateFields(data)
-      if (dateResult.length > 0) {
-        this.sendWarningMessages(dateResult, 'dateFormat')
-        return false
-      }
-      // 校验是否存在重复的原设备编号
-      const duplicateOriginalDeviceResult =
-        this.checkDuplicateOriginalDeviceNo(data)
-      if (duplicateOriginalDeviceResult.length > 0) {
-        this.sendWarningMessages(
-          duplicateOriginalDeviceResult,
-          'duplicateOriginalDevice'
-        )
-        return false
-      }
-      return true
-    },
-    /**
-     * 将日期字段信息格式化为 yyyy-MM-dd
-     * @param {*} list
-     * @returns
-     */
-    formatDateFieldsToReal(list) {
-      list.forEach((item) => {
-        this.dateFieldRange.forEach((field) => {
-          item[field] = item[field]?.replace(/\//g, '-')
-        })
-      })
-      return list
-    },
-    getNextAlias() {
-      return new Promise((resolve, reject) => {
-        this.$common
-          .getNextIdByAlias({
-            alias: 'sbbh'
-          })
-          .then((response) => {
-            resolve(response.data)
-          })
-          .catch((error) => {
-            reject(error)
-          })
-      })
-    },
-    /**
-     * 过滤出来excel 的原设备编号存在当前数据库中的数据
-     * @param {*} list 导入的数据
-     */
-    async filterOriginalDeviceNo(list, currentPosition) {
-      const uniqueArr = Array.from(
-        new Set(list.map((i) => i.yuanSheBeiBian.trim()))
-      )
-      // const sql = `select id_,yuan_she_bei_bian from t_sbdj where find_in_set(yuan_she_bei_bian,'${uniqueArr.join(',')}')and di_dian_ = '${currentPosition}'`
-      const res = await this.$common.request('query', {
-        key: 'getExistDeviceWithImport',
-        params: [uniqueArr.join(','), currentPosition]
-      })
-      const { data = [] } = res.variables || {}
-      const originalDeviceNoList = data.map((i) => i.yuan_she_bei_bian.trim())
-      // 给要更新的数据加上id (接口需要!!!)
-      data.forEach((item) => {
-        const temp = list.find(
-          (i) => i.yuanSheBeiBian === item.yuan_she_bei_bian
-        )
-        temp.id = item.id_
-      })
-      return originalDeviceNoList || ''
-    },
-    /**
-     *
-     * @param {*} list excel数据
-     * @param {*} currentTime 当前时间
-     * @param {*} currentApartment 当前部门ID
-     * @param {*} currentUser 当前用户ID
-     * @param {*} currentPosition 当前地点ID
-     */
-    async handleBasicData(
-      list,
-      currentTime,
-      currentApartment,
-      currentUser,
-      currentPosition,
-      deptList
-    ) {
-      // 使用map生成一个异步操作的数组
-      const promises = list.map(async (element) => {
-        element.bianZhiShiJian = currentTime
-        element.bianZhiRen = currentUser
-        element.diDian = currentPosition
-        element.shiFouGuoShen = '已完成'
-        const o = deptList?.find(
-          (i) => i.positionName === element.bianZhiBuMen.trim()
-        )
-        const { positionId = currentApartment } = o || {}
-        element.bianZhiBuMen = positionId
-        if (!element.id) {
-          // 获取下一个编号
-          element.sheBeiShiBieH = await this.getNextAlias()
-        }
-      })
-      // 使用Promise.all并发执行所有异步操作
-      await Promise.all(promises)
-    },
-
-    /**
-     *
-     * @param {*} list excel数据
-     * @param {*} positionList 现有房间信息
-     * @param {*} supplierList 现有供应商信息
-     * @param {*} employeeList 现有人员信息
-     * @returns
-     */
-    handleExcelData(
-      list,
-      positionList,
-      supplierList,
-      employeeList,
-      deviceGroupList
-    ) {
-      if (list.length < 1) {
-        return
-      }
-      this.handleSupplierInfo(list, supplierList)
-      this.handlePositionInfo(list, positionList)
-      this.handlePersonInfo(list, employeeList)
-      this.handleDeviceGroupInfo(list, deviceGroupList)
-    },
-    /**
-     *
-     * @param {*} list excel数据
-     * @param {*} supplierList 现有供应商信息
-     */
-    handleSupplierInfo(list, supplierList) {
-      list.forEach((element) => {
-        if (element.gongYingShang.trim()) {
-          const supplier = supplierList.find(
-            (i) => i.gong_ying_shang_m === element.gongYingShang.trim()
-          )
-          if (supplier) {
-            element.shiFouQiJianH = supplier.id_
-          } else {
-            element.shiFouQiJianH = ''
-            element.gongYingShang = ''
-          }
-        } else {
-          element.shiFouQiJianH = ''
-        }
-
-        if (element.shiYongKeShi.trim()) {
-          const supplier = supplierList.find(
-            (i) => i.gong_ying_shang_m === element.shiYongKeShi.trim()
-          )
-          if (supplier) {
-            element.shiYongKeShi = supplier.id_
-          } else {
-            element.shiYongKeShi = ''
-          }
-        } else {
-          element.shiYongKeShi = ''
-        }
-      })
-    },
-    /**
-     *
-     * @param {*} list excel数据
-     * @param {*} positionList 现有房间信息
-     */
-    handlePositionInfo(list, positionList) {
-      list.forEach((element) => {
-        if (element.cunFangDiDian !== '') {
-          const postion = positionList.find(
-            (i) =>
-              (i.fang_jian_ming_ha.trim() || '') ===
-              element.cunFangDiDian.trim()
-          )
-          if (postion) {
-            const positionId = postion.id_
-            element.cunFangWeiZhi = positionId
-          } else {
-            element.cunFangWeiZhi = ''
-            element.cunFangDiDian = ''
-          }
-        } else {
-          element.cunFangWeiZhi = ''
-        }
-      })
-    },
-    handlePersonInfo(list, employeeList) {
-      list.forEach((element) => {
-        // 处理保管人
-        if (element.guanLiRen !== '') {
-          const person = employeeList.find(
-            (i) => i.userName === element.guanLiRen.trim()
-          )
-          if (person) {
-            const personId = person.userId
-            element.guanLiRen = personId
-          } else {
-            element.guanLiRen = ''
-          }
-        } else {
-          element.guanLiRen = ''
-        }
-        // 处理核查人
-        // if (element.biXuDeHuanJin !== '') {
-        //     const checkPerson = employeeList.find(i => i.userName === element.biXuDeHuanJin.trim())
-        //     if (checkPerson) {
-        //         const checkPersonId = checkPerson.userId
-        //         element.biXuDeHuanJin = checkPersonId
-        //     } else {
-        //         element.biXuDeHuanJin = ''
-        //     }
-        // } else {
-        //     element.biXuDeHuanJin = ''
-        // }
-      })
-    },
-    handleDeviceGroupInfo(list, deviceGroupList) {
-      list.forEach((element) => {
-        const result = []
-        const { weiHuFangShi } = element
-        const valList = weiHuFangShi.trim()?.split(',')
-        valList.forEach((item) =>
-          result.push(
-            deviceGroupList?.find((i) => i.positionName === item)?.positionId ||
-              ''
-          )
-        )
-        element.weiHuFangShi = result.join(',')
-      })
-    },
-    async handleUploadChange1(file) {
-      const dataBinary = await this.readFile(file.target.files[0])
-      file.target.value = null // 注意上传后要将input的值设为空
-      const workBook = xlsx.read(dataBinary, {
-        type: 'binary',
-        cellDates: true
-      })
-      const workSheet = workBook.Sheets[workBook.SheetNames[0]]
-      const data = xlsx.utils.sheet_to_json(workSheet)
-      let importData = this.switchDeviceObj(data, {
-        ...this.deviceColumns,
-        t: '设备分组'
-      }) // 这个t用于兼容老版本的模板
-      importData.forEach((i) => {
-        delete i.sheBeiShiBieH // 设备编号需自动生成
-        // i.sheBeiZhuangTa = '合格'
-        const keyFound = Object.entries(this.stateList).find(
-          ([key, value]) => value === i.sheBeiZhuangTa
-        )
-        if (keyFound) {
-          i.sheBeiZhuangTa = keyFound[0]
-        }
-        const keyFound2 = Object.entries(this.typeList).find(
-          ([key, value]) => value === i.sheBeiLeiXing
-        )
-        if (keyFound2) {
-          i.sheBeiLeiXing = keyFound2[0]
-        }
-      })
-      const isNewVersion = importData.some((i) => i.weiHuFangShi) // 判断是否是最新模板
-      if (isNewVersion) {
-        // 使用岗位/分组
-        importData.forEach((i) => {
-          delete i.t
-        })
-      } else {
-        // 使用设备分组
-        importData.forEach((i) => {
-          i.weiHuFangShi = i.t
-          delete i.t
-        })
-      }
-      const currentPosition = this.level
-      const { userList = [], deptList = [] } = this.$store.getters || {}
-      // const positionSql = `select id_,fang_jian_ming_ha from t_jjqfjb where di_dian_ = ${currentPosition}` // 房间信息
-      // const supplierSql = `select id_,gong_ying_shang_m from t_gysxxb where di_dian_ = ${currentPosition}` // 供应商信息
-      // const deviceGroupSql = `select id_,suo_shu_bu_men_,wei_hu_gang_wei_ from t_sbwhgwpzb where di_dian_ =  ${currentPosition}` // 岗位/分组信息
-      const currentTime = dayjs().format('YYYY-MM-DD HH:mm')
-      const currentApartment =
-        this.$store.getters.userInfo.employee.positions.split(',').at(-1) || ''
-      const currentUser = this.userId
-
-      const partOneInvalidResult = this.deviceInvalidPartOne(importData)
-      if (!partOneInvalidResult) return
-
-      importData = this.formatDateFieldsToReal(importData)
-      console.log(
-        '%c partOne doCheck is completed! %c the result is %c',
-        'background:#35495E; padding: 1px; border-radius: 3px 0 0 3px; color: #fff;',
-        'background:#FF5733; padding: 1px; border-radius: 0 3px 3px 0; color: #fff;',
-        'background:transparent',
-        importData
-      )
-      this.loading = true
-      Promise.all([
-        this.$common.request('query', {
-          key: 'getRoomData',
-          params: [currentPosition]
-        }),
-        this.$common.request('query', {
-          key: 'getSupplierList',
-          params: [currentPosition]
-        }),
-        this.$common.request('query', {
-          key: this.config ? 'gwzzzha' : 'getPositionList',
-          params: [currentPosition]
-        })
-      ])
-        .then(async ([res1, res2, res3]) => {
-          const { data: positionList = [] } = res1.variables || {}
-          const { data: supplierList = [] } = res2.variables || {}
-          const { data: deviceGroupList = [] } = res3.variables || {}
-          // 根据原设备编号去重,检验原设备编号是否在数据库中存在
-          const originalDeviceNoList = await this.filterOriginalDeviceNo(
-            importData,
-            currentPosition
-          )
-          await this.handleBasicData(
-            importData,
-            currentTime,
-            currentApartment,
-            currentUser,
-            currentPosition,
-            deptList
-          )
-          this.handleExcelData(
-            importData,
-            positionList,
-            supplierList,
-            userList,
-            deviceGroupList
-          )
-          // 分离出 已存在的设备,和新设备
-          const newDeviceList = importData.filter(
-            (i) => !originalDeviceNoList.includes(i.yuanSheBeiBian.trim())
-          )
-          const existDeviceList = importData.filter((i) =>
-            originalDeviceNoList.includes(i.yuanSheBeiBian.trim())
-          )
-          console.log(
-            '%c new device %c',
-            'background:#FF5733; padding: 1px; border-radius: 0 3px 3px 0; color: #fff;',
-            'background:transparent',
-            newDeviceList
-          )
-          console.log(
-            '%c already exist device %c',
-            'background:#43f80c; padding: 1px; border-radius: 0 3px 3px 0; color: #fff;',
-            'background:transparent',
-            existDeviceList
-          )
-          this.loading = false
-          this.$confirm(
-            `<span style="color:#f56c6c; font-size: 18px; font-weight: 600;">
-                                        经系统判定</span><br>1.预期新导入设备的数量为 ${newDeviceList.length} 台!<br>
-                                        2.预期更新已存在的设备数量为 ${existDeviceList.length} 台!<br>
-                                        <span style="color:#f56c6c;">Tips:请确认数据无误再点击确定进行导入</span><br><span style="color:#f56c6c; font-size: 18px; font-weight: 600;">请谨慎操作!</span>`,
-            '提示',
-            {
-              confirmButtonText: '确定',
-              cancelButtonText: '取消',
-              dangerouslyUseHTMLString: true,
-              type: 'warning'
-            }
-          )
-            .then(async () => {
-              await this.doImportDevice(importData)
-              this.loading = true
-              setTimeout(() => {
-                this.loading = false
-                this.$message.success('设备数据导入成功!')
-                this.getDatas()
-              }, 1000)
-            })
-            .catch(() => {})
-        })
-        .catch(() => {
-          this.loading = false
-        })
-    },
-    async doImportDevice(existDeviceList, currentPosition) {
-      this.loading = true
-      const allRequests = []
-      for (let index = 0; index < existDeviceList.length; index++) {
-        const item = existDeviceList[index]
-        let params = {}
-        if (item.id) {
-          // 获取设备数据
-          const { data: itemData } = await getequipmentCard({ id: item.id })
-          params = { ...itemData, ...item } // 合并数据
-        } else {
-          params = item // 直接使用当前 item
-        }
-        console.log(params)
-        // 将每个 saveEquipmentCard 请求加入到 allRequests 数组中
-        allRequests.push(saveEquipmentCard(params))
-      }
-      // 等待所有异步请求完成
-      await Promise.all(allRequests)
-      this.loading = false
-    },
-    generateDayRule() {
-      const days = [
-        '每周1',
-        '每周2',
-        '每周3',
-        '每周4',
-        '每周5',
-        '每周6',
-        '每周7'
-      ]
-      let combinations = []
-      for (let length = 1; length <= days.length; length++) {
-        this.generateCombinations([], days, combinations)
-      }
-      combinations = combinations.map(
-        (comb) => '每周' + comb.map((item) => item.slice(2)).join(',')
-      )
-      combinations.push('每天')
-      return combinations
-    },
-    generateRule(num, prefix, suffix) {
-      return Array.from({ length: num }, (_, i) => prefix + `${i + 1}` + suffix)
-    },
-    generateCombinations(current, remaining, results) {
-      if (remaining.length === 0) {
-        results.push(current)
-        return
-      }
-      const first = remaining[0]
-      const rest = remaining.slice(1)
-      // 包括当前数字和不包括当前数字两种情况
-      this.generateCombinations(current.concat([first]), rest, results)
-      this.generateCombinations(current, rest, results)
-    },
-    /**
-     * 负责导入设备维护项目数据的第一部分校验,全部成功则返回true
-     * @param {*} data
-     * @returns
-     */
-    maintenanceInvalidPartOne(data) {
-      // 1、对数据进行清洗校验(设备编号不能为空,维护周期、维护项目亦不可为空)
-      const invalidResult = this.checkDeviceRequiredFieldsIfEmpty(
-        data,
-        this.maintenanceRequiredFieldMap
-      )
-      if (invalidResult.length > 0) {
-        this.sendWarningMessages(invalidResult, 'required')
-        return false
-      }
-      // 根据规则校验字段的限定范围
-      const allResult = this.checkFieldsRange(
-        data,
-        this.maintenanceValidationRules
-      )
-      if (allResult.length > 0) {
-        this.sendWarningMessages(allResult, 'range')
-        return false
-      }
-      // 根据规则校验维护周期对应的维护日期的限定范围
-      const result = this.checkMaintenanceDateRange(
-        data,
-        this.maintenanceDateValidationRules
-      )
-      if (result.length > 0) {
-        this.sendWarningMessages(result, 'range')
-        return false
-      }
-      return true
-    },
-    /**
-     * 根据规则校验维护周期对应的维护日期的限定范围
-     */
-    checkMaintenanceDateRange(list, rules) {
-      const msgList = []
-      list.forEach(({ weiHuLeiXing: type, weiHuRiQi: exactDate }, index) => {
-        if (type === '按需保养') {
-          console.log('按需pass2')
-        } else {
-          if (!rules[type].includes(exactDate)) {
-            msgList.push({
-              row: index + 2,
-              field: '维护日期',
-              value: exactDate
-            })
-          }
-        }
-      })
-      return msgList
-    },
-    async handleUploadChange2(file) {
-      const dataBinary = await this.readFile(file.target.files[0])
-      file.target.value = null // 注意上传后要将input的值设为空
-      const workBook = xlsx.read(dataBinary, {
-        type: 'binary',
-        cellDates: true
-      })
-      const workSheet = workBook.Sheets[workBook.SheetNames[0]]
-      const data = xlsx.utils.sheet_to_json(workSheet)
-      const importData = this.switchDeviceObj(data, this.projectColums)
-      console.log(importData)
-      importData.forEach((item) => {
-        if (item.weiHuLeiXing === '按需保养') {
-          item.weiHuRiQi = '/'
-        }
-        if (
-          item.weiHuLeiXing === '日保养' &&
-          item.weiHuRiQi === '每周1,2,3,4,5,6,7'
-        ) {
-          item.weiHuRiQi = '每天'
-        }
-      })
-      const currentPosition = this.level
-      const { userList = [], deptList = [] } = this.$store.getters || {}
-      const positionSql = `select id_,fang_jian_ming_ha from t_jjqfjb where di_dian_ = ${currentPosition}` // 房间信息
-      const supplierSql = `select id_,gong_ying_shang_m from t_gysxxb where di_dian_ = ${currentPosition}` // 供应商信息
-      const deviceGroupSql = `select id_,suo_shu_bu_men_,wei_hu_gang_wei_ from t_sbwhgwpzb where di_dian_ =  ${currentPosition}` // 岗位/分组信息
-      const currentTime = dayjs().format('YYYY-MM-DD HH:mm')
-      const currentApartment = this.$store.getters.userInfo.employee.positions
-      const currentUser = this.userId
-
-      const partOneInvalidResult = this.maintenanceInvalidPartOne(importData)
-      if (!partOneInvalidResult) return
-
-      // 2、根据原设备编号去重,检验原设备编号是否在数据库中存在,如有不存在的数据,不进行导入,并提示用户
-      const uniqueArr = Array.from(
-        new Set(importData.map((i) => i.yuanSheBeiBian.trim()))
-      )
-      /* 3、根据去重的设备编号去查对应的设备ID,然后拼接data数据,赋值设备ID*/
-      // const sql = `select id_,yuan_she_bei_bian from t_sbdj where find_in_set(yuan_she_bei_bian,'${uniqueArr.join(',')}')and di_dian_ = ${currentPosition}`
-      this.$common
-        .request('query', {
-          key: 'getExistDeviceWithImport',
-          params: [uniqueArr.join(','), currentPosition]
-        })
-        .then(async (res) => {
-          const deviceNoWithIdlist = res.variables.data
-          console.log(deviceNoWithIdlist, ' <=> ', uniqueArr)
-          const deviceNoSet = new Set(
-            deviceNoWithIdlist.map((i) => i.yuan_she_bei_bian)
-          )
-          const missStr =
-            uniqueArr.filter((i) => !deviceNoSet.has(i)).join(',') || ''
-          if (missStr !== '') {
-            this.$message.error(
-              `设备维护项目数据中包含不存在于设备档案的原设备编号!具体原设备编号为:${missStr}`
-            )
-            return
-          }
-          importData.forEach((item) => {
-            item.id = deviceNoWithIdlist.find(
-              (i) => i.yuan_she_bei_bian === item.yuanSheBeiBian
-            ).id_
-          })
-
-          const resultList = []
-          importData.forEach((item) => {
-            const flag = item.weiHuLeiXing === '日保养'
-            const match = item.weiHuRiQi?.match(/\d+/g)
-            const o = {
-              id: item.id,
-              weiHuLeiXing: item.weiHuLeiXing.trim(),
-              weiHuRiQi: item.weiHuRiQi?.trim() || '',
-              weiHuXiangMuC: item.weiHuXiangMuC.trim(),
-              riQiShuZi: match ? (flag ? match.join(',') : match[0]) : ''
-            }
-            if (o.weiHuLeiXing === '日保养' && o.weiHuRiQi === '每天')
-              o.riQiShuZi = '1,2,3,4,5,6,7'
-            resultList.push(o)
-          })
-          // 4、根据用户选择 进行全量替换|增量添加
-          await this.doProjectImport(
-            deviceNoWithIdlist,
-            resultList,
-            this.ImportDeviceType
-          )
-          this.$message.success(
-            '维护项目数据' + this.ImportDeviceType + '成功!'
-          )
-        })
-    },
-    async doProjectImport(deviceNoWithIdlist, resultList, type) {
-      this.loading = true
-      const allRequests = []
-      deviceNoWithIdlist.forEach(async (item) => {
-        const { data: itemData } = await getequipmentCard({ id: item.id_ })
-        const temp = resultList
-          .filter((i) => i.id === item.id_)
-          .map((ii) => {
-            delete ii.id
-            return ii
-          })
-        let params = {}
-        if (type === '增量添加') {
-          // 增量
-          params = {
-            ...itemData,
-            maintenanceItemPoList: [...itemData.maintenanceItemPoList, ...temp]
-          }
-        } else if (type === '全量替换') {
-          // 全量
-          params = {
-            ...itemData,
-            maintenanceItemPoList: temp
-          }
-        }
-        console.log('params', params)
-        allRequests.push(saveEquipmentCard(params))
-      })
-      await Promise.all(allRequests)
-      this.loading = false
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-.icon-image {
-  width: 36px;
-}
-.device-image {
-  width: 152px;
-  height: 110px;
-}
-.title {
-  font-size: 12px;
-  font-weight: 900;
-  color: #333;
-  margin: 0 0 14px 20px;
-}
-.ctx {
-  margin: 0 0 0 20px;
-  .item {
-    .cusitem {
-      margin: -8px 0;
-      display: flex;
-      align-items: center;
-    }
-    .span {
-      min-width: 60px;
-    }
-    margin: 6px 0;
-    color: #999;
-  }
-}
-::v-deep {
-  .el-form-item__label {
-    text-align: left;
-    font-size: 12px !important;
-  }
-  .el-form-item__ctx {
-    font-size: 12px !important;
-  }
-}
-</style>

+ 218 - 218
src/views/system/jbdHome/board/equipmentBoard.vue

@@ -174,7 +174,7 @@ export default {
       year: d.toJSON().slice(0, 4),
       month: d.toJSON().slice(0, 7),
       today: d.toJSON().slice(0, 10),
-      topBarData: [],
+      // topBarData: [],
       timer: null,
       MiddleLeftPieViewList: {},
       eBgRateData: {},
@@ -307,225 +307,225 @@ export default {
       this.getWeihuBarData()
       this.getZichanBarData()
     },
-    async getTopBarData() {
-      const didian = this.level
-      this.MiddleLeftPieViewList = {
-        data: [],
-        config: { idSelector: 'main' },
-        rowNum: 7,
-        color: []
-      }
-      this.sheBeiDataShow = false
-      this.eBgRateData = { data: [], config: {} }
-      this.sheBeiHeChaData = { data: [], config: {} }
-      this.jianDingjiaoZhunSheBeiData = { data: [], config: {} }
-      this.sheBeiData = { xData: [], data: [], config: { idSelector: '' } }
-      this.weiHuSheBeiData = { data: [], config: {} }
-      this.bottomData = { xData: [], data: [], config: { idSelector: '' } }
-      this.zhuantaiEData = { xData: [], data: [], config: { idSelector: '' } }
-      this.sheBeiweiHuData = {
-        xData: [],
-        data: [],
-        config: { idSelector: '' }
-      }
-      const year = this.month.slice(0, 4)
-      /* const sql =
-      `select a.Equipments,a1.mony,b.addEquipments,c.testEquipments,c1.testNoEquipments,e.goodEquipments,f.scrapEquipments,g.limitedEquipments,h.weiHuNoEquipments,h1.weiHuEquipments  FROM
-      (select COUNT(*) AS Equipments FROM t_sbdj where di_dian_ = '${didian}') AS a,
-      (select zi_chan_yuan_zhi_ AS mony FROM t_sbdj where  di_dian_ = '${didian}') AS a1,
-      (select COUNT(*) AS addEquipments  FROM t_yqsbysb WHERE bian_zhi_shi_jian LIKE concat('%', '${this.month}','%') AND shi_fou_guo_shen_ ='已完成' and  di_dian_ = '${didian}') AS b,
-      (select COUNT(*) AS testNoEquipments FROM t_jyxtxzjgyzhqrjlb WHERE bian_zhi_shi_jian LIKE concat('%', '${year}','%') or create_time_ LIKE concat('%', '${year}','%') and  di_dian_ = '${didian}') AS c1,
-      (select COUNT(*) AS testEquipments FROM t_jyxtxzjgyzhqrjlb WHERE bian_zhi_shi_jian LIKE concat('%', '${year}','%') and  shi_fou_guo_shen_ ='已完成' and  di_dian_ = '${didian}') AS c,
-      (select COUNT(*) AS goodEquipments  FROM t_sbdj WHERE she_bei_zhuang_ta ='合格' and  di_dian_ = '${didian}') AS e,
-      (select COUNT(*) AS scrapEquipments  FROM t_sbdj WHERE she_bei_zhuang_ta ='停用' OR she_bei_zhuang_ta ='暂停使用' and  di_dian_ = '${didian}') AS f,
-      (select COUNT(*) AS limitedEquipments  FROM t_sbdj WHERE she_bei_zhuang_ta ='报废' and  di_dian_ = '${didian}') AS g,
-      (select  COUNT(*) AS weiHuNoEquipments FROM t_mjsbwhbyjlby WHERE bian_zhi_shi_jian LIKE concat('%', '${this.month}','%') or create_time_ LIKE concat('%', '${this.month}','%') and  di_dian_ = '${didian}') AS h,
-      (select COUNT(*) AS weiHuEquipments  FROM t_mjsbwhbyjlby WHERE bian_zhi_shi_jian LIKE concat('%', '${this.month}','%') AND shi_fou_guo_shen_ ='已完成' and  di_dian_ = '${didian}') AS h1` */
-      await curdPost('query', {
-        key: 'devMgtBoard1',
-        params: [didian, this.month, year]
-      })
-        .then((res) => {
-          const data = res.variables.data
+    // async getTopBarData() {
+    //   const didian = this.level
+    //   this.MiddleLeftPieViewList = {
+    //     data: [],
+    //     config: { idSelector: 'main' },
+    //     rowNum: 7,
+    //     color: []
+    //   }
+    //   this.sheBeiDataShow = false
+    //   this.eBgRateData = { data: [], config: {} }
+    //   this.sheBeiHeChaData = { data: [], config: {} }
+    //   this.jianDingjiaoZhunSheBeiData = { data: [], config: {} }
+    //   this.sheBeiData = { xData: [], data: [], config: { idSelector: '' } }
+    //   this.weiHuSheBeiData = { data: [], config: {} }
+    //   this.bottomData = { xData: [], data: [], config: { idSelector: '' } }
+    //   this.zhuantaiEData = { xData: [], data: [], config: { idSelector: '' } }
+    //   this.sheBeiweiHuData = {
+    //     xData: [],
+    //     data: [],
+    //     config: { idSelector: '' }
+    //   }
+    //   const year = this.month.slice(0, 4)
+    //   /* const sql =
+    //   `select a.Equipments,a1.mony,b.addEquipments,c.testEquipments,c1.testNoEquipments,e.goodEquipments,f.scrapEquipments,g.limitedEquipments,h.weiHuNoEquipments,h1.weiHuEquipments  FROM
+    //   (select COUNT(*) AS Equipments FROM t_sbdj where di_dian_ = '${didian}') AS a,
+    //   (select zi_chan_yuan_zhi_ AS mony FROM t_sbdj where  di_dian_ = '${didian}') AS a1,
+    //   (select COUNT(*) AS addEquipments  FROM t_yqsbysb WHERE bian_zhi_shi_jian LIKE concat('%', '${this.month}','%') AND shi_fou_guo_shen_ ='已完成' and  di_dian_ = '${didian}') AS b,
+    //   (select COUNT(*) AS testNoEquipments FROM t_jyxtxzjgyzhqrjlb WHERE bian_zhi_shi_jian LIKE concat('%', '${year}','%') or create_time_ LIKE concat('%', '${year}','%') and  di_dian_ = '${didian}') AS c1,
+    //   (select COUNT(*) AS testEquipments FROM t_jyxtxzjgyzhqrjlb WHERE bian_zhi_shi_jian LIKE concat('%', '${year}','%') and  shi_fou_guo_shen_ ='已完成' and  di_dian_ = '${didian}') AS c,
+    //   (select COUNT(*) AS goodEquipments  FROM t_sbdj WHERE she_bei_zhuang_ta ='合格' and  di_dian_ = '${didian}') AS e,
+    //   (select COUNT(*) AS scrapEquipments  FROM t_sbdj WHERE she_bei_zhuang_ta ='停用' OR she_bei_zhuang_ta ='暂停使用' and  di_dian_ = '${didian}') AS f,
+    //   (select COUNT(*) AS limitedEquipments  FROM t_sbdj WHERE she_bei_zhuang_ta ='报废' and  di_dian_ = '${didian}') AS g,
+    //   (select  COUNT(*) AS weiHuNoEquipments FROM t_mjsbwhbyjlby WHERE bian_zhi_shi_jian LIKE concat('%', '${this.month}','%') or create_time_ LIKE concat('%', '${this.month}','%') and  di_dian_ = '${didian}') AS h,
+    //   (select COUNT(*) AS weiHuEquipments  FROM t_mjsbwhbyjlby WHERE bian_zhi_shi_jian LIKE concat('%', '${this.month}','%') AND shi_fou_guo_shen_ ='已完成' and  di_dian_ = '${didian}') AS h1` */
+    //   await curdPost('query', {
+    //     key: 'devMgtBoard1',
+    //     params: [didian, this.month, year]
+    //   })
+    //     .then((res) => {
+    //       const data = res.variables.data
 
-          let zichan = this.getAllMonyInt(data)
-          zichan = zichan + ''
-          if (zichan.length > 4) {
-            zichan = zichan.substring(0, zichan.length - 4)
-          }
+    //       let zichan = this.getAllMonyInt(data)
+    //       zichan = zichan + ''
+    //       if (zichan.length > 4) {
+    //         zichan = zichan.substring(0, zichan.length - 4)
+    //       }
 
-          const eIntactnessRate = Number(
-            (
-              (data[0].goodEquipments / data[0].Equipments).toFixed(2) * 100 +
-              ''
-            ).slice(0, 5)
-          )
-          const eBadRate = Number(
-            ((100 - eIntactnessRate).toFixed(4) + '').slice(0, 4)
-          )
-          let obj = {}
-          obj.value = Number(
-            (
-              (data[0].goodEquipments / data[0].Equipments).toFixed(4) * 100 +
-              ''
-            ).slice(0, 5)
-          )
-          obj.name = '正常设备数'
-          this.MiddleLeftPieViewList.data.push(obj)
-          obj = {}
-          obj.value = Number(
-            (
-              (data[0].scrapEquipments / data[0].Equipments).toFixed(4) * 100 +
-              ''
-            ).slice(0, 5)
-          )
-          obj.name = '停用/报废'
-          this.MiddleLeftPieViewList.data.push(obj)
-          this.MiddleLeftPieViewList.color = ['#339933', '#FFFF66', '#FF0033']
-          this.MiddleLeftPieViewList.config.title = '设备各工作状态数量统计'
-          this.MiddleLeftPieViewList.config.idSelector = 'main2'
-          obj = {}
-          const result = [
-            {
-              title: '',
-              children: [
-                {
-                  label: '设备总数',
-                  value: data[0].Equipments,
-                  danwei: ''
-                },
-                {
-                  label: '新增数',
-                  value: data[0].addEquipments,
-                  danwei: ''
-                },
-                {
-                  label: '正常数',
-                  value: data[0].goodEquipments,
-                  danwei: ''
-                },
-                {
-                  label: '报废/停用数',
-                  value: data[0].scrapEquipments,
-                  danwei: ''
-                }
-              ]
-            },
-            {
-              title: '',
-              children: [
-                {
-                  label: '计划维护数',
-                  value: data[0].weiHuNoEquipments,
-                  danwei: ''
-                },
-                {
-                  label: '已维护数',
-                  value: data[0].weiHuEquipments,
-                  danwei: ''
-                }
-              ]
-            },
-            {
-              title: '',
-              children: [
-                {
-                  label: '计划检定/校准数',
-                  value: data[0].testNoEquipments,
-                  danwei: ''
-                },
-                {
-                  label: '已检定/校准数',
-                  value: data[0].testEquipments,
-                  danwei: ''
-                }
-              ]
-            },
-            {
-              title: '',
-              children: [
-                {
-                  label: '完好率',
-                  value: eIntactnessRate,
-                  danwei: '%'
-                },
-                {
-                  label: '故障率',
-                  value: eBadRate,
-                  danwei: '%'
-                },
-                {
-                  label: zichan.length > 4 ? '总值(万元)' : '总值(元)',
-                  value: zichan,
-                  danwei: ''
-                }
-              ]
-            }
-          ]
-          // 设备数量统计
-          // this.sheBeiData.xData = ["设备总数","新增数","良好数","报废停用数",];
-          this.sheBeiData.xData = ['设备总数', '良好数']
-          this.sheBeiData.data.push(data[0].Equipments)
-          // this.sheBeiData.data.push(data[0].addEquipments);
-          this.sheBeiData.data.push(data[0].goodEquipments)
-          // this.sheBeiData.data.push(data[0].limitedEquipments);
-          // this.sheBeiData.data.push(data[0].scrapEquipments);
-          this.sheBeiData.config.title = '设备完好情况'
-          this.sheBeiData.config.idSelector = 'main8'
-          this.sheBeiDataShow = true
-          this.zhuantaiEData.xData = ['计划检定/校准数', '已完成检定/校准数']
-          this.zhuantaiEData.data.push(data[0].testNoEquipments)
-          this.zhuantaiEData.data.push(data[0].testEquipments)
-          this.zhuantaiEData.config.title = '检定/校准设备完成图'
-          this.zhuantaiEData.config.idSelector = 'main3'
-          // 维护设备数柱状图
-          this.sheBeiweiHuData.xData = ['计划维护数', '已完成数']
-          this.sheBeiweiHuData.data.push(data[0].weiHuNoEquipments)
-          this.sheBeiweiHuData.data.push(data[0].weiHuEquipments)
-          this.sheBeiweiHuData.config.title = '设备维护柱状图'
-          this.sheBeiweiHuData.config.idSelector = 'mainWeiHuZ'
-          let objRate = {}
-          objRate.name = '完好率'
-          objRate.value = eIntactnessRate
-          this.eBgRateData.data.push(objRate)
-          objRate = {}
-          objRate.value = eBadRate
-          objRate.name = '故障率'
-          this.eBgRateData.data.push(objRate)
-          this.eBgRateData.color = ['#339933', '#FF0033']
-          this.eBgRateData.config.title = '设备工作状态完成率'
-          this.eBgRateData.config.idSelector = 'main1'
-          // 设备数维护
-          let objweihu = {}
-          objweihu.name = '计划维护数'
-          objweihu.value = data[0].weiHuNoEquipments
-          this.weiHuSheBeiData.data.push(objweihu)
-          objweihu = {}
-          objweihu.value = data[0].weiHuEquipments
-          objweihu.name = '已维护数'
-          this.weiHuSheBeiData.data.push(objweihu)
-          this.weiHuSheBeiData.color = ['#5470c6', '#38a838']
-          this.weiHuSheBeiData.config.title = '设备维护完成情况'
-          this.weiHuSheBeiData.config.idSelector = 'mainWeiHu'
-          // 设备数检定校准
-          let objJianding = {}
-          objJianding.name = '计划检定/校准数'
-          objJianding.value = data[0].testNoEquipments
-          this.jianDingjiaoZhunSheBeiData.data.push(objJianding)
-          objJianding = {}
-          objJianding.value = data[0].testEquipments
-          objJianding.name = '已完成数'
-          this.jianDingjiaoZhunSheBeiData.data.push(objJianding)
-          this.jianDingjiaoZhunSheBeiData.color = ['#5470c6', '#38a838']
-          this.jianDingjiaoZhunSheBeiData.config.title = '设备检定/校准完成情况'
-          this.jianDingjiaoZhunSheBeiData.config.idSelector = 'mainJianDing'
-          objRate = {}
-          this.topBarData = result
-        })
-        .catch((err) => {
-          console.log(err)
-        })
-    },
+    //       const eIntactnessRate = Number(
+    //         (
+    //           (data[0].goodEquipments / data[0].Equipments).toFixed(2) * 100 +
+    //           ''
+    //         ).slice(0, 5)
+    //       )
+    //       const eBadRate = Number(
+    //         ((100 - eIntactnessRate).toFixed(4) + '').slice(0, 4)
+    //       )
+    //       let obj = {}
+    //       obj.value = Number(
+    //         (
+    //           (data[0].goodEquipments / data[0].Equipments).toFixed(4) * 100 +
+    //           ''
+    //         ).slice(0, 5)
+    //       )
+    //       obj.name = '正常设备数'
+    //       this.MiddleLeftPieViewList.data.push(obj)
+    //       obj = {}
+    //       obj.value = Number(
+    //         (
+    //           (data[0].scrapEquipments / data[0].Equipments).toFixed(4) * 100 +
+    //           ''
+    //         ).slice(0, 5)
+    //       )
+    //       obj.name = '停用/报废'
+    //       this.MiddleLeftPieViewList.data.push(obj)
+    //       this.MiddleLeftPieViewList.color = ['#339933', '#FFFF66', '#FF0033']
+    //       this.MiddleLeftPieViewList.config.title = '设备各工作状态数量统计'
+    //       this.MiddleLeftPieViewList.config.idSelector = 'main2'
+    //       obj = {}
+    //       const result = [
+    //         {
+    //           title: '',
+    //           children: [
+    //             {
+    //               label: '设备总数',
+    //               value: data[0].Equipments,
+    //               danwei: ''
+    //             },
+    //             {
+    //               label: '新增数',
+    //               value: data[0].addEquipments,
+    //               danwei: ''
+    //             },
+    //             {
+    //               label: '正常数',
+    //               value: data[0].goodEquipments,
+    //               danwei: ''
+    //             },
+    //             {
+    //               label: '报废/停用数',
+    //               value: data[0].scrapEquipments,
+    //               danwei: ''
+    //             }
+    //           ]
+    //         },
+    //         {
+    //           title: '',
+    //           children: [
+    //             {
+    //               label: '计划维护数',
+    //               value: data[0].weiHuNoEquipments,
+    //               danwei: ''
+    //             },
+    //             {
+    //               label: '已维护数',
+    //               value: data[0].weiHuEquipments,
+    //               danwei: ''
+    //             }
+    //           ]
+    //         },
+    //         {
+    //           title: '',
+    //           children: [
+    //             {
+    //               label: '计划检定/校准数',
+    //               value: data[0].testNoEquipments,
+    //               danwei: ''
+    //             },
+    //             {
+    //               label: '已检定/校准数',
+    //               value: data[0].testEquipments,
+    //               danwei: ''
+    //             }
+    //           ]
+    //         },
+    //         {
+    //           title: '',
+    //           children: [
+    //             {
+    //               label: '完好率',
+    //               value: eIntactnessRate,
+    //               danwei: '%'
+    //             },
+    //             {
+    //               label: '故障率',
+    //               value: eBadRate,
+    //               danwei: '%'
+    //             },
+    //             {
+    //               label: zichan.length > 4 ? '总值(万元)' : '总值(元)',
+    //               value: zichan,
+    //               danwei: ''
+    //             }
+    //           ]
+    //         }
+    //       ]
+    //       // 设备数量统计
+    //       // this.sheBeiData.xData = ["设备总数","新增数","良好数","报废停用数",];
+    //       this.sheBeiData.xData = ['设备总数', '良好数']
+    //       this.sheBeiData.data.push(data[0].Equipments)
+    //       // this.sheBeiData.data.push(data[0].addEquipments);
+    //       this.sheBeiData.data.push(data[0].goodEquipments)
+    //       // this.sheBeiData.data.push(data[0].limitedEquipments);
+    //       // this.sheBeiData.data.push(data[0].scrapEquipments);
+    //       this.sheBeiData.config.title = '设备完好情况'
+    //       this.sheBeiData.config.idSelector = 'main8'
+    //       this.sheBeiDataShow = true
+    //       this.zhuantaiEData.xData = ['计划检定/校准数', '已完成检定/校准数']
+    //       this.zhuantaiEData.data.push(data[0].testNoEquipments)
+    //       this.zhuantaiEData.data.push(data[0].testEquipments)
+    //       this.zhuantaiEData.config.title = '检定/校准设备完成图'
+    //       this.zhuantaiEData.config.idSelector = 'main3'
+    //       // 维护设备数柱状图
+    //       this.sheBeiweiHuData.xData = ['计划维护数', '已完成数']
+    //       this.sheBeiweiHuData.data.push(data[0].weiHuNoEquipments)
+    //       this.sheBeiweiHuData.data.push(data[0].weiHuEquipments)
+    //       this.sheBeiweiHuData.config.title = '设备维护柱状图'
+    //       this.sheBeiweiHuData.config.idSelector = 'mainWeiHuZ'
+    //       let objRate = {}
+    //       objRate.name = '完好率'
+    //       objRate.value = eIntactnessRate
+    //       this.eBgRateData.data.push(objRate)
+    //       objRate = {}
+    //       objRate.value = eBadRate
+    //       objRate.name = '故障率'
+    //       this.eBgRateData.data.push(objRate)
+    //       this.eBgRateData.color = ['#339933', '#FF0033']
+    //       this.eBgRateData.config.title = '设备工作状态完成率'
+    //       this.eBgRateData.config.idSelector = 'main1'
+    //       // 设备数维护
+    //       let objweihu = {}
+    //       objweihu.name = '计划维护数'
+    //       objweihu.value = data[0].weiHuNoEquipments
+    //       this.weiHuSheBeiData.data.push(objweihu)
+    //       objweihu = {}
+    //       objweihu.value = data[0].weiHuEquipments
+    //       objweihu.name = '已维护数'
+    //       this.weiHuSheBeiData.data.push(objweihu)
+    //       this.weiHuSheBeiData.color = ['#5470c6', '#38a838']
+    //       this.weiHuSheBeiData.config.title = '设备维护完成情况'
+    //       this.weiHuSheBeiData.config.idSelector = 'mainWeiHu'
+    //       // 设备数检定校准
+    //       let objJianding = {}
+    //       objJianding.name = '计划检定/校准数'
+    //       objJianding.value = data[0].testNoEquipments
+    //       this.jianDingjiaoZhunSheBeiData.data.push(objJianding)
+    //       objJianding = {}
+    //       objJianding.value = data[0].testEquipments
+    //       objJianding.name = '已完成数'
+    //       this.jianDingjiaoZhunSheBeiData.data.push(objJianding)
+    //       this.jianDingjiaoZhunSheBeiData.color = ['#5470c6', '#38a838']
+    //       this.jianDingjiaoZhunSheBeiData.config.title = '设备检定/校准完成情况'
+    //       this.jianDingjiaoZhunSheBeiData.config.idSelector = 'mainJianDing'
+    //       objRate = {}
+    //       this.topBarData = result
+    //     })
+    //     .catch((err) => {
+    //       console.log(err)
+    //     })
+    // },
     async getCarouselShiYonglvTable() {
       // 设备建档信息
       // const sql = `select a.she_bei_shi_bie_h,a.she_bei_ming_cheng_,a.cun_fang_di_dian_,a.she_bei_zhuang_ta,b.name_ FROM t_sbdj AS a JOIN ibps_party_employee AS b ON a.guan_li_ren_ = b.ID_ where a.di_dian_ = '${this.level}'`

+ 0 - 427
src/views/system/jbdScan/goods/deviceTag-hengsheng.vue

@@ -1,427 +0,0 @@
-<template>
-  <div class="bg">
-    <el-dialog
-      width="11cm"
-      height="10cm"
-      :modal-append-to-body="true"
-      :append-to-body="true"
-      title="设备标签"
-      :visible.sync="dialogVisible"
-      @close="close"
-    >
-      <!-- 表单是否显示 -->
-      <div style="height: 500px">
-        <div id="box" ref="qrcode">
-          <vue-easy-print ref="easyPrint" table-show :one-page-row="onePageRow">
-            <div v-for="(item, index) in list" :key="index">
-              <div class="All">
-                <div>
-                  <div class="one">
-                    <div class="container">
-                      <div
-                        :class="
-                          item.deviceStatus === '合格'
-                            ? 'triangle'
-                            : item.deviceStatus === '停用'
-                            ? 'triangleRed'
-                            : item.deviceStatus === '限用'
-                            ? 'triangleYellow'
-                            : 'triangleGray'
-                        "
-                      >
-                        <div class="label" style="border: 0">
-                          {{ item.prove }}
-                        </div>
-                      </div>
-                      <div style="position: absolute; top: 25px; width: 100%">
-                        <div
-                          style="
-                            display: flex;
-                            justify-content: space-between;
-                            font-size: 14px;
-                            font-weight: 800;
-                            margin: 0 8px;
-                          "
-                        >
-                          <div>{{ item.slogan }}</div>
-                        </div>
-                      </div>
-                    </div>
-                  </div>
-                  <div class="tagBox">
-                    <div
-                      v-for="(e, t) in midData.columns"
-                      v-if="
-                        (e.field == 'range' && item[e.field] !== '') ||
-                        e.field != 'range'
-                      "
-                      :key="'zi' + t"
-                      class="lh"
-                      :style="
-                        e.field == 'verificationDate'
-                          ? item['range'] !== ''
-                            ? 'border-bottom: 1px solid #000000;'
-                            : 'border-bottom: 0px;'
-                          : ''
-                      "
-                    >
-                      <div :class="e.field == 'name' ? 'qianZhi' : ''">
-                        {{ e.label }}:
-                      </div>
-                      <div>{{ item[e.field] }}</div>
-                    </div>
-                  </div>
-                </div>
-              </div>
-            </div>
-          </vue-easy-print>
-        </div>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="close">取 消</el-button>
-        <el-button type="primary" @click="printDemo">打印标签</el-button>
-      </span>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import VueBarcode from 'vue-barcode'
-import vueEasyPrint from 'vue-easy-print'
-
-export default {
-  components: {
-    VueBarcode,
-    vueEasyPrint
-  },
-  props: {
-    obj: {
-      default: () => [],
-      type: Array
-    },
-    onePageRow: {
-      type: Number,
-      default: 3
-    },
-    blankLines: {
-      type: Boolean,
-      default: true
-    },
-    scanVisible: {
-      type: Boolean,
-      default: false
-    },
-    stateList: {
-      type: Object,
-      default: function () {
-        return { 停用: '停用', 报废: '报废', 合格: '合格' }
-      }
-    },
-    tagData: {
-      type: Object,
-      default: () => {}
-    }
-  },
-  data() {
-    return {
-      dialogVisible: false,
-      value: '',
-      id: '',
-      list: [
-        {
-          name: '设备名称',
-          serial: '设备编号',
-          original: '原设备编号',
-          model: '型号规格',
-          verifier: '核查人',
-          verificationDate: '核查日期',
-          // status: 1
-          prove: '测试证', // 证名
-          slogan: '标语', // 标语
-          deviceStatus: '设备状态',
-          range: '限用范围', // 限用范围
-          assetNum: '固定资产号'
-        }
-      ],
-      visible: true,
-      midData: {}
-    }
-  },
-  watch: {
-    obj() {
-      this.getInit()
-    },
-    scanVisible: {
-      handler(val) {
-        this.dialogVisible = val
-      },
-      immediate: true
-    },
-    tagData: {
-      handler(val) {
-        if (this.tagData && this.tagData.hasOwnProperty('columns')) {
-          this.midData = val
-        } else {
-          this.midData = {
-            columns: [
-              { label: '设备名称', field: 'name' },
-              { label: '设备型号', field: 'model' },
-              { label: '原设备编号', field: 'original' },
-              { label: '固定资产号', field: 'assetNum' },
-              { label: '核查人', field: 'verifier' },
-              { label: '核查日期', field: 'verificationDate' },
-              { label: '限用范围', field: 'range' }
-            ],
-            width: 330
-          }
-        }
-      },
-      immediate: true
-    }
-  },
-  created() {
-    this.getInit()
-  },
-  methods: {
-    close() {
-      this.dialogVisible = false
-      this.$emit('scanOff')
-    },
-    printDemo() {
-      this.$refs.easyPrint.print()
-    },
-    getInit() {
-      var idStr = ''
-      this.obj.forEach((item) => {
-        idStr += item.split(' ')[0] + ','
-      })
-      idStr = idStr.substring(0, idStr.length - 1)
-      this.getLook(idStr)
-    },
-    getLook(id) {
-      // const sql = `select she_bei_ming_cheng_, she_bei_shi_bie_h, gui_ge_xing_hao_, she_bei_zhuang_ta, bi_xu_de_huan_jin, bi_xu_she_shi_, cai_gou_he_tong_, zi_chan_bian_hao_, yuan_she_bei_bian FROM t_sbdj WHERE find_in_set(id_, ${id})`
-      // const personSql = `select * from ibps_party_employee`
-      Promise.all([
-        this.$common.request('query', {
-          key: 'getDeviceInfoByIds',
-          params: [id]
-        }),
-        this.$common.request('query', {
-          key: 'getAllUser',
-          params: [null]
-        })
-      ]).then(([res1, res2]) => {
-        const { data } = res1.variables || []
-        const personData = res2.variables.data || []
-        console.log(data)
-        // console.log(personData)
-        const list = []
-        data.forEach((item) => {
-          const verificationDateStr = item.bi_xu_she_shi_
-            ? item.bi_xu_she_shi_
-            : ''
-          const o = {
-            prove: this.switchProve(item.she_bei_zhuang_ta),
-            slogan: this.switchSlogan(item.she_bei_zhuang_ta),
-            deviceStatus: item.she_bei_zhuang_ta,
-            range: this.judgementVal(item.cai_gou_he_tong_)
-              ? item.cai_gou_he_tong_
-              : '',
-            assetNum: item.zi_chan_bian_hao_,
-
-            name: item.she_bei_ming_cheng_,
-            serial: item.she_bei_shi_bie_h,
-            original: item.yuan_she_bei_bian,
-            model: item.gui_ge_xing_hao_,
-            verifier: this.findPersonName(item.bi_xu_de_huan_jin, personData),
-            verificationDate: verificationDateStr.substring(0, 10)
-          }
-          list.push(o)
-          console.log(o)
-        })
-        this.list = list
-      })
-    },
-    judgementVal(value) {
-      return value != null && value != undefined
-    },
-    switchProve(status) {
-      console.log('this.stateList===>', this.stateList, status)
-      return `${this.stateList[status] || '测试'}`
-    },
-    switchSlogan(status) {
-      switch (status) {
-        case '合格':
-          return 'PASS'
-        case '停用':
-          return 'STOP'
-        case '限用':
-          return 'RESTRICT'
-        case '报废':
-          return 'SCRAP'
-        default:
-          return 'TEST'
-      }
-    },
-    findPersonName(id, personData) {
-      if (!personData) {
-        return '核查人列表为空'
-      }
-      if (!id) {
-        return ''
-      }
-      const people = personData.find((i) => i.ID_ === id)
-      return people?.NAME_
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-.All {
-  text-align: center;
-  margin: 10px 0px;
-}
-
-.bg {
-  // height: auto;
-}
-
-.tagBox {
-  width: 400px; // 300  240 231
-  // height: 283px;  // 180  150  94
-  position: relative;
-  border: 1px solid #000000;
-  border-top: 0px;
-  //   padding: 2px;
-  display: inline-block;
-  // justify-content: space-around;
-  // flex-direction: column;
-  //   margin: 10px 5px;
-  //   border-radius: 4px;
-  background-color: #fff;
-}
-
-.ewm {
-  margin-left: 10px;
-}
-
-/*
-.tagBox {
-  width: 177.5px;   // 300  240
-  height: 106.5px;  // 180  150
-  position: relative;
-  border: 1px solid #000000;
-  padding: 20px;
-  display: flex;
-  justify-content: space-around;
-  flex-direction: column;
-  margin: 20px auto;
-  border-radius: 15px;
-  background-color: #fff;
-}
-*/
-.qianZhi {
-  white-space: nowrap;
-}
-
-.la {
-  font-size: 12px; //16
-  display: flex;
-  align-items: center;
-  padding: 1px;
-  width: 50%;
-}
-
-.zuoJuZhong {
-  text-align: left;
-}
-
-.lh {
-  display: flex;
-  align-items: center;
-  //   line-height: auto;
-  padding: 1px;
-  font-size: 16px; //16
-  display: flex;
-  align-items: center;
-  border-bottom: 1px solid #000000;
-}
-
-.container {
-  width: 400px;
-  height: 50px;
-  position: relative;
-  border: 1px solid #000000;
-}
-
-.triangle,
-.triangleYellow,
-.triangleRed,
-.triangleGray {
-  width: 0;
-  height: 0;
-  position: relative;
-  border-right: 200px solid transparent;
-  border-left: 200px solid transparent;
-  border-bottom: 200px solid transparent;
-  text-align: center;
-  //   float: left;
-}
-
-.triangle {
-  border-top: 50px solid #fff;
-}
-
-.triangleYellow {
-  border-top: 50px solid #fff;
-}
-
-.triangleRed {
-  border-top: 50px solid #fff;
-}
-.triangleGray {
-  border-top: 50px solid #fff;
-}
-.triangle > .label,
-.triangleYellow > .label,
-.triangleRed > .label,
-.triangleGray > .label {
-  width: 120px;
-  position: relative;
-  top: -45px;
-  left: 50%;
-  transform: translateX(-50%);
-  font-size: 24px;
-  font-weight: bold;
-  color: #000000;
-}
-
-.top-triangle {
-  border-left: 100px solid transparent;
-  border-right: 100px solid transparent;
-  top: 0;
-  left: 0;
-}
-
-.left-triangle {
-  /* border-top: 100px solid transparent; */
-  border-right: 100px solid black;
-  border-bottom: 50px solid rgb(217, 217, 233);
-  top: 0;
-  left: 0;
-}
-
-.right-triangle {
-  border-left: 100px solid black; //red
-  border-bottom: 50px solid rgb(217, 217, 233);
-  top: 0;
-  left: 100px;
-}
-
-.one {
-  justify-content: center;
-  align-items: center;
-  display: flex;
-}
-</style>

+ 12 - 12
src/views/system/jbdScan/goods/deviceTag.vue

@@ -20,11 +20,11 @@
                     <div class="container">
                       <div
                         :class="
-                          item.deviceStatus === '合格'
+                          item.deviceStatus === '正常使用'
                             ? 'triangle'
-                            : item.deviceStatus === '停用'
+                            : item.deviceStatus === '停止使用'
                             ? 'triangleRed'
-                            : item.deviceStatus === '用'
+                            : item.deviceStatus === '暂停使用'
                             ? 'triangleYellow'
                             : 'triangleGray'
                         "
@@ -114,7 +114,7 @@ export default {
     stateList: {
       type: Object,
       default: function () {
-        return { 停用: '停用', 报废: '报废', 合格: '合格' }
+        return { 正常使用: '正常使用', 暂停使用: '暂停使用', 停止使用: '停止使用' }
       }
     },
     tagData: {
@@ -250,14 +250,14 @@ export default {
     },
     switchSlogan(status) {
       switch (status) {
-        case '合格':
-          return 'PASS'
-        case '停用':
-          return 'STOP'
-        case '限用':
-          return 'RESTRICT'
-        case '报废':
-          return 'SCRAP'
+        case '正常使用':
+          return 'normal'
+        case '使用':
+          return 'paused'
+        // case '限用':
+        //   return 'RESTRICT'
+        case '停止使用':
+          return 'stopped'
         default:
           return 'TEST'
       }

+ 9 - 9
src/views/system/jbdScan/goods/deviceTagTemplateThree.vue

@@ -103,7 +103,7 @@ export default {
     stateList: {
       type: Object,
       default: function () {
-        return { 停用: '停用', 报废: '报废', 合格: '合格' }
+        return { 正常使用: '正常使用', 暂停使用: '暂停使用', 停止使用: '停止使用' }
       }
     },
     tagData: {
@@ -299,14 +299,14 @@ export default {
     },
     switchSlogan(status) {
       switch (status) {
-        case '合格':
-          return 'PASS'
-        case '停用':
-          return 'STOP'
-        case '限用':
-          return 'RESTRICT'
-        case '报废':
-          return 'SCRAP'
+        case '正常使用':
+          return 'normal'
+        case '使用':
+          return 'paused'
+        // case '限用':
+        //   return 'RESTRICT'
+        case '停止使用':
+          return 'stopped'
         default:
           return 'TEST'
       }

+ 9 - 9
src/views/system/jbdScan/goods/deviceTagTemplateTwo.vue

@@ -122,7 +122,7 @@ export default {
     stateList: {
       type: Object,
       default: function () {
-        return { 停用: '停用', 报废: '报废', 合格: '合格' }
+        return { 正常使用: '正常使用', 暂停使用: '暂停使用', 停止使用: '停止使用' }
       }
     },
     tagData: {
@@ -265,14 +265,14 @@ export default {
     },
     switchSlogan(status) {
       switch (status) {
-        case '合格':
-          return 'PASS'
-        case '停用':
-          return 'STOP'
-        case '限用':
-          return 'RESTRICT'
-        case '报废':
-          return 'SCRAP'
+        case '正常使用':
+          return 'normal'
+        case '使用':
+          return 'paused'
+        // case '限用':
+        //   return 'RESTRICT'
+        case '停止使用':
+          return 'stopped'
         default:
           return 'TEST'
       }

+ 0 - 556
src/views/system/jbdScan/goods/deviceTagWeiNing.vue

@@ -1,556 +0,0 @@
-<template>
-  <div class="bg">
-    <el-dialog
-      width="11cm"
-      height="10cm"
-      :modal-append-to-body="true"
-      :append-to-body="true"
-      title="设备标签"
-      :visible.sync="dialogVisible"
-      @close="close"
-    >
-      <!-- 表单是否显示 -->
-      <div style="height: 500px">
-        <div id="box" ref="qrcode">
-          <vue-easy-print ref="easyPrint" table-show :one-page-row="onePageRow">
-            <div v-for="(item, index) in list" :key="index">
-              <div class="All">
-                <div class="mid">
-                  <!-- <div class="one">
-                                        <div class="container">
-                                            <div
-                                                :class="item.deviceStatus === '合格' ? 'triangle' : item.deviceStatus === '停用' ? 'triangleRed' : item.deviceStatus === '限用' ? 'triangleYellow': 'triangleGray'"
-                                            >
-                                                <div class="label" style="border: 0;">{{ item.prove }}</div>
-                                            </div>
-                                            <div style="position: absolute;top: 25px;width: 100%;">
-                                                <div
-                                                    style="display: flex;justify-content: space-between;font-size: 14px;font-weight: 800;margin: 0 8px;"
-                                                >
-                                                    <div>{{ item.slogan }}</div>
-                                                </div>
-                                            </div>
-                                        </div>
-                                    </div> -->
-                  <div class="titleFont">威宁县人民医院检验科标识卡</div>
-                  <div
-                    class="borderLine"
-                    style="width: 330px; margin: 7px auto"
-                  />
-                  <div class="tagBox">
-                    <div class="midSty" style="margin: 5px 0">
-                      <div class="lh">
-                        <div style="width: 80px; text-align: left">
-                          仪器名称:
-                        </div>
-                        <div style="width: 80px" class="borderSty">
-                          {{ item.name || '/' }}
-                        </div>
-                      </div>
-                      <div class="lh marginLeft">
-                        <div style="width: 80px; text-align: left">
-                          设备编号:
-                        </div>
-                        <div
-                          style="width: 80px; text-align: left"
-                          class="borderSty"
-                        >
-                          {{ item.serial || '/' }}
-                        </div>
-                      </div>
-                    </div>
-
-                    <div class="midSty" style="margin: 5px 0">
-                      <div class="lh">
-                        <div style="width: 80px; text-align: left">型号:</div>
-                        <div
-                          style="width: 80px; text-align: left"
-                          class="borderSty"
-                        >
-                          {{ item.model || '/' }}
-                        </div>
-                      </div>
-                      <div class="lh marginLeft">
-                        <div style="width: 80px; text-align: left">
-                          责任人:
-                        </div>
-                        <div
-                          style="width: 80px; text-align: left"
-                          class="borderSty"
-                        >
-                          {{ item.personInCharge || '/' }}
-                        </div>
-                      </div>
-                    </div>
-                    <div class="midSty" style="margin: 5px 0">
-                      <div class="lh">
-                        <div style="width: 80px; text-align: left">
-                          设备分组:
-                        </div>
-                        <div
-                          style="width: 80px; text-align: left"
-                          class="borderSty"
-                        >
-                          {{ item.deviceGrouping || '/' }}
-                        </div>
-                      </div>
-                      <div class="lh marginLeft">
-                        <div style="width: 80px; text-align: left">
-                          放置地点:
-                        </div>
-                        <div
-                          style="width: 80px; text-align: left"
-                          class="borderSty"
-                        >
-                          {{ item.placeOfPlacement || '/' }}
-                        </div>
-                      </div>
-                    </div>
-                    <div class="midSty" style="margin: 5px 0">
-                      <div class="lh">
-                        <div style="width: 80px; text-align: left">
-                          校准日期:
-                        </div>
-                        <div
-                          style="width: 80px; text-align: left"
-                          class="borderSty"
-                        >
-                          {{ item.calibrationDate || '/' }}
-                        </div>
-                      </div>
-                      <div class="lh marginLeft">
-                        <div style="width: 80px; text-align: left">
-                          下次校准时间:
-                        </div>
-                        <div
-                          style="width: 80px; text-align: left"
-                          class="borderSty"
-                        >
-                          {{ item.nextCalibrationDate || '/' }}
-                        </div>
-                      </div>
-                    </div>
-                    <div class="midSty" style="margin: 5px 0">
-                      <div class="lh">
-                        <div style="width: 80px; text-align: left">
-                          启用日期:
-                        </div>
-                        <div
-                          style="width: 80px; text-align: left"
-                          class="borderSty"
-                        >
-                          {{ item.commissioningDate || '/' }}
-                        </div>
-                      </div>
-                      <div class="lh marginLeft">
-                        <div style="width: 80px; text-align: left">
-                          设备状态:
-                        </div>
-                        <div
-                          style="width: 80px; text-align: left"
-                          class="borderSty"
-                        >
-                          <span
-                            :style="{
-                              'background-color':
-                                item.deviceStatus === '合格'
-                                  ? '#008000'
-                                  : item.deviceStatus === '停用'
-                                    ? '#ff0000'
-                                    : item.deviceStatus === '限用'
-                                      ? '#ffff00'
-                                      : '#909399',
-                              color: '#fff',
-                              padding: '0px 3px',
-                              'border-radius': '2px'
-                            }"
-                            >{{ item.deviceStatus }}</span
-                          >
-                        </div>
-                      </div>
-                    </div>
-                    <!-- <div class="lh">
-                                            <div>固定资产号:</div>
-                                            <div>{{ item.assetNum }}</div>
-                                        </div>
-                                        <div class="lh">
-                                            <div>核查人:</div>
-                                            <div>{{ item.verifier }}</div>
-                                        </div>
-                                        <div class="lh" :style="item.range !== '' ? 'border-bottom: 1px solid #000000;' : 'border-bottom: 0px;'">
-                                            <div>核查日期:</div>
-                                            <div>{{ item.verificationDate }}</div>
-                                        </div> -->
-                    <!-- <div class="lh">
-                                            <div class="la">
-                                                <div>核查人:</div>
-                                                <div>{{ item.verifier }}</div>
-                                            </div>
-                                            <div class="la" style="border-left: 1px solid #000000;">
-                                                <div>核查日期:</div>
-                                                <div>{{ item.verificationDate }}</div>
-                                            </div>
-                                        </div> -->
-                    <div
-                      v-if="item.range !== ''"
-                      class="lh"
-                      style="border-bottom: 0px"
-                    >
-                      <div class="qianZhi">限用范围:</div>
-                      <div class="zuoJuZhong">{{ item.range }}</div>
-                    </div>
-                  </div>
-                </div>
-              </div>
-            </div>
-          </vue-easy-print>
-        </div>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="close">取 消</el-button>
-        <el-button type="primary" @click="printDemo">打印标签</el-button>
-      </span>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import VueBarcode from 'vue-barcode'
-import vueEasyPrint from 'vue-easy-print'
-
-export default {
-  components: {
-    VueBarcode,
-    vueEasyPrint
-  },
-  props: {
-    obj: {
-      default: () => [],
-      type: Array
-    },
-    onePageRow: {
-      type: Number,
-      default: 3
-    },
-    blankLines: {
-      type: Boolean,
-      default: true
-    },
-    scanVisible: {
-      type: Boolean,
-      default: false
-    },
-    stateList: {
-      type: Object,
-      default: function () {
-        return { 停用: '停用', 报废: '报废', 合格: '合格' }
-      }
-    }
-  },
-  data() {
-    const { userList = [] } = this.$store.getters || {}
-    return {
-      userList: userList,
-      dialogVisible: false,
-      value: '',
-      id: '',
-      list: [
-        {
-          name: '设备名称',
-          serial: '设备编号',
-          model: '型号规格',
-          verifier: '核查人',
-          verificationDate: '核查日期',
-          // status: 1
-          prove: '测试证', // 证名
-          slogan: '标语', // 标语
-          deviceStatus: '设备状态',
-          range: '限用范围', // 限用范围
-          assetNum: '固定资产号',
-          deviceGrouping: '设备分组',
-          placeOfPlacement: '放置地点',
-          calibrationDate: '校准日期',
-          nextCalibrationDate: '下次校准日期',
-          commissioningDate: '启用日期',
-          personInCharge: '责任人'
-        }
-      ],
-      visible: true
-    }
-  },
-  watch: {
-    obj() {
-      this.getInit()
-    },
-    scanVisible: {
-      handler(val) {
-        this.dialogVisible = val
-      },
-      immediate: true
-    }
-  },
-  created() {
-    this.getInit()
-  },
-  methods: {
-    close() {
-      this.dialogVisible = false
-      this.$emit('scanOff')
-    },
-    printDemo() {
-      this.$refs.easyPrint.print()
-    },
-    getInit() {
-      var idStr = ''
-      this.obj.forEach((item) => {
-        idStr += item.split(' ')[0] + ','
-      })
-      idStr = idStr.substring(0, idStr.length - 1)
-      this.getLook(idStr)
-    },
-    getLook(id) {
-      // const sql = `select * FROM t_sbdj WHERE find_in_set(id_, '${id}' )`
-      // const posSql = `select * from t_sbwhgwpzb`
-      // const roomSql = `select * from t_jjqfjb`
-      const { first, second } = this.$store.getters.level || {}
-      Promise.all([
-        this.$common.request('query', {
-          key: 'rygwsqbb',
-          params: [id]
-        }),
-        this.$common.request('query', {
-          key: 'getPositionList',
-          params: [second || first]
-        }),
-        this.$common.request('query', {
-          key: 'getRoomData',
-          params: [second || first]
-        })
-      ]).then(([res1, res2, res3]) => {
-        const { data } = res1.variables || []
-        const posData = res2.variables.data || []
-        const roomData = res3.variables.data || []
-        const list = []
-        data.forEach((item) => {
-          const midPos = item.wei_hu_fang_shi_
-            ? posData.find((t) => t.positionId === item.wei_hu_fang_shi_)
-                .positionName
-            : ''
-          const midRoom = item.cun_fang_wei_zhi_
-            ? roomData.find((t) => t.id_ === item.cun_fang_wei_zhi_)
-                .fang_jian_ming_ha
-            : ''
-          const midPer = item.guan_li_ren_
-            ? this.userList.find((t) => t.userId === item.guan_li_ren_).userName
-            : ''
-
-          const verificationDateStr = item.bi_xu_she_shi_
-            ? item.bi_xu_she_shi_
-            : ''
-          const o = {
-            prove: this.switchProve(item.she_bei_zhuang_ta),
-            slogan: this.switchSlogan(item.she_bei_zhuang_ta),
-            deviceStatus: item.she_bei_zhuang_ta,
-            range: this.judgementVal(item.cai_gou_he_tong_)
-              ? item.cai_gou_he_tong_
-              : '',
-            assetNum: item.zi_chan_bian_hao_,
-
-            name: item.she_bei_ming_cheng_,
-            serial: item.she_bei_shi_bie_h,
-            model: item.gui_ge_xing_hao_,
-            verifier: this.findPersonName(item.bi_xu_de_huan_jin),
-            verificationDate: verificationDateStr.substring(0, 10),
-            deviceGrouping: midPos,
-            placeOfPlacement: midRoom,
-            calibrationDate: item.yi_xiao_ri_qi_,
-            nextCalibrationDate: item.xiao_zhun_you_xia,
-            commissioningDate: item.qi_yong_ri_qi_,
-            personInCharge: midPer
-          }
-          list.push(o)
-          console.log(o)
-        })
-        this.list = list
-      })
-    },
-    judgementVal(value) {
-      return value != null && value != undefined
-    },
-    switchProve(status) {
-      return `${this.stateList[status] || '测试'}证`
-    },
-    switchSlogan(status) {
-      switch (status) {
-        case '合格':
-          return 'PASS'
-        case '停用':
-          return 'STOP'
-        case '限用':
-          return 'RESTRICT'
-        case '报废':
-          return 'SCRAP'
-        default:
-          return 'TEST'
-      }
-    },
-    findPersonName(id) {
-      if (!id || !this.userList) {
-        return ''
-      }
-      return this.userList.find((i) => i.userId === id).userName
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-.All {
-  text-align: center;
-  margin: 10px 0px;
-}
-// .mid{
-//     display: flex;
-//     justify-content: center;
-//     flex-wrap: wrap;
-// }
-.bg {
-  // height: auto;
-}
-
-.tagBox {
-  width: 330px; // 300  240 231
-  position: relative;
-  // border: 1px solid #000000;
-  border-top: 0px;
-  display: inline-block;
-  background-color: #fff;
-}
-.midSty {
-  display: flex;
-  justify-items: center;
-  align-items: center;
-}
-.ewm {
-  margin-left: 10px;
-}
-.qianZhi {
-  white-space: nowrap;
-}
-
-.la {
-  font-size: 12px; //16
-  display: flex;
-  align-items: center;
-  padding: 1px;
-  width: 50%;
-}
-
-.zuoJuZhong {
-  text-align: left;
-}
-.titleFont {
-  font-size: 16px;
-  font-weight: 600;
-  letter-spacing: 1px;
-}
-.borderLine {
-  height: 1px;
-  border-top: 2px solid #000;
-  border-bottom: 1px solid #000;
-}
-.lh {
-  display: flex;
-  align-items: center;
-  padding: 1px;
-  font-size: 12px; //16
-  display: flex;
-  align-items: center;
-  // border-bottom: 1px solid #000000;
-  .borderSty {
-    border-bottom: 1px solid #000;
-    text-align: left;
-  }
-  div {
-    width: 60px;
-  }
-}
-.marginLeft {
-  margin-left: 10px;
-}
-
-.container {
-  width: 330px;
-  height: 50px;
-  position: relative;
-  border: 1px solid #000000;
-}
-
-.triangle,
-.triangleYellow,
-.triangleRed,
-.triangleGray {
-  width: 0;
-  height: 0;
-  position: relative;
-  border-right: 125px solid transparent;
-  border-left: 125px solid transparent;
-  border-bottom: 125px solid transparent;
-  text-align: center;
-}
-
-.triangle {
-  border-top: 50px solid #008000;
-}
-
-.triangleYellow {
-  border-top: 50px solid #ffff00;
-}
-
-.triangleRed {
-  border-top: 50px solid #ff0000;
-}
-.triangleGray {
-  border-top: 50px solid #909399;
-}
-.triangle > .label,
-.triangleYellow > .label,
-.triangleRed > .label,
-.triangleGray > .label {
-  width: 100px;
-  position: relative;
-  top: -45px;
-  left: -50px;
-  font-size: 20px;
-  font-weight: bold;
-  color: #000000;
-}
-
-.top-triangle {
-  border-left: 100px solid transparent;
-  border-right: 100px solid transparent;
-  top: 0;
-  left: 0;
-}
-
-.left-triangle {
-  /* border-top: 100px solid transparent; */
-  border-right: 100px solid black;
-  border-bottom: 50px solid rgb(217, 217, 233);
-  top: 0;
-  left: 0;
-}
-
-.right-triangle {
-  border-left: 100px solid black; //red
-  border-bottom: 50px solid rgb(217, 217, 233);
-  top: 0;
-  left: 100px;
-}
-
-.one {
-  justify-content: center;
-  align-items: center;
-  display: flex;
-}
-</style>

+ 0 - 413
src/views/system/jbdScan/goods/deviceVerificationTag-hengsheng.vue

@@ -1,413 +0,0 @@
-<template>
-  <div class="bg">
-    <el-dialog
-      width="11cm"
-      height="10cm"
-      :modal-append-to-body="true"
-      :append-to-body="true"
-      title="设备检定校准标签"
-      :visible.sync="scanVisible"
-    >
-      <!-- 表单是否显示 -->
-      <div style="height: 500px">
-        <div id="box" ref="qrcode">
-          <vue-easy-print ref="easyPrint" table-show :one-page-row="onePageRow">
-            <div v-for="(item, index1) in list" :key="index1">
-              <!-- style="page-break-after:always" -->
-              <div class="All">
-                <div>
-                  <div class="one">
-                    <div class="container">
-                      <div
-                        :class="
-                          item.deviceStatus === '合格'
-                            ? 'triangle'
-                            : item.deviceStatus === '停用'
-                            ? 'triangleRed'
-                            : 'triangleYellow'
-                        "
-                      >
-                        <div class="label" style="border: 0">
-                          {{ item.prove }}
-                        </div>
-                      </div>
-                      <div style="position: absolute; top: 25px; width: 100%">
-                        <div
-                          style="
-                            display: flex;
-                            justify-content: space-between;
-                            font-size: 14px;
-                            font-weight: 800;
-                            margin: 0 8px;
-                          "
-                        >
-                          <div>{{ item.slogan }}</div>
-                        </div>
-                      </div>
-                    </div>
-                  </div>
-                  <div class="tagBox">
-                    <div class="lh">
-                      <div class="qianZhi">设备名称:</div>
-                      <div>{{ item.name }}</div>
-                    </div>
-                    <div v-if="modelTF" class="lh">
-                      <div>设备型号:</div>
-                      <div>{{ item.model }}</div>
-                    </div>
-                    <div class="lh">
-                      <div>原设备编号:</div>
-                      <div>{{ item.original }}</div>
-                    </div>
-
-                    <div class="lh">
-                      <div class="la">
-                        <div>校准日期:</div>
-                        <div>{{ item.jiaoZhunTime }}</div>
-                      </div>
-                      <div class="la" style="border-left: 1px solid #000000">
-                        <div>有效期至:</div>
-                        <div>{{ item.validTo }}</div>
-                      </div>
-                    </div>
-                    <div
-                      class="lh"
-                      :style="
-                        item.range !== ''
-                          ? 'border-bottom: 1px solid #000000;'
-                          : 'border-bottom: 0px;'
-                      "
-                    >
-                      <div class="qianZhi">校准单位:</div>
-                      <div class="zuoJuZhong">{{ item.unit }}</div>
-                    </div>
-                    <!-- <div class="lh" style="border-bottom: 0px;" v-if="item.range !== ''">
-                                            <div class="qianZhi">限用范围:</div>
-                                            <div class="zuoJuZhong">{{ item.range }}</div>
-                                        </div> -->
-                  </div>
-                </div>
-              </div>
-            </div>
-          </vue-easy-print>
-        </div>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="scanVisible = false">取 消</el-button>
-        <el-button type="primary" @click="printDemo">打印标签</el-button>
-      </span>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import VueBarcode from 'vue-barcode'
-import vueEasyPrint from 'vue-easy-print'
-import { getSetting } from '@/utils/query'
-
-export default {
-  components: {
-    VueBarcode,
-    vueEasyPrint
-  },
-  props: {
-    obj: {
-      default: () => [],
-      type: Array
-    },
-    onePageRow: {
-      type: Number,
-      default: 3
-    },
-    blankLines: {
-      type: Boolean,
-      default: true
-    },
-    scanVisible: {
-      type: Boolean,
-      default: false
-    }
-  },
-  data() {
-    return {
-      value: '',
-      id: '',
-      list: [
-        {
-          name: 1,
-          serial: 1,
-          original: 1,
-          validTo: 1,
-          model: 1,
-          unit: 1,
-          jiaoZhunTime: 1,
-          // status: 1
-          prove: 1, // 证名
-          slogan: 1, // 标语
-          deviceStatus: 1,
-          range: 1 // 限用范围
-        }
-      ],
-      visible: true,
-      orgTF: false,
-      modelTF: true
-    }
-  },
-  watch: {
-    obj() {
-      this.getInit()
-      // console.log(this.obj)
-    }
-  },
-  created() {
-    this.getInit()
-  },
-  methods: {
-    printDemo() {
-      this.$refs.easyPrint.print()
-    },
-    async getInit() {
-      var idStr = ''
-      this.obj.forEach((item) => {
-        idStr += item.split(' ')[0] + ','
-      })
-      idStr = idStr.substring(0, idStr.length - 1)
-      this.getLook(idStr)
-      const { tagData } = (await getSetting('verificationTag')) || {}
-      this.orgTF =
-        tagData && tagData.hasOwnProperty('originalDevice')
-          ? tagData.originalDevice
-          : false
-      this.modelTF =
-        tagData && tagData.hasOwnProperty('originalDevice')
-          ? tagData.modelNumber
-          : true
-    },
-    getLook(id) {
-      // const sql = `select dj.she_bei_ming_cheng_, dj.she_bei_shi_bie_h, dj.gui_ge_xing_hao_, dj.she_bei_zhuang_ta, dj.cai_gou_he_tong_, dj.yuan_she_bei_bian, zx.shi_shi_ri_qi_, zx.chu_chang_bian_ha, zx.jian_ding_dan_wei FROM t_sbdj dj RIGHT JOIN t_mjsbjdxzjhzb zx ON zx.bian_hao_zhong_we = dj.she_bei_shi_bie_h WHERE find_in_set(zx.id_, '${id}')`
-      this.$common
-        .request('query', {
-          key: 'deviceVerificationTag',
-          params: [id]
-        })
-        .then((res) => {
-          const { data } = res.variables || []
-          // console.log(data)
-          const list = []
-          data.forEach((item) => {
-            const o = {
-              prove: this.switchProve(item.she_bei_zhuang_ta),
-              slogan: this.switchSlogan(item.she_bei_zhuang_ta),
-              deviceStatus: item.she_bei_zhuang_ta,
-              range: this.judgementVal(item.cai_gou_he_tong_)
-                ? item.cai_gou_he_tong_
-                : '',
-
-              name: item.she_bei_ming_cheng_,
-              serial: item.she_bei_shi_bie_h,
-              original: item.yuan_she_bei_bian,
-              validTo: item.chu_chang_bian_ha,
-              model: item.gui_ge_xing_hao_,
-              unit: item.jian_ding_dan_wei,
-              jiaoZhunTime: item.shi_shi_ri_qi_
-            }
-            list.push(o)
-          })
-
-          this.list = list
-        })
-    },
-    judgementVal(value) {
-      return value != null && value != undefined
-    },
-    switchProve(status) {
-      switch (status) {
-        case '合格':
-          return '合格'
-        case '停用':
-          return '停用'
-        case '限用':
-          return '限用'
-        case '报废':
-          return '报废'
-        default:
-          return '测试'
-      }
-    },
-    switchSlogan(status) {
-      switch (status) {
-        case '合格':
-          return 'PASS'
-        case '停用':
-          return 'STOP'
-        case '限用':
-          return 'RESTRICT'
-        default:
-          return 'TEST'
-      }
-    },
-    getTime(second) {
-      const date = new Date(second)
-      const year = date.getFullYear()
-      let month = ''
-      let day = ''
-      if (date.getMonth() + 1 <= 9) {
-        month = '0' + (date.getMonth() + 1)
-      } else {
-        month = date.getMonth() + 1
-      }
-      if (date.getDate() <= 9) {
-        day = '0' + date.getDate()
-      } else {
-        day = date.getDate()
-      }
-      return year + '-' + month + '-' + day
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-.All {
-  text-align: center;
-  margin: 10px 0px;
-}
-
-.bg {
-  // height: auto;
-}
-
-.tagBox {
-  width: 400px; // 300  240 231
-  // height: 283px;  // 180  150  94
-  position: relative;
-  border: 1px solid #000000;
-  border-top: 0px;
-  //   padding: 2px;
-  display: inline-block;
-  // justify-content: space-around;
-  // flex-direction: column;
-  //   margin: 10px 5px;
-  //   border-radius: 4px;
-  background-color: #fff;
-}
-
-.ewm {
-  margin-left: 10px;
-}
-
-/*
-.tagBox {
-  width: 177.5px;   // 300  240
-  height: 106.5px;  // 180  150
-  position: relative;
-  border: 1px solid #000000;
-  padding: 20px;
-  display: flex;
-  justify-content: space-around;
-  flex-direction: column;
-  margin: 20px auto;
-  border-radius: 15px;
-  background-color: #fff;
-}
-*/
-.qianZhi {
-  white-space: nowrap;
-}
-
-.la {
-  font-size: 16px; //16
-  display: flex;
-  align-items: center;
-  padding: 1px;
-  width: 50%;
-}
-
-.zuoJuZhong {
-  text-align: left;
-}
-
-.lh {
-  display: flex;
-  align-items: center;
-  //   line-height: auto;
-  padding: 1px;
-  font-size: 16px; //16
-  display: flex;
-  align-items: center;
-  border-bottom: 1px solid #000000;
-}
-
-.container {
-  width: 400px;
-  height: 50px;
-  position: relative;
-  border: 1px solid #000000;
-}
-
-.triangle,
-.triangleYellow,
-.triangleRed {
-  width: 0;
-  height: 0;
-  position: relative;
-  border-right: 200px solid transparent;
-  border-left: 200px solid transparent;
-  border-bottom: 200px solid transparent;
-  text-align: center;
-  //   float: left;
-}
-
-.triangle {
-  border-top: 50px solid #fff;
-}
-
-.triangleYellow {
-  border-top: 50px solid #ffff00;
-}
-
-.triangleRed {
-  border-top: 50px solid #ff0000;
-}
-
-.triangle > .label,
-.triangleYellow > .label,
-.triangleRed > .label {
-  width: 150px;
-  position: relative;
-  top: -45px;
-  left: 50%;
-  transform: translateX(-50%);
-  font-size: 24px;
-  font-weight: bold;
-  color: #000000;
-}
-
-.top-triangle {
-  border-left: 100px solid transparent;
-  border-right: 100px solid transparent;
-  top: 0;
-  left: 0;
-}
-
-.left-triangle {
-  /* border-top: 100px solid transparent; */
-  border-right: 100px solid black;
-  border-bottom: 50px solid rgb(217, 217, 233);
-  top: 0;
-  left: 0;
-}
-
-.right-triangle {
-  border-left: 100px solid black; //red
-  border-bottom: 50px solid rgb(217, 217, 233);
-  top: 0;
-  left: 100px;
-}
-
-.one {
-  justify-content: center;
-  align-items: center;
-  display: flex;
-}
-</style>

+ 0 - 429
src/views/system/jbdScan/goods/deviceVerificationTag-sichuan.vue

@@ -1,429 +0,0 @@
-<template>
-  <div class="bg">
-    <el-dialog
-      width="11cm"
-      height="10cm"
-      :modal-append-to-body="true"
-      :append-to-body="true"
-      title="设备检定校准标签"
-      :visible.sync="scanVisible"
-    >
-      <!-- 表单是否显示 -->
-      <div style="height: 500px">
-        <div id="box" ref="qrcode">
-          <vue-easy-print ref="easyPrint" table-show :one-page-row="onePageRow">
-            <div v-for="(item, index1) in list" :key="index1">
-              <!-- style="page-break-after:always" -->
-              <div class="All">
-                <div>
-                  <div class="one">
-                    <div class="container">
-                      <div
-                        :class="
-                          item.deviceStatus === '合格'
-                            ? 'triangle'
-                            : item.deviceStatus === '停用'
-                              ? 'triangleRed'
-                              : 'triangleYellow'
-                        "
-                      >
-                        <div class="label" style="border: 0">
-                          {{ item.prove }}
-                        </div>
-                      </div>
-                      <div style="position: absolute; top: 25px; width: 100%">
-                        <div
-                          style="
-                            display: flex;
-                            justify-content: space-between;
-                            font-size: 14px;
-                            font-weight: 800;
-                            margin: 0 8px;
-                          "
-                        >
-                          <div>{{ item.slogan }}</div>
-                        </div>
-                      </div>
-                    </div>
-                  </div>
-                  <div class="tagBox">
-                    <div class="lh">
-                      <div class="qianZhi">设备名称:</div>
-                      <div>{{ item.name }}</div>
-                    </div>
-                    <div v-if="modelTF" class="lh">
-                      <div>设备型号:</div>
-                      <div>{{ item.model }}</div>
-                    </div>
-                    <div class="lh">
-                      <div>原设备编号:</div>
-                      <div>{{ item.original}}</div>
-                    </div>
-
-                    <div class="lh">
-                      <div class="la">
-                        <div>校准日期:</div>
-                        <div>{{ item.jiaoZhunTime }}</div>
-                      </div>
-                      <div class="la" style="border-left: 1px solid #000000">
-                        <div>有效期至:</div>
-                        <div>{{ item.validTo }}</div>
-                      </div>
-                    </div>
-                    <div
-                      class="lh"
-                      :style="
-                        item.range !== ''
-                          ? 'border-bottom: 1px solid #000000;'
-                          : 'border-bottom: 0px;'
-                      "
-                    >
-                      <div class="qianZhi">校准单位:</div>
-                      <div class="zuoJuZhong">{{ item.unit }}</div>
-                    </div>
-                    <!-- <div class="lh" style="border-bottom: 0px;" v-if="item.range !== ''">
-                                            <div class="qianZhi">限用范围:</div>
-                                            <div class="zuoJuZhong">{{ item.range }}</div>
-                                        </div> -->
-                  </div>
-                </div>
-              </div>
-            </div>
-          </vue-easy-print>
-        </div>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="scanVisible = false">取 消</el-button>
-        <el-button type="primary" @click="printDemo">打印标签</el-button>
-      </span>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import VueBarcode from 'vue-barcode'
-import vueEasyPrint from 'vue-easy-print'
-import { getSetting } from '@/utils/query'
-
-export default {
-  components: {
-    VueBarcode,
-    vueEasyPrint
-  },
-  props: {
-    obj: {
-      default: () => [],
-      type: Array
-    },
-    onePageRow: {
-      type: Number,
-      default: 3
-    },
-    blankLines: {
-      type: Boolean,
-      default: true
-    },
-    scanVisible: {
-      type: Boolean,
-      default: false
-    }
-  },
-  data() {
-    return {
-      value: '',
-      id: '',
-      list: [
-        {
-          name: 1,
-          serial: 1,
-          original: 1,
-          validTo: 1,
-          model: 1,
-          unit: 1,
-          jiaoZhunTime: 1,
-          // status: 1
-          prove: 1, // 证名
-          slogan: 1, // 标语
-          deviceStatus: 1,
-          range: 1 // 限用范围
-        }
-      ],
-      visible: true,
-      orgTF: true,
-      modelTF: true
-    }
-  },
-  watch: {
-    obj() {
-      this.getInit()
-      // console.log(this.obj)
-    }
-  },
-  created() {
-    this.getInit()
-  },
-  methods: {
-    printDemo() {
-      this.$refs.easyPrint.print()
-    },
-    async getInit() {
-      var idStr = ''
-      this.obj.forEach((item) => {
-        idStr += item.split(' ')[0] + ','
-      })
-      idStr = idStr.substring(0, idStr.length - 1)
-      this.getLook(idStr)
-      const { tagData } = (await getSetting('verificationTag')) || {}
-      this.orgTF =
-        tagData && tagData.hasOwnProperty('originalDevice')
-          ? tagData.originalDevice
-          : false
-      this.modelTF =
-        tagData && tagData.hasOwnProperty('originalDevice')
-          ? tagData.modelNumber
-          : true
-    },
-    getLook(id) {
-            /*
-      const sql = `SELECT 
-          dj.she_bei_ming_cheng_, 
-          dj.she_bei_shi_bie_h, 
-          dj.gui_ge_xing_hao_, 
-          dj.she_bei_zhuang_ta, 
-          dj.cai_gou_he_tong_, 
-          dj.yuan_she_bei_bian AS dj_yuan_she_bei_bian, 
-          zx.shi_shi_ri_qi_, 
-          zx.chu_chang_bian_ha, 
-          zx.jian_ding_dan_wei,
-          zx.yuan_she_bei_bian AS zx_yuan_she_bei_bian
-      FROM t_sbdj dj 
-      RIGHT JOIN t_mjsbjdxzjhzb zx 
-          ON zx.yuan_she_bei_bian = dj.yuan_she_bei_bian 
-      WHERE FIND_IN_SET(zx.id_, '${id}')`
-      */
-      this.$common
-        .request('query', {
-          key: 'deviceVerificationTag',
-          params: [id]
-        })
-        .then((res) => {
-          const { data } = res.variables || []
-          // console.log(data)
-          const list = []
-          
-          data.forEach((item) => {
-            const o = {
-              prove: this.switchProve(item.she_bei_zhuang_ta),
-              slogan: this.switchSlogan(item.she_bei_zhuang_ta),
-              deviceStatus: item.she_bei_zhuang_ta,
-              range: this.judgementVal(item.cai_gou_he_tong_)
-                ? item.cai_gou_he_tong_
-                : '',
-
-              name: item.she_bei_ming_cheng_,
-              serial: item.she_bei_shi_bie_h,
-              original: item.yuan_she_bei_bian,
-              validTo: item.chu_chang_bian_ha,
-              model: item.gui_ge_xing_hao_,
-              unit: item.jian_ding_dan_wei,
-              jiaoZhunTime: item.shi_shi_ri_qi_
-            }
-            list.push(o)
-          })
-
-          this.list = list
-        })
-    },
-    judgementVal(value) {
-      return value != null && value != undefined
-    },
-    switchProve(status) {
-      switch (status) {
-        case '合格':
-          return '合格证'
-        case '停用':
-          return '停用证'
-        case '限用':
-          return '限用证'
-        case '报废':
-          return '报废证'
-        default:
-          return '测试证'
-      }
-    },
-    switchSlogan(status) {
-      switch (status) {
-        case '合格':
-          return 'PASS'
-        case '停用':
-          return 'STOP'
-        case '限用':
-          return 'RESTRICT'
-        default:
-          return 'TEST'
-      }
-    },
-    getTime(second) {
-      const date = new Date(second)
-      const year = date.getFullYear()
-      let month = ''
-      let day = ''
-      if (date.getMonth() + 1 <= 9) {
-        month = '0' + (date.getMonth() + 1)
-      } else {
-        month = date.getMonth() + 1
-      }
-      if (date.getDate() <= 9) {
-        day = '0' + date.getDate()
-      } else {
-        day = date.getDate()
-      }
-      return year + '-' + month + '-' + day
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-.All {
-  text-align: center;
-  margin: 10px 0px;
-}
-
-.bg {
-  // height: auto;
-}
-
-.tagBox {
-  width: 300px; // 300  240 231
-  // height: 283px;  // 180  150  94
-  position: relative;
-  border: 1px solid #000000;
-  border-top: 0px;
-  //   padding: 2px;
-  display: inline-block;
-  // justify-content: space-around;
-  // flex-direction: column;
-  //   margin: 10px 5px;
-  //   border-radius: 4px;
-  background-color: #fff;
-}
-
-.ewm {
-  margin-left: 10px;
-}
-
-/*
-.tagBox {
-  width: 177.5px;   // 300  240
-  height: 106.5px;  // 180  150
-  position: relative;
-  border: 1px solid #000000;
-  padding: 20px;
-  display: flex;
-  justify-content: space-around;
-  flex-direction: column;
-  margin: 20px auto;
-  border-radius: 15px;
-  background-color: #fff;
-}
-*/
-.qianZhi {
-  white-space: nowrap;
-}
-
-.la {
-  font-size: 12px; //16
-  display: flex;
-  align-items: center;
-  padding: 1px;
-  width: 50%;
-}
-
-.zuoJuZhong {
-  text-align: left;
-}
-
-.lh {
-  display: flex;
-  align-items: center;
-  //   line-height: auto;
-  padding: 1px;
-  font-size: 12px; //16
-  display: flex;
-  align-items: center;
-  border-bottom: 1px solid #000000;
-}
-
-.container {
-  width: 300px;
-  height: 50px;
-  position: relative;
-  border: 1px solid #000000;
-}
-
-.triangle,
-.triangleYellow,
-.triangleRed {
-  width: 0;
-  height: 0;
-  position: relative;
-  border-right: 125px solid transparent;
-  border-left: 125px solid transparent;
-  border-bottom: 125px solid transparent;
-  text-align: center;
-  //   float: left;
-}
-
-.triangle {
-  border-top: 50px solid #008000;
-}
-
-.triangleYellow {
-  border-top: 50px solid #ffff00;
-}
-
-.triangleRed {
-  border-top: 50px solid #ff0000;
-}
-
-.triangle > .label,
-.triangleYellow > .label,
-.triangleRed > .label {
-  width: 100px;
-  position: relative;
-  top: -45px;
-  left: -50px;
-  font-size: 24px;
-  font-weight: bold;
-  color: #000000;
-}
-
-.top-triangle {
-  border-left: 100px solid transparent;
-  border-right: 100px solid transparent;
-  top: 0;
-  left: 0;
-}
-
-.left-triangle {
-  /* border-top: 100px solid transparent; */
-  border-right: 100px solid black;
-  border-bottom: 50px solid rgb(217, 217, 233);
-  top: 0;
-  left: 0;
-}
-
-.right-triangle {
-  border-left: 100px solid black; //red
-  border-bottom: 50px solid rgb(217, 217, 233);
-  top: 0;
-  left: 100px;
-}
-
-.one {
-  justify-content: center;
-  align-items: center;
-  display: flex;
-}
-</style>

+ 8 - 40
src/views/system/jbdScan/goods/deviceVerificationTag.vue

@@ -141,7 +141,6 @@ export default {
           model: 1,
           unit: 1,
           jiaoZhunTime: 1,
-          // status: 1
           prove: 1, // 证名
           slogan: 1, // 标语
           deviceStatus: 1,
@@ -156,7 +155,6 @@ export default {
   watch: {
     obj() {
       this.getInit()
-      // console.log(this.obj)
     }
   },
   created() {
@@ -222,25 +220,23 @@ export default {
     },
     switchProve(status) {
       switch (status) {
-        case '合格':
+        case '正常使用':
           return '合格证'
-        case '停用':
-          return '停用证'
-        case '限用':
-          return '限用证'
-        case '报废':
-          return '报废证'
+        case '暂停使用':
+          return '暂停使用证'
+        case '停止使用':
+          return '停止使用证'
         default:
           return '测试证'
       }
     },
     switchSlogan(status) {
       switch (status) {
-        case '合格':
+        case '正常使用':
           return 'PASS'
-        case '停用':
+        case '使用':
           return 'STOP'
-        case '用':
+        case '停止使用':
           return 'RESTRICT'
         default:
           return 'TEST'
@@ -273,22 +269,12 @@ export default {
   margin: 10px 0px;
 }
 
-.bg {
-  // height: auto;
-}
-
 .tagBox {
   width: 250px; // 300  240 231
-  // height: 283px;  // 180  150  94
   position: relative;
   border: 1px solid #000000;
   border-top: 0px;
-  //   padding: 2px;
   display: inline-block;
-  // justify-content: space-around;
-  // flex-direction: column;
-  //   margin: 10px 5px;
-  //   border-radius: 4px;
   background-color: #fff;
 }
 
@@ -296,21 +282,6 @@ export default {
   margin-left: 10px;
 }
 
-/*
-.tagBox {
-  width: 177.5px;   // 300  240
-  height: 106.5px;  // 180  150
-  position: relative;
-  border: 1px solid #000000;
-  padding: 20px;
-  display: flex;
-  justify-content: space-around;
-  flex-direction: column;
-  margin: 20px auto;
-  border-radius: 15px;
-  background-color: #fff;
-}
-*/
 .qianZhi {
   white-space: nowrap;
 }
@@ -330,7 +301,6 @@ export default {
 .lh {
   display: flex;
   align-items: center;
-  //   line-height: auto;
   padding: 1px;
   font-size: 12px; //16
   display: flex;
@@ -355,7 +325,6 @@ export default {
   border-left: 125px solid transparent;
   border-bottom: 125px solid transparent;
   text-align: center;
-  //   float: left;
 }
 
 .triangle {
@@ -390,7 +359,6 @@ export default {
 }
 
 .left-triangle {
-  /* border-top: 100px solid transparent; */
   border-right: 100px solid black;
   border-bottom: 50px solid rgb(217, 217, 233);
   top: 0;

+ 0 - 6
src/views/system/jbdScan/scan.vue

@@ -13,9 +13,6 @@
 <script>
 /* 共同调用类, 与脚本统一调用。*/
 import deviceTag from './goods/deviceTag.vue'
-import deviceTagHengSheng from './goods/deviceTag-hengsheng.vue'
-import deviceVerificationTagHengSheng from './goods/deviceVerificationTag-hengsheng.vue'
-import deviceVerificationTagSiChuan from './goods/deviceVerificationTag-sichuan.vue'
 import deviceVerificationTag from './goods/deviceVerificationTag.vue'
 import deviceFailureTag from './goods/deviceFailureTag.vue'
 import neishenzhuangtai from './goods/neishenzhuangtai'
@@ -27,9 +24,6 @@ import tag from './goods/tag'
 export default {
   components: {
     deviceTag,
-    deviceTagHengSheng,
-    deviceVerificationTagHengSheng,
-    deviceVerificationTagSiChuan,
     deviceVerificationTag,
     deviceFailureTag,
     neishenzhuangtai,

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.