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

页面刷新

parent 86b7b92b
...@@ -44,9 +44,9 @@ ...@@ -44,9 +44,9 @@
:current-page.sync="msg.pageIndex" layout="prev, pager, next" :total="total"> :current-page.sync="msg.pageIndex" layout="prev, pager, next" :total="total">
</el-pagination> </el-pagination>
</div> </div>
<!-- 修改分类 --> <!-- 修改及新增分类 -->
<el-dialog :title="editTitle" :visible.sync="isShowCategoryForm" width="500px"> <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-form-item label="分类名称" prop="Name">
<el-input type="text" style="width:250px" size="small" maxlength="100" v-model="postMsg.Name"> <el-input type="text" style="width:250px" size="small" maxlength="100" v-model="postMsg.Name">
</el-input> </el-input>
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="isShowCategoryForm = false">取 消</el-button> <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> </span>
</el-dialog> </el-dialog>
<!-- 选择文件 --> <!-- 选择文件 -->
...@@ -171,18 +171,35 @@ export default { ...@@ -171,18 +171,35 @@ export default {
formTest(res, pass) { formTest(res, pass) {
this.pass = 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() { saveData(editform) {
if (this.pass && this.postMsg.Image) { this.$refs[editform].validate((valid) => {
this.assetsApipost("/api/Assess/SetCategoryInfo", this.postMsg, res => { if (valid && this.postMsg.Image) {
if (res.data.resultCode == 1) { this.assetsApipost("/api/Assess/SetCategoryInfo", this.postMsg, res => {
this.Success(res.data.message); if (res.data.resultCode == 1) {
this.getList(); this.Success(res.data.message);
} else { this.getList();
this.Error(res.data.message); } else {
} this.Error(res.data.message);
}); }
} });
} else {
return false;
}
});
}, },
//删除分类 //删除分类
RemmoveCategory(item) { 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