|
|
|
|
@ -1,14 +1,5 @@ |
|
|
|
|
<template> |
|
|
|
|
<el-row> |
|
|
|
|
<!-- <el-col :span="5"> |
|
|
|
|
<div class="box"> |
|
|
|
|
<el-scrollbar> |
|
|
|
|
<basic-container> |
|
|
|
|
<avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" /> |
|
|
|
|
</basic-container> |
|
|
|
|
</el-scrollbar> |
|
|
|
|
</div> |
|
|
|
|
</el-col> --> |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<basic-container> |
|
|
|
|
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" |
|
|
|
|
@ -35,15 +26,7 @@ |
|
|
|
|
</avue-crud> |
|
|
|
|
</basic-container> |
|
|
|
|
</el-col> |
|
|
|
|
<!-- <el-dialog title="新增" append-to-body :visible.sync="addBox" :close-on-click-modal="false" width="60%"> |
|
|
|
|
|
|
|
|
|
<avue-form :option="debugOption" v-model="debugForm" /> |
|
|
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button @click="closeBox">取 消</el-button> |
|
|
|
|
<el-button @click="addBoxReject">提 交</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> --> |
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
@ -119,24 +102,7 @@ export default { |
|
|
|
|
trigger: "click" |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '地址', |
|
|
|
|
prop: 'province', |
|
|
|
|
type: 'select', |
|
|
|
|
span: 12, |
|
|
|
|
// search: true, |
|
|
|
|
// hide: true, |
|
|
|
|
props: { |
|
|
|
|
label: 'name', |
|
|
|
|
value: 'code' |
|
|
|
|
}, |
|
|
|
|
dicUrl: '/api/blade-system/region/select', |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请选择省份", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// { |
|
|
|
|
// label: "机构全称", |
|
|
|
|
@ -181,20 +147,37 @@ export default { |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入机构类型", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}] |
|
|
|
|
}], |
|
|
|
|
change: (val) => { |
|
|
|
|
this.typeChange(val) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "排序", |
|
|
|
|
prop: "sort", |
|
|
|
|
type: "number", |
|
|
|
|
align: "right", |
|
|
|
|
width: 80, |
|
|
|
|
label: '地址', |
|
|
|
|
prop: 'labAddress', |
|
|
|
|
span: 12, |
|
|
|
|
// search: true, |
|
|
|
|
// hide: true, |
|
|
|
|
display: false, |
|
|
|
|
disabled: false, |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入排序", |
|
|
|
|
trigger: "blur" |
|
|
|
|
message: "请输入实验室所在地址", |
|
|
|
|
trigger: "click" |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
// { |
|
|
|
|
// label: "排序", |
|
|
|
|
// prop: "sort", |
|
|
|
|
// type: "number", |
|
|
|
|
// align: "right", |
|
|
|
|
// width: 80, |
|
|
|
|
// rules: [{ |
|
|
|
|
// required: true, |
|
|
|
|
// message: "请输入排序", |
|
|
|
|
// trigger: "blur" |
|
|
|
|
// }] |
|
|
|
|
// }, |
|
|
|
|
{ |
|
|
|
|
label: "备注", |
|
|
|
|
prop: "remark", |
|
|
|
|
@ -208,143 +191,7 @@ export default { |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
data: [], |
|
|
|
|
// 省市组织树 |
|
|
|
|
treeData: [], |
|
|
|
|
treeOption: { |
|
|
|
|
nodeKey: 'id', |
|
|
|
|
lazy: true, |
|
|
|
|
treeLoad: function (node, resolve) { |
|
|
|
|
const parentCode = (node.level === 0) ? "00" : node.data.id; |
|
|
|
|
getLazyTree(parentCode).then(res => { |
|
|
|
|
resolve(res.data.data.map(item => { |
|
|
|
|
return { |
|
|
|
|
...item, |
|
|
|
|
leaf: !item.hasChildren |
|
|
|
|
} |
|
|
|
|
})) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
addBtn: false, |
|
|
|
|
menu: false, |
|
|
|
|
size: 'small', |
|
|
|
|
props: { |
|
|
|
|
labelText: '标题', |
|
|
|
|
label: 'title', |
|
|
|
|
value: 'value', |
|
|
|
|
children: 'children' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
addBox: false, |
|
|
|
|
debugForm: {}, |
|
|
|
|
debugOption: { |
|
|
|
|
// labelWidth: 50, |
|
|
|
|
submitBtn: false, |
|
|
|
|
emptyBtn: false, |
|
|
|
|
display: true, |
|
|
|
|
column: [ |
|
|
|
|
{ |
|
|
|
|
label: "机构名称", |
|
|
|
|
prop: "deptName", |
|
|
|
|
search: true, |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入机构名称", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "机构类型", |
|
|
|
|
type: "select", |
|
|
|
|
dicUrl: "/api/blade-system/dict/dictionary?code=org_category", |
|
|
|
|
props: { |
|
|
|
|
label: "dictValue", |
|
|
|
|
value: "dictKey" |
|
|
|
|
}, |
|
|
|
|
dataType: "number", |
|
|
|
|
width: 120, |
|
|
|
|
prop: "deptCategory", |
|
|
|
|
slot: true, |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入机构类型", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '省份', |
|
|
|
|
prop: 'province', |
|
|
|
|
type: 'select', |
|
|
|
|
span: 12, |
|
|
|
|
props: { |
|
|
|
|
label: 'name', |
|
|
|
|
value: 'code' |
|
|
|
|
}, |
|
|
|
|
cascader: ['city'], |
|
|
|
|
dicUrl: '/api/blade-system/region/select', |
|
|
|
|
// change: ({ value, column }) => { |
|
|
|
|
// console.log(11111,value, column); |
|
|
|
|
// }, |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请选择省份", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}], |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '地市', |
|
|
|
|
prop: 'city', |
|
|
|
|
type: 'select', |
|
|
|
|
props: { |
|
|
|
|
label: 'name', |
|
|
|
|
value: 'code' |
|
|
|
|
}, |
|
|
|
|
cascader: ['district'], |
|
|
|
|
dicFlag: false, |
|
|
|
|
dicUrl: '/api/blade-system/region/select?code={{province}}', |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请选择地市", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "排序", |
|
|
|
|
prop: "sort", |
|
|
|
|
type: "number", |
|
|
|
|
align: "right", |
|
|
|
|
width: 80, |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入排序", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "备注", |
|
|
|
|
prop: "remark", |
|
|
|
|
rules: [{ |
|
|
|
|
required: false, |
|
|
|
|
message: "请输入备注", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}], |
|
|
|
|
hide: true |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// { |
|
|
|
|
// label: '区县', |
|
|
|
|
// prop: 'district', |
|
|
|
|
// type: 'select', |
|
|
|
|
// props: { |
|
|
|
|
// label: 'name', |
|
|
|
|
// value: 'code' |
|
|
|
|
// }, |
|
|
|
|
// dicFlag: false, |
|
|
|
|
// dicUrl: '/api/blade-system/region/select?code={{city}}', |
|
|
|
|
// span: 24, |
|
|
|
|
// } |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
@ -369,38 +216,21 @@ export default { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
addInstitution() { |
|
|
|
|
this.addBox = true |
|
|
|
|
}, |
|
|
|
|
closeBox() { |
|
|
|
|
this.addBox = false |
|
|
|
|
}, |
|
|
|
|
addBoxReject() { |
|
|
|
|
let query = { |
|
|
|
|
...this.debugForm, |
|
|
|
|
provinceName: this.debugForm.$province, |
|
|
|
|
provinceCode: this.debugForm.province, |
|
|
|
|
cityName: this.debugForm.$city, |
|
|
|
|
cityCode: this.debugForm.city, |
|
|
|
|
} |
|
|
|
|
add(query).then((res) => { |
|
|
|
|
// 获取新增数据的相关字段 |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
// 数据回调进行刷新 |
|
|
|
|
this.addBox = false |
|
|
|
|
this.onLoad() |
|
|
|
|
}, error => { |
|
|
|
|
window.console.log(error); |
|
|
|
|
loading(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 组织树点击 |
|
|
|
|
nodeClick() { |
|
|
|
|
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(); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initData(tenantId) { |
|
|
|
|
getDeptTree(tenantId).then(res => { |
|
|
|
|
const column = this.findObject(this.option.column, "parentId"); |
|
|
|
|
@ -411,25 +241,13 @@ export default { |
|
|
|
|
handleAdd(row) { |
|
|
|
|
this.parentId = row.id; |
|
|
|
|
const column = this.findObject(this.option.column, "parentId"); |
|
|
|
|
this.option.column.forEach(item => { |
|
|
|
|
if (item.prop == 'province' || item.prop == 'city') { |
|
|
|
|
item.display = false |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
column.value = row.id; |
|
|
|
|
column.addDisabled = true; |
|
|
|
|
|
|
|
|
|
this.$refs.crud.rowAdd(); |
|
|
|
|
}, |
|
|
|
|
rowSave(row, done, loading) { |
|
|
|
|
|
|
|
|
|
let query = { |
|
|
|
|
...row, |
|
|
|
|
provinceName: this.form.$province, |
|
|
|
|
provinceCode: this.form.province, |
|
|
|
|
cityName: this.form.$city, |
|
|
|
|
cityCode: this.form.city, |
|
|
|
|
} |
|
|
|
|
console.log(9999, this.form,query) |
|
|
|
|
add(row).then((res) => { |
|
|
|
|
// 获取新增数据的相关字段 |
|
|
|
|
const data = res.data.data; |
|
|
|
|
@ -537,21 +355,16 @@ export default { |
|
|
|
|
this.form.parentId = ''; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if (this.form.parentId != '') { |
|
|
|
|
this.option.column.forEach(item => { |
|
|
|
|
if (item.prop == 'province' || item.prop == 'city') { |
|
|
|
|
item.display = false |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.$refs.crud.rowAdd(); |
|
|
|
|
} else { |
|
|
|
|
this.option.column.forEach(item => { |
|
|
|
|
if (item.prop == 'province' || item.prop == 'city') { |
|
|
|
|
item.display = true |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.$refs.crud.rowAdd(); |
|
|
|
|
} |
|
|
|
|
// labAddress |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.option.column.forEach(item => { |
|
|
|
|
if (item.prop == 'labAddress' && this.form.deptCategory == 5) { |
|
|
|
|
item.display = true |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.$refs.crud.rowAdd(); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
done(); |
|
|
|
|
|