-
@@ -59,7 +60,7 @@
import HandleFormItem from '@/components/Template/HandleFormItem.vue';
import { EventBus } from '@/utils/eventBus';
import { getLatestSn } from '@/api/template';
-import { isValueEmpty } from '@/utils/index.js';
+import { isValueEmpty,justUpdateFilledFormData } from '@/utils/index.js';
export default {
inject: ['templateFillType'],
dicts: [
@@ -73,6 +74,14 @@ export default {
type: Object,
default: () => ({})
},
+ prefixKey: {
+ type: String,
+ default: ""
+ },
+ stepIndex: {
+ type: Number,
+ default: 0
+ },
},
data() {
return {
@@ -165,22 +174,68 @@ export default {
maxlength: 3,
unit:"份",
},
- {//占位
- fieldKey:"clfz_dw1",
- type:"span",
- },
+ // {//占位
+ // fieldKey:"clfz_dw1",
+ // type:"span",
+ // },
]
},
},
methods: {
+ onSure(){
+ this.$emit("onSubPackageSubmit");
+ },
+ onPrint(item){
+ console.log(item,"打印");
+ },
updateFormData(data){
this.formData = {...this.formData,...data};
+ if(data.mybh){
+ this.updateCode(data.mybh);
+ }
+ },
+ // 更新分装列表
+ async updateCode(mybh){
+ const { fzList } = this;
+ if(isValueEmpty(mybh) || isValueEmpty(fzList)){
+ return;
+ }
+ const result = await getLatestSn({
+ pre: mybh,
+ count: fzList.length,
+ type: 2,
+ })
+ if(result.code === 200){
+ const codes = result.data;
+ // 根据输入的数量生成新列表
+ for (let i = 0; i < fzList.length; i++) {
+ fzList[i].subCode = codes[i];
+ }
+ justUpdateFilledFormData()
+ }
},
// 获取按钮项
getButtonItem() {
return {
fillType: "actFill",
buttonName:"获取值",
+ key:"hqz",
+ }
+ },
+ // 获取按钮项
+ getPrintButtonItem() {
+ return {
+ fillType: "actFill",
+ buttonName:"打印",
+ key:"print",
+ }
+ },
+ // 获取确认项
+ getSureButtonItem() {
+ return {
+ fillType: "actFill",
+ buttonName:"确定",
+ key:"sure",
}
},
close() {
@@ -189,6 +244,31 @@ export default {
this.formData = {};
this.resetErrors();
},
+ onAverage() {
+ const { mfbzl } = this.formData;
+ this.fzList.forEach((item, index) => {
+ item.prenum = mfbzl;
+ // 同时更新错误状态
+ if (this.fzListErrors[index] !== undefined) {
+ this.$set(this.fzListErrors, index, false);
+ }
+ })
+ // 清除相关字段的错误状态
+ this.formErrors.mfbzl = false;
+ justUpdateFilledFormData()
+ },
+ onReset() {
+ this.fzList.forEach((item, index) => {
+ item.num = "";
+ // 同时更新错误状态
+ if (this.fzListErrors[index] !== undefined) {
+ this.$set(this.fzListErrors, index, false);
+ }
+ })
+ // 清除相关字段的错误状态
+ this.formErrors.mfbzl = false;
+ justUpdateFilledFormData()
+ },
validateFormData() {
let isValid = true;
@@ -255,29 +335,15 @@ export default {
// 清空现有列表
this.fzList = [];
this.fzListErrors = [];
- const result = await getLatestSn({
- pre: this.formData.mybh,
- count: e,
- type: 2,
- })
- if(result.code === 200){
- const codes = result.data;
- // 根据输入的数量生成新列表
- for (let i = 0; i < e; i++) {
+ for (let i = 0; i < e; i++) {
this.fzList.push({
prenum: "",
actnum: "",
- subCode: codes[i],
+ subCode: "",
});
}
- const params = {
- type: "fieldChanged",
- newRecord: null,
- resourceList: null,
- }
- EventBus.$emit("onModifyRecord", params);
-
- }
+ justUpdateFilledFormData()
+
},
onGetValue(item) {
@@ -416,9 +482,9 @@ export default {
align-items: center;
}
-.header-container {
+.zl-header-container {
display: grid;
- grid-template-columns: 1fr 1fr 1fr;
+ grid-template-columns: repeat(2, 1fr);
grid-gap: 20px;
margin-top: 10px;
}
@@ -429,6 +495,7 @@ export default {
border-radius: 4px;
display: flex;
align-items: center;
+ justify-content: flex-start;
// padding: 20px;
}
@@ -459,5 +526,15 @@ export default {
margin-right: 5px;
// width: 200px;
}
-
+.sure-button-row{
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ margin-top: 20px;
+ position: relative;
+ padding: 20px;
+}
+.absolute{
+ position: absolute;
+ }
\ No newline at end of file
diff --git a/src/components/Template/StepComponents/ry/zlfz.vue b/src/components/Template/StepComponents/ry/zlfz.vue
index 3e0f5bf..f478ca1 100644
--- a/src/components/Template/StepComponents/ry/zlfz.vue
+++ b/src/components/Template/StepComponents/ry/zlfz.vue
@@ -1,8 +1,9 @@
@@ -28,7 +29,7 @@ export default {
type: "input",
fillType: "preFill",
},
- yq: {
+ gsp: {
type: "gsp",
fillType: "actFill",
},
@@ -49,13 +50,22 @@ export default {
}
},
methods: {
- onDialogSubmit(data,key){
- console.log(data,key,"onDialogSubmit")
- if(key === 'yq'){//供试品弹窗确定
- this.$refs.stepFormPackageRef.updateZlfzData("zlfz",{mybh:data.selectedId});
+ onRegentSubmit(data){
+ console.log(data,"onRegentSubmit")
+ const {key,selectInfo} = data;
+ if(key === 'gsp'){//供试品弹窗确定
+ this.$refs.stepFormPackageRef.updateZlfzData("zlfz",{mybh:selectInfo.selectedId});
// this.formData[key] = data;
}
+ },
+ async onSubPackageSubmit(data){
+ const {key} = data;
+ if(key === 'zlfz'){
+ const formData = await this.$refs.stepFormPackageRef.getFormData();
+ console.log(formData,"formData")
+
+ }
}
}
}
diff --git a/src/components/Template/StepFormPackage.vue b/src/components/Template/StepFormPackage.vue
index 2d83c19..099af63 100644
--- a/src/components/Template/StepFormPackage.vue
+++ b/src/components/Template/StepFormPackage.vue
@@ -49,7 +49,9 @@
{{ formFields[key] }}
- onSubPackageUpdate(data,key)" :subData = "formFields[key]" :ref="'zlSubPackageRef_'+key" />
+ onSubPackageUpdate(data,key)" :subData = "formFields[key]" :ref="'zlSubPackageRef_'+key" />
@@ -97,6 +99,10 @@ export default {
prefixKey: {
type: String,
default: ""
+ },
+ stepIndex: {
+ type: Number,
+ default: 0
}
},
mounted() {
@@ -115,6 +121,10 @@ export default {
}
},
methods: {
+ // 子组件提交处理方法
+ onSubPackageSubmit(key){
+ this.$emit("onSubPackageSubmit", {key,formData:this.formFields});
+ },
// //试剂/仪器等弹窗提交
onRegentSubmit(data,key,item){
this.updateFormData(key,data.selectedId);
@@ -123,7 +133,7 @@ export default {
this.allFieldsConfig[key].sjSelectType = data.selectType;
}
this.formFields[`selectInfo_${key}`] = data.selectInfo;
- // this.$emit("onRegentSubmit", {selectInfo:data,key,config:item});
+ this.$emit("onRegentSubmit", {selectInfo:data,key,config:item});
},
getRegentItem(item,fieldCode="type"){
const type = item[fieldCode] ;
diff --git a/src/utils/formPackageCommon.js b/src/utils/formPackageCommon.js
index 9fb003e..cfb6814 100644
--- a/src/utils/formPackageCommon.js
+++ b/src/utils/formPackageCommon.js
@@ -5,7 +5,7 @@ export const isShowOther = (v = [], col) => {
}
// 确保v是数组类型,以避免类型错误
const arr = Array.isArray(v) ? v : [v]
- const otherArr = ['其他', '遮光', 'CA-QC Dilution-', '拒绝', '部分接受',"污染"]
+ const otherArr = ['其他', '遮光', 'CA-QC Dilution-', '拒绝', '部分接受', "污染"]
return arr.some((item) => otherArr.includes(item))
}
@@ -19,7 +19,25 @@ export const isShowOtherByRadioAndOther = (v = '', col) => {
}
//checkboxTree判断是否显示其他输入框
-export const isShowOtherByCheckboxTree = (v = "")=>{
- const otherArr = ['其他', '样品信息', '样品','部分接受']
- return otherArr.includes(v)
+export const isShowOtherByCheckboxTree = (v = "") => {
+
+ const otherArr = ['其他', '样品信息', '样品', '部分接受', '给药 ',
+ '样本采集',
+ '日常观察 ',
+ '皮肤评分',
+ '眼刺激评分',
+ '麻醉 ',
+ '交配确认',
+ 'PND检测',
+ '神经行为功能评测',
+ '血糖测定',
+ '遥测数据采集',
+ '呼吸检测',
+ '血压测定',
+ '心电检测',
+ '体温测定',
+ '毒代 TK',
+ '药代 PK'
+ , '细胞因子']
+ return otherArr.includes(v)
}