|
|
@@ -61,34 +61,48 @@
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
- <!-- 开关配置对话框 -->
|
|
|
- <el-dialog title="开关配置" :visible.sync="switchDialogVisible" width="500px" class="switch-dialog">
|
|
|
- <el-form :model="switchForm" label-width="100px">
|
|
|
- <el-form-item label="AppId">
|
|
|
- <el-input v-model="switchForm.appId" :disabled="true"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="开关状态">
|
|
|
- <el-switch
|
|
|
- v-model="switchForm.switchStatus"
|
|
|
- active-text="开启"
|
|
|
- inactive-text="关闭"
|
|
|
- active-value="001"
|
|
|
- inactive-value="002">
|
|
|
- </el-switch>
|
|
|
+ <!-- 绑定商户弹窗 -->
|
|
|
+ <el-dialog title="绑定商户" :visible.sync="bindDialog.open" width="500px" append-to-body>
|
|
|
+ <el-form ref="bindForm" :model="bindDialog.form" label-width="100px">
|
|
|
+ <el-form-item label="商户类型" prop="merchantType">
|
|
|
+ <el-select
|
|
|
+ v-model="bindDialog.form.merchantType"
|
|
|
+ placeholder="请选择商户类型"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ style="width: 100%"
|
|
|
+ @change="handleMerchantTypeChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="dict in merchantTypeOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="配置信息" v-if="switchForm.configInfo">
|
|
|
- <el-input
|
|
|
- type="textarea"
|
|
|
- :rows="4"
|
|
|
- v-model="switchForm.configInfo"
|
|
|
- :disabled="true">
|
|
|
- </el-input>
|
|
|
+ <el-form-item label="商户号" prop="merchantId">
|
|
|
+ <el-select
|
|
|
+ v-model="bindDialog.form.merchantId"
|
|
|
+ placeholder="请选择商户号"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ style="width: 100%"
|
|
|
+ :disabled="!bindDialog.form.merchantType"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in merchantOptions"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.merchantId"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="switchDialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitSwitchConfig">确 定</el-button>
|
|
|
- </span>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitBind">确 定</el-button>
|
|
|
+ <el-button @click="bindDialog.open = false">取 消</el-button>
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
|
|
|
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange" border>
|
|
|
@@ -117,6 +131,11 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" />
|
|
|
<el-table-column label="修改时间" align="center" prop="updateTime" />
|
|
|
+ <el-table-column label="商户号" align="center" prop="merchantNo">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.merchantNo || '未绑定' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
@@ -136,9 +155,9 @@
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
- icon="el-icon-setting"
|
|
|
- @click="handleSwitchConfig(scope.row)"
|
|
|
- >是否展示销售</el-button>
|
|
|
+ icon="el-icon-link"
|
|
|
+ @click="handleBind(scope.row)"
|
|
|
+ >绑定</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -201,17 +220,13 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {list, get, update, add, del, updateIsTownOn} from '@/api/course/coursePlaySourceConfig'
|
|
|
+import {list, get, update, add, del, bindMerchant} from '@/api/course/coursePlaySourceConfig'
|
|
|
+import {listMerchantAppConfig} from '@/api/merchantAppConfig/merchantAppConfig'
|
|
|
|
|
|
export default {
|
|
|
name: 'CoursePlaySourceConfig',
|
|
|
data() {
|
|
|
return {
|
|
|
- switchDialogVisible: false,
|
|
|
- switchForm: {
|
|
|
- appId: '',
|
|
|
- switchStatus: '001',
|
|
|
- },
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
@@ -226,6 +241,16 @@ export default {
|
|
|
list: [],
|
|
|
total: 0,
|
|
|
typesOptions: [],
|
|
|
+ merchantTypeOptions: [],
|
|
|
+ merchantOptions: [],
|
|
|
+ bindDialog: {
|
|
|
+ open: false,
|
|
|
+ currentAppId: null,
|
|
|
+ form: {
|
|
|
+ merchantType: null,
|
|
|
+ merchantId: null
|
|
|
+ }
|
|
|
+ },
|
|
|
title: null,
|
|
|
open: false,
|
|
|
form: {},
|
|
|
@@ -268,53 +293,54 @@ export default {
|
|
|
listClass: 'primary'}
|
|
|
})
|
|
|
});
|
|
|
+ this.getDicts("sys_pay_mode").then(response => {
|
|
|
+ this.merchantTypeOptions = response.data;
|
|
|
+ });
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
|
|
|
|
|
|
- // 处理开关配置
|
|
|
- handleSwitchConfig(row) {
|
|
|
- this.switchForm.appId = row.appid;
|
|
|
- this.switchForm.switchStatus = "001"; // 默认关闭状态
|
|
|
-
|
|
|
- // 调用接口获取开关状态
|
|
|
- this.getSwitchConfig(row.appid);
|
|
|
- this.switchDialogVisible = true;
|
|
|
+ // 打开绑定弹窗
|
|
|
+ handleBind(row) {
|
|
|
+ this.bindDialog.currentAppId = row.appid;
|
|
|
+ this.bindDialog.form.merchantType = null;
|
|
|
+ this.bindDialog.form.merchantId = null;
|
|
|
+ this.merchantOptions = [];
|
|
|
+ this.bindDialog.open = true;
|
|
|
},
|
|
|
-
|
|
|
- // 获取开关配置
|
|
|
- getSwitchConfig(appId) {
|
|
|
- const params = {
|
|
|
- appId: this.switchForm.appId
|
|
|
- };
|
|
|
- updateIsTownOn(params).then(response=>{
|
|
|
- if (response.code === 200) {
|
|
|
- if ( response.date){
|
|
|
- this.switchForm.switchStatus = response.date;
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.$message.error('获取配置失败: ' + response.msg);
|
|
|
- }
|
|
|
- }).catch(error => {
|
|
|
- this.$message.error('请求失败: ' + error.message);
|
|
|
+ // 商户类型变更时查询商户
|
|
|
+ handleMerchantTypeChange(val) {
|
|
|
+ if (!val) {
|
|
|
+ this.merchantOptions = [];
|
|
|
+ this.bindDialog.form.merchantId = null;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ listMerchantAppConfig({
|
|
|
+ merchantType: val,
|
|
|
+ appIds: this.bindDialog.currentAppId,
|
|
|
+ isDeleted: '0'
|
|
|
+ }).then(res => {
|
|
|
+ this.merchantOptions = res.rows || [];
|
|
|
+ this.bindDialog.form.merchantId = null;
|
|
|
+ }).catch(() => {
|
|
|
+ this.merchantOptions = [];
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
- // 提交开关配置
|
|
|
- submitSwitchConfig() {
|
|
|
- const params = {
|
|
|
- appId: this.switchForm.appId,
|
|
|
- bock: this.switchForm.switchStatus
|
|
|
- };
|
|
|
- updateIsTownOn(params).then(response=>{
|
|
|
- if (response.code === 200) {
|
|
|
- this.$message.success('配置更新成功');
|
|
|
- this.switchDialogVisible = false;
|
|
|
- } else {
|
|
|
- this.$message.error('更新失败: ' + response.msg);
|
|
|
- }
|
|
|
- })
|
|
|
+ // 确认绑定
|
|
|
+ submitBind() {
|
|
|
+ if (!this.bindDialog.form.merchantId) {
|
|
|
+ this.$message.warning("请选择商户号");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ bindMerchant({
|
|
|
+ appId: this.bindDialog.currentAppId,
|
|
|
+ merchantConfigId: this.bindDialog.form.merchantId
|
|
|
+ }).then(res => {
|
|
|
+ this.msgSuccess("绑定成功");
|
|
|
+ this.bindDialog.open = false;
|
|
|
+ this.getList();
|
|
|
+ }).catch(() => {});
|
|
|
},
|
|
|
|
|
|
|