Commit 2af55f25 by 胡悦

feat(权限管理): 添加学习中心权限弹窗组件及逻辑

在多个页面添加学习中心权限弹窗组件,替换原有的禁止提单检查逻辑
当用户被限制下单时显示学习中心弹窗,引导用户前往学习中心
1 parent ed57ab97
......@@ -116,6 +116,10 @@
</view>
</template>
</PublishPopup>
<!-- 学习中心权限弹窗 -->
<StudyPopup :show.sync="showStudyPermissionPopup" title="" :width="848" :height="870" :topImage="require('@/assets/images/common/warning-notice.png')" :topImageWidth="848" :topImageHeight="248" style="overflow: hidden">
<StudyCenterPermissionPopup :lockReason="lockReason" @confirm="handleStudyPermissionConfirm" />
</StudyPopup>
</view>
</template>
<script>
......@@ -124,6 +128,8 @@ import { interceptionMixin } from '@/mixin/index'
import utils from '@/utils/utils'
import { checkDailyReport, showNextModal } from '@/utils/modalUtils'
import PublishPopup from '@/components/PublishPopup.vue'
import StudyPopup from '@/components/StudyPopup.vue'
import StudyPopupContent from '@/components/StudyPopupContent.vue'
import { debounce } from 'lodash'
export default {
mixins: [interceptionMixin],
......@@ -135,7 +141,9 @@ export default {
}
},
components: {
PublishPopup
PublishPopup,
StudyPopup,
StudyPopupContent
},
computed: {
payType() {
......@@ -190,7 +198,9 @@ export default {
key: 'orderTime'
}
],
localUserInfo: null
localUserInfo: null,
showStudyPermissionPopup: false,
lockReason: ''
}
},
mounted() {
......@@ -228,7 +238,16 @@ export default {
// 校验是否填写昨日日报
let staffCheck = await checkDailyReport()
if (staffCheck) return false
if (name == 'CreateOrder' && (await this.inspectionOfProhibitionBill())) return /**禁止提单 */
// if (name == 'CreateOrder' && (await this.inspectionOfProhibitionBill())) return /**禁止提单 */
if (name == 'CreateOrder') {
// 提示去学习中心弹窗
const res = await this.getLimitRecord()
if (res.lockOrder) {
this.showStudyPermissionPopup = true
this.lockReason = res.lockReason
return
}
}
// 是微信支付直接跳转确认页面
if (userType == 2 && item?.selectPayType == 1) {
this.$emit('jump', 'ConfirmOrder', this.orderCardDetail)
......@@ -284,8 +303,14 @@ export default {
this.$refs.recordOrderPopup.closePopup()
console.log('this.selectType', this.selectType)
if (this.selectType == 1) {
console.log(await this.inspectionOfProhibitionBill())
if (await this.inspectionOfProhibitionBill()) return
// if (await this.inspectionOfProhibitionBill()) return
// 提示去学习中心弹窗
const res = await this.getLimitRecord()
if (res.lockOrder) {
this.showStudyPermissionPopup = true
this.lockReason = res.lockReason
return
}
this.$emit('jump', 'CreateOrder', { paramsData: this.orderCardDetail, type: 'createWithPay' })
} else if (this.selectType == 2 || this.selectType == 3) {
this.$emit('jump', 'DefeatOrder', { paramsData: this.orderCardDetail, type: 'createWithPay', isExpiredTraffic: this.selectType == 3 })
......@@ -309,7 +334,18 @@ export default {
},
cardClick: debounce(function () {
this.jumpClick(this.orderCardDetail.status == 3 ? 'ConfirmOrder' : this.orderCardDetail.status == 1 ? 'CreateOrder' : 'OrderDetail', this.orderCardDetail)
}, 300)
}, 300),
// 跳转学习中心
handleStudyPermissionConfirm() {
this.showStudyPermissionPopup = false
uni.navigateBack({
success: () => {
setTimeout(() => {
uni.$emit('studyCenter')
}, 100)
}
})
}
}
}
</script>
......
......@@ -57,6 +57,10 @@
text="当前页面暂未保存,是否确认退出"
type="warning"
></NoticePopup>
<!-- 学习中心权限弹窗 -->
<StudyPopup :show.sync="showStudyPermissionPopup" title="" :width="848" :height="870" :topImage="require('@/assets/images/common/warning-notice.png')" :topImageWidth="848" :topImageHeight="248" style="overflow: hidden">
<StudyCenterPermissionPopup :lockReason="lockReason" @confirm="handleStudyPermissionConfirm" />
</StudyPopup>
</view>
</template>
......@@ -72,6 +76,8 @@ import UploadProofOfPayment from './components/UploadProofOfPayment.vue'
import NoticePopup from '@/components/NoticePopup.vue'
import dayjs from 'dayjs'
import { interceptionMixin } from '@/mixin/index'
import StudyPopup from '@/components/StudyPopup.vue'
import StudyCenterPermissionPopup from '@/components/StudyCenterPermissionPopup.vue'
export default {
mixins: [interceptionMixin],
......@@ -84,7 +90,9 @@ export default {
ConfirmOrder,
NoticePopup,
UploadProofOfPayment,
OrderDetail
OrderDetail,
StudyPopup,
StudyCenterPermissionPopup
},
data () {
return {
......@@ -93,7 +101,9 @@ export default {
endDate: dayjs().format('YYYY-MM-DD'),
currentDate: dayjs().format('YYYY-MM-DD'),
currentMonth: dayjs().format('YYYY-MM'),
selectedDays: []
selectedDays: [],
lockReason: '',
showStudyPermissionPopup: false
}
},
onLoad (options) {
......@@ -112,7 +122,16 @@ export default {
async entranceClick (item) {
if(this.toolComponentName == item.name) return
const noInterceptPage = ['DailyReport']
if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return
// 原禁止提单inspectionOfProhibitionBill方法被替换getLimitRecord
// if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return
if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()))) return
// 提示去学习中心弹窗
const res = await this.getLimitRecord()
if (res.lockOrder) {
this.showStudyPermissionPopup = true
this.lockReason = res.lockReason
return
}
// 保存当前选择的组件信息,但不立即切换
const selectedItem = item
if (this.toolComponentName === selectedItem.name && (!this.transmissionOfData || this.transmissionOfData.type !== 'supplementOrder')) return
......@@ -164,6 +183,17 @@ export default {
if (val) {
this.transmissionOfData = val
}
},
// 跳转学习中心
handleStudyPermissionConfirm() {
this.showStudyPermissionPopup = false
uni.navigateBack({
success: () => {
setTimeout(() => {
uni.$emit('studyCenter')
}, 100)
}
})
}
}
}
......
......@@ -24,6 +24,11 @@
</view>
</view>
<NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup>
<!-- 学习中心权限弹窗 -->
<StudyPopup :show.sync="showStudyPermissionPopup" title="" :width="848" :height="870" :topImage="require('@/assets/images/common/warning-notice.png')" :topImageWidth="848" :topImageHeight="248" style="overflow: hidden">
<StudyCenterPermissionPopup :lockReason="lockReason" @confirm="handleStudyPermissionConfirm" />
</StudyPopup>
</view>
</template>
......@@ -39,6 +44,8 @@ import NoticePopup from '@/components/NoticePopup.vue'
import dayjs from 'dayjs'
import { interceptionMixin } from '@/mixin/index'
import UpdateOrderInfo from './components/UpdateOrderInfo.vue'
import StudyPopup from '@/components/StudyPopup.vue'
import StudyCenterPermissionPopup from '@/components/StudyCenterPermissionPopup.vue'
export default {
mixins: [interceptionMixin],
......@@ -51,7 +58,9 @@ export default {
NoticePopup,
UploadProofOfPayment,
OrderDetail,
UpdateOrderInfo
UpdateOrderInfo,
StudyPopup,
StudyCenterPermissionPopup
},
data() {
return {
......@@ -60,7 +69,9 @@ export default {
endDate: dayjs().format('YYYY-MM-DD'),
currentDate: dayjs().format('YYYY-MM-DD'),
currentMonth: dayjs().format('YYYY-MM'),
selectedDays: []
selectedDays: [],
lockReason: '',
showStudyPermissionPopup: false
}
},
onLoad(options) {
......@@ -79,7 +90,15 @@ export default {
async entranceClick(item) {
if(this.toolComponentName == item.name) return
const noInterceptPage = ['DailyReport']
if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return
// if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return
if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()))) return
// 提示去学习中心弹窗
const res = await this.getLimitRecord()
if (res.lockOrder) {
this.showStudyPermissionPopup = true
this.lockReason = res.lockReason
return
}
// 保存当前选择的组件信息,但不立即切换
const selectedItem = item
if (this.toolComponentName === selectedItem.name && (!this.transmissionOfData || this.transmissionOfData.type !== 'supplementOrder')) return
......@@ -130,6 +149,17 @@ export default {
if (val) {
this.transmissionOfData = val
}
},
// 跳转学习中心
handleStudyPermissionConfirm() {
this.showStudyPermissionPopup = false
uni.navigateBack({
success: () => {
setTimeout(() => {
uni.$emit('studyCenter')
}, 100)
}
})
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!