408249787 2 жил өмнө
parent
commit
1d68c25844

+ 17 - 0
src/api/sb/info.js

@@ -464,6 +464,23 @@ export function importMeasure (parameter) {
     data: parameter
   })
 }
+/**
+ * add batch func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function batchChanges (parameter) {
+  return axios({
+    url: '/sb/sb-changes/batch',
+    method: 'POST',
+    headers: {
+      'Accept': 'application/json',
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    data: parameter
+  })
+}
 /**
  * add batch func
  * parameter: { }

+ 12 - 13
src/views/sb/info/SbInfo.vue

@@ -152,7 +152,7 @@
                 修改导入
               </a-button>
               <a-button style="margin-left: 8px" type="primary" icon="printer" @click="handlePrintBatch()">批量打印</a-button>
-              <a-button style="margin-left: 8px" type="primary" icon="reload" @click="handleMeasureBatch()">批量检定</a-button>
+              <!-- <a-button style="margin-left: 8px" type="primary" icon="reload" @click="handleMeasureBatch()">批量检定</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">
@@ -162,9 +162,12 @@
                   <a-popconfirm v-if="measureStatus===1" :visible="false" @visibleChange="batchIncorrect()">
                     <a-menu-item key="2"><my-icon type="icon-pandian" /><a>检定</a></a-menu-item>
                   </a-popconfirm>
-                  <a-popconfirm :visible="false" @visibleChange="batchLocation()">
+                  <a-popconfirm :visible="false" @visibleChange="batchLocation(2)">
                     <a-menu-item key="3"><my-icon type="icon-pandian" /><a>设备位号</a></a-menu-item>
                   </a-popconfirm>
+                  <a-popconfirm :visible="false" @visibleChange="batchLocation(1)">
+                    <a-menu-item key="4"><my-icon type="icon-pandian" /><a>设备位置</a></a-menu-item>
+                  </a-popconfirm>
                 </a-menu>
                 <a-button style="margin-left: 8px">
                   批量操作 <a-icon type="down" />
@@ -652,23 +655,19 @@ export default {
         modal.base([res.data])
       })
     },
-    batchLocation (id) {
+    batchLocation (type) {
       let ids = []
-      if (this.BaseTool.String.isBlank(id)) {
-        const length = this.selectedRows.length
-        if (length === 0) {
-          this.$message.info('请选择设备')
-          return
-        }
-        ids = this.selectedRows.map(item => item.id)
-      } else {
-        ids = [id]
+      const length = this.selectedRows.length
+      if (length === 0) {
+        this.$message.info('请选择设备')
+        return
       }
+      ids = this.selectedRows.map(item => item.id)
       console.log(ids)
       batchLocationList({ ids }).then(res => {
         this.visible = false
         const modal = this.$refs.baseFormLocation
-        modal.base(res.data)
+        modal.base(res.data, type)
       })
     },
     batchIncorrect (id) {

+ 32 - 10
src/views/sb/info/modules/BaseFormLocation.vue

@@ -19,17 +19,23 @@
           {{ index+1 }}
         </template>
         <template v-slot:positionNo="text,record,index">
-          <a-input v-if="record.isChild === 1" style="width: 150px" v-model="record.positionNo" />
-          <div v-else style="width:300px">
-            <a-input
-              disabled
-              style="width: 50%"
-              v-model="record.positionNo"/>
-            <a-button type="primary" @click="handleSbNoSelect(index)">选择</a-button>
+          <div v-if="changeType===1">
+            {{ text }}
+          </div>
+          <div v-else>
+            <a-input v-if="record.isChild === 1" style="width: 150px" v-model="record.positionNo" />
+            <div v-else style="width:300px">
+              <a-input
+                disabled
+                style="width: 50%"
+                v-model="record.positionNo"/>
+              <a-button type="primary" @click="handleSbNoSelect(index)">选择</a-button>
+            </div>
           </div>
         </template>
         <template v-slot:positionName="text,record">
           <a-tree-select
+            v-if="changeType===1"
             style="width: 150px"
             :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
             :treeData="treeData"
@@ -39,6 +45,7 @@
             placeholder="请选择"
           >
           </a-tree-select>
+          <span v-else>  {{ text }}</span>
         </template>
         <span slot="status" slot-scope="text">
           <badge
@@ -55,7 +62,7 @@
 <script>
 import { getSbPositionTree } from '@/api/sb/position'
 import SbPositionNoModal from '@/views/sb/info/modules/SbPositionNoModal'
-import { importMeasure } from '@/api/sb/info'
+import { batchChanges } from '@/api/sb/info'
 
 export default {
   name: 'BaseFillGatherTask',
@@ -70,6 +77,7 @@ export default {
       treeData: [],
       sbParentOPt: '',
       statusMap: {},
+      changeType: 0,
       columns: [
         {
           title: '序号',
@@ -129,13 +137,27 @@ export default {
     })
   },
   methods: {
-    base (record) {
+    base (record, type) {
       this.visible = true
+      this.changeType = type
       this.modal = record
       console.log(this.modal)
+      console.log(this.changeType)
     },
     save () {
-
+      const params = this.modal.map(item => {
+        const param = {
+          sbId: item.id,
+          changeType: this.changeType,
+          sbNoId: item.positionNo,
+          positionId: item.positionId
+        }
+        return param
+      })
+      batchChanges({ sbChangeRecordDTOList: params }).then(res => {
+        console.log(res)
+      })
+      console.log(params)
     },
     handleSbNoSelect (i) {
       this.sbParentOPt = i

+ 5 - 2
src/views/sb/info/modules/BaseFormMeasure.vue

@@ -25,10 +25,11 @@
               <th width="150px">设备位置</th>
               <th width="150px">设备位号</th>
               <th width="150px">检定周期</th>
-              <th width="150px">检定单号</th>
               <th width="150px">检定日期</th>
+              <th width="150px">检定单号</th>
               <th width="150px">检定单位</th>
               <th width="150px">备注</th>
+              <th width="150px">有效期</th>
               <th width="150px">操作</th>
             </tr>
             <tr v-if="ListForm.length>0">
@@ -70,14 +71,15 @@
                 </div>
               </td>
               <td><a-input v-model="item.checkPeriod" :formatter="BaseTool.Amount.formatter" :parser="BaseTool.Amount.parser"> <span slot="suffix" >月</span> </a-input></td>
-              <td><a-input style="width: 150px" v-model="item.no" /></td>
               <td><a-date-picker
                 placeholder="日期"
                 style="width: 150px"
                 :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
                 v-model="item.lastDate" /></td>
+              <td><a-input style="width: 150px" v-model="item.no" /></td>
               <td><a-input style="width: 150px" v-model="item.requirement" /></td>
               <td><a-input style="width: 150px" v-model="item.remark" /></td>
+              <td>{{ item.validity }}</td>
               <td>
                 <a-button type="link" @click="uploadImg(item,i)">上传图片</a-button>
                 <a-button type="link" @click="uploadFile(item,i)">上传文件</a-button>
@@ -202,6 +204,7 @@ export default {
           sbPositionId: item.positionId,
           no: '',
           lastDate: '',
+          validity: '',
           sbPositionNo: item.positionNo,
           requirement: '',
           remark: '',