diff --git a/api/workPlan/my.js b/api/workPlan/my.js
index 0154f9c..ebc1492 100644
--- a/api/workPlan/my.js
+++ b/api/workPlan/my.js
@@ -16,3 +16,11 @@ export function getReportMessageApi(data) {
data: data
})
}
+// 点击报告获取内容
+export function messagePushApi(data) {
+ return request_yn({
+ url: '/ynPlanApp/home/setSendNessage',
+ method: 'post',
+ data: data
+ })
+}
diff --git a/pages/workPlan/custody/index.vue b/pages/workPlan/custody/index.vue
index 7ca3578..5153046 100644
--- a/pages/workPlan/custody/index.vue
+++ b/pages/workPlan/custody/index.vue
@@ -89,10 +89,9 @@
{{ submitParams.lon }}
- 点击获取
+
-
-
+
@@ -450,7 +449,6 @@ export default {
const this_ = this
uni.chooseLocation({
success: function (res) {
-
this_.submitParams.address = res.address
this_.submitParams.lon = res.longitude
this_.submitParams.lat = res.latitude
@@ -463,26 +461,42 @@ export default {
this.getMySceneListData()
this.getTodayRiskData()
// 获取定位位置信息
- // uni.getLocation({
- // type: 'wgs84', // 默认为 gcj02,可以选择 'wgs84'
- // // altitude: false,
- // // geocode: true,
- // success: res => {
- // console.log(res, '位置信息--')
- // // this.demoAddress = res
- // const { latitude, longitude } = res
- // // const { province, city, district, street, streetNum, poiName } = res.address
+ uni.getLocation({
+ type: 'gcj02', // 默认为 gcj02,可以选择 'wgs84'
+ altitude: false,
+ geocode: true,
+ success: res => {
+ console.log(res, '位置信息--')
+ this.demoAddress = res
+ const { latitude, longitude } = res
+ // const { province, city, district, street, streetNum, poiName } = res.address
- // this.submitParams.lon = longitude
- // this.submitParams.lat = latitude
- // // console.log(province, 'province')
- // // this.submitParams.address = `${province}${city}${district}${street}${streetNum}${poiName}`
- // },
- // fail: err => {
- // console.error('获取位置失败:', err)
- // uni.showToast({ title: '位置获取失败,请稍后尝试', icon: 'none' })
- // }
- // })
+ uni.request({
+ url: `https://api.map.baidu.com/reverse_geocoding/v3/?ak=PM43nB8eDNTBrXkQwGrTQFcmOni3Z9nO&output=json&coordtype=gcj02ll&location=${latitude},${longitude}`,
+ method: 'GET',
+ // data: {
+ // ak: 'PM43nB8eDNTBrXkQwGrTQFcmOni3Z9nO',
+ // output: JSON,
+ // coordtype: 'gcj02ll',
+ // location: `${longitude},${latitude}`
+ // },
+ success: res => {
+ console.log('解析的地址', res)
+
+ this.submitParams.address = res.data.result.formatted_address
+ }
+ })
+
+ this.submitParams.lon = longitude
+ this.submitParams.lat = latitude
+ // console.log(province, 'province')
+ // this.submitParams.address = `${province}${city}${district}${street}${streetNum}${poiName}`
+ },
+ fail: err => {
+ console.error('获取位置失败:', err)
+ uni.showToast({ title: '位置获取失败,请稍后尝试', icon: 'none' })
+ }
+ })
// uni.chooseLocation({
// success: function (res) {
diff --git a/pages/workPlan/dayPlan/inf-index.vue b/pages/workPlan/dayPlan/inf-index.vue
index ffeb49d..1bb7e67 100644
--- a/pages/workPlan/dayPlan/inf-index.vue
+++ b/pages/workPlan/dayPlan/inf-index.vue
@@ -2050,7 +2050,25 @@ export default {
(this.monthDataList[this.activeFormPages].imgList.length +
this.monthDataList[this.activeFormPages].imgViewList.length)
}
- }
+ },
+ debounce(fn, delay) {
+ let timer = null
+ return (...args) => {
+ // 清除之前的定时器
+ if (timer) {
+ clearTimeout(timer)
+ }
+
+ // 设置新的定时器,延迟执行函数
+ timer = setTimeout(() => {
+ fn.apply( ...args) // 使用 `apply` 确保 `this` 指向 Vue 实例
+ }, delay)
+ }
+ },
+ },
+ created() {
+ // 将防抖应用到 `onSendMessage` 方法上
+ this.onSaveSubmit = this.debounce(this.onSaveSubmit, 1000);
},
onReady() {},
diff --git a/pages/workPlan/dayPlan/sub-user/index.vue b/pages/workPlan/dayPlan/sub-user/index.vue
index cc1dcc1..6a4c58d 100644
--- a/pages/workPlan/dayPlan/sub-user/index.vue
+++ b/pages/workPlan/dayPlan/sub-user/index.vue
@@ -143,11 +143,11 @@
暂退人员:
- {{ item }}
+ {{ item }}
临时人员:
- {{ item }}
+ {{ item }}
@@ -422,7 +422,9 @@ export default {
this.subUserList.forEach(e => {
console.log('选择的每一项', e)
-
+ this.fixedPersonList = []
+ this.tempPersonList = []
+ this.returnPersonList = []
if (e.isChecked) {
if (e.userState == 1) {
// 固定人员
diff --git a/pages/workPlan/messagePush/index.vue b/pages/workPlan/messagePush/index.vue
index 67d9e00..112b4bb 100644
--- a/pages/workPlan/messagePush/index.vue
+++ b/pages/workPlan/messagePush/index.vue
@@ -30,6 +30,7 @@
发送
+
@@ -88,7 +89,8 @@
diff --git a/pages/workPlan/monthPlanAuditingDetails/pro-index.vue b/pages/workPlan/monthPlanAuditingDetails/pro-index.vue
index bdcb8c3..d4e654e 100644
--- a/pages/workPlan/monthPlanAuditingDetails/pro-index.vue
+++ b/pages/workPlan/monthPlanAuditingDetails/pro-index.vue
@@ -242,10 +242,10 @@ export default {
{ title: '提交', id: 4, type: 'upload', isShow: ['1', '2', '3'], isRoles: ['22', '23'] }
],
productionFormLabel: [
- { form_label: '作业内容', items_type: 'ipt', name: 'area', required: true },
- { form_label: '实施单位', items_type: 'ipt', name: 'area', required: true },
- { form_label: '实施部门', items_type: 'ipt', name: 'area', required: true },
- { form_label: '任务来源', items_type: 'ipt', name: 'area', required: true },
+ { form_label: '作业内容', items_type: 'area', name: 'zynr', required: true },
+ { form_label: '实施单位', items_type: 'area', name: 'ssdw', required: true },
+ { form_label: '实施部门', items_type: 'area', name: 'ssbm', required: true },
+ { form_label: '任务来源', items_type: 'area', name: 'rwly', required: true },
{
form_label: '作业类型',
items_type: 'sel',
@@ -331,7 +331,7 @@ export default {
]
},
{ form_label: '备注', items_type: 'ipt', name: 'bz', required: false },
- { form_label: '计划数量', items_type: 'ipt', name: 'planCount', isType: 'number', required: true }
+ { form_label: '计划数量', items_type: 'ipt', isType: 'number', name: 'planCount', required: true }
],
kjsAmount: 0,
dfxAmount: 0,
diff --git a/pages/workPlan/monthPlanDetails/pro-index.vue b/pages/workPlan/monthPlanDetails/pro-index.vue
index 50634b3..83dbb48 100644
--- a/pages/workPlan/monthPlanDetails/pro-index.vue
+++ b/pages/workPlan/monthPlanDetails/pro-index.vue
@@ -13,7 +13,7 @@
+
+ 工程名称
+ {{ item.proName }}
+
计划数量
{{ item.planCount }}
@@ -363,6 +367,10 @@
{{ item.planTime }}
+
+ 工程名称
+ {{ item.proName }}
+
计划数量
{{ item.planCount }}
@@ -1780,7 +1788,8 @@ export default {
}
.item-num,
- .item-time {
+ .item-time,
+ .item-pro {
width: 96%;
margin: 0 auto;
padding: 12rpx 0;
@@ -1789,6 +1798,9 @@ export default {
justify-content: space-between;
font-size: 26rpx;
}
+ .item-pro text:first-child {
+ width: 30%;
+ }
.item-num {
margin-top: 18rpx;
}
diff --git a/pages/workPlan/networkPlan/pro-index.vue b/pages/workPlan/networkPlan/pro-index.vue
index c7a5b4a..9b3e269 100644
--- a/pages/workPlan/networkPlan/pro-index.vue
+++ b/pages/workPlan/networkPlan/pro-index.vue
@@ -313,6 +313,10 @@
{{ item.planTime }}
+
+ 工程名称
+ {{ item.proName }}
+
计划数量
@@ -363,6 +367,10 @@
{{ item.planTime }}
+
+ 工程名称
+ {{ item.proName }}
+
计划数量
@@ -1776,7 +1784,8 @@ export default {
}
.item-num,
- .item-time {
+ .item-time,
+ .item-pro {
width: 96%;
margin: 0 auto;
padding: 12rpx 0;
@@ -1788,6 +1797,9 @@ export default {
.item-num {
margin-top: 18rpx;
}
+ .item-pro text:first-child {
+ width: 30%;
+ }
.item-num text:last-child {
width: 60%;
text-align: left;
diff --git a/utils/request_new_yn.js b/utils/request_new_yn.js
index a79ceed..54879b7 100644
--- a/utils/request_new_yn.js
+++ b/utils/request_new_yn.js
@@ -10,13 +10,26 @@ let timeout = 60000
const baseUrl = config.workPlanNewYnUrl
console.log('token', token)
+let isRequesting = false // 请求锁,防止重复请求
+
const request = config => {
+ // 如果正在请求中,直接返回一个 rejected promise
+ if (isRequesting) {
+ return uni.showToast({ title: '请求正在处理中...请稍后', icon: 'none' })
+ // return Promise.reject('请求正在处理中,请稍后再试')
+ // uni.showToast({ title: '请求正在处理中...', icon: 'none' })
+ }
+
+ // 设置请求正在进行
+ isRequesting = true
+
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false
config.header = config.header || {}
if (token && !isToken) {
config.header['Authorization'] = 'Bearer ' + token
}
+
// get请求映射params参数
if (config.params) {
let url = config.url + '?' + tansParams(config.params)
@@ -31,6 +44,7 @@ const request = config => {
}
// config.data = JSON.stringify(config.data);
}
+
return new Promise((resolve, reject) => {
uni
.request({
@@ -42,15 +56,18 @@ const request = config => {
dataType: 'json'
})
.then(response => {
- // console.log(response)
let [error, res] = response
if (error) {
toast('后端接口连接异常')
+ // 请求完成,解除锁定
+ isRequesting = false
reject('后端接口连接异常')
return
}
+
const code = res.data.code || 200
const msg = errorCode[code] || res.data.msg || errorCode['default']
+
if (code === 401) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {
@@ -59,18 +76,29 @@ const request = config => {
})
}
})
+ // 请求完成,解除锁定
+ isRequesting = false
reject('无效的会话,或者会话已过期,请重新登录。')
} else if (code === 500) {
toast(msg)
+ // 请求完成,解除锁定
+ isRequesting = false
reject(msg)
} else if (code !== 200) {
toast(msg)
+ // 请求完成,解除锁定
+ isRequesting = false
reject(msg)
}
+
+ // 请求完成,解除锁定
+ isRequesting = false
resolve(res.data)
})
.catch(error => {
let { message } = error
+
+ // 请求异常处理
if (message === 'Network Error') {
message = '后端接口连接异常'
} else if (message.includes('timeout')) {
@@ -78,6 +106,9 @@ const request = config => {
} else if (message.includes('Request failed with status code')) {
message = '系统接口' + message.substr(message.length - 3) + '异常'
}
+
+ // 请求完成,解除锁定
+ isRequesting = false
toast(message)
reject(error)
})