|
@@ -1,18 +1,19 @@
|
|
|
<!-- 随手拍-添加 -->
|
|
|
<template>
|
|
|
<view class="examine">
|
|
|
+ <view class="header" @click="handleClick('manage')">
|
|
|
+ <text>随手拍管理</text>
|
|
|
+ <img src="@/pages_safetyExamine/images/icon_04.png">
|
|
|
+ </view>
|
|
|
<scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
|
|
|
- <view class="header" @click="handleClick('manage')">
|
|
|
- <text>随手拍管理</text>
|
|
|
- <img src="@/images/Version3.3.3/icon_04.png">
|
|
|
- </view>
|
|
|
+
|
|
|
<view class="basics">
|
|
|
<view class="basics_li">
|
|
|
<view class="basics_li_l">学院</view>
|
|
|
<picker @change="collegeChange" :value="collegeIndex" :range="collegeArray" class="scope_r">
|
|
|
<view class="basics_li_r college_r">
|
|
|
<view>{{form.deptName?form.deptName:'选择学院'}}</view>
|
|
|
- <img src="@/images/Version3.3.3/icon_06.png">
|
|
|
+ <img src="@/pages_safetyExamine/images/icon_06.png">
|
|
|
</view>
|
|
|
</picker>
|
|
|
</view>
|
|
@@ -21,7 +22,7 @@
|
|
|
<view class="basics_li_r lab_r">
|
|
|
<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">
|
|
|
+ <img src="@/pages_safetyExamine/images/icon_aqjc_sm.png">
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -48,7 +49,7 @@
|
|
|
<view class="popup-big-box">
|
|
|
<view class="popup-input-box">
|
|
|
<input type="text" maxlength="10" v-model="room" placeholder="请输入房间号">
|
|
|
- <view @click="getSelectInfoByRoom">搜索</view>
|
|
|
+ <view @click="buildBySub">搜索</view>
|
|
|
</view>
|
|
|
<view class="popup-for-max-box">
|
|
|
<view class="popup-for-null" v-if="!roomList[0]">暂无数据</view>
|
|
@@ -66,7 +67,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { config } from '@/api/request/config.js'
|
|
|
-import { getSelectInfoByRoom,conditionCollegeInfo,checkClapAdd,subjectList} from '@/api/index.js'
|
|
|
+import { buildBySub,conditionCollegeInfo,checkClapAdd,subjectList,getUserCollegCheck,listDepartments} from '@/api/index.js'
|
|
|
export default {
|
|
|
name: "rectifyList",
|
|
|
components: {
|
|
@@ -117,7 +118,8 @@ export default {
|
|
|
|
|
|
},
|
|
|
mounted(){
|
|
|
- this.conditionCollegeInfo();
|
|
|
+ this.listDepartments();
|
|
|
+ this.getUserCollegCheck();
|
|
|
},
|
|
|
methods: {
|
|
|
//滚动事件
|
|
@@ -125,12 +127,12 @@ export default {
|
|
|
handleClick(doType){
|
|
|
let self=this;
|
|
|
if( doType=='manage'){//随手拍管理
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/pages_safetyExamine/snapshotManage/snapshotList?pageType=1'
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages_safetyExamine/snapshotManage/snapshotList?pageType=1'
|
|
|
});
|
|
|
}else if(doType=='self'){//随手拍上报记录
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/pages_safetyExamine/snapshotManage/snapshotList?pageType=2'
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages_safetyExamine/snapshotManage/snapshotList?pageType=2'
|
|
|
});
|
|
|
}else if(doType=='subBtn'){//提交
|
|
|
|
|
@@ -155,12 +157,12 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
wx.chooseImage({
|
|
|
- count: 1,
|
|
|
+ count: 5,
|
|
|
sizeType: ["original", "compressed"],
|
|
|
sourceType: ["album", "camera"],
|
|
|
success: function(res) {
|
|
|
- let tempFilePaths = res.tempFilePaths[0];
|
|
|
- self.uploadImg(tempFilePaths);
|
|
|
+ //let tempFilePaths = res.tempFilePaths[0];
|
|
|
+ self.uploadImg(res.tempFilePaths);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -170,34 +172,38 @@ export default {
|
|
|
title: '上传中',
|
|
|
mask: true
|
|
|
});
|
|
|
- uni.uploadFile({
|
|
|
- url: config.base_url+'/base/file/upload', //仅为示例,非真实的接口地址
|
|
|
- header:{'Authorization':uni.getStorageSync('token')},
|
|
|
- filePath: tempFilePaths,
|
|
|
- name: 'file',
|
|
|
- formData: {
|
|
|
- 'user': 'test'
|
|
|
- },
|
|
|
- success: (uploadFileRes) => {
|
|
|
- let res = JSON.parse(uploadFileRes.data);
|
|
|
- console.log(res.data)
|
|
|
- if(res.code == 200){
|
|
|
- this.form.imgDtoList.push({'fileUrl':res.data.url,'fileName':res.data.name});
|
|
|
- console.log(res.data.url)
|
|
|
- }else{
|
|
|
- uni.showToast({
|
|
|
- title: res.msg,
|
|
|
- icon:"none",
|
|
|
- mask:true,
|
|
|
- duration: 2000
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- fail: err => {},
|
|
|
- complete: () => {
|
|
|
- uni.hideLoading()
|
|
|
- }
|
|
|
- });
|
|
|
+ for(let i=0;i<tempFilePaths.length;i++){
|
|
|
+ console.log(tempFilePaths[i])
|
|
|
+ uni.uploadFile({
|
|
|
+ url: config.base_url+'/base/file/upload', //仅为示例,非真实的接口地址
|
|
|
+ header:{'Authorization':uni.getStorageSync('token')},
|
|
|
+ filePath: tempFilePaths[i],
|
|
|
+ name: 'file',
|
|
|
+ formData: {
|
|
|
+ 'user': 'test'
|
|
|
+ },
|
|
|
+ success: (uploadFileRes) => {
|
|
|
+ let res = JSON.parse(uploadFileRes.data);
|
|
|
+ console.log(res.data)
|
|
|
+ if(res.code == 200){
|
|
|
+ this.form.imgDtoList.push({'fileUrl':res.data.url,'fileName':res.data.name});
|
|
|
+ console.log(res.data.url)
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon:"none",
|
|
|
+ mask:true,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: err => {},
|
|
|
+ complete: () => {
|
|
|
+ uni.hideLoading()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
//删除图片
|
|
|
delImg(minIndex){
|
|
@@ -215,7 +221,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//搜索房间接口
|
|
|
- async getSelectInfoByRoom(){
|
|
|
+ async buildBySub(){
|
|
|
let self = this;
|
|
|
if(!this.room){
|
|
|
uni.showToast({
|
|
@@ -226,7 +232,7 @@ export default {
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- const {data} = await getSelectInfoByRoom(this.room);
|
|
|
+ const {data} = await buildBySub({'name':this.room,'deptId':this.form.deptId});
|
|
|
if(data.code==200){
|
|
|
if(data.data[0]){
|
|
|
this.roomList = data.data;
|
|
@@ -245,6 +251,12 @@ export default {
|
|
|
console.log(item)
|
|
|
this.$set(this.form,"subId",item.id)
|
|
|
this.$set(this.form,"subName",item.name)
|
|
|
+ this.$set(this.form,"deptId",item.deptId)
|
|
|
+ for(let i=0;i<this.collegeList.length;i++){
|
|
|
+ if(item.deptId==this.collegeList[i].deptId){
|
|
|
+ this.$set(this.form,"deptName",this.collegeList[i].deptName)
|
|
|
+ }
|
|
|
+ }
|
|
|
this.popupType = false;
|
|
|
},
|
|
|
//调用摄像头
|
|
@@ -261,7 +273,7 @@ export default {
|
|
|
if(codeRoom){
|
|
|
self.roomList = [];
|
|
|
self.room = codeRoom;
|
|
|
- self.getSelectInfoByRoom();
|
|
|
+ self.buildBySub();
|
|
|
self.popupType = true;
|
|
|
}else{
|
|
|
uni.showToast({
|
|
@@ -282,10 +294,20 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ //查询用户身份信息
|
|
|
+ async getUserCollegCheck(){
|
|
|
+ let _this = this;
|
|
|
+ const {data} = await getUserCollegCheck();
|
|
|
+ if(data.code == 200){
|
|
|
+ this.form.deptId=data.data.dept.deptId;
|
|
|
+ this.form.deptName=data.data.dept.deptName;
|
|
|
+ }
|
|
|
+ },
|
|
|
//查询学院列表
|
|
|
- async conditionCollegeInfo(){
|
|
|
+ async listDepartments(){
|
|
|
let _this = this;
|
|
|
- const {data} = await conditionCollegeInfo();
|
|
|
+ const {data} = await listDepartments();
|
|
|
if(data.code == 200){
|
|
|
|
|
|
for(let i=0;i<data.data.length;i++){
|
|
@@ -306,7 +328,7 @@ export default {
|
|
|
duration: 2000
|
|
|
});
|
|
|
uni.redirectTo({
|
|
|
- url: '/pages/pages_safetyExamine/snapshotManage/snapshotList?pageType=2'
|
|
|
+ url: '/pages_safetyExamine/snapshotManage/snapshotList?pageType=2'
|
|
|
});
|
|
|
|
|
|
}
|
|
@@ -422,7 +444,7 @@ export default {
|
|
|
>img{
|
|
|
width:30rpx;
|
|
|
height:28rpx;
|
|
|
- margin:16rpx 18rpx 0 0;
|
|
|
+ margin:26rpx 18rpx 0 0;
|
|
|
}
|
|
|
}
|
|
|
}
|