|
@@ -616,12 +616,16 @@ async function calcPriceIndex(libID, period, areaID, compilationID) {
|
|
|
return message;
|
|
|
}
|
|
|
|
|
|
-async function exportExcelData(libID) {
|
|
|
- const priceItems = await priceInfoItemModel.find({ libID }).lean();
|
|
|
+async function exportExcelData(libID, areaName) {
|
|
|
+ const area = await priceInfoAreaModel.findOne({ name: areaName }).lean();
|
|
|
+ if (!area) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ const priceItems = await priceInfoItemModel.find({ libID, areaID: area.ID }).lean();
|
|
|
// 整理数据
|
|
|
let priceData = [];
|
|
|
for (const tmp of priceItems) {
|
|
|
- const item = [tmp.code || '', tmp.classCode || '', tmp.name || '', tmp.specs || '', tmp.unit || '', tmp.taxPrice || '', tmp.noTaxPrice || '', tmp.remark || '', tmp.expString || ''];
|
|
|
+ const item = [tmp.code || '', tmp.classCode || '', tmp.name || '', tmp.specs || '', tmp.unit || '', tmp.taxPrice || '', tmp.noTaxPrice || '', tmp.dateRemark || '', tmp.expString || ''];
|
|
|
priceData.push(item);
|
|
|
}
|
|
|
const excelData = [['主从对应码', '别名编码', '材料名称', '规格型号', '单位', '含税价(元)', '除税价(元)', '多价备注', '计算式']];
|