Bläddra i källkod

新增商户收费

1
mo 3 år sedan
förälder
incheckning
c20ff2b517
2 ändrade filer med 189 tillägg och 32 borttagningar
  1. 146 0
      src/views/chargeManager/four.vue
  2. 43 32
      src/views/chargeManager/index.vue

+ 146 - 0
src/views/chargeManager/four.vue

@@ -0,0 +1,146 @@
+ <template>
+  <div class="m-container">
+    <div>
+      <!-- <el-button  type="primary">添加规则</el-button> -->
+
+      <el-form :inline="true" :model="form" ref="form">
+        <el-alert
+          style="margin: 20px 0 40px"
+          title="商品收款账户设置"
+          :closable="false"
+          type="info"
+        >
+        </el-alert>
+        <el-row>
+                商品收款账户:
+          <el-form-item
+            prop="231"
+            :rules="[
+              {
+                required: true,
+                message: '请输入收款账户',
+              },
+            ]"
+          >
+
+            <el-input v-model="form['231']" placeholder="请输入商品收款账户">
+            </el-input>
+
+          </el-form-item>
+          <el-button
+            type="primary"
+            @click="save"
+
+            v-permission="'sysConfig/batchUpdate_dayaTeamRules'"
+            >保存</el-button
+          >
+        </el-row>
+      </el-form>
+    </div>
+  </div>
+</template>
+<script>
+import {
+  getSysTenantConfig,
+  setSysTenantConfig,
+} from "@/views/courseRulersManager/api";
+import { sysConfigList, sysConfigUpdate } from "@/api/generalSettings"; // 平台的修改和查
+export default {
+  props: ["isPlatform"],
+  data() {
+    return {
+      form: {},
+      questionList: [],
+      rulesVisiable: false,
+    };
+  },
+  async mounted() {
+    this.getRules();
+  },
+  methods: {
+    getRules() {
+      if (this.isPlatform) {
+        this.getPlatformRules();
+      } else {
+        this.getInstitutionRules();
+      }
+    },
+    async getPlatformRules() {
+      try {
+        const res = await sysConfigList({ group: "COLLECTION" });
+        res.data.forEach((item) => {
+          // this.form[item.paramName] = item.paranValue
+          this.$set(this.form, item.id, item.paranValue);
+        });
+        // this.$forceUpdate()
+        // console.log(this.form);
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    async getInstitutionRules() {
+      try {
+        const res = await getSysTenantConfig({ group: "COLLECTION" });
+        res.data.forEach((item) => {
+          // this.form[item.paramName] = item.paranValue
+          this.$set(this.form, item.id, item.paranValue);
+        });
+        // this.$forceUpdate()
+        // console.log(this.form);
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    savePlatform() {
+      this.$refs.form.validate(async (valid) => {
+        if (valid) {
+          let param = [];
+          for (let i in this.form) {
+            param.push({
+              id: i,
+              paranValue: this.form[i],
+            });
+          }
+          try {
+            const res = await sysConfigUpdate(param);
+            this.$message.success("保存成功");
+            this.getRules();
+          } catch (e) {
+            console.log(e);
+          }
+        }
+      });
+    },
+    saveInstitution() {
+      this.$refs.form.validate(async (valid) => {
+        if (valid) {
+          let param = [];
+          for (let i in this.form) {
+            param.push({
+              id: i,
+              paranValue: this.form[i],
+            });
+          }
+          try {
+            const res = await setSysTenantConfig(param);
+            this.$message.success("保存成功");
+            this.getRules();
+          } catch (e) {
+            console.log(e);
+          }
+        }
+      });
+    },
+    save() {
+      if (this.isPlatform) {
+        this.savePlatform();
+      } else {
+        this.saveInstitution();
+      }
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+@import "~@scss/views/courseRulersManager/index.scss";
+</style>

+ 43 - 32
src/views/chargeManager/index.vue

@@ -1,58 +1,69 @@
 <template>
   <div class="m-container">
     <h2>
-      <div class="squrt"></div>收费管理
+      <div class="squrt"></div>
+      收费管理
       <!-- <div @click="chargeOperation('create')" v-permission="'paymentConfig/add'" class="newBand">添加</div> -->
     </h2>
     <div class="m-core">
       <!-- navMenu -->
 
-        <tab-router v-model.trim="activeIndex" type="card" @tab-click="handleClick">
-          <el-tab-pane lazy label="分润" name="0" v-if="permissionList.share">
-              <three v-if="activeIndex == 0" />
-          </el-tab-pane>
-          <el-tab-pane lazy label="比例" name="1" v-if="permissionList.scalc">
-              <one v-if="activeIndex == 1" />
-          </el-tab-pane>
-          <el-tab-pane lazy label="金额" name="2" v-if="permissionList.money">
-              <two v-if="activeIndex == 2" />
-          </el-tab-pane>
-        </tab-router>
+      <tab-router
+        v-model.trim="activeIndex"
+        type="card"
+        @tab-click="handleClick"
+      >
+        <el-tab-pane lazy label="分润" name="0" v-if="permissionList.share">
+          <three v-if="activeIndex == 0" />
+        </el-tab-pane>
+        <el-tab-pane lazy label="比例" name="1" v-if="permissionList.scalc">
+          <one v-if="activeIndex == 1" />
+        </el-tab-pane>
+        <el-tab-pane lazy label="金额" name="2" v-if="permissionList.money">
+          <two v-if="activeIndex == 2" />
+        </el-tab-pane>
+        <el-tab-pane lazy label="商品" name="3" v-if="permissionList.shop">
+          <four v-if="activeIndex == 3" />
+        </el-tab-pane>
+      </tab-router>
     </div>
   </div>
 </template>
 <script>
-import one from './one'
-import two from './two'
-import three from './three'
-import { permission} from '@/utils/directivePage'
+import one from "./one";
+import two from "./two";
+import three from "./three";
+import four from "./four";
+import { permission } from "@/utils/directivePage";
 export default {
   components: {
     one,
     two,
-    three
+    three,
+    four
   },
-  name: 'chargeManager',
-  data () {
-    const query = this.$route.query
+  name: "chargeManager",
+  data() {
+    const query = this.$route.query;
     return {
-      activeIndex: '0',
+      activeIndex: "0",
       permissionList: {
-        scalc: permission('/chargeManager/scalc'),
-        money: permission('/chargeManager/money'),
-        share: permission('/chargeManager/share'),
-      }
-    }
+        scalc: permission("/chargeManager/scalc"),
+        money: permission("/chargeManager/money"),
+        share: permission("/chargeManager/share"),
+        shop:permission("/chargeManager/shop"),
+      },
+    };
   },
   methods: {
-    handleClick (val) {
-      this.activeIndex = val.name
-    }
-  }
-}
+    handleClick(val) {
+      this.activeIndex = val.name;
+    },
+  },
+};
 </script>
 <style lang="scss" scoped>
 /deep/.m-container {
-  padding: 0 10px 40px
+  padding: 0 10px 40px;
 }
 </style>