租户航线维护

szh_zidingyibiaoti
张同海 2 years ago
parent 8803b1cac7
commit f1000b922d

@ -0,0 +1,46 @@
import { axios } from '@/utils/request'
/**
* 分页查询网站账号维护
*
* @author Myshipping
*/
export function DjyTenantLinePage(parameter) {
return axios({
url: '/DjyTenantLine/page',
method: 'get',
params: parameter
})
}
// 查询当前租户航线列表
export function DjyTenantLineList(parameter) {
return axios({
url: '/DjyTenantLine/list',
method: 'get',
params: parameter
})
}
/**
* 保存租户航线
*
* @author Myshipping
*/
export function DjyTenantLineSave(parameter) {
return axios({
url: '/DjyTenantLine/save',
method: 'post',
data: parameter
})
}
/**
* 删除租户航线
*
* @author Myshipping
*/
export function DjyTenantLineDelete(parameter) {
return axios({
url: '/DjyTenantLine/delete',
method: 'post',
params: parameter
})
}

@ -0,0 +1,131 @@
<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="['lineName', { 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']" />
</a-form-item>
</a-col> -->
<!-- <a-col :span="12">
<a-form-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input-number placeholder="请输入排序" v-decorator="['sort']" />
</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']" />
</a-form-item>
</a-col> -->
</a-row>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import { DjyTenantLineSave } from '@/api/modular/main/djytenantline'
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])
}
}
DjyTenantLineSave(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="['lineName', { 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="请输入代码"
: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="['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']" />
</a-form-item>
</a-col> -->
<!-- <a-col :span="12">
<a-form-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input-number placeholder="请输入排序" v-decorator="['sort']" />
</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']" />
</a-form-item>
</a-col> -->
</a-row>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import { DjyTenantLineSave } from '@/api/modular/main/djytenantline'
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({
lineName: record.lineName
// code: record.code,
// enName: record.enName,
// cnName: record.cnName,
// description: record.description,
// sort: record.sort,
// 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])
}
}
values.id = this.data.id
console.log(values)
DjyTenantLineSave(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,339 @@
<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.SearchValue" 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> -->
<div class="nav-box">
<div class="nav" @click="$refs.addForm.add()"><i class="iconfont icon-jiahao2fill"></i>新建</div>
</div>
</template>
</vxe-toolbar>
<vxe-table :data="loadData" stripe resizable round :loading="loading" height="546" 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="120" align="center">
<template #default="{ row }">
<vxe-button type="text" @click="$refs.editForm.edit(row)">
<a-icon type="form" :style="{ color: '#13c2c2' }" />
</vxe-button>
<a-popconfirm
title="请确认删除?"
ok-text="是"
cancel-text="否"
@confirm="
e => {
confirm(e, row)
}
"
>
<vxe-button type="text">
<a-icon type="delete" :style="{ color: '#13c2c2' }" />
</vxe-button>
</a-popconfirm>
</template>
</vxe-column>
</vxe-table>
<vxe-pager
:current-page="queryParam.PageNo"
:page-size="queryParam.PageSize"
:total="queryParam.totalCount"
:layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
@page-change="handlePageChange1"
>
</vxe-pager>
<add-form ref="addForm" @ok="handleOk" />
<edit-form ref="editForm" @ok="handleOk" />
</a-card>
</div>
</template>
<script>
import { DjyTenantLinePage, DjyTenantLineDelete } from '@/api/modular/main/djytenantline'
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: {
PageNo: 1,
PageSize: 10,
totalCount: 0,
SortField: 'sort',
descSort: true
},
ColumnsQuery: [],
columns: [
{
title: '航线名称',
align: 'center',
width: '80',
dataIndex: 'lineName'
}
// {
// title: '',
// align: 'center',
// width: '80',
// dataIndex: 'code'
// },
// {
// title: '',
// align: 'center',
// width: '80',
// dataIndex: 'enName'
// },
// {
// title: '',
// align: 'center',
// width: '80',
// dataIndex: 'cnName'
// },
// {
// title: '',
// align: 'center',
// width: '80',
// dataIndex: 'remark'
// },
// {
// title: '',
// align: 'center',
// width: '80',
// dataIndex: 'description'
// }
// {
// title: '',
// align: 'center',
// width: '80',
// dataIndex: 'sort'
// }
],
tstyle: { 'padding-top': '12px', 'padding-bottom': '0px', 'margin-bottom': '10px' },
// Promise
loadData: [],
CodeData: [],
WCodeData: [],
ModulesData: [],
carrierCodeData: []
}
},
created() {},
mounted() {
this.init()
},
methods: {
confirm(e, data) {
DjyTenantLineDelete({ id: data.id }).then(res => {
if (res.success) {
this.$message.success('删除成功')
this.FnGetData()
} else {
this.$message.error(`删除失败,${res.message}`)
}
})
},
handlePageChange1({ currentPage, pageSize }) {
this.queryParam.PageNo = currentPage
this.queryParam.PageSize = pageSize
this.FnGetData()
},
toggleAdvanced() {
this.advanced = !this.advanced
},
init() {
Object.assign(this.$data, this.$options.data())
this.ColumnsQuery = this.columns
this.FnGetData()
},
FnGetData() {
this.loading = true
DjyTenantLinePage(this.queryParam).then(res => {
if (res.code == 200) {
this.loadData = res.data.rows
this.queryParam.totalCount = res.data.totalCount
} 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;
}
.vxe-table--render-default .vxe-body--row.row--stripe {
background: #f5f9fe;
}
.ant-card-body {
padding-top: 10px;
}
.nav-box {
padding: 0 10px;
.nav {
display: inline-block;
margin-right: 8px;
cursor: pointer;
border: 1px solid rgba(255, 255, 255, 0);
padding: 0 10px;
height: 28px;
line-height: 26px;
.iconfont {
margin-right: 6px;
}
&:hover {
border: 1px solid rgba(255, 255, 255, 0);
border-radius: 4px;
}
&:nth-of-type(1) {
.iconfont {
color: #1d8aff;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(2) {
.iconfont {
color: #865ef8;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(3) {
.iconfont {
color: #ff9702;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(4) {
.iconfont {
color: #1d8aff;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(5) {
.iconfont {
color: #ff1062;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(6) {
.iconfont {
color: #1ebeca;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(7) {
.iconfont {
color: #82c93d;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(8) {
.iconfont {
color: #1d8aff;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
}
}
</style>
Loading…
Cancel
Save