|
|
@@ -2529,7 +2529,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ({
|
|
|
props: {
|
|
|
populateWith: {
|
|
|
- type: Object
|
|
|
+ type: Object,
|
|
|
+ require: true
|
|
|
},
|
|
|
modalId: {
|
|
|
type: String,
|
|
|
@@ -2547,32 +2548,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
},
|
|
|
data: function data() {
|
|
|
return {
|
|
|
- note: {}
|
|
|
+ note: JSON.parse(JSON.stringify(this.populateWith))
|
|
|
};
|
|
|
},
|
|
|
- mounted: function mounted() {
|
|
|
- if (!this.populateWith) {
|
|
|
- this.note = {
|
|
|
- thenote: '',
|
|
|
- notetype: this.noteType,
|
|
|
- noteuser: this.noteUser,
|
|
|
- woid: this.woid
|
|
|
- };
|
|
|
- } else {
|
|
|
- this.note = JSON.parse(JSON.stringify(this.populateWith));
|
|
|
- }
|
|
|
- },
|
|
|
methods: {
|
|
|
updateNote: function updateNote(note) {
|
|
|
- if (this.populateWith) {
|
|
|
- axios.put('/api/workorders/notes/' + note.noteid, note).then(function (response) {
|
|
|
- hideModal();
|
|
|
- });
|
|
|
- } else {
|
|
|
- axios.post('/api/workorders/notes', note).then(function (response) {
|
|
|
- hideModal();
|
|
|
- });
|
|
|
- }
|
|
|
+ axios.put('/api/workorders/notes/' + note.noteid, note).then(function (response) {
|
|
|
+ hideModal();
|
|
|
+ });
|
|
|
},
|
|
|
hideModal: function hideModal() {
|
|
|
$('#' + this.modalId).modal('hide');
|
|
|
@@ -2619,6 +2602,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
//
|
|
|
//
|
|
|
//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ({
|
|
|
mixins: [_mixins_dateMixin__WEBPACK_IMPORTED_MODULE_0__["default"]],
|
|
|
@@ -2626,7 +2620,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
data: function data() {
|
|
|
return {
|
|
|
notes: Object.values(this.initialnotes),
|
|
|
- currentOrder: 'order-first'
|
|
|
+ currentOrder: 'order-first',
|
|
|
+ newNote: {
|
|
|
+ notetype: this.noteType,
|
|
|
+ thenote: '',
|
|
|
+ noteuser: this.authusername,
|
|
|
+ woid: this.woid
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -2642,6 +2642,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
}
|
|
|
|
|
|
return this.currentOrder;
|
|
|
+ },
|
|
|
+ createNote: function createNote() {
|
|
|
+ var _this = this;
|
|
|
+
|
|
|
+ axios.post('/api/workorders/notes', this.newNote).then(function (response) {
|
|
|
+ $('#note' + _this.noteType + 'add').collapse('hide');
|
|
|
+ _this.newNote.thenote = '';
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -50093,27 +50101,91 @@ var render = function() {
|
|
|
"ul",
|
|
|
{ staticClass: "list-unstyled" },
|
|
|
[
|
|
|
- _c("note-form-modal", {
|
|
|
- attrs: {
|
|
|
- "modal-id": "note" + _vm.noteType + "CreateModal",
|
|
|
- "note-type": _vm.noteType,
|
|
|
- woid: _vm.woid,
|
|
|
- "note-user": _vm.authusername
|
|
|
- }
|
|
|
- }),
|
|
|
- _vm._v(" "),
|
|
|
- _c(
|
|
|
- "button",
|
|
|
- {
|
|
|
- staticClass: "btn btn-primary",
|
|
|
- attrs: {
|
|
|
- type: "button",
|
|
|
- "data-toggle": "modal",
|
|
|
- "data-target": "#note" + _vm.noteType + "CreateModal"
|
|
|
- }
|
|
|
- },
|
|
|
- [_c("i", { staticClass: "fas fa-fw fa-plus" }), _vm._v(" Add New Note")]
|
|
|
- ),
|
|
|
+ _c("div", { staticClass: "row" }, [
|
|
|
+ _c(
|
|
|
+ "div",
|
|
|
+ {
|
|
|
+ staticClass:
|
|
|
+ "col-md-2 d-flex justify-content-center justify-content-md-start"
|
|
|
+ },
|
|
|
+ [
|
|
|
+ _c(
|
|
|
+ "button",
|
|
|
+ {
|
|
|
+ staticClass: "btn btn-primary m-2",
|
|
|
+ attrs: {
|
|
|
+ type: "button",
|
|
|
+ "data-toggle": "collapse",
|
|
|
+ "data-target": "#note" + _vm.noteType + "add"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ [
|
|
|
+ _c("i", { staticClass: "fas fa-fw fa-plus" }),
|
|
|
+ _vm._v(" Add New Note")
|
|
|
+ ]
|
|
|
+ )
|
|
|
+ ]
|
|
|
+ ),
|
|
|
+ _vm._v(" "),
|
|
|
+ _c("div", { staticClass: "col-md-10" }, [
|
|
|
+ _c(
|
|
|
+ "div",
|
|
|
+ {
|
|
|
+ staticClass: "collapse",
|
|
|
+ attrs: { id: "note" + _vm.noteType + "add" }
|
|
|
+ },
|
|
|
+ [
|
|
|
+ _c(
|
|
|
+ "div",
|
|
|
+ {
|
|
|
+ staticClass:
|
|
|
+ "d-flex flex-wrap flex-md-nowrap justify-content-center"
|
|
|
+ },
|
|
|
+ [
|
|
|
+ _c("textarea", {
|
|
|
+ directives: [
|
|
|
+ {
|
|
|
+ name: "model",
|
|
|
+ rawName: "v-model",
|
|
|
+ value: _vm.newNote.thenote,
|
|
|
+ expression: "newNote.thenote"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ staticClass: "form-control",
|
|
|
+ attrs: {
|
|
|
+ name: "newnote" + _vm.noteType,
|
|
|
+ id: "newnote" + _vm.noteType
|
|
|
+ },
|
|
|
+ domProps: { value: _vm.newNote.thenote },
|
|
|
+ on: {
|
|
|
+ input: function($event) {
|
|
|
+ if ($event.target.composing) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ _vm.$set(_vm.newNote, "thenote", $event.target.value)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }),
|
|
|
+ _vm._v(" "),
|
|
|
+ _c(
|
|
|
+ "button",
|
|
|
+ {
|
|
|
+ staticClass: "btn btn-secondary m-2",
|
|
|
+ attrs: { type: "button" },
|
|
|
+ on: {
|
|
|
+ click: function($event) {
|
|
|
+ return _vm.createNote()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ [_vm._v("Save")]
|
|
|
+ )
|
|
|
+ ]
|
|
|
+ )
|
|
|
+ ]
|
|
|
+ )
|
|
|
+ ])
|
|
|
+ ]),
|
|
|
_vm._v(" "),
|
|
|
_vm._l(this.notes, function(note, index) {
|
|
|
return _c(
|