|
|
@@ -60,7 +60,7 @@
|
|
|
|
|
|
<!-- 添加分类 -->
|
|
|
<template #slot-add-goods-btn>
|
|
|
- <el-button type="primary" size="mini" @click="replaceBtnFn(0)">添加</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="replaceBtnFn({})">添加</el-button>
|
|
|
</template>
|
|
|
|
|
|
<template #slot-item-list="{scope}">
|
|
|
@@ -68,7 +68,7 @@
|
|
|
</template>
|
|
|
|
|
|
<template #slot-modify="{scope}">
|
|
|
- <el-button type="text" @click.native.stop="replaceBtnFn(scope.row.id,scope.row.name)">修改</el-button>
|
|
|
+ <el-button type="text" @click.native.stop="replaceBtnFn(scope.row)">修改</el-button>
|
|
|
</template>
|
|
|
|
|
|
</x-crud>
|
|
|
@@ -86,6 +86,9 @@
|
|
|
<el-form-item label="分类名称" prop="name">
|
|
|
<el-input v-model="replaceForm.name" placeholder="请输入名称" size="small"></el-input>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="排序" prop="name">
|
|
|
+ <el-input v-model="replaceForm.inTurn" placeholder="请输入顺序" size="small"></el-input>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
@@ -121,7 +124,8 @@ export default {
|
|
|
replaceDialog:false,
|
|
|
id:0,
|
|
|
replaceForm: {
|
|
|
- name: ''
|
|
|
+ name: '',
|
|
|
+ inTurn:'',
|
|
|
},
|
|
|
ruleForm: {
|
|
|
name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
|
|
@@ -176,9 +180,16 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- replaceBtnFn(id,name) {
|
|
|
- this.id = id
|
|
|
- this.replaceForm.name = name
|
|
|
+ replaceBtnFn(item) {
|
|
|
+ if (!this.$util.isEmpty(item)) {
|
|
|
+ this.id = item.id
|
|
|
+ this.replaceForm.name = item.name
|
|
|
+ this.replaceForm.inTurn = item.inTurn
|
|
|
+ }else{
|
|
|
+ this.id = 0
|
|
|
+ this.replaceForm.name = ''
|
|
|
+ this.replaceForm.inTurn = ''
|
|
|
+ }
|
|
|
this.replaceDialog = true
|
|
|
},
|
|
|
handleClick(tab, e) {
|