|
@@ -1420,6 +1420,24 @@ projectGljObject = {
|
|
|
if ($("#freight_ration").is(":visible") && materialCalcObj.freightRationSpread) materialCalcObj.freightRationSpread.refresh();
|
|
if ($("#freight_ration").is(":visible") && materialCalcObj.freightRationSpread) materialCalcObj.freightRationSpread.refresh();
|
|
|
if ($("#price_ration").is(":visible") && materialCalcObj.priceRationSpread) materialCalcObj.priceRationSpread.refresh();
|
|
if ($("#price_ration").is(":visible") && materialCalcObj.priceRationSpread) materialCalcObj.priceRationSpread.refresh();
|
|
|
},
|
|
},
|
|
|
|
|
+ getColIndex: function (colName) {
|
|
|
|
|
+ const headerArr = this.projectGljSetting.header;
|
|
|
|
|
+ for (let index = 0; index < headerArr.length; index++) {
|
|
|
|
|
+ const e = headerArr[index];
|
|
|
|
|
+ if (e.headerName === colName) return index;
|
|
|
|
|
+ }
|
|
|
|
|
+ return -1;
|
|
|
|
|
+ },
|
|
|
|
|
+ getSheetDataRowAndPrice: function (gljIndex) {
|
|
|
|
|
+ const pGlj = projectObj.project.projectGLJ.datas.gljMap[gljIndex];
|
|
|
|
|
+ if (!pGlj) return null;
|
|
|
|
|
+ const sheetDataArr = this.projectGljSheetData;
|
|
|
|
|
+ for (let index = 0; index < sheetDataArr.length; index++) {
|
|
|
|
|
+ const e = sheetDataArr[index];
|
|
|
|
|
+ if (e.id === pGlj.id) return { row: index, price: e.unit_price.market_price };
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+ },
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
function getProjectResizeEles() {
|
|
function getProjectResizeEles() {
|
|
@@ -1784,7 +1802,8 @@ $(function () {
|
|
|
sheetData[0][1].value === "名称" &&
|
|
sheetData[0][1].value === "名称" &&
|
|
|
sheetData[0][2].value === "规格" &&
|
|
sheetData[0][2].value === "规格" &&
|
|
|
sheetData[0][3].value === "单位" &&
|
|
sheetData[0][3].value === "单位" &&
|
|
|
- sheetData[0][4].value === "预算价";
|
|
|
|
|
|
|
+ sheetData[0][4].value === "类型" &&
|
|
|
|
|
+ sheetData[0][5].value === "预算价";
|
|
|
if (!isRightHead) throw err;
|
|
if (!isRightHead) throw err;
|
|
|
|
|
|
|
|
let rst = [];
|
|
let rst = [];
|
|
@@ -1794,7 +1813,8 @@ $(function () {
|
|
|
name: sheetData[row][1].value,
|
|
name: sheetData[row][1].value,
|
|
|
specs: sheetData[row][2].value,
|
|
specs: sheetData[row][2].value,
|
|
|
unit: sheetData[row][3].value,
|
|
unit: sheetData[row][3].value,
|
|
|
- unitPrice: sheetData[row][4].value,
|
|
|
|
|
|
|
+ type: sheetData[row][4].value,
|
|
|
|
|
+ unitPrice: sheetData[row][5].value,
|
|
|
};
|
|
};
|
|
|
rst.push(rowData);
|
|
rst.push(rowData);
|
|
|
}
|
|
}
|
|
@@ -1859,8 +1879,24 @@ $(function () {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
showAlert("正在导入预算价...", true);
|
|
showAlert("正在导入预算价...", true);
|
|
|
- //
|
|
|
|
|
- let gljList = projectObj.project.projectGLJ.datas.gljList;
|
|
|
|
|
|
|
+ debugger;
|
|
|
|
|
+ const priceCol = projectGljObject.getColIndex("预算价");
|
|
|
|
|
+ console.log(projectGljObject.projectGljSheetData);
|
|
|
|
|
+ const changeInfo = [];
|
|
|
|
|
+ for (const pd of priceData) {
|
|
|
|
|
+ const idx = gljUtil.getIndex(pd, gljKeyArray);
|
|
|
|
|
+ const pGlj = projectGljObject.getSheetDataRowAndPrice(idx);
|
|
|
|
|
+ if (pGlj && pGlj.price !== pd.unitPrice) {
|
|
|
|
|
+ changeInfo.push({ row: pGlj.row, col: priceCol, value: pd.unitPrice });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (changeInfo.length > 0) projectGljObject.batchUpdateProjectGLJ(changeInfo, "projectGljSheet");
|
|
|
|
|
+ $("#showAlert").hide();
|
|
|
|
|
+ $(me).removeClass("disabled");
|
|
|
|
|
+ $("#importPriceForm").modal("hide");
|
|
|
|
|
+ if ($.bootstrapLoading.isLoading()) {
|
|
|
|
|
+ $.bootstrapLoading.end();
|
|
|
|
|
+ }
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
console.log(err);
|
|
console.log(err);
|
|
|
showAlert(err);
|
|
showAlert(err);
|