|
@@ -1,29 +1,22 @@
|
|
|
<template>
|
|
|
<div class="classify">
|
|
|
- <el-row :gutter="10" class="mb10">
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="primary" size="small" plain @click="addClassify"
|
|
|
- >新增</el-button
|
|
|
- >
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="primary" size="small" plain @click="editClassify"
|
|
|
- >修改</el-button
|
|
|
- >
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="primary" size="small" plain @click="deleteClassify"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
|
|
|
<el-card v-loading="loading">
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb10">
|
|
|
+ <div>
|
|
|
+ <el-button type="primary" size="mini" plain @click="addClassify">新增</el-button>
|
|
|
+ <el-button type="primary" size="mini" plain @click="editClassify">修改</el-button>
|
|
|
+ <el-button type="primary" size="mini" plain @click="refreshData">{{refreshName == '2'? '查询启用': '查询停用'}}</el-button>
|
|
|
+ <el-button type="primary" size="mini" plain @click="deleteClassify">删除</el-button>
|
|
|
+ </div>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
<el-row :gutter="10" class="content">
|
|
|
<el-col :span="6">
|
|
|
<el-input
|
|
|
placeholder="输入关键字/编码进行过滤"
|
|
|
- size="small"
|
|
|
+ size="mini"
|
|
|
v-model="filterText"
|
|
|
>
|
|
|
</el-input>
|
|
@@ -60,6 +53,7 @@
|
|
|
<el-input
|
|
|
:disabled="disable"
|
|
|
v-model="ruleForm.code"
|
|
|
+ size="mini"
|
|
|
></el-input>
|
|
|
<span>编码规则x-xxx-xxx-xxx</span>
|
|
|
</el-form-item>
|
|
@@ -69,6 +63,7 @@
|
|
|
<el-input
|
|
|
:disabled="disable"
|
|
|
v-model="ruleForm.materialType"
|
|
|
+ size="mini"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -80,6 +75,7 @@
|
|
|
v-model="ruleForm.isEnable"
|
|
|
placeholder="启用状态"
|
|
|
clearable
|
|
|
+ size="mini"
|
|
|
:disabled="disable"
|
|
|
style="width: 230px"
|
|
|
>
|
|
@@ -102,6 +98,7 @@
|
|
|
placeholder="属性结构"
|
|
|
clearable
|
|
|
:disabled="disable"
|
|
|
+ size="mini"
|
|
|
style="width: 230px"
|
|
|
>
|
|
|
<el-option
|
|
@@ -210,6 +207,7 @@ export default {
|
|
|
// 判断是新增还是修改
|
|
|
isAdd: true,
|
|
|
defaultExpanded: [],
|
|
|
+ refreshName: '0'
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -218,15 +216,15 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
created() {
|
|
|
- this.getTreeData();
|
|
|
+ this.getTreeData(this.refreshName);
|
|
|
//
|
|
|
},
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
// 获取树形结构
|
|
|
- getTreeData(data) {
|
|
|
+ getTreeData(isEnable) {
|
|
|
this.loading = true;
|
|
|
- getTree({})
|
|
|
+ getTree({isEnable: isEnable})
|
|
|
.then((res) => {
|
|
|
let { code, rows } = res;
|
|
|
if (code === 200) {
|
|
@@ -389,6 +387,16 @@ export default {
|
|
|
this.isAdd = false;
|
|
|
}
|
|
|
},
|
|
|
+ // 启用停用
|
|
|
+ refreshData() {
|
|
|
+ if(this.refreshName == '0') {
|
|
|
+ this.refreshName = '2'
|
|
|
+ this.getTreeData(this.refreshName);
|
|
|
+ } else {
|
|
|
+ this.refreshName = '0'
|
|
|
+ this.getTreeData(this.refreshName);
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -403,4 +411,8 @@ export default {
|
|
|
.title {
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
+.mb10 {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row-reverse;
|
|
|
+}
|
|
|
</style>
|