|
@@ -114,6 +114,10 @@ export default {
|
|
|
callback();
|
|
callback();
|
|
|
};
|
|
};
|
|
|
return {
|
|
return {
|
|
|
|
|
+ extraParams: {
|
|
|
|
|
+ companyId: null,
|
|
|
|
|
+ companyUserId: null
|
|
|
|
|
+ },
|
|
|
form: {
|
|
form: {
|
|
|
id: null,
|
|
id: null,
|
|
|
questionId: null,
|
|
questionId: null,
|
|
@@ -182,6 +186,11 @@ export default {
|
|
|
this.getAllPrivatePackge();
|
|
this.getAllPrivatePackge();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 新增:用于接收主页面传来的公司id和销售id
|
|
|
|
|
+ setExtraParams(params) {
|
|
|
|
|
+ console.log('【collection】接收到 extraParams:', params);
|
|
|
|
|
+ this.extraParams = { ...params };
|
|
|
|
|
+ },
|
|
|
handleIsPackageChange(value) {
|
|
handleIsPackageChange(value) {
|
|
|
if (value === 0) {
|
|
if (value === 0) {
|
|
|
this.form.packageId = null;
|
|
this.form.packageId = null;
|
|
@@ -287,6 +296,7 @@ export default {
|
|
|
allergy: '',
|
|
allergy: '',
|
|
|
remark: ''
|
|
remark: ''
|
|
|
};
|
|
};
|
|
|
|
|
+ this.extraParams = { companyId: null, companyUserId: null };
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
//选择问答模板
|
|
//选择问答模板
|
|
@@ -332,7 +342,12 @@ export default {
|
|
|
this.$refs["form"].validate(valid => {
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
// 深拷贝表单数据,避免直接修改原始 form
|
|
// 深拷贝表单数据,避免直接修改原始 form
|
|
|
- const submitData = { ...this.form };
|
|
|
|
|
|
|
+ const submitData = {
|
|
|
|
|
+ ...this.form,
|
|
|
|
|
+ userId: this.userId,
|
|
|
|
|
+ companyId: this.extraParams.companyId,
|
|
|
|
|
+ companyUserId: this.extraParams.companyUserId
|
|
|
|
|
+ };
|
|
|
submitData.userId = this.userId;
|
|
submitData.userId = this.userId;
|
|
|
|
|
|
|
|
// 如果未关联产品疗法,清除相关字段(避免传 null/0 等无效值)
|
|
// 如果未关联产品疗法,清除相关字段(避免传 null/0 等无效值)
|