给采购入库和销售出库关联单据的时候自动加载默认的仓库id

This commit is contained in:
jishenghua
2024-02-03 23:20:20 +08:00
parent 6d2cd8af63
commit 847acce9a4
3 changed files with 23 additions and 3 deletions

View File

@@ -132,6 +132,7 @@
discountMoney: '', discountMoney: '',
deposit: '', deposit: '',
remark: '', remark: '',
defaultDepotId: '',
queryParam: { queryParam: {
number: "", number: "",
materialParam: "", materialParam: "",
@@ -254,6 +255,7 @@
}, },
handleOk () { handleOk () {
if(this.selectType === 'list') { if(this.selectType === 'list') {
this.getDepotByCurrentUser()
this.getSelectBillRows(); this.getSelectBillRows();
this.selectType = 'detail' this.selectType = 'detail'
this.title = "选择单据明细" this.title = "选择单据明细"
@@ -269,7 +271,7 @@
} else { } else {
if(this.selectedDetailRowKeys.length) { if(this.selectedDetailRowKeys.length) {
this.getSelectBillDetailRows() this.getSelectBillDetailRows()
this.$emit('ok', this.selectBillDetailRows, this.linkNumber, this.organId, this.discountMoney, this.deposit, this.remark) this.$emit('ok', this.selectBillDetailRows, this.linkNumber, this.organId, this.discountMoney, this.deposit, this.remark, this.defaultDepotId)
this.close() this.close()
} else { } else {
this.$message.warning('抱歉,请选择单据明细!') this.$message.warning('抱歉,请选择单据明细!')
@@ -349,6 +351,22 @@
} }
} }
}, },
//加载默认仓库id
getDepotByCurrentUser() {
getAction('/depot/findDepotByCurrentUser').then((res) => {
if (res.code === 200) {
if (res.data.length === 1) {
this.defaultDepotId = res.data[0].id+''
} else {
for (let i = 0; i < res.data.length; i++) {
if(res.data[i].isDefault){
this.defaultDepotId = res.data[i].id+''
}
}
}
}
})
},
rowAction(record, index) { rowAction(record, index) {
return { return {
on: { on: {

View File

@@ -433,7 +433,7 @@
this.$refs.linkBillList.show('其它', '采购订单', '供应商', "1,3") this.$refs.linkBillList.show('其它', '采购订单', '供应商', "1,3")
this.$refs.linkBillList.title = "选择采购订单" this.$refs.linkBillList.title = "选择采购订单"
}, },
linkBillListOk(selectBillDetailRows, linkNumber, organId, discountMoney, deposit, remark) { linkBillListOk(selectBillDetailRows, linkNumber, organId, discountMoney, deposit, remark, depotId) {
this.rowCanEdit = false this.rowCanEdit = false
this.materialTable.columns[1].type = FormTypes.normal this.materialTable.columns[1].type = FormTypes.normal
this.changeFormTypes(this.materialTable.columns, 'preNumber', 1) this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
@@ -450,6 +450,7 @@
info.taxMoney = (info.allPrice*taxRate/100).toFixed(2)-0 info.taxMoney = (info.allPrice*taxRate/100).toFixed(2)-0
info.taxLastMoney = (info.allPrice + info.taxMoney).toFixed(2)-0 info.taxLastMoney = (info.allPrice + info.taxMoney).toFixed(2)-0
} }
info.depotId = depotId ? depotId:''
info.linkId = info.id info.linkId = info.id
allTaxLastMoney += info.taxLastMoney allTaxLastMoney += info.taxLastMoney
listEx.push(info) listEx.push(info)

View File

@@ -451,7 +451,7 @@
this.$refs.linkBillList.show('其它', '销售订单', '客户', "1,3") this.$refs.linkBillList.show('其它', '销售订单', '客户', "1,3")
this.$refs.linkBillList.title = "选择销售订单" this.$refs.linkBillList.title = "选择销售订单"
}, },
linkBillListOk(selectBillDetailRows, linkNumber, organId, discountMoney, deposit, remark) { linkBillListOk(selectBillDetailRows, linkNumber, organId, discountMoney, deposit, remark, depotId) {
this.rowCanEdit = false this.rowCanEdit = false
this.materialTable.columns[1].type = FormTypes.normal this.materialTable.columns[1].type = FormTypes.normal
this.changeFormTypes(this.materialTable.columns, 'preNumber', 1) this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
@@ -468,6 +468,7 @@
info.taxMoney = (info.allPrice*taxRate/100).toFixed(2)-0 info.taxMoney = (info.allPrice*taxRate/100).toFixed(2)-0
info.taxLastMoney = (info.allPrice + info.taxMoney).toFixed(2)-0 info.taxLastMoney = (info.allPrice + info.taxMoney).toFixed(2)-0
} }
info.depotId = depotId ? depotId:''
info.linkId = info.id info.linkId = info.id
allTaxLastMoney += info.taxLastMoney allTaxLastMoney += info.taxLastMoney
listEx.push(info) listEx.push(info)