|
|
|
@ -1,4 +1,4 @@ |
|
|
|
<!-- 生物分析生物样品采集管制备表 --> |
|
|
|
<!-- 畸变情况表 --> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div class="detail-container"> |
|
|
|
@ -10,7 +10,7 @@ |
|
|
|
ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" /> |
|
|
|
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" /> |
|
|
|
|
|
|
|
<LineLabel label="template.dl.dl022.gcqk" /> |
|
|
|
<LineLabel label="template.dl.dl022.jbqk" /> |
|
|
|
<!-- 观察情况 --> |
|
|
|
<div class="template-form-item"> |
|
|
|
<BaseInfoFormPackage ref="swypyjInfoRef" fieldItemLabel="template.common.operationSteps" |
|
|
|
@ -19,9 +19,9 @@ |
|
|
|
<div style="color:#999;font-size:14px;"> |
|
|
|
畸变类型以代号填写:断片(b)、裂隙(g)、互换及射体(t)、环状染色体(r)、多倍体(p)、双着丝点染色体(d)、内复制(e)、染色体碎化(z)、缺失(l)、粘着(s)、微小体(m)。 |
|
|
|
</div> |
|
|
|
<CustomTable :ref="`tableRef`" :columns="tableColumns" :formData="formData" |
|
|
|
operationWidth="120px" :prefixKey="`table`" fieldItemLabel="template.dl.dl022.gcqk" |
|
|
|
@onAddRow = "onAddRow" |
|
|
|
<CustomTable :ref="`tableRef`" :columns="tableColumns" :formData="tableFormData" |
|
|
|
operationWidth="120px" :prefixKey="`table`" fieldItemLabel="template.dl.dl022.jbqk" |
|
|
|
@onAddRow = "onAddRow" @blur="handleClickButton" |
|
|
|
:showAddRow="fillType === 'actFill'" :showOperation="fillType === 'actFill'"> |
|
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
|
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
|
@ -50,8 +50,6 @@ import Step from "@/components/Template/Step"; |
|
|
|
import templateMixin from "../../mixins/templateMixin"; |
|
|
|
import CustomTable from '@/components/Template/CustomTable.vue'; |
|
|
|
import { EventBus } from "@/utils/eventBus"; |
|
|
|
import { uniqeResource } from "@/utils/calUnitTools"; |
|
|
|
import { debounce } from 'lodash-es' |
|
|
|
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue" |
|
|
|
import { getuuid } from "@/utils/index.js"; |
|
|
|
export default { |
|
|
|
@ -68,6 +66,13 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
// 表格数据 |
|
|
|
tableFormData() { |
|
|
|
return { |
|
|
|
stepTableFormData: this.formData.stepTableFormData || [], |
|
|
|
headerSelectFields: {} |
|
|
|
} |
|
|
|
}, |
|
|
|
// 备注表单配置 |
|
|
|
remarkConig() { |
|
|
|
return [ |
|
|
|
@ -169,28 +174,32 @@ export default { |
|
|
|
bodyType: 'inputNumber', |
|
|
|
bodyFillType: 'actFill', |
|
|
|
width: 200, |
|
|
|
disabled: true |
|
|
|
disabled: true, |
|
|
|
bodyDisabled: true, |
|
|
|
}, { |
|
|
|
label: 'template.dl.dl022.lxjbs', |
|
|
|
prop: 'lxjbs', |
|
|
|
bodyType: 'inputNumber', |
|
|
|
bodyFillType: 'actFill', |
|
|
|
width: 200, |
|
|
|
disabled: true |
|
|
|
disabled: true, |
|
|
|
bodyDisabled: true, |
|
|
|
}, { |
|
|
|
label: 'template.dl.dl022.dbtjbs', |
|
|
|
prop: 'dbtjbs', |
|
|
|
bodyType: 'inputNumber', |
|
|
|
bodyFillType: 'actFill', |
|
|
|
width: 200, |
|
|
|
disabled: true |
|
|
|
disabled: true, |
|
|
|
bodyDisabled: true, |
|
|
|
}, { |
|
|
|
label: 'template.dl.dl022.nfzjbs', |
|
|
|
prop: 'nfzjbs', |
|
|
|
bodyType: 'inputNumber', |
|
|
|
bodyFillType: 'actFill', |
|
|
|
width: 200, |
|
|
|
disabled: true |
|
|
|
disabled: true, |
|
|
|
bodyDisabled: true, |
|
|
|
}, { |
|
|
|
label: 'template.dl.dl022.jblx', |
|
|
|
prop: 'jblx', |
|
|
|
@ -209,6 +218,14 @@ export default { |
|
|
|
currentRowIndex: -1, |
|
|
|
}; |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
formData: { |
|
|
|
immediate: true, |
|
|
|
handler(v) { |
|
|
|
console.log('formData==============',v); |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
EventBus.$on('onEditSignCallback', this.handleEditSignCallback); |
|
|
|
}, |
|
|
|
@ -216,6 +233,44 @@ export default { |
|
|
|
EventBus.$off('onEditSignCallback', this.handleEditSignCallback); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
//畸变类型 |
|
|
|
handleClickButton(e, rowIndex) { |
|
|
|
console.log('formData==============',e,rowIndex,this.formData); |
|
|
|
if(this.formData.stepTableFormData&&this.formData.stepTableFormData.length>0){ |
|
|
|
const list = this.formData.stepTableFormData; |
|
|
|
list.map((item, index) => { |
|
|
|
let jblxList = item.jblx; |
|
|
|
if(jblxList&&jblxList.length>0){ |
|
|
|
item.jgjxjbs = this.calculateJgjxjbs(jblxList); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
// 使用 $set 更新 formData,触发 CustomTable 的响应式更新 |
|
|
|
this.$set(this.formData, this.formData) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 计算结构畸形畸变数 |
|
|
|
calculateJgjxjbs(jblxList,countCodes) { |
|
|
|
if (!jblxList || jblxList.length === 0) return 0 |
|
|
|
// 需要计数的代号 |
|
|
|
// const countCodes = ['b', 't', 'r', 'd', 'z', 'l', 's', 'm'] |
|
|
|
|
|
|
|
let count = 0 |
|
|
|
|
|
|
|
for (const it of jblxList) { |
|
|
|
if (it.value) { |
|
|
|
const val = String(it.value).toLowerCase() |
|
|
|
// 同一输入框中,每个符合规则的代号都计1 |
|
|
|
for (const code of countCodes) { |
|
|
|
if (val.includes(code)) { |
|
|
|
count++ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return count |
|
|
|
}, |
|
|
|
handleEditSignCallback(data){ |
|
|
|
if (data.uuid === this.uuid) { |
|
|
|
this.handleEdit(); |
|
|
|
@ -235,10 +290,14 @@ export default { |
|
|
|
this.$message.error('畸变类型还未填写完,请填写完成后再操作') |
|
|
|
return |
|
|
|
} |
|
|
|
item.jgjxjbs = this.calculateJgjxjbs(jblx,['b', 't', 'r', 'd', 'z', 'l', 's', 'm']) |
|
|
|
item.lxjbs = this.calculateJgjxjbs(jblx,['g']) |
|
|
|
item.dbtjbs = this.calculateJgjxjbs(jblx,['p']) |
|
|
|
item.nfzjbs = this.calculateJgjxjbs(jblx,['e']) |
|
|
|
EventBus.$emit('showEditSignDialog', { uuid: this.uuid }); |
|
|
|
this.currentItem = item; |
|
|
|
this.currentRowIndex = rowIndex; |
|
|
|
|
|
|
|
this.$refs.tableRef.updateDataSourceByRowIndex(rowIndex, item) |
|
|
|
}, |
|
|
|
// 新增行 |
|
|
|
onAddRow() { |
|
|
|
@ -298,7 +357,6 @@ export default { |
|
|
|
//保存 |
|
|
|
async onSave() { |
|
|
|
// stepRef不存在,直接返回空对象 |
|
|
|
console.log({}); |
|
|
|
}, |
|
|
|
// 删除表格行 |
|
|
|
deleteRow(rowIndex) { |
|
|
|
@ -325,7 +383,7 @@ export default { |
|
|
|
EventBus.$emit('onModifyRecord', params); |
|
|
|
}, |
|
|
|
} |
|
|
|
}; |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style rel="stylesheet/scss" lang="scss"> |
|
|
|
.edit-button{ |
|
|
|
|