超市修复
This commit is contained in:
1 parent
2937f29168
commit
6e2dc50f40
5 files changed
+45
-18
No files matched your search
@@ -80,6 +80,7 @@ const dataRules = ref({
|
||||
merchantId: [{ required: true, message: "商户不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "品牌名称不能为空", trigger: "blur" }],
|
||||
sort: [{ validator: rule.number, trigger: "blur" }],
|
||||
status: [{ required: true, message: "请选择状态", trigger: "blur" }],
|
||||
})
|
||||
|
||||
// 打开弹窗
|
||||
|
||||
@@ -92,7 +92,11 @@
|
||||
<el-input-number v-model="row.promotionPrice" controls-position="right" :min="0" :precision="2" />
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="costPrice" title="成本价(元)" />
|
||||
<vxe-column field="costPrice" title="成本价(元)" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
|
||||
<template #edit="{ row }">
|
||||
<el-input-number v-model="row.costPrice" controls-position="right" :min="0" :precision="2" />
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<el-button v-if="currentTabPaneIndex == 1 || currentTabPaneIndex == 2" type="primary" @click="currentTabPaneIndex++">
|
||||
下一步
|
||||
</el-button>
|
||||
<el-button v-if="currentTabPaneIndex == 3" type="primary" @click="onSubmit" :disabled="loading">提 交</el-button>
|
||||
<el-button v-if="currentTabPaneIndex == 3" type="primary" @click="onSubmit" :loading="loading">提 交</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -147,7 +147,7 @@ const openDialog = async (id: string) => {
|
||||
const getsupermarketSpuData = async (id: string) => {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await getObj(id).finally(() => (loading.value = false))
|
||||
const res = await getObj(id)
|
||||
if (res.code === 0) {
|
||||
res.data.smErpUnitEntityList = res.data.smErpUnitEntityList.map((item: rowVU) => {
|
||||
// 格式化金额数据
|
||||
@@ -287,7 +287,11 @@ const onSubmit = async () => {
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
} finally {
|
||||
loading.value = false
|
||||
let timer = null
|
||||
timer = setTimeout(() => {
|
||||
loading.value = false
|
||||
timer = null
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -299,7 +303,7 @@ defineExpose({
|
||||
<style scoped>
|
||||
.el-tab-pane {
|
||||
overflow-y: auto;
|
||||
height: 60vh;
|
||||
height: 54vh;
|
||||
}
|
||||
::v-deep .el-tabs .el-tabs__nav .is-active {
|
||||
color: #2e5cf6 !important;
|
||||
|
||||
@@ -71,20 +71,25 @@
|
||||
>
|
||||
<el-table-column type="selection" width="40" fixed="left" />
|
||||
<el-table-column type="index" label="#" width="50" fixed="left" />
|
||||
<el-table-column prop="productCode" label="货号" show-overflow-tooltip />
|
||||
<el-table-column prop="productCode" label="货号" show-overflow-tooltip min-width="160" />
|
||||
<!-- <el-table-column prop="barcode" label="自编码/条码" show-overflow-tooltip width="100" /> -->
|
||||
<el-table-column prop="productName" label="商品名称" show-overflow-tooltip width="100" />
|
||||
<el-table-column prop="productName" label="商品名称" show-overflow-tooltip min-width="160" />
|
||||
<el-table-column prop="unit" label="单位" show-overflow-tooltip />
|
||||
<el-table-column prop="categoryId" label="商品分类" show-overflow-tooltip width="100">
|
||||
<template #default="scope">
|
||||
{{ supermarketCategory?.find((item: any) => item.id === scope.row.categoryId)?.name }}
|
||||
<el-tag>{{ supermarketCategory?.find((item: any) => item.id === scope.row.categoryId)?.name }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="brandId" label="品牌" show-overflow-tooltip>
|
||||
<el-table-column prop="supplierId" label="货商" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ supermarketSupplier?.find((item: any) => item.supplierId == scope.row.supplierId)?.supplierName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="brandId" label="品牌" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ supermarketBrand?.find((item: any) => item.id === scope.row.brandId)?.name }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table-column>
|
||||
<el-table-column prop="picUrl" label="封面图" width="100">
|
||||
<template #default="scope">
|
||||
<preview-image :src="scope.row.picUrl" />
|
||||
@@ -95,12 +100,13 @@
|
||||
<dict-tag :options="status" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="costPrice" label="成本单价" show-overflow-tooltip width="100" />
|
||||
<el-table-column prop="costPrice" label="成本单价(元)" show-overflow-tooltip width="120">
|
||||
<template #default="{ row }">{{ displayPrice(row.costPrice, "") }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stock" label="总库存" show-overflow-tooltip />
|
||||
<!-- <el-table-column prop="giveIntegral" label="赠送积分" show-overflow-tooltip /> -->
|
||||
<!-- <el-table-column prop="merchantId" label="商户编号" show-overflow-tooltip /> -->
|
||||
<!-- <el-table-column prop="specification" label="规格" show-overflow-tooltip /> -->
|
||||
<!-- <el-table-column prop="origin" label="产地" show-overflow-tooltip /> -->
|
||||
<!-- <el-table-column prop="packingQuantity" label="装数" show-overflow-tooltip /> -->
|
||||
<!-- <el-table-column prop="purchasePrice" label="进价)" show-overflow-tooltip /> -->
|
||||
<!-- <el-table-column prop="retailPrice" label="零售价" show-overflow-tooltip /> -->
|
||||
@@ -112,7 +118,11 @@
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="inventoryUpperLimit" label="库存上限" show-overflow-tooltip /> -->
|
||||
<!-- <el-table-column prop="inventoryLowerLimit" label="库存下限" show-overflow-tooltip /> -->
|
||||
<!-- <el-table-column prop="grossMargin" label="毛利率" show-overflow-tooltip /> -->
|
||||
<el-table-column prop="salesCount" label="售卖数量" show-overflow-tooltip min-width="100" />
|
||||
<el-table-column prop="grossMargin" label="毛利率" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ displayPrice(row.grossMargin, "") }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="origin" label="产地" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -151,6 +161,8 @@ import { fetchList, delObjs, getSupermarketCategory, getSupermarketBrand } from
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import UploadExcel from "./components/upload-excel.vue"
|
||||
import { displayPrice } from "/@/utils/formatMoney"
|
||||
import { getSupplierSimpleAll } from "/@/api/supermarketerp/smErpSupplier"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
@@ -163,6 +175,7 @@ const selectObjs = ref([]) as any // 表格行选中的数据
|
||||
const multiple = ref(true) // 是否已经多选
|
||||
const supermarketCategory = ref<any>([]) // 商品分类
|
||||
const supermarketBrand = ref<any>([]) // 商品品牌
|
||||
const supermarketSupplier = ref<any>([]) // 货商
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
@@ -223,5 +236,12 @@ onMounted(async () => {
|
||||
} catch (error) {
|
||||
supermarketBrand.value = []
|
||||
}
|
||||
// 获取货商
|
||||
try {
|
||||
const res = await getSupplierSimpleAll()
|
||||
supermarketSupplier.value = res.data
|
||||
} catch (error) {
|
||||
supermarketSupplier.value = []
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -28,9 +28,7 @@
|
||||
<dict-tag :options="wallet_biz_recharge" :value="detail.bizType" />
|
||||
</el-table-column>
|
||||
<el-table-column prop="currentImport_price" label="操作金额" align="center" min-width="250">
|
||||
<template #default="{ row }">
|
||||
<div class="color-success">{{ displayPrice(row.currentImport_price) }}</div>
|
||||
</template>
|
||||
<template #default="{ row }">{{ displayPrice(row.currentImport_price) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="detail.bizType == 2 && false" prop="afterBalance" label="记账扣款后余额" align="center" min-width="180">
|
||||
<template #default="{ row }">
|
||||
@@ -186,7 +184,7 @@ const getSummaries = (param: SummaryMethodProps) => {
|
||||
if (column.property === "currentImport_price") {
|
||||
const values = data1.map((item) => Number(item[column.property]))
|
||||
if (!values.every((value) => Number.isNaN(value))) {
|
||||
sums[index] = h("span", { style: { color: "#67C260" } }, [
|
||||
sums[index] = h("span", { style: {} }, [
|
||||
displayPrice(
|
||||
values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
@@ -204,7 +202,7 @@ const getSummaries = (param: SummaryMethodProps) => {
|
||||
} else if (column.property === "afterBalance") {
|
||||
const values = data1.map((item) => Number(item[column.property]))
|
||||
if (!values.every((value) => Number.isNaN(value))) {
|
||||
sums[index] = h("span", { style: { color: "#f56c6c" } }, [
|
||||
sums[index] = h("span", { style: {} }, [
|
||||
displayPrice(
|
||||
values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
|
||||
Reference in new issue
Block a user