delete.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. getApp().globalData.Language.getLanguagePackage(this, '作废原因');
  11. },
  12. onInput(e) {
  13. this.setData({
  14. deletereason: e.detail.value
  15. })
  16. },
  17. handleDetele() {
  18. let that = this;
  19. wx.showModal({
  20. title: getApp().globalData.Language.getMapText('提示'),
  21. content: getApp().globalData.Language.getMapText('是否确认作废该报价单', '', '?'),
  22. cancelText: getApp().globalData.Language.getMapText('取消'),
  23. confirmText: getApp().globalData.Language.getMapText('确定'),
  24. complete: ({
  25. confirm
  26. }) => {
  27. if (confirm) _Http.basic({
  28. "id": 20221020165503,
  29. "version": 1,
  30. "content": {
  31. "sa_quotedpriceids": [sa_quotedpriceid],
  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.code != '1' ? res.msg : getApp().globalData.Language.getMapText('作废成功'),
  41. icon: "none",
  42. mask: true
  43. });
  44. if (res.code == '1') setTimeout(() => {
  45. wx.navigateBack({
  46. delta: 2
  47. });
  48. }, 300)
  49. getCurrentPages().find(v => v.__route__ == 'packageA/offers/index').getList(true)
  50. })
  51. }
  52. })
  53. }
  54. })