|
@@ -93,10 +93,17 @@
|
|
|
<span style="color:#b5b7bb;padding-left:10px;">选中的部门可查看或领取任务</span>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <div style="margin-left: 80px; margin-bottom: 8px;">以天为单位,每逾期一天扣分</div>
|
|
|
- <el-form-item label="逾期扣分" prop="timeout_deduction_point">
|
|
|
- <el-input v-model="formData.timeout_deduction_point" oninput="value=value.replace(/[^\d]/g,'')" placeholder="请输入数值"></el-input>
|
|
|
+ <div style="margin-left: 80px; margin-bottom: 8px;">以天为单位,每 提前/逾期 一天 加分/扣分</div>
|
|
|
+ <el-form-item label="提前奖分" prop="ahead_award_point">
|
|
|
+ <el-input v-model="formData.ahead_award_point" oninput="value=value.replace(/[^\d]/g,'')" placeholder="请输入每日奖分" style="width: 150px;"></el-input> 分/每天,
|
|
|
+ 奖分上限 <el-input v-model="formData.ahead_award_point_limit" oninput="value=value.replace(/[^\d]/g,'')" placeholder="请输入奖分上限" style="width: 150px;"></el-input> 分
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="逾期扣分" prop="timeout_deduction_point" >
|
|
|
+ <el-input v-model="formData.timeout_deduction_point" oninput="value=value.replace(/[^\d]/g,'')" placeholder="请输入每日扣分" style="width: 150px;"></el-input> 分/每天,
|
|
|
+ 扣分上限 <el-input v-model="formData.timeout_deduction_point_limit" oninput="value=value.replace(/[^\d]/g,'')" placeholder="请输入扣分上限" style="width: 150px;"></el-input> 分
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-show="false" prop="ahead_award_point_limit" ></el-form-item>
|
|
|
+ <el-form-item v-show="false" prop="timeout_deduction_point_limit" ></el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="sub('formData')">确认修改</el-button>
|
|
@@ -150,6 +157,9 @@ export default {
|
|
|
reviewer_id: '',
|
|
|
task_cycle: 0,
|
|
|
timeout_deduction_point: null,
|
|
|
+ timeout_deduction_point_limit: null,
|
|
|
+ ahead_award_point: null,
|
|
|
+ ahead_award_point_limit: null,
|
|
|
dept_ids: null
|
|
|
},
|
|
|
point_types: [],
|
|
@@ -273,12 +283,12 @@ export default {
|
|
|
{ id: this.rewardTaskAmendData.reviewer_id, img_url: this.rewardTaskAmendData.img_url, name: this.rewardTaskAmendData.reviewer_name }
|
|
|
];
|
|
|
|
|
|
- if (this.rewardTaskAmendData.point_config.timeout_deduction_point != '0') {
|
|
|
- //逾期扣分/月
|
|
|
- this.formData.timeout_deduction_point = this.rewardTaskAmendData.point_config.timeout_deduction_point;
|
|
|
- } else {
|
|
|
- this.formData.timeout_deduction_point = '';
|
|
|
- }
|
|
|
+
|
|
|
+ let add = ['ahead_award_point', 'ahead_award_point_limit', 'timeout_deduction_point', 'timeout_deduction_point_limit']
|
|
|
+ add.forEach(item =>{
|
|
|
+ this.deductionPoint(item)
|
|
|
+ })
|
|
|
+
|
|
|
let department_infoName = '';
|
|
|
// avatar: "static/images/e66f.jpg"
|
|
|
// dept_id: 462
|
|
@@ -310,6 +320,13 @@ export default {
|
|
|
this.getDepartment();
|
|
|
},
|
|
|
methods: {
|
|
|
+ deductionPoint(item){
|
|
|
+ if (this.rewardTaskAmendData.point_config[item] != '0') {
|
|
|
+ this.formData[item] = this.rewardTaskAmendData.point_config[item];
|
|
|
+ } else {
|
|
|
+ this.formData[item] = '';
|
|
|
+ }
|
|
|
+ },
|
|
|
handleChange(val) {
|
|
|
let data = [];
|
|
|
for (let i in val) {
|
|
@@ -341,13 +358,24 @@ export default {
|
|
|
this.dept_name = [];
|
|
|
this.dept_selected = { dept: [], employee: [] };
|
|
|
},
|
|
|
+ ahead_timeout(item,arr,codes,code){
|
|
|
+ if(item){
|
|
|
+ if(arr){
|
|
|
+ if(Number(item) > Number(arr)){
|
|
|
+ this.$message.warning(code +'上限不能小于每日'+ code)
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.$message.warning( codes + '不为0时,'+ code +'上限不能为空')
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deletedata(data,arr){
|
|
|
+ data[arr] && data[arr] != 0 ? '' : delete data[arr]
|
|
|
+ },
|
|
|
// 提交
|
|
|
saveFun(formName) {
|
|
|
- // 没有选择重复任务的时候
|
|
|
- // /api/integral/task/publish
|
|
|
- // 选择重复任务之后
|
|
|
- // /api/integral/schedule/publish/task
|
|
|
- this.forTheTaskLoading = true;
|
|
|
let self = this;
|
|
|
let data = JSON.parse(JSON.stringify(self.formData));
|
|
|
data.task_remark ? '' : delete data.task_remark;
|
|
@@ -369,6 +397,29 @@ export default {
|
|
|
// data.task_remark?'':delete data.task_remark
|
|
|
// data.timeout_deduction_point?'':delete data.timeout_deduction_point
|
|
|
// }
|
|
|
+
|
|
|
+ if(!data.ahead_award_point && data.ahead_award_point_limit){
|
|
|
+ this.$message.warning('奖分上限不为0时每日奖分不能为空')
|
|
|
+ return
|
|
|
+ }else if(data.ahead_award_point && !data.ahead_award_point_limit){
|
|
|
+ this.$message.warning('每日奖分不为0时奖分上限不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!data.timeout_deduction_point && data.timeout_deduction_point_limit){
|
|
|
+ this.$message.warning('扣分上限不为0时每日扣分不能为空')
|
|
|
+ return
|
|
|
+ }else if(data.timeout_deduction_point && !data.timeout_deduction_point_limit){
|
|
|
+ this.$message.warning('每日扣分不为0时扣分上限不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(this.ahead_timeout(data.ahead_award_point,data.ahead_award_point_limit,'提前奖分','奖分')) return
|
|
|
+ if(this.ahead_timeout(data.timeout_deduction_point,data.timeout_deduction_point_limit,'逾期扣分','扣分')) return
|
|
|
+ let add = ['ahead_award_point', 'ahead_award_point_limit', 'timeout_deduction_point', 'timeout_deduction_point_limit']
|
|
|
+ add.forEach(item =>{
|
|
|
+ this.deletedata(data,item)
|
|
|
+ })
|
|
|
+
|
|
|
+ this.forTheTaskLoading = true;
|
|
|
self.$axios('post', '/api/integral/task/update', data)
|
|
|
.then(res => {
|
|
|
if (res.data.code == 1) {
|