dev
张同海 2 years ago
parent 51c7c0ac7e
commit c22b87679c

@ -0,0 +1,27 @@
import { axios } from '@/utils/request'
/**
* 获取船公司列表信息
*
* @author Myshipping
*/
export function CommondbCarrierList(parameter) {
return axios({
url: '/commondb/carrierlist',
method: 'get',
params: parameter
})
}
/**
* 新增船公司信息
*
* @author Myshipping
*/
export function CommondbAddCarrier(parameter) {
return axios({
url: '/commondb/addcarrier',
method: 'post',
data: parameter
})
}

@ -0,0 +1,27 @@
import { axios } from '@/utils/request'
/**
* 查询航线信息
*
* @author Myshipping
*/
export function CommondbCodeLaneList(parameter) {
return axios({
url: '/api/commondb/code-lane-list',
method: 'post',
params: parameter
})
}
/**
* 保存航线信息
*
* @author Myshipping
*/
export function CommondbSaveCodeLane(parameter) {
return axios({
url: '/commondb/savecodelane',
method: 'post',
data: parameter
})
}

@ -0,0 +1,27 @@
import { axios } from '@/utils/request'
/**
* 查询航线与港口的的关系表
*
* @author Myshipping
*/
export function CommondbRelaPortCarrierLaneDtoList(parameter) {
return axios({
url: '/api/commondb/rela-port-carrier-lane-dto-list',
method: 'post',
params: parameter
})
}
/**
* 保存航线与港口的的关系表
*
* @author Myshipping
*/
export function CommondbSaveRelaPortCarrierLaneDto(parameter) {
return axios({
url: '/api/commondb/save-rela-port-carrier-lane-dto',
method: 'post',
data: parameter
})
}

@ -0,0 +1,141 @@
<template>
<a-modal
title="新增配置"
:width="1100"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="12">
<a-form-item label="代码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入代码"
v-decorator="['code', { rules: [{ required: true, message: '请输入代码!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="英文名" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入英文名"
v-decorator="['enName', { rules: [{ required: true, message: '请输入英文名!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="中文名" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入中文名"
v-decorator="['cnName', { rules: [{ required: true, message: '请输入中文名!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入备注"
v-decorator="['remark', { rules: [{ required: true, message: '请输入备注!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="EDI代码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入EDI代码"
v-decorator="['ediCode', { rules: [{ required: true, message: '请输入EDI代码' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="描述" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-textarea
:autosize="{ minRows: 3 }"
placeholder="请输入描述"
v-decorator="['description', { rules: [{ required: true, message: '请输入描述!' }] }]"
/>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import { CommondbAddCarrier } from '@/api/modular/main/CommondbCarrierList'
export default {
data() {
return {
TypeData: [],
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
labelCol2: {
xs: { span: 24 },
sm: { span: 3 }
},
wrapperCol2: {
xs: { span: 24 },
sm: { span: 20 }
},
visible: false,
confirmLoading: false,
form: this.$form.createForm(this)
}
},
mounted() {},
methods: {
//
add(record) {
this.visible = true
},
/**
* 提交表单
*/
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])
}
}
CommondbAddCarrier(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,156 @@
<template>
<a-modal
title="编辑配置"
:width="1100"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="12">
<a-form-item label="代码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入代码"
v-decorator="['code', { rules: [{ required: true, message: '请输入代码!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="英文名" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入英文名"
v-decorator="['enName', { rules: [{ required: true, message: '请输入英文名!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="中文名" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入中文名"
v-decorator="['cnName', { rules: [{ required: true, message: '请输入中文名!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入备注"
v-decorator="['remark', { rules: [{ required: true, message: '请输入备注!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="EDI代码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入EDI代码"
v-decorator="['ediCode', { rules: [{ required: true, message: '请输入EDI代码' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="描述" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-textarea
:autosize="{ minRows: 3 }"
placeholder="请输入描述"
v-decorator="['description', { rules: [{ required: true, message: '请输入描述!' }] }]"
/>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import { CommondbAddCarrier } from '@/api/modular/main/CommondbCarrierList'
export default {
data() {
return {
TypeData: [],
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
labelCol2: {
xs: { span: 24 },
sm: { span: 3 }
},
wrapperCol2: {
xs: { span: 24 },
sm: { span: 20 }
},
visible: false,
confirmLoading: false,
form: this.$form.createForm(this)
}
},
mounted() {},
methods: {
//
edit(record) {
this.data = record
console.log(record)
this.visible = true
setTimeout(() => {
this.form.setFieldsValue({
code: record.code,
enName: record.enName,
cnName: record.cnName,
ediCode: record.ediCode,
description: record.description,
remark: record.remark
})
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.gid)
values.gid = this.data.gid
console.log(values)
CommondbAddCarrier(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,180 @@
<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">
<a-form-item label="关键字:">
<a-input v-model="queryParam.KeyWord" allow-clear placeholder="请输入关键字" />
</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()">
新增配置
</a-button>
</template>
</vxe-toolbar>
<vxe-table :data="loadData" border :loading="loading" height="600px" empty-text="">
<vxe-column type="seq" width="50" 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"
:show-overflow="true"
>
</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>
</template>
</vxe-column>
</vxe-table>
<add-form ref="addForm" @ok="handleOk" />
<edit-form ref="editForm" @ok="handleOk" />
</a-card>
</div>
</template>
<script>
import { CommondbCarrierList } from '@/api/modular/main/CommondbCarrierList'
import addForm from './addForm.vue'
import editForm from './editForm.vue'
export default {
components: {
addForm,
editForm
},
data() {
return {
TypeData: [],
// /
advanced: false,
loading: false,
setVisible: false,
setVisible1: false,
queryParam: {
// currentPage: 1,
// pageSize: 10,
// totalResult: 1
},
ColumnsQuery: [],
columns: [
{
title: '代码',
align: 'center',
width: '100',
dataIndex: 'code'
},
{
title: '英文名',
align: 'center',
width: '80',
dataIndex: 'enName'
},
{
title: '中文名',
align: 'center',
width: '80',
dataIndex: 'cnName'
},
{
title: 'EDI代码',
align: 'center',
width: '80',
dataIndex: 'ediCode'
},
{
title: '描述',
align: 'center',
width: '80',
dataIndex: 'description'
},
{
title: '备注',
align: 'center',
width: '80',
dataIndex: 'remark'
}
],
tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
// Promise
loadData: [],
CodeData: [],
WCodeData: [],
ModulesData: [],
carrierCodeData: []
}
},
created() {},
mounted() {
this.init()
},
methods: {
toggleAdvanced() {
this.advanced = !this.advanced
},
init() {
Object.assign(this.$data, this.$options.data())
this.ColumnsQuery = this.columns
this.FnGetData()
},
FnGetData() {
this.loading = true
CommondbCarrierList(this.queryParam).then(res => {
if (res.code == 200) {
this.loadData = res.data
} else {
this.loadData = []
this.$message.warning(res.message)
}
this.loading = false
})
},
handleOk() {
this.FnGetData()
}
}
}
</script>
<style lang="less">
.table-operator {
margin-bottom: 18px;
}
button {
margin-right: 8px;
}
.Open {
}
.Close {
height: 45px;
overflow: hidden;
}
</style>

@ -0,0 +1,133 @@
<template>
<a-modal
title="新增配置"
:width="1100"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="12">
<a-form-item label="代码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入代码"
v-decorator="['code', { rules: [{ required: true, message: '请输入代码!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="航线类型" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入航线类型"
v-decorator="['laneType', { rules: [{ required: true, message: '请输入航线类型!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="英文名" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入英文名"
v-decorator="['enName', { rules: [{ required: true, message: '请输入英文名!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="中文名" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入中文名"
v-decorator="['cnName', { rules: [{ required: true, message: '请输入中文名!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="描述" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-textarea
:autosize="{ minRows: 3 }"
placeholder="请输入描述"
v-decorator="['description', { rules: [{ required: true, message: '请输入描述!' }] }]"
/>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import { CommondbSaveCodeLane } from '@/api/modular/main/CommondbCodeLane'
export default {
data() {
return {
TypeData: [],
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
labelCol2: {
xs: { span: 24 },
sm: { span: 3 }
},
wrapperCol2: {
xs: { span: 24 },
sm: { span: 20 }
},
visible: false,
confirmLoading: false,
form: this.$form.createForm(this)
}
},
mounted() {},
methods: {
//
add(record) {
this.visible = true
},
/**
* 提交表单
*/
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])
}
}
CommondbSaveCodeLane(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,148 @@
<template>
<a-modal
title="编辑配置"
:width="1100"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="12">
<a-form-item label="代码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入代码"
:disabled="true"
v-decorator="['code', { rules: [{ required: true, message: '请输入代码!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="航线类型" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入航线类型"
v-decorator="['laneType', { rules: [{ required: true, message: '请输入航线类型!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="英文名" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入英文名"
v-decorator="['enName', { rules: [{ required: true, message: '请输入英文名!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="中文名" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入中文名"
v-decorator="['cnName', { rules: [{ required: true, message: '请输入中文名!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="描述" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-textarea
:autosize="{ minRows: 3 }"
placeholder="请输入描述"
v-decorator="['description', { rules: [{ required: true, message: '请输入描述!' }] }]"
/>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import { CommondbSaveCodeLane } from '@/api/modular/main/CommondbCodeLane'
export default {
data() {
return {
TypeData: [],
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
labelCol2: {
xs: { span: 24 },
sm: { span: 3 }
},
wrapperCol2: {
xs: { span: 24 },
sm: { span: 20 }
},
visible: false,
confirmLoading: false,
form: this.$form.createForm(this)
}
},
mounted() {},
methods: {
//
edit(record) {
this.data = record
console.log(record)
this.visible = true
setTimeout(() => {
this.form.setFieldsValue({
code: record.code,
laneType: record.laneType,
enName: record.enName,
cnName: record.cnName,
description: record.description
})
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.gid)
values.gid = this.data.gid
console.log(values)
CommondbSaveCodeLane(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,185 @@
<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"
v-if="
item.title != '备注' && item.title != '船公司' && item.title != '包装' && item.title != '模块'
"
>
<a-input v-model="queryParam[item.dataIndex]" allow-clear :placeholder="`请输入${item.title}`" />
</a-form-item>
</a-col> -->
<a-col :md="8" :sm="24">
<a-form-item label="关键字:">
<a-input v-model="queryParam.KeyWord" allow-clear placeholder="请输入关键字" />
</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()">
新增配置
</a-button>
</template>
</vxe-toolbar>
<vxe-table :data="loadData" border :loading="loading" height="600px" empty-text="">
<vxe-column type="seq" width="50" 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"
:show-overflow="true"
>
</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>
</template>
</vxe-column>
</vxe-table>
<add-form ref="addForm" @ok="handleOk" />
<edit-form ref="editForm" @ok="handleOk" />
</a-card>
</div>
</template>
<script>
import { CommondbCodeLaneList } from '@/api/modular/main/CommondbCodeLane'
import addForm from './addForm.vue'
import editForm from './editForm.vue'
export default {
components: {
addForm,
editForm
},
data() {
return {
TypeData: [],
// /
advanced: false,
loading: false,
setVisible: false,
setVisible1: false,
queryParam: {
// currentPage: 1,
// pageSize: 10,
// totalResult: 1
},
ColumnsQuery: [],
columns: [
{
title: '代码',
align: 'center',
width: '100',
dataIndex: 'code'
},
{
title: '航线类型',
align: 'center',
width: '80',
dataIndex: 'laneType'
},
{
title: '英文名',
align: 'center',
width: '80',
dataIndex: 'enName'
},
{
title: '中文名',
align: 'center',
width: '80',
dataIndex: 'cnName'
},
{
title: '描述',
align: 'center',
width: '80',
dataIndex: 'description'
}
],
tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
// Promise
loadData: [],
CodeData: [],
WCodeData: [],
ModulesData: [],
carrierCodeData: []
}
},
created() {},
mounted() {
this.init()
},
methods: {
toggleAdvanced() {
this.advanced = !this.advanced
},
init() {
Object.assign(this.$data, this.$options.data())
this.ColumnsQuery = this.columns
this.FnGetData()
},
FnGetData() {
this.loading = true
CommondbCodeLaneList(this.queryParam).then(res => {
if (res.code == 200) {
this.loadData = res.data
} else {
this.loadData = []
this.$message.warning(res.message)
}
this.loading = false
})
},
handleOk() {
this.FnGetData()
}
}
}
</script>
<style lang="less">
.table-operator {
margin-bottom: 18px;
}
button {
margin-right: 8px;
}
.Open {
}
.Close {
height: 45px;
overflow: hidden;
}
</style>

@ -0,0 +1,129 @@
<template>
<a-modal
title="新增配置"
:width="1100"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="12">
<a-form-item label="航线代码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入航线代码"
v-decorator="['laneCode', { rules: [{ required: true, message: '请输入航线代码!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="船司代码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入船司代码"
v-decorator="['carrierCode', { rules: [{ required: true, message: '请输入船司代码!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="港口代码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入港口代码"
v-decorator="['portCode', { rules: [{ required: true, message: '请输入港口代码!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入模块"
v-decorator="['module', { rules: [{ required: true, message: '请输入模块!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input placeholder="请输入备注" v-decorator="['remark']" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import { CommondbSaveRelaPortCarrierLaneDto } from '@/api/modular/main/CommondbRelaPortCarrierLaneDto'
export default {
data() {
return {
TypeData: [],
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 15 }
},
labelCol2: {
xs: { span: 24 },
sm: { span: 4 }
},
wrapperCol2: {
xs: { span: 24 },
sm: { span: 20 }
},
visible: false,
confirmLoading: false,
form: this.$form.createForm(this)
}
},
mounted() {},
methods: {
//
add(record) {
this.visible = true
},
/**
* 提交表单
*/
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])
}
}
CommondbSaveRelaPortCarrierLaneDto(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,144 @@
<template>
<a-modal
title="编辑配置"
:width="1100"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="12">
<a-form-item label="航线代码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入航线代码"
v-decorator="['laneCode', { rules: [{ required: true, message: '请输入航线代码!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="船司代码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入船司代码"
v-decorator="['carrierCode', { rules: [{ required: true, message: '请输入船司代码!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="港口代码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入港口代码"
v-decorator="['portCode', { rules: [{ required: true, message: '请输入港口代码!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入模块"
v-decorator="['module', { rules: [{ required: true, message: '请输入模块!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input placeholder="请输入备注" v-decorator="['remark']" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import { CommondbSaveRelaPortCarrierLaneDto } from '@/api/modular/main/CommondbRelaPortCarrierLaneDto'
export default {
data() {
return {
TypeData: [],
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
labelCol2: {
xs: { span: 24 },
sm: { span: 3 }
},
wrapperCol2: {
xs: { span: 24 },
sm: { span: 20 }
},
visible: false,
confirmLoading: false,
form: this.$form.createForm(this)
}
},
mounted() {},
methods: {
//
edit(record) {
this.data = record
console.log(record)
this.visible = true
setTimeout(() => {
console.log(record)
this.form.setFieldsValue({
laneCode: record.laneCode,
carrierCode: record.carrierCode,
portCode: record.portCode,
module: record.module,
remark: record.remark
})
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.gid)
values.gid = this.data.gid
console.log(values)
CommondbSaveRelaPortCarrierLaneDto(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,189 @@
<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">
<a-form-item label="航线代码:">
<a-input v-model="queryParam.LaneCode" allow-clear placeholder="请输入航线代码" />
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="船司代码:">
<a-input v-model="queryParam.CarrierCode" allow-clear placeholder="请输入船司代码" />
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="港口代码:">
<a-input v-model="queryParam.PortCode" allow-clear placeholder="请输入港口代码" />
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="模块:">
<a-input v-model="queryParam.Module" allow-clear placeholder="请输入模块" />
</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()">
新增配置
</a-button>
</template>
</vxe-toolbar>
<vxe-table :data="loadData" border :loading="loading" height="600px" empty-text="">
<vxe-column type="seq" width="50" 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"
:show-overflow="true"
>
</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>
</template>
</vxe-column>
</vxe-table>
<add-form ref="addForm" @ok="handleOk" />
<edit-form ref="editForm" @ok="handleOk" />
</a-card>
</div>
</template>
<script>
import { CommondbRelaPortCarrierLaneDtoList } from '@/api/modular/main/CommondbRelaPortCarrierLaneDto'
import addForm from './addForm.vue'
import editForm from './editForm.vue'
export default {
components: {
addForm,
editForm
},
data() {
return {
TypeData: [],
// /
advanced: false,
loading: false,
setVisible: false,
setVisible1: false,
queryParam: {
// currentPage: 1,
// pageSize: 10,
// totalResult: 1
},
ColumnsQuery: [],
columns: [
{
title: '航线代码',
align: 'center',
width: '100',
dataIndex: 'laneCode'
},
{
title: '船司代码',
align: 'center',
width: '80',
dataIndex: 'carrierCode'
},
{
title: '港口代码',
align: 'center',
width: '80',
dataIndex: 'portCode'
},
{
title: '模块',
align: 'center',
width: '80',
dataIndex: 'module'
},
{
title: '备注',
align: 'center',
width: '80',
dataIndex: 'remark'
}
],
tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
// Promise
loadData: [],
CodeData: [],
WCodeData: [],
ModulesData: [],
carrierCodeData: []
}
},
created() {},
mounted() {
this.init()
},
methods: {
toggleAdvanced() {
this.advanced = !this.advanced
},
init() {
Object.assign(this.$data, this.$options.data())
this.ColumnsQuery = this.columns
this.FnGetData()
},
FnGetData() {
this.loading = true
CommondbRelaPortCarrierLaneDtoList(this.queryParam).then(res => {
if (res.code == 200) {
this.loadData = res.data
} else {
this.loadData = []
this.$message.warning(res.message)
}
this.loading = false
})
},
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