|
@@ -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 () {
|