代码优化

This commit is contained in:
BianLzhaoMin 2024-11-04 10:13:18 +08:00
parent 58e42dd8d6
commit 2d43edd5b8
12 changed files with 271 additions and 255 deletions

View File

@ -13,7 +13,7 @@
"type" : "uniCloud" "type" : "uniCloud"
}, },
{ {
"playground" : "standard", "playground" : "custom",
"type" : "uni-app:app-android" "type" : "uni-app:app-android"
} }
] ]

View File

@ -462,7 +462,7 @@ export default {
}, },
fail: err => { fail: err => {
console.error('获取位置失败:', err) console.error('获取位置失败:', err)
uni.showToast({ title: '位置获取失败,请稍后尝试' }) uni.showToast({ title: '位置获取失败,请稍后尝试',icon:'none' })
} }
}) })

View File

@ -428,7 +428,7 @@
<view class="item-time"> <view class="item-time">
<text>提交人/提交时间</text> <text>提交人/提交时间</text>
<text>{{ item.upUser }}/{{ item.planTime }}</text> <text>{{ item.upUser }}/{{ item.upTime }}</text>
<text :class="getTYpeStyle(item.state)">{{ onTypeChange(item.state) }}</text> <text :class="getTYpeStyle(item.state)">{{ onTypeChange(item.state) }}</text>
</view> </view>
</view> </view>

View File

@ -436,7 +436,7 @@
<view class="item-time"> <view class="item-time">
<text>提交人/提交时间</text> <text>提交人/提交时间</text>
<text>{{ item.upUser }}/{{ item.planTime }}</text> <text>{{ item.upUser }}/{{ item.upTime }}</text>
<text :class="getTYpeStyle(item.state)">{{ onTypeChange(item.state) }}</text> <text :class="getTYpeStyle(item.state)">{{ onTypeChange(item.state) }}</text>
</view> </view>
</view> </view>

View File

@ -93,9 +93,9 @@
</view> </view>
<view class="day-td"> <view class="day-td">
<view>{{ currentDayInfo.proName }}</view> <view>{{ currentDayInfo.proName || '' }}</view>
<view> <view>
<text>{{ currentDayInfo.rys }}</text> <text>{{ currentDayInfo.rys || '' }}</text>
</view> </view>
<view @tap="onViewPersonDetails(currentDayInfo.idNumber)"> <view @tap="onViewPersonDetails(currentDayInfo.idNumber)">
<text class="style_4" v-if="currentDayInfo.kjsfx > 0">可接受:{{ currentDayInfo.kjsfx }}</text> <text class="style_4" v-if="currentDayInfo.kjsfx > 0">可接受:{{ currentDayInfo.kjsfx }}</text>
@ -166,7 +166,9 @@ export default {
todayCount: 0, todayCount: 0,
currentQueryDay: this.$moment().format('YYYY-MM'), currentQueryDay: this.$moment().format('YYYY-MM'),
currentPramsWeekDay: '', currentPramsWeekDay: '',
currentDayInfo: {} currentDayInfo: {
proName: ''
}
} }
}, },
computed: { computed: {
@ -376,8 +378,10 @@ export default {
/* 获取当日数据 */ /* 获取当日数据 */
async getProFxByDayFun() { async getProFxByDayFun() {
const res = await getProFxByDayApi({ day: this.currentDay }) const res = await getProFxByDayApi({ day: this.currentDay })
if (res.data.length > 0) {
this.currentDayInfo = res.data[0] this.currentDayInfo = res.data[0]
console.log('----------当日数据', res) console.log('----------当日数据', res)
}
}, },
onViewPersonDetails(id) { onViewPersonDetails(id) {
uni.navigateTo({ url: `/pages/realName/index/pages/personDetail?idNumber=${id}` }) uni.navigateTo({ url: `/pages/realName/index/pages/personDetail?idNumber=${id}` })

View File

@ -10,7 +10,7 @@
<view class="left-right"> <view class="left-right">
<text>本周风险数</text> <text>本周风险数</text>
<text>{{ weekNum }}</text> <text>{{ weekNum }}</text>
<text>累计总数 {{ weekNum }}</text> <text>累计总数 {{ weekAmount }}</text>
</view> </view>
</view> </view>
</view> </view>
@ -24,7 +24,7 @@ export default {
monthNum: 0, monthNum: 0,
monthAmount: 9520, monthAmount: 9520,
weekNum: 0, weekNum: 0,
weekAmount: 9820 weekAmount: 0
} }
}, },
methods: { methods: {
@ -40,6 +40,9 @@ export default {
if (e.type == 'w1') { if (e.type == 'w1') {
this.weekNum = e.num this.weekNum = e.num
} }
if (e.type == 'w2') {
this.weekAmount = e.num
}
}) })
} }
} }

View File

@ -35,8 +35,11 @@ export default {
} }
}, },
methods: { methods: {
//
leftClick() { leftClick() {
uni.navigateBack() uni.reLaunch({
url: '/pages/gzt/index'
})
} }
}, },
onLoad() { onLoad() {

View File

@ -463,7 +463,7 @@
<view class="item-time"> <view class="item-time">
<text>提交人/提交时间</text> <text>提交人/提交时间</text>
<text>{{ item.upUser }}/{{ item.planTime }}</text> <text>{{ item.upUser }}/{{ item.upTime }}</text>
<text :class="getTYpeStyle(item.state)">{{ onTypeChange(item.state) }}</text> <text :class="getTYpeStyle(item.state)">{{ onTypeChange(item.state) }}</text>
</view> </view>
</view> </view>

View File

@ -481,7 +481,7 @@
<view class="item-time"> <view class="item-time">
<text>提交人/提交时间</text> <text>提交人/提交时间</text>
<text>{{ item.upUser }}/{{ item.planTime }}</text> <text>{{ item.upUser }}/{{ item.upTime }}</text>
<text :class="getTYpeStyle(item.state)">{{ onTypeChange(item.state) }}</text> <text :class="getTYpeStyle(item.state)">{{ onTypeChange(item.state) }}</text>
</view> </view>
</view> </view>

View File

@ -685,12 +685,15 @@ export default {
} }
console.log('saveParams保存参数', params) console.log('saveParams保存参数', params)
uni.showLoading({
title: '正在提交,请稍后...'
})
const result = await submitPlanApi(params) const result = await submitPlanApi(params)
console.log(result, 'results上报人提交结果') console.log(result, 'results上报人提交结果')
if (result.res == 1) { if (result.res == 1) {
uni.showToast({ title: `审核成功`, icon: 'none' }) uni.showToast({ title: `审核成功`, icon: 'none' })
uni.hideLoading()
setTimeout(() => { setTimeout(() => {
uni.navigateBack({ uni.navigateBack({
delta: 1, delta: 1,
@ -711,7 +714,6 @@ export default {
uni.showToast({ title: '请选择审核意见', icon: 'none' }) uni.showToast({ title: '请选择审核意见', icon: 'none' })
} else if (this.isPass === 0) { } else if (this.isPass === 0) {
// //
updateInfPlanContentApi({ id: JSON.stringify(this.monthDetailsList) }).then(async res => { updateInfPlanContentApi({ id: JSON.stringify(this.monthDetailsList) }).then(async res => {
console.log('修改结果---', res) console.log('修改结果---', res)
if (res.res == 1 && this.roles == 24) { if (res.res == 1 && this.roles == 24) {
@ -724,10 +726,14 @@ export default {
user: '' user: ''
// state: '2' // state: '2'
} }
uni.showLoading({
title: '正在提交,请稍后...'
})
const result = await submitPlanApi(params) const result = await submitPlanApi(params)
console.log(result, 'results上报人提交结果') console.log(result, 'results上报人提交结果')
if (result.res == 1) { if (result.res == 1) {
uni.showToast({ title: `审核成功`, icon: 'none' }) uni.showToast({ title: `审核成功`, icon: 'none' })
uni.hideLoading()
setTimeout(() => { setTimeout(() => {
uni.navigateBack({ uni.navigateBack({
delta: 1, delta: 1,
@ -893,18 +899,18 @@ export default {
} }
.revoke { .revoke {
width: 100%; width: 94%;
padding: 12px 0; padding: 12px 0;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 3%;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
// background-color: #fff; // background-color: #fff;
.auditing-complete { .auditing-complete {
width: 98%; width: 100%;
height: 70rpx; height: 70rpx;
margin: 0 auto; margin: 0 auto;
border-radius: 16rpx; border-radius: 16rpx;

View File

@ -187,11 +187,11 @@ export default {
console.log('params参数', params) console.log('params参数', params)
uni.request({ uni.request({
url: `${config.realNewBmwUrl}${ url: `${config.workPlanNewYnUrl}${
row.isCollect == 0 ? '/app/offLine/insertCollect' : '/app/offLine/deleteCollect' row.isCollect == 0 ? '/app/offLine/insertCollect' : '/app/offLine/deleteCollect'
}`, }`,
method: 'POST', method: 'POST',
data: JSON.stringify(params), data: JSON.stringify(params), //192.168.0.14:19191/ynPlanApp/
header: { header: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
token: this.token token: this.token