采购退货和零售退货调整、商品管理默认包装单位回显
This commit is contained in:
1 parent
7826941946
commit
1dd21a5061
8 files changed
+78
-57
No files matched your search
@@ -0,0 +1,48 @@
|
||||
import request from "/@/utils/request"
|
||||
|
||||
export function fetchList(query?: Object) {
|
||||
return request({
|
||||
url: "/supermarket/smErpCgBack/page",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function addObj(obj?: Object) {
|
||||
return request({
|
||||
url: "/supermarket/smErpCgBack",
|
||||
method: "post",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
|
||||
export function getObj(id?: string) {
|
||||
return request({
|
||||
url: "/supermarket/smErpCgBack/" + id,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
export function delObjs(ids?: Object) {
|
||||
return request({
|
||||
url: "/supermarket/smErpCgBack",
|
||||
method: "delete",
|
||||
data: ids,
|
||||
})
|
||||
}
|
||||
|
||||
export function putObj(obj?: Object) {
|
||||
return request({
|
||||
url: "/supermarket/smErpCgBack",
|
||||
method: "put",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
|
||||
export function getCgInventoryPage(params?: Object) {
|
||||
return request({
|
||||
url: "/smErpInventoryRecords/inventory/page",
|
||||
method: "get",
|
||||
params,
|
||||
})
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
import request from "/@/utils/request"
|
||||
|
||||
export function fetchList(query?: Object) {
|
||||
return request({
|
||||
url: '/supermarket/smErpInventoryRecordsItem/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function addObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/supermarket/smErpInventoryRecordsItem',
|
||||
method: 'post',
|
||||
data: obj
|
||||
})
|
||||
}
|
||||
|
||||
export function getObj(id?: string) {
|
||||
return request({
|
||||
url: '/supermarket/smErpInventoryRecordsItem/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function delObjs(ids?: Object) {
|
||||
return request({
|
||||
url: '/supermarket/smErpInventoryRecordsItem',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function putObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/supermarket/smErpInventoryRecordsItem',
|
||||
method: 'put',
|
||||
data: obj
|
||||
})
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import request from "/@/utils/request"
|
||||
|
||||
export function getCgInventoryPage(params?: Object) {
|
||||
return request({
|
||||
url: "/smErpInventoryRecords/inventory/page",
|
||||
method: "get",
|
||||
params,
|
||||
})
|
||||
}
|
||||
@@ -55,8 +55,8 @@
|
||||
|
||||
<script setup lang="ts" name="linkCgCodeDialog">
|
||||
import { ref } from "vue"
|
||||
import { getCgddPage } from "/@/api/supermarketerp/smErpInventoryRecords"
|
||||
import { VxeTableEvents } from "vxe-table"
|
||||
import { getCgInventoryPage } from "/@/api/supermarketerp/smErpCgBack"
|
||||
|
||||
const linkCgCodeDialogVisible = defineModel()
|
||||
const emit = defineEmits(["getSelectedCgPlan"])
|
||||
@@ -74,7 +74,7 @@ const openLinkCodeDialog = async () => {
|
||||
step.value = 0
|
||||
linkCodeLoading.value = true
|
||||
try {
|
||||
const res = await getCgddPage().finally(() => (linkCodeLoading.value = false))
|
||||
const res = await getCgInventoryPage({ inventoryType: "3" }).finally(() => (linkCodeLoading.value = false))
|
||||
if (res.code === 0) {
|
||||
cgddPage.value = res.data.records
|
||||
}
|
||||
|
||||
@@ -181,14 +181,14 @@
|
||||
import { ref, reactive, computed, onMounted } from "vue"
|
||||
import { useRouter, useRoute } from "vue-router"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { getObj, addObj, putObj } from "/@/api/supermarketerp/smErpInventoryRecords"
|
||||
import { getObj, addObj, putObj } from "/@/api/supermarketerp/smErpCgBack"
|
||||
import { getPlanCode, getErpSpuSimpleAll } from "/@/api/supermarketerp/common"
|
||||
import { VxeTableEvents, VxeTablePropTypes, type VxeTableInstance } from "vxe-table"
|
||||
import { getSupplierTypeOptions } from "/@/api/supermarketerp/smErpSupplier"
|
||||
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 linkCgCodeDialog from "/@/views/supermarketerp/smErpCgBack/components/linkCgCodeDialog.vue"
|
||||
import { displayPrice } from "/@/utils/formatMoney"
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
@@ -55,8 +55,8 @@
|
||||
|
||||
<script setup lang="ts" name="linkCgCodeDialog">
|
||||
import { ref } from "vue"
|
||||
import { getCgddPage } from "/@/api/supermarketerp/smErpInventoryRecords"
|
||||
import { VxeTableEvents } from "vxe-table"
|
||||
import { getCgInventoryPage } from "/@/api/supermarketerp/smErpRetailBack"
|
||||
|
||||
const linkCgCodeDialogVisible = defineModel()
|
||||
const emit = defineEmits(["getSelectedCgPlan"])
|
||||
@@ -74,7 +74,7 @@ const openLinkCodeDialog = async () => {
|
||||
step.value = 0
|
||||
linkCodeLoading.value = true
|
||||
try {
|
||||
const res = await getCgddPage().finally(() => (linkCodeLoading.value = false))
|
||||
const res = await getCgInventoryPage({ inventoryType: "5" }).finally(() => (linkCodeLoading.value = false))
|
||||
if (res.code === 0) {
|
||||
cgddPage.value = res.data.records
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ import { getSupplierTypeOptions } from "/@/api/supermarketerp/smErpSupplier"
|
||||
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 linkCgCodeDialog from "/@/views/supermarketerp/smErpRetailBack/components/linkCgCodeDialog.vue"
|
||||
import { displayPrice, storePrice } from "/@/utils/formatMoney"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
|
||||
|
||||
@@ -244,7 +244,10 @@ const openDialog = async (id: string) => {
|
||||
// 获取supermarketSpu信息
|
||||
if (id) {
|
||||
form.id = id
|
||||
getsupermarketSpuData(id)
|
||||
await getsupermarketSpuData(id)
|
||||
|
||||
// 设置基础包装单位单选行
|
||||
supermarketUnitEntityListRef.value.setRadioRow(form.smErpUnitEntityList.findIndex((item: any) => item.isBase))
|
||||
}
|
||||
|
||||
// 获取分类下拉选项 & 获取品牌下拉选项 & 获取货商下拉选项
|
||||
@@ -268,17 +271,19 @@ const getsupermarketSpuData = async (id: string) => {
|
||||
if (res.code === 0) {
|
||||
res.data.smErpUnitEntityList = res.data.smErpUnitEntityList.map((item: any) => {
|
||||
// 格式化数据
|
||||
item.retailPrice = displayPrice(item.retailPrice, "")
|
||||
item.promotionPrice = displayPrice(item.promotionPrice, "")
|
||||
item.purchasePrice = displayPrice(item.purchasePrice, "")
|
||||
item.costPrice = displayPrice(item.costPrice, "")
|
||||
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)
|
||||
|
||||
// 设置基础包装单位单选行
|
||||
supermarketUnitEntityListRef.value.setRadioRow(form.smErpUnitEntityList.findIndex((item: any) => item.isBase))
|
||||
Object.assign(form, {
|
||||
...res.data,
|
||||
costPrice: parseFloat(displayPrice(res.data.costPrice, "")),
|
||||
purchasePrice: parseFloat(displayPrice(res.data.purchasePrice, "")),
|
||||
retailPrice: parseFloat(displayPrice(res.data.retailPrice, "")),
|
||||
})
|
||||
|
||||
console.log("获取的商品详情:", res.data)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user