|
@@ -9,7 +9,7 @@
|
|
|
:rules="rules"
|
|
|
:stockVisible="stockVisible"
|
|
|
ref="editForm"
|
|
|
- :total="dataSource.length || 0"
|
|
|
+ :total="ipagination.total"
|
|
|
:openType="openType"
|
|
|
:stockType="stockType"
|
|
|
@getForm="getForm"
|
|
@@ -29,7 +29,7 @@
|
|
|
:dataSource="dataSource"
|
|
|
:loading="loading"
|
|
|
:scroll="{ y: 500 }"
|
|
|
- :pagination="false"
|
|
|
+ :pagination="ipagination"
|
|
|
@change="handleTableChange"
|
|
|
>
|
|
|
<span v-if="isShowBtn" slot="action" slot-scope="text, record">
|
|
@@ -126,6 +126,7 @@ export default {
|
|
|
form: {},
|
|
|
isShow: false,
|
|
|
stockType: 'task',
|
|
|
+ batchNumberStr: ''
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -230,32 +231,39 @@ export default {
|
|
|
.filter((item) => item)
|
|
|
.join(',')
|
|
|
console.log('rows', rows)
|
|
|
+ console.log('ids', ids)
|
|
|
+ console.log('str===', str)
|
|
|
getAction('/materialBatch/findBatchNumbersByBarCode',{
|
|
|
barCodes: str,
|
|
|
}).then((res) => {
|
|
|
- this.getBatchData(res.data)
|
|
|
+ const batchStr = res.data.split(',')
|
|
|
+ .filter((item) => item)
|
|
|
+ .join(',')
|
|
|
+ this.batchNumberStr = batchStr
|
|
|
+ this.getBatchData()
|
|
|
})
|
|
|
},
|
|
|
findAllSelect() {
|
|
|
// const params = { ...this.$refs.selectModal.queryParam }
|
|
|
getAction('/materialBatch/findBatchNumbersByBarCode').then((res) => {
|
|
|
this.$refs.selectModal.close()
|
|
|
- this.getBatchData(res.data)
|
|
|
- })
|
|
|
- },
|
|
|
- getBatchData(val) {
|
|
|
- const batchStr = val
|
|
|
- .split(',')
|
|
|
+ const batchStr = res.data.split(',')
|
|
|
.filter((item) => item)
|
|
|
.join(',')
|
|
|
+ this.batchNumberStr = batchStr
|
|
|
+ this.getBatchData()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getBatchData() {
|
|
|
const params = {
|
|
|
- batchNumber: batchStr,
|
|
|
- organId: '',
|
|
|
- mpList: '',
|
|
|
- prefixNo: '',
|
|
|
+ batchNumber: this.batchNumberStr,
|
|
|
+ // organId: '',
|
|
|
+ // mpList: '',
|
|
|
+ // prefixNo: '',
|
|
|
}
|
|
|
- getMaterialByBatchNumber(params).then((res) => {
|
|
|
- this.dataSource.push(...res.data)
|
|
|
+ getAction(`/material/getMaterialByBatchNumber?currentPage=${this.ipagination.current}&pageSize=${this.ipagination.pageSize}`, params).then((res) => {
|
|
|
+ this.dataSource = res.data.rows
|
|
|
+ this.ipagination.total = Number(res.data.total)
|
|
|
this.dataSource = this.dataSource.reduce((acc, cur) => {
|
|
|
const hasDuplicate = acc.some((item) => item.batchNumber === cur.batchNumber)
|
|
|
if (!hasDuplicate) {
|
|
@@ -276,6 +284,8 @@ export default {
|
|
|
|
|
|
onClearList(val) {
|
|
|
this.dataSource = []
|
|
|
+ this.ipagination.current = 1
|
|
|
+ this.ipagination.total = 0
|
|
|
this.getForm(val)
|
|
|
if (val.taskType === 1) {
|
|
|
this.findAllSelect()
|
|
@@ -285,7 +295,12 @@ export default {
|
|
|
handleDrag() {},
|
|
|
// ipagination() {},
|
|
|
|
|
|
- handleTableChange() {},
|
|
|
+ handleTableChange(pagination) {
|
|
|
+ if (pagination && pagination.current) {
|
|
|
+ this.ipagination = pagination
|
|
|
+ }
|
|
|
+ this.getBatchData()
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|