许成详 6 år sedan
förälder
incheckning
20c28e9bb8

+ 65
- 29
src/pages/system/library/borrow/appointmentList.vue Visa fil

5
         <div class="flex-item flex-h"></div>
5
         <div class="flex-item flex-h"></div>
6
         <ul style="white-space: normal;">
6
         <ul style="white-space: normal;">
7
           <li style="margin-bottom: 15px;">
7
           <li style="margin-bottom: 15px;">
8
-            <el-input placeholder="请输入条形码" v-model="postData.BarCode"></el-input>
8
+            <el-input placeholder="请输入条形码" v-model="postData.barcode"></el-input>
9
           </li>
9
           </li>
10
           <li style="margin-bottom: 15px;">
10
           <li style="margin-bottom: 15px;">
11
-            <el-input placeholder="请输入图书名" v-model="postData.BookName"></el-input>
11
+            <el-input placeholder="请输入图书名" v-model="postData.bookname"></el-input>
12
           </li>
12
           </li>
13
           <li style="margin-bottom: 15px;">
13
           <li style="margin-bottom: 15px;">
14
-            <el-input placeholder="请输入用户名" v-model="postData.UserName"></el-input>
14
+            <el-input placeholder="请输入用户名" v-model="postData.customername"></el-input>
15
           </li>
15
           </li>
16
           <li style="margin-bottom: 15px;">
16
           <li style="margin-bottom: 15px;">
17
-            <el-input placeholder="请输入手机号" v-model="postData.Tel"></el-input>
17
+            <el-input placeholder="请输入手机号" v-model="postData.customerphone"></el-input>
18
           </li>
18
           </li>
19
           <li style="margin-bottom: 15px;">
19
           <li style="margin-bottom: 15px;">
20
             <el-select v-model="CaseId" placeholder="请选择案场">
20
             <el-select v-model="CaseId" placeholder="请选择案场">
34
     </div>
34
     </div>
35
     <div class="system-table-box">
35
     <div class="system-table-box">
36
       <el-table :data="list" stripe style="width: 100%">
36
       <el-table :data="list" stripe style="width: 100%">
37
-        <el-table-column prop="GoodsName" label="案场"></el-table-column>
37
+        <el-table-column label="案场">
38
+          <template slot-scope="scope">{{returnCaseName(scope.row.CaseId)}}</template>
39
+        </el-table-column>
38
         <el-table-column label="图片" width="300">
40
         <el-table-column label="图片" width="300">
39
           <template slot-scope="scope">
41
           <template slot-scope="scope">
40
-            <img :src="((scope.row.Images || [])[0] || {}).ImgUrl" style="width:200px;">
42
+            <img :src="scope.row.BookImg" style="height: 150px;">
41
           </template>
43
           </template>
42
         </el-table-column>
44
         </el-table-column>
43
-        <el-table-column prop="BarCode" label="条形码"></el-table-column>
45
+        <el-table-column prop="BookBarcode" label="条形码"></el-table-column>
44
         <el-table-column prop="BookName" label="图书名"></el-table-column>
46
         <el-table-column prop="BookName" label="图书名"></el-table-column>
45
-        <el-table-column prop="UserName" label="用户名"></el-table-column>
46
-        <el-table-column prop="Tel" label="手机号"></el-table-column>
47
-        <el-table-column prop="xxDate" label="预约时间"></el-table-column>
48
-        <el-table-column prop="xxDate" label="保留时间"></el-table-column>
47
+        <el-table-column prop="CustomerName" label="用户名"></el-table-column>
48
+        <el-table-column prop="CustomerPhone" label="手机号"></el-table-column>
49
+        <el-table-column label="预约时间">
50
+          <template slot-scope="scope">{{toolClass.dateFormat(scope.row.ReserveDate)}}</template>
51
+        </el-table-column>
52
+        <el-table-column label="保留时间">
53
+          <template slot-scope="scope">{{toolClass.dateFormat(scope.row.ReserveEndDate)}}</template>
54
+        </el-table-column>
49
         <el-table-column label="操作">
55
         <el-table-column label="操作">
50
           <template slot-scope="scope">
56
           <template slot-scope="scope">
51
-            <el-button size="mini" type="warning">取消预约</el-button>
57
+            <el-button size="mini" type="warning" @click="cancel(scope.row.BookBorrowRecordId)">取消预约</el-button>
52
           </template>
58
           </template>
53
         </el-table-column>
59
         </el-table-column>
54
       </el-table>
60
       </el-table>
55
       <el-pagination
61
       <el-pagination
56
-        @size-change="handleSizeChange"
57
         @current-change="handleCurrentChange"
62
         @current-change="handleCurrentChange"
58
         :current-page.sync="postData.page"
63
         :current-page.sync="postData.page"
59
         :page-size="postData.pagesize"
64
         :page-size="postData.pagesize"
71
   name: 'borrowList',
76
   name: 'borrowList',
72
   data () {
77
   data () {
73
     return {
78
     return {
74
-      total: 1000,
79
+      total: 1,
75
       postData: {
80
       postData: {
76
-        BarCode: '',
77
-        BookName: '',
78
-        UserName: '',
79
-        Tel: '',
80
-        Status: '',
81
-        CaseId: '',
81
+        barcode: '',
82
+        bookname: '',
83
+        customername: '',
84
+        customerphone: '',
85
+        borrowstatus: '4',
86
+        caseid: '',
82
         page: 1,
87
         page: 1,
83
         pagesize: 10
88
         pagesize: 10
84
       },
89
       },
85
       statusList: [{
90
       statusList: [{
86
         id: '',
91
         id: '',
87
         value: ''
92
         value: ''
88
-      }],
89
-      list: []
93
+      }]
90
     }
94
     }
91
   },
95
   },
92
   created () {
96
   created () {
97
+    this.getBorrowList({ ...this.postData }).then((res) => {
98
+      this.page = res.page
99
+      this.total = res.pagenum
100
+    })
93
   },
101
   },
94
   computed: {
102
   computed: {
95
     ...mapState({
103
     ...mapState({
98
       orgid: x => x.app.user.OrgId
106
       orgid: x => x.app.user.OrgId
99
     }),
107
     }),
100
     ...mapLibSate({
108
     ...mapLibSate({
109
+      list: x => x.borrow.list
101
     }),
110
     }),
102
     CaseId: {
111
     CaseId: {
103
       get () {
112
       get () {
104
-        return this.postData.CaseId || this.defaultCaseId
113
+        return this.postData.caseid || this.defaultCaseId
105
       },
114
       },
106
       set (val) {
115
       set (val) {
107
-        this.postData.CaseId = val
116
+        this.postData.caseid = val
108
       }
117
       }
109
     }
118
     }
110
   },
119
   },
111
   methods: {
120
   methods: {
112
-    ...mapLibActions([]),
113
-    search () {
114
-
121
+    ...mapLibActions(['getBorrowList', 'cancelBorrow']),
122
+    cancel (id) {
123
+      this.$confirm('确认取消预约?', '提示', {
124
+        confirmButtonText: '确定',
125
+        cancelButtonText: '取消',
126
+        type: 'warning'
127
+      }).then(() => {
128
+        this.cancelBorrow(id).then(() => {
129
+          this.getBorrowList({ ...this.postData }).then((res) => {
130
+            this.page = res.page
131
+            this.total = res.pagenum
132
+          })
133
+        })
134
+      })
115
     },
135
     },
116
-    handleSizeChange (val) {
117
-      console.log(`每页 ${val} 条`)
136
+    search () {
137
+      this.page = 1
138
+      this.getBorrowList({ ...this.postData }).then((res) => {
139
+        this.page = res.page
140
+        this.total = res.pagenum
141
+      })
118
     },
142
     },
119
     handleCurrentChange (val) {
143
     handleCurrentChange (val) {
144
+      this.postData.page = val
145
+      this.getBorrowList({ ...this.postData }).then((res) => {
146
+        this.page = res.page
147
+        this.total = res.pagenum
148
+      })
120
     },
149
     },
150
+    returnCaseName (id) {
151
+      var name = ''
152
+      this.cases.map((item) => {
153
+        if (item.CaseId === id) name = item.CaseName
154
+      })
155
+      return name
156
+    }
121
   }
157
   }
122
 }
158
 }
123
 </script>
159
 </script>

+ 59
- 14
src/pages/system/library/borrow/borrowList.vue Visa fil

11
             <el-input placeholder="请输入图书名" v-model="postData.bookname"></el-input>
11
             <el-input placeholder="请输入图书名" v-model="postData.bookname"></el-input>
12
           </li>
12
           </li>
13
           <li style="margin-bottom: 15px;">
13
           <li style="margin-bottom: 15px;">
14
-            <el-input placeholder="请输入借阅人" v-model="postData.borrowername"></el-input>
14
+            <el-input placeholder="请输入借阅人" v-model="postData.customername"></el-input>
15
           </li>
15
           </li>
16
           <li style="margin-bottom: 15px;">
16
           <li style="margin-bottom: 15px;">
17
-            <el-input placeholder="请输入手机号" v-model="postData.tel"></el-input>
17
+            <el-input placeholder="请输入手机号" v-model="postData.customerphone"></el-input>
18
           </li>
18
           </li>
19
           <li style="margin-bottom: 15px;">
19
           <li style="margin-bottom: 15px;">
20
             <el-select v-model="CaseId" placeholder="请选择案场">
20
             <el-select v-model="CaseId" placeholder="请选择案场">
44
     </div>
44
     </div>
45
     <div class="system-table-box">
45
     <div class="system-table-box">
46
       <el-table :data="list" stripe style="width: 100%">
46
       <el-table :data="list" stripe style="width: 100%">
47
-        <el-table-column prop="GoodsName" label="案场"></el-table-column>
47
+        <el-table-column label="案场">
48
+          <template slot-scope="scope">{{returnCaseName(scope.row.CaseId)}}</template>
49
+        </el-table-column>
48
         <el-table-column label="图片" width="300">
50
         <el-table-column label="图片" width="300">
49
           <template slot-scope="scope">
51
           <template slot-scope="scope">
50
-            <img :src="((scope.row.Images || [])[0] || {}).ImgUrl" style="width:200px;">
52
+            <img :src="scope.row.BookImg" style="height: 150px;">
51
           </template>
53
           </template>
52
         </el-table-column>
54
         </el-table-column>
53
-        <el-table-column prop="BarCode" label="条形码"></el-table-column>
55
+        <el-table-column prop="BookBarcode" label="条形码"></el-table-column>
54
         <el-table-column prop="BookName" label="图书名"></el-table-column>
56
         <el-table-column prop="BookName" label="图书名"></el-table-column>
55
-        <el-table-column prop="BorrowerName" label="借阅人"></el-table-column>
56
-        <el-table-column prop="Tel" label="手机号"></el-table-column>
57
-        <el-table-column prop="CreateDate" label="借阅时间"></el-table-column>
58
-        <el-table-column prop="xxDate" label="规定归还时间"></el-table-column>
59
-        <el-table-column prop="xxDate" label="实际归还时间"></el-table-column>
60
-        <el-table-column prop="Status" label="状态"></el-table-column>
57
+        <el-table-column prop="CustomerName" label="借阅人"></el-table-column>
58
+        <el-table-column prop="CustomerPhone" label="手机号"></el-table-column>
59
+        <el-table-column label="借阅时间">
60
+          <template slot-scope="scope">{{toolClass.dateFormat(scope.row.BorrowDate)}}</template>
61
+        </el-table-column>
62
+        <el-table-column label="规定归还时间">
63
+          <template slot-scope="scope">{{toolClass.dateFormat(scope.row.EndDate)}}</template>
64
+        </el-table-column>
65
+        <el-table-column label="实际归还时间">
66
+          <template slot-scope="scope">{{toolClass.dateFormat(scope.row.ReturnDate)}}</template>
67
+        </el-table-column>
68
+        <el-table-column label="状态">
69
+          <template slot-scope="scope">{{returnStatus(scope.row.BorrowStatus)}}</template>
70
+        </el-table-column>
61
       </el-table>
71
       </el-table>
62
       <el-pagination
72
       <el-pagination
63
         @current-change="handleCurrentChange"
73
         @current-change="handleCurrentChange"
77
   name: 'borrowList',
87
   name: 'borrowList',
78
   data () {
88
   data () {
79
     return {
89
     return {
80
-      total: 1000,
90
+      total: 1,
81
       postData: {
91
       postData: {
82
         barcode: '',
92
         barcode: '',
83
         bookname: '',
93
         bookname: '',
84
-        borrowername: '',
85
-        tel: '',
94
+        customername: '',
95
+        customerphone: '',
86
         borrowstatus: '',
96
         borrowstatus: '',
87
         caseid: '',
97
         caseid: '',
88
         page: 1,
98
         page: 1,
91
       statusList: [{
101
       statusList: [{
92
         id: '',
102
         id: '',
93
         value: ''
103
         value: ''
104
+      }, {
105
+        id: '0',
106
+        value: '延期'
107
+      }, {
108
+        id: '1',
109
+        value: '借阅中'
110
+      }, {
111
+        id: '2',
112
+        value: '已归还'
113
+      }, {
114
+        id: '3',
115
+        value: '逾期归还'
116
+      }, {
117
+        id: '4',
118
+        value: '预约中'
119
+      }, {
120
+        id: '5',
121
+        value: '过期'
122
+      }, {
123
+        id: '6',
124
+        value: '取消'
94
       }]
125
       }]
95
     }
126
     }
96
   },
127
   },
134
         this.total = res.pagenum
165
         this.total = res.pagenum
135
       })
166
       })
136
     },
167
     },
168
+    returnCaseName (id) {
169
+      var name = ''
170
+      this.cases.map((item) => {
171
+        if (item.CaseId === id) name = item.CaseName
172
+      })
173
+      return name
174
+    },
175
+    returnStatus (id) {
176
+      var status = ''
177
+      this.statusList.map((item) => {
178
+        if (item.id === id) status = item.value
179
+      })
180
+      return status
181
+    }
137
   }
182
   }
138
 }
183
 }
139
 </script>
184
 </script>

+ 10
- 0
src/store/library/index.js Visa fil

99
     }
99
     }
100
   },
100
   },
101
   actions: {
101
   actions: {
102
+    cancelBorrow ({ commit }, payload) { // 取消预约
103
+      return new Promise((resolve, reject) => {
104
+        ajax(api.borrow.cancelBorrow.url, {
105
+          method: api.borrow.cancelBorrow.method,
106
+          urlData: { id: payload }
107
+        }).then(res => {
108
+          resolve(res)
109
+        }).catch(({ message }) => reject(message))
110
+      })
111
+    },
102
     getBorrowList ({ commit }, payload) { // 获取借阅记录
112
     getBorrowList ({ commit }, payload) { // 获取借阅记录
103
       return new Promise((resolve, reject) => {
113
       return new Promise((resolve, reject) => {
104
         ajax(api.borrow.getBorrowList.url, {
114
         ajax(api.borrow.getBorrowList.url, {

+ 5
- 1
src/util/api.js Visa fil

952
     getBorrowList: {
952
     getBorrowList: {
953
       method: 'get',
953
       method: 'get',
954
       url: `${baseUrl}${common}/book/record`
954
       url: `${baseUrl}${common}/book/record`
955
-    },    
955
+    },
956
+    cancelBorrow: {
957
+      method: 'put',
958
+      url: `${baseUrl}${common}/book/cancel/:id`
959
+    }
956
   },
960
   },
957
   bookType: {
961
   bookType: {
958
     list: {
962
     list: {