planEditor.js
1.59 KB
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
import { notifyError } from '../services/app.js';
import { PlanClause,payInsurance,getProspectusaAditional,deletePlan} from '../services/planEditor';
export default {
namespace: 'planEditor',
state: {
userName: '',
password: '',
},
effects: {
// 计划书查看条款
*PlanClause({ payload, callback ,error}, { call, put }) {
const { data } = yield call(PlanClause, payload);
if (data.status) {
if (callback) callback(data);
} else {
// notifyError(data.message);
if (error) error(data);
}
},
/* 编辑计划书--买入保险 */
*payInsurance({ payload, callback,error }, { call, put }) {
const { data } = yield call(payInsurance, payload);
if (data && data.status) {
if (callback) callback(data);
} else {
if (error) error(data);
// notifyErrorfyError(data.message);
}
},
/* 获取附加险 */
*getProspectusaAditional({ payload, callback,error }, { call, put }) {
const { data } = yield call(getProspectusaAditional, payload);
if (data.status) {
if (callback) callback(data);
} else {
if (error) error(data);
// notifyError(data.message);
}
},
/* 删除主险,附加险*/
*deletePlan({ payload, callback,error }, { call, put }) {
const { data } = yield call(deletePlan, payload);
if (data.status === true) {
if (callback) callback(data);
} else {
// notifyError(data.message);
if (error) error(data);
}
},
},
reducers: {
},
subscriptions: {
},
};