xiaochengxurenwu
This commit is contained in:
parent
c006c0842d
commit
a374ecea1c
4
app.js
4
app.js
|
@ -97,8 +97,8 @@ App({
|
|||
perms:[],
|
||||
openid:null
|
||||
},
|
||||
serverUrl: 'https://safeyun.ctcshe.com/',
|
||||
// serverUrl: 'http://127.0.0.1:8000/',
|
||||
// serverUrl: 'https://safeyun.ctcshe.com/',
|
||||
serverUrl: 'http://127.0.0.1:8000/',
|
||||
//serverUrl: 'http://10.21.28.148:8000/',
|
||||
//serverUrl: 'http://192.168.0.103:8000/',
|
||||
//serverUrl:'http://10.0.11.195:8000/',
|
||||
|
|
|
@ -88,12 +88,34 @@ Page({
|
|||
wx.hideLoading();
|
||||
console.log(res.data);
|
||||
if (res.statusCode === 200) {
|
||||
var data = res.data
|
||||
//格式化观察信息
|
||||
var yhdata = res.data
|
||||
//格式化隐患信息
|
||||
for (var i = 0; i < yhdata.yhtp.length; i++) {
|
||||
yhdata.yhtp[i] = this.data.serverUrl + yhdata.yhtp[i];
|
||||
}
|
||||
for (var i = 0; i < yhdata.zghtp.length; i++) {
|
||||
yhdata.zghtp[i] = this.data.serverUrl + yhdata.zghtp[i];
|
||||
}
|
||||
|
||||
this.setData(data)
|
||||
this.setData(yhdata)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
yhtpPreview: function (e) {
|
||||
var current = e.target.dataset.src
|
||||
|
||||
wx.previewImage({
|
||||
current: current,
|
||||
urls: this.data.yhtp
|
||||
})
|
||||
},
|
||||
zghtpPreview: function (e) {
|
||||
var current = e.target.dataset.src
|
||||
|
||||
wx.previewImage({
|
||||
current: current,
|
||||
urls: this.data.zghtp
|
||||
})
|
||||
}
|
||||
})
|
|
@ -13,7 +13,7 @@
|
|||
<view>检查人</view>
|
||||
</view>
|
||||
<view class="weui-cell__ft">
|
||||
{{checkname__username}}
|
||||
{{checkname__name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_access">
|
||||
|
@ -34,12 +34,25 @@
|
|||
</view>
|
||||
<view class="weui-cell weui-cell_access">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view>检查发现问题</view>
|
||||
<view>检查问题</view>
|
||||
</view>
|
||||
<view class="weui-cell__ft" style="width:200px">
|
||||
{{checkquestion}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_access">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view>问题图片</view>
|
||||
<view class="weui-uploader__files">
|
||||
<block wx:for="{{yhtp}}" wx:for-item="image" wx:key="unique">
|
||||
<view class="weui-uploader__file">
|
||||
<image class="weui-uploader__img" src="{{image}}" data-src="{{image}}" bindtap="yhtpPreview"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="weui-cell weui-cell_access">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view>整改情况</view>
|
||||
|
@ -48,7 +61,18 @@
|
|||
{{zgjg}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="weui-cell weui-cell_access">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view>整改图片</view>
|
||||
<view class="weui-uploader__files">
|
||||
<block wx:for="{{zghtp}}" wx:for-item="image" wx:key="unique">
|
||||
<view class="weui-uploader__file">
|
||||
<image class="weui-uploader__img" src="{{image}}" data-src="{{image}}" bindtap="zghtpPreview"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_access">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view>检查状态</view>
|
||||
|
@ -67,7 +91,7 @@
|
|||
</view>
|
||||
<view class="weui-cell weui-cell_access">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view>处理意见</view>
|
||||
<view>经验教训</view>
|
||||
</view>
|
||||
<view class="weui-cell__ft" style="width:200px">
|
||||
{{content}}
|
||||
|
|
|
@ -10,7 +10,7 @@ Page({
|
|||
serverUrl: getApp().globalData.serverUrl,
|
||||
alllist: [],
|
||||
tabs: ["我的任务", "全部任务", "验收任务"],
|
||||
activeIndex: 1,
|
||||
activeIndex: 0,
|
||||
sliderOffset: 0,
|
||||
sliderLeft: 0
|
||||
},
|
||||
|
@ -235,7 +235,7 @@ Page({
|
|||
title: '加载中',
|
||||
}),
|
||||
wx.request({
|
||||
url: this.data.serverUrl + 'api/checkproject?a=listallx&rows=10&page=' + page,
|
||||
url: this.data.serverUrl + 'api/checkproject?a=wxlistall&rows=10&page=' + page,
|
||||
header: {
|
||||
'content-type': 'application/json', // 默认值
|
||||
'Cookie': getApp().globalData.sessionId,
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
var util = require('../../utils/util.js')
|
||||
// pages/observe/observedetail.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
|
@ -13,7 +12,11 @@ Page({
|
|||
{ name: '1', value: '正在整改中'},
|
||||
{ name: '2', value: '已整改完成' },
|
||||
|
||||
]
|
||||
],
|
||||
cjryname:"",
|
||||
cjry:"",
|
||||
yhtp1: [],
|
||||
zghtp1: [],
|
||||
},
|
||||
bindjcwtInput: function (e) {
|
||||
this.data.jcwt = e.detail.value
|
||||
|
@ -27,7 +30,140 @@ Page({
|
|||
radioChange: function (e) {
|
||||
this.data.jczt = e.detail.value
|
||||
},
|
||||
|
||||
deleteImage: function (e) {
|
||||
var that = this;
|
||||
var yhtp1 = that.data.yhtp1;
|
||||
var index = e.currentTarget.dataset.index; //获取当前长按图片下标
|
||||
wx.showModal({
|
||||
title: '系统提醒',
|
||||
content: '确定要删除此图片吗?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
yhtp1.splice(index, 1);
|
||||
} else if (res.cancel) {
|
||||
return false;
|
||||
}
|
||||
that.setData({
|
||||
yhtp1: yhtp1
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseImage: function () {
|
||||
var that = this
|
||||
wx.chooseImage({
|
||||
count: 9,
|
||||
sizeType: ['original', 'compressed'],
|
||||
sourceType: ['album', 'camera'],
|
||||
success: function (res) {
|
||||
console.log(that.data.yhtp1.concat(res.tempFilePaths))
|
||||
that.setData({
|
||||
yhtp1: that.data.yhtp1.concat(res.tempFilePaths)
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
previewImage: function (e) {
|
||||
var current = e.target.dataset.src
|
||||
wx.previewImage({
|
||||
current: current,
|
||||
urls: this.data.yhtp1
|
||||
})
|
||||
},
|
||||
//上传图片
|
||||
upimg:function(x,y){
|
||||
var that=this
|
||||
if(x<y){
|
||||
|
||||
wx.uploadFile({
|
||||
header: {
|
||||
'content-type': 'application/json', // 默认值
|
||||
'Cookie': getApp().globalData.sessionId,
|
||||
},
|
||||
url: that.data.serverUrl + 'upfile',
|
||||
filePath: that.data.yhtp1[x],
|
||||
name: 'upfile',
|
||||
success(res) {
|
||||
|
||||
var obj = JSON.parse(res.data);
|
||||
that.data.yhtp1[x] = obj['filepath']
|
||||
x = x + 1
|
||||
if(x<y){
|
||||
that.upimg(x, y)
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
deleteImages: function (e) {
|
||||
var that = this;
|
||||
var zghtp1 = that.data.zghtp1;
|
||||
var index = e.currentTarget.dataset.index; //获取当前长按图片下标
|
||||
wx.showModal({
|
||||
title: '系统提醒',
|
||||
content: '确定要删除此图片吗?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
zghtp1.splice(index, 1);
|
||||
} else if (res.cancel) {
|
||||
return false;
|
||||
}
|
||||
that.setData({
|
||||
zghtp1: zghtp1
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseImages: function () {
|
||||
var that = this
|
||||
wx.chooseImage({
|
||||
count: 9,
|
||||
sizeType: ['original', 'compressed'],
|
||||
sourceType: ['album', 'camera'],
|
||||
success: function (res) {
|
||||
console.log(that.data.zghtp1.concat(res.tempFilePaths))
|
||||
that.setData({
|
||||
zghtp1: that.data.zghtp1.concat(res.tempFilePaths)
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
previewImages: function (e) {
|
||||
var current = e.target.dataset.src
|
||||
wx.previewImage({
|
||||
current: current,
|
||||
urls: this.data.zghtp1
|
||||
})
|
||||
},
|
||||
//上传图片
|
||||
upimgs:function(x,y){
|
||||
var that=this
|
||||
if(x<y){
|
||||
|
||||
wx.uploadFile({
|
||||
header: {
|
||||
'content-type': 'application/json', // 默认值
|
||||
'Cookie': getApp().globalData.sessionId,
|
||||
},
|
||||
url: that.data.serverUrl + 'upfile',
|
||||
filePath: that.data.zghtp1[x],
|
||||
name: 'upfile',
|
||||
success(res) {
|
||||
|
||||
var obj = JSON.parse(res.data);
|
||||
that.data.zghtp1[x] = obj['filepath']
|
||||
x = x + 1
|
||||
if(x<y){
|
||||
that.upimgs(x, y)
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
submit: function () {
|
||||
|
||||
if (!this.data.jcwt) {
|
||||
|
@ -39,10 +175,12 @@ Page({
|
|||
else if (!this.data.jczt) {
|
||||
this.Tap1('请选择检查状态!')
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
this.addjob()
|
||||
|
||||
this.upimg(0, this.data.yhtp1.length)
|
||||
this.upimgs(0, this.data.zghtp1.length)
|
||||
|
||||
this.addjob()
|
||||
}
|
||||
},
|
||||
Tap1: function (x) {
|
||||
|
@ -53,6 +191,7 @@ Page({
|
|||
confirmText: "确定"
|
||||
})
|
||||
},
|
||||
|
||||
addjob: function () {
|
||||
|
||||
var jobdata = {
|
||||
|
@ -61,7 +200,8 @@ Page({
|
|||
content: this.data.cfnr,//处罚内容
|
||||
taskstate: this.data.jczt,//检查状态
|
||||
participant: this.data.cjry,//处罚人
|
||||
|
||||
yhtp1:this.data.yhtp1,//问题图片
|
||||
zghtp:this.data.zghtp1,//问题图片
|
||||
}
|
||||
console.log(jobdata)
|
||||
wx.showModal({
|
||||
|
@ -75,9 +215,9 @@ Page({
|
|||
title: '正在提交...',
|
||||
})
|
||||
wx.request({
|
||||
url: getApp().globalData.serverUrl + 'api/checkproject?a=addjobwx&jobid=' + this.data.jobid,
|
||||
url: getApp().globalData.serverUrl + 'api/checkproject?a=addjob&jobid=' + this.data.jobid,
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded', //
|
||||
'content-type': 'application/json', //
|
||||
'Cookie': getApp().globalData.sessionId,
|
||||
},
|
||||
method: 'POST',
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<view class="weui-cells__title">检查发现问题</view>
|
||||
<view class="weui-cells__title">检查问题</view>
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
<view class="weui-cell">
|
||||
<view class="weui-cell__bd">
|
||||
|
@ -54,6 +54,27 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cells__title">问题图片</view>
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
<view class="weui-cell">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view class="weui-uploader">
|
||||
<view class="weui-uploader__bd">
|
||||
<view class="weui-uploader__files">
|
||||
<block wx:for="{{yhtp1}}" wx:for-item="image" wx:key="unique">
|
||||
<view class="weui-uploader__file">
|
||||
<image class="weui-uploader__img" src="{{image}}" data-src="{{image}}" data-index="{{index}}" bindtap="previewImage" bindlongpress="deleteImage" data-index="{{index}}"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="weui-uploader__input-box">
|
||||
<view class="weui-uploader__input" bindtap="chooseImage"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cells__title">整改情况</view>
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
<view class="weui-cell">
|
||||
|
@ -62,7 +83,27 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="weui-cells__title">整改图片</view>
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
<view class="weui-cell">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view class="weui-uploader">
|
||||
<view class="weui-uploader__bd">
|
||||
<view class="weui-uploader__files">
|
||||
<block wx:for="{{zghtp1}}" wx:for-item="image" wx:key="unique">
|
||||
<view class="weui-uploader__file">
|
||||
<image class="weui-uploader__img" src="{{image}}" data-src="{{image}}" data-index="{{index}}" bindtap="previewImages" bindlongpress="deleteImages" data-index="{{index}}"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="weui-uploader__input-box">
|
||||
<view class="weui-uploader__input" bindtap="chooseImages"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="weui-cell weui-cell_access">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
|
@ -79,7 +120,7 @@
|
|||
|
||||
|
||||
|
||||
<view class="weui-cells__title">处罚内容</view>
|
||||
<view class="weui-cells__title">经验教训</view>
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
<view class="weui-cell">
|
||||
<view class="weui-cell__bd">
|
||||
|
@ -89,7 +130,7 @@
|
|||
</view>
|
||||
<view class="weui-cell weui-cell_select">
|
||||
<view class="weui-cell__hd weui-cell__hd_in-select-after">
|
||||
<view class="weui-label">被处罚人</view>
|
||||
<view class="weui-label">涉及人员</view>
|
||||
</view>
|
||||
<view class="weui-cell__bd">
|
||||
<navigator url="/pages/userSelect/userSelect">
|
||||
|
|
|
@ -110,10 +110,16 @@ Page({
|
|||
wx.hideLoading();
|
||||
console.log(res.data);
|
||||
if (res.statusCode === 200) {
|
||||
var data = res.data
|
||||
//格式化观察信息
|
||||
var yhdata = res.data
|
||||
//格式化隐患信息
|
||||
for (var i = 0; i < yhdata.yhtp.length; i++) {
|
||||
yhdata.yhtp[i] = this.data.serverUrl + yhdata.yhtp[i];
|
||||
}
|
||||
for (var i = 0; i < yhdata.zghtp.length; i++) {
|
||||
yhdata.zghtp[i] = this.data.serverUrl + yhdata.zghtp[i];
|
||||
}
|
||||
|
||||
this.setData(data)
|
||||
this.setData(yhdata)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -121,5 +127,20 @@ Page({
|
|||
|
||||
},
|
||||
|
||||
yhtpPreview: function (e) {
|
||||
var current = e.target.dataset.src
|
||||
|
||||
wx.previewImage({
|
||||
current: current,
|
||||
urls: this.data.yhtp
|
||||
})
|
||||
},
|
||||
zghtpPreview: function (e) {
|
||||
var current = e.target.dataset.src
|
||||
|
||||
wx.previewImage({
|
||||
current: current,
|
||||
urls: this.data.zghtp
|
||||
})
|
||||
}
|
||||
})
|
|
@ -17,7 +17,7 @@
|
|||
<view>检查人</view>
|
||||
</view>
|
||||
<view class="weui-cell__ft">
|
||||
{{checkname__username}}
|
||||
{{checkname__name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_access">
|
||||
|
@ -38,11 +38,23 @@
|
|||
</view>
|
||||
<view class="weui-cell weui-cell_access">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view>检查发现问题</view>
|
||||
<view>检查问题</view>
|
||||
</view>
|
||||
<view class="weui-cell__ft" style="width:200px">
|
||||
{{checkquestion}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_access">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view>问题图片</view>
|
||||
<view class="weui-uploader__files">
|
||||
<block wx:for="{{yhtp}}" wx:for-item="image" wx:key="unique">
|
||||
<view class="weui-uploader__file">
|
||||
<image class="weui-uploader__img" src="{{image}}" data-src="{{image}}" bindtap="yhtpPreview"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_access">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
|
@ -52,7 +64,18 @@
|
|||
{{zgjg}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="weui-cell weui-cell_access">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view>整改图片</view>
|
||||
<view class="weui-uploader__files">
|
||||
<block wx:for="{{zghtp}}" wx:for-item="image" wx:key="unique">
|
||||
<view class="weui-uploader__file">
|
||||
<image class="weui-uploader__img" src="{{image}}" data-src="{{image}}" bindtap="zghtpPreview"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_access">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view>检查状态</view>
|
||||
|
@ -71,7 +94,7 @@
|
|||
</view>
|
||||
<view class="weui-cell weui-cell_access">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view>处罚内容</view>
|
||||
<view>经验教训</view>
|
||||
</view>
|
||||
<view class="weui-cell__ft" style="width:200px">
|
||||
{{content}}
|
||||
|
@ -79,7 +102,7 @@
|
|||
</view>
|
||||
<view class="weui-cell weui-cell_access">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view>被处罚人员</view>
|
||||
<view>涉及人员</view>
|
||||
</view>
|
||||
<view class="weui-cell__ft" style="width:200px">
|
||||
{{bcfr==[]?'kkl':bcfr}}
|
||||
|
|
|
@ -47,7 +47,7 @@ Page({
|
|||
this.setData({
|
||||
itemscheck:res.items
|
||||
})
|
||||
console.log(itemscheck)
|
||||
|
||||
}
|
||||
wx.hideLoading();
|
||||
}
|
||||
|
|
|
@ -86,6 +86,7 @@ Page({
|
|||
sizeType: ['original', 'compressed'],
|
||||
sourceType: ['album', 'camera'],
|
||||
success: function (res) {
|
||||
console.log()
|
||||
that.setData({
|
||||
yhtp: that.data.yhtp.concat(res.tempFilePaths)
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue