|
@@ -0,0 +1,89 @@
|
|
|
+<template>
|
|
|
+ <div class="wx">
|
|
|
+ <div class="title">请选择您要绑定的组织</div>
|
|
|
+
|
|
|
+ <a-select
|
|
|
+ ref="select"
|
|
|
+ v-model:value="orgId"
|
|
|
+ :options="options"
|
|
|
+ allowClear
|
|
|
+ style="width: 200px"
|
|
|
+ :field-names="{ label: 'name', value: 'id' }"
|
|
|
+ />
|
|
|
+
|
|
|
+ <div class="btn">
|
|
|
+ <a-button type="primary" @click="onSubmit" :disabled="!orgId" :loading="loading">确定</a-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+ import { useRoute } from 'vue-router'
|
|
|
+ import router from '@/router'
|
|
|
+ import { message } from 'ant-design-vue'
|
|
|
+ import orgApi from '@/api/sys/orgApi.js'
|
|
|
+ import alarmUserApi from '@/api/coldchain/alarmUserApi'
|
|
|
+
|
|
|
+ const orgId = ref() //选中的机构
|
|
|
+ const options = ref([]) //机构数据
|
|
|
+ const loading = ref(false) //按钮加载
|
|
|
+ const queryObj = ref({}) //携带的参数
|
|
|
+ const Route = useRoute()
|
|
|
+
|
|
|
+ onMounted(() => {
|
|
|
+ getOrg()
|
|
|
+ if (Route.query.code) {
|
|
|
+ queryObj.value = Route.query
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ // 获取机构信息
|
|
|
+ const getOrg = () => {
|
|
|
+ orgApi.orgList().then((res) => {
|
|
|
+ options.value = res || []
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 确定
|
|
|
+ const onSubmit = () => {
|
|
|
+ if (queryObj.value && queryObj.value.code) {
|
|
|
+ this.loading = true
|
|
|
+ alarmUserApi
|
|
|
+ .getwxUserInfo({ code: queryObj.value.code, orgId: orgId.value })
|
|
|
+ .then((res) => {
|
|
|
+ loading.value = false
|
|
|
+
|
|
|
+ router.push({
|
|
|
+ path: '/success',
|
|
|
+ query: {
|
|
|
+ data: res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ loading.value = false
|
|
|
+ message.error('当前无权授权')
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ loading.value = false
|
|
|
+ message.error('当前无权授权')
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+ .wx {
|
|
|
+ height: 400px;
|
|
|
+ text-align: center;
|
|
|
+ padding-top: 45%;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ font-size: 13px;
|
|
|
+ margin: 20px 0;
|
|
|
+ color: #303133;
|
|
|
+ }
|
|
|
+
|
|
|
+ .btn {
|
|
|
+ margin: 20px 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|