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 @@ - {{ month }} + 可接受风险:{{ kjsAmount }} 低风险:{{ dfxAmount }} 中风险:{{ zfxAmount }} @@ -239,20 +239,17 @@ export default { ], 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', name: 'zylx', required: true, - options: [ - { value: 0, text: '检修' }, - { value: 1, text: '维护' } - ] + options: [] }, { form_label: '计划开始时间', items_type: 'date', name: 'kssj', required: true }, { form_label: '计划结束时间', items_type: 'date', name: 'jssj', required: true }, @@ -262,8 +259,8 @@ export default { name: 'sftd', required: true, options: [ - { value: 1, text: '是' }, - { value: 0, text: '否' } + { value: '1', text: '是' }, + { value: '0', text: '否' } ] }, { form_label: '停电设备(作业场所)', items_type: 'ipt', name: 'tdsb', required: true }, @@ -288,12 +285,7 @@ export default { items_type: 'sel', name: 'gkfs', required: true, - options: [ - { value: 0, text: '过程管控' }, - { value: 1, text: '巡视管控' }, - { value: 2, text: '驻点管控' }, - { value: 2, text: '节点管控' } - ] + options: [] }, { form_label: '施工方案', @@ -301,8 +293,8 @@ export default { name: 'sgfa', required: true, options: [ - { value: 1, text: '是' }, - { value: 0, text: '否' } + { value: '1', text: '是' }, + { value: '0', text: '否' } ] }, { @@ -311,8 +303,8 @@ export default { name: 'zyzds', required: true, options: [ - { value: 0, text: '是' }, - { value: 1, text: '否' } + { value: '1', text: '是' }, + { value: '0', text: '否' } ] }, { @@ -321,8 +313,8 @@ export default { name: 'zybd', required: true, options: [ - { value: 0, text: '是' }, - { value: 1, text: '否' } + { value: '1', text: '是' }, + { value: '0', text: '否' } ] }, { @@ -331,12 +323,12 @@ export default { name: 'gzp', required: true, options: [ - { value: 0, text: '是' }, - { value: 1, text: '否' } + { value: '1', text: '是' }, + { value: '0', text: '否' } ] }, - { form_label: '备注', items_type: 'ipt', name: 'bz' }, - { form_label: '计划数量', items_type: 'ipt', name: 'planCount', required: true, isType: 'number' } + { form_label: '备注', items_type: 'ipt', name: 'bz', required: false }, + { form_label: '计划数量', items_type: 'ipt', isType: 'number', name: 'planCount', required: true } ], kjsAmount: 0, dfxAmount: 0, @@ -757,6 +749,93 @@ export default { border-bottom: 1px solid #003778; color: #003778 !important; } + +.process-container { + padding: 20rpx; + background-color: #fff; + border-top: 2px solid #ccc; + + h1 { + margin-bottom: 20rpx; + font-size: 40rpx; + letter-spacing: 2px; + } + + .process-item { + display: flex; + justify-content: space-between; + } + + .process-item view:first-child { + position: relative; + width: 20%; + height: 80rpx; + color: #fff; + // background-color: #00337a; + border-radius: 12rpx; + + image { + width: 100%; + height: 80rpx; + } + + .type-icon { + // box-sizing: border-box; + position: absolute; + bottom: 0; + right: 0; + height: 35rpx; + width: 35rpx; + border-radius: 50%; + text-align: center; + line-height: 35rpx; + transform: translate(25%, 25%); + border: 3px solid #fff; + background-color: green; + } + } + .process-item .box-2 { + flex: 1; + padding-left: 26rpx; + display: flex; + flex-direction: column; + + .text_1 { + font-size: 28rpx; + color: #7e7e7e; + } + .text_2 { + width: 100%; + display: flex; + // display: block; + justify-content: space-between; + align-items: center; + margin-top: 16rpx; + font-size: 24rpx; + color: #000; + } + } + + .process-item .box-3 { + width: 30%; + font-size: 22rpx; + color: #333; + } + + .line { + margin: 28rpx 0; + .line-content { + width: 20%; + + view { + margin: 0 auto; + height: 60rpx; + width: 2px; + background-color: #00337a; + } + } + } +} .auditing-content { width: 95vw; height: 60vh; diff --git a/pages/workPlan/networkPlan/inf-index.vue b/pages/workPlan/networkPlan/inf-index.vue index a24de06..87d755a 100644 --- a/pages/workPlan/networkPlan/inf-index.vue +++ b/pages/workPlan/networkPlan/inf-index.vue @@ -313,6 +313,10 @@ {{ item.planTime }} + + 工程名称 + {{ 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) })