Browse Source

feat:[模板管理][update]

luojie
luojie 3 weeks ago
parent
commit
1cdf0a0a90
8 changed files with 237 additions and 26 deletions
  1. +3
    -0
      src/components/Template/Step.vue
  2. +186
    -0
      src/components/Template/StepComponents/pcr/lx.vue
  3. +8
    -5
      src/components/Template/StepComponents/ry/jd.vue
  4. +9
    -1
      src/components/Template/StepComponents/xb/bpqr.vue
  5. +7
    -4
      src/components/Template/StepFormPackage.vue
  6. +8
    -0
      src/components/Template/mixins/stepMixins.js
  7. +1
    -1
      src/components/Template/operation/TableOpertaion.vue
  8. +15
    -15
      src/views/business/comps/template/mixins/templateMixin.js

+ 3
- 0
src/components/Template/Step.vue View File

@ -193,6 +193,7 @@ import xfzzysjg from './StepComponents/pcr/xfzzysjg.vue';//PCR-吸附柱转移
import xfzzylxg from './StepComponents/pcr/xfzzylxg.vue';//PCR-
import xt from './StepComponents/pcr/xt.vue';//PCR-
import ecxt from './StepComponents/pcr/ecxt.vue';//PCR-
import lx_pcr from './StepComponents/pcr/lx.vue';//PCR-
//PCR
@ -491,6 +492,7 @@ export default {
xfzzylxg,
xt,
ecxt,
lx_pcr,
//PCR
ndcd,
@ -726,6 +728,7 @@ export default {
'xfzzylxg':'xfzzylxg',
'xt':'xt',
'ecxt':'ecxt',
'lx_pcr':'lx_pcr',
//PCR
'ndcd':'ndcd',

+ 186
- 0
src/components/Template/StepComponents/pcr/lx.vue View File

@ -0,0 +1,186 @@
<!-- 离心 -->
<template>
<StepFormPackage @select="select" ref="stepFormPackageRef" :prefixKey="stepIndex+'_'+'pcr_lx'" @resetRecord = "resetRecord" :form-config="formConfig" :formData="formData" />
</template>
<script>
import StepFormPackage from '@/components/Template/StepFormPackage.vue';
import stepMixins from '@/components/Template/mixins/stepMixins.js';
export default {
mixins: [stepMixins],
props: {
sn: {
type: String,
default: 'lx',
},
},
components: {
StepFormPackage
},
data() {
return {
sflx: '',
}
},
mounted() {
this.sflx = this.formData.sflx;
},
methods: {
select(e) {
// this.formData.sflx = val;
const {value,key} =e;
if(key === "sflx"){
this.sflx = value;
}
}
},
computed: {
formConfig() {
const config1 = {
text1: {
label: "使用离心机",
type: "text",
},
yq: {
type: "yq",
fillType: "actFill",
},
text2: {
label: "仪器,设置预计温度为",
type: "text",
},
rm: {
type: "inputNumber",
fillType: "preFill",
},
text3: {
label: "°C,实际设置温度为",
type: "text",
},
rxry: {
type: "inputNumber",
fillType: "actFill",
compareTo:"rm",
copyFrom:"rm"
},
text4: {
label: "°C,设置预计转速为",
type: "text",
},
sjjrl: {
type: "inputNumber",
fillType: "preFill",
},
sjjrldw: {
type: "select",
options: this.getDictOptions("business_zsdw"),
selectTo: "sjzsdw",
fillType: "preFill",
},
text5: {
label: ",实际设置转速为",
type: "text",
},
jxry: {
type: "inputNumber",
fillType: "actFill",
compareTo:"sjjrl",
copyFrom:"sjjrl"
},
sjzsdw: {
type: "select",
options: this.getDictOptions("business_zsdw"),
fillType: "preFill",
},
text6: {
label: ",设置预计时长为",
type: "text",
},
sjjrl1: {
type: "inputNumber",
fillType: "preFill",
},
yqsc: {
type: "select",
options: this.getDictOptions("business_yqscdw"),
selectTo: "sjscdw",
fillType: "preFill",
},
text7: {
label: ",实际设置时长为",
type: "text",
},
sjsc: {
type: "inputNumber",
fillType: "actFill",
compareTo:"sjjrl1",
copyFrom:"sjjrl1"
},
sjscdw: {
type: "select",
options: this.getDictOptions("business_yqscdw"),
fillType: "preFill",
},
text8: {
label: ",进行离心。离心",
type: "text",
},
startDate: {
type: "input",
fillType: "actFill",
disabled: true,
},
button1: {
type: "button",
buttonName: "开始",
},
}
const config2 = {
text:{
type: "text",
label: "。",
}
}
let lxConfig = {};
if(this.sflx === '是'){
lxConfig = config1;
}else{
lxConfig = config2;
}
if(!this.sflx){
lxConfig = {...config2,...config1};
}
console.log(lxConfig,"lxConfig");
return [{
config: {
sflx: {
type: "radio",
fillType:"actFill",
options: [
{
label: "是",
value: "是",
},
{
label: "否",
value: "否",
},
],
},
lxtext:{
type: "text",
label: "需要离心",
},
...lxConfig
}
}]
}
},
}
</script>
<style lang="scss" scoped></style>

+ 8
- 5
src/components/Template/StepComponents/ry/jd.vue View File

@ -23,7 +23,10 @@ export default {
},
methods: {
select(data) {
console.log(data, "select")
const {value,key} = data;
if(key==='sjccwz'){
this.updateWcData("sjwd",value);
}
}
},
computed: {
@ -36,8 +39,8 @@ export default {
type: "text",
},
ccwz: {
type: "select",
options: this.getDictOptions("business_ccwz"),
type: "input",
// options: this.getDictOptions("business_ccwz"),
fillType: "preFill",
otherCode: "ccwzOther",
},
@ -149,8 +152,8 @@ export default {
type: "text",
},
ccwz: {
type: "select",
options: this.getDictOptions("business_ccwz"),
type: "input",
// options: this.getDictOptions("business_ccwz"),
fillType: "preFill",
otherCode: "ccwzOther",
},

+ 9
- 1
src/components/Template/StepComponents/xb/bpqr.vue View File

@ -1,6 +1,6 @@
<!-- 破片确认 -->
<template>
<StepFormPackage ref="stepFormPackageRef" :prefixKey="stepIndex+'_'+'xb_bpqr'" @resetRecord = "resetRecord" :form-config="formConfig" :formData="formData" />
<StepFormPackage ref="stepFormPackageRef" @select="select" :prefixKey="stepIndex+'_'+'xb_bpqr'" @resetRecord = "resetRecord" :form-config="formConfig" :formData="formData" />
</template>
<script>
@ -18,6 +18,14 @@ export default {
components: {
StepFormPackage
},
methods: {
select(data) {
const {value,key} = data;
if(key==='ccwz'){
this.updateWcData("wc",value);
}
}
},
computed: {
formConfig() {
let config = [{

+ 7
- 4
src/components/Template/StepFormPackage.vue View File

@ -1,7 +1,7 @@
<template>
<div>
<div v-for="(item, index) in formConfig" :key="index" class="step-form-package">
<div v-for="(sItem, key) in item.config" class="step-item" :key="key">
<div v-for="(sItem, key) in item.config" class="step-item" :class="sItem.type === 'radio' ? 'radio-row' : ''" :key="key">
<template v-if="sItem.type === 'input'">
<HandleFormItem class="step-row" :field-item-label="fieldItemLabel" @blur="onBlur(key, $event)"
:item="sItem" v-model="formFields[key]" :field-key="prefixKey+'_' + key"
@ -21,9 +21,9 @@
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" />
</template>
<template v-else-if="sItem.type === 'checkbox'">
<HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey+'_' + key"
type="checkbox" :item="sItem" v-model="formFields[key]"
<template v-else-if="sItem.type === 'checkbox' || sItem.type === 'radio'">
<HandleFormItem :class="sItem.type === 'checkbox' ? 'step-row' : ''" :field-item-label="fieldItemLabel" :field-key="prefixKey+'_' + key"
:type="sItem.type" :item="sItem" v-model="formFields[key]"
@change="onSelectChange(key, $event, sItem.type)"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" />
@ -254,4 +254,7 @@ export default {
margin-bottom: 10px;
min-height: 28px;
}
.radio-row{
padding-top: 4px;
}
</style>

+ 8
- 0
src/components/Template/mixins/stepMixins.js View File

@ -32,5 +32,13 @@ export default {
resetRecord() {
this.$refs.stepFormPackageRef.resetRecord();
},
//更新温层数据
updateWcData(key,value) {
const options = this.getDictOptions("business_ccwz");
const selectedOption = options.find(item => item.value === value);
if (selectedOption) {
this.$refs.stepFormPackageRef.updateFormData(key, [selectedOption.raw.remark]);
}
}
},
}

+ 1
- 1
src/components/Template/operation/TableOpertaion.vue View File

@ -167,7 +167,7 @@ export default {
if (innerRow.fzsj) {
defaultData = {...innerRow.fzsj,...defaultData}
}
EventBus.$emit("showSubPackageDialog", {...defaultData,uuid:this.uuid})
EventBus.$emit("showSubPackageDialog", {...defaultData,uuid:this.uuid,packageType:"ryList"})
},
onSubPackageSubmit(data) {
if (data.uuid === this.uuid) {

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

@ -695,24 +695,24 @@ export default {
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 {
if(mbyjndArr.length !== initNdArr.length){
this.$message.error("起始溶液浓度和目标溶液浓度格式不一致,请重新输入")
return
}
//预设体积
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("/");
},
// 导出excel模板
exportExcel(headerArray, title = '导出模板') {

Loading…
Cancel
Save