fix: 修复工单创建应用保存时报错问题

This commit is contained in:
“怀磊”
2022-01-19 12:52:08 +08:00
committed by 老广
parent 316b39d15b
commit c1ddc0f8e0

View File

@@ -232,10 +232,14 @@ export default {
},
methods: {
performSubmit(validValues) {
const applyCategoryType = validValues.meta.apply_category_type
validValues.meta.apply_category = applyCategoryType && applyCategoryType.length > 0 ? applyCategoryType[0] : ''
validValues.meta.apply_type = applyCategoryType && applyCategoryType.length > 0 ? applyCategoryType[1] : ''
delete validValues.meta['apply_category_type']
const validMeta = validValues.meta
const applyCategoryType = validMeta.apply_category_type
const filter = (len, field) => {
return applyCategoryType && applyCategoryType.length > 0 ? applyCategoryType[len] : validMeta[field]
}
validMeta.apply_category = filter(0, 'apply_category')
validMeta.apply_type = filter(1, 'apply_type')
delete validMeta['apply_category_type']
return this.$axios['post'](`/api/v1/tickets/tickets/open/?type=apply_application`, validValues)
}
}