|
|
@@ -17,9 +17,9 @@
|
|
|
:label-width="formLabelWidth"
|
|
|
:model.sync="form"
|
|
|
:rules="rules"
|
|
|
- :readonly="readonly"
|
|
|
+ :readonly="internalReadonly"
|
|
|
class="config-form"
|
|
|
- :class="readonly ? 'readonly-form' : ''"
|
|
|
+ :class="internalReadonly ? 'readonly-form' : ''"
|
|
|
@submit.native.prevent
|
|
|
>
|
|
|
<!--<div>流程进来</div>-->
|
|
|
@@ -30,16 +30,16 @@
|
|
|
:criterion="configData.criterion || ''"
|
|
|
:formulas="configData.formulas || []"
|
|
|
:references="configData.references || []"
|
|
|
- :readonly="readonly"
|
|
|
+ :readonly="internalReadonly"
|
|
|
/>
|
|
|
- <basic-info :info="form" :readonly="readonly" />
|
|
|
- <reagent-info :info="form.reagentPoList" :readonly="readonly" />
|
|
|
+ <basic-info :info="form" :readonly="internalReadonly" />
|
|
|
+ <reagent-info :info="form.reagentPoList" :readonly="internalReadonly" />
|
|
|
<param-info
|
|
|
v-if="$utils.isNotEmpty(configData && configData.params)"
|
|
|
:form-id="formId"
|
|
|
:info="form.shiYanCanShu"
|
|
|
:config-data="configData.params || []"
|
|
|
- :readonly="readonly"
|
|
|
+ :readonly="internalReadonly"
|
|
|
@updateParams="handleUpdateParams"
|
|
|
/>
|
|
|
</div>
|
|
|
@@ -47,20 +47,20 @@
|
|
|
<experimental-data
|
|
|
:exp="form.jiSuanJieGuo"
|
|
|
:form-id="formId"
|
|
|
- :readonly="readonly"
|
|
|
+ :readonly="internalReadonly"
|
|
|
@export="handleExport"
|
|
|
@import="handleImport"
|
|
|
/>
|
|
|
<precision
|
|
|
v-if="$utils.isNotEmpty(form.jiSuanJieGuo)"
|
|
|
:info="form.jiSuanJieGuo"
|
|
|
- :readonly="readonly"
|
|
|
+ :readonly="internalReadonly"
|
|
|
@recalculate="handleRecalculate"
|
|
|
/>
|
|
|
<conclusion
|
|
|
:result="form.shiYanJieLun"
|
|
|
:files="form.fuJian"
|
|
|
- :readonly="readonly"
|
|
|
+ :readonly="internalReadonly"
|
|
|
@updateData="handleUpdateData"
|
|
|
/>
|
|
|
</div>
|
|
|
@@ -240,7 +240,7 @@ export default {
|
|
|
rejectDialogVisible: false,
|
|
|
pdf: 'pdf',
|
|
|
formLabelWidth: '110px',
|
|
|
- readonly: true,
|
|
|
+ internalReadonly: true, // 使用内部变量管理只读状态
|
|
|
instid:'',
|
|
|
currentName: '',//当前流程节点名称
|
|
|
configData: { methodName: '' },
|
|
|
@@ -352,10 +352,13 @@ export default {
|
|
|
// immediate: true
|
|
|
}*/
|
|
|
},
|
|
|
- created() {
|
|
|
+ async created() {
|
|
|
// this.getConfigData(this.params)
|
|
|
- if (!this.params.attrs.id) {
|
|
|
- this.loadCompleted = true
|
|
|
+ if (!this.params.attrs.id && this.params.instanceId) {
|
|
|
+ //没有页面id,从我的请求,我的已办进来
|
|
|
+ this.instid = this.params.instanceId
|
|
|
+ this.params.attrs.id = await this.fetchId(this.params.instanceId)
|
|
|
+ this.loadData()
|
|
|
return
|
|
|
}
|
|
|
if(this.params.attrs.id ){
|
|
|
@@ -424,7 +427,7 @@ export default {
|
|
|
this.currentName = await this.fetchTaskId(this.instid)
|
|
|
//根据流程节点判断是否可编辑
|
|
|
if (this.currentName === '编制') {
|
|
|
- this.readonly = false
|
|
|
+ this.internalReadonly = false // 使用内部变量
|
|
|
}
|
|
|
this.loadCompleted = true
|
|
|
console.log('流程id',this.instid )
|
|
|
@@ -433,6 +436,13 @@ export default {
|
|
|
this.loading = false
|
|
|
})
|
|
|
},
|
|
|
+ async fetchId(instid) { //流程获取id
|
|
|
+ const res = await this.$common.request('query', {
|
|
|
+ key: 'xnyzgjlchqbd',
|
|
|
+ params: [instid]
|
|
|
+ });
|
|
|
+ return res.variables.data[0]?.BIZ_KEY_ || '';
|
|
|
+ },
|
|
|
async fetchInstanceId(dataId) { //获取当前单据对应流程
|
|
|
const instres = await this.$common.request('query', {
|
|
|
key: 'xnyzkspjcxdylc',
|
|
|
@@ -932,21 +942,25 @@ export default {
|
|
|
const status = (this.form && this.form.shiFouGuoShen) || '已暂存'
|
|
|
// 已暂存状态显示流程图,导出pdf,关闭,保存,提交,终止按钮
|
|
|
if (status === '已暂存' || status === '已退回') {
|
|
|
+ this.internalReadonly = false
|
|
|
return !['flowChart', 'approvalHistory','pdf', 'cancel', 'save','doEndProcess', 'submit'].includes(key)
|
|
|
}
|
|
|
|
|
|
// 已编制状态显示流程图,导出pdf,关闭,保存,退回,提交,终止按钮
|
|
|
if (status === '已编制') {
|
|
|
+ this.internalReadonly = true
|
|
|
return !['flowChart','approvalHistory', 'pdf', 'cancel', 'save', 'sendBack','doEndProcess', 'submit'].includes(key)
|
|
|
}
|
|
|
|
|
|
// 已审核状态显示流程图,导出pdf,关闭,保存,退回,提交,终止按钮
|
|
|
if (status === '已审核') {
|
|
|
+ this.internalReadonly = true
|
|
|
return !['flowChart','approvalHistory', 'pdf', 'cancel', 'save', 'sendBack','doEndProcess', 'submit'].includes(key)
|
|
|
}
|
|
|
|
|
|
// 已完成,已终止状态和查阅时显示一致
|
|
|
if (status === '已完成' || status === '已终止') {
|
|
|
+ this.internalReadonly = true
|
|
|
return !['flowChart','approvalHistory', 'pdf', 'cancel'].includes(key)
|
|
|
}
|
|
|
|
|
|
@@ -1132,4 +1146,4 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|