whj преди 11 месеца
родител
ревизия
1183962dc2
променени са 2 файла, в които са добавени 41 реда и са изтрити 16 реда
  1. 4 13
      src/views/sb/info/SbInfoC.vue
  2. 37 3
      src/views/sb/info/modules/BaseFormMeasure.vue

+ 4 - 13
src/views/sb/info/SbInfoC.vue

@@ -188,16 +188,16 @@
               <a-button style="margin-left: 8px" type="primary" icon="printer" @click="handlePrintBatch()">批量打印</a-button>
               <a-button style="margin-left: 8px" type="primary" @click="handleBackBatch(13)">批量退库</a-button>
               <a-button style="margin-left: 8px" type="primary" @click="handleBackBatch(4)">批量报废</a-button>
-              <!-- <a-button style="margin-left: 8px" type="primary" icon="reload" @click="handleMeasureBatch()">批量检定</a-button> -->
+              <a-button style="margin-left: 8px" v-if="isMeasure===1" type="primary" icon="reload" @click="batchIncorrect()">批量检定</a-button>
               <a-button style="margin-left: 8px" v-if="$auth('sb-infos-generate-code-all')" :loading="confirmLoading" type="primary" @click="batchGenerate()">重新生成二维码</a-button>
               <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-infos-del')">
                 <a-menu slot="overlay">
                   <a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
                     <a-menu-item key="1"><a-icon type="delete" /><a>删除</a></a-menu-item>
                   </a-popconfirm>
-                  <a-popconfirm v-if="isMeasure===1" @visibleChange="batchIncorrect()">
+                  <!-- <a-popconfirm v-if="isMeasure===1" @visibleChange="batchIncorrect()">
                     <a-menu-item key="2"><my-icon type="icon-pandian" /><a>检定</a></a-menu-item>
-                  </a-popconfirm>
+                  </a-popconfirm> -->
                   <a-popconfirm v-if="isMeasure===1" @visibleChange="batchIncorrectInStore()">
                     <a-menu-item key="3"><my-icon type="icon-pandian" /><a>入库</a></a-menu-item>
                   </a-popconfirm>
@@ -954,16 +954,7 @@ export default {
     },
     batchIncorrect (id) {
       let ids = []
-      if (this.BaseTool.String.isBlank(id)) {
-        const length = this.selectedRows.length
-        if (length === 0) {
-          this.$message.info('请选择要填报的设备')
-          return
-        }
-        ids = this.selectedRows
-      } else {
-        ids = [id]
-      }
+      ids = [id]
       this.visible = false
       const modal = this.$refs.baseModalMeasure
       modal.base(ids, this.correctType)

+ 37 - 3
src/views/sb/info/modules/BaseFormMeasure.vue

@@ -2,10 +2,11 @@
   <a-card :bordered="false" v-show="visible" class="card">
     <a-row :gutter="48" style="position:fixed;bottom:150px;z-index:999;display:flex; justify-content: center;width: 90%;">
       <a-col :md="48" :sm="48">
-        <span>
+        <a-space>
           <a-button type="primary" @click="save()">保存</a-button>
-          <a-button style="margin-left: 8px" type="default" @click="handleCancel()">返回</a-button>
-        </span>
+          <a-button type="primary" @click="$refs.sbSelect.base()">选择设备</a-button>
+          <a-button type="default" @click="handleCancel()">返回</a-button>
+        </a-space>
       </a-col>
     </a-row>
     <div>
@@ -143,6 +144,7 @@
     </div>
     <sb-info-select-modal ref="sbInfoSelectModal" @selected="handleSbSelectd"/>
     <sb-position-no-modal ref="sbPositionNoModal" @selected="handleSbNoSelectd"/>
+    <SbInfoSelectModal2 ref="sbSelect" @selected="handleSelected" />
 
   </a-card>
 </template>
@@ -152,6 +154,7 @@ import { getSbPositionTree } from '@/api/sb/position'
 import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
 import SbPositionNoModal from '@/views/sb/location/modules/LocationSelectModal'
 import { importMeasureInStore } from '@/api/sb/info'
+import SbInfoSelectModal2 from './SbInfoSelectModal2.vue'
 
 import { uploadUrl } from '@/api/upms/file'
 import Vue from 'vue'
@@ -161,6 +164,7 @@ export default {
   name: 'BaseFillGatherTask',
   components: {
     SbInfoSelectModal,
+    SbInfoSelectModal2,
     SbPositionNoModal
   },
   data () {
@@ -220,6 +224,7 @@ export default {
     base (record, type) {
       this.visible = true
       this.model = record
+      this.type = type
       this.ListForm = record.map(item => {
         const data = {
           sbName: item.name,
@@ -375,6 +380,35 @@ export default {
         this.handleCancel()
       })
     },
+    handleSelected (keys, rows) {
+      rows.forEach((item) => {
+        if (!this.ListForm.map((sb) => sb.sbId).includes(item.id)) {
+          const data = {
+            sbName: item.name,
+            sbModel: item.model,
+            checkPeriod: item.checkPeriod || 0,
+            isChild: item.isChild,
+            parentSbName: item.parentSbName,
+            sbParentId: item.parentId,
+            sbPositionId: item.positionId,
+            sbPositionName: item.positionName,
+            no: '',
+            lastDate: '',
+            sbStatus: false,
+            sbPositionNo: item.positionNo,
+            requirement: '',
+            remark: '',
+            name: this.username,
+            sbId: item.id,
+            type: this.type,
+            zzh: item.zzh,
+            checkImgList: [],
+            checkFileList: []
+          }
+          this.ListForm.push(data)
+        }
+      })
+    },
     handleCancel () {
       this.visible = false
       this.ListForm = []