|
@@ -0,0 +1,171 @@
|
|
1
|
+<!--
|
|
2
|
+ * @Author: ysh
|
|
3
|
+ * @Date: 2024-04-08 13:56:14
|
|
4
|
+ * @LastEditors: Please set LastEditors
|
|
5
|
+ * @LastEditTime: 2024-04-12 14:17:37
|
|
6
|
+-->
|
|
7
|
+<template>
|
|
8
|
+ <div class="app-container">
|
|
9
|
+ <h2 style="text-align:center;">生产确认</h2>
|
|
10
|
+ <el-form :model="form" :rules="rules" label-width="100px" :disabled="disabled">
|
|
11
|
+ <el-form-item label="确认信息:" prop="scComment">
|
|
12
|
+ <el-input type="textarea" :rows="4" placeholder="请输入确认信息" v-model="form.scComment">
|
|
13
|
+ </el-input>
|
|
14
|
+ </el-form-item>
|
|
15
|
+ <el-form-item label="签名:">
|
|
16
|
+ <span class="auditor">{{ form.scApproverName }}</span>
|
|
17
|
+ <el-button @click.once="sign" type="primary" size="mini" v-if="taskName == '生产确认'">签名</el-button>
|
|
18
|
+ </el-form-item>
|
|
19
|
+ <el-form-item label="审核时间:">
|
|
20
|
+ {{ form.scApprovalTime }}
|
|
21
|
+ </el-form-item>
|
|
22
|
+ <el-form-item>
|
|
23
|
+ <p style="text-align:center;"><el-button type="primary" @click="confirm">确认审核</el-button></p>
|
|
24
|
+ </el-form-item>
|
|
25
|
+ </el-form>
|
|
26
|
+ </div>
|
|
27
|
+</template>
|
|
28
|
+
|
|
29
|
+<script>
|
|
30
|
+import { mapGetters } from 'vuex';
|
|
31
|
+import { parseTime } from "@/utils/ruoyi";
|
|
32
|
+import { complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm } from "@/api/flowable/todo";
|
|
33
|
+import { getProjectComment, addProjectComment, updateProjectComment } from "@/api/oa/project/projectComment"
|
|
34
|
+import { getUsersDeptLeaderByDept } from '@/api/system/post'
|
|
35
|
+export default {
|
|
36
|
+ computed: {
|
|
37
|
+ ...mapGetters(['name', 'userId']),
|
|
38
|
+ },
|
|
39
|
+ props: {
|
|
40
|
+ disabled: {
|
|
41
|
+ type: Boolean,
|
|
42
|
+ require: true,
|
|
43
|
+ },
|
|
44
|
+ taskForm: {
|
|
45
|
+ type: Object,
|
|
46
|
+ required: true,
|
|
47
|
+ },
|
|
48
|
+ taskName: {
|
|
49
|
+ type: String,
|
|
50
|
+ required: true,
|
|
51
|
+ },
|
|
52
|
+ },
|
|
53
|
+ data() {
|
|
54
|
+ return {
|
|
55
|
+ form: {
|
|
56
|
+ scApprover: '',
|
|
57
|
+ scApproverName: '',
|
|
58
|
+ scApprovalTime: ''
|
|
59
|
+ },
|
|
60
|
+ rules: {
|
|
61
|
+ scComment: [{ required: true, message: "请输入审核意见", trigger: "blur" }]
|
|
62
|
+ },
|
|
63
|
+ deptLeaderList: []
|
|
64
|
+ }
|
|
65
|
+ },
|
|
66
|
+ created() {
|
|
67
|
+ if (this.$route.query.taskName != '项目登记' && this.$route.query.taskName != '项目安排') {
|
|
68
|
+ this.initForm();
|
|
69
|
+ }
|
|
70
|
+ },
|
|
71
|
+ watch: {
|
|
72
|
+ underDeptId(newVal, oldVal) {
|
|
73
|
+ this.getDeptLeader(newVal)
|
|
74
|
+ }
|
|
75
|
+ },
|
|
76
|
+ computed: {
|
|
77
|
+ underDeptId() {
|
|
78
|
+ return this.$store.state.projectProcess.underDeptId;
|
|
79
|
+ }
|
|
80
|
+ },
|
|
81
|
+ methods: {
|
|
82
|
+ initForm() {
|
|
83
|
+ getProjectComment(this.taskForm.formId).then(res => {
|
|
84
|
+ if (res.data) {
|
|
85
|
+ this.form = res.data
|
|
86
|
+ // if (res.data.scApproverName) {
|
|
87
|
+ // this.form.scApproverName = res.data.scApproverName
|
|
88
|
+ // }
|
|
89
|
+ } else {
|
|
90
|
+ this.form.scApprover = '';
|
|
91
|
+ this.form.scApproverName = '';
|
|
92
|
+ this.form.scApprovalTime = '';
|
|
93
|
+ }
|
|
94
|
+ // if (res.data) {
|
|
95
|
+ // this.form = res.data
|
|
96
|
+ // debugger
|
|
97
|
+ // if (this.taskName == '生产确认') {
|
|
98
|
+ // if (res.data.scApproverName) {
|
|
99
|
+ // this.form.scApproverName = res.data.scApproverName
|
|
100
|
+ // this.form.scApprover = this.$store.state.user.id;
|
|
101
|
+ // } else {
|
|
102
|
+ // this.form.scApprover = this.$store.state.user.id;
|
|
103
|
+ // this.form.scApproverName = this.$store.state.user.name;
|
|
104
|
+ // this.form.scApprovalTime = parseTime(new Date(), '{y}-{m}-{d}')
|
|
105
|
+ // }
|
|
106
|
+ // } else {
|
|
107
|
+ // if (res.data.scApproverName)
|
|
108
|
+ // this.form.scApproverName = res.data.scApproverName
|
|
109
|
+ // }
|
|
110
|
+ // } else {
|
|
111
|
+ // if (this.taskName == '生产确认') {
|
|
112
|
+ // this.form.scApprover = this.$store.state.user.id;
|
|
113
|
+ // this.form.scApproverName = this.$store.state.user.name;
|
|
114
|
+ // this.form.scApprovalTime = parseTime(new Date(), '{y}-{m}-{d}')
|
|
115
|
+ // } else {
|
|
116
|
+ // this.form.scApprover = '';
|
|
117
|
+ // this.form.scApprovalTime = '';
|
|
118
|
+ // }
|
|
119
|
+ // }
|
|
120
|
+ })
|
|
121
|
+ },
|
|
122
|
+ getDeptLeader(val) {
|
|
123
|
+ this.deptLeaderList = [];
|
|
124
|
+ for (let v of val) {
|
|
125
|
+ getUsersDeptLeaderByDept({ deptId: Number(v) }).then(res => {
|
|
126
|
+ this.deptLeaderList.push(res.data.userId);
|
|
127
|
+ this.$store.commit('SET_UNDERLEADERID', this.deptLeaderList)
|
|
128
|
+ })
|
|
129
|
+ }
|
|
130
|
+ },
|
|
131
|
+ sign() {
|
|
132
|
+ debugger
|
|
133
|
+ this.form.scApprover = this.$store.state.user.id;
|
|
134
|
+ if (this.form.scApproverName != null && this.form.scApproverName != undefined && this.form.scApproverName != '') {
|
|
135
|
+ let sign = this.form.scApproverName + ',' + this.$store.state.user.name;
|
|
136
|
+ this.form.scApproverName = sign
|
|
137
|
+ } else {
|
|
138
|
+ this.form.scApproverName = this.$store.state.user.name;
|
|
139
|
+ }
|
|
140
|
+
|
|
141
|
+ },
|
|
142
|
+ confirm() {
|
|
143
|
+ this.form.projectId = this.taskForm.formId
|
|
144
|
+ console.log(this.form);
|
|
145
|
+ updateProjectComment(this.form)
|
|
146
|
+ const params = { taskId: this.taskForm.taskId };
|
|
147
|
+ // 获取下一个流程节点
|
|
148
|
+ getNextFlowNode(params).then(res => {
|
|
149
|
+ this.$set(this.taskForm.variables, "approval", this.deptLeaderList);
|
|
150
|
+ complete(this.taskForm).then(response => {
|
|
151
|
+ this.$modal.msgSuccess(response.msg);
|
|
152
|
+ this.$emit("goBack");
|
|
153
|
+ });
|
|
154
|
+ });
|
|
155
|
+ },
|
|
156
|
+
|
|
157
|
+ },
|
|
158
|
+}
|
|
159
|
+</script>
|
|
160
|
+
|
|
161
|
+<style lang="scss" scoped>
|
|
162
|
+.auditor {
|
|
163
|
+ font-family: '华文行楷';
|
|
164
|
+ font-size: 20px;
|
|
165
|
+ margin-right: 20px;
|
|
166
|
+}
|
|
167
|
+
|
|
168
|
+::v-deep .el-textarea.is-disabled .el-textarea__inner {
|
|
169
|
+ color: #121212 !important;
|
|
170
|
+}
|
|
171
|
+</style>
|