12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- var app = getApp()
- var that;
- Page({
- data: {
- review_id: '',
- isBh: false,//是否显示驳回弹窗
- textArea: "",
- disabled: false,
- },
- onLoad(e) {
- that = this;
- dd.setNavigationBar({ title: "详情" });
- if (e.id) {
- that.setData({ review_id: e.id,userData:app.globalData.userData });
- that.getData();
- }
- if (e.is) {
- that.setData({ is: e.is });
- }
- },
- 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.data.page!=1){
- active.refreshData(that.data.review_id);
- }
- setTimeout(() => {
- dd.navigateBack({ delta: 1 });
- }, 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.data.page!=1){
- active.refreshData(that.data.review_id);
- }
- setTimeout(() => {
- dd.navigateBack({
- delta: 1
- })
- }, 1000);
- })
- }
- },
- });
- },
- getData() {
- // that.data.review_id
- 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
- })
- })
- },
- });
|