Browse Source

feat:[模板管理][update]

luojie
luojie 4 weeks ago
parent
commit
28c9fb9593
4 changed files with 67 additions and 51 deletions
  1. +5
    -4
      src/components/Template/HandleFormItem.vue
  2. +7
    -0
      src/components/Template/StepComponents/ry/jd.vue
  3. +51
    -43
      src/views/business/comps/template/mixins/templateMixin.js
  4. +4
    -4
      src/views/business/form/drug/comp/sqbdList.vue

+ 5
- 4
src/components/Template/HandleFormItem.vue View File

@ -340,9 +340,9 @@ export default {
currentCheckboxTreeValue: '',//checkboxTree currentCheckboxTreeValue: '',//checkboxTree
isShowOtherByCheckboxTree, isShowOtherByCheckboxTree,
pickerOptions: { pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
},
// disabledDate(time) {
// return time.getTime() > Date.now();
// },
shortcuts: type === 'dateTimeRange' ? undefined:[{ shortcuts: type === 'dateTimeRange' ? undefined:[{
text: '今天', text: '今天',
onClick(picker) { onClick(picker) {
@ -524,7 +524,7 @@ export default {
// //
// //
this.pendingRemoveFile = { file, fileList: this.fileList }; this.pendingRemoveFile = { file, fileList: this.fileList };
console.log("fillll")
// //
EventBus.$emit('showEditSignDialog', { uuid: this.uuid }); EventBus.$emit('showEditSignDialog', { uuid: this.uuid });
@ -1200,6 +1200,7 @@ export default {
return; return;
} }
if (!isOldValueEmpty && !(isSame) && (this.templateFillType === "actFill" || this.templateFillType === "blxjsh")&&this.type !== "attachment") { if (!isOldValueEmpty && !(isSame) && (this.templateFillType === "actFill" || this.templateFillType === "blxjsh")&&this.type !== "attachment") {
console.log("需要电子签名")
// EventBus // EventBus
EventBus.$emit('showEditSignDialog', { uuid: this.uuid }); EventBus.$emit('showEditSignDialog', { uuid: this.uuid });
} else {// } else {//

+ 7
- 0
src/components/Template/StepComponents/ry/jd.vue View File

@ -1,6 +1,7 @@
<!-- 解冻 --> <!-- 解冻 -->
<template> <template>
<StepFormPackage ref="stepFormPackageRef" :prefixKey="stepIndex+'_'+'ry_jd'" @resetRecord="resetRecord" :form-config="formConfig" <StepFormPackage ref="stepFormPackageRef" :prefixKey="stepIndex+'_'+'ry_jd'" @resetRecord="resetRecord" :form-config="formConfig"
@select="select"
:formData="formData" /> :formData="formData" />
</template> </template>
@ -16,9 +17,15 @@ export default {
default: 'jd', default: 'jd',
}, },
}, },
components: { components: {
StepFormPackage StepFormPackage
}, },
methods: {
select(data) {
console.log(data, "select")
}
},
computed: { computed: {
formConfig() { formConfig() {
let config = this.sn==='jd_swypfx'? let config = this.sn==='jd_swypfx'?

+ 51
- 43
src/views/business/comps/template/mixins/templateMixin.js View File

@ -1,6 +1,6 @@
import moment from 'moment' import moment from 'moment'
import { getLatestSn, getLatestSnArr } from '@/api/template'; 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 { isCommonUnit } from "@/utils/conTools";
import { sj_subpackage, sj_startConfiguration, sj_configurationCompleted } from '@/api/business/sj/sj'; import { sj_subpackage, sj_startConfiguration, sj_configurationCompleted } from '@/api/business/sj/sj';
import { convertConcentration } from "@/utils/conConverter";//浓度单位转换 import { convertConcentration } from "@/utils/conConverter";//浓度单位转换
@ -142,7 +142,7 @@ export default {
templateId, templateId,
templateSn, templateSn,
startDate, startDate,
submittedCodes,
submittedCodes,
bdmc, bdmc,
endDate, endDate,
id id
@ -157,7 +157,7 @@ export default {
templateMcEn, templateMcEn,
templateId, templateId,
templateSn, templateSn,
submittedCodes,
submittedCodes,
startDate, startDate,
bdmc, bdmc,
endDate, endDate,
@ -288,12 +288,12 @@ export default {
onBeforeReagentSubmit(data) { onBeforeReagentSubmit(data) {
const { selectData, callback, key, formFields } = data; const { selectData, callback, key, formFields } = data;
const { subTargetStartSolution } = formFields; const { subTargetStartSolution } = formFields;
//判断选择的浓度单位和预制的浓度单位是否一致 //判断选择的浓度单位和预制的浓度单位是否一致
if (key === "subStartSolution" && !isCommonUnit(selectData.row.nddw, [subTargetStartSolution])) {//选择起始源溶液需要同步更新table的变更记录。 if (key === "subStartSolution" && !isCommonUnit(selectData.row.nddw, [subTargetStartSolution])) {//选择起始源溶液需要同步更新table的变更记录。
callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。'); callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。');
} }
if(selectData.row.nd === "NA"){
if (selectData.row.nd === "NA") {
callback.prevent('当前实际浓度为NA,请重新选择'); callback.prevent('当前实际浓度为NA,请重新选择');
} }
}, },
@ -503,19 +503,19 @@ export default {
targetDiluentVolumePrecision: 3, //小数点精度默认为3 targetDiluentVolumePrecision: 3, //小数点精度默认为3
targetStartSolutionVolumePrecision: 3, //小数点精度默认为3 targetStartSolutionVolumePrecision: 3, //小数点精度默认为3
targetSolutionCode: `CA-WS-STD${Number(codeSTD) - index}`, targetSolutionCode: `CA-WS-STD${Number(codeSTD) - index}`,
id:getuuid(),
rowIndex:index,
id: getuuid(),
rowIndex: index,
})) }))
this.$refs.stepTableRef.updateDataSource(arr) this.$refs.stepTableRef.updateDataSource(arr)
} else if (key === 'targetStartSolution' || key === 'subTargetStartSolution') { } else if (key === 'targetStartSolution' || key === 'subTargetStartSolution') {
//起始溶液体积失焦时,更新目标溶液预计浓度 //起始溶液体积失焦时,更新目标溶液预计浓度
const arr = this.$refs.stepTableRef?.getDataSource(); const arr = this.$refs.stepTableRef?.getDataSource();
const { headerSelectFields,stepTableFormData=[] } = this.$refs.stepTableRef?.getFilledFormData();
const { headerSelectFields, stepTableFormData = [] } = this.$refs.stepTableRef?.getFilledFormData();
const params = { const params = {
subTargetStartSolution, subTargetStartSolution,
headerSelectFields, headerSelectFields,
dataSource:stepTableFormData,
}
dataSource: stepTableFormData,
}
arr.forEach((item, rowIndex) => { arr.forEach((item, rowIndex) => {
this.updateTargetStartSolutionVolume( this.updateTargetStartSolutionVolume(
item, item,
@ -583,7 +583,7 @@ export default {
} }
if (isValueEmpty(initNd)) { if (isValueEmpty(initNd)) {
console.log("initNd",initNd)
console.log("initNd", initNd)
this.$message.error('请先选择起始源溶液') this.$message.error('请先选择起始源溶液')
return return
} else { } else {
@ -598,7 +598,7 @@ export default {
//计算目标溶液浓度 //计算目标溶液浓度
calcNd(item, targetAcSolution, params) { calcNd(item, targetAcSolution, params) {
console.log(item,params, "ppp")
console.log(item, params, "ppp")
// debugger // debugger
//targetStartSolutionUnit(实际起始源溶液浓度单位) //targetStartSolutionUnit(实际起始源溶液浓度单位)
const { targetStartSolutionUnit, headerSelectFields } = params; const { targetStartSolutionUnit, headerSelectFields } = params;
@ -606,7 +606,7 @@ export default {
let initUnit = targetStartSolutionUnit; let initUnit = targetStartSolutionUnit;
if (item.rowIndex > 0) { if (item.rowIndex > 0) {
initUnit = actSolutionConcentrationUnit; initUnit = actSolutionConcentrationUnit;
}
}
//actStartSolutionVolumeUnit(实际起始源溶液体积单位)actSolutionVolumeUnit(实际目标溶液体积单位) //actStartSolutionVolumeUnit(实际起始源溶液体积单位)actSolutionVolumeUnit(实际目标溶液体积单位)
//actDiluentVolumeUnit(实际稀释液体积单位)actSolutionConcentrationUnit(实际目标溶液浓度单位) //actDiluentVolumeUnit(实际稀释液体积单位)actSolutionConcentrationUnit(实际目标溶液浓度单位)
//实际源溶液浓度÷(实际终体积÷源溶液加入体积); //实际源溶液浓度÷(实际终体积÷源溶液加入体积);
@ -619,6 +619,14 @@ export default {
if (isValueEmpty(actStartSolutionVolume) || isValueEmpty(actDiluentVolume) || isValueEmpty(initUnit)) { if (isValueEmpty(actStartSolutionVolume) || isValueEmpty(actDiluentVolume) || isValueEmpty(initUnit)) {
return false 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 converActDiluentVolume = volumeConverter.convert(actDiluentVolume + actDiluentVolumeUnit, actSolutionVolumeUnit)
const converActStartSolutionVolume = volumeConverter.convert(actStartSolutionVolume + actStartSolutionVolumeUnit, actSolutionVolumeUnit) const converActStartSolutionVolume = volumeConverter.convert(actStartSolutionVolume + actStartSolutionVolumeUnit, actSolutionVolumeUnit)
//实际源溶液加入体积+实际稀释液加入体积 //实际源溶液加入体积+实际稀释液加入体积
@ -628,11 +636,11 @@ export default {
const targetStartVolUnit = actSolutionConcentrationUnit.split("/")[1];//先按照预设目标溶液浓度的单位标准 const targetStartVolUnit = actSolutionConcentrationUnit.split("/")[1];//先按照预设目标溶液浓度的单位标准
const converActVol = volumeConverter.convert(actVol + actSolutionVolumeUnit, targetStartVolUnit) const converActVol = volumeConverter.convert(actVol + actSolutionVolumeUnit, targetStartVolUnit)
const converActDiluentVolume1 = volumeConverter.convert(actStartSolutionVolume + actStartSolutionVolumeUnit, 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) return convertConcentration.convert(item + initUnit, actSolutionConcentrationUnit)
}) })
console.log(converArr,"converArr")
console.log(converArr, "converArr")
const converTargetAcSolution = convertConcentration.convert(targetAcSolution + initUnit, actSolutionConcentrationUnit) const converTargetAcSolution = convertConcentration.convert(targetAcSolution + initUnit, actSolutionConcentrationUnit)
// 实际目标溶液浓度 = 实际源溶液浓度÷(实际终体积÷源溶液加入体积); // 实际目标溶液浓度 = 实际源溶液浓度÷(实际终体积÷源溶液加入体积);
const actNd = ( const actNd = (
@ -653,16 +661,17 @@ export default {
//更新起始溶液体积时,计算预设起始溶液体积和预设稀释液体积 //更新起始溶液体积时,计算预设起始溶液体积和预设稀释液体积
updateTargetStartSolutionVolume(item, volume, unitParams) { updateTargetStartSolutionVolume(item, volume, unitParams) {
const { rowIndex } = item const { rowIndex } = item
const { subTargetStartSolution, headerSelectFields, dataSource=[] } = unitParams
const { subTargetStartSolution, headerSelectFields, dataSource = [] } = unitParams
const { targetSolutionConcentrationUnit, targetSolutionVolumeUnit, targetStartSolutionVolumeUnit, targetDiluentVolumeUnit } = headerSelectFields const { targetSolutionConcentrationUnit, targetSolutionVolumeUnit, targetStartSolutionVolumeUnit, targetDiluentVolumeUnit } = headerSelectFields
let initNd = volume,unit = subTargetStartSolution;
let initNd = volume, unit = subTargetStartSolution;
//平行配置不会传dataSource; //平行配置不会传dataSource;
if (rowIndex > 0 && dataSource.length > 0) { if (rowIndex > 0 && dataSource.length > 0) {
initNd = dataSource[rowIndex - 1].targetSolutionConcentration; initNd = dataSource[rowIndex - 1].targetSolutionConcentration;
unit = targetSolutionConcentrationUnit; unit = targetSolutionConcentrationUnit;
}
}
const precision = item.targetStartSolutionVolumePrecision || 0 const precision = item.targetStartSolutionVolumePrecision || 0
const precision1 = item.targetDiluentVolumePrecision || 0;
const concentration = item.targetSolutionConcentration const concentration = item.targetSolutionConcentration
const targetVolume = item.targetSolutionVolume const targetVolume = item.targetSolutionVolume
if ( if (
@ -676,34 +685,33 @@ export default {
) { ) {
return; return;
} }
const targetStartVolUnit = targetSolutionConcentrationUnit.split("/")[1];//先按照预设目标溶液浓度的单位标准 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 //将预设目标溶液体积转换为和预设目标溶液浓度单位的分母一样的单位再计算;如:预设目标溶液浓度单位为mg/mL,预设目标溶液体积单位为uL,则将预设目标溶液体积转换为mL
const convertTargetVol = volumeConverter.convert(targetVolume + targetSolutionVolumeUnit, targetStartVolUnit) 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模板 // 导出excel模板

+ 4
- 4
src/views/business/form/drug/comp/sqbdList.vue View File

@ -192,13 +192,13 @@
<!-- 编辑 --> <!-- 编辑 -->
<Bj v-show="showEdit" key="Bj" ref="Bj" @close="bjClose" /> <Bj v-show="showEdit" key="Bj" ref="Bj" @close="bjClose" />
<!-- 详情 --> <!-- 详情 -->
<Xq v-show="showDetail" key="Xq" ref="Xq" @close="xqClose" />
<Xq v-if="showDetail" key="Xq" ref="Xq" @close="xqClose" />
<!-- 审阅 --> <!-- 审阅 -->
<Sy v-show="showAudit" key="Sy" ref="Sy" @close="syClose" />
<Sy v-if="showAudit" key="Sy" ref="Sy" @close="syClose" />
<!-- 复核 --> <!-- 复核 -->
<Fh v-show="showFh" key="Fh" ref="Fh" @close="fhClose" />
<Fh v-if="showFh" key="Fh" ref="Fh" @close="fhClose" />
<!-- 审核 --> <!-- 审核 -->
<Sh v-show="showSh" key="Sh" ref="Sh" @close="shClose" />
<Sh v-if="showSh" key="Sh" ref="Sh" @close="shClose" />
<!-- 废止 --> <!-- 废止 -->
<Fz key="Fz" ref="Fz" @callback="search" /> <Fz key="Fz" ref="Fz" @callback="search" />
<!-- 确认废止 --> <!-- 确认废止 -->

Loading…
Cancel
Save