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 cellId = 9060; // this figure is for testing use
|
||||
let copiedRowHolder: any;
|
||||
let orderHeadTags = [
|
||||
let copiedRemaingForm: any[] = [];
|
||||
const orderHeadTags = [
|
||||
'${订单号}',
|
||||
'${客户名}',
|
||||
'${出售日期}',
|
||||
@ -102,8 +103,8 @@ let orderHeadTags = [
|
||||
'${送货地址}',
|
||||
'${订单备注}',
|
||||
];
|
||||
let banCaiHeadTags = ['${板材材料}', '${板材颜色}'];
|
||||
let banCaiBodyTags = [
|
||||
const banCaiHeadTags = ['${板材材料}', '${板材颜色}'];
|
||||
const banCaiBodyTags = [
|
||||
'${板材房名}',
|
||||
'${板材柜名}',
|
||||
'${板材号}',
|
||||
@ -371,12 +372,16 @@ export default Vue.extend({
|
||||
this.selectedCell = 0; // 如果selectedCell 不等于0 选择的cell 将不会被更新
|
||||
this.designTemplate = JSON.parse(JSON.stringify(this.infos)); // 复制设计好的表
|
||||
|
||||
Tool.addOrderDetails(this); // 添加表单头部信息
|
||||
|
||||
const copiedBanCaiTemplateRows = [];
|
||||
for (const board of data.boards) {
|
||||
copiedBanCaiTemplateRows.push(this.copyBanCaiTemplate());
|
||||
}
|
||||
const copiedRemaingForm = this.copyRemainingForm(); // 复制板材之外的剩余表格
|
||||
Tool.addOrderDetails(this); // 添加表单头部信息
|
||||
// 复制板材之外的剩余表格
|
||||
if (copiedRemaingForm.length === 0) {
|
||||
copiedRemaingForm = this.copyRemainingForm();
|
||||
}
|
||||
|
||||
if (this.hasBanCaiBodyTags()) {
|
||||
for (let i = 0; i < data.boards.length; i++) {
|
||||
|
@ -96,23 +96,33 @@ const tagsObject: any = {
|
||||
'${条纹}': 'stripe',
|
||||
'${板材备注}': 'boardAddOn',
|
||||
};
|
||||
const orderDetailsKeys: string[] = [];
|
||||
const banCaiHeaderKeys: string[] = [];
|
||||
const banCaiDetailsKeys: string[] = [];
|
||||
const orderDetailsKeys: string[] = [
|
||||
'orderNo',
|
||||
'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[] = [];
|
||||
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 = {
|
||||
addRow: (that: any, rowId: number) => {
|
||||
@ -288,14 +298,10 @@ const Tool = {
|
||||
}
|
||||
}
|
||||
},
|
||||
copyBanCaiBodyTemplate: (that) => {
|
||||
copyBanCaiBodyTemplate: (that: any) => {
|
||||
for (const row of that.infos) {
|
||||
for (const cell of row.cells) {
|
||||
if (
|
||||
Object.keys(data.boards[0].boardInfos[0]).indexOf(
|
||||
tagsObject[cell.title],
|
||||
) !== -1
|
||||
) {
|
||||
if (banCaiDetailsKeys.indexOf(tagsObject[cell.title]) !== -1) {
|
||||
return that.infos.indexOf(row);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user