Browse Source

变更选取清单修改

laiguoran 5 years ago
parent
commit
0fb9757837
3 changed files with 5 additions and 5 deletions
  1. 1 1
      app/controller/change_controller.js
  2. 3 3
      app/public/js/change_set.js
  3. 1 1
      app/view/change/info.ejs

+ 1 - 1
app/controller/change_controller.js

@@ -344,7 +344,7 @@ module.exports = app => {
                         ];
                         ];
                         ototalCost += cl.unit_price === null ? 0 : ctx.helper.mul(cl.unit_price, cl.oamount, ctx.tender.info.decimal.tp);
                         ototalCost += cl.unit_price === null ? 0 : ctx.helper.mul(cl.unit_price, cl.oamount, ctx.tender.info.decimal.tp);
                         ctotalCost += cl.unit_price === null ? 0 : ctx.helper.mul(cl.unit_price, cl.camount, ctx.tender.info.decimal.tp);
                         ctotalCost += cl.unit_price === null ? 0 : ctx.helper.mul(cl.unit_price, cl.camount, ctx.tender.info.decimal.tp);
-                        if (cl.lid !== 0) {
+                        if (cl.lid !== '0') {
                             changeListData.push(cLArray.join(';'));
                             changeListData.push(cLArray.join(';'));
                         } else {
                         } else {
                             changeWhiteListData.push(cLArray.join(';'));
                             changeWhiteListData.push(cLArray.join(';'));

+ 3 - 3
app/public/js/change_set.js

@@ -46,7 +46,6 @@ $(document).ready(() => {
     for (const ggd in gclGatherData) {
     for (const ggd in gclGatherData) {
         gclGatherData[ggd].code = gclGatherData[ggd].b_code;
         gclGatherData[ggd].code = gclGatherData[ggd].b_code;
     }
     }
-    console.log(gclGatherData);
     // 数组去重
     // 数组去重
     for (const db of gclGatherData) {
     for (const db of gclGatherData) {
         const exist_index = dealBillList.findIndex(function (item) {
         const exist_index = dealBillList.findIndex(function (item) {
@@ -68,6 +67,7 @@ $(document).ready(() => {
         const unit_price = gcl.unit_price !== null && gcl.unit_price !== undefined ? gcl.unit_price : 0;
         const unit_price = gcl.unit_price !== null && gcl.unit_price !== undefined ? gcl.unit_price : 0;
         let gclhtml = gcl.leafXmjs !== undefined && gcl.leafXmjs !== null ? ' data-gcl="' + gcl_index + '"': '';
         let gclhtml = gcl.leafXmjs !== undefined && gcl.leafXmjs !== null ? ' data-gcl="' + gcl_index + '"': '';
         gcl_index = gclhtml !== '' ? ++gcl_index : gcl_index;
         gcl_index = gclhtml !== '' ? ++gcl_index : gcl_index;
+        // const lid = gcl.leafXmjs !== undefined && gcl.leafXmjs !== null ? gcl.leafXmjs[0].gcl_id : gcl.id;
         listHtml += '<tr data-lid="' + list_index + '"'+ gclhtml +' data-index="' + list_index + '" data-bwmx="">' +
         listHtml += '<tr data-lid="' + list_index + '"'+ gclhtml +' data-index="' + list_index + '" data-bwmx="">' +
             '<td>' + list_index + '</td>' +
             '<td>' + list_index + '</td>' +
             '<td>' + gcl.code + '</td>' +
             '<td>' + gcl.code + '</td>' +
@@ -592,7 +592,7 @@ function tableDataRemake(changeListData) {
     if (changeList.length > 0 && changeList[0]) {
     if (changeList.length > 0 && changeList[0]) {
         for (const cl of changeList) {
         for (const cl of changeList) {
             const clinfo = cl.split(';');
             const clinfo = cl.split(';');
-            // console.log(clinfo);
+            console.log(clinfo);
             const listinfo = changeListData[clinfo[8] - 1];
             const listinfo = changeListData[clinfo[8] - 1];
             // const listinfo = changeListData.find(function (item) {
             // const listinfo = changeListData.find(function (item) {
             //     return item.b_code === clinfo[0] && item.name === clinfo[1] && item.unit_price === parseFloat(clinfo[4])
             //     return item.b_code === clinfo[0] && item.name === clinfo[1] && item.unit_price === parseFloat(clinfo[4])
@@ -601,7 +601,7 @@ function tableDataRemake(changeListData) {
             //     toastr.warning('台账清单列表已不存在'+ clinfo[0] +',故删除之');
             //     toastr.warning('台账清单列表已不存在'+ clinfo[0] +',故删除之');
             //     continue;
             //     continue;
             // }
             // }
-            // console.log(listinfo);
+            console.log(listinfo);
             $('#table-list-select tr[data-index="'+ clinfo[8] +'"]').addClass('table-success');
             $('#table-list-select tr[data-index="'+ clinfo[8] +'"]').addClass('table-success');
             let pushbwmx = '0;0';
             let pushbwmx = '0;0';
             if (listinfo.leafXmjs !== undefined) {
             if (listinfo.leafXmjs !== undefined) {

+ 1 - 1
app/view/change/info.ejs

@@ -439,7 +439,7 @@
                 <tbody id="list">
                 <tbody id="list">
                 <% let windex = 0; %>
                 <% let windex = 0; %>
                 <% for (const [index,cl] of changeList.entries()) { %>
                 <% for (const [index,cl] of changeList.entries()) { %>
-                    <% if (cl.lid !== 0) { %>
+                    <% if (cl.lid !== '0') { %>
                     <tr class="clist clid" data-lid="<%= cl.lid %>_<%= index %>" data-index="<%= index %>">
                     <tr class="clist clid" data-lid="<%= cl.lid %>_<%= index %>" data-index="<%= index %>">
                         <td data-site="0"><%= cl.code %></td>
                         <td data-site="0"><%= cl.code %></td>
                         <td data-site="1"><%= cl.name %></td>
                         <td data-site="1"><%= cl.name %></td>