Kaynağa Gözat

护理技能大赛 选手信息维护,只能各级维护各级的
选手排序 按照名次(省市区)

单文琦 2 yıl önce
ebeveyn
işleme
9feee8531f

+ 3 - 0
ruoyi-modules/mz-business-hljnds/src/main/java/com/ruoyi/business/domain/ZwywHldsXsxx.java

@@ -274,4 +274,7 @@ public class ZwywHldsXsxx extends BaseEntity
 
     @TableField(exist = false)
     private String mc;
+
+    @TableField(exist = false)
+    private String  cjrId;
 }

+ 16 - 2
ruoyi-modules/mz-business-hljnds/src/main/java/com/ruoyi/business/service/impl/ZwywHldsXsxxServiceImpl.java

@@ -8,7 +8,9 @@ import com.ruoyi.common.core.exception.ServiceException;
 import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.security.utils.SecurityUtils;
 import com.ruoyi.system.domain.SysDeptJl;
+import com.ruoyi.system.domain.SysHljndsSqwh;
 import com.ruoyi.system.mapper.SysDeptJlMapper;
+import com.ruoyi.system.mapper.SysHljndsSqwhMapper;
 import com.ruoyi.system.utils.SubCodeUtil;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -32,6 +34,9 @@ public class ZwywHldsXsxxServiceImpl implements IZwywHldsXsxxService
     @Autowired
     private SysDeptJlMapper sysDeptJlMapper;
 
+    @Autowired
+    private SysHljndsSqwhMapper sysHljndsSqwhMapper;
+
 
     /**
      * 查询选手基础信息
@@ -43,7 +48,11 @@ public class ZwywHldsXsxxServiceImpl implements IZwywHldsXsxxService
     public ZwywHldsXsxx selectZwywHldsXsxxById(String id)
     {
         ZwywHldsXsxx res = zwywHldsXsxxMapper.selectById(id);
-
+        SysHljndsSqwh sysHljndsSqwh = sysHljndsSqwhMapper.selectById(res.getSqwhId());
+        res.setMc(sysHljndsSqwh.getMc());
+        if (!res.getCreateUserId().equals(String.valueOf(SecurityUtils.getUserId()))){
+            throw  new ServiceException("只允许维护自己创建的数据");
+        }
         res.setSqMc(sysDeptJlMapper.getXzqhNames(res.getSq()));
         res.setSq(sysDeptJlMapper.getXzqhCodes(res.getSq()));
         return res;
@@ -63,7 +72,12 @@ public class ZwywHldsXsxxServiceImpl implements IZwywHldsXsxxService
         }
         zwywHldsXsxx.setCreateAreaCode(SubCodeUtil.getSubCode(SecurityUtils.getAreaCode()).get("level").toString());
         List<ZwywHldsXsxx> res = zwywHldsXsxxMapper.selectZwywHldsXsxxList(zwywHldsXsxx);
-        res.forEach(r -> r.setSqMc(sysDeptJlMapper.getXzqhNames(r.getSq()) + "赛区"));
+        res.forEach(r ->{
+                    r.setSqMc(sysDeptJlMapper.getXzqhNames(r.getSq()) + "赛区");
+                    ZwywHldsXsxx zwywHldsXsxx1 = zwywHldsXsxxMapper.selectById(r.getId());
+                    r.setCjrId(zwywHldsXsxx1.getCreateUserId());
+                }
+        );
         return res;
     }
 

+ 1 - 1
ruoyi-ui/src/views/business/hljnds/xscjwh/index.vue

@@ -43,7 +43,7 @@
             <el-table-column label="市级名次" align="center" prop="sxbsmc" />
             <el-table-column label="省级成绩" align="center" prop="sjxbsfs" />
             <el-table-column label="省级名次" align="center" prop="sjxbsmc" />
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" width="200" fixed="right">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" fixed="right">
         <template slot-scope="scope">
           <el-button
             size="mini"

+ 12 - 2
ruoyi-ui/src/views/business/hljnds/xsxx/index.vue

@@ -82,6 +82,7 @@
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" fixed="right">
         <template slot-scope="scope">
           <el-button
+            v-if="scope.row.cjrId == user.userData.userId"
             size="mini"
             type="text"
             icon="el-icon-edit"
@@ -98,6 +99,7 @@
           >详情
           </el-button>
           <el-button
+            v-if="scope.row.cjrId == user.userData.userId"
             size="mini"
             type="text"
             icon="el-icon-delete"
@@ -355,6 +357,8 @@
           <tr>
             <td>姓名:</td>
             <td>{{dataDetails.xm}}</td>
+            <td>赛期名称:</td>
+            <td>{{dataDetails.mc}}</td>
             <td>身份证号:</td>
             <td>{{dataDetails.sfzhm}}</td>
           </tr>
@@ -475,7 +479,7 @@
 import {addXsxx, delXsxx, getXsxx, listXsxx, updateXsxx, updateZwywHldsXsxxSj} from '@/api/business/hljnds/xsxx'
 import {chineseOne, idCard, Regular} from '@/utils/regular'
 import {Constant} from '@/utils/constant'
-import {mapGetters} from 'vuex'
+import {mapGetters, mapState} from 'vuex'
 
 export default {
     name: 'Xsxx',
@@ -668,7 +672,10 @@ export default {
     //   this.isIF=checkPermi(['business:sjxsxx:edit']);
     //   this.getList()
     // },
-    mounted() {
+    created() {
+      console.log('11',this.user.userData)
+    },
+  mounted() {
     this.getList();
     // 省市显示行政区划筛选
     if (this.level < 1) {
@@ -678,6 +685,7 @@ export default {
   },
   computed: {
     ...mapGetters(["level"]),
+    ...mapState(['user']),
   },
     methods: {
       //获取选择信息的数据 👇
@@ -712,6 +720,7 @@ export default {
       getList() {
         this.loading = true
         listXsxx({...this.queryParams,sq:this.queryParams.sq?this.queryParams.sq[this.queryParams.sq.length-1]:''}).then(response => {
+          console.log(response.rows)
           this.xsxxList = response.rows
           this.total = response.total
           this.loading = false
@@ -917,6 +926,7 @@ export default {
       particulars(row) {
         this.dataDetails = {}
         getXsxx(row.id).then(response => {
+          console.log(response.data)
           this.dataDetails = response.data
           this.openXQ = true
         })