|
@@ -12,8 +12,7 @@
|
|
|
:total="ipagination.total"
|
|
|
:openType="openType"
|
|
|
:stockType="stockType"
|
|
|
- @getForm="getForm"
|
|
|
- @clear="onClearList"
|
|
|
+ @changeForm="handleChangeForm"
|
|
|
></edit-form>
|
|
|
<div>
|
|
|
<a-button v-if="form.taskType === 2" style="margin-bottom: 6px" type="primary" @click="onChangeGoods"
|
|
@@ -25,17 +24,17 @@
|
|
|
size="middle"
|
|
|
bordered
|
|
|
rowKey="id"
|
|
|
+ :scroll="{ x: 'max-content'}"
|
|
|
:columns="columns"
|
|
|
:dataSource="dataSource"
|
|
|
:loading="loading"
|
|
|
- :scroll="{ y: 500 }"
|
|
|
:pagination="ipagination"
|
|
|
@change="handleTableChange"
|
|
|
>
|
|
|
<span v-if="isShowBtn" slot="action" slot-scope="text, record">
|
|
|
<!-- <a-divider type="vertical" /> -->
|
|
|
<a-popconfirm @confirm="handleDelete(record)" title="确定删除吗?">
|
|
|
- <a>删除</a>
|
|
|
+ <a v-if="form.taskType!=1">删除</a>
|
|
|
</a-popconfirm>
|
|
|
</span>
|
|
|
<template slot="inventory" slot-scope="value, record">
|
|
@@ -179,6 +178,10 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
onChangeGoods() {
|
|
|
+ if(!this.form.depotId){
|
|
|
+ this.$message.warning('请选择仓库!')
|
|
|
+ return
|
|
|
+ }
|
|
|
// this.$refs.selectModal.queryParam.depotId = this.form.depotId
|
|
|
this.$refs.selectModal.showModal()
|
|
|
},
|
|
@@ -224,6 +227,8 @@ export default {
|
|
|
materialExtendIdList,
|
|
|
})
|
|
|
this.getForm(form.getFieldsValue())
|
|
|
+ console.log('this.dataSource',this.dataSource)
|
|
|
+ console.log('this.columns',this.columns)
|
|
|
})
|
|
|
})
|
|
|
},
|
|
@@ -232,11 +237,13 @@ export default {
|
|
|
.split(',')
|
|
|
.filter((item) => item)
|
|
|
.join(',')
|
|
|
- console.log('rows', rows)
|
|
|
- console.log('ids', ids)
|
|
|
- console.log('str===', str)
|
|
|
+ if(!this.form.depotId){
|
|
|
+ this.$message.warning('请选择仓库!')
|
|
|
+ return
|
|
|
+ }
|
|
|
getAction('/materialBatch/findBatchNumbersByBarCode',{
|
|
|
barCodes: str,
|
|
|
+ depotId:this.form.depotId
|
|
|
}).then((res) => {
|
|
|
const batchStr = res.data.split(',')
|
|
|
.filter((item) => item)
|
|
@@ -246,8 +253,13 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
findAllSelect() {
|
|
|
- // const params = { ...this.$refs.selectModal.queryParam }
|
|
|
- getAction('/materialBatch/findBatchNumbersByBarCode').then((res) => {
|
|
|
+ if(!this.form.depotId){
|
|
|
+ this.$message.warning('请选择仓库!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ getAction('/materialBatch/findBatchNumbersByBarCode',{
|
|
|
+ depotId:this.form.depotId
|
|
|
+ }).then((res) => {
|
|
|
this.$refs.selectModal.close()
|
|
|
const batchStr = res.data.split(',')
|
|
|
.filter((item) => item)
|
|
@@ -265,6 +277,9 @@ export default {
|
|
|
}
|
|
|
getAction(`/material/getMaterialByBatchNumber?currentPage=${this.ipagination.current}&pageSize=${this.ipagination.pageSize}`, params).then((res) => {
|
|
|
this.dataSource = res.data.rows
|
|
|
+ if(this.dataSource.length===0){
|
|
|
+ this.$message.warning('暂无数据!')
|
|
|
+ }
|
|
|
this.ipagination.total = Number(res.data.total)
|
|
|
this.dataSource = this.dataSource.reduce((acc, cur) => {
|
|
|
const hasDuplicate = acc.some((item) => item.batchNumber === cur.batchNumber)
|
|
@@ -284,7 +299,7 @@ export default {
|
|
|
this.dataSource = this.dataSource.filter((item) => item.batchNumber !== record.batchNumber)
|
|
|
},
|
|
|
|
|
|
- onClearList(val) {
|
|
|
+ handleChangeForm(val) {
|
|
|
this.dataSource = []
|
|
|
this.ipagination.current = 1
|
|
|
this.ipagination.total = 0
|
|
@@ -301,7 +316,11 @@ export default {
|
|
|
if (pagination && pagination.current) {
|
|
|
this.ipagination = pagination
|
|
|
}
|
|
|
- this.getBatchData()
|
|
|
+ if(this.openType=='add'){
|
|
|
+ this.getBatchData()
|
|
|
+ }else{
|
|
|
+ this.getList(this.taskId)
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
}
|