|
|
@ -124,7 +124,7 @@ |
|
|
|
v-model="formData.rangeList" |
|
|
|
:options="optionsRange" |
|
|
|
@change="handleChangeRange" |
|
|
|
:props="props" |
|
|
|
:props="rangeProps" |
|
|
|
:disabled="formType==='detail'" |
|
|
|
clearable /> |
|
|
|
|
|
|
@ -150,6 +150,7 @@ import { Loading } from "element-ui"; // 引入Loading服务 |
|
|
|
import { requestPost, requestGet } from "@/js/dai/request"; |
|
|
|
import nextTick from "dai-js/tools/nextTick"; |
|
|
|
import { dormitoryTypeList, } from "@/js/columns/constants"; |
|
|
|
import { isCard } from "@/utils/validate"; |
|
|
|
|
|
|
|
let loading; // 加载动画 |
|
|
|
|
|
|
@ -171,7 +172,7 @@ export default { |
|
|
|
btnDisable: false, |
|
|
|
optionsA: [], |
|
|
|
optionsRange: [], |
|
|
|
props: { |
|
|
|
rangeProps: { |
|
|
|
multiple: true, |
|
|
|
checkStrictly: true, |
|
|
|
// emitPath: true, |
|
|
@ -187,26 +188,11 @@ export default { |
|
|
|
idNum: "", |
|
|
|
dormitoryTypeArray: [], |
|
|
|
dormitoryTypeCode: '', |
|
|
|
rangeList: [ |
|
|
|
|
|
|
|
// ["1497127889652744194", "1497127889728241666"], |
|
|
|
|
|
|
|
// ["1497127889652744194", "1497127889728241666", "1497127889786961922"], |
|
|
|
|
|
|
|
] |
|
|
|
rangeList: [] |
|
|
|
|
|
|
|
}, |
|
|
|
dormitoryTypeList, |
|
|
|
|
|
|
|
dataRule: { |
|
|
|
agencyId: [{ required: true, message: "所属组织不能为空", trigger: "change" }], |
|
|
|
name: [{ required: true, message: "姓名不能为空", trigger: "change" }], |
|
|
|
mobile: [{ required: true, message: "联系电话不能为空", trigger: "change" }], |
|
|
|
idNum: [{ required: true, message: "身份证号不能为空", trigger: "change" }], |
|
|
|
dormitoryTypeArray: [{ required: true, message: "类型不能为空", trigger: "change" }], |
|
|
|
rangeList: [{ required: true, message: "管理范围不能为空", trigger: "change" }], |
|
|
|
}, |
|
|
|
|
|
|
|
categorizedResiId: '' |
|
|
|
|
|
|
|
}; |
|
|
@ -215,10 +201,11 @@ export default { |
|
|
|
watch: {}, |
|
|
|
|
|
|
|
components: {}, |
|
|
|
async created () { }, |
|
|
|
async created () { |
|
|
|
await this.getGridList() |
|
|
|
}, |
|
|
|
async mounted () { |
|
|
|
this.startLoading(); |
|
|
|
await this.endLoading(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
@ -228,9 +215,16 @@ export default { |
|
|
|
if (this.formType === 'add') { |
|
|
|
|
|
|
|
} else { |
|
|
|
this.startLoading(); |
|
|
|
|
|
|
|
this.categorizedResiId = row.categorizedResiId |
|
|
|
await this.getDetail(); |
|
|
|
if (this.formData.agencyId) { |
|
|
|
await this.getRangeList() |
|
|
|
} |
|
|
|
this.endLoading(); |
|
|
|
} |
|
|
|
await this.getGridList() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -269,6 +263,7 @@ export default { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
this.formData.agencyId = val |
|
|
|
this.getRangeList() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -297,8 +292,32 @@ export default { |
|
|
|
|
|
|
|
const _arr = [{ ...agencyList, subAgencyList: [...subAgencyList] }] |
|
|
|
this.optionsA = this.deepTree(_arr) |
|
|
|
this.optionsRange = this.deepTree(_arr) |
|
|
|
this.getDetail(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
this.dataListLoading = false |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
this.dataListLoading = false |
|
|
|
}, |
|
|
|
async getRangeList () { |
|
|
|
const { user } = this.$store.state |
|
|
|
this.dataListLoading = true |
|
|
|
const params = { |
|
|
|
agencyId: user.agencyId, |
|
|
|
client: 'gov' |
|
|
|
} |
|
|
|
let url = `/actual/base/communityOrgList/getOrgListTree/${this.formData.agencyId}` |
|
|
|
this.$http |
|
|
|
.post(url) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} else { |
|
|
|
|
|
|
|
this.optionsRange = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
@ -383,6 +402,39 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
computed: { |
|
|
|
dataRule () { |
|
|
|
let checkIdCard = (rule, value, callback) => { |
|
|
|
if (value === "") { |
|
|
|
callback(new Error("请输入证件号")); |
|
|
|
} else { |
|
|
|
if (!isCard(value)) { |
|
|
|
callback(new Error("请输入正确的证件号")); |
|
|
|
} |
|
|
|
callback(); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
|
|
|
|
agencyId: [{ required: true, message: "所属组织不能为空", trigger: "change" }], |
|
|
|
name: [{ required: true, message: "姓名不能为空", trigger: "change" }], |
|
|
|
mobile: [{ required: true, message: "联系电话不能为空", trigger: "change" }], |
|
|
|
idNum: [ |
|
|
|
{ required: true, message: "证件号不能为空", trigger: "bulr" }, |
|
|
|
{ required: true, validator: checkIdCard, trigger: "blur" }, |
|
|
|
], |
|
|
|
dormitoryTypeArray: [{ required: true, message: "类型不能为空", trigger: "change" }], |
|
|
|
rangeList: [{ required: true, message: "管理范围不能为空", trigger: "change" }], |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|