修改
This commit is contained in:
1 parent
e8ceb6084c
commit
f26d9b3b5e
6 files changed
+61
-73
No files matched your search
@@ -108,6 +108,7 @@
|
||||
:label="item.unit"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option v-else :key="row.id" :label="row.unit" :value="row.id" />
|
||||
</el-select>
|
||||
</template>
|
||||
<template #default="{ row }">
|
||||
@@ -124,17 +125,22 @@
|
||||
|
||||
<vxe-column field="unitPrice" title="进价">
|
||||
<template #default="{ row }">
|
||||
{{ row.purchasePrice ?? row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice }}
|
||||
{{
|
||||
row.purchasePrice
|
||||
? 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 }">
|
||||
{{
|
||||
row.unitId && row.quantity
|
||||
? Number(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice) * row.quantity
|
||||
: ""
|
||||
}}
|
||||
<span v-if="row.unitId && row.quantity && row.unit && !row.erpUnitVos">
|
||||
{{ 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) }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
|
||||
@@ -179,11 +185,11 @@ import { getObj, addObj, putObj } from "/@/api/supermarketerp/smErpInventoryReco
|
||||
import { getPlanCode, getErpSpuSimpleAll } from "/@/api/supermarketerp/common"
|
||||
import { VxeTableEvents, VxeTablePropTypes, type VxeTableInstance } from "vxe-table"
|
||||
import { getSupplierTypeOptions } from "/@/api/supermarketerp/smErpSupplier"
|
||||
import { storePrice } from "/@/utils/formatMoney"
|
||||
import { formatDate } from "/@/utils/formatTime"
|
||||
import { Search } from "@element-plus/icons-vue"
|
||||
import erpSpuSelectDialog from "/@/views/supermarketerp/components/erpSpuSelectDialog.vue"
|
||||
import linkCgCodeDialog from "/@/views/supermarketerp/smErpCgDd/components/linkCgCodeDialog.vue"
|
||||
import { displayPrice } from "/@/utils/formatMoney"
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
@@ -198,15 +204,10 @@ const baseDataForm = reactive<any>({
|
||||
id: "",
|
||||
inventoryCode: "",
|
||||
inventoryDate: formatDate(new Date(), "YYYY-mm-dd"),
|
||||
inventoryType: "4",
|
||||
sourceId: "",
|
||||
warehouseId: "",
|
||||
handlerUserId: "",
|
||||
checkStatus: "",
|
||||
checkUserId: "",
|
||||
checkTime: "",
|
||||
merchantId: "",
|
||||
deptId: "",
|
||||
supplierId: "",
|
||||
remark: "",
|
||||
orderType: "2",
|
||||
@@ -416,7 +417,7 @@ const cgPlanSpuItems = computed(() => {
|
||||
id: item.isNew ? undefined : item.id,
|
||||
erpSpuId: item.erpSpuId,
|
||||
quantity: item.quantity,
|
||||
unitPrice: unit.purchasePrice ? storePrice(unit?.purchasePrice) : 0,
|
||||
unitPrice: unit.purchasePrice ? Number(unit?.purchasePrice) : 0,
|
||||
totalAmount: Number(unit?.purchasePrice || 0) * item.quantity,
|
||||
remark: item.remark,
|
||||
unitId: item.unitId,
|
||||
@@ -426,7 +427,7 @@ const cgPlanSpuItems = computed(() => {
|
||||
id: item.isNew ? undefined : item.id,
|
||||
erpSpuId: item.erpSpuId,
|
||||
quantity: item.quantity,
|
||||
unitPrice: item.unitPrice ? storePrice(item.unitPrice) : 0,
|
||||
unitPrice: item.unitPrice ? Number(item.unitPrice) : 0,
|
||||
totalAmount: Number(item.unitPrice || 0) * item.quantity,
|
||||
remark: item.remark,
|
||||
unitId: item.unitId,
|
||||
|
||||
@@ -44,10 +44,10 @@
|
||||
<el-table-column prop="handlerUserId" label="经办人" show-overflow-tooltip />
|
||||
<el-table-column prop="checkStatus" label="审批状态" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="check_status" :value="scope.row.checkStatus"></dict-tag>
|
||||
<dict-tag :options="check_status" :value="scope.row.checkStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="totalAmount" label="金额合计" show-overflow-tooltip />-->
|
||||
<!-- <el-table-column prop="totalAmount" label="金额合计" show-overflow-tooltip /> -->
|
||||
<el-table-column prop="supplierId" label="货商" show-overflow-tooltip />
|
||||
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150">
|
||||
|
||||
@@ -112,6 +112,7 @@
|
||||
:label="item.unit"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option v-else :key="row.id" :label="row.unit" :value="row.id" />
|
||||
</el-select>
|
||||
</template>
|
||||
<template #default="{ row }">
|
||||
@@ -126,22 +127,24 @@
|
||||
</template>
|
||||
</vxe-column>
|
||||
|
||||
<vxe-column field="unitPrice" title="进价" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
|
||||
<vxe-column field="purchasePrice" title="进价">
|
||||
<template #default="{ row }">
|
||||
{{ row.purchasePrice ?? row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice }}
|
||||
</template>
|
||||
<template #edit="{ row }">
|
||||
<el-input v-model="row.purchasePrice" />
|
||||
{{
|
||||
row.purchasePrice
|
||||
? 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 }">
|
||||
{{
|
||||
row.unitId && row.quantity
|
||||
? Number(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice) * row.quantity
|
||||
: ""
|
||||
}}
|
||||
<span v-if="row.unitId && row.quantity && row.unit && !row.erpUnitVos">
|
||||
{{ 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) }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
|
||||
@@ -186,11 +189,11 @@ import { getObj, addObj, putObj } from "/@/api/supermarketerp/smErpCgDd"
|
||||
import { getPlanCode, getErpSpuSimpleAll } from "/@/api/supermarketerp/common"
|
||||
import { VxeTableEvents, VxeTablePropTypes, type VxeTableInstance } from "vxe-table"
|
||||
import { getSupplierTypeOptions } from "/@/api/supermarketerp/smErpSupplier"
|
||||
import { storePrice } from "/@/utils/formatMoney"
|
||||
import { formatDate } from "/@/utils/formatTime"
|
||||
import { Search } from "@element-plus/icons-vue"
|
||||
import erpSpuSelectDialog from "/@/views/supermarketerp/components/erpSpuSelectDialog.vue"
|
||||
import linkCgCodeDialog from "/@/views/supermarketerp/smErpCgDd/components/linkCgCodeDialog.vue"
|
||||
import { displayPrice } from "/@/utils/formatMoney"
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
@@ -210,10 +213,6 @@ const baseDataForm = reactive<any>({
|
||||
linkCode: "",
|
||||
checkStatus: "",
|
||||
checkUserId: "",
|
||||
checkTime: "",
|
||||
merchantId: "",
|
||||
deptId: "",
|
||||
quantity: "",
|
||||
totalNumber: "",
|
||||
totalAmount: "",
|
||||
supplierId: "",
|
||||
@@ -252,8 +251,6 @@ const dataRules = ref({
|
||||
const validRules = ref<VxeTablePropTypes.EditRules<any>>({
|
||||
unitId: [{ required: true, message: "必须选择" }],
|
||||
quantity: [{ required: true, type: "number", min: 1, max: 99, message: "数值范围1~99" }],
|
||||
unitPrice: [{ required: true, type: "number", min: 0, message: "请输入数值" }],
|
||||
purchasePrice: [{ required: true, type: "number", min: 0, message: "请输入数值" }],
|
||||
})
|
||||
|
||||
// 初始化数据
|
||||
@@ -425,7 +422,7 @@ const cgPlanSpuItems = computed(() => {
|
||||
id: item.isNew ? undefined : item.id,
|
||||
erpSpuId: item.erpSpuId,
|
||||
quantity: item.quantity,
|
||||
unitPrice: unit.purchasePrice ? storePrice(unit?.purchasePrice) : 0,
|
||||
unitPrice: unit.purchasePrice ? Number(unit?.purchasePrice) : 0,
|
||||
totalAmount: Number(unit?.purchasePrice || 0) * item.quantity,
|
||||
remark: item.remark,
|
||||
unitId: item.unitId,
|
||||
@@ -435,7 +432,7 @@ const cgPlanSpuItems = computed(() => {
|
||||
id: item.isNew ? undefined : item.id,
|
||||
erpSpuId: item.erpSpuId,
|
||||
quantity: item.quantity,
|
||||
unitPrice: item.unitPrice ? storePrice(item.unitPrice) : 0,
|
||||
unitPrice: item.unitPrice ? Number(item.unitPrice) : 0,
|
||||
totalAmount: Number(item.unitPrice || 0) * item.quantity,
|
||||
remark: item.remark,
|
||||
unitId: item.unitId,
|
||||
|
||||
@@ -177,7 +177,6 @@ import { getSupplierTypeOptions } from "/@/api/supermarketerp/smErpSupplier"
|
||||
import { getObj, addObj, putObj } from "/@/api/supermarketerp/smErpCgPlan"
|
||||
import { getPlanCode, getErpSpuSimpleAll } from "/@/api/supermarketerp/common"
|
||||
import erpSpuSelectDialog from "/@/views/supermarketerp/components/erpSpuSelectDialog.vue"
|
||||
import { storePrice } from "/@/utils/formatMoney"
|
||||
import { formatDate } from "/@/utils/formatTime"
|
||||
|
||||
const router = useRouter()
|
||||
@@ -191,9 +190,7 @@ const supplierTypeDict = ref<any[]>([]) // 货商下拉选项
|
||||
const baseDataForm = reactive<any>({
|
||||
id: undefined,
|
||||
planCode: "",
|
||||
orderNumber: "",
|
||||
planDate: formatDate(new Date(), "YYYY-mm-dd"),
|
||||
supplierId: "",
|
||||
handlerUserId: "",
|
||||
remark: "",
|
||||
})
|
||||
@@ -218,7 +215,6 @@ const dataRules = ref({
|
||||
planCode: [{ required: true, message: "采购计划编号不能为空", trigger: "blur" }],
|
||||
planDate: [{ required: true, message: "采购计划单据日期不能为空", trigger: "blur" }],
|
||||
handlerUserId: [{ required: true, message: "经办人不能为空", trigger: "blur" }],
|
||||
supplierId: [{ required: true, message: "货商不能为空", trigger: "blur" }],
|
||||
})
|
||||
|
||||
// 可编辑表格校验规则
|
||||
@@ -239,15 +235,7 @@ const getInitData = async () => {
|
||||
.finally(() => (loading.value = false))
|
||||
|
||||
if (cgPlanData && cgPlanData.code === 0) {
|
||||
Object.assign(baseDataForm, {
|
||||
id: cgPlanData.data.id,
|
||||
planCode: cgPlanData.data.planCode,
|
||||
orderNumber: cgPlanData.data.orderNumber,
|
||||
planDate: cgPlanData.data.planDate,
|
||||
supplierId: cgPlanData.data.supplierId,
|
||||
handlerUserId: cgPlanData.data.handlerUserId,
|
||||
remark: cgPlanData.data.remark,
|
||||
})
|
||||
Object.assign(baseDataForm, cgPlanData.data)
|
||||
state.editableTableData = cgPlanData.data.items
|
||||
state.erpSpuItemsMemo = cgPlanData.data.items
|
||||
}
|
||||
@@ -388,7 +376,7 @@ const cgPlanSpuItems = computed(() => {
|
||||
id: item.isNew ? undefined : item.id,
|
||||
erpSpuId: item.erpSpuId,
|
||||
quantity: item.quantity,
|
||||
unitPrice: unit.purchasePrice ? storePrice(unit?.purchasePrice) : 0,
|
||||
unitPrice: unit.purchasePrice ? Number(unit?.purchasePrice) : 0,
|
||||
totalAmount: Number(unit?.purchasePrice || 0) * item.quantity,
|
||||
remark: item.remark,
|
||||
unitId: item.unitId,
|
||||
|
||||
@@ -112,6 +112,7 @@
|
||||
:label="item.unit"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option v-else :key="row.id" :label="row.unit" :value="row.id" />
|
||||
</el-select>
|
||||
</template>
|
||||
<template #default="{ row }">
|
||||
@@ -128,17 +129,22 @@
|
||||
|
||||
<vxe-column field="unitPrice" title="进价">
|
||||
<template #default="{ row }">
|
||||
{{ row.purchasePrice ?? row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice }}
|
||||
{{
|
||||
row.purchasePrice
|
||||
? 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 }">
|
||||
{{
|
||||
row.unitId && row.quantity
|
||||
? Number(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice) * row.quantity
|
||||
: ""
|
||||
}}
|
||||
<span v-if="row.unitId && row.quantity && row.unit && !row.erpUnitVos">
|
||||
{{ 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) }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
|
||||
@@ -183,11 +189,11 @@ import { getObj, addObj, putObj } from "/@/api/supermarketerp/smErpInventoryReco
|
||||
import { getPlanCode, getErpSpuSimpleAll } from "/@/api/supermarketerp/common"
|
||||
import { VxeTableEvents, VxeTablePropTypes, type VxeTableInstance } from "vxe-table"
|
||||
import { getSupplierTypeOptions } from "/@/api/supermarketerp/smErpSupplier"
|
||||
import { storePrice } from "/@/utils/formatMoney"
|
||||
import { formatDate } from "/@/utils/formatTime"
|
||||
import { Search } from "@element-plus/icons-vue"
|
||||
import erpSpuSelectDialog from "/@/views/supermarketerp/components/erpSpuSelectDialog.vue"
|
||||
import linkCgCodeDialog from "/@/views/supermarketerp/smErpCgDd/components/linkCgCodeDialog.vue"
|
||||
import { displayPrice } from "/@/utils/formatMoney"
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
@@ -202,15 +208,10 @@ const baseDataForm = reactive<any>({
|
||||
id: "",
|
||||
inventoryCode: "",
|
||||
inventoryDate: formatDate(new Date(), "YYYY-mm-dd"),
|
||||
inventoryType: "3",
|
||||
sourceId: "",
|
||||
warehouseId: "",
|
||||
handlerUserId: "",
|
||||
checkStatus: "",
|
||||
checkUserId: "",
|
||||
checkTime: "",
|
||||
merchantId: "",
|
||||
deptId: "",
|
||||
supplierId: "",
|
||||
remark: "",
|
||||
orderType: "1",
|
||||
@@ -420,7 +421,7 @@ const cgPlanSpuItems = computed(() => {
|
||||
id: item.isNew ? undefined : item.id,
|
||||
erpSpuId: item.erpSpuId,
|
||||
quantity: item.quantity,
|
||||
unitPrice: unit.purchasePrice ? storePrice(unit?.purchasePrice) : 0,
|
||||
unitPrice: unit.purchasePrice ? Number(unit?.purchasePrice) : 0,
|
||||
totalAmount: Number(unit?.purchasePrice || 0) * item.quantity,
|
||||
remark: item.remark,
|
||||
unitId: item.unitId,
|
||||
@@ -430,7 +431,7 @@ const cgPlanSpuItems = computed(() => {
|
||||
id: item.isNew ? undefined : item.id,
|
||||
erpSpuId: item.erpSpuId,
|
||||
quantity: item.quantity,
|
||||
unitPrice: item.unitPrice ? storePrice(item.unitPrice) : 0,
|
||||
unitPrice: item.unitPrice ? Number(item.unitPrice) : 0,
|
||||
totalAmount: Number(item.unitPrice || 0) * item.quantity,
|
||||
remark: item.remark,
|
||||
unitId: item.unitId,
|
||||
|
||||
Reference in new issue
Block a user