瀏覽代碼

修改支付功能

lex-xin 4 年之前
父節點
當前提交
e825497665

文件差異過大導致無法顯示
+ 0 - 0
dist/index.html


文件差異過大導致無法顯示
+ 0 - 0
dist/static/css/chunk-b0ae1d98.41595255.css


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/app.61e4fcd7.js


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/chunk-9b604690.04dce09b.js


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/chunk-b0ae1d98.379ff219.js


+ 241 - 218
src/views/chargeManager/two.vue

@@ -1,70 +1,92 @@
 <template>
   <div class="m-container">
     <div class="m-core">
-      <div @click="chargeOperation('create')" v-permission="'sysConfig/update'" class="newBand">添加</div>
       <div @click="sporadicStatus = true" v-permission="'sysConfig/update'" class="newBand">零星收费设置</div>
 
       <!-- 列表 -->
-      <div class="tableWrap">
-        <el-table :data="tableList" :header-cell-style="{background:'#EDEEF0',color:'#444'}">
-          <el-table-column align="center" prop="organName" label="分部"></el-table-column>
-          <el-table-column align="center" prop="money" label="金额(元)"></el-table-column>
-          <el-table-column align="center" width="250px" label="操作">
-            <template slot-scope="scope">
-              <el-button v-if="permission('sysConfig/update')" @click="chargeOperation('update', scope.row)" type="text">修改</el-button>
-              <el-button v-if="permission('sysConfig/update')" @click="chargeDel(scope.row)" type="text">删除</el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-        <!-- <pagination :total="pageInfo.total"
-                    :page.sync="pageInfo.page"
-                    :limit.sync="pageInfo.limit"
-                    :page-sizes="pageInfo.page_size"
-        @pagination="getList" />-->
-      </div>
-    </div>
-
-    <el-dialog
-      :title="formTitle[formActionTitle]"
-      :visible.sync="chargeStatus"
-      @close="onFormClose('ruleForm')"
-      width="500px"
-    >
-      <el-form :model="form" :rules="rules" ref="ruleForm">
-        <el-form-item label="所属分部" prop="organId" :label-width="formLabelWidth">
-          <el-select v-model.trim="form.organId">
-            <el-option
-              v-for="item in branchList"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-              :disabled="item.disabled"
-            ></el-option>
-          </el-select>
+      <el-form :model="result" ref="ruleFormValid">
+        <el-form-item class="moreRule" :label-width="formLabelWidth" style="margin-bottom: 0;">
+          <span class="min">分部</span>
+          <span class="min">收款分部</span>
+          <span class="min">金额</span>
+          <span class="max">购买类型</span>
         </el-form-item>
-        <el-form-item label="金额(元)" prop="money" :label-width="formLabelWidth">
-          <el-input-number
-            style="width: 100%;"
-            v-model="form.money"
-            :precision="0"
-            controls-position="right"
-            :min="1"
-            :max="999999999"
-          ></el-input-number>
+        <div class="moreRule">
+          <div class="moreRuleIn" v-for="(domain, index) in result.domains" :key="index">
+            <el-form-item class="setWidth"
+              :label-width="formLabelWidth"
+              :label="'第' + (index + 1)"
+              :prop="'domains.' + index + '.organId'"
+              :rules="{
+                required: true, message: '请选择所属分部', trigger: 'change'
+              }">
+              <el-select v-model.trim="domain.organId" :disabled="domain.disabled" placeholder="请选择所属分部">
+                <el-option
+                  v-for="(item, index1) in branchList"
+                  :key="index1"
+                  :label="item.label"
+                  :value="item.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item class="setWidth" :prop="'domains.' + index + '.routeOrganId'" :rules="[
+              { required: true, message: '请选择收款分部', trigger: 'change' },
+            ]">
+              <el-select v-model.trim="domain.routeOrganId" :disabled="domain.disabled" placeholder="请选择收款分部">
+                <el-option
+                  v-for="(item, index) in calcBranchList"
+                  :key="index"
+                  :label="item.label"
+                  :value="item.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item class="setWidth" :prop="'domains.' + index + '.amount'" :rules="validAmount">
+              <el-input
+                type="age"
+                placeholder="请输入比例"
+                :disabled="domain.disabled"
+                @mousewheel.native.prevent
+                v-model.number="domain.amount"
+              >
+              </el-input>
+            </el-form-item>
+            <el-form-item :prop="'domains.' + index + '.type'" :rules="[
+              { required: true, message: '请选择购买类型', trigger: 'change' },
+            ]">
+              <el-select
+                v-model.trim="domain.type"
+                placeholder="购买类型"
+                style="width: 180px !important"
+                :disabled="domain.disabled"
+              >
+                <el-option value="vipBuy" label="VIP课"></el-option>
+                <el-option value="practiceBuy" label="网管课"></el-option>
+                <el-option value="musicGroupBuy" label="乐团课"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item>
+              <el-button
+                v-if="index != 0 && !domain.disabled"
+                @click.prevent="removeDomain(result, domain)"
+              >删除</el-button>
+            </el-form-item>
+          </div>
+          <!-- <div class="el-form-item__error" v-if="result.errorText">{{ result.errorText }}</div> -->
+        </div>
+        <el-form-item class="add">
+          <el-button icon="el-icon-plus" @click="addDomain(result)">新增</el-button>
         </el-form-item>
       </el-form>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="chargeStatus = false">取 消</el-button>
-        <el-button @click="onChargeSubmit('ruleForm')" type="primary">确 定</el-button>
-      </span>
-    </el-dialog>
+      <el-button style="margin-left: 100px" @click="onSaveDomain" type="primary">保 存</el-button>
+    </div>
 
     <el-dialog title="零星收费设置" :visible.sync="sporadicStatus" width="500px">
       <el-form :model="formSporadic" :rules="rulesSporadic" ref="ruleFormSporadic">
-        <el-form-item label="所属分部" prop="organId" :label-width="formLabelWidth2">
+        <el-form-item label="收款分部" prop="organId" :label-width="formLabelWidth2">
           <el-select v-model.trim="formSporadic.organId">
             <el-option
-              v-for="item in branchList2"
+              v-for="item in calcBranchList"
               :key="item.value"
               :label="item.label"
               :value="item.value.toString()"
@@ -72,22 +94,16 @@
             ></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="最大收款(元)" prop="maxReceipt" :label-width="formLabelWidth2">
+        <el-form-item label="金额(元)" prop="minReceipt" :label-width="formLabelWidth2">
           <el-input-number
             style="width: 100%;"
-            v-model="formSporadic.maxReceipt"
+            v-model="formSporadic.minReceipt"
             :precision="0"
             controls-position="right"
             :min="1"
             :max="999999999"
           ></el-input-number>
         </el-form-item>
-        <el-form-item label="是否承担手续费" prop="feeFlag" :label-width="formLabelWidth2">
-          <el-select v-model.trim="formSporadic.feeFlag" placeholder="请选择是否承担手续费">
-            <el-option value="Y" label="是"></el-option>
-            <el-option value="N" label="否"></el-option>
-          </el-select>
-        </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button @click="sporadicStatus = false">取 消</el-button>
@@ -101,7 +117,19 @@ import pagination from "@/components/Pagination/index";
 import { branchQueryPage } from "@/api/specialSetting";
 import { sysConfigList, sysConfigUpdate } from "@/api/generalSettings";
 import store from "@/store";
+import { getPaymentConfigs } from "./api";
 import { permission } from "@/utils/directivePage";
+let validAmount = (rule, value, callback) => {
+  if (!value) {
+    callback(new Error("请输入金额"));
+  } else if (value < 0) {
+    callback(new Error("输入金额必须大于0"));
+  } else if (value > 999999999) {
+    callback(new Error("输入金额必须小于999999999"));
+  } else {
+    callback();
+  }
+};
 export default {
   name: "chargeProfitManager",
   components: { pagination },
@@ -115,54 +143,75 @@ export default {
         total: 0, // 总条数
         page_size: [10, 20, 40, 50] // 选择限制显示条数
       },
-      chargeStatus: false,
       roleList: [], // 角色列表
       branchList: [], // 分部列表
-      branchList2: [], // 分部列表
-      formActionTitle: "create",
+      calcBranchList: [],
       formLabelWidth: "100px",
-      formTitle: {
-        create: "添加收费",
-        update: "修改收费"
-      },
-      form: {
-        organName: null,
-        organId: null,
-        money: null
-      },
-      rules: {
-        organId: [
-          { required: true, message: "请选择所属分部", trigger: "change" }
+      result: {
+        domains: [
+          {
+            organId: null,
+            routeOrganId: null,
+            amount: null,
+            type: null
+          }
         ],
-        money: [{ required: true, message: "请输入金额", trigger: "blur" }]
+        // errorText: null,
       },
+      validAmount: [
+        { required: true, validator: validAmount, trigger: 'blur' },
+        { type: 'number', message: '金额必须为数字值' }],
       selectId: null, // 编号
       selectItem: {}, // 选中对象
-      sporadicStatus: false, // {"organId":"2","maxReceipt":"75000","feeFlag":"Y"}
+      sporadicStatus: false, // {"organId":"2","minReceipt":"75000"}
       formLabelWidth2: "120px",
       sporadicId: null, // 零星收费编号
       formSporadic: {
         organId: null,
-        maxReceipt: 0,
-        feeFlag: null
+        minReceipt: 0
       },
       rulesSporadic: {
         organId: [
           { required: true, message: "请选择所属分部", trigger: "change" }
         ],
-        maxReceipt: [
-          { required: true, message: "请输入最大收款", trigger: "blur" }
-        ],
-        feeFlag: [
-          { required: true, message: "请选择是否承担手续费", trigger: "change" }
+        minReceipt: [
+          { required: true, message: "请输入金额", trigger: "blur" }
         ]
       }
     };
   },
   mounted() {
+    this.__init()
     this.getList();
   },
   methods: {
+    async __init() {
+      await branchQueryPage({
+        // 获取分部
+        delFlag: 0,
+        rows: 9999
+      }).then(res => {
+        this.branchList = [];
+        if (res.code == 200 && res.data && res.data.rows) {
+          res.data.rows.forEach(item => {
+            this.branchList.push({
+              label: item.name,
+              value: item.id
+            });
+          });
+        }
+      });
+      await getPaymentConfigs().then(res => {
+        if (res.code == 200 && res.data) {
+          res.data.forEach(item => {
+            this.calcBranchList.push({
+              label: item.organName,
+              value: item.organId
+            });
+          });
+        }
+      });
+    },
     permission (str) {
       return permission(str)
     },
@@ -184,55 +233,6 @@ export default {
         }
       });
     },
-    onChargeSubmit(formName) {
-      this.$refs[formName].validate(valid => {
-        if (valid) {
-          let value = {};
-          let str = "更新";
-          let form = this.form;
-          const money = form.money;
-          const organId = form.organId;
-          let status = false;
-          if (this.formActionTitle == "create") {
-            value[money] = organId;
-            str = "添加";
-            this.tableList.forEach(item => {
-              value[item.money] = item.organId;
-              if (item.money == money) {
-                this.$message.error("输入金额不能重复");
-                status = true;
-              }
-            });
-          } else if (this.formActionTitle == "update") {
-            const selectItem = this.selectItem;
-            selectItem.organId = form.organId;
-            selectItem.money = form.money;
-            this.tableList.forEach(item => {
-              value[item.money] = item.organId;
-              if (item.money == money && item.key != selectItem.key) {
-                this.$message.error("输入金额不能重复");
-                status = true;
-              }
-            });
-          }
-          if (status) {
-            return;
-          }
-          let params = {
-            id: this.selectId,
-            paranValue: JSON.stringify(value),
-            paramName: "amount_channel"
-          };
-          sysConfigUpdate(params).then(res => {
-            if (res.code == 200) {
-              this.messageTips(str, res);
-            }
-          });
-        } else {
-          return;
-        }
-      });
-    },
     messageTips(title, res) {
       if (res.code == 200) {
         this.$message.success(title + "成功");
@@ -244,116 +244,89 @@ export default {
       }
     },
     async getList() {
-      await branchQueryPage({
-        // 获取分部
-        delFlag: 0,
-        rows: 9999
-      }).then(res => {
-        this.branchList = [];
-        this.branchList2 = [];
-        if (res.code == 200 && res.data && res.data.rows) {
-          res.data.rows.forEach(item => {
-            this.branchList.push({
-              label: item.name,
-              value: item.id
-            });
-            this.branchList2.push({
-              label: item.name,
-              value: item.id
-            });
-          });
-        }
-      });
       await sysConfigList({ group: "payment_config" }).then(res => {
         if (res.code == 200 && res.data.length > 0) {
           let tempResult = [];
           let paranValue = {};
           res.data.forEach((item, index) => {
             if (item.paramName === "amount_channel") {
-              paranValue = item.paranValue ? JSON.parse(item.paranValue) : {};
+              paranValue = item.paranValue ? JSON.parse(item.paranValue) : [];
               this.selectId = item.id;
+              this.result.domains = []
+              paranValue.forEach((item, index) => {
+                // let disabled = true
+                // if(paranValue.length - 1 === index) {
+                //   disabled = false
+                // }
+                this.result.domains.push({
+                  organId: item.organId,
+                  routeOrganId: item.routeOrganId,
+                  amount: item.amount,
+                  type: item.type
+                })
+              })
             }
             if (item.paramName === "sporadic_channel") {
               this.formSporadic = item.paranValue
                 ? JSON.parse(item.paranValue)
-                : { organId: null, maxReceipt: 0, feeFlag: null };
+                : { organId: null, minReceipt: 0 };
+              console.log(this.formSporadic)
               this.sporadicId = item.id;
             }
           });
-          this.branchList.forEach(item => {
-            for (let key in paranValue) {
-              if (paranValue[key] == item.value) {
-                tempResult.push({
-                  organId: item.value,
-                  organName: item.label,
-                  money: key,
-                  key: +new Date() + item.value
-                });
-              }
-            }
-          });
-          this.tableList = tempResult;
         }
       });
     },
-    chargeOperation(type, data) {
-      this.formActionTitle = type;
-      this.chargeStatus = true;
-      this.branchList.forEach(item => {
-        this.tableList.forEach(table => {
-          if (item.value == table.organId) {
-            item.disabled = true;
-          }
-        });
-      });
-      // 修改的时候
-      if (type == "update") {
-        this.form = {
-          organId: data.organId,
-          organName: data.organName,
-          money: data.money,
-          key: data.key
-        };
-        this.selectItem = data;
-      } else if (type == "create") {
-      }
-    },
-    chargeDel(row) {
-      // 删除数据
-      this.$confirm("你确定删除?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
-        .then(() => {
-          let value = {};
-          this.tableList.forEach(item => {
-            if (row.organId != item.organId) {
-              value[item.money] = item.organId;
-            }
-          });
+    onSaveDomain() { // 保存设置
+      this.$refs["ruleFormValid"].validate(valid => {
+        if(valid) {
+          const domain = this.result.domains
           let params = {
             id: this.selectId,
-            paranValue: JSON.stringify(value),
+            paranValue: JSON.stringify(domain),
             paramName: "amount_channel"
           };
           sysConfigUpdate(params).then(res => {
             if (res.code == 200) {
-              this.messageTips("删除", res);
+              this.messageTips("保存", res);
             }
           });
-        })
-        .catch();
+        } else {
+          return
+        }
+      })
+    },
+    addDomain(form, checked) {
+      let domains = form.domains,
+        forms = this.form,
+        singleLength = domains.length,
+        lastDate = domains[singleLength - 1]; // 获取倒数一个对象
+      this.$refs["ruleFormValid"].validate(valid => {
+        if(valid) {
+          if (!checked) {
+            lastDate.disabled = true;
+            domains.push({
+              organId: null,
+              routeOrganId: null,
+              amount: null,
+              type: null,
+              disabled: false
+            });
+          }
+        } else {
+          return
+        }
+      })
+    },
+    removeDomain(form, item) {
+      var index = form.domains.indexOf(item);
+      if (index !== -1) {
+        form.domains.splice(index, 1);
+        // 取消最后一个数据的禁用状态
+        form.domains[form.domains.length - 1].disabled = false;
+        // form.errorText = null;
+      }
     },
-    onFormClose(formName) {
-      this.form = {
-        organName: null,
-        organId: null,
-        money: null
-      };
-      // 关闭弹窗重置验证
-      this.$refs[formName].resetFields();
-    }
   }
 };
 </script>
@@ -383,4 +356,54 @@ export default {
 .newBand {
   display: inline-block;
 }
+
+
+.moreRule {
+  background: #f8f8f8;
+  position: relative;
+
+  .el-form-item__error {
+    color: #f56c6c;
+    font-size: 12px;
+    line-height: 1;
+    position: absolute;
+    left: 120px;
+    top: 100%;
+    margin-top: -21px;
+  }
+}
+.add {
+  margin-bottom: 22px;
+  background: #f8f8f8;
+  padding-bottom: 22px;
+  padding-left: 100px;
+}
+.moreRuleIn {
+  .el-form-item {
+    display: inline-block;
+    &:first-child {
+      /deep/.el-form-item__content {
+        margin-left: 100px !important;
+      }
+    }
+    /deep/.el-form-item__content {
+      margin-left: 0 !important;
+    }
+  }
+
+  .setWidth {
+    /deep/.el-form-item__content {
+      width: 180px;
+    }
+  }
+  /deep/.el-input-group__append {
+    padding: 0 8px;
+  }
+}
+.min,
+.max {
+  display: inline-block;
+  width: 180px;
+  text-align: center;
+}
 </style>

+ 386 - 0
src/views/chargeManager/twoTemp.vue

@@ -0,0 +1,386 @@
+<template>
+  <div class="m-container">
+    <div class="m-core">
+      <div @click="chargeOperation('create')" v-permission="'sysConfig/update'" class="newBand">添加</div>
+      <div @click="sporadicStatus = true" v-permission="'sysConfig/update'" class="newBand">零星收费设置</div>
+
+      <!-- 列表 -->
+      <div class="tableWrap">
+        <el-table :data="tableList" :header-cell-style="{background:'#EDEEF0',color:'#444'}">
+          <el-table-column align="center" prop="organName" label="分部"></el-table-column>
+          <el-table-column align="center" prop="money" label="金额(元)"></el-table-column>
+          <el-table-column align="center" width="250px" label="操作">
+            <template slot-scope="scope">
+              <el-button v-if="permission('sysConfig/update')" @click="chargeOperation('update', scope.row)" type="text">修改</el-button>
+              <el-button v-if="permission('sysConfig/update')" @click="chargeDel(scope.row)" type="text">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <!-- <pagination :total="pageInfo.total"
+                    :page.sync="pageInfo.page"
+                    :limit.sync="pageInfo.limit"
+                    :page-sizes="pageInfo.page_size"
+        @pagination="getList" />-->
+      </div>
+    </div>
+
+    <el-dialog
+      :title="formTitle[formActionTitle]"
+      :visible.sync="chargeStatus"
+      @close="onFormClose('ruleForm')"
+      width="500px"
+    >
+      <el-form :model="form" :rules="rules" ref="ruleForm">
+        <el-form-item label="所属分部" prop="organId" :label-width="formLabelWidth">
+          <el-select v-model.trim="form.organId">
+            <el-option
+              v-for="item in branchList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+              :disabled="item.disabled"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="金额(元)" prop="money" :label-width="formLabelWidth">
+          <el-input-number
+            style="width: 100%;"
+            v-model="form.money"
+            :precision="0"
+            controls-position="right"
+            :min="1"
+            :max="999999999"
+          ></el-input-number>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="chargeStatus = false">取 消</el-button>
+        <el-button @click="onChargeSubmit('ruleForm')" type="primary">确 定</el-button>
+      </span>
+    </el-dialog>
+
+    <el-dialog title="零星收费设置" :visible.sync="sporadicStatus" width="500px">
+      <el-form :model="formSporadic" :rules="rulesSporadic" ref="ruleFormSporadic">
+        <el-form-item label="所属分部" prop="organId" :label-width="formLabelWidth2">
+          <el-select v-model.trim="formSporadic.organId">
+            <el-option
+              v-for="item in branchList2"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value.toString()"
+              :disabled="item.disabled"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="最大收款(元)" prop="maxReceipt" :label-width="formLabelWidth2">
+          <el-input-number
+            style="width: 100%;"
+            v-model="formSporadic.maxReceipt"
+            :precision="0"
+            controls-position="right"
+            :min="1"
+            :max="999999999"
+          ></el-input-number>
+        </el-form-item>
+        <el-form-item label="是否承担手续费" prop="feeFlag" :label-width="formLabelWidth2">
+          <el-select v-model.trim="formSporadic.feeFlag" placeholder="请选择是否承担手续费">
+            <el-option value="Y" label="是"></el-option>
+            <el-option value="N" label="否"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="sporadicStatus = false">取 消</el-button>
+        <el-button @click="onSporadicSubmit('ruleFormSporadic')" type="primary">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import pagination from "@/components/Pagination/index";
+import { branchQueryPage } from "@/api/specialSetting";
+import { sysConfigList, sysConfigUpdate } from "@/api/generalSettings";
+import store from "@/store";
+import { permission } from "@/utils/directivePage";
+export default {
+  name: "chargeProfitManager",
+  components: { pagination },
+  data() {
+    return {
+      tableList: [],
+      pageInfo: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
+      },
+      chargeStatus: false,
+      roleList: [], // 角色列表
+      branchList: [], // 分部列表
+      branchList2: [], // 分部列表
+      formActionTitle: "create",
+      formLabelWidth: "100px",
+      formTitle: {
+        create: "添加收费",
+        update: "修改收费"
+      },
+      form: {
+        organName: null,
+        organId: null,
+        money: null
+      },
+      rules: {
+        organId: [
+          { required: true, message: "请选择所属分部", trigger: "change" }
+        ],
+        money: [{ required: true, message: "请输入金额", trigger: "blur" }]
+      },
+      selectId: null, // 编号
+      selectItem: {}, // 选中对象
+      sporadicStatus: false, // {"organId":"2","maxReceipt":"75000","feeFlag":"Y"}
+      formLabelWidth2: "120px",
+      sporadicId: null, // 零星收费编号
+      formSporadic: {
+        organId: null,
+        maxReceipt: 0,
+        feeFlag: null
+      },
+      rulesSporadic: {
+        organId: [
+          { required: true, message: "请选择所属分部", trigger: "change" }
+        ],
+        maxReceipt: [
+          { required: true, message: "请输入最大收款", trigger: "blur" }
+        ],
+        feeFlag: [
+          { required: true, message: "请选择是否承担手续费", trigger: "change" }
+        ]
+      }
+    };
+  },
+  mounted() {
+    this.getList();
+  },
+  methods: {
+    permission (str) {
+      return permission(str)
+    },
+    onSporadicSubmit(formName) {
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          let params = {
+            id: this.sporadicId,
+            paranValue: JSON.stringify(this.formSporadic),
+            paramName: "sporadic_channel"
+          };
+          sysConfigUpdate(params).then(res => {
+            if (res.code == 200) {
+              this.messageTips("保存", res);
+            }
+          });
+        } else {
+          return;
+        }
+      });
+    },
+    onChargeSubmit(formName) {
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          let value = {};
+          let str = "更新";
+          let form = this.form;
+          const money = form.money;
+          const organId = form.organId;
+          let status = false;
+          if (this.formActionTitle == "create") {
+            value[money] = organId;
+            str = "添加";
+            this.tableList.forEach(item => {
+              value[item.money] = item.organId;
+              if (item.money == money) {
+                this.$message.error("输入金额不能重复");
+                status = true;
+              }
+            });
+          } else if (this.formActionTitle == "update") {
+            const selectItem = this.selectItem;
+            selectItem.organId = form.organId;
+            selectItem.money = form.money;
+            this.tableList.forEach(item => {
+              value[item.money] = item.organId;
+              if (item.money == money && item.key != selectItem.key) {
+                this.$message.error("输入金额不能重复");
+                status = true;
+              }
+            });
+          }
+          if (status) {
+            return;
+          }
+          let params = {
+            id: this.selectId,
+            paranValue: JSON.stringify(value),
+            paramName: "amount_channel"
+          };
+          sysConfigUpdate(params).then(res => {
+            if (res.code == 200) {
+              this.messageTips(str, res);
+            }
+          });
+        } else {
+          return;
+        }
+      });
+    },
+    messageTips(title, res) {
+      if (res.code == 200) {
+        this.$message.success(title + "成功");
+        this.chargeStatus = false;
+        this.sporadicStatus = false;
+        this.getList();
+      } else {
+        this.$message.error(res.msg);
+      }
+    },
+    async getList() {
+      await branchQueryPage({
+        // 获取分部
+        delFlag: 0,
+        rows: 9999
+      }).then(res => {
+        this.branchList = [];
+        this.branchList2 = [];
+        if (res.code == 200 && res.data && res.data.rows) {
+          res.data.rows.forEach(item => {
+            this.branchList.push({
+              label: item.name,
+              value: item.id
+            });
+            this.branchList2.push({
+              label: item.name,
+              value: item.id
+            });
+          });
+        }
+      });
+      await sysConfigList({ group: "payment_config" }).then(res => {
+        if (res.code == 200 && res.data.length > 0) {
+          let tempResult = [];
+          let paranValue = {};
+          res.data.forEach((item, index) => {
+            if (item.paramName === "amount_channel") {
+              paranValue = item.paranValue ? JSON.parse(item.paranValue) : {};
+              this.selectId = item.id;
+            }
+            if (item.paramName === "sporadic_channel") {
+              this.formSporadic = item.paranValue
+                ? JSON.parse(item.paranValue)
+                : { organId: null, maxReceipt: 0, feeFlag: null };
+              this.sporadicId = item.id;
+            }
+          });
+          this.branchList.forEach(item => {
+            for (let key in paranValue) {
+              if (paranValue[key] == item.value) {
+                tempResult.push({
+                  organId: item.value,
+                  organName: item.label,
+                  money: key,
+                  key: +new Date() + item.value
+                });
+              }
+            }
+          });
+          this.tableList = tempResult;
+        }
+      });
+    },
+    chargeOperation(type, data) {
+      this.formActionTitle = type;
+      this.chargeStatus = true;
+      this.branchList.forEach(item => {
+        this.tableList.forEach(table => {
+          if (item.value == table.organId) {
+            item.disabled = true;
+          }
+        });
+      });
+      // 修改的时候
+      if (type == "update") {
+        this.form = {
+          organId: data.organId,
+          organName: data.organName,
+          money: data.money,
+          key: data.key
+        };
+        this.selectItem = data;
+      } else if (type == "create") {
+      }
+    },
+    chargeDel(row) {
+      // 删除数据
+      this.$confirm("你确定删除?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          let value = {};
+          this.tableList.forEach(item => {
+            if (row.organId != item.organId) {
+              value[item.money] = item.organId;
+            }
+          });
+          let params = {
+            id: this.selectId,
+            paranValue: JSON.stringify(value),
+            paramName: "amount_channel"
+          };
+          sysConfigUpdate(params).then(res => {
+            if (res.code == 200) {
+              this.messageTips("删除", res);
+            }
+          });
+        })
+        .catch();
+    },
+    onFormClose(formName) {
+      this.form = {
+        organName: null,
+        organId: null,
+        money: null
+      };
+      // 关闭弹窗重置验证
+      this.$refs[formName].resetFields();
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+/deep/.el-button--primary {
+  background: #14928a;
+  border-color: #14928a;
+  color: #fff;
+  &:hover,
+  &:active,
+  &:focus {
+    background: #14928a;
+    border-color: #14928a;
+    color: #fff;
+  }
+}
+/deep/.el-dialog__body {
+  padding: 0 20px;
+}
+/deep/.el-select,
+/deep/.el-date-editor.el-input {
+  width: 100% !important;
+}
+/deep/.el-input-number.is-controls-right .el-input__inner {
+  text-align: left;
+}
+.newBand {
+  display: inline-block;
+}
+</style>

部分文件因文件數量過多而無法顯示