Commit e2812ea3 by liuzhanxin

fix

parent a3c5e62c
...@@ -130,7 +130,7 @@ Vue.prototype.GLOBALUTIL = util; ...@@ -130,7 +130,7 @@ Vue.prototype.GLOBALUTIL = util;
button.primary { button.primary {
background-color: #0faeff; background-color: #0faeff;
} }
scroll-view ::-webkit-scrollbar { ::-webkit-scrollbar {
  display: none background-color: #0faeff;
} }
</style> </style>
var url = "http://47.94.204.226"; var url = "http://47.94.204.226";
var token = "";
var addressSelectionTemp = []; var addressSelectionTemp = [];
var user = {}; var user = {};
var sysInfo = {}; var sysInfo = {};
...@@ -8,5 +9,6 @@ export default{ ...@@ -8,5 +9,6 @@ export default{
addressSelectionTemp, addressSelectionTemp,
user, user,
sysInfo, sysInfo,
moment moment,
token
} }
\ No newline at end of file
<template>
<view class="a_mask">
<form class="a_box" @submit="formSubmit" @reset="formReset">
<view class="a_head">
{{title}}
</view>
<view class="a_input">
<input :type="type" :value="value" :placeholder="placeholder" :name="name"/>
</view>
<view class="a_btn">
<button form-type="reset" :style="{color:cancelColor}">{{cancelText}}</button>
<button form-type="submit" :style="{color:confirmColor}">{{confirmText}}</button>
</view>
</form>
</view>
</template>
<script>
export default {
props:{
title:{
type:String,
default:'提示'
},
placeholder:{
type:String,
default:'请点击输入'
},
name:{
type:String,
default:'text'
},
type:{
type:String,
default:'text'
},
value:{
type:String,
default:''
},
cancelColor:{
type:String,
default:'#999999'
},
confirmColor:{
type:String,
default:'#333333'
},
cancelText:{
type:String,
default:'取消'
},
confirmText:{
type:String,
default:'确定'
},
},
data() {
return {
};
},
methods: {
formSubmit: function(e) {
console.log(e)
let _formdata = e.detail.value
this.$emit('confirm',_formdata)
},
formReset: function(e) {
this.$emit('cancel')
}
}
}
</script>
<style lang="scss">
.a_mask{
position: fixed;
z-index: 99999;
background-color: rgba(0,0,0,0.5);
top: 0;
left: 0;
bottom: 0;
right: 0;
.a_box{
width: 500upx;
overflow: hidden;
background-color: #fff;
border-radius: 10upx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
.a_head{
text-align: center;
font-size: 30upx;
line-height: 88upx;
}
.a_input{
padding: 30upx 20upx;
font-size: 28upx;
input{
text-align: center;
}
}
.a_btn{
text-align: center;
font-size: 30upx;
line-height: 88upx;
display: flex;
justify-content: space-between;
border-top: 1upx solid #f5f5f5;
button{
width: 50%;
background-color: #fff;
font-size: 30upx;
border-radius: 0upx;
padding: 0;
&::after{
border:none
}
&:first-child{
border-right: 1upx solid #f5f5f5;
color: #999999;
box-sizing: border-box;
}
&:last-child{
color: #333;
}
}
}
}
}
</style>
<template>
<view class="">
<view class="mask">
<view hover-class="hover" @click="goBack" style="position:absolute;left:15px;top:60px;display: flex;flex-direction: row;">
<image class="goback" src="../../static/common/back.png"/>
</view>
<view hover-class="hover" @click="showAction" style="position:absolute;right:15px;top:60px;display: flex;flex-direction: row;">
<view class="dots"></view>
<view class="dots"></view>
<view class="dots"></view>
</view>
<swiper @change="changeSwiper" class="my_swiper" :current="current" :circular="circular" :indicator-dots="indicatorDots" :autoplay="autoplay" :duration="duration">
<swiper-item v-for="(x, y) in picList" :key="y">
<view class="bg_img" :style="{ backgroundImage: 'url('+x+')'}">
</view>
</swiper-item>
</swiper>
</view>
<view class="page" v-if="picList.length>0">{{ current + 1 }} / {{ picList.length }}</view>
<ActionSheet :show="showActionSheet" :tips="tips" :item-list="actionList" :mask-closable="maskClosable"
:color="color" :size="size" :is-cancel="isCancel" @click="itemClick" @cancel="closeActionSheet"></ActionSheet>
</view>
</template>
<script>
import ActionSheet from "../actionsheet/actionsheet.vue"
export default {
data() {
return {
picList: [],
indicatorDots: true,
autoplay: false,
duration: 500,
circular: true,
current: 0,
isShowSwiper: false,
showActionSheet: false,
maskClosable: true,
tips: "请选择",
color: "#9a9a9a",
size: 26,
isCancel: true,
actionList: [{text:"删除照片"}],
};
},
onLoad() {
var that = this;
uni.$on('previewPhoto',function(data){
that.picList= data[0];
that.current= data[1];
})
},
onUnload(){
uni.$off('previewPhoto',function(data){
})
},
methods: {
clickPic(index) {
this.current = index;
this.isShowSwiper = true;
},
showAction(){
this.showActionSheet = true;
},
closeActionSheet: function() {
this.showActionSheet = false
},
goBack(){
uni.navigateBack({
})
},
changeSwiper(e) {
this.current = e.target.current;
},
itemClick(){
this.picList.splice(this.current,1);
uni.navigateBack({
})
uni.$emit("securitySubmitPicChange",[this.picList])
},
},
components: {
ActionSheet,
},
};
</script>
<style lang="scss" scoped>
.page {
position: fixed;
z-index: 6;
color: #fff;
bottom: 20rpx;
text-align: center;
width: 100%;
}
.mask {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: #000;
z-index: 5;
> .my_swiper {
width: 100%;
height: 60vh;
.bg_img {
background-size: 100% auto;
background-repeat: no-repeat;
background-position:center;
width: 100%;
height: 100%;
display: flex;
justify-content: flex-end;
align-items: flex-start;
}
}
}
.pic_list {
display: flex;
flex-flow: row wrap;
> view {
flex: 0 0 33.3vw;
height: 33.3vw;
padding: 1vw;
> image {
width: 100%;
height: 100%;
}
}
}
.dots {
width:7px;
height:7px;
background-color: #FFFFFF;
border-radius: 7px;
margin-right: 4px;
}
.goback{
width:45rpx;
height: 45rpx;
}
.hover {
opacity: 0.7;
}
</style>
...@@ -7,4 +7,5 @@ page { ...@@ -7,4 +7,5 @@ page {
height: auto; /* 不可固定高度,否则overflow: hidden, 可通过设置最小高度使列表不满屏仍可下拉*/ height: auto; /* 不可固定高度,否则overflow: hidden, 可通过设置最小高度使列表不满屏仍可下拉*/
overflow: hidden; /* 遮住顶部下拉刷新区域 */ overflow: hidden; /* 遮住顶部下拉刷新区域 */
box-sizing: border-box; /* 避免设置padding出现双滚动条的问题 */ box-sizing: border-box; /* 避免设置padding出现双滚动条的问题 */
width: 100%;
} }
\ No newline at end of file
...@@ -279,7 +279,4 @@ ...@@ -279,7 +279,4 @@
@import "./mescroll-body.css"; @import "./mescroll-body.css";
@import "./components/mescroll-down.css"; @import "./components/mescroll-down.css";
@import './components/mescroll-up.css'; @import './components/mescroll-up.css';
.mescroll-body-content{
width: 100%;
}
</style> </style>
<!--
*属性 isdistance 每个弹窗之间是否有间距
*数组形式传值
*type,类型 success warn info err loading(string)
*content,内容(string)
*timeout,消失时间(Number)
*isClick,是否点击消失(Boolean)
-->
<template>
<view class="popup_list">
<view v-for="(items,index) of popup_list" :id="items.uuid" :key="items.uuid" >
<view class="mpopup" :style="{ background: items.color ,bottom:index*distance+45+'px'}" :class="[items.animator,items.typeClass]" @click="close(items.uuid,index)">
<view class="pic"><image class="icon" mode="aspectFit" :src="items.icon"></image></view>
<text class="text" :style="{ color: items.colortext }">{{ items.content }}</text>
</view>
</view>
</view>
</template>
<script>
export default{
data(){
return{
popup_list:[],//弹窗数组
distance:65//每个弹窗之间间距
}
},
props:{
//是否有间距
isdistance:{
type:Boolean,
default:true
},
},
methods:{
init:function(list){
if (list.type == 'success') {
list.icon = '../../static/xuan-popup/success.png';
list.typeClass='mpopup-success';
return list;
}
if (list.type == 'warn') {
list.icon = '../../static/xuan-popup/warn.png';
list.typeClass='mpopup-warn';
return list;
}
if (list.type == 'info') {
list.icon = '../../static/xuan-popup/info.png';
list.typeClass='mpopup-info';
return list;
}
if (list.type == 'err') {
list.icon = '../../static/xuan-popup/err.png';
list.typeClass='mpopup-err';
return list;
}
if (list.type == 'loading') {
list.icon = '../../static/xuan-popup/loading.png';
list.typeClass='mpopup-loading';
return list;
}
},
open:function(list){
if(!this.isdistance){this.distance=0}
//生成uuid
let uuid=this.guid();
list.uuid=uuid;
//添加动画
list.animator='fade_Down';
//判断是否可点击消失/可控制消失
if(typeof(list.isClick)!='boolean'){list.isClick=false;}
//if(typeof(list.isControl)!='boolean'){list.isControl=false;}
//初始化
let new_list=this.init(list);
//添加进数组
this.popup_list.push(new_list);
if(!new_list.isClick){
this.disappear(new_list.uuid,new_list.timeout);
}//可点击消失
else{
this.$emit('uuidCallback',new_list.uuid);
}
// else if(new_list.isControl){
// this.$emit('Callback',new_list.uuid);
// }
},
//自动消失
disappear:function(uuid,timeout){
//退出动画之后,短暂延迟后移除本元素
this.fade_out_animator(uuid,timeout).then(res=>{
setTimeout(()=>{
for(let i=0;i<this.popup_list.length;i++){
if(this.popup_list[i].uuid==res){
//移除本元素
this.popup_list.splice(i,1);
this.$forceUpdate()
}
}
},250)
});
},
fade_out_animator:function(uuid,timeout){
//timeout秒后退出
if(!timeout||typeof(timeout)!='number'){timeout=3000;}
return new Promise(res=>{
setTimeout(()=>{
for(let i=0;i<this.popup_list.length;i++){
if(this.popup_list[i].uuid==uuid){
//添加退出动画
this.popup_list[i].animator='fade_Top';
res(uuid);
}
}
},timeout)
})
},
//可控制关闭的弹出框
close:function(uuid,ind){
if(ind){
if(!this.popup_list[ind].isClick){return}
}
this.remove_element(uuid).then((res)=>{
setTimeout(()=>{
for(let i=0;i<this.popup_list.length;i++){
if(this.popup_list[i].uuid==res){
//移除本元素
this.popup_list.splice(i,1);
this.$emit('closeCallback',uuid);
this.$forceUpdate()
}
}
},250)
})
},
//控制移除元素
remove_element:function(uuid){
return new Promise(res=>{
for (var i = 0; i < this.popup_list.length; i++) {
if(this.popup_list[i].uuid==uuid){
this.popup_list[i].animator='fade_Top';
res(uuid)
break;
}
}
})
},
//更新
update:function(update_list){
for (var i = 0; i < this.popup_list.length; i++) {
if(this.popup_list[i].uuid==update_list.uuid){
this.popup_list[i].type=update_list.type;
this.init(this.popup_list[i]);
this.popup_list[i].content=update_list.content;
break;
}
}
},
//生成uuid
guid:function() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
return v.toString(16);
});
}
}
}
</script>
<style lang="scss">
.mpopup{
display: flex;
flex-direction: row;
text-align: center;
justify-content: center;
align-items: center;
min-height: 45px;
width: 550rpx;
transition :all .5s;
position: fixed;
left: 0;
right: 0;
margin: 0 auto;
border-radius: 5px;
z-index:998;
.pic{
display: flex;
text-align: center;
justify-content: center;
width: 15px;
height: 15px;
margin: auto 20px auto 0;
.icon{
width: 100%;
height: auto;
}
}
.text{
margin: auto 20px auto 0;
width: 65%;
font-size: 16px;
}
}
.mpopup-success{
background: #f0f9eb;
border: 1px solid #e1f3d8;
color: #67c23a;
}
.mpopup-err{
background: #fef0f0;
border: 1px solid #fde2e2;
color: #f56c6c;
}
.mpopup-warn{
background: #fdf6ec;
border: 1px solid #faecd8;
color: #e6a23c;
}
.mpopup-info{
background: #edf2fc;
border: 1px solid #ebeef5;
color: #909399;
}
.mpopup-loading{
background: #e2f5ff;
border: 1px solid #ceeeff;
color: #5cbaff;
image{
animation: rotate360 1.5s ease infinite;
}
}
.fade_Down{
animation: fadeInDown 0.6s both;
}
.fade_Top{
animation: fadeInTop 0.5s forwards;
}
/*从上到下*/
@keyframes fadeInDown
{
from {
opacity:0;
-webkit-transform: translate(0,10px);
transform: stranslate(0,10px);
}
to{
opacity: 1;
-webkit-transform: translate(0,-100px);
transform: stranslate(0,-100px);
}
}
/*从下到上*/
@keyframes fadeInTop
{
from {
opacity:1;
-webkit-transform: translate(0,10px);
transform: stranslate(0,10px);
}
to {
opacity: 0;
-webkit-transform: translate(0,-100px);
transform: stranslate(0,-100px);
}
}
@keyframes rotate360
{
from {
transform: rotate(0);
}
to{
transform: rotate(360deg);
}
}
</style>
import Vue from 'vue' import Vue from 'vue'
import App from './App' import App from './App'
import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue" // import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue" // import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue"
Vue.component('mescroll-body', MescrollBody) import FormAlert from "@/components/form-alert/h-form-alert.vue"
Vue.component('mescroll-uni', MescrollUni) import PopUp from "@/components/popup/popup.vue"
// Vue.component('mescroll-body', MescrollBody)
// Vue.component('mescroll-uni', MescrollUni)
Vue.component('form-alert', FormAlert)
Vue.component('PopUp', PopUp)
Vue.config.productionTip = false Vue.config.productionTip = false
App.mpType = 'app' App.mpType = 'app'
......
...@@ -7,6 +7,12 @@ ...@@ -7,6 +7,12 @@
} }
}, },
{ {
"path": "pages/user/user",
"style": {
"navigationBarTitleText": "我的"
}
},
{
"path": "pages/login/index", "path": "pages/login/index",
"style": { "style": {
"navigationBarTitleText": "登录" "navigationBarTitleText": "登录"
...@@ -45,7 +51,8 @@ ...@@ -45,7 +51,8 @@
"buttons" : [ "buttons" : [
{ {
"text" : "查看危险源", "text" : "查看危险源",
"fontSize" : "14" "fontSize" : "14",
"width":"100"
} }
] ]
} }
...@@ -106,6 +113,12 @@ ...@@ -106,6 +113,12 @@
} }
} }
},
{
"path": "components/image-preview/image-preview",
"style": {
"navigationStyle": "custom"
}
} }
], ],
"tabBar": { "tabBar": {
......
...@@ -4,8 +4,14 @@ ...@@ -4,8 +4,14 @@
<view class="detailtext"><text class="titletext">位置</text><text class="contenttext">{{roomName}}</text></view> <view class="detailtext"><text class="titletext">位置</text><text class="contenttext">{{roomName}}</text></view>
<view class="detailtext"><text class="titletext">实验室</text><text class="contenttext">{{roomName}}</text></view> <view class="detailtext"><text class="titletext">实验室</text><text class="contenttext">{{roomName}}</text></view>
<view class="detailtext"><text class="titletextlong">整改项照片</text></view> <view class="detailtext"><text class="titletextlong">整改项照片</text></view>
<view class="detailtext"><text class="remind">未上传整改项照片</text></view> <view v-if="imgUrl.length==0" class="detailtext"><text class="remind">未上传整改项照片</text></view>
<image v-if="imgUrl.length>0" class="pic" src="../../static/common/camera.png"> <view style="width: 100%;display: flex;align-items: flex-start; justify-content: flex-start;margin-top: 30rpx;flex-direction: row;">
<view style="margin-right: 30rpx;" v-for="(item,index) in imgUrl" :key="index">
<button class="camera-button">
<image mod="scaleToFill" class="camera-button" :src="item" />
</button>
</view>
</view>
</view> </view>
</template> </template>
...@@ -13,7 +19,7 @@ ...@@ -13,7 +19,7 @@
export default { export default {
data() { data() {
return { return {
imgUrl:"", imgUrl:[],
roomName:"", roomName:"",
description:"", description:"",
detailData:{} detailData:{}
...@@ -21,18 +27,18 @@ ...@@ -21,18 +27,18 @@
}, },
methods: { methods: {
onLoad() { onLoad() {
console.log("onllllllllllllllload")
var that = this var that = this
uni.$on('rectificationListData',function(data){ uni.$on('rectificationListData',function(data){
console.log("@@@@@@@@@@@@@@@"+JSON.stringify(data))
var detailData = data[0] var detailData = data[0]
that.roomName = JSON.parse(detailData.room).name that.roomName = JSON.parse(detailData.room).name
that.description = detailData.description; that.description = detailData.description;
that.detailData = detailData; that.detailData = detailData;
that.imgUrl = JSON.parse(detailData.images)
that.$forceUpdate(); that.$forceUpdate();
}) })
}, },
onUnload(){ onUnload(){
console.log("onunnnnnnnnnnnnnnload")
uni.$off('rectificationListData',function(data){ uni.$off('rectificationListData',function(data){
}) })
...@@ -47,7 +53,7 @@ ...@@ -47,7 +53,7 @@
}, },
onNavigationBarButtonTap(){ onNavigationBarButtonTap(){
uni.navigateTo({ uni.navigateTo({
url:"../Security-Check/index" url:"../Security-Check/index?mod=put"
}) })
uni.$emit("rectificationEdit",[this.detailData]) uni.$emit("rectificationEdit",[this.detailData])
}, },
...@@ -108,4 +114,13 @@ ...@@ -108,4 +114,13 @@
flex-direction: row; flex-direction: row;
margin-top: 20rpx; margin-top: 20rpx;
} }
.camera-button {
display:flex;
flex-direction: row;
align-items: center;
justify-content: center;
width:200rpx;
height: 200rpx;
padding: 0;
}
</style> </style>
<template> <template>
<mescroll-body class="containter" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback" @up="upCallback"> <Mescroll style="background-color: #F5F5F5;" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback" @up="upCallback">
<view class="news-li" v-for="news in dataList" :key="news.id" hover-class="hover" @click="goDetail(news)"> <view class="news-li" v-for="news in dataList" :key="news.id" hover-class="hover" @click="goDetail(news)">
<view style="width: auto;background-color: #FFFFFF;">
<image class="statuspic" :src="news.imgsrc"> <image class="statuspic" :src="news.imgsrc">
<view class="top-container" > <view class="top-container" >
<text class="title">{{news.description}}</text> <text class="title">{{news.description}}</text>
<view class="detailtext"><text class="titletext">实验室</text><text class="contenttext">{{JSON.parse(news.check_scope).name}}</text></view> <view class="detailtext"><text class="titletext">实验室</text><text class="contenttext">{{JSON.parse(news.check_scope).name}}</text></view>
<view class="detailtext"><text class="titletext">负责人</text><text class="contenttext">{{JSON.parse(news.manager).name}}</text></view> <view class="detailtext"><text class="titletext">负责人</text><text class="contenttext">{{news.manager?JSON.parse(news.manager).name:""}}</text></view>
<view class="detailtext"><text class="titletext">创建人</text><text class="contenttext">{{JSON.parse(news.creator).name}}</text></view> <view class="detailtext"><text class="titletext">创建人</text><text class="contenttext">{{news.creator?JSON.parse(news.creator).name:""}}</text></view>
<view class="detailtext"><text class="titletextlong">创建时间</text><text class="contenttext">{{GLOBALUTIL.moment(news.created).format("YYYY-MM-DD HH:mm:ss")}}</text></view> <view class="detailtext"><text class="titletextlong">创建时间</text><text class="contenttext">{{news.createTime}}</text></view>
<view class="detailtext"><text class="titletextlong">检查任务</text><text class="contenttext">{{news.check_task_code_name}}</text></view> <view class="detailtext"><text class="titletextlong">检查任务</text><text class="contenttext">{{news.check_task_code_name?news.check_task_code_name:""}}</text></view>
</view>
</view> </view>
</view> </view>
<Drawer mode="left" :visible="showDrawer" @close="closeDrawer"> <Drawer mode="left" :visible="showDrawer" @close="closeDrawer">
...@@ -19,35 +21,35 @@ ...@@ -19,35 +21,35 @@
</view> </view>
<text style="font-size: 24px; line-height:33px;margin-top: 50px;">过滤条件</text> <text style="font-size: 24px; line-height:33px;margin-top: 50px;">过滤条件</text>
<view class="item" hover-class="hover" @click="showStatusPicker"> <view class="item" hover-class="hover" @click="showStatusPicker">
<text class="title" style="margin-top: 30rpx;">状态</text> <text class="title" style="margin-top: 30upx;">状态</text>
<view class="selcontent"> <view class="selcontent">
<text class="datacontent">{{curStatus.name}}</text> <text class="datacontent">{{curStatus.name}}</text>
<image class="tip" src="../../static/common/arrow_right_gray.png"> <image class="tip" src="../../static/common/arrow_right_gray.png">
</view> </view>
</view> </view>
<view class="item" hover-class="hover" @click="showTaskPicker"> <view class="item" hover-class="hover" @click="showTaskPicker">
<text class="title" style="margin-top: 30rpx;">检查任务</text> <text class="title" style="margin-top: 30upx;">检查任务</text>
<view class="selcontent"> <view class="selcontent">
<text class="datacontent">{{curTask.name}}</text> <text class="datacontent">{{curTask.name}}</text>
<image class="tip" src="../../static/common/arrow_right_gray.png"> <image class="tip" src="../../static/common/arrow_right_gray.png">
</view> </view>
</view> </view>
<view class="item" hover-class="hover" @click="showLabPicker"> <view class="item" hover-class="hover" @click="showLabPicker">
<text class="title" style="margin-top: 30rpx;">实验室</text> <text class="title" style="margin-top: 30upx;">实验室</text>
<view class="selcontent"> <view class="selcontent">
<text class="datacontent">{{curLab.name}}</text> <text class="datacontent">{{curLab.name}}</text>
<image class="tip" src="../../static/common/arrow_right_gray.png"> <image class="tip" src="../../static/common/arrow_right_gray.png">
</view> </view>
</view> </view>
<view class="datetime" hover-class="hover" @click="showStartTimePicker"> <view class="datetime" hover-class="hover" @click="showStartTimePicker">
<text class="title" style="margin-left: 15rpx;" >开始日期</text> <text class="title" style="margin-left: 15upx;" >开始日期</text>
<view class="selcontent-time"> <view class="selcontent-time">
<text class="datacontent">{{startTime!=""?startTime:"请选择开始时间"}}</text> <text class="datacontent">{{startTime!=""?startTime:"请选择开始时间"}}</text>
<image class="tip" src="../../static/common/arrow_right_gray.png"> <image class="tip" src="../../static/common/arrow_right_gray.png">
</view> </view>
</view> </view>
<view class="datetime" hover-class="hover" @click="showEndTimePicker"> <view class="datetime" hover-class="hover" @click="showEndTimePicker">
<text class="title" style="margin-left: 15rpx;">结束日期</text> <text class="title" style="margin-left: 15upx;">结束日期</text>
<view class="selcontent-time"> <view class="selcontent-time">
<text class="datacontent">{{endTime !=""?endTime:"请选择开始时间"}}</text> <text class="datacontent">{{endTime !=""?endTime:"请选择开始时间"}}</text>
<image class="tip" src="../../static/common/arrow_right_gray.png"> <image class="tip" src="../../static/common/arrow_right_gray.png">
...@@ -65,19 +67,27 @@ ...@@ -65,19 +67,27 @@
</view> </view>
</Drawer> </Drawer>
<Picker <Picker
mode="selector" :mode="pickerMod"
@confirm="onConfirm" @confirm="onConfirm"
ref="picker" ref="picker"
themeColor="#f00" themeColor="#f00"
:selectList="itemList" :selectList="itemList"
></Picker> ></Picker>
</mescroll-body> </Mescroll>
</template> </template>
<script> <script>
import Mescroll from "../../components/mescroll-uni/mescroll-body.vue"
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import Drawer from '@/components/uni-drawer/uni-drawer.vue' import Drawer from '@/components/uni-drawer/uni-drawer.vue'
import Picker from "@/components/w-picker/w-picker.vue"; import Picker from "@/components/w-picker/w-picker.vue";
const sortFunction = (x,y)=>{
if(x.created > y.created){
return -1;
}else {
return 1;
}
}
export default { export default {
mixins: [MescrollMixin], mixins: [MescrollMixin],
data() { data() {
...@@ -87,7 +97,7 @@ ...@@ -87,7 +97,7 @@
}, },
dataList: [], dataList: [],
upOption: { upOption: {
use: false, // 是否启用上拉加载; 默认true use: false,
}, },
showDrawer:false, showDrawer:false,
drawer:{status:"fckkk"}, drawer:{status:"fckkk"},
...@@ -97,7 +107,7 @@ ...@@ -97,7 +107,7 @@
labData:[], labData:[],
taskData:[], taskData:[],
filterBody:"", filterBody:"",
pickerMod:"linkage", pickerMod:"selector",
curTask:{}, curTask:{},
curStatus:{}, curStatus:{},
curLab:{}, curLab:{},
...@@ -108,7 +118,8 @@ ...@@ -108,7 +118,8 @@
components: { components: {
Drawer, Drawer,
Picker Picker,
Mescroll
}, },
methods: { methods: {
closeDrawer(){ closeDrawer(){
...@@ -150,8 +161,10 @@ ...@@ -150,8 +161,10 @@
success: (res) => { success: (res) => {
var data = res.data.data; var data = res.data.data;
data.map((opt)=>{ data.map((opt)=>{
opt.createTime = this.GLOBALUTIL.moment(opt.created).format("YYYY-MM-DD HH:mm:ss")
opt.imgsrc = this.handleStatus(opt) opt.imgsrc = this.handleStatus(opt)
}) })
data.sort(sortFunction);
this.dataList = data; this.dataList = data;
// console.log(JSON.stringify(data)) // console.log(JSON.stringify(data))
} }
...@@ -183,19 +196,19 @@ ...@@ -183,19 +196,19 @@
}, },
showStatusPicker(){ showStatusPicker(){
this.curType = "status" this.curType = "status"
this.pickerMod = "linkage"; this.pickerMod = "selector";
this.itemList = this.statusData; this.itemList = this.statusData;
this.$refs.picker.show() this.$refs.picker.show()
}, },
showTaskPicker(){ showTaskPicker(){
this.curType = "task" this.curType = "task"
this.pickerMod = "linkage"; this.pickerMod = "selector";
this.itemList = this.taskData; this.itemList = this.taskData;
this.$refs.picker.show() this.$refs.picker.show()
}, },
showLabPicker(){ showLabPicker(){
this.curType = "lab" this.curType = "lab"
this.pickerMod = "linkage"; this.pickerMod = "selector";
this.itemList = this.labData; this.itemList = this.labData;
this.$refs.picker.show() this.$refs.picker.show()
}, },
...@@ -241,6 +254,7 @@ ...@@ -241,6 +254,7 @@
body:null, body:null,
success: (res) => { success: (res) => {
var data = res.data.data; var data = res.data.data;
console.log(data.length)
var itemList = data.map((opt)=>{ var itemList = data.map((opt)=>{
return {label:opt.name,value:opt.id}; return {label:opt.name,value:opt.id};
}) })
...@@ -305,13 +319,13 @@ ...@@ -305,13 +319,13 @@
} }
/*展示上拉加载的数据列表*/ /*展示上拉加载的数据列表*/
.news-li{ .news-li{
widht:auto;
font-size: 32upx; font-size: 32upx;
border-bottom: 1upx solid #eee; padding-top: 20upx;
width: auto; padding-left: 20upx;
display: flex; padding-right: 20upx;
flex-direction: column; padding-bottom: 0upx;
background-color: #FFFFFF; background-color: #F5F5F5;
margin-top:20rpx;
} }
.news-li .new-content{ .news-li .new-content{
font-size: 28upx; font-size: 28upx;
...@@ -320,27 +334,27 @@ ...@@ -320,27 +334,27 @@
color: #666; color: #666;
} }
.icon { .icon {
width:20rpx; width:20upx;
height:20rpx; height:20upx;
margin-right: 20rpx; margin-right: 20upx;
} }
.top-container { .top-container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100%; width: auto;
padding-left: 50rpx; padding-left: 50upx;
margin-top: -35rpx; margin-top: -35upx;
margin-bottom: 20rpx; padding-bottom: 30upx;
} }
.status { .status {
width:170rpx; width:170upx;
height:35rpx; height:35upx;
background-color: rgba(242,115,115,0.10); background-color: rgba(242,115,115,0.10);
border-radius: 50rpx; border-radius: 50upx;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin-left: 35rpx; margin-left: 35upx;
} }
.status-text{ .status-text{
color: #F27373; color: #F27373;
...@@ -364,28 +378,22 @@ ...@@ -364,28 +378,22 @@
.type { .type {
font-size:14px; font-size:14px;
} }
.containter{
display: flex;
width: 100%;
background-color: #F5F5F5;
padding: 20rpx;
}
.statuspic{ .statuspic{
width:80rpx; width:80upx;
height:80rpx; height:80upx;
} }
.titletext{ .titletext{
font-size:28rpx; font-size:28upx;
color: #666666; color: #666666;
margin-right: 78rpx; margin-right: 78upx;
} }
.titletextlong{ .titletextlong{
font-size:28rpx; font-size:28upx;
color: #666666; color: #666666;
margin-right: 50rpx; margin-right: 50upx;
} }
.contenttext{ .contenttext{
font-size:28rpx; font-size:28upx;
color: #333333; color: #333333;
}, },
.selcontent { .selcontent {
...@@ -400,12 +408,12 @@ ...@@ -400,12 +408,12 @@
align-items: center; align-items: center;
} }
.item { .item {
border-bottom: 1rpx solid #D0D0D0; border-bottom: 1upx solid #D0D0D0;
width: auto; width: auto;
margin-top: 20rpx; margin-top: 20upx;
margin-left: 20rpx; margin-left: 20upx;
margin-right: 40rpx; margin-right: 40upx;
padding-bottom: 10rpx; padding-bottom: 10upx;
} }
.datacontent { .datacontent {
width: 100%; width: 100%;
...@@ -416,20 +424,20 @@ ...@@ -416,20 +424,20 @@
opacity: 0.7; opacity: 0.7;
} }
.tip { .tip {
width: 30rpx; width: 30upx;
height:30rpx height:30upx
} }
.submit-button { .submit-button {
display: flex; display: flex;
width:500rpx; width:500upx;
height:60rpx; height:60upx;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background: linear-gradient(-45deg, rgba(87, 225, 181, 1) 0%, rgba(0, 63, 255, 1) 100%); background: linear-gradient(-45deg, rgba(87, 225, 181, 1) 0%, rgba(0, 63, 255, 1) 100%);
border-radius: 15rpx; border-radius: 15upx;
margin-left: 0; margin-left: 0;
margin-right: 0; margin-right: 0;
margin-bottom: 40rpx; margin-bottom: 40upx;
} }
.submittext { .submittext {
font-size: 14px; font-size: 14px;
...@@ -450,4 +458,7 @@ ...@@ -450,4 +458,7 @@
align-items: center; align-items: center;
margin-top:20px; margin-top:20px;
} }
.detailtext{
padding-right: 20px;
}
</style> </style>
...@@ -8,22 +8,28 @@ ...@@ -8,22 +8,28 @@
</view> </view>
<text class="title" style="margin-top: 30rpx;">整改项详情</text> <text class="title" style="margin-top: 30rpx;">整改项详情</text>
<view style="width: 100%;"> <view style="width: 100%;">
<textarea class="detail" @blur="changeTextValue" /> <textarea class="detail" :value="description" @blur="changeTextValue" />
</view> </view>
<text class="title" style="margin-top: 30rpx;">整改项照片</text> <text class="title" style="margin-top: 30rpx;">整改项照片</text>
<view style="width: 100%;display: flex;align-items: flex-start; justify-content: flex-start;margin-top: 30rpx;"> <view style="width: 100%;display: flex;align-items: flex-start; justify-content: flex-start;margin-top: 30rpx;">
<view> <view style="margin-right: 30rpx;" v-for="(item,index) in images" :key="index">
<button @click="onPhotoClick(index)" class="camera-button">
<image mod="scaleToFill" class="camera-button" :src="item" />
</button>
</view>
<view class="photo">
<button @click="onclick" class="camera-button"> <button @click="onclick" class="camera-button">
<image class="camera" src="../../static/common/camera.png"> <image class="camera" src="../../static/common/camera.png">
</button> </button>
</view> </view>
</view> </view>
<button hover-class="submithover" @click="onSubmitClick" class="submit-button"> <button hover-class="submithover" @click="showModal" class="submit-button">
<text class="submittext" >提交</text> <text class="submittext" >提交</text>
</button> </button>
<ActionSheet :show="showActionSheet" :tips="tips" :item-list="itemList" :mask-closable="maskClosable" <ActionSheet :show="showActionSheet" :tips="tips" :item-list="itemList" :mask-closable="maskClosable"
:color="color" :size="size" :is-cancel="isCancel" @click="itemClick" @cancel="closeActionSheet"></ActionSheet> :color="color" :size="size" :is-cancel="isCancel" @click="itemClick" @cancel="closeActionSheet"></ActionSheet>
<form-alert v-if="submitShow" name="检查对象" placeholder="确定提交所填的数据?" @confirm="onSubmitClick" @cancel="cancel"></form-alert>
<PopUp ref="popup" :isdistance="true"></PopUp>
</view> </view>
</template> </template>
...@@ -48,11 +54,17 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue" ...@@ -48,11 +54,17 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
room:{}, room:{},
description:"", description:"",
address:"", address:"",
addressType:"" addressType:"",
submitMethod:"POST",
baseBody:{},
submitShow:false,
} }
}, },
onLoad() { onLoad(option) {
if(option.mod){
this.submitMethod = "PUT"
}
var that = this; var that = this;
uni.$on('addressSave',function(data){ uni.$on('addressSave',function(data){
console.log(JSON.stringify(that.GLOBALUTIL.addressSelectionTemp)) console.log(JSON.stringify(that.GLOBALUTIL.addressSelectionTemp))
...@@ -75,9 +87,12 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue" ...@@ -75,9 +87,12 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
}) })
uni.$on('rectificationEdit',function(data){ uni.$on('rectificationEdit',function(data){
var baseData = data[0]; var baseData = data[0];
that.baseBody = baseData;
that.objectData = JSON.parse(baseData.check_scope) that.objectData = JSON.parse(baseData.check_scope)
that.checkitem = baseData.check_item that.checkitem = baseData.check_item
that.taskId = baseData.check_task_id ; that.taskId = baseData.check_task_id ;
that.description = baseData.description ;
that.images = JSON.parse(baseData.images);
that.room = JSON.parse(baseData.room); that.room = JSON.parse(baseData.room);
if(that.objectData.type == "site"){ if(that.objectData.type == "site"){
that.addressType = "site"; that.addressType = "site";
...@@ -85,6 +100,9 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue" ...@@ -85,6 +100,9 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
} }
}) })
uni.$on('securitySubmitPicChange',function(data){
that.images = data[0];
})
}, },
onUnload(){ onUnload(){
var that = this var that = this
...@@ -95,6 +113,8 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue" ...@@ -95,6 +113,8 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
}) })
uni.$off('rectificationEdit',function(data){ uni.$off('rectificationEdit',function(data){
}) })
uni.$off('securitySubmitPicChange',function(data){
})
}, },
methods: { methods: {
showAddressSel(){ showAddressSel(){
...@@ -110,10 +130,14 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue" ...@@ -110,10 +130,14 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
this.showActionSheet = true; this.showActionSheet = true;
}, },
onPhotoClick:function(index){
uni.navigateTo({
url:"../../components/image-preview/image-preview"
})
uni.$emit("previewPhoto",[this.images,index])
},
onSubmitClick: function() { onSubmitClick: function() {
// uni.navigateTo({ this.submitShow = false;
// url:'../../components/address-select/index?maxLevel='+this.maxLevel
// });
var body = { var body = {
"check_scope":JSON.stringify(this.objectData), "check_scope":JSON.stringify(this.objectData),
"check_item_id":this.checkitem.id, "check_item_id":this.checkitem.id,
...@@ -124,20 +148,41 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue" ...@@ -124,20 +148,41 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
"description":this.description, "description":this.description,
"room":JSON.stringify(this.room) "room":JSON.stringify(this.room)
} }
if(this.submitMethod == "PUT"){
body = this.baseBody
body.description = this.description
}
var user = {}; var user = {};
user.id = this.GLOBALUTIL.user.userid; user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username); user.name = encodeURI(this.GLOBALUTIL.user.username);
console.log(JSON.stringify(body))
uni.request({ uni.request({
url: this.GLOBALUTIL.url+'/safety/v1/danger', url: this.GLOBALUTIL.url+'/safety/v1/danger',
method: 'POST', method: this.submitMethod,
body:JSON.stringify(body), data:JSON.stringify(body),
header: { header: {
'Accept': 'application/json', 'Accept': 'application/json',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'user' : JSON.stringify(user) 'user' : JSON.stringify(user)
}, },
success: (res) => { success: (res) => {
console.log(res) console.log(JSON.stringify(res))
if(res.statusCode == 200){
if(this.submitMethod == "PUT"){
uni.$emit("rectificationListData",[this.baseBody])
}
this.$refs.popup.open({
type:'success',
content:'提交成功!',
timeout:1000,
isClick:false
});
setTimeout(()=>{
uni.navigateBack({
delta:1
})
},1000)
}
} }
}) })
}, },
...@@ -166,33 +211,18 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue" ...@@ -166,33 +211,18 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
}, },
uploadPic(imgPath){ uploadPic(imgPath){
var user = {}; var user = {};
var that = this;
user.id = this.GLOBALUTIL.user.userid; user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username); user.name = encodeURI(this.GLOBALUTIL.user.username);
// uni.request({ let imgs = imgPath.map((value, index) => {
// url: this.GLOBALUTIL.url+'/safety/v1/file/image', return {
// method: 'POST', name: "file",
// data:{ uri: value
// file:[{"uri": imgPath[0],"name":"file"}] }
// }, });
// header: {
// 'Accept': 'application/json',
// 'Content-Type': 'multipart/form-data',
// 'user' : JSON.stringify(user)
// },
// success: (res) => {
// console.log(res)
// }
// })
// console.log(imgPath[0])
// let imgs = imgPath.map((value, index) => {
// return {
// name: "file["+index+"]",//注意这一行,uni的hello的示例中,这里为key名+index,这样是无法和使用一个固定key名接多个文件的php接口对接上的改为数组下标形式的字符串就解决这个问题了。其效果等同于在html页面上多个同name文件域同时提交表单。
// uri: value
// }
// });
uni.uploadFile({ uni.uploadFile({
url: this.GLOBALUTIL.url+'/safety/v1/file/image', url: this.GLOBALUTIL.url+'/safety/v1/file/image',
// files:imgs, files:imgs,
filePath:imgPath[0], filePath:imgPath[0],
name:"file", name:"file",
header: { header: {
...@@ -200,7 +230,8 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue" ...@@ -200,7 +230,8 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
'Content-Type': 'multipart/form-data', 'Content-Type': 'multipart/form-data',
}, },
success: (res) => { success: (res) => {
console.log(JSON.stringify(res)) var uri = JSON.parse(res.data).data;
that.images.push(uri);
} }
}) })
}, },
...@@ -210,6 +241,12 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue" ...@@ -210,6 +241,12 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
changeTextValue:function(e){ changeTextValue:function(e){
this.description = e.detail.value; this.description = e.detail.value;
}, },
cancel:function(){
this.submitShow = false;
},
showModal:function(){
this.submitShow = true;
},
}, },
components: { components: {
...@@ -276,6 +313,7 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue" ...@@ -276,6 +313,7 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
justify-content: center; justify-content: center;
width:200rpx; width:200rpx;
height: 200rpx; height: 200rpx;
padding:0 ;
} }
.camera { .camera {
width:50rpx; width:50rpx;
......
...@@ -16,9 +16,11 @@ ...@@ -16,9 +16,11 @@
<view ><image @click="checkItem(item)" class="icon" src="../../static/security-check/safeEdit.png"></view> <view ><image @click="checkItem(item)" class="icon" src="../../static/security-check/safeEdit.png"></view>
</view> </view>
</view> </view>
<button hover-class="submithover" @click="onSubmitClick" class="submit-button"> <button hover-class="submithover" @click="showModal" class="submit-button">
<text class="submittext">提交</text> <text class="submittext">提交</text>
</button> </button>
<form-alert v-if="submitShow" name="检查对象" placeholder="确定提交所填的数据?" @confirm="onSubmitClick" @cancel="cancel"></form-alert>
<PopUp ref="popup" :isdistance="true"></PopUp>
</mescroll-body> </mescroll-body>
</template> </template>
...@@ -39,10 +41,17 @@ ...@@ -39,10 +41,17 @@
checkitems:[], checkitems:[],
objectData:{}, objectData:{},
taskId:"", taskId:"",
checkResult:[] checkResult:[],
submitShow:false
} }
}, },
methods: { methods: {
cancel:function(){
this.submitShow = false;
},
showModal:function(){
this.submitShow = true;
},
onLoad() { onLoad() {
var that = this; var that = this;
uni.$on('sendCheckItem',function(data){ uni.$on('sendCheckItem',function(data){
...@@ -82,7 +91,7 @@ ...@@ -82,7 +91,7 @@
code:this.checkitems[status].code, code:this.checkitems[status].code,
id:this.checkitems[status].id id:this.checkitems[status].id
} }
this.checkResult[index].result_type = res this.checkResult[index].result_type = JSON.stringify(res);
this.$forceUpdate(); this.$forceUpdate();
console.log(JSON.stringify(this.checkResult)) console.log(JSON.stringify(this.checkResult))
}, },
...@@ -135,6 +144,7 @@ ...@@ -135,6 +144,7 @@
}, },
onSubmitClick(){ onSubmitClick(){
this.submitShow = false;
var user = {}; var user = {};
user.id = this.GLOBALUTIL.user.userid; user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username); user.name = encodeURI(this.GLOBALUTIL.user.username);
...@@ -150,6 +160,20 @@ ...@@ -150,6 +160,20 @@
}, },
success: (res) => { success: (res) => {
console.log(JSON.stringify(res)) console.log(JSON.stringify(res))
if(res.statusCode == 200){
uni.$emit("refreshTaskList")
this.$refs.popup.open({
type:'success',
content:'提交成功!',
timeout:1000,
isClick:false
});
setTimeout(()=>{
uni.navigateBack({
delta:2
})
},1000)
}
} }
}) })
} }
......
...@@ -2,19 +2,21 @@ ...@@ -2,19 +2,21 @@
<mescroll-body class="containter" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback" @up="upCallback"> <mescroll-body class="containter" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback" @up="upCallback">
<view class="news-li" v-for="news in dataList" :key="news.id" hover-class="hover" @click="goDetail(news)"> <view class="news-li" v-for="news in dataList" :key="news.id" hover-class="hover" @click="goDetail(news)">
<view class="top-container" > <view class="top-container" >
<text class="title">{{news.name}}</text> <view style="width: 500rpx;"><text class="title">{{news.name}}</text></view>
<view :class="news.color=='finish' ? 'status-finish' : 'status' "> <view :class="news.color=='finish' ? 'status-finish' : 'status' ">
<text :class="news.color=='finish' ? 'status-finish-text' : 'status-text' ">{{news.taskstatus}}</text> <text :class="news.color=='finish' ? 'status-finish-text' : 'status-text' ">{{news.taskstatus}}</text>
</view> </view>
</view> </view>
<view><text class="des">{{news.check_point}}</text></view> <view style="width: 700rpx;" ><text class="des">{{news.check_point}}</text></view>
<view><image class="icon" src="../../static/security-check/safeTime.png"><text class="detail">{{JSON.parse(news.schedule).startdate}}~{{JSON.parse(news.schedule).enddate}}</text></view> <view><image class="icon" src="../../static/security-check/safeTime.png"><text class="detail">{{JSON.parse(news.schedule).startdate}}~{{JSON.parse(news.schedule).enddate}}</text></view>
<view style="display: flex;flex-direction: row;align-items: center;"> <view style="display: flex;flex-direction: row;align-items: center;">
<image class="icon" src="../../static/security-check/safeSys.png"> <view style="width: 20rpx;margin-right:20rpx;"><image class="icon" src="../../static/security-check/safeSys.png"></view>
<view style="display: flex;flex-direction: column;" v-for="(data,index) in JSON.parse(news.check_scope)" :key="index" > <view style="display:flex;flex-direction: row; -webkit-flex-wrap: wrap;flex-wrap: wrap">
<view style="display: flex;margin-right:30px" v-for="(data,index) in JSON.parse(news.check_scope)" :key="index" >
<text class="detail">{{data.name}}</text> <text class="detail">{{data.name}}</text>
</view> </view>
</view> </view>
</view>
<view><image class="icon" src="../../static/security-check/safePerson.png"><text class="detail">{{news.taskexecutor}}</text></view> <view><image class="icon" src="../../static/security-check/safePerson.png"><text class="detail">{{news.taskexecutor}}</text></view>
<view><text class="type">{{news.taskTypeTitle}}</text></view> <view><text class="type">{{news.taskTypeTitle}}</text></view>
</view> </view>
...@@ -38,8 +40,16 @@ ...@@ -38,8 +40,16 @@
}, },
methods: { methods: {
onLoad() { onLoad() {
var that = this;
uni.$on('refreshTaskList',function(data){
that.loadData();
})
this.loadData(); this.loadData();
}, },
onUnload(){
uni.$off('refreshTaskList',function(data){
})
},
/*下拉刷新的回调 */ /*下拉刷新的回调 */
downCallback() { downCallback() {
this.mescroll.endSuccess(); this.mescroll.endSuccess();
...@@ -52,7 +62,6 @@ ...@@ -52,7 +62,6 @@
loadData(){ loadData(){
var body = {}; var body = {};
var user = {}; var user = {};
console.log(this.GLOBALUTIL.user)
user.id = this.GLOBALUTIL.user.userid; user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username); user.name = encodeURI(this.GLOBALUTIL.user.username);
uni.request({ uni.request({
...@@ -65,6 +74,7 @@ ...@@ -65,6 +74,7 @@
}, },
body:null, body:null,
success: (res) => { success: (res) => {
console.log(JSON.stringify(res))
var data = res.data.data; var data = res.data.data;
data.map((opt)=>{ data.map((opt)=>{
opt.taskstatus = (this.handleStatus(opt)).text; opt.taskstatus = (this.handleStatus(opt)).text;
......
...@@ -14,12 +14,11 @@ ...@@ -14,12 +14,11 @@
<text class="submittext">开始检查</text> <text class="submittext">开始检查</text>
</button> </button>
<Picker <Picker
mode="linkage" mode="selector"
:level="1"
@confirm="onConfirm" @confirm="onConfirm"
ref="picker" ref="picker"
:linkList="itemList"
themeColor="#f00" themeColor="#f00"
:selectList="itemList"
></Picker> ></Picker>
</view> </view>
</template> </template>
...@@ -56,15 +55,15 @@ import Picker from "@/components/w-picker/w-picker.vue"; ...@@ -56,15 +55,15 @@ import Picker from "@/components/w-picker/w-picker.vue";
}, },
onConfirm(data){ onConfirm(data){
if(this.curType == "object"){ if(this.curType == "object"){
this.selObject = data.checkValue[0]; this.selObject = data.checkArr.value;
this.selObjectText = data.checkArr[0]; this.selObjectText = data.checkArr.label;
this.itemarr = []; this.itemarr = [];
this.selectItem = ""; this.selectItem = "";
this.selectItemText = ""; this.selectItemText = "";
this.loadItemData(); this.loadItemData();
}else{ }else{
this.selectItem = data.checkValue[0]; this.selectItem = data.checkArr.value;
this.selectItemText = data.checkArr[0]; this.selectItemText = data.checkArr.label;
} }
}, },
onSubmitClick(){ onSubmitClick(){
...@@ -104,8 +103,10 @@ import Picker from "@/components/w-picker/w-picker.vue"; ...@@ -104,8 +103,10 @@ import Picker from "@/components/w-picker/w-picker.vue";
success: (res) => { success: (res) => {
var data = res.data; var data = res.data;
this.objectData = data; this.objectData = data;
var itemList = data.map((opt)=>{ var itemList = data.map((opt)=>{
return {label:opt.name,value:opt.id}; var status = opt.execute_state?"(已完成)":""
return {label:opt.name+status,value:opt.id};
}) })
this.objectarr = itemList; this.objectarr = itemList;
this.itemList = itemList; this.itemList = itemList;
...@@ -129,7 +130,8 @@ import Picker from "@/components/w-picker/w-picker.vue"; ...@@ -129,7 +130,8 @@ import Picker from "@/components/w-picker/w-picker.vue";
var data = res.data; var data = res.data;
this.itemData = data; this.itemData = data;
var itemList = data.map((opt)=>{ var itemList = data.map((opt)=>{
return {label:opt.content,value:opt.id}; var status = opt.execute_state?"(已完成)":""
return {label:opt.content+status,value:opt.id};
}) })
this.itemarr = itemList; this.itemarr = itemList;
} }
......
<template> <template>
<view style="width: 100%;height: 100%;padding: 10px;">
<scroll-view scroll-y="true" class="scroll-Y" show-scrollbar="false" > <scroll-view scroll-y="true" class="scroll-Y" show-scrollbar="false" >
<view style="display: flex;flex-direction: row;padding:10rpx;border-bottom: 1rpx solid #4BBC9A;align-items: center;"> <view style="display: flex;flex-direction: row;border-bottom: 1rpx solid #4BBC9A;align-items: center;">
<image class="tip" src="../../static/security-submit/tip.png"> <image class="tip" src="../../static/security-submit/tip.png">
<text class="toptitle">整改项提交</text> <text class="toptitle">整改项提交</text>
</view> </view>
...@@ -47,8 +48,13 @@ ...@@ -47,8 +48,13 @@
</view> </view>
<view style="margin-top: 20px;"> <view style="margin-top: 20px;">
<text class="title" style="margin-top: 30rpx;">整改项照片</text> <text class="title" style="margin-top: 30rpx;">整改项照片</text>
<view style="width: 100%;display: flex;align-items: flex-start; justify-content: flex-start;margin-top: 30rpx;"> <view style="width: 100%;display: flex;align-items: flex-start; justify-content: flex-start;margin-top: 30rpx;flex-direction: row;">
<view> <view style="margin-right: 30rpx;" v-for="(item,index) in images" :key="index">
<button @click="onPhotoClick(index)" class="camera-button">
<image mod="scaleToFill" class="camera-button" :src="item" />
</button>
</view>
<view class="photo">
<button @click="onclick" class="camera-button"> <button @click="onclick" class="camera-button">
<image class="camera" src="../../static/common/camera.png"> <image class="camera" src="../../static/common/camera.png">
</button> </button>
...@@ -56,13 +62,14 @@ ...@@ -56,13 +62,14 @@
</view> </view>
</view> </view>
<view style="display: flex;justify-content: center;align-items: center;width: 100%;margin-top: 40px;"> <view style="display: flex;justify-content: center;align-items: center;width: 100%;margin-top: 40px;">
<view hover-class="submithover" @click="onSubmitClick" class="submit-button"> <view hover-class="submithover" @click="showModal" class="submit-button">
<text class="submittext" >提交</text> <text class="submittext" >提交</text>
</view> </view>
</view> </view>
<view style="width: 100%;height: 40px;"> <view style="width: 100%;height: 40px;">
</view> </view>
</scroll-view>
<ActionSheet :show="showActionSheet" :tips="tips" :item-list="actionList" :mask-closable="maskClosable" <ActionSheet :show="showActionSheet" :tips="tips" :item-list="actionList" :mask-closable="maskClosable"
:color="color" :size="size" :is-cancel="isCancel" @click="itemClick" @cancel="closeActionSheet"></ActionSheet> :color="color" :size="size" :is-cancel="isCancel" @click="itemClick" @cancel="closeActionSheet"></ActionSheet>
<Picker <Picker
...@@ -73,8 +80,9 @@ ...@@ -73,8 +80,9 @@
:linkList="itemList" :linkList="itemList"
themeColor="#f00" themeColor="#f00"
></Picker> ></Picker>
</scroll-view> <form-alert v-if="submitShow" name="整改项提交" placeholder="确定提交所填的数据?" @confirm="onSubmitClick" @cancel="cancel"></form-alert>
<PopUp ref="popup" :isdistance="true"></PopUp>
</view>
</template> </template>
<script> <script>
...@@ -109,14 +117,14 @@ import Picker from "@/components/w-picker/w-picker.vue"; ...@@ -109,14 +117,14 @@ import Picker from "@/components/w-picker/w-picker.vue";
address:"", address:"",
addressType:"", addressType:"",
description:"", description:"",
room:{} room:{},
submitShow:false,
} }
}, },
onLoad() { onLoad() {
var that = this; var that = this;
uni.$on('addressSave',function(data){ uni.$on('addressSave',function(data){
console.log(JSON.stringify(that.GLOBALUTIL.addressSelectionTemp))
var roomData = {}; var roomData = {};
roomData.code = that.GLOBALUTIL.addressSelectionTemp[3].code; roomData.code = that.GLOBALUTIL.addressSelectionTemp[3].code;
roomData.id = that.GLOBALUTIL.addressSelectionTemp[3].id; roomData.id = that.GLOBALUTIL.addressSelectionTemp[3].id;
...@@ -124,6 +132,9 @@ import Picker from "@/components/w-picker/w-picker.vue"; ...@@ -124,6 +132,9 @@ import Picker from "@/components/w-picker/w-picker.vue";
that.room = roomData that.room = roomData
that.address = that.GLOBALUTIL.addressSelectionTemp[0].name + that.GLOBALUTIL.addressSelectionTemp[1].name+that.GLOBALUTIL.addressSelectionTemp[2].name + that.GLOBALUTIL.addressSelectionTemp[3].name; that.address = that.GLOBALUTIL.addressSelectionTemp[0].name + that.GLOBALUTIL.addressSelectionTemp[1].name+that.GLOBALUTIL.addressSelectionTemp[2].name + that.GLOBALUTIL.addressSelectionTemp[3].name;
}) })
uni.$on('securitySubmitPicChange',function(data){
that.images = data[0];
})
this.getTaskList(); this.getTaskList();
}, },
onUnload(){ onUnload(){
...@@ -131,14 +142,27 @@ import Picker from "@/components/w-picker/w-picker.vue"; ...@@ -131,14 +142,27 @@ import Picker from "@/components/w-picker/w-picker.vue";
uni.$off('addressSave',function(data){ uni.$off('addressSave',function(data){
that.GLOBALUTIL.addressSelectionTemp = []; that.GLOBALUTIL.addressSelectionTemp = [];
}) })
uni.$off('securitySubmitPicChange',function(data){
})
}, },
methods: { methods: {
cancel:function(){
this.submitShow = false;
},
showModal:function(){
this.submitShow = true;
},
onclick: function() { onclick: function() {
console.log(this.textvalue)
this.showActionSheet = true; this.showActionSheet = true;
},
onPhotoClick:function(index){
uni.navigateTo({
url:"../../components/image-preview/image-preview"
})
uni.$emit("previewPhoto",[this.images,index])
}, },
onSubmitClick: function() { onSubmitClick: function() {
this.submitShow = false;
var body = { var body = {
"check_scope":JSON.stringify(this.curCheckScope), "check_scope":JSON.stringify(this.curCheckScope),
"check_item_id":this.curItem.value, "check_item_id":this.curItem.value,
...@@ -149,7 +173,7 @@ import Picker from "@/components/w-picker/w-picker.vue"; ...@@ -149,7 +173,7 @@ import Picker from "@/components/w-picker/w-picker.vue";
"room":JSON.stringify(this.room) "room":JSON.stringify(this.room)
} }
console.log(JSON.stringify(body)) console.log(JSON.stringify(body))
console.log(this.GLOBALUTIL.url) // console.log(this.GLOBALUTIL.url)
var user = {}; var user = {};
user.id = this.GLOBALUTIL.user.userid; user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username); user.name = encodeURI(this.GLOBALUTIL.user.username);
...@@ -164,7 +188,19 @@ import Picker from "@/components/w-picker/w-picker.vue"; ...@@ -164,7 +188,19 @@ import Picker from "@/components/w-picker/w-picker.vue";
'user' : JSON.stringify(user) 'user' : JSON.stringify(user)
}, },
success: (res) => { success: (res) => {
console.log(JSON.stringify(res)) if(res.statusCode == 200){
this.$refs.popup.open({
type:'success',
content:'提交成功!',
timeout:1000,
isClick:false
});
setTimeout(()=>{
uni.navigateBack({
delta:1
})
},1000)
}
} }
}) })
}, },
...@@ -192,7 +228,32 @@ import Picker from "@/components/w-picker/w-picker.vue"; ...@@ -192,7 +228,32 @@ import Picker from "@/components/w-picker/w-picker.vue";
this.closeActionSheet(); this.closeActionSheet();
}, },
uploadPic(imgPath){ uploadPic(imgPath){
var user = {};
var that = this;
user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username);
let imgs = imgPath.map((value, index) => {
return {
name: "file",
uri: value
}
});
uni.uploadFile({
url: this.GLOBALUTIL.url+'/safety/v1/file/image',
files:imgs,
filePath:imgPath[0],
name:"file",
header: {
'user' : JSON.stringify(user),
'Content-Type': 'multipart/form-data',
},
success: (res) => {
var uri = JSON.parse(res.data).data;
console.log(uri)
console.log(JSON.stringify(res))
that.images.push(uri);
}
})
}, },
closeActionSheet: function() { closeActionSheet: function() {
this.showActionSheet = false this.showActionSheet = false
...@@ -230,6 +291,7 @@ import Picker from "@/components/w-picker/w-picker.vue"; ...@@ -230,6 +291,7 @@ import Picker from "@/components/w-picker/w-picker.vue";
this.$refs.picker.show() this.$refs.picker.show()
}, },
onConfirm(data){ onConfirm(data){
console.log(JSON.stringify(data))
if(this.curPicker == "task"){ if(this.curPicker == "task"){
this.curTask = {"name":data.checkArr[0],value:data.checkValue[0]} this.curTask = {"name":data.checkArr[0],value:data.checkValue[0]}
this.loadTaskObject(); this.loadTaskObject();
...@@ -264,7 +326,6 @@ import Picker from "@/components/w-picker/w-picker.vue"; ...@@ -264,7 +326,6 @@ import Picker from "@/components/w-picker/w-picker.vue";
getTaskList(){ getTaskList(){
var body = {}; var body = {};
var user = {}; var user = {};
console.log(this.GLOBALUTIL.user)
user.id = this.GLOBALUTIL.user.userid; user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username); user.name = encodeURI(this.GLOBALUTIL.user.username);
uni.request({ uni.request({
...@@ -341,7 +402,7 @@ import Picker from "@/components/w-picker/w-picker.vue"; ...@@ -341,7 +402,7 @@ import Picker from "@/components/w-picker/w-picker.vue";
components: { components: {
ActionSheet, ActionSheet,
AddressSelect, AddressSelect,
Picker Picker,
}, },
} }
</script> </script>
...@@ -402,6 +463,7 @@ import Picker from "@/components/w-picker/w-picker.vue"; ...@@ -402,6 +463,7 @@ import Picker from "@/components/w-picker/w-picker.vue";
justify-content: center; justify-content: center;
width:200rpx; width:200rpx;
height: 200rpx; height: 200rpx;
padding: 0;
} }
.camera { .camera {
width:50rpx; width:50rpx;
...@@ -470,7 +532,8 @@ import Picker from "@/components/w-picker/w-picker.vue"; ...@@ -470,7 +532,8 @@ import Picker from "@/components/w-picker/w-picker.vue";
} }
.scroll-Y{ .scroll-Y{
height: 100%; height: 100%;
padding-left: 20rpx; }
padding-right: 20rpx; .photo{
margin-right: 30rpx;
} }
</style> </style>
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
providerList: [], providerList: [],
hasProvider: false, hasProvider: false,
account: '20040998', account: '20040998',
// account:"20190071",
password: 'password', password: 'password',
positionTop: 0, positionTop: 0,
isDevtools: false, isDevtools: false,
...@@ -71,7 +72,6 @@ ...@@ -71,7 +72,6 @@
var form = []; var form = [];
for(let i in body){ for(let i in body){
if(body.hasOwnProperty(i)){ if(body.hasOwnProperty(i)){
debugger
form.push(i+'='+encodeURI(body[i])); form.push(i+'='+encodeURI(body[i]));
} }
} }
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
}, },
success: (res) => { success: (res) => {
console.log(JSON.stringify(res))
this.GLOBALUTIL.user = res.data.loginresponse this.GLOBALUTIL.user = res.data.loginresponse
this.text = 'request success'; this.text = 'request success';
console.log(res.data.loginresponse) console.log(res.data.loginresponse)
......
<template>
</template>
<script>
</script>
<style>
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment