From 1d715a2fa6d104656ffc7e3c511e1afa06323fab Mon Sep 17 00:00:00 2001
From: lion <120344285@qq.com>
Date: Wed, 15 Jun 2022 11:34:44 +0800
Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=94=A8=E5=B7=A1=E6=9F=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.hbuilderx/launch.json | 4 +
main.js | 3 +
package.json | 3 +-
packageA/pages/generalList/generalList.vue | 226 ++++++++++-------
.../pages/generalPatrol/generalPatrol.vue | 228 +++++++++++-------
packageA/pages/generalPatrol/viewPatrol.vue | 198 ++++++++++++++-
.../pages/dailyInspection/dailyInspection.vue | 19 +-
packageB/pages/dailyList/dailyList.vue | 42 +++-
pages.json | 4 +-
utils/util.js | 5 +-
10 files changed, 542 insertions(+), 190 deletions(-)
diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json
index 81f13f4..ee5be77 100644
--- a/.hbuilderx/launch.json
+++ b/.hbuilderx/launch.json
@@ -2,6 +2,10 @@
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version": "0.0",
"configurations": [{
+ "app-plus" :
+ {
+ "launchtype" : "local"
+ },
"default" :
{
"launchtype" : "local"
diff --git a/main.js b/main.js
index 0d2e54c..3061066 100644
--- a/main.js
+++ b/main.js
@@ -27,3 +27,6 @@ import uView from "uview-ui";
Vue.use(uView);
import util from "@/utils/util";
Vue.prototype.util = util;
+
+import {VueJsonp} from 'vue-jsonp' //中间有忘记大括号出现install undefind问题
+Vue.use(VueJsonp)
diff --git a/package.json b/package.json
index bbd71fa..960f981 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,6 @@
{
"dependencies": {
- "uview-ui": "^1.8.4"
+ "uview-ui": "^1.8.4",
+ "vue-jsonp": "^2.0.0"
}
}
diff --git a/packageA/pages/generalList/generalList.vue b/packageA/pages/generalList/generalList.vue
index 6901162..a43cd50 100644
--- a/packageA/pages/generalList/generalList.vue
+++ b/packageA/pages/generalList/generalList.vue
@@ -8,40 +8,41 @@
:action-style="{color: '#fff'}">
-
-
-
-
-
- {{item.label}}
-
-
- 确定
-
-
-
-
-
+
-
+
+
+
+
+
+
+ {{item.label}}
+
+
+ 确定
+
+
+
+
+
-
-
+
+
问题类别:
- {{item.feedback_department.name}}
+ {{item.ask_type_detail.value}}
问题内容:
- {{item.created_at}}
+ {{item.ask_content_detail.value}}
@@ -51,38 +52,38 @@
{{item.feedback_department.name}}
-
+
描述:
-
+
{{item.content}}
-
-
+
@@ -97,12 +98,22 @@
background: {
backgroundColor: '#007AFF'
},
- mask: true,
+ mask: false,
+ loadStatus:"loadmore",
+ loadText:{
+ loadmore:"加载更多",
+ nomore:"已经到底了"
+ },
dataList: [],
thumb: "/static/img/location.png",
- currentPage: 0,
- customStyle: {
- marginLeft: '20px'
+ currentPage: 0,
+ lastPage:0,
+ editStyle:{
+ fontSize:'30rpx'
+ },
+ customStyle: {
+ marginLeft: '20px',
+ fontSize:'30rpx'
},
currentRole: "inspector", //前端用户角色:inspector巡查员,manager管理员,operator现场处置人员
value1Arr: [],
@@ -135,6 +146,10 @@
}
},
onReachBottom: function(e) {
+ if(this.currentPage>=this.lastPage){
+ this.loadStatus = "nomore"
+ return;
+ }
this.loadPage(this.currentPage + 1);
},
onPullDownRefresh: function(e) {
@@ -146,7 +161,15 @@
onLoad(options) {
this.loadPage(1);
},
- methods: {
+ methods: {
+ openmask(){
+ this.mask=true
+ // this.isPullDown(false);
+ },
+ closemask(){
+ this.mask=false
+ // this.isPullDown(true);
+ },
toChangeStatus: function(value) {
var jsonSearch = this.options3.filter(function(e) {
return e.value == value;
@@ -169,46 +192,19 @@
tagClick(index) {
this.options1[index].active = !this.options1[index].active;
},
- loadAreaList: function() {
- var that = this;
- that.options1 = [];
- this.util.request({
- api: 'worker/get-zones',
- utilSuccess: function(res) {
- for (var m of res) {
- that.options1.push({
- label: m.name,
- value: m.id,
- active: false
- });
- }
- },
- utilFail: function(res) {
- console.log(res)
- }
- });
- },
- toAssin: function(id) {
- uni.navigateTo({
- url: "../assign/assign?id=" + id
- })
- },
- toOperate: function(id) {
- uni.navigateTo({
- url: "../operate/operate?id=" + id
- })
- },
- add: function() {
- uni.navigateTo({
- url: "../addPatrol/addPatrol"
- })
+ toedit(id){
+ uni.navigateTo({
+ url:"../generalPatrol/generalPatrol?id="+id
+ })
},
+
todetail: function(id) {
uni.navigateTo({
- url: "../patrolInfo/info?id=" + id
+ url: "../generalPatrol/viewPatrol?id=" + id
})
- },
+ },
+
loadPage: function(page) {
uni.hideKeyboard()
var that = this;
@@ -218,16 +214,20 @@
customLoading: false,
data: {
page: page,
- page_size: 5,
+ page_size: 4,
keyword: that.keyword
},
utilSuccess: function(r) {
var res = r.data;
+ that.lastPage = r.last_page;
uni.stopPullDownRefresh(); // 服务器总条数 < 每页条数, 会将第一页的条数重新返回
-
- var hasNoMore = that.dataList.length < 5 && page > 1;
+ if(r.total<5){
+ that.loadStatus = "nomore";
+ }
+ var hasNoMore = that.dataList.length < 4 && page > 1;
if (hasNoMore || res.length == 0 && page > 1) {
- // 已加载到最后一页
+ // 已加载到最后一页
+ that.loadStatus = "nomore";
uni.showToast({
title: '已加载到最后一页',
icon: 'none'
@@ -243,7 +243,25 @@
dataList.push(...res);
}
for (var m of dataList) {
- m.created_at = m.created_at.split("T")[0]
+ m.created_at = m.created_at.split("T")[0]
+ switch(m.status){
+ case 1:
+ m.statusName = "已提交"
+ break
+ case 2:
+ m.statusName = "已复核"
+ break
+ case 3:
+ m.statusName = "已处理"
+ break
+ case 4:
+ m.statusName = "已办结"
+ break
+
+ default:
+
+ break;
+ }
}
console.log(dataList)
@@ -261,6 +279,44 @@
this.util.alert(res);
}
});
+ },
+ del(id){
+ var that = this;
+ uni.showModal({
+ title: '提示',
+ content: '是否确定删除?',
+ success(res) {
+ if(res.confirm){
+ that.util.request({
+ api: '/api/mobile/common-inspection/destroy',
+ customLoading: false,
+ method:"get",
+ data: {
+ id:id
+ },
+ utilSuccess: function(r) {
+ uni.showToast({
+ icon: "none",
+ title: "提交成功",
+ complete() {
+ that.loadPage(1)
+ },
+ duration: 2000
+ })
+ },
+ utilFail:function(r) {
+ this.util.alert(res);
+ },
+
+ })
+ }else if(res.cancel){
+
+ }
+ }
+
+
+
+ })
}
}
@@ -301,6 +357,12 @@
.search-wrap {
background: #007AFF;
padding: 20rpx;
+ }
+ .overflowmask{
+ overflow: hidden;
+ }
+ .loadmore{
+ padding:24rpx!important
}
.u-config-wrap {
diff --git a/packageA/pages/generalPatrol/generalPatrol.vue b/packageA/pages/generalPatrol/generalPatrol.vue
index 88bd2db..a1d203d 100644
--- a/packageA/pages/generalPatrol/generalPatrol.vue
+++ b/packageA/pages/generalPatrol/generalPatrol.vue
@@ -12,15 +12,15 @@
@confirm="confirmContent">
- 江苏省苏州市通园路66号
- 重新获取
+
+ 重新获取
@@ -33,17 +33,6 @@
提交
-
-
-
-
-
- 确认选择
-
-
-
@@ -55,14 +44,15 @@
token: ""
},
unitshow: false,
- showMap: false,
typeshow: false,
contentshow: false,
action: "",
location: {},
plist: [],
list: [],
- listUnit: [],
+ listUnit: [],
+ filesList:[],
+ infoId:"",
form: {
unitName: "",
ask_type_id: "",
@@ -95,27 +85,36 @@
}
}
},
- onLoad() {
+ onLoad(options) {
var that = this;
this.loadType({
'number': "general_type",
}, function(res) {
that.plist = res;
- });
+ });
+ if(options.id){
+ this.infoId = options.id;
+ this.showInfo(this.infoId);
+ }
this.action = this.util.HOST + "/api/mobile/upload-file";
this.otherData.token = uni.getStorageSync("userInfo_token").access_token;
this.loadUnit();
},
onReady() {
this.$refs.uForm.setRules(this.rules);
- this._mapContext = uni.createMapContext("map", this);
let that = this;
uni.getLocation({
type: "gcj02",
success(res) {
that.location = res;
that.form.latitude = res.latitude;
- that.form.longitude = res.longitude;
+ that.form.longitude = res.longitude;
+ const url = "https://apis.map.qq.com/ws/geocoder/v1/?key=EUQBZ-MJALU-WZFVR-2HFNW-TIK2K-TNBJI&location="+res.latitude+","+res.longitude+"&output=jsonp"
+ that.$jsonp(
+ url
+ ).then(re => {
+ that.form.address = re.result.formatted_addresses.recommend
+ })
}
})
uni.getSystemInfo({
@@ -126,26 +125,35 @@
})
},
- methods: {
+ methods: {
+ onprogress(res){
+ uni.showToast({
+ icon: "none",
+ title: "上传中",
+ duration: 2000
+ })
+ },
+ tosuccess(){
+ uni.showToast({
+ icon: "none",
+ title: "上传成功",
+ duration: 2000
+ })
+ },
toremove(index, lists, nam) {
console.log(lists);
let list = [];
- for (var m of lists) {
- list.push({
- upload_id: m.response.id
- })
- }
- this.form.files_list = list;
+ this.filesList.splice(index,1)
},
toupload(lists, name) {
console.log(lists)
let list = [];
- for (var m of lists) {
- list.push({
- upload_id: m.response.id
- })
+ for (var m of lists) {
+ if(m.response){
+ this.filesList.push(m)
+ }
}
- this.form.files_list = list;
+ // this.form.files_list = list;
},
confirmUnit(e) {
var that = this;
@@ -177,34 +185,97 @@
}
});
+ },
+ showInfo(id){
+ var that = this;
+ that.util.request({
+ api: '/api/mobile/common-inspection/show',
+ method: "get",
+ data: {
+ id:id
+ },
+ utilSuccess: function(result) {
+ that.form = result;
+ that.form.typeName = result.ask_type_detail.value;
+ that.form.contentName = result.ask_content_detail.value;
+ that.form.unitName = result.feedback_department.name
+ let _files = [];
+ for (var mod of result.common_inspection_files) {
+ let m = Object.assign({}, mod);
+ m.url = mod.files.url;
+ m.id = mod.files.id;
+ m.name = mod.files.original_name;
+ _files.push(m);
+ }
+ that.filesList = _files
+ // that.form.files_list = _upfiles;
+ },
+ utilFail: function(res) {
+ that.util.alert(res);
+ }
+ });
},
- toshowMap() {
- this.showMap = true;
- this.addMaker();
- },
+
submit() {
- let that = this;
+ let that = this;
+ let list = [];
+ for(var mod of that.filesList){
+ if( mod.response){
+ list.push({
+ upload_id: mod.response.id
+ })
+ }else{
+ list.push({
+ upload_id:mod.id
+ })
+ }
+ }
+ this.form.files_list = list
+ // console.log(that.form);
+ // return;
this.$refs.uForm.validate(valid => {
if (valid) {
- console.log('验证通过');
- that.util.request({
- api: '/api/mobile/common-inspection/store',
- method: "POST",
- data: that.form,
- utilSuccess: function(res) {
- uni.showToast({
- icon: "none",
- title: "提交成功",
- complete() {
- that.afterSubmit(res);
- },
- duration: 2000
- })
- },
- utilFail: function(res) {
- this.util.alert(res);
- }
- });
+ console.log('验证通过');
+ if(that.infoId){
+ that.util.request({
+ api: '/api/mobile/common-inspection/save',
+ method: "POST",
+ data: that.form,
+ utilSuccess: function(res) {
+ uni.showToast({
+ icon: "none",
+ title: "提交成功",
+ complete() {
+ that.afterSubmit(res);
+ },
+ duration: 2000
+ })
+ },
+ utilFail: function(res) {
+ this.util.alert(res);
+ }
+ });
+ }else{
+ that.util.request({
+ api: '/api/mobile/common-inspection/store',
+ method: "POST",
+ data: that.form,
+ utilSuccess: function(res) {
+ uni.showToast({
+ icon: "none",
+ title: "提交成功",
+ complete() {
+ that.afterSubmit(res);
+ },
+ duration: 2000
+ })
+ },
+ utilFail: function(res) {
+ this.util.alert(res);
+ }
+ });
+ }
+
} else {
console.log('验证失败');
}
@@ -222,41 +293,28 @@
this.loadType({
pid: e[0].value
}, function(res) {
- that.list = res;
+ that.list = res;
+ that.form.ask_content_id =""
+ that.form.contentName =""
})
},
confirmContent(e) {
this.form.ask_content_id = e[0].value
this.form.contentName = e[0].label
},
- addMaker() {
- let img = "../../../static/img/location.png"
- const marker = {
- id: 1,
- iconPath: img,
- width: 50,
- height: 50,
- label: {
- width: 50,
- height: 30,
- borderWidth: 1,
- borderRadius: 10,
- bgColor: '#ffffff'
- },
- latitude: this.location.latitude,
- longitude: this.location.longitude
- };
- this._mapContext.addMarkers({
- marker,
- clear: true,
- complete(res) {
- console.log('addMarkers', res)
- },
- fail(res) {
- console.log('fail', res)
- }
- });
- }
+
+ chooseLocation(e) { //打开地图选择位置
+ var that = this;
+ uni.chooseLocation({
+ longitude : that.form.longitude,
+ latitude : that.form.latitude,
+ success: res => {
+ that.form.address = res.name;
+ that.form.longitude = res.longitude;
+ that.form.latitude = res.latitude;
+ }
+ });
+ },
}
}
diff --git a/packageA/pages/generalPatrol/viewPatrol.vue b/packageA/pages/generalPatrol/viewPatrol.vue
index 02409e3..f86a288 100644
--- a/packageA/pages/generalPatrol/viewPatrol.vue
+++ b/packageA/pages/generalPatrol/viewPatrol.vue
@@ -1,8 +1,192 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+ 问题类型:
+
+
+ {{lists.ask_type_detail.value}}
+
+
+
+
+ 问题内容:
+
+
+ {{lists.ask_content_detail.value}}
+
+
+
+
+ 反馈科室:
+
+
+ {{lists.feedback_department.name}}
+
+
+
+
+ 位置:
+
+
+ {{lists.address}}
+
+
+
+
+ 描述:
+
+
+ {{lists.content}}
+
+
+
+
+ 现场图片:
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packageB/pages/dailyInspection/dailyInspection.vue b/packageB/pages/dailyInspection/dailyInspection.vue
index ef88ae8..6423c0b 100644
--- a/packageB/pages/dailyInspection/dailyInspection.vue
+++ b/packageB/pages/dailyInspection/dailyInspection.vue
@@ -13,7 +13,7 @@
@on-remove="function(index, lists, name) {return toremove(index, lists, name,'filesList')}">
-
+
@@ -102,7 +102,8 @@
address:"",
files_list:"",
deal_files_list:""
- },
+ },
+ qqmapsdk:"",
width: 300,
height: 300,
rules: {
@@ -133,8 +134,15 @@
geocode:true,
success(res) {
that.form.deal_latitude = res.latitude;
- that.form.deal_longitude = res.longitude;
- }
+ that.form.deal_longitude = res.longitude;
+ const url = "https://apis.map.qq.com/ws/geocoder/v1/?key=EUQBZ-MJALU-WZFVR-2HFNW-TIK2K-TNBJI&location="+res.latitude+","+res.longitude+"&output=jsonp"
+ that.$jsonp(
+ url
+ ).then(re => {
+ that.form.address = re.result.formatted_addresses.recommend
+ })
+ }
+
})
uni.getSystemInfo({
complete(res) {
@@ -202,6 +210,7 @@
that.form.status = that.normalstatus;
that.form.deal_latitude = "";
that.form.deal_longitude = "";
+ that.form.address = "";
}
let list = [];
let deallist=[];
diff --git a/packageB/pages/dailyList/dailyList.vue b/packageB/pages/dailyList/dailyList.vue
index c00d210..bdc46e8 100644
--- a/packageB/pages/dailyList/dailyList.vue
+++ b/packageB/pages/dailyList/dailyList.vue
@@ -13,9 +13,13 @@
-
+
+
+
- 项目状态:
+ 处理方式:
@@ -102,7 +106,9 @@
},
currentRole: "inspector", //前端用户角色:inspector巡查员,manager管理员,operator现场处置人员
proStatus: '',
- proStatusId: '',
+ proStatusId: '',
+ lzStatus: '',
+ lzStatusId: '',
keyword: "",
title: "",
prostatusList: [{
@@ -118,6 +124,20 @@
}, {
label: "不可现场处理",
value: 3
+ }],
+ lzstatusList: [{
+ label: "所有",
+ value: "",
+ id: ""
+ }, {
+ label: "已提交",
+ value: 1,
+ }, {
+ label: "已处理",
+ value: 2,
+ }, {
+ label: "未处理",
+ value: 3
}]
}
},
@@ -145,11 +165,11 @@
methods: {
openmask(){
this.mask=true
- this.isPullDown(false);
+ // this.isPullDown(false);
},
closemask(){
this.mask=false
- this.isPullDown(true);
+ // this.isPullDown(true);
},
toChangeStatus: function(value) {
for(var m of this.prostatusList){
@@ -159,6 +179,15 @@
}
this.loadPage(1);
this.$refs.uDropdown.close();
+ },
+ toChangelzStatus: function(value) {
+ for(var m of this.lzstatusList){
+ if(value == m.value){
+ this.lzStatus = m.label
+ }
+ }
+ this.loadPage(1);
+ this.$refs.lzuDropdown.close();
},
tosearch() {
@@ -186,7 +215,8 @@
page: page,
page_size: 5,
keyword: that.keyword,
- status:that.proStatusId
+ status:that.proStatusId,
+ lzstatus:that.lzStatusId
},
utilSuccess: function(r) {
diff --git a/pages.json b/pages.json
index e0f2f52..b193f4b 100644
--- a/pages.json
+++ b/pages.json
@@ -51,8 +51,8 @@
"path": "generalPatrol/viewPatrol",
"style": {
"navigationBarTitleText": "通用巡查",
- "enablePullDownRefresh": false,
- "navigationStyle": "custom"
+ "enablePullDownRefresh": false
+
}
}]
diff --git a/utils/util.js b/utils/util.js
index 96a5d47..acbdf05 100755
--- a/utils/util.js
+++ b/utils/util.js
@@ -529,7 +529,8 @@ var Base64 = {
return this.UTF8ToUTF16(res.join(''));
}
-};
+};
+
module.exports = {
HOST: HOST,
formatTime: formatTime,
@@ -552,6 +553,6 @@ module.exports = {
getUserProfile: getUserProfile,
getUserInfo: getUserInfo,
toast: toast,
- isValidCardID:isValidCardID
+ isValidCardID:isValidCardID,
};