|
@@ -17,15 +17,18 @@
|
|
|
<u-form-item label="所在位置 " prop="fpdLocal">
|
|
<u-form-item label="所在位置 " prop="fpdLocal">
|
|
|
<u-input v-model="formData.fpdLocal" placeholder="请输入所在位置" />
|
|
<u-input v-model="formData.fpdLocal" placeholder="请输入所在位置" />
|
|
|
</u-form-item>
|
|
</u-form-item>
|
|
|
- <!-- <u-form-item label="设备状态" @click="
|
|
|
|
|
|
|
+ <!-- <u-form-item label="设备状态" @click="
|
|
|
showSex4 = true;
|
|
showSex4 = true;
|
|
|
hideKeyboard();
|
|
hideKeyboard();
|
|
|
">
|
|
">
|
|
|
<u--input v-model="fpdStatus" disabled disabledColor="#ffffff" placeholder="请选择设备状态"></u--input>
|
|
<u--input v-model="fpdStatus" disabled disabledColor="#ffffff" placeholder="请选择设备状态"></u--input>
|
|
|
</u-form-item> -->
|
|
</u-form-item> -->
|
|
|
|
|
|
|
|
- <u-form-item label="所属建筑">
|
|
|
|
|
- <u-input v-model="formData.buildingId" placeholder="请输入所属建筑" />
|
|
|
|
|
|
|
+ <u-form-item label="所属建筑" @click="
|
|
|
|
|
+ showBuilding = true;
|
|
|
|
|
+ hideKeyboard();
|
|
|
|
|
+ ">
|
|
|
|
|
+ <u-input v-model="formData.buildingName" placeholder="请输入所属建筑" />
|
|
|
</u-form-item>
|
|
</u-form-item>
|
|
|
<u-form-item label="设施类别" prop="ywbnc" @click="
|
|
<u-form-item label="设施类别" prop="ywbnc" @click="
|
|
|
showSex = true;
|
|
showSex = true;
|
|
@@ -78,6 +81,8 @@
|
|
|
@select="sexSelect4"></u-action-sheet>
|
|
@select="sexSelect4"></u-action-sheet>
|
|
|
<u-action-sheet :show="showSex5" :actions="actions5" title="请选择单位" @close="showSex5 = false"
|
|
<u-action-sheet :show="showSex5" :actions="actions5" title="请选择单位" @close="showSex5 = false"
|
|
|
@select="sexSelect5"></u-action-sheet>
|
|
@select="sexSelect5"></u-action-sheet>
|
|
|
|
|
+ <u-action-sheet :show="showBuilding" :actions="buildingData" title="请选择所属建筑" @close="showBuilding = false"
|
|
|
|
|
+ @select="buildingSelect"></u-action-sheet>
|
|
|
<!-- 加载中 -->
|
|
<!-- 加载中 -->
|
|
|
<!-- <isLodingModel></isLodingModel> -->
|
|
<!-- <isLodingModel></isLodingModel> -->
|
|
|
</view>
|
|
</view>
|
|
@@ -94,6 +99,9 @@
|
|
|
getOrgId
|
|
getOrgId
|
|
|
} from '@/api/fire_device';
|
|
} from '@/api/fire_device';
|
|
|
import {
|
|
import {
|
|
|
|
|
+ getArc, //获取建筑信息列表
|
|
|
|
|
+ } from '@/api/architecture';
|
|
|
|
|
+ import {
|
|
|
getAccessToken
|
|
getAccessToken
|
|
|
} from '@/utils/auth'
|
|
} from '@/utils/auth'
|
|
|
import {
|
|
import {
|
|
@@ -107,6 +115,8 @@
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ showBuilding: false, //所属建筑
|
|
|
|
|
+ buildingData: [],
|
|
|
contentText: {
|
|
contentText: {
|
|
|
contentrefresh: '上传照片中',
|
|
contentrefresh: '上传照片中',
|
|
|
},
|
|
},
|
|
@@ -139,7 +149,8 @@
|
|
|
formData: {
|
|
formData: {
|
|
|
status: '0',
|
|
status: '0',
|
|
|
orgName: '',
|
|
orgName: '',
|
|
|
- picVOList: []
|
|
|
|
|
|
|
+ picVOList: [],
|
|
|
|
|
+ buildingId: ''
|
|
|
},
|
|
},
|
|
|
// 用于显示下拉确认内容,不作为提交
|
|
// 用于显示下拉确认内容,不作为提交
|
|
|
fpdStatus: '',
|
|
fpdStatus: '',
|
|
@@ -208,7 +219,21 @@
|
|
|
onReady() {
|
|
onReady() {
|
|
|
this.$refs.customForm.setRules(this.customRules);
|
|
this.$refs.customForm.setRules(this.customRules);
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+ onShow() {
|
|
|
|
|
+ this.buildingData = []
|
|
|
|
|
+ getArc({
|
|
|
|
|
+ pageNo: 1,
|
|
|
|
|
+ pageSize: 100,
|
|
|
|
|
+ orgId: this.formData.orgId,
|
|
|
|
|
+ }).then(response => {
|
|
|
|
|
+ response.data.records.map(v => {
|
|
|
|
|
+ this.buildingData.push({
|
|
|
|
|
+ id: v.id,
|
|
|
|
|
+ name: v.buildingName
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
closeImage(val, index) {
|
|
closeImage(val, index) {
|
|
|
this.formData.picVOList.splice(index, 1)
|
|
this.formData.picVOList.splice(index, 1)
|
|
@@ -220,7 +245,7 @@
|
|
|
// sourceType: ['camera'], //实现拍照
|
|
// sourceType: ['camera'], //实现拍照
|
|
|
count: 3,
|
|
count: 3,
|
|
|
sizeType: ['original', 'compressed'],
|
|
sizeType: ['original', 'compressed'],
|
|
|
- sourceType: ['album','camera'], //打开系统相册
|
|
|
|
|
|
|
+ sourceType: ['album', 'camera'], //打开系统相册
|
|
|
success(res) {
|
|
success(res) {
|
|
|
that.loading = true
|
|
that.loading = true
|
|
|
if (Array.isArray(res.tempFilePaths)) { //从相册选择有三张的情况
|
|
if (Array.isArray(res.tempFilePaths)) { //从相册选择有三张的情况
|
|
@@ -258,7 +283,7 @@
|
|
|
},
|
|
},
|
|
|
fail: () => {
|
|
fail: () => {
|
|
|
that.loading = false
|
|
that.loading = false
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
URL.revokeObjectURL(fileUrl);
|
|
URL.revokeObjectURL(fileUrl);
|
|
@@ -286,7 +311,7 @@
|
|
|
})
|
|
})
|
|
|
var jsdata = JSON.stringify(this.formData);
|
|
var jsdata = JSON.stringify(this.formData);
|
|
|
createDevice(jsdata).then(response => {
|
|
createDevice(jsdata).then(response => {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
|
title: response.data.msg
|
|
title: response.data.msg
|
|
|
});
|
|
});
|
|
@@ -296,7 +321,7 @@
|
|
|
});
|
|
});
|
|
|
})
|
|
})
|
|
|
.catch(err => {
|
|
.catch(err => {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
icon: 'none',
|
|
|
title: '错误!' + err[0].message
|
|
title: '错误!' + err[0].message
|
|
@@ -312,22 +337,27 @@
|
|
|
|
|
|
|
|
// 类型
|
|
// 类型
|
|
|
sexSelect2(e) {
|
|
sexSelect2(e) {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
this.formData.fpdTypeName = e.label;
|
|
this.formData.fpdTypeName = e.label;
|
|
|
this.formData.fpdType = e.value;
|
|
this.formData.fpdType = e.value;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
// 设备状态
|
|
// 设备状态
|
|
|
sexSelect4(e) {
|
|
sexSelect4(e) {
|
|
|
this.formData.fpdStatus = e.id;
|
|
this.formData.fpdStatus = e.id;
|
|
|
this.fpdStatus = e.name;
|
|
this.fpdStatus = e.name;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ //所属建筑
|
|
|
|
|
+ buildingSelect(e) {
|
|
|
|
|
+ this.formData.buildingId = e.id;
|
|
|
|
|
+ this.formData.buildingName = e.name;
|
|
|
},
|
|
},
|
|
|
// 所属单位
|
|
// 所属单位
|
|
|
sexSelect5(e) {
|
|
sexSelect5(e) {
|
|
|
this.formData.orgId = e.id;
|
|
this.formData.orgId = e.id;
|
|
|
this.formData.orgName = e.name;
|
|
this.formData.orgName = e.name;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 生成隐患弹出层 //暂存为草稿箱弹出层
|
|
// 生成隐患弹出层 //暂存为草稿箱弹出层
|
|
@@ -544,6 +574,7 @@
|
|
|
.example {
|
|
.example {
|
|
|
overflow-y: auto;
|
|
overflow-y: auto;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/deep/.u-action-sheet {
|
|
/deep/.u-action-sheet {
|
|
|
overflow-y: auto;
|
|
overflow-y: auto;
|
|
|
height: 1000rpx;
|
|
height: 1000rpx;
|