田源
2024-06-18 d0b2563e29ab723b68c70855375a37c76471eb26
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<template>
  <el-dialog v-dialogDrag
             append-to-body="true"
             :close-on-click-modal="false"
             :destroy-on-close="true"
             :visible.sync="visible"
             :width="width"
             class="avue-dialog"
             title="启动流程"
             top="0"
             style="margin-top: -10% !important;"
             @close="dialogClose">
 
    <el-form :model="saveParam" :rules="rules" class="demo-form-inline" label-position="left" label-width="auto">
      <el-form-item label="流程模板">
        <el-input v-model="saveParam.modelName" disabled placeholder="流程模板"></el-input>
      </el-form-item>
      <el-form-item label="流程名称" prop="processName">
        <el-input v-model="saveParam.processName" placeholder="流程名称">
        </el-input>
      </el-form-item>
      <el-form-item label="流程描述">
        <el-input v-model="saveParam.processDesc" :rows="4" placeholder="流程描述" type="textarea">
        </el-input>
      </el-form-item>
    </el-form>
 
    <el-divider></el-divider>
    <div class="btns-icon">
      <el-button circle icon="el-icon-star-off" @click="handleCollect"></el-button>
    </div>
    <el-form :model="collectParam" class="demo-form-inline" label-position="left" label-width="auto">
      <el-form-item v-for="(item, index) in initFrom" :key="index" :label="item.taskName">
        <el-select v-model="collectParam.flowTaskUsers[index]['userId']" :placeholder="item.taskName" filterable
                   style="width: 100%;" @change="handleSelect($event, index)">
          <el-option v-for="(key, keyi) in typeName" :key="keyi" :label="key.userNames"
                     :value="key.userId"></el-option>
        </el-select>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="handleCancel">取 消</el-button>
      <el-button type="primary" @click="handleConfirm">确 定</el-button>
    </div>
 
  </el-dialog>
</template>
 
<script>
import {validatenull} from "@/util/validate";
 
export default {
  name: "startWorkFlow",
  props: {
    paramVOS: {
      type: Object,
      default: {}
    },
    sourceData: {
      //所属区域的上一区域选中数据
      type: Object,
      default: {}
    },
    dataStore: {
      //弹窗时按钮所属区域选中数据
      type: Array,
      default: []
    },
  },
  data() {
    return {
      visible: false,
      saveParam: {},
      users: [],
      collectParam: {},
      initFrom: [],
      typeName: [],
    }
  },
  watch: {
    users: {
      handler(val) {
        this.collectParam.flowTaskUsers = val
      },
      deep: true,
      immediate: true
    },
    parameter: {
      handler(newval, oldval) {
        this.saveParam = Object.assign({processName: '', processDesc: ''}, newval);
      },
      deep: true,
      immediate: true
    }
  },
  computed: {
    fullscreen() {
      if (this.paramVOS.width || this.paramVOS.height) {
        return false;
      } else if (this.paramVOS.form) {
        return false;
      }
      return true;
    },
    width() {
      if (!validatenull(this.paramVOS.width)) {
        if (this.paramVOS.width.includes("px") || this.paramVOS.width.includes("%")) {
          return this.paramVOS.width;
        } else {
          return this.paramVOS.width + "px";
        }
      } else {
        return "40%";
      }
    },
  },
  methods: {
    // 关闭弹窗
    dialogClose() {
      this.visible = false;
    },
 
    handleSelect() {
 
    },
 
    handleCollect() {
 
    },
 
    handleCancel() {
      this.dialogClose();
    },
 
    handleConfirm() {
 
    }
  }
}
</script>
 
<style scoped lang="scss">
 
</style>