Browse Source

批次入库接口对接

任茂勇 3 năm trước cách đây
mục cha
commit
aa0e0a980f

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

@@ -202,9 +202,7 @@ export default {
     },
     //数据统计
     getDataTotle() {
-      debugger
       dataTotle().then(res => {
-        debugger
         if (res.code === 200) {
           this.dataTotle = res.data
         } else {

+ 33 - 67
src/views/device/storage/batchWarehousing.vue

@@ -17,14 +17,13 @@
 		</el-form>
 
     <el-table
-      v-loading="page.loading"
-      :data="page.data"
+      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
-      @sort-change="sortChange"
     >
 			<el-table-column label="批次编号" sortable="custom">
         <template slot-scope="scope">
@@ -87,50 +86,36 @@
       </el-table-column>
     </el-table>
 
-		<el-pagination style="float: right; margin-top: 30px;" :current-page="listQuery.page" :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.limit" :total="listQuery.total"
+		<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>
-
-		<Create v-if="addVisible" ref="create" @refreshDataList="getDataList"></Create>
   </div>
 </template>
 
 <script>
-import { postJson, getSort } from '@/api/page'
+import { getInfoList } from '@/api/device/info'
 import Create from '@/views/device/storage/create.vue'
 
 export default {
   components: { Create },
   data() {
     return {
-      page: {
-        loading: false,
-        data: [
-					{code: 'SZRLCG20210001', total: 100, type: '二轮车', dt: '美顺', into: 0, create: '张三', address: '北京', to: '2021-05-18', intime: '2021-05-18 13:13:32',id: 'asdasdas'},
-					{code: 'SZRLCG20210001', total: 100, type: '二轮车', dt: '美顺', into: 0, create: '张三', address: '北京', to: '2021-05-18', intime: '2021-05-18 13:13:32',id: 'asdasdas'},
-					{code: 'SZRLCG20210001', total: 100, type: '二轮车', dt: '美顺', into: 0, create: '张三', address: '北京', to: '2021-05-18', intime: '2021-05-18 13:13:32',id: 'asdasdas'},
-					{code: 'SZRLCG20210001', total: 100, type: '二轮车', dt: '美顺', into: 0, create: '张三', address: '北京', to: '2021-05-18', intime: '2021-05-18 13:13:32',id: 'asdasdas'}
-				],
-        param: {
-          index: 1,
-          length: 10,
-          sort: 'updateTime desc',
-          plateNumber: ''
-        }
-      },
+      //列表加载动画
+      loading: false,
+      //列表数据
+      data: [],
+      //总条数
+      total: 0,
 			/**查询条件对象 */
 			listQuery: {
-        page: 1,
-        limit: 20,
-				total: 3,
+        index: 1,
+        length: 20,
         importance: undefined,
-        title: undefined,
+        sn: '',
         type: undefined,
         sort: '+id'
       },
-			/**是否显示新增弹窗 */
-			addVisible: false,
     }
   },
   created() {
@@ -139,62 +124,43 @@ export default {
   methods: {
     //返回上一页面
     goBack() {
-      let ss =this.$router
       this.$store.dispatch('tagsView/delView', this.$route)
       this.$router.go(-1)
     },
+    //搜索
+    handleFilter() {
+      this.listQuery.index = 1
+      this.getDataList()
+    },
     /**请求列表数据 */
     getDataList() {
-
+      this.loading = true
+      getInfoList(this.listQuery).then(response => {
+        if (response.code === 200) {
+          this.data = response.data
+          this.total = response.total
+          this.loading = false
+        } else {
+          this.loading = false
+          return this.$message.error(response.message)
+        }
+      })
     },
 		// 分页, 每页条数
     pageSizeChangeHandle (val) {
-      this.listQuery.page = 1
-      this.listQuery.limit = val
+      this.listQuery.index = 1
+      this.listQuery.length = val
       this.getDataList()
     },
     // 分页, 当前页
     pageCurrentChangeHandle (val) {
-      this.listQuery.page = val
+      this.listQuery.index = val
       this.getDataList()
     },
 
-		//打开新增弹窗
-		cerateHandle() {
-			this.addVisible = true
-			this.$nextTick(() => {
-				this.$refs.create.init()
-			});
-		},
-
-    /**跳转批次入库页面 */
+    /**跳转入库页面 */
     gotoHandle() {
       this.$router.push('/device/storage/warehousing')
-    },
-
-    fetchData() {
-      this.page.loading = false
-      postJson('/api/v1/carinfo/pageQuery', this.page.param).then(response => {
-        if (response.code === 200) {
-          this.page.data = response.data
-          this.page.total = response.total
-          this.page.loading = false
-        }
-      })
-    },
-
-    del(val) {
-      this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        postJson('/api/v1/carinfo/delete', { id: val }).then(response => {
-          if (response.code === 200) {
-            this.fetchData()
-          }
-        })
-      })
     }
   }
 }

+ 12 - 40
src/views/device/storage/warehousing.vue

@@ -20,7 +20,6 @@
 			:cell-style="{'text-align':'center'}"
       fit
       highlight-current-row
-      @sort-change="sortChange"
 			@selection-change="handleSelectionChange"
     >
 			<el-table-column
@@ -84,12 +83,10 @@
       </el-table-column>
     </el-table>
 
-		<el-pagination style="float: right; margin-top: 30px;" :current-page="listQuery.page" :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.limit" :total="listQuery.total"
+		<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>
-
-		<Create v-if="addVisible" ref="create" @refreshDataList="getDataList"></Create>
   </div>
 </template>
 
@@ -101,33 +98,21 @@ export default {
   components: { Create },
   data() {
     return {
-      page: {
-        loading: false,
-        data: [
-					{code: 'SZRLCG20210001', total: 100, type: '二轮车', disabled: false, dt: '美顺', into: 0, create: '张三', address: '北京', to: '2021-05-18', intime: '2021-05-18 13:13:32',id: 'asdasdas'},
-					{code: 'SZRLCG20210001', total: 100, type: '二轮车', disabled: true, dt: '美顺', into: 0, create: '张三', address: '北京', to: '2021-05-18', intime: '2021-05-18 13:13:32',id: 'asdasdas'},
-					{code: 'SZRLCG20210001', total: 100, type: '二轮车', disabled: false, dt: '美顺', into: 0, create: '张三', address: '北京', to: '2021-05-18', intime: '2021-05-18 13:13:32',id: 'asdasdas'},
-					{code: 'SZRLCG20210001', total: 100, type: '二轮车', disabled: false, dt: '美顺', into: 0, create: '张三', address: '北京', to: '2021-05-18', intime: '2021-05-18 13:13:32',id: 'asdasdas'}
-				],
-        param: {
-          index: 1,
-          length: 10,
-          sort: 'updateTime desc',
-          plateNumber: ''
-        }
-      },
+      //列表加载动画
+      loading: false,
+      //列表数据
+      data: [],
+      //总套数
+      total: 0,
 			/**查询条件对象 */
 			listQuery: {
-        page: 1,
-        limit: 20,
-				total: 3,
+        index: 1,
+        length: 20,
         importance: undefined,
         title: undefined,
         type: undefined,
         sort: '+id'
       },
-			/**是否显示新增弹窗 */
-			addVisible: false,
 			/**批量选中的数据列表 */
 			multipleSelection: [],
     }
@@ -147,29 +132,16 @@ export default {
     },
 		// 分页, 每页条数
     pageSizeChangeHandle (val) {
-      this.listQuery.page = 1
-      this.listQuery.limit = val
+      this.listQuery.index = 1
+      this.listQuery.length = val
       this.getDataList()
     },
     // 分页, 当前页
     pageCurrentChangeHandle (val) {
-      this.listQuery.page = val
+      this.listQuery.index = val
       this.getDataList()
     },
 
-		//打开新增弹窗
-		cerateHandle() {
-			this.addVisible = true
-			this.$nextTick(() => {
-				this.$refs.create.init()
-			});
-		},
-
-    /**跳转批次入库页面 */
-    gotoHandle() {
-      this.$router.push('/device/storage/batchWarehousing')
-    },
-
 		/**批量选择表格数据 */
 		handleSelectionChange(val) {
 			this.multipleSelection = val