Эх сурвалжийг харах

ehr-绩效:功能优化

001295 1 жил өмнө
parent
commit
6fed6bb943

+ 4 - 4
src/api/business/ehr/pm/performance.js

@@ -17,11 +17,11 @@ export function getPerformance(id) {
   })
 }
 
-// 保存绩效
-export function savePerformance(data) {
+// 复制绩效明细
+export function copyItem(data) {
   return request({
-    url: '/ehr/pm/performance/save',
-    method: 'put',
+    url: '/ehr/pm/performance/copyItem',
+    method: 'post',
     data: data
   })
 }

+ 12 - 4
src/views/business/ehr/pm/mark/index.vue

@@ -28,9 +28,9 @@
         <div>
           评语<el-input type="textarea" v-model="form.comment"></el-input>
         </div>
-        <div style="float:right">
+        <!-- <div style="float:right">
           <el-button size="mini" @click="btnUnfold">{{isUnfold == true ? "收起" : "展开"}}</el-button>
-        </div>
+        </div> -->
         <el-table size="mini"  :data="form.performanceItem" show-summary :summary-method="getSummaries">
           <el-table-column width="100" :show-overflow-tooltip="!isUnfold" label="评估方面" align="center" prop="aspect">
             <template slot-scope="scope">
@@ -38,14 +38,22 @@
             </template>
           </el-table-column>
           <el-table-column width="100" :show-overflow-tooltip="!isUnfold" label="评估指标" align="center" prop="target" />
-          <el-table-column :show-overflow-tooltip="!isUnfold" label="评估说明" align="center" prop="instructions" />
+          <el-table-column :show-overflow-tooltip="!isUnfold" label="评估说明" align="center" prop="instructions">
+            <template slot-scope="scope">
+              <div style="white-space: pre-wrap;text-align: left">{{scope.row.instructions}}</div>
+            </template>
+          </el-table-column>
           <el-table-column width="100" label="角色" align="center" prop="role">
             <template slot-scope="scope">
               <dict-tag :options="dict.type.ehr_pm_role" :value="scope.row.role"/>
             </template>
           </el-table-column>
           <el-table-column width="80" label="权重" align="center" prop="weight"/>
-          <el-table-column :show-overflow-tooltip="!isUnfold" label="绩效标准" align="center" prop="standard" />
+          <el-table-column :show-overflow-tooltip="!isUnfold" label="绩效标准" align="center" prop="standard">
+            <template slot-scope="scope">
+              <div style="white-space: pre-wrap;text-align: left">{{scope.row.standard}}</div>
+            </template>
+          </el-table-column>
           <el-table-column width="100" label="数据来源" align="center" prop="source" />
           <el-table-column width="80" label="自评分" align="center" prop="selfScoring"/>
           <el-table-column :show-overflow-tooltip="!isUnfold" label="自评语" align="center" prop="selfComment"/>

+ 8 - 7
src/views/business/ehr/pm/performance/btnCopyItem.vue

@@ -44,6 +44,9 @@ export default {
         pageNum: 1,
         pageSize: 10,
         staff: null,
+        params:{
+          includeCurrentMonth: null,
+        },
       },
       // 总条数
       total: 0,
@@ -73,15 +76,13 @@ export default {
     },
     //复制
     async btnCopy(row){
-      let res = await getPerformance(row.id);
-      if(res.code === 200){
-        this.$emit('setItems',res.data.performanceItem);
-        this.$modal.msgSuccess("复制成功");
-        this.open = false;
-      }
+      this.$emit('setItems',row.id);
+      this.open = false;
     },
   },
-  created() {},
+  created() {
+    this.queryParams.params.includeCurrentMonth = "N";
+  },
 };
 </script>
 

+ 20 - 18
src/views/business/ehr/pm/performance/detail.vue

@@ -25,6 +25,7 @@
           <el-descriptions-item label="评估周期">{{form.name}}</el-descriptions-item>
           <el-descriptions-item label="评估人编号">{{form.startTime}}</el-descriptions-item>
           <el-descriptions-item label="评估人姓名">{{form.deadlineTime}}</el-descriptions-item>
+          <el-descriptions-item label="所属分组">{{form.deadlineTime}}</el-descriptions-item>
         </el-descriptions>
         <el-descriptions v-if="form.status > 3">
           <el-descriptions-item label="个人总结">{{form.summary}}</el-descriptions-item>
@@ -37,7 +38,7 @@
         </el-descriptions>
         <div style="float:right">
           <el-button type="primary" size="mini" @click="btnAddRow" v-if="this.$store.state.user.name == form.staff && form.status == '0'">增加指标</el-button>
-          <el-button size="mini" @click="btnUnfold">{{isUnfold == true ? "收起" : "展开"}}</el-button>
+          <!-- <el-button size="mini" @click="btnUnfold">{{isUnfold == true ? "收起" : "展开"}}</el-button> -->
         </div>
         <el-table size="mini"  :data="form.performanceItem" show-summary :summary-method="getSummaries">
           <el-table-column width="100" :show-overflow-tooltip="!isUnfold" label="评估方面" align="center" prop="aspect">
@@ -56,7 +57,7 @@
               <dict-tag :options="dict.type.ehr_pm_role" :value="scope.row.role"/>
             </template>
           </el-table-column>
-          <el-table-column width="80" label="权重" align="center" prop="weight"/>
+          <el-table-column width="80" label="权重(%)" align="center" prop="weight"/>
           <el-table-column :show-overflow-tooltip="!isUnfold" label="绩效标准" align="center" prop="standard">
             <template slot-scope="scope">
               <div style="white-space: pre-wrap;text-align: left">{{scope.row.standard}}</div>
@@ -128,7 +129,7 @@
           </el-select>
         </el-form-item>
         <el-form-item label="加/减分项" prop="asItem">
-          <el-checkbox v-model="rowData.asItem"></el-checkbox>
+          <el-checkbox v-model="rowData.asItem" @change="handleCheckedChange"></el-checkbox>
         </el-form-item>
         <el-form-item label="权重(%)" prop="weight" v-if="!rowData.asItem">
           <el-input 
@@ -160,8 +161,8 @@
 <script>
 import ApproveLogDialog from './btnApproveLog.vue'
 import CopyItemDialog from './btnCopyItem.vue'
-import { getPerformance,fillinFinish,selfestimate} from "@/api/business/ehr/pm/performance";
-import { getPerformanceItem,addPerformanceItem,updatePerformanceItem,batchUpdatePerformanceItem,delPerformanceItem} from "@/api/business/ehr/pm/performanceitem";
+import { getPerformance,fillinFinish,selfestimate,copyItem} from "@/api/business/ehr/pm/performance";
+import { getPerformanceItem,addPerformanceItem,updatePerformanceItem,delPerformanceItem} from "@/api/business/ehr/pm/performanceitem";
 
 export default {
   name: 'detail',
@@ -368,19 +369,20 @@ export default {
       }
     },
     //设置明细
-    setItems(items){
-      console.log(111);
-      items.forEach((e) => {
-        e.id = null;
-        e.standard = null;
-        e.selfScoring = null;
-        e.selfComment = null;
-        e.leaderScoring = null;
-        e.leaderComment = null;
-        e.weightedScore = null;
-      });
-      this.form.performanceItem = items;
-      return true;
+    async setItems(cId){
+      let params = {
+        id : this.id,
+        cId : cId
+      }
+      let res = await copyItem(params);
+      if("200" == res.code){
+        this.$modal.msgSuccess("复制成功");
+        this.fetchPerformance(this.id);
+      }
+    },
+    //选择加减分项后
+    handleCheckedChange(value){
+      this.rowData.weight = value ? 0 : null;
     },
   }
 }

+ 8 - 5
src/views/business/ehr/pm/performance/index.vue

@@ -238,10 +238,14 @@ export default {
     //查看当月绩效
     async btnCurrentMonth(){
       let res = await getCurrentMonthId();
-      this.rowId = res.id;
-      this.page = 'add';
-      this.ids = [res.id];
-      this.isList = false;
+      if(!res.id){
+        this.$modal.msgSuccess("未查询到本月绩效!");
+      }else{
+        this.rowId = res.id;
+        this.page = 'add';
+        this.ids = [res.id];
+        this.isList = false;
+      }
     },
     //查看下月绩效
     async btnNextMonth(){
@@ -254,7 +258,6 @@ export default {
         this.ids = [res.id];
         this.isList = false;
       }
-      
     },
     //查询周期列表
     getlistStage() {

+ 40 - 10
src/views/business/ehr/pm/psnrelation/detail.vue

@@ -37,9 +37,9 @@
           </el-table-column>
           <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
             <template slot-scope="scope">
-              <el-button size="mini" type="text" @click="btnMoveUp(scope.row)">上移</el-button>
-              <el-button size="mini" type="text" @click="btnMoveDown(scope.row)">下移</el-button>
-              <el-button size="mini" type="text" @click="btnDelete(scope.row)">删行</el-button>
+              <el-button size="mini" type="text" @click="btnMoveUp(scope.row, scope.$index)">上移</el-button>
+              <el-button size="mini" type="text" @click="btnMoveDown(scope.row, scope.$index)">下移</el-button>
+              <el-button size="mini" type="text" @click="btnDelete(scope.$index, scope.row)">删行</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -72,6 +72,8 @@ export default {
       id:null,
       //表单
       form:{},
+      //删除的子表数据
+      delItems:[],
       //表单校验规则
       formRules:{
       },
@@ -111,19 +113,44 @@ export default {
     },
     //新增
     btnAddRow(){
-      this.form.psnrelationItem.push({delFlag: 0});
+      this.form.psnrelationItem.push({psnrelationId: this.id,delFlag: 0});
     },
     //上移
-    btnMoveUp(){
-
+    btnMoveUp(row, index){
+      if (index > 0) {
+        let upData = this.form.psnrelationItem[index - 1];
+        this.form.psnrelationItem.splice(index - 1, 1);
+        this.form.psnrelationItem.splice(index, 0, upData);
+      } else {
+        this.$message({
+            message: '已经是第一条,上移失败',
+            type: 'warning'
+        });
+      }
     },
     //下移
-    btnMoveDown(){
-
+    btnMoveDown(row, index){
+      if ((index + 1) == this.form.psnrelationItem.length) {
+        this.$message({
+            message: '已经是最后一条,下移失败',
+            type: 'warning'
+        });
+      } else {
+        let downData = this.form.psnrelationItem[index + 1];
+        this.form.psnrelationItem.splice(index + 1, 1);
+        this.form.psnrelationItem.splice(index, 0, downData);
+      }
     },
     //删除
-    btnDelete(){
-
+    btnDelete(index){
+      console.log('index',index);
+      this.form.psnrelationItem[index].delFlag = '2';
+      console.log('this.form.psnrelationItem',this.form.psnrelationItem);
+      if(this.form.psnrelationItem[index].id){
+        this.delItems.push(this.form.psnrelationItem[index]);
+      }
+      console.log('this.delItems',this.delItems);
+      this.form.psnrelationItem.splice(index, 1);
     },
     //修改
     btnEdit(){
@@ -140,8 +167,11 @@ export default {
     },
     //保存
     btnSave(){
+      this.form.psnrelationItem.push(...this.delItems);
+      this.form.psnrelationItem = this.form.psnrelationItem.filter(e => e.staff);
       savePsnrelation(this.form).then(response => {
         this.$modal.msgSuccess("保存成功");
+        this.fetchPsnrelation(this.id);
         this.pageState = "see";
       });
     },

+ 12 - 4
src/views/business/ehr/pm/verify/index.vue

@@ -22,9 +22,9 @@
           <el-descriptions-item label="评估人编号">{{form.startTime}}</el-descriptions-item>
           <el-descriptions-item label="评估人姓名">{{form.deadlineTime}}</el-descriptions-item>
         </el-descriptions>
-        <div style="float:right">
+        <!-- <div style="float:right">
           <el-button size="mini" @click="btnUnfold">{{isUnfold == true ? "收起" : "展开"}}</el-button>
-        </div>
+        </div> -->
         <el-table size="mini"  :data="form.performanceItem" show-summary :summary-method="getSummaries">
           <el-table-column width="100" :show-overflow-tooltip="!isUnfold" label="评估方面" align="center" prop="aspect">
             <template slot-scope="scope">
@@ -32,14 +32,22 @@
             </template>
           </el-table-column>
           <el-table-column width="100" :show-overflow-tooltip="!isUnfold" label="评估指标" align="center" prop="target" />
-          <el-table-column :show-overflow-tooltip="!isUnfold" label="评估说明" align="center" prop="instructions" />
+          <el-table-column :show-overflow-tooltip="!isUnfold" label="评估说明" align="center" prop="instructions">
+            <template slot-scope="scope">
+              <div style="white-space: pre-wrap;text-align: left">{{scope.row.instructions}}</div>
+            </template>
+          </el-table-column>
           <el-table-column width="100" label="角色" align="center" prop="role">
             <template slot-scope="scope">
               <dict-tag :options="dict.type.ehr_pm_role" :value="scope.row.role"/>
             </template>
           </el-table-column>
           <el-table-column width="80" label="权重" align="center" prop="weight"/>
-          <el-table-column :show-overflow-tooltip="!isUnfold" label="绩效标准" align="center" prop="standard" />
+          <el-table-column :show-overflow-tooltip="!isUnfold" label="绩效标准" align="center" prop="standard">
+            <template slot-scope="scope">
+              <div style="white-space: pre-wrap;text-align: left">{{scope.row.standard}}</div>
+            </template>
+          </el-table-column>
           <el-table-column width="100" label="数据来源" align="center" prop="source" />
         </el-table>
       </div>

+ 13 - 25
src/views/ehrentrance.vue

@@ -4,7 +4,7 @@
 </template>
 
 <script>
-import { setToken,getToken } from '@/utils/auth'
+import { setToken } from '@/utils/auth'
 import { ehrLogin } from '@/api/sso/ssoLogin';
 export default {
   data () {
@@ -20,31 +20,19 @@ export default {
   },
   methods: {
     jump() {
-      var code = this.GetQueryString('code')
-      var jumpPath = this.GetQueryString('path')
-      let str = jumpPath + window.location.search;
-      if(getToken()){
-        this.$router.push({ path: str});
-      }else{
-        ehrLogin(code).then(res => {
-          if (res.code === 200) {
-            let token = res.token
-            setToken(token);
-            this.$store.commit('SET_TOKEN', token)
-            this.$store.dispatch("GetInfo").then(() => {})
-            console.log("str", str)
-            this.$store.dispatch("GenerateRoutes").then(
-              this.$router.push({ path: str}).catch(()=>{})
-            )
-          }
-        })
-      }
+      let query = this.$route.query;
+      let str = query.path + window.location.search;
+      ehrLogin(query.code).then(res => {
+        if (res.code === 200) {
+          let token = res.token;
+          setToken(token);
+          this.$store.commit('SET_TOKEN', token)
+          this.$store.dispatch("GetInfo").then(
+            this.$router.push({ path: str})
+          )
+        }
+      })
     },
-    GetQueryString(name) {
-      var  reg = new  RegExp( "(^|&)" + name + "=([^&]*)(&|$)" );
-      var  r = window.location.search.substr(1).match(reg);
-      if (r!= null ) return   unescape(r[2]); return  null ;
-    }
   }
 }
 </script>