| @ -0,0 +1,88 @@ | |||||
| import { EventBus } from "@/utils/eventBus"; | |||||
| import { getuuid } from "@/utils/index"; | |||||
| import moment from "moment"; | |||||
| export default { | |||||
| inject: ["templateFillType"], | |||||
| data() { | |||||
| return { | |||||
| uuid: getuuid(), | |||||
| deleteIndex: 0, | |||||
| } | |||||
| }, | |||||
| mounted() { | |||||
| EventBus.$on('onEditSignCallback', this.handleEditSignCallback); | |||||
| }, | |||||
| unmounted() { | |||||
| EventBus.$off('onEditSignCallback', this.handleEditSignCallback); | |||||
| }, | |||||
| methods: { | |||||
| handleEditSignCallback(data) { | |||||
| if (data.uuid === this.uuid) { | |||||
| console.log(this.columns, this.templateFillType, data, "this.columns") | |||||
| const { qmrMc, qmrMcEn, remark } = data.data; | |||||
| const { fieldItemLabel, columnsData } = this.columns; | |||||
| const { row } = this; | |||||
| const desArr = columnsData.map((item) => { | |||||
| const label = this.$t(item.label), otherValue = "", subValue = "", mainValue = row[item.prop]; | |||||
| if (item.bodySubKey && (item.bodySubType !== "button")) { | |||||
| subValue = row[item.bodySubKey]; | |||||
| } | |||||
| if (item.otherCode) { | |||||
| otherValue = row[item.otherCode]; | |||||
| } | |||||
| const desStr = `${label}:${mainValue}${subValue ? `[${subValue}]` : ''}${otherValue ? `[${otherValue}]` : ''}`; | |||||
| return desStr; | |||||
| }); | |||||
| const record = [ | |||||
| { | |||||
| "userNameCn": qmrMc, | |||||
| "userNameEn": qmrMcEn, | |||||
| "fieldCn": this.$t(fieldItemLabel, 'zh_CN'), | |||||
| "fieldEn": this.$t(fieldItemLabel, 'en_US'), | |||||
| "oldValue": desArr.join(";"), | |||||
| "value": "", | |||||
| "title": "修改", | |||||
| "time": moment().format("YYYY-MM-DD HH:mm:ss"), | |||||
| "reason": remark | |||||
| } | |||||
| ] | |||||
| this.sureDelete(record); | |||||
| } | |||||
| }, | |||||
| sureDelete(record) { | |||||
| this.$emit("deleteRow", this.deleteIndex); | |||||
| setTimeout(() => { | |||||
| const params = { | |||||
| type: "fieldChanged", | |||||
| newRecord: record || null, | |||||
| resourceList: null, | |||||
| } | |||||
| EventBus.$emit('onModifyRecord', params,) | |||||
| }, 30); | |||||
| }, | |||||
| // 删除行 | |||||
| deleteRow(index) { | |||||
| const { columnsData } = this.columns; | |||||
| const { row } = this; | |||||
| const filledRowData = {}; | |||||
| columnsData.map((item) => { | |||||
| filledRowData[item.prop] = row[item.prop]; | |||||
| if (item.bodySubKey && (item.bodySubType !== "button")) { | |||||
| filledRowData[item.bodySubKey] = row[item.bodySubKey]; | |||||
| } | |||||
| if (item.otherCode) { | |||||
| filledRowData[item.otherCode] = row[item.otherCode]; | |||||
| } | |||||
| }) | |||||
| const isFilled = Object.values(filledRowData).every((item) => !!item); | |||||
| this.deleteIndex = index; | |||||
| if (this.templateFillType === "actFill" && isFilled) { | |||||
| EventBus.$emit('showEditSignDialog', { uuid: this.uuid }); | |||||
| } else { | |||||
| this.sureDelete(); | |||||
| } | |||||
| } | |||||
| }, | |||||
| } | |||||
| @ -1,586 +0,0 @@ | |||||
| <!-- PCR分析溶液配制记录表 --> | |||||
| <template> | |||||
| <div> | |||||
| <div class="detail-container"> | |||||
| <div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img src="@/assets/images/detail-title.png" /></div> | |||||
| <div class="detail-content"> | |||||
| <div class="content"> | |||||
| <BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" | |||||
| ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" /> | |||||
| <TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" /> | |||||
| <TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" /> | |||||
| <LineLabel label="template.common.operationSteps" /> | |||||
| <div class="template-form-item"> | |||||
| <BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" | |||||
| @clickable="handleFormClickable" | |||||
| @onSureModifyRecord="onSureModifyRecord" | |||||
| @resetRecord="resetRecord" | |||||
| :formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" /> | |||||
| <CustomTable | |||||
| @blur="onHandleTableBlur" | |||||
| :ref="`stepTableRef`" | |||||
| :columns="tableStepColumns" | |||||
| :formData="formData" | |||||
| :prefixKey = "`table`" | |||||
| @clickable="handleClickable" | |||||
| fieldItemLabel = "template.common.operationSteps" | |||||
| > | |||||
| <template slot="operation" slot-scope="{ row, rowIndex, columns }"> | |||||
| <TableOpertaion | |||||
| :fillType="fillType" | |||||
| :row="row" | |||||
| :rowIndex="rowIndex" | |||||
| :columns="columns" | |||||
| @deleteRow="(rowIndex) => deleteRow(rowIndex)" | |||||
| @subPackageSubmit="subPackageSubmit" | |||||
| @startConfig="startConfig" | |||||
| @configComplete="configComplete" | |||||
| ></TableOpertaion> | |||||
| </template> | |||||
| </CustomTable> | |||||
| </div> | |||||
| <Step ref="stepRef" :formData="formData.stepData"></Step> | |||||
| <BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" | |||||
| ref="remarkRef" :formConfig="remarkConig" :formData="formData" /> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| <SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef"> | |||||
| </SelectReagentDialog> | |||||
| <!-- <button @click="onSave">保存</button> --> | |||||
| </div> | |||||
| </template> | |||||
| <script> | |||||
| import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage"; | |||||
| import LineLabel from "@/components/Template/LineLabel"; | |||||
| import TableList from "@/components/Template/Table"; | |||||
| import Step from "@/components/Template/Step"; | |||||
| import templateMixin from "../../mixins/templateMixin"; | |||||
| import CustomTable from '@/components/Template/CustomTable.vue'; | |||||
| import { getLatestSnArr } from '@/api/template'; | |||||
| import { EventBus } from "@/utils/eventBus"; | |||||
| import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; | |||||
| import { getLadderColumnsConfig } from "../../formConfig/PCRTableConfig.js"; | |||||
| import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" | |||||
| import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools"; | |||||
| export default { | |||||
| name: "PCR002", | |||||
| components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog }, | |||||
| mixins: [templateMixin], | |||||
| props: { | |||||
| fillType: { | |||||
| type: String, | |||||
| default: 'preFill', | |||||
| }, | |||||
| }, | |||||
| computed: { | |||||
| tableStepColumns() { | |||||
| return getLadderColumnsConfig(this, 'business_pcr_gzy'); | |||||
| }, | |||||
| // 配置条件 | |||||
| storageFormConfig() { | |||||
| return [ | |||||
| { | |||||
| type: "conditionItem", | |||||
| config: { | |||||
| storageCondition: { | |||||
| label: 'template.common.storageConditionLabel', | |||||
| type: "select", | |||||
| fillType: "preFill", | |||||
| options: this.getDictOptions("business_cctj"), | |||||
| multiple: true, | |||||
| 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, | |||||
| }, | |||||
| } | |||||
| }, | |||||
| { | |||||
| 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, | |||||
| compareTo: "pre", | |||||
| options: this.getDictOptions('business_pztj') | |||||
| } | |||||
| } | |||||
| }, | |||||
| { | |||||
| type: "cellItem", | |||||
| label: 'template.common.configurationTime', | |||||
| config: { | |||||
| startDate: { | |||||
| label: 'template.common.startTime', | |||||
| type: "input", | |||||
| }, | |||||
| endDate: { | |||||
| label: 'template.common.endTime', | |||||
| type: "input", | |||||
| }, | |||||
| } | |||||
| } | |||||
| ] | |||||
| }, | |||||
| // 操作步骤表单配置 | |||||
| stepFormConfig() { | |||||
| return [ | |||||
| { | |||||
| type: 'step', | |||||
| config: { | |||||
| startSolution: { | |||||
| label: 'template.pcr.pcr002.qsyry', | |||||
| type: 'input', | |||||
| fillType: 'preFill', | |||||
| subType: 'clickable', | |||||
| subKey: 'subStartSolution', | |||||
| subFillType: 'actFill', | |||||
| maxlength: 20 | |||||
| }, | |||||
| targetStartSolution: { | |||||
| label: 'template.pcr.pcr002.ysqsyrynd', | |||||
| type: 'inputNumber', | |||||
| subType: 'select', | |||||
| fillType: 'preFill', | |||||
| subOptions: this.getDictOptions('business_nddw'), | |||||
| subKey: 'subTargetStartSolution', | |||||
| maxlength: 10 | |||||
| }, | |||||
| targetAcSolution: { | |||||
| label: 'template.pcr.pcr002.sjqsyrynd', | |||||
| type: 'input', | |||||
| fillType: 'actFill', | |||||
| disabled: true, | |||||
| maxlength: 10, | |||||
| compareTo: 'targetStartSolution', //比较哪个字段 | |||||
| }, | |||||
| solution: { | |||||
| label: 'template.pcr.pcr002.xsy', | |||||
| type: 'input', | |||||
| fillType: 'preFill', | |||||
| subType: 'clickable', | |||||
| subKey: 'subSolution', | |||||
| subFillType: 'actFill', | |||||
| maxlength: 20 | |||||
| }, | |||||
| stepStorageCondition: { | |||||
| label: 'template.pcr.pcr002.cctj', | |||||
| type: 'select', | |||||
| fillType: 'preFill', | |||||
| options: this.getDictOptions('business_cctj'), | |||||
| multiple: true, | |||||
| otherCode: 'stepStorageConditionOther' | |||||
| }, | |||||
| effectivePeriod: { | |||||
| label: 'template.pcr.pcr002.mbryyxzq', | |||||
| type: 'input', | |||||
| subType: 'select', | |||||
| subKey: 'effectivePeriodUnit', | |||||
| fillType: 'preFill', | |||||
| subOptions: this.getDictOptions('business_yxqdw') | |||||
| }, | |||||
| expireDate: { | |||||
| label: 'template.pcr.pcr002.mbrysxr', | |||||
| type: 'input' | |||||
| } | |||||
| } | |||||
| } | |||||
| ] | |||||
| }, | |||||
| }, | |||||
| data() { | |||||
| return { | |||||
| reagentType: null, // 1-表单 2-表格 | |||||
| formData: {}, | |||||
| currentSubKey: "",//当前点击的子项key | |||||
| currentType: "",//当前点击的类型 | |||||
| currentRowIndex: "",//当前点击的行索引 | |||||
| }; | |||||
| }, | |||||
| mounted() { | |||||
| const formData = this.getFormDataByTemplateData(); | |||||
| if (this.fillType === "actFill") { | |||||
| this.getCode(formData); | |||||
| } | |||||
| }, | |||||
| methods: { | |||||
| //更新记录 | |||||
| onSureModifyRecord(key) { | |||||
| if (key === "subStartSolution") {//选择起始源溶液需要同步更新table的变更记录。 | |||||
| this.$refs.stepTableRef.updateRecords(); | |||||
| } | |||||
| }, | |||||
| resetRecord() { | |||||
| this.$refs.stepTableRef.resetRecord(); | |||||
| }, | |||||
| // 表单点击 | |||||
| handleFormClickable(obj) { | |||||
| if (this.fillType === "preFill") { | |||||
| return; | |||||
| } | |||||
| console.log(obj) | |||||
| const subKey = obj.subKey; | |||||
| if (subKey === "subStartSolution" || subKey === "subSolution") {//起始源溶液点击事件 | |||||
| this.$refs.selectReagentDialogRef.show(this.formData.id) | |||||
| this.currentSubKey = subKey; | |||||
| this.reagentType = 1; | |||||
| } | |||||
| }, | |||||
| //点击表格单元格 | |||||
| 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(this.formData.id) | |||||
| } | |||||
| }, | |||||
| //选择试剂提交事件 | |||||
| onSelectReagentSubmit(code,row){ | |||||
| if(this.reagentType===1){ | |||||
| this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code); | |||||
| // 实际起始源溶液浓度:根据所选的起始溶液自动回显浓度 | |||||
| if(this.currentSubKey == 'subStartSolution') { | |||||
| this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd + row.nddw); | |||||
| this.updateStepTableData(row); | |||||
| } | |||||
| }else{ | |||||
| this.$refs.stepTableRef.updateDataSourceByRowIndex(this.rowIndex,{ | |||||
| [this.currentSubKey]: code, | |||||
| }) | |||||
| } | |||||
| this.$refs.selectReagentDialogRef.onCancel() | |||||
| }, | |||||
| //更新table数据 | |||||
| updateStepTableData(row) { | |||||
| const { stepTableFormData = [] } = this.$refs.stepTableRef.getFilledFormData(); | |||||
| // 创建新的表格数据副本 | |||||
| const newStepTableData = JSON.parse(JSON.stringify(stepTableFormData)); | |||||
| // 遍历数据,按要求更新起始溶液编号 | |||||
| for (let i = 0; i < newStepTableData.length; i++) { | |||||
| const item = newStepTableData[i]; | |||||
| if (i === 0) { | |||||
| // 第一条记录的起始溶液编号是确认弹框带出来的,也就是row.code字段 | |||||
| newStepTableData[i].startSolutionCode = row.bh; | |||||
| } else { | |||||
| // 第二条的起始溶液编号是第一条数据里面的targetSolutionCode字段, | |||||
| // 第三条的起始溶液编号是第二条数据里面的targetSolutionCode字段,以此类推 | |||||
| newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode + newStepTableData[i - 1].subTargetSolutionCode; | |||||
| } | |||||
| console.log(item, row, 'updateStepTableData') | |||||
| const volResult = this.updateSjmbrynd(item, row.nd); | |||||
| console.log(volResult, 'volResult') | |||||
| if (!volResult) { | |||||
| continue | |||||
| } | |||||
| item.actSolutionVolume = volResult.actVol; | |||||
| item.actSolutionConcentration = volResult.actNd; | |||||
| item.actSolutionExpire = row.sxr; | |||||
| } | |||||
| this.$refs.stepTableRef.updateDataSource(newStepTableData); | |||||
| // 更新tableRef组件的数据 | |||||
| }, | |||||
| //获取目标溶液编号 | |||||
| async getCode(v) { | |||||
| const { stepTableFormData = [] } = v; | |||||
| if (stepTableFormData && stepTableFormData.length > 0 && !stepTableFormData[0].bhCode) { | |||||
| let postSn = [] | |||||
| for (let i = 0; i < stepTableFormData.length; i++) { | |||||
| postSn.push({ | |||||
| pre: stepTableFormData[i].targetSolutionCode, | |||||
| type: 1 | |||||
| }) | |||||
| } | |||||
| const result = await getLatestSnArr(postSn) | |||||
| if (result.code == 200) { | |||||
| for (let i = 0; i < stepTableFormData.length; i++) { | |||||
| this.$refs.stepTableRef.updateDataSourceByRowIndex(i, { | |||||
| subTargetSolutionCode: result.data[i], | |||||
| }) | |||||
| } | |||||
| const params = { | |||||
| type: "fieldChanged", | |||||
| newRecord: null, | |||||
| resourceList: null, | |||||
| } | |||||
| setTimeout(() => { | |||||
| EventBus.$emit('onModifyRecord', params,) | |||||
| }, 10); | |||||
| } | |||||
| } | |||||
| }, | |||||
| //获取已填写的表单数据 | |||||
| getFilledFormData() { | |||||
| return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef","stepTableRef", "stepRef", "remarkRef"]) | |||||
| }, | |||||
| async getFormData() { | |||||
| let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef","stepRef", "remarkRef"]); | |||||
| return content; | |||||
| }, | |||||
| getResource() { | |||||
| let content = this.getFilledFormData(); | |||||
| console.log(content) | |||||
| //生成resource | |||||
| let tmpResource = [] | |||||
| if(this.fillType === "actFill"){ | |||||
| let tableList = content.stepTableFormData | |||||
| if(tableList && tableList.length>0){ | |||||
| for(let i=0;i<tableList.length;i++){ | |||||
| //配置的试剂 | |||||
| let item = tableList[i] | |||||
| console.log('表格item:'+JSON.stringify(item)) | |||||
| //使用的 | |||||
| // 起始溶液 | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: item.startSolutionCode, | |||||
| ph: null, | |||||
| ndz: null, | |||||
| nd: null, | |||||
| nddw: null, | |||||
| ly: 'ELN配制', | |||||
| sxrq: null, | |||||
| kc: null, | |||||
| kcdw: null, | |||||
| syl: item.actStartSolutionVolume, | |||||
| type: 1, | |||||
| elnType: this.product, | |||||
| syldw:content.headerSelectFields.actStartSolutionVolumeUnit, | |||||
| yxzq:null, | |||||
| yxzqdw:null, | |||||
| }) | |||||
| // 稀释液 | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: content.subSolution, | |||||
| ph: null, | |||||
| ndz: null, | |||||
| nd: null, | |||||
| nddw: null, | |||||
| ly: 'ELN配制', | |||||
| sxrq: null, | |||||
| kc: null, | |||||
| kcdw: null, | |||||
| syl: item.actDiluentVolume, | |||||
| type: 1, | |||||
| elnType: this.product, | |||||
| syldw:content.headerSelectFields.actDiluentVolumeUnit, | |||||
| yxzq:null, | |||||
| yxzqdw:null, | |||||
| }) | |||||
| //分装的 | |||||
| let fzTotal = 0//分装总量 | |||||
| if(item.fzsj && item.fzsj.fzList && item.fzsj.fzList.length>0){ | |||||
| for(let j=0;j<item.fzsj.fzList.length;j++){ | |||||
| let fzItem = item.fzsj.fzList[j] | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: item.fzsj.mybh+fzItem.preCode+ fzItem.subCode, | |||||
| ph: null, | |||||
| ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit, | |||||
| nd: item.hhwznd, | |||||
| nddw: content.headerSelectFields.hhwzndUnit, | |||||
| ly: 'ELN配制', | |||||
| sxrq: null, | |||||
| kc: fzItem.num, | |||||
| kcdw: item.fzsj.dw, | |||||
| syl: null, | |||||
| type: null, | |||||
| elnType: this.product, | |||||
| syldw:item.fzsj.dw, | |||||
| yxzq:null, | |||||
| yxzqdw:null, | |||||
| }) | |||||
| fzTotal=addDecimals(fzTotal,fzItem.num) | |||||
| } | |||||
| } | |||||
| //生成的 | |||||
| // const { total, unit } = addTj([item.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit]) | |||||
| const { total, unit } = addTj([item.actStartSolutionVolume, item.actDiluentVolume], [content.headerSelectFields.actStartSolutionVolumeUnit, content.headerSelectFields.actDiluentVolumeUnit]) | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: item.targetSolutionCode+item.subTargetSolutionCode, | |||||
| ph: null, | |||||
| ndz: item.actSolutionConcentration + content.headerSelectFields.actSolutionConcentrationUnit, | |||||
| nd: item.actSolutionConcentration, | |||||
| nddw: content.headerSelectFields.actSolutionConcentrationUnit, | |||||
| ly: 'ELN配制', | |||||
| sxrq: null, | |||||
| kc: total, | |||||
| kcdw: unit, | |||||
| type: null, | |||||
| elnType: this.product, | |||||
| syl: fzTotal>0?fzTotal:null, | |||||
| syldw:fzTotal>0?item.fzsj.dw:unit, | |||||
| yxzq:content.effectivePeriod, | |||||
| yxzqdw:content.effectivePeriodUnit, | |||||
| }) | |||||
| } | |||||
| } | |||||
| } | |||||
| if(tmpResource.length>0){ | |||||
| tmpResource = uniqeResourceOne(tmpResource) | |||||
| } | |||||
| //使用的试剂、仪器 | |||||
| const stepResource = this.$refs.stepRef.getStepResource() | |||||
| this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[]) | |||||
| this.yqResourceTmp = stepResource.yqResource||[] | |||||
| return this.resourceTmp; | |||||
| }, | |||||
| //保存 | |||||
| async onSave() { | |||||
| let content = this.$refs.stepRef.getStepResource(); | |||||
| console.log(content); | |||||
| }, | |||||
| // 删除表格行 | |||||
| deleteRow(rowIndex) { | |||||
| const stepTableRef = this.$refs['stepTableRef']; | |||||
| if (stepTableRef) { | |||||
| stepTableRef.deleteRow(rowIndex); | |||||
| } | |||||
| }, | |||||
| configComplete(val) { | |||||
| if (val.rowData.sjjzxql === '' || val.rowData.sjjzxql === undefined || val.rowData.sjryxql === '' || val.rowData.sjryxql === undefined) { | |||||
| this.$message.error("表格内容未填完") | |||||
| return | |||||
| } | |||||
| console.log("完成配置数据:" + JSON.stringify(val)) | |||||
| const { total, unit } = addTj([val.rowData.sjjzxql, val.rowData.sjryxql], [val.headerSelectFields.sjjzxqlUnit, val.headerSelectFields.sjryxqlUnit]) | |||||
| let postData = { | |||||
| mc: null, | |||||
| studyId: this.formData.studyId, | |||||
| studyFormId: this.formData.id, | |||||
| studySubjectId: this.formData.studySubjectId, | |||||
| bh: val.rowData.bh + val.rowData.bhCode, | |||||
| nd: val.rowData.hhwznd, | |||||
| nddw: val.headerSelectFields.hhwzndUnit, | |||||
| kc: total, | |||||
| kcdw: unit, | |||||
| } | |||||
| console.log("完成配置提交数据:" + JSON.stringify(postData)) | |||||
| sj_configurationCompleted(postData).then(() => { | |||||
| }).catch(() => { | |||||
| }) | |||||
| .finally(() => { | |||||
| }) | |||||
| }, | |||||
| startConfig(val) { | |||||
| console.log("开始配置数据:" + JSON.stringify(val)) | |||||
| let postData = { | |||||
| bh: val.rowData.bh + val.rowData.bhCode, | |||||
| studyId: this.formData.studyId, | |||||
| studyFormId: this.formData.id, | |||||
| studySubjectId: this.formData.studySubjectId, | |||||
| } | |||||
| console.log("开始配置提交数据:" + JSON.stringify(postData)) | |||||
| sj_startConfiguration(postData).then(() => { | |||||
| }).catch(() => { | |||||
| }) | |||||
| .finally(() => { | |||||
| }) | |||||
| }, | |||||
| subPackageSubmit(val) { | |||||
| console.log("分装数据:" + JSON.stringify(val)) | |||||
| if (val.fzsj.fzList && val.fzsj.fzList.length > 0) { | |||||
| let list = [] | |||||
| for (let i = 0; i < val.fzsj.fzList.length; i++) { | |||||
| let item = val.fzsj.fzList[i] | |||||
| list.push({ | |||||
| bh: val.fzsj.mybh + item.preCode, | |||||
| kc: item.num, | |||||
| kcdw: val.fzsj.dw, | |||||
| }) | |||||
| } | |||||
| let postData = { | |||||
| studyId: this.formData.studyId, | |||||
| studyFormId: this.formData.id, | |||||
| studySubjectId: this.formData.studySubjectId, | |||||
| bh: val.fzsj.mybh, | |||||
| nd: val.rowData.hhwznd, | |||||
| nddw: val.headerSelectFields.hhwzndUnit, | |||||
| list: list | |||||
| } | |||||
| console.log("分装提交数据:" + JSON.stringify(postData)) | |||||
| sj_subpackage(postData).then(() => { | |||||
| }).catch(() => { | |||||
| }) | |||||
| .finally(() => { | |||||
| }) | |||||
| } | |||||
| }, | |||||
| } | |||||
| }; | |||||
| </script> | |||||
| <style rel="stylesheet/scss" lang="scss"> | |||||
| .mt-20 { | |||||
| margin-top: 20px; | |||||
| } | |||||
| .print-btn { | |||||
| margin-bottom: 20px; | |||||
| } | |||||
| </style> | |||||
| @ -1,587 +0,0 @@ | |||||
| <!-- PCR生物分析标准曲线制备表 --> | |||||
| <template> | |||||
| <div> | |||||
| <div class="detail-container"> | |||||
| <div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img src="@/assets/images/detail-title.png" /></div> | |||||
| <div class="detail-content"> | |||||
| <div class="content"> | |||||
| <BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" | |||||
| ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" /> | |||||
| <TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" /> | |||||
| <TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" /> | |||||
| <LineLabel label="template.common.operationSteps" /> | |||||
| <div class="template-form-item"> | |||||
| <BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" | |||||
| @clickable="handleFormClickable" | |||||
| @onSureModifyRecord="onSureModifyRecord" | |||||
| @resetRecord="resetRecord" | |||||
| :formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" /> | |||||
| <CustomTable | |||||
| @blur="onHandleTableBlur" | |||||
| :ref="`stepTableRef`" | |||||
| :columns="tableStepColumns" | |||||
| :formData="formData" | |||||
| :prefixKey = "`table`" | |||||
| @clickable="handleClickable" | |||||
| fieldItemLabel = "template.common.operationSteps" | |||||
| > | |||||
| <template slot="operation" slot-scope="{ row, rowIndex, columns }"> | |||||
| <TableOpertaion | |||||
| :fillType="fillType" | |||||
| :row="row" | |||||
| :rowIndex="rowIndex" | |||||
| :columns="columns" | |||||
| @deleteRow="(rowIndex) => deleteRow(rowIndex)" | |||||
| @subPackageSubmit="subPackageSubmit" | |||||
| @startConfig="startConfig" | |||||
| @configComplete="configComplete" | |||||
| ></TableOpertaion> | |||||
| </template> | |||||
| </CustomTable> | |||||
| </div> | |||||
| <Step ref="stepRef" :formData="formData.stepData"></Step> | |||||
| <BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" | |||||
| ref="remarkRef" :formConfig="remarkConig" :formData="formData" /> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| <SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef"> | |||||
| </SelectReagentDialog> | |||||
| <!-- <button @click="onSave">保存</button> --> | |||||
| </div> | |||||
| </template> | |||||
| <script> | |||||
| import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage"; | |||||
| import LineLabel from "@/components/Template/LineLabel"; | |||||
| import TableList from "@/components/Template/Table"; | |||||
| import Step from "@/components/Template/Step"; | |||||
| import templateMixin from "../../mixins/templateMixin.js"; | |||||
| import CustomTable from '@/components/Template/CustomTable.vue'; | |||||
| import { getLatestSnArr } from '@/api/template'; | |||||
| import { EventBus } from "@/utils/eventBus"; | |||||
| import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; | |||||
| import { getLadderColumnsConfig } from "../../formConfig/PCRTableConfig.js"; | |||||
| import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" | |||||
| import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools"; | |||||
| export default { | |||||
| name: "PCR003", | |||||
| components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog }, | |||||
| mixins: [templateMixin], | |||||
| props: { | |||||
| fillType: { | |||||
| type: String, | |||||
| default: 'preFill', | |||||
| }, | |||||
| }, | |||||
| computed: { | |||||
| tableStepColumns() { | |||||
| return getLadderColumnsConfig(this, 'business_pcr_fxbzqxzbb'); | |||||
| }, | |||||
| // 配置条件 | |||||
| storageFormConfig() { | |||||
| return [ | |||||
| { | |||||
| type: "conditionItem", | |||||
| config: { | |||||
| storageCondition: { | |||||
| label: 'template.common.storageConditionLabel', | |||||
| type: "select", | |||||
| fillType: "preFill", | |||||
| options: this.getDictOptions("business_cctj"), | |||||
| multiple: true, | |||||
| 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, | |||||
| }, | |||||
| } | |||||
| }, | |||||
| { | |||||
| 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, | |||||
| compareTo: "pre", | |||||
| options: this.getDictOptions('business_pztj') | |||||
| } | |||||
| } | |||||
| }, | |||||
| { | |||||
| type: "cellItem", | |||||
| label: 'template.common.configurationTime', | |||||
| config: { | |||||
| startDate: { | |||||
| label: 'template.common.startTime', | |||||
| type: "input", | |||||
| }, | |||||
| endDate: { | |||||
| label: 'template.common.endTime', | |||||
| type: "input", | |||||
| }, | |||||
| } | |||||
| } | |||||
| ] | |||||
| }, | |||||
| // 操作步骤表单配置 | |||||
| stepFormConfig() { | |||||
| return [ | |||||
| { | |||||
| type: 'step', | |||||
| config: { | |||||
| startSolution: { | |||||
| label: 'template.pcr.pcr002.qsyry', | |||||
| type: 'input', | |||||
| fillType: 'preFill', | |||||
| subType: 'clickable', | |||||
| subKey: 'subStartSolution', | |||||
| subFillType: 'actFill', | |||||
| maxlength: 20 | |||||
| }, | |||||
| targetStartSolution: { | |||||
| label: 'template.pcr.pcr002.ysqsyrynd', | |||||
| type: 'inputNumber', | |||||
| subType: 'select', | |||||
| fillType: 'preFill', | |||||
| subOptions: this.getDictOptions('business_nddw'), | |||||
| subKey: 'subTargetStartSolution', | |||||
| maxlength: 10 | |||||
| }, | |||||
| targetAcSolution: { | |||||
| label: 'template.pcr.pcr002.sjqsyrynd', | |||||
| type: 'input', | |||||
| fillType: 'actFill', | |||||
| disabled: true, | |||||
| maxlength: 10, | |||||
| compareTo: 'targetStartSolution', //比较哪个字段 | |||||
| }, | |||||
| solution: { | |||||
| label: 'template.pcr.pcr002.xsy', | |||||
| type: 'input', | |||||
| fillType: 'preFill', | |||||
| subType: 'clickable', | |||||
| subKey: 'subSolution', | |||||
| subFillType: 'actFill', | |||||
| maxlength: 20 | |||||
| }, | |||||
| stepStorageCondition: { | |||||
| label: 'template.pcr.pcr002.cctj', | |||||
| type: 'select', | |||||
| fillType: 'preFill', | |||||
| options: this.getDictOptions('business_cctj'), | |||||
| multiple: true, | |||||
| otherCode: 'stepStorageConditionOther' | |||||
| }, | |||||
| effectivePeriod: { | |||||
| label: 'template.pcr.pcr002.mbryyxzq', | |||||
| type: 'input', | |||||
| subType: 'select', | |||||
| subKey: 'effectivePeriodUnit', | |||||
| fillType: 'preFill', | |||||
| subOptions: this.getDictOptions('business_yxqdw') | |||||
| }, | |||||
| expireDate: { | |||||
| label: 'template.pcr.pcr002.mbrysxr', | |||||
| type: 'input' | |||||
| } | |||||
| } | |||||
| } | |||||
| ] | |||||
| }, | |||||
| }, | |||||
| data() { | |||||
| return { | |||||
| reagentType: null, // 1-表单 2-表格 | |||||
| formData: {}, | |||||
| currentSubKey: "",//当前点击的子项key | |||||
| currentType: "",//当前点击的类型 | |||||
| currentRowIndex: "",//当前点击的行索引 | |||||
| }; | |||||
| }, | |||||
| mounted() { | |||||
| const formData = this.getFormDataByTemplateData(); | |||||
| if (this.fillType === "actFill") { | |||||
| this.getCode(formData); | |||||
| } | |||||
| }, | |||||
| methods: { | |||||
| //更新记录 | |||||
| onSureModifyRecord(key) { | |||||
| if (key === "subStartSolution") {//选择起始源溶液需要同步更新table的变更记录。 | |||||
| this.$refs.stepTableRef.updateRecords(); | |||||
| } | |||||
| }, | |||||
| resetRecord() { | |||||
| this.$refs.stepTableRef.resetRecord(); | |||||
| }, | |||||
| // 表单点击 | |||||
| handleFormClickable(obj) { | |||||
| if (this.fillType === "preFill") { | |||||
| return; | |||||
| } | |||||
| console.log(obj) | |||||
| const subKey = obj.subKey; | |||||
| if (subKey === "subStartSolution" || subKey === "subSolution") {//起始源溶液点击事件 | |||||
| this.$refs.selectReagentDialogRef.show(this.formData.id) | |||||
| this.currentSubKey = subKey; | |||||
| this.reagentType = 1; | |||||
| } | |||||
| }, | |||||
| //点击表格单元格 | |||||
| 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(this.formData.id) | |||||
| } | |||||
| }, | |||||
| //选择试剂提交事件 | |||||
| onSelectReagentSubmit(code,row){ | |||||
| if(this.reagentType===1){ | |||||
| this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code); | |||||
| // 实际起始源溶液浓度:根据所选的起始溶液自动回显浓度 | |||||
| if(this.currentSubKey == 'subStartSolution') { | |||||
| this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd + row.nddw); | |||||
| this.updateStepTableData(row); | |||||
| } | |||||
| }else{ | |||||
| this.$refs.stepTableRef.updateDataSourceByRowIndex(this.rowIndex,{ | |||||
| [this.currentSubKey]: code, | |||||
| }) | |||||
| } | |||||
| this.$refs.selectReagentDialogRef.onCancel() | |||||
| }, | |||||
| //更新table数据 | |||||
| updateStepTableData(row) { | |||||
| const { stepTableFormData = [] } = this.$refs.stepTableRef.getFilledFormData(); | |||||
| // 创建新的表格数据副本 | |||||
| const newStepTableData = JSON.parse(JSON.stringify(stepTableFormData)); | |||||
| // 遍历数据,按要求更新起始溶液编号 | |||||
| for (let i = 0; i < newStepTableData.length; i++) { | |||||
| const item = newStepTableData[i]; | |||||
| if (i === 0) { | |||||
| // 第一条记录的起始溶液编号是确认弹框带出来的,也就是row.code字段 | |||||
| newStepTableData[i].startSolutionCode = row.bh; | |||||
| } else { | |||||
| // 第二条的起始溶液编号是第一条数据里面的targetSolutionCode字段, | |||||
| // 第三条的起始溶液编号是第二条数据里面的targetSolutionCode字段,以此类推 | |||||
| newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode + newStepTableData[i - 1].subTargetSolutionCode; | |||||
| } | |||||
| console.log(item, row, 'updateStepTableData') | |||||
| const volResult = this.updateSjmbrynd(item, row.nd); | |||||
| console.log(volResult, 'volResult') | |||||
| if (!volResult) { | |||||
| continue | |||||
| } | |||||
| item.actSolutionVolume = volResult.actVol; | |||||
| item.actSolutionConcentration = volResult.actNd; | |||||
| item.actSolutionExpire = row.sxr; | |||||
| } | |||||
| this.$refs.stepTableRef.updateDataSource(newStepTableData); | |||||
| // 更新tableRef组件的数据 | |||||
| }, | |||||
| //获取目标溶液编号 | |||||
| async getCode(v) { | |||||
| const { stepTableFormData = [] } = v; | |||||
| if (stepTableFormData && stepTableFormData.length > 0 && !stepTableFormData[0].bhCode) { | |||||
| let postSn = [] | |||||
| for (let i = 0; i < stepTableFormData.length; i++) { | |||||
| postSn.push({ | |||||
| pre: stepTableFormData[i].targetSolutionCode, | |||||
| type: 1 | |||||
| }) | |||||
| } | |||||
| const result = await getLatestSnArr(postSn) | |||||
| if (result.code == 200) { | |||||
| for (let i = 0; i < stepTableFormData.length; i++) { | |||||
| this.$refs.stepTableRef.updateDataSourceByRowIndex(i, { | |||||
| subTargetSolutionCode: result.data[i], | |||||
| }) | |||||
| } | |||||
| const params = { | |||||
| type: "fieldChanged", | |||||
| newRecord: null, | |||||
| resourceList: null, | |||||
| } | |||||
| setTimeout(() => { | |||||
| EventBus.$emit('onModifyRecord', params,) | |||||
| }, 10); | |||||
| } | |||||
| } | |||||
| }, | |||||
| //获取已填写的表单数据 | |||||
| getFilledFormData() { | |||||
| return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef","stepTableRef", "stepRef", "remarkRef"]) | |||||
| }, | |||||
| async getFormData() { | |||||
| let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef","stepRef", "remarkRef"]); | |||||
| return content; | |||||
| }, | |||||
| getResource() { | |||||
| let content = this.getFilledFormData(); | |||||
| console.log(content) | |||||
| //生成resource | |||||
| let tmpResource = [] | |||||
| if(this.fillType === "actFill"){ | |||||
| let tableList = content.stepTableFormData | |||||
| if(tableList && tableList.length>0){ | |||||
| for(let i=0;i<tableList.length;i++){ | |||||
| //配置的试剂 | |||||
| let item = tableList[i] | |||||
| console.log('表格item:'+JSON.stringify(item)) | |||||
| //使用的 | |||||
| // 起始溶液 | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: item.startSolutionCode, | |||||
| ph: null, | |||||
| ndz: null, | |||||
| nd: null, | |||||
| nddw: null, | |||||
| ly: 'ELN配制', | |||||
| sxrq: null, | |||||
| kc: null, | |||||
| kcdw: null, | |||||
| syl: item.actStartSolutionVolume, | |||||
| type: 1, | |||||
| elnType: this.product, | |||||
| syldw:content.headerSelectFields.actStartSolutionVolumeUnit, | |||||
| yxzq:null, | |||||
| yxzqdw:null, | |||||
| }) | |||||
| // 稀释液 | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: content.subSolution, | |||||
| ph: null, | |||||
| ndz: null, | |||||
| nd: null, | |||||
| nddw: null, | |||||
| ly: 'ELN配制', | |||||
| sxrq: null, | |||||
| kc: null, | |||||
| kcdw: null, | |||||
| syl: item.actDiluentVolume, | |||||
| type: 1, | |||||
| elnType: this.product, | |||||
| syldw:content.headerSelectFields.actDiluentVolumeUnit, | |||||
| yxzq:null, | |||||
| yxzqdw:null, | |||||
| }) | |||||
| //分装的 | |||||
| let fzTotal = 0//分装总量 | |||||
| if(item.fzsj && item.fzsj.fzList && item.fzsj.fzList.length>0){ | |||||
| for(let j=0;j<item.fzsj.fzList.length;j++){ | |||||
| let fzItem = item.fzsj.fzList[j] | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: item.fzsj.mybh+fzItem.preCode+ fzItem.subCode, | |||||
| ph: null, | |||||
| ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit, | |||||
| nd: item.hhwznd, | |||||
| nddw: content.headerSelectFields.hhwzndUnit, | |||||
| ly: 'ELN配制', | |||||
| sxrq: null, | |||||
| kc: fzItem.num, | |||||
| kcdw: item.fzsj.dw, | |||||
| syl: null, | |||||
| type: null, | |||||
| elnType: this.product, | |||||
| syldw:item.fzsj.dw, | |||||
| yxzq:null, | |||||
| yxzqdw:null, | |||||
| }) | |||||
| fzTotal=addDecimals(fzTotal,fzItem.num) | |||||
| } | |||||
| } | |||||
| //生成的 | |||||
| // const { total, unit } = addTj([item.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit]) | |||||
| const { total, unit } = addTj([item.actStartSolutionVolume, item.actDiluentVolume], [content.headerSelectFields.actStartSolutionVolumeUnit, content.headerSelectFields.actDiluentVolumeUnit]) | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: item.targetSolutionCode+item.subTargetSolutionCode, | |||||
| ph: null, | |||||
| ndz: item.actSolutionConcentration + content.headerSelectFields.actSolutionConcentrationUnit, | |||||
| nd: item.actSolutionConcentration, | |||||
| nddw: content.headerSelectFields.actSolutionConcentrationUnit, | |||||
| ly: 'ELN配制', | |||||
| sxrq: null, | |||||
| kc: total, | |||||
| kcdw: unit, | |||||
| type: null, | |||||
| elnType: this.product, | |||||
| syl: fzTotal>0?fzTotal:null, | |||||
| syldw:fzTotal>0?item.fzsj.dw:unit, | |||||
| yxzq:content.effectivePeriod, | |||||
| yxzqdw:content.effectivePeriodUnit, | |||||
| }) | |||||
| } | |||||
| } | |||||
| } | |||||
| if(tmpResource.length>0){ | |||||
| tmpResource = uniqeResourceOne(tmpResource) | |||||
| } | |||||
| //使用的试剂、仪器 | |||||
| const stepResource = this.$refs.stepRef.getStepResource() | |||||
| this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[]) | |||||
| this.yqResourceTmp = stepResource.yqResource||[] | |||||
| return this.resourceTmp; | |||||
| }, | |||||
| //保存 | |||||
| async onSave() { | |||||
| let content = this.$refs.stepRef.getStepResource(); | |||||
| console.log(content); | |||||
| }, | |||||
| // 删除表格行 | |||||
| deleteRow(rowIndex) { | |||||
| const stepTableRef = this.$refs['stepTableRef']; | |||||
| if (stepTableRef) { | |||||
| stepTableRef.deleteRow(rowIndex); | |||||
| } | |||||
| }, | |||||
| configComplete(val) { | |||||
| if (val.rowData.sjjzxql === '' || val.rowData.sjjzxql === undefined || val.rowData.sjryxql === '' || val.rowData.sjryxql === undefined) { | |||||
| this.$message.error("表格内容未填完") | |||||
| return | |||||
| } | |||||
| console.log("完成配置数据:" + JSON.stringify(val)) | |||||
| const { total, unit } = addTj([val.rowData.sjjzxql, val.rowData.sjryxql], [val.headerSelectFields.sjjzxqlUnit, val.headerSelectFields.sjryxqlUnit]) | |||||
| let postData = { | |||||
| mc: null, | |||||
| studyId: this.formData.studyId, | |||||
| studyFormId: this.formData.id, | |||||
| studySubjectId: this.formData.studySubjectId, | |||||
| bh: val.rowData.bh + val.rowData.bhCode, | |||||
| nd: val.rowData.hhwznd, | |||||
| nddw: val.headerSelectFields.hhwzndUnit, | |||||
| kc: total, | |||||
| kcdw: unit, | |||||
| } | |||||
| console.log("完成配置提交数据:" + JSON.stringify(postData)) | |||||
| sj_configurationCompleted(postData).then(() => { | |||||
| }).catch(() => { | |||||
| }) | |||||
| .finally(() => { | |||||
| }) | |||||
| }, | |||||
| startConfig(val) { | |||||
| console.log("开始配置数据:" + JSON.stringify(val)) | |||||
| let postData = { | |||||
| bh: val.rowData.bh + val.rowData.bhCode, | |||||
| studyId: this.formData.studyId, | |||||
| studyFormId: this.formData.id, | |||||
| studySubjectId: this.formData.studySubjectId, | |||||
| } | |||||
| console.log("开始配置提交数据:" + JSON.stringify(postData)) | |||||
| sj_startConfiguration(postData).then(() => { | |||||
| }).catch(() => { | |||||
| }) | |||||
| .finally(() => { | |||||
| }) | |||||
| }, | |||||
| subPackageSubmit(val) { | |||||
| console.log("分装数据:" + JSON.stringify(val)) | |||||
| if (val.fzsj.fzList && val.fzsj.fzList.length > 0) { | |||||
| let list = [] | |||||
| for (let i = 0; i < val.fzsj.fzList.length; i++) { | |||||
| let item = val.fzsj.fzList[i] | |||||
| list.push({ | |||||
| bh: val.fzsj.mybh + item.preCode, | |||||
| kc: item.num, | |||||
| kcdw: val.fzsj.dw, | |||||
| }) | |||||
| } | |||||
| let postData = { | |||||
| studyId: this.formData.studyId, | |||||
| studyFormId: this.formData.id, | |||||
| studySubjectId: this.formData.studySubjectId, | |||||
| bh: val.fzsj.mybh, | |||||
| nd: val.rowData.hhwznd, | |||||
| nddw: val.headerSelectFields.hhwzndUnit, | |||||
| list: list | |||||
| } | |||||
| console.log("分装提交数据:" + JSON.stringify(postData)) | |||||
| sj_subpackage(postData).then(() => { | |||||
| }).catch(() => { | |||||
| }) | |||||
| .finally(() => { | |||||
| }) | |||||
| } | |||||
| }, | |||||
| } | |||||
| }; | |||||
| </script> | |||||
| <style rel="stylesheet/scss" lang="scss"> | |||||
| .mt-20 { | |||||
| margin-top: 20px; | |||||
| } | |||||
| .print-btn { | |||||
| margin-bottom: 20px; | |||||
| } | |||||
| </style> | |||||
| @ -1,587 +0,0 @@ | |||||
| <!-- PCR生物分析质控样品制备表 --> | |||||
| <template> | |||||
| <div> | |||||
| <div class="detail-container"> | |||||
| <div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img src="@/assets/images/detail-title.png" /></div> | |||||
| <div class="detail-content"> | |||||
| <div class="content"> | |||||
| <BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" | |||||
| ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" /> | |||||
| <TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" /> | |||||
| <TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" /> | |||||
| <LineLabel label="template.common.operationSteps" /> | |||||
| <div class="template-form-item"> | |||||
| <BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" | |||||
| @clickable="handleFormClickable" | |||||
| @onSureModifyRecord="onSureModifyRecord" | |||||
| @resetRecord="resetRecord" | |||||
| :formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" /> | |||||
| <CustomTable | |||||
| @blur="onHandleTableBlur" | |||||
| :ref="`stepTableRef`" | |||||
| :columns="tableStepColumns" | |||||
| :formData="formData" | |||||
| :prefixKey = "`table`" | |||||
| @clickable="handleClickable" | |||||
| fieldItemLabel = "template.common.operationSteps" | |||||
| > | |||||
| <template slot="operation" slot-scope="{ row, rowIndex, columns }"> | |||||
| <TableOpertaion | |||||
| :fillType="fillType" | |||||
| :row="row" | |||||
| :rowIndex="rowIndex" | |||||
| :columns="columns" | |||||
| @deleteRow="(rowIndex) => deleteRow(rowIndex)" | |||||
| @subPackageSubmit="subPackageSubmit" | |||||
| @startConfig="startConfig" | |||||
| @configComplete="configComplete" | |||||
| ></TableOpertaion> | |||||
| </template> | |||||
| </CustomTable> | |||||
| </div> | |||||
| <Step ref="stepRef" :formData="formData.stepData"></Step> | |||||
| <BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" | |||||
| ref="remarkRef" :formConfig="remarkConig" :formData="formData" /> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| <SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef"> | |||||
| </SelectReagentDialog> | |||||
| <!-- <button @click="onSave">保存</button> --> | |||||
| </div> | |||||
| </template> | |||||
| <script> | |||||
| import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage"; | |||||
| import LineLabel from "@/components/Template/LineLabel"; | |||||
| import TableList from "@/components/Template/Table"; | |||||
| import Step from "@/components/Template/Step"; | |||||
| import templateMixin from "../../mixins/templateMixin.js"; | |||||
| import CustomTable from '@/components/Template/CustomTable.vue'; | |||||
| import { getLatestSnArr } from '@/api/template'; | |||||
| import { EventBus } from "@/utils/eventBus"; | |||||
| import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; | |||||
| import { getLadderColumnsConfig } from "../../formConfig/PCRTableConfig.js"; | |||||
| import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" | |||||
| import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools"; | |||||
| export default { | |||||
| name: "PCR004", | |||||
| components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog }, | |||||
| mixins: [templateMixin], | |||||
| props: { | |||||
| fillType: { | |||||
| type: String, | |||||
| default: 'preFill', | |||||
| }, | |||||
| }, | |||||
| computed: { | |||||
| tableStepColumns() { | |||||
| return getLadderColumnsConfig(this, 'business_pcr_fxzkypzbb'); | |||||
| }, | |||||
| // 配置条件 | |||||
| storageFormConfig() { | |||||
| return [ | |||||
| { | |||||
| type: "conditionItem", | |||||
| config: { | |||||
| storageCondition: { | |||||
| label: 'template.common.storageConditionLabel', | |||||
| type: "select", | |||||
| fillType: "preFill", | |||||
| options: this.getDictOptions("business_cctj"), | |||||
| multiple: true, | |||||
| 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, | |||||
| }, | |||||
| } | |||||
| }, | |||||
| { | |||||
| 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, | |||||
| compareTo: "pre", | |||||
| options: this.getDictOptions('business_pztj') | |||||
| } | |||||
| } | |||||
| }, | |||||
| { | |||||
| type: "cellItem", | |||||
| label: 'template.common.configurationTime', | |||||
| config: { | |||||
| startDate: { | |||||
| label: 'template.common.startTime', | |||||
| type: "input", | |||||
| }, | |||||
| endDate: { | |||||
| label: 'template.common.endTime', | |||||
| type: "input", | |||||
| }, | |||||
| } | |||||
| } | |||||
| ] | |||||
| }, | |||||
| // 操作步骤表单配置 | |||||
| stepFormConfig() { | |||||
| return [ | |||||
| { | |||||
| type: 'step', | |||||
| config: { | |||||
| startSolution: { | |||||
| label: 'template.pcr.pcr002.qsyry', | |||||
| type: 'input', | |||||
| fillType: 'preFill', | |||||
| subType: 'clickable', | |||||
| subKey: 'subStartSolution', | |||||
| subFillType: 'actFill', | |||||
| maxlength: 20 | |||||
| }, | |||||
| targetStartSolution: { | |||||
| label: 'template.pcr.pcr002.ysqsyrynd', | |||||
| type: 'inputNumber', | |||||
| subType: 'select', | |||||
| fillType: 'preFill', | |||||
| subOptions: this.getDictOptions('business_nddw'), | |||||
| subKey: 'subTargetStartSolution', | |||||
| maxlength: 10 | |||||
| }, | |||||
| targetAcSolution: { | |||||
| label: 'template.pcr.pcr002.sjqsyrynd', | |||||
| type: 'input', | |||||
| fillType: 'actFill', | |||||
| disabled: true, | |||||
| maxlength: 10, | |||||
| compareTo: 'targetStartSolution', //比较哪个字段 | |||||
| }, | |||||
| solution: { | |||||
| label: 'template.pcr.pcr002.xsy', | |||||
| type: 'input', | |||||
| fillType: 'preFill', | |||||
| subType: 'clickable', | |||||
| subKey: 'subSolution', | |||||
| subFillType: 'actFill', | |||||
| maxlength: 20 | |||||
| }, | |||||
| stepStorageCondition: { | |||||
| label: 'template.pcr.pcr002.cctj', | |||||
| type: 'select', | |||||
| fillType: 'preFill', | |||||
| options: this.getDictOptions('business_cctj'), | |||||
| multiple: true, | |||||
| otherCode: 'stepStorageConditionOther' | |||||
| }, | |||||
| effectivePeriod: { | |||||
| label: 'template.pcr.pcr002.mbryyxzq', | |||||
| type: 'input', | |||||
| subType: 'select', | |||||
| subKey: 'effectivePeriodUnit', | |||||
| fillType: 'preFill', | |||||
| subOptions: this.getDictOptions('business_yxqdw') | |||||
| }, | |||||
| expireDate: { | |||||
| label: 'template.pcr.pcr002.mbrysxr', | |||||
| type: 'input' | |||||
| } | |||||
| } | |||||
| } | |||||
| ] | |||||
| }, | |||||
| }, | |||||
| data() { | |||||
| return { | |||||
| reagentType: null, // 1-表单 2-表格 | |||||
| formData: {}, | |||||
| currentSubKey: "",//当前点击的子项key | |||||
| currentType: "",//当前点击的类型 | |||||
| currentRowIndex: "",//当前点击的行索引 | |||||
| }; | |||||
| }, | |||||
| mounted() { | |||||
| const formData = this.getFormDataByTemplateData(); | |||||
| if (this.fillType === "actFill") { | |||||
| this.getCode(formData); | |||||
| } | |||||
| }, | |||||
| methods: { | |||||
| //更新记录 | |||||
| onSureModifyRecord(key) { | |||||
| if (key === "subStartSolution") {//选择起始源溶液需要同步更新table的变更记录。 | |||||
| this.$refs.stepTableRef.updateRecords(); | |||||
| } | |||||
| }, | |||||
| resetRecord() { | |||||
| this.$refs.stepTableRef.resetRecord(); | |||||
| }, | |||||
| // 表单点击 | |||||
| handleFormClickable(obj) { | |||||
| if (this.fillType === "preFill") { | |||||
| return; | |||||
| } | |||||
| console.log(obj) | |||||
| const subKey = obj.subKey; | |||||
| if (subKey === "subStartSolution" || subKey === "subSolution") {//起始源溶液点击事件 | |||||
| this.$refs.selectReagentDialogRef.show(this.formData.id) | |||||
| this.currentSubKey = subKey; | |||||
| this.reagentType = 1; | |||||
| } | |||||
| }, | |||||
| //点击表格单元格 | |||||
| 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(this.formData.id) | |||||
| } | |||||
| }, | |||||
| //选择试剂提交事件 | |||||
| onSelectReagentSubmit(code,row){ | |||||
| if(this.reagentType===1){ | |||||
| this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code); | |||||
| // 实际起始源溶液浓度:根据所选的起始溶液自动回显浓度 | |||||
| if(this.currentSubKey == 'subStartSolution') { | |||||
| this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd + row.nddw); | |||||
| this.updateStepTableData(row); | |||||
| } | |||||
| }else{ | |||||
| this.$refs.stepTableRef.updateDataSourceByRowIndex(this.rowIndex,{ | |||||
| [this.currentSubKey]: code, | |||||
| }) | |||||
| } | |||||
| this.$refs.selectReagentDialogRef.onCancel() | |||||
| }, | |||||
| //更新table数据 | |||||
| updateStepTableData(row) { | |||||
| const { stepTableFormData = [] } = this.$refs.stepTableRef.getFilledFormData(); | |||||
| // 创建新的表格数据副本 | |||||
| const newStepTableData = JSON.parse(JSON.stringify(stepTableFormData)); | |||||
| // 遍历数据,按要求更新起始溶液编号 | |||||
| for (let i = 0; i < newStepTableData.length; i++) { | |||||
| const item = newStepTableData[i]; | |||||
| if (i === 0) { | |||||
| // 第一条记录的起始溶液编号是确认弹框带出来的,也就是row.code字段 | |||||
| newStepTableData[i].startSolutionCode = row.bh; | |||||
| } else { | |||||
| // 第二条的起始溶液编号是第一条数据里面的targetSolutionCode字段, | |||||
| // 第三条的起始溶液编号是第二条数据里面的targetSolutionCode字段,以此类推 | |||||
| newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode + newStepTableData[i - 1].subTargetSolutionCode; | |||||
| } | |||||
| console.log(item, row, 'updateStepTableData') | |||||
| const volResult = this.updateSjmbrynd(item, row.nd); | |||||
| console.log(volResult, 'volResult') | |||||
| if (!volResult) { | |||||
| continue | |||||
| } | |||||
| item.actSolutionVolume = volResult.actVol; | |||||
| item.actSolutionConcentration = volResult.actNd; | |||||
| item.actSolutionExpire = row.sxr; | |||||
| } | |||||
| this.$refs.stepTableRef.updateDataSource(newStepTableData); | |||||
| // 更新tableRef组件的数据 | |||||
| }, | |||||
| //获取目标溶液编号 | |||||
| async getCode(v) { | |||||
| const { stepTableFormData = [] } = v; | |||||
| if (stepTableFormData && stepTableFormData.length > 0 && !stepTableFormData[0].bhCode) { | |||||
| let postSn = [] | |||||
| for (let i = 0; i < stepTableFormData.length; i++) { | |||||
| postSn.push({ | |||||
| pre: stepTableFormData[i].targetSolutionCode, | |||||
| type: 1 | |||||
| }) | |||||
| } | |||||
| const result = await getLatestSnArr(postSn) | |||||
| if (result.code == 200) { | |||||
| for (let i = 0; i < stepTableFormData.length; i++) { | |||||
| this.$refs.stepTableRef.updateDataSourceByRowIndex(i, { | |||||
| subTargetSolutionCode: result.data[i], | |||||
| }) | |||||
| } | |||||
| const params = { | |||||
| type: "fieldChanged", | |||||
| newRecord: null, | |||||
| resourceList: null, | |||||
| } | |||||
| setTimeout(() => { | |||||
| EventBus.$emit('onModifyRecord', params,) | |||||
| }, 10); | |||||
| } | |||||
| } | |||||
| }, | |||||
| //获取已填写的表单数据 | |||||
| getFilledFormData() { | |||||
| return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef","stepTableRef", "stepRef", "remarkRef"]) | |||||
| }, | |||||
| async getFormData() { | |||||
| let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef","stepRef", "remarkRef"]); | |||||
| return content; | |||||
| }, | |||||
| getResource() { | |||||
| let content = this.getFilledFormData(); | |||||
| console.log(content) | |||||
| //生成resource | |||||
| let tmpResource = [] | |||||
| if(this.fillType === "actFill"){ | |||||
| let tableList = content.stepTableFormData | |||||
| if(tableList && tableList.length>0){ | |||||
| for(let i=0;i<tableList.length;i++){ | |||||
| //配置的试剂 | |||||
| let item = tableList[i] | |||||
| console.log('表格item:'+JSON.stringify(item)) | |||||
| //使用的 | |||||
| // 起始溶液 | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: item.startSolutionCode, | |||||
| ph: null, | |||||
| ndz: null, | |||||
| nd: null, | |||||
| nddw: null, | |||||
| ly: 'ELN配制', | |||||
| sxrq: null, | |||||
| kc: null, | |||||
| kcdw: null, | |||||
| syl: item.actStartSolutionVolume, | |||||
| type: 1, | |||||
| elnType: this.product, | |||||
| syldw:content.headerSelectFields.actStartSolutionVolumeUnit, | |||||
| yxzq:null, | |||||
| yxzqdw:null, | |||||
| }) | |||||
| // 稀释液 | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: content.subSolution, | |||||
| ph: null, | |||||
| ndz: null, | |||||
| nd: null, | |||||
| nddw: null, | |||||
| ly: 'ELN配制', | |||||
| sxrq: null, | |||||
| kc: null, | |||||
| kcdw: null, | |||||
| syl: item.actDiluentVolume, | |||||
| type: 1, | |||||
| elnType: this.product, | |||||
| syldw:content.headerSelectFields.actDiluentVolumeUnit, | |||||
| yxzq:null, | |||||
| yxzqdw:null, | |||||
| }) | |||||
| //分装的 | |||||
| let fzTotal = 0//分装总量 | |||||
| if(item.fzsj && item.fzsj.fzList && item.fzsj.fzList.length>0){ | |||||
| for(let j=0;j<item.fzsj.fzList.length;j++){ | |||||
| let fzItem = item.fzsj.fzList[j] | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: item.fzsj.mybh+fzItem.preCode+ fzItem.subCode, | |||||
| ph: null, | |||||
| ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit, | |||||
| nd: item.hhwznd, | |||||
| nddw: content.headerSelectFields.hhwzndUnit, | |||||
| ly: 'ELN配制', | |||||
| sxrq: null, | |||||
| kc: fzItem.num, | |||||
| kcdw: item.fzsj.dw, | |||||
| syl: null, | |||||
| type: null, | |||||
| elnType: this.product, | |||||
| syldw:item.fzsj.dw, | |||||
| yxzq:null, | |||||
| yxzqdw:null, | |||||
| }) | |||||
| fzTotal=addDecimals(fzTotal,fzItem.num) | |||||
| } | |||||
| } | |||||
| //生成的 | |||||
| // const { total, unit } = addTj([item.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit]) | |||||
| const { total, unit } = addTj([item.actStartSolutionVolume, item.actDiluentVolume], [content.headerSelectFields.actStartSolutionVolumeUnit, content.headerSelectFields.actDiluentVolumeUnit]) | |||||
| tmpResource.push({ | |||||
| mc: null, | |||||
| bh: item.targetSolutionCode+item.subTargetSolutionCode, | |||||
| ph: null, | |||||
| ndz: item.actSolutionConcentration + content.headerSelectFields.actSolutionConcentrationUnit, | |||||
| nd: item.actSolutionConcentration, | |||||
| nddw: content.headerSelectFields.actSolutionConcentrationUnit, | |||||
| ly: 'ELN配制', | |||||
| sxrq: null, | |||||
| kc: total, | |||||
| kcdw: unit, | |||||
| type: null, | |||||
| elnType: this.product, | |||||
| syl: fzTotal>0?fzTotal:null, | |||||
| syldw:fzTotal>0?item.fzsj.dw:unit, | |||||
| yxzq:content.effectivePeriod, | |||||
| yxzqdw:content.effectivePeriodUnit, | |||||
| }) | |||||
| } | |||||
| } | |||||
| } | |||||
| if(tmpResource.length>0){ | |||||
| tmpResource = uniqeResourceOne(tmpResource) | |||||
| } | |||||
| //使用的试剂、仪器 | |||||
| const stepResource = this.$refs.stepRef.getStepResource() | |||||
| this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[]) | |||||
| this.yqResourceTmp = stepResource.yqResource||[] | |||||
| return this.resourceTmp; | |||||
| }, | |||||
| //保存 | |||||
| async onSave() { | |||||
| let content = this.$refs.stepRef.getStepResource(); | |||||
| console.log(content); | |||||
| }, | |||||
| // 删除表格行 | |||||
| deleteRow(rowIndex) { | |||||
| const stepTableRef = this.$refs['stepTableRef']; | |||||
| if (stepTableRef) { | |||||
| stepTableRef.deleteRow(rowIndex); | |||||
| } | |||||
| }, | |||||
| configComplete(val) { | |||||
| if (val.rowData.sjjzxql === '' || val.rowData.sjjzxql === undefined || val.rowData.sjryxql === '' || val.rowData.sjryxql === undefined) { | |||||
| this.$message.error("表格内容未填完") | |||||
| return | |||||
| } | |||||
| console.log("完成配置数据:" + JSON.stringify(val)) | |||||
| const { total, unit } = addTj([val.rowData.sjjzxql, val.rowData.sjryxql], [val.headerSelectFields.sjjzxqlUnit, val.headerSelectFields.sjryxqlUnit]) | |||||
| let postData = { | |||||
| mc: null, | |||||
| studyId: this.formData.studyId, | |||||
| studyFormId: this.formData.id, | |||||
| studySubjectId: this.formData.studySubjectId, | |||||
| bh: val.rowData.bh + val.rowData.bhCode, | |||||
| nd: val.rowData.hhwznd, | |||||
| nddw: val.headerSelectFields.hhwzndUnit, | |||||
| kc: total, | |||||
| kcdw: unit, | |||||
| } | |||||
| console.log("完成配置提交数据:" + JSON.stringify(postData)) | |||||
| sj_configurationCompleted(postData).then(() => { | |||||
| }).catch(() => { | |||||
| }) | |||||
| .finally(() => { | |||||
| }) | |||||
| }, | |||||
| startConfig(val) { | |||||
| console.log("开始配置数据:" + JSON.stringify(val)) | |||||
| let postData = { | |||||
| bh: val.rowData.bh + val.rowData.bhCode, | |||||
| studyId: this.formData.studyId, | |||||
| studyFormId: this.formData.id, | |||||
| studySubjectId: this.formData.studySubjectId, | |||||
| } | |||||
| console.log("开始配置提交数据:" + JSON.stringify(postData)) | |||||
| sj_startConfiguration(postData).then(() => { | |||||
| }).catch(() => { | |||||
| }) | |||||
| .finally(() => { | |||||
| }) | |||||
| }, | |||||
| subPackageSubmit(val) { | |||||
| console.log("分装数据:" + JSON.stringify(val)) | |||||
| if (val.fzsj.fzList && val.fzsj.fzList.length > 0) { | |||||
| let list = [] | |||||
| for (let i = 0; i < val.fzsj.fzList.length; i++) { | |||||
| let item = val.fzsj.fzList[i] | |||||
| list.push({ | |||||
| bh: val.fzsj.mybh + item.preCode, | |||||
| kc: item.num, | |||||
| kcdw: val.fzsj.dw, | |||||
| }) | |||||
| } | |||||
| let postData = { | |||||
| studyId: this.formData.studyId, | |||||
| studyFormId: this.formData.id, | |||||
| studySubjectId: this.formData.studySubjectId, | |||||
| bh: val.fzsj.mybh, | |||||
| nd: val.rowData.hhwznd, | |||||
| nddw: val.headerSelectFields.hhwzndUnit, | |||||
| list: list | |||||
| } | |||||
| console.log("分装提交数据:" + JSON.stringify(postData)) | |||||
| sj_subpackage(postData).then(() => { | |||||
| }).catch(() => { | |||||
| }) | |||||
| .finally(() => { | |||||
| }) | |||||
| } | |||||
| }, | |||||
| } | |||||
| }; | |||||
| </script> | |||||
| <style rel="stylesheet/scss" lang="scss"> | |||||
| .mt-20 { | |||||
| margin-top: 20px; | |||||
| } | |||||
| .print-btn { | |||||
| margin-bottom: 20px; | |||||
| } | |||||
| </style> | |||||
| @ -0,0 +1,188 @@ | |||||
| <template> | |||||
| <div> | |||||
| <!-- 存储弹窗 --> | |||||
| <el-dialog :title="$t('page.business.resource.gyzj.cunchu')" :visible.sync="open" width="800px" append-to-body | |||||
| :close-on-click-modal="false"> | |||||
| <el-form ref="form" :model="form" :rules="rules" label-width="120px" v-if="open"> | |||||
| <div class="sbzdtcma"> <input type="text"> <input type="password" show-password> </div> | |||||
| <el-row> | |||||
| <el-col :span="12"> | |||||
| <el-form-item :label="$t('page.business.resource.gyzj.mc')"> | |||||
| <el-input type="text" v-model="form.mc" maxlength="50" disabled /> | |||||
| </el-form-item> | |||||
| </el-col> | |||||
| <el-col :span="12"> | |||||
| <el-form-item :label="$t('page.business.resource.gyzj.bh')"> | |||||
| <el-input type="text" v-model="form.bh" maxlength="50" disabled /> | |||||
| </el-form-item> | |||||
| </el-col> | |||||
| </el-row> | |||||
| <el-row> | |||||
| <el-col :span="12"> | |||||
| <el-form-item :label="$t('page.business.resource.mjy.ccwz')" prop="ccwz"> | |||||
| <BusinessSelect v-model="form.ccwz" dictType="business_ccwz" @change="ccwzChange"></BusinessSelect> | |||||
| </el-form-item> | |||||
| </el-col> | |||||
| <el-col :span="12"> | |||||
| <el-form-item :label="$t('page.business.resource.mjy.cctj')" prop="cctj"> | |||||
| <BusinessSelect v-model="form.cctj" dictType="business_cctj" :multiple="true"></BusinessSelect> | |||||
| </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="12"> | |||||
| <el-form-item :label="$t('page.business.resource.gyzj.qmr1Id')"> | |||||
| <el-input type="text" v-model="nickName" maxlength="50" disabled /> | |||||
| </el-form-item> | |||||
| </el-col> | |||||
| <el-col :span="12"> | |||||
| <el-form-item :label="$t('page.business.resource.gyzj.qmr1Id') + $t('form.password')" prop="qmr1mm"> | |||||
| <el-input type="password" show-password v-model="form.qmr1mm" maxlength="20" | |||||
| :placeholder="$t('form.placeholderInput')" /> | |||||
| </el-form-item> | |||||
| </el-col> | |||||
| </el-row> | |||||
| <el-row> | |||||
| <el-col :span="12"> | |||||
| <el-form-item :label="$t('page.business.resource.gyzj.qmr2Id')" prop="qmr2Id"> | |||||
| <SelectDeptUser v-model="form.qmr2Id" key="qmr2Id" /> | |||||
| </el-form-item> | |||||
| </el-col> | |||||
| <el-col :span="12"> | |||||
| <el-form-item :label="$t('page.business.resource.gyzj.qmr2Id') + $t('form.password')" prop="qmr2mm"> | |||||
| <el-input type="password" show-password v-model="form.qmr2mm" maxlength="20" | |||||
| :placeholder="$t('form.placeholderInput')" /> | |||||
| </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.qmyyMc" maxlength="50" disabled /> | |||||
| </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 { cc } from "@/api/business/gsp/gsp" | |||||
| import { mapGetters } from 'vuex' | |||||
| import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser'; | |||||
| import BusinessSelect from '@/views/business/comps/select/BusinessSelect'; | |||||
| export default { | |||||
| name: "Cc", | |||||
| components: { SelectDeptUser, BusinessSelect }, | |||||
| data() { | |||||
| return { | |||||
| isBatch: false, | |||||
| ids: [], | |||||
| selectList: [], | |||||
| open: false, | |||||
| form: {}, | |||||
| rules: { | |||||
| ccwz: [{ | |||||
| required: true, | |||||
| message: ' ', | |||||
| trigger: 'blur' | |||||
| }], | |||||
| cctj: [{ | |||||
| required: true, | |||||
| message: ' ', | |||||
| trigger: 'blur' | |||||
| }], | |||||
| qmr1Id: [{ | |||||
| required: true, | |||||
| message: ' ', | |||||
| trigger: 'blur' | |||||
| }], | |||||
| qmr1mm: [{ | |||||
| required: true, | |||||
| message: ' ', | |||||
| trigger: 'blur' | |||||
| }], | |||||
| qmr2Id: [{ | |||||
| required: true, | |||||
| message: ' ', | |||||
| trigger: 'blur' | |||||
| }], | |||||
| qmr2mm: [{ | |||||
| required: true, | |||||
| message: ' ', | |||||
| trigger: 'blur' | |||||
| }] | |||||
| } | |||||
| } | |||||
| }, | |||||
| computed: { | |||||
| ...mapGetters([ | |||||
| 'nickName', 'name' | |||||
| ]), | |||||
| }, | |||||
| created() { | |||||
| }, | |||||
| methods: { | |||||
| ccwzChange(val){ | |||||
| this.form.cctj=val.wc | |||||
| }, | |||||
| cancel() { | |||||
| this.open = false | |||||
| }, | |||||
| reset() { | |||||
| this.form = { | |||||
| id: null, | |||||
| cctj: '', | |||||
| mc:'', | |||||
| bh:'', | |||||
| remark: '', | |||||
| qmr1Id: '', | |||||
| qmr1mm: '', | |||||
| qmr2Id: '', | |||||
| qmr2mm: '', | |||||
| remark: '', | |||||
| ccwz: '', | |||||
| qmyyMc: this.$t('page.business.resource.gyzj.cunchu'), | |||||
| } | |||||
| this.resetForm("form") | |||||
| }, | |||||
| show(row) { | |||||
| this.reset() | |||||
| this.form.id = row.resourceId | |||||
| this.form.bh = row.bh | |||||
| this.form.mc = row.mc | |||||
| this.open = true | |||||
| }, | |||||
| save() { | |||||
| this.$refs["form"].validate(valid => { | |||||
| if (valid) { | |||||
| this.$modal.loading() | |||||
| cc(this.form).then(response => { | |||||
| this.open = false | |||||
| this.$emit('callback') | |||||
| this.$modal.closeLoading() | |||||
| }).finally(() => { | |||||
| this.$modal.closeLoading() | |||||
| }) | |||||
| } | |||||
| }) | |||||
| } | |||||
| } | |||||
| } | |||||
| </script> | |||||
| @ -0,0 +1,237 @@ | |||||
| <template> | |||||
| <!-- 详情 --> | |||||
| <div v-if="open"> | |||||
| <div class="detail-container"> | |||||
| <div class="detail-top"> | |||||
| <div class="left-top"> | |||||
| <img src="@/assets/images/back.png" @click="cancel()" /> | |||||
| <div class="left-title"></div> | |||||
| </div> | |||||
| <div class="right-top"> | |||||
| <el-button @click="cancel()">{{ $t('form.cancel') }}</el-button> | |||||
| <el-button @click="exportExcel()">{{ $t('form.export') }}</el-button> | |||||
| </div> | |||||
| </div> | |||||
| <div class="detail-title"><img src="@/assets/images/detail-title.png">{{ $t('page.business.resource.gyzj.gyzjxq') | |||||
| }}<img src="@/assets/images/detail-title.png" /></div> | |||||
| <div class="detail-content"> | |||||
| <div class="content-left"> | |||||
| <div class="content-title"> | |||||
| <div class="line"></div> | |||||
| <div class="subtitle"> {{ $t('page.business.resource.gyzj.jbxx') }}</div> | |||||
| </div> | |||||
| <div class="pal"> | |||||
| <div class="left"> | |||||
| <div class="left-title">{{ $t('page.business.resource.gyzj.mc') }}</div> | |||||
| <el-input type="text" :value="form.mc" maxlength="50" disabled /> | |||||
| </div> | |||||
| <div class="right"> | |||||
| <div class="right-title">{{ $t('page.business.resource.gyzj.bh') }}</div> | |||||
| <el-input type="text" :value="form.bh" maxlength="50" disabled /> | |||||
| </div> | |||||
| </div> | |||||
| <div class="pal"> | |||||
| <div class="left"> | |||||
| <div class="left-title">{{ $t('page.business.resource.gyzj.nd') }}</div> | |||||
| <el-input type="text" :value="form.nd" maxlength="50" disabled> <template slot="append">{{ | |||||
| form.nddw }}</template> | |||||
| </el-input> | |||||
| </div> | |||||
| <div class="right"> | |||||
| <div class="right-title">{{ $t('page.business.resource.gyzj.kcl') }}</div> | |||||
| <el-input type="text" :value="form.kc" maxlength="50" disabled> <template slot="append">{{ | |||||
| form.kcdw }}</template> </el-input> | |||||
| </div> | |||||
| </div> | |||||
| <div class="pal"> | |||||
| <div class="left"> | |||||
| <div class="left-title">{{ $t('page.business.resource.gyzj.sxrq') }}</div> | |||||
| <el-input type="text" :value="form.sxrq" maxlength="50" disabled /> | |||||
| </div> | |||||
| <div class="right"> | |||||
| <div class="right-title">{{ $t('page.business.resource.gyzj.cctj') }}</div> | |||||
| <el-input type="text" :value="form.cctj" maxlength="50" disabled /> | |||||
| </div> | |||||
| </div> | |||||
| <div class="pal"> | |||||
| <div class="left"> | |||||
| <div class="left-title">{{ $t('page.business.resource.gyzj.ccwz') }}</div> | |||||
| <el-input type="text" :value="form.ccwz" maxlength="50" disabled /> | |||||
| </div> | |||||
| <div class="right"> | |||||
| <div class="right-title">{{ $t('page.business.resource.gyzj.zjzt') }}</div> | |||||
| <el-select v-model="form.zjzt" disabled style="width: 100%;"> | |||||
| <el-option key="1" :label="$t('page.business.resource.resource.zjzt.rk')" :value="1" /> | |||||
| <el-option key="2" :label="$t('page.business.resource.resource.zjzt.wrk')" :value="2" /> | |||||
| <el-option key="3" :label="$t('page.business.resource.resource.zjzt.yff')" :value="3" /> | |||||
| <el-option key="5" :label="$t('page.business.resource.resource.zjzt.ysd')" :value="5" /> | |||||
| <el-option key="7" :label="$t('page.business.resource.resource.zjzt.dgd')" :value="7" /> | |||||
| <el-option key="9" :label="$t('page.business.resource.resource.zjzt.gd')" :value="9" /> | |||||
| <el-option key="11" :label="$t('page.business.resource.resource.zjzt.djd')" :value="11" /> | |||||
| </el-select> | |||||
| </div> | |||||
| </div> | |||||
| <div class="content-title"> | |||||
| <div class="line"></div> | |||||
| <div class="subtitle"> {{ $t('page.business.resource.gyzj.bdxx') }} </div> | |||||
| </div> | |||||
| <div class="pal"> | |||||
| <div class="left"> | |||||
| <div class="left-title">{{ $t('page.business.resource.gyzj.sssy') }}</div> | |||||
| <el-input type="text" :value="form.studyMc" maxlength="50" disabled /> | |||||
| </div> | |||||
| <div class="right"> | |||||
| <div class="right-title">{{ $t('page.business.resource.gyzj.ssbd') }}</div> | |||||
| <el-input type="text" :value="form.bdMc" maxlength="50" disabled /> | |||||
| </div> | |||||
| </div> | |||||
| <div class="pal"> | |||||
| <div class="left"> | |||||
| <div class="left-title">{{ $t('page.business.resource.gyzj.bdssr') }}</div> | |||||
| <el-input type="text" :value="form.bdgsrMc" maxlength="50" disabled /> | |||||
| </div> | |||||
| </div> | |||||
| <div class="content-title"> | |||||
| <div class="line"></div> | |||||
| <div class="subtitle"> {{ $t('page.business.resource.gyzj.tz') }}</div> | |||||
| </div> | |||||
| <div class="pal"> | |||||
| <el-table :data="tzList" v-loading="loadingTz"> | |||||
| <el-table-column :label="$t('page.business.resource.gyzj.syr')" align="center" | |||||
| :show-overflow-tooltip="true"> | |||||
| <template slot-scope="scope"> | |||||
| {{ scope.row.qmrMc }} | |||||
| </template> | |||||
| </el-table-column> | |||||
| <el-table-column :label="$t('page.business.resource.gyzj.lqghr')" align="center" | |||||
| :show-overflow-tooltip="true" width="200px"> | |||||
| <template slot-scope="scope"> | |||||
| {{ scope.row.lqrMc }}{{ scope.row.ghrMc }} | |||||
| </template> | |||||
| </el-table-column> | |||||
| <el-table-column :label="$t('page.business.resource.gyzj.ffjsr')" align="center" | |||||
| :show-overflow-tooltip="true"> | |||||
| <template slot-scope="scope"> | |||||
| {{ scope.row.ffrMc }}{{ scope.row.jsrMc }} | |||||
| </template> | |||||
| </el-table-column> | |||||
| <el-table-column :label="$t('page.business.resource.gyzj.czlx')" align="center" | |||||
| :prop="$i18n.locale === 'zh_CN' ? 'qmyy' : 'qmyyEn'" width="100" /> | |||||
| <el-table-column :label="$t('page.business.resource.gyzj.bdmc')" align="center" | |||||
| prop="bdMc" width="100" :show-overflow-tooltip="true"/> | |||||
| <el-table-column :label="$t('page.business.resource.gyzj.czl')" align="center" | |||||
| :show-overflow-tooltip="true"> | |||||
| <template slot-scope="scope"> | |||||
| {{ scope.row.czl }}{{ scope.row.czldw }} | |||||
| </template> | |||||
| </el-table-column> | |||||
| <el-table-column :label="$t('page.business.resource.gyzj.bzyy')" align="center" prop="remark" | |||||
| :show-overflow-tooltip="true" /> | |||||
| <el-table-column :label="$t('page.business.resource.gyzj.ccsj')" align="center" prop="createTime" | |||||
| width="150px" /> | |||||
| </el-table> | |||||
| </div> | |||||
| <div class="pal"> | |||||
| <pagination v-show="totalTz > 0" :total="totalTz" :page.sync="queryParamstZ.pageNum" | |||||
| :limit.sync="queryParamstZ.pageSize" @pagination="getTzList" /> | |||||
| </div> | |||||
| </div> | |||||
| <div class="content-right"> | |||||
| <div class="content-title"> | |||||
| <div class="line"></div> | |||||
| <div class="subtitle"> {{ $t('page.business.resource.gyzj.jcgj') }}</div> | |||||
| </div> | |||||
| <jcgjList ref="jcgjList" @handleQuery="getJjcgjList" /> | |||||
| <pagination v-show="jcgjTotal > 0" small layout="prev, pager, next" :total="jcgjTotal" | |||||
| @pagination="getJjcgjList" /> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| </template> | |||||
| <script> | |||||
| import { info, tzList, jcgjList,exportDetail } from "@/api/business/gyzj/gyzj" | |||||
| import JcgjList from "@/views/business/comps/common/JcgjList"; | |||||
| export default { | |||||
| name: "Xq", | |||||
| components: { JcgjList }, | |||||
| data() { | |||||
| return { | |||||
| form: {}, | |||||
| appTitle: process.env.VUE_APP_TITLE, | |||||
| tzList: [], | |||||
| totalTz: 0, | |||||
| loadingTz: true, | |||||
| open: false, | |||||
| queryParamstZ: { | |||||
| gyzjId: null, | |||||
| pageNum: 1, | |||||
| pageSize: 10 | |||||
| }, | |||||
| jcgjTotal: 0, | |||||
| jcgjList: [], | |||||
| queryJcgjParams: { | |||||
| pageNum: 1, | |||||
| gyzjId: null, | |||||
| pageSize: 10, | |||||
| } | |||||
| } | |||||
| }, | |||||
| created() { | |||||
| }, | |||||
| methods: { | |||||
| exportExcel() { | |||||
| this.$modal.loading() | |||||
| exportDetail({ id: this.form.id,lang:this.$store.getters.language.split("_")[0],version:this.appTitle }).then(response => { | |||||
| window.open(process.env.VUE_APP_FILE_DOMAIN +response.msg) | |||||
| this.$modal.closeLoading() | |||||
| }).finally(() => { | |||||
| this.$modal.closeLoading() | |||||
| }) | |||||
| }, | |||||
| getJjcgjList(val) { | |||||
| this.$modal.loading() | |||||
| jcgjList(_.merge({}, this.queryJcgjParams, val)).then(response => { | |||||
| this.jcgjList = response.rows | |||||
| this.jcgjTotal = response.total | |||||
| this.$refs.jcgjList.init(this.jcgjList) | |||||
| this.$modal.closeLoading() | |||||
| }).finally(() => { | |||||
| this.$modal.closeLoading() | |||||
| }) | |||||
| }, | |||||
| cancel() { | |||||
| this.open = false | |||||
| this.$emit('callback') | |||||
| }, | |||||
| getTzList() { | |||||
| this.loadingTz = true | |||||
| tzList(this.queryParamstZ).then(response => { | |||||
| this.tzList = response.rows | |||||
| this.totalTz = response.total | |||||
| this.loadingTz = false | |||||
| this.getJjcgjList() | |||||
| }) | |||||
| }, | |||||
| show(row) { | |||||
| this.$modal.loading() | |||||
| this.queryParamstZ.gyzjId = row.id | |||||
| this.queryJcgjParams.gyzjId = row.id | |||||
| this.$modal.loading() | |||||
| info({ id: row.id }).then(response => { | |||||
| this.form = response.data | |||||
| this.open = true | |||||
| this.getTzList() | |||||
| this.saveSimpleLog({name:row.bh,nameEn:row.bh,jcmc:'给药制剂详情',jcmcEn:'Formulation Detail'}) | |||||
| }).finally(() => { | |||||
| this.$modal.closeLoading() | |||||
| }) | |||||
| } | |||||
| } | |||||
| } | |||||
| </script> | |||||