Browse Source

feat:[模板管理][yp003]

ouqian
luojie 1 month ago
parent
commit
54ac3b46df
6 changed files with 159 additions and 14 deletions
  1. +12
    -5
      src/components/Template/BaseInfoFormPackage.vue
  2. +4
    -7
      src/components/Template/HandleFormItem.vue
  3. +1
    -1
      src/utils/formPackageCommon.js
  4. +3
    -1
      src/views/business/comps/template/TemplateTable.vue
  5. +124
    -0
      src/views/business/comps/template/comps/sp/SP0020.vue
  6. +15
    -0
      src/views/business/comps/template/formConfig/sp/SP0020.js

+ 12
- 5
src/components/Template/BaseInfoFormPackage.vue View File

@ -40,7 +40,7 @@
</div> </div>
<div class="p-l-20"> <div class="p-l-20">
<div v-show="isShowOther(formFields[key])"> <div v-show="isShowOther(formFields[key])">
<div class="form-title">{{ sItem.otherLabel ? $t(sItem.otherLabel) :
<div class="form-title" >{{ sItem.otherLabel ? $t(sItem.otherLabel) :
$t("template.common.other") }}</div> $t("template.common.other") }}</div>
<div class="flex flex1"> <div class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" <HandleFormItem :field-item-label="fieldItemLabel"
@ -90,7 +90,7 @@
@change="(e, type) => onSelectChange(key, e, type)" :error="errors[key]" @change="(e, type) => onSelectChange(key, e, type)" :error="errors[key]"
@update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" /> @update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" />
<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) :
<div class="other-title" v-if="isShowOtherTitle(sItem)">{{ sItem.otherLabel ? $t(sItem.otherLabel) :
$t("template.common.other") }}</div> $t("template.common.other") }}</div>
<div class="flex"> <div class="flex">
<HandleFormItem :field-item-label="fieldItemLabel" <HandleFormItem :field-item-label="fieldItemLabel"
@ -192,7 +192,7 @@
: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 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) :
<div class="other-title" v-if="isShowOtherTitle(sItem)">{{ sItem.otherLabel ? $t(sItem.otherLabel) :
$t("template.common.other") }}</div> $t("template.common.other") }}</div>
<div class="flex"> <div class="flex">
<HandleFormItem :field-item-label="fieldItemLabel" <HandleFormItem :field-item-label="fieldItemLabel"
@ -241,7 +241,7 @@
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false" :error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
:value="formFields[sItem.subKey]" /> :value="formFields[sItem.subKey]" />
<div v-show="isShowOther(formFields[sItem.subKey])" class="flex flex1"> <div v-show="isShowOther(formFields[sItem.subKey])" class="flex flex1">
<div class="other-title">{{ sItem.otherLabel ? $t(sItem.otherLabel) :
<div class="other-title" v-if="isShowOtherTitle(sItem)">{{ sItem.otherLabel ? $t(sItem.otherLabel) :
$t("template.common.other") }}</div> $t("template.common.other") }}</div>
<div class="flex flex1"> <div class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" <HandleFormItem :field-item-label="fieldItemLabel"
@ -406,7 +406,14 @@ export default {
onFqyqChange(key, e) { onFqyqChange(key, e) {
console.log(e, key, 'fqyq'); console.log(e, key, 'fqyq');
this.formFields[key] = e; this.formFields[key] = e;
}
},
//
isShowOtherTitle(sItem){
if (sItem.hasOwnProperty("showOtherLabel")) {
return sItem.showOtherLabel
}
return true
},
} }
} }

+ 4
- 7
src/components/Template/HandleFormItem.vue View File

@ -309,10 +309,7 @@ export default {
watch: { watch: {
value(newVal) { value(newVal) {
if (this.type === 'checkboxList' && newVal && typeof newVal === 'object') { if (this.type === 'checkboxList' && newVal && typeof newVal === 'object') {
this.checkboxListValue = {
checkboxValues: newVal.checkboxValues || [],
otherValues: newVal.otherValues || {}
};
this.checkboxListValue = JSON.parse(JSON.stringify(newVal));
} else if (this.type === 'checkboxTag' && Array.isArray(newVal)) { } else if (this.type === 'checkboxTag' && Array.isArray(newVal)) {
// checkboxTagvalue // checkboxTagvalue
this.checkboxTagList = newVal.map(tag => ({ this.checkboxTagList = newVal.map(tag => ({
@ -916,7 +913,7 @@ export default {
const { otherValues: oldOtherValues,checkboxValues: oldCheckboxValues } = this.oldCheckboxListValue; const { otherValues: oldOtherValues,checkboxValues: oldCheckboxValues } = this.oldCheckboxListValue;
const o = { const o = {
"checkboxListValue":{oldValue:oldCheckboxValues,newValue:checkboxValues,des:""}, "checkboxListValue":{oldValue:oldCheckboxValues,newValue:checkboxValues,des:""},
"checkboxListOther":{oldValue:oldOtherValues[this.currentOtherCode],newValue:otherValues[this.currentOtherCode],des:""},
"checkboxListOther":{oldValue:oldOtherValues[this.currentOtherCode],newValue:otherValues[this.currentOtherCode],des:"样品信息:"},
} }
return o[this.currentHandleType]; return o[this.currentHandleType];
}, },
@ -1067,8 +1064,8 @@ export default {
isModify = !!this.oldFqyqValue.mainRadio isModify = !!this.oldFqyqValue.mainRadio
}else if(this.type === "checkboxList"){ }else if(this.type === "checkboxList"){
const current = this.getCheckboxListInfo(); const current = this.getCheckboxListInfo();
recordOldVlaue = `${current.oldValue || ''}`;
recordValue = `${current.newValue || ''}`;
recordOldVlaue = `${current.des+(current.oldValue || '')}`;
recordValue = `${current.des+(current.newValue || '')}`;
isModify = !!current.oldValue; isModify = !!current.oldValue;
} }
const record = { const record = {

+ 1
- 1
src/utils/formPackageCommon.js View File

@ -5,7 +5,7 @@ export const isShowOther = (v = [], col) => {
} }
// 确保v是数组类型,以避免类型错误 // 确保v是数组类型,以避免类型错误
const arr = Array.isArray(v) ? v : [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)) return arr.some((item) => otherArr.includes(item))
} }

+ 3
- 1
src/views/business/comps/template/TemplateTable.vue View File

@ -31,6 +31,7 @@ import SP007 from "./comps/sp/SP007.vue";
import SP008 from "./comps/sp/SP008.vue"; import SP008 from "./comps/sp/SP008.vue";
import SP009 from "./comps/sp/SP009.vue"; import SP009 from "./comps/sp/SP009.vue";
import SP0019 from "./comps/sp/SP0019.vue"; import SP0019 from "./comps/sp/SP0019.vue";
import SP0020 from "./comps/sp/SP0020.vue";
import Demo from "./comps/sp/Demo.vue"; import Demo from "./comps/sp/Demo.vue";
// //
import GSP001 from "./comps/gsp/GSP001.vue"; import GSP001 from "./comps/gsp/GSP001.vue";
@ -111,7 +112,7 @@ export default {
// //
GSP001,GSP002, GSP003, GSP004,GSP009, GSP010, GSP001,GSP002, GSP003, GSP004,GSP009, GSP010,
// //
SP001, SP003, SP00456,SP007, SP008, SP009,SP0019,
SP001, SP003, SP00456,SP007, SP008, SP009,SP0019,SP0020,
// PCR // PCR
PCR002, PCR003, PCR004, PCR005, PCR002, PCR003, PCR004, PCR005,
//LBA //LBA
@ -206,6 +207,7 @@ export default {
'SP017': 'SP008', 'SP017': 'SP008',
'SP018': 'SP008', 'SP018': 'SP008',
'SP019': 'SP0019', 'SP019': 'SP0019',
'SP020': 'SP0020',
// //
'GSP001': 'GSP001', 'GSP001': 'GSP001',

+ 124
- 0
src/views/business/comps/template/comps/sp/SP0020.vue View File

@ -0,0 +1,124 @@
<!-- 生物样品分析溶液配制表 -->
<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" />
<LineLabel label="试验内容" />
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
</div>
<!-- <button @click="onSave">保存</button> -->
</div>
</template>
<script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
import { getBaseInfoFormConfig} from "../../formConfig/sp/SP0019";
import { getSynrFormConfig} from "../../formConfig/sp/SP0020";
export default {
name: "SP0020",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
synrFormConfig(){
return getSynrFormConfig(this);
},
//
baseInfoFormConfig() {
return getBaseInfoFormConfig(this);
},
//
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
},
data() {
return {
formData: {},
compRefs:["baseInfoRef", "storageConditionRef", "spzxhRef","yqInfoTableRef","ryTableRef", "remarkRef"]
};
},
mounted() {
},
methods: {
onRegentSubmit(e){
const {selectInfo, key, col, rowIndex, colIndex, rowData} = e;
const {row} = selectInfo;
if(key === "rymc"){
const params = {
pzrq: row.pzrq,
sxr: row.sxr,
}
this.$refs.ryTableRef.updateDataSourceByRowIndex(rowIndex, params);
}
},
onYqSubmit(data, col, rowIndex, colIndex, row){
console.log(data, col, rowIndex, colIndex, row,"onRegentSubmit")
},
//
getFilledFormData() {
return this.getFilledFormDataByRefs(this.compRefs)
},
//
async getFormData() {
let content = await this.validFormFields(this.compRefs);
console.log(content)
return content;
},
//
async onSave() {
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
.print-btn {
margin-bottom: 20px;
}
</style>

+ 15
- 0
src/views/business/comps/template/formConfig/sp/SP0020.js View File

@ -0,0 +1,15 @@
export const getSynrFormConfig = ($this) => {
return [
{
type: 'step',
config: {
yqmxh: {
label: '色谱柱型号',
type: 'yq',
fillType: 'actFill',
filledCodes:['mc','bh'],
},
}
},
]
}

Loading…
Cancel
Save