|
@@ -2929,6 +2929,7 @@ $(document).ready(function() {
|
|
|
font: '12px 微软雅黑',
|
|
|
};
|
|
|
this.dealSpread = SpreadJsObj.createNewSpread($('.batch-r', this.obj)[0]);
|
|
|
+ this.dealSheet = this.dealSpread.getActiveSheet();
|
|
|
// 初始化 清单编号、部位数量复核表 表格
|
|
|
this.initView();
|
|
|
SpreadJsObj.initSheet(this.dealSpread.getActiveSheet(), this.dealSpreadSetting);
|
|
@@ -3094,6 +3095,42 @@ $(document).ready(function() {
|
|
|
$('input[name=batch-filter]').change(function () {
|
|
|
setLocalCache('zh-calc-batch-filter', this.checked ? 1 : 0);
|
|
|
});
|
|
|
+ this.initDealBillsSearch();
|
|
|
+ }
|
|
|
+ search(keyword) {
|
|
|
+ this.searchResult = [];
|
|
|
+ this.searchCur = 0;
|
|
|
+ if (keyword) {
|
|
|
+ for (const [i, d] of this.dealSheet.zh_data.entries()) {
|
|
|
+ if (d.code.indexOf(keyword) >= 0 || d.name.indexOf(keyword) >= 0) this.searchResult.push(d);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $('#batch-dbs-count').html(`结果:${this.searchResult.length}`);
|
|
|
+ if (this.searchResult.length > 0) SpreadJsObj.locateData(this.dealSheet, this.searchResult[0]);
|
|
|
+ }
|
|
|
+ searchPre() {
|
|
|
+ if (this.searchResult.length <= 1) return;
|
|
|
+ this.searchCur = this.searchCur - 1;
|
|
|
+ if (this.searchCur < 0) this.searchCur = this.searchResult.length - 1;
|
|
|
+ SpreadJsObj.locateData(this.dealSheet, this.searchResult[this.searchCur]);
|
|
|
+ }
|
|
|
+ searchNext() {
|
|
|
+ if (this.searchResult.length <= 1) return;
|
|
|
+ this.searchCur = this.searchCur + 1;
|
|
|
+ if (this.searchCur >= this.searchResult.length) this.searchCur = 0;
|
|
|
+ SpreadJsObj.locateData(this.dealSheet, this.searchResult[this.searchCur]);
|
|
|
+ }
|
|
|
+ initDealBillsSearch() {
|
|
|
+ const self = this;
|
|
|
+ $('#batch-dbs-keyword').change(function () { self.search(this.value); });
|
|
|
+ $('#batch-dbs-pre').click(function (e) {
|
|
|
+ self.searchPre();
|
|
|
+ e.stopPropagation();
|
|
|
+ });
|
|
|
+ $('#batch-dbs-next').click(function (e) {
|
|
|
+ self.searchNext();
|
|
|
+ e.stopPropagation();
|
|
|
+ });
|
|
|
}
|
|
|
// 初始化左侧表格
|
|
|
initView () {
|
|
@@ -3120,10 +3157,6 @@ $(document).ready(function() {
|
|
|
posSheet.clear(0, 0, posSheet.getRowCount(), posSheet.getColumnCount(), GC.Spread.Sheets.SheetArea.viewport, GC.Spread.Sheets.StorageType.data);
|
|
|
posSheet.setSelection(0, 0, 1 ,1);
|
|
|
SpreadJsObj.endMassOperation(posSheet);
|
|
|
- // 检查签约清单数据,以工具栏数据为准
|
|
|
- if (dealBills) {
|
|
|
- SpreadJsObj.loadSheetData(this.dealSpread.getActiveSheet(), 'data', dealBills.data);
|
|
|
- }
|
|
|
this.dealSpread.getActiveSheet().setSelection(0, 0, 1, 1);
|
|
|
}
|
|
|
// 获取界面数据
|