Commit a3c5e62c by liuzhanxin

fix

parent 896752f3
<script> <script>
import util from "common/util.js" import util from "common/util.js"
import Vue from 'vue'
Vue.prototype.GLOBALUTIL = util; Vue.prototype.GLOBALUTIL = util;
export default { export default {
onLaunch: function() { onLaunch: function() {
...@@ -129,4 +130,7 @@ Vue.prototype.GLOBALUTIL = util; ...@@ -129,4 +130,7 @@ Vue.prototype.GLOBALUTIL = util;
button.primary { button.primary {
background-color: #0faeff; background-color: #0faeff;
} }
scroll-view ::-webkit-scrollbar {
  display: none
}
</style> </style>
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2,9 +2,11 @@ var url = "http://47.94.204.226"; ...@@ -2,9 +2,11 @@ var url = "http://47.94.204.226";
var addressSelectionTemp = []; var addressSelectionTemp = [];
var user = {}; var user = {};
var sysInfo = {}; var sysInfo = {};
import moment from "./moment.js"
export default{ export default{
url, url,
addressSelectionTemp, addressSelectionTemp,
user, user,
sysInfo sysInfo,
moment
} }
\ No newline at end of file
<template> <template>
<view class="content"> <view class="content">
<view class="status_bar">
<!-- 这里是状态栏 -->
</view>
<uni-nav-bar @clickLeft="goBackClick" @clickRight="saveClick" left-icon="back" left-text="返回" right-text="确定" :title="title[index]"></uni-nav-bar>
<uni-list v-for="(item,index) in listData" :key=index> <uni-list v-for="(item,index) in listData" :key=index>
<view class="itemclass" hover-class="hoverclass" hover-stay-time="40" @click="itemClick(item,index)"> <view class="itemclass" hover-class="hoverclass" hover-stay-time="40" @click="itemClick(item,index)">
<view> <view>
...@@ -25,21 +21,36 @@ ...@@ -25,21 +21,36 @@
data() { data() {
return { return {
title: ["校区","楼栋","楼层","教室"], title: ["校区","楼栋","楼层","教室"],
listData:[{name:"名字",selected:false},{name:"名字2",selected:false},{name:"名字3",selected:false},{name:"名字4",selected:false}], listData:[],
index:0, index:0,
addressSel:[] addressSel:[],
id:""
} }
}, },
onLoad(option) { onLoad(option) {
if(option.maxLevel){ if(option.maxLevel){
this.maxLevel = option.maxLevel this.maxLevel = option.maxLevel
} }
if(option.id){
this.id = option.id
}
if(option.lastIndex){ if(option.lastIndex){
this.index = parseInt(option.lastIndex) +1; this.index = parseInt(option.lastIndex) +1;
} }
this.getData(); if(this.index == 0){
this.getStartId()
}else{
this.getData(this.id);
}
uni.setNavigationBarTitle({
title:this.title[this.index]
})
}, },
methods: { methods: {
onNavigationBarButtonTap(){
this.saveClick();
console.log("ad")
},
goBackClick:function(){ goBackClick:function(){
uni.navigateBack({ uni.navigateBack({
...@@ -55,9 +66,15 @@ ...@@ -55,9 +66,15 @@
}, },
itemClick:function(item,index){ itemClick:function(item,index){
if(this.GLOBALUTIL.addressSelectionTemp[this.index]){ if(this.GLOBALUTIL.addressSelectionTemp[this.index]){
this.GLOBALUTIL.addressSelectionTemp[this.index] = item.name; this.GLOBALUTIL.addressSelectionTemp[this.index].name = item.name;
this.GLOBALUTIL.addressSelectionTemp[this.index].id = item.name;
this.GLOBALUTIL.addressSelectionTemp[this.index].code = item.code;
}else{ }else{
this.GLOBALUTIL.addressSelectionTemp.push(item.name) this.GLOBALUTIL.addressSelectionTemp.push({
code:item.code,
id:item.id,
name:item.name
})
} }
this.listData.map((opt)=>{ this.listData.map((opt)=>{
opt.selected = false; opt.selected = false;
...@@ -67,12 +84,52 @@ ...@@ -67,12 +84,52 @@
return return
}else{ }else{
uni.navigateTo({ uni.navigateTo({
url:'../../components/address-select/index?lastIndex='+this.index+"&maxLevel="+this.maxLevel url:'../../components/address-select/index?lastIndex='+this.index+"&maxLevel="+this.maxLevel+"&id="+item.id
}) })
} }
}, },
getData:function(){ getData:function(id){
var body = {};
var user = {};
user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username);
uni.request({
url: this.GLOBALUTIL.url+'/base-data/v1/dict-items?sort_property=ID&sort_direction=ASC&dict_code=jsxx&&page_number=1&page_size=100&prev_id='+id,
method: 'GET',
header: {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'user' : JSON.stringify(user)
},
body:null,
success: (res) => {
console.log(JSON.stringify(res))
var list = res.data.data;
list.map((opt)=>{
opt.selected = false;
})
this.listData = list
}
})
},
getStartId(){
var body = {};
var user = {};
user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username);
uni.request({
url: this.GLOBALUTIL.url+'/base-data/v1/dicts-code/jsxx',
method: 'GET',
header: {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'user' : JSON.stringify(user)
},
body:null,
success: (res) => {
this.getData(res.data.id);
}
})
} }
}, },
components: {uniList,uniListItem,uniNavBar} components: {uniList,uniListItem,uniNavBar}
...@@ -84,6 +141,7 @@ ...@@ -84,6 +141,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background-color: #F7F7F7; background-color: #F7F7F7;
padding:0
} }
.status_bar { .status_bar {
height: var(--status-bar-height); height: var(--status-bar-height);
......
...@@ -279,4 +279,7 @@ ...@@ -279,4 +279,7 @@
@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>
<template>
<view class="tui-drawer-class tui-drawer" :class="[visible ? 'tui-drawer-show' : '','tui-drawer-' + mode]">
<view v-if="mask" class="tui-drawer-mask" @tap="handleMaskClick" @touchmove.stop.prevent></view>
<view class="tui-drawer-container" @touchmove.stop.prevent>
<slot></slot>
</view>
</view>
</template>
<script>
export default {
name:"tuiDrawer",
props: {
visible: {
type: Boolean,
default: false
},
mask: {
type: Boolean,
default: true
},
maskClosable: {
type: Boolean,
default: true
},
mode: {
type: String,
default: 'left' // left right
}
},
methods: {
handleMaskClick() {
if (!this.maskClosable) {
return;
}
this.$emit('close', {});
}
}
}
</script>
<style>
.tui-drawer {
visibility: hidden;
}
.tui-drawer-show {
visibility: visible;
}
.tui-drawer-show .tui-drawer-mask {
display: block;
opacity: 1;
}
.tui-drawer-show .tui-drawer-container {
opacity: 1;
}
.tui-drawer-show.tui-drawer-left .tui-drawer-container,
.tui-drawer-show.tui-drawer-right .tui-drawer-container {
transform: translate3d(0, -50%, 0);
}
.tui-drawer-mask {
opacity: 0;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 998;
background: rgba(0, 0, 0, 0.6);
transition: all 0.3s ease-in-out;
}
.tui-drawer-container {
position: fixed;
left: 50%;
height: 100.2%;
top: 0;
transform: translate3d(-50%, -50%, 0);
transform-origin: center;
transition: all 0.3s ease-in-out;
z-index: 998;
opacity: 0;
overflow-y: scroll;
background: #fff;
-webkit-overflow-scrolling: touch;
-ms-touch-action: pan-y cross-slide-y;
-ms-scroll-chaining: none;
-ms-scroll-limit: 0 50 0 50;
}
.tui-drawer-left .tui-drawer-container {
left: 0;
top: 50%;
transform: translate3d(-100%, -50%, 0);
}
.tui-drawer-right .tui-drawer-container {
right: 0;
top: 50%;
left: auto;
transform: translate3d(100%, -50%, 0);
}
</style>
...@@ -1024,7 +1024,7 @@ ...@@ -1024,7 +1024,7 @@
<style lang="scss"> <style lang="scss">
.w-picker{ .w-picker{
position: relative; position: relative;
z-index: 888; z-index: 999;
.mask { .mask {
position: fixed; position: fixed;
z-index: 1000; z-index: 1000;
......
...@@ -21,12 +21,30 @@ ...@@ -21,12 +21,30 @@
{ {
"path": "pages/Security-Check/security-task-list", "path": "pages/Security-Check/security-task-list",
"style": { "style": {
"navigationBarTitleText": "安全检查", "navigationBarTitleText": "安全检查"
}
},
{
"path": "pages/Security-Check/index",
"style": {
"navigationBarTitleText": "安全检查"
}
},
{
"path": "pages/Security-Check/select-checkobject",
"style": {
"navigationBarTitleText": "检查对象"
}
},
{
"path": "pages/Security-Check/security-checkitem",
"style": {
"navigationBarTitleText": "检查对象",
"app-plus" : { "app-plus" : {
"titleNView" : { "titleNView" : {
"buttons" : [ "buttons" : [
{ {
"text" : "消息", "text" : "查看危险源",
"fontSize" : "14" "fontSize" : "14"
} }
] ]
...@@ -35,21 +53,35 @@ ...@@ -35,21 +53,35 @@
} }
}, },
{ {
"path": "pages/Security-Check/index", "path": "pages/Rectification-Item/list",
"style": { "style": {
"navigationBarTitleText": "安全检查" "navigationBarTitleText": "整改项查询",
} "app-plus" : {
}, "titleNView" : {
"buttons" : [
{ {
"path": "pages/Security-Check/select-checkobject", "text" : "筛选",
"style": { "fontSize" : "14"
"navigationBarTitleText": "检查对象" }
]
}
}
} }
}, },
{ {
"path": "pages/Security-Check/security-checkitem", "path": "pages/Rectification-Item/detail",
"style": { "style": {
"navigationBarTitleText": "检查对象" "navigationBarTitleText": "整改项详情",
"app-plus" : {
"titleNView" : {
"buttons" : [
{
"text" : "编辑",
"fontSize" : "14"
}
]
}
}
} }
}, },
{ {
...@@ -61,7 +93,18 @@ ...@@ -61,7 +93,18 @@
{ {
"path": "components/address-select/index", "path": "components/address-select/index",
"style": { "style": {
"navigationStyle":"custom" "navigationBarTitleText":"校区",
"app-plus" : {
"titleNView" : {
"buttons" : [
{
"text" : "确定",
"fontSize" : "14"
}
]
}
}
} }
} }
], ],
......
<template>
<view class="top-container" >
<view class="detailtext"><text class="titletext">整改项详情</text><text class="contenttext">{{description}}</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="remind">未上传整改项照片</text></view>
<image v-if="imgUrl.length>0" class="pic" src="../../static/common/camera.png">
</view>
</template>
<script>
export default {
data() {
return {
imgUrl:"",
roomName:"",
description:"",
detailData:{}
}
},
methods: {
onLoad() {
console.log("onllllllllllllllload")
var that = this
uni.$on('rectificationListData',function(data){
var detailData = data[0]
that.roomName = JSON.parse(detailData.room).name
that.description = detailData.description;
that.detailData = detailData;
that.$forceUpdate();
})
},
onUnload(){
console.log("onunnnnnnnnnnnnnnload")
uni.$off('rectificationListData',function(data){
})
},
/*下拉刷新的回调 */
downCallback() {
this.mescroll.endSuccess();
},
/*上拉加载的回调 */
upCallback(page) {
},
onNavigationBarButtonTap(){
uni.navigateTo({
url:"../Security-Check/index"
})
uni.$emit("rectificationEdit",[this.detailData])
},
}
}
</script>
<style>
.top-container {
display: flex;
flex-direction: column;
width: 100%;
padding-left: 20rpx;
margin-top: 10rpx;
margin-bottom: 20rpx;
}
.title {
font-size: 16px;
color: #333333;
}
.containter{
display: flex;
width: 100%;
background-color: #F5F5F5;
padding: 20rpx;
}
.statuspic{
width:80rpx;
height:80rpx;
}
.titletext{
font-size:28rpx;
color: #666666;
margin-right: 78rpx;
flex:1
}
.titletextlong{
font-size:28rpx;
color: #666666;
margin-right: 50rpx;
flex:1
}
.contenttext{
font-size:28rpx;
color: #333333;
flex:3
}
.pic {
width:80rpx;
height:80rpx;
}
.remind {
font-size:32rpx;
color: #CDCDCD;
}
.detailtext {
display: flex;
flex-direction: row;
margin-top: 20rpx;
}
</style>
...@@ -2,12 +2,13 @@ ...@@ -2,12 +2,13 @@
<view class="content"> <view class="content">
<text class="title"> 实验室名称: {{objectData.name}}</text> <text class="title"> 实验室名称: {{objectData.name}}</text>
<text class="title" style="margin-top: 30rpx;">位置</text> <text class="title" style="margin-top: 30rpx;">位置</text>
<view class="location-container"> <view class="location-container" hover-class="hover" @click="showAddressSel">
<text class="location">{{objectData.name}}</text> <text class="location">{{address}}</text>
<image class="tip" src="../../static/common/arrow_right_gray.png">
</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" /> <textarea class="detail" @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;">
...@@ -18,7 +19,7 @@ ...@@ -18,7 +19,7 @@
</view> </view>
</view> </view>
<button hover-class="submithover" @click="onSubmitClick" class="submit-button"> <button hover-class="submithover" @click="onSubmitClick" 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>
...@@ -44,19 +45,45 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue" ...@@ -44,19 +45,45 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
checkitem:{}, checkitem:{},
taskId:"", taskId:"",
images:[], images:[],
room:{} room:{},
description:"",
address:"",
addressType:""
} }
}, },
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 = {};
roomData.code = that.GLOBALUTIL.addressSelectionTemp[3].code;
roomData.id = that.GLOBALUTIL.addressSelectionTemp[3].id;
roomData.name = that.GLOBALUTIL.addressSelectionTemp[1].name + that.GLOBALUTIL.addressSelectionTemp[3].name;
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;
}) })
uni.$on('safeReportData',function(data){ uni.$on('safeReportData',function(data){
that.objectData = data[0] that.objectData = data[0]
that.checkitem = data[1] that.checkitem = data[1]
that.taskId = data[2] that.taskId = data[2]
that.room = that.objectData
if(that.objectData.type == "site"){
that.addressType = "site";
that.address = that.objectData.name
}
})
uni.$on('rectificationEdit',function(data){
var baseData = data[0];
that.objectData = JSON.parse(baseData.check_scope)
that.checkitem = baseData.check_item
that.taskId = baseData.check_task_id ;
that.room = JSON.parse(baseData.room);
if(that.objectData.type == "site"){
that.addressType = "site";
that.address = that.objectData.name
}
}) })
}, },
onUnload(){ onUnload(){
...@@ -64,11 +91,22 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue" ...@@ -64,11 +91,22 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
uni.$off('addressSave',function(data){ uni.$off('addressSave',function(data){
that.GLOBALUTIL.addressSelectionTemp = []; that.GLOBALUTIL.addressSelectionTemp = [];
}) })
uni.$on('safeReportData',function(data){ uni.$off('safeReportData',function(data){
})
uni.$off('rectificationEdit',function(data){
}) })
}, },
methods: { methods: {
showAddressSel(){
if(this.addressType == "site"){
return
}
uni.navigateTo({
url:"../../components/address-select/index?maxLevel=4"
})
},
onclick: function() { onclick: function() {
console.log(this.textvalue)
this.showActionSheet = true; this.showActionSheet = true;
}, },
...@@ -95,7 +133,7 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue" ...@@ -95,7 +133,7 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
body:JSON.stringify(body), body:JSON.stringify(body),
header: { header: {
'Accept': 'application/json', 'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'Content-Type': 'application/json',
'user' : JSON.stringify(user) 'user' : JSON.stringify(user)
}, },
success: (res) => { success: (res) => {
...@@ -127,27 +165,51 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue" ...@@ -127,27 +165,51 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
this.closeActionSheet(); this.closeActionSheet();
}, },
uploadPic(imgPath){ uploadPic(imgPath){
var currentTime = new Date().getTime();
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);
// uni.request({
// url: this.GLOBALUTIL.url+'/safety/v1/file/image',
// method: 'POST',
// data:{
// 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:[{uri: imgPath[0],name: currentTime+'.jpg'}], // files:imgs,
filePath:"", filePath:imgPath[0],
name:"", name:"file",
header: { header: {
'Accept': 'application/json', 'user' : JSON.stringify(user),
'user' : JSON.stringify(user) 'Content-Type': 'multipart/form-data',
}, },
success: (res) => { success: (res) => {
console.log(res) console.log(JSON.stringify(res))
} }
}) })
}, },
closeActionSheet: function() { closeActionSheet: function() {
this.showActionSheet = false this.showActionSheet = false
}, },
changeTextValue:function(e){
this.description = e.detail.value;
},
}, },
components: { components: {
...@@ -200,6 +262,7 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue" ...@@ -200,6 +262,7 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between;
width:100%; width:100%;
} }
.arrow-right{ .arrow-right{
...@@ -249,4 +312,11 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue" ...@@ -249,4 +312,11 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
font-size: 34rpx; font-size: 34rpx;
color: #000000; color: #000000;
} }
.tip {
width: 30rpx;
height:30rpx
}
.hover {
opacity: 0.7;
}
</style> </style>
...@@ -38,7 +38,8 @@ ...@@ -38,7 +38,8 @@
isShow:false, isShow:false,
checkitems:[], checkitems:[],
objectData:{}, objectData:{},
taskId:"" taskId:"",
checkResult:[]
} }
}, },
methods: { methods: {
...@@ -76,7 +77,14 @@ ...@@ -76,7 +77,14 @@
}, },
itemClick(index,status){ itemClick(index,status){
this.dataList[index].status = status; this.dataList[index].status = status;
var res = {
name:this.checkitems[status].name,
code:this.checkitems[status].code,
id:this.checkitems[status].id
}
this.checkResult[index].result_type = res
this.$forceUpdate(); this.$forceUpdate();
console.log(JSON.stringify(this.checkResult))
}, },
checkItem(item){ checkItem(item){
uni.navigateTo({ uni.navigateTo({
...@@ -103,12 +111,47 @@ ...@@ -103,12 +111,47 @@
}) })
this.checkitems = res.data.data; this.checkitems = res.data.data;
this.isShow = true; this.isShow = true;
// console.log(JSON.stringify(this.objectData))
// console.log(JSON.stringify(this.dataList))
// console.log(JSON.stringify(this.checkitems))
this.checkResult = [];
this.dataList.map((opt)=>{
var res = {
name:this.checkitems[0].name,
id:this.checkitems[0].id,
code:this.checkitems[0].code
}
var item = {
"result_type":JSON.stringify(res),
"check_item_id":opt.id,
"check_list_id":opt.check_list_id,
"check_task_id":this.taskId,
"lab_id":this.objectData.id
}
this.checkResult.push(item)
})
} }
}) })
}, },
onSubmitClick(){ onSubmitClick(){
var user = {};
user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username);
var body = this.checkResult
uni.request({
url: this.GLOBALUTIL.url+'/safety/v1/check-result',
method: 'POST',
data:JSON.stringify(body),
header: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'user' : JSON.stringify(user)
},
success: (res) => {
console.log(JSON.stringify(res))
}
})
} }
} }
} }
......
<template> <template>
<mescroll-body 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> <text class="title">{{news.name}}</text>
<view class="status"> <view :class="news.color=='finish' ? 'status-finish' : 'status' ">
<text class="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><text class="des">{{news.check_point}}</text></view>
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
<text class="detail">{{data.name}}</text> <text class="detail">{{data.name}}</text>
</view> </view>
</view> </view>
<view><image class="icon" src="../../static/security-check/safePerson.png"><text class="detail">陆冬梅</text></view> <view><image class="icon" src="../../static/security-check/safePerson.png"><text class="detail">{{news.taskexecutor}}</text></view>
<view><text class="type">自建任务</text></view> <view><text class="type">{{news.taskTypeTitle}}</text></view>
</view> </view>
</mescroll-body> </mescroll-body>
</template> </template>
...@@ -67,13 +67,15 @@ ...@@ -67,13 +67,15 @@
success: (res) => { success: (res) => {
var data = res.data.data; var data = res.data.data;
data.map((opt)=>{ data.map((opt)=>{
opt.taskstatus = this.handleStatus(opt); opt.taskstatus = (this.handleStatus(opt)).text;
opt.color = (this.handleStatus(opt)).color;
var taskexecutor = JSON.parse(opt.excutor); var taskexecutor = JSON.parse(opt.excutor);
var taskexecutortext = ""; var taskexecutortext = "";
taskexecutor.map((opt)=>{ taskexecutor.map((opt)=>{
taskexecutortext = opt.name +" "; taskexecutortext = opt.name +" ";
}) })
opt.taskexecutor = taskexecutortext; opt.taskexecutor = taskexecutortext;
opt.taskTypeTitle = opt.auto_task?"上级下发":"自建任务"
}) })
this.dataList = data; this.dataList = data;
} }
...@@ -81,9 +83,11 @@ ...@@ -81,9 +83,11 @@
}, },
handleStatus(data){ handleStatus(data){
var text = ""; var text = "";
var color = ""
if(data.execute_state){ if(data.execute_state){
var check_scope = JSON.parse(data.check_scope); var check_scope = JSON.parse(data.check_scope);
text = "已完成" + check_scope.length +"/" + check_scope.length; text = "已完成" + check_scope.length +"/" + check_scope.length;
color = "finish"
}else{ }else{
var check_scope = JSON.parse(data.check_scope); var check_scope = JSON.parse(data.check_scope);
var checked = 0; var checked = 0;
...@@ -94,11 +98,13 @@ ...@@ -94,11 +98,13 @@
}) })
if(checked == check_scope.length){ if(checked == check_scope.length){
text = "已完成 " + check_scope.length +"/" + check_scope.length; text = "已完成 " + check_scope.length +"/" + check_scope.length;
color = "finish"
}else{ }else{
text = '未完成 '+checked+'/'+check_scope.length; text = '未完成 '+checked+'/'+check_scope.length;
color = "unfinish"
} }
} }
return text return {text:text,color:color}
}, },
goDetail(data){ goDetail(data){
uni.navigateTo({ uni.navigateTo({
...@@ -122,6 +128,9 @@ ...@@ -122,6 +128,9 @@
font-size: 32upx; font-size: 32upx;
padding: 32upx; padding: 32upx;
border-bottom: 1upx solid #eee; border-bottom: 1upx solid #eee;
width: 100%;
display: flex;
flex-direction: column;
} }
.news-li .new-content{ .news-li .new-content{
font-size: 28upx; font-size: 28upx;
...@@ -149,10 +158,24 @@ ...@@ -149,10 +158,24 @@
align-items: center; align-items: center;
margin-left: 35rpx; margin-left: 35rpx;
} }
.status-finish {
width:170rpx;
height:35rpx;
background-color: rgba(47,190,178,0.10);
border-radius: 50rpx;
display: flex;
justify-content: center;
align-items: center;
margin-left: 35rpx;
}
.status-text{ .status-text{
color: #F27373; color: #F27373;
font-size: 11px; font-size: 11px;
} }
.status-finish-text{
color: #2FBEB2;
font-size: 11px;
}
.hover{ .hover{
opacity: 0.7; opacity: 0.7;
} }
...@@ -171,4 +194,8 @@ ...@@ -171,4 +194,8 @@
.type { .type {
font-size:14px; font-size:14px;
} }
.containter{
display: flex;
width: 100%;
}
</style> </style>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
}, },
clickQuery(){ clickQuery(){
uni.navigateTo({ uni.navigateTo({
url:"./select-checkobject?taskId="+data.id url:"../Rectification-Item/list"
}) })
} }
} }
......
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