Browse Source

feat:[模板管理][update]

lkf
luojie 1 month ago
parent
commit
8e59b38660
6 changed files with 276 additions and 4 deletions
  1. +1
    -1
      src/components/Template/HandleFormItem.vue
  2. +3
    -1
      src/views/business/comps/template/TemplateTable.vue
  3. +138
    -0
      src/views/business/comps/template/comps/sp/SP0019.vue
  4. +1
    -1
      src/views/business/comps/template/comps/sp/SP007.vue
  5. +128
    -0
      src/views/business/comps/template/formConfig/sp/SP0019.js
  6. +5
    -1
      src/views/business/comps/template/mixins/templateMixin.js

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

@ -60,7 +60,7 @@
:on-change="handleChange" :on-change="handleChange"
:on-exceed="handleExceed" :file-list="fileList" :on-exceed="handleExceed" :file-list="fileList"
:auto-upload="false"> :auto-upload="false">
<el-button :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" size="small" type="primary">点击上传</el-button>
<el-button :disabled="getDisabled()" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" size="small" type="primary">点击上传</el-button>
<span v-if="error" class = "atta-tips">请上传附件</span> <span v-if="error" class = "atta-tips">请上传附件</span>
<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>

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

@ -30,6 +30,7 @@ import SP007 from "./comps/sp/SP007.vue";
//-10 //-10
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 Demo from "./comps/sp/Demo.vue"; import Demo from "./comps/sp/Demo.vue";
// //
import GSP002 from "./comps/gsp/GSP002.vue"; import GSP002 from "./comps/gsp/GSP002.vue";
@ -77,7 +78,7 @@ export default {
// //
GSP002, GSP003, GSP004,GSP009, GSP010, GSP002, GSP003, GSP004,GSP009, GSP010,
// //
SP001, SP003, SP00456,SP007, SP008, SP009,
SP001, SP003, SP00456,SP007, SP008, SP009,SP0019,
// PCR // PCR
PCR002, PCR003, PCR004, PCR005, PCR002, PCR003, PCR004, PCR005,
//LBA //LBA
@ -128,6 +129,7 @@ export default {
'SP016': 'SP008', 'SP016': 'SP008',
'SP017': 'SP008', 'SP017': 'SP008',
'SP018': 'SP008', 'SP018': 'SP008',
'SP019': 'SP0019',
// //
'GSP001': 'DMYPPZJLB', 'GSP001': 'DMYPPZJLB',

+ 138
- 0
src/views/business/comps/template/comps/sp/SP0019.vue View File

@ -0,0 +1,138 @@
<!-- 生物样品分析溶液配制表 -->
<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="template.common.instrumentInfo" />
<CustomTable
:columns="yqInfoColumns"
:formData = "formData"
ref = "yqInfoTableRef"
:showAddRow = "fillType === 'actFill'"
:showOperation = "fillType === 'actFill'"
:prefixKey="`yqTable`"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="()=>deleteRow(rowIndex,'yqInfoTableRef')" ></TableOpertaionDelete>
</template>
</CustomTable>
<BaseInfoFormPackage class="mt-20" fieldItemLabel="色谱柱型号" label="色谱柱型号" ref="storageConditionRef"
:formConfig="storageFormConfig" :formData="formData" />
<LineLabel label="溶液" />
<CustomTable
:columns="ryColumns"
ref = "ryTableRef"
:showOperation = "fillType === 'preFill'"
:formData="{stepTableFormData:formData.stepTableFormData_1,headerSelectFields:{}}" :prefixKey="`ryTable`"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="()=>deleteRow(rowIndex,'ryTableRef')" ></TableOpertaionDelete>
</template>
</CustomTable>
<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, storageFormConfig, getYqColumns,getRyColumns } from "../../formConfig/sp/SP0019"
export default {
name: "SP0019",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
ryColumns(){
return getRyColumns(this);
},
//
yqInfoColumns() {
return getYqColumns(this);
},
//
storageFormConfig() {
return storageFormConfig;
},
//
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
//
baseInfoFormConfig() {
return getBaseInfoFormConfig(this);
},
},
data() {
return {
formData: {}
};
},
mounted() {
},
methods: {
//
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "yqInfoTableRef", "ryTableRef", "remarkRef"])
},
//
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "yqInfoTableRef","ryTableRef", "remarkRef"]);
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>

+ 1
- 1
src/views/business/comps/template/comps/sp/SP007.vue View File

@ -26,7 +26,7 @@
</div> </div>
</div> </div>
</div> </div>
<button @click="onSave">保存</button>
<!-- <button @click="onSave">保存</button> -->
</div> </div>
</template> </template>

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

@ -0,0 +1,128 @@
export const getBaseInfoFormConfig = ($this) => {
return [
{
type: 'cardItem',
config: {
studyMc: {
label: 'template.common.testName',
type: 'input',
disabled: true
},
studySn: {
label: 'template.common.testNumber',
type: 'input',
disabled: true
},
methodCode: {
label: 'template.common.methodCode',
type: 'input',
fillType: 'preFill',
maxlength: 50
},
versionNum: {
label: 'template.common.versionNumber',
type: 'inputNumber',
fillType: 'actFill',
prepend: 'V',
maxlength: 50
},
clpbh: {
label: '处理批编号',
type: 'input',
fillType: 'actFill',
maxlength: 50
},
fxpbh: {
label: '分析批编号',
type: 'input',
fillType: 'actFill',
maxlength: 50
},
}
},
]
}
export const storageFormConfig = [
{
type: 'step',
config: {
yqmxh: {
label: '色谱柱型号',
type: 'yq',
fillType: 'actFill',
},
}
},
]
//仪器信息
export const getYqColumns = ($this) => {
return [
{
label: 'template.common.instrumentName',
prop: "mc",
bodyType: "yq",
bodyFillType: 'actFill',
},//仪器名称
{
label: 'template.common.instrumentModel',
prop: "xh",
bodyType: "input",
bodyDisabled: true,
bodyFillType: 'actFill',
},//仪器型号
{
label: 'template.common.instrumentCode',
prop: "bh",
bodyType: "input",
bodyDisabled: true,
bodyFillType: 'actFill',
},//仪器编号
{
label: 'template.common.nextTestDate',
prop: "jzrq",
bodyType: "input",
bodyDisabled: true,
bodyFillType: 'actFill',
},//下次测试/校准/检定日期
]
}
//溶液
export const getRyColumns = () => {
return [
{
label: '溶液类型',
prop: "rylx",
bodyType: "select",
bodyOptions:[
{
label:'溶液',
value:'溶液'
},
],
bodyFillType: 'preFill',
},
{
label: '溶液名称(编号)',
prop: "rymc",
bodyType: "input",
disabled: true,
bodyFillType: 'actFill',
},
{
label: '配置日期',
prop: "pzrq",
bodyType: "input",
disabled: true,
bodyFillType: 'actFill',
},
{
label: '失效日',
prop: "sxr",
bodyType: "input",
bodyFillType: 'actFill',
},
]
}

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

@ -328,7 +328,11 @@ export default {
this.$store.commit('template/SET_TEMPLATE_DATA', data) this.$store.commit('template/SET_TEMPLATE_DATA', data)
}, },
//统一处理删除行 //统一处理删除行
deleteRow(index) {
deleteRow(index,ref) {
if(ref){
this.$refs[ref].deleteRow(index);
return;
}
this.$refs.stepTableRef.deleteRow(index) this.$refs.stepTableRef.deleteRow(index)
}, },

Loading…
Cancel
Save