Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dd_zhxy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangqi
dd_zhxy
Commits
50341b1c
Commit
50341b1c
authored
Aug 21, 2023
by
peijy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8.21 校产管理
parent
3d10c67c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
1316 additions
and
135 deletions
+1316
-135
package.json
+1
-0
src/router/index.js
+35
-5
src/service/schoolProperty.js
+35
-11
src/service/studentCourseSelection.js
+6
-1
src/utils/axios.js
+7
-7
src/utils/scanCode.js
+48
-3
src/views/login/login.vue
+3
-1
src/views/parent/InforCollection/apply.vue
+9
-0
src/views/parent/studentCourseSelection/checkCourse.vue
+74
-0
src/views/parent/studentCourseSelection/index.vue
+0
-0
src/views/tabbar/TeacherInfo.vue
+1
-0
src/views/tabbar/main/index.vue
+36
-6
src/views/teacher/schoolProperty/borrowDetail.vue
+97
-30
src/views/teacher/schoolProperty/borrowList.vue
+28
-3
src/views/teacher/schoolProperty/deviceList.vue
+55
-13
src/views/teacher/schoolProperty/deviceListInfo.vue
+0
-0
src/views/teacher/schoolProperty/equipmentFix.vue
+160
-0
src/views/teacher/schoolProperty/equipmentFixDetail.vue
+205
-0
src/views/teacher/schoolProperty/equipmentInfo.vue
+99
-0
src/views/teacher/schoolProperty/index.vue
+77
-4
src/views/teacher/schoolProperty/returnDetail.vue
+151
-0
src/views/teacher/schoolProperty/returnList.vue
+68
-19
src/views/teacher/schoolProperty/useAdd.vue
+73
-20
src/views/teacher/schoolProperty/useList.vue
+48
-12
vue.config.js
+0
-0
No files found.
package.json
View file @
50341b1c
...
...
@@ -14,6 +14,7 @@
"
core-js
"
:
"^3.6.5"
,
"
fs
"
:
"^0.0.1-security"
,
"
js-cookie
"
:
"^3.0.1"
,
"
moment
"
:
"^2.29.4"
,
"
path
"
:
"^0.12.7"
,
"
useless-files-webpack-plugin
"
:
"^1.0.1"
,
"
vant
"
:
"^3.0.16"
,
...
...
src/router/index.js
View file @
50341b1c
import
{
createRouter
,
createWebHashHistory
,
createWebHistory
}
from
"vue-router"
;
import
{
Toast
}
from
"vant"
;
import
{
createRouter
,
createWebHashHistory
,
createWebHistory
}
from
"vue-router"
;
import
{
Toast
}
from
"vant"
;
// createWebHistory
const
routes
=
[
...
...
@@ -74,8 +74,6 @@ const routes = [
},
/* 校历*/
{
path
:
"/Calendar"
,
...
...
@@ -205,6 +203,12 @@ const routes = [
name
:
"studentCourseSelection"
,
component
:
()
=>
import
(
"../views/parent/studentCourseSelection/index"
),
},
/* 学生选课 家长端 超过日期页面 */
{
path
:
"/studentCourse"
,
name
:
"studentCourse"
,
component
:
()
=>
import
(
"../views/parent/studentCourseSelection/checkCourse"
),
},
/* 学生选课 家长端 学科成绩 */
{
path
:
"/subjectAchievement"
,
...
...
@@ -550,6 +554,12 @@ const routes = [
name
:
"adminReturnList"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/returnList"
),
},
// 管理员 归还查看页
{
path
:
"/schoolProperty/return/detail"
,
name
:
"adminReturnDetail"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/returnDetail"
),
},
// 管理员 物品领用列表页
{
path
:
"/schoolProperty/use"
,
...
...
@@ -568,11 +578,30 @@ const routes = [
name
:
"adminDeviceList"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/deviceList"
),
},
// 管理员 设备维修列表页
{
path
:
"/schoolProperty/equipmentFix"
,
name
:
"equipmentFix"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/equipmentFix"
),
},
// 管理员 设备维修列表详情页
{
path
:
"/schoolProperty/equipmentFix/equipmentFixDetail"
,
name
:
"equipmentFixDetail"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/equipmentFixDetail"
),
},
// 设备报修新增、修改、查看、反馈页面
{
path
:
"/schoolProperty/device/info"
,
name
:
"deviceListInfo"
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/deviceListInfo"
),
},
//扫码查看设备的详细信息
{
path
:
"/schoolProperty/equipmentInfo"
,
name
:
'equipmentInfo'
,
component
:
()
=>
import
(
"../views/teacher/schoolProperty/equipmentInfo"
),
}
...
...
@@ -591,7 +620,8 @@ router.beforeEach((to, from, next) => {
if
(
to
.
name
==
"development"
)
{
Toast
(
"开发中"
);
return
;
}
next
()
}
next
()
// next();
// if (!to.meta.noAuth) {
// next({ name: "login" });
...
...
src/service/schoolProperty.js
View file @
50341b1c
...
...
@@ -18,8 +18,8 @@ export function getBorrowList(borrowById) {
}
//扫码借用获取设备基本信息
export
function
getScan
Info
(
encode
)
{
return
axios
.
post
(
`wx/equipment/getEquipment
${
encode
}
`
);
export
function
scanEquipment
Info
(
encode
)
{
return
axios
.
get
(
`wx/equipment/getEquipment/
${
encode
}
`
);
}
//物品借用
...
...
@@ -38,18 +38,18 @@ export function checkBorrowDetail(id) {
//管理员物品列表查看
export
function
getEquipmentList
(
managerId
)
{
return
axios
.
pos
t
(
`wx/equipment/getMyBorrowList/
${
managerId
}
`
);
return
axios
.
ge
t
(
`wx/equipment/getMyBorrowList/
${
managerId
}
`
);
}
//借用物品记录详情查看-克隆
export
function
checkEquipmentDetail
(
id
)
{
return
axios
.
get
(
`wx/equipment/
byCirculation/
${
id
}
`
);
export
function
getEquipmentDetail
(
encode
)
{
return
axios
.
get
(
`wx/equipment/
getReturningEquipmentByList/
${
encode
}
`
);
}
//物品归还
export
function
returnEquipment
(
data
)
{
return
axios
.
put
(
'/wx/equipment/returnDevice'
,{
params
:
data
...
data
}
);
}
...
...
@@ -57,8 +57,8 @@ export function returnEquipment(data) {
/********** 物品领用 ***********/
//领用列表
export
function
getUseList
(
recipientById
)
{
return
axios
.
get
(
`wx/equipment/getUseList/
${
recipientById
}
`
);
export
function
getUseList
(
recipientById
,
equipmentName
)
{
return
axios
.
get
(
`wx/equipment/getUseList/
?recipientById=
${
recipientById
}
&equipmentName=
${
equipmentName
}
`
);
}
//新增领用
...
...
@@ -75,6 +75,11 @@ export function useDeatil(id) {
/********** 设备报修 ***********/
//获取修理人
export
function
getRepairName
()
{
return
axios
.
get
(
`wx/equipment/getRepair`
);
}
//报修个人记录列表
export
function
getDeviceList
(
reportRepairid
)
{
return
axios
.
get
(
`wx/equipment/getMaintenanceList/
${
reportRepairid
}
`
);
...
...
@@ -89,13 +94,13 @@ export function addDevice(data) {
//报修记录详情
export
function
getDeviceDetail
(
id
)
{
return
axios
.
pos
t
(
`wx/equipment/getMaintenance/
${
id
}
`
);
return
axios
.
ge
t
(
`wx/equipment/getMaintenance/
${
id
}
`
);
}
//报修记录修改
export
function
editDevice
(
data
)
{
return
axios
.
put
(
'/wx/equipment/pudateMaintenance'
,{
params
:
data
...
data
}
);
}
...
...
@@ -108,7 +113,26 @@ export function getFeedbackDetail(id) {
// 报修结果反馈
export
function
submitFeedback
(
data
)
{
return
axios
.
put
(
'/wx/equipment/pudateMaintenance'
,{
params
:
data
...
data
}
);
}
//报修记录删除
export
function
deletEuipemnt
(
id
)
{
return
axios
.
delete
(
`wx/equipment/deletEuipemnt/
${
id
}
`
);
}
/********** 设备维修 ***********/
//维修工作列表
export
function
getMaintenanceList
()
{
return
axios
.
get
(
'wx/equipment/getMaintenanceUserList'
);
}
//报修记录详情-克隆
export
function
getMaintenanceDetail
(
id
)
{
return
axios
.
get
(
`wx/equipment/getMaintenance/
${
id
}
`
);
}
src/service/studentCourseSelection.js
View file @
50341b1c
...
...
@@ -31,7 +31,12 @@ export function getSelectGrade(data) {
//保存选课信息
export
function
saveSelectInfo
(
data
)
{
return
axios
.
p
os
t
(
'/wx/course/savestudentcourse'
,{
return
axios
.
p
u
t
(
'/wx/course/savestudentcourse'
,{
...
data
}
);
}
//根据字典类型和字典键值查询字典数据信息
export
function
getStudentCourse
(
course_type
,
value
)
{
return
axios
.
get
(
`system/dict/data/getDictLabel/
${
course_type
}
/
${
value
}
`
);
}
src/utils/axios.js
View file @
50341b1c
...
...
@@ -7,10 +7,10 @@
* 版权所有,侵权必究!
*/
import
axios
from
"axios"
;
import
{
Toast
}
from
"vant"
;
import
{
Toast
}
from
"vant"
;
import
router
from
"../router"
;
import
{
getToken
}
from
"@/utils/auth"
;
import
{
tansParams
}
from
"@/utils/common"
;
import
{
getToken
}
from
"@/utils/auth"
;
import
{
tansParams
}
from
"@/utils/common"
;
axios
.
defaults
.
baseURL
=
"/school"
;
// axios.defaults.baseURL = "/schoolnw";
...
...
@@ -116,14 +116,14 @@ axios.interceptors.response.use(
console
.
log
(
res
.
data
);
// if (res.data.message) Toast.fail(res.data.message);
if
(
res
.
data
.
code
==
401
)
{
router
.
push
({
path
:
"/"
});
router
.
push
({
path
:
"/"
});
}
if
(
res
.
data
.
code
==
500
)
{
// router.push({ path: "/login" });
Toast
.
fail
(
"获取信息异常"
);
//
Toast.fail("获取信息异常");
// return Promise.reject(res.data);
// Toast.fail(res.data.msg
);
Toast
.
fail
(
res
.
data
.
msg
);
router
.
push
({
path
:
"/login"
}
);
}
return
Promise
.
reject
(
res
.
data
);
// return Promise.resolve(res.data);
...
...
src/utils/scanCode.js
View file @
50341b1c
import
{
getWxConfig
}
from
"../service/schoolProperty"
;
import
{
getWxConfig
,
scanEquipmentInfo
}
from
"../service/schoolProperty"
;
import
wx
from
"weixin-js-sdk"
;
//调用微信相关
/***
* Date:2023-08-14
* Describe:用于调取微信扫码
* */
export
function
scanCodeFun
(
appId
){
export
function
scanCodeFun
(
appId
,
type
){
let
url
=
location
.
href
.
split
(
'#'
)[
0
]
//获取当前域名
let
encode
=
''
getWxConfig
(
url
).
then
(
res
=>
{
...
...
@@ -31,9 +31,54 @@ export function scanCodeFun(appId){
scanType
:
[
"qrCode"
,
"barCode"
],
// 可以指定扫二维码还是一维码,默认二者都有
success
:
function
(
res
)
{
encode
=
res
.
resultStr
;
// 当needResult 为 1 时,扫码返回的结果
if
(
type
=
0
){
//校产管理页面扫码显示设备信息
router
.
push
({
path
:
"/schoolProperty/equipmentInfo"
,
query
:
{
encode
:
encode
}
})
}
if
(
type
=
1
){
// 物品借用
router
.
push
({
path
:
"/schoolProperty/borrow/detail"
,
query
:{
encode
:
encode
}
});
};
if
(
type
=
2
){
// 归还管理
router
.
push
({
path
:
"/schoolProperty/return/detail"
,
query
:{
encode
:
encode
}
});
};
if
(
type
=
3
){
// 物品领用
router
.
push
({
path
:
"/schoolProperty/use/add"
,
query
:{
encode
:
encode
}
});
};
if
(
type
=
4
){
// 设备报修
router
.
push
({
path
:
"/schoolProperty/device/info"
,
query
:{
encode
:
encode
,
name
:
'新增'
}
});
}
}
})
}
})
return
encode
}
src/views/login/login.vue
View file @
50341b1c
...
...
@@ -285,6 +285,7 @@ export default {
data
.
password
=
state
.
password
;
data
.
type
=
state
.
loginType
;
data
.
openId
=
state
.
openId
;
//访问后台接口
let
postData
=
{};
if
(
state
.
parentShow
)
{
...
...
@@ -303,7 +304,7 @@ export default {
phonenumber
:
state
.
phonenumber
,
};
}
console
.
log
(
'postData'
,
postData
)
// 发送请求登录
let
result
=
await
loginGet
({
...
postData
,
...
...
@@ -312,6 +313,7 @@ export default {
});
if
(
result
.
code
===
200
)
{
setToken
(
result
.
token
);
setParentTelephone
(
state
.
parentTelephone
);
setTotyp
(
state
.
loginType
);
...
...
src/views/parent/InforCollection/apply.vue
View file @
50341b1c
...
...
@@ -68,6 +68,7 @@
v-model=
"schoolInfoDetail.birthday"
type=
"date"
@
confirm=
"birthdayconfirm"
@
cancel=
"birthdaycancel"
title=
"请选择时间"
:min-date=
"minDate"
:max-date=
"maxDate"
...
...
@@ -561,6 +562,13 @@ const formatter = (type, val) => {
return
val
;
};
const
birthdaycancel
=
()
=>
{
schoolInfoDetail
.
value
.
birthdayShow
=
false
;
console
.
log
(
'detail2'
,
detail
)
// schoolInfoDetail.value = detail;
}
const
birthdayconfirm
=
(
value
)
=>
{
schoolInfoDetail
.
value
.
birthdayShow
=
false
;
schoolInfoDetail
.
value
.
birthday
=
formatDate
(
value
);
...
...
@@ -599,6 +607,7 @@ const onnature = (value) => {
onMounted
(
async
()
=>
{
if
(
detail
.
birthday
==
""
)
detail
.
birthday
=
getBirthday
(
detail
.
idCard
);
schoolInfoDetail
.
value
=
detail
;
console
.
log
(
'detail2'
,
detail
)
schoolInfoDetail
.
value
.
relationship2text
=
getrelationship
(
schoolInfoDetail
.
value
.
relationship2
);
...
...
src/views/parent/studentCourseSelection/checkCourse.vue
0 → 100644
View file @
50341b1c
<
template
>
<van-nav-bar
title=
"课程查看"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<van-form
class=
"formBlock"
label-align=
"right"
label-width=
"60px"
>
<van-cell-group
inset
>
<van-field
readonly
v-model=
"courseForm.studentName"
name=
"姓名"
label=
"姓名"
placeholder=
"姓名"
:rules=
"[
{ required: true, message: '请填写姓名' }]"
/>
<van-field
readonly
v-model=
"courseForm.courseResult"
type=
"password"
name=
"选课结果"
label=
"选课结果"
placeholder=
"选课结果"
:rules=
"[
{ required: true, message: '请填写选课结果' }]"
/>
</van-cell-group>
<div
style=
"margin: 16px;"
>
<van-button
round
block
type=
"primary"
@
click=
"goback"
>
关闭
</van-button>
</div>
</van-form>
</
template
>
<
script
setup
>
import
{
getStudentInfo
,
//学生选课信息查询
getStudentCourse
,
//根据字典类型和字典键值查询字典数据信息
}
from
"@/service/studentCourseSelection"
;
import
{
ref
,
reactive
,
onMounted
}
from
'vue'
;
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
useStore
}
from
"vuex"
;
const
router
=
useRouter
()
const
store
=
useStore
()
//课程类型 春季 夏季 艺体
const
courseType
=
ref
()
console
.
log
(
'store'
,
store
)
const
courseForm
=
reactive
({
studentName
:
''
,
courseResult
:
''
,
})
onMounted
(
async
()
=>
{
let
result
=
await
getStudentInfo
(
store
.
state
.
userInfo
.
studentId
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
courseForm
.
studentName
=
store
.
state
.
userInfo
.
studentName
courseType
.
value
=
result
.
data
.
courseType
if
(
result
.
data
.
selectedCourse
!=
''
){
let
courseResult
=
await
getStudentCourse
(
courseType
.
value
,
result
.
data
.
selectedCourse
)
console
.
log
(
'courseResult'
,
courseResult
)
}
// else if(){}
}
})
//返回上一页
const
goback
=
(
g
)
=>
{
router
.
back
()
// router.replace({
// path: "/main"
// });
};
</
script
>
<
style
scoped
>
</
style
>
src/views/parent/studentCourseSelection/index.vue
View file @
50341b1c
This diff is collapsed.
Click to expand it.
src/views/tabbar/TeacherInfo.vue
View file @
50341b1c
...
...
@@ -278,6 +278,7 @@ export default {
});
const
initUserInfo
=
async
()
=>
{
console
.
log
(
'store'
,
store
)
//访问后台接口
let
result
=
await
getteacherInfo
();
if
(
result
.
code
==
200
)
{
...
...
src/views/tabbar/main/index.vue
View file @
50341b1c
...
...
@@ -184,7 +184,7 @@
/>
<span
class=
"item_text"
>
教师信息
</span>
</van-grid-item>
<van-grid-item
icon=
"photo-o"
text=
"学生选课"
url=
" #/studentCourseSelection
"
>
<van-grid-item
@
click
.
native=
"toCourseSelect"
icon=
"photo-o"
text=
"学生选课
"
>
<van-image
style=
"width: 48px"
:src=
"require('@/assets/index/rkls.png')"
...
...
@@ -482,6 +482,7 @@
<
script
>
// import HelloWorld from "@/components/HelloWorld.vue";
import
moment
from
"moment"
;
import
{
reactive
,
onMounted
,
toRefs
,
ref
}
from
"vue"
;
import
{}
from
"@/service/home"
;
import
{
useStore
}
from
"vuex"
;
...
...
@@ -506,7 +507,9 @@ import {
getRunNum
,
}
from
"@/service/home"
;
import
{
storetyprelationshiptyp
}
from
"@/service/dir"
;
import
{
getStudentInfo
,
//学生选课信息查询
}
from
"@/service/studentCourseSelection"
;
export
default
{
name
:
"Home"
,
...
...
@@ -533,7 +536,8 @@ export default {
const
getpic
=
(
img
)
=>
{
return
axios
.
defaults
.
baseURL
+
img
;
};
const
courseStartTime
=
ref
();
const
courseEndTime
=
ref
();
const
loadData
=
async
()
=>
{
console
.
log
(
"加载数据"
,
store
);
goCalendar
();
...
...
@@ -556,9 +560,7 @@ export default {
/* 初始化 消息推送数据 */
let
type
=
store
.
state
.
userLoginType
;
state
.
typ
=
type
;
//访问后台接口
if
(
type
==
1
)
{
parentShow
.
value
=
true
;
initGradeList
();
...
...
@@ -590,8 +592,35 @@ export default {
storetypsectiontyp
();
storetyprelationshiptyp
();
getnumb
();
if
(
store
.
state
.
userInfo
.
studentId
){
courseInfo
();
}
};
const
flag
=
ref
();
const
noCourse
=
ref
(
false
)
//获取选课基本信息
const
courseInfo
=
async
()
=>
{
let
result
=
await
getStudentInfo
(
store
.
state
.
userInfo
.
studentId
)
console
.
log
(
'result66'
,
result
)
if
(
result
.
code
==
200
){
courseStartTime
.
value
=
result
.
data
.
startTime
;
courseEndTime
.
value
=
result
.
data
.
endTime
;
flag
.
value
=
result
.
data
.
flag
}
if
(
result
.
code
==
2000
){
noCourse
.
value
=
true
}
}
//点击学生选课
const
toCourseSelect
=
()
=>
{
// console.log('flag.value',flag.value)
if
(
noCourse
.
value
==
true
){
Toast
(
"当前没有选课任务!"
);
}
else
{
router
.
push
({
path
:
"/studentCourseSelection"
,
})
}
}
const
getuserInfo
=
async
()
=>
{
//访问后台接口
let
result
=
await
getInfo
();
...
...
@@ -821,6 +850,7 @@ export default {
goaskForLeavealist
,
goDutytable
,
gomylesson
,
toCourseSelect
};
},
};
...
...
src/views/teacher/schoolProperty/borrowDetail.vue
View file @
50341b1c
...
...
@@ -2,58 +2,72 @@
<van-nav-bar
:title=
title
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<van-form
@
submit=
"onSubmit"
class=
"formBlock"
label-align=
"right"
label-width=
"110px"
>
<van-cell-group
inset
>
<van-field
:readonly=
"queryId ? true : false"
v-model=
"borrowForm.encode"
label=
"自编码"
placeholder=
"请输入自编码"
/>
<van-field
:readonly=
"queryId ? true : false"
v-model=
"borrowForm.equipmentName"
label=
"设备名称"
<van-field
readonly
v-model=
"borrowForm.encode"
label=
"自编码"
placeholder=
"请输入自编码"
/>
<van-field
readonly
v-model=
"borrowForm.equipmentName"
label=
"设备名称"
placeholder=
"请输入设备名称"
/>
<van-field
:readonly=
"queryId ? true : false"
v-model=
"borrowForm.model"
label=
"型号"
placeholder=
"请输入型号"
/>
<
div
v-if=
"queryId"
>
<van-field
readonly
v-model=
"
borrowTime"
label=
"借用日期"
/>
<
/div
>
<
div
v-else
>
<van-field
is-link
readonly
v-model=
"borrowTime"
label=
"借用日期"
@
click=
"showPicker = true"
placeholder=
"请选择借用日期"
/
>
<van-calendar
:readonly=
"queryId ? true : false"
v-model:show=
"showPicker"
@
confirm=
"onConfirmBorrowTime"
/
>
<
/div
>
<van-field
:readonly=
"queryId ? true : false"
v-model=
"borrowForm.borrowBy"
label=
"借用人"
placeholder=
"请输入借用人"
/>
<van-field
readonly
v-model=
"borrowForm.model"
label=
"型号"
placeholder=
"请输入型号"
/>
<
!--
<div
v-if=
"queryId"
>
--
>
<van-field
readonly
v-model=
"borrowForm.
borrowTime"
label=
"借用日期"
/>
<
!--
</div>
--
>
<
!--
<div
v-else
>
--
>
<!--
<van-field
is-link
readonly
v-model=
"borrowForm.borrowTime"
label=
"借用日期"
@
click=
"showPicker = true"
--
>
<!-- placeholder="请选择借用日期"/>--
>
<!--
<van-calendar
:readonly=
"queryId ? true : false"
v-model:show=
"showPicker"
@
confirm=
"onConfirmBorrowTime"
/>
--
>
<
!--
</div>
--
>
<van-field
readonly
v-model=
"borrowForm.borrowBy"
label=
"借用人"
placeholder=
"请输入借用人"
/>
<van-field
:readonly=
"queryId ? true : false"
v-model=
"borrowForm.purpose"
label=
"用途"
placeholder=
"请输入用途"
/>
<div
v-if=
"queryId"
>
<van-field
readonly
v-model=
"returnTime"
label=
"归还时间"
/>
<van-field
readonly
v-model=
"
borrowForm.
returnTime"
label=
"归还时间"
/>
<van-field
readonly
v-model=
"borrowForm.returnEquipmentCondition"
label=
"归还时设备情况"
/>
</div>
<van-field
:readonly=
"queryId ? true : false"
v-model=
"borrowForm.deadline"
label=
"借用期限(天)"
placeholder=
"请输入借用期限"
/>
</van-cell-group>
<div>
<van-button
class=
"sureBtn"
round
block
type=
"primary"
native-type=
"submit"
>
确 定
</van-button>
<div
v-if=
"queryId"
style=
"margin: 30px; display: flex;justify-content: center"
>
<van-button
round
type=
"success"
size=
"small"
style=
"width: 80px;margin-left: 20px;"
@
click=
"goback"
>
关 闭
</van-button>
</div>
<div
v-else
style=
"margin: 30px; display: flex;justify-content: center"
>
<van-button
size=
"small"
round
type=
"primary"
style=
"width: 80px;"
native-type=
"submit"
>
确 定
</van-button>
<van-button
round
type=
"success"
size=
"small"
style=
"width: 80px;margin-left: 20px;"
@
click=
"goback"
>
取 消
</van-button>
</div>
</van-form>
</
template
>
<
script
setup
>
import
{
checkBorrowDetail
}
from
"@/service/schoolProperty"
import
{
checkBorrowDetail
,
scanEquipmentInfo
,
submitBorrowDetail
}
from
"@/service/schoolProperty"
import
{
reactive
,
ref
,
onMounted
}
from
"vue"
;
import
{
formatDatetime
}
from
"@/utils/time.js"
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
useStore
}
from
"vuex"
;
import
{
Toast
,
Dialog
}
from
"vant"
;
const
store
=
useStore
();
const
userName
=
store
.
state
.
userInfo
.
teacherName
console
.
log
(
'store'
,
store
.
state
)
const
router
=
useRouter
();
const
route
=
useRoute
();
const
queryId
=
route
.
query
.
id
;
const
queryEncode
=
route
.
query
.
encode
let
title
=
ref
(
''
)
// 页面标题
let
borrowForm
=
reactive
({
// 表单数据
encode
:
''
,
//自编码
equipmentName
:
''
,
//设备名称
model
:
''
,
//型号
// borrowTime:
'', // 借用日期
borrowTime
:
''
,
// 借用日期
borrowBy
:
''
,
//借用人
purpose
:
''
,
//用途
// deadline:
'', //借用期限(天)
deadline
:
''
,
//借用期限(天)
returnTime
:
''
,
//归还日期
returnEquipmentCondition
:
''
,
//归还时设备情况
})
let
borrowTime
=
ref
(
''
)
// 借用日期
let
returnTime
=
ref
(
''
)
// 归还日期
//
let borrowTime = ref('') // 借用日期
//
let returnTime = ref('') // 归还日期
let
showPicker
=
ref
(
false
)
//是否显示日历选择-借用
...
...
@@ -64,20 +78,60 @@ onMounted(async () => {
console
.
log
(
'result'
,
result
)
title
.
value
=
'物品借用查看'
Object
.
assign
(
borrowForm
,
result
.
data
)
borrowTime
.
value
=
result
.
data
.
borrowTime
returnTime
.
value
=
result
.
data
.
returnTime
//
borrowTime.value = result.data.borrowTime
//
returnTime.value = result.data.returnTime
}
else
{
console
.
log
(
'queryEncode'
,
queryEncode
)
title
.
value
=
'物品借用新增'
let
equipmentRes
=
await
scanEquipmentInfo
(
queryEncode
)
console
.
log
(
'equipmentRes'
,
equipmentRes
)
Object
.
assign
(
borrowForm
,
equipmentRes
.
data
)
borrowForm
.
borrowBy
=
userName
borrowForm
.
borrowTime
=
formatDatetime
(
new
Date
())
console
.
log
(
'borrowForm'
,
borrowForm
)
if
(
equipmentRes
.
data
.
affiliationType
!=
2
)
{
Dialog
.
alert
({
title
:
'提示'
,
message
:
'该设备不属于信息中心,不可借用'
,
}).
then
(()
=>
{
router
.
back
();
});
}
else
if
(
equipmentRes
.
data
.
equipmentState
!=
1
)
{
Dialog
.
alert
({
title
:
'提示'
,
message
:
'该设备非完好状态,不可借用'
,
}).
then
(()
=>
{
router
.
back
();
});
}
else
if
(
equipmentRes
.
data
.
isAllowLend
==
0
)
{
Dialog
.
alert
({
title
:
'提示'
,
message
:
'该设备不允许借用'
,
}).
then
(()
=>
{
router
.
back
();
});
}
else
if
(
equipmentRes
.
data
.
isLend
==
1
){
Dialog
.
alert
({
title
:
'提示'
,
message
:
'该设备已借出'
,
}).
then
(()
=>
{
router
.
back
();
});
}
}
});
//借用日期确认
const
onConfirmBorrowTime
=
(
date
)
=>
{
borrow
Time
.
valu
e
=
`
${
date
.
getFullYear
()}
-
${
date
.
getMonth
()
+
1
}
-
${
date
.
getDate
()}
`
borrow
Form
.
borrowTim
e
=
`
${
date
.
getFullYear
()}
-
${
date
.
getMonth
()
+
1
}
-
${
date
.
getDate
()}
`
// returnTime.value = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
showPicker
.
value
=
false
;
console
.
log
(
'date'
,
date
)
console
.
log
(
'borrowTime.value'
,
borrow
Time
.
valu
e
)
console
.
log
(
'borrowTime.value'
,
borrow
Form
.
borrowTim
e
)
};
//返回上一页
...
...
@@ -86,13 +140,26 @@ const goback = () => {
};
//表单提交
const
onSubmit
=
()
=>
{
if
(
queryId
)
{
const
onSubmit
=
async
()
=>
{
console
.
log
(
'queryEncode'
,
queryEncode
)
const
params
=
{
equipmentId
:
borrowForm
.
id
,
borrowTime
:
borrowForm
.
borrowTime
,
borrowById
:
store
.
state
.
userInfo
.
userId
,
borrowBy
:
userName
,
purpose
:
borrowForm
.
purpose
,
deadline
:
Number
(
borrowForm
.
deadline
),
}
console
.
log
(
'params'
,
params
)
// 调接口
let
result
=
await
submitBorrowDetail
(
params
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
)
{
router
.
back
();
}
else
{
Toast
(
"借用成功"
);
}
}
</
script
>
...
...
src/views/teacher/schoolProperty/borrowList.vue
View file @
50341b1c
<
template
>
<van-nav-bar
title=
"物品借用"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<van-nav-bar
title=
"物品借用"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<div
class=
"flexBLock searchBlock"
>
<van-search
class=
"searchInput"
v-model=
"searchKey"
placeholder=
"请输入搜索关键词"
/>
<van-icon
name=
"scan"
@
click=
"getCode"
/>
...
...
@@ -34,6 +34,7 @@ import { useRouter } from "vue-router";
import
{
onMounted
,
ref
}
from
"vue"
;
import
{
useStore
}
from
"vuex"
;
import
{
scanCodeFun
}
from
"../../../utils/scanCode"
import
{
Toast
}
from
"vant"
;
const
router
=
useRouter
();
const
store
=
useStore
();
...
...
@@ -43,18 +44,39 @@ const loading = ref(false)
const
list
=
ref
([]);
const
pullLoading
=
ref
(
false
);
const
finished
=
ref
(
false
);
const
pageNum
=
ref
(
0
);
//扫码获取
const
getCode
=
()
=>
{
let
enCode
=
scanCodeFun
(
store
.
state
.
appid
)
//获取到的设备自编码
scanCodeFun
(
store
.
state
.
appid
,
1
)
//获取到的设备自编码
// let enCode = scanCodeFun(store.state.appid,1) //获取到的设备自编码
//测试
// router.push({
// path: "/schoolProperty/borrow/detail",
// query: {
// encode:'100101202300003'
// }
// })
}
//获取列表数据
const
getList
=
async
()
=>
{
if
(
pullLoading
.
value
)
{
list
.
value
=
[];
pageNum
.
value
=
0
;
pullLoading
.
value
=
false
;
}
let
result
=
await
getBorrowList
(
id
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
loading
.
value
=
false
;
list
.
value
=
result
.
data
finished
.
value
=
true
}
else
{
Toast
(
"获取信息失败!"
);
finished
.
value
=
true
;
loading
.
value
=
false
;
return
;
}
}
...
...
@@ -76,7 +98,10 @@ const goback = () => {
//下拉刷新
const
onRefresh
=
()
=>
{
finished
.
value
=
false
;
loading
.
value
=
true
;
pullLoading
.
value
=
true
;
getList
()
};
</
script
>
...
...
src/views/teacher/schoolProperty/deviceList.vue
View file @
50341b1c
<
template
>
<van-nav-bar
title=
"设备报修"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<div
class=
"flexBLock searchBlock"
>
<van-search
class=
"searchInput"
v-model=
"searchKey"
placeholder=
"请输入搜索关键词"
/>
<van-icon
name=
"scan"
/>
<van-search
class=
"searchInput"
@
search=
"onSearch"
v-model=
"searchKey"
placeholder=
"请输入搜索关键词"
/>
<van-icon
name=
"scan"
@
click=
"getCode"
/>
</div>
<van-pull-refresh
v-model=
"pullLoading"
@
refresh=
"onRefresh"
>
<van-list
v-model:loading=
"loading"
:finished=
"finished"
finished-text=
"没有更多了"
@
load=
"getList"
>
<div
style=
"position:relative;"
v-for=
"(item,index) in list"
:key=
"index"
class=
"listBlock"
>
<div>
自编码:
{{
item
.
encode
}}
</div>
<div>
设备名称:
{{
item
.
equipmentName
}}
</div>
<div>
型号:
{{
item
.
model
}}
}
</div>
<div>
型号:
{{
item
.
model
}}
</div>
<div>
投产日期:
{{
item
.
dateOfProduction
}}
</div>
<div>
地点:
{{
item
.
place
}}
</div>
<div>
报修日期:
{{
item
.
reportRepairTime
}}
</div>
<div>
报修人:
{{
item
.
reportRepair
}}
</div>
<div>
问题:
{{
item
.
problem
}}
</div>
<div
class=
"flexBLock btnBlock"
>
<div
v-if=
"item.disposeState == 0"
class=
"flexBLock btnBlock"
>
<van-button
size=
"small"
round
type=
"primary"
class=
"btn"
@
click=
"toDetail('修改',item.id)"
>
修 改
</van-button>
<van-button
size=
"small"
round
type=
"success"
class=
"btn"
@
click=
"toDetail('反馈',item.id)"
>
反 馈
</van-button>
<van-button
size=
"small"
round
type=
"default"
class=
"btn"
@
click=
"toDetail('查看',item.id)"
>
查 看
</van-button>
<van-button
size=
"small"
round
type=
"danger"
class=
"btn"
@
click=
"deleteDevice(item.id)"
>
删 除
</van-button>
</div>
<div
v-if=
"item.disposeState == 1"
>
<van-button
style=
"margin-right: 10px"
size=
"small"
round
type=
"success"
class=
"btn"
@
click=
"toDetail('反馈',item.id)"
>
反 馈
</van-button>
<van-button
size=
"small"
round
type=
"default"
class=
"btn"
@
click=
"toDetail('查看',item.id)"
>
查 看
</van-button>
</div>
<div
class=
"state"
>
<div
v-if=
"item.repairState == 0 && item.disposeState == 1"
class=
"fixed"
>
已
完成
-已维修
</div>
<div
v-if=
"item.repairState == 1 && item.disposeState == 1"
class=
"unable"
>
已
完成
-已维修
</div>
<div
v-if=
"item.repairState == 0 && item.disposeState == 1"
class=
"fixed"
>
已
处理
-已维修
</div>
<div
v-if=
"item.repairState == 1 && item.disposeState == 1"
class=
"unable"
>
已
处理
-已维修
</div>
</div>
</div>
</van-list>
...
...
@@ -30,19 +34,20 @@
</
template
>
<
script
setup
>
import
{
getDeviceList
}
from
"@/service/schoolProperty"
import
{
getDeviceList
,
deletEuipemnt
}
from
"@/service/schoolProperty"
import
{
useRouter
}
from
"vue-router"
;
import
{
onMounted
,
ref
}
from
"vue"
;
import
{
useStore
}
from
"vuex"
;
import
{
Toast
}
from
"vant"
;
import
{
scanCodeFun
}
from
"../../../utils/scanCode"
;
const
router
=
useRouter
();
const
store
=
useStore
();
const
id
=
store
.
state
.
userInfo
.
userId
;
console
.
log
(
'id'
,
id
)
const
rolesArr
=
store
.
state
.
userInfo
.
roles
;
let
searchKey
=
ref
(
''
)
const
loading
=
ref
(
false
)
const
list
=
ref
([]);
const
pullLoading
=
ref
(
false
);
const
finished
=
ref
(
false
);
...
...
@@ -51,14 +56,42 @@ onMounted( () => {
});
//获取列表数据
const
getList
=
async
()
=>
{
console
.
log
(
'id'
,
id
)
if
(
pullLoading
.
value
)
{
list
.
value
=
[];
pageNum
.
value
=
0
;
pullLoading
.
value
=
false
;
}
let
result
=
await
getDeviceList
(
id
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
loading
.
value
=
false
;
list
.
value
=
result
.
data
finished
.
value
=
true
}
else
{
Toast
(
"获取信息失败!"
);
finished
.
value
=
true
;
loading
.
value
=
false
;
return
;
}
}
//搜索
const
onSearch
=
(
val
)
=>
{
console
.
log
(
'搜索val'
,
val
)
}
//扫码获取
const
getCode
=
()
=>
{
scanCodeFun
(
store
.
state
.
appid
,
4
)
//获取到的设备自编码
// let enCode = scanCodeFun(store.state.appid,4) //获取到的设备自编码
//测试
// router.push({
// path: "/schoolProperty/device/info",
// query: {
// encode:'100101202300003',
// name:'新增'
// }
// })
}
//详情按钮
const
toDetail
=
(
name
,
id
)
=>
{
console
.
log
(
'id'
,
id
)
...
...
@@ -71,8 +104,14 @@ const toDetail = (name,id) => {
})
}
//删除按钮
const
deleteDevice
=
()
=>
{
const
deleteDevice
=
async
(
id
)
=>
{
console
.
log
(
'id'
,
id
)
let
result
=
await
deletEuipemnt
(
id
)
if
(
result
.
code
==
200
){
Toast
.
success
(
"删除成功"
);
getList
()
}
console
.
log
(
'result'
,
result
)
}
//返回上一页
const
goback
=
()
=>
{
...
...
@@ -81,7 +120,10 @@ const goback = () => {
//下拉刷新
const
onRefresh
=
()
=>
{
finished
.
value
=
false
;
loading
.
value
=
true
;
pullLoading
.
value
=
true
;
getList
()
};
</
script
>
...
...
src/views/teacher/schoolProperty/deviceListInfo.vue
View file @
50341b1c
This diff is collapsed.
Click to expand it.
src/views/teacher/schoolProperty/equipmentFix.vue
0 → 100644
View file @
50341b1c
<
template
>
<van-nav-bar
title=
"设备维修"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<div
class=
"flexBLock searchBlock"
>
<van-search
class=
"search"
v-model=
"searchKey"
show-action
placeholder=
"请输入搜索关键词"
>
<template
#
action
>
<div
@
click=
"onClickSearch"
>
搜 索
</div>
</
template
>
</van-search>
</div>
<van-pull-refresh
v-model=
"pullLoading"
@
refresh=
"onRefresh"
>
<van-list
v-model:loading=
"loading"
:finished=
"finished"
finished-text=
"没有更多了"
@
load=
"getList"
>
<div
style=
"position:relative;"
v-for=
"(item,index) in list"
:key=
"index"
class=
"listBlock"
@
click=
"toDetail(item)"
>
<div>
自编码:{{ item.encode }}
</div>
<div>
修理人:{{ item.repairName }}
</div>
<div>
修理时间:{{ item.repairTime }}
</div>
<div>
修理状态:{{ item. disposeState}}
</div>
<div>
报修人确认:{{item.repairState}}
</div>
<div>
备注:{{ item.remark }}
</div>
<div
class=
"state"
>
<div
v-if=
"item.disposeState == 1"
class=
"fixed"
>
已完成
</div>
<div
v-if=
"item.disposeState == 0"
class=
"unable"
>
待维修
</div>
</div>
</div>
</van-list>
</van-pull-refresh>
</template>
<
script
setup
>
import
{
getMaintenanceList
,
getMaintenanceDetail
}
from
"@/service/schoolProperty"
import
{
useRouter
}
from
"vue-router"
;
import
{
onMounted
,
ref
}
from
"vue"
;
import
{
useStore
}
from
"vuex"
;
import
{
Toast
}
from
"vant"
;
import
{
scanCodeFun
}
from
"../../../utils/scanCode"
;
const
router
=
useRouter
();
const
store
=
useStore
();
const
id
=
store
.
state
.
userInfo
.
userId
;
console
.
log
(
'id'
,
id
)
const
rolesArr
=
store
.
state
.
userInfo
.
roles
;
let
searchKey
=
ref
(
''
)
const
loading
=
ref
(
false
)
const
list
=
ref
([]);
const
pullLoading
=
ref
(
false
);
const
finished
=
ref
(
false
);
onMounted
(
()
=>
{
});
//搜索按钮
const
onClickSearch
=
()
=>
{
console
.
log
(
'searchKey.value'
,
searchKey
.
value
)
}
//获取列表数据
const
getList
=
async
()
=>
{
if
(
pullLoading
.
value
)
{
list
.
value
=
[];
pageNum
.
value
=
0
;
pullLoading
.
value
=
false
;
}
let
result
=
await
getMaintenanceList
()
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
loading
.
value
=
false
;
list
.
value
=
result
.
data
finished
.
value
=
true
list
.
value
.
map
(
item
=>
{
if
(
item
.
repairState
==
"1"
){
item
.
repairState
=
"已损坏"
}
if
(
item
.
repairState
==
"0"
){
item
.
repairState
=
"已维修"
}
if
(
item
.
disposeState
==
"1"
){
item
.
disposeState
=
"已处理"
}
if
(
item
.
disposeState
==
"0"
)
{
item
.
disposeState
=
"待处理"
}
})
}
else
{
Toast
(
"获取信息失败!"
);
finished
.
value
=
true
;
loading
.
value
=
false
;
return
;
}
}
//扫码获取
// const getCode = () => {
// let enCode = scanCodeFun(store.state.appid,4) //获取到的设备自编码
//测试
// router.push({
// path: "/schoolProperty/device/info",
// query: {
// encode:'100101202300003',
// name:'新增'
// }
// })
// }
//详情按钮
const
toDetail
=
(
item
)
=>
{
console
.
log
(
'item'
,
item
)
router
.
push
({
path
:
"/schoolProperty/equipmentFix/equipmentFixDetail"
,
query
:{
id
:
item
.
id
}
})
}
//返回上一页
const
goback
=
()
=>
{
router
.
back
();
};
//下拉刷新
const
onRefresh
=
()
=>
{
finished
.
value
=
false
;
loading
.
value
=
true
;
pullLoading
.
value
=
true
;
getList
()
};
</
script
>
<
style
scoped
>
.btnBlock
{
flex-wrap
:
wrap
;
}
.btn
{
width
:
75px
;
margin-top
:
10px
;
}
.state
{
position
:
absolute
;
top
:
0
;
right
:
0
;
}
.fixed
{
background
:
#07c160
;
color
:
#FFFFFF
;
border-radius
:
5px
10px
;
width
:
100px
;
text-align
:
center
;
}
.unable
{
background
:
gray
;
color
:
#FFFFFF
;
border-radius
:
5px
10px
;
width
:
100px
;
text-align
:
center
;
}
.search
{
width
:
98%
;
}
::v-deep
.van-search__action
{
background
:
#f7f8fa
;
margin-left
:
10px
;
}
</
style
>
src/views/teacher/schoolProperty/equipmentFixDetail.vue
0 → 100644
View file @
50341b1c
<
template
>
<van-nav-bar
title=
"报修单反馈"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<!--
<div
class=
"card"
>
-->
<!--
<div
class=
"title"
>
报修台账新增
</div>
-->
<van-form
class=
"formBlock"
label-align=
"right"
label-width=
"70px"
>
<van-cell-group
inset
>
<van-field
readonly
v-model=
"fixForm.encode"
name=
"自编码"
label=
"自编码"
placeholder=
"自编码"
:rules=
"[
{ required: true, message: '请填写自编码' }]"
/>
<van-field
readonly
v-model=
"fixForm.equipmentName"
name=
"设备名称"
label=
"设备名称"
placeholder=
"设备名称"
:rules=
"[
{ required: true, message: '请填写设备名称' }]"
/>
<van-field
readonly
v-model=
"fixForm.model"
name=
"型号"
label=
"型号"
placeholder=
"型号"
:rules=
"[
{ required: true, message: '请填写设备型号' }]"
/>
<van-field
readonly
v-model=
"fixForm.dateOfProduction"
name=
"投产日期"
label=
"投产日期"
placeholder=
"投产日期"
:rules=
"[
{ required: true, message: '请填写投产日期' }]"
/>
<van-field
readonly
v-model=
"fixForm.place"
name=
"地点"
label=
"地点"
placeholder=
"地点"
:rules=
"[
{ required: true, message: '请填写地点' }]"
/>
<van-field
v-model=
"fixForm.reportRepairTime"
readonly
name=
"calendar"
label=
"报修时间"
placeholder=
"请填写报修时间"
:rules=
"[
{ required: true, message: '请填写报修时间' }]"
/>
<van-field
readonly
v-model=
"fixForm.reportRepair"
name=
"报修人"
label=
"报修人"
placeholder=
"报修人"
:rules=
"[
{ required: true, message: '请填写报修人' }]"
/>
<van-field
v-model=
"fixForm.problem"
name=
"问题"
label=
"问题"
placeholder=
"问题"
:rules=
"[
{ required: true, message: '请填写问题' }]"
/>
<van-field
v-model=
"fixForm.repairName"
readonly
label=
"修理人"
/>
<van-field
v-model=
"fixForm.repairTime"
readonly
name=
"修理时间"
label=
"修理时间"
placeholder=
"修理时间"
:rules=
"[
{ required: true, message: '请填写修理时间' }]"
/>
<van-field
v-model=
"fixForm.repairStateName"
readonly
label=
"修理状态"
/>
<van-field
v-model=
"fixForm.disposeStateName"
readonly
label=
"报修人确认"
/>
<van-field
readonly
v-model=
"fixForm.remark"
name=
"备注"
label=
"备注"
placeholder=
"备注"
:rules=
"[
{ required: true, message: '请填写维修备注' }]"
/>
</van-cell-group>
<van-button
round
block
type=
"primary"
size=
"small"
style=
"width: 80px;margin:0 auto"
@
click=
"goback"
>
关 闭
</van-button>
</van-form>
<!--
</div>
-->
</
template
>
<
script
setup
>
import
{
getMaintenanceDetail
}
from
"@/service/schoolProperty"
import
{
formatDatetime
}
from
"@/utils/time.js"
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
ref
,
onMounted
,
reactive
}
from
"vue"
;
import
{
useStore
}
from
"vuex"
;
import
{
Toast
}
from
"vant"
;
const
router
=
useRouter
();
const
route
=
useRoute
();
const
store
=
useStore
();
const
queryEncode
=
route
.
query
.
encode
;
const
userName
=
store
.
state
.
userInfo
.
teacherName
const
userId
=
store
.
state
.
userInfo
.
userId
const
title
=
ref
(
""
);
const
name
=
route
.
query
.
name
;
const
id
=
route
.
query
.
id
;
const
encode
=
route
.
query
.
encode
;
const
fixForm
=
reactive
({
encode
:
''
,
//自编码
equipmentName
:
''
,
//设备名称
model
:
''
,
//型号
dateOfProduction
:
''
,
//投产日期
place
:
''
,
//地点
reportRepairTime
:
''
,
//报修时间
reportRepair
:
''
,
//报修人
problem
:
''
,
//问题
repairName
:
''
,
//修理人
repairId
:
''
,
//修理人id
repairPhone
:
''
,
//修理人电话
repairTime
:
''
,
//修理时间
repairState
:
''
,
//维修结果
repairStateName
:
''
,
//维修结果文本
disposeState
:
''
,
//报修人确认
disposeStateName
:
''
,
//报修人确认文本
remark
:
''
,
//备注
})
const
evaluate
=
ref
();
const
showState
=
ref
(
false
);
//维修结果
const
repairState
=
(
value
)
=>
{
console
.
log
(
'value'
,
value
)
fixForm
.
repairStateName
=
value
.
text
;
fixForm
.
repairState
=
value
.
id
;
showState
.
value
=
false
;
};
const
showPicker
=
ref
(
false
);
const
columns
=
ref
([]);
onMounted
(
async
()
=>
{
let
repairResult
=
await
getMaintenanceDetail
(
id
)
if
(
repairResult
.
code
==
200
){
console
.
log
(
'repairResult'
,
repairResult
)
Object
.
assign
(
fixForm
,
repairResult
.
data
)
if
(
repairResult
.
repairState
==
'0'
){
fixForm
.
repairStateName
=
'已维修'
}
else
{
fixForm
.
repairStateName
=
'已损坏'
}
if
(
repairResult
.
disposeState
==
'0'
){
fixForm
.
disposeStateName
=
'待处理'
}
else
{
fixForm
.
disposeStateName
=
'已处理'
}
}
});
//返回上一页
const
goback
=
()
=>
{
router
.
back
();
};
</
script
>
<
style
scoped
>
.card
{
margin
:
10px
;
border
:
1px
solid
silver
;
border-radius
:
5px
;
}
.title
{
margin-top
:
10px
;
font-size
:
16px
;
margin-left
:
10px
;
}
.title
:before
{
content
:
''
;
height
:
3px
;
width
:
5px
;
border
:
3px
solid
#1989fa
;
border-radius
:
5px
;
margin-right
:
5px
;
}
</
style
>
src/views/teacher/schoolProperty/equipmentInfo.vue
0 → 100644
View file @
50341b1c
<
template
>
<van-nav-bar
title=
"设备信息"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<van-form
class=
"formBlock"
label-align=
"right"
label-width=
"90px"
>
<van-cell-group
inset
>
<van-field
readonly
v-model=
"equipmentForm.encode"
label=
"自编码"
/>
<van-field
readonly
v-model=
"equipmentForm.equipmentName"
label=
"设备名称"
/>
<van-field
readonly
v-model=
"equipmentForm.model"
label=
"型号"
/>
<van-field
readonly
v-model=
"equipmentForm.specification"
label=
"规格"
/>
<van-field
readonly
v-model=
"equipmentForm.classificationCode"
label=
"分类编码"
/>
<van-field
readonly
v-model=
"equipmentForm.unit"
label=
"单位"
/>
<van-field
readonly
v-model=
"affiliationType"
label=
"归属类型"
/>
<van-field
readonly
v-model=
"equipmentState"
label=
"设备状态"
/>
<van-field
readonly
v-model=
"isAllowLend"
label=
"是否允许借出"
/>
<van-field
readonly
v-model=
"isLend"
label=
"是否借出"
/>
<van-field
readonly
v-model=
"equipmentForm.dateOfProduction"
label=
"投产日期"
/>
<van-field
readonly
v-model=
"equipmentForm.price"
label=
"价格(元)"
/>
<van-field
readonly
v-model=
"equipmentForm.lifeOfUtility"
label=
"效用年限(年)"
/>
<van-field
readonly
v-model=
"equipmentForm.model"
label=
"地点"
/>
<van-field
readonly
v-model=
"equipmentForm.useName"
label=
"使用人"
/>
<van-field
readonly
v-model=
"equipmentForm.remark"
label=
"备注"
/>
</van-cell-group>
<van-button
round
block
type=
"primary"
size=
"small"
style=
"width: 80px;margin:0 auto"
@
click=
"goback"
>
关 闭
</van-button>
</van-form>
</
template
>
<
script
setup
>
import
{
reactive
,
ref
,
onMounted
}
from
"vue"
;
import
{
scanEquipmentInfo
}
from
"@/service/schoolProperty"
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
Dialog
,
Toast
}
from
"vant"
;
import
{
useStore
}
from
"vuex"
;
const
equipmentForm
=
reactive
({
encode
:
''
,
equipmentName
:
''
,
model
:
''
,
specification
:
''
,
classificationCode
:
''
,
unit
:
''
,
dateOfProduction
:
''
,
price
:
''
,
lifeOfUtility
:
''
,
place
:
''
,
useName
:
''
,
remark
:
''
})
const
affiliationType
=
ref
(
''
)
const
equipmentState
=
ref
(
''
)
const
isAllowLend
=
ref
(
''
)
const
isLend
=
ref
(
''
)
const
router
=
useRouter
();
const
route
=
useRoute
();
const
store
=
useStore
();
const
queryEncode
=
route
.
query
.
encode
onMounted
(
async
()
=>
{
let
result
=
await
scanEquipmentInfo
(
queryEncode
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
Object
.
assign
(
equipmentForm
,
result
.
data
)
if
(
result
.
data
.
affiliationType
==
'1'
){
affiliationType
.
value
=
'公共区域'
}
else
if
(
result
.
data
.
affiliationType
==
'2'
){
affiliationType
.
value
=
'信息中心'
}
else
{
affiliationType
.
value
=
'个人'
}
if
(
result
.
data
.
equipmentState
==
'1'
){
equipmentState
.
value
=
'完好'
}
else
if
(
result
.
data
.
equipmentState
==
'2'
){
equipmentState
.
value
=
'损坏'
}
else
{
equipmentState
.
value
=
'报废'
}
if
(
result
.
data
.
isAllowLend
==
'1'
){
isAllowLend
.
value
=
'是'
}
else
{
isAllowLend
.
value
=
'否'
}
if
(
result
.
data
.
isLend
==
'1'
){
isLend
.
value
=
'是'
}
else
{
isLend
.
value
=
'否'
}
}
})
//返回上一页
const
goback
=
()
=>
{
router
.
back
();
};
</
script
>
<
style
scoped
>
</
style
>
src/views/teacher/schoolProperty/index.vue
View file @
50341b1c
<
template
>
<van-nav-bar
title=
"校产管理"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<van-nav-bar
title=
"校产管理"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
>
<template
#
right
>
<van-icon
name=
"scan"
size=
"18"
@
click=
"getCode"
/>
</
template
>
</van-nav-bar>
<!-- <!– 维修人员只能看维修–>-->
<!-- <div v-if="roleRepair" >-->
<!-- <div class="deviceBlock" @click="toPage(2)">-->
<!-- <!– <div class="deviceBlock" @click="toPage(2)">–>-->
<!-- <van-image class="leftImg" :src="require('../../../assets/icon/device.png')"/>-->
<!-- <div>设备报修</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div v-else>-->
<div
class=
"borrowBlock"
@
click=
"toPage(3)"
>
<van-image
class=
"leftImg"
:src=
"require('../../../assets/icon/wallet.png')"
/>
<div>
物品借用
</div>
</div>
<div
class=
"returnBlock"
@
click=
"toPage(0)"
>
<div
v-if=
"roleAdmin"
class=
"returnBlock"
@
click=
"toPage(0)"
>
<!-- <div class="returnBlock" @click="toPage(0)">-->
<van-image
class=
"leftImg"
:src=
"require('../../../assets/icon/return.png')"
/>
<div>
物品归还
</div>
</div>
<div
class=
"useBlock"
@
click=
"toPage(1)"
>
<van-image
class=
"leftImg"
:src=
"require('../../../assets/icon/use.png')"
/>
<div>
物品领用
</div>
</div>
<div
class=
"deviceBlock"
@
click=
"toPage(2)"
>
<!-- <div class="deviceBlock" @click="toPage(2)">-->
<van-image
class=
"leftImg"
:src=
"require('../../../assets/icon/device.png')"
/>
<div>
设备报修
</div>
</div>
<div
v-if=
"roleRepair"
class=
"fixBlock"
@
click=
"toPage(4)"
>
<!-- <div class="deviceBlock" @click="toPage(2)">-->
<van-image
class=
"leftImg"
:src=
"require('../../../assets/icon/fix.png')"
/>
<div>
设备维修
</div>
</div>
<!-- </div>-->
</template>
<
script
setup
>
import
{
useRouter
}
from
"vue-router"
;
import
{
scanCodeFun
}
from
"../../../utils/scanCode"
;
import
{
useStore
}
from
"vuex"
;
import
{
onMounted
,
ref
}
from
"vue"
;
const
store
=
useStore
();
const
router
=
useRouter
();
console
.
log
(
'store'
,
store
.
state
.
userInfo
.
roles
)
const
rolesArr
=
store
.
state
.
userInfo
.
roles
const
roleAdmin
=
ref
()
const
roleRepair
=
ref
()
onMounted
(
()
=>
{
rolesArr
.
find
(
item
=>
{
if
(
item
==
"productCategoryAdmin"
){
return
roleAdmin
.
value
=
true
}
else
{
roleAdmin
.
value
=
false
}
})
// if(rolesArr.l)
rolesArr
.
find
(
item
=>
{
if
(
item
==
"maintain"
){
return
roleRepair
.
value
=
true
}
else
{
roleRepair
.
value
=
false
}
})
console
.
log
(
'roleAdmin.value'
,
roleAdmin
.
value
)
console
.
log
(
'roleRepair.value'
,
roleRepair
.
value
)
})
//扫码获取
const
getCode
=
()
=>
{
scanCodeFun
(
store
.
state
.
appid
,
0
)
//获取到的设备自编码
// let enCode = scanCodeFun(store.state.appid,0) //获取到的设备自编码
//测试
// router.push({
// path: "/schoolProperty/equipmentInfo",
// query: {
// encode:'100101202300003'
// }
// })
}
const
toPage
=
(
type
)
=>
{
if
(
type
==
0
){
// 归还管理
...
...
@@ -38,11 +103,16 @@ const toPage = (type) => {
router
.
push
({
path
:
"/schoolProperty/device"
,
});
}
else
{
}
else
if
(
type
==
3
)
{
// 物品借用
router
.
push
({
path
:
"/schoolProperty/borrow"
,
});
}
else
{
//设备维修
router
.
push
({
path
:
"/schoolProperty/equipmentFix"
,
});
}
}
...
...
@@ -53,7 +123,7 @@ const goback = () => {
</
script
>
<
style
scoped
>
.returnBlock
,
.deviceBlock
,
.useBlock
,
.borrowBlock
{
.returnBlock
,
.deviceBlock
,
.useBlock
,
.borrowBlock
,
.fixBlock
{
padding
:
20px
30px
;
border-radius
:
12px
;
color
:
#FFFFFF
;
...
...
@@ -76,6 +146,9 @@ const goback = () => {
.useBlock
{
background
:
linear-gradient
(
to
right
,
#FDAE86
,
#EA4A6B
);
}
.fixBlock
{
background
:
linear-gradient
(
to
right
,
#EA4A6B
,
#b971c1
);
}
.leftImg
{
width
:
56px
;
height
:
56px
;
...
...
src/views/teacher/schoolProperty/returnDetail.vue
0 → 100644
View file @
50341b1c
<
template
>
<van-nav-bar
:title=
title
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<van-form
@
submit=
"onSubmit"
class=
"formBlock"
label-align=
"right"
label-width=
"110px"
>
<van-cell-group
inset
>
<van-field
readonly
v-model=
"returnForm.model"
label=
"型号"
placeholder=
"请输入型号"
/>
<van-field
readonly
v-model=
"returnForm.encode"
label=
"自编码"
placeholder=
"请输入自编码"
/>
<van-field
readonly
v-model=
"returnForm.borrowBy"
label=
"借用人"
placeholder=
"请输入借用人"
/>
<van-field
readonly
v-model=
"returnForm.receivedBy"
label=
"接收人"
placeholder=
"请输入接收人"
/>
<!--
<div
v-if=
"queryId"
>
-->
<van-field
readonly
v-model=
"returnForm.borrowTime"
label=
"借用日期"
/>
<!--
</div>
-->
<!--
<div
v-else
>
-->
<!--
<van-field
is-link
readonly
v-model=
"borrowTime"
label=
"借用日期"
@
click=
"showPicker = true"
--
>
<!-- placeholder="请选择借用日期"/>-->
<!--
<van-calendar
:readonly=
"queryId ? true : false"
v-model:show=
"showPicker"
@
confirm=
"onConfirmBorrowTime"
/>
-->
<!--
</div>
-->
<!--
<div
v-if=
"queryId"
>
-->
<van-field
readonly
v-model=
"returnForm.returnTime"
label=
"归还日期"
/>
<!--
</div>
-->
<van-field
readonly
v-model=
"returnForm.deadline"
label=
"借用期限"
placeholder=
"请输入借用期限"
/>
<van-field
:readonly=
"queryId ? true : false"
v-model=
"returnForm.returnEquipmentCondition"
label=
"归还时设备情况"
/>
<van-field
:readonly=
"queryId ? true : false"
v-model=
"returnForm.remark"
label=
"备注"
placeholder=
"请输入备注"
/>
</van-cell-group>
<div
v-if=
"queryId"
style=
"margin: 30px; display: flex;justify-content: center"
>
<van-button
round
type=
"primary"
size=
"small"
style=
"width: 80px;margin-left: 20px;"
@
click=
"goback"
>
关 闭
</van-button>
</div>
<div
v-else
style=
"margin: 30px; display: flex;justify-content: center"
>
<van-button
round
size=
"small"
style=
"width: 80px;"
type=
"primary"
native-type=
"submit"
>
确 定
</van-button>
<van-button
round
type=
"success"
size=
"small"
style=
"width: 80px;margin-left: 20px;"
@
click=
"goback"
>
取 消
</van-button>
</div>
</van-form>
</
template
>
<
script
setup
>
import
moment
from
'moment'
;
import
{
returnEquipment
,
getEquipmentDetail
}
from
"@/service/schoolProperty"
import
{
reactive
,
ref
,
onMounted
}
from
"vue"
;
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
Dialog
,
Toast
}
from
"vant"
;
import
{
useStore
}
from
"vuex"
;
import
{
formatDatetime
}
from
"@/utils/time.js"
const
router
=
useRouter
();
const
route
=
useRoute
();
const
queryId
=
route
.
query
.
id
;
const
queryEncode
=
route
.
query
.
encode
;
console
.
log
(
'queryEncode'
,
queryEncode
)
const
store
=
useStore
()
const
userName
=
store
.
state
.
userInfo
.
teacherName
const
userId
=
store
.
state
.
userInfo
.
userId
let
title
=
ref
(
''
)
// 页面标题
let
returnForm
=
reactive
({
// 表单数据
encode
:
''
,
//自编码
equipmentName
:
''
,
//设备名称
model
:
''
,
//型号
borrowTime
:
''
,
// 借用日期
borrowBy
:
''
,
//借用人
purpose
:
''
,
//用途
deadline
:
''
,
//借用期限(天)
returnTime
:
''
,
//归还日期
returnEquipmentCondition
:
''
,
//归还时设备情况
receivedBy
:
''
})
onMounted
(
async
()
=>
{
if
(
queryId
)
{
let
result
=
await
getEquipmentDetail
(
queryEncode
)
console
.
log
(
'result'
,
result
)
title
.
value
=
'归还情况查看'
Object
.
assign
(
returnForm
,
result
.
data
)
returnForm
.
borrowTime
=
result
.
data
.
borrowTime
returnForm
.
returnTime
=
result
.
data
.
returnTime
returnForm
.
deadline
=
returnForm
.
returnTime
-
returnForm
.
borrowTime
}
else
{
title
.
value
=
'物品归还'
let
equipmentRes
=
await
getEquipmentDetail
(
queryEncode
)
console
.
log
(
'equipmentRes'
,
equipmentRes
.
data
)
console
.
log
(
'returnForm'
,
returnForm
)
Object
.
assign
(
returnForm
,
equipmentRes
.
data
)
returnForm
.
receivedBy
=
userName
returnForm
.
returnTime
=
formatDatetime
(
new
Date
())
// const date1 = moment(returnForm.returnTime).format('YYYY/MM/DD HH:mm:ss')
const
newDay
=
moment
(
returnForm
.
returnTime
).
diff
(
moment
(
returnForm
.
borrowTime
),
'days'
)
if
(
newDay
==
0
){
const
minute
=
moment
(
returnForm
.
returnTime
).
diff
(
moment
(
returnForm
.
borrowTime
),
'minute'
)
returnForm
.
deadline
=
Math
.
floor
(
minute
/
60
)
+
'小时'
}
else
{
returnForm
.
deadline
=
moment
(
returnForm
.
returnTime
).
diff
(
moment
(
returnForm
.
borrowTime
),
'days'
)
+
'天'
}
if
(
equipmentRes
.
data
.
isLend
==
'0'
){
//未借出 只会返回设备那3个基本信息
Dialog
.
alert
({
title
:
'提示'
,
message
:
'该设备未借出,无需归还'
,
}).
then
(()
=>
{
router
.
back
();
});
}
}
});
//借用日期确认
const
onConfirmBorrowTime
=
(
date
)
=>
{
borrowTime
.
value
=
`
${
date
.
getFullYear
()}
-
${
date
.
getMonth
()
+
1
}
-
${
date
.
getDate
()}
`
// returnTime.value = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
showPicker
.
value
=
false
;
console
.
log
(
'date'
,
date
)
console
.
log
(
'borrowTime.value'
,
borrowTime
.
value
)
};
//返回上一页
const
goback
=
()
=>
{
router
.
back
();
};
//表单提交
const
onSubmit
=
async
()
=>
{
console
.
log
(
'submit returnForm'
,
returnForm
)
const
params
=
{
id
:
returnForm
.
id
,
returnTime
:
returnForm
.
returnTime
,
returnEquipmentCondition
:
returnForm
.
returnEquipmentCondition
,
remark
:
returnForm
.
remark
,
receivedById
:
userId
,
receivedBy
:
userName
,
equipmentId
:
returnForm
.
equipmentId
}
console
.
log
(
'params'
,
params
)
let
result
=
await
returnEquipment
(
params
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
router
.
back
();
Toast
(
"归还成功"
);
}
}
</
script
>
<
style
scoped
>
.sureBtn
{
margin
:
30px
auto
;
width
:
80%
;
}
.van-cell-group--inset
{
margin
:
0px
;
}
</
style
>
src/views/teacher/schoolProperty/returnList.vue
View file @
50341b1c
...
...
@@ -2,29 +2,29 @@
<van-nav-bar
title=
"归还管理"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<div
class=
"flexBLock searchBlock"
>
<van-search
class=
"searchInput"
v-model=
"searchKey"
placeholder=
"请输入搜索关键词"
/>
<van-icon
name=
"scan"
/>
<van-icon
name=
"scan"
@
click=
"getCode"
/>
</div>
<van-pull-refresh
v-model=
"pullLoading"
@
refresh=
"onRefresh"
>
<van-list
v-model:loading=
"loading"
:finished=
"finished"
finished-text=
"没有更多了"
@
load=
"getList"
>
<div
v-for=
"(item,index) in list"
:key=
"index"
class=
"listBlock"
>
<div
v-for=
"(item,index) in list"
:key=
"index"
class=
"listBlock"
@
click=
"toDetailPage(item.id,item.encode)"
>
<div
class=
"flexBLock"
>
<div>
<div>
型号:
联想Y0079
</div>
<div>
自编码:
202308081101
</div>
<div>
借用人:
张蔷
</div>
<div>
借用日期:
2023-08-08 12:32:30
</div>
<div>
接收人:
张蔷
</div>
<div>
归还日期:
2023-08-08 12:32:30
</div>
<div>
归还时设备情况:
良好
</div>
<div>
型号:
{{
item
.
model
}}
</div>
<div>
自编码:
{{
item
.
encode
}}
</div>
<div>
借用人:
{{
item
.
borrowBy
}}
</div>
<div>
借用日期:
{{
item
.
borrowTime
}}
</div>
<div>
接收人:
{{
item
.
receivedBy
}}
</div>
<div>
归还日期:
{{
item
.
returnTime
}}
</div>
<div>
归还时设备情况:
{{
item
.
returnEquipmentCondition
}}
</div>
</div>
<div
class=
"listLeft"
>
<div>
7
</div>
<div>
{{
item
.
deadline
}}
</div>
<div>
借用期限(天)
</div>
</div>
</div>
<div>
备注:已借用取回,暂不外借,设备换修。已借用取回,暂不外借,设备换修。
</div>
<div
class=
"waitReturn"
>
待归还
</div>
<div
class=
"endReturn"
>
已归还
</div>
<div
v-if=
"item.returnState == 0"
class=
"waitReturn"
>
待归还
</div>
<div
v-if=
"item.returnState == 1"
class=
"endReturn"
>
已归还
</div>
</div>
</van-list>
</van-pull-refresh>
...
...
@@ -34,29 +34,78 @@
import
{
getEquipmentList
}
from
"@/service/schoolProperty"
import
{
useRouter
}
from
"vue-router"
;
import
{
ref
}
from
"vue"
;
import
{
onMounted
,
ref
,
reactive
}
from
"vue"
;
import
{
useStore
}
from
"vuex"
;
import
{
Toast
}
from
"vant"
;
import
{
scanCodeFun
}
from
"../../../utils/scanCode"
;
const
router
=
useRouter
();
const
store
=
useStore
();
const
id
=
store
.
state
.
userInfo
.
userId
;
let
searchKey
=
ref
(
''
)
const
loading
=
ref
(
false
)
const
list
=
ref
([
1
,
2
,
3
,
4
,
5
]);
const
list
=
ref
([]);
const
pullLoading
=
ref
(
false
);
const
finished
=
ref
(
false
);
const
pageNum
=
ref
(
0
);
onMounted
(
async
()
=>
{
})
//获取列表数据
const
getList
=
async
()
=>
{
if
(
pullLoading
.
value
)
{
list
.
value
=
[];
pageNum
.
value
=
0
;
pullLoading
.
value
=
false
;
}
let
result
=
await
getEquipmentList
(
id
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
loading
.
value
=
false
;
list
.
value
=
result
.
data
;
finished
.
value
=
true
}
else
{
Toast
(
"获取信息失败!"
);
finished
.
value
=
true
;
loading
.
value
=
false
;
return
;
}
}
//扫码获取
const
getCode
=
()
=>
{
scanCodeFun
(
store
.
state
.
appid
,
2
)
//获取到的设备自编码
// let enCode = scanCodeFun(store.state.appid,2) //获取到的设备自编码
// console.log(1)
//测试
// router.push({
// path: "/schoolProperty/return/detail",
// query: {
// encode:'100101202300003'
// }
// })
}
//返回上一页
const
goback
=
()
=>
{
router
.
back
();
};
//跳转详情页面
const
toDetailPage
=
(
id
,
encode
)
=>
{
console
.
log
(
'id'
,
id
)
console
.
log
(
'encode'
,
encode
)
router
.
push
({
path
:
"/schoolProperty/return/detail"
,
query
:
{
id
:
id
,
encode
:
encode
}
})
}
//下拉刷新
const
onRefresh
=
()
=>
{
finished
.
value
=
false
;
loading
.
value
=
true
;
pullLoading
.
value
=
true
;
getList
()
};
</
script
>
...
...
src/views/teacher/schoolProperty/useAdd.vue
View file @
50341b1c
...
...
@@ -2,34 +2,71 @@
<van-nav-bar
title=
"新增物品领用"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<van-form
@
submit=
"onSubmit"
class=
"formBlock"
label-align=
"right"
label-width=
"80px"
>
<van-cell-group
inset
>
<van-field
v-model=
"code"
label=
"自编码"
placeholder=
"请输入自编码"
/>
<van-field
v-model=
"code"
label=
"设备名称"
placeholder=
"请输入设备名称"
/>
<van-field
v-model=
"code"
label=
"型号"
placeholder=
"请输入型号"
/>
<van-field
is-link
readonly
v-model=
"dateChoose"
label=
"领用日期"
@
click=
"showPicker = true"
placeholder=
"请选择领用日期"
/>
<van-calendar
v-model:show=
"showPicker"
@
confirm=
"onConfirm"
/>
<van-field
v-model=
"code"
label=
"领用人"
placeholder=
"请输入领用人"
/>
<van-field
readonly
v-model=
"useForm.encode"
label=
"自编码"
placeholder=
"请输入自编码"
/>
<van-field
readonly
v-model=
"useForm.equipmentName"
label=
"设备名称"
placeholder=
"请输入设备名称"
/>
<van-field
readonly
v-model=
"useForm.model"
label=
"型号"
placeholder=
"请输入型号"
/>
<van-field
readonly
v-model=
"useForm.recipientTime"
label=
"领用日期"
placeholder=
"请输入领用日期"
/>
<van-field
readonly
v-model=
"useForm.recipientBy"
label=
"领用人"
placeholder=
"请输入领用人"
/>
</van-cell-group>
<div>
<van-button
class=
"sureBtn"
round
block
type=
"primary"
native-type=
"submit"
>
确 定
</van-button>
<div
style=
"display:flex;justify-content: center;margin: 30px"
>
<van-button
round
type=
"primary"
size=
"small"
style=
"width: 80px;"
native-type=
"submit"
>
确 定
</van-button>
<van-button
round
type=
"success"
size=
"small"
style=
"width: 80px;margin-left: 20px;"
@
click=
"goback"
>
取 消
</van-button>
</div>
</van-form>
</
template
>
<
script
setup
>
import
{
addUse
,
useDeatil
}
from
"@/service/schoolProperty"
import
{
useRouter
}
from
"vue-router"
;
import
{
ref
}
from
"vue"
;
import
{
addUse
,
useDeatil
,
scanEquipmentInfo
}
from
"@/service/schoolProperty"
import
{
formatDatetime
}
from
"@/utils/time.js"
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
onMounted
,
reactive
,
ref
}
from
"vue"
;
import
{
useStore
}
from
"vuex"
;
import
{
Dialog
,
Toast
}
from
"vant"
;
const
router
=
useRouter
();
const
code
=
ref
(
''
)
const
route
=
useRoute
();
const
store
=
useStore
()
const
queryEncode
=
route
.
query
.
encode
;
const
userId
=
store
.
state
.
userInfo
.
userId
;
const
userName
=
store
.
state
.
userInfo
.
teacherName
;
console
.
log
(
'store'
,
store
)
const
useForm
=
reactive
({
encode
:
''
,
equipmentName
:
''
,
model
:
''
,
recipientTime
:
''
,
recipientBy
:
''
})
const
dateChoose
=
ref
(
''
)
let
showPicker
=
ref
(
false
)
//是否显示日历选择
const
onConfirm
=
(
date
)
=>
{
dateChoose
.
value
=
`
${
date
.
getFullYear
()}
-
${
date
.
getMonth
()
+
1
}
-
${
date
.
getDate
()}
`
showPicker
.
value
=
false
;
};
onMounted
(
async
()
=>
{
let
equipmentRes
=
await
scanEquipmentInfo
(
queryEncode
)
console
.
log
(
'equipmentRes'
,
equipmentRes
)
if
(
equipmentRes
.
code
==
200
){
Object
.
assign
(
useForm
,
equipmentRes
.
data
)
useForm
.
recipientTime
=
formatDatetime
(
new
Date
())
useForm
.
recipientBy
=
userName
console
.
log
(
'useForm'
,
useForm
)
if
(
equipmentRes
.
data
.
affiliationType
!=
2
)
{
Dialog
.
alert
({
title
:
'提示'
,
message
:
'该设备不属于信息中心,不可领用'
,
}).
then
(()
=>
{
router
.
back
();
});
}
if
(
equipmentRes
.
data
.
isLend
==
1
){
Dialog
.
alert
({
title
:
'提示'
,
message
:
'该设备已借出,不可领用'
,
}).
then
(()
=>
{
router
.
back
();
});
}
}
})
//返回上一页
const
goback
=
()
=>
{
...
...
@@ -37,8 +74,24 @@ const goback = () => {
};
//表单提交
const
onSubmit
=
()
=>
{
}
const
onSubmit
=
async
()
=>
{
const
params
=
{
equipmentId
:
useForm
.
id
,
recipientTime
:
useForm
.
recipientTime
,
recipientById
:
userId
,
recipientBy
:
useForm
.
recipientBy
}
let
result
=
await
addUse
(
params
)
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
)
{
router
.
back
();
Toast
(
"领用成功"
);
}
};
</
script
>
<
style
scoped
>
...
...
src/views/teacher/schoolProperty/useList.vue
View file @
50341b1c
<
template
>
<van-nav-bar
title=
"物品领用"
left-text=
"返回"
left-arrow
@
click-left=
"goback"
></van-nav-bar>
<div
class=
"flexBLock searchBlock"
>
<van-search
class=
"searchInput"
v-model=
"searchKey"
placeholder=
"请输入搜索关键词"
/>
<van-icon
@
click=
"
sacnClick
"
name=
"scan"
/>
<van-search
class=
"searchInput"
@
search=
"onSearch"
v-model=
"searchKey"
placeholder=
"请输入搜索关键词"
/>
<van-icon
@
click=
"
getCode
"
name=
"scan"
/>
</div>
<van-pull-refresh
v-model=
"pullLoading"
@
refresh=
"onRefresh"
>
<van-list
v-model:loading=
"loading"
:finished=
"finished"
finished-text=
"没有更多了"
@
load=
"getList"
>
...
...
@@ -30,32 +30,65 @@ import { getUseList } from "@/service/schoolProperty"
import
{
useRouter
}
from
"vue-router"
;
import
{
ref
}
from
"vue"
;
import
{
useStore
}
from
"vuex"
;
import
{
Toast
}
from
"vant"
;
import
{
scanCodeFun
}
from
"../../../utils/scanCode"
;
const
router
=
useRouter
();
const
store
=
useStore
();
const
id
=
store
.
state
.
userInfo
.
userId
;
console
.
log
(
'store'
,
store
.
state
.
userInfo
.
userId
)
let
searchKey
=
ref
(
''
)
const
loading
=
ref
(
false
)
const
list
=
ref
([]);
const
pullLoading
=
ref
(
false
);
const
finished
=
ref
(
false
);
const
pageNum
=
ref
(
0
);
const
equipmentName
=
ref
(
''
)
//获取列表数据
const
getList
=
async
()
=>
{
let
result
=
await
getUseList
(
id
);
if
(
pullLoading
.
value
)
{
list
.
value
=
[];
pageNum
.
value
=
0
;
pullLoading
.
value
=
false
;
}
let
result
=
await
getUseList
(
id
,
equipmentName
.
value
);
console
.
log
(
'result'
,
result
)
if
(
result
.
code
==
200
){
loading
.
value
=
false
;
list
.
value
=
result
.
data
finished
.
value
=
true
}
else
{
Toast
(
"获取信息失败!"
);
finished
.
value
=
true
;
loading
.
value
=
false
;
return
;
}
}
const
onSearch
=
async
(
val
)
=>
{
list
.
value
=
[];
loading
.
value
=
true
;
equipmentName
.
value
=
val
let
searchResult
=
await
getUseList
(
id
,
equipmentName
.
value
);
console
.
log
(
'searchResult'
,
searchResult
)
if
(
searchResult
.
code
==
200
){
loading
.
value
=
false
;
list
.
value
=
searchResult
.
data
finished
.
value
=
true
}
}
//扫码获取
const
getCode
=
()
=>
{
scanCodeFun
(
store
.
state
.
appid
,
3
)
//获取到的设备自编码
//扫码
const
sacnClick
=
()
=>
{
router
.
push
({
path
:
"/schoolProperty/use/add"
,
})
// let enCode = scanCodeFun(store.state.appid,3) //获取到的设备自编码
// console.log(1)
//测试
// router.push({
// path: "/schoolProperty/use/add",
// query: {
// encode:'100101202300003'
// }
// })
}
//返回上一页
...
...
@@ -65,7 +98,10 @@ const goback = () => {
//下拉刷新
const
onRefresh
=
()
=>
{
finished
.
value
=
false
;
loading
.
value
=
true
;
pullLoading
.
value
=
true
;
getList
()
};
</
script
>
...
...
vue.config.js
View file @
50341b1c
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment