|
@@ -12,6 +12,7 @@
|
|
|
style="text-align: left"
|
|
style="text-align: left"
|
|
|
@close="closeDialog"
|
|
@close="closeDialog"
|
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
|
|
|
+ width="900px"
|
|
|
>
|
|
>
|
|
|
<div class="user-panel" v-loading="loading">
|
|
<div class="user-panel" v-loading="loading">
|
|
|
<el-form
|
|
<el-form
|
|
@@ -20,18 +21,6 @@
|
|
|
:rules="ruleValidate"
|
|
:rules="ruleValidate"
|
|
|
:label-width="'100px'"
|
|
:label-width="'100px'"
|
|
|
>
|
|
>
|
|
|
- <!-- <el-row>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="单位" prop="companyId">
|
|
|
|
|
- <el-select-tree
|
|
|
|
|
- :props="props"
|
|
|
|
|
- :options="companyResult"
|
|
|
|
|
- v-model="formModel.companyId"
|
|
|
|
|
- height="200"
|
|
|
|
|
- ></el-select-tree>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </el-row> -->
|
|
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-form-item label="姓名" prop="name">
|
|
<el-form-item label="姓名" prop="name">
|
|
@@ -41,18 +30,6 @@
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="园区" prop="parkId">
|
|
|
|
|
- <el-select-tree
|
|
|
|
|
- :props="props"
|
|
|
|
|
- :options="parkList"
|
|
|
|
|
- v-model="formModel.parkId"
|
|
|
|
|
- height="200"
|
|
|
|
|
- ></el-select-tree>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- <el-row>
|
|
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-form-item label="手机号" prop="phone">
|
|
<el-form-item label="手机号" prop="phone">
|
|
|
<el-input
|
|
<el-input
|
|
@@ -61,34 +38,48 @@
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="身份证" prop="idCard">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="formModel.idCard"
|
|
|
|
|
- placeholder="请输入身份证"
|
|
|
|
|
- ></el-input>
|
|
|
|
|
|
|
+ <el-form-item label="单位" prop="companyId">
|
|
|
|
|
+ <el-select-tree
|
|
|
|
|
+ :props="props"
|
|
|
|
|
+ :options="companyResult"
|
|
|
|
|
+ v-model="formModel.companyId"
|
|
|
|
|
+ height="200"
|
|
|
|
|
+ style="width:330px;"
|
|
|
|
|
+ size="large"
|
|
|
|
|
+ ></el-select-tree>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- </el-row>
|
|
|
|
|
- <!-- <el-row>
|
|
|
|
|
- <el-col :span="24">
|
|
|
|
|
- <el-form-item label="用户身份" prop="popedom">
|
|
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="用户身份" prop="personRoleId">
|
|
|
<el-select
|
|
<el-select
|
|
|
- v-model="formModel.popedom"
|
|
|
|
|
filterable
|
|
filterable
|
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
|
style="width: 280px"
|
|
style="width: 280px"
|
|
|
|
|
+ v-model="formModel.personRoleId"
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="role in personRoleResult"
|
|
v-for="role in personRoleResult"
|
|
|
:key="role.personRoleName"
|
|
:key="role.personRoleName"
|
|
|
:label="role.personRoleName"
|
|
:label="role.personRoleName"
|
|
|
- :value="role.personRoleName"
|
|
|
|
|
|
|
+ :value="role.id"
|
|
|
></el-option>
|
|
></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- </el-row> -->
|
|
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="身份证" prop="idCard">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="formModel.idCard"
|
|
|
|
|
+ placeholder="请输入身份证"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
|
<el-form-item label="关联单位" prop="personCompany">
|
|
<el-form-item label="关联单位" prop="personCompany">
|
|
@@ -250,6 +241,26 @@ export default {
|
|
|
"companyPosition4",
|
|
"companyPosition4",
|
|
|
"companyPosition5",
|
|
"companyPosition5",
|
|
|
],
|
|
],
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ "formModel.companyId":function(newVal,oldVal){
|
|
|
|
|
+ var self = this;
|
|
|
|
|
+
|
|
|
|
|
+ if(newVal!=null){
|
|
|
|
|
+ var formData = new FormData();
|
|
|
|
|
+ formData.append("companyId", newVal);
|
|
|
|
|
+
|
|
|
|
|
+ //查询单位下角色
|
|
|
|
|
+ personRoleInfoApi.listByCompanyId(formData)
|
|
|
|
|
+ .then(response=>{
|
|
|
|
|
+ var jsonData = response.data;
|
|
|
|
|
+
|
|
|
|
|
+ if (jsonData.result) {
|
|
|
|
|
+ self.personRoleResult = jsonData.data;
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
data() {
|
|
data() {
|
|
|
let checkIdCard = (rule, value, callback) => {
|
|
let checkIdCard = (rule, value, callback) => {
|
|
|
var identNumber = value;
|
|
var identNumber = value;
|
|
@@ -268,6 +279,7 @@ export default {
|
|
|
companyId: [{ required: true, message: "请选择单位", trigger: "blur" }],
|
|
companyId: [{ required: true, message: "请选择单位", trigger: "blur" }],
|
|
|
name: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
|
|
name: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
|
|
|
phone: [{ required: true, message: "手机号不能为空", trigger: "blur" }],
|
|
phone: [{ required: true, message: "手机号不能为空", trigger: "blur" }],
|
|
|
|
|
+ personRoleId: [{ required: true, message: "请选择身份", trigger: "blur" }]
|
|
|
// idCard: [
|
|
// idCard: [
|
|
|
// { required: false, message: "身份证不能为空", trigger: "blur" },
|
|
// { required: false, message: "身份证不能为空", trigger: "blur" },
|
|
|
// {
|
|
// {
|
|
@@ -275,9 +287,6 @@ export default {
|
|
|
// trigger: "blur"
|
|
// trigger: "blur"
|
|
|
// }
|
|
// }
|
|
|
// ]
|
|
// ]
|
|
|
- popedom: [
|
|
|
|
|
- { required: true, message: "请选择用户身份", trigger: "blur" },
|
|
|
|
|
- ],
|
|
|
|
|
},
|
|
},
|
|
|
showDialog: true,
|
|
showDialog: true,
|
|
|
loading: false,
|
|
loading: false,
|
|
@@ -358,15 +367,15 @@ export default {
|
|
|
var id = self.formModel.id;
|
|
var id = self.formModel.id;
|
|
|
//数组转换为字符串
|
|
//数组转换为字符串
|
|
|
//用户身份
|
|
//用户身份
|
|
|
- if (
|
|
|
|
|
- self.formModel.popedom != null &&
|
|
|
|
|
- self.formModel.popedom != ""
|
|
|
|
|
- ) {
|
|
|
|
|
- var popedom = self.formModel.popedom.join(",");
|
|
|
|
|
- self.formModel.popedom = popedom;
|
|
|
|
|
- } else {
|
|
|
|
|
- self.formModel.popedom = "";
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (
|
|
|
|
|
+ // self.formModel.popedom != null &&
|
|
|
|
|
+ // self.formModel.popedom != ""
|
|
|
|
|
+ // ) {
|
|
|
|
|
+ // var popedom = self.formModel.popedom.join(",");
|
|
|
|
|
+ // self.formModel.popedom = popedom;
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // self.formModel.popedom = "";
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
//子单位
|
|
//子单位
|
|
|
if (
|
|
if (
|
|
@@ -451,12 +460,12 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (self.businessKey.length == 0) {
|
|
if (self.businessKey.length == 0) {
|
|
|
- self.formModel.popedom = ["1"];
|
|
|
|
|
|
|
+ //self.formModel.popedom = ["1"];
|
|
|
} else {
|
|
} else {
|
|
|
- var popedom = self.formModel.popedom;
|
|
|
|
|
- if (popedom != "") {
|
|
|
|
|
- self.formModel.popedom = popedom.split(",");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // var popedom = self.formModel.popedom;
|
|
|
|
|
+ // if (popedom != "") {
|
|
|
|
|
+ // self.formModel.popedom = popedom.split(",");
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
var personCompany = self.formModel.personCompany;
|
|
var personCompany = self.formModel.personCompany;
|
|
|
if (personCompany != "") {
|
|
if (personCompany != "") {
|
|
@@ -468,19 +477,6 @@ export default {
|
|
|
self.formModel.wechatNoticeEnabled = true;
|
|
self.formModel.wechatNoticeEnabled = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- var formData5 = new FormData();
|
|
|
|
|
- formData5.append("companyId", self.formModel.companyId);
|
|
|
|
|
- personRoleInfoApi
|
|
|
|
|
- .listByCompanyId(formData5)
|
|
|
|
|
- .then(function (response) {
|
|
|
|
|
- var jsonData = response.data;
|
|
|
|
|
- if (jsonData.result) {
|
|
|
|
|
- if (jsonData.data != null && jsonData.data != "") {
|
|
|
|
|
- self.personRoleResult = jsonData.data;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
} else {
|
|
} else {
|
|
|
self.$message.error(jsonData.message + "");
|
|
self.$message.error(jsonData.message + "");
|
|
|
}
|
|
}
|