|
@@ -34,29 +34,29 @@
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="摄像头:" prop="cameraId">
|
|
|
|
- <el-select v-model="newData.cameraId" placeholder="请选择摄像头" style="width: 500px">
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in cameraOptions"
|
|
|
|
- :key="item.value"
|
|
|
|
- :label="item.label"
|
|
|
|
- :value="item.value"
|
|
|
|
- />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- </div>
|
|
|
|
- <div class="form-max-box">
|
|
|
|
- <el-form-item label="采集器:" prop="collectorId">
|
|
|
|
- <el-select v-model="newData.collectorId" placeholder="请选择采集器" style="width: 500px">
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in harvesterOptions"
|
|
|
|
- :key="item.value"
|
|
|
|
- :label="item.label"
|
|
|
|
- :value="item.value"
|
|
|
|
- />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <!--<el-form-item label="摄像头:" prop="cameraId">-->
|
|
|
|
+ <!--<el-select v-model="newData.cameraId" placeholder="请选择摄像头" style="width: 500px">-->
|
|
|
|
+ <!--<el-option-->
|
|
|
|
+ <!--v-for="item in cameraOptions"-->
|
|
|
|
+ <!--:key="item.value"-->
|
|
|
|
+ <!--:label="item.label"-->
|
|
|
|
+ <!--:value="item.value"-->
|
|
|
|
+ <!--/>-->
|
|
|
|
+ <!--</el-select>-->
|
|
|
|
+ <!--</el-form-item>-->
|
|
</div>
|
|
</div>
|
|
|
|
+ <!--<div class="form-max-box">-->
|
|
|
|
+ <!--<el-form-item label="采集器:" prop="collectorId">-->
|
|
|
|
+ <!--<el-select v-model="newData.collectorId" placeholder="请选择采集器" style="width: 500px">-->
|
|
|
|
+ <!--<el-option-->
|
|
|
|
+ <!--v-for="item in harvesterOptions"-->
|
|
|
|
+ <!--:key="item.value"-->
|
|
|
|
+ <!--:label="item.label"-->
|
|
|
|
+ <!--:value="item.value"-->
|
|
|
|
+ <!--/>-->
|
|
|
|
+ <!--</el-select>-->
|
|
|
|
+ <!--</el-form-item>-->
|
|
|
|
+ <!--</div>-->
|
|
<div class="form-max-box">
|
|
<div class="form-max-box">
|
|
<el-form-item label="柜门设置:" prop="cabinetDoorModelList">
|
|
<el-form-item label="柜门设置:" prop="cabinetDoorModelList">
|
|
<div class="form-add-box">
|
|
<div class="form-add-box">
|
|
@@ -95,15 +95,15 @@
|
|
remote
|
|
remote
|
|
clearable
|
|
clearable
|
|
reserve-keyword
|
|
reserve-keyword
|
|
- @change="userSelectClick(item)"
|
|
|
|
|
|
+ @change="(val)=>userSelectClick(val,index)"
|
|
@clear="userClearClick"
|
|
@clear="userClearClick"
|
|
placeholder="请输入姓名进行搜索"
|
|
placeholder="请输入姓名进行搜索"
|
|
- :remote-method="userSelect">
|
|
|
|
|
|
+ :remote-method="(val)=>userSelect(val,index)">
|
|
<el-option
|
|
<el-option
|
|
- v-for="item in userOptions"
|
|
|
|
- :key="item.userId"
|
|
|
|
- :label="item.userName"
|
|
|
|
- :value="item.userId">
|
|
|
|
|
|
+ v-for="itemOptions in item.userOptions"
|
|
|
|
+ :key="itemOptions.userId"
|
|
|
|
+ :label="itemOptions.userName"
|
|
|
|
+ :value="itemOptions.userId">
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -223,7 +223,27 @@
|
|
adminAndSafeId:[],
|
|
adminAndSafeId:[],
|
|
//当前实验室管理员和安全员id和name
|
|
//当前实验室管理员和安全员id和name
|
|
adminAndSafeList:[],
|
|
adminAndSafeList:[],
|
|
- newData:{},
|
|
|
|
|
|
+ newData:{
|
|
|
|
+ cabinetName:'',
|
|
|
|
+ deptId:'',
|
|
|
|
+ deptName:'',
|
|
|
|
+ subId:'',
|
|
|
|
+ subName:'',
|
|
|
|
+ cameraId:'',
|
|
|
|
+ collectorId:'',
|
|
|
|
+ cabinetDoorModelList:[
|
|
|
|
+ {
|
|
|
|
+ doorName:'默认柜门1',
|
|
|
|
+ doorLayers:'',
|
|
|
|
+ cabinetAdminModelList:[],
|
|
|
|
+ unlockingMethod:'1',
|
|
|
|
+ cabinetLockList:[],
|
|
|
|
+ cabinetLattice:[],
|
|
|
|
+ userOptions:[],
|
|
|
|
+ userNameOptions:[],
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
rules:{
|
|
rules:{
|
|
cabinetName: [
|
|
cabinetName: [
|
|
{ required: true, message: "请输入化学品柜名称", trigger: "blur" },
|
|
{ required: true, message: "请输入化学品柜名称", trigger: "blur" },
|
|
@@ -273,7 +293,10 @@
|
|
{ required: true, message: "请选择柜格", trigger: "blur" },
|
|
{ required: true, message: "请选择柜格", trigger: "blur" },
|
|
{ required: true, message: "请选择柜格", validator: this.spaceJudgment, trigger: "blur" }
|
|
{ required: true, message: "请选择柜格", validator: this.spaceJudgment, trigger: "blur" }
|
|
],
|
|
],
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ //实验室管理员数据
|
|
|
|
+ safeList:[],
|
|
|
|
+ safeIdList:[],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created(){
|
|
created(){
|
|
@@ -289,6 +312,54 @@
|
|
initialize(){
|
|
initialize(){
|
|
let self=this;
|
|
let self=this;
|
|
if(this.propsData.cabinetId){
|
|
if(this.propsData.cabinetId){
|
|
|
|
+ let obj = JSON.parse(JSON.stringify(this.propsData))
|
|
|
|
+ console.log('obj=>', obj)
|
|
|
|
+ let newData = {
|
|
|
|
+ cabinetName:obj.cabinetName,
|
|
|
|
+ deptId:obj.deptId,
|
|
|
|
+ deptName:obj.deptName,
|
|
|
|
+ subId:obj.subId,
|
|
|
|
+ subName:obj.subName,
|
|
|
|
+ cameraId:obj.cameraId,
|
|
|
|
+ collectorId:obj.collectorId,
|
|
|
|
+ cabinetDoorModelList:[],
|
|
|
|
+ }
|
|
|
|
+ obj.cabinetDoorVoList.forEach((item)=>{
|
|
|
|
+ console.log('item=>', item)
|
|
|
|
+ let minObj = {
|
|
|
|
+ doorLayers:item.doorLayers,
|
|
|
|
+ doorName:item.doorName,
|
|
|
|
+ unlockingMethod:item.unlockingMethod,
|
|
|
|
+ cabinetLockList:[],
|
|
|
|
+ cabinetAdminModelList:[],
|
|
|
|
+ userOptions:[],
|
|
|
|
+ userNameOptions:[],
|
|
|
|
+ };
|
|
|
|
+ item.cabinetLockVoList.forEach((bigItem)=>{
|
|
|
|
+ console.log('bigItem=>', bigItem)
|
|
|
|
+ minObj.cabinetLockList.push(bigItem.lockId)
|
|
|
|
+ })
|
|
|
|
+ item.cabinetAdminVoList.forEach((minItem)=>{
|
|
|
|
+ console.log('minItem=>', minItem)
|
|
|
|
+ minObj.cabinetAdminModelList.push(minItem.userId)
|
|
|
|
+ minObj.userOptions.push({
|
|
|
|
+ userId:minItem.userId,
|
|
|
|
+ userName:minItem.userName,
|
|
|
|
+ })
|
|
|
|
+ minObj.userNameOptions.push({
|
|
|
|
+ userId:minItem.userId,
|
|
|
|
+ userName:minItem.userName,
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ newData.cabinetDoorModelList.push(minObj);
|
|
|
|
+ })
|
|
|
|
+ this.subOptions=[{subId:obj.subId,subName:obj.subName,}]
|
|
|
|
+ this.$set(this,'newData',newData);
|
|
|
|
+ this.iotDeviceFindByType(this.newData.subId);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return
|
|
this.$set(this,'newData',this.propsData);
|
|
this.$set(this,'newData',this.propsData);
|
|
//智能锁
|
|
//智能锁
|
|
this.iotDeviceFindByType(this.newData.subId);
|
|
this.iotDeviceFindByType(this.newData.subId);
|
|
@@ -330,27 +401,6 @@
|
|
self.userOptions=this.unique(self.userOptions)
|
|
self.userOptions=this.unique(self.userOptions)
|
|
self.userOptionsArr=this.unique(self.userOptions)
|
|
self.userOptionsArr=this.unique(self.userOptions)
|
|
this.newData.cabinetDoorModelList=this.newData.cabinetDoorVoList
|
|
this.newData.cabinetDoorModelList=this.newData.cabinetDoorVoList
|
|
-
|
|
|
|
- }else{
|
|
|
|
- this.$set(this,'newData',{
|
|
|
|
- cabinetName:'',
|
|
|
|
- deptId:'',
|
|
|
|
- deptName:'',
|
|
|
|
- subId:'',
|
|
|
|
- subName:'',
|
|
|
|
- cameraId:'',
|
|
|
|
- collectorId:'',
|
|
|
|
- cabinetDoorModelList:[
|
|
|
|
- {
|
|
|
|
- doorName:'默认柜门1',
|
|
|
|
- doorLayers:'',
|
|
|
|
- cabinetAdminModelList:[],
|
|
|
|
- unlockingMethod:'1',
|
|
|
|
- cabinetLockList:[],
|
|
|
|
- cabinetLattice:[],
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
- });
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 返回按钮
|
|
// 返回按钮
|
|
@@ -371,30 +421,81 @@
|
|
},
|
|
},
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
submitForm() {
|
|
submitForm() {
|
|
|
|
+ let self = this;
|
|
this.$refs["form"].validate(valid => {
|
|
this.$refs["form"].validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- let self=this;
|
|
|
|
- self.newData.cabinetDoorModelList.forEach(function(item) {
|
|
|
|
- //管理员数据处理
|
|
|
|
- item.cabinetAdminModelList=item.cabinetAdminModelListArr
|
|
|
|
- //当开门方式为智能锁数据处理
|
|
|
|
- if (item.unlockingMethod=='2'){
|
|
|
|
- item.cabinetLockList= item.cabinetLockListArr
|
|
|
|
- }
|
|
|
|
- //当开门方式为钥匙柜时数据处理
|
|
|
|
- if (item.unlockingMethod=='3'){
|
|
|
|
- item.cabinetLockList= item.cabinetLockListArr
|
|
|
|
- item.cabinetLockList[0].cabinetLattice=item.cabinetLattice.join(',')
|
|
|
|
- }
|
|
|
|
|
|
+ let obj = JSON.parse(JSON.stringify(this.newData))
|
|
|
|
+ let modelList = [];
|
|
|
|
+ obj.cabinetDoorModelList.forEach((item)=>{
|
|
|
|
+ let userList = [];
|
|
|
|
+ item.cabinetAdminModelList.forEach((bigItem)=>{
|
|
|
|
+ let num = 0;
|
|
|
|
+ item.userNameOptions.forEach((minItem)=>{
|
|
|
|
+ if(bigItem == minItem.userId){
|
|
|
|
+ if(num < 1){
|
|
|
|
+ num++
|
|
|
|
+ userList.push({
|
|
|
|
+ userId:minItem.userId,
|
|
|
|
+ userName:minItem.userName,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ delete item.userOptions;
|
|
|
|
+ delete item.userNameOptions;
|
|
|
|
+ let lockList = [];
|
|
|
|
+ item.cabinetLockList.forEach((item)=>{
|
|
|
|
+ self.lockOptions.forEach((minItem)=>{
|
|
|
|
+ if(item == minItem.lockId){
|
|
|
|
+ lockList.push({
|
|
|
|
+ lockId: minItem.lockId,
|
|
|
|
+ lockName: minItem.lockName,
|
|
|
|
+ lockNum: minItem.lockNum,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ modelList.push({
|
|
|
|
+ doorLayers:item.doorLayers,
|
|
|
|
+ doorName:item.doorName,
|
|
|
|
+ unlockingMethod:item.unlockingMethod,
|
|
|
|
+ cabinetLockList:lockList,
|
|
|
|
+ cabinetAdminModelList:userList,
|
|
|
|
+ })
|
|
})
|
|
})
|
|
|
|
+ let upData = {
|
|
|
|
+ cabinetName : obj.cabinetName,
|
|
|
|
+ deptId : obj.deptId,
|
|
|
|
+ deptName : obj.deptName,
|
|
|
|
+ subId : obj.subId,
|
|
|
|
+ subName : obj.subName,
|
|
|
|
+ cameraId:1,
|
|
|
|
+ collectorId:1,
|
|
|
|
+ cabinetDoorModelList:modelList,
|
|
|
|
+ }
|
|
|
|
+ console.log('upData',upData);
|
|
|
|
+ // self.newData.cabinetDoorModelList.forEach(function(item) {
|
|
|
|
+ // //管理员数据处理
|
|
|
|
+ // item.cabinetAdminModelList=item.cabinetAdminModelListArr
|
|
|
|
+ // //当开门方式为智能锁数据处理
|
|
|
|
+ // if (item.unlockingMethod=='2'){
|
|
|
|
+ // item.cabinetLockList= item.cabinetLockListArr
|
|
|
|
+ // }
|
|
|
|
+ // //当开门方式为钥匙柜时数据处理
|
|
|
|
+ // if (item.unlockingMethod=='3'){
|
|
|
|
+ // item.cabinetLockList= item.cabinetLockListArr
|
|
|
|
+ // item.cabinetLockList[0].cabinetLattice=item.cabinetLattice.join(',')
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
if (this.newData.cabinetId){//编辑
|
|
if (this.newData.cabinetId){//编辑
|
|
- chemicalCabinetUpdate(self.newData).then( response => {
|
|
|
|
|
|
+ upData.cabinetId = this.newData.cabinetId;
|
|
|
|
+ chemicalCabinetUpdate(upData).then( response => {
|
|
self.msgSuccess("提交成功")
|
|
self.msgSuccess("提交成功")
|
|
self.$parent.tableButton(5);
|
|
self.$parent.tableButton(5);
|
|
});
|
|
});
|
|
}else{//提交
|
|
}else{//提交
|
|
-
|
|
|
|
- chemicalCabinetAdd(self.newData).then( response => {
|
|
|
|
|
|
+ chemicalCabinetAdd(upData).then( response => {
|
|
self.msgSuccess("提交成功")
|
|
self.msgSuccess("提交成功")
|
|
self.$parent.tableButton(5);
|
|
self.$parent.tableButton(5);
|
|
});
|
|
});
|
|
@@ -411,12 +512,12 @@
|
|
//学院选中
|
|
//学院选中
|
|
deptChange(){
|
|
deptChange(){
|
|
this.$set(this.newData,'subId','');
|
|
this.$set(this.newData,'subId','');
|
|
- this.$set(this,'userOptions',[]);
|
|
|
|
- this.newData.cabinetDoorModelList.forEach((item)=>{
|
|
|
|
- item.cabinetLockList = [];
|
|
|
|
- item.cabinetLockListArr = [];
|
|
|
|
- item.cabinetAdminModelList = [];
|
|
|
|
- })
|
|
|
|
|
|
+ // this.$set(this,'userOptions',[]);
|
|
|
|
+ // this.newData.cabinetDoorModelList.forEach((item)=>{
|
|
|
|
+ // item.cabinetLockList = [];
|
|
|
|
+ // item.cabinetLockListArr = [];
|
|
|
|
+ // item.cabinetAdminModelList = [];
|
|
|
|
+ // })
|
|
for (let i=0;i<this.deptOptions.length;i++){
|
|
for (let i=0;i<this.deptOptions.length;i++){
|
|
if (this.newData.deptId==this.deptOptions[i].deptId){
|
|
if (this.newData.deptId==this.deptOptions[i].deptId){
|
|
this.$set(this.newData, 'deptName', this.deptOptions[i].deptName)
|
|
this.$set(this.newData, 'deptName', this.deptOptions[i].deptName)
|
|
@@ -436,48 +537,90 @@
|
|
});
|
|
});
|
|
},
|
|
},
|
|
//实验室选中
|
|
//实验室选中
|
|
- subChange(){
|
|
|
|
|
|
+ subChange(val){
|
|
|
|
+ let list = [];
|
|
|
|
+ let idList = [];
|
|
|
|
+ this.subOptions.forEach((item)=>{
|
|
|
|
+ if(item.subId == val){
|
|
|
|
+ this.$set(this.newData, 'subName', item.subName)
|
|
|
|
+ if (item.oneSafeId){
|
|
|
|
+ idList.push(item.oneSafeId)
|
|
|
|
+ list.push({
|
|
|
|
+ userId:item.oneSafeId,
|
|
|
|
+ userName:item.oneSafeName,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ if (item.twoSafeId){
|
|
|
|
+ idList.push(item.twoSafeId)
|
|
|
|
+ list.push({
|
|
|
|
+ userId:item.twoSafeId,
|
|
|
|
+ userName:item.twoSafeName,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.$set(this,'safeList',list);
|
|
|
|
+ this.$set(this,'safeIdList',idList);
|
|
|
|
+ //刷新现有数据
|
|
this.newData.cabinetDoorModelList.forEach((item)=>{
|
|
this.newData.cabinetDoorModelList.forEach((item)=>{
|
|
- item.cabinetLockList = [];
|
|
|
|
- item.cabinetLockListArr = [];
|
|
|
|
- item.cabinetAdminModelList = [];
|
|
|
|
|
|
+ if(!item.cabinetAdminModelList[0]){
|
|
|
|
+ item.cabinetAdminModelList = idList;
|
|
|
|
+ item.userOptions = JSON.parse(JSON.stringify(list));
|
|
|
|
+ item.userNameOptions = JSON.parse(JSON.stringify(list));
|
|
|
|
+ }
|
|
})
|
|
})
|
|
- this.adminAndSafeFun();
|
|
|
|
this.iotDeviceFindByType(this.newData.subId);
|
|
this.iotDeviceFindByType(this.newData.subId);
|
|
},
|
|
},
|
|
//选中实验室后给柜门管理员赋值
|
|
//选中实验室后给柜门管理员赋值
|
|
- adminAndSafeFun(){
|
|
|
|
- let list=[];
|
|
|
|
- let list2=[];
|
|
|
|
- for (let i=0;i<this.subOptions.length;i++){
|
|
|
|
- if (this.newData.subId==this.subOptions[i].subId){
|
|
|
|
- this.$set(this.newData, 'subName', this.subOptions[i].subName)
|
|
|
|
- //获取当前实验室管理员和安全员
|
|
|
|
- if (this.subOptions[i].adminId){
|
|
|
|
- list.push(this.subOptions[i].adminId)
|
|
|
|
- list2.push({userId:this.subOptions[i].adminId,userName:this.subOptions[i].adminName})
|
|
|
|
- }
|
|
|
|
- if (this.subOptions[i].oneSafeId){
|
|
|
|
- list.push(this.subOptions[i].oneSafeId)
|
|
|
|
- list2.push({userId:this.subOptions[i].oneSafeId,userName:this.subOptions[i].oneSafeName})
|
|
|
|
- }
|
|
|
|
- if (this.subOptions[i].twoSafeId){
|
|
|
|
- list.push(this.subOptions[i].twoSafeId)
|
|
|
|
- list2.push({userId:this.subOptions[i].twoSafeId,userName:this.subOptions[i].twoSafeName})
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.$set(this,'adminAndSafeId',list)
|
|
|
|
- this.$set(this,'adminAndSafeList',list2)
|
|
|
|
- this.$set(this,'userOptions',list2)
|
|
|
|
- //循环给每个柜门的管理员赋值
|
|
|
|
- for (let b=0;b<this.newData.cabinetDoorModelList.length;b++){
|
|
|
|
- this.newData.cabinetDoorModelList[b].cabinetAdminModelList=list
|
|
|
|
- this.newData.cabinetDoorModelList[b].cabinetAdminModelListArr=list2
|
|
|
|
- }
|
|
|
|
|
|
+ adminAndSafeFun(val){
|
|
|
|
+ // let list=[];
|
|
|
|
+ // let list2=[];
|
|
|
|
+ // for (let i=0;i<this.subOptions.length;i++){
|
|
|
|
+ // if (this.newData.subId==this.subOptions[i].subId){
|
|
|
|
+ // this.$set(this.newData, 'subName', this.subOptions[i].subName)
|
|
|
|
+ // //获取当前实验室管理员和安全员
|
|
|
|
+ // if (this.subOptions[i].adminId){
|
|
|
|
+ // list.push(this.subOptions[i].adminId)
|
|
|
|
+ // list2.push({userId:this.subOptions[i].adminId,userName:this.subOptions[i].adminName})
|
|
|
|
+ // }
|
|
|
|
+ // if (this.subOptions[i].oneSafeId){
|
|
|
|
+ // list.push(this.subOptions[i].oneSafeId)
|
|
|
|
+ // list2.push({userId:this.subOptions[i].oneSafeId,userName:this.subOptions[i].oneSafeName})
|
|
|
|
+ // }
|
|
|
|
+ // if (this.subOptions[i].twoSafeId){
|
|
|
|
+ // list.push(this.subOptions[i].twoSafeId)
|
|
|
|
+ // list2.push({userId:this.subOptions[i].twoSafeId,userName:this.subOptions[i].twoSafeName})
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // this.$set(this,'adminAndSafeId',list)
|
|
|
|
+ // this.$set(this,'adminAndSafeList',list2)
|
|
|
|
+ // this.$set(this,'userOptions',list2)
|
|
|
|
+ // //循环给每个柜门的管理员赋值
|
|
|
|
+ // for (let b=0;b<this.newData.cabinetDoorModelList.length;b++){
|
|
|
|
+ // this.newData.cabinetDoorModelList[b].cabinetAdminModelList=list
|
|
|
|
+ // this.newData.cabinetDoorModelList[b].cabinetAdminModelListArr=list2
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
//人员选中触发
|
|
//人员选中触发
|
|
- userSelectClick(data){
|
|
|
|
|
|
+ userSelectClick(val,index){
|
|
|
|
+ let self = this;
|
|
|
|
+ console.log('val',val);
|
|
|
|
+ console.log('index',index);
|
|
|
|
+
|
|
|
|
+ this.newData.cabinetDoorModelList[index].userOptions.forEach((item)=>{
|
|
|
|
+ if(item.userId == val){
|
|
|
|
+ self.newData.cabinetDoorModelList[index].userNameOptions.push({
|
|
|
|
+ userId:item.userId,
|
|
|
|
+ userName:item.userName,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
let list=[];//管理员临时存储
|
|
let list=[];//管理员临时存储
|
|
for (let i=0;i<data.cabinetAdminModelList.length;i++){
|
|
for (let i=0;i<data.cabinetAdminModelList.length;i++){
|
|
for (let b=0;b<this.userOptionsArr.length;b++){
|
|
for (let b=0;b<this.userOptionsArr.length;b++){
|
|
@@ -493,16 +636,16 @@
|
|
userClearClick(){
|
|
userClearClick(){
|
|
},
|
|
},
|
|
//人员查询
|
|
//人员查询
|
|
- userSelect(query){
|
|
|
|
- let self=this;
|
|
|
|
|
|
+ userSelect(query,index){
|
|
if (query !== '') {
|
|
if (query !== '') {
|
|
let obj = {
|
|
let obj = {
|
|
userType:'',
|
|
userType:'',
|
|
userName:query,
|
|
userName:query,
|
|
}
|
|
}
|
|
systemUserSelect(obj).then(response => {
|
|
systemUserSelect(obj).then(response => {
|
|
- this.userOptions = response.data;
|
|
|
|
- self.userOptionsArr=[...self.userOptionsArr,...response.data]
|
|
|
|
|
|
+ this.$set(this.newData.cabinetDoorModelList[index],'userOptions',response.data);
|
|
|
|
+ // this.userOptions = response.data;
|
|
|
|
+ // self.userOptionsArr=[...self.userOptionsArr,...response.data]
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
this.userOptions = [];
|
|
this.userOptions = [];
|
|
@@ -566,11 +709,12 @@
|
|
this.newData.cabinetDoorModelList.push({
|
|
this.newData.cabinetDoorModelList.push({
|
|
doorName:'默认柜门'+Number(this.newData.cabinetDoorModelList.length+1),
|
|
doorName:'默认柜门'+Number(this.newData.cabinetDoorModelList.length+1),
|
|
doorLayers:'',
|
|
doorLayers:'',
|
|
- cabinetAdminModelList:this.adminAndSafeId,
|
|
|
|
- cabinetAdminModelListArr:this.adminAndSafeList,
|
|
|
|
|
|
+ cabinetAdminModelList:this.safeIdList,
|
|
unlockingMethod:'1',
|
|
unlockingMethod:'1',
|
|
cabinetLockList:[],
|
|
cabinetLockList:[],
|
|
cabinetLattice:'',
|
|
cabinetLattice:'',
|
|
|
|
+ userOptions:this.safeList,
|
|
|
|
+ userNameOptions:this.safeList,
|
|
})
|
|
})
|
|
this.$forceUpdate()
|
|
this.$forceUpdate()
|
|
}
|
|
}
|