Forráskód Böngészése

增加删除历史薪资记录功能

seyason 1 éve
szülő
commit
101fabb330

+ 20 - 19
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -1611,25 +1611,26 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             //删除日报的日志
             reportLogMapper.delete(new QueryWrapper<ReportLog>().eq("creator_id", userId).eq("create_date", date));
         }
-        if(company.getId()==862){
-            String url = "http://183.194.0.98:3202/api/web-server/controlCenter/billRejected";
-            HttpHeaders headers = new HttpHeaders();
-            headers.setContentType(MediaType.APPLICATION_JSON);
-            headers.add("token",getTokenOfYiWei());
-            JSONObject body=new JSONObject();
-            body.put("type","EXPENSE");
-            body.put("billNo","GS"+reportList.get(0).getCreatorId()+reportList.get(0).getCreateDate());
-            HttpEntity<String> requestEntity = new HttpEntity<String>(body.toJSONString(), headers);
-            ResponseEntity<String> responseEntity = this.restTemplate.exchange(url,
-                    HttpMethod.POST, requestEntity, String.class);
-            if (responseEntity.getStatusCode() == HttpStatus.OK) {
-                String resp = responseEntity.getBody();
-                JSONObject json = JSONObject.parseObject(resp);
-                if(json.getIntValue("status")==0){
-                    JSONArray jsonArray = json.getJSONArray("data");
-                }
-            }
-        }
+        //不需要调绎维的删除接口了。工时在我们这边系统内管理控制。
+//        if(company.getId()==862){
+//            String url = "http://183.194.0.98:3202/api/web-server/controlCenter/billRejected";
+//            HttpHeaders headers = new HttpHeaders();
+//            headers.setContentType(MediaType.APPLICATION_JSON);
+//            headers.add("token",getTokenOfYiWei());
+//            JSONObject body=new JSONObject();
+//            body.put("type","EXPENSE");
+//            body.put("billNo","GS"+reportList.get(0).getCreatorId()+reportList.get(0).getCreateDate());
+//            HttpEntity<String> requestEntity = new HttpEntity<String>(body.toJSONString(), headers);
+//            ResponseEntity<String> responseEntity = this.restTemplate.exchange(url,
+//                    HttpMethod.POST, requestEntity, String.class);
+//            if (responseEntity.getStatusCode() == HttpStatus.OK) {
+//                String resp = responseEntity.getBody();
+//                JSONObject json = JSONObject.parseObject(resp);
+//                if(json.getIntValue("status")==0){
+//                    JSONArray jsonArray = json.getJSONArray("data");
+//                }
+//            }
+//        }
         return httpRespMsg;
     }
 

+ 44 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -526,7 +526,7 @@
           <el-button type="primary" @click="deleteUser(deleteUserFlgData)" :loading="deleteUserFlgloading">确 定</el-button>
         </span>
       </el-dialog>
-        <el-dialog :title="$t('historicalpersonnelcost')" :visible.sync="userSalaryListDialog" width="550px" >
+        <el-dialog :title="$t('historicalpersonnelcost')" :visible.sync="userSalaryListDialog" width="750px" >
             <el-table :data="userSalaryList" highlight-current-row v-loading="listLoading" height="300px" style="width: 100%;">
                 <el-table-column prop="userName" :label="$t('lable.name')" >
                   <template slot-scope="scope">
@@ -552,7 +552,11 @@
                         {{scope.row.cost}} {{ $t('yuan') }}
                     </template>
                 </el-table-column>
-                
+                <el-table-column  >
+                    <template slot-scope="scope" >
+                        <el-button size="small" @click="delHisSalary(scope.row.id,scope.row.userId)">删除</el-button>
+                    </template>
+                </el-table-column>
             </el-table>
         </el-dialog>
         <!--导出人员 -->
@@ -1119,6 +1123,40 @@ export default {
     that = this;
   },
   methods: {
+    delHisSalary(id, userId) {
+      this.$confirm('是否删除该记录?', this.$t('other.prompts'), {
+            confirmButtonText: this.$t('btn.determine'),
+            cancelButtonText: this.$t('btn.cancel'),
+            type: 'warning'
+        }).then(()=>{
+            this.http.post('/user/deleteUserSalaryById',{
+                id: id
+            },res => {
+                if(res.code == 'ok'){
+                    this.$message({
+                        message: '操作成功',
+                        type: 'success'
+                    })
+                    this.reqSalaryList(userId);
+                }else {
+                    this.$message({
+                        message: res.msg,
+                        type: 'error'
+                    })
+                }
+            },error => {
+                this.$message({
+                    message: error,
+                    type: 'error'
+                })
+            })
+        }).catch(()=>{
+            this.$message({
+                message: this.$t('thedeletionhasbeencancelled'),
+                type: 'info'
+            })
+        })
+    },
     statesPush(){
       if(this.user.corpwxUserid != null && this.user.userNameNeedTranslate == 1){
         var state = {value: "2",label: "可转让"}
@@ -2322,11 +2360,14 @@ export default {
     },
     showSalaryList(item) {
       this.userSalaryListDialog = true;
+      this.reqSalaryList(item.id);
+    },
+    reqSalaryList(userId) {
       this.userSalaryList = [];
       this.http.post(
         "/user/getUserSalaryList",
         {
-          id: item.id,
+          id: userId,
         },
         (res) => {
           if (res.code == "ok") {