Browse Source

批量插入清单-计量单元,复制粘贴清单编号,根据签约清单自动填入名称等

MaiXinRong 5 years ago
parent
commit
e6ec01b6f0
3 changed files with 28 additions and 4 deletions
  1. 14 0
      app/public/js/ledger.js
  2. 14 0
      app/public/js/revise.js
  3. 0 4
      app/service/stage.js

+ 14 - 0
app/public/js/ledger.js

@@ -2200,6 +2200,20 @@ $(document).ready(function() {
                         posSheet.getCell(0, i + 2 - 1, spreadNS.SheetArea.colHeader).text('清单' + i);
                     }
                 }
+                if (info.cellRange.col === 0 && info.cellRange.colCount === 1) {
+                    const dealBills = self.dealSpread.getActiveSheet().zh_data;
+                    if (dealBills && dealBills.length > 0) {
+                        for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
+                            const curRow = iRow + info.cellRange.row;
+                            const bills = _.find(dealBills, {code: info.sheet.getText(curRow, 0)});
+                            if (bills) {
+                                info.sheet.getCell(curRow, 1).value(bills.name);
+                                info.sheet.getCell(curRow, 2).value(bills.unit);
+                                info.sheet.getCell(curRow, 3).value(bills.unit_price);
+                            }
+                        }
+                    }
+                }
             });
             this.qdSpread.bind(spreadNS.Events.EditEnded, function (e, info) {
                 if (info.col === 0) {

+ 14 - 0
app/public/js/revise.js

@@ -1660,6 +1660,20 @@ $(document).ready(() => {
                         posSheet.getCell(0, i + 2 - 1, spreadNS.SheetArea.colHeader).text('清单' + i);
                     }
                 }
+                if (info.cellRange.col === 0 && info.cellRange.colCount === 1) {
+                    const dealBills = self.dealSpread.getActiveSheet().zh_data;
+                    if (dealBills && dealBills.length > 0) {
+                        for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
+                            const curRow = iRow + info.cellRange.row;
+                            const bills = _.find(dealBills, {code: info.sheet.getText(curRow, 0)});
+                            if (bills) {
+                                info.sheet.getCell(curRow, 1).value(bills.name);
+                                info.sheet.getCell(curRow, 2).value(bills.unit);
+                                info.sheet.getCell(curRow, 3).value(bills.unit_price);
+                            }
+                        }
+                    }
+                }
             });
             this.qdSpread.bind(spreadNS.Events.EditEnded, function (e, info) {
                 if (info.col === 0) {

+ 0 - 4
app/service/stage.js

@@ -191,16 +191,12 @@ module.exports = app => {
             // 最新一期计量(未审批完成),当前操作人的期详细数据,应实时计算
             if (stages.length > 0 && stages[0].status !== auditConst.status.checked) {
                 const stage = stages[0];
-                console.log(stage);
                 const curAuditor = await this.ctx.service.stageAudit.getCurAuditor(stage.id, stage.times);
-                console.log(curAuditor);
                 const isActive = curAuditor ? curAuditor.aid === this.ctx.session.sessionUser.accountId : stage.user_id === this.ctx.session.sessionUser.accountId;
-                console.log(isActive);
                 if (isActive) {
                     stage.curTimes = stage.times;
                     stage.curOrder = curAuditor ? curAuditor.order : 0;
                     const tpData = await this.ctx.service.stageBills.getSumTotalPrice(stage);
-                    console.log(tpData);
                     stage.contract_tp = tpData.contract_tp;
                     stage.qc_tp = tpData.qc_tp;
                     stage.yf_tp = await this.ctx.service.stagePay.getYfTotalPrice(stage);