feat:入库出库单可以通过货商搜索,零售价可编辑
This commit is contained in:
1 parent
f5bf29ba9e
commit
eabc3edc4a
4 files changed
+26
-18
No files matched your search
@@ -73,7 +73,7 @@
|
|||||||
{
|
{
|
||||||
seq: '合计',
|
seq: '合计',
|
||||||
quantity: total.quantity,
|
quantity: total.quantity,
|
||||||
retailPrice: total.retailPrice,
|
retailPrice: `${total.retailPrice}元`,
|
||||||
purchasePrice: total.purchasePrice,
|
purchasePrice: total.purchasePrice,
|
||||||
realPrice: `${total.realPrice}元`,
|
realPrice: `${total.realPrice}元`,
|
||||||
totalAmount: total.totalAmount,
|
totalAmount: total.totalAmount,
|
||||||
@@ -130,9 +130,12 @@
|
|||||||
<el-input-number v-else v-model="row.quantity" :min="0" :precision="2" @change="onQuantityChange(row, $rowIndex)" />
|
<el-input-number v-else v-model="row.quantity" :min="0" :precision="2" @change="onQuantityChange(row, $rowIndex)" />
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="retailPrice" title="零售价">
|
<vxe-column field="retailPrice" title="零售价" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ displayPrice(row.selectedUnitObj?.retailPrice || 0) }}
|
{{ row.selectedUnitObj.retailPrice || 0 }}
|
||||||
|
</template>
|
||||||
|
<template #edit="{ row }">
|
||||||
|
<el-input-number v-model="row.selectedUnitObj.retailPrice" :min="0" :precision="2" />
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="purchasePrice" title="原进价">
|
<vxe-column field="purchasePrice" title="原进价">
|
||||||
@@ -257,9 +260,7 @@ const validRules = ref<VxeTablePropTypes.EditRules<any>>({
|
|||||||
// 合计总金额
|
// 合计总金额
|
||||||
const total = computed(() => {
|
const total = computed(() => {
|
||||||
const quantity = vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.quantity || 0), 0).toFixed(2)
|
const quantity = vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.quantity || 0), 0).toFixed(2)
|
||||||
const retailPrice = displayPrice(
|
const retailPrice = vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.selectedUnitObj?.retailPrice || 0), 0).toFixed(2)
|
||||||
vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.selectedUnitObj?.retailPrice || 0), 0).toFixed(2),
|
|
||||||
)
|
|
||||||
const purchasePrice = displayPrice(
|
const purchasePrice = displayPrice(
|
||||||
vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.selectedUnitObj?.purchasePrice || 0), 0),
|
vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.selectedUnitObj?.purchasePrice || 0), 0),
|
||||||
)
|
)
|
||||||
@@ -293,6 +294,7 @@ const getInitData = async () => {
|
|||||||
selectedUnitObj: {
|
selectedUnitObj: {
|
||||||
...selectedUnitObj,
|
...selectedUnitObj,
|
||||||
realPrice: Number(displayPrice(item?.realPrice, "")) || 0,
|
realPrice: Number(displayPrice(item?.realPrice, "")) || 0,
|
||||||
|
retailPrice: Number(displayPrice(selectedUnitObj.retailPrice, "")) || 0,
|
||||||
totalAmount: Number(displayPrice(item?.totalAmount, "")),
|
totalAmount: Number(displayPrice(item?.totalAmount, "")),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -332,6 +334,7 @@ const getSelectedRows = (selectionRows: any) => {
|
|||||||
selectedUnitObj: {
|
selectedUnitObj: {
|
||||||
...firstUnit,
|
...firstUnit,
|
||||||
realPrice: Number(displayPrice(firstUnit.purchasePrice, "")),
|
realPrice: Number(displayPrice(firstUnit.purchasePrice, "")),
|
||||||
|
retailPrice: Number(displayPrice(firstUnit.retailPrice, "")),
|
||||||
totalAmount: 1 * Number(displayPrice(firstUnit.purchasePrice, "")),
|
totalAmount: 1 * Number(displayPrice(firstUnit.purchasePrice, "")),
|
||||||
},
|
},
|
||||||
unitId: firstUnit.id,
|
unitId: firstUnit.id,
|
||||||
@@ -388,6 +391,7 @@ const settledTableItems = computed(() => {
|
|||||||
productNature: item.productNature,
|
productNature: item.productNature,
|
||||||
unitPrice: selectedUnitObj.purchasePrice ? Number(selectedUnitObj?.purchasePrice) : 0,
|
unitPrice: selectedUnitObj.purchasePrice ? Number(selectedUnitObj?.purchasePrice) : 0,
|
||||||
realPrice: selectedUnitObj.realPrice ? storePrice(selectedUnitObj?.realPrice) : 0,
|
realPrice: selectedUnitObj.realPrice ? storePrice(selectedUnitObj?.realPrice) : 0,
|
||||||
|
retailPrice: selectedUnitObj.retailPrice ? storePrice(selectedUnitObj?.retailPrice) : 0,
|
||||||
totalAmount: storePrice(Number(selectedUnitObj?.totalAmount || 0)),
|
totalAmount: storePrice(Number(selectedUnitObj?.totalAmount || 0)),
|
||||||
remark: item.remark,
|
remark: item.remark,
|
||||||
unitId: selectedUnitObj.id,
|
unitId: selectedUnitObj.id,
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="经办人" prop="handlerUserId">
|
<el-form-item label="货商" prop="supplierId">
|
||||||
<SelectHandlerUser v-model.trim="state.queryForm.handlerUserId" placeholder="请选择经办人" style="width: 200px" />
|
<SelectSupermarketSupplier v-model="state.queryForm.supplierId" style="width: 200px" />
|
||||||
</el-form-item> -->
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button icon="search" type="primary" @click="getDataList">查询</el-button>
|
<el-button icon="search" type="primary" @click="getDataList">查询</el-button>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
{
|
{
|
||||||
seq: '合计',
|
seq: '合计',
|
||||||
quantity: total.quantity,
|
quantity: total.quantity,
|
||||||
retailPrice: total.retailPrice,
|
retailPrice: `${total.retailPrice}元`,
|
||||||
purchasePrice: total.purchasePrice,
|
purchasePrice: total.purchasePrice,
|
||||||
realPrice: `${total.realPrice}元`,
|
realPrice: `${total.realPrice}元`,
|
||||||
totalAmount: total.totalAmount,
|
totalAmount: total.totalAmount,
|
||||||
@@ -158,9 +158,12 @@
|
|||||||
<el-input-number v-else v-model="row.quantity" :min="0" :precision="2" @change="onQuantityChange(row, $rowIndex)" />
|
<el-input-number v-else v-model="row.quantity" :min="0" :precision="2" @change="onQuantityChange(row, $rowIndex)" />
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="retailPrice" title="零售价">
|
<vxe-column field="retailPrice" title="零售价" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ displayPrice(row.selectedUnitObj?.retailPrice || 0) }}
|
{{ row.selectedUnitObj.retailPrice || 0 }}
|
||||||
|
</template>
|
||||||
|
<template #edit="{ row }">
|
||||||
|
<el-input-number v-model="row.selectedUnitObj.retailPrice" :min="0" :precision="2" />
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="purchasePrice" title="原进价">
|
<vxe-column field="purchasePrice" title="原进价">
|
||||||
@@ -285,9 +288,7 @@ const validRules = ref<VxeTablePropTypes.EditRules<any>>({
|
|||||||
// 合计总金额
|
// 合计总金额
|
||||||
const total = computed(() => {
|
const total = computed(() => {
|
||||||
const quantity = vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.quantity || 0), 0).toFixed(2)
|
const quantity = vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.quantity || 0), 0).toFixed(2)
|
||||||
const retailPrice = displayPrice(
|
const retailPrice = vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.selectedUnitObj?.retailPrice || 0), 0).toFixed(2)
|
||||||
vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.selectedUnitObj?.retailPrice || 0), 0).toFixed(2),
|
|
||||||
)
|
|
||||||
const purchasePrice = displayPrice(
|
const purchasePrice = displayPrice(
|
||||||
vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.selectedUnitObj?.purchasePrice || 0), 0),
|
vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.selectedUnitObj?.purchasePrice || 0), 0),
|
||||||
)
|
)
|
||||||
@@ -321,6 +322,7 @@ const getInitData = async () => {
|
|||||||
selectedUnitObj: {
|
selectedUnitObj: {
|
||||||
...selectedUnitObj,
|
...selectedUnitObj,
|
||||||
realPrice: Number(displayPrice(item?.realPrice, "")) || 0,
|
realPrice: Number(displayPrice(item?.realPrice, "")) || 0,
|
||||||
|
retailPrice: Number(displayPrice(selectedUnitObj.retailPrice, "")) || 0,
|
||||||
totalAmount: Number(displayPrice(item?.totalAmount, "")),
|
totalAmount: Number(displayPrice(item?.totalAmount, "")),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -360,6 +362,7 @@ const getSelectedRows = (selectionRows: any[]) => {
|
|||||||
selectedUnitObj: {
|
selectedUnitObj: {
|
||||||
...firstUnit,
|
...firstUnit,
|
||||||
realPrice: Number(displayPrice(firstUnit.purchasePrice, "")),
|
realPrice: Number(displayPrice(firstUnit.purchasePrice, "")),
|
||||||
|
retailPrice: Number(displayPrice(firstUnit.retailPrice, "")),
|
||||||
totalAmount: 1 * Number(displayPrice(firstUnit.purchasePrice, "")),
|
totalAmount: 1 * Number(displayPrice(firstUnit.purchasePrice, "")),
|
||||||
},
|
},
|
||||||
unitId: firstUnit.id,
|
unitId: firstUnit.id,
|
||||||
@@ -415,6 +418,7 @@ const settledTableItems = computed(() => {
|
|||||||
productNature: item.productNature,
|
productNature: item.productNature,
|
||||||
unitPrice: selectedUnitObj.purchasePrice ? Number(selectedUnitObj?.purchasePrice) : 0,
|
unitPrice: selectedUnitObj.purchasePrice ? Number(selectedUnitObj?.purchasePrice) : 0,
|
||||||
realPrice: selectedUnitObj.realPrice ? storePrice(selectedUnitObj?.realPrice) : 0,
|
realPrice: selectedUnitObj.realPrice ? storePrice(selectedUnitObj?.realPrice) : 0,
|
||||||
|
retailPrice: selectedUnitObj.retailPrice ? storePrice(selectedUnitObj?.retailPrice) : 0,
|
||||||
totalAmount: storePrice(Number(selectedUnitObj?.totalAmount || 0)),
|
totalAmount: storePrice(Number(selectedUnitObj?.totalAmount || 0)),
|
||||||
remark: item.remark,
|
remark: item.remark,
|
||||||
unitId: selectedUnitObj.id,
|
unitId: selectedUnitObj.id,
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="经办人" prop="handlerUserId">
|
<el-form-item label="货商" prop="supplierId">
|
||||||
<SelectHandlerUser v-model.trim="state.queryForm.handlerUserId" placeholder="请选择经办人" style="width: 200px" />
|
<SelectSupermarketSupplier v-model="state.queryForm.supplierId" style="width: 200px" />
|
||||||
</el-form-item> -->
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button icon="search" type="primary" @click="getDataList">查询</el-button>
|
<el-button icon="search" type="primary" @click="getDataList">查询</el-button>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
|||||||
Reference in new issue
Block a user