step3.js
9.26 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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
"use strict";
const common_vendor = require("../../common/vendor.js");
const training_train = require("../train.js");
require("../../common/request.js");
require("../../common/login.js");
require("../../config.js");
require("../../common/aes.js");
if (!Array) {
const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput");
const _easycom_uni_forms_item2 = common_vendor.resolveComponent("uni-forms-item");
const _easycom_uni_data_checkbox2 = common_vendor.resolveComponent("uni-data-checkbox");
const _easycom_uni_file_picker2 = common_vendor.resolveComponent("uni-file-picker");
const _easycom_uni_data_select2 = common_vendor.resolveComponent("uni-data-select");
const _easycom_uni_forms2 = common_vendor.resolveComponent("uni-forms");
(_easycom_uni_easyinput2 + _easycom_uni_forms_item2 + _easycom_uni_data_checkbox2 + _easycom_uni_file_picker2 + _easycom_uni_data_select2 + _easycom_uni_forms2)();
}
const _easycom_uni_easyinput = () => "../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js";
const _easycom_uni_forms_item = () => "../../uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.js";
const _easycom_uni_data_checkbox = () => "../../uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.js";
const _easycom_uni_file_picker = () => "../../uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.js";
const _easycom_uni_data_select = () => "../../uni_modules/uni-data-select/components/uni-data-select/uni-data-select.js";
const _easycom_uni_forms = () => "../../uni_modules/uni-forms/components/uni-forms/uni-forms.js";
if (!Math) {
(_easycom_uni_easyinput + _easycom_uni_forms_item + _easycom_uni_data_checkbox + _easycom_uni_file_picker + _easycom_uni_data_select + _easycom_uni_forms)();
}
const _sfc_main = {
__name: "step3",
props: {
activity: {
type: Object,
default: () => {
}
},
trainId: {
type: String,
default: () => {
}
},
active: {
type: Number,
default: () => {
}
}
},
emits: ["prev", "next"],
setup(__props, { emit }) {
const props = __props;
const customInfo = common_vendor.computed(() => {
if (props.activity.customInfo) {
return JSON.parse(props.activity.customInfo).info;
} else {
return [];
}
});
const data = common_vendor.reactive({
form: {
invoiceFlag: "1",
customInfoObj: {}
},
invoiceFlag: [{
value: "0",
text: "否"
}, {
value: "1",
text: "是"
}],
invoiceType: [{
value: 0,
text: "电子票"
}, {
value: 1,
text: "纸质专票"
}, {
value: 2,
text: "纸质普票"
}]
});
const {
form,
invoiceType,
invoiceFlag
} = common_vendor.toRefs(data);
common_vendor.watch(() => props.activity.invoiceFlag, (val) => {
if (val == "1") {
if (!form.value.invoiceType) {
form.value.invoiceType = common_vendor._.orderBy(props.activity.invoiceType.split(","))[0];
}
}
}, {
immediate: true
});
common_vendor.watch(() => props.active, (val) => {
if (val == 2) {
common_vendor.index.showLoading({
title: "加载中"
});
training_train.getTrainPersonalInfo(props.trainId).then((res) => {
var _a;
form.value = res.data || {};
if ((_a = res.data) == null ? void 0 : _a.customInfo) {
form.value.customInfoObj = JSON.parse(res.data.customInfo);
} else {
form.value.customInfoObj = {};
}
common_vendor.index.hideLoading();
});
}
});
function prev() {
emit("prev");
}
function next() {
if (!form.value.unitName) {
common_vendor.index.showToast({
title: "请填写所在单位",
icon: "none"
});
return;
}
if (!form.value.unitRole) {
common_vendor.index.showToast({
title: "请填写职务信息",
icon: "none"
});
return;
}
form.value.activityId = props.trainId;
form.value.customInfo = JSON.stringify(form.value.customInfoObj);
training_train.savePersonalInfo(form.value).then(() => {
common_vendor.index.showToast({
title: "保存成功",
icon: "none"
}).finally((res) => {
emit("next");
});
});
}
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.o(($event) => common_vendor.unref(form).unitName = $event),
b: common_vendor.p({
placeholder: "请输入所在单位名称",
modelValue: common_vendor.unref(form).unitName
}),
c: common_vendor.p({
label: "所在单位名称",
required: true,
name: "unitName"
}),
d: common_vendor.o(($event) => common_vendor.unref(form).unitRole = $event),
e: common_vendor.p({
placeholder: "请输入现任职务",
modelValue: common_vendor.unref(form).unitRole
}),
f: common_vendor.p({
label: "现任职务",
required: true,
name: "unitRole"
}),
g: __props.activity.invoiceFlag == "1"
}, __props.activity.invoiceFlag == "1" ? common_vendor.e({
h: common_vendor.o(($event) => common_vendor.unref(form).invoiceFlag = $event),
i: common_vendor.p({
localdata: common_vendor.unref(invoiceFlag),
modelValue: common_vendor.unref(form).invoiceFlag
}),
j: common_vendor.p({
label: "是否需要发票",
required: true,
name: "invoiceFlag"
}),
k: common_vendor.unref(form).invoiceFlag == "1"
}, common_vendor.unref(form).invoiceFlag == "1" ? {
l: common_vendor.o(($event) => common_vendor.unref(form).invoiceType = $event),
m: common_vendor.p({
localdata: common_vendor.unref(invoiceType),
modelValue: common_vendor.unref(form).invoiceType
}),
n: common_vendor.p({
label: "发票形式",
required: true,
name: "invoiceType"
})
} : {}, {
o: common_vendor.unref(form).invoiceFlag == "1"
}, common_vendor.unref(form).invoiceFlag == "1" ? {
p: common_vendor.o(($event) => common_vendor.unref(form).invoiceInfo = $event),
q: common_vendor.p({
placeholder: "请输入开票信息",
modelValue: common_vendor.unref(form).invoiceInfo
}),
r: common_vendor.p({
label: "开票信息",
required: true,
name: "invoiceInfo"
})
} : {}) : {}, {
s: common_vendor.f(common_vendor.unref(customInfo), (c, k0, i0) => {
return common_vendor.e({
a: c.type == "1"
}, c.type == "1" ? {
b: "9bd2f2aa-12-" + i0 + "," + ("9bd2f2aa-11-" + i0),
c: common_vendor.o(($event) => common_vendor.unref(form).customInfoObj[c.id] = $event, c.id),
d: common_vendor.p({
placeholder: "请输入",
modelValue: common_vendor.unref(form).customInfoObj[c.id]
})
} : {}, {
e: c.type == "2"
}, c.type == "2" ? {
f: common_vendor.o(_ctx.selectFile, c.id),
g: common_vendor.o(($event) => _ctx.delSupplementFile(c, $event), c.id),
h: "9bd2f2aa-13-" + i0 + "," + ("9bd2f2aa-11-" + i0),
i: common_vendor.o(($event) => c.value = $event, c.id),
j: common_vendor.p({
limit: "1",
["file-mediatype"]: "all",
["file-extname"]: "doc,docx,pdf,txt",
modelValue: c.value
})
} : {}, {
k: c.type == "2"
}, c.type == "2" ? {} : {}, {
l: c.type == "3"
}, c.type == "3" ? {
m: common_vendor.o(_ctx.upSupplement3, c.id),
n: common_vendor.o(($event) => _ctx.delSupplementImg(c, $event), c.id),
o: "9bd2f2aa-14-" + i0 + "," + ("9bd2f2aa-11-" + i0),
p: common_vendor.o(($event) => _ctx.upSupplement3Value = $event, c.id),
q: common_vendor.p({
["return-type"]: "object",
limit: "1",
modelValue: _ctx.upSupplement3Value
})
} : {}, {
r: c.type == "4"
}, c.type == "4" ? {
s: "9bd2f2aa-15-" + i0 + "," + ("9bd2f2aa-11-" + i0),
t: common_vendor.o(($event) => c.value = $event, c.id),
v: common_vendor.p({
localdata: c.option,
modelValue: c.value
})
} : {}, {
w: c.id,
x: "9bd2f2aa-11-" + i0 + ",9bd2f2aa-0",
y: common_vendor.p({
label: c.name
})
});
}),
t: common_vendor.sr("baseForm", "9bd2f2aa-0"),
v: common_vendor.p({
modelValue: common_vendor.unref(form),
["label-width"]: "120"
}),
w: common_vendor.o(prev),
x: common_vendor.o(next)
});
};
}
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "/Users/yangyang/ztx_wx_minapp/training/components/step3.vue"]]);
wx.createComponent(Component);