diff --git a/src/api/business/public/public.js b/src/api/business/public/public.js index 96d3658..f8d8b6a 100644 --- a/src/api/business/public/public.js +++ b/src/api/business/public/public.js @@ -131,3 +131,11 @@ export function public_saveSimpleLog(query) { params: query }) } +// 检测板 +export function public_jcbList(query) { + return request({ + url: '/system/business/public/jcbList', + method: 'get', + params: query + }) +} diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue index 2a28bb0..d901325 100644 --- a/src/components/Template/HandleFormItem.vue +++ b/src/components/Template/HandleFormItem.vue @@ -203,7 +203,7 @@ export default { visible: false,//是否显示弹窗 checkboxValue: this.getChecked(),//是否选中 uuid: getuuid(), // 唯一标识符,用于EventBus事件匹配 - regentType: ['sj', 'gsp', 'mix', 'xj', 'xb', 'gyzj', 'mjy', 'yq'], //试剂/仪器/供试品等类型 + regentType: ['sj', 'gsp', 'mix', 'xj', 'xb', 'gyzj', 'mjy', 'yq','jcb'], //试剂/仪器/供试品等类型 selectRegentInfo: {},//选择的试剂/仪器/供试品等信息 fileList: [],//上传的文件列表 uploadFileUrl: process.env.VUE_APP_BASE_API + "/file/upload", @@ -352,6 +352,7 @@ export default { mjy: "5",//麻精药 xj: "9",//细菌 xb: "11",//细胞 + jcb: "13",//检测板 } params = { ...params, diff --git a/src/lang/en/template/commonTemplate.js b/src/lang/en/template/commonTemplate.js index 550f11f..d8846ac 100644 --- a/src/lang/en/template/commonTemplate.js +++ b/src/lang/en/template/commonTemplate.js @@ -46,6 +46,7 @@ export default { // 按钮 saveBtn: 'Save', + addBtn: 'Add', deleteBtn: 'Delete', // 错误提示 diff --git a/src/lang/en/template/gsp.js b/src/lang/en/template/gsp.js index 2e7308c..4b80a04 100644 --- a/src/lang/en/template/gsp.js +++ b/src/lang/en/template/gsp.js @@ -31,5 +31,9 @@ export default { // 毒麻药品配制记录表 DMYPPZJLB:{ + }, + GSP003:{ + calcConditionLabel:'计算公式', + sfxyzjfx:'是否需要制剂分析' } } diff --git a/src/lang/en/template/lba.js b/src/lang/en/template/lba.js index 8f775b7..69ae582 100644 --- a/src/lang/en/template/lba.js +++ b/src/lang/en/template/lba.js @@ -4,10 +4,26 @@ export default { lba002: { cztj: 'Work Condition', czsj: 'Work Time', - jcbmc: 'Analysis Plate Name' + jcbmc: 'Analysis Plate Name', + cjr: 'Creator', + cjsj: 'Creation Date' }, lba003: { jclc: 'Testing Process', fj: 'Attachment' + }, + lba004: { + xbxx: 'Analysis Plate Information', + ypxx: 'Sample Information', + xszj: '稀释组件', + xz: 'Add', + sc: 'Delete', + jzmc: '基质名称', + xh: '序号', + xsbs: '稀释倍数', + ysypjrz: '预设样品加入值', + sjypjrz: '实际样品加入值', + ysjzjrz: '预设基质加入值', + sjjzjrz: '实际基质加入值' } } diff --git a/src/lang/zh/template/commonTemplate.js b/src/lang/zh/template/commonTemplate.js index fe037a2..4c709ff 100644 --- a/src/lang/zh/template/commonTemplate.js +++ b/src/lang/zh/template/commonTemplate.js @@ -46,6 +46,7 @@ export default { // 按钮 + addBtn: '新增', saveBtn: '保存', deleteBtn: '刪除', diff --git a/src/lang/zh/template/gsp.js b/src/lang/zh/template/gsp.js index 256abf7..041f338 100644 --- a/src/lang/zh/template/gsp.js +++ b/src/lang/zh/template/gsp.js @@ -31,5 +31,9 @@ export default { // 毒麻药品配制记录表 DMYPPZJLB:{ + }, + GSP003:{ + calcConditionLabel:'计算公式', + sfxyzjfx:'是否需要制剂分析' } } diff --git a/src/lang/zh/template/lba.js b/src/lang/zh/template/lba.js index 191723f..ef20ee2 100644 --- a/src/lang/zh/template/lba.js +++ b/src/lang/zh/template/lba.js @@ -4,10 +4,26 @@ export default { lba002: { cztj: '操作条件', czsj: '操作时间', - jcbmc: '检测板名称' + jcbmc: '检测板名称', + cjr: '创建人', + cjsj: '创建时间' }, lba003: { jclc: '检测流程', fj: '附件' + }, + lba004: { + xbxx: '选板信息', + ypxx: '样品信息', + xszj: '稀释组件', + xz: '新增', + sc: '删除', + jzmc: '基质名称', + xh: '序号', + xsbs: '稀释倍数', + ysypjrz: '预设样品加入值', + sjypjrz: '实际样品加入值', + ysjzjrz: '预设基质加入值', + sjjzjrz: '实际基质加入值' } } diff --git a/src/views/business/comps/template/TemplateTable.vue b/src/views/business/comps/template/TemplateTable.vue index a700d38..7d696ed 100644 --- a/src/views/business/comps/template/TemplateTable.vue +++ b/src/views/business/comps/template/TemplateTable.vue @@ -41,6 +41,7 @@ import SP017 from "./comps/sp/SWYPFXFFXYPZBB/SP017.vue"; import SP018 from "./comps/sp/SWYPFXFFXYPZBB/SP018.vue"; import Demo from "./comps/sp/Demo.vue"; //供试品 +import GSP003 from "./comps/gsp/GSP003.vue"; //试验物质配制计划表/麻精药领取申请单/毒麻药品配制记录表 import SYWZPZJHB from "./comps/gsp/SYWZPZJHB.vue"; @@ -55,6 +56,7 @@ import PCR002 from "./comps/pcr/PCR002.vue"; // LBA001-使用SP001 import LBA002 from "./comps/lba/LBA002.vue"; import LBA003 from "./comps/lba/LBA003.vue"; +import LBA004 from "./comps/lba/LBA004.vue"; //ADA // ADA001-使用SP001 @@ -72,13 +74,15 @@ export default { //试验物质配制计划表/麻精药领取申请单/毒麻药品配制记录表 MJYLQSQD, SYWZPZJHB, DMYPPZJLB, //供试品 + GSP003, //色谱 SP001, SP003, SP00456,SP007, SP008, SP009, SP010, SP011, SP012, SP013, SP014, SP015, SP016, SP017, SP018, // PCR PCR002, //LBA LBA002, - LBA003 + LBA003, + LBA004 }, props: { sn: { @@ -123,6 +127,8 @@ export default { 'SP017': 'SP017', 'SP018': 'SP018', //供试品 + 'GSP001': 'DMYPPZJLB', + 'GSP003': 'GSP003', //试验物质配制计划表/麻精药领取申请单/毒麻药品配制记录表 'SYWZPZJHB': 'SYWZPZJHB', 'MJYLQSQD': 'MJYLQSQD', @@ -134,6 +140,7 @@ export default { 'LBA001': 'SP001', 'LBA002': 'LBA002', 'LBA003': 'LBA003', + 'LBA004': 'LBA004', //ADA 'ADA001': 'SP001', 'ADA002': 'LBA002', diff --git a/src/views/business/comps/template/comps/gsp/DMYPPZJLB.vue b/src/views/business/comps/template/comps/gsp/DMYPPZJLB.vue index 96af2f0..75888b4 100644 --- a/src/views/business/comps/template/comps/gsp/DMYPPZJLB.vue +++ b/src/views/business/comps/template/comps/gsp/DMYPPZJLB.vue @@ -2,31 +2,49 @@ @@ -41,6 +59,7 @@ import { getLatestSn } from '@/api/template'; import { EventBus } from "@/utils/eventBus"; import { uniqeResource } from "@/utils/calUnitTools"; import { debounce } from 'lodash-es' +import { duplicateResource, getExpireDate } from "@/utils/index.js"; export default { name: "DMYPPZJLB", @@ -249,13 +268,32 @@ export default { }, mounted() { const formData = this.getFormDataByTemplateData(); - if(!formData.targetCodeSn&& this.fillType === "actFill"){ + if (!formData.targetCodeSn && this.fillType === "actFill") { this.getCode(formData); + } else { + if (!this.formData.formConfigs) { + this.$set(this.formData, 'formConfigs', []); + this.formData.formConfigs.push({ + formConfigs: [], + }); + } } - }, methods: { - //打印标签 + //新增 + handleAddFormConfig() { + if (!this.formData.formConfigs) { + this.$set(this.formData, 'formConfigs', []); + } + this.formData.formConfigs.push({ + formConfigs: [], + }); + }, + //删除 + handleDeleteFormConfig(index) { + this.formData.formConfigs.splice(index, 1); + }, + //todo 打印标签 printTag() { const printConfig = this.getBasePrintConfig(); const { storageCondition, targetCodeSn } = this.formData; @@ -264,58 +302,123 @@ export default { EventBus.$emit('showTagPrintDialog', { printConfig }) }, - //获取目标溶液编号 + //填报获取编号 getCode: debounce(async function (v) { - const result = await getLatestSn({ - count: 1, - pre:v.targetCode, - type:1 - }) - if (result.code == 200) { - this.$refs.stepFormPackageRef.updateFormData("targetCodeSn", result.data[0]) + if (this.formData.formConfigs && this.formData.formConfigs.length > 0) { + for (let i = 0; i < this.formData.formConfigs.length; i++) { + let item = this.formData.formConfigs[i] + const result = await getLatestSn({ + count: 1, + pre: item.targetCode, + type: 1 + }) + if (result.code == 200) { + this.$refs[`formConfigStepFormPackageRef_${i}`][0].updateFormData("targetCodeSn", result.data[0]) + } + } } }, 100), - //获取已填写的表单数据 + //获取字段值,不检验 getFilledFormData() { - return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"]) + const baseData = this.$refs.baseInfoRef.getFilledFormData(); + const conditionData = this.$refs.storageConditionRef.getFilledFormData(); + const formConfigsData = []; + if (this.formData.formConfigs && this.formData.formConfigs.length > 0) { + for (let i = 0; i < this.formData.formConfigs.length; i++) { + const formData = this.$refs[`formConfigStepFormPackageRef_${i}`][0].getFilledFormData(); + const stepData = this.$refs[`formStepRef_${i}`][0].getFilledFormData(); + if(this.formData.startDate&&formData.effectivePeriod&&formData.effectivePeriodUnit){ + formData.expireDate=getExpireDate(this.formData.startDate, formData.effectivePeriod, formData.effectivePeriodUnit) + } + formConfigsData.push({ + ...formData, + ...stepData, + }); + } + } + const remarkData = this.$refs.remarkRef.getFilledFormData(); + return { + ...baseData, + ...conditionData, + formConfigs: formConfigsData, + ...remarkData + } + }, + //检验 + async validFields() { + // 构建需要验证的引用数组 + let refsToValidate = ["baseInfoRef", "storageConditionRef", "remarkRef"]; + + if (this.formData.formConfigs && this.formData.formConfigs.length > 0) { + for (let i = 0; i < this.formData.formConfigs.length; i++) { + refsToValidate.push(`formConfigStepFormPackageRef_${i}`); + refsToValidate.push(`formStepRef_${i}`); + } + } + + return await this.validFormFields(refsToValidate); }, - //获取填写完成的表单数据 + //获取字段值 async getFormData() { - let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"]); + //先校验再获取值 + const validFlag = await this.validFields(); + if (!validFlag) { + return false; + } + let content = this.getFilledFormData(); + return content; + }, + //获取生成,使用物资 + getResource() { + let content = this.getFilledFormData(); //生成resource let tmpResource = [] if (this.fillType === "actFill") { - //配置的试剂 - tmpResource.push({ - mc: content.targetName, - bh: content.targetCode + content.targetCodeSn, - ph: '', - ndz: content.targetActConcentration + content.targetActConcentrationUnit, - nd: content.targetActConcentration, - nddw: content.targetActConcentrationUnit, - ly: 'ELN配制', - sxrq: content.expireDate, - kc: content.targetActVolume, - kcdw: content.targetActVolumeUnit, - syl: null, - type: null, - elnType: this.product, - syldw: content.targetActVolumeUnit, - yxzq: content.effectivePeriod, - yxzqdw: content.effectivePeriodUnit, - }) + let tableList = content.formConfigs + if (tableList && tableList.length > 0) { + for (let i = 0; i < tableList.length; i++) { + let item = tableList[i] + tmpResource.push({ + mc: item.targetName, + bh: item.targetCode + item.targetCodeSn, + ph: '', + ndz: item.targetActConcentration + item.targetActConcentrationUnit, + nd: item.targetActConcentration, + nddw: item.targetActConcentrationUnit, + ly: 'ELN配制', + sxrq: item.expireDate, + kc: item.targetActVolume, + kcdw: item.targetActVolumeUnit, + syl: null, + type: null, + elnType: this.product, + syldw: item.targetActVolumeUnit, + yxzq: item.effectivePeriod, + yxzqdw: item.effectivePeriodUnit, + }) + } + } } //使用的试剂、仪器 - const stepResource = this.$refs.stepRef.getStepResource() - this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[]) - this.yqResourceTmp = stepResource.yqResource||[] - return content; + const stepResource = this.getStepResource() + this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || []) + this.yqResourceTmp = stepResource.yqResource || [] + debugger + return this.resourceTmp; }, - //保存 - async onSave() { - let content =await this.$refs.stepRef.getFormData(); - console.log(content); - + //获取步骤使用物资 + getStepResource() { + const sjResource = [], yqResource = []; + if (this.formData.formConfigs && this.formData.formConfigs.length > 0) { + for (let i = 0; i < this.formData.formConfigs.length; i++) { + const paralleResource = this.$refs[`formStepRef_${i}`][0].getStepResource(); + sjResource.push(...paralleResource.sjResource); + yqResource.push(...paralleResource.yqResource); + } + } + //去重 + const { sj, yq } = duplicateResource(sjResource, yqResource) + return { sjResource: sj, yqResource: yq }; }, } }; @@ -328,4 +431,13 @@ export default { .print-btn { margin-bottom: 20px; } + +.config-header-right { + margin-bottom: 15px; + font-weight: bold; + font-size: 16px; + color: #303133; + text-align: right; + width: 100%; +} \ No newline at end of file diff --git a/src/views/business/comps/template/comps/gsp/GSP003.vue b/src/views/business/comps/template/comps/gsp/GSP003.vue new file mode 100644 index 0000000..27bc800 --- /dev/null +++ b/src/views/business/comps/template/comps/gsp/GSP003.vue @@ -0,0 +1,473 @@ + + + + + \ No newline at end of file diff --git a/src/views/business/comps/template/comps/lba/LBA002.vue b/src/views/business/comps/template/comps/lba/LBA002.vue index 95c515b..267750e 100644 --- a/src/views/business/comps/template/comps/lba/LBA002.vue +++ b/src/views/business/comps/template/comps/lba/LBA002.vue @@ -21,8 +21,9 @@ :formData="formData" :prefixKey = "`table`" fieldItemLabel = "template.common.operationSteps" + :showOperation="fillType === 'preFill'" > -