delete.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. const _Http = getApp().globalData.http;
  2. let sa_projectid = null;
  3. Page({
  4. data: {
  5. deletereason: "",
  6. loading: false,
  7. },
  8. onLoad(options) {
  9. sa_projectid = options.id;
  10. },
  11. onInput(e) {
  12. this.setData({
  13. deletereason: e.detail.value
  14. })
  15. },
  16. handleDetele() {
  17. let that = this;
  18. wx.showModal({
  19. title: '提示',
  20. content: '是否确认作废该项目?',
  21. complete: ({
  22. confirm
  23. }) => {
  24. if (confirm) {
  25. that.setData({
  26. loading: true
  27. })
  28. _Http.basic({
  29. "id": 20221020144302,
  30. "content": {
  31. "sa_projectids": [sa_projectid],
  32. "deletereason": that.data.deletereason
  33. },
  34. }).then(res => {
  35. console.log("作废", res);
  36. that.setData({
  37. loading: false
  38. })
  39. wx.showToast({
  40. title: res.msg != '成功' ? res.data : '作废成功',
  41. icon: "none",
  42. mask: true
  43. });
  44. if (res.msg == '成功') setTimeout(() => {
  45. wx.navigateBack({
  46. delta: 2
  47. });
  48. }, 300)
  49. })
  50. }
  51. }
  52. })
  53. }
  54. })