Browse Source

接口修改

renmy 3 years ago
parent
commit
4cb2adc583

+ 1 - 1
src/api/device/allocation.js

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 //列表
 export function transferList(data) {
     return request({
-        url: '/api/v1/app/device/log/batchNum/transfer/pageQuery',
+        url: '/api/v1/app/device/log/transfer/pageQuery',
         method: 'post',
         data
     })

+ 9 - 0
src/api/device/info.js

@@ -9,6 +9,15 @@ export function getInfoList(data) {
     })
 }
 
+//查看电池详情
+export function getBatteryDetail(data) {
+    return request({
+        url: '/api/v1/appdevice/pageQuery/detail',
+        method: 'post',
+        data
+    })
+}
+
 //设备信息分页
 export function getBatchList(data) {
     return request({

+ 18 - 0
src/api/device/storage.js

@@ -1,5 +1,23 @@
 import request from '@/utils/request'
 
+//电池入库列表页
+export function storageInList(data) {
+    return request({
+        url: '/api/v1/app/device/log/instorage/pageQuery',
+        method: 'post',
+        data
+    })
+}
+
+//电池批次入库列表
+export function batchStorageInList(data) {
+    return request({
+        url: '/api/v1/app/device/log/instorage/batch/Query',
+        method: 'post',
+        data
+    })
+}
+
 //新增电池入库
 export function addStorageIn(data) {
     return request({

+ 3 - 3
src/views/device/allocation/allocation-modal.vue

@@ -83,12 +83,12 @@ export default {
 			packTitle: '',
 			typeTitle: '',
 			option: [
-				{label: '动力电池', value: '1'},
-				{label: '储能电池', value: '2'}
+				{label: '动力电池', value: 1},
+				{label: '储能电池', value: 2}
 			],
 			usedOption: [
 				{label: '智慧运营', value: '1'},
-				{label: '智慧运维2', value: '2'},
+				{label: '智慧运维', value: '2'},
 			],
 			disdOption: [
 				{label: '运营设备', value: '1'},

+ 26 - 4
src/views/device/allocation/index.vue

@@ -62,7 +62,7 @@
           fit
           highlight-current-row
         >
-          <el-table-column label="调拨时间" sortable="custom">
+          <el-table-column label="调拨时间">
             <template slot-scope="scope">
               {{ scope.row.add_time }}
             </template>
@@ -76,13 +76,13 @@
 
           <el-table-column label="调拨类型" prop="deptId">
             <template slot-scope="scope">
-              {{ scope.row.tf_device_type}}
+              {{ scope.row.tf_device_type | TFDeviceStr}}
             </template>
           </el-table-column>
 
           <el-table-column label="用途">
             <template slot-scope="scope">
-              {{ scope.row.tf_used }}
+              {{ scope.row.tf_used | TFUserdStr }}
             </template>
           </el-table-column>
 
@@ -100,7 +100,7 @@
 
           <el-table-column label="备注">
             <template slot-scope="scope">
-              {{ scope.row.remarks }}
+              {{ scope.row.remarks || '-' }}
             </template>
           </el-table-column>
 
@@ -468,6 +468,28 @@ export default {
         })
       })
     }
+  },
+
+  filters: {
+    TFDeviceStr(value) {
+      if(value === '1' || value === 1) {
+        return '动力电池'
+      } else if (value === 2 || value === '2') {
+        return '储能电池'
+      }
+    },
+    TFUserdStr(value) {
+      let arr = value.split(',')
+      if(arr.length === 1) {
+        if(arr[0] === '1') {
+          return '智慧运营'
+        } else if(arr[0] === '2') {
+          return '智慧运维'
+        }
+      } else {
+        return '智慧运营,智慧运维'
+      }
+    }
   }
 }
 </script>

+ 2 - 2
src/views/device/info/details.vue

@@ -110,7 +110,7 @@
 </template>
 
 <script>
-import { getInfoList } from '@/api/device/info'
+import { getBatteryDetail } from '@/api/device/info'
 import AddOrUpdate from '@/views/device/info/info-add-or-update.vue'
 import UpLoad from '@/views/device/info/up-load.vue'
 
@@ -196,7 +196,7 @@ export default {
 		/**获取列表数据 */
 		getDataList() {
       this.loading = true
-      getInfoList(this.listQuery).then(response => {
+      getBatteryDetail(this.listQuery).then(response => {
         if (response.code === 200) {
           this.data = response.data
           this.total = response.total

+ 2 - 2
src/views/device/info/index.vue

@@ -386,7 +386,7 @@
 </template>
 
 <script>
-import { getBatchList, dataTotle } from '@/api/device/info'
+import { getInfoList, dataTotle } from '@/api/device/info'
 import { getForm } from '@/api/page'
 import AddOrUpdate from '@/views/device/info/info-add-or-update.vue'
 import UpLoad from '@/views/device/info/up-load.vue'
@@ -440,7 +440,7 @@ export default {
     //获取分页数据
     getDataList() {
       this.loading = true
-      getBatchList(this.listQuery).then(response => {
+      getInfoList(this.listQuery).then(response => {
         if (response.code === 200) {
           this.data = response.data
           this.total = response.total

+ 3 - 3
src/views/device/storage/batchWarehousing.vue

@@ -25,7 +25,7 @@
       fit
       highlight-current-row
     >
-			<el-table-column label="批次编号" sortable="custom">
+			<el-table-column label="批次编号">
         <template slot-scope="scope">
           {{ scope.row.batch_num }}
         </template>
@@ -94,7 +94,7 @@
 </template>
 
 <script>
-import { getBatchList } from '@/api/device/info'
+import { batchStorageInList } from '@/api/device/storage'
 import Create from '@/views/device/storage/create.vue'
 
 export default {
@@ -147,7 +147,7 @@ export default {
     /**请求列表数据 */
     getDataList() {
       this.loading = true
-      getBatchList(this.listQuery).then(response => {
+      batchStorageInList(this.listQuery).then(response => {
         if (response.code === 200) {
           this.data = response.data
           this.total = response.total

+ 24 - 18
src/views/device/storage/index.vue

@@ -70,43 +70,43 @@
 
           <el-table-column label="入库时间">
             <template slot-scope="scope">
-              {{ scope.row.updateTime }}
+              {{ scope.row.add_time }}
             </template>
           </el-table-column>
 
           <el-table-column label="电池类型" prop="deptId">
             <template slot-scope="scope">
-              {{ scope.row.typeTitle}}
+              {{ scope.row.type_title}}
             </template>
           </el-table-column>
 
           <el-table-column label="PACK厂">
             <template slot-scope="scope">
-              {{ scope.row.packTitle }}
+              {{ scope.row.pack_title }}
             </template>
           </el-table-column>
 
           <el-table-column label="批次编号">
             <template slot-scope="scope">
-              {{ scope.row.batchNum }}
+              {{ scope.row.batch_num }}
             </template>
           </el-table-column>
 
           <el-table-column label="状态">
             <template slot-scope="scope">
-              {{ scope.row.statusTitle }}
+              {{ scope.row.status | statusStr }}
             </template>
           </el-table-column>
 
           <el-table-column label="发送地">
             <template slot-scope="scope">
-              {{ scope.row.receivedPlace }}
+              {{ scope.row.received_place }}
             </template>
           </el-table-column>
 
           <el-table-column align="center" prop="updateTime" label="操作时间">
             <template slot-scope="scope">
-              <span>{{ scope.row.updateTime }}</span>
+              <span>{{ scope.row.add_time }}</span>
             </template>
           </el-table-column>
 
@@ -371,7 +371,7 @@
 </template>
 
 <script>
-import { getInfoList } from '@/api/device/info'
+import { storageInList } from '@/api/device/storage'
 import Create from '@/views/device/storage/create.vue'
 
 export default {
@@ -387,9 +387,8 @@ export default {
         index: 1,
         length: 20,
         sn: '',
-        status: [1],
         sort: 'id desc',
-        checkStatus: null
+        // checkStatus: []
       },
       //总条数
       total: 0,
@@ -438,14 +437,8 @@ export default {
     /**请求列表数据 */
     getDataList() {
       this.loading = true
-      let dataForm = {
-        index: this.listQuery.index,
-        length: this.listQuery.length,
-        sn: this.listQuery.sn,
-        status: [1],
-        sort: this.listQuery.sort,
-      }
-      getInfoList(dataForm).then(response => {
+      
+      storageInList(this.listQuery).then(response => {
         if (response.code === 200) {
           this.data = response.data
           this.total = response.total
@@ -480,6 +473,19 @@ export default {
     gotoHandle() {
       this.$router.push('/device/storage/batchWarehousing')
     }
+  },
+  filters: {
+    statusStr(value) {
+      if(value === 1) {
+        return '已入库'
+      } else if(value === 2) {
+        return '已调拨'
+      } else if(value === 3) {
+        return '已出库'
+      } else if(value === 4) {
+        return '已处置'
+      } 
+    }
   }
 }
 </script>

+ 1 - 1
src/views/device/storage/warehousing.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <h1><i class="el-icon-arrow-left" @click="goBack"></i>批次入库</h1>
+    <h1><i class="el-icon-arrow-left" @click="goBack"></i>电池批次入库</h1>
 		<div class="top-info">
 			共计电池 <span>{{totalData}}</span>,未入库电池 <span>200</span>批次号: 录入时间:
 		</div>