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 base64_1 = computed(() => store.get_base64_1)
const base64_2 = computed(() => store.get_base64_2)
const currentCkProjectId = ref('')
const submitData = ref<Item[]>([])
// watch(
// daily,
@ -206,11 +206,13 @@ const ckProjectListByType = async function (type) {
const res = await api.get<CkProjectListByType[]>(`/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,14 +284,14 @@ 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') {
console.log(selectedItem)
if (selectedItem != 'null') {
assessmentRecordDetails.value.push({
ckGroupId: element.snowFlakeId, //Id
ckItemId: ele.ckItemId, //ID
ckItemId: item.snowFlakeId, //ID
ckStandardId: selectedItem, //ID
})
}
@ -297,7 +299,6 @@ const onSubmit = async function () {
}
})
})
})
const assessmentRecordParams = {
assessmentRecordDetails: [] as any[],
@ -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,