|
@@ -29,14 +29,14 @@ Page({
|
|
|
this.getDetail(true);
|
|
|
},
|
|
|
/* 获取详情 */
|
|
|
- getDetail(init = false) {
|
|
|
+ getDetail(init = false, show = true) {
|
|
|
_Http.basic({
|
|
|
"id": 20221108151302,
|
|
|
"content": {
|
|
|
nocache: true,
|
|
|
"sa_orderid": this.data.sa_orderid
|
|
|
}
|
|
|
- }).then(res => {
|
|
|
+ }, show).then(res => {
|
|
|
console.log("订单详情", res)
|
|
|
if (res.msg != '成功') return wx.showToast({
|
|
|
title: res.msg,
|
|
@@ -317,12 +317,14 @@ Page({
|
|
|
icon: "none"
|
|
|
})
|
|
|
this.setData({
|
|
|
- "detail.accountclass.rebate_used": this.data.detail.rebate_used == 1 ? 0 : 1
|
|
|
+ "detail.rebate_used": this.data.detail.rebate_used == 1 ? 0 : 1
|
|
|
})
|
|
|
let res = await this.changeDetail();
|
|
|
- if (res.msg != '成功') this.setData({
|
|
|
- "detail.accountclass.rebate_used": this.data.detail.rebate_used == 1 ? 0 : 1
|
|
|
- });
|
|
|
+ if (res.msg != '成功') {
|
|
|
+ this.setData({
|
|
|
+ "detail.rebate_used": this.data.detail.rebate_used == 1 ? 0 : 1
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
/* 删除订单 */
|
|
|
deleteItem() {
|
|
@@ -363,17 +365,7 @@ Page({
|
|
|
},
|
|
|
/* 提交订单 */
|
|
|
submit() {
|
|
|
- let that = this,
|
|
|
- sys_enterpriseid = that.data.detail.sys_enterpriseid,
|
|
|
- sa_accountclassid = that.data.detail.accountclass.sa_accountclassid;
|
|
|
- if (!sys_enterpriseid) return wx.showToast({
|
|
|
- title: '还未选择开票单位',
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- if (!sa_accountclassid) return wx.showToast({
|
|
|
- title: '还完成支付信息',
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
+ let that = this;
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '是否确认提交订单?',
|
|
@@ -381,9 +373,7 @@ Page({
|
|
|
if (res.confirm) _Http.basic({
|
|
|
"id": 20221108153402,
|
|
|
"content": {
|
|
|
- sa_orderid: that.data.sa_orderid,
|
|
|
- sys_enterpriseid,
|
|
|
- sa_accountclassid
|
|
|
+ sa_orderid: that.data.sa_orderid
|
|
|
},
|
|
|
}).then(s => {
|
|
|
console.log("提交订单", s)
|
|
@@ -391,6 +381,9 @@ Page({
|
|
|
title: s.msg != '成功' ? s.msg : '提交成功',
|
|
|
icon: "none"
|
|
|
});
|
|
|
+ if (s.msg == '成功') that.setData({
|
|
|
+ "detail.status": "提交"
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -424,5 +417,22 @@ Page({
|
|
|
icon: "none"
|
|
|
});
|
|
|
return this.data.detail.status != '新建';
|
|
|
- }
|
|
|
+ },
|
|
|
+ onUnload() {
|
|
|
+ let page = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/index');
|
|
|
+ let content = page.data.content;
|
|
|
+ content.pageNumber = 1;
|
|
|
+ content.pageSize = page.data.list.length;
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20221224180302,
|
|
|
+ content
|
|
|
+ }).then(res => {
|
|
|
+ console.log("订单列表", res)
|
|
|
+ page.setData({
|
|
|
+ list: res.data,
|
|
|
+ "content.total": res.total,
|
|
|
+ amount: res.tips.amount || 0
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
})
|