|
@@ -107,9 +107,9 @@
|
|
|
</el-row>
|
|
|
<el-row v-if="workDetailData.point_config.item_info">
|
|
|
<el-col :span="4">积分</el-col>
|
|
|
- <el-col :span="19" v-show="workDetailData.point_config.item_info.min_point == workDetailData.point_config.item_info.max_point">{{ workDetailData.point_config.item_info.min_point }}</el-col>
|
|
|
+ <el-col :span="19" v-show="workDetailData.point_config.item_info.min_point == workDetailData.point_config.item_info.max_point">{{ workDetailData.point_config.item_info.min_point }} {{workDetailData.pt_name}}</el-col>
|
|
|
<el-col :span="19" v-show="workDetailData.point_config.item_info.min_point != workDetailData.point_config.item_info.max_point">
|
|
|
- {{ workDetailData.point_config.item_info.min_point }} ~ {{ workDetailData.point_config.item_info.max_point }}
|
|
|
+ {{ workDetailData.point_config.item_info.min_point }} ~ {{ workDetailData.point_config.item_info.max_point }} {{workDetailData.pt_name}}
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -126,7 +126,7 @@
|
|
|
<el-tab-pane label="工作记录" name="work">
|
|
|
<div class="flex-box">
|
|
|
<div class="flex-1"></div>
|
|
|
- <div class="fontColorF addJf" @click="isOne = true" v-if="workDetailData.employee_id == userId && workDetailData.status == 1 || workDetailData.employee_id == userId && workDetailData.status == 2">+记一条工作记录</div>
|
|
|
+ <div class="fontColorF addJf" @click="isOne = true" v-if="workDetailData.employee_id == userId && workDetailData.status < 3 ">+记一条工作记录</div>
|
|
|
</div>
|
|
|
<div class="work_box" style="padding-top:10px">
|
|
|
<div class="work_item" v-for="(item, index) in text_list" :key="index" style="margin: 0 0 15px 0">
|
|
@@ -138,7 +138,7 @@
|
|
|
<span v-if="item.point * 1 > 0">+{{ item.point }}</span>
|
|
|
<span v-if="item.point * 1 < 0">{{ item.point }}</span>
|
|
|
</div>
|
|
|
- <div class="d_date fontColorF">{{ item.time }}</div>
|
|
|
+ <div class="d_date fontColorF">{{ item.time }} <span class="delete_jfjl" v-if="workDetailData.employee_id == userId && workDetailData.status < 3 " @click="deletejf_cli(index,0)"><i class="el-icon-delete"></i></span> </div>
|
|
|
</div>
|
|
|
<div class="fontColorB" style="margin-top: 5px;">{{ item.remark }}</div>
|
|
|
</div>
|
|
@@ -153,7 +153,7 @@
|
|
|
<span v-if="point_total > 0">合计:+{{ point_total }}</span>
|
|
|
<span v-else>合计:{{ point_total }}</span>
|
|
|
</div>
|
|
|
- <div class="fontColorF addJf" @click="isIntegral = true" v-if="workDetailData.reviewer_id == userId && workDetailData.status == 1 || workDetailData.reviewer_id == userId && workDetailData.status == 2">+记分</div>
|
|
|
+ <div class="fontColorF addJf" @click="isIntegral = true" v-if="keepTheScore">+记分</div>
|
|
|
</div>
|
|
|
<div class="work_box" style="padding-top:10px">
|
|
|
<div class="work_item" v-for="(item, index) in point_list" :key="index" style="margin: 0 0 15px 0">
|
|
@@ -165,7 +165,7 @@
|
|
|
<span class="red" v-if="item.point * 1 > 0">+{{ item.point }}</span>
|
|
|
<span class="green" v-if="item.point * 1 < 0">{{ item.point }}</span>
|
|
|
</div>
|
|
|
- <div class="d_date fontColorF">{{ item.time }}</div>
|
|
|
+ <div class="d_date fontColorF">{{ item.time }} <span class="delete_jfjl" v-if="keepTheScore" @click="deletejf_cli(index,1)"><i class="el-icon-delete"></i></span> </div>
|
|
|
</div>
|
|
|
<div class="fontColorB" style="margin-top: 5px;">{{ item.remark }}</div>
|
|
|
</div>
|
|
@@ -192,7 +192,7 @@
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
<!-- 记一条 -->
|
|
|
- <el-dialog title="记一条" :close-on-click-modal="false" :visible.sync="isOne" :before-close="publicClose" width="40%">
|
|
|
+ <el-dialog title="记一条" :close-on-click-modal="false" :visible.sync="isOne" destroy-on-close :before-close="publicClose" width="40%">
|
|
|
<div class="flex-box">
|
|
|
<div style="width: 80px;">工作记录</div>
|
|
|
<el-input type="textarea" :rows="3" placeholder="请输入内容" v-model="textarea"></el-input>
|
|
@@ -203,7 +203,7 @@
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
<!-- 记分记录 -->
|
|
|
- <el-dialog title="记分" :visible.sync="isIntegral" :before-close="publicClose" width="40%" :close-on-click-modal="false">
|
|
|
+ <el-dialog title="记分" :visible.sync="isIntegral" :before-close="publicClose" width="40%" destroy-on-close :close-on-click-modal="false">
|
|
|
<el-form :model="integral" ref="integral" label-width="80px" :rules="formRules">
|
|
|
<el-form-item label="记录" prop="text" :rules="[{ required: true, message: '记录不能为空'}]">
|
|
|
<el-input type="textarea" :rows="3" v-model="integral.text"></el-input>
|
|
@@ -308,6 +308,8 @@ export default {
|
|
|
}
|
|
|
],
|
|
|
},
|
|
|
+ keepTheScore: false,
|
|
|
+ employeeMe: {},
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -318,6 +320,55 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ employee_me(data){
|
|
|
+ let params = {
|
|
|
+ id: data.employee_id
|
|
|
+ };
|
|
|
+ this.$axios('get', '/api/employee/info', params)
|
|
|
+ .then(res => {
|
|
|
+ this.employeeMe = res.data.data
|
|
|
+ this.keepTheScore = this.keepThe_score(data)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ keepThe_score(cer){
|
|
|
+ if(cer.status > 2){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if(this.userId == cer.reviewer_id){
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return this.employeeMe.employee_detail.superior_list.some(x =>{
|
|
|
+ if(this.userId == x.id){
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deletejf_cli(cor,cur){
|
|
|
+ this.$confirm('确定永久删除此项?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ let lier = cur == 1 ? this.point_list : this.text_list
|
|
|
+ let libf = cur == 1 ? this.text_list : this.point_list
|
|
|
+ lier.splice(cor,1)
|
|
|
+ let data = {
|
|
|
+ work_id: this.workDetailData.id,
|
|
|
+ process: []
|
|
|
+ }
|
|
|
+ data.process =lier.concat(libf)
|
|
|
+ if (data.process.length == 0) {
|
|
|
+ data.process = "[1]"
|
|
|
+ } else {
|
|
|
+ data.process = JSON.stringify(data.process);
|
|
|
+ }
|
|
|
+ this.$axios('post', '/api/integral/work', data).then(res =>{
|
|
|
+ if(res.data.code == 1){
|
|
|
+ this.getData();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
//记分记录
|
|
|
integralSend(formName){
|
|
|
var items = this.workDetailData.process.list || [];
|
|
@@ -334,7 +385,7 @@ export default {
|
|
|
process: [],
|
|
|
}
|
|
|
items.unshift(process);
|
|
|
- data.process = items;
|
|
|
+ data.process = JSON.stringify(items);
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.$axios('post','/api/integral/work',data).then(res => {
|
|
@@ -353,7 +404,6 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
var items = this.workDetailData.process.list || [];
|
|
|
- console.log(items)
|
|
|
var process = {
|
|
|
img_url: this.$getUserData().img_url,
|
|
|
point: 0,
|
|
@@ -367,7 +417,7 @@ export default {
|
|
|
process:[],
|
|
|
}
|
|
|
items.unshift(process);
|
|
|
- data.process=items;
|
|
|
+ data.process=JSON.stringify(items);
|
|
|
this.$axios('post', '/api/integral/work', data).then(res => {
|
|
|
if (res.data.code == 1) {
|
|
|
this.publicClose();
|
|
@@ -394,6 +444,12 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
publicClose(){
|
|
|
+ this.textarea = '';
|
|
|
+ this.integral = {
|
|
|
+ text: '',
|
|
|
+ num: 0,
|
|
|
+ type: "1",
|
|
|
+ };
|
|
|
this.isSlider = false;
|
|
|
this.isOne = false;
|
|
|
this.isIntegral = false;
|
|
@@ -413,7 +469,7 @@ export default {
|
|
|
this.$axios('get', this.getDataUrl, data).then(res => {
|
|
|
if (res.data.code == 1) {
|
|
|
this.workDetailData = res.data.data;
|
|
|
- this.workDetailData = res.data.data
|
|
|
+ this.employee_me(res.data.data)
|
|
|
this.text_list = []
|
|
|
this.point_list = []
|
|
|
this.point_total = 0
|
|
@@ -539,4 +595,12 @@ export default {
|
|
|
content: "-";
|
|
|
color: #67c23a;
|
|
|
}
|
|
|
+.delete_jfjl{
|
|
|
+ transition: .3s all;
|
|
|
+ cursor: pointer;
|
|
|
+ margin: 0 0 0 10px;
|
|
|
+}
|
|
|
+.delete_jfjl:hover{
|
|
|
+ color: #26a2ff;
|
|
|
+}
|
|
|
</style>
|