如果仓库只有1个,直接给单据进行默认选中

This commit is contained in:
季圣华 2023-02-13 23:08:42 +08:00
parent 0a07c88b19
commit 5f83ac5bc0

View File

@ -329,9 +329,13 @@ export const BillModalMixin = {
getAction('/depot/findDepotByCurrentUser').then((res) => {
if (res.code === 200) {
let arr = res.data
for (let i = 0; i < arr.length; i++) {
if(arr[i].isDefault){
target.setValues([{rowKey: row.id, values: {depotId: arr[i].id+''}}])
if(arr.length===1) {
target.setValues([{rowKey: row.id, values: {depotId: arr[0].id+''}}])
} else {
for (let i = 0; i < arr.length; i++) {
if(arr[i].isDefault){
target.setValues([{rowKey: row.id, values: {depotId: arr[i].id+''}}])
}
}
}
}