浏览代码

干体重

xiaoming_global 5 年前
父节点
当前提交
ac32532056
共有 2 个文件被更改,包括 57 次插入6 次删除
  1. 6 1
      src/api/patient.js
  2. 51 5
      src/xt_pages/user/dryWeight.vue

+ 6 - 1
src/api/patient.js 查看文件

316
   })
316
   })
317
 }
317
 }
318
 
318
 
319
-export function getAllData(params) {
319
+export function getAllData(id, page, limit) {
320
+  const params = {
321
+    id: id,
322
+    page: page,
323
+    limit: limit
324
+  }
320
   return request({
325
   return request({
321
     url: '/api/patient/getalldata',
326
     url: '/api/patient/getalldata',
322
     method: 'Get',
327
     method: 'Get',

+ 51 - 5
src/xt_pages/user/dryWeight.vue 查看文件

36
           </template>
36
           </template>
37
       </el-table-column>
37
       </el-table-column>
38
   </el-table>
38
   </el-table>
39
+    <el-pagination
40
+        @size-change="handleSizeChange"
41
+        @current-change="handleCurrentChange"
42
+        :page-sizes="[10,20,50,100]"
43
+        :page-size="10"
44
+        background
45
+        style="margin-top:20px;"
46
+        align="right"
47
+        layout="total, sizes, prev, pager, next, jumper"
48
+        :total="total"></el-pagination>
39
      
49
      
40
      <el-dialog
50
      <el-dialog
41
          title="调整干体重"
51
          title="调整干体重"
105
           remarks: ''
115
           remarks: ''
106
         },
116
         },
107
         addShow: true,
117
         addShow: true,
108
-        adjustShow: false
118
+        adjustShow: false,
119
+        page: 1,
120
+        limit: 10,
121
+        total: 0
109
       }
122
       }
110
     },
123
     },
111
     methods: {
124
     methods: {
153
                 var patientDryweight = response.data.data.patientDryweight
166
                 var patientDryweight = response.data.data.patientDryweight
154
                 console.log('patientdryweight', patientDryweight)
167
                 console.log('patientdryweight', patientDryweight)
155
                 this.dialogVisible = false
168
                 this.dialogVisible = false
156
-                this.getAllData()
157
                 const id = this.$route.params && this.$route.params.id
169
                 const id = this.$route.params && this.$route.params.id
170
+                this.getAllData(id)
158
                 this.getDryWeightData(id)
171
                 this.getDryWeightData(id)
159
               }
172
               }
160
             })
173
             })
161
           }
174
           }
162
         })
175
         })
163
       },
176
       },
164
-      getAllData() {
165
-        getAllData().then(response => {
177
+      getAllData(id, page, limit) {
178
+        getAllData(id, this.page, this.limit).then(response => {
166
           if (response.data.state === 1) {
179
           if (response.data.state === 1) {
167
             var dry = response.data.data.dry
180
             var dry = response.data.data.dry
181
+            var total = response.data.data.total
182
+            this.total = total
183
+            console.log('total', total)
168
             this.tableData = dry
184
             this.tableData = dry
185
+            const usertype = this.$store.getters.xt_user.user.user_type
186
+
187
+            if (usertype === 1 || usertype === 2) {
188
+              this.addShow = true
189
+              this.adjustShow = false
190
+            } else {
191
+              this.addShow = false
192
+              this.adjustShow = false
193
+              return
194
+            }
169
             if (dry.length === 0) {
195
             if (dry.length === 0) {
170
               this.addShow = true
196
               this.addShow = true
171
               this.adjustShow = false
197
               this.adjustShow = false
176
             console.log('dry', dry)
202
             console.log('dry', dry)
177
           }
203
           }
178
         })
204
         })
205
+      },
206
+      handleSizeChange(limit) {
207
+        this.limit = limit
208
+        const id = this.$route.params && this.$route.params.id
209
+        this.getAllData(id, this.page, this.limit)
210
+      },
211
+      handleCurrentChange(page) {
212
+        this.page = page
213
+        const id = this.$route.params && this.$route.params.id
214
+        this.getAllData(id, this.page, this.limit)
179
       }
215
       }
180
     },
216
     },
181
     created() {
217
     created() {
184
       this.patientID = parseInt(id)
220
       this.patientID = parseInt(id)
185
       this.getDryWeightData(id)
221
       this.getDryWeightData(id)
186
       this.getAllDoctor()
222
       this.getAllDoctor()
187
-      this.getAllData()
223
+      this.getAllData(id)
224
+      const usertype = this.$store.getters.xt_user.user.user_type
225
+      // if (usertype === 2) {
226
+      //   this.addShow = true
227
+      //   this.adjustShow = false
228
+      // } else {
229
+      //   this.addShow = false
230
+      //   this.addjustShow = false
231
+      // }
232
+
233
+      console.log('usertype', usertype)
188
     }
234
     }
189
   }
235
   }
190
 </script>
236
 </script>