|
|
|
@ -36,11 +36,57 @@ |
|
|
|
</template> |
|
|
|
</CustomTable> |
|
|
|
|
|
|
|
<!-- 预留区域 - 细胞信息 --> |
|
|
|
<!-- 细胞信息 --> |
|
|
|
<LineLabel label="template.dl.dl013.xbxx" /> |
|
|
|
<div class="template-form-item"> |
|
|
|
<BaseInfoFormPackage |
|
|
|
fieldItemLabel="" |
|
|
|
label="" |
|
|
|
:ref="refConf.xbxx" |
|
|
|
:formConfig="xbxxConfig" |
|
|
|
:formData="formData" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 预留区域 - 测定信息 --> |
|
|
|
<!-- 测定信息 --> |
|
|
|
<LineLabel label="template.dl.dl013.cdxx" /> |
|
|
|
<div class="template-form-item"> |
|
|
|
<BaseInfoFormPackage |
|
|
|
fieldItemLabel="" |
|
|
|
label="" |
|
|
|
:ref="refConf.cdxx" |
|
|
|
:formConfig="cdxxConfig" |
|
|
|
:formData="formData" |
|
|
|
/> |
|
|
|
<div> |
|
|
|
<el-button type="primary" @click="handleCdxxAdd">新增</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- 测定信息第X次 --> |
|
|
|
<div |
|
|
|
class="template-form-item" |
|
|
|
v-for="(item, index) in cdxxTimeConfigs" |
|
|
|
:key="index" |
|
|
|
> |
|
|
|
<div class="flex-between"> |
|
|
|
<span>第{{ index + 1 }}次</span> |
|
|
|
<el-button type="danger" plain @click="handleCdxxDelete(index)" |
|
|
|
>删除</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
<BaseInfoFormPackage |
|
|
|
fieldItemLabel="" |
|
|
|
label="" |
|
|
|
:ref="`cdxx${index}Ref`" |
|
|
|
:formConfig="item" |
|
|
|
:formData="formData" |
|
|
|
@blur=" |
|
|
|
(e) => { |
|
|
|
onBlur(e, index) |
|
|
|
} |
|
|
|
" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
|
|
|
|
<BaseInfoFormPackage |
|
|
|
fieldItemLabel="template.dl.dl007.bz" |
|
|
|
@ -68,7 +114,9 @@ import moment from 'moment' |
|
|
|
const refConf = { |
|
|
|
base: 'baseInfoRef', |
|
|
|
yqsy: 'yqsyTableRef', |
|
|
|
remark: 'remarkRef' |
|
|
|
remark: 'remarkRef', |
|
|
|
xbxx: 'xbxxRef', |
|
|
|
cdxx: 'cdxxRef' |
|
|
|
} |
|
|
|
const refNames = Object.values(refConf) |
|
|
|
|
|
|
|
@ -145,16 +193,15 @@ export default { |
|
|
|
type: 'cellItem', |
|
|
|
label: 'template.dl.dl013.czsj', |
|
|
|
config: { |
|
|
|
kssj: { |
|
|
|
startDate: { |
|
|
|
label: 'template.dl.dl013.kssj', |
|
|
|
type: 'input', |
|
|
|
disabled: true |
|
|
|
}, |
|
|
|
jssj: { |
|
|
|
endDate: { |
|
|
|
label: 'template.dl.dl013.jssj', |
|
|
|
type: 'input', |
|
|
|
fillType: 'actFill', |
|
|
|
maxlength: 200 |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -194,30 +241,214 @@ export default { |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
xbxxConfig() { |
|
|
|
return [ |
|
|
|
{ |
|
|
|
type: 'step', |
|
|
|
config: { |
|
|
|
xbmc: { |
|
|
|
label: '细胞名称', |
|
|
|
type: 'select', |
|
|
|
options: this.getDictOptions('business_dl_xbmc'), |
|
|
|
fillType: 'actFill', |
|
|
|
otherCode: 'xbmcOther' |
|
|
|
}, |
|
|
|
xbbh: { |
|
|
|
label: '细胞编号', |
|
|
|
type: 'xb', |
|
|
|
fillType: 'actFill' |
|
|
|
}, |
|
|
|
xbxytj: { |
|
|
|
label: '细胞悬液体积', |
|
|
|
type: 'inputNumber', |
|
|
|
subType: 'select', |
|
|
|
subKey: 'xbxytjUnit', |
|
|
|
fillType: 'actFill', |
|
|
|
subOptions: this.getDictOptions('business_nddw'), |
|
|
|
maxlength: 10 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
cdxxConfig() { |
|
|
|
return [ |
|
|
|
{ |
|
|
|
type: 'step', |
|
|
|
config: { |
|
|
|
sjmcdptj: { |
|
|
|
label: '实际每次滴片体积(ul)', |
|
|
|
type: 'inputNumber', |
|
|
|
fillType: 'actFill' |
|
|
|
}, |
|
|
|
cdcs: { |
|
|
|
label: '测定次数', |
|
|
|
type: 'inputNumber', |
|
|
|
fillType: 'actFill', |
|
|
|
disabled: true |
|
|
|
}, |
|
|
|
pjxbmd: { |
|
|
|
label: '平均细胞密度', |
|
|
|
type: 'inputNumber', |
|
|
|
fillType: 'actFill', |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
cdxxTimeConfigs() { |
|
|
|
const array = [] |
|
|
|
for (let index = 1; index <= this.cdcs; index++) { |
|
|
|
array.push([ |
|
|
|
{ |
|
|
|
type: 'step', |
|
|
|
config: { |
|
|
|
[`xsbs_${index}`]: { |
|
|
|
label: '稀释倍数', |
|
|
|
type: 'inputNumber', |
|
|
|
maxlength: 4, |
|
|
|
fillType: 'actFill' |
|
|
|
}, |
|
|
|
[`xbmd_${index}`]: { |
|
|
|
label: '细胞密度(个/ml)', |
|
|
|
type: 'input', |
|
|
|
fillType: 'actFill', |
|
|
|
disabled: true |
|
|
|
}, |
|
|
|
[`zsg_${index}`]: { |
|
|
|
label: '左上格(个)', |
|
|
|
type: 'inputNumber', |
|
|
|
fillType: 'actFill', |
|
|
|
maxlength: 10 |
|
|
|
}, |
|
|
|
[`ysg_${index}`]: { |
|
|
|
label: '右上格(个)', |
|
|
|
type: 'inputNumber', |
|
|
|
fillType: 'actFill', |
|
|
|
maxlength: 10 |
|
|
|
}, |
|
|
|
[`zxg_${index}`]: { |
|
|
|
label: '左下格(个)', |
|
|
|
type: 'inputNumber', |
|
|
|
fillType: 'actFill', |
|
|
|
maxlength: 10 |
|
|
|
}, |
|
|
|
[`yxg_${index}`]: { |
|
|
|
label: '右下格(个)', |
|
|
|
type: 'inputNumber', |
|
|
|
fillType: 'actFill', |
|
|
|
maxlength: 10 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
]) |
|
|
|
} |
|
|
|
return array |
|
|
|
} |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
formData: {}, |
|
|
|
refConf |
|
|
|
refConf, |
|
|
|
cdcs: 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.cdcs = this.getCdcsNumber() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
onBlur(e, index) { |
|
|
|
console.log(e, 'e+++') |
|
|
|
let xbmd = undefined |
|
|
|
let xsbs = e[`xsbs_${index + 1}`] |
|
|
|
let zsg = e[`zsg_${index + 1}`] |
|
|
|
let ysg = e[`ysg_${index + 1}`] |
|
|
|
let zxg = e[`zxg_${index + 1}`] |
|
|
|
let yxg = e[`yxg_${index + 1}`] |
|
|
|
if (xsbs && zsg && ysg && zxg && yxg) { |
|
|
|
xsbs = this.getNumber(xsbs) |
|
|
|
zsg = this.getNumber(zsg) |
|
|
|
ysg = this.getNumber(ysg) |
|
|
|
zxg = this.getNumber(zxg) |
|
|
|
yxg = this.getNumber(yxg) |
|
|
|
xbmd = (((zsg + zxg + ysg + yxg) / 4) * xsbs * 10000).toFixed(1) |
|
|
|
} |
|
|
|
|
|
|
|
this.$refs[`cdxx${index}Ref`]?.[0]?.updateFormData( |
|
|
|
`xbmd_${index + 1}`, |
|
|
|
xbmd, |
|
|
|
{ |
|
|
|
isUpdateRecord: false, |
|
|
|
signData: null |
|
|
|
} |
|
|
|
) |
|
|
|
}, |
|
|
|
// 转化为数字 默认为0 |
|
|
|
getNumber(data) { |
|
|
|
try { |
|
|
|
return data ? Number(data) : 0 |
|
|
|
} catch (error) { |
|
|
|
return 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
// 获取测定次数 默认为0 |
|
|
|
getCdcsNumber() { |
|
|
|
const originData = this.getFilledFormDataByRefs([refConf.cdxx]) |
|
|
|
const { cdcs } = originData || {} |
|
|
|
return this.getNumber(cdcs) |
|
|
|
}, |
|
|
|
handleCdxxDelete(index) { |
|
|
|
this.$refs[refConf.cdxx].updateFormData( |
|
|
|
'cdcs', |
|
|
|
this.getCdcsNumber() - 1 < 0 ? 0 : this.getCdcsNumber() - 1, |
|
|
|
{ |
|
|
|
isUpdateRecord: false, |
|
|
|
signData: null |
|
|
|
} |
|
|
|
) |
|
|
|
this.cdcs = this.getCdcsNumber() |
|
|
|
}, |
|
|
|
// 新增测定信息次数 |
|
|
|
handleCdxxAdd() { |
|
|
|
this.$refs[refConf.cdxx].updateFormData( |
|
|
|
'cdcs', |
|
|
|
this.getCdcsNumber() + 1, |
|
|
|
{ |
|
|
|
isUpdateRecord: false, |
|
|
|
signData: null |
|
|
|
} |
|
|
|
) |
|
|
|
this.cdcs = this.getCdcsNumber() |
|
|
|
}, |
|
|
|
// 删除表格行 |
|
|
|
deleteTableRow(rowIndex, refName) { |
|
|
|
this.$refs[refName].deleteRow(rowIndex) |
|
|
|
}, |
|
|
|
// 获取已填写的表单数据 |
|
|
|
getFilledFormData() { |
|
|
|
return this.getFilledFormDataByRefs(refNames) |
|
|
|
const arr = [] |
|
|
|
for (let index = 0; index < this.cdcs; index++) { |
|
|
|
arr.push(`cdxx${index}Ref`) |
|
|
|
} |
|
|
|
return this.getFilledFormDataByRefs([...refNames, ...arr]) |
|
|
|
}, |
|
|
|
// 获取填写完成的表单数据 |
|
|
|
async getFormData() { |
|
|
|
return await this.validFormFields(refNames) |
|
|
|
const arr = [] |
|
|
|
for (let index = 0; index < this.cdcs; index++) { |
|
|
|
arr.push(`cdxx${index}Ref`) |
|
|
|
} |
|
|
|
return await this.validFormFields([...refNames, ...arr]) |
|
|
|
}, |
|
|
|
// 只做校验 |
|
|
|
async validFields() { |
|
|
|
return await this.validFormFields(refNames) |
|
|
|
const arr = [] |
|
|
|
for (let index = 0; index < this.cdcs; index++) { |
|
|
|
arr.push(`cdxx${index}Ref`) |
|
|
|
} |
|
|
|
return await this.validFormFields([...refNames, ...arr]) |
|
|
|
}, |
|
|
|
getResource() { |
|
|
|
const stepResource = this.$refs.yqsyTableRef.getStepResource() |
|
|
|
@ -264,4 +495,9 @@ export default { |
|
|
|
font-size: 16px; |
|
|
|
color: #303133; |
|
|
|
} |
|
|
|
.flex-between { |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
</style> |