|
@@ -19,7 +19,7 @@ import { exportExcel } from '@/libs/util'
|
|
|
import { GetOutStockPageList } from '@/api/stock'
|
|
|
import axios from 'axios'
|
|
|
import MyForm from './my-form'
|
|
|
-import MyTable from '_c/my-table/my-table'
|
|
|
+import MyTable from '_c/my-table/my-table2'
|
|
|
import { GetUserPageList } from '@/api/user'
|
|
|
// import poptipTxet from './poptip-text.vue'
|
|
|
export default {
|
|
@@ -76,7 +76,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
title: '领料人',
|
|
|
- key: 'userName',
|
|
|
+ key: 'realName',
|
|
|
minWidth: 150
|
|
|
},
|
|
|
// {
|
|
@@ -86,12 +86,15 @@ export default {
|
|
|
// },
|
|
|
{
|
|
|
title: '出库类型',
|
|
|
- key: 'outStockType',
|
|
|
- minWidth: 150
|
|
|
+ key: 'stockChangeType',
|
|
|
+ minWidth: 150,
|
|
|
+ render: (h, params) => {
|
|
|
+ return h('span', {}, params.row.stockChangeType == 20 ? '出库' : params.row.stockChangeType == 26 ? '退货出库' : '报废出库' )
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title: '出库时间',
|
|
|
- key: 'outDate',
|
|
|
+ key: 'createdTime',
|
|
|
minWidth: 150
|
|
|
},
|
|
|
{
|
|
@@ -99,7 +102,7 @@ export default {
|
|
|
key: 'tagQuantity',
|
|
|
minWidth: 150,
|
|
|
render: (h, params) => {
|
|
|
- const arr = params.row.detailItems
|
|
|
+ const arr = params.row.detailsList
|
|
|
return h('div', [
|
|
|
h(
|
|
|
'Poptip',
|
|
@@ -117,7 +120,7 @@ export default {
|
|
|
click: () => {}
|
|
|
}
|
|
|
},
|
|
|
- params.row.tagQuantity
|
|
|
+ params.row.detailsList.length
|
|
|
),
|
|
|
h(
|
|
|
'div',
|
|
@@ -137,7 +140,7 @@ export default {
|
|
|
{ style: { marginRight: '30px' } },
|
|
|
'RFID:' + item.rfidCode
|
|
|
),
|
|
|
- h('span', '数量:' + item.quantity)
|
|
|
+ h('span', '数量:' + item.changeNum)
|
|
|
])
|
|
|
]
|
|
|
})
|
|
@@ -150,7 +153,16 @@ export default {
|
|
|
{
|
|
|
title: '出库数量',
|
|
|
key: 'quantity',
|
|
|
- minWidth: 150
|
|
|
+ minWidth: 150,
|
|
|
+ render: (h, params) => {
|
|
|
+ let _this = this
|
|
|
+ var total = 0
|
|
|
+ for (let i = 0; i < params.row.detailsList.length; i++) {
|
|
|
+ const element = params.row.detailsList[i];
|
|
|
+ total = total + Number(element.changeNum)
|
|
|
+ }
|
|
|
+ return h('span', {}, total)
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title: '备注',
|
|
@@ -163,11 +175,13 @@ export default {
|
|
|
{
|
|
|
name: 'Input',
|
|
|
value: 'key',
|
|
|
- placeholder: '请输入关键字'
|
|
|
+ placeholder: '请输入关键字',
|
|
|
+ width:'140px'
|
|
|
},
|
|
|
{
|
|
|
name: 'Select',
|
|
|
value: 'stockChangeType',
|
|
|
+ width: '150px',
|
|
|
placeholder: '请选择出库类型',
|
|
|
list: [
|
|
|
{ label: '出库', value: 20 },
|
|
@@ -179,14 +193,15 @@ export default {
|
|
|
name: 'Select',
|
|
|
value: 'userId',
|
|
|
placeholder: '请选择领料人',
|
|
|
+ width: '150px',
|
|
|
list: []
|
|
|
},
|
|
|
{
|
|
|
name: 'DatePicker',
|
|
|
- type: 'daterange',
|
|
|
+ type: 'datetimerangeCopy',
|
|
|
placeholder: '请选择时间',
|
|
|
- width: '200px',
|
|
|
- value: 'date'
|
|
|
+ width: '300px',
|
|
|
+ value: 'date',
|
|
|
},
|
|
|
{
|
|
|
name: 'Button',
|
|
@@ -221,7 +236,9 @@ export default {
|
|
|
params: {
|
|
|
pageIndex: 1,
|
|
|
pageSize: 20,
|
|
|
- total: 0
|
|
|
+ total: 0,
|
|
|
+ beginTime:this.$dayjs(new Date).format('YYYY-MM-DD') + ' 00:00',
|
|
|
+ endTime:this.$dayjs(new Date).format('YYYY-MM-DD') + ' 23:45',
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -253,36 +270,42 @@ export default {
|
|
|
eventHandle (option) {
|
|
|
console.log('????????')
|
|
|
console.log(option)
|
|
|
+ if(option.date[0] && option._evnet == 'datetimerangeCopy'){
|
|
|
+ this.params.beginTime = option.date[0]
|
|
|
+ this.params.endTime = option.date[1]
|
|
|
+ }
|
|
|
switch (option._evnet) {
|
|
|
+ case '"datetimerangeCopy"':
|
|
|
+
|
|
|
+
|
|
|
+ break
|
|
|
case 'search':
|
|
|
this.params.pageIndex = 1
|
|
|
this.params.key = option.key
|
|
|
- option.date[0]
|
|
|
- ? (this.params.beginTime =
|
|
|
- this.$dayjs(option.date[0]).format('YYYY-MM-DD') || '')
|
|
|
- : (this.params.beginTime = '')
|
|
|
- option.date[1]
|
|
|
- ? (this.params.endTime =
|
|
|
- this.$dayjs(option.date[1]).format('YYYY-MM-DD') || '')
|
|
|
- : (this.params.endTime = '')
|
|
|
this.params.takeState = option.takeState
|
|
|
this.params.stockChangeType = option.stockChangeType
|
|
|
this.params.userId = option.userId
|
|
|
- this.getList()
|
|
|
+ console.log(this.params)
|
|
|
+ this.getList(this.params)
|
|
|
break
|
|
|
case 'export':
|
|
|
- GetOutStockPageList({
|
|
|
- ...this.params,
|
|
|
- key: this.params.key || this.key,
|
|
|
- pageIndex: 1,
|
|
|
+
|
|
|
+ axios.post('/cloudApi/stockWater/outPage', {
|
|
|
+ stockChangeType:this.params.stockChangeType,
|
|
|
+ keyword:this.params.key,
|
|
|
+ operUserId:this.params.userId,
|
|
|
+ beginTime:this.params.beginTime || this.$dayjs(new Date).format('YYYY-MM-DD') + ' 00:00:00',
|
|
|
+ endTime:this.params.endTime || this.$dayjs(new Date).format('YYYY-MM-DD') + ' 23:59:59',
|
|
|
+ pageNum: 1,
|
|
|
pageSize: 99999
|
|
|
- }).then(res => {
|
|
|
- if (res.code === 0) {
|
|
|
- let data = res.result.outStockPageList.list
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.data.code == 200){
|
|
|
+ let data = res.data.data.records
|
|
|
if (data.length < 1) return this.$Message.error('数据为空!')
|
|
|
exportExcel(this.columns, data, '出库记录')
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
break
|
|
|
}
|
|
|
},
|
|
@@ -320,23 +343,52 @@ export default {
|
|
|
// }
|
|
|
// })
|
|
|
},
|
|
|
- getList () {
|
|
|
- GetOutStockPageList({
|
|
|
- ...this.params,
|
|
|
- key: this.params.key || this.key
|
|
|
- }).then(res => {
|
|
|
- if (res.code === 0) {
|
|
|
- this.tableFilter[6].text = '出库总数量:' + res.result.totalQty || 0
|
|
|
- this.tableFilter[7].text = '出库件数:' + res.result.totalCount || 0
|
|
|
- this.data = res.result.outStockPageList.list
|
|
|
- this.params.total = res.result.outStockPageList.totalCount
|
|
|
+ getList (params) {
|
|
|
+ console.log(params)
|
|
|
+ axios.post('/cloudApi/stockWater/outPage', {
|
|
|
+ stockChangeType:this.params.stockChangeType,
|
|
|
+ keyword:this.params.key,
|
|
|
+ operUserId:this.params.userId,
|
|
|
+ beginTime:this.params.beginTime,
|
|
|
+ endTime:this.params.endTime,
|
|
|
+ pageNum: this.params.pageIndex,
|
|
|
+ pageSize: this.params.pageSize
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.data.code == 200){
|
|
|
+
|
|
|
+ this.params.total = res.data.data.total
|
|
|
+ this.data = res.data.data.records
|
|
|
+ }
|
|
|
+ })
|
|
|
+ axios.post('/cloudApi/stockWater/outStatistics', {
|
|
|
+ stockChangeType:this.params.stockChangeType,
|
|
|
+ keyword:this.params.key,
|
|
|
+ operUserId:this.params.userId,
|
|
|
+ beginTime:this.params.beginTime,
|
|
|
+ endTime:this.params.endTime,
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.data.code == 200){
|
|
|
+ console.log(res.data)
|
|
|
+ this.tableFilter[6].text = res.data.data.sum ? '出库总数量:' + res.data.data.sum : '出库总数量:' + 0
|
|
|
+ this.tableFilter[7].text = '出库件数:' + res.data.data.count || 0
|
|
|
}
|
|
|
})
|
|
|
+ // GetOutStockPageList({
|
|
|
+ // ...this.params,
|
|
|
+ // key: this.params.key || this.key
|
|
|
+ // }).then(res => {
|
|
|
+ // if (res.code === 0) {
|
|
|
+ // this.tableFilter[6].text = '出库总数量:' + res.result.totalQty || 0
|
|
|
+ // this.tableFilter[7].text = '出库件数:' + res.result.totalCount || 0
|
|
|
+ // this.data = res.result.outStockPageList.list
|
|
|
+ // this.params.total = res.result.outStockPageList.totalCount
|
|
|
+ // }
|
|
|
+ // })
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
this.key = this.$route.query.materialCode
|
|
|
- // this.getList()
|
|
|
+ this.getList()
|
|
|
this.getUserPageList()
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.table.setModel('date', [new Date(), new Date()])
|