瀏覽代碼

批量插入清单-计量单元,调整

maixinrong 5 年之前
父節點
當前提交
4593b3bddf

+ 7 - 4
app/controller/revise_controller.js

@@ -350,13 +350,16 @@ module.exports = app => {
                 const revise = await ctx.service.ledgerRevise.getLastestRevise(ctx.tender.id);
                 if (!revise) throw '台账修订数据有误';
 
-                const reviseBills = revise.bills_file
-                    ? JSON.parse(await fs.readFileSync(this.ctx.app.config.filePath + revise.bills_file, 'utf8'))
+                const billsFile = revise.bills_file ? this.ctx.app.config.filePath + revise.bills_file : undefined;
+                const reviseBills = billsFile && fs.existsSync(billsFile)
+                    ? JSON.parse(await fs.readFileSync(billsFile, 'utf8'))
                     : await ctx.service.reviseBills.getData(ctx.tender.id);
 
-                const revisePos = revise.pos_file
-                    ? JSON.parse(await fs.readFileSync(this.ctx.app.config.filePath + revise.pos_file, 'utf8'))
+                const posFile = revise.pos_file ? this.ctx.app.config.filePath + revise.pos_file : undefined;
+                const revisePos = posFile && fs.existsSync(posFile)
+                    ? JSON.parse(await fs.readFileSync(posFile, 'utf8'))
                     : await ctx.service.revisePos.getData(ctx.tender.id);
+
                 if (revise.uid === ctx.session.sessionUser.accountId &&
                     (revise.status === audit.revise.status.uncheck || revise.status === audit.revise.status.checkNo)) {                    
                     const lastStage = await ctx.service.stage.getLastestStage(ctx.tender.id, true);

File diff suppressed because it is too large
+ 565 - 491
app/public/css/main.css


+ 0 - 1
app/public/js/spreadjs_rela/spreadjs_zh.js

@@ -375,7 +375,6 @@ const SpreadJsObj = {
             }
 
             let font = sheet.getDefaultStyle().font;
-            console.log(font);
             if (col.font) {
                 font = col.font;
             }

+ 1 - 1
app/view/ledger/explode_modal.ejs

@@ -49,7 +49,7 @@
 </div>
 <!--批量添加清单部位-->
 <div class="modal fade" id="batch" data-backdrop="static">
-    <div class="modal-dialog modal-lg" role="document">
+    <div class="modal-dialog modal-xl" role="document" style="height: 700px">
         <div class="modal-content">
             <div class="modal-header">
                 <h5 class="modal-title">批量插入清单-计量单元</h5>

+ 1 - 1
app/view/revise/info_modal.ejs

@@ -1,6 +1,6 @@
 <!--批量添加清单部位-->
 <div class="modal fade" id="batch" data-backdrop="static">
-    <div class="modal-dialog modal-lg" role="document">
+    <div class="modal-dialog modal-xl" role="document">
         <div class="modal-content">
             <div class="modal-header">
                 <h5 class="modal-title">批量插入清单-计量单元</h5>

+ 8 - 4
config/config.default.js

@@ -1,6 +1,8 @@
 'use strict';
 
 const path = require('path');
+const fs = require('fs');
+
 module.exports = appInfo => {
     const config = {};
 
@@ -8,13 +10,13 @@ module.exports = appInfo => {
     config.mysql = {
         client: {
             // host
-            host: '127.0.0.1',
+            host: 'rm-wz9ae9t6qopwrday6.mysql.rds.aliyuncs.com',
             // 端口号
             port: '3306',
             // 用户名
             user: 'zh_calc',
             // 密码
-            password: 'zh@)!(3850calc',
+            password: 'Zh@)!(3850Calc',
             // 数据库名
             database: 'calculation',
         },
@@ -101,7 +103,7 @@ module.exports = appInfo => {
         app: true,
     };
 
-    config.filePath = '/etc/calc/files/';
+    config.filePath = '/etc/calc/files';
 
     // 上传设置
     config.multipart = {
@@ -118,7 +120,9 @@ module.exports = appInfo => {
     // 是否压缩替换前端js
     config.min = true;
 
-    config.version = '1.0.1';
+    const file = appInfo.baseDir + '/config/version';
+
+    config.version = fs.existsSync(file) ? fs.readFileSync(file, 'utf8') : '1.0.4';
 
     // 压缩设置
     config.gzip = {

+ 1 - 0
package.json

@@ -62,6 +62,7 @@
     "dev": "egg-bin dev --port 7002",
     "dev-local": "set EGG_SERVER_ENV=local&&egg-bin dev --port 7002",
     "dev-remoteqa": "set EGG_SERVER_ENV=remoteqa&&egg-bin dev --port 7002",
+    "dev-localpro": "set EGG_SERVER_ENV=localpro&&egg-bin dev --port 7002",
     "dev-temp": "set EGG_SERVER_ENV=temp&&egg-bin dev --port 7002",
     "dev-qa": "set EGG_SERVER_ENV=qa&&egg-bin dev --port 7002",
     "dev-test": "set EGG_SERVER_ENV=test&&egg-bin dev --port 7002",