yaoyao 2 лет назад
Родитель
Сommit
520b808f29
2 измененных файлов с 72 добавлено и 0 удалено
  1. 20 0
      src/http/moudules/sys.js
  2. 52 0
      src/views/Sys/Costmanagement.vue

+ 20 - 0
src/http/moudules/sys.js

@@ -63,5 +63,25 @@ export const sysUserLinkSysDelete=(data) => {
     })
 }
 
+// 获取费用配置
+export const getConfig=(data) => {
+    return axios({
+        url: '/fee/getConfig',
+        method: 'get',
+        data
+    })
+}
+
+
+// 更新费用配置
+export const updateConfig=(data) => {
+    return axios({
+        url: '/fee/updateConfig',
+        method: 'post',
+        data
+    })
+}
+
+
 
 

+ 52 - 0
src/views/Sys/Costmanagement.vue

@@ -0,0 +1,52 @@
+<template>
+  <div>
+    <el-card>
+      <el-row :gutter="20" v-for="(item, index) in configList" :key="index" style="margin-bottom: 20px;">
+        <el-col :span="2">{{ item.name }}:</el-col>
+        <el-col :span="3">
+          <el-input size="small" v-model="item.val" :placeholder="'请输入' + item.name"></el-input>
+        </el-col>
+      </el-row>
+      <el-button size="small" type="primary" @click="handleEdit">修改</el-button>
+    </el-card>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      configList: [],
+    }
+  },
+  created() {
+    this.getInfo()
+  },
+  methods: {
+    getInfo() {
+      this.$api.sys.getConfig().then((res) => {
+        if (res.code == 200) {
+          this.configList = res.data
+        }
+      })
+    },
+    handleEdit(row) {
+      console.log(row)
+      this.$api.sys.updateConfig(this.configList).then((res) => {
+        if (res.code == 200) {
+          this.$message.success(res.msg)
+          this.getInfo()
+        } else {
+          this.$message.error(res.msg)
+        }
+      })
+    },
+  }
+}
+</script>
+
+<style scoped lang="scss">
+.el-col {
+  line-height: 34px;
+}
+</style>