Browse Source

feat:[模板管理]PCR003/PCR004

lkf
HanLong 2 months ago
parent
commit
ab9a97d664
4 changed files with 1177 additions and 0 deletions
  1. +4
    -0
      src/views/business/comps/template/TemplateTable.vue
  2. +1
    -0
      src/views/business/comps/template/comps/pcr/PCR002.vue
  3. +586
    -0
      src/views/business/comps/template/comps/pcr/PCR003.vue
  4. +586
    -0
      src/views/business/comps/template/comps/pcr/PCR004.vue

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

@ -53,6 +53,8 @@ import DMYPPZJLB from "./comps/gsp/DMYPPZJLB.vue";
// PCR // PCR
//PCR001-使SP001 //PCR001-使SP001
import PCR002 from "./comps/pcr/PCR002.vue"; import PCR002 from "./comps/pcr/PCR002.vue";
import PCR003 from "./comps/pcr/PCR003.vue";
import PCR004 from "./comps/pcr/PCR004.vue";
//LBA //LBA
// LBA001-使SP001 // LBA001-使SP001
@ -140,6 +142,8 @@ export default {
//PCR //PCR
'PCR001': 'SP001', 'PCR001': 'SP001',
'PCR002': 'PCR002', 'PCR002': 'PCR002',
'PCR003': 'PCR003',
'PCR004': 'PCR004',
//LBA //LBA
'LBA001': 'SP001', 'LBA001': 'SP001',
'LBA002': 'LBA002', 'LBA002': 'LBA002',

+ 1
- 0
src/views/business/comps/template/comps/pcr/PCR002.vue View File

@ -19,6 +19,7 @@
@onSureModifyRecord="onSureModifyRecord" @onSureModifyRecord="onSureModifyRecord"
@resetRecord="resetRecord" @resetRecord="resetRecord"
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" /> :formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
<el-button type="primary">导入模板</el-button>
<CustomTable <CustomTable
@blur="onHandleTableBlur" @blur="onHandleTableBlur"
:ref="`stepTableRef`" :ref="`stepTableRef`"

+ 586
- 0
src/views/business/comps/template/comps/pcr/PCR003.vue View File

@ -0,0 +1,586 @@
<!-- PCR生物分析标准曲线制备表 -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc ||
$t('template.pcr.pcr002.title') }}<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="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<LineLabel label="template.common.operationSteps" />
<div class="template-form-item">
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef"
@clickable="handleFormClickable"
@onSureModifyRecord="onSureModifyRecord"
@resetRecord="resetRecord"
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
<CustomTable
@blur="onHandleTableBlur"
:ref="`stepTableRef`"
:columns="tableStepColumns"
:formData="formData"
:prefixKey = "`table`"
@clickable="handleClickable"
fieldItemLabel = "template.common.operationSteps"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
@subPackageSubmit="subPackageSubmit"
@startConfig="startConfig"
@configComplete="configComplete"
></TableOpertaion>
</template>
</CustomTable>
</div>
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
</div>
<SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef">
</SelectReagentDialog>
<!-- <button @click="onSave">保存</button> -->
</div>
</template>
<script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin.js";
import CustomTable from '@/components/Template/CustomTable.vue';
import { getLatestSnArr } from '@/api/template';
import { EventBus } from "@/utils/eventBus";
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import { getLadderColumnsConfig } from "../../formConfig/PCRTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools";
export default {
name: "PCR002",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
tableStepColumns() {
return getLadderColumnsConfig(this, 'business_pcr_fxbzqxzbb');
},
//
storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition: {
label: 'template.common.storageConditionLabel',
type: "select",
fillType: "preFill",
options: this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
}
}
];
},
//
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
//
baseInfoFormConfig() {
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",
},
}
}
]
},
//
stepFormConfig() {
return [
{
type: 'step',
config: {
startSolution: {
label: 'template.pcr.pcr002.qsyry',
type: 'input',
fillType: 'preFill',
subType: 'clickable',
subKey: 'subStartSolution',
subFillType: 'actFill',
maxlength: 20
},
targetStartSolution: {
label: 'template.pcr.pcr002.ysqsyrynd',
type: 'inputNumber',
subType: 'select',
fillType: 'preFill',
subOptions: this.getDictOptions('business_nddw'),
subKey: 'subTargetStartSolution',
maxlength: 10
},
targetAcSolution: {
label: 'template.pcr.pcr002.sjqsyrynd',
type: 'input',
fillType: 'actFill',
disabled: true,
maxlength: 10,
compareTo: 'targetStartSolution', //
},
solution: {
label: 'template.pcr.pcr002.xsy',
type: 'input',
fillType: 'preFill',
subType: 'clickable',
subKey: 'subSolution',
subFillType: 'actFill',
maxlength: 20
},
stepStorageCondition: {
label: 'template.pcr.pcr002.cctj',
type: 'select',
fillType: 'preFill',
options: this.getDictOptions('business_cctj'),
otherCode: 'stepStorageConditionOther'
},
effectivePeriod: {
label: 'template.pcr.pcr002.mbryyxzq',
type: 'input',
subType: 'select',
subKey: 'effectivePeriodUnit',
fillType: 'preFill',
subOptions: this.getDictOptions('business_yxqdw')
},
expireDate: {
label: 'template.pcr.pcr002.mbrysxr',
type: 'input'
}
}
}
]
},
},
data() {
return {
reagentType: null, // 1- 2-
formData: {},
currentSubKey: "",//key
currentType: "",//
currentRowIndex: "",//
};
},
mounted() {
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {
//
onSureModifyRecord(key) {
if (key === "subStartSolution") {//table
this.$refs.stepTableRef.updateRecords();
}
},
resetRecord() {
this.$refs.stepTableRef.resetRecord();
},
//
handleFormClickable(obj) {
if (this.fillType === "preFill") {
return;
}
console.log(obj)
const subKey = obj.subKey;
if (subKey === "subStartSolution" || subKey === "subSolution") {//
this.$refs.selectReagentDialogRef.show(this.formData.id)
this.currentSubKey = subKey;
this.reagentType = 1;
}
},
//
handleClickable(col, rowIndex) {
//
this.reagentType = 2
this.rowIndex = rowIndex
this.currentSubKey = col.prop;
console.log("clickable",rowIndex, col)
if(col.prop === "sjry"){
//-
this.$refs.selectReagentDialogRef.show(this.formData.id)
}
},
//
onSelectReagentSubmit(code,row){
if(this.reagentType===1){
this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code);
//
if(this.currentSubKey == 'subStartSolution') {
this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd + row.nddw);
this.updateStepTableData(row);
}
}else{
this.$refs.stepTableRef.updateDataSourceByRowIndex(this.rowIndex,{
[this.currentSubKey]: code,
})
}
this.$refs.selectReagentDialogRef.onCancel()
},
//table
updateStepTableData(row) {
const { stepTableFormData = [] } = this.$refs.stepTableRef.getFilledFormData();
//
const newStepTableData = JSON.parse(JSON.stringify(stepTableFormData));
//
for (let i = 0; i < newStepTableData.length; i++) {
const item = newStepTableData[i];
if (i === 0) {
// row.code
newStepTableData[i].startSolutionCode = row.bh;
} else {
// targetSolutionCode
// targetSolutionCode
newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode + newStepTableData[i - 1].subTargetSolutionCode;
}
console.log(item, row, 'updateStepTableData')
const volResult = this.updateSjmbrynd(item, row.nd);
console.log(volResult, 'volResult')
if (!volResult) {
continue
}
item.actSolutionVolume = volResult.actVol;
item.actSolutionConcentration = volResult.actNd;
item.actSolutionExpire = row.sxr;
}
this.$refs.stepTableRef.updateDataSource(newStepTableData);
// tableRef
},
//
async getCode(v) {
const { stepTableFormData = [] } = v;
if (stepTableFormData && stepTableFormData.length > 0 && !stepTableFormData[0].bhCode) {
let postSn = []
for (let i = 0; i < stepTableFormData.length; i++) {
postSn.push({
pre: stepTableFormData[i].targetSolutionCode,
type: 1
})
}
const result = await getLatestSnArr(postSn)
if (result.code == 200) {
for (let i = 0; i < stepTableFormData.length; i++) {
this.$refs.stepTableRef.updateDataSourceByRowIndex(i, {
subTargetSolutionCode: result.data[i],
})
}
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
setTimeout(() => {
EventBus.$emit('onModifyRecord', params,)
}, 10);
}
}
},
//
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef","stepTableRef", "stepRef", "remarkRef"])
},
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef","stepRef", "remarkRef"]);
return content;
},
getResource() {
let content = this.getFilledFormData();
console.log(content)
//resource
let tmpResource = []
if(this.fillType === "actFill"){
let tableList = content.stepTableFormData
if(tableList && tableList.length>0){
for(let i=0;i<tableList.length;i++){
//
let item = tableList[i]
console.log('表格item:'+JSON.stringify(item))
//使
//
tmpResource.push({
mc: null,
bh: item.startSolutionCode,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.actStartSolutionVolume,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.actStartSolutionVolumeUnit,
yxzq:null,
yxzqdw:null,
})
//
tmpResource.push({
mc: null,
bh: content.subSolution,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.actDiluentVolume,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.actDiluentVolumeUnit,
yxzq:null,
yxzqdw:null,
})
//
let fzTotal = 0//
if(item.fzsj && item.fzsj.fzList && item.fzsj.fzList.length>0){
for(let j=0;j<item.fzsj.fzList.length;j++){
let fzItem = item.fzsj.fzList[j]
tmpResource.push({
mc: null,
bh: item.fzsj.mybh+fzItem.preCode+ fzItem.subCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: fzItem.num,
kcdw: item.fzsj.dw,
syl: null,
type: null,
elnType: this.product,
syldw:item.fzsj.dw,
yxzq:null,
yxzqdw:null,
})
fzTotal=addDecimals(fzTotal,fzItem.num)
}
}
//
// const { total, unit } = addTj([item.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit])
const { total, unit } = addTj([item.actStartSolutionVolume, item.actDiluentVolume], [content.headerSelectFields.actStartSolutionVolumeUnit, content.headerSelectFields.actDiluentVolumeUnit])
tmpResource.push({
mc: null,
bh: item.targetSolutionCode+item.subTargetSolutionCode,
ph: null,
ndz: item.actSolutionConcentration + content.headerSelectFields.actSolutionConcentrationUnit,
nd: item.actSolutionConcentration,
nddw: content.headerSelectFields.actSolutionConcentrationUnit,
ly: 'ELN配制',
sxrq: null,
kc: total,
kcdw: unit,
type: null,
elnType: this.product,
syl: fzTotal>0?fzTotal:null,
syldw:fzTotal>0?item.fzsj.dw:unit,
yxzq:content.effectivePeriod,
yxzqdw:content.effectivePeriodUnit,
})
}
}
}
if(tmpResource.length>0){
tmpResource = uniqeResourceOne(tmpResource)
}
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
return this.resourceTmp;
},
//
async onSave() {
let content = this.$refs.stepRef.getStepResource();
console.log(content);
},
//
deleteRow(rowIndex) {
const stepTableRef = this.$refs['stepTableRef'];
if (stepTableRef) {
stepTableRef.deleteRow(rowIndex);
}
},
configComplete(val) {
if (val.rowData.sjjzxql === '' || val.rowData.sjjzxql === undefined || val.rowData.sjryxql === '' || val.rowData.sjryxql === undefined) {
this.$message.error("表格内容未填完")
return
}
console.log("完成配置数据:" + JSON.stringify(val))
const { total, unit } = addTj([val.rowData.sjjzxql, val.rowData.sjryxql], [val.headerSelectFields.sjjzxqlUnit, val.headerSelectFields.sjryxqlUnit])
let postData = {
mc: null,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh: val.rowData.bh + val.rowData.bhCode,
nd: val.rowData.hhwznd,
nddw: val.headerSelectFields.hhwzndUnit,
kc: total,
kcdw: unit,
}
console.log("完成配置提交数据:" + JSON.stringify(postData))
sj_configurationCompleted(postData).then(() => {
}).catch(() => {
})
.finally(() => {
})
},
startConfig(val) {
console.log("开始配置数据:" + JSON.stringify(val))
let postData = {
bh: val.rowData.bh + val.rowData.bhCode,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studySubjectId: this.formData.studySubjectId,
}
console.log("开始配置提交数据:" + JSON.stringify(postData))
sj_startConfiguration(postData).then(() => {
}).catch(() => {
})
.finally(() => {
})
},
subPackageSubmit(val) {
console.log("分装数据:" + JSON.stringify(val))
if (val.fzsj.fzList && val.fzsj.fzList.length > 0) {
let list = []
for (let i = 0; i < val.fzsj.fzList.length; i++) {
let item = val.fzsj.fzList[i]
list.push({
bh: val.fzsj.mybh + item.preCode,
kc: item.num,
kcdw: val.fzsj.dw,
})
}
let postData = {
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh: val.fzsj.mybh,
nd: val.rowData.hhwznd,
nddw: val.headerSelectFields.hhwzndUnit,
list: list
}
console.log("分装提交数据:" + JSON.stringify(postData))
sj_subpackage(postData).then(() => {
}).catch(() => {
})
.finally(() => {
})
}
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
.print-btn {
margin-bottom: 20px;
}
</style>

+ 586
- 0
src/views/business/comps/template/comps/pcr/PCR004.vue View File

@ -0,0 +1,586 @@
<!-- PCR生物分析标准曲线制备表 -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc ||
$t('template.pcr.pcr002.title') }}<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="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<LineLabel label="template.common.operationSteps" />
<div class="template-form-item">
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef"
@clickable="handleFormClickable"
@onSureModifyRecord="onSureModifyRecord"
@resetRecord="resetRecord"
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
<CustomTable
@blur="onHandleTableBlur"
:ref="`stepTableRef`"
:columns="tableStepColumns"
:formData="formData"
:prefixKey = "`table`"
@clickable="handleClickable"
fieldItemLabel = "template.common.operationSteps"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
@subPackageSubmit="subPackageSubmit"
@startConfig="startConfig"
@configComplete="configComplete"
></TableOpertaion>
</template>
</CustomTable>
</div>
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
</div>
<SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef">
</SelectReagentDialog>
<!-- <button @click="onSave">保存</button> -->
</div>
</template>
<script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin.js";
import CustomTable from '@/components/Template/CustomTable.vue';
import { getLatestSnArr } from '@/api/template';
import { EventBus } from "@/utils/eventBus";
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import { getLadderColumnsConfig } from "../../formConfig/PCRTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools";
export default {
name: "PCR002",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
tableStepColumns() {
return getLadderColumnsConfig(this, 'business_pcr_fxzkypzbb');
},
//
storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition: {
label: 'template.common.storageConditionLabel',
type: "select",
fillType: "preFill",
options: this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
}
}
];
},
//
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
//
baseInfoFormConfig() {
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",
},
}
}
]
},
//
stepFormConfig() {
return [
{
type: 'step',
config: {
startSolution: {
label: 'template.pcr.pcr002.qsyry',
type: 'input',
fillType: 'preFill',
subType: 'clickable',
subKey: 'subStartSolution',
subFillType: 'actFill',
maxlength: 20
},
targetStartSolution: {
label: 'template.pcr.pcr002.ysqsyrynd',
type: 'inputNumber',
subType: 'select',
fillType: 'preFill',
subOptions: this.getDictOptions('business_nddw'),
subKey: 'subTargetStartSolution',
maxlength: 10
},
targetAcSolution: {
label: 'template.pcr.pcr002.sjqsyrynd',
type: 'input',
fillType: 'actFill',
disabled: true,
maxlength: 10,
compareTo: 'targetStartSolution', //
},
solution: {
label: 'template.pcr.pcr002.xsy',
type: 'input',
fillType: 'preFill',
subType: 'clickable',
subKey: 'subSolution',
subFillType: 'actFill',
maxlength: 20
},
stepStorageCondition: {
label: 'template.pcr.pcr002.cctj',
type: 'select',
fillType: 'preFill',
options: this.getDictOptions('business_cctj'),
otherCode: 'stepStorageConditionOther'
},
effectivePeriod: {
label: 'template.pcr.pcr002.mbryyxzq',
type: 'input',
subType: 'select',
subKey: 'effectivePeriodUnit',
fillType: 'preFill',
subOptions: this.getDictOptions('business_yxqdw')
},
expireDate: {
label: 'template.pcr.pcr002.mbrysxr',
type: 'input'
}
}
}
]
},
},
data() {
return {
reagentType: null, // 1- 2-
formData: {},
currentSubKey: "",//key
currentType: "",//
currentRowIndex: "",//
};
},
mounted() {
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {
//
onSureModifyRecord(key) {
if (key === "subStartSolution") {//table
this.$refs.stepTableRef.updateRecords();
}
},
resetRecord() {
this.$refs.stepTableRef.resetRecord();
},
//
handleFormClickable(obj) {
if (this.fillType === "preFill") {
return;
}
console.log(obj)
const subKey = obj.subKey;
if (subKey === "subStartSolution" || subKey === "subSolution") {//
this.$refs.selectReagentDialogRef.show(this.formData.id)
this.currentSubKey = subKey;
this.reagentType = 1;
}
},
//
handleClickable(col, rowIndex) {
//
this.reagentType = 2
this.rowIndex = rowIndex
this.currentSubKey = col.prop;
console.log("clickable",rowIndex, col)
if(col.prop === "sjry"){
//-
this.$refs.selectReagentDialogRef.show(this.formData.id)
}
},
//
onSelectReagentSubmit(code,row){
if(this.reagentType===1){
this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code);
//
if(this.currentSubKey == 'subStartSolution') {
this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd + row.nddw);
this.updateStepTableData(row);
}
}else{
this.$refs.stepTableRef.updateDataSourceByRowIndex(this.rowIndex,{
[this.currentSubKey]: code,
})
}
this.$refs.selectReagentDialogRef.onCancel()
},
//table
updateStepTableData(row) {
const { stepTableFormData = [] } = this.$refs.stepTableRef.getFilledFormData();
//
const newStepTableData = JSON.parse(JSON.stringify(stepTableFormData));
//
for (let i = 0; i < newStepTableData.length; i++) {
const item = newStepTableData[i];
if (i === 0) {
// row.code
newStepTableData[i].startSolutionCode = row.bh;
} else {
// targetSolutionCode
// targetSolutionCode
newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode + newStepTableData[i - 1].subTargetSolutionCode;
}
console.log(item, row, 'updateStepTableData')
const volResult = this.updateSjmbrynd(item, row.nd);
console.log(volResult, 'volResult')
if (!volResult) {
continue
}
item.actSolutionVolume = volResult.actVol;
item.actSolutionConcentration = volResult.actNd;
item.actSolutionExpire = row.sxr;
}
this.$refs.stepTableRef.updateDataSource(newStepTableData);
// tableRef
},
//
async getCode(v) {
const { stepTableFormData = [] } = v;
if (stepTableFormData && stepTableFormData.length > 0 && !stepTableFormData[0].bhCode) {
let postSn = []
for (let i = 0; i < stepTableFormData.length; i++) {
postSn.push({
pre: stepTableFormData[i].targetSolutionCode,
type: 1
})
}
const result = await getLatestSnArr(postSn)
if (result.code == 200) {
for (let i = 0; i < stepTableFormData.length; i++) {
this.$refs.stepTableRef.updateDataSourceByRowIndex(i, {
subTargetSolutionCode: result.data[i],
})
}
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
setTimeout(() => {
EventBus.$emit('onModifyRecord', params,)
}, 10);
}
}
},
//
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef","stepTableRef", "stepRef", "remarkRef"])
},
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef","stepRef", "remarkRef"]);
return content;
},
getResource() {
let content = this.getFilledFormData();
console.log(content)
//resource
let tmpResource = []
if(this.fillType === "actFill"){
let tableList = content.stepTableFormData
if(tableList && tableList.length>0){
for(let i=0;i<tableList.length;i++){
//
let item = tableList[i]
console.log('表格item:'+JSON.stringify(item))
//使
//
tmpResource.push({
mc: null,
bh: item.startSolutionCode,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.actStartSolutionVolume,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.actStartSolutionVolumeUnit,
yxzq:null,
yxzqdw:null,
})
//
tmpResource.push({
mc: null,
bh: content.subSolution,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.actDiluentVolume,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.actDiluentVolumeUnit,
yxzq:null,
yxzqdw:null,
})
//
let fzTotal = 0//
if(item.fzsj && item.fzsj.fzList && item.fzsj.fzList.length>0){
for(let j=0;j<item.fzsj.fzList.length;j++){
let fzItem = item.fzsj.fzList[j]
tmpResource.push({
mc: null,
bh: item.fzsj.mybh+fzItem.preCode+ fzItem.subCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: fzItem.num,
kcdw: item.fzsj.dw,
syl: null,
type: null,
elnType: this.product,
syldw:item.fzsj.dw,
yxzq:null,
yxzqdw:null,
})
fzTotal=addDecimals(fzTotal,fzItem.num)
}
}
//
// const { total, unit } = addTj([item.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit])
const { total, unit } = addTj([item.actStartSolutionVolume, item.actDiluentVolume], [content.headerSelectFields.actStartSolutionVolumeUnit, content.headerSelectFields.actDiluentVolumeUnit])
tmpResource.push({
mc: null,
bh: item.targetSolutionCode+item.subTargetSolutionCode,
ph: null,
ndz: item.actSolutionConcentration + content.headerSelectFields.actSolutionConcentrationUnit,
nd: item.actSolutionConcentration,
nddw: content.headerSelectFields.actSolutionConcentrationUnit,
ly: 'ELN配制',
sxrq: null,
kc: total,
kcdw: unit,
type: null,
elnType: this.product,
syl: fzTotal>0?fzTotal:null,
syldw:fzTotal>0?item.fzsj.dw:unit,
yxzq:content.effectivePeriod,
yxzqdw:content.effectivePeriodUnit,
})
}
}
}
if(tmpResource.length>0){
tmpResource = uniqeResourceOne(tmpResource)
}
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
return this.resourceTmp;
},
//
async onSave() {
let content = this.$refs.stepRef.getStepResource();
console.log(content);
},
//
deleteRow(rowIndex) {
const stepTableRef = this.$refs['stepTableRef'];
if (stepTableRef) {
stepTableRef.deleteRow(rowIndex);
}
},
configComplete(val) {
if (val.rowData.sjjzxql === '' || val.rowData.sjjzxql === undefined || val.rowData.sjryxql === '' || val.rowData.sjryxql === undefined) {
this.$message.error("表格内容未填完")
return
}
console.log("完成配置数据:" + JSON.stringify(val))
const { total, unit } = addTj([val.rowData.sjjzxql, val.rowData.sjryxql], [val.headerSelectFields.sjjzxqlUnit, val.headerSelectFields.sjryxqlUnit])
let postData = {
mc: null,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh: val.rowData.bh + val.rowData.bhCode,
nd: val.rowData.hhwznd,
nddw: val.headerSelectFields.hhwzndUnit,
kc: total,
kcdw: unit,
}
console.log("完成配置提交数据:" + JSON.stringify(postData))
sj_configurationCompleted(postData).then(() => {
}).catch(() => {
})
.finally(() => {
})
},
startConfig(val) {
console.log("开始配置数据:" + JSON.stringify(val))
let postData = {
bh: val.rowData.bh + val.rowData.bhCode,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studySubjectId: this.formData.studySubjectId,
}
console.log("开始配置提交数据:" + JSON.stringify(postData))
sj_startConfiguration(postData).then(() => {
}).catch(() => {
})
.finally(() => {
})
},
subPackageSubmit(val) {
console.log("分装数据:" + JSON.stringify(val))
if (val.fzsj.fzList && val.fzsj.fzList.length > 0) {
let list = []
for (let i = 0; i < val.fzsj.fzList.length; i++) {
let item = val.fzsj.fzList[i]
list.push({
bh: val.fzsj.mybh + item.preCode,
kc: item.num,
kcdw: val.fzsj.dw,
})
}
let postData = {
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh: val.fzsj.mybh,
nd: val.rowData.hhwznd,
nddw: val.headerSelectFields.hhwzndUnit,
list: list
}
console.log("分装提交数据:" + JSON.stringify(postData))
sj_subpackage(postData).then(() => {
}).catch(() => {
})
.finally(() => {
})
}
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
.print-btn {
margin-bottom: 20px;
}
</style>

Loading…
Cancel
Save