From 70bea26fff699365e1cd72972cd9ae77b4d47918 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <963808678@qq.com>
Date: Wed, 18 Jan 2023 09:14:31 +0800
Subject: [PATCH] 1/18
---
src/views/main/DjyTenantConfig/addForm.vue | 4 +-
src/views/main/DjyTenantConfig/editForm.vue | 4 +-
src/views/main/PrintingNew/index.vue | 149 +++++++++++++++-----
src/views/main/VoyageBill/index.vue | 2 +-
4 files changed, 117 insertions(+), 42 deletions(-)
diff --git a/src/views/main/DjyTenantConfig/addForm.vue b/src/views/main/DjyTenantConfig/addForm.vue
index 95a041d..349a5b2 100644
--- a/src/views/main/DjyTenantConfig/addForm.vue
+++ b/src/views/main/DjyTenantConfig/addForm.vue
@@ -76,10 +76,10 @@ export default {
BookingOrderGetFieldName().then(res => {
let FieldNameList = []
- Object.keys(res.data[0]).forEach(item => {
+ Object.keys(res.data.order).forEach(item => {
FieldNameList.push({
code: item,
- name: res.data[0][item]
+ name: res.data.order[item]
})
})
this.FieldNameList = FieldNameList
diff --git a/src/views/main/DjyTenantConfig/editForm.vue b/src/views/main/DjyTenantConfig/editForm.vue
index 57198b3..dfa0dea 100644
--- a/src/views/main/DjyTenantConfig/editForm.vue
+++ b/src/views/main/DjyTenantConfig/editForm.vue
@@ -77,10 +77,10 @@ export default {
this.visible = true
BookingOrderGetFieldName().then(res => {
let FieldNameList = []
- Object.keys(res.data[0]).forEach(item => {
+ Object.keys(res.data.order).forEach(item => {
FieldNameList.push({
code: item,
- name: res.data[0][item]
+ name: res.data.order[item]
})
})
this.FieldNameList = FieldNameList
diff --git a/src/views/main/PrintingNew/index.vue b/src/views/main/PrintingNew/index.vue
index c0e1d88..de15f17 100644
--- a/src/views/main/PrintingNew/index.vue
+++ b/src/views/main/PrintingNew/index.vue
@@ -165,7 +165,7 @@
-
+
添加一行
@@ -184,28 +184,27 @@
:edit-config="{ trigger: 'click', mode: 'row', icon: 'vxe-icon-edit', showStatus: true }"
>
-
+
-
-
-
-
+
+
+
+
+
+
@@ -259,12 +258,11 @@ import addForm from './addForm.vue'
import editForm from './editForm.vue'
import columnSetting from '@/components/tableColumnSetting'
const columns = [
- // {
- // title: '类型',
- // align: 'center',
- // dataIndex: 'CateName'
- // },
-
+ {
+ title: '类型',
+ align: 'center',
+ dataIndex: 'CateName'
+ },
{
title: '租户名称',
align: 'center',
@@ -304,8 +302,15 @@ export default {
loadData: [],
ExcelPid: '',
fieldData: [],
+ fieldData1: [],
visible1: false,
- SysTenantData: []
+ SysTenantData: [],
+ fieldList: [
+ { code: 'order', name: '主单' },
+ { code: 'ctn', name: '箱信息' },
+ { code: 'edi', name: 'edi信息' },
+ { code: 'userinfo', name: '用户信息' }
+ ]
}
},
created() {
@@ -323,27 +328,57 @@ export default {
this.SysTenantData = res.data.rows
})
},
- focusEvent1() {
+ focusEvent1(row) {
this.visible1 = false
+ this.fieldData = []
+ let fieldData = []
+ Object.keys(this.data1).forEach(ele => {
+ this.fieldList.forEach(e => {
+ if (e.name == row.Ffield) {
+ if (ele == e.code) {
+ Object.keys(this.data1[ele]).forEach(item => {
+ fieldData.push({
+ code: item,
+ name: this.data1[ele][item]
+ })
+ })
+ }
+ }
+ })
+ })
+ this.fieldData = fieldData
+ this.fieldData1 = fieldData
setTimeout(() => {
this.visible1 = true
console.log('点击')
}, 200)
},
keyupEvent1(data) {
- this.fieldData = data.fieldName ? this.data1.filter(item => item.name.indexOf(data.fieldName) > -1) : this.data1
+ this.fieldData = data.fieldName
+ ? this.fieldData1.filter(item => item.name.indexOf(data.fieldName) > -1)
+ : this.fieldData1
},
selectEvent1(item, data) {
data.fieldName = item.name
data.field = item.code
this.visible1 = false
- this.fieldData = this.data1
+ this.fieldData = this.fieldData1
},
saveEvent() {
const $table = this.$refs.xTable
const { insertRecords, removeRecords, updateRecords } = $table.getRecordset()
- console.log(this.tableData, insertRecords, removeRecords)
- let children = [...this.tableData, ...insertRecords]
+ let tableData = []
+ this.tableData.forEach(item => {
+ this.fieldList.forEach(item2 => {
+ if (item.Ffield == item2.name) {
+ tableData.push({
+ ...item,
+ field: `${item2.code}.${item.field}`
+ })
+ }
+ })
+ })
+ let children = [...tableData, ...insertRecords]
if (removeRecords.length) {
children.forEach((item, index) => {
removeRecords.forEach(ele => {
@@ -375,16 +410,39 @@ export default {
await $table.setActiveCell(newRow, 'name')
},
FnExcel(data) {
- console.log(data)
this.ExcelPid = data.id
this.tableData = []
BookingTemplateBookingExcelTemplateList({ id: this.ExcelPid }).then(res => {
res.data.forEach(item => {
- this.data1.forEach(ele => {
- if (item.field == ele.code) {
- item.fieldName = ele.name
+ this.fieldList.forEach(item2 => {
+ if (item2.code == item.field.split('.')[0]) {
+ item.Ffield = item2.name
}
})
+ item.field = item.field.split('.')[1]
+ })
+ // fieldName
+ Object.keys(this.data1).forEach(item => {
+ res.data.forEach(item2 => {
+ this.fieldList.forEach(ele => {
+ if (ele.name == item2.Ffield) {
+ if (ele.code == item) {
+ console.log(item, ele, item2)
+ console.log(this.data1, this.data1[item], 1111)
+ Object.keys(this.data1[item]).forEach(e => {
+ if (e.split('.')[1] == item2.field) {
+ item2.fieldName = this.data1[item][e]
+ }
+ })
+ // this.data1[item].forEach(e => {
+ // if (e.code == item2.field) {
+ // item2.fieldName = e.name
+ // }
+ // })
+ }
+ }
+ })
+ })
})
this.tableData = res.data
})
@@ -402,7 +460,6 @@ export default {
return Text
},
FnDFile(Data) {
- console.log(Data)
window.open(` http://60.209.125.238:25805/BookingPrintTemplate/download?id=${Data.id}`, '_blank')
// BookingPrintTemplateDownload({ id: Data.id }).then(res => {
@@ -461,17 +518,35 @@ export default {
this.ColumnsQuery.push({ ...item, checked: true })
})
BookingOrderGetFieldName().then(res => {
- let Arr = []
- Object.keys(res.data[0]).forEach(ele => {
- Arr.push({ code: ele, name: res.data[0][ele] })
- })
+ console.log(res.data)
+ this.data1 = res.data
+ // let fieldList = [
+ // { code: 'order', name: '主表' },
+ // { code: 'ctn', name: 'ctn' },
+ // { code: 'edi', name: 'edi' },
+ // { code: 'userinfo', name: 'userinfo' }
+ // ]
+ // Object.keys(res.data).forEach(ele => {
+ // this.fieldListData.forEach(item => {
+ // if (ele == item.code) {
+ // fieldList.push({
+ // code: ele,
+ // name: item.name
+ // })
+ // }
+ // })
+ // })
+ // this.fieldList = fieldList
+ // Object.keys(res.data[0]).forEach(ele => {
+ // Arr.push({ code: ele, name: res.data[0][ele] })
+ // })
// res.data.forEach(item => {
// Object.keys(item).forEach(ele => {
// Arr.push({ code: ele, name: item[ele] })
// })
// })
- this.fieldData = Arr
- this.data1 = Arr
+ // this.fieldData = Arr
+ // this.data1 = Arr
})
DjyCustomerGet({ type: 'printing_list_col' }).then(res => {
if (res.data && JSON.parse(res.data.configJson).length) {
diff --git a/src/views/main/VoyageBill/index.vue b/src/views/main/VoyageBill/index.vue
index 81bc7cf..0956885 100644
--- a/src/views/main/VoyageBill/index.vue
+++ b/src/views/main/VoyageBill/index.vue
@@ -48,7 +48,7 @@
-
+