Commit ce425d2d by liuzhanxin

提交整改项修改

parent 6f06f9ee
......@@ -15,6 +15,12 @@ var commonHeader = {
"tenant-id":undefined
};
import moment from "./moment.js"
var guid2 = ()=> {
function S4() {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
}
return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
}
export default{
url,
addressSelectionTemp,
......@@ -23,5 +29,6 @@ export default{
moment,
token,
commonHeader,
intelligent_access_url
intelligent_access_url,
guid2
}
\ No newline at end of file
......@@ -14,7 +14,7 @@
<view :style="{ top: positionTop + 'upx' }" class="days">
<view class="item" v-for="(item, index) in dates" :key="index">
<view class="day" @click="selectOne(item, $event)" :class="{ choose: choose == handleDate(item.year,item.month+1,item.date), nolm: !item.lm }">{{ item.date }}</view>
<view class="sign" v-if="isSigned(item.year, item.month + 1, item.date)"></view>
<view :class="isSigned(item.year, item.month + 1, item.date).isOvertime? 'can-not-sign' : 'sign' " v-if="isSigned(item.year, item.month + 1, item.date).signState" ></view>
</view>
</view>
</view>
......@@ -126,17 +126,42 @@ export default {
}
return dates
},
getNowFormatDate() {
var date = new Date();
var seperator1 = "-";
var year = date.getFullYear();
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = year + seperator1 + month + seperator1 + strDate;
return currentdate;
},
// 已经签到处理
isSigned(y, m, d) {
let flag = false
let isOvertime = false;
for (let i = 0; i < this.signeddates.length; i++) {
let dy = this.handleDate(y,m,d);
if (this.signeddates[i] == dy) {
flag = true
let now = this.getNowFormatDate();
if(now > dy){
isOvertime = true;
}
break
}
}
return flag
var res = {
signState:flag,
isOvertime:isOvertime
}
return res
},
isToday(y, m, d) {
let date = new Date()
......@@ -295,6 +320,19 @@ export default {
pointer-events: none;
}
.can-not-sign {
font-style: normal;
width: 20upx;
height: 20upx;
background: #999999;
border-radius: 10upx;
position: absolute;
left: 50%;
margin-left: -10upx;
bottom: 0;
pointer-events: none;
}
.today-text {
position: absolute;
font-size: 20upx;
......
......@@ -136,6 +136,7 @@
header: this.GLOBALUTIL.commonHeader,
body: null,
success: (res) => {
console.log(res)
var calendarData = res.data.data;
var signeddates = calendarData.map((opt)=>{
var dt = opt.date.split(" ")[0]
......@@ -167,6 +168,13 @@
opt.checked = false;
return opt
})
this.currentCalendarData.sort((a,b)=>{
if(a.startTime > b.startTime){
return 1
}else{
return -1
}
})
}
})
},
......@@ -192,10 +200,18 @@
},
onNavigationBarButtonTap() {
var timetableUuids = [];
var flag = false
this.currentCalendarData.map((opt)=>{
if(opt.checked){
timetableUuids.push(opt.calendarId);
}
if(opt.date){
var curDate = this.GLOBALUTIL.moment().format("YYYY-MM-DD")
var dt = opt.date.split(" ")[0]
if(dt < curDate ){
flag = true
}
}
})
if(timetableUuids.length == 0){
this.$refs.popup.open({
......@@ -206,6 +222,15 @@
});
return
}
if(flag){
this.$refs.popup.open({
type:'err',
content:'已过期的时间不可预约',
timeout:1000,
isClick:false
});
return
}
uni.navigateTo({
url:"./write-confirm",
})
......@@ -215,11 +240,20 @@
},
submit(){
var timetableUuids = [];
var flag = false
this.currentCalendarData.map((opt)=>{
if(opt.checked){
timetableUuids.push(opt.calendarId);
}
if(opt.date){
var curDate = this.GLOBALUTIL.moment().fomat("YYYY-MM-DD")
var dt = opt.date.split(" ")[0]
if(dt < curDate ){
flag = true
}
}
})
if(timetableUuids.length == 0){
this.$refs.popup.open({
type:'err',
......@@ -229,6 +263,15 @@
});
return
}
if(flag){
this.$refs.popup.open({
type:'err',
content:'已过期的时间不可预约',
timeout:1000,
isClick:false
});
return
}
var body = {
"openLab": this.settingData.labUuid,
"openProject": {},
......
......@@ -3,7 +3,7 @@
<MescrollBody 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" >
<view class="ori" style="height:300upx;border-bottom: 1px solid #EEEEEE;">
<view class="ori" style="height:300upx;border-bottom: 1px solid #EEEEEE;padding-left: 20upx;">
<image mode="scaleToFill" class="cover" src="../../static/lab-share/cover.jpg" />
<view style="flex-direction: column;">
<view>
......@@ -39,8 +39,11 @@
<text class="detail">审核状态:</text>
<text class="detail">{{news.statusName}}</text>
</view>
<view class="signin" hover-class="hover" @click="signIn(news)">
<text class="detail" style="color:#ffffff">签到</text>
<view v-if="news.signIn" class="signed" hover-class="hover">
<text class="detail" style="color:#898989">已签到</text>
</view>
<view v-if="!news.signIn" class="signin" hover-class="hover" @click="signIn(news)">
<text class="detail" style="color:#ffffff">已签到</text>
</view>
</view>
</view>
......@@ -66,7 +69,8 @@
upOption: {
use: false, // 是否启用上拉加载; 默认true
},
submitShow:false
submitShow:false,
curSign:""
}
},
methods: {
......@@ -94,6 +98,7 @@
method: 'GET',
header: this.GLOBALUTIL.commonHeader,
success: (res) => {
console.log(res)
var finalData = res.data.data;
finalData.map((opt)=>{
opt.labName = opt.labInfo == null?"":opt.labInfo.name
......@@ -114,6 +119,8 @@
})
},
signIn(data) {
console.log(data)
this.curSign = data;
this.submitShow = true;
},
cancel:function(){
......@@ -122,14 +129,12 @@
onSubmitClick(){
this.submitShow = false;
uni.request({
url: '',
url:this.GLOBALUTIL.url +'/openlab/v2/signIn/'+this.curSign.id,
method: 'GET',
data: {},
header: this.GLOBALUTIL.commonHeader,
success: res => {
console.log(res)
},
fail: () => {},
complete: () => {}
});
this.$refs.popup.open({
type:'success',
......@@ -137,6 +142,7 @@
timeout:1000,
isClick:false
});
this.loadData();
}
},
components: {
......@@ -161,13 +167,6 @@
margin-top:30rpx;
}
.news-li .new-content {
font-size: 28upx;
margin-top: 10upx;
margin-left: 20upx;
color: #666;
}
.icon {
width: 20rpx;
height: 20rpx;
......@@ -267,4 +266,14 @@
align-items: center;
margin-right: 40upx;
}
.signed {
width:200upx;
height:60upx;
background-color: #f5f5f5;
display: flex;
justify-content: center;
align-items: center;
margin-right: 40upx;
}
</style>
......@@ -30,10 +30,29 @@
var that = this
uni.$on('rectificationListData', function(data) {
var detailData = data[0]
that.roomName = JSON.parse(detailData.room).name
console.log(detailData.room)
if(that.isJSON(detailData.room)){
that.roomName =JSON.parse(detailData.room).name
}else{
that.roomName = detailData.room
}
that.description = detailData.description;
that.detailData = detailData;
that.imgUrl = JSON.parse(detailData.images)
// that.imgUrl = JSON.parse(detailData.images)
uni.request({
url: that.GLOBALUTIL.url+'/basis/attachments/fileInfos?belongId='+that.detailData.id,
method: 'GET',
header:that.GLOBALUTIL.commonHeader,
success: res => {
if(res.statusCode == 200){
var data = res.data;
var url = data.map((opt)=>{
return that.GLOBALUTIL.url+"/basis/attachments/files/preview/"+opt.id+"?token="+that.GLOBALUTIL.commonHeader["x-auth-token"]
})
that.imgUrl = url;
}
},
});
that.$forceUpdate();
})
},
......@@ -54,8 +73,27 @@
uni.navigateTo({
url: "../Security-Check/index?mod=put"
})
setTimeout(()=>{
uni.$emit("rectificationEdit", [this.detailData])
},300)
},
isJSON(str) {
if (typeof str == 'string') {
try {
var obj=JSON.parse(str);
if(typeof obj == 'object' && obj ){
return true;
}else{
return false;
}
} catch(e) {
// console.log('error:'+str+'!!!'+e);
return false;
}
}
// console.log('It is not a string!')
}
}
}
</script>
......
......@@ -205,10 +205,13 @@
}
},
goDetail(data) {
console.log(data)
uni.navigateTo({
url: "./detail"
})
setTimeout(()=>{
uni.$emit("rectificationListData", [data])
},300)
},
showStatusPicker() {
this.curType = "status"
......
<template>
<view class="content">
<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" hover-class="hover" @click="showAddressSel">
<text class="location">{{address}}</text>
<image class="tip" src="../../static/common/arrow_right_gray.png">
......@@ -60,6 +60,7 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
submitMethod:"POST",
baseBody:{},
submitShow:false,
dataId:''
}
},
......@@ -68,14 +69,17 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
this.submitMethod = "PUT"
}
var that = this;
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;
this.dataId = this.GLOBALUTIL.guid2();
uni.$on('labEntitySave',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;
that.address = data[0].name
that.room = data[0];
})
uni.$on('safeReportData',function(data){
that.objectData = data[0]
......@@ -107,16 +111,10 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
})
},
onUnload(){
var that = this
uni.$off('addressSave',function(data){
that.GLOBALUTIL.addressSelectionTemp = [];
})
uni.$off('safeReportData',function(data){
})
uni.$off('rectificationEdit',function(data){
})
uni.$off('securitySubmitPicChange',function(data){
})
uni.$off('labEntitySave')
uni.$off('safeReportData')
uni.$off('rectificationEdit')
uni.$off('securitySubmitPicChange')
},
methods: {
showAddressSel(){
......@@ -124,13 +122,12 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
return
}
uni.navigateTo({
url:"../../components/address-select/index?maxLevel=4"
url:"../../components/lab-select/index?experimentCenterId="+this.objectData.id
})
},
onclick: function() {
console.log(this.textvalue)
this.showActionSheet = true;
},
onPhotoClick:function(index){
uni.navigateTo({
......@@ -145,7 +142,8 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
"check_item_id":this.checkitem.id,
"check_list_id":this.checkitem.check_list_id,
"check_task_id":this.taskId,
"images":JSON.stringify(this.images),
// "images":JSON.stringify(this.images),
"id":this.dataId,
"place":this.objectData.name,
"description":this.description,
"room":JSON.stringify(this.room)
......@@ -219,17 +217,24 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
}
});
uni.uploadFile({
url: this.GLOBALUTIL.url+'/safety/v1/file/image',
url: this.GLOBALUTIL.url+'/basis/attachments/files',
files:imgs,
filePath:imgPath[0],
name:"file",
header: {
formData: {
'belongId': this.dataId
},
header:{
"x-auth-token":this.GLOBALUTIL.commonHeader["x-auth-token"],
// 'Content-Type': 'multipart/form-data',
},
success: (res) => {
var uri = JSON.parse(res.data).data;
that.images.push(uri);
// var uri = JSON.parse(res.data).data;
console.log(res)
console.log(JSON.stringify(res))
imgPath.map((opt)=>{
that.images.push(opt)
})
}
})
},
......
......@@ -33,12 +33,13 @@
<image class="tip" src="../../static/common/arrow_right_gray.png">
</view>
</view>
<view class="item" hover-class="hover" @click="showAddressSel">
<view class="item">
<text class="title" style="margin-top: 30rpx;">位置</text>
<view class="selcontent">
<input style="margin-top:10rpx;" v-model="address" focus placeholder="请输入位置" />
<!-- <view class="selcontent">
<text class="datacontent">{{address}}</text>
<image class="tip" src="../../static/common/arrow_right_gray.png">
</view>
</view> -->
</view>
<view style="margin-top: 20px;">
<text class="title">整改项详情</text>
......@@ -114,11 +115,12 @@ import FormAlert from "@/components/form-alert/h-form-alert.vue"
description:"",
room:{},
submitShow:false,
dataId:''
}
},
onLoad() {
var that = this;
this.dataId = this.GLOBALUTIL.guid2();
uni.$on('addressSave',function(data){
var roomData = {};
roomData.code = that.GLOBALUTIL.addressSelectionTemp[3].code;
......@@ -163,9 +165,10 @@ import FormAlert from "@/components/form-alert/h-form-alert.vue"
"check_item_id":this.curItem.value,
"check_list_id":this.curItemType.value,
"check_task_id":this.curTask.value,
"images":JSON.stringify(this.images),
// "images":JSON.stringify(this.images),
"id":this.dataId,
"description":this.description,
"room":JSON.stringify(this.room)
"room":this.address//JSON.stringify(this.room)
}
console.log(JSON.stringify(body))
// console.log(this.GLOBALUTIL.url)
......@@ -231,19 +234,24 @@ import FormAlert from "@/components/form-alert/h-form-alert.vue"
}
});
uni.uploadFile({
url: this.GLOBALUTIL.url+'/safety/v1/file/image',
url: this.GLOBALUTIL.url+'/basis/attachments/files',
files:imgs,
filePath:imgPath[0],
name:"file",
header: {
'user' : JSON.stringify(user),
'Content-Type': 'multipart/form-data',
formData: {
'belongId': this.dataId
},
header:{
"x-auth-token":this.GLOBALUTIL.commonHeader["x-auth-token"],
// 'Content-Type': 'multipart/form-data',
},
success: (res) => {
var uri = JSON.parse(res.data).data;
console.log(uri)
// var uri = JSON.parse(res.data).data;
console.log(res)
console.log(JSON.stringify(res))
that.images.push(uri);
imgPath.map((opt)=>{
that.images.push(opt)
})
}
})
},
......
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