asd26269546 2 年 前
コミット
05fda1bc3b

+ 30 - 19
src/view/store-manage/store-material/store-material.vue

@@ -26,7 +26,7 @@ import MyTable from '_c/my-table/my-table'
 import MyForm from './my-form'
 import WriteForm from './write-form'
 import WriteListForm from './write-list-form'
-
+import axios from 'axios'
 export default {
   name: 'test',
   components: {
@@ -59,12 +59,12 @@ export default {
         },
         {
           title: '物料编码',
-          key: 'materialCode',
+          key: 'materialcode',
           minWidth: 150
         },
         {
           title: '物料名称',
-          key: 'materialName',
+          key: 'name',
           minWidth: 150,
           sortable: true
         },
@@ -75,7 +75,7 @@ export default {
         },
         {
           title: '单位',
-          key: 'unitName',
+          key: 'stockunitid',
           minWidth: 100
         },
         {
@@ -230,7 +230,7 @@ export default {
         // }
       ],
       params: {
-        pageIndex: 1,
+        pageNum: 1,
         pageSize: 20,
         total: 0
       }
@@ -268,8 +268,8 @@ export default {
     eventHandle (option) {
       switch (option._evnet) {
         case 'search':
-          this.params.pageIndex = 1
-          this.params.keyWord = option.key
+          this.params.pageNum = 1
+          this.params.keyword = option.key
           this.params.hadPrinter = !!option.hadPrinter
           this.getList()
           break
@@ -277,7 +277,7 @@ export default {
           if (this.data.length < 1) return this.$Message.error('数据为空!')
           GetStockDataPageList({
             ...this.params,
-            pageIndex: 1,
+            pageNum: 1,
             pageSize: 999999
           }).then(res => {
             if (res.code === 0) {
@@ -307,20 +307,31 @@ export default {
           break
       }
     },
-    changePage (pageIndex) {
-      this.params.pageIndex = pageIndex
+    changePage (pageNum) {
+      this.params.pageNum = pageNum
       this.getList()
     },
     getList () {
-      GetStockDataPageList(this.params).then(res => {
-        if (res.code === 0) {
-          this.data = res.result.list
-          this.data.forEach(item => {
-            item.id = item.materialCode
-          })
-          this.params.total = res.result.totalCount
-        }
-      })
+      const v = this
+      axios.post('/cloudApi/stock/materialStock',{...this.params}).then(res=>{
+        console.log(res)
+          if (res.data.code == 200) {
+            this.data = res.data.data.records
+            this.data.forEach(item => {
+              item.id = item.materialcode
+            })
+            this.params.total = res.data.data.total
+          }
+        })
+      // GetStockDataPageList(this.params).then(res => {
+      //   if (res.code === 0) {
+      //     this.data = res.result.list
+      //     this.data.forEach(item => {
+      //       item.id = item.materialCode
+      //     })
+      //     this.params.total = res.result.totalCount
+      //   }
+      // })
     }
   },
   mounted () {

+ 22 - 2
src/view/system-manage/store-update/store-update.vue

@@ -22,7 +22,7 @@ import { exportExcel } from '@/libs/util'
 import { GetStockTagDetialPageList, StockTagOut, UpdateStockTagQty } from '@/api/stock'
 import MyTable from '_c/my-table/my-table'
 import MyForm from './my-form'
-
+import axios from 'axios'
 export default {
   name: 'test',
   components: {
@@ -164,15 +164,35 @@ export default {
   },
   methods: {
     select (selection, data) {
+      console.log(data)
       // this.selectList = data
       if (selection.length > 0) {
-        this.id = data.id
+        this.id = data.rfidCode
       } else {
         this.id = ''
       }
     },
     cfm (formData) {
+      const v = this
       if (this.storeType === '出库') {
+        console.log(formData,this.id)
+        axios.post('/cloudApi/stock/out',{
+          userId: formData.userId,
+					plcCode: 1,
+					rfidItems:[this.id],
+					//rfidItems: this.scanList.map(item => item.rfidCode),
+					stockChangeType: 20,
+					remark: this.remark,
+					device:2,
+        }).then(res=>{
+          if (res.data.code == 200) {
+            v.$Message.info('操作成功')
+            this.id = ''
+            this.show = false
+            v.getList()
+          }
+        })
+        return
         StockTagOut({
           id: this.id,
           ...formData