Parcourir la source

移动端添加用车审批表单

余思翰 il y a 2 jours
Parent
révision
3b8618c7d3
1 fichiers modifiés avec 131 ajouts et 0 suppressions
  1. 131
    0
      oa-ui-app/pages/form/car/car.vue

+ 131
- 0
oa-ui-app/pages/form/car/car.vue Voir le fichier

@@ -0,0 +1,131 @@
1
+<template>
2
+  <view class="form-container">
3
+    <!-- 表单标题 -->
4
+    <view class="form-title">
5
+      <text class="title-text">用车申请表</text>
6
+      <view class="title-line"></view>
7
+    </view>
8
+    <uni-forms ref="form" :modelValue="form" :rules="rules" label-position="top" label-width="150" class="custom-form">
9
+      <flow-note :taskForm="taskForm"></flow-note>
10
+      <!-- 当前节点 -->
11
+      <uni-forms-item label="当前节点" class="form-item" v-if="taskName">
12
+        <uni-tag :inverted="true" type="primary" :text="taskName"></uni-tag>
13
+      </uni-forms-item>
14
+
15
+      <!-- 流程发起人 -->
16
+      <uni-forms-item label="填报人" class="form-item">
17
+        <b style="font-size:30rpx;">{{ applierUserName }}</b>
18
+      </uni-forms-item>
19
+
20
+      <!-- 填报日期 -->
21
+      <uni-forms-item label="填报日期" class="form-item">
22
+        <text>{{ form.applyDate }}</text>
23
+      </uni-forms-item>
24
+
25
+      <!-- 借款类型 -->
26
+      <uni-forms-item label="申请用途" required class="form-item" name="carUsage">
27
+        <uni-data-checkbox v-model="form.carUsage" :localdata="carUsageOptions" :disabled="taskName != '用车申请'"
28
+          @change="hanldeChangeType"></uni-data-checkbox>
29
+      </uni-forms-item>
30
+
31
+      <!-- 选择项目 -->
32
+      <uni-forms-item label="选择项目" required class="form-item" v-if="form.carUsage == 0" name="projectId">
33
+        <u-button type="primary" @click="openProject = true" v-if="taskName == '用车申请'">+ 选择项目</u-button>
34
+        <ProjectPicker :visible.sync="openProject" :selected.sync="selectedProject" @confirm="handleConfirm" />
35
+        <ProjectInfo :project="projectObj"></ProjectInfo>
36
+      </uni-forms-item>
37
+    </uni-forms>
38
+  </view>
39
+</template>
40
+
41
+<script>
42
+import { parseTime } from "@/utils/common.js"
43
+import { complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm, } from "@/api/flowable/todo";
44
+import { listCar, getCar } from "@/api/oa/car/car";
45
+import { listCarApproval, getCarApproval, updateCarApproval, addCarApproval, modifyCarApproval } from '@/api/oa/car/carApproval'
46
+import { listProject, getProject } from "@/api/oa/project/project";
47
+import { getUserByRole } from "@/api/system/role";
48
+import { getUsersManageLeader } from '@/api/system/post.js'
49
+import FlowNote from '@/pages/components/flowNote.vue';
50
+import ProjectPicker from '@/pages/components/ProjectPicker.vue';
51
+import ProjectInfo from '@/pages/components/ProjectInfo.vue';
52
+import Auditor from "@/pages/components/auditor.vue";
53
+export default {
54
+  components: {
55
+    FlowNote,
56
+    ProjectPicker,
57
+    ProjectInfo,
58
+    Auditor
59
+  },
60
+  props: {
61
+    taskForm: Object,
62
+    taskName: String,
63
+    startUserName: String,
64
+  },
65
+  data() {
66
+    return {
67
+      form: {
68
+        applyDate: '',
69
+        projectId: '',
70
+        carUsage:'0',
71
+      },
72
+      rules: {},
73
+      openProject: false,
74
+      projectObj: {},
75
+      selectedProject: {},
76
+      carUsageOptions: [{
77
+        text: '项目用车',
78
+        value: '0',
79
+        disable: false
80
+      }, {
81
+        text: '非项目用车',
82
+        value: '1',
83
+        disable: false
84
+      }, {
85
+        text: '工会用车',
86
+        value: '2',
87
+        disable: false
88
+      }, {
89
+        text: '党委用车',
90
+        value: '3',
91
+        disable: false
92
+      }, {
93
+        text: '团委用车',
94
+        value: '4',
95
+        disable: false
96
+      }],
97
+      dept: 0,
98
+    }
99
+  },
100
+  created() {
101
+    this.applierUserName = this.startUserName;
102
+    this.initForm();
103
+  },
104
+  methods: {
105
+    initForm() {
106
+      getCarApproval(this.taskForm.formId).then(res => {
107
+        if (res.data) {
108
+
109
+        } else {
110
+          this.form.applyDate = parseTime(new Date(), "{y}-{m}-{d}");
111
+        }
112
+      })
113
+    },
114
+    handleConfirm(project) {
115
+      this.selectedProject = project;
116
+      this.projectObj = project;
117
+      this.form.projectId = project.projectId;
118
+    },
119
+    hanldeChangeType(val) {
120
+      if (val == '2' || val == '3' || val == '4') {
121
+        this.dept = 0;
122
+      }
123
+      else
124
+        this.dept = this.$store.getters.deptId;
125
+    }
126
+  },
127
+}
128
+
129
+</script>
130
+
131
+<style lang="scss" scoped></style>

Loading…
Annuler
Enregistrer