Browse Source

feat:[模板管理][乱七八糟的浓度计算]

lkf
luojie 3 months ago
parent
commit
9fad473922
7 changed files with 57 additions and 42 deletions
  1. +18
    -4
      src/components/Template/HandleFormItem.vue
  2. +1
    -16
      src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue
  3. +1
    -0
      src/views/business/comps/template/comps/sp/SWYPFXCBYPZB.vue
  4. +1
    -0
      src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue
  5. +32
    -14
      src/views/business/comps/template/comps/sp/SWYPNBGZYZBB.vue
  6. +3
    -7
      src/views/business/comps/template/formConfig/paralleAndLadderConfig.js
  7. +1
    -1
      src/views/business/comps/template/mixins/templateMixin.js

+ 18
- 4
src/components/Template/HandleFormItem.vue View File

@ -28,7 +28,7 @@
<div class="clickable"
:class="getFillTypeStyle() + (getDisabled() ? ' disabled' : '') + (orangeBg ? ' orange-bg' : '')"
v-else-if="item.type === 'clickable'" @click="handleClickable(item, $event)">
<span v-if="value">{{ value }}</span>
<span v-if="inputValue">{{ inputValue }}</span>
<span v-else class="default-placeholder-text">{{ getPlaceholder() }}</span>
</div>
</div>
@ -167,6 +167,13 @@ export default {
watch: {
value(newVal) {
this.inputValue = newVal;
// typeclickable
if (this.item.type === 'clickable') {
this.$nextTick(() => {
this.onCommonHandleSaveRecord(newVal);
});
}
}
},
filters: {
@ -360,7 +367,9 @@ export default {
} else if (!this.error && isEmpty) {
this.$emit('update:error', true);
}
console.log(this.oldValue,this.inputValue,"onCommonHandleSaveRecord")
//
console.log(this.oldValue,this.in)
//
const isSame = this.isEqual(this.oldValue, this.inputValue);
if(isSame){
@ -523,8 +532,13 @@ export default {
return placeholder ? this.$t(placeholder) : (this.$t(prex) + this.$t(label))
},
onCopy() {
this.$emit("copy")
async onCopy() {
//
this.$emit("copy");
//
this.$nextTick(async () => {
await this.onCommonHandleSaveRecord(this.inputValue);
});
},
//
getIsShowQuestionIcon() {

+ 1
- 16
src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue View File

@ -403,21 +403,6 @@ export default {
subSolutionVisible: false,
currentSubKey: "",//key
stepTableDataSource: [],
sysjColumns: [
{ label: "试剂名称", prop: "reagentName" },
{ label: "编号", prop: "reagentCode" },
{ label: "批号", prop: "reagentNo" },
{ label: "浓度/含量/纯度", prop: "concentration" },
{ label: "来源", prop: "source" },
{ label: "失效日", prop: "expireDate" },
],
yqsColumns: [
{ label: "仪器名称", prop: "instrumentName" },
{ label: "仪器型号", prop: "instrumentModel" },
{ label: "仪器编号", prop: "instrumentCode" },
{ label: "下次测试/校准/检定日期", prop: "nextTestDate" },
],
};
},
mounted() {
@ -437,7 +422,7 @@ export default {
//
onSelectReagentSubmit(code,row){
if(this.currentSubKey === "subStartSolution"){//
this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.sjnd);
this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd);
this.updateStepTableData(row);
}
this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code);

+ 1
- 0
src/views/business/comps/template/comps/sp/SWYPFXCBYPZB.vue View File

@ -111,6 +111,7 @@ export default {
label: 'template.common.versionNumber',
type: "input",
fillType: "actFill",
prepend:"V",
maxlength: 50
},

+ 1
- 0
src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue View File

@ -111,6 +111,7 @@ export default {
label: 'template.common.versionNumber',
type: "input",
fillType: "actFill",
prepend:"V",
maxlength: 50
},

+ 32
- 14
src/views/business/comps/template/comps/sp/SWYPNBGZYZBB.vue View File

@ -63,6 +63,7 @@
fieldItemLabel="平行配制" />
<CustomTable @blur="(e)=>onHandleTableBlur('paralle', paralleIndex,e)" :ref="`paralleStepTableRef_${paralleIndex}`"
:columns="paralleStepColumns" :formData="paralleConfig"
@clickable="(col,rowIndex) => handleTableClickable('paralle', paralleIndex, col,rowIndex)"
:prefixKey="'paralle' + paralleIndex" fieldItemLabel="平行配制">
<template slot="operation" slot-scope="{ row, rowIndex}">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex"
@ -151,7 +152,9 @@ export default {
currentType: "",//
currentRowIndex: "",//
dataSource: [],
currentTableIndex: "",//
currentTableKey: "",//key
targetAcSolutionFromTable:true,//
};
},
mounted() {
@ -239,14 +242,25 @@ export default {
this.updateSjmbrynd(item,targetAcSolution);
}
}else if(type === "paralle"){
const targetAcSolution = item.actStartSolutionConcentration || 0;//
const targetAcSolution = item.targetAcSolution || 0;//
if(targetAcSolution){
this.updateSjmbrynd(item,targetAcSolution);
this.updateSjmbrynd(item,targetAcSolution);
}
}
}
},
//
handleTableClickable(type, rowIndex, col,tableRowIndex) {
if(col.prop === "actStartSolutionCode"){//
this.currentTableKey = col.prop;
this.currentType = type;
this.currentRowIndex = rowIndex;
this.currentTableIndex = tableRowIndex;
this.$refs.selectReagentDialogRef.show();
}
},
//form
handleClickable(type, rowIndex, item) {
if (this.fillType === "preFill") {
return;
@ -262,20 +276,24 @@ export default {
},
//
onSelectReagentSubmit(code,row) {
const { currentSubKey } = this;
if (this.currentType === "ladder") {
const packageRef = this.$refs[`ladderStepFormPackageRef_${this.currentRowIndex}`][0];
if (currentSubKey === "subStartSolution") {
packageRef.updateFormData("targetAcSolution", row.sjnd);
const { currentSubKey,currentTableKey,currentRowIndex,currentTableIndex } = this;
if(currentSubKey){
const ref = this.currentType === "ladder" ?"ladderStepFormPackageRef_":"paralleStepFormPackageRef_"
const packageRef = this.$refs[`${ref}${this.currentRowIndex}`][0];
if(currentSubKey === "subStartSolution"){
packageRef.updateFormData("targetAcSolution", row.nd);
}
packageRef.updateFormData(currentSubKey, code);
} else if (this.currentType === "paralle") {
this.$refs.paralleStepFormPackageRef_[this.currentRowIndex].updateFormData(this.currentSubKey, {
reagentCode: code,
});
this.currentSubKey = "";
}else if (currentTableKey === "actStartSolutionCode"){//
const tableRef = this.$refs[`paralleStepTableRef_${currentRowIndex}`][0];
if(tableRef){
tableRef.updateDataSourceByRowIndex(currentTableIndex,{
actStartSolutionCode: code,
targetAcSolution: row.nd,
})
}
}
// this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code);
this.$refs.selectReagentDialogRef.onCancel()
},
//

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

@ -150,10 +150,7 @@ export const getParallelColumnsConfig = ($this) => {
label: "目标溶液编号",
prop: "targetSolutionCode",
bodyType: "select",
bodyOptions: [{
label: "溶液1",
value: "1",
}],
bodyOptions: $this.getDictOptions('business_jmdyzqdyp'),
subType: "span",
subKey: "subTargetSolutionCode",
bodyFillType: "preFill",
@ -251,9 +248,8 @@ export const getParallelColumnsConfig = ($this) => {
label: "实际原始溶液编号",
prop: "actStartSolutionCode",
width: 280,
bodyType: "input",
bodyType: "clickable",
bodyFillType: "actFill",
bodyDisabled: true,
},
{
label: "预设原始溶液浓度",
@ -270,7 +266,7 @@ export const getParallelColumnsConfig = ($this) => {
},
{
label: "实际原始溶液浓度",
prop: "actStartSolutionConcentration",
prop: "targetAcSolution",
width: 280,
bodyType: "inputNumber",
bodyFillType: "actFill",

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

@ -22,7 +22,7 @@ export default {
if (v.bdnr) {
this.formData = { ...JSON.parse(v.bdnr), studyMc,studySn,templateMc,templateMcEn,templateSn,startDate,endDate, };
}
const { effectivePeriod, effectivePeriodUnit, expireDate } = this.formData;
const { effectivePeriod, effectivePeriodUnit, expireDate } = this.formData;
//实际填报的时候,如果有了开始时间,并且有有效周期,但是没有失效日,就计算失效日为开始时间+有效周期
if (startDate && this.fillType === "actFill" && effectivePeriod && effectivePeriodUnit && !expireDate) {
const start = moment(startDate);

Loading…
Cancel
Save