fix:asset编辑页面查询vendor和assetType取消分页限制 & model保存bug修复
This commit is contained in:
@@ -313,7 +313,7 @@
|
|||||||
},
|
},
|
||||||
getVendorData() {
|
getVendorData() {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
this.$get('sys/dict/all?type=vendor').then(response => {
|
this.$get('sys/dict/all?type=vendor&pageSize=-1').then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.vendorData = response.data;
|
this.vendorData = response.data;
|
||||||
}
|
}
|
||||||
@@ -323,7 +323,7 @@
|
|||||||
},
|
},
|
||||||
getModelData(assetType) {
|
getModelData(assetType) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
let url = assetType ? ('model?typeCode=' + assetType) : 'model';
|
let url = assetType ? ('model?typeCode=' + assetType+'&pageSize=-1') : 'model?pageSize=-1';
|
||||||
this.$get(url).then(response => {
|
this.$get(url).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.modelData = response.data.list;
|
this.modelData = response.data.list;
|
||||||
@@ -501,7 +501,7 @@
|
|||||||
},
|
},
|
||||||
getAssetTypeData() {
|
getAssetTypeData() {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
this.$get('sys/dict/all?type=assetType').then(response => {
|
this.$get('sys/dict/all?type=assetType&pageSize=-1').then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.assetTypeData = response.data;
|
this.assetTypeData = response.data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -238,7 +238,7 @@
|
|||||||
},
|
},
|
||||||
saveType(item) {
|
saveType(item) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
if (this.editingType) {
|
if (this.editingType) { //下拉选中的编辑
|
||||||
let temp = Object.assign({}, item);
|
let temp = Object.assign({}, item);
|
||||||
temp.value = this.editingType;
|
temp.value = this.editingType;
|
||||||
this.$post('sys/dict/update', temp).then(response => {
|
this.$post('sys/dict/update', temp).then(response => {
|
||||||
@@ -254,6 +254,17 @@
|
|||||||
this.$message.error(response.msg);
|
this.$message.error(response.msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
this.$post('sys/dict/save', item).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.editModel.typeCode=response.data.dictEntity.code;
|
||||||
|
this.$emit("reload");
|
||||||
|
this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")});
|
||||||
|
resolve();
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -283,11 +294,7 @@
|
|||||||
} else {
|
} else {
|
||||||
this.$post('sys/dict/save', item).then(response => {
|
this.$post('sys/dict/save', item).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
item.value = this.editingVendor;
|
this.editModel.vendorCode=response.data.dictEntity.code;
|
||||||
item.isEdit = false;
|
|
||||||
if (this.editModel.vendor.id == item.id) {
|
|
||||||
this.editModel.vendor.value = item.value;
|
|
||||||
}
|
|
||||||
this.$emit("reload");
|
this.$emit("reload");
|
||||||
this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")});
|
this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")});
|
||||||
resolve();
|
resolve();
|
||||||
@@ -316,7 +323,7 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
getVendorData() {
|
getVendorData() {
|
||||||
this.$get('sys/dict/all?type=vendor').then(response => {
|
this.$get('sys/dict/all?type=vendor&pageSize=-1').then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.vendorData = response.data.map((item) => {
|
this.vendorData = response.data.map((item) => {
|
||||||
item.isEdit = false;
|
item.isEdit = false;
|
||||||
@@ -326,7 +333,7 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
getTypeData() {
|
getTypeData() {
|
||||||
this.$get('sys/dict/all?type=assetType').then(response => {
|
this.$get('sys/dict/all?type=assetType&pageSize=-1').then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.typeData = response.data.map((item) => {
|
this.typeData = response.data.map((item) => {
|
||||||
item.isEdit = false;
|
item.isEdit = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user