Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dd_zhxy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangqi
dd_zhxy
Commits
50341b1c
Commit
50341b1c
authored
Aug 21, 2023
by
peijy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8.21 校产管理
parent
3d10c67c
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
2353 additions
and
936 deletions
+2353
-936
package.json
+1
-0
src/router/index.js
+624
-594
src/service/schoolProperty.js
+35
-11
src/service/studentCourseSelection.js
+6
-1
src/utils/axios.js
+93
-93
src/utils/scanCode.js
+48
-3
src/views/login/login.vue
+3
-1
src/views/parent/InforCollection/apply.vue
+9
-0
src/views/parent/studentCourseSelection/checkCourse.vue
+74
-0
src/views/parent/studentCourseSelection/index.vue
+94
-37
src/views/tabbar/TeacherInfo.vue
+1
-0
src/views/tabbar/main/index.vue
+36
-6
src/views/teacher/schoolProperty/borrowDetail.vue
+98
-31
src/views/teacher/schoolProperty/borrowList.vue
+28
-3
src/views/teacher/schoolProperty/deviceList.vue
+55
-13
src/views/teacher/schoolProperty/deviceListInfo.vue
+252
-73
src/views/teacher/schoolProperty/equipmentFix.vue
+160
-0
src/views/teacher/schoolProperty/equipmentFixDetail.vue
+205
-0
src/views/teacher/schoolProperty/equipmentInfo.vue
+99
-0
src/views/teacher/schoolProperty/index.vue
+91
-18
src/views/teacher/schoolProperty/returnDetail.vue
+151
-0
src/views/teacher/schoolProperty/returnList.vue
+69
-20
src/views/teacher/schoolProperty/useAdd.vue
+73
-20
src/views/teacher/schoolProperty/useList.vue
+48
-12
vue.config.js
+0
-0
No files found.
package.json
View file @
50341b1c
...
...
@@ -14,6 +14,7 @@
"
core-js
"
:
"^3.6.5"
,
"
fs
"
:
"^0.0.1-security"
,
"
js-cookie
"
:
"^3.0.1"
,
"
moment
"
:
"^2.29.4"
,
"
path
"
:
"^0.12.7"
,
"
useless-files-webpack-plugin
"
:
"^1.0.1"
,
"
vant
"
:
"^3.0.16"
,
...
...
src/router/index.js
View file @
50341b1c
import
{
createRouter
,
createWebHashHistory
,
createWebHistory
}
from
"vue-router"
;
import
{
Toast
}
from
"vant"
;
import
{
createRouter
,
createWebHashHistory
,
createWebHistory
}
from
"vue-router"
;
import
{
Toast
}
from
"vant"
;
// createWebHistory
const
routes
=
[
/* 登录 */
// {
// path: "/login",
// name: "Home",
// component: () => import("../views/Home.vue"),
// },
/* 登录 */
{
path
:
""
,
name
:
"login"
,
component
:
()
=>
import
(
"../views/login/login.vue"
),
children
:
[
{
path
:
"login"
,
/* 登录 */
// {
// path: "/login",
// name: "Home",
// component: () => import("../views/Home.vue"),
// },
/* 登录 */
{
path
:
""
,
name
:
"login"
,
component
:
()
=>
import
(
"../views/login/login.vue"
),
meta
:
{
requireAuth
:
true
,
},
},
],
},
/* 主页 */
{
path
:
"/main"
,
name
:
"main"
,
// children: [
// {
// path: "main",
// name: "Main",
// component: () => import("../views/tabbar/main/index.vue"),
// meta: {
// requireAuth: true,
// },
// },
// ],
component
:
()
=>
import
(
"../views/tabbar/main/index.vue"
),
},
/* 个人信息 */
{
path
:
"/personInfo"
,
name
:
"PersonInfo"
,
component
:
()
=>
import
(
"../views/tabbar/PersonInfo.vue"
),
},
/* 考试成绩*/
{
path
:
"/achievement"
,
name
:
"Achievement"
,
component
:
()
=>
import
(
"../views/parent/achievement.vue"
),
},
/* 考试列表 教师端*/
{
path
:
"/exlisttec"
,
name
:
"Exlisttec"
,
component
:
()
=>
import
(
"../views/teacher/exlisttec.vue"
),
},
children
:
[
{
path
:
"login"
,
name
:
"login"
,
component
:
()
=>
import
(
"../views/login/login.vue"
),
meta
:
{
requireAuth
:
true
,
},
},
],
},
/* 主页 */
{
path
:
"/main"
,
name
:
"main"
,
// children: [
// {
// path: "main",
// name: "Main",
// component: () => import("../views/tabbar/main/index.vue"),
// meta: {
// requireAuth: true,
// },
// },
// ],
component
:
()
=>
import
(
"../views/tabbar/main/index.vue"
),
},
/* 个人信息 */
{
path
:
"/personInfo"
,
name
:
"PersonInfo"
,
component
:
()
=>
import
(
"../views/tabbar/PersonInfo.vue"
),
},
/* 考试成绩*/
{
path
:
"/achievement"
,
name
:
"Achievement"
,
component
:
()
=>
import
(
"../views/parent/achievement.vue"
),
},
/* 考试列表 教师端*/
{
path
:
"/exlisttec"
,
name
:
"Exlisttec"
,
component
:
()
=>
import
(
"../views/teacher/exlisttec.vue"
),
},
/* 考试成绩 教师端*/
{
path
:
"/achievementtec"
,
name
:
"Achievementtec"
,
component
:
()
=>
import
(
"../views/teacher/achievementtec.vue"
),
},
/* 考试列表*/
{
path
:
"/exlist"
,
name
:
"Exlist"
,
component
:
()
=>
import
(
"../views/parent/exlist.vue"
),
},
/* 考试成绩 教师端*/
{
path
:
"/achievementtec"
,
name
:
"Achievementtec"
,
component
:
()
=>
import
(
"../views/teacher/achievementtec.vue"
),
},
/* 考试列表*/
{
path
:
"/exlist"
,
name
:
"Exlist"
,
component
:
()
=>
import
(
"../views/parent/exlist.vue"
),
},
/* 校历*/
{
path
:
"/Calendar"
,
name
:
"Calendar"
,
component
:
()
=>
import
(
"../views/public/Calendar.vue"
),
},
/* 个人信息 老师*/
{
path
:
"/teacherInfo"
,
name
:
"TeacherInfo"
,
component
:
()
=>
import
(
"../views/tabbar/TeacherInfo.vue"
),
},
/* 问卷调查列表 */
{
path
:
"/questionnairelist"
,
name
:
"questionnairelist"
,
component
:
()
=>
import
(
"../views/public/questionnaire/questionnairelist.vue"
),
},
/* 问卷调查详情 */
{
path
:
"/questionnairedetail"
,
name
:
"questionnairedetail"
,
component
:
()
=>
import
(
"../views/public/questionnaire/questionnairedetail.vue"
),
},
/* 校历*/
{
path
:
"/Calendar"
,
name
:
"Calendar"
,
component
:
()
=>
import
(
"../views/public/Calendar.vue"
),
},
/* 个人信息 老师*/
{
path
:
"/teacherInfo"
,
name
:
"TeacherInfo"
,
component
:
()
=>
import
(
"../views/tabbar/TeacherInfo.vue"
),
},
/* 问卷调查列表 */
{
path
:
"/questionnairelist"
,
name
:
"questionnairelist"
,
component
:
()
=>
import
(
"../views/public/questionnaire/questionnairelist.vue"
),
},
/* 问卷调查详情 */
{
path
:
"/questionnairedetail"
,
name
:
"questionnairedetail"
,
component
:
()
=>
import
(
"../views/public/questionnaire/questionnairedetail.vue"
),
},
/* 学生请假 */
{
path
:
"/studentLeave"
,
name
:
"StudentLeave"
,
component
:
()
=>
import
(
"../views/parent/leave.vue"
),
},
/* 学生请假 */
{
path
:
"/studentLeavetask"
,
name
:
"studentLeavetask"
,
component
:
()
=>
import
(
"../views/parent/studentLeavexj.vue"
),
},
/* 学生请假详情 */
{
path
:
"/studentLeavedetail"
,
name
:
"studentLeavedetail"
,
component
:
()
=>
import
(
"../views/parent/leavedetail.vue"
),
// meta: { keepAlive: true }, //需要缓存的页面 }
},
/* 学生请假 */
{
path
:
"/studentLeave"
,
name
:
"StudentLeave"
,
component
:
()
=>
import
(
"../views/parent/leave.vue"
),
},
{
path
:
"/studentLeave/detail/:id"
,
name
:
"LeaveDetail"
,
component
:
()
=>
import
(
"../views/parent/LeaveProcess.vue"
),
},
/* 学生请假 */
{
path
:
"/studentLeavetask"
,
name
:
"studentLeavetask"
,
component
:
()
=>
import
(
"../views/parent/studentLeavexj.vue"
),
},
/* 学生请假详情 */
{
path
:
"/studentLeavedetail"
,
name
:
"studentLeavedetail"
,
component
:
()
=>
import
(
"../views/parent/leavedetail.vue"
),
// meta: { keepAlive: true }, //需要缓存的页面 }
},
/* 老师请假请假详情 */
{
path
:
"/teacherLeave"
,
name
:
"teacherLeave"
,
component
:
()
=>
import
(
"../views/teacher/leave.vue"
),
},
{
path
:
"/studentLeave/detail/:id"
,
name
:
"LeaveDetail"
,
component
:
()
=>
import
(
"../views/parent/LeaveProcess.vue"
),
},
/* 老师请假请假详情 */
{
path
:
"/teacherLeave"
,
name
:
"teacherLeave"
,
component
:
()
=>
import
(
"../views/teacher/leave.vue"
),
},
// /* 人物查询 */
// {
// path: "/seachName",
// name: "seachName",
// component: () => import("../views/public/seachName.vue"),
// },
/* 冬夏时令 */
{
path
:
"/time"
,
name
:
"time"
,
component
:
()
=>
import
(
"../views/public/time.vue"
),
},
/* 学生请假 申请页 */
{
path
:
"/studentLeaveApply"
,
name
:
"StudentLeaveApply"
,
component
:
()
=>
import
(
"../views/parent/StudentLeaveApply.vue"
),
},
/* 园区介绍 */
{
path
:
"/gardenIntr"
,
name
:
"GardenIntr"
,
component
:
()
=>
import
(
"../views/tabbar/GardenIntr.vue"
),
},
/* 每日食谱 */
{
path
:
"/everydayFood"
,
name
:
"EverydayFood"
,
component
:
()
=>
import
(
"../views/EverydayFood.vue"
),
},
/* 消息通知 */
{
path
:
"/messageNotice"
,
name
:
"MessageNotice"
,
component
:
()
=>
import
(
"../views/MessageNotice.vue"
),
},
/* 消息通知 详情 */
{
path
:
"/messageNoticeDetail"
,
name
:
"MessageNoticeDetail"
,
component
:
()
=>
import
(
"../views/MessageNoticeDetail.vue"
),
},
/* 德育 */
{
path
:
"/moralEducation"
,
name
:
"moralEducation"
,
component
:
()
=>
import
(
"../views/parent/moralEducation/index.vue"
),
},
/* 学生德育详情 */
{
path
:
"/moralEducationDetail"
,
name
:
"moralEducationDetail"
,
component
:
()
=>
import
(
"../views/parent/moralEducation/detail.vue"
),
},
/* 教师列表页 家长端 */
{
path
:
"/teacherList"
,
name
:
"TeacherList"
,
component
:
()
=>
import
(
"../views/parent/TeacherList.vue"
),
},
/* 学生选课 家长端 */
{
path
:
"/studentCourseSelection"
,
name
:
"studentCourseSelection"
,
component
:
()
=>
import
(
"../views/parent/studentCourseSelection/index"
),
},
/* 学生选课 家长端 学科成绩 */
{
path
:
"/subjectAchievement"
,
name
:
"subjectAchievement"
,
component
:
()
=>
import
(
"../views/parent/studentCourseSelection/subjectAchievement"
),
},
/* 学生选课 家长端 成绩查看 */
{
path
:
"/totalScoreView"
,
name
:
"totalScoreView"
,
component
:
()
=>
import
(
"../views/parent/studentCourseSelection/totalScoreView"
),
},
/* 教师列表页 教师端的 可以查看所有教师 */
{
path
:
"/teacherListTeac"
,
name
:
"TeacherListTeac"
,
component
:
()
=>
import
(
"../views/teacher/TeacherListTeac.vue"
),
},
// /* 课程表 */
// {
// path: "/gradeSchedule",
// name: "GradeSchedule",
// component: () => import("../views/tabbar/GradeSchedule.vue"),
// },
/* 课程表 */
{
path
:
"/gradeSchedule"
,
name
:
"GradeSchedule"
,
component
:
()
=>
import
(
"../views/tabbar/lesson.vue"
),
},
/* 课程表 学生1111111111 */
{
path
:
"/lesson"
,
name
:
"lesson"
,
component
:
()
=>
import
(
"../views/tabbar/lesson.vue"
),
},
/* 班级列表页 */
{
path
:
"/gradeList"
,
name
:
"GradeList"
,
component
:
()
=>
import
(
"../views/parent/GradeList.vue"
),
},
/* 班级列表页 教师端 */
{
path
:
"/gradeListTeac"
,
name
:
"GradeListTeac"
,
component
:
()
=>
import
(
"../views/teacher/GradeListTeac.vue"
),
},
/* 学生考勤页 */
{
path
:
"/attendance"
,
name
:
"Attendance"
,
component
:
()
=>
import
(
"../views/Attendance.vue"
),
},
{
path
:
"/courseSele"
,
name
:
"courseSele"
,
component
:
()
=>
import
(
"../views/parent/courseSele.vue"
),
},
// 综合素质
{
path
:
"/qualitylist"
,
name
:
"qualitylist"
,
component
:
()
=>
import
(
"../views/parent/qualitylist.vue"
),
},
/* 教师工资 */
{
path
:
"/wagesdetail"
,
name
:
"WageList"
,
component
:
()
=>
import
(
"../views/teacher/wagesdetail.vue"
),
},
{
path
:
"/wagesdetail/info/:id"
,
name
:
"WageDetail"
,
component
:
()
=>
import
(
"../views/teacher/wagesDetails/WageDetail.vue"
),
},
//值班
{
path
:
"/dutylist"
,
name
:
"dutylist"
,
component
:
()
=>
import
(
"../views/teacher/Dutytable/list.vue"
),
},
{
path
:
"/dutydetail"
,
name
:
"Dutydetail"
,
component
:
()
=>
import
(
"../views/teacher/Dutytable/detail.vue"
),
},
{
path
:
"/dutydetailh"
,
name
:
"Dutydetailh"
,
component
:
()
=>
import
(
"../views/teacher/Dutytable/detailh.vue"
),
},
{
path
:
"/overworklist"
,
name
:
"overworklist"
,
component
:
()
=>
import
(
"../views/teacher/overwork/list.vue"
),
},
{
path
:
"/overworkdetail"
,
name
:
"overworkdetail"
,
component
:
()
=>
import
(
"../views/teacher/overwork/detail.vue"
),
},
{
path
:
"/overworkapply"
,
name
:
"overworkapply"
,
component
:
()
=>
import
(
"../views/teacher/overwork/Apply.vue"
),
},
{
path
:
"/patrollist"
,
name
:
"patrollist"
,
component
:
()
=>
import
(
"../views/teacher/patrol/list.vue"
),
},
{
path
:
"/patroldetail"
,
name
:
"patroldetail"
,
component
:
()
=>
import
(
"../views/teacher/patrol/detail.vue"
),
},
{
path
:
"/task"
,
name
:
"task"
,
component
:
()
=>
import
(
"../views/teacher/task/index.vue"
),
},
{
path
:
"/taskleave"
,
name
:
"taskleave"
,
component
:
()
=>
import
(
"../views/teacher/task/leavedetail.vue"
),
},
/* 教师考勤 */
{
path
:
"/attendance"
,
name
:
"Attendance"
,
redirect
:
"/attendance/sign"
,
component
:
()
=>
import
(
"../views/teacher/attendance/Attendance.vue"
),
children
:
[
{
path
:
"sign"
,
name
:
"Sign"
,
component
:
()
=>
import
(
"../views/teacher/attendance/Sign.vue"
),
},
{
path
:
"history"
,
name
:
"History"
,
// /* 人物查询 */
// {
// path: "/seachName",
// name: "seachName",
// component: () => import("../views/public/seachName.vue"),
// },
/* 冬夏时令 */
{
path
:
"/time"
,
name
:
"time"
,
component
:
()
=>
import
(
"../views/public/time.vue"
),
},
/* 学生请假 申请页 */
{
path
:
"/studentLeaveApply"
,
name
:
"StudentLeaveApply"
,
component
:
()
=>
import
(
"../views/parent/StudentLeaveApply.vue"
),
},
/* 园区介绍 */
{
path
:
"/gardenIntr"
,
name
:
"GardenIntr"
,
component
:
()
=>
import
(
"../views/tabbar/GardenIntr.vue"
),
},
/* 每日食谱 */
{
path
:
"/everydayFood"
,
name
:
"EverydayFood"
,
component
:
()
=>
import
(
"../views/EverydayFood.vue"
),
},
/* 消息通知 */
{
path
:
"/messageNotice"
,
name
:
"MessageNotice"
,
component
:
()
=>
import
(
"../views/MessageNotice.vue"
),
},
/* 消息通知 详情 */
{
path
:
"/messageNoticeDetail"
,
name
:
"MessageNoticeDetail"
,
component
:
()
=>
import
(
"../views/MessageNoticeDetail.vue"
),
},
/* 德育 */
{
path
:
"/moralEducation"
,
name
:
"moralEducation"
,
component
:
()
=>
import
(
"../views/parent/moralEducation/index.vue"
),
},
/* 学生德育详情 */
{
path
:
"/moralEducationDetail"
,
name
:
"moralEducationDetail"
,
component
:
()
=>
import
(
"../views/parent/moralEducation/detail.vue"
),
},
/* 教师列表页 家长端 */
{
path
:
"/teacherList"
,
name
:
"TeacherList"
,
component
:
()
=>
import
(
"../views/parent/TeacherList.vue"
),
},
/* 学生选课 家长端 */
{
path
:
"/studentCourseSelection"
,
name
:
"studentCourseSelection"
,
component
:
()
=>
import
(
"../views/parent/studentCourseSelection/index"
),
},
/* 学生选课 家长端 超过日期页面 */
{
path
:
"/studentCourse"
,
name
:
"studentCourse"
,
component
:
()
=>
import
(
"../views/parent/studentCourseSelection/checkCourse"
),
},
/* 学生选课 家长端 学科成绩 */
{
path
:
"/subjectAchievement"
,
name
:
"subjectAchievement"
,
component
:
()
=>
import
(
"../views/parent/studentCourseSelection/subjectAchievement"
),
},
/* 学生选课 家长端 成绩查看 */
{
path
:
"/totalScoreView"
,
name
:
"totalScoreView"
,
component
:
()
=>
import
(
"../views/parent/studentCourseSelection/totalScoreView"
),
},
/* 教师列表页 教师端的 可以查看所有教师 */
{
path
:
"/teacherListTeac"
,
name
:
"TeacherListTeac"
,
component
:
()
=>
import
(
"../views/teacher/TeacherListTeac.vue"
),
},
// /* 课程表 */
// {
// path: "/gradeSchedule",
// name: "GradeSchedule",
// component: () => import("../views/tabbar/GradeSchedule.vue"),
// },
/* 课程表 */
{
path
:
"/gradeSchedule"
,
name
:
"GradeSchedule"
,
component
:
()
=>
import
(
"../views/tabbar/lesson.vue"
),
},
/* 课程表 学生1111111111 */
{
path
:
"/lesson"
,
name
:
"lesson"
,
component
:
()
=>
import
(
"../views/tabbar/lesson.vue"
),
},
/* 班级列表页 */
{
path
:
"/gradeList"
,
name
:
"GradeList"
,
component
:
()
=>
import
(
"../views/parent/GradeList.vue"
),
},
/* 班级列表页 教师端 */
{
path
:
"/gradeListTeac"
,
name
:
"GradeListTeac"
,
component
:
()
=>
import
(
"../views/teacher/GradeListTeac.vue"
),
},
/* 学生考勤页 */
{
path
:
"/attendance"
,
name
:
"Attendance"
,
component
:
()
=>
import
(
"../views/Attendance.vue"
),
},
{
path
:
"/courseSele"
,
name
:
"courseSele"
,
component
:
()
=>
import
(
"../views/parent/courseSele.vue"
),
},
// 综合素质
{
path
:
"/qualitylist"
,
name
:
"qualitylist"
,
component
:
()
=>
import
(
"../views/parent/qualitylist.vue"
),
},
/* 教师工资 */
{
path
:
"/wagesdetail"
,
name
:
"WageList"
,
component
:
()
=>
import
(
"../views/teacher/wagesdetail.vue"
),
},
{
path
:
"/wagesdetail/info/:id"
,
name
:
"WageDetail"
,
component
:
()
=>
import
(
"../views/teacher/wagesDetails/WageDetail.vue"
),
},
//值班
{
path
:
"/dutylist"
,
name
:
"dutylist"
,
component
:
()
=>
import
(
"../views/teacher/Dutytable/list.vue"
),
},
{
path
:
"/dutydetail"
,
name
:
"Dutydetail"
,
component
:
()
=>
import
(
"../views/teacher/Dutytable/detail.vue"
),
},
{
path
:
"/dutydetailh"
,
name
:
"Dutydetailh"
,
component
:
()
=>
import
(
"../views/teacher/Dutytable/detailh.vue"
),
},
{
path
:
"/overworklist"
,
name
:
"overworklist"
,
component
:
()
=>
import
(
"../views/teacher/overwork/list.vue"
),
},
{
path
:
"/overworkdetail"
,
name
:
"overworkdetail"
,
component
:
()
=>
import
(
"../views/teacher/overwork/detail.vue"
),
},
{
path
:
"/overworkapply"
,
name
:
"overworkapply"
,
component
:
()
=>
import
(
"../views/teacher/overwork/Apply.vue"
),
},
{
path
:
"/patrollist"
,
name
:
"patrollist"
,
component
:
()
=>
import
(
"../views/teacher/patrol/list.vue"
),
},
{
path
:
"/patroldetail"
,
name
:
"patroldetail"
,
component
:
()
=>
import
(
"../views/teacher/patrol/detail.vue"
),
},
{
path
:
"/task"
,
name
:
"task"
,
component
:
()
=>
import
(
"../views/teacher/task/index.vue"
),
},
{
path
:
"/taskleave"
,
name
:
"taskleave"
,
component
:
()
=>
import
(
"../views/teacher/task/leavedetail.vue"
),
},
/* 教师考勤 */
{
path
:
"/attendance"
,
name
:
"Attendance"
,
redirect
:
"/attendance/sign"
,
component
:
()
=>
import
(
"../views/teacher/attendance/Attendance.vue"
),
children
:
[
{
path
:
"sign"
,
name
:
"Sign"
,
component
:
()
=>
import
(
"../views/teacher/attendance/Sign.vue"
),
},
{
path
:
"history"
,
name
:
"History"
,
component
:
()
=>
import
(
"../views/teacher/attendance/History.vue"
),
},
],
},
{
path
:
"/attendancelist"
,
name
:
"attendancelist"
,
component
:
()
=>
import
(
"../views/teacher/attendance/list.vue"
),
},
{
path
:
"/attendanceHistory"
,
name
:
"attendanceHistory"
,
component
:
()
=>
import
(
"../views/teacher/attendance/History.vue"
),
},
],
},
{
path
:
"/attendancelist"
,
name
:
"attendancelist"
,
component
:
()
=>
import
(
"../views/teacher/attendance/list.vue"
),
},
{
path
:
"/attendanceHistory"
,
name
:
"attendanceHistory"
,
component
:
()
=>
import
(
"../views/teacher/attendance/History.vue"
),
},
{
path
:
"/attendancedetail"
,
name
:
"attendancedetail"
,
component
:
()
=>
import
(
"../views/teacher/attendance/detail.vue"
),
},
/* 场地申请 */
{
path
:
"/area"
,
name
:
"area"
,
component
:
()
=>
import
(
"../views/areaApply/list"
),
},
{
path
:
"/areaDetail"
,
name
:
"areaDetail"
,
component
:
()
=>
import
(
"../views/areaApply/detail"
),
},
{
path
:
"/areaApply"
,
name
:
"areaApply"
,
component
:
()
=>
import
(
"../views/areaApply/apply"
),
},
{
path
:
"/askForLeaveapply"
,
name
:
"askForLeaveapply"
,
component
:
()
=>
import
(
"../views/teacher/askForLeave/apply"
),
},
{
path
:
"/askForLeavealist"
,
name
:
"askForLeavelist"
,
component
:
()
=>
import
(
"../views/teacher/askForLeave/list"
),
},
{
path
:
"/askForLeavedetail"
,
name
:
"askForLeavedetail"
,
component
:
()
=>
import
(
"../views/teacher/askForLeave/detail"
),
},
},
{
path
:
"/attendancedetail"
,
name
:
"attendancedetail"
,
component
:
()
=>
import
(
"../views/teacher/attendance/detail.vue"
),
},
/* 场地申请 */
{
path
:
"/area"
,
name
:
"area"
,
component
:
()
=>
import
(
"../views/areaApply/list"
),
},
{
path
:
"/areaDetail"
,
name
:
"areaDetail"
,
component
:
()
=>
import
(
"../views/areaApply/detail"
),
},
{
path
:
"/areaApply"
,
name
:
"areaApply"
,
component
:
()
=>
import
(
"../views/areaApply/apply"
),
},
{
path
:
"/askForLeaveapply"
,
name
:
"askForLeaveapply"
,
component
:
()
=>
import
(
"../views/teacher/askForLeave/apply"
),
},
{
path
:
"/askForLeavealist"
,
name
:
"askForLeavelist"
,
component
:
()
=>
import
(
"../views/teacher/askForLeave/list"
),
},
{
path
:
"/askForLeavedetail"
,
name
:
"askForLeavedetail"
,
component
:
()
=>
import
(
"../views/teacher/askForLeave/detail"
),
},
{
path
:
"/lessonall"
,
name
:
"lessonall"
,
component
:
()
=>
import
(
"../views/teacher/lesson/all"
),
},
{
path
:
"/lessonmy"
,
name
:
"lessonmy"
,
component
:
()
=>
import
(
"../views/teacher/lesson/my"
),
},
{
path
:
"/lessonall"
,
name
:
"lessonall"
,
component
:
()
=>
import
(
"../views/teacher/lesson/all"
),
},
{
path
:
"/lessonmy"
,
name
:
"lessonmy"
,
component
:
()
=>
import
(
"../views/teacher/lesson/my"
),
},
{
path
:
"/SchoolTeacherAward"
,
name
:
"SchoolTeacherAward"
,
component
:
()
=>
import
(
"../views/teacher/SchoolTeacherAward"
),
},
{
path
:
"/teacherResume"
,
name
:
"teacherResume"
,
component
:
()
=>
import
(
"../views/teacher/teacherResume"
),
},
//审批列表
{
path
:
"/approvalList"
,
name
:
"materialPurchase"
,
component
:
()
=>
import
(
"../views/teacher/approvalList/index.vue"
),
},
// 审批详情
{
path
:
"/approvalDetail"
,
name
:
"approvalDetail"
,
component
:
()
=>
import
(
"../views/teacher/approvalList/detail.vue"
),
},
// 审批详情
{
path
:
"/teacherLeaveDetail"
,
name
:
"teacherLeaveDetail"
,
component
:
()
=>
import
(
"../views/teacher/approvalList/detailqj.vue"
),
},
//我的领用
{
path
:
"/myUse"
,
name
:
"myUse"
,
component
:
()
=>
import
(
"../views/teacher/myUse/index.vue"
),
},
//修改密码
{
path
:
"/changePassword"
,
name
:
"changePassword"
,
component
:
()
=>
import
(
"../views/public/changePassword/index.vue"
),
},
//学生请假
{
path
:
"/stleavelist"
,
name
:
"stleavelist"
,
component
:
()
=>
import
(
"../views/parent/askForLeave/list.vue"
),
},
{
path
:
"/stleavedetail"
,
name
:
"stleavedetail"
,
component
:
()
=>
import
(
"../views/parent/askForLeave/detail.vue"
),
},
{
path
:
"/stspdetail"
,
name
:
"stspdetail"
,
component
:
()
=>
import
(
"../views/teacher/approvalList/detailqjst.vue"
),
},
{
path
:
"/stleaveapply"
,
name
:
"stleaveapply"
,
component
:
()
=>
import
(
"../views/parent/askForLeave/apply.vue"
),
},
{
path
:
"/infomationlist"
,
name
:
"infomationlist"
,
component
:
()
=>
import
(
"../views/parent/infomation/list.vue"
),
},
{
path
:
"/infomationdetail"
,
name
:
"infomationdetail"
,
component
:
()
=>
import
(
"../views/parent/infomation/detail.vue"
),
},
{
path
:
"/InforColl"
,
name
:
"InforColl"
,
component
:
()
=>
import
(
"../views/parent/InforCollection/index.vue"
),
},
{
path
:
"/InforColledit"
,
name
:
"InforColledit"
,
component
:
()
=>
import
(
"../views/parent/InforCollection/edit.vue"
),
},
{
path
:
"/InforCollapply"
,
name
:
"InforCollapply"
,
component
:
()
=>
import
(
"../views/parent/InforCollection/apply.vue"
),
},
{
path
:
"/SchoolTeacherAward"
,
name
:
"SchoolTeacherAward"
,
component
:
()
=>
import
(
"../views/teacher/SchoolTeacherAward"
),
},
{
path
:
"/teacherResume"
,
name
:
"teacherResume"
,
component
:
()
=>
import
(
"../views/teacher/teacherResume"
),
},
//审批列表
{
path
:
"/approvalList"
,
name
:
"materialPurchase"
,
component
:
()
=>
import
(
"../views/teacher/approvalList/index.vue"
),
},
// 审批详情
{
path
:
"/approvalDetail"
,
name
:
"approvalDetail"
,
component
:
()
=>
import
(
"../views/teacher/approvalList/detail.vue"
),
},
// 审批详情
{
path
:
"/teacherLeaveDetail"
,
name
:
"teacherLeaveDetail"
,
component
:
()
=>
import
(
"../views/teacher/approvalList/detailqj.vue"
),
},
//我的领用
{
path
:
"/myUse"
,
name
:
"myUse"
,
component
:
()
=>
import
(
"../views/teacher/myUse/index.vue"
),
},
//修改密码
{
path
:
"/changePassword"
,
name
:
"changePassword"
,
component
:
()
=>
import
(
"../views/public/changePassword/index.vue"
),
},
//学生请假
{
path
:
"/stleavelist"
,
name
:
"stleavelist"
,
component
:
()
=>
import
(
"../views/parent/askForLeave/list.vue"
),
},
{
path
:
"/stleavedetail"
,
name
:
"stleavedetail"
,
component
:
()
=>
import
(
"../views/parent/askForLeave/detail.vue"
),
},
{
path
:
"/stspdetail"
,
name
:
"stspdetail"
,
component
:
()
=>
import
(
"../views/teacher/approvalList/detailqjst.vue"
),
},
{
path
:
"/stleaveapply"
,
name
:
"stleaveapply"
,
component
:
()
=>
import
(
"../views/parent/askForLeave/apply.vue"
),
},
{
path
:
"/infomationlist"
,
name
:
"infomationlist"
,
component
:
()
=>
import
(
"../views/parent/infomation/list.vue"
),
},
{
path
:
"/infomationdetail"
,
name
:
"infomationdetail"
,
component
:
()
=>
import
(
"../views/parent/infomation/detail.vue"
),
},
{
path
:
"/InforColl"
,
name
:
"InforColl"
,
component
:
()
=>
import
(
"../views/parent/InforCollection/index.vue"
),
},
{
path
:
"/InforColledit"
,
name
:
"InforColledit"
,
component
:
()
=>
import
(
"../views/parent/InforCollection/edit.vue"
),
},
{
path
:
"/InforCollapply"
,
name
:
"InforCollapply"
,
component
:
()
=>
import
(
"../views/parent/InforCollection/apply.vue"
),
},
/**
* Type:教师端
* Describe:后勤报修、校产管理
* Date:2023-08-08
**/
/* 后勤报修 */
{
path
:
"/logisticsRepair"
,
name
:
"logisticsRepair"
,
component
:
()
=>
import
(
"../views/teacher/logisticsRepair/index"
),
},
/* 后勤报修新增 */
{
path
:
"/addRepair"
,
name
:
"addRepair"
,
component
:
()
=>
import
(
"../views/teacher/logisticsRepair/addRepair"
),
},
/* 后勤报修查看 */
{
path
:
"/checkRepair"
,
name
:
"checkRepair"
,
component
:
()
=>
import
(
"../views/teacher/logisticsRepair/checkRepair"
),
},
/* 后勤报修反馈 */
{
path
:
"/feedbackRepair"
,
name
:
"feedbackRepair"
,
component
:
()
=>
import
(
"../views/teacher/logisticsRepair/feedbackRepair"
),
},
/** 校产管理 schoolProperty 管理员权限 教师权限 **/
// 管理员 首页
{
path
:
"/schoolProperty"
,
name
:
"adminIndex"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty"
),
},
// 管理员 物品借用列表页
{
path
:
"/schoolProperty/borrow"
,
name
:
"adminBorrowList"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/borrowList"
),
},
// 管理员 物品借用 新增、编辑、查看页面
{
path
:
"/schoolProperty/borrow/detail"
,
name
:
"adminBorrowDetail"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/borrowDetail"
),
},
// 管理员 归还列表页
{
path
:
"/schoolProperty/return"
,
name
:
"adminReturnList"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/returnList"
),
},
// 管理员 归还查看页
{
path
:
"/schoolProperty/return/detail"
,
name
:
"adminReturnDetail"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/returnDetail"
),
},
// 管理员 物品领用列表页
{
path
:
"/schoolProperty/use"
,
name
:
"adminUseList"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/useList"
),
},
// 管理员 物品领用 新增
{
path
:
"/schoolProperty/use/add"
,
name
:
"adminUseAdd"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/useAdd"
),
},
// 管理员 设备报修列表页
{
path
:
"/schoolProperty/device"
,
name
:
"adminDeviceList"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/deviceList"
),
},
// 管理员 设备维修列表页
{
path
:
"/schoolProperty/equipmentFix"
,
name
:
"equipmentFix"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/equipmentFix"
),
},
// 管理员 设备维修列表详情页
{
path
:
"/schoolProperty/equipmentFix/equipmentFixDetail"
,
name
:
"equipmentFixDetail"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/equipmentFixDetail"
),
},
// 设备报修新增、修改、查看、反馈页面
{
path
:
"/schoolProperty/device/info"
,
name
:
"deviceListInfo"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/deviceListInfo"
),
},
//扫码查看设备的详细信息
{
path
:
"/schoolProperty/equipmentInfo"
,
name
:
'equipmentInfo'
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/equipmentInfo"
),
/**
* Type:教师端
* Describe:后勤报修、校产管理
* Date:2023-08-08
**/
/* 后勤报修 */
{
path
:
"/logisticsRepair"
,
name
:
"logisticsRepair"
,
component
:
()
=>
import
(
"../views/teacher/logisticsRepair/index"
),
},
/* 后勤报修新增 */
{
path
:
"/addRepair"
,
name
:
"addRepair"
,
component
:
()
=>
import
(
"../views/teacher/logisticsRepair/addRepair"
),
},
/* 后勤报修查看 */
{
path
:
"/checkRepair"
,
name
:
"checkRepair"
,
component
:
()
=>
import
(
"../views/teacher/logisticsRepair/checkRepair"
),
},
/* 后勤报修反馈 */
{
path
:
"/feedbackRepair"
,
name
:
"feedbackRepair"
,
component
:
()
=>
import
(
"../views/teacher/logisticsRepair/feedbackRepair"
),
},
/** 校产管理 schoolProperty 管理员权限 教师权限 **/
// 管理员 首页
{
path
:
"/schoolProperty"
,
name
:
"adminIndex"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty"
),
},
// 管理员 物品借用列表页
{
path
:
"/schoolProperty/borrow"
,
name
:
"adminBorrowList"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/borrowList"
),
},
// 管理员 物品借用 新增、编辑、查看页面
{
path
:
"/schoolProperty/borrow/detail"
,
name
:
"adminBorrowDetail"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/borrowDetail"
),
},
// 管理员 归还列表页
{
path
:
"/schoolProperty/return"
,
name
:
"adminReturnList"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/returnList"
),
},
// 管理员 物品领用列表页
{
path
:
"/schoolProperty/use"
,
name
:
"adminUseList"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/useList"
),
},
// 管理员 物品领用 新增
{
path
:
"/schoolProperty/use/add"
,
name
:
"adminUseAdd"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/useAdd"
),
},
// 管理员 设备报修列表页
{
path
:
"/schoolProperty/device"
,
name
:
"adminDeviceList"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/deviceList"
),
},
// 设备报修新增、修改、查看、反馈页面
{
path
:
"/schoolProperty/device/info"
,
name
:
"deviceListInfo"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/deviceListInfo"
),
}
}
];
const
router
=
createRouter
({
history
:
createWebHashHistory
(
'zhxygzh'
),
// mode: "history",
// base: process.env.BASE_URL,
routes
,
history
:
createWebHashHistory
(
'zhxygzh'
),
// mode: "history",
// base: process.env.BASE_URL,
routes
,
});
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
// console.log(to,from);
if
(
to
.
name
==
"development"
)
{
Toast
(
"开发中"
);
return
;
}
next
()
// next();
// if (!to.meta.noAuth) {
// next({ name: "login" });
// // 路由需要授权
// if (_.isEmpty(store.getters.wechatUserInfo)) {
// // 获取用户信息
// if (
// !_.isEmpty(store.getters.openid) &&
// !_.isEmpty(store.getters.accessToken)
// ) {
// // 存在openid和accessToken,已经授过权
// // 判断accessToken是否过期,过期刷新token,获取用户信息
// store.dispatch('getUserInfo')
// next()
// } else {
// // todo 跳转网页授权
// // 记录当前页面url
// localStorage.setItem('currentUrl', to.fullPath)
// next({name: 'auth'})
// }
// } else {
// // todo 已经存在用户信息,需要定期更新
// next()
// }
// } else {
// // 路由不需要授权
// next();
// }
// console.log(to,from);
if
(
to
.
name
==
"development"
)
{
Toast
(
"开发中"
);
return
;
}
next
()
// next();
// if (!to.meta.noAuth) {
// next({ name: "login" });
// // 路由需要授权
// if (_.isEmpty(store.getters.wechatUserInfo)) {
// // 获取用户信息
// if (
// !_.isEmpty(store.getters.openid) &&
// !_.isEmpty(store.getters.accessToken)
// ) {
// // 存在openid和accessToken,已经授过权
// // 判断accessToken是否过期,过期刷新token,获取用户信息
// store.dispatch('getUserInfo')
// next()
// } else {
// // todo 跳转网页授权
// // 记录当前页面url
// localStorage.setItem('currentUrl', to.fullPath)
// next({name: 'auth'})
// }
// } else {
// // todo 已经存在用户信息,需要定期更新
// next()
// }
// } else {
// // 路由不需要授权
// next();
// }
});
export
default
router
;
src/service/schoolProperty.js
View file @
50341b1c
...
...
@@ -18,8 +18,8 @@ export function getBorrowList(borrowById) {
}
//扫码借用获取设备基本信息
export
function
getScan
Info
(
encode
)
{
return
axios
.
post
(
`wx/equipment/getEquipment
${
encode
}
`
);
export
function
scanEquipment
Info
(
encode
)
{
return
axios
.
get
(
`wx/equipment/getEquipment/
${
encode
}
`
);
}
//物品借用
...
...
@@ -38,18 +38,18 @@ export function checkBorrowDetail(id) {
//管理员物品列表查看
export
function
getEquipmentList
(
managerId
)
{
return
axios
.
pos
t
(
`wx/equipment/getMyBorrowList/
${
managerId
}
`
);
return
axios
.
ge
t
(
`wx/equipment/getMyBorrowList/
${
managerId
}
`
);
}
//借用物品记录详情查看-克隆
export
function
checkEquipmentDetail
(
id
)
{
return
axios
.
get
(
`wx/equipment/
byCirculation/
${
id
}
`
);
export
function
getEquipmentDetail
(
encode
)
{
return
axios
.
get
(
`wx/equipment/
getReturningEquipmentByList/
${
encode
}
`
);
}
//物品归还
export
function
returnEquipment
(
data
)
{
return
axios
.
put
(
'/wx/equipment/returnDevice'
,{
params
:
data
...
data
}
);
}
...
...
@@ -57,8 +57,8 @@ export function returnEquipment(data) {
/********** 物品领用 ***********/
//领用列表
export
function
getUseList
(
recipientById
)
{
return
axios
.
get
(
`wx/equipment/getUseList/
${
recipientById
}
`
);
export
function
getUseList
(
recipientById
,
equipmentName
)
{
return
axios
.
get
(
`wx/equipment/getUseList/
?recipientById=
${
recipientById
}
&equipmentName=
${
equipmentName
}
`
);
}
//新增领用
...
...
@@ -75,6 +75,11 @@ export function useDeatil(id) {
/********** 设备报修 ***********/
//获取修理人
export
function
getRepairName
()
{
return
axios
.
get
(
`wx/equipment/getRepair`
);
}
//报修个人记录列表
export
function
getDeviceList
(
reportRepairid
)
{
return
axios
.
get
(
`wx/equipment/getMaintenanceList/
${
reportRepairid
}
`
);
...
...
@@ -89,13 +94,13 @@ export function addDevice(data) {
//报修记录详情
export
function
getDeviceDetail
(
id
)
{
return
axios
.
pos
t
(
`wx/equipment/getMaintenance/
${
id
}
`
);
return
axios
.
ge
t
(
`wx/equipment/getMaintenance/
${
id
}
`
);
}
//报修记录修改
export
function
editDevice
(
data
)
{
return
axios
.
put
(
'/wx/equipment/pudateMaintenance'
,{
params
:
data
...
data
}
);
}
...
...
@@ -108,7 +113,26 @@ export function getFeedbackDetail(id) {
// 报修结果反馈
export
function
submitFeedback
(
data
)
{
return
axios
.
put
(
'/wx/equipment/pudateMaintenance'
,{
params
:
data
...
data
}
);
}
//报修记录删除
export
function
deletEuipemnt
(
id
)
{
return
axios
.
delete
(
`wx/equipment/deletEuipemnt/
${
id
}
`
);
}
/********** 设备维修 ***********/
//维修工作列表
export
function
getMaintenanceList
()
{
return
axios
.
get
(
'wx/equipment/getMaintenanceUserList'
);
}
//报修记录详情-克隆
export
function
getMaintenanceDetail
(
id
)
{
return
axios
.
get
(
`wx/equipment/getMaintenance/
${
id
}
`
);
}
src/service/studentCourseSelection.js
View file @
50341b1c
...
...
@@ -31,7 +31,12 @@ export function getSelectGrade(data) {
//保存选课信息
export
function
saveSelectInfo
(
data
)
{
return
axios
.
p
os
t
(
'/wx/course/savestudentcourse'
,{
return
axios
.
p
u
t
(
'/wx/course/savestudentcourse'
,{
...
data
}
);
}
//根据字典类型和字典键值查询字典数据信息
export
function
getStudentCourse
(
course_type
,
value
)
{
return
axios
.
get
(
`system/dict/data/getDictLabel/
${
course_type
}
/
${
value
}
`
);
}
src/utils/axios.js
View file @
50341b1c
...
...
@@ -7,10 +7,10 @@
* 版权所有,侵权必究!
*/
import
axios
from
"axios"
;
import
{
Toast
}
from
"vant"
;
import
{
Toast
}
from
"vant"
;
import
router
from
"../router"
;
import
{
getToken
}
from
"@/utils/auth"
;
import
{
tansParams
}
from
"@/utils/common"
;
import
{
getToken
}
from
"@/utils/auth"
;
import
{
tansParams
}
from
"@/utils/common"
;
axios
.
defaults
.
baseURL
=
"/school"
;
// axios.defaults.baseURL = "/schoolnw";
...
...
@@ -44,108 +44,108 @@ axios.defaults.headers["X-Requested-With"] = "XMLHttpRequest";
axios
.
defaults
.
headers
.
post
[
"Content-Type"
]
=
"application/json"
;
axios
.
interceptors
.
request
.
use
(
(
config
)
=>
{
let
cacheKey
=
config
.
url
;
// log
// 是否需要设置 token
const
isToken
=
(
config
.
headers
||
{}).
isToken
===
false
;
if
(
getToken
()
&&
!
isToken
)
{
config
.
headers
[
"Authorization"
]
=
"Bearer "
+
getToken
();
// 让每个请求携带自定义token 请根据实际情况自行修改
(
config
)
=>
{
let
cacheKey
=
config
.
url
;
// log
// 是否需要设置 token
const
isToken
=
(
config
.
headers
||
{}).
isToken
===
false
;
if
(
getToken
()
&&
!
isToken
)
{
config
.
headers
[
"Authorization"
]
=
"Bearer "
+
getToken
();
// 让每个请求携带自定义token 请根据实际情况自行修改
}
CacheUtils
.
cache
[
cacheKey
]
&&
CacheUtils
.
clearCache
(
cacheKey
);
config
.
cancelToken
=
new
axios
.
CancelToken
(
function
executor
(
c
)
{
CacheUtils
.
cache
[
cacheKey
]
=
c
;
});
config
.
cacheKey
=
cacheKey
;
// get请求映射params参数
if
(
config
.
method
===
"get"
&&
config
.
params
)
{
let
url
=
config
.
url
+
"?"
+
tansParams
(
config
.
params
);
url
=
url
.
slice
(
0
,
-
1
);
config
.
params
=
{};
config
.
url
=
url
;
}
return
config
;
},
(
error
)
=>
{
Promise
.
reject
(
error
);
}
CacheUtils
.
cache
[
cacheKey
]
&&
CacheUtils
.
clearCache
(
cacheKey
);
config
.
cancelToken
=
new
axios
.
CancelToken
(
function
executor
(
c
)
{
CacheUtils
.
cache
[
cacheKey
]
=
c
;
});
config
.
cacheKey
=
cacheKey
;
// get请求映射params参数
if
(
config
.
method
===
"get"
&&
config
.
params
)
{
let
url
=
config
.
url
+
"?"
+
tansParams
(
config
.
params
);
url
=
url
.
slice
(
0
,
-
1
);
config
.
params
=
{};
config
.
url
=
url
;
}
return
config
;
},
(
error
)
=>
{
Promise
.
reject
(
error
);
}
);
export
const
CacheUtils
=
{
// 存储请求接口地址以及请求体和取消函数之间的映射关系
cache
:
{},
// 根据提供的键名 key 取消对应的请求,若未提供则取消全部请求
clearCache
:
function
(
key
)
{
if
(
key
)
{
const
cancel
=
this
.
cache
[
key
];
if
(
cancel
&&
typeof
cancel
===
"function"
)
{
cancel
();
delete
this
.
cache
[
key
];
}
return
;
}
console
.
log
(
"assd"
);
console
.
log
(
this
.
cache
);
Object
.
keys
(
this
.
cache
).
forEach
((
cacheKey
)
=>
{
const
cancel
=
this
.
cache
[
cacheKey
];
cancel
();
delete
this
.
cache
[
cacheKey
];
});
},
// 存储请求接口地址以及请求体和取消函数之间的映射关系
cache
:
{},
// 根据提供的键名 key 取消对应的请求,若未提供则取消全部请求
clearCache
:
function
(
key
)
{
if
(
key
)
{
const
cancel
=
this
.
cache
[
key
];
if
(
cancel
&&
typeof
cancel
===
"function"
)
{
cancel
();
delete
this
.
cache
[
key
];
}
return
;
}
console
.
log
(
"assd"
);
console
.
log
(
this
.
cache
);
Object
.
keys
(
this
.
cache
).
forEach
((
cacheKey
)
=>
{
const
cancel
=
this
.
cache
[
cacheKey
];
cancel
();
delete
this
.
cache
[
cacheKey
];
});
},
};
// 响应拦截
axios
.
interceptors
.
response
.
use
(
(
res
)
=>
{
const
cacheKey
=
res
.
config
.
cacheKey
?
res
.
config
.
cacheKey
:
''
;
delete
CacheUtils
.
cache
[
cacheKey
];
// console.log("我发送了请求,这是结果", res);
if
(
typeof
res
.
data
!==
"object"
)
{
Toast
.
fail
(
"服务端异常!"
);
return
Promise
.
reject
(
res
);
}
if
(
res
.
data
.
code
!=
200
)
{
console
.
log
(
res
.
data
);
// if (res.data.message) Toast.fail(res.data.message);
if
(
res
.
data
.
code
==
401
)
{
router
.
push
({
path
:
"/"
});
}
if
(
res
.
data
.
code
==
500
)
{
// router.push({ path: "/login" });
Toast
.
fail
(
"获取信息异常"
);
// return Promise.reject(res.data);
// Toast.fail(res.data.msg);
}
return
Promise
.
reject
(
res
.
data
);
// return Promise.resolve(res.data);
(
res
)
=>
{
const
cacheKey
=
res
.
config
.
cacheKey
?
res
.
config
.
cacheKey
:
''
;
delete
CacheUtils
.
cache
[
cacheKey
];
// console.log("我发送了请求,这是结果", res);
if
(
typeof
res
.
data
!==
"object"
)
{
Toast
.
fail
(
"服务端异常!"
);
return
Promise
.
reject
(
res
);
}
if
(
res
.
data
.
code
!=
200
)
{
console
.
log
(
res
.
data
);
// if (res.data.message) Toast.fail(res.data.message);
if
(
res
.
data
.
code
==
401
)
{
router
.
push
({
path
:
"/"
});
}
if
(
res
.
data
.
code
==
500
)
{
// router.push({ path: "/login" });
// Toast.fail("获取信息异常");
// return Promise.reject(res.data);
Toast
.
fail
(
res
.
data
.
msg
);
router
.
push
({
path
:
"/login"
});
}
return
Promise
.
reject
(
res
.
data
);
// return Promise.resolve(res.data);
}
return
Promise
.
resolve
(
res
.
data
);
},
(
error
)
=>
{
// 响应异常清除缓存
if
(
error
.
config
)
{
const
cacheKey
=
error
.
config
.
cacheKey
;
delete
CacheUtils
.
cache
[
cacheKey
];
}
return
Promise
.
reject
(
error
);
}
return
Promise
.
resolve
(
res
.
data
);
},
(
error
)
=>
{
// 响应异常清除缓存
if
(
error
.
config
)
{
const
cacheKey
=
error
.
config
.
cacheKey
;
delete
CacheUtils
.
cache
[
cacheKey
];
}
return
Promise
.
reject
(
error
);
}
);
export
function
trueUrl
(
data
)
{
let
arr
=
[];
for
(
const
key
in
data
)
{
arr
.
push
(
`
${
key
}
=
${
data
[
key
]}
`
);
}
return
"?"
+
arr
.
join
(
"&"
);
let
arr
=
[];
for
(
const
key
in
data
)
{
arr
.
push
(
`
${
key
}
=
${
data
[
key
]}
`
);
}
return
"?"
+
arr
.
join
(
"&"
);
}
export
default
axios
;
src/utils/scanCode.js
View file @
50341b1c
import
{
getWxConfig
}
from
"../service/schoolProperty"
;
import
{
getWxConfig
,
scanEquipmentInfo
}
from
"../service/schoolProperty"
;
import
wx
from
"weixin-js-sdk"
;
//调用微信相关
/***
* Date:2023-08-14
* Describe:用于调取微信扫码
* */
export
function
scanCodeFun
(
appId
){
export
function
scanCodeFun
(
appId
,
type
){
let
url
=
location
.
href
.
split
(
'#'
)[
0
]
//获取当前域名
let
encode
=
''
getWxConfig
(
url
).
then
(
res
=>
{
...
...
@@ -31,9 +31,54 @@ export function scanCodeFun(appId){
scanType
:
[
"qrCode"
,
"barCode"
],
// 可以指定扫二维码还是一维码,默认二者都有
success
:
function
(
res
)
{
encode
=
res
.
resultStr
;
// 当needResult 为 1 时,扫码返回的结果
if
(
type
=
0
){
//校产管理页面扫码显示设备信息
router
.
push
({
path
:
"/schoolProperty/equipmentInfo"
,
query
:
{
encode
:
encode
}
})
}
if
(
type
=
1
){
// 物品借用
router
.
push
({
path
:
"/schoolProperty/borrow/detail"
,
query
:{
encode
:
encode
}
});
};
if
(
type
=
2
){
// 归还管理
router
.
push
({
path
:
"/schoolProperty/return/detail"
,
query
:{
encode
:
encode
}
});
};
if
(
type
=
3
){
// 物品领用
router
.
push
({
path
:
"/schoolProperty/use/add"
,
query
:{
encode
:
encode
}
});
};
if
(
type
=
4
){
// 设备报修
router
.
push
({
path
:
"/schoolProperty/device/info"
,
query
:{
encode
:
encode
,
name
:
'新增'
}
});
}
}
})
}
})
return
encode
}
src/views/login/login.vue
View file @
50341b1c
...
...
@@ -285,6 +285,7 @@ export default {
data
.
password
=
state
.
password
;
data
.
type
=
state
.
loginType
;
data
.
openId
=
state
.
openId
;
//访问后台接口
let
postData
=
{};
if
(
state
.
parentShow
)
{
...
...
@@ -303,7 +304,7 @@ export default {
phonenumber
:
state
.
phonenumber
,
};
}
console
.
log
(
'postData'
,
postData
)
// 发送请求登录
let
result
=
await
loginGet
({
...
postData
,
...
...
@@ -312,6 +313,7 @@ export default {
});
if
(
result
.
code
===
200
)
{
setToken
(
result
.
token
);
setParentTelephone
(
state
.
parentTelephone
);
setTotyp
(
state
.
loginType
);
...
...
src/views/parent/InforCollection/apply.vue
View file @
50341b1c
...
...
@@ -68,6 +68,7 @@
v-model=
"schoolInfoDetail.birthday"
type=
"date"
@
confirm=
"birthdayconfirm"
@
cancel=
"birthdaycancel"
title=
"请选择时间"
:min-date=
"minDate"
:max-date=
"maxDate"
...
...
@@ -561,6 +562,13 @@ const formatter = (type, val) => {
return
val
;
};
const
birthdaycancel
=
()
=>
{
schoolInfoDetail
.
value
.
birthdayShow
=
false
;
console
.
log
(
'detail2'
,
detail
)
// schoolInfoDetail.value = detail;
}
const
birthdayconfirm
=
(
value
)
=>
{
schoolInfoDetail
.
value
.
birthdayShow
=
false
;
schoolInfoDetail
.
value
.
birthday
=
formatDate
(
value
);
...
...
@@ -599,6 +607,7 @@ const onnature = (value) => {
onMounted
(
async
()
=>
{
if
(
detail
.
birthday
==
""
)
detail
.
birthday
=
getBirthday
(
detail
.
idCard
);
schoolInfoDetail
.
value
=
detail
;
console
.
log
(
'detail2'
,
detail
)
schoolInfoDetail
.
value
.
relationship2text
=
getrelationship
(
schoolInfoDetail
.
value
.
relationship2
);
...
...
src/views/parent/studentCourseSelection/checkCourse.vue
0 → 100644
View file @
50341b1c
<
template
>
<van-nav-bar
title=
"课程查看"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<van-form
class=
"formBlock"
label-align=
"right"
label-width=
"60px"
>
<van-cell-group
inset
>
<van-field
readonly
v-model=
"courseForm.studentName"
name=
"姓名"
label=
"姓名"
placeholder=
"姓名"
:rules=
"[
{ required: true, message: '请填写姓名' }]"
/>
<van-field
readonly
v-model=
"courseForm.courseResult"
type=
"password"
name=
"选课结果"
label=
"选课结果"
placeholder=
"选课结果"
:rules=
"[
{ required: true, message: '请填写选课结果' }]"
/>
</van-cell-group>
<div
style=
"margin: 16px;"
>
<van-button
round
block
type=
"primary"
@
click=
"goback"
>
关闭
</van-button>
</div>
</van-form>
</
template
>
<
script
setup
>
import
{
getStudentInfo
,
//学生选课信息查询
getStudentCourse
,
//根据字典类型和字典键值查询字典数据信息
}
from
"@/service/studentCourseSelection"
;
import
{
ref
,
reactive
,
onMounted
}
from
'vue'
;
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
useStore
}
from
"vuex"
;
const
router
=
useRouter
()
const
store
=
useStore
()
//课程类型 春季 夏季 艺体
const
courseType
=
ref
()
console
.
log
(
'store'
,
store
)
const
courseForm
=
reactive
({
studentName
:
''
,
courseResult
:
''
,
})
onMounted
(
async
()
=>
{
let
result
=
await
getStudentInfo
(
store
.
state
.
userInfo
.
studentId
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
courseForm
.
studentName
=
store
.
state
.
userInfo
.
studentName
courseType
.
value
=
result
.
data
.
courseType
if
(
result
.
data
.
selectedCourse
!=
''
){
let
courseResult
=
await
getStudentCourse
(
courseType
.
value
,
result
.
data
.
selectedCourse
)
console
.
log
(
'courseResult'
,
courseResult
)
}
// else if(){}
}
})
//返回上一页
const
goback
=
(
g
)
=>
{
router
.
back
()
// router.replace({
// path: "/main"
// });
};
</
script
>
<
style
scoped
>
</
style
>
src/views/parent/studentCourseSelection/index.vue
View file @
50341b1c
...
...
@@ -33,16 +33,16 @@
<van-field
name=
"radio1"
label=
"选课方式"
>
<template
#
input
>
<van-radio-group
v-for=
"(item,index) in typeColumn"
:key=
"item.dictValue"
v-model=
"checkedType"
<van-radio-group
:disabled=
"flag == true"
v-for=
"(item,index) in typeColumn"
:key=
"item.dictValue"
v-model=
"checkedType"
direction=
"horizontal"
>
<van-radio
icon-size=
"18px"
:name=
"item.dictValue"
>
{{
item
.
dictLabel
}}
</van-radio>
<van-radio
icon-size=
"18px"
:name=
"item.dictValue"
>
{{
item
.
dictLabel
}}
</van-radio>
</van-radio-group>
</
template
>
</van-field>
<!-- 夏季 -->
<van-field
v-if=
"checkedType == 2"
name=
"radio"
label=
" "
>
<
template
#
input
>
<van-radio-group
style=
"display: flex;flex-wrap: wrap"
v-model=
"checkedSub"
direction=
"horizontal"
>
<van-radio-group
:disabled=
"flag == true"
style=
"display: flex;flex-wrap: wrap"
v-model=
"checkedSub"
direction=
"horizontal"
>
<van-radio
v-for=
"(item) in selectionColumn"
:key=
"item.dictValue"
icon-size=
"18px"
:name=
"item.dictValue"
shape=
"square"
@
click=
"toSubjectGrade(item.dictLabel,item.dictValue)"
>
{{
item
.
dictLabel
}}
</van-radio>
...
...
@@ -61,7 +61,7 @@
placeholder=
"请选择"
@
click=
"showFirst"
/>
<van-popup
v-model:show=
"showPickerFirst"
position=
"bottom"
>
<van-popup
v-
if=
"flag == false"
v-
model:show=
"showPickerFirst"
position=
"bottom"
>
<van-picker
:columns=
"firstDropDown"
@
confirm=
"onConfirmFirst"
...
...
@@ -78,7 +78,7 @@
placeholder=
"请选择"
@
click=
"showSecond"
/>
<van-popup
v-model:show=
"showPickerSecond"
position=
"bottom"
>
<van-popup
v-
if=
"flag == false"
v-
model:show=
"showPickerSecond"
position=
"bottom"
>
<van-picker
:columns=
"secondDropDown"
@
confirm=
"onConfirmSecond"
...
...
@@ -95,7 +95,7 @@
placeholder=
"请选择"
@
click=
"showThird"
/>
<van-popup
v-model:show=
"showPickerThird"
position=
"bottom"
>
<van-popup
v-
if=
"flag == false"
v-
model:show=
"showPickerThird"
position=
"bottom"
>
<van-picker
:columns=
"thirdDropDown"
@
confirm=
"onConfirmThird"
...
...
@@ -112,7 +112,7 @@
placeholder=
"请选择"
@
click=
"showForth"
/>
<van-popup
v-model:show=
"showPickerForth"
position=
"bottom"
>
<van-popup
v-
if=
"flag == false"
v-
model:show=
"showPickerForth"
position=
"bottom"
>
<van-picker
:columns=
"forthDropDown"
@
confirm=
"onConfirmForth"
...
...
@@ -129,7 +129,7 @@
placeholder=
"请选择"
@
click=
"showFifth"
/>
<van-popup
v-model:show=
"showPickerfifth"
position=
"bottom"
>
<van-popup
v-
if=
"flag == false"
v-
model:show=
"showPickerfifth"
position=
"bottom"
>
<van-picker
:columns=
"fifthDropDown"
@
confirm=
"onConfirmFifth"
...
...
@@ -146,7 +146,7 @@
placeholder=
"请选择"
@
click=
"showSix"
/>
<van-popup
v-model:show=
"showPickerSix"
position=
"bottom"
>
<van-popup
v-
if=
"flag == false"
v-
model:show=
"showPickerSix"
position=
"bottom"
>
<van-picker
:columns=
"sixDropDown"
@
confirm=
"onConfirmSix"
...
...
@@ -158,7 +158,7 @@
<div
v-if=
"checkedType == 3"
>
<van-field
class=
"art"
name=
"radio"
label=
" "
>
<
template
#
input
>
<van-radio-group
v-for=
"(item,index) in artColumn"
:key=
"item.dictValue"
v-model=
"checkedArt"
<van-radio-group
:disabled=
"flag == true"
v-for=
"(item,index) in artColumn"
:key=
"item.dictValue"
v-model=
"checkedArt"
direction=
"horizontal"
>
<van-radio
icon-size=
"18px"
:name=
"item.dictValue"
shape=
"square"
>
{{
item
.
dictLabel
}}
</van-radio>
</van-radio-group>
...
...
@@ -166,9 +166,9 @@
</van-field>
<van-field
v-if=
"checkedType == 3"
name=
"radio"
label=
" "
>
<
template
#
input
>
<van-radio-group
v-model=
"checkedArtSub"
direction=
"horizontal"
>
<van-radio-group
:disabled=
"flag == true"
v-model=
"checkedArtSub"
direction=
"horizontal"
>
<van-radio
v-for=
"(item,index) in selectionColumn"
:key=
"item.dictValue"
icon-size=
"18px"
:name=
"item.dictValue"
shape=
"square"
>
{{
item
.
dictLabel
}}
:name=
"item.dictValue"
shape=
"square"
@
click=
"toSubjectGrade(item.dictLabel,item.dictValue)"
>
{{
item
.
dictLabel
}}
</van-radio>
</van-radio-group>
</
template
>
...
...
@@ -735,7 +735,7 @@
</template>
<
script
setup
>
import
{
onMounted
,
ref
,
onUpdated
,
reactive
,
toRefs
,
nextTick
}
from
"vue"
;
import
{
onMounted
,
ref
,
onUpdated
,
reactive
,
toRefs
,
nextTick
,
markRaw
,
toRaw
}
from
"vue"
;
import
{
Dialog
,
Toast
}
from
"vant"
;
import
{
formatDatetime
,
formatDate
}
from
"@/utils/time.js"
;
...
...
@@ -779,7 +779,10 @@ const volunteerColumn = ref([]);
//志愿提交数组
const
volunteerIndex
=
ref
([]);
const
id
=
ref
(
''
)
const
choiceArr
=
ref
([]);
//接口返回的已选中的志愿
const
paramsArr
=
ref
([]);
const
flag
=
ref
();
onMounted
(
async
()
=>
{
console
.
log
(
'isShowDialog'
,
isShowDialog
.
show
)
console
.
log
(
'route666'
,
route
.
query
)
...
...
@@ -788,14 +791,6 @@ onMounted(async () => {
checkedType
.
value
=
'2'
;
checkedSub
.
value
=
route
.
query
.
value
}
let
result
=
await
getStudentInfo
(
store
.
state
.
userInfo
.
studentId
)
console
.
log
(
'result66'
,
result
)
if
(
result
.
code
==
200
)
{
startTime
.
value
=
result
.
data
.
startTime
endTime
.
value
=
result
.
data
.
endTime
state
.
selectionTime
=
result
.
data
.
startTime
+
'-'
+
result
.
data
.
endTime
id
.
value
=
result
.
data
.
id
}
//课程类型 1-春季选课,2-夏季选课,3-艺体
let
courseType
=
await
getDicts
(
'course_type'
)
console
.
log
(
'courseType'
,
courseType
)
...
...
@@ -846,6 +841,53 @@ onMounted(async () => {
}
let
result
=
await
getStudentInfo
(
store
.
state
.
userInfo
.
studentId
)
console
.
log
(
'result66'
,
result
)
if
(
result
.
code
==
200
)
{
flag
.
value
=
result
.
data
.
flag
// flag.value = true
startTime
.
value
=
result
.
data
.
startTime
endTime
.
value
=
result
.
data
.
endTime
state
.
selectionTime
=
result
.
data
.
startTime
+
'-'
+
result
.
data
.
endTime
id
.
value
=
result
.
data
.
id
checkedType
.
value
=
result
.
data
.
courseType
checkedSub
.
value
=
result
.
data
.
selectedCourse
if
(
result
.
data
.
selectedMajor
.
length
!=
0
){
const
newArr
=
result
.
data
.
selectedMajor
.
split
(
","
)
console
.
log
(
'newArr'
,
newArr
)
console
.
log
(
'1224'
,
volunteerColumn
.
value
)
state
.
firstChoice
=
volunteerColumn
.
value
.
find
(
item
=>
item
.
value
==
newArr
[
0
]
).
text
console
.
log
(
'state.firstChoice66'
,
state
.
firstChoice
)
selectArr
.
value
[
0
]
=
state
.
firstChoice
state
.
secondChoice
=
volunteerColumn
.
value
.
find
(
item
=>
item
.
value
==
newArr
[
1
]
).
text
selectArr
.
value
[
1
]
=
state
.
secondChoice
state
.
thirdChoice
=
volunteerColumn
.
value
.
find
(
item
=>
item
.
value
==
newArr
[
2
]
).
text
selectArr
.
value
[
2
]
=
state
.
thirdChoice
state
.
forthChoice
=
volunteerColumn
.
value
.
find
(
item
=>
item
.
value
==
newArr
[
3
]
).
text
selectArr
.
value
[
3
]
=
state
.
forthChoice
state
.
fifthChoice
=
volunteerColumn
.
value
.
find
(
item
=>
item
.
value
==
newArr
[
4
]
).
text
selectArr
.
value
[
4
]
=
state
.
fifthChoice
state
.
sixChoice
=
volunteerColumn
.
value
.
find
(
item
=>
item
.
value
==
newArr
[
5
]
).
text
selectArr
.
value
[
5
]
=
state
.
sixChoice
volunteerIndex
.
value
=
newArr
console
.
log
(
'volunteerIndex.value'
,
volunteerIndex
.
value
)
console
.
log
(
'choiceArr.value'
,
choiceArr
.
value
)
}
checkedArt
.
value
=
result
.
data
.
selectedCourse
checkedArtSub
.
value
=
result
.
data
.
selectedSubject
}
});
//成绩查看按钮
...
...
@@ -861,9 +903,7 @@ const subjectColumn = ref([])
const
params
=
reactive
({
name
:
''
})
// nextTick(() => {
// console.log('scrollDiv',scrollDiv.value)
// })
//物政化等学科点击事件
const
toSubjectGrade
=
async
(
name
,
value
)
=>
{
...
...
@@ -871,8 +911,6 @@ const toSubjectGrade = async (name, value) => {
console
.
log
(
'params.name'
,
params
.
name
)
params
.
name
=
name
;
// const scrollDiv = document.getElementById('scrollDiv')
// scrollDiv.scrollTop = 0
console
.
log
(
'isShowDialog'
,
isShowDialog
.
show
)
const
data
=
{
studentId
:
store
.
state
.
userInfo
.
studentId
,
...
...
@@ -904,13 +942,13 @@ const checkForm = ref(null);
// 加载效果
const
loading
=
ref
(
false
);
//单选框1 夏季/春季/艺考
const
checkedType
=
ref
(
'
1
'
);
const
checkedType
=
ref
(
''
);
//夏季-物政化等
const
checkedSub
=
ref
(
'
1
'
);
const
checkedSub
=
ref
(
''
);
//艺体-音乐/美术/田径/舞蹈
const
checkedArt
=
ref
(
'
1
'
);
const
checkedArt
=
ref
(
''
);
//艺体-物政化等
const
checkedArtSub
=
ref
(
'
1
'
);
const
checkedArtSub
=
ref
(
''
);
// const result = ref('');
//六个下拉框已经选中的数据
...
...
@@ -920,8 +958,10 @@ const selectArr = ref([]);
const
firstDropDown
=
ref
([]);
//第一志愿下拉框是否显示
const
showPickerFirst
=
ref
(
false
);
//第一志愿点击下拉框事件
const
showFirst
=
()
=>
{
console
.
log
(
'choiceArr'
,
choiceArr
.
value
)
// firstDropDown.value = columns.filter(item => {
// return item != state.secondChoice && item != state.thirdChoice && item != state.forthChoice
// })
...
...
@@ -932,6 +972,7 @@ const showFirst = () => {
return
item
}
})
console
.
log
(
'paramsArr.value'
,
paramsArr
.
value
)
console
.
log
(
'state.secondChoice'
,
state
.
secondChoice
)
console
.
log
(
'firstDropDown.value'
,
firstDropDown
.
value
)
showPickerFirst
.
value
=
true
;
...
...
@@ -942,7 +983,8 @@ const onConfirmFirst = (value, index) => {
state
.
firstChoice
=
value
.
text
;
showPickerFirst
.
value
=
false
;
selectArr
.
value
[
0
]
=
value
.
text
;
volunteerIndex
.
value
[
0
]
=
value
.
value
volunteerIndex
.
value
[
0
]
=
value
.
value
;
console
.
log
(
'volunteerIndex.value'
,
volunteerIndex
.
value
)
console
.
log
(
'selectArr.value'
,
selectArr
.
value
)
};
...
...
@@ -1060,7 +1102,7 @@ const showSix = () => {
// })
//把其他下拉框已选择的过滤出去
sixDropDown
.
value
=
volunteerColumn
.
value
.
filter
(
item
=>
{
if
(
!
selectArr
.
value
.
includes
(
item
.
text
))
{
if
(
!
selectArr
.
value
.
includes
(
item
.
text
)
)
{
return
item
}
})
...
...
@@ -1082,17 +1124,21 @@ const onSubmit = async () => {
console
.
log
(
'volunteerIndex.value'
,
volunteerIndex
.
value
)
const
volunteerString
=
volunteerIndex
.
value
.
toString
()
console
.
log
(
'volunteerString'
,
volunteerString
)
//春季选课
if
(
checkedType
.
value
==
'1'
)
{
if
(
volunteerIndex
.
value
.
length
==
6
)
{
const
data
=
{
studentId
:
store
.
state
.
userInfo
.
studentId
,
curriculaId
:
id
.
value
,
//
curriculaId: id.value,
courseType
:
checkedType
.
value
,
curriculaTime
:
formatDatetime
(
new
Date
()),
curriculaState
:
'2'
,
selectedCourse
:
''
,
//志愿
selectedMajor
:
volunteerString
,
selectedSubject
:
''
,
id
:
id
.
value
,
}
console
.
log
(
'data'
,
data
)
...
...
@@ -1100,7 +1146,8 @@ const onSubmit = async () => {
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
)
{
Toast
(
"选课成功"
);
router
.
back
()
// router.back()
router
.
push
(
'/main'
)
}
}
else
{
Toast
(
"志愿未填报完成"
);
...
...
@@ -1112,12 +1159,16 @@ const onSubmit = async () => {
if
(
checkedType
.
value
==
'2'
)
{
const
data
=
{
studentId
:
store
.
state
.
userInfo
.
studentId
,
curriculaId
:
id
.
value
,
//
curriculaId: id.value,
courseType
:
checkedType
.
value
,
curriculaTime
:
formatDatetime
(
new
Date
()),
curriculaState
:
'2'
,
//物理化学科
selectedCourse
:
checkedSub
.
value
,
selectedMajor
:
''
,
selectedSubject
:
''
,
id
:
id
.
value
}
console
.
log
(
'data'
,
data
)
let
result
=
await
saveSelectInfo
(
data
)
...
...
@@ -1134,14 +1185,17 @@ const onSubmit = async () => {
if
(
checkedType
.
value
==
'3'
)
{
const
data
=
{
studentId
:
store
.
state
.
userInfo
.
studentId
,
curriculaId
:
id
.
value
,
//
curriculaId: id.value,
courseType
:
checkedType
.
value
,
curriculaTime
:
formatDatetime
(
new
Date
()),
curriculaState
:
'2'
,
//物理化学科
selectedCourse
:
checkedArtSub
.
value
,
selectedMajor
:
''
,
// 艺考
selectedSubject
:
checkedArt
.
value
,
id
:
id
.
value
}
console
.
log
(
'data'
,
data
)
let
result
=
await
saveSelectInfo
(
data
)
...
...
@@ -1335,4 +1389,7 @@ const goback = (g) => {
margin-bottom
:
10px
;
}
::v-deep
.van-radio__label--disabled
{
color
:
#323233
;
}
</
style
>
src/views/tabbar/TeacherInfo.vue
View file @
50341b1c
...
...
@@ -278,6 +278,7 @@ export default {
});
const
initUserInfo
=
async
()
=>
{
console
.
log
(
'store'
,
store
)
//访问后台接口
let
result
=
await
getteacherInfo
();
if
(
result
.
code
==
200
)
{
...
...
src/views/tabbar/main/index.vue
View file @
50341b1c
...
...
@@ -184,7 +184,7 @@
/>
<span
class=
"item_text"
>
教师信息
</span>
</van-grid-item>
<van-grid-item
icon=
"photo-o"
text=
"学生选课"
url=
" #/studentCourseSelection
"
>
<van-grid-item
@
click
.
native=
"toCourseSelect"
icon=
"photo-o"
text=
"学生选课
"
>
<van-image
style=
"width: 48px"
:src=
"require('@/assets/index/rkls.png')"
...
...
@@ -482,6 +482,7 @@
<
script
>
// import HelloWorld from "@/components/HelloWorld.vue";
import
moment
from
"moment"
;
import
{
reactive
,
onMounted
,
toRefs
,
ref
}
from
"vue"
;
import
{}
from
"@/service/home"
;
import
{
useStore
}
from
"vuex"
;
...
...
@@ -506,7 +507,9 @@ import {
getRunNum
,
}
from
"@/service/home"
;
import
{
storetyprelationshiptyp
}
from
"@/service/dir"
;
import
{
getStudentInfo
,
//学生选课信息查询
}
from
"@/service/studentCourseSelection"
;
export
default
{
name
:
"Home"
,
...
...
@@ -533,7 +536,8 @@ export default {
const
getpic
=
(
img
)
=>
{
return
axios
.
defaults
.
baseURL
+
img
;
};
const
courseStartTime
=
ref
();
const
courseEndTime
=
ref
();
const
loadData
=
async
()
=>
{
console
.
log
(
"加载数据"
,
store
);
goCalendar
();
...
...
@@ -556,9 +560,7 @@ export default {
/* 初始化 消息推送数据 */
let
type
=
store
.
state
.
userLoginType
;
state
.
typ
=
type
;
//访问后台接口
if
(
type
==
1
)
{
parentShow
.
value
=
true
;
initGradeList
();
...
...
@@ -590,8 +592,35 @@ export default {
storetypsectiontyp
();
storetyprelationshiptyp
();
getnumb
();
if
(
store
.
state
.
userInfo
.
studentId
){
courseInfo
();
}
};
const
flag
=
ref
();
const
noCourse
=
ref
(
false
)
//获取选课基本信息
const
courseInfo
=
async
()
=>
{
let
result
=
await
getStudentInfo
(
store
.
state
.
userInfo
.
studentId
)
console
.
log
(
'result66'
,
result
)
if
(
result
.
code
==
200
){
courseStartTime
.
value
=
result
.
data
.
startTime
;
courseEndTime
.
value
=
result
.
data
.
endTime
;
flag
.
value
=
result
.
data
.
flag
}
if
(
result
.
code
==
2000
){
noCourse
.
value
=
true
}
}
//点击学生选课
const
toCourseSelect
=
()
=>
{
// console.log('flag.value',flag.value)
if
(
noCourse
.
value
==
true
){
Toast
(
"当前没有选课任务!"
);
}
else
{
router
.
push
({
path
:
"/studentCourseSelection"
,
})
}
}
const
getuserInfo
=
async
()
=>
{
//访问后台接口
let
result
=
await
getInfo
();
...
...
@@ -821,6 +850,7 @@ export default {
goaskForLeavealist
,
goDutytable
,
gomylesson
,
toCourseSelect
};
},
};
...
...
src/views/teacher/schoolProperty/borrowDetail.vue
View file @
50341b1c
...
...
@@ -2,58 +2,72 @@
<van-nav-bar
:title=
title
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<van-form
@
submit=
"onSubmit"
class=
"formBlock"
label-align=
"right"
label-width=
"110px"
>
<van-cell-group
inset
>
<van-field
:readonly=
"queryId ? true : false"
v-model=
"borrowForm.encode"
label=
"自编码"
placeholder=
"请输入自编码"
/>
<van-field
:readonly=
"queryId ? true : false"
v-model=
"borrowForm.equipmentName"
label=
"设备名称"
<van-field
readonly
v-model=
"borrowForm.encode"
label=
"自编码"
placeholder=
"请输入自编码"
/>
<van-field
readonly
v-model=
"borrowForm.equipmentName"
label=
"设备名称"
placeholder=
"请输入设备名称"
/>
<van-field
:readonly=
"queryId ? true : false"
v-model=
"borrowForm.model"
label=
"型号"
placeholder=
"请输入型号"
/>
<
div
v-if=
"queryId"
>
<van-field
readonly
v-model=
"
borrowTime"
label=
"借用日期"
/>
<
/div
>
<
div
v-else
>
<van-field
is-link
readonly
v-model=
"borrowTime"
label=
"借用日期"
@
click=
"showPicker = true"
placeholder=
"请选择借用日期"
/
>
<van-calendar
:readonly=
"queryId ? true : false"
v-model:show=
"showPicker"
@
confirm=
"onConfirmBorrowTime"
/
>
<
/div
>
<van-field
:readonly=
"queryId ? true : false"
v-model=
"borrowForm.borrowBy"
label=
"借用人"
placeholder=
"请输入借用人"
/>
<van-field
readonly
v-model=
"borrowForm.model"
label=
"型号"
placeholder=
"请输入型号"
/>
<
!--
<div
v-if=
"queryId"
>
--
>
<van-field
readonly
v-model=
"borrowForm.
borrowTime"
label=
"借用日期"
/>
<
!--
</div>
--
>
<
!--
<div
v-else
>
--
>
<!--
<van-field
is-link
readonly
v-model=
"borrowForm.borrowTime"
label=
"借用日期"
@
click=
"showPicker = true"
--
>
<!-- placeholder="请选择借用日期"/>--
>
<!--
<van-calendar
:readonly=
"queryId ? true : false"
v-model:show=
"showPicker"
@
confirm=
"onConfirmBorrowTime"
/>
--
>
<
!--
</div>
--
>
<van-field
readonly
v-model=
"borrowForm.borrowBy"
label=
"借用人"
placeholder=
"请输入借用人"
/>
<van-field
:readonly=
"queryId ? true : false"
v-model=
"borrowForm.purpose"
label=
"用途"
placeholder=
"请输入用途"
/>
<div
v-if=
"queryId"
>
<van-field
readonly
v-model=
"returnTime"
label=
"归还时间"
/>
<van-field
readonly
v-model=
"
borrowForm.
returnTime"
label=
"归还时间"
/>
<van-field
readonly
v-model=
"borrowForm.returnEquipmentCondition"
label=
"归还时设备情况"
/>
</div>
<van-field
:readonly=
"queryId ? true : false"
v-model=
"borrowForm.deadline"
label=
"借用期限(天)"
placeholder=
"请输入借用期限"
/>
</van-cell-group>
<div>
<van-button
class=
"sureBtn"
round
block
type=
"primary"
native-type=
"submit"
>
确 定
</van-button>
<div
v-if=
"queryId"
style=
"margin: 30px; display: flex;justify-content: center"
>
<van-button
round
type=
"success"
size=
"small"
style=
"width: 80px;margin-left: 20px;"
@
click=
"goback"
>
关 闭
</van-button>
</div>
<div
v-else
style=
"margin: 30px; display: flex;justify-content: center"
>
<van-button
size=
"small"
round
type=
"primary"
style=
"width: 80px;"
native-type=
"submit"
>
确 定
</van-button>
<van-button
round
type=
"success"
size=
"small"
style=
"width: 80px;margin-left: 20px;"
@
click=
"goback"
>
取 消
</van-button>
</div>
</van-form>
</
template
>
<
script
setup
>
import
{
checkBorrowDetail
}
from
"@/service/schoolProperty"
import
{
checkBorrowDetail
,
scanEquipmentInfo
,
submitBorrowDetail
}
from
"@/service/schoolProperty"
import
{
reactive
,
ref
,
onMounted
}
from
"vue"
;
import
{
formatDatetime
}
from
"@/utils/time.js"
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
useStore
}
from
"vuex"
;
import
{
Toast
,
Dialog
}
from
"vant"
;
const
store
=
useStore
();
const
userName
=
store
.
state
.
userInfo
.
teacherName
console
.
log
(
'store'
,
store
.
state
)
const
router
=
useRouter
();
const
route
=
useRoute
();
const
queryId
=
route
.
query
.
id
;
const
queryEncode
=
route
.
query
.
encode
let
title
=
ref
(
''
)
// 页面标题
let
borrowForm
=
reactive
({
// 表单数据
encode
:
''
,
//自编码
equipmentName
:
''
,
//设备名称
model
:
''
,
//型号
// borrowTime:
'', // 借用日期
borrowTime
:
''
,
// 借用日期
borrowBy
:
''
,
//借用人
purpose
:
''
,
//用途
// deadline:
'', //借用期限(天)
deadline
:
''
,
//借用期限(天)
returnTime
:
''
,
//归还日期
returnEquipmentCondition
:
''
,
//归还时设备情况
})
let
borrowTime
=
ref
(
''
)
// 借用日期
let
returnTime
=
ref
(
''
)
// 归还日期
//
let borrowTime = ref('') // 借用日期
//
let returnTime = ref('') // 归还日期
let
showPicker
=
ref
(
false
)
//是否显示日历选择-借用
...
...
@@ -64,20 +78,60 @@ onMounted(async () => {
console
.
log
(
'result'
,
result
)
title
.
value
=
'物品借用查看'
Object
.
assign
(
borrowForm
,
result
.
data
)
borrowTime
.
value
=
result
.
data
.
borrowTime
returnTime
.
value
=
result
.
data
.
returnTime
//
borrowTime.value = result.data.borrowTime
//
returnTime.value = result.data.returnTime
}
else
{
console
.
log
(
'queryEncode'
,
queryEncode
)
title
.
value
=
'物品借用新增'
}
let
equipmentRes
=
await
scanEquipmentInfo
(
queryEncode
)
console
.
log
(
'equipmentRes'
,
equipmentRes
)
Object
.
assign
(
borrowForm
,
equipmentRes
.
data
)
borrowForm
.
borrowBy
=
userName
borrowForm
.
borrowTime
=
formatDatetime
(
new
Date
())
console
.
log
(
'borrowForm'
,
borrowForm
)
if
(
equipmentRes
.
data
.
affiliationType
!=
2
)
{
Dialog
.
alert
({
title
:
'提示'
,
message
:
'该设备不属于信息中心,不可借用'
,
}).
then
(()
=>
{
router
.
back
();
});
}
else
if
(
equipmentRes
.
data
.
equipmentState
!=
1
)
{
Dialog
.
alert
({
title
:
'提示'
,
message
:
'该设备非完好状态,不可借用'
,
}).
then
(()
=>
{
router
.
back
();
});
}
else
if
(
equipmentRes
.
data
.
isAllowLend
==
0
)
{
Dialog
.
alert
({
title
:
'提示'
,
message
:
'该设备不允许借用'
,
}).
then
(()
=>
{
router
.
back
();
});
}
else
if
(
equipmentRes
.
data
.
isLend
==
1
){
Dialog
.
alert
({
title
:
'提示'
,
message
:
'该设备已借出'
,
}).
then
(()
=>
{
router
.
back
();
});
}
}
});
//借用日期确认
const
onConfirmBorrowTime
=
(
date
)
=>
{
borrow
Time
.
valu
e
=
`
${
date
.
getFullYear
()}
-
${
date
.
getMonth
()
+
1
}
-
${
date
.
getDate
()}
`
borrow
Form
.
borrowTim
e
=
`
${
date
.
getFullYear
()}
-
${
date
.
getMonth
()
+
1
}
-
${
date
.
getDate
()}
`
// returnTime.value = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
showPicker
.
value
=
false
;
console
.
log
(
'date'
,
date
)
console
.
log
(
'borrowTime.value'
,
borrow
Time
.
valu
e
)
console
.
log
(
'borrowTime.value'
,
borrow
Form
.
borrowTim
e
)
};
//返回上一页
...
...
@@ -86,13 +140,26 @@ const goback = () => {
};
//表单提交
const
onSubmit
=
()
=>
{
if
(
queryId
)
{
const
onSubmit
=
async
()
=>
{
console
.
log
(
'queryEncode'
,
queryEncode
)
const
params
=
{
equipmentId
:
borrowForm
.
id
,
borrowTime
:
borrowForm
.
borrowTime
,
borrowById
:
store
.
state
.
userInfo
.
userId
,
borrowBy
:
userName
,
purpose
:
borrowForm
.
purpose
,
deadline
:
Number
(
borrowForm
.
deadline
),
}
console
.
log
(
'params'
,
params
)
// 调接口
let
result
=
await
submitBorrowDetail
(
params
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
)
{
router
.
back
();
}
else
{
Toast
(
"借用成功"
);
}
}
</
script
>
...
...
src/views/teacher/schoolProperty/borrowList.vue
View file @
50341b1c
<
template
>
<van-nav-bar
title=
"物品借用"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<van-nav-bar
title=
"物品借用"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<div
class=
"flexBLock searchBlock"
>
<van-search
class=
"searchInput"
v-model=
"searchKey"
placeholder=
"请输入搜索关键词"
/>
<van-icon
name=
"scan"
@
click=
"getCode"
/>
...
...
@@ -34,6 +34,7 @@ import { useRouter } from "vue-router";
import
{
onMounted
,
ref
}
from
"vue"
;
import
{
useStore
}
from
"vuex"
;
import
{
scanCodeFun
}
from
"../../../utils/scanCode"
import
{
Toast
}
from
"vant"
;
const
router
=
useRouter
();
const
store
=
useStore
();
...
...
@@ -43,18 +44,39 @@ const loading = ref(false)
const
list
=
ref
([]);
const
pullLoading
=
ref
(
false
);
const
finished
=
ref
(
false
);
const
pageNum
=
ref
(
0
);
//扫码获取
const
getCode
=
()
=>
{
let
enCode
=
scanCodeFun
(
store
.
state
.
appid
)
//获取到的设备自编码
scanCodeFun
(
store
.
state
.
appid
,
1
)
//获取到的设备自编码
// let enCode = scanCodeFun(store.state.appid,1) //获取到的设备自编码
//测试
// router.push({
// path: "/schoolProperty/borrow/detail",
// query: {
// encode:'100101202300003'
// }
// })
}
//获取列表数据
const
getList
=
async
()
=>
{
if
(
pullLoading
.
value
)
{
list
.
value
=
[];
pageNum
.
value
=
0
;
pullLoading
.
value
=
false
;
}
let
result
=
await
getBorrowList
(
id
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
loading
.
value
=
false
;
list
.
value
=
result
.
data
finished
.
value
=
true
}
else
{
Toast
(
"获取信息失败!"
);
finished
.
value
=
true
;
loading
.
value
=
false
;
return
;
}
}
...
...
@@ -76,7 +98,10 @@ const goback = () => {
//下拉刷新
const
onRefresh
=
()
=>
{
finished
.
value
=
false
;
loading
.
value
=
true
;
pullLoading
.
value
=
true
;
getList
()
};
</
script
>
...
...
src/views/teacher/schoolProperty/deviceList.vue
View file @
50341b1c
<
template
>
<van-nav-bar
title=
"设备报修"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<div
class=
"flexBLock searchBlock"
>
<van-search
class=
"searchInput"
v-model=
"searchKey"
placeholder=
"请输入搜索关键词"
/>
<van-icon
name=
"scan"
/>
<van-search
class=
"searchInput"
@
search=
"onSearch"
v-model=
"searchKey"
placeholder=
"请输入搜索关键词"
/>
<van-icon
name=
"scan"
@
click=
"getCode"
/>
</div>
<van-pull-refresh
v-model=
"pullLoading"
@
refresh=
"onRefresh"
>
<van-list
v-model:loading=
"loading"
:finished=
"finished"
finished-text=
"没有更多了"
@
load=
"getList"
>
<div
style=
"position:relative;"
v-for=
"(item,index) in list"
:key=
"index"
class=
"listBlock"
>
<div>
自编码:
{{
item
.
encode
}}
</div>
<div>
设备名称:
{{
item
.
equipmentName
}}
</div>
<div>
型号:
{{
item
.
model
}}
}
</div>
<div>
型号:
{{
item
.
model
}}
</div>
<div>
投产日期:
{{
item
.
dateOfProduction
}}
</div>
<div>
地点:
{{
item
.
place
}}
</div>
<div>
报修日期:
{{
item
.
reportRepairTime
}}
</div>
<div>
报修人:
{{
item
.
reportRepair
}}
</div>
<div>
问题:
{{
item
.
problem
}}
</div>
<div
class=
"flexBLock btnBlock"
>
<div
v-if=
"item.disposeState == 0"
class=
"flexBLock btnBlock"
>
<van-button
size=
"small"
round
type=
"primary"
class=
"btn"
@
click=
"toDetail('修改',item.id)"
>
修 改
</van-button>
<van-button
size=
"small"
round
type=
"success"
class=
"btn"
@
click=
"toDetail('反馈',item.id)"
>
反 馈
</van-button>
<van-button
size=
"small"
round
type=
"default"
class=
"btn"
@
click=
"toDetail('查看',item.id)"
>
查 看
</van-button>
<van-button
size=
"small"
round
type=
"danger"
class=
"btn"
@
click=
"deleteDevice(item.id)"
>
删 除
</van-button>
</div>
<div
v-if=
"item.disposeState == 1"
>
<van-button
style=
"margin-right: 10px"
size=
"small"
round
type=
"success"
class=
"btn"
@
click=
"toDetail('反馈',item.id)"
>
反 馈
</van-button>
<van-button
size=
"small"
round
type=
"default"
class=
"btn"
@
click=
"toDetail('查看',item.id)"
>
查 看
</van-button>
</div>
<div
class=
"state"
>
<div
v-if=
"item.repairState == 0 && item.disposeState == 1"
class=
"fixed"
>
已
完成
-已维修
</div>
<div
v-if=
"item.repairState == 1 && item.disposeState == 1"
class=
"unable"
>
已
完成
-已维修
</div>
<div
v-if=
"item.repairState == 0 && item.disposeState == 1"
class=
"fixed"
>
已
处理
-已维修
</div>
<div
v-if=
"item.repairState == 1 && item.disposeState == 1"
class=
"unable"
>
已
处理
-已维修
</div>
</div>
</div>
</van-list>
...
...
@@ -30,19 +34,20 @@
</
template
>
<
script
setup
>
import
{
getDeviceList
}
from
"@/service/schoolProperty"
import
{
getDeviceList
,
deletEuipemnt
}
from
"@/service/schoolProperty"
import
{
useRouter
}
from
"vue-router"
;
import
{
onMounted
,
ref
}
from
"vue"
;
import
{
useStore
}
from
"vuex"
;
import
{
Toast
}
from
"vant"
;
import
{
scanCodeFun
}
from
"../../../utils/scanCode"
;
const
router
=
useRouter
();
const
store
=
useStore
();
const
id
=
store
.
state
.
userInfo
.
userId
;
console
.
log
(
'id'
,
id
)
const
rolesArr
=
store
.
state
.
userInfo
.
roles
;
let
searchKey
=
ref
(
''
)
const
loading
=
ref
(
false
)
const
list
=
ref
([]);
const
pullLoading
=
ref
(
false
);
const
finished
=
ref
(
false
);
...
...
@@ -51,14 +56,42 @@ onMounted( () => {
});
//获取列表数据
const
getList
=
async
()
=>
{
console
.
log
(
'id'
,
id
)
if
(
pullLoading
.
value
)
{
list
.
value
=
[];
pageNum
.
value
=
0
;
pullLoading
.
value
=
false
;
}
let
result
=
await
getDeviceList
(
id
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
loading
.
value
=
false
;
list
.
value
=
result
.
data
finished
.
value
=
true
}
else
{
Toast
(
"获取信息失败!"
);
finished
.
value
=
true
;
loading
.
value
=
false
;
return
;
}
}
//搜索
const
onSearch
=
(
val
)
=>
{
console
.
log
(
'搜索val'
,
val
)
}
//扫码获取
const
getCode
=
()
=>
{
scanCodeFun
(
store
.
state
.
appid
,
4
)
//获取到的设备自编码
// let enCode = scanCodeFun(store.state.appid,4) //获取到的设备自编码
//测试
// router.push({
// path: "/schoolProperty/device/info",
// query: {
// encode:'100101202300003',
// name:'新增'
// }
// })
}
//详情按钮
const
toDetail
=
(
name
,
id
)
=>
{
console
.
log
(
'id'
,
id
)
...
...
@@ -71,8 +104,14 @@ const toDetail = (name,id) => {
})
}
//删除按钮
const
deleteDevice
=
()
=>
{
const
deleteDevice
=
async
(
id
)
=>
{
console
.
log
(
'id'
,
id
)
let
result
=
await
deletEuipemnt
(
id
)
if
(
result
.
code
==
200
){
Toast
.
success
(
"删除成功"
);
getList
()
}
console
.
log
(
'result'
,
result
)
}
//返回上一页
const
goback
=
()
=>
{
...
...
@@ -81,7 +120,10 @@ const goback = () => {
//下拉刷新
const
onRefresh
=
()
=>
{
finished
.
value
=
false
;
loading
.
value
=
true
;
pullLoading
.
value
=
true
;
getList
()
};
</
script
>
...
...
src/views/teacher/schoolProperty/deviceListInfo.vue
View file @
50341b1c
...
...
@@ -5,8 +5,8 @@
<van-form
class=
"formBlock"
label-align=
"right"
label-width=
"60px"
>
<van-cell-group
inset
>
<van-field
:readonly=
"name == '新增' || name == '查看' ? true : false"
v-model=
"
ow
ncode"
readonly
v-model=
"
fixForm.e
ncode"
name=
"自编码"
label=
"自编码"
placeholder=
"自编码"
...
...
@@ -14,9 +14,8 @@
/>
<van-field
v-if=
"name == '反馈' ? false : true"
:readonly=
"name == '新增' || name == '查看' ? true : false"
v-model=
"password"
type=
"password"
readonly
v-model=
"fixForm.equipmentName"
name=
"设备名称"
label=
"设备名称"
placeholder=
"设备名称"
...
...
@@ -24,9 +23,8 @@
/>
<van-field
v-if=
"name == '反馈' ? false : true"
:readonly=
"name == '新增' || name == '查看' ? true : false"
v-model=
"password"
type=
"password"
readonly
v-model=
"fixForm.model"
name=
"型号"
label=
"型号"
placeholder=
"型号"
...
...
@@ -34,9 +32,8 @@
/>
<van-field
v-if=
"name == '反馈' ? false : true"
:readonly=
"name == '新增' || name == '查看' ? true : false"
v-model=
"password"
type=
"password"
readonly
v-model=
"fixForm.dateOfProduction"
name=
"投产日期"
label=
"投产日期"
placeholder=
"投产日期"
...
...
@@ -44,29 +41,26 @@
/>
<van-field
v-if=
"name == '反馈' ? false : true"
:readonly=
"name == '新增' || name == '查看' ? true : false"
v-model=
"password"
type=
"password"
readonly
v-model=
"fixForm.place"
name=
"地点"
label=
"地点"
placeholder=
"地点"
:rules=
"[
{ required: true, message: '请填写地点' }]"
/>
<van-field
v-if=
"name == '反馈' ? false : true"
v-model=
"fixForm.reportRepairTime"
readonly
name=
"calendar"
label=
"报修时间"
placeholder=
"请填写报修时间"
:rules=
"[
{ required: true, message: '请填写报修时间' }]"
/>
<van-field
v-if=
"name == '反馈' ? false : true"
:readonly=
"name == '新增' || name == '查看' ? true : false"
v-model=
"password"
type=
"password"
name=
"报修时间"
label=
"报修时间"
placeholder=
"报修时间"
:rules=
"[
{ required: true, message: '请填写报修时间' }]"
/>
<van-field
v-if=
"name == '反馈' ? false : true"
:readonly=
"name == '新增' || name == '查看' ? true : false"
v-model=
"password"
type=
"password"
readonly
v-model=
"fixForm.reportRepair"
name=
"报修人"
label=
"报修人"
placeholder=
"报修人"
...
...
@@ -74,55 +68,80 @@
/>
<van-field
v-if=
"name == '反馈' ? false : true"
:readonly=
"name == '查看' ? true : false"
v-model=
"password"
type=
"password"
v-model=
"fixForm.problem"
name=
"问题"
label=
"问题"
placeholder=
"问题"
:rules=
"[
{ required: true, message: '请填写问题' }]"
/>
<van-field
v-if=
"name == '反馈' || name =='查看' ? true : false "
v-model=
"state.fixman"
is-link
readonly
name=
"picker"
label=
"修理人"
placeholder=
"请选择修理人"
@
click=
"showPicker = true"
:rules=
"[
{ required: true, message: '请选择修理人' }]"
/>
<van-popup
v-model:show=
"showPicker"
position=
"bottom"
>
<van-picker
:columns=
"columns"
@
confirm=
"onConfirm"
@
cancel=
"showPicker = false"
<div
v-if=
"name=='查看'"
>
<van-field
v-model=
"fixForm.repairName"
readonly
label=
"修理人"
/>
</van-popup>
</div>
<div
v-if=
"name == '反馈'"
>
<van-field
v-if=
"name == '反馈' || name =='查看' ? true : false "
v-model=
"fixForm.repairName"
is-link
readonly
name=
"picker"
label=
"修理人"
placeholder=
"请选择修理人"
@
click=
"showPicker = true"
:rules=
"[
{ required: true, message: '请选择修理人' }]"
/>
<van-popup
v-model:show=
"showPicker"
position=
"bottom"
>
<van-picker
:columns=
"columns"
@
confirm=
"onConfirm"
@
cancel=
"showPicker = false"
/>
</van-popup>
</div>
<van-field
v-if=
"name == '反馈' || name =='查看' ? true : false "
v-model=
"
password
"
type=
"password"
v-model=
"
fixForm.repairTime
"
readonly
name=
"修理时间"
label=
"修理时间"
placeholder=
"修理时间"
:rules=
"[
{ required: true, message: '请填写修理时间' }]"
/>
<van-field
v-if=
"name == '反馈' || name =='查看' ? true : false "
v-model=
"password"
type=
"password"
name=
"维修结果"
label=
"维修结果"
placeholder=
"维修结果"
:rules=
"[
{ required: true, message: '请填写维修结果' }]"
/>
<div
v-if=
"name == '反馈'"
>
<van-field
v-if=
"name == '反馈' || name =='查看' ? true : false "
v-model=
"fixForm.repairStateName"
is-link
readonly
name=
"picker"
label=
"维修结果"
placeholder=
"维修结果"
@
click=
"showState = true"
:rules=
"[
{ required: true, message: '请填写维修结果' }]"
/>
<van-popup
v-model:show=
"showState"
position=
"bottom"
>
<van-picker
:columns=
"stateColumns"
@
confirm=
"repairState"
@
cancel=
"showState = false"
/>
</van-popup>
</div>
<div
v-if=
"name == '查看'"
>
<van-field
v-model=
"fixForm.repairStateName"
readonly
label=
"维修结果"
/>
</div>
<van-field
v-if=
" name =='查看' ? true : false "
readonly
v-model=
"password"
type=
"password"
v-model=
"fixForm.remark"
name=
"备注"
label=
"备注"
placeholder=
"备注"
...
...
@@ -130,16 +149,30 @@
/>
<van-field
v-if=
"name == '反馈' ? true : false"
name=
"rate"
label=
"评分"
>
<template
#
input
>
<van-rate
v-model=
"
valu
e"
/>
<van-rate
v-model=
"
evaluat
e"
/>
</
template
>
</van-field>
</van-cell-group>
<div
style=
"margin: 30px; display: flex;justify-content: center"
>
<div
v-if=
"name=='反馈'"
style=
"margin: 30px; display: flex;justify-content: center"
>
<van-button
round
type=
"primary"
size=
"small"
style=
"width: 80px;"
@
click=
"feedBack"
>
确 定
</van-button>
<van-button
round
type=
"success"
size=
"small"
style=
"width: 80px;margin-left: 20px;"
@
click=
"cancel"
>
取 消
</van-button>
</div>
<div
v-if=
"name=='查看'"
style=
"margin: 30px; display: flex;justify-content: center"
>
<van-button
round
type=
"primary"
size=
"small"
style=
"width: 80px;margin-left: 20px;"
@
click=
"cancel"
>
关 闭
</van-button>
</div>
<div
v-if=
"name=='修改' || name =='新增'"
style=
"margin: 30px; display: flex;justify-content: center"
>
<van-button
round
type=
"primary"
size=
"small"
style=
"width: 80px;"
@
click=
"onSubmit"
>
点击报修
</van-button>
<van-button
round
type=
"success"
size=
"small"
style=
"width: 80px;margin-left: 20px;"
@
click=
"cancel"
>
取消
取
消
</van-button>
</div>
</van-form>
...
...
@@ -147,44 +180,190 @@
</template>
<
script
setup
>
import
{
addDevice
,
getDeviceDetail
,
editDevice
,
getFeedbackDetail
,
submitFeedback
}
from
"@/service/schoolProperty"
import
{
getRepairName
,
addDevice
,
getDeviceDetail
,
editDevice
,
getFeedbackDetail
,
submitFeedback
,
scanEquipmentInfo
}
from
"@/service/schoolProperty"
import
{
formatDatetime
}
from
"@/utils/time.js"
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
ref
,
onMounted
,
reactive
}
from
"vue"
;
import
{
useStore
}
from
"vuex"
;
import
{
Toast
}
from
"vant"
;
const
router
=
useRouter
();
const
route
=
useRoute
();
const
store
=
useStore
();
const
queryEncode
=
route
.
query
.
encode
;
const
userName
=
store
.
state
.
userInfo
.
teacherName
const
userId
=
store
.
state
.
userInfo
.
userId
const
title
=
ref
(
""
);
const
name
=
route
.
query
.
name
;
const
id
=
route
.
query
.
id
;
const
state
=
reactive
({
fixman
:
''
,
//修理人
const
encode
=
route
.
query
.
encode
;
const
fixForm
=
reactive
({
encode
:
''
,
//自编码
equipmentName
:
''
,
//设备名称
model
:
''
,
//型号
dateOfProduction
:
''
,
//投产日期
place
:
''
,
//地点
reportRepairTime
:
''
,
//报修时间
reportRepair
:
''
,
//报修人
problem
:
''
,
//问题
repairName
:
''
,
//修理人
repairId
:
''
,
//修理人id
repairPhone
:
''
,
//修理人电话
repairTime
:
''
,
//修理时间
repairState
:
''
,
//维修结果
repairStateName
:
''
,
//维修结果文本
remark
:
''
,
//备注
})
const
evaluate
=
ref
();
const
showState
=
ref
(
false
);
const
stateColumns
=
[{
text
:
'已维修'
,
id
:
0
},{
text
:
'已损坏'
,
id
:
1
}];
//维修结果
const
repairState
=
(
value
)
=>
{
console
.
log
(
'value'
,
value
)
fixForm
.
repairStateName
=
value
.
text
;
fixForm
.
repairState
=
value
.
id
;
showState
.
value
=
false
;
};
const
showPicker
=
ref
(
false
);
const
columns
=
[
'杭州'
,
'宁波'
,
'温州'
,
'嘉兴'
,
'湖州'
];
const
columns
=
ref
([]);
//修理人
const
onConfirm
=
(
value
)
=>
{
state
.
fixman
=
value
;
console
.
log
(
'value'
,
value
)
fixForm
.
repairName
=
value
.
text
;
fixForm
.
repairId
=
value
.
id
;
fixForm
.
repairPhone
=
value
.
phone
showPicker
.
value
=
false
;
};
onMounted
(
async
()
=>
{
let
repairResult
=
await
getRepairName
()
console
.
log
(
'repairResult'
,
repairResult
)
if
(
repairResult
.
code
==
200
){
columns
.
value
=
repairResult
.
data
.
map
(
item
=>
{
return
{
text
:
item
.
repairName
,
id
:
item
.
repairId
,
phone
:
item
.
repairPhone
}
})
console
.
log
(
'columns.value'
,
columns
.
value
)
}
if
(
name
==
'修改'
)
{
title
.
value
=
'报修台账修改'
let
editResult
=
await
editDevice
(
id
)
let
editResult
=
await
getDeviceDetail
(
id
)
console
.
log
(
'editResult'
,
editResult
)
if
(
editResult
.
code
==
200
){
Object
.
assign
(
fixForm
,
editResult
.
data
)
console
.
log
(
'fixForm'
,
fixForm
)
}
}
if
(
name
==
'反馈'
)
{
title
.
value
=
'报修台账反馈'
let
feedBack
=
await
getFeedbackDetail
(
id
)
console
.
log
(
'feedBack'
,
feedBack
)
if
(
feedBack
.
code
==
200
){
Object
.
assign
(
fixForm
,
feedBack
.
data
)
// fixForm.repairState = stateColumns[feedBack.data.repairState]
stateColumns
.
find
(
item
=>
{
if
(
item
.
id
==
feedBack
.
data
.
repairState
){
console
.
log
(
'item'
,
item
)
fixForm
.
repairStateName
=
item
.
text
}
})
}
}
if
(
name
==
'查看'
)
{
title
.
value
=
'报修台账查看'
let
checkResult
=
await
getDeviceDetail
(
id
)
console
.
log
(
'editResult'
,
checkResult
)
if
(
checkResult
.
code
==
200
){
Object
.
assign
(
fixForm
,
checkResult
.
data
)
console
.
log
(
'fixForm'
,
fixForm
)
// fixForm.repairState = stateColumns[checkResult.data.repairState]
stateColumns
.
find
(
item
=>
{
if
(
item
.
id
==
checkResult
.
data
.
repairState
){
console
.
log
(
'item'
,
item
)
fixForm
.
repairStateName
=
item
.
text
}
})
}
}
if
(
name
==
'新增'
){
title
.
value
=
'新增报修台账'
let
equipmentRes
=
await
scanEquipmentInfo
(
queryEncode
)
console
.
log
(
'equipmentRes'
,
equipmentRes
.
data
)
Object
.
assign
(
fixForm
,
equipmentRes
.
data
)
fixForm
.
reportRepairTime
=
formatDatetime
(
new
Date
())
fixForm
.
reportRepair
=
userName
console
.
log
(
'fixForm'
,
fixForm
)
}
});
//点击报修按钮
const
onSubmit
=
()
=>
{
const
onSubmit
=
async
()
=>
{
if
(
id
){
//修改
const
params
=
{
id
:
id
,
equipmentId
:
fixForm
.
equipmentId
,
classificationCode
:
fixForm
.
classificationCode
,
reportRepairTime
:
fixForm
.
reportRepairTime
,
reportRepairId
:
fixForm
.
reportRepairId
,
reportRepair
:
fixForm
.
reportRepair
,
problem
:
fixForm
.
problem
}
console
.
log
(
'params'
,
params
)
let
result
=
await
editDevice
(
params
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
Toast
.
success
(
"修改成功"
);
router
.
back
();
}
}
else
{
// 新增
const
params
=
{
equipmentId
:
fixForm
.
id
,
reportRepairTime
:
fixForm
.
reportRepairTime
,
classificationCode
:
fixForm
.
classificationCode
,
reportRepairId
:
userId
,
reportRepair
:
fixForm
.
reportRepair
,
problem
:
fixForm
.
problem
}
console
.
log
(
'params'
,
params
)
let
result
=
await
addDevice
(
params
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
Toast
.
success
(
"报修成功"
);
router
.
back
();
}
}
};
//点击反馈按钮
const
feedBack
=
async
()
=>
{
const
params
=
{
id
:
Number
(
id
),
evaluate
:
evaluate
.
value
?
evaluate
.
value
.
toString
():
''
,
repairName
:
fixForm
.
repairName
,
repairId
:
fixForm
.
repairId
,
repairState
:
fixForm
.
repairState
,
repairPhone
:
fixForm
.
repairPhone
,
repairTime
:
fixForm
.
repairTime
}
console
.
log
(
'params'
,
params
)
let
result
=
await
submitFeedback
(
params
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
Toast
.
success
(
"反馈成功"
);
router
.
back
();
}
};
//取消按钮
const
cancel
=
()
=>
{
...
...
src/views/teacher/schoolProperty/equipmentFix.vue
0 → 100644
View file @
50341b1c
<
template
>
<van-nav-bar
title=
"设备维修"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<div
class=
"flexBLock searchBlock"
>
<van-search
class=
"search"
v-model=
"searchKey"
show-action
placeholder=
"请输入搜索关键词"
>
<template
#
action
>
<div
@
click=
"onClickSearch"
>
搜 索
</div>
</
template
>
</van-search>
</div>
<van-pull-refresh
v-model=
"pullLoading"
@
refresh=
"onRefresh"
>
<van-list
v-model:loading=
"loading"
:finished=
"finished"
finished-text=
"没有更多了"
@
load=
"getList"
>
<div
style=
"position:relative;"
v-for=
"(item,index) in list"
:key=
"index"
class=
"listBlock"
@
click=
"toDetail(item)"
>
<div>
自编码:{{ item.encode }}
</div>
<div>
修理人:{{ item.repairName }}
</div>
<div>
修理时间:{{ item.repairTime }}
</div>
<div>
修理状态:{{ item. disposeState}}
</div>
<div>
报修人确认:{{item.repairState}}
</div>
<div>
备注:{{ item.remark }}
</div>
<div
class=
"state"
>
<div
v-if=
"item.disposeState == 1"
class=
"fixed"
>
已完成
</div>
<div
v-if=
"item.disposeState == 0"
class=
"unable"
>
待维修
</div>
</div>
</div>
</van-list>
</van-pull-refresh>
</template>
<
script
setup
>
import
{
getMaintenanceList
,
getMaintenanceDetail
}
from
"@/service/schoolProperty"
import
{
useRouter
}
from
"vue-router"
;
import
{
onMounted
,
ref
}
from
"vue"
;
import
{
useStore
}
from
"vuex"
;
import
{
Toast
}
from
"vant"
;
import
{
scanCodeFun
}
from
"../../../utils/scanCode"
;
const
router
=
useRouter
();
const
store
=
useStore
();
const
id
=
store
.
state
.
userInfo
.
userId
;
console
.
log
(
'id'
,
id
)
const
rolesArr
=
store
.
state
.
userInfo
.
roles
;
let
searchKey
=
ref
(
''
)
const
loading
=
ref
(
false
)
const
list
=
ref
([]);
const
pullLoading
=
ref
(
false
);
const
finished
=
ref
(
false
);
onMounted
(
()
=>
{
});
//搜索按钮
const
onClickSearch
=
()
=>
{
console
.
log
(
'searchKey.value'
,
searchKey
.
value
)
}
//获取列表数据
const
getList
=
async
()
=>
{
if
(
pullLoading
.
value
)
{
list
.
value
=
[];
pageNum
.
value
=
0
;
pullLoading
.
value
=
false
;
}
let
result
=
await
getMaintenanceList
()
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
loading
.
value
=
false
;
list
.
value
=
result
.
data
finished
.
value
=
true
list
.
value
.
map
(
item
=>
{
if
(
item
.
repairState
==
"1"
){
item
.
repairState
=
"已损坏"
}
if
(
item
.
repairState
==
"0"
){
item
.
repairState
=
"已维修"
}
if
(
item
.
disposeState
==
"1"
){
item
.
disposeState
=
"已处理"
}
if
(
item
.
disposeState
==
"0"
)
{
item
.
disposeState
=
"待处理"
}
})
}
else
{
Toast
(
"获取信息失败!"
);
finished
.
value
=
true
;
loading
.
value
=
false
;
return
;
}
}
//扫码获取
// const getCode = () => {
// let enCode = scanCodeFun(store.state.appid,4) //获取到的设备自编码
//测试
// router.push({
// path: "/schoolProperty/device/info",
// query: {
// encode:'100101202300003',
// name:'新增'
// }
// })
// }
//详情按钮
const
toDetail
=
(
item
)
=>
{
console
.
log
(
'item'
,
item
)
router
.
push
({
path
:
"/schoolProperty/equipmentFix/equipmentFixDetail"
,
query
:{
id
:
item
.
id
}
})
}
//返回上一页
const
goback
=
()
=>
{
router
.
back
();
};
//下拉刷新
const
onRefresh
=
()
=>
{
finished
.
value
=
false
;
loading
.
value
=
true
;
pullLoading
.
value
=
true
;
getList
()
};
</
script
>
<
style
scoped
>
.btnBlock
{
flex-wrap
:
wrap
;
}
.btn
{
width
:
75px
;
margin-top
:
10px
;
}
.state
{
position
:
absolute
;
top
:
0
;
right
:
0
;
}
.fixed
{
background
:
#07c160
;
color
:
#FFFFFF
;
border-radius
:
5px
10px
;
width
:
100px
;
text-align
:
center
;
}
.unable
{
background
:
gray
;
color
:
#FFFFFF
;
border-radius
:
5px
10px
;
width
:
100px
;
text-align
:
center
;
}
.search
{
width
:
98%
;
}
::v-deep
.van-search__action
{
background
:
#f7f8fa
;
margin-left
:
10px
;
}
</
style
>
src/views/teacher/schoolProperty/equipmentFixDetail.vue
0 → 100644
View file @
50341b1c
<
template
>
<van-nav-bar
title=
"报修单反馈"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<!--
<div
class=
"card"
>
-->
<!--
<div
class=
"title"
>
报修台账新增
</div>
-->
<van-form
class=
"formBlock"
label-align=
"right"
label-width=
"70px"
>
<van-cell-group
inset
>
<van-field
readonly
v-model=
"fixForm.encode"
name=
"自编码"
label=
"自编码"
placeholder=
"自编码"
:rules=
"[
{ required: true, message: '请填写自编码' }]"
/>
<van-field
readonly
v-model=
"fixForm.equipmentName"
name=
"设备名称"
label=
"设备名称"
placeholder=
"设备名称"
:rules=
"[
{ required: true, message: '请填写设备名称' }]"
/>
<van-field
readonly
v-model=
"fixForm.model"
name=
"型号"
label=
"型号"
placeholder=
"型号"
:rules=
"[
{ required: true, message: '请填写设备型号' }]"
/>
<van-field
readonly
v-model=
"fixForm.dateOfProduction"
name=
"投产日期"
label=
"投产日期"
placeholder=
"投产日期"
:rules=
"[
{ required: true, message: '请填写投产日期' }]"
/>
<van-field
readonly
v-model=
"fixForm.place"
name=
"地点"
label=
"地点"
placeholder=
"地点"
:rules=
"[
{ required: true, message: '请填写地点' }]"
/>
<van-field
v-model=
"fixForm.reportRepairTime"
readonly
name=
"calendar"
label=
"报修时间"
placeholder=
"请填写报修时间"
:rules=
"[
{ required: true, message: '请填写报修时间' }]"
/>
<van-field
readonly
v-model=
"fixForm.reportRepair"
name=
"报修人"
label=
"报修人"
placeholder=
"报修人"
:rules=
"[
{ required: true, message: '请填写报修人' }]"
/>
<van-field
v-model=
"fixForm.problem"
name=
"问题"
label=
"问题"
placeholder=
"问题"
:rules=
"[
{ required: true, message: '请填写问题' }]"
/>
<van-field
v-model=
"fixForm.repairName"
readonly
label=
"修理人"
/>
<van-field
v-model=
"fixForm.repairTime"
readonly
name=
"修理时间"
label=
"修理时间"
placeholder=
"修理时间"
:rules=
"[
{ required: true, message: '请填写修理时间' }]"
/>
<van-field
v-model=
"fixForm.repairStateName"
readonly
label=
"修理状态"
/>
<van-field
v-model=
"fixForm.disposeStateName"
readonly
label=
"报修人确认"
/>
<van-field
readonly
v-model=
"fixForm.remark"
name=
"备注"
label=
"备注"
placeholder=
"备注"
:rules=
"[
{ required: true, message: '请填写维修备注' }]"
/>
</van-cell-group>
<van-button
round
block
type=
"primary"
size=
"small"
style=
"width: 80px;margin:0 auto"
@
click=
"goback"
>
关 闭
</van-button>
</van-form>
<!--
</div>
-->
</
template
>
<
script
setup
>
import
{
getMaintenanceDetail
}
from
"@/service/schoolProperty"
import
{
formatDatetime
}
from
"@/utils/time.js"
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
ref
,
onMounted
,
reactive
}
from
"vue"
;
import
{
useStore
}
from
"vuex"
;
import
{
Toast
}
from
"vant"
;
const
router
=
useRouter
();
const
route
=
useRoute
();
const
store
=
useStore
();
const
queryEncode
=
route
.
query
.
encode
;
const
userName
=
store
.
state
.
userInfo
.
teacherName
const
userId
=
store
.
state
.
userInfo
.
userId
const
title
=
ref
(
""
);
const
name
=
route
.
query
.
name
;
const
id
=
route
.
query
.
id
;
const
encode
=
route
.
query
.
encode
;
const
fixForm
=
reactive
({
encode
:
''
,
//自编码
equipmentName
:
''
,
//设备名称
model
:
''
,
//型号
dateOfProduction
:
''
,
//投产日期
place
:
''
,
//地点
reportRepairTime
:
''
,
//报修时间
reportRepair
:
''
,
//报修人
problem
:
''
,
//问题
repairName
:
''
,
//修理人
repairId
:
''
,
//修理人id
repairPhone
:
''
,
//修理人电话
repairTime
:
''
,
//修理时间
repairState
:
''
,
//维修结果
repairStateName
:
''
,
//维修结果文本
disposeState
:
''
,
//报修人确认
disposeStateName
:
''
,
//报修人确认文本
remark
:
''
,
//备注
})
const
evaluate
=
ref
();
const
showState
=
ref
(
false
);
//维修结果
const
repairState
=
(
value
)
=>
{
console
.
log
(
'value'
,
value
)
fixForm
.
repairStateName
=
value
.
text
;
fixForm
.
repairState
=
value
.
id
;
showState
.
value
=
false
;
};
const
showPicker
=
ref
(
false
);
const
columns
=
ref
([]);
onMounted
(
async
()
=>
{
let
repairResult
=
await
getMaintenanceDetail
(
id
)
if
(
repairResult
.
code
==
200
){
console
.
log
(
'repairResult'
,
repairResult
)
Object
.
assign
(
fixForm
,
repairResult
.
data
)
if
(
repairResult
.
repairState
==
'0'
){
fixForm
.
repairStateName
=
'已维修'
}
else
{
fixForm
.
repairStateName
=
'已损坏'
}
if
(
repairResult
.
disposeState
==
'0'
){
fixForm
.
disposeStateName
=
'待处理'
}
else
{
fixForm
.
disposeStateName
=
'已处理'
}
}
});
//返回上一页
const
goback
=
()
=>
{
router
.
back
();
};
</
script
>
<
style
scoped
>
.card
{
margin
:
10px
;
border
:
1px
solid
silver
;
border-radius
:
5px
;
}
.title
{
margin-top
:
10px
;
font-size
:
16px
;
margin-left
:
10px
;
}
.title
:before
{
content
:
''
;
height
:
3px
;
width
:
5px
;
border
:
3px
solid
#1989fa
;
border-radius
:
5px
;
margin-right
:
5px
;
}
</
style
>
src/views/teacher/schoolProperty/equipmentInfo.vue
0 → 100644
View file @
50341b1c
<
template
>
<van-nav-bar
title=
"设备信息"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<van-form
class=
"formBlock"
label-align=
"right"
label-width=
"90px"
>
<van-cell-group
inset
>
<van-field
readonly
v-model=
"equipmentForm.encode"
label=
"自编码"
/>
<van-field
readonly
v-model=
"equipmentForm.equipmentName"
label=
"设备名称"
/>
<van-field
readonly
v-model=
"equipmentForm.model"
label=
"型号"
/>
<van-field
readonly
v-model=
"equipmentForm.specification"
label=
"规格"
/>
<van-field
readonly
v-model=
"equipmentForm.classificationCode"
label=
"分类编码"
/>
<van-field
readonly
v-model=
"equipmentForm.unit"
label=
"单位"
/>
<van-field
readonly
v-model=
"affiliationType"
label=
"归属类型"
/>
<van-field
readonly
v-model=
"equipmentState"
label=
"设备状态"
/>
<van-field
readonly
v-model=
"isAllowLend"
label=
"是否允许借出"
/>
<van-field
readonly
v-model=
"isLend"
label=
"是否借出"
/>
<van-field
readonly
v-model=
"equipmentForm.dateOfProduction"
label=
"投产日期"
/>
<van-field
readonly
v-model=
"equipmentForm.price"
label=
"价格(元)"
/>
<van-field
readonly
v-model=
"equipmentForm.lifeOfUtility"
label=
"效用年限(年)"
/>
<van-field
readonly
v-model=
"equipmentForm.model"
label=
"地点"
/>
<van-field
readonly
v-model=
"equipmentForm.useName"
label=
"使用人"
/>
<van-field
readonly
v-model=
"equipmentForm.remark"
label=
"备注"
/>
</van-cell-group>
<van-button
round
block
type=
"primary"
size=
"small"
style=
"width: 80px;margin:0 auto"
@
click=
"goback"
>
关 闭
</van-button>
</van-form>
</
template
>
<
script
setup
>
import
{
reactive
,
ref
,
onMounted
}
from
"vue"
;
import
{
scanEquipmentInfo
}
from
"@/service/schoolProperty"
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
Dialog
,
Toast
}
from
"vant"
;
import
{
useStore
}
from
"vuex"
;
const
equipmentForm
=
reactive
({
encode
:
''
,
equipmentName
:
''
,
model
:
''
,
specification
:
''
,
classificationCode
:
''
,
unit
:
''
,
dateOfProduction
:
''
,
price
:
''
,
lifeOfUtility
:
''
,
place
:
''
,
useName
:
''
,
remark
:
''
})
const
affiliationType
=
ref
(
''
)
const
equipmentState
=
ref
(
''
)
const
isAllowLend
=
ref
(
''
)
const
isLend
=
ref
(
''
)
const
router
=
useRouter
();
const
route
=
useRoute
();
const
store
=
useStore
();
const
queryEncode
=
route
.
query
.
encode
onMounted
(
async
()
=>
{
let
result
=
await
scanEquipmentInfo
(
queryEncode
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
Object
.
assign
(
equipmentForm
,
result
.
data
)
if
(
result
.
data
.
affiliationType
==
'1'
){
affiliationType
.
value
=
'公共区域'
}
else
if
(
result
.
data
.
affiliationType
==
'2'
){
affiliationType
.
value
=
'信息中心'
}
else
{
affiliationType
.
value
=
'个人'
}
if
(
result
.
data
.
equipmentState
==
'1'
){
equipmentState
.
value
=
'完好'
}
else
if
(
result
.
data
.
equipmentState
==
'2'
){
equipmentState
.
value
=
'损坏'
}
else
{
equipmentState
.
value
=
'报废'
}
if
(
result
.
data
.
isAllowLend
==
'1'
){
isAllowLend
.
value
=
'是'
}
else
{
isAllowLend
.
value
=
'否'
}
if
(
result
.
data
.
isLend
==
'1'
){
isLend
.
value
=
'是'
}
else
{
isLend
.
value
=
'否'
}
}
})
//返回上一页
const
goback
=
()
=>
{
router
.
back
();
};
</
script
>
<
style
scoped
>
</
style
>
src/views/teacher/schoolProperty/index.vue
View file @
50341b1c
<
template
>
<van-nav-bar
title=
"校产管理"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<div
class=
"borrowBlock"
@
click=
"toPage(3)"
>
<van-image
class=
"leftImg"
:src=
"require('../../../assets/icon/wallet.png')"
/>
<div>
物品借用
</div>
</div>
<div
class=
"returnBlock"
@
click=
"toPage(0)"
>
<van-image
class=
"leftImg"
:src=
"require('../../../assets/icon/return.png')"
/>
<div>
物品归还
</div>
</div>
<div
class=
"useBlock"
@
click=
"toPage(1)"
>
<van-image
class=
"leftImg"
:src=
"require('../../../assets/icon/use.png')"
/>
<div>
物品领用
</div>
</div>
<div
class=
"deviceBlock"
@
click=
"toPage(2)"
>
<van-image
class=
"leftImg"
:src=
"require('../../../assets/icon/device.png')"
/>
<div>
设备报修
</div>
<van-nav-bar
title=
"校产管理"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
>
<template
#
right
>
<van-icon
name=
"scan"
size=
"18"
@
click=
"getCode"
/>
</
template
>
</van-nav-bar>
<!-- <!– 维修人员只能看维修–>-->
<!-- <div v-if="roleRepair" >-->
<!-- <div class="deviceBlock" @click="toPage(2)">-->
<!-- <!– <div class="deviceBlock" @click="toPage(2)">–>-->
<!-- <van-image class="leftImg" :src="require('../../../assets/icon/device.png')"/>-->
<!-- <div>设备报修</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div v-else>-->
<div
class=
"borrowBlock"
@
click=
"toPage(3)"
>
<van-image
class=
"leftImg"
:src=
"require('../../../assets/icon/wallet.png')"
/>
<div>
物品借用
</div>
</div>
<div
v-if=
"roleAdmin"
class=
"returnBlock"
@
click=
"toPage(0)"
>
<!-- <div class="returnBlock" @click="toPage(0)">-->
<van-image
class=
"leftImg"
:src=
"require('../../../assets/icon/return.png')"
/>
<div>
物品归还
</div>
</div>
<div
class=
"useBlock"
@
click=
"toPage(1)"
>
<van-image
class=
"leftImg"
:src=
"require('../../../assets/icon/use.png')"
/>
<div>
物品领用
</div>
</div>
<div
class=
"deviceBlock"
@
click=
"toPage(2)"
>
<!-- <div class="deviceBlock" @click="toPage(2)">-->
<van-image
class=
"leftImg"
:src=
"require('../../../assets/icon/device.png')"
/>
<div>
设备报修
</div>
</div>
<div
v-if=
"roleRepair"
class=
"fixBlock"
@
click=
"toPage(4)"
>
<!-- <div class="deviceBlock" @click="toPage(2)">-->
<van-image
class=
"leftImg"
:src=
"require('../../../assets/icon/fix.png')"
/>
<div>
设备维修
</div>
</div>
<!-- </div>-->
</template>
<
script
setup
>
import
{
useRouter
}
from
"vue-router"
;
import
{
scanCodeFun
}
from
"../../../utils/scanCode"
;
import
{
useStore
}
from
"vuex"
;
import
{
onMounted
,
ref
}
from
"vue"
;
const
store
=
useStore
();
const
router
=
useRouter
();
console
.
log
(
'store'
,
store
.
state
.
userInfo
.
roles
)
const
rolesArr
=
store
.
state
.
userInfo
.
roles
const
roleAdmin
=
ref
()
const
roleRepair
=
ref
()
onMounted
(
()
=>
{
rolesArr
.
find
(
item
=>
{
if
(
item
==
"productCategoryAdmin"
){
return
roleAdmin
.
value
=
true
}
else
{
roleAdmin
.
value
=
false
}
})
// if(rolesArr.l)
rolesArr
.
find
(
item
=>
{
if
(
item
==
"maintain"
){
return
roleRepair
.
value
=
true
}
else
{
roleRepair
.
value
=
false
}
})
console
.
log
(
'roleAdmin.value'
,
roleAdmin
.
value
)
console
.
log
(
'roleRepair.value'
,
roleRepair
.
value
)
})
//扫码获取
const
getCode
=
()
=>
{
scanCodeFun
(
store
.
state
.
appid
,
0
)
//获取到的设备自编码
// let enCode = scanCodeFun(store.state.appid,0) //获取到的设备自编码
//测试
// router.push({
// path: "/schoolProperty/equipmentInfo",
// query: {
// encode:'100101202300003'
// }
// })
}
const
toPage
=
(
type
)
=>
{
if
(
type
==
0
){
// 归还管理
...
...
@@ -38,11 +103,16 @@ const toPage = (type) => {
router
.
push
({
path
:
"/schoolProperty/device"
,
});
}
else
{
}
else
if
(
type
==
3
)
{
// 物品借用
router
.
push
({
path
:
"/schoolProperty/borrow"
,
});
}
else
{
//设备维修
router
.
push
({
path
:
"/schoolProperty/equipmentFix"
,
});
}
}
...
...
@@ -53,7 +123,7 @@ const goback = () => {
</
script
>
<
style
scoped
>
.returnBlock
,
.deviceBlock
,
.useBlock
,
.borrowBlock
{
.returnBlock
,
.deviceBlock
,
.useBlock
,
.borrowBlock
,
.fixBlock
{
padding
:
20px
30px
;
border-radius
:
12px
;
color
:
#FFFFFF
;
...
...
@@ -76,6 +146,9 @@ const goback = () => {
.useBlock
{
background
:
linear-gradient
(
to
right
,
#FDAE86
,
#EA4A6B
);
}
.fixBlock
{
background
:
linear-gradient
(
to
right
,
#EA4A6B
,
#b971c1
);
}
.leftImg
{
width
:
56px
;
height
:
56px
;
...
...
src/views/teacher/schoolProperty/returnDetail.vue
0 → 100644
View file @
50341b1c
<
template
>
<van-nav-bar
:title=
title
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<van-form
@
submit=
"onSubmit"
class=
"formBlock"
label-align=
"right"
label-width=
"110px"
>
<van-cell-group
inset
>
<van-field
readonly
v-model=
"returnForm.model"
label=
"型号"
placeholder=
"请输入型号"
/>
<van-field
readonly
v-model=
"returnForm.encode"
label=
"自编码"
placeholder=
"请输入自编码"
/>
<van-field
readonly
v-model=
"returnForm.borrowBy"
label=
"借用人"
placeholder=
"请输入借用人"
/>
<van-field
readonly
v-model=
"returnForm.receivedBy"
label=
"接收人"
placeholder=
"请输入接收人"
/>
<!--
<div
v-if=
"queryId"
>
-->
<van-field
readonly
v-model=
"returnForm.borrowTime"
label=
"借用日期"
/>
<!--
</div>
-->
<!--
<div
v-else
>
-->
<!--
<van-field
is-link
readonly
v-model=
"borrowTime"
label=
"借用日期"
@
click=
"showPicker = true"
--
>
<!-- placeholder="请选择借用日期"/>-->
<!--
<van-calendar
:readonly=
"queryId ? true : false"
v-model:show=
"showPicker"
@
confirm=
"onConfirmBorrowTime"
/>
-->
<!--
</div>
-->
<!--
<div
v-if=
"queryId"
>
-->
<van-field
readonly
v-model=
"returnForm.returnTime"
label=
"归还日期"
/>
<!--
</div>
-->
<van-field
readonly
v-model=
"returnForm.deadline"
label=
"借用期限"
placeholder=
"请输入借用期限"
/>
<van-field
:readonly=
"queryId ? true : false"
v-model=
"returnForm.returnEquipmentCondition"
label=
"归还时设备情况"
/>
<van-field
:readonly=
"queryId ? true : false"
v-model=
"returnForm.remark"
label=
"备注"
placeholder=
"请输入备注"
/>
</van-cell-group>
<div
v-if=
"queryId"
style=
"margin: 30px; display: flex;justify-content: center"
>
<van-button
round
type=
"primary"
size=
"small"
style=
"width: 80px;margin-left: 20px;"
@
click=
"goback"
>
关 闭
</van-button>
</div>
<div
v-else
style=
"margin: 30px; display: flex;justify-content: center"
>
<van-button
round
size=
"small"
style=
"width: 80px;"
type=
"primary"
native-type=
"submit"
>
确 定
</van-button>
<van-button
round
type=
"success"
size=
"small"
style=
"width: 80px;margin-left: 20px;"
@
click=
"goback"
>
取 消
</van-button>
</div>
</van-form>
</
template
>
<
script
setup
>
import
moment
from
'moment'
;
import
{
returnEquipment
,
getEquipmentDetail
}
from
"@/service/schoolProperty"
import
{
reactive
,
ref
,
onMounted
}
from
"vue"
;
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
Dialog
,
Toast
}
from
"vant"
;
import
{
useStore
}
from
"vuex"
;
import
{
formatDatetime
}
from
"@/utils/time.js"
const
router
=
useRouter
();
const
route
=
useRoute
();
const
queryId
=
route
.
query
.
id
;
const
queryEncode
=
route
.
query
.
encode
;
console
.
log
(
'queryEncode'
,
queryEncode
)
const
store
=
useStore
()
const
userName
=
store
.
state
.
userInfo
.
teacherName
const
userId
=
store
.
state
.
userInfo
.
userId
let
title
=
ref
(
''
)
// 页面标题
let
returnForm
=
reactive
({
// 表单数据
encode
:
''
,
//自编码
equipmentName
:
''
,
//设备名称
model
:
''
,
//型号
borrowTime
:
''
,
// 借用日期
borrowBy
:
''
,
//借用人
purpose
:
''
,
//用途
deadline
:
''
,
//借用期限(天)
returnTime
:
''
,
//归还日期
returnEquipmentCondition
:
''
,
//归还时设备情况
receivedBy
:
''
})
onMounted
(
async
()
=>
{
if
(
queryId
)
{
let
result
=
await
getEquipmentDetail
(
queryEncode
)
console
.
log
(
'result'
,
result
)
title
.
value
=
'归还情况查看'
Object
.
assign
(
returnForm
,
result
.
data
)
returnForm
.
borrowTime
=
result
.
data
.
borrowTime
returnForm
.
returnTime
=
result
.
data
.
returnTime
returnForm
.
deadline
=
returnForm
.
returnTime
-
returnForm
.
borrowTime
}
else
{
title
.
value
=
'物品归还'
let
equipmentRes
=
await
getEquipmentDetail
(
queryEncode
)
console
.
log
(
'equipmentRes'
,
equipmentRes
.
data
)
console
.
log
(
'returnForm'
,
returnForm
)
Object
.
assign
(
returnForm
,
equipmentRes
.
data
)
returnForm
.
receivedBy
=
userName
returnForm
.
returnTime
=
formatDatetime
(
new
Date
())
// const date1 = moment(returnForm.returnTime).format('YYYY/MM/DD HH:mm:ss')
const
newDay
=
moment
(
returnForm
.
returnTime
).
diff
(
moment
(
returnForm
.
borrowTime
),
'days'
)
if
(
newDay
==
0
){
const
minute
=
moment
(
returnForm
.
returnTime
).
diff
(
moment
(
returnForm
.
borrowTime
),
'minute'
)
returnForm
.
deadline
=
Math
.
floor
(
minute
/
60
)
+
'小时'
}
else
{
returnForm
.
deadline
=
moment
(
returnForm
.
returnTime
).
diff
(
moment
(
returnForm
.
borrowTime
),
'days'
)
+
'天'
}
if
(
equipmentRes
.
data
.
isLend
==
'0'
){
//未借出 只会返回设备那3个基本信息
Dialog
.
alert
({
title
:
'提示'
,
message
:
'该设备未借出,无需归还'
,
}).
then
(()
=>
{
router
.
back
();
});
}
}
});
//借用日期确认
const
onConfirmBorrowTime
=
(
date
)
=>
{
borrowTime
.
value
=
`
${
date
.
getFullYear
()}
-
${
date
.
getMonth
()
+
1
}
-
${
date
.
getDate
()}
`
// returnTime.value = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
showPicker
.
value
=
false
;
console
.
log
(
'date'
,
date
)
console
.
log
(
'borrowTime.value'
,
borrowTime
.
value
)
};
//返回上一页
const
goback
=
()
=>
{
router
.
back
();
};
//表单提交
const
onSubmit
=
async
()
=>
{
console
.
log
(
'submit returnForm'
,
returnForm
)
const
params
=
{
id
:
returnForm
.
id
,
returnTime
:
returnForm
.
returnTime
,
returnEquipmentCondition
:
returnForm
.
returnEquipmentCondition
,
remark
:
returnForm
.
remark
,
receivedById
:
userId
,
receivedBy
:
userName
,
equipmentId
:
returnForm
.
equipmentId
}
console
.
log
(
'params'
,
params
)
let
result
=
await
returnEquipment
(
params
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
router
.
back
();
Toast
(
"归还成功"
);
}
}
</
script
>
<
style
scoped
>
.sureBtn
{
margin
:
30px
auto
;
width
:
80%
;
}
.van-cell-group--inset
{
margin
:
0px
;
}
</
style
>
src/views/teacher/schoolProperty/returnList.vue
View file @
50341b1c
...
...
@@ -2,29 +2,29 @@
<van-nav-bar
title=
"归还管理"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<div
class=
"flexBLock searchBlock"
>
<van-search
class=
"searchInput"
v-model=
"searchKey"
placeholder=
"请输入搜索关键词"
/>
<van-icon
name=
"scan"
/>
<van-icon
name=
"scan"
@
click=
"getCode"
/>
</div>
<van-pull-refresh
v-model=
"pullLoading"
@
refresh=
"onRefresh"
>
<van-list
v-model:loading=
"loading"
:finished=
"finished"
finished-text=
"没有更多了"
@
load=
"getList"
>
<div
v-for=
"(item,index) in list"
:key=
"index"
class=
"listBlock"
>
<div
class=
"flexBLock"
>
<div
v-for=
"(item,index) in list"
:key=
"index"
class=
"listBlock"
@
click=
"toDetailPage(item.id,item.encode)"
>
<div
class=
"flexBLock"
>
<div>
<div>
型号:
联想Y0079
</div>
<div>
自编码:
202308081101
</div>
<div>
借用人:
张蔷
</div>
<div>
借用日期:
2023-08-08 12:32:30
</div>
<div>
接收人:
张蔷
</div>
<div>
归还日期:
2023-08-08 12:32:30
</div>
<div>
归还时设备情况:
良好
</div>
<div>
型号:
{{
item
.
model
}}
</div>
<div>
自编码:
{{
item
.
encode
}}
</div>
<div>
借用人:
{{
item
.
borrowBy
}}
</div>
<div>
借用日期:
{{
item
.
borrowTime
}}
</div>
<div>
接收人:
{{
item
.
receivedBy
}}
</div>
<div>
归还日期:
{{
item
.
returnTime
}}
</div>
<div>
归还时设备情况:
{{
item
.
returnEquipmentCondition
}}
</div>
</div>
<div
class=
"listLeft"
>
<div>
7
</div>
<div>
{{
item
.
deadline
}}
</div>
<div>
借用期限(天)
</div>
</div>
</div>
<div>
备注:已借用取回,暂不外借,设备换修。已借用取回,暂不外借,设备换修。
</div>
<div
class=
"waitReturn"
>
待归还
</div>
<div
class=
"endReturn"
>
已归还
</div>
<div
v-if=
"item.returnState == 0"
class=
"waitReturn"
>
待归还
</div>
<div
v-if=
"item.returnState == 1"
class=
"endReturn"
>
已归还
</div>
</div>
</van-list>
</van-pull-refresh>
...
...
@@ -34,29 +34,78 @@
import
{
getEquipmentList
}
from
"@/service/schoolProperty"
import
{
useRouter
}
from
"vue-router"
;
import
{
ref
}
from
"vue"
;
import
{
onMounted
,
ref
,
reactive
}
from
"vue"
;
import
{
useStore
}
from
"vuex"
;
import
{
Toast
}
from
"vant"
;
import
{
scanCodeFun
}
from
"../../../utils/scanCode"
;
const
router
=
useRouter
();
const
store
=
useStore
();
const
id
=
store
.
state
.
userInfo
.
userId
;
let
searchKey
=
ref
(
''
)
const
loading
=
ref
(
false
)
const
list
=
ref
([
1
,
2
,
3
,
4
,
5
]);
const
list
=
ref
([]);
const
pullLoading
=
ref
(
false
);
const
finished
=
ref
(
false
);
const
pageNum
=
ref
(
0
);
onMounted
(
async
()
=>
{
})
//获取列表数据
const
getList
=
async
()
=>
{
if
(
pullLoading
.
value
)
{
list
.
value
=
[];
pageNum
.
value
=
0
;
pullLoading
.
value
=
false
;
}
let
result
=
await
getEquipmentList
(
id
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
loading
.
value
=
false
;
list
.
value
=
result
.
data
;
finished
.
value
=
true
}
else
{
Toast
(
"获取信息失败!"
);
finished
.
value
=
true
;
loading
.
value
=
false
;
return
;
}
}
//扫码获取
const
getCode
=
()
=>
{
scanCodeFun
(
store
.
state
.
appid
,
2
)
//获取到的设备自编码
// let enCode = scanCodeFun(store.state.appid,2) //获取到的设备自编码
// console.log(1)
//测试
// router.push({
// path: "/schoolProperty/return/detail",
// query: {
// encode:'100101202300003'
// }
// })
}
//返回上一页
const
goback
=
()
=>
{
router
.
back
();
};
//跳转详情页面
const
toDetailPage
=
(
id
,
encode
)
=>
{
console
.
log
(
'id'
,
id
)
console
.
log
(
'encode'
,
encode
)
router
.
push
({
path
:
"/schoolProperty/return/detail"
,
query
:
{
id
:
id
,
encode
:
encode
}
})
}
//下拉刷新
const
onRefresh
=
()
=>
{
finished
.
value
=
false
;
loading
.
value
=
true
;
pullLoading
.
value
=
true
;
getList
()
};
</
script
>
...
...
src/views/teacher/schoolProperty/useAdd.vue
View file @
50341b1c
...
...
@@ -2,34 +2,71 @@
<van-nav-bar
title=
"新增物品领用"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<van-form
@
submit=
"onSubmit"
class=
"formBlock"
label-align=
"right"
label-width=
"80px"
>
<van-cell-group
inset
>
<van-field
v-model=
"code"
label=
"自编码"
placeholder=
"请输入自编码"
/>
<van-field
v-model=
"code"
label=
"设备名称"
placeholder=
"请输入设备名称"
/>
<van-field
v-model=
"code"
label=
"型号"
placeholder=
"请输入型号"
/>
<van-field
is-link
readonly
v-model=
"dateChoose"
label=
"领用日期"
@
click=
"showPicker = true"
placeholder=
"请选择领用日期"
/>
<van-calendar
v-model:show=
"showPicker"
@
confirm=
"onConfirm"
/>
<van-field
v-model=
"code"
label=
"领用人"
placeholder=
"请输入领用人"
/>
<van-field
readonly
v-model=
"useForm.encode"
label=
"自编码"
placeholder=
"请输入自编码"
/>
<van-field
readonly
v-model=
"useForm.equipmentName"
label=
"设备名称"
placeholder=
"请输入设备名称"
/>
<van-field
readonly
v-model=
"useForm.model"
label=
"型号"
placeholder=
"请输入型号"
/>
<van-field
readonly
v-model=
"useForm.recipientTime"
label=
"领用日期"
placeholder=
"请输入领用日期"
/>
<van-field
readonly
v-model=
"useForm.recipientBy"
label=
"领用人"
placeholder=
"请输入领用人"
/>
</van-cell-group>
<div>
<van-button
class=
"sureBtn"
round
block
type=
"primary"
native-type=
"submit"
>
确 定
</van-button>
<div
style=
"display:flex;justify-content: center;margin: 30px"
>
<van-button
round
type=
"primary"
size=
"small"
style=
"width: 80px;"
native-type=
"submit"
>
确 定
</van-button>
<van-button
round
type=
"success"
size=
"small"
style=
"width: 80px;margin-left: 20px;"
@
click=
"goback"
>
取 消
</van-button>
</div>
</van-form>
</
template
>
<
script
setup
>
import
{
addUse
,
useDeatil
}
from
"@/service/schoolProperty"
import
{
useRouter
}
from
"vue-router"
;
import
{
ref
}
from
"vue"
;
import
{
addUse
,
useDeatil
,
scanEquipmentInfo
}
from
"@/service/schoolProperty"
import
{
formatDatetime
}
from
"@/utils/time.js"
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
onMounted
,
reactive
,
ref
}
from
"vue"
;
import
{
useStore
}
from
"vuex"
;
import
{
Dialog
,
Toast
}
from
"vant"
;
const
router
=
useRouter
();
const
code
=
ref
(
''
)
const
route
=
useRoute
();
const
store
=
useStore
()
const
queryEncode
=
route
.
query
.
encode
;
const
userId
=
store
.
state
.
userInfo
.
userId
;
const
userName
=
store
.
state
.
userInfo
.
teacherName
;
console
.
log
(
'store'
,
store
)
const
useForm
=
reactive
({
encode
:
''
,
equipmentName
:
''
,
model
:
''
,
recipientTime
:
''
,
recipientBy
:
''
})
const
dateChoose
=
ref
(
''
)
let
showPicker
=
ref
(
false
)
//是否显示日历选择
const
onConfirm
=
(
date
)
=>
{
dateChoose
.
value
=
`
${
date
.
getFullYear
()}
-
${
date
.
getMonth
()
+
1
}
-
${
date
.
getDate
()}
`
showPicker
.
value
=
false
;
};
onMounted
(
async
()
=>
{
let
equipmentRes
=
await
scanEquipmentInfo
(
queryEncode
)
console
.
log
(
'equipmentRes'
,
equipmentRes
)
if
(
equipmentRes
.
code
==
200
){
Object
.
assign
(
useForm
,
equipmentRes
.
data
)
useForm
.
recipientTime
=
formatDatetime
(
new
Date
())
useForm
.
recipientBy
=
userName
console
.
log
(
'useForm'
,
useForm
)
if
(
equipmentRes
.
data
.
affiliationType
!=
2
)
{
Dialog
.
alert
({
title
:
'提示'
,
message
:
'该设备不属于信息中心,不可领用'
,
}).
then
(()
=>
{
router
.
back
();
});
}
if
(
equipmentRes
.
data
.
isLend
==
1
){
Dialog
.
alert
({
title
:
'提示'
,
message
:
'该设备已借出,不可领用'
,
}).
then
(()
=>
{
router
.
back
();
});
}
}
})
//返回上一页
const
goback
=
()
=>
{
...
...
@@ -37,8 +74,24 @@ const goback = () => {
};
//表单提交
const
onSubmit
=
()
=>
{
}
const
onSubmit
=
async
()
=>
{
const
params
=
{
equipmentId
:
useForm
.
id
,
recipientTime
:
useForm
.
recipientTime
,
recipientById
:
userId
,
recipientBy
:
useForm
.
recipientBy
}
let
result
=
await
addUse
(
params
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
)
{
router
.
back
();
Toast
(
"领用成功"
);
}
};
</
script
>
<
style
scoped
>
...
...
src/views/teacher/schoolProperty/useList.vue
View file @
50341b1c
<
template
>
<van-nav-bar
title=
"物品领用"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<div
class=
"flexBLock searchBlock"
>
<van-search
class=
"searchInput"
v-model=
"searchKey"
placeholder=
"请输入搜索关键词"
/>
<van-icon
@
click=
"
sacnClick
"
name=
"scan"
/>
<van-search
class=
"searchInput"
@
search=
"onSearch"
v-model=
"searchKey"
placeholder=
"请输入搜索关键词"
/>
<van-icon
@
click=
"
getCode
"
name=
"scan"
/>
</div>
<van-pull-refresh
v-model=
"pullLoading"
@
refresh=
"onRefresh"
>
<van-list
v-model:loading=
"loading"
:finished=
"finished"
finished-text=
"没有更多了"
@
load=
"getList"
>
...
...
@@ -30,32 +30,65 @@ import { getUseList } from "@/service/schoolProperty"
import
{
useRouter
}
from
"vue-router"
;
import
{
ref
}
from
"vue"
;
import
{
useStore
}
from
"vuex"
;
import
{
Toast
}
from
"vant"
;
import
{
scanCodeFun
}
from
"../../../utils/scanCode"
;
const
router
=
useRouter
();
const
store
=
useStore
();
const
id
=
store
.
state
.
userInfo
.
userId
;
console
.
log
(
'store'
,
store
.
state
.
userInfo
.
userId
)
let
searchKey
=
ref
(
''
)
const
loading
=
ref
(
false
)
const
list
=
ref
([]);
const
pullLoading
=
ref
(
false
);
const
finished
=
ref
(
false
);
const
pageNum
=
ref
(
0
);
const
equipmentName
=
ref
(
''
)
//获取列表数据
const
getList
=
async
()
=>
{
let
result
=
await
getUseList
(
id
);
if
(
pullLoading
.
value
)
{
list
.
value
=
[];
pageNum
.
value
=
0
;
pullLoading
.
value
=
false
;
}
let
result
=
await
getUseList
(
id
,
equipmentName
.
value
);
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
loading
.
value
=
false
;
list
.
value
=
result
.
data
finished
.
value
=
true
}
else
{
Toast
(
"获取信息失败!"
);
finished
.
value
=
true
;
loading
.
value
=
false
;
return
;
}
}
const
onSearch
=
async
(
val
)
=>
{
list
.
value
=
[];
loading
.
value
=
true
;
equipmentName
.
value
=
val
let
searchResult
=
await
getUseList
(
id
,
equipmentName
.
value
);
console
.
log
(
'searchResult'
,
searchResult
)
if
(
searchResult
.
code
==
200
){
loading
.
value
=
false
;
list
.
value
=
searchResult
.
data
finished
.
value
=
true
}
}
//扫码获取
const
getCode
=
()
=>
{
scanCodeFun
(
store
.
state
.
appid
,
3
)
//获取到的设备自编码
//扫码
const
sacnClick
=
()
=>
{
router
.
push
({
path
:
"/schoolProperty/use/add"
,
})
// let enCode = scanCodeFun(store.state.appid,3) //获取到的设备自编码
// console.log(1)
//测试
// router.push({
// path: "/schoolProperty/use/add",
// query: {
// encode:'100101202300003'
// }
// })
}
//返回上一页
...
...
@@ -65,7 +98,10 @@ const goback = () => {
//下拉刷新
const
onRefresh
=
()
=>
{
finished
.
value
=
false
;
loading
.
value
=
true
;
pullLoading
.
value
=
true
;
getList
()
};
</
script
>
...
...
vue.config.js
View file @
50341b1c
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment