walter 1 рік тому
батько
коміт
e71e91e83b

+ 1 - 1
src/components/NumberInput.vue

@@ -166,7 +166,7 @@ export default {
   },
   methods: {
     setCurrentValue(value) {
-      console.log('value:'+value,this.numVal)
+      // console.log('value:'+value,this.numVal)
       if(value===''){
         return false
       }

+ 3 - 3
src/point/view/integral/deptRank.vue

@@ -183,7 +183,7 @@ export default {
     },
     onRefresh(done){
       if (!this.searchForm.startDate || !this.searchForm.endDate || !this.searchForm.ptId){
-        done();
+        if (typeof done === 'function') done();
         return;
       }
 
@@ -201,11 +201,11 @@ export default {
 
       this.$socketApiTow.sendData(msg,(res) => {
         if (res.code !== 1 || res.type !== msg.type){
-          done();
+          if (typeof done === 'function') done();
           return;
         }
         this.dataList = res.result.list;
-        done();
+        if (typeof done === 'function') done();
       })
 
 

+ 3 - 3
src/point/view/integral/reward_deduction_search.vue

@@ -165,7 +165,7 @@ export default {
     },
     onRefresh(done){
       if (!this.searchForm.startDate || !this.searchForm.endDate) {
-        done();
+        if (typeof done === 'function') done();
         return;
       }
       let msg = {
@@ -180,11 +180,11 @@ export default {
       }
       this.$socketApiTow.sendData(msg,(res)=>{
         if (res.code !== 1 || res.type !== msg.type){
-          done();
+          if (typeof done === 'function') done();
           return;
         }
         this.dataList = res.result.list;
-        done();
+        if (typeof done === 'function') done();
       })
     },
   }

+ 13 - 3
src/point/view/task/short_task.vue

@@ -38,7 +38,7 @@
           <van-cell title="任务类型" required id="task_types">
             <template slot="right-icon">
               <van-radio-group v-model="data.pt_id" direction="horizontal" class="radio_button">
-                <van-radio checked-color class="list" :name="item.id" v-for="(item, index) in point_types" v-if="item.code != 'JX'" :key="index">{{ item.name }}</van-radio>
+                <van-radio checked-color class="list" :name="item.id" v-for="(item, index) in point_types" v-if="item.code !== 'JX'" :key="index">{{ item.name }}</van-radio>
               </van-radio-group>
               <van-icon class="small_tip" @click="show_small_tip = true" name="question-o" />
             </template>
@@ -302,6 +302,9 @@ export default {
     NumberInput
   },
   data() {
+    let pts = this.$getTypes;
+    let ptB = pts.filter(pt => pt.code === 'BF');
+    ptB = ptB ? ptB[0] : null;
     return {
       point: 0,
       exced: 0, // 超预期计算标准
@@ -394,9 +397,10 @@ export default {
       executor_name: [],
       reviewer: [], // 登录员工的信息,
       manage_scope: this.$userInfo().employee_detail.manage_scope,
+      pts:pts,
       data: {
         targets: [],
-        pt_id: 0,
+        pt_id: ptB ? ptB.id : 0,
         task_name: '',
         task_remark: '',
         base_point: 0,
@@ -434,7 +438,7 @@ export default {
       pointLevel: {},
       employee_map: this.$getEmployeeMap(),
       approver_manage_scope: [],
-      point_types: this.$getTypes,
+      point_types: pts,
       showScheduleExpireDate:false,
       scheduleExpireDate:null
     };
@@ -486,7 +490,9 @@ export default {
       }
     },
     scheduleExpireDate(val){
+      // console.log('任务 schedule expire Date',val);
       this.data.schedule_expire_date = val ? moment(val).format('YYYY-MM-DD') : '';
+      // console.log('任务 ',this.data)
       if (val) this.toast("重复任务将在" + this.data.schedule_expire_date + "停止自动发布")
     }
   },
@@ -757,6 +763,9 @@ export default {
       }else if(this.data.task_cycle==3&&this.data.task_expire_day<=moment().format('D')){
       	is=false
       }
+
+      if (!data.schedule_expire_date) delete data.schedule_expire_date;
+
       this.$axiosUser('post', url, data).then(res => {
             if(this.data.task_cycle&&is){
               let str=this.data.task_cycle==1? '您发布的每日重复任务将于明天0点执行自动发布,是否需要立即发布一条任务?':this.data.task_cycle==2? '您发布的每周重复任务将于下周一执行自动发布,是否需要立即发布一条任务?':'您发布的每月重复任务将于下个月1号执行自动发布,是否需要立即发布一条任务?'
@@ -808,6 +817,7 @@ export default {
     	});
     },
     sava_btn() {
+      // console.log('任务 save btn',this.data);return;
       let self = this;
       if (this.data.base_point === 0) {
         self.$notify({ type: 'danger', message: '任务积分不能为0' });

+ 14 - 7
src/point/view/task/temp_task.vue

@@ -37,7 +37,7 @@
           <van-cell title="任务类型" required>
             <template slot="right-icon">
               <van-radio-group v-model="data.pt_id" direction="horizontal" class="radio_button">
-                <van-radio class="list" :class="{ changeRadio: item.id === data.pt_id }" v-if="item.code != 'JX'" :name="item.id" v-for="(item, index) in $getTypes" :key="index">
+                <van-radio class="list" :class="{ changeRadio: item.id === data.pt_id }" v-if="item.code !== 'JX'" :name="item.id" v-for="(item, index) in pts" :key="index">
                   {{ item.name }}
                 </van-radio>
               </van-radio-group>
@@ -296,6 +296,10 @@ Vue.use(calendar)
 export default {
   data() {
     const reviewer = [this.$userInfo()];
+    let pts = this.$getTypes;
+    let ptB = pts.filter(pt => pt.code === 'BF');
+    ptB = ptB ? ptB[0] : null;
+
     return {
       isNeed: !this.$getCache('isAndroid'),
       bar_height: 0,
@@ -363,9 +367,10 @@ export default {
         '31号'
       ],
       reviewer: reviewer,
+      pts: pts,
       data: {
         task_type: 1,
-        pt_id: 0,
+        pt_id: ptB ? ptB.id : 0,
         task_name: '',
         task_remark: '',
         base_point: 0,
@@ -437,7 +442,9 @@ export default {
       }
     },
     scheduleExpireDate(val){
+      // console.log('悬赏 schedule expire date',val);
       this.data.schedule_expire_date = val ? moment(val).format('YYYY-MM-DD') : '';
+      // console.log('悬赏',this.data);
       if (val) this.$toast("重复悬赏将在" + this.data.schedule_expire_date + "停止自动发布")
     }
   },
@@ -580,6 +587,9 @@ export default {
       }else if(this.data.task_cycle==3&&this.data.task_expire_day<=moment().format('D')){
       	is=false
       }
+
+      if (!data.schedule_expire_date) delete data.schedule_expire_date;
+
       this.$axiosUser('post', url, data).then(res => {
         if(this.data.task_cycle&&is){
           let str=this.data.task_cycle==1? '您发布的每日重复任务将于明天0点执行自动发布,是否需要立即发布一条任务?':this.data.task_cycle==2? '您发布的每周重复任务将于下周一执行自动发布,是否需要立即发布一条任务?':'您发布的每月重复任务将于下个月1号执行自动发布,是否需要立即发布一条任务?'
@@ -651,6 +661,7 @@ export default {
     	});
     },
     sava_btn() {
+      // console.log('悬赏 sava_btn',this.data);return;
       let self = this;
       self.$validator.validate().then(result => {
         if (!result) {
@@ -662,6 +673,7 @@ export default {
             self.sub();
           }
         }
+
       });
     },
     scheduleExpireDateConfirm(val) {
@@ -674,11 +686,6 @@ export default {
     }
   },
   created() {
-    for (let i in this.$getTypes) {
-      if (this.$getTypes[i].code == 'BF') {
-        this.data.pt_id = this.$getTypes[i].id;
-      }
-    }
     if (window.plus) {
       this.bar_height = window.plus.navigator.getStatusbarHeight();
       if(!this.$getCache('flexDialog')){