Browse Source

feat:[模板管理][update]

lkf
luojie 2 months ago
parent
commit
65a27526c1
10 changed files with 352 additions and 13 deletions
  1. +17
    -0
      src/components/Template/BaseInfoFormPackage.vue
  2. +3
    -0
      src/lang/en/template/sp.js
  3. +3
    -0
      src/lang/zh/template/sp.js
  4. +3
    -1
      src/views/business/comps/template/TemplateTable.vue
  5. +5
    -2
      src/views/business/comps/template/comps/sp/SP003.vue
  6. +9
    -3
      src/views/business/comps/template/comps/sp/SP00456.vue
  7. +158
    -0
      src/views/business/comps/template/comps/sp/SP007.vue
  8. +1
    -1
      src/views/business/comps/template/formConfig/paralleAndLadderConfig.js
  9. +144
    -0
      src/views/business/comps/template/formConfig/sp/SP007.js
  10. +9
    -6
      src/views/business/comps/template/mixins/templateMixin.js

+ 17
- 0
src/components/Template/BaseInfoFormPackage.vue View File

@ -53,6 +53,22 @@
</div> </div>
</div> </div>
</template> </template>
<template v-else-if="item.type === 'attachment'">
<div class="form-item ">
<div class="form-title fs-16" v-if="item.label">{{ $t( item.label) }}</div>
<div v-for="(sItem, key) in item.config" class="c-Item grid-container">
<div class="p-r-20">
<div class="form-title">{{ $t( sItem.label) }}</div>
<div class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+key" type="attachment" :item="sItem" v-model="formFields[key]"
@copy="onCopy(sItem, key)" @change="(e,type)=>onSelectChange(key, e,type)"
:error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" />
</div>
</div>
</div>
</div>
</template>
<template v-else-if="item.type === 'cellItem'"> <template v-else-if="item.type === 'cellItem'">
<div class="form-item "> <div class="form-item ">
<div class="form-title fs-16" v-if="item.label">{{ $t( item.label) }}</div> <div class="form-title fs-16" v-if="item.label">{{ $t( item.label) }}</div>
@ -173,6 +189,7 @@
</div> </div>
</div> </div>
</template> </template>
</div> </div>
</div> </div>
</template> </template>

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

@ -63,6 +63,9 @@ export default {
rqcz: 'Container Material', rqcz: 'Container Material',
cctj:'Storage Condition', cctj:'Storage Condition',
}, },
sp007:{
title: '生物样品分析样本处理表',
},
// 生物样品分析方法学样品制备表-准确度与精密度 // 生物样品分析方法学样品制备表-准确度与精密度
sp008: { sp008: {
title: title:

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

@ -63,6 +63,9 @@ export default {
rqcz: '容器材质', rqcz: '容器材质',
cctj:'存储条件', cctj:'存储条件',
}, },
sp007:{
title: '生物样品分析样本处理表',
},
// 生物样品分析方法学样品制备表-准确度与精密度 // 生物样品分析方法学样品制备表-准确度与精密度
sp008: { sp008: {
title: '生物样品分析方法学样品制备表(准确度与精密度)', title: '生物样品分析方法学样品制备表(准确度与精密度)',

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

@ -27,6 +27,7 @@ import SP001 from "./comps/sp/SP001.vue";
import SP002 from "./comps/sp/SP002.vue"; import SP002 from "./comps/sp/SP002.vue";
import SP003 from "./comps/sp/SP003.vue"; import SP003 from "./comps/sp/SP003.vue";
import SP00456 from "./comps/sp/SP00456.vue"; import SP00456 from "./comps/sp/SP00456.vue";
import SP007 from "./comps/sp/SP007.vue";
//-10 //-10
import SP008 from "./comps/sp/SWYPFXFFXYPZBB/SP008.vue"; import SP008 from "./comps/sp/SWYPFXFFXYPZBB/SP008.vue";
import SP009 from "./comps/sp/SWYPFXFFXYPZBB/SP009.vue"; import SP009 from "./comps/sp/SWYPFXFFXYPZBB/SP009.vue";
@ -56,7 +57,7 @@ export default {
// //
MJYLQSQD, SYWZPZJHB, MJYLQSQD, SYWZPZJHB,
// //
SP001, SP002, SP003, SP00456, SP008, SP009, SP010, SP011, SP012, SP013, SP014, SP015, SP016, SP017, SP018,
SP001, SP002, SP003, SP00456,SP007, SP008, SP009, SP010, SP011, SP012, SP013, SP014, SP015, SP016, SP017, SP018,
// PCR // PCR
PCR001, PCR002 PCR001, PCR002
}, },
@ -90,6 +91,7 @@ export default {
'SP004': 'SP00456', 'SP004': 'SP00456',
'SP005': 'SP00456', 'SP005': 'SP00456',
'SP006': 'SP00456', 'SP006': 'SP00456',
'SP007': 'SP007',
'SP008': 'SP008', 'SP008': 'SP008',
'SP009': 'SP009', 'SP009': 'SP009',
'SP010': 'SP010', 'SP010': 'SP010',

+ 5
- 2
src/views/business/comps/template/comps/sp/SP003.vue View File

@ -280,6 +280,7 @@ export default {
bodyType: "input", bodyType: "input",
bodyFillType: "actFill", bodyFillType: "actFill",
bodyMaxlength: 10, bodyMaxlength: 10,
bodyDisabled: true,
}, },
{ {
label: "template.sp.sp003.ysqsrytj", label: "template.sp.sp003.ysqsrytj",
@ -552,15 +553,17 @@ export default {
// //
for (let i = 0; i < newStepTableData.length; i++) { for (let i = 0; i < newStepTableData.length; i++) {
const item = newStepTableData[i]; const item = newStepTableData[i];
let initNd = row.nd;//
if (i === 0) { if (i === 0) {
// row.code // row.code
newStepTableData[i].startSolutionCode = row.bh; newStepTableData[i].startSolutionCode = row.bh;
} else { } else {
// targetSolutionCode // targetSolutionCode
// targetSolutionCode // targetSolutionCode
newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode;
newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode+newStepTableData[i - 1].subTargetSolutionCode;
initNd = newStepTableData[i - 1].actSolutionConcentration;
} }
const volResult = this.updateSjmbrynd(item, row.nd);
const volResult = this.updateSjmbrynd(item, initNd);
if (!volResult) { if (!volResult) {
continue continue
} }

+ 9
- 3
src/views/business/comps/template/comps/sp/SP00456.vue View File

@ -504,13 +504,19 @@ export default {
const newData = JSON.parse(JSON.stringify(stepTableFormData)); const newData = JSON.parse(JSON.stringify(stepTableFormData));
// //
newData.forEach((item, index) => { newData.forEach((item, index) => {
const volResult = this.updateSjmbrynd(item, row.nd);
let initNd = row.nd;//
if(index ===0){
item.startSolutionCode = row.bh;
}else{
item.startSolutionCode = newData[index - 1].targetSolutionCode+ newData[index - 1].subTargetSolutionCode;
initNd = newData[i - 1].actSolutionConcentration;
}
const volResult = this.updateSjmbrynd(item, initNd);
if (!volResult) { if (!volResult) {
return return
} }
console.log(volResult.actNd, "actNd")
item.actSolutionVolume = volResult.actVol; item.actSolutionVolume = volResult.actVol;
debugger
item.actSolutionConcentration = volResult.actNd; item.actSolutionConcentration = volResult.actNd;
// stepTableRef // stepTableRef
}) })

+ 158
- 0
src/views/business/comps/template/comps/sp/SP007.vue View File

@ -0,0 +1,158 @@
<!-- 生物样品分析溶液配制表 -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc ||
$t('template.sp.sp007.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.wzInfo" :columns="sywzColumns" :dataSource="resourceWz" v-if="resourceWz.length>0"/>
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<BaseInfoFormPackage fieldItemLabel="template.common.storageCondition"
label="template.common.storageCondition" ref="storageConditionRef"
:formConfig="storageFormConfig" :formData="formData" />
<BaseInfoFormPackage fieldItemLabel="样本说明" label="样本说明"
ref="ybRef" :formConfig="ybFormConfig" :formData="formData" />
<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>
<!-- <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 CustomTable from '@/components/Template/CustomTable.vue';
import { getLatestSn } from '@/api/template';
import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es';
import {getBaseInfoFormConfig, getRemarkFormConfig,getStorageFormConfig,getYbFormConfig} from "../../formConfig/sp/SP007";
export default {
name: "SP007",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
//
storageFormConfig() {
return getStorageFormConfig(this);
},
//
remarkConig() {
return getRemarkFormConfig();
},
//
ybFormConfig() {
return getYbFormConfig();
},
//
baseInfoFormConfig() {
return getBaseInfoFormConfig(this);
},
},
data() {
return {
formData: {}
};
},
mounted() {
const formData = this.getFormDataByTemplateData();
if(!formData.targetCodeSn&& this.fillType === "actFill"){
this.getCode(formData);
}
},
methods: {
//
printTag() {
const printConfig = this.getBasePrintConfig();
const { storageCondition, targetCodeSn } = this.formData;
printConfig["存储条件"] = storageCondition;
printConfig["编号"] = targetCodeSn;
EventBus.$emit('showTagPrintDialog', { printConfig })
},
//
getCode: debounce(async function (v) {
const result = await getLatestSn({
count: 1,
pre:v.targetCode,
type:1
})
if (result.code == 200) {
this.$refs.stepFormPackageRef.updateFormData("targetCodeSn", result.data[0])
}
}, 100),
//
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"])
},
//
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"]);
//resource
let tmpResource = []
if (this.fillType === "actFill") {
//
tmpResource.push({
mc: content.targetName,
bh: content.targetCode + content.targetCodeSn,
ph: '',
ndz: content.targetActConcentration + content.targetActConcentrationUnit,
nd: content.targetActConcentration,
nddw: content.targetActConcentrationUnit,
ly: 'ELN配制',
sxrq: content.expireDate,
kc: content.targetActVolume,
kcdw: content.targetActVolumeUnit,
syl: null,
type: null,
elnType: this.product,
syldw: content.targetActVolumeUnit,
yxzq: content.effectivePeriod,
yxzqdw: content.effectivePeriodUnit,
})
}
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
return content;
},
//
async onSave() {
let content =await this.$refs.stepRef.getFormData();
console.log(content);
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
.print-btn {
margin-bottom: 20px;
}
</style>

+ 1
- 1
src/views/business/comps/template/formConfig/paralleAndLadderConfig.js View File

@ -21,7 +21,7 @@ export const getLadderColumnsConfig = ($this) => {
showWidth: 180, showWidth: 180,
bodyType: 'input', bodyType: 'input',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyMaxlength: 10
bodyDisabled: true,
}, },
{ {
label: 'template.sp.sp00456.ysqsrytj', label: 'template.sp.sp00456.ysqsrytj',

+ 144
- 0
src/views/business/comps/template/formConfig/sp/SP007.js View File

@ -0,0 +1,144 @@
export const getBaseInfoFormConfig = ($this) => {
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
},
clpbh: {
label: '处理批编号',
type: "input",
fillType: "actFill",
maxlength: 50
},
}
},
{
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",
config: {
containerMaterial: {
label: "template.sp.sp003.rqcz",
type: "select",
options: $this.getDictOptions('business_rqcz'),
fillType: "actFill",
otherCode: "containerMaterialOther",
}
}
},
{
type: "cellItem",
label: 'template.sp.sp008.clsj',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
}
//备注
export const getRemarkFormConfig = () => {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
}
//样本说明
export const getYbFormConfig = () => {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: '样本说明',
maxlength: 1000,
rows: 5
}
}
}
]
}
//存储条件
export const getStorageFormConfig = ($this) => {
return [
{
type: "conditionItem",
config: {
storageCondition: {
label: 'template.common.storageConditionLabel',
type: "select",
fillType: "preFill",
options: $this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
}
}
]
}

+ 9
- 6
src/views/business/comps/template/mixins/templateMixin.js View File

@ -347,6 +347,7 @@ export default {
//统一处理table失焦事件 //统一处理table失焦事件
onHandleTableBlur(params) { onHandleTableBlur(params) {
const { rowIndex, colKey, value, item } = params const { rowIndex, colKey, value, item } = params
console.log(params,"params");
if ( if (
colKey === 'targetSolutionVolume' || colKey === 'targetSolutionVolume' ||
colKey === 'targetSolutionConcentration' || colKey === 'targetSolutionConcentration' ||
@ -381,11 +382,11 @@ export default {
//计算并更新实际目标溶液浓度 先计算实际目标溶液体积再计算实际目标溶液浓度 //计算并更新实际目标溶液浓度 先计算实际目标溶液体积再计算实际目标溶液浓度
updateSjmbrynd(item, targetAcSolution) { updateSjmbrynd(item, targetAcSolution) {
//实际源溶液浓度÷(实际终体积÷源溶液加入体积); //实际源溶液浓度÷(实际终体积÷源溶液加入体积);
const precision = item.actSolutionConcentrationPrecision || 0
const precision = item.actSolutionConcentrationPrecision
const volPrecision = item.actSolutionVolumePrecision || 0 const volPrecision = item.actSolutionVolumePrecision || 0
//实际稀释液体积 //实际稀释液体积
const actDiluentVolume = item.actDiluentVolume || 0
const actStartSolutionVolume = item.actStartSolutionVolume || 0
const actDiluentVolume = item.actDiluentVolume
const actStartSolutionVolume = item.actStartSolutionVolume
//实际高源溶液加入体积+实际稀释液加入体积 //实际高源溶液加入体积+实际稀释液加入体积
const actVol = ( const actVol = (
Number(actStartSolutionVolume) + Number(actDiluentVolume) Number(actStartSolutionVolume) + Number(actDiluentVolume)
@ -396,10 +397,12 @@ export default {
if(isValueEmpty(actDiluentVolume) && isValueEmpty(actStartSolutionVolume)){ if(isValueEmpty(actDiluentVolume) && isValueEmpty(actStartSolutionVolume)){
return false return false
} }
// 实际目标溶液浓度 = 实际源溶液浓度÷(实际终体积÷源溶液加入体积);
const actNd = ( const actNd = (
parseFloat(targetAcSolution) /
parseFloat(actStartSolutionVolume) /
parseFloat(actVol)
parseFloat(targetAcSolution) /(
parseFloat(actStartSolutionVolume) /
parseFloat(actVol)
)
).toFixed(precision) ).toFixed(precision)
const nd = actNd === 'Infinity' ? 0 : Number(actNd) const nd = actNd === 'Infinity' ? 0 : Number(actNd)
console.log(actNd, targetAcSolution, actStartSolutionVolume, actVol, "actNd") console.log(actNd, targetAcSolution, actStartSolutionVolume, actVol, "actNd")

Loading…
Cancel
Save