Browse Source

feat: [模板管理] 分装步骤的试剂抓取,细胞/细菌类型修改

zhangteng
memorylkf 3 days ago
parent
commit
b9fa28f4af
4 changed files with 89 additions and 29 deletions
  1. +2
    -2
      src/components/Template/HandleFormItem.vue
  2. +55
    -0
      src/components/Template/StepFormPackage.vue
  3. +21
    -16
      src/utils/index.js
  4. +11
    -11
      src/views/business/comps/template/dialog/SelectMixReagentDialog.vue

+ 2
- 2
src/components/Template/HandleFormItem.vue View File

@ -641,8 +641,8 @@ export default {
mix: "1",//// mix: "1",////
gyzj: "3",// gyzj: "3",//
mjy: "5",// mjy: "5",//
xj: "9",//
xb: "11",//
xb: "9",//
xj: "11",//
jcb: "13",// jcb: "13",//
qxbd: "15",// qxbd: "15",//
} }

+ 55
- 0
src/components/Template/StepFormPackage.vue View File

@ -235,6 +235,61 @@ export default {
getSjResource(){ getSjResource(){
const {allFieldsConfig,formFields} = this; const {allFieldsConfig,formFields} = this;
const sjResource = [],yqResource = []; const sjResource = [],yqResource = [];
if(formFields && formFields.fzInfo){
let fzInfo = formFields.fzInfo
let myInfo = fzInfo.myInfo || {};
let fzList = fzInfo.fzList || [];
let myCount = 0
//
if(fzList.length>0){
for(let j=0;j<fzList.length;j++){
let fzItem = fzList[j]
myCount+= parseFloat(fzItem.num || 0);
sjResource.push({
mc: null,
bh: fzItem.preCode,
ph: null,
ndz: myInfo.ndz,
nd: myInfo.nd,
nddw: myInfo.nddw,
ly: 'ELN配制',
sxrq: myInfo.sxrq,
kc: fzItem.num,
kcdw: fzInfo.dw,
syl: null,
type: myInfo.elnType,
elnType: myInfo.elnType,
syldw: fzInfo.dw,
yxzq:myInfo.yxzq,
yxzqdw:myInfo.yxzqdw,
value:fzItem.preCode,
})
}
}
//使
sjResource.push({
mc: null,
bh: fzInfo.mybh,
ph: null,
ndz: myInfo.ndz,
nd: myInfo.nd,
nddw: myInfo.nddw,
ly: 'ELN配制',
sxrq: myInfo.sxrq,
kc: myInfo.maxVolume,
kcdw: myInfo.maxVolumeUnit,
syl: myCount,
type: myInfo.elnType,
elnType: myInfo.elnType,
syldw: fzInfo.dw,
yxzq:myInfo.yxzq,
yxzqdw:myInfo.yxzqdw,
value:fzInfo.mybh,
})
}
for(const key in allFieldsConfig){ for(const key in allFieldsConfig){
const item = allFieldsConfig[key]; const item = allFieldsConfig[key];
if(item.type === "xj" || item.type === "xb" || item.type === "sj" || item.type === "gsp" || item.type === "mix"){ if(item.type === "xj" || item.type === "xb" || item.type === "sj" || item.type === "gsp" || item.type === "mix"){

+ 21
- 16
src/utils/index.js View File

@ -1,7 +1,7 @@
import { parseTime } from './ruoyi' import { parseTime } from './ruoyi'
import { encrypt, decrypt } from '@/utils/encryptUtil' import { encrypt, decrypt } from '@/utils/encryptUtil'
import moment from 'moment' import moment from 'moment'
import {EventBus} from './eventBus'
import { EventBus } from './eventBus'
/** /**
* 表格时间格式化 * 表格时间格式化
*/ */
@ -419,8 +419,8 @@ export const getExpireDate = (
effectivePeriod, effectivePeriod,
effectivePeriodUnit effectivePeriodUnit
) => { ) => {
if(effectivePeriod === "NA" || effectivePeriodUnit === "NA"){
return "NA";
if (effectivePeriod === 'NA' || effectivePeriodUnit === 'NA') {
return 'NA'
} }
const start = moment(startDate) const start = moment(startDate)
const unit = effectivePeriodUnit === '天' ? 'days' : 'hours' const unit = effectivePeriodUnit === '天' ? 'days' : 'hours'
@ -436,7 +436,12 @@ export function getuuid() {
// 判断值是否为空 // 判断值是否为空
export function isValueEmpty(value) { export function isValueEmpty(value) {
if (value === null || value === undefined || value === '' || value === false) {
if (
value === null ||
value === undefined ||
value === '' ||
value === false
) {
return true return true
} }
if (typeof value === 'string' && value.trim() === '') { if (typeof value === 'string' && value.trim() === '') {
@ -446,7 +451,7 @@ export function isValueEmpty(value) {
return true return true
} }
if (Object.keys(value).length === 0 && typeof value == 'object') { if (Object.keys(value).length === 0 && typeof value == 'object') {
return true;
return true
} }
return false return false
} }
@ -591,31 +596,31 @@ export function getStringWidth(str) {
//根据选项获取默认值,为了 //根据选项获取默认值,为了
export const getDefaultValueByOptions = (options = []) => { export const getDefaultValueByOptions = (options = []) => {
const arr = [];
options.forEach(item => {
const { children = [], label } = item;
const arr = []
options.forEach((item) => {
const { children = [], label } = item
//目前只考虑2层,也不考虑label值重复的问题; //目前只考虑2层,也不考虑label值重复的问题;
if (children.length > 0) { if (children.length > 0) {
children.forEach(child => {
children.forEach((child) => {
arr.push({ label: child.label, checked: undefined }) arr.push({ label: child.label, checked: undefined })
}) })
} else { } else {
arr.push({ label, checked: undefined }) arr.push({ label, checked: undefined })
} }
}) })
return arr;
return arr
} }
// 只是更新已填写的表单数据,不触发其他事件 // 只是更新已填写的表单数据,不触发其他事件
export const justUpdateFilledFormData = () => { export const justUpdateFilledFormData = () => {
const params = { const params = {
type: "fieldChanged",
type: 'fieldChanged',
newRecord: null, newRecord: null,
resourceList: null,
resourceList: null
} }
EventBus.$emit('onModifyRecord', params,)
EventBus.$emit('onModifyRecord', params)
} }
export const formatNumberByDigits =(num, digits = 3)=> {
return num.toString().padStart(digits, '0');
}
export const formatNumberByDigits = (num, digits = 3) => {
return num.toString().padStart(digits, '0')
}

+ 11
- 11
src/views/business/comps/template/dialog/SelectMixReagentDialog.vue View File

@ -37,6 +37,12 @@ const typeMap = {
listApi: public_sjList, listApi: public_sjList,
title:"选择试剂" title:"选择试剂"
}, },
"3": {
searchForm: getGyzjSearchForm(),
columns: getGyzjColumns(),
listApi: public_gyzjList,
title:"选择给药制剂"
},
'7': { '7': {
searchForm: getGspSearchForm(), searchForm: getGspSearchForm(),
columns: getGspColumns(), columns: getGspColumns(),
@ -44,22 +50,16 @@ const typeMap = {
title:"选择供试品" title:"选择供试品"
}, },
"9": { "9": {
searchForm: getXjSearchForm(),
columns: getXjColumns(),
listApi: public_xjList,
title:"选择细菌"
},
"11": {
searchForm: getXbSearchForm(), searchForm: getXbSearchForm(),
columns: getXbColumns(), columns: getXbColumns(),
listApi: public_xbList, listApi: public_xbList,
title:"选择细胞" title:"选择细胞"
}, },
"3": {
searchForm: getGyzjSearchForm(),
columns: getGyzjColumns(),
listApi: public_gyzjList,
title:"选择给药制剂"
"11": {
searchForm: getXjSearchForm(),
columns: getXjColumns(),
listApi: public_xjList,
title:"选择细菌"
}, },
"13": { "13": {
searchForm: getJcbSearchForm(), searchForm: getJcbSearchForm(),

Loading…
Cancel
Save