|
@@ -53,6 +53,19 @@
|
|
|
<el-form-item :label="$t('table.org.abbreviation')" prop="abbreviation">
|
|
|
<el-input v-model="org.abbreviation"/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item :label="$t('table.org.area')" prop="regionId">
|
|
|
+ <!-- <el-select class="from-item" v-model="org.regionId" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in areaList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select> -->
|
|
|
+ <el-checkbox-group v-model="org.regionId" size="mini">
|
|
|
+ <el-checkbox-button v-for="item in areaList" :label="item.name" :key="item.id">{{item.name}}</el-checkbox-button>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item :label="$t('table.org.describe')" prop="describe">
|
|
|
<el-input v-model="org.describe"/>
|
|
|
</el-form-item>
|
|
@@ -131,12 +144,41 @@
|
|
|
label: [
|
|
|
{required: true, message: this.$t('rules.require'), trigger: 'blur'},
|
|
|
{min: 1, max: 255, message: this.$t('rules.range3to10'), trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ regionId: [
|
|
|
+ {required: true, message: this.$t('rules.require'), trigger: 'change'}
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ areaList:[]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ res:function(){
|
|
|
+ const r = this.org
|
|
|
+ r.regionId = this.org.regionId.join()
|
|
|
+ return r
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.initOrgTree()
|
|
|
+ // 所属区域列表
|
|
|
+ orgApi.getAreaList().then(e=>{
|
|
|
+ // e = {
|
|
|
+ // "code": 0, "msg": "ok", "path": null, "extra": null,
|
|
|
+ // "timestamp": 1676963721835, "isError": false,"isSuccess": true
|
|
|
+ // "data":
|
|
|
+ // [
|
|
|
+ // {
|
|
|
+ // "id": 123456789,
|
|
|
+ // "name": "北方大区"
|
|
|
+ // },
|
|
|
+ // ......
|
|
|
+ // ]
|
|
|
+ // }
|
|
|
+ if (e.code === 0){
|
|
|
+ this.areaList = e.data
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
initOrg() {
|
|
@@ -147,7 +189,8 @@
|
|
|
parentId: 0,
|
|
|
status: true,
|
|
|
describe: '',
|
|
|
- sortValue: 0
|
|
|
+ sortValue: 0,
|
|
|
+ regionId:[]
|
|
|
}
|
|
|
},
|
|
|
initOrgTree() {
|
|
@@ -201,7 +244,9 @@
|
|
|
if (!value) return true
|
|
|
return data.label.indexOf(value) !== -1
|
|
|
},
|
|
|
- nodeClick(data) {
|
|
|
+ nodeClick(e) {
|
|
|
+ const data = JSON.parse(JSON.stringify(e))
|
|
|
+ data.regionId = data.regionId.split(',')
|
|
|
this.org = {...data}
|
|
|
this.$refs.form.clearValidate()
|
|
|
}
|
|
@@ -275,7 +320,7 @@
|
|
|
}
|
|
|
,
|
|
|
save() {
|
|
|
- orgApi.save({...this.org})
|
|
|
+ orgApi.save({...this.res})
|
|
|
.then((response) => {
|
|
|
const res = response.data
|
|
|
if (res.isSuccess) {
|
|
@@ -290,7 +335,7 @@
|
|
|
}
|
|
|
,
|
|
|
update() {
|
|
|
- orgApi.update({...this.org})
|
|
|
+ orgApi.update({...this.res})
|
|
|
.then((response) => {
|
|
|
const res = response.data
|
|
|
if (res.isSuccess) {
|
|
@@ -333,4 +378,7 @@
|
|
|
border-bottom: 1px solid #f1f1f1 !important;
|
|
|
}
|
|
|
}
|
|
|
+ // .from-item{
|
|
|
+ // width:100%
|
|
|
+ // }
|
|
|
</style>
|