Browse Source

新增租户

pull/1/head
余菲 2 years ago
parent
commit
c377f021b9
1 changed files with 36 additions and 14 deletions
  1. +36
    -14
      src/views/data/tenant/tenant-edit.vue

+ 36
- 14
src/views/data/tenant/tenant-edit.vue View File

@@ -16,6 +16,18 @@
:label-col="{ md: { span: 4 }, sm: { span: 24 } }"
:wrapper-col="{ md: { span: 20 }, sm: { span: 24 } }"
>
<a-row :gutter="16">
<a-col :md="24" :sm="24" :xs="24">
<a-form-item label="租户编号:" name="code">
<a-input
allow-clear
:maxlength="150"
placeholder="请输入租户编号"
v-model:value="form.code"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="16">
<a-col :md="24" :sm="24" :xs="24">
<a-form-item label="平台logo:">
@@ -171,6 +183,14 @@ export default {
form: Object.assign({}, this.data),
// 表单验证规则
rules: {
// code: [
// {
// required: true,
// message: "请输入租户编号",
// type: "string",
// trigger: "blur",
// },
// ],
name: [
{
required: true,
@@ -222,6 +242,9 @@ export default {
initUpload: ''
}
},
created() {
this.getAreaList()
},
watch: {
data() {
if (this.data) {
@@ -240,32 +263,31 @@ export default {
},
visible() {
if(this.visible) {
this.getAreaList()
}
}
},
methods: {
/* 获取省市区列表 */
getAreaList() {
this.provinceList = []
this.$http.get('/city/queryCityList').then(res => {
this.provinceList = res.data
if(this.provinceList.length) {
if(this.data.provinceCode) {
if(this.form.provinceCode) {
this.provinceList.forEach((item) => {
if (item.citycode == this.data.provinceCode) {
if (item.citycode === this.form.provinceCode) {
this.cityList = item.itemList
}
})
}
if(this.data.cityCode) {
if(this.form.cityCode) {
this.cityList.forEach((item) => {
if (item.citycode == this.data.cityCode) {
if (item.citycode === this.form.cityCode) {
this.districtList = item.itemList
}
})
}
}
}
}
},
methods: {
/* 获取省市区列表 */
getAreaList() {
this.provinceList = []
this.$http.get('/city/queryCityList').then(res => {
this.provinceList = res.data
}).catch(e => {
this.$message.error(e.message)
})

Loading…
Cancel
Save