|
@@ -18,7 +18,7 @@
|
|
|
ref="form"
|
|
|
:model="formModel"
|
|
|
:rules="ruleValidate"
|
|
|
- :label-width="'100px'"
|
|
|
+ :label-width="'150px'"
|
|
|
>
|
|
|
<el-form-item label="电话号码" prop="phone">
|
|
|
<el-input
|
|
@@ -42,15 +42,49 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="角色" prop="role">
|
|
|
- <el-select v-model="formModel.role" placeholder="请选择" clearable style="width:200px;">
|
|
|
+ <el-select
|
|
|
+ v-model="formModel.role"
|
|
|
+ placeholder="请选择"
|
|
|
+ clearable
|
|
|
+ style="width: 200px"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in roleList"
|
|
|
:key="item.value"
|
|
|
:label="item.name"
|
|
|
- :value="item.value">
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="自定义授权电表" prop="authorizedStationEnabled">
|
|
|
+ <el-switch
|
|
|
+ v-model="formModel.authorizedStationEnabled"
|
|
|
+ active-color="#13ce66"
|
|
|
+ active-text="开启"
|
|
|
+ inactive-color="#ff4949"
|
|
|
+ inactive-text="不开启"
|
|
|
+ ></el-switch>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="授权电表"
|
|
|
+ prop="roleId"
|
|
|
+ v-show="formModel.authorizedStationEnabled"
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ v-model="authorizedStationList"
|
|
|
+ style="width: 300px"
|
|
|
+ filterable
|
|
|
+ multiple
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="result in chargingStationResult"
|
|
|
+ :key="result.id"
|
|
|
+ :label="result.name"
|
|
|
+ :value="result.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
@@ -65,6 +99,7 @@
|
|
|
import Constant from "@/constant";
|
|
|
import inspectionUserApi from "@/api/inspection/inspectionUser";
|
|
|
import dataDictionaryApi from "@/api/sys/dataDictionary";
|
|
|
+import stationUserRelationApi from "@/api/base/stationUserRelation";
|
|
|
|
|
|
export default {
|
|
|
props: ["businessKey", "title"],
|
|
@@ -83,7 +118,9 @@ export default {
|
|
|
showDialog: true,
|
|
|
loading: false,
|
|
|
submitting: false,
|
|
|
- roleList:[],
|
|
|
+ roleList: [],
|
|
|
+ chargingStationResult: [],
|
|
|
+ authorizedStationList: [],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -95,6 +132,15 @@ export default {
|
|
|
var jsonData = response.data;
|
|
|
self.roleList = jsonData.data;
|
|
|
});
|
|
|
+
|
|
|
+ stationUserRelationApi.stationList().then(function (response) {
|
|
|
+ var jsonData = response.data;
|
|
|
+ if (jsonData.result) {
|
|
|
+ if (jsonData.data != null && jsonData.data != "") {
|
|
|
+ self.chargingStationResult = jsonData.data;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
closeDialog() {
|
|
@@ -108,6 +154,9 @@ export default {
|
|
|
(function () {
|
|
|
var id = self.formModel.id;
|
|
|
|
|
|
+ self.formModel.authorizedStationIds =
|
|
|
+ self.authorizedStationList.join(",");
|
|
|
+
|
|
|
if (id == null || id.length == 0) {
|
|
|
return inspectionUserApi.add(self.formModel);
|
|
|
} else {
|
|
@@ -152,6 +201,13 @@ export default {
|
|
|
|
|
|
if (jsonData.result) {
|
|
|
self.formModel = jsonData.data;
|
|
|
+ if (
|
|
|
+ self.formModel.authorizedStationIds != null &&
|
|
|
+ self.formModel.authorizedStationIds.length > 0
|
|
|
+ ) {
|
|
|
+ self.authorizedStationList =
|
|
|
+ self.formModel.authorizedStationIds.split(",");
|
|
|
+ }
|
|
|
} else {
|
|
|
self.$message.error(jsonData.message + "");
|
|
|
}
|