|
|
@@ -2192,7 +2192,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
data: function data() {
|
|
|
return {
|
|
|
data: JSON.parse(this.workOrder),
|
|
|
- storeName: null,
|
|
|
storeList: null
|
|
|
};
|
|
|
},
|
|
|
@@ -2201,28 +2200,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
|
|
|
Echo.channel('work-orders').listen('WorkOrderUpdated', function (e) {
|
|
|
_this.data = JSON.parse(e.data);
|
|
|
- _this.storeName = _this.getStoreName();
|
|
|
});
|
|
|
axios.get('/api/stores').then(function (response) {
|
|
|
- _this.storeList = response.data;
|
|
|
+ _this.storeList = new Map();
|
|
|
+ response.data.map(function (val) {
|
|
|
+ _this.storeList.set(val.storeid, val);
|
|
|
+ });
|
|
|
})["catch"](function (error) {
|
|
|
console.error(error);
|
|
|
});
|
|
|
- this.storeList = this.getStoreName();
|
|
|
},
|
|
|
methods: {
|
|
|
updateWorkOrder: function updateWorkOrder() {
|
|
|
axios.put('/api/workorders/' + this.data.woid, this.data).then(function (response) {})["catch"](function (error) {});
|
|
|
$('#workordereditModal').modal('hide');
|
|
|
- },
|
|
|
- getStoreName: function getStoreName() {
|
|
|
- var _this2 = this;
|
|
|
-
|
|
|
- axios.get('/api/stores/' + this.data.storeid).then(function (response) {
|
|
|
- _this2.storeName = response.data.storesname;
|
|
|
- })["catch"](function (error) {
|
|
|
- console.error(error);
|
|
|
- });
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -49208,54 +49199,59 @@ var render = function() {
|
|
|
_c("div", { staticClass: "form-group" }, [
|
|
|
_c("label", { attrs: { for: "storelist" } }, [_vm._v("Store")]),
|
|
|
_vm._v(" "),
|
|
|
- _c(
|
|
|
- "select",
|
|
|
- {
|
|
|
- directives: [
|
|
|
+ _vm.storeList
|
|
|
+ ? _c(
|
|
|
+ "select",
|
|
|
{
|
|
|
- name: "model",
|
|
|
- rawName: "v-model",
|
|
|
- value: _vm.data.storeid,
|
|
|
- expression: "data.storeid"
|
|
|
- }
|
|
|
- ],
|
|
|
- staticClass: "form-control",
|
|
|
- attrs: { name: "storelist", id: "storelist" },
|
|
|
- on: {
|
|
|
- change: function($event) {
|
|
|
- var $$selectedVal = Array.prototype.filter
|
|
|
- .call($event.target.options, function(o) {
|
|
|
- return o.selected
|
|
|
- })
|
|
|
- .map(function(o) {
|
|
|
- var val = "_value" in o ? o._value : o.value
|
|
|
- return val
|
|
|
- })
|
|
|
- _vm.$set(
|
|
|
- _vm.data,
|
|
|
- "storeid",
|
|
|
- $event.target.multiple
|
|
|
- ? $$selectedVal
|
|
|
- : $$selectedVal[0]
|
|
|
- )
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- _vm._l(_vm.storeList, function(store) {
|
|
|
- return _c(
|
|
|
- "option",
|
|
|
- { key: store.storeid, domProps: { value: store.storeid } },
|
|
|
- [
|
|
|
- _vm._v(
|
|
|
- "\n " +
|
|
|
- _vm._s(store.storesname) +
|
|
|
- "\n "
|
|
|
+ directives: [
|
|
|
+ {
|
|
|
+ name: "model",
|
|
|
+ rawName: "v-model",
|
|
|
+ value: _vm.data.storeid,
|
|
|
+ expression: "data.storeid"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ staticClass: "form-control",
|
|
|
+ attrs: { name: "storelist", id: "storelist" },
|
|
|
+ on: {
|
|
|
+ change: function($event) {
|
|
|
+ var $$selectedVal = Array.prototype.filter
|
|
|
+ .call($event.target.options, function(o) {
|
|
|
+ return o.selected
|
|
|
+ })
|
|
|
+ .map(function(o) {
|
|
|
+ var val = "_value" in o ? o._value : o.value
|
|
|
+ return val
|
|
|
+ })
|
|
|
+ _vm.$set(
|
|
|
+ _vm.data,
|
|
|
+ "storeid",
|
|
|
+ $event.target.multiple
|
|
|
+ ? $$selectedVal
|
|
|
+ : $$selectedVal[0]
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ _vm._l(_vm.storeList.values(), function(store) {
|
|
|
+ return _c(
|
|
|
+ "option",
|
|
|
+ {
|
|
|
+ key: store.storeid,
|
|
|
+ domProps: { value: store.storeid }
|
|
|
+ },
|
|
|
+ [
|
|
|
+ _vm._v(
|
|
|
+ "\n " +
|
|
|
+ _vm._s(store.storesname) +
|
|
|
+ "\n "
|
|
|
+ )
|
|
|
+ ]
|
|
|
)
|
|
|
- ]
|
|
|
+ }),
|
|
|
+ 0
|
|
|
)
|
|
|
- }),
|
|
|
- 0
|
|
|
- )
|
|
|
+ : _vm._e()
|
|
|
])
|
|
|
]),
|
|
|
_vm._v(" "),
|
|
|
@@ -49307,7 +49303,11 @@ var render = function() {
|
|
|
_c("p", [
|
|
|
_c("i", { staticClass: "fas fa-fw fa-building" }),
|
|
|
_vm._v(" "),
|
|
|
- _c("span", [_vm._v(_vm._s(_vm.storeName))])
|
|
|
+ this.storeList
|
|
|
+ ? _c("span", [
|
|
|
+ _vm._v(_vm._s(this.storeList.get(this.data.storeid).storesname))
|
|
|
+ ])
|
|
|
+ : _vm._e()
|
|
|
]),
|
|
|
_vm._v(" "),
|
|
|
_c("p", [
|