|
|
@@ -1,6 +1,11 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<el-form validate-on-rule-change :rules="rules" ref="form" :model="form" label-width="140px">
|
|
|
+ <el-form-item label="小程序" prop="appId">
|
|
|
+ <el-select v-model="form.appId" placeholder="小程序" clearable>
|
|
|
+ <el-option v-for="dict in sourceList" :key="dict.dictValue1" :label="dict.dictLabel" :value="dict.dictValue1" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="信息模板" prop="questionId">
|
|
|
<el-select @change="selectQuestion" v-model="form.questionId" placeholder="请选择问答">
|
|
|
<el-option v-for="dict in questionOptions" :key="dict.dictValue" :label="dict.dictLabel"
|
|
|
@@ -87,6 +92,7 @@
|
|
|
<script>
|
|
|
import { questionOptions, getAnswer } from "@/api/hisStore/answer";
|
|
|
import { allPrivatePackage } from "@/api/store/package";
|
|
|
+import { options } from "@/api/course/coursePlaySourceConfig";
|
|
|
import { getInfo, addCollection, updateCollection, getWxaCodeCollectionUnLimit } from "@/api/hisStore/collection";
|
|
|
|
|
|
export default {
|
|
|
@@ -114,6 +120,7 @@ export default {
|
|
|
callback();
|
|
|
};
|
|
|
return {
|
|
|
+ sourceList:[],
|
|
|
extraParams: {
|
|
|
companyId: null,
|
|
|
companyUserId: null
|
|
|
@@ -143,6 +150,9 @@ export default {
|
|
|
codeImage: null,
|
|
|
|
|
|
rules: {
|
|
|
+ appId: [
|
|
|
+ { required: true, message: '请选择分享的小程序', trigger: 'change' }
|
|
|
+ ],
|
|
|
questionId: [
|
|
|
{ required: true, message: '请选择信息模板', trigger: 'change' }
|
|
|
],
|
|
|
@@ -184,6 +194,9 @@ export default {
|
|
|
created() {
|
|
|
this.getQuestionOptions();
|
|
|
this.getAllPrivatePackge();
|
|
|
+ options().then(res => {
|
|
|
+ this.sourceList = res.data;
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
// 新增:用于接收主页面传来的公司id和销售id
|
|
|
@@ -209,7 +222,7 @@ export default {
|
|
|
link.click();
|
|
|
document.body.removeChild(link);
|
|
|
},
|
|
|
- handleShare(id) {
|
|
|
+ handleShare(id,appId) {
|
|
|
let loadingRock = this.$loading({
|
|
|
lock: true,
|
|
|
text: '生成二维码中~~请不要刷新页面!!',
|
|
|
@@ -217,7 +230,7 @@ export default {
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
|
});
|
|
|
|
|
|
- getWxaCodeCollectionUnLimit(id).then(response => {
|
|
|
+ getWxaCodeCollectionUnLimit(id,appId).then(response => {
|
|
|
this.codeImage = response.url
|
|
|
this.collectionForm.open = true;
|
|
|
this.collectionForm.name = id;
|
|
|
@@ -363,14 +376,14 @@ export default {
|
|
|
}
|
|
|
|
|
|
console.log('实际提交数据:', submitData); // 调试用
|
|
|
-
|
|
|
+ const appId = this.form.appId;
|
|
|
if (submitData.id != null) {
|
|
|
updateCollection(submitData).then(res => {
|
|
|
this.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
this.$parent.$parent.closeCollection();
|
|
|
this.$refs['form'].resetFields();
|
|
|
- this.handleShare(res.data);
|
|
|
+ this.handleShare(res.data,appId);
|
|
|
});
|
|
|
} else {
|
|
|
addCollection(submitData).then(res => {
|
|
|
@@ -378,7 +391,7 @@ export default {
|
|
|
this.open = false;
|
|
|
this.$parent.$parent.closeCollection();
|
|
|
this.$refs['form'].resetFields();
|
|
|
- this.handleShare(res.data);
|
|
|
+ this.handleShare(res.data,appId);
|
|
|
});
|
|
|
}
|
|
|
}
|