订舱打印 文件下载等

dev
张同海 2 years ago
parent 4a235560bd
commit d6b83674e0

@ -39,10 +39,17 @@ export function BookingPrintTemplateAdd(parameter) {
* @author Myshipping
*/
export function BookingPrintTemplateEdit(parameter) {
let params = new FormData()
params.append('file', parameter.file)
Object.keys(parameter.data).forEach(item => {
params.append(`${item}`, parameter.data[item])
})
console.log(parameter)
return axios({
url: '/BookingPrintTemplate/edit',
method: 'post',
data: parameter
data: params,
headers: { 'Content-type': 'multipart/form-data;charset=utf-8' }
})
}
@ -73,3 +80,15 @@ export function SysTenantPage() {
}
})
}
/**
* 下载模板文件
*
* @author Myshipping
*/
export function BookingPrintTemplateDownload(parameter) {
return axios({
url: '/BookingPrintTemplate/download',
method: 'get',
params: parameter
})
}

@ -1,26 +0,0 @@
"edicode": "string",
"ediname": "string",
"serverip": "string",
"foldername": "string",
"username": "string",
"password": "string",
"sendcode": "string",
"receivecode": "string",
"sendname": "string",
"sendattn": "string",
"sendtel": "string",
"sendemail": "string",
"sendcompanycode": "string",
"sendsubcompanycode": "string",
"carrierid": "string",
"receiveemail": "string",
"receivesiemail": "string",
"receiveop": "string",
"receivesale": "string",
"receivedept": "string",
"shippertel": "string",
"consigneetel": "string",
"notifypartytel": "string",
"isusetel": "string",
"tenantId": 0,
"tenantName": "string"

@ -12,15 +12,11 @@
<a-row>
<a-col :span="8">
<a-form-item label="类型名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<!-- <a-input
placeholder="请输入类型名称"
v-decorator="['typeName', { rules: [{ required: true, message: '请输入类型名称!' }] }]"
/> -->
<a-select
placeholder="请输入类型名称"
v-decorator="['typeName', { rules: [{ required: true, message: '请输入类型名称!' }] }]"
v-decorator="['typeCode', { rules: [{ required: true, message: '请输入类型名称!' }] }]"
>
<a-select-option v-for="item in TypeData" :key="item.id" :value="item.value">
<a-select-option v-for="item in TypeData" :key="item.code" :value="item.code">
{{ item.value }}
</a-select-option>
</a-select>
@ -28,10 +24,6 @@
</a-col>
<a-col :span="8">
<a-form-item label="租户名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<!-- <a-input
placeholder="请输入租户名称"
v-decorator="['tenantName', { rules: [{ required: true, message: '请输入租户名称!' }] }]"
/> -->
<a-select
placeholder="请输入租户名称"
v-decorator="['tenantName', { rules: [{ required: true, message: '请输入租户名称!' }] }]"
@ -127,6 +119,13 @@ export default {
values.tenantId = item.tenantId
}
})
this.TypeData.forEach(item => {
if (values.typeCode == item.code) {
console.log(item)
values.TypeName = item.value
}
})
console.log(values)
BookingPrintTemplateAdd({ file: this.file, data: values })
.then(res => {
if (res.success) {

@ -12,27 +12,41 @@
<a-row>
<a-col :span="8">
<a-form-item label="类型名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
<a-select
placeholder="请输入类型名称"
v-decorator="['typeName', { rules: [{ required: true, message: '请输入类型名称!' }] }]"
/>
v-decorator="['typeCode', { rules: [{ required: true, message: '请输入类型名称!' }] }]"
>
<a-select-option v-for="item in TypeData" :key="item.code" :value="item.code">
{{ item.value }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="租户名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
<a-select
placeholder="请输入租户名称"
v-decorator="['tenantName', { rules: [{ required: true, message: '请输入租户名称!' }] }]"
/>
>
<a-select-option v-for="item in SysTenantData" :key="item.id" :value="item.name">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-upload :file-list="fileList" :before-upload="beforeUpload" @remove="handleRemove">
<a-button>
<upload-outlined></upload-outlined>
Select File
</a-button>
</a-upload>
<a-form-item>
<a-upload
name="file"
:file-list="fileList"
@change="handleChange"
:customRequest="customRequest"
:multiple="false"
:style="{ marginTop: '4px' }"
>
<a-button> <a-icon type="upload" /> 文件上传 </a-button>
</a-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
@ -41,11 +55,15 @@
</template>
<script>
import { BookingPrintTemplateEdit } from '@/api/modular/main/bookingprinttemplate'
import { BookingPrintTemplateEdit, SysTenantPage } from '@/api/modular/main/bookingprinttemplate'
import { sysDictDataPage } from '@/api/modular/system/dictDataManage'
export default {
data() {
return {
fileList: '',
TypeData: [],
SysTenantData: [],
file: {},
fileList: [],
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
@ -54,52 +72,45 @@ export default {
xs: { span: 24 },
sm: { span: 15 }
},
typeData: [],
visible: false,
confirmLoading: false,
form: this.$form.createForm(this)
form: this.$form.createForm(this),
data: {}
}
},
mounted() {
SysTenantPage().then(res => {
console.log(res.data)
this.SysTenantData = res.data.rows
})
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '348569545515077' }).then(res => {
this.TypeData = res.data.rows
console.log(this.TypeData, 11111)
})
},
methods: {
beforeUpload(file) {
console.log('beforeUpload', file)
customRequest(data) {
this.file = data.file
},
handleRemove(file) {
console.log('handleRemove', file)
handleChange(info) {
this.fileList = [info.file]
},
//
edit(record) {
this.data = record
console.log(record)
this.visible = true
const typeOption = this.$options
this.typeData = typeOption.filters['dictData']('edi_type')
setTimeout(() => {
this.form.setFieldsValue({
addr: record.addr,
addrEN: record.addrEN,
chief: record.chief,
city: record.city,
createdTime: record.createdTime,
createdUserId: record.createdUserId,
createdUserName: record.createdUserName,
email: record.email,
fullName: record.fullName,
fullNameEN: record.fullNameEN,
typeCode: record.typeCode,
typeName: record.typeName,
filePath: record.filePath,
fileName: record.fileName,
tenantName: record.tenantName,
id: record.id,
invAddrTel: record.invAddrTel,
invTitle: record.invTitle,
isDeleted: record.isDeleted,
province: record.province,
qq: record.qq,
rmbAccount: record.rmbAccount,
rmbBank: record.rmbBank,
shortName: record.shortName,
taxNO: record.taxNO,
tel: record.tel,
tenantId: record.tenantId,
usdAccount: record.usdAccount,
usdBank: record.usdBank,
webUrl: record.webUrl
tenantId: record.tenantId
})
console.log(this.form.getFieldsValue())
}, 100)
@ -118,8 +129,21 @@ export default {
values[key] = JSON.stringify(values[key])
}
}
console.log(this.form, values.id)
BookingPrintTemplateEdit(values)
this.SysTenantData.forEach(item => {
if (values.tenantName == item.tenantName) {
values.tenantId = item.tenantId
}
})
this.TypeData.forEach(item => {
if (values.typeCode == item.code) {
console.log(item)
values.TypeName = item.value
}
})
console.log(this.form.getFieldsValue(), 1111)
values.id = this.data.id
console.log(values)
BookingPrintTemplateEdit({ file: this.file, data: values })
.then(res => {
if (res.success) {
this.$message.success('编辑成功')
@ -129,8 +153,12 @@ export default {
} else {
this.$message.error('编辑失败') // + res.message
}
this.file = {}
this.fileList = []
})
.finally(res => {
this.file = {}
this.fileList = []
this.confirmLoading = false
})
} else {

@ -67,7 +67,11 @@
:title="item.title"
:align="item.align"
v-if="item.checked"
></vxe-column>
>
<template #default="{ row }" v-if="item.title == '文件名称'">
<a @click="FnDFile(row)">{{ row.fileName }}</a>
</template>
</vxe-column>
<vxe-column title="操作" fixed="right" width="200" align="center">
<template #default="{ row }">
<vxe-button type="text" @click="$refs.editForm.edit(row)"></vxe-button>
@ -101,7 +105,11 @@
</div>
</template>
<script>
import { BookingPrintTemplatePage, BookingPrintTemplateDelete } from '@/api/modular/main/bookingprinttemplate'
import {
BookingPrintTemplatePage,
BookingPrintTemplateDelete,
BookingPrintTemplateDownload
} from '@/api/modular/main/bookingprinttemplate'
import { DjyCustomerGet, DjyUserConfigAdd } from '@/api/modular/main/CustomerInformationManagement'
import addForm from './addForm.vue'
import editForm from './editForm.vue'
@ -154,6 +162,17 @@ export default {
this.init()
},
methods: {
FnDFile(Data) {
BookingPrintTemplateDownload({ id: Data.id }).then(res => {
const blob = res
let link = document.createElement('a')
link.href = URL.createObjectURL(new Blob([blob], { type: 'application/vnd.ms-excel' }))
link.download = Data.fileName
document.body.appendChild(link)
link.click()
URL.revokeObjectURL(link.href)
})
},
columnChange(data) {
this.ColumnsQuery = [...data]
let Data = []

@ -0,0 +1,240 @@
<template>
<a-modal
title="新增EDI参数设置"
:width="1100"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="8">
<a-form-item label="EDI类型名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入EDI类型名称"
v-decorator="['ediname', { rules: [{ required: true, message: '请输入EDI类型名称' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="服务器IP" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入服务器IP"
v-decorator="['serverip', { rules: [{ required: true, message: '请输入服务器IP' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="文件夹" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入文件夹"
v-decorator="['foldername', { rules: [{ required: true, message: '请输入文件夹!' }] }]"
/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="8">
<a-form-item label="用户名" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入用户名"
v-decorator="['username', { rules: [{ required: true, message: '请输入用户名!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="密码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入密码"
v-decorator="['password', { rules: [{ required: true, message: '请输入密码!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="发送方名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入发送方名称"
v-decorator="['sendname', { rules: [{ required: true, message: '请输入发送方名称!' }] }]"
/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="8">
<a-form-item label="发送方联系人" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入发送方联系人"
v-decorator="['sendattn', { rules: [{ required: true, message: '请输入发送方联系人!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="发送方电话" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入发送方电话"
v-decorator="['sendtel', { rules: [{ required: true, message: '请输入发送方电话!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="发送方邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入发送方邮箱"
v-decorator="['sendemail', { rules: [{ required: true, message: '请输入发送方邮箱!' }] }]"
/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="8">
<a-form-item label="接收方邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入接收方邮箱"
v-decorator="['receiveemail', { rules: [{ required: true, message: '请输入接收方邮箱!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="接收方操作" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入接收方操作"
v-decorator="['receiveop', { rules: [{ required: true, message: '请输入接收方操作!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="接收方销售" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入接收方销售"
v-decorator="['receivesale', { rules: [{ required: true, message: '请输入接收方销售!' }] }]"
/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="8">
<a-form-item label="接收方部门" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入接收方部门"
v-decorator="['receivedept', { rules: [{ required: true, message: '请输入接收方部门!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="发送人电话" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入发送人电话"
v-decorator="['shippertel', { rules: [{ required: true, message: '请输入发送人电话!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="收货人电话" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入收货人电话"
v-decorator="['consigneetel', { rules: [{ required: true, message: '请输入收货人电话!' }] }]"
/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="8">
<a-form-item label="通知人电话" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入通知人电话"
v-decorator="['notifypartytel', { rules: [{ required: true, message: '请输入通知人电话!' }] }]"
/>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import { DjyEdiSettingAdd } from '@/api/modular/main/EDIParameterSettingService'
export default {
data() {
return {
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 15 }
},
typeData: [],
visible: false,
confirmLoading: false,
form: this.$form.createForm(this)
}
},
methods: {
//
add(record) {
this.visible = true
this.typeData = [
{
code: 10,
name: '收货人'
},
{
code: 20,
name: '发货人'
},
{
code: 30,
name: '通知人'
},
{
code: 40,
name: '第二通知人'
}
]
},
/**
* 提交表单
*/
handleSubmit() {
const {
form: { validateFields }
} = this
this.confirmLoading = true
validateFields((errors, values) => {
if (!errors) {
for (const key in values) {
if (typeof values[key] === 'object' && !(values[key] === null)) {
values[key] = JSON.stringify(values[key])
}
}
DjyEdiSettingAdd(values)
.then(res => {
if (res.success) {
this.$message.success('新增成功')
this.confirmLoading = false
this.$emit('ok', values)
this.handleCancel()
} else {
this.$message.error('新增失败') // + res.message
}
})
.finally(res => {
this.confirmLoading = false
})
} else {
this.confirmLoading = false
}
})
},
handleCancel() {
this.form.resetFields()
this.visible = false
}
}
}
</script>

@ -0,0 +1,245 @@
<template>
<a-modal
title="编辑EDI参数设置"
:width="1100"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="8">
<a-form-item label="EDI类型名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入EDI类型名称"
v-decorator="['ediname', { rules: [{ required: true, message: '请输入EDI类型名称' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="服务器IP" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入服务器IP"
v-decorator="['serverip', { rules: [{ required: true, message: '请输入服务器IP' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="文件夹" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入文件夹"
v-decorator="['foldername', { rules: [{ required: true, message: '请输入文件夹!' }] }]"
/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="8">
<a-form-item label="用户名" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入用户名"
v-decorator="['username', { rules: [{ required: true, message: '请输入用户名!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="密码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入密码"
v-decorator="['password', { rules: [{ required: true, message: '请输入密码!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="发送方名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入发送方名称"
v-decorator="['sendname', { rules: [{ required: true, message: '请输入发送方名称!' }] }]"
/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="8">
<a-form-item label="发送方联系人" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入发送方联系人"
v-decorator="['sendattn', { rules: [{ required: true, message: '请输入发送方联系人!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="发送方电话" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入发送方电话"
v-decorator="['sendtel', { rules: [{ required: true, message: '请输入发送方电话!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="发送方邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入发送方邮箱"
v-decorator="['sendemail', { rules: [{ required: true, message: '请输入发送方邮箱!' }] }]"
/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="8">
<a-form-item label="接收方邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入接收方邮箱"
v-decorator="['receiveemail', { rules: [{ required: true, message: '请输入接收方邮箱!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="接收方操作" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入接收方操作"
v-decorator="['receiveop', { rules: [{ required: true, message: '请输入接收方操作!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="接收方销售" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入接收方销售"
v-decorator="['receivesale', { rules: [{ required: true, message: '请输入接收方销售!' }] }]"
/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="8">
<a-form-item label="接收方部门" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入接收方部门"
v-decorator="['receivedept', { rules: [{ required: true, message: '请输入接收方部门!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="发送人电话" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入发送人电话"
v-decorator="['shippertel', { rules: [{ required: true, message: '请输入发送人电话!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="收货人电话" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入收货人电话"
v-decorator="['consigneetel', { rules: [{ required: true, message: '请输入收货人电话!' }] }]"
/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="8">
<a-form-item label="通知人电话" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入通知人电话"
v-decorator="['notifypartytel', { rules: [{ required: true, message: '请输入通知人电话!' }] }]"
/>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import { DjyEdiSettingEdit } from '@/api/modular/main/EDIParameterSettingService'
export default {
data() {
return {
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 15 }
},
typeData: [],
visible: false,
confirmLoading: false,
form: this.$form.createForm(this)
}
},
methods: {
//
edit(record) {
console.log(record)
this.visible = true
const typeOption = this.$options
this.typeData = typeOption.filters['dictData']('edi_type')
setTimeout(() => {
this.form.setFieldsValue({
ediname: record.ediname,
serverip: record.serverip,
foldername: record.foldername,
username: record.username,
password: record.password,
sendname: record.sendname,
sendattn: record.sendattn,
sendtel: record.sendtel,
sendemail: record.sendemail,
receiveemail: record.receiveemail,
receiveop: record.receiveop,
receivesale: record.receivesale,
receivedept: record.receivedept,
shippertel: record.shippertel,
consigneetel: record.consigneetel,
notifypartytel: record.notifypartytel
})
console.log(this.form.getFieldsValue())
}, 100)
},
handleSubmit() {
const {
form: { validateFields }
} = this
this.confirmLoading = true
validateFields((errors, values) => {
console.log(errors, values)
if (!errors) {
for (const key in values) {
console.log(key, 1)
if (typeof values[key] === 'object' && !(values[key] === null)) {
values[key] = JSON.stringify(values[key])
}
}
console.log(this.form, values.id)
DjyEdiSettingEdit(values)
.then(res => {
if (res.success) {
this.$message.success('编辑成功')
this.confirmLoading = false
this.$emit('ok', values)
this.handleCancel()
} else {
this.$message.error('编辑失败') // + res.message
}
})
.finally(res => {
this.confirmLoading = false
})
} else {
this.confirmLoading = false
}
})
},
handleCancel() {
this.form.resetFields()
this.visible = false
}
}
}
</script>

@ -0,0 +1,279 @@
<template>
<div>
<a-card :bordered="false" :bodyStyle="tstyle">
<div
class="table-page-search-wrapper"
v-if="hasPerm('BookingTemplate:page')"
:class="advanced ? 'Open' : 'Close'"
>
<a-form layout="inline">
<a-row :gutter="48">
<a-col :md="18">
<a-row :gutter="48">
<a-col :md="8" :sm="24" v-for="item in ColumnsQuery" :key="`${item.dataIndex}1`">
<a-form-item :label="item.title">
<a-input v-model="queryParam[item.dataIndex]" allow-clear :placeholder="`请输入${item.title}`" />
</a-form-item>
</a-col>
</a-row>
</a-col>
<a-col :md="6" :sm="24">
<span class="table-page-search-submitButtons">
<a-button type="primary" @click="FnGetData"></a-button>
<a-button style="margin-left: 8px" @click="init"></a-button>
<a @click="toggleAdvanced" style="margin-left: 8px">
{{ advanced ? '收起' : '展开' }}
<a-icon :type="advanced ? 'up' : 'down'" />
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
</a-card>
<a-card :bordered="false">
<vxe-toolbar>
<template #buttons>
<a-button type="primary" icon="plus" @click="$refs.addForm.add()">
新增EDI参数
</a-button>
</template>
</vxe-toolbar>
<vxe-table :data="loadData" border :loading="loading" empty-text="">
<vxe-column type="seq" width="40" fixed="left"></vxe-column>
<vxe-column
v-for="item in columns"
:key="`${item.dataIndex}3`"
:field="item.dataIndex"
:min-width="item.width"
:title="item.title"
:align="item.align"
></vxe-column>
<vxe-column title="操作" fixed="right" width="200" align="center">
<template #default="{ row }">
<vxe-button type="text" @click="$refs.editForm.edit(row)"></vxe-button>
<a-popconfirm
title="请确认删除?"
ok-text="是"
cancel-text="否"
@confirm="
e => {
confirm(e, row)
}
"
>
<vxe-button type="text">删除</vxe-button>
</a-popconfirm>
</template>
</vxe-column>
</vxe-table>
<vxe-pager
:loading="loading"
:current-page="queryParam.currentPage"
:page-size="queryParam.pageSize"
:total="queryParam.totalResult"
:layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
@page-change="handlePageChange"
>
</vxe-pager>
<add-form ref="addForm" @ok="handleOk" />
<edit-form ref="editForm" @ok="handleOk" />
</a-card>
</div>
</template>
<script>
import { DjyEdiSettingPage, DjyEdiSettingDelete } from '@/api/modular/main/EDIParameterSettingService'
import addForm from './addForm.vue'
import editForm from './editForm.vue'
import columnSetting from '@/components/tableColumnSetting'
export default {
components: {
addForm,
editForm,
columnSetting
},
data() {
return {
// /
advanced: false,
loading: false,
setVisible: false,
setVisible1: false,
queryParam: {
currentPage: 1,
pageSize: 10,
totalResult: 1
},
ColumnsQuery: [],
columns: [
{
title: 'EDI类型名称',
align: 'center',
width: '100',
dataIndex: 'ediname'
},
{
title: '服务器IP',
align: 'center',
width: '80',
dataIndex: 'serverip'
},
{
title: '文件夹',
align: 'center',
width: '80',
dataIndex: 'foldername'
},
{
title: '用户名',
align: 'center',
width: '80',
dataIndex: 'username'
},
{
title: '密码',
align: 'center',
width: '100',
dataIndex: 'password'
},
{
title: '发送方名称',
align: 'center',
width: '100',
dataIndex: 'sendname'
},
{
title: '发送方联系人',
align: 'center',
width: '120',
dataIndex: 'sendattn'
},
{
title: '发送方电话',
align: 'center',
width: '100',
dataIndex: 'sendtel'
},
{
title: '发送方邮箱',
align: 'center',
width: '100',
dataIndex: 'sendemail'
},
{
title: '接收方邮箱',
align: 'center',
width: '100',
dataIndex: 'receiveemail'
},
{
title: '接收方操作',
align: 'center',
width: '100',
dataIndex: 'receiveop'
},
{
title: '接收方销售',
align: 'center',
width: '100',
dataIndex: 'receivesale'
},
{
title: '接收方部门',
align: 'center',
width: '100',
dataIndex: 'receivedept'
},
{
title: '发送人电话',
align: 'center',
width: '100',
dataIndex: 'shippertel'
},
{
title: '收货人电话',
align: 'center',
width: '100',
dataIndex: 'consigneetel'
},
{
title: '通知人电话',
align: 'center',
width: '100',
dataIndex: 'notifypartytel'
}
],
tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
// Promise
loadData: {}
}
},
created() {},
mounted() {
this.init()
},
methods: {
toggleAdvanced() {
this.advanced = !this.advanced
},
init() {
Object.assign(this.$data, this.$options.data())
this.ColumnsQuery = this.columns
this.FnGetData()
},
handlePageChange({ currentPage, pageSize }) {
this.queryParam.pageNo = currentPage
this.queryParam.pageSize = pageSize
this.FnGetData()
},
FnGetData() {
this.loading = true
DjyEdiSettingPage(this.queryParam).then(res => {
this.loadData = res.data.rows
this.loading = false
this.queryParam.currentPage = res.data.pageNo
this.queryParam.pageSize = res.data.pageSize
this.queryParam.totalResult = res.data.totalRows
})
},
/**
* 查询参数组装
*/
switchingDate() {
const obj = JSON.parse(JSON.stringify(this.queryParam))
return obj
},
confirm(e, data) {
this.DjyEdiSettingDelete(data)
},
DjyEdiSettingDelete(record) {
DjyEdiSettingDelete(record).then(res => {
if (res.success) {
this.$message.success('删除成功')
this.FnGetData()
} else {
this.$message.error('删除失败') // + res.message
}
})
},
handleOk() {
this.FnGetData()
}
}
}
</script>
<style lang="less">
.table-operator {
margin-bottom: 18px;
}
button {
margin-right: 8px;
}
.Open {
}
.Close {
height: 45px;
overflow: hidden;
}
</style>
Loading…
Cancel
Save