Bladeren bron

工资条删除,福利报名删除

xianwait 2 jaren geleden
bovenliggende
commit
b1ef9e1f8d

+ 17 - 0
willalp-admin/src/main/java/com/willalp/web/controller/clockingin/HsSalarySlipController.java

@@ -1,5 +1,6 @@
 package com.willalp.web.controller.clockingin;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.willalp.common.annotation.Log;
 import com.willalp.common.core.controller.BaseController;
 import com.willalp.common.core.domain.AjaxResult;
@@ -7,6 +8,7 @@ import com.willalp.common.core.page.TableDataInfo;
 import com.willalp.common.enums.BusinessType;
 import com.willalp.common.utils.DateUtils;
 import com.willalp.common.utils.SecurityUtils;
+import com.willalp.common.utils.StringUtils;
 import com.willalp.common.utils.poi.ExcelUtil;
 import com.willalp.salary.domain.HsSalarySlip;
 import com.willalp.salary.service.IHsSalarySlipService;
@@ -144,4 +146,19 @@ public class HsSalarySlipController extends BaseController {
         hsSalarySlipService.updatePushStatus(ids);
         return AjaxResult.success();
     }
+
+    /**
+     * 删除指定excel导入的数据
+     *
+     * @param source
+     * @return
+     */
+    @GetMapping("/deleteSource")
+    public AjaxResult deleteSource(String source) {
+        if (StringUtils.isBlank(source)) {
+            return AjaxResult.error();
+        }
+        return toAjax(hsSalarySlipService.remove(new QueryWrapper<HsSalarySlip>()
+                .eq("source", source)));
+    }
 }

+ 17 - 0
willalp-admin/src/main/java/com/willalp/web/controller/clockingin/HsWelfareApplyRecordController.java

@@ -8,6 +8,7 @@ import com.willalp.common.core.page.TableDataInfo;
 import com.willalp.common.enums.BusinessType;
 import com.willalp.common.utils.DateUtils;
 import com.willalp.common.utils.SecurityUtils;
+import com.willalp.common.utils.StringUtils;
 import com.willalp.common.utils.poi.ExcelUtil;
 import com.willalp.event.domain.HsWelfareApplyRecord;
 import com.willalp.event.service.IHsWelfareApplyRecordService;
@@ -141,4 +142,20 @@ public class HsWelfareApplyRecordController extends BaseController {
     public AjaxResult remove(@PathVariable String[] ids) {
         return toAjax(hsWelfareApplyRecordService.removeByIds(Arrays.asList(ids)));
     }
+
+
+    /**
+     * 删除指定excel导入的数据
+     *
+     * @param source
+     * @return
+     */
+    @GetMapping("/deleteSource")
+    public AjaxResult deleteSource(String source) {
+        if (StringUtils.isBlank(source)) {
+            return AjaxResult.error();
+        }
+        return toAjax(hsWelfareApplyRecordService.remove(new QueryWrapper<HsWelfareApplyRecord>()
+                .eq("source", source)));
+    }
 }

+ 1 - 0
willalp-clocking-in/src/main/java/com/willalp/salary/mapper/xml/HsSalarySlipMapper.xml

@@ -81,6 +81,7 @@
                source,
                pay_date
         FROM hs_salary_slip
+        WHERE is_delete = 0
         GROUP BY source
     </select>
 </mapper>

+ 8 - 0
willalp-ui/src/api/event/applyRecord.js

@@ -66,6 +66,14 @@ export function delApplyRecord(id) {
   })
 }
 
+// 删除福利报名记录
+export function delSource(source) {
+  return request({
+    url: '/event/applyRecord/deleteSource?source=' + source,
+    method: 'get'
+  })
+}
+
 // 导出福利报名记录
 export function exportApplyRecord(query) {
   return request({

+ 8 - 0
willalp-ui/src/api/salary/salaryslip.js

@@ -60,6 +60,14 @@ export function delSalaryslip(id) {
   })
 }
 
+// 删除福利报名记录
+export function delSource(source) {
+  return request({
+    url: '/salary/salaryslip/deleteSource?source=' + source,
+    method: 'get'
+  })
+}
+
 // 删除工资条基础
 export function push(id) {
   return request({

+ 14 - 1
willalp-ui/src/views/event/applyRecord/index.vue

@@ -135,7 +135,7 @@
                     size="mini"
                     type="text"
                     icon="el-icon-delete"
-                    @click="sourceDoUnregistered(scope.row.source)"
+                    @click="doDelSource(scope.row.source)"
                   >删除
                   </el-button>
                 </template>
@@ -288,6 +288,7 @@ import {
   doUnregistered,
   getApplyRecord,
   delApplyRecord,
+  delSource,
   addApplyRecord,
   updateApplyRecord,
   exportApplyRecord,
@@ -416,6 +417,18 @@ export default {
 
       })
     },
+    doDelSource(source) {
+      this.$modal.confirm('删除后所有信息都将删除,确认删除吗?').then(() => {
+        return delSource(source)
+      }).then(response => {
+        if (response.code === 200) {
+          this.$modal.msgSuccess('删除成功')
+          this.getList()
+        } else {
+          this.$modal.msgError('删除失败')
+        }
+      })
+    },
     // 取消按钮
     cancel() {
       this.open = false

+ 41 - 16
willalp-ui/src/views/salary/salaryslip/index.vue

@@ -114,7 +114,18 @@
             <el-table border v-loading="loading" :data="excelInfo.list" @selection-change="handleSelectionChange"
                       @row-click="rowClick">
               <el-table-column label="工资列表" align="center" prop="source"/>
-              <el-table-column label="日期" align="center" prop="payDate" width="100"/>
+              <el-table-column label="日期" align="center" prop="payDate"/>
+              <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+                <template slot-scope="scope">
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-delete"
+                    @click="doDelSource(scope.row.source)"
+                  >删除
+                  </el-button>
+                </template>
+              </el-table-column>
             </el-table>
             <pagination
               v-show="excelInfo.total>0"
@@ -152,7 +163,6 @@
                     type="text"
                     icon="el-icon-delete"
                     @click="handleDelete(scope.row)"
-                    v-hasPermi="['salary:salaryslip:remove']"
                   >删除
                   </el-button>
                   <el-button style="margin-left: 10px"
@@ -270,14 +280,15 @@
 <script>
 import {
   listSalaryslip,
-    getSalaryslip,
-    delSalaryslip,
-    addSalaryslip,
-    updateSalaryslip,
-    exportSalaryslip, importTempSalaryslip, getSalaryslips, push, excelList
+  getSalaryslip,
+  delSalaryslip,
+  delSource,
+  addSalaryslip,
+  updateSalaryslip,
+  exportSalaryslip, importTempSalaryslip, getSalaryslips, push, excelList
 }
-from
-'@/api/salary/salaryslip'
+  from
+    '@/api/salary/salaryslip'
 import { getToken } from '@/utils/auth'
 
 export default {
@@ -364,6 +375,18 @@ export default {
         this.loading = false
       })
     },
+    doDelSource(source) {
+      this.$modal.confirm('删除后所有信息都将删除,确认删除吗?').then(() => {
+        return delSource(source)
+      }).then(response => {
+        if (response.code === 200) {
+          this.$modal.msgSuccess('删除成功')
+          this.getList()
+        } else {
+          this.$modal.msgError('删除失败')
+        }
+      })
+    },
     /** 查询工资条基础列表 */
     getList() {
       this.loading = true
@@ -376,13 +399,15 @@ export default {
         this.excelInfo.list = response.rows
         this.excelInfo.total = response.total
         this.loading = false
-        this.queryParams.source = this.excelInfo.list[0].source
-        listSalaryslip(this.queryParams).then(response => {
-          this.salaryslipList = []
-          this.salaryslipList = response.rows
-          this.total = response.total
-          this.loading = false
-        })
+        if (this.excelInfo.list[0]) {
+          this.queryParams.source = this.excelInfo.list[0].source
+        }
+      })
+      listSalaryslip(this.queryParams).then(response => {
+        this.salaryslipList = []
+        this.salaryslipList = response.rows
+        this.total = response.total
+        this.loading = false
       })
     },
     // 取消按钮