approveDetail.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. var app = getApp()
  2. var that;
  3. Page({
  4. data: {
  5. review_id: '',
  6. isBh: false,//是否显示驳回弹窗
  7. textArea: ""
  8. },
  9. onLoad(e) {
  10. that = this;
  11. dd.setNavigationBar({ title: "详情" });
  12. if (e.id) {
  13. that.setData({ review_id: e.id });
  14. that.getData();
  15. }
  16. if (e.is) {
  17. that.setData({ is: e.is });
  18. }
  19. },
  20. showImg(e) {
  21. var index = e.target.dataset.index;
  22. var item = e.target.dataset.item
  23. dd.previewImage({
  24. current: index,
  25. urls: item
  26. });
  27. },
  28. submit() {
  29. dd.navigateTo({
  30. url: '../approve/approve?id=' + that.data.dataDetail.id
  31. })
  32. },
  33. bindTextAreaBlur(e) {
  34. this.setData({
  35. textArea: e.detail.value
  36. });
  37. },
  38. openBh(e) {
  39. this.setData({ isBh: !this.data.isBh, textArea: '' })
  40. },
  41. confirmBh() {
  42. var item = that.data.bhItem;
  43. if (!that.data.textArea) {
  44. app.globalData.showToast("请输入审批意见");
  45. return;
  46. }
  47. app.$post("api/integral/review", { review_id: that.data.review_id, remark: that.data.textArea, action: "refuse", ticket_count: 0 }).then((res) => {
  48. app.globalData.showToast("已审批");
  49. setTimeout(() => {
  50. dd.navigateBack({ delta: 1 });
  51. }, 1000);
  52. })
  53. },
  54. openCx() {
  55. dd.confirm({
  56. title: '温馨提示',
  57. content: '您确定撤销此项吗?',
  58. confirmButtonText: '确定',
  59. cancelButtonText: '取消',
  60. success: (result) => {
  61. if (result.confirm) {
  62. app.$post("api/integral/review/destroy", { review_id: that.data.review_id }).then((res) => {
  63. app.globalData.showToast("已撤销");
  64. setTimeout(() => {
  65. dd.navigateBack({
  66. delta: 1
  67. })
  68. }, 1000);
  69. })
  70. }
  71. },
  72. });
  73. },
  74. getData() {
  75. // that.data.review_id
  76. app.$get("api/integral/review", { review_id: that.data.review_id }).then((res) => {
  77. var data = res.data.data;
  78. data.typeName = app.getTypesItem(data.pt_id).name;
  79. this.setData({
  80. dataDetail: data
  81. })
  82. })
  83. },
  84. });