Browse Source

feat:[模板管理][update]

luojie
luojie 1 month ago
parent
commit
5e185a43eb
5 changed files with 62 additions and 32 deletions
  1. +8
    -1
      src/components/Template/BaseInfoFormPackage.vue
  2. +2
    -1
      src/components/Template/CustomTable.vue
  3. +11
    -6
      src/components/Template/HandleFormItem.vue
  4. +8
    -5
      src/views/business/comps/template/comps/sp/comps/LadderConfig.vue
  5. +33
    -19
      src/views/business/comps/template/mixins/templateMixin.js

+ 8
- 1
src/components/Template/BaseInfoFormPackage.vue View File

@ -445,10 +445,17 @@ export default {
},
//
getButtonItem(sItem) {
const o = {
...sItem,
key: sItem.subKey,
fillType: sItem.subFillType || sItem.fillType
};
if(sItem.hasOwnProperty("subDisabled")){
o.disabled = sItem.disabled;
}
return {
...sItem,
key: sItem.subKey,
disabled: sItem.subDisabled,
fillType: sItem.subFillType || sItem.fillType
}
},

+ 2
- 1
src/components/Template/CustomTable.vue View File

@ -800,7 +800,7 @@ export default {
const compareToValue = this.localDataSource[rowIndex][col.compareTo];
// compareTo
if (value !== compareToValue) {
if (!isEqual(value, compareToValue)) {
this.setOrangeBg(rowIndex, colIndex, colKey, true);
} else {
//
@ -1069,6 +1069,7 @@ export default {
targetDiluentVolumePrecision: 3,//3
targetStartSolutionVolumePrecision: 3,//3
id:getuuid(),
rowIndex:this.localDataSource.length,
});
justUpdateFilledFormData()
},

+ 11
- 6
src/components/Template/HandleFormItem.vue View File

@ -111,6 +111,7 @@
<template v-else-if="type === 'attachment'">
<el-upload ref="uploadRef" class="upload-demo" :action="uploadFileUrl" :on-preview="handlePreview"
:headers="headers" :before-remove="beforeRemove" :on-remove="handleRemove" multiple :limit="10"
:disabled="getDisabled()"
:on-success="handleSuccess" :on-change="handleChange" :on-exceed="handleExceed"
:file-list="fileList" :auto-upload="false">
<el-button :disabled="getDisabled()" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')"
@ -205,7 +206,7 @@
</div>
<div>
<div v-if="record.content">复核意见{{ record.content }}</div>
<div v-if="record.reply">回复意见{{ record.reply }}</div>
<div v-if="record.reply">意见回复{{ record.reply }}</div>
</div>
</div>
<hr v-if="index < modificationRecords.length - 1">
@ -213,7 +214,7 @@
</div>
</div>
</div>
<el-dialog :close-on-click-modal="false" append-to-body :title="(templateFillType == 'actFill' || templateFillType == 'blxjsh') ? '回复意见' : '复核意见'"
<el-dialog :close-on-click-modal="false" append-to-body :title="(templateFillType == 'actFill' || templateFillType == 'blxjsh') ? '意见回复' : '复核意见'"
:visible.sync="visible" width="30%">
<el-input v-model="replyContent" type="textarea" show-word-limit resize="none" rows="8" placeholder="输入内容"
maxlength="500" />
@ -404,7 +405,6 @@ export default {
},
methods: {
remoteMethod(query) {
console.log(query,"qqq")
this.$emit('remoteMethod', query);
},
handleFalse() {
@ -766,7 +766,7 @@ export default {
const baseInfo = this.getCommonRecordInfo();
const record = {
...baseInfo,
title: (this.templateFillType == 'actFill' || this.templateFillType == 'blxjsh') ? "回复意见" : "复核意见",
title: (this.templateFillType == 'actFill' || this.templateFillType == 'blxjsh') ? "意见回复" : "复核意见",
time: moment().format("YYYY-MM-DD HH:mm:ss"),
}
if (this.templateFillType == 'actFill' || this.templateFillType == 'blxjsh') {
@ -816,7 +816,7 @@ export default {
const records = this.getReplyRecords();
if (records.length > 0) {
const o = records[0];
if (o.reply && o.content) {//
if (o.reply && o.content) {//
return "green"
} else if (o.content && !o.reply) {//
return "orange"
@ -1198,7 +1198,7 @@ export default {
if (isSame) {
return;
}
if (!isOldValueEmpty && !(isSame) && (this.templateFillType === "actFill" || this.templateFillType === "blxjsh")) {
if (!isOldValueEmpty && !(isSame) && (this.templateFillType === "actFill" || this.templateFillType === "blxjsh")&&this.type !== "attachment") {
// EventBus
EventBus.$emit('showEditSignDialog', { uuid: this.uuid });
} else {//
@ -1284,6 +1284,11 @@ export default {
recordOldVlaue = `${this.item.checkboxLabel || ""}:${this.oldValue?'勾选':'未勾选'}`;
recordValue = `${this.item.checkboxLabel||""}:${this.inputValue?'勾选':'未勾选'}`;
isModify = this.oldValue !== '';
}else if(this.type === "attachment"){
const attList = JSON.parse(recordValue);
const oldAttList = JSON.parse(recordOldVlaue || "[]");
recordValue = attList.map(item => item.name).join(";");
recordOldVlaue = oldAttList.map(item => item.name).join(";");
}
const record = {
...baseInfo,

+ 8
- 5
src/views/business/comps/template/comps/sp/comps/LadderConfig.vue View File

@ -109,13 +109,14 @@ export default {
methods: {
//
onAddRow(e) {
const {dataSource} = e;
const {dataSource=[]} = e;
const rowInfo = {
actSolutionVolumePrecision: 3,//3
actSolutionConcentrationPrecision: 3,//3
targetDiluentVolumePrecision: 3,//3
targetStartSolutionVolumePrecision: 3,//3
id:getuuid(),
rowIndex:dataSource.length,
};
if(this.ladderType === 'bq' && this.sn =="LBA005"){
rowInfo.targetSolutionCode = `LBA-STD${dataSource.length + 1}`;
@ -212,7 +213,8 @@ export default {
const { targetStartSolution, subTargetStartSolution } = this.$refs.formPackageRef?.getFilledFormData();
const params = {
subTargetStartSolution,
headerSelectFields
headerSelectFields,
dataSource,
}
if (targetStartSolution) {
this.updateTargetStartSolutionVolume(item, targetStartSolution, params);
@ -266,15 +268,16 @@ export default {
}
},
bodySelectChange(data) {
this.paralleUpdateTargetStartSolutionVolume(data.item, data.headerSelectFields);
this.paralleUpdateTargetStartSolutionVolume(data.item, data.headerSelectFields, data.dataSource);
},
//
paralleUpdateTargetStartSolutionVolume(item, headerSelectFields) {
paralleUpdateTargetStartSolutionVolume(item, headerSelectFields, dataSource) {
const volumne = item.targetStartSolutionConcentration;
const subTargetStartSolution = item.targetStartSolutionConcentrationPrecision;
const params = {
headerSelectFields,
subTargetStartSolution
subTargetStartSolution,
dataSource,
}
if (volumne) {
this.updateTargetStartSolutionVolume(item, volumne, params);

+ 33
- 19
src/views/business/comps/template/mixins/templateMixin.js View File

@ -503,18 +503,19 @@ export default {
targetDiluentVolumePrecision: 3, //小数点精度默认为3
targetStartSolutionVolumePrecision: 3, //小数点精度默认为3
targetSolutionCode: `CA-WS-STD${Number(codeSTD) - index}`,
id:getuuid()
id:getuuid(),
rowIndex:index,
}))
this.$refs.stepTableRef.updateDataSource(arr)
} else if (key === 'targetStartSolution' || key === 'subTargetStartSolution') {
//起始溶液体积失焦时,更新目标溶液预计浓度
const arr = this.$refs.stepTableRef?.getDataSource();
const { headerSelectFields } = this.$refs.stepTableRef?.getFilledFormData();
const { headerSelectFields,stepTableFormData=[] } = this.$refs.stepTableRef?.getFilledFormData();
const params = {
subTargetStartSolution,
headerSelectFields
}
headerSelectFields,
dataSource:stepTableFormData,
}
arr.forEach((item, rowIndex) => {
this.updateTargetStartSolutionVolume(
item,
@ -526,6 +527,7 @@ export default {
},
//批量更新目标起始源溶液体积
batchUpdateTargetStartSolutionVolume(arr, startConcentration, params) {
params.dataSource = arr;
arr.forEach((item, rowIndex) => {
this.updateTargetStartSolutionVolume(
item,
@ -553,7 +555,8 @@ export default {
)
const params = {
subTargetStartSolution: subTargetStartSolution,
headerSelectFields
headerSelectFields,
dataSource
}
if (isValueEmpty(volume)) {
this.$message.error('请先选择预设起始源溶液浓度')
@ -593,13 +596,17 @@ export default {
//计算目标溶液浓度
calcNd(item, targetAcSolution, params) {
console.log(params, "ppp")
console.log(item,params, "ppp")
// debugger
//targetStartSolutionUnit(实际起始源溶液浓度单位)
const { targetStartSolutionUnit, headerSelectFields } = params;
const { actStartSolutionVolumeUnit, actSolutionVolumeUnit, actDiluentVolumeUnit, actSolutionConcentrationUnit } = headerSelectFields;
let initUnit = targetStartSolutionUnit;
if (item.rowIndex > 0) {
initUnit = actSolutionConcentrationUnit;
}
//actStartSolutionVolumeUnit(实际起始源溶液体积单位)actSolutionVolumeUnit(实际目标溶液体积单位)
//actDiluentVolumeUnit(实际稀释液体积单位)actSolutionConcentrationUnit(实际目标溶液浓度单位)
const { actStartSolutionVolumeUnit, actSolutionVolumeUnit, actDiluentVolumeUnit, actSolutionConcentrationUnit } = headerSelectFields;
//实际源溶液浓度÷(实际终体积÷源溶液加入体积);
const precision = item.actSolutionConcentrationPrecision
const volPrecision = item.actSolutionVolumePrecision;
@ -607,10 +614,9 @@ export default {
const actDiluentVolume = item.actDiluentVolume
//实际起始源溶液体积
const actStartSolutionVolume = item.actStartSolutionVolume
if (isValueEmpty(actStartSolutionVolume) || isValueEmpty(actDiluentVolume) || isValueEmpty(targetStartSolutionUnit)) {
if (isValueEmpty(actStartSolutionVolume) || isValueEmpty(actDiluentVolume) || isValueEmpty(initUnit)) {
return false
}
const converActDiluentVolume = volumeConverter.convert(actDiluentVolume + actDiluentVolumeUnit, actSolutionVolumeUnit)
const converActStartSolutionVolume = volumeConverter.convert(actStartSolutionVolume + actStartSolutionVolumeUnit, actSolutionVolumeUnit)
//实际源溶液加入体积+实际稀释液加入体积
@ -620,12 +626,12 @@ 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("/");
const converArr = (targetAcSolution+'').split("/");
converArr.map((item)=>{
return convertConcentration.convert(item + targetStartSolutionUnit, actSolutionConcentrationUnit)
return convertConcentration.convert(item + initUnit, actSolutionConcentrationUnit)
})
console.log(converArr,"converArr")
const converTargetAcSolution = convertConcentration.convert(targetAcSolution + targetStartSolutionUnit, actSolutionConcentrationUnit)
const converTargetAcSolution = convertConcentration.convert(targetAcSolution + initUnit, actSolutionConcentrationUnit)
// 实际目标溶液浓度 = 实际源溶液浓度÷(实际终体积÷源溶液加入体积);
const actNd = (
parseFloat(converTargetAcSolution) / (
@ -644,15 +650,22 @@ export default {
},
//更新起始溶液体积时,计算预设起始溶液体积和预设稀释液体积
updateTargetStartSolutionVolume(item, volume, unitParams) {
const { rowIndex } = item
const { subTargetStartSolution, headerSelectFields, dataSource=[] } = unitParams
const { targetSolutionConcentrationUnit, targetSolutionVolumeUnit, targetStartSolutionVolumeUnit, targetDiluentVolumeUnit } = headerSelectFields
let initNd = volume,unit = subTargetStartSolution;
if (rowIndex > 0) {
initNd = dataSource[rowIndex - 1].targetSolutionConcentration;
unit = targetSolutionConcentrationUnit;
}
const precision = item.targetStartSolutionVolumePrecision || 0
const concentration = item.targetSolutionConcentration
const targetVolume = item.targetSolutionVolume
const { subTargetStartSolution, headerSelectFields } = unitParams
const { targetSolutionConcentrationUnit, targetSolutionVolumeUnit, targetStartSolutionVolumeUnit, targetDiluentVolumeUnit } = headerSelectFields
if (
isValueEmpty(concentration) ||
isValueEmpty(targetVolume) ||
isValueEmpty(subTargetStartSolution) ||
isValueEmpty(unit) ||
isValueEmpty(targetSolutionConcentrationUnit) ||
isValueEmpty(targetSolutionVolumeUnit) ||
isValueEmpty(targetStartSolutionVolumeUnit) ||
@ -660,14 +673,15 @@ export default {
) {
return;
}
const targetStartVolUnit = targetSolutionConcentrationUnit.split("/")[1];//先按照预设目标溶液浓度的单位标准
const volumeArr = volume.split("/");
const volumeArr = (initNd+'').split("/");
const converArr = volumeArr.map((item)=>{
return convertConcentration.convert(item + subTargetStartSolution, targetSolutionConcentrationUnit)
return convertConcentration.convert(item + unit, targetSolutionConcentrationUnit)
})
console.log(converArr,"converArr")
//将起始溶液浓度转换为和预设目标溶液浓度一样的单位再计算;
const converStartCon = convertConcentration.convert(volume + subTargetStartSolution, targetSolutionConcentrationUnit)
const converStartCon = convertConcentration.convert(initNd + unit, targetSolutionConcentrationUnit)
//将预设目标溶液体积转换为和预设目标溶液浓度单位的分母一样的单位再计算;如:预设目标溶液浓度单位为mg/mL,预设目标溶液体积单位为uL,则将预设目标溶液体积转换为mL
const convertTargetVol = volumeConverter.convert(targetVolume + targetSolutionVolumeUnit, targetStartVolUnit)

Loading…
Cancel
Save