This commit is contained in:
@@ -401,6 +401,8 @@ export default {
|
||||
return "$ayiCustomize";
|
||||
case window.$gz.type.Part:
|
||||
return "$ayiBoxes";
|
||||
case window.$gz.type.PartWarehouse:
|
||||
return "$ayiWarehouse";
|
||||
case window.$gz.type.PartAssembly:
|
||||
return "$ayiObjectGroup";
|
||||
case window.$gz.type.PM:
|
||||
|
||||
@@ -425,7 +425,6 @@ function initNavPanel() {
|
||||
|
||||
//NOTE: V7 HAD PORECEIPTITEMS, THAT MAY BE AN ANACHRONISM NOW SO NOT PUTTING HERE
|
||||
|
||||
|
||||
//ADJUSTMENTS
|
||||
sub.push({
|
||||
title: "InventoryPartInventoryAdjustments",
|
||||
@@ -434,11 +433,11 @@ function initNavPanel() {
|
||||
key: key++
|
||||
});
|
||||
|
||||
//WAREHOUSES
|
||||
sub.push({
|
||||
//WAREHOUSES
|
||||
sub.push({
|
||||
title: "PartWarehouseList",
|
||||
icon: "$ayiWarehouse",
|
||||
route: "/inv-warehouses",
|
||||
route: "/inv-part-warehouses",
|
||||
key: key++
|
||||
});
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ export default {
|
||||
break;
|
||||
case ayatype.PartWarehouse:
|
||||
vm.$router.push({
|
||||
name: "part-warehouse",
|
||||
name: "inv-part-warehouse",
|
||||
params: { recordid: tid.id }
|
||||
});
|
||||
break;
|
||||
|
||||
@@ -238,8 +238,9 @@ export default {
|
||||
return template.find(z => z.type != undefined);
|
||||
},
|
||||
GetValueForField: function(dataKey) {
|
||||
if (!this.value) {
|
||||
return null;
|
||||
if (this.value == null) {
|
||||
//return null;
|
||||
this.value = "{}";
|
||||
}
|
||||
|
||||
//get the data out of the JSON string value
|
||||
@@ -333,6 +334,9 @@ export default {
|
||||
SetValueForField: function(dataKey, newValue) {
|
||||
//Get the current data out of the json string value
|
||||
//
|
||||
if (this.value == null) {
|
||||
this.value = "{}";
|
||||
}
|
||||
let cData = JSON.parse(this.value);
|
||||
if (!window.$gz.util.has(cData, dataKey)) {
|
||||
cData[dataKey] = null;
|
||||
|
||||
@@ -38,8 +38,11 @@
|
||||
//and in theory it could help if picking more than one tag that have similar selection criteria
|
||||
export default {
|
||||
beforeUpdate() {
|
||||
// if(this.value==null){
|
||||
// this.value=[];
|
||||
// }
|
||||
//Set the initial list items based on the record items, this only needs to be called once at init
|
||||
if (!this.initialized && this.value.length > 0) {
|
||||
if (!this.initialized && this.value!=null && this.value.length > 0) {
|
||||
this.sourcetags = this.value;
|
||||
this.initialized = true;
|
||||
}
|
||||
@@ -54,7 +57,11 @@ export default {
|
||||
};
|
||||
},
|
||||
props: {
|
||||
value: Array,
|
||||
value: {
|
||||
default: [],
|
||||
type: Array
|
||||
},
|
||||
// value: Array,
|
||||
label: String,
|
||||
readonly: { type: Boolean, default: false }
|
||||
},
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||
<v-checkbox
|
||||
v-model="obj.active"
|
||||
:readonly="formState.readOnly"
|
||||
:readonly="formState.readOnly || obj.id == 1"
|
||||
:disabled="obj.id == 1"
|
||||
:label="$ay.t('Active')"
|
||||
ref="active"
|
||||
data-cy="active"
|
||||
@@ -104,7 +105,7 @@
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
const FORM_KEY = "partwarehouse-edit";
|
||||
const FORM_KEY = "inv-part-warehouse";
|
||||
const API_BASE_URL = "part-warehouse/";
|
||||
const FORM_CUSTOM_TEMPLATE_KEY = "PartWarehouse"; //<-- Should always be CoreBizObject AyaType name here where possible
|
||||
|
||||
@@ -180,11 +181,7 @@ export default {
|
||||
notes: null,
|
||||
wiki: null,
|
||||
customFields: "{}",
|
||||
tags: [],
|
||||
dateStarted: window.$gz.locale.nowUTC8601String(),
|
||||
dateCompleted: null,
|
||||
partwarehouseOverseerId: null,
|
||||
accountNumber: null
|
||||
tags: []
|
||||
},
|
||||
formState: {
|
||||
ready: false,
|
||||
@@ -328,7 +325,7 @@ export default {
|
||||
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
|
||||
|
||||
this.$router.push({
|
||||
name: "partwarehouse-edit",
|
||||
name: "inv-part-warehouse",
|
||||
params: {
|
||||
recordid: res.data.id,
|
||||
obj: res.data // Pass data object to new form
|
||||
@@ -419,7 +416,7 @@ export default {
|
||||
} else {
|
||||
//Navigate to new record
|
||||
this.$router.push({
|
||||
name: "partwarehouse-edit",
|
||||
name: "inv-part-warehouse",
|
||||
params: {
|
||||
recordid: res.data.id,
|
||||
obj: res.data // Pass data object to new form
|
||||
@@ -457,7 +454,7 @@ async function clickHandler(menuItem) {
|
||||
break;
|
||||
case "new":
|
||||
m.vm.$router.push({
|
||||
name: "partwarehouse-edit",
|
||||
name: "inv-part-warehouse",
|
||||
params: { recordid: 0, new: true }
|
||||
});
|
||||
break;
|
||||
@@ -533,7 +530,12 @@ function generateMenu(vm) {
|
||||
});
|
||||
}
|
||||
|
||||
if (vm.rights.delete && vm.$route.params.recordid != 0) {
|
||||
//don't allow deleting the default warehouse id=1
|
||||
if (
|
||||
vm.rights.delete &&
|
||||
vm.$route.params.recordid != 0 &&
|
||||
vm.$route.params.recordid != 1
|
||||
) {
|
||||
menuOptions.menuItems.push({
|
||||
title: "Delete",
|
||||
icon: "$ayiTrashAlt",
|
||||
@@ -583,7 +585,6 @@ function generateMenu(vm) {
|
||||
|
||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||
|
||||
|
||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,24 +9,24 @@
|
||||
</gz-extensions>
|
||||
<gz-data-table
|
||||
ref="gzdatatable"
|
||||
formKey="project-list"
|
||||
formKey="inv-part-warehouses"
|
||||
:dataListKey="dataListKey"
|
||||
:dataListFilter="dataListFilter"
|
||||
:dataListSort="dataListSort"
|
||||
:showSelect="rights.read"
|
||||
:reload="reload"
|
||||
v-on:selection-change="handleSelected"
|
||||
data-cy="projectsTable"
|
||||
data-cy="partwarehousesTable"
|
||||
>
|
||||
</gz-data-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const FORM_KEY = "project-list";
|
||||
const FORM_KEY = "inv-part-warehouses";
|
||||
export default {
|
||||
created() {
|
||||
this.rights = window.$gz.role.getRights(window.$gz.type.Project);
|
||||
this.rights = window.$gz.role.getRights(window.$gz.type.PartWarehouse);
|
||||
window.$gz.eventBus.$on("menu-click", clickHandler);
|
||||
generateMenu(this);
|
||||
},
|
||||
@@ -36,11 +36,11 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
currentListViewId: 1,
|
||||
dataListKey: "ProjectDataList",
|
||||
dataListKey: "PartWarehouseDataList",
|
||||
dataListFilter: "",
|
||||
dataListSort: "",
|
||||
rights: window.$gz.role.defaultRightsObject(),
|
||||
ayType: window.$gz.type.Project,
|
||||
ayType: window.$gz.type.PartWarehouse,
|
||||
selectedItems: [],
|
||||
reload: false
|
||||
};
|
||||
@@ -64,13 +64,15 @@ async function clickHandler(menuItem) {
|
||||
switch (m.key) {
|
||||
case "new":
|
||||
m.vm.$router.push({
|
||||
name: "project-edit",
|
||||
name: "inv-part-warehouse",
|
||||
params: { recordid: 0 }
|
||||
});
|
||||
break;
|
||||
case "extensions":
|
||||
let res = await m.vm.$refs.extensions.open(
|
||||
m.vm.$refs.gzdatatable.getDataListSelection(window.$gz.type.Project)
|
||||
m.vm.$refs.gzdatatable.getDataListSelection(
|
||||
window.$gz.type.PartWarehouse
|
||||
)
|
||||
);
|
||||
if (res && res.refresh == true) {
|
||||
m.vm.reload = !m.vm.reload;
|
||||
@@ -81,13 +83,15 @@ async function clickHandler(menuItem) {
|
||||
//last report selected is in m.id
|
||||
m.vm.$router.push({
|
||||
name: "ay-report",
|
||||
params: { recordid: m.id, ayatype: window.$gz.type.Project }
|
||||
params: { recordid: m.id, ayatype: window.$gz.type.PartWarehouse }
|
||||
});
|
||||
} else {
|
||||
//general report selector chosen
|
||||
|
||||
let res = await m.vm.$refs.reportSelector.open(
|
||||
m.vm.$refs.gzdatatable.getDataListSelection(window.$gz.type.Project)
|
||||
m.vm.$refs.gzdatatable.getDataListSelection(
|
||||
window.$gz.type.PartWarehouse
|
||||
)
|
||||
);
|
||||
|
||||
//if null for no selection
|
||||
@@ -101,7 +105,7 @@ async function clickHandler(menuItem) {
|
||||
//Now open the report viewer...
|
||||
m.vm.$router.push({
|
||||
name: "ay-report",
|
||||
params: { recordid: res.id, ayatype: window.$gz.type.Project }
|
||||
params: { recordid: res.id, ayatype: window.$gz.type.PartWarehouse }
|
||||
});
|
||||
}
|
||||
break;
|
||||
@@ -121,12 +125,12 @@ async function clickHandler(menuItem) {
|
||||
function generateMenu(vm) {
|
||||
let menuOptions = {
|
||||
isMain: true,
|
||||
icon: "$ayiProjectDiagram",
|
||||
title: "ProjectList",
|
||||
helpUrl: "form-svc-projects",
|
||||
icon: "$ayiWarehouse",
|
||||
title: "PartWarehouseList",
|
||||
helpUrl: "form-inv-part-warehouses",
|
||||
menuItems: [],
|
||||
formData: {
|
||||
ayaType: window.$gz.type.Project
|
||||
ayaType: window.$gz.type.PartWarehouse
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user