347617796@qq.com 3 years ago
parent
commit
d4e21d6b1f

+ 1 - 1
app.acss

@@ -103,7 +103,7 @@
 		left: 0;
 		right: 0;
 		bottom: 0;
-		z-index: 0;
+		z-index: 1;
 }
 
 	.tab {

+ 2 - 2
app.js

@@ -1,8 +1,8 @@
 import { showToast } from './utils/feedback'
 import { formatTime, arrRemoveObj, getTypeItem } from './utils/util'
 
-const baseUrl = "https://test-ding.g107.com/";//测试
-// const baseUrl = "https://ding.insys.g107.com/";//正式
+// const baseUrl = "https://test-ding.g107.com/";//测试
+const baseUrl = "https://ding.insys.g107.com/";//正式
 var that;
 var yearArr = [];
 var year = formatTime(new Date()).year;

+ 1 - 0
pages/deploy/integralRule/integralRule.js

@@ -124,6 +124,7 @@ Page({
         allItems: list,
         allTree: rule_tree,
       })
+      console.log(this.data.item_list,this.data.rule_tree)
     })
   },
 });

+ 5 - 0
pages/statistics/assaign/assaign.acss

@@ -12,6 +12,11 @@
   width: 160rpx;
   font-size: 32rpx
 }
+.label2{
+  position: relative;
+  width: 200rpx;
+  font-size: 32rpx
+}
 .isBt::before{
   position: absolute;
   content: "*";

+ 19 - 5
pages/statistics/assaign/assaign.axml

@@ -41,9 +41,14 @@
         </view>
       </view>
 
-      <view class="flex-box flex-v-ce li  margin-bottom" catchTap="openDate" data-index="{{index}}">
+      <view class="flex-box flex-v-ce li  margin-bottom">
         <view class="label isBt">截止时间</view>
-        <view class="flex-1">{{items.expire_time}}</view>
+        <view class="flex-1" a:if="{{items.task_cycle==0}}" catchTap="openDate">{{items.expire_time}}</view>
+        <view class="flex-1" a:else>
+          <picker onChange="activeDate" value="{{columnsIndex}}" range="{{columnsArray}}" range-key="name">
+            <text >{{columnsArray[columnsIndex].name}}</text>
+          </picker>
+        </view>
         <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
       </view>
       <view class="li">
@@ -59,10 +64,19 @@
         <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
       </view>
       <view class="flex-box li" style="padding:15rpx 28rpx;">
-        <view class="label" style="position: relative;top:10rpx;">逾期扣分</view>
+        <view class="label2" style="position: relative;top:10rpx;">提前奖分(天)</view>
+        <text class="red" style="position: relative;top:10rpx;">+</text>
+        <view class="flex-box-ce flex-1">
+          <input value="{{items.ahead_award_point}}" data-name="ahead_award_point" placeholder="提前奖多少分" type="number" onInput="bindKeyInput2"/>
+          <input style="border-left:1px solid #f1f1f1" data-name="ahead_award_point_limit" value="{{items.ahead_award_point_limit}}"  placeholder="奖分上限" type="number" onInput="bindKeyInput2"/>
+        </view>
+      </view>
+      <view class="flex-box li" style="padding:15rpx 28rpx;">
+        <view class="label2" style="position: relative;top:10rpx;">逾期扣分(天)</view>
         <text class="green" style="position: relative;top:10rpx;">-</text>
-        <view class="flex-1">
-          <input value="{{items.timeout_deduction_point}}"  placeholder="每逾期一天扣多少分" type="number" onInput="bindKeyInput2"  class="flex-1"/>
+        <view class="flex-1 flex-box-ce">
+          <input value="{{items.timeout_deduction_point}}" data-name="timeout_deduction_point" placeholder="逾期扣多少分" type="number" onInput="bindKeyInput2"/>
+           <input style="border-left:1px solid #f1f1f1" data-name="timeout_deduction_point_limit"  value="{{items.timeout_deduction_point_limit}}"  placeholder="扣分上限" type="number" onInput="bindKeyInput2"/>
         </view>
       </view>
     </view>

+ 72 - 17
pages/statistics/assaign/assaign.js

@@ -16,11 +16,15 @@ Page({
       file_list: [],//附件地址列表
       reviewer_id: '',//审批者id
       revieweName: '',
-      timeout_deduction_point: '',//逾期扣分/月
+      timeout_deduction_point: '',//逾期扣分/天
+      timeout_deduction_point_limit:'',//逾期扣分上限
+      ahead_award_point: '',//提前奖分/天
+      ahead_award_point_limit:'',//提前奖分上限
       qualified: '',//
       cate_id: 0,// 共组分类id   
-      task_cycle: 0,//重复周期
-      task_expire_day: 1
+
+      task_cycle: 0,//任务发布周期 1-天 2-周 3-月
+      task_expire_day: 1,//任务截至天数
     },
     reviewerObj: [],//默认审批人
     objectArray: [
@@ -42,20 +46,43 @@ Page({
       },
     ],
     arrIndex: 0,
-    popupCx: ''
+    popupCx: '',
+    point_limit:0,
+    columnsIndex: 0,//条件选择
+    columnsArray: [{name:'01:00', value: 1}, {name:'02:00', value: 2}, {name:'03:00', value: 3}, {name:'04:00', value: 4}, {name:'05:00', value: 5}, {name:'06:00', value: 6}, {name:'07:00', value: 7}, {name:'08:00', value: 8}, {name:'09:00', value: 9}, {name:'10:00', value: 10}, {name:'11:00', value: 11}, {name:'12:00', value: 12}, {name:'13:00', value: 13}, {name:'14:00', value: 14}, {name:'15:00', value: 15}, {name:'16:00', value: 16}, {name:'17:00', value: 17}, {name:'18:00', value: 18}, {name:'19:00', value: 19}, {name:'20:00', value: 20}, {name:'21:00', value: 21}, {name:'22:00', value: 22}, {name:'23:00', value: 23}, {name:'24:00', value: 24}],
+    columns1: [{name:'01:00', value: 1}, {name:'02:00', value: 2}, {name:'03:00', value: 3}, {name:'04:00', value: 4}, {name:'05:00', value: 5}, {name:'06:00', value: 6}, {name:'07:00', value: 7}, {name:'08:00', value: 8}, {name:'09:00', value: 9}, {name:'10:00', value: 10}, {name:'11:00', value: 11}, {name:'12:00', value: 12}, {name:'13:00', value: 13}, {name:'14:00', value: 14}, {name:'15:00', value: 15}, {name:'16:00', value: 16}, {name:'17:00', value: 17}, {name:'18:00', value: 18}, {name:'19:00', value: 19}, {name:'20:00', value: 20}, {name:'21:00', value: 21}, {name:'22:00', value: 22}, {name:'23:00', value: 23}, {name:'24:00', value: 24}],
+    columns2: [{name: '周一', value: 1}, {name: '周二', value: 2}, {name: '周三', value: 3}, {name: '周四', value: 4}, {name: '周五', value: 5}, {name: '周六', value: 6}, {name: '周日', value: 7}],
+    columns3: [{name:'1号', value: 1},{name:'2号', value: 2},{name:'3号', value: 3},{name:'4号', value: 4},{name:'5号', value: 5},{name:'6号', value: 6},{name:'7号', value: 7},{name:'8号', value: 8},{name:'9号', value: 9},{name:'10号', value: 10},{name:'11号', value: 11},{name:'12号', value: 12},{name:'13号', value: 13},{name:'14号', value: 14},{name:'15号', value: 15},{name:'16号', value: 16},{name:'17号', value: 17},{name:'18号', value: 18},{name:'19号', value: 19},{name:'20号', value: 20},{name:'21号', value: 21},{name:'22号', value: 22},{name:'23号', value: 23},{name:'24号', value: 24},{name:'25号', value: 25},{name:'26号', value: 26},{name:'27号', value: 27},{name:'28号', value: 28},{name:'29号', value: 29},{name:'30号', value: 30},{name:'31号', value: 31}],
+
   },
   onLoad() {
     that = this;
     dd.setNavigationBar({ title: "指派任务" });
     that.setData({
-      types: app.globalData.types
+      types: app.globalData.types,
+      [`items.expire_time`]: app.globalData.day+' 18:00',
+      point_limit:app.globalData.userData.point_config.point_limit
     })
   },
+  activeDate(e){
+    this.setData({
+      columnsIndex: e.detail.value,
+      [`items.task_expire_day`]:parseInt(e.detail.value)+1
+    });
+  },
   bindObjPickerChange(e) {
     this.setData({
+      columnsIndex:0,
+      [`items.task_expire_day`]:1,
       arrIndex: e.detail.value,
       [`items.task_cycle`]: e.detail.value
     });
+    // 跟不同重复周期,切换数据源
+    let str='columns'+e.detail.value;
+    let columnsArray=this.data[str];
+    this.setData({
+      columnsArray:columnsArray,
+    });
   },
   openType(e) {
     var id = e.target.dataset.id;
@@ -79,9 +106,33 @@ Page({
   },
   //积分输入
   bindKeyInput2(e) {
-    var point = `items.timeout_deduction_point`;
+    var name = e.target.dataset.name;
+    let value=e.detail.value;
+    var point = `items.${name}`;
+    var pointIimit= that.data.point_limit[1].point;
+    if(pointIimit!=0&&pointIimit!=-1){
+      if(name=='timeout_deduction_point'||name=='ahead_award_point'){
+          pointIimit=pointIimit*1;
+          if(value>pointIimit){
+              this.showToast('分值不能超过您的奖扣分权限');
+                this.setData({
+                  [point]: '',
+                });
+              return false
+          }
+      }else{
+          pointIimit=pointIimit*10;
+          if(value>pointIimit){
+              this.showToast('上限不能超过'+pointIimit+'分');
+                this.setData({
+                  [point]: '',
+                });
+              return false
+          }
+      }
+    }
     this.setData({
-      [point]: e.detail.value,
+      [point]: value,
     });
   },
 
@@ -184,7 +235,6 @@ Page({
               that.setData({
                 [files_box]: files
               });
-              console.log(that.data.items);
               app.globalData.showToast("已上传");
             }
           },
@@ -229,14 +279,13 @@ Page({
     app.globalData.showToast(text);
   },
   formSubmit() {
-    var items = this.data.items;
-    console.log(items);
+    var items =JSON.parse(JSON.stringify(this.data.items));
     if (!items.task_name) {
       this.showToast('请输入任务内容')
       return;
     }
     if (!items.base_point) {
-      this.showToast('请输入任务分')
+      this.showToast('请输入任务分')
       return;
     }
     if (items.targets.length == 0) {
@@ -247,12 +296,12 @@ Page({
       this.showToast('请选择审批人')
       return;
     }
-    if (!items.expire_time) {
-      this.showToast('请选择截止时间')
-      return;
+    if (items.task_cycle == 0) {
+      if (!items.expire_time) {
+        this.showToast('请选择截止时间')
+        return;
+      }
     }
-    // items.file_list=JSON.stringify(items.file_list);
-    // items.targets=JSON.stringify(items.targets);
     if(!items.task_remark){
       delete items.task_remark
     }
@@ -261,13 +310,19 @@ Page({
     }
     items.file_list=items.file_list.toString();
     items.targets=items.targets.toString();
-    this.setData({ disabled: true });
     var url;
     if (items.task_cycle == 0) {
+        delete items.task_cycle
+        delete items.task_expire_day
         url = '/api/integral/work/publish'
     } else {
+        delete items.expire_time
+        delete items.package_id
+        delete items.weight
         url ='/api/integral/schedule/publish/work'
     }
+    this.setData({ disabled: true });
+    console.log(JSON.stringify(items))
     app.$post(url,items).then((res) => {
         this.showToast(res.data.msg);
         setTimeout(() => {

+ 11 - 11
pages/statistics/assaign_set/assaign_set.axml

@@ -49,20 +49,20 @@
       <view class="li">
         <textarea maxlength="100" value="{{items.task_remark}}" onInput="bindTextAreaBlur2" placeholder="请输入任务描述" data-index="{{index}}"></textarea>
       </view>
-      <!-- <view class="flex-box flex-v-ce li">
-        <view class="label">重复周期</view>
-        <view class="flex-1">
-          <picker onChange="bindObjPickerChange" value="{{arrIndex}}" range="{{objectArray}}" range-key="name">
-              <view class="row-extra">{{objectArray[arrIndex].name}}</view>
-          </picker>
+      <view class="flex-box li" style="padding:15rpx 28rpx;">
+        <view class="label2" style="position: relative;top:10rpx;">提前奖分(天)</view>
+        <text class="red" style="position: relative;top:10rpx;">+</text>
+        <view class="flex-box-ce flex-1">
+          <input value="{{items.ahead_award_point}}" data-name="ahead_award_point" placeholder="提前奖多少分" type="number" onInput="bindKeyInput2"/>
+          <input style="border-left:1px solid #f1f1f1" data-name="ahead_award_point_limit" value="{{items.ahead_award_point_limit}}"  placeholder="奖分上限" type="number" onInput="bindKeyInput2"/>
         </view>
-        <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
-      </view> -->
+      </view>
       <view class="flex-box li" style="padding:15rpx 28rpx;">
-        <view class="label" style="position: relative;top:10rpx;">逾期扣分</view>
+        <view class="label2" style="position: relative;top:10rpx;">逾期扣分(天)</view>
         <text class="green" style="position: relative;top:10rpx;">-</text>
-        <view class="flex-1">
-          <input value="{{items.timeout_deduction_point}}"  placeholder="每逾期一天扣多少分" type="number" onInput="bindKeyInput2"  class="flex-1"/>
+        <view class="flex-1 flex-box-ce">
+          <input value="{{items.timeout_deduction_point}}" data-name="timeout_deduction_point" placeholder="逾期扣多少分" type="number" onInput="bindKeyInput2"/>
+           <input style="border-left:1px solid #f1f1f1" data-name="timeout_deduction_point_limit"  value="{{items.timeout_deduction_point_limit}}"  placeholder="扣分上限" type="number" onInput="bindKeyInput2"/>
         </view>
       </view>
     </view>

+ 38 - 6
pages/statistics/assaign_set/assaign_set.js

@@ -16,7 +16,10 @@ Page({
       file_list: [],//附件地址列表
       reviewer_id: '',//审批者id
       revieweName: '',
-      timeout_deduction_point: '',//逾期扣分/月
+      timeout_deduction_point: '',//逾期扣分/天
+      timeout_deduction_point_limit:'',//逾期扣分上限
+      ahead_award_point: '',//提前奖分/天
+      ahead_award_point_limit:'',//提前奖分上限
       qualified: '',//
       cate_id: 0,// 共组分类id   
       task_cycle: 0,//重复周期
@@ -41,7 +44,8 @@ Page({
         name: '每月重复',
       },
     ],
-    arrIndex: 0
+    arrIndex: 0,
+    point_limit:0,
   },
   onLoad(e) {
     that = this;
@@ -51,6 +55,7 @@ Page({
       this.setData({
         reviewerObj:[{name:item.reviewer_name,id:item.reviewer_id}],
         users:[{name:item.employee_name,id:item.employee_id}],
+        point_limit:app.globalData.userData.point_config.point_limit,
         items: {
           id:item.id,
           targets: [item.employee_id],//工作执行者列表,以逗号分割的字符串或直接传入数组
@@ -64,7 +69,10 @@ Page({
           file_list: item.task_file_list,//附件地址列表
           reviewer_id:item.reviewer_id,//审批者id
           revieweName:item.reviewer_name,
-          timeout_deduction_point: item.point_config.timeout_deduction_point,//逾期扣分/月
+          timeout_deduction_point: item.point_config.timeout_deduction_point,//逾期扣分/天
+          timeout_deduction_point_limit:item.point_config.timeout_deduction_point_limit,//逾期扣分上限
+          ahead_award_point: item.point_config.ahead_award_point,//提前奖分/天
+          ahead_award_point_limit:item.point_config.ahead_award_point_limit,//提前奖分上限
           qualified:item.point_config.base_point,//
           cate_id: 0,// 共组分类id   
           task_cycle:0,//重复周期
@@ -104,9 +112,33 @@ Page({
   },
   //积分输入
   bindKeyInput2(e) {
-    var point = `items.timeout_deduction_point`;
+    var name = e.target.dataset.name;
+    let value=e.detail.value;
+    var point = `items.${name}`;
+    var pointIimit= that.data.point_limit[1].point;
+    if(pointIimit!=0&&pointIimit!=-1){
+      if(name=='timeout_deduction_point'||name=='ahead_award_point'){
+          pointIimit=pointIimit*1;
+          if(value>pointIimit){
+              this.showToast('分值不能超过您的奖扣分权限');
+                this.setData({
+                  [point]: '',
+                });
+              return false
+          }
+      }else{
+          pointIimit=pointIimit*10;
+          if(value>pointIimit){
+              this.showToast('上限不能超过'+pointIimit+'分');
+                this.setData({
+                  [point]: '',
+                });
+              return false
+          }
+      }
+    }
     this.setData({
-      [point]: e.detail.value,
+      [point]: value,
     });
   },
 
@@ -263,7 +295,7 @@ Page({
       return;
     }
     if (!items.base_point) {
-      this.showToast('请输入任务分')
+      this.showToast('请输入任务分')
       return;
     }
     if (items.targets.length == 0) {

+ 5 - 0
pages/statistics/offerAreward/offerAreward.acss

@@ -12,6 +12,11 @@
   width: 160rpx;
   font-size: 32rpx
 }
+.label2{
+  position: relative;
+  width: 200rpx;
+  font-size: 32rpx
+}
 .isBt::before{
   position: absolute;
   content: "*";

+ 19 - 5
pages/statistics/offerAreward/offerAreward.axml

@@ -31,9 +31,14 @@
           </view>
         </view>
       </view>
-      <view class="flex-box flex-v-ce li  margin-bottom" catchTap="openDate" data-index="{{index}}">
+      <view class="flex-box flex-v-ce li  margin-bottom">
         <view class="label isBt">截止时间</view>
-        <view class="flex-1">{{items.expire_time}}</view>
+        <view class="flex-1" a:if="{{items.task_cycle==0}}" catchTap="openDate">{{items.expire_time}}</view>
+        <view class="flex-1" a:else>
+          <picker onChange="activeDate" value="{{columnsIndex}}" range="{{columnsArray}}" range-key="name">
+            <text >{{columnsArray[columnsIndex].name}}</text>
+          </picker>
+        </view>
         <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
       </view>
       <view class="li">
@@ -49,10 +54,19 @@
         <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
       </view>
       <view class="flex-box li" style="padding:15rpx 28rpx;">
-        <view class="label" style="position: relative;top:10rpx;">逾期扣分</view>
+        <view class="label2" style="position: relative;top:10rpx;">提前奖分(天)</view>
+        <text class="red" style="position: relative;top:10rpx;">+</text>
+        <view class="flex-box-ce flex-1">
+          <input value="{{items.ahead_award_point}}" data-name="ahead_award_point" placeholder="提前奖多少分" type="number" onInput="bindKeyInput2"/>
+          <input style="border-left:1px solid #f1f1f1" data-name="ahead_award_point_limit" value="{{items.ahead_award_point_limit}}"  placeholder="奖分上限" type="number" onInput="bindKeyInput2"/>
+        </view>
+      </view>
+      <view class="flex-box li" style="padding:15rpx 28rpx;">
+        <view class="label2" style="position: relative;top:10rpx;">逾期扣分(天)</view>
         <text class="green" style="position: relative;top:10rpx;">-</text>
-        <view class="flex-1">
-          <input value="{{item.point2}}" placeholder="每逾期一天扣多少分" type="number" onInput="bindKeyInput2" class="flex-1"/>
+        <view class="flex-box-ce flex-1">
+          <input value="{{items.timeout_deduction_point}}" data-name="timeout_deduction_point" placeholder="逾期扣多少分" type="number" onInput="bindKeyInput2"/>
+          <input style="border-left:1px solid #f1f1f1" data-name="timeout_deduction_point_limit"  value="{{items.timeout_deduction_point_limit}}"  placeholder="扣分上限" type="number" onInput="bindKeyInput2"/>
         </view>
       </view>
       <view class="flex-box flex-v-ce li" data-num="1" catchTap="openSelect">

+ 69 - 16
pages/statistics/offerAreward/offerAreward.js

@@ -13,11 +13,16 @@ Page({
       file_list: [],//附件地址列表
       reviewer_id: '',//审批者id
       revieweName: '',
-      timeout_deduction_point: '',//逾期扣分/月
-      task_cycle: 0,
-      task_expire_day: 1,
+      timeout_deduction_point: '',//逾期扣分/天
+      timeout_deduction_point_limit:'',//逾期扣分上限
+      ahead_award_point: '',//提前奖分/天
+      ahead_award_point_limit:'',//提前奖分上限
+
+      task_cycle: 0,//任务发布周期 1-天 2-周 3-月
+      task_expire_day: 1,//任务截至天数
+
       task_type:1,
-      popupCx: ''
+      popupCx: '',
     },
     reviewerObj: [],//默认审批人
     objectArray: [
@@ -40,19 +45,41 @@ Page({
     ],
     arrIndex: 0,
     defaultSection: [],//选择的部门
+    point_limit:0,
+    columnsIndex: 0,//条件选择
+    columnsArray: [{name:'01:00', value: 1}, {name:'02:00', value: 2}, {name:'03:00', value: 3}, {name:'04:00', value: 4}, {name:'05:00', value: 5}, {name:'06:00', value: 6}, {name:'07:00', value: 7}, {name:'08:00', value: 8}, {name:'09:00', value: 9}, {name:'10:00', value: 10}, {name:'11:00', value: 11}, {name:'12:00', value: 12}, {name:'13:00', value: 13}, {name:'14:00', value: 14}, {name:'15:00', value: 15}, {name:'16:00', value: 16}, {name:'17:00', value: 17}, {name:'18:00', value: 18}, {name:'19:00', value: 19}, {name:'20:00', value: 20}, {name:'21:00', value: 21}, {name:'22:00', value: 22}, {name:'23:00', value: 23}, {name:'24:00', value: 24}],
+    columns1: [{name:'01:00', value: 1}, {name:'02:00', value: 2}, {name:'03:00', value: 3}, {name:'04:00', value: 4}, {name:'05:00', value: 5}, {name:'06:00', value: 6}, {name:'07:00', value: 7}, {name:'08:00', value: 8}, {name:'09:00', value: 9}, {name:'10:00', value: 10}, {name:'11:00', value: 11}, {name:'12:00', value: 12}, {name:'13:00', value: 13}, {name:'14:00', value: 14}, {name:'15:00', value: 15}, {name:'16:00', value: 16}, {name:'17:00', value: 17}, {name:'18:00', value: 18}, {name:'19:00', value: 19}, {name:'20:00', value: 20}, {name:'21:00', value: 21}, {name:'22:00', value: 22}, {name:'23:00', value: 23}, {name:'24:00', value: 24}],
+    columns2: [{name: '周一', value: 1}, {name: '周二', value: 2}, {name: '周三', value: 3}, {name: '周四', value: 4}, {name: '周五', value: 5}, {name: '周六', value: 6}, {name: '周日', value: 7}],
+    columns3: [{name:'1号', value: 1},{name:'2号', value: 2},{name:'3号', value: 3},{name:'4号', value: 4},{name:'5号', value: 5},{name:'6号', value: 6},{name:'7号', value: 7},{name:'8号', value: 8},{name:'9号', value: 9},{name:'10号', value: 10},{name:'11号', value: 11},{name:'12号', value: 12},{name:'13号', value: 13},{name:'14号', value: 14},{name:'15号', value: 15},{name:'16号', value: 16},{name:'17号', value: 17},{name:'18号', value: 18},{name:'19号', value: 19},{name:'20号', value: 20},{name:'21号', value: 21},{name:'22号', value: 22},{name:'23号', value: 23},{name:'24号', value: 24},{name:'25号', value: 25},{name:'26号', value: 26},{name:'27号', value: 27},{name:'28号', value: 28},{name:'29号', value: 29},{name:'30号', value: 30},{name:'31号', value: 31}],
   },
   onLoad() {
     that = this;
     dd.setNavigationBar({ title: "发布悬赏任务" });
     that.setData({
-      types: app.globalData.types
+      types: app.globalData.types,
+      [`items.expire_time`]: app.globalData.day+' 18:00',
+      point_limit:app.globalData.userData.point_config.point_limit
     })
   },
+  activeDate(e){
+    this.setData({
+      columnsIndex: e.detail.value,
+      [`items.task_expire_day`]:parseInt(e.detail.value)+1
+    });
+  },
   bindObjPickerChange(e) {
     this.setData({
+      columnsIndex:0,
+      [`items.task_expire_day`]:1,
       arrIndex: e.detail.value,
       [`items.task_cycle`]: e.detail.value
     });
+    // 跟不同重复周期,切换数据源
+    let str='columns'+e.detail.value;
+    let columnsArray=this.data[str];
+    this.setData({
+      columnsArray:columnsArray,
+    });
   },
   openType(e) {
     var id = e.target.dataset.id;
@@ -75,9 +102,33 @@ Page({
   },
   //积分输入
   bindKeyInput2(e) {
-    var point = `items.timeout_deduction_point`;
+    var name = e.target.dataset.name;
+    let value=e.detail.value;
+    var point = `items.${name}`;
+    var pointIimit= that.data.point_limit[1].point;
+    if(pointIimit!=0&&pointIimit!=-1){
+      if(name=='timeout_deduction_point'||name=='ahead_award_point'){
+          pointIimit=pointIimit*1;
+          if(value>pointIimit){
+              this.showToast('分值不能超过您的奖扣分权限');
+                this.setData({
+                  [point]: '',
+                });
+              return false
+          }
+      }else{
+          pointIimit=pointIimit*10;
+          if(value>pointIimit){
+              this.showToast('上限不能超过'+pointIimit+'分');
+                this.setData({
+                  [point]: '',
+                });
+              return false
+          }
+      }
+    }
     this.setData({
-      [point]: e.detail.value,
+      [point]: value,
     });
   },
 
@@ -235,26 +286,25 @@ Page({
     app.globalData.showToast(text);
   },
   formSubmit() {
-    var items = this.data.items;
-    console.log(items);
+    var items =JSON.parse(JSON.stringify(this.data.items));
     if (!items.task_name) {
       this.showToast('请输入任务内容')
       return;
     }
     if (!items.base_point) {
-      this.showToast('请输入任务分')
+      this.showToast('请输入任务分')
       return;
     }
     if (!items.reviewer_id) {
       this.showToast('请选择审批人')
       return;
     }
-    if (!items.expire_time) {
-      this.showToast('请选择截止时间')
-      return;
+    if (items.task_cycle == 0) {
+      if (!items.expire_time) {
+        this.showToast('请选择截止时间')
+        return;
+      }
     }
-    // items.file_list=JSON.stringify(items.file_list);
-    // items.targets=JSON.stringify(items.targets);
     if(!items.task_remark){
       delete items.task_remark
     }
@@ -268,10 +318,13 @@ Page({
     }
     items.file_list=items.file_list.toString();
     this.setData({ disabled: true });
-        var url;
+    var url;
     if (items.task_cycle == 0) {
+        delete items.task_cycle
+        delete items.task_expire_day
         url = '/api/integral/task/publish'
       } else {
+        delete items.expire_time
         url = '/api/integral/schedule/publish/task'
     }
     app.$post(url,items).then((res) => {

+ 11 - 11
pages/statistics/offerAreward_set/offerAreward_set.axml

@@ -39,20 +39,20 @@
       <view class="li">
         <textarea maxlength="100" value="{{items.task_remark}}" onInput="bindTextAreaBlur2" placeholder="请输入任务描述" data-index="{{index}}"></textarea>
       </view>
-      <!-- <view class="flex-box flex-v-ce li">
-        <view class="label">重复周期</view>
-        <view class="flex-1">
-          <picker onChange="bindObjPickerChange" value="{{arrIndex}}" range="{{objectArray}}" range-key="name">
-            <view class="row-extra">{{objectArray[arrIndex].name}}</view>
-          </picker>
+      <view class="flex-box li" style="padding:15rpx 28rpx;">
+        <view class="label2" style="position: relative;top:10rpx;">提前奖分(天)</view>
+        <text class="red" style="position: relative;top:10rpx;">+</text>
+        <view class="flex-box-ce flex-1">
+          <input value="{{items.ahead_award_point}}" data-name="ahead_award_point" placeholder="提前奖多少分" type="number" onInput="bindKeyInput2"/>
+          <input style="border-left:1px solid #f1f1f1" data-name="ahead_award_point_limit" value="{{items.ahead_award_point_limit}}"  placeholder="奖分上限" type="number" onInput="bindKeyInput2"/>
         </view>
-        <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
-      </view> -->
+      </view>
       <view class="flex-box li" style="padding:15rpx 28rpx;">
-        <view class="label" style="position: relative;top:10rpx;">逾期扣分</view>
+        <view class="label2" style="position: relative;top:10rpx;">逾期扣分(天)</view>
         <text class="green" style="position: relative;top:10rpx;">-</text>
-        <view class="flex-1">
-          <input value="{{items.timeout_deduction_point}}" placeholder="每逾期一天扣多少分" type="number" onInput="bindKeyInput2" class="flex-1"/>
+        <view class="flex-box-ce flex-1">
+          <input value="{{items.timeout_deduction_point}}" data-name="timeout_deduction_point" placeholder="逾期扣多少分" type="number" onInput="bindKeyInput2"/>
+          <input style="border-left:1px solid #f1f1f1" data-name="timeout_deduction_point_limit"  value="{{items.timeout_deduction_point_limit}}"  placeholder="扣分上限" type="number" onInput="bindKeyInput2"/>
         </view>
       </view>
       <view class="flex-box flex-v-ce li" data-num="1" catchTap="openSelect">

+ 38 - 6
pages/statistics/offerAreward_set/offerAreward_set.js

@@ -13,7 +13,10 @@ Page({
       file_list: [],//附件地址列表
       reviewer_id: '',//审批者id
       revieweName: '',
-      timeout_deduction_point: '',//逾期扣分/月
+      timeout_deduction_point: '',//逾期扣分/天
+      timeout_deduction_point_limit:'',//逾期扣分上限
+      ahead_award_point: '',//提前奖分/天
+      ahead_award_point_limit:'',//提前奖分上限
       task_cycle: 0,
       task_expire_day: 1,
       task_type:1,
@@ -39,6 +42,7 @@ Page({
     ],
     arrIndex: 0,
     defaultSection: [],//选择的部门
+    point_limit:0,
   },
   onLoad(e) {
     that = this;
@@ -66,12 +70,16 @@ Page({
           file_list: item.task_file_list,//附件地址列表
           reviewer_id:item.reviewer_id,//审批者id
           revieweName:item.reviewer_name,
-          timeout_deduction_point: item.point_config.timeout_deduction_point,//逾期扣分/月
+          timeout_deduction_point: item.point_config.timeout_deduction_point,//逾期扣分/天
+          timeout_deduction_point_limit:item.point_config.timeout_deduction_point_limit,//逾期扣分上限
+          ahead_award_point: item.point_config.ahead_award_point,//提前奖分/天
+          ahead_award_point_limit:item.point_config.ahead_award_point_limit,//提前奖分上限
           task_cycle: 0,
           task_expire_day: 1,
           task_type:1,
         },
-        types: app.globalData.types
+        types: app.globalData.types,
+        point_limit:app.globalData.userData.point_config.point_limit
       })
     }
   },
@@ -102,9 +110,33 @@ Page({
   },
   //积分输入
   bindKeyInput2(e) {
-    var point = `items.timeout_deduction_point`;
+    var name = e.target.dataset.name;
+    let value=e.detail.value;
+    var point = `items.${name}`;
+    var pointIimit= that.data.point_limit[1].point;
+    if(pointIimit!=0&&pointIimit!=-1){
+      if(name=='timeout_deduction_point'||name=='ahead_award_point'){
+          pointIimit=pointIimit*1;
+          if(value>pointIimit){
+              this.showToast('分值不能超过您的奖扣分权限');
+                this.setData({
+                  [point]: '',
+                });
+              return false
+          }
+      }else{
+          pointIimit=pointIimit*10;
+          if(value>pointIimit){
+              this.showToast('上限不能超过'+pointIimit+'分');
+                this.setData({
+                  [point]: '',
+                });
+              return false
+          }
+      }
+    }
     this.setData({
-      [point]: e.detail.value,
+      [point]: value,
     });
   },
 
@@ -269,7 +301,7 @@ Page({
       return;
     }
     if (!items.base_point) {
-      this.showToast('请输入任务分')
+      this.showToast('请输入任务分')
       return;
     }
     if (!items.reviewer_id) {

+ 1 - 1
pages/statistics/schedule/schedule.acss

@@ -9,7 +9,7 @@
   font-weight: 600
 }
 .slider{
-   padding:0 .24rem ;
+   padding:0 .32rem ;
    padding-top: 0;
    padding-bottom: 0.5rem;
 }

+ 1 - 1
pages/statistics/schedule/schedule.axml

@@ -5,7 +5,7 @@
       <view class="title">任务进度</view>
     </view>
     <view class="slider">
-      <slider value="{{items.progress}}" onChange="slider4change" min="0" max="100" show-value></slider>
+      <slider value="{{items.progress}}" onChange="slider4change" min="0" max="100" show-value style="padding:0 0.32rem"></slider>
       <view style="font-size: 0.28rem; padding-top: 0.24rem;">已完成{{items.progress}}%</view>
     </view>
   </view>

+ 6 - 2
pages/statistics/taskDetail/taskDetail.axml

@@ -33,9 +33,13 @@
         <view class="laber">截止时间</view>
         <view class="flex-1">{{dataDetail.expire_time}}</view>
       </view>
-      <view class="flex-box flex-v-ce">
+      <view class="flex-box flex-v-ce" a:if="{{dataDetail.point_config.ahead_award_point}}">
+        <view class="laber">提前奖分</view>
+        <view class="flex-1">{{dataDetail.point_config.ahead_award_point}}B分/天</view>
+      </view>
+      <view class="flex-box flex-v-ce" a:if="{{dataDetail.point_config.timeout_deduction_point}}">
         <view class="laber">逾期扣分</view>
-        <view class="flex-1">{{dataDetail.point_config.timeout_deduction_point}}分/天</view>
+        <view class="flex-1">{{dataDetail.point_config.timeout_deduction_point}}B分/天</view>
       </view>
       <view class="flex-box flex-v-ce" a:if="{{dataDetail.department_info.length>0}}">
         <view class="laber">可见范围</view>

+ 7 - 3
pages/statistics/workDetail/workDetail.axml

@@ -53,9 +53,13 @@
         <text style="padding-left: 10px;" class="red" a:if="{{dataDetail.expire_day > 0}}">逾期{{dataDetail.expire_day}}天</text>
         </view>
       </view>
-      <view class="flex-box flex-v-ce">
+      <view class="flex-box flex-v-ce" a:if="{{dataDetail.point_config.ahead_award_point}}">
+        <view class="laber">提前奖分</view>
+        <view class="flex-1">{{dataDetail.point_config.ahead_award_point}}B分/天</view>
+      </view>
+      <view class="flex-box flex-v-ce" a:if="{{dataDetail.point_config.timeout_deduction_point}}">
         <view class="laber">逾期扣分</view>
-        <view class="flex-1">{{dataDetail.point_config.timeout_deduction_point}}分/天</view>
+        <view class="flex-1">{{dataDetail.point_config.timeout_deduction_point}}B分/天</view>
       </view>
       <view class="flex-box flex-v-ce" a:if="{{dataDetail.task_remark}}">
         <view class="laber">任务备注</view>
@@ -150,7 +154,7 @@
     </view>
   </view>
   <view class="btn-area" style="margin-top:28rpx;" a:if="{{(dataDetail.reviewer_id == userId && dataDetail.status == 2)||(dataDetail.employee_id == userId && dataDetail.status == 1)}}">
-      <button type="default" loading="{{disabled}}" a:if="{{dataDetail.reviewer_id == userId && dataDetail.status == 2}}" class="defBtn" disabled="{{disabled}}" catchTap="openWc">去审批</button>
+      <button type="default" loading="{{disabled}}" a:if="{{dataDetail.reviewer_id == userId && dataDetail.status == 2&&!isNot}}" class="defBtn" disabled="{{disabled}}" catchTap="openWc">去审批</button>
       <button type="default" loading="{{disabled}}" a:if="{{dataDetail.employee_id == userId && dataDetail.status == 1}}" class="defBtn" disabled="{{disabled}}" catchTap="openPerform">完成</button>
   </view>
   <view class="pop-up" a:if="{{isPublisher}}">

+ 4 - 1
pages/statistics/workDetail/workDetail.js

@@ -11,6 +11,7 @@ Page({
     array: ['编辑任务', '删除任务'],
     isPublisher: true,//是不是发布者
     corpId: '',
+    isNot:false,
   },
   onLoad(e) {
     that = this;
@@ -18,13 +19,15 @@ Page({
     if (e.id) {
       this.setData({
         id: parseInt(e.id),
-        userId: app.globalData.userData.id
+        userId: app.globalData.userData.id,
+        isNot:e.isNot?true:false,
       })
     }
     if (e.corpId) {
       that.setData({ corpId: e.corpId });
       app.globalData.corpId = e.corpId
     }
+
   },
   onShow() {
     if (app.globalData.userData) {

+ 2 - 2
pages/workbench/apply/apply.axml

@@ -33,7 +33,7 @@
                   <text class="green" a:else>{{item.selectRule.min_point}} ~ {{item.selectRule.max_point}}</text>
               </view>
               <view class="fontColorF" style="margin-left:10rpx;">
-                 {{item.selectRule.pt_Obj.name}}
+                {{item.selectRule.pt_Obj.name}}
               </view>
           </view>
           <view style="font-size:24rpx;margin-left:10rpx;" class="fontColorF">
@@ -50,7 +50,7 @@
             <image mode="scaleToFill" class="showImg" src="{{imgs}}"  data-index="{{imgIndex}}" data-item="{{item.files}}" catchTap="showImg"/>
           </view>
         </view>
-         <view class="flex-box flex-v-ce li" catchTap="openDate" data-index="{{index}}">
+        <view class="flex-box flex-v-ce li" catchTap="openDate" data-index="{{index}}">
           <view class="label isBt">发生时间</view>
           <view class="flex-1">{{item.event_time}}</view>
           <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>

+ 2 - 3
pages/workbench/apply/apply.js

@@ -103,7 +103,6 @@ Page({
         }, 1000);
         return;
       }
-      console.log(this.data.qrcodeId);
       app.$get("api/integral/rule/items/info", { item_id: this.data.qrcodeId }).then((res) => {
         var item = res.data.data || {}
         item.pt_Obj = app.getTypesItem(item.pt_id);
@@ -181,7 +180,7 @@ Page({
         }
         animation.translateY(0).step();
         that.setData({
-          popupCx: '',
+          popupCx: 'container__mask',
           animationInfo: animation.export()
         });
       });
@@ -194,7 +193,7 @@ Page({
         employeeObj: num == 3 ? [e.target.dataset.item] : [],
         isShowType: num,
         activeIndex: index,
-        popupCx: '',
+        popupCx: 'container__mask',
         animationInfo: animation.export()
       });
     }

+ 3 - 36
pages/workbench/approve/approve.axml

@@ -10,7 +10,7 @@
             <view class="fontColorF">{{item.rule_name}}</view>
           </view>
           <view class="flex-box flex-v-ce li">
-            <view class="label">选择规则</view>
+            <view class="label isBt">选择规则</view>
             <view class="flex-1">已选择1条</view>
             <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
           </view>
@@ -73,14 +73,6 @@
             <view class="flex-1">
               <view class="flex-box flex-v-ce">
                 <view  style="padding-left:10rpx; height:60rpx;line-height:60rpx;" class="flex-1">{{item.point}}</view>
-                <!-- <input  value="{{item.point}}"  placeholder="0" type="number" onInput="bindKeyInput" class="flex-1"/>
-                <view class="picker-box"  catchTap="bindPickerChange">
-                  <view class="{{item.isArrindex==true ? 'picker-right':'picker-left'}} yuan"></view>
-                  <view class="flex-box flex-v-ce" class="picker">
-                    <text class="red flex-1">奖</text>
-                    <text class="green flex-1">扣</text>
-                  </view>
-                </view> -->
               </view>
             </view>
           </view>
@@ -92,31 +84,6 @@
             <view class="flex-1"></view>
             <view class="fontColorF">{{item.rule_name}}</view>
           </view>
-          <!-- <view class="flex-box flex-v-ce li" data-num="1" catchTap="openSelect">
-            <view class="label">选择规则</view>
-            <view class="flex-1" a:if="{{item.selectRule}}">已选择1条</view>
-            <view class="flex-1" a:else></view>
-            <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
-          </view> -->
-          <!-- <view class="selectRule margin-bottom" a:if="{{item.selectRule}}">
-            <view class="flex-box flex-v-ce">
-              <view a:if="{{item.selectRule.range_type==1&&item.selectRule.min_point==item.selectRule.max_point}}">
-                <text class="red" a:if="{{item.selectRule.min_point>0}}">+{{item.selectRule.min_point}}</text>
-                <text class="green" a:else>{{item.selectRule.min_point}}</text>
-              </view>
-              <view class="green" a:else>
-                <text class="red" a:if="{{item.selectRule.min_point>0}}"> +{{item.selectRule.min_point}}~{{item.selectRule.max_point}}</text>
-                <text class="green" a:else>{{item.selectRule.min_point}} ~ {{item.selectRule.max_point}}</text>
-              </view>
-              <view class="fontColorF" style="margin-left:10rpx;">
-                  {{item.selectRule.pt_Obj.name}}
-              </view>
-            </view>
-            <view style="font-size:24rpx;margin-left:10rpx;" class="fontColorF">
-              {{item.selectRule.remark}}
-            </view>
-          </view> -->
-          <!-- <view class="margin-bottom"></view> -->
           <view class="flex-box li margin-bottom" style="padding:15rpx 28rpx;">
             <view class="label isBt" style="position: relative;top:8rpx;">积分</view>
             <text class="red" style="position: relative;top:8rpx;" a:if="{{item.isArrindex==true}}">+</text>
@@ -149,7 +116,7 @@
             <switch onChange="switchChange" checked="{{item.checked}}" color="#26A2FF"></switch>
           </view>
           <view class="flex-box flex-v-ce li" a:if="{{item.checked}}" data-num="1" data-ruleId="{{item.item_id}}" catchTap="openSelect">
-            <view class="label">选择规则</view>
+            <view class="label isBt">选择规则</view>
             <view class="flex-1" a:if="{{item.selectRule}}">已选择1条</view>
             <view class="flex-1" a:else></view>
             <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
@@ -234,7 +201,7 @@
           <textarea  maxlength="300" value="{{item.remark}}" onInput="bindTextAreaBlur" placeholder="审批意见(选填)"></textarea>
         </view>
       </view>
-    </form>
+    </view>
     <view class="btn-seve">
       <button type="default" loading="{{disabled}}" class="defBtn" disabled="{{disabled}}" catchTap="formSubmit">提交</button>
     </view>

+ 2 - 0
pages/workbench/approve/approve.js

@@ -14,6 +14,7 @@ Page({
       rule_name: '',
       item_id: '',//积分细则id 不选可以为0
       point: '',//积分
+      point2: '',//积分
       reviewer_id: '',//递交者
       remark: '',//备注
       ticket_count: false,//奖票数量
@@ -280,6 +281,7 @@ Page({
         ['item.item_id']: data.item_id,
         ['item.rule_name']: data.rule_name,
         ['item.point']: getPoint == 0 ? '' : getPoint,
+        ['item.point2']: getPoint == 0 ? '' : getPoint,
         ['item.isArrindex']: data.point >= 0 ? true : false,
       })
     })

+ 4 - 1
pages/workbench/approveDetail/approveDetail.acss

@@ -23,7 +23,10 @@
 .names{
   padding-top: 14rpx;
 }
-
+.img-right {
+  width: 24rpx;
+  height: 24rpx;
+}
 .imgBox{
   position: absolute;
   width: 1rpx;

+ 4 - 0
pages/workbench/approveDetail/approveDetail.axml

@@ -34,6 +34,10 @@
           </view>
         </block>
       </view>
+      <view class="flex-box-ce" style="padding-top:24rpx;border-top:2rpx solid #f1f1f1" catchTap="openDetail" a:if="{{dataDetail.source_type==1}}">
+          <view class="flex-1">任务详情</view>
+          <image mode="scaleToFill" class="img-right" src="../../../image/right.png"/>
+      </view>
     </view>
   </view>
   <view class="margin-bottom">

+ 5 - 0
pages/workbench/approveDetail/approveDetail.js

@@ -42,6 +42,11 @@ Page({
       }, function () { })
     }
   },
+  openDetail(){
+    dd.navigateTo({
+      url: '../../statistics/workDetail/workDetail?id=' + that.data.dataDetail.source_id+'&isNot=true'
+    })
+  },
   showImg(e) {
     var index = e.target.dataset.index;
     var item = e.target.dataset.item

+ 0 - 1
pages/workbench/jk_B/jk_B.axml

@@ -100,7 +100,6 @@
         <button type="default" loading="{{disabled}}" class="defBtn" disabled="{{disabled}}" catchTap="formSubmit">提交</button>
     </view>
   </view>
-
   <view class="box" animation="{{animationInfo}}">
     <select-rule defaultId="{{defaultRuleId}}" isGzType="{{isGzType}}" onConfirm="onSelectItem" onClose="onClose" a:if="{{isShowType=='1'}}"/>
     <select-type defaultId="{{defaultRuleId}}" isGzType="{{isGzType}}" onConfirm="onSelectType" onClose="onClose" a:if="{{isShowType=='2'}}"/>

+ 1 - 1
pages/workbench/jk_B/jk_B.js

@@ -100,6 +100,7 @@ Page({
     var num = e.target.dataset.num;
     var userData = this.data.users;
     var superior_list = this.data.superior_list;
+    that.setData({ activeIndex: '', isShowType: '0' });
     if (num == 4) {
       if (userData.length == 0) {
         this.showToast('请先选择奖扣对象')
@@ -110,7 +111,6 @@ Page({
         return;
       }
     }
-    that.setData({ activeIndex: '' });
     if (e.target.dataset.ruleId) {
       that.setData({ defaultRuleId: e.target.dataset.ruleId });
     }