Update dailyInspection.vue
This commit is contained in:
parent
5369190b1d
commit
e2bc9ea50a
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue