index.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. nodes: {
  5. type: Object
  6. },
  7. prefix: {
  8. type: Number,
  9. value: 0
  10. },
  11. status: {
  12. type: String
  13. },
  14. sa_workorderid: {
  15. type: [String, Number]
  16. }
  17. },
  18. lifetimes: {
  19. attached: function () {
  20. getApp().globalData.Language.getLanguagePackage(this)
  21. }
  22. },
  23. data: {
  24. },
  25. methods: {
  26. toWork(e) {
  27. const {
  28. item
  29. } = e.currentTarget.dataset;
  30. try {
  31. if (item.child.length) return;
  32. } catch (error) {
  33. item.child = [];
  34. }
  35. console.log(item)
  36. if (item.child.length) return;
  37. item.title = (this.data.prefix ? this.data.prefix + '-' : '') + item.rowindex + '. ' + item.workpresetjson.workname;
  38. item.status1 = this.data.status;
  39. _Http.data = item;
  40. let isleader = true;
  41. wx.navigateTo({
  42. url: (isleader ? '/Eservice/nodeDetail/index?id=' : '/Eservice/nodeDetail/index?class=stopClick&id=') + item.sa_workorder_nodeid + '&wid=' + item.sa_workorderid + (this.data.status != '进行中' ? '&class=stopClick' : '')
  43. })
  44. },
  45. }
  46. })