<template>
|
<view class="main_app">
|
<view class="main_wrap">
|
<!-- -->
|
<view class="line">
|
<view class="label">
|
<text>*</text>
|
<text>隐患区域</text>
|
</view>
|
<view class="value" @click="isShowArea = true">
|
<text class="mr6" :style="{ color: param.area ? '#000000' : '#999999' }">{{ param.area ? param.area : '请选择' }}</text>
|
<u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
|
</view>
|
</view>
|
<view class="line">
|
<view class="label">
|
<text>*</text>
|
<text>接受人</text>
|
</view>
|
<view class="value" @click="selMember">
|
<text class="mr6" :style="{ color: param.area ? '#000000' : '#999999' }">{{ param.area ? param.area : '请选择' }}</text>
|
<u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
|
</view>
|
</view>
|
<view class="empty"></view>
|
<view class="line">
|
<view class="label">
|
<text>*</text>
|
<text>隐患类型</text>
|
</view>
|
<view class="value">
|
<text class="mr6" :style="{ color: param.area ? '#000000' : '#999999' }">{{ param.area ? param.area : '请选择' }}</text>
|
<u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
|
</view>
|
</view>
|
<view class="upload_line">
|
<view class="name">现场情况</view>
|
<view class="adduser_list_item_ipt1_upload" @click="upload('imgurl')" v-if="!param.imgurlUrl"><u-icon name="plus" color="rgb(153, 153, 153)" size="28"></u-icon></view>
|
<view class="adduser_list_item_ipt1_upload" @click="upload('imgurl')" v-else><image :src="param.imgurlUrl" mode="widthFix"></image></view>
|
</view>
|
|
<view class="line">
|
<view class="label">
|
<text></text>
|
<text>提报人</text>
|
</view>
|
<view class="value"><input type="text" placeholder="请输入提报人" v-model="param.receptMemberName" @blur="getUser" placeholder-style="color: #999999;" /></view>
|
</view>
|
<view class="line">
|
<view class="label">
|
<text></text>
|
<text>联系电话</text>
|
</view>
|
<view class="value"><input type="text" placeholder="请输入联系电话" v-model="param.receptMemberName" @blur="getUser" placeholder-style="color: #999999;" /></view>
|
</view>
|
<view class="line">
|
<view class="label">
|
<text></text>
|
<text>提报时间</text>
|
</view>
|
<view class="value">
|
<text class="mr6" :style="{ color: param.area ? '#000000' : '#999999' }">{{ param.area ? param.area : '请选择' }}</text>
|
<u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
|
</view>
|
</view>
|
</view>
|
<!-- -->
|
<!-- 区域 -->
|
<u-picker keyName="name" :show="isShowArea" :columns="areaOptions" @confirm="seletedArea" @cancel="isShowArea = false"></u-picker>
|
</view>
|
</template>
|
|
<script>
|
import { uploadUrl } from '@/api'
|
export default {
|
data() {
|
return {
|
param: {},
|
isShowArea: false,
|
areaOptions: [[{ name: '111', id: 11 }, { name: '111', id: 11 }]]
|
};
|
},
|
methods: {
|
seletedArea(e) {
|
const item = e.value[0];
|
console.log(item);
|
this.isShowArea = false;
|
},
|
selMember() {
|
uni.navigateTo({
|
url: '/pages/staff/memberSel'
|
});
|
},
|
upload() {
|
uni.chooseImage({
|
success: (chooseImageRes) => {
|
uni.showLoading({ title: '上传中', mask: true });
|
for (let i = 0; i < chooseImageRes.tempFilePaths.length; i++) {
|
uni.uploadFile({
|
url: `${uploadUrl}visitsAdmin/cloudService/web/public/uploadFtp.do`,
|
filePath: chooseImageRes.tempFilePaths[i],
|
name: 'file',
|
formData: {
|
folderCode: 'MEMBER_IMG'
|
},
|
success: (uploadFileRes) => {
|
console.log('uploadFileRes', uploadFileRes);
|
let res = JSON.parse(uploadFileRes.data)
|
if (type === 'faceImg') {
|
this.param.faceImg = res.data.halfPath
|
this.param.faceImgUrl = res.data.prefixPath + res.data.folder + res.data.halfPath
|
} else {
|
this.param.imgurl = res.data.halfPath
|
this.param.imgurlUrl = res.data.prefixPath + res.data.folder + res.data.halfPath
|
}
|
},
|
complete() {
|
if (i === chooseImageRes.tempFilePaths.length - 1) {
|
uni.hideLoading();
|
}
|
}
|
});
|
}
|
}
|
});
|
},
|
getUser() {}
|
}
|
};
|
</script>
|
|
<style lang="scss">
|
.main_wrap {
|
.line {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
border-bottom: 1rpx solid #e5e5e5;
|
padding: 30rpx 0;
|
.label {
|
font-size: 30rpx;
|
font-weight: 400;
|
text {
|
&:nth-child(1) {
|
color: #e42d2d;
|
margin-right: 4rpx;
|
}
|
}
|
}
|
.value {
|
flex: 1;
|
height: 100%;
|
margin-left: 30rpx;
|
display: flex;
|
align-items: center;
|
justify-content: flex-end;
|
input {
|
width: 100%;
|
height: 100%;
|
text-align: right;
|
font-size: 28rpx;
|
font-weight: 400;
|
color: #222222;
|
}
|
}
|
}
|
.upload_line {
|
padding: 30rpx 0;
|
.adduser_list_item_ipt1_upload {
|
margin-top: 24rpx;
|
width: 120rpx;
|
height: 120rpx;
|
border: 2rpx solid #E5E5E5;
|
background: #f7f7f7;
|
color: #666666;
|
font-size: 22rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
overflow: hidden;
|
image {
|
width: 100%;
|
height: 100%;
|
}
|
}
|
}
|
}
|
.main_app {
|
// padding-top: 10rpx;
|
}
|
|
.empty {
|
width: 750rpx;
|
height: 20rpx;
|
background-color: #f7f7f7;
|
margin: 0 -30rpx;
|
}
|
</style>
|