Browse Source

feat: [模板管理] GSP009+GSP011改造

lkf
memorylkf 2 months ago
parent
commit
3c48fdebd0
3 changed files with 8 additions and 307 deletions
  1. +2
    -3
      src/views/business/comps/template/TemplateTable.vue
  2. +6
    -2
      src/views/business/comps/template/comps/gsp/GSP009.vue
  3. +0
    -302
      src/views/business/comps/template/comps/gsp/GSP011.vue

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

@ -46,7 +46,6 @@ import GSP003 from "./comps/gsp/GSP003.vue";
import GSP004 from "./comps/gsp/GSP004.vue";
import GSP009 from "./comps/gsp/GSP009.vue";
import GSP010 from "./comps/gsp/GSP010.vue";
import GSP011 from "./comps/gsp/GSP011.vue";
////
import SYWZPZJHB from "./comps/gsp/SYWZPZJHB.vue";
@ -84,7 +83,7 @@ export default {
////
MJYLQSQD, SYWZPZJHB, DMYPPZJLB,
//
GSP002, GSP003, GSP004,GSP009, GSP010,GSP011,
GSP002, GSP003, GSP004,GSP009, GSP010,
//
SP001, SP003, SP00456,SP007, SP008, SP009, SP010, SP011, SP012, SP013, SP014, SP015, SP016, SP017, SP018,
// PCR
@ -147,7 +146,7 @@ export default {
'GSP008': 'GSP002',
'GSP009': 'GSP009',
'GSP010': 'GSP010',
'GSP011': 'GSP011',
'GSP011': 'GSP009',
'GSP012': 'GSP002',
'GSP013': 'GSP002',
'GSP014': 'GSP002',

+ 6
- 2
src/views/business/comps/template/comps/gsp/GSP009.vue View File

@ -12,7 +12,7 @@
<TableList label="template.common.wzInfo" :columns="sywzColumns" :dataSource="resourceWz" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<LineLabel label="template.gsp.gsp009.xtsyx" />
<LineLabel :label="sn=='GSP009'?'template.gsp.gsp009.xtsyx':'template.gsp.gsp011.cl'" />
<div v-if="fillType === 'preFill'" class="mt-20">
<el-button type="primary" @click="handleAddParalle(false)">{{ $t('template.lba.lba004.xz')
@ -66,6 +66,10 @@ export default {
type: String,
default: 'preFill',
},
sn: {
type: String,
default: '',
},
},
computed: {
//
@ -162,7 +166,7 @@ export default {
type: "sj",
fillType: "actFill",
subType:"text",
subText:"template.gsp.gsp009.zw"
subText:this.sn=='GSP009'?'template.gsp.gsp009.zw':'template.gsp.gsp011.zw'
},
}
}

+ 0
- 302
src/views/business/comps/template/comps/gsp/GSP011.vue View File

@ -1,302 +0,0 @@
<!-- 配体结合分析处理记录表 -->
<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" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<LineLabel label="template.gsp.gsp011.cl" />
<div v-if="fillType === 'preFill'" class="mt-20">
<el-button type="primary" @click="handleAddParalle(false)">{{ $t('template.lba.lba004.xz')
}}</el-button>
</div>
<!-- 平行配制区域 -->
<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="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')" />
</div>
</div>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
</div>
<!-- <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";
import { EventBus } from "@/utils/eventBus";
import { uniqeResource,uniqeResourceOne } from "@/utils/calUnitTools";
import { duplicateResource } from "@/utils/index.js";
import { debounce } from 'lodash-es';
import CustomTable from '@/components/Template/CustomTable.vue';
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
export default {
name: "GSP011",
components: { BaseInfoFormPackage, LineLabel, TableList, Step,CustomTable,TableOpertaionDelete },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
//
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,
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",
},
}
}
]
},
paralleStepFormConfig(){
return [
{
type: 'step',
config: {
yp: {
label: 'template.gsp.gsp009.ypbh',
type: "input",
fillType: "preFill",
subType: "span",
subKey: "ypBh",
subFillType: "actFill",
maxlength: 20,
},
xz: {
label: 'template.gsp.gsp009.xz',
type: "sj",
fillType: "actFill",
subType:"text",
subText:"template.gsp.gsp011.zw"
},
}
}
]
},
},
data() {
return {
formData: {}
};
},
mounted() {
this.handleAddParalle(true);
},
methods: {
//
getFilledFormData() {
const baseData = this.$refs.baseInfoRef.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();
paralleConfigsData.push({
...paralleFormData,
showParalleConfig: true
});
}
}
return {
...baseData,
...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", "remarkRef"];
//
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) {
for (let i = 0; i < this.formData.paralleConfigs.length; i++) {
refsToValidate.push(`paralleStepFormPackageRef_${i}`);
}
}
return await this.validFormFields(refsToValidate);
},
getResource() {
let content = this.getFilledFormData();
//使
this.resourceTmp = []
this.yqResourceTmp = []
return this.resourceTmp;
},
//
async onSave() {
const formData = this.getStepResource();
console.log(formData, "formData")
},
//
handleAddParalle(init) {
debugger
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({
showParalleConfig: true
});
}
//todo:
debugger
},
//
deleteParalleConfig(index) {
if(this.formData.paralleConfigs.length===1){
// this.$message.error("1");
return;
}
this.formData.paralleConfigs.splice(index, 1);
},
//
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