This commit is contained in:
zxx 2023-12-13 14:24:03 +08:00
parent 47837e9615
commit 6d065a1d46
5 changed files with 44 additions and 14 deletions

View File

@ -104,7 +104,8 @@ export default {
warehouse_id: 0,
version: '',
is_default: 0,
processing_cost: 11,
purchase_cost: 0,
processing_cost: 0,
},
//
titleWidth: 100,
@ -204,7 +205,6 @@ export default {
{field: 'delivery_no', title: '发货单号', span: 12, itemRender: {name: '$input'}},
{field: 'contact', title: '联系人', span: 12, itemRender: {name: '$input'}},
{
field: 'purchase_cost',
title: '采购成本',
@ -220,6 +220,7 @@ export default {
itemRender: {name: '$input', props: {type: "number"}},
},
{field: 'contact', title: '联系人', span: 12, itemRender: {name: '$input'}},
{field: 'phone', title: '联系电话', span: 12, itemRender: {name: '$input'}},
{field: 'remark', title: '备注', span: 24, itemRender: {name: '$textarea'}},
]
@ -288,7 +289,8 @@ export default {
this.stock_out = a.data.stock_out;
console.log(" this.warehouse_idetail:", this.warehouse_idetail)
console.log(" this.warehouse_pos_idetail:", this.warehouse_pos_idetail)
this.formOptions.data.purchase_cost = this.product_detail.purchase_cost;
this.formOptions.data.processing_cost = this.product_detail.processing_cost;
}).catch((a) => {
this.$mk.error(a.data.msg);
});

View File

@ -3,7 +3,7 @@
<div class="page-body">
<a-button type="primary" v-if="formOptions.data.in_time === 0" icon="eye" @click="preView">
打印预览
打印单据
</a-button>
<h2> {{ title }}</h2>
<!-- <vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"-->
@ -32,27 +32,43 @@
单价
</th>
<td class="table-cell" colspan="3">
{{ formOptions.data.price|formatNumber }}
{{ formOptions.data.price|formatMoney }}
</td>
<th class="table-cell">
总价
</th>
<td class="table-cell" colspan="6">
{{ formOptions.data.total_price|formatNumber }}
{{ formOptions.data.total_price|formatMoney }}
</td>
</tr>
<tr class="table-row-2" v-if="formOptions.data.out_time === 0">
<th class="table-cell">
采购成本
</th>
<td class="table-cell" colspan="3">
{{ formOptions.data.purchase_cost|formatNumber }}
<td class="table-cell">
{{ formOptions.data.purchase_cost|formatMoney }}
</td>
<th class="table-cell">
加工成本
</th>
<td class="table-cell" colspan="6">
{{ formOptions.data.processing_cost|formatNumber }}
<td class="table-cell">
{{ formOptions.data.processing_cost|formatMoney }}
</td>
<th class="table-cell">
单件成本
</th>
<td class="table-cell">
{{
(formOptions.data.purchase_cost + formOptions.data.processing_cost)|formatMoney
}}
</td>
<th class="table-cell">
总成本
</th>
<td class="table-cell">
{{
(formOptions.data.purchase_cost + formOptions.data.processing_cost) * formOptions.data.in_stock|formatMoney
}}
</td>
</tr>
<tr class="table-row-3" v-if="formOptions.data.out_time === 0">
@ -60,7 +76,7 @@
入库数量
</th>
<td class="table-cell" colspan="2">
{{ formOptions.data.in_stock }}
{{ formOptions.data.in_stock }} {{ formOptions.data.product_detail.unit }}
</td>
<th class="table-cell">
单据日期
@ -473,9 +489,9 @@ export default {
this.formOptions.data = a.data[detailDataFieldName];
if (this.formOptions.data.out_time === 0) {
this.title = "入库单据"
this.title = "入库信息"
} else {
this.title = "出库单据"
this.title = "出库信息"
}
this.product_detail = this.formOptions.data.product_detail
@ -645,6 +661,12 @@ export default {
}
return cellValue.toFixed(2);
},
formatMoney(cellValue) {
if (!cellValue) {
return '-';
}
return cellValue.toFixed(2) + " 元"
},
},
//

View File

@ -276,6 +276,8 @@ export default {
console.log(" this.stock_in:", this.stock_in)
this.stock_out = a.data.stock_out;
console.log(" this.stock_out:", this.stock_out)
this.formOptions.data.purchase_cost = this.product_detail.purchase_cost;
this.formOptions.data.processing_cost = this.product_detail.processing_cost;
}).catch((a) => {
this.$mk.error(a.data.msg);
});

View File

@ -3,7 +3,7 @@
{
"index": 0,
"name": 1,
"height": 296.6,
"height": 120,
"width": 210,
"paperHeader": 82.5,
"paperFooter": 802.5,

View File

@ -47,6 +47,9 @@ export default {
this.visible = false
},
show(hiprintTemplate, printData, width = '210') {
console.log("hiprintTemplate:", hiprintTemplate)
console.log("printData:", printData)
this.visible = true
this.spinning = true
this.width = hiprintTemplate.editingPanel ? hiprintTemplate.editingPanel.width : width;
@ -55,6 +58,7 @@ export default {
//this.hiprintTemplate.print(this.printData);
setTimeout(() => {
// eslint-disable-next-line no-undef
$('#preview_content_custom').html(hiprintTemplate.getHtml(printData))