123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- <template>
- <!-- 待用活动表单 -->
- <active-form :formData="formData" ref="form" >
- </active-form>
- </template>
- <script>
- import activeForm from '@/components/generate-form/generate-form.vue';
- import formService from "@/api/flowable/formService"
- var graceChecker = require("@/common/graceChecker.js");
- export default {
- components:{
- activeForm
- },
- props: {
- processDefinitionId: {
- type: String,
- required: true
- },
- edit: {
- type: Boolean,
- default: true
- },
- formData:{
- type:Array,
- default:function(){
- return []
- }
- }
- },
- methods: {
- // 提交序列化的表单
- getFormData (option){
- var submitData={};
- for(var i=0;i<option.length;i++){
- submitData[option[i].model]=option[i].value;
- }
- return submitData;
- },
- //
- submitStartFormData (vars, callback) {
- // 表单校验
- let errMsg = graceChecker.checkFormData(this.formData);
- if(errMsg){
- uni.showToast({
- title:errMsg,
- icon:'none'
- })
- return
- }
- let data = this.getFormData(this.formData)
- formService.submitStartFormData(
- {
- id: this.id,
- ...vars,
- data: JSON.stringify(data)
- }
- ).then((data) => {
- uni.showToast({
- title: "启动成功",
- icon: "none"
- });
- callback(data)
- })
- },
- submitTaskFormData (vars, procInsId, taskId, assignee, comment, callback) {
- // 表单校验
- let errMsg = graceChecker.checkFormData(this.formData);
- if(errMsg){
- uni.showToast({
- title:errMsg,
- icon:'none'
- })
- return
- }
- let data = this.getFormData(this.formData);
- data = {...vars, ...data}
- this.loading = true
- formService.submitTaskFormData({
- id: this.id,
- procInsId: procInsId,
- taskId: taskId,
- assignee: assignee,
- comment: comment,
- data: JSON.stringify(data)
- }).then((data) => {
- uni.showToast({
- title: "提交成功"
- })
- callback(data)
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .form-container-box{
- width: 100vw;
- font-size: 28upx;
- min-height: 100vh;
- position: relative;
- padding-bottom: 100upx;
- }
- .bgfff {
- background: #fff;
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- }
-
- .buttonBox {
- width: 100%;
- height: 84upx;
- color: white;
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: #ff5b01;
-
- }
- .submit-data {
- padding: 20upx;
- margin-top: 20upx;
- word-break: break-word;
- }
-
- </style>
|