Browse Source

Merge branch 'master' into zhangteng

luojie
ZHANGTENG\张腾 1 month ago
parent
commit
3638465f4a
31 changed files with 1842 additions and 813 deletions
  1. +159
    -140
      src/components/Template/BaseInfoFormPackage.vue
  2. +15
    -8
      src/components/Template/CustomTable.vue
  3. +94
    -100
      src/components/Template/DecimalInput.vue
  4. +6
    -0
      src/components/Template/HandleFormItem.vue
  5. +10
    -7
      src/lang/en/template/dl.js
  6. +8
    -8
      src/lang/zh/template/dl.js
  7. +12
    -5
      src/utils/conConverter.js
  8. +25
    -0
      src/utils/conTools.js
  9. +11
    -4
      src/views/business/comps/template/TemplateTable.vue
  10. +12
    -8
      src/views/business/comps/template/comps/dl/DL007.vue
  11. +87
    -67
      src/views/business/comps/template/comps/dl/DL008.vue
  12. +84
    -66
      src/views/business/comps/template/comps/dl/DL009.vue
  13. +23
    -13
      src/views/business/comps/template/comps/dl/DL010.vue
  14. +47
    -20
      src/views/business/comps/template/comps/dl/DL011.vue
  15. +85
    -51
      src/views/business/comps/template/comps/dl/DL012.vue
  16. +50
    -17
      src/views/business/comps/template/comps/dl/DL013.vue
  17. +50
    -15
      src/views/business/comps/template/comps/dl/DL014.vue
  18. +32
    -13
      src/views/business/comps/template/comps/dl/DL015.vue
  19. +107
    -129
      src/views/business/comps/template/comps/dl/DL018.vue
  20. +1
    -42
      src/views/business/comps/template/comps/dl/DL022.vue
  21. +9
    -1
      src/views/business/comps/template/comps/dl/DL023.vue
  22. +19
    -12
      src/views/business/comps/template/comps/dl/DL024.vue
  23. +416
    -0
      src/views/business/comps/template/comps/gsp/GSP015.vue
  24. +33
    -5
      src/views/business/comps/template/comps/sp/SP0019.vue
  25. +50
    -42
      src/views/business/comps/template/comps/sp/SP0021.vue
  26. +13
    -4
      src/views/business/comps/template/comps/sp/SP00456.vue
  27. +16
    -12
      src/views/business/comps/template/comps/sp/comps/LadderConfig.vue
  28. +327
    -0
      src/views/business/comps/template/formConfig/gsp/gsp015.js
  29. +24
    -11
      src/views/business/comps/template/formConfig/paralleAndLadderConfig.js
  30. +16
    -13
      src/views/business/comps/template/formConfig/sp/SP0019.js
  31. +1
    -0
      src/views/business/comps/template/mixins/templateMixin.js

+ 159
- 140
src/components/Template/BaseInfoFormPackage.vue View File

@ -10,8 +10,7 @@
<div class="form-title">{{ $t(sItem.label) }}</div>
<HandleFormItem :field-item-label="fieldItemLabel" @blur="onBlur(key, $event)" :item="sItem"
v-model="formFields[key]" :field-key="prefixKey + '_' + key" @copy="onCopy(sItem, key)"
:error="errors[key]" @update:error="errors[key] = false"
:type="sItem.type"
:error="errors[key]" @update:error="errors[key] = false" :type="sItem.type"
:orange-bg="orangeBgFields[key]" />
</template>
</div>
@ -33,7 +32,7 @@
</div>
<div class="p-l-20">
<div v-show="isShowOther(formFields[key])">
<div class="form-title" >{{ sItem.otherLabel ? $t(sItem.otherLabel) :
<div class="form-title">{{ sItem.otherLabel ? $t(sItem.otherLabel) :
$t("template.common.other") }}</div>
<div class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel"
@ -73,17 +72,18 @@
<div class="form-title" v-if="sItem.label">{{ $t(sItem.label) }}</div>
<div v-if="sItem.type === 'dateTime' || sItem.type === 'datePicker'" class="flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
:type="sItem.type" :item="sItem" v-model="formFields[key]" @copy="onCopy(sItem, key)"
:error="errors[key]" @update:error="errors[key] = false"
:type="sItem.type" :item="sItem" v-model="formFields[key]"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" />
</div>
<div v-else-if="sItem.type === 'select'" class = "flex flex1">
<div v-else-if="sItem.type === 'select'" class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="select" :item="sItem" v-model="formFields[key]" @copy="onCopy(sItem, key)"
@change="(e, type) => onSelectChange(key, e, type)" :error="errors[key]"
@update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" />
<div v-show="isShowOther(formFields[key])" class="flex flex1 ml-10">
<div class="other-title" v-if="isShowOtherLabel(sItem)">{{ sItem.otherLabel ? $t(sItem.otherLabel) :
<div class="other-title" v-if="isShowOtherLabel(sItem)">{{ sItem.otherLabel ?
$t(sItem.otherLabel) :
$t("template.common.other") }}</div>
<div class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel"
@ -95,16 +95,19 @@
</div>
</div>
</div>
<div v-else-if="sItem.type === 'input'||sItem.type === 'textarea' || sItem.type === 'inputNumber'" class="item-center">
<div v-else-if="sItem.type === 'input' || sItem.type === 'textarea' || sItem.type === 'inputNumber'"
class="item-center">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
@blur="onBlur(key, $event)" :item="sItem" v-model="formFields[key]"
:type="sItem.type"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
:ref="key" :orange-bg="orangeBgFields[key]" />
:type="sItem.type" @copy="onCopy(sItem, key)" :error="errors[key]"
@update:error="errors[key] = false" :ref="key" :orange-bg="orangeBgFields[key]" />
<span v-if="sItem.subType === 'text'" class="sub-text">{{ $t(sItem.subText) }}</span>
<HandleFormItem class="ml-10" v-else-if="sItem.subType === 'button'" type="button"
:item="getButtonItem(sItem)" :value="formFields[sItem.subKey]"
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data)" />
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data, sItem.subKey)" />
<HandleFormItem class="ml-10" v-else-if="sItem.thirdType === 'button'" type="button"
:item="getThirdButtonItem(sItem)" :value="formFields[sItem.thirdKey]"
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data, sItem.thirdKey)" />
</div>
<div v-else-if="sItem.type === 'clickable'" class="flex1">
@ -124,8 +127,7 @@
</div>
<!-- 勾选某些选项时出现其他输入框 -->
<div v-else-if="sItem.type === 'radioAndOther'" class="item-center"
:class="{'form-error-border': errors[key]}"
>
:class="{ 'form-error-border': errors[key] }">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="radio" :error="errors[key]" @update:error="errors[key] = false"
@change="(e, type) => onSelectChange(key, e, type)" :item="sItem"
@ -155,12 +157,14 @@
</template>
<div class="flex flex-wrap" v-else-if="item.type === 'explainItem'">
<div v-for="(sItem, key) in item.config" :key="key" class="explain-item">
<div v-if="sItem.type === 'input' || sItem.type === 'textarea' || sItem.type === 'inputNumber'" class="m-r-10">
<div v-if="sItem.type === 'input' || sItem.type === 'textarea' || sItem.type === 'inputNumber'"
class="m-r-10">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
:type="sItem.type" :item="sItem" style="width: auto;flex:1" :style = "{'width': sItem.formWidth ? sItem.formWidth + 'px' : 'auto'}" v-model="formFields[key]"
@copy="onCopy(sItem, key)" @change="(e, type) => onSelectChange(key, e, type)"
:error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" />
:type="sItem.type" :item="sItem" style="width: auto;flex:1"
:style="{ 'width': sItem.formWidth ? sItem.formWidth + 'px' : 'auto' }"
v-model="formFields[key]" @copy="onCopy(sItem, key)"
@change="(e, type) => onSelectChange(key, e, type)" :error="errors[key]"
@update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" />
</div>
<span v-else-if="sItem.type === 'span'" class="explain-title">{{ $t(sItem.label) }}</span>
</div>
@ -174,26 +178,31 @@
:style="{ 'width': sItem.labelWidth ? sItem.labelWidth + 'px' : '150px' }"
v-if="sItem.label">
{{ $t(sItem.label) }}</div>
<div v-if="sItem.type === 'span'" class="flex1">
{{ formFields[key] }}
</div>
<div v-if="sItem.type === 'dateTime'" class="flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="dateTime" :item="sItem" v-model="formFields[key]" @copy="onCopy(sItem, key)"
:error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" />
</div>
<div v-else-if="sItem.type === 'select' ||sItem.type === 'radio'" class="flex flex1">
<div v-else-if="sItem.type === 'select' || sItem.type === 'radio'" class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
:type="sItem.type" :item="sItem" style="width: auto;flex:1" v-model="formFields[key]"
@copy="onCopy(sItem, key)" @change="(e, type) => onSelectChange(key, e, type)"
:error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" />
<div v-show="isShowOther(formFields[key]) || isShowRadioSelect(formFields[key])" class="flex flex1 ml-10">
<div class="other-title" v-if="isShowOtherLabel(sItem) && isShowOther(formFields[key])">{{ sItem.otherLabel ? $t(sItem.otherLabel) :
$t("template.common.other") }}</div>
@remoteMethod="(query) => remoteMethod(query, sItem, key)" :error="errors[key]"
@update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" />
<div v-show="isShowOther(formFields[key]) || isShowRadioSelect(formFields[key])"
class="flex flex1 ml-10">
<div class="other-title" v-if="isShowOtherLabel(sItem) && isShowOther(formFields[key])">
{{ sItem.otherLabel ? $t(sItem.otherLabel) :
$t("template.common.other") }}</div>
<div class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.otherCode" @blur="onBlur(key, $event)"
:item="getOtherItem(sItem)" v-model="formFields[sItem.otherCode]"
:type = "isShowOther(formFields[key]) ? 'input' : 'select'"
:type="isShowOther(formFields[key]) ? 'input' : 'select'"
@copy="onCopy(sItem, key)" :error="errors[sItem.otherCode]"
@update:error="errors[sItem.otherCode] = false"
:orange-bg="orangeBgFields[sItem.otherCode]" />
@ -202,46 +211,57 @@
</div>
<div v-else-if="sItem.type === 'input' || sItem.type === 'inputNumber'" class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
:type="sItem.type"
@blur="onBlur(key, $event)" class="flex1" :item="sItem" v-model="formFields[key]"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-if="sItem.subType === 'select'" type="select" :item="getSubItem(sItem)"
v-model="formFields[sItem.subKey]" @copy="onCopy(sItem, key)"
@change="(e, type) => onSelectChange(sItem.subKey, e, type)"
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
:orange-bg="orangeBgFields[sItem.subKey]" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-if="sItem.subType === 'input'" type="input" :item="getSubItem(sItem)"
v-model="formFields[sItem.subKey]" @copy="onCopy(sItem, key)"
:error="errors[sItem.subKey]" @blur="onBlur(sItem.subKey, $event)"
@update:error="errors[sItem.subKey] = false"
:orange-bg="orangeBgFields[sItem.subKey]" />
<div class="ml-10 item-span" v-else-if="sItem.subType === 'span'">{{
formFields[sItem.subKey] }}</div>
<span v-else-if="sItem.subType === 'text'" class="sub-text">{{ $t(sItem.subText) }}</span>
<HandleFormItem class="ml-10" v-else-if="sItem.subType === 'button'" type="button"
:item="getButtonItem(sItem)" :value="formFields[sItem.subKey]"
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data)" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-else-if="sItem.subType === 'clickable'" type="clickable"
@clickable="handleClickable(sItem, sItem.subKey)" :item="getClickableItem(sItem)"
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
@resetRecord="resetRecord(sItem.subKey)" :value="formFields[sItem.subKey]" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-else-if="isRegent(sItem, 'subType')" :type="sItem.subType"
:item="getRegentItem(sItem, 'subType')" sourceFrom="baseInfoFormPackage"
@beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, sItem.subKey)"
@onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, sItem.subKey, sItem)"
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
:value="formFields[sItem.subKey]" />
:type="sItem.type" @blur="onBlur(key, $event)" class="flex1" :item="sItem"
v-model="formFields[key]" @copy="onCopy(sItem, key)" :error="errors[key]" :ref="key"
@update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" />
<template v-if="isShowSub(sItem)">
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-if="sItem.subType === 'select'" type="select" :item="getSubItem(sItem)"
v-model="formFields[sItem.subKey]" @copy="onCopy(sItem, key)"
@change="(e, type) => onSelectChange(sItem.subKey, e, type)"
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
:orange-bg="orangeBgFields[sItem.subKey]" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-if="sItem.subType === 'input'" type="input" :item="getSubItem(sItem)"
v-model="formFields[sItem.subKey]" @copy="onCopy(sItem, key)"
:error="errors[sItem.subKey]" @blur="onBlur(sItem.subKey, $event)"
:ref="sItem.subKey" @update:error="errors[sItem.subKey] = false"
:orange-bg="orangeBgFields[sItem.subKey]" />
<div class="ml-10 item-span" v-else-if="sItem.subType === 'span'">{{
formFields[sItem.subKey] }}</div>
<span v-else-if="sItem.subType === 'text'" class="sub-text">{{ $t(sItem.subText)
}}</span>
<div v-else-if="sItem.subType === 'button'">
<HandleFormItem class="ml-10" type="button" :item="getButtonItem(sItem)"
:value="formFields[sItem.subKey]"
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data, sItem.subKey)" />
</div>
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-else-if="sItem.subType === 'clickable'" type="clickable"
@clickable="handleClickable(sItem, sItem.subKey)" :item="getClickableItem(sItem)"
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
@resetRecord="resetRecord(sItem.subKey)" :value="formFields[sItem.subKey]" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-else-if="isRegent(sItem, 'subType')" :type="sItem.subType"
:item="getRegentItem(sItem, 'subType')" sourceFrom="baseInfoFormPackage"
@beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, sItem.subKey)"
@onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, sItem.subKey, sItem)"
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
:value="formFields[sItem.subKey]" />
</template>
<div v-if="isShowSub(sItem,'thirdType')">
<HandleFormItem class="ml-10" v-if="sItem.thirdType === 'button'" type="button"
:item="getThirdButtonItem(sItem)" :value="formFields[sItem.thirdKey]"
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data, sItem.thirdKey)" />
</div>
<div v-show="isShowOther(formFields[sItem.subKey])" class="flex flex1 ml-10">
<div class="other-title" v-if="isShowOtherLabel(sItem)">{{ sItem.otherLabel ? $t(sItem.otherLabel) :
<div class="other-title" v-if="isShowOtherLabel(sItem)">{{ sItem.otherLabel ?
$t(sItem.otherLabel) :
$t("template.common.other") }}</div>
<div class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel"
@ -252,44 +272,9 @@
:orange-bg="orangeBgFields[sItem.otherCode]" />
</div>
</div>
<!-- <div class="clickable" :class="getFillType(sItem.subFillType)" v-else-if = "sItem.subType ==='clickable'" @click="handleClickable(sItem,$event)">
<span v-if="formFields[sItem.subKey]">{{ formFields[sItem.subKey] }}</span>
<span v-else class="default-placeholder-text">请选择</span>
</div> -->
</div>
<!-- <div v-else-if="sItem.type === 'inputNumber'" class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="inputNumber" @blur="onBlur(key, $event)" class="flex1" :item="sItem"
@input="onInputNumberChange(key, $event)" :value="formFields[key]"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-if="sItem.subType === 'select'" type="select" :item="getSubItem(sItem)"
v-model="formFields[sItem.subKey]" @copy="onCopy(sItem, key)"
@change="(e, type) => onSelectChange(sItem.subKey, e, type)"
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
:orange-bg="orangeBgFields[sItem.subKey]" />
<div class="ml-10 item-span" v-else-if="sItem.subType === 'span'">{{
formFields[sItem.subKey] }}</div>
<HandleFormItem class="ml-10" v-else-if="sItem.subType === 'button'" type="button"
:item="getButtonItem(sItem)" :value="formFields[sItem.subKey]"
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data)" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-else-if="sItem.subType === 'clickable'"
@clickable="handleClickable(sItem, sItem.subKey)" :error="errors[sItem.subKey]"
type="clickable" @update:error="errors[sItem.subKey] = false"
@resetRecord="resetRecord(sItem.subKey)" :item="getClickableItem(sItem)"
:value="formFields[sItem.subKey]" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-else-if="isRegent(sItem, 'subType')" sourceFrom="baseInfoFormPackage"
:error="errors[sItem.subKey]" :type="sItem.subType"
@beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, sItem.subKey)"
@onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, sItem.subKey, sItem)"
:item="getRegentItem(sItem, 'subType')" :value="formFields[sItem.subKey]" />
</div> -->
<div v-else-if="sItem.type === 'clickable'" class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="clickable" @clickable="handleClickable(sItem, key)" :error="errors[key]"
@ -306,47 +291,47 @@
<span v-if="sItem.subType === 'text'" class="sub-text">{{ $t(sItem.subText) }}</span>
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-else-if="sItem.subType === 'input' || sItem.subType === 'inputNumber' || sItem.subType === 'select'" :type="sItem.subType" :item="getSubItem(sItem)"
v-model="formFields[sItem.subKey]" @copy="onCopy(sItem, key)"
:error="errors[sItem.subKey]" @blur="onBlur(sItem.subKey, $event)"
@update:error="errors[sItem.subKey] = false"
v-else-if="sItem.subType === 'input' || sItem.subType === 'inputNumber' || sItem.subType === 'select'"
:type="sItem.subType" :item="getSubItem(sItem)" v-model="formFields[sItem.subKey]"
@copy="onCopy(sItem, key)" :error="errors[sItem.subKey]"
@blur="onBlur(sItem.subKey, $event)" @update:error="errors[sItem.subKey] = false"
:orange-bg="orangeBgFields[sItem.subKey]" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.thirdKey" class="ml-10"
v-if="sItem.thirdType === 'select' || sItem.thirdType === 'input'" :type="sItem.thirdType" :item="getThirdItem(sItem)"
v-model="formFields[sItem.thirdKey]" @copy="onCopy(sItem, key)"
:error="errors[sItem.thirdKey]" @blur="onBlur(sItem.thirdKey, $event)"
@update:error="errors[sItem.thirdKey] = false"
v-if="sItem.thirdType === 'select' || sItem.thirdType === 'input'"
:type="sItem.thirdType" :item="getThirdItem(sItem)" v-model="formFields[sItem.thirdKey]"
@copy="onCopy(sItem, key)" :error="errors[sItem.thirdKey]"
@blur="onBlur(sItem.thirdKey, $event)" @update:error="errors[sItem.thirdKey] = false"
:orange-bg="orangeBgFields[sItem.thirdKey]" />
<HandleFormItem class="ml-10" v-if="sItem.fourthType === 'button'" type="button"
:item="getFourthButtonItem(sItem)" :value="formFields[sItem.fourthKey]"
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data)" />
:item="getFourthButtonItem(sItem)" :value="formFields[sItem.fourthKey]"
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data, sItem.fourthKey)" />
</div>
</div>
</div>
</template>
<template v-else-if="item.type === 'checkboxList'">
<div class="form-item " >
<div class="form-item ">
<div class="form-title fs-16" v-if="item.label">{{ $t(item.label) }}</div>
<div v-for="(sItem, key) in item.config" class="c-Item grid-container">
<div class="p-r-20 item-center" :class="sItem.span == 1 ? 'full-row' : ''">
<div class="form-title mr-20 checkboxList-title">{{ $t(sItem.label) }}</div>
<div class="flex flex1">
<HandleFormItem
v-if="sItem.type === 'checkboxTree'"
:field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
:type="sItem.type" :item="sItem" :value="formFields[key]"
@change="(e) => onAttachmentChange(key, e)"
<HandleFormItem v-if="sItem.type === 'checkboxTree'" :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + key" :type="sItem.type" :item="sItem"
:value="formFields[key]" @change="(e) => onAttachmentChange(key, e)"
:error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" />
<HandleFormItem v-else-if="sItem.type === 'textarea'" :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
@blur="onBlur(key, $event)" type="textarea" :item="sItem" v-model="formFields[key]"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
<HandleFormItem v-else-if="sItem.type === 'textarea'" :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + key" @blur="onBlur(key, $event)" type="textarea"
:item="sItem" v-model="formFields[key]" @copy="onCopy(sItem, key)"
:error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" />
<HandleFormItem v-else-if="sItem.type === 'input'" :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
@blur="onBlur(key, $event)" type="input" :item="sItem" v-model="formFields[key]"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
<HandleFormItem v-else-if="sItem.type === 'input'" :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + key" @blur="onBlur(key, $event)" type="input"
:item="sItem" v-model="formFields[key]" @copy="onCopy(sItem, key)"
:error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" />
</div>
</div>
@ -410,34 +395,63 @@ export default {
};
},
methods: {
isShowSub(item,type){
if(type === 'thirdType'){
if (item.hasOwnProperty("showThird")) {
return item.showThird
}
return item.thirdType && item.thirdKey;
}
if (item.hasOwnProperty("showSub")) {
return item.showSub
} else if (item.subType === 'text') {//span
return true;
}
return item.subType && item.subKey;
},
remoteMethod(query, sItem, key) {
this.$emit('remoteMethod', { query, sItem, key, formFields: this.formFields })
},
//radioselect
isShowRadioSelect(value){
const arr = ["动物种属","细胞系"];
isShowRadioSelect(value) {
const arr = ["动物种属", "细胞系"];
return arr.includes(value)
},
onBeforeReagentSubmit(data, callback, key) {
this.$emit('beforeReagentSubmit', { selectData: data, callback, key, formFields: this.formFields })
},
//
handleClickButton(e, item, val, data) {
if(!item.isClearForm){
this.formFields[item.subKey] = val;
}
this.$emit("clickButton", item, data)
handleClickButton(e, item, val, data, key) {
if (!item.isClearForm) {
this.formFields[key] = val;
}
this.$emit("clickButton", item, data, key, this.formFields)
},
//
getButtonItem(sItem) {
return {
...sItem,
key: sItem.subKey,
fillType: sItem.fourthFillType || sItem.fillType
disabled: sItem.subDisabled,
fillType: sItem.subFillType || sItem.fillType
}
},
//
getThirdButtonItem(sItem) {
return {
...sItem,
key: sItem.thirdKey,
disabled: sItem.thirdDisabled,
buttonName: sItem.thirdButtonName,
fillType: sItem.thirdFillType || sItem.fillType
}
},
getFourthButtonItem(sItem) {
return {
...sItem,
key: sItem.fourthKey,
buttonName:sItem.fourthButtonName,
buttonName: sItem.fourthButtonName,
disabled: sItem.fourthDisabled,
fillType: sItem.fourthFillType || sItem.fillType
}
},
@ -447,7 +461,7 @@ export default {
this.formFields[key] = e;
},
//
isShowOtherLabel(sItem){
isShowOtherLabel(sItem) {
if (sItem.hasOwnProperty("showOtherLabel")) {
return sItem.showOtherLabel
}
@ -539,22 +553,26 @@ export default {
.p-r-20 {
padding-right: 20px;
}
.explain-title{
.explain-title {
font-size: 14px;
font-weight: normal;
color: #606266;
padding-right: 10px;
}
.explain-item{
.explain-item {
display: flex;
align-items: center;
padding: 10px 0;
}
.flex-wrap{
.flex-wrap {
flex-wrap: wrap;
}
.m-r-10{
.m-r-10 {
margin-right: 10px;
}
@ -640,7 +658,8 @@ export default {
border-radius: 4px;
border: 1px solid #ff5d5d;
}
.checkboxList-title{
.checkboxList-title {
width: 120px;
text-align: center;
}

+ 15
- 8
src/components/Template/CustomTable.vue View File

@ -93,7 +93,7 @@
<template
v-if="col.bodyType === 'input' || col.bodyType === 'inputNumber' || col.bodyType === 'select' || col.bodyType === 'dateTimeRange' || col.bodyType === 'radio'">
<div class="flex flex1">
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex"
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + row.id"
:fieldItemLabel="fieldItemLabel" :type="col.bodyType"
@blur="onBlur(rowIndex, col.prop, $event)" @copy="onCopy(rowIndex, col)"
class="body-input" :item="getBodyItem(col, rowIndex)"
@ -120,7 +120,7 @@
:class="{ 'full-row': row[col.prop] && row[col.prop].length == 1 }"
v-for="(opItem, itemIndex) in row[col.prop]" :key="itemIndex">
<HandleFormItem
:fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex + '_' + itemIndex"
:fieldKey="prefixKey + '_' + col.prop + '_' + row.id + '_' + itemIndex"
:fieldItemLabel="fieldItemLabel" type="input"
@blur="onOperableInputBlur(opItem, $event)" class="body-input"
:item="getBodyItem(col, rowIndex)" :value="opItem.value"
@ -140,7 +140,7 @@
</div>
<div class="flex flex1" v-else-if="col.bodyType === 'clickable'">
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex"
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + row.id"
:fieldItemLabel="fieldItemLabel" type="clickable" class="body-clickable"
:item="getBodyItem(col, rowIndex)" :value="row[col.prop]"
:error="hasError(rowIndex, colIndex, col.prop)"
@ -150,7 +150,7 @@
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
</div>
<div class="flex flex1" v-else-if="isRegent(col, 'bodyType')">
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex"
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + row.id"
:fieldItemLabel="fieldItemLabel" :type="col.bodyType" class="body-clickable"
sourceFrom="customTable" :item="getBodyItem(col, rowIndex)"
:value="row[col.prop]" :error="hasError(rowIndex, colIndex, col.prop)"
@ -167,7 +167,7 @@
<template v-else-if="col.bodyType === 'checkboxTag'">
<div class="flex flex-wrap"
:class="{ 'row-error-border': hasError(rowIndex, colIndex, col.prop) }">
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex"
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + row.id"
:fieldItemLabel="fieldItemLabel" type="checkboxTag" :value="row[col.prop]"
:item="getBodyItem(col, rowIndex)"
@change="onCheckboxTagChange(rowIndex, colIndex, col, $event)"
@ -177,7 +177,7 @@
</div>
</template>
<template v-else-if="col.bodyType === 'checkbox'">
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex"
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + row.id"
:fieldItemLabel="fieldItemLabel" type="checkbox" v-model="row[col.prop]"
:item="getBodyItem(col, rowIndex)"
@change="onCheckboxChange(rowIndex, colIndex, col, $event)"
@ -204,7 +204,7 @@
v-if="isShowBodySub(col, row)">
<template
v-if="col.bodySubType === 'inputNumber' || col.bodySubType === 'input' || col.bodySubType === 'select'">
<HandleFormItem :fieldKey="prefixKey + '_' + col.bodySubKey + '_' + rowIndex"
<HandleFormItem :fieldKey="prefixKey + '_' + col.bodySubKey + '_' + row.id"
:fieldItemLabel="fieldItemLabel" :type="col.bodySubType"
@blur="onSubBlur(rowIndex, col.bodySubKey, $event)"
@copy="onCopy(rowIndex, col)" :item="getBodySubItem(col)"
@ -225,7 +225,7 @@
@clickButton="(e, data) => handleClickButton(e, data, col.bodySubKey, rowIndex, colIndex)" />
</template>
<div class="flex flex1" v-else-if="isRegent(col, 'bodySubType')">
<HandleFormItem :fieldKey="prefixKey + '_' + col.bodySubKey + '_' + rowIndex"
<HandleFormItem :fieldKey="prefixKey + '_' + col.bodySubKey + '_' + row.id"
:fieldItemLabel="fieldItemLabel" :type="col.bodySubType" class="body-clickable"
sourceFrom="customTable" :item="getBodySubItem(col, rowIndex)"
:value="row[col.bodySubKey]"
@ -1012,6 +1012,12 @@ export default {
this.checkCompareToOnDataLoad();
justUpdateFilledFormData();
},
pushDataSource(data=[]) {
this.localDataSource.push(...data);
this.localDataSource = [...this.localDataSource];
this.checkCompareToOnDataLoad();
justUpdateFilledFormData();
},
// newDataoldDatafalse
compareOldAndCurrentFormFields(newData, oldData) {
for (const key in newData) {
@ -1062,6 +1068,7 @@ export default {
actSolutionConcentrationPrecision: 3,//3
targetDiluentVolumePrecision: 3,//3
targetStartSolutionVolumePrecision: 3,//3
id:getuuid(),
});
justUpdateFilledFormData()
},

+ 94
- 100
src/components/Template/DecimalInput.vue View File

@ -38,6 +38,7 @@ export default {
internalValue: this.value !== null && this.value !== undefined ? String(this.value) : '',
oldValue: null,
oldPattern: null,
isNA: this.value !== null && this.value !== undefined ? /^NA$/i.test(String(this.value).toUpperCase()) : false,
patternRules: [
{ name: 'NA', pattern: /^NA$/i, inputPattern: /^N?A?$/i },
{ name: 'FRACTION', pattern: /^\d+(\/\d+)*$/, inputPattern: /^(\d+\/?)*$/ }
@ -51,9 +52,11 @@ export default {
this.internalValue = '';
this.oldValue = null;
this.oldPattern = null;
this.isNA = false;
} else {
const strVal = String(newVal);
this.internalValue = strVal;
this.isNA = /^NA$/i.test(strVal.toUpperCase());
this.updateOldValue(strVal);
}
},
@ -84,123 +87,118 @@ export default {
handleInput(val) {
if (val === '') {
this.internalValue = '';
this.isNA = false;
this.$emit('input', '');
return;
}
// NA
if (this.isNA) {
// NANA
this.internalValue = 'NA';
this.$emit('input', 'NA');
return;
}
const upperVal = val.toUpperCase();
let cleaned = val;
let matchedRule = null;
if (this.oldPattern) {
// oldValue
if (val.startsWith(this.oldValue)) {
// inputPattern
if (this.oldPattern.inputPattern.test(val)) {
matchedRule = this.oldPattern;
cleaned = val;
} else {
// FRACTION
if (this.oldPattern.name === 'FRACTION') {
cleaned = val.replace(/[^\d/]/g, '');
const parts = cleaned.split('/');
const validParts = [];
for (let i = 0; i < parts.length; i++) {
if (parts[i] !== '') {
validParts.push(parts[i]);
}
}
cleaned = validParts.join('/');
matchedRule = this.oldPattern;
} else {
cleaned = this.oldValue || '';
this.internalValue = cleaned;
return;
}
}
} else if (this.oldPattern.inputPattern.test(val)) {
// inputPattern
matchedRule = this.oldPattern;
cleaned = val;
} else {
//
matchedRule = this.getMatchingRule(val);
if (!matchedRule) {
cleaned = this.oldValue || '';
this.internalValue = cleaned;
return;
}
}
// NAFRACTION
// NA
if (/^NA$/i.test(upperVal)) {
matchedRule = { name: 'NA', pattern: /^NA$/i, inputPattern: /^N?A?$/i };
cleaned = upperVal;
this.isNA = true;
} else if (upperVal === 'N' || upperVal === 'A') {
// NA
matchedRule = { name: 'NA', pattern: /^NA$/i, inputPattern: /^N?A?$/i };
cleaned = upperVal;
} else {
// FRACTION
matchedRule = this.getMatchingRule(val);
if (matchedRule) {
if (matchedRule.name === 'FRACTION') {
cleaned = val.replace(/[^\d/]/g, '');
const parts = cleaned.split('/');
const validParts = [];
for (let i = 0; i < parts.length; i++) {
if (parts[i] !== '') {
validParts.push(parts[i]);
}
}
if (matchedRule) {
if (matchedRule.name === 'FRACTION') {
cleaned = val.replace(/[^\d/]/g, '');
const parts = cleaned.split('/');
const validParts = [];
for (let i = 0; i < parts.length; i++) {
if (parts[i] !== '' || i === parts.length - 1) {
validParts.push(parts[i]);
}
cleaned = validParts.join('/');
} else {
cleaned = upperVal;
}
cleaned = validParts.join('/');
} else {
cleaned = val
.replace(/[^\d.-]/g, '')
.replace(/^(-)\1+/, '$1');
cleaned = upperVal;
}
} else {
//
cleaned = val
.replace(/[^\d.-]/g, '')
.replace(/^(-)\1+/, '$1');
const firstDotIndex = cleaned.indexOf('.');
if (firstDotIndex !== -1) {
const before = cleaned.slice(0, firstDotIndex);
const after = cleaned.slice(firstDotIndex + 1).replace(/\./g, '');
cleaned = before + '.' + after;
}
//
const firstDotIndex = cleaned.indexOf('.');
if (firstDotIndex !== -1) {
const before = cleaned.slice(0, firstDotIndex);
const after = cleaned.slice(firstDotIndex + 1).replace(/\./g, '');
cleaned = before + '.' + after;
}
if (this.decimalDigits > 0 && cleaned.includes('.')) {
const [intPart, decPart = ''] = cleaned.split('.');
cleaned = intPart + '.' + decPart.slice(0, this.decimalDigits);
} else if (this.decimalDigits === 0) {
cleaned = cleaned.split('.')[0];
}
//
if (this.decimalDigits > 0 && cleaned.includes('.')) {
const [intPart, decPart = ''] = cleaned.split('.');
cleaned = intPart + '.' + decPart.slice(0, this.decimalDigits);
} else if (this.decimalDigits === 0) {
cleaned = cleaned.split('.')[0];
}
if (cleaned === '.') cleaned = '0.';
else if (cleaned === '-.') cleaned = '-0.';
else if (cleaned.startsWith('.')) cleaned = '0' + cleaned;
else if (cleaned.startsWith('-.')) cleaned = '-0.' + cleaned.slice(2);
//
if (cleaned === '.') cleaned = '0.';
else if (cleaned === '-.') cleaned = '-0.';
else if (cleaned.startsWith('.')) cleaned = '0' + cleaned;
else if (cleaned.startsWith('-.')) cleaned = '-0.' + cleaned.slice(2);
if (cleaned.includes('.')) {
const [int, dec] = cleaned.split('.');
let newInt = int;
if (/^-?0+\d/.test(int)) {
newInt = int.replace(/^-?0+(\d)/, '$1');
} else if (int === '' || int === '-') {
newInt = int + '0';
} else if (int === '00' || /^-00+$/.test(int)) {
newInt = int.startsWith('-') ? '-0' : '0';
}
cleaned = newInt + '.' + dec;
} else {
if (/^-?0+\d/.test(cleaned)) {
cleaned = cleaned.replace(/^-?0+(\d)/, '$1');
} else if (cleaned === '00' || /^-00+$/.test(cleaned)) {
cleaned = cleaned.startsWith('-') ? '-0' : '0';
}
//
if (cleaned.includes('.')) {
const [int, dec] = cleaned.split('.');
let newInt = int;
if (/^-?0+\d/.test(int)) {
newInt = int.replace(/^-?0+(\d)/, '$1');
} else if (int === '' || int === '-') {
newInt = int + '0';
} else if (int === '00' || /^-00+$/.test(int)) {
newInt = int.startsWith('-') ? '-0' : '0';
}
cleaned = newInt + '.' + dec;
} else {
if (/^-?0+\d/.test(cleaned)) {
cleaned = cleaned.replace(/^-?0+(\d)/, '$1');
} else if (cleaned === '00' || /^-00+$/.test(cleaned)) {
cleaned = cleaned.startsWith('-') ? '-0' : '0';
}
}
}
this.internalValue = cleaned;
// emit
if (cleaned === '' || cleaned === '-') {
this.$emit('input', cleaned === '-' ? '-' : '');
} else if (matchedRule && matchedRule.name !== 'FRACTION') {
this.$emit('input', cleaned);
} else if (cleaned.includes('/')) {
this.$emit('input', cleaned);
} else if (cleaned.includes('.')) {
// emit
this.$emit('input', cleaned);
} else if (matchedRule && matchedRule.name === 'FRACTION') {
// FRACTION
this.$emit('input', cleaned);
} else {
//
const num = parseFloat(cleaned);
this.$emit('input', isNaN(num) ? '' : num);
}
@ -238,6 +236,7 @@ export default {
if (val === '') {
this.oldValue = null;
this.oldPattern = null;
this.isNA = false;
this.$emit('input', '');
this.$emit('blur', '');
return;
@ -245,17 +244,20 @@ export default {
const upperVal = val.toUpperCase();
//
for (const rule of this.patternRules) {
if (rule.pattern.test(upperVal)) {
this.oldValue = upperVal;
this.oldPattern = rule;
this.internalValue = upperVal;
this.isNA = /^NA$/i.test(upperVal);
this.$emit('input', upperVal);
this.$emit('blur', upperVal);
return;
}
}
//
if (val.includes('/')) {
const parts = val.split('/');
const validParts = parts.filter(part => part !== '');
@ -292,20 +294,12 @@ export default {
return;
}
if (this.oldValue && this.oldPattern) {
const partialMatch = this.oldPattern.inputPattern && this.oldPattern.inputPattern.test(val);
if (!partialMatch) {
this.internalValue = this.oldValue;
this.$emit('input', this.oldValue);
this.$emit('blur', this.oldValue);
return;
}
}
//
let formatted = this.handleDecimalDigits(val);
this.internalValue = formatted;
this.$emit('input', parseFloat(formatted));
this.$emit('blur', parseFloat(formatted));
const num = parseFloat(formatted);
this.$emit('input', isNaN(num) ? '' : num);
this.$emit('blur', isNaN(num) ? '' : num);
}
}
};

+ 6
- 0
src/components/Template/HandleFormItem.vue View File

@ -19,6 +19,8 @@
<el-select v-else-if="type === 'select'" class="flex1" :multiple="item.multiple"
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue"
:disabled="getDisabled()" :placeholder="getPlaceholder()" @remove-tag="onRemoveTag"
:remote = "true"
:remote-method="remoteMethod"
@visible-change="onSelectBlur" @change="onInputChange" filterable>
<el-option v-for="op in item.options" :key="op.value" :label="op.label" :value="op.value">
</el-option>
@ -401,6 +403,10 @@ export default {
EventBus.$off("onMixReagentSubmit", this.onMixReagentSubmit)
},
methods: {
remoteMethod(query) {
console.log(query,"qqq")
this.$emit('remoteMethod', query);
},
handleFalse() {
return false;
},

+ 10
- 7
src/lang/en/template/dl.js View File

@ -78,7 +78,7 @@ export default {
pykssj: 'Cultivation Start Time',
pyjssj: 'Cultivation End Time',
jsButton: 'End',
yqsyxxEmpty: 'Please add instrument usage information first'
yqsyxxEmpty: 'Instrument usage information has not been filled in, please fill in before submitting'
},
dl008: {
...common,
@ -89,8 +89,8 @@ export default {
jzbh2: 'Strain Number',
jzbh3: 'Strain Number',
jzbh4: 'Strain Number',
yqsyxxEmpty: 'Instrument usage information cannot be empty',
cxqkEmpty: 'Imaging status cannot be empty'
yqsyxxEmpty: 'Instrument usage information has not been filled in, please fill in before submitting',
cxqkEmpty: 'Imaging status has not been filled in, please fill in before submitting'
},
dl009: {
...common,
@ -107,8 +107,8 @@ export default {
czqkDesc: 'Precipitation codes: "P-" = "None"; "P+" = "Slight"; "P++" = "Moderate"; "P+++" = "Severe".',
bjjtDesc: 'Background lawn codes: "N" = "Normal"; "R1" = "Weak, lawn covers 70%-90% of plate area"; "R2" = "Medium, lawn covers 40%-70% of plate area"; "R3" = "Strong, lawn covers 10%-40% of plate area"; "A" = "Absent, no lawn on plate"; "O" = "Precipitation present, affecting lawn assessment";',
jlsDesc: 'Colony count special case: "*" indicates pinpoint colonies visible on plate;',
yqsyxxEmpty: 'Instrument usage information cannot be empty',
jgxxEmpty: 'Result information cannot be empty'
yqsyxxEmpty: 'Instrument usage information has not been filled in, please fill in before submitting',
jgxxEmpty: 'Result information has not been filled in, please fill in before submitting'
},
dl010: {
...common,
@ -194,7 +194,9 @@ export default {
zxg: 'Lower Left Grid (cells)',
yxg: 'Lower Right Grid (cells)',
cdxxTime: 'Time {index}',
addCdxx: 'Add'
addCdxx: 'Add',
yqsyxxEmpty: 'Instrument usage information has not been filled in, please fill in before submitting',
cdxxEmpty: 'Measurement information has not been filled in, please fill in before submitting'
},
dl014: {
...common,
@ -221,7 +223,8 @@ export default {
sjgspjrl: 'Actual Test Article Volume',
gyhzqk: 'Post-dose Status',
qrButton: 'Confirm',
wcButton: 'Complete'
wcButton: 'Complete',
yqsyxxEmpty: 'Instrument usage information has not been filled in, please fill in before submitting'
},
dl015: {
...common,

+ 8
- 8
src/lang/zh/template/dl.js View File

@ -81,7 +81,7 @@ export default {
pykssj: '培养开始时间',
pyjssj: '培养结束时间',
jsButton: '结束',
yqsyxxEmpty: '请先添加仪器使用信息'
yqsyxxEmpty: '仪器使用信息还未填写,请填写后再提交'
},
dl008: {
...common,
@ -92,8 +92,8 @@ export default {
jzbh2: '菌种编号',
jzbh3: '菌种编号',
jzbh4: '菌种编号',
yqsyxxEmpty: '仪器使用信息不能为空',
cxqkEmpty: '成像情况不能为空'
yqsyxxEmpty: '仪器使用信息还未填写,请填写后再提交',
cxqkEmpty: '成像情况还未填写,请填写后再提交'
},
dl009: {
...common,
@ -110,8 +110,8 @@ export default {
czqkDesc: '沉淀量以代码填入:"P-" 代表 "无沉淀";"P+" 代表 "少量";"P++" 代表 "中等";"P+++" 代表 "严重"。',
bjjtDesc: '背景菌苔以代码填入:"N" 代表 "正常";"R1" 代表 "弱,菌苔约占平皿面积 70%-90%";"R2" 代表 "中,菌苔约占平皿面积 40%-70%";"R3" 代表 "强,菌苔约占平皿面积 10%-40%";"A" 代表 "消失,平皿上无菌苔";"O" 代表 "产生沉淀,影响背景菌苔判断";',
jlsDesc: '菌落数特殊情况:"*" 该平皿可见针尖样菌落;',
yqsyxxEmpty: '仪器使用信息不能为空',
jgxxEmpty: '结果信息不能为空'
yqsyxxEmpty: '仪器使用信息还未填写,请填写后再提交',
jgxxEmpty: '结果信息还未填写,请填写后再提交'
},
dl010: {
...common,
@ -198,8 +198,8 @@ export default {
yxg: '右下格(个)',
cdxxTime: '第{index}次',
addCdxx: '新增',
yqsyxxEmpty: '仪器使用信息不能为空,请添加后再提交',
cdxxEmpty: '测定信息不能为空,请添加后再提交'
yqsyxxEmpty: '仪器使用信息还未填写,请填写后再提交',
cdxxEmpty: '测定信息还未填写,请填写后再提交'
},
dl014: {
...common,
@ -227,7 +227,7 @@ export default {
gyhzqk: '给药后状态情况',
qrButton: '确认',
wcButton: '完成',
yqsyxxEmpty: '仪器使用信息不能为空,请添加后再提交'
yqsyxxEmpty: '仪器使用信息还未填写,请填写后再提交'
},
dl015: {
...common,

+ 12
- 5
src/utils/conConverter.js View File

@ -43,7 +43,8 @@ class ConcentrationConverter {
unitCategories = {
'mass': ['mg/mL', 'μg/mL', 'ug/mL', 'ng/mL', 'pg/mL', 'fg/mL', 'g/L', 'mg/L', 'μg/L'],
'mole': ['mol/mL', 'mol/L', 'mmol/L', 'μmol/L', 'umol/L', 'nmol/L', 'pmol/L', 'mmol/mL', 'μmol/mL'],
'activity': ['U/mL', 'IU/mL', 'U/L', 'IU/L']
'activity': ['U/mL', 'IU/mL', 'U/L', 'IU/L'],
'percent': ['%']
};
/**
@ -100,12 +101,12 @@ class ConcentrationConverter {
let inputValue, inputUnit;
if (typeof value === 'string') {
const match = value.toString().trim().match(/^([\d.]+(?:[eE][+-]?\d+)?)\s*([a-zA-Zμ/]+)$/);
const match = value.toString().trim().match(/^([\d.]+(?:[eE][+-]?\d+)?)(?:\s*([a-zA-Zμ/%]+))?$/);
if (!match) {
throw new Error(`输入格式错误: ${value}`);
}
inputValue = parseFloat(match[1]);
inputUnit = this.normalizeUnit(match[2]);
inputUnit = match[2] ? this.normalizeUnit(match[2]) : '';
} else if (typeof value === 'number') {
inputValue = value;
inputUnit = ''; // 无量纲
@ -124,12 +125,18 @@ class ConcentrationConverter {
return inputValue; // 相同单位,直接返回
}
// 3. 验证单位类别
// 3. 检查是否为%单位
if (inputUnit === '%' || normalizedTargetUnit === '%') {
// %单位是单独的系列,不进行转换
throw new Error(`单位类别不匹配: ${inputUnit} 不能转换为 ${targetUnit}`);
}
// 4. 验证单位类别
if (!this.isSameCategory(inputUnit, normalizedTargetUnit)) {
throw new Error(`单位类别不匹配: ${inputUnit} 不能转换为 ${targetUnit}`);
}
// 4. 执行转换
// 5. 执行转换
return this._convertValue(inputValue, inputUnit, normalizedTargetUnit);
}

+ 25
- 0
src/utils/conTools.js View File

@ -10,6 +10,11 @@ export const isCommonUnit = (startUnit, units) => {
return false;
}
// 检查是否为%单位
const isPercentUnit = (unit) => {
return unit.trim() === '%';
};
// 提取单位分子部分(斜杠前的部分)
const extractNumerator = (unit) => {
const normalizedUnit = unit
@ -48,6 +53,26 @@ export const isCommonUnit = (startUnit, units) => {
return 'other';
};
// 检查基准单位是否为%单位
if (isPercentUnit(startUnit)) {
// 所有单位都必须是%
for (const unit of units) {
if (!isPercentUnit(unit)) {
console.log(`单位 ${unit} 不是%单位,与基准单位不同`);
return false;
}
}
return true;
}
// 检查所有单位是否有%单位
for (const unit of units) {
if (isPercentUnit(unit)) {
console.log(`单位 ${unit} 是%单位,与基准单位 ${startUnit} 不同`);
return false;
}
}
// 获取基准单位的分子类别
const startNumerator = extractNumerator(startUnit);
if (!startNumerator) {

+ 11
- 4
src/views/business/comps/template/TemplateTable.vue View File

@ -43,6 +43,7 @@ import GSP004 from "./comps/gsp/GSP004.vue";
import GSP005 from "./comps/gsp/GSP005.vue";
import GSP009 from "./comps/gsp/GSP009.vue";
import GSP010 from "./comps/gsp/GSP010.vue";
import GSP015 from "./comps/gsp/GSP015.vue";
////
import SYWZPZJHB from "./comps/gsp/SYWZPZJHB.vue";
@ -77,7 +78,9 @@ import LBA008 from "./comps/lba/LBA008.vue";
// ADA002-使LBA002
// ADA003-使LBA003
// ADA004-使LBA004
// ADA005-使LBA005
// ADA006-使LBA006
// ADA007-使LBA007
//
// YP001-使SP001
@ -133,7 +136,7 @@ export default {
////
MJYLQSQD, SYWZPZJHB, DMYPPZJLB,
//
GSP001,GSP002, GSP003,GSP004,GSP005,GSP009, GSP010,
GSP001,GSP002, GSP003,GSP004,GSP005,GSP009, GSP010,GSP015,
//
SP001, SP003, SP00456,SP007, SP008, SP009,SP0019,SP0020,SP0021,
// PCR
@ -253,9 +256,11 @@ export default {
'GSP004': 'GSP004',
'GSP005': 'GSP005',
'GSP006': 'GSP002',
'GSP007': 'SP00456',
'GSP008': 'GSP002',
'GSP009': 'GSP009',
'GSP010': 'GSP010',
'GSP015': 'GSP015',
'GSP011': 'GSP009',
'GSP012': 'GSP002',
'GSP013': 'GSP002',
@ -266,9 +271,9 @@ export default {
'DMYPPZJLB': 'DMYPPZJLB',
//PCR
'PCR001': 'SP001',
'PCR002': 'PCR002',
'PCR003': 'PCR003',
'PCR004': 'PCR004',
'PCR002': 'SP00456',
'PCR003': 'SP00456',
'PCR004': 'SP00456',
'PCR005': 'PCR005',
'PCR006': 'SP0020',
'PCR007': 'PCR007',
@ -292,7 +297,9 @@ export default {
'ADA002': 'LBA002',
'ADA003': 'LBA003',
'ADA004': 'LBA004',
'ADA005': 'SP00456',
'ADA006': 'LBA006',
'ADA007': 'SP00456',
//
'YP001': 'SP001',
'YP002': 'YP002',

+ 12
- 8
src/views/business/comps/template/comps/dl/DL007.vue View File

@ -142,7 +142,8 @@ export default {
type: 'select',
options: this.getDictOptions('business_sydd'),
fillType: 'actFill',
otherCode: 'syddOther'
otherCode: 'syddOther',
otherMaxlength: 50
}
}
},
@ -223,8 +224,9 @@ export default {
label: 'template.dl.dl007.pyjssj',
type: 'input',
fillType: 'actFill',
maxlength: 200,
subType: 'button',
disabled: true,
subDisabled: this.fillType !== 'actFill',
subKey: 'pyjssjButton',
buttonName: 'template.dl.dl007.jsButton'
}
@ -263,13 +265,15 @@ export default {
},
//
async validFields() {
// 1. 使
const yqsyTableRef = this.$refs[refConf.yqsy]
const yqsyTableData = yqsyTableRef?.getDataSource() || []
// 1. 使 actFill
if (this.fillType === 'actFill') {
const yqsyTableRef = this.$refs[refConf.yqsy]
const yqsyTableData = yqsyTableRef?.getDataSource() || []
if (yqsyTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl007.yqsyxxEmpty'))
return Promise.reject(this.$t('template.dl.dl007.yqsyxxEmpty'))
if (yqsyTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl007.yqsyxxEmpty'))
return Promise.reject(this.$t('template.dl.dl007.yqsyxxEmpty'))
}
}
// 2.

+ 87
- 67
src/views/business/comps/template/comps/dl/DL008.vue View File

@ -47,18 +47,20 @@
@onRegentSubmit="onRegentSubmit"
>
</BaseInfoFormPackage>
<CustomTable
:columns="cxqkColumns"
:ref="refConf.cxqk"
@onRegentSubmit="(e) => onRegentSubmit(e)"
:showOperation="false"
:showAddRow="false"
:formData="cxqkFormData"
:prefixKey="`cxqkTable`"
:isBorder="true"
:showSort="false"
>
</CustomTable>
<template v-if="dynamicCxqkColumns.length > 0">
<CustomTable
:columns="cxqkColumns"
:ref="refConf.cxqk"
@onRegentSubmit="(e) => onRegentSubmit(e)"
:showOperation="false"
:showAddRow="false"
:formData="cxqkFormData"
:prefixKey="`cxqkTable`"
:isBorder="true"
:showSort="false"
>
</CustomTable>
</template>
<BaseInfoFormPackage
:ref="refConf.cxqkwrqk"
:formConfig="cxqkwrqkConfig"
@ -151,10 +153,10 @@ export default {
// ''
label: 'template.dl.dl008.wrqk',
type: 'select',
span: 1,
options: this.getDictOptions('business_dl_ameswrqk'),
fillType: 'actFill',
otherCode: 'cxqkwrqkOther',
otherMaxlength: 200,
showOtherLabel: false
}
}
@ -307,14 +309,20 @@ export default {
const headerSelectFields = this.formData.headerSelectFields || {}
//
if (!stepTableFormData_1 || stepTableFormData_1.length === 0 || this.isDataLoaded) {
if (
!stepTableFormData_1 ||
stepTableFormData_1.length === 0 ||
this.isDataLoaded
) {
return
}
// jzbh Label
const firstRow = stepTableFormData_1[0]
const labelKeys = Object.keys(firstRow).filter(key => key.match(/^jzbh\d+Label$/))
const labelKeys = Object.keys(firstRow).filter((key) =>
key.match(/^jzbh\d+Label$/)
)
if (labelKeys.length === 0) {
return
}
@ -335,7 +343,7 @@ export default {
// headerSelectFields
labelKeys.sort().forEach((labelKey, index) => {
const colIndex = index + 1
// headerSelectFields 1_1, 1_2, 1_3
const headerValues = []
let rowIndex = 1
@ -343,10 +351,12 @@ export default {
headerValues.push(headerSelectFields[`${colIndex}_${rowIndex}`])
rowIndex++
}
// 使
const headerLabel = headerValues.length > 0 ? headerValues.join(' ') : `菌种${colIndex}`
// "123"
const headerLabel = headerValues.length > 1
? `${headerValues[0]}${headerValues.slice(1).join('')}`
: headerValues[0] || `菌种${colIndex}`
dynamicColumns.push({
label: headerLabel,
prop: `jzbh${colIndex}`,
@ -382,19 +392,19 @@ export default {
//
getFilledFormData() {
const baseData = this.getFilledFormDataByRefs(refNames)
//
const cxqkTableRef = this.$refs[refConf.cxqk]
if (cxqkTableRef) {
const cxqkData = cxqkTableRef.getFilledFormData()
baseData.stepTableFormData_1 = cxqkData.stepTableFormData || []
}
// headerSelectFields
if (this.formData.headerSelectFields) {
baseData.headerSelectFields = this.formData.headerSelectFields
}
return baseData
},
//
@ -404,22 +414,25 @@ export default {
},
//
async validFields() {
// 1. 使
const yqsyTableRef = this.$refs[refConf.yqsy]
const yqsyTableData = yqsyTableRef?.getDataSource() || []
if (yqsyTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl008.yqsyxxEmpty'))
return Promise.reject(this.$t('template.dl.dl008.yqsyxxEmpty'))
}
// actFill
if (this.fillType === 'actFill') {
// 1. 使
const yqsyTableRef = this.$refs[refConf.yqsy]
const yqsyTableData = yqsyTableRef?.getDataSource() || []
// 2.
const cxqkTableRef = this.$refs[refConf.cxqk]
const cxqkTableData = cxqkTableRef?.getDataSource() || []
if (cxqkTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl008.cxqkEmpty'))
return Promise.reject(this.$t('template.dl.dl008.cxqkEmpty'))
if (yqsyTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl008.yqsyxxEmpty'))
return Promise.reject(this.$t('template.dl.dl008.yqsyxxEmpty'))
}
// 2.
const cxqkTableRef = this.$refs[refConf.cxqk]
const cxqkTableData = cxqkTableRef?.getDataSource() || []
if (cxqkTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl008.cxqkEmpty'))
return Promise.reject(this.$t('template.dl.dl008.cxqkEmpty'))
}
}
// 3.
@ -455,7 +468,7 @@ export default {
this.handleCxqkQxbdSelect(row)
}
},
//
handleYqbhSelect(row, rowIndex) {
const params = {
@ -465,15 +478,15 @@ export default {
}
this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params)
},
//
handleCxqkQxbdSelect(row) {
//
this.isDataLoaded = false
try {
const bdnr = JSON.parse(row.bdnr)
const headerFields = bdnr.headerFields || {}
const stepTableFormData_1 = bdnr.stepTableFormData_1 || []
@ -491,7 +504,10 @@ export default {
}
// 2.
const tableData = this.generateTableData(stepTableFormData_1, dynamicColumns.columnKeys)
const tableData = this.generateTableData(
stepTableFormData_1,
dynamicColumns.columnKeys
)
if (tableData.length === 0) {
this.clearCxqkTable()
return
@ -499,18 +515,17 @@ export default {
// 3.
this.updateCxqkTable(dynamicColumns.columns, tableData, headerFields)
} catch (error) {
console.error('解析前序表单数据失败:', error)
this.clearCxqkTable()
}
},
//
generateDynamicColumns(headerFields) {
// _1 key
const columnKeys = Object.keys(headerFields)
.filter(key => key.endsWith('_1'))
.filter((key) => key.endsWith('_1'))
.sort((a, b) => parseInt(a.split('_')[0]) - parseInt(b.split('_')[0]))
if (columnKeys.length === 0) {
@ -525,14 +540,16 @@ export default {
bodyFillType: 'actFill',
bodyDisabled: true,
disabled: true,
width: 100
width: 180,
showWidth: 90,
}
]
columnKeys.forEach((key, index) => {
const colIndex = index + 1
const baseColIndex = key.split('_')[0] // "1_1" -> "1"
// headerFields 1_1, 1_2, 1_3
const headerValues = []
let rowIndex = 1
@ -540,58 +557,59 @@ export default {
headerValues.push(headerFields[`${baseColIndex}_${rowIndex}`])
rowIndex++
}
//
const headerLabel = headerValues.join(' ')
// "123"
const headerLabel = headerValues.length > 1
? `${headerValues[0]}${headerValues.slice(1).join('')}`
: headerValues[0] || `菌种${colIndex}`
columns.push({
label: headerLabel,
prop: `jzbh${colIndex}`,
bodyType: 'checkbox',
bodyFillType: 'actFill',
checkboxLabel: '',
width: 150
})
})
return { columns, columnKeys }
},
//
generateTableData(stepTableFormData_1, columnKeys) {
const tableData = []
stepTableFormData_1.forEach((item) => {
const rowData = { jlzb: item.jlzb || '' }
columnKeys.forEach((_key, index) => {
const colIndex = index + 1
const valueKey = `jzbh${colIndex}`
// DL006 label
// DL006 使 czrxm_${index}Label
const labelValue = item[`czrxm_${index}Label`] || ''
rowData[`${valueKey}Label`] = labelValue
rowData[valueKey] = '' //
})
tableData.push(rowData)
})
return tableData
},
//
updateCxqkTable(columns, tableData, headerFields) {
//
this.dynamicCxqkColumns = columns
// headerFields formData
if (!this.formData.headerSelectFields) {
this.$set(this.formData, 'headerSelectFields', {})
}
Object.keys(headerFields).forEach(key => {
Object.keys(headerFields).forEach((key) => {
this.$set(this.formData.headerSelectFields, key, headerFields[key])
})
@ -600,19 +618,21 @@ export default {
if (tableRef) {
//
tableRef.updateDataSource(tableData)
// oldLocalDataSource
//
this.$nextTick(() => {
tableRef.oldLocalDataSource = JSON.parse(JSON.stringify(tableRef.localDataSource))
tableRef.oldLocalDataSource = JSON.parse(
JSON.stringify(tableRef.localDataSource)
)
})
}
this.$set(this.formData, 'stepTableFormData_1', tableData)
this.isDataLoaded = true
})
},
//
clearCxqkTable() {
this.dynamicCxqkColumns = []

+ 84
- 66
src/views/business/comps/template/comps/dl/DL009.vue View File

@ -57,6 +57,7 @@
<p>{{ $t('template.dl.dl009.jlsDesc') }}</p>
</div>
<CustomTable
v-if="dynamicJgxxColumns.length > 0"
:columns="jgxxColumns"
:ref="refConf.jgxx"
:showOperation="false"
@ -339,20 +340,24 @@ export default {
const headerSelectFields = this.formData.headerSelectFields || {}
//
if (!stepTableFormData_1 || stepTableFormData_1.length === 0 || this.isDataLoaded) {
if (
!stepTableFormData_1 ||
stepTableFormData_1.length === 0 ||
this.isDataLoaded
) {
return
}
// jzbh Label
const firstRow = stepTableFormData_1[0]
const jzbhKeys = Object.keys(firstRow)
.filter(key => key.match(/^jzbh\d+$/) && !key.endsWith('Label'))
.filter((key) => key.match(/^jzbh\d+$/) && !key.endsWith('Label'))
.sort((a, b) => {
const numA = parseInt(a.replace('jzbh', ''))
const numB = parseInt(b.replace('jzbh', ''))
return numA - numB
})
if (jzbhKeys.length === 0) {
return
}
@ -373,10 +378,11 @@ export default {
// headerSelectFields
jzbhKeys.forEach((_jzbhKey, index) => {
const colIndex = index + 1
// headerSelectFields T-A02
const jzbhLabel = headerSelectFields[`${colIndex}_1`] || `菌种${colIndex}`
const jzbhLabel =
headerSelectFields[`${colIndex}_1`] || `菌种${colIndex}`
//
dynamicColumns.push({
label: jzbhLabel,
@ -418,15 +424,19 @@ export default {
//
this.dynamicJgxxColumns = dynamicColumns
// headerSelectFields formData.headerSelectFields
if (!this.formData.headerSelectFields) {
this.$set(this.formData, 'headerSelectFields', {})
}
Object.keys(headerSelectFields).forEach((key) => {
this.$set(this.formData.headerSelectFields, key, headerSelectFields[key])
this.$set(
this.formData.headerSelectFields,
key,
headerSelectFields[key]
)
})
this.isDataLoaded = true
//
@ -434,11 +444,13 @@ export default {
const tableRef = this.$refs[refConf.jgxx]
if (tableRef) {
tableRef.updateDataSource(stepTableFormData_1)
// oldLocalDataSource
//
this.$nextTick(() => {
tableRef.oldLocalDataSource = JSON.parse(JSON.stringify(tableRef.localDataSource))
tableRef.oldLocalDataSource = JSON.parse(
JSON.stringify(tableRef.localDataSource)
)
})
}
})
@ -450,7 +462,7 @@ export default {
initializeYqsyTableFromFormData() {
try {
const stepTableFormData = this.formData.stepTableFormData
if (!stepTableFormData || stepTableFormData.length === 0) {
return
}
@ -459,10 +471,12 @@ export default {
const tableRef = this.$refs[refConf.yqsy]
if (tableRef) {
tableRef.updateDataSource(stepTableFormData)
// oldLocalDataSource
this.$nextTick(() => {
tableRef.oldLocalDataSource = JSON.parse(JSON.stringify(tableRef.localDataSource))
tableRef.oldLocalDataSource = JSON.parse(
JSON.stringify(tableRef.localDataSource)
)
})
}
})
@ -473,7 +487,7 @@ export default {
//
getFilledFormData() {
const baseData = this.getFilledFormDataByRefs(refNames)
// 使
const yqsyTableRef = this.$refs[refConf.yqsy]
if (yqsyTableRef) {
@ -481,7 +495,7 @@ export default {
// 使 stepTableFormData
baseData.stepTableFormData = yqsyData.stepTableFormData || []
}
//
const jgxxTableRef = this.$refs[refConf.jgxx]
if (jgxxTableRef) {
@ -489,44 +503,47 @@ export default {
// stepTableFormData_1
baseData.stepTableFormData_1 = jgxxData.stepTableFormData || []
}
// headerSelectFields
if (this.formData.headerSelectFields) {
baseData.headerSelectFields = this.formData.headerSelectFields
}
return baseData
},
//
async getFormData() {
//
const validResult = await this.validFields()
// headerSelectFields
if (validResult) {
return this.getFilledFormData()
}
return validResult
},
//
async validFields() {
// 1. 使
const yqsyTableRef = this.$refs[refConf.yqsy]
const yqsyTableData = yqsyTableRef?.getDataSource() || []
if (yqsyTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl009.yqsyxxEmpty'))
return Promise.reject(this.$t('template.dl.dl009.yqsyxxEmpty'))
}
// actFill
if (this.fillType === 'actFill') {
// 1. 使
const yqsyTableRef = this.$refs[refConf.yqsy]
const yqsyTableData = yqsyTableRef?.getDataSource() || []
if (yqsyTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl009.yqsyxxEmpty'))
return Promise.reject(this.$t('template.dl.dl009.yqsyxxEmpty'))
}
// 2.
const jgxxTableRef = this.$refs[refConf.jgxx]
const jgxxTableData = jgxxTableRef?.getDataSource() || []
if (jgxxTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl009.jgxxEmpty'))
return Promise.reject(this.$t('template.dl.dl009.jgxxEmpty'))
// 2.
const jgxxTableRef = this.$refs[refConf.jgxx]
const jgxxTableData = jgxxTableRef?.getDataSource() || []
if (jgxxTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl009.jgxxEmpty'))
return Promise.reject(this.$t('template.dl.dl009.jgxxEmpty'))
}
}
// 3.
@ -563,37 +580,22 @@ export default {
//
if (key === 'jgxxQxbd') {
// 使
const currentYqsyData = this.formData.stepTableFormData ? JSON.parse(JSON.stringify(this.formData.stepTableFormData)) : []
const currentHeaderFields = this.formData.headerSelectFields ? JSON.parse(JSON.stringify(this.formData.headerSelectFields)) : {}
// 使 $nextTick tick
this.$nextTick(() => {
this.handleJgxxQxbdSelect(row)
// 使 $nextTick handleJgxxQxbdSelect
this.$nextTick(() => {
if (currentYqsyData.length > 0 && (!this.formData.stepTableFormData || this.formData.stepTableFormData.length === 0)) {
this.$set(this.formData, 'stepTableFormData', currentYqsyData)
//
const yqsyTableRef = this.$refs[refConf.yqsy]
if (yqsyTableRef) {
yqsyTableRef.updateDataSource(currentYqsyData)
}
}
//
if (Object.keys(currentHeaderFields).length > 0 && (!this.formData.headerSelectFields || Object.keys(this.formData.headerSelectFields).length === 0)) {
this.$set(this.formData, 'headerSelectFields', currentHeaderFields)
}
})
})
// ref使formData
const yqsyTableRef = this.$refs[refConf.yqsy]
const savedYqsyData = JSON.parse(JSON.stringify(yqsyTableRef?.getDataSource() || []))
console.log('[DL009] 选择前序表单前,保存仪器数据:', savedYqsyData.length, '条')
// formDatawatch
if (savedYqsyData.length > 0) {
this.$set(this.formData, 'stepTableFormData', savedYqsyData)
}
this.handleJgxxQxbdSelect(row, savedYqsyData)
}
},
//
handleJgxxQxbdSelect(row) {
handleJgxxQxbdSelect(row, savedYqsyData) {
//
this.isDataLoaded = false
@ -632,7 +634,7 @@ export default {
}
// 3.
this.updateJgxxTable(dynamicColumns.columns, tableData, headerFields)
this.updateJgxxTable(dynamicColumns.columns, tableData, headerFields, savedYqsyData)
} catch (error) {
console.error('解析前序表单数据失败:', error)
this.clearJgxxTable()
@ -743,7 +745,7 @@ export default {
},
//
updateJgxxTable(columns, tableData, headerFields) {
updateJgxxTable(columns, tableData, headerFields, savedYqsyData) {
//
this.dynamicJgxxColumns = columns
@ -772,6 +774,22 @@ export default {
this.$set(this.formData, 'stepTableFormData_1', tableData)
this.isDataLoaded = true
// 使
const yqsyTableRef = this.$refs[refConf.yqsy]
const currentData = yqsyTableRef?.getDataSource() || []
console.log('[DL009] updateJgxxTable $nextTick - 当前仪器数据:', currentData.length, '条')
console.log('[DL009] updateJgxxTable $nextTick - 保存的仪器数据:', savedYqsyData?.length, '条')
if (savedYqsyData && savedYqsyData.length > 0 && currentData.length === 0) {
console.log('[DL009] 恢复仪器数据')
// formData
this.$set(this.formData, 'stepTableFormData', savedYqsyData)
this.$nextTick(() => {
yqsyTableRef?.updateDataSource(savedYqsyData)
console.log('[DL009] 恢复后仪器数据:', yqsyTableRef?.getDataSource()?.length, '条')
})
}
})
},
@ -789,9 +807,9 @@ export default {
if (this.dynamicJgxxColumns.length === 0) {
return
}
// select bodyOptions
this.dynamicJgxxColumns.forEach(col => {
this.dynamicJgxxColumns.forEach((col) => {
if (col.bodyType === 'select') {
if (col.prop.startsWith('czqk')) {
col.bodyOptions = this.getDictOptions('business_dl_amescdqk')

+ 23
- 13
src/views/business/comps/template/comps/dl/DL010.vue View File

@ -67,8 +67,8 @@
></TableOpertaionDelete>
</template>
</CustomTable>
<Step :ref="refConf.sjxxStep" :formData="formData.stepData" />
</div>
<Step :ref="refConf.sjxxStep" :formData="formData.stepData" />
<BaseInfoFormPackage
fieldItemLabel="template.dl.dl007.bz"
@ -173,6 +173,7 @@ export default {
type: 'select',
options: this.getDictOptions('business_dwzs'),
fillType: 'preFill',
otherMaxlength: 50,
otherCode: 'dwzsOther'
}
}
@ -210,6 +211,7 @@ export default {
type: 'select',
options: this.getDictOptions('business_cjbw'),
fillType: 'preFill',
otherMaxlength: 50,
otherCode: 'cjbwOther'
}
}
@ -240,7 +242,8 @@ export default {
prop: 'dwbh',
bodyType: 'input',
bodyMaxlength: 50,
bodyFillType: 'preFill'
bodyFillType: 'preFill',
width: 180
},
{
label: 'template.dl.dl010.yslhnzsjyjrl',
@ -251,7 +254,8 @@ export default {
bodyType: 'inputNumber',
bodyMaxlength: 10,
fillType: 'preFill',
bodyFillType: 'preFill'
bodyFillType: 'preFill',
width: 260
},
{
label: 'template.dl.dl010.sjlhnzsjyjrl',
@ -263,7 +267,8 @@ export default {
copyFrom: 'yslhnzsjyjrl',
bodyType: 'inputNumber',
bodyFillType: 'actFill',
fillType: 'preFill'
fillType: 'preFill',
width: 260
},
{
label: 'template.dl.dl010.sjgs',
@ -271,6 +276,7 @@ export default {
bodyType: 'checkbox',
checkboxLabel: '',
bodyFillType: 'actFill',
span: 3,
headerColumns: [
{ type: 'span', label: 'template.dl.dl010.sj' },
{
@ -280,14 +286,16 @@ export default {
key: 'gs'
},
{ type: 'span', label: 'template.dl.dl010.gusui' }
]
],
width: 260
},
{
label: 'template.dl.dl010.lx',
prop: 'lx',
bodyType: 'checkbox',
checkboxLabel: '',
bodyFillType: 'actFill'
bodyFillType: 'actFill',
width: 100
},
{
label: 'template.dl.dl010.ysjrxq',
@ -298,7 +306,8 @@ export default {
fillType: 'preFill',
headerSelectKey: 'ysjrxqUnit',
headerSelectTo: 'sjjrxqUnit',
headerOptions: this.getDictOptions('business_tjdw')
headerOptions: this.getDictOptions('business_tjdw'),
width: 180
},
{
label: 'template.dl.dl010.sjjrxq',
@ -310,7 +319,8 @@ export default {
compareTo: 'ysjrxq',
copyFrom: 'ysjrxq',
headerSelectKey: 'sjjrxqUnit',
headerOptions: this.getDictOptions('business_tjdw')
headerOptions: this.getDictOptions('business_tjdw'),
width: 180
}
]
}
@ -479,16 +489,16 @@ export default {
// 使
this.resourceTmp = sjxxStepResource.sjResource || []
this.yqResourceTmp = sjxxStepResource.yqResource || []
//
const sjxxTableData = this.$refs.sjxxTableRef?.getFilledFormData()
const sjxxList = sjxxTableData?.stepTableFormData || []
const headerSelectFields = sjxxTableData?.headerSelectFields || {}
// 0.9%
//
const sjxxResource = []
sjxxList.forEach((item) => {
// 0.9%
if (item.sjlhnzsjyjrl) {
@ -510,7 +520,7 @@ export default {
yxzqdw: null //
})
}
//
if (item.sjjrxq) {
sjxxResource.push({
@ -532,7 +542,7 @@ export default {
})
}
})
//
return [...this.resourceTmp, ...sjxxResource]
},

+ 47
- 20
src/views/business/comps/template/comps/dl/DL011.vue View File

@ -198,6 +198,8 @@ export default {
fillType: 'actFill',
subType: 'button',
subKey: 'pykssjButton',
subDisabled: this.fillType !== 'actFill',
disabled: true,
buttonName: 'template.dl.dl011.pykssjButton'
}
}
@ -214,7 +216,8 @@ export default {
type: 'select',
options: this.getDictOptions('business_dl_xbmc'),
fillType: 'preFill',
otherCode: 'xbmcOther'
otherCode: 'xbmcOther',
otherMaxlength: 50
},
xbdcbh: {
label: 'template.dl.dl011.xbdcbh',
@ -248,8 +251,7 @@ export default {
copyFrom: 'fshxbyjtj',
compareTo: 'fshxbyjtj',
subOptions: this.getDictOptions('business_nddw'),
maxlength: 10,
copyFrom: 'fshxbyjtj' //
maxlength: 10
}
}
}
@ -257,12 +259,35 @@ export default {
}
},
mounted() {
// pytjText
const pyxxData = this.getFilledFormDataByRefs([refConf.pyxx])
const { pytjText } = pyxxData || {}
// pytjText
if (!pytjText) {
this.$nextTick(() => {
this.$refs[refConf.pyxx]?.updateFormData(
'pytjText',
'培养条件:温度为温度为37℃±2℃,CO2浓度为5%±0.5%',
{ isUpdateRecord: false, signData: null }
)
})
}
//
if (this.fillType !== 'actFill') return
const data = this.getFilledFormDataByRefs([refConf.xbxx])
const { fshxbbhCodeSn } = data || {}
// fshxbbhCodeSn
if (fshxbbhCodeSn) return
this.$nextTick(() => {
this.$refs[refConf.pyxx]?.updateFormData(
'pytjText',
'培养条件:温度为温度为37℃±2℃,CO2浓度为5%±0.5%',
{ isUpdateRecord: false, signData: null }
)
const updateData = {}
const formattedDate = moment().format('YYMMDD')
updateData['fshxbbhCodeSn'] = formattedDate + '-' + '0001'
this.$refs[refConf.xbxx].batchUpdateFormData(updateData)
})
},
data() {
@ -301,28 +326,30 @@ export default {
// 使
this.resourceTmp = stepResource.sjResource || []
this.yqResourceTmp = [...(stepResource.yqResource || [])]
//
const xbxxData = this.$refs.xbxxRef?.getFilledFormData() || {}
//
if (xbxxData.xbdcbh) {
const xbInfo = xbxxData.selectInfo_xbdcbh || {}
// type StepFormPackage xb
this.xbxjTmp = [{
value: xbxxData.xbdcbh,
bh: xbInfo.bh || xbxxData.xbdcbh,
mc: xbInfo.mc || '',
xh: xbInfo.xh || '',
jzrq: xbInfo.jzrq || ''
}]
this.xbxjTmp = [
{
value: xbxxData.xbdcbh,
bh: xbInfo.bh || xbxxData.xbdcbh,
mc: xbInfo.mc || '',
xh: xbInfo.xh || '',
jzrq: xbInfo.jzrq || ''
}
]
} else {
this.xbxjTmp = []
}
//
const pyxxData = this.$refs.pyxxRef?.getFilledFormData() || {}
//
if (pyxxData.pyxbh) {
const pyxInfo = pyxxData.selectInfo_pyxbh || {}
@ -336,7 +363,7 @@ export default {
jzrq: pyxInfo.jzrq || ''
})
}
return this.resourceTmp
},
onRegentSubmit(e) {

+ 85
- 51
src/views/business/comps/template/comps/dl/DL012.vue View File

@ -194,13 +194,15 @@ export default {
fillType: 'actFill',
subType: 'button',
subKey: 'pykssjButton',
disabled: true,
subDisabled: this.fillType !== 'actFill',
buttonName: 'template.dl.dl012.pykssjButton'
}
}
}
]
},
//
// - formData zbhxbbh_
xbxxConfig() {
const config = {
xbmc: {
@ -221,8 +223,19 @@ export default {
fillType: 'preFill'
}
}
for (let index = 1; index <= this.zbxbs; index++) {
config['zbhxbbh_' + index] = {
// formData zbhxbbh_
const zbhxbbhKeys = Object.keys(this.formData)
.filter(key => /^zbhxbbh_\d+$/.test(key))
.sort((a, b) => {
return parseInt(a.split('_')[1]) - parseInt(b.split('_')[1])
})
// zbhxbbh_1preFill
if (zbhxbbhKeys.length === 0) {
zbhxbbhKeys.push('zbhxbbh_1')
}
zbhxbbhKeys.forEach(key => {
const index = key.split('_')[1]
config[key] = {
label: 'template.dl.dl012.zbhxbbh',
type: 'input',
subType: 'span',
@ -230,20 +243,12 @@ export default {
subKey: 'zbhxbbhCodeSn_' + index,
fillType: 'preFill'
}
}
})
return [
{
type: 'step',
config: {
...config,
// zbhxbbh: {
// label: 'template.dl.dl012.zbhxbbh',
// type: 'input',
// subType: 'span',
// maxlength: 20,
// subKey: 'zbhxbbhCodeSn',
// fillType: 'preFill'
// },
zbhxbyjtj: {
label: 'template.dl.dl012.zbhxbyjtj',
type: 'inputNumber',
@ -252,7 +257,7 @@ export default {
fillType: 'preFill',
subOptions: this.getDictOptions('business_nddw'),
maxlength: 10,
selectTo: 'zbhxbsjtjUnit' //
selectTo: 'zbhxbsjtjUnit'
},
zbhxbsjtj: {
label: 'template.dl.dl012.zbhxbsjtj',
@ -271,39 +276,66 @@ export default {
}
},
mounted() {
this.$nextTick(() => {
this.$refs[refConf.pyxx]?.updateFormData(
'pytjText',
'培养条件:温度为温度为37℃±2℃,CO2浓度为5%±0.5%',
{ isUpdateRecord: false, signData: null }
)
})
const data = this.getFilledFormDataByRefs([refConf.xbxx, refConf.base])
console.log(data)
const { zbxbs, zbhxbbh_1, startDate } = data || {}
if (!zbxbs) return
try {
this.zbxbs = Number(zbxbs)
} catch (error) {
this.zbxbs = 1
console.log(this.fillType, '===>fillType')
// pytjText
const pyxxData = this.getFilledFormDataByRefs([refConf.pyxx])
const { pytjText } = pyxxData || {}
// pytjText
if (!pytjText) {
this.$nextTick(() => {
this.$refs[refConf.pyxx]?.updateFormData(
'pytjText',
'培养条件:温度为温度为37℃±2℃,CO2浓度为5%±0.5%',
{ isUpdateRecord: false, signData: null }
)
})
}
this.$nextTick(() => {
// actFill zbxbs zbhxbbh_1/2/3... formData
if (this.fillType === 'actFill') {
const data = this.getFilledFormDataByRefs([refConf.xbxx])
const { zbxbs, zbhxbbh_1 } = data || {}
if (!zbxbs) return
let count = 1
try {
count = Number(zbxbs)
} catch (error) {
count = 1
}
// this.formData xbxxConfig computed
const updateData = {}
// Convert startDate from "2026-03-07 14:02:15" to "260307" (YYMMDD)
const formattedDate = startDate ? moment(startDate).format('YYMMDD') : ''
for (let index = 1; index <= this.zbxbs; index++) {
updateData['zbhxbbh_' + index] = zbhxbbh_1
updateData['zbhxbbhCodeSn_' + index] =
formattedDate + '-' + `${index}`.padStart(2, '0')
const formattedDate = moment().format('YYMMDD')
for (let index = 1; index <= count; index++) {
const zbhxbbhKey = 'zbhxbbh_' + index
const codeSnKey = 'zbhxbbhCodeSn_' + index
if (!data[zbhxbbhKey]) {
this.$set(this.formData, zbhxbbhKey, zbhxbbh_1)
updateData[zbhxbbhKey] = zbhxbbh_1
}
if (!data[codeSnKey]) {
const codeSnVal = formattedDate + '-' + `${index}`.padStart(4, '0')
this.$set(this.formData, codeSnKey, codeSnVal)
updateData[codeSnKey] = codeSnVal
}
}
// formFields
if (Object.keys(updateData).length > 0) {
this.$nextTick(() => {
this.$refs[refConf.xbxx].batchUpdateFormData(updateData)
})
}
this.$refs[refConf.xbxx].batchUpdateFormData(updateData)
})
}
},
data() {
return {
formData: {},
refConf,
zbxbs: 1
refConf
}
},
methods: {
@ -339,28 +371,30 @@ export default {
// 使
this.resourceTmp = stepResource.sjResource || []
this.yqResourceTmp = [...(stepResource.yqResource || [])]
//
const xbxxData = this.$refs.xbxxRef?.getFilledFormData() || {}
//
if (xbxxData.xbzbqbh) {
const xbInfo = xbxxData.selectInfo_xbzbqbh || {}
// type
this.xbxjTmp = [{
value: xbxxData.xbzbqbh,
bh: xbInfo.bh || xbxxData.xbzbqbh,
mc: xbInfo.mc || '',
xh: xbInfo.xh || '',
jzrq: xbInfo.jzrq || ''
}]
this.xbxjTmp = [
{
value: xbxxData.xbzbqbh,
bh: xbInfo.bh || xbxxData.xbzbqbh,
mc: xbInfo.mc || '',
xh: xbInfo.xh || '',
jzrq: xbInfo.jzrq || ''
}
]
} else {
this.xbxjTmp = []
}
//
const pyxxData = this.$refs.pyxxRef?.getFilledFormData() || {}
//
if (pyxxData.pyxbh) {
const pyxInfo = pyxxData.selectInfo_pyxbh || {}
@ -374,7 +408,7 @@ export default {
jzrq: pyxInfo.jzrq || ''
})
}
return this.resourceTmp
},
onRegentSubmit(e) {

+ 50
- 17
src/views/business/comps/template/comps/dl/DL013.vue View File

@ -254,7 +254,9 @@ export default {
type: 'select',
options: this.getDictOptions('business_dl_xbmc'),
fillType: 'actFill',
otherCode: 'xbmcOther'
otherCode: 'xbmcOther',
otherMaxlength: 50
},
xbbh: {
label: 'template.dl.dl013.xbbh',
@ -450,13 +452,28 @@ export default {
},
//
handleCdxxAdd() {
// 使
const yqsyTableRef = this.$refs[refConf.yqsy]
const beforeData = yqsyTableRef?.getDataSource() || []
// 使
const currentYqsyData = yqsyTableRef?.getFilledFormData() || {}
// formData使
if (currentYqsyData.stepTableFormData && currentYqsyData.stepTableFormData.length > 0) {
// 使$set
this.$set(this.formData, 'yqsyTablestepTableFormData', currentYqsyData.stepTableFormData)
this.$set(this.formData, 'yqsyTableheaderSelectFields', currentYqsyData.headerSelectFields || {})
this.$set(this.formData, 'yqsyTableheaderFields', currentYqsyData.headerFields || {})
}
//
if (!this.formData.cdxxConfigs) {
this.$set(this.formData, 'cdxxConfigs', [])
}
//
this.formData.cdxxConfigs.push({
//
const newCdxxItem = {
id: getuuid(),
xsbs: null,
xbmd: null,
@ -464,7 +481,10 @@ export default {
ysg: null,
zxg: null,
yxg: null
})
}
//
this.formData.cdxxConfigs.push(newCdxxItem)
//
this.$refs[refConf.cdxx]?.updateFormData(
@ -476,13 +496,24 @@ export default {
}
)
// 使
this.$nextTick(() => {
//
EventBus.$emit('onModifyRecord', {
type: 'fieldChanged',
newRecord: null,
resourceList: null
})
const afterData = yqsyTableRef?.getDataSource() || []
//
if (afterData.length === 0 && beforeData.length > 0) {
yqsyTableRef?.updateDataSource(beforeData)
}
//
setTimeout(() => {
EventBus.$emit('onModifyRecord', {
type: 'fieldChanged',
newRecord: null,
resourceList: null,
source: 'cdxxAdd'
})
}, 100)
})
},
//
@ -522,13 +553,15 @@ export default {
},
//
async getFormData() {
// 1. 使
const yqsyTableRef = this.$refs[refConf.yqsy]
const yqsyTableData = yqsyTableRef?.getDataSource() || []
if (yqsyTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl013.yqsyxxEmpty'))
return Promise.reject(this.$t('template.dl.dl013.yqsyxxEmpty'))
// 1. 使 actFill
if (this.fillType === 'actFill') {
const yqsyTableRef = this.$refs[refConf.yqsy]
const yqsyTableData = yqsyTableRef?.getDataSource() || []
if (yqsyTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl013.yqsyxxEmpty'))
return Promise.reject(this.$t('template.dl.dl013.yqsyxxEmpty'))
}
}
// 2.

+ 50
- 15
src/views/business/comps/template/comps/dl/DL014.vue View File

@ -298,14 +298,16 @@ export default {
type: 'select',
options: this.getDictOptions('business_dl_qsxjbltj'),
fillType: 'preFill',
otherCode: 'bltjOther'
otherCode: 'bltjOther',
otherMaxlength: 50
},
xbmc: {
label: 'template.dl.dl014.xbmc',
type: 'select',
options: this.getDictOptions('business_dl_xbmc'),
fillType: 'preFill',
otherCode: 'xbmcOther'
otherCode: 'xbmcOther',
otherMaxlength: 50
}
}
}
@ -317,7 +319,8 @@ export default {
pxpb: {
label: 'template.dl.dl014.pxpb',
type: 'inputNumber',
fillType: 'preFill'
fillType: 'preFill',
maxlength: 2
},
sftjs9: {
label: 'template.dl.dl014.sftjs9',
@ -343,7 +346,8 @@ export default {
const jlzzsConfig = {
label: 'template.dl.dl014.jlzzs',
type: 'inputNumber',
fillType: 'preFill'
fillType: 'preFill',
maxlength: 2
}
// preFill
@ -369,7 +373,8 @@ export default {
label: 'template.dl.dl014.jlzzmc',
prop: 'jlzzmc',
bodyType: 'input',
bodyFillType: 'preFill'
bodyFillType: 'preFill',
bodyMaxlength: 20
}
]
},
@ -399,11 +404,14 @@ export default {
label: 'template.dl.dl014.jlzb',
prop: 'jlzb',
bodyType: 'input',
bodyFillType: 'preFill'
width: 180,
bodyFillType: 'preFill',
bodyMaxlength: 10
},
{
label: 'template.dl.dl014.xybh',
prop: 'xybh',
width: 180,
bodyType: 'sj',
bodyFillType: 'actFill'
},
@ -411,6 +419,7 @@ export default {
label: 'template.dl.dl014.gysqgc',
prop: 'gysqgc',
bodyType: 'select',
width: 180,
bodyFillType: 'actFill',
bodyOptions: [
{ label: '良好', value: '良好' },
@ -426,6 +435,7 @@ export default {
bodyMaxlength: 10,
headerSelectKey: 'ysplyjrlUnit',
headerOptions: this.getDictOptions('business_tjdw'),
width: 180,
fillType: 'preFill'
},
{
@ -438,6 +448,7 @@ export default {
headerOptions: this.getDictOptions('business_tjdw'),
copyFrom: 'ysplyjrl',
compareTo: 'ysplyjrl',
width: 180,
fillType: 'preFill'
}
]
@ -453,6 +464,7 @@ export default {
bodyMaxlength: 10,
headerSelectKey: 'yss9hhyjrlUnit',
headerOptions: this.getDictOptions('business_tjdw'),
width: 180,
fillType: 'preFill'
},
{
@ -465,6 +477,7 @@ export default {
headerOptions: this.getDictOptions('business_tjdw'),
copyFrom: 'yss9hhyjrl',
compareTo: 'yss9hhyjrl',
width: 180,
fillType: 'preFill'
}
)
@ -478,8 +491,9 @@ export default {
bodyType: 'input',
bodyFillType: 'preFill',
bodyMaxlength: 20,
bodySubType: 'gsp',
bodySubKey: 'gspbh',
bodySubType: 'gyzj',
bodySubKey: 'gyzjbh',
width: 240,
bodySubFillType: 'actFill'
},
{
@ -490,6 +504,7 @@ export default {
bodyMaxlength: 10,
headerSelectKey: 'ysgspjrlUnit',
headerOptions: this.getDictOptions('business_tjdw'),
width: 180,
fillType: 'preFill'
},
{
@ -501,6 +516,7 @@ export default {
headerSelectKey: 'ysgspjrlUnit',
headerOptions: this.getDictOptions('business_tjdw'),
copyFrom: 'ysgspjrl',
width: 180,
compareTo: 'ysgspjrl',
fillType: 'preFill'
},
@ -509,6 +525,7 @@ export default {
prop: 'gyhzqk',
bodyType: 'select',
bodyFillType: 'actFill',
width: 180,
bodyOptions: [
{ label: '严重', value: '严重' },
{ label: '中等', value: '中等' },
@ -580,13 +597,15 @@ export default {
},
//
async getFormData() {
// 1. 使
const yqsyTableRef = this.$refs[refConf.yqsy]
const yqsyTableData = yqsyTableRef?.getDataSource() || []
if (yqsyTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl014.yqsyxxEmpty'))
return Promise.reject(this.$t('template.dl.dl014.yqsyxxEmpty'))
// 1. 使 actFill
if (this.fillType === 'actFill') {
const yqsyTableRef = this.$refs[refConf.yqsy]
const yqsyTableData = yqsyTableRef?.getDataSource() || []
if (yqsyTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl014.yqsyxxEmpty'))
return Promise.reject(this.$t('template.dl.dl014.yqsyxxEmpty'))
}
}
// 2.
@ -890,6 +909,11 @@ export default {
return
}
//
if (jlzmcList.length > 0) {
this.$set(this.formData, 'jlzmcTableData', jlzmcList)
}
//
const newRows = []
@ -918,6 +942,17 @@ export default {
// formDataCustomTable
this.$set(this.formData, 'jlzTableData', newRows)
//
this.$nextTick(() => {
const jlzmcTableRef = this.$refs[refConf.jlzmcTable]
const currentJlzmcData = jlzmcTableRef?.getDataSource() || []
//
if (currentJlzmcData.length === 0 && jlzmcList.length > 0) {
jlzmcTableRef?.updateDataSource(jlzmcList)
}
})
this.$message.success(`已生成 ${newRows.length} 行剂量组数据`)
},
//

+ 32
- 13
src/views/business/comps/template/comps/dl/DL015.vue View File

@ -16,8 +16,16 @@
:formData="formData"
/>
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resourceSj" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<TableList
label="template.common.reagentInfo"
:columns="sysjColumns"
:dataSource="resourceSj"
/>
<TableList
label="template.common.instrumentInfo"
:columns="yqColumns"
:dataSource="yqResource"
/>
<LineLabel label="template.dl.dl015.xbxx" />
<BaseInfoFormPackage
@ -185,7 +193,7 @@ export default {
qxbd: {
label: 'template.dl.dl015.qxbd',
type: 'qxbd',
qxbdType:'DL014',
qxbdType: 'DL014',
fillType: 'actFill',
filledCodes: ['bdmc', 'bdbh']
},
@ -194,7 +202,8 @@ export default {
type: 'select',
options: this.getDictOptions('business_dl_qsxjbltj'),
fillType: 'preFill',
otherCode: 'bltjOther'
otherCode: 'bltjOther',
otherMaxlength: 50
}
}
}
@ -209,6 +218,7 @@ export default {
bodyType: 'input',
bodyFillType: 'actFill',
bodyDisabled: true,
width: 180,
disabled: true
},
{
@ -217,12 +227,14 @@ export default {
bodyType: 'input',
bodyFillType: 'actFill',
bodyDisabled: true,
width: 180,
disabled: true
},
{
label: 'template.dl.dl015.hyqszqk',
prop: 'hyqszqk',
bodyType: 'select',
width: 180,
bodyFillType: 'actFill',
bodyOptions: [
{ label: '良好', value: '良好' },
@ -234,6 +246,7 @@ export default {
label: 'template.dl.dl015.hyqcdjqk',
prop: 'hyqcdjqk',
bodyType: 'select',
width: 180,
bodyFillType: 'actFill',
bodyOptions: [
{ label: '严重', value: '严重' },
@ -246,6 +259,7 @@ export default {
label: 'template.dl.dl015.hyqqtqk',
prop: 'hyqqtqk',
bodyType: 'select',
width: 180,
bodyFillType: 'actFill',
bodyOptions: [
{ label: '大量贴壁细胞变圆', value: '大量贴壁细胞变圆' },
@ -255,6 +269,7 @@ export default {
{
label: 'template.dl.dl015.qqpyy',
prop: 'qqpyy',
width: 100,
bodyType: 'checkbox',
bodyFillType: 'actFill',
checkboxLabel: ''
@ -262,12 +277,14 @@ export default {
{
label: 'template.dl.dl015.pbsxd',
prop: 'pbsxd',
width: 100,
bodyType: 'checkbox',
bodyFillType: 'actFill',
checkboxLabel: ''
},
{
label: 'template.dl.dl015.pyybrl',
width: 180,
prop: 'pyybrl',
bodyType: 'inputNumber',
bodyFillType: 'actFill',
@ -290,14 +307,14 @@ export default {
//
getFilledFormData() {
const baseData = this.getFilledFormDataByRefs(refNames)
// stepTableFormData
const hyqkData = this.$refs[refConf.hyqk]?.getFilledFormData()
if (hyqkData) {
baseData.stepTableFormData = hyqkData.stepTableFormData || []
baseData.headerSelectFields = hyqkData.headerSelectFields || {}
}
return baseData
},
//
@ -312,16 +329,16 @@ export default {
const stepResource = this.$refs.stepRef.getStepResource()
const hyqkData = this.$refs.hyqkTableRef?.getFilledFormData()
const hyqkList = hyqkData?.stepTableFormData || []
//
this.resourceTmp = stepResource.sjResource || []
this.yqResourceTmp = stepResource.yqResource || []
//
// Set
const xybhSet = new Set()
const sjResourceFromHyqk = []
hyqkList.forEach((item) => {
if (item.xybh && !xybhSet.has(item.xybh)) {
xybhSet.add(item.xybh)
@ -344,9 +361,9 @@ export default {
})
}
})
this.resourceTmp = [...this.resourceTmp, ...sjResourceFromHyqk]
return this.resourceTmp
},
onRegentSubmit(e) {
@ -370,7 +387,7 @@ export default {
}
//
const hyqkData = jlzTableData.map(item => ({
const hyqkData = jlzTableData.map((item) => ({
jlzb: item.jlzb || '', //
xybh: item.xybh || '', //
hyqszqk: '', //
@ -384,7 +401,9 @@ export default {
// 使 $set formData CustomTable
this.$set(this.formData, 'stepTableFormData', hyqkData)
this.$message.success(`已从前序表单加载 ${hyqkData.length} 条剂量组数据`)
this.$message.success(
`已从前序表单加载 ${hyqkData.length} 条剂量组数据`
)
} catch (error) {
console.error('解析前序表单数据失败:', error)
//

+ 107
- 129
src/views/business/comps/template/comps/dl/DL018.vue View File

@ -11,23 +11,20 @@
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<BaseInfoFormPackage fieldItemLabel="template.dl.dl018.xbxx" label="template.dl.dl018.xbxx"
ref="swypyjInfoRef" :formConfig="swypyjInfoFormConfig" :formData="formData"
@onRegentSubmit="onRegentSubmit" />
<BaseInfoFormPackage fieldItemLabel="template.dl.dl018.xbxx" label="template.dl.dl018.xbxx"
ref="swypyjInfoRef" :formConfig="swypyjInfoFormConfig" :formData="formData" @onRegentSubmit="onRegentSubmit"
/>
<LineLabel label="template.dl.dl018.xbczqk" />
<CustomTable @headerSelectChange="onHeaderSelectChange"
fieldItemLabel="template.common.operationSteps" @blur="onHandleTableBlur"
@beforeSaveRecord="beforeSaveRecord" :showAddRow="false" :showOperation="false"
@clickButton="clickButton"
ref="stepTableRef" :columns="stepColumns" :formData="tableFormData">
<!-- <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion @startConfig="startConfig" @configComplete="configComplete"
@printTag="printTag" @subPackageSubmit="subPackageSubmit" :fillType="fillType"
:row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow">
</TableOpertaion>
</template> -->
</CustomTable>
<LineLabel label="template.dl.dl018.xbczqk" />
<CustomTable
fieldItemLabel="template.common.operationSteps"
@clickButton="handleClickButton"
:showAddRow="false" :showOperation="false"
ref="stepTableRef" :prefixKey = "`tableSecond`" :columns="stepColumns" :formData="tableFormData">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow(rowIndex,'secondTable')" ></TableOpertaionDelete>
</template>
</CustomTable>
<LineLabel label="template.dl.dl018.czbz" />
<Step ref="stepRef" :formData="formData.stepData"></Step>
@ -52,13 +49,14 @@ import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es'
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
import moment from 'moment'
export default {
name: "DL018",
dicts: [
'business_dl_qsxjbltj', 'business_tjdw'
],
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaionDelete },
dicts: [
'business_dl_qsxjbltj','business_tjdw'
],
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete },
mixins: [templateMixin],
props: {
fillType: {
@ -67,13 +65,13 @@ export default {
},
},
computed: {
//
tableFormData() {
return {
stepTableFormData: [{}],
headerSelectFields: {}
}
},
//
tableFormData() {
return {
stepTableFormData: this.formData.stepTableFormData || [],
headerSelectFields: {}
}
},
//
remarkConig() {
return [
@ -138,7 +136,7 @@ export default {
}
]
},
//
//
swypyjInfoFormConfig() {
return [
{
@ -149,16 +147,16 @@ export default {
label: 'template.dl.dl018.qxbd',
type: 'qxbd',
fillType: 'actFill',
qxbdType: 'DL014',
filledCodes: ['bdmc', 'bdbh'],
qxbdType:'DL014',
filledCodes:['bdmc','bdbh'],
},
bltj: {
bltj: {
label: 'template.dl.dl018.bltj',
type: 'select',
fillType: 'preFill',
options: this.getDictOptions('business_dl_qsxjbltj'),
otherCode: 'bltjOther',
showOtherLabel: false
showOtherLabel:false
},
}
}
@ -173,7 +171,7 @@ export default {
width: 180,
bodyType: "input",
bodyFillType: "actFill",
disabled: true,
disabled: true,
bodyDisabled: true,
},
{
@ -182,38 +180,34 @@ export default {
width: 180,
bodyType: "input",
bodyFillType: "actFill",
disabled: true,
disabled: true,
bodyDisabled: true,
},
{
label: "template.dl.dl018.rsks",
prop: "rsks",
width: 180,
bodyType: "input",
bodyFillType: "actFill",
// disabled: true,
// showOtherLabel: false,
bodySubType: 'button',
bodySubFillType: 'actFill',
bodySubKey: 'rsks',
bodySubType: 'button',
bodySubButtonName: 'template.dl.dl018.ksButton',
showBodySub: this.fillType === "actFill",
bodySubKey: 'rsks1',
bodySubFillType: 'actFill',
bodyFillType: 'actFill',
bodyDisabled: true,
width: 280,
bodyMaxlength: 50,
},
{
label: "template.dl.dl018.rsjs",
prop: "rsjs",
width: 180,
bodyType: "input",
bodyFillType: "actFill",
// disabled: true,
// showOtherLabel: false,
bodySubType: 'button',
bodySubType: 'button',
bodySubButtonName: 'template.dl.dl018.jsButton',
bodySubKey: 'rsjs1',
bodySubFillType: 'actFill',
bodySubKey: 'rsjs',
bodySubButtonName: 'template.dl.dl018.jsButton',
showBodySub: this.fillType === "actFill",
bodyFillType: 'actFill',
bodyDisabled: true,
width: 280,
bodyMaxlength: 50,
},
{
label: "template.dl.dl018.zs",
@ -261,115 +255,98 @@ export default {
mounted() {
},
methods: {
clickButton(e,rowIndex) {
console.log(e,rowIndex)
//
handleClickButton(e, rowIndex) {
const arrStr = typeof e === 'string' ? e.slice(0, -1) : '';
const updateData = { [arrStr]: moment().format('YYYY/MM/DD HH:mm') };
this.$refs.stepTableRef?.updateDataSourceByRowIndex(rowIndex, updateData);
// console.log(this.getFilledFormData())
},
onRegentSubmit(e) {
const { selectInfo, key, rowIndex } = e
const { row } = selectInfo
if (key === 'qxbd') {
try {
//
const bdnr = JSON.parse(row.bdnr)
//
const stepTableFormData = bdnr.jlzTableData || []
onRegentSubmit(e) {
const { selectInfo, key, rowIndex } = e
const { row } = selectInfo
if (key === 'qxbd') {
try {
//
const bdnr = JSON.parse(row.bdnr)
//
const stepTableFormData = bdnr.jlzTableData || []
if (stepTableFormData.length === 0) {
//
this.$set(this.formData, 'stepTableFormData', [])
this.$message.warning('前序表单中没有剂量组数据')
return
}
if (stepTableFormData.length === 0) {
//
this.$set(this.formData, 'stepTableFormData', [])
this.$message.warning('前序表单中没有剂量组数据')
return
}
//
const itemData = stepTableFormData.map(item => ({
jlzb: item.jlzb || '', //
xybh: item.xybh || '', //
rsks: '', //
rsjs: '', //
zs: '', //
ys: '', //
zy: '', //
yx: '', //
tj: '', //
}))
// 使 $set formData CustomTable
this.$set(this.formData, 'stepTableFormData', itemData)
//
const itemData = stepTableFormData.map(item => ({
jlzb: item.jlzb || '', //
xybh: item.xybh || '', //
rsks: '', //
rsjs: '', //
zs: '', //
ys: '', //
zy: '', //
yx: '', //
tj: '', //
}))
// 使 $set formData CustomTable
this.$set(this.formData, 'stepTableFormData', itemData)
this.$message.success(`已从前序表单加载 ${itemData.length} 条剂量组数据`)
} catch (error) {
this.$set(this.formData, 'stepTableFormData', [])
console.error('解析前序表单数据失败:', error)
this.$message.error('解析前序表单数据失败')
}
}
},
//table header
onHeaderSelectChange(data) {
const { key, headerSelectFields, dataSource = [] } = data;
this.$message.success(`已从前序表单加载 ${itemData.length} 条剂量组数据`)
} catch (error) {
this.$set(this.formData, 'stepTableFormData', [])
console.error('解析前序表单数据失败:', error)
this.$message.error('解析前序表单数据失败')
}
}
},
//table header
onHeaderSelectChange(data){
const {key, headerSelectFields,dataSource=[]} = data;
const keys = [
'targetStartSolutionVolumeUnit',
'targetDiluentVolumeUnit',
'targetSolutionConcentrationUnit',
'targetSolutionVolumeUnit',
]
if (keys.includes(key)) {
const { targetStartSolution, subTargetStartSolution } = this.$refs.swypyjInfoRef?.getFilledFormData();
if(keys.includes(key)){
const {targetStartSolution,subTargetStartSolution} = this.$refs.swypyjInfoRef?.getFilledFormData();
const params = {
subTargetStartSolution,
headerSelectFields
}
this.batchUpdateTargetStartSolutionVolume(dataSource, targetStartSolution, params)
}
},
beforeSaveRecord(data) {
const formFields = this.$refs.swypyjInfoRef?.getFilledFormData();
this.onCommonVerifyNdException(formFields, data);
},
configComplete(val) {
const { rowData, headerSelectFields } = val;
//(+)
const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit])
let postData = {
mc: null,
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
nd: rowData.actSolutionConcentration,//
nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studyFormId: this.formData.id,
studyId: this.formData.studyId,
kc: total,
kcdw: unit,
this.batchUpdateTargetStartSolutionVolume(dataSource,targetStartSolution,params)
}
this.configCompleteRequest(postData);
},
//
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "swypyjInfoRef", "stepTableRef", "stepRef", "remarkRef"])
return this.getFilledFormDataByRefs(["baseInfoRef", "swypyjInfoRef", "stepTableRef", "stepRef","remarkRef"])
},
//
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "swypyjInfoRef", "stepTableRef", "stepRef", "remarkRef"]);
let content = await this.validFormFields(["baseInfoRef", "swypyjInfoRef", "stepTableRef", "stepRef","remarkRef"]);
return content;
},
getResource() {
//使
const stepResource = this.$refs.stepRef.getStepResource()
const tableList = this.$refs.qcxjjyqkTableRef?.getFilledFormData()?.stepTableFormData || []
const tableList = this.$refs.qcxjjyqkTableRef?.getFilledFormData()?.stepTableFormData || []
//
this.resourceTmp = stepResource.sjResource || []
this.yqResourceTmp = stepResource.yqResource || []
const tableFromHyqk = tableList
.filter(item => item.xybh)
.map(item => ({
bh: item.xybh,
type: 'cell'
}))
const tableFromHyqk = tableList
.filter(item => item.xybh)
.map(item => ({
bh: item.xybh,
type: 'cell'
}))
this.resourceTmp = [...this.resourceTmp, ...tableFromHyqk]
this.resourceTmp = [...this.resourceTmp, ...tableFromHyqk]
return this.resourceTmp;
},
//
@ -387,4 +364,5 @@ export default {
}
};
</script>
<style rel="stylesheet/scss" lang="scss"></style>
<style rel="stylesheet/scss" lang="scss">
</style>

+ 1
- 42
src/views/business/comps/template/comps/dl/DL022.vue View File

@ -271,48 +271,7 @@ export default {
const formFields = this.$refs.swypyjInfoRef?.getFilledFormData();
this.onCommonVerifyNdException(formFields, data);
},
configComplete(val) {
const { rowData, headerSelectFields } = val;
//(+)
const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit])
let postData = {
mc: null,
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
nd: rowData.actSolutionConcentration,//
nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studyFormId: this.formData.id,
studyId: this.formData.studyId,
kc: total,
kcdw: unit,
}
this.configCompleteRequest(postData);
},
//
subPackageSubmit(data) {
const { fzsj, rowData, headerSelectFields } = data;
const { fzList = [], dw = "", mybh } = fzsj;
if (fzList && fzList.length > 0) {
const list = fzList.map((item) => {
return {
bh: mybh + item.preCode + item.subCode,
kc: item.num,
kcdw: dw,
}
})
let postData = {
studyId: this.formData.studyId,
studyFormId: this.formData.id,
bh: mybh,
nd: rowData.actSolutionConcentration || 0,
nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studyFormId: this.formData.id,
list: list
}
this.subPackageRequest(postData);
}
},
//
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "swypyjInfoRef", "remarkRef", "tableRef"])

+ 9
- 1
src/views/business/comps/template/comps/dl/DL023.vue View File

@ -22,7 +22,7 @@
<LineLabel label="template.dl.dl023.czjl" />
<!-- 操作记录 -->
<BaseInfoFormPackage ref="swypyjInfoRef" fieldItemLabel="template.common.operationSteps"
@select="onSelect" :formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
@select="onSelect" @clickButton="handleClickButton" :formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
@ -43,6 +43,7 @@ import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es'
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
import moment from 'moment'
export default {
name: "dl023",
@ -210,6 +211,13 @@ export default {
mounted() {
},
methods: {
//
handleClickButton(item,signData) {
const arrStr = item.subKey;
const value = moment().format('YYYY/MM/DD HH:mm');
this.$refs.swypyjInfoRef.updateFormData(arrStr, value,{isUpdateRecord:true,signData});
// console.log(this.getFilledFormData())
},
onSelect(e) {
const { key, value } = e
if (key === "dwzshxbx") {//

+ 19
- 12
src/views/business/comps/template/comps/dl/DL024.vue View File

@ -15,12 +15,15 @@
<!-- 操作记录 -->
<div class="template-form-item">
<BaseInfoFormPackage ref="swypyjInfoRef" fieldItemLabel="template.common.operationSteps"
:formConfig="stepFormConfig" @blur="onHandleBlur" @onRegentSubmit="onRegentSubmit"
:formConfig="stepFormConfig"
@blur="onHandleBlur"
@clickButton="handleClickButton"
@onRegentSubmit="onRegentSubmit"
:formData="formData" />
<CustomTable
:ref="`tableRef`"
:columns="tableColumns"
:formData="formData"
:formData="tableFormData"
operationWidth = "80px"
:prefixKey = "`table`"
fieldItemLabel = "template.dl.dl024.gcqk"
@ -52,6 +55,7 @@ import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es'
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
import moment from 'moment'
export default {
name: "dl024",
@ -183,7 +187,7 @@ export default {
bodyType: 'input',
bodyFillType: 'actFill',
width: 100,
bodyMaxlength: 50,
bodyDisabled: true,
}
]
},
@ -196,6 +200,13 @@ export default {
mounted() {
},
methods: {
//
handleClickButton(item,signData) {
const arrStr = item.subKey;
const value = moment().format('YYYY/MM/DD HH:mm');
this.$refs.swypyjInfoRef.updateFormData(arrStr, value,{isUpdateRecord:true,signData});
// console.log(this.getFilledFormData())
},
//
onRegentSubmit(e) {
const { selectInfo, key, rowIndex } = e
@ -205,7 +216,7 @@ export default {
//
const bdnr = JSON.parse(row.bdnr)
//
const stepTableFormData = bdnr.jlzTableData || []
const stepTableFormData = bdnr.stepTableFormData || []
if (stepTableFormData.length === 0) {
//
@ -213,12 +224,13 @@ export default {
this.$message.warning('前序表单中没有细胞编号数据')
return
}
console.log('选择仪器编号预留=2==',stepTableFormData)
//
const itemData = stepTableFormData.map(item => ({
xbbh: item.jlzb || '', //
xbbh: item.jzlybh || '', //
}))
// 使 $set formData CustomTable
console.log('选择仪器编号预留=3==',itemData)
this.$set(this.formData, 'stepTableFormData', itemData)
this.$message.success(`已从前序表单加载 ${itemData.length} 条细胞编号数据`)
@ -249,19 +261,14 @@ export default {
return content;
},
getResource() {
//使
const stepResource = this.$refs.stepRef.getStepResource()
const tableList = this.$refs.qcxjjyqkTableRef?.getFilledFormData()?.stepTableFormData || []
//
this.resourceTmp = stepResource.sjResource || []
const tableFromHyqk = tableList
this.resourceTmp = tableList
.filter(item => item.xybh)
.map(item => ({
bh: item.xybh,
type: 'cell'
}))
this.resourceTmp = [...this.resourceTmp, ...tableFromHyqk]
return this.resourceTmp;
},
//

+ 416
- 0
src/views/business/comps/template/comps/gsp/GSP015.vue View File

@ -0,0 +1,416 @@
<!-- 供试品部给药制剂取样/前处理记录表 -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img
src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo"
:ref="refConfig.baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.gyzjInfo" :columns="gyzjColumns" :dataSource="resourceGyzj" />
<TableList label="template.common.sjInfo" :columns="sjColumns" :dataSource="resourceSj" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<LineLabel label="取样进样信息" />
<el-button class="mt-20" v-if="fillType === 'preFill'" type="primary"
@click="onAdd('ybsmDataList')">新增</el-button>
<el-button class="mt-20" v-if="fillType === 'actFill'" type="primary"
@click="onExport">导出</el-button>
<div v-for="(item, index) in formData.ybsmDataList" :key="item.id" class="template-form-item">
<div class="config-header">
<div></div>
<el-popconfirm title="确认删除当前数据?" @confirm="deleteConfig(item, 'ybsmDataList')">
<el-button slot="reference" v-if="fillType === 'preFill'" type="text"
icon="el-icon-delete">{{
$t('template.common.deleteBtn')
}}</el-button>
</el-popconfirm>
</div>
<BaseInfoFormPackage fieldItemLabel="取样进样信息" :ref="`ybsmFormPackageRef${index}`"
@clickButton="(e,d,key,formFields) => handleClickButton(e,d,key,formFields,index)"
:formConfig="ybsmFormConfig" :formData="item" />
<CustomTable :ref="`ybsmTableRef${index}`" :columns="ybsmColumns" prefix="qy"
:showOperation="fillType === 'actFill' || fillType === 'preFill'"
:showAddRow="fillType === 'preFill'" @onAddRow="() => addTableRow(index)"
fieldItemLabel="取样进样信息" :formData="item">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="() => deleteTableRow(rowIndex, index)">
</TableOpertaionDelete>
</template>
</CustomTable>
<CustomTable :ref="`jyTableRef${index}`" :columns="yjColumns" prefix="jy"
fieldItemLabel="取样进样信息" @blur="(e) => onHandleTableBlur(e, index, 'jyTableRef')"
:showOperation="fillType === 'actFill'" :showAddRow="false"
:formData="{ stepTableFormData: item.jyStepTableFormData || [], headerSelectFields: item.jyHeaderSelectFields || {} }">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="() => deleteTableRow(rowIndex, index)">
</TableOpertaionDelete>
</template>
</CustomTable>
</div>
<LineLabel label="二次稀释信息" />
<el-button class="mt-20" v-if="fillType === 'preFill'" type="primary"
@click="onAdd('ecDataList')">新增</el-button>
<el-button class="mt-20" v-if="fillType === 'actFill'" type="primary"
@click="onExport('ec')">导出</el-button>
<div v-for="(item, index) in formData.ecDataList" :key="item.id" class="template-form-item">
<div class="config-header">
<div></div>
<el-popconfirm title="确认删除当前数据?" @confirm="deleteConfig(item, 'ecDataList')">
<el-button slot="reference" v-if="fillType === 'preFill'" type="text"
icon="el-icon-delete">{{
$t('template.common.deleteBtn')
}}</el-button>
</el-popconfirm>
</div>
<BaseInfoFormPackage fieldItemLabel="二次稀释信息" :ref="`ecFormPackageRef${index}`"
:formConfig="ecFormConfig" :formData="item" />
<CustomTable :ref="`ecTableRef${index}`" :columns="yjColumns" prefix="ec"
fieldItemLabel="二次稀释信息" @blur="(e) => onHandleTableBlur(e, index, 'ecTableRef')"
:showOperation="fillType === 'preFill' || fillType === 'actFill'"
@onAddRow="() => addEcTableRow(index, 'ecTableRef')" :formData="item">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="() => deleteTableRow(rowIndex, index)">
</TableOpertaionDelete>
</template>
</CustomTable>
</div>
<Step :ref="`stepRef`" :formData="formData.stepData || []"></Step>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
:ref="refConfig.remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
</div>
<!-- <button @click="onSave">保存</button> -->
</div>
</template>
<script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import { uniqeResource } from "@/utils/calUnitTools";
import { getuuid, justUpdateFilledFormData } from "@/utils/index";
import { isCommonUnit } from "@/utils/conTools";
import { convertConcentration } from "@/utils/conConverter";//
import { volumeConverter } from "@/utils/volConverter";//
import moment from "moment";//
import { getBaseInfoFormConfig, getRemarkFormConfig, getYbsmFormConfig, getQyTableColumns, getJyTableColumns, getEcFormConfig } from "../../formConfig/gsp/gsp015";
const refConfig = {
baseInfoRef: "baseInfoRef",
remarkRef: "remarkRef",
stepRef: "stepRef",
}
const compRefs = Object.values(refConfig);
export default {
name: "SP0021",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaionDelete },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
sn: {
type: String,
default: '',
},
},
computed: {
//
remarkConig() {
return getRemarkFormConfig(this)
},
//
baseInfoFormConfig() {
return getBaseInfoFormConfig(this)
},
//
ybsmFormConfig() {
return getYbsmFormConfig(this)
},
//
ybsmColumns() {
return getQyTableColumns(this)
},
//
yjColumns() {
return getJyTableColumns(this)
},
//
ecFormConfig() {
return getEcFormConfig(this)
},
},
data() {
return {
refConfig,
currentIndex: -1,
};
},
mounted() {
},
methods: {
handleClickButton(item,signData,key,formFields,index){
const {} = item;
const ref = this.$refs[`ybsmFormPackageRef${index}`][0];
if(key === "startButton"){
ref.updateFormData("qysj",moment().format("YYYY/MM/DD HH:mm:ss"),{ isUpdateRecord: true, signData })
}else if(key === "endButton"){
const qysj = formFields.qysj;
if(!qysj){
this.$message.error("请先记录开始时间");
return;
}
const subQysj = qysj.substr(0,19)
const endTime = moment().format("YYYY/MM/DD HH:mm:ss");
ref.updateFormData("qysj",`${subQysj} ~ ${endTime}`,{ isUpdateRecord: true, signData })
}
},
onHandleTableBlur(e, index, refName) {
if (this.fillType === 'preFill') {
return
}
const { colKey, headerSelectFields, item } = e;
//[]
const keys = ["bdtj", "qytj", "jytj", "qynd"];
if (keys.includes(colKey)) {
const { bdtj, qytj, jytj, qynd, xsbsxsd, sjjyndsd, ztjxsd, xsbs } = item;
const { bdtjdw, qytjdw, jytjdw, qynddw, ztjdw, sjjynddw } = headerSelectFields || {};
//
if (!!bdtj && !!qytj) {
const transBdtj = volumeConverter.convert(bdtj + bdtjdw, ztjdw);//
const transQytj = volumeConverter.convert(qytj + qytjdw, ztjdw);//
//
const bs = parseFloat((transBdtj / transQytj).toFixed(xsbsxsd));
item.xsbs = bs;
}
if (!!bdtj && !!jytj) {
const transBdtj = volumeConverter.convert(bdtj + bdtjdw, ztjdw);//
const transJytj = volumeConverter.convert(jytj + jytjdw, ztjdw);//
// -
const ztj = parseFloat((transBdtj - transJytj).toFixed(ztjxsd));
item.ztj = ztj;
}
if (!!qynd && !!xsbs) {
const transQynd = convertConcentration.convert(qynd + qynddw, sjjynddw);//
//
const sjjynd = parseFloat((transQynd / xsbs).toFixed(sjjyndsd));
item.sjjynd = sjjynd;
}
}
},
addEcTableRow(index, refName = "ecTableRef") {
this.$refs[`${refName + index}`][0].addRow({
xsbsxsd: 3,
ztjxsd: 3,
sjjyndsd: 3,
id: getuuid(),
})
this.justUpdateFilledFormData();
},
//
addTableRow(index) {
this.$refs[`ybsmTableRef${index}`][0].addRow({
id: getuuid(),
})
this.addEcTableRow(index, "jyTableRef");
},
onExport() {
},
//
deleteConfig(item, type = "ybsmDataList") {
if (this.formData[type].length > 1) {
const configIndex = this.formData[type].findIndex(config => config.id === item.id);
if (configIndex > -1) {
const newList = [...this.formData[type]]
newList.splice(configIndex, 1);
this.$set(this.formData, type, newList);
this.$nextTick(() => {
//
justUpdateFilledFormData();
})
}
} else {
this.$message.warning('至少保留一条数据');
}
},
//
onAdd(type = "ybsmDataList") {
if (!this.formData[type]) {
this.$set(this.formData, type, []);
}
let defaultInfo = {
id: getuuid(),
}
this.formData = { ...this.formData, ...this.getFilledFormData() };
//
this.formData[type].push(defaultInfo);
this.justUpdateFilledFormData();
},
//
deleteTableRow(rowIndex, index) {
this.$refs[`ybsmTableRef${index}`][0].deleteRow(rowIndex)
this.$refs[`jyTableRef${index}`][0].deleteRow(rowIndex)
},
//
getFilledFormData() {
//
const baseData = this.getFilledFormDataByRefs(compRefs);
const { ybsmDataList = [], ecDataList = [] } = this.formData
const yData = ybsmDataList.map((item, index) => {
const ybsmFormData = this.$refs[`ybsmFormPackageRef${index}`][0]?.getFilledFormData() || {};
const ybsmTableData = this.$refs[`ybsmTableRef${index}`][0]?.getFilledFormData() || [];
const jyTableData = this.$refs[`jyTableRef${index}`][0]?.getFilledFormData() || [];
return {
...ybsmFormData,
...ybsmTableData,
jyStepTableFormData: jyTableData.stepTableFormData,
jyHeaderSelectFields: jyTableData.headerSelectFields,
};
});
const eData = ecDataList.map((item, index) => {
const ecFormData = this.$refs[`ecFormPackageRef${index}`][0]?.getFilledFormData() || {};
const ecTableData = this.$refs[`ecTableRef${index}`][0]?.getFilledFormData() || [];
return {
...ecFormData,
...ecTableData,
};
});
return {
...baseData,
ybsmDataList: yData,
ecDataList: eData
};
},
//
async getFormData() {
const refs = [];
const { ecDataList = [], ybsmDataList = [] } = this.getFilledFormData();
//
for (let index = 0; index < ybsmDataList.length; index++) {
//
refs.push(`ybsmFormPackageRef${index}`)
refs.push(`ybsmTableRef${index}`)
refs.push(`jyTableRef${index}`)
}
for (let index = 0; index < ecDataList.length; index++) {
//
refs.push(`ecFormPackageRef${index}`)
refs.push(`ecTableRef${index}`)
}
//
let content = await this.validFormFields([...compRefs, ...refs]);
if (!content) return false;
if (!ybsmDataList.length) {
this.$message.error('请添加取样进样信息');
return false;
} else if (!ecDataList.length) {
this.$message.error('请添加二次稀释信息');
return false;
}
const diff1 = ybsmDataList.every(item => isCommonUnit(item.jyHeaderSelectFields.qynddw, [item.jyHeaderSelectFields.sjjynddw]));
const diff2 = ecDataList.every(item => isCommonUnit(item.headerSelectFields.qynddw, [item.headerSelectFields.sjjynddw]));
console.log(diff1, diff2, "dff")
if (!diff1 || !diff2) {
this.$message.error("取样浓度单位与实际进样浓度单位不符,请重新选择!");
return false;
}
//
return this.getFilledFormData();
},
getResource() {
let content = this.getFilledFormData();
//resource
let tmpResource = []
if (this.fillType === "actFill") {
//
tmpResource.push({
mc: content.targetName,
bh: content.targetCode + content.targetCodeSn,
ph: '',
ndz: content.targetActConcentration + content.targetActConcentrationUnit,
nd: content.targetActConcentration,
nddw: content.targetActConcentrationUnit,
ly: 'ELN配制',
sxrq: content.expireDate,
kc: content.targetActVolume,
kcdw: content.targetActVolumeUnit,
syl: null,
type: null,
elnType: this.product,
syldw: content.targetActVolumeUnit,
yxzq: content.effectivePeriod,
yxzqdw: content.effectivePeriodUnit,
})
}
//使
let allSjResource = [];
let allYqResource = [];
//
const stepResource = this.$refs[`stepRef`]?.getStepResource() || { sjResource: [], yqResource: [] };
allSjResource = [...allSjResource, ...(stepResource.sjResource || [])];
allYqResource = [...allYqResource, ...(stepResource.yqResource || [])];
this.resourceTmp = uniqeResource(tmpResource, allSjResource)
this.yqResourceTmp = allYqResource
return this.resourceTmp;
},
//
async onSave() {
let content = await this.getFormData();
console.log(content);
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
.print-btn {
margin-bottom: 20px;
}
.config-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
font-weight: bold;
font-size: 16px;
color: #303133;
}
.config-header .el-button {
color: #f56c6c;
font-size: 14px;
}
.config-header .el-button:hover {
color: #f78989;
}
</style>

+ 33
- 5
src/views/business/comps/template/comps/sp/SP0019.vue View File

@ -23,6 +23,7 @@
</template>
</CustomTable>
<BaseInfoFormPackage class="mt-20" fieldItemLabel="色谱柱型号" label="色谱柱型号" ref="spzxhRef"
@remoteMethod="remoteMethod"
:formConfig="storageFormConfig" :formData="formData" />
<LineLabel label="溶液" />
<CustomTable
@ -55,8 +56,9 @@ import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
import { public_sjList } from '@/api/business/public/public';
import { getBaseInfoFormConfig, storageFormConfig, getYqColumns,getRyColumns,getYqphFormConfig } from "../../formConfig/sp/SP0019"
import { getBaseInfoFormConfig, getStorageFormConfig, getYqColumns,getRyColumns,getYqphFormConfig } from "../../formConfig/sp/SP0019"
export default {
name: "SP0019",
@ -83,7 +85,7 @@ export default {
},
//
storageFormConfig() {
return storageFormConfig;
return getStorageFormConfig(this);
},
//
remarkConig() {
@ -111,7 +113,8 @@ export default {
},
data() {
return {
formData: {}
formData: {},
spzxhOptions: [],
};
},
mounted() {
@ -119,6 +122,22 @@ export default {
},
methods: {
async remoteMethod({ query, key }) {
if (key === "spzxh") {
const res = await public_sjList({
pageNum: 1,
pageSize: 10,
mc: query
});
if(res.code === 200){
const {rows = []} = res;
this.spzxhOptions = rows.map(item => ({
label: item.bh,
value: item.bh,
}));
}
}
},
onRegentSubmit(e){
const {selectInfo, key, col, rowIndex, colIndex, rowData} = e;
const {row} = selectInfo;
@ -130,8 +149,17 @@ export default {
this.$refs.ryTableRef.updateDataSourceByRowIndex(rowIndex, params);
}
},
onYqSubmit(data, col, rowIndex, colIndex, row){
console.log(data, col, rowIndex, colIndex, row,"onRegentSubmit")
onYqSubmit(data){
const {selectInfo,rowIndex,key} = data;
const {row} = selectInfo;
if(key === "bh"){//
const params = {
mc: row.mc,
xh: row.xh,
jzrq: row.jzrq,
}
this.$refs.yqInfoTableRef.updateDataSourceByRowIndex(rowIndex, params);
}
},
//
getFilledFormData() {

+ 50
- 42
src/views/business/comps/template/comps/sp/SP0021.vue View File

@ -19,30 +19,26 @@
<div class="config-header">
<div></div>
<el-popconfirm title="确认删除当前样本?" @confirm="deleteConfig(item)">
<el-button slot="reference" v-if="fillType === 'actFill'" type="text" icon="el-icon-delete" >{{
$t('template.common.deleteBtn')
}}</el-button>
<el-button slot="reference" v-if="fillType === 'actFill'" type="text"
icon="el-icon-delete">{{
$t('template.common.deleteBtn')
}}</el-button>
</el-popconfirm>
</div>
<BaseInfoFormPackage fieldItemLabel="样本说明" :ref="`ybsmFormPackageRef${index}`"
:formConfig="ybsmFormConfig" @blur="onHandleBlur" :formData="item" />
<el-button v-if="fillType === 'actFill'" type="primary" @click="onImportAnimal">导入动物</el-button>
<CustomTable
:ref = "`ybsmTableRef${index}`"
:columns="ybsmColumns"
:showOperation="fillType === 'actFill'"
:showAddRow="fillType === 'actFill'"
:formData = "item">
<BaseInfoFormPackage fieldItemLabel="样本说明" :ref="`ybsmFormPackageRef${index}`"
:formConfig="ybsmFormConfig" @blur="onHandleBlur" :formData="item" />
<el-button v-if="fillType === 'actFill'" type="primary"
@click="onImportAnimal(item, index)">导入动物</el-button>
<CustomTable :ref="`ybsmTableRef${index}`" :columns="ybsmColumns"
:showOperation="fillType === 'actFill'" :showAddRow="fillType === 'actFill'"
:formData="item">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="() => deleteTableRow(rowIndex, `ybsmTableRef${index}`)"
></TableOpertaionDelete>
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="() => deleteTableRow(rowIndex, `ybsmTableRef${index}`)">
</TableOpertaionDelete>
</template>
</CustomTable>
<Step :ref="`stepRef${index}`" :formData="item.stepData ||[]"></Step>
<Step :ref="`stepRef${index}`" :formData="item.stepData || []"></Step>
</div>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
:ref="refConfig.remarkRef" :formConfig="remarkConig" :formData="formData" />
@ -50,7 +46,8 @@
</div>
</div>
<!-- <button @click="onSave">保存</button> -->
<ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" :downloadArr="['动物编号']" @downloadExcelTemplate="downloadExcelTemplate" />
<ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" :downloadArr="['动物编号']"
@downloadExcelTemplate="downloadExcelTemplate" />
</div>
</template>
@ -65,8 +62,8 @@ import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import { uniqeResource } from "@/utils/calUnitTools";
import {getuuid,justUpdateFilledFormData} from "@/utils/index";
import { getBaseInfoFormConfig, getStorageFormConfig, getRemarkFormConfig, getYbsmFormConfig,getTableColumns } from "../../formConfig/sp/SP0021";
import { getuuid, justUpdateFilledFormData } from "@/utils/index";
import { getBaseInfoFormConfig, getStorageFormConfig, getRemarkFormConfig, getYbsmFormConfig, getTableColumns } from "../../formConfig/sp/SP0021";
const refConfig = {
baseInfoRef: "baseInfoRef",
remarkRef: "remarkRef",
@ -78,7 +75,7 @@ const refConfig = {
const compRefs = Object.values(refConfig);
export default {
name: "SP0021",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete,ImportExcelDialog },
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaionDelete, ImportExcelDialog },
mixins: [templateMixin],
props: {
fillType: {
@ -113,23 +110,24 @@ export default {
},
},
data() {
return {
refConfig,
};
},
return {
refConfig,
currentIndex: -1,
};
},
mounted() {
if(this.fillType === 'preFill' &&!this.formData.ybsmDataList){//
if (this.fillType === 'preFill' && !this.formData.ybsmDataList) {//
this.onAdd()
}
},
methods: {
//
deleteConfig(item){
deleteConfig(item) {
// ybsmDataList
if (this.formData.ybsmDataList.length > 1) {
const configIndex = this.formData.ybsmDataList.findIndex(config => config.id === item.id);
console.log(configIndex,"configIndex")
if(configIndex>-1){
console.log(configIndex, "configIndex")
if (configIndex > -1) {
const newList = [...this.formData.ybsmDataList]
newList.splice(configIndex, 1);
this.$set(this.formData, 'ybsmDataList', newList);
@ -141,41 +139,50 @@ export default {
} else {
this.$message.warning('至少保留一个样本说明项');
}
},
//
onAdd(){
onAdd() {
if (!this.formData.ybsmDataList) {
this.$set(this.formData, 'ybsmDataList', []);
}
let defaultInfo = {
let defaultInfo = {
id: getuuid(),
stepData: [],
}
if(this.fillType === "actFill"){
const {ybsmDataList} = this.formData
if (this.fillType === "actFill") {
const { ybsmDataList } = this.formData
defaultInfo.stepData = ybsmDataList[0]?.stepData || []
}
this.formData = { ...this.formData, ...this.getFilledFormData() };
//
this.formData.ybsmDataList.push(defaultInfo);
},
onLoadExcelData(excelData) {
const data = excelData.splice(1);
const transData = data.map((item)=>{
return{
dwbh: item[0],
id: getuuid(),
}
})
this.$refs[`ybsmTableRef${this.currentIndex}`][0].pushDataSource(transData)
this.$refs.ImportExcelDialog.cancel()
setTimeout(() => {
justUpdateFilledFormData();
}, 100);
},
downloadExcelTemplate(arr){
downloadExcelTemplate(arr) {
this.exportExcel(arr)
},
//
onImportAnimal(){
onImportAnimal(item, index) {
this.currentIndex = index;
this.$refs.ImportExcelDialog.show()
},
//
deleteTableRow(rowIndex, refName) {
this.$refs[refName].deleteRow(rowIndex)
this.$refs[refName][0].deleteRow(rowIndex)
},
//
getFilledFormData() {
@ -202,18 +209,18 @@ export default {
//
let content = await this.validFormFields(compRefs);
if (!content) return null;
//
for (let index = 0; index < this.formData.ybsmDataList.length; index++) {
//
const ybsmFormValid = await this.$refs[`ybsmFormPackageRef${index}`][0]?.getFormData() || true;
if (!ybsmFormValid) return null;
//
const stepValid = await this.$refs[`stepRef${index}`][0]?.getFormData() || true;
if (!stepValid) return null;
}
//
return this.getFilledFormData();
},
@ -272,6 +279,7 @@ export default {
.print-btn {
margin-bottom: 20px;
}
.config-header {
display: flex;
justify-content: space-between;

+ 13
- 4
src/views/business/comps/template/comps/sp/SP00456.vue View File

@ -25,7 +25,7 @@
</CustomTable>
</div>
<LineLabel :label="getOperationStepsLabel()" />
<div v-if="fillType === 'preFill'" class="mt-20">
<div v-if="fillType === 'preFill' && !isPcr234" class="mt-20">
<el-button type="primary" @click="handleAddConfig('paralleConfigs')">{{
$t('template.common.xzpxpz')
}}</el-button>
@ -41,6 +41,7 @@
:tableColumns="ladderStepColumns" :prefixKey="'ladder_' + ladderIndex"
:configType="'ladder'" :ref="`ladderRef_${ladderIndex}`"
:fieldItemLabel="'template.common.jtpz'"
:showHeader="!isPcr234"
@deleteConfig="deleteConfig('ladderConfigs', ladderConfig)" :fillType="fillType" />
</div>
@ -52,9 +53,10 @@
:tableColumns="paralleStepColumns" :prefixKey="'paralle_' + paralleIndex"
:configType="'paralle'" :ref="`paralleRef_${paralleIndex}`"
:fieldItemLabel="'template.common.pxpz'"
:showHeader="!isPcr234"
@deleteConfig="deleteConfig('paralleConfigs', paralleConfig)" :fillType="fillType" />
</div>
<template v-if="sn === 'LBA005'">
<template v-if="sn === 'LBA005' || sn === 'ADA005'">
<LineLabel :label="$t('template.lba.lba005.zkpz')" />
<div v-if="fillType === 'preFill'" class="mt-20">
<el-button type="primary" @click="handleAddConfig('paralleConfigs_1')">{{
@ -192,7 +194,8 @@ export default {
},
},
data() {
const labArr = ["LBA005", "LBA007"];
const labArr = ["LBA005", "LBA007","ADA005","ADA007"];
const pcr234Arr = ["PCR002", "PCR003", "PCR004"];
const sn = this.sn || '';
return {
subSolutionVisible: false,
@ -206,6 +209,7 @@ export default {
currentRowData: {},//
isLba: labArr.includes(this.sn),
isSp: sn.includes('SP'),//
isPcr234: pcr234Arr.includes(this.sn),//PCR234
};
},
mounted() {
@ -215,12 +219,17 @@ export default {
this.handleUpdateCode(formData);
}, 0);
}
// PCR234
if(this.isPcr234 &&!this.formData.ladderConfigs){
this.handleAddConfig("ladderConfigs");
}
},
methods: {
//
getOperationStepsLabel() {
const obj = {
"LBA005": "template.lba.lba005.bzqxpz",//线
"ADA005": "template.lba.lba005.bzqxpz",//线
// "LBA007": "template.lba.lba005.bzqxpz",//
}
return obj[this.sn] || 'template.common.operationSteps';//
@ -291,10 +300,10 @@ export default {
//
if (!this.formData[configType]) {
// formdatabug
this.formData = { ...this.formData, ...this.getFilledFormData() };
this.$set(this.formData, configType, []);
// this.formData[configType] = [];
}
this.formData = { ...this.formData, ...this.getFilledFormData() };
//
this.formData[configType].push({
id: getuuid(),

+ 16
- 12
src/views/business/comps/template/comps/sp/comps/LadderConfig.vue View File

@ -1,6 +1,6 @@
<template>
<div class="template-form-item">
<div class="config-header">
<div class="config-header" v-if="showHeader">
<div>{{ $t(fieldItemLabel) }}</div>
<el-popconfirm title="确认删除当前配置?" @confirm="deleteConfig">
<el-button slot="reference" v-if="fillType === 'preFill'" type="text" icon="el-icon-delete" >{{
@ -53,6 +53,10 @@ export default {
name: "LadderConfig",
mixins: [templateMixin],
props: {
showHeader: {//
type: Boolean,
default: true,
},
fillType: {
type: String,
default: '',
@ -301,9 +305,9 @@ export default {
const { rowData } = val;
let postData = {
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
studySubjectId: this.formData.studySubjectId,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studySubjectId: this.currentFormData.studySubjectId,
studyId: this.currentFormData.studyId,
studyFormId: this.currentFormData.id,
}
this.startConfigRequest(postData);
},
@ -317,9 +321,9 @@ export default {
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
nd: rowData.actSolutionConcentration,//
nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studySubjectId: this.currentFormData.studySubjectId,
studyId: this.currentFormData.studyId,
studyFormId: this.currentFormData.id,
kc: total,
kcdw: unit,
}
@ -338,14 +342,14 @@ export default {
}
})
let postData = {
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studyId: this.currentFormData.studyId,
studyFormId: this.currentFormData.id,
bh: mybh,
nd: rowData.actSolutionConcentration || 0,
nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studySubjectId: this.currentFormData.studySubjectId,
studyId: this.currentFormData.studyId,
studyFormId: this.currentFormData.id,
list: list
}
this.subPackageRequest(postData);

+ 327
- 0
src/views/business/comps/template/formConfig/gsp/gsp015.js View File

@ -0,0 +1,327 @@
export const getBaseInfoFormConfig = ($this) => {
return [
{
type: 'cardItem',
config: {
studyMc: {
label: 'template.common.testName',
type: 'input',
disabled: true
},
studySn: {
label: 'template.common.testNumber',
type: 'input',
disabled: true
}
}
},
{
type: 'conditionItem',
label: 'template.common.testConfigurationConditions',
config: {
pre: {
label: 'template.common.preFill',
type: 'select',
multiple: true,
fillType: 'preFill',
options: $this.getDictOptions('business_pztj'),
otherCode: 'preOther'
},
act: {
label: 'template.common.actualFill',
type: 'select',
fillType: 'actFill',
otherCode: 'actOther',
multiple: true,
compareTo: 'pre',
options: $this.getDictOptions('business_pztj')
}
}
},
{
type: 'cellItem',
label: 'template.common.configurationTime',
config: {
startDate: {
label: 'template.common.startTime',
type: 'input'
},
endDate: {
label: 'template.common.endTime',
type: 'input'
}
}
}
]
}
//备注
export const getRemarkFormConfig = ($this) => {
return [
{
type: 'cellItem',
config: {
remark: {
label: '',
type: 'textarea',
fillType: 'actFill',
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
}
export const getYbsmFormConfig = ($this) => {
return [
{
type: 'step',
config: {
qysj: {
label: '取样时间',
type: 'input',
fillType: 'actFill',
maxlength: 50,
disabled: true,
subType:"button",
subKey: "startButton",
buttonName:"开始",
thirdType: 'button',
showSub:$this.fillType === 'actFill',
showThird:$this.fillType === 'actFill',
thirdKey: 'endButton',
thirdButtonName:"结束",
},
xsy: {
label: "template.sp.sp003.xsy",
type: "input",
fillType: "preFill",
subType: "sj",
subKey: "subSolution",
subFillType: "actFill",
maxlength: 20,
}
}
}
]
}
//取样table
export const getQyTableColumns = ($this) => {
return [
{
label: '取样编号',
prop: 'qybh',
width: 280,
bodyType: 'input',
bodyFillType: 'preFill',
},
{
label: '制剂编号',
prop: 'zjbh',
width: 280,
bodyType: 'gsp',
bodyFillType: 'actFill',
},
{
label: '预设制剂浓度',
prop: 'yszjnd',
width: 280,
headerSelectKey: 'yszjnddw',
fillType: "preFill",
headerOptions: $this.getDictOptions('business_nddw'),
bodyType: 'inputNumber',
bodyFillType: 'preFill',
headerSelectTo: 'sjzjnddw',
},
{
label: '实际制剂浓度',
prop: 'sjzjnd',
width: 280,
headerSelectKey: 'sjzjnddw',
fillType: "preFill",
headerOptions: $this.getDictOptions('business_nddw'),
bodyType: 'inputNumber',
bodyFillType: 'actFill',
copyFrom: 'yszjnd',
compareTo: 'yszjnd',
},
{
label: '制剂状态',
prop: 'zjzt',
width: 180,
bodyType: 'input',
bodyFillType: 'actFill',
},
{
label: '预设取样位置',
prop: 'ysqywz',
width: 180,
bodyType: 'select',
bodyOptions: $this.getDictOptions('business_qywz'),
bodyFillType: 'actFill',
},
{
label: '预设取样位置',
prop: 'sjqywz',
width: 180,
bodyType: 'select',
bodyOptions: $this.getDictOptions('business_qywz'),
bodyFillType: 'actFill',
compareTo: 'ysqywz',
},
{
label: '预设取样量',
prop: 'ysqyl',
width: 280,
headerSelectKey: 'ysqyldw',
fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber',
bodyMaxlength:10,
bodyFillType: 'preFill',
headerSelectTo: 'sjqydw',
},
{
label: '实际取样量',
prop: 'sjqyl',
width: 280,
headerSelectKey: 'sjqydw',
fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber',
bodyFillType: 'actFill',
copyFrom: 'ysqyl',
compareTo: 'ysqyl',
},
]
}
//进样table
export const getJyTableColumns = ($this) => {
return [
{
label: '进样编号',
prop: 'jybh',
width: 280,
bodyType: 'input',
bodyFillType: 'preFill',
},
{
label: '取样编号',
prop: 'qybh',
width: 280,
bodyType: 'gsp',
bodyFillType: 'actFill',
},
{
label: '取样浓度',
prop: 'qynd',
width: 280,
headerSelectKey: 'qynddw',
fillType: "preFill",
headerOptions: $this.getDictOptions('business_nddw'),
bodyType: 'inputNumber',
bodyFillType: 'actFill',
},
{
label: '取样体积',
prop: 'qytj',
width: 280,
headerSelectKey: 'qytjdw',
fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber',
bodyFillType: 'actFill',
},
{
label: '标定体积',
prop: 'bdtj',
width: 280,
headerSelectKey: 'bdtjdw',
fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber',
bodyFillType: 'preFill',
},
{
label: '进样体积',
prop: 'jytj',
width: 280,
headerSelectKey: 'jytjdw',
fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber',
bodyFillType: 'actFill',
},
{
label: '稀释倍数',
prop: 'xsbs',
width: 280,
bodyType: 'inputNumber',
bodyFillType: 'actFill',
bodySubType: "inputNumber",
bodySubKey: "xsbsxsd",
bodySubFillType: "preFill",
showBodySub: $this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "xsbsxsd",
},
{
label: '终体积',
prop: 'ztj',
width: 280,
headerSelectKey: 'ztjdw',
fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber',
bodyFillType: 'actFill',
bodySubType: "inputNumber",
bodySubKey: "ztjxsd",
bodySubFillType: "preFill",
showBodySub: $this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "ztjxsd",
},
{
label: '实际进样浓度',
prop: 'sjjynd',
width: 280,
headerSelectKey: 'sjjynddw',
fillType: "preFill",
headerOptions: $this.getDictOptions('business_nddw'),
bodyType: 'inputNumber',
bodyFillType: 'actFill',
bodySubType: "inputNumber",
bodySubKey: "sjjyndsd",
bodySubFillType: "preFill",
showBodySub: $this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "sjjyndsd",
},
]
}
export const getEcFormConfig = ($this) => {
return [
{
type: "step",
config: {
xsy: {
label: 'template.sp.sp00456.xsy',
labelWidth: 80,
type: 'input',
fillType: 'preFill',
subType: 'sj',
subKey: 'subXsy',
subFillType: 'actFill',
maxlength: 20
},
}
}
]
}

+ 24
- 11
src/views/business/comps/template/formConfig/paralleAndLadderConfig.js View File

@ -34,13 +34,32 @@ const explainConfig = {
}
}
}
//编号对应的数据字典code
const optionsCode = {
SP004: 'business_sp_nbgzy',
SP005: 'business_sp_zkgzy',
SP006: 'business_sp_bzqxzkypzbb',
PCR002: 'business_pcr_gzy',
PCR003: 'business_pcr_fxbzqxzbb',
PCR004: 'business_pcr_fxzkypzbb',
GSP007:"",
PCR013:"",
LBA005:"",
LBA007:"",
ADA005:"",
ADA007:"",
}
// 阶梯配置表格列配置
export const getLadderColumnsConfig = ($this) => {
const dic = optionsCode[$this.sn] || 'business_sp_nbgzy'
return [
{
label: 'template.sp.sp00456.mbrybh',
prop: 'targetSolutionCode',
bodyType: 'input',
bodyType: 'select',
bodyOptions: $this.getDictOptions(dic),
bodySubType: 'span',
bodySubKey: 'subTargetSolutionCode',
bodyFillType: 'preFill',
@ -205,13 +224,7 @@ export const getLadderColumnsConfig = ($this) => {
}
// 平行配置表格列配置
export const getParallelColumnsConfig = ($this) => {
const sn = $this.sn
let o = {
SP004: 'business_sp_nbgzy',
SP005: 'business_sp_zkgzy',
SP006: 'business_sp_bzqxzkypzbb'
}
const dic = o[sn] || 'business_sp_nbgzy'
const dic = optionsCode[$this.sn] || 'business_sp_nbgzy'
return [
{
label: 'template.sp.sp00456.mbrybh',
@ -510,7 +523,7 @@ export const getLadderFormConfig = ($this) => {
}
}
]
if (sn === 'LBA007') {
if (sn === 'LBA007' || sn === 'ADA007') {
defaultConfig.unshift(explainConfig)
}
return defaultConfig
@ -519,7 +532,7 @@ export const getLadderFormConfig = ($this) => {
//试验基本信息
export const getBaseInfoFormConfig = ($this) => {
const sn = $this.sn
const labArr = ['LBA005', 'LBA007']
const labArr = ['LBA005', 'LBA007','ADA005','ADA007']
const isLba = labArr.includes(sn)
const isSp = sn.includes('SP')//是否是色谱
return [
@ -679,7 +692,7 @@ export const getParalleStepFormConfig = ($this) => {
}
]
const sn = $this.sn
if (sn === 'LBA007') {
if (sn === 'LBA007' || sn === 'ADA007') {
defaultConfig.unshift(explainConfig)
}
return defaultConfig

+ 16
- 13
src/views/business/comps/template/formConfig/sp/SP0019.js View File

@ -43,19 +43,22 @@ export const getBaseInfoFormConfig = (formType) => {
]
}
export const storageFormConfig = [
{
type: 'step',
config: {
yqmxh: {
label: '色谱柱型号',
type: 'yq',
fillType: 'actFill',
filledCodes:['mc','bh'],
},
}
},
]
export const getStorageFormConfig = ($this)=>{
return[
{
type: 'step',
config: {
spzxh: {
label: '色谱柱型号',
type: 'select',
fillType: 'actFill',
options: $this.spzxhOptions,
filledCodes:['mc','bh'],
},
}
},
]
}
//仪器信息
export const getYqColumns = ($this) => {

+ 1
- 0
src/views/business/comps/template/mixins/templateMixin.js View File

@ -59,6 +59,7 @@ export default {
'business_cjdd', // 采集地点
'business_zpdd', // 制片地点
'business_cjbw', // 制片部位
'business_qywz', // 取样位置
],
props: {
templateData: {

Loading…
Cancel
Save