Browse Source

fix:[模板管理]新增供试品002

lkf
15881625488@163.com 2 months ago
parent
commit
957d6d83eb
4 changed files with 595 additions and 1 deletions
  1. +3
    -0
      src/lang/en/template/gsp.js
  2. +3
    -0
      src/lang/zh/template/gsp.js
  3. +3
    -1
      src/views/business/comps/template/TemplateTable.vue
  4. +586
    -0
      src/views/business/comps/template/comps/gsp/GSP002.vue

+ 3
- 0
src/lang/en/template/gsp.js View File

@ -32,6 +32,9 @@ export default {
DMYPPZJLB:{ DMYPPZJLB:{
}, },
GSP002:{
xsy:'稀释液',
},
GSP003:{ GSP003:{
calcConditionLabel:'计算公式', calcConditionLabel:'计算公式',
sfxyzjfx:'是否需要制剂分析' sfxyzjfx:'是否需要制剂分析'

+ 3
- 0
src/lang/zh/template/gsp.js View File

@ -32,6 +32,9 @@ export default {
DMYPPZJLB:{ DMYPPZJLB:{
}, },
GSP002:{
xsy:'稀释液',
},
GSP003:{ GSP003:{
calcConditionLabel:'计算公式', calcConditionLabel:'计算公式',
sfxyzjfx:'是否需要制剂分析' sfxyzjfx:'是否需要制剂分析'

+ 3
- 1
src/views/business/comps/template/TemplateTable.vue View File

@ -41,6 +41,7 @@ import SP017 from "./comps/sp/SWYPFXFFXYPZBB/SP017.vue";
import SP018 from "./comps/sp/SWYPFXFFXYPZBB/SP018.vue"; import SP018 from "./comps/sp/SWYPFXFFXYPZBB/SP018.vue";
import Demo from "./comps/sp/Demo.vue"; import Demo from "./comps/sp/Demo.vue";
// //
import GSP002 from "./comps/gsp/GSP002.vue";
import GSP003 from "./comps/gsp/GSP003.vue"; import GSP003 from "./comps/gsp/GSP003.vue";
import GSP010 from "./comps/gsp/GSP010.vue"; import GSP010 from "./comps/gsp/GSP010.vue";
@ -75,7 +76,7 @@ export default {
//// ////
MJYLQSQD, SYWZPZJHB, DMYPPZJLB, MJYLQSQD, SYWZPZJHB, DMYPPZJLB,
// //
GSP003, GSP010,
GSP002, GSP003, GSP010,
// //
SP001, SP003, SP00456,SP007, SP008, SP009, SP010, SP011, SP012, SP013, SP014, SP015, SP016, SP017, SP018, SP001, SP003, SP00456,SP007, SP008, SP009, SP010, SP011, SP012, SP013, SP014, SP015, SP016, SP017, SP018,
// PCR // PCR
@ -129,6 +130,7 @@ export default {
'SP018': 'SP018', 'SP018': 'SP018',
// //
'GSP001': 'DMYPPZJLB', 'GSP001': 'DMYPPZJLB',
'GSP002': 'GSP002',
'GSP003': 'GSP003', 'GSP003': 'GSP003',
'GSP010': 'GSP010', 'GSP010': 'GSP010',
//// ////

+ 586
- 0
src/views/business/comps/template/comps/gsp/GSP002.vue View File

@ -0,0 +1,586 @@
<!-- 供试品部试剂配制记录表 -->
<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="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" />
<TableList label="template.common.wzInfo" :columns="sywzColumns" :dataSource="resourceWz"
v-if="resourceWz.length > 0" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<LineLabel label="template.common.operationSteps" />
<div :label="$t('template.common.pxpz')"
v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs"
:key="'paralle_' + paralleIndex">
<div class="template-form-item">
<div class="config-header-end" v-if="fillType === 'preFill'">
<el-button type="primary" @click="handleAddParalle(false)">{{
$t('template.lba.lba004.xz')}}</el-button>
<el-button type="danger" plain @click="deleteParalleConfig(paralleIndex)">{{
$t('template.lba.lba004.sc')}}</el-button>
</div>
<BaseInfoFormPackage @clickable="(e) => handleClickable('paralle', paralleIndex, e)"
:ref="`paralleStepFormPackageRef_${paralleIndex}`" :formConfig="paralleStepFormConfig"
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex"
:fieldItemLabel="$t('template.lba.lba004.xszj')" />
<!-- <CustomTable @blur="(e) => onHandleTableBlur('paralle', paralleIndex, e)"
:ref="`paralleStepTableRef_${paralleIndex}`" :showOperation="fillType === 'actFill' || fillType === 'preFill'"
:columns="paralleStepColumns"
@onRegentSubmit="(data) => onTableRegentSubmit('paralle', paralleIndex, data)"
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex"
:fieldItemLabel="$t('template.lba.lba004.xszj')">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="(rowIndex) => deleteRow(rowIndex, 'paralle', paralleIndex)" ></TableOpertaionDelete>
</template>
</CustomTable> -->
<CustomTable :ref="`paralleStepTableRef_${paralleIndex}`"
:showOperation="fillType === 'preFill'" :columns="paralleStepColumns"
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex"
:fieldItemLabel="$t('template.lba.lba004.xszj')">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex, 'paralle', paralleIndex)">
</TableOpertaionDelete>
</template>
</CustomTable>
<Step class="mt-0 s-container" :ref="`paralleStepRef_${paralleIndex}`"
:formData="paralleConfig.paralleStepData"
:fieldItemLabel="$t('template.lba.lba004.xszj')" :prefixKey="'paralle' + paralleIndex">
</Step>
</div>
</div>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
</div>
</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";
import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es';
import CustomTable from '@/components/Template/CustomTable.vue';
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
export default {
name: "GSP002",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaionDelete },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
//
jcbColumns() {
return [{
label: 'template.lba.lba002.jcbmc',
prop: 'jcb',
bodyType: 'input',
bodyFillType: 'preFill',
width: 280,
}, {
label: '',
prop: 'jcbBh',
bodyType: 'jcb',
bodyFillType: 'actFill',
width: 280
}]
},
//
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,
},
methodCode: {
label: 'template.common.methodCode',
type: "input",
fillType: "preFill",
maxlength: 50
},
versionNum: {
label: 'template.common.versionNumber',
type: "inputNumber",
fillType: "actFill",
prepend: "V",
maxlength: 50
},
}
},
{
type: "conditionItem",
label: 'template.lba.lba002.cztj',
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.lba.lba002.czsj',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
},
paralleStepFormConfig() {
return [
{
type: 'step',
config: {
jz: {
label: 'template.gsp.GSP002.xsy',
type: 'input',
fillType: 'preFill',
subType: 'sj',
subKey: 'jzCode',
subFillType: 'actFill',
maxlength: 20
},
storageCondition: {
label: 'template.common.storageConditionLabel',
type: "select",
fillType: "preFill",
options: this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
}
}
]
},
paralleStepColumns() {
return [
{
label: 'template.sp.sp00456.mbrybh',
prop: 'targetSolutionCode',
bodyType: 'input',
bodySubType: 'span',
bodySubKey: 'subTargetSolutionCode',
bodyFillType: 'preFill',
myCodeFields: ["targetSolutionCode", "subTargetSolutionCode"],//
maxVolumeField: "actSolutionVolume",//
maxVolumeFieldUnit: "actSolutionVolumeUnit",//
showWidth: 180,
width: 280
},
{
label: 'template.sp.sp00456.ysmbrynd',
prop: 'targetSolutionConcentration',
width: 280,
showWidth: 120,
headerSelectKey: 'targetSolutionConcentrationUnit',
fillType: 'preFill',
headerOptions: this.getDictOptions('business_nddw'),
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
headerSelectTo: "actSolutionConcentrationUnit",
},
{
label: 'template.sp.sp00456.sjmbrynd',
prop: 'actSolutionConcentration',
width: 280,
showWidth: 120,
headerSelectKey: 'actSolutionConcentrationUnit',
fillType: 'preFill',
headerOptions: this.getDictOptions('business_nddw'),
bodyDisabled: true,
bodyType: 'inputNumber',
bodySubType: 'inputNumber',
bodySubKey: 'actSolutionConcentrationPrecision',
bodyFillType: 'actFill',
bodySubFillType: 'preFill',
showBodySub: this.fillType === 'preFill',
bodyPrecisionKey: 'actSolutionConcentrationPrecision',
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
compareTo: 'targetSolutionConcentration', //
},
{
label: 'template.sp.sp00456.ysmbrytj',
prop: 'targetSolutionVolume',
width: 280,
showWidth: 120,
headerSelectKey: 'targetSolutionVolumeUnit',
fillType: 'preFill',
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
headerSelectTo: "actSolutionVolumeUnit",
},
{
label: 'template.sp.sp00456.sjmbrytj',
prop: 'actSolutionVolume',
width: 280,
showWidth: 120,
headerSelectKey: 'actSolutionVolumeUnit',
fillType: 'preFill',
headerOptions: this.getDictOptions('business_tjdw'),
bodyDisabled: true,
bodyType: 'inputNumber',
bodySubType: 'inputNumber',
bodySubKey: 'actSolutionVolumePrecision',
bodyFillType: 'actFill',
bodySubFillType: 'preFill',
showBodySub: this.fillType === 'preFill',
bodyPrecisionKey: 'actSolutionVolumePrecision',
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
compareTo: 'targetSolutionVolume', //
},
{
label: 'template.sp.sp00456.mbryyxzq',
prop: 'targetSolutionCycle',
width: 280,
showWidth: 160,
fillType: 'preFill',
bodyType: 'inputNumber',
bodySubType: 'select',
showBodySub: true,
bodySubKey: 'targetSolutionCyclePrecision',
bodySubOptions: this.getDictOptions('business_yxqdw'),
bodyFillType: 'preFill',
bodySubFillType: 'preFill',
bodyMaxlength: 10
},
{
label: 'template.sp.sp00456.mbrysxr',
prop: 'targetSolutionExpirationDate',
showWidth: 120,
width: 180,
bodyType: 'span'
},
{
label: 'template.sp.sp00456.ysysrybh',
prop: 'startSolutionCode',
width: 280,
showWidth: 120,
bodyType: 'input',
bodyFillType: 'preFill'
},
{
label: 'template.sp.sp00456.sjysrybh',
prop: 'actStartSolutionCode',
width: 280,
showWidth: 180,
bodyType: 'sj',
bodyFillType: 'actFill',
compareTo: 'startSolutionCode', //
},
{
label: 'template.sp.sp00456.ysysrynd',
prop: 'targetStartSolutionConcentration',
width: 280,
showWidth: 160,
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodySubType: 'select',
bodySubKey: 'targetStartSolutionConcentrationPrecision',
bodySubOptions: this.getDictOptions('business_nddw'),
bodySubFillType: 'preFill',
bodyMaxlength: 10,
showBodySub: true,
},
{
label: 'template.sp.sp00456.sjysrynd',
prop: 'targetAcSolution',
width: 280,
showWidth: 120,
bodyType: 'inputNumber',
bodyFillType: 'actFill',
bodyDisabled: true,
compareTo: 'targetStartSolutionConcentration', //
},
{
label: 'template.sp.sp00456.ysysrytj',
prop: 'targetStartSolutionVolume',
headerSelectKey: 'targetStartSolutionVolumeUnit',
fillType: 'preFill',
headerOptions: this.getDictOptions('business_tjdw'),
width: 280,
showWidth: 120,
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodySubType: 'inputNumber',
bodySubKey: 'targetStartSolutionVolumePrecision',
bodySubFillType: 'preFill',
bodyMaxlength: 10,
bodyPrecisionKey: 'targetStartSolutionVolumePrecision',
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
bodyDisabled: true,
showBodySub: true,
showBodySub: this.fillType === 'preFill',
headerSelectTo: "actStartSolutionVolumeUnit",
},
{
label: 'template.sp.sp00456.sjysrytj',
prop: 'actStartSolutionVolume',
headerSelectKey: 'actStartSolutionVolumeUnit',
fillType: 'preFill',
headerOptions: this.getDictOptions('business_tjdw'),
width: 280,
showWidth: 120,
bodyType: 'inputNumber',
bodyFillType: 'actFill',
bodyMaxlength: 10,
compareTo: 'targetStartSolutionVolume', //
copyFrom: 'targetStartSolutionVolume' //
},
{
label: 'template.sp.sp00456.yjxsytj',
prop: 'targetDiluentVolume',
headerSelectKey: 'preDiluentVolumeUnit',
fillType: 'preFill',
headerOptions: this.getDictOptions('business_tjdw'),
width: 280,
showWidth: 120,
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodySubType: 'inputNumber',
bodySubKey: 'targetDiluentVolumePrecision',
bodySubFillType: 'preFill',
bodyMaxlength: 10,
bodyPrecisionKey: 'targetDiluentVolumePrecision',
bodySubPlaceholder: 'template.common.xswsPlaceholder',
bodyDisabled: true,
showBodySub: this.fillType === 'preFill',
headerSelectTo: "actDiluentVolumeUnit",
},
{
label: 'template.sp.sp00456.sjxsytj',
prop: 'actDiluentVolume',
headerSelectKey: 'actDiluentVolumeUnit',
fillType: 'preFill',
headerOptions: this.getDictOptions('business_tjdw'),
width: 280,
showWidth: 120,
bodyType: 'inputNumber',
bodyFillType: 'actFill',
bodyMaxlength: 10,
copyFrom: "targetDiluentVolume",
compareTo: 'targetDiluentVolume' //
}
]
}
},
data() {
return {
formData: {}
};
},
mounted() {
if (this.fillType === "preFill") {
this.handleAddParalle(true);
}
},
methods: {
//
getFilledFormData() {
const baseData = this.$refs.baseInfoRef.getFilledFormData();
const fjData = this.$refs.fjRef.getFilledFormData();
const remarkData = this.$refs.remarkRef.getFilledFormData();
//
const paralleConfigsData = [];
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) {
for (let i = 0; i < this.formData.paralleConfigs.length; i++) {
const paralleFormData = this.$refs[`paralleStepFormPackageRef_${i}`][0].getFilledFormData();
const paralleTableFormData = this.$refs[`paralleStepTableRef_${i}`][0].getFilledFormData();
const paralleStepData = this.$refs[`paralleStepRef_${i}`][0].getFilledFormData();
paralleConfigsData.push({
...paralleFormData,
...paralleTableFormData,
paralleStepData: paralleStepData.stepData,
showParalleConfig: true
});
}
}
return {
...baseData,
...fjData,
...remarkData,
paralleConfigs: paralleConfigsData,
}
},
//
async getFormData() {
//
const validFlag = await this.validFields();
if (!validFlag) {
return false;
}
let content = this.getFilledFormData();
return content
},
//
async validFields() {
//
let refsToValidate = ["baseInfoRef", "jcbRef", "fjRef", "remarkRef"];
//
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) {
for (let i = 0; i < this.formData.paralleConfigs.length; i++) {
refsToValidate.push(`paralleStepFormPackageRef_${i}`);
refsToValidate.push(`paralleStepTableRef_${i}`);
refsToValidate.push(`paralleStepRef_${i}`);
}
}
return await this.validFormFields(refsToValidate);
},
getResource() {
let content = this.getFilledFormData();
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp = stepResource.sjResource || []
this.yqResourceTmp = stepResource.yqResource || []
return this.resourceTmp;
},
//
async onSave() {
const formData = this.getStepResource();
console.log(formData, "formData")
},
//
handleAddParalle(init) {
let isAdd = !init
if (init && (!this.formData.paralleConfigs || this.formData.paralleConfigs.length === 0)) {
isAdd = true
}
if (isAdd) {
//
if (!this.formData.paralleConfigs) {
this.$set(this.formData, 'paralleConfigs', []);
}
//
this.formData.paralleConfigs.push({
paralleStepData: [],
paralleTableFormData: [],
showParalleConfig: true
});
}
},
//
deleteParalleConfig(index) {
if (this.formData.paralleConfigs.length === 1) {
// this.$message.error("1");
return;
}
this.formData.paralleConfigs.splice(index, 1);
},
deleteJcbRow(rowIndex) {
const jcbRef = this.$refs['jcbRef'];
if (jcbRef) {
jcbRef.deleteRow(rowIndex);
}
},
//
deleteRow(rowIndex, type, configIndex = 0) {
//
if (type === 'ladder') {
const tableRef = this.$refs[`ladderStepTableRef_${configIndex}`];
if (tableRef) {
tableRef.deleteRow(rowIndex);
}
} else if (type === 'paralle') {
const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`];
if (tableRef) {
tableRef[0].deleteRow(rowIndex);
}
}
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
.print-btn {
margin-bottom: 20px;
}
.config-header-end {
display: flex;
justify-content: flex-end;
align-items: center;
margin-bottom: 15px;
font-weight: bold;
font-size: 16px;
color: #303133;
}
</style>

Loading…
Cancel
Save