|
@@ -3,24 +3,18 @@
|
|
|
*/
|
|
|
|
|
|
var pageOprObj = {
|
|
|
- rationLibName : null,
|
|
|
- rationLibId: null,
|
|
|
initPage : function(container) {
|
|
|
- var me = this, rationLibId = getQueryString("repository"),//获取定额库参数
|
|
|
- rationLibName = storageUtil.getSessionCache("RationGrp","repositoryID_" + rationLibId);
|
|
|
- me.rationLibId = rationLibId;
|
|
|
- if (rationLibName) {
|
|
|
- var html = $("#rationname")[0].outerHTML;
|
|
|
- html = html.replace("XXX定额库", rationLibName);
|
|
|
- $("#rationname")[0].outerHTML = html;
|
|
|
- me.rationLibName = rationLibName;
|
|
|
+ this.libID = parseInt(getQueryString("repository"));
|
|
|
+ var me = this;
|
|
|
+ if (this.libID) {
|
|
|
repositoryGljObj.buildSheet(container);
|
|
|
- repositoryGljObj.getRationGljIds(rationLibId);
|
|
|
+ repositoryGljObj.getRationGljIds(me.libID);
|
|
|
repositoryGljObj.getGljDistType(function () {
|
|
|
- repositoryGljObj.currentRepositoryId = parseInt(rationLibId);
|
|
|
+ repositoryGljObj.currentRepositoryId = parseInt(me.libID);
|
|
|
//引用的工料机库
|
|
|
- let gljLibID = storageUtil.getSessionCache("gljLib", "repositoryID_" + rationLibId);
|
|
|
+ let gljLibID = $('#rationname').attr('gljLib');
|
|
|
if(gljLibID && typeof gljLibID !== 'undefined'){
|
|
|
+ gljLibID = parseInt(gljLibID);
|
|
|
repositoryGljObj.getGljTree(gljLibID, function () {
|
|
|
repositoryGljObj.getGljItems(gljLibID);
|
|
|
});
|
|
@@ -669,7 +663,7 @@ repositoryGljObj = {
|
|
|
$.ajax({
|
|
|
type: 'post',
|
|
|
url: 'api/updateRationBasePrc',
|
|
|
- data:{data: JSON.stringify({repId: pageOprObj.rationLibId, lastOpr: userAccount, basePrcArr: basePrcArr})},
|
|
|
+ data:{data: JSON.stringify({repId: pageOprObj.libID, lastOpr: userAccount, basePrcArr: basePrcArr})},
|
|
|
dataType: 'json',
|
|
|
success: function (result) {
|
|
|
if(result.error){
|
|
@@ -855,7 +849,7 @@ var gljTypeTreeOprObj = {
|
|
|
$.ajax({
|
|
|
type:"POST",
|
|
|
url:"api/deleteGljNodes",
|
|
|
- data:{"repId": pageOprObj.rationLibId, "lastOpr": userAccount, "nodes": JSON.stringify(nodeIds), "preNodeId": preNodeId, "preNodeNextId": treeNode.NextSiblingID},
|
|
|
+ data:{"repId": pageOprObj.libID, "lastOpr": userAccount, "nodes": JSON.stringify(nodeIds), "preNodeId": preNodeId, "preNodeNextId": treeNode.NextSiblingID},
|
|
|
dataType:"json",
|
|
|
cache:false,
|
|
|
timeout:5000,
|
|
@@ -894,7 +888,7 @@ var gljTypeTreeOprObj = {
|
|
|
$.ajax({
|
|
|
type:"POST",
|
|
|
url:"api/updateGljNodes",
|
|
|
- data:{"repId": pageOprObj.rationLibId, "lastOpr": userAccount, "nodes": JSON.stringify(reqData)},
|
|
|
+ data:{"repId": pageOprObj.libID, "lastOpr": userAccount, "nodes": JSON.stringify(reqData)},
|
|
|
dataType:"json",
|
|
|
cache:false,
|
|
|
timeout:5000,
|