Commit 0d6babba by peijy

10.26 修改测试问题

parent dcd826fd
# NODE_ENV='development' # NODE_ENV='development'
# VUE_APP_MODE='development' # VUE_APP_MODE='development'
# VUE_APP_API_URL='/school' # VUE_APP_API_URL='/abc'
\ No newline at end of file
...@@ -25,7 +25,7 @@ See [Configuration Reference](https://cli.vuejs.org/config/). ...@@ -25,7 +25,7 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
//打包更改地方 //打包更改地方
1.appId 1.vue.config.js改成打包地址
2.登录页图片 开发测试时路径访问/login正常登录测试
3.axios.js中改成 axios.defaults.baseURL = "/school"; 测试钉钉免登陆是路径访问/dd或者/进行测试
4.vue.config.js 2.退出登录不需要了
...@@ -23,6 +23,7 @@ declare module '@vue/runtime-core' { ...@@ -23,6 +23,7 @@ declare module '@vue/runtime-core' {
VanCollapseItem: typeof import('vant/es')['CollapseItem'] VanCollapseItem: typeof import('vant/es')['CollapseItem']
VanConfigProvider: typeof import('vant/es')['ConfigProvider'] VanConfigProvider: typeof import('vant/es')['ConfigProvider']
VanDatetimePicker: typeof import('vant/es')['DatetimePicker'] VanDatetimePicker: typeof import('vant/es')['DatetimePicker']
VanDialog: typeof import('vant/es')['Dialog']
VanDropdownItem: typeof import('vant/es')['DropdownItem'] VanDropdownItem: typeof import('vant/es')['DropdownItem']
VanDropdownMenu: typeof import('vant/es')['DropdownMenu'] VanDropdownMenu: typeof import('vant/es')['DropdownMenu']
VanEmpty: typeof import('vant/es')['Empty'] VanEmpty: typeof import('vant/es')['Empty']
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
"axios": "^0.21.1", "axios": "^0.21.1",
"compression-webpack-plugin": "^6.1.1", "compression-webpack-plugin": "^6.1.1",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"dingtalk-jsapi": "^3.0.28",
"fs": "^0.0.1-security", "fs": "^0.0.1-security",
"js-cookie": "^3.0.1", "js-cookie": "^3.0.1",
"moment": "^2.29.4", "moment": "^2.29.4",
......
...@@ -37,19 +37,6 @@ const onConfirm = (value) => { ...@@ -37,19 +37,6 @@ const onConfirm = (value) => {
schoolYearResult.value = value[0] + '-' + value[1] ; schoolYearResult.value = value[0] + '-' + value[1] ;
showPicker.value = false; showPicker.value = false;
}; };
// const columns = [
// // 第一列
// {
// values: ['周一', '周二', '周三', '周四', '周五'],
// defaultIndex: 0,
// },
// // 第二列
// {
// values: ['上学期', '下学期'],
// defaultIndex: 0,
// },
// ];
const columns = ref([]); const columns = ref([]);
onMounted(async () => { onMounted(async () => {
const data = { const data = {
...@@ -60,7 +47,7 @@ onMounted(async () => { ...@@ -60,7 +47,7 @@ onMounted(async () => {
console.log('schoolYear',schoolYear); console.log('schoolYear',schoolYear);
if(schoolYear.code == 200){ if(schoolYear.code == 200){
const schoolYearColumns =schoolYear.data.map(item => { const schoolYearColumns =schoolYear.data.map(item => {
return item.schoolYear return item.gradeYear
}) })
console.log('schoolYearColumns',schoolYearColumns) console.log('schoolYearColumns',schoolYearColumns)
columns.value = [{values:schoolYearColumns},{values: ['上学期', '下学期'],}] columns.value = [{values:schoolYearColumns},{values: ['上学期', '下学期'],}]
......
...@@ -63,9 +63,10 @@ const icon = { ...@@ -63,9 +63,10 @@ const icon = {
inactive: "https://fastly.jsdelivr.net/npm/@vant/assets/user-inactive.png", inactive: "https://fastly.jsdelivr.net/npm/@vant/assets/user-inactive.png",
}; };
onMounted(async () => { onMounted(async () => {
console.log('getTotyp()',getTotyp())
if (getTotyp() != 1) { if (getTotyp() != 1) {
userType.value = false; userType.value = false;
} }
}); });
......
...@@ -16,6 +16,7 @@ import store from "./store"; ...@@ -16,6 +16,7 @@ import store from "./store";
import { Form, Field, Uploader,DatetimePicker,Calendar } from "vant"; import { Form, Field, Uploader,DatetimePicker,Calendar } from "vant";
// import { Picker } from "vant"; // import { Picker } from "vant";
import { Popup } from "vant"; import { Popup } from "vant";
import { Dialog } from 'vant'
// import { Toast } from "vant"; // import { Toast } from "vant";
// import { Empty } from "vant"; // import { Empty } from "vant";
// import { Dialog } from "vant"; // import { Dialog } from "vant";
...@@ -81,6 +82,7 @@ app ...@@ -81,6 +82,7 @@ app
// .use(ContactCard) // .use(ContactCard)
// .use(Calendar) // .use(Calendar)
// .use(Divider) // .use(Divider)
.use(Dialog)
.use(Calendar) .use(Calendar)
.use(VueHashCalendar) .use(VueHashCalendar)
.use(Uploader).use(DatetimePicker); .use(Uploader).use(DatetimePicker);
......
...@@ -3,28 +3,56 @@ import {Toast} from "vant"; ...@@ -3,28 +3,56 @@ import {Toast} from "vant";
// createWebHistory // createWebHistory
const routes = [ const routes = [
/* 登录 */ /* 正常登录 */
// { // {
// path: "/login", // path: "",
// name: "Home", // name: "login",
// component: () => import("../views/Home.vue"), // component: () => import("../views/login/login.vue"),
// children: [
// {
// path: "login",
// name: "login",
// component: () => import("../views/login/login.vue"),
// meta: {
// requireAuth: true,
// },
// },
// ],
// }, // },
/* 登录 */ /* 钉钉免登陆 */
{ {
path: "", path: "",
name: "login", name: "dd",
component: () => import("../views/login/login.vue"), component: () => import("../views/dd.vue"),
children: [ children: [
{ {
path: "login", path: "dd",
name: "login", name: "dd",
component: () => import("../views/login/login.vue"), component: () => import("../views/dd.vue"),
meta: { meta: {
requireAuth: true, requireAuth: true,
}, },
}, },
], ],
}, },
// {
// path: "/dd",
// name: "dd",
// component: () => import("../views/dd.vue"),
// meta: {
// requireAuth: true,
// },
// },
/* 不用钉钉登录时 */
{
path: "/login",
name: "login",
component: () => import("../views/login/login.vue"),
meta: {
requireAuth: true,
},
},
/* 主页 */ /* 主页 */
{ {
path: "/main", path: "/main",
...@@ -218,19 +246,19 @@ const routes = [ ...@@ -218,19 +246,19 @@ const routes = [
/* 学校社团 家长端 */ /* 学校社团 家长端 */
{ {
path: "/schoolClub", path: "/schoolClub",
name:"schoolClub", name: "schoolClub",
component: () => import("../views/parent/schoolClub/index"), component: () => import("../views/parent/schoolClub/index"),
}, },
/* 学校社团-查看社团详情 家长端 */ /* 学校社团-查看社团详情 家长端 */
{ {
path: "/schoolClub/clubDetail", path: "/schoolClub/clubDetail",
name:"clubDetail", name: "clubDetail",
component: () => import("../views/parent/schoolClub/clueDetail"), component: () => import("../views/parent/schoolClub/clueDetail"),
}, },
/* 学校社团-查看社团详情 家长端 */ /* 学校社团-查看社团详情 家长端 */
{ {
path: "/schoolClub/clubDetail/clubApply", path: "/schoolClub/clubDetail/clubApply",
name:"clubApply", name: "clubApply",
component: () => import("../views/parent/schoolClub/clubApply"), component: () => import("../views/parent/schoolClub/clubApply"),
}, },
/* 学生选课 家长端 成绩查看 */ /* 学生选课 家长端 成绩查看 */
...@@ -617,190 +645,190 @@ const routes = [ ...@@ -617,190 +645,190 @@ const routes = [
//扫码查看设备的详细信息 //扫码查看设备的详细信息
{ {
path: "/schoolProperty/equipmentInfo", path: "/schoolProperty/equipmentInfo",
name:'equipmentInfo', name: 'equipmentInfo',
component: () => import("../views/teacher/schoolProperty/equipmentInfo"), component: () => import("../views/teacher/schoolProperty/equipmentInfo"),
}, },
/** 实验室管理 laboratoryManagement 管理员权限 教师权限 领导权限 级部权限 **/ /** 实验室管理 laboratoryManagement 管理员权限 教师权限 领导权限 级部权限 **/
{ {
path:"/laboratoryManagement", path: "/laboratoryManagement",
name:'laboratoryManagement', name: 'laboratoryManagement',
component: () => import("../views/teacher/laboratoryManagement/index.vue"), component: () => import("../views/teacher/laboratoryManagement/index.vue"),
}, },
//领导-实验室记录 //领导-实验室记录
{ {
path:"/laboratoryManagement/laboratoryRecord", path: "/laboratoryManagement/laboratoryRecord",
name:'laboratoryRecord', name: 'laboratoryRecord',
component: () => import("../views/teacher/laboratoryManagement/leader/laboratoryRecord"), component: () => import("../views/teacher/laboratoryManagement/leader/laboratoryRecord"),
}, },
//领导-实验室完成情况统计 //领导-实验室完成情况统计
{ {
path:"/laboratoryManagement/laboratoryCompleteStatistics", path: "/laboratoryManagement/laboratoryCompleteStatistics",
name: 'laboratoryCompleteStatistics', name: 'laboratoryCompleteStatistics',
component: () => import("../views/teacher/laboratoryManagement/leader/laboratoryCompleteStatistics"), component: () => import("../views/teacher/laboratoryManagement/leader/laboratoryCompleteStatistics"),
}, },
{ {
path:'/laboratoryManagement/laboratoryCompleteStatistics/checkComplete', path: '/laboratoryManagement/laboratoryCompleteStatistics/checkComplete',
name:'checkComplete', name: 'checkComplete',
component: () => import("../views/teacher/laboratoryManagement/leader/checkComplete"), component: () => import("../views/teacher/laboratoryManagement/leader/checkComplete"),
}, },
// 实验室管理员 - 年级实验预约列表 // 实验室管理员 - 年级实验预约列表
{ {
path: '/laboratoryManagement/gradeLaboratory', path: '/laboratoryManagement/gradeLaboratory',
name:'gradeLaboratory', name: 'gradeLaboratory',
component: () => import("../views/teacher/laboratoryManagement/manager/gradeLaboratory"), component: () => import("../views/teacher/laboratoryManagement/manager/gradeLaboratory"),
}, },
// 实验室管理员 - 年级实验预约列表查看 // 实验室管理员 - 年级实验预约列表查看
{ {
path: '/laboratoryManagement/gradeLaboratory/checkGradeComplete', path: '/laboratoryManagement/gradeLaboratory/checkGradeComplete',
name:'checkGradeComplete', name: 'checkGradeComplete',
component: () => import("../views/teacher/laboratoryManagement/manager/checkGradeComplete"), component: () => import("../views/teacher/laboratoryManagement/manager/checkGradeComplete"),
}, },
// 实验室管理员 - 教师实验室预约 // 实验室管理员 - 教师实验室预约
{ {
path: '/laboratoryManagement/teacherLaboratory', path: '/laboratoryManagement/teacherLaboratory',
name:'teacherLaboratory', name: 'teacherLaboratory',
component: () => import("../views/teacher/laboratoryManagement/manager/teacherLaboratory"), component: () => import("../views/teacher/laboratoryManagement/manager/teacherLaboratory"),
}, },
// 实验室管理员 - 教师实验室预约查看/申请审批 // 实验室管理员 - 教师实验室预约查看/申请审批
{ {
path: '/laboratoryManagement/teacherLaboratory/teacherLaboratoryApprove', path: '/laboratoryManagement/teacherLaboratory/teacherLaboratoryApprove',
name:'teacherLaboratoryApprove', name: 'teacherLaboratoryApprove',
component: () => import("../views/teacher/laboratoryManagement/manager/teacherLaboratoryApprove"), component: () => import("../views/teacher/laboratoryManagement/manager/teacherLaboratoryApprove"),
}, },
// 实验室管理员 - 个人实验审批 // 实验室管理员 - 个人实验审批
{ {
path: '/laboratoryManagement/personalLaboratoryApprove', path: '/laboratoryManagement/personalLaboratoryApprove',
name:'personalLaboratoryApprove', name: 'personalLaboratoryApprove',
component: () => import("../views/teacher/laboratoryManagement/manager/personalLaboratoryApprove"), component: () => import("../views/teacher/laboratoryManagement/manager/personalLaboratoryApprove"),
}, },
//级部申请-年级实验室预约 //级部申请-年级实验室预约
{ {
path: '/laboratoryManagement/gradeLaboratoryApprove', path: '/laboratoryManagement/gradeLaboratoryApprove',
name:'gradeLaboratoryApprove', name: 'gradeLaboratoryApprove',
component: () => import("../views/teacher/laboratoryManagement/levelPart/gradeLaboratoryApprove"), component: () => import("../views/teacher/laboratoryManagement/levelPart/gradeLaboratoryApprove"),
}, },
//级部申请-年级实验室预约-新增/查看/修改 //级部申请-年级实验室预约-新增/查看/修改
{ {
path: '/laboratoryManagement/gradeLaboratoryApprove/gradeLaboratoryDetail', path: '/laboratoryManagement/gradeLaboratoryApprove/gradeLaboratoryDetail',
name:'gradeLaboratoryDetail', name: 'gradeLaboratoryDetail',
component: () => import("../views/teacher/laboratoryManagement/levelPart/gradeLaboratoryDetail"), component: () => import("../views/teacher/laboratoryManagement/levelPart/gradeLaboratoryDetail"),
}, },
//级部申请-班级完成情况明细 //级部申请-班级完成情况明细
{ {
path: '/laboratoryManagement/gradeLaboratoryComplete', path: '/laboratoryManagement/gradeLaboratoryComplete',
name:'gradeLaboratoryComplete', name: 'gradeLaboratoryComplete',
component: () => import("../views/teacher/laboratoryManagement/levelPart/gradeLaboratoryComplete"), component: () => import("../views/teacher/laboratoryManagement/levelPart/gradeLaboratoryComplete"),
}, },
//级部申请-班级完成情况查看 //级部申请-班级完成情况查看
{ {
path: '/laboratoryManagement/gradeLaboratoryComplete/checkGradeLaboratoryComplete', path: '/laboratoryManagement/gradeLaboratoryComplete/checkGradeLaboratoryComplete',
name:'checkGradeLaboratoryComplete', name: 'checkGradeLaboratoryComplete',
component: () => import("../views/teacher/laboratoryManagement/levelPart/checkGradeLaboratoryComplete"), component: () => import("../views/teacher/laboratoryManagement/levelPart/checkGradeLaboratoryComplete"),
}, },
//级部申请-实验室完成情况明细 //级部申请-实验室完成情况明细
{ {
path: '/laboratoryManagement/laboratoryCompleteDetail', path: '/laboratoryManagement/laboratoryCompleteDetail',
name:'laboratoryCompleteDetail', name: 'laboratoryCompleteDetail',
component: () => import("../views/teacher/laboratoryManagement/levelPart/laboratoryCompleteDetail"), component: () => import("../views/teacher/laboratoryManagement/levelPart/laboratoryCompleteDetail"),
}, },
//级部申请-查看实验室完成情况 //级部申请-查看实验室完成情况
{ {
path: '/laboratoryManagement/laboratoryCompleteDetail/checkLaboratoryComplete', path: '/laboratoryManagement/laboratoryCompleteDetail/checkLaboratoryComplete',
name:'checkLaboratoryComplete', name: 'checkLaboratoryComplete',
component: () => import("../views/teacher/laboratoryManagement/levelPart/checkLaboratoryComplete"), component: () => import("../views/teacher/laboratoryManagement/levelPart/checkLaboratoryComplete"),
}, },
//教师申请-实验室安排 //教师申请-实验室安排
{ {
path: '/laboratoryManagement/laboratoryArrangement', path: '/laboratoryManagement/laboratoryArrangement',
name:'laboratoryArrangement', name: 'laboratoryArrangement',
component: () => import("../views/teacher/laboratoryManagement/teacher/laboratoryArrangement"), component: () => import("../views/teacher/laboratoryManagement/teacher/laboratoryArrangement"),
}, },
//教师申请-实验室安排查看、申请 //教师申请-实验室安排查看、申请
{ {
path: '/laboratoryManagement/laboratoryArrangement/laboratoryArrangementDetail', path: '/laboratoryManagement/laboratoryArrangement/laboratoryArrangementDetail',
name:'laboratoryArrangementDetail', name: 'laboratoryArrangementDetail',
component: () => import("../views/teacher/laboratoryManagement/teacher/laboratoryArrangementDetail"), component: () => import("../views/teacher/laboratoryManagement/teacher/laboratoryArrangementDetail"),
}, },
//教师申请-实验室申请记录 //教师申请-实验室申请记录
{ {
path: '/laboratoryManagement/laboratoryApplicationRecord', path: '/laboratoryManagement/laboratoryApplicationRecord',
name:'laboratoryApplicationRecord', name: 'laboratoryApplicationRecord',
component: () => import("../views/teacher/laboratoryManagement/teacher/laboratoryApplicationRecord"), component: () => import("../views/teacher/laboratoryManagement/teacher/laboratoryApplicationRecord"),
}, },
//教师申请-实验室申请记录查看 //教师申请-实验室申请记录查看
{ {
path: '/laboratoryManagement/laboratoryApplicationRecord/checkLaboratoryApplication', path: '/laboratoryManagement/laboratoryApplicationRecord/checkLaboratoryApplication',
name:'checkLaboratoryApplication', name: 'checkLaboratoryApplication',
component: () => import("../views/teacher/laboratoryManagement/teacher/checkLaboratoryApplication"), component: () => import("../views/teacher/laboratoryManagement/teacher/checkLaboratoryApplication"),
}, },
//教师申请-个人实验申请 //教师申请-个人实验申请
{ {
path: '/laboratoryManagement/PersonalLaboratoryApplication', path: '/laboratoryManagement/PersonalLaboratoryApplication',
name:'PersonalLaboratoryApplication', name: 'PersonalLaboratoryApplication',
component: () => import("../views/teacher/laboratoryManagement/teacher/PersonalLaboratoryApplication"), component: () => import("../views/teacher/laboratoryManagement/teacher/PersonalLaboratoryApplication"),
}, },
//教师申请-个人实验申请新增、修改 //教师申请-个人实验申请新增、修改
{ {
path: '/laboratoryManagement/PersonalLaboratoryApplication/PersonalLaboratoryApplyDetail', path: '/laboratoryManagement/PersonalLaboratoryApplication/PersonalLaboratoryApplyDetail',
name:'PersonalLaboratoryApplyDetail', name: 'PersonalLaboratoryApplyDetail',
component: () => import("../views/teacher/laboratoryManagement/teacher/PersonalLaboratoryApplyDetail"), component: () => import("../views/teacher/laboratoryManagement/teacher/PersonalLaboratoryApplyDetail"),
}, },
/** 实验室管理 laboratoryManagement 管理员权限 教师权限 领导权限 级部权限 **/ /** 实验室管理 laboratoryManagement 管理员权限 教师权限 领导权限 级部权限 **/
/** 安全管理 safetyManagement 教师端 **/ /** 安全管理 safetyManagement 教师端 **/
{ {
path:'/safetyManagement', path: '/safetyManagement',
name:'safetyManagement', name: 'safetyManagement',
component: () => import("../views/teacher/safetyManagement/index.vue"), component: () => import("../views/teacher/safetyManagement/index.vue"),
}, },
//个人安全管理-车辆出入登记 //个人安全管理-车辆出入登记
{ {
path:'/safetyManagement/carAccessRegistration', path: '/safetyManagement/carAccessRegistration',
name:'carAccessRegistration', name: 'carAccessRegistration',
component: () => import("../views/teacher/safetyManagement/carAccessRegistration"), component: () => import("../views/teacher/safetyManagement/carAccessRegistration"),
}, },
//个人安全管理-监控录像调阅 //个人安全管理-监控录像调阅
{ {
path:'/safetyManagement/monitoringCall', path: '/safetyManagement/monitoringCall',
name:'monitoringCall', name: 'monitoringCall',
component: () => import("../views/teacher/safetyManagement/monitoringCall"), component: () => import("../views/teacher/safetyManagement/monitoringCall"),
}, },
//信息中心监控管理-监控调阅内部 //信息中心监控管理-监控调阅内部
{ {
path:'/safetyManagement/monitoringCallInside', path: '/safetyManagement/monitoringCallInside',
name:'monitoringCallInside', name: 'monitoringCallInside',
component: () => import("../views/teacher/safetyManagement/monitoringCallInside"), component: () => import("../views/teacher/safetyManagement/monitoringCallInside"),
}, },
//信息中心监控管理-监控调阅外部 //信息中心监控管理-监控调阅外部
{ {
path:'/safetyManagement/monitoringCallOutside', path: '/safetyManagement/monitoringCallOutside',
name:'monitoringCallOutside', name: 'monitoringCallOutside',
component: () => import("../views/teacher/safetyManagement/monitoringCallOutside"), component: () => import("../views/teacher/safetyManagement/monitoringCallOutside"),
}, },
//安全管理-车辆登记表 //安全管理-车辆登记表
{ {
path:'/safetyManagement/vehicleRegistration', path: '/safetyManagement/vehicleRegistration',
name:'vehicleRegistration', name: 'vehicleRegistration',
component: () => import("../views/teacher/safetyManagement/vehicleRegistration"), component: () => import("../views/teacher/safetyManagement/vehicleRegistration"),
}, },
//安全管理-车辆出入登记申请列表 //安全管理-车辆出入登记申请列表
{ {
path:'/safetyManagement/carAccessRegistrationApply', path: '/safetyManagement/carAccessRegistrationApply',
name:'carAccessRegistrationApply', name: 'carAccessRegistrationApply',
component: () => import("../views/teacher/safetyManagement/carAccessRegistrationApply"), component: () => import("../views/teacher/safetyManagement/carAccessRegistrationApply"),
}, },
//安全管理-监控调阅内部申请列表 //安全管理-监控调阅内部申请列表
{ {
path:'/safetyManagement/monitoringCallInsideApply', path: '/safetyManagement/monitoringCallInsideApply',
name:'monitoringCallInsideApply', name: 'monitoringCallInsideApply',
component: () => import("../views/teacher/safetyManagement/monitoringCallInsideApply"), component: () => import("../views/teacher/safetyManagement/monitoringCallInsideApply"),
}, },
//安全管理-监控调阅外部申请列表 //安全管理-监控调阅外部申请列表
{ {
path:'/safetyManagement/monitoringCallOutsideApply', path: '/safetyManagement/monitoringCallOutsideApply',
name:'monitoringCallOutsideApply', name: 'monitoringCallOutsideApply',
component: () => import("../views/teacher/safetyManagement/monitoringCallOutsideApply"), component: () => import("../views/teacher/safetyManagement/monitoringCallOutsideApply"),
}, },
......
//钉钉免密登录
import axios from "../utils/axios";
//获取用户角色
export function getRole(code) {
return axios.get("/dd/App/user/getRole?code=" + code);
}
//获取token
export function getToken(code,roleType) {
return axios.get("/dd/App/user/login?code=" + code + "&roleType=" + roleType);
}
...@@ -18,6 +18,10 @@ export function login(params) { ...@@ -18,6 +18,10 @@ export function login(params) {
return result; return result;
} }
//获取用户角色
export function loginType(phoneNumber) {
return axios.get(`/wx/user/getRoleType/${phoneNumber}`);
}
//用户登录接口 //用户登录接口
/* /*
* @params postData { studentName,studentIdCard(teacherIdCard),parentName,type,teacherName,openId} * @params postData { studentName,studentIdCard(teacherIdCard),parentName,type,teacherName,openId}
...@@ -629,7 +633,20 @@ export function cancelLeave(taskId, params) { ...@@ -629,7 +633,20 @@ export function cancelLeave(taskId, params) {
data: params, data: params,
}); });
} }
//根据用户找到所在的组织
export function getUserDept(userId){
return axios({
url: "/wx/teacherLeave/getUserDept/" + userId,
method: "get",
});
}
//根据部门和部门id 获取当前机构的 科室主任 处室主任
export function getDeptGrapRole(deptName,deptId){
return axios({
url: `/wx/teacherLeave/getDeptGrapRole?deptName=${deptName}&deptId=${deptId}`,
method: "get",
});
}
// 老师审批请假列表 // 老师审批请假列表
export function teacherLeavelist(params) { export function teacherLeavelist(params) {
// console.log(params); // console.log(params);
...@@ -1084,9 +1101,9 @@ export function getpersonalListinfo(id) { ...@@ -1084,9 +1101,9 @@ export function getpersonalListinfo(id) {
}); });
} }
//请假时间 //请假时间
export function getTotalTime(query) { export function getTotalTime(query,type) {
return axios({ return axios({
url: "/wx/teacherLeave/getTotalTime/" + store.state.userInfo.userId, url: `/wx/teacherLeave/getTotalTime/${store.state.userInfo.userId}/${type}`,
method: "get", method: "get",
params: query, params: query,
}); });
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
import axios from "../utils/axios"; import axios from "../utils/axios";
/********************** 字典 *******************/ /********************** 字典 *******************/
//获取数据字典 //获取数据字典 course_arrange:节次 course_type:课程类型 section_type:课程
//specialty:志愿 art_subject:艺体所选科目 experiment_classify:实验类型
export function getDicts(type) { export function getDicts(type) {
let url = `/system/dict/data/type/${type}`; let url = `/system/dict/data/type/${type}`;
let result = axios.get(url); let result = axios.get(url);
...@@ -22,6 +23,11 @@ export function getSchoolYear(data){ ...@@ -22,6 +23,11 @@ export function getSchoolYear(data){
}) })
}; };
//获取学科
export function getSubject(){
return axios.get('/wx/teacher/expriment/getSubject')
};
/********************** 领导 *******************/ /********************** 领导 *******************/
//领导—实验室完成情况统计 //领导—实验室完成情况统计
export function getLabCompleteList(data){ export function getLabCompleteList(data){
...@@ -129,15 +135,28 @@ export function addTeacherLab(data) { ...@@ -129,15 +135,28 @@ export function addTeacherLab(data) {
...data ...data
} ) } )
} }
//1.2 获取实验计划详细信息 //1.3 获取实验计划详细信息
export function getLabPlanDetail(id) { export function getLabPlanDetail(id) {
return axios.get(`/wx/level/expriment/classYear/${id}`); return axios.get(`/wx/teacher/expriment/classYear/${id}`);
}
//1.4 获取班级
export function getTeacherClass(data) {
return axios.get(`/wx/teacher/expriment/getTeacherClass`,{
params:data
});
}
//1.5获取实验室状态
export function getTeacherLab(data) {
return axios.get(`/wx/teacher/expriment/getTeacherLab`,{
params:data
});
} }
//1.实验室申请记录 //1.实验室申请记录
//1.1实验室申请记录 //1.1实验室申请记录
export function getLabApplyList(data){ export function getLabApplyList(data){
return axios.get('/wx/level/expriment/list',{ return axios.get('/wx/teacher/expriment/list',{
params:data params:data
}) })
}; };
...@@ -180,6 +199,10 @@ export function editApply(data) { ...@@ -180,6 +199,10 @@ export function editApply(data) {
export function deleteApply(ids){ export function deleteApply(ids){
return axios.delete(`/wx/teacher/expriment/apply/${ids}`) return axios.delete(`/wx/teacher/expriment/apply/${ids}`)
} }
//3.6获取当前老师学年的班级
export function getTeacherschoolyearClass(id){
return axios.get(`/wx/teacher/expriment/getTeacherschoolyearClass/${id}`)
}
/********************** 级部申请 *******************/ /********************** 级部申请 *******************/
//获取级部id //获取级部id
......
...@@ -37,8 +37,10 @@ export function checkBorrowDetail(id) { ...@@ -37,8 +37,10 @@ export function checkBorrowDetail(id) {
/********** 物品归还(管理员) ***********/ /********** 物品归还(管理员) ***********/
//管理员物品列表查看 //管理员物品列表查看
export function getEquipmentList(userId,equipmentName) { export function getEquipmentList(data) {
return axios.get(`wx/equipment/getMyBorrowList/?userId=${userId}&equipmentName=${equipmentName}` ); return axios.get('wx/equipment/getReturningEquipmentList/',{
params:data
} );
} }
//借用物品记录详情查看-克隆 //借用物品记录详情查看-克隆
......
...@@ -12,7 +12,7 @@ import router from "../router"; ...@@ -12,7 +12,7 @@ import router from "../router";
import {getToken} from "@/utils/auth"; import {getToken} from "@/utils/auth";
import {tansParams} from "@/utils/common"; import {tansParams} from "@/utils/common";
axios.defaults.baseURL = "/school"; axios.defaults.baseURL = "/wx_api";
// axios.defaults.baseURL = "/houduan"; // axios.defaults.baseURL = "/houduan";
// axios.defaults.baseURL = "/schoolnw"; // axios.defaults.baseURL = "/schoolnw";
...@@ -45,6 +45,7 @@ axios.defaults.headers["X-Requested-With"] = "XMLHttpRequest"; ...@@ -45,6 +45,7 @@ axios.defaults.headers["X-Requested-With"] = "XMLHttpRequest";
//axios.defaults.headers['token'] = localStorage.getItem('token') || '' //axios.defaults.headers['token'] = localStorage.getItem('token') || ''
axios.defaults.headers.post["Content-Type"] = "application/json"; axios.defaults.headers.post["Content-Type"] = "application/json";
// 请求拦截器
axios.interceptors.request.use( axios.interceptors.request.use(
(config) => { (config) => {
let cacheKey = config.url; let cacheKey = config.url;
...@@ -116,21 +117,19 @@ axios.interceptors.response.use( ...@@ -116,21 +117,19 @@ axios.interceptors.response.use(
} }
if (res.data.code != 200) { if (res.data.code != 200) {
console.log(res.data); console.log(res.data);
if(res.data.code == 2000){ if(res.data.code === 2000){
return res.data return res.data
}if(res.data.code == 3000){ }if(res.data.code === 3000){
return res.data return res.data
} }
// if (res.data.message) Toast.fail(res.data.message); // if (res.data.message) Toast.fail(res.data.message);
if (res.data.code == 401) { if (res.data.code === 401) {
router.push({path: "/"}); router.push({path: "/"});
} }
if (res.data.code == 500) { if (res.data.code === 500) {
// router.push({ path: "/login" });
// Toast.fail("获取信息异常");
// return Promise.reject(res.data);
Toast.fail(res.data.msg); Toast.fail(res.data.msg);
router.push({path: "/login"}); router.push({path: "/dd"});
// router.push({path: "/login"});
} }
return Promise.reject(res.data); return Promise.reject(res.data);
// return Promise.resolve(res.data); // return Promise.resolve(res.data);
......
import { getWxConfig,scanEquipmentInfo } from "../service/schoolProperty"; import {getWxConfig, scanEquipmentInfo} from "../service/schoolProperty";
import wx from "weixin-js-sdk"; //调用微信相关 // import wx from "weixin-js-sdk"; //调用微信相关
import * as dd from 'dingtalk-jsapi';
import Vue from 'vue'; import Vue from 'vue';
import { useRouter } from "vue-router"; import {useRouter} from "vue-router";
import router from "@/router/index.js" import router from "@/router/index.js"
/*** /***
* Date:2023-08-14 * Date:2023-10-13
* Describe:用于调取微信扫码 * Describe:用于调取钉钉扫码
* */ * */
export function scanCodeFun(appId,type){ export function scanCodeFun(type) {
console.log('appId',appId) let enCode ='';
let url = encodeURIComponent(location.href.split('#')[0]) //获取当前域名 dd.scan({
type: ['qr','bar'],
console.log('location.href',location.href) success: (res) => {
console.log('url',url) console.log('res',res)
let encode = '' enCode = res.text
getWxConfig(url).then(res=>{ if (type == 0) {
if(res.code == 200){
const data = res.data
wx.config({
// 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
debug: false,
// debug: true,
// 必填,公众号的唯一标识
appId,
// 必填,生成签名的时间戳
timestamp: data.timestamp,
// 必填,生成签名的随机串
nonceStr: data.noncestr,
// 必填,签名,见附录1
signature: data.signature,
// 必填,需要使用的JS接口列表,所有JS接口列表见附录2
jsApiList: ['scanQRCode'],
});
// setTimeout(()=>{
wx.ready(function () {
console.log(666)
wx.checkJsApi({
jsApiList: [
// 所有要调用的 API 都要加到这个列表中
'scanQRCode'
],
success: function (res){
console.log("res.checkResult.scanQRCode",res.checkResult.scanQRCode)
if(res.checkResult.scanQRCode === true){
wx.scanQRCode({
needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码,默认二者都有
success: function (res) {
console.log(777)
encode = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
console.log(encode,"encode")
if(type == 0){
console.log(type,"type")
// 校产管理页面扫码显示设备信息 // 校产管理页面扫码显示设备信息
router.push({ router.push({
path: "/schoolProperty/equipmentInfo", path: "/schoolProperty/equipmentInfo",
query: { query: {
encode:encode encode: enCode
} }
}) })
} };
if(type == 1){ if (type == 1) {
// 物品借用 // 物品借用
router.push({ router.push({
path: "/schoolProperty/borrow/detail", path: "/schoolProperty/borrow/detail",
query:{ query: {
encode:encode encode: enCode
} }
}); });
}; };
if(type == 2){ if (type == 2) {
// 归还管理 // 归还管理
router.push({ router.push({
path: "/schoolProperty/return/detail", path: "/schoolProperty/return/detail",
query:{ query: {
encode:encode encode: enCode
} }
}); });
}; };
if(type == 3){ if (type == 3) {
// 物品领用 // 物品领用
router.push({ router.push({
path: "/schoolProperty/use/add", path: "/schoolProperty/use/add",
query:{ query: {
encode:encode encode: enCode
} }
}); });
}; };
if(type == 4){ if (type == 4) {
// 设备报修 // 设备报修
router.push({ router.push({
path: "/schoolProperty/device/info", path: "/schoolProperty/device/info",
query:{ query: {
encode:encode, encode: enCode,
name:'新增' name: '新增'
} }
}); });
} };
}, },
fail:function (res){ // fail: () => {
console.log('fail',res) // },
} // complete: (res) => {
}) // console.log('complete',res)
} // },
}
})
}); });
// },3000)
}
})
// return encode // return encode
} }
<template>
<!-- <div>钉钉内跳转</div>-->
<van-dialog v-model:show="showDialog" title="请选择角色" show-cancel-button @confirm="confirmDialog">
<van-radio-group style="justify-content: space-around;margin: 20px 0" v-model="checked" direction="horizontal">
<div v-for="(item,index) in typeResult" :key="index">
<van-radio :name="item.userLoginType" >{{item.userLoginType == "0" ? '教师' : '家长' }}
<span v-if="item.userLoginType == '1'">({{ item.studentName }})</span>
</van-radio>
</div>
</van-radio-group>
</van-dialog>
</template>
<script setup>
import {Dialog, Toast} from 'vant';
import {getRole, getToken} from "@/service/dd";
import {onMounted, ref} from "vue";
import * as dd from "dingtalk-jsapi";
import { setToken, setParentTelephone, setTotyp } from "@/utils/auth";
import {useRoute, useRouter} from "vue-router";
const router = useRouter();
const VanDialog = Dialog.Component;
const showDialog = ref(false);
const checked = ref();
const studentName = ref();
const typeResult = ref([]);
//code码
const code = ref()
onMounted(() => {
getCode()
console.log('showDialog', showDialog.value)
})
// 获取code
const getCode = () => {
dd.getAuthCode({
corpId: 'dingaa3937ff8b7dd267f2c783f7214b6d69',
success: (res) => {
console.log('获取新的免登码成功', res);
const code = res.code
// this.code = code;
// this.authCodeTimestamp = currentTime;
// console.log('this.authCodeTimestamp', this.authCodeTimestamp);
console.log('code', code);
getRoleType(code)
// console.log('loginResponse', loginResponse);
},
fail: (res) => {
console.log('获取免登码失败', res);
},
complete: () => {
},
});
}
//获取类型
const getRoleType = async (code) => {
const type = await getRole(code);
console.log('type', type);
if (type.code == 200) {
typeResult.value = type.data
if (type.data.length == 1) {
dd.getAuthCode({
corpId: 'dingaa3937ff8b7dd267f2c783f7214b6d69',
success: (res) => {
console.log('获取新的免登码成功', res);
const code = res.code
console.log('code', code);
const typeNew = type.data[0].userLoginType
console.log('666',typeNew)
getgetToken(code, typeNew)
},
fail: (res) => {
console.log('获取免登码失败', res);
},
complete: () => {
},
});
} else {
showDialog.value = true
}
} else {
Toast("获取信息失败!");
}
}
// 获取token登录
const getgetToken = async (code, roleType) => {
console.log('token code',code)
console.log('token roleType',roleType)
const result = await getToken(code, roleType);
console.log("asdasd", result);
if (result.code == 200) {
setToken(result.token);
setTotyp(roleType);
console.log(router);
router.replace({
path: "/main",
query:{
roleType:roleType
},
});
}else if (result.code == 500) {
Toast("获取信息失败,请重新进入");
return;
}
};
//确认弹框,再次获取code码
const confirmDialog = () => {
console.log('确认',checked.value)
dd.getAuthCode({
corpId: 'dingaa3937ff8b7dd267f2c783f7214b6d69',
success: (res) => {
console.log('获取新的免登码成功', res);
const code = res.code
console.log('code', code);
getgetToken(code, checked.value)
},
fail: (res) => {
console.log('获取免登码失败', res);
},
complete: () => {
},
});
}
</script>
<style scoped lang="less">
</style>
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
<div class="bg_color"> <div class="bg_color">
<!--/* <van-loading style="margin:0 auto;height: 100vh;display:flex;align-items: center;justify-content: center" v-if="displayStyle == '0'" vertical text-color="#0094ff" color="#0094ff" >加载中...</van-loading>*/--> <!--/* <van-loading style="margin:0 auto;height: 100vh;display:flex;align-items: center;justify-content: center" v-if="displayStyle == '0'" vertical text-color="#0094ff" color="#0094ff" >加载中...</van-loading>*/-->
<!-- <div v-else>--> <!-- <div v-else>-->
<div class="bg_top"> <div class="bg_top">
<div class="bg_top_til" >智慧校园云平台</div> <div class="bg_top_til">智慧校园云平台</div>
<div class="bg_top_bla"> <div class="bg_top_bla">
<text class="bg_top_text">家校互动</text> <text class="bg_top_text">家校互动</text>
<div class="bg_top_bt"></div> <div class="bg_top_bt"></div>
...@@ -16,83 +16,24 @@ ...@@ -16,83 +16,24 @@
</div> --> </div> -->
</div> </div>
<div class="main"> <div class="main">
<van-form @submit="onSubmit" ref="loginForm"> <van-form ref="loginForm">
<div class="flex_center sw"> <div style="margin-top:100px;"></div>
<text
class="sw_text_jz flex_center"
:class="{ sw_true: checked }"
@click="changeTyoe"
>
家长
</text>
<text
class="sw_text_jzg flex_center"
:class="{ sw_text_true: !checked }"
@click="changeTyoe"
>
教职工
</text>
</div>
<van-field
v-model="studentName"
v-show="parentShow"
name="studentName"
class="studentName"
left-icon="user-circle-o"
type="text"
placeholder="输入学生姓名"
:rules="[{ required: true, message: '请填写学生姓名' }]"
/>
<van-field <van-field
v-model="studentIdCard" v-model="state.phonenumber"
v-show="parentShow"
name="idcard"
left-icon="idcard"
type="text"
placeholder="输入学生身份证号"
:rules="[
{
validator: validator,
// required: true,
// message: message,
},
]"
/>
<van-field
v-show="teacherShow"
v-model="phonenumber"
left-icon="phone-o" left-icon="phone-o"
name="phonenumber" name="phonenumber"
type="text" type="text"
placeholder="手机号码" placeholder="手机号码"
:rules="[{ required: true, message: '请输入手机号码' }]"
></van-field> ></van-field>
<van-field <van-field
v-model="parentName" v-model="state.password"
v-show="parentShow"
name="parentName"
left-icon="contact"
type="text"
placeholder="输入家长姓名"
:rules="[{ required: true, message: '请填写家长姓名' }]"
/>
<van-field
v-model="password"
v-show="teacherShow"
name="password" name="password"
left-icon="contact" left-icon="contact"
type="password" type="password"
placeholder="请输入密码" placeholder="请输入密码"
:rules="[{ required: true, message: '请输入密码' }]" :rules="[{ required: true, message: '请输入密码' }]"
/> />
<van-field
v-show="parentShow"
v-model="state.parentTelephone"
name="parentTelephone"
left-icon="phone-o"
placeholder="输入手机号"
:rules="[{ required: true, message: '请填写手机号' }]"
/>
<div <div
style=" style="
margin: 16px 0; margin: 16px 0;
...@@ -110,13 +51,12 @@ ...@@ -110,13 +51,12 @@
type="danger" type="danger"
class="submit" class="submit"
native-type="submit" native-type="submit"
@click="onSubmit" @click="onSubmitType"
>账号绑定 >账号绑定
</van-button> </van-button>
</div> </div>
</van-form> </van-form>
</div> </div>
<!-- </div>-->
<van-image <van-image
style="background: #e7f4fb; position: absolute; bottom: 0; height: auto" style="background: #e7f4fb; position: absolute; bottom: 0; height: auto"
:src="require('@/assets/login/loginback.png')" :src="require('@/assets/login/loginback.png')"
...@@ -125,61 +65,52 @@ ...@@ -125,61 +65,52 @@
height="100%" height="100%"
></van-image> ></van-image>
</div> </div>
<van-dialog v-model:show="showDialog" title="请选择角色" show-cancel-button @confirm="confirmDialog">
<van-radio-group style="justify-content: space-around;margin: 20px 0" v-model="checked" direction="horizontal">
<div v-for="(item,index) in userType" :key="index">
<van-radio :name="item.user_login_type">{{ item.user_login_type == "0" ? '教师' : '家长' }}
<span v-if="item.user_login_type == '1'">({{ item.login_name }})</span>
</van-radio>
</div>
</van-radio-group>
</van-dialog>
</template> </template>
<script> <script setup>
import {handleCode} from "@/service/home.js" import {handleCode} from "@/service/home.js"
import {reactive, onMounted, toRefs, onBeforeMount,nextTick} from "vue"; import {reactive, onMounted, toRefs, onBeforeMount, nextTick} from "vue";
import { ref } from "vue"; import {ref} from "vue";
import {useRoute, useRouter} from "vue-router"; import {useRoute, useRouter} from "vue-router";
import { useStore } from "vuex"; import {useStore} from "vuex";
import { formatDatetime, formatDate, isEmpty } from "@/utils/time.js"; import {formatDatetime, formatDate, isEmpty} from "@/utils/time.js";
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
import { loginGet, getgetToken } from "@/service/home"; import {loginGet, getgetToken, loginType} from "@/service/home";
import { Toast } from "vant"; import {Toast} from "vant";
import { my_switch } from "@/components/my_switch.vue"; import {my_switch} from "@/components/my_switch.vue";
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
import { Dialog } from "vant"; import {Dialog} from "vant";
import { getUrlKey, getCodeApi, getopid } from "@/service/utils"; import {getUrlKey, getCodeApi, getopid} from "@/service/utils";
import { setToken, setParentTelephone, setTotyp } from "@/utils/auth"; import {setToken, setParentTelephone, setTotyp} from "@/utils/auth";
export default {
name: "Login",
setup() {
//双向绑定对象
const state = reactive({
message: "请填写学生身份证号",
// studentName: "伊一", //学生姓名
studentName: "", //学生姓名
// studentIdCard: "400380200605055143", // 身份证号
studentIdCard: "", // 身份证号
const VanDialog = Dialog.Component;
//双向绑定对象
const state = reactive({
// phonenumber: "18174873412", // phonenumber: "18174873412",
phonenumber: "", phonenumber: "",
// parentName: "伊二", //家长姓名
parentName: "", //家长姓名
parentId: "", //家长Id
// parentTelephone: "17661047887", //手机号
parentTelephone: "", //手机号
// password: "admin123", // 教职工姓名 // password: "admin123", // 教职工姓名
password: "", // 教职工姓名 password: "", // 教职工姓名
openId: "1", // 用户的OpenId
parentShow: true, //默认展示 家长登陆信息输入框
teacherShow: false, //教职工登陆信息输入框
loginType: "", //登录类型 值 loginType: "", //登录类型 值
msg: "", msg: "",
list: [], list: [],
gradeClassValue: "", //选择年级班级 gradeClassValue: "", //选择年级班级
showPicker: false, showPicker: false,
}); });
const userTypeChecked = ref("1"); //单选框 默认 家长 const showDialog = ref(false);
const gradeClassColumns = [ const typeResult = ref([]);
const checkedType = ref();
const userType = ref([]);
const userTypeChecked = ref("1"); //单选框 默认 家长
const gradeClassColumns = [
// 年级班级列表 // 年级班级列表
{ {
values: ["一年级", "二年级", "三年级", "四年级", "五年级", "六年级"], values: ["一年级", "二年级", "三年级", "四年级", "五年级", "六年级"],
...@@ -189,142 +120,92 @@ export default { ...@@ -189,142 +120,92 @@ export default {
values: ["一班", "二班", "三班", "四班", "五班", "六班"], values: ["一班", "二班", "三班", "四班", "五班", "六班"],
defaultIndex: 0, defaultIndex: 0,
}, },
]; ];
const router = useRouter(); const router = useRouter();
const store = useStore(); const store = useStore();
const route = useRoute(); const route = useRoute();
const code = ref('') const code = ref('')
let displayStyle = ref('0') let displayStyle = ref('0')
onMounted( () => { onMounted(() => {
console.log('route',route.query.isLogout) showDialog.value = false
console.log('displayStyle',displayStyle.value) console.log('route', route.query.isLogout)
getToken() console.log('displayStyle', displayStyle.value)
if (process.env.NODE_ENV != "development") {
//获取openId
code.value = getUrlKey("code");
console.log('code',code)
if (isEmpty(code.value)) getCodeApi() ;
else checkOpenIdOrWxCookie();
}
});
// const loadData = async () => { });
// console.log("加载数据");
// //
// };
// 新增获取用户信息 // 新增获取用户信息
const getToken = async () => { const getToken = async () => {
const result = await getgetToken(); const result = await getgetToken();
// getgetToken() console.log("asdasd", result);
// .then((res) => {
// console.log("resolve:", res);
// if (res.data) {
// router.push({
// path: "/main",
// });
// }
// })
// .catch((rej) => {
// Toast.clear();
// console.log("catch:", rej);
// });
console.log("asdasd",result);
if (result.data) { if (result.data) {
console.log(router); console.log(router);
router.replace({ router.replace({
path: "/main", path: "/main",
}); });
} }
}; };
const changeTyoe = async () => { //登录的角色
checked.value = !checked.value; const onSubmitType = async () => {
/* 选择登陆类型 触发 */ console.log('1')
let loginType = checked.value ? "1" : "0"; let result = await loginType(state.phonenumber)
if (checked.value) { if(result.code == 200){
/** 家长 */ userType.value = result.data
state.parentShow = true; console.log('userType.value',userType.value)
state.teacherShow = false; if (userType.value.length > 1) {
// state.phonenumber = "18174873412"; // 弹窗提示
state.phonenumber = ""; showDialog.value = true
} else { } else {
/** 教职工 */ showDialog.value = false
state.parentShow = false; // 直接登录
state.teacherShow = true; const selectType = userType.value[0].user_login_type
// state.phonenumber = "15888888888"; console.log('selectType',selectType)
state.phonenumber = ""; onSubmit(selectType)
}
};
/* 自定义方法 */
const onSubmit = async () => {
/* 登录按钮 触发 */
let loginType = checked.value ? "1" : "0";
state.loginType = loginType;
/** 数据校验 */
if (loginType == "1") {
/** 家长 */
if (state.studentName == "") {
Toast("请填写学生姓名!");
return;
}
if (state.idcard == "") {
Toast("请填写学生身份证号!");
return;
} }
if (state.parentName == "") { }else{
Toast("请填写家长姓名!"); Toast(result.msg);
return; return;
} }
} else if (loginType == "0") {
/** 教职工 */
if (state.password == "") {
Toast("请输入密码!");
return;
}
}
//请求后台校验是否 数据正确可登陆
let data = {};
data.studentName = state.studentName;
// data.idcard = state.idcard;
data.phonenumber = state.phonenumber;
// loginType == "0" && (data.tearchIdCard = state.idcard);
data.parentName = state.parentName;
data.password = state.password;
data.type = state.loginType;
data.openId = state.openId;
}
/*确认弹框登录*/
const confirmDialog = () => {
console.log('确认', checked.value)
onSubmit(checked.value)
}
/* 登录 */
const onSubmit = async (selectType) => {
//访问后台接口 //访问后台接口
let postData = {}; let postData = {};
if (state.parentShow) { //教师
// 家长登录 if(selectType == '0'){
postData = { postData = {
studentName: state.studentName, password: state.password,
studentIdCard: state.studentIdCard, phonenumber: state.phonenumber,
parentName: state.parentName,
parentTelephone: state.parentTelephone,
openId: state.openId,
}; };
} else { }
// 家长
if(selectType == '1'){
postData = { postData = {
openId: state.openId,
password: state.password, password: state.password,
phonenumber: state.phonenumber, parentTelephone: state.phonenumber,
}; };
} }
console.log('postData',postData) console.log('postData', postData)
// 发送请求登录 // 发送请求登录
let result = await loginGet({ let result = await loginGet({
...postData, ...postData,
// openId: 1, // openId: 1,
type: state.loginType, type: selectType,
}); });
if (result.code == 200) { if (result.code == 200) {
setToken(result.token); setToken(result.token);
setParentTelephone(state.parentTelephone); setParentTelephone(state.parentTelephone);
setTotyp(state.loginType); setTotyp(selectType);
// setTotyp(state.loginType);
router.replace({ router.replace({
path: "/main", path: "/main",
...@@ -339,20 +220,20 @@ export default { ...@@ -339,20 +220,20 @@ export default {
Toast("登陆失败,请确认输入信息的正确性!"); Toast("登陆失败,请确认输入信息的正确性!");
return; return;
} }
}; };
const checked = ref(true); const checked = ref(true);
const gocj = () => { const gocj = () => {
router.push({ router.push({
path: "/InforColledit", path: "/InforColledit",
}); });
}; };
const onConfirmGradeClass = (value) => { const onConfirmGradeClass = (value) => {
/* 选择年级班级 选择后触发事件 */ /* 选择年级班级 选择后触发事件 */
state.gradeClassValue = value; state.gradeClassValue = value;
state.showPicker = false; state.showPicker = false;
}; };
//身份证校验 //身份证校验
const validator = async (val) => { const validator = async (val) => {
if (val == "") { if (val == "") {
return "请填写学生身份证号"; return "请填写学生身份证号";
} }
...@@ -364,21 +245,21 @@ export default { ...@@ -364,21 +245,21 @@ export default {
// let isvalidator = card15.test(val) || card18.test(val); // let isvalidator = card15.test(val) || card18.test(val);
// return isvalidator ? "" : "请填写正确的身份证号"; // return isvalidator ? "" : "请填写正确的身份证号";
// } // }
}; };
/** 获取OpenId */ /** 获取OpenId */
const checkOpenIdOrWxCookie = async () => { const checkOpenIdOrWxCookie = async () => {
let openId; let openId;
let code = getUrlKey("code"); let code = getUrlKey("code");
console.log('code',code); console.log('code', code);
let result = await getopid(code); let result = await getopid(code);
console.log(result); console.log(result);
openId = result.openId; openId = result.openId;
store.commit("editopenId", openId); store.commit("editopenId", openId);
state.openId = openId; state.openId = openId;
nextTick(()=>{ nextTick(() => {
displayStyle.value = '1' displayStyle.value = '1'
console.log('displayStyle.value',displayStyle.value) console.log('displayStyle.value', displayStyle.value)
}) })
// 接收到openId 进行判断 如果与本地 localStorage 中存储的 userInfo 中的openId 一致,表示登陆过,直接进入主页 // 接收到openId 进行判断 如果与本地 localStorage 中存储的 userInfo 中的openId 一致,表示登陆过,直接进入主页
...@@ -407,25 +288,8 @@ export default { ...@@ -407,25 +288,8 @@ export default {
// // }, // // },
// // }); // // });
// } // }
};
return {
...toRefs(state),
state,
userTypeChecked,
gradeClassColumns,
router,
store,
changeTyoe,
validator,
onSubmit,
onConfirmGradeClass,
checked,
gocj,
displayStyle
};
} /* end setup */,
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
...@@ -440,6 +304,7 @@ export default { ...@@ -440,6 +304,7 @@ export default {
height: 100%; height: 100%;
background: #e7f4fb; background: #e7f4fb;
} }
.bg_top { .bg_top {
margin: auto; margin: auto;
margin-top: 83px; margin-top: 83px;
...@@ -447,6 +312,7 @@ export default { ...@@ -447,6 +312,7 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
&_til { &_til {
height: 50px; height: 50px;
font-family: PingFang SC; font-family: PingFang SC;
...@@ -454,11 +320,13 @@ export default { ...@@ -454,11 +320,13 @@ export default {
color: #1b4052; color: #1b4052;
font-size: 34px; font-size: 34px;
} }
&_bla { &_bla {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
&_bt { &_bt {
width: 22px; width: 22px;
height: 0px; height: 0px;
...@@ -466,6 +334,7 @@ export default { ...@@ -466,6 +334,7 @@ export default {
border-color: #1b4052; border-color: #1b4052;
margin: 0 11.5px; margin: 0 11.5px;
} }
&_text { &_text {
height: 20px; height: 20px;
font-family: PingFang SC; font-family: PingFang SC;
...@@ -473,9 +342,10 @@ export default { ...@@ -473,9 +342,10 @@ export default {
font-size: 14px; font-size: 14px;
} }
} }
.sw_true { .sw_true {
width: 90px !important; width: 90px !important;
height: 40; height: 40px;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 700; font-weight: 700;
color: #1b4052 !important; color: #1b4052 !important;
...@@ -483,6 +353,7 @@ export default { ...@@ -483,6 +353,7 @@ export default {
background: #ffffff; background: #ffffff;
border-radius: 999px; border-radius: 999px;
} }
.sw { .sw {
margin: auto; margin: auto;
width: 160px; width: 160px;
...@@ -509,6 +380,7 @@ export default { ...@@ -509,6 +380,7 @@ export default {
font-size: 14px; font-size: 14px;
// padding: 10px 17px 10px 25px; // padding: 10px 17px 10px 25px;
} }
.sw_text_true { .sw_text_true {
width: 90px !important; width: 90px !important;
height: 40px; height: 40px;
...@@ -519,6 +391,7 @@ export default { ...@@ -519,6 +391,7 @@ export default {
background: #ffffff; background: #ffffff;
border-radius: 999px; border-radius: 999px;
} }
.sw_text_jzg { .sw_text_jzg {
width: 70px; width: 70px;
height: 40px; height: 40px;
...@@ -528,6 +401,7 @@ export default { ...@@ -528,6 +401,7 @@ export default {
font-size: 14px; font-size: 14px;
// padding: 10px 24px; // padding: 10px 24px;
} }
.icon-wrapper { .icon-wrapper {
display: flex; display: flex;
width: 100%; width: 100%;
......
...@@ -27,6 +27,18 @@ ...@@ -27,6 +27,18 @@
label="性别" label="性别"
/> />
<van-field <van-field
v-model="cardid"
name="cardid"
label="身份证号"
/>
<van-field
v-model="phone"
name="phone"
label="联系电话"
/>
<van-field
:readonly="status == '1' || status == '2' ? true:false" :readonly="status == '1' || status == '2' ? true:false"
v-model="hobby" v-model="hobby"
name="hobby" name="hobby"
...@@ -56,7 +68,7 @@ ...@@ -56,7 +68,7 @@
<van-button type="warning" style="margin-right: 10px;border-radius: 5px;width: 90px;height: 40px"> <van-button type="warning" style="margin-right: 10px;border-radius: 5px;width: 90px;height: 40px">
不同意 不同意
</van-button> </van-button>
<van-button type="success" style="border-radius: 5px;width: 90px;height: 40px" native-type="submit"> <van-button type="success" style="border-radius: 5px;width: 95px;height: 40px" native-type="submit">
重新报名 重新报名
</van-button> </van-button>
</div> </div>
...@@ -79,6 +91,8 @@ const grade = ref(''); ...@@ -79,6 +91,8 @@ const grade = ref('');
const classes = ref(''); const classes = ref('');
const name = ref(''); const name = ref('');
const sex = ref(''); const sex = ref('');
const cardid = ref('');
const phone = ref('');
const hobby = ref(''); const hobby = ref('');
const reason = ref(''); const reason = ref('');
const status = ref(''); const status = ref('');
...@@ -98,20 +112,32 @@ onMounted(async ()=>{ ...@@ -98,20 +112,32 @@ onMounted(async ()=>{
reason.value = result.data.reason reason.value = result.data.reason
reason.value = result.data.reason reason.value = result.data.reason
status.value = result.data.status status.value = result.data.status
phone.value = result.data.phone
cardid.value = result.data.cardid
} }
console.log('result',result) console.log('result',result)
}) })
const goback = () => { const goback = () => {
router.back() router.back()
} }
const onSubmit = (values) => { const onSubmit = async (values) => {
console.log('submit', values); console.log('submit', values);
values.cid = route.query.id; values.cid = route.query.id;
values.orgName = route.query.name values.orgName = route.query.name
values.userId = store.state.userInfo.userId values.userId = store.state.userInfo.userId
console.log('values',values) console.log('values',values)
let addResult = await addClubApply(values)
console.log('addResult',addResult)
if(addResult.code == 200){
router.back()
}
}; };
//重新报名
const resubmit = () => {
// hobby.value = '';
// reason.value = '';
}
</script> </script>
<style scoped> <style scoped>
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
</div> </div>
<div class="swiper"> <div class="swiper">
<van-swipe class="my-swipe" :autoplay="3000" indicator-color="white" > <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white" >
<van-swipe-item v-for="(item,index) in 6" :key="index">{{ index }}</van-swipe-item> <van-swipe-item v-for="(item,index) in content" :key="index">
<img :src="item" />
</van-swipe-item>
<!-- <van-swipe-item v-for="(item,index) in content" :key="index">{{ index }}</van-swipe-item>--> <!-- <van-swipe-item v-for="(item,index) in content" :key="index">{{ index }}</van-swipe-item>-->
</van-swipe> </van-swipe>
...@@ -42,7 +44,13 @@ onMounted( async () => { ...@@ -42,7 +44,13 @@ onMounted( async () => {
if(result.code == 200){ if(result.code == 200){
aim.value = result.data.aim aim.value = result.data.aim
intro.value = result.data.intro intro.value = result.data.intro
content.value = result.data.imgs if(result.data.imgs){
content.value = result.data.imgs.split(',').map(item => {
return item.replace('dev-api','wx_api')
})
}
console.log('content.value',content.value)
} }
}) })
//社团报名按钮 //社团报名按钮
...@@ -68,9 +76,9 @@ const goback = () => { ...@@ -68,9 +76,9 @@ const goback = () => {
.my-swipe .van-swipe-item { .my-swipe .van-swipe-item {
color: #fff; color: #fff;
font-size: 20px; font-size: 20px;
line-height: 150px; /*line-height: 150px;*/
text-align: center; text-align: center;
background-color: #39a9ed; /*background-color: #39a9ed;*/
} }
.title{ .title{
font-size: 14px; font-size: 14px;
......
...@@ -9,12 +9,15 @@ ...@@ -9,12 +9,15 @@
> >
<div class="clubWrap"> <div class="clubWrap">
<div class="clubItem" v-for="item in list" :key="item.id"> <div class="clubItem" v-for="item in list" :key="item.id">
<div style="position: relative" @click="toDetail(item.id,item.name)"> <div style="position: relative;width: 100%;height: 100%" @click="toDetail(item.id,item.name)" >
<div class="image"> <div class="image">
<van-image <van-image
fit="contain" fit="fill"
position="center"
width="100%"
height="100%"
radius="10" radius="10"
:src='item.src' :src="item.imgs == null ? '':item.imgs.split(',')[0].replace('dev-api','wx_api')"
/> />
</div> </div>
<div class="clubName">{{ item.name }}</div> <div class="clubName">{{ item.name }}</div>
...@@ -55,8 +58,8 @@ const onLoad = async () => { ...@@ -55,8 +58,8 @@ const onLoad = async () => {
if (result.code == 200) { if (result.code == 200) {
loading.value = false; loading.value = false;
list.value = result.data list.value = result.data
imgArr.value = result.data.map(item => item.imgs) // imgArr.value = result.data.map(item => item.imgs)
// src.value = imgArr.value.map(item => ) imgArr.value = result.data.imgs
finished.value = true finished.value = true
}else { }else {
Toast("获取信息失败!"); Toast("获取信息失败!");
...@@ -100,10 +103,13 @@ const goback = () => { ...@@ -100,10 +103,13 @@ const goback = () => {
.clubItem { .clubItem {
width: 50%; width: 50%;
height: 130px;
margin-bottom: 20px; margin-bottom: 20px;
} }
.image { .image {
width: 90%;
height: 100px;
margin-right: 20px; margin-right: 20px;
border-radius: 10px; border-radius: 10px;
border: 1px solid silver; border: 1px solid silver;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
@click-tab="onClickTab" @click-tab="onClickTab"
title-inactive-color="#969799" title-inactive-color="#969799"
title-active-color="#39befe" title-active-color="#39befe"
v-model:active="active" v-model:active="activeName"
style="height: 44px" style="height: 44px"
> >
<van-tab <van-tab
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
font-size:14px; font-size:14px;
text-align:center;" text-align:center;"
title="夏季时刻" title="夏季时刻"
name="1"
><div ><div
style=" style="
background: #ffffff; background: #ffffff;
...@@ -67,6 +68,7 @@ text-align:center;" ...@@ -67,6 +68,7 @@ text-align:center;"
font-size:14px; font-size:14px;
text-align:center;" text-align:center;"
title="冬季时刻" title="冬季时刻"
name="0"
><div ><div
style=" style="
background: #ffffff; background: #ffffff;
...@@ -126,7 +128,7 @@ import { ...@@ -126,7 +128,7 @@ import {
getTimeList, getTimeList,
} from "@/service/home"; } from "@/service/home";
const router = useRouter(); const router = useRouter();
const active = ref(0); const activeName = ref('');
const nowtime = ref(); const nowtime = ref();
const onClickTab = ({ title }) => { const onClickTab = ({ title }) => {
getDetail(); getDetail();
...@@ -137,17 +139,20 @@ onMounted(async () => { ...@@ -137,17 +139,20 @@ onMounted(async () => {
if (result2.code == 200) { if (result2.code == 200) {
nowtime.value = result2.rows; nowtime.value = result2.rows;
if (result2.rows[0].isUsed == "1") { if (result2.rows[0].isUsed == "1") {
active.value = 0; activeName.value = '0';
getDetail(); getDetail();
} else { } else {
active.value = 1; activeName.value = '1';
getDetail(); getDetail();
} }
} }
}); });
const detail = ref(); const detail = ref();
const getDetail = async () => { const getDetail = async () => {
let result = await getTimeDetail(nowtime.value[active.value].id); console.log('nowtime.value',nowtime.value)
console.log('active.value',activeName.value)
let result = await getTimeDetail(nowtime.value[activeName.value].id);
console.log('result',result)
detail.value = result.rows; detail.value = result.rows;
}; };
const goback = () => { const goback = () => {
......
...@@ -337,10 +337,11 @@ const onGetPics = async () => { ...@@ -337,10 +337,11 @@ const onGetPics = async () => {
let result = await schoolPiclist(); let result = await schoolPiclist();
if (result.code == 200) { if (result.code == 200) {
let getData = result.data; let getData = result.data;
console.log('getData',getData)
console.log('href',window.location) console.log('href',window.location)
const href = window.location.origin const href = window.location.origin
const url = getData.map(item => { const url = getData.map(item => {
return href + '/csimges/' +item return href + '/wx_api' +item
}) })
console.log('url',url) console.log('url',url)
state.picList = url; state.picList = url;
......
...@@ -452,12 +452,12 @@ export default { ...@@ -452,12 +452,12 @@ export default {
//localStorage.clear(); //localStorage.clear();
Toast.success("退出成功"); Toast.success("退出成功");
//测试服务器 //测试服务器
console.log('window',window) // console.log('window',window)
window.location.href = window.location.href.split('?')[0] // window.location.href = window.location.href.split('?')[0]
// router.push({ router.push({
// path: "/login", path: "/login",
// query: {}, query: {},
// }); });
}) })
.catch(() => {}); .catch(() => {});
}; };
......
...@@ -320,14 +320,14 @@ export default { ...@@ -320,14 +320,14 @@ export default {
Toast.success("退出成功"); Toast.success("退出成功");
console.log('openId',store) console.log('openId',store)
//测试服务器 //测试服务器
console.log('window',window) // console.log('window',window)
window.location.href = window.location.href.split('?')[0] // window.location.href = window.location.href.split('?')[0]
// router.replace({ router.replace({
// path: "/login", path: "/login",
// query: { query: {
// isLogout:1 isLogout:1
// }, },
// }); });
}) })
.catch(() => {}); .catch(() => {});
}) })
......
...@@ -508,7 +508,7 @@ import { reactive, onMounted, toRefs, ref } from "vue"; ...@@ -508,7 +508,7 @@ import { reactive, onMounted, toRefs, ref } from "vue";
import {} from "@/service/home"; import {} from "@/service/home";
import { useStore } from "vuex"; import { useStore } from "vuex";
import { Toast } from "vant"; import { Toast } from "vant";
import { useRouter } from "vue-router"; import {useRoute, useRouter} from "vue-router";
import { formatDate } from "@/utils/time"; import { formatDate } from "@/utils/time";
// import Tabbar from "@/components/tabbar"; // import Tabbar from "@/components/tabbar";
import image1 from "@/assets/swiper1.jpeg" import image1 from "@/assets/swiper1.jpeg"
...@@ -535,6 +535,7 @@ import { ...@@ -535,6 +535,7 @@ import {
getStudentInfo,//学生选课信息查询 getStudentInfo,//学生选课信息查询
} from "@/service/studentCourseSelection"; } from "@/service/studentCourseSelection";
import {getGradeId} from '@/service/laboratoryManagement' import {getGradeId} from '@/service/laboratoryManagement'
import * as dd from 'dingtalk-jsapi';
export default { export default {
name: "Home", name: "Home",
...@@ -555,6 +556,7 @@ export default { ...@@ -555,6 +556,7 @@ export default {
gradeListOption: [], gradeListOption: [],
}); });
const router = useRouter(); const router = useRouter();
const route = useRoute()
const store = useStore(); const store = useStore();
const stuOption = []; const stuOption = [];
const parentShow = ref(false); // 家长端内容是否显示 家长登录true 显示 const parentShow = ref(false); // 家长端内容是否显示 家长登录true 显示
...@@ -564,6 +566,7 @@ export default { ...@@ -564,6 +566,7 @@ export default {
}; };
const courseStartTime = ref(); const courseStartTime = ref();
const courseEndTime = ref(); const courseEndTime = ref();
const roleType = ref()
const loadData = async () => { const loadData = async () => {
console.log("加载数据", store); console.log("加载数据", store);
goCalendar(); goCalendar();
...@@ -578,7 +581,35 @@ export default { ...@@ -578,7 +581,35 @@ export default {
onInitData(); onInitData();
} }
}; };
//系统返回按钮退出页面
// const returnBtn = () => {
//
// const u = navigator.userAgent
// const that = this
// const isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
// if (isiOS) {
// dd.biz.navigation.setLeft({
// control: true,
// onSuccess: function () {
// // if (that.$route.path === '/institution') {
// // dd.biz.navigation.close()
// // } else {
// // window.history.back()
// // }
// }
// })
// } else {
// // document.addEventListener('backbutton', function () {
// // if (that.$route.path === '/institution') {
// // dd.biz.navigation.close()
// // }
// // })
// }
// };
onMounted(async () => { onMounted(async () => {
console.log('route',route)
console.log('store',store)
// roleType.value = route.query.roleType
// var ws = new WebSocket("ws:/ws/webSocket/{userId}"); // var ws = new WebSocket("ws:/ws/webSocket/{userId}");
loadData(); loadData();
let result = await getTerm(); let result = await getTerm();
...@@ -591,6 +622,7 @@ export default { ...@@ -591,6 +622,7 @@ export default {
state.typ = type; state.typ = type;
//访问后台接口 //访问后台接口
if (type == 1) { if (type == 1) {
console.log('type',type)
parentShow.value = true; parentShow.value = true;
initGradeList(); initGradeList();
let result = await getparentPushList({ let result = await getparentPushList({
...@@ -605,6 +637,8 @@ export default { ...@@ -605,6 +637,8 @@ export default {
return; return;
} }
} else if (type == 0) { } else if (type == 0) {
console.log('type',type)
teacherShow.value = true; teacherShow.value = true;
let result = await getteacherPushList({ pageNum: 1, pageSize: 2 }); let result = await getteacherPushList({ pageNum: 1, pageSize: 2 });
if (result.code == 200) { if (result.code == 200) {
...@@ -677,11 +711,14 @@ export default { ...@@ -677,11 +711,14 @@ export default {
store.commit("editTeacherName", userInfo.teacherName); store.commit("editTeacherName", userInfo.teacherName);
store.commit("edituserInfo", userInfo); store.commit("edituserInfo", userInfo);
console.log('userInfo666',userInfo) console.log('userInfo666',userInfo)
if(getGradeId.value == '0'){
let gradeId = await getGradeId(userInfo.userId) let gradeId = await getGradeId(userInfo.userId)
console.log('gradeId',gradeId) console.log('gradeId',gradeId)
if(gradeId.code == 200){ if(gradeId.code == 200){
store.commit("editGradeId", gradeId.data); store.commit("editGradeId", gradeId.data);
} }
}
onInitData(); onInitData();
} }
}; };
......
...@@ -17,6 +17,24 @@ ...@@ -17,6 +17,24 @@
placeholder="标题默认姓名类别时间" placeholder="标题默认姓名类别时间"
readonly readonly
/> />
<van-field
label="级部/处室"
v-model="state.applyOrgname"
rows="1"
autosize
type="textarea"
placeholder="级部/处室"
readonly
/>
<van-field
label="级部/处室主任"
v-model="state.handUserName1"
rows="1"
autosize
type="textarea"
placeholder="级部/处室主任"
readonly
/>
<!--非老师 --> <!--非老师 -->
<van-field <van-field
v-if="employeeType == '1'" v-if="employeeType == '1'"
...@@ -36,7 +54,7 @@ ...@@ -36,7 +54,7 @@
position="bottom" position="bottom"
> >
<van-datetime-picker <van-datetime-picker
v-model="state.startTime"
type="datetime" type="datetime"
@confirm="onConfirm1" @confirm="onConfirm1"
title="请选择时间" title="请选择时间"
...@@ -63,7 +81,7 @@ ...@@ -63,7 +81,7 @@
position="bottom" position="bottom"
> >
<van-datetime-picker <van-datetime-picker
v-model="state.endTimeShow"
type="datetime" type="datetime"
@confirm="onConfirm2" @confirm="onConfirm2"
title="请选择时间" title="请选择时间"
...@@ -91,7 +109,6 @@ ...@@ -91,7 +109,6 @@
position="bottom" position="bottom"
> >
<van-datetime-picker <van-datetime-picker
v-model="state.startTime"
type="date" type="date"
@change="onchange1" @change="onchange1"
@confirm="onConfirm1" @confirm="onConfirm1"
...@@ -124,7 +141,6 @@ ...@@ -124,7 +141,6 @@
@cancel="showapplystartSort = false" @cancel="showapplystartSort = false"
/> />
</van-popup> </van-popup>
<van-field <van-field
v-if="employeeType == '0'" v-if="employeeType == '0'"
required required
...@@ -143,7 +159,6 @@ ...@@ -143,7 +159,6 @@
position="bottom" position="bottom"
> >
<van-datetime-picker <van-datetime-picker
v-model="state.endTimeShow"
type="date" type="date"
@change="onchange2" @change="onchange2"
@confirm="onConfirm2" @confirm="onConfirm2"
...@@ -189,42 +204,42 @@ ...@@ -189,42 +204,42 @@
@click="showPicker = true" @click="showPicker = true"
:rules="[{ required: true, message: '请选择类型' }]" :rules="[{ required: true, message: '请选择类型' }]"
/> />
<van-field <!-- <van-field-->
required <!-- required-->
v-model="state.applyOrgname" <!-- v-model="state.applyOrgname"-->
is-link <!-- is-link-->
readonly <!-- readonly-->
name="picker" <!-- name="picker"-->
label="级部/处室" <!-- label="级部/处室"-->
placeholder="点击选择级部/处室" <!-- placeholder="点击选择级部/处室"-->
@click="showapplyOrgnamePicker = true" <!-- @click="showapplyOrgnamePicker = true"-->
:rules="[{ required: true, message: '请选择级部/处室' }]" <!-- :rules="[{ required: true, message: '请选择级部/处室' }]"-->
/> <!-- />-->
<van-popup v-model:show="showapplyOrgnamePicker" position="bottom"> <!-- <van-popup v-model:show="showapplyOrgnamePicker" position="bottom">-->
<van-picker <!-- <van-picker-->
:columns="state.gradeOfficeList" <!-- :columns="state.gradeOfficeList"-->
@confirm="onConfirmapplyOrgname" <!-- @confirm="onConfirmapplyOrgname"-->
@cancel="showapplyOrgnamePicker = false" <!-- @cancel="showapplyOrgnamePicker = false"-->
/> <!-- />-->
</van-popup> <!-- </van-popup>-->
<van-field <!-- <van-field-->
v-model="state.handUserName1" <!-- v-model="state.handUserName1"-->
is-link <!-- is-link-->
readonly <!-- readonly-->
name="picker" <!-- name="picker"-->
label="级部/处室主任" <!-- label="级部/处室主任"-->
placeholder="点击选择级部/处室主任" <!-- placeholder="点击选择级部/处室主任"-->
@click="showhandUserName1Picker = true" <!-- @click="showhandUserName1Picker = true"-->
/> <!-- />-->
<!-- :rules="[{ required: true, message: '请选择级部/处室主任' }]" --> <!-- :rules="[{ required: true, message: '请选择级部/处室主任' }]" -->
<van-popup v-model:show="showhandUserName1Picker" position="bottom"> <!-- <van-popup v-model:show="showhandUserName1Picker" position="bottom">-->
<van-picker <!-- <van-picker-->
:columns="state.gradeOfficeDirectorList" <!-- :columns="state.gradeOfficeDirectorList"-->
@confirm="onConfirmhandUserName1" <!-- @confirm="onConfirmhandUserName1"-->
@cancel="showhandUserName1Picker = false" <!-- @cancel="showhandUserName1Picker = false"-->
/> <!-- />-->
</van-popup> <!-- </van-popup>-->
<van-field <van-field
required required
v-if="state.totalTime >= 0.5" v-if="state.totalTime >= 0.5"
...@@ -319,7 +334,7 @@ ...@@ -319,7 +334,7 @@
<script setup> <script setup>
import { onMounted, ref } from "vue"; import { onMounted, ref } from "vue";
import { Dialog, Toast } from "vant"; import { Dialog, Toast } from "vant";
import { useRouter } from "vue-router"; import {useRoute, useRouter} from "vue-router";
import { useStore } from "vuex"; import { useStore } from "vuex";
import { import {
getleavtyp, getleavtyp,
...@@ -352,7 +367,7 @@ const state = ref({ ...@@ -352,7 +367,7 @@ const state = ref({
leaveReason: "", //请假原因 leaveReason: "", //请假原因
startTime: "", //开始时间 startTime: "", //开始时间
endTime: "", //结束时间 endTime: "", //结束时间
totalTime: "", //请假时长 totalTime: 0, //请假时长
startTimeShow: false, //开始时间选择显示 startTimeShow: false, //开始时间选择显示
endTimeShow: false, //开始时间选择显示 endTimeShow: false, //开始时间选择显示
totalTimeText: "", //请假时长显示 totalTimeText: "", //请假时长显示
...@@ -367,11 +382,11 @@ const state = ref({ ...@@ -367,11 +382,11 @@ const state = ref({
schoolLeaderList: [], schoolLeaderList: [],
endSort: null, endSort: null,
startSort: null, startSort: null,
totalTime: 0,
}); });
const employeeType = ref(0); const employeeType = ref();
const router = useRouter(); const router = useRouter();
const route = useRoute()
const store = useStore(); const store = useStore();
const columns = ref([]); const columns = ref([]);
// 提交表单 // 提交表单
...@@ -392,7 +407,7 @@ const formatter = (type, val) => { ...@@ -392,7 +407,7 @@ const formatter = (type, val) => {
return val; return val;
}; };
const loadData = async () => { const loadData = async () => {
getGradeOffice(); // getGradeOffice();
schoolLeader(); schoolLeader();
let result = await getleavtyp(); let result = await getleavtyp();
if (result.code == 200) { if (result.code == 200) {
...@@ -409,10 +424,11 @@ const loadData = async () => { ...@@ -409,10 +424,11 @@ const loadData = async () => {
}; };
const courseNumss = ref([]); const courseNumss = ref([]);
onMounted(async () => { onMounted(async () => {
console.log("3- 组件挂在完毕执行 --- onMounted"); state.value.applyOrgname = route.query.deptName
state.value.handUserName1 = route.query.name
loadData(); loadData();
console.log('route',route)
employeeType.value = store.state.userInfo.employeeType; employeeType.value = route.query.type;
let result = await getcourseNum(); let result = await getcourseNum();
courseNumss.value = result.data; courseNumss.value = result.data;
for (let index = 0; index < result.data.length; index++) { for (let index = 0; index < result.data.length; index++) {
...@@ -448,7 +464,9 @@ const onConfirmapplyOrgname = async (value) => { ...@@ -448,7 +464,9 @@ const onConfirmapplyOrgname = async (value) => {
const courseNums = ref([]); const courseNums = ref([]);
const getcourseNums = (tiem, Sort) => { const getcourseNums = (tiem, Sort) => {
console.log(tiem, Sort); console.log(tiem, Sort);
if (store.state.userInfo.employeeType == 0) { // if (store.state.userInfo.employeeType == 0) {
if (employeeType.value == 0) {
for (let index = 0; index < courseNums.value.length; index++) { for (let index = 0; index < courseNums.value.length; index++) {
const element = courseNums.value[index]; const element = courseNums.value[index];
if (courseNums.value[index].id == Sort) { if (courseNums.value[index].id == Sort) {
...@@ -590,7 +608,7 @@ const getTotalTimes = async () => { ...@@ -590,7 +608,7 @@ const getTotalTimes = async () => {
(state.value.startSort != null) & (state.value.startSort != null) &
(state.value.endSort != null) (state.value.endSort != null)
) { ) {
let result = await getTotalTime(state.value); let result = await getTotalTime(state.value,route.query.type);
state.value.totalTime = result.data; state.value.totalTime = result.data;
state.value.dayCourse = result.dayCourse; state.value.dayCourse = result.dayCourse;
} }
...@@ -698,8 +716,13 @@ const submitApplyadd = () => { ...@@ -698,8 +716,13 @@ const submitApplyadd = () => {
forbidClick: true, forbidClick: true,
}); });
console.log(valid); console.log(valid);
console.log('postForm.value',postForm.value)
console.log('state.value',state.value)
addteatcherleave({ addteatcherleave({
...state.value, ...state.value,
applyOrgid:route.query.deptId,
applyType:route.query.type,
teacherId: store.state.userInfo.userId, teacherId: store.state.userInfo.userId,
teacherName: store.state.userInfo.teacherName, teacherName: store.state.userInfo.teacherName,
startTime: formatDatetime(new Date(state.value.startTime.replace(/-/g, "/"))), startTime: formatDatetime(new Date(state.value.startTime.replace(/-/g, "/"))),
...@@ -728,6 +751,8 @@ const submitApplypost = () => { ...@@ -728,6 +751,8 @@ const submitApplypost = () => {
console.log(valid); console.log(valid);
postteatcherleavel({ postteatcherleavel({
...state.value, ...state.value,
applyOrgid:route.query.deptId,
applyType:route.query.type,
teacherId: store.state.userInfo.userId, teacherId: store.state.userInfo.userId,
teacherName: store.state.userInfo.teacherName, teacherName: store.state.userInfo.teacherName,
startTime: formatDatetime(new Date(state.value.startTime.replace(/-/g, "/"))), startTime: formatDatetime(new Date(state.value.startTime.replace(/-/g, "/"))),
......
...@@ -207,12 +207,22 @@ ...@@ -207,12 +207,22 @@
</div> </div>
</van-list> </van-list>
</van-pull-refresh> </van-pull-refresh>
<van-dialog v-model:show="showDialog" title="请选择部门" show-cancel-button @confirm="confirmDialog">
<van-radio-group style="justify-content: space-around;margin: 20px 0" v-model="dialogChecked">
<div style="margin-left: 40px" v-for="(item,index) in typeResult" :key="index">
<van-radio style="margin-bottom: 10px;" :name="item" >{{item.deptName}}
</van-radio>
</div>
</van-radio-group>
</van-dialog>
</template> </template>
<script setup> <script setup>
import { ref, toRefs, computed, reactive, onMounted } from "vue"; import { ref, toRefs, computed, reactive, onMounted } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { import {
getDeptGrapRole,
getUserDept,
teacherLeavelist, teacherLeavelist,
getcourseNum, getcourseNum,
teacherLeavetaskDoneList, teacherLeavetaskDoneList,
...@@ -220,18 +230,23 @@ import { ...@@ -220,18 +230,23 @@ import {
deleteteatcherleave, deleteteatcherleave,
postTeatcherleave, postTeatcherleave,
} from "@/service/home"; } from "@/service/home";
import { Toast } from "vant"; import { Dialog, Toast } from "vant";
import axios from "axios"; import axios from "axios";
import { useStore } from "vuex"; import { useStore } from "vuex";
import { formatDatetime, formatDate } from "@/utils/time.js"; import { formatDatetime, formatDate } from "@/utils/time.js";
const typeResult = ref([]);
const VanDialog = Dialog.Component;
const store = useStore(); const store = useStore();
const router = useRouter(); const router = useRouter();
const dialogChecked = ref();
const state = reactive({ const state = reactive({
searchText: "", searchText: "",
typeId: "", typeId: "",
optionId: 0, optionId: 0,
}); });
const showDialog = ref(false);
const tab = ref([{ title: "全部" }, { title: "已提交" }, { title: "未提交" }]); const tab = ref([{ title: "全部" }, { title: "已提交" }, { title: "未提交" }]);
const option = []; const option = [];
const value1 = ref(0); const value1 = ref(0);
...@@ -364,6 +379,10 @@ onMounted(async () => { ...@@ -364,6 +379,10 @@ onMounted(async () => {
loadData(); loadData();
let result = await getcourseNum(); let result = await getcourseNum();
courseNums.value = result.data; courseNums.value = result.data;
let deptResult = await getUserDept(store.state.userInfo.userId);
console.log('deptResult',deptResult)
typeResult.value = deptResult.data
console.log('typeResult.value',typeResult.value)
}); });
const goDetails = (item) => { const goDetails = (item) => {
// if (item.state === "2") { // if (item.state === "2") {
...@@ -405,14 +424,36 @@ const resolveType = computed(() => { ...@@ -405,14 +424,36 @@ const resolveType = computed(() => {
const goback = () => { const goback = () => {
router.back(); router.back();
}; };
//新增按钮
const goLeaveApply = (g) => { const goLeaveApply = (g) => {
/* 跳转 请假流程发起 */ showDialog.value = true
};
//确认弹框
const confirmDialog = async () => {
console.log('确认',dialogChecked.value)
let roleResult = await getDeptGrapRole(dialogChecked.value.deptName,dialogChecked.value.deptId)
console.log('roleResult',roleResult)
// /* 跳转 请假流程发起 */
store.commit("editApply", ""); store.commit("editApply", "");
router.push({ router.push({
path: "/askForLeaveapply", path: "/askForLeaveapply",
query: {}, query: {
type: roleResult.data.employeeType,
name: roleResult.data.userName,
deptName:dialogChecked.value.deptName,
deptId:dialogChecked.value.deptId
},
}); });
}; }
// const goLeaveApply = (g) => {
// /* 跳转 请假流程发起 */
// store.commit("editApply", "");
// router.push({
// path: "/askForLeaveapply",
// query: {},
// });
// };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
......
<template> <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 v-if="leaderRole == true">--> <div v-if="leaderRole == true">
<div class="recordBlock" @click="toPage(1)"> <div class="recordBlock" @click="toPage(1)">
<van-image class="leftImg" :src="require('../../../assets/icon/record.png')"/> <van-image class="leftImg" :src="require('../../../assets/icon/record.png')"/>
<div>教师实验室统计</div> <div>教师实验室统计</div>
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<van-image class="leftImg" :src="require('../../../assets/icon/statistics.png')"/> <van-image class="leftImg" :src="require('../../../assets/icon/statistics.png')"/>
<div>实验室完成情况统计</div> <div>实验室完成情况统计</div>
</div> </div>
<!-- </div>--> </div>
<!--实验室管理员 --> <!--实验室管理员 -->
<!-- <div v-if="managerRole == true">--> <div v-if="managerRole == true">
<div class="orderBlock" @click="toPage(3)"> <div class="orderBlock" @click="toPage(3)">
<van-image class="leftImg" :src="require('../../../assets/icon/order.png')"/> <van-image class="leftImg" :src="require('../../../assets/icon/order.png')"/>
<div>年级实验预约</div> <div>年级实验预约</div>
...@@ -29,14 +29,14 @@ ...@@ -29,14 +29,14 @@
<van-image class="leftImg" :src="require('../../../assets/icon/personal.png')"/> <van-image class="leftImg" :src="require('../../../assets/icon/personal.png')"/>
<div>个人实验审批</div> <div>个人实验审批</div>
</div> </div>
<!-- </div>--> </div>
<!-- <div class="competitionBlock" @click="toPage(7)">--> <!-- <div class="competitionBlock" @click="toPage(7)">-->
<!-- <van-image class="leftImg" :src="require('../../../assets/icon/competition.png')"/>--> <!-- <van-image class="leftImg" :src="require('../../../assets/icon/competition.png')"/>-->
<!-- <div>实验室竞赛</div>--> <!-- <div>实验室竞赛</div>-->
<!-- </div>--> <!-- </div>-->
<!--级部申请--> <!--级部申请-->
<!-- <div v-if="levelPartRole == true">--> <div v-if="levelPartRole == true">
<div class="levelOrderBlock" @click="toPage(8)"> <div class="levelOrderBlock" @click="toPage(8)">
<van-image class="leftImg" :src="require('../../../assets/icon/level.png')"/> <van-image class="leftImg" :src="require('../../../assets/icon/level.png')"/>
<div>年级实验室预约</div> <div>年级实验室预约</div>
...@@ -49,10 +49,10 @@ ...@@ -49,10 +49,10 @@
<van-image class="leftImg" :src="require('../../../assets/icon/levelFinish.png')"/> <van-image class="leftImg" :src="require('../../../assets/icon/levelFinish.png')"/>
<div>实验室完成情况明细</div> <div>实验室完成情况明细</div>
</div> </div>
<!-- </div>--> </div>
<!--教师申请--> <!--教师申请-->
<!-- <div v-if="teacherRole == true">--> <div v-if="teacherRole == true">
<div class="laboratoryBlock" @click="toPage(11)"> <div class="laboratoryBlock" @click="toPage(11)">
<van-image class="leftImg" :src="require('../../../assets/icon/laboratoryArrangement.png')"/> <van-image class="leftImg" :src="require('../../../assets/icon/laboratoryArrangement.png')"/>
<div>实验室安排</div> <div>实验室安排</div>
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<van-image class="leftImg" :src="require('../../../assets/icon/personalApplication.png')"/> <van-image class="leftImg" :src="require('../../../assets/icon/personalApplication.png')"/>
<div>个人实验室申请</div> <div>个人实验室申请</div>
</div> </div>
<!-- </div>--> </div>
</template> </template>
...@@ -90,37 +90,37 @@ const teacherRole = ref() ...@@ -90,37 +90,37 @@ const teacherRole = ref()
onMounted(()=>{ onMounted(()=>{
//查找角色 //查找角色
//领导-校领导 //领导-校领导
// rolesArr.find(item => { rolesArr.find(item => {
// if(item == 'schoolLeader'){ if(item == 'schoolLeader'){
// return leaderRole.value = true return leaderRole.value = true
// }else{ }else{
// leaderRole.value = false leaderRole.value = false
// } }
// }) })
// 级部-级部主任 // 级部-级部主任
// rolesArr.find(item => { rolesArr.find(item => {
// if(item == 'gradeLeader'){ if(item == 'gradeLeader'){
// return levelPartRole.value = true return levelPartRole.value = true
// }else{ }else{
// levelPartRole.value = false levelPartRole.value = false
// } }
// }) })
//实验室管理员 //实验室管理员
// rolesArr.find(item => { rolesArr.find(item => {
// if(item == 'phy_lab_admin' || item == 'che_lab_admin' || item == 'bio_lab_admin'){ if(item == 'phy_lab_admin' || item == 'che_lab_admin' || item == 'bio_lab_admin'){
// return managerRole.value = true return managerRole.value = true
// }else{ }else{
// managerRole.value = false managerRole.value = false
// } }
// }) })
//教师 //教师
// rolesArr.find(item => { rolesArr.find(item => {
// if(item == 'teacher'){ if(item == 'teacher'){
// return teacherRole.value = true return teacherRole.value = true
// }else{ }else{
// teacherRole.value = false teacherRole.value = false
// } }
// }) })
}) })
const toPage = (type) => { const toPage = (type) => {
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
finished-text="没有更多了" finished-text="没有更多了"
@load="onLoad" @load="onLoad"
> >
<div v-for="(item,index) in list" :key="index"> <div v-for="(item,index) in list" :key="index" style="position: relative;">
<div class="card" @click="toDetail(item.id)"> <div class="card" @click="toDetail(item.id)" style="padding-bottom: 20px">
<div class="topContent"> <div class="topContent">
<div class="topLeft"> <div class="topLeft">
<van-image v-if="item.sub == '1'" style="height: 20px;width: 20px;vertical-align: middle" <van-image v-if="item.sub == '1'" style="height: 20px;width: 20px;vertical-align: middle"
...@@ -42,8 +42,9 @@ ...@@ -42,8 +42,9 @@
style="font-size: 16px;font-weight: bold;padding-left: 5px">{{ item.sub == '1' ? '物理' : item.sub == '2' ? '化学' : '生物' }}研究</span> style="font-size: 16px;font-weight: bold;padding-left: 5px">{{ item.sub == '1' ? '物理' : item.sub == '2' ? '化学' : '生物' }}研究</span>
</div> </div>
<div class="topRight"> <div class="topRight">
<div v-if="item.declareState == '3'" class="unAssigned">已分配</div> <div v-if="item.declareState == '3'" class="assigned">已分配</div>
<div v-else class="assigned">未分配</div> <div v-if="item.declareState == '1'" class="declared">已申报</div>
<div v-if="item.declareState == '0'" class="unAssigned">未申报</div>
</div> </div>
</div> </div>
<div class="middleContent"> <div class="middleContent">
...@@ -63,14 +64,14 @@ ...@@ -63,14 +64,14 @@
</div> </div>
<div style="width: 40%;overflow: hidden; white-space: nowrap; text-overflow: ellipsis"> <div style="width: 40%;overflow: hidden; white-space: nowrap; text-overflow: ellipsis">
<span>实验室:</span> <span>实验室:</span>
<span>{{ item.labName }}</span> <span>{{ item.schoolTeacherExperimentApplyLabsList.map(item => item.labName).toString()}}</span>
</div> </div>
</div> </div>
<div class="bottomButton" v-if="item.declareState != '3'"> </div>
<div class="bottomButton" v-if="item.declareState == '0'" style="position: absolute;bottom: 0;right: 10px">
<van-button color="#e5c35d" size="small" class="edit" @click="toEdit(item.id)">修改</van-button> <van-button color="#e5c35d" size="small" class="edit" @click="toEdit(item.id)">修改</van-button>
<van-button type="danger" size="small" class="delete" @click="handleDelete(item.id)">删除</van-button> <van-button type="danger" size="small" class="delete" @click="handleDelete(item.id)">删除</van-button>
</div> <van-button type="primary" size="small" class="delete" @click="handleSubmit(item.id)">提交</van-button>
</div> </div>
</div> </div>
</van-list> </van-list>
...@@ -80,7 +81,7 @@ ...@@ -80,7 +81,7 @@
</template> </template>
<script setup> <script setup>
import {getPersonalLabApplyList,deleteApply} from '@/service/laboratoryManagement' import {getPersonalLabApplyList,deleteApply,applyToReport} from '@/service/laboratoryManagement'
import {reactive, onMounted, toRefs, ref} from "vue"; import {reactive, onMounted, toRefs, ref} from "vue";
import {useStore} from "vuex"; import {useStore} from "vuex";
...@@ -129,12 +130,14 @@ const onLoad = async () => { ...@@ -129,12 +130,14 @@ const onLoad = async () => {
} }
console.log('params', params) console.log('params', params)
//接口 //接口
let result = await getPersonalLabApplyList(params) let resultList = await getPersonalLabApplyList(params)
console.log('result', result) console.log('resultList', resultList)
if (result.code == 200) { if (resultList.code == 200) {
loading.value = false; loading.value = false;
list.value = result.data list.value = resultList.data;
finished.value = true finished.value = true
console.log(' list.value ', list.value )
} else { } else {
Toast("获取信息失败!"); Toast("获取信息失败!");
finished.value = true; finished.value = true;
...@@ -176,6 +179,24 @@ const toEdit = (id) => { ...@@ -176,6 +179,24 @@ const toEdit = (id) => {
const handleDelete = async (id) => { const handleDelete = async (id) => {
let result = await deleteApply(id) let result = await deleteApply(id)
console.log('result',result) console.log('result',result)
if(result.code == 200){
Toast.success("删除成功");
onRefresh()
}
}
//提交按钮
const handleSubmit = async (id) => {
console.log('id',id)
const params = {
id:id
}
let submitResult = await applyToReport(params)
console.log('submitResult',submitResult)
if(submitResult.code == 200){
Toast.success("提交成功");
onRefresh()
}
} }
//下拉刷新 //下拉刷新
const onRefresh = () => { const onRefresh = () => {
...@@ -238,7 +259,10 @@ const goback = () => { ...@@ -238,7 +259,10 @@ const goback = () => {
background: #00c15d; background: #00c15d;
border-radius: 10px; border-radius: 10px;
} }
.declared{
background: #ee870a;
border-radius: 10px;
}
.unAssigned { .unAssigned {
background: #4ea0fc; background: #4ea0fc;
border-radius: 10px; border-radius: 10px;
......
...@@ -6,24 +6,30 @@ ...@@ -6,24 +6,30 @@
<van-cell-group inset> <van-cell-group inset>
<van-field <van-field
v-model="formData.sub" v-model="formData.sub"
:readonly="name == '查看' ? true : false" readonly
label="学科" label="学科"
/> />
<van-field <van-field
:readonly="name == '查看' ? true : false" readonly
v-model="formData.grade" v-model="formData.grade"
label="级部" label="级部"
/> />
<van-field <van-field
:readonly="name == '查看' ? true : false" readonly
v-model="formData.semester" v-model="formData.semester"
label="学期" label="学期"
/> />
<van-field <van-field
v-if="name == '查看'" v-if="name == '查看'"
readonly readonly
v-model="formData.experimentTime" v-model="formData.plannedStartTime"
label="实验时间" label="计划开始时间"
/>
<van-field
v-if="name == '查看'"
readonly
v-model="formData.plannedEndTime"
label="计划结束时间"
/> />
<van-field <van-field
:readonly="name == '查看' ? true : false" :readonly="name == '查看' ? true : false"
...@@ -31,15 +37,27 @@ ...@@ -31,15 +37,27 @@
label="实验名称" label="实验名称"
/> />
<van-field <van-field
v-model="value" v-if="name == '新增' ||name =='修改'"
v-model="formData.plannedStartTime"
is-link
readonly
name="calendar"
label="计划开始时间"
placeholder="点击选择实验时间"
@click="showStartCalendar = true"
/>
<van-calendar v-model:show="showStartCalendar" @confirm="onConfirmStartTime" />
<van-field
v-if="name == '新增' ||name =='修改'"
v-model="formData.plannedEndTime"
is-link is-link
readonly readonly
name="calendar" name="calendar"
label="实验时间" label="计划结束时间"
placeholder="点击选择实验时间" placeholder="点击选择实验时间"
@click="showCalendar = true" @click="showEndCalendar = true"
/> />
<van-calendar v-model:show="showCalendar" type="range" @confirm="onConfirm" /> <van-calendar v-model:show="showEndCalendar" @confirm="onConfirmEndTime" />
<div v-if="name == '新增' ||name =='修改'"> <div v-if="name == '新增' ||name =='修改'">
<van-field <van-field
is-link is-link
...@@ -62,84 +80,84 @@ ...@@ -62,84 +80,84 @@
v-model="formData.experimentClassify" v-model="formData.experimentClassify"
label="实验分类" label="实验分类"
/> />
<van-field <!-- <van-field-->
:readonly="name == '查看' ? true : false" <!-- :readonly="name == '查看' ? true : false"-->
v-model="formData.chapterContent" <!-- v-model="formData.chapterContent"-->
label="章节内容" <!-- label="章节内容"-->
/> <!-- />-->
<div v-if="name == '新增' ||name =='修改'"> <!-- <div v-if="name == '新增' ||name =='修改'">-->
<van-field <!-- <van-field-->
v-model="formData.labName" <!-- v-model="formData.labName"-->
is-link <!-- is-link-->
readonly <!-- readonly-->
name="picker" <!-- name="picker"-->
label="实验室" <!-- label="实验室"-->
placeholder="选择实验室" <!-- placeholder="选择实验室"-->
@click="showPickerLab = true" <!-- @click="showPickerLab = true"-->
/> <!-- />-->
<van-popup v-model:show="showPickerLab" position="bottom"> <!-- <van-popup v-model:show="showPickerLab" position="bottom">-->
<van-picker <!-- <van-picker-->
:columns="columnsLab" <!-- :columns="columnsLab"-->
@confirm="onConfirmLab" <!-- @confirm="onConfirmLab"-->
@cancel="showPickerLab = false" <!-- @cancel="showPickerLab = false"-->
/> <!-- />-->
</van-popup> <!-- </van-popup>-->
</div> <!-- </div>-->
<van-field <van-field
v-if="name == '查看'" v-if="name == '查看'"
readonly readonly
v-model="formData.labName" v-model="formData.labName"
label="实验室" label="实验室"
/> />
<div v-if="name == '新增' ||name =='修改'"> <!-- <div v-if="name == '新增' ||name =='修改'">-->
<van-field <!-- <van-field-->
v-model="formData.section" <!-- v-model="formData.section"-->
label="节次" <!-- label="节次"-->
readonly <!-- readonly-->
is-link <!-- is-link-->
placeholder="选择节次" <!-- placeholder="选择节次"-->
@click="showPickerSection = true" <!-- @click="showPickerSection = true"-->
/> <!-- />-->
<van-popup v-model:show="showPickerSection" position="bottom"> <!-- <van-popup v-model:show="showPickerSection" position="bottom">-->
<van-picker <!-- <van-picker-->
:columns="columnsSection" <!-- :columns="columnsSection"-->
@confirm="onConfirmSection" <!-- @confirm="onConfirmSection"-->
@cancel="showPickerSection = false" <!-- @cancel="showPickerSection = false"-->
/> <!-- />-->
</van-popup> <!-- </van-popup>-->
</div> <!-- </div>-->
<van-field <!-- <van-field-->
v-if="name == '查看'" <!-- v-if="name == '查看'"-->
readonly <!-- readonly-->
v-model="formData.section" <!-- v-model="formData.section"-->
label="节次" <!-- label="节次"-->
/> <!-- />-->
<div v-if="name == '新增' ||name =='修改'"> <!-- <div v-if="name == '新增' ||name =='修改'">-->
<van-field <!-- <van-field-->
v-model="formData.className" <!-- v-model="formData.className"-->
label="班级" <!-- label="班级"-->
is-link <!-- is-link-->
readonly <!-- readonly-->
placeholder="选择班级" <!-- placeholder="选择班级"-->
@click="showPickerClass = true" <!-- @click="showPickerClass = true"-->
/> <!-- />-->
<van-popup v-model:show="showPickerClass" position="bottom"> <!-- <van-popup v-model:show="showPickerClass" position="bottom">-->
<van-picker <!-- <van-picker-->
:columns="columnsClass" <!-- :columns="columnsClass"-->
@confirm="onConfirmClass" <!-- @confirm="onConfirmClass"-->
@cancel="showPickerClass = false" <!-- @cancel="showPickerClass = false"-->
/> <!-- />-->
</van-popup> <!-- </van-popup>-->
</div> <!-- </div>-->
<div> <!-- <div>-->
<van-field <!-- <van-field-->
v-if="name == '查看'" <!-- v-if="name == '查看'"-->
readonly <!-- readonly-->
v-model="formData.className" <!-- v-model="formData.className"-->
label="班级" <!-- label="班级"-->
/> <!-- />-->
</div> <!-- </div>-->
<div style="margin: 10px"> <div style="margin: 10px">
<div style="font-size: 16px;margin: 8px;font-size: 14px;color: #646566">实验用品</div> <div style="font-size: 16px;margin: 8px;font-size: 14px;color: #646566">实验用品</div>
<van-field <van-field
...@@ -161,7 +179,7 @@ ...@@ -161,7 +179,7 @@
</div> </div>
<div v-else style="margin: 20px;display: flex;justify-content: center"> <div v-else style="margin: 20px;display: flex;justify-content: center">
<van-button style="margin-right: 50px;width: 90px;height: 30px" round type="primary" native-type="submit"> <van-button style="margin-right: 50px;width: 90px;height: 30px" round type="primary" @click="submit">
同意 同意
</van-button> </van-button>
<van-button style="width: 90px;height: 30px" round type="success" @click="goback"> <van-button style="width: 90px;height: 30px" round type="success" @click="goback">
...@@ -172,8 +190,7 @@ ...@@ -172,8 +190,7 @@
</template> </template>
<script setup> <script setup>
import { getPersonalApplyDetail, addPersonalApply,editApply, getLabList,getDicts } from '@/service/laboratoryManagement' import { getNewSchoolYear,getSubject,getGradeId,getPersonalApplyDetail, addPersonalApply,editApply, getLabList,getDicts } from '@/service/laboratoryManagement'
import { reactive, onMounted, toRefs, ref } from "vue"; import { reactive, onMounted, toRefs, ref } from "vue";
import { useStore } from "vuex"; import { useStore } from "vuex";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
...@@ -184,6 +201,10 @@ const router = useRouter(); ...@@ -184,6 +201,10 @@ const router = useRouter();
const route = useRoute(); const route = useRoute();
const title = ref('') const title = ref('')
const name = route.query.name const name = route.query.name
const submitSub = ref();
const gradeId = ref();
const submitSemester = ref();
const submitExperimentClassify = ref()
const formData = reactive({ const formData = reactive({
sub:'', sub:'',
grade:'', grade:'',
...@@ -191,19 +212,49 @@ const formData = reactive({ ...@@ -191,19 +212,49 @@ const formData = reactive({
experimentTime:'', experimentTime:'',
experimentName:'', experimentName:'',
experimentClassify:'', experimentClassify:'',
experimentClassifyId:'',
chapterContent:'', chapterContent:'',
laboratory:'',
labName:'', labName:'',
labNameId:'',
section:'', section:'',
sectionId:'',
className:'', className:'',
message:'' message:'',
plannedStartTime:'',
plannedEndTime:'',
}) })
//实验分类下拉框
const showPickerClassify = ref(false);
const columnsClassify = ref([]);
//实验室下拉框
const showPickerLab = ref(false);
const columnsLab = ref([]);
//节次下拉框
const showPickerSection = ref(false);
const columnsSection = ref([]);
//班级下拉框
const showPickerClass = ref(false);
const columnsClass = ref([]);
onMounted(async () => { onMounted(async () => {
console.log('store',store.state)
let gradeIdResult = await getGradeId(store.state.userInfo.userId)
if(gradeIdResult.code == 200){
gradeId.value = gradeIdResult.data
console.log('gradeId.value',gradeId.value)
}
if(route.query.id){ if(route.query.id){
console.log('route.query.id',route.query.id)
let detailResult = await getPersonalApplyDetail(route.query.id) let detailResult = await getPersonalApplyDetail(route.query.id)
console.log('detailResult',detailResult) console.log('detailResult',detailResult)
if(detailResult.code == 200){ if(detailResult.code == 200){
Object.assign(formData,detailResult.data) Object.assign(formData,detailResult.data)
submitSub.value = detailResult.data.sub
submitSemester.value = detailResult.data.semester
submitExperimentClassify.value = detailResult.data.experimentClassify
formData.sub = formData.sub == '1' ? '物理' : formData.sub == '2' ? '化学' : '生物'; formData.sub = formData.sub == '1' ? '物理' : formData.sub == '2' ? '化学' : '生物';
formData.semester = formData.semester == '1' ? '上学期' : '下学期'; formData.semester = formData.semester == '1' ? '上学期' : '下学期';
formData.experimentClassify = formData.experimentClassify == '1' ? '分组实验': formData.experimentClassify == '2' ? '演示实验' : '探究实验'; formData.experimentClassify = formData.experimentClassify == '1' ? '分组实验': formData.experimentClassify == '2' ? '演示实验' : '探究实验';
...@@ -216,6 +267,33 @@ onMounted(async () => { ...@@ -216,6 +267,33 @@ onMounted(async () => {
} }
}else{ }else{
title.value = '新增教师演示实验室申请' title.value = '新增教师演示实验室申请'
// 获取学科
let subjectResult = await getSubject()
console.log('subjectResult',subjectResult)
if(subjectResult.code == 200){
formData.sub = subjectResult.msg
}
//获取级部和学期
let schoolYearResult = await getNewSchoolYear()
// console.log('schoolYearResult',schoolYearResult)
if(schoolYearResult.code == 200){
submitSemester.value = schoolYearResult.semester
formData.grade = schoolYearResult.schoolYear
formData.semester = schoolYearResult.semester == "1" ? '上学期' : '下学期'
}
}
//实验类型下拉框
let classifyResult = await getDicts('experiment_classify')
console.log('classifyResult',classifyResult)
if(classifyResult.code == 200){
classifyResult.data.forEach(ele => {
columnsClassify.value.push({text:ele.dictLabel,value:ele.dictValue})
})
}
//实验室下拉框 //实验室下拉框
let labResult = await getLabList() let labResult = await getLabList()
console.log('labResult',labResult) console.log('labResult',labResult)
...@@ -228,50 +306,119 @@ onMounted(async () => { ...@@ -228,50 +306,119 @@ onMounted(async () => {
}) })
console.log('columnsLab.value',columnsLab.value) console.log('columnsLab.value',columnsLab.value)
}; };
//节次下拉框 //节次下拉框
let sectionResult = await getDicts('course_arrange') let sectionResult = await getDicts('course_arrange')
console.log('sectionResult',sectionResult) console.log('sectionResult',sectionResult)
if(sectionResult.code == 200){
//实验类型下拉框 sectionResult.data.forEach(ele => {
let classifyResult = await getDicts('experiment_classify') columnsSection.value.push({text:ele.dictLabel,value:ele.dictValue})
console.log('classifyResult',classifyResult) })
} }
}) })
//实验时间选择
const showCalendar = ref(false)
//实验分类下拉框 //实验类型选择
const showPickerClassify = ref(false);
const columnsClassify = ['杭州', '宁波', '温州', '嘉兴', '湖州'];
const onConfirmClassify = (value) => { const onConfirmClassify = (value) => {
console.log('value',value) console.log('value',value)
formData.classify = value; formData.experimentClassify = value.text;
formData.experimentClassifyId = value.value;
showPickerClassify.value = false; showPickerClassify.value = false;
}; };
//计划开始时间
const showStartCalendar = ref(false)
//计划开始时间确认
const onConfirmStartTime = (date) => {
formData.plannedStartTime = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
showStartCalendar.value = false;
}
//计划结束时间
const showEndCalendar = ref(false)
//计划结束时间确认
const onConfirmEndTime = (date) => {
formData.plannedEndTime = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
showEndCalendar.value = false;
}
//实验室分类下拉框 //实验室分类下拉框
const experimentNameId= ref('')
const showPickerLab = ref(false);
// const columnsLab = ['杭州', '宁波', '温州', '嘉兴', '湖州'];
const onConfirmLab = (value) => { const onConfirmLab = (value) => {
formData.labName = value.text; formData.labName = value.text;
experimentNameId.value = value.value; formData.labNameId = value.value;
showPickerLab.value = false; showPickerLab.value = false;
}; };
//节次分类下拉框 //节次分类下拉框
const showPickerSection = ref(false);
const columnsSection = ['杭州', '宁波', '温州', '嘉兴', '湖州'];
const onConfirmSection = (value) => { const onConfirmSection = (value) => {
formData.section = value; formData.section = value.text;
formData.sectionId = value.value;
showPickerSection.value = false; showPickerSection.value = false;
}; };
//班级分类下拉框 //班级分类下拉框
const showPickerClass = ref(false);
const columnsClass = ['杭州', '宁波', '温州', '嘉兴', '湖州'];
const onConfirmClass = (value) => { const onConfirmClass = (value) => {
formData.class = value; formData.class = value;
showPickerClass.value = false; showPickerClass.value = false;
}; };
//新增提交按钮
const submit = async () => {
console.log('gradeId.value',gradeId.value)
if(route.query.id){
console.log('修改')
const data = {
id:route.query.id,
sub:submitSub.value,
gradeId:gradeId.value,
grade:formData.grade,
schoolYear:formData.grade,
semester:submitSemester.value,
plannedStartTime:formData.plannedStartTime,
plannedEndTime:formData.plannedEndTime,
experimentName:formData.experimentName,
experimentClassify:submitExperimentClassify.value,
experimentUseGoods:formData.experimentUseGoods,
// labId:formData.labNameId,
// labName:formData.labName,
applyId:store.state.userInfo.userId,
applyName:store.state.userInfo.teacherName,
applyTime:formatDate(new Date()),
}
console.log('修改data',data)
let editResult = await editApply(data)
console.log('editResult',editResult)
if(editResult.code == 200){
Toast.success('修改成功')
router.back();
}
}else{
console.log('新增')
// console.log('gradeId.value',gradeId.value)
const data = {
sub:formData.sub == '物理' ? '1' : formData.sub == '化学' ? '2' : '3',
gradeId:gradeId.value,
grade:formData.grade,
schoolYear:formData.grade,
semester:submitSemester.value,
plannedStartTime:formData.plannedStartTime,
plannedEndTime:formData.plannedEndTime,
experimentName:formData.experimentName,
experimentClassify:formData.experimentClassifyId,
experimentUseGoods:formData.experimentUseGoods,
// labId:formData.labNameId,
// labName:formData.labName,
applyId:store.state.userInfo.userId,
applyName:store.state.userInfo.teacherName,
applyTime:formatDate(new Date()),
}
console.log('新增data',data)
let addResult = await addPersonalApply(data)
console.log('addResult',addResult)
if(addResult.code == 200){
Toast.success('新增成功')
router.back();
}
}
}
......
...@@ -107,9 +107,9 @@ onMounted(async () => { ...@@ -107,9 +107,9 @@ onMounted(async () => {
console.log('result',result) console.log('result',result)
if(result.code == 200){ if(result.code == 200){
Object.assign(formData,result.data) Object.assign(formData,result.data)
form.sub = form.sub == '1' ? '物理' : form.sub == '2' ? '化学' : '生物'; formData.sub = formData.sub == '1' ? '物理' : formData.sub == '2' ? '化学' : '生物';
form.semester = form.semester == '1' ? '上学期' : '下学期'; formData.semester = formData.semester == '1' ? '上学期' : '下学期';
form.experimentClassify = form.experimentClassify == '1' ? '分组实验': form.experimentClassify == '2' ? '演示实验' : '探究实验'; formData.experimentClassify = formData.experimentClassify == '1' ? '分组实验': formData.experimentClassify == '2' ? '演示实验' : '探究实验';
}else{ }else{
Toast("获取信息失败!"); Toast("获取信息失败!");
} }
......
...@@ -42,21 +42,21 @@ ...@@ -42,21 +42,21 @@
<div class="middleContent"> <div class="middleContent">
<div style="width: 60%"> <div style="width: 60%">
<span>级部:</span> <span>级部:</span>
<span>2021级</span> <span>{{item.grade}}</span>
</div> </div>
<div style="width: 40%;"> <div style="width: 40%;">
<span>学期:</span> <span>学期:</span>
<span>2022下学期</span> <span>{{ item.schoolYear }}{{item.semester == '1' ? '上学期' :'下学期'}}</span>
</div> </div>
</div> </div>
<div class="bottomContent" style="padding-bottom: 20px"> <div class="bottomContent" style="padding-bottom: 20px">
<div style="width: 60%"> <div style="width: 60%">
<span>实验时间:</span> <span>实验时间:</span>
<span>2023-08-16</span> <span>{{item.experimentTime}}</span>
</div> </div>
<div style="width: 40%;overflow: hidden; white-space: nowrap; text-overflow: ellipsis"> <div style="width: 40%;overflow: hidden; white-space: nowrap; text-overflow: ellipsis">
<span>实验室:</span> <span>实验室:</span>
<span>101、401、102、103、104</span> <span>{{ item.labName }}</span>
</div> </div>
</div> </div>
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
<van-form> <van-form>
<van-cell-group inset> <van-cell-group inset>
<van-field <van-field
v-model="formData.subject" v-model="formData.sub"
readonly readonly
label="学科" label="学科"
/> />
<van-field <van-field
readonly readonly
v-model="formData.level" v-model="formData.grade"
label="级部" label="级部"
/> />
<van-field <van-field
...@@ -22,19 +22,19 @@ ...@@ -22,19 +22,19 @@
<van-field <van-field
v-if="name == '查看'" v-if="name == '查看'"
readonly readonly
v-model="formData.time" v-model="formData.experimentTime"
label="实验时间" label="实验时间"
/> />
<van-field <van-field
readonly readonly
v-model="formData.name" v-model="formData.experimentName"
label="实验名称" label="实验名称"
/> />
<van-field <van-field
readonly readonly
v-model="formData.name" v-model="formData.experimentClassify"
label="实验分类" label="实验分类"
/> />
<!-- <div v-if="name == '申请'">--> <!-- <div v-if="name == '申请'">-->
...@@ -53,71 +53,56 @@ ...@@ -53,71 +53,56 @@
<!-- />--> <!-- />-->
<!-- </van-popup>--> <!-- </van-popup>-->
<!-- </div>--> <!-- </div>-->
<van-field <!-- <van-field-->
v-if="name == '查看'" <!-- v-if="name == '查看'"-->
readonly <!-- readonly-->
v-model="formData.classify" <!-- v-model="formData.experimentClassify"-->
label="实验分类" <!-- label="实验分类"-->
/> <!-- />-->
<van-field <van-field
readonly readonly
v-model="formData.chapter" v-model="formData.chapterContent"
label="章节内容" label="章节内容"
/> />
<div v-if="name == '申请'">
<van-field <van-field
v-model="formData.laboratory" v-if="name == '查看'"
is-link
readonly readonly
name="picker" v-model="formData.labName"
label="实验室" label="实验室"
placeholder="选择实验室"
@click="showPickerLab = true"
/> />
<van-popup v-model:show="showPickerLab" position="bottom"> <van-field
<van-picker v-if="name == '申请'"
:columns="columnsLab" readonly
@confirm="onConfirmLab" v-model="formData.plannedStartTime"
@cancel="showPickerLab = false" label="实验开始时间"
/> />
</van-popup>
</div>
<van-field <van-field
v-if="name == '查看'" v-if="name == '申请'"
readonly readonly
v-model="formData.laboratory" v-model="formData.plannedEndTime"
label="实验" label="实验结束时间"
/> />
<van-field <van-field
v-if="name == '申请'" v-if="name == '申请'"
v-model="formData.time" v-model="formData.experimentTime"
is-link is-link
readonly readonly
name="datetimePicker" name="calendar"
label="实验时间" label="实验时间"
placeholder="点击选择实验时间" placeholder="点击选择实验时间"
@click="showPickerTime = true" @click="showPickerTime = true"
/> />
<van-popup v-model:show="showPickerTime" position="bottom"> <van-calendar v-model:show="showPickerTime" @confirm="onConfirmTime" :min-date="minDate" :max-date="maxDate" />
<van-datetime-picker
v-model="formData.time"
type="datetime"
title="选择完整时间"
:min-date="minDate"
:max-date="maxDate"
@confirm="onConfirmTime"
@cancel="showPickerTime = false"
/>
</van-popup>
<van-field <van-field
v-if="name == '查看'" v-if="name == '查看'"
readonly readonly
v-model="formData.laboratory" v-model="formData.section"
label="节次" label="节次"
/> />
<van-field <van-field
v-if="name == '申请'" v-if="name == '申请'"
v-model="formData.section" v-model="formData.sectionText"
label="节次" label="节次"
readonly readonly
is-link is-link
...@@ -131,15 +116,34 @@ ...@@ -131,15 +116,34 @@
@cancel="showPickerSection = false" @cancel="showPickerSection = false"
/> />
</van-popup> </van-popup>
<div v-if="name == '申请'">
<van-field
v-model="formData.labName"
is-link
readonly
name="picker"
label="实验室"
placeholder="选择实验室"
@click="selectLab"
/>
<van-popup v-model:show="showPickerLab" position="bottom">
<van-picker
:columns="columnsLab"
@confirm="onConfirmLab"
@cancel="showPickerLab = false"
/>
</van-popup>
</div>
<van-field <van-field
v-if="name == '查看'" v-if="name == '查看'"
readonly readonly
v-model="formData.laboratory" v-model="formData.className"
label="班级" label="班级"
/> />
<van-field <van-field
v-if="name == '申请'" v-if="name == '申请'"
v-model="formData.class" v-model="formData.className"
label="班级" label="班级"
is-link is-link
readonly readonly
...@@ -160,7 +164,7 @@ ...@@ -160,7 +164,7 @@
readonly readonly
style="border: 1px solid #ebedf0;border-radius: 10px" style="border: 1px solid #ebedf0;border-radius: 10px"
name="message" name="message"
v-model="formData.message" v-model="formData.experimentUseGoods"
rows="3" rows="3"
autosize autosize
type="textarea" type="textarea"
...@@ -175,7 +179,7 @@ ...@@ -175,7 +179,7 @@
</div> </div>
<div v-else style="margin: 20px;display: flex;justify-content: center"> <div v-else style="margin: 20px;display: flex;justify-content: center">
<van-button style="margin-right: 50px;width: 90px;height: 30px" round type="primary" native-type="submit"> <van-button style="margin-right: 50px;width: 90px;height: 30px" round type="primary" @click="submit">
同意 同意
</van-button> </van-button>
<van-button style="width: 90px;height: 30px" round type="success" @click="goback"> <van-button style="width: 90px;height: 30px" round type="success" @click="goback">
...@@ -186,7 +190,7 @@ ...@@ -186,7 +190,7 @@
</template> </template>
<script setup> <script setup>
import { getLabPlanDetail } from '@/service/laboratoryManagement' import { getLabPlanDetail,getDicts,addTeacherLab,getTeacherClass,getTeacherLab } from '@/service/laboratoryManagement'
import { reactive, onMounted, toRefs, ref } from "vue"; import { reactive, onMounted, toRefs, ref } from "vue";
import { useStore } from "vuex"; import { useStore } from "vuex";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
...@@ -201,70 +205,159 @@ const name = route.query.name ...@@ -201,70 +205,159 @@ const name = route.query.name
minDate : new Date();// 最小的可选的日期 minDate : new Date();// 最小的可选的日期
maxDate: new Date(); // 最大的可选日期 maxDate: new Date(); // 最大的可选日期
const formData = reactive({ const formData = reactive({
subject:'', sub:'',
level:'', grade:'',
semester:'', semester:'',
time:'', experimentTime:'',
name:'', experimentName:'',
classify:'', experimentClassify:'',
chapter:'', chapterContent:'',
laboratory:'', labName:'',
plannedStartTime:'',
plannedEndTime:'',
section:'', section:'',
sectionText:'',
class:'', class:'',
message:'' message:'',
labId:'',
className:'',
classId:'',
experimentUseGoods:''
}) })
onMounted(async () => {
if(name == '申请'){
title.value = '教师实验室申请'
}
if(name == '查看'){
title.value = '教师实验室安排明细'
let result = await getLabPlanDetail(route.query.id)
console.log('result',result)
}
})
//日期时间选择器
const showPickerTime = ref(false);
const onConfirmTime = (value) => {
formData.time = value;
showPickerTime.value = false;
};
//实验分类下拉框
const showPickerClassify = ref(false);
const columnsClassify = ['杭州', '宁波', '温州', '嘉兴', '湖州'];
const onConfirmClassify = (value) => {
formData.Classify = value;
showPickerClassify.value = false;
};
//实验室分类下拉框 //实验室分类下拉框
const showPickerLab = ref(false); const showPickerLab = ref(false);
const columnsLab = ['杭州', '宁波', '温州', '嘉兴', '湖州']; const columnsLab = ref([]);
const onConfirmLab = (value) => { const onConfirmLab = (value) => {
formData.laboratory = value; formData.labName = value.text;
formData.labId = value.value;
showPickerLab.value = false; showPickerLab.value = false;
}; };
const selectLab = async (value) => {
console.log('formData.experimentTime',formData.experimentTime)
console.log('formData.section',formData.section)
if(formData.experimentTime == null || formData.experimentTime == undefined || formData.experimentTime == ""){
Toast.fail('请选择实验时间');
}else if(formData.section == null || formData.section == undefined || formData.section == ""){
Toast.fail('请选择节次');
}else{
//实验室下拉框
const data={
labClassYearId:route.query.id,
experimentTime:formData.experimentTime,
section:formData.section
}
let labResult = await getTeacherLab(data)
console.log('labResult',labResult)
if(labResult.code == 200){
labResult.data.forEach((element) => {
if(element.useState == '空闲'){
columnsLab.value.push({ text: element.labName, value: element.labId });
}
});
}
console.log('columnsLab.value',columnsLab.value)
showPickerLab.value = true;
}
}
//节次分类下拉框 //节次分类下拉框
const showPickerSection = ref(false); const showPickerSection = ref(false);
const columnsSection = ['杭州', '宁波', '温州', '嘉兴', '湖州']; const columnsSection = ref([]);
const onConfirmSection = (value) => { const onConfirmSection = (value) => {
formData.section = value; formData.sectionText = value.text;
formData.section = value.value;
showPickerSection.value = false; showPickerSection.value = false;
}; };
//班级分类下拉框 //班级分类下拉框
const showPickerClass = ref(false); const showPickerClass = ref(false);
const columnsClass = ['杭州', '宁波', '温州', '嘉兴', '湖州']; const columnsClass = ref([]);
const onConfirmClass = (value) => { const onConfirmClass = (value) => {
formData.class = value; formData.className = value.text;
formData.classId = value.value;
showPickerClass.value = false; showPickerClass.value = false;
}; };
const startTime = ref();
const endTime = ref();
const minDate = ref();
const maxDate = ref();
onMounted(async () => {
let result = await getLabPlanDetail(route.query.id)
console.log('result',result)
Object.assign(formData,result.data)
const startTime = result.data.plannedStartTime.split('-')
const endTime = result.data.plannedEndTime.split('-')
//格式化日期,月是从0开始,所以实际上的月要-1
minDate.value = new Date(startTime[0], Number(startTime[1])-1, startTime[2]);
maxDate.value = new Date(endTime[0], Number(endTime[1]-1), endTime[2]);
formData.sub = formData.sub == '1' ? '物理' : formData.sub == '2' ? '化学' : '生物';
formData.semester = formData.semester == '1' ? '上学期' : '下学期';
formData.experimentClassify = formData.experimentClassify == '1' ? '分组实验': formData.experimentClassify == '2' ? '演示实验' : '探究实验';
if(name == '申请'){
title.value = '教师实验室申请'
//节次下拉框
let sectionResult = await getDicts('course_arrange')
console.log('sectionResult',sectionResult)
if(sectionResult.code == 200){
const checkForm = reactive({ sectionResult.data.forEach((element) => {
columnsSection.value.push({ text: element.dictLabel, value: element.dictValue });
});
}
//班级下拉框
let classResult = await getTeacherClass({experimentPlanId:route.query.id})
console.log('classResult',classResult)
if(classResult.code == 200){
classResult.data.forEach((element) => {
columnsClass.value.push({ text: element.className, value: element.classId });
});
}
}
if(name == '查看'){
title.value = '教师实验室安排明细'
console.log('route.query.id',route.query.id)
let result = await getLabPlanDetail(route.query.id)
console.log('result66',result)
Object.assign(formData,result.data)
formData.sub = formData.sub == '1' ? '物理' : formData.sub == '2' ? '化学' : '生物';
formData.semester = formData.semester == '1' ? '上学期' : '下学期';
formData.experimentClassify = formData.experimentClassify == '1' ? '分组实验': formData.experimentClassify == '2' ? '演示实验' : '探究实验';
}
}) })
//日期时间选择器
const showPickerTime = ref(false);
const onConfirmTime = (date) => {
formData.experimentTime = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;;
showPickerTime.value = false;
};
//提交按钮
const submit = async () => {
console.log('formData1230',formData)
const data = {
labClassYearId:route.query.id,
experimentClassify:formData.experimentClassify == '分组实验' ? '1' :formData.experimentClassify == '演示实验' ? '2' : '3',
sub:formData.sub == '物理' ? '1' : formData.sub == '化学' ? '2' : '3' ,
grade:formData.grade,
schoolYear:formData.schoolYear,
classId :formData.classId,
chapterContent :formData.chapterContent,
experimentTime :formData.experimentTime,
section :formData.section,
labId :formData.labId,
labName :formData.labName,
applyId :formData.applyId,
applyName :formData.applyName,
applyTime :formData.applyTime,
}
console.log('data',data)
let submitResult = await addTeacherLab(data)
console.log('submitResult',submitResult)
if(submitResult.code == 200){
console.log('666')
router.back();
}
}
//返回上一页 //返回上一页
......
...@@ -84,6 +84,7 @@ onMounted(async () => { ...@@ -84,6 +84,7 @@ onMounted(async () => {
console.log('queryEncode', queryEncode) console.log('queryEncode', queryEncode)
title.value = '物品借用新增' title.value = '物品借用新增'
let equipmentRes = await scanEquipmentInfo(queryEncode) let equipmentRes = await scanEquipmentInfo(queryEncode)
console.log('equipmentRes',equipmentRes)
if(equipmentRes.code == 3000){ if(equipmentRes.code == 3000){
Dialog.alert({ Dialog.alert({
title: '提示', title: '提示',
......
...@@ -49,7 +49,8 @@ const equipmentName = ref('') ...@@ -49,7 +49,8 @@ const equipmentName = ref('')
//扫码获取 //扫码获取
const getCode = () => { const getCode = () => {
let enCode = scanCodeFun(store.state.appid,1) //获取到的设备自编码 let enCode = scanCodeFun(1) //获取到的设备自编码
//测试 //测试
// router.push({ // router.push({
// path: "/schoolProperty/borrow/detail", // path: "/schoolProperty/borrow/detail",
......
...@@ -60,7 +60,7 @@ onMounted( () => { ...@@ -60,7 +60,7 @@ onMounted( () => {
const getList = async () => { const getList = async () => {
if (pullLoading.value) { if (pullLoading.value) {
list.value = []; list.value = [];
pageNum.value = 0; // pageNum.value = 0;
pullLoading.value = false; pullLoading.value = false;
} }
let result = await getDeviceList(id,equipmentName.value) let result = await getDeviceList(id,equipmentName.value)
...@@ -94,7 +94,8 @@ const onSearch = async (val) =>{ ...@@ -94,7 +94,8 @@ const onSearch = async (val) =>{
//扫码获取 //扫码获取
const getCode = () => { const getCode = () => {
let enCode = scanCodeFun(store.state.appid,4) //获取到的设备自编码 let enCode = scanCodeFun(4) //获取到的设备自编码
//测试 //测试
// router.push({ // router.push({
// path: "/schoolProperty/device/info", // path: "/schoolProperty/device/info",
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
/> />
<van-field <van-field
v-if="name == '反馈' ? false : true" v-if="name == '反馈' ? false : true"
readonly :readonly="name == '查看' ? true : false"
v-model="fixForm.place" v-model="fixForm.place"
name="地点" name="地点"
label="地点" label="地点"
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
<div>报修人确认:{{item.repairState}}</div> <div>报修人确认:{{item.repairState}}</div>
<div>备注:{{ item.remark }}</div> <div>备注:{{ item.remark }}</div>
<div class="state"> <div class="state">
<div v-if="item.disposeState == 1" class="fixed">已完成</div> <div v-if="item.disposeState == '1'" class="fixed">已完成</div>
<div v-if="item.disposeState == 0" class="unable">待维修</div> <div v-if="item.disposeState == '0'" class="unable">待维修</div>
</div> </div>
</div> </div>
</van-list> </van-list>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<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="card">--> <!-- <div class="card">-->
<!-- <div class="title">报修台账新增</div>--> <!-- <div class="title">报修台账新增</div>-->
<van-form class="formBlock" label-align="right" label-width="70px"> <van-form class="formBlock" label-align="right" label-width="75px">
<van-cell-group inset> <van-cell-group inset>
<van-field <van-field
readonly readonly
...@@ -81,12 +81,12 @@ ...@@ -81,12 +81,12 @@
:rules="[{ required: true, message: '请填写修理时间' }]" :rules="[{ required: true, message: '请填写修理时间' }]"
/> />
<van-field <van-field
v-model="fixForm.repairStateName" v-model="fixForm.disposeStateName"
readonly readonly
label="修理状态" label="修理状态"
/> />
<van-field <van-field
v-model="fixForm.disposeStateName" v-model="fixForm.repairStateName"
readonly readonly
label="报修人确认" label="报修人确认"
/> />
...@@ -161,14 +161,16 @@ onMounted(async () => { ...@@ -161,14 +161,16 @@ onMounted(async () => {
if(repairResult.code == 200){ if(repairResult.code == 200){
console.log('repairResult',repairResult) console.log('repairResult',repairResult)
Object.assign(fixForm,repairResult.data) Object.assign(fixForm,repairResult.data)
if(repairResult.repairState == '0'){ if(repairResult.data.repairState == '0'){
fixForm.repairStateName = '已维修' fixForm.repairStateName = '已维修'
}else{ }
if(repairResult.data.repairState == '1'){
fixForm.repairStateName = '已损坏' fixForm.repairStateName = '已损坏'
} }
if(repairResult.disposeState == '0'){ if(repairResult.data.disposeState == '0'){
fixForm.disposeStateName = '待处理' fixForm.disposeStateName = '待处理'
}else{ }
if(repairResult.data.disposeState == '1'){
fixForm.disposeStateName = '已处理' fixForm.disposeStateName = '已处理'
} }
} }
......
...@@ -48,6 +48,8 @@ import { useRouter } from "vue-router"; ...@@ -48,6 +48,8 @@ import { useRouter } from "vue-router";
import {scanCodeFun} from "../../../utils/scanCode"; import {scanCodeFun} from "../../../utils/scanCode";
import {useStore} from "vuex"; import {useStore} from "vuex";
import {onMounted,ref} from "vue"; import {onMounted,ref} from "vue";
import * as dd from 'dingtalk-jsapi';
const store = useStore(); const store = useStore();
const router = useRouter(); const router = useRouter();
console.log('store',store.state.userInfo.roles) console.log('store',store.state.userInfo.roles)
...@@ -77,17 +79,7 @@ onMounted( () => { ...@@ -77,17 +79,7 @@ onMounted( () => {
}) })
//扫码获取 //扫码获取
const getCode = () => { const getCode = () => {
let enCode = scanCodeFun(store.state.appid,0) //获取到的设备自编码 let enCode = scanCodeFun(0) //获取到的设备自编码
// alert(enCode)
// if(enCode){
// //测试
// router.push({
// path: "/schoolProperty/equipmentInfo",
// query: {
// encode:enCode
// }
// })
// }
} }
const toPage = (type) => { const toPage = (type) => {
if(type == 0){ if(type == 0){
......
...@@ -6,8 +6,9 @@ ...@@ -6,8 +6,9 @@
</div> </div>
<van-pull-refresh v-model="pullLoading" @refresh="onRefresh"> <van-pull-refresh v-model="pullLoading" @refresh="onRefresh">
<van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="getList"> <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="getList">
<div v-for="(item,index) in list" :key="index" class="listBlock" @click="toDetailPage(item.id,item.encode)"> <div v-for="(item,index) in list" :key="index" @click="toDetailPage(item.id,item.encode)" >
<div class="flexBLock"> <div v-if="item.returnState == 0" class="listBlock">
<div class="flexBLock" >
<div> <div>
<div>型号:{{ item.model}}</div> <div>型号:{{ item.model}}</div>
<div>自编码:{{ item.encode }}</div> <div>自编码:{{ item.encode }}</div>
...@@ -24,7 +25,8 @@ ...@@ -24,7 +25,8 @@
</div> </div>
<div>备注:已借用取回,暂不外借,设备换修。已借用取回,暂不外借,设备换修。</div> <div>备注:已借用取回,暂不外借,设备换修。已借用取回,暂不外借,设备换修。</div>
<div v-if="item.returnState == 0" class="waitReturn">待归还</div> <div v-if="item.returnState == 0" class="waitReturn">待归还</div>
<div v-if="item.returnState == 1" class="endReturn">已归还</div> <!-- <div v-if="item.returnState == 1" class="endReturn">已归还</div>-->
</div>
</div> </div>
</van-list> </van-list>
</van-pull-refresh> </van-pull-refresh>
...@@ -59,7 +61,10 @@ const getList = async () => { ...@@ -59,7 +61,10 @@ const getList = async () => {
pageNum.value = 0; pageNum.value = 0;
pullLoading.value = false; pullLoading.value = false;
} }
let result = await getEquipmentList(id) const params = {
userId:id,
}
let result = await getEquipmentList(params)
console.log('result',result) console.log('result',result)
if(result.code == 200){ if(result.code == 200){
loading.value = false; loading.value = false;
...@@ -77,7 +82,11 @@ const onSearch = async (val) =>{ ...@@ -77,7 +82,11 @@ const onSearch = async (val) =>{
list.value = []; list.value = [];
loading.value = true; loading.value = true;
equipmentName.value = val equipmentName.value = val
let searchResult = await getEquipmentList(id,equipmentName.value); const params = {
userId:id,
equipmentName:equipmentName.value
}
let searchResult = await getEquipmentList(params);
console.log('searchResult',searchResult) console.log('searchResult',searchResult)
if(searchResult.code == 200){ if(searchResult.code == 200){
loading.value = false; loading.value = false;
...@@ -88,7 +97,9 @@ const onSearch = async (val) =>{ ...@@ -88,7 +97,9 @@ const onSearch = async (val) =>{
} }
//扫码获取 //扫码获取
const getCode = () => { const getCode = () => {
let enCode = scanCodeFun(store.state.appid,2) //获取到的设备自编码 // let enCode = scanCodeFun(store.state.appid,2) //获取到的设备自编码
let enCode = scanCodeFun(2) //获取到的设备自编码
// console.log(1) // console.log(1)
//测试 //测试
// router.push({ // router.push({
......
...@@ -78,7 +78,8 @@ const onSearch = async (val) =>{ ...@@ -78,7 +78,8 @@ const onSearch = async (val) =>{
} }
//扫码获取 //扫码获取
const getCode = () => { const getCode = () => {
let enCode = scanCodeFun(store.state.appid,3) //获取到的设备自编码 let enCode = scanCodeFun(3) //获取到的设备自编码
// console.log(1) // console.log(1)
//测试 //测试
// router.push({ // router.push({
......
[ [
"/Users/ths/WebstormProjects/二中/公众号/zhxy/src/assets/icon/competition.png", "/Users/ths/WebstormProjects/二中钉钉/公众号-钉钉/dd_zhxy/src/assets/icon/competition.png",
"/Users/ths/WebstormProjects/二中/公众号/zhxy/src/assets/index/home.jpg", "/Users/ths/WebstormProjects/二中钉钉/公众号-钉钉/dd_zhxy/src/assets/index/home.jpg",
"/Users/ths/WebstormProjects/二中/公众号/zhxy/src/assets/index/hqbx.png", "/Users/ths/WebstormProjects/二中钉钉/公众号-钉钉/dd_zhxy/src/assets/index/hqbx.png",
"/Users/ths/WebstormProjects/二中/公众号/zhxy/src/assets/ttf/x.ttf", "/Users/ths/WebstormProjects/二中钉钉/公众号-钉钉/dd_zhxy/src/assets/ttf/x.ttf",
"/Users/ths/WebstormProjects/二中/公众号/zhxy/src/assets/xxcjx.png", "/Users/ths/WebstormProjects/二中钉钉/公众号-钉钉/dd_zhxy/src/assets/xxcjx.png",
"/Users/ths/WebstormProjects/二中/公众号/zhxy/src/assets/zbb.png", "/Users/ths/WebstormProjects/二中钉钉/公众号-钉钉/dd_zhxy/src/assets/zbb.png",
"/Users/ths/WebstormProjects/二中/公众号/zhxy/src/router/config.js", "/Users/ths/WebstormProjects/二中钉钉/公众号-钉钉/dd_zhxy/src/router/config.js",
"/Users/ths/WebstormProjects/二中/公众号/zhxy/src/store/other.js", "/Users/ths/WebstormProjects/二中钉钉/公众号-钉钉/dd_zhxy/src/store/other.js",
"/Users/ths/WebstormProjects/二中/公众号/zhxy/src/utils/dict.js", "/Users/ths/WebstormProjects/二中钉钉/公众号-钉钉/dd_zhxy/src/utils/dict.js",
"/Users/ths/WebstormProjects/二中/公众号/zhxy/src/utils/MyTools.js", "/Users/ths/WebstormProjects/二中钉钉/公众号-钉钉/dd_zhxy/src/utils/MyTools.js",
"/Users/ths/WebstormProjects/二中/公众号/zhxy/src/views/tabbar/main/parent.vue", "/Users/ths/WebstormProjects/二中钉钉/公众号-钉钉/dd_zhxy/src/views/tabbar/main/parent.vue",
"/Users/ths/WebstormProjects/二中/公众号/zhxy/src/views/tabbar/main/teacher.vue", "/Users/ths/WebstormProjects/二中钉钉/公众号-钉钉/dd_zhxy/src/views/tabbar/main/teacher.vue",
"/Users/ths/WebstormProjects/二中/公众号/zhxy/src/views/teacher/laboratoryManagement/manager/applyTeacherApprove.vue" "/Users/ths/WebstormProjects/二中钉钉/公众号-钉钉/dd_zhxy/src/views/teacher/laboratoryManagement/manager/applyTeacherApprove.vue"
] ]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment