This commit is contained in:
2021-01-20 00:32:46 +00:00
parent cc32c335e9
commit 40fadc8180
7 changed files with 53 additions and 36 deletions

View File

@@ -401,6 +401,8 @@ export default {
return "$ayiCustomize"; return "$ayiCustomize";
case window.$gz.type.Part: case window.$gz.type.Part:
return "$ayiBoxes"; return "$ayiBoxes";
case window.$gz.type.PartWarehouse:
return "$ayiWarehouse";
case window.$gz.type.PartAssembly: case window.$gz.type.PartAssembly:
return "$ayiObjectGroup"; return "$ayiObjectGroup";
case window.$gz.type.PM: case window.$gz.type.PM:

View File

@@ -425,7 +425,6 @@ function initNavPanel() {
//NOTE: V7 HAD PORECEIPTITEMS, THAT MAY BE AN ANACHRONISM NOW SO NOT PUTTING HERE //NOTE: V7 HAD PORECEIPTITEMS, THAT MAY BE AN ANACHRONISM NOW SO NOT PUTTING HERE
//ADJUSTMENTS //ADJUSTMENTS
sub.push({ sub.push({
title: "InventoryPartInventoryAdjustments", title: "InventoryPartInventoryAdjustments",
@@ -434,11 +433,11 @@ function initNavPanel() {
key: key++ key: key++
}); });
//WAREHOUSES //WAREHOUSES
sub.push({ sub.push({
title: "PartWarehouseList", title: "PartWarehouseList",
icon: "$ayiWarehouse", icon: "$ayiWarehouse",
route: "/inv-warehouses", route: "/inv-part-warehouses",
key: key++ key: key++
}); });
} }

View File

@@ -245,7 +245,7 @@ export default {
break; break;
case ayatype.PartWarehouse: case ayatype.PartWarehouse:
vm.$router.push({ vm.$router.push({
name: "part-warehouse", name: "inv-part-warehouse",
params: { recordid: tid.id } params: { recordid: tid.id }
}); });
break; break;

View File

@@ -238,8 +238,9 @@ export default {
return template.find(z => z.type != undefined); return template.find(z => z.type != undefined);
}, },
GetValueForField: function(dataKey) { GetValueForField: function(dataKey) {
if (!this.value) { if (this.value == null) {
return null; //return null;
this.value = "{}";
} }
//get the data out of the JSON string value //get the data out of the JSON string value
@@ -333,6 +334,9 @@ export default {
SetValueForField: function(dataKey, newValue) { SetValueForField: function(dataKey, newValue) {
//Get the current data out of the json string value //Get the current data out of the json string value
// //
if (this.value == null) {
this.value = "{}";
}
let cData = JSON.parse(this.value); let cData = JSON.parse(this.value);
if (!window.$gz.util.has(cData, dataKey)) { if (!window.$gz.util.has(cData, dataKey)) {
cData[dataKey] = null; cData[dataKey] = null;

View File

@@ -38,8 +38,11 @@
//and in theory it could help if picking more than one tag that have similar selection criteria //and in theory it could help if picking more than one tag that have similar selection criteria
export default { export default {
beforeUpdate() { 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 //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.sourcetags = this.value;
this.initialized = true; this.initialized = true;
} }
@@ -54,7 +57,11 @@ export default {
}; };
}, },
props: { props: {
value: Array, value: {
default: [],
type: Array
},
// value: Array,
label: String, label: String,
readonly: { type: Boolean, default: false } readonly: { type: Boolean, default: false }
}, },

View File

@@ -21,7 +21,8 @@
<v-col cols="12" sm="6" lg="4" xl="3"> <v-col cols="12" sm="6" lg="4" xl="3">
<v-checkbox <v-checkbox
v-model="obj.active" v-model="obj.active"
:readonly="formState.readOnly" :readonly="formState.readOnly || obj.id == 1"
:disabled="obj.id == 1"
:label="$ay.t('Active')" :label="$ay.t('Active')"
ref="active" ref="active"
data-cy="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 API_BASE_URL = "part-warehouse/";
const FORM_CUSTOM_TEMPLATE_KEY = "PartWarehouse"; //<-- Should always be CoreBizObject AyaType name here where possible const FORM_CUSTOM_TEMPLATE_KEY = "PartWarehouse"; //<-- Should always be CoreBizObject AyaType name here where possible
@@ -180,11 +181,7 @@ export default {
notes: null, notes: null,
wiki: null, wiki: null,
customFields: "{}", customFields: "{}",
tags: [], tags: []
dateStarted: window.$gz.locale.nowUTC8601String(),
dateCompleted: null,
partwarehouseOverseerId: null,
accountNumber: null
}, },
formState: { formState: {
ready: false, 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() //NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({ this.$router.push({
name: "partwarehouse-edit", name: "inv-part-warehouse",
params: { params: {
recordid: res.data.id, recordid: res.data.id,
obj: res.data // Pass data object to new form obj: res.data // Pass data object to new form
@@ -419,7 +416,7 @@ export default {
} else { } else {
//Navigate to new record //Navigate to new record
this.$router.push({ this.$router.push({
name: "partwarehouse-edit", name: "inv-part-warehouse",
params: { params: {
recordid: res.data.id, recordid: res.data.id,
obj: res.data // Pass data object to new form obj: res.data // Pass data object to new form
@@ -457,7 +454,7 @@ async function clickHandler(menuItem) {
break; break;
case "new": case "new":
m.vm.$router.push({ m.vm.$router.push({
name: "partwarehouse-edit", name: "inv-part-warehouse",
params: { recordid: 0, new: true } params: { recordid: 0, new: true }
}); });
break; 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({ menuOptions.menuItems.push({
title: "Delete", title: "Delete",
icon: "$ayiTrashAlt", icon: "$ayiTrashAlt",
@@ -583,7 +585,6 @@ function generateMenu(vm) {
menuOptions.menuItems.push({ divider: true, inset: false }); menuOptions.menuItems.push({ divider: true, inset: false });
window.$gz.eventBus.$emit("menu-change", menuOptions); window.$gz.eventBus.$emit("menu-change", menuOptions);
} }

View File

@@ -9,24 +9,24 @@
</gz-extensions> </gz-extensions>
<gz-data-table <gz-data-table
ref="gzdatatable" ref="gzdatatable"
formKey="project-list" formKey="inv-part-warehouses"
:dataListKey="dataListKey" :dataListKey="dataListKey"
:dataListFilter="dataListFilter" :dataListFilter="dataListFilter"
:dataListSort="dataListSort" :dataListSort="dataListSort"
:showSelect="rights.read" :showSelect="rights.read"
:reload="reload" :reload="reload"
v-on:selection-change="handleSelected" v-on:selection-change="handleSelected"
data-cy="projectsTable" data-cy="partwarehousesTable"
> >
</gz-data-table> </gz-data-table>
</div> </div>
</template> </template>
<script> <script>
const FORM_KEY = "project-list"; const FORM_KEY = "inv-part-warehouses";
export default { export default {
created() { 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); window.$gz.eventBus.$on("menu-click", clickHandler);
generateMenu(this); generateMenu(this);
}, },
@@ -36,11 +36,11 @@ export default {
data() { data() {
return { return {
currentListViewId: 1, currentListViewId: 1,
dataListKey: "ProjectDataList", dataListKey: "PartWarehouseDataList",
dataListFilter: "", dataListFilter: "",
dataListSort: "", dataListSort: "",
rights: window.$gz.role.defaultRightsObject(), rights: window.$gz.role.defaultRightsObject(),
ayType: window.$gz.type.Project, ayType: window.$gz.type.PartWarehouse,
selectedItems: [], selectedItems: [],
reload: false reload: false
}; };
@@ -64,13 +64,15 @@ async function clickHandler(menuItem) {
switch (m.key) { switch (m.key) {
case "new": case "new":
m.vm.$router.push({ m.vm.$router.push({
name: "project-edit", name: "inv-part-warehouse",
params: { recordid: 0 } params: { recordid: 0 }
}); });
break; break;
case "extensions": case "extensions":
let res = await m.vm.$refs.extensions.open( 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) { if (res && res.refresh == true) {
m.vm.reload = !m.vm.reload; m.vm.reload = !m.vm.reload;
@@ -81,13 +83,15 @@ async function clickHandler(menuItem) {
//last report selected is in m.id //last report selected is in m.id
m.vm.$router.push({ m.vm.$router.push({
name: "ay-report", name: "ay-report",
params: { recordid: m.id, ayatype: window.$gz.type.Project } params: { recordid: m.id, ayatype: window.$gz.type.PartWarehouse }
}); });
} else { } else {
//general report selector chosen //general report selector chosen
let res = await m.vm.$refs.reportSelector.open( 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 //if null for no selection
@@ -101,7 +105,7 @@ async function clickHandler(menuItem) {
//Now open the report viewer... //Now open the report viewer...
m.vm.$router.push({ m.vm.$router.push({
name: "ay-report", name: "ay-report",
params: { recordid: res.id, ayatype: window.$gz.type.Project } params: { recordid: res.id, ayatype: window.$gz.type.PartWarehouse }
}); });
} }
break; break;
@@ -121,12 +125,12 @@ async function clickHandler(menuItem) {
function generateMenu(vm) { function generateMenu(vm) {
let menuOptions = { let menuOptions = {
isMain: true, isMain: true,
icon: "$ayiProjectDiagram", icon: "$ayiWarehouse",
title: "ProjectList", title: "PartWarehouseList",
helpUrl: "form-svc-projects", helpUrl: "form-inv-part-warehouses",
menuItems: [], menuItems: [],
formData: { formData: {
ayaType: window.$gz.type.Project ayaType: window.$gz.type.PartWarehouse
} }
}; };