1
This commit is contained in:
commit
6cb9ae40dc
|
@ -3,8 +3,8 @@
|
|||
<div>
|
||||
<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-select v-model="types" placeholder="请选择">type
|
||||
<el-option label="材料包" value="材料包" />type
|
||||
<el-select v-model="types" placeholder="请选择">
|
||||
<el-option label="材料包" value="材料包" />
|
||||
<el-option label="手持物" value="手持物" />
|
||||
<el-option label="头饰" value="头饰" />
|
||||
<el-option label="定制" value="定制" />
|
||||
|
@ -86,7 +86,8 @@
|
|||
<el-table-column label="商品状态">
|
||||
<template #default="scope">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -99,7 +100,8 @@
|
|||
编辑
|
||||
</el-button>
|
||||
<el-button size="small" @click="handleOff(scope.$index, scope.row)">
|
||||
{{ status }}
|
||||
<div v-if="scope.row.isShelves==1">下架 </div>
|
||||
<div v-if="scope.row.isShelves==0">上架 </div>
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
|
@ -301,15 +303,14 @@ const handleRevise = (index: number, row: any) => {
|
|||
editForm.value = row;
|
||||
};
|
||||
const handleOff = (index: number, row: any) => {
|
||||
console.log(row)
|
||||
if (row.isShelves === '上架') {
|
||||
row.isShelves = '上架';
|
||||
row.attribute = '下架';
|
||||
} else if (row.attribute === '下架') {
|
||||
row.isShelves = '下架';
|
||||
row.attribute = '上架';
|
||||
console.log()
|
||||
if (row.isShelves === 0) {
|
||||
row.isShelves = 1;//0下架,1上架
|
||||
console.log(row.isShelves)
|
||||
} else if (row.isShelves ===1) {
|
||||
row.isShelves = 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const handleDelete = (index: number, row: any) => {
|
||||
const confirmDelete = window.confirm('您确定要删除该商品吗?');
|
||||
|
@ -329,7 +330,7 @@ const getGoodList = async () => {
|
|||
console.log(res.data)
|
||||
if (res.data.code === 1) {
|
||||
tableData.value = res.data.data.records;
|
||||
total.value = parseInt(res.data.data.total)
|
||||
total.value = parseInt(res.data.data.total)//总数据量,用于分页
|
||||
} else {
|
||||
ElMessage({
|
||||
message: '获取数据失败',
|
||||
|
|
Loading…
Reference in New Issue
Block a user