Browse Source

fix:[模板管理]供试品002

lkf
15881625488@163.com 2 months ago
parent
commit
41b7a6900f
5 changed files with 572 additions and 174 deletions
  1. +0
    -1
      src/views/business/comps/template/comps/gsp/DMYPPZJLB.vue
  2. +572
    -170
      src/views/business/comps/template/comps/gsp/GSP002.vue
  3. +0
    -1
      src/views/business/comps/template/comps/gsp/GSP003.vue
  4. +0
    -1
      src/views/business/comps/template/comps/gsp/GSP010.vue
  5. +0
    -1
      src/views/business/comps/template/comps/sp/SP00456.vue

+ 0
- 1
src/views/business/comps/template/comps/gsp/DMYPPZJLB.vue View File

@ -403,7 +403,6 @@ export default {
const stepResource = this.getStepResource() const stepResource = this.getStepResource()
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || []) this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || [] this.yqResourceTmp = stepResource.yqResource || []
debugger
return this.resourceTmp; return this.resourceTmp;
}, },
//使 //使

+ 572
- 170
src/views/business/comps/template/comps/gsp/GSP002.vue View File

@ -9,50 +9,49 @@
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" <BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo"
ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" /> ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" /> <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.wzInfo" :columns="sywzColumns" :dataSource="resourceWz" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" /> <TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<LineLabel label="template.common.operationSteps" /> <LineLabel label="template.common.operationSteps" />
<!-- 平行配制区域 -->
<div :label="$t('template.common.pxpz')" <div :label="$t('template.common.pxpz')"
v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs" v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs"
:key="'paralle_' + paralleIndex"> :key="'paralle_' + paralleIndex">
<div class="template-form-item"> <div class="template-form-item">
<div class="config-header-end" v-if="fillType === 'preFill'">
<el-button type="primary" @click="handleAddParalle(false)">{{
$t('template.lba.lba004.xz')}}</el-button>
<el-button type="danger" plain @click="deleteParalleConfig(paralleIndex)">{{
$t('template.lba.lba004.sc')}}</el-button>
<div class="config-header-right">
<el-button type="primary" v-if="fillType === 'preFill'" @click="handleAddParalle">{{
$t('template.common.addBtn') }}</el-button>
<el-button v-if="fillType === 'preFill' && formData.paralleConfigs.length > 1"
type="danger" @click="deleteParalleConfig(paralleIndex)">{{
$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.lba.lba004.xszj')" />
<!-- <CustomTable @blur="(e) => onHandleTableBlur('paralle', paralleIndex, e)"
:ref="`paralleStepTableRef_${paralleIndex}`" :showOperation="fillType === 'actFill' || fillType === 'preFill'"
:fieldItemLabel="$t('template.common.pxpz')" />
<CustomTable @blur="(e) => onHandleTableBlur('paralle', paralleIndex, e)"
:ref="`paralleStepTableRef_${paralleIndex}`"
:showOperation="fillType === 'actFill' || fillType === 'preFill'"
:columns="paralleStepColumns" :columns="paralleStepColumns"
@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"
:fieldItemLabel="$t('template.lba.lba004.xszj')">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="(rowIndex) => deleteRow(rowIndex, 'paralle', paralleIndex)" ></TableOpertaionDelete>
</template>
</CustomTable> -->
<CustomTable :ref="`paralleStepTableRef_${paralleIndex}`"
:showOperation="fillType === 'preFill'" :columns="paralleStepColumns"
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex"
:fieldItemLabel="$t('template.lba.lba004.xszj')">
:fieldItemLabel="$t('template.common.pxpz')">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns"
<TableOpertaion @printTag="(e) => printTag(e, 'paralleConfigs', paralleIndex)"
@startConfig="(val) => startConfig(val, 'paralleConfigs', paralleIndex)"
@configComplete="(val) => configComplete(val, 'paralleConfigs', paralleIndex)"
@subPackageSubmit="(val) => subPackageSubmit(val, 'paralleConfigs', paralleIndex)"
:fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex, 'paralle', paralleIndex)"> @deleteRow="(rowIndex) => deleteRow(rowIndex, 'paralle', paralleIndex)">
</TableOpertaionDelete>
</TableOpertaion>
</template> </template>
</CustomTable> </CustomTable>
<Step class="mt-0 s-container" :ref="`paralleStepRef_${paralleIndex}`" <Step class="mt-0 s-container" :ref="`paralleStepRef_${paralleIndex}`"
:formData="paralleConfig.paralleStepData"
:fieldItemLabel="$t('template.lba.lba004.xszj')" :prefixKey="'paralle' + paralleIndex">
</Step>
:formData="paralleConfig.paralleStepData" :fieldItemLabel="$t('template.common.pxpz')"
:prefixKey="'paralle' + paralleIndex"></Step>
</div> </div>
</div> </div>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" <BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
@ -64,54 +63,52 @@
</template> </template>
<script> <script>
import { EventBus } from "@/utils/eventBus";
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage"; import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import LineLabel from "@/components/Template/LineLabel"; import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table"; import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step"; import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin";
import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es';
import templateMixin from "../../mixins/templateMixin.js";
import CustomTable from '@/components/Template/CustomTable.vue'; import CustomTable from '@/components/Template/CustomTable.vue';
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue";
import { getExpireDate, duplicateResource } from "@/utils/index.js";
import { isCommonUnit } from "@/utils/conTools";
import moment from "moment";
import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools";
export default { export default {
name: "GSP002", name: "GSP002",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaionDelete },
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion },
mixins: [templateMixin], mixins: [templateMixin],
props: { props: {
fillType: { fillType: {
type: String, type: String,
default: 'preFill', default: 'preFill',
}, },
sn: {
type: String,
default: '',
},
}, },
computed: {
//
jcbColumns() {
return [{
label: 'template.lba.lba002.jcbmc',
prop: 'jcb',
bodyType: 'input',
bodyFillType: 'preFill',
width: 280,
}, {
label: '',
prop: 'jcbBh',
bodyType: 'jcb',
bodyFillType: 'actFill',
width: 280
}]
watch: {
fillType: {
immediate: true,
handler(v) {
console.log(v, "fillType")
}
}, },
},
computed: {
// //
remarkConig() { remarkConig() {
return [ return [
{ {
type: "cellItem",
type: 'cellItem',
config: { config: {
remark: { remark: {
label: "",
type: "textarea",
fillType: "actFill",
label: '',
type: 'textarea',
fillType: 'actFill',
span: 1, span: 1,
placeholder: 'template.common.remarkPlaceholder', placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000, maxlength: 1000,
@ -119,102 +116,116 @@ export default {
} }
} }
} }
]
];
}, },
// //
baseInfoFormConfig() { baseInfoFormConfig() {
return [ return [
{ {
type: "cardItem",
type: 'cardItem',
config: { config: {
studyMc: { studyMc: {
label: 'template.common.testName', label: 'template.common.testName',
type: "input",
disabled: true,
type: 'input',
disabled: true
}, },
studySn: { studySn: {
label: 'template.common.testNumber', label: 'template.common.testNumber',
type: "input",
disabled: true,
type: 'input',
disabled: true
}, },
methodCode: { methodCode: {
label: 'template.common.methodCode', label: 'template.common.methodCode',
type: "input",
fillType: "preFill",
type: 'input',
fillType: 'preFill',
maxlength: 50 maxlength: 50
}, },
versionNum: { versionNum: {
label: 'template.common.versionNumber', label: 'template.common.versionNumber',
type: "inputNumber",
fillType: "actFill",
prepend: "V",
type: 'inputNumber',
fillType: 'actFill',
prepend: 'V',
maxlength: 50 maxlength: 50
},
}
} }
}, },
{ {
type: "conditionItem",
label: 'template.lba.lba002.cztj',
type: 'conditionItem',
label: 'template.common.testConfigurationConditions',
config: { config: {
pre: { pre: {
label: 'template.common.preFill', label: 'template.common.preFill',
type: "select",
type: 'select',
multiple: true, multiple: true,
fillType: "preFill",
fillType: 'preFill',
options: this.getDictOptions('business_pztj'), options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
otherCode: 'preOther'
}, },
act: { act: {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select",
fillType: "actFill",
otherCode: "actOther",
type: 'select',
fillType: 'actFill',
otherCode: 'actOther',
multiple: true, multiple: true,
compareTo: "pre",
options: this.getDictOptions('business_pztj')
options: this.getDictOptions('business_pztj'),
compareTo: 'pre'
} }
} }
}, },
{ {
type: "cellItem",
label: 'template.lba.lba002.czsj',
type: 'conditionItem',
label: 'template.sp.sp00456.rqcz',
config: {
containerMaterial: {
label: 'template.sp.sp00456.rqcz',
type: 'select',
options: this.getDictOptions('business_rqcz'),
fillType: 'actFill',
multiple: true,
otherCode: 'containerMaterialOther'
}
}
},
{
type: 'cellItem',
label: 'template.common.configurationTime',
config: { config: {
startDate: { startDate: {
label: 'template.common.startTime', label: 'template.common.startTime',
type: "input",
type: 'input'
}, },
endDate: { endDate: {
label: 'template.common.endTime', label: 'template.common.endTime',
type: "input",
},
type: 'input'
}
} }
} }
]
];
}, },
paralleStepFormConfig() { paralleStepFormConfig() {
return [ return [
{ {
type: 'step', type: 'step',
config: { config: {
jz: {
label: 'template.gsp.GSP002.xsy',
solution: {
label: 'template.sp.sp00456.xsy',
type: 'input', type: 'input',
fillType: 'preFill', fillType: 'preFill',
subType: 'sj', subType: 'sj',
subKey: 'jzCode',
subKey: 'subSolution',
subFillType: 'actFill', subFillType: 'actFill',
maxlength: 20 maxlength: 20
}, },
storageCondition: {
label: 'template.common.storageConditionLabel',
type: "select",
fillType: "preFill",
options: this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
paralleStepStorageCondition: {
label: 'template.sp.sp00456.cctj',
type: 'select',
fillType: 'preFill',
options: this.getDictOptions('business_cctj'),
otherCode: 'paralleStepStorageConditionOther'
}
} }
} }
]
];
}, },
paralleStepColumns() { paralleStepColumns() {
return [ return [
@ -432,25 +443,341 @@ export default {
copyFrom: "targetDiluentVolume", copyFrom: "targetDiluentVolume",
compareTo: 'targetDiluentVolume' // compareTo: 'targetDiluentVolume' //
} }
]
}
];
},
}, },
data() { data() {
return { return {
formData: {}
subSolutionVisible: false,
currentSubKey: "",//key
currentType: "",//
currentRowIndex: "",//
dataSource: [],
currentTableIndex: "",//
currentTableKey: "",//key
targetAcSolutionFromTable: true,//
currentRowData: {},//
}; };
}, },
mounted() { mounted() {
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
setTimeout(() => {
this.handleUpdateCode(formData);
}, 0);
}
if (this.fillType === "preFill") { if (this.fillType === "preFill") {
this.handleAddParalle(true);
if (!this.formData.paralleConfigs) {
this.handleAddParalle()
}
} }
}, },
methods: { methods: {
//
//
subPackageSubmit(data, configType, index) {
const { fzsj, rowData, headerSelectFields } = data;
const { fzList = [], dw = "", mybh } = fzsj;
if (fzList && fzList.length > 0) {
const list = fzList.map((item) => {
return {
bh: mybh + item.preCode + item.subCode,
kc: item.num,
kcdw: dw,
}
})
let postData = {
studyId: this.formData.studyId,
studyFormId: this.formData.id,
bh: mybh,
nd: rowData.actSolutionConcentration || 0,
nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
list: list
}
this.subPackageRequest(postData);
}
},
startConfig(val) {
const { rowData } = val;
console.log(rowData, "rowData")
let postData = {
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
studySubjectId: this.formData.studySubjectId,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
}
this.startConfigRequest(postData);
},
configComplete(val) {
const { rowData, headerSelectFields } = val;
//(+)
const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit])
debugger
let postData = {
mc: null,
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
nd: rowData.actSolutionConcentration,//
nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
kc: total,
kcdw: unit,
}
this.configCompleteRequest(postData);
},
//
printTag(e, configType, index) {
const { nickName, name } = this.$store.getters;
const { printCode, row, type } = e;
const currentForm = this.formData[configType][index];
const { stepStorageCondition, startDate, expireDate, paralleStepStorageCondition } = currentForm;
const targetSolutionExpirationDate = row.targetSolutionExpirationDate;
const lang = this.$i18n.locale;
const printConfig = {
"品名": "暂时还不知道品名是哪个字段",
"存储条件": stepStorageCondition || paralleStepStorageCondition,
"配制日期": moment(startDate).format("YYYY-MM-DD"),
"有效期至": moment(targetSolutionExpirationDate || expireDate).format("YYYY-MM-DD HH:mm"),
"配置者": lang === "zh_CN" ? nickName : name,
//type==="subPackage"
//type==="row"
"编号": type === "subPackage" ? printCode : (row.targetSolutionCode + row.subTargetSolutionCode),
}
console.log(printConfig, "printConfig")
EventBus.$emit('showTagPrintDialog', { printConfig })
},
//
async assignNumbersToTableData(config) {
return new Promise(async (resolve, reject) => {
const configs = this.formData[config]
const { startDate } = this.formData;
// paralleConfigsparalleTableFormData
if (configs && configs.length > 0) {
for (let i = 0; i < configs.length; i++) {
const ref = `paralleStepTableRef_${i}`;
const { stepTableFormData = [], effectivePeriod, effectivePeriodUnit, expireDate } = configs[i];
if (!expireDate && config === "ladderConfigs") {
const date = getExpireDate(startDate, effectivePeriod, effectivePeriodUnit);
configs[i].expireDate = date;
}
if (stepTableFormData && stepTableFormData.length > 0) {
const tableDataArray = stepTableFormData;
// subTargetSolutionCode
const hasAnyWithValue = tableDataArray.some(row =>
row.subTargetSolutionCode && row.subTargetSolutionCode.trim() !== '');
//
if (!hasAnyWithValue) {
const codes = stepTableFormData.map((item) => ({ prex: item.targetSolutionCode, type: 1 }));
const snList = await this.getLatestSnArr(codes);
tableDataArray.forEach((row, idx) => {
let expDate = {};
if (config === "paralleConfigs" && !row.targetSolutionExpirationDate) {
let date = getExpireDate(startDate, row.targetSolutionCycle, row.targetSolutionCyclePrecision);
expDate = {
targetSolutionExpirationDate: date
}
}
this.$refs[ref][0]?.updateDataSourceByRowIndex(idx, { subTargetSolutionCode: snList[idx], ...expDate });
});
resolve()
} else {
reject()
}
}
}
}
})
},
async handleUpdateCode() {
Promise.all([this.assignNumbersToTableData("ladderConfigs"), this.assignNumbersToTableData("paralleConfigs")
]).then(() => {
//
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
EventBus.$emit('onModifyRecord', params,)
})
},
//
handleAddParalle() {
//
if (!this.formData.paralleConfigs) {
this.$set(this.formData, 'paralleConfigs', []);
}
//
this.formData.paralleConfigs.push({
paralleStepData: [],
paralleTableFormData: [],
showParalleConfig: true
});
},
//
handleAddLadder() {
//
if (!this.formData.ladderConfigs) {
this.$set(this.formData, 'ladderConfigs', []);
}
//
this.formData.ladderConfigs.push({
ladderStepData: [],
ladderTableFormData: [],
showLadderConfig: true
});
},
//
deleteLadderConfig(index) {
this.formData.ladderConfigs.splice(index, 1);
},
//
deleteParalleConfig(index) {
this.formData.paralleConfigs.splice(index, 1);
},
//
handleAddRow(type, rowIndex, configIndex = 0) {
const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`];
if (tableRef && tableRef[0].addRow) {
tableRef[0].addRow({});
}
},
//
deleteRow(rowIndex, type, configIndex = 0) {
//
const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`];
if (tableRef) {
tableRef[0].deleteRow(rowIndex);
}
},
//
onHandleTableBlur(type, configIndex, e) {
const { colKey = "", item, rowIndex } = e;
debugger
if (colKey === "targetStartSolutionConcentration" || colKey === "targetSolutionVolume" || colKey === "targetSolutionConcentration" || colKey === "targetStartSolutionVolumePrecision" || colKey === "targetDiluentVolumePrecision") {
if (type === "paralle") {
const volumne = item.targetStartSolutionConcentration || 0;
if (volumne) {
this.updateTargetStartSolutionVolume(item, volumne);
}
}
} else if (colKey === "actStartSolutionVolume" || colKey === "actDiluentVolume") {//
if (type === "paralle") {
const targetAcSolution = item.targetAcSolution || 0;//
if (targetAcSolution) {
const volResult = this.updateSjmbrynd(item, targetAcSolution);
if (!volResult) {
return
}
this.$refs[`paralleStepTableRef_${configIndex}`][0]?.updateDataSourceByRowIndex(rowIndex, {
actSolutionVolume: volResult.actVol,
actSolutionConcentration: volResult.actNd,
});
}
}
}
},
onTableBeforeReagentSubmit(data) {
const { selectData, callback, key, rowData } = data;
if (key === "actStartSolutionCode" && !isCommonUnit(selectData.row.nddw, [rowData.targetStartSolutionConcentrationPrecision])) {//table
callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。');
}
},
// table
onTableRegentSubmit(type, configIndex, data) {
const { selectInfo, rowIndex, key, rowData } = data;
const { row, selectedId } = selectInfo;
if (key === "actStartSolutionCode") {//
const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`][0];
if (tableRef) {
const volResult = this.updateSjmbrynd(rowData, row.nd);
//code
tableRef.updateDataSourceByRowIndex(rowIndex, {
actStartSolutionCode: selectedId,
targetAcSolution: row.nd,
})
if (!volResult) {
return
}
tableRef.updateDataSourceByRowIndex(rowIndex, {
actSolutionVolume: volResult.actVol,
actSolutionConcentration: volResult.actNd,
})
}
}
},
//
onRegentSubmit(type, rowIndex, data) {
const { selectInfo, key } = data;
const { row } = selectInfo;
if (key) {
const packageRef = this.$refs[`paralleStepFormPackageRef_${rowIndex}`][0];
if (key === "subStartSolution") {
packageRef.updateFormData("targetAcSolution", row.nd);
packageRef.onValueChangeCompareTo("targetAcSolution", row.nd, "targetStartSolution");
this.updateTableNd(row, rowIndex);
}
}
},
updateRecord() {
this.$nextTick(() => {
EventBus.$emit('onModifyRecord', {
type: "fieldChanged",
newRecord: null,
resourceList: null,
},)
})
},
//table
updateTableNd(row, rowIndex) {
const { stepTableFormData = [] } = this.$refs[`ladderStepTableRef_${rowIndex}`][0].getFilledFormData();
const newData = JSON.parse(JSON.stringify(stepTableFormData));
//
newData.forEach((item, index) => {
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) {
return
}
item.actSolutionVolume = volResult.actVol;
item.actSolutionConcentration = volResult.actNd;
// stepTableRef
})
this.$refs[`ladderStepTableRef_${rowIndex}`][0].updateDataSource(newData);
},
//
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}`);
refsToValidate.push(`paralleStepTableRef_${i}`);
refsToValidate.push(`paralleStepRef_${i}`);
}
}
return await this.validFormFields(refsToValidate);
},
getFilledFormData() { getFilledFormData() {
const baseData = this.$refs.baseInfoRef.getFilledFormData(); const baseData = this.$refs.baseInfoRef.getFilledFormData();
const fjData = this.$refs.fjRef.getFilledFormData();
const remarkData = this.$refs.remarkRef.getFilledFormData();
// //
const paralleConfigsData = []; const paralleConfigsData = [];
@ -468,14 +795,14 @@ export default {
}); });
} }
} }
const remarkData = this.$refs.remarkRef.getFilledFormData();
return { return {
...baseData, ...baseData,
...fjData,
...remarkData,
paralleConfigs: paralleConfigsData, paralleConfigs: paralleConfigsData,
...remarkData
} }
}, },
//
async getFormData() { async getFormData() {
// //
const validFlag = await this.validFields(); const validFlag = await this.validFields();
@ -483,85 +810,129 @@ export default {
return false; return false;
} }
let content = this.getFilledFormData(); let content = this.getFilledFormData();
return content
},
//
async validFields() {
//
let refsToValidate = ["baseInfoRef", "jcbRef", "fjRef", "remarkRef"];
//
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) {
for (let i = 0; i < this.formData.paralleConfigs.length; i++) {
refsToValidate.push(`paralleStepFormPackageRef_${i}`);
refsToValidate.push(`paralleStepTableRef_${i}`);
refsToValidate.push(`paralleStepRef_${i}`);
if (content) {
const { paralleConfigs = [] } = content;
if (paralleConfigs.length > 0) {
const paralleConUnitDiff = paralleConfigs.every(item => {
const { stepTableFormData = [], headerSelectFields = {} } = item;
const conUnits = stepTableFormData.map(item => item.targetStartSolutionConcentrationPrecision);
const { actSolutionConcentrationUnit, targetSolutionConcentrationUnit } = headerSelectFields;
return isCommonUnit(actSolutionConcentrationUnit, [...conUnits, targetSolutionConcentrationUnit]);
});
if (!paralleConUnitDiff) {
this.$message.error("起始浓度单位与目标浓度单位不符,请重新选择!");
return false;
}
} }
} }
return await this.validFormFields(refsToValidate);
return content;
}, },
getResource() { getResource() {
let content = this.getFilledFormData(); let content = this.getFilledFormData();
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp = stepResource.sjResource || []
this.yqResourceTmp = stepResource.yqResource || []
return this.resourceTmp;
},
//
async onSave() {
const formData = this.getStepResource();
console.log(formData, "formData")
},
//
handleAddParalle(init) {
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', []);
//resource
let tmpResource = []
if (this.fillType === "actFill") {
//
if (content.paralleConfigs && content.paralleConfigs.length > 0) {
for (let i = 0; i < content.paralleConfigs.length; i++) {
let paralleConfigs = content.paralleConfigs[i]
let stepTableFormData = paralleConfigs.stepTableFormData
for (let j = 0; j < stepTableFormData.length; j++) {
//
let fzTotal = 0//
let fzsj = stepTableFormData[j].fzsj
if (fzsj && fzsj.fzList) {
for (let k = 0; k < fzsj.fzList.length; k++) {
let fzItem = fzsj.fzList[k]
tmpResource.push({
mc: null,
bh: fzsj.mybh + fzItem.preCode + fzItem.subCode,
ph: null,
ndz: stepTableFormData[j].actSolutionConcentration + paralleConfigs.headerSelectFields.actSolutionConcentrationUnit,
nd: stepTableFormData[j].actSolutionConcentration,
nddw: paralleConfigs.headerSelectFields.actSolutionConcentrationUnit,
ly: 'ELN配制',
sxrq: paralleConfigs.expireDate,
kc: fzItem.num,
kcdw: fzsj.dw,
type: null,
elnType: this.product,
syl: null,
syldw: paralleConfigs.headerSelectFields.actSolutionVolumeUnit,
yxzq: paralleConfigs.effectivePeriod,
yxzqdw: paralleConfigs.effectivePeriodUnit,
})
fzTotal = addDecimals(fzTotal, fzItem.num)
}
}
//
const { total, unit } = addTj([stepTableFormData[j].actSolutionVolume, stepTableFormData[j].actDiluentVolume], [paralleConfigs.headerSelectFields.actSolutionVolumeUnit, paralleConfigs.headerSelectFields.actDiluentVolumeUnit])
tmpResource.push({
mc: null,
bh: stepTableFormData[j].targetSolutionCode + stepTableFormData[j].subTargetSolutionCode,
ph: null,
nd: stepTableFormData[j].actSolutionConcentration,
ndz: stepTableFormData[j].actSolutionConcentration + paralleConfigs.headerSelectFields.actSolutionConcentrationUnit,
nddw: paralleConfigs.headerSelectFields.actSolutionConcentrationUnit,
ly: 'ELN配制',
sxrq: stepTableFormData[j].targetSolutionExpirationDate,
kc: total,
kcdw: unit,
type: null,
elnType: this.product,
syl: fzTotal > 0 ? fzTotal : null,
syldw: fzTotal > 0 ? fzsj.dw : unit,
yxzq: stepTableFormData[j].targetSolutionCycle,
yxzqdw: stepTableFormData[j].targetSolutionCyclePrecision,
})
//
tmpResource.push({
mc: null,
bh: paralleConfigs.subSolution,
ph: null,
nd: null,
nddw: null,
ndz: null,
ly: null,
sxrq: null,
kc: null,
kcdw: null,
type: 1,
syl: stepTableFormData[j].actDiluentVolume,
syldw: paralleConfigs.headerSelectFields.actDiluentVolumeUnit,
yxzq: null,
yxzqdw: null,
})
}
}
} }
//
this.formData.paralleConfigs.push({
paralleStepData: [],
paralleTableFormData: [],
showParalleConfig: true
});
}
},
//
deleteParalleConfig(index) {
if (this.formData.paralleConfigs.length === 1) {
// this.$message.error("1");
return;
} }
this.formData.paralleConfigs.splice(index, 1);
},
deleteJcbRow(rowIndex) {
const jcbRef = this.$refs['jcbRef'];
if (jcbRef) {
jcbRef.deleteRow(rowIndex);
if (tmpResource.length > 0) {
tmpResource = uniqeResourceOne(tmpResource)
} }
//使
const stepResource = this.getStepResource()
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || []
return this.resourceTmp;
}, },
//
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);
getStepResource() {
const sjResource = [], yqResource = [];
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) {
for (let i = 0; i < this.formData.paralleConfigs.length; i++) {
const paralleResource = this.$refs[`paralleStepRef_${i}`][0].getStepResource();
sjResource.push(...paralleResource.sjResource);
yqResource.push(...paralleResource.yqResource);
} }
} }
//
const { sj, yq } = duplicateResource(sjResource, yqResource)
return { sjResource: sj, yqResource: yq };
}, },
async onSave() {
const formData = this.getStepResource();
console.log(formData, "formData")
}
} }
}; };
</script> </script>
@ -570,17 +941,48 @@ export default {
margin-top: 20px; margin-top: 20px;
} }
.print-btn {
.config-section {
margin-bottom: 20px; margin-bottom: 20px;
padding: 15px;
border: 1px solid #ebeef5;
border-radius: 4px;
background-color: #fafafa;
} }
.config-header-end {
.config-header {
display: flex; display: flex;
justify-content: flex-end;
justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 15px; margin-bottom: 15px;
font-weight: bold; font-weight: bold;
font-size: 16px; font-size: 16px;
color: #303133; color: #303133;
} }
.config-header .el-button {
color: #f56c6c;
font-size: 14px;
}
.config-header .el-button:hover {
color: #f78989;
}
.mt-0 {
margin-top: 0;
}
.config-header-right {
margin-bottom: 15px;
font-weight: bold;
font-size: 16px;
color: #303133;
text-align: right;
width: 100%;
}
.s-container {
box-shadow: none !important;
padding: 24px 0 !important;
}
</style> </style>

+ 0
- 1
src/views/business/comps/template/comps/gsp/GSP003.vue View File

@ -437,7 +437,6 @@ export default {
const stepResource = this.getStepResource() const stepResource = this.getStepResource()
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || []) this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || [] this.yqResourceTmp = stepResource.yqResource || []
debugger
return this.resourceTmp; return this.resourceTmp;
}, },
//使 //使

+ 0
- 1
src/views/business/comps/template/comps/gsp/GSP010.vue View File

@ -387,7 +387,6 @@ export default {
const stepResource = this.getStepResource() const stepResource = this.getStepResource()
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || []) this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || [] this.yqResourceTmp = stepResource.yqResource || []
debugger
return this.resourceTmp; return this.resourceTmp;
}, },
//使 //使

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

@ -796,7 +796,6 @@ export default {
const stepResource = this.getStepResource() const stepResource = this.getStepResource()
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || []) this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || [] this.yqResourceTmp = stepResource.yqResource || []
this.resourceTmp = tmpResource
return this.resourceTmp; return this.resourceTmp;
}, },
getStepResource() { getStepResource() {

Loading…
Cancel
Save