Browse Source

feat:[模板管理][update]

ouqian
luojie 1 month ago
parent
commit
5fcacfaa46
2 changed files with 151 additions and 101 deletions
  1. +77
    -32
      src/components/Template/CustomTable.vue
  2. +74
    -69
      src/views/business/comps/template/comps/sp/SP00456.vue

+ 77
- 32
src/components/Template/CustomTable.vue View File

@ -6,9 +6,10 @@
<div v-if="showSort" class="custom-table-cell header-cell sort-cell"> <div v-if="showSort" class="custom-table-cell header-cell sort-cell">
序号 序号
</div> </div>
<div class = "custom-table-cell header-cell c-cell">
<div class="custom-table-cell header-cell c-cell" v-if="showCheckAll">
<div class="checkbox-item"> <div class="checkbox-item">
<el-checkbox></el-checkbox>
<el-checkbox v-model="checkAll" :indeterminate="isIndeterminate"
@change="handleCheckAllChange"></el-checkbox>
</div> </div>
</div> </div>
<div v-for="(col, index) in columns" :key="index" class="custom-table-cell header-cell" <div v-for="(col, index) in columns" :key="index" class="custom-table-cell header-cell"
@ -45,9 +46,9 @@
<div v-if="showSort" class="custom-table-cell body-cell sort-cell"> <div v-if="showSort" class="custom-table-cell body-cell sort-cell">
{{ rowIndex + 1 }} {{ rowIndex + 1 }}
</div> </div>
<div class = "custom-table-cell body-cell c-cell">
<div class="custom-table-cell body-cell c-cell" v-if="showCheckAll">
<div class="checkbox-item"> <div class="checkbox-item">
<el-checkbox></el-checkbox>
<el-checkbox v-model="row._checked" @change="handleCheckChange(row, $event)"></el-checkbox>
</div> </div>
</div> </div>
<div v-for="(col, colIndex) in columns" :key="colIndex" class="custom-table-cell body-cell" <div v-for="(col, colIndex) in columns" :key="colIndex" class="custom-table-cell body-cell"
@ -120,29 +121,25 @@
</div> </div>
</template> </template>
<template v-else-if="col.bodyType === 'checkboxTag'"> <template v-else-if="col.bodyType === 'checkboxTag'">
<div class="flex flex-wrap" :class="{ 'row-error-border': hasError(rowIndex, colIndex, col.prop) }">
<HandleFormItem
:fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex"
:fieldItemLabel="fieldItemLabel" type="checkboxTag"
:value="row[col.prop]"
<div class="flex flex-wrap"
:class="{ 'row-error-border': hasError(rowIndex, colIndex, col.prop) }">
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex"
:fieldItemLabel="fieldItemLabel" type="checkboxTag" :value="row[col.prop]"
:item="getBodyItem(col, rowIndex)"
@change="onCheckboxTagChange(rowIndex, colIndex, col, $event)"
@deleteTag="onDeleteCheckboxTag(rowIndex, col, $event)"
:error="hasError(rowIndex, colIndex, col.prop)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" />
</div>
</template>
<template v-else-if="col.bodyType === 'checkbox'">
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex"
:fieldItemLabel="fieldItemLabel" type="checkbox" v-model="row[col.prop]"
:item="getBodyItem(col, rowIndex)" :item="getBodyItem(col, rowIndex)"
@change="onCheckboxTagChange(rowIndex, colIndex, col, $event)"
@deleteTag="onDeleteCheckboxTag(rowIndex, col, $event)"
@change="onCheckboxChange(rowIndex, colIndex, col, $event)"
:error="hasError(rowIndex, colIndex, col.prop)" :error="hasError(rowIndex, colIndex, col.prop)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" /> @update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" />
</div>
</template>
<template v-else-if="col.bodyType === 'checkbox'">
<HandleFormItem
:fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex"
:fieldItemLabel="fieldItemLabel"
type="checkbox"
v-model="row[col.prop]"
:item="getBodyItem(col, rowIndex)"
@change="onCheckboxChange(rowIndex, colIndex, col, $event)"
:error="hasError(rowIndex, colIndex, col.prop)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" />
</template>
</template>
</div> </div>
<div v-show="isShowOther(row[col.prop], col)" class="flex flex1"> <div v-show="isShowOther(row[col.prop], col)" class="flex flex1">
@ -296,6 +293,12 @@ export default {
type: Boolean, type: Boolean,
default: true, default: true,
}, },
//
showCheckAll: {
type: Boolean,
default: false,
},
//
showSort: { showSort: {
type: Boolean, type: Boolean,
default: false, default: false,
@ -311,6 +314,9 @@ export default {
oldLocalDataSource: [], oldLocalDataSource: [],
uuid: getuuid(), uuid: getuuid(),
isRegent, isRegent,
selectedRows: [], //
isIndeterminate: false, //
checkAll: false, //
} }
}, },
watch: { watch: {
@ -348,7 +354,6 @@ export default {
this.justUpdateFilledFormData(); this.justUpdateFilledFormData();
}, },
onCheckboxTagChange(rowIndex, colIndex, col, value) { onCheckboxTagChange(rowIndex, colIndex, col, value) {
console.log(value,"vvv")
// value // value
this.localDataSource[rowIndex][col.prop] = value; this.localDataSource[rowIndex][col.prop] = value;
// //
@ -836,7 +841,11 @@ export default {
updateDataSource(dataSource = []) { updateDataSource(dataSource = []) {
this.oldLocalDataSource = JSON.parse(JSON.stringify(this.localDataSource)); this.oldLocalDataSource = JSON.parse(JSON.stringify(this.localDataSource));
// //
this.localDataSource = JSON.parse(JSON.stringify(dataSource || []));
this.localDataSource = JSON.parse(JSON.stringify(dataSource || [])).map(row => ({
...row,
_checked: false // false
}));
this.updateCheckStatus();
this.checkCompareToOnDataLoad(); this.checkCompareToOnDataLoad();
}, },
// autoUpdateRecord // autoUpdateRecord
@ -862,7 +871,7 @@ export default {
return true; return true;
}, },
// //
justUpdateFilledFormData(){
justUpdateFilledFormData() {
const params = { const params = {
type: "fieldChanged", type: "fieldChanged",
newRecord: null, newRecord: null,
@ -870,6 +879,32 @@ export default {
} }
EventBus.$emit('onModifyRecord', params,) EventBus.$emit('onModifyRecord', params,)
}, },
//
handleCheckAllChange(val) {
this.localDataSource.forEach(row => {
row._checked = val;
});
this.updateCheckStatus();
this.$emit('selectionChange', this.selectedRows);
},
// checkbox
handleCheckChange(row, val) {
row._checked = val;
this.updateCheckStatus();
this.$emit('selectionChange', this.selectedRows);
},
//
updateCheckStatus() {
const totalRows = this.localDataSource.length;
const checkedRows = this.localDataSource.filter(row => row._checked).length;
this.checkAll = checkedRows === totalRows && totalRows > 0;
this.isIndeterminate = checkedRows > 0 && checkedRows < totalRows;
//
this.selectedRows = this.localDataSource.map((row, rowIndex) => ({
...row,
rowIndex
})).filter(item => item._checked);
},
onAddRow() { onAddRow() {
if (this.$listeners && this.$listeners['onAddRow']) { if (this.$listeners && this.$listeners['onAddRow']) {
this.$emit('onAddRow'); this.$emit('onAddRow');
@ -886,10 +921,18 @@ export default {
// //
addRow(row = {}) { addRow(row = {}) {
this.localDataSource.push(row);
this.localDataSource.push({
...row,
_checked: false // false
});
this.updateCheckStatus();
}, },
addRows(rows = []) { addRows(rows = []) {
this.localDataSource.push(...rows);
this.localDataSource.push(...rows.map(row => ({
...row,
_checked: false // false
})));
this.updateCheckStatus();
}, },
getDataSource() { getDataSource() {
return this.localDataSource; return this.localDataSource;
@ -1166,7 +1209,7 @@ export default {
.flex-wrap { .flex-wrap {
flex-wrap: wrap; flex-wrap: wrap;
gap:10px;
gap: 10px;
} }
.row-error-border { .row-error-border {
@ -1175,13 +1218,15 @@ export default {
border-radius: 4px; border-radius: 4px;
border: 1px solid #ff5d5d; border: 1px solid #ff5d5d;
} }
.checkbox-item{
.checkbox-item {
/* width: 50px; */ /* width: 50px; */
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.c-cell{
.c-cell {
width: 50px; width: 50px;
} }
</style> </style>

+ 74
- 69
src/views/business/comps/template/comps/sp/SP00456.vue View File

@ -16,33 +16,36 @@
<LineLabel label="template.common.operationSteps" /> <LineLabel label="template.common.operationSteps" />
<div v-if="fillType === 'preFill'" class="mt-20"> <div v-if="fillType === 'preFill'" class="mt-20">
<el-button type="primary" @click="handleAddParalle">{{ $t('template.common.xzpxpz') <el-button type="primary" @click="handleAddParalle">{{ $t('template.common.xzpxpz')
}}</el-button>
}}</el-button>
<el-button type="primary" @click="handleAddLadder">{{ $t('template.common.xzjtpz') <el-button type="primary" @click="handleAddLadder">{{ $t('template.common.xzjtpz')
}}</el-button>
}}</el-button>
</div> </div>
<!-- 阶梯配制区域 --> <!-- 阶梯配制区域 -->
<div v-for="(ladderConfig, ladderIndex) in formData.ladderConfigs" :key="'ladder_' + ladderConfig.id">
<div v-for="(ladderConfig, ladderIndex) in formData.ladderConfigs"
:key="'ladder_' + ladderConfig.id">
<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('template.common.jtpz') }}</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('ladderConfigs', ladderConfig)">{{ $t('template.common.deleteBtn')
}}</el-button>
@click="deleteConfig('ladderConfigs', ladderConfig)">{{
$t('template.common.deleteBtn')
}}</el-button>
</div> </div>
<BaseInfoFormPackage @onRegentSubmit="(e) => onRegentSubmit('ladder', ladderIndex, e)" <BaseInfoFormPackage @onRegentSubmit="(e) => onRegentSubmit('ladder', ladderIndex, e)"
@beforeReagentSubmit="(data) => onBeforeReagentSubmit(data,ladderIndex, ladderConfig)"
@beforeReagentSubmit="(data) => onBeforeReagentSubmit(data, ladderIndex, ladderConfig)"
:ref="`ladderStepFormPackageRef_${ladderIndex}`" :formConfig="ladderStepFormConfig" :ref="`ladderStepFormPackageRef_${ladderIndex}`" :formConfig="ladderStepFormConfig"
:formData="ladderConfig" :fieldItemLabel="$t('template.common.jtpz')" :formData="ladderConfig" :fieldItemLabel="$t('template.common.jtpz')"
@blur="(e) => onHandleBlur(e,'ladder', ladderIndex)"
@select = "(e) => onHandleBlur(e,'ladder', ladderIndex)"
@blur="(e) => onHandleBlur(e, 'ladder', ladderIndex)"
@select="(e) => onHandleBlur(e, 'ladder', ladderIndex)"
:prefixKey="'ladder_' + ladderIndex" /> :prefixKey="'ladder_' + ladderIndex" />
<CustomTable @blur="(e) => onHandleTableBlur('ladder', ladderIndex, e)" <CustomTable @blur="(e) => onHandleTableBlur('ladder', ladderIndex, e)"
:ref="`ladderStepTableRef_${ladderIndex}`" :showOperation="fillType === 'actFill' || fillType === 'preFill'"
:ref="`ladderStepTableRef_${ladderIndex}`"
:showOperation="fillType === 'actFill' || fillType === 'preFill'"
:columns="ladderStepColumns" :formData="ladderConfig" :columns="ladderStepColumns" :formData="ladderConfig"
@beforeSaveRecord = "(data) => onBeforeSaveRecord(data,'ladder',ladderIndex)"
@headerSelectChange="(data)=>onHeaderSelectChange(data,'ladder',ladderIndex)"
@beforeSaveRecord="(data) => onBeforeSaveRecord(data, 'ladder', ladderIndex)"
@headerSelectChange="(data) => onHeaderSelectChange(data, 'ladder', ladderIndex)"
:prefixKey="'ladder_' + ladderIndex" :fieldItemLabel="$t('template.common.jtpz')"> :prefixKey="'ladder_' + ladderIndex" :fieldItemLabel="$t('template.common.jtpz')">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion @printTag="(e) => printTag(e, 'ladderConfigs', ladderIndex)" <TableOpertaion @printTag="(e) => printTag(e, 'ladderConfigs', ladderIndex)"
@ -62,26 +65,27 @@
</div> </div>
<!-- 平行配制区域 --> <!-- 平行配制区域 -->
<div :label="$t('template.common.pxpz')"
v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs"
:key="'paralle_' + paralleConfig.id">
<div :label="$t('template.common.pxpz')"
v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs"
:key="'paralle_' + paralleConfig.id">
<div class="template-form-item"> <div class="template-form-item">
<div class="config-header"> <div class="config-header">
<div>{{ $t('template.common.pxpz') }}</div> <div>{{ $t('template.common.pxpz') }}</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('paralleConfigs', paralleConfig)">{{ $t('template.common.deleteBtn')
}}</el-button>
@click="deleteConfig('paralleConfigs', paralleConfig)">{{
$t('template.common.deleteBtn')
}}</el-button>
</div> </div>
<BaseInfoFormPackage @clickable="(e) => handleClickable('paralle', paralleIndex, e)" <BaseInfoFormPackage @clickable="(e) => handleClickable('paralle', paralleIndex, e)"
:ref="`paralleStepFormPackageRef_${paralleIndex}`" :formConfig="paralleStepFormConfig" :ref="`paralleStepFormPackageRef_${paralleIndex}`" :formConfig="paralleStepFormConfig"
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex" :formData="paralleConfig" :prefixKey="'paralle' + paralleIndex"
:fieldItemLabel="$t('template.common.pxpz')" /> :fieldItemLabel="$t('template.common.pxpz')" />
<CustomTable @blur="(e) => onHandleTableBlur('paralle', paralleIndex, e)" <CustomTable @blur="(e) => onHandleTableBlur('paralle', paralleIndex, e)"
:ref="`paralleStepTableRef_${paralleIndex}`" :showOperation="fillType === 'actFill' || fillType === 'preFill'"
:columns="paralleStepColumns"
@bodySelectChange = "bodySelectChange"
@headerSelectChange="(data)=>onHeaderSelectChange(data,'paralle',paralleIndex)"
:ref="`paralleStepTableRef_${paralleIndex}`"
:showOperation="fillType === 'actFill' || fillType === 'preFill'"
:columns="paralleStepColumns" @bodySelectChange="bodySelectChange"
@headerSelectChange="(data) => onHeaderSelectChange(data, 'paralle', paralleIndex)"
@beforeReagentSubmit="(data) => onTableBeforeReagentSubmit(data, paralleIndex, paralleConfig)" @beforeReagentSubmit="(data) => onTableBeforeReagentSubmit(data, paralleIndex, paralleConfig)"
@onRegentSubmit="(data) => onTableRegentSubmit('paralle', paralleIndex, data)" @onRegentSubmit="(data) => onTableRegentSubmit('paralle', paralleIndex, data)"
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex" :formData="paralleConfig" :prefixKey="'paralle' + paralleIndex"
@ -200,17 +204,18 @@ export default {
} }
}, },
methods: { methods: {
onBeforeSaveRecord(data,type,configIndex){
if(type === "ladder"){
onBeforeSaveRecord(data, type, configIndex) {
if (type === "ladder") {
const formFields = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFilledFormData(); const formFields = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFilledFormData();
this.onCommonVerifyNdException(formFields,data);
this.onCommonVerifyNdException(formFields, data);
} }
}, },
bodySelectChange(data){
this.paralleUpdateTargetStartSolutionVolume(data.item,data.headerSelectFields);
bodySelectChange(data) {
this.paralleUpdateTargetStartSolutionVolume(data.item, data.headerSelectFields);
}, },
// //
paralleUpdateTargetStartSolutionVolume(item,headerSelectFields){
paralleUpdateTargetStartSolutionVolume(item, headerSelectFields) {
const volumne = item.targetStartSolutionConcentration; const volumne = item.targetStartSolutionConcentration;
const subTargetStartSolution = item.targetStartSolutionConcentrationPrecision; const subTargetStartSolution = item.targetStartSolutionConcentrationPrecision;
const params = { const params = {
@ -218,42 +223,42 @@ export default {
subTargetStartSolution subTargetStartSolution
} }
if (volumne) { if (volumne) {
this.updateTargetStartSolutionVolume(item, volumne,params);
this.updateTargetStartSolutionVolume(item, volumne, params);
} }
}, },
onHandleBlur(e,type,configIndex){
const {targetStartSolution,subTargetStartSolution} = e;
const {stepTableFormData,headerSelectFields} = this.$refs[`ladderStepTableRef_${configIndex}`][0]?.getFilledFormData();
onHandleBlur(e, type, configIndex) {
const { targetStartSolution, subTargetStartSolution } = e;
const { stepTableFormData, headerSelectFields } = this.$refs[`ladderStepTableRef_${configIndex}`][0]?.getFilledFormData();
const params = { const params = {
subTargetStartSolution, subTargetStartSolution,
headerSelectFields headerSelectFields
} }
this.batchUpdateTargetStartSolutionVolume(stepTableFormData,targetStartSolution,params)
this.batchUpdateTargetStartSolutionVolume(stepTableFormData, targetStartSolution, params)
}, },
//table header //table header
onHeaderSelectChange(data,type,configIndex){
const {key, headerSelectFields,dataSource=[]} = data;
onHeaderSelectChange(data, type, configIndex) {
const { key, headerSelectFields, dataSource = [] } = data;
const keys = [ const keys = [
'targetStartSolutionVolumeUnit', 'targetStartSolutionVolumeUnit',
'targetDiluentVolumeUnit', 'targetDiluentVolumeUnit',
'targetSolutionConcentrationUnit', 'targetSolutionConcentrationUnit',
'targetSolutionVolumeUnit', 'targetSolutionVolumeUnit',
] ]
console.log(key,"key")
if(keys.includes(key)){
if(type === 'ladder'){
const {targetStartSolution,subTargetStartSolution} = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFilledFormData();
console.log(key, "key")
if (keys.includes(key)) {
if (type === 'ladder') {
const { targetStartSolution, subTargetStartSolution } = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFilledFormData();
const params = { const params = {
subTargetStartSolution, subTargetStartSolution,
headerSelectFields headerSelectFields
} }
this.batchUpdateTargetStartSolutionVolume(dataSource,targetStartSolution,params)
}else{
this.batchUpdateTargetStartSolutionVolume(dataSource, targetStartSolution, params)
} else {
dataSource.forEach(item => { dataSource.forEach(item => {
this.paralleUpdateTargetStartSolutionVolume(item,headerSelectFields);
this.paralleUpdateTargetStartSolutionVolume(item, headerSelectFields);
}) })
} }
} }
}, },
// //
@ -263,7 +268,7 @@ export default {
if (fzList && fzList.length > 0) { if (fzList && fzList.length > 0) {
const list = fzList.map((item) => { const list = fzList.map((item) => {
return { return {
bh: mybh +item.preCode + item.subCode,
bh: mybh + item.preCode + item.subCode,
kc: item.num, kc: item.num,
kcdw: dw, kcdw: dw,
} }
@ -461,45 +466,45 @@ export default {
} }
} }
}, },
getLadderNdParamsByIndex(configIndex){
getLadderNdParamsByIndex(configIndex) {
const { headerSelectFields = [] } = this.$refs[`ladderStepTableRef_${configIndex}`][0].getFilledFormData(); const { headerSelectFields = [] } = this.$refs[`ladderStepTableRef_${configIndex}`][0].getFilledFormData();
const subTargetAcSolutionUnit = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFormDataByKey("subTargetAcSolutionUnit");// const subTargetAcSolutionUnit = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFormDataByKey("subTargetAcSolutionUnit");//
return { return {
targetStartSolutionUnit:subTargetAcSolutionUnit,
targetStartSolutionUnit: subTargetAcSolutionUnit,
headerSelectFields headerSelectFields
} }
}, },
getParalleNdParamsByIndex(item,configIndex){
getParalleNdParamsByIndex(item, configIndex) {
const { headerSelectFields = [] } = this.$refs[`paralleStepTableRef_${configIndex}`][0].getFilledFormData(); const { headerSelectFields = [] } = this.$refs[`paralleStepTableRef_${configIndex}`][0].getFilledFormData();
const subTargetAcSolutionUnit = item.subTargetAcSolutionUnit || "";// const subTargetAcSolutionUnit = item.subTargetAcSolutionUnit || "";//
return { return {
targetStartSolutionUnit:subTargetAcSolutionUnit,
targetStartSolutionUnit: subTargetAcSolutionUnit,
headerSelectFields headerSelectFields
} }
}, },
// //
onHandleTableBlur(type, configIndex, e) { onHandleTableBlur(type, configIndex, e) {
const { colKey = "", item, rowIndex,headerSelectFields } = e;
const { colKey = "", item, rowIndex, headerSelectFields } = e;
if (colKey === "targetStartSolutionConcentration" || colKey === "targetSolutionVolume" || colKey === "targetSolutionConcentration" || colKey === "targetStartSolutionVolumePrecision" || colKey === "targetDiluentVolumePrecision") { if (colKey === "targetStartSolutionConcentration" || colKey === "targetSolutionVolume" || colKey === "targetSolutionConcentration" || colKey === "targetStartSolutionVolumePrecision" || colKey === "targetDiluentVolumePrecision") {
if (type === "ladder") { if (type === "ladder") {
const {targetStartSolution,subTargetStartSolution} = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFilledFormData();
const { targetStartSolution, subTargetStartSolution } = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFilledFormData();
const params = { const params = {
subTargetStartSolution, subTargetStartSolution,
headerSelectFields headerSelectFields
} }
if (targetStartSolution) { if (targetStartSolution) {
this.updateTargetStartSolutionVolume(item, targetStartSolution,params);
this.updateTargetStartSolutionVolume(item, targetStartSolution, params);
} }
} else if (type === "paralle") { } else if (type === "paralle") {
this.paralleUpdateTargetStartSolutionVolume(item,headerSelectFields);
this.paralleUpdateTargetStartSolutionVolume(item, headerSelectFields);
} }
} else if (colKey === "actStartSolutionVolume" || colKey === "actDiluentVolume") {// } else if (colKey === "actStartSolutionVolume" || colKey === "actDiluentVolume") {//
if (type === "ladder") { if (type === "ladder") {
const targetAcSolution = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFormDataByKey("targetAcSolution");// const targetAcSolution = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFormDataByKey("targetAcSolution");//
const params = this.getLadderNdParamsByIndex(configIndex); const params = this.getLadderNdParamsByIndex(configIndex);
if (targetAcSolution) { if (targetAcSolution) {
const volResult = this.updateSjmbrynd(item, targetAcSolution,params);
const volResult = this.updateSjmbrynd(item, targetAcSolution, params);
if (!volResult) { if (!volResult) {
return return
} }
@ -510,9 +515,9 @@ export default {
} }
} else if (type === "paralle") { } else if (type === "paralle") {
const targetAcSolution = item.targetAcSolution || 0;// const targetAcSolution = item.targetAcSolution || 0;//
const params = this.getParalleNdParamsByIndex(item,configIndex);
const params = this.getParalleNdParamsByIndex(item, configIndex);
if (targetAcSolution) { if (targetAcSolution) {
const volResult = this.updateSjmbrynd(item, targetAcSolution,params);
const volResult = this.updateSjmbrynd(item, targetAcSolution, params);
if (!volResult) { if (!volResult) {
return return
} }
@ -526,9 +531,9 @@ export default {
} }
}, },
onTableBeforeReagentSubmit(data){
const {selectData, callback, key, rowData} = data;
if(key === "actStartSolutionCode" && !isCommonUnit(selectData.row.nddw,[rowData.targetStartSolutionConcentrationPrecision])){//table
onTableBeforeReagentSubmit(data) {
const { selectData, callback, key, rowData } = data;
if (key === "actStartSolutionCode" && !isCommonUnit(selectData.row.nddw, [rowData.targetStartSolutionConcentrationPrecision])) {//table
callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。'); callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。');
} }
}, },
@ -538,9 +543,9 @@ export default {
const { row, selectedId } = selectInfo; const { row, selectedId } = selectInfo;
if (key === "actStartSolutionCode") {// if (key === "actStartSolutionCode") {//
const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`][0]; const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`][0];
const params = this.getParalleNdParamsByIndex(rowData,configIndex);
const params = this.getParalleNdParamsByIndex(rowData, configIndex);
if (tableRef) { if (tableRef) {
const volResult = this.updateSjmbrynd(rowData, row.nd,params);
const volResult = this.updateSjmbrynd(rowData, row.nd, params);
//code //code
tableRef.updateDataSourceByRowIndex(rowIndex, { tableRef.updateDataSourceByRowIndex(rowIndex, {
actStartSolutionCode: selectedId, actStartSolutionCode: selectedId,
@ -597,7 +602,7 @@ export default {
item.startSolutionCode = newData[index - 1].targetSolutionCode + newData[index - 1].subTargetSolutionCode; item.startSolutionCode = newData[index - 1].targetSolutionCode + newData[index - 1].subTargetSolutionCode;
initNd = newData[index - 1].actSolutionConcentration; initNd = newData[index - 1].actSolutionConcentration;
} }
const volResult = this.updateSjmbrynd(item, initNd,params);
const volResult = this.updateSjmbrynd(item, initNd, params);
if (!volResult) { if (!volResult) {
return return
} }
@ -691,23 +696,23 @@ export default {
return false; return false;
} }
let content = this.getFilledFormData(); let content = this.getFilledFormData();
if(content){
const {ladderConfigs = [], paralleConfigs = []} = content;
if(ladderConfigs.length > 0){
const ladderConUnitDiff = ladderConfigs.every(item => isCommonUnit(item.subTargetStartSolution,[item.headerSelectFields.actSolutionConcentrationUnit, item.headerSelectFields.targetSolutionConcentrationUnit]));
if(!ladderConUnitDiff){
if (content) {
const { ladderConfigs = [], paralleConfigs = [] } = content;
if (ladderConfigs.length > 0) {
const ladderConUnitDiff = ladderConfigs.every(item => isCommonUnit(item.subTargetStartSolution, [item.headerSelectFields.actSolutionConcentrationUnit, item.headerSelectFields.targetSolutionConcentrationUnit]));
if (!ladderConUnitDiff) {
this.$message.error("起始浓度单位与目标浓度单位不符,请重新选择!"); this.$message.error("起始浓度单位与目标浓度单位不符,请重新选择!");
return false; return false;
} }
} }
if(paralleConfigs.length > 0){
if (paralleConfigs.length > 0) {
const paralleConUnitDiff = paralleConfigs.every(item => { const paralleConUnitDiff = paralleConfigs.every(item => {
const {stepTableFormData = [],headerSelectFields = {}} =item;
const { stepTableFormData = [], headerSelectFields = {} } = item;
const conUnits = stepTableFormData.map(item => item.targetStartSolutionConcentrationPrecision); const conUnits = stepTableFormData.map(item => item.targetStartSolutionConcentrationPrecision);
const {actSolutionConcentrationUnit,targetSolutionConcentrationUnit} = headerSelectFields;
return isCommonUnit(actSolutionConcentrationUnit,[...conUnits,targetSolutionConcentrationUnit]);
const { actSolutionConcentrationUnit, targetSolutionConcentrationUnit } = headerSelectFields;
return isCommonUnit(actSolutionConcentrationUnit, [...conUnits, targetSolutionConcentrationUnit]);
}); });
if(!paralleConUnitDiff){
if (!paralleConUnitDiff) {
this.$message.error("起始浓度单位与目标浓度单位不符,请重新选择!"); this.$message.error("起始浓度单位与目标浓度单位不符,请重新选择!");
return false; return false;
} }

Loading…
Cancel
Save