Browse Source

支付审批,标段属性,新增付款账户

MaiXinRong 1 year ago
parent
commit
9c5c403060
5 changed files with 101 additions and 4 deletions
  1. 4 4
      app/const/spread.js
  2. 1 0
      app/const/tender_info.js
  3. 70 0
      app/public/js/payment_list.js
  4. 23 0
      app/view/payment/list_modal.ejs
  5. 3 0
      sql/update.sql

+ 4 - 4
app/const/spread.js

@@ -24,11 +24,11 @@ const withCl = {
     ledger: {
         cols: [
             {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 145, formatter: '@', cellType: 'tree'},
-            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 70, formatter: '@'},
-            {title: 'ex_memo1', colSpan: '1', rowSpan: '2', field: 'ex_memo1', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip'},
-            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@'},
+            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 70, formatter: '@',},
+            {title: 'ex_memo1', colSpan: '1', rowSpan: '2', field: 'ex_memo1', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip',},
+            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@', },
             {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 50, formatter: '@', cellType: 'unit'},
-            {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
+            {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number',},
             {title: '项目节数量|数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
             {title: '|数量2',  colSpan: '|1', rowSpan: '|1', field: 'dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
             {title: '经济指标',  colSpan: '1', rowSpan: '2', field: 'dgn_price', hAlign: 2, width: 60, type: 'Number', readOnly: true},

+ 1 - 0
app/const/tender_info.js

@@ -206,6 +206,7 @@ const paymentDefaultInfo = (function () {
     result.deal_info = JSON.parse(JSON.stringify(defaultInfo.deal_info));
     result.construction_unit = JSON.parse(JSON.stringify(defaultInfo.construction_unit));
     result.tech_param = JSON.parse(JSON.stringify(defaultInfo.tech_param));
+    result.pay_account = JSON.parse(JSON.stringify(defaultInfo.pay_account));
 
     return result;
 })(defaultInfo);

+ 70 - 0
app/public/js/payment_list.js

@@ -418,6 +418,7 @@ $(function () {
                     property.deal_info = result.tender_info.deal_info;
                     property.construction_unit = result.tender_info.construction_unit;
                     property.tech_param = result.tender_info.tech_param;
+                    property.pay_account = result.tender_info.pay_account;
                     loadCommonProperty(property);
                     $('#sync-attr').modal('hide');
                 });
@@ -505,9 +506,57 @@ function loadCommonProperty () {
     $('#real-start-date').val(property.tech_param.realStartDate);
     $('#real-end-date').val(property.tech_param.realEndDate);
     $('#structure-scale').val(property.tech_param.structureScale);
+
+    // 付款账号
+    $('#project-name').val(property.pay_account.project.name);
+    $('#project-bank').val(property.pay_account.project.bank);
+    $('#project-account').val(property.pay_account.project.account);
+    $('#project-rate').val(property.pay_account.project.rate);
+    $('#project-contact').val(property.pay_account.project.contact);
+    $('#project-phone').val(property.pay_account.project.phone);
+    $('#project-num').val(property.pay_account.project.num);
+
+    $('#worker-name').val(property.pay_account.worker.name);
+    $('#worker-bank').val(property.pay_account.worker.bank);
+    $('#worker-account').val(property.pay_account.worker.account);
+    $('#worker-rate').val(property.pay_account.worker.rate);
+    $('#worker-contact').val(property.pay_account.worker.contact);
+    $('#worker-phone').val(property.pay_account.worker.phone);
+    $('#worker-num').val(property.pay_account.worker.num);
 }
 
 function postAttr () {
+    let flag = false;
+    const rate_reg = /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2}))|)$/;
+    const phone_reg = /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/;
+
+    const project_rate = $('#project-rate').val();
+    if (!rate_reg.test(project_rate) && project_rate !== '') {
+        toastr.error('工程款账户分账划拨比例数字格式有误且最多保留2位小数');
+        flag = true;
+    }
+
+    const project_phone = $('#project-phone').val();
+    if (!phone_reg.test(project_phone) && project_phone !== '') {
+        toastr.error('工程款账户联系电话格式有误');
+        flag = true;
+    }
+
+    const worker_rate = $('#worker-rate').val();
+    if (!rate_reg.test(worker_rate) && worker_rate !== '') {
+        toastr.error('农民工工资专用账户分账划拨比例数字格式有误且最多保留2位小数');
+        flag = true;
+    }
+
+    const worker_phone = $('#worker-phone').val();
+    if (!phone_reg.test(worker_phone) && worker_phone !== '') {
+        toastr.error('农民工工资专用账户联系电话格式有误');
+        flag = true;
+    }
+    if (flag) {
+        return false;
+    }
+
     const info = {
         deal_info: {
             buildName: $('#build-name').val(),
@@ -563,12 +612,33 @@ function postAttr () {
             realEndDate: $('#real-end-date').val(),
             structureScale: $('#structure-scale').val(),
         },
+        pay_account: {
+            project: {
+                name: $('#project-name').val(),
+                bank: $('#project-bank').val(),
+                account: $('#project-account').val(),
+                rate: $('#project-rate').val(),
+                contact: $('#project-contact').val(),
+                phone: $('#project-phone').val(),
+                num: $('#project-num').val(),
+            },
+            worker: {
+                name: $('#worker-name').val(),
+                bank: $('#worker-bank').val(),
+                account: $('#worker-account').val(),
+                rate: $('#worker-rate').val(),
+                contact: $('#worker-contact').val(),
+                phone: $('#worker-phone').val(),
+                num: $('#worker-num').val(),
+            },
+        },
     };
     const tenderId = window.location.pathname.split('/')[2];
     postData('/payment/info/save', { type: 'info', postData: { id: tenderId, info} }, function (data) {
         property.deal_info = info.deal_info;
         property.construction_unit = info.construction_unit;
         property.tech_param = info.tech_param;
+        property.pay_account = info.pay_account;
         $('#bd-attr').modal('hide');
     });
 }

+ 23 - 0
app/view/payment/list_modal.ejs

@@ -228,6 +228,9 @@
                         <li class="nav-item">
                             <a class="nav-link" data-toggle="tab" href="#jscs" role="tab">技术参数</a>
                         </li>
+                        <li class="nav-item">
+                            <a class="nav-link" data-toggle="tab" href="#fkzh" role="tab">付款账号</a>
+                        </li>
                     </ul>
                     <div class="tab-content">
                         <div class="tab-pane active" id="htxx">
@@ -576,6 +579,26 @@
                                 </div>
                             </div>
                         </div>
+                        <div class="tab-pane" id="fkzh">
+                            <table class="table table-bordered">
+                                <tr><th colspan="2" class="text-center">工程款账户</th></tr>
+                                <tr><td>开户名称</td><td><input type="text" id="project-name" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
+                                <tr><td>开户银行</td><td><input type="text" id="project-bank" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
+                                <tr><td>开户账号</td><td><input type="text" id="project-account" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
+                                <tr><td>分账划拨比例(%)</td><td><input type="text" id="project-rate" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
+                                <tr><td>联系人</td><td><input type="text" id="project-contact" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
+                                <tr><td>联系电话</td><td><input type="text" id="project-phone" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
+                                <tr><td>行号</td><td><input type="text" id="project-num" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
+                                <tr><th colspan="2" class="text-center">农民工工资专用账户</th></tr>
+                                <tr><td>开户名称</td><td><input type="text" id="worker-name" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
+                                <tr><td>开户银行</td><td><input type="text" id="worker-bank" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
+                                <tr><td>开户账号</td><td><input type="text" id="worker-account" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
+                                <tr><td>分账划拨比例(%)</td><td><input type="text" id="worker-rate" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
+                                <tr><td>联系人</td><td><input type="text" id="worker-contact" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
+                                <tr><td>联系电话</td><td><input type="text" id="worker-phone" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
+                                <tr><td>行号</td><td><input type="text" id="worker-num" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
+                            </table>
+                        </div>
                     </div>
                 </div>
             </div>

+ 3 - 0
sql/update.sql

@@ -10,3 +10,6 @@ ADD COLUMN `audit_order`  tinyint(4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0 COMMEN
 ALTER TABLE `zh_stage_audit`
 ADD COLUMN `audit_type`  tinyint(4) UNSIGNED NOT NULL DEFAULT 1 COMMENT '审批类型(1个人,2会签,3或签)' AFTER `is_old`,
 ADD COLUMN `audit_order`  tinyint(4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0 COMMENT '审批顺序' AFTER `audit_type`;
+
+ALTER TABLE `zh_payment_tender_info`
+ADD COLUMN `pay_account`  varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '付款账号' AFTER `tech_param`;