Browse Source

Merge branch 'dev' into uat

MaiXinRong 3 years ago
parent
commit
68fc2e9e4e

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

@@ -2798,13 +2798,11 @@ $(document).ready(function() {
             if (this.searchResult.length > 0) SpreadJsObj.locateData(this.sheet, 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.sheet, 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.sheet, this.searchResult[this.searchCur]);
@@ -3111,13 +3109,11 @@ $(document).ready(function() {
             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]);

+ 1 - 1
app/public/js/material_list.js

@@ -454,7 +454,7 @@ $(document).ready(() => {
 
 
         // 上传到数据库
-        console.log(datas, gcl);
+        console.log(datas, gcl, mb_id);
         postData(window.location.pathname + '/save', {type: 'adds', postData: {xmjs: datas, mbIds: mb_id}}, function (result) {
             materialListData = result;
             // toastr.success('已成功应用');

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

@@ -2034,13 +2034,11 @@ $(document).ready(() => {
             if (this.searchResult.length > 0) SpreadJsObj.locateData(this.sheet, 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.sheet, 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.sheet, this.searchResult[this.searchCur]);
@@ -2390,13 +2388,11 @@ $(document).ready(() => {
             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]);

+ 1 - 1
app/public/js/shares/cs_tools.js

@@ -1118,7 +1118,7 @@ const showSelectTab = function(select, spread, afterShow) {
             `            <a class="dropdown-item" href="javascript: void(0);" tag="last" name="${relaSelect.showLevel}">最底层</a>\n` +
             '        </div>\n' +
             '    </div>' +
-            `    <div class=input-group input-group-sm pr-1"><select class="form-control form-control-sm">${stdLibHtml.join('')}</select></div>\n` +
+            `    <div class="input-group input-group-sm pr-1"><select class="form-control form-control-sm col-auto">${stdLibHtml.join('')}</select></div>\n` +
             '    <div class="ml-1">\n' +
             '        <div class="dropdown">\n' +
             '            <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n' +

+ 5 - 7
app/service/deal_bills.js

@@ -222,14 +222,12 @@ module.exports = app => {
                 const nd = { id: this.uuid.v4(), tender_id: this.ctx.tender.id };
                 nd.code = d.code;
                 nd.order = d.order;
-                if (d.name) nd.name = d.name;
-                if (d.unit) nd.unit = d.unit;
-                if (d.unit_price) nd.unit_price = this.ctx.helper.round(d.unit_price, info.decimal.up);
+                nd.name = d.name || '';
+                nd.unit = d.unit || '';
+                nd.unit_price = d.unit_price ? this.ctx.helper.round(d.unit_price, info.decimal.up) : 0;
                 const precision = this.ctx.helper.findPrecision(info.precision, d.unit);
-                if (d.quantity) {
-                    nd.quantity = this.ctx.helper.round(d.quantity, precision.value);
-                    nd.total_price = this.ctx.helper.mul(nd.unit_price, nd.quantity, info.decimal.tp);
-                }
+                nd.quantity = d.quantity ? this.ctx.helper.round(d.quantity, precision.value) : 0;
+                nd.total_price = this.ctx.helper.mul(nd.unit_price, nd.quantity, info.decimal.tp);
                 insertData.push(nd);
             }
             const result = await this.db.insert(this.tableName, insertData);

+ 5 - 5
app/service/material_list.js

@@ -312,8 +312,8 @@ module.exports = app => {
                     xmj_id: ml.xmj_id,
                     mx_id: ml.mx_id,
                     gather_qty: ml.gather_qty,
-                    quantity: ml.quantity,
-                    expr: ml.expr,
+                    quantity: ml.quantity ? ml.quantity : 0,
+                    expr: ml.expr ? ml.expr : '',
                     is_join: is_join ? 0 : 1,
                     in_time: new Date(),
                 };
@@ -366,7 +366,7 @@ module.exports = app => {
                             };
                             list.push(newLists);
                         }
-                        if (this._.findIndex(listGcl, {gcl_id: xmj.gcl_id}) === -1) {
+                        if (this._.findIndex(listGcl, { gcl_id: xmj.gcl_id, mb_id: mb }) === -1) {
                             const newListGcl = {
                                 tid: this.ctx.tender.id,
                                 order: this.ctx.material.order,
@@ -548,8 +548,8 @@ module.exports = app => {
                             listGcl.push(xmj.gcl_id);
                             updateListGcl.push({
                                 row: {
-                                    expr: datas.expr,
-                                    quantity: datas.quantity,
+                                    expr: data.expr,
+                                    quantity: data.quantity,
                                 },
                                 where: {
                                     tid: this.ctx.tender.id,

+ 1 - 1
app/view/material/modal.ejs

@@ -132,4 +132,4 @@
     </div>
 </div>
 <script src="/public/js/moment/moment.min.js"></script>
-<script src="/public/js/measure_material.js"></script>
+<script src="/public/js/measure_material.js?202204191"></script>

+ 2 - 2
app/view/profile/sign.ejs

@@ -51,12 +51,12 @@
                                     <div class="position-relative">
                                         <img src="/public/images/baobiao3.png">
                                         <div class="position-absolute fixed-top" id="sign-show" style="left:290px;top:320px">
-                                            <% if (!accountData.sign_path) { %>
+                                            <% if (accountData.sign_path !== '') { %>
                                                 <img src="/public/upload/sign/<%= accountData.sign_path %>" width="90">
                                             <% } %>
                                         </div>
                                         <div class="position-absolute fixed-top" id="stamp-show" style="left:300px;top:260px">
-                                            <% if (!accountData.stamp_path) { %>
+                                            <% if (accountData.stamp_path) { %>
                                                 <img src="<%- fujianOssPath + accountData.stamp_path %>" width="90">
                                             <% } %>
                                         </div>

+ 2 - 2
app/view/setting/user_permission.ejs

@@ -33,9 +33,9 @@
                         <div class="row">
                             <div class="col-3">
                                 <div class="list-group">
-                                    <a href="/setting/user?company=" class="list-group-item list-group-item-action <% if (!company) { %>active<% } %>">全部</a>
+                                    <a href="/setting/user/permission/set?company=" class="list-group-item list-group-item-action <% if (!company) { %>active<% } %>">全部</a>
                                     <% for (const u of unitList) { %>
-                                        <a href="/setting/user?company=<%- u.name %>" class="list-group-item list-group-item-action <% if (company === u.name) { %>active<% } %>"><%- u.name %></a>
+                                        <a href="/setting/user/permission/set?company=<%- u.name %>" class="list-group-item list-group-item-action <% if (company === u.name) { %>active<% } %>"><%- u.name %></a>
                                     <% } %>
                                 </div>
                             </div>