|
|
@ -297,26 +297,21 @@ export default {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const data = JSON.parse(JSON.stringify(this.currentRow))
|
|
|
|
const data = JSON.parse(JSON.stringify(this.currentRow))
|
|
|
|
|
|
|
|
const id = data.index
|
|
|
|
delete data.status
|
|
|
|
delete data.status
|
|
|
|
|
|
|
|
delete data.index
|
|
|
|
bind_tmp_enter_warehouse(stringify({
|
|
|
|
bind_tmp_enter_warehouse(stringify({
|
|
|
|
'tmplate_content': JSON.stringify(data),
|
|
|
|
'tmplate_content': JSON.stringify(data),
|
|
|
|
'bar_code': newCode,
|
|
|
|
'bar_code': newCode,
|
|
|
|
'client_id': this.client_id_input
|
|
|
|
'client_id': this.client_id_input
|
|
|
|
})).then(res => {
|
|
|
|
})).then(res => {
|
|
|
|
if (res.status === 0) {
|
|
|
|
if (res.status === 0) {
|
|
|
|
let cindex = 0 // 记录成功后的下一个index
|
|
|
|
this.bindToDBData[id].status = true
|
|
|
|
this.$message.success('入库成功!')
|
|
|
|
this.$message.success('入库成功!')
|
|
|
|
this.bindToDBData = this.bindToDBData.map((item, index) => {
|
|
|
|
|
|
|
|
if (item.variety_id === this.currentRow.variety_id) {
|
|
|
|
|
|
|
|
item.status = true
|
|
|
|
|
|
|
|
cindex = index + 1
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return item
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
// 判断是否是最后一行,不是最后一行自动选择下一行
|
|
|
|
// 判断是否是最后一行,不是最后一行自动选择下一行
|
|
|
|
if (cindex <= this.bindToDBData.length - 1) {
|
|
|
|
if (id < this.bindToDBData.length - 1) {
|
|
|
|
// 将下一行自动选中
|
|
|
|
// 将下一行自动选中
|
|
|
|
this.$refs.singleTable.setCurrentRow(this.bindToDBData[cindex])
|
|
|
|
this.$refs.singleTable.setCurrentRow(this.bindToDBData[id + 1])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.$message.error('入库失败,请重试!')
|
|
|
|
this.$message.error('入库失败,请重试!')
|
|
|
@ -407,9 +402,13 @@ export default {
|
|
|
|
this.formVisible = false
|
|
|
|
this.formVisible = false
|
|
|
|
this.bindToDBData = []
|
|
|
|
this.bindToDBData = []
|
|
|
|
for (let i = 0; i < obj.num; i++) {
|
|
|
|
for (let i = 0; i < obj.num; i++) {
|
|
|
|
this.bindToDBData.push({ ...this.propsformdata, ...obj, 'status': false })
|
|
|
|
this.bindToDBData.push({ ...this.propsformdata, ...obj, 'status': false, 'index': i })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.client_id_input = obj.client_id
|
|
|
|
this.client_id_input = obj.client_id
|
|
|
|
|
|
|
|
// 自动选择第一行数据
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
|
|
this.$refs.singleTable.setCurrentRow(this.bindToDBData[0])
|
|
|
|
|
|
|
|
})
|
|
|
|
this.bindToDBVisible = true
|
|
|
|
this.bindToDBVisible = true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 处理选择试剂入库弹框关闭后数据留存问题
|
|
|
|
// 处理选择试剂入库弹框关闭后数据留存问题
|
|
|
@ -535,8 +534,9 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.bindToDBData = []
|
|
|
|
this.bindToDBData = []
|
|
|
|
this.multipleSelection.forEach(item => {
|
|
|
|
this.multipleSelection.forEach(item => {
|
|
|
|
this.bindToDBData.push(...JSON.parse(item.template_content).map(item => {
|
|
|
|
this.bindToDBData.push(...JSON.parse(item.template_content).map((item, index) => {
|
|
|
|
item.status = false
|
|
|
|
item.status = false
|
|
|
|
|
|
|
|
item.index = index
|
|
|
|
return item
|
|
|
|
return item
|
|
|
|
}))
|
|
|
|
}))
|
|
|
|
})
|
|
|
|
})
|
|
|
|