| @ -0,0 +1,374 @@ | |||||
| <!-- 生物样品分析方法学样品制备表(Stock solution comparison)- 生物样品分析方法学样品制备表(储备液对比)--> | |||||
| <template> | |||||
| <div> | |||||
| <div class="detail-container"> | |||||
| <div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc || | |||||
| $t('template.sp.sp017.title') }}<img src="@/assets/images/detail-title.png" /></div> | |||||
| <div class="detail-content"> | |||||
| <div class="content"> | |||||
| <BaseInfoFormPcakge 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="yqsColumns" | |||||
| :dataSource="resource" /> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.storageCondition" label="template.common.storageCondition" ref="storageConditionRef" | |||||
| :formConfig="storageFormConfig" :formData="formData" /> | |||||
| <LineLabel label="template.common.operationSteps" /> | |||||
| <div class="template-form-item"> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig" | |||||
| :formData="formData" @clickable="handleJzClickable" /> | |||||
| <CustomTable | |||||
| @blur="onHandleTableBlur" | |||||
| :ref="`tableRef`" | |||||
| :columns="tableStepColumns" | |||||
| :formData="formData" | |||||
| :prefixKey = "`table`" | |||||
| @clickable="handleClickable" | |||||
| fieldItemLabel = "template.common.operationSteps" | |||||
| > | |||||
| <template slot="operation" slot-scope="{ row, rowIndex}"> | |||||
| <TableOpertaion | |||||
| :fillType="fillType" | |||||
| :row="row" | |||||
| :rowIndex="rowIndex" | |||||
| @deleteRow="(rowIndex) => deleteRow(rowIndex)" | |||||
| ></TableOpertaion> | |||||
| </template> | |||||
| </CustomTable> | |||||
| </div> | |||||
| <Step ref="stepRef" :formData="formData.stepData"></Step> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.remark" label="template.common.remark" ref="remarkRef" :formConfig="remarkConig" | |||||
| :formData="formData" /> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| <!-- <button @click = "onSave">保存</button> --> | |||||
| <SelectReagentDialog | |||||
| @submit="onSelectReagentSubmit" | |||||
| ref="selectReagentDialogRef" > | |||||
| </SelectReagentDialog> | |||||
| </div> | |||||
| </template> | |||||
| <script> | |||||
| import BaseInfoFormPcakge from "@/components/Template/BaseInfoFormPcakge"; | |||||
| 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 { getLatestSn } from '@/api/template'; | |||||
| import {getSWYPFXFFXYPZBBTableConfig} from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js"; | |||||
| import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" | |||||
| import SelectReagentDialog from '../../../dialog/SelectReagentDialog.vue'; | |||||
| export default { | |||||
| name: "CBYDB", | |||||
| components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable,TableOpertaion,SelectReagentDialog }, | |||||
| 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: "input", | |||||
| fillType: "actFill", | |||||
| 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", | |||||
| 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: "clickable", | |||||
| subKey: "subJz", | |||||
| subFillType: "actFill", | |||||
| maxlength: 20, | |||||
| labelWidth: 80, | |||||
| }, | |||||
| } | |||||
| } | |||||
| ] | |||||
| }, | |||||
| tableStepColumns() { | |||||
| return getSWYPFXFFXYPZBBTableConfig(this,'business_sp_cbydb'); | |||||
| }, | |||||
| }, | |||||
| data() { | |||||
| return { | |||||
| reagentType: "",//本表单特殊字段:选择试剂的类型1选择基质,2表格里面选择试剂 | |||||
| currentSubKey: "",//当前点击的子项key | |||||
| rowIndex:0,//当前表格点击的行数 | |||||
| resource: [], | |||||
| sysjColumns: [ | |||||
| { label: 'template.common.reagentName', prop: "mc" },//名称 | |||||
| { label: 'template.common.reagentCode', prop: "bh" },//编号 | |||||
| { label: 'template.common.reagentNo', prop: "ph" },//批号 试剂,供试品才有 | |||||
| { label: 'template.common.concentration', prop: "nd" },//浓度 | |||||
| { label: 'template.common.source', prop: "source" },//来源 | |||||
| { label: 'template.common.reagentExpireDate', prop: "sxrq" },//失效日期 | |||||
| ], | |||||
| yqsColumns: [ | |||||
| { label: 'template.common.instrumentName', prop: "instrumentName" }, | |||||
| { label: 'template.common.instrumentModel', prop: "instrumentModel" }, | |||||
| { label: 'template.common.instrumentCode', prop: "instrumentCode" }, | |||||
| { label: 'template.common.nextTestDate', prop: "nextTestDate" }, | |||||
| ], | |||||
| formData: {} | |||||
| }; | |||||
| }, | |||||
| mounted() { | |||||
| }, | |||||
| watch: { | |||||
| formData: { | |||||
| immediate: true, | |||||
| handler(v) { | |||||
| if(this.fillType === "actFill"){ | |||||
| this.getCode(v); | |||||
| } | |||||
| } | |||||
| } | |||||
| }, | |||||
| methods: { | |||||
| //点击基质选择 | |||||
| handleJzClickable(obj){ | |||||
| this.reagentType = 1//本表单特殊字段 | |||||
| this.currentSubKey = obj.subKey; | |||||
| this.$refs.selectReagentDialogRef.show() | |||||
| }, | |||||
| //选择试剂提交事件 | |||||
| onSelectReagentSubmit(code,row){ | |||||
| if(this.reagentType===1){ | |||||
| this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code); | |||||
| }else{ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(this.rowIndex,{ | |||||
| [this.currentSubKey]: code, | |||||
| }) | |||||
| } | |||||
| this.$refs.selectReagentDialogRef.onCancel() | |||||
| }, | |||||
| //点击表格单元格 | |||||
| handleClickable(col, rowIndex) { | |||||
| //本表单特殊字段 | |||||
| this.reagentType = 2 | |||||
| this.rowIndex = rowIndex | |||||
| this.currentSubKey = col.prop; | |||||
| console.log("clickable",rowIndex, col) | |||||
| if(col.prop === "sjry"){ | |||||
| //调用对应弹窗的方法-多个点击的需要判断是哪个字段点击 | |||||
| this.$refs.selectReagentDialogRef.show() | |||||
| } | |||||
| }, | |||||
| //获取目标溶液编号 | |||||
| async getCode(v){ | |||||
| const {stepTableFormData = []} = v; | |||||
| if(stepTableFormData && stepTableFormData.length>0 && !stepTableFormData[0].bhCode){ | |||||
| const result = await getLatestSn({ | |||||
| count: stepTableFormData.length, | |||||
| }) | |||||
| if(result.code == 200){ | |||||
| if(stepTableFormData.length===1){ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(0,{ | |||||
| bhCode: result.data, | |||||
| }) | |||||
| }else{ | |||||
| for(let i=0;i<stepTableFormData.length;i++){ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(i,{ | |||||
| bhCode: result.data[i], | |||||
| }) | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| }, | |||||
| //获取已填写的表单数据 | |||||
| getFilledFormData(){ | |||||
| return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef","stepRef", "remarkRef"]) | |||||
| }, | |||||
| async getFormData() { | |||||
| let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"]); | |||||
| //生成resource | |||||
| let tmpResource = [] | |||||
| let tableList = content.stepTableFormData | |||||
| for(let i=0;i<tableList.length;i++){ | |||||
| //配置的试剂 | |||||
| let item = tableList[i] | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: item.bh+item.bhCode, | |||||
| ph: null, | |||||
| nd: item.hhwznd + content.headerSelectFields.hhwzndUnit, | |||||
| source: 'ELN配制', | |||||
| sxrq: null, | |||||
| ndz: item.hhwznd, | |||||
| nddw: content.headerSelectFields.hhwzndUnit, | |||||
| kc: item.sjjzxql+item.sjryxql,//todo 单位不一致-计算 | |||||
| kcdw: content.headerSelectFields.sjryxqlUnit || content.headerSelectFields.sjjzxqlUnit,//todo 单位不一致-计算-按最小算 | |||||
| syl: null, | |||||
| syldw:content.headerSelectFields.sjryxqlUnit || content.headerSelectFields.sjjzxqlUnit,//todo 单位不一致-计算-按最小算, | |||||
| yxzq:null, | |||||
| yxzqdw:null, | |||||
| }) | |||||
| } | |||||
| //使用的试剂 | |||||
| this.resource=tmpResource | |||||
| return content; | |||||
| }, | |||||
| async onSave() { | |||||
| const formData = await this.getFilledFormData(); | |||||
| console.log(formData, "formData") | |||||
| }, | |||||
| // 删除表格行 | |||||
| deleteRow(rowIndex) { | |||||
| const tableRef = this.$refs['tableRef']; | |||||
| if (tableRef) { | |||||
| tableRef.deleteRow(rowIndex); | |||||
| } | |||||
| }, | |||||
| } | |||||
| }; | |||||
| </script> | |||||
| <style rel="stylesheet/scss" lang="scss"> | |||||
| .mt-20 { | |||||
| margin-top: 20px; | |||||
| } | |||||
| </style> | |||||
| @ -0,0 +1,374 @@ | |||||
| <!-- 生物样品分析方法学样品制备表-储备液和工作液稳定性 Solution Stability --> | |||||
| <template> | |||||
| <div> | |||||
| <div class="detail-container"> | |||||
| <div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc || | |||||
| $t('template.sp.sp011.title') }}<img src="@/assets/images/detail-title.png" /></div> | |||||
| <div class="detail-content"> | |||||
| <div class="content"> | |||||
| <BaseInfoFormPcakge 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="yqsColumns" | |||||
| :dataSource="resource" /> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.storageCondition" label="template.common.storageCondition" ref="storageConditionRef" | |||||
| :formConfig="storageFormConfig" :formData="formData" /> | |||||
| <LineLabel label="template.common.operationSteps" /> | |||||
| <div class="template-form-item"> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig" | |||||
| :formData="formData" @clickable="handleJzClickable" /> | |||||
| <CustomTable | |||||
| @blur="onHandleTableBlur" | |||||
| :ref="`tableRef`" | |||||
| :columns="tableStepColumns" | |||||
| :formData="formData" | |||||
| :prefixKey = "`table`" | |||||
| @clickable="handleClickable" | |||||
| fieldItemLabel = "template.common.operationSteps" | |||||
| > | |||||
| <template slot="operation" slot-scope="{ row, rowIndex}"> | |||||
| <TableOpertaion | |||||
| :fillType="fillType" | |||||
| :row="row" | |||||
| :rowIndex="rowIndex" | |||||
| @deleteRow="(rowIndex) => deleteRow(rowIndex)" | |||||
| ></TableOpertaion> | |||||
| </template> | |||||
| </CustomTable> | |||||
| </div> | |||||
| <Step ref="stepRef" :formData="formData.stepData"></Step> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.remark" label="template.common.remark" ref="remarkRef" :formConfig="remarkConig" | |||||
| :formData="formData" /> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| <!-- <button @click = "onSave">保存</button> --> | |||||
| <SelectReagentDialog | |||||
| @submit="onSelectReagentSubmit" | |||||
| ref="selectReagentDialogRef" > | |||||
| </SelectReagentDialog> | |||||
| </div> | |||||
| </template> | |||||
| <script> | |||||
| import BaseInfoFormPcakge from "@/components/Template/BaseInfoFormPcakge"; | |||||
| 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 { getLatestSn } from '@/api/template'; | |||||
| import {getSWYPFXFFXYPZBBTableConfig} from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js"; | |||||
| import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" | |||||
| import SelectReagentDialog from '../../../dialog/SelectReagentDialog.vue'; | |||||
| export default { | |||||
| name: "CBYHGZYWDX", | |||||
| components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable,TableOpertaion,SelectReagentDialog }, | |||||
| 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: "input", | |||||
| fillType: "actFill", | |||||
| 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", | |||||
| 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: "clickable", | |||||
| subKey: "subJz", | |||||
| subFillType: "actFill", | |||||
| maxlength: 20, | |||||
| labelWidth: 80, | |||||
| }, | |||||
| } | |||||
| } | |||||
| ] | |||||
| }, | |||||
| tableStepColumns() { | |||||
| return getSWYPFXFFXYPZBBTableConfig(this,'business_sp_cbyhgzywdx',true); | |||||
| }, | |||||
| }, | |||||
| data() { | |||||
| return { | |||||
| reagentType: "",//本表单特殊字段:选择试剂的类型1选择基质,2表格里面选择试剂 | |||||
| currentSubKey: "",//当前点击的子项key | |||||
| rowIndex:0,//当前表格点击的行数 | |||||
| resource: [], | |||||
| sysjColumns: [ | |||||
| { label: 'template.common.reagentName', prop: "mc" },//名称 | |||||
| { label: 'template.common.reagentCode', prop: "bh" },//编号 | |||||
| { label: 'template.common.reagentNo', prop: "ph" },//批号 试剂,供试品才有 | |||||
| { label: 'template.common.concentration', prop: "nd" },//浓度 | |||||
| { label: 'template.common.source', prop: "source" },//来源 | |||||
| { label: 'template.common.reagentExpireDate', prop: "sxrq" },//失效日期 | |||||
| ], | |||||
| yqsColumns: [ | |||||
| { label: 'template.common.instrumentName', prop: "instrumentName" }, | |||||
| { label: 'template.common.instrumentModel', prop: "instrumentModel" }, | |||||
| { label: 'template.common.instrumentCode', prop: "instrumentCode" }, | |||||
| { label: 'template.common.nextTestDate', prop: "nextTestDate" }, | |||||
| ], | |||||
| formData: {} | |||||
| }; | |||||
| }, | |||||
| mounted() { | |||||
| }, | |||||
| watch: { | |||||
| formData: { | |||||
| immediate: true, | |||||
| handler(v) { | |||||
| if(this.fillType === "actFill"){ | |||||
| this.getCode(v); | |||||
| } | |||||
| } | |||||
| } | |||||
| }, | |||||
| methods: { | |||||
| //点击基质选择 | |||||
| handleJzClickable(obj){ | |||||
| this.reagentType = 1//本表单特殊字段 | |||||
| this.currentSubKey = obj.subKey; | |||||
| this.$refs.selectReagentDialogRef.show() | |||||
| }, | |||||
| //选择试剂提交事件 | |||||
| onSelectReagentSubmit(code,row){ | |||||
| if(this.reagentType===1){ | |||||
| this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code); | |||||
| }else{ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(this.rowIndex,{ | |||||
| [this.currentSubKey]: code, | |||||
| }) | |||||
| } | |||||
| this.$refs.selectReagentDialogRef.onCancel() | |||||
| }, | |||||
| //点击表格单元格 | |||||
| handleClickable(col, rowIndex) { | |||||
| //本表单特殊字段 | |||||
| this.reagentType = 2 | |||||
| this.rowIndex = rowIndex | |||||
| this.currentSubKey = col.prop; | |||||
| console.log("clickable",rowIndex, col) | |||||
| if(col.prop === "sjry"){ | |||||
| //调用对应弹窗的方法-多个点击的需要判断是哪个字段点击 | |||||
| this.$refs.selectReagentDialogRef.show() | |||||
| } | |||||
| }, | |||||
| //获取目标溶液编号 | |||||
| async getCode(v){ | |||||
| const {stepTableFormData = []} = v; | |||||
| if(stepTableFormData && stepTableFormData.length>0 && !stepTableFormData[0].bhCode){ | |||||
| const result = await getLatestSn({ | |||||
| count: stepTableFormData.length, | |||||
| }) | |||||
| if(result.code == 200){ | |||||
| if(stepTableFormData.length===1){ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(0,{ | |||||
| bhCode: result.data, | |||||
| }) | |||||
| }else{ | |||||
| for(let i=0;i<stepTableFormData.length;i++){ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(i,{ | |||||
| bhCode: result.data[i], | |||||
| }) | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| }, | |||||
| //获取已填写的表单数据 | |||||
| getFilledFormData(){ | |||||
| return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef","stepRef", "remarkRef"]) | |||||
| }, | |||||
| async getFormData() { | |||||
| let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"]); | |||||
| //生成resource | |||||
| let tmpResource = [] | |||||
| let tableList = content.stepTableFormData | |||||
| for(let i=0;i<tableList.length;i++){ | |||||
| //配置的试剂 | |||||
| let item = tableList[i] | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: item.bh+item.bhCode, | |||||
| ph: null, | |||||
| nd: item.hhwznd + content.headerSelectFields.hhwzndUnit, | |||||
| source: 'ELN配制', | |||||
| sxrq: null, | |||||
| ndz: item.hhwznd, | |||||
| nddw: content.headerSelectFields.hhwzndUnit, | |||||
| kc: item.sjjzxql+item.sjryxql,//todo 单位不一致-计算 | |||||
| kcdw: content.headerSelectFields.sjryxqlUnit || content.headerSelectFields.sjjzxqlUnit,//todo 单位不一致-计算-按最小算 | |||||
| syl: null, | |||||
| syldw:content.headerSelectFields.sjryxqlUnit || content.headerSelectFields.sjjzxqlUnit,//todo 单位不一致-计算-按最小算, | |||||
| yxzq:null, | |||||
| yxzqdw:null, | |||||
| }) | |||||
| } | |||||
| //使用的试剂 | |||||
| this.resource=tmpResource | |||||
| return content; | |||||
| }, | |||||
| async onSave() { | |||||
| const formData = await this.getFilledFormData(); | |||||
| console.log(formData, "formData") | |||||
| }, | |||||
| // 删除表格行 | |||||
| deleteRow(rowIndex) { | |||||
| const tableRef = this.$refs['tableRef']; | |||||
| if (tableRef) { | |||||
| tableRef.deleteRow(rowIndex); | |||||
| } | |||||
| }, | |||||
| } | |||||
| }; | |||||
| </script> | |||||
| <style rel="stylesheet/scss" lang="scss"> | |||||
| .mt-20 { | |||||
| margin-top: 20px; | |||||
| } | |||||
| </style> | |||||
| @ -0,0 +1,362 @@ | |||||
| <!-- 生物样品分析方法学样品制备表(Matrix effect)-生物样品分析方法学样品制备表(基质效应) --> | |||||
| <template> | |||||
| <div> | |||||
| <div class="detail-container"> | |||||
| <div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc || | |||||
| $t('template.sp.sp013.title') }}<img src="@/assets/images/detail-title.png" /></div> | |||||
| <div class="detail-content"> | |||||
| <div class="content"> | |||||
| <BaseInfoFormPcakge 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="yqsColumns" | |||||
| :dataSource="resource" /> | |||||
| <BaseInfoFormPcakge 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`" | |||||
| @clickable="handleClickable" | |||||
| fieldItemLabel = "template.common.operationSteps" | |||||
| > | |||||
| <template slot="operation" slot-scope="{ row, rowIndex}"> | |||||
| <TableOpertaion | |||||
| :fillType="fillType" | |||||
| :row="row" | |||||
| :rowIndex="rowIndex" | |||||
| @deleteRow="(rowIndex) => deleteRow(rowIndex)" | |||||
| ></TableOpertaion> | |||||
| </template> | |||||
| </CustomTable> | |||||
| </div> | |||||
| <Step ref="stepRef" :formData="formData.stepData"></Step> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.remark" label="template.common.remark" ref="remarkRef" :formConfig="remarkConig" | |||||
| :formData="formData" /> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| <!-- <button @click = "onSave">保存</button> --> | |||||
| <SelectReagentDialog | |||||
| @submit="onSelectReagentSubmit" | |||||
| ref="selectReagentDialogRef" > | |||||
| </SelectReagentDialog> | |||||
| </div> | |||||
| </template> | |||||
| <script> | |||||
| import BaseInfoFormPcakge from "@/components/Template/BaseInfoFormPcakge"; | |||||
| 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 { getLatestSn } from '@/api/template'; | |||||
| import {getSWYPFXFFXYPZBBTableConfig} from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js"; | |||||
| import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" | |||||
| import SelectReagentDialog from '../../../dialog/SelectReagentDialog.vue'; | |||||
| export default { | |||||
| name: "JZXY", | |||||
| components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable,TableOpertaion,SelectReagentDialog }, | |||||
| 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: "input", | |||||
| fillType: "actFill", | |||||
| 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", | |||||
| 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: "clickable", | |||||
| subKey: "subJz", | |||||
| subFillType: "actFill", | |||||
| maxlength: 20, | |||||
| labelWidth: 80, | |||||
| }, | |||||
| } | |||||
| } | |||||
| ] | |||||
| }, | |||||
| tableStepColumns() { | |||||
| return getSWYPFXFFXYPZBBTableConfig(this,'business_sp_jzxy',false,true); | |||||
| }, | |||||
| }, | |||||
| data() { | |||||
| return { | |||||
| reagentType: "",//本表单特殊字段:选择试剂的类型1选择基质,2表格里面选择试剂 | |||||
| currentSubKey: "",//当前点击的子项key | |||||
| rowIndex:0,//当前表格点击的行数 | |||||
| resource: [], | |||||
| sysjColumns: [ | |||||
| { label: 'template.common.reagentName', prop: "mc" },//名称 | |||||
| { label: 'template.common.reagentCode', prop: "bh" },//编号 | |||||
| { label: 'template.common.reagentNo', prop: "ph" },//批号 试剂,供试品才有 | |||||
| { label: 'template.common.concentration', prop: "nd" },//浓度 | |||||
| { label: 'template.common.source', prop: "source" },//来源 | |||||
| { label: 'template.common.reagentExpireDate', prop: "sxrq" },//失效日期 | |||||
| ], | |||||
| yqsColumns: [ | |||||
| { label: 'template.common.instrumentName', prop: "instrumentName" }, | |||||
| { label: 'template.common.instrumentModel', prop: "instrumentModel" }, | |||||
| { label: 'template.common.instrumentCode', prop: "instrumentCode" }, | |||||
| { label: 'template.common.nextTestDate', prop: "nextTestDate" }, | |||||
| ], | |||||
| formData: {} | |||||
| }; | |||||
| }, | |||||
| mounted() { | |||||
| }, | |||||
| watch: { | |||||
| formData: { | |||||
| immediate: true, | |||||
| handler(v) { | |||||
| if(this.fillType === "actFill"){ | |||||
| this.getCode(v); | |||||
| } | |||||
| } | |||||
| } | |||||
| }, | |||||
| methods: { | |||||
| //选择试剂提交事件 | |||||
| onSelectReagentSubmit(code,row){ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(this.rowIndex,{ | |||||
| [this.currentSubKey]: code, | |||||
| }) | |||||
| this.$refs.selectReagentDialogRef.onCancel() | |||||
| }, | |||||
| //点击表格单元格 | |||||
| handleClickable(col, rowIndex) { | |||||
| //本表单特殊字段 | |||||
| this.reagentType = 2 | |||||
| this.rowIndex = rowIndex | |||||
| this.currentSubKey = col.prop; | |||||
| console.log("clickable",rowIndex, col) | |||||
| if(col.prop === "sjry" || col.prop === "kbjzbh"){ | |||||
| //调用对应弹窗的方法-多个点击的需要判断是哪个字段点击 | |||||
| this.$refs.selectReagentDialogRef.show() | |||||
| } | |||||
| }, | |||||
| //获取目标溶液编号 | |||||
| async getCode(v){ | |||||
| const {stepTableFormData = []} = v; | |||||
| if(stepTableFormData && stepTableFormData.length>0 && !stepTableFormData[0].bhCode){ | |||||
| const result = await getLatestSn({ | |||||
| count: stepTableFormData.length, | |||||
| }) | |||||
| if(result.code == 200){ | |||||
| if(stepTableFormData.length===1){ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(0,{ | |||||
| bhCode: result.data, | |||||
| }) | |||||
| }else{ | |||||
| for(let i=0;i<stepTableFormData.length;i++){ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(i,{ | |||||
| bhCode: result.data[i], | |||||
| }) | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| }, | |||||
| //获取已填写的表单数据 | |||||
| getFilledFormData(){ | |||||
| return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "tableRef","stepRef", "remarkRef"]) | |||||
| }, | |||||
| async getFormData() { | |||||
| let content = await this.validFormFields(["baseInfoRef", "storageConditionRef","tableRef" ,"stepRef", "remarkRef"]); | |||||
| //生成resource | |||||
| let tmpResource = [] | |||||
| let tableList = content.stepTableFormData | |||||
| for(let i=0;i<tableList.length;i++){ | |||||
| //配置的试剂 | |||||
| let item = tableList[i] | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: item.bh+item.bhCode, | |||||
| ph: null, | |||||
| nd: item.hhwznd + content.headerSelectFields.hhwzndUnit, | |||||
| source: 'ELN配制', | |||||
| sxrq: null, | |||||
| ndz: item.hhwznd, | |||||
| nddw: content.headerSelectFields.hhwzndUnit, | |||||
| kc: item.sjjzxql+item.sjryxql,//todo 单位不一致-计算 | |||||
| kcdw: content.headerSelectFields.sjryxqlUnit || content.headerSelectFields.sjjzxqlUnit,//todo 单位不一致-计算-按最小算 | |||||
| syl: null, | |||||
| syldw:content.headerSelectFields.sjryxqlUnit || content.headerSelectFields.sjjzxqlUnit,//todo 单位不一致-计算-按最小算, | |||||
| yxzq:null, | |||||
| yxzqdw:null, | |||||
| }) | |||||
| } | |||||
| //使用的试剂 | |||||
| this.resource=tmpResource | |||||
| return content; | |||||
| }, | |||||
| async onSave() { | |||||
| const formData = await this.getFilledFormData(); | |||||
| console.log(formData, "formData") | |||||
| }, | |||||
| // 删除表格行 | |||||
| deleteRow(rowIndex) { | |||||
| const tableRef = this.$refs['tableRef']; | |||||
| if (tableRef) { | |||||
| tableRef.deleteRow(rowIndex); | |||||
| } | |||||
| }, | |||||
| } | |||||
| }; | |||||
| </script> | |||||
| <style rel="stylesheet/scss" lang="scss"> | |||||
| .mt-20 { | |||||
| margin-top: 20px; | |||||
| } | |||||
| </style> | |||||
| @ -0,0 +1,374 @@ | |||||
| <!-- 生物样品分析方法学样品制备表(Haemolysed matrix effect)-生物样品分析方法学样品制备表(溶血基质效应) --> | |||||
| <template> | |||||
| <div> | |||||
| <div class="detail-container"> | |||||
| <div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc || | |||||
| $t('template.sp.sp012.title') }}<img src="@/assets/images/detail-title.png" /></div> | |||||
| <div class="detail-content"> | |||||
| <div class="content"> | |||||
| <BaseInfoFormPcakge 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="yqsColumns" | |||||
| :dataSource="resource" /> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.storageCondition" label="template.common.storageCondition" ref="storageConditionRef" | |||||
| :formConfig="storageFormConfig" :formData="formData" /> | |||||
| <LineLabel label="template.common.operationSteps" /> | |||||
| <div class="template-form-item"> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig" | |||||
| :formData="formData" @clickable="handleJzClickable" /> | |||||
| <CustomTable | |||||
| @blur="onHandleTableBlur" | |||||
| :ref="`tableRef`" | |||||
| :columns="tableStepColumns" | |||||
| :formData="formData" | |||||
| :prefixKey = "`table`" | |||||
| @clickable="handleClickable" | |||||
| fieldItemLabel = "template.common.operationSteps" | |||||
| > | |||||
| <template slot="operation" slot-scope="{ row, rowIndex}"> | |||||
| <TableOpertaion | |||||
| :fillType="fillType" | |||||
| :row="row" | |||||
| :rowIndex="rowIndex" | |||||
| @deleteRow="(rowIndex) => deleteRow(rowIndex)" | |||||
| ></TableOpertaion> | |||||
| </template> | |||||
| </CustomTable> | |||||
| </div> | |||||
| <Step ref="stepRef" :formData="formData.stepData"></Step> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.remark" label="template.common.remark" ref="remarkRef" :formConfig="remarkConig" | |||||
| :formData="formData" /> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| <!-- <button @click = "onSave">保存</button> --> | |||||
| <SelectReagentDialog | |||||
| @submit="onSelectReagentSubmit" | |||||
| ref="selectReagentDialogRef" > | |||||
| </SelectReagentDialog> | |||||
| </div> | |||||
| </template> | |||||
| <script> | |||||
| import BaseInfoFormPcakge from "@/components/Template/BaseInfoFormPcakge"; | |||||
| 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 { getLatestSn } from '@/api/template'; | |||||
| import {getSWYPFXFFXYPZBBTableConfig} from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js"; | |||||
| import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" | |||||
| import SelectReagentDialog from '../../../dialog/SelectReagentDialog.vue'; | |||||
| export default { | |||||
| name: "RXJZXY", | |||||
| components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable,TableOpertaion,SelectReagentDialog }, | |||||
| 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: "input", | |||||
| fillType: "actFill", | |||||
| 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", | |||||
| 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: "clickable", | |||||
| subKey: "subJz", | |||||
| subFillType: "actFill", | |||||
| maxlength: 20, | |||||
| labelWidth: 80, | |||||
| }, | |||||
| } | |||||
| } | |||||
| ] | |||||
| }, | |||||
| tableStepColumns() { | |||||
| return getSWYPFXFFXYPZBBTableConfig(this,'business_sp_rxjzxy',true); | |||||
| }, | |||||
| }, | |||||
| data() { | |||||
| return { | |||||
| reagentType: "",//本表单特殊字段:选择试剂的类型1选择基质,2表格里面选择试剂 | |||||
| currentSubKey: "",//当前点击的子项key | |||||
| rowIndex:0,//当前表格点击的行数 | |||||
| resource: [], | |||||
| sysjColumns: [ | |||||
| { label: 'template.common.reagentName', prop: "mc" },//名称 | |||||
| { label: 'template.common.reagentCode', prop: "bh" },//编号 | |||||
| { label: 'template.common.reagentNo', prop: "ph" },//批号 试剂,供试品才有 | |||||
| { label: 'template.common.concentration', prop: "nd" },//浓度 | |||||
| { label: 'template.common.source', prop: "source" },//来源 | |||||
| { label: 'template.common.reagentExpireDate', prop: "sxrq" },//失效日期 | |||||
| ], | |||||
| yqsColumns: [ | |||||
| { label: 'template.common.instrumentName', prop: "instrumentName" }, | |||||
| { label: 'template.common.instrumentModel', prop: "instrumentModel" }, | |||||
| { label: 'template.common.instrumentCode', prop: "instrumentCode" }, | |||||
| { label: 'template.common.nextTestDate', prop: "nextTestDate" }, | |||||
| ], | |||||
| formData: {} | |||||
| }; | |||||
| }, | |||||
| mounted() { | |||||
| }, | |||||
| watch: { | |||||
| formData: { | |||||
| immediate: true, | |||||
| handler(v) { | |||||
| if(this.fillType === "actFill"){ | |||||
| this.getCode(v); | |||||
| } | |||||
| } | |||||
| } | |||||
| }, | |||||
| methods: { | |||||
| //点击基质选择 | |||||
| handleJzClickable(obj){ | |||||
| this.reagentType = 1//本表单特殊字段 | |||||
| this.currentSubKey = obj.subKey; | |||||
| this.$refs.selectReagentDialogRef.show() | |||||
| }, | |||||
| //选择试剂提交事件 | |||||
| onSelectReagentSubmit(code,row){ | |||||
| if(this.reagentType===1){ | |||||
| this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code); | |||||
| }else{ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(this.rowIndex,{ | |||||
| [this.currentSubKey]: code, | |||||
| }) | |||||
| } | |||||
| this.$refs.selectReagentDialogRef.onCancel() | |||||
| }, | |||||
| //点击表格单元格 | |||||
| handleClickable(col, rowIndex) { | |||||
| //本表单特殊字段 | |||||
| this.reagentType = 2 | |||||
| this.rowIndex = rowIndex | |||||
| this.currentSubKey = col.prop; | |||||
| console.log("clickable",rowIndex, col) | |||||
| if(col.prop === "sjry"){ | |||||
| //调用对应弹窗的方法-多个点击的需要判断是哪个字段点击 | |||||
| this.$refs.selectReagentDialogRef.show() | |||||
| } | |||||
| }, | |||||
| //获取目标溶液编号 | |||||
| async getCode(v){ | |||||
| const {stepTableFormData = []} = v; | |||||
| if(stepTableFormData && stepTableFormData.length>0 && !stepTableFormData[0].bhCode){ | |||||
| const result = await getLatestSn({ | |||||
| count: stepTableFormData.length, | |||||
| }) | |||||
| if(result.code == 200){ | |||||
| if(stepTableFormData.length===1){ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(0,{ | |||||
| bhCode: result.data, | |||||
| }) | |||||
| }else{ | |||||
| for(let i=0;i<stepTableFormData.length;i++){ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(i,{ | |||||
| bhCode: result.data[i], | |||||
| }) | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| }, | |||||
| //获取已填写的表单数据 | |||||
| getFilledFormData(){ | |||||
| return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef","stepRef", "remarkRef"]) | |||||
| }, | |||||
| async getFormData() { | |||||
| let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"]); | |||||
| //生成resource | |||||
| let tmpResource = [] | |||||
| let tableList = content.stepTableFormData | |||||
| for(let i=0;i<tableList.length;i++){ | |||||
| //配置的试剂 | |||||
| let item = tableList[i] | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: item.bh+item.bhCode, | |||||
| ph: null, | |||||
| nd: item.hhwznd + content.headerSelectFields.hhwzndUnit, | |||||
| source: 'ELN配制', | |||||
| sxrq: null, | |||||
| ndz: item.hhwznd, | |||||
| nddw: content.headerSelectFields.hhwzndUnit, | |||||
| kc: item.sjjzxql+item.sjryxql,//todo 单位不一致-计算 | |||||
| kcdw: content.headerSelectFields.sjryxqlUnit || content.headerSelectFields.sjjzxqlUnit,//todo 单位不一致-计算-按最小算 | |||||
| syl: null, | |||||
| syldw:content.headerSelectFields.sjryxqlUnit || content.headerSelectFields.sjjzxqlUnit,//todo 单位不一致-计算-按最小算, | |||||
| yxzq:null, | |||||
| yxzqdw:null, | |||||
| }) | |||||
| } | |||||
| //使用的试剂 | |||||
| this.resource=tmpResource | |||||
| return content; | |||||
| }, | |||||
| async onSave() { | |||||
| const formData = await this.getFilledFormData(); | |||||
| console.log(formData, "formData") | |||||
| }, | |||||
| // 删除表格行 | |||||
| deleteRow(rowIndex) { | |||||
| const tableRef = this.$refs['tableRef']; | |||||
| if (tableRef) { | |||||
| tableRef.deleteRow(rowIndex); | |||||
| } | |||||
| }, | |||||
| } | |||||
| }; | |||||
| </script> | |||||
| <style rel="stylesheet/scss" lang="scss"> | |||||
| .mt-20 { | |||||
| margin-top: 20px; | |||||
| } | |||||
| </style> | |||||
| @ -0,0 +1,425 @@ | |||||
| <!-- 生物样品分析方法学样品制备表-Recovery --> | |||||
| <template> | |||||
| <div> | |||||
| <div class="detail-container"> | |||||
| <div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.templateMc || | |||||
| $t('template.sp.sp009.title') }}<img src="@/assets/images/detail-title.png" /></div> | |||||
| <div class="detail-content"> | |||||
| <div class="content"> | |||||
| <BaseInfoFormPcakge 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="yqsColumns" :dataSource="resource" /> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.storageCondition" | |||||
| label="template.common.storageCondition" ref="storageConditionRef" | |||||
| :formConfig="storageFormConfig" :formData="formData" /> | |||||
| <LineLabel label="template.common.operationSteps" /> | |||||
| <div class="template-form-item"> | |||||
| <span>基质</span> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" | |||||
| :formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" | |||||
| @clickable="handleJzClickable" /> | |||||
| <CustomTable @blur="onHandleTableBlur" :ref="`tableRef`" :columns="tableStepColumns" | |||||
| :formData="formData" :prefixKey="`table`" @clickable="handleClickable" | |||||
| fieldItemLabel="template.common.operationSteps"> | |||||
| <template slot="operation" slot-scope="{ row, rowIndex}"> | |||||
| <TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" | |||||
| @deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion> | |||||
| </template> | |||||
| </CustomTable> | |||||
| </div> | |||||
| <div class="template-form-item"> | |||||
| <span>溶液</span> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.operationSteps" | |||||
| ref="rongyeStepFormPackageRef" :formConfig="rongyeStepFormConfig" @blur="onHandleBlur" | |||||
| :formData="formData" @clickable="handleRongyeClickable" /> | |||||
| <CustomTable @blur="onHandleTableBlur" :ref="`rongyeTableRef`" :columns="rongyeTableStepColumns" | |||||
| :formData="formData" :prefixKey="`rongyeTable`" @clickable="handleRongyeTableClickable" | |||||
| fieldItemLabel="template.common.operationSteps"> | |||||
| <template slot="operation" slot-scope="{ row, rowIndex}"> | |||||
| <TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" | |||||
| @deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion> | |||||
| </template> | |||||
| </CustomTable> | |||||
| </div> | |||||
| <Step ref="stepRef" :formData="formData.stepData"></Step> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.remark" label="template.common.remark" | |||||
| ref="remarkRef" :formConfig="remarkConig" :formData="formData" /> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| <!-- <button @click = "onSave">保存</button> --> | |||||
| <SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef"> | |||||
| </SelectReagentDialog> | |||||
| </div> | |||||
| </template> | |||||
| <script> | |||||
| import BaseInfoFormPcakge from "@/components/Template/BaseInfoFormPcakge"; | |||||
| 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 { getLatestSn } from '@/api/template'; | |||||
| import { getSWYPFXFFXYPZBBTableConfig, getSWYPFXFFXYPZBBTQHSLTableConfig } from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js"; | |||||
| import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" | |||||
| import SelectReagentDialog from '../../../dialog/SelectReagentDialog.vue'; | |||||
| export default { | |||||
| name: "SWYPFXRYPZB", | |||||
| components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog }, | |||||
| 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: "input", | |||||
| fillType: "actFill", | |||||
| maxlength: 50 | |||||
| }, | |||||
| //处理批编号 | |||||
| clpbg: { | |||||
| label: 'template.sp.sp009.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", | |||||
| multiple: true, | |||||
| options: this.getDictOptions('business_pztj') | |||||
| } | |||||
| } | |||||
| }, | |||||
| { | |||||
| type: "cellItem", | |||||
| label: 'template.sp.sp009.rqcz', | |||||
| config: { | |||||
| rqcz: { | |||||
| type: "select", | |||||
| multiple: true, | |||||
| fillType: "actFill", | |||||
| options: this.getDictOptions('business_rqcz'), | |||||
| otherCode: "rqczOther", | |||||
| }, | |||||
| } | |||||
| }, | |||||
| { | |||||
| type: "cellItem", | |||||
| label: 'template.sp.sp009.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: "clickable", | |||||
| subKey: "subJz", | |||||
| subFillType: "actFill", | |||||
| maxlength: 20, | |||||
| labelWidth: 80, | |||||
| }, | |||||
| } | |||||
| } | |||||
| ] | |||||
| }, | |||||
| rongyeStepFormConfig() { | |||||
| return [ | |||||
| { | |||||
| type: "step", | |||||
| config: { | |||||
| gzy: { | |||||
| label: 'template.sp.sp009.xzgzy', | |||||
| type: "input", | |||||
| fillType: "preFill", | |||||
| subType: "clickable", | |||||
| subKey: "subGzy", | |||||
| subFillType: "actFill", | |||||
| maxlength: 20, | |||||
| }, | |||||
| } | |||||
| }, | |||||
| { | |||||
| type: "step", | |||||
| config: { | |||||
| xsy: { | |||||
| label: 'template.sp.sp009.xzxsy', | |||||
| type: "input", | |||||
| fillType: "preFill", | |||||
| subType: "clickable", | |||||
| subKey: "subXsy", | |||||
| subFillType: "actFill", | |||||
| maxlength: 20, | |||||
| }, | |||||
| } | |||||
| }, | |||||
| ] | |||||
| }, | |||||
| tableStepColumns() { | |||||
| return getSWYPFXFFXYPZBBTableConfig(this, 'business_sp_tqhsl', false); | |||||
| }, | |||||
| rongyeTableStepColumns() { | |||||
| return getSWYPFXFFXYPZBBTQHSLTableConfig(this, 'business_sp_tqhsl'); | |||||
| }, | |||||
| }, | |||||
| data() { | |||||
| return { | |||||
| reagentType: '', | |||||
| resource: [], | |||||
| resourceData1: [], | |||||
| sysjColumns: [ | |||||
| { label: 'template.common.reagentName', prop: "mc" },//名称 | |||||
| { label: 'template.common.reagentCode', prop: "bh" },//编号 | |||||
| { label: 'template.common.reagentNo', prop: "ph" },//批号 试剂,供试品才有 | |||||
| { label: 'template.common.concentration', prop: "nd" },//浓度 | |||||
| { label: 'template.common.source', prop: "source" },//来源 | |||||
| { label: 'template.common.reagentExpireDate', prop: "sxrq" },//失效日期 | |||||
| ], | |||||
| yqsColumns: [ | |||||
| { label: 'template.common.instrumentName', prop: "instrumentName" }, | |||||
| { label: 'template.common.instrumentModel', prop: "instrumentModel" }, | |||||
| { label: 'template.common.instrumentCode', prop: "instrumentCode" }, | |||||
| { label: 'template.common.nextTestDate', prop: "nextTestDate" }, | |||||
| ], | |||||
| formData: {} | |||||
| }; | |||||
| }, | |||||
| mounted() { | |||||
| }, | |||||
| watch: { | |||||
| formData: { | |||||
| immediate: true, | |||||
| handler(v) { | |||||
| if (!v.targetCodeSn && this.fillType === "actFill") { | |||||
| this.getCode(); | |||||
| } | |||||
| } | |||||
| } | |||||
| }, | |||||
| methods: { | |||||
| //点击基质选择 | |||||
| handleJzClickable(obj) { | |||||
| this.reagentType = 1//本表单特殊字段 | |||||
| this.currentSubKey = obj.subKey; | |||||
| this.$refs.selectReagentDialogRef.show() | |||||
| }, | |||||
| handleRongyeClickable(obj) { | |||||
| this.reagentType = 2//本表单特殊字段 | |||||
| this.currentSubKey = obj.subKey; | |||||
| this.$refs.selectReagentDialogRef.show() | |||||
| }, | |||||
| //选择试剂提交事件 | |||||
| onSelectReagentSubmit(code, row) { | |||||
| if (this.reagentType == 1) { | |||||
| this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code); | |||||
| } else if(this.reagentType == 2){ | |||||
| this.$refs.rongyeStepFormPackageRef.updateFormData(this.currentSubKey, code); | |||||
| } else if(this.reagentType == 3) { | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(this.rowIndex,{ | |||||
| [this.currentSubKey]: code, | |||||
| }) | |||||
| } else if(this.reagentType == 4) { | |||||
| this.$refs.rongyeTableRef.updateDataSourceByRowIndex(this.rowIndex,{ | |||||
| [this.currentSubKey]: code, | |||||
| }) | |||||
| } | |||||
| this.$refs.selectReagentDialogRef.onCancel() | |||||
| }, | |||||
| //点击表格单元格 | |||||
| handleClickable(col, rowIndex) { | |||||
| this.reagentType = 3 | |||||
| this.rowIndex = rowIndex | |||||
| this.currentSubKey = col.prop; | |||||
| console.log("clickable",rowIndex, col) | |||||
| if(col.prop === "sjry"){ | |||||
| //调用对应弹窗的方法-多个点击的需要判断是哪个字段点击 | |||||
| this.$refs.selectReagentDialogRef.show() | |||||
| } | |||||
| }, | |||||
| handleRongyeTableClickable(col, rowIndex) { | |||||
| this.reagentType = 4 | |||||
| this.rowIndex = rowIndex | |||||
| this.currentSubKey = col.prop; | |||||
| console.log("clickable",rowIndex, col) | |||||
| if(col.prop === "sjry"){ | |||||
| //调用对应弹窗的方法-多个点击的需要判断是哪个字段点击 | |||||
| this.$refs.selectReagentDialogRef.show() | |||||
| } | |||||
| }, | |||||
| //获取目标溶液编号 | |||||
| async getCode() { | |||||
| const { stepTableFormData = [] } = v; | |||||
| if (stepTableFormData && stepTableFormData.length > 0 && !stepTableFormData[0].bhCode) { | |||||
| const result = await getLatestSn({ | |||||
| count: stepTableFormData.length, | |||||
| }) | |||||
| if (result.code == 200) { | |||||
| if (stepTableFormData.length === 0) { | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(0, { | |||||
| [bhCode]: result.data, | |||||
| }) | |||||
| } else { | |||||
| for (let i = 0; i < stepTableFormData.length; i++) { | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(i, { | |||||
| bhCode: result.data[i], | |||||
| }) | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| }, | |||||
| //获取已填写的表单数据 | |||||
| getFilledFormData() { | |||||
| return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef", "stepRef", "rongyeTableRef", "rongyeStepFormPackageRef", "remarkRef"]) | |||||
| }, | |||||
| async getFormData() { | |||||
| let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef", "stepRef", | |||||
| "rongyeTableRef", "rongyeStepFormPackageRef", "remarkRef"]); | |||||
| console.log(content) | |||||
| //生成resource | |||||
| let tmpResource = [] | |||||
| debugger | |||||
| //配置的试剂 | |||||
| tmpResource.push({ | |||||
| mc: content.targetName, | |||||
| bh: content.targetCode + content.targetCodeSn, | |||||
| ph: '', | |||||
| nd: content.targetActConcentration + content.targetActConcentrationUnit, | |||||
| source: 'ELN配制', | |||||
| sxrq: content.expireDate, | |||||
| ndz: content.targetActConcentration, | |||||
| nddw: content.targetActConcentrationUnit, | |||||
| kc: content.targetActVolume, | |||||
| kcdw: content.targetActVolumeUnit, | |||||
| syl: null, | |||||
| syldw: content.targetActVolumeUnit, | |||||
| yxzq: content.effectivePeriod, | |||||
| yxzqdw: content.effectivePeriodUnit, | |||||
| }) | |||||
| //使用的试剂 | |||||
| this.resource = tmpResource | |||||
| return content; | |||||
| }, | |||||
| async onSave() { | |||||
| const formData = await this.getFilledFormData(); | |||||
| console.log(formData, "formData") | |||||
| }, | |||||
| // 删除表格行 | |||||
| deleteRow(rowIndex) { | |||||
| const tableRef = this.$refs['tableRef']; | |||||
| if (tableRef) { | |||||
| tableRef.deleteRow(rowIndex); | |||||
| } | |||||
| }, | |||||
| } | |||||
| }; | |||||
| </script> | |||||
| <style rel="stylesheet/scss" lang="scss"> | |||||
| .mt-20 { | |||||
| margin-top: 20px; | |||||
| } | |||||
| </style> | |||||
| @ -0,0 +1,374 @@ | |||||
| <!-- 生物样品分析方法学样品制备表(Dilution Integrity)- 生物样品分析方法学样品制备表(稀释可靠性)--> | |||||
| <template> | |||||
| <div> | |||||
| <div class="detail-container"> | |||||
| <div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc || | |||||
| $t('template.sp.sp016.title') }}<img src="@/assets/images/detail-title.png" /></div> | |||||
| <div class="detail-content"> | |||||
| <div class="content"> | |||||
| <BaseInfoFormPcakge 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="yqsColumns" | |||||
| :dataSource="resource" /> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.storageCondition" label="template.common.storageCondition" ref="storageConditionRef" | |||||
| :formConfig="storageFormConfig" :formData="formData" /> | |||||
| <LineLabel label="template.common.operationSteps" /> | |||||
| <div class="template-form-item"> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig" | |||||
| :formData="formData" @clickable="handleJzClickable" /> | |||||
| <CustomTable | |||||
| @blur="onHandleTableBlur" | |||||
| :ref="`tableRef`" | |||||
| :columns="tableStepColumns" | |||||
| :formData="formData" | |||||
| :prefixKey = "`table`" | |||||
| @clickable="handleClickable" | |||||
| fieldItemLabel = "template.common.operationSteps" | |||||
| > | |||||
| <template slot="operation" slot-scope="{ row, rowIndex}"> | |||||
| <TableOpertaion | |||||
| :fillType="fillType" | |||||
| :row="row" | |||||
| :rowIndex="rowIndex" | |||||
| @deleteRow="(rowIndex) => deleteRow(rowIndex)" | |||||
| ></TableOpertaion> | |||||
| </template> | |||||
| </CustomTable> | |||||
| </div> | |||||
| <Step ref="stepRef" :formData="formData.stepData"></Step> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.remark" label="template.common.remark" ref="remarkRef" :formConfig="remarkConig" | |||||
| :formData="formData" /> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| <!-- <button @click = "onSave">保存</button> --> | |||||
| <SelectReagentDialog | |||||
| @submit="onSelectReagentSubmit" | |||||
| ref="selectReagentDialogRef" > | |||||
| </SelectReagentDialog> | |||||
| </div> | |||||
| </template> | |||||
| <script> | |||||
| import BaseInfoFormPcakge from "@/components/Template/BaseInfoFormPcakge"; | |||||
| 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 { getLatestSn } from '@/api/template'; | |||||
| import {getSWYPFXFFXYPZBBTableConfig} from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js"; | |||||
| import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" | |||||
| import SelectReagentDialog from '../../../dialog/SelectReagentDialog.vue'; | |||||
| export default { | |||||
| name: "XSKKX", | |||||
| components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable,TableOpertaion,SelectReagentDialog }, | |||||
| 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: "input", | |||||
| fillType: "actFill", | |||||
| 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", | |||||
| 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: "clickable", | |||||
| subKey: "subJz", | |||||
| subFillType: "actFill", | |||||
| maxlength: 20, | |||||
| labelWidth: 80, | |||||
| }, | |||||
| } | |||||
| } | |||||
| ] | |||||
| }, | |||||
| tableStepColumns() { | |||||
| return getSWYPFXFFXYPZBBTableConfig(this,'business_sp_xskkx'); | |||||
| }, | |||||
| }, | |||||
| data() { | |||||
| return { | |||||
| reagentType: "",//本表单特殊字段:选择试剂的类型1选择基质,2表格里面选择试剂 | |||||
| currentSubKey: "",//当前点击的子项key | |||||
| rowIndex:0,//当前表格点击的行数 | |||||
| resource: [], | |||||
| sysjColumns: [ | |||||
| { label: 'template.common.reagentName', prop: "mc" },//名称 | |||||
| { label: 'template.common.reagentCode', prop: "bh" },//编号 | |||||
| { label: 'template.common.reagentNo', prop: "ph" },//批号 试剂,供试品才有 | |||||
| { label: 'template.common.concentration', prop: "nd" },//浓度 | |||||
| { label: 'template.common.source', prop: "source" },//来源 | |||||
| { label: 'template.common.reagentExpireDate', prop: "sxrq" },//失效日期 | |||||
| ], | |||||
| yqsColumns: [ | |||||
| { label: 'template.common.instrumentName', prop: "instrumentName" }, | |||||
| { label: 'template.common.instrumentModel', prop: "instrumentModel" }, | |||||
| { label: 'template.common.instrumentCode', prop: "instrumentCode" }, | |||||
| { label: 'template.common.nextTestDate', prop: "nextTestDate" }, | |||||
| ], | |||||
| formData: {} | |||||
| }; | |||||
| }, | |||||
| mounted() { | |||||
| }, | |||||
| watch: { | |||||
| formData: { | |||||
| immediate: true, | |||||
| handler(v) { | |||||
| if(this.fillType === "actFill"){ | |||||
| this.getCode(v); | |||||
| } | |||||
| } | |||||
| } | |||||
| }, | |||||
| methods: { | |||||
| //点击基质选择 | |||||
| handleJzClickable(obj){ | |||||
| this.reagentType = 1//本表单特殊字段 | |||||
| this.currentSubKey = obj.subKey; | |||||
| this.$refs.selectReagentDialogRef.show() | |||||
| }, | |||||
| //选择试剂提交事件 | |||||
| onSelectReagentSubmit(code,row){ | |||||
| if(this.reagentType===1){ | |||||
| this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code); | |||||
| }else{ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(this.rowIndex,{ | |||||
| [this.currentSubKey]: code, | |||||
| }) | |||||
| } | |||||
| this.$refs.selectReagentDialogRef.onCancel() | |||||
| }, | |||||
| //点击表格单元格 | |||||
| handleClickable(col, rowIndex) { | |||||
| //本表单特殊字段 | |||||
| this.reagentType = 2 | |||||
| this.rowIndex = rowIndex | |||||
| this.currentSubKey = col.prop; | |||||
| console.log("clickable",rowIndex, col) | |||||
| if(col.prop === "sjry"){ | |||||
| //调用对应弹窗的方法-多个点击的需要判断是哪个字段点击 | |||||
| this.$refs.selectReagentDialogRef.show() | |||||
| } | |||||
| }, | |||||
| //获取目标溶液编号 | |||||
| async getCode(v){ | |||||
| const {stepTableFormData = []} = v; | |||||
| if(stepTableFormData && stepTableFormData.length>0 && !stepTableFormData[0].bhCode){ | |||||
| const result = await getLatestSn({ | |||||
| count: stepTableFormData.length, | |||||
| }) | |||||
| if(result.code == 200){ | |||||
| if(stepTableFormData.length===1){ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(0,{ | |||||
| bhCode: result.data, | |||||
| }) | |||||
| }else{ | |||||
| for(let i=0;i<stepTableFormData.length;i++){ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(i,{ | |||||
| bhCode: result.data[i], | |||||
| }) | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| }, | |||||
| //获取已填写的表单数据 | |||||
| getFilledFormData(){ | |||||
| return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef","stepRef", "remarkRef"]) | |||||
| }, | |||||
| async getFormData() { | |||||
| let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"]); | |||||
| //生成resource | |||||
| let tmpResource = [] | |||||
| let tableList = content.stepTableFormData | |||||
| for(let i=0;i<tableList.length;i++){ | |||||
| //配置的试剂 | |||||
| let item = tableList[i] | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: item.bh+item.bhCode, | |||||
| ph: null, | |||||
| nd: item.hhwznd + content.headerSelectFields.hhwzndUnit, | |||||
| source: 'ELN配制', | |||||
| sxrq: null, | |||||
| ndz: item.hhwznd, | |||||
| nddw: content.headerSelectFields.hhwzndUnit, | |||||
| kc: item.sjjzxql+item.sjryxql,//todo 单位不一致-计算 | |||||
| kcdw: content.headerSelectFields.sjryxqlUnit || content.headerSelectFields.sjjzxqlUnit,//todo 单位不一致-计算-按最小算 | |||||
| syl: null, | |||||
| syldw:content.headerSelectFields.sjryxqlUnit || content.headerSelectFields.sjjzxqlUnit,//todo 单位不一致-计算-按最小算, | |||||
| yxzq:null, | |||||
| yxzqdw:null, | |||||
| }) | |||||
| } | |||||
| //使用的试剂 | |||||
| this.resource=tmpResource | |||||
| return content; | |||||
| }, | |||||
| async onSave() { | |||||
| const formData = await this.getFilledFormData(); | |||||
| console.log(formData, "formData") | |||||
| }, | |||||
| // 删除表格行 | |||||
| deleteRow(rowIndex) { | |||||
| const tableRef = this.$refs['tableRef']; | |||||
| if (tableRef) { | |||||
| tableRef.deleteRow(rowIndex); | |||||
| } | |||||
| }, | |||||
| } | |||||
| }; | |||||
| </script> | |||||
| <style rel="stylesheet/scss" lang="scss"> | |||||
| .mt-20 { | |||||
| margin-top: 20px; | |||||
| } | |||||
| </style> | |||||
| @ -0,0 +1,374 @@ | |||||
| <!-- 生物样品分析方法学样品制备表-储备液和工作液稳定性 Solution Stability --> | |||||
| <template> | |||||
| <div> | |||||
| <div class="detail-container"> | |||||
| <div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc || | |||||
| $t('template.sp.sp014.title') }}<img src="@/assets/images/detail-title.png" /></div> | |||||
| <div class="detail-content"> | |||||
| <div class="content"> | |||||
| <BaseInfoFormPcakge 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="yqsColumns" | |||||
| :dataSource="resource" /> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.storageCondition" label="template.common.storageCondition" ref="storageConditionRef" | |||||
| :formConfig="storageFormConfig" :formData="formData" /> | |||||
| <LineLabel label="template.common.operationSteps" /> | |||||
| <div class="template-form-item"> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig" | |||||
| :formData="formData" @clickable="handleJzClickable" /> | |||||
| <CustomTable | |||||
| @blur="onHandleTableBlur" | |||||
| :ref="`tableRef`" | |||||
| :columns="tableStepColumns" | |||||
| :formData="formData" | |||||
| :prefixKey = "`table`" | |||||
| @clickable="handleClickable" | |||||
| fieldItemLabel = "template.common.operationSteps" | |||||
| > | |||||
| <template slot="operation" slot-scope="{ row, rowIndex}"> | |||||
| <TableOpertaion | |||||
| :fillType="fillType" | |||||
| :row="row" | |||||
| :rowIndex="rowIndex" | |||||
| @deleteRow="(rowIndex) => deleteRow(rowIndex)" | |||||
| ></TableOpertaion> | |||||
| </template> | |||||
| </CustomTable> | |||||
| </div> | |||||
| <Step ref="stepRef" :formData="formData.stepData"></Step> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.remark" label="template.common.remark" ref="remarkRef" :formConfig="remarkConig" | |||||
| :formData="formData" /> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| <!-- <button @click = "onSave">保存</button> --> | |||||
| <SelectReagentDialog | |||||
| @submit="onSelectReagentSubmit" | |||||
| ref="selectReagentDialogRef" > | |||||
| </SelectReagentDialog> | |||||
| </div> | |||||
| </template> | |||||
| <script> | |||||
| import BaseInfoFormPcakge from "@/components/Template/BaseInfoFormPcakge"; | |||||
| 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 { getLatestSn } from '@/api/template'; | |||||
| import {getSWYPFXFFXYPZBBTableConfig} from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js"; | |||||
| import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" | |||||
| import SelectReagentDialog from '../../../dialog/SelectReagentDialog.vue'; | |||||
| export default { | |||||
| name: "XZXHTYX", | |||||
| components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable,TableOpertaion,SelectReagentDialog }, | |||||
| 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: "input", | |||||
| fillType: "actFill", | |||||
| 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", | |||||
| 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: "clickable", | |||||
| subKey: "subJz", | |||||
| subFillType: "actFill", | |||||
| maxlength: 20, | |||||
| labelWidth: 80, | |||||
| }, | |||||
| } | |||||
| } | |||||
| ] | |||||
| }, | |||||
| tableStepColumns() { | |||||
| return getSWYPFXFFXYPZBBTableConfig(this,'business_sp_xzxytyx',true); | |||||
| }, | |||||
| }, | |||||
| data() { | |||||
| return { | |||||
| reagentType: "",//本表单特殊字段:选择试剂的类型1选择基质,2表格里面选择试剂 | |||||
| currentSubKey: "",//当前点击的子项key | |||||
| rowIndex:0,//当前表格点击的行数 | |||||
| resource: [], | |||||
| sysjColumns: [ | |||||
| { label: 'template.common.reagentName', prop: "mc" },//名称 | |||||
| { label: 'template.common.reagentCode', prop: "bh" },//编号 | |||||
| { label: 'template.common.reagentNo', prop: "ph" },//批号 试剂,供试品才有 | |||||
| { label: 'template.common.concentration', prop: "nd" },//浓度 | |||||
| { label: 'template.common.source', prop: "source" },//来源 | |||||
| { label: 'template.common.reagentExpireDate', prop: "sxrq" },//失效日期 | |||||
| ], | |||||
| yqsColumns: [ | |||||
| { label: 'template.common.instrumentName', prop: "instrumentName" }, | |||||
| { label: 'template.common.instrumentModel', prop: "instrumentModel" }, | |||||
| { label: 'template.common.instrumentCode', prop: "instrumentCode" }, | |||||
| { label: 'template.common.nextTestDate', prop: "nextTestDate" }, | |||||
| ], | |||||
| formData: {} | |||||
| }; | |||||
| }, | |||||
| mounted() { | |||||
| }, | |||||
| watch: { | |||||
| formData: { | |||||
| immediate: true, | |||||
| handler(v) { | |||||
| if(this.fillType === "actFill"){ | |||||
| this.getCode(v); | |||||
| } | |||||
| } | |||||
| } | |||||
| }, | |||||
| methods: { | |||||
| //点击基质选择 | |||||
| handleJzClickable(obj){ | |||||
| this.reagentType = 1//本表单特殊字段 | |||||
| this.currentSubKey = obj.subKey; | |||||
| this.$refs.selectReagentDialogRef.show() | |||||
| }, | |||||
| //选择试剂提交事件 | |||||
| onSelectReagentSubmit(code,row){ | |||||
| if(this.reagentType===1){ | |||||
| this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code); | |||||
| }else{ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(this.rowIndex,{ | |||||
| [this.currentSubKey]: code, | |||||
| }) | |||||
| } | |||||
| this.$refs.selectReagentDialogRef.onCancel() | |||||
| }, | |||||
| //点击表格单元格 | |||||
| handleClickable(col, rowIndex) { | |||||
| //本表单特殊字段 | |||||
| this.reagentType = 2 | |||||
| this.rowIndex = rowIndex | |||||
| this.currentSubKey = col.prop; | |||||
| console.log("clickable",rowIndex, col) | |||||
| if(col.prop === "sjry"){ | |||||
| //调用对应弹窗的方法-多个点击的需要判断是哪个字段点击 | |||||
| this.$refs.selectReagentDialogRef.show() | |||||
| } | |||||
| }, | |||||
| //获取目标溶液编号 | |||||
| async getCode(v){ | |||||
| const {stepTableFormData = []} = v; | |||||
| if(stepTableFormData && stepTableFormData.length>0 && !stepTableFormData[0].bhCode){ | |||||
| const result = await getLatestSn({ | |||||
| count: stepTableFormData.length, | |||||
| }) | |||||
| if(result.code == 200){ | |||||
| if(stepTableFormData.length===1){ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(0,{ | |||||
| bhCode: result.data, | |||||
| }) | |||||
| }else{ | |||||
| for(let i=0;i<stepTableFormData.length;i++){ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(i,{ | |||||
| bhCode: result.data[i], | |||||
| }) | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| }, | |||||
| //获取已填写的表单数据 | |||||
| getFilledFormData(){ | |||||
| return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef","stepRef", "remarkRef"]) | |||||
| }, | |||||
| async getFormData() { | |||||
| let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"]); | |||||
| //生成resource | |||||
| let tmpResource = [] | |||||
| let tableList = content.stepTableFormData | |||||
| for(let i=0;i<tableList.length;i++){ | |||||
| //配置的试剂 | |||||
| let item = tableList[i] | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: item.bh+item.bhCode, | |||||
| ph: null, | |||||
| nd: item.hhwznd + content.headerSelectFields.hhwzndUnit, | |||||
| source: 'ELN配制', | |||||
| sxrq: null, | |||||
| ndz: item.hhwznd, | |||||
| nddw: content.headerSelectFields.hhwzndUnit, | |||||
| kc: item.sjjzxql+item.sjryxql,//todo 单位不一致-计算 | |||||
| kcdw: content.headerSelectFields.sjryxqlUnit || content.headerSelectFields.sjjzxqlUnit,//todo 单位不一致-计算-按最小算 | |||||
| syl: null, | |||||
| syldw:content.headerSelectFields.sjryxqlUnit || content.headerSelectFields.sjjzxqlUnit,//todo 单位不一致-计算-按最小算, | |||||
| yxzq:null, | |||||
| yxzqdw:null, | |||||
| }) | |||||
| } | |||||
| //使用的试剂 | |||||
| this.resource=tmpResource | |||||
| return content; | |||||
| }, | |||||
| async onSave() { | |||||
| const formData = await this.getFilledFormData(); | |||||
| console.log(formData, "formData") | |||||
| }, | |||||
| // 删除表格行 | |||||
| deleteRow(rowIndex) { | |||||
| const tableRef = this.$refs['tableRef']; | |||||
| if (tableRef) { | |||||
| tableRef.deleteRow(rowIndex); | |||||
| } | |||||
| }, | |||||
| } | |||||
| }; | |||||
| </script> | |||||
| <style rel="stylesheet/scss" lang="scss"> | |||||
| .mt-20 { | |||||
| margin-top: 20px; | |||||
| } | |||||
| </style> | |||||
| @ -0,0 +1,374 @@ | |||||
| <!-- 生物样品分析方法学样品制备表-最大样本数-生物样品分析方法学样品制备表(Sample Size) --> | |||||
| <template> | |||||
| <div> | |||||
| <div class="detail-container"> | |||||
| <div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc || | |||||
| $t('template.sp.sp015.title') }}<img src="@/assets/images/detail-title.png" /></div> | |||||
| <div class="detail-content"> | |||||
| <div class="content"> | |||||
| <BaseInfoFormPcakge 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="yqsColumns" | |||||
| :dataSource="resource" /> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.storageCondition" label="template.common.storageCondition" ref="storageConditionRef" | |||||
| :formConfig="storageFormConfig" :formData="formData" /> | |||||
| <LineLabel label="template.common.operationSteps" /> | |||||
| <div class="template-form-item"> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig" | |||||
| :formData="formData" @clickable="handleJzClickable" /> | |||||
| <CustomTable | |||||
| @blur="onHandleTableBlur" | |||||
| :ref="`tableRef`" | |||||
| :columns="tableStepColumns" | |||||
| :formData="formData" | |||||
| :prefixKey = "`table`" | |||||
| @clickable="handleClickable" | |||||
| fieldItemLabel = "template.common.operationSteps" | |||||
| > | |||||
| <template slot="operation" slot-scope="{ row, rowIndex}"> | |||||
| <TableOpertaion | |||||
| :fillType="fillType" | |||||
| :row="row" | |||||
| :rowIndex="rowIndex" | |||||
| @deleteRow="(rowIndex) => deleteRow(rowIndex)" | |||||
| ></TableOpertaion> | |||||
| </template> | |||||
| </CustomTable> | |||||
| </div> | |||||
| <Step ref="stepRef" :formData="formData.stepData"></Step> | |||||
| <BaseInfoFormPcakge fieldItemLabel="template.common.remark" label="template.common.remark" ref="remarkRef" :formConfig="remarkConig" | |||||
| :formData="formData" /> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| <!-- <button @click = "onSave">保存</button> --> | |||||
| <SelectReagentDialog | |||||
| @submit="onSelectReagentSubmit" | |||||
| ref="selectReagentDialogRef" > | |||||
| </SelectReagentDialog> | |||||
| </div> | |||||
| </template> | |||||
| <script> | |||||
| import BaseInfoFormPcakge from "@/components/Template/BaseInfoFormPcakge"; | |||||
| 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 { getLatestSn } from '@/api/template'; | |||||
| import {getSWYPFXFFXYPZBBTableConfig} from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js"; | |||||
| import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" | |||||
| import SelectReagentDialog from '../../../dialog/SelectReagentDialog.vue'; | |||||
| export default { | |||||
| name: "ZDYBS", | |||||
| components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable,TableOpertaion,SelectReagentDialog }, | |||||
| 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: "input", | |||||
| fillType: "actFill", | |||||
| 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", | |||||
| 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: "clickable", | |||||
| subKey: "subJz", | |||||
| subFillType: "actFill", | |||||
| maxlength: 20, | |||||
| labelWidth: 80, | |||||
| }, | |||||
| } | |||||
| } | |||||
| ] | |||||
| }, | |||||
| tableStepColumns() { | |||||
| return getSWYPFXFFXYPZBBTableConfig(this,'business_sp_zdybs'); | |||||
| }, | |||||
| }, | |||||
| data() { | |||||
| return { | |||||
| reagentType: "",//本表单特殊字段:选择试剂的类型1选择基质,2表格里面选择试剂 | |||||
| currentSubKey: "",//当前点击的子项key | |||||
| rowIndex:0,//当前表格点击的行数 | |||||
| resource: [], | |||||
| sysjColumns: [ | |||||
| { label: 'template.common.reagentName', prop: "mc" },//名称 | |||||
| { label: 'template.common.reagentCode', prop: "bh" },//编号 | |||||
| { label: 'template.common.reagentNo', prop: "ph" },//批号 试剂,供试品才有 | |||||
| { label: 'template.common.concentration', prop: "nd" },//浓度 | |||||
| { label: 'template.common.source', prop: "source" },//来源 | |||||
| { label: 'template.common.reagentExpireDate', prop: "sxrq" },//失效日期 | |||||
| ], | |||||
| yqsColumns: [ | |||||
| { label: 'template.common.instrumentName', prop: "instrumentName" }, | |||||
| { label: 'template.common.instrumentModel', prop: "instrumentModel" }, | |||||
| { label: 'template.common.instrumentCode', prop: "instrumentCode" }, | |||||
| { label: 'template.common.nextTestDate', prop: "nextTestDate" }, | |||||
| ], | |||||
| formData: {} | |||||
| }; | |||||
| }, | |||||
| mounted() { | |||||
| }, | |||||
| watch: { | |||||
| formData: { | |||||
| immediate: true, | |||||
| handler(v) { | |||||
| if(this.fillType === "actFill"){ | |||||
| this.getCode(v); | |||||
| } | |||||
| } | |||||
| } | |||||
| }, | |||||
| methods: { | |||||
| //点击基质选择 | |||||
| handleJzClickable(obj){ | |||||
| this.reagentType = 1//本表单特殊字段 | |||||
| this.currentSubKey = obj.subKey; | |||||
| this.$refs.selectReagentDialogRef.show() | |||||
| }, | |||||
| //选择试剂提交事件 | |||||
| onSelectReagentSubmit(code,row){ | |||||
| if(this.reagentType===1){ | |||||
| this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code); | |||||
| }else{ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(this.rowIndex,{ | |||||
| [this.currentSubKey]: code, | |||||
| }) | |||||
| } | |||||
| this.$refs.selectReagentDialogRef.onCancel() | |||||
| }, | |||||
| //点击表格单元格 | |||||
| handleClickable(col, rowIndex) { | |||||
| //本表单特殊字段 | |||||
| this.reagentType = 2 | |||||
| this.rowIndex = rowIndex | |||||
| this.currentSubKey = col.prop; | |||||
| console.log("clickable",rowIndex, col) | |||||
| if(col.prop === "sjry"){ | |||||
| //调用对应弹窗的方法-多个点击的需要判断是哪个字段点击 | |||||
| this.$refs.selectReagentDialogRef.show() | |||||
| } | |||||
| }, | |||||
| //获取目标溶液编号 | |||||
| async getCode(v){ | |||||
| const {stepTableFormData = []} = v; | |||||
| if(stepTableFormData && stepTableFormData.length>0 && !stepTableFormData[0].bhCode){ | |||||
| const result = await getLatestSn({ | |||||
| count: stepTableFormData.length, | |||||
| }) | |||||
| if(result.code == 200){ | |||||
| if(stepTableFormData.length===1){ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(0,{ | |||||
| bhCode: result.data, | |||||
| }) | |||||
| }else{ | |||||
| for(let i=0;i<stepTableFormData.length;i++){ | |||||
| this.$refs.tableRef.updateDataSourceByRowIndex(i,{ | |||||
| bhCode: result.data[i], | |||||
| }) | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| }, | |||||
| //获取已填写的表单数据 | |||||
| getFilledFormData(){ | |||||
| return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef","stepRef", "remarkRef"]) | |||||
| }, | |||||
| async getFormData() { | |||||
| let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"]); | |||||
| //生成resource | |||||
| let tmpResource = [] | |||||
| let tableList = content.stepTableFormData | |||||
| for(let i=0;i<tableList.length;i++){ | |||||
| //配置的试剂 | |||||
| let item = tableList[i] | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: item.bh+item.bhCode, | |||||
| ph: null, | |||||
| nd: item.hhwznd + content.headerSelectFields.hhwzndUnit, | |||||
| source: 'ELN配制', | |||||
| sxrq: null, | |||||
| ndz: item.hhwznd, | |||||
| nddw: content.headerSelectFields.hhwzndUnit, | |||||
| kc: item.sjjzxql+item.sjryxql,//todo 单位不一致-计算 | |||||
| kcdw: content.headerSelectFields.sjryxqlUnit || content.headerSelectFields.sjjzxqlUnit,//todo 单位不一致-计算-按最小算 | |||||
| syl: null, | |||||
| syldw:content.headerSelectFields.sjryxqlUnit || content.headerSelectFields.sjjzxqlUnit,//todo 单位不一致-计算-按最小算, | |||||
| yxzq:null, | |||||
| yxzqdw:null, | |||||
| }) | |||||
| } | |||||
| //使用的试剂 | |||||
| this.resource=tmpResource | |||||
| return content; | |||||
| }, | |||||
| async onSave() { | |||||
| const formData = await this.getFilledFormData(); | |||||
| console.log(formData, "formData") | |||||
| }, | |||||
| // 删除表格行 | |||||
| deleteRow(rowIndex) { | |||||
| const tableRef = this.$refs['tableRef']; | |||||
| if (tableRef) { | |||||
| tableRef.deleteRow(rowIndex); | |||||
| } | |||||
| }, | |||||
| } | |||||
| }; | |||||
| </script> | |||||
| <style rel="stylesheet/scss" lang="scss"> | |||||
| .mt-20 { | |||||
| margin-top: 20px; | |||||
| } | |||||
| </style> | |||||
| @ -0,0 +1,224 @@ | |||||
| <template> | |||||
| <div> | |||||
| <div class="edit-container"> | |||||
| <div class="edit-top"> | |||||
| <div class="left-top"> | |||||
| <img src="@/assets/images/back.png" @click="cancel()" /> | |||||
| <div class="left-title"></div> | |||||
| </div> | |||||
| <div class="center-top"> | |||||
| </div> | |||||
| <div class="right-top"> | |||||
| <el-button @click="cancel()">{{ $t('form.cancel') }}</el-button> | |||||
| <el-button type="primary" @click="handleExport" v-if="showExportBtn">{{ | |||||
| $t('page.business.study.studyMethod.daochu') }}</el-button> | |||||
| <el-button type="primary" @click="yuedu" v-if="form.zt == 0 && !showExportBtn">{{ | |||||
| $t('page.business.study.studyMethod.yuedu') }}</el-button> | |||||
| </div> | |||||
| </div> | |||||
| <div class="edit-content "> | |||||
| <div class="pdf-layout"> | |||||
| <div class="pdf-content"> | |||||
| <pdf id="pdfBox" :page="pageNum" :src="pdfSrc" @progress="loadedRatio = $event" | |||||
| @num-pages="totalPages = $event"></pdf> | |||||
| </div> | |||||
| <div class="btn-layout" v-if="totalPages"> | |||||
| <div class="pageNum">{{ pageNum }} / {{ totalPages }}</div> | |||||
| <el-button-group> | |||||
| <el-button round plain type="primary" icon="el-icon-arrow-left" size="mini" | |||||
| @click="prePage">上一页</el-button> | |||||
| <el-button round plain type="primary" size="mini" @click="nextPage">下一页<i | |||||
| class="el-icon-arrow-right el-icon--right"></i></el-button> | |||||
| </el-button-group> | |||||
| </div> | |||||
| <div ref="contentToPdf"> | |||||
| <div class="content-title"> | |||||
| <div class="line"></div> | |||||
| <div class="subtitle"> {{ $t('page.business.study.studyMethod.qmhz') }}</div> | |||||
| </div> | |||||
| <el-table v-loading="loading" :data="list"> | |||||
| <el-table-column :label="$t('page.business.study.studyMethod.qmr')" prop="qmrMc" /> | |||||
| <el-table-column :label="$t('page.business.study.studyMethod.qmsj')" prop="createTime" /> | |||||
| <el-table-column :label="$t('page.business.study.studyMethod.qmyy')" prop="qmyy" /> | |||||
| <el-table-column :label="$t('page.business.study.studyMethod.remark')" prop="remark" /> | |||||
| </el-table> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| <Yd ref="Yd" @callback="closeYd" /> | |||||
| </div> | |||||
| </template> | |||||
| <script> | |||||
| import { studyMethod_readList, studyMethod_export } from '@/api/business/study/studyMethod' | |||||
| import html2canvas from 'html2canvas'; | |||||
| import { PDFDocument } from 'pdf-lib' | |||||
| import { mapGetters } from 'vuex' | |||||
| import pdf from 'vue-pdf' | |||||
| import Yd from './Yd.vue' | |||||
| export default { | |||||
| name: "Xq", | |||||
| components: { pdf, Yd }, | |||||
| data() { | |||||
| return { | |||||
| showExportBtn: false, | |||||
| pdfSrc: '', | |||||
| open: false, | |||||
| pageNum: 1, | |||||
| loadedRatio: 0, // 当前页面的加载进度,范围是0-1 ,等于1的时候代表当前页已经完全加载完成了 | |||||
| totalPages: 0, //pdf总页数 | |||||
| form: {}, | |||||
| list: [], | |||||
| loading: false, | |||||
| } | |||||
| }, | |||||
| computed: { | |||||
| ...mapGetters([ | |||||
| 'nickName','name' | |||||
| ]), | |||||
| }, | |||||
| created() { | |||||
| }, | |||||
| methods: { | |||||
| yuedu() { | |||||
| this.$refs.Yd.show(this.form) | |||||
| }, | |||||
| cancel() { | |||||
| this.$emit('close') | |||||
| }, | |||||
| show(row) { | |||||
| this.showExportBtn = false | |||||
| this.open = true | |||||
| this.form = row | |||||
| this.pdfSrc = process.env.VUE_APP_FILE_DOMAIN + row.fileUrl | |||||
| this.getPageNum() | |||||
| }, | |||||
| showExport(row) { | |||||
| this.loading = true | |||||
| this.open = true | |||||
| this.showExportBtn = true | |||||
| this.form = row | |||||
| this.pdfSrc = process.env.VUE_APP_FILE_DOMAIN + row.fileUrl | |||||
| studyMethod_readList({ studyMethodId: row.id }).then(response => { | |||||
| this.list = response.data | |||||
| this.loading = false | |||||
| this.getPageNum() | |||||
| }) | |||||
| }, | |||||
| // 获取PDF总页数 | |||||
| getPageNum() { | |||||
| let loadingTask = pdf.createLoadingTask(this.pdfSrc); | |||||
| loadingTask.promise | |||||
| .then((pdf) => { | |||||
| this.totalPages = pdf.numPages; | |||||
| this.loadPdfFromUrl() | |||||
| // this.$nextTick(() => { | |||||
| // this.setWatermarkContent(); | |||||
| // }); | |||||
| }) | |||||
| .catch((err) => { | |||||
| this.$message.msgError("pdf加载失败"); | |||||
| }); | |||||
| }, | |||||
| // 上一页 | |||||
| prePage() { | |||||
| let page = this.pageNum; | |||||
| page = page > 1 ? page - 1 : this.totalPages; | |||||
| this.pageNum = page; | |||||
| window.scrollTo(0, 0); | |||||
| }, | |||||
| // 下一页 | |||||
| nextPage() { | |||||
| let page = this.pageNum; | |||||
| page = page < this.totalPages ? page + 1 : 1; | |||||
| this.pageNum = page; | |||||
| window.scrollTo(0, 0); | |||||
| }, | |||||
| closeYd(val) { | |||||
| this.form.zt = val | |||||
| }, | |||||
| handleExport() { | |||||
| studyMethod_export({studyMethodId: this.form.id}).then(response => { | |||||
| let fileUrl = response.data.fileUrl | |||||
| this.$download.saveAs(process.env.VUE_APP_FILE_DOMAIN + fileUrl, this.form.ffmc + ".pdf"); | |||||
| }) | |||||
| } | |||||
| } | |||||
| } | |||||
| </script> | |||||
| <style lang="scss"> | |||||
| .pdf-layout { | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| align-items: center; | |||||
| } | |||||
| .pdf-content { | |||||
| min-width: 1000px; | |||||
| min-height: 550px; | |||||
| position: relative; | |||||
| margin: 0 auto | |||||
| } | |||||
| .btn-layout { | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| align-items: center; | |||||
| } | |||||
| .content-edit { | |||||
| background: #f5f5f5; | |||||
| padding: 0; | |||||
| .edit-top { | |||||
| background: #fff; | |||||
| padding: 10px 20px; | |||||
| margin-bottom: 10px; | |||||
| display: flex; | |||||
| flex-direction: row; | |||||
| align-items: center; | |||||
| justify-content: space-between; | |||||
| .left-top { | |||||
| flex-shrink: 0; | |||||
| display: flex; | |||||
| flex-direction: row; | |||||
| align-items: center; | |||||
| img { | |||||
| height: 16px; | |||||
| margin-right: 20px; | |||||
| cursor: pointer; | |||||
| } | |||||
| .right-top {} | |||||
| } | |||||
| } | |||||
| .edit-content { | |||||
| background: #fff; | |||||
| padding: 20px; | |||||
| min-height: 500px; | |||||
| .edit-form { | |||||
| width: 800px; | |||||
| margin: 0 auto; | |||||
| } | |||||
| } | |||||
| } | |||||
| </style> | |||||
| @ -0,0 +1,205 @@ | |||||
| G<template> | |||||
| <div> | |||||
| <!-- 新增试验间弹窗 --> | |||||
| <el-dialog :title="$t('page.business.study.studyMethod.scff')" :visible.sync="open" width="400px" append-to-body | |||||
| :close-on-click-modal="false"> | |||||
| <el-form ref="form" :model="form" :rules="rules" label-width="80px"> | |||||
| <el-row> | |||||
| <el-col :span="24"> | |||||
| <el-form-item :label="$t('page.business.study.studyMethod.mc')" prop="ffmc"> | |||||
| <el-input type="text" v-model="form.ffmc" maxlength="20" | |||||
| :placeholder="$t('form.placeholderInput')" /> | |||||
| </el-form-item> | |||||
| </el-col> | |||||
| </el-row> | |||||
| <el-row> | |||||
| <!-- 方法 --> | |||||
| <el-col :span="24"> | |||||
| <el-form-item :label="$t('page.business.study.studyMethod.ff')" prop="fileUlr"> | |||||
| <el-upload class="upload-demo" :before-upload="handleBeforeUpload" :on-error="handleUploadError" | |||||
| :on-exceed="handleExceed" :on-success="handleUploadSuccess" :show-file-list="true" :headers="headers" | |||||
| :on-remove="handleRemove" :action="uploadFileUrl" accept=".pdf" :limit="1" :file-list="fileList"> | |||||
| <el-button size="small" type="primary">{{ $t('page.business.study.studyMethod.scwj') }}</el-button> | |||||
| <div slot="tip" class="el-upload__tip">{{ $t('page.business.study.studyMethod.wjm') }}</div> | |||||
| </el-upload> | |||||
| </el-form-item> | |||||
| </el-col> | |||||
| </el-row> | |||||
| <el-row> | |||||
| <el-col :span="24"> | |||||
| <el-form-item :label="$t('form.qmyy')" prop="qmyy"> | |||||
| <el-input type="text" :value="form.qmyy" maxlength="50" disabled | |||||
| :placeholder="$t('form.placeholderInput')" /> | |||||
| </el-form-item> | |||||
| </el-col> | |||||
| </el-row> | |||||
| <el-row> | |||||
| <el-col :span="24"> | |||||
| <el-form-item :label="$t('form.remark')" prop="qmbz"> | |||||
| <el-input type="textarea" v-model="form.qmbz" :rows="2" maxlength="500" | |||||
| :placeholder="$t('form.placeholderInput')"> | |||||
| </el-input> | |||||
| </el-form-item> | |||||
| </el-col> | |||||
| </el-row> | |||||
| <el-row> | |||||
| <el-col :span="24"> | |||||
| <el-form-item :label="$t('form.signer')"> | |||||
| <el-input type="text" v-model="nickName" maxlength="50" disabled | |||||
| :placeholder="$t('form.placeholderInput')" /> | |||||
| </el-form-item> | |||||
| </el-col> | |||||
| </el-row> | |||||
| <el-row> | |||||
| <el-col :span="24"> | |||||
| <el-form-item :label="$t('form.password')" prop="qmrmm"> | |||||
| <el-input type="password" v-model="form.qmrmm" maxlength="20" | |||||
| :placeholder="$t('form.placeholderInput')" /> | |||||
| </el-form-item> | |||||
| </el-col> | |||||
| </el-row> | |||||
| </el-form> | |||||
| <div slot="footer" class="dialog-footer"> | |||||
| <el-button type="primary" @click="save">{{ $t('form.confirm') }}</el-button> | |||||
| <el-button @click="cancel">{{ $t('form.cancel') }}</el-button> | |||||
| </div> | |||||
| </el-dialog> | |||||
| </div> | |||||
| </template> | |||||
| <script> | |||||
| import { studyMethod_save } from "@/api/business/study/studyMethod" | |||||
| import { mapGetters } from 'vuex' | |||||
| import { getToken } from "@/utils/auth" | |||||
| export default { | |||||
| name: "XzSyj", | |||||
| components: {}, | |||||
| data() { | |||||
| return { | |||||
| open: false, | |||||
| form: { | |||||
| mc: '', | |||||
| fileUrl: '', | |||||
| fileName: '' | |||||
| }, | |||||
| uploadFileUrl: process.env.VUE_APP_BASE_API + "/file/upload", | |||||
| headers: { | |||||
| Authorization: "Bearer " + getToken(), | |||||
| }, | |||||
| fileList: [], | |||||
| rules: { | |||||
| ffmc: [{ | |||||
| required: true, | |||||
| message: ' ', | |||||
| trigger: 'blur' | |||||
| }], | |||||
| fileUrl: [{ | |||||
| required: true, | |||||
| message: ' ', | |||||
| trigger: 'blur' | |||||
| }], | |||||
| qmrmm: [{ | |||||
| required: true, | |||||
| message: ' ', | |||||
| trigger: 'blur' | |||||
| }], | |||||
| } | |||||
| } | |||||
| }, | |||||
| computed: { | |||||
| ...mapGetters([ | |||||
| 'nickName','name' | |||||
| ]), | |||||
| }, | |||||
| created() { | |||||
| }, | |||||
| methods: { | |||||
| cancel() { | |||||
| this.open = false | |||||
| }, | |||||
| reset() { | |||||
| this.form = { | |||||
| ffmc: null, | |||||
| fileUrl: '', | |||||
| fileName: '', | |||||
| qmrmm: null, | |||||
| kssyyl: '', | |||||
| qmyy: '上传文件', | |||||
| bjbz: '' | |||||
| } | |||||
| this.fileList = [] | |||||
| this.resetForm("form") | |||||
| }, | |||||
| show(study) { | |||||
| this.reset() | |||||
| this.form.studyId = study.id | |||||
| this.form.studySubjectId = study.studySubjectId | |||||
| this.open = true | |||||
| }, | |||||
| save() { | |||||
| this.$refs["form"].validate(valid => { | |||||
| if (valid) { | |||||
| studyMethod_save(this.form).then(response => { | |||||
| this.open = false | |||||
| this.$emit('callback') | |||||
| }) | |||||
| } | |||||
| }) | |||||
| }, | |||||
| // 上传前校检格式和大小 | |||||
| handleBeforeUpload(file) { | |||||
| let fileType = ['pdf'] | |||||
| // 校检文件类型 | |||||
| if (fileType) { | |||||
| const fileName = file.name.split('.') | |||||
| const fileExt = fileName[fileName.length - 1] | |||||
| const isTypeOk = fileType.indexOf(fileExt) >= 0 | |||||
| if (!isTypeOk) { | |||||
| this.$modal.msgError('文件格式不正确,请上传pdf格式文件!') | |||||
| return false | |||||
| } | |||||
| } | |||||
| // 校检文件名是否包含特殊字符 | |||||
| if (file.name.includes(',')) { | |||||
| this.$modal.msgError('文件名不正确,不能包含英文逗号!') | |||||
| return false | |||||
| } | |||||
| this.$modal.loading("正在上传文件,请稍候...") | |||||
| this.number++ | |||||
| return true | |||||
| }, | |||||
| // 文件个数超出 | |||||
| handleExceed() { | |||||
| this.$modal.msgError('上传文件数量不能超过1个!') | |||||
| }, | |||||
| // 上传失败 | |||||
| handleUploadError(err) { | |||||
| this.$modal.msgError("上传文件失败,请重试") | |||||
| this.$modal.closeLoading() | |||||
| }, | |||||
| // 上传成功回调 | |||||
| handleUploadSuccess(res, file) { | |||||
| console.log(res) | |||||
| if (res.code === 200) { | |||||
| this.form.fileUrl = res.data.url | |||||
| this.form.fileName = res.data.name | |||||
| this.fileList.push({ name: res.data.name, url: res.data.url }) | |||||
| this.$modal.closeLoading() | |||||
| } else { | |||||
| this.number-- | |||||
| this.$modal.closeLoading() | |||||
| this.$modal.msgError(res.msg) | |||||
| this.$refs.fileUpload.handleRemove(file) | |||||
| } | |||||
| }, | |||||
| handleRemove() { | |||||
| this.form.fileUrl = '' | |||||
| this.form.fileName = '' | |||||
| this.fileList = [] | |||||
| } | |||||
| } | |||||
| } | |||||
| </script> | |||||
| @ -0,0 +1,109 @@ | |||||
| <template> | |||||
| <div> | |||||
| <!-- 阅读弹窗 --> | |||||
| <el-dialog :title="$t('page.business.study.studyMethod.yuedu')" :visible.sync="open" width="500px" append-to-body | |||||
| :close-on-click-modal="false"> | |||||
| <el-form ref="form" :model="form" :rules="rules" label-width="120px"> | |||||
| <el-row> | |||||
| <el-col :span="24"> | |||||
| <el-form-item :label="$t('form.qmyy')" prop="qmyy"> | |||||
| <el-input type="text" :value="form.qmyy" maxlength="50" disabled | |||||
| :placeholder="$t('form.placeholderInput')" /> | |||||
| </el-form-item> | |||||
| </el-col> | |||||
| </el-row> | |||||
| <el-row> | |||||
| <el-col :span="24"> | |||||
| <el-form-item :label="$t('form.remark')" prop="remark"> | |||||
| <el-input type="textarea" v-model="form.remark" :rows="5" maxlength="500" | |||||
| :placeholder="$t('form.placeholderInput')"> | |||||
| </el-input> | |||||
| </el-form-item> | |||||
| </el-col> | |||||
| </el-row> | |||||
| <el-row> | |||||
| <el-col :span="24"> | |||||
| <el-form-item :label="$t('form.signer')"> | |||||
| <el-input type="text" v-model="nickName" maxlength="50" disabled | |||||
| :placeholder="$t('form.placeholderInput')" /> | |||||
| </el-form-item> | |||||
| </el-col> | |||||
| </el-row> | |||||
| <el-row> | |||||
| <el-col :span="24"> | |||||
| <el-form-item :label="$t('form.password')" prop="qmrmm"> | |||||
| <el-input type="password" v-model="form.qmrmm" maxlength="20" | |||||
| :placeholder="$t('form.placeholderInput')" /> | |||||
| </el-form-item> | |||||
| </el-col> | |||||
| </el-row> | |||||
| </el-form> | |||||
| <div slot="footer" class="dialog-footer"> | |||||
| <el-button type="primary" @click="save">{{ $t('form.confirm') }}</el-button> | |||||
| <el-button @click="cancel">{{ $t('form.cancel') }}</el-button> | |||||
| </div> | |||||
| </el-dialog> | |||||
| </div> | |||||
| </template> | |||||
| <script> | |||||
| import { studyMethod_read } from "@/api/business/study/studyMethod" | |||||
| import { mapGetters } from 'vuex' | |||||
| export default { | |||||
| name: "Yd", | |||||
| data() { | |||||
| return { | |||||
| open: false, | |||||
| form: {}, | |||||
| rules: { | |||||
| qmrmm: [{ | |||||
| required: true, | |||||
| message: ' ', | |||||
| trigger: 'blur' | |||||
| }] | |||||
| } | |||||
| } | |||||
| }, | |||||
| computed: { | |||||
| ...mapGetters([ | |||||
| 'nickName','name' | |||||
| ]), | |||||
| }, | |||||
| created() { | |||||
| }, | |||||
| methods: { | |||||
| cancel() { | |||||
| this.open = false | |||||
| }, | |||||
| reset() { | |||||
| this.form = { | |||||
| studyMethodId: null, | |||||
| qmyy: '阅读', | |||||
| remark: '', | |||||
| qmrmm: null | |||||
| } | |||||
| this.resetForm("form") | |||||
| }, | |||||
| show(row) { | |||||
| this.reset() | |||||
| this.form.studyMethodId = row.id | |||||
| this.open = true | |||||
| }, | |||||
| save() { | |||||
| this.$refs["form"].validate(valid => { | |||||
| if (valid) { | |||||
| this.$modal.loading() | |||||
| studyMethod_read(this.form).then(response => { | |||||
| this.open = false | |||||
| this.$emit('callback', 1) | |||||
| this.$modal.closeLoading() | |||||
| }).finally(() => { | |||||
| this.$modal.closeLoading() | |||||
| }) | |||||
| } | |||||
| }) | |||||
| } | |||||
| } | |||||
| } | |||||
| </script> | |||||
| @ -0,0 +1,211 @@ | |||||
| <!-- 试验方法列表 --> | |||||
| <template> | |||||
| <div> | |||||
| <div class="tbbd-list" v-show="!showDetail"> | |||||
| <div class="tbbd-search"> | |||||
| <el-form :model="searchForm" ref="searchForm" class="search-area" :inline="true" label-width="88px"> | |||||
| <el-row> | |||||
| <el-col :span="24"> | |||||
| <!-- 方法名称 --> | |||||
| <el-form-item :label="$t('page.business.study.studyMethod.ffmc')" prop="ffmc"> | |||||
| <el-input v-model="searchForm.ffmc" :placeholder="$t('form.placeholderInput')" clearable | |||||
| @keyup.enter.native="search" /> | |||||
| </el-form-item> | |||||
| <!-- 创建人 --> | |||||
| <el-form-item :label="$t('page.business.study.studyMethod.cjr')" prop="cjr"> | |||||
| <el-input v-model="searchForm.cjr" :placeholder="$t('form.placeholderInput')" clearable | |||||
| @keyup.enter.native="search" /> | |||||
| </el-form-item> | |||||
| <!-- 创建时间 --> | |||||
| <el-form-item :label="$t('page.business.study.studyMethod.cjsj') + ':'"> | |||||
| <el-date-picker v-model="daterange" class="chat-histogram-daterange" type="daterange" | |||||
| range-separator="-" :start-placeholder="$t('form.startDate')" :end-placeholder="$t('form.endDate')" | |||||
| value-format="yyyy-MM-dd" @change="search" style="width: 250px;" /> | |||||
| </el-form-item> | |||||
| <!-- 状态 --> | |||||
| <el-form-item :label="$t('page.business.study.studyMethod.zt') + ':'" prop="zt"> | |||||
| <el-select v-model="searchForm.zt" :placeholder="$t('form.placeholderSelect')" clearable | |||||
| @change="search"> | |||||
| <el-option :label="$t('page.business.study.studyMethod.yidu')" :value="1" /> | |||||
| <el-option :label="$t('page.business.study.studyMethod.weidu')" :value="0" /> | |||||
| </el-select> | |||||
| </el-form-item> | |||||
| <el-form-item> | |||||
| <el-button type="primary" icon="el-icon-search" @click="search">{{ $t('form.search') }}</el-button> | |||||
| <el-button icon="el-icon-refresh" @click="reset">{{ $t('form.reset') }}</el-button> | |||||
| </el-form-item> | |||||
| </el-col> | |||||
| </el-row> | |||||
| </el-form> | |||||
| </div> | |||||
| <div class="tbbd-content"> | |||||
| <el-row class="add-box"> | |||||
| <el-col> | |||||
| <el-button type="primary" icon="el-icon-plus" @click="add()" v-hasPermi="['business:studyMethod:upload']">{{ | |||||
| $t('page.business.study.studyMethod.scff') }}</el-button> | |||||
| </el-col> | |||||
| </el-row> | |||||
| <el-table v-loading="loading" :data="list"> | |||||
| <el-table-column :label="$t('page.business.study.studyMethod.ffmc')" prop="ffmc" /> | |||||
| <el-table-column :label="$t('page.business.study.studyMethod.cjsj')" prop="createTime" /> | |||||
| <el-table-column :label="$t('page.business.study.studyMethod.cjr')" prop="userMc" /> | |||||
| <el-table-column :label="$t('page.business.study.studyMethod.zt')" prop="status" align="center" width="100"> | |||||
| <template slot-scope="scope"> | |||||
| <span v-if="scope.row.zt != 0">{{ $t('page.business.study.studyMethod.yidu') }}</span> | |||||
| <span v-if="scope.row.zt === 0">{{ $t('page.business.study.studyMethod.weidu') }}</span> | |||||
| </template> | |||||
| </el-table-column> | |||||
| <el-table-column :label="$t('form.operate')" align="left" fixed="right" width="200"> | |||||
| <template slot-scope="scope"> | |||||
| <!-- 阅读 --> | |||||
| <el-button type="text" @click="detail(scope.row)" v-hasPermi="['business:studyMethod:read']">{{ | |||||
| $t('page.business.study.studyMethod.yuedu') }}</el-button> | |||||
| <!-- 导出 --> | |||||
| <el-button type="text" @click="showExport(scope.row)" v-hasPermi="['business:studyMethod:download']">{{ | |||||
| $t('page.business.study.studyMethod.daochu') }}</el-button> | |||||
| </template> | |||||
| </el-table-column> | |||||
| </el-table> | |||||
| <pagination v-show="total > 0" :total="total" :page.sync="searchForm.pageNum" :limit.sync="searchForm.pageSize" | |||||
| @pagination="getList" /> | |||||
| </div> | |||||
| </div> | |||||
| <!-- 新增 --> | |||||
| <Xz key="Xz" ref="Xz" @callback="search" /> | |||||
| <!-- 详情 --> | |||||
| <Xq key="Xq" ref="Xq" v-show="showDetail" @close="xqClose" /> | |||||
| </div> | |||||
| </template> | |||||
| <script> | |||||
| import { studyMethod_list } from '@/api/business/study/studyMethod' | |||||
| import Xz from "./syff/Xz"; | |||||
| import Xq from "./syff/Xq"; | |||||
| import { mapGetters } from 'vuex' | |||||
| import moment from "moment"; | |||||
| export default { | |||||
| name: 'SyffList', | |||||
| props: { | |||||
| study: { | |||||
| type: Object, | |||||
| default: () => { | |||||
| return {} | |||||
| } | |||||
| } | |||||
| }, | |||||
| computed: { | |||||
| ...mapGetters([ | |||||
| 'id' | |||||
| ]), | |||||
| }, | |||||
| watch: { | |||||
| study: { | |||||
| handler(newVal) { | |||||
| this.searchForm.studySn = newVal.sn | |||||
| this.searchForm.studyMc = newVal.name | |||||
| this.searchForm.studyId = newVal.id | |||||
| this.searchForm.studySubjectId = newVal.studySubjectId | |||||
| this.leader = newVal.leader | |||||
| this.search() | |||||
| }, | |||||
| immediate: true, | |||||
| deep: true | |||||
| } | |||||
| }, | |||||
| components: { Xz, Xq }, | |||||
| data() { | |||||
| return { | |||||
| showDetail: false, | |||||
| daterange: [], | |||||
| showFh: false, | |||||
| daterange: [], | |||||
| searchForm: { | |||||
| pageNum: 1, | |||||
| pageSize: 10, | |||||
| studyId: '', | |||||
| syjh: '', | |||||
| syqy: '', | |||||
| qyr: '', | |||||
| jsr: '', | |||||
| startDate: '', | |||||
| endDate: '' | |||||
| }, | |||||
| loading: false, | |||||
| total: 0, | |||||
| list: [], | |||||
| currentRow: null | |||||
| } | |||||
| }, | |||||
| created() { }, | |||||
| methods: { | |||||
| search() { | |||||
| this.searchForm.pageNum = 1 | |||||
| this.getList() | |||||
| }, | |||||
| reset() { | |||||
| this.resetForm("searchForm") | |||||
| this.search() | |||||
| }, | |||||
| getList() { | |||||
| if (this.daterange != null && this.daterange.length > 0) { | |||||
| this.searchForm.startDate = this.daterange[0] + " 00:00:00" | |||||
| this.searchForm.endDate = this.daterange[1] + " 23:59:59" | |||||
| } else { | |||||
| this.searchForm.startDate = '' | |||||
| this.searchForm.endDate = '' | |||||
| } | |||||
| this.loading = true | |||||
| studyMethod_list(this.searchForm).then(response => { | |||||
| this.list = response.rows | |||||
| this.total = response.total | |||||
| this.loading = false | |||||
| }) | |||||
| }, | |||||
| add() { | |||||
| this.$refs.Xz.show(this.study); | |||||
| }, | |||||
| detail(row) { | |||||
| this.showDetail = true | |||||
| this.$emit('showDetail', this.showDetail) | |||||
| this.$refs.Xq.show(row) | |||||
| }, | |||||
| showExport(row) { | |||||
| this.showDetail = true | |||||
| this.$emit('showDetail', this.showDetail) | |||||
| this.$refs.Xq.showExport(row) | |||||
| }, | |||||
| xqClose() { | |||||
| this.showDetail = false | |||||
| this.$emit('showDetail', this.showDetail) | |||||
| this.search() | |||||
| }, | |||||
| } | |||||
| } | |||||
| </script> | |||||
| <style lang="scss" scoped> | |||||
| .tbbd-list { | |||||
| .tbbd-search { | |||||
| background: #fff; | |||||
| padding: 20px; | |||||
| margin-bottom: 10px; | |||||
| .right-btn { | |||||
| text-align: right | |||||
| } | |||||
| } | |||||
| .tbbd-content { | |||||
| padding: 20px; | |||||
| background: #fff; | |||||
| .add-box { | |||||
| margin-bottom: 10px; | |||||
| } | |||||
| } | |||||
| } | |||||
| </style> | |||||