超市-字段修改
This commit is contained in:
1 parent
8ce1cdf9e1
commit
f934c709bb
4 files changed
+50
-38
No files matched your search
@@ -8,7 +8,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-col :span="14" class="mb20">
|
||||
<el-form-item label="库存商品" prop="erpSpuId">
|
||||
<el-input
|
||||
v-model="form.erpSpuId"
|
||||
@@ -28,8 +28,8 @@
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="排序字段" prop="sort">
|
||||
<el-input v-model="form.sort" placeholder="请输入排序字段" />
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number :min="0" :max="1000" :precision="0" v-model="form.sort" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -78,17 +78,22 @@
|
||||
<el-table v-loading="state.loading" :data="state.dataList" @row-click="handleRowClick" :row-style="{ cursor: 'pointer' }">
|
||||
<el-table-column type="index" label="#" width="50" align="center" />
|
||||
<el-table-column prop="productName" label="商品名称" width="100px" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="productCode" label="货号" width="100px" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="barcode" label="商品条码" width="100px" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="brandId" label="商品品牌" width="100px" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="categoryId" label="商品分类" width="100px" align="center" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<!-- {{ categoryOptions?.find((item: any) => item?.id === row?.categoryId)?.name }} -->
|
||||
{{ row.categoryId }}
|
||||
<el-tag>{{ categoryOptions.find((item: any) => item.id == row.categoryId)?.name }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="merchantId" label="商户" width="100px" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="sliderPicUrls" label="商品轮播图" align="center" show-overflow-tooltip>
|
||||
<el-table-column prop="picUrl" label="商品图" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<preview-image @click.stop :src="scope.row.sliderPicUrls" />
|
||||
<preview-image @click.stop :src="scope.row.picUrl" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="productNature" label="商品性质" align="center" show-overflow-tooltip width="150">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="supermarket_nature" :value="scope.row.productNature" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="上架状态" align="center" show-overflow-tooltip>
|
||||
@@ -96,10 +101,8 @@
|
||||
<dict-tag :options="spu_status" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="barcode" label="商品条码" width="100px" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="supplierId" label="供货商" width="100px" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="sort" label="排序字段" align="center" show-overflow-tooltip />
|
||||
|
||||
<!-- <el-table-column prop="supplierId" label="供货商" width="100px" align="center" show-overflow-tooltip /> -->
|
||||
<!-- <el-table-column prop="sort" label="排序字段" align="center" show-overflow-tooltip /> -->
|
||||
<!-- <el-table-column prop="price" label="商品价格" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ displayPrice(scope.row.price) }}
|
||||
@@ -118,9 +121,7 @@
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="spuSelectDialogVisible = false">取消</el-button>
|
||||
</div>
|
||||
<el-button @click="spuSelectDialogVisible = false">取消</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -129,9 +130,9 @@
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { getObj, addObj, putObj, getOnlineSpuPage } from "/@/api/supermarket/smSpu"
|
||||
import { rule } from "/@/utils/validate"
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { Search } from "@element-plus/icons-vue"
|
||||
import { getSupermarketCategory } from "/@/api/supermarketerp/supermarketSpu"
|
||||
const emit = defineEmits(["refresh"])
|
||||
|
||||
// 定义变量内容
|
||||
@@ -139,7 +140,7 @@ const dataFormRef = ref()
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
// 定义字典
|
||||
const { spu_status } = useDict("spu_status")
|
||||
const { supermarket_nature, spu_status } = useDict("supermarket_nature", "spu_status")
|
||||
const spuSelectDialogVisible = ref<boolean>(false)
|
||||
|
||||
// 提交表单数据
|
||||
@@ -156,6 +157,7 @@ const form = reactive({
|
||||
salesCount: "",
|
||||
erpSpuName: "",
|
||||
})
|
||||
const categoryOptions = ref<any>([])
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({
|
||||
@@ -215,7 +217,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
pageList: getOnlineSpuPage,
|
||||
})
|
||||
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle } = useTable(state)
|
||||
|
||||
const resetQuery = () => {
|
||||
state.queryForm.productName = ""
|
||||
@@ -223,14 +225,17 @@ const resetQuery = () => {
|
||||
}
|
||||
|
||||
// 点击选择库存商品
|
||||
const handleClickSelectSpu = () => {
|
||||
const handleClickSelectSpu = async () => {
|
||||
loading.value = true
|
||||
resetQuery()
|
||||
state.queryForm.productName = ""
|
||||
spuSelectDialogVisible.value = true
|
||||
try {
|
||||
getDataList()
|
||||
const res = await getSupermarketCategory()
|
||||
categoryOptions.value = res.data
|
||||
} catch (error) {
|
||||
state.dataList = []
|
||||
categoryOptions.value = []
|
||||
loading.value = false
|
||||
}
|
||||
loading.value = false
|
||||
|
||||
@@ -3,10 +3,8 @@
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="库存商品id" prop="erpSpuId">
|
||||
<el-select v-model="state.queryForm.erpSpuId" placeholder="请选择库存商品id">
|
||||
<el-option label="0" value="0"></el-option>
|
||||
</el-select>
|
||||
<el-form-item label="商品名称" prop="productName">
|
||||
<el-input v-model="state.queryForm.productName" placeholder="请输入商品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList">查询</el-button>
|
||||
@@ -51,6 +49,7 @@
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="50" />
|
||||
<el-table-column prop="productName" label="商品名称" show-overflow-tooltip />
|
||||
<el-table-column prop="productCode" label="货号" show-overflow-tooltip />
|
||||
<el-table-column prop="categoryName" label="商品分类" width="100px" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="picUrl" label="商品封面图" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
@@ -59,21 +58,27 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="商品状态" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="spu_status" :value="scope.row.status"></dict-tag>
|
||||
<dict-tag :options="spu_status" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="barcode" label="商品条码" width="100px" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="sort" label="排序字段" show-overflow-tooltip />
|
||||
<el-table-column prop="sort" label="排序" show-overflow-tooltip />
|
||||
<el-table-column prop="giveIntegral" label="赠送积分" show-overflow-tooltip />
|
||||
<el-table-column prop="salesCount" label="销量" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'supermarket_smSpu_edit'" @click="formDialogRef.openDialog(scope.row.id)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button icon="delete" text type="primary" v-auth="'supermarket_smSpu_del'" @click="handleDelete([scope.row.id])"
|
||||
>删除</el-button
|
||||
<el-button
|
||||
icon="edit-pen"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'supermarket_smSpu_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'supermarket_smSpu_del'" @click="handleDelete([scope.row.id])">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -53,8 +53,8 @@
|
||||
</el-col>
|
||||
|
||||
<el-col :span="14" class="mb20">
|
||||
<el-form-item label="邮箱地址" prop="email">
|
||||
<el-input v-model="form.email" placeholder="请输入邮箱地址" />
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="form.email" placeholder="请输入邮箱" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
@@ -71,16 +71,18 @@
|
||||
<el-table-column type="selection" width="40" align="center" fixed="left" />
|
||||
<el-table-column type="index" label="#" width="50" fixed="left" />
|
||||
<el-table-column prop="supplierName" label="货商名称" show-overflow-tooltip min-width="160" />
|
||||
<el-table-column prop="supplierType" label="货商类别" show-overflow-tooltip min-width="160">
|
||||
<template #default="scope">
|
||||
<el-tag>{{ supplierType.length > 0 && supplierType?.find((item: any) => item.id == scope.row.supplierType)?.typeName }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="phone" label="电话号码" show-overflow-tooltip />
|
||||
<el-table-column prop="tax" label="税号" show-overflow-tooltip />
|
||||
<el-table-column prop="linkName" label="联系人" show-overflow-tooltip />
|
||||
<el-table-column prop="openAccount" label="开户行账号" show-overflow-tooltip />
|
||||
<el-table-column prop="supplierType" label="货商类别" show-overflow-tooltip min-width="160">
|
||||
<template #default="scope">
|
||||
{{ supplierType.length > 0 && supplierType?.find((item: any) => item.id == scope.row.supplierType)?.typeName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="supplierArea" label="货商地区" show-overflow-tooltip />
|
||||
<el-table-column prop="address" label="货商地址" show-overflow-tooltip />
|
||||
<el-table-column prop="email" label="邮箱" show-overflow-tooltip />
|
||||
<el-table-column prop="openName" label="开户行" show-overflow-tooltip />
|
||||
<el-table-column prop="contractNumber" label="合同号" show-overflow-tooltip />
|
||||
<el-table-column prop="status" label="状态" show-overflow-tooltip min-width="100">
|
||||
|
||||
Reference in new issue
Block a user