From 75a390cb9ed6de55d4282122271fd28f8fef8457 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=88=98=E7=BF=94=E5=AE=87-=E6=97=85=E7=AE=A1=E5=AE=B6?=
<153298343@qq.com>
Date: Sun, 31 Jul 2022 23:01:08 +0800
Subject: [PATCH] up
---
order/order/order/order.vue | 223 +--
.../pages/generalPatrol/generalPatrol.vue | 21 +-
.../pages/dailyInspection/dailyInspection.vue | 195 +--
.../raininspection/raininspection.vue | 1453 +++++++++--------
rainmaintain/rainmaintain/rainmaintain.vue | 1052 ++++++------
road/road/road.vue | 28 +-
utils/util.js | 2 +-
7 files changed, 1530 insertions(+), 1444 deletions(-)
diff --git a/order/order/order/order.vue b/order/order/order/order.vue
index cf69a84..8136980 100644
--- a/order/order/order/order.vue
+++ b/order/order/order/order.vue
@@ -4,15 +4,15 @@
-
+
-
+
-
+
重新获取
@@ -20,44 +20,42 @@
-
+
-
+
{{item.name}}
-
+
{{item.name}}
-
+
-
+
@@ -75,44 +73,44 @@
otherData: {
token: ""
},
- depshow:false,
- depName:"",
- rainArr:{
- depList:[],
- rains:[{
- id:0,
- name:"否"
- },{
- id:1,
- name:"是"
+ depshow: false,
+ depName: "",
+ rainArr: {
+ depList: [],
+ rains: [{
+ id: 0,
+ name: "否"
+ }, {
+ id: 1,
+ name: "是"
}],
- scenes:[{
- id:0,
- name:"否"
- },{
- id:1,
- name:"是"
+ scenes: [{
+ id: 0,
+ name: "否"
+ }, {
+ id: 1,
+ name: "是"
}]
},
action: "",
- infoId:"",
-
- filesList:[],
- dealFilesList:[],
- changeResult:"",
- changedealFilesList:[],
+ infoId: "",
+
+ filesList: [],
+ dealFilesList: [],
+ changeResult: "",
+ changedealFilesList: [],
form: {
- feedback_department_id:"",
- name:"",
- content:"",
- status:0,
- is_rain:"",
- is_scene:"",
- tip:"",
- result:"",
- address:"",
- files_list:"",
- files_end_list:""
+ feedback_department_id: "",
+ name: "",
+ content: "",
+ status: 0,
+ is_rain: "",
+ is_scene: "",
+ tip: "",
+ result: "",
+ address: "",
+ files_list: "",
+ files_end_list: ""
},
width: 300,
height: 300,
@@ -134,12 +132,12 @@
},
onLoad(options) {
var that = this;
- if(options.id){
+ if (options.id) {
this.infoId = options.id;
this.showInfo(this.infoId);
}
this.loadDep();
-
+
this.action = this.util.HOST + "/api/mobile/upload-file";
this.otherData.token = uni.getStorageSync("userInfo_token").access_token;
},
@@ -148,17 +146,34 @@
let that = this;
uni.getLocation({
type: "gcj02",
- geocode:true,
+ geocode: true,
success(res) {
- const url = "https://apis.map.qq.com/ws/geocoder/v1/?key=EUQBZ-MJALU-WZFVR-2HFNW-TIK2K-TNBJI&location="+res.latitude+","+res.longitude+"&output=jsonp"
+ var loc = null
+ console.log(typeof(window.android))
+ if (typeof(window.android) != undefined && typeof(window.android) != "undefined") {
+ loc = window.android.getLocInfo();
+ }
+ let latitude = "";
+ let longitude = "";
+ if (loc) {
+ latitude = JSON.parse(loc).lat;
+ longitude = JSON.parse(loc).lon;
+ } else {
+ latitude = res.latitude;
+ longitude = res.longitude;
+ }
+
+ const url =
+ "https://apis.map.qq.com/ws/geocoder/v1/?key=EUQBZ-MJALU-WZFVR-2HFNW-TIK2K-TNBJI&location=" +
+ latitude + "," + longitude + "&output=jsonp"
that.$jsonp(
- url
- ).then(re => {
+ url
+ ).then(re => {
that.form.address = re.result.formatted_addresses.recommend
})
}
-
+
})
uni.getSystemInfo({
complete(res) {
@@ -169,13 +184,13 @@
},
methods: {
- loadDep(){
+ loadDep() {
var that = this
that.util.request({
api: '/api/mobile/other/department-list',
method: "get",
data: {
- is_tree:0
+ is_tree: 0
},
utilSuccess: function(res) {
that.rainArr.depList = res
@@ -185,41 +200,41 @@
}
});
},
- radioGroupChange(e){
- console.log(e)
- if(e==0){
+ radioGroupChange(e) {
+ console.log(e)
+ if (e == 0) {
this.form.result = "";
this.dealFilesList = [];
- }else{
+ } else {
this.form.result = this.changeResult;
this.dealFilesList = this.changedealFilesList;
}
},
- confirmDepType(val){
+ confirmDepType(val) {
var that = this
console.log(val)
that.form.feedback_department_id = val[0].value
that.depName = val[0].label
-
+
},
- toremove(index, lists, name,whatfile) {
- if(whatfile=="filesList"){
- this.filesList.splice(index,1)
+ toremove(index, lists, name, whatfile) {
+ if (whatfile == "filesList") {
+ this.filesList.splice(index, 1)
// this.form.files_list = list;
}
- if(whatfile=="dealFilesList"){
- this.dealFilesList.splice(index,1)
+ if (whatfile == "dealFilesList") {
+ this.dealFilesList.splice(index, 1)
// this.form.files_end_list = list;
}
},
- onprogress(res){
+ onprogress(res) {
uni.showToast({
icon: "none",
title: "上传中",
duration: 2000
})
},
- tosuccess(){
+ tosuccess() {
uni.showToast({
icon: "none",
title: "上传成功",
@@ -229,36 +244,36 @@
toupload(lists, name, whatfile) {
var that = this;
let list = [];
- if(whatfile=="filesList"){
+ if (whatfile == "filesList") {
that.filesList = lists
// this.form.files_list = list;
}
- if(whatfile=="dealFilesList"){
+ if (whatfile == "dealFilesList") {
that.dealFilesList = lists;
-
+
}
},
submit() {
let that = this;
let list = [];
- let deallist=[];
- for(var mod of that.filesList){
- if( mod.response){
+ let deallist = [];
+ for (var mod of that.filesList) {
+ if (mod.response) {
list.push({
upload_id: mod.response.id
})
- }else{
+ } else {
list.push({
- upload_id:mod.id
+ upload_id: mod.id
})
}
}
- for(var mod of that.dealFilesList){
- if( mod.response){
+ for (var mod of that.dealFilesList) {
+ if (mod.response) {
deallist.push({
upload_id: mod.response.id
})
- }else{
+ } else {
deallist.push({
upload_id: mod.id
})
@@ -268,13 +283,13 @@
that.form.files_end_list = deallist;
that.changeResult = that.form.result
that.changedealFilesList = that.deallist
- console.log("form",that.form)
+ console.log("form", that.form)
// return;
// return;
this.$refs.uForm.validate(valid => {
if (valid) {
console.log('验证通过');
- if(that.infoId){
+ if (that.infoId) {
that.util.request({
api: '/api/mobile/mobile-worksheet/save',
method: "POST",
@@ -293,7 +308,7 @@
that.util.alert(res);
}
});
- }else{
+ } else {
that.util.request({
api: '/api/mobile/mobile-worksheet/store',
method: "POST",
@@ -313,7 +328,7 @@
}
});
}
-
+
} else {
console.log('验证失败');
}
@@ -324,18 +339,18 @@
url: "../orderList/orderList"
})
},
- showInfo(id){
+ showInfo(id) {
var that = this;
that.util.request({
api: '/api/mobile/mobile-worksheet/show',
method: "get",
data: {
- id:id
+ id: id
},
utilSuccess: function(result) {
that.form = result;
- for(var m of that.rainArr.depList){
- if(result.feedback_department_id==m.id){
+ for (var m of that.rainArr.depList) {
+ if (result.feedback_department_id == m.id) {
console.log(m)
that.depName = m.name
}
@@ -343,19 +358,19 @@
let _files = [];
let _dealfiles = [];
for (var mod of result.worksheet_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);
+ let m = Object.assign({}, mod);
+ m.url = mod.files.url;
+ m.id = mod.files.id;
+ m.name = mod.files.original_name;
+ _files.push(m);
}
-
+
for (var mod of result.worksheet_end_files) {
- let m = Object.assign({}, mod);
- m.url = mod.files.url;
- m.id = mod.files.id;
- m.name = mod.files.original_name;
- _dealfiles.push(m);
+ let m = Object.assign({}, mod);
+ m.url = mod.files.url;
+ m.id = mod.files.id;
+ m.name = mod.files.original_name;
+ _dealfiles.push(m);
}
that.filesList = _files
that.dealFilesList = _dealfiles
@@ -368,7 +383,7 @@
}
});
},
-
+
chooseLocation(e) { //打开地图选择位置
var that = this;
uni.chooseLocation({
@@ -394,4 +409,4 @@
color: #fff;
padding: 20rpx 30rpx;
}
-
+
diff --git a/packageA/pages/generalPatrol/generalPatrol.vue b/packageA/pages/generalPatrol/generalPatrol.vue
index 64e08f2..b8bfad2 100644
--- a/packageA/pages/generalPatrol/generalPatrol.vue
+++ b/packageA/pages/generalPatrol/generalPatrol.vue
@@ -114,10 +114,23 @@
uni.getLocation({
type: "gcj02",
success(res) {
- that.location = res;
- that.form.latitude = res.latitude;
- 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.location = res;
+ var loc = null
+ console.log(typeof(window.android))
+ if (typeof(window.android) != undefined && typeof(window.android) != "undefined") {
+ loc = window.android.getLocInfo();
+ }
+ if (loc) {
+ that.form.latitude = JSON.parse(loc).lat;
+ that.form.longitude = JSON.parse(loc).lon;
+ } else {
+ that.form.latitude = res.latitude;
+ that.form.longitude = res.longitude;
+ }
+ const url =
+ "https://apis.map.qq.com/ws/geocoder/v1/?key=EUQBZ-MJALU-WZFVR-2HFNW-TIK2K-TNBJI&location=" +
+ that.form.latitude + "," + that.form.longitude + "&output=jsonp"
+
that.$jsonp(
url
).then(re => {
diff --git a/packageB/pages/dailyInspection/dailyInspection.vue b/packageB/pages/dailyInspection/dailyInspection.vue
index a940d2c..04e3ad0 100644
--- a/packageB/pages/dailyInspection/dailyInspection.vue
+++ b/packageB/pages/dailyInspection/dailyInspection.vue
@@ -2,24 +2,22 @@
-
+
-
+
{{item.name}}
@@ -35,10 +33,12 @@
-
+
@@ -46,8 +46,9 @@
-
- 重新获取
+
+ 重新获取
+
@@ -64,46 +65,44 @@
token: ""
},
showMap: false,
- nextStatus:"可现场处理",
- normalstatus:1,
- nextStatusId:2,
- nextShow:false,
+ nextStatus: "可现场处理",
+ normalstatus: 1,
+ nextStatusId: 2,
+ nextShow: false,
action: "",
- infoId:"",
- slist:[
- {
- id:2,
- name:"可现场处理"
+ infoId: "",
+ slist: [{
+ id: 2,
+ name: "可现场处理"
},
{
- id:3,
- name:"不可现场处理"
+ id: 3,
+ name: "不可现场处理"
}
],
- statuss:[
- {
- id:1,
- name:"无异常"
+ statuss: [{
+ id: 1,
+ name: "无异常"
},
{
- id:2,
- name:"有异常"
+ id: 2,
+ name: "有异常"
}
],
- filesList:[],
- dealFilesList:[],
+ filesList: [],
+ dealFilesList: [],
form: {
- name:"",
- content:"",
- status:1,
- deal_content:"",
- deal_longitude:"",
- deal_latitude:"",
- address:"",
- files_list:"",
- deal_files_list:""
+ name: "",
+ content: "",
+ status: 1,
+ deal_content: "",
+ deal_longitude: "",
+ deal_latitude: "",
+ address: "",
+ files_list: "",
+ deal_files_list: ""
},
- qqmapsdk:"",
+ qqmapsdk: "",
width: 300,
height: 300,
rules: {
@@ -118,11 +117,11 @@
},
onLoad(options) {
var that = this;
- if(options.id){
+ 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;
},
@@ -131,18 +130,32 @@
let that = this;
uni.getLocation({
type: "gcj02",
- geocode:true,
+ geocode: true,
success(res) {
- that.form.deal_latitude = res.latitude;
- 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"
+ var loc = null
+ console.log(typeof(window.android))
+ if (typeof(window.android) != undefined && typeof(window.android) != "undefined") {
+ loc = window.android.getLocInfo();
+ }
+ if (loc) {
+ that.form.deal_latitude = JSON.parse(loc).lat;
+ that.form.deal_longitude = JSON.parse(loc).lon;
+ } else {
+ that.form.deal_latitude = res.latitude;
+ that.form.deal_longitude = res.longitude;
+ }
+ const url =
+ "https://apis.map.qq.com/ws/geocoder/v1/?key=EUQBZ-MJALU-WZFVR-2HFNW-TIK2K-TNBJI&location=" +
+ that.form.deal_latitude + "," + that.form.deal_longitude + "&output=jsonp"
+
+
that.$jsonp(
- url
- ).then(re => {
+ url
+ ).then(re => {
that.form.address = re.result.formatted_addresses.recommend
})
}
-
+
})
uni.getSystemInfo({
complete(res) {
@@ -153,24 +166,24 @@
},
methods: {
- toremove(index, lists, name,whatfile) {
- if(whatfile=="filesList"){
- this.filesList.splice(index,1)
+ toremove(index, lists, name, whatfile) {
+ if (whatfile == "filesList") {
+ this.filesList.splice(index, 1)
// this.form.files_list = list;
}
- if(whatfile=="dealFilesList"){
- this.dealFilesList.splice(index,1)
+ if (whatfile == "dealFilesList") {
+ this.dealFilesList.splice(index, 1)
// this.form.deal_files_list = list;
}
},
- onprogress(res){
+ onprogress(res) {
uni.showToast({
icon: "none",
title: "上传中",
duration: 2000
})
},
- tosuccess(){
+ tosuccess() {
uni.showToast({
icon: "none",
title: "上传成功",
@@ -180,16 +193,16 @@
toupload(lists, name, whatfile) {
var that = this;
let list = [];
- if(whatfile=="filesList"){
+ if (whatfile == "filesList") {
that.filesList = lists
// this.form.files_list = list;
}
- if(whatfile=="dealFilesList"){
+ if (whatfile == "dealFilesList") {
that.dealFilesList = lists;
-
+
}
},
- radioChange(val){
+ radioChange(val) {
console.log(val)
},
confirmNext(e) {
@@ -200,33 +213,33 @@
},
submit() {
let that = this;
- if(that.nextStatusId==3){
+ if (that.nextStatusId == 3) {
that.form.status = that.nextStatusId
- }else{
+ } else {
that.form.status = that.normalstatus;
that.form.deal_latitude = "";
that.form.deal_longitude = "";
that.form.address = "";
}
let list = [];
- let deallist=[];
- for(var mod of that.filesList){
- if( mod.response){
+ let deallist = [];
+ for (var mod of that.filesList) {
+ if (mod.response) {
list.push({
upload_id: mod.response.id
})
- }else{
+ } else {
list.push({
- upload_id:mod.id
+ upload_id: mod.id
})
}
}
- for(var mod of that.dealFilesList){
- if( mod.response){
+ for (var mod of that.dealFilesList) {
+ if (mod.response) {
deallist.push({
upload_id: mod.response.id
})
- }else{
+ } else {
deallist.push({
upload_id: mod.id
})
@@ -238,7 +251,7 @@
this.$refs.uForm.validate(valid => {
if (valid) {
console.log('验证通过');
- if(that.infoId){
+ if (that.infoId) {
that.util.request({
api: '/api/mobile/daily-inspection/save',
method: "POST",
@@ -257,7 +270,7 @@
that.util.alert(res);
}
});
- }else{
+ } else {
that.util.request({
api: '/api/mobile/daily-inspection/store',
method: "POST",
@@ -277,7 +290,7 @@
}
});
}
-
+
} else {
console.log('验证失败');
}
@@ -288,18 +301,18 @@
url: "../dailyList/dailyList"
})
},
- showInfo(id){
+ showInfo(id) {
var that = this;
that.util.request({
api: '/api/mobile/daily-inspection/show',
method: "get",
data: {
- id:id
+ id: id
},
utilSuccess: function(result) {
that.form = result;
that.normalstatus = result.status;
- if(result.status==3){
+ if (result.status == 3) {
that.nextStatusId = 3;
that.normalstatus = 2;
that.nextStatus = "不可现场处理"
@@ -307,19 +320,19 @@
let _files = [];
let _dealfiles = [];
for (var mod of result.daily_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);
+ let m = Object.assign({}, mod);
+ m.url = mod.files.url;
+ m.id = mod.files.id;
+ m.name = mod.files.original_name;
+ _files.push(m);
}
-
+
for (var mod of result.daily_inspection_deal_files) {
- let m = Object.assign({}, mod);
- m.url = mod.files.url;
- m.id = mod.files.id;
- m.name = mod.files.original_name;
- _dealfiles.push(m);
+ let m = Object.assign({}, mod);
+ m.url = mod.files.url;
+ m.id = mod.files.id;
+ m.name = mod.files.original_name;
+ _dealfiles.push(m);
}
that.filesList = _files
that.dealFilesList = _dealfiles
@@ -330,12 +343,12 @@
}
});
},
-
+
chooseLocation(e) { //打开地图选择位置
var that = this;
uni.chooseLocation({
- longitude : that.form.deal_longitude,
- latitude : that.form.deal_latitude,
+ longitude: that.form.deal_longitude,
+ latitude: that.form.deal_latitude,
success: res => {
that.form.address = res.name;
that.form.deal_longitude = res.longitude;
@@ -359,4 +372,4 @@
color: #fff;
padding: 20rpx 30rpx;
}
-
+
diff --git a/raininspection/raininspection/raininspection.vue b/raininspection/raininspection/raininspection.vue
index d7620e9..d040369 100644
--- a/raininspection/raininspection/raininspection.vue
+++ b/raininspection/raininspection/raininspection.vue
@@ -1,719 +1,736 @@
-
-
-
- 所属道路:{{roadName}}
-
-
-
-
-
-
-
-
-
- {{typeName}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.name}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 重新获取
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.name}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.name}}
-
-
-
-
-
-
-
-
-
-
- {{item.name}}
-
-
-
-
-
-
-
-
-
-
-
-
- 提交
-
-
-
-
-
-
-
diff --git a/rainmaintain/rainmaintain/rainmaintain.vue b/rainmaintain/rainmaintain/rainmaintain.vue
index 3d41b72..9f88e8a 100644
--- a/rainmaintain/rainmaintain/rainmaintain.vue
+++ b/rainmaintain/rainmaintain/rainmaintain.vue
@@ -1,518 +1,536 @@
-
-
-
- 所属道路:{{roadName}}
-
-
-
-
-
-
-
-
-
- {{typeName}}
-
-
-
-
-
-
- 重新获取
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.name}}
-
-
-
-
-
-
- {{item.name}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 提交
-
-
-
-
-
-
-
diff --git a/road/road/road.vue b/road/road/road.vue
index 27d8a66..f862281 100644
--- a/road/road/road.vue
+++ b/road/road/road.vue
@@ -4,8 +4,8 @@