4***@qq.com
4***@qq.com
  • 发布:2025-06-18 13:54
  • 更新:2025-06-18 14:48
  • 阅读:29

一直报错“数据库请求失败”,但看着程序好像没啥错

分类:uni-app

在.update(this.cancelOrderParams)这里老是报错“数据库请求错误”,有谁能指点下,哪里写错了

let process_nodes_update = {
commit_time: this.currentDate,
commit_user: this.userInfo.nickname,
node_name: '工单取消',
comments: this.createOrderComments
}
let ifCreateUser = 0

            this._processNodes.push(process_nodes_update)  
            this.cancelOrderParams.actual_cancel_time = this.currentDate  
            this.cancelOrderParams.cancel_order_comments = this.createOrderComments  
            this.cancelOrderParams.order_status = '已取消'  
            this.cancelOrderParams.process_nodes = this._processNodes  
            console.log("this.cancelOrderParams值", this.cancelOrderParams)  
            await orderTable  
                .where("order_id =='" + this._orderId + "'")  
                .field("create_order_user_id")  
                .get()  
                .then(res => {  
                    console.log("create_order_user_id值", res.result)  
                    if (this.userInfo._id == res.result.data[0].create_order_user_id) {  
                        ifCreateUser = 1  
                    } else {  
                        uni.showModal({  
                            content: '您不是工单创建者,所以无法取消工单!',  
                            showCancel: false,  
                            success: function(res) {},  
                        })  
                    }  
                })  
            if (ifCreateUser == 1) {  
                uni.showModal({  
                    content: '是否确定取消工单?',  
                    showCancel: true,  
                    success: function(res3) {  
                        if (res3.confirm) {  
                            orderTable  
                                .where("order_id =='" + this._orderId + "'")  
                                .update(this.cancelOrderParams)  
                                .then(res1 => {  
                                    console.log("res update值", res1)  
                                    if (res1.result.code == 0) {  
                                        uni.showModal({  
                                            content: '工单已取消!',  
                                            showCancel: false,  
                                            success: function(res2) {  
                                                if (res2.confirm) {  
                                                    uni.navigateTo({  
                                                        url: '/pages/tabBar/allOrder/allOrder?type=' +  
                                                            this._type +  
                                                            '&estate=' + this  
                                                            ._estate  
                                                    })  
                                                }  
                                            }  

                                        })  
                                    }  
                                })  
                        }  
                    },  
                })  
            }
2025-06-18 13:54 负责人:无 分享
已邀请:
4***@qq.com

4***@qq.com (作者)

已解决,谢谢大家

要回复问题请先登录注册