From 28c9fb95932766df567cf58b2d0cd1d33967cea5 Mon Sep 17 00:00:00 2001
From: luojie <125330818@qq.com>
Date: Tue, 24 Mar 2026 16:55:28 +0800
Subject: [PATCH] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86][upd?=
=?UTF-8?q?ate]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/Template/HandleFormItem.vue | 9 ++-
src/components/Template/StepComponents/ry/jd.vue | 7 ++
.../comps/template/mixins/templateMixin.js | 94 ++++++++++++----------
src/views/business/form/drug/comp/sqbdList.vue | 8 +-
4 files changed, 67 insertions(+), 51 deletions(-)
diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue
index 096ac34..d2955b2 100644
--- a/src/components/Template/HandleFormItem.vue
+++ b/src/components/Template/HandleFormItem.vue
@@ -340,9 +340,9 @@ export default {
currentCheckboxTreeValue: '',//当前操作的checkboxTree值
isShowOtherByCheckboxTree,
pickerOptions: {
- disabledDate(time) {
- return time.getTime() > Date.now();
- },
+ // disabledDate(time) {
+ // return time.getTime() > Date.now();
+ // },
shortcuts: type === 'dateTimeRange' ? undefined:[{
text: '今天',
onClick(picker) {
@@ -524,7 +524,7 @@ export default {
// 所有删除操作都需要验证电子签名
// 保存待删除的文件信息
this.pendingRemoveFile = { file, fileList: this.fileList };
-
+console.log("fillll")
// 触发电子签名弹窗
EventBus.$emit('showEditSignDialog', { uuid: this.uuid });
@@ -1200,6 +1200,7 @@ export default {
return;
}
if (!isOldValueEmpty && !(isSame) && (this.templateFillType === "actFill" || this.templateFillType === "blxjsh")&&this.type !== "attachment") {
+ console.log("需要电子签名")
// 通过EventBus触发电子签名弹窗
EventBus.$emit('showEditSignDialog', { uuid: this.uuid });
} else {//如果是第一次填写,不需要密码验证
diff --git a/src/components/Template/StepComponents/ry/jd.vue b/src/components/Template/StepComponents/ry/jd.vue
index 2486dcb..906c652 100644
--- a/src/components/Template/StepComponents/ry/jd.vue
+++ b/src/components/Template/StepComponents/ry/jd.vue
@@ -1,6 +1,7 @@
@@ -16,9 +17,15 @@ export default {
default: 'jd',
},
},
+
components: {
StepFormPackage
},
+ methods: {
+ select(data) {
+ console.log(data, "select")
+ }
+ },
computed: {
formConfig() {
let config = this.sn==='jd_swypfx'?
diff --git a/src/views/business/comps/template/mixins/templateMixin.js b/src/views/business/comps/template/mixins/templateMixin.js
index f1eb8a3..1e24bf4 100644
--- a/src/views/business/comps/template/mixins/templateMixin.js
+++ b/src/views/business/comps/template/mixins/templateMixin.js
@@ -1,6 +1,6 @@
import moment from 'moment'
import { getLatestSn, getLatestSnArr } from '@/api/template';
-import { isValueEmpty, getStringWidth,getuuid } from '@/utils/index';
+import { isValueEmpty, getStringWidth, getuuid } from '@/utils/index';
import { isCommonUnit } from "@/utils/conTools";
import { sj_subpackage, sj_startConfiguration, sj_configurationCompleted } from '@/api/business/sj/sj';
import { convertConcentration } from "@/utils/conConverter";//浓度单位转换
@@ -142,7 +142,7 @@ export default {
templateId,
templateSn,
startDate,
- submittedCodes,
+ submittedCodes,
bdmc,
endDate,
id
@@ -157,7 +157,7 @@ export default {
templateMcEn,
templateId,
templateSn,
- submittedCodes,
+ submittedCodes,
startDate,
bdmc,
endDate,
@@ -288,12 +288,12 @@ export default {
onBeforeReagentSubmit(data) {
const { selectData, callback, key, formFields } = data;
const { subTargetStartSolution } = formFields;
-
+
//判断选择的浓度单位和预制的浓度单位是否一致
if (key === "subStartSolution" && !isCommonUnit(selectData.row.nddw, [subTargetStartSolution])) {//选择起始源溶液需要同步更新table的变更记录。
callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。');
}
- if(selectData.row.nd === "NA"){
+ if (selectData.row.nd === "NA") {
callback.prevent('当前实际浓度为NA,请重新选择');
}
},
@@ -503,19 +503,19 @@ export default {
targetDiluentVolumePrecision: 3, //小数点精度默认为3
targetStartSolutionVolumePrecision: 3, //小数点精度默认为3
targetSolutionCode: `CA-WS-STD${Number(codeSTD) - index}`,
- id:getuuid(),
- rowIndex:index,
+ id: getuuid(),
+ rowIndex: index,
}))
this.$refs.stepTableRef.updateDataSource(arr)
} else if (key === 'targetStartSolution' || key === 'subTargetStartSolution') {
//起始溶液体积失焦时,更新目标溶液预计浓度
const arr = this.$refs.stepTableRef?.getDataSource();
- const { headerSelectFields,stepTableFormData=[] } = this.$refs.stepTableRef?.getFilledFormData();
+ const { headerSelectFields, stepTableFormData = [] } = this.$refs.stepTableRef?.getFilledFormData();
const params = {
subTargetStartSolution,
headerSelectFields,
- dataSource:stepTableFormData,
- }
+ dataSource: stepTableFormData,
+ }
arr.forEach((item, rowIndex) => {
this.updateTargetStartSolutionVolume(
item,
@@ -583,7 +583,7 @@ export default {
}
if (isValueEmpty(initNd)) {
- console.log("initNd",initNd)
+ console.log("initNd", initNd)
this.$message.error('请先选择起始源溶液')
return
} else {
@@ -598,7 +598,7 @@ export default {
//计算目标溶液浓度
calcNd(item, targetAcSolution, params) {
- console.log(item,params, "ppp")
+ console.log(item, params, "ppp")
// debugger
//targetStartSolutionUnit(实际起始源溶液浓度单位)
const { targetStartSolutionUnit, headerSelectFields } = params;
@@ -606,7 +606,7 @@ export default {
let initUnit = targetStartSolutionUnit;
if (item.rowIndex > 0) {
initUnit = actSolutionConcentrationUnit;
- }
+ }
//actStartSolutionVolumeUnit(实际起始源溶液体积单位)actSolutionVolumeUnit(实际目标溶液体积单位)
//actDiluentVolumeUnit(实际稀释液体积单位)actSolutionConcentrationUnit(实际目标溶液浓度单位)
//实际源溶液浓度÷(实际终体积÷源溶液加入体积);
@@ -619,6 +619,14 @@ export default {
if (isValueEmpty(actStartSolutionVolume) || isValueEmpty(actDiluentVolume) || isValueEmpty(initUnit)) {
return false
}
+ const splitXsytj = actDiluentVolume.split("/");
+ const splitYrytj = actStartSolutionVolume.split("/");
+ const sjZtj = splitXsytj.map((item,index) => {
+ const xsytj = volumeConverter.convert(item + actDiluentVolumeUnit, actSolutionVolumeUnit);
+ const yrytj = volumeConverter.convert(splitYrytj[index] + actStartSolutionVolumeUnit, actSolutionVolumeUnit);
+ return (Number(xsytj) + Number(yrytj)).toFixed(volPrecision);
+ })
+ console.log(sjZtj, "sjZtj")
const converActDiluentVolume = volumeConverter.convert(actDiluentVolume + actDiluentVolumeUnit, actSolutionVolumeUnit)
const converActStartSolutionVolume = volumeConverter.convert(actStartSolutionVolume + actStartSolutionVolumeUnit, actSolutionVolumeUnit)
//实际源溶液加入体积+实际稀释液加入体积
@@ -628,11 +636,11 @@ export default {
const targetStartVolUnit = actSolutionConcentrationUnit.split("/")[1];//先按照预设目标溶液浓度的单位标准
const converActVol = volumeConverter.convert(actVol + actSolutionVolumeUnit, targetStartVolUnit)
const converActDiluentVolume1 = volumeConverter.convert(actStartSolutionVolume + actStartSolutionVolumeUnit, targetStartVolUnit)
- const converArr = (targetAcSolution+'').split("/");
- converArr.map((item)=>{
+ const converArr = (targetAcSolution + '').split("/");
+ converArr.map((item) => {
return convertConcentration.convert(item + initUnit, actSolutionConcentrationUnit)
})
- console.log(converArr,"converArr")
+ console.log(converArr, "converArr")
const converTargetAcSolution = convertConcentration.convert(targetAcSolution + initUnit, actSolutionConcentrationUnit)
// 实际目标溶液浓度 = 实际源溶液浓度÷(实际终体积÷源溶液加入体积);
const actNd = (
@@ -653,16 +661,17 @@ export default {
//更新起始溶液体积时,计算预设起始溶液体积和预设稀释液体积
updateTargetStartSolutionVolume(item, volume, unitParams) {
const { rowIndex } = item
- const { subTargetStartSolution, headerSelectFields, dataSource=[] } = unitParams
+ const { subTargetStartSolution, headerSelectFields, dataSource = [] } = unitParams
const { targetSolutionConcentrationUnit, targetSolutionVolumeUnit, targetStartSolutionVolumeUnit, targetDiluentVolumeUnit } = headerSelectFields
- let initNd = volume,unit = subTargetStartSolution;
+ let initNd = volume, unit = subTargetStartSolution;
//平行配置不会传dataSource;
if (rowIndex > 0 && dataSource.length > 0) {
initNd = dataSource[rowIndex - 1].targetSolutionConcentration;
unit = targetSolutionConcentrationUnit;
- }
+ }
const precision = item.targetStartSolutionVolumePrecision || 0
+ const precision1 = item.targetDiluentVolumePrecision || 0;
const concentration = item.targetSolutionConcentration
const targetVolume = item.targetSolutionVolume
if (
@@ -676,34 +685,33 @@ export default {
) {
return;
}
-
const targetStartVolUnit = targetSolutionConcentrationUnit.split("/")[1];//先按照预设目标溶液浓度的单位标准
- const volumeArr = (initNd+'').split("/");
- const converArr = volumeArr.map((item)=>{
- return convertConcentration.convert(item + unit, targetSolutionConcentrationUnit)
- })
- console.log(converArr,"converArr")
- //将起始溶液浓度转换为和预设目标溶液浓度一样的单位再计算;
- const converStartCon = convertConcentration.convert(initNd + unit, targetSolutionConcentrationUnit)
//将预设目标溶液体积转换为和预设目标溶液浓度单位的分母一样的单位再计算;如:预设目标溶液浓度单位为mg/mL,预设目标溶液体积单位为uL,则将预设目标溶液体积转换为mL
const convertTargetVol = volumeConverter.convert(targetVolume + targetSolutionVolumeUnit, targetStartVolUnit)
+ const convertTargetVol1 = volumeConverter.convert(targetVolume + targetSolutionVolumeUnit, targetStartSolutionVolumeUnit)
- //预设起始溶液体积:(目标溶液预计浓度 乘以 目标溶液预计体积)除以 起始溶液浓度
- const result = Number((concentration * convertTargetVol) / converStartCon)
- //根据预设起始溶液体积单位转换计算后的数据
- const convertYsVol = volumeConverter.convert(result + targetStartVolUnit, targetStartSolutionVolumeUnit)
- item.targetStartSolutionVolume = Number(convertYsVol.toFixed(
- precision
- ))
- // this.$refs.stepTableRef.updateDataSourceByRowIndex(rowIndex, { targetStartSolutionVolume: result });
- if (targetVolume) {
- //预设稀释液体积:目标溶液预计体积 减去 源溶液预计体积;
- const precision1 = item.targetDiluentVolumePrecision || 0;
- //将预设目标溶液体积转换为和预设起始溶液体积单位一样的单位再计算;
- const convertTargetVol1 = volumeConverter.convert(targetVolume + targetSolutionVolumeUnit, targetStartSolutionVolumeUnit)
- const result1 = (convertTargetVol1 - convertYsVol)
- item.targetDiluentVolume = Number(volumeConverter.convert(result1 + targetStartSolutionVolumeUnit, targetDiluentVolumeUnit).toFixed(precision1))
- // this.$refs.stepTableRef.updateDataSourceByRowIndex(rowIndex, { targetDiluentVolume: result1 });
+ const initNdArr = (initNd + '').split("/");
+ const transNdArr = initNdArr.map((con) => {
+ return convertConcentration.convert(con + unit, targetSolutionConcentrationUnit)
+ })
+ const mbyjndArr = (concentration + '').split("/");//目标预计浓度
+ if (initNdArr.length == 1 || mbyjndArr.length == initNdArr.length) {
+ //预设体积
+ const ystjArr = mbyjndArr.map((con, index) => {
+ const ystj = Number((con * convertTargetVol) / (transNdArr[index] || transNdArr[0]))
+ const convertYsVol = volumeConverter.convert(ystj + targetStartVolUnit, targetStartSolutionVolumeUnit)
+ const xstj = (convertTargetVol1 - convertYsVol)//稀释体积
+ return {qsrytj:convertYsVol,xstj}
+ })
+ item.targetStartSolutionVolume = ystjArr.map((item) => {
+ return Number((item.qsrytj).toFixed(precision))
+ }).join("/");
+ item.targetDiluentVolume = ystjArr.map((item) => {
+ return Number((volumeConverter.convert(item.xstj + targetStartSolutionVolumeUnit, targetDiluentVolumeUnit)).toFixed(precision1))
+ }).join("/");
+ } else {
+ this.$message.error("起始溶液浓度和目标溶液浓度格式不一致,请重新输入")
+ return
}
},
// 导出excel模板
diff --git a/src/views/business/form/drug/comp/sqbdList.vue b/src/views/business/form/drug/comp/sqbdList.vue
index 0c5983c..9ad7354 100644
--- a/src/views/business/form/drug/comp/sqbdList.vue
+++ b/src/views/business/form/drug/comp/sqbdList.vue
@@ -192,13 +192,13 @@
-
+
-
+
-
+
-
+