Explorar el Código

Merge branch 'master' of http://192.168.1.41:3000/maixinrong/Calculation

MaiXinRong hace 4 años
padre
commit
5b27325fa9
Se han modificado 3 ficheros con 30 adiciones y 7 borrados
  1. 1 2
      app/service/tender.js
  2. 17 2
      app/view/stage/audit_modal.ejs
  3. 12 3
      sql/update.sql

+ 1 - 2
app/service/tender.js

@@ -296,8 +296,6 @@ module.exports = app => {
                 await transaction.delete(this.ctx.service.materialBillsHistory.tableName, { tid: id });
                 await transaction.delete(this.ctx.service.materialList.tableName, { tid: id });
                 await transaction.delete(this.ctx.service.materialListNotjoin.tableName, { tid: id });
-                await transaction.delete(this.ctx.service.materialFile.tableName, { tid: id });
-
                 await transaction.delete(this.ctx.service.signatureUsed.tableName, { tender_id: id });
                 await transaction.delete(this.ctx.service.signatureRole.tableName, { tender_id: id });
                 // 先删除附件文件
@@ -306,6 +304,7 @@ module.exports = app => {
                 attList.concat(newAttList);
                 await this.ctx.helper.delFiles(attList);
                 await transaction.delete(this.ctx.service.changeAtt.tableName, { tid: id });
+                await transaction.delete(this.ctx.service.materialFile.tableName, { tid: id });
                 await transaction.commit();
                 return true;
             } catch (err) {

+ 17 - 2
app/view/stage/audit_modal.ejs

@@ -1595,10 +1595,25 @@
     });
     $('.modal').on('shown.bs.modal', function () {
         const height = $(this)[0].scrollHeight
-        const scrollBox = $(this).find('div[class="col-8 modal-height-500"]')
+        const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
+        const hdheight = hdiv ? hdiv.parents('.list-group-item').offset().top : 0;
+        const scrollBox = $(this).find('div[class="col-8 modal-height-500"]');
+        const bdiv = scrollBox.offset().top;
         // 450是modal没有滚动条时的最大高度,超过则出现滚动条,需要自动下拉到底部
-        if (scrollBox.length && scrollBox[0].scrollHeight > 450) {
+        // if (scrollBox.length && scrollBox[0].scrollHeight > 450) {
+        //     scrollBox.scrollTop(height);
+        // }
+        if (hdiv && hdheight - bdiv > 300) {
+            scrollBox.scrollTop(hdheight - bdiv);
+        } else if (scrollBox.length && scrollBox[0].scrollHeight > 450) {
             scrollBox.scrollTop(height);
         }
     });
+
+    function divSearch(div) {
+        if (div.length > 0) {
+            return true;
+        }
+        return false;
+    }
 </script>

+ 12 - 3
sql/update.sql

@@ -100,9 +100,18 @@ ALTER TABLE `zh_project_account` ADD `wx_type` TEXT NULL DEFAULT NULL COMMENT '
 ALTER TABLE `zh_rpt_custom_define`
 ADD COLUMN `stage_select`  text CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL COMMENT '用户定制信息 - 多期汇总表' AFTER `gather_select`;
 
-ALTER TABLE `calculation`.`zh_material_file`
-ADD COLUMN `s_order` VARCHAR(255) NOT NULL  COMMENT '期数order' AFTER `file_name`;
-
 -- ----------------------------
 -- 以上于2020-7-23 15:00 因测试需求更新至uat,尚未更新prod,如需增加sql,请一定在其后添加
 -- ----------------------------
+CREATE TABLE `zh_material_file` (
+  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
+  `tid` int(11) NOT NULL COMMENT '标段id',
+  `user_id` int(11) NOT NULL COMMENT '用户id',
+  `mid` int(11) NOT NULL COMMENT '期id',
+  `upload_time` varchar(45) COLLATE utf8_unicode_ci NOT NULL COMMENT '上传时间',
+  `filepath` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件存储路径',
+  `file_size` varchar(45) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件大小',
+  `file_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件名',
+  `s_order` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '期数order',
+  PRIMARY KEY (`id`)
+)COMMENT = '调差附件表';