Browse Source

feat:[模板管理][生物样品分析方法学样品制备表-Recovery]

lkf
HanLong 3 months ago
parent
commit
37ad5264db
2 changed files with 144 additions and 132 deletions
  1. +88
    -25
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/Recovery.vue
  2. +56
    -107
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/ZQDYJMD.vue

+ 88
- 25
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/Recovery.vue View File

@ -17,11 +17,12 @@
<div class="template-form-item"> <div class="template-form-item">
<span>基质</span> <span>基质</span>
<BaseInfoFormPcakge fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" <BaseInfoFormPcakge fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef"
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData"
@clickable="handleJzClickable" />
<CustomTable @blur="onHandleTableBlur" :ref="`tableRef`" :columns="tableStepColumns" <CustomTable @blur="onHandleTableBlur" :ref="`tableRef`" :columns="tableStepColumns"
:formData="formData" :prefixKey="`table`" @clickable="handleClickable" :formData="formData" :prefixKey="`table`" @clickable="handleClickable"
fieldItemLabel="这个是什么">
fieldItemLabel="template.common.operationSteps">
<template slot="operation" slot-scope="{ row, rowIndex}"> <template slot="operation" slot-scope="{ row, rowIndex}">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" <TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion> @deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion>
@ -31,11 +32,12 @@
<div class="template-form-item"> <div class="template-form-item">
<span>溶液</span> <span>溶液</span>
<BaseInfoFormPcakge fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef"
:formConfig="rongyeStepFormConfig" @blur="onHandleBlur" :formData="formData" />
<CustomTable @blur="onHandleTableBlur" :ref="`tableRef`" :columns="rongyeTableStepColumns"
:formData="formData" :prefixKey="`table`" @clickable="handleClickable"
fieldItemLabel="这个是什么">
<BaseInfoFormPcakge fieldItemLabel="template.common.operationSteps"
ref="rongyeStepFormPackageRef" :formConfig="rongyeStepFormConfig" @blur="onHandleBlur"
:formData="formData" @clickable="handleRongyeClickable" />
<CustomTable @blur="onHandleTableBlur" :ref="`rongyeTableRef`" :columns="rongyeTableStepColumns"
:formData="formData" :prefixKey="`rongyeTable`" @clickable="handleRongyeTableClickable"
fieldItemLabel="template.common.operationSteps">
<template slot="operation" slot-scope="{ row, rowIndex}"> <template slot="operation" slot-scope="{ row, rowIndex}">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" <TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion> @deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion>
@ -50,6 +52,8 @@
</div> </div>
</div> </div>
<!-- <button @click = "onSave">保存</button> --> <!-- <button @click = "onSave">保存</button> -->
<SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef">
</SelectReagentDialog>
</div> </div>
</template> </template>
@ -63,10 +67,11 @@ import CustomTable from '@/components/Template/CustomTable.vue';
import { getLatestSn } from '@/api/template'; import { getLatestSn } from '@/api/template';
import { getSWYPFXFFXYPZBBTableConfig, getSWYPFXFFXYPZBBTQHSLTableConfig } from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js"; import { getSWYPFXFFXYPZBBTableConfig, getSWYPFXFFXYPZBBTQHSLTableConfig } from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import SelectReagentDialog from '../../../dialog/SelectReagentDialog.vue';
export default { export default {
name: "SWYPFXRYPZB", name: "SWYPFXRYPZB",
components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable, TableOpertaion },
components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog },
mixins: [templateMixin], mixins: [templateMixin],
props: { props: {
fillType: { fillType: {
@ -174,9 +179,11 @@ export default {
label: 'template.sp.sp009.rqcz', label: 'template.sp.sp009.rqcz',
config: { config: {
rqcz: { rqcz: {
type: "input",
type: "select",
multiple: true,
fillType: "actFill", fillType: "actFill",
maxlength: 50
options: this.getDictOptions('business_rqcz'),
otherCode: "rqczOther",
}, },
} }
}, },
@ -225,7 +232,7 @@ export default {
type: "input", type: "input",
fillType: "preFill", fillType: "preFill",
subType: "clickable", subType: "clickable",
subKey: "subSolution",
subKey: "subGzy",
subFillType: "actFill", subFillType: "actFill",
maxlength: 20, maxlength: 20,
}, },
@ -239,7 +246,7 @@ export default {
type: "input", type: "input",
fillType: "preFill", fillType: "preFill",
subType: "clickable", subType: "clickable",
subKey: "subSolution",
subKey: "subXsy",
subFillType: "actFill", subFillType: "actFill",
maxlength: 20, maxlength: 20,
}, },
@ -256,6 +263,7 @@ export default {
}, },
data() { data() {
return { return {
reagentType: '',
resource: [], resource: [],
resourceData1: [], resourceData1: [],
sysjColumns: [ sysjColumns: [
@ -289,31 +297,86 @@ export default {
} }
}, },
methods: { methods: {
//
handleJzClickable(obj) {
this.reagentType = 1//
this.currentSubKey = obj.subKey;
this.$refs.selectReagentDialogRef.show()
},
handleRongyeClickable(obj) {
this.reagentType = 2//
this.currentSubKey = obj.subKey;
this.$refs.selectReagentDialogRef.show()
},
//
onSelectReagentSubmit(code, row) {
if (this.reagentType == 1) {
this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code);
} else if(this.reagentType == 2){
this.$refs.rongyeStepFormPackageRef.updateFormData(this.currentSubKey, code);
} else if(this.reagentType == 3) {
this.$refs.tableRef.updateDataSourceByRowIndex(this.rowIndex,{
[this.currentSubKey]: code,
})
} else if(this.reagentType == 4) {
this.$refs.rongyeTableRef.updateDataSourceByRowIndex(this.rowIndex,{
[this.currentSubKey]: code,
})
}
this.$refs.selectReagentDialogRef.onCancel()
},
// //
handleClickable(col, rowIndex) { handleClickable(col, rowIndex) {
console.log("clickable", rowIndex, col)
if (col.prop === "sjry") {
//
this.reagentType = 3
this.rowIndex = rowIndex
this.currentSubKey = col.prop;
console.log("clickable",rowIndex, col)
if(col.prop === "sjry"){
//-
this.$refs.selectReagentDialogRef.show()
}
},
handleRongyeTableClickable(col, rowIndex) {
this.reagentType = 4
this.rowIndex = rowIndex
this.currentSubKey = col.prop;
console.log("clickable",rowIndex, col)
if(col.prop === "sjry"){
//-
this.$refs.selectReagentDialogRef.show()
} }
this.$refs.tableRef.updateDataSourceByRowIndex(rowIndex, {
sjry: "我是填充进来的数据",
})
}, },
// //
async getCode() { async getCode() {
const result = await getLatestSn({
count: 1,
})
if (result.code == 200) {
this.$refs.stepFormPackageRef.updateFormData("targetCodeSn", result.data)
const { stepTableFormData = [] } = v;
if (stepTableFormData && stepTableFormData.length > 0 && !stepTableFormData[0].bhCode) {
const result = await getLatestSn({
count: stepTableFormData.length,
})
if (result.code == 200) {
if (stepTableFormData.length === 0) {
this.$refs.tableRef.updateDataSourceByRowIndex(0, {
[bhCode]: result.data,
})
} else {
for (let i = 0; i < stepTableFormData.length; i++) {
this.$refs.tableRef.updateDataSourceByRowIndex(i, {
bhCode: result.data[i],
})
}
}
}
} }
}, },
// //
getFilledFormData() { getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef", "stepRef", "remarkRef"])
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef", "stepRef", "rongyeTableRef", "rongyeStepFormPackageRef", "remarkRef"])
}, },
async getFormData() { async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef", "stepRef", "remarkRef"]);
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef", "stepRef",
"rongyeTableRef", "rongyeStepFormPackageRef", "remarkRef"]);
console.log(content)
//resource //resource
let tmpResource = [] let tmpResource = []
debugger debugger

+ 56
- 107
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/ZQDYJMD.vue View File

@ -2,8 +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">{{ formData.bdmc ||
$t('template.sp.sp008.title') }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.templateMc ||
'生物样品分析方法学样品制备表-准确度与精密度' }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-content"> <div class="detail-content">
<div class="content"> <div class="content">
<BaseInfoFormPcakge fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" ref="baseInfoRef" <BaseInfoFormPcakge fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" ref="baseInfoRef"
@ -16,22 +16,22 @@
:formConfig="storageFormConfig" :formData="formData" /> :formConfig="storageFormConfig" :formData="formData" />
<LineLabel label="template.common.operationSteps" /> <LineLabel label="template.common.operationSteps" />
<div class="template-form-item"> <div class="template-form-item">
<BaseInfoFormPcakge fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig"
:formData="formData" @clickable="handleJzClickable" />
<BaseInfoFormPcakge fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig" @blur="onHandleBlur"
:formData="formData" />
<CustomTable
@blur="onHandleTableBlur"
:ref="`tableRef`"
:columns="tableStepColumns"
<CustomTable
@blur="onHandleTableBlur"
:ref="`tableRef`"
:columns="tableStepColumns"
:formData="formData" :formData="formData"
:prefixKey = "`table`" :prefixKey = "`table`"
@clickable="handleClickable" @clickable="handleClickable"
fieldItemLabel = "template.common.operationSteps"
fieldItemLabel = "这个是什么"
> >
<template slot="operation" slot-scope="{ row, rowIndex}"> <template slot="operation" slot-scope="{ row, rowIndex}">
<TableOpertaion
:fillType="fillType"
:row="row"
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex" :rowIndex="rowIndex"
@deleteRow="(rowIndex) => deleteRow(rowIndex)" @deleteRow="(rowIndex) => deleteRow(rowIndex)"
></TableOpertaion> ></TableOpertaion>
@ -46,11 +46,6 @@
</div> </div>
</div> </div>
<!-- <button @click = "onSave">保存</button> --> <!-- <button @click = "onSave">保存</button> -->
<SelectReagentDialog
@submit="onSelectReagentSubmit"
ref="selectReagentDialogRef" >
</SelectReagentDialog>
</div> </div>
</template> </template>
@ -64,11 +59,10 @@ import CustomTable from '@/components/Template/CustomTable.vue';
import { getLatestSn } from '@/api/template'; import { getLatestSn } from '@/api/template';
import {getSWYPFXFFXYPZBBTableConfig} from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js"; import {getSWYPFXFFXYPZBBTableConfig} from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import SelectReagentDialog from '../../../dialog/SelectReagentDialog.vue';
export default { export default {
name: "ZQDYJMD",
components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable,TableOpertaion,SelectReagentDialog },
name: "SWYPFXRYPZB",
components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable,TableOpertaion },
mixins: [templateMixin], mixins: [templateMixin],
props: { props: {
fillType: { fillType: {
@ -112,7 +106,7 @@ export default {
} }
] ]
}, },
baseInfoFormConfig() { baseInfoFormConfig() {
return [ return [
{ {
@ -142,7 +136,7 @@ export default {
}, },
// //
clpbg: { clpbg: {
label: 'template.sp.sp008.clpbh',
label: 'template.common.clpbh',
type: "input", type: "input",
fillType: "actFill", fillType: "actFill",
maxlength: 50 maxlength: 50
@ -174,20 +168,18 @@ export default {
}, },
{ {
type: "cellItem", type: "cellItem",
label: 'template.sp.sp008.rqcz',
label: 'template.common.rqcz',
config: { config: {
rqcz: { rqcz: {
type: "select",
multiple: true,
type: "input",
fillType: "actFill", fillType: "actFill",
options: this.getDictOptions('business_rqcz'),
otherCode: "rqczOther",
maxlength: 50
}, },
} }
}, },
{ {
type: "cellItem", type: "cellItem",
label: 'template.sp.sp008.clsj',
label: 'template.common.clsj',
config: { config: {
startDate: { startDate: {
label: 'template.common.startTime', label: 'template.common.startTime',
@ -207,37 +199,32 @@ export default {
type: "step", type: "step",
config: { config: {
jz: { jz: {
label: 'template.sp.sp008.xzjz',
label: 'template.common.xzjz',
type: "input", type: "input",
fillType: "preFill", fillType: "preFill",
subType: "clickable", subType: "clickable",
subKey: "subJz",
subKey: "subSolution",
subFillType: "actFill", subFillType: "actFill",
maxlength: 20, maxlength: 20,
labelWidth: 80,
}, },
} }
} }
] ]
}, },
tableStepColumns() { tableStepColumns() {
return getSWYPFXFFXYPZBBTableConfig(this,'business_sp_jmdyzqdyp');
return getSWYPFXFFXYPZBBTableConfig(this);
}, },
}, },
data() { data() {
return { return {
reagentType: "",//12
currentSubKey: "",//key
rowIndex:0,//
resource: [], resource: [],
resourceData1: [],
sysjColumns: [ sysjColumns: [
{ label: 'template.common.reagentName', prop: "mc" },// { label: 'template.common.reagentName', prop: "mc" },//
{ label: 'template.common.reagentCode', prop: "bh" },// { label: 'template.common.reagentCode', prop: "bh" },//
{ label: 'template.common.reagentNo', prop: "ph" },// { label: 'template.common.reagentNo', prop: "ph" },//
{ label: 'template.common.concentration', prop: "nd" },// { label: 'template.common.concentration', prop: "nd" },//
{ label: 'template.common.source', prop: "source" },//
{ label: 'template.common.source', prop: "source" },//
{ label: 'template.common.reagentExpireDate', prop: "sxrq" },// { label: 'template.common.reagentExpireDate', prop: "sxrq" },//
], ],
yqsColumns: [ yqsColumns: [
@ -256,63 +243,30 @@ export default {
formData: { formData: {
immediate: true, immediate: true,
handler(v) { handler(v) {
if(this.fillType === "actFill"){
this.getCode(v);
if(!v.targetCodeSn && this.fillType === "actFill"){
this.getCode();
} }
} }
} }
}, },
methods: { methods: {
//
handleJzClickable(obj){
this.reagentType = 1//
this.currentSubKey = obj.subKey;
this.$refs.selectReagentDialogRef.show()
},
//
onSelectReagentSubmit(code,row){
if(this.reagentType===1){
this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code);
}else{
this.$refs.tableRef.updateDataSourceByRowIndex(this.rowIndex,{
[this.currentSubKey]: code,
})
}
this.$refs.selectReagentDialogRef.onCancel()
},
// //
handleClickable(col, rowIndex) { handleClickable(col, rowIndex) {
//
this.reagentType = 2
this.rowIndex = rowIndex
this.currentSubKey = col.prop;
console.log("clickable",rowIndex, col) console.log("clickable",rowIndex, col)
if(col.prop === "sjry"){ if(col.prop === "sjry"){
//-
this.$refs.selectReagentDialogRef.show()
//
} }
this.$refs.tableRef.updateDataSourceByRowIndex(rowIndex,{
sjry: "我是填充进来的数据",
})
}, },
// //
async getCode(v){
const {stepTableFormData = []} = v;
if(stepTableFormData && stepTableFormData.length>0 && !stepTableFormData[0].bhCode){
const result = await getLatestSn({
count: stepTableFormData.length,
})
if(result.code == 200){
if(stepTableFormData.length===1){
this.$refs.tableRef.updateDataSourceByRowIndex(0,{
bhCode: result.data,
})
}else{
for(let i=0;i<stepTableFormData.length;i++){
this.$refs.tableRef.updateDataSourceByRowIndex(i,{
bhCode: result.data[i],
})
}
}
}
async getCode(){
const result = await getLatestSn({
count: 1,
})
if(result.code == 200){
this.$refs.stepFormPackageRef.updateFormData("targetCodeSn",result.data)
} }
}, },
// //
@ -323,31 +277,27 @@ export default {
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"]); let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"]);
//resource //resource
let tmpResource = [] let tmpResource = []
let tableList = content.stepTableFormData
for(let i=0;i<tableList.length;i++){
//
let item = tableList[i]
tmpResource.push({
mc: null,
bh: item.bh+item.bhCode,
ph: null,
nd: item.hhwznd + content.headerSelectFields.hhwzndUnit,
source: 'ELN配制',
sxrq: null,
ndz: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
kc: item.sjjzxql+item.sjryxql,//todo -
kcdw: content.headerSelectFields.sjryxqlUnit || content.headerSelectFields.sjjzxqlUnit,//todo --
syl: null,
syldw:content.headerSelectFields.sjryxqlUnit || content.headerSelectFields.sjjzxqlUnit,//todo --,
yxzq:null,
yxzqdw:null,
})
}
debugger
//
tmpResource.push({
mc: content.targetName,
bh: content.targetCode+content.targetCodeSn,
ph: '',
nd: content.targetActConcentration + content.targetActConcentrationUnit,
source: 'ELN配制',
sxrq: content.expireDate,
ndz: content.targetActConcentration,
nddw: content.targetActConcentrationUnit,
kc: content.targetActVolume,
kcdw: content.targetActVolumeUnit,
syl: null,
syldw:content.targetActVolumeUnit,
yxzq:content.effectivePeriod,
yxzqdw:content.effectivePeriodUnit,
})
//使 //使
this.resource=tmpResource this.resource=tmpResource
return content; return content;
}, },
async onSave() { async onSave() {
@ -362,7 +312,6 @@ export default {
tableRef.deleteRow(rowIndex); tableRef.deleteRow(rowIndex);
} }
}, },
} }
}; };

Loading…
Cancel
Save