张同海 2 years ago
parent 2c3416adf5
commit 70bea26fff

@ -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

@ -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

@ -165,7 +165,7 @@
<add-form ref="addForm" @ok="handleOk" />
<edit-form ref="editForm" @ok="handleOk" />
</a-card>
<a-modal v-model="ExcelVisible" width="800px" title="详细设置">
<a-modal v-model="ExcelVisible" width="1100px" title="详细设置">
<vxe-toolbar>
<template #buttons>
<vxe-button @click="insertEvent(-1)"></vxe-button>
@ -184,28 +184,27 @@
:edit-config="{ trigger: 'click', mode: 'row', icon: 'vxe-icon-edit', showStatus: true }"
>
<vxe-column type="checkbox" width="60"></vxe-column>
<vxe-column field="fieldName" title="字段名称" :edit-render="{}">
<vxe-column field="Ffield" title="对象名" :edit-render="{}">
<template #edit="{ row }">
<!-- <vxe-input v-model="row.field" type="text"></vxe-input> -->
<!-- <a-select v-model="row.field" style="width: 100%" placeholder="请选择分类" allow-clear>
<a-select-option v-for="(item, index) in fieldData" :key="index" :value="item.name">
{{ item.name }}
</a-select-option>
</a-select> -->
<!-- <vxe-select v-model="row.field" style="width: 100%" placeholder="请选择分类">
<vxe-select v-model="row.Ffield" style="width: 100%" placeholder="请选择对象名">
<vxe-option
v-for="(item, index) in fieldData"
v-for="(item, index) in fieldList"
:key="index"
:value="item.name"
:label="item.name"
></vxe-option>
</vxe-select> -->
<vxe-pulldown v-model="visible1">
</vxe-select>
</template>
</vxe-column>
<vxe-column field="fieldName" title="字段名称" width="300" :edit-render="{}">
<template #edit="{ row }">
<vxe-pulldown v-model="visible1" style="width: 100%">
<template #default>
<vxe-input
v-model="row.fieldName"
placeholder="请选择分类"
@focus="focusEvent1"
placeholder="请选择字段名称"
:disabled="!row.Ffield"
@focus="focusEvent1(row)"
@keyup="keyupEvent1(row)"
></vxe-input>
</template>
@ -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) {

@ -48,7 +48,7 @@
</a-card>
</a-col>
<a-col :span="12">
<a-card :bordered="false" :bodyStyle="tstyle">
<a-card :bordered="false">
<a-row type="flex" :gutter="16">
<a-col :span="22">
<a-row type="flex" class="CsBRTT" :gutter="16">

Loading…
Cancel
Save