接口修复和调整
This commit is contained in:
1 parent
e17475dc19
commit
80e29b5eda
7 files changed
+42
-54
No files matched your search
@@ -34,7 +34,7 @@ export function getErpSpuSimpleAll() {
|
||||
// 获取出入库订单列表
|
||||
export function getCgInventoryPage(params?: Object) {
|
||||
return request({
|
||||
url: "/smErpInventoryRecords/inventory/page",
|
||||
url: "/supermarket/smErpInventoryRecords/inventory/page",
|
||||
method: "get",
|
||||
params,
|
||||
})
|
||||
|
||||
@@ -115,18 +115,18 @@
|
||||
<template #default="{ row }">
|
||||
{{
|
||||
row.purchasePrice
|
||||
? displayPrice(row.purchasePrice, "元", 2)
|
||||
: displayPrice(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice, "元", 2)
|
||||
? displayPrice(row.purchasePrice)
|
||||
: displayPrice(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice)
|
||||
}}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="totalAmount" title="累计总金额">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.unitId && row.quantity && row.unit && !row.erpUnitVos">
|
||||
{{ displayPrice(row.quantity * parseFloat(row.purchasePrice), "元", 2) }}
|
||||
{{ displayPrice(row.quantity * parseFloat(row.purchasePrice)) }}
|
||||
</span>
|
||||
<span v-if="row.unitId && row.quantity && row.erpUnitVos">
|
||||
{{ displayPrice(Number(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice) * row.quantity, "元", 2) }}
|
||||
{{ displayPrice(Number(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice) * row.quantity) }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
|
||||
@@ -115,18 +115,18 @@
|
||||
<template #default="{ row }">
|
||||
{{
|
||||
row.purchasePrice
|
||||
? displayPrice(row.purchasePrice, "元", 2)
|
||||
: displayPrice(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice, "元", 2)
|
||||
? displayPrice(row.purchasePrice)
|
||||
: displayPrice(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice)
|
||||
}}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="totalAmount" title="累计总金额">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.unitId && row.quantity && row.unit && !row.erpUnitVos">
|
||||
{{ displayPrice(row.quantity * parseFloat(row.purchasePrice), "元", 2) }}
|
||||
{{ displayPrice(row.quantity * parseFloat(row.purchasePrice)) }}
|
||||
</span>
|
||||
<span v-if="row.unitId && row.quantity && row.erpUnitVos">
|
||||
{{ displayPrice(Number(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice) * row.quantity, "元", 2) }}
|
||||
{{ displayPrice(Number(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice) * row.quantity) }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
|
||||
@@ -120,18 +120,18 @@
|
||||
<template #default="{ row }">
|
||||
{{
|
||||
row.purchasePrice
|
||||
? displayPrice(row.purchasePrice, "元", 2)
|
||||
: displayPrice(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice, "元", 2)
|
||||
? displayPrice(row.purchasePrice)
|
||||
: displayPrice(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice)
|
||||
}}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="totalAmount" title="累计总金额">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.unitId && row.quantity && row.unit && !row.erpUnitVos">
|
||||
{{ displayPrice(row.quantity * parseFloat(row.purchasePrice), "元", 2) }}
|
||||
{{ displayPrice(row.quantity * parseFloat(row.purchasePrice)) }}
|
||||
</span>
|
||||
<span v-if="row.unitId && row.quantity && row.erpUnitVos">
|
||||
{{ displayPrice(Number(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice) * row.quantity, "元", 2) }}
|
||||
{{ displayPrice(Number(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice) * row.quantity) }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
|
||||
@@ -125,20 +125,18 @@
|
||||
<template #default="{ row }">
|
||||
{{
|
||||
row.purchasePrice
|
||||
? displayPrice(row.purchasePrice, "元", 2)
|
||||
: displayPrice(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice, "元", 2)
|
||||
? displayPrice(row.purchasePrice)
|
||||
: displayPrice(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice)
|
||||
}}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="totalAmount" title="累计总金额">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.unitId && row.quantity && row.unit && !row.erpUnitVos">
|
||||
{{ displayPrice(row.quantity * parseFloat(row.purchasePrice), "元", 2) }}
|
||||
{{ displayPrice(row.quantity * parseFloat(row.purchasePrice)) }}
|
||||
</span>
|
||||
<span v-if="row.unitId && row.quantity && row.erpUnitVos">
|
||||
{{
|
||||
displayPrice(Number(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice) * row.quantity, "元", 2)
|
||||
}}
|
||||
{{ displayPrice(Number(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice) * row.quantity) }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
@@ -153,19 +151,14 @@
|
||||
<el-card class="h-full flex items-center overflow-auto">
|
||||
<el-form :model="receiveAmountForm" :rules="receiveAmountFormRules" label-width="100px">
|
||||
<el-form-item label="单据金额:" prop="totalAmount">
|
||||
<span class="w-full text-purple-600 border-b border-b-black text-xl h-8 text-center">{{
|
||||
displayPrice(totalAmount, "元", 2)
|
||||
}}</span>
|
||||
<span class="w-full text-purple-600 border-b border-b-black text-xl h-8 text-center">{{ displayPrice(totalAmount) }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item class="receive-amount-input" label="收款金额:" prop="receiveAmount">
|
||||
<el-input v-model.trim="receiveAmountForm.receiveAmount" />
|
||||
</el-form-item>
|
||||
<el-form-item label="找零:" prop="backAmount">
|
||||
<span class="w-full text-green-600 border-b border-b-black text-xl h-8 text-center">
|
||||
{{
|
||||
receiveAmountForm.receiveAmount &&
|
||||
displayPrice(Number(totalAmount) - storePrice(receiveAmountForm.receiveAmount), "元", 2)
|
||||
}}
|
||||
{{ receiveAmountForm.receiveAmount && displayPrice(Number(totalAmount) - storePrice(receiveAmountForm.receiveAmount)) }}
|
||||
</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -125,20 +125,18 @@
|
||||
<template #default="{ row }">
|
||||
{{
|
||||
row.purchasePrice
|
||||
? displayPrice(row.purchasePrice, "元", 2)
|
||||
: displayPrice(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice, "元", 2)
|
||||
? displayPrice(row.purchasePrice)
|
||||
: displayPrice(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice)
|
||||
}}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="totalAmount" title="累计总金额">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.unitId && row.quantity && row.unit && !row.erpUnitVos">
|
||||
{{ displayPrice(row.quantity * parseFloat(row.purchasePrice), "元", 2) }}
|
||||
{{ displayPrice(row.quantity * parseFloat(row.purchasePrice)) }}
|
||||
</span>
|
||||
<span v-if="row.unitId && row.quantity && row.erpUnitVos">
|
||||
{{
|
||||
displayPrice(Number(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice) * row.quantity, "元", 2)
|
||||
}}
|
||||
{{ displayPrice(Number(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice) * row.quantity) }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
@@ -153,19 +151,14 @@
|
||||
<el-card class="h-full flex items-center overflow-auto">
|
||||
<el-form :model="receiveAmountForm" :rules="receiveAmountFormRules" label-width="100px">
|
||||
<el-form-item label="单据金额:" prop="totalAmount">
|
||||
<span class="w-full text-purple-600 border-b border-b-black text-xl h-8 text-center">{{
|
||||
displayPrice(totalAmount, "元", 2)
|
||||
}}</span>
|
||||
<span class="w-full text-purple-600 border-b border-b-black text-xl h-8 text-center">{{ displayPrice(totalAmount) }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item class="receive-amount-input" label="收款金额:" prop="receiveAmount">
|
||||
<el-input v-model.trim="receiveAmountForm.receiveAmount" />
|
||||
</el-form-item>
|
||||
<el-form-item label="找零:" prop="backAmount">
|
||||
<span class="w-full text-green-600 border-b border-b-black text-xl h-8 text-center">
|
||||
{{
|
||||
receiveAmountForm.receiveAmount &&
|
||||
displayPrice(Number(totalAmount) - storePrice(receiveAmountForm.receiveAmount), "元", 2)
|
||||
}}
|
||||
{{ receiveAmountForm.receiveAmount && displayPrice(Number(totalAmount) - storePrice(receiveAmountForm.receiveAmount)) }}
|
||||
</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -132,16 +132,16 @@ const getsupermarketSpuData = async (id: string) => {
|
||||
if (res.code === 0) {
|
||||
res.data.smErpUnitEntityList = res.data.smErpUnitEntityList.map((item: rowVU) => {
|
||||
// 格式化金额数据
|
||||
item.retailPrice = parseFloat(displayPrice(item.retailPrice, "", 2))
|
||||
item.promotionPrice = parseFloat(displayPrice(item.promotionPrice, "", 2))
|
||||
item.purchasePrice = parseFloat(displayPrice(item.purchasePrice, "", 2))
|
||||
item.costPrice = parseFloat(displayPrice(item.costPrice, "", 2))
|
||||
item.retailPrice = parseFloat(displayPrice(item.retailPrice, ""))
|
||||
item.promotionPrice = parseFloat(displayPrice(item.promotionPrice, ""))
|
||||
item.purchasePrice = parseFloat(displayPrice(item.purchasePrice, ""))
|
||||
item.costPrice = parseFloat(displayPrice(item.costPrice, ""))
|
||||
return item
|
||||
})
|
||||
|
||||
Object.assign(form, {
|
||||
...res.data,
|
||||
grossMargin: parseFloat(displayPrice(res.data.grossMargin, "", 2)),
|
||||
grossMargin: parseFloat(displayPrice(res.data.grossMargin, "")),
|
||||
})
|
||||
}
|
||||
} catch (error: any) {
|
||||
@@ -184,16 +184,18 @@ const usePackageUnitList = () => {
|
||||
|
||||
// 整理辅助条码列表
|
||||
const useAuxiliaryCode = () => {
|
||||
return form.smErpAuxiliaryCodeEntityList.map((item: rowVC) => {
|
||||
const curAuxiliaryCodeItem = form.smErpUnitEntityList.find((unitItem: any) => unitItem.id === item.unitId)
|
||||
if (curAuxiliaryCodeItem.barCode) item.barCode = curAuxiliaryCodeItem.barCode
|
||||
if (item.isNew) {
|
||||
item.id = ""
|
||||
if (curAuxiliaryCodeItem.isNew) item.unitId = ""
|
||||
delete item.isNew
|
||||
}
|
||||
return item
|
||||
})
|
||||
return form.smErpAuxiliaryCodeEntityList
|
||||
.filter((item: rowVC) => item.unitId)
|
||||
.map((item: rowVC) => {
|
||||
const curAuxiliaryCodeItem = form.smErpUnitEntityList.find((unitItem: any) => unitItem.id === item.unitId)
|
||||
if (curAuxiliaryCodeItem.barCode) item.barCode = curAuxiliaryCodeItem.barCode
|
||||
if (item.isNew) {
|
||||
item.id = ""
|
||||
if (curAuxiliaryCodeItem.isNew) item.unitId = ""
|
||||
delete item.isNew
|
||||
}
|
||||
return item
|
||||
})
|
||||
}
|
||||
|
||||
// 提交
|
||||
|
||||
Reference in new issue
Block a user