|
|
@@ -258,25 +258,34 @@
|
|
|
};
|
|
|
});
|
|
|
|
|
|
- this.isSubmitting = true;
|
|
|
- this.$api
|
|
|
- .post('/core/team/member/answer/submit', submitList)
|
|
|
- .then((res) => {
|
|
|
- if (res.data.code !== 0) {
|
|
|
- this.isSubmitting = false;
|
|
|
- return this.$showToast(res.data.msg);
|
|
|
+ let that = this;
|
|
|
+ uni.showModal({
|
|
|
+ title:'温馨提示',
|
|
|
+ content:'是否确认提交问卷?提交后不可修改。',
|
|
|
+ success: (res) => {
|
|
|
+ if(res.confirm){
|
|
|
+ that.isSubmitting = true;
|
|
|
+ that.$api
|
|
|
+ .post('/core/team/member/answer/submit', submitList)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data.code !== 0) {
|
|
|
+ that.isSubmitting = false;
|
|
|
+ return that.$showToast(res.data.msg);
|
|
|
+ }
|
|
|
+ uni.removeStorageSync('questionnaire');
|
|
|
+ let url = '/pagesPublish/questionnaireResult'
|
|
|
+ if(that.type == 2) url = '/pagesPublish/submitResult'
|
|
|
+ uni.navigateTo({ url })
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ that.$showToast('网络异常,请稍后重试');
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ that.isSubmitting = false;
|
|
|
+ });
|
|
|
}
|
|
|
- uni.removeStorageSync('questionnaire');
|
|
|
- let url = '/pagesPublish/questionnaireResult'
|
|
|
- if(this.type == 2) url = '/pagesPublish/submitResult'
|
|
|
- uni.navigateTo({ url })
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- this.$showToast('网络异常,请稍后重试');
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- this.isSubmitting = false;
|
|
|
- });
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
setQuestionnaireCache() {
|
|
|
const answeredList = this.list.filter((l) => l.answer.filter(a => a?.value).length>0).map((l) => ({ id: l.id, answer: l.answer }));
|