Browse Source

feat: [模板管理] SP008-SP018合并

lkf
memorylkf 2 months ago
parent
commit
cd8ea38993
11 changed files with 47 additions and 4248 deletions
  1. +10
    -19
      src/views/business/comps/template/TemplateTable.vue
  2. +37
    -6
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP008.vue
  3. +0
    -469
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP010.vue
  4. +0
    -468
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP011.vue
  5. +0
    -469
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP012.vue
  6. +0
    -467
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP013.vue
  7. +0
    -469
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP014.vue
  8. +0
    -469
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP015.vue
  9. +0
    -473
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP016.vue
  10. +0
    -469
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP017.vue
  11. +0
    -470
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP018.vue

+ 10
- 19
src/views/business/comps/template/TemplateTable.vue View File

@ -30,15 +30,6 @@ import SP007 from "./comps/sp/SP007.vue";
//-10 //-10
import SP008 from "./comps/sp/SWYPFXFFXYPZBB/SP008.vue"; import SP008 from "./comps/sp/SWYPFXFFXYPZBB/SP008.vue";
import SP009 from "./comps/sp/SWYPFXFFXYPZBB/SP009.vue"; import SP009 from "./comps/sp/SWYPFXFFXYPZBB/SP009.vue";
import SP010 from "./comps/sp/SWYPFXFFXYPZBB/SP010.vue";
import SP011 from "./comps/sp/SWYPFXFFXYPZBB/SP011.vue";
import SP012 from "./comps/sp/SWYPFXFFXYPZBB/SP012.vue";
import SP013 from "./comps/sp/SWYPFXFFXYPZBB/SP013.vue";
import SP014 from "./comps/sp/SWYPFXFFXYPZBB/SP014.vue";
import SP015 from "./comps/sp/SWYPFXFFXYPZBB/SP015.vue";
import SP016 from "./comps/sp/SWYPFXFFXYPZBB/SP016.vue";
import SP017 from "./comps/sp/SWYPFXFFXYPZBB/SP017.vue";
import SP018 from "./comps/sp/SWYPFXFFXYPZBB/SP018.vue";
import Demo from "./comps/sp/Demo.vue"; import Demo from "./comps/sp/Demo.vue";
// //
import GSP002 from "./comps/gsp/GSP002.vue"; import GSP002 from "./comps/gsp/GSP002.vue";
@ -85,7 +76,7 @@ export default {
// //
GSP002, GSP003, GSP004,GSP009, GSP010, GSP002, GSP003, GSP004,GSP009, GSP010,
// //
SP001, SP003, SP00456,SP007, SP008, SP009, SP010, SP011, SP012, SP013, SP014, SP015, SP016, SP017, SP018,
SP001, SP003, SP00456,SP007, SP008, SP009,
// PCR // PCR
PCR002, PCR002,
//LBA //LBA
@ -127,15 +118,15 @@ export default {
'SP007': 'SP007', 'SP007': 'SP007',
'SP008': 'SP008', 'SP008': 'SP008',
'SP009': 'SP009', 'SP009': 'SP009',
'SP010': 'SP010',
'SP011': 'SP011',
'SP012': 'SP012',
'SP013': 'SP013',
'SP014': 'SP014',
'SP015': 'SP015',
'SP016': 'SP016',
'SP017': 'SP017',
'SP018': 'SP018',
'SP010': 'SP008',
'SP011': 'SP008',
'SP012': 'SP008',
'SP013': 'SP008',
'SP014': 'SP008',
'SP015': 'SP008',
'SP016': 'SP008',
'SP017': 'SP008',
'SP018': 'SP008',
// //
'GSP001': 'DMYPPZJLB', 'GSP001': 'DMYPPZJLB',

+ 37
- 6
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP008.vue View File

@ -15,7 +15,7 @@
: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">
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig"
<BaseInfoFormPackage v-if="sn!='SP013'" fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig"
:formData="formData" /> :formData="formData" />
<CustomTable <CustomTable
@ -74,6 +74,10 @@ export default {
type: String, type: String,
default: 'preFill', default: 'preFill',
}, },
sn: {
type: String,
default: '',
},
}, },
computed: { computed: {
storageFormConfig() { storageFormConfig() {
@ -208,7 +212,18 @@ export default {
type: "step", type: "step",
config: { config: {
jz: { jz: {
label: 'template.sp.sp008.xzjz',
label:
this.sn=='SP008'?'template.sp.sp008.xzjz':
this.sn=='SP010'?'template.sp.sp008.xzjz':
this.sn=='SP011'?'template.sp.sp011.xzxsy':
this.sn=='SP012'?'template.sp.sp011.xzxsy':
this.sn=='SP013'?'template.sp.sp011.xzxsy':
this.sn=='SP014'?'template.sp.sp011.xzxsy':
this.sn=='SP015'?'template.sp.sp008.xzjz':
this.sn=='SP016'?'template.sp.sp008.xzjz':
this.sn=='SP017'?'template.sp.sp008.xzjz':
this.sn=='SP018'?'template.sp.sp018.xzxsy':''
,
type: "input", type: "input",
fillType: "preFill", fillType: "preFill",
subType: "sj", subType: "sj",
@ -222,7 +237,17 @@ export default {
] ]
}, },
tableStepColumns() { tableStepColumns() {
return getSWYPFXFFXYPZBBTableConfig(this,'business_sp_jmdyzqdyp');
return this.sn=='SP008'?getSWYPFXFFXYPZBBTableConfig(this,'business_sp_jmdyzqdyp'):
this.sn=='SP010'?getSWYPFXFFXYPZBBTableConfig(this,'business_sp_qxwdx'):
this.sn=='SP011'?getSWYPFXFFXYPZBBTableConfig(this,'business_sp_cbyhgzywdx',true):
this.sn=='SP012'?getSWYPFXFFXYPZBBTableConfig(this,'business_sp_rxjzxy',true):
this.sn=='SP013'?getSWYPFXFFXYPZBBTableConfig(this,'business_sp_jzxy',false,true):
this.sn=='SP014'?getSWYPFXFFXYPZBBTableConfig(this,'business_sp_xzxytyx',true):
this.sn=='SP015'?getSWYPFXFFXYPZBBTableConfig(this,'business_sp_zdybs'):
this.sn=='SP016'?getSWYPFXFFXYPZBBTableConfig(this,'business_sp_xskkx'):
this.sn=='SP017'?getSWYPFXFFXYPZBBTableConfig(this,'business_sp_cbydb'):
this.sn=='SP018'?getSWYPFXFFXYPZBBTableConfig(this,'',true):
'';
}, },
}, },
data() { data() {
@ -275,10 +300,16 @@ export default {
}, },
// //
getFilledFormData(){ getFilledFormData(){
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef","stepRef", "remarkRef"])
return this.sn=='SP013'?
this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "tableRef","stepRef", "remarkRef"])
:
this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef","stepRef", "remarkRef"])
}, },
async getFormData() { async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"]);
let content = this.sn=='SP013'?
await this.validFormFields(["baseInfoRef", "storageConditionRef","tableRef" ,"stepRef", "remarkRef"])
:
await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"])
return content; return content;
}, },
getResource() { getResource() {
@ -314,7 +345,7 @@ export default {
}) })
tmpResource.push({ tmpResource.push({
mc: null, mc: null,
bh: content.subJz,
bh: this.sn=='SP013'?item.kbjzbh:content.subJz,
ph: null, ph: null,
ndz: null, ndz: null,
nd: null, nd: null,

+ 0
- 469
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP010.vue View File

@ -1,469 +0,0 @@
<!-- 生物样品分析方法学样品制备表-全血稳定性 -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" ref="baseInfoRef"
:formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns"
:dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns"
:dataSource="yqResource" />
<BaseInfoFormPackage fieldItemLabel="template.common.storageCondition" label="template.common.storageCondition" ref="storageConditionRef"
:formConfig="storageFormConfig" :formData="formData" />
<LineLabel label="template.common.operationSteps" />
<div class="template-form-item">
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig"
:formData="formData" />
<CustomTable
@blur="onHandleTableBlur"
:ref="`tableRef`"
:columns="tableStepColumns"
:formData="formData"
:prefixKey = "`table`"
fieldItemLabel = "template.common.operationSteps"
:showOperation="fillType === 'preFill'"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
@subPackageSubmit="subPackageSubmit"
@startConfig="startConfig"
@configComplete="configComplete"
></TableOpertaion>
</template>
</CustomTable>
</div>
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" ref="remarkRef" :formConfig="remarkConig"
:formData="formData" />
</div>
</div>
</div>
<!-- <button @click = "onSave">保存</button> -->
</div>
</template>
<script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import { getLatestSnArr } from '@/api/template';
import {getSWYPFXFFXYPZBBTableConfig} from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { EventBus } from "@/utils/eventBus";
import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools";
export default {
name: "QXWDX",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaion },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition: {
label: 'template.common.storageConditionLabel',
type: "select",
fillType: "preFill",
options: this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
}
}
];
},
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
baseInfoFormConfig() {
return [
{
type: "cardItem",
config: {
studyMc: {
label: 'template.common.testName',
type: "input",
disabled: true,
},
studySn: {
label: 'template.common.testNumber',
type: "input",
disabled: true,
},
methodCode: {
label: 'template.common.methodCode',
type: "input",
fillType: "preFill",
maxlength: 50
},
versionNum: {
label: 'template.common.versionNumber',
type: "inputNumber",
fillType: "actFill",
prepend: "V",
maxlength: 50
},
//
clpbg: {
label: 'template.sp.sp008.clpbh',
type: "input",
fillType: "actFill",
maxlength: 50
},
}
},
{
type: "conditionItem",
label: 'template.common.testConfigurationConditions',
config: {
pre: {
label: 'template.common.preFill',
type: "select",
multiple: true,
fillType: "preFill",
options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
},
act: {
label: 'template.common.actualFill',
type: "select",
fillType: "actFill",
otherCode: "actOther",
compareTo: "pre",
multiple: true,
options: this.getDictOptions('business_pztj')
}
}
},
{
type: "cellItem",
label: 'template.sp.sp008.rqcz',
config: {
rqcz: {
type: "select",
multiple: true,
fillType: "actFill",
options: this.getDictOptions('business_rqcz'),
otherCode: "rqczOther",
},
}
},
{
type: "cellItem",
label: 'template.sp.sp008.clsj',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
},
stepFormConfig() {
return [
{
type: "step",
config: {
jz: {
label: 'template.sp.sp008.xzjz',
type: "input",
fillType: "preFill",
subType: "sj",
subKey: "subJz",
subFillType: "actFill",
maxlength: 20,
labelWidth: 80,
},
}
}
]
},
tableStepColumns() {
return getSWYPFXFFXYPZBBTableConfig(this,'business_sp_qxwdx');
},
},
data() {
return {
reagentType: "",//12
currentSubKey: "",//key
rowIndex:0,//
formData: {}
};
},
mounted() {
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {
//
async getCode(v){
const {stepTableFormData = []} = v;
if(stepTableFormData && stepTableFormData.length>0 && !stepTableFormData[0].bhCode){
let postSn = []
for(let i=0;i<stepTableFormData.length;i++){
postSn.push({
pre:stepTableFormData[i].bh,
type:1
})
}
const result = await getLatestSnArr(postSn)
if(result.code == 200){
for(let i=0;i<stepTableFormData.length;i++){
this.$refs.tableRef.updateDataSourceByRowIndex(i,{
bhCode: result.data[i],
})
}
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
setTimeout(() => {
debugger
EventBus.$emit('onModifyRecord', params,)
}, 10);
}
}
},
//
getFilledFormData(){
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef","stepRef", "remarkRef"])
},
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"]);
return content;
},
getResource() {
let content = this.getFilledFormData();
//resource
let tmpResource = []
if(this.fillType === "actFill"){
let tableList = content.stepTableFormData
if(tableList && tableList.length>0){
for(let i=0;i<tableList.length;i++){
//
let item = tableList[i]
//使
tmpResource.push({
mc: null,
bh: item.sjry,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjryxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjryxqlUnit,
yxzq:null,
yxzqdw:null,
})
tmpResource.push({
mc: null,
bh: content.subJz,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjjzxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjjzxqlUnit,
yxzq:null,
yxzqdw:null,
})
//
let fzTotal = 0//
if(item.fzsj && item.fzsj.fzList && item.fzsj.fzList.length>0){
for(let j=0;j<item.fzsj.fzList.length;j++){
let fzItem = item.fzsj.fzList[j]
tmpResource.push({
mc: null,
bh: item.fzsj.mybh+fzItem.preCode+ fzItem.subCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: fzItem.num,
kcdw: item.fzsj.dw,
syl: null,
type: null,
elnType: this.product,
syldw:item.fzsj.dw,
yxzq:null,
yxzqdw:null,
})
fzTotal=addDecimals(fzTotal,fzItem.num)
}
}
//
const { total, unit } = addTj([item.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit])
tmpResource.push({
mc: null,
bh: item.bh+item.bhCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: total,
kcdw: unit,
syl: fzTotal>0?fzTotal:null,
type: null,
elnType: this.product,
syldw:fzTotal>0?item.fzsj.dw:unit,
yxzq:null,
yxzqdw:null,
})
}
}
}
if(tmpResource.length>0){
tmpResource = uniqeResourceOne(tmpResource)
}
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
return this.resourceTmp;
},
async onSave() {
const formData = await this.getFilledFormData();
console.log(formData, "formData")
},
//
deleteRow(rowIndex) {
const tableRef = this.$refs['tableRef'];
if (tableRef) {
tableRef.deleteRow(rowIndex);
}
},
subPackageSubmit(val){
console.log("分装数据:"+JSON.stringify(val))
if(val.fzsj.fzList && val.fzsj.fzList.length>0){
let list = []
for(let i=0;i<val.fzsj.fzList.length;i++){
let item = val.fzsj.fzList[i]
list.push({
bh:val.fzsj.mybh+item.preCode + item.subCode,
kc:item.num,
kcdw:val.fzsj.dw,
})
}
let postData = {
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh:val.fzsj.mybh,
nd:val.rowData.hhwznd,
nddw:val.headerSelectFields.hhwzndUnit,
list:list
}
console.log("分装提交数据:"+JSON.stringify(postData))
this.subPackageRequest(postData)
}
},
startConfig(val){
console.log("开始配置数据:"+JSON.stringify(val))
let postData = {
bh:val.rowData.bh+val.rowData.bhCode,
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
}
console.log("开始配置提交数据:"+JSON.stringify(postData))
this.startConfigRequest(postData);
},
configComplete(val){
if(val.rowData.sjjzxql==='' || val.rowData.sjjzxql===undefined || val.rowData.sjryxql==='' || val.rowData.sjryxql===undefined){
this.$message.error("表格内容未填完")
return
}
console.log("完成配置数据:"+JSON.stringify(val))
const { total, unit } = addTj([val.rowData.sjjzxql, val.rowData.sjryxql], [val.headerSelectFields.sjjzxqlUnit, val.headerSelectFields.sjryxqlUnit])
let postData = {
mc:null,
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh:val.rowData.bh+val.rowData.bhCode,
nd:val.rowData.hhwznd,
nddw:val.headerSelectFields.hhwzndUnit,
kc: total,
kcdw: unit,
}
console.log("完成配置提交数据:"+JSON.stringify(postData))
this.configCompleteRequest(postData);
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
</style>

+ 0
- 468
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP011.vue View File

@ -1,468 +0,0 @@
<!-- 生物样品分析方法学样品制备表-储备液和工作液稳定性 Solution Stability -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" ref="baseInfoRef"
:formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns"
:dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns"
:dataSource="yqResource" />
<BaseInfoFormPackage fieldItemLabel="template.common.storageCondition" label="template.common.storageCondition" ref="storageConditionRef"
:formConfig="storageFormConfig" :formData="formData" />
<LineLabel label="template.common.operationSteps" />
<div class="template-form-item">
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig"
:formData="formData" />
<CustomTable
@blur="onHandleTableBlur"
:ref="`tableRef`"
:columns="tableStepColumns"
:formData="formData"
:prefixKey = "`table`"
fieldItemLabel = "template.common.operationSteps"
:showOperation="fillType === 'preFill'"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
@subPackageSubmit="subPackageSubmit"
@startConfig="startConfig"
@configComplete="configComplete"
></TableOpertaion>
</template>
</CustomTable>
</div>
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" ref="remarkRef" :formConfig="remarkConig"
:formData="formData" />
</div>
</div>
</div>
<!-- <button @click = "onSave">保存</button> -->
</div>
</template>
<script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import { getLatestSnArr } from '@/api/template';
import {getSWYPFXFFXYPZBBTableConfig} from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { EventBus } from "@/utils/eventBus";
import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools";
export default {
name: "CBYHGZYWDX",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaion },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition: {
label: 'template.common.storageConditionLabel',
type: "select",
fillType: "preFill",
options: this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
}
}
];
},
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
baseInfoFormConfig() {
return [
{
type: "cardItem",
config: {
studyMc: {
label: 'template.common.testName',
type: "input",
disabled: true,
},
studySn: {
label: 'template.common.testNumber',
type: "input",
disabled: true,
},
methodCode: {
label: 'template.common.methodCode',
type: "input",
fillType: "preFill",
maxlength: 50
},
versionNum: {
label: 'template.common.versionNumber',
type: "inputNumber",
fillType: "actFill",
prepend: "V",
maxlength: 50
},
//
clpbg: {
label: 'template.sp.sp008.clpbh',
type: "input",
fillType: "actFill",
maxlength: 50
},
}
},
{
type: "conditionItem",
label: 'template.common.testConfigurationConditions',
config: {
pre: {
label: 'template.common.preFill',
type: "select",
multiple: true,
fillType: "preFill",
options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
},
act: {
label: 'template.common.actualFill',
type: "select",
fillType: "actFill",
otherCode: "actOther",
compareTo: "pre",
multiple: true,
options: this.getDictOptions('business_pztj')
}
}
},
{
type: "cellItem",
label: 'template.sp.sp008.rqcz',
config: {
rqcz: {
type: "select",
multiple: true,
fillType: "actFill",
options: this.getDictOptions('business_rqcz'),
otherCode: "rqczOther",
},
}
},
{
type: "cellItem",
label: 'template.sp.sp008.clsj',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
},
stepFormConfig() {
return [
{
type: "step",
config: {
jz: {
label: 'template.sp.sp011.xzxsy',
type: "input",
fillType: "preFill",
subType: "sj",
subKey: "subJz",
subFillType: "actFill",
maxlength: 20,
labelWidth: 80,
},
}
}
]
},
tableStepColumns() {
return getSWYPFXFFXYPZBBTableConfig(this,'business_sp_cbyhgzywdx',true);
},
},
data() {
return {
reagentType: "",//12
currentSubKey: "",//key
rowIndex:0,//
formData: {}
};
},
mounted() {
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {
//
async getCode(v){
const {stepTableFormData = []} = v;
if(stepTableFormData && stepTableFormData.length>0 && !stepTableFormData[0].bhCode){
let postSn = []
for(let i=0;i<stepTableFormData.length;i++){
postSn.push({
pre:stepTableFormData[i].bh,
type:1
})
}
const result = await getLatestSnArr(postSn)
if(result.code == 200){
for(let i=0;i<stepTableFormData.length;i++){
this.$refs.tableRef.updateDataSourceByRowIndex(i,{
bhCode: result.data[i],
})
}
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
setTimeout(() => {
debugger
EventBus.$emit('onModifyRecord', params,)
}, 10);
}
}
},
//
getFilledFormData(){
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef","stepRef", "remarkRef"])
},
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"]);
return content;
},
getResource() {
let content = this.getFilledFormData();
//resource
let tmpResource = []
if(this.fillType === "actFill"){
let tableList = content.stepTableFormData
if(tableList && tableList.length>0){
for(let i=0;i<tableList.length;i++){
//
let item = tableList[i]
//使
tmpResource.push({
mc: null,
bh: item.sjry,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjryxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjryxqlUnit,
yxzq:null,
yxzqdw:null,
})
tmpResource.push({
mc: null,
bh: content.subJz,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjjzxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjjzxqlUnit,
yxzq:null,
yxzqdw:null,
})
//
let fzTotal = 0//
if(item.fzsj && item.fzsj.fzList && item.fzsj.fzList.length>0){
for(let j=0;j<item.fzsj.fzList.length;j++){
let fzItem = item.fzsj.fzList[j]
tmpResource.push({
mc: null,
bh: item.fzsj.mybh+fzItem.preCode + fzItem.subCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: fzItem.num,
kcdw: item.fzsj.dw,
syl: null,
type: null,
elnType: this.product,
syldw:item.fzsj.dw,
yxzq:null,
yxzqdw:null,
})
fzTotal=addDecimals(fzTotal,fzItem.num)
}
}
//
const { total, unit } = addTj([item.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit])
tmpResource.push({
mc: null,
bh: item.bh+item.bhCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: total,
kcdw: unit,
syl: fzTotal>0?fzTotal:null,
type: null,
elnType: this.product,
syldw:fzTotal>0?item.fzsj.dw:unit,
yxzq:null,
yxzqdw:null,
})
}
}
}
if(tmpResource.length>0){
tmpResource = uniqeResourceOne(tmpResource)
}
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
return this.resourceTmp;
},
async onSave() {
const formData = await this.getFilledFormData();
console.log(formData, "formData")
},
//
deleteRow(rowIndex) {
const tableRef = this.$refs['tableRef'];
if (tableRef) {
tableRef.deleteRow(rowIndex);
}
},
subPackageSubmit(val){
console.log("分装数据:"+JSON.stringify(val))
if(val.fzsj.fzList && val.fzsj.fzList.length>0){
let list = []
for(let i=0;i<val.fzsj.fzList.length;i++){
let item = val.fzsj.fzList[i]
list.push({
bh:val.fzsj.mybh+item.preCode + item.subCode,
kc:item.num,
kcdw:val.fzsj.dw,
})
}
let postData = {
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh:val.fzsj.mybh,
nd:val.rowData.hhwznd,
nddw:val.headerSelectFields.hhwzndUnit,
list:list
}
console.log("分装提交数据:"+JSON.stringify(postData))
this.subPackageRequest(postData)
}
},
startConfig(val){
console.log("开始配置数据:"+JSON.stringify(val))
let postData = {
bh:val.rowData.bh+val.rowData.bhCode,
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
}
console.log("开始配置提交数据:"+JSON.stringify(postData))
this.startConfigRequest(postData);
},
configComplete(val){
if(val.rowData.sjjzxql==='' || val.rowData.sjjzxql===undefined || val.rowData.sjryxql==='' || val.rowData.sjryxql===undefined){
this.$message.error("表格内容未填完")
return
}
console.log("完成配置数据:"+JSON.stringify(val))
const { total, unit } = addTj([val.rowData.sjjzxql, val.rowData.sjryxql], [val.headerSelectFields.sjjzxqlUnit, val.headerSelectFields.sjryxqlUnit])
let postData = {
mc:null,
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh:val.rowData.bh+val.rowData.bhCode,
nd:val.rowData.hhwznd,
nddw:val.headerSelectFields.hhwzndUnit,
kc: total,
kcdw: unit,
}
this.configCompleteRequest(postData);
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
</style>

+ 0
- 469
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP012.vue View File

@ -1,469 +0,0 @@
<!-- 生物样品分析方法学样品制备表Haemolysed matrix effect-生物样品分析方法学样品制备表溶血基质效应 -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" ref="baseInfoRef"
:formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns"
:dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns"
:dataSource="yqResource" />
<BaseInfoFormPackage fieldItemLabel="template.common.storageCondition" label="template.common.storageCondition" ref="storageConditionRef"
:formConfig="storageFormConfig" :formData="formData" />
<LineLabel label="template.common.operationSteps" />
<div class="template-form-item">
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig"
:formData="formData" />
<CustomTable
@blur="onHandleTableBlur"
:ref="`tableRef`"
:columns="tableStepColumns"
:formData="formData"
:prefixKey = "`table`"
fieldItemLabel = "template.common.operationSteps"
:showOperation="fillType === 'preFill'"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
@subPackageSubmit="subPackageSubmit"
@startConfig="startConfig"
@configComplete="configComplete"
></TableOpertaion>
</template>
</CustomTable>
</div>
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" ref="remarkRef" :formConfig="remarkConig"
:formData="formData" />
</div>
</div>
</div>
<!-- <button @click = "onSave">保存</button> -->
</div>
</template>
<script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import { getLatestSnArr } from '@/api/template';
import {getSWYPFXFFXYPZBBTableConfig} from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { EventBus } from "@/utils/eventBus";
import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools";
export default {
name: "RXJZXY",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaion },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition: {
label: 'template.common.storageConditionLabel',
type: "select",
fillType: "preFill",
options: this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
}
}
];
},
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
baseInfoFormConfig() {
return [
{
type: "cardItem",
config: {
studyMc: {
label: 'template.common.testName',
type: "input",
disabled: true,
},
studySn: {
label: 'template.common.testNumber',
type: "input",
disabled: true,
},
methodCode: {
label: 'template.common.methodCode',
type: "input",
fillType: "preFill",
maxlength: 50
},
versionNum: {
label: 'template.common.versionNumber',
type: "inputNumber",
fillType: "actFill",
prepend: "V",
maxlength: 50
},
//
clpbg: {
label: 'template.sp.sp008.clpbh',
type: "input",
fillType: "actFill",
maxlength: 50
},
}
},
{
type: "conditionItem",
label: 'template.common.testConfigurationConditions',
config: {
pre: {
label: 'template.common.preFill',
type: "select",
multiple: true,
fillType: "preFill",
options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
},
act: {
label: 'template.common.actualFill',
type: "select",
fillType: "actFill",
otherCode: "actOther",
compareTo: "pre",
multiple: true,
options: this.getDictOptions('business_pztj')
}
}
},
{
type: "cellItem",
label: 'template.sp.sp008.rqcz',
config: {
rqcz: {
type: "select",
multiple: true,
fillType: "actFill",
options: this.getDictOptions('business_rqcz'),
otherCode: "rqczOther",
},
}
},
{
type: "cellItem",
label: 'template.sp.sp008.clsj',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
},
stepFormConfig() {
return [
{
type: "step",
config: {
jz: {
label: 'template.sp.sp011.xzxsy',
type: "input",
fillType: "preFill",
subType: "sj",
subKey: "subJz",
subFillType: "actFill",
maxlength: 20,
labelWidth: 80,
},
}
}
]
},
tableStepColumns() {
return getSWYPFXFFXYPZBBTableConfig(this,'business_sp_rxjzxy',true);
},
},
data() {
return {
reagentType: "",//12
currentSubKey: "",//key
rowIndex:0,//
formData: {}
};
},
mounted() {
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {
//
async getCode(v){
const {stepTableFormData = []} = v;
if(stepTableFormData && stepTableFormData.length>0 && !stepTableFormData[0].bhCode){
let postSn = []
for(let i=0;i<stepTableFormData.length;i++){
postSn.push({
pre:stepTableFormData[i].bh,
type:1
})
}
const result = await getLatestSnArr(postSn)
if(result.code == 200){
for(let i=0;i<stepTableFormData.length;i++){
this.$refs.tableRef.updateDataSourceByRowIndex(i,{
bhCode: result.data[i],
})
}
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
setTimeout(() => {
debugger
EventBus.$emit('onModifyRecord', params,)
}, 10);
}
}
},
//
getFilledFormData(){
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef","stepRef", "remarkRef"])
},
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"]);
return content;
},
getResource() {
let content = this.getFilledFormData();
//resource
let tmpResource = []
if(this.fillType === "actFill"){
let tableList = content.stepTableFormData
if(tableList && tableList.length>0){
for(let i=0;i<tableList.length;i++){
//
let item = tableList[i]
//使
tmpResource.push({
mc: null,
bh: item.sjry,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjryxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjryxqlUnit,
yxzq:null,
yxzqdw:null,
})
tmpResource.push({
mc: null,
bh: content.subJz,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjjzxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjjzxqlUnit,
yxzq:null,
yxzqdw:null,
})
//
let fzTotal = 0//
if(item.fzsj && item.fzsj.fzList && item.fzsj.fzList.length>0){
for(let j=0;j<item.fzsj.fzList.length;j++){
let fzItem = item.fzsj.fzList[j]
tmpResource.push({
mc: null,
bh: item.fzsj.mybh+fzItem.preCode + fzItem.subCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: fzItem.num,
kcdw: item.fzsj.dw,
syl: null,
type: null,
elnType: this.product,
syldw:item.fzsj.dw,
yxzq:null,
yxzqdw:null,
})
fzTotal=addDecimals(fzTotal,fzItem.num)
}
}
//
const { total, unit } = addTj([item.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit])
tmpResource.push({
mc: null,
bh: item.bh+item.bhCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: total,
kcdw: unit,
syl: fzTotal>0?fzTotal:null,
type: null,
elnType: this.product,
syldw:fzTotal>0?item.fzsj.dw:unit,
yxzq:null,
yxzqdw:null,
})
}
}
}
if(tmpResource.length>0){
tmpResource = uniqeResourceOne(tmpResource)
}
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
return this.resourceTmp;
},
async onSave() {
const formData = await this.getFilledFormData();
console.log(formData, "formData")
},
//
deleteRow(rowIndex) {
const tableRef = this.$refs['tableRef'];
if (tableRef) {
tableRef.deleteRow(rowIndex);
}
},
subPackageSubmit(val){
console.log("分装数据:"+JSON.stringify(val))
if(val.fzsj.fzList && val.fzsj.fzList.length>0){
let list = []
for(let i=0;i<val.fzsj.fzList.length;i++){
let item = val.fzsj.fzList[i]
list.push({
bh:val.fzsj.mybh+item.preCode + item.subCode,
kc:item.num,
kcdw:val.fzsj.dw,
})
}
let postData = {
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh:val.fzsj.mybh,
nd:val.rowData.hhwznd,
nddw:val.headerSelectFields.hhwzndUnit,
list:list
}
console.log("分装提交数据:"+JSON.stringify(postData))
this.subPackageRequest(postData)
}
},
startConfig(val){
console.log("开始配置数据:"+JSON.stringify(val))
let postData = {
bh:val.rowData.bh+val.rowData.bhCode,
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
}
console.log("开始配置提交数据:"+JSON.stringify(postData))
this.startConfigRequest(postData);
},
configComplete(val){
if(val.rowData.sjjzxql==='' || val.rowData.sjjzxql===undefined || val.rowData.sjryxql==='' || val.rowData.sjryxql===undefined){
this.$message.error("表格内容未填完")
return
}
console.log("完成配置数据:"+JSON.stringify(val))
const { total, unit } = addTj([val.rowData.sjjzxql, val.rowData.sjryxql], [val.headerSelectFields.sjjzxqlUnit, val.headerSelectFields.sjryxqlUnit])
let postData = {
mc:null,
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh:val.rowData.bh+val.rowData.bhCode,
nd:val.rowData.hhwznd,
nddw:val.headerSelectFields.hhwzndUnit,
kc: total,
kcdw: unit,
}
console.log("完成配置提交数据:"+JSON.stringify(postData))
this.configCompleteRequest(postData);
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
</style>

+ 0
- 467
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP013.vue View File

@ -1,467 +0,0 @@
<!-- 生物样品分析方法学样品制备表Matrix effect-生物样品分析方法学样品制备表基质效应 -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" ref="baseInfoRef"
:formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns"
:dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns"
:dataSource="yqResource" />
<BaseInfoFormPackage fieldItemLabel="template.common.storageCondition" label="template.common.storageCondition" ref="storageConditionRef"
:formConfig="storageFormConfig" :formData="formData" />
<LineLabel label="template.common.operationSteps" />
<div class="template-form-item">
<CustomTable
@blur="onHandleTableBlur"
:ref="`tableRef`"
:columns="tableStepColumns"
:formData="formData"
:prefixKey = "`table`"
fieldItemLabel = "template.common.operationSteps"
:showOperation="fillType === 'preFill'"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
@subPackageSubmit="subPackageSubmit"
@startConfig="startConfig"
@configComplete="configComplete"
></TableOpertaion>
</template>
</CustomTable>
</div>
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" ref="remarkRef" :formConfig="remarkConig"
:formData="formData" />
</div>
</div>
</div>
<!-- <button @click = "onSave">保存</button> -->
</div>
</template>
<script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import { getLatestSnArr } from '@/api/template';
import {getSWYPFXFFXYPZBBTableConfig} from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { EventBus } from "@/utils/eventBus";
import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools";
export default {
name: "JZXY",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaion },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition: {
label: 'template.common.storageConditionLabel',
type: "select",
fillType: "preFill",
options: this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
}
}
];
},
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
baseInfoFormConfig() {
return [
{
type: "cardItem",
config: {
studyMc: {
label: 'template.common.testName',
type: "input",
disabled: true,
},
studySn: {
label: 'template.common.testNumber',
type: "input",
disabled: true,
},
methodCode: {
label: 'template.common.methodCode',
type: "input",
fillType: "preFill",
maxlength: 50
},
versionNum: {
label: 'template.common.versionNumber',
type: "inputNumber",
fillType: "actFill",
prepend: "V",
maxlength: 50
},
//
clpbg: {
label: 'template.sp.sp008.clpbh',
type: "input",
fillType: "actFill",
maxlength: 50
},
}
},
{
type: "conditionItem",
label: 'template.common.testConfigurationConditions',
config: {
pre: {
label: 'template.common.preFill',
type: "select",
multiple: true,
fillType: "preFill",
options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
},
act: {
label: 'template.common.actualFill',
type: "select",
fillType: "actFill",
otherCode: "actOther",
compareTo: "pre",
multiple: true,
options: this.getDictOptions('business_pztj')
}
}
},
{
type: "cellItem",
label: 'template.sp.sp008.rqcz',
config: {
rqcz: {
type: "select",
multiple: true,
fillType: "actFill",
options: this.getDictOptions('business_rqcz'),
otherCode: "rqczOther",
},
}
},
{
type: "cellItem",
label: 'template.sp.sp008.clsj',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
},
stepFormConfig() {
return [
{
type: "step",
config: {
jz: {
label: 'template.sp.sp011.xzxsy',
type: "input",
fillType: "preFill",
subType: "sj",
subKey: "subJz",
subFillType: "actFill",
maxlength: 20,
labelWidth: 80,
},
}
}
]
},
tableStepColumns() {
return getSWYPFXFFXYPZBBTableConfig(this,'business_sp_jzxy',false,true);
},
},
data() {
return {
reagentType: "",//12
currentSubKey: "",//key
rowIndex:0,//
formData: {}
};
},
mounted() {
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {
//
async getCode(v){
const {stepTableFormData = []} = v;
if(stepTableFormData && stepTableFormData.length>0 && !stepTableFormData[0].bhCode){
let postSn = []
for(let i=0;i<stepTableFormData.length;i++){
postSn.push({
pre:stepTableFormData[i].bh,
type:1
})
}
const result = await getLatestSnArr(postSn)
if(result.code == 200){
for(let i=0;i<stepTableFormData.length;i++){
this.$refs.tableRef.updateDataSourceByRowIndex(i,{
bhCode: result.data[i],
})
}
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
setTimeout(() => {
debugger
EventBus.$emit('onModifyRecord', params,)
}, 10);
}
}
},
//
getFilledFormData(){
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "tableRef","stepRef", "remarkRef"])
},
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef","tableRef" ,"stepRef", "remarkRef"]);
return content;
},
getResource() {
let content = this.getFilledFormData();
//resource
let tmpResource = []
if(this.fillType === "actFill"){
let tableList = content.stepTableFormData
if(tableList && tableList.length>0){
for(let i=0;i<tableList.length;i++){
//
let item = tableList[i]
//使
tmpResource.push({
mc: null,
bh: item.sjry,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjryxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjryxqlUnit,
yxzq:null,
yxzqdw:null,
})
tmpResource.push({
mc: null,
bh: item.kbjzbh,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjjzxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjjzxqlUnit,
yxzq:null,
yxzqdw:null,
})
//
let fzTotal = 0//
if(item.fzsj && item.fzsj.fzList && item.fzsj.fzList.length>0){
for(let j=0;j<item.fzsj.fzList.length;j++){
let fzItem = item.fzsj.fzList[j]
tmpResource.push({
mc: null,
bh: item.fzsj.mybh+fzItem.preCode + fzItem.subCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: fzItem.num,
kcdw: item.fzsj.dw,
syl: null,
type: null,
elnType: this.product,
syldw:item.fzsj.dw,
yxzq:null,
yxzqdw:null,
})
fzTotal=addDecimals(fzTotal,fzItem.num)
}
}
//
const { total, unit } = addTj([item.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit])
tmpResource.push({
mc: null,
bh: item.bh+item.bhCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: total,
kcdw: unit,
syl: fzTotal>0?fzTotal:null,
type: null,
elnType: this.product,
syldw:fzTotal>0?item.fzsj.dw:unit,
yxzq:null,
yxzqdw:null,
})
}
}
}
if(tmpResource.length>0){
tmpResource = uniqeResourceOne(tmpResource)
}
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
return this.resourceTmp;
},
async onSave() {
const formData = await this.getFilledFormData();
console.log(formData, "formData")
},
//
deleteRow(rowIndex) {
const tableRef = this.$refs['tableRef'];
if (tableRef) {
tableRef.deleteRow(rowIndex);
}
},
subPackageSubmit(val){
console.log("分装数据:"+JSON.stringify(val))
if(val.fzsj.fzList && val.fzsj.fzList.length>0){
let list = []
for(let i=0;i<val.fzsj.fzList.length;i++){
let item = val.fzsj.fzList[i]
list.push({
bh:val.fzsj.mybh+item.preCode + item.subCode,
kc:item.num,
kcdw:val.fzsj.dw,
})
}
let postData = {
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh:val.fzsj.mybh,
nd:val.rowData.hhwznd,
nddw:val.headerSelectFields.hhwzndUnit,
list:list
}
console.log("分装提交数据:"+JSON.stringify(postData))
this.subPackageRequest(postData)
}
},
startConfig(val){
console.log("开始配置数据:"+JSON.stringify(val))
let postData = {
bh:val.rowData.bh+val.rowData.bhCode,
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
}
console.log("开始配置提交数据:"+JSON.stringify(postData))
this.startConfigRequest(postData);
},
configComplete(val){
if(val.rowData.sjjzxql==='' || val.rowData.sjjzxql===undefined || val.rowData.sjryxql==='' || val.rowData.sjryxql===undefined){
this.$message.error("表格内容未填完")
return
}
console.log("完成配置数据:"+JSON.stringify(val))
const { total, unit } = addTj([val.rowData.sjjzxql, val.rowData.sjryxql], [val.headerSelectFields.sjjzxqlUnit, val.headerSelectFields.sjryxqlUnit])
let postData = {
mc:null,
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh:val.rowData.bh+val.rowData.bhCode,
nd:val.rowData.hhwznd,
nddw:val.headerSelectFields.hhwzndUnit,
kc: total,
kcdw: unit,
}
console.log("完成配置提交数据:"+JSON.stringify(postData))
this.configCompleteRequest(postData);
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
</style>

+ 0
- 469
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP014.vue View File

@ -1,469 +0,0 @@
<!-- 生物样品分析方法学样品制备表-储备液和工作液稳定性 Solution Stability -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" ref="baseInfoRef"
:formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns"
:dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns"
:dataSource="yqResource" />
<BaseInfoFormPackage fieldItemLabel="template.common.storageCondition" label="template.common.storageCondition" ref="storageConditionRef"
:formConfig="storageFormConfig" :formData="formData" />
<LineLabel label="template.common.operationSteps" />
<div class="template-form-item">
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig"
:formData="formData" />
<CustomTable
@blur="onHandleTableBlur"
:ref="`tableRef`"
:columns="tableStepColumns"
:formData="formData"
:prefixKey = "`table`"
fieldItemLabel = "template.common.operationSteps"
:showOperation="fillType === 'preFill'"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
@subPackageSubmit="subPackageSubmit"
@startConfig="startConfig"
@configComplete="configComplete"
></TableOpertaion>
</template>
</CustomTable>
</div>
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" ref="remarkRef" :formConfig="remarkConig"
:formData="formData" />
</div>
</div>
</div>
<!-- <button @click = "onSave">保存</button> -->
</div>
</template>
<script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import { getLatestSnArr } from '@/api/template';
import {getSWYPFXFFXYPZBBTableConfig} from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { EventBus } from "@/utils/eventBus";
import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools";
export default {
name: "XZXHTYX",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaion },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition: {
label: 'template.common.storageConditionLabel',
type: "select",
fillType: "preFill",
options: this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
}
}
];
},
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
baseInfoFormConfig() {
return [
{
type: "cardItem",
config: {
studyMc: {
label: 'template.common.testName',
type: "input",
disabled: true,
},
studySn: {
label: 'template.common.testNumber',
type: "input",
disabled: true,
},
methodCode: {
label: 'template.common.methodCode',
type: "input",
fillType: "preFill",
maxlength: 50
},
versionNum: {
label: 'template.common.versionNumber',
type: "inputNumber",
fillType: "actFill",
prepend: "V",
maxlength: 50
},
//
clpbg: {
label: 'template.sp.sp008.clpbh',
type: "input",
fillType: "actFill",
maxlength: 50
},
}
},
{
type: "conditionItem",
label: 'template.common.testConfigurationConditions',
config: {
pre: {
label: 'template.common.preFill',
type: "select",
multiple: true,
fillType: "preFill",
options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
},
act: {
label: 'template.common.actualFill',
type: "select",
fillType: "actFill",
otherCode: "actOther",
compareTo: "pre",
multiple: true,
options: this.getDictOptions('business_pztj')
}
}
},
{
type: "cellItem",
label: 'template.sp.sp008.rqcz',
config: {
rqcz: {
type: "select",
multiple: true,
fillType: "actFill",
options: this.getDictOptions('business_rqcz'),
otherCode: "rqczOther",
},
}
},
{
type: "cellItem",
label: 'template.sp.sp008.clsj',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
},
stepFormConfig() {
return [
{
type: "step",
config: {
jz: {
label: 'template.sp.sp011.xzxsy',
type: "input",
fillType: "preFill",
subType: "sj",
subKey: "subJz",
subFillType: "actFill",
maxlength: 20,
labelWidth: 80,
},
}
}
]
},
tableStepColumns() {
return getSWYPFXFFXYPZBBTableConfig(this,'business_sp_xzxytyx',true);
},
},
data() {
return {
reagentType: "",//12
currentSubKey: "",//key
rowIndex:0,//
formData: {}
};
},
mounted() {
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {
//
async getCode(v){
const {stepTableFormData = []} = v;
if(stepTableFormData && stepTableFormData.length>0 && !stepTableFormData[0].bhCode){
let postSn = []
for(let i=0;i<stepTableFormData.length;i++){
postSn.push({
pre:stepTableFormData[i].bh,
type:1
})
}
const result = await getLatestSnArr(postSn)
if(result.code == 200){
for(let i=0;i<stepTableFormData.length;i++){
this.$refs.tableRef.updateDataSourceByRowIndex(i,{
bhCode: result.data[i],
})
}
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
setTimeout(() => {
debugger
EventBus.$emit('onModifyRecord', params,)
}, 10);
}
}
},
//
getFilledFormData(){
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef","stepRef", "remarkRef"])
},
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"]);
return content;
},
getResource() {
let content = this.getFilledFormData();
//resource
let tmpResource = []
if(this.fillType === "actFill"){
let tableList = content.stepTableFormData
if(tableList && tableList.length>0){
for(let i=0;i<tableList.length;i++){
//
let item = tableList[i]
//使
tmpResource.push({
mc: null,
bh: item.sjry,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjryxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjryxqlUnit,
yxzq:null,
yxzqdw:null,
})
tmpResource.push({
mc: null,
bh: content.subJz,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjjzxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjjzxqlUnit,
yxzq:null,
yxzqdw:null,
})
//
let fzTotal = 0//
if(item.fzsj && item.fzsj.fzList && item.fzsj.fzList.length>0){
for(let j=0;j<item.fzsj.fzList.length;j++){
let fzItem = item.fzsj.fzList[j]
tmpResource.push({
mc: null,
bh: item.fzsj.mybh+fzItem.preCode + fzItem.subCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: fzItem.num,
kcdw: item.fzsj.dw,
syl: null,
type: null,
elnType: this.product,
syldw:item.fzsj.dw,
yxzq:null,
yxzqdw:null,
})
fzTotal=addDecimals(fzTotal,fzItem.num)
}
}
//
const { total, unit } = addTj([item.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit])
tmpResource.push({
mc: null,
bh: item.bh+item.bhCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: total,
kcdw: unit,
syl: fzTotal>0?fzTotal:null,
type: null,
elnType: this.product,
syldw:fzTotal>0?item.fzsj.dw:unit,
yxzq:null,
yxzqdw:null,
})
}
}
}
if(tmpResource.length>0){
tmpResource = uniqeResourceOne(tmpResource)
}
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
return this.resourceTmp;
},
async onSave() {
const formData = await this.getFilledFormData();
console.log(formData, "formData")
},
//
deleteRow(rowIndex) {
const tableRef = this.$refs['tableRef'];
if (tableRef) {
tableRef.deleteRow(rowIndex);
}
},
subPackageSubmit(val){
console.log("分装数据:"+JSON.stringify(val))
if(val.fzsj.fzList && val.fzsj.fzList.length>0){
let list = []
for(let i=0;i<val.fzsj.fzList.length;i++){
let item = val.fzsj.fzList[i]
list.push({
bh:val.fzsj.mybh+item.preCode + item.subCode,
kc:item.num,
kcdw:val.fzsj.dw,
})
}
let postData = {
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh:val.fzsj.mybh,
nd:val.rowData.hhwznd,
nddw:val.headerSelectFields.hhwzndUnit,
list:list
}
console.log("分装提交数据:"+JSON.stringify(postData))
this.subPackageRequest(postData)
}
},
startConfig(val){
console.log("开始配置数据:"+JSON.stringify(val))
let postData = {
bh:val.rowData.bh+val.rowData.bhCode,
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
}
console.log("开始配置提交数据:"+JSON.stringify(postData))
this.startConfigRequest(postData);
},
configComplete(val){
if(val.rowData.sjjzxql==='' || val.rowData.sjjzxql===undefined || val.rowData.sjryxql==='' || val.rowData.sjryxql===undefined){
this.$message.error("表格内容未填完")
return
}
console.log("完成配置数据:"+JSON.stringify(val))
const { total, unit } = addTj([val.rowData.sjjzxql, val.rowData.sjryxql], [val.headerSelectFields.sjjzxqlUnit, val.headerSelectFields.sjryxqlUnit])
let postData = {
mc:null,
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh:val.rowData.bh+val.rowData.bhCode,
nd:val.rowData.hhwznd,
nddw:val.headerSelectFields.hhwzndUnit,
kc: total,
kcdw: unit,
}
console.log("完成配置提交数据:"+JSON.stringify(postData))
this.configCompleteRequest(postData);
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
</style>

+ 0
- 469
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP015.vue View File

@ -1,469 +0,0 @@
<!-- 生物样品分析方法学样品制备表-最大样本数-生物样品分析方法学样品制备表(Sample Size) -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" ref="baseInfoRef"
:formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns"
:dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns"
:dataSource="yqResource" />
<BaseInfoFormPackage fieldItemLabel="template.common.storageCondition" label="template.common.storageCondition" ref="storageConditionRef"
:formConfig="storageFormConfig" :formData="formData" />
<LineLabel label="template.common.operationSteps" />
<div class="template-form-item">
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig"
:formData="formData" />
<CustomTable
@blur="onHandleTableBlur"
:ref="`tableRef`"
:columns="tableStepColumns"
:formData="formData"
:prefixKey = "`table`"
fieldItemLabel = "template.common.operationSteps"
:showOperation="fillType === 'preFill'"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
@subPackageSubmit="subPackageSubmit"
@startConfig="startConfig"
@configComplete="configComplete"
></TableOpertaion>
</template>
</CustomTable>
</div>
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" ref="remarkRef" :formConfig="remarkConig"
:formData="formData" />
</div>
</div>
</div>
<!-- <button @click = "onSave">保存</button> -->
</div>
</template>
<script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import { getLatestSnArr } from '@/api/template';
import {getSWYPFXFFXYPZBBTableConfig} from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { EventBus } from "@/utils/eventBus";
import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools";
export default {
name: "ZDYBS",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaion },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition: {
label: 'template.common.storageConditionLabel',
type: "select",
fillType: "preFill",
options: this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
}
}
];
},
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
baseInfoFormConfig() {
return [
{
type: "cardItem",
config: {
studyMc: {
label: 'template.common.testName',
type: "input",
disabled: true,
},
studySn: {
label: 'template.common.testNumber',
type: "input",
disabled: true,
},
methodCode: {
label: 'template.common.methodCode',
type: "input",
fillType: "preFill",
maxlength: 50
},
versionNum: {
label: 'template.common.versionNumber',
type: "inputNumber",
fillType: "actFill",
prepend: "V",
maxlength: 50
},
//
clpbg: {
label: 'template.sp.sp008.clpbh',
type: "input",
fillType: "actFill",
maxlength: 50
},
}
},
{
type: "conditionItem",
label: 'template.common.testConfigurationConditions',
config: {
pre: {
label: 'template.common.preFill',
type: "select",
multiple: true,
fillType: "preFill",
options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
},
act: {
label: 'template.common.actualFill',
type: "select",
fillType: "actFill",
otherCode: "actOther",
compareTo: "pre",
multiple: true,
options: this.getDictOptions('business_pztj')
}
}
},
{
type: "cellItem",
label: 'template.sp.sp008.rqcz',
config: {
rqcz: {
type: "select",
multiple: true,
fillType: "actFill",
options: this.getDictOptions('business_rqcz'),
otherCode: "rqczOther",
},
}
},
{
type: "cellItem",
label: 'template.sp.sp008.clsj',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
},
stepFormConfig() {
return [
{
type: "step",
config: {
jz: {
label: 'template.sp.sp008.xzjz',
type: "input",
fillType: "preFill",
subType: "sj",
subKey: "subJz",
subFillType: "actFill",
maxlength: 20,
labelWidth: 80,
},
}
}
]
},
tableStepColumns() {
return getSWYPFXFFXYPZBBTableConfig(this,'business_sp_zdybs');
},
},
data() {
return {
reagentType: "",//12
currentSubKey: "",//key
rowIndex:0,//
formData: {}
};
},
mounted() {
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {
//
async getCode(v){
const {stepTableFormData = []} = v;
if(stepTableFormData && stepTableFormData.length>0 && !stepTableFormData[0].bhCode){
let postSn = []
for(let i=0;i<stepTableFormData.length;i++){
postSn.push({
pre:stepTableFormData[i].bh,
type:1
})
}
const result = await getLatestSnArr(postSn)
if(result.code == 200){
for(let i=0;i<stepTableFormData.length;i++){
this.$refs.tableRef.updateDataSourceByRowIndex(i,{
bhCode: result.data[i],
})
}
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
setTimeout(() => {
debugger
EventBus.$emit('onModifyRecord', params,)
}, 10);
}
}
},
//
getFilledFormData(){
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef","stepRef", "remarkRef"])
},
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"]);
return content;
},
getResource() {
let content = this.getFilledFormData();
//resource
let tmpResource = []
if(this.fillType === "actFill"){
let tableList = content.stepTableFormData
if(tableList && tableList.length>0){
for(let i=0;i<tableList.length;i++){
//
let item = tableList[i]
//使
tmpResource.push({
mc: null,
bh: item.sjry,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjryxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjryxqlUnit,
yxzq:null,
yxzqdw:null,
})
tmpResource.push({
mc: null,
bh: content.subJz,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjjzxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjjzxqlUnit,
yxzq:null,
yxzqdw:null,
})
//
let fzTotal = 0//
if(item.fzsj && item.fzsj.fzList && item.fzsj.fzList.length>0){
for(let j=0;j<item.fzsj.fzList.length;j++){
let fzItem = item.fzsj.fzList[j]
tmpResource.push({
mc: null,
bh: item.fzsj.mybh+fzItem.preCode + fzItem.subCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: fzItem.num,
kcdw: item.fzsj.dw,
syl: null,
type: null,
elnType: this.product,
syldw:item.fzsj.dw,
yxzq:null,
yxzqdw:null,
})
fzTotal=addDecimals(fzTotal,fzItem.num)
}
}
//
const { total, unit } = addTj([item.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit])
tmpResource.push({
mc: null,
bh: item.bh+item.bhCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: total,
kcdw: unit,
syl: fzTotal>0?fzTotal:null,
type: null,
elnType: this.product,
syldw:fzTotal>0?item.fzsj.dw:unit,
yxzq:null,
yxzqdw:null,
})
}
}
}
if(tmpResource.length>0){
tmpResource = uniqeResourceOne(tmpResource)
}
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
return this.resourceTmp;
},
async onSave() {
const formData = await this.getFilledFormData();
console.log(formData, "formData")
},
//
deleteRow(rowIndex) {
const tableRef = this.$refs['tableRef'];
if (tableRef) {
tableRef.deleteRow(rowIndex);
}
},
subPackageSubmit(val){
console.log("分装数据:"+JSON.stringify(val))
if(val.fzsj.fzList && val.fzsj.fzList.length>0){
let list = []
for(let i=0;i<val.fzsj.fzList.length;i++){
let item = val.fzsj.fzList[i]
list.push({
bh:val.fzsj.mybh+item.preCode + item.subCode,
kc:item.num,
kcdw:val.fzsj.dw,
})
}
let postData = {
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh:val.fzsj.mybh,
nd:val.rowData.hhwznd,
nddw:val.headerSelectFields.hhwzndUnit,
list:list
}
console.log("分装提交数据:"+JSON.stringify(postData))
this.subPackageRequest(postData)
}
},
startConfig(val){
console.log("开始配置数据:"+JSON.stringify(val))
let postData = {
bh:val.rowData.bh+val.rowData.bhCode,
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
}
console.log("开始配置提交数据:"+JSON.stringify(postData))
this.startConfigRequest(postData);
},
configComplete(val){
if(val.rowData.sjjzxql==='' || val.rowData.sjjzxql===undefined || val.rowData.sjryxql==='' || val.rowData.sjryxql===undefined){
this.$message.error("表格内容未填完")
return
}
console.log("完成配置数据:"+JSON.stringify(val))
const { total, unit } = addTj([val.rowData.sjjzxql, val.rowData.sjryxql], [val.headerSelectFields.sjjzxqlUnit, val.headerSelectFields.sjryxqlUnit])
let postData = {
mc:null,
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh:val.rowData.bh+val.rowData.bhCode,
nd:val.rowData.hhwznd,
nddw:val.headerSelectFields.hhwzndUnit,
kc: total,
kcdw: unit,
}
console.log("完成配置提交数据:"+JSON.stringify(postData))
this.configCompleteRequest(postData);
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
</style>

+ 0
- 473
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP016.vue View File

@ -1,473 +0,0 @@
<!-- 生物样品分析方法学样品制备表(Dilution Integrity)- 生物样品分析方法学样品制备表稀释可靠性-->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" ref="baseInfoRef"
:formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns"
:dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns"
:dataSource="yqResource" />
<BaseInfoFormPackage fieldItemLabel="template.common.storageCondition" label="template.common.storageCondition" ref="storageConditionRef"
:formConfig="storageFormConfig" :formData="formData" />
<LineLabel label="template.common.operationSteps" />
<div class="template-form-item">
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig"
:formData="formData" />
<CustomTable
@blur="onHandleTableBlur"
:ref="`tableRef`"
:columns="tableStepColumns"
:formData="formData"
:prefixKey = "`table`"
fieldItemLabel = "template.common.operationSteps"
:showOperation="fillType === 'preFill'"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
@subPackageSubmit="subPackageSubmit"
@startConfig="startConfig"
@configComplete="configComplete"
></TableOpertaion>
</template>
</CustomTable>
</div>
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" ref="remarkRef" :formConfig="remarkConig"
:formData="formData" />
</div>
</div>
</div>
<!-- <button @click = "onSave">保存</button> -->
</div>
</template>
<script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import { getLatestSnArr } from '@/api/template';
import {getSWYPFXFFXYPZBBTableConfig} from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { EventBus } from "@/utils/eventBus";
import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools";
export default {
name: "XSKKX",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaion },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition: {
label: 'template.common.storageConditionLabel',
type: "select",
fillType: "preFill",
options: this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
}
}
];
},
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
baseInfoFormConfig() {
return [
{
type: "cardItem",
config: {
studyMc: {
label: 'template.common.testName',
type: "input",
disabled: true,
},
studySn: {
label: 'template.common.testNumber',
type: "input",
disabled: true,
},
methodCode: {
label: 'template.common.methodCode',
type: "input",
fillType: "preFill",
maxlength: 50
},
versionNum: {
label: 'template.common.versionNumber',
type: "inputNumber",
fillType: "actFill",
prepend: "V",
maxlength: 50
},
//
clpbg: {
label: 'template.sp.sp008.clpbh',
type: "input",
fillType: "actFill",
maxlength: 50
},
}
},
{
type: "conditionItem",
label: 'template.common.testConfigurationConditions',
config: {
pre: {
label: 'template.common.preFill',
type: "select",
multiple: true,
fillType: "preFill",
options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
},
act: {
label: 'template.common.actualFill',
type: "select",
fillType: "actFill",
otherCode: "actOther",
compareTo: "pre",
multiple: true,
options: this.getDictOptions('business_pztj')
}
}
},
{
type: "cellItem",
label: 'template.sp.sp008.rqcz',
config: {
rqcz: {
type: "select",
multiple: true,
fillType: "actFill",
options: this.getDictOptions('business_rqcz'),
otherCode: "rqczOther",
},
}
},
{
type: "cellItem",
label: 'template.sp.sp008.clsj',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
},
stepFormConfig() {
return [
{
type: "step",
config: {
jz: {
label: 'template.sp.sp008.xzjz',
type: "input",
fillType: "preFill",
subType: "sj",
subKey: "subJz",
subFillType: "actFill",
maxlength: 20,
labelWidth: 80,
},
}
}
]
},
tableStepColumns() {
return getSWYPFXFFXYPZBBTableConfig(this,'business_sp_xskkx');
},
},
data() {
return {
reagentType: "",//12
currentSubKey: "",//key
rowIndex:0,//
formData: {}
};
},
mounted() {
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {
//
async getCode(v){
const {stepTableFormData = []} = v;
if(stepTableFormData && stepTableFormData.length>0 && !stepTableFormData[0].bhCode){
let postSn = []
for(let i=0;i<stepTableFormData.length;i++){
postSn.push({
pre:stepTableFormData[i].bh,
type:1
})
}
const result = await getLatestSnArr(postSn)
if(result.code == 200){
for(let i=0;i<stepTableFormData.length;i++){
this.$refs.tableRef.updateDataSourceByRowIndex(i,{
bhCode: result.data[i],
})
}
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
setTimeout(() => {
debugger
EventBus.$emit('onModifyRecord', params,)
}, 10);
}
}
},
//
getFilledFormData(){
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef","stepRef", "remarkRef"])
},
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"]);
return content;
},
getResource() {
let content = this.getFilledFormData();
//resource
let tmpResource = []
if(this.fillType === "actFill"){
let tableList = content.stepTableFormData
if(tableList && tableList.length>0){
for(let i=0;i<tableList.length;i++){
//
let item = tableList[i]
//使
tmpResource.push({
mc: null,
bh: item.sjry,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjryxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjryxqlUnit,
yxzq:null,
yxzqdw:null,
})
tmpResource.push({
mc: null,
bh: content.subJz,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjjzxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjjzxqlUnit,
yxzq:null,
yxzqdw:null,
})
//
let fzTotal = 0//
if(item.fzsj && item.fzsj.fzList && item.fzsj.fzList.length>0){
for(let j=0;j<item.fzsj.fzList.length;j++){
let fzItem = item.fzsj.fzList[j]
tmpResource.push({
mc: null,
bh: item.fzsj.mybh+fzItem.preCode + fzItem.subCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: fzItem.num,
kcdw: item.fzsj.dw,
syl: null,
type: null,
elnType: this.product,
syldw:item.fzsj.dw,
yxzq:null,
yxzqdw:null,
})
fzTotal=addDecimals(fzTotal,fzItem.num)
}
}
//
const { total, unit } = addTj([item.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit])
tmpResource.push({
mc: null,
bh: item.bh+item.bhCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: total,
kcdw: unit,
syl: fzTotal>0?fzTotal:null,
type: null,
elnType: this.product,
syldw:fzTotal>0?item.fzsj.dw:unit,
yxzq:null,
yxzqdw:null,
})
}
}
}
if(tmpResource.length>0){
tmpResource = uniqeResourceOne(tmpResource)
}
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
return this.resourceTmp;
},
async onSave() {
const formData = await this.getFilledFormData();
console.log(formData, "formData")
},
//
deleteRow(rowIndex) {
const tableRef = this.$refs['tableRef'];
if (tableRef) {
tableRef.deleteRow(rowIndex);
}
},
subPackageSubmit(val){
console.log("分装数据:"+JSON.stringify(val))
if(val.fzsj.fzList && val.fzsj.fzList.length>0){
let list = []
for(let i=0;i<val.fzsj.fzList.length;i++){
let item = val.fzsj.fzList[i]
list.push({
bh:val.fzsj.mybh+item.preCode + item.subCode,
kc:item.num,
kcdw:val.fzsj.dw,
})
}
let postData = {
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh:val.fzsj.mybh,
nd:val.rowData.hhwznd,
nddw:val.headerSelectFields.hhwzndUnit,
list:list
}
console.log("分装提交数据:"+JSON.stringify(postData))
this.subPackageRequest(postData)
}
},
startConfig(val){
console.log("开始配置数据:"+JSON.stringify(val))
let postData = {
bh:val.rowData.bh+val.rowData.bhCode,
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
}
console.log("开始配置提交数据:"+JSON.stringify(postData))
this.startConfigRequest(postData);
},
configComplete(val){
if(val.rowData.sjjzxql==='' || val.rowData.sjjzxql===undefined || val.rowData.sjryxql==='' || val.rowData.sjryxql===undefined){
this.$message.error("表格内容未填完")
return
}
if(val.rowData.sjjzxql==='' || val.rowData.sjjzxql===undefined || val.rowData.sjryxql==='' || val.rowData.sjryxql===undefined){
this.$message.error("表格内容未填完")
return
}
console.log("完成配置数据:"+JSON.stringify(val))
const { total, unit } = addTj([val.rowData.sjjzxql, val.rowData.sjryxql], [val.headerSelectFields.sjjzxqlUnit, val.headerSelectFields.sjryxqlUnit])
let postData = {
mc:null,
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh:val.rowData.bh+val.rowData.bhCode,
nd:val.rowData.hhwznd,
nddw:val.headerSelectFields.hhwzndUnit,
kc: total,
kcdw: unit,
}
console.log("完成配置提交数据:"+JSON.stringify(postData))
this.configCompleteRequest(postData);
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
</style>

+ 0
- 469
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP017.vue View File

@ -1,469 +0,0 @@
<!-- 生物样品分析方法学样品制备表(Stock solution comparison)- 生物样品分析方法学样品制备表储备液对比-->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" ref="baseInfoRef"
:formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns"
:dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns"
:dataSource="yqResource" />
<BaseInfoFormPackage fieldItemLabel="template.common.storageCondition" label="template.common.storageCondition" ref="storageConditionRef"
:formConfig="storageFormConfig" :formData="formData" />
<LineLabel label="template.common.operationSteps" />
<div class="template-form-item">
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig"
:formData="formData" />
<CustomTable
@blur="onHandleTableBlur"
:ref="`tableRef`"
:columns="tableStepColumns"
:formData="formData"
:prefixKey = "`table`"
fieldItemLabel = "template.common.operationSteps"
:showOperation="fillType === 'preFill'"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
@subPackageSubmit="subPackageSubmit"
@startConfig="startConfig"
@configComplete="configComplete"
></TableOpertaion>
</template>
</CustomTable>
</div>
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" ref="remarkRef" :formConfig="remarkConig"
:formData="formData" />
</div>
</div>
</div>
<!-- <button @click = "onSave">保存</button> -->
</div>
</template>
<script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import { getLatestSnArr } from '@/api/template';
import {getSWYPFXFFXYPZBBTableConfig} from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { EventBus } from "@/utils/eventBus";
import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools";
export default {
name: "CBYDB",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaion },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition: {
label: 'template.common.storageConditionLabel',
type: "select",
fillType: "preFill",
options: this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
}
}
];
},
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
baseInfoFormConfig() {
return [
{
type: "cardItem",
config: {
studyMc: {
label: 'template.common.testName',
type: "input",
disabled: true,
},
studySn: {
label: 'template.common.testNumber',
type: "input",
disabled: true,
},
methodCode: {
label: 'template.common.methodCode',
type: "input",
fillType: "preFill",
maxlength: 50
},
versionNum: {
label: 'template.common.versionNumber',
type: "inputNumber",
fillType: "actFill",
prepend: "V",
maxlength: 50
},
//
clpbg: {
label: 'template.sp.sp008.clpbh',
type: "input",
fillType: "actFill",
maxlength: 50
},
}
},
{
type: "conditionItem",
label: 'template.common.testConfigurationConditions',
config: {
pre: {
label: 'template.common.preFill',
type: "select",
multiple: true,
fillType: "preFill",
options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
},
act: {
label: 'template.common.actualFill',
type: "select",
fillType: "actFill",
otherCode: "actOther",
compareTo: "pre",
multiple: true,
options: this.getDictOptions('business_pztj')
}
}
},
{
type: "cellItem",
label: 'template.sp.sp008.rqcz',
config: {
rqcz: {
type: "select",
multiple: true,
fillType: "actFill",
options: this.getDictOptions('business_rqcz'),
otherCode: "rqczOther",
},
}
},
{
type: "cellItem",
label: 'template.sp.sp008.clsj',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
},
stepFormConfig() {
return [
{
type: "step",
config: {
jz: {
label: 'template.sp.sp008.xzjz',
type: "input",
fillType: "preFill",
subType: "sj",
subKey: "subJz",
subFillType: "actFill",
maxlength: 20,
labelWidth: 80,
},
}
}
]
},
tableStepColumns() {
return getSWYPFXFFXYPZBBTableConfig(this,'business_sp_cbydb');
},
},
data() {
return {
reagentType: "",//12
currentSubKey: "",//key
rowIndex:0,//
formData: {}
};
},
mounted() {
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {
//
async getCode(v){
const {stepTableFormData = []} = v;
if(stepTableFormData && stepTableFormData.length>0 && !stepTableFormData[0].bhCode){
let postSn = []
for(let i=0;i<stepTableFormData.length;i++){
postSn.push({
pre:stepTableFormData[i].bh,
type:1
})
}
const result = await getLatestSnArr(postSn)
if(result.code == 200){
for(let i=0;i<stepTableFormData.length;i++){
this.$refs.tableRef.updateDataSourceByRowIndex(i,{
bhCode: result.data[i],
})
}
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
setTimeout(() => {
debugger
EventBus.$emit('onModifyRecord', params,)
}, 10);
}
}
},
//
getFilledFormData(){
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef","stepRef", "remarkRef"])
},
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"]);
return content;
},
getResource() {
let content = this.getFilledFormData();
//resource
let tmpResource = []
if(this.fillType === "actFill"){
let tableList = content.stepTableFormData
if(tableList && tableList.length>0){
for(let i=0;i<tableList.length;i++){
//
let item = tableList[i]
//使
tmpResource.push({
mc: null,
bh: item.sjry,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjryxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjryxqlUnit,
yxzq:null,
yxzqdw:null,
})
tmpResource.push({
mc: null,
bh: content.subJz,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjjzxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjjzxqlUnit,
yxzq:null,
yxzqdw:null,
})
//
let fzTotal = 0//
if(item.fzsj && item.fzsj.fzList && item.fzsj.fzList.length>0){
for(let j=0;j<item.fzsj.fzList.length;j++){
let fzItem = item.fzsj.fzList[j]
tmpResource.push({
mc: null,
bh: item.fzsj.mybh+fzItem.preCode + fzItem.subCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: fzItem.num,
kcdw: item.fzsj.dw,
syl: null,
type: null,
elnType: this.product,
syldw:item.fzsj.dw,
yxzq:null,
yxzqdw:null,
})
fzTotal=addDecimals(fzTotal,fzItem.num)
}
}
//
const { total, unit } = addTj([item.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit])
tmpResource.push({
mc: null,
bh: item.bh+item.bhCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: total,
kcdw: unit,
syl: fzTotal>0?fzTotal:null,
type: null,
elnType: this.product,
syldw:fzTotal>0?item.fzsj.dw:unit,
yxzq:null,
yxzqdw:null,
})
}
}
}
if(tmpResource.length>0){
tmpResource = uniqeResourceOne(tmpResource)
}
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
return this.resourceTmp;
},
async onSave() {
const formData = await this.getFilledFormData();
console.log(formData, "formData")
},
//
deleteRow(rowIndex) {
const tableRef = this.$refs['tableRef'];
if (tableRef) {
tableRef.deleteRow(rowIndex);
}
},
subPackageSubmit(val){
console.log("分装数据:"+JSON.stringify(val))
if(val.fzsj.fzList && val.fzsj.fzList.length>0){
let list = []
for(let i=0;i<val.fzsj.fzList.length;i++){
let item = val.fzsj.fzList[i]
list.push({
bh:val.fzsj.mybh+item.preCode + item.subCode,
kc:item.num,
kcdw:val.fzsj.dw,
})
}
let postData = {
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh:val.fzsj.mybh,
nd:val.rowData.hhwznd,
nddw:val.headerSelectFields.hhwzndUnit,
list:list
}
console.log("分装提交数据:"+JSON.stringify(postData))
this.subPackageRequest(postData)
}
},
startConfig(val){
console.log("开始配置数据:"+JSON.stringify(val))
let postData = {
bh:val.rowData.bh+val.rowData.bhCode,
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
}
console.log("开始配置提交数据:"+JSON.stringify(postData))
this.startConfigRequest(postData);
},
configComplete(val){
if(val.rowData.sjjzxql==='' || val.rowData.sjjzxql===undefined || val.rowData.sjryxql==='' || val.rowData.sjryxql===undefined){
this.$message.error("表格内容未填完")
return
}
console.log("完成配置数据:"+JSON.stringify(val))
const { total, unit } = addTj([val.rowData.sjjzxql, val.rowData.sjryxql], [val.headerSelectFields.sjjzxqlUnit, val.headerSelectFields.sjryxqlUnit])
let postData = {
mc:null,
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh:val.rowData.bh+val.rowData.bhCode,
nd:val.rowData.hhwznd,
nddw:val.headerSelectFields.hhwzndUnit,
kc: total,
kcdw: unit,
}
console.log("完成配置提交数据:"+JSON.stringify(postData))
this.configCompleteRequest(postData);
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
</style>

+ 0
- 470
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP018.vue View File

@ -1,470 +0,0 @@
<!-- 生物样品分析方法学质控配制表-->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" ref="baseInfoRef"
:formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns"
:dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns"
:dataSource="yqResource" />
<BaseInfoFormPackage fieldItemLabel="template.common.storageCondition" label="template.common.storageCondition" ref="storageConditionRef"
:formConfig="storageFormConfig" :formData="formData" />
<LineLabel label="template.common.operationSteps" />
<div class="template-form-item">
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig"
:formData="formData" />
<CustomTable
@blur="onHandleTableBlur"
:ref="`tableRef`"
:columns="tableStepColumns"
:formData="formData"
:prefixKey = "`table`"
fieldItemLabel = "template.common.operationSteps"
:showOperation="fillType === 'preFill'"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
@subPackageSubmit="subPackageSubmit"
@startConfig="startConfig"
@configComplete="configComplete"
></TableOpertaion>
</template>
</CustomTable>
</div>
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" ref="remarkRef" :formConfig="remarkConig"
:formData="formData" />
</div>
</div>
</div>
<!-- <button @click = "onSave">保存</button> -->
</div>
</template>
<script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../../mixins/templateMixin.js";
import CustomTable from '@/components/Template/CustomTable.vue';
import { getLatestSnArr } from '@/api/template';
import {getSWYPFXFFXYPZBBTableConfig} from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { EventBus } from "@/utils/eventBus";
import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools";
export default {
name: "CBYDB",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaion },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition: {
label: 'template.common.storageConditionLabel',
type: "select",
fillType: "preFill",
options: this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
}
}
];
},
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
baseInfoFormConfig() {
return [
{
type: "cardItem",
config: {
studyMc: {
label: 'template.common.testName',
type: "input",
disabled: true,
},
studySn: {
label: 'template.common.testNumber',
type: "input",
disabled: true,
},
methodCode: {
label: 'template.common.methodCode',
type: "input",
fillType: "preFill",
maxlength: 50
},
versionNum: {
label: 'template.common.versionNumber',
type: "inputNumber",
fillType: "actFill",
prepend:"V",
maxlength: 50
},
//
clpbg: {
label: 'template.sp.sp008.clpbh',
type: "input",
fillType: "actFill",
maxlength: 50
},
}
},
{
type: "conditionItem",
label: 'template.common.testConfigurationConditions',
config: {
pre: {
label: 'template.common.preFill',
type: "select",
multiple: true,
fillType: "preFill",
options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
},
act: {
label: 'template.common.actualFill',
type: "select",
fillType: "actFill",
otherCode: "actOther",
compareTo: "pre",
multiple: true,
options: this.getDictOptions('business_pztj')
}
}
},
{
type: "cellItem",
label: 'template.sp.sp008.rqcz',
config: {
rqcz: {
type: "select",
multiple: true,
fillType: "actFill",
options: this.getDictOptions('business_rqcz'),
otherCode: "rqczOther",
},
}
},
{
type: "cellItem",
label: 'template.sp.sp008.clsj',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
},
stepFormConfig() {
return [
{
type: "step",
config: {
jz: {
label: 'template.sp.sp018.xzxsy',
type: "input",
fillType: "preFill",
subType: "sj",
subKey: "subJz",
subFillType: "actFill",
maxlength: 20,
labelWidth: 80,
},
}
}
]
},
tableStepColumns() {
return getSWYPFXFFXYPZBBTableConfig(this,'',true);
},
},
data() {
return {
reagentType: "",//12
currentSubKey: "",//key
rowIndex:0,//
formData: {}
};
},
mounted() {
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {
//
async getCode(v){
const {stepTableFormData = []} = v;
if(stepTableFormData && stepTableFormData.length>0 && !stepTableFormData[0].bhCode){
let postSn = []
for(let i=0;i<stepTableFormData.length;i++){
postSn.push({
pre:stepTableFormData[i].bh,
type:1
})
}
const result = await getLatestSnArr(postSn)
if(result.code == 200){
for(let i=0;i<stepTableFormData.length;i++){
this.$refs.tableRef.updateDataSourceByRowIndex(i,{
bhCode: result.data[i],
})
}
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
setTimeout(() => {
debugger
EventBus.$emit('onModifyRecord', params,)
}, 10);
}
}
},
getStepResource(){
return this.$refs.stepRef.getStepResource()
},
//
getFilledFormData(){
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef","stepRef", "remarkRef"])
},
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"]);
return content;
},
getResource() {
let content = this.getFilledFormData();
//resource
let tmpResource = []
if(this.fillType === "actFill"){
let tableList = content.stepTableFormData
if(tableList && tableList.length>0){
for(let i=0;i<tableList.length;i++){
//
let item = tableList[i]
//使
tmpResource.push({
mc: null,
bh: item.sjry,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjryxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjryxqlUnit,
yxzq:null,
yxzqdw:null,
})
tmpResource.push({
mc: null,
bh: content.subJz,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjjzxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjjzxqlUnit,
yxzq:null,
yxzqdw:null,
})
//
let fzTotal = 0//
if(item.fzsj && item.fzsj.fzList && item.fzsj.fzList.length>0){
for(let j=0;j<item.fzsj.fzList.length;j++){
let fzItem = item.fzsj.fzList[j]
tmpResource.push({
mc: null,
bh: item.fzsj.mybh+fzItem.preCode+ fzItem.subCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: fzItem.num,
kcdw: item.fzsj.dw,
syl: null,
type: null,
elnType: this.product,
syldw:item.fzsj.dw,
yxzq:null,
yxzqdw:null,
})
fzTotal=addDecimals(fzTotal,fzItem.num)
}
}
//
const { total, unit } = addTj([item.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit])
tmpResource.push({
mc: null,
bh: item.bh+item.bhCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: total,
kcdw: unit,
syl: fzTotal>0?fzTotal:null,
type: null,
elnType: this.product,
syldw:fzTotal>0?item.fzsj.dw:unit,
yxzq:null,
yxzqdw:null,
})
}
}
}
if(tmpResource.length>0){
tmpResource = uniqeResourceOne(tmpResource)
}
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
return this.resourceTmp;
},
async onSave() {
const formData = await this.getFilledFormData();
console.log(formData, "formData")
},
//
deleteRow(rowIndex) {
const tableRef = this.$refs['tableRef'];
if (tableRef) {
tableRef.deleteRow(rowIndex);
}
},
subPackageSubmit(val){
console.log("分装数据:"+JSON.stringify(val))
if(val.fzsj.fzList && val.fzsj.fzList.length>0){
let list = []
for(let i=0;i<val.fzsj.fzList.length;i++){
let item = val.fzsj.fzList[i]
list.push({
bh:val.fzsj.mybh+item.preCode+ item.subCode,
kc:item.num,
kcdw:val.fzsj.dw,
})
}
let postData = {
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh:val.fzsj.mybh,
nd:val.rowData.hhwznd,
nddw:val.headerSelectFields.hhwzndUnit,
list:list
}
console.log("分装提交数据:"+JSON.stringify(postData))
this.subPackageRequest(postData)
}
},
startConfig(val){
console.log("开始配置数据:"+JSON.stringify(val))
let postData = {
bh:val.rowData.bh+val.rowData.bhCode,
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
}
console.log("开始配置提交数据:"+JSON.stringify(postData))
this.startConfigRequest(postData);
},
configComplete(val){
if(val.rowData.sjjzxql==='' || val.rowData.sjjzxql===undefined || val.rowData.sjryxql==='' || val.rowData.sjryxql===undefined){
this.$message.error("表格内容未填完")
return
}
console.log("完成配置数据:"+JSON.stringify(val))
const { total, unit } = addTj([val.rowData.sjjzxql, val.rowData.sjryxql], [val.headerSelectFields.sjjzxqlUnit, val.headerSelectFields.sjryxqlUnit])
let postData = {
mc:null,
studyId:this.formData.studyId,
studyFormId:this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh:val.rowData.bh+val.rowData.bhCode,
nd:val.rowData.hhwznd,
nddw:val.headerSelectFields.hhwzndUnit,
kc: total,
kcdw: unit,
}
console.log("完成配置提交数据:"+JSON.stringify(postData))
this.configCompleteRequest(postData);
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
</style>

Loading…
Cancel
Save