Browse Source

feat:[模板管理][update]

lkf
luojie 2 months ago
parent
commit
e726c06c04
17 changed files with 889 additions and 77 deletions
  1. +1
    -1
      src/components/Template/HandleFormItem.vue
  2. +1
    -0
      src/components/Template/SelectTable.vue
  3. +50
    -7
      src/components/Template/Step.vue
  4. +64
    -0
      src/components/Template/StepComponents/ry/clcz.vue
  5. +71
    -0
      src/components/Template/StepComponents/ry/clfcz.vue
  6. +53
    -39
      src/components/Template/StepComponents/ry/czhj.vue
  7. +81
    -0
      src/components/Template/StepComponents/ry/jrry.vue
  8. +53
    -0
      src/components/Template/StepComponents/ry/qywz.vue
  9. +125
    -0
      src/components/Template/StepComponents/ry/tpjydd.vue
  10. +226
    -0
      src/components/Template/StepComponents/ry/tpjysd.vue
  11. +44
    -0
      src/components/Template/StepComponents/ry/xzrq.vue
  12. +44
    -12
      src/components/Template/StepFormPackage.vue
  13. +4
    -1
      src/components/Template/mixins/formPackageMixins.js
  14. +6
    -1
      src/components/Template/mixins/stepMixins.js
  15. +8
    -1
      src/views/business/comps/template/TemplateTable.vue
  16. +5
    -3
      src/views/business/comps/template/dialog/SelectInstrumentDialog.vue
  17. +53
    -12
      src/views/business/comps/template/dialog/SelectMixReagentDialog.vue

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

@ -498,7 +498,7 @@ export default {
return false; return false;
}, },
handleClickable(item, event) { handleClickable(item, event) {
if (item.fillType !== 'actFill') {
if (this.templateFillType !== 'actFill') {
return return
} }
this.$emit("clickable", item) this.$emit("clickable", item)

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

@ -148,6 +148,7 @@ export default {
this.localSelectedId = row[this.selectedCode]; this.localSelectedId = row[this.selectedCode];
this.$emit("radioSelect", row[this.selectedCode],row); this.$emit("radioSelect", row[this.selectedCode],row);
}, },
} }
} }

+ 50
- 7
src/components/Template/Step.vue View File

@ -2,7 +2,7 @@
<div class="step-container"> <div class="step-container">
<el-button v-if="isShowAddStep()" type="primary" @click="addStep" icon="el-icon-plus">添加步骤</el-button> <el-button v-if="isShowAddStep()" type="primary" @click="addStep" icon="el-icon-plus">添加步骤</el-button>
<div class="step-list"> <div class="step-list">
<div v-for="(step, index) in steps" :key="step.id" class="step-item">
<div v-for="(step, index) in steps" :key="step.id" class="step-list-item">
<div class="step-content"> <div class="step-content">
@ -12,12 +12,18 @@
<!-- 根据步骤类型显示对应的表单 --> <!-- 根据步骤类型显示对应的表单 -->
<!-- 根据步骤类型显示对应的表单 --> <!-- 根据步骤类型显示对应的表单 -->
<component :is="getStepComponent(step.type)" :formData="step.formData"
<component class="flex1" :is="getStepComponent(step.type)" :formData="step.formData"
@update="onFormUpdate(index, $event)" :ref="'stepCompRef_' + index"> @update="onFormUpdate(index, $event)" :ref="'stepCompRef_' + index">
</component> </component>
<div class="step-header-item"> <div class="step-header-item">
<el-button type="text" @click="removeStep(index)" icon="el-icon-delete"
<el-popconfirm
@confirm="removeStep(index)"
title="确定删除当前步骤吗?"
>
<el-button type="text" slot="reference" icon="el-icon-delete"
class="delete-btn"></el-button> class="delete-btn"></el-button>
</el-popconfirm>
</div> </div>
</div> </div>
</div> </div>
@ -28,9 +34,26 @@
<script> <script>
import HandleFormItem from './HandleFormItem.vue'; import HandleFormItem from './HandleFormItem.vue';
import Czdd from './StepComponents/ry/czdd.vue';//- import Czdd from './StepComponents/ry/czdd.vue';//-
import Czhj from './StepComponents/ry/czhj.vue';//-
import Xzrq from './StepComponents/ry/xzrq.vue';//-
import Jrry from './StepComponents/ry/jrry.vue';//-
import Tpjydd from './StepComponents/ry/tpjydd.vue';//-()
import Tpjysd from './StepComponents/ry/tpjysd.vue';//-()
import Qywz from './StepComponents/ry/qywz.vue';//-
import Clfcz from './StepComponents/ry/clfcz.vue';//
import Clcz from './StepComponents/ry/clcz.vue';//
const stepTypes = [ const stepTypes = [
{ label: '操作地点', value: 'czdd' }, { label: '操作地点', value: 'czdd' },
{ label: '操作方法', value: 'czhj' },
{ label: '选择容器', value: 'xzrq' },
{ label: '加入溶液', value: 'jrry' },
{ label: '天平校验(单点)', value: 'tpjydd' },
{ label: '天平校验(双点)', value: 'tpjysd' },
{ label: '取用物质', value: 'qywz' },
{ label: '称量(非传值)', value: 'clfcz' },
{ label: '称量(传值)', value: 'clcz' },
]; ];
export default { export default {
@ -57,12 +80,28 @@ export default {
components: { components: {
HandleFormItem, HandleFormItem,
Czdd, Czdd,
Czhj,
Xzrq,
Jrry,
Tpjydd,
Tpjysd,
Qywz,
Clfcz,
Clcz,
}, },
computed: { computed: {
stepComponentMap() { stepComponentMap() {
if (!this.componentMap) { if (!this.componentMap) {
this.componentMap = { this.componentMap = {
'czdd': 'Czdd', 'czdd': 'Czdd',
'czhj': 'Czhj',
'xzrq': 'Xzrq',
'jrry': 'Jrry',
'tpjydd': 'Tpjydd',
'tpjysd': 'Tpjysd',
'qywz': 'Qywz',
'clfcz': 'Clfcz',
'clcz': 'Clcz',
} }
} }
return this.componentMap return this.componentMap
@ -120,6 +159,7 @@ export default {
}, },
removeStep(index) { removeStep(index) {
if (this.steps.length > 1) { if (this.steps.length > 1) {
const removedStep = this.steps.splice(index, 1)[0] const removedStep = this.steps.splice(index, 1)[0]
this.$emit('step-removed', { index, step: removedStep, remaining: this.steps.length }) this.$emit('step-removed', { index, step: removedStep, remaining: this.steps.length })
@ -311,15 +351,18 @@ export default {
background: #f5f7fa; background: #f5f7fa;
border-radius: 6px; border-radius: 6px;
} }
.flex1 {
flex:1
}
.step-list { .step-list {
.step-item {
margin-top: 20px;
.step-list-item {
margin-top: 10px;
border-radius: 6px; border-radius: 6px;
overflow: hidden; overflow: hidden;
.step-title { .step-title {
margin-right: 10px; margin-right: 10px;
margin-top: 6px;
} }
.step-type-select { .step-type-select {
@ -342,7 +385,7 @@ export default {
.step-content { .step-content {
display: flex; display: flex;
align-items: center;
align-items: start;
} }
} }
} }

+ 64
- 0
src/components/Template/StepComponents/ry/clcz.vue View File

@ -0,0 +1,64 @@
<!-- 称量非传值 -->
<template>
<StepFormPackage ref = "stepFormPackageRef" :form-config="formConfig" :formData = "formData" />
</template>
<script>
import StepFormPackage from '@/components/Template/StepFormPackage.vue';
import stepMixins from '@/components/Template/mixins/stepMixins.js';
export default {
mixins: [stepMixins],
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config:{
text1:{
label:"使用电子天平",
type:"text",
},
yq:{
type:"instrument",
fillType:"actFill",
},
text2:{
label:"仪器,称取",
type:"text",
},
wzmc:{
type:"mix",
fillType:"actFill",
},
text3:{
label:"物质,称取预计质量为",
type:"text",
},
wzsul:{
type:"inputNumber",
fillType:"preFill",
},
wzsuldw:{
type:"select",
fillType:"preFill",
options:this.getDictOptions("business_zldw"),
},
text4:{
type:"text",
label:",实际质量为"
},
sjcz:{
type:"span"
},
}
}]
}
},
}
</script>
<style lang="scss" scoped>
</style>

+ 71
- 0
src/components/Template/StepComponents/ry/clfcz.vue View File

@ -0,0 +1,71 @@
<!-- 称量传值 -->
<template>
<StepFormPackage ref = "stepFormPackageRef" :form-config="formConfig" :formData = "formData" />
</template>
<script>
import StepFormPackage from '@/components/Template/StepFormPackage.vue';
import stepMixins from '@/components/Template/mixins/stepMixins.js';
export default {
mixins: [stepMixins],
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config:{
text1:{
label:"使用电子天平",
type:"text",
},
yq:{
type:"instrument",
fillType:"actFill",
},
text2:{
label:"仪器,称取",
type:"text",
},
wzmc:{
type:"mix",
fillType:"actFill",
},
text3:{
label:"物质,称取预计质量为",
type:"text",
},
wzsul:{
type:"inputNumber",
fillType:"preFill",
},
wzsuldw:{
type:"select",
fillType:"preFill",
options:this.getDictOptions("business_zldw"),
selectTo:"wzsuldw1",
},
text4:{
type:"text",
label:",实际质量为"
},
sjcz:{
type:"inputNumber",
fillType:"actFill",
},
wzsuldw1:{
type:"select",
fillType:"preFill",
options:this.getDictOptions("business_zldw"),
},
}
}]
}
},
}
</script>
<style lang="scss" scoped>
</style>

+ 53
- 39
src/components/Template/StepComponents/ry/czhj.vue View File

@ -1,48 +1,62 @@
<!-- 操作环境 --> <!-- 操作环境 -->
<template> <template>
<StepFormPackage ref = "stepFormPackageRef" :form-config="formConfig" :formData = "formData" />
<StepFormPackage ref="stepFormPackageRef" :form-config="formConfig" :formData="formData" />
</template> </template>
<script> <script>
import StepFormPackage from '@/components/Template/StepFormPackage.vue'; import StepFormPackage from '@/components/Template/StepFormPackage.vue';
import stepMixins from '@/components/Template/mixins/stepMixins.js';
import stepMixins from '@/components/Template/mixins/stepMixins.js';
export default {
mixins: [stepMixins],
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config:{
text1:{
label:"选择在",
type:"text",
},
ddsys:{
type:"input",
fillType:"preFill",
},
yq:{
type:"instrument",
fillType:"actFill",
},
text2:{
label:"环境下,操作下预计在",
type:"text",
},
ytczhj:{
type:"input",
}
}
}]
}
},
}
export default {
mixins: [stepMixins],
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config: {
text1: {
label: "选择在",
type: "text",
},
ddsys: {
type: "input",
fillType: "preFill",
},
yq: {
type: "instrument",
fillType: "actFill",
},
text2: {
label: "环境下,操作下预计在",
type: "text",
},
ytczhj: {
fillType: "preFill",
type: "select",
options: this.getDictOptions('business_czhj'),
otherCode: "ytczhjOther"
},
text3: {
label: "实际在",
type: "text",
},
sjczhj: {
fillType: "actFill",
type: "select",
options: this.getDictOptions('business_czhj'),
otherCode: "sjczhjOther"
},
text4: {
label: "条件下操作下述步骤",
type: "text",
},
}
}]
}
},
}
</script> </script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>

+ 81
- 0
src/components/Template/StepComponents/ry/jrry.vue View File

@ -0,0 +1,81 @@
<!-- 加入溶液 -->
<template>
<StepFormPackage ref="stepFormPackageRef" :form-config="formConfig" :formData="formData" />
</template>
<script>
import StepFormPackage from '@/components/Template/StepFormPackage.vue';
import stepMixins from '@/components/Template/mixins/stepMixins.js';
export default {
mixins: [stepMixins],
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config: {
text1: {
label: "使用",
type: "text",
},
ytrq: {
fillType: "preFill",
type: "input",
},
sjrqcz: {
fillType: "actFill",
type: "instrument",
},
text2: {
label: "仪器,吸取",
type: "text",
},
srry: {
fillType: "preFill",
type: "input",
},
sjrq:{
fillType: "actFill",
type: "regent",
},
text3:{
label: "溶液,加入预计体积为",
type: "text",
},
ytsr1:{
fillType: "preFill",
type: "inputNumber",
},
tjxz:{
fillType: "preFill",
type: "select",
selectTo: "sjsrdw2",
options:this.getDictOptions('business_tjdw'),
},
text4:{
label: ",实际体积为",
type: "text",
},
sjsr2:{
fillType: "actFill",
type: "inputNumber",
},
sjsrdw2:{
fillType: "preFill",
type: "select",
options: this.getDictOptions('business_tjdw'),
},
text5:{
label: "至容器中。",
type: "text",
}
}
}]
}
},
}
</script>
<style lang="scss" scoped></style>

+ 53
- 0
src/components/Template/StepComponents/ry/qywz.vue View File

@ -0,0 +1,53 @@
<!-- 取用物质 -->
<template>
<StepFormPackage @onDialogSubmit="onDialogSubmit" ref = "stepFormPackageRef" :form-config="formConfig" :formData = "formData" />
</template>
<script>
import StepFormPackage from '@/components/Template/StepFormPackage.vue';
import stepMixins from '@/components/Template/mixins/stepMixins.js';
export default {
mixins: [stepMixins],
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config:{
text1:{
label:"选择",
type:"text",
},
ddsys:{
type:"input",
fillType:"preFill",
},
yq:{
type:"gsp",
fillType:"actFill",
},
text2:{
label:"其质量为",
type:"text",
},
zl:{
type:"span",
}
}
}]
}
},
methods: {
onDialogSubmit(data){
console.log(data);
}
}
}
</script>
<style lang="scss" scoped>
</style>

+ 125
- 0
src/components/Template/StepComponents/ry/tpjydd.vue View File

@ -0,0 +1,125 @@
<!-- 天平校验(单点) -->
<template>
<StepFormPackage
ref = "stepFormPackageRef"
@clickButton="handleClickButton"
:form-config="formConfig" :formData = "formData" />
</template>
<script>
import StepFormPackage from '@/components/Template/StepFormPackage.vue';
import stepMixins from '@/components/Template/mixins/stepMixins.js';
export default {
mixins: [stepMixins],
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config:{
text1:{
label:"校验天平编号为",
type:"text",
},
ddsys:{
type:"instrument",
fillType:"actFill",
},
text2:{
label:"皮重显示值为",
type:"text",
},
pz:{
type:"inputNumber",
fillType:"actFill",
disabled:true,
},
button1:{
type:"button",
buttonName:"获取值",
},
text3:{
label:",标准砝码编号为",
type:"text",
},
sjsr1:{
type:"input",
fillType:"actFill",
},
text4:{
label:",标准砝码实际值为",
type:"text",
},
sjsr2:{
type:"inputNumber",
fillType:"actFill",
},
sjsrdw2:{
type:"select",
fillType:"actFill",
options:this.getDictOptions("business_zldw")
},
text5:{
label:"标准砝码发修正值为",
type:"text",
},
sjsr3:{
type:"inputNumber",
fillType:"actFill",
},
sjsrdw3:{
type:"select",
fillType:"actFill",
options:this.getDictOptions("business_zldw")
},
text6:{
label:",标准砝码显示值为",
type:"text",
},
fmz:{
type:"inputNumber",
fillType:"actFill",
disabled:true,
},
button2:{
type:"button",
buttonName:"获取值",
},
text7:{
label:"允许的偏差范围为±",
type:"text",
},
sjsr4:{
type:"inputNumber",
fillType:"actFill",
},
sjsrdw4:{
type:"select",
fillType:"actFill",
options:this.getDictOptions("business_zldw")
},
text8:{
label:",结果判定",
type:"text",
},
jgpd:{
label:"通过/不通过",
type:"span",
}
}
}]
}
},
methods: {
handleClickButton(key){
console.log(key)
}
}
}
</script>
<style lang="scss" scoped>
</style>

+ 226
- 0
src/components/Template/StepComponents/ry/tpjysd.vue View File

@ -0,0 +1,226 @@
<!-- 天平校验(双点) -->
<template>
<StepFormPackage
ref = "stepFormPackageRef"
@clickButton="handleClickButton"
:form-config="formConfig" :formData = "formData" />
</template>
<script>
import StepFormPackage from '@/components/Template/StepFormPackage.vue';
import stepMixins from '@/components/Template/mixins/stepMixins.js';
export default {
mixins: [stepMixins],
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config:{
text1:{
label:"校验天平编号为",
type:"text",
},
ddsys:{
type:"instrument",
fillType:"actFill",
},
}
},
{
config:{
dfmtext1:{
label:"低砝码校验:",
type:"text",
},
dfmtext2:{
label:"皮重显示值为",
type:"text",
},
dfmpz:{
type:"inputNumber",
fillType:"actFill",
disabled:true,
},
dfmbutton1:{
type:"button",
buttonName:"获取值",
},
dfmtext3:{
label:",标准砝码编号为",
type:"text",
},
dfmsjsr1:{
type:"input",
fillType:"actFill",
},
dfmtext4:{
label:",标准砝码实际值为",
type:"text",
},
dfmsjsr2:{
type:"inputNumber",
fillType:"actFill",
},
dfmsjsrdw2:{
type:"select",
fillType:"actFill",
options:this.getDictOptions("business_zldw")
},
dfmtext5:{
label:"标准砝码发修正值为",
type:"text",
},
dfmsjsr3:{
type:"inputNumber",
fillType:"actFill",
},
dfmsjsrdw3:{
type:"select",
fillType:"actFill",
options:this.getDictOptions("business_zldw")
},
dfmtext6:{
label:",标准砝码显示值为",
type:"text",
},
dfmfmz:{
type:"inputNumber",
fillType:"actFill",
disabled:true,
},
dfmbutton2:{
type:"button",
buttonName:"获取值",
},
dfmtext7:{
label:"允许的偏差范围为±",
type:"text",
},
dfmsjsr4:{
type:"inputNumber",
fillType:"actFill",
},
dfmsjsrdw4:{
type:"select",
fillType:"actFill",
options:this.getDictOptions("business_zldw")
},
dfmtext8:{
label:",结果判定",
type:"text",
},
dfmjgpd:{
label:"通过/不通过",
type:"span",
}
}
},
{
config:{
text1:{
label:"高砝码校验:",
type:"text",
},
text2:{
label:"皮重显示值为",
type:"text",
},
pz:{
type:"inputNumber",
fillType:"actFill",
disabled:true,
},
button1:{
type:"button",
buttonName:"获取值",
},
text3:{
label:",标准砝码编号为",
type:"text",
},
sjsr1:{
type:"input",
fillType:"actFill",
},
text4:{
label:",标准砝码实际值为",
type:"text",
},
sjsr2:{
type:"inputNumber",
fillType:"actFill",
},
sjsrdw2:{
type:"select",
fillType:"actFill",
options:this.getDictOptions("business_zldw")
},
text5:{
label:"标准砝码发修正值为",
type:"text",
},
sjsr3:{
type:"inputNumber",
fillType:"actFill",
},
sjsrdw3:{
type:"select",
fillType:"actFill",
options:this.getDictOptions("business_zldw")
},
text6:{
label:",标准砝码显示值为",
type:"text",
},
fmz:{
type:"inputNumber",
fillType:"actFill",
disabled:true,
},
button2:{
type:"button",
buttonName:"获取值",
},
text7:{
label:"允许的偏差范围为±",
type:"text",
},
sjsr4:{
type:"inputNumber",
fillType:"actFill",
},
sjsrdw4:{
type:"select",
fillType:"actFill",
options:this.getDictOptions("business_zldw")
},
text8:{
label:",结果判定",
type:"text",
},
jgpd:{
label:"通过/不通过",
type:"span",
}
}
}
]
}
},
methods: {
handleClickButton(key){
console.log(key)
}
}
}
</script>
<style lang="scss" scoped>
</style>

+ 44
- 0
src/components/Template/StepComponents/ry/xzrq.vue View File

@ -0,0 +1,44 @@
<!-- 选择容器 -->
<template>
<StepFormPackage ref="stepFormPackageRef" :form-config="formConfig" :formData="formData" />
</template>
<script>
import StepFormPackage from '@/components/Template/StepFormPackage.vue';
import stepMixins from '@/components/Template/mixins/stepMixins.js';
export default {
mixins: [stepMixins],
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config: {
text1: {
label: "选择",
type: "text",
},
ytrqcz: {
fillType: "preFill",
type: "select",
options: this.getDictOptions('business_rqcz'),
},
sjrqcz: {
fillType: "actFill",
type: "select",
options: this.getDictOptions('business_rqcz'),
},
text2: {
label: "作为容器",
type: "text",
},
}
}]
}
},
}
</script>
<style lang="scss" scoped></style>

+ 44
- 12
src/components/Template/StepFormPackage.vue View File

@ -17,20 +17,14 @@
<template v-else-if="sItem.type === 'select'"> <template v-else-if="sItem.type === 'select'">
<HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key" <HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="select" @blur="onBlur(key, $event)" :item="sItem" v-model="formFields[key]" type="select" @blur="onBlur(key, $event)" :item="sItem" v-model="formFields[key]"
@change="onSelectChange(key, $event, sItem.type)"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false" @copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" /> :orange-bg="orangeBgFields[key]" />
</template> </template>
<!-- 仪器 -->
<template v-else-if="sItem.type === 'instrument'">
<!-- 仪器instrumentregent(药剂) gsp(供试品) mix药剂/供试品/给药制剂 -->
<template v-else-if="sItem.type === 'instrument' || sItem.type === 'regent' || sItem.type === 'gsp' || sItem.type === 'mix'">
<HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key" <HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="clickable" @clickable="handleClickInstrument(key,'instrument')" :error="errors[key]"
@update:error="errors[key] = false" @resetRecord="resetRecord(key)" :item="getClickableItem(sItem)"
:value="formFields[key]" />
</template>
<!-- 仪器 -->
<template v-else-if="sItem.type === 'regent'">
<HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="clickable" @clickable="handleClickInstrument(key,'regent')" :error="errors[key]"
type="clickable" @clickable="handleClickInstrument(key,sItem.type)" :error="errors[key]"
@update:error="errors[key] = false" @resetRecord="resetRecord(key)" :item="getClickableItem(sItem)" @update:error="errors[key] = false" @resetRecord="resetRecord(key)" :item="getClickableItem(sItem)"
:value="formFields[key]" /> :value="formFields[key]" />
</template> </template>
@ -40,6 +34,16 @@
<template v-else-if="sItem.type === 'span'"> <template v-else-if="sItem.type === 'span'">
<span>{{ formFields[key] }}</span> <span>{{ formFields[key] }}</span>
</template> </template>
<template v-else-if="sItem.type === 'button'">
<el-button type="primary" @click="handleClickButton(key)">{{ sItem.buttonName }}</el-button>
</template>
<div v-show="isShowOther(formFields[key])" class="flex flex1">
<div class="other-title">{{sItem.otherLabel ? $t(sItem.otherLabel) : $t("template.common.other") }}</div>
<HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+sItem.otherCode" @blur="onBlur(key, $event)" :item="getOtherItem(sItem)"
v-model="formFields[sItem.otherCode]" @copy="onCopy(sItem, key)"
:error="errors[sItem.otherCode]" @update:error="errors[sItem.otherCode] = false"
:orange-bg="orangeBgFields[sItem.otherCode]" />
</div>
</div> </div>
</div> </div>
@ -80,10 +84,12 @@ export default {
mounted() { mounted() {
EventBus.$on("onReagentSubmit",this.onReagentSubmit) EventBus.$on("onReagentSubmit",this.onReagentSubmit)
EventBus.$on("onInstrumentSubmit",this.onInstrumentSubmit) EventBus.$on("onInstrumentSubmit",this.onInstrumentSubmit)
EventBus.$on("onMixReagentSubmit",this.onMixReagentSubmit)
}, },
unmounted() { unmounted() {
EventBus.$off("onReagentSubmit",this.onReagentSubmit) EventBus.$off("onReagentSubmit",this.onReagentSubmit)
EventBus.$off("onInstrumentSubmit",this.onInstrumentSubmit) EventBus.$off("onInstrumentSubmit",this.onInstrumentSubmit)
EventBus.$off("onMixReagentSubmit",this.onMixReagentSubmit)
}, },
data() { data() {
return { return {
@ -97,6 +103,12 @@ export default {
} }
}, },
methods: { methods: {
// //
onMixReagentSubmit(data){
if(data.uuid !== this.uuid) return;
this.formFields[this.currentClickKey] = data.selectedId;
this.$emit("onDialogSubmit",data)
},
// //
onReagentSubmit(data){ onReagentSubmit(data){
if(data.uuid !== this.uuid) return; if(data.uuid !== this.uuid) return;
@ -110,15 +122,33 @@ export default {
getClickableItem(sItem) { getClickableItem(sItem) {
return { return {
...sItem, ...sItem,
type:"clickable"
type:"clickable",
} }
}, },
handleClickInstrument(key,type) { handleClickInstrument(key,type) {
this.currentClickKey = key; this.currentClickKey = key;
if(type === 'regent'){ if(type === 'regent'){
EventBus.$emit("showSelectReagentDialog",{
EventBus.$emit("showSelectMixReagentDialog",{
studyFormId:this.templateData.id,
uuid:this.uuid,
sourceFrom:'step',
type:"sj"
})
}else if(type === 'gsp'){
EventBus.$emit("showSelectMixReagentDialog",{
studyFormId:this.templateData.id,
uuid:this.uuid,
sourceFrom:'step',
type:"gsp"
})
}else if(type === 'gsp'){
EventBus.$emit("showSelectMixReagentDialog",{
studyFormId:this.templateData.id, studyFormId:this.templateData.id,
uuid:this.uuid, uuid:this.uuid,
sourceFrom:'step',
type:"sj",
mixType:true,
}) })
}else if(type === 'instrument'){ }else if(type === 'instrument'){
EventBus.$emit("showSelectInstrumentDialog",{ EventBus.$emit("showSelectInstrumentDialog",{
@ -138,6 +168,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 14px; font-size: 14px;
flex-wrap: wrap;
} }
.step-row { .step-row {
@ -148,5 +179,6 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
margin-left: 5px; margin-left: 5px;
margin-bottom: 10px;
} }
</style> </style>

+ 4
- 1
src/components/Template/mixins/formPackageMixins.js View File

@ -35,6 +35,9 @@ export default {
}, },
methods: { methods: {
handleClickButton(key){
this.$emit("clickButton", key)
},
getFillType(type) { getFillType(type) {
const typeObj = { const typeObj = {
actFill: "orange-border",//实际填写的边框颜色 actFill: "orange-border",//实际填写的边框颜色
@ -242,7 +245,7 @@ export default {
continue continue
} }
//span的字段不校验 //span的字段不校验
if (o.type === "span" || o.type ==="text") {
if (o.type === "span" || o.type ==="text" || o.type === "button") {
continue continue
} }
if (o.fillType === this.templateFillType && !o.disabled) { if (o.fillType === this.templateFillType && !o.disabled) {

+ 6
- 1
src/components/Template/mixins/stepMixins.js View File

@ -1,4 +1,5 @@
export default { export default {
dicts:["business_tjdw","business_czhj","business_rqcz","business_zldw"],
props: { props: {
formData: { formData: {
type: Object, type: Object,
@ -11,6 +12,10 @@ export default {
}, },
getFilledFormData() { getFilledFormData() {
return this.$refs.stepFormPackageRef?.getFilledFormData(); return this.$refs.stepFormPackageRef?.getFilledFormData();
}
},
//试验配制条件options
getDictOptions(dictType) {
return this.dict.type[dictType] || []
},
}, },
} }

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

@ -6,6 +6,7 @@
<TagPrintDialog ref = "tagPrintDialogRef"></TagPrintDialog> <TagPrintDialog ref = "tagPrintDialogRef"></TagPrintDialog>
<SelectReagentDialog ref="selectReagentDialogRef"/> <SelectReagentDialog ref="selectReagentDialogRef"/>
<SelectInstrumentDialog ref="selectInstrumentDialogRef"/> <SelectInstrumentDialog ref="selectInstrumentDialogRef"/>
<SelectMixReagentDialog ref="selectMixReagentDialogRef"/>
</div> </div>
</template> </template>
@ -16,6 +17,7 @@ import SubPackageDialog from "./dialog/SubPackageDialog.vue";//分装弹窗
import TagPrintDialog from "./dialog/PrintTagDialog.vue";// import TagPrintDialog from "./dialog/PrintTagDialog.vue";//
import SelectReagentDialog from "./dialog/SelectReagentDialog.vue";// import SelectReagentDialog from "./dialog/SelectReagentDialog.vue";//
import SelectInstrumentDialog from "./dialog/SelectInstrumentDialog.vue";// import SelectInstrumentDialog from "./dialog/SelectInstrumentDialog.vue";//
import SelectMixReagentDialog from "./dialog/SelectMixReagentDialog.vue";////
// //
import SWYPFXRYPZB from "./comps/sp/SWYPFXRYPZB.vue"; import SWYPFXRYPZB from "./comps/sp/SWYPFXRYPZB.vue";
@ -44,7 +46,7 @@ import MJYLQSQD from "./comps/gsp/MJYLQSQD.vue";
export default { export default {
name: "TemplateTable", name: "TemplateTable",
components: { components: {
SubPackageDialog,TagPrintDialog,SelectReagentDialog,SelectInstrumentDialog,
SubPackageDialog,TagPrintDialog,SelectReagentDialog,SelectInstrumentDialog,SelectMixReagentDialog,
// //
MJYLQSQD, SYWZPZJHB, MJYLQSQD, SYWZPZJHB,
// //
@ -179,6 +181,10 @@ export default {
EventBus.$on("showSelectReagentDialog",(data)=>{ EventBus.$on("showSelectReagentDialog",(data)=>{
this.$refs.selectReagentDialogRef.show(data.studyFormId,data) this.$refs.selectReagentDialogRef.show(data.studyFormId,data)
}) })
////
EventBus.$on("showSelectMixReagentDialog",(data)=>{
this.$refs.selectMixReagentDialogRef.show(data.studyFormId,data)
})
}, },
beforeDestroy() { beforeDestroy() {
// //
@ -187,6 +193,7 @@ export default {
EventBus.$off("showTagPrintDialog"); EventBus.$off("showTagPrintDialog");
EventBus.$off("showSelectReagentDialog"); EventBus.$off("showSelectReagentDialog");
EventBus.$off("showSelectInstrumentDialog"); EventBus.$off("showSelectInstrumentDialog");
EventBus.$off("showSelectMixReagentDialog");
}, },
methods: { methods: {
async getFormData() { async getFormData() {

+ 5
- 3
src/views/business/comps/template/dialog/SelectInstrumentDialog.vue View File

@ -98,10 +98,12 @@ export default {
if(data && data.uuid) {//eventBusid if(data && data.uuid) {//eventBusid
this.uuid = data.uuid this.uuid = data.uuid
} }
if(this.$refs.selectSjRef){
this.$refs.selectSjRef.show()
}
this.visible = true this.visible = true
setTimeout(() => {
if(this.$refs.selectSjRef){
this.$refs.selectSjRef.show()
}
}, 10);
this.studyFormId = studyFormId this.studyFormId = studyFormId
}, },
onCancel() { onCancel() {

+ 53
- 12
src/views/business/comps/template/dialog/SelectMixReagentDialog.vue View File

@ -2,13 +2,19 @@
<template> <template>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="$t(title)" @close="onCancel" <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="$t(title)" @close="onCancel"
:visible.sync="visible" append-to-body width="80%"> :visible.sync="visible" append-to-body width="80%">
<el-radio-group v-model="selectType" @change="handleRadioChange" style="margin-bottom: 30px;">
<el-radio-group v-show = "mixType" v-model="selectType" @change="handleShowTableInfo" class="mt-20 mb-20">
<el-radio-button label="sj">试剂列表</el-radio-button> <el-radio-button label="sj">试剂列表</el-radio-button>
<el-radio-button label="gsp">供试品列表</el-radio-button> <el-radio-button label="gsp">供试品列表</el-radio-button>
<el-radio-button label="gyzj">给药制剂列表</el-radio-button> <el-radio-button label="gyzj">给药制剂列表</el-radio-button>
</el-radio-group> </el-radio-group>
<SelectTable ref="selectSjRef" :columns="columns" :selectedId="selectedId" :searchForm="searchForm" <SelectTable ref="selectSjRef" :columns="columns" :selectedId="selectedId" :searchForm="searchForm"
:studyFormId="studyFormId" :listApi="listApi" :selectedCode="selectedCode" @radioSelect="handleSelect" /> :studyFormId="studyFormId" :listApi="listApi" :selectedCode="selectedCode" @radioSelect="handleSelect" />
<!-- 只有步骤才会又这个选项 -->
<div v-if = "sourceFrom === 'step'" class="other-reagent">
<el-checkbox v-model="otherChecked" @change="handleOtherChange">其他</el-checkbox>
<el-input class="other-reagent-input" v-model="otherReagent"></el-input>
</div>
<template slot="footer" class="dialog-footer"> <template slot="footer" class="dialog-footer">
<el-button @click="onCancel">{{ $t('form.cancel') }}</el-button> <el-button @click="onCancel">{{ $t('form.cancel') }}</el-button>
<el-button :disabled="isDisabled" type="primary" @click="onSubmit">{{ $t('form.saveConfirm') }}</el-button> <el-button :disabled="isDisabled" type="primary" @click="onSubmit">{{ $t('form.saveConfirm') }}</el-button>
@ -19,7 +25,7 @@
<script> <script>
import SelectTable from '@/components/Template/SelectTable.vue'; import SelectTable from '@/components/Template/SelectTable.vue';
import SelectDept from "@/views/business/comps/select/SelectDept"; import SelectDept from "@/views/business/comps/select/SelectDept";
import { public_sjList,public_gyzjList } from '@/api/business/public/public';
import { public_sjList,public_gyzjList,public_gspList } from '@/api/business/public/public';
import { getSjSearchForm, getSjColumns,getGyzjSearchForm,getGyzjColumns,getGspSearchForm,getGspColumns } from '@/views/business/comps/template/formConfig/formConfig.js'; import { getSjSearchForm, getSjColumns,getGyzjSearchForm,getGyzjColumns,getGspSearchForm,getGspColumns } from '@/views/business/comps/template/formConfig/formConfig.js';
import { EventBus } from "@/utils/eventBus"; import { EventBus } from "@/utils/eventBus";
const typeMap ={ const typeMap ={
@ -61,6 +67,7 @@ export default {
data() { data() {
return { return {
visible: false, visible: false,
otherChecked: false,
selectedId: "", selectedId: "",
currentRow: {}, currentRow: {},
radio: 1, radio: 1,
@ -73,10 +80,15 @@ export default {
searchForm: getSjSearchForm(), searchForm: getSjSearchForm(),
columns: getSjColumns(), columns: getSjColumns(),
sourceFrom:"step",// sourceFrom:"step",//
otherReagent: "",//
mixType: false,//
} }
}, },
computed: { computed: {
isDisabled() { isDisabled() {
if(this.otherChecked && this.otherReagent){//
return false;
}
return !this.selectedId; return !this.selectedId;
} }
}, },
@ -86,15 +98,32 @@ export default {
this.uuid = data.uuid this.uuid = data.uuid
} }
//type:sj()gsp()gyzj() //type:sj()gsp()gyzj()
const {type = "sj"} = data;
const {type,sourceFrom = "step",mixType = false} = data;
this.mixType = mixType;
this.sourceFrom = sourceFrom;
this.studyFormId = studyFormId;
this.visible = true;
this.handleShowTableInfo(type);
},
handleOtherChange(val){
this.otherChecked = val;
if(val){//id
this.selectedId = "";
this.currentRow = {};
}
},
handleShowTableInfo(type){
this.selectType = type; this.selectType = type;
this.searchForm = typeMap[type].searchForm; this.searchForm = typeMap[type].searchForm;
this.columns = typeMap[type].columns; this.columns = typeMap[type].columns;
this.listApi = typeMap[type].listApi; this.listApi = typeMap[type].listApi;
this.listApi = typeMap[type].listApi || this.listApi; this.listApi = typeMap[type].listApi || this.listApi;
this.studyFormId = studyFormId
setTimeout(() => {
if(this.$refs.selectSjRef){
this.$refs.selectSjRef.show()
}
}, 10);
}, },
onCancel() { onCancel() {
this.visible = false this.visible = false
@ -102,15 +131,12 @@ export default {
}, },
onSubmit() { onSubmit() {
let row = this.currentRow; let row = this.currentRow;
this.$emit('submit', this.selectedId, row);
const selectedValue = this.otherChecked ? this.otherReagent : this.selectedId;
this.$emit('submit', selectedValue, row);
// eventBus // eventBus
EventBus.$emit("onReagentSubmit", { uuid: this.uuid, selectedId: this.selectedId, row });
EventBus.$emit("onMixReagentSubmit", { uuid: this.uuid, selectedId: selectedValue, row });
this.visible = false; this.visible = false;
}, },
//Radio
handleRadioChange(val){
},
// //
handleSelect(code, row) { handleSelect(code, row) {
this.selectedId = code; this.selectedId = code;
@ -126,4 +152,19 @@ export default {
align-items: center; align-items: center;
padding: 20px 0; padding: 20px 0;
} }
.other-reagent{
display: flex;
align-items: center;
padding:20px 0;
}
.other-reagent-input{
width: 200px;
margin-left: 5px;
}
.mt-20{
margin-top: 20px;
}
.mb-20{
margin-bottom: 20px;
}
</style> </style>

Loading…
Cancel
Save