Browse Source

feat: 按流量计算金额

xdd 2 months ago
parent
commit
d3917bd6fd
1 changed files with 36 additions and 4 deletions
  1. 36 4
      src/views/system/config/config.vue

+ 36 - 4
src/views/system/config/config.vue

@@ -507,6 +507,16 @@
            </div>
          </el-form>
        </el-tab-pane>
+       <el-tab-pane label="统计配置" name="statis.config">
+         <el-form ref="form12" :model="form12" :rules="rules12" label-width="180px">
+           <el-form-item   label="流量价格(每G/元)" prop="trafficPrice">
+             <el-input-number v-model="form12.trafficPrice" />
+           </el-form-item>
+           <div   class="footer">
+             <el-button type="primary" @click="submitForm12">提  交</el-button>
+           </div>
+         </el-form>
+       </el-tab-pane>
 
     </el-tabs>
      <el-dialog :title="sign.title" :visible.sync="sign.open" width="500px" append-to-body>
@@ -587,6 +597,11 @@ export default {
       // 表单校验
       rules3: {
 
+      },
+      rules12: {
+        trafficPrice: [{
+          required: true, message: '流量价格不能为空', trigger: 'blur'
+        }]
       },
       form4: {
         sign:[],
@@ -615,6 +630,7 @@ export default {
       },
       form10:[],
       form11:{},
+      form12:{trafficPrice: 0},
       form19:{
       },
       // 表单校验
@@ -717,26 +733,34 @@ export default {
               this.configKey=response.data.configKey;
               this.form6 =JSON.parse(response.data.configValue);
             }
-           if(key=="course.config"){
+           else if(key=="course.config"){
              this.configId=response.data.configId;
              this.configKey=response.data.configKey;
              this.form18 =JSON.parse(response.data.configValue);
            }
-           if(key=="redPacket.config"){
+          else if(key=="redPacket.config"){
              this.configId=response.data.configId;
              this.configKey=response.data.configKey;
              this.form19 =JSON.parse(response.data.configValue);
            }
-           if(key=="store.appShow"){
+          else if(key=="store.appShow"){
              this.configId=response.data.configId;
              this.configKey=response.data.configKey;
              this.form10 =JSON.parse(response.data.configValue);
            }
-           if(key=="qw.config"){
+          else if(key=="qw.config"){
              this.configId=response.data.configId;
              this.configKey=response.data.configKey;
              this.form11 =JSON.parse(response.data.configValue);
            }
+          else if(key == "statis.config"){
+             this.configId=response.data.configId;
+             this.configKey=response.data.configKey;
+             if(response.data.configValue != null) {
+               this.form12 =JSON.parse(response.data.configValue);
+             }
+
+           }
         });
      },
     /** 提交按钮 */
@@ -853,6 +877,14 @@ export default {
         }
       });
     },
+    submitForm12(){
+      var param={configId:this.configId,configKey:this.configKey,configValue:JSON.stringify(this.form12)}
+      updateConfigByKey(param).then(response => {
+        if (response.code === 200) {
+          this.msgSuccess("修改成功");
+        }
+      });
+    },
     /** 清理缓存按钮操作 */
     handleClearCache() {
       clearCache().then(response => {