approveDetail.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. submit() {
  21. dd.navigateTo({
  22. url: '../approve/approve?id=' + that.data.dataDetail.id
  23. })
  24. },
  25. bindTextAreaBlur(e) {
  26. this.setData({
  27. textArea: e.detail.value
  28. });
  29. },
  30. openBh(e) {
  31. this.setData({ isBh: !this.data.isBh })
  32. },
  33. confirmBh() {
  34. var item = that.data.bhItem;
  35. if (!that.data.textArea) {
  36. app.globalData.showToast("请输入审批意见");
  37. return;
  38. }
  39. app.$post("api/integral/review", { review_id: that.data.review_id, remark: that.data.textArea, action: "refuse", ticket_count: 0 }).then((res) => {
  40. app.globalData.showToast("已审批");
  41. setTimeout(() => {
  42. dd.navigateBack({ delta: 1 });
  43. }, 1000);
  44. })
  45. },
  46. openCx() {
  47. dd.confirm({
  48. title: '温馨提示',
  49. content: '您确定撤销此项吗?',
  50. confirmButtonText: '确定',
  51. cancelButtonText: '取消',
  52. success: (result) => {
  53. app.$post("api/integral/review/destroy", { review_id: that.data.review_id }).then((res) => {
  54. app.globalData.showToast("已撤销");
  55. setTimeout(() => {
  56. dd.navigateBack({
  57. delta: 1
  58. })
  59. }, 1000);
  60. })
  61. },
  62. });
  63. },
  64. getData() {
  65. // that.data.review_id
  66. app.$get("api/integral/review", { review_id: that.data.review_id }).then((res) => {
  67. var data = res.data.data;
  68. data.typeName = app.getTypesItem(data.pt_id).name;
  69. this.setData({
  70. dataDetail: data
  71. })
  72. })
  73. },
  74. });