Browse Source

JSON.parse兼容转义字符等

MaiXinRong 4 years ago
parent
commit
04bd5171aa

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

@@ -119,5 +119,5 @@
     const materialType = JSON.parse('<%- JSON.stringify(materialType) %>');
     const ex_calc = JSON.parse('<%- JSON.stringify(ex_calc) %>');
     let ex_expr = '<%- material.ex_expr %>';
-    let materialExponentData = JSON.parse('<%- JSON.stringify(materialExponentData) %>');
+    let materialExponentData = JSON.parse(unescape('<%- escape(JSON.stringify(materialExponentData)) %>'));
 </script>

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

@@ -108,7 +108,7 @@
 <!--<script src="/public/js/jquery-ui/datepicker-zh-CN.js"></script>-->
 <script>
     const materialType = JSON.parse('<%- materialType %>');
-    let materialBillsData = JSON.parse('<%- JSON.stringify(materialBillsData) %>');
+    let materialBillsData = JSON.parse(unescape('<%- escape(JSON.stringify(materialBillsData)) %>'));
     const materialListData = JSON.parse('<%- JSON.stringify(materialListData) %>');
     const readOnly = <%- material.readOnly %>;
     const materialID = <%- material.id %>;

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

@@ -63,7 +63,7 @@
 </div>
 <script>
     const materialType = JSON.parse('<%- materialType %>');
-    const materialBillsData = JSON.parse('<%- JSON.stringify(materialBillsData) %>');
+    const materialBillsData = JSON.parse(unescape('<%- escape(JSON.stringify(materialBillsData)) %>'));
     let materialListData = JSON.parse('<%- JSON.stringify(materialListData) %>');
     const notJoinList = JSON.parse('<%- JSON.stringify(materialNotJoinListData) %>');
     const ledger = JSON.parse('<%- JSON.stringify(ledger) %>');

+ 1 - 1
app/view/stage/index.ejs

@@ -591,7 +591,7 @@
         colWidth: true,
     }
     const tender = JSON.parse('<%- JSON.stringify(tender) %>');
-    const tenderInfo = JSON.parse('<%- JSON.stringify(ctx.tender.info) %>');
+    const tenderInfo = JSON.parse(unescape('<%- escape(JSON.stringify(ctx.tender.info)) %>'));
     const thousandth = <%- ctx.tender.info.display.thousandth %>;
     const measureType = JSON.parse('<%- JSON.stringify(measureType) %>');
     const stage = JSON.parse('<%- JSON.stringify(ctx.stage) %>');

+ 1 - 1
app/view/stage/pay.ejs

@@ -59,7 +59,7 @@
     const tender = JSON.parse('<%- JSON.stringify(tender) %>');
     const stage = JSON.parse('<%- JSON.stringify(ctx.stage) %>');
     const readOnly = <%- stage.readOnly || stage.revising %>;
-    const dealPay = JSON.parse('<%- JSON.stringify(dealPay) %>');
+    const dealPay = JSON.parse(unescape('<%- escape(JSON.stringify(dealPay)) %>'));
     const calcBase = JSON.parse('<%- JSON.stringify(calcBase) %>');
     const decimal = JSON.parse('<%- JSON.stringify(ctx.tender.info.decimal) %>');
     const thousandth = <%- ctx.tender.info.display.thousandth %>;

+ 4 - 0
sql/update.sql

@@ -5,3 +5,7 @@ ALTER TABLE `zh_tender_info` ADD `shenpi` VARCHAR(1000) CHARACTER SET utf8 COLLA
 
 ALTER TABLE `zh_material_file`
 ADD COLUMN `extra_upload` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否是审核完成后上传的,0:否、1:是' AFTER `fileext`;
+
+ALTER TABLE `zh_pos`
+MODIFY COLUMN `gxby_status`  int(4) NULL DEFAULT -1 COMMENT '工序报验-状态' AFTER `real_qty`,
+MODIFY COLUMN `dagl_status`  int(4) NULL DEFAULT -1 COMMENT '档案管理-状态' AFTER `gxby_status`;