diff --git a/src/views/DeliverGoods/components/MySaleout.vue b/src/views/DeliverGoods/components/MySaleout.vue index d313a855..a5363c8d 100644 --- a/src/views/DeliverGoods/components/MySaleout.vue +++ b/src/views/DeliverGoods/components/MySaleout.vue @@ -402,6 +402,9 @@ export default { this.employeeVisible = false console.log(this.choosedata) const saleOutdata = this.choosedata.saleOutDetailVos + for (const i in saleOutdata) { + saleOutdata[i].sourceNumber = this.choosedata.number + } console.log('源单', saleOutdata) const outRepositoryId = this.choosedata.saleRepositoryId const outRepositoryName = this.choosedata.saleRepositoryName @@ -412,10 +415,14 @@ export default { productType: item.productTypeName, unit: item.unit, color: item.color, - Categoryid: item.productCategoryName, - typeId: item.productTypeName, - basicQuantity: item.quantity, - price: item.salePrice, + category: item.category, + productCategoryName: item.productCategoryName, + type: item.type, + productTypeName: item.productTypeName, + // basicQuantity: item.quantity, + salePrice: item.salePrice, + costPrice: 0, + costMonney: 0, deliverQuantity: item.quantity, deliverMoney: item.money, outRepositoryId: outRepositoryId, @@ -423,19 +430,22 @@ export default { batch: item.batch, kpiGrade: item.kpiGrade, point: item.point, - taxprice: item.salePrice - item.taxMoney, + // taxprice: item.salePrice - item.taxMoney, taxRate: item.taxRate, taxMoney: item.taxMoney, - discountRate: item.discountRate * 100, - discountMoney: item.discountMoney, + discount: item.discountRate * 100, + discountMoney: 0, + OriginalDiscountMont: item.discountMoney, alreadyReturnQuantity: item.retreatQuantity, carCode: item.carCode, motorCode: item.motorCode, batteryCode: item.batteryCode, sourceNumber: item.sourceNumber, sendQuantity: item.quantity, + locationId: item.locationId, locationName: item.locationName, - includeTaxCostMoney: 0 + includeTaxCostMoney: 0, + includeTaxMoney: 0 } }) this.$emit('saleOutDetail', saleOutDetail) diff --git a/src/views/SaleReturn/AddSaleReturn.vue b/src/views/SaleReturn/AddSaleReturn.vue index 864d2065..9c2b0618 100644 --- a/src/views/SaleReturn/AddSaleReturn.vue +++ b/src/views/SaleReturn/AddSaleReturn.vue @@ -163,22 +163,22 @@ - + - + - + - - + + @@ -651,27 +651,27 @@ export default { sums[24] = '' sums[25] = '' this.heji1 = sums[19] - this.heji2 = sums[19] this.heji3 = sums[15] this.heji4 = sums[14] - this.heji5 = sums[18] - this.heji6 = sums[15] - sums[18] + this.heji5 = sums[17] + this.heji6 = sums[15] - sums[17] this.personalForm.actualReturnMoney = this.heji6 return sums }, // 通过折扣额计算折扣 - getdiscountMoney(row) { - row.discount = ((1 - row.discountMoney / row.salePrice / row.quantity) * 100).toFixed(2) - }, + // getdiscountMoney(row) { + // row.discount = ((1 - row.discountMoney / row.salePrice / row.quantity) * 100).toFixed(2) + // }, // 通过折扣计算折扣额 - getdiscount(row) { - row.discountMoney = (row.salePrice * row.quantity * (1 - row.discount / 100)).toFixed(2) - }, + // getdiscount(row) { + // row.discountMoney = (row.salePrice * row.quantity * (1 - row.discount / 100)).toFixed(2) + // }, // 通过数量计算成本金额, 含税金额, 金额, 含税成本金额 getquantity(row) { - row.includeTaxCostMoney = (row.taxprice * row.returnQuantity).toFixed(2) - row.taxMoney = (row.taxMoney * row.returnQuantity).toFixed(2) - row.discountMoney = (row.taxprice * (1 - row.discountRate / 100) * row.returnQuantity).toFixed(2) + console.log(row.discount) + row.money = (row.salePrice * row.returnQuantity).toFixed(2) + row.taxMoney = (row.salePrice / (1 + row.taxRate) * row.taxRate * row.returnQuantity).toFixed(2) + row.discountMoney = (row.OriginalDiscountMont * row.returnQuantity).toFixed(2) if (row.returnQuantity > (row.sendQuantity - row.alreadyReturnQuantity) && this.personalForm.sourceType === '1') { this.$notify.error({ title: '错误', @@ -679,32 +679,32 @@ export default { offset: 100 }) row.returnQuantity = 1 - row.includeTaxCostMoney = (row.taxprice * row.returnQuantity).toFixed(2) - row.taxMoney = (row.taxMoney * row.returnQuantity).toFixed(2) - row.discountMoney = (row.taxprice * (1 - row.discountRate / 100) * row.returnQuantity).toFixed(2) + row.money = (row.salePrice * row.returnQuantity).toFixed(2) + row.taxMoney = (row.salePrice / (1 + row.taxRate) * row.taxRate * row.returnQuantity).toFixed(2) + row.discountMoney = (row.OriginalDiscountMont * row.returnQuantity).toFixed(2) return false } return row.returnQuantity }, // 计算含税价 - gettaxprice(row) { - row.taxprice = (row.salePrice * (1 + row.taxRate / 100)).toFixed(2) - return row.taxprice - }, + // gettaxprice(row) { + // row.taxprice = (row.salePrice * (1 + row.taxRate / 100)).toFixed(2) + // return row.taxprice + // }, // 通过税率计算税额 - gettaxRate(row) { - if (row.taxRate !== 0) { - row.taxMoney = (row.salePrice * row.taxRate * row.quantity / 100).toFixed(2) - } - return row.taxRate - }, + // gettaxRate(row) { + // if (row.taxRate !== 0) { + // row.taxMoney = (row.salePrice * row.taxRate * row.quantity / 100).toFixed(2) + // } + // return row.taxRate + // }, // 通过税额计算税率 - gettaxMoney(row) { - if (row.taxMoney !== 0 && row.quantity !== 0 && row.salePrice !== 0) { - row.taxRate = ((row.taxMoney / (row.salePrice * row.quantity)) * 100).toFixed(2) - } - return row.taxMoney - }, + // gettaxMoney(row) { + // if (row.taxMoney !== 0 && row.quantity !== 0 && row.salePrice !== 0) { + // row.taxRate = ((row.taxMoney / (row.salePrice * row.quantity)) * 100).toFixed(2) + // } + // return row.taxMoney + // }, // 选择客户类型时清理客户名称 clearCustomer() { // this.$store.dispatch('get_customtype', this.personalForm.customerType) @@ -806,6 +806,7 @@ export default { this.$refs.personalForm.validate((valid) => { if (valid) { const EnterDetail = this.deepClone(this.$refs.editable.getRecords()) + console.log(EnterDetail) if (EnterDetail.length === 0) { this.$notify.error({ title: '错误', @@ -817,90 +818,84 @@ export default { EnterDetail.map(function(elem) { return elem }).forEach(function(elem) { - if (elem.batch === null || elem.batch === '' || elem.batch === undefined) { - delete elem.batch - } - if (elem.productName === null || elem.productName === '' || elem.productName === undefined) { - delete elem.productName - } - if (elem.category === null || elem.category === '' || elem.category === undefined) { - delete elem.category - } - if (elem.unit === null || elem.unit === '' || elem.unit === undefined) { - delete elem.unit - } - if (elem.type === null || elem.type === '' || elem.type === undefined) { - delete elem.type - } - if (elem.color === null || elem.color === '' || elem.color === undefined) { - delete elem.color - } - if (elem.kpiGrade === null || elem.kpiGrade === '' || elem.kpiGrade === undefined) { - delete elem.kpiGrade - } - if (elem.point === null || elem.point === '' || elem.point === undefined) { - delete elem.point - } - if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) { - delete elem.salePrice - } - if (elem.costPrice === null || elem.costPrice === '' || elem.costPrice === undefined) { - delete elem.costPrice - } - if (elem.costMoney === null || elem.costMoney === '' || elem.costMoney === undefined) { - delete elem.costMoney - } - if (elem.includeTaxMoney === null || elem.includeTaxMoney === '' || elem.includeTaxMoney === undefined) { - delete elem.includeTaxMoney - } - if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) { - delete elem.taxRate - } + // if (elem.batch === null || elem.batch === '' || elem.batch === undefined) { + // delete elem.batch + // } + // if (elem.productName === null || elem.productName === '' || elem.productName === undefined) { + // delete elem.productName + // } + // if (elem.unit === null || elem.unit === '' || elem.unit === undefined) { + // delete elem.unit + // } + // if (elem.color === null || elem.color === '' || elem.color === undefined) { + // delete elem.color + // } + // if (elem.kpiGrade === null || elem.kpiGrade === '' || elem.kpiGrade === undefined) { + // delete elem.kpiGrade + // } + // if (elem.point === null || elem.point === '' || elem.point === undefined) { + // delete elem.point + // } + // if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) { + // delete elem.salePrice + // } + // if (elem.costPrice === null || elem.costPrice === '' || elem.costPrice === undefined) { + // delete elem.costPrice + // } + // if (elem.costMoney === null || elem.costMoney === '' || elem.costMoney === undefined) { + // delete elem.costMoney + // } + // if (elem.includeTaxMoney === null || elem.includeTaxMoney === '' || elem.includeTaxMoney === undefined) { + // delete elem.includeTaxMoney + // } + // if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) { + // delete elem.taxRate + // } if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) { elem.taxRate = elem.taxRate / 100 } - if (elem.taxMoney === null || elem.taxMoney === '' || elem.taxMoney === undefined) { - delete elem.taxMoney - } - if (elem.money === null || elem.money === '' || elem.money === undefined) { - delete elem.money - } - if (elem.includeTaxCostMoney === null || elem.includeTaxCostMoney === '' || elem.includeTaxCostMoney === undefined) { - delete elem.includeTaxCostMoney - } - if (elem.discount === null || elem.discount === '' || elem.discount === undefined) { - delete elem.discount - } + // if (elem.taxMoney === null || elem.taxMoney === '' || elem.taxMoney === undefined) { + // delete elem.taxMoney + // } + // if (elem.money === null || elem.money === '' || elem.money === undefined) { + // delete elem.money + // } + // if (elem.includeTaxCostMoney === null || elem.includeTaxCostMoney === '' || elem.includeTaxCostMoney === undefined) { + // delete elem.includeTaxCostMoney + // } + // if (elem.discount === null || elem.discount === '' || elem.discount === undefined) { + // delete elem.discount + // } if (elem.discountRate !== null || elem.discountRate !== '' || elem.discountRate !== undefined) { - elem.discount = elem.discountRate / 100 - } - if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) { - delete elem.discountMoney - } - if (elem.alreadyReturnQuantity === null || elem.alreadyReturnQuantity === '' || elem.alreadyReturnQuantity === undefined) { - delete elem.alreadyReturnQuantity - } - if (elem.returnQuantity === null || elem.returnQuantity === '' || elem.returnQuantity === undefined) { - delete elem.returnQuantity - } - if (elem.returnReason === null || elem.returnReason === '' || elem.returnReason === undefined) { - delete elem.returnReason - } - if (elem.sendQuantity === null || elem.sendQuantity === '' || elem.sendQuantity === undefined) { - delete elem.sendQuantity - } - if (elem.carCode === null || elem.carCode === '' || elem.carCode === undefined) { - delete elem.carCode - } - if (elem.motorCode === null || elem.motorCode === '' || elem.motorCode === undefined) { - delete elem.motorCode - } - if (elem.batteryCode === null || elem.batteryCode === '' || elem.batteryCode === undefined) { - delete elem.batteryCode - } - if (elem.locationId === null || elem.locationId === '' || elem.locationId === undefined) { - delete elem.locationId + elem.discount = elem.discount / 100 } + // if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) { + // delete elem.discountMoney + // } + // if (elem.alreadyReturnQuantity === null || elem.alreadyReturnQuantity === '' || elem.alreadyReturnQuantity === undefined) { + // delete elem.alreadyReturnQuantity + // } + // if (elem.returnQuantity === null || elem.returnQuantity === '' || elem.returnQuantity === undefined) { + // delete elem.returnQuantity + // } + // if (elem.returnReason === null || elem.returnReason === '' || elem.returnReason === undefined) { + // delete elem.returnReason + // } + // if (elem.sendQuantity === null || elem.sendQuantity === '' || elem.sendQuantity === undefined) { + // delete elem.sendQuantity + // } + // if (elem.carCode === null || elem.carCode === '' || elem.carCode === undefined) { + // delete elem.carCode + // } + // if (elem.motorCode === null || elem.motorCode === '' || elem.motorCode === undefined) { + // delete elem.motorCode + // } + // if (elem.batteryCode === null || elem.batteryCode === '' || elem.batteryCode === undefined) { + // delete elem.batteryCode + // } + // if (elem.locationId === null || elem.locationId === '' || elem.locationId === undefined) { + // delete elem.locationId + // } return elem }) const parms2 = JSON.stringify(EnterDetail)