|
@@ -1,6 +1,10 @@
|
|
|
<template>
|
|
|
<div class="hc-task-html-form-body">
|
|
|
- <hc-table-form v-if="detailInfo.opinionType === 1 && tableHtml" ref="htmlRef" :form="htmlForm" :html="tableHtml" :loading="htmlLoading" @render="htmlRender" />
|
|
|
+ <hc-table-form
|
|
|
+ v-if="detailInfo.opinionType === 1 && tableHtml"
|
|
|
+ ref="htmlRef" :form="htmlForm" :html="tableHtml"
|
|
|
+ :loading="htmlLoading" @render="htmlRender" @blur="htmlBlur"
|
|
|
+ />
|
|
|
<hc-pdfs v-else-if="detailInfo.opinionType === 2 && HtmlPdfUrl" :src="HtmlPdfUrl" />
|
|
|
<hc-empty v-else-if="detailInfo.opinionType === 3" :src="nullPng" title="当前暂无审计咨询意见" />
|
|
|
<hc-empty v-else :src="noDataPng" />
|
|
@@ -9,9 +13,10 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { onMounted, ref, watch } from 'vue'
|
|
|
-import { deepClone, getObjValue } from 'js-fast-way'
|
|
|
+import { deepClone, getArrValue, getObjValue, isNullES } from 'js-fast-way'
|
|
|
import nullPng from '~src/assets/view/null.svg'
|
|
|
import noDataPng from '~src/assets/view/no-data.svg'
|
|
|
+import BigNumber from 'bignumber.js'
|
|
|
|
|
|
const props = defineProps({
|
|
|
detail: {
|
|
@@ -60,6 +65,19 @@ const getTableForm = () => {
|
|
|
return getObjValue(res)
|
|
|
}
|
|
|
|
|
|
+//表单输入框失去焦点
|
|
|
+const htmlBlur = (key, val) => {
|
|
|
+ if (isNullES(key)) return
|
|
|
+ const calculateKey = getArrValue(detailInfo.value?.calculateKey)
|
|
|
+ if (calculateKey.length < 3) return
|
|
|
+ const a = calculateKey[0], b = calculateKey[1], c = calculateKey[2]
|
|
|
+ if (a !== key) return
|
|
|
+ const form = htmlForm.value
|
|
|
+ const bv = form[b] ?? 0
|
|
|
+ htmlForm.value[c] = (BigNumber(val).plus(bv)).toString()
|
|
|
+ htmlRef.value?.setFormData(htmlForm.value)
|
|
|
+}
|
|
|
+
|
|
|
defineExpose({
|
|
|
getTableForm,
|
|
|
})
|