This commit is contained in:
sa_10_0 2024-10-31 18:26:29 +08:00
parent e5939bc8b0
commit 86fa12d792

View File

@ -3,8 +3,8 @@
<div> <div>
<el-input style="width: 200px; height: 30px; margin-right: 10px;" suffix-icon="Search" placeholder="请输入商品名称" v-model="username"></el-input> <el-input style="width: 200px; height: 30px; margin-right: 10px;" suffix-icon="Search" placeholder="请输入商品名称" v-model="username"></el-input>
<el-form-item label="商品类型" style="width: 200px; margin-right: 10px;display: inline-block"> <el-form-item label="商品类型" style="width: 200px; margin-right: 10px;display: inline-block">
<el-select v-model="types" placeholder="请选择">type <el-select v-model="types" placeholder="请选择">
<el-option label="材料包" value="材料包" />type <el-option label="材料包" value="材料包" />
<el-option label="手持物" value="手持物" /> <el-option label="手持物" value="手持物" />
<el-option label="头饰" value="头饰" /> <el-option label="头饰" value="头饰" />
<el-option label="定制" value="定制" /> <el-option label="定制" value="定制" />
@ -85,7 +85,8 @@
<el-table-column label="商品状态"> <el-table-column label="商品状态">
<template #default="scope"> <template #default="scope">
<div> <div>
<span style="margin-left: 10px">{{ scope.row.isShelvesisShelves }}</span> <span style="margin-left: 10px" v-if="scope.row.isShelves==1">上架</span>
<span style="margin-left: 10px" v-if="scope.row.isShelves==0">下架</span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -97,8 +98,9 @@
<el-button size="small" @click="handleRevise(scope.$index, scope.row)"> <el-button size="small" @click="handleRevise(scope.$index, scope.row)">
编辑 编辑
</el-button> </el-button>
<el-button size="small" @click="handleOff(scope.$index, scope.row)"> <el-button size="small" @click="handleOff(scope.$index, scope.row)">
{{scope.row.attribute}} <div v-if="scope.row.isShelves==1">下架 </div>
<div v-if="scope.row.isShelves==0">上架 </div>
</el-button> </el-button>
<el-button <el-button
size="small" size="small"
@ -298,14 +300,14 @@ const handleRevise = (index: number, row: any) => {
editForm.value = row; editForm.value = row;
}; };
const handleOff = (index: number, row: any) => { const handleOff = (index: number, row: any) => {
if (row.attribute === '上架') { console.log()
row.isShelves = '上架'; if (row.isShelves === 0) {
row.attribute = '下架'; row.isShelves = 1;//01
} else if (row.attribute === '下架') { console.log(row.isShelves)
row.isShelves = '下架'; } else if (row.isShelves ===1) {
row.attribute = '上架'; row.isShelves = 0;
} }
}; }
const handleDelete = (index: number, row: any) => { const handleDelete = (index: number, row: any) => {
const confirmDelete = window.confirm('您确定要删除该商品吗?'); const confirmDelete = window.confirm('您确定要删除该商品吗?');
@ -325,7 +327,7 @@ const getGoodList = async () => {
console.log(res.data) console.log(res.data)
if (res.data.code === 1) { if (res.data.code === 1) {
tableData.value = res.data.data.records; tableData.value = res.data.data.records;
total.value = parseInt(res.data.data.total) total.value = parseInt(res.data.data.total)//
} else { } else {
ElMessage({ ElMessage({
message: '获取数据失败', message: '获取数据失败',