abp(net core)+easyui+efcore implements warehouse management system – under organizational management upgrade (62)
In the previous article, we have upgraded the warehouse management system implemented by abp (net core) + easyui + efcore to ABP7.3. Today we will upgrade the organization management function and solve some problems after the upgrade.
Abp(net core)+easyui+efcore implements warehouse management system directory
abp(net core)+easyui+efcore implements warehouse management system-overall introduction to ABP (1)
abp(net core)+easyui+efcore implements warehouse management system – solution introduction (2)
abp(net core)+easyui+efcore implements warehouse management system – creating entities at the domain layer (3)
abp(net core)+easyui+efcore implements warehouse management system – define warehousing and implement (4)
abp(net core)+easyui+efcore implements warehouse management system – creating application services (5)
abp(net core)+easyui+efcore implements warehouse management system – using WEBAPI to implement CURD (11)
abp(net core)+easyui+efcore implements warehouse management system – EasyUI cargo management one (nineteen)
abp(net core)+easyui+efcore implements warehouse management system – ABP WebAPI and EasyUI combine to add, delete, modify and check one (twenty-seven)
abp(net core)+easyui+efcore implements warehouse management system – warehousing management one (thirty-seven)
abp(net core)+easyui+efcore implements warehouse management system – outbound management One (forty-nine)
abp(net core)+easyui+efcore implements warehouse management system – ABP upgrade to 7.3 (Fifty-eight)
In the previous article (abp(net core) +easyui+efcore implements warehouse management system – on top of organizational management upgrade (61)) We have partially upgraded the organization management module, and today we continue to upgrade the organization management module.
13. Use the mouse to select the organization information you want to modify in the “Organization Management” list page, and then click the “Modify” button. As shown below.
14. The “Modify Organization Information” interface will pop up, but the interface does not display any data for the organizational information we checked. As shown below.
15. Since our functions are mainly written in javascript, so to call javascript, you can use the “Developer Tools” function of the browser. By checking the code and setting a breakpoint in the showOrg function, we observed that the attributes of the row object begin with a lowercase letter, which is inconsistent with the attribute name in our original code. As shown below.
16. In the Solution Explorer in Visual Studio 2022, find the “ABP.TPLMS.Web.Mvc” project and find “wwwroot\view-resources” \views\orgs\index.js” file, use the left mouse button, double-click, open it in a text editor, and find the showOrg function. The code is modified as follows:
function showOrg(row) {
$("#IDUpdate").val(row.id);
$("#NameUpdate").val(row.name);
$("#UpdBizCode").val(row.bizCode);
$("#UpdType").val(row.Type);
$("#UpdCustomCode").val(row.customCode);
$("#UpdIsAutoExpand").val(row.isAutoExpand);
$("#UpdIsLeaf").val(row.isLeaf);
$("#UpdStatus").val(row.status);
$("#UpdHotKey").val(row.hotKey);
$("#UpdIconName").val(row.iconName);
$("#RemarkUpdate").val(row.remark);
$("#AddTree").combotree('setValue', row.parentId);
$("#AddTree").combotree('setText', row.parentName);
$('#UpdParentName').val(row.parentName);
}
17. Press F5 in the browser, refresh the page, and then repeat steps 13 and 14. In the “Organization Management” list page, use the mouse to select the organization information you want to modify, and then click the “Modify” button. At this time, the “Modify Organization Information” interface will pop up, and the interface will display the data of the organizational information we checked. As shown below.
18. Change the type to 2, and then click the “Save” button. 2This data is saved to the database. As shown below.
19. Use the add function to add a new record of “Beijing Temple of Heaven Store”, then select this record and click the “Delete” button. As shown below.
20. In the pop-up prompt “Information”, we clicked the “OK” button, the program performed the deletion operation, and the prompt message also prompted “Deletion successful!”. As shown below.
21. In fact, the data has not been deleted from the database. The data of “Beijing Temple of Heaven Store” is still in the database. As shown below.
22. In the Solution Explorer in Visual Studio 2022, find the “ABP.TPLMS.Web.Mvc” project and find “wwwroot\view-resources” \views\orgs\index.js” file, use the left mouse button, double-click, open it in a text editor, and find the deleteOrg function. As shown in the red box in the picture below.
23. It is found that in row.Id, the first letter of the Id in the last code to pass the Id in the deletion operation is capitalized. When debugging the modification operation before, I found that the first letter of the row attribute should be lowercase. So the Id here should be changed to id. The specific code is as follows:
//Delete
function deleteOrg() {
$("#del").click(function () {
var rows = $("#dgOrg").datagrid("getSelections");
if (rows.length > 0) {
$.messager.confirm("Prompt", "Are you sure you want to delete?", function (res) {
if (res) {
var codes = []; //The important thing is not {}
for (var i = 0; i < rows.length; i++) {
codes.push(rows[i].id);
_orgService.delete( {
id: rows[i].id
}).done(function () {
$.messager.alert("Prompt", "Deletion successful!");
$("#dgOrg").datagrid("clearChecked");
$("#dgOrg").datagrid("clearSelections");
$('#dgOrg').treegrid('reload');
});
}
}
});
}
})
}
24. Refresh the page in the browser, let us download the modified js code to the local, and then select the “Beijing Tiantan Store” Record, click the “Delete” button, and we click the “OK” button in the pop-up “Information” prompt. The program performs the deletion operation, and the prompt message also prompts “Deletion successful!”. This piece of data is deleted from the database, page There is no such record in . As shown below.
pan style=”color: rgba(0, 128, 0, 1)”>The important thing is not {}
for (var i = 0; i < rows.length; i++) {
codes.push(rows[i].id);
_orgService.delete( {
id: rows[i].id
}).done(function () {
$.messager.alert(“Prompt”, “Deletion successful!”);
$(“#dgOrg”).datagrid(“clearChecked”);
$(“#dgOrg”).datagrid(“clearSelections”);
$(‘#dgOrg’).treegrid(‘reload’);
});
}
}
});
}
})
}
24. Refresh the page in the browser, let us download the modified js code to the local, and then select the “Beijing Tiantan Store” Record, click the “Delete” button, and we click the “OK” button in the pop-up “Information” prompt. The program performs the deletion operation, and the prompt message also prompts “Deletion successful!”. This piece of data is deleted from the database, page There is no such record in . As shown below.