Commit 937ed7a6 authored by 黄奎's avatar 黄奎

页面刷新

parent 86b7b92b
......@@ -44,9 +44,9 @@
:current-page.sync="msg.pageIndex" layout="prev, pager, next" :total="total">
</el-pagination>
</div>
<!-- 修改分类 -->
<!-- 修改及新增分类 -->
<el-dialog :title="editTitle" :visible.sync="isShowCategoryForm" width="500px">
<el-form :model="postMsg" :rules="rules" label-width="150px" @validate="formTest">
<el-form ref="editform" :model="postMsg" :rules="rules" label-width="150px" @validate="formTest">
<el-form-item label="分类名称" prop="Name">
<el-input type="text" style="width:250px" size="small" maxlength="100" v-model="postMsg.Name">
</el-input>
......@@ -71,7 +71,7 @@
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="isShowCategoryForm = false">取 消</el-button>
<el-button size="small" type="primary" @click="saveData()">确 定</el-button>
<el-button size="small" type="primary" @click="saveData('editform')">确 定</el-button>
</span>
</el-dialog>
<!-- 选择文件 -->
......@@ -171,18 +171,35 @@ export default {
formTest(res, pass) {
this.pass = pass;
},
// saveData() {
// if (this.pass && this.postMsg.Image) {
// this.assetsApipost("/api/Assess/SetCategoryInfo", this.postMsg, res => {
// if (res.data.resultCode == 1) {
// this.Success(res.data.message);
// this.getList();
// } else {
// this.Error(res.data.message);
// }
// });
// }
// },
//新增修改分类
saveData() {
if (this.pass && this.postMsg.Image) {
this.assetsApipost("/api/Assess/SetCategoryInfo", this.postMsg, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.getList();
} else {
this.Error(res.data.message);
}
});
}
saveData(editform) {
this.$refs[editform].validate((valid) => {
if (valid && this.postMsg.Image) {
this.assetsApipost("/api/Assess/SetCategoryInfo", this.postMsg, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.getList();
} else {
this.Error(res.data.message);
}
});
} else {
return false;
}
});
},
//删除分类
RemmoveCategory(item) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment