|
@@ -1345,37 +1345,36 @@ $(document).ready(() => {
|
|
|
}
|
|
|
class BgBills {
|
|
|
constructor (selector, spreadSetting) {
|
|
|
- const self = this;
|
|
|
this.loaded = false;
|
|
|
this.obj = $(selector)[0];
|
|
|
- this.url = '/tender/' + window.location.pathname.split('/')[2] + '/deal';
|
|
|
this.spreadSetting = spreadSetting;
|
|
|
this.spread = SpreadJsObj.createNewSpread(this.obj);
|
|
|
- SpreadJsObj.initSheet(this.spread.getActiveSheet(), this.spreadSetting);
|
|
|
+ this.sheet = this.spread.getActiveSheet();
|
|
|
+ SpreadJsObj.initSheet(this.sheet, this.spreadSetting);
|
|
|
if (!readOnly) {
|
|
|
this.spread.bind(spreadNS.Events.CellDoubleClick, function (e, info) {
|
|
|
const dealSheet = info.sheet;
|
|
|
const mainSheet = billsSheet;
|
|
|
|
|
|
- const dealBills = SpreadJsObj.getSelectObject(dealSheet);
|
|
|
- if (!dealBills) { return; }
|
|
|
+ const bgBills = SpreadJsObj.getSelectObject(dealSheet);
|
|
|
+ if (!bgBills) { return; }
|
|
|
const mainTree = mainSheet.zh_tree;
|
|
|
const mainNode = SpreadJsObj.getSelectObject(mainSheet);
|
|
|
if (!mainNode || !mainTree) { return; }
|
|
|
|
|
|
if (mainNode.code && mainNode.code !== '' && !mainTree.isLeafXmj(mainNode)) {
|
|
|
- toastr.warning('非最底层项目下,不应添加节点');
|
|
|
+ toastr.warning('非最底层项目下,不应添加变更清单');
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
postData(window.location.pathname + '/update', {
|
|
|
- postType: 'add-deal',
|
|
|
+ postType: 'add-bg',
|
|
|
postData: {
|
|
|
id: mainNode.ledger_id,
|
|
|
type: mainNode.code ? 'child' : 'next',
|
|
|
dealBills: {
|
|
|
- b_code: dealBills.code, name: dealBills.name, unit: dealBills.unit,
|
|
|
- unit_price: dealBills.unit_price,
|
|
|
+ b_code: bgBills.code, name: bgBills.name, unit: bgBills.unit,
|
|
|
+ unit_price: bgBills.unit_price,
|
|
|
}
|
|
|
},
|
|
|
}, function (result) {
|
|
@@ -1396,7 +1395,7 @@ $(document).ready(() => {
|
|
|
loadData () {
|
|
|
if (this.loaded) return;
|
|
|
const self = this;
|
|
|
- postData('/tender/' + window.location.pathname.split('/')[2] +'/get-bg-bills', {}, function (data) {
|
|
|
+ postData('/tender/' + window.location.pathname.split('/')[2] +'/change/bills', {type: 'gather'}, function (data) {
|
|
|
self.data = data;
|
|
|
SpreadJsObj.loadSheetData(self.spread.getActiveSheet(), 'data', data);
|
|
|
self.loaded = true;
|
|
@@ -1587,6 +1586,22 @@ $(document).ready(() => {
|
|
|
headerFont: '12px 微软雅黑',
|
|
|
font: '12px 微软雅黑',
|
|
|
});
|
|
|
+ const bgBills = new BgBills('#bg-bills-spread', {
|
|
|
+ cols: [
|
|
|
+ {title: '清单编号', field: 'code', hAlign: 0, width: 85, formatter: '@', readOnly: true},
|
|
|
+ {title: '名称', field: 'name', hAlign: 0, width: 150, formatter: '@', readOnly: true},
|
|
|
+ {title: '单位', field: 'unit', hAlign: 1, width: 50, formatter: '@', readOnly: true},
|
|
|
+ {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
|
|
|
+ {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},
|
|
|
+ {title: '金额', field: 'total_price', hAlign: 2, width: 50, readOnly: true},
|
|
|
+ ],
|
|
|
+ emptyRows: 0,
|
|
|
+ headRows: 1,
|
|
|
+ headRowHeight: [32],
|
|
|
+ defaultRowHeight: 21,
|
|
|
+ headerFont: '12px 微软雅黑',
|
|
|
+ font: '12px 微软雅黑',
|
|
|
+ });
|
|
|
|
|
|
$.divResizer({
|
|
|
select: '#revise-right-spr',
|
|
@@ -1604,6 +1619,9 @@ $(document).ready(() => {
|
|
|
if (dealBills) {
|
|
|
dealBills.spread.refresh();
|
|
|
}
|
|
|
+ if (bgBills) {
|
|
|
+ bgBills.spread.refresh();
|
|
|
+ }
|
|
|
if (searchLedger) {
|
|
|
searchLedger.spread.refresh();
|
|
|
}
|
|
@@ -1636,6 +1654,9 @@ $(document).ready(() => {
|
|
|
if (dealBills) {
|
|
|
dealBills.spread.refresh();
|
|
|
}
|
|
|
+ if (bgBills) {
|
|
|
+ bgBills.spread.refresh();
|
|
|
+ }
|
|
|
if (searchLedger) {
|
|
|
searchLedger.spread.refresh();
|
|
|
}
|
|
@@ -1804,6 +1825,9 @@ $(document).ready(() => {
|
|
|
} else if (tab.attr('content') === '#deal-bills') {
|
|
|
dealBills.loadData();
|
|
|
dealBills.spread.refresh();
|
|
|
+ } else if (tab.attr('content') === '#bg-bills') {
|
|
|
+ bgBills.loadData();
|
|
|
+ bgBills.spread.refresh();
|
|
|
} else if (tab.attr('content') === '#search' && !searchLedger) {
|
|
|
if (!searchLedger) {
|
|
|
searchLedger = $.billsSearch({
|