51 lines
1.2 KiB
Plaintext
51 lines
1.2 KiB
Plaintext
@*本模板只适用于纯表单带流程*@
|
|
<template>
|
|
<div class="JNPF-common-layout">
|
|
<FlowBox ref="FlowBox" @@close="closeFlow" />
|
|
</div>
|
|
</template>
|
|
<script>
|
|
import FlowBox from '@@/views/workFlow/components/FlowBox'
|
|
import { getFormById } from '@@/api/workFlow/FormDesign'
|
|
export default {
|
|
components: { FlowBox },
|
|
data() {
|
|
return {
|
|
formFlowId: ""
|
|
}
|
|
},
|
|
created() {
|
|
this.getFormById();
|
|
},
|
|
methods: {
|
|
getFormById() {
|
|
getFormById("@(Model.FormId)").then(res => {
|
|
const flowId = res.data && res.data.id
|
|
this.formFlowId = flowId;
|
|
this.init(flowId)
|
|
})
|
|
},
|
|
init(flowId) {
|
|
// 纯流程带流程
|
|
let data = {
|
|
id: '',//写死
|
|
enCode: '',
|
|
flowId: flowId,
|
|
formType: 1, //写死
|
|
type: 1, //写死
|
|
opType: '-1', //写死
|
|
modelId: '@(Model.FormId)', //模板ID
|
|
fromForm: 1, //写死
|
|
hideCancelBtn: true //写死
|
|
}
|
|
if (!data.flowId) return this.$message.error("该功能未配置流程不可用!")
|
|
this.$nextTick(() => {
|
|
this.$refs.FlowBox.init(data)
|
|
})
|
|
},
|
|
closeFlow(isRefresh) {
|
|
if (isRefresh) this.init(this.formFlowId)
|
|
},
|
|
}
|
|
}
|
|
</script> |