Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {ServeService} from "../../serve.service";
import {CommonService} from "../../../../provide/common.service";
@Component({
selector: 'page-goods-verify',
templateUrl: 'goods-verify.html',
})
export class GoodsVerifyPage {
changeType = 1;
doneList = [];
noList = [];
chooseObj = [];
footerView = false;
checkAll = false;
constructor(public navCtrl: NavController, public navParams: NavParams,
private serveSer: ServeService, private commonSer: CommonService) {
}
ionViewDidLoad() {
this.footerView = true;
this.getUnsubmit();
}
ionViewWillLeave() {
this.footerView = false;
}
getUnsubmit() {
this.changeType = 1;
this.footerView = true;
const data = {
P_pageNumber: 1,
P_pageSize: 100,
type: 1,
};
this.serveSer.searchUnsubmit(data).subscribe(
(res) => {
this.noList = res.list;
}
)
}
getSubmited() {
this.changeType = 2;
this.footerView = false;
const data = {
P_pageNumber: 1,
P_pageSize: 100,
type: 1,
};
this.serveSer.searchSubmited(data).subscribe(
(res) => {
this.doneList = res.list;
}
)
}
doRefresh(e) {
e.complete()
}
doInfinite(e) {
e.complete()
}
//单选
changeCheck(goods) {
const index = this.chooseObj.indexOf(goods.id);
if (index > -1) {
this.chooseObj.splice(index, 1);
} else {
this.chooseObj.push(goods.id);
}
console.log(this.chooseObj);
}
//全选
selectAll(e) {
this.chooseObj = [];
if (e == false) {
this.noList.forEach(e => {
e.checkbox = false;
})
} else {
this.noList.forEach(e => {
e.checkbox = true;
this.chooseObj.push(e.id);
})
}
}
//提交
submit(operateFlag) {
const data = {
idStr: this.chooseObj.join(','),
operateFlag: operateFlag,
};
let params = 2;
let msg = operateFlag == 1 ? '确定通过所选申请' : '确定退回所选申请';
this.commonSer.alert(msg, () => {
this.serveSer.dealOrder(data, params).subscribe(
(res) => {
this.getSubmited();
this.getUnsubmit();
}
)
})
}
}