反馈结果
diff --git a/src/views/system/dept.vue b/src/views/system/dept.vue
index d047c87..604c0ba 100644
--- a/src/views/system/dept.vue
+++ b/src/views/system/dept.vue
@@ -80,12 +80,12 @@ export default {
filterBtn: false,
column: [
{
- label: "机构名称",
+ label: "名称",
prop: "deptName",
search: true,
rules: [{
required: true,
- message: "请输入机构名称",
+ message: "请输入名称",
trigger: "blur"
}]
},
@@ -139,7 +139,7 @@ export default {
}]
},
{
- label: "机构类型",
+ label: "类型",
type: "select",
dicUrl: "/api/blade-system/dict/dictionary?code=org_category",
props: {
@@ -153,7 +153,7 @@ export default {
search: website.tenantMode,
rules: [{
required: true,
- message: "请输入机构类型",
+ message: "请输入类型",
trigger: "blur"
}],
change: (val) => {
@@ -226,15 +226,15 @@ export default {
methods: {
typeChange(val) {
console.log('value', val)
- this.option.column.forEach(item => {
- if (item.prop == 'labAddress' &&val.item.dictKey == 5) {
- item.display = true
- }
- if (item.prop == 'labAddress' &&val.item.dictKey != 5){
- item.display = false
- }
- this.$refs.crud.rowAdd();
- })
+ // this.option.column.forEach(item => {
+ // if (item.prop == 'labAddress' &&val.item.dictKey == 5) {
+ // item.display = true
+ // }
+ // if (item.prop == 'labAddress' &&val.item.dictKey != 5){
+ // item.display = false
+ // }
+ // this.$refs.crud.rowAdd();
+ // })
},
@@ -247,12 +247,27 @@ export default {
},
// 新增子项
handleAdd(row) {
+ console.log('row--------------->',row)
this.parentId = row.id;
const column = this.findObject(this.option.column, "parentId");
column.value = row.id;
column.addDisabled = true;
+ if(row.deptCategory == 0){
+ const column = this.findObject(this.option.column, "deptCategory");
+ column.addDisabled = true;
+ column.value = 5
+ }else if(row.deptCategory == 5){
+ const column = this.findObject(this.option.column, "deptCategory");
+ column.addDisabled = true;
+ column.value = 6
+ }else if(row.deptCategory == 6){
+ const column = this.findObject(this.option.column, "deptCategory");
+ column.addDisabled = true;
+ column.value = 7
+ }
+
this.$refs.crud.rowAdd();
},
rowSave(row, done, loading) {
@@ -268,6 +283,9 @@ export default {
});
// 数据回调进行刷新
done(row);
+ const column = this.findObject(this.option.column, "deptCategory");
+ column.addDisabled = false;
+ column.value = ''
this.onLoad();
}, error => {
window.console.log(error);
@@ -354,14 +372,25 @@ export default {
this.$refs.crud.toggleSelection();
},
beforeOpen(done, type) {
+ this.option.column.forEach(item => {
+ if(item.prop == 'parentId'){
+ item.display = true
+ }
+ })
if (["add", "edit"].includes(type)) {
this.initData(this.form.tenantId);
}
+ if(['add'].includes(type)){
+ this.option.column.forEach(item => {
+ if(item.prop == 'parentId' && item.value === ''){
+ item.display = false
+ }
+ })
+ }
if (["edit", "view"].includes(type)) {
getDept(this.form.id).then(res => {
this.form = res.data.data;
- console.log('类型', this.form.parentId == '0')
if (this.form.parentId == '0') {
this.form.parentId = '';
@@ -369,12 +398,12 @@ export default {
// labAddress
- this.option.column.forEach(item => {
- if (item.prop == 'labAddress' && this.form.deptCategory == 5) {
- item.display = true
- }
- })
- this.$refs.crud.rowAdd();
+ // this.option.column.forEach(item => {
+ // if (item.prop == 'labAddress' && this.form.deptCategory == 5) {
+ // item.display = true
+ // }
+ // })
+ // this.$refs.crud.rowAdd();
});
}