完善采购订单
This commit is contained in:
@@ -319,7 +319,7 @@
|
|||||||
"deptSid": window.sessionStorage.getItem('defaultDeptSid'),
|
"deptSid": window.sessionStorage.getItem('defaultDeptSid'),
|
||||||
"deptName": window.sessionStorage.getItem('defaultDeptName'),
|
"deptName": window.sessionStorage.getItem('defaultDeptName'),
|
||||||
"useOrgSid": window.sessionStorage.getItem('orgSid'),
|
"useOrgSid": window.sessionStorage.getItem('orgSid'),
|
||||||
"createOrgSid": window.sessionStorage.getItem('defaultDeptSid'),
|
"createOrgSid": window.sessionStorage.getItem('orgSid'),
|
||||||
"orgPath": window.sessionStorage.getItem('orgSidPath'),
|
"orgPath": window.sessionStorage.getItem('orgSidPath'),
|
||||||
"purchaseBillAmount": {
|
"purchaseBillAmount": {
|
||||||
"sid": "",
|
"sid": "",
|
||||||
@@ -405,7 +405,7 @@
|
|||||||
init() {
|
init() {
|
||||||
// 供应商
|
// 供应商
|
||||||
choiceSupplierInfo({
|
choiceSupplierInfo({
|
||||||
createOrgSid: window.sessionStorage.getItem('orgSidPath')
|
createOrgSid: window.sessionStorage.getItem('orgSid')
|
||||||
}).then((resp) => {
|
}).then((resp) => {
|
||||||
if (resp.success) {
|
if (resp.success) {
|
||||||
this.supplierList = resp.data
|
this.supplierList = resp.data
|
||||||
@@ -414,7 +414,7 @@
|
|||||||
|
|
||||||
// 仓库
|
// 仓库
|
||||||
getWarehouses({
|
getWarehouses({
|
||||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
orgPath: window.sessionStorage.getItem('orgSid'),
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.warehouseList = res.data
|
this.warehouseList = res.data
|
||||||
@@ -423,7 +423,7 @@
|
|||||||
|
|
||||||
// 业务员
|
// 业务员
|
||||||
selAllByOrgSidPath({
|
selAllByOrgSidPath({
|
||||||
orgSidPath: window.sessionStorage.getItem('orgSidPath')
|
orgSidPath: window.sessionStorage.getItem('orgSid')
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.allOrgperList = res.data
|
this.allOrgperList = res.data
|
||||||
@@ -574,11 +574,18 @@
|
|||||||
for (var i = 0; i < this.formobj.purchaseBillDetailList.length; i++) {
|
for (var i = 0; i < this.formobj.purchaseBillDetailList.length; i++) {
|
||||||
|
|
||||||
var item = this.formobj.purchaseBillDetailList[i]
|
var item = this.formobj.purchaseBillDetailList[i]
|
||||||
|
|
||||||
if (row.sid != item.sid) {
|
if (row.sid != item.sid) {
|
||||||
|
// console.log("item.cost1》》》》", item.cost)
|
||||||
|
// console.log("item.shareAmount》》》》", item.shareAmount)
|
||||||
|
// console.log("item.count》》》》", item.count)
|
||||||
// 列表其他数据 先计算单价
|
// 列表其他数据 先计算单价
|
||||||
// item.cost = (Number(item.cost) - Number(item.shareAmount) / Number(item.count)).toFixed(2)
|
|
||||||
item.cost = Number(item.cost1)
|
if (Number(item.count) != 0) {
|
||||||
|
item.cost = (Number(item.cost) - Number(item.shareAmount) / Number(item.count)).toFixed(2)
|
||||||
|
}
|
||||||
|
|
||||||
|
// item.cost = Number(item.cost1)
|
||||||
|
// console.log("item.cost2》》》》", item.cost)
|
||||||
this.calculation2(item)
|
this.calculation2(item)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -590,10 +597,16 @@
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
if (updateProp == 'cost') {
|
if (updateProp == 'cost') {
|
||||||
// 修改的不是单价
|
// 修改的是单价
|
||||||
this.calculation2(item)
|
this.calculation2(item)
|
||||||
} else {
|
} else {
|
||||||
item.cost = Number(item.cost1)
|
// item.cost = Number(item.cost1)
|
||||||
|
if (Number(item.count) != 0) {
|
||||||
|
item.cost = (Number(item.cost) - Number(item.shareAmount) / Number(item.count)).toFixed(2)
|
||||||
|
}
|
||||||
|
|
||||||
|
// console.log("item.cost》》》》", item.cost)
|
||||||
|
|
||||||
this.calculation2(item)
|
this.calculation2(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -622,6 +635,73 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 计算分摊金额
|
||||||
|
computeShareAmount() {
|
||||||
|
// 分摊金额 = (采购运费+其他费用)*单价*数量/所有商品总价
|
||||||
|
|
||||||
|
var price = Number(this.formobj.purchaseBillAmount.freight) + Number(this.formobj.purchaseBillAmount
|
||||||
|
.otherAmount)
|
||||||
|
|
||||||
|
var all = 0 // 除去最后一个的分摊总和
|
||||||
|
var totalAmount = 0 // 原所有商品总价
|
||||||
|
for (var i = 0; i < this.formobj.purchaseBillDetailList.length; i++) {
|
||||||
|
|
||||||
|
var item = this.formobj.purchaseBillDetailList[i]
|
||||||
|
totalAmount = (Number(totalAmount) + Number(Number(item.cost1) * Number(item.count1))).toFixed(2)
|
||||||
|
// totalAmount = (Number(totalAmount) + Number(Number(item.cost) * Number(item.count))).toFixed(2)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 分摊金额 = (采购运费+其他费用)*单价*数量/ 原所有商品总价
|
||||||
|
|
||||||
|
for (var i = 0; i < this.formobj.purchaseBillDetailList.length; i++) {
|
||||||
|
|
||||||
|
var item = this.formobj.purchaseBillDetailList[i]
|
||||||
|
if (i == this.formobj.purchaseBillDetailList.length - 1) {
|
||||||
|
|
||||||
|
if (Number(item.count) != 0) {
|
||||||
|
|
||||||
|
if (Number(price) == 0) {
|
||||||
|
item.cost = (Number(item.cost) - Number(item.shareAmount) / Number(item.count)).toFixed(2)
|
||||||
|
item.shareAmount = 0.00
|
||||||
|
} else {
|
||||||
|
// 最后一条数据
|
||||||
|
item.cost1 = (Number(item.cost) - Number(item.shareAmount) / Number(item.count)).toFixed(2)
|
||||||
|
item.shareAmount = (Number(price) - Number(all)).toFixed(2)
|
||||||
|
|
||||||
|
// item.cost = (Number(item.cost1) + (Number(item.shareAmount) / Number(item.count))).toFixed(2)
|
||||||
|
item.cost = (Number(item.cost1) + Number(item.shareAmount) / Number(item.count)).toFixed(2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (Number(item.count) != 0) {
|
||||||
|
if (Number(price) == 0) {
|
||||||
|
item.shareAmount = 0.00
|
||||||
|
} else {
|
||||||
|
// 分摊金额 = (采购运费+其他费用)*单价*数量/所有商品总价
|
||||||
|
// item.shareAmount = (Number(price) * Number(item.cost1) * Number(item.count) / Number(totalAmount))
|
||||||
|
item.shareAmount = (Number(price) * Number(item.cost1) * Number(item.count) / Number(totalAmount))
|
||||||
|
.toFixed(2)
|
||||||
|
|
||||||
|
// item.cost = (Number(item.cost1) + (Number(item.shareAmount) / Number(item.count))).toFixed(2)
|
||||||
|
item.cost = (Number(item.cost1) + Number(item.shareAmount) / Number(item.count)).toFixed(2)
|
||||||
|
|
||||||
|
all += Number(item.shareAmount)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
this.calculation2(item)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
calculation2(row) {
|
calculation2(row) {
|
||||||
|
|
||||||
// 折后单价 = 单价*折扣率 / 100
|
// 折后单价 = 单价*折扣率 / 100
|
||||||
@@ -654,8 +734,6 @@
|
|||||||
},
|
},
|
||||||
manufactureDateChange(row) {
|
manufactureDateChange(row) {
|
||||||
|
|
||||||
console.log("manufactureDateChange》》》》", row.madeDate)
|
|
||||||
console.log("manufactureDateChange》》》》", row.shelfLife)
|
|
||||||
row.expireDate = this.addDate(row.madeDate, Number(row.shelfLife))
|
row.expireDate = this.addDate(row.madeDate, Number(row.shelfLife))
|
||||||
|
|
||||||
let reg = new RegExp('-', 'g') //g代表全部
|
let reg = new RegExp('-', 'g') //g代表全部
|
||||||
@@ -680,50 +758,7 @@
|
|||||||
return time
|
return time
|
||||||
},
|
},
|
||||||
|
|
||||||
// 计算分摊金额
|
|
||||||
computeShareAmount() {
|
|
||||||
// 分摊金额 = (采购运费+其他费用)*单价*数量/所有商品总价
|
|
||||||
|
|
||||||
var price = Number(this.formobj.purchaseBillAmount.freight) + Number(this.formobj.purchaseBillAmount
|
|
||||||
.otherAmount)
|
|
||||||
|
|
||||||
var all = 0 // 除去最后一个的分摊总和
|
|
||||||
var totalAmount = 0 // 原所有商品总价
|
|
||||||
for (var i = 0; i < this.formobj.purchaseBillDetailList.length; i++) {
|
|
||||||
|
|
||||||
var item = this.formobj.purchaseBillDetailList[i]
|
|
||||||
totalAmount = (Number(totalAmount) + Number(Number(item.cost1) * Number(item.count1))).toFixed(2)
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log("price》》》》", price)
|
|
||||||
console.log("totalAmount》》》》", totalAmount)
|
|
||||||
// 分摊金额 = (采购运费+其他费用)*单价*数量/ 原所有商品总价
|
|
||||||
|
|
||||||
for (var i = 0; i < this.formobj.purchaseBillDetailList.length; i++) {
|
|
||||||
|
|
||||||
var item = this.formobj.purchaseBillDetailList[i]
|
|
||||||
|
|
||||||
if (i == this.formobj.purchaseBillDetailList.length - 1) {
|
|
||||||
// 最后一条数据
|
|
||||||
item.shareAmount = (Number(price) - Number(all)).toFixed(2)
|
|
||||||
item.cost = (Number(item.cost1) + (Number(item.shareAmount) / Number(item.count))).toFixed(2)
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
item.shareAmount = (Number(price) * Number(item.cost1) * Number(item.count) / Number(totalAmount))
|
|
||||||
.toFixed(2)
|
|
||||||
item.cost = (Number(item.cost1) + (Number(item.shareAmount) / Number(item.count))).toFixed(2)
|
|
||||||
all += Number(item.shareAmount)
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// this.calculation(item)
|
|
||||||
this.calculation2(item)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
goodsAdd() {
|
goodsAdd() {
|
||||||
this.viewState = 2
|
this.viewState = 2
|
||||||
@@ -773,8 +808,8 @@
|
|||||||
"count1": value[i].count != null ? value[i].count1 : '0',
|
"count1": value[i].count != null ? value[i].count1 : '0',
|
||||||
"pcsCount": value[i].pcsNum != null ? value[i].pcsNum : '0',
|
"pcsCount": value[i].pcsNum != null ? value[i].pcsNum : '0',
|
||||||
"tagPrice": value[i].tagPrice != null ? value[i].tagPrice : '',
|
"tagPrice": value[i].tagPrice != null ? value[i].tagPrice : '',
|
||||||
"cost": value[i].cost != null ? value[i].cost : '',
|
"cost": value[i].cost != null ? value[i].cost : '0.00',
|
||||||
"cost1": value[i].cost != null ? value[i].cost1 : '',
|
"cost1": value[i].cost != null ? value[i].cost1 : '0.00',
|
||||||
"discountRate": value[i].discountRate != null ? value[i].discountRate : '100',
|
"discountRate": value[i].discountRate != null ? value[i].discountRate : '100',
|
||||||
"discountPrice": value[i].discountPrice != null ? value[i].discountPrice : '0.00',
|
"discountPrice": value[i].discountPrice != null ? value[i].discountPrice : '0.00',
|
||||||
"shareAmount": value[i].shareAmount != null ? value[i].shareAmount : '0.00',
|
"shareAmount": value[i].shareAmount != null ? value[i].shareAmount : '0.00',
|
||||||
@@ -892,7 +927,7 @@
|
|||||||
"deptSid": window.sessionStorage.getItem('defaultDeptSid'),
|
"deptSid": window.sessionStorage.getItem('defaultDeptSid'),
|
||||||
"deptName": window.sessionStorage.getItem('defaultDeptName'),
|
"deptName": window.sessionStorage.getItem('defaultDeptName'),
|
||||||
"useOrgSid": window.sessionStorage.getItem('orgSid'),
|
"useOrgSid": window.sessionStorage.getItem('orgSid'),
|
||||||
"createOrgSid": window.sessionStorage.getItem('defaultDeptSid'),
|
"createOrgSid": window.sessionStorage.getItem('orgSid'),
|
||||||
"orgPath": window.sessionStorage.getItem('orgSidPath'),
|
"orgPath": window.sessionStorage.getItem('orgSidPath'),
|
||||||
"purchaseBillAmount": {
|
"purchaseBillAmount": {
|
||||||
"sid": "",
|
"sid": "",
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="createTime" label="业务日期" width="120" align="center" />
|
<el-table-column prop="createTime" label="业务日期" width="120" align="center" />
|
||||||
<el-table-column prop="billNo" label="单据编号" width="120" align="center" />
|
<el-table-column prop="billNo" label="单据编号" width="150" align="center" />
|
||||||
<el-table-column prop="supplierName" label="供应商" width="150" align="center" />
|
<el-table-column prop="supplierName" label="供应商" width="150" align="center" />
|
||||||
<el-table-column prop="purchaserName" label="业务员" width="120" align="center" />
|
<el-table-column prop="purchaserName" label="业务员" width="120" align="center" />
|
||||||
<el-table-column prop="wareHouseName" label="仓库" width="150" align="center" />
|
<el-table-column prop="wareHouseName" label="仓库" width="150" align="center" />
|
||||||
@@ -110,9 +110,9 @@
|
|||||||
<el-table-column prop="thisPayAmount" label="本次付款" width="120" align="center" />
|
<el-table-column prop="thisPayAmount" label="本次付款" width="120" align="center" />
|
||||||
<el-table-column prop="taxAmount" label="税额汇总" width="120" align="center" />
|
<el-table-column prop="taxAmount" label="税额汇总" width="120" align="center" />
|
||||||
<el-table-column prop="countTotal" label="商品数量" width="120" align="center" />
|
<el-table-column prop="countTotal" label="商品数量" width="120" align="center" />
|
||||||
<el-table-column prop="remarks" label="备注" width="200" align="center" />
|
<el-table-column prop="remarks" label="备注" min-width="200" align="center" />
|
||||||
<el-table-column prop="createByName" label="创建人" align="center" />
|
<el-table-column prop="createByName" label="创建人" width="150" align="center" />
|
||||||
<el-table-column prop="modifyTime" label="最后修改时间" width="150" align="center" />
|
<el-table-column prop="modifyTime" label="最后修改时间" width="180" align="center" />
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<!-- End 项目列表 -->
|
<!-- End 项目列表 -->
|
||||||
@@ -365,7 +365,7 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
getWarehouses({
|
getWarehouses({
|
||||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
orgPath: window.sessionStorage.getItem('orgSid'),
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.warehouseList = res.data
|
this.warehouseList = res.data
|
||||||
@@ -376,7 +376,7 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
getGoodsListAllByOrg({
|
getGoodsListAllByOrg({
|
||||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
orgPath: window.sessionStorage.getItem('orgSid'),
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.goodsList = res.data
|
this.goodsList = res.data
|
||||||
@@ -719,6 +719,7 @@
|
|||||||
message: resp.msg,
|
message: resp.msg,
|
||||||
showClose: true
|
showClose: true
|
||||||
})
|
})
|
||||||
|
this.orderInfo = {}
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
this.loadList()
|
this.loadList()
|
||||||
} else {
|
} else {
|
||||||
@@ -728,6 +729,7 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
handleDialogClose() {
|
handleDialogClose() {
|
||||||
|
this.orderInfo = {}
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@
|
|||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="span-sty">其他费用</div>
|
<div class="span-sty">其他费用</div>
|
||||||
<el-form-item><span
|
<el-form-item><span
|
||||||
class="addinputInfo">{{ formobj.purchaseBillAmount.otherAmountName }}</span></el-form-item>
|
class="addinputInfo">{{ formobj.purchaseBillAmount.otherAmount }}</span></el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
|||||||
Reference in New Issue
Block a user