fix:出入库明细页单价/金额/合计改用后端返回的unit_price、price、total_price,修复前端浮点计算误差;库存导出总金额保留两位
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
02f3d3e3dd
commit
0c73337a9a
|
|
@ -214,7 +214,7 @@ export default {
|
||||||
that.$API.inm.warehouse.batch.req({ page: 0, count__gte: 1, material__type__in: "40" }).then((res) => {
|
that.$API.inm.warehouse.batch.req({ page: 0, count__gte: 1, material__type__in: "40" }).then((res) => {
|
||||||
res.forEach(item => {
|
res.forEach(item => {
|
||||||
let data0 = [];
|
let data0 = [];
|
||||||
let total = Number(item.material_.unit_price)*Number(item.count);
|
let total = Math.round(Number(item.material_.unit_price)*Number(item.count)*100)/100;
|
||||||
data0.push(item.update_time);
|
data0.push(item.update_time);
|
||||||
data0.push(item.material_.number);
|
data0.push(item.material_.number);
|
||||||
data0.push(item.material_.name);
|
data0.push(item.material_.name);
|
||||||
|
|
|
||||||
|
|
@ -104,15 +104,9 @@
|
||||||
<el-link v-else :underline="false" type="primary" @click="showWpr(scope.row)">{{scope.row.count}}</el-link>
|
<el-link v-else :underline="false" type="primary" @click="showWpr(scope.row)">{{scope.row.count}}</el-link>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="单价" prop="price" v-if="cate == 'helpso'&&project_code=='gx'">
|
<el-table-column label="单价" prop="unit_price" v-if="cate == 'helpso'&&project_code=='gx'">
|
||||||
<template #default="scope">
|
|
||||||
<span v-if="scope.row.material_">{{ scope.row.material_.unit_price }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="金额" prop="price" v-if="cate == 'helpso'&&project_code=='gx'">
|
<el-table-column label="金额" prop="price" v-if="cate == 'helpso'&&project_code=='gx'">
|
||||||
<template #default="scope">
|
|
||||||
<span v-if="scope.row.material_">{{ scope.row.count * Number(scope.row.material_.unit_price) }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="发出数量" prop="count_send" v-if="mioObj.type == 'sale_out'&&project_code=='gx'">
|
<el-table-column label="发出数量" prop="count_send" v-if="mioObj.type == 'sale_out'&&project_code=='gx'">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -721,13 +715,9 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(index==7&&this.cate == 'helpso'&&this.project_code=='gx'){
|
if(index==7&&this.cate == 'helpso'&&this.project_code=='gx'){
|
||||||
let sumsss = 0;
|
// 直接用后端汇总的单据总金额
|
||||||
data.forEach((item)=>{
|
const total = this.mioObj ? this.mioObj.total_price : null;
|
||||||
if(item.count&&item.material_.unit_price&&item.material_.unit_price!==null){
|
sums[index] = total !== null && total !== undefined ? total : '';
|
||||||
sumsss += Number(item.count)*Number(item.material_.unit_price);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
sums[index] =sumsss;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue