Browse Source

Merge branch 'master' into ouqian_test

ouqian
ouqian 1 month ago
parent
commit
1e49620d19
32 changed files with 1227 additions and 159 deletions
  1. +9
    -21
      src/components/Template/BaseInfoFormPackage.vue
  2. +3
    -0
      src/components/Template/CustomTable.vue
  3. +290
    -53
      src/components/Template/HandleFormItem.vue
  4. +40
    -3
      src/components/Template/Step.vue
  5. +1
    -1
      src/components/Template/StepComponents/ry/fy.vue
  6. +101
    -1
      src/components/Template/StepComponents/ry/jd.vue
  7. +2
    -2
      src/components/Template/StepComponents/ry/lx.vue
  8. +91
    -0
      src/components/Template/StepComponents/swypfx/hhspe.vue
  9. +67
    -0
      src/components/Template/StepComponents/swypfx/jryp.vue
  10. +79
    -0
      src/components/Template/StepComponents/swypfx/zyfc.vue
  11. +6
    -6
      src/components/Template/StepFormPackage.vue
  12. +1
    -0
      src/components/Template/mixins/formPackageMixins.js
  13. +18
    -0
      src/lang/en/template/pcr.js
  14. +3
    -4
      src/lang/zh/template/dl.js
  15. +18
    -0
      src/lang/zh/template/pcr.js
  16. +18
    -1
      src/utils/index.js
  17. +4
    -2
      src/views/business/comps/template/TemplateTable.vue
  18. +1
    -0
      src/views/business/comps/template/comps/dl/DL016.vue
  19. +1
    -0
      src/views/business/comps/template/comps/dl/DL017.vue
  20. +1
    -0
      src/views/business/comps/template/comps/dl/DL018.vue
  21. +1
    -0
      src/views/business/comps/template/comps/dl/DL019.vue
  22. +5
    -10
      src/views/business/comps/template/comps/dl/DL021.vue
  23. +38
    -25
      src/views/business/comps/template/comps/pcr/PCR005.vue
  24. +277
    -0
      src/views/business/comps/template/comps/pcr/PCR007.vue
  25. +15
    -10
      src/views/business/comps/template/comps/sp/SP0020.vue
  26. +2
    -2
      src/views/business/comps/template/dialog/ImportExcelDialog.vue
  27. +6
    -1
      src/views/business/comps/template/dialog/SelectMixReagentDialog.vue
  28. +64
    -0
      src/views/business/comps/template/formConfig/PCRTableConfig.js
  29. +2
    -2
      src/views/business/comps/template/formConfig/sp/SP0019.js
  30. +51
    -7
      src/views/business/comps/template/formConfig/sp/SP0020.js
  31. +4
    -1
      src/views/business/comps/template/mixins/templateMixin.js
  32. +8
    -7
      src/views/business/study/comp/tbbd/Bj.vue

+ 9
- 21
src/components/Template/BaseInfoFormPackage.vue View File

@ -92,7 +92,7 @@
<div v-show="isShowOther(formFields[key])" class="flex flex1 ml-10"> <div v-show="isShowOther(formFields[key])" class="flex flex1 ml-10">
<div class="other-title" v-if="isShowOtherLabel(sItem)">{{ sItem.otherLabel ? $t(sItem.otherLabel) : <div class="other-title" v-if="isShowOtherLabel(sItem)">{{ sItem.otherLabel ? $t(sItem.otherLabel) :
$t("template.common.other") }}</div> $t("template.common.other") }}</div>
<div class="flex">
<div class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" <HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.otherCode" @blur="onBlur(key, $event)" :field-key="prefixKey + '_' + sItem.otherCode" @blur="onBlur(key, $event)"
:item="getOtherItem(sItem)" v-model="formFields[sItem.otherCode]" :item="getOtherItem(sItem)" v-model="formFields[sItem.otherCode]"
@ -125,14 +125,6 @@
@update:error="errors[key] = false" @resetRecord="resetRecord(key)" :item="sItem" @update:error="errors[key] = false" @resetRecord="resetRecord(key)" :item="sItem"
:value="formFields[key]" /> :value="formFields[key]" />
</div> </div>
<div v-else-if="sItem.type === 'checkboxList'" class="flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="checkboxList" :item="sItem" :value="formFields[key]"
@copy="onCopy(sItem, key)" @change="(e) => onAttachmentChange(key, e)"
:error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" />
</div>
<div v-else-if="isRegent(sItem)" class="flex1"> <div v-else-if="isRegent(sItem)" class="flex1">
<HandleFormItem <HandleFormItem
@beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, key)" @beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, key)"
@ -194,7 +186,7 @@
<div v-show="isShowOther(formFields[key])" class="flex flex1 ml-10"> <div v-show="isShowOther(formFields[key])" class="flex flex1 ml-10">
<div class="other-title" v-if="isShowOtherLabel(sItem)">{{ sItem.otherLabel ? $t(sItem.otherLabel) : <div class="other-title" v-if="isShowOtherLabel(sItem)">{{ sItem.otherLabel ? $t(sItem.otherLabel) :
$t("template.common.other") }}</div> $t("template.common.other") }}</div>
<div class="flex">
<div class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" <HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.otherCode" @blur="onBlur(key, $event)" :field-key="prefixKey + '_' + sItem.otherCode" @blur="onBlur(key, $event)"
:item="getOtherItem(sItem)" v-model="formFields[sItem.otherCode]" :item="getOtherItem(sItem)" v-model="formFields[sItem.otherCode]"
@ -293,12 +285,6 @@
@update:error="errors[key] = false" @resetRecord="resetRecord(key)" :item="sItem" @update:error="errors[key] = false" @resetRecord="resetRecord(key)" :item="sItem"
:value="formFields[key]" /> :value="formFields[key]" />
</div> </div>
<div v-else-if="sItem.type === 'checkboxList'" class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="checkboxList" :item="sItem" :value="formFields[key]" @copy="onCopy(sItem, key)"
@change="(e) => onAttachmentChange(key, e)" :error="errors[key]"
@update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" />
</div>
<div v-else-if="isRegent(sItem)" class="flex item-center flex1"> <div v-else-if="isRegent(sItem)" class="flex item-center flex1">
<HandleFormItem :field-item-label="fieldItemLabel" sourceFrom="baseInfoFormPackage" <HandleFormItem :field-item-label="fieldItemLabel" sourceFrom="baseInfoFormPackage"
@beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, key)" @beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, key)"
@ -313,15 +299,17 @@
</div> </div>
</template> </template>
<template v-else-if="item.type === 'checkboxList'"> <template v-else-if="item.type === 'checkboxList'">
<div class="form-item ">
<div class="form-item " >
<div class="form-title fs-16" v-if="item.label">{{ $t(item.label) }}</div> <div class="form-title fs-16" v-if="item.label">{{ $t(item.label) }}</div>
<div v-for="(sItem, key) in item.config" class="c-Item grid-container"> <div v-for="(sItem, key) in item.config" class="c-Item grid-container">
<div class="p-r-20 item-center">
<div class="p-r-20 item-center" :class="sItem.span == 1 ? 'full-row' : ''">
<div class="form-title mr-20">{{ $t(sItem.label) }}</div> <div class="form-title mr-20">{{ $t(sItem.label) }}</div>
<div class="flex flex1"> <div class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="checkboxList" :item="sItem" :value="formFields[key]"
@copy="onCopy(sItem, key)" @change="(e) => onAttachmentChange(key, e)"
<HandleFormItem
v-if="sItem.type === 'checkboxList' || sItem.type === 'checkboxTree'"
:field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
:type="sItem.type" :item="sItem" :value="formFields[key]"
@change="(e) => onAttachmentChange(key, e)"
:error="errors[key]" @update:error="errors[key] = false" :error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" /> :orange-bg="orangeBgFields[key]" />
</div> </div>

+ 3
- 0
src/components/Template/CustomTable.vue View File

@ -777,6 +777,9 @@ export default {
if (col.bodyDisabled) { if (col.bodyDisabled) {
item.disabled = col.bodyDisabled; item.disabled = col.bodyDisabled;
} }
if (col.qxbdType) {
item.qxbdType = col.qxbdType;
}
// checkboxLabel - // checkboxLabel -
const dynamicLabelKey = col.prop + 'Label'; const dynamicLabelKey = col.prop + 'Label';
if (currentItem && currentItem[dynamicLabelKey]) { if (currentItem && currentItem[dynamicLabelKey]) {

+ 290
- 53
src/components/Template/HandleFormItem.vue View File

@ -42,12 +42,38 @@
</el-checkbox> </el-checkbox>
<div v-if="isShowCheckboxListOther(option)"> <div v-if="isShowCheckboxListOther(option)">
<el-input v-model="checkboxListValue.otherValues[option.otherCode]" <el-input v-model="checkboxListValue.otherValues[option.otherCode]"
:class="{ 'error-border': isOtherInputError(option.otherCode) }"
:placeholder="option.otherPlaceholder || '请输入'" @blur="onCheckboxListOtherBlur($event, option.otherCode)"/>
:class="{ 'error-border': isOtherInputError(option.otherCode) }"
:placeholder="option.otherPlaceholder || '请输入'"
@blur="onCheckboxListOtherBlur($event, option.otherCode)" />
</div> </div>
</div> </div>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
<div v-else-if="type === 'checkboxTree'" class="flex1 checkbox-list-container"
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')">
<div v-for="group in item.options" :key="group.value" class="checkbox-tree-group">
<el-checkbox :label="group.value" :disabled="getDisabled()"
:value="getCheckboxTreeChecked(group.value)"
:indeterminate="getCheckboxTreeIndeterminate(group.value)"
@change="onCheckboxTreeParentChange(group, $event)">
{{ group.label }}
</el-checkbox>
<div v-if="group.children && group.children.length > 0" class="checkbox-tree-children">
<div v-for="child in group.children" :key="child.value" class="checkbox-tree-item">
<el-checkbox :label="child.value" :disabled="getDisabled()"
:value="getCheckboxTreeChecked(child.value)"
@change="onCheckboxTreeChildChange(group, child.value, $event)">
{{ child.label }}
</el-checkbox>
<div v-if="(child.value === '样品信息' || child.value === '其他') && isCheckboxTreeChecked(child.value)"
class="checkbox-tree-input-container">
<el-input v-model="inputValue.otherValues[child.value]"
placeholder="请输入" @blur="onCheckboxTreeOtherBlur(child.value, $event)" />
</div>
</div>
</div>
</div>
</div>
<el-date-picker v-else-if="type === 'dateTime'" type="datetime" class="flex1" <el-date-picker v-else-if="type === 'dateTime'" type="datetime" class="flex1"
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue"
:disabled="getDisabled()" format="yyyy/MM/dd HH:mm:ss" :placeholder="getPlaceholder()" :disabled="getDisabled()" format="yyyy/MM/dd HH:mm:ss" :placeholder="getPlaceholder()"
@ -87,7 +113,8 @@
<div slot="tip" class="el-upload__tip">支持扩展名.rar .zip .doc .docx .pdf .jpg文件大小不超过2MB</div> <div slot="tip" class="el-upload__tip">支持扩展名.rar .zip .doc .docx .pdf .jpg文件大小不超过2MB</div>
</el-upload> </el-upload>
</template> </template>
<div v-else-if="type === 'checkboxTag'" class="flex1 checkbox-tag-wrapper" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')">
<div v-else-if="type === 'checkboxTag'" class="flex1 checkbox-tag-wrapper"
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')">
<div v-for="(tag, tagIndex) in checkboxTagList" :key="tagIndex" class="checkbox-tag-container"> <div v-for="(tag, tagIndex) in checkboxTagList" :key="tagIndex" class="checkbox-tag-container">
<div class="checkbox-tag-item"> <div class="checkbox-tag-item">
<el-checkbox v-model="tag.checked" :disabled="getDisabled()" <el-checkbox v-model="tag.checked" :disabled="getDisabled()"
@ -95,8 +122,8 @@
<div class="tag-content blue-border"> <div class="tag-content blue-border">
<el-input v-if="templateFillType === 'preFill'" v-model="tag.tagValue" <el-input v-if="templateFillType === 'preFill'" v-model="tag.tagValue"
:ref="'tagInput_' + tagIndex" :maxlength="item.maxlength || 20" :ref="'tagInput_' + tagIndex" :maxlength="item.maxlength || 20"
@blur="onTagBlur(tagIndex)" @keyup.enter.native="onTagBlur(tagIndex)"
placeholder="请输入" size="mini" class="tag-input" />
@blur="onTagBlur(tagIndex)" @keyup.enter.native="onTagBlur(tagIndex)" placeholder="请输入"
size="mini" class="tag-input" />
<el-tag v-else :type="'info'" class="tag-display" :closable="false"> <el-tag v-else :type="'info'" class="tag-display" :closable="false">
{{ tag.tagValue }} {{ tag.tagValue }}
</el-tag> </el-tag>
@ -110,13 +137,16 @@
</div> </div>
</div> </div>
<div v-else-if="type === 'fqyq'" :class="getFillTypeStyle()"> <div v-else-if="type === 'fqyq'" :class="getFillTypeStyle()">
<el-radio-group v-model="fqyqValue.mainRadio" :disabled="getDisabled()" @input="onFqyqRadioChange($event,'mainRadio')">
<el-radio-group v-model="fqyqValue.mainRadio" :disabled="getDisabled()"
@input="onFqyqRadioChange($event, 'mainRadio')">
<div class="item-center mb-10"> <div class="item-center mb-10">
<el-radio label="是"></el-radio> <el-radio label="是"></el-radio>
<div class="item-center" v-if="fqyqValue.mainRadio === '是'"> <div class="item-center" v-if="fqyqValue.mainRadio === '是'">
<el-input class="fqyq-input" maxlength="100" v-model="fqyqValue.inputValue" :disabled="getDisabled()" placeholder="请输入" @blur="onFqyqInputBlur" ></el-input>
<el-input class="fqyq-input" maxlength="100" v-model="fqyqValue.inputValue"
:disabled="getDisabled()" placeholder="请输入" @blur="onFqyqInputBlur"></el-input>
<div class="fs-14 mr-10">是否在规定时间完成</div> <div class="fs-14 mr-10">是否在规定时间完成</div>
<el-radio-group v-model="fqyqValue.subRadio" :disabled="getDisabled()" @input="onFqyqRadioChange($event,'subRadio')">
<el-radio-group v-model="fqyqValue.subRadio" :disabled="getDisabled()"
@input="onFqyqRadioChange($event, 'subRadio')">
<el-radio label="是"></el-radio> <el-radio label="是"></el-radio>
<el-radio label="否"></el-radio> <el-radio label="否"></el-radio>
</el-radio-group> </el-radio-group>
@ -197,7 +227,7 @@ import moment from "moment";
import { deepClone } from "@/utils/index"; import { deepClone } from "@/utils/index";
import { getuuid } from "@/utils/index.js"; import { getuuid } from "@/utils/index.js";
import { getToken } from "@/utils/auth" import { getToken } from "@/utils/auth"
import { isValueEmpty } from '@/utils/index.js';
import { isValueEmpty, getDefaultValueByOptions } from '@/utils/index.js';
export default { export default {
inject: ['templateData', 'templateFillType', "getZdxgjl", "getFhyjjl", "updateZdxgjl", "replaceFhyjjl", "updateFhyjjl", "getFieldCheckObj", "updateFieldCheckObj"], inject: ['templateData', 'templateFillType', "getZdxgjl", "getFhyjjl", "updateZdxgjl", "replaceFhyjjl", "updateFhyjjl", "getFieldCheckObj", "updateFieldCheckObj"],
@ -256,14 +286,15 @@ export default {
}, },
data() { data() {
let initialValue = this.value; let initialValue = this.value;
console.log(this.value, "check value");
let initialOtherValues = {}, checkboxTagList = []; let initialOtherValues = {}, checkboxTagList = [];
if(this.type === 'checkboxList' && !this.value) {
if (this.type === 'checkboxList' && !this.value) {
initialValue = { initialValue = {
checkboxValues: [], checkboxValues: [],
otherValues: {} otherValues: {}
}; };
} else if (this.type === 'checkboxTag' && Array.isArray(this.value)) { } else if (this.type === 'checkboxTag' && Array.isArray(this.value)) {
// checkboxTagvalue // checkboxTagvalue
checkboxTagList = this.value.map(tag => ({ checkboxTagList = this.value.map(tag => ({
@ -271,11 +302,14 @@ export default {
tagValue: tag.tagValue || '' tagValue: tag.tagValue || ''
})); }));
} else if (this.type === 'fqyq' && !this.value) { } else if (this.type === 'fqyq' && !this.value) {
initialValue = {mainRadio: '', subRadio: '',inputValue:""};
initialValue = { mainRadio: '', subRadio: '', inputValue: "" };
} else if (this.type === 'checkboxTree' && !this.value) {
const defaultCheckedValue = getDefaultValueByOptions(this.item.options || []);
initialValue = { checkedValues: defaultCheckedValue, otherValues: {} };
} }
return { return {
inputValue: initialValue, inputValue: initialValue,
oldValue: initialValue, //
oldValue: typeof initialValue === 'object' ? JSON.parse(JSON.stringify(initialValue)) : initialValue, //
showModal: false, // showModal: false, //
modificationRecords: [], // modificationRecords: [], //
modalTimer: null, // modalTimer: null, //
@ -288,7 +322,7 @@ export default {
checkboxTagList: checkboxTagList, // checkboxTag checkboxTagList: checkboxTagList, // checkboxTag
oldCheckboxTagList: JSON.parse(JSON.stringify(checkboxTagList)), // checkboxTagList oldCheckboxTagList: JSON.parse(JSON.stringify(checkboxTagList)), // checkboxTagList
fqyqValue: initialValue, // fqyq fqyqValue: initialValue, // fqyq
oldFqyqValue: {...initialValue}, // fqyq
oldFqyqValue: { ...initialValue }, // fqyq
checkboxListValue: initialValue, // checkboxList checkboxListValue: initialValue, // checkboxList
oldCheckboxListValue: JSON.parse(JSON.stringify(initialValue)), // checkboxList oldCheckboxListValue: JSON.parse(JSON.stringify(initialValue)), // checkboxList
uuid: getuuid(), // EventBus uuid: getuuid(), // EventBus
@ -301,13 +335,16 @@ export default {
}, },
pendingUploadFile: null, // pendingUploadFile: null, //
pendingRemoveFile: null, // pendingRemoveFile: null, //
currentTagIndex:-1,//checkboxTag
currentHandleType:'',//
currentOtherCode:'',//otherCode
currentTagIndex: -1,//checkboxTag
currentHandleType: '',//
currentOtherCode: '',//otherCode
currentCheckboxTreeValue: '',//checkboxTree
} }
}, },
watch: { watch: {
value(newVal) { value(newVal) {
console.log(newVal, "newVal")
if (this.type === 'checkboxList' && newVal && typeof newVal === 'object') { if (this.type === 'checkboxList' && newVal && typeof newVal === 'object') {
this.checkboxListValue = JSON.parse(JSON.stringify(newVal)); this.checkboxListValue = JSON.parse(JSON.stringify(newVal));
} else if (this.type === 'checkboxTag' && Array.isArray(newVal)) { } else if (this.type === 'checkboxTag' && Array.isArray(newVal)) {
@ -324,7 +361,7 @@ export default {
subRadio: newVal.subRadio || '' subRadio: newVal.subRadio || ''
}; };
} else { } else {
this.inputValue = newVal;
this.inputValue = typeof newVal === 'object' ? JSON.parse(JSON.stringify(newVal)) : newVal;
} }
} }
}, },
@ -360,7 +397,7 @@ export default {
}, },
methods: { methods: {
getFlexClass() { getFlexClass() {
const noFlexArr = ["radio", "checkboxTag","fqyq"]
const noFlexArr = ["radio", "checkboxTag", "fqyq"]
return noFlexArr.includes(this.type) ? '' : 'flex1' return noFlexArr.includes(this.type) ? '' : 'flex1'
}, },
getDecimalDigits() { getDecimalDigits() {
@ -598,6 +635,8 @@ export default {
}; };
if (type === "mix") { if (type === "mix") {
params.mixType = true; params.mixType = true;
} else if (item.qxbdType) {
params.qxbdType = item.qxbdType;
} }
} }
EventBus.$emit(eventName, params) EventBus.$emit(eventName, params)
@ -679,7 +718,7 @@ export default {
}, },
getFillTypeStyle(type) { getFillTypeStyle(type) {
const { fillType } = this.item; const { fillType } = this.item;
const filterType = ["attachment","checkboxTag","fqyq"]
const filterType = ["attachment", "checkboxTag", "fqyq", "checkboxTree"]
const typeObj = { const typeObj = {
actFill: "orange-border",// actFill: "orange-border",//
green: "green-border", green: "green-border",
@ -821,7 +860,7 @@ export default {
}, },
// checkboxList // checkboxList
isShowCheckboxListOther(option) { isShowCheckboxListOther(option) {
const {checkboxValues } = this.checkboxListValue
const { checkboxValues } = this.checkboxListValue
if (!checkboxValues) { if (!checkboxValues) {
return false; return false;
} }
@ -880,6 +919,148 @@ export default {
this.checkboxListValue.otherValues[otherCode] = e.target.value; this.checkboxListValue.otherValues[otherCode] = e.target.value;
this.onCommonHandleSaveRecord(e.target.value); this.onCommonHandleSaveRecord(e.target.value);
}, },
// checkboxTree
isCheckboxTreeChecked(value) {
if (!this.inputValue || !this.inputValue.checkedValues) {
return false;
}
const checkedItem = this.inputValue.checkedValues.find(item => item.label === value);
return checkedItem && checkedItem.checked;
},
// checkboxTree
isCheckboxTreeOtherInputError(value) {
if (!this.error) {
return false;
}
return isValueEmpty(this.inputValue.otherValues[value]);
},
// checkboxTree
getCheckboxTreeChecked(value) {
const { checkedValues } = this.inputValue
const o = checkedValues.find(item => item.label === value) || {};
return !!o.checked;
},
// checkedItem
getOrCreateCheckedItem(value) {
let checkedItem = this.inputValue.checkedValues.find(item => item.label === value);
if (!checkedItem) {
checkedItem = { label: value, checked: false };
this.inputValue.checkedValues.push(checkedItem);
}
return checkedItem;
},
// checkbox
onCheckboxTreeParentChange(group, checked) {
this.currentHandleType = 'checkboxTreeCheckbox';
this.currentCheckboxTreeValue = group.value;
//
const parentItem = this.getOrCreateCheckedItem(group.value);
parentItem.checked = checked;
//
if (group.children && group.children.length > 0) {
group.children.forEach(child => {
const childItem = this.getOrCreateCheckedItem(child.value);
childItem.checked = checked;
// otherValues
if (!checked) {
delete this.inputValue.otherValues[child.value];
}
});
}
this.onCommonHandleSaveRecord();
},
// checkbox
onCheckboxTreeChildChange(group, childValue, checked) {
this.currentHandleType = 'checkboxTreeCheckbox';
this.currentCheckboxTreeValue = childValue;
//
const childItem = this.getOrCreateCheckedItem(childValue);
childItem.checked = checked;
// otherValues
if (!checked) {
delete this.inputValue.otherValues[childValue];
}
//
this.updateParentState(group);
this.onCommonHandleSaveRecord();
},
//
updateParentState(group) {
if (!group.children || group.children.length === 0) return;
const parentItem = this.getOrCreateCheckedItem(group.value);
const childValues = group.children.map(child => child.value);
//
let checkedCount = 0;
let totalCount = childValues.length;
childValues.forEach(childValue => {
const childItem = this.inputValue.checkedValues.find(item => item.label === childValue);
if (childItem && childItem.checked) {
checkedCount++;
}
});
//
if (checkedCount === 0) {
//
parentItem.checked = false;
} else if (checkedCount === totalCount) {
//
parentItem.checked = true;
}
// indeterminate
},
//
getCheckboxTreeIndeterminate(groupValue) {
if (!this.inputValue || !this.inputValue.checkedValues) {
return false;
}
// group
const group = this.item.options.find(opt => opt.value === groupValue);
if (!group || !group.children || group.children.length === 0) {
return false;
}
const childValues = group.children.map(child => child.value);
let checkedCount = 0;
childValues.forEach(childValue => {
const childItem = this.inputValue.checkedValues.find(item => item.label === childValue);
if (childItem && childItem.checked) {
checkedCount++;
}
});
//
return checkedCount > 0 && checkedCount < childValues.length;
},
// checkboxTree
onCheckboxTreeOtherBlur(value, e) {
this.currentHandleType = "checkboxTreeOther";
this.currentCheckboxTreeValue = value;
this.inputValue.otherValues[value] = e.target.value;
this.onCommonHandleSaveRecord(e.target.value);
},
// question // question
onClickQuestion() { onClickQuestion() {
const { templateFillType } = this; const { templateFillType } = this;
@ -908,25 +1089,37 @@ export default {
this.visible = true; this.visible = true;
} }
}, },
getCheckboxListInfo(){
const { otherValues,checkboxValues } = this.checkboxListValue;
const { otherValues: oldOtherValues,checkboxValues: oldCheckboxValues } = this.oldCheckboxListValue;
getCheckboxListInfo() {
const { otherValues, checkboxValues } = this.checkboxListValue;
const { otherValues: oldOtherValues, checkboxValues: oldCheckboxValues } = this.oldCheckboxListValue;
const o = { const o = {
"checkboxListValue":{oldValue:oldCheckboxValues,newValue:checkboxValues,des:""},
"checkboxListOther":{oldValue:oldOtherValues[this.currentOtherCode],newValue:otherValues[this.currentOtherCode],des:"样品信息:"},
"checkboxListValue": { oldValue: oldCheckboxValues, newValue: checkboxValues, des: "" },
"checkboxListOther": { oldValue: oldOtherValues[this.currentOtherCode], newValue: otherValues[this.currentOtherCode], des: "样品信息:" },
} }
return o[this.currentHandleType]; return o[this.currentHandleType];
}, },
getFqyqInfo(){
const { mainRadio,inputValue,subRadio } = this.fqyqValue;
const { mainRadio: oldMainRadio,inputValue: oldInputValue,subRadio: oldSubRadio } = this.oldFqyqValue;
const o ={
"mainRadio":{oldValue:oldMainRadio,newValue:mainRadio,des:""},
"inputValue":{oldValue:oldInputValue,newValue:inputValue,des:""},
"subRadio":{oldValue:oldSubRadio,newValue:subRadio,des:"是否在规定时间完成:"}
getFqyqInfo() {
const { mainRadio, inputValue, subRadio } = this.fqyqValue;
const { mainRadio: oldMainRadio, inputValue: oldInputValue, subRadio: oldSubRadio } = this.oldFqyqValue;
const o = {
"mainRadio": { oldValue: oldMainRadio, newValue: mainRadio, des: "" },
"inputValue": { oldValue: oldInputValue, newValue: inputValue, des: "" },
"subRadio": { oldValue: oldSubRadio, newValue: subRadio, des: "是否在规定时间完成:" }
} }
return o[this.currentHandleType]; return o[this.currentHandleType];
}, },
getCheckboxTreeInfo() {
const { checkedValues, otherValues } = this.inputValue;
const { checkedValues: oldCheckedValues, otherValues: oldOtherValues } = this.oldValue;
const { currentHandleType, currentCheckboxTreeValue } = this;
const newItem = checkedValues.find(item => item.label === currentCheckboxTreeValue);
const oldItem = oldCheckedValues.find(item => item.label === currentCheckboxTreeValue);
const o = {
"checkboxTreeCheckbox": { oldValue: oldItem, newValue: newItem, des: "" },
"checkboxTreeOther": { oldValue: oldOtherValues[currentCheckboxTreeValue], newValue: otherValues[currentCheckboxTreeValue], des: `${currentCheckboxTreeValue}` },
}
return o[currentHandleType];
},
async onCommonHandleSaveRecord(val) { async onCommonHandleSaveRecord(val) {
const isEmpty = isValueEmpty(this.inputValue); const isEmpty = isValueEmpty(this.inputValue);
if (this.error && !isEmpty) { if (this.error && !isEmpty) {
@ -970,14 +1163,13 @@ export default {
this.$emit("change", this.inputValue); this.$emit("change", this.inputValue);
return; return;
} }
// //
let isSame = true, isOldValueEmpty = true; let isSame = true, isOldValueEmpty = true;
const { currentHandleType } = this; const { currentHandleType } = this;
// checkboxListotherValues // checkboxListotherValues
if (this.type === 'checkboxList') { if (this.type === 'checkboxList') {
const current = this.getCheckboxListInfo(); const current = this.getCheckboxListInfo();
isSame = this.isEqual(current.oldValue,current.newValue);
isSame = this.isEqual(current.oldValue, current.newValue);
isOldValueEmpty = isValueEmpty(current.oldValue); isOldValueEmpty = isValueEmpty(current.oldValue);
} else if (this.type === "checkboxTag") { } else if (this.type === "checkboxTag") {
// checkboxTagtagIndex // checkboxTagtagIndex
@ -987,13 +1179,25 @@ export default {
isOldValueEmpty = isValueEmpty(oldTag.checked); isOldValueEmpty = isValueEmpty(oldTag.checked);
} else if (this.type === "fqyq") { } else if (this.type === "fqyq") {
const current = this.getFqyqInfo(); const current = this.getFqyqInfo();
isSame = this.isEqual(current.oldValue,current.newValue);
isSame = this.isEqual(current.oldValue, current.newValue);
isOldValueEmpty = isValueEmpty(current.oldValue); isOldValueEmpty = isValueEmpty(current.oldValue);
} else if (this.type === "checkboxTree") {
const current = this.getCheckboxTreeInfo();
const { oldValue, newValue } = current;
if (currentHandleType === "checkboxTreeCheckbox") {
isSame = this.isEqual(oldValue.checked, newValue.checked);
isOldValueEmpty = isValueEmpty(oldValue.checked);
} else {
isSame = this.isEqual(current.oldValue, current.newValue);
isOldValueEmpty = isValueEmpty(current.oldValue);
}
} else { } else {
isSame = this.isEqual(this.oldValue, this.inputValue) isSame = this.isEqual(this.oldValue, this.inputValue)
isOldValueEmpty = isValueEmpty(this.oldValue); isOldValueEmpty = isValueEmpty(this.oldValue);
} }
console.log(isSame,isOldValueEmpty,this.fqyqValue,this.oldFqyqValue,"isSame")
console.log(isSame, isOldValueEmpty, this.currentCheckboxTreeValue, this.oldValue, this.inputValue, "isSame")
if (isSame) { if (isSame) {
return; return;
} }
@ -1030,13 +1234,10 @@ export default {
this.fqyqValue = JSON.parse(JSON.stringify(this.oldFqyqValue)); this.fqyqValue = JSON.parse(JSON.stringify(this.oldFqyqValue));
oldValue = { ...this.fqyqValue }; oldValue = { ...this.fqyqValue };
} }
this.inputValue = this.oldValue;
this.inputValue = typeof oldValue === 'object' ? JSON.parse(JSON.stringify(oldValue)) : oldValue;
this.$emit('input', oldValue); // v-model this.$emit('input', oldValue); // v-model
// this.$emit("blur", this.oldValue); // this.$emit("blur", this.oldValue);
this.$emit("change", oldValue, "cancel"); this.$emit("change", oldValue, "cancel");
if (this.item.type === "clickable") {
this.$emit("resetRecord");
}
}, },
// //
@ -1059,14 +1260,27 @@ export default {
isModify = oldTag.checked !== undefined; isModify = oldTag.checked !== undefined;
} else if (this.type === "fqyq") { } else if (this.type === "fqyq") {
const current = this.getFqyqInfo(); const current = this.getFqyqInfo();
recordOldVlaue = `${current.des+current.oldValue}`;
recordValue = `${current.des+current.newValue}`;
isModify = !!this.oldFqyqValue.mainRadio
}else if(this.type === "checkboxList"){
recordOldVlaue = `${current.des + current.oldValue}`;
recordValue = `${current.des + current.newValue}`;
isModify = !!this.oldFqyqValue.mainRadio
} else if (this.type === "checkboxList") {
const current = this.getCheckboxListInfo(); const current = this.getCheckboxListInfo();
recordOldVlaue = `${current.des+(current.oldValue || '')}`;
recordValue = `${current.des+(current.newValue || '')}`;
recordOldVlaue = `${current.des + (current.oldValue || '')}`;
recordValue = `${current.des + (current.newValue || '')}`;
isModify = !!current.oldValue; isModify = !!current.oldValue;
} else if (this.type === "checkboxTree") {
// checkboxTree
const current = this.getCheckboxTreeInfo();
if (this.currentHandleType === "checkboxTreeCheckbox") {
const { oldValue, newValue } = current;
recordOldVlaue = `${oldValue.label || ''}:${oldValue.checked ? '勾选' : '未勾选'}`;
recordValue = `${newValue.label || ''}:${newValue.checked ? '勾选' : '未勾选'}`;
isModify = newValue.checked !== undefined;
} else {
recordOldVlaue = `${current.des + current.oldValue}`;
recordValue = `${current.des + current.newValue}`;
isModify = !!current.oldValue;
}
} }
const record = { const record = {
...baseInfo, ...baseInfo,
@ -1118,7 +1332,7 @@ export default {
} }
} }
// //
this.oldValue = value; //
this.oldValue = typeof value === 'object' ? JSON.parse(JSON.stringify(value)) : value; //
this.$emit("blur", value); this.$emit("blur", value);
this.$emit('input', value); this.$emit('input', value);
this.$emit("change", value, data ? "save" : ""); this.$emit("change", value, data ? "save" : "");
@ -1757,6 +1971,7 @@ export default {
border-color: #f9c588; border-color: #f9c588;
} }
} }
.el-radio__inner { .el-radio__inner {
border-color: #f9c588; border-color: #f9c588;
} }
@ -1814,17 +2029,39 @@ export default {
} }
} }
} }
.fqyq-input{
.fqyq-input {
width: 500px; width: 500px;
margin-right:10px;
margin-right: 10px;
} }
.mb-10{
.mb-10 {
margin-bottom: 10px; margin-bottom: 10px;
} }
.fs-14{
.fs-14 {
font-size: 14px; font-size: 14px;
} }
.mr-10{
.mr-10 {
margin-right: 10px; margin-right: 10px;
} }
.checkbox-tree-children {
margin-left: 30px;
padding: 16px 0;
gap: 16px;
display: grid;
grid-template-columns: repeat(4, 1fr);
}
.checkbox-tree-item {
box-sizing: border-box;
display: flex;
align-items: center;
}
.checkbox-tree-input-container{
margin-left: 10px;
width: 500px;
}
</style> </style>

+ 40
- 3
src/components/Template/Step.vue View File

@ -13,7 +13,7 @@
<!-- 根据步骤类型显示对应的表单 --> <!-- 根据步骤类型显示对应的表单 -->
<!-- 根据步骤类型显示对应的表单 --> <!-- 根据步骤类型显示对应的表单 -->
<component class="flex1" :sn="step.type" :is="getStepComponent(step.type)" :formData="step.formData" <component class="flex1" :sn="step.type" :is="getStepComponent(step.type)" :formData="step.formData"
@update="onFormUpdate(index, $event)" :ref="'stepCompRef_' + index">
@update="onFormUpdate(index, $event)" :stepIndex = "index" :ref="'stepCompRef_' + index">
</component> </component>
<div v-if="templateFillType === 'preFill'" class="step-header-item"> <div v-if="templateFillType === 'preFill'" class="step-header-item">
<el-popconfirm <el-popconfirm
@ -103,6 +103,24 @@ import cl from './StepComponents/b/cl.vue';//表配置-称量
//-使- //-使-
//-使- //-使-
//
//-使-
//-使-
//-使-
import jryp from './StepComponents/swypfx/jryp.vue';//-
//-使-
import hhspe from './StepComponents/swypfx/hhspe.vue';//-SPE
//-SPE使-SPE
//-SPE使-SPE
//-SPE使-SPE
//-SPE使-SPE
import zyfc from './StepComponents/swypfx/zyfc.vue';//-
//-使-
//-使-
//-使-
//-使-
import { public_templateStepList } from '@/api/business/public/public'; import { public_templateStepList } from '@/api/business/public/public';
@ -223,6 +241,11 @@ export default {
// //
jrry_b, jrry_b,
cl, cl,
//
jryp,
hhspe,
zyfc
}, },
computed: { computed: {
stepComponentMap() { stepComponentMap() {
@ -280,8 +303,8 @@ export default {
// //
'jrry_b': 'jrry_b', 'jrry_b': 'jrry_b',
'cl': 'cl', 'cl': 'cl',
'lx_b': 'lx',
'cs_b': 'cs',
'lx_b': 'Lx',
'cs_b': 'Cs',
'hwhy_b': 'Hwhy', 'hwhy_b': 'Hwhy',
'zyhy_b': 'Zyhy', 'zyhy_b': 'Zyhy',
'wxhy_b': 'Wxhy', 'wxhy_b': 'Wxhy',
@ -298,6 +321,19 @@ export default {
'jd_b': 'Jd', 'jd_b': 'Jd',
'fy_b': 'Fy', 'fy_b': 'Fy',
'fr_b': 'Fr', 'fr_b': 'Fr',
//
'jd_swypfx': 'Jd',
'jryp': 'jryp',
'ysfy': 'Lx',
'hhspe': 'hhspe',
'phspe': 'hhspe',
'syspe': 'hhspe',
'lxspe': 'hhspe',
'xtspe': 'hhspe',
'zyfc': 'zyfc',
} }
} }
return this.componentMap return this.componentMap
@ -339,6 +375,7 @@ export default {
}, },
methods: { methods: {
getStepList(){ getStepList(){
debugger
public_templateStepList({templateId:this.templateData.templateId}).then(response => { public_templateStepList({templateId:this.templateData.templateId}).then(response => {
let options = [] let options = []
_.forEach(response.data,(item)=>{ _.forEach(response.data,(item)=>{

+ 1
- 1
src/components/Template/StepComponents/ry/fy.vue View File

@ -40,7 +40,7 @@ export default {
fillType: "preFill", fillType: "preFill",
}, },
text3: { text3: {
label: "实际条件为",
label: "实际设置条件为",
type: "text", type: "text",
}, },
sjtj: { sjtj: {

+ 101
- 1
src/components/Template/StepComponents/ry/jd.vue View File

@ -21,7 +21,107 @@ export default {
}, },
computed: { computed: {
formConfig() { formConfig() {
let config = [{
let config = this.sn==='jd_swypfx'?
[{
config: {
text1: {
label: "将上述样品预计放置于",
type: "text",
},
ccwz: {
type: "select",
options: this.getDictOptions("business_ccwz"),
fillType: "preFill",
otherCode: "ccwzOther",
},
text3: {
label: "实际放置于",
type: "text",
},
sjccwz: {
type: "select",
options: this.getDictOptions("business_ccwz"),
fillType: "actFill",
otherCode: "sjccwzOther",
compareTo: "ccwz",
},
text4: {
label: "位置,其环境条件预计为",
type: "text",
},
yjwd: {
type: "select",
options: this.getDictOptions("business_wddw"),
fillType: "preFill",
otherCode: "yjwdOther",
},
yjhj: {
type: "select",
options: this.getDictOptions("business_hjxx"),
fillType: "preFill",
otherCode: "yjhjOther",
},
text5: {
label: ",实际条件为",
type: "text",
},
sjwd: {
type: "select",
options: this.getDictOptions("business_wddw"),
fillType: "actFill",
otherCode: "sjwdOther",
compareTo: "yjwd",
},
sjhj: {
type: "select",
options: this.getDictOptions("business_hjxx"),
fillType: "actFill",
otherCode: "sjhjOther",
compareTo: "yjhj",
},
text6: {
label: ",放置",
type: "text",
},
sr1:{
type: "input",
fillType: "preFill",
},
text7:{
type:"text",
label:",解冻",
},
startDate: {
type: "input",
fillType: "actFill",
disabled: true,
},
button1:{
type:"button",
buttonName:"开始",
},
text8:{
type:"text",
label:",解冻",
},
endDate: {
type: "input",
fillType: "actFill",
disabled: true,
},
button2:{
type:"button",
buttonName:"结束",
},
text9: {
type: "text",
label: "。",
},
}
}]:
[{
config: { config: {
text1: { text1: {
label: "将", label: "将",

+ 2
- 2
src/components/Template/StepComponents/ry/lx.vue View File

@ -23,7 +23,7 @@ export default {
let config = [{ let config = [{
config: { config: {
text1: { text1: {
label: "使用离心机",
label: this.sn==='ysfy'?"使用恒温混匀仪":"使用离心机",
type: "text", type: "text",
}, },
yq: { yq: {
@ -110,7 +110,7 @@ export default {
fillType: "preFill", fillType: "preFill",
}, },
text8: { text8: {
label: ",进行离心。离心",
label: this.sn==='ysfy'?",进行衍生反应,反应":",进行离心。离心",
type: "text", type: "text",
}, },
startDate: { startDate: {

+ 91
- 0
src/components/Template/StepComponents/swypfx/hhspe.vue View File

@ -0,0 +1,91 @@
<!-- 活化SPE -->
<template>
<StepFormPackage ref="stepFormPackageRef" prefixKey="ry_hhspe" @resetRecord = "resetRecord" :form-config="formConfig" :formData="formData" />
</template>
<script>
import StepFormPackage from '@/components/Template/StepFormPackage.vue';
import stepMixins from '@/components/Template/mixins/stepMixins.js';
export default {
mixins: [stepMixins],
props: {
sn: {
type: String,
default: 'hhsep',
},
},
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config: {
text1: {
label: "使用",
type: "text",
},
ytrq: {
fillType: "preFill",
type: "input",
},
sjrqcz: {
fillType: "actFill",
type: "yq",
},
text2: {
label: this.sn==='syspe'?"向预先活化平衡好的固相萃取版中加入":"向固相萃取版中加入",
type: "text",
},
srry: {
fillType: "preFill",
type: "input",
},
sjrq:{
fillType: "actFill",
type: "sj",
ylCode: "sjsr2",
dwCode: "sjsrdw2",
},
text3:{
label: this.sn==='syspe'?"样品,预计加入":"溶液,预计加入",
type: "text",
},
ytsr1:{
fillType: "preFill",
type: "inputNumber",
},
tjxz:{
fillType: "preFill",
type: "select",
selectTo: "sjsrdw2",
options:this.getDictOptions('business_tjdw'),
},
text4:{
label: ",实际加入",
type: "text",
},
sjsr2:{
fillType: "actFill",
type: "inputNumber",
compareTo:"ytsr1",
copyFrom:"ytsr1"
},
sjsrdw2:{
fillType: "preFill",
type: "select",
options: this.getDictOptions('business_tjdw'),
},
text5:{
label: this.sn==='phspe'?"进行平衡。":this.sn==='syspe'?"进行上样。":this.sn==='lxspe'?"进行淋洗,弃去淋洗液。":this.sn==='xtspe'?"进行洗脱,收集洗脱液。":"进行活化。",
type: "text",
}
}
}]
}
},
}
</script>
<style lang="scss" scoped></style>

+ 67
- 0
src/components/Template/StepComponents/swypfx/jryp.vue View File

@ -0,0 +1,67 @@
<!-- 加入样品 -->
<template>
<StepFormPackage ref="stepFormPackageRef" prefixKey="ry_jryp" @resetRecord = "resetRecord" :form-config="formConfig" :formData="formData" />
</template>
<script>
import StepFormPackage from '@/components/Template/StepFormPackage.vue';
import stepMixins from '@/components/Template/mixins/stepMixins.js';
export default {
mixins: [stepMixins],
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config: {
text1: {
label: "使用移液器",
type: "text",
},
sjrqcz: {
fillType: "actFill",
type: "yq",
},
text2: {
label: "仪器,预计加入样品",
type: "text",
},
ytsr1:{
fillType: "preFill",
type: "inputNumber",
},
tjxz:{
fillType: "preFill",
type: "select",
selectTo: "sjsrdw2",
options:this.getDictOptions('business_tjdw'),
},
text4:{
label: ",实际加入样品",
type: "text",
},
sjsr2:{
fillType: "actFill",
type: "inputNumber",
compareTo:"ytsr1",
copyFrom:"ytsr1"
},
sjsrdw2:{
fillType: "preFill",
type: "select",
options: this.getDictOptions('business_tjdw'),
},
text5:{
label: "。",
type: "text",
}
}
}]
}
},
}
</script>
<style lang="scss" scoped></style>

+ 79
- 0
src/components/Template/StepComponents/swypfx/zyfc.vue View File

@ -0,0 +1,79 @@
<!-- 转移分层 -->
<template>
<StepFormPackage ref="stepFormPackageRef" prefixKey="ry_zyfc" @resetRecord = "resetRecord" :form-config="formConfig" :formData="formData" />
</template>
<script>
import StepFormPackage from '@/components/Template/StepFormPackage.vue';
import stepMixins from '@/components/Template/mixins/stepMixins.js';
export default {
mixins: [stepMixins],
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config: {
text1: {
label: "使用",
type: "text",
},
ytyq: {
fillType: "preFill",
type: "input",
},
sjrqcz: {
fillType: "actFill",
type: "yq",
},
text2: {
label: "转移",
type: "text",
},
shang:{
fillType: "preFill",
type: "input",
},
text3: {
label: "层清液,预计转移",
type: "text",
},
ytsr1:{
fillType: "preFill",
type: "inputNumber",
},
tjxz:{
fillType: "preFill",
type: "select",
selectTo: "sjsrdw2",
options:this.getDictOptions('business_tjdw'),
},
text4:{
label: ",实际转移",
type: "text",
},
sjsr2:{
fillType: "actFill",
type: "inputNumber",
compareTo:"ytsr1",
copyFrom:"ytsr1"
},
sjsrdw2:{
fillType: "preFill",
type: "select",
options: this.getDictOptions('business_tjdw'),
},
text5:{
label: "至容器中。",
type: "text",
}
}
}]
}
},
}
</script>
<style lang="scss" scoped></style>

+ 6
- 6
src/components/Template/StepFormPackage.vue View File

@ -4,25 +4,25 @@
<div v-for="(sItem, key) in item.config" class="step-item" :key="key"> <div v-for="(sItem, key) in item.config" class="step-item" :key="key">
<template v-if="sItem.type === 'input'"> <template v-if="sItem.type === 'input'">
<HandleFormItem class="step-row" :field-item-label="fieldItemLabel" @blur="onBlur(key, $event)" <HandleFormItem class="step-row" :field-item-label="fieldItemLabel" @blur="onBlur(key, $event)"
:item="sItem" v-model="formFields[key]" :field-key="prefixKey + '_' + key"
:item="sItem" v-model="formFields[key]" :field-key="prefixKey+uuid + '_' + key"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false" @copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" /> :orange-bg="orangeBgFields[key]" />
</template> </template>
<template v-else-if="sItem.type === 'inputNumber'"> <template v-else-if="sItem.type === 'inputNumber'">
<HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
<HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey+uuid + '_' + key"
type="inputNumber" @blur="onBlur(key, $event)" :item="sItem" type="inputNumber" @blur="onBlur(key, $event)" :item="sItem"
@input="onInputNumberChange(key, $event)" v-model="formFields[key]" @copy="onCopy(sItem, key)" @input="onInputNumberChange(key, $event)" v-model="formFields[key]" @copy="onCopy(sItem, key)"
:error="errors[key]" @update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" /> :error="errors[key]" @update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" />
</template> </template>
<template v-else-if="sItem.type === 'select'"> <template v-else-if="sItem.type === 'select'">
<HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
<HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey+uuid + '_' + key"
type="select" @blur="onBlur(key, $event)" :item="sItem" v-model="formFields[key]" type="select" @blur="onBlur(key, $event)" :item="sItem" v-model="formFields[key]"
@change="onSelectChange(key, $event, sItem.type)" @change="onSelectChange(key, $event, sItem.type)"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false" @copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" /> :orange-bg="orangeBgFields[key]" />
</template> </template>
<template v-else-if="sItem.type === 'checkbox'"> <template v-else-if="sItem.type === 'checkbox'">
<HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
<HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey+uuid + '_' + key"
type="checkbox" :item="sItem" v-model="formFields[key]" type="checkbox" :item="sItem" v-model="formFields[key]"
@change="onSelectChange(key, $event, sItem.type)" @change="onSelectChange(key, $event, sItem.type)"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false" @copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
@ -36,7 +36,7 @@
</template> </template>
<!-- 仪器instrumentsj(药剂) gsp(供试品) mix药剂/供试品/给药制剂 --> <!-- 仪器instrumentsj(药剂) gsp(供试品) mix药剂/供试品/给药制剂 -->
<template v-else-if="isRegent(sItem)"> <template v-else-if="isRegent(sItem)">
<HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
<HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey+uuid + '_' + key"
:type="sItem.type" :error="errors[key]" :type="sItem.type" :error="errors[key]"
@onRegentSubmit="(data)=>onRegentSubmit(data,key,sItem)" @onRegentSubmit="(data)=>onRegentSubmit(data,key,sItem)"
@update:error="errors[key] = false" :item="getRegentItem(sItem)" @update:error="errors[key] = false" :item="getRegentItem(sItem)"
@ -55,7 +55,7 @@
<div v-show="isShowOther(formFields[key])" class="flex flex1"> <div v-show="isShowOther(formFields[key])" class="flex flex1">
<div class="other-title">{{sItem.otherLabel ? $t(sItem.otherLabel) : $t("template.common.other") }}</div> <div class="other-title">{{sItem.otherLabel ? $t(sItem.otherLabel) : $t("template.common.other") }}</div>
<HandleFormItem sourceFrom = "step" class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+sItem.otherCode" @blur="onBlur(key, $event)" :item="getOtherItem(sItem)"
<HandleFormItem sourceFrom = "step" class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey+uuid+'_'+sItem.otherCode" @blur="onBlur(key, $event)" :item="getOtherItem(sItem)"
v-model="formFields[sItem.otherCode]" @copy="onCopy(sItem, key)" v-model="formFields[sItem.otherCode]" @copy="onCopy(sItem, key)"
:error="errors[sItem.otherCode]" @update:error="errors[sItem.otherCode] = false" :error="errors[sItem.otherCode]" @update:error="errors[sItem.otherCode] = false"
:orange-bg="orangeBgFields[sItem.otherCode]" /> :orange-bg="orangeBgFields[sItem.otherCode]" />

+ 1
- 0
src/components/Template/mixins/formPackageMixins.js View File

@ -75,6 +75,7 @@ export default {
fillType: item.subFillType || item.fillType, fillType: item.subFillType || item.fillType,
parentLabel: item.label, parentLabel: item.label,
filledCodes: item.filledCodes, filledCodes: item.filledCodes,
qxbdType: item.qxbdType,
} }
}, },

+ 18
- 0
src/lang/en/template/pcr.js View File

@ -47,6 +47,24 @@ export default {
ypznd: '样品终浓度', ypznd: '样品终浓度',
fj: 'Attachment', fj: 'Attachment',
}, },
pcr007: {
dztpbh: '电子天平编号',
ypmc: '样品名称',
cyqypgsjyjtjtj: '采样前样品管试剂预计添加体积',
cyqypgsjsjtjtj: '采样前样品管试剂实际添加体积',
cygzl: '采集管重量',
czsj: '称重时间',
clpbh: 'Analysis Batch Number',
ypmc: '样品名称',
ypcsnd: '样品初始浓度',
sxbs: '稀释倍数',
ysypxytj: '预设样品吸样体积',
sjypxytj: '实际样品吸样体积',
ysxsyxytj: '预设稀释液吸样体积',
sjxsyxytj: '实际稀释液吸样体积',
ypznd: '样品终浓度',
fj: 'Attachment',
},
// 生物样品分析方法学样品制备表-准确度与精密度 // 生物样品分析方法学样品制备表-准确度与精密度
sp008: { sp008: {
title: title:

+ 3
- 4
src/lang/zh/template/dl.js View File

@ -194,9 +194,8 @@ export default {
dlbz: '备注', dlbz: '备注',
gcqk: '观察情况', gcqk: '观察情况',
jlzb:'剂量组别',
xybh:'悬液编号',
bplsh1:'玻片流水号',
bplsh2:'玻片流水号',
bpbh:'玻片编号',
gcxps:'观察细胞数目',
zqxxbs:'中期相细胞数',
}, },
} }

+ 18
- 0
src/lang/zh/template/pcr.js View File

@ -46,6 +46,24 @@ export default {
ypznd: '样品终浓度', ypznd: '样品终浓度',
fj: '附件', fj: '附件',
}, },
pcr007: {
dztpbh: '电子天平编号',
ypmc: '样品名称',
cyqypgsjyjtjtj: '采样前样品管试剂预计添加体积',
cyqypgsjsjtjtj: '采样前样品管试剂实际添加体积',
cygzl: '采集管重量',
czsj: '称重时间',
clpbh: 'Analysis Batch Number',
ypmc: '样品名称',
ypcsnd: '样品初始浓度',
sxbs: '稀释倍数',
ysypxytj: '预设样品吸样体积',
sjypxytj: '实际样品吸样体积',
ysxsyxytj: '预设稀释液吸样体积',
sjxsyxytj: '实际稀释液吸样体积',
ypznd: '样品终浓度',
fj: 'Attachment',
},
// 生物样品分析方法学样品制备表-Recovery // 生物样品分析方法学样品制备表-Recovery
sp009: { sp009: {
title: '生物样品分析方法学样品制备表(Recovery)', title: '生物样品分析方法学样品制备表(Recovery)',

+ 18
- 1
src/utils/index.js View File

@ -441,7 +441,7 @@ export function isValueEmpty(value) {
if (Array.isArray(value) && value.length === 0) { if (Array.isArray(value) && value.length === 0) {
return true return true
} }
if (Object.keys(value).length === 0) {
if (Object.keys(value).length === 0 && typeof value=='object') {
return true; return true;
} }
return false return false
@ -584,3 +584,20 @@ export function getStringWidth(str) {
} }
return width return width
} }
//根据选项获取默认值,为了
export const getDefaultValueByOptions = (options = []) => {
const arr = [];
options.forEach(item => {
const { children = [], label } = item;
//目前只考虑2层,也不考虑label值重复的问题;
if (children.length > 0) {
children.forEach(child => {
arr.push({ label: child.label, checked: undefined })
})
} else {
arr.push({ label, checked: undefined })
}
})
return arr;
}

+ 4
- 2
src/views/business/comps/template/TemplateTable.vue View File

@ -52,6 +52,7 @@ import PCR002 from "./comps/pcr/PCR002.vue";
import PCR003 from "./comps/pcr/PCR003.vue"; import PCR003 from "./comps/pcr/PCR003.vue";
import PCR004 from "./comps/pcr/PCR004.vue"; import PCR004 from "./comps/pcr/PCR004.vue";
import PCR005 from "./comps/pcr/PCR005.vue"; import PCR005 from "./comps/pcr/PCR005.vue";
import PCR007 from "./comps/pcr/PCR007.vue";
//LBA //LBA
// LBA001-使SP001 // LBA001-使SP001
@ -114,7 +115,7 @@ export default {
// //
SP001, SP003, SP00456,SP007, SP008, SP009,SP0019,SP0020, SP001, SP003, SP00456,SP007, SP008, SP009,SP0019,SP0020,
// PCR // PCR
PCR002, PCR003, PCR004, PCR005,
PCR002, PCR003, PCR004, PCR005,PCR007,
//LBA //LBA
LBA002, LBA002,
LBA003, LBA003,
@ -162,7 +163,7 @@ export default {
handleEditSignCancel(e) { handleEditSignCancel(e) {
EventBus.$emit('edit-sign-cancel', e); EventBus.$emit('edit-sign-cancel', e);
}, },
}, },
props: { props: {
sn: { sn: {
@ -232,6 +233,7 @@ export default {
'PCR003': 'PCR003', 'PCR003': 'PCR003',
'PCR004': 'PCR004', 'PCR004': 'PCR004',
'PCR005': 'PCR005', 'PCR005': 'PCR005',
'PCR007': 'PCR007',
//LBA //LBA
'LBA001': 'SP001', 'LBA001': 'SP001',
'LBA002': 'LBA002', 'LBA002': 'LBA002',

+ 1
- 0
src/views/business/comps/template/comps/dl/DL016.vue View File

@ -150,6 +150,7 @@ export default {
fillType: 'preFill', fillType: 'preFill',
options: this.getDictOptions('business_dl_qsxjbltj'), options: this.getDictOptions('business_dl_qsxjbltj'),
otherCode: 'bltjOther', otherCode: 'bltjOther',
showOtherLabel:false
}, },
} }
} }

+ 1
- 0
src/views/business/comps/template/comps/dl/DL017.vue View File

@ -151,6 +151,7 @@ export default {
fillType: 'preFill', fillType: 'preFill',
options: this.getDictOptions('business_dl_qsxjbltj'), options: this.getDictOptions('business_dl_qsxjbltj'),
otherCode: 'bltjOther', otherCode: 'bltjOther',
showOtherLabel:false
}, },
} }
} }

+ 1
- 0
src/views/business/comps/template/comps/dl/DL018.vue View File

@ -151,6 +151,7 @@ export default {
fillType: 'preFill', fillType: 'preFill',
options: this.getDictOptions('business_dl_qsxjbltj'), options: this.getDictOptions('business_dl_qsxjbltj'),
otherCode: 'bltjOther', otherCode: 'bltjOther',
showOtherLabel:false
}, },
} }
} }

+ 1
- 0
src/views/business/comps/template/comps/dl/DL019.vue View File

@ -151,6 +151,7 @@ export default {
fillType: 'preFill', fillType: 'preFill',
options: this.getDictOptions('business_dl_qsxjbltj'), options: this.getDictOptions('business_dl_qsxjbltj'),
otherCode: 'bltjOther', otherCode: 'bltjOther',
showOtherLabel:false
}, },
} }
} }

+ 5
- 10
src/views/business/comps/template/comps/dl/DL021.vue View File

@ -123,21 +123,16 @@ export default {
bodyMaxlength: 50, bodyMaxlength: 50,
},{ },{
label: 'template.dl.dl021.gcxps', label: 'template.dl.dl021.gcxps',
prop: 'dwbh',
bodyType: 'checkboxTag',
prop: 'cyd',
bodyType: 'input',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodySubType:"button",
bodySubFillType:"preFill",
bodySubButtonName:"template.common.importTemplate",
bodySubKey:"exportBtn",
showBodySub:this.fillType === "preFill",
width: 280,
width: 100,
bodyMaxlength: 10, bodyMaxlength: 10,
},{ },{
label: 'template.dl.dl021.zqxxbs', label: 'template.dl.dl021.zqxxbs',
prop: 'ypsl',
label: 'template.dl.dl021.gcxps',
prop: 'cyd',
bodyType: 'input', bodyType: 'input',
bodyDisabled: true,
bodyFillType: 'actFill', bodyFillType: 'actFill',
width: 80, width: 80,
bodyMaxlength: 10, bodyMaxlength: 10,

+ 38
- 25
src/views/business/comps/template/comps/pcr/PCR005.vue View File

@ -16,16 +16,21 @@
<div class="template-form-item"> <div class="template-form-item">
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" <BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef"
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" /> :formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
<el-button type="primary" @click="downloadExcelTemplate">{{
$t('template.common.downloadTemplate') }}</el-button>
<el-button type="primary" @click="showImportExcelDialog">{{ $t('template.common.importTemplate')
}}</el-button>
<div v-if="fillType == 'preFill'">
<el-button type="primary" @click="downloadExcelTemplate">{{
$t('template.common.downloadTemplate') }}</el-button>
<el-button type="primary" @click="showImportExcelDialog">{{
$t('template.common.importTemplate')
}}</el-button>
</div>
<CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur" <CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur"
:ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`" :ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`"
:showOperation="fillType === 'preFill'"
fieldItemLabel="template.common.operationSteps"> fieldItemLabel="template.common.operationSteps">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns" <TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion>
@deleteRow="(rowIndex) => deleteRow(rowIndex)" ></TableOpertaion>
</template> </template>
</CustomTable> </CustomTable>
</div> </div>
@ -39,8 +44,6 @@
</div> </div>
</div> </div>
</div> </div>
<SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef">
</SelectReagentDialog>
<!-- <button @click="onSave">保存</button> --> <!-- <button @click="onSave">保存</button> -->
<ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" /> <ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" />
</div> </div>
@ -57,7 +60,7 @@ import { isValueEmpty } from '@/utils/index';
import { getLatestSnArr } from '@/api/template'; import { getLatestSnArr } from '@/api/template';
import { EventBus } from "@/utils/eventBus"; import { EventBus } from "@/utils/eventBus";
import { volumeConverter } from "@/utils/volConverter";// import { volumeConverter } from "@/utils/volConverter";//
import {convertConcentration} from "@/utils/conConverter";//
import { convertConcentration } from "@/utils/conConverter";//
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import { getPCR005Config } from "../../formConfig/PCRTableConfig.js"; import { getPCR005Config } from "../../formConfig/PCRTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
@ -173,11 +176,11 @@ export default {
type: "cellItem", type: "cellItem",
label: 'template.pcr.pcr005.clpbh', label: 'template.pcr.pcr005.clpbh',
config: { config: {
act: {
clpbh: {
label: '', label: '',
type: "input", type: "input",
fillType: "actFill", fillType: "actFill",
otherCode: "preOther",
otherCode: "clpbh",
} }
} }
}, },
@ -233,7 +236,7 @@ export default {
}, },
methods: { methods: {
downloadExcelTemplate() { downloadExcelTemplate() {
this.exportExcel(['样品名称', '样品初始浓度', '稀释倍数', '预设样品吸样体积'])
this.exportExcel(['样品名称', '样品初始浓度', '稀释倍数', '预设样品吸样体积'], 'PCR分析样品处理表导入模板')
}, },
// //
onSelectReagentSubmit(code, row) { onSelectReagentSubmit(code, row) {
@ -243,7 +246,21 @@ export default {
this.$refs.ImportExcelDialog.show() this.$refs.ImportExcelDialog.show()
}, },
onLoadExcelData(excelData) { onLoadExcelData(excelData) {
console.log(excelData)
excelData.shift()
let list = []
excelData.forEach(item => {
list.push({
ypmc: item[0],
ypcsnd: item[1],
sxbs: item[2],
ysypxytj: item[3],
targetDiluentVolumePrecision: 3,
actSolutionVolumePrecision: 3
})
})
this.$refs.stepTableRef.addRows(list)
this.$refs.ImportExcelDialog.cancel()
this.onHandleTableBlur()
}, },
// //
onHandleTableBlur() { onHandleTableBlur() {
@ -259,8 +276,6 @@ export default {
if (tableList && tableList.length > 0) { if (tableList && tableList.length > 0) {
for (let i = 0; i < tableList.length; i++) { for (let i = 0; i < tableList.length; i++) {
let item = tableList[i] let item = tableList[i]
console.log(item)
if ( if (
isValueEmpty(ysypxytjUnit) || isValueEmpty(ysypxytjUnit) ||
isValueEmpty(ysxsyxytjUnit) || isValueEmpty(ysxsyxytjUnit) ||
@ -271,6 +286,7 @@ export default {
) { ) {
continue; continue;
} }
// (-1)* // (-1)*
let ysxsyxytj = (item.sxbs - 1) * item.ysypxytj let ysxsyxytj = (item.sxbs - 1) * item.ysypxytj
ysxsyxytj = volumeConverter.convert(ysxsyxytj + ysypxytjUnit, ysxsyxytjUnit).toFixed( ysxsyxytj = volumeConverter.convert(ysxsyxytj + ysypxytjUnit, ysxsyxytjUnit).toFixed(
@ -280,31 +296,28 @@ export default {
// / // /
let ypznd = (item.ypcsnd ) / item.sxbs
let ypznd = (item.ypcsnd) / item.sxbs
ypznd = convertConcentration.convert(ypznd + ypcsndUnit, ypzndUnit).toFixed( ypznd = convertConcentration.convert(ypznd + ypcsndUnit, ypzndUnit).toFixed(
item.targetDiluentVolumePrecision item.targetDiluentVolumePrecision
) )
tableList[i].ypznd = ypznd tableList[i].ypznd = ypznd
} }
} }
this.$refs.stepTableRef.updateDataSource(tableList); this.$refs.stepTableRef.updateDataSource(tableList);
} }
}, },
// //
getFilledFormData() { getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"])
return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "fjRef", "remarkRef"])
}, },
async getFormData() { async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "fjRef", "remarkRef"]);
return content; return content;
}, },
getResource() { getResource() {
let content = this.getFilledFormData(); let content = this.getFilledFormData();
console.log(content)
//resource //resource
let tmpResource = [] let tmpResource = []
if (this.fillType === "actFill") { if (this.fillType === "actFill") {
@ -319,7 +332,7 @@ export default {
tmpResource.push({ tmpResource.push({
mc: null, mc: null,
bh: item.startSolutionCode,
bh: content.subSolution,
ph: null, ph: null,
ndz: null, ndz: null,
nd: null, nd: null,
@ -328,10 +341,10 @@ export default {
sxrq: null, sxrq: null,
kc: null, kc: null,
kcdw: null, kcdw: null,
syl: item.actStartSolutionVolume,
syl: item.ysxsyxytj,
type: 1, type: 1,
elnType: this.product, elnType: this.product,
syldw: content.headerSelectFields.actStartSolutionVolumeUnit,
syldw: content.headerSelectFields.sjxsyxytjUnit,
yxzq: null, yxzq: null,
yxzqdw: null, yxzqdw: null,
}) })

+ 277
- 0
src/views/business/comps/template/comps/pcr/PCR007.vue View File

@ -0,0 +1,277 @@
<!-- 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"
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
<div v-if="fillType == 'preFill'">
<el-button type="primary" @click="downloadExcelTemplate">{{
$t('template.common.downloadTemplate') }}</el-button>
<el-button type="primary" @click="showImportExcelDialog">{{
$t('template.common.importTemplate')
}}</el-button>
</div>
<CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur"
:ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`"
:showOperation="fillType === 'preFill'"
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)"></TableOpertaion>
</template>
</CustomTable>
</div>
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
</div>
<!-- <button @click="onSave">保存</button> -->
<ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" />
</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 { isValueEmpty } from '@/utils/index';
import { getLatestSnArr } from '@/api/template';
import { EventBus } from "@/utils/eventBus";
import { volumeConverter } from "@/utils/volConverter";//
import { convertConcentration } from "@/utils/conConverter";//
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import { getPCR007Config } from "../../formConfig/PCRTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools";
import ImportExcelDialog from '../../dialog/ImportExcelDialog'
export default {
name: "PCR005",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog, ImportExcelDialog },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
tableStepColumns() {
return getPCR007Config(this);
},
//
getFjFormConfig() {
return [
{
type: "attachment",
config: {
attTitle: {
label: 'template.pcr.pcr005.fj',
type: "attachment",
fillType: "actFill",
},
}
}
]
},
//
storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition: {
label: 'template.common.storageConditionLabel',
type: "select",
fillType: "preFill",
options: this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
}
}
];
},
//
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
//
baseInfoFormConfig() {
return [
{
type: "cardItem",
config: {
studyMc: {
label: 'template.common.testName',
type: "input",
disabled: true,
},
studySn: {
label: 'template.common.testNumber',
type: "input",
disabled: true,
},
}
},
{
type: "cellItem",
label: 'template.pcr.pcr007.czsj',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
},
//
stepFormConfig() {
return [
{
type: 'step',
config: {
solution: {
labelWidth: 100,
label: 'template.pcr.pcr007.dztpbh',
type: 'yq',
fillType: 'actFill',
},
}
}
]
},
},
data() {
return {
reagentType: null, // 1- 2-
formData: {},
currentSubKey: "",//key
currentType: "",//
currentRowIndex: "",//
};
},
mounted() {
const formData = this.getFormDataByTemplateData();
this.onHandleTableBlur()
},
methods: {
downloadExcelTemplate() {
this.exportExcel(['样品名称', '样品初始浓采样前样品管试剂预计添加体积度'], 'PCR分析采集管称重记录表导入模板')
},
//
onSelectReagentSubmit(code, row) {
},
showImportExcelDialog() {
this.$refs.ImportExcelDialog.show()
},
onLoadExcelData(excelData) {
excelData.shift()
let list = []
excelData.forEach(item => {
list.push({
ypmc: item[0],
ypcsnd: item[1],
})
})
this.$refs.stepTableRef.addRows(list)
this.$refs.ImportExcelDialog.cancel()
this.onHandleTableBlur()
},
//
onHandleTableBlur() {
},
//
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();
//resource
let tmpResource = []
if (this.fillType === "actFill") {
let tableList = content.stepTableFormData
if (tableList && tableList.length > 0) {
for (let i = 0; i < tableList.length; i++) {
}
}
}
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();
},
//
deleteRow(rowIndex) {
const stepTableRef = this.$refs['stepTableRef'];
if (stepTableRef) {
stepTableRef.deleteRow(rowIndex);
}
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
.print-btn {
margin-bottom: 20px;
}
</style>

+ 15
- 10
src/views/business/comps/template/comps/sp/SP0020.vue View File

@ -7,10 +7,11 @@
<div class="detail-content"> <div class="detail-content">
<div class="content"> <div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" <BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo"
ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
<LineLabel label="试验内容" />
:ref="refConfig.baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
<BaseInfoFormPackage fieldItemLabel="试验内容" label="试验内容"
:ref="refConfig.synrRef" :formConfig="synrFormConfig" :formData="formData" />
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" <BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
:ref="refConfig.remarkRef" :formConfig="remarkConig" :formData="formData" />
</div> </div>
</div> </div>
</div> </div>
@ -30,6 +31,13 @@ import TableOpertaionDelete from "@/components/Template/operation/TableOpertaion
import { getBaseInfoFormConfig} from "../../formConfig/sp/SP0019"; import { getBaseInfoFormConfig} from "../../formConfig/sp/SP0019";
import { getSynrFormConfig} from "../../formConfig/sp/SP0020"; import { getSynrFormConfig} from "../../formConfig/sp/SP0020";
const refConfig = {
baseInfoRef: "baseInfoRef",
remarkRef: "remarkRef",
synrRef: "synrRef",
}
const compRefs = Object.values(refConfig);
export default { export default {
name: "SP0020", name: "SP0020",
@ -47,7 +55,7 @@ export default {
}, },
// //
baseInfoFormConfig() { baseInfoFormConfig() {
return getBaseInfoFormConfig(this);
return getBaseInfoFormConfig('sp0020');
}, },
// //
@ -74,7 +82,7 @@ export default {
data() { data() {
return { return {
formData: {}, formData: {},
compRefs:["baseInfoRef", "storageConditionRef", "spzxhRef","yqInfoTableRef","ryTableRef", "remarkRef"]
refConfig
}; };
}, },
mounted() { mounted() {
@ -93,16 +101,13 @@ export default {
this.$refs.ryTableRef.updateDataSourceByRowIndex(rowIndex, params); this.$refs.ryTableRef.updateDataSourceByRowIndex(rowIndex, params);
} }
}, },
onYqSubmit(data, col, rowIndex, colIndex, row){
console.log(data, col, rowIndex, colIndex, row,"onRegentSubmit")
},
// //
getFilledFormData() { getFilledFormData() {
return this.getFilledFormDataByRefs(this.compRefs)
return this.getFilledFormDataByRefs(compRefs)
}, },
// //
async getFormData() { async getFormData() {
let content = await this.validFormFields(this.compRefs);
let content = await this.validFormFields(compRefs);
console.log(content) console.log(content)
return content; return content;
}, },

+ 2
- 2
src/views/business/comps/template/dialog/ImportExcelDialog.vue View File

@ -3,7 +3,7 @@
<!-- 导入excel模板 --> <!-- 导入excel模板 -->
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title" :visible.sync="open" <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title" :visible.sync="open"
width="400px" @close="close" append-to-body> width="400px" @close="close" append-to-body>
<el-button style="margin-bottom:10px" v-if="downloadArr && downloadArr.length>0" type="primary" @click="downloadExcelTemplate">{{$t('template.common.downloadTemplate') }}</el-button> <el-button style="margin-bottom:10px" v-if="downloadArr && downloadArr.length>0" type="primary" @click="downloadExcelTemplate">{{$t('template.common.downloadTemplate') }}</el-button>
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :disabled="upload.isUploading" action="" <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :disabled="upload.isUploading" action=""
@ -65,7 +65,6 @@ export default {
// //
handleFileUploadProgress(event, file, fileList) { handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true this.upload.isUploading = true
console.log('.....')
}, },
// //
handleFileSuccess(response, file, fileList) { handleFileSuccess(response, file, fileList) {
@ -94,6 +93,7 @@ export default {
const jsonData = XLSX.utils.sheet_to_json(worksheet, { header: 1 }) const jsonData = XLSX.utils.sheet_to_json(worksheet, { header: 1 })
this.excelData = jsonData this.excelData = jsonData
this.$emit('onLoadData', this.excelData) this.$emit('onLoadData', this.excelData)
this.$refs.fileUpload.handleRemove(file)
} catch (error) { } catch (error) {
console.error('解析失败:', error) console.error('解析失败:', error)
this.$modal.msgError('文件解析失败,请检查格式', error) this.$modal.msgError('文件解析失败,请检查格式', error)

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

@ -28,7 +28,6 @@ import SelectDept from "@/views/business/comps/select/SelectDept";
import { public_sjList, public_gyzjList, public_gspList, public_xbList,public_jcbList,public_qxFormFillList } from '@/api/business/public/public'; import { public_sjList, public_gyzjList, public_gspList, public_xbList,public_jcbList,public_qxFormFillList } from '@/api/business/public/public';
import { getSjSearchForm, getSjColumns, getGyzjSearchForm, getGyzjColumns, getGspSearchForm, getGspColumns, getXbSearchForm, getXbColumns,getJcbSearchForm,getJcbColumns,getQxbdSearchForm,getQxbdColumns } from '@/views/business/comps/template/formConfig/formConfig.js'; import { getSjSearchForm, getSjColumns, getGyzjSearchForm, getGyzjColumns, getGspSearchForm, getGspColumns, getXbSearchForm, getXbColumns,getJcbSearchForm,getJcbColumns,getQxbdSearchForm,getQxbdColumns } from '@/views/business/comps/template/formConfig/formConfig.js';
import { EventBus } from "@/utils/eventBus"; import { EventBus } from "@/utils/eventBus";
console.log(this,"this")
const typeMap = { const typeMap = {
'1': { '1': {
searchForm: getSjSearchForm(), searchForm: getSjSearchForm(),
@ -99,6 +98,7 @@ export default {
mixType: false,// mixType: false,//
title:"选择试剂", title:"选择试剂",
currentType: '1',// currentType: '1',//
qxbdType:"",//
} }
}, },
computed: { computed: {
@ -119,6 +119,7 @@ export default {
this.currentType = type; this.currentType = type;
if(type==15){ if(type==15){
this.selectedCode = 'id' this.selectedCode = 'id'
this.qxbdType = data.qxbdType || '';
} }
this.mixType = mixType; this.mixType = mixType;
this.sourceFrom = sourceFrom; this.sourceFrom = sourceFrom;
@ -173,6 +174,10 @@ export default {
ndz: (row.nd||"")+(row.nddw||""), ndz: (row.nd||"")+(row.nddw||""),
type: Number(this.selectType), type: Number(this.selectType),
} }
if(this.qxbdType && row.templateSn !== this.qxbdType){
this.$message.error(`请选择正确前序表单`);
return
}
this.$emit('submit', selectedValue, row); this.$emit('submit', selectedValue, row);
// eventBus // eventBus
EventBus.$emit("onMixReagentSubmit", { selectInfo, uuid: this.uuid, selectedId: selectedValue, row,selectType:this.selectType }); EventBus.$emit("onMixReagentSubmit", { selectInfo, uuid: this.uuid, selectedId: selectedValue, row,selectType:this.selectType });

+ 64
- 0
src/views/business/comps/template/formConfig/PCRTableConfig.js View File

@ -632,6 +632,7 @@ export const getPCR005Config = ($this) => {
fillType: 'preFill', fillType: 'preFill',
headerSelectKey: 'sjypxytjUnit', headerSelectKey: 'sjypxytjUnit',
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),
copyFrom: 'ysypxytj', //复制哪个字段
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyMaxlength: 10, bodyMaxlength: 10,
@ -666,6 +667,7 @@ export const getPCR005Config = ($this) => {
fillType: 'preFill', fillType: 'preFill',
headerSelectKey: 'sjxsyxytjUnit', headerSelectKey: 'sjxsyxytjUnit',
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),
copyFrom: 'ysxsyxytj', //复制哪个字段
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyMaxlength: 10, bodyMaxlength: 10,
@ -692,4 +694,66 @@ export const getPCR005Config = ($this) => {
bodySubPlaceholder: 'template.common.xswsPlaceholder', bodySubPlaceholder: 'template.common.xswsPlaceholder',
}, },
] ]
}
// PCR007
export const getPCR007Config = ($this) => {
return [
{
label: 'template.pcr.pcr007.ypmc',
prop: 'ypmc',
width: 280,
bodyType: 'input',
fillType: 'preFill',
otherCode: 'bhOther',
bodyFillType: 'preFill',
},
{
label: 'template.pcr.pcr007.cyqypgsjyjtjtj',
prop: 'cyqypgsjyjtjtj',
width: 280,
showWidth: 180,
fillType: 'preFill',
headerSelectKey: 'cyqypgsjyjtjtjUnit',
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
},
{
label: 'template.pcr.pcr007.cyqypgsjsjtjtj',
prop: 'cyqypgsjsjtjtj',
width: 280,
showWidth: 180,
fillType: 'preFill',
headerSelectKey: 'cyqypgsjsjtjtjUnit',
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber',
bodyFillType: 'actFill',
copyFrom: 'cyqypgsjyjtjtj', //复制哪个字段
bodyMaxlength: 10,
},
{
label: 'template.pcr.pcr007.cygzl',
prop: 'cygzl',
width: 280,
showWidth: 180,
fillType: 'preFill',
headerSelectKey: 'cygzlUnit',
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber',
bodyFillType: 'actFill',
bodySubType: 'button',
bodySubButtonName: 'form.hqz',
bodyMaxlength: 10,
bodySubKey: 'targetDiluentVolumePrecision',
bodyPrecisionKey: 'targetDiluentVolumePrecision',
bodySubFillType: 'actFill',
subPrecision: 0,
showBodySub: $this.fillType === 'actFill',
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
}
]
} }

+ 2
- 2
src/views/business/comps/template/formConfig/sp/SP0019.js View File

@ -1,4 +1,4 @@
export const getBaseInfoFormConfig = ($this) => {
export const getBaseInfoFormConfig = (formType) => {
return [ return [
{ {
type: 'cardItem', type: 'cardItem',
@ -16,7 +16,7 @@ export const getBaseInfoFormConfig = ($this) => {
methodCode: { methodCode: {
label: 'template.common.methodCode', label: 'template.common.methodCode',
type: 'input', type: 'input',
fillType: 'preFill',
fillType: formType === 'sp0020' ? 'actFill' : 'preFill',
maxlength: 50 maxlength: 50
}, },
versionNum: { versionNum: {

+ 51
- 7
src/views/business/comps/template/formConfig/sp/SP0020.js View File

@ -1,13 +1,57 @@
export const getSynrFormConfig = ($this) => {
// checkboxTree 类型的配置
const checkboxTreeOptions = [
{
label: '方法学验证',
value: '方法学验证',
children: [
{ label: '储备液比对', value: '储备液比对' },
{ label: '标准曲线线性范围', value: '标准曲线线性范围' },
{ label: '准确度与精密度&灵敏度', value: '准确度与精密度&灵敏度' },
{ label: '残留', value: '残留' },
{ label: '选择性与特异性', value: '选择性与特异性' },
{ label: '基质效应', value: '基质效应' },
{ label: '提取回收率', value: '提取回收率' },
{ label: '溶血基质效应', value: '溶血基质效应' },
{ label: '批最大样本数', value: '批最大样本数' },
{ label: '基质样品', value: '基质样品' },
{ label: '基质样品长期冻存稳定性', value: '基质样品长期冻存稳定性' },
{ label: '反复冻融稳定性', value: '反复冻融稳定性' },
{ label: '稀释可靠性', value: '稀释可靠性' },
{ label: '处理后样品稳定性', value: '处理后样品稳定性' },
{ label: '进样重现性', value: '进样重现性' },
{ label: '全血稳定性', value: '全血稳定性' },
{ label: '储备液短期稳定性', value: '储备液短期稳定性' },
{ label: '储备液长期稳定性', value: '储备液长期稳定性' },
{ label: '工作液短期稳定性', value: '工作液短期稳定性' },
{ label: '工作液长期稳定性', value: '工作液长期稳定性' }
]
},
{
label: '样品分析',
value: '样品分析',
children: [
{ label: '样品信息', value: '样品信息' }
]
},
{
label: '其他',
value: '其他',
children: []
}
]
//试验内容
export const getSynrFormConfig = ()=>{
return [ return [
{ {
type: 'step',
type: 'checkboxList',
config: { config: {
yqmxh: {
label: '色谱柱型号',
type: 'yq',
fillType: 'actFill',
filledCodes:['mc','bh'],
ffxyz: {
type: 'checkboxTree',
label: '方法学验证',
options:checkboxTreeOptions,
span:1,
fillType:"actFill"
}, },
} }
}, },

+ 4
- 1
src/views/business/comps/template/mixins/templateMixin.js View File

@ -62,6 +62,7 @@ export default {
studySn, studySn,
templateMc, templateMc,
templateMcEn, templateMcEn,
templateId,
templateSn, templateSn,
startDate, startDate,
bdmc, bdmc,
@ -109,7 +110,8 @@ export default {
studySn, studySn,
templateMc, templateMc,
templateMcEn, templateMcEn,
templateSn,
templateId,
templateSn,
startDate, startDate,
bdmc, bdmc,
endDate, endDate,
@ -123,6 +125,7 @@ export default {
studySn, studySn,
templateMc, templateMc,
templateMcEn, templateMcEn,
templateId,
templateSn, templateSn,
startDate, startDate,
bdmc, bdmc,

+ 8
- 7
src/views/business/study/comp/tbbd/Bj.vue View File

@ -80,7 +80,7 @@
</div> </div>
<div class="content" v-if="showIndex == 2"> <div class="content" v-if="showIndex == 2">
<TemplateTable emitName="onFillCallback" @onFillCallback="onFillCallback" ref="templateTable" <TemplateTable emitName="onFillCallback" @onFillCallback="onFillCallback" ref="templateTable"
:sn="form.templateSn" :templateData="templateData" fillType="actFill" />
:sn="templateData.templateSn" :templateData="templateData" fillType="actFill" />
</div> </div>
</div> </div>
</div> </div>
@ -588,12 +588,7 @@ export default {
if (params) { if (params) {
this.reset() this.reset()
if (params.formId && params.formId != '') { if (params.formId && params.formId != '') {
if (params.fromYt) {
this.showIndex = 1
this.bdmbTitle = this.$t('page.business.study.studyFormFill.ytbd')
} else {
this.showIndex = 2
}
this.$modal.loading() this.$modal.loading()
studyFormFill_info({ id: params.formId }).then(response => { studyFormFill_info({ id: params.formId }).then(response => {
this.form = response.data this.form = response.data
@ -601,6 +596,12 @@ export default {
this.templateData = deepClone(this.form) this.templateData = deepClone(this.form)
const obj = Object.assign({}, this.$route, { title: this.form.bdmc }) const obj = Object.assign({}, this.$route, { title: this.form.bdmc })
this.$tab.updatePage(obj); this.$tab.updatePage(obj);
if (params.fromYt) {
this.showIndex = 1
this.bdmbTitle = this.$t('page.business.study.studyFormFill.ytbd')
} else {
this.showIndex = 2
}
this.saveSimpleLog({ jcmc: '填报表单编辑', jcmcEn: 'Record Edit', name: this.form.bdmc + '(' + this.form.bdbh + ')', nameEn: this.form.bdmc + '(' + this.form.bdbh + ')' }) this.saveSimpleLog({ jcmc: '填报表单编辑', jcmcEn: 'Record Edit', name: this.form.bdmc + '(' + this.form.bdbh + ')', nameEn: this.form.bdmc + '(' + this.form.bdbh + ')' })
this.$modal.closeLoading() this.$modal.closeLoading()
}) })

Loading…
Cancel
Save