fix re-import bug going to restruture...
This commit is contained in:
parent
e7027941eb
commit
afa11720ee
@ -93,7 +93,8 @@ import { hightlight } from '@/components/reportTemplate/rescource/hightlight';
|
|||||||
let rowId = 30; // this figure is for testing use
|
let rowId = 30; // this figure is for testing use
|
||||||
let cellId = 9060; // this figure is for testing use
|
let cellId = 9060; // this figure is for testing use
|
||||||
let copiedRowHolder: any;
|
let copiedRowHolder: any;
|
||||||
let orderHeadTags = [
|
let copiedRemaingForm: any[] = [];
|
||||||
|
const orderHeadTags = [
|
||||||
'${订单号}',
|
'${订单号}',
|
||||||
'${客户名}',
|
'${客户名}',
|
||||||
'${出售日期}',
|
'${出售日期}',
|
||||||
@ -102,8 +103,8 @@ let orderHeadTags = [
|
|||||||
'${送货地址}',
|
'${送货地址}',
|
||||||
'${订单备注}',
|
'${订单备注}',
|
||||||
];
|
];
|
||||||
let banCaiHeadTags = ['${板材材料}', '${板材颜色}'];
|
const banCaiHeadTags = ['${板材材料}', '${板材颜色}'];
|
||||||
let banCaiBodyTags = [
|
const banCaiBodyTags = [
|
||||||
'${板材房名}',
|
'${板材房名}',
|
||||||
'${板材柜名}',
|
'${板材柜名}',
|
||||||
'${板材号}',
|
'${板材号}',
|
||||||
@ -371,12 +372,16 @@ export default Vue.extend({
|
|||||||
this.selectedCell = 0; // 如果selectedCell 不等于0 选择的cell 将不会被更新
|
this.selectedCell = 0; // 如果selectedCell 不等于0 选择的cell 将不会被更新
|
||||||
this.designTemplate = JSON.parse(JSON.stringify(this.infos)); // 复制设计好的表
|
this.designTemplate = JSON.parse(JSON.stringify(this.infos)); // 复制设计好的表
|
||||||
|
|
||||||
|
Tool.addOrderDetails(this); // 添加表单头部信息
|
||||||
|
|
||||||
const copiedBanCaiTemplateRows = [];
|
const copiedBanCaiTemplateRows = [];
|
||||||
for (const board of data.boards) {
|
for (const board of data.boards) {
|
||||||
copiedBanCaiTemplateRows.push(this.copyBanCaiTemplate());
|
copiedBanCaiTemplateRows.push(this.copyBanCaiTemplate());
|
||||||
}
|
}
|
||||||
const copiedRemaingForm = this.copyRemainingForm(); // 复制板材之外的剩余表格
|
// 复制板材之外的剩余表格
|
||||||
Tool.addOrderDetails(this); // 添加表单头部信息
|
if (copiedRemaingForm.length === 0) {
|
||||||
|
copiedRemaingForm = this.copyRemainingForm();
|
||||||
|
}
|
||||||
|
|
||||||
if (this.hasBanCaiBodyTags()) {
|
if (this.hasBanCaiBodyTags()) {
|
||||||
for (let i = 0; i < data.boards.length; i++) {
|
for (let i = 0; i < data.boards.length; i++) {
|
||||||
|
@ -96,23 +96,33 @@ const tagsObject: any = {
|
|||||||
'${条纹}': 'stripe',
|
'${条纹}': 'stripe',
|
||||||
'${板材备注}': 'boardAddOn',
|
'${板材备注}': 'boardAddOn',
|
||||||
};
|
};
|
||||||
const orderDetailsKeys: string[] = [];
|
const orderDetailsKeys: string[] = [
|
||||||
const banCaiHeaderKeys: string[] = [];
|
'orderNo',
|
||||||
const banCaiDetailsKeys: string[] = [];
|
'clientName',
|
||||||
|
'soldDate',
|
||||||
|
'contactName',
|
||||||
|
'contactNo',
|
||||||
|
'deliveryAddress',
|
||||||
|
'addOn',
|
||||||
|
];
|
||||||
|
const banCaiHeaderKeys: string[] = ['id', 'material', 'color'];
|
||||||
|
const banCaiDetailsKeys: string[] = [
|
||||||
|
'houseName',
|
||||||
|
'closetName',
|
||||||
|
'boardNo',
|
||||||
|
'boardName',
|
||||||
|
'length',
|
||||||
|
'width',
|
||||||
|
'thickness',
|
||||||
|
'quantity',
|
||||||
|
'area',
|
||||||
|
'mutation',
|
||||||
|
'shape',
|
||||||
|
'direction',
|
||||||
|
'stripe',
|
||||||
|
'boardAddOn',
|
||||||
|
];
|
||||||
const temRowHolder: string[] = [];
|
const temRowHolder: string[] = [];
|
||||||
for (const key in orderDetails) {
|
|
||||||
if (key !== 'boards') {
|
|
||||||
orderDetailsKeys.push(key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (const key in orderDetails.boards[0]) {
|
|
||||||
if (key !== 'boardInfos') {
|
|
||||||
banCaiHeaderKeys.push(key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (const key of Object.keys(orderDetails.boards[0].boardInfos[0])) {
|
|
||||||
banCaiDetailsKeys.push(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
const Tool = {
|
const Tool = {
|
||||||
addRow: (that: any, rowId: number) => {
|
addRow: (that: any, rowId: number) => {
|
||||||
@ -288,14 +298,10 @@ const Tool = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
copyBanCaiBodyTemplate: (that) => {
|
copyBanCaiBodyTemplate: (that: any) => {
|
||||||
for (const row of that.infos) {
|
for (const row of that.infos) {
|
||||||
for (const cell of row.cells) {
|
for (const cell of row.cells) {
|
||||||
if (
|
if (banCaiDetailsKeys.indexOf(tagsObject[cell.title]) !== -1) {
|
||||||
Object.keys(data.boards[0].boardInfos[0]).indexOf(
|
|
||||||
tagsObject[cell.title],
|
|
||||||
) !== -1
|
|
||||||
) {
|
|
||||||
return that.infos.indexOf(row);
|
return that.infos.indexOf(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user