Browse Source

定额库导入导出内部数据更新显示名称

zhongzewei 6 years ago
parent
commit
d2185865bf

+ 6 - 4
modules/ration_repository/models/ration_item.js

@@ -915,17 +915,17 @@ rationItemDAO.prototype.exportExcelData = async function(rationRepId) {
         rationRepId: rationRepId
     };
     // @todo 限制导出的数量以防内存溢出
-    const rationDataList = await this.getRationItemByCondition(condition, ['name', 'code', 'ID', 'sectionId', 'feeType']);
+    const rationDataList = await this.getRationItemByCondition(condition, ['name', 'code', 'ID', 'sectionId', 'feeType', 'caption']);
 
     // 整理数据
     let rationData = [];
     for (const tmp of rationDataList) {
         const sectionId = tmp.sectionId <= 0 || tmp.sectionId === undefined ? null : tmp.sectionId;
         const feeType = tmp.feeType === '' || tmp.feeType === undefined ? null : tmp.feeType;
-        const ration = [sectionId, feeType, tmp.ID, tmp.code, tmp.name];
+        const ration = [sectionId, feeType, tmp.ID, tmp.code, tmp.name, tmp.caption];
         rationData.push(ration);
     }
-    const excelData = [['树ID', '取费专业', '定额ID', '定额编码', '定额名']];
+    const excelData = [['树ID', '取费专业', '定额ID', '定额编码', '定额名', '定额显示名称']];
     excelData.push.apply(excelData, rationData);
 
     return excelData;
@@ -953,10 +953,12 @@ rationItemDAO.prototype.batchUpdateSectionIdFromExcel = async function(data) {
         feeType = isNaN(feeType) || feeType <= 0 ? null : feeType;
         let name = tmp[4];
         name = name ? name : '';
+        let caption = tmp[5];
+        caption = caption ? caption : '';
         if (sectionId <= 0 || rationId <= 0) {
             continue;
         }
-        bulkOprs.push({updateOne: {filter: {ID: rationId}, update: {$set: {sectionId: sectionId, feeType: feeType, name: name, caption: name}}}});
+        bulkOprs.push({updateOne: {filter: {ID: rationId}, update: {$set: {sectionId: sectionId, feeType: feeType, name: name, caption: caption}}}});
     }
     if(bulkOprs.length <= 0){
         throw '无有效数据(树ID、定额ID不为空、且为数值)';

+ 270 - 0
web/over_write/js/gansu_2013.js

@@ -0,0 +1,270 @@
+'use strict';
+
+/**
+ *
+ *
+ * @author Zhong
+ * @date 2018/8/31
+ * @version
+ */
+
+/*
+* 费用定额下priceProperties为空,则单位工程中取价取basePrice字段
+* 费用定额下consumeAmtProperties为空,则单位工程中取消耗量取consumeAmt字段
+* */
+
+//计税方式
+const taxModel = {'common': 1, 'simple': 2};
+//兰州 定西 天水 平凉 庆阳 武威 金昌 张掖 酒泉 甘矿 嘉峪关 临夏 合作 武都 白银
+//价格属性-地区+计税方式
+const pricePropertiesTemplate = [
+    {
+        region: '兰州',
+        taxModel: taxModel.common,
+        price: {
+            dataCode: 'price1',
+            dataName: '兰州单价-一般'
+        }
+    },
+    {
+        region: '兰州',
+        taxModel: taxModel.simple,
+        price: {
+            dataCode: 'price2',
+            dataName: '兰州单价-简易'
+        }
+    },
+    {
+        region: '定西',
+        taxModel: taxModel.common,
+        price: {
+            dataCode: 'price3',
+            dataName: '定西单价-一般'
+        }
+    },
+    {
+        region: '定西',
+        taxModel: taxModel.simple,
+        price: {
+            dataCode: 'price4',
+            dataName: '定西单价-简易'
+        }
+    },
+    {
+        region: '天水',
+        taxModel: taxModel.common,
+        price: {
+            dataCode: 'price5',
+            dataName: '天水单价-一般'
+        }
+    },
+    {
+        region: '天水',
+        taxModel: taxModel.simple,
+        price: {
+            dataCode: 'price6',
+            dataName: '天水单价-简易'
+        }
+    },
+    {
+        region: '平凉',
+        taxModel: taxModel.common,
+        price: {
+            dataCode: 'price7',
+            dataName: '平凉单价-一般'
+        }
+    },
+    {
+        region: '平凉',
+        taxModel: taxModel.simple,
+        price: {
+            dataCode: 'price8',
+            dataName: '平凉单价-简易'
+        }
+    },
+    {
+        region: '庆阳',
+        taxModel: taxModel.common,
+        price: {
+            dataCode: 'price9',
+            dataName: '庆阳单价-一般'
+        }
+    },
+    {
+        region: '庆阳',
+        taxModel: taxModel.simple,
+        price: {
+            dataCode: 'price10',
+            dataName: '庆阳单价-简易'
+        }
+    },
+    {
+        region: '武威',
+        taxModel: taxModel.common,
+        price: {
+            dataCode: 'price11',
+            dataName: '武威单价-一般'
+        }
+    },
+    {
+        region: '武威',
+        taxModel: taxModel.simple,
+        price: {
+            dataCode: 'price12',
+            dataName: '武威单价-简易'
+        }
+    },
+    {
+        region: '金昌',
+        taxModel: taxModel.common,
+        price: {
+            dataCode: 'price13',
+            dataName: '金昌单价-一般'
+        }
+    },
+    {
+        region: '金昌',
+        taxModel: taxModel.simple,
+        price: {
+            dataCode: 'price14',
+            dataName: '金昌单价-简易'
+        }
+    },
+    {
+        region: '张掖',
+        taxModel: taxModel.common,
+        price: {
+            dataCode: 'price15',
+            dataName: '张掖单价-一般'
+        }
+    },
+    {
+        region: '张掖',
+        taxModel: taxModel.simple,
+        price: {
+            dataCode: 'price16',
+            dataName: '张掖单价-简易'
+        }
+    },
+    {
+        region: '酒泉',
+        taxModel: taxModel.common,
+        price: {
+            dataCode: 'Price17',
+            dataName: '酒泉单价-一般'
+        }
+    },
+    {
+        region: '酒泉',
+        taxModel: taxModel.simple,
+        price: {
+            dataCode: 'price18',
+            dataName: '酒泉单价-简易'
+        }
+    },
+    {
+        region: '甘矿',
+        taxModel: taxModel.common,
+        price: {
+            dataCode: 'price19',
+            dataName: '甘矿单价-一般'
+        }
+    },
+    {
+        region: '甘矿',
+        taxModel: taxModel.simple,
+        price: {
+            dataCode: 'price20',
+            dataName: '甘矿单价-简易'
+        }
+    },
+    {
+        region: '嘉峪关',
+        taxModel: taxModel.common,
+        price: {
+            dataCode: 'price21',
+            dataName: '嘉峪关单价-一般'
+        }
+    },
+    {
+        region: '嘉峪关',
+        taxModel: taxModel.simple,
+        price: {
+            dataCode: 'price22',
+            dataName: '嘉峪关单价-简易'
+        }
+    },
+    {
+        region: '临夏',
+        taxModel: taxModel.common,
+        price: {
+            dataCode: 'price23',
+            dataName: '临夏单价-一般'
+        }
+    },
+    {
+        region: '临夏',
+        taxModel: taxModel.simple,
+        price: {
+            dataCode: 'price24',
+            dataName: '临夏单价-简易'
+        }
+    },
+    {
+        region: '合作',
+        taxModel: taxModel.common,
+        price: {
+            dataCode: 'price25',
+            dataName: '合作单价-一般'
+        }
+    },
+    {
+        region: '合作',
+        taxModel: taxModel.simple,
+        price: {
+            dataCode: 'price26',
+            dataName: '合作单价-简易'
+        }
+    },
+    {
+        region: '武都',
+        taxModel: taxModel.common,
+        price: {
+            dataCode: 'price27',
+            dataName: '武都单价-一般'
+        }
+    },
+    {
+        region: '武都',
+        taxModel: taxModel.simple,
+        price: {
+            dataCode: 'price28',
+            dataName: '武都单价-简易'
+        }
+    },
+    {
+        region: '白银',
+        taxModel: taxModel.common,
+        price: {
+            dataCode: 'price29',
+            dataName: '白银单价-一般'
+        }
+    },
+    {
+        region: '白银',
+        taxModel: taxModel.simple,
+        price: {
+            dataCode: 'price30',
+            dataName: '白银单价-简易'
+        }
+    },
+];
+
+const consumeAmtPropertiesTemplate = [];
+
+if(typeof module !== 'undefined'){
+    module.exports = {
+        pricePropertiesTemplate: pricePropertiesTemplate,
+        consumeAmtPropertiesTemplate: consumeAmtPropertiesTemplate
+    };
+}

+ 60 - 0
web/over_write/js/jiangxi_2017.js

@@ -0,0 +1,60 @@
+'use strict';
+
+/**
+ *
+ *
+ * @author Zhong
+ * @date 2018/8/31
+ * @version
+ */
+
+//计税方式
+const taxModel = {'common': 1, 'simple': 2};
+//价格属性:计税方式
+const pricePropertiesTemplate = [
+    {
+        region: '全省',
+        taxModel: taxModel.common,
+        price: {
+            dataCode: 'price1',
+            dataName: '单价-一般'
+        }
+    },
+    {
+        region: '全省',
+        taxModel: taxModel.simple,
+        price: {
+            dataCode: 'price2',
+            dataName: '单价-简易'
+        }
+    }
+];
+
+//消耗量属性:计税方式
+const consumeAmtPropertiesTemplate = [
+    {
+        region: '全省',
+        taxModel: taxModel.common,
+        consumeAmt: {
+            dataCode: 'consumeAmt1',
+            dataName: '消耗量-一般',
+            refPrice: 'price1' //关联的单价字段
+        }
+    },
+    {
+        region: '全省',
+        taxModel: taxModel.simple,
+        consumeAmt: {
+            dataCode: 'consumeAmt2',
+            dataName: '消耗量-简易',
+            refPrice: 'price2' //关联的单价字段
+        }
+    }
+];
+
+if(typeof module !== 'undefined'){
+    module.exports = {
+        pricePropertiesTemplate: pricePropertiesTemplate,
+        consumeAmtPropertiesTemplate: consumeAmtPropertiesTemplate
+    };
+}