|
@@ -37,10 +37,14 @@
|
37
|
37
|
<el-table-column prop="BookBarcode" label="条形码"></el-table-column>
|
38
|
38
|
<el-table-column prop="BookName" label="书名"></el-table-column>
|
39
|
39
|
<el-table-column prop="BookTypeName" label="分类"></el-table-column>
|
40
|
|
- <el-table-column prop="ReturnDate" label="规定归还日期"></el-table-column>
|
|
40
|
+ <el-table-column label="规定归还日期">
|
|
41
|
+ <template slot-scope="scope">
|
|
42
|
+ <span>{{toolClass.dateFormat(scope.row.EndDate)}}</span>
|
|
43
|
+ </template>
|
|
44
|
+ </el-table-column>
|
41
|
45
|
<el-table-column label="逾期天数">
|
42
|
46
|
<template slot-scope="scope">
|
43
|
|
- <span>{{ diffToday(scope.row.ReturnDate) }}</span>
|
|
47
|
+ <span>{{ diffToday(scope.row.EndDate) }}</span>
|
44
|
48
|
</template>
|
45
|
49
|
</el-table-column>
|
46
|
50
|
<el-table-column fixed="right" label="操作" width="150">
|
|
@@ -51,7 +55,7 @@
|
51
|
55
|
</el-table>
|
52
|
56
|
|
53
|
57
|
<div :style="{ paddingTop: '40px' }">
|
54
|
|
- <el-button @click="$router.back()">取消</el-button>
|
|
58
|
+ <el-button @click="cancel()">取消</el-button>
|
55
|
59
|
</div>
|
56
|
60
|
</div>
|
57
|
61
|
</div>
|
|
@@ -85,7 +89,8 @@ export default {
|
85
|
89
|
...mapActions({
|
86
|
90
|
getBorrowHistory: 'getBorrowHistory',
|
87
|
91
|
getList: 'getReturnList',
|
88
|
|
- returnBook: 'returnBook'
|
|
92
|
+ returnBook: 'returnBook',
|
|
93
|
+ getUserReturn: 'getUserReturn'
|
89
|
94
|
}),
|
90
|
95
|
|
91
|
96
|
nextStep() {
|
|
@@ -109,8 +114,21 @@ export default {
|
109
|
114
|
type: 'error'
|
110
|
115
|
})
|
111
|
116
|
})
|
|
117
|
+ this.getList()
|
112
|
118
|
},
|
|
119
|
+ getList () {
|
|
120
|
+ this.getUserReturn({ customerInfo: this.customerInfo, page: 1, pagesize: 1000 })
|
|
121
|
+ .then(() => {
|
113
|
122
|
|
|
123
|
+ })
|
|
124
|
+ .catch(err => {
|
|
125
|
+ this.$message({
|
|
126
|
+ showClose: true,
|
|
127
|
+ message: err,
|
|
128
|
+ type: 'error'
|
|
129
|
+ })
|
|
130
|
+ })
|
|
131
|
+ },
|
114
|
132
|
isBookReturn(book) {
|
115
|
133
|
this.$confirm('确定归还此书?', '提示', {
|
116
|
134
|
confirmButtonText: '确定',
|
|
@@ -118,13 +136,16 @@ export default {
|
118
|
136
|
type: 'warning'
|
119
|
137
|
})
|
120
|
138
|
.then(() => {
|
121
|
|
- this.returnBook(book)
|
|
139
|
+ this.returnBook({
|
|
140
|
+ borrowIds: book.BookBorrowRecordId,
|
|
141
|
+ })
|
122
|
142
|
.then(() => {
|
123
|
143
|
this.$message({
|
124
|
144
|
showClose: true,
|
125
|
145
|
message: '归还成功',
|
126
|
146
|
type: 'success'
|
127
|
147
|
})
|
|
148
|
+ this.getList()
|
128
|
149
|
})
|
129
|
150
|
.catch(err => {
|
130
|
151
|
this.$message({
|
|
@@ -139,8 +160,12 @@ export default {
|
139
|
160
|
|
140
|
161
|
diffToday(dt) {
|
141
|
162
|
const days =
|
142
|
|
- (new window.Date().getTime() - dt.getTime()) / (1000 * 60 * 60 * 24)
|
|
163
|
+ (new window.Date().getTime() - (new Date(dt)).getTime()) / (1000 * 60 * 60 * 24)
|
143
|
164
|
return days <= 0 ? 0 : days
|
|
165
|
+ },
|
|
166
|
+ cancel() {
|
|
167
|
+ this.customerInfo = ''
|
|
168
|
+ this.active = 0
|
144
|
169
|
}
|
145
|
170
|
}
|
146
|
171
|
}
|