Browse Source

接口对接

renmy 3 years ago
parent
commit
88c485698e

+ 10 - 0
src/api/device/delivery.js

@@ -36,6 +36,16 @@ export function deliveryDefualtList(data) {
     })
 }
 
+//批次出库查看列表
+export function deliveryOutDetailList(data) {
+    return request({
+        url: '/api/v1/app/device/log/outstorage/batch/detailQuery',
+        method: 'post',
+        data
+    })
+}
+
+
 //设备出库
 export function deliveryAdd(data) {
     return request({

+ 8 - 0
src/router/index.js

@@ -155,6 +155,14 @@ export const constantRoutes = [{
                     import ('@/views/device/delivery/batchOut'),
                 meta: { title: '批次出库', icon: 'el-icon-picture-outline' }
             },
+            {
+                path: 'delivery/batchOutDetail',
+                name: 'BatchOutDetail',
+                hidden: true,
+                component: () =>
+                    import ('@/views/device/delivery/batchOutDetail'),
+                meta: { title: '批次出库-查看详情', icon: 'el-icon-picture-outline' }
+            },
             {
                 path: 'handle',
                 name: 'Handle',

+ 12 - 4
src/views/device/delivery/batchOut.vue

@@ -55,19 +55,19 @@
 
       <el-table-column label="未出库">
         <template slot-scope="scope">
-          {{ scope.row.code || '-' }}
+          {{ scope.row.total - scope.row.out_storage || 0 }}
         </template>
       </el-table-column>
 
       <el-table-column label="可出库">
         <template slot-scope="scope">
-          {{ scope.row.total || '-'}}
+          {{ scope.row.transfer || 0}}
         </template>
       </el-table-column>
 
       <el-table-column label="不可出库">
         <template slot-scope="scope">
-          {{ scope.row.dt || '-' }}
+          {{ scope.row.out_storage || 0 }}
         </template>
       </el-table-column>
 
@@ -79,7 +79,7 @@
 
       <el-table-column align="center" label="查看明细" width="180">
         <template slot-scope="scope">
-          <el-button @click="edit(scope.row.id)" type="text">查看</el-button>
+          <el-button @click="gotoDetail(scope.row.batch_num)" type="text">查看</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -191,6 +191,14 @@ export default {
 		checkSelectable() {
 			
 		},
+    gotoDetail(batchId) {
+      this.$router.push({
+        path: '/device/delivery/batchOutDetail',
+        query: {
+          batchId: batchId
+        }
+      })
+    },
     del(val) {
       this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
         confirmButtonText: '确定',

+ 220 - 0
src/views/device/delivery/batchOutDetail.vue

@@ -0,0 +1,220 @@
+<template>
+  <div class="app-container">
+    <h1><i class="el-icon-arrow-left" @click="goBack"></i>批次出库-查看详情</h1>
+		<div class="top-info">
+			设备共计 <span>1864</span>
+		</div>
+
+		<el-form :inline="true" :model="listQuery" @keyup.enter.native="searchHandle()">
+			<el-row>
+				<el-col :span="12">
+					<el-form-item label="设备SN">
+						<el-input v-model="listQuery.sn" placeholder="请输入设备SN" clearable></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<div style="float: right;">
+						<el-form-item>
+							<el-button type="primary" @click="searchHandle()">搜索</el-button>
+						</el-form-item>
+						<el-form-item>
+							<el-button @click="resetForm()">重置</el-button>
+						</el-form-item>
+					</div>
+				</el-col>
+			</el-row>
+		</el-form>
+
+    <el-table
+      v-loading="loading"
+      :data="data"
+      element-loading-text="Loading"
+			:header-cell-style="{background:'rgba(242, 242, 242, 1)',borderColor:'rgba(242, 242, 242, 1);',textAlign:'center'}"
+			:cell-style="{'text-align':'center'}"
+      fit
+      highlight-current-row
+    >
+			<el-table-column label="设备SN">
+        <template slot-scope="scope">
+          {{ scope.row.sn || '-' }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="电池类型">
+        <template slot-scope="scope">
+          {{ scope.row.typeTitle || '-' }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="PACK厂">
+        <template slot-scope="scope">
+          {{ scope.row.packTitle || '-'}}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="产品规格">
+        <template slot-scope="scope">
+          {{ scope.row.expandTitle || '-' }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="产品拓展">
+        <template slot-scope="scope">
+          {{ scope.row.specTitle || '-' }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="出库时间">
+        <template slot-scope="scope">
+          {{ scope.row.addTime || '-' }}
+        </template>
+      </el-table-column>
+
+			<el-table-column label="操作人">
+        <template slot-scope="scope">
+          {{ scope.row.create || '-' }}
+        </template>
+      </el-table-column>
+    </el-table>
+
+		<el-pagination style="float: right; margin-top: 30px;" :current-page="listQuery.index" :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.length" :total="total"
+			layout="total, sizes, prev, pager, next, jumper" @size-change="pageSizeChangeHandle"
+			@current-change="pageCurrentChangeHandle">
+		</el-pagination>
+  </div>
+</template>
+
+<script>
+import { deliveryOutDetailList } from '@/api/device/delivery'
+
+export default {
+  components: {  },
+  data() {
+    return {
+      //列表加载动画
+      loading: false,
+      //总条数
+      total: 0,
+      //列表数据
+      data: [],
+			/**查询条件对象 */
+			listQuery: {
+        index: 1,
+        length: 20,
+        sn: '',
+        type: null,
+        sort: '',
+        batchNum: '',
+        operateID: null
+      },
+			/**是否显示新增弹窗 */
+			addVisible: false,
+      //出库类型选项
+      options: [
+        {label: '全部', value: null},
+        {label: '商用', value: 1},
+        {label: '测试', value: 2},
+        {label: '试用', value: 3}
+      ]
+    }
+  },
+  created() {
+    if (this.$route.query.batchId !== undefined) {
+      this.listQuery.batchNum = this.$route.query.batchId
+    }
+    this.getDataList()
+  },
+  methods: {
+    //搜索
+    searchHandle() {
+      this.listQuery.index = 1
+      this.getDataList()
+    },
+
+    //重置
+    resetForm() {
+      this.listQuery = {
+        index: 1,
+        length: 20,
+        sn: '',
+        type: null,
+        sort: '',
+        batchNum: ''
+      }
+      this.getDataList()
+    },
+
+    //获取列表数据
+    getDataList() {
+      this.loading = true
+      deliveryOutDetailList(this.listQuery).then(res => {
+        if (res.code === 200) {
+          this.data = res.data
+          this.total = res.total
+          this.loading = false
+        } else {
+          this.loading = false
+          return this.$message.error(res.message)
+        }
+      })
+    },
+
+		// 分页, 每页条数
+    pageSizeChangeHandle (val) {
+      this.listQuery.index = 1
+      this.listQuery.length = val
+      this.getDataList()
+    },
+    // 分页, 当前页
+    pageCurrentChangeHandle (val) {
+      this.listQuery.index = val
+      this.getDataList()
+    },
+
+    //打开新增弹窗
+    cerateHandle() {
+        this.addVisible = true
+        this.$nextTick(() => {
+            this.$refs.add.init()
+        });
+    },
+    //返回上一页
+    goBack() {
+      this.$store.dispatch('tagsView/delView', this.$route)
+      this.$router.go(-1)
+    },
+    del(val) {
+      this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        postJson('/api/v1/carinfo/delete', { id: val }).then(response => {
+          if (response.code === 200) {
+            this.fetchData()
+          }
+        })
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+	.top-info {
+		height: 53px;
+		line-height: 53px;
+		width: 100%;
+		background-color: rgba(242, 242, 242, 1);
+		box-shadow: none;
+		text-align: left;
+		color: #7F7F7F;
+		font-size: 13px;
+		padding-left: 20px;
+		margin-bottom: 20px;
+		>span {
+			color: #0000FF;
+			font-size: 13px;
+		}
+	}
+</style>

+ 4 - 1
src/views/device/info/details.vue

@@ -155,8 +155,11 @@ export default {
     }
   },
   created() {
+    if (this.$route.query.operateId !== undefined) {
+      this.listQuery.operateID = this.$route.query.operateId
+    }
     if (this.$route.query.batchId !== undefined) {
-      this.listQuery.operateID = this.$route.query.batchId
+      this.listQuery.batchNum = this.$route.query.batchId
     }
 		if (this.$route.query.inTime !== undefined) {
       this.inTime = this.$route.query.inTime

+ 7 - 6
src/views/device/info/index.vue

@@ -103,11 +103,11 @@
             </template>
           </el-table-column>
 
-          <el-table-column align="center" label="发货时间">
+          <!-- <el-table-column align="center" label="发货时间">
             <template slot-scope="scope">
               <span>{{ scope.row.deliver_time || '-' }}</span>
             </template>
-          </el-table-column>
+          </el-table-column> -->
 
           <el-table-column label="录入时间" prop="vin">
             <template slot-scope="scope">
@@ -353,11 +353,11 @@
             </template>
           </el-table-column>
 
-          <el-table-column align="center" label="发货时间">
+          <!-- <el-table-column align="center" label="发货时间">
             <template slot-scope="scope">
               <span>{{ scope.row.deliver_time || '-' }}</span>
             </template>
-          </el-table-column>
+          </el-table-column> -->
 
           <el-table-column label="录入时间" prop="vin">
             <template slot-scope="scope">
@@ -381,7 +381,7 @@
 		
 
     <add-or-update v-if="addVisible" ref="addOrUpdate" @refreshDataList="searchHandle" ></add-or-update>
-    <up-load v-if="upVisible" ref="upLoad" ></up-load>
+    <up-load v-if="upVisible" ref="upLoad" @refreshDataList="searchHandle" ></up-load>
   </div>
 </template>
 
@@ -494,7 +494,8 @@ export default {
       this.$router.push({
         path: '/device/info/details',
         query: {
-          batchId: row.operate_id,
+          batchId: row.batch_num,
+          operateId: row.operate_id,
           inTime: row.add_time,
           total: row.total,
           storage: row.total-row.in_storage

+ 4 - 1
src/views/device/info/up-load.vue

@@ -41,6 +41,7 @@
 
 <script>
 import debounce from 'lodash/debounce'
+import { getInfoList, dataTotle } from '@/api/device/info'
 export default {
   data () {
     return {
@@ -127,7 +128,9 @@ export default {
     // 文件上传成功时的钩子
     handleSuccess(res, file, fileList) {
       this.$message.success("文件上传成功");
-      this.$router.push({ path: "/order" });
+      this.visible = false
+      this.$emit('refreshDataList')
+      // this.$router.push({ path: "/device/info/index" });
     },
     dataFormSubmitHandle: debounce(function () {
       if(this.length !== 1) {

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

@@ -78,7 +78,7 @@
 
 			<el-table-column align="center" prop="updateTime" label="入库时间">
         <template slot-scope="scope">
-          <span>{{ scope.row.addTime || '-' }}</span>
+          <span>{{ scope.row.instorageTime || '-' }}</span>
         </template>
       </el-table-column>
     </el-table>