浏览代码

概算控制,调整

MaiXinRong 3 年之前
父节点
当前提交
5a2e8b30f0
共有 3 个文件被更改,包括 12 次插入7 次删除
  1. 9 5
      app/public/js/budget_detail.js
  2. 2 1
      app/public/js/budget_list.js
  3. 1 1
      sql/update.sql

+ 9 - 5
app/public/js/budget_detail.js

@@ -35,8 +35,9 @@ function limitDecimal(obj) {
 }
 
 const invalidFields = {
-    parent: ['total_price', 'unit_price'],
+    parent: ['quantity', 'total_price', 'unit_price'],
     gcl: ['dgn_qty1', 'dgn_qty2', 'total_price'],
+    xmj: ['quantity', 'unit_price'],
 };
 $(document).ready(() => {
     const copyBlockTag = 'zh.calc.copyBlock';
@@ -287,14 +288,12 @@ $(document).ready(() => {
             }
             switch (col.field) {
                 case 'unit_price':
+                case 'quantity':
                     info.cancel = (node.children && node.children.length > 0) || !node.b_code;
                     break;
                 case 'total_price':
                     info.cancel = (node.children && node.children.length > 0) || node.b_code;
                     break;
-                case 'quantity':
-                    info.cancel = (node.children && node.children.length > 0);
-                    break;
                 case 'dgn_price':
                     info.cance = false;
                     break;
@@ -362,7 +361,8 @@ $(document).ready(() => {
             const hint = {
                 invalidNum: {type: 'warning', msg: '粘贴的数字非法'},
                 parent: {type: 'warning', msg: `含有子项,不可粘贴${needGcl ? '数量、单价、' : ''}金额`},
-                gcl: {type: 'warning', msg: '工程量清单,不可粘贴项目节数量、金额'}
+                gcl: {type: 'warning', msg: '工程量清单,不可粘贴项目节数量、金额'},
+                xmj: {type: 'warning', msg: '项目节,不可粘贴数量、单价'},
             };
             const datas = [], filterNodes = [];
 
@@ -386,6 +386,10 @@ $(document).ready(() => {
                         toastMessageUniq(hint.gcl);
                         continue;
                     }
+                    if (_.isEmpty(node.b_code) && invalidFields.xmj.indexOf(colSetting.field) >= 0) {
+                        toastMessageUniq(hint.xmj);
+                        continue;
+                    }
 
                     if (colSetting.type === 'Number') {
                         if (colSetting.type === 'Number') {

+ 2 - 1
app/public/js/budget_list.js

@@ -78,6 +78,7 @@ $(document).ready(() => {
         }
     });
     $('#select-rela').on('show.bs.modal', () => {
+        $('#sr-select-all')[0].checked = false;
         $('#valid-rela-tender').html('');
         postData(`/budget/rela?id=${curBudget.id}`, {}, tenders => {
             const rela = curBudget.rela_tender ? curBudget.rela_tender.split(',') : [];
@@ -200,7 +201,7 @@ $(document).ready(() => {
     });
     $('#member').on('click', 'a[name="del-member"]', function () {
         const id = parseInt(this.getAttribute('uid'));
-        newMembers.splice(newMembers.findIndex(x => { return x.id === id}), 1);
+        newMembers.splice(newMembers.findIndex(x => { return x.uid === id}), 1);
         generateMemberHtml();
     });
     $('#member-ok').click(() => {

+ 1 - 1
sql/update.sql

@@ -146,7 +146,7 @@ ALTER TABLE `zh_change_audit_list` ADD `mx_id` VARCHAR(50) NULL DEFAULT NULL COM
 ALTER TABLE `zh_change_audit_list` CHANGE `gcl_id` `gcl_id` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '台账对应id(非准确)';
 
 -- 估概预标准
-INSERT INTO `calculation`.`zh_permission` (`id`, `name`, `controller`, `action`, `pid`, `icon_class`, `create_time`, `isshow`) VALUES ('72', '估概预标准', 'budget', 'all', '44', '', '0', '1');
+INSERT INTO `calculation`.`zh_permission` (`id`, `name`, `controller`, `action`, `pid`, `icon_class`, `create_time`, `isshow`) VALUES ('72', '估概预标准', 'budget', 'all', '44', '', '12', '1');
 
 ALTER TABLE `zh_project`
 ADD COLUMN `budget`  varchar(100) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '' COMMENT '估概预标准-id列表(\',\'分隔)' AFTER `valuation`;