|
@@ -29,7 +29,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="排序值" align="center" prop="sort">
|
|
|
<template slot-scope="{row}">
|
|
|
- <el-input v-model="row.sort" style="width:60px;" size="small" />
|
|
|
+ <el-input v-model="row.sort" style="width:100px;" size="small" type="number" maxlength="3" min="1" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column class-name="status-col" label="状态" align="center" prop="status">
|
|
@@ -39,7 +39,7 @@
|
|
|
v-model="row.status"
|
|
|
active-value="1"
|
|
|
inactive-value="0"
|
|
|
- @change="changeStatus(row.id)"
|
|
|
+ @change="changeStatus(row.id, row.status)"
|
|
|
/>
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
@@ -57,6 +57,7 @@
|
|
|
</el-table>
|
|
|
|
|
|
<pagination v-show="total>20" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="getList" />
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -104,7 +105,15 @@ export default {
|
|
|
this.listLoading = false
|
|
|
})
|
|
|
},
|
|
|
- changeStatus(id) {
|
|
|
+ changeStatus(id, status) {
|
|
|
+ const confirmTxt = '确定要' + (status * 1 === 1 ? '启用' : '停用') + '该分类吗?'
|
|
|
+ this.$confirm(confirmTxt).then(_ => {
|
|
|
+ this.confirmChange(id)
|
|
|
+ }).catch(() => {
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ confirmChange(id) {
|
|
|
switchClassify({ id: id }).then(() => {
|
|
|
this.getList()
|
|
|
}).catch(() => {
|