servantlist.js 797 B

1234567891011121314151617181920212223242526272829303132333435
  1. import request from '../../../util/http'
  2. import apiUrl from '../../../util/apiUrl1'
  3. import util from '../../../util/util'
  4. import moment from 'moment'
  5. var app = getApp();
  6. Page({
  7. data: {},
  8. onLoad() {
  9. this.loadpage();
  10. },
  11. loadpage(){
  12. let params = {}
  13. request.httpServiceGet(apiUrl.getSubjectWhenEdit, params).then(data => {
  14. if (data.length > 0) {
  15. //添加选中的状态列
  16. let servantlist = data;
  17. this.setData({
  18. servantlist: servantlist
  19. });
  20. } else {
  21. this.setData({
  22. servantlist: []
  23. });
  24. }
  25. }).catch(e => {
  26. console.log(e);
  27. })
  28. },
  29. toEditPage(e){
  30. let subtypeNo=e.target.dataset.id;
  31. my.navigateTo({
  32. url: '../servantedit/servantedit?subtypeNo='+subtypeNo
  33. });
  34. },
  35. });