Browse Source

feat:[模板管理][生物样品分析溶液配制表

]
luojie
luojie 1 week ago
parent
commit
3cdb9ab995
10 changed files with 668 additions and 116 deletions
  1. +41
    -34
      src/components/Template/BaseInfoFormPcakge.vue
  2. +163
    -0
      src/components/Template/CustomTable.vue
  3. +33
    -29
      src/components/Template/Step.vue
  4. +1
    -0
      src/components/Template/StepComponents/ContainerStep.vue
  5. +1
    -1
      src/store/modules/template.js
  6. +22
    -2
      src/views/business/comps/template/TemplateTable.vue
  7. +297
    -0
      src/views/business/comps/template/comps/sp/Demo.vue
  8. +106
    -46
      src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue
  9. +3
    -3
      src/views/business/comps/template/mixins/templateMixin.js
  10. +1
    -1
      src/views/business/template/list.vue

+ 41
- 34
src/components/Template/BaseInfoFormPcakge.vue View File

@ -67,7 +67,7 @@
<div class="grid-container gap2"> <div class="grid-container gap2">
<div v-for="(sItem, key) in item.config" class="c-Item flex item-center" :class="getSpanClass(sItem)" <div v-for="(sItem, key) in item.config" class="c-Item flex item-center" :class="getSpanClass(sItem)"
:key="key"> :key="key">
<div class="step-title" v-if="sItem.label">{{ sItem.label }}</div>
<div class="step-form-title" v-if="sItem.label">{{ sItem.label }}</div>
<div v-if="sItem.type === 'dateTime'"> <div v-if="sItem.type === 'dateTime'">
<HandleFormItem type="dateTime" :item="sItem" v-model="formFields[key]" <HandleFormItem type="dateTime" :item="sItem" v-model="formFields[key]"
@copy="onCopy(sItem, key)" /> @copy="onCopy(sItem, key)" />
@ -158,6 +158,7 @@ export default {
return { return {
label: sItem.label, label: sItem.label,
options: sItem.subOptions || [], options: sItem.subOptions || [],
fillType: sItem.subFillType || sItem.fillType,
} }
}, },
isShowOther(v = []) { isShowOther(v = []) {
@ -183,22 +184,22 @@ export default {
let value = formData[key]; let value = formData[key];
// //
if (currentConfig.type === 'select' && currentConfig.multiple) {
if (!Array.isArray(value)) {
//
value = value ? [value] : [];
}
}
// if (currentConfig.type === 'select' && currentConfig.multiple) {
// if (!Array.isArray(value)) {
// //
// value = value ? [value] : [];
// </span><span class="err"> pan> }
// }
// null/undefined
if (value === null || value === undefined) {
//
if (currentConfig.type === 'select' && currentConfig.multiple) {
value = [];
} else {
value = '';
}
}
// // null/undefined
// if (value === null || value === undefined) {
// //
// if (currentConfig.type === 'select' && currentConfig.multiple) {
// value = [];
// } else {
// value = '';
// </span><span class="err"> pan> }
// }
// formFields // formFields
if (formFields[key] !== null && if (formFields[key] !== null &&
@ -239,21 +240,27 @@ export default {
}, },
getFormData() { getFormData() {
const { formFields, allFieldsConfig } = this; const { formFields, allFieldsConfig } = this;
const { templateStatus } = this.$store.state.template;
return new Promise((resolve,reject)=>{ return new Promise((resolve,reject)=>{
for (const key in formFields) { for (const key in formFields) {
if (!formFields[key]) {
const o = allFieldsConfig[key];
let prefix = "";
if (o.type === "input") {
prefix = "填写"
} else {
prefix = "选择"
console.log(key,formFields[key])
if (!formFields[key]) {
const o = allFieldsConfig[key];
console.log(templateStatus,o.fillType,"fill")
if (o.fillType == templateStatus) {
let prefix = "";
if (o.type === "input") {
prefix = "填写"
} else {
prefix = "选择"
}
this.$message.error(`${o.label}还未${prefix}${prefix}后再提交`);
reject(`${o.label}还未${prefix}`);
return;
}
} }
this.$message.error(`${o.label}还未${prefix}${prefix}后再提交`);
reject("还未填写完");
return;
} }
}
resolve(formFields) resolve(formFields)
}) })
@ -266,14 +273,14 @@ export default {
// //
const currentConfig = this.allFieldsConfig[key]; const currentConfig = this.allFieldsConfig[key];
//
if (currentConfig && currentConfig.multiple) {
//
this.formFields[key] = Array.isArray(val) ? val : (val ? [val] : []);
} else {
// //
// if (currentConfig && currentConfig.multiple) {
// //
// this.formFields[key] = Array.isArray(val) ? val : (val ? [val] : []);
// } else {
// //
this.formFields[key] = val; this.formFields[key] = val;
}
// }
this.$emit("select", { key, value: val }); this.$emit("select", { key, value: val });
}, },
@ -342,7 +349,7 @@ export default {
font-weight: normal; font-weight: normal;
color: #606266; color: #606266;
} }
.step-title{
.step-form-title{
font-size: 14px; font-size: 14px;
font-weight: normal; font-weight: normal;
color: #606266; color: #606266;

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

@ -0,0 +1,163 @@
<template>
<div class="custom-table-wrapper">
<div class="custom-table-header">
<div class="custom-table-row">
<div
v-for="(col, index) in columns"
:key="index"
class="custom-table-cell header-cell"
:style="{ width: col.width ? col.width + 'px' : 'auto' }"
>
<div>{{ col.label }}</div>
<template v-if="col.showSelect&& col.options">
<select v-model="col.selected" @change="onHeaderSelectChange(index, $event)">
<option value="" disabled>{{ col.placeholder || '请选择' }}</option>
<option
v-for="opt in col.options"
:key="opt.value"
:value="opt.value"
>
{{ opt.label }}
</option>
</select>
</template>
</div>
</div>
</div>
<div class="custom-table-body">
<div
v-for="(row, rowIndex) in dataSource"
:key="rowIndex"
class="custometable-row"
>
<div
v-for="(col, colIndex) in columns"
:key="colIndex"
class="custom-table-cell body-cell"
:style="{ width: col.width ? col.width + 'px' : 'auto' }"
>
{{ row[col.prop] }}
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'CustomTable',
props: {
columns: {
type: Array,
required: true,
//
// [
// { label: '', prop: 'name' },
// { label: '', prop: 'status', type: 'select', options: [{value:1,label:''},...], selected: null }
// ]
},
dataSource: {
type: Array,
required: true
}
},
methods: {
onHeaderSelectChange(colIndex, event) {
this.$emit('header-select-change', colIndex, event.target.value);
}
}
};
</script>
<style scoped>
.custom-table-wrapper {
border: 1px solid #ebeef5;
border-radius: 4px;
overflow: hidden;
font-size: 14px;
color: #606266;
}
/* 表头 */
.custom-table-header {
background-color: #f5f7fa;
border-bottom: 1px solid #ebeef5;
white-space: nowrap;
display: block;
}
.custom-table-body {
max-height: 300px; /* 可根据需要调整或由父组件控制 */
}
/* 共同行样式 */
.custom-table-row {
display: table;
width: 100%;
table-layout: fixed;
}
.custometable-row {
display: table;
width: 100%;
table-layout: fixed;
}
/* 单元格 */
.custom-table-cell {
display: table-cell;
padding: 12px 10px;
text-align: left;
vertical-align: middle;
border-right: 1px solid #ebeef5;
box-sizing: border-box;
}
.custom-table-cell:last-child {
border-right: none;
}
.header-cell {
font-weight: bold;
color: #909399;
background-color: #f5f7fa;
}
.body-cell {
color: #606266;
background-color: #fff;
}
/* select 样式(模仿 Element UI) */
.header-cell select {
width: 100%;
padding: 4px 8px;
border: 1px solid #dcdfe6;
border-radius: 4px;
outline: none;
background-color: #fff;
font-size: 13px;
color: #606266;
appearance: none; /* 隐藏默认箭头(可选) */
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
background-repeat: no-repeat;
background-position: right 8px center;
background-size: 14px;
padding-right: 28px;
}
/* 滚动容器:如果整体宽度超限,显示横向滚动条 */
.custom-table-wrapper {
display: flex;
flex-direction: column;
max-width: 100%; /* 父容器决定宽度 */
overflow-x: auto;
}
.custom-table-header,
.custom-table-body {
min-width: 100%;
}
</style>

+ 33
- 29
src/components/Template/Step.vue View File

@ -1,24 +1,13 @@
<template> <template>
<div class="step-container"> <div class="step-container">
<div class="step-header">
<el-button type="primary" @click="addStep" icon="el-icon-plus">添加步骤</el-button>
</div>
<el-button v-if = "isShowAddStep()" type="primary" @click="addStep" icon="el-icon-plus">添加步骤</el-button>
<div class="step-list"> <div class="step-list">
<div <div
v-for="(step, index) in steps" v-for="(step, index) in steps"
:key="step.id" :key="step.id"
class="step-item" class="step-item"
> >
<div class="step-header-item">
<el-button
type="text"
@click="removeStep(index)"
icon="el-icon-delete"
class="delete-btn"
:disabled="steps.length === 1"
></el-button>
</div>
<div class="step-content"> <div class="step-content">
<span class="step-title">步骤{{ index + 1 }}</span> <span class="step-title">步骤{{ index + 1 }}</span>
@ -41,6 +30,14 @@
:step-data="step.formData" :step-data="step.formData"
@update="onFormUpdate(index, $event)"> @update="onFormUpdate(index, $event)">
</component> </component>
<div class="step-header-item">
<el-button
type="text"
@click="removeStep(index)"
icon="el-icon-delete"
class="delete-btn"
></el-button>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -77,21 +74,21 @@ export default {
return { return {
stepTypes: [ stepTypes: [
{ label: '容器选择', value: 'container' }, { label: '容器选择', value: 'container' },
{ label: '离心', value: 'centrifuge' },
{ label: '自动称量', value: 'autoWeigh' },
{ label: '手动称量', value: 'manualWeigh' },
{ label: '加入溶液', value: 'addSolution' },
{ label: '混合', value: 'mix' },
{ label: '超声', value: 'ultrasound' },
{ label: '抽滤', value: 'filtration' },
{ label: '分装', value: 'package' },
{ label: '封装2管', value: 'seal2' },
{ label: '封装3管', value: 'seal3' },
{ label: '漩涡混匀', value: 'vortex' },
{ label: '包被', value: 'coat' },
{ label: '静置开始', value: 'staticStart' },
{ label: '静置结束', value: 'staticEnd' },
{ label: '取板', value: 'takePlate' }
// { label: '', value: 'centrifuge' },
// { label: '', value: 'autoWeigh' },
// { label: '', value: 'manualWeigh' },
// { label: '', value: 'addSolution' },
// { label: '', value: 'mix' },
// { label: '', value: 'ultrasound' },
// { label: '', value: 'filtration' },
// { label: '', value: 'package' },
// { label: '2', value: 'seal2' },
// { label: '3', value: 'seal3' },
// { label: '', value: 'vortex' },
// { label: '', value: 'coat' },
// { label: '', value: 'staticStart' },
// { label: '', value: 'staticEnd' },
// { label: '', value: 'takePlate' }
], ],
steps: [], steps: [],
stepId: 1, stepId: 1,
@ -166,6 +163,10 @@ export default {
} }
}, },
methods: { methods: {
isShowAddStep() {
const {templateStatus} = this.$store.state.template
return templateStatus === 'preFill';
},
addStep() { addStep() {
try { try {
this.steps.push({ this.steps.push({
@ -309,6 +310,10 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.step-container { .step-container {
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
margin-top: 24px;
padding: 24px;
border-radius: 5px 5px;
.step-header { .step-header {
margin-bottom: 20px; margin-bottom: 20px;
padding: 15px; padding: 15px;
@ -319,7 +324,6 @@ export default {
.step-list { .step-list {
.step-item { .step-item {
margin-bottom: 20px; margin-bottom: 20px;
border: 1px solid #e4e7ed;
border-radius: 6px; border-radius: 6px;
overflow: hidden; overflow: hidden;

+ 1
- 0
src/components/Template/StepComponents/ContainerStep.vue View File

@ -27,6 +27,7 @@ export default {
containerType: { containerType: {
label: '容器选择', label: '容器选择',
placeholder: '请选择', placeholder: '请选择',
fillType:"actFill",
options: [ options: [
{ label: '离心管', value: 'centrifugeTube' }, { label: '离心管', value: 'centrifugeTube' },
{ label: '试管', value: 'testTube' }, { label: '试管', value: 'testTube' },

+ 1
- 1
src/store/modules/template.js View File

@ -1,7 +1,7 @@
const template = { const template = {
namespaced: true, namespaced: true,
state: { state: {
templateStatus:"",//模板状态 "actFill" 实际填报 "preFill" 预填 ”qc“
templateStatus:"",//模板状态 "actFill"(实际填报) "preFill"(预填) ”qc“(qc) "detail"(详情)
}, },
mutations: { mutations: {
SET_TEMPLATE_STATUS: (state, status) => { SET_TEMPLATE_STATUS: (state, status) => {

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

@ -1,7 +1,9 @@
<template> <template>
<div class="template-table"> <div class="template-table">
<SP001 v-if="sn == 'SP0012'" />
<SWYPFXRYPZB v-if="sn == 'SP001'" />
<!-- <SP001 v-if="sn == 'SP0012'" />
<SWYPFXRYPZB v-if="sn == 'SP001'" /> -->
<component :is="getTemplateComponent()" :fillType="fillType">
</component>
</div> </div>
</template> </template>
@ -18,6 +20,21 @@ export default {
sn: { sn: {
type: String, type: String,
default: '', default: '',
},
fillType: {
type: String,
default: 'preFill',
}
},
computed: {
templateComponentMap() {
if (!this.componentMap) {
this.componentMap = {
'SP001': 'SWYPFXRYPZB',
}
}
return this.componentMap
} }
}, },
watch: { watch: {
@ -35,6 +52,9 @@ export default {
mounted() { mounted() {
}, },
methods: { methods: {
getTemplateComponent() {
return this.templateComponentMap[this.sn]
},
} }
}; };
</script> </script>

+ 297
- 0
src/views/business/comps/template/comps/sp/Demo.vue View File

@ -0,0 +1,297 @@
<!-- 生物样品分析溶液配制表 -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">生物样品分析溶液配制表<img
src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<LineLabel label = "试验基本信息"/>
<BaseInfoFormPcakge ref = "baseInfo" :formConfig = "formConfig" :formData = "formData"/>
<LineLabel class="mt-20" label = "试验试剂信息"/>
<TableList class="mt-20" :columns = "sysjColumns" :dataSource = "dataSource"/>
<LineLabel class="mt-20" label = "仪器使用信息"/>
<TableList class="mt-20" :columns = "yqsColumns" :dataSource = "dataSource"/>
<LineLabel class="mt-20" label = "存储条件"/>
<BaseInfoFormPcakge ref = "storageCondition" :formConfig = "storageFormConfig" :formData = "formData"/>
<LineLabel class="mt-20" label = "操作步骤"/>
<div class="template-form-item">
<BaseInfoFormPcakge ref = "stepFormPackage" :formConfig = "stepFormConfig" :formData = "formData"/>
<!-- <CustomTable class="mt-20" :columns = "stepColumns" :dataSource = "stepDataSource"/> -->
</div>
<Step ref = "stepRef"></Step>
</div>
</div>
<button @click = "onSave">保存</button>
</div>
</div>
</template>
<script>
import BaseInfoFormPcakge from "@/components/Template/BaseInfoFormPcakge";
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'
export default {
name: "SWYPFXRYPZB",
components: { BaseInfoFormPcakge,LineLabel,TableList,Step,CustomTable },
mixins: [templateMixin],
props: {
value: {
type: {},
default: () => { },
}
},
watch: {
value: {
immediate: true,
handler(v) {
}
}
},
data() {
return {
dataSource:[{name:"名称1"}],
stepDataSource:[{
code1:"目标溶液编号1",
code1:"目标溶液编号1",
code1:"目标溶液编号1",
code1:"目标溶液编号1",
code1:"目标溶液编号1",
code1:"目标溶液编号1",
code1:"目标溶液编号1",
code1:"目标溶液编号1",
code1:"目标溶液编号1",
code2:"起始溶液编号1",
code3:"预设起始溶液体积1",
code4:"实际起始溶液体积1",
code5:"预设稀释液体积1",
code6:"实际稀释液体积1",
code7:"预设目标溶液浓度1",
code8:"实际目标溶液浓度1",
}],
stepColumns:[
{label:"目标溶液编号",prop:"code1",width: 120},
{label:"起始溶液编号",prop:"code2",width: 120},
{label:"起始溶液编号",prop:"code2",width: 120},
{label:"起始溶液编号",prop:"code2",width: 120},
{label:"起始溶液编号",prop:"code2",width: 120},
{label:"起始溶液编号",prop:"code2",width: 120},
{label:"起始溶液编号",prop:"code2",width: 120},
{label:"起始溶液编号",prop:"code2",width: 120},
{label:"起始溶液编号",prop:"code2",width: 120},
{
label:"预设起始溶液体积",prop:"code3",showSelect: true,
options: [
{ label: 'mg', value: 'mg' },
{ label: 'ng', value: 'ng' },
]
},
{
label:"实际起始溶液体积",prop:"code4",showSelect: true,width: 180,
options: [
{ label: 'mg', value: 'mg' },
{ label: 'ng', value: 'ng' },
]
},
{
label:"预设稀释液体积",prop:"code5",showSelect: true,width: 180,
options: [
{ label: 'mg', value: 'mg' },
{ label: 'ng', value: 'ng' },
]
},
{
label:"实际稀释液体积",prop:"code6",showSelect: true,width: 180,
options: [
{ label: 'mg', value: 'mg' },
{ label: 'ng', value: 'ng' },
]
},
{
label:"预设目标溶液浓度",prop:"code7",showSelect: true,width: 180,
options: [
{ label: 'mg', value: 'mg' },
{ label: 'ng', value: 'ng' },
]
},
{
label:"实际目标溶液浓度",prop:"code8",showSelect: true,width: 180,
options: [
{ label: 'mg', value: 'mg' },
{ label: 'ng', value: 'ng' },
]
},
],
sysjColumns:[
{label:"试剂名称",prop:"name"},
{label:"编号",prop:"name"},
{label:"批号",prop:"name"},
{label:"浓度/含量/纯度",prop:"name"},
{label:"来源",prop:"name"},
{label:"失效日",prop:"name"},
],
yqsColumns:[
{label:"仪器名称",prop:"name"},
{label:"仪器型号",prop:"name"},
{label:"仪器编号",prop:"name"},
{label:"下次测试/校准/检定日期",prop:"name"},
],
storageFormConfig:[
{
type:"conditionItem",
config:{
storageCondition1:{
label:"存储条件",
type:"select",
fillType:"preFill",
options:[],
otherCode:"other1",
},
}
}
],
formConfig: [
{
type:"cardItem",
config:{
name:{
label:"试验名称",
type:"input",
disabled:true,
},
code:{
label:"试验编号",
type:"input",
disabled:true,
},
methodCode:{
label:"方法编号",
type:"input",
fillType:"preFill",
copyFrom:"name",//
},
versionNum:{
label:"版本号",
type:"input",
fillType:"actFill"
},
}
},
{
type:"conditionItem",
label:"试验配制条件",
config:{
pre:{
label:"预填",
type:"select",
multiple:true,
fillType:"preFill",
options:[
{label:"白光",value:"1"},
{label:"黄光",value:"3"},
{label:"其他",value:"-1"},
],
otherCode:"other1",
},
act:{
label:"实际",
type:"select",
fillType:"actFill",
otherCode:"other2",
multiple:true,
options:[
{label:"白光",value:"1"},
{label:"黄光",value:"3"},
{label:"其他",value:"-1"},
]
}
}
},
{
type:"cellItem",
label:"配置时间",
config:{
startDate:{
label:"开始时间",
type:"dateTime",
},
endDate:{
label:"结束时间",
type:"dateTime",
},
}
}
],
stepFormConfig:[
{
type:"step",
config:{
startDate:{
label:"目标溶液名称",
type:"input",
},
endDate:{
label:"目标溶液编号",
type:"input",
subType:"span",
subKey:"targetCode1",
},
target:{
label:"目标溶液预计浓度",
type:"input",
subType:"select",
subKey:"taget1",
subOptions:[
{label:"mg",value:"mg"},
{label:"ng",value:"ng"},
],
},
target:{
label:"目标溶液预计浓度",
type:"input",
subType:"clickable",
subKey:"taget1c",
},
}
}
],
formData:{}
};
},
mounted() {
setTimeout(()=>{
this.formData = {
// code:"code1",name:"name1",act:["1","-1"],taget1:"mg",targetCode1:"123456",taget1c:""
}
},3000)
setTimeout(()=>{
this.storageFormConfig[0].config.storageCondition1.options = [
{label:"白光",value:"1"},
{label:"黄光",value:"3"},
{label:"其他",value:"-1"},
]
},4000)
},
methods: {
async onSave(){
// const result1 = await this.$refs.baseInfo.getFormData();
// const result2 = await this.$refs.storageCondition.getFormData();
// const result3 = await this.$refs.stepRef.getFormData();
const result = await this.$refs.stepFormPackage.getFormData();
console.log(result,"reee")
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20{
margin-top: 20px;
}
</style>

+ 106
- 46
src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue View File

@ -4,6 +4,8 @@
<div class="detail-container"> <div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">生物样品分析溶液配制表<img <div class="detail-title"><img src="@/assets/images/detail-title.png">生物样品分析溶液配制表<img
src="@/assets/images/detail-title.png" /></div> src="@/assets/images/detail-title.png" /></div>
<button @click = "onSave">保存</button>
<div class="detail-content"> <div class="detail-content">
<div class="content"> <div class="content">
<LineLabel label = "试验基本信息"/> <LineLabel label = "试验基本信息"/>
@ -12,6 +14,7 @@
<TableList class="mt-20" :columns = "sysjColumns" :dataSource = "dataSource"/> <TableList class="mt-20" :columns = "sysjColumns" :dataSource = "dataSource"/>
<LineLabel class="mt-20" label = "仪器使用信息"/> <LineLabel class="mt-20" label = "仪器使用信息"/>
<TableList class="mt-20" :columns = "yqsColumns" :dataSource = "dataSource"/> <TableList class="mt-20" :columns = "yqsColumns" :dataSource = "dataSource"/>
<LineLabel class="mt-20" label = "存储条件"/>
<BaseInfoFormPcakge ref = "storageCondition" :formConfig = "storageFormConfig" :formData = "formData"/> <BaseInfoFormPcakge ref = "storageCondition" :formConfig = "storageFormConfig" :formData = "formData"/>
<LineLabel class="mt-20" label = "操作步骤"/> <LineLabel class="mt-20" label = "操作步骤"/>
<div class="template-form-item"> <div class="template-form-item">
@ -20,7 +23,6 @@
<Step ref = "stepRef"></Step> <Step ref = "stepRef"></Step>
</div> </div>
</div> </div>
<button @click = "onSave">保存</button>
</div> </div>
</div> </div>
</template> </template>
@ -31,15 +33,30 @@ import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table"; import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step"; import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin"; import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
const mgOptions = [
{label:"mg",value:"mg"},
{label:"ng",value:"ng"},
];
const conditionOptions = [
{label:"条件1",value:"1"},
{label:"条件2",value:"2"},
{label:"条件3",value:"3"},
{label:"其他",value:"-1"},
];
export default { export default {
name: "SWYPFXRYPZB", name: "SWYPFXRYPZB",
components: { BaseInfoFormPcakge,LineLabel,TableList,Step },
components: { BaseInfoFormPcakge,LineLabel,TableList,Step,CustomTable },
mixins: [templateMixin], mixins: [templateMixin],
props: { props: {
value: { value: {
type: {}, type: {},
default: () => { }, default: () => { },
}
},
fillType: {
type: String,
default: 'preFill',
},
}, },
watch: { watch: {
value: { value: {
@ -53,18 +70,18 @@ export default {
return { return {
dataSource:[{name:"名称1"}], dataSource:[{name:"名称1"}],
sysjColumns:[ sysjColumns:[
{label:"试剂名称",prop:"name"},
{label:"编号",prop:"name"},
{label:"批号",prop:"name"},
{label:"浓度/含量/纯度",prop:"name"},
{label:"来源",prop:"name"},
{label:"失效日",prop:"name"},
{label:"试剂名称",prop:"reagentName"},
{label:"编号",prop:"reagentCode"},
{label:"批号",prop:"reagentNo"},
{label:"浓度/含量/纯度",prop:"concentration"},
{label:"来源",prop:"source"},
{label:"失效日",prop:"expireDate"},
], ],
yqsColumns:[ yqsColumns:[
{label:"仪器名称",prop:"name"},
{label:"仪器型号",prop:"name"},
{label:"仪器编号",prop:"name"},
{label:"下次测试/校准/检定日期",prop:"name"},
{label:"仪器名称",prop:"instrumentName"},
{label:"仪器型号",prop:"instrumentModel"},
{label:"仪器编号",prop:"instrumentCode"},
{label:"下次测试/校准/检定日期",prop:"nextTestDate"},
], ],
storageFormConfig:[ storageFormConfig:[
{ {
@ -74,11 +91,7 @@ export default {
label:"存储条件", label:"存储条件",
type:"select", type:"select",
fillType:"preFill", fillType:"preFill",
options:[
{label:"白光",value:"1"},
{label:"黄光",value:"3"},
{label:"其他",value:"-1"},
],
options:conditionOptions,
otherCode:"other1", otherCode:"other1",
}, },
@ -122,11 +135,7 @@ export default {
type:"select", type:"select",
multiple:true, multiple:true,
fillType:"preFill", fillType:"preFill",
options:[
{label:"白光",value:"1"},
{label:"黄光",value:"3"},
{label:"其他",value:"-1"},
],
options:conditionOptions,
otherCode:"other1", otherCode:"other1",
}, },
act:{ act:{
@ -135,11 +144,7 @@ export default {
fillType:"actFill", fillType:"actFill",
otherCode:"other2", otherCode:"other2",
multiple:true, multiple:true,
options:[
{label:"白光",value:"1"},
{label:"黄光",value:"3"},
{label:"其他",value:"-1"},
]
options:conditionOptions
} }
} }
}, },
@ -149,11 +154,11 @@ export default {
config:{ config:{
startDate:{ startDate:{
label:"开始时间", label:"开始时间",
type:"dateTime",
type:"input",
}, },
endDate:{ endDate:{
label:"结束时间", label:"结束时间",
type:"dateTime",
type:"input",
}, },
} }
} }
@ -162,31 +167,66 @@ export default {
{ {
type:"step", type:"step",
config:{ config:{
startDate:{
targetName:{
label:"目标溶液名称", label:"目标溶液名称",
type:"input", type:"input",
fillType:"preFill",
}, },
endDate:{
targetCode:{
label:"目标溶液编号", label:"目标溶液编号",
type:"input", type:"input",
subType:"span", subType:"span",
fillType:"preFill",
subKey:"targetCode1", subKey:"targetCode1",
}, },
target:{
targetPreConcentration:{
label:"目标溶液预计浓度", label:"目标溶液预计浓度",
type:"input", type:"input",
subType:"select", subType:"select",
subKey:"taget1",
subKey:"targetPreConcentrationUnit",
fillType:"preFill",
subOptions:mgOptions,
},
targetActConcentration:{
label:"目标溶液实际浓度",
type:"input",
subType:"select",
subKey:"targetActConcentrationUnit",
fillType:"actFill",
subFillType:"preFill",
subOptions:mgOptions,
},
targetPreVolume:{
label:"目标溶液预计体积",
type:"input",
subType:"select",
subKey:"targetPreVolumeUnit",
subOptions:mgOptions,
fillType:"preFill",
},
targetActVolume:{
label:"目标溶液实际体积",
type:"input",
subType:"select",
subKey:"targetActVolumeUnit",
fillType:"actFill",
subFillType:"preFill",
subOptions:mgOptions,
},
effectivePeriod:{
label:"有效周期",
type:"input",
subType:"select",
subKey:"effectivePeriodUnit",
fillType:"preFill",
subOptions:[ subOptions:[
{label:"mg",value:"mg"},
{label:"ng",value:"ng"},
{label:"小时",value:"hour"},
{label:"",value:"day"},
], ],
}, },
target:{
label:"目标溶液预计浓度",
expireDate:{
label:"失效日",
type:"input", type:"input",
subType:"clickable",
subKey:"taget1c",
}, },
} }
} }
@ -197,17 +237,37 @@ export default {
mounted() { mounted() {
setTimeout(()=>{ setTimeout(()=>{
this.formData = { this.formData = {
code:"code1",name:"name1",act:["1","-1"],taget1:"mg",targetCode1:"123456",taget1c:"可点击"
// code:"code1",name:"name1",act:["1","-1"],taget1:"mg",targetCode1:"123456",taget1c:""
} }
},3000) },3000)
setTimeout(()=>{
this.storageFormConfig[0].config.storageCondition1.options = [
{label:"白光",value:"1"},
{label:"黄光",value:"3"},
{label:"其他",value:"-1"},
]
},4000)
}, },
methods: { methods: {
getFormData(){
const baseData = this.$refs.baseInfo.getFormData();
const conditionData = this.$refs.storageCondition.getFormData();
const stepData = this.$refs.stepRef.getFormData();
const stepFormData = this.$refs.stepFormPackage.getFormData();
return {
...baseData,
...conditionData,
...stepData,
...stepFormData,
}
},
async onSave(){ async onSave(){
// const result1 = await this.$refs.baseInfo.getFormData();
// const result2 = await this.$refs.storageCondition.getFormData();
// const result3 = await this.$refs.stepRef.getFormData();
const result = await this.$refs.stepFormPackage.getFormData();
console.log(result,"reee")
const baseData = await this.$refs.baseInfo.getFormData();
const conditionData = await this.$refs.storageCondition.getFormData();
const stepData = await this.$refs.stepRef.getFormData();
const stepFormData = await this.$refs.stepFormPackage.getFormData();
console.log(baseData,conditionData,stepData,stepFormData,"reee")
} }
} }
}; };

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

@ -3,9 +3,9 @@ export default {
}, },
mounted() { mounted() {
setTimeout(() => {
this.setTemplateStatus("actFill")
}, 4000)
this.setTemplateStatus(this.fillType)
}, },
methods: { methods: {
setTemplateStatus(status) { setTemplateStatus(status) {

+ 1
- 1
src/views/business/template/list.vue View File

@ -79,7 +79,7 @@
</el-dialog> </el-dialog>
<el-dialog :close-on-click-modal="false" :title="$t('page.system.template.bdpz')" :visible.sync="tableDialog.visible" <el-dialog :close-on-click-modal="false" :title="$t('page.system.template.bdpz')" :visible.sync="tableDialog.visible"
width="90%" append-to-body> width="90%" append-to-body>
<TemplateTable :sn="tableDialog.sn" />
<TemplateTable :sn="tableDialog.sn" fillType="detail" />
</el-dialog> </el-dialog>
</div> </div>
</template> </template>

Loading…
Cancel
Save