大件运输联网系统前端代码
guoshilong
2022-12-19 6fd27418225f2d36fc206acdfe6c24fb33ae7590
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<template>
  <div>
    <basic-container>
      <avue-form :option="option" v-model="form" @submit="handleSubmit"/>
    </basic-container>
    <basic-container>
      <flow-design :is-display="true" :process-definition-id="processDefinitionId"></flow-design>
    </basic-container>
  </div>
</template>
 
<script>
import {applicationProcess} from "@/api/application/application"
import option from "@/const/application/application"
import {mapGetters} from "vuex";
export default {
  name: "form",
  data() {
    return {
      processDefinitionId: '',
      form: {},
      option:option
    }
  },
  computed: {
    ...mapGetters(["permission", 'userInfo']),
  },
  created() {
    this.controlOption('open')
    this.processDefinitionId = this.$route.params.processDefinitionId;
  },
  beforeDestroy() {
    this.controlOption('close')
  },
  methods: {
    handleSubmit() {
      const params = {
        processDefinitionId: this.$route.params.processDefinitionId,
        userId: this.userInfo.user_id,
        ...this.form,
      };
      applicationProcess(params).then(resp => {
        const data = resp.data;
        if (data.success) {
          this.$message.success(data.msg);
          this.$router.$avueRouter.closeTag();
          this.$router.push({path: `/work/start`});
        } else {
          this.$message.error(data.msg || '提交失败');
        }
      });
    },
    controlOption(arg) {
      // const suggestion = this.findObject(this.option.column,"suggestion")
      // const comment = this.findObject(this.option.column,"comment")
      if (arg == 'open'){
        //解除禁用状态
        this.option.group.forEach(group=>{
          group.column.forEach(item=>{
            item.disabled = false
          })
        })
        //
        // //隐藏完善意见
        // suggestion.display = false
        // //隐藏批复意见
        // comment.display = false
 
      }else if (arg == 'close'){
        // suggestion.display = true
        // comment.display = true
      }
    }
  }
}
</script>
 
<style scoped>
 
</style>