Browse Source

feat:[模板管理][update]

ouqian
luojie 1 month ago
parent
commit
687cffb1f3
8 changed files with 137 additions and 27 deletions
  1. +27
    -4
      src/components/Template/operation/TableOpertaion.vue
  2. +3
    -0
      src/lang/en/template/gsp.js
  3. +3
    -0
      src/lang/zh/template/gsp.js
  4. +54
    -9
      src/views/business/comps/template/comps/gsp/GSP015.vue
  5. +12
    -2
      src/views/business/comps/template/comps/sp/SP00456.vue
  6. +7
    -1
      src/views/business/comps/template/comps/sp/comps/LadderConfig.vue
  7. +25
    -10
      src/views/business/comps/template/formConfig/paralleAndLadderConfig.js
  8. +6
    -1
      src/views/business/comps/template/mixins/templateMixin.js

+ 27
- 4
src/components/Template/operation/TableOpertaion.vue View File

@ -8,10 +8,10 @@
</el-popconfirm> </el-popconfirm>
<template v-if="fillType === 'actFill'"> <template v-if="fillType === 'actFill'">
<el-button type="text" size="small" @click="onSubPackage">分装</el-button>
<el-button type="text" size="small" @click="onStartConfig">开始配制</el-button>
<el-button type="text" size="small" @click="onConfigComplete">配制完成</el-button>
<el-button type="text" size="small" @click="()=>onPrintTag()">打印标签</el-button>
<el-button v-if="showFz" type="text" size="small" @click="onSubPackage">分装</el-button>
<el-button v-if="showKspz" type="text" size="small" @click="onStartConfig">开始配制</el-button>
<el-button v-if="showPzwc" type="text" size="small" @click="onConfigComplete">配制完成</el-button>
<el-button v-if="showDybq" type="text" size="small" @click="()=>onPrintTag()">打印标签</el-button>
</template> </template>
</div> </div>
</template> </template>
@ -40,6 +40,26 @@ export default {
type: String, type: String,
default: "preFill", default: "preFill",
}, },
//
showFz: {
type: Boolean,
default: true,
},
//
showKspz: {
type: Boolean,
default: true,
},
//
showPzwc: {
type: Boolean,
default: true,
},
//
showDybq: {
type: Boolean,
default: true,
},
}, },
mounted() { mounted() {
@ -92,6 +112,9 @@ export default {
onConfigComplete() { onConfigComplete() {
const actConfig = this.getColumnConfig(); const actConfig = this.getColumnConfig();
const cloneRow = JSON.parse(JSON.stringify(this.innerRow)); const cloneRow = JSON.parse(JSON.stringify(this.innerRow));
if(cloneRow.hasOwnProperty("_checked")){
delete cloneRow._checked;
}
const isComplete = Object.values({...actConfig,...cloneRow}).every((val)=>{ const isComplete = Object.values({...actConfig,...cloneRow}).every((val)=>{
// 0 // 0
if (val === 0) return true; if (val === 0) return true;

+ 3
- 0
src/lang/en/template/gsp.js View File

@ -68,6 +68,9 @@ export default {
rjyjtj:'溶剂预计体积', rjyjtj:'溶剂预计体积',
rjsjtj:'溶剂实际体积', rjsjtj:'溶剂实际体积',
}, },
gsp007:{
bzqx:'标准曲线',
},
gsp009: { gsp009: {
xtsyx: '系统适应性', xtsyx: '系统适应性',
ypbh: '样品编号', ypbh: '样品编号',

+ 3
- 0
src/lang/zh/template/gsp.js View File

@ -68,6 +68,9 @@ export default {
rjyjtj:'溶剂预计体积', rjyjtj:'溶剂预计体积',
rjsjtj:'溶剂实际体积', rjsjtj:'溶剂实际体积',
}, },
gsp007:{
bzqx:'标准曲线',
},
gsp009: { gsp009: {
xtsyx: '系统适应性', xtsyx: '系统适应性',
ypbh: '样品编号', ypbh: '样品编号',

+ 54
- 9
src/views/business/comps/template/comps/gsp/GSP015.vue View File

@ -34,9 +34,14 @@
:showAddRow="fillType === 'preFill'" @onAddRow="() => addTableRow(index)" :showAddRow="fillType === 'preFill'" @onAddRow="() => addTableRow(index)"
fieldItemLabel="取样进样信息" :formData="item"> fieldItemLabel="取样进样信息" :formData="item">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns"
<TableOpertaion :row="row" :rowIndex="rowIndex" :columns="columns"
@configComplete="(e)=>onConfigComplete(e,'qy')"
@printTag="(e)=>onPrintTag(e,index)"
:fillType="fillType"
:showFz="false"
:showKspz="false"
@deleteRow="() => deleteTableRow(rowIndex, index)"> @deleteRow="() => deleteTableRow(rowIndex, index)">
</TableOpertaionDelete>
</TableOpertaion>
</template> </template>
</CustomTable> </CustomTable>
<CustomTable :ref="`jyTableRef${index}`" :columns="yjColumns" prefix="jy" <CustomTable :ref="`jyTableRef${index}`" :columns="yjColumns" prefix="jy"
@ -44,9 +49,14 @@
:showOperation="fillType === 'actFill'" :showAddRow="false" :showOperation="fillType === 'actFill'" :showAddRow="false"
:formData="{ stepTableFormData: item.jyStepTableFormData || [], headerSelectFields: item.jyHeaderSelectFields || {} }"> :formData="{ stepTableFormData: item.jyStepTableFormData || [], headerSelectFields: item.jyHeaderSelectFields || {} }">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns"
<TableOpertaion :row="row" :rowIndex="rowIndex" :columns="columns"
@configComplete="(e)=>onConfigComplete(e,'jy')"
@printTag="(e)=>onPrintTag(e,index)"
:fillType="fillType"
:showFz="false"
:showKspz="false"
@deleteRow="() => deleteTableRow(rowIndex, index)"> @deleteRow="() => deleteTableRow(rowIndex, index)">
</TableOpertaionDelete>
</TableOpertaion>
</template> </template>
</CustomTable> </CustomTable>
</div> </div>
@ -72,9 +82,14 @@
:showOperation="fillType === 'preFill' || fillType === 'actFill'" :showOperation="fillType === 'preFill' || fillType === 'actFill'"
@onAddRow="() => addEcTableRow(index, 'ecTableRef')" :formData="item"> @onAddRow="() => addEcTableRow(index, 'ecTableRef')" :formData="item">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns"
<TableOpertaion :row="row" :rowIndex="rowIndex" :columns="columns"
@configComplete="(e)=>onConfigComplete(e,'jy')"
@printTag="(e)=>onPrintTag(e,index)"
:fillType="fillType"
:showFz="false"
:showKspz="false"
@deleteRow="() => deleteTableRow(rowIndex, index)"> @deleteRow="() => deleteTableRow(rowIndex, index)">
</TableOpertaionDelete>
</TableOpertaion>
</template> </template>
</CustomTable> </CustomTable>
</div> </div>
@ -91,7 +106,7 @@
<script> <script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage"; import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete";
import TableOpertaion from "@/components/Template/operation/TableOpertaion";
import LineLabel from "@/components/Template/LineLabel"; import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table"; import TableList from "@/components/Template/Table";
@ -113,7 +128,7 @@ const refConfig = {
const compRefs = Object.values(refConfig); const compRefs = Object.values(refConfig);
export default { export default {
name: "SP0021", name: "SP0021",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaionDelete },
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion },
mixins: [templateMixin], mixins: [templateMixin],
props: { props: {
fillType: { fillType: {
@ -161,8 +176,38 @@ export default {
}, },
methods: { methods: {
onConfigComplete(e,type){
const {rowData,headerSelectFields} = e;
let params = {
studySubjectId: this.formData.studySubjectId,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
};
if(type === 'qy'){
params = {
...params,
bh:rowData.qybh,//
nd:rowData.sjzjnd,//
nddw:headerSelectFields.sjzjnddw,//
kc:rowData.sjqyl,//
kcdw:headerSelectFields.sjqydw,//
}
}else if(type === 'jy'){
params = {
...params,
bh:rowData.jybh,//
nd:rowData.sjjynd,//
nddw:headerSelectFields.sjjynddw,//
kc:rowData.ztj,//
kcdw:headerSelectFields.ztjdw,//
}
}
this.configCompleteRequest(params)
},
onPrintTag(e,index){
console.log(e,index,"onPrintTag")
},
handleClickButton(item,signData,key,formFields,index){ handleClickButton(item,signData,key,formFields,index){
const {} = item;
const ref = this.$refs[`ybsmFormPackageRef${index}`][0]; const ref = this.$refs[`ybsmFormPackageRef${index}`][0];
if(key === "startButton"){ if(key === "startButton"){
ref.updateFormData("qysj",moment().format("YYYY/MM/DD HH:mm:ss"),{ isUpdateRecord: true, signData }) ref.updateFormData("qysj",moment().format("YYYY/MM/DD HH:mm:ss"),{ isUpdateRecord: true, signData })

+ 12
- 2
src/views/business/comps/template/comps/sp/SP00456.vue View File

@ -8,6 +8,8 @@
<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" /> ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.gspsywzInfo" :columns="gspColumns" :dataSource="resourceGsp"
v-if="isGsp" />
<TableList label="template.common.sjInfo" :columns="sjColumns" :dataSource="resourceSj" /> <TableList label="template.common.sjInfo" :columns="sjColumns" :dataSource="resourceSj" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" /> <TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<BaseInfoFormPackage v-if="isSp" fieldItemLabel="template.common.storageCondition" <BaseInfoFormPackage v-if="isSp" fieldItemLabel="template.common.storageCondition"
@ -25,7 +27,7 @@
</CustomTable> </CustomTable>
</div> </div>
<LineLabel :label="getOperationStepsLabel()" /> <LineLabel :label="getOperationStepsLabel()" />
<div v-if="fillType === 'preFill' && !isPcr234" class="mt-20">
<div v-if="fillType === 'preFill' && !isPcr234 && !isGsp" class="mt-20">
<el-button type="primary" @click="handleAddConfig('paralleConfigs')">{{ <el-button type="primary" @click="handleAddConfig('paralleConfigs')">{{
$t('template.common.xzpxpz') $t('template.common.xzpxpz')
}}</el-button> }}</el-button>
@ -33,6 +35,11 @@
$t('template.common.xzjtpz') $t('template.common.xzjtpz')
}}</el-button> }}</el-button>
</div> </div>
<div v-else-if="fillType === 'preFill' && isGsp" class="mt-20">
<el-button type="primary" @click="handleAddConfig('ladderConfigs')">{{
$t('template.common.addBtn')
}}</el-button>
</div>
<!-- 阶梯配制区域 --> <!-- 阶梯配制区域 -->
<div v-for="(ladderConfig, ladderIndex) in formData.ladderConfigs" <div v-for="(ladderConfig, ladderIndex) in formData.ladderConfigs"
:key="'ladder_' + ladderConfig.id"> :key="'ladder_' + ladderConfig.id">
@ -54,6 +61,7 @@
:configType="'paralle'" :ref="`paralleRef_${paralleIndex}`" :configType="'paralle'" :ref="`paralleRef_${paralleIndex}`"
:fieldItemLabel="'template.common.pxpz'" :fieldItemLabel="'template.common.pxpz'"
:showHeader="!isPcr234" :showHeader="!isPcr234"
:showHeaderLabel="!isGsp"
@deleteConfig="deleteConfig('paralleConfigs', paralleConfig)" :fillType="fillType" /> @deleteConfig="deleteConfig('paralleConfigs', paralleConfig)" :fillType="fillType" />
</div> </div>
<template v-if="sn === 'LBA005' || sn === 'ADA005'"> <template v-if="sn === 'LBA005' || sn === 'ADA005'">
@ -208,7 +216,8 @@ export default {
targetAcSolutionFromTable: true,// targetAcSolutionFromTable: true,//
currentRowData: {},// currentRowData: {},//
isLba: labArr.includes(this.sn), isLba: labArr.includes(this.sn),
isSp: sn.includes('SP'),//
isSp: sn.startsWith('SP'),//
isGsp: sn.startsWith('GSP'),//
isPcr234: pcr234Arr.includes(this.sn),//PCR234 isPcr234: pcr234Arr.includes(this.sn),//PCR234
}; };
}, },
@ -230,6 +239,7 @@ export default {
const obj = { const obj = {
"LBA005": "template.lba.lba005.bzqxpz",//线 "LBA005": "template.lba.lba005.bzqxpz",//线
"ADA005": "template.lba.lba005.bzqxpz",//线 "ADA005": "template.lba.lba005.bzqxpz",//线
"GSP007": "template.gsp.gsp007.bzqx",//线
// "LBA007": "template.lba.lba005.bzqxpz",// // "LBA007": "template.lba.lba005.bzqxpz",//
} }
return obj[this.sn] || 'template.common.operationSteps';// return obj[this.sn] || 'template.common.operationSteps';//

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

@ -1,7 +1,9 @@
<template> <template>
<div class="template-form-item"> <div class="template-form-item">
<div class="config-header" v-if="showHeader"> <div class="config-header" v-if="showHeader">
<div>{{ $t(fieldItemLabel) }}</div>
<div>
<span v-if = "showHeaderLabel">{{ $t(fieldItemLabel) }}</span>
</div>
<el-popconfirm title="确认删除当前配置?" @confirm="deleteConfig"> <el-popconfirm title="确认删除当前配置?" @confirm="deleteConfig">
<el-button slot="reference" v-if="fillType === 'preFill'" type="text" icon="el-icon-delete" >{{ <el-button slot="reference" v-if="fillType === 'preFill'" type="text" icon="el-icon-delete" >{{
$t('template.common.deleteBtn') $t('template.common.deleteBtn')
@ -57,6 +59,10 @@ export default {
type: Boolean, type: Boolean,
default: true, default: true,
}, },
showHeaderLabel: {//
type: Boolean,
default: true,
},
fillType: { fillType: {
type: String, type: String,
default: '', default: '',

+ 25
- 10
src/views/business/comps/template/formConfig/paralleAndLadderConfig.js View File

@ -43,22 +43,23 @@ const optionsCode = {
PCR002: 'business_pcr_gzy', PCR002: 'business_pcr_gzy',
PCR003: 'business_pcr_fxbzqxzbb', PCR003: 'business_pcr_fxbzqxzbb',
PCR004: 'business_pcr_fxzkypzbb', PCR004: 'business_pcr_fxzkypzbb',
GSP007:"",
PCR013:"",
LBA005:"",
LBA007:"",
ADA005:"",
ADA007:"",
GSP007:"",//GSP007是输入框
PCR013:"business_pcr_fxffypzbb",
LBA005:"business_lba_ptjhbzqx_zkpx",
LBA007:"business_lba_ptjhfxyp",
ADA005:"business_ada_kyktzkyp",
ADA007:"business_ada_kyktffxyp",
} }
// 阶梯配置表格列配置 // 阶梯配置表格列配置
export const getLadderColumnsConfig = ($this) => { export const getLadderColumnsConfig = ($this) => {
const dic = optionsCode[$this.sn] || 'business_sp_nbgzy'
const dic = optionsCode[$this.sn] || 'business_sp_nbgzy';
const mbryType = $this.sn === "GSP007"?"input":"select"
return [ return [
{ {
label: 'template.sp.sp00456.mbrybh', label: 'template.sp.sp00456.mbrybh',
prop: 'targetSolutionCode', prop: 'targetSolutionCode',
bodyType: 'select',
bodyType: mbryType,
bodyOptions: $this.getDictOptions(dic), bodyOptions: $this.getDictOptions(dic),
bodySubType: 'span', bodySubType: 'span',
bodySubKey: 'subTargetSolutionCode', bodySubKey: 'subTargetSolutionCode',
@ -534,11 +535,12 @@ export const getBaseInfoFormConfig = ($this) => {
const sn = $this.sn const sn = $this.sn
const labArr = ['LBA005', 'LBA007','ADA005','ADA007'] const labArr = ['LBA005', 'LBA007','ADA005','ADA007']
const isLba = labArr.includes(sn) const isLba = labArr.includes(sn)
const isSp = sn.includes('SP')//是否是色谱
const isSp = sn.startsWith('SP')//是否是色谱
return [ return [
{ {
type: 'cardItem', type: 'cardItem',
config: {
config: isSp?
{
studyMc: { studyMc: {
label: 'template.common.testName', label: 'template.common.testName',
type: 'input', type: 'input',
@ -563,6 +565,19 @@ export const getBaseInfoFormConfig = ($this) => {
maxlength: 50 maxlength: 50
} }
} }
:
{
studyMc: {
label: 'template.common.testName',
type: 'input',
disabled: true
},
studySn: {
label: 'template.common.testNumber',
type: 'input',
disabled: true
},
}
}, },
{ {
type: 'conditionItem', type: 'conditionItem',

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

@ -60,6 +60,11 @@ export default {
'business_zpdd', // 制片地点 'business_zpdd', // 制片地点
'business_cjbw', // 制片部位 'business_cjbw', // 制片部位
'business_qywz', // 取样位置 'business_qywz', // 取样位置
'business_lba_ptjhbzqx_zkpx', // lba005
'business_lba_ptjhfxyp', // lba007
'business_ada_kyktzkyp', // ada005
'business_ada_kyktffxyp', // ada007
], ],
props: { props: {
templateData: { templateData: {
@ -479,7 +484,7 @@ export default {
actSolutionConcentrationPrecision: 3, //小数点精度默认为3 actSolutionConcentrationPrecision: 3, //小数点精度默认为3
targetDiluentVolumePrecision: 3, //小数点精度默认为3 targetDiluentVolumePrecision: 3, //小数点精度默认为3
targetStartSolutionVolumePrecision: 3, //小数点精度默认为3 targetStartSolutionVolumePrecision: 3, //小数点精度默认为3
targetSolutionCode: `STD${Number(codeSTD) - index}`
targetSolutionCode: `CA-WS-STD${Number(codeSTD) - index}`
})) }))
this.$refs.stepTableRef.updateDataSource(arr) this.$refs.stepTableRef.updateDataSource(arr)
} else if (key === 'targetStartSolution' || key === 'subTargetStartSolution') { } else if (key === 'targetStartSolution' || key === 'subTargetStartSolution') {

Loading…
Cancel
Save