|
|
@@ -24,19 +24,19 @@
|
|
|
<div v-if="loadCompleted" class="config-form-container">
|
|
|
<div class="left">
|
|
|
<experimental-desc
|
|
|
- :step="configData.step"
|
|
|
- :criterion="configData.criterion"
|
|
|
- :formulas="configData.formulas"
|
|
|
- :references="configData.references"
|
|
|
+ :step="configData.step || ''"
|
|
|
+ :criterion="configData.criterion || ''"
|
|
|
+ :formulas="configData.formulas || []"
|
|
|
+ :references="configData.references || []"
|
|
|
:readonly="readonly"
|
|
|
/>
|
|
|
<basic-info :info="form" :readonly="readonly" />
|
|
|
<reagent-info :info="form.reagentPoList" :readonly="readonly" />
|
|
|
<param-info
|
|
|
- v-if="$utils.isNotEmpty(configData.params)"
|
|
|
+ v-if="$utils.isNotEmpty(configData && configData.params)"
|
|
|
:form-id="formId"
|
|
|
:info="form.shiYanCanShu"
|
|
|
- :config-data="configData.params"
|
|
|
+ :config-data="configData.params || []"
|
|
|
:readonly="readonly"
|
|
|
@updateParams="handleUpdateParams"
|
|
|
/>
|
|
|
@@ -65,7 +65,7 @@
|
|
|
</div>
|
|
|
</el-form>
|
|
|
<div slot="title" class="config-dialog-header">
|
|
|
- <div class="title">{{ configData.methodName }}</div>
|
|
|
+ <div class="title">{{ configData.methodName || '' }}</div>
|
|
|
<div class="operate">
|
|
|
<template v-for="btn in toolbars">
|
|
|
<el-button
|
|
|
@@ -76,7 +76,7 @@
|
|
|
:size="btn.size || 'mini'"
|
|
|
@click="handleActionEvent(btn.key)"
|
|
|
>
|
|
|
- {{ btn.label }}
|
|
|
+ {{ typeof btn.label === "function" ? btn.label() : btn.label }}
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</div>
|
|
|
@@ -96,22 +96,22 @@
|
|
|
margin-bottom: 20px;
|
|
|
"
|
|
|
>
|
|
|
- {{ configData.methodName }}
|
|
|
+ {{ configData.methodName || '' }}
|
|
|
</div>
|
|
|
<experimental-desc
|
|
|
- :step="configData.step"
|
|
|
- :criterion="configData.criterion"
|
|
|
- :formulas="configData.formulas"
|
|
|
- :references="configData.references"
|
|
|
+ :step="configData.step || ''"
|
|
|
+ :criterion="configData.criterion || ''"
|
|
|
+ :formulas="configData.formulas || []"
|
|
|
+ :references="configData.references || []"
|
|
|
:readonly="true"
|
|
|
/>
|
|
|
<basic-info :info="form" :readonly="true" />
|
|
|
<reagent-info :info="form.reagentPoList" :readonly="true" :pdf="pdf" />
|
|
|
<param-info
|
|
|
- v-if="$utils.isNotEmpty(configData.params)"
|
|
|
+ v-if="$utils.isNotEmpty(configData && configData.params)"
|
|
|
:form-id="formId"
|
|
|
:info="form.shiYanCanShu"
|
|
|
- :config-data="configData.params"
|
|
|
+ :config-data="configData.params || []"
|
|
|
:readonly="true"
|
|
|
@updateParams="handleUpdateParams"
|
|
|
/>
|
|
|
@@ -204,7 +204,7 @@ export default {
|
|
|
dialogFormVisible: false,
|
|
|
pdf: 'pdf',
|
|
|
formLabelWidth: '110px',
|
|
|
- configData: {},
|
|
|
+ configData: { methodName: '' },
|
|
|
formId: this.params.recordId,
|
|
|
form: {
|
|
|
xingNengZhiBia: '',
|
|
|
@@ -227,25 +227,48 @@ export default {
|
|
|
shiYanShuJu: [],
|
|
|
jiSuanJieGuo: {},
|
|
|
shiYanJieLun: '',
|
|
|
+ shiFouGuoShen: '已暂存',
|
|
|
fuJian: ''
|
|
|
},
|
|
|
rules: formRules,
|
|
|
loading: false,
|
|
|
loadCompleted: false,
|
|
|
toolbars: [
|
|
|
+ {
|
|
|
+ key: 'flowChart',
|
|
|
+ icon: 'ibps-icon-picture',
|
|
|
+ label: '流程图',
|
|
|
+ type: 'primary',
|
|
|
+ hidden: this.showToolBarsBtn('flowChart')
|
|
|
+ },
|
|
|
{
|
|
|
key: 'pdf',
|
|
|
icon: 'ibps-icon-cube',
|
|
|
label: '导出为PDF',
|
|
|
- type: 'primary'
|
|
|
+ type: 'primary',
|
|
|
+ hidden: this.showToolBarsBtn('pdf')
|
|
|
},
|
|
|
// { key: 'test', icon: 'ibps-icon-gg', label: '测试', type: 'warning', hidden: this.readonly },
|
|
|
{
|
|
|
key: 'save',
|
|
|
icon: 'ibps-icon-save',
|
|
|
label: '保存',
|
|
|
- type: 'success',
|
|
|
- hidden: this.readonly
|
|
|
+ type: 'primary',
|
|
|
+ hidden: this.showToolBarsBtn('save')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'submit',
|
|
|
+ icon: 'el-icon-s-promotion',
|
|
|
+ label: this.getSubmitLabel,
|
|
|
+ type: 'primary',
|
|
|
+ hidden: this.showToolBarsBtn('submit')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'sendBack',
|
|
|
+ icon: 'ibps-icon-check-square-o',
|
|
|
+ label: '退回',
|
|
|
+ type: 'primary',
|
|
|
+ hidden: this.showToolBarsBtn('sendBack')
|
|
|
},
|
|
|
// { key: 'submit', icon: 'ibps-icon-send', label: '提交', type: 'primary', hidden: this.readonly },
|
|
|
// { key: 'generate', icon: 'ibps-icon-cube', label: '生成报告', type: 'success', hidden: this.readonly },
|
|
|
@@ -253,7 +276,8 @@ export default {
|
|
|
key: 'cancel',
|
|
|
icon: 'el-icon-close',
|
|
|
label: '关闭',
|
|
|
- type: 'danger'
|
|
|
+ type: 'danger',
|
|
|
+ hidden: this.showToolBarsBtn('cancel')
|
|
|
}
|
|
|
],
|
|
|
validateList: [
|
|
|
@@ -274,6 +298,14 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ // 如果从myRecord传来了shiFouGuoShen,则使用它
|
|
|
+ if (this.params && this.params.shiFouGuoShen) {
|
|
|
+ // 确保form对象存在
|
|
|
+ if (!this.form) {
|
|
|
+ this.form = {}
|
|
|
+ }
|
|
|
+ this.form.shiFouGuoShen = this.params.shiFouGuoShen
|
|
|
+ }
|
|
|
this.getConfigData(this.params)
|
|
|
if (!this.params.recordId) {
|
|
|
this.loadCompleted = true
|
|
|
@@ -641,6 +673,50 @@ export default {
|
|
|
...t,
|
|
|
shiYanCanShu: this.form.shiYanCanShu
|
|
|
}
|
|
|
+ },
|
|
|
+ // 控制工具栏按钮显示
|
|
|
+ showToolBarsBtn(key) {
|
|
|
+ // 在查阅状态时,只显示流程图、导出PDF和关闭按钮
|
|
|
+ if (this.readonly) {
|
|
|
+ // 允许显示的按钮:flowChart(流程图)、pdf(导出PDF)、cancel(关闭)
|
|
|
+ return !['flowChart', 'pdf', 'cancel'].includes(key)
|
|
|
+ }
|
|
|
+
|
|
|
+ // 非查阅状态,根据shiFouGuoShen状态字段控制按钮显示
|
|
|
+ const status = (this.form && this.form.shiFouGuoShen) || '已暂存'
|
|
|
+
|
|
|
+ // 已暂存状态显示流程图,导出pdf,关闭,保存,提交按钮
|
|
|
+ if (status === '已暂存' || status === '已退回') {
|
|
|
+ return !['flowChart', 'pdf', 'cancel', 'save', 'submit'].includes(key)
|
|
|
+ }
|
|
|
+
|
|
|
+ // 已编制状态显示流程图,导出pdf,关闭,保存,退回,提交按钮
|
|
|
+ if (status === '已编制') {
|
|
|
+ return !['flowChart', 'pdf', 'cancel', 'save', 'sendBack', 'submit'].includes(key)
|
|
|
+ }
|
|
|
+
|
|
|
+ // 已审核状态显示流程图,导出pdf,关闭,保存,退回,提交按钮
|
|
|
+ if (status === '已审核') {
|
|
|
+ return !['flowChart', 'pdf', 'cancel', 'save', 'sendBack', 'submit'].includes(key)
|
|
|
+ }
|
|
|
+
|
|
|
+ // 已完成,已终止状态和查阅时显示一致
|
|
|
+ if (status === '已完成' || status === '已终止') {
|
|
|
+ return !['flowChart', 'pdf', 'cancel'].includes(key)
|
|
|
+ }
|
|
|
+
|
|
|
+ // 默认显示流程图,导出pdf,关闭,保存,提交按钮
|
|
|
+ return !['flowChart', 'pdf', 'cancel', 'save', 'submit'].includes(key)
|
|
|
+ },
|
|
|
+ // 获取提交按钮的标签
|
|
|
+ getSubmitLabel() {
|
|
|
+ const status = (this.form && this.form.shiFouGuoShen) || '已暂存'
|
|
|
+ // 已编制和已审核状态下,提交按钮显示为"同意"
|
|
|
+ if (status === '已编制' || status === '已审核') {
|
|
|
+ return '同意'
|
|
|
+ }
|
|
|
+ // 其他状态下显示为"提交"
|
|
|
+ return '提交'
|
|
|
}
|
|
|
}
|
|
|
}
|