Commit 9bb8279a by zhaopanyu

zpy

parent f7c54e66
<template> <template>
<van-nav-bar <van-nav-bar title="场地申请" left-text="返回" left-arrow @click-left="goback" />
title="场地申请"
left-text="返回"
left-arrow
@click-left="goback"
/>
<div class="main_search"> <div class="main_search">
<div class="main_search_2"> <div class="main_search_2">
<van-config-provider :theme-vars="themeVars"> <van-config-provider :theme-vars="themeVars">
<van-dropdown-menu <van-dropdown-menu class="main_search_2_cd" active-color="#1989fa" overlay="false">
class="main_search_2_cd" <van-dropdown-item v-model="state.optionId" :options="option" @change="changeGradeId()" />
active-color="#1989fa"
overlay="false"
>
<van-dropdown-item
v-model="state.optionId"
:options="option"
@change="changeGradeId()"
/>
</van-dropdown-menu> </van-dropdown-menu>
</van-config-provider> </van-config-provider>
</div> </div>
<div class="main_search_1"> <div class="main_search_1">
<van-search <van-search v-model="areaNum" @search="onGetGradeList" shape="round" background="#ffffff" placeholder="搜索" />
v-model="areaNum"
@search="onGetGradeList"
shape="round"
background="#ffffff"
placeholder="搜索"
/>
</div> </div>
</div> </div>
<van-pull-refresh v-model="refreshing" @refresh="onRefresh"> <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-list <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
v-model:loading="loading" <div @click="goDetails(item)" class="c_main_list" v-for="item in list" :key="item">
:finished="finished"
finished-text="没有更多了"
@load="onLoad"
>
<div
@click="goDetails(item)"
class="c_main_list"
v-for="item in list"
:key="item"
>
<div> <div>
<div style="font-size: medium; text-align: start; margin-top: 10px"> <div style="font-size: medium; text-align: start; margin-top: 10px">
申请时间:{{ item.applyTime }} 申请时间:{{ item.applyTime }}
...@@ -68,20 +39,14 @@ ...@@ -68,20 +39,14 @@
</div> </div>
</van-list> </van-list>
</van-pull-refresh> </van-pull-refresh>
<van-icon <van-icon style="position: fixed; bottom: 40px; right: 0px" @click="goApply" class="icon" color="#1989fa" name="add"
style="position: fixed; bottom: 40px; right: 0px" size="20vw" />
@click="goApply"
class="icon"
color="#1989fa"
name="add"
size="20vw"
/>
</template> </template>
<script setup> <script setup>
// import {useStore} from "vuex"; // import {useStore} from "vuex";
import {useRouter} from "vue-router/dist/vue-router"; import { useRouter } from "vue-router/dist/vue-router";
import { reactive, ref} from "vue"; import { reactive, ref } from "vue";
import { useStore } from "vuex"; import { useStore } from "vuex";
const store = useStore(); const store = useStore();
const router = useRouter(); const router = useRouter();
...@@ -95,24 +60,24 @@ const state = reactive({ ...@@ -95,24 +60,24 @@ const state = reactive({
// }); // });
const refreshing = ref(true); const refreshing = ref(true);
const areaNum = ref('') const areaNum = ref('')
const option = [{ text: "开始时间", value: 0 },{text:"结束时间",value:1}]; const option = [{ text: "开始时间", value: 0 }, { text: "结束时间", value: 1 }];
const loading = ref(); const loading = ref();
const list = ref([ const list = ref([
{ {
area:'校内一食堂', area: '校内一食堂',
areaDetail:'505', areaDetail: '505',
applyTime: "2020-12-10", applyTime: "2020-12-10",
startTime:'2021-11-10 8:00', startTime: '2021-11-10 8:00',
endTime:'2021-11-10 11:00', endTime: '2021-11-10 11:00',
handuserName:'我', handuserName: '我',
state: "驳回", //状态(0通过,1驳回) state: "驳回", //状态(0通过,1驳回)
},{ }, {
area:'四教', area: '四教',
areaDetail:'303', areaDetail: '303',
applyTime: "2020-12-10", applyTime: "2020-12-10",
startTime:'2021-11-10 8:00', startTime: '2021-11-10 8:00',
endTime:'2021-11-10 11:00', endTime: '2021-11-10 11:00',
handuserName:'我', handuserName: '我',
state: "通过", //状态(0通过,1驳回) state: "通过", //状态(0通过,1驳回)
} }
]); ]);
...@@ -141,6 +106,7 @@ const goApply = () => { ...@@ -141,6 +106,7 @@ const goApply = () => {
::v-deep .van-dropdown-menu__bar { ::v-deep .van-dropdown-menu__bar {
box-shadow: none !important; box-shadow: none !important;
} }
.main_search { .main_search {
width: 100vw; width: 100vw;
height: 15vw; height: 15vw;
...@@ -154,9 +120,11 @@ const goApply = () => { ...@@ -154,9 +120,11 @@ const goApply = () => {
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
} }
.van-dropdown-menu:root { .van-dropdown-menu:root {
--van-dropdown-menu-box-shadow: none; --van-dropdown-menu-box-shadow: none;
} }
.main_search_2 { .main_search_2 {
height: 15vw; height: 15vw;
display: flex; display: flex;
......
<template> <template>
<!-- <div>钉钉内跳转</div>--> <!-- <div>钉钉内跳转</div>-->
<van-dialog v-model:show="showDialog" title="请选择角色" show-cancel-button @confirm="confirmDialog"> <van-dialog v-model:show="showDialog" title="请选择角色" show-cancel-button @confirm="confirmDialog">
<van-radio-group style="justify-content: space-around;margin: 20px 0" v-model="checked" direction="horizontal"> <van-radio-group style="justify-content: space-around;margin: 20px 0" v-model="checked" direction="horizontal">
<div v-for="(item,index) in typeResult" :key="index"> <div v-for="(item, index) in typeResult" :key="index">
<van-radio :name="item.userLoginType" >{{item.userLoginType == "0" ? '教师' : '家长' }} <van-radio :name="item.userLoginType">{{ item.userLoginType == "0" ? '教师' : '家长' }}
<span v-if="item.userLoginType == '1'">({{ item.studentName }})</span> <span v-if="item.userLoginType == '1'">({{ item.studentName }})</span>
</van-radio> </van-radio>
</div> </div>
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
</template> </template>
<script setup> <script setup>
import {Dialog, Toast} from 'vant'; import { Dialog, Toast } from 'vant';
import {getRole, getToken} from "@/service/dd"; import { getRole, getToken } from "@/service/dd";
import {onMounted, ref} from "vue"; import { onMounted, ref } from "vue";
import * as dd from "dingtalk-jsapi"; import * as dd from "dingtalk-jsapi";
import { setToken, setParentTelephone, setTotyp } from "@/utils/auth"; import { setToken, setParentTelephone, setTotyp } from "@/utils/auth";
import {useRoute, useRouter} from "vue-router"; import { useRoute, useRouter } from "vue-router";
const router = useRouter(); const router = useRouter();
const VanDialog = Dialog.Component; const VanDialog = Dialog.Component;
const showDialog = ref(false); const showDialog = ref(false);
...@@ -44,7 +44,6 @@ const getCode = () => { ...@@ -44,7 +44,6 @@ const getCode = () => {
// console.log('this.authCodeTimestamp', this.authCodeTimestamp); // console.log('this.authCodeTimestamp', this.authCodeTimestamp);
console.log('code', code); console.log('code', code);
getRoleType(code) getRoleType(code)
// console.log('loginResponse', loginResponse); // console.log('loginResponse', loginResponse);
}, },
fail: (res) => { fail: (res) => {
...@@ -69,7 +68,7 @@ const getRoleType = async (code) => { ...@@ -69,7 +68,7 @@ const getRoleType = async (code) => {
const code = res.code const code = res.code
console.log('code', code); console.log('code', code);
const typeNew = type.data[0].userLoginType const typeNew = type.data[0].userLoginType
console.log('666',typeNew) console.log('666', typeNew)
getgetToken(code, typeNew) getgetToken(code, typeNew)
}, },
fail: (res) => { fail: (res) => {
...@@ -89,8 +88,8 @@ const getRoleType = async (code) => { ...@@ -89,8 +88,8 @@ const getRoleType = async (code) => {
} }
// 获取token登录 // 获取token登录
const getgetToken = async (code, roleType) => { const getgetToken = async (code, roleType) => {
console.log('token code',code) console.log('token code', code)
console.log('token roleType',roleType) console.log('token roleType', roleType)
const result = await getToken(code, roleType); const result = await getToken(code, roleType);
console.log("asdasd", result); console.log("asdasd", result);
if (result.code == 200) { if (result.code == 200) {
...@@ -99,11 +98,11 @@ const getgetToken = async (code, roleType) => { ...@@ -99,11 +98,11 @@ const getgetToken = async (code, roleType) => {
console.log(router); console.log(router);
router.replace({ router.replace({
path: "/main", path: "/main",
query:{ query: {
roleType:roleType roleType: roleType
}, },
}); });
}else if (result.code == 500) { } else if (result.code == 500) {
Toast("获取信息失败,请重新进入"); Toast("获取信息失败,请重新进入");
return; return;
} }
...@@ -111,7 +110,7 @@ const getgetToken = async (code, roleType) => { ...@@ -111,7 +110,7 @@ const getgetToken = async (code, roleType) => {
//确认弹框,再次获取code码 //确认弹框,再次获取code码
const confirmDialog = () => { const confirmDialog = () => {
console.log('确认',checked.value) console.log('确认', checked.value)
dd.getAuthCode({ dd.getAuthCode({
// corpId: 'dingaa3937ff8b7dd267f2c783f7214b6d69', // corpId: 'dingaa3937ff8b7dd267f2c783f7214b6d69',
corpId: 'dingccea40788226c988f2c783f7214b6d69', corpId: 'dingccea40788226c988f2c783f7214b6d69',
...@@ -130,7 +129,4 @@ const confirmDialog = () => { ...@@ -130,7 +129,4 @@ const confirmDialog = () => {
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="less"></style>
</style>
...@@ -10,18 +10,9 @@ ...@@ -10,18 +10,9 @@
:src="require('../../assets/person_info_5.png')" :src="require('../../assets/person_info_5.png')"
fit="contain" fit="contain"
></van-image> --> ></van-image> -->
<van-uploader <van-uploader class="m_top_info_img_div" :after-read="afterCard" accept="image/*" :max-size="10240 * 1024">
class="m_top_info_img_div" <img style="border-radius: 50px; width: 100%; height: 100%" :src="imgUrl ? imgUrl : require('../../assets/person_info_5.png')
:after-read="afterCard" " />
accept="image/*"
:max-size="10240 * 1024"
>
<img
style="border-radius: 50px; width: 100%; height: 100%"
:src="
imgUrl ? imgUrl : require('../../assets/person_info_5.png')
"
/>
<!-- <van-image :src="imgUrl ? imgUrl : require('../../assets/person_info_5.png')" />s --> <!-- <van-image :src="imgUrl ? imgUrl : require('../../assets/person_info_5.png')" />s -->
<!-- <van-tag type="danger" class="vip" size="medium">VIP</van-tag> --> <!-- <van-tag type="danger" class="vip" size="medium">VIP</van-tag> -->
</van-uploader> </van-uploader>
...@@ -29,26 +20,18 @@ ...@@ -29,26 +20,18 @@
<div class="m_top_info_div"> <div class="m_top_info_div">
<div class="row_top"> <div class="row_top">
<span class="m_top_info_one"> <span class="m_top_info_one">
{{ state.teacherInfo.teacherName }}</span {{ state.teacherInfo.teacherName }}</span>
> <span @click="onLoginOut" class="m_top_info_rtun">
<!-- <span @click="onLoginOut" class="m_top_info_rtun">--> 退出登录</span>
<!-- 退出登录</span-->
<!-- >-->
</div> </div>
<div class="m_top_info_bot2"> <div class="m_top_info_bot2">
<span class="m_top_info_two"> <span class="m_top_info_two">
{{ state.teacherInfo.teacherCode }}</span {{ state.teacherInfo.teacherCode }}</span>
>
<span class="" style="display: flex"> <span class="" style="display: flex">
<span class="m_top_info_two">联系方式</span> <span class="m_top_info_two">联系方式</span>
<a <a class="m_top_info_two" f="'tel:' + state.teacherInfo.teacherTel">
class="m_top_info_two" {{ state.teacherInfo.teacherTel }}</a></span>
f="'tel:' + state.teacherInfo.teacherTel"
>
{{ state.teacherInfo.teacherTel }}</a
></span
>
</div> </div>
</div> </div>
</div> </div>
...@@ -57,113 +40,80 @@ ...@@ -57,113 +40,80 @@
</div> </div>
<div class="main"> <div class="main">
<div class=""> <div class="">
<van-cell-group <van-cell-group inset style="
inset
style="
background: #ffffff; background: #ffffff;
border-radius: 6px; border-radius: 6px;
box-shadow: 0px 0px 10px rgba(2, 21, 99, 0.1); box-shadow: 0px 0px 10px rgba(2, 21, 99, 0.1);
" ">
>
<van-cell> <van-cell>
<template #title <template #title><span style="
><span
style="
height: 20px; height: 20px;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 700; font-weight: 700;
color: #6f787d; color: #6f787d;
font-size: 14px; font-size: 14px;
" ">生日</span></template>
>生日</span <a style="
></template
>
<a
style="
height: 20px; height: 20px;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 700; font-weight: 700;
color: #6f787d; color: #6f787d;
font-size: 14px; font-size: 14px;
" ">
> {{ state.teacherInfo.birthday }}</a>
{{ state.teacherInfo.birthday }}</a
>
</van-cell> </van-cell>
<van-cell> <van-cell>
<template #title <template #title><span style="
><span
style="
height: 20px; height: 20px;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 700; font-weight: 700;
color: #6f787d; color: #6f787d;
font-size: 14px; font-size: 14px;
" ">民族</span></template>
>民族</span <a style="
></template
>
<a
style="
height: 20px; height: 20px;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 700; font-weight: 700;
color: #6f787d; color: #6f787d;
font-size: 14px; font-size: 14px;
" ">
> {{ state.teacherInfo.nation }}</a>
{{ state.teacherInfo.nation }}</a
>
</van-cell> </van-cell>
<van-cell> <van-cell>
<template #title <template #title><span style="
><span
style="
height: 20px; height: 20px;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 700; font-weight: 700;
color: #6f787d; color: #6f787d;
font-size: 14px; font-size: 14px;
" ">地址</span></template>
>地址</span <a style="
></template
>
<a
style="
height: 20px; height: 20px;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 700; font-weight: 700;
color: #6f787d; color: #6f787d;
font-size: 14px; font-size: 14px;
" ">
> {{ state.teacherInfo.homeAddress }}</a>
{{ state.teacherInfo.homeAddress }}</a
>
</van-cell> </van-cell>
<van-cell> <van-cell>
<template #title> <template #title>
<span <span style="
style="
height: 20px; height: 20px;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 700; font-weight: 700;
color: #6f787d; color: #6f787d;
font-size: 14px; font-size: 14px;
" ">性别</span>
>性别</span
>
</template> </template>
<span <span style="
style="
height: 20px; height: 20px;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 700; font-weight: 700;
color: #6f787d; color: #6f787d;
font-size: 14px; font-size: 14px;
" ">{{ state.teacherInfo.sex === "0" ? "男" : "女" }}</span>
>{{ state.teacherInfo.sex === "0" ? "男" : "女" }}</span
>
</van-cell> </van-cell>
<!--<van-cell>--> <!--<van-cell>-->
<!-- <template #title><span>工龄</span></template>--> <!-- <template #title><span>工龄</span></template>-->
...@@ -174,54 +124,34 @@ ...@@ -174,54 +124,34 @@
<!-- <a> 10</a>--> <!-- <a> 10</a>-->
<!--</van-cell>--> <!--</van-cell>-->
</van-cell-group> </van-cell-group>
<van-cell <van-cell style="
style="
margin: 15px; margin: 15px;
background: #ffffff; background: #ffffff;
border-radius: 6px; border-radius: 6px;
box-shadow: 0px 0px 10px rgba(2, 21, 99, 0.1); box-shadow: 0px 0px 10px rgba(2, 21, 99, 0.1);
width: auto; width: auto;
" " to="SchoolTeacherAward" title="我的荣誉" is-link />
to="SchoolTeacherAward" <van-cell style="
title="我的荣誉"
is-link
/>
<van-cell
style="
margin: 15px; margin: 15px;
background: #ffffff; background: #ffffff;
border-radius: 6px; border-radius: 6px;
box-shadow: 0px 0px 10px rgba(2, 21, 99, 0.1); box-shadow: 0px 0px 10px rgba(2, 21, 99, 0.1);
width: auto; width: auto;
" " to="teacherResume" title="我的履历" is-link />
to="teacherResume" <van-cell style="
title="我的履历"
is-link
/>
<van-cell
style="
margin: 15px; margin: 15px;
background: #ffffff; background: #ffffff;
border-radius: 6px; border-radius: 6px;
box-shadow: 0px 0px 10px rgba(2, 21, 99, 0.1); box-shadow: 0px 0px 10px rgba(2, 21, 99, 0.1);
width: auto; width: auto;
" " title="我的领用" is-link to="myUse" />
title="我的领用" <van-cell style="
is-link
to="myUse"
/>
<van-cell
style="
margin: 15px; margin: 15px;
background: #ffffff; background: #ffffff;
border-radius: 6px; border-radius: 6px;
box-shadow: 0px 0px 10px rgba(2, 21, 99, 0.1); box-shadow: 0px 0px 10px rgba(2, 21, 99, 0.1);
width: auto; width: auto;
" " title="修改密码" is-link to="changePassword" />
title="修改密码"
is-link
to="changePassword"
/>
</div> </div>
</div> </div>
</div> </div>
...@@ -271,7 +201,7 @@ export default { ...@@ -271,7 +201,7 @@ export default {
const loadData = async () => { const loadData = async () => {
console.log("加载数据"); console.log("加载数据");
state.imgUrl = store.state.userInfo.avatar; state.imgUrl = store.state.userInfo.avatar;
console.log('userInfo',store.state.userInfo) console.log('userInfo', store.state.userInfo)
}; };
onMounted(async () => { onMounted(async () => {
loadData(); loadData();
...@@ -279,7 +209,7 @@ export default { ...@@ -279,7 +209,7 @@ export default {
}); });
const initUserInfo = async () => { const initUserInfo = async () => {
console.log('store',store) console.log('store', store)
//访问后台接口 //访问后台接口
let result = await getteacherInfo(); let result = await getteacherInfo();
if (result.code == 200) { if (result.code == 200) {
...@@ -318,18 +248,18 @@ export default { ...@@ -318,18 +248,18 @@ export default {
//删除所有 //删除所有
//localStorage.clear(); //localStorage.clear();
Toast.success("退出成功"); Toast.success("退出成功");
console.log('openId',store) console.log('openId', store)
//测试服务器 //测试服务器
// console.log('window',window) // console.log('window',window)
// window.location.href = window.location.href.split('?')[0] // window.location.href = window.location.href.split('?')[0]
router.replace({ router.replace({
path: "/login", path: "/login",
query: { query: {
isLogout:1 isLogout: 1
}, },
}); });
}) })
.catch(() => {}); .catch(() => { });
}) })
.catch(() => { .catch(() => {
// on cancel // on cancel
...@@ -416,11 +346,9 @@ export default { ...@@ -416,11 +346,9 @@ export default {
.m_top_info { .m_top_info {
height: 141px; height: 141px;
background: linear-gradient( background: linear-gradient(180deg,
180deg, #39befe 0%,
#39befe 0%, rgba(255, 255, 255, 0) 100%);
rgba(255, 255, 255, 0) 100%
);
.m_top_info_top { .m_top_info_top {
width: 100vw; width: 100vw;
......
...@@ -4,46 +4,52 @@ ...@@ -4,46 +4,52 @@
<van-cell-group inset> <van-cell-group inset>
<van-field readonly v-model="equipmentForm.encode" label="自编码" /> <van-field readonly v-model="equipmentForm.encode" label="自编码" />
<van-field readonly v-model="equipmentForm.equipmentName" label="设备名称" /> <van-field readonly v-model="equipmentForm.equipmentName" label="设备名称" />
<van-field readonly v-model="equipmentForm.model" label="型号"/> <van-field readonly v-model="equipmentForm.model" label="型号" />
<!-- <van-field readonly v-model="equipmentForm.specification" label="规格"/>--> <!-- <van-field readonly v-model="equipmentForm.specification" label="规格"/>-->
<van-field readonly v-model="equipmentForm.classificationCode" label="分类编码"/> <van-field readonly v-model="equipmentForm.classificationCode" label="分类编码" />
<van-field readonly v-model="equipmentForm.unit" label="单位"/> <van-field readonly v-model="equipmentForm.unit" label="单位" />
<van-field readonly v-model="affiliationType" label="归属类型"/> <van-field readonly v-model="affiliationType" label="归属类型" />
<van-field readonly v-model="equipmentState" label="设备状态"/> <!-- <van-field readonly v-model="equipmentState" label="设备状态"/> -->
<van-field readonly v-model="isAllowLend" label="是否允许借出"/> <!-- <van-field readonly v-model="isAllowLend" label="是否允许借出" /> -->
<van-field readonly v-model="isLend" label="是否借出"/> <!-- <van-field readonly v-model="isLend" label="是否借出" /> -->
<van-field readonly v-model="equipmentForm.dateOfProduction" label="安装时间"/> <van-field readonly v-model="equipmentForm.dateOfProduction" label="安装时间" />
<van-field readonly v-model="equipmentForm.price" label="价格(元)"/> <van-field readonly v-model="equipmentForm.price" label="价格(元)" />
<van-field readonly v-model="equipmentForm.lifeOfUtility" label="效用年限(年)"/> <van-field readonly v-model="equipmentForm.lifeOfUtility" label="效用年限(年)" />
<van-field readonly v-model="equipmentForm.place" label="地点"/> <van-field readonly v-model="equipmentForm.place" label="地点" />
<van-field readonly v-model="equipmentForm.useName" label="使用人" /> <van-field readonly v-model="equipmentForm.useName" label="使用人" />
<!-- 新加两个字段 出厂编号、批号 -->
<van-field readonly v-model="equipmentForm.unit" label="出厂编号" />
<van-field readonly v-model="equipmentForm.ph" label="批号" />
<van-field readonly v-model="equipmentForm.remark" label="备注" /> <van-field readonly v-model="equipmentForm.remark" label="备注" />
</van-cell-group> </van-cell-group>
<van-button round block type="primary" size="small" style="width: 80px;margin:0 auto" @click="goback"> <van-button round block type="primary" size="small" style="width: 80px;margin:0 auto" @click="goback">
关 闭 关 闭
</van-button> </van-button>
</van-form> </van-form>
</template> </template>
<script setup> <script setup>
import {reactive, ref, onMounted} from "vue"; import { reactive, ref, onMounted } from "vue";
import { scanEquipmentInfo} from "@/service/schoolProperty" import { scanEquipmentInfo } from "@/service/schoolProperty"
import {useRoute, useRouter} from "vue-router"; import { useRoute, useRouter } from "vue-router";
import {Dialog, Toast} from "vant"; import { Dialog, Toast } from "vant";
import {useStore} from "vuex"; import { useStore } from "vuex";
const equipmentForm = reactive({ const equipmentForm = reactive({
encode:'', encode: '',
equipmentName:'', equipmentName: '',
model:'', model: '',
// specification:'', // specification:'',
classificationCode:'', classificationCode: '',
unit:'', unit: '',
dateOfProduction:'', dateOfProduction: '',
price:'', price: '',
lifeOfUtility:'', lifeOfUtility: '',
place:'', place: '',
useName:'', useName: '',
remark:'' remark: '',
unit: '',
ph: '',
// 需要新加两个字段出厂编号、批号
}) })
const affiliationType = ref('') const affiliationType = ref('')
const equipmentState = ref('') const equipmentState = ref('')
...@@ -54,10 +60,10 @@ const router = useRouter(); ...@@ -54,10 +60,10 @@ const router = useRouter();
const route = useRoute(); const route = useRoute();
const store = useStore(); const store = useStore();
const queryEncode = route.query.encode const queryEncode = route.query.encode
onMounted( async () => { onMounted(async () => {
let result = await scanEquipmentInfo(queryEncode) let result = await scanEquipmentInfo(queryEncode)
console.log('result',result) console.log('result', result)
if(result.code == 3000){ if (result.code == 3000) {
Dialog.alert({ Dialog.alert({
title: '提示', title: '提示',
message: result.msg, message: result.msg,
...@@ -65,31 +71,31 @@ onMounted( async () => { ...@@ -65,31 +71,31 @@ onMounted( async () => {
router.back(); router.back();
}); });
} }
if(result.code == 200){ if (result.code == 200) {
Object.assign(equipmentForm,result.data) Object.assign(equipmentForm, result.data)
if(result.data.affiliationType == '1'){ if (result.data.affiliationType == '1') {
affiliationType.value = '公共区域' affiliationType.value = '公共区域'
}else if(result.data.affiliationType == '2'){ } else if (result.data.affiliationType == '2') {
affiliationType.value = '信息中心' affiliationType.value = '信息中心'
}else{ } else {
affiliationType.value = '个人' affiliationType.value = '个人'
} }
if(result.data.equipmentState == '1'){ if (result.data.equipmentState == '1') {
equipmentState.value = '完好' equipmentState.value = '完好'
}else if(result.data.equipmentState == '2'){ } else if (result.data.equipmentState == '2') {
equipmentState.value = '损坏' equipmentState.value = '损坏'
}else{ } else {
equipmentState.value = '报废' equipmentState.value = '报废'
} }
if(result.data.isAllowLend == '1'){ if (result.data.isAllowLend == '1') {
isAllowLend.value = '是' isAllowLend.value = '是'
}else{ } else {
isAllowLend.value = '否' isAllowLend.value = '否'
} }
if(result.data.isLend == '1'){ if (result.data.isLend == '1') {
isLend.value ='是' isLend.value = '是'
}else{ } else {
isLend.value ='否' isLend.value = '否'
} }
} }
...@@ -102,6 +108,4 @@ const goback = () => { ...@@ -102,6 +108,4 @@ const goback = () => {
</script> </script>
<style scoped> <style scoped></style>
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment