소스 검색

增加更新观察期配置

root 3 년 전
부모
커밋
36396cd3e3

+ 1 - 0
backendApi/config/urlManagerRules.php

@@ -259,6 +259,7 @@ return [
             'POST,GET period' => 'period',
             'POST,GET other' => 'other',
             'GET dec-level' => 'dec-level',
+            'GET,POST month-limit' => 'month-limit',
             'POST dec-level-add' => 'dec-level-add',
             'POST,GET dec-level-edit/<id>' => 'dec-level-edit',
             'GET dec-level-delete/<selected>' => 'dec-level-delete',

+ 15 - 0
backendApi/modules/v1/controllers/ConfigController.php

@@ -464,6 +464,21 @@ class ConfigController extends BaseController {
         return static::notice($data);
     }
 
+    public function actionMonthLimit() {
+        if (Yii::$app->request->isPost) {
+            $postData = Yii::$app->request->post();
+            $month = $postData['month'];
+            $ret = Config::updateAll(['VALUE' => $month, 'UPDATED_AT' => Date::nowTime()], "CONFIG_NAME=:CONFIG_NAME", [':CONFIG_NAME' => 'observePeriodLimit']);
+            if ($ret) {
+                return static::notice('更新观察期成功');
+            } else {
+                return static::notice('更新观察期失败,请重试');
+            }
+        }
+        $data = Config::find()->where("CONFIG_NAME='observePeriodLimit'")->asArray()->one();
+        return static::notice($data);
+    }
+
     /**
      *  查看报单中心级别
      * @return mixed

+ 42 - 1
backendEle/src/views/config/dec-level.vue

@@ -61,6 +61,20 @@
         </el-dropdown>
         <el-button type="primary" size="small" @click="onAdd" v-if="false">添加级别</el-button>
       </div>
+
+      <el-form ref="form" :model="form" label-width="150px">
+        <el-form-item :label="form.monthLimitTITLE">
+          <el-input  v-model="form.monthLimitVALUE" placeholder="请输入内容">
+          </el-input>
+        <div class="white-box-footer" style="line-height: 1.2;color: #999;">
+          <p>注:</p>
+          <p>(1) 请输入正整数数字;</p>
+          <p>(2) 输入0代表无观察期,即全站升级单为全额升级;</p>
+        </div>
+        <div class="white-box-footer">
+          <el-button type="primary" @click="onSubmit" :loading="submitButtonStat">更新观察期</el-button>
+        </div></el-form-item>
+      </el-form>
     </div>
 
   </div>
@@ -81,9 +95,18 @@ export default {
       this.tableData = response.list
       this.loading = false
     })
+    network.getData('config/month-limit').then(response => {
+      this.form.monthLimitTITLE = response.TITLE
+      this.form.monthLimitVALUE = response.VALUE
+    })
   },
   data () {
     return {
+      submitButtonStat: false,
+      form:{
+        monthLimitTITLE:'',
+        monthLimitVALUE:''
+      },
       tableData: null,
       loading: true,
       tool: tool,
@@ -91,6 +114,22 @@ export default {
     }
   },
   methods: {
+    onSubmit() {
+        this.submitButtonStat = true
+        network.postData('config/month-limit', {
+          month: this.form.monthLimitVALUE,
+        }).then(response => {
+          this.$message({
+            message: response,
+            type: 'success'
+          })
+          this.submitButtonStat = false
+        
+        }).catch(response => {
+          this.submitButtonStat = false
+  
+        })
+      },
     editHandle (row) {
       this.$router.push({path: `/config/dec-level-edit/${row.ID}`})
     },
@@ -139,5 +178,7 @@ export default {
 </script>
 
 <style scoped>
-
+/deep/ .el-form-item__label {
+  text-align: left !important;
+}
 </style>

+ 0 - 0
common/models/OriginDecPv.php


+ 0 - 0
common/models/UpgradeType.php


+ 0 - 0
common/models/forms/DeclarationUpgradeForm.php


+ 0 - 0
frontendEle/src/views/user/upgrade.vue


+ 0 - 0
vendor/composer/InstalledVersions.php


+ 0 - 0
vendor/composer/installed.php


+ 0 - 0
vendor/composer/platform_check.php