|
|
@@ -166,6 +166,15 @@
|
|
|
</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="协议状态" align="center" prop="settingsProtocolType" width="100">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-tag
|
|
|
+ :type="scope.row.settingsProtocolType === 2 ? 'success' : scope.row.settingsProtocolType === 1 ? 'warning' : 'info'"
|
|
|
+ >
|
|
|
+ {{ getProtocolStatusLabel(scope.row.settingsProtocolType) }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </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" class-name="small-padding fixed-width">
|
|
|
@@ -190,6 +199,12 @@
|
|
|
icon="el-icon-setting"
|
|
|
@click="handleSwitchConfig(scope.row)"
|
|
|
>是否展示销售</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-document"
|
|
|
+ @click="handlePrivacyConfig(scope.row)"
|
|
|
+ >隐私协议</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -302,12 +317,67 @@
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
-
|
|
|
+ <!-- 隐私协议配置对话框 -->
|
|
|
+ <el-dialog
|
|
|
+ :title="privacyTitle"
|
|
|
+ :visible.sync="privacyDialogVisible"
|
|
|
+ width="60%"
|
|
|
+ class="privacy-dialog"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ ref="privacyFormRef"
|
|
|
+ :model="privacyForm"
|
|
|
+ :rules="privacyRules"
|
|
|
+ label-width="100px"
|
|
|
+ >
|
|
|
+ <el-form-item label="医生注册协议" prop="doctorRegister">
|
|
|
+ <editor v-model="privacyForm.doctorRegister" :min-height="292"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="医生多机构备案协议" prop="doctorFiling">
|
|
|
+ <editor v-model="privacyForm.doctorFiling" :min-height="292"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="药师注册协议" prop="pharmacistRegister">
|
|
|
+ <editor v-model="privacyForm.pharmacistRegister" :min-height="292"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="药师多机构备案协议" prop="pharmacistFiling">
|
|
|
+ <editor v-model="privacyForm.pharmacistFiling" :min-height="292"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="用户协议" prop="userRegister">
|
|
|
+ <editor v-model="privacyForm.userRegister" :min-height="292"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="隐私协议" prop="userPrivacy">
|
|
|
+ <editor v-model="privacyForm.userPrivacy" :min-height="292"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="健康客服协议" prop="userHealth">
|
|
|
+ <editor v-model="privacyForm.userHealth" :min-height="292"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="会员服务协议" prop="vipService">
|
|
|
+ <editor v-model="privacyForm.vipService" :min-height="292"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="会员自动续费协议" prop="vipAutomaticService">
|
|
|
+ <editor v-model="privacyForm.vipAutomaticService" :min-height="292"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="用户注销协议" prop="userRemoveService">
|
|
|
+ <editor v-model="privacyForm.userRemoveService" :min-height="292"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="商家规则" prop="storeRules">
|
|
|
+ <editor v-model="privacyForm.storeRules" :min-height="292"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="入驻协议" prop="residencyAgreement">
|
|
|
+ <editor v-model="privacyForm.residencyAgreement" :min-height="292"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="privacyDialogVisible = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="submitPrivacyConfig">保存</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {list, get, update, add, del} from '@/api/course/coursePlaySourceConfig'
|
|
|
+import {list, get, update, add, del,getProtocolConfig,updateProtocolConfig} from '@/api/course/coursePlaySourceConfig'
|
|
|
import {updateIsTownOn} from "@/api/system/config";
|
|
|
import { allList } from '@/api/company/company'
|
|
|
import { resetForm } from '@/utils/common'
|
|
|
@@ -320,6 +390,23 @@ export default {
|
|
|
components: {Treeselect},
|
|
|
data() {
|
|
|
return {
|
|
|
+ privacyTitle:null,
|
|
|
+ privacyDialogVisible: false,
|
|
|
+ privacyForm: {
|
|
|
+ appId: '',
|
|
|
+ doctorRegister:null,
|
|
|
+ doctorFiling:null,
|
|
|
+ pharmacistRegister:null,
|
|
|
+ pharmacistFilinga:null,
|
|
|
+ userRegister:null,
|
|
|
+ userPrivacy:null,
|
|
|
+ userHealth:null,
|
|
|
+ vipService:null,
|
|
|
+ vipAutomaticService:null,
|
|
|
+ userRemoveService:null,
|
|
|
+ storeRules:null,
|
|
|
+ residencyAgreement:null,
|
|
|
+ },
|
|
|
authOptions:[
|
|
|
{
|
|
|
dictLabel: "食品",
|
|
|
@@ -685,6 +772,100 @@ export default {
|
|
|
'2': '封禁'
|
|
|
};
|
|
|
return statusMap[status] || '未知';
|
|
|
+ },
|
|
|
+ // 处理隐私协议配置
|
|
|
+ async handlePrivacyConfig(row) {
|
|
|
+ try {
|
|
|
+ this.privacyTitle = '《' + row.name + '》' + '隐私协议配置';
|
|
|
+ this.privacyForm.id = row.id;
|
|
|
+ this.privacyForm.appid = row.appid;
|
|
|
+ this.privacyForm.name = row.name;
|
|
|
+
|
|
|
+ // 显示加载
|
|
|
+ this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '正在加载协议配置...',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+
|
|
|
+ // 调用接口获取协议配置
|
|
|
+ const response = await getProtocolConfig(row.id);
|
|
|
+
|
|
|
+ if (response.code === 200 && response.data) {
|
|
|
+ const data = response.data;
|
|
|
+ // 将接口返回的数据映射到表单
|
|
|
+ this.privacyForm.doctorRegister = data.doctorRegister || null;
|
|
|
+ this.privacyForm.doctorFiling = data.doctorFiling || null;
|
|
|
+ this.privacyForm.pharmacistRegister = data.pharmacistRegister || null;
|
|
|
+ this.privacyForm.pharmacistFiling = data.pharmacistFiling || null;
|
|
|
+ this.privacyForm.userRegister = data.userRegister || null;
|
|
|
+ this.privacyForm.userPrivacy = data.userPrivacy || null;
|
|
|
+ this.privacyForm.userHealth = data.userHealth || null;
|
|
|
+ this.privacyForm.vipService = data.vipService || null;
|
|
|
+ this.privacyForm.vipAutomaticService = data.vipAutomaticService || null;
|
|
|
+ this.privacyForm.userRemoveService = data.userRemoveService || null;
|
|
|
+ this.privacyForm.storeRules = data.storeRules || null;
|
|
|
+ this.privacyForm.residencyAgreement = data.residencyAgreement || null;
|
|
|
+ this.privacyForm.settingsProtocolType = data.settingsProtocolType || 0;
|
|
|
+
|
|
|
+ this.$message.success('协议配置加载成功');
|
|
|
+ } else {
|
|
|
+ this.$message.warning('未找到协议配置,将创建新的配置');
|
|
|
+ // 清空表单
|
|
|
+ Object.keys(this.privacyForm).forEach(key => {
|
|
|
+ if (key !== 'id' && key !== 'appid' && key !== 'name') {
|
|
|
+ this.privacyForm[key] = null;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ this.privacyDialogVisible = true;
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error('加载协议配置失败: ' + (error.message || error));
|
|
|
+ } finally {
|
|
|
+ this.$loading().close();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 提交隐私协议配置
|
|
|
+ async submitPrivacyConfig() {
|
|
|
+ try {
|
|
|
+ // 验证必要字段
|
|
|
+ if (!this.privacyForm.id) {
|
|
|
+ this.$message.error('配置ID不能为空');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 显示加载
|
|
|
+ const loadingInstance = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '正在保存协议配置...',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+ // 调用更新接口
|
|
|
+ const response = await updateProtocolConfig(this.privacyForm);
|
|
|
+ if (response.code === 200) {
|
|
|
+ this.$message.success(response.msg || '保存成功');
|
|
|
+ this.privacyDialogVisible = false;
|
|
|
+ // 刷新列表
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.$message.error(response.msg || '保存失败');
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error('保存失败: ' + (error.message || error));
|
|
|
+ } finally {
|
|
|
+ this.$loading().close();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取协议状态标签
|
|
|
+ getProtocolStatusLabel(type) {
|
|
|
+ const statusMap = {
|
|
|
+ '0': '未设置',
|
|
|
+ '1': '部分设置',
|
|
|
+ '2': '已设置'
|
|
|
+ };
|
|
|
+ return statusMap[type] || '未知';
|
|
|
}
|
|
|
},
|
|
|
}
|