/home/techb158/ileadtechnology.com/SSM/public/js/resource/assignment
Edit: /home/techb158/ileadtechnology.com/SSM/public/js/resource/assignment/edit.js (9742B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[309],{G9k9:function(t,e,s){"use strict";s.r(e);var n={components:{assignmentForm:s("NDCc").a},data:function(){return{uuid:this.$route.params.uuid}},mounted:function(){helper.hasPermission("edit-assignment")||(helper.notAccessibleMsg(),this.$router.push("/dashboard"))}},a=s("KHd+"),i=Object(a.a)(n,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("div",{staticClass:"page-titles"},[s("div",{staticClass:"row"},[s("div",{staticClass:"col-12 col-sm-6"},[s("h3",{staticClass:"text-themecolor"},[t._v(t._s(t.trans("resource.edit_assignment")))])]),t._v(" "),s("div",{staticClass:"col-12 col-sm-6"},[s("div",{staticClass:"action-buttons pull-right"},[s("button",{staticClass:"btn btn-info btn-sm",on:{click:function(e){return t.$router.push("/resource/assignment")}}},[s("i",{staticClass:"fas fa-list"}),t._v(" "),s("span",{staticClass:"d-none d-sm-inline"},[t._v(t._s(t.trans("resource.assignment")))])])])])])]),t._v(" "),s("div",{staticClass:"container-fluid"},[s("div",{staticClass:"card card-form"},[s("div",{staticClass:"card-body p-t-20"},[s("assignment-form",{attrs:{uuid:t.uuid}})],1)])])])}),[],!1,null,null,null);e.default=i.exports},NDCc:function(t,e,s){"use strict";var n={components:{},data:function(){return{assignmentForm:new Form({batch_id:"",subject_id:"",title:"",date_of_assignment:"",due_date:"",description:"",upload_token:""}),batches:[],selected_batch:null,subjects:[],selected_subject:null,subject_detail:[],module_id:"",clearAttachment:!0}},props:["uuid"],mounted:function(){helper.hasPermission("create-assignment")||helper.hasPermission("edit-assignment")||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),this.uuid?this.get():this.assignmentForm.upload_token=this.$uuid.v4(),this.getPreRequisite()},methods:{hasPermission:function(t){return helper.hasPermission(t)},getPreRequisite:function(){var t=this,e=this.$loading.show();axios.get("/api/assignment/pre-requisite").then((function(s){t.batches=s.batches,e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},getSubjects:function(){var t=this;this.uuid||(this.assignmentForm.subject_id="",this.selected_subject=null);var e=this.$loading.show();axios.post("/api/batch/"+this.assignmentForm.batch_id+"/subjects").then((function(s){t.subjects=s.subjects,t.subject_details=s.subject_details,e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},proceed:function(){this.uuid?this.update():this.store()},store:function(){var t=this,e=this.$loading.show();this.assignmentForm.post("/api/assignment").then((function(s){toastr.success(s.message),t.clearAttachment=!t.clearAttachment,t.assignmentForm.upload_token=t.$uuid.v4(),t.selected_batch=null,t.selected_subject=null,t.$emit("completed"),e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},get:function(){var t=this,e=this.$loading.show();axios.get("/api/assignment/"+this.uuid).then((function(s){var n=s.assignment;t.assignmentForm.title=n.title,t.assignmentForm.date_of_assignment=n.date_of_assignment,t.assignmentForm.due_date=n.due_date,t.assignmentForm.description=n.description,t.assignmentForm.batch_id=n.subject.batch_id,t.assignmentForm.subject_id=n.subject_id,t.selected_batch=t.assignmentForm.batch_id?{id:n.subject.batch_id,name:n.subject.batch.course.name+" "+n.subject.batch.name}:null,t.selected_subject=n.subject_id?{id:n.subject_id,name:n.subject.name+" ("+n.subject.code+")"}:null,t.assignmentForm.upload_token=n.upload_token,t.module_id=n.id,e.hide()})).catch((function(s){e.hide(),helper.showErrorMsg(s),t.$router.push("/resource/assignment")}))},update:function(){var t=this,e=this.$loading.show();this.assignmentForm.patch("/api/assignment/"+this.uuid).then((function(s){toastr.success(s.message),e.hide(),t.$router.push("/resource/assignment")})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},onBatchSelect:function(t){this.assignmentForm.batch_id=t.id},onSubjectSelect:function(t){this.assignmentForm.subject_id=t.id}},watch:{"assignmentForm.batch_id":function(t){t&&this.getSubjects()}}},a=(s("Re69"),s("KHd+")),i=Object(a.a)(n,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("form",{on:{submit:function(e){return e.preventDefault(),t.proceed(e)},keydown:function(e){return t.assignmentForm.errors.clear(e.target.name)}}},[s("div",{staticClass:"row"},[s("div",{staticClass:"col-12 col-sm-6"},[s("div",{staticClass:"form-group"},[s("label",{attrs:{for:""}},[t._v(t._s(t.trans("academic.batch"))+" ")]),t._v(" "),s("v-select",{attrs:{label:"name","group-values":"batches","group-label":"course_group","group-select":!1,name:"batch_id",id:"batch_id",options:t.batches,placeholder:t.trans("academic.select_batch")},on:{select:t.onBatchSelect,close:function(e){return t.assignmentForm.errors.clear("batch_id")},remove:function(e){t.assignmentForm.batch_id=""}},model:{value:t.selected_batch,callback:function(e){t.selected_batch=e},expression:"selected_batch"}},[t.batches.length?t._e():s("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[t._v("\n "+t._s(t.trans("general.no_option_found"))+"\n ")])]),t._v(" "),s("show-error",{attrs:{"form-name":t.assignmentForm,"prop-name":"batch_id"}})],1),t._v(" "),t.assignmentForm.batch_id?s("div",{staticClass:"form-group"},[s("label",{attrs:{for:""}},[t._v(t._s(t.trans("academic.subject"))+" ")]),t._v(" "),s("v-select",{attrs:{label:"name",name:"subject_id",id:"subject_id",options:t.subjects,placeholder:t.trans("resource.select_subject")},on:{select:t.onSubjectSelect,close:function(e){return t.assignmentForm.errors.clear("subject_id")},remove:function(e){t.assignmentForm.subject_id=""}},model:{value:t.selected_subject,callback:function(e){t.selected_subject=e},expression:"selected_subject"}},[t.subjects.length?t._e():s("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[t._v("\n "+t._s(t.trans("general.no_option_found"))+"\n ")])]),t._v(" "),s("show-error",{attrs:{"form-name":t.assignmentForm,"prop-name":"subject_id"}})],1):t._e(),t._v(" "),s("div",{staticClass:"form-group"},[s("label",{attrs:{for:""}},[t._v(t._s(t.trans("resource.assignment_title")))]),t._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:t.assignmentForm.title,expression:"assignmentForm.title"}],staticClass:"form-control",attrs:{type:"text",name:"title",placeholder:t.trans("resource.assignment_title")},domProps:{value:t.assignmentForm.title},on:{input:function(e){e.target.composing||t.$set(t.assignmentForm,"title",e.target.value)}}}),t._v(" "),s("show-error",{attrs:{"form-name":t.assignmentForm,"prop-name":"title"}})],1),t._v(" "),s("div",{staticClass:"form-group"},[s("label",{attrs:{for:""}},[t._v(t._s(t.trans("resource.date_of_assignment")))]),t._v(" "),s("datepicker",{attrs:{bootstrapStyling:!0,placeholder:t.trans("resource.date_of_assignment")},on:{selected:function(e){return t.assignmentForm.errors.clear("date_of_assignment")}},model:{value:t.assignmentForm.date_of_assignment,callback:function(e){t.$set(t.assignmentForm,"date_of_assignment",e)},expression:"assignmentForm.date_of_assignment"}}),t._v(" "),s("show-error",{attrs:{"form-name":t.assignmentForm,"prop-name":"date_of_assignment"}})],1),t._v(" "),s("div",{staticClass:"form-group"},[s("label",{attrs:{for:""}},[t._v(t._s(t.trans("resource.due_date_of_assignment")))]),t._v(" "),s("datepicker",{attrs:{bootstrapStyling:!0,placeholder:t.trans("resource.due_date_of_assignment")},on:{selected:function(e){return t.assignmentForm.errors.clear("due_date")}},model:{value:t.assignmentForm.due_date,callback:function(e){t.$set(t.assignmentForm,"due_date",e)},expression:"assignmentForm.due_date"}}),t._v(" "),s("show-error",{attrs:{"form-name":t.assignmentForm,"prop-name":"due_date"}})],1),t._v(" "),s("div",{staticClass:"form-group"},[s("file-upload-input",{attrs:{"button-text":t.trans("general.upload_document"),token:t.assignmentForm.upload_token,module:"assignment","clear-file":t.clearAttachment,"module-id":t.module_id}})],1)]),t._v(" "),s("div",{staticClass:"col-12 col-sm-6"},[s("div",{staticClass:"form-group"},[s("html-editor",{attrs:{name:"description",model:t.assignmentForm.description,height:"300",isUpdate:!!t.uuid},on:{"update:model":function(e){return t.$set(t.assignmentForm,"description",e)},clearErrors:function(e){return t.assignmentForm.errors.clear("description")}}}),t._v(" "),s("show-error",{attrs:{"form-name":t.assignmentForm,"prop-name":"description"}})],1)])]),t._v(" "),s("div",{staticClass:"card-footer text-right"},[s("router-link",{directives:[{name:"show",rawName:"v-show",value:t.uuid,expression:"uuid"}],staticClass:"btn btn-danger waves-effect waves-light ",attrs:{to:"/resource/assignment"}},[t._v(t._s(t.trans("general.cancel")))]),t._v(" "),t.uuid?t._e():s("button",{staticClass:"btn btn-danger waves-effect waves-light ",attrs:{type:"button"},on:{click:function(e){return t.$emit("cancel")}}},[t._v(t._s(t.trans("general.cancel")))]),t._v(" "),s("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"submit"}},[t.uuid?s("span",[t._v(t._s(t.trans("general.update")))]):s("span",[t._v(t._s(t.trans("general.save")))])])],1)])])}),[],!1,null,null,null);e.a=i.exports},Re69:function(t,e,s){"use strict";var n=s("bNSu");s.n(n).a},bNSu:function(t,e,s){var n=s("iSf7");"string"==typeof n&&(n=[[t.i,n,""]]);var a={hmr:!0,transform:void 0,insertInto:void 0};s("aET+")(n,a);n.locals&&(t.exports=n.locals)},iSf7:function(t,e,s){(t.exports=s("I1BE")(!1)).push([t.i,"\n.loading-overlay.is-full-page{\n z-index: 1060;\n}\n",""])}}]);
//# sourceMappingURL=edit.js.map?id=739ed610368ae5d28155