|
@@ -454,25 +454,25 @@ export const BillModalMixin = {
|
|
setTimeout(function () {
|
|
setTimeout(function () {
|
|
that.$refs.materialDataTable.resetScrollTop((target.rows.length + 1) * that.$refs.materialDataTable.rowHeight)
|
|
that.$refs.materialDataTable.resetScrollTop((target.rows.length + 1) * that.$refs.materialDataTable.rowHeight)
|
|
}, 1000)
|
|
}, 1000)
|
|
- if (this.currentSelectDepotId) {
|
|
|
|
- //如果单据选择过仓库,则直接从当前选择的仓库加载
|
|
|
|
- target.setValues([{ rowKey: row.id, values: { depotId: this.currentSelectDepotId } }])
|
|
|
|
- } else {
|
|
|
|
- getAction('/depot/findDepotByCurrentUser').then((res) => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- let arr = res.data
|
|
|
|
- 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 + '' } }])
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ // if (this.currentSelectDepotId) {
|
|
|
|
+ // //如果单据选择过仓库,则直接从当前选择的仓库加载
|
|
|
|
+ // target.setValues([{ rowKey: row.id, values: { depotId: this.currentSelectDepotId } }])
|
|
|
|
+ // } else {
|
|
|
|
+ // getAction('/depot/findDepotByCurrentUser').then((res) => {
|
|
|
|
+ // if (res.code === 200) {
|
|
|
|
+ // let arr = res.data
|
|
|
|
+ // 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 + '' } }])
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
//根据【仓库名】带出对应的【仓位货架】
|
|
//根据【仓库名】带出对应的【仓位货架】
|
|
async setProPosition(barCode, depotId, event){
|
|
async setProPosition(barCode, depotId, event){
|
|
@@ -517,11 +517,7 @@ export const BillModalMixin = {
|
|
console.log('row========', row)
|
|
console.log('row========', row)
|
|
// // 选择商品自动带出barCode、商品ID
|
|
// // 选择商品自动带出barCode、商品ID
|
|
if(row.depotId&&row.barCode){
|
|
if(row.depotId&&row.barCode){
|
|
- // console.log('row.depotId========', row.depotId)
|
|
|
|
// // 根据仓库id自动带出仓位货架(若有)参数:商品id、仓库id
|
|
// // 根据仓库id自动带出仓位货架(若有)参数:商品id、仓库id
|
|
- // getAction('/material/getPositionByDidAndMid',{mid:row.mid,did:row.depotId}).then((res) => {
|
|
|
|
- // console.log('res========', res)
|
|
|
|
- // })
|
|
|
|
this.setProPosition(row.barCode, row.depotId, event)
|
|
this.setProPosition(row.barCode, row.depotId, event)
|
|
}
|
|
}
|
|
break
|
|
break
|
|
@@ -617,6 +613,7 @@ export const BillModalMixin = {
|
|
getMaterialByBarCode(param).then((res) => {
|
|
getMaterialByBarCode(param).then((res) => {
|
|
if (res && res.code === 200) {
|
|
if (res && res.code === 200) {
|
|
let mList = res.data
|
|
let mList = res.data
|
|
|
|
+ console.log('mList======',mList)
|
|
target.getValues((error, values) => {
|
|
target.getValues((error, values) => {
|
|
const clickRowIndex = values.findIndex((item) => item.id === row.id) //获取当前行的索引
|
|
const clickRowIndex = values.findIndex((item) => item.id === row.id) //获取当前行的索引
|
|
// values.pop() //移除最后一行数据
|
|
// values.pop() //移除最后一行数据
|
|
@@ -632,13 +629,15 @@ export const BillModalMixin = {
|
|
mObj.depotId = mInfo.depotId
|
|
mObj.depotId = mInfo.depotId
|
|
mObj.stock = mInfo.stock
|
|
mObj.stock = mInfo.stock
|
|
mObj.inventory = mInfo.inventory
|
|
mObj.inventory = mInfo.inventory
|
|
|
|
+ mObj.allPrice = mInfo.allPrice||0
|
|
|
|
+ mObj.taxLastMoney = mInfo.taxLastMoney||0
|
|
mArr.push(mObj)
|
|
mArr.push(mObj)
|
|
}
|
|
}
|
|
let allPriceTotal = 0
|
|
let allPriceTotal = 0
|
|
let taxLastMoneyTotal = 0
|
|
let taxLastMoneyTotal = 0
|
|
for (let j = 0; j < mArr.length; j++) {
|
|
for (let j = 0; j < mArr.length; j++) {
|
|
allPriceTotal += mArr[j].allPrice - 0
|
|
allPriceTotal += mArr[j].allPrice - 0
|
|
- taxLastMoneyTotal += mArr[j].taxLastMoney - 0
|
|
|
|
|
|
+ taxLastMoneyTotal += mArr[j].taxLastMoney- 0
|
|
//组合和拆分单据给商品类型进行重新赋值
|
|
//组合和拆分单据给商品类型进行重新赋值
|
|
if (j === 0) {
|
|
if (j === 0) {
|
|
mArr[0].mType = '组合件'
|
|
mArr[0].mType = '组合件'
|
|
@@ -646,6 +645,7 @@ export const BillModalMixin = {
|
|
mArr[j].mType = '普通子件'
|
|
mArr[j].mType = '普通子件'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ console.log('mArr--------',mArr)
|
|
this.materialTable.dataSource = mArr
|
|
this.materialTable.dataSource = mArr
|
|
if (this.prefixNo === 'LSCK' || this.prefixNo === 'LSTH') {
|
|
if (this.prefixNo === 'LSCK' || this.prefixNo === 'LSTH') {
|
|
target.statisticsColumns.allPrice = allPriceTotal
|
|
target.statisticsColumns.allPrice = allPriceTotal
|