给采购入库和销售出库关联单据的时候自动加载默认的仓库id
This commit is contained in:
@@ -132,6 +132,7 @@
|
||||
discountMoney: '',
|
||||
deposit: '',
|
||||
remark: '',
|
||||
defaultDepotId: '',
|
||||
queryParam: {
|
||||
number: "",
|
||||
materialParam: "",
|
||||
@@ -254,6 +255,7 @@
|
||||
},
|
||||
handleOk () {
|
||||
if(this.selectType === 'list') {
|
||||
this.getDepotByCurrentUser()
|
||||
this.getSelectBillRows();
|
||||
this.selectType = 'detail'
|
||||
this.title = "选择单据明细"
|
||||
@@ -269,7 +271,7 @@
|
||||
} else {
|
||||
if(this.selectedDetailRowKeys.length) {
|
||||
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()
|
||||
} else {
|
||||
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) {
|
||||
return {
|
||||
on: {
|
||||
|
||||
@@ -433,7 +433,7 @@
|
||||
this.$refs.linkBillList.show('其它', '采购订单', '供应商', "1,3")
|
||||
this.$refs.linkBillList.title = "选择采购订单"
|
||||
},
|
||||
linkBillListOk(selectBillDetailRows, linkNumber, organId, discountMoney, deposit, remark) {
|
||||
linkBillListOk(selectBillDetailRows, linkNumber, organId, discountMoney, deposit, remark, depotId) {
|
||||
this.rowCanEdit = false
|
||||
this.materialTable.columns[1].type = FormTypes.normal
|
||||
this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
|
||||
@@ -450,6 +450,7 @@
|
||||
info.taxMoney = (info.allPrice*taxRate/100).toFixed(2)-0
|
||||
info.taxLastMoney = (info.allPrice + info.taxMoney).toFixed(2)-0
|
||||
}
|
||||
info.depotId = depotId ? depotId:''
|
||||
info.linkId = info.id
|
||||
allTaxLastMoney += info.taxLastMoney
|
||||
listEx.push(info)
|
||||
|
||||
@@ -451,7 +451,7 @@
|
||||
this.$refs.linkBillList.show('其它', '销售订单', '客户', "1,3")
|
||||
this.$refs.linkBillList.title = "选择销售订单"
|
||||
},
|
||||
linkBillListOk(selectBillDetailRows, linkNumber, organId, discountMoney, deposit, remark) {
|
||||
linkBillListOk(selectBillDetailRows, linkNumber, organId, discountMoney, deposit, remark, depotId) {
|
||||
this.rowCanEdit = false
|
||||
this.materialTable.columns[1].type = FormTypes.normal
|
||||
this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
|
||||
@@ -468,6 +468,7 @@
|
||||
info.taxMoney = (info.allPrice*taxRate/100).toFixed(2)-0
|
||||
info.taxLastMoney = (info.allPrice + info.taxMoney).toFixed(2)-0
|
||||
}
|
||||
info.depotId = depotId ? depotId:''
|
||||
info.linkId = info.id
|
||||
allTaxLastMoney += info.taxLastMoney
|
||||
listEx.push(info)
|
||||
|
||||
Reference in New Issue
Block a user