Browse Source

feat:[模板管理][阶梯/平行配置组件抽离,未完]

ouqian
luojie 1 month ago
parent
commit
2d3bf4041f
5 changed files with 30 additions and 19 deletions
  1. +1
    -1
      src/components/Template/CustomTable.vue
  2. +1
    -1
      src/components/Template/HandleFormItem.vue
  3. +6
    -4
      src/views/business/comps/template/comps/sp/SP00456.vue
  4. +20
    -13
      src/views/business/comps/template/comps/sp/comps/LadderConfig.vue
  5. +2
    -0
      src/views/business/comps/template/mixins/templateMixin.js

+ 1
- 1
src/components/Template/CustomTable.vue View File

@ -183,7 +183,7 @@
</div> </div>
<div class="m-l-5" :class="{ 'flex1': col.bodySubType !== 'button' }" <div class="m-l-5" :class="{ 'flex1': col.bodySubType !== 'button' }"
v-if="isShowBodySub(col, row)"> v-if="isShowBodySub(col, row)">
<template v-if="col.bodySubType === 'inputNumber' || col.bodySubType === 'input'">
<template v-if="col.bodySubType === 'inputNumber' || col.bodySubType === 'input' || col.bodySubType === 'select'">
<HandleFormItem :fieldKey="prefixKey + '_' + col.bodySubKey + '_' + rowIndex" <HandleFormItem :fieldKey="prefixKey + '_' + col.bodySubKey + '_' + rowIndex"
:fieldItemLabel="fieldItemLabel" :type="col.bodySubType" :fieldItemLabel="fieldItemLabel" :type="col.bodySubType"
@blur="onSubBlur(rowIndex, col.bodySubKey, $event)" @blur="onSubBlur(rowIndex, col.bodySubKey, $event)"

+ 1
- 1
src/components/Template/HandleFormItem.vue View File

@ -411,7 +411,7 @@ export default {
getDecimalDigits() { getDecimalDigits() {
const { precision } = this.item; const { precision } = this.item;
if (!isNaN(precision)) { if (!isNaN(precision)) {
return precision
return Number(precision)
} }
return 6 return 6
}, },

+ 6
- 4
src/views/business/comps/template/comps/sp/SP00456.vue View File

@ -38,6 +38,7 @@
<LadderConfig :currentFormConfig="ladderStepFormConfig" :currentFormData="ladderConfig" <LadderConfig :currentFormConfig="ladderStepFormConfig" :currentFormData="ladderConfig"
:showOperation="fillType === 'actFill' || fillType === 'preFill'" :showOperation="fillType === 'actFill' || fillType === 'preFill'"
:tableColumns="ladderStepColumns" :prefixKey="'ladder_' + ladderIndex" :tableColumns="ladderStepColumns" :prefixKey="'ladder_' + ladderIndex"
:configType="'ladder'"
:ref="`ladderRef_${ladderIndex}`" :fieldItemLabel="$t('template.common.jtpz')" :ref="`ladderRef_${ladderIndex}`" :fieldItemLabel="$t('template.common.jtpz')"
@deleteConfig="deleteConfig('ladderConfigs',ladderConfig)" @deleteConfig="deleteConfig('ladderConfigs',ladderConfig)"
:fillType="fillType" /> :fillType="fillType" />
@ -50,6 +51,7 @@
<LadderConfig :currentFormConfig="paralleStepFormConfig" :currentFormData="paralleConfig" <LadderConfig :currentFormConfig="paralleStepFormConfig" :currentFormData="paralleConfig"
:showOperation="fillType === 'actFill' || fillType === 'preFill'" :showOperation="fillType === 'actFill' || fillType === 'preFill'"
:tableColumns="paralleStepColumns" :prefixKey="'paralle_' + paralleIndex" :tableColumns="paralleStepColumns" :prefixKey="'paralle_' + paralleIndex"
:configType="'paralle'"
:ref="`paralleRef_${paralleIndex}`" :fieldItemLabel="$t('template.common.pxpz')" :ref="`paralleRef_${paralleIndex}`" :fieldItemLabel="$t('template.common.pxpz')"
@deleteConfig="deleteConfig('paralleConfigs',paralleConfig)" @deleteConfig="deleteConfig('paralleConfigs',paralleConfig)"
:fillType="fillType" /> :fillType="fillType" />
@ -234,7 +236,7 @@ export default {
// //
this.formData.paralleConfigs.push({ this.formData.paralleConfigs.push({
id: getuuid(), id: getuuid(),
paralleStepData: [],
stepData: [],
paralleTableFormData: [], paralleTableFormData: [],
showParalleConfig: true showParalleConfig: true
}); });
@ -250,7 +252,7 @@ export default {
// //
this.formData.ladderConfigs.push({ this.formData.ladderConfigs.push({
id: getuuid(), id: getuuid(),
ladderStepData: [],
stepData: [],
ladderTableFormData: [], ladderTableFormData: [],
showLadderConfig: true showLadderConfig: true
}); });
@ -318,7 +320,7 @@ export default {
ladderConfigsData.push({ ladderConfigsData.push({
...baseFormData, ...baseFormData,
...tableData, ...tableData,
ladderStepData: stepData,
stepData: stepData,
showLadderConfig: true, showLadderConfig: true,
id id
}); });
@ -339,7 +341,7 @@ export default {
paralleConfigsData.push({ paralleConfigsData.push({
...baseFormData, ...baseFormData,
...tableData, ...tableData,
paralleStepData: stepData,
stepData: stepData,
showParalleConfig: true, showParalleConfig: true,
id id
}); });

+ 20
- 13
src/views/business/comps/template/comps/sp/comps/LadderConfig.vue View File

@ -1,7 +1,7 @@
<template> <template>
<div class="template-form-item"> <div class="template-form-item">
<div class="config-header"> <div class="config-header">
<div>{{ $t('template.common.jtpz') }}</div>
<div>{{ $t(fieldItemLabel) }}</div>
<el-button v-if="fillType === 'preFill'" type="text" icon="el-icon-delete" <el-button v-if="fillType === 'preFill'" type="text" icon="el-icon-delete"
@click="deleteConfig">{{ @click="deleteConfig">{{
$t('template.common.deleteBtn') $t('template.common.deleteBtn')
@ -18,8 +18,8 @@
@bodySelectChange="bodySelectChange" @bodySelectChange="bodySelectChange"
@beforeSaveRecord="(data) => onBeforeSaveRecord(data )" @beforeSaveRecord="(data) => onBeforeSaveRecord(data )"
@headerSelectChange="(data) => onHeaderSelectChange(data)" @headerSelectChange="(data) => onHeaderSelectChange(data)"
@beforeReagentSubmit="(data) => onTableBeforeReagentSubmit(data, paralleIndex, paralleConfig)"
@onRegentSubmit="(data) => onTableRegentSubmit('paralle', paralleIndex, data)"
@beforeReagentSubmit="(data) => onTableBeforeReagentSubmit(data)"
@onRegentSubmit="(data) => onTableRegentSubmit( data)"
:prefixKey="prefixKey" :fieldItemLabel="fieldItemLabel"> :prefixKey="prefixKey" :fieldItemLabel="fieldItemLabel">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion @printTag="(e) => printTag(e)" <TableOpertaion @printTag="(e) => printTag(e)"
@ -32,7 +32,7 @@
</template> </template>
</CustomTable> </CustomTable>
<Step class="mt-0 s-container" ref="stepRef" :formData="currentFormData.ladderStepData"
<Step class="mt-0 s-container" ref="stepRef" :formData="currentFormData.stepData"
:fieldItemLabel="fieldItemLabel" :prefixKey="prefixKey"></Step> :fieldItemLabel="fieldItemLabel" :prefixKey="prefixKey"></Step>
</div> </div>
</template> </template>
@ -107,11 +107,10 @@ export default {
} }
}, },
// getFormData // getFormData
getFormData() {
const baseFormData = this.$refs.formPackageRef?.getFormData();
const tableData = this.$refs.tableRef?.getFormData();
const stepData = this.$refs.stepRef?.getFormData();
async getFormData() {
const baseFormData = await this.$refs.formPackageRef?.getFormData();
const tableData = await this.$refs.tableRef?.getFormData();
const stepData =await this.$refs.stepRef?.getFormData();
// //
if (!baseFormData || !tableData || !stepData) { if (!baseFormData || !tableData || !stepData) {
return false; return false;
@ -179,7 +178,7 @@ export default {
// //
onHandleTableBlur(e) { onHandleTableBlur(e) {
const { configType } = this; const { configType } = this;
const { colKey = "", item, rowIndex, headerSelectFields } = e;
const { colKey = "", item, rowIndex, headerSelectFields,dataSource } = e;
if (colKey === "targetStartSolutionConcentration" || colKey === "targetSolutionVolume" || colKey === "targetSolutionConcentration" || colKey === "targetStartSolutionVolumePrecision" || colKey === "targetDiluentVolumePrecision") { if (colKey === "targetStartSolutionConcentration" || colKey === "targetSolutionVolume" || colKey === "targetSolutionConcentration" || colKey === "targetStartSolutionVolumePrecision" || colKey === "targetDiluentVolumePrecision") {
if (configType === "ladder") { if (configType === "ladder") {
const { targetStartSolution, subTargetStartSolution } = this.$refs.formPackageRef?.getFilledFormData(); const { targetStartSolution, subTargetStartSolution } = this.$refs.formPackageRef?.getFilledFormData();
@ -196,9 +195,15 @@ export default {
} else if (colKey === "actStartSolutionVolume" || colKey === "actDiluentVolume") {// } else if (colKey === "actStartSolutionVolume" || colKey === "actDiluentVolume") {//
if (configType === "ladder") { if (configType === "ladder") {
const targetAcSolution = this.$refs.formPackageRef?.getFormDataByKey("targetAcSolution");// const targetAcSolution = this.$refs.formPackageRef?.getFormDataByKey("targetAcSolution");//
let initNd = 0;
if(rowIndex === 0){
initNd = targetAcSolution;
}else{
initNd = dataSource[rowIndex - 1].actSolutionConcentration;
}
const params = this.getLadderNdParamsByIndex(); const params = this.getLadderNdParamsByIndex();
if (targetAcSolution) { if (targetAcSolution) {
const volResult = this.updateSjmbrynd(item, targetAcSolution, params);
const volResult = this.updateSjmbrynd(item, initNd, params);
if (!volResult) { if (!volResult) {
return return
} }
@ -315,7 +320,6 @@ export default {
const { rowData, headerSelectFields } = val; const { rowData, headerSelectFields } = val;
//(+) //(+)
const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit]) const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit])
debugger
let postData = { let postData = {
mc: null, mc: null,
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode, bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
@ -366,7 +370,7 @@ export default {
} }
}, },
// table // table
onTableRegentSubmit(type, configIndex, data) {
onTableRegentSubmit(data) {
const { selectInfo, rowIndex, key, rowData } = data; const { selectInfo, rowIndex, key, rowData } = data;
const { row, selectedId } = selectInfo; const { row, selectedId } = selectInfo;
if (key === "actStartSolutionCode") {// if (key === "actStartSolutionCode") {//
@ -390,6 +394,9 @@ export default {
} }
} }
}, },
updateDataSourceByRowIndex(rowIndex, data) {
this.$refs.tableRef.updateDataSourceByRowIndex(rowIndex, data);
},
} }
} }
</script> </script>

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

@ -560,6 +560,7 @@ export default {
//计算目标溶液浓度 //计算目标溶液浓度
calcNd(item, targetAcSolution,params) { calcNd(item, targetAcSolution,params) {
console.log(params,"ppp") console.log(params,"ppp")
// debugger
//targetStartSolutionUnit(实际起始源溶液浓度单位) //targetStartSolutionUnit(实际起始源溶液浓度单位)
const {targetStartSolutionUnit,headerSelectFields} = params; const {targetStartSolutionUnit,headerSelectFields} = params;
//actStartSolutionVolumeUnit(实际起始源溶液体积单位)actSolutionVolumeUnit(实际目标溶液体积单位) //actStartSolutionVolumeUnit(实际起始源溶液体积单位)actSolutionVolumeUnit(实际目标溶液体积单位)
@ -575,6 +576,7 @@ export default {
if(isValueEmpty(actStartSolutionVolume) || isValueEmpty(actDiluentVolume) || isValueEmpty(targetStartSolutionUnit)){ if(isValueEmpty(actStartSolutionVolume) || isValueEmpty(actDiluentVolume) || isValueEmpty(targetStartSolutionUnit)){
return false return false
} }
const converActDiluentVolume = volumeConverter.convert(actDiluentVolume+actDiluentVolumeUnit,actSolutionVolumeUnit) const converActDiluentVolume = volumeConverter.convert(actDiluentVolume+actDiluentVolumeUnit,actSolutionVolumeUnit)
const converActStartSolutionVolume = volumeConverter.convert(actStartSolutionVolume+actStartSolutionVolumeUnit,actSolutionVolumeUnit) const converActStartSolutionVolume = volumeConverter.convert(actStartSolutionVolume+actStartSolutionVolumeUnit,actSolutionVolumeUnit)
//实际源溶液加入体积+实际稀释液加入体积 //实际源溶液加入体积+实际稀释液加入体积

Loading…
Cancel
Save