From 3dadf7ce4eede2f5f8cc5dd772e1a12f20f0fae5 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: Sun, 3 May 2020 22:13:27 +0800
Subject: [PATCH 1/5] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E5=B7=A1=E6=A3=80?=
=?UTF-8?q?=E8=BF=87=E7=A8=8B=E5=92=8C=E6=89=A7=E8=A1=8C=E5=B7=A1=E6=A3=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages.json | 8 +-
pages/excuteInspection/excuteInspection.vue | 8 +-
.../excuteOneInspection.vue | 111 ++++++++++++++++++
3 files changed, 125 insertions(+), 2 deletions(-)
create mode 100644 pages/excuteOneInspection/excuteOneInspection.vue
diff --git a/pages.json b/pages.json
index f7b5173..6b5734e 100644
--- a/pages.json
+++ b/pages.json
@@ -149,7 +149,13 @@
,{
"path" : "pages/excuteInspection/excuteInspection",
"style" : {
- "navigationBarTitleText": "执行巡检"
+ "navigationBarTitleText": "巡检过程"
+ }
+ }
+ ,{
+ "path" : "pages/excuteOneInspection/excuteOneInspection",
+ "style" : {
+ "navigationBarTitleText": "执行巡检"
}
}
],
diff --git a/pages/excuteInspection/excuteInspection.vue b/pages/excuteInspection/excuteInspection.vue
index f14efb1..6bb77ca 100644
--- a/pages/excuteInspection/excuteInspection.vue
+++ b/pages/excuteInspection/excuteInspection.vue
@@ -8,7 +8,7 @@
{{item.inspectionName}}
-
@@ -67,6 +67,12 @@
ScrollSteps() {
this.scroll= this.scroll == 9 ? 0 : this.scroll + 1
+ },
+ _excuteInspection:function(_item){
+ console.log('巡检点',_item);
+ uni.navigateTo({
+ url:'/pages/excuteOneInspection/excuteOneInspection?taskDetailId='+_item.taskDetailId+"&taskId="+_item.taskId+"&inspectionId="+_item.inspectionId+"&inspectionName="+_item.inspectionName
+ });
}
}
}
diff --git a/pages/excuteOneInspection/excuteOneInspection.vue b/pages/excuteOneInspection/excuteOneInspection.vue
new file mode 100644
index 0000000..36181bd
--- /dev/null
+++ b/pages/excuteOneInspection/excuteOneInspection.vue
@@ -0,0 +1,111 @@
+
+
+ {{inspectionName}}巡检
+
+
+
+ 提交
+
+
+
+
+
+
+
+
From 7b1205aad33dde647862790361c24b092b3f2b46 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: Sun, 3 May 2020 23:23:34 +0800
Subject: [PATCH 2/5] =?UTF-8?q?=E5=B7=A1=E6=A3=80=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E6=89=8B=E6=9C=BA=E7=AB=AF=E5=9F=BA=E6=9C=AC=E5=BC=80=E5=8F=91?=
=?UTF-8?q?=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../excuteOneInspection.vue | 124 ++++++++++++++++--
1 file changed, 116 insertions(+), 8 deletions(-)
diff --git a/pages/excuteOneInspection/excuteOneInspection.vue b/pages/excuteOneInspection/excuteOneInspection.vue
index 36181bd..8c044aa 100644
--- a/pages/excuteOneInspection/excuteOneInspection.vue
+++ b/pages/excuteOneInspection/excuteOneInspection.vue
@@ -19,19 +19,19 @@
巡检图片
- {{imgList.length}}/4
+ {{photoList.length}}/4
-
-
-
-
+
+
+
+
-
-
+
+
@@ -59,7 +59,11 @@
description:'',
photos:[],
imgList:[],
- patrolIndex:0
+ photoList:[],
+ patrolIndex:0,
+ communityId:'',
+ userId:'',
+ userName:''
}
},
onLoad(option) {
@@ -67,12 +71,35 @@
this.taskId = option.taskId;
this.inspectionId = option.inspectionId;
this.inspectionName = option.inspectionName;
+
+ this.communityId = this.java110Context.getCurrentCommunity().communityId;
+ let _userInfo = this.java110Context.getUserInfo();
+ this.userName = _userInfo.userName;
+ this.userId = _userInfo.userId;
},
methods: {
patrolChange:function(e){
this.patrolTypeName = this.patrols[e.detail.value];
this.patrolType = this.patrolTypes[e.detail.value];
},
+ afterRead: function(event) {
+ const {
+ file
+ } = event.detail;
+
+ let _that = this;
+
+ const {
+ photoList = []
+ } = this;
+ photoList.push(file);
+ this.photoList = photoList;
+
+ factory.base64.urlTobase64(file.path).then(function(_baseInfo) {
+ _that.photos.push(_baseInfo);
+ });
+ console.log("data信息:", this);
+ },
ChooseImage: function(e) {
let that = this;
wx.chooseImage({
@@ -94,6 +121,87 @@
let imageArr = this.$data.photoList;
imageArr.splice(e, 1);
},
+ submitExcuteInspection: function() {
+ /**
+ * taskId:'',
+ taskDetailId:'',
+ inspectionId:'',
+ inspectionName:'',
+ */
+ let obj = {
+ "taskId": this.taskId,
+ "taskDetailId": this.taskDetailId,
+ "inspectionId": this.inspectionId,
+ "inspectionName": this.inspectionName,
+ "communityId": this.communityId,
+ "patrolType":this.patrolType,
+ "description":this.description,
+ "photos": [],
+ "userId": this.userId,
+ "userName": this.userName
+ }
+
+ let _photos = this.photos;
+ _photos.forEach(function(_item) {
+ obj.photos.push({
+ "photo": _item
+ });
+ });
+
+ let msg = "";
+ if (obj.taskId == "") {
+ msg = "数据异常,巡检任务为空";
+ } else if (obj.taskDetailId == "") {
+ msg = "数据异常,巡检任务详情为空";
+ } else if (obj.inspectionId == "") {
+ msg = "巡检点不能为空";
+ } else if (obj.inspectionName == "") {
+ msg = "巡检点名称不能为空";
+ } else if (obj.patrolType == "") {
+ msg = "巡检情况不能为空";
+ } else if (obj.description == "") {
+ msg = "巡检说明不能为空";
+ } else if (obj.userId == "") {
+ msg = "数据异常,巡检人为空";
+ }
+ console.log(obj);
+
+ if (msg != "") {
+ wx.showToast({
+ title: msg,
+ icon: 'none',
+ duration: 2000
+ });
+ } else {
+ context.request({
+ url: constant.url.saveOwnerRepair, // http://hc.demo.winqi.cn:8012/appApi/ownerRepair.saveOwnerRepair
+ header: context.getHeaders(),
+ method: "POST",
+ data: obj, //动态数据
+ success: function(res) {
+ if (res.statusCode == 200) {
+ uni.navigateBack({
+ delta:1
+ })
+ return;
+ }
+ wx.showToast({
+ title: "服务器异常了",
+ icon: 'none',
+ duration: 2000
+ })
+ },
+ fail: function(e) {
+ wx.showToast({
+ title: "服务器异常了",
+ icon: 'none',
+ duration: 2000
+ })
+ }
+ });
+
+ }
+ },
}
}
From cc4ffcb2596649d2041318786f6ef30ab6a4150b Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: Sun, 3 May 2020 23:36:16 +0800
Subject: [PATCH 3/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A6=96=E9=A1=B5?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../excuteOneInspection/excuteOneInspection.vue | 10 +++++-----
pages/index/index.vue | 17 ++++++++++++++++-
2 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/pages/excuteOneInspection/excuteOneInspection.vue b/pages/excuteOneInspection/excuteOneInspection.vue
index 8c044aa..966309a 100644
--- a/pages/excuteOneInspection/excuteOneInspection.vue
+++ b/pages/excuteOneInspection/excuteOneInspection.vue
@@ -38,7 +38,7 @@
- 提交
+ 提交
@@ -121,7 +121,7 @@
let imageArr = this.$data.photoList;
imageArr.splice(e, 1);
},
- submitExcuteInspection: function() {
+ _submitExcuteInspection: function() {
/**
* taskId:'',
taskDetailId:'',
@@ -173,9 +173,9 @@
duration: 2000
});
} else {
- context.request({
- url: constant.url.saveOwnerRepair, // http://hc.demo.winqi.cn:8012/appApi/ownerRepair.saveOwnerRepair
- header: context.getHeaders(),
+ this.java110Context.request({
+ url: this.java110Constant.url.saveOwnerRepair, // http://hc.demo.winqi.cn:8012/appApi/ownerRepair.saveOwnerRepair
+ header: this.java110Context.getHeaders(),
method: "POST",
data: obj, //动态数据
success: function(res) {
diff --git a/pages/index/index.vue b/pages/index/index.vue
index ce6434a..5e99ede 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -27,7 +27,8 @@
- 小区文化
+
+ 小区文化
@@ -54,6 +55,9 @@
+
+ java110团队提供技术支持,交流群827669685
+
@@ -347,4 +351,15 @@
.notice-startTime {
margin-left: 16upx;
}
+
+ .bock-icon{
+ height: 34upx;
+ width: 14upx;
+ line-height: 100upx;
+ background-color: #00AA00;
+ }
+
+ .tec-height{
+ height: 120upx;
+ }
From bd7cf76402ce7666a0bd2c8df95d0afdc13fd491 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: Mon, 4 May 2020 23:01:19 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B7=A1=E6=A3=80?=
=?UTF-8?q?=E5=9B=BE=E7=89=87=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
constant/UrlConstant.js | 6 +-
factory/Base64Factory.js | 121 ++++++++++++------
pages/excuteInspection/excuteInspection.vue | 42 +++++-
.../excuteOneInspection.vue | 64 ++++-----
4 files changed, 162 insertions(+), 71 deletions(-)
diff --git a/constant/UrlConstant.js b/constant/UrlConstant.js
index 6a725af..bd59b9e 100644
--- a/constant/UrlConstant.js
+++ b/constant/UrlConstant.js
@@ -64,6 +64,9 @@ const listInspectionTasks = baseUrl + "app/inspectionTask.listInspectionTasks";
//巡检任务详情
const listInspectionTaskDetails = baseUrl + 'app/inspectionTaskDetail.listInspectionTaskDetails';
+//巡检
+const updateInspectionTaskDetail = baseUrl + 'app/inspectionTaskDetail.updateInspectionTaskDetail'
+
module.exports = {
baseUrl: baseUrl,
@@ -96,5 +99,6 @@ module.exports = {
listAdvertPhoto: listAdvertPhoto,
saveOwnerRepair:saveOwnerRepair,
listInspectionTasks:listInspectionTasks,
- listInspectionTaskDetails:listInspectionTaskDetails
+ listInspectionTaskDetails:listInspectionTaskDetails,
+ updateInspectionTaskDetail:updateInspectionTaskDetail
};
\ No newline at end of file
diff --git a/factory/Base64Factory.js b/factory/Base64Factory.js
index c7852b5..bd6211c 100644
--- a/factory/Base64Factory.js
+++ b/factory/Base64Factory.js
@@ -4,43 +4,92 @@
* add by wuxw 2020-01-01 美丽的夏都西宁
*/
class Base64Factory {
- constructor() {}
+ constructor() {}
- static urlTobase64(url) {
- return new Promise((resolve, reject) => {
- uni.request({
- url: url,
- method:'GET',
- responseType: 'arraybuffer',
- success: ress => {
- let base64 = wx.arrayBufferToBase64(ress.data); //把arraybuffer转成base64
- base64 = 'data:image/jpeg;base64,' + base64 //不加上这串字符,在页面无法显示的哦
- console.log(base64);
- resolve(base64);
- },
- fail: function (e) {
- console.log(e);
- reject(e);
- }
- });
- /* wx.getFileSystemManager().readFile({
- filePath: url,
- //选择图片返回的相对路径
- encoding: 'base64',
- //编码格式
- success: res => {
- //成功的回调
- //console.log('data:image/png;base64,' + res.data);
- let base64 = 'data:image/png;base64,' + res.data;
- resolve(base64);
- },
- fail: function (e) {
- console.log(e);
- reject(e);
- }
- }); */
- });
- }
+ static getLocalFilePath(path) {
+ if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path.indexOf(
+ '_downloads') === 0) {
+ return path
+ }
+ if (path.indexOf('file://') === 0) {
+ return path
+ }
+ if (path.indexOf('/storage/emulated/0/') === 0) {
+ return path
+ }
+ if (path.indexOf('/') === 0) {
+ var localFilePath = plus.io.convertAbsoluteFileSystem(path)
+ if (localFilePath !== path) {
+ return localFilePath
+ } else {
+ path = path.substr(1)
+ }
+ }
+ return '_www/' + path
+ }
+
+ static urlTobase64(url) {
+ //url = Base64Factory.getLocalFilePath(url);
+
+ return new Promise((resolve, reject) => {
+ console.log('url', url);
+ // #ifdef H5
+ let imgData;
+ let reader = new FileReader();
+ getImageBlob(url, function(blob) {
+ reader.readAsDataURL(blob);
+ });
+ reader.onload = function(e) {
+ imgData = e.target.result;
+ resolve(imgData);
+ };
+
+ function getImageBlob(_url, cb) {
+ let xhr = new XMLHttpRequest();
+ xhr.open("get", _url, true);
+ xhr.responseType = "blob";
+ xhr.onload = function() {
+ if (this.status == 200) {
+ if (cb) cb(this.response);
+ }
+ };
+ xhr.send();
+ }
+ // #endif
+ // #ifdef APP-PLUS
+ let _imageBase64List = '';
+ plus.io.resolveLocalFileSystemURL(url,
+ function(entry) {
+ // 可通过entry对象操作test.html文件
+ entry.file(function(file) {
+ var fileReader = new plus.io.FileReader();
+ fileReader.readAsDataURL(file);
+ fileReader.onloadend = function(evt) {
+ _imageBase64List = _imageBase64List.concat(evt.target.result);
+ resolve(_imageBase64List);
+ }
+ })
+ });
+ // #endif
+
+ // #ifdef MP-WEIXIN
+ wx.getFileSystemManager().readFile({
+ filePath: url, //选择图片返回的相对路径
+ encoding: 'base64', //编码格式
+ success: res => { //成功的回调
+ //console.log('data:image/png;base64,' + res.data);
+ let base64 = 'data:image/png;base64,' + res.data;
+ resolve(base64);
+ },
+ fail: function(e) {
+ console.log(e);
+ reject(e);
+ }
+ })
+ // #endif
+ });
+
+ }
}
diff --git a/pages/excuteInspection/excuteInspection.vue b/pages/excuteInspection/excuteInspection.vue
index 6bb77ca..f041883 100644
--- a/pages/excuteInspection/excuteInspection.vue
+++ b/pages/excuteInspection/excuteInspection.vue
@@ -11,9 +11,26 @@
巡检
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -27,7 +44,9 @@
communityId:'',
userId:'',
userName:'',
- taskDetails:[]
+ taskDetails:[],
+ viewImage:false,
+ viewImageSrc:''
}
},
@@ -38,6 +57,9 @@
let _userInfo = this.java110Context.getUserInfo();
this.userName = _userInfo.userName;
this.userId = _userInfo.userId;
+
+ },
+ onShow() {
this._queryTaskDetail();
},
methods: {
@@ -60,7 +82,16 @@
// res.data.inspectionTaskDetails.forEach(function(item, index) {
// item.timeStr = item.planInsTime.replace(/:\d{1,2}$/, ' ');
// });
- _that.taskDetails = res.data.inspectionTaskDetails;
+ let _inspectionTaskDetails = res.data.inspectionTaskDetails;
+ _inspectionTaskDetails.forEach(function(_item){
+ if(_item.state == '20200407'){
+ _item.photos.forEach(function(_photoTmp) {
+ _photoTmp.url = _that.java110Constant.url.hcBaseUrl + _photoTmp.url;
+ });
+ }
+
+ })
+ _that.taskDetails = _inspectionTaskDetails;
}
});
},
@@ -73,6 +104,13 @@
uni.navigateTo({
url:'/pages/excuteOneInspection/excuteOneInspection?taskDetailId='+_item.taskDetailId+"&taskId="+_item.taskId+"&inspectionId="+_item.inspectionId+"&inspectionName="+_item.inspectionName
});
+ },
+ preview: function(_src) {
+ this.viewImage = true;
+ this.viewImageSrc = _src;
+ },
+ closeViewImage: function() {
+ this.viewImage = false;
}
}
}
diff --git a/pages/excuteOneInspection/excuteOneInspection.vue b/pages/excuteOneInspection/excuteOneInspection.vue
index 966309a..1dd4b23 100644
--- a/pages/excuteOneInspection/excuteOneInspection.vue
+++ b/pages/excuteOneInspection/excuteOneInspection.vue
@@ -19,18 +19,18 @@
巡检图片
- {{photoList.length}}/4
+ {{imgList.length}}/4
-
-
+
+
-
+
@@ -59,7 +59,6 @@
description:'',
photos:[],
imgList:[],
- photoList:[],
patrolIndex:0,
communityId:'',
userId:'',
@@ -82,23 +81,27 @@
this.patrolTypeName = this.patrols[e.detail.value];
this.patrolType = this.patrolTypes[e.detail.value];
},
- afterRead: function(event) {
- const {
- file
- } = event.detail;
-
- let _that = this;
-
- const {
- photoList = []
- } = this;
- photoList.push(file);
- this.photoList = photoList;
-
- factory.base64.urlTobase64(file.path).then(function(_baseInfo) {
- _that.photos.push(_baseInfo);
+ removePhoto: function(e) {
+ console.log(e.detail.index);
+ let _imgList = [];
+ this.imgList.forEach(function(item, index) {
+ if (index != e.detail.index) {
+ _imgList.push(item);
+ }
});
- console.log("data信息:", this);
+ let _photos = [];
+ this.photos.forEach(function(item, index) {
+ if (index != e.detail.index) {
+ _photos.push(item);
+ }
+ });
+ this.photos = _photos;
+ this.imgList = _imgList;
+ },
+ deleteImage: function(e) {
+ console.log(e);
+ let imageArr = this.$data.imgList;
+ imageArr.splice(e, 1);
},
ChooseImage: function(e) {
let that = this;
@@ -108,19 +111,16 @@
sourceType: ['album'], //从相册选择
success: (res) => {
console.log(res);
- if (that.$data.photoList.length) {
- that.$data.photoList.push(res.tempFilePaths[0]);
- } else {
- that.$data.photoList = res.tempFilePaths;
- }
+ that.$data.imgList.push(res.tempFilePaths[0]);
+ let _base64Photo = '';
+ that.java110Factory.base64.urlTobase64(res.tempFilePaths[0]).then(function(_res) {
+ _base64Photo = _res;
+ console.log('base64', _base64Photo);
+ that.photos.push(_base64Photo);
+ });
}
});
},
- removePhoto: function(e) {
- console.log(e);
- let imageArr = this.$data.photoList;
- imageArr.splice(e, 1);
- },
_submitExcuteInspection: function() {
/**
* taskId:'',
@@ -174,7 +174,7 @@
});
} else {
this.java110Context.request({
- url: this.java110Constant.url.saveOwnerRepair, // http://hc.demo.winqi.cn:8012/appApi/ownerRepair.saveOwnerRepair
+ url: this.java110Constant.url.updateInspectionTaskDetail, // http://hc.demo.winqi.cn:8012/appApi/ownerRepair.saveOwnerRepair
header: this.java110Context.getHeaders(),
method: "POST",
data: obj, //动态数据
From 693ec1b72b559c7c7ce410c792731c74bdbfa613 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: Tue, 5 May 2020 22:57:18 +0800
Subject: [PATCH 5/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B7=A1=E6=A3=80?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/excuteInspection/excuteInspection.vue | 3 +--
pages/inspection/inspection.vue | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/pages/excuteInspection/excuteInspection.vue b/pages/excuteInspection/excuteInspection.vue
index f041883..1c85333 100644
--- a/pages/excuteInspection/excuteInspection.vue
+++ b/pages/excuteInspection/excuteInspection.vue
@@ -73,8 +73,7 @@
data: {
communityId: _that.communityId,
page: 1,
- row: 100,
- taskId: _that.taskId
+ row: 100
},
success: function(res) {
// TODO 判断
diff --git a/pages/inspection/inspection.vue b/pages/inspection/inspection.vue
index b507ca0..0590384 100644
--- a/pages/inspection/inspection.vue
+++ b/pages/inspection/inspection.vue
@@ -70,7 +70,7 @@
page: 1,
row: 10,
planUserId: _that.userId,
- state: '20200405'
+
},
success: function(res) {
// TODO 判断