brook 3 tahun lalu
induk
melakukan
c64ef7343c

+ 5 - 11
backendApi/modules/v1/controllers/CalcController.php

@@ -177,20 +177,14 @@ class CalcController extends BaseController
         $formModel           = new PeriodForm();
         $formModel->scenario = 'perf';
 
-        if (2 == $period['IS_PREPARE'] && 1 == $period['IS_PERFED']) {
-            //设置计算进行中标识
-            Period::updatePeriodIsProcessing($periodNum, Period::IS_PROCESSING);
-            if ($formModel->load(Yii::$app->request->get(), '') && $formModel->pullPeriod()) {
-                return static::notice('开始拉取期业绩数据,请等待');
-            } else {
-                Period::updatePeriodIsProcessing($periodNum, Period::NOT_PROCESSING);
-                return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
-            }
+        //设置计算进行中标识
+        Period::updatePeriodIsProcessing($periodNum, Period::IS_PROCESSING);
+        if ($formModel->load(Yii::$app->request->get(), '') && $formModel->pullPeriod()) {
+            return static::notice('开始拉取期业绩数据,请等待');
         } else {
             Period::updatePeriodIsProcessing($periodNum, Period::NOT_PROCESSING);
-            return static::notice('业绩单还未全部生成,无法拉取期业绩数据,请稍后重试', 400);
+            return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
         }
-
     }
 
     /**

+ 22 - 27
backendEle/src/views/bonus/period.vue

@@ -84,7 +84,7 @@
               <div class="flex">
                 <div>
                   <el-table :data="dialogData" height="550" v-loading="dialogLoading">
-                    <el-table-column prop="CREATED_AT" label="操作时间" width="210">
+                    <el-table-column prop="CREATED_AT" label="操作时间" width="180">
                       <template slot-scope="scope">
                         {{tool.formatDate(scope.row.CREATED_AT)}}
                       </template>
@@ -223,7 +223,7 @@ export default {
       dialogTableVisible: false,
       dialogData: null,
       currentDialogPage: 1,
-      dialogPageSize: 10,
+      dialogPageSize: 100,
       dialogLoading: true,
       form: {
         name: '',
@@ -336,6 +336,22 @@ export default {
       }).catch(response => {
       })
     },
+    calcBonusRecordHandle(currentPeriod) {
+      this.$confirm('Confirm to sync calculate bonus record for the current period?', 'Hint', { // '确定对当前期进行生成业绩单操作?', '提示'
+        confirmButtonText: 'confirm', // 确定
+        cancelButtonText: 'cancel', // 取消
+        type: 'warning'
+      }).then(() => {
+        return network.getData(`calc/sync-calc-record/${currentPeriod}`)
+      }).then(response => {
+        this.$message({
+          message: response,
+          type: 'success'
+        })
+        this.getDialogData(this.currentPage, this.pageSize)
+      }).catch(response => {
+      })
+    },
     pullBonusHandle(currentPeriod) {
       this.$confirm('Confirm to calculate bonus data for the current period?', 'Hint', { // '确定对当前期进行生成业绩单操作?', '提示'
         confirmButtonText: 'confirm', // 确定
@@ -499,34 +515,13 @@ export default {
 </script>
 <style>
 .flex{
-  /*position: fixed;*/
-  /*top: calc(50vh - 200px);*/
-  /*left:calc(50vw - 200px);*/
   display: flex;
-  /*width:400px;*/
-  /*height:400px;*/
-  /*background: rgb(190, 167, 154);*/
-}
-.lefti{
-  width: 100px;
-  background: chartreuse;
-
-}
-.item{
-  width: 100px;
-  height:40px;
-  line-height: 40px;
-  text-align: center;
-}
-.active{
-  background: coral;
-}
-.overfowwlosc{
-  /*width: 100px;*/
-  /*height: 100px;*/
-  overflow-y: scroll;
 }
 .button{
   margin-bottom: 10px;
 }
+.el-table__body {
+-webkit-border-horizontal-spacing: -30px;
+-webkit-border-vertical-spacing: -30px;
+}
 </style>

+ 1 - 1
common/helpers/bonus/Calc/PullCalcBonusData.php

@@ -105,7 +105,7 @@ class PullCalcBonusData extends BaseBusiness
     {
         $repeatField = [
 //            'ORI_CAPPED_BONUS_QY' => ['CAPPED_BONUS_QY'],
-            'ORI_BONUS_QY'        => ['BONUS_QY'],
+            'ORI_BONUS_QY' => ['BONUS_QY', 'SHOULD_QY'],
 
             'ORI_BONUS_BS'      => ['BONUS_BS', 'REAL_BONUS_BS'],
             'ORI_BONUS_QUARTER' => ['BONUS_QUARTER'],

+ 2 - 2
common/helpers/bonus/Calc/PullPerfDataFromCalc.php

@@ -49,8 +49,8 @@ class PullPerfDataFromCalc extends BasePerfBusiness
         $data = \Yii::$app->$db->createCommand("SELECT IS_PREPARE,IS_PERFED FROM AR_PERIOD where PERIOD_NUM = $this->_periodNum")->queryOne();;
 
         if (
-            2 == $data['IS_PREPARE'] //计算业绩阶段
-            &&
+//            2 == $data['IS_PREPARE'] //计算业绩阶段
+//            &&
             1 == $data['IS_PERFED']  //1表示累计业绩已完成
         ) {
             return true;