diff --git a/src/sass/AppAskForm/PreviewForm.vue b/src/sass/AppAskForm/PreviewForm.vue index 1934df35..be25e63a 100644 --- a/src/sass/AppAskForm/PreviewForm.vue +++ b/src/sass/AppAskForm/PreviewForm.vue @@ -21,7 +21,7 @@
@@ -97,38 +98,28 @@ export default { type: 0, id: '', touchStart: 0, - ...params + ...params, + formInfo: {} } }, - mounted () { + onLoad (query) { document.title = '表单预览' + query.id && this.getInfo(query.id, query.formId) }, methods: { - getInfo(id) { - uni.showLoading() - this.$http.post(`/app/appquestionnairetemplate/queryDetailById?id=${id}`).then(res => { + getInfo(id, formId) { + this.$http.post(`/app/appquestionnairetemplate/queryDataInfoById?id=${formId}&dataId=${id}`).then(res => { if (res.code == 0) { - this.form = { - ...res.data, - headPicture: res.data.headPicture - } + this.formInfo = res.data - this.type = res.data.type - - this.targetList = res.data.fields.map(item => { - return JSON.parse(item.fieldInfo) + this.targetList.forEach((item, index) => { + if (item.type === 'checkbox' && this.formInfo[`field_${index}`]) { + this.formInfo[`field_${index}`] = this.formInfo[`field_${index}`].split(',') + } }) - - this.pageShow = true - } else { - this.$u.toast(res.msg) } - - uni.hideLoading() - }).catch(() => { - uni.hideLoading() }) } } diff --git a/src/sass/AppAskForm/Statistical.vue b/src/sass/AppAskForm/Statistical.vue index 2b48d9b7..95adaa03 100644 --- a/src/sass/AppAskForm/Statistical.vue +++ b/src/sass/AppAskForm/Statistical.vue @@ -15,38 +15,44 @@
-
-

{{ item.fieldName }}({{ item.fixedLabel }})

-
-
-
-

{{ filed.label }}:

- -
-
- {{ filed.c }}票 - {{ (((filed.c || 0) / fieldDataCount[`field_${index}`]) * 100).toFixed(2) }}% +
+ +
-
+
-

且听风吟

- 微信用户 +

{{ item.residentName }}

+ {{ $dict.getLabel('wxUserType', item.userType) }}
-

2021-10-10 10:30:00

+

{{ item.commitTime }}

-

分值: 10

-
查看表单
+

分值: {{ item.totalScore }}

+
查看表单
@@ -71,12 +77,18 @@ total: 0, pageShow: false, form: {}, + search: { + size: 15, + current: 1 + }, + isMore: false, fieldTypeCount: [], fieldValueDistribution: [], fieldDataCount: {}, isShowForm: false, targetList: [], - formInfo: {} + formInfo: {}, + list: [] } }, @@ -87,6 +99,10 @@ this.$nextTick(() => { this.getInfo() this.getFormInfo() + + this.$dict.load(['wxUserType']).then(() => { + this.getList() + }) }) }, @@ -102,6 +118,42 @@ }) }, + toPreview(id) { + localStorage.setItem("toPreviewForm", JSON.stringify({form: this.info, targetList: this.targetList})) + uni.navigateTo({url: `./PreviewForm?id=${id}&formId=${this.info.id}`}) + }, + + getList() { + if (this.isMore) return + this.$http.post(`/app/appquestionnairetemplate/statisticsResident?id=${this.id}`, null, { + params: { + ...this.search + } + }).then(res => { + if (res.code == 0) { + if (this.search.current > 1) { + this.list = [...this.list, ...res.data.records] + } else { + this.list = res.data.records + } + + uni.hideLoading() + + if (res.data.records.length < 10) { + this.isMore = true + + return false + } + + this.search.current = this.search.current + 1 + } else { + uni.hideLoading() + } + }).catch(() => { + uni.hideLoading() + }) + }, + mapType(type) { return { upload: '上传图片', @@ -151,6 +203,10 @@ } }) } + }, + + onReachBottom() { + this.getList() } } @@ -262,6 +318,29 @@ font-size: 32px; } + &.topic-item__active { + display: flex; + align-items: center; + justify-content: space-between; + margin: 40px 32px 0; + padding: 34px 32px; + background: #EFF7FF; + border-radius: 16px; + border: 1px solid #CCCCCC; + + h2 { + flex: 1; + margin-right: 9px; + font-weight: 600; + font-size: 32px; + color: #333333; + } + + span { + color: #666666; + } + } + .option-item { display: flex; align-items: center;