delete.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. const _Http = getApp().globalData.http;
  2. let sa_quotedpriceid = null;
  3. Page({
  4. data: {
  5. deletereason: "",
  6. loading: false,
  7. },
  8. onLoad(options) {
  9. sa_quotedpriceid = 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) _Http.basic({
  25. "id": 20221020165503,
  26. "version": 1,
  27. "content": {
  28. "sa_quotedpriceids": [sa_quotedpriceid],
  29. deletereason: that.data.deletereason
  30. }
  31. }).then(res => {
  32. console.log("作废报价单", res)
  33. that.setData({
  34. loading: false
  35. })
  36. wx.showToast({
  37. title: res.msg != '成功' ? res.msg : '作废成功',
  38. icon: "none",
  39. mask: true
  40. });
  41. if (res.msg == '成功') setTimeout(() => {
  42. wx.navigateBack({
  43. delta: 2
  44. });
  45. }, 300)
  46. getCurrentPages().find(v => v.__route__ == 'packageA/offers/index').getList(true)
  47. })
  48. }
  49. })
  50. }
  51. })