diff --git a/src/components/feedBack/fun.js b/src/components/feedBack/fun.js index f45a3ffc..a9dc546d 100644 --- a/src/components/feedBack/fun.js +++ b/src/components/feedBack/fun.js @@ -3,7 +3,7 @@ import FEEDBACKCOMP from "./index.vue"; const FBConstructor = Vue.extend(FEEDBACKCOMP); const FB = options => { - const { type, cancelBack, trialId = null, Id = null } = options; + const { type, callBack, cancelBack, trialId = null, Id = null, visitTaskId = null } = options; if (!type) throw `type is requred.but ${type}` const id = `FB${new Date().getTime()}`; const instance = new FBConstructor(); @@ -12,8 +12,10 @@ const FB = options => { if (instance.vm.visible) return; document.body.appendChild(instance.vm.$el); console.log(type); - instance.vm.open({ type, trialId, Id }); + instance.vm.open({ type, trialId, Id, visitTaskId }); instance.vm.$on("success", (Id) => { + if (callBack) callBack(); + }); instance.vm.$on("closed", () => { document.body.removeChild(instance.vm.$el); diff --git a/src/components/feedBack/index.vue b/src/components/feedBack/index.vue index fe9c903b..1416eb91 100644 --- a/src/components/feedBack/index.vue +++ b/src/components/feedBack/index.vue @@ -149,8 +149,9 @@ export default { loading: false, options: [], type: null, // detail 表格详情 feedback 填写反馈 imgfail 影像异常 - trialId: null, - Id: null, + trialId: null, // 项目id + Id: null, // 反馈数据id + visitTaskId: null, // 任务id form: { Code: null, UserId: null, @@ -200,10 +201,11 @@ export default { }, methods: { open(data) { - let { type, trialId, Id } = data; + let { type, trialId, Id, visitTaskId } = data; this.type = type; this.trialId = trialId; this.Id = Id; + this.visitTaskId = visitTaskId; this.visible = true; if (!Id) { this.title = this.setTitle(); diff --git a/src/views/feedBack/index.vue b/src/views/feedBack/index.vue index a2ace98b..e04f47ca 100644 --- a/src/views/feedBack/index.vue +++ b/src/views/feedBack/index.vue @@ -294,7 +294,7 @@ export default { ], data() { return { - list: [{ PublishUserName: 1 }], + list: [], total: 0, loading: false, datetimerange: [], diff --git a/src/views/trials/trials-layout/components/feedBack.vue b/src/views/trials/trials-layout/components/feedBack.vue index 12096923..98d1dc8c 100644 --- a/src/views/trials/trials-layout/components/feedBack.vue +++ b/src/views/trials/trials-layout/components/feedBack.vue @@ -28,12 +28,10 @@ export default { return { visible: false, show: null, - lock: false, }; }, mounted() { document.getElementsByTagName("body")[0].addEventListener("click", () => { - if (this.lock) return; this.visible = false; if (this.show) { this.show = false; @@ -57,13 +55,9 @@ export default { }, // 打开意见反馈 openFeedBack() { - this.lock = true; this.$FB({ type: "feedback", trialId: this.$route.query.trialId, - cancelBack: () => { - this.lock = false; - }, }); }, // 打开反馈列表