|
@@ -7,7 +7,6 @@ Page({
|
|
|
disabled: false,
|
|
|
loading: false
|
|
|
},
|
|
|
-
|
|
|
onLoad(options) {
|
|
|
this.setData({
|
|
|
sourceData: JSON.parse(options.item),
|
|
@@ -38,36 +37,55 @@ Page({
|
|
|
this.setData({
|
|
|
loading: false
|
|
|
})
|
|
|
- wx.showToast({
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
title: res.data,
|
|
|
icon: "none"
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ disabled: true
|
|
|
})
|
|
|
+ this.randerData()
|
|
|
+ setTimeout(() => {
|
|
|
+ wx.navigateBack({
|
|
|
+ delta: 0,
|
|
|
+ })
|
|
|
+ }, 500)
|
|
|
+ wx.showToast({
|
|
|
+ title: '保存成功',
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
})
|
|
|
},
|
|
|
+ randerData() {
|
|
|
+ let pages = getCurrentPages();
|
|
|
+ pages[pages.length - 2].getList(true);
|
|
|
+ },
|
|
|
/* 获取列表 */
|
|
|
getList() {
|
|
|
- _Http.basic({
|
|
|
+ let parem = {
|
|
|
"id": 20220906154703,
|
|
|
"version": 1,
|
|
|
"content": {
|
|
|
"nocheca": true,
|
|
|
"sa_salesforecastbillid": this.data.sourceData.sa_salesforecastbillid,
|
|
|
'pageSize': 9999,
|
|
|
- "where": {
|
|
|
- "condition": ""
|
|
|
- }
|
|
|
+ "where": {}
|
|
|
}
|
|
|
- }).then(res => {
|
|
|
- console.log("详情列表", res)
|
|
|
+ };
|
|
|
+ if (this.data.sourceData.sa_projectid != 0) parem.content.where = {
|
|
|
+ "sa_projectid": this.data.sourceData.sa_projectid
|
|
|
+ }
|
|
|
+ _Http.basic(parem).then(res => {
|
|
|
+ console.log(321321321,res)
|
|
|
if (res.msg != '成功') return wx.showToast({
|
|
|
- title: res.data,
|
|
|
+ title: res.msg,
|
|
|
icon: "none"
|
|
|
})
|
|
|
for (let i = 0; i < res.data.length; i++) {
|
|
|
- res.data[i].complete = true
|
|
|
+ res.data[i].complete = true;
|
|
|
}
|
|
|
this.setData({
|
|
|
- list: res.data
|
|
|
+ list: res.data.filter(v => v.itemclassname)
|
|
|
});
|
|
|
})
|
|
|
},
|
|
@@ -163,13 +181,14 @@ Page({
|
|
|
icon: "none"
|
|
|
})
|
|
|
that.isDisabled();
|
|
|
+ that.randerData()
|
|
|
} else {
|
|
|
_Http.basic({
|
|
|
"id": 20220906155103,
|
|
|
"version": 1,
|
|
|
"content": {
|
|
|
"sa_salesforecastid": item.sa_salesforecastid,
|
|
|
- "sa_projectid": item.sa_projectid,
|
|
|
+ "sa_projectid": 0,
|
|
|
"sa_salesforecastbillid": item.sa_salesforecastbillid
|
|
|
}
|
|
|
}).then(res => {
|
|
@@ -177,14 +196,15 @@ Page({
|
|
|
title: res.data,
|
|
|
icon: "none"
|
|
|
});
|
|
|
- wx.showToast({
|
|
|
- title: '删除成功',
|
|
|
- icon: "none"
|
|
|
- })
|
|
|
that.setData({
|
|
|
list: that.data.list.filter(v => v.itemclassnum != item.itemclassnum)
|
|
|
})
|
|
|
that.isDisabled();
|
|
|
+ that.randerData()
|
|
|
+ wx.showToast({
|
|
|
+ title: '删除成功',
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -193,7 +213,6 @@ Page({
|
|
|
},
|
|
|
/* 判断是否禁用保存按钮 */
|
|
|
isDisabled() {
|
|
|
- console.log(123)
|
|
|
let count = 0;
|
|
|
this.data.list.forEach(v => v.complete ? count += 1 : '')
|
|
|
this.setData({
|