From e2bc9ea50addd2bb888988f9d4b2914fcb355ed6 Mon Sep 17 00:00:00 2001 From: TimSpan Date: Fri, 8 Nov 2024 17:21:50 +0800 Subject: [PATCH] Update dailyInspection.vue --- .../dailyInspection/dailyInspection.vue | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/collect_information/src/subPages/police/dailyInspection/dailyInspection.vue b/collect_information/src/subPages/police/dailyInspection/dailyInspection.vue index 5cb8791..4e4512a 100644 --- a/collect_information/src/subPages/police/dailyInspection/dailyInspection.vue +++ b/collect_information/src/subPages/police/dailyInspection/dailyInspection.vue @@ -85,7 +85,7 @@ const store = useDailyStore() const daily = computed(() => store.getdailyinspection) const base64_1 = computed(() => store.get_base64_1) const base64_2 = computed(() => store.get_base64_2) - +const currentCkProjectId = ref('') const submitData = ref([]) // watch( // daily, @@ -206,11 +206,13 @@ const ckProjectListByType = async function (type) { const res = await api.get(`/assessmentCriteria/ckProjectListByType`, { type }) selectorType.value = res.data } + const onChangeType = function (e: any) { let index = Number(e.detail.value) selectorCheckedType.value = selectorType.value?.[index].label as string - let ckProjectId = selectorType.value?.[index].value - assessmentCriteriaRulesByCkProjectId(ckProjectId) + currentCkProjectId.value = selectorType.value?.[index].value as string + // let ckProjectId = selectorType.value?.[index].value + assessmentCriteriaRulesByCkProjectId(currentCkProjectId.value) _form.ckProjectId = selectorType.value?.[index].value as string } @@ -282,20 +284,19 @@ const onSubmit = async function () { ckStandardId: item.selectedID, //已选择的雪花ID }) } - if (item.hasOwnProperty('selectedGroup')) { - item.selectedGroup.forEach((selectedItem) => { - // console.log(selectedItem) - // console.log(ele) - if (ele.ckItemId != 'null' && selectedItem != 'null') { - assessmentRecordDetails.value.push({ - ckGroupId: element.snowFlakeId, //选项的雪花Id - ckItemId: ele.ckItemId, //已选择的ID - ckStandardId: selectedItem, //已选择的雪花ID - }) - } - }) - } }) + if (item.hasOwnProperty('selectedGroup')) { + item.selectedGroup.forEach((selectedItem) => { + console.log(selectedItem) + if (selectedItem != 'null') { + assessmentRecordDetails.value.push({ + ckGroupId: element.snowFlakeId, //选项的雪花Id + ckItemId: item.snowFlakeId, //已选择的ID + ckStandardId: selectedItem, //已选择的雪花ID + }) + } + }) + } }) }) @@ -309,6 +310,8 @@ const onSubmit = async function () { const result = await api.post('/assessmentCriteria/submitAssessmentRecord', assessmentRecordParams) console.log('🚀 ~ onSubmit ~ result:', result) Taro.hideLoading() + store.dailyinspectionList([]) //清空数据 + assessmentCriteriaRulesByCkProjectId(currentCkProjectId.value) //重新获取数据 if (result.code === 200) { Taro.showToast({ title: result.message,