This commit is contained in:
weiwei committed 2025-03-11 21:56:40 +08:00
1 parent 462f7bbc73
commit 2caf6ff1e3
6 files changed
+69 -63

No files matched your search

+6 -6
View File
@@ -8,18 +8,18 @@ VITE_OPEN = true
ENV = 'development'
# ADMIN 服务地址
# VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/ # 线上
VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/ # 测试线上
# VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/
# VITE_ADMIN_PROXY_PATH = http://localhost:9999/
VITE_ADMIN_PROXY_PATH = http://192.168.101.60:9999/ # 邓-本地
# VITE_ADMIN_PROXY_PATH = http://59.202.170.152:81/api # 正式环境
# VITE_ADMIN_PROXY_PATH = http://192.168.101.60:9999/ # 邓-本地
# VITE_ADMIN_PROXY_PATH = http://59.202.170.152:81/api # 正式环境线上
# 图片访问基础地址
# VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api # 线上
VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api # 测试线上
# VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc
# VITE_IMAGE_BASE_PATH = http://localhost:9999
VITE_IMAGE_BASE_PATH = http://192.168.101.50:9999 # 邓-本地
# VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api/ # 正式环境
# VITE_IMAGE_BASE_PATH = http://192.168.101.50:9999 # 邓-本地
# VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api/ # 正式环境线上
# 代码生成服务地址
VITE_GEN_PROXY_PATH = http://192.168.110.156:5003
+2 -1
View File
@@ -6,7 +6,8 @@ import request from "/@/utils/request"
// type:4 获取采购退货编号
// type:5 获取零售出库编号
// type:4 获取零售退货编号
export function getPlanCode(params: { type: 1 | 2 | 3 | 4 | 5 | 6 }) {
// type:7 获取库存盘点编号
export function getPlanCode(params: { type: 1 | 2 | 3 | 4 | 5 | 6 | 7 }) {
return request({
url: "/supermarket/sm/common/getSequence",
method: "get",
@@ -10,15 +10,15 @@
>
<el-row>
<el-form :model="queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataListAndSelect">
<el-form-item label="商品名称" prop="productName">
<el-input placeholder="请输入商品名称" v-model="queryForm.productName" />
</el-form-item>
<el-form-item label="货号" prop="productCode">
<el-input placeholder="请输入货号" v-model="queryForm.productCode" />
</el-form-item>
<el-form-item label="自编码/条码" prop="barcode">
<el-input placeholder="请输入自编码/条码" v-model="queryForm.barcode" />
</el-form-item>
<el-form-item label="商品名称" prop="productName">
<el-input placeholder="请输入商品名称" v-model="queryForm.productName" />
</el-form-item>
<el-form-item>
<el-button icon="search" type="primary" @click="getDataListAndSelect">查询</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
@@ -42,20 +42,20 @@
<preview-image @click.stop :src="scope.row.picUrl" />
</template>
</el-table-column>
<!-- <el-table-column prop="barcode" label="自编码/条码" min-width="150px" align="center" show-overflow-tooltip />-->
<!-- <el-table-column prop="barcode" label="自编码/条码" min-width="150px" align="center" show-overflow-tooltip /> -->
<el-table-column prop="stock" label="库存" min-width="80px" align="center" show-overflow-tooltip />
<el-table-column prop="productCode" label="货号" min-width="100px" align="center" show-overflow-tooltip />
<!-- <el-table-column prop="brandId" label="品牌" min-width="100px" align="center" show-overflow-tooltip>-->
<!-- <template #default="scope">-->
<!-- {{ supermarketBrand?.find((item: any) => item.id === scope.row.brandId)?.name }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="brandId" label="品牌" min-width="100px" align="center" show-overflow-tooltip>-->
<!-- <template #default="scope">-->
<!-- {{ supermarketBrand?.find((item: any) => item.id === scope.row.brandId)?.name }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column prop="categoryId" label="分类" min-width="100px" align="center" show-overflow-tooltip>
<template #default="scope">
{{ supermarketCategory?.find((item: any) => item.id === scope.row.categoryId)?.name }}
</template>
</el-table-column>
<!-- <el-table-column prop="deptId" label="商户" min-width="100px" align="center" show-overflow-tooltip />-->
<!-- <el-table-column prop="deptId" label="商户" min-width="100px" align="center" show-overflow-tooltip /> -->
<el-table-column prop="supplierId" label="货商" min-width="100px" align="center" show-overflow-tooltip />
<el-table-column prop="status" label="状态" min-width="100px" align="center" show-overflow-tooltip>
<template #default="scope">
@@ -130,7 +130,7 @@ const getDataListAndSelect = async () => {
nextTick(() => {
// 合并当前页面数据中的已选行和之前保存的已选行
const rowsToSelect = [
...currentSelectedRows,
// ...currentSelectedRows,
...props.selectedSpuRows.filter((row) => spuDataList.value.some((item) => item.erpSpuId === row.erpSpuId)),
]
// 去重
@@ -145,6 +145,8 @@ const getDataListAndSelect = async () => {
} catch (error) {
spuDataList.value = []
spuListLoading.value = false
} finally {
spuListLoading.value = false
}
}
+26 -26
View File
@@ -70,7 +70,7 @@
>
<vxe-column type="checkbox" width="40" fixed="left" />
<vxe-column type="seq" width="50" fixed="left" />
<vxe-column field="productCode" title="货号编码"/>
<vxe-column field="productCode" title="货号编码" />
<vxe-column field="productName" title="商品名称">
<template #default="{ row }">
<span v-if="row.productName">{{ row.productName }}</span>
@@ -100,21 +100,21 @@
<el-input v-model="row.quantity" />
</template>
</vxe-column>
<vxe-column field="currentStock" title="实际数量" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
<template #edit="{ row }">
<el-input v-model="row.quantity" />
</template>
</vxe-column>
<vxe-column field="profit" title="盈" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
<template #edit="{ row }">
<el-input v-model="row.quantity" />
</template>
</vxe-column>
<vxe-column field="loss" title="亏" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
<template #edit="{ row }">
<el-input v-model="row.quantity" />
</template>
</vxe-column>
<vxe-column field="currentStock" title="实际数量" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
<template #edit="{ row }">
<el-input v-model="row.quantity" />
</template>
</vxe-column>
<vxe-column field="profit" title="盈" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
<template #edit="{ row }">
<el-input v-model="row.quantity" />
</template>
</vxe-column>
<vxe-column field="loss" title="亏" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
<template #edit="{ row }">
<el-input v-model="row.quantity" />
</template>
</vxe-column>
<vxe-column field="unitPrice" title="账面进价">
<template #default="{ row }">
{{
@@ -124,16 +124,16 @@
}}
</template>
</vxe-column>
<vxe-column field="pdPrice" title="盘点单价" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
<template #edit="{ row }">
<el-input v-model="row.quantity" />
</template>
</vxe-column>
<vxe-column field="pdTotalNum" title="盘后总数" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
<template #edit="{ row }">
<el-input v-model="row.quantity" />
</template>
</vxe-column>
<vxe-column field="pdPrice" title="盘点单价" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
<template #edit="{ row }">
<el-input v-model="row.quantity" />
</template>
</vxe-column>
<vxe-column field="pdTotalNum" title="盘后总数" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
<template #edit="{ row }">
<el-input v-model="row.quantity" />
</template>
</vxe-column>
<vxe-column field="totalAmount" title="盘后总金额">
<template #default="{ row }">
<span v-if="row.unitId && row.quantity && row.unit && !row.erpUnitVos">
@@ -31,7 +31,7 @@
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button icon="folder-add" type="primary" class="ml10" @click="handleClickCreateInventoryRecord()"> 新 增 </el-button>
<el-button icon="folder-add" type="primary" class="ml10" @click="handleClickCreateStockTaking()"> 新 增 </el-button>
<el-button plain :disabled="multiple" icon="Delete" type="primary" @click="handleDelete(selectObjs)"> 删 除 </el-button>
<right-toolbar
v-model:showSearch="showSearch"
@@ -68,7 +68,7 @@
<el-table-column prop="totalAmount" label="入库总金额" show-overflow-tooltip />
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button icon="edit-pen" text type="primary" @click="handleClickEditInventoryRecord(scope.row.id)"> 编辑 </el-button>
<el-button icon="edit-pen" text type="primary" @click="handleClickEditStockTaking(scope.row.id)">编辑</el-button>
<el-button icon="delete" text type="primary" @click="handleDelete([scope.row.id])"> 删除 </el-button>
</template>
</el-table-column>
@@ -124,10 +124,8 @@ const selectionChangHandle = (objs: { id: string }[]) => {
multiple.value = !objs.length
}
// 点击创建出库入库记录表
const handleClickCreateInventoryRecord = () => router.push({ path: "/supermarketerp/stockTaking/form" })
// 点击编辑出库入库记录表
const handleClickEditInventoryRecord = (id: string) => router.push({ path: "/supermarketerp/stockTaking/form", query: { id } })
const handleClickCreateStockTaking = () => router.push({ path: "/supermarketerp/stockTaking/form" })
const handleClickEditStockTaking = (id: string) => router.push({ path: "/supermarketerp/stockTaking/form", query: { id } })
// 删除操作
const handleDelete = async (ids: string[]) => {
@@ -1,5 +1,5 @@
<template>
<el-dialog width="95%" :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
<el-dialog width="80%" :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="auto" v-loading="loading">
<el-tabs v-model="tabPaneActiveName" @tab-change="handleTabChange">
<el-tab-pane class="el-tab-pane" label="基础信息" name="基础信息">
@@ -162,14 +162,14 @@ const resetForm = () => {
const handleTabChange = (name: TabPaneName) => (currentTabPaneIndex.value = tabPaneEnum.findIndex((item) => item === name))
// 计算包装单位列表
const usePackageUnitList = computed(() => {
const smErpUnitEntityList = JSON.parse(JSON.stringify(form.smErpUnitEntityList))
const usePackageUnitList = () => {
const curRadioRowUnit = packageUnitRef.value.getRadioEvent()
const smErpUnitEntityList = JSON.parse(JSON.stringify(form.smErpUnitEntityList)) // 深拷贝
return smErpUnitEntityList.map((item: rowVU) => {
if (item.id === curRadioRowUnit.id) {
item.isBase = true
} else {
item.isBase = false
item.isBase = null
}
item.costPrice = storePrice(item.costPrice)
item.promotionPrice = storePrice(item.promotionPrice)
@@ -181,16 +181,17 @@ const usePackageUnitList = computed(() => {
}
return item
})
})
}
// 计算辅助条码列表
const useAuxiliaryCode = computed(() => {
const smErpUnitEntityList = JSON.parse(JSON.stringify(form.smErpUnitEntityList))
return form.smErpAuxiliaryCodeEntityList
const useAuxiliaryCode = () => {
const smErpAuxiliaryCodeEntityList = [...form.smErpAuxiliaryCodeEntityList]
return smErpAuxiliaryCodeEntityList
.filter((item: rowVC) => item.unitId)
.map((item: rowVC) => {
const curPackageUnitItem = smErpUnitEntityList.find((unitItem: any) => unitItem.id === item.unitId)
// if (curAuxiliaryCodeItem.barCode) item.barCode = curAuxiliaryCodeItem.barCode
const curPackageUnitItem = form.smErpUnitEntityList.find((unitItem: any) => unitItem.id === item.unitId)
console.log(form.smErpUnitEntityList)
if (item.isNew) {
item.id = ""
if (curPackageUnitItem?.isNew) item.unitId = ""
@@ -198,7 +199,7 @@ const useAuxiliaryCode = computed(() => {
}
return item
})
})
}
// 提交
const onSubmit = async () => {
@@ -212,13 +213,17 @@ const onSubmit = async () => {
// if (!form.smErpAuxiliaryCodeEntityList || form.smErpAuxiliaryCodeEntityList.length <= 0) return useMessage().warning("请添加辅助条码")
// if (!(await auxiliaryCodeRef.value.editableTableValidate())) return useMessage().warning("辅助条码必填项未填写完整")
console.log(form.smErpUnitEntityList)
const smErpAuxiliaryCodeEntityList = useAuxiliaryCode()
const smErpUnitEntityList = usePackageUnitList()
try {
loading.value = true
const _pa = {
...form,
grossMargin: storePrice(form.grossMargin),
smErpAuxiliaryCodeEntityList: useAuxiliaryCode.value,
smErpUnitEntityList: usePackageUnitList.value,
smErpAuxiliaryCodeEntityList,
smErpUnitEntityList,
}
console.log("提交的数据", _pa)