소스 검색

成本报审,合同明细,新增支付年月列,导入合同数据时写入

MaiXinRong 4 시간 전
부모
커밋
447a3d3691
3개의 변경된 파일7개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 0
      app/public/js/cost_stage_ledger.js
  2. 4 4
      app/service/cost_stage_detail.js
  3. 2 1
      sql/update.sql

+ 1 - 0
app/public/js/cost_stage_ledger.js

@@ -512,6 +512,7 @@ $(document).ready(function() {
                     {title: '合同编号', colSpan: '1', rowSpan: '1', field: 'code', hAlign: 0, width: 160, formatter: '@', readOnly: true},
                     {title: '合同名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 160, formatter: '@', readOnly: true},
                     {title: '乙方', colSpan: '1', rowSpan: '1', field: 'party_b', hAlign: 0, width: 150, formatter: '@', readOnly: true},
+                    {title: '支付年月', colSpan: '1', rowSpan: '1', field: 'pay_date', hAlign: 1, width: 120, formatter: '@', readOnly: true},
                     {title: '合同金额', colSpan: '1', rowSpan: '1', field: 'deal_tp', hAlign: 2, width: 80, type: 'Number', readOnly: true},
                     {title: '税率(%)', colSpan: '1', rowSpan: '1', field: 'tax', hAlign: 2, width: 80, type: 'Number', readOnly: true},
                     {title: '付款金额', colSpan: '1', rowSpan: '1', field: 'pay_tp', hAlign: 2, width: 80, type: 'Number', readOnly: true},

+ 4 - 4
app/service/cost_stage_detail.js

@@ -9,7 +9,7 @@
  */
 
 const costFields = {
-    textFields: ['code', 'name', 'party_b', 'postil', 'memo'],
+    textFields: ['code', 'name', 'party_b', 'pay_date', 'postil', 'memo'],
     curFields: ['pay_tp', 'cut_tp', 'yf_tp', 'sf_tp', 'yf_excl_tax_tp', 'sf_excl_tax_tp'],
     readFields: ['read_pay_tp', 'read_cut_tp', 'read_yf_tp', 'read_sf_tp', 'read_yf_excl_tax_tp', 'read_sf_excl_tax_tp'],
     taxFields: ['tax'],
@@ -291,7 +291,7 @@ module.exports = app => {
                         stage_order: this.ctx.costStage.stage_order, is_deal: 1,
                         ledger_id: ledgerId, cost_id: costId, d_order: insertDetails.length + 1, source_cid: pay.cid,
                         add_user_id: user_id, update_user_id: user_id,
-                        code: pay.c_code, name: pay.name, party_b: pay.party_b,
+                        code: pay.c_code, name: pay.name, party_b: pay.party_b, pay_date: months || '',
                     };
                     insertDetails.push(idetail);
                 }
@@ -328,8 +328,8 @@ module.exports = app => {
             return await this._importContractByIds(ledgerId, costId, contracts.map(x => { return x.id; }), months);
         }
         async importContract(data) {
-            if (data.types) return this._importContractByTypes(data.ledger_id, data.cost_id, data.types, data.months || [this.ctx.costStage.stage_date]);
-            if (data.ids) return this._importContractByIds(data.ledger_id, data.cost_id, data.ids, data.months || [this.ctx.costStage.stage_date]);
+            if (data.types) return this._importContractByTypes(data.ledger_id, data.cost_id, data.types, data.months || this.ctx.costStage.stage_date);
+            if (data.ids) return this._importContractByIds(data.ledger_id, data.cost_id, data.ids, data.months || this.ctx.costStage.stage_date);
         }
 
         async deletePartData(transaction, tender_id, ledger_id) {

+ 2 - 1
sql/update.sql

@@ -122,7 +122,7 @@ CREATE TABLE `zh_cost_stage_file`  (
   `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
   `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
   `is_deleted` tinyint(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否删除',
-  `is_add` tinyint(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否为审批完成后追加',
+  `extra_upload` tinyint(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否为审批完成后追加',
   PRIMARY KEY (`id`) USING BTREE
 ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;
 
@@ -184,6 +184,7 @@ CREATE TABLE `zh_cost_stage_detail`  (
   `code` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '编号',
   `name` varchar(255) CHARACTER SET utf16 NOT NULL DEFAULT '' COMMENT '名称',
   `party_b` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '乙方',
+  `pay_date` varchar(50) NOT NULL DEFAULT '' COMMENT '支付年月',
   `pre_pay_tp` decimal(24, 8) NOT NULL DEFAULT 0.00000000 COMMENT '截止上期-付款',
   `pre_cut_tp` decimal(24, 8) NOT NULL DEFAULT 0.00000000 COMMENT '截止上期-扣款',
   `pre_yf_tp` decimal(24, 8) NOT NULL DEFAULT 0.00000000 COMMENT '截止上期-应付',