浏览代码

Merge branch '选型' into 配合官网应用跳转

xiaohaizhao 1 年之前
父节点
当前提交
dc291e0750
共有 2 个文件被更改,包括 94 次插入29 次删除
  1. 52 15
      packageA/contract/detail.js
  2. 42 14
      packageA/offers/detail.js

+ 52 - 15
packageA/contract/detail.js

@@ -613,22 +613,59 @@ Page({
                 wx.showModal({
                     title: '提示',
                     content: `是否确定提交当前协议,提交后禁止使用部分功能`,
-                    complete: (res) => {
-                        if (res.confirm) _Http.basic({
-                            "id": 20221121202802,
-                            "content": {
-                                "sa_contractids": [that.data.sa_contractid]
-                            }
-                        }).then(res => {
-                            console.log("提交报价单", res)
-                            wx.showToast({
-                                title: res.msg == '成功' ? "提交成功" : res.msg,
-                                icon: "none"
+                    complete: ({
+                        confirm
+                    }) => {
+                        if (confirm) {
+                            _Http.basic({
+                                "id": "2024091910001802",
+                                "content": {
+                                    "ownertable": "sa_contract", //sa_project,,sa_quotedprice
+                                    "ownerid": that.data.sa_contractid
+                                },
+                            }).then(s => {
+                                console.log("是否可以提交", s)
+                                if (s.code == 1) {
+                                    _Http.basic({
+                                        "id": 20221121202802,
+                                        "content": {
+                                            "sa_contractids": [that.data.sa_contractid]
+                                        }
+                                    }).then(res => {
+                                        console.log("提交合同", res)
+                                        wx.showToast({
+                                            title: res.msg == '成功' ? "提交成功" : res.msg,
+                                            icon: "none"
+                                        })
+                                        if (res.msg == '成功') setTimeout(() => {
+                                            that.getDetail();
+                                        }, 300)
+                                    })
+                                } else {
+                                    wx.showModal({
+                                        title: '提示',
+                                        content: s.msg,
+                                        complete: ({
+                                            confirm
+                                        }) => {
+                                            if (confirm) _Http.basic({
+                                                "id": "2024091910214302",
+                                                "content": {
+                                                    "ownertable": "sa_contract", //sa_project,,sa_quotedprice
+                                                    "ownerid": that.data.sa_contractid
+                                                },
+                                            }).then(v => {
+                                                console.log("发送提醒", v)
+                                                wx.showToast({
+                                                    title: v.msg == '成功' ? "已发送提醒" : res.msg,
+                                                    icon: "none"
+                                                })
+                                            })
+                                        }
+                                    })
+                                }
                             })
-                            if (res.msg == '成功') setTimeout(() => {
-                                that.getDetail();
-                            }, 300)
-                        })
+                        }
                     }
                 })
                 break;

+ 42 - 14
packageA/offers/detail.js

@@ -373,22 +373,50 @@ Page({
                 wx.showModal({
                     title: '提示',
                     content: `是否确定提交当前报价,提交后禁止使用部分功能`,
-                    complete: (res) => {
-                        if (res.confirm) _Http.basic({
-                            "id": 20221020165303,
-                            "version": 1,
+                    complete: ({
+                        confirm
+                    }) => {
+                        if (confirm) _Http.basic({
+                            "id": "2024091910001802",
                             "content": {
-                                "sa_quotedpriceid": that.data.sa_quotedpriceid
+                                "ownertable": "sa_quotedprice", //sa_project,sa_contract,sa_quotedprice
+                                "ownerid": that.data.sa_quotedpriceid
+                            }
+                        }).then(s => {
+                            console.log("报价单是否可以提交", s)
+                            if (s.code == 1) {
+                                _Http.basic({
+                                    "id": 20221020165303,
+                                    "version": 1,
+                                    "content": {
+                                        "sa_quotedpriceid": that.data.sa_quotedpriceid
+                                    }
+                                }).then(res => {
+                                    console.log("提交报价单", res)
+                                    wx.showToast({
+                                        title: res.msg == '成功' ? "提交成功" : res.msg,
+                                        icon: "none"
+                                    })
+                                    if (res.msg == '成功') setTimeout(() => {
+                                        that.getDetail();
+                                    }, 300)
+                                })
+                            } else {
+                                _Http.basic({
+                                    "id": 2024091910214302,
+                                    "version": 1,
+                                    "content": {
+                                        "ownertable": "sa_quotedprice", //sa_project,sa_contract,sa_quotedprice
+                                        "ownerid": that.data.sa_quotedpriceid
+                                    }
+                                }).then(v => {
+                                    console.log("发送提醒", v)
+                                    wx.showToast({
+                                        title: v.msg == '成功' ? "已发送提醒" : res.msg,
+                                        icon: "none"
+                                    })
+                                })
                             }
-                        }).then(res => {
-                            console.log("提交报价单", res)
-                            wx.showToast({
-                                title: res.msg == '成功' ? "提交成功" : res.msg,
-                                icon: "none"
-                            })
-                            if (res.msg == '成功') setTimeout(() => {
-                                that.getDetail();
-                            }, 300)
                         })
                     }
                 })