Browse Source

feat:[模板管理][update]

lkf
luojie 2 months ago
parent
commit
dc25b383ef
15 changed files with 824 additions and 105 deletions
  1. +25
    -1
      src/components/Template/Step.vue
  2. +84
    -0
      src/components/Template/StepComponents/ry/bdtj.vue
  3. +68
    -0
      src/components/Template/StepComponents/ry/bdzl.vue
  4. +115
    -0
      src/components/Template/StepComponents/ry/lx.vue
  5. +107
    -0
      src/components/Template/StepComponents/ry/tjphcz.vue
  6. +103
    -0
      src/components/Template/StepComponents/ry/tjphfcz.vue
  7. +1
    -1
      src/components/Template/StepComponents/ry/tpjydd.vue
  8. +2
    -2
      src/components/Template/StepComponents/ry/tpjysd.vue
  9. +111
    -0
      src/components/Template/StepComponents/ry/ym.vue
  10. +1
    -1
      src/components/Template/mixins/stepMixins.js
  11. +9
    -2
      src/components/Template/operation/TableOpertaion.vue
  12. +50
    -9
      src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue
  13. +115
    -86
      src/views/business/comps/template/comps/sp/SWYPNBGZYZBB.vue
  14. +1
    -1
      src/views/business/comps/template/dialog/SubPackageDialog.vue
  15. +32
    -2
      src/views/business/comps/template/mixins/templateMixin.js

+ 25
- 1
src/components/Template/Step.vue View File

@ -42,6 +42,14 @@ import Tpjysd from './StepComponents/ry/tpjysd.vue';//溶液-天平校验(双点
import Qywz from './StepComponents/ry/qywz.vue';//- import Qywz from './StepComponents/ry/qywz.vue';//-
import Clfcz from './StepComponents/ry/clfcz.vue';// import Clfcz from './StepComponents/ry/clfcz.vue';//
import Clcz from './StepComponents/ry/clcz.vue';// import Clcz from './StepComponents/ry/clcz.vue';//
import Bdtj from './StepComponents/ry/bdtj.vue';//
import Bdzl from './StepComponents/ry/bdzl.vue';//
import Tjphcz from './StepComponents/ry/tjphcz.vue';//PH()
import Tjphfcz from './StepComponents/ry/tjphfcz.vue';//PH()
import Lx from './StepComponents/ry/lx.vue';//
const stepTypes = [ const stepTypes = [
@ -54,6 +62,12 @@ const stepTypes = [
{ label: '取用物质', value: 'qywz' }, { label: '取用物质', value: 'qywz' },
{ label: '称量(非传值)', value: 'clfcz' }, { label: '称量(非传值)', value: 'clfcz' },
{ label: '称量(传值)', value: 'clcz' }, { label: '称量(传值)', value: 'clcz' },
{ label: '标定(体积)', value: 'bdtj' },
{ label: '标定(质量)', value: 'bdzl' },
{ label: '调节PH(传值)', value: 'tjphcz' },
{ label: '调节PH(非传值)', value: 'tjphfcz' },
{ label: '离心', value: 'lx' },
]; ];
export default { export default {
@ -88,6 +102,11 @@ export default {
Qywz, Qywz,
Clfcz, Clfcz,
Clcz, Clcz,
Bdtj,
Bdzl,
Tjphcz,
Tjphfcz,
Lx,
}, },
computed: { computed: {
stepComponentMap() { stepComponentMap() {
@ -102,6 +121,11 @@ export default {
'qywz': 'Qywz', 'qywz': 'Qywz',
'clfcz': 'Clfcz', 'clfcz': 'Clfcz',
'clcz': 'Clcz', 'clcz': 'Clcz',
'bdtj': 'Bdtj',
'bdzl': 'Bdzl',
'tjphcz': 'Tjphcz',
'tjphfcz': 'Tjphfcz',
'lx': 'Lx',
} }
} }
return this.componentMap return this.componentMap
@ -385,7 +409,7 @@ export default {
.step-content { .step-content {
display: flex; display: flex;
align-items: start;
align-items: flex-start;
} }
} }
} }

+ 84
- 0
src/components/Template/StepComponents/ry/bdtj.vue View File

@ -0,0 +1,84 @@
<!-- 标定(体积) -->
<template>
<StepFormPackage ref = "stepFormPackageRef" :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],
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config:{
text1:{
label:"使用",
type:"text",
},
ddsys:{
type:"input",
fillType:"preFill",
},
yq:{
type:"instrument",
fillType:"actFill",
},
text2:{
label:"仪器,使用标定物",
type:"text",
},
rm:{
type:"input",
fillType:"preFill",
},
sj:{
type:"reagent",
fillType:"actFill",
},
text3:{
label:",预计标定体积为",
type:"text",
},
bdtj:{
type:"inputNumber",
fillType:"preFill",
},
bdtjdw:{
type:"select",
options:this.getDictOptions("business_tjdw"),
selectTo:"sjbdtjdw",
fillType:"preFill",
},
text4:{
label:",实际体积为",
type:"text",
},
sjbdtj:{
type:"inputNumber",
fillType:"actFill",
},
sjbdtjdw:{
type:"select",
options:this.getDictOptions("business_tjdw"),
fillType:"preFill",
},
text5:{
label:",划线。",
type:"text",
},
}
}]
}
},
}
</script>
<style lang="scss" scoped>
</style>

+ 68
- 0
src/components/Template/StepComponents/ry/bdzl.vue View File

@ -0,0 +1,68 @@
<!-- 标定(质量) -->
<template>
<StepFormPackage ref = "stepFormPackageRef" :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],
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config:{
text1:{
label:"使用电子天平",
type:"text",
},
yq:{
type:"instrument",
fillType:"actFill",
},
text2:{
label:"仪器,称取水,其预计标定质量为",
type:"text",
},
rm:{
type:"inputNumber",
fillType:"preFill",
},
bdtjdw:{
type:"select",
options:this.getDictOptions("business_zldw"),
selectTo:"sjbdtjdw",
fillType:"preFill",
},
text4:{
label:",实际质量为",
type:"text",
},
sjbdtj:{
type:"inputNumber",
fillType:"actFill",
},
button1:{
type:"button",
buttonName:"获取值",
},
text5:{
label:",划线。",
type:"text",
},
}
}]
}
},
}
</script>
<style lang="scss" scoped>
</style>

+ 115
- 0
src/components/Template/StepComponents/ry/lx.vue View File

@ -0,0 +1,115 @@
<!-- 离心 -->
<template>
<StepFormPackage ref="stepFormPackageRef" :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],
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config: {
text1: {
label: "使用离心机",
type: "text",
},
yq: {
type: "instrument",
fillType: "actFill",
},
text2: {
label: "仪器,设置预计温度为",
type: "text",
},
rm: {
type: "inputNumber",
fillType: "preFill",
},
text3: {
label: "°C,实际温度为",
type: "text",
},
rxry: {
type: "inputNumber",
fillType: "actFill",
},
text4: {
label: "°C,设置预计转速为",
type: "text",
},
sjjrl: {
type: "input",
fillType: "actFill",
},
sjjrldw: {
type: "select",
options: this.getDictOptions("business_zsdw"),
selectTo: "sjzsdw",
fillType: "actFill",
},
text5: {
label: "°C,实际转速为",
type: "text",
},
jxry: {
type: "inputNumber",
fillType: "actFill",
},
sjzsdw: {
type: "select",
options: this.getDictOptions("business_zsdw"),
fillType: "actFill",
},
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",
},
sjscdw: {
type: "select",
options: this.getDictOptions("business_yqscdw"),
fillType: "preFill",
},
text8: {
label: ",进行离心。离心",
type: "text",
},
button1: {
type: "button",
buttonName: "开始",
},
}
}]
}
},
}
</script>
<style lang="scss" scoped></style>

+ 107
- 0
src/components/Template/StepComponents/ry/tjphcz.vue View File

@ -0,0 +1,107 @@
<!-- 调节PH(传值) -->
<template>
<StepFormPackage ref="stepFormPackageRef" :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],
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config: {
text1: {
label: "使用PH测量仪",
type: "text",
},
yq: {
type: "instrument",
fillType: "actFill",
},
text2: {
label: "仪器,目标PH值为",
type: "text",
},
rm: {
type: "inputNumber",
fillType: "preFill",
},
text3: {
label: ",加入酸性溶液",
type: "text",
},
rxry: {
type: "input",
fillType: "preFill",
},
sj1: {
type: "regent",
fillType: "actFill",
},
text4: {
label: "进行调节,实际加入量为",
type: "text",
},
sjjrl: {
type: "input",
fillType: "actFill",
},
sjjrldw: {
type: "select",
options: this.getDictOptions("business_tjdw"),
selectTo: "sjbdtjdw",
fillType: "actFill",
},
text5: {
label: ",加入碱性溶液",
type: "text",
},
jxry: {
type: "input",
fillType: "preFill",
},
sj2: {
type: "regent",
fillType: "actFill",
},
text6: {
label: "进行调节,实际加入量为",
type: "text",
},
sjjrl1: {
type: "input",
fillType: "actFill",
},
sjjrldw1: {
type: "select",
options: this.getDictOptions("business_tjdw"),
selectTo: "sjbdtjdw",
fillType: "actFill",
},
text7: {
label: ",调节后实际PH值为",
type: "text",
},
ph: {
type: "inputNumber",
fillType: "actFill",
},
button1: {
type: "button",
buttonName: "获取值",
},
}
}]
}
},
}
</script>
<style lang="scss" scoped></style>

+ 103
- 0
src/components/Template/StepComponents/ry/tjphfcz.vue View File

@ -0,0 +1,103 @@
<!-- 调节PH(非传值) -->
<template>
<StepFormPackage ref="stepFormPackageRef" :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],
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config: {
text1: {
label: "使用PH测量仪",
type: "text",
},
yq: {
type: "instrument",
fillType: "actFill",
},
text2: {
label: "仪器,目标PH值为",
type: "text",
},
rm: {
type: "inputNumber",
fillType: "preFill",
},
text3: {
label: ",加入酸性溶液",
type: "text",
},
rxry: {
type: "input",
fillType: "preFill",
},
sj1: {
type: "regent",
fillType: "actFill",
},
text4: {
label: "进行调节,实际加入量为",
type: "text",
},
sjjrl: {
type: "input",
fillType: "actFill",
},
sjjrldw: {
type: "select",
options: this.getDictOptions("business_tjdw"),
selectTo: "sjbdtjdw",
fillType: "actFill",
},
text5: {
label: ",加入碱性溶液",
type: "text",
},
jxry: {
type: "input",
fillType: "preFill",
},
sj2: {
type: "regent",
fillType: "actFill",
},
text6: {
label: "进行调节,实际加入量为",
type: "text",
},
sjjrl1: {
type: "input",
fillType: "actFill",
},
sjjrldw1: {
type: "select",
options: this.getDictOptions("business_tjdw"),
selectTo: "sjbdtjdw",
fillType: "actFill",
},
text7: {
label: ",调节后实际PH值为",
type: "text",
},
ph: {
type: "inputNumber",
fillType: "actFill",
},
}
}]
}
},
}
</script>
<style lang="scss" scoped></style>

+ 1
- 1
src/components/Template/StepComponents/ry/tpjydd.vue View File

@ -62,7 +62,7 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
options:this.getDictOptions("business_zldw") options:this.getDictOptions("business_zldw")
}, },
text5:{ text5:{
label:"标准砝码修正值为",
label:"标准砝码修正值为",
type:"text", type:"text",
}, },
sjsr3:{ sjsr3:{

+ 2
- 2
src/components/Template/StepComponents/ry/tpjysd.vue View File

@ -71,7 +71,7 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
options:this.getDictOptions("business_zldw") options:this.getDictOptions("business_zldw")
}, },
dfmtext5:{ dfmtext5:{
label:"标准砝码修正值为",
label:"标准砝码修正值为",
type:"text", type:"text",
}, },
dfmsjsr3:{ dfmsjsr3:{
@ -161,7 +161,7 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
options:this.getDictOptions("business_zldw") options:this.getDictOptions("business_zldw")
}, },
text5:{ text5:{
label:"标准砝码修正值为",
label:"标准砝码修正值为",
type:"text", type:"text",
}, },
sjsr3:{ sjsr3:{

+ 111
- 0
src/components/Template/StepComponents/ry/ym.vue View File

@ -0,0 +1,111 @@
<!-- 研磨 -->
<template>
<StepFormPackage ref = "stepFormPackageRef" :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],
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config:{
text1:{
label:"使用",
type:"text",
},
ymj:{
type:"input",
fillType:"preFill",
},
text2:{
label:"同时使用",
type:"text",
},
ymj2:{
type:"input",
fillType:"preFill",
},
yq:{
type:"instrument",
fillType:"actFill",
},
text3:{
label:"仪器,吸取",
type:"text",
},
ry1:{
type:"input",
fillType:"preFill",
},
sj:{
type:"regent",
fillType:"actFill",
},
text4:{
label:"溶媒,加入预计体积为",
type:"text",
},
ry2:{
type:"input",
fillType:"preFill",
},
rytj:{
type:"select",
options: this.getDictOptions("business_tjdw"),
selectTo: "sjrytjdw",
fillType: "preFill",
},
text5:{
label:",实际体积为",
type:"text",
},
ry3:{
type:"input",
fillType:"actFill",
},
sjrytjdw:{
type:"select",
options: this.getDictOptions("business_tjdw"),
fillType: "preFill",
},
text6:{
label:"至研钵中,研磨至",
type:"text",
},
klzt:{
type:"input",
fillType:"preFill",
},
text7:{
label:"。研磨",
type:"text",
},
button1:{
type:"button",
buttonName:"开始"
},
text8:{
label:"研磨",
type:"text",
},
button2:{
type:"button",
buttonName:"结束"
},
}
}]
}
},
}
</script>
<style lang="scss" scoped>
</style>

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

@ -1,5 +1,5 @@
export default { export default {
dicts:["business_tjdw","business_czhj","business_rqcz","business_zldw"],
dicts:["business_tjdw","business_czhj","business_rqcz","business_zldw","business_yqscdw","business_zsdw"],
props: { props: {
formData: { formData: {
type: Object, type: Object,

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

@ -56,7 +56,7 @@ export default {
watch: { watch: {
row: { row: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
this.innerRow = newVal;
this.innerRow = JSON.parse(JSON.stringify(newVal));
}, },
deep: true, deep: true,
} }
@ -66,6 +66,10 @@ export default {
innerRow: this.row, innerRow: this.row,
} }
}, },
mounted() {
console.log("mounted")
},
methods: { methods: {
// //
onStartConfig() { onStartConfig() {
@ -88,6 +92,8 @@ export default {
// //
onSubPackage() { onSubPackage() {
const { columns, innerRow } = this; const { columns, innerRow } = this;
console.log(columns,innerRow,"inner")
const { headerSelectFields, columnsData } = columns; const { headerSelectFields, columnsData } = columns;
const col = columnsData.find((item) => item.myCodeFields); const col = columnsData.find((item) => item.myCodeFields);
const { myCodeFields, maxVolumeField, maxVolumeFieldUnit } = col; const { myCodeFields, maxVolumeField, maxVolumeFieldUnit } = col;
@ -106,9 +112,10 @@ export default {
units.push(headerSelectFields[key]) units.push(headerSelectFields[key])
}) })
const {total,unit} = addTj(cols,units) const {total,unit} = addTj(cols,units)
let defaultData = { mybh: fields.join(""), maxVolume: total, maxVolumeUnit: unit, rowIndex: this.rowIndex } let defaultData = { mybh: fields.join(""), maxVolume: total, maxVolumeUnit: unit, rowIndex: this.rowIndex }
if (innerRow.fzsj) { if (innerRow.fzsj) {
defaultData = innerRow.fzsj
defaultData = {...innerRow.fzsj,...defaultData}
} }
EventBus.$emit("showSubPackageDialog", defaultData) EventBus.$emit("showSubPackageDialog", defaultData)
}, },

+ 50
- 9
src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue View File

@ -20,7 +20,7 @@
:showOperation="fillType === 'actFill'" ref="stepTableRef" :columns="stepColumns" :showOperation="fillType === 'actFill'" ref="stepTableRef" :columns="stepColumns"
:formData="formData"> :formData="formData">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion @printTag="printTag" @subPackageSubmit="subPackageSubmit" :fillType="fillType" :row="row"
<TableOpertaion @startConfig="startConfig" @configComplete="configComplete" @printTag="printTag" @subPackageSubmit="subPackageSubmit" :fillType="fillType" :row="row"
:rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow"></TableOpertaion> :rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow"></TableOpertaion>
</template> </template>
</CustomTable> </CustomTable>
@ -47,8 +47,7 @@ import CustomTable from '@/components/Template/CustomTable.vue';
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"; import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue";
import { EventBus } from "@/utils/eventBus"; import { EventBus } from "@/utils/eventBus";
import moment from 'moment';
import { addTj } from "@/utils/calUnitTools";
export default { export default {
name: "SWYPBQGZYZBB", name: "SWYPBQGZYZBB",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion }, components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion },
@ -417,6 +416,27 @@ export default {
mounted() { mounted() {
}, },
methods: { methods: {
startConfig(val){
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);
},
// //
printTag(data) { printTag(data) {
const printConfig = this.getBasePrintConfig(data); const printConfig = this.getBasePrintConfig(data);
@ -424,8 +444,26 @@ export default {
}, },
// //
subPackageSubmit(data) { subPackageSubmit(data) {
const { fzsj, rowData } = data;
console.log(data, "子项提交事件")
const { fzsj, rowData,headerSelectFields } = data;
const {fzList = [],dw="",mybh} = fzsj;
if(fzList && fzList.length>0){
const list = fzList.map((item)=>{
return{
bh:mybh+item.subCode,
kc:item.num,
kcdw:dw,
}
})
let postData = {
studyId:this.formData.studyId,
studyFormId:this.formData.id,
bh:mybh,
nd:rowData.actSolutionConcentration || 0,
nddw:headerSelectFields.actSolutionConcentrationUnit,
list:list
}
this.subPackageRequest(postData);
}
}, },
// //
async handleUpdateCode() { async handleUpdateCode() {
@ -477,32 +515,35 @@ export default {
}, },
//table //table
updateStepTableData(row) { updateStepTableData(row) {
const { stepTableFormData = [] } = this.formData;
const {stepTableFormData = []} = this.$refs.stepTableRef.getFilledFormData();
// //
const newStepTableData = JSON.parse(JSON.stringify(stepTableFormData)); const newStepTableData = JSON.parse(JSON.stringify(stepTableFormData));
// //
for (let i = 0; i < newStepTableData.length; i++) { for (let i = 0; i < newStepTableData.length; i++) {
const item = newStepTableData[i];
const volume = item.actStartSolutionVolume || 0;
if (i === 0) { if (i === 0) {
// row.code // row.code
newStepTableData[i].startSolutionCode = row.code;
newStepTableData[i].startSolutionCode = row.bh;
} else { } else {
// targetSolutionCode // targetSolutionCode
// targetSolutionCode // targetSolutionCode
newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode; newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode;
} }
this.updateSjmbrynd(item, row.nd)
} }
// stepTableRef // stepTableRef
this.$refs.stepTableRef.updateDataSource(newStepTableData); this.$refs.stepTableRef.updateDataSource(newStepTableData);
}, },
async getFormData() { async getFormData() {
return await this.validFormFields(["baseInfoRef", , "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
return await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
}, },
async onSave() { async onSave() {
// const formData = await this.getFormData(); // const formData = await this.getFormData();
const formData = await this.validFormFields(["baseInfoRef", , "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
const formData = await this.validFormFields(["baseInfoRef","stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
console.log(formData, "formData") console.log(formData, "formData")
} }

+ 115
- 86
src/views/business/comps/template/comps/sp/SWYPNBGZYZBB.vue View File

@ -2,7 +2,8 @@
<template> <template>
<div> <div>
<div class="detail-container"> <div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ getTemplateName() }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ getTemplateName() }}<img
src="@/assets/images/detail-title.png" /></div>
<div class="detail-content"> <div class="detail-content">
<div class="content"> <div class="content">
<BaseInfoFormPackage label="试验基本信息" ref="baseInfoRef" :formConfig="baseInfoFormConfig" <BaseInfoFormPackage label="试验基本信息" ref="baseInfoRef" :formConfig="baseInfoFormConfig"
@ -30,11 +31,15 @@
:ref="`ladderStepFormPackageRef_${ladderIndex}`" :formConfig="ladderStepFormConfig" :ref="`ladderStepFormPackageRef_${ladderIndex}`" :formConfig="ladderStepFormConfig"
@blur="onHandleBlur" :formData="ladderConfig" fieldItemLabel="阶梯配制" @blur="onHandleBlur" :formData="ladderConfig" fieldItemLabel="阶梯配制"
:prefixKey="'ladder_' + ladderIndex" /> :prefixKey="'ladder_' + ladderIndex" />
<CustomTable @blur="(e)=>onHandleTableBlur('ladder', ladderIndex,e)" :ref="`ladderStepTableRef_${ladderIndex}`"
:columns="ladderStepColumns" :formData="ladderConfig" :prefixKey="'ladder_' + ladderIndex"
fieldItemLabel="阶梯配制">
<CustomTable @blur="(e) => onHandleTableBlur('ladder', ladderIndex, e)"
:ref="`ladderStepTableRef_${ladderIndex}`" :columns="ladderStepColumns"
:formData="ladderConfig" :prefixKey="'ladder_' + ladderIndex" fieldItemLabel="阶梯配制">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion @printTag="(e) => printTag(e,'ladderConfigs',ladderIndex)" :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
<TableOpertaion @printTag="(e) => 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)"> @deleteRow="(rowIndex) => deleteRow(rowIndex, 'ladder', ladderIndex)">
</TableOpertaion> </TableOpertaion>
</template> </template>
@ -60,12 +65,15 @@
:ref="`paralleStepFormPackageRef_${paralleIndex}`" :formConfig="paralleStepFormConfig" :ref="`paralleStepFormPackageRef_${paralleIndex}`" :formConfig="paralleStepFormConfig"
@blur="onHandleBlur" :formData="paralleConfig" :prefixKey="'paralle' + paralleIndex" @blur="onHandleBlur" :formData="paralleConfig" :prefixKey="'paralle' + paralleIndex"
fieldItemLabel="平行配制" /> fieldItemLabel="平行配制" />
<CustomTable @blur="(e)=>onHandleTableBlur('paralle', paralleIndex,e)" :ref="`paralleStepTableRef_${paralleIndex}`"
:columns="paralleStepColumns" :formData="paralleConfig"
@clickable="(col,rowIndex) => handleTableClickable('paralle', paralleIndex, col,rowIndex)"
:prefixKey="'paralle' + paralleIndex" fieldItemLabel="平行配制">
<CustomTable @blur="(e) => onHandleTableBlur('paralle', paralleIndex, e)"
:ref="`paralleStepTableRef_${paralleIndex}`" :columns="paralleStepColumns"
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex" fieldItemLabel="平行配制">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion @printTag="(e) => printTag(e,'paralleConfigs',paralleIndex)" :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
<TableOpertaion @printTag="(e) => 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)"> @deleteRow="(rowIndex) => deleteRow(rowIndex, 'paralle', paralleIndex)">
</TableOpertaion> </TableOpertaion>
</template> </template>
@ -82,8 +90,7 @@
</div> </div>
<!-- <button @click="onSave">保存</button> --> <!-- <button @click="onSave">保存</button> -->
</div> </div>
<SelectReagentDialog @submit="onSelectReagentSubmit"
ref="selectReagentDialogRef">
<SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef">
</SelectReagentDialog> </SelectReagentDialog>
</div> </div>
</template> </template>
@ -98,7 +105,7 @@ import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue'; import CustomTable from '@/components/Template/CustomTable.vue';
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import TableOpertaion from "@/components/Template/operation/TableOpertaion.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 moment from "moment";
import { getLadderColumnsConfig, getParallelColumnsConfig, getLadderFormConfig, getBaseInfoFormConfig, getRemarkFormConfig, getStorageConditionFormConfig, getParalleStepFormConfig } from "../../formConfig/paralleAndLadderConfig.js"; import { getLadderColumnsConfig, getParallelColumnsConfig, getLadderFormConfig, getBaseInfoFormConfig, getRemarkFormConfig, getStorageConditionFormConfig, getParalleStepFormConfig } from "../../formConfig/paralleAndLadderConfig.js";
export default { export default {
@ -125,7 +132,7 @@ export default {
formData: { formData: {
immediate: true, immediate: true,
handler(v) { handler(v) {
if(v &&this.fillType === "actFill"){
if (v && this.fillType === "actFill") {
this.handleUpdateCode(); this.handleUpdateCode();
} }
} }
@ -168,94 +175,115 @@ export default {
dataSource: [], dataSource: [],
currentTableIndex: "",// currentTableIndex: "",//
currentTableKey: "",//key currentTableKey: "",//key
targetAcSolutionFromTable:true,//
targetAcSolutionFromTable: true,//
}; };
}, },
mounted() { 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 return this.templateData.templateMc
} }
const o = { const o = {
"SP004":"生物样品内标工作液制备表",
"SP005":"生物样品质控工作液制备表",
"SP006":"生物样品标准曲线/质控样品制备表",
"SP004": "生物样品内标工作液制备表",
"SP005": "生物样品质控工作液制备表",
"SP006": "生物样品标准曲线/质控样品制备表",
} }
return o[this.sn]; return o[this.sn];
}, },
// //
printTag(e,configType,index){
printTag(e, configType, index) {
const { nickName, name } = this.$store.getters; const { nickName, name } = this.$store.getters;
const {printCode,row,type} = e;
const { printCode, row, type } = e;
const currentForm = this.formData[configType][index]; const currentForm = this.formData[configType][index];
const {stepStorageCondition,startDate,expireDate,paralleStepStorageCondition} = currentForm;
const { stepStorageCondition, startDate, expireDate, paralleStepStorageCondition } = currentForm;
const targetSolutionExpirationDate = row.targetSolutionExpirationDate; const targetSolutionExpirationDate = row.targetSolutionExpirationDate;
const lang = this.$i18n.locale; const lang = this.$i18n.locale;
const printConfig = { 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==="subPackage"
//type==="row" //type==="row"
"编号":type === "subPackage" ? printCode : (row.targetSolutionCode+row.subTargetSolutionCode),
"编号": type === "subPackage" ? printCode : (row.targetSolutionCode + row.subTargetSolutionCode),
} }
console.log(printConfig, "printConfig") console.log(printConfig, "printConfig")
EventBus.$emit('showTagPrintDialog', {printConfig})
EventBus.$emit('showTagPrintDialog', { printConfig })
}, },
// //
async assignNumbersToTableData(config) { async assignNumbersToTableData(config) {
const configs = this.formData[config] const configs = this.formData[config]
const {startDate} = this.formData;
const { startDate } = this.formData;
// paralleConfigsparalleTableFormData // paralleConfigsparalleTableFormData
if (configs && configs.length > 0) { if (configs && configs.length > 0) {
for (let i = 0; i < configs.length; i++) { for (let i = 0; i < configs.length; i++) {
const ref = config === "paralleConfigs" ? `paralleStepTableRef_${i}` : `ladderStepTableRef_${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); const date = getExpireDate(startDate, effectivePeriod, effectivePeriodUnit);
configs[i].expireDate = date; configs[i].expireDate = date;
} }
if (stepTableFormData && stepTableFormData.length > 0) { 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() { async handleUpdateCode() {
Promise.all([this.assignNumbersToTableData("ladderConfigs"),this.assignNumbersToTableData("paralleConfigs")
]).then(()=>{
Promise.all([this.assignNumbersToTableData("ladderConfigs"), this.assignNumbersToTableData("paralleConfigs")
]).then(() => {
console.log("nextTick") console.log("nextTick")
// //
const params = { const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
EventBus.$emit('onModifyRecord', params,) EventBus.$emit('onModifyRecord', params,)
}) })
}, },
@ -321,37 +349,37 @@ export default {
// //
onHandleTableBlur(type, configIndex, e) { onHandleTableBlur(type, configIndex, e) {
const { colKey = "",item } = e;
const { colKey = "", item } = e;
if (colKey === "targetStartSolutionConcentration" || colKey === "targetSolutionVolume" || colKey === "targetSolutionConcentration" || colKey === "targetStartSolutionVolumePrecision" || colKey === "targetDiluentVolumePrecision") { 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; const volume = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFormDataByKey("targetStartSolution") || 0;
if (volume) { if (volume) {
this.updateTargetStartSolutionVolume(item, volume); this.updateTargetStartSolutionVolume(item, volume);
} }
}else if(type === "paralle"){
} else if (type === "paralle") {
const volumne = item.targetStartSolutionConcentration || 0; const volumne = item.targetStartSolutionConcentration || 0;
if (volumne) { if (volumne) {
this.updateTargetStartSolutionVolume(item, 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;// 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;// 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.currentTableKey = col.prop;
this.currentType = type; this.currentType = type;
this.currentRowIndex = rowIndex; 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]; 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); packageRef.updateFormData(currentSubKey, code);
this.currentSubKey = ""; this.currentSubKey = "";
}else if (currentTableKey === "actStartSolutionCode"){//
} else if (currentTableKey === "actStartSolutionCode") {//
const tableRef = this.$refs[`paralleStepTableRef_${currentRowIndex}`][0]; const tableRef = this.$refs[`paralleStepTableRef_${currentRowIndex}`][0];
if(tableRef){
tableRef.updateDataSourceByRowIndex(currentTableIndex,{
if (tableRef) {
tableRef.updateDataSourceByRowIndex(currentTableIndex, {
actStartSolutionCode: code, actStartSolutionCode: code,
targetAcSolution: row.nd, targetAcSolution: row.nd,
}) })
}
}
} }
this.$refs.selectReagentDialogRef.onCancel() this.$refs.selectReagentDialogRef.onCancel()
}, },
@ -518,8 +546,9 @@ export default {
.mt-0 { .mt-0 {
margin-top: 0; margin-top: 0;
} }
.s-container{
.s-container {
box-shadow: none !important; box-shadow: none !important;
padding:24px 0 !important;
padding: 24px 0 !important;
} }
</style> </style>

+ 1
- 1
src/views/business/comps/template/dialog/SubPackageDialog.vue View File

@ -128,6 +128,7 @@ export default {
} else { } else {
const errMsg = "分装后小份容量之和大于母液容量,是否确认分装?" const errMsg = "分装后小份容量之和大于母液容量,是否确认分装?"
const {maxVolume,maxVolumeUnit,dw} = this.formData; const {maxVolume,maxVolumeUnit,dw} = this.formData;
const totalVolume = this.fzList.reduce((acc, cur) => acc + Number(cur.num), 0); const totalVolume = this.fzList.reduce((acc, cur) => acc + Number(cur.num), 0);
const compareResult = compareVolume(totalVolume,dw,maxVolume, maxVolumeUnit); const compareResult = compareVolume(totalVolume,dw,maxVolume, maxVolumeUnit);
console.log(compareResult,totalVolume,dw,maxVolume, maxVolumeUnit,"比较结果"); console.log(compareResult,totalVolume,dw,maxVolume, maxVolumeUnit,"比较结果");
@ -151,7 +152,6 @@ export default {
}, },
submitEmit(){ submitEmit(){
EventBus.$emit('dialogSubPackageSubmit', {...this.formData, fzList: this.fzList}); EventBus.$emit('dialogSubPackageSubmit', {...this.formData, fzList: this.fzList});
this.$message.success('分装成功');
setTimeout(() => { setTimeout(() => {
this.close(); this.close();
}, 500); }, 500);

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

@ -1,5 +1,6 @@
import moment from 'moment' 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 { export default {
dicts: [ dicts: [
'business_pztj', 'business_pztj',
@ -129,6 +130,34 @@ export default {
this.setTemplateData({}) this.setTemplateData({})
}, },
methods: { 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 = {}){ getBasePrintConfig (data = {}){
const { printCode,type,row = {} } = data; const { printCode,type,row = {} } = data;
@ -317,7 +346,8 @@ export default {
actStartSolutionVolume / actStartSolutionVolume /
actVol actVol
).toFixed(precision) ).toFixed(precision)
item.actSolutionConcentration = actNd
console.log(actNd,targetAcSolution,actStartSolutionVolume,actVol, "actNd")
item.actSolutionConcentration = actNd === 'Infinity' ? 0 : actNd
}, },
//更新起始溶液体积时,计算目标溶液预计浓度 //更新起始溶液体积时,计算目标溶液预计浓度
updateTargetStartSolutionVolume(item, volume) { updateTargetStartSolutionVolume(item, volume) {

Loading…
Cancel
Save