-

{{ getTemplateName() }}

+

{{ getTemplateName() }}

-
onHandleTableBlur('ladder', ladderIndex,e)" :ref="`ladderStepTableRef_${ladderIndex}`"
- :columns="ladderStepColumns" :formData="ladderConfig" :prefixKey="'ladder_' + ladderIndex"
- fieldItemLabel="阶梯配制">
+ onHandleTableBlur('ladder', ladderIndex, e)"
+ :ref="`ladderStepTableRef_${ladderIndex}`" :columns="ladderStepColumns"
+ :formData="ladderConfig" :prefixKey="'ladder_' + ladderIndex" fieldItemLabel="阶梯配制">
- printTag(e,'ladderConfigs',ladderIndex)" :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
+ printTag(e, 'ladderConfigs', ladderIndex)"
+ @startConfig="(val) => startConfig(val, 'ladderConfigs', ladderIndex)"
+ @configComplete="(val) => configComplete(val, 'ladderConfigs', ladderIndex)"
+ @subPackageSubmit="(val) => subPackageSubmit(val, 'ladderConfigs', ladderIndex)"
+ :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex, 'ladder', ladderIndex)">
@@ -60,12 +65,15 @@
:ref="`paralleStepFormPackageRef_${paralleIndex}`" :formConfig="paralleStepFormConfig"
@blur="onHandleBlur" :formData="paralleConfig" :prefixKey="'paralle' + paralleIndex"
fieldItemLabel="平行配制" />
- onHandleTableBlur('paralle', paralleIndex,e)" :ref="`paralleStepTableRef_${paralleIndex}`"
- :columns="paralleStepColumns" :formData="paralleConfig"
- @clickable="(col,rowIndex) => handleTableClickable('paralle', paralleIndex, col,rowIndex)"
- :prefixKey="'paralle' + paralleIndex" fieldItemLabel="平行配制">
+ onHandleTableBlur('paralle', paralleIndex, e)"
+ :ref="`paralleStepTableRef_${paralleIndex}`" :columns="paralleStepColumns"
+ :formData="paralleConfig" :prefixKey="'paralle' + paralleIndex" fieldItemLabel="平行配制">
- printTag(e,'paralleConfigs',paralleIndex)" :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
+ 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)">
@@ -82,8 +90,7 @@
-
+
@@ -98,7 +105,7 @@ import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue";
-import {getExpireDate} from "@/utils/index.js";
+import { getExpireDate } from "@/utils/index.js";
import moment from "moment";
import { getLadderColumnsConfig, getParallelColumnsConfig, getLadderFormConfig, getBaseInfoFormConfig, getRemarkFormConfig, getStorageConditionFormConfig, getParalleStepFormConfig } from "../../formConfig/paralleAndLadderConfig.js";
export default {
@@ -125,7 +132,7 @@ export default {
formData: {
immediate: true,
handler(v) {
- if(v &&this.fillType === "actFill"){
+ if (v && this.fillType === "actFill") {
this.handleUpdateCode();
}
}
@@ -168,94 +175,115 @@ export default {
dataSource: [],
currentTableIndex: "",//当前点击的表格索引
currentTableKey: "",//当前点击的表格key
- targetAcSolutionFromTable:true,//是否从表格中获取实际原始溶液浓度
+ targetAcSolutionFromTable: true,//是否从表格中获取实际原始溶液浓度
};
},
mounted() {
},
- methods: {
- getTemplateName(){
- if(this.templateData.templateMc){
+ methods: {
+ subPackageSubmit(val, configType, index) {
+ // const { rowData } = val;
+ // let postData = {
+ // bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
+ // }
+ // this.startConfigRequest(postData);
+ },
+ configComplete(val) {
+ const { rowData, headerSelectFields } = val;
+ //计算实际目标溶液体积(实际起始溶液体积+实际稀释液体积)
+ const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit])
+ let postData = {
+ mc: null,
+ bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
+ nd: rowData.actSolutionConcentration,//实际目标溶液浓度
+ nddw: headerSelectFields.actSolutionConcentrationUnit,
+ kc: total,
+ kcdw: unit,
+ }
+ this.configCompleteRequest(postData);
+ },
+ getTemplateName() {
+ if (this.templateData.templateMc) {
return this.templateData.templateMc
}
const o = {
- "SP004":"生物样品内标工作液制备表",
- "SP005":"生物样品质控工作液制备表",
- "SP006":"生物样品标准曲线/质控样品制备表",
+ "SP004": "生物样品内标工作液制备表",
+ "SP005": "生物样品质控工作液制备表",
+ "SP006": "生物样品标准曲线/质控样品制备表",
}
return o[this.sn];
},
//标签打印
- printTag(e,configType,index){
+ printTag(e, configType, index) {
const { nickName, name } = this.$store.getters;
- const {printCode,row,type} = e;
+ const { printCode, row, type } = e;
const currentForm = this.formData[configType][index];
- const {stepStorageCondition,startDate,expireDate,paralleStepStorageCondition} = currentForm;
+ 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,
+ "品名": "暂时还不知道品名是哪个字段",
+ "存储条件": 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),
+ "编号": type === "subPackage" ? printCode : (row.targetSolutionCode + row.subTargetSolutionCode),
}
console.log(printConfig, "printConfig")
- EventBus.$emit('showTagPrintDialog', {printConfig})
+ EventBus.$emit('showTagPrintDialog', { printConfig })
},
// 为指定的表单数据数组分配编号
async assignNumbersToTableData(config) {
const configs = this.formData[config]
- const {startDate} = this.formData;
+ const { startDate } = this.formData;
// 检查paralleConfigs中的paralleTableFormData数组
if (configs && configs.length > 0) {
for (let i = 0; i < configs.length; i++) {
const ref = config === "paralleConfigs" ? `paralleStepTableRef_${i}` : `ladderStepTableRef_${i}`;
- const {stepTableFormData = [], effectivePeriod, effectivePeriodUnit,expireDate} = configs[i];
- if(!expireDate && config === "ladderConfigs"){
+ 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 length = tableDataArray.length;
- const snList = await this.getLatestSn(length);
- tableDataArray.forEach((row, idx) => {
- let expDate = {};
- if(config === "paralleConfigs" && !row.targetSolutionExpirationDate){
- let date = getExpireDate(startDate, row.targetSolutionCycle, row.targetSolutionCyclePrecision);
- expDate = {
- targetSolutionExpirationDate: date
- }
+ const tableDataArray = stepTableFormData;
+ // 检查表单数据中是否有任何一行的subTargetSolutionCode有值
+ const hasAnyWithValue = tableDataArray.some(row =>
+ row.subTargetSolutionCode && row.subTargetSolutionCode.trim() !== '');
+ // 如果没有任何一行有值,则为所有行分配编号
+ if (!hasAnyWithValue) {
+ const length = tableDataArray.length;
+ const snList = await this.getLatestSn(length);
+ 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});
- });
- Promise.resolve();
- }
+ }
+ this.$refs[ref][0]?.updateDataSourceByRowIndex(idx, { subTargetSolutionCode: snList[idx], ...expDate });
+ });
+ Promise.resolve();
+ }
}
}
}
-
+
},
async handleUpdateCode() {
- Promise.all([this.assignNumbersToTableData("ladderConfigs"),this.assignNumbersToTableData("paralleConfigs")
- ]).then(()=>{
+ Promise.all([this.assignNumbersToTableData("ladderConfigs"), this.assignNumbersToTableData("paralleConfigs")
+ ]).then(() => {
console.log("nextTick")
//通知后端保存数据
const params = {
- type: "fieldChanged",
- newRecord: null,
- resourceList: null,
- }
+ type: "fieldChanged",
+ newRecord: null,
+ resourceList: null,
+ }
EventBus.$emit('onModifyRecord', params,)
})
},
@@ -321,37 +349,37 @@ export default {
// 表格失去焦点事件
onHandleTableBlur(type, configIndex, e) {
- const { colKey = "",item } = e;
+ const { colKey = "", item } = e;
if (colKey === "targetStartSolutionConcentration" || colKey === "targetSolutionVolume" || colKey === "targetSolutionConcentration" || colKey === "targetStartSolutionVolumePrecision" || colKey === "targetDiluentVolumePrecision") {
- if(type === "ladder"){
+ if (type === "ladder") {
const volume = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFormDataByKey("targetStartSolution") || 0;
if (volume) {
this.updateTargetStartSolutionVolume(item, volume);
}
- }else if(type === "paralle"){
+ } else if (type === "paralle") {
const volumne = item.targetStartSolutionConcentration || 0;
if (volumne) {
this.updateTargetStartSolutionVolume(item, volumne);
}
}
- }else if(colKey === "actStartSolutionVolume" || colKey === "actDiluentVolume"){//实际起始溶液体积和实际目标溶液体积
- if(type === "ladder"){
+ } else if (colKey === "actStartSolutionVolume" || colKey === "actDiluentVolume") {//实际起始溶液体积和实际目标溶液体积
+ if (type === "ladder") {
const targetAcSolution = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFormDataByKey("targetAcSolution") || 0;//获取实际起始溶液浓度
- if(targetAcSolution){
- this.updateSjmbrynd(item,targetAcSolution);
+ if (targetAcSolution) {
+ this.updateSjmbrynd(item, targetAcSolution);
}
- }else if(type === "paralle"){
+ } else if (type === "paralle") {
const targetAcSolution = item.targetAcSolution || 0;//获取实际起始溶液浓度
- if(targetAcSolution){
- this.updateSjmbrynd(item,targetAcSolution);
+ if (targetAcSolution) {
+ this.updateSjmbrynd(item, targetAcSolution);
}
}
-
+
}
},
//表格点击事件
- handleTableClickable(type, rowIndex, col,tableRowIndex) {
- if(col.prop === "actStartSolutionCode"){//实际原始溶液编号点击事件
+ handleTableClickable(type, rowIndex, col, tableRowIndex) {
+ if (col.prop === "actStartSolutionCode") {//实际原始溶液编号点击事件
this.currentTableKey = col.prop;
this.currentType = type;
this.currentRowIndex = rowIndex;
@@ -374,26 +402,26 @@ export default {
}
},
//选择试剂提交事件
- onSelectReagentSubmit(code,row) {
- const { currentSubKey,currentTableKey,currentRowIndex,currentTableIndex } = this;
- if(currentSubKey){
- const ref = this.currentType === "ladder" ?"ladderStepFormPackageRef_":"paralleStepFormPackageRef_"
+ onSelectReagentSubmit(code, row) {
+ 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,["targetAcSolution"]);
- packageRef.onValueChangeCompareTo("targetAcSolution", row.nd,"targetStartSolution");
+ if (currentSubKey === "subStartSolution") {
+ packageRef.updateFormData("targetAcSolution", row.nd, ["targetAcSolution"]);
+ packageRef.onValueChangeCompareTo("targetAcSolution", row.nd, "targetStartSolution");
}
packageRef.updateFormData(currentSubKey, code);
this.currentSubKey = "";
- }else if (currentTableKey === "actStartSolutionCode"){//实际原始溶液编号点击事件
+ } else if (currentTableKey === "actStartSolutionCode") {//实际原始溶液编号点击事件
const tableRef = this.$refs[`paralleStepTableRef_${currentRowIndex}`][0];
- if(tableRef){
- tableRef.updateDataSourceByRowIndex(currentTableIndex,{
+ if (tableRef) {
+ tableRef.updateDataSourceByRowIndex(currentTableIndex, {
actStartSolutionCode: code,
targetAcSolution: row.nd,
})
- }
+ }
}
this.$refs.selectReagentDialogRef.onCancel()
},
@@ -518,8 +546,9 @@ export default {
.mt-0 {
margin-top: 0;
}
-.s-container{
+
+.s-container {
box-shadow: none !important;
- padding:24px 0 !important;
+ padding: 24px 0 !important;
}
\ No newline at end of file
diff --git a/src/views/business/comps/template/dialog/SubPackageDialog.vue b/src/views/business/comps/template/dialog/SubPackageDialog.vue
index b276d3d..3b19ece 100644
--- a/src/views/business/comps/template/dialog/SubPackageDialog.vue
+++ b/src/views/business/comps/template/dialog/SubPackageDialog.vue
@@ -128,6 +128,7 @@ export default {
} else {
const errMsg = "分装后小份容量之和大于母液容量,是否确认分装?"
const {maxVolume,maxVolumeUnit,dw} = this.formData;
+
const totalVolume = this.fzList.reduce((acc, cur) => acc + Number(cur.num), 0);
const compareResult = compareVolume(totalVolume,dw,maxVolume, maxVolumeUnit);
console.log(compareResult,totalVolume,dw,maxVolume, maxVolumeUnit,"比较结果");
@@ -151,7 +152,6 @@ export default {
},
submitEmit(){
EventBus.$emit('dialogSubPackageSubmit', {...this.formData, fzList: this.fzList});
- this.$message.success('分装成功');
setTimeout(() => {
this.close();
}, 500);
diff --git a/src/views/business/comps/template/mixins/templateMixin.js b/src/views/business/comps/template/mixins/templateMixin.js
index 62426f2..7e7b8d7 100644
--- a/src/views/business/comps/template/mixins/templateMixin.js
+++ b/src/views/business/comps/template/mixins/templateMixin.js
@@ -1,5 +1,6 @@
import moment from 'moment'
-import { getLatestSn } from '@/api/template'
+import { getLatestSn } from '@/api/template';
+import { sj_subpackage,sj_startConfiguration,sj_configurationCompleted } from '@/api/business/sj/sj';
export default {
dicts: [
'business_pztj',
@@ -129,6 +130,34 @@ export default {
this.setTemplateData({})
},
methods: {
+ //开始配置
+ //postData: {bh: '123456'}
+ async startConfigRequest (postData){
+ const res = await sj_startConfiguration(postData)
+ if (res.code === 200) {
+ this.$message.success('开始配置成功')
+ } else {
+ this.$message.error('开始配置失败')
+ }
+ },
+ //完成配置
+ async configCompleteRequest (postData){
+ const res = await sj_configurationCompleted(postData)
+ if (res.code === 200) {
+ this.$message.success('完成配置成功')
+ } else {
+ this.$message.error('完成配置失败')
+ }
+ },
+ //分装
+ async subPackageRequest (postData){
+ const res = await sj_subpackage(postData)
+ if (res.code === 200) {
+ this.$message.success('分装成功')
+ } else {
+ this.$message.error('分装失败')
+ }
+ },
//获取打印配置
getBasePrintConfig (data = {}){
const { printCode,type,row = {} } = data;
@@ -317,7 +346,8 @@ export default {
actStartSolutionVolume /
actVol
).toFixed(precision)
- item.actSolutionConcentration = actNd
+ console.log(actNd,targetAcSolution,actStartSolutionVolume,actVol, "actNd")
+ item.actSolutionConcentration = actNd === 'Infinity' ? 0 : actNd
},
//更新起始溶液体积时,计算目标溶液预计浓度
updateTargetStartSolutionVolume(item, volume) {