|
@@ -11,7 +11,7 @@
|
|
|
<view class="basics_li_l">学院</view>
|
|
|
<picker @change="collegeChange" :value="collegeIndex" :range="collegeArray" class="scope_r">
|
|
|
<view class="basics_li_r college_r">
|
|
|
- <view>{{collegeArray[collegeIndex]}}</view>
|
|
|
+ <view>{{form.deptName?form.deptName:'选择学院'}}</view>
|
|
|
<img src="@/images/Version3.3.3/icon_06.png">
|
|
|
</view>
|
|
|
</picker>
|
|
@@ -19,7 +19,7 @@
|
|
|
<view class="basics_li">
|
|
|
<view class="basics_li_l">实验室</view>
|
|
|
<view class="basics_li_r lab_r">
|
|
|
- <input class="picker-text" @click="popupClick(1)" type="text" disabled v-model="form.fjNumber" placeholder="请选择房间" placeholder-style="font-size: 30rpx;color:#333;">
|
|
|
+ <input class="picker-text" @click="popupClick(1)" type="text" disabled v-model="form.subName" placeholder="请选择房间" placeholder-style="font-size: 30rpx;color:#333;">
|
|
|
<view class="img-box" @click.stop="saoCode">
|
|
|
<img src="@/images/Version3.3.3/icon_aqjc_sm.png">
|
|
|
</view>
|
|
@@ -27,16 +27,16 @@
|
|
|
</view>
|
|
|
<view class="check-for-input-max-box">
|
|
|
<view class="left-title-p">隐患描述:</view>
|
|
|
- <textarea type="text" v-model="form.yhMs" maxlength="50" placeholder="请输入隐患描述" placeholder-style="font-size:28rpx;color:#999;"></textarea>
|
|
|
+ <textarea type="text" v-model="form.hazardDescribe" maxlength="50" placeholder="请输入隐患描述" placeholder-style="font-size:28rpx;color:#999;"></textarea>
|
|
|
</view>
|
|
|
<view class="check-for-img-max-box">
|
|
|
<view class="left-title-p">隐患照片(最多上传5张):</view>
|
|
|
<view class="right-img-box">
|
|
|
- <view class="img-box" v-for="(imgUrl,imgIndex) in form.yhImg" :key="imgIndex">
|
|
|
- <img class="img-data" :src="configURL+imgUrl">
|
|
|
+ <view class="img-box" v-for="(imgUrl,imgIndex) in form.imgDtoList" :key="imgIndex">
|
|
|
+ <img class="img-data" :src="configURL+imgUrl.fileUrl">
|
|
|
<img class="position-img" src="@/pages_manage/images/icon_ssp_closure.png" @click="delImg(imgIndex)">
|
|
|
</view>
|
|
|
- <img class="add-button" src="@/pages_manage/images/icon_07.png" @click="selectImage()" v-if="form.yhImg.length<5">
|
|
|
+ <img class="add-button" src="@/pages_manage/images/icon_07.png" @click="selectImage()" v-if="form.imgDtoList.length<5">
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -59,14 +59,14 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="bottom_btn" @click="handleClick('subBtn')">提交</view>
|
|
|
+ <view class="bottom_btn" @click="submitForm()">提交</view>
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { config } from '@/api/request/config.js'
|
|
|
-import { getSelectInfoByRoom} from '@/api/index.js'
|
|
|
+import { getSelectInfoByRoom,conditionCollegeInfo,checkClapAdd } from '@/api/index.js'
|
|
|
export default {
|
|
|
name: "rectifyList",
|
|
|
components: {
|
|
@@ -82,15 +82,17 @@ export default {
|
|
|
pageSize:20,
|
|
|
},
|
|
|
form:{
|
|
|
- name:'',
|
|
|
- startTime:'',
|
|
|
- inspectResult:0,//检查结果
|
|
|
- yhMs:'',
|
|
|
- yhImg:[],
|
|
|
+ deptId:'',
|
|
|
+ deptName:'',
|
|
|
+ subId:'',
|
|
|
+ subName:'',
|
|
|
+ hazardDescribe:'',
|
|
|
+ imgDtoList:[],
|
|
|
},
|
|
|
collegeIndex :0,
|
|
|
- collegeArray:['选择学院','学院名称1','学院名称2','学院名称3',],
|
|
|
+ collegeArray:[],
|
|
|
categoryIndex :0,
|
|
|
+ collegeList:[],
|
|
|
categoryArray:['校级巡查','院级巡查'],
|
|
|
planIndex :0,
|
|
|
planArray:['请选择巡查计划标题','2023年3月份校级督导检查','2023年4月份校级督导检查'],
|
|
@@ -115,7 +117,7 @@ export default {
|
|
|
|
|
|
},
|
|
|
mounted(){
|
|
|
-
|
|
|
+ this.conditionCollegeInfo();
|
|
|
},
|
|
|
methods: {
|
|
|
//滚动事件
|
|
@@ -137,11 +139,13 @@ export default {
|
|
|
},
|
|
|
collegeChange(e){
|
|
|
this.collegeIndex = e.target.value;
|
|
|
+ this.form.deptId=this.collegeList[e.target.value].deptId
|
|
|
+ this.form.deptName=this.collegeList[e.target.value].deptName
|
|
|
},
|
|
|
// 图片上传
|
|
|
selectImage() {
|
|
|
let self = this;
|
|
|
- if(this.form.yhImg.length>4){
|
|
|
+ if(this.form.imgDtoList.length>4){
|
|
|
uni.showToast({
|
|
|
title: '最多上传5张图片',
|
|
|
icon:"none",
|
|
@@ -176,8 +180,9 @@ export default {
|
|
|
},
|
|
|
success: (uploadFileRes) => {
|
|
|
let res = JSON.parse(uploadFileRes.data);
|
|
|
+ console.log(res.data)
|
|
|
if(res.code == 200){
|
|
|
- this.form.yhImg.push(res.data.url);
|
|
|
+ this.form.imgDtoList.push({'fileUrl':res.data.url,'fileName':res.data.name});
|
|
|
console.log(res.data.url)
|
|
|
}else{
|
|
|
uni.showToast({
|
|
@@ -196,7 +201,7 @@ export default {
|
|
|
},
|
|
|
//删除图片
|
|
|
delImg(minIndex){
|
|
|
- this.form.yhImg.splice(minIndex,1);
|
|
|
+ this.form.imgDtoList.splice(minIndex,1);
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
//搜索房间弹层开关
|
|
@@ -237,16 +242,9 @@ export default {
|
|
|
},
|
|
|
//确认搜索房间
|
|
|
popupClickItem(item){
|
|
|
- this.$set(this.form,"fjNumber",item.room)
|
|
|
- this.$set(this.form,"deptName",item.deptName)
|
|
|
- this.$set(this.form,"buildingId",item.building)
|
|
|
- this.$set(this.form,"deptId",item.deptId)
|
|
|
- this.$set(this.form,"laboratoryId",item.id)
|
|
|
- this.$set(this.form,"buildingName",item.buildName)
|
|
|
- this.$set(this.form,"laboratoryName",item.name)
|
|
|
- this.$set(this.form,"fzrId",item.userId)
|
|
|
- this.$set(this.form,"fzrName",item.safeUserName)
|
|
|
- this.$set(this.form,"fzrLxfs",item.safeUserPhone)
|
|
|
+ console.log(item)
|
|
|
+ this.$set(this.form,"subId",item.id)
|
|
|
+ this.$set(this.form,"subName",item.name)
|
|
|
this.popupType = false;
|
|
|
},
|
|
|
//调用摄像头
|
|
@@ -284,6 +282,36 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ //查询学院列表
|
|
|
+ async conditionCollegeInfo(){
|
|
|
+ let _this = this;
|
|
|
+ const {data} = await conditionCollegeInfo();
|
|
|
+ if(data.code == 200){
|
|
|
+
|
|
|
+ for(let i=0;i<data.data.length;i++){
|
|
|
+ _this.collegeArray.push(data.data[i].deptName)
|
|
|
+ }
|
|
|
+ _this.collegeList=data.data;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //添加
|
|
|
+ async submitForm(){
|
|
|
+ let _this = this;
|
|
|
+ const {data} = await checkClapAdd(_this.form);
|
|
|
+ if(data.code == 200){
|
|
|
+ uni.showToast({
|
|
|
+ title: '提交成功',
|
|
|
+ icon:"none",
|
|
|
+ mask:true,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ // uni.redirectTo({
|
|
|
+ // url: '/pages/pages_safetyExamine/patrolPlan/patrolPlanList?pageType='+this.form.checkType
|
|
|
+ // });
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
|
|
|
}
|
|
|
}
|