Browse Source

资料模板库,归档单位

MaiXinRong 1 month ago
parent
commit
99053bc0d8
3 changed files with 13 additions and 4 deletions
  1. 4 1
      app/public/js/filing_template.js
  2. 3 3
      app/service/filing_template.js
  3. 6 0
      sql/update.sql

+ 4 - 1
app/public/js/filing_template.js

@@ -289,6 +289,7 @@ $(document).ready(function() {
                 cols: [
                     { title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 250, formatter: '@', readOnly: true, cellType: 'tree' },
                     { title: '固定', colSpan: '1', rowSpan: '1', field: 'is_fixed', hAlign: 1, width: 50, cellType: 'checkbox' },
+                    { title: '归档单位', colSpan: '1', rowSpan: '1', field: 'file_company', hAlign: 0, width: 80, formatter: '@' },
                     { title: '提示', colSpan: '1', rowSpan: '1', field: 'tips', hAlign: 0, width: 280, formatter: '@', wordWrap: 1 },
                 ],
                 emptyRows: 0,
@@ -387,7 +388,7 @@ $(document).ready(function() {
                         if (!fixedParent) throw `【${node.name}】查询不到固定信息`;
                         filing_type = fixedParent.source_filing_type;
                     }
-                    data.push({ id: node.id, is_fixed: node.is_fixed, filing_type, tree_order: i + 1, tips: node.tips || '' });
+                    data.push({ id: node.id, is_fixed: node.is_fixed, filing_type, tree_order: i + 1, tips: node.tips || '', file_company: node.file_company || '' });
                     if (node.children) getUpdateData(node.children);
                 }
             };
@@ -410,6 +411,7 @@ $(document).ready(function() {
                     name: node.name,
                     is_fixed: node.is_fixed,
                     filing_type: node.filing_type,
+                    file_company: node.file_company,
                     tips: node.tips,
                 });
             }
@@ -431,6 +433,7 @@ $(document).ready(function() {
                 name: node.name,
                 is_fixed: node.is_fixed,
                 filing_type: node.filing_type,
+                file_company: node.file_company,
                 tips: node.tips,
             }});
             const blob = new Blob([JSON.stringify(exportData, '', '')], { type: 'application/text'});

+ 3 - 3
app/service/filing_template.js

@@ -63,7 +63,7 @@ module.exports = app => {
                 insertData.push({
                     id: this.uuid.v4(), temp_id: templateId, add_user_id: this.ctx.session.sessionUser.accountId,
                     tree_pid: parent ? parent.id : rootId, tree_level: parent ? parent.tree_level + 1 : 1, tree_order: d.tree_order,
-                    name: d.name, tips: d.tips, filing_type: d.filing_type, is_fixed: parent ? d.is_fixed : 1, org_id: d.id,
+                    name: d.name, file_company: d.file_company, tips: d.tips, filing_type: d.filing_type, is_fixed: parent ? d.is_fixed : 1, org_id: d.id,
                 });
             }
             insertData.forEach(x => { delete x.org_id; });
@@ -256,7 +256,7 @@ module.exports = app => {
                 insertData.push({
                     id: this.uuid.v4(), temp_id: templateId, add_user_id: this.ctx.session.sessionUser.accountId,
                     tree_pid: parent ? parent.id : rootId, tree_level: parent ? parent.tree_level + 1 : 1, tree_order: d.tree_order,
-                    name: d.name, tips: d.tips, filing_type: d.filing_type, is_fixed: parent ? d.is_fixed : 1, org_id: d.id,
+                    name: d.name, file_company: node.file_company, tips: d.tips, filing_type: d.filing_type, is_fixed: parent ? d.is_fixed : 1, org_id: d.id,
                 });
             }
             insertData.forEach(x => { delete x.org_id; });
@@ -278,7 +278,7 @@ module.exports = app => {
 
             const sourceData = await this.getData(templateId);
 
-            const validFields = ['id', 'is_fixed', 'name', 'filing_type', 'tree_order', 'tips'];
+            const validFields = ['id', 'is_fixed', 'name', 'filing_type', 'tree_order', 'tips', 'file_company'];
             const updateData = [];
             for (const d of data) {
                 if (!d.id) throw '提交数据格式错误';

+ 6 - 0
sql/update.sql

@@ -13,6 +13,12 @@ ADD COLUMN `sign_permission` tinyint(1) NULL DEFAULT 1 COMMENT '授权所有人
 ALTER TABLE `zh_project_account`
 ADD COLUMN `unit_sign_path` mediumtext NULL COMMENT '单位章图片地址' AFTER `stamp_path`;
 
+ALTER TABLE `zh_filing`
+ADD COLUMN `file_company` varchar(100) NOT NULL DEFAULT '' COMMENT '归档单位' AFTER `tips`;
+
+ALTER TABLE `zh_filing_template`
+ADD COLUMN `file_company` varchar(100) NOT NULL DEFAULT '' COMMENT '归档单位' AFTER `tips`;
+
 ------------------------------------
 -- 表数据
 ------------------------------------