|
|
@@ -7,6 +7,7 @@ const _Http = getApp().globalData.http,
|
|
|
Page({
|
|
|
data: {
|
|
|
isLeader: false, //是否为负责人
|
|
|
+ isRecover: false, //关闭弹窗是否恢复项目
|
|
|
tabsActive: 0, //tabs 选中项
|
|
|
sa_projectid: "",
|
|
|
tabsList: [{
|
|
|
@@ -300,25 +301,38 @@ Page({
|
|
|
title: '失败项目才可恢复!',
|
|
|
icon: "none"
|
|
|
});
|
|
|
- wx.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '是否确认恢复项目',
|
|
|
- complete: ({
|
|
|
- confirm
|
|
|
- }) => {
|
|
|
- if (confirm) _Http.basic({
|
|
|
- "id": 20221215164002,
|
|
|
- "content": {
|
|
|
- "sa_projectid": data.sa_projectid
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20221208184202,
|
|
|
+ "content": {
|
|
|
+ ...data,
|
|
|
+ pageSize: 999
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log("查看重复", res)
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ if (res.data.length == 0) {
|
|
|
+ wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '是否确认恢复项目',
|
|
|
+ complete: ({
|
|
|
+ confirm
|
|
|
+ }) => {
|
|
|
+ if (confirm) that.onRecover()
|
|
|
}
|
|
|
- }).then(res => {
|
|
|
- console.log('恢复', res)
|
|
|
- wx.showToast({
|
|
|
- title: res.msg == '成功' ? '已恢复' : res.msg,
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- if (res.msg == '成功') setTimeout(this.getDetail, 300);
|
|
|
})
|
|
|
+ } else {
|
|
|
+ wx.showToast({
|
|
|
+ title: '查询到有疑似重复项目',
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ this.setData({
|
|
|
+ repetitionList: res.data,
|
|
|
+ repetitionShow: true,
|
|
|
+ isRecover: true
|
|
|
+ });
|
|
|
}
|
|
|
})
|
|
|
break;
|
|
|
@@ -433,9 +447,59 @@ Page({
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
+ /* 恢复项目 */
|
|
|
+ onRecover() {
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20221215164002,
|
|
|
+ "content": {
|
|
|
+ "sa_projectid": this.data.sa_projectid
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log('恢复', res)
|
|
|
+ wx.showToast({
|
|
|
+ title: res.msg == '成功' ? '已恢复' : res.msg,
|
|
|
+ icon: "none",
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ if (res.msg == '成功') setTimeout(this.getDetail, 300);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 关闭查重弹窗 */
|
|
|
repClose() {
|
|
|
+ let that = this;
|
|
|
+ if (this.data.isRecover) wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '存在重复项目,是否确认恢复',
|
|
|
+ complete: ({
|
|
|
+ confirm
|
|
|
+ }) => {
|
|
|
+ if (confirm) {
|
|
|
+ that.onRecover(true)
|
|
|
+ let {
|
|
|
+ datatag,
|
|
|
+ systemtag
|
|
|
+ } = this.selectComponent("#Tags").returnTags();
|
|
|
+ if (!systemtag.some(v => v == '疑似重复')) {
|
|
|
+ systemtag.push("疑似重复")
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20220929090901,
|
|
|
+ "content": {
|
|
|
+ "ownertable": "sa_project",
|
|
|
+ "ownerid": that.data.sa_projectid,
|
|
|
+ datatag,
|
|
|
+ systemtag
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log("绑定疑似重复标签", res)
|
|
|
+ if (res.msg == '成功') that.getTags();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
this.setData({
|
|
|
- repetitionShow: false
|
|
|
+ repetitionShow: false,
|
|
|
+ isRecover: false
|
|
|
})
|
|
|
},
|
|
|
/* 1提交报备,2报备审核,3报备驳回(退回) */
|