| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045 |
- <template>
- <div class="app-container">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
- <el-form-item label="名称" prop="name">
- <el-input
- v-model="queryParams.name"
- placeholder="请输入名称"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="所属公司" prop="companyId">
- <el-select
- v-model="queryParams.companyId"
- filterable
- remote
- reserve-keyword
- placeholder="请输入公司名称搜索"
- :remote-method="searchCompanies"
- :loading="companySearchLoading"
- style="width: 220px"
- clearable
- size="small"
- >
- <el-option
- v-for="item in companyOptions"
- :key="item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="appid" prop="appid">
- <el-input
- v-model="queryParams.appid"
- placeholder="请输入appid"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <!-- <el-form-item label="状态" prop="status">-->
- <!-- <el-select-->
- <!-- v-model="queryParams.status"-->
- <!-- placeholder="请选择状态"-->
- <!-- clearable-->
- <!-- size="small"-->
- <!-- >-->
- <!-- <el-option-->
- <!-- v-for="item in statusOptions"-->
- <!-- :key="item.value"-->
- <!-- :label="item.label"-->
- <!-- :value="item.value"-->
- <!-- />-->
- <!-- </el-select>-->
- <!-- </el-form-item>-->
- <el-form-item>
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
- </el-form-item>
- </el-form>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- plain
- icon="el-icon-plus"
- size="mini"
- @click="handleAdd"
- v-hasPermi="['course:playSourceConfig:add']"
- >新增</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="success"
- plain
- icon="el-icon-edit"
- size="mini"
- :disabled="single"
- @click="handleUpdate"
- v-hasPermi="['course:playSourceConfig:edit']"
- >修改</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="danger"
- plain
- icon="el-icon-delete"
- size="mini"
- :disabled="multiple"
- @click="handleDelete"
- v-hasPermi="['course:playSourceConfig:remove']"
- >删除</el-button>
- </el-col>
- <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-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>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="switchDialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="submitSwitchConfig">确 定</el-button>
- </span>
- </el-dialog>
- <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange" border>
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column label="ID" align="center" prop="id" />
- <el-table-column label="名称" align="center" prop="name" />
- <!-- <el-table-column label="所属公司" align="center" prop="companyId" :formatter="companyNameFormatter"/>-->
- <el-table-column label="图标" align="center" prop="img">
- <template slot-scope="scope">
- <el-image
- style="width: 80px; height: 80px"
- :src="scope.row.img"
- :preview-src-list="[scope.row.img]">
- </el-image>
- </template>
- </el-table-column>
- <el-table-column label="原始ID" align="center" prop="originalId" />
- <el-table-column label="appId" align="center" prop="appid" />
- <el-table-column label="secret" align="center" prop="secret" />
- <el-table-column label="msgDataFormat" align="center" prop="msgDataFormat" />
- <el-table-column label="积分商品" align="center" prop="integralGoods">
- <template slot-scope="scope">
- <div v-if="scope.row.integralGoods">
- <el-tooltip
- v-for="id in scope.row.integralGoods.split(',')"
- :key="id"
- :content="getGoodsNameById(id)"
- placement="top"
- :open-delay="300"
- >
- <el-tag
- size="small"
- style="margin-right: 4px; margin-bottom: 4px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"
- >
- {{ getGoodsNameById(id) }}
- </el-tag>
- </el-tooltip>
- </div>
- <span v-else>-</span>
- </template>
- </el-table-column>
- <!-- <el-table-column label="类型" align="center" prop="type">-->
- <!-- <template slot-scope="scope">-->
- <!-- <dict-tag :options="typesOptions" :value="scope.row.type"/>-->
- <!-- </template>-->
- <!-- </el-table-column>-->
- <!-- <el-table-column label="授权方式" align="center" prop="authType">-->
- <!-- <template slot-scope="scope">-->
- <!-- <dict-tag :options="authTypeOptions" :value="scope.row.authType"/>-->
- <!-- </template>-->
- <!-- </el-table-column>-->
- <el-table-column label="互医/商城小程序" align="center" prop="isMall" width="80px">
- <template slot-scope="scope">
- <el-tag prop="isMall" v-for="(item, index) in isMallOptions" v-if="scope.row.isMall==item.dictValue">{{item.dictLabel}}</el-tag>
- </template>
- </el-table-column>
- <el-table-column label="状态" align="center" prop="status" width="100px">
- <template slot-scope="scope">
- <el-tag
- :type="scope.row.status === 0 ? 'success' : scope.row.status === 1 ? 'warning' : 'danger'"
- >
- {{ getStatusLabel(scope.row.status) }}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column label="配置绑定Id" align="center" prop="merchantConfigId" width="85px"/>
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['course:playSourceConfig:edit']"
- >修改</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDelete(scope.row)"
- v-hasPermi="['course:playSourceConfig:remove']"
- >删除</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-setting"
- @click="handleSwitchConfig(scope.row)"
- >展示销售</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleBind(scope.row)"
- v-hasPermi="['course:playSourceConfig:bind']"
- v-if="!scope.row.merchantConfigId"
- >绑定商户</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUnbind(scope.row)"
- v-hasPermi="['course:playSourceConfig:unbind']"
- v-if="scope.row.merchantConfigId"
- >解绑</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-document"
- @click="handleAgreement(scope.row)"
- v-hasPermi="['course:playSourceConfig:agreement']"
- >协议配置</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- <!-- 添加或修改点播配置对话框 -->
- <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body :before-close="resetOption">
- <el-form ref="form" :model="form" :rules="rules" label-width="130px">
- <el-form-item label="名称" prop="name">
- <el-input v-model="form.name" placeholder="请输入名称" />
- </el-form-item>
- <el-form-item label="所属公司" prop="companyId">
- <el-select
- v-model="form.companyId"
- filterable
- remote
- reserve-keyword
- placeholder="请输入公司名称搜索"
- :remote-method="searchCompanies"
- :loading="companySearchLoading"
- style="width: 220px"
- clearable
- size="small"
- >
- <el-option
- v-for="item in companyOptions"
- :key="item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="可查看设置公司" prop="setCompanyIdList">
- <el-select
- v-model="form.setCompanyIdList"
- filterable
- multiple
- remote
- reserve-keyword
- placeholder="请输入公司名称搜索"
- :remote-method="searchCompanies"
- :loading="companySearchLoading"
- style="width: 220px"
- clearable
- size="small"
- >
- <el-option
- v-for="item in companyOptions"
- :key="item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="是否是互医/商城小程序" prop="isMall">
- <el-select
- v-model="form.isMall"
- style="width: 220px"
- clearable
- size="small"
- >
- <el-option
- v-for="item in isMallOptions"
- :key="item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="状态" prop="status">
- <el-select
- v-model="form.status"
- placeholder="请选择状态"
- style="width: 220px"
- clearable
- size="small"
- >
- <el-option
- v-for="item in statusOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="图标" prop="img">
- <image-upload v-model="form.img" :file-type='["png", "jpg", "jpeg"]' :limit="1"/>
- </el-form-item>
- <el-form-item label="授权方式" prop="authType">
- <el-select
- v-model="form.authType"
- placeholder="请选择授权方式">
- <el-option
- v-for="item in authTypeOptions"
- :key="item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"/>
- </el-select>
- </el-form-item>
- <el-form-item label="类型" prop="type">
- <el-select
- v-model="form.type"
- placeholder="请选择类型">
- <el-option
- v-for="item in typesOptions"
- :key="item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"/>
- </el-select>
- </el-form-item>
- <el-form-item label="原始id" prop="originalId">
- <el-input v-model="form.originalId" placeholder="请输入原始id" />
- </el-form-item>
- <el-form-item label="appid" prop="appid">
- <el-input v-model="form.appid" placeholder="请输入appid" />
- </el-form-item>
- <el-form-item label="secret" prop="secret">
- <el-input v-model="form.secret" placeholder="请输入secret" />
- </el-form-item>
- <el-form-item label="msgDataFormat" prop="msgDataFormat">
- <el-input v-model="form.msgDataFormat" placeholder="请输入msgDataFormat" />
- </el-form-item>
- <el-form-item label="客服电话" prop="customerNum">
- <el-input v-model="form.customerNum" placeholder="请输入客服电话" />
- </el-form-item>
- <el-form-item label="备案号" prop="recordNumber">
- <el-input v-model="form.recordNumber" placeholder="请输入备案号" />
- </el-form-item>
- <el-form-item label="积分商品配置" prop="integralGoods" >
- <el-select
- v-model="form.integralGoods"
- filterable
- multiple
- remote
- reserve-keyword
- placeholder="请选择积分商品配置"
- clearable
- style="width: 625px"
- size="small"
- >
- <el-option
- v-for="item in IntegralGoodsList"
- :key="item.goodsId"
- :label="`${item.goodsName} 【所需积分: ${item.integral} / 需支付现金: ${item.cash} 元】`"
- :value="item.goodsId"
- :disabled="form.integralGoods && form.integralGoods.length >= 3 && !form.integralGoods.includes(item.goodsId)"
- />
- </el-select>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="showOpenPlatformWarning">确 定</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 协议配置对话框 -->
- <el-dialog title="协议配置" :visible.sync="agreementDialogVisible" width="1000px" append-to-body>
- <el-form ref="agreementForm" :model="agreementForm" :rules="agreementRules" label-width="150px" style="margin-right: 25px">
- <el-form-item label="医生注册协议" prop="doctorRegister">
- <editor v-model="agreementForm.doctorRegister" :min-height="200"/>
- </el-form-item>
- <el-form-item label="医生多机构备案协议" prop="doctorFiling">
- <editor v-model="agreementForm.doctorFiling" :min-height="200"/>
- </el-form-item>
- <el-form-item label="用户协议" prop="userRegister">
- <editor v-model="agreementForm.userRegister" :min-height="200"/>
- </el-form-item>
- <el-form-item label="隐私协议" prop="userPrivacy">
- <editor v-model="agreementForm.userPrivacy" :min-height="200"/>
- </el-form-item>
- <el-form-item label="健康客服协议" prop="userHealth">
- <editor v-model="agreementForm.userHealth" :min-height="200"/>
- </el-form-item>
- <el-form-item label="会员服务协议" prop="vipService">
- <editor v-model="agreementForm.vipService" :min-height="200"/>
- </el-form-item>
- <el-form-item label="会员自动续费协议" prop="vipAutomaticService">
- <editor v-model="agreementForm.vipAutomaticService" :min-height="200"/>
- </el-form-item>
- <el-form-item label="用户注销协议" prop="userRemoveService">
- <editor v-model="agreementForm.userRemoveService" :min-height="200"/>
- </el-form-item>
- <el-form-item label="APP用户协议" prop="appUserAgreement">
- <editor v-model="agreementForm.appUserAgreement" :min-height="200"/>
- </el-form-item>
- <el-form-item label="APP隐私协议" prop="appPrivacyAgreement">
- <editor v-model="agreementForm.appPrivacyAgreement" :min-height="200"/>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="agreementDialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="submitAgreementForm">确 定</el-button>
- </div>
- </el-dialog>
- <!-- 绑定 -->
- <el-dialog :title="bindForm.bindTitle" :visible.sync="bindForm.bindShow" width="800px" append-to-body :before-close="handleBindClose">
- <el-form ref="bindForm" :model="bindForm" :rules="bindRules" label-width="130px">
- <el-form-item label="商户类型" prop="merchantType">
- <el-select v-model="bindForm.merchantType" placeholder="请选择商户类型" clearable size="small" @change="changeSysPayModes">
- <el-option
- v-for="dict in sysPayModes"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="商户号" prop="merchantId">
- <el-select v-model="bindForm.id" placeholder="请选择商户号" clearable size="small">
- <el-option
- v-for="dict in merchantAppConfigList"
- :key="dict.id"
- :label="dict.merchantId"
- :value="dict.id"
- />
- </el-select>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitFormBind(bindCurrentRow)" >确 定</el-button>
- <el-button @click="cancelBind">取 消</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- list,
- get,
- update,
- add,
- del,
- updateBindConfig,
- updateUnbindConfig,
- updateAgreementConfig,
- queryAgreementConfig
- } from '@/api/course/coursePlaySourceConfig'
- import {updateIsTownOn} from "@/api/system/config";
- import { allList } from '@/api/company/company'
- import { resetForm } from '@/utils/common'
- import { listMerchantAppConfig } from "@/api/merchantAppConfig/merchantAppConfig";
- import { norIntegralGoodsList } from '@/api/his/integralGoods'
- export default {
- name: 'CoursePlaySourceConfig',
- data() {
- return {
- sysPayModes: [],
- bindCurrentRow: {},
- authTypeOptions: [],
- bindForm:{
- bindTitle: '绑定支付配置',
- bindShow: false,
- merchantType: null,
- id:null,
- },
- merchantAppConfigList:[],
- switchDialogVisible: false,
- // 公司搜索相关
- companySearchLoading: false,
- companyOptions: [],
- formatterCompanyOptions: [],
- switchForm: {
- appId: '',
- switchStatus: '001',
- },
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- name: null,
- appid: null,
- status: null
- },
- // 协议配置相关
- agreementDialogVisible: false,
- agreementForm: {
- appId: null,
- doctorRegister: '',
- doctorFiling: '',
- userRegister: '',
- userPrivacy: '',
- userHealth: '',
- vipService: '',
- vipAutomaticService: '',
- userRemoveService: '',
- appUserAgreement: '',
- appPrivacyAgreement: ''
- },
- agreementRules: {
- // doctorRegister: [
- // { required: true, message: "医生注册协议不能为空", trigger: "blur" }
- // ],
- // userRegister: [
- // { required: true, message: "用户协议不能为空", trigger: "blur" }
- // ]
- },
- showSearch: true,
- single: true,
- multiple: true,
- ids: [],
- loading: false,
- list: [],
- total: 0,
- //正常的积分列表
- IntegralGoodsList:[],
- typesOptions: [],
- statusOptions: [
- {
- label: "正常",
- value: 0
- },
- {
- label: "半封禁",
- value: 1
- },
- {
- label: "封禁",
- value: 2
- }
- ],
- isMallOptions:[
- {
- dictLabel: "是",
- dictValue: 1
- },
- {
- dictLabel: "否",
- dictValue: 0
- }
- ],
- title: null,
- open: false,
- form: {
- authType:'1',
- setCompanyIdList: []
- },
- bindRules:{
- merchantType: [
- { required: true, message: "商户类型不能为空", trigger: "blur" }
- ],
- id: [
- { required: true, message: "商户号不能为空", trigger: "blur" }
- ]
- },
- rules: {
- name: [
- { required: true, message: "名称不能为空", trigger: "blur" }
- ],
- // companyId: [
- // { required: true, message: "所属公司不能为空", trigger: "blur" }
- // ],
- appid: [
- { required: true, message: "appid不能为空", trigger: "blur" }
- ],
- img: [
- { required: true, message: "图标不能为空", trigger: "blur" }
- ],
- type: [
- { required: true, message: "类型不能为空", trigger: "blur" }
- ],
- originalId: [
- { required: true, message: "原始id不能为空", trigger: "blur" }
- ],
- secret: [
- { required: true, message: "secret不能为空", trigger: "blur" }
- ],
- token: [
- { required: true, message: "token不能为空", trigger: "blur" }
- ],
- aesKey: [
- { required: true, message: "aesKey不能为空", trigger: "blur" }
- ],
- msgDataFormat: [
- { required: true, message: "msgDataFormat不能为空", trigger: "blur" }
- ]
- }
- }
- },
- created() {
- this.getDicts("play_config_auth_type").then(response => {
- this.authTypeOptions = response.data;
- });
- this.getDicts("sys_pay_mode").then(response => {
- this.sysPayModes = response.data;
- });
- this.getDicts("play_source_type").then(response => {
- this.typesOptions = response.data.map(item => {
- return {
- ...item,
- listClass: 'primary'}
- })
- });
- this.getIntegralGoodsList();
- //初始化formatterCompanyOptions
- allList().then(e => {
- this.formatterCompanyOptions = e.rows;
- });
- this.getList();
- },
- methods: {
- resetForm,
- resetOption(){
- console.log(1)
- this.companyOptions = [];
- this.open = false;
- },
- getGoodsNameById(id) {
- const goods = this.IntegralGoodsList.find(item => item.goodsId == id)
- return goods ? goods.goodsName : id
- },
- showOpenPlatformWarning() {
- if (this.form.authType=='1'){
- this.$confirm('必须绑定开放平台,否则会导致看课冲突。是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- // 用户点击确定,执行原有提交逻辑
- this.submitForm()
- }).catch(() => {
- // 用户点击取消,停留在当前弹窗,不执行任何操作
- // 可以在这里添加一些提示信息
- console.log('用户取消提交')
- })
- }else {
- this.submitForm()
- }
- },
- getIntegralGoodsList(){
- norIntegralGoodsList().then(res=>{
- this.IntegralGoodsList= res.rows
- })
- },
- // 协议配置处理
- handleAgreement(row) {
- // 获取当前行的协议相关信息
- queryAgreementConfig({appid:row.appid}).then(response => {
- if (response.code === 200) {
- // 返回agreementData json串
- let agreementData = JSON.parse(response.data.agreementData);
- this.agreementForm = {
- appId: row.appid,
- doctorRegister: agreementData.doctorRegister || '',
- doctorFiling: agreementData.doctorFiling || '',
- userRegister: agreementData.userRegister || '',
- userPrivacy: agreementData.userPrivacy || '',
- userHealth: agreementData.userHealth || '',
- vipService: agreementData.vipService || '',
- vipAutomaticService: agreementData.vipAutomaticService || '',
- userRemoveService: agreementData.userRemoveService || '',
- appUserAgreement: agreementData.appUserAgreement || '',
- appPrivacyAgreement: agreementData.appPrivacyAgreement || ''
- };
- this.agreementDialogVisible = true;
- }
- })
- },
- // 提交协议配置
- submitAgreementForm() {
- this.$refs["agreementForm"].validate(valid => {
- if (valid) {
- // 调用API更新协议配置
- const params = {
- appId: this.agreementForm.appId,
- agreementData: JSON.stringify({
- doctorRegister: this.agreementForm.doctorRegister,
- doctorFiling: this.agreementForm.doctorFiling,
- userRegister: this.agreementForm.userRegister,
- userPrivacy: this.agreementForm.userPrivacy,
- userHealth: this.agreementForm.userHealth,
- vipService: this.agreementForm.vipService,
- vipAutomaticService: this.agreementForm.vipAutomaticService,
- userRemoveService: this.agreementForm.userRemoveService,
- appUserAgreement: this.agreementForm.appUserAgreement,
- appPrivacyAgreement: this.agreementForm.appPrivacyAgreement
- })
- };
- updateAgreementConfig(params).then(response => {
- if (response.code === 200) {
- this.msgSuccess("协议配置更新成功");
- this.agreementDialogVisible = false;
- this.getList(); // 刷新列表
- } else {
- this.msgError("协议配置更新失败:" + response.msg);
- }
- }).catch(error => {
- this.msgError("请求失败:" + error.message);
- });
- }
- });
- },
- handleUnbind(row) {
- this.$confirm('是否确认解绑该配置?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- const params = {
- id: row.id
- };
- updateUnbindConfig(params).then(response => {
- if (response.code === 200) {
- this.msgSuccess("解绑成功");
- this.getList();
- } else {
- this.msgError("解绑失败: " + response.msg);
- }
- }).catch(error => {
- this.msgError("请求失败: " + error.message);
- });
- }).catch(() => {
- // 用户取消操作
- });
- }
- ,
- submitFormBind(row) {
- this.$refs["bindForm"].validate(valid => {
- if (valid) {
- // 构造请求参数
- const params = {
- id: row.id, // 使用传入行数据的ID
- merchantType: this.bindForm.merchantType,
- merchantConfigId: this.bindForm.id
- };
- // 调用API更新绑定关系
- updateBindConfig(params).then(response => {
- if (response.code === 200) {
- this.msgSuccess("绑定配置更新成功");
- this.bindForm.bindShow = false;
- this.getList(); // 刷新列表数据
- this.resetForm("bindForm");
- } else {
- this.msgError("更新失败: " + response.msg);
- }
- }).catch(error => {
- this.msgError("请求失败: " + error.message);
- });
- }
- });
- },
- handleBindClose(done) {
- this.resetForm("bindForm");
- this.bindForm.bindShow = false;
- this.bindForm.id = null;
- done();
- },
- cancelBind(){
- this.resetForm("bindForm");
- this.bindForm.bindShow = false; // 关闭对话框
- },
- // 绑定支付配置
- handleBind(row) {
- this.merchantAppConfigList= [];
- this.bindForm.merchantType = null;
- this.bindForm.id = null;
- this.bindCurrentRow = row; // 保存当前行数据
- this.bindForm.bindShow = true;
- },
- changeSysPayModes(value,row){
- const query = {
- pageNum: 1,
- pageSize: 100,
- merchantType: value,
- isDeleted: 0,
- appId:this.bindCurrentRow.appid
- }
- listMerchantAppConfig(query).then( response => {
- this.merchantAppConfigList = response.rows;
- }
- )
- },
- // 处理开关配置
- handleSwitchConfig(row) {
- this.switchForm.appId = row.appid;
- this.switchForm.switchStatus = "001"; // 默认关闭状态
- // 调用接口获取开关状态
- this.getSwitchConfig(row.appid);
- this.switchDialogVisible = true;
- },
- /** 搜索公司 */
- searchCompanies(query) {
- this.companySearchLoading = true;
- allList().then(response => {
- this.companyOptions = response.rows;
- if (query) {
- this.companyOptions = this.companyOptions.filter(item =>
- item.dictLabel.includes(query)
- );
- }
- this.companySearchLoading = false;
- }).catch(()=>{
- this.companySearchLoading = false;
- });
- },
- companyNameFormatter(row){
- let company = this.formatterCompanyOptions.filter(item => item.dictValue === row.companyId)[0];
- return company ? company.dictLabel : '';
- },
- // 获取开关配置
- 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);
- });
- },
- // 提交开关配置
- 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);
- }
- })
- },
- getList() {
- this.loading = true;
- list(this.queryParams).then(response => {
- this.list = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- resetQuery() {
- this.resetForm("queryForm");
- this.getList();
- },
- handleAdd() {
- this.reset()
- this.open = true
- this.form.isMall = 0;
- this.title = "添加小程序配置"
- },
- handleUpdate(row) {
- this.reset()
- const id = row.id || this.ids
- get(id).then(response => {
- this.form = {
- ...response.data,
- type: response.data.type.toString(),
- authType: response.data.authType ? response.data.authType.toString() : '1'
- }
- if(!!this.form.setCompanyIds){
- this.$set(
- this.form,
- "setCompanyIdList",
- this.form.setCompanyIds.split(",").map(str => parseInt(str, 10))
- );
- // this.form.setCompanyIdList = this.form.setCompanyIds.split(",").map(str => parseInt(str, 10));
- }
- if(!!this.form.integralGoods){
- this.$set(
- this.form,
- "integralGoods",
- this.form.integralGoods.split(",").map(str => parseInt(str, 10))
- );
- }
- this.searchCompanies("");
- this.open = true
- this.title = "修改小程序配置"
- })
- },
- handleDelete(row) {
- const id = row.id || this.ids
- this.$confirm('是否确认删除小程序配置编号为"' + id + '"的数据项?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- return del(id);
- }).then(() => {
- this.getList();
- this.msgSuccess("删除成功");
- }).catch(() => {});
- },
- handleSelectionChange(selection) {
- this.ids = selection.map(item => item.id)
- this.single = selection.length!==1
- this.multiple = !selection.length
- },
- submitForm() {
- this.$refs["form"].validate(valid => {
- if (valid) {
- if(!!this.form.setCompanyIdList && this.form.setCompanyIdList.length > 0){
- this.form.setCompanyIds = this.form.setCompanyIdList.join(',')
- }else{
- this.form.setCompanyIds = "";
- }
- if(!!this.form.integralGoods && this.form.integralGoods.length > 0){
- this.form.integralGoods = this.form.integralGoods.join(',')
- }else{
- this.form.integralGoods = "";
- }
- if (this.form.id != null) {
- update(this.form).then(response => {
- const {code, msg} = response
- if (code !== 200) {
- this.msgError(msg)
- return
- }
- this.msgSuccess("修改成功");
- this.open = false;
- this.getList();
- });
- } else {
- add(this.form).then(response => {
- const {code, msg} = response
- if (code !== 200) {
- this.msgError(msg)
- return
- }
- this.msgSuccess("新增成功");
- this.open = false;
- this.getList();
- });
- }
- }
- });
- },
- cancel() {
- this.open = false;
- this.reset();
- },
- reset() {
- this.form = {
- id: null,
- name: null,
- appid: null,
- secret: null,
- img: null,
- originalId: null,
- setCompanyIdList: [],
- token: 'cbnd7lJvkripVOpyTFAna6NAWCxCrvC',
- aesKey: 'HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E',
- msgDataFormat: 'JSON',
- type: '1',
- status: 0
- }
- this.resetForm("form");
- },
- getStatusLabel(status) {
- const statusMap = {
- 0: '正常',
- 1: '半封禁',
- 2: '封禁'
- };
- return statusMap[status] || '未知';
- }
- },
- }
- </script>
- <style scoped>
- </style>
|