luohairen
2024-12-17 ba61d95e7367745913a0c85d45416578d8d66e31
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
<template>
  <div class="app-container">
    <el-container>
      <el-header class="header-title">项目名称:{{ planInfoData.projectName }} ({{ planInfoData.planTime}} {{ planInfoData.planTimeFlag === 0 ? '月度计划' : planInfoData.planTimeFlag === 1 ? '季度计划' : '年度计划' }})</el-header>
      <h4 style="text-align: center">项目代码:{{ planInfoData.projectCode }}</h4>
      <el-main>
        <el-card shadow="hover">
          <el-row :gutter="20">
            <el-col :span="24" class="mb-4">
              <!--项目计划项-->
              <el-table :data="tableData" border stripe style="width: 100%; margin-bottom: 20px">
                <el-table-column prop="index" label="序号" width="50" align="center">
                  <template #default="scope">
                    {{ scope.$index + 1 }}
                  </template>
                </el-table-column>
                <el-table-column prop="taskName" label="事项名称" width="500" align="center">
                  <template #default="scope">
                    <el-input type="textarea" v-model="scope.row.title" placeholder="请输入" rows="3" :readonly="scope.row.planStatus !== 1" />
                  </template>
                </el-table-column>
                <el-table-column prop="startTime" label="计划开始时间" width="160" align="center" >
                  <template #default="scope">
                    <el-date-picker
                      v-model="scope.row.startTime"
                      type="date"
                      placeholder="选择日期"
                      value-format="yyyy-MM-dd HH:mm:ss"
                      size="medium"
                      style="width: 130px"
                      :readonly="projectInfoData.managerFlag"/>
                  </template>
                </el-table-column>
                <el-table-column prop="endTime" label="计划完成时间" width="160" align="center" >
                  <template #default="scope">
                    <el-date-picker
                      v-model="scope.row.endTime"
                      type="date"
                      placeholder="选择日期"
                      value-format="yyyy-MM-dd HH:mm:ss"
                      size="medium"
                      style="width: 130px"
                      :readonly="projectInfoData.managerFlag"  />
                  </template>
                </el-table-column>
                <el-table-column :label="planInfoData.planTimeFlag === 0 ? '月度' : planInfoData.planTimeFlag === 1 ? '季度' : '年度' " align="center">
                    {{ planInfoData.planTime }}{{ planInfoData.planTimeFlag === 0 ? '月度' : planInfoData.planTimeFlag === 1 ? '季度' : '年度' }}
                </el-table-column>
                <el-table-column prop="planStatus" label="状态" width="100" align="center">
                  <template #default="scope">
                    {{ scope.row.planStatus === 1 ? '已驳回' : scope.row.planStatus === 2 ? '已通过' : '未审核' }}
                  </template>
                </el-table-column>
                <div v-if="!projectInfoData.managerFlag">
                  <el-table-column fixed="right" label="操作" align="center">
                    <template #default="scope">
                      <!-- 状态为未审核 -->
                      <div v-if="scope.row.planStatus === 0"></div>
                      <!-- 状态为已驳回 -->
                      <div v-if="scope.row.planStatus === 1">
                        <el-button
                          size="medium"
                          type="text"
                          icon="el-icon-upload2"
                          @click="handleResubmit(scope.row)">重新上报</el-button>
                        <el-button
                          size="medium"
                          type="text"
                          icon="el-icon-refresh-left"
                          @click="handleReset(scope.$index)">重置</el-button>
                      </div>
                      <!-- 状态为已通过 -->
                      <div v-if="scope.row.planStatus === 2">
                        <el-button
                          size="medium"
                          type="text"
                          icon="el-icon-edit"
                          @click="handleDelay(scope.$index)">延期</el-button>
                      </div>
                    </template>
                  </el-table-column>
                </div>
              </el-table>
              <div style="display: flex; align-items: center;">
                <h1 style="margin: 0;">
                  计划投资金额(万元):
                </h1>
                <el-input
                  placeholder="请输入投资金额"
                  style="flex: 1"
                  v-model="actualInvest"
                  clearable
                  :type="number"
                  @input="handleInput"
                  readonly>
                </el-input>
              </div>
 
              <!--上级批复-->
              <div style="margin-bottom: 10px; margin-top: 40px;">
                <span style="font-size: 20px; font-weight: bold;">上级批复</span>
              </div>
              <el-table :data="departmentApprovalData" border stripe style="width: 100%; margin-bottom: 20px">
                <el-table-column prop="index" label="序号" width="50" align="center">
                  <template #default="scope">
                    {{ scope.$index + 1 }}
                  </template>
                </el-table-column>
                <el-table-column prop="title" label="事项名称" width="200" align="center" />
                <el-table-column prop="departmentExamine" label="上级审核" width="130" align="center">
                  <template #default="scope">
                    <div v-if="projectInfoData.managerFlag">
                      <el-select
                        v-model="scope.row.departmentExamine"
                        :disabled="scope.row.planStatus === 2 || scope.row.planStatus === 1"
                        placeholder="请选择"
                        size="medium"
                        clearable>
                        <el-option label="同意" :value="0"></el-option>
                        <el-option label="驳回" :value="1"></el-option>
                      </el-select>
                    </div>
                    <div v-if="!projectInfoData.managerFlag">
                      {{ scope.row.departmentExamine === 0 ? '同意' : scope.row.departmentExamine === 1 ? '驳回' : '未审核' }}
                    </div>
                  </template>
                </el-table-column>
                <el-table-column prop="departmentApproval" label="批复内容" width="160" align="center">
                  <template v-if="projectInfoData.managerFlag" #default="scope">
                    <el-input
                      type="textarea"
                      v-model="scope.row.departmentApproval"
                      :readonly="scope.row.planStatus === 2 || scope.row.planStatus === 1"
                      placeholder="请输入"
                      rows="3" />
                  </template>
                </el-table-column>
                <el-table-column prop="departmentApprovalReply" label="批复回复" width="160" align="center">
                  <template #default="scope" v-if="!projectInfoData.managerFlag">
                    <el-input
                      type="textarea"
                      v-model="scope.row.departmentApprovalReply"
                      :readonly="scope.row.planStatus === 0"
                      placeholder="请输入"
                      rows="3" />
                  </template>
                </el-table-column>
                <el-table-column prop="manageExamine" label="主管部门审核" width="130" align="center" >
                  <template #default="scope">
                    <div v-if="!projectInfoData.managerFlag">
                      {{ scope.row.manageExamine === 0 ? '同意' : scope.row.manageExamine === 1 ? '驳回' : '未审核' }}
                    </div>
                    <div v-if="projectInfoData.managerFlag">
                      <el-select
                        v-model="scope.row.manageExamine"
                        :disabled="scope.row.planStatus === 2 || scope.row.planStatus === 1"
                        placeholder="请选择"
                        size="medium"
                        clearable>
                        <el-option label="同意" :value="0"></el-option>
                        <el-option label="驳回" :value="1"></el-option>
                      </el-select>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column prop="manageApproval" label="批复内容" width="160" align="center">
                  <template v-if="projectInfoData.managerFlag" #default="scope">
                    <el-input
                      type="textarea"
                      v-model="scope.row.manageApproval"
                      :readonly="scope.row.planStatus === 2 || scope.row.planStatus === 1"
                      placeholder="请输入"
                      rows="3" />
                  </template>
                </el-table-column>
                <el-table-column prop="manageApprovalReply" label="批复回复" width="160" align="center">
                  <template #default="scope" v-if="!projectInfoData.managerFlag">
                    <el-input
                      type="textarea"
                      v-model="scope.row.manageApprovalReply"
                      :readonly="scope.row.planStatus === 0"
                      placeholder="请输入"
                      rows="3" />
                  </template>
                </el-table-column>
                <el-table-column prop="planStatus" label="状态" width="200" align="center" >
                  <template #default="scope">
                    {{ scope.row.planStatus === 1 ? '已驳回' : scope.row.planStatus === 2 ? '已通过' : '未审核' }}
                  </template>
                </el-table-column>
                <el-table-column fixed="right" label="操作" align="center" width="200">
                  <template #default="scope">
                    <div v-if="!projectInfoData.managerFlag">
                      <el-button
                        size="medium"
                        type="text"
                        icon="el-icon-reply"
                        @click="handleReply(scope.$index)"
                        :disabled="scope.row.planStatus === 0">回复</el-button>
                      <el-button
                        size="medium"
                        type="text"
                        icon="el-icon-refresh-left"
                        @click="handleReset(scope.$index)"
                        :disabled="scope.row.planStatus === 0">重置</el-button>
                    </div>
                    <div v-if="projectInfoData.managerFlag">
                      <el-button
                        size="medium"
                        type="text"
                        @click="handleExamine(scope.$index)"
                        v-if="scope.row.planStatus === 0">审核</el-button>
                    </div>
                  </template>
                </el-table-column>
              </el-table>
 
 
              <!--计划日志-->
              <div style="margin-bottom: 10px; margin-top: 40px;">
                <span style="font-size: 20px; font-weight: bold;">计划日志</span>
              </div>
              <el-table :data="planLogData" border stripe style="width: 100%; margin-bottom: 20px">
                <el-table-column prop="index" label="序号" width="50" align="center">
                  <template #default="scope">
                    {{ scope.$index + 1 }}
                  </template>
                </el-table-column>
                <el-table-column prop="title" label="事项名称" width="200" align="center" />
                <el-table-column prop="departmentExamine" label="上级审核" width="100" align="center" >
                  <template #default="scope">
                    {{ scope.row.departmentExamine === 0 ? '同意' : scope.row.departmentExamine === 1 ? '驳回' : '未审核' }}
                  </template>
                </el-table-column>
                <el-table-column prop="departmentApproval" label="批复内容" width="160" align="center" />
                <el-table-column prop="departmentApprovalReply" label="批复回复" width="160" align="center" />
                <el-table-column prop="manageExamine" label="主管部门审核" width="100" align="center" >
                  <template #default="scope">
                    {{ scope.row.manageExamine === 0 ? '同意' : scope.row.manageExamine === 1 ? '驳回' : '未审核' }}
                  </template>
                </el-table-column>
                <el-table-column prop="manageApproval" label="批复内容" width="160" align="center" />
                <el-table-column prop="manageApprovalReply" label="批复回复" width="160" align="center" />
                <el-table-column prop="gmtCreate" label="时间" align="center" />
              </el-table>
            </el-col>
          </el-row>
        </el-card>
      </el-main>
    </el-container>
  </div>
</template>
 
<script>
import { getPlanInfoData, delayPlanInfo, getDepartmentApproval, getPlanLog, replyExamine, saveExamine, resubmitPlanInfo } from "@/api/projectPlan/index";
 
export default {
  name: "planInfoCheck",
  data() {
    return {
      loading: true,
      // 接收传递过来的项目计划数据
      planInfoData: {},
      projectInfoData: {},
      // 计划项数据
      tableData: [
        {
          title: '',
          startTime: '',
          endTime: ''
        },
      ],
      // 上级批复数据
      departmentApprovalData: [],
      // 计划日志数据
      planLogData: [],
      // 投资金额
      actualInvest: '',
      // 新增参数
      addData: {
        projectPlanRecordId: '',
        actualInvest: '',
        addList: []
      }
    }
  },
 
  methods: {
    // 页面加载
    search() {
      this.getPlanInfoData(this.planInfoData.id); // 获取项目计划项
      this.getDepartmentApproval(this.planInfoData.id); // 获取上级批复
      this.getPlanLog(this.planInfoData.id); // 获取计划日志
    },
    // 获取传递过来的项目计划详情
    getPlanRecordData() {
      // 从查询参数中获取数据
      this.projectInfoData = JSON.parse(this.$route.query.projectInfoData)
      this.planInfoData = JSON.parse(this.$route.query.data)
      this.search();
    },
    // 获取项目计划项
    getPlanInfoData(id) {
      getPlanInfoData(id).then(response => {
        this.actualInvest = response.data.actualInvest;
        if (response.data.list.length === 0) {
          this.tableData = [{title: '', startTime: '', endTime: ''}];
        } else {
          this.tableData = response.data.list;
        }
      });
    },
    // 用户重新上报计划项
    handleResubmit(data) {
      resubmitPlanInfo(data).then(response => {
        this.$message.success('重新上报成功');
        this.search()
      });
    },
    // 延期
    handleDelay(index) {
      delayPlanInfo(this.tableData[index]).then(response => {
        this.$message.success('延期成功');
        this.search()
      });
    },
    // 获取上级批复
    getDepartmentApproval(projectPlanRecordId) {
      getDepartmentApproval(projectPlanRecordId).then(response => {
        this.departmentApprovalData = response.data;
      });
    },
    // 回复审批
    handleReply(index) {
      replyExamine(this.departmentApprovalData[index]).then(response => {
        this.$message.success('回复成功');
        this.search()
      });
    },
    // 保存审批
    handleExamine(index) {
      saveExamine(this.departmentApprovalData[index]).then(response => {
        this.$message.success('审批成功');
        this.search()
      });
    },
    // 获取计划日志
    getPlanLog(projectPlanRecordId) {
      getPlanLog(projectPlanRecordId).then(response => {
        this.planLogData = response.data;
      });
    },
    // 重置当前行数据
    handleReset(index) {
      this.tableData[index].title = '';
      this.tableData[index].startTime = '';
      this.tableData[index].endTime = '';
    },
  },
  created() {
    this.getPlanRecordData();
  },
};
</script>
 
<style scoped>
.header-title {
  font-size: 24px; /* 根据需要调整字体大小 */
  text-align: center; /* 居中对齐 */
  line-height: 64px; /* 如果需要与 header 高度对齐 */
}
</style>