Update dailyInspection.vue

This commit is contained in:
TimSpan 2024-11-08 17:21:50 +08:00
parent 5369190b1d
commit e2bc9ea50a
1 changed files with 19 additions and 16 deletions

View File

@ -85,7 +85,7 @@ const store = useDailyStore()
const daily = computed(() => store.getdailyinspection) const daily = computed(() => store.getdailyinspection)
const base64_1 = computed(() => store.get_base64_1) const base64_1 = computed(() => store.get_base64_1)
const base64_2 = computed(() => store.get_base64_2) const base64_2 = computed(() => store.get_base64_2)
const currentCkProjectId = ref('')
const submitData = ref<Item[]>([]) const submitData = ref<Item[]>([])
// watch( // watch(
// daily, // daily,
@ -206,11 +206,13 @@ const ckProjectListByType = async function (type) {
const res = await api.get<CkProjectListByType[]>(`/assessmentCriteria/ckProjectListByType`, { type }) const res = await api.get<CkProjectListByType[]>(`/assessmentCriteria/ckProjectListByType`, { type })
selectorType.value = res.data selectorType.value = res.data
} }
const onChangeType = function (e: any) { const onChangeType = function (e: any) {
let index = Number(e.detail.value) let index = Number(e.detail.value)
selectorCheckedType.value = selectorType.value?.[index].label as string selectorCheckedType.value = selectorType.value?.[index].label as string
let ckProjectId = selectorType.value?.[index].value currentCkProjectId.value = selectorType.value?.[index].value as string
assessmentCriteriaRulesByCkProjectId(ckProjectId) // let ckProjectId = selectorType.value?.[index].value
assessmentCriteriaRulesByCkProjectId(currentCkProjectId.value)
_form.ckProjectId = selectorType.value?.[index].value as string _form.ckProjectId = selectorType.value?.[index].value as string
} }
@ -282,20 +284,19 @@ const onSubmit = async function () {
ckStandardId: item.selectedID, //ID 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) const result = await api.post('/assessmentCriteria/submitAssessmentRecord', assessmentRecordParams)
console.log('🚀 ~ onSubmit ~ result:', result) console.log('🚀 ~ onSubmit ~ result:', result)
Taro.hideLoading() Taro.hideLoading()
store.dailyinspectionList([]) //
assessmentCriteriaRulesByCkProjectId(currentCkProjectId.value) //
if (result.code === 200) { if (result.code === 200) {
Taro.showToast({ Taro.showToast({
title: result.message, title: result.message,