123456789101112131415161718192021222324252627282930313233343536373839404142 |
- /**
- * Created by Zhong on 2017/12/22.
- */
- let compleRationMain = {
- getRationLibs: function () {
- let scFunc = function (rstData) {
- $("#comple_ration_table").empty();
- for(let i = 0; i < rstData.length; i++){
- if(rstData[i].gljLib !== undefined && rstData[i].gljLib && rstData[i].gljLib != -1){
- let id = rstData[i].ID;
- let libName = rstData[i].dispName;
- $("#comple_ration_table").append(
- "<tr id='tempId'>" +
- "<td><a href='javascript:void(0);'>"+libName+"</a></td></tr>"
- );
- var newHref = "/complementaryRation/ration?repository="+id;
- $("#tempId td:first a").click(function () {
- let newHref = "/complementaryRation/ration?repository="+id;
- let newTab = window.open('about:blank');
- CommonAjax.get(newHref, [], function () {
- newTab.location.href = newHref;
- });
- });
- $("#tempId").attr("id", id);
- }
- }
- };
- let ration_lib = projectInfoObj.projectInfo.engineeringInfo.ration_lib;
- let ids = [];
- for(lib of ration_lib){
- ids.push(parseInt(lib.id));
- }
- CommonAjax.post('/complementaryRation/api/getRationLibs', {user_id: userID, ids: ids}, scFunc);
- }
- };
- $(document).ready(function () {
- $('#comple-ration').on('shown.bs.modal', function () {
- compleRationMain.getRationLibs();
- });
- });
|