This commit is contained in:
weipengfei 2024-05-31 15:46:52 +08:00
parent 8ecfe79909
commit c4079cd7a1
5 changed files with 414 additions and 526 deletions

View File

@ -1,6 +1,7 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit"
@close="handleClose">
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<el-form-item label="所属ID" prop="pid">
<!-- <el-input v-model="formData.pid" clearable placeholder="请输入所属ID" /> -->
@ -12,6 +13,7 @@
<el-form-item label="备注信息" prop="data">
<el-input v-model="formData.data" clearable placeholder="请输入备注信息" />
</el-form-item>
<el-form-item label="图片" prop="pic">
<material-picker v-model="formData.pic" />
</el-form-item>

View File

@ -46,10 +46,12 @@
<el-table-column label="排序" prop="sort" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button v-perms="['store.storecategory/edit']" type="primary" link @click.stop="handleEdit(row)">
<el-button v-perms="['store.storecategory/edit']" type="primary" link
@click.stop="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['store.storecategory/delete']" type="danger" link @click.stop="handleDelete(row.id)">
<el-button v-perms="['store.storecategory/delete']" type="danger" link
@click.stop="handleDelete(row.id)">
删除
</el-button>
</template>

View File

@ -1,16 +1,10 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
title="详情"
:async="true"
width="550px"
:cancelButtonText="false"
:confirmButtonText="false"
>
<popup ref="popupRef" title="详情" :async="true" width="550px" :cancelButtonText="false"
:confirmButtonText="false">
<el-form ref="formRef" :model="formData" label-width="90px">
<el-form-item label="商品名称" prop="store_name">
<el-input v-model="formData.store_name" clearable placeholder="请输入商品名称" :readonly="true"/>
<el-input v-model="formData.store_name" clearable placeholder="请输入商品名称" :readonly="true" />
</el-form-item>
</el-form>
</popup>

View File

@ -3,91 +3,39 @@
<div class="mb-4 text-lg font-bold">
{{ mode == "add" ? "添加商品" : "编辑商品" }}
</div>
<el-form
ref="formRef"
:model="formData"
label-width="90px"
:rules="formRules"
>
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<el-form-item label="商品图片" prop="image">
<material-picker v-model="formData.image" :limit="1" />
</el-form-item>
<el-form-item label="商品名称" prop="store_name">
<el-input
v-model="formData.store_name"
clearable
placeholder="请输入商品名称"
:readonly="false"
/>
<el-input v-model="formData.store_name" clearable placeholder="请输入商品名称" :readonly="false" />
</el-form-item>
<el-form-item label="商品条码" prop="bar_code">
<el-input
v-model="formData.bar_code"
clearable
placeholder="请输入商品条码"
:readonly="false"
/>
<el-input v-model="formData.bar_code" clearable placeholder="请输入商品条码" :readonly="false" />
</el-form-item>
<el-form-item label="商品分类" prop="cate_id">
<el-input
v-model="formData.cate_id"
clearable
placeholder="请输入商品分类"
:readonly="false"
/>
<el-input v-model="formData.cate_id" clearable placeholder="请输入商品分类" :readonly="false" />
</el-form-item>
<el-form-item label="商品价格" prop="price">
<el-input
v-model="formData.price"
clearable
placeholder="请输入商品价格"
:readonly="false"
/>
<el-input v-model="formData.price" clearable placeholder="请输入商品价格" :readonly="false" />
</el-form-item>
<el-form-item label="商品单位" prop="unit">
<el-input
v-model="formData.unit"
clearable
placeholder="请输入商品单位"
:readonly="false"
/>
<el-input v-model="formData.unit" clearable placeholder="请输入商品单位" :readonly="false" />
</el-form-item>
<el-form-item label="库存" prop="stock">
<el-input
v-model="formData.stock"
clearable
placeholder="请输入库存"
:readonly="false"
/>
<el-input v-model="formData.stock" clearable placeholder="请输入库存" :readonly="false" />
</el-form-item>
<el-form-item label="成本价" prop="cost">
<el-input
v-model="formData.cost"
clearable
placeholder="请输入成本价"
:readonly="false"
/>
<el-input v-model="formData.cost" clearable placeholder="请输入成本价" :readonly="false" />
</el-form-item>
<el-form-item label="采购价" prop="purchase">
<el-input
v-model="formData.purchase"
clearable
placeholder="请输入采购价"
:readonly="false"
/>
<el-input v-model="formData.purchase" clearable placeholder="请输入采购价" :readonly="false" />
</el-form-item>
<el-form-item label="上浮比例" prop="rose">
<el-input
v-model="formData.rose"
clearable
placeholder="请输入上浮比例"
:readonly="false"
/>
<el-input v-model="formData.rose" clearable placeholder="请输入上浮比例" :readonly="false" />
</el-form-item>
<el-form-item label="">
<el-button @click="handleSubmit" type="primary" class="w-40"
>提交</el-button
>
<el-button @click="handleSubmit" type="primary" class="w-40">提交</el-button>
</el-form-item>
</el-form>
</el-card>

View File

@ -3,12 +3,7 @@
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="商品名称" prop="store_name">
<el-input
class="w-[280px]"
v-model="queryParams.store_name"
clearable
placeholder="请输入商品名称"
/>
<el-input class="w-[280px]" v-model="queryParams.store_name" clearable placeholder="请输入商品名称" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
@ -17,25 +12,16 @@
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button
v-perms="['store_product.store_product/add']"
type="primary"
icon="Plus"
>
<router-link
:to="{
<el-button v-perms="['store_product.store_product/add']" type="primary" icon="Plus">
<router-link :to="{
path: 'store_product_edit',
query: { id: 0, mode: 'add' },
}"
>
}">
新增
</router-link>
</el-button>
<el-button
v-perms="['store_product.store_product/delete']"
:disabled="!selectData.length"
@click="handleDelete(selectData)"
>
<el-button v-perms="['store_product.store_product/delete']" :disabled="!selectData.length"
@click="handleDelete(selectData)">
删除
</el-button>
<div class="mt-4">
@ -47,26 +33,10 @@
<el-image style="width: 50px; height: 50px" :src="row.image" />
</template>
</el-table-column>
<el-table-column
label="商品名称"
prop="store_name"
show-overflow-tooltip
/>
<el-table-column
label="分类id"
prop="cate_id"
show-overflow-tooltip
/>
<el-table-column
label="商品价格"
prop="price"
show-overflow-tooltip
/>
<el-table-column
label="单位名"
prop="unit_name"
show-overflow-tooltip
/>
<el-table-column label="商品名称" prop="store_name" show-overflow-tooltip />
<el-table-column label="分类id" prop="cate_id" show-overflow-tooltip />
<el-table-column label="商品价格" prop="price" show-overflow-tooltip />
<el-table-column label="单位名" prop="unit_name" show-overflow-tooltip />
<el-table-column label="销量" prop="sales" show-overflow-tooltip />
<el-table-column label="库存" prop="stock" show-overflow-tooltip />
<el-table-column label="状态" prop="is_show" show-overflow-tooltip>
@ -74,51 +44,23 @@
{{ row.is_show ? "上架" : "未上架" }}
</template>
</el-table-column>
<el-table-column
label="是否新品"
prop="is_new"
show-overflow-tooltip
/>
<el-table-column
label="添加时间"
prop="add_time"
show-overflow-tooltip
/>
<el-table-column
label="是否包邮"
prop="is_postage"
show-overflow-tooltip
/>
<el-table-column
label="是否删除"
prop="is_del"
show-overflow-tooltip
/>
<el-table-column label="是否新品" prop="is_new" show-overflow-tooltip />
<el-table-column label="添加时间" prop="add_time" show-overflow-tooltip />
<el-table-column label="是否包邮" prop="is_postage" show-overflow-tooltip />
<el-table-column label="是否删除" prop="is_del" show-overflow-tooltip />
<el-table-column label="成本价" prop="cost" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['store_product.store_product/edit']"
type="primary"
link
@click="handleEdit(row)"
>
<el-button v-perms="['store_product.store_product/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button
v-perms="['store_product.store_product/edit']"
type="primary"
link
@click="handleDetail(row)"
>
<el-button v-perms="['store_product.store_product/edit']" type="primary" link
@click="handleDetail(row)">
详情
</el-button>
<el-button
v-perms="['store_product.store_product/delete']"
type="danger"
link
@click="handleDelete(row.id)"
>
<el-button v-perms="['store_product.store_product/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
</template>