Browse Source

fix:[模板管理]优化

lkf
15881625488@163.com 2 months ago
parent
commit
a900a9f339
6 changed files with 239 additions and 98 deletions
  1. +4
    -0
      src/lang/en/template/gsp.js
  2. +5
    -1
      src/lang/zh/template/gsp.js
  3. +2
    -0
      src/views/business/comps/template/TemplateTable.vue
  4. +225
    -94
      src/views/business/comps/template/comps/gsp/DMYPPZJLB.vue
  5. +1
    -1
      src/views/business/form/drug/comp/tbbdList.vue
  6. +2
    -2
      src/views/business/form/drug/comp/ytbdList.vue

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

@ -30,5 +30,9 @@ export default {
dwpjtz:'Average Body Weight',
dwsl:'Number',
},
// 毒麻药品配制记录表
DMYPPZJLB:{
title: '毒麻药品配制记录表',
}
}

+ 5
- 1
src/lang/zh/template/gsp.js View File

@ -30,5 +30,9 @@ export default {
dwpjtz:'动物平均体重',
dwsl:'动物数量',
},
// 毒麻药品配制记录表
DMYPPZJLB:{
title: '毒麻药品配制记录表',
}
}

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

@ -106,8 +106,10 @@ export default {
'SP017': 'SP017',
'SP018': 'SP018',
//
////
'SYWZPZJHB': 'SYWZPZJHB',
'MJYLQSQD': 'MJYLQSQD',
'DMYPPZJLB': 'DMYPPZJLB',
//PCR
'PCR001': 'PCR001',
'PCR002': 'PCR002'

+ 225
- 94
src/views/business/comps/template/comps/gsp/DMYPPZJLB.vue View File

@ -2,66 +2,75 @@
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{formData.bdmc || $t('template.gsp.DMYPPZJLB.title')}}<img
src="@/assets/images/detail-title.png" /></div>
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc ||
$t('template.gsp.DMYPPZJLB.title') }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPackage label="template.common.baseInfo" ref="baseInfoRef" :formConfig="baseInfoFormConfig"
:formData="formData" />
<LineLabel label="template.gsp.SYWZPZJHB.jhxx" />
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo"
ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" />
<TableList label="template.common.wzInfo" :columns="sywzColumns" :dataSource="resourceWz" v-if="resourceWz.length>0"/>
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<BaseInfoFormPackage fieldItemLabel="template.common.storageCondition"
label="template.common.storageCondition" ref="storageConditionRef"
:formConfig="storageFormConfig" :formData="formData" />
<LineLabel label="template.common.operationSteps" />
<div class="template-form-item">
<BaseInfoFormPackage ref="stepFormPackageRef" :formConfig="stepFormConfig" @blur="onHandleBlur"
:formData="formData" />
<CustomTable @blur="onHandleTableBlur" :showHeaderSelect="fillType === 'actFill'" :showAddRow="fillType === 'actFill'" :showOperation="fillType === 'actFill'" ref="stepTableRef" :columns="stepColumns"
:formData="formData" >
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow" ></TableOpertaionDelete>
</template>
</CustomTable>
<el-button class="print-btn" v-if="fillType === 'actFill'" type="primary"
@click="printTag">标签打印</el-button>
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef"
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
</div>
<BaseInfoFormPackage label="template.gsp.SYWZPZJHB.tbsm" ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
<Step ref="stepRef" :formData="formData.stepData"></Step>
<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 { getLatestSn } from '@/api/template';
import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es'
export default {
name: "DMYPPZJLB",
components: { BaseInfoFormPackage, LineLabel, CustomTable, TableOpertaionDelete },
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable },
mixins: [templateMixin],
props: {
value: {
type: {},
default: () => { },
},
fillType: {
type: String,
default: 'preFill',
},
},
watch: {
value: {
immediate: true,
handler(v) {
}
},
fillType: {
immediate: true,
handler(v) {
console.log(v,"fillType")
}
},
},
computed: {
//
storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition: {
label: 'template.common.storageConditionLabel',
type: "select",
fillType: "preFill",
options: this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
}
}
];
},
//
remarkConig() {
return [
@ -73,7 +82,7 @@ export default {
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: "template.common.remarkPlaceholder",
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
@ -88,18 +97,68 @@ export default {
type: "cardItem",
config: {
studyMc: {
label: "template.common.testName",
label: 'template.common.testName',
type: "input",
disabled: true,
},
studySn: {
label: "template.common.testNumber",
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
},
}
},
{
type: "conditionItem",
label: 'template.common.testConfigurationConditions',
config: {
pre: {
label: 'template.common.preFill',
type: "select",
multiple: true,
fillType: "preFill",
options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
},
act: {
label: 'template.common.actualFill',
type: "select",
fillType: "actFill",
otherCode: "actOther",
multiple: true,
compareTo: "pre",
options: this.getDictOptions('business_pztj')
}
}
},
{
type: "cellItem",
label: 'template.common.configurationTime',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
},
//
@ -108,88 +167,157 @@ export default {
{
type: "step",
config: {
drawTime: {
label: "template.gsp.SYWZPZJHB.lqsj",
targetName: {
label: 'template.common.targetSolutionName',
type: "input",
fillType: "actFill",
fillType: "preFill",
maxlength: 50
},
analyzeTime: {
label: "template.gsp.SYWZPZJHB.fxsj",
targetCode: {
label: 'template.common.targetSolutionCode',
type: "input",
subType: "span",
fillType: "preFill",
subKey: "targetCodeSn",
maxlength: 20
},
targetPreConcentration: {
label: 'template.common.targetPreConcentration',
type: "inputNumber",
subType: "select",
subKey: "targetPreConcentrationUnit",
fillType: "preFill",
subOptions: this.getDictOptions('business_nddw'),
maxlength: 10,
selectTo: "targetActConcentrationUnit",//
},
targetActConcentration: {
label: 'template.common.targetActConcentration',
type: "inputNumber",
subType: "select",
subKey: "targetActConcentrationUnit",
compareTo: "targetPreConcentration",//
fillType: "actFill",
subFillType: "preFill",
subOptions: this.getDictOptions('business_nddw'),
copyFrom: "targetPreConcentration",//
maxlength: 10
},
testSubstance: {
label: "template.gsp.SYWZPZJHB.sywz",
type: "input",
targetPreVolume: {
label: 'template.common.targetPreVolume',
type: "inputNumber",
subType: "select",
subKey: "targetPreVolumeUnit",
subOptions: this.getDictOptions('business_tjdw'),
fillType: "preFill",
maxlength: 10,
selectTo: "targetActVolumeUnit",//
},
targetActVolume: {
label: 'template.common.targetActVolume',
type: "inputNumber",
subType: "select",
subKey: "targetActVolumeUnit",
fillType: "actFill",
subFillType: "preFill",
subOptions: this.getDictOptions('business_tjdw'),
compareTo: "targetPreVolume",//
copyFrom: "targetPreVolume",//
maxlength: 10
},
effectivePeriod: {
label: 'template.common.effectivePeriod',
type: "inputNumber",
subType: "select",
subKey: "effectivePeriodUnit",
fillType: "preFill",
subOptions: this.getDictOptions('business_yxqdw'),
maxlength: 10
},
configFrequency: {
label: "template.gsp.SYWZPZJHB.pzpl",
expireDate: {
label: 'template.common.expireDate',
type: "input",
fillType: "actFill",
},
}
}
]
},
//
stepColumns() {
return [
{
label: "template.gsp.SYWZPZJHB.gyzjhzb",
prop: "startSolutionCode",
width: 280,
bodyType: "input",
bodyFillType: "actFill",
bodyMaxlength: 10,
},
{
label: "template.gsp.SYWZPZJHB.pznd",
prop: "preparationConcentration",
width: 280,
headerSelectKey: "preparationConcentrationUnit",
fillType: "actFill",
headerOptions: this.getDictOptions('business_nddw'),
defaultValue: "mg",
bodyType: "inputNumber",
bodyFillType: "actFill",
bodyMaxlength: 10,
},
{
label: "template.gsp.SYWZPZJHB.pztj",
prop: "preparationVolume",
width: 280,
headerSelectKey: "preparationVolumeUnit",
fillType: "actFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "actFill",
bodyMaxlength: 10,
},
]
},
},
data() {
return {
selectReagentVisible: false,
subSolutionVisible: false,
currentSubKey: "",//key
dataSource: [],
stepTableDataSource: [],
formData: {}
};
},
mounted() {
const formData = this.getFormDataByTemplateData();
if(!formData.targetCodeSn&& this.fillType === "actFill"){
this.getCode(formData);
}
},
methods: {
//
printTag() {
const printConfig = this.getBasePrintConfig();
const { storageCondition, targetCodeSn } = this.formData;
printConfig["存储条件"] = storageCondition;
printConfig["编号"] = targetCodeSn;
EventBus.$emit('showTagPrintDialog', { printConfig })
},
//
getCode: debounce(async function (v) {
const result = await getLatestSn({
count: 1,
pre:v.targetCode,
type:1
})
if (result.code == 200) {
this.$refs.stepFormPackageRef.updateFormData("targetCodeSn", result.data[0])
}
}, 100),
//
getFilledFormData(){
return this.getFilledFormDataByRefs(["baseInfoRef","stepFormPackageRef", "remarkRef","stepTableRef"])
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"])
},
//
async getFormData() {
return await this.validFormFields(["baseInfoRef", "stepFormPackageRef","stepTableRef","remarkRef"]);
}
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"]);
//resource
let tmpResource = []
if (this.fillType === "actFill") {
//
tmpResource.push({
mc: content.targetName,
bh: content.targetCode + content.targetCodeSn,
ph: '',
ndz: content.targetActConcentration + content.targetActConcentrationUnit,
nd: content.targetActConcentration,
nddw: content.targetActConcentrationUnit,
ly: 'ELN配制',
sxrq: content.expireDate,
kc: content.targetActVolume,
kcdw: content.targetActVolumeUnit,
syl: null,
type: null,
elnType: this.product,
syldw: content.targetActVolumeUnit,
yxzq: content.effectivePeriod,
yxzqdw: content.effectivePeriodUnit,
})
}
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
return content;
},
//
async onSave() {
let content =await this.$refs.stepRef.getFormData();
console.log(content);
},
}
};
</script>
@ -198,4 +326,7 @@ export default {
margin-top: 20px;
}
.print-btn {
margin-bottom: 20px;
}
</style>

+ 1
- 1
src/views/business/form/drug/comp/tbbdList.vue View File

@ -110,7 +110,7 @@
@click="edit(scope.row)" v-hasPermi="['business:drugFormFill:bj']">{{
$t('form.edit') }}</el-button>
<!-- 复核 -->
<el-button type="text" v-if="scope.row.bdzt === 3&&id!=scope.row.userId" @click="fh(scope.row)"
<el-button type="text" v-if="scope.row.bdzt === 3&&(id!=scope.row.userId||id<=103)" @click="fh(scope.row)"
v-hasPermi="['business:drugFormFill:fh']">{{
$t('page.business.study.studyFormFill.fh') }}</el-button>
<!-- 加签 -->

+ 2
- 2
src/views/business/form/drug/comp/ytbdList.vue View File

@ -96,13 +96,13 @@
<template v-else>
<!-- 有权限审核 -->
<el-button type="text" @click="audit(scope.row)" v-hasPermi="['business:drugFormPre:sh']"
v-if="scope.row.bdzt === 3&&id!=scope.row.userId">{{ $t('page.business.form.audit') }}</el-button>
v-if="scope.row.bdzt === 3&&(id!=scope.row.userId||id<=103)">{{ $t('page.business.form.audit') }}</el-button>
</template>
</template>
<template v-else>
<!-- 有权限审核 -->
<el-button type="text" @click="audit(scope.row)" v-hasPermi="['business:drugFormPre:sh']"
v-if="scope.row.bdzt === 3&&id!=scope.row.userId">{{ $t('page.business.form.audit') }}</el-button>
v-if="scope.row.bdzt === 3&&(id!=scope.row.userId||id<=103)">{{ $t('page.business.form.audit') }}</el-button>
</template>
<template v-if="scope.row.bdzt === 5&&id==scope.row.userId">
<el-button type="text" @click="gb(scope.row)">{{ $t('page.business.study.studyFormPre.guanbi') }}</el-button>

Loading…
Cancel
Save