Sfoglia il codice sorgente

网页端:修改绩效审批

余思翰 1 giorno fa
parent
commit
e8471d0448

+ 15
- 10
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcPerformanceStaffMapper.xml Vedi File

@@ -62,41 +62,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
62 62
     </select>
63 63
 
64 64
     <select id="selectMonthPerformanceList" parameterType="String" resultMap="CmcPerformanceStaffResult">
65
-        select avg(t1.produce_performance) * 1.6 as manage_performance, t2.produce_performance, t2.user_id, t2.performance_month
65
+        select avg(t1.produce_performance) * 1.6 as manage_performance, t2.produce_performance, t2.user_id, t2.nick_name, t2.dept_name, t2.performance_month
66 66
         from
67
-        (select sum(ps.produce_performance) as produce_performance, u.nick_name, p.post_name, ps.user_id, ps.performance_month from cmc_performance_staff as ps
67
+        (select sum(ps.produce_performance) as produce_performance, u.nick_name, d.dept_name, p.post_name, ps.user_id, ps.performance_month from cmc_performance_staff as ps
68 68
         left join sys_user as u on u.user_id = ps.user_id
69
+        left join sys_dept as d on d.dept_id = u.dept_id
69 70
         left join sys_user_post as up on u.user_id = up.user_id
70 71
         left join sys_post as p on p.post_id = up.post_id
71 72
         where p.post_name != '主任' and p.post_name != '副主任' and ps.performance_id = #{param1} and u.dept_id = #{param2}
72 73
         group by user_id) as t1,
73
-        (select sum(ps.produce_performance) as produce_performance, u.nick_name, p.post_name, ps.user_id, ps.performance_month from cmc_performance_staff as ps
74
+        (select sum(ps.produce_performance) as produce_performance, u.nick_name, d.dept_name, p.post_name, ps.user_id, ps.performance_month from cmc_performance_staff as ps
74 75
         left join sys_user as u on u.user_id = ps.user_id
76
+        left join sys_dept as d on d.dept_id = u.dept_id
75 77
         left join sys_user_post as up on u.user_id = up.user_id
76 78
         left join sys_post as p on p.post_id = up.post_id
77
-        where p.post_name = '主任' and ps.performance_id = '1' and u.dept_id = 111
79
+        where p.post_name = '主任' and ps.performance_id = #{param1} and u.dept_id = #{param2}
78 80
         group by user_id) as t2
79 81
         union all
80
-        select avg(t1.produce_performance) * 1.2 as manage_performance, t2.produce_performance, t2.user_id, t2.performance_month
82
+        select avg(t1.produce_performance) * 1.2 as manage_performance, t2.produce_performance, t2.user_id, t2.nick_name, t2.dept_name, t2.performance_month
81 83
         from
82
-        (select sum(ps.produce_performance) as produce_performance, u.nick_name, p.post_name, ps.user_id, ps.performance_month from cmc_performance_staff as ps
84
+        (select sum(ps.produce_performance) as produce_performance, u.nick_name, d.dept_name, p.post_name, ps.user_id, ps.performance_month from cmc_performance_staff as ps
83 85
         left join sys_user as u on u.user_id = ps.user_id
86
+        left join sys_dept as d on d.dept_id = u.dept_id
84 87
         left join sys_user_post as up on u.user_id = up.user_id
85 88
         left join sys_post as p on p.post_id = up.post_id
86 89
         where p.post_name != '主任' and p.post_name != '副主任' and ps.performance_id = #{param1} and u.dept_id = #{param2}
87 90
         group by user_id) as t1,
88
-        (select sum(ps.produce_performance) as produce_performance, u.nick_name, p.post_name, ps.user_id, ps.performance_month from cmc_performance_staff as ps
91
+        (select sum(ps.produce_performance) as produce_performance, u.nick_name, d.dept_name, p.post_name, ps.user_id, ps.performance_month from cmc_performance_staff as ps
89 92
         left join sys_user as u on u.user_id = ps.user_id
93
+        left join sys_dept as d on d.dept_id = u.dept_id
90 94
         left join sys_user_post as up on u.user_id = up.user_id
91 95
         left join sys_post as p on p.post_id = up.post_id
92
-        where p.post_name = '副主任' and ps.performance_id = '1' and u.dept_id = 111
96
+        where p.post_name = '副主任' and ps.performance_id = #{param1} and u.dept_id = #{param2}
93 97
         group by user_id) as t2
94 98
         union all
95
-        select ps.produce_performance * 0 as manage_performance, sum(ps.produce_performance) as produce_performance, ps.user_id, ps.performance_month from cmc_performance_staff as ps
99
+        select ps.produce_performance * 0 as manage_performance, sum(ps.produce_performance) as produce_performance, ps.user_id, u.nick_name, d.dept_name, ps.performance_month from cmc_performance_staff as ps
96 100
         left join sys_user as u on u.user_id = ps.user_id
101
+        left join sys_dept as d on d.dept_id = u.dept_id
97 102
         left join sys_user_post as up on u.user_id = up.user_id
98 103
         left join sys_post as p on p.post_id = up.post_id
99
-        where p.post_name != '主任' and p.post_name != '副主任' and ps.performance_id = #{param1} and u.dept_id = #{param2}
104
+        where p.post_name != '主任' and p.post_name != '副主任' and ps.performance_id = #{param1}
100 105
         group by user_id
101 106
     </select>
102 107
 

+ 2
- 2
oa-ui/src/api/oa/performance/performance.js Vedi File

@@ -1,8 +1,8 @@
1 1
 /*
2 2
  * @Author: wrh
3 3
  * @Date: 2024-09-23 14:23:36
4
- * @LastEditors: wrh
5
- * @LastEditTime: 2024-09-23 14:31:00
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2025-06-06 09:28:06
6 6
  */
7 7
 import request from '@/utils/request'
8 8
 

+ 5
- 5
oa-ui/src/api/oa/performance/performanceStaff.js Vedi File

@@ -1,8 +1,8 @@
1 1
 /*
2 2
  * @Author: wrh
3 3
  * @Date: 2025-06-05 11:11:47
4
- * @LastEditors: wrh
5
- * @LastEditTime: 2025-06-05 17:14:54
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2025-06-06 09:35:20
6 6
  */
7 7
 import request from '@/utils/request'
8 8
 
@@ -49,10 +49,10 @@ export function delPerformanceStaff(performanceStaffId) {
49 49
   })
50 50
 }
51 51
 
52
-// 删除cmc员工绩效
53
-export function getMonthPerformanceList() {
52
+// 查询部门绩效列表
53
+export function getMonthPerformanceList(query) {
54 54
   return request({
55
-    url: '/oa/monthPerformance',
55
+    url: '/oa/performanceStaff/monthPerformance',
56 56
     method: 'get',
57 57
     params: query
58 58
   })

+ 363
- 179
oa-ui/src/views/flowable/form/performance/performanceForm.vue Vedi File

@@ -1,109 +1,217 @@
1 1
 <template>
2 2
   <div class="app-container">
3 3
     <el-row :gutter="20">
4
-      <el-col :span="isFlow ? 18 : 24" :xs="24">
5
-        <div class="mb20" v-if="showAlter">
6
-          <el-alert title="任务被退回,请修改后重新提交" type="error" :closable="false">
7
-            <return-comment :taskForm="taskForm" @isReturn="isReturn"></return-comment>
8
-          </el-alert>
4
+      <h2 style="text-align: center;">绩效审批表</h2>
5
+      <el-form ref="form" :model="form" :rules="rules" :disabled="taskName == ''">
6
+        <el-row :gutter="20">
7
+          <el-col :span="7" :xs="24">
8
+            <el-form-item label="上报人:" prop="reporter" label-width="100px">
9
+              {{ getUserName(form.reporter) }}
10
+            </el-form-item>
11
+          </el-col>
12
+          <el-col :span="7" :xs="24">
13
+            <el-form-item label="上报部门:" prop="reportDept" label-width="100px">
14
+              {{ getDeptName(form.reportDept) }}
15
+            </el-form-item>
16
+          </el-col>
17
+          <el-col :span="7" :xs="24">
18
+            <el-form-item label="上报时间:" prop="reportTime" label-width="100px">
19
+              {{ form.reportTime }}
20
+            </el-form-item>
21
+          </el-col>
22
+        </el-row>
23
+        <div>
24
+          <el-button type="primary" size="small" icon="el-icon-upload" @click="upload.open = true">上传绩效表</el-button>
25
+          <div
26
+            style="background-color: #f0f9eb; border: 1px solid #c2e7b0; padding: 10px; border-radius: 5px;margin-top: 10px;">
27
+            <span style="font-size: 14px;font-weight: 700;">Tips:</span>
28
+            <span style="font-size: 14px;">若需要添加人员绩效,可再次上传绩效表,重复上传会更新数据和新增数据。</span>
29
+          </div>
9 30
         </div>
10
-        <el-button type="success" icon="el-icon-printer" @click="printOpen = true">打印</el-button>
11
-        <h2 style="text-align: center;">绩效审批表</h2>
12
-        <el-form ref="form" :model="form" :rules="rules" :disabled="taskName == ''">
13
-          <el-row :gutter="20">
14
-            <el-col :span="7" :xs="24">
15
-              <el-form-item label="上报人:" prop="reporter" label-width="100px">
16
-                {{ getUserName(form.reporter) }}
17
-              </el-form-item>
18
-            </el-col>
19
-            <el-col :span="7" :xs="24">
20
-              <el-form-item label="上报部门:" prop="reportDept" label-width="100px">
21
-                {{ getDeptName(form.reportDept) }}
22
-              </el-form-item>
23
-            </el-col>
24
-            <el-col :span="7" :xs="24">
25
-              <el-form-item label="上报时间:" prop="reportTime" label-width="100px">
26
-                {{ form.reportTime }}
27
-              </el-form-item>
28
-            </el-col>
29
-          </el-row>
30
-          <el-form-item label="附件上传:" prop="document" label-width="100px">
31
-            <FileUpload v-if="!form.document" ref="orz" :limit="1" :isShowTip="false"
32
-              :filePathName="'绩效审批/' + parseTime(new Date(), '{y}-{m}-{d}-{h}-{i}-{s}')"
33
-              :fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf', 'rar', 'zip']" @input="setDocument">
34
-            </FileUpload>
35
-            <div v-if="form.document" class="upload-list">
36
-              <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + form.document}`)">
37
-                {{ getFileName(form.document) }}
38
-              </el-link>
39
-              <el-link class="ml20" type="warning" :href="`${baseUrl}${'/profile/upload' + form.document}`"
40
-                :underline="false" target="_blank">
41
-                <span class="el-icon-download">下载文件</span>
42
-              </el-link>
43
-              <span class="el-icon-delete del-file" @click="deleteDoc" v-if="taskName == '绩效上报'">删除文件</span>
44
-            </div>
31
+        <div class="table-title">内业绩效表</div>
32
+        <el-form :inline="true" size="small" class="table-search-bar" @submit.native.prevent>
33
+          <el-form-item label="姓名">
34
+            <el-select v-model="innerParams.userId" filterable clearable @change="getInnerTableData">
35
+              <el-option v-for="item in $store.state.user.userList" :key="item.userId" :label="item.nickName"
36
+                :value="item.userId">
37
+              </el-option>
38
+            </el-select>
45 39
           </el-form-item>
46
-          <el-form-item label="绩效统计:">
47
-            <performance-wages ref="wagesRef" :deptId="form.reportDept" :performanceId="taskForm.formId"
48
-              :taskName="taskName" @getTotal="setAmount" @saves="saves()"></performance-wages>
40
+          <el-form-item label="项目编号">
41
+            <el-select v-model="innerParams.projectId" clearable filterable remote reserve-keyword placeholder="请输入项目编号"
42
+              :remote-method="remoteMethod" style="width: 300px;" @change="getInnerTableData">
43
+              <el-option v-for="project in projectList" :key="project.projectId"
44
+                :label="project.projectNumber + '-' + project.projectName" :value="project.projectId">
45
+              </el-option>
46
+            </el-select>
49 47
           </el-form-item>
50
-          <el-form-item label="分管审核意见:" prop="managerComment" label-width="130px">
51
-            <el-input type="textarea" v-model="form.managerComment" :autosize="{ minRows: 4 }"
52
-              :disabled="taskName != '分管审核'"></el-input>
53
-            <auditor-row ref="fgRef" :isCurrent="taskName == '分管审核'"
54
-              :signature="form.managerUserId ? form.managerUserId : null" :signTime="form.managerTime"></auditor-row>
48
+          <el-form-item>
49
+            <el-button type="primary" @click="getInnerTableData">搜索</el-button>
50
+            <el-button @click="resetInnerSearch">重置</el-button>
51
+          </el-form-item>
52
+        </el-form>
53
+        <el-table :data="innerTableData" style="width: 100%">
54
+          <el-table-column type="index" label="序号" width="50" />
55
+          <el-table-column prop="projectNumber" label="项目编号" width="80" />
56
+          <el-table-column prop="project.projectName" label="项目名称" />
57
+          <el-table-column prop="nickName" label="姓名" width="80" />
58
+          <el-table-column prop="content" label="工作内容" />
59
+          <el-table-column prop="scaleGrade" label="比例尺" width="80" />
60
+          <el-table-column prop="workload" label="工作量" width="80" />
61
+          <el-table-column prop="unit" label="单位" width="80" />
62
+          <el-table-column prop="price" label="单价" width="80" />
63
+          <el-table-column prop="coefficient" label="系数" width="80" />
64
+          <el-table-column prop="producePerformance" label="绩效" width="100" />
65
+          <el-table-column prop="performanceMonth" label="统计月份" width="100">
66
+            <template slot-scope="scope">
67
+              {{ parseTime(scope.row.performanceMonth, '{y}-{m}') }}
68
+            </template>
69
+          </el-table-column>
70
+          <el-table-column prop="remark" label="备注" />
71
+          <el-table-column label="操作" width="100" v-if="taskName == '绩效上报'">
72
+            <template slot-scope="scope">
73
+              <el-button type="text" size="small" @click="handleEdit(scope.row, 'inner')">修改</el-button>
74
+            </template>
75
+          </el-table-column>
76
+        </el-table>
77
+        <pagination v-show="innerTotal > 0" :total="innerTotal" :page.sync="innerParams.pageNum"
78
+          :limit.sync="innerParams.pageSize" @pagination="getInnerTableData" />
79
+        <div class="table-title">外业绩效表</div>
80
+        <el-form :inline="true" size="small" class="table-search-bar" @submit.native.prevent>
81
+          <el-form-item label="姓名">
82
+            <el-select v-model="outerParams.userId" filterable clearable @change="getOuterTableData">
83
+              <el-option v-for="item in $store.state.user.userList" :key="item.userId" :label="item.nickName"
84
+                :value="item.userId">
85
+              </el-option>
86
+            </el-select>
55 87
           </el-form-item>
56
-          <el-form-item label="总经理审批意见:" prop="zjlComment" label-width="130px">
57
-            <el-input type="textarea" v-model="form.zjlComment" :autosize="{ minRows: 4 }"
58
-              :disabled="taskName != '总经理审批'"></el-input>
59
-            <auditor-row ref="zjlRef" :isCurrent="taskName == '总经理审批'"
60
-              :signature="form.zjlUserId ? form.zjlUserId : null" :signTime="form.zjlTime"></auditor-row>
88
+          <el-form-item label="项目编号">
89
+            <el-select v-model="outerParams.projectId" clearable filterable remote reserve-keyword placeholder="请输入项目编号"
90
+              :remote-method="remoteMethod" style="width: 300px;" @change="getOuterTableData">
91
+              <el-option v-for="project in projectList" :key="project.projectId"
92
+                :label="project.projectNumber + '-' + project.projectName" :value="project.projectId">
93
+              </el-option>
94
+            </el-select>
61 95
           </el-form-item>
62
-          <el-form-item label="人事制单:" label-width="130px" v-if="taskName == '人事制单'">
63
-            <el-button type="success" icon="el-icon-printer" @click="printOpen = true">打印</el-button>
96
+          <el-form-item>
97
+            <el-button type="primary" @click="getOuterTableData">搜索</el-button>
98
+            <el-button @click="resetOuterSearch">重置</el-button>
64 99
           </el-form-item>
65 100
         </el-form>
66
-        <el-row style="text-align: center;" v-if="taskName != ''">
67
-          <el-button type="danger" @click="returnOpen = true" v-show="taskName != '绩效上报'">退 回</el-button>
68
-          <el-button type="warning" @click="saves()">保存</el-button>
69
-          <el-button type="primary" @click="completeApply()">提交</el-button>
70
-        </el-row>
71
-      </el-col>
72
-      <el-col :span="6" :xs="24" v-if="isFlow">
73
-        <el-card>
74
-          <h2 style="text-align: center;">流程进度</h2>
75
-          <div>
76
-            <flow :flowData="flowData" />
101
+        <el-table :data="outerTableData" style="width: 100%">
102
+          <el-table-column type="index" label="序号" width="50" />
103
+          <el-table-column prop="projectNumber" label="项目编号" width="80" />
104
+          <el-table-column prop="project.projectName" label="项目名称" />
105
+          <el-table-column prop="nickName" label="姓名" width="80" />
106
+          <el-table-column prop="content" label="工作内容" />
107
+          <el-table-column prop="workload" label="工天" width="80" />
108
+          <el-table-column prop="unit" label="单位" width="80" />
109
+          <el-table-column prop="price" label="单价" width="80" />
110
+          <el-table-column prop="coefficient" label="系数" width="80" />
111
+          <el-table-column prop="producePerformance" label="绩效" width="100" />
112
+          <el-table-column prop="performanceMonth" label="统计月份" width="100">
113
+            <template slot-scope="scope">
114
+              {{ parseTime(scope.row.performanceMonth, '{y}-{m}') }}
115
+            </template>
116
+          </el-table-column>
117
+          <el-table-column prop="remark" label="备注" />
118
+          <el-table-column label="操作" width="100" v-if="taskName == '绩效上报'">
119
+            <template slot-scope="scope">
120
+              <el-button type="text" size="small" @click="handleEdit(scope.row, 'outer')">修改</el-button>
121
+            </template>
122
+          </el-table-column>
123
+        </el-table>
124
+        <pagination v-show="outerTotal > 0" :total="outerTotal" :page.sync="outerParams.pageNum"
125
+          :limit.sync="outerParams.pageSize" @pagination="getOuterTableData" />
126
+        <div class="table-title">绩效统计表</div>
127
+        <el-table :data="performanceTableData" style="width: 100%">
128
+          <el-table-column prop="nickName" label="姓名" />
129
+          <el-table-column prop="deptName" label="部门" />
130
+          <el-table-column prop="producePerformance" label="生产绩效" />
131
+          <el-table-column prop="managePerformance" label="管理绩效" />
132
+          <el-table-column prop="performanceMonth" label="统计月份">
133
+            <template slot-scope="scope">
134
+              {{ parseTime(scope.row.performanceMonth, '{y}-{m}') }}
135
+            </template>
136
+          </el-table-column>
137
+        </el-table>
138
+        <el-form-item label="附件上传:" prop="document" label-width="100px">
139
+          <FileUpload v-if="!form.document" ref="orz" :limit="1" :isShowTip="false"
140
+            :filePathName="'绩效审批/' + parseTime(new Date(), '{y}-{m}-{d}-{h}-{i}-{s}')"
141
+            :fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf', 'rar', 'zip']" @input="setDocument">
142
+          </FileUpload>
143
+          <div v-if="form.document" class="upload-list">
144
+            <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + form.document}`)">
145
+              {{ getFileName(form.document) }}
146
+            </el-link>
147
+            <el-link class="ml20" type="warning" :href="`${baseUrl}${'/profile/upload' + form.document}`"
148
+              :underline="false" target="_blank">
149
+              <span class="el-icon-download">下载文件</span>
150
+            </el-link>
151
+            <span class="el-icon-delete del-file" @click="deleteDoc" v-if="taskName == '绩效上报'">删除文件</span>
77 152
           </div>
78
-        </el-card>
79
-      </el-col>
153
+        </el-form-item>
154
+        <el-form-item label="绩效说明:" prop="remark" label-width="100px">
155
+          <el-input type="textarea" v-model="form.remark" :autosize="{ minRows: 4 }" />
156
+        </el-form-item>
157
+      </el-form>
158
+      <el-row style="text-align: center;" v-if="taskName != ''">
159
+        <el-button type="danger" @click="returnOpen = true" v-show="taskName != '绩效上报'">退 回</el-button>
160
+        <el-button type="warning" @click="saves()">保存</el-button>
161
+        <el-button type="primary" @click="completeApply()">提交</el-button>
162
+      </el-row>
80 163
     </el-row>
81
-    <el-dialog title="退回" :visible.sync="returnOpen" width="40%" append-to-body>
82
-      <return-btn :taskForm="taskForm" @goBack="$emit('goBack')" @saves="" @cancel="returnOpen = false"></return-btn>
164
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
165
+      <el-upload ref="uploadRef" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url" :data="upload.data"
166
+        :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-change="handleFileUploadChange"
167
+        :on-success="handleFileSuccess" :auto-upload="false" drag v-loading="uploadLoading"
168
+        element-loading-text="正在上传,请稍等">
169
+        <i class="el-icon-upload"></i>
170
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
171
+        <template #tip>
172
+          <div class="el-upload__tip text-center">
173
+            <span>仅允许导入xls、xlsx格式文件。</span>
174
+            <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
175
+              @click="importTemplate">下载模板</el-link>
176
+          </div>
177
+        </template>
178
+      </el-upload>
179
+      <template #footer>
180
+        <div class="dialog-footer">
181
+          <el-button type="primary" @click="submitUpload">确 定</el-button>
182
+          <el-button @click="upload.open = false">取 消</el-button>
183
+        </div>
184
+      </template>
83 185
     </el-dialog>
84
-    <el-dialog title="打印预览" :visible.sync="printOpen" width="60%" append-to-body>
85
-      <performance-print :formId="taskForm.formId" @cancel="printOpen = false"></performance-print>
186
+    <el-dialog :visible.sync="editDialogVisible" title="修改绩效" width="400px">
187
+      <el-form :model="editRow" label-width="80px">
188
+        <el-form-item label="工作量">
189
+          <el-input-number v-model="editRow.workload" :min="0" @change="calcPerformance" />
190
+        </el-form-item>
191
+        <el-form-item label="系数">
192
+          <el-input-number v-model="editRow.coefficient" :min="0" :max="10" :step="0.01" @change="calcPerformance" />
193
+        </el-form-item>
194
+        <el-form-item label="绩效">
195
+          <el-tag type="success" style="font-size: 16px;font-weight: 700;">{{ editRow.producePerformance }}</el-tag>
196
+        </el-form-item>
197
+      </el-form>
198
+      <div slot="footer" class="dialog-footer">
199
+        <el-button @click="editDialogVisible = false">取消</el-button>
200
+        <el-button type="primary" @click="submitEdit">确定</el-button>
201
+      </div>
86 202
     </el-dialog>
87 203
   </div>
88 204
 </template>
89 205
 
90 206
 <script>
91
-import flow from '@/views/flowable/task/todo/detail/flow';
92
-import { flowXmlAndNode } from "@/api/flowable/definition";
93 207
 import { parseTime } from "@/utils/ruoyi";
94 208
 import { complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm, } from "@/api/flowable/todo";
95 209
 import { listPerformance, getPerformance, addPerformance, updatePerformance, delPerformance } from "@/api/oa/performance/performance"
96
-import { listWage, getWage, addWage, updateWage, delWage } from "@/api/oa/wage/wage"
97
-import { getUsersDeptLeaderByDept, getUsersManageLeaderByDept, getUserByPost } from '@/api/system/post'
98
-import { getUserByRole } from "@/api/system/role";
99
-import PerformanceWages from './performanceWages.vue';
100
-import { scrollTo } from '@/utils/scroll-to'
101
-import AuditorRow from '@/views/flowable/form/components/auditorRow.vue';
102
-import returnBtn from '@/views/flowable/form/components/flowBtn/returnBtn.vue';
103
-import ReturnComment from '@/views/flowable/form/components/flowBtn/returnComment.vue';
104
-import PerformancePrint from '@/views/flowable/form/components/print/performancePrint.vue';
210
+import { listPerformanceStaff, getPerformanceStaff, updatePerformanceStaff, getMonthPerformanceList } from "@/api/oa/performance/performanceStaff";
211
+import { listProject } from "@/api/oa/project/project";
212
+import { getToken } from "@/utils/auth";
213
+
105 214
 export default {
106
-  components: { flow, PerformanceWages, AuditorRow, returnBtn, ReturnComment, PerformancePrint },
107 215
   props: {
108 216
     taskName: {
109 217
       type: String,
@@ -113,47 +221,55 @@ export default {
113 221
       type: Object,
114 222
       required: true
115 223
     },
116
-    isFlow: {
117
-      type: Boolean,
118
-      default: true
119
-    },
120 224
   },
121 225
   data() {
122 226
     return {
123 227
       baseUrl: process.env.VUE_APP_BASE_API,
124 228
       flowData: {},
125
-      rules: {
126
-        document: [
127
-          { required: true, message: '请上传统计明细附件', trigger: 'blur' }
128
-        ]
229
+      form: {},
230
+      rules: {},
231
+      showAlter: false,
232
+      upload: {
233
+        open: false,
234
+        title: "上传绩效表",
235
+        isUploading: false,
236
+        updateSupport: 0,
237
+        headers: { 'Authorization': "Bearer " + getToken() },
238
+        data: { 'performanceId': this.taskForm.formId },
239
+        url: process.env.VUE_APP_BASE_API + "/oa/performanceStaff/uploadSheet"
240
+      },
241
+      uploadLoading: false,
242
+      uploadFormData: undefined,
243
+      innerTableData: [],
244
+      outerTableData: [],
245
+      performanceTableData: [],
246
+      innerTotal: 0,
247
+      outerTotal: 0,
248
+      innerParams: {
249
+        pageNum: 1,
250
+        pageSize: 10,
251
+        userId: null,
252
+        projectId: null
129 253
       },
130
-      form: {
131
-        deptId: undefined,
132
-        applyTime: undefined,
133
-        applier: undefined,
254
+      outerParams: {
255
+        pageNum: 1,
256
+        pageSize: 10,
257
+        userId: null,
258
+        projectId: null
134 259
       },
135
-      performanceId: '',
260
+      projectList: [],
261
+      editDialogVisible: false,
262
+      editRow: {},
263
+      editType: '', // 'inner' or 'outer'
136 264
       formTotal: 0,
137
-      returnOpen: false,
138
-      printOpen: false,
139
-      showAlter: true,
140 265
     }
141 266
   },
142 267
   created() {
143
-    this.initFlow();
144 268
     this.initForm();
145 269
   },
146 270
   methods: {
147
-    initFlow() {
148
-      if (this.isFlow) {
149
-        flowXmlAndNode({ procInsId: this.taskForm.procInsId, deployId: this.taskForm.deployId }).then(res => {
150
-          this.flowData = res.data;
151
-        })
152
-      }
153
-    },
154 271
     initForm() {
155 272
       const formId = this.taskForm.formId;
156
-      this.performanceId = formId;
157 273
       if (this.taskName == '绩效上报') {
158 274
         this.form.reporter = this.$store.getters.userId;
159 275
         this.form.reportDept = this.$store.getters.deptId;
@@ -164,74 +280,143 @@ export default {
164 280
           this.formTotal = 1
165 281
           this.form = res.data;
166 282
         }
167
-        if (this.taskName == '绩效上报')
168
-          this.saves();
169 283
       })
284
+      this.getInnerTableData();
285
+      this.getOuterTableData();
286
+      this.getTotalPerformance();
287
+    },
288
+    getInnerTableData() {
289
+      listPerformanceStaff({
290
+        performanceId: this.taskForm.formId,
291
+        workType: '内业',
292
+        pageSize: this.innerParams.pageSize,
293
+        pageNum: this.innerParams.pageNum,
294
+        userId: this.innerParams.userId,
295
+        projectId: this.innerParams.projectId
296
+      }).then(res => {
297
+        this.innerTableData = res.rows || [];
298
+        this.innerTotal = res.total || 0;
299
+      })
300
+    },
301
+    getOuterTableData() {
302
+      listPerformanceStaff({
303
+        performanceId: this.taskForm.formId,
304
+        workType: '外业',
305
+        pageSize: this.outerParams.pageSize,
306
+        pageNum: this.outerParams.pageNum,
307
+        userId: this.outerParams.userId,
308
+        projectId: this.outerParams.projectId
309
+      }).then(res => {
310
+        this.outerTableData = res.rows || [];
311
+        this.outerTotal = res.total || 0;
312
+      })
313
+    },
314
+    getTotalPerformance() {
315
+      let deptId;
316
+      if (this.taskName == '绩效上报') {
317
+        deptId = this.$store.getters.deptId;
318
+      } else {
319
+        deptId = this.form.reportDept;
320
+      }
321
+      getMonthPerformanceList({ performanceId: this.taskForm.formId, deptId: deptId }).then(res => {
322
+        console.log(res);
323
+        this.performanceTableData = res.data;
324
+      })
325
+    },
326
+    remoteMethod(val) {
327
+      let params = {
328
+        pageNum: 1,
329
+        pageSize: 20,
330
+        projectNumber: val
331
+      }
332
+      listProject(params).then(res => {
333
+        this.projectList = res.rows;
334
+      })
335
+    },
336
+    resetInnerSearch() {
337
+      this.innerParams.userId = null;
338
+      this.innerParams.projectId = null;
339
+      this.getInnerTableData();
170 340
     },
171
-    setAmount(val) {
172
-      this.amount = val[0]
173
-      this.peopleNum = val[1]
341
+    resetOuterSearch() {
342
+      this.outerParams.userId = null;
343
+      this.outerParams.projectId = null;
344
+      this.getOuterTableData();
345
+    },
346
+    /**Excel文件上传中处理 */
347
+    handleFileUploadProgress(event, file, fileList) {
348
+      this.upload.isUploading = true;
349
+      this.uploadLoading = true;
350
+    },
351
+    /* Excel文件改变时 */
352
+    handleFileUploadChange(file, fileList) {
353
+      if (fileList.length > 1) {
354
+        fileList.splice(0, 1);
355
+      }
356
+      this.uploadFormData = new FormData();
357
+      this.uploadFormData.append("file", file);
358
+      this.upload.data = { 'performanceId': this.taskForm.formId };
359
+    },
360
+    /** Excel文件上传成功处理 */
361
+    handleFileSuccess(response, file, fileList) {
362
+      this.upload.open = false;
363
+      this.upload.isUploading = false;
364
+      this.uploadLoading = false;
365
+      this.fileList = [];
366
+      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
367
+      this.$refs["uploadRef"].clearFiles();
368
+      this.getInnerTableData();
369
+      this.getOuterTableData();
370
+    },
371
+    /* Excel上传提交按钮 */
372
+    submitUpload() {
373
+      const formData = new FormData();
374
+      const file = this.$refs['uploadRef'].uploadFiles[0];
375
+      if (file) {
376
+        formData.append('file', file.raw);
377
+        formData.append('performanceId', this.taskForm.formId);
378
+        this.$refs['uploadRef'].uploadFiles[0].formData = formData;
379
+      }
380
+      this.$refs['uploadRef'].submit();
381
+    },
382
+    /* 下载模板 */
383
+    importTemplate() {
384
+      const path = '/profile/upload/template/userWage.xlsx'
385
+      downloadTemplate(path).then(res => {
386
+        const blob = new Blob([res])
387
+        saveAs(blob, '社保公积金模版.xlsx');
388
+      });
389
+    },
390
+    handleEdit(row, type) {
391
+      this.editRow = { ...row };
392
+      this.editType = type;
393
+      this.editDialogVisible = true;
394
+    },
395
+    calcPerformance() {
396
+      const { workload, price, coefficient } = this.editRow;
397
+      this.editRow.producePerformance = (workload * price * coefficient).toFixed(2);
398
+    },
399
+    submitEdit() {
400
+      updatePerformanceStaff(this.editRow).then(() => {
401
+        this.$message.success('修改成功');
402
+        this.editDialogVisible = false;
403
+        if (this.editType === 'inner') {
404
+          this.getInnerTableData();
405
+        } else {
406
+          this.getOuterTableData();
407
+        }
408
+      });
174 409
     },
175 410
     async saves() {
176 411
       if (this.formTotal != 0) {
177
-        if (this.taskName == '分管审核') {
178
-          this.form.managerUserId = this.$refs.fgRef.localSignatureUserId;
179
-          this.form.managerTime = this.$refs.fgRef.loaclSignTime;
180
-        } else if (this.taskName == '总经理审批') {
181
-          this.form.zjlUserId = this.$refs.zjlRef.localSignatureUserId;
182
-          this.form.zjlTime = this.$refs.zjlRef.loaclSignTime;
183
-        }
184 412
         await updatePerformance(this.form)
185 413
       } else {
186 414
         this.form.performanceId = this.taskForm.formId;
187 415
         await addPerformance(this.form)
188 416
         this.initForm();
189 417
       }
190
-      this.savesWages()
191 418
       this.$message.success('保存成功')
192 419
     },
193
-    async savesWages() {
194
-      const wagesList = this.$refs.wagesRef.wagesList;
195
-      for (let wages of wagesList) {
196
-        await updateWage(wages)
197
-      }
198
-    },
199
-    completeApply() {
200
-      const params = { taskId: this.taskForm.taskId };
201
-      this.$refs['form'].validate(valid => {
202
-        if (valid) {
203
-          this.saves();
204
-          getNextFlowNode(params).then(async () => {
205
-            if (this.taskName == '绩效上报') {
206
-              let result = await getUsersManageLeaderByDept({ deptId: this.form.reportDept });
207
-              const managerList = result.data.map(element => element.userId);
208
-              this.$set(this.taskForm.variables, "approvalList", managerList);
209
-              this.successComplete();
210
-            } else if (this.taskName == '分管审核') {
211
-              let result = await getUserByPost({ postName: '总经理' })
212
-              this.$set(this.taskForm.variables, "approval", result.data[0].userId);
213
-              this.successComplete();
214
-            } else if (this.taskName == '总经理审批') {
215
-              let result = await getUserByRole({ roleId: 3 })
216
-              this.$set(this.taskForm.variables, "approvalList", result.data);
217
-              this.successComplete();
218
-            } else if (this.taskName == '人事制单') {
219
-              this.$modal.confirm('最后一个节点,提交将结束流程,是否提交?').then(res => {
220
-                this.successComplete();
221
-              })
222
-            }
223
-          })
224
-        } else {
225
-          scrollTo(0, 600)
226
-        }
227
-      })
228
-    },
229
-    successComplete() {
230
-      complete(this.taskForm).then(response => {
231
-        this.$modal.msgSuccess(response.msg);
232
-        this.$emit('goBack')
233
-      })
234
-    },
235 420
     setDocument(val) {
236 421
       let arr = val.split('/upload')
237 422
       this.$set(this.form, 'document', arr[1])
@@ -239,27 +424,26 @@ export default {
239 424
         this.$set(this.form, 'document', "")
240 425
       }
241 426
     },
242
-    deleteDoc() {
243
-      this.$set(this.form, 'document', undefined)
244
-    },
245
-    isReturn(val) {
246
-      this.showAlter = val
247
-    }
248 427
   }
249 428
 }
250 429
 </script>
251 430
 
252 431
 <style lang="scss" scoped>
253
-@import "@/assets/styles/element-reset.scss";
254
-
255
-::v-deep .el-descriptions-item__label.is-bordered-label {
256
-  color: #5a5757;
257
-  background: rgba($color: #a9adb3, $alpha: 0.1);
258
-  width: 150px;
259
-  min-width: 150px;
432
+.table-title {
433
+  font-size: 18px;
434
+  font-weight: 700;
435
+  text-align: left;
436
+  margin: 32px 0 16px 0;
437
+  color: #222;
438
+  letter-spacing: 1px;
439
+  background: linear-gradient(90deg, #e3f0ff 0%, #f8fbff 100%);
440
+  padding: 10px 0 10px 16px;
441
+  border-left: 5px solid #409EFF;
442
+  border-radius: 6px;
443
+  box-shadow: 0 2px 8px rgba(64, 158, 255, 0.06);
260 444
 }
261 445
 
262
-::v-deep .el-descriptions .is-bordered .el-descriptions-item__cell {
263
-  border: 1px solid #cdd0d3;
446
+.table-search-bar {
447
+  margin-bottom: 10px;
264 448
 }
265 449
 </style>

Loading…
Annulla
Salva