|
@@ -25,7 +25,7 @@ let otherFileData = {};
|
|
|
let currentTag = '';
|
|
|
let isChanging = false;
|
|
|
$(document).ready(function () {
|
|
|
- $('#tab_gongliaoji').on('shown.bs.tab', function (e) {
|
|
|
+ $('#tab_gongliaoji').on('show.bs.tab', function (e) {
|
|
|
init();
|
|
|
});
|
|
|
|
|
@@ -157,50 +157,32 @@ $(document).ready(function () {
|
|
|
/**
|
|
|
* 初始化数据
|
|
|
*
|
|
|
- * @return {void}
|
|
|
+ * @return {void|boolean}
|
|
|
*/
|
|
|
function init() {
|
|
|
// 加载工料机数据
|
|
|
- $.ajax({
|
|
|
- url: '/glj/getData',
|
|
|
- type: 'post',
|
|
|
- dataType: 'json',
|
|
|
- data: {project_id: scUrlUtil.GetQueryString('project')},
|
|
|
- error: function() {
|
|
|
- // alert('数据传输错误');
|
|
|
- },
|
|
|
- beforeSend: function() {
|
|
|
-
|
|
|
- },
|
|
|
- success: function(response) {
|
|
|
- if (response.err === 1) {
|
|
|
- let msg = response.msg !== undefined && response.msg !== '' ? response.msg : '读取工料机数据失败!';
|
|
|
- alert(msg);
|
|
|
- return false;
|
|
|
- }
|
|
|
- let data = response.data;
|
|
|
- // 赋值
|
|
|
- jsonData = data.gljList !== undefined && data.gljList.length > 0 ? data.gljList : [];
|
|
|
- mixRatioConnectData = data.mixRatioConnectData !== undefined ? data.mixRatioConnectData : mixRatioConnectData;
|
|
|
+ let data = projectObj.project.projectGLJ === null ? null : projectObj.project.projectGLJ.datas;
|
|
|
+ if (data === null) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ // 赋值
|
|
|
+ jsonData = data.gljList !== undefined && data.gljList.length > 0 ? data.gljList : [];
|
|
|
+ mixRatioConnectData = data.mixRatioConnectData !== undefined ? data.mixRatioConnectData : mixRatioConnectData;
|
|
|
|
|
|
- host = data.constData.hostname !== undefined ? data.constData.hostname : '';
|
|
|
- materialIdList = data.constData.materialIdList !== undefined ? data.constData.materialIdList : materialIdList;
|
|
|
- roomId = data.constData.roomId !== undefined ? data.constData.roomId : roomId;
|
|
|
- canNotChangeTypeId = data.constData.ownCompositionTypes !== undefined ?
|
|
|
- data.constData.ownCompositionTypes : canNotChangeTypeId;
|
|
|
- GLJTypeConst = data.constData.GLJTypeConst !== undefined ? JSON.parse(data.constData.GLJTypeConst) : GLJTypeConst;
|
|
|
+ host = data.constData.hostname !== undefined ? data.constData.hostname : '';
|
|
|
+ materialIdList = data.constData.materialIdList !== undefined ? data.constData.materialIdList : materialIdList;
|
|
|
+ roomId = data.constData.roomId !== undefined ? data.constData.roomId : roomId;
|
|
|
+ canNotChangeTypeId = data.constData.ownCompositionTypes !== undefined ?
|
|
|
+ data.constData.ownCompositionTypes : canNotChangeTypeId;
|
|
|
+ GLJTypeConst = data.constData.GLJTypeConst !== undefined ? JSON.parse(data.constData.GLJTypeConst) : GLJTypeConst;
|
|
|
|
|
|
- let usedTenderList = data.usedTenderList !== undefined ? data.usedTenderList : [];
|
|
|
- usedUnitPriceInfo = data.constData.usedUnitPriceInfo !== undefined ?
|
|
|
- data.constData.usedUnitPriceInfo : {};
|
|
|
- // 存入缓存
|
|
|
- projectObj.project.projectGLJ.datas = jsonData;
|
|
|
+ let usedTenderList = data.usedTenderList !== undefined ? data.usedTenderList : [];
|
|
|
+ usedUnitPriceInfo = data.constData.usedUnitPriceInfo !== undefined ?
|
|
|
+ data.constData.usedUnitPriceInfo : {};
|
|
|
|
|
|
- spreadInit();
|
|
|
- unitPriceFileInit(usedUnitPriceInfo.name, usedTenderList);
|
|
|
- }
|
|
|
- });
|
|
|
+ unitPriceFileInit(usedUnitPriceInfo.name, usedTenderList);
|
|
|
|
|
|
+ setTimeout(spreadInit, 1);
|
|
|
}
|
|
|
|
|
|
/**
|