123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- var app = getApp()
- var that;
- Page({
- data: {
- review_id: '',
- isBh: false,//是否显示驳回弹窗
- textArea: "",
- disabled: false,
- corpId: '',
- },
- onLoad(e) {
- that = this;
- dd.setNavigationBar({ title: "详情" });
- if (e.id) {
- that.setData({ review_id: parseInt(e.id), userData: app.globalData.userData });
- }
- if (e.is) {
- that.setData({ is: e.is });
- }
- if (e.corpId) {
- that.setData({ corpId: e.corpId });
- app.globalData.corpId = e.corpId
- }
- },
- onShow() {
- if (app.globalData.userData) {
- dd.hideLoading();
- that.getData();
- } else {
- let corpId = that.data.corpId ? that.data.corpId : app.globalData.corpId
- app.login(corpId, function (is) {
- if (is) {
- dd.hideLoading();
- that.setData({userData: app.globalData.userData });
- that.getData();
- } else {
- dd.reLaunch({
- url: '../noJurisdiction/noJurisdiction'
- })
- }
- }, function () { })
- }
- },
- showImg(e) {
- var index = e.target.dataset.index;
- var item = e.target.dataset.item
- dd.previewImage({
- current: index,
- urls: item
- });
- },
- submit() {
- dd.navigateTo({
- url: '../approve/approve?id=' + that.data.dataDetail.id
- })
- },
- bindTextAreaBlur(e) {
- this.setData({
- textArea: e.detail.value
- });
- },
- openBh(e) {
- this.setData({ isBh: !this.data.isBh, textArea: '' })
- },
- confirmBh() {
- if (!that.data.textArea) {
- app.globalData.showToast("请输入审批意见");
- return;
- }
- this.setData({ disabled: true });
- app.$post("api/integral/review", { review_id: that.data.review_id, remark: that.data.textArea, action: "refuse", ticket_count: 0 }).then((res) => {
- app.globalData.showToast("已驳回");
- that.setData({ disabled: false });
- var pages = getCurrentPages();//当上一页的page不等于一时,执行上一页的方法
- var active = pages[pages.length - 2];
- if (active) {
- if (active.data.page != 1) {
- active.refreshData(that.data.review_id);
- }
- setTimeout(() => {
- dd.navigateBack({ delta: 1 });
- }, 1000);
- } else {
- setTimeout(() => {
- dd.reLaunch({
- url: '/pages/workbench/index/index'
- })
- }, 1000);
- }
- })
- },
- openCx() {
- dd.confirm({
- title: '撤掉审批',
- content: '您确定撤掉此项吗?',
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- success: (result) => {
- if (result.confirm) {
- app.$post("api/integral/review/destroy", { review_id: that.data.review_id }).then((res) => {
- app.globalData.showToast("已撤掉");
- var pages = getCurrentPages();//当上一页的page不等于一时,执行上一页的方法
- var active = pages[pages.length - 2];
- if (active) {
- if (active.data.page != 1) {
- active.refreshData(that.data.review_id);
- active.filtrationList(2, item.review_id);
- }
- setTimeout(() => {
- dd.navigateBack({delta: 1})
- }, 1000);
- } else {
- setTimeout(() => {
- dd.reLaunch({
- url: '/pages/workbench/index/index'
- })
- }, 1000);
- }
- })
- }
- },
- });
- },
- getData() {
- app.$get("api/integral/review", { review_id: that.data.review_id }).then((res) => {
- var data = res.data.data;
- data.typeName = app.getTypesItem(data.pt_id).name;
- this.setData({
- dataDetail: data
- })
- })
- },
- });
|