lilu 2 years ago
commit a70776ac82

@ -0,0 +1,52 @@
import { axios } from '@/utils/request'
/**
* 获取打印模板权限
*/
export function BookingTemplateGetPrinttemplateRightList(parameter) {
return axios({
url: '/BookingPrintTemplate/GetPrinttemplateRightList',
method: 'get',
params: parameter
})
}
/**
* 新增打印模板权限
*/
export function BookingTemplateAddPrinttemplateRight(parameter) {
return axios({
url: '/BookingPrintTemplate/AddPrinttemplateRight',
method: 'post',
data: parameter
})
}
/**
* 分页查询用户
*/
export function SysUserPage(parameter) {
return axios({
url: '/sysUser/page',
method: 'get',
params: { PageNo: 1, PageSize: 999 }
})
}
/**
* 获取订舱打印模板列表带有当前用户打印历史排序
*/
export function BookingPrintTemplatePage(parameter) {
return axios({
url: '/BookingPrintTemplate/page',
method: 'get',
params: { PageNo: 1, PageSize: 999 }
})
}
/**
* 获取订舱打印模板列表带有当前用户打印历史排序
*/
export function BookingPrintTemplateGetPrintTemplateList(parameter) {
return axios({
url: '/BookingPrintTemplate/GetPrintTemplateList',
method: 'get',
params: { PageNo: 1, PageSize: 999 }
})
}

@ -131,13 +131,25 @@
<div class="model-btn-list" v-if="modelType === 'initCabin'"> <div class="model-btn-list" v-if="modelType === 'initCabin'">
<a-button class="btn" @click="saveModel" :loading="SaveLoading">保存</a-button> <a-button class="btn" @click="saveModel" :loading="SaveLoading">保存</a-button>
<a-button class="btn" type="primary" @click="sendModel" :loading="SendLoading">发送</a-button> <a-button class="btn" type="primary" @click="sendModel" :loading="SendLoading">发送</a-button>
<a-button class="btn" type="primary" @click="removeModel" :loading="DelLoading" v-if="['initCabin'].includes(modelType)"> <a-button
class="btn"
type="primary"
@click="removeModel"
:loading="DelLoading"
v-if="['initCabin'].includes(modelType)"
>
删除 删除
</a-button> </a-button>
<template v-if="modelType === 'initCabin'"> <template v-if="modelType === 'initCabin'">
<a-button class="btn" type="primary" @click="downLoadFile(2, 'EXCEL')" :loading="downLoadEXCELLoading">EXCEL</a-button> <a-button class="btn" type="primary" @click="downLoadFile(2, 'EXCEL')" :loading="downLoadEXCELLoading"
<a-button class="btn" type="primary" @click="downLoadFile(1, 'PDF')" :loading="downLoadPDFLoading">PDF</a-button> >EXCEL</a-button
<a-button class="btn" type="primary" @click="downLoadFile(3, 'DOCX')" :loading="downLoadDOCXLoading">DOCX</a-button> >
<a-button class="btn" type="primary" @click="downLoadFile(1, 'PDF')" :loading="downLoadPDFLoading"
>PDF</a-button
>
<a-button class="btn" type="primary" @click="downLoadFile(3, 'DOCX')" :loading="downLoadDOCXLoading"
>DOCX</a-button
>
</template> </template>
</div> </div>
<a-form> <a-form>
@ -504,7 +516,7 @@
</a-form> </a-form>
<template slot="footer"> <template slot="footer">
<template v-if="['initCabin'].includes(modelType)"> <template v-if="['initCabin'].includes(modelType)">
<a-button @click="handleModelCancel" >关闭</a-button> <a-button @click="handleModelCancel"></a-button>
</template> </template>
<template v-else> <template v-else>
<a-button @click="saveModel" :loading="SaveLoading">保存</a-button> <a-button @click="saveModel" :loading="SaveLoading">保存</a-button>
@ -744,14 +756,6 @@ export default {
}, },
mounted() { mounted() {
this.BCvData = [...this.CvData] this.BCvData = [...this.CvData]
BookingOrderPrintTemplateList().then(res => {
this.templateType = []
res.data.forEach(item => {
if (item.isMain) {
this.templateType.push(item)
}
})
})
}, },
watch: { watch: {
scale() { scale() {
@ -887,6 +891,15 @@ export default {
}, },
// ========== ========== // ========== ==========
FSnhowPrintModal() { FSnhowPrintModal() {
BookingOrderPrintTemplateList().then(res => {
console.log(res.data)
this.templateType = []
res.data.forEach(item => {
if (item.isMain) {
this.templateType.push(item)
}
})
})
this.PrintModalVisible = true this.PrintModalVisible = true
}, },
FnCilckTemplateType(typeCode) { FnCilckTemplateType(typeCode) {
@ -1477,14 +1490,14 @@ export default {
return false return false
} }
const query = { const query = {
businessId: this.$route.query.id, businessId: this.$route.query.id,
mblno: this.details.mblno, mblno: this.details.mblno,
yard: this.traceValue.includes('1') ? this.details.yard : '', yard: this.traceValue.includes('1') ? this.details.yard : '',
yardCode: this.traceValue.includes('1') ? this.details.yardid : '', yardCode: this.traceValue.includes('1') ? this.details.yardid : '',
carrierid: this.traceValue.includes('2') ? this.details.carrierid : '', carrierid: this.traceValue.includes('2') ? this.details.carrierid : '',
carrier: this.traceValue.includes('2') ? this.details.carrier : '', carrier: this.traceValue.includes('2') ? this.details.carrier : '',
isBook: !!this.traceValue.includes('2') isBook: !!this.traceValue.includes('2')
} }
SendTrace([query]) SendTrace([query])
.then(res => { .then(res => {
if (res.success) { if (res.success) {
@ -1815,11 +1828,11 @@ export default {
.trace-check { .trace-check {
margin-left: 10px; margin-left: 10px;
} }
.model-btn-list{ .model-btn-list {
margin-bottom:15px; margin-bottom: 15px;
.btn{ .btn {
margin-right: 6px; margin-right: 6px;
&.ant-btn-primary{ &.ant-btn-primary {
color: #fff; color: #fff;
} }
} }

@ -62,16 +62,7 @@ export default {
PrintType: '1' PrintType: '1'
} }
}, },
mounted() { mounted() {},
BookingOrderPrintTemplateList().then(res => {
this.templateType = []
res.data.forEach(item => {
if (item.isSub) {
this.templateType.push(item)
}
})
})
},
methods: { methods: {
refreshPage() { refreshPage() {
this.$emit('refresh') this.$emit('refresh')
@ -87,11 +78,23 @@ export default {
this.$emit('copy') this.$emit('copy')
}, },
FSnhowPrintModal() { FSnhowPrintModal() {
this.PrintModalVisible = true if (this.details.id && this.details.id !== this.id) {
BookingOrderPrintTemplateList().then(res => {
this.templateType = []
res.data.forEach(item => {
if (item.isSub) {
this.templateType.push(item)
}
})
})
this.PrintModalVisible = true
} else {
this.$message.warning('请先保存分单')
}
}, },
FnCilckTemplateType(typeCode) { FnCilckTemplateType(typeCode) {
this.$message.success(`搜索文件中...`) this.$message.success(`搜索文件中...`)
BookingOrderPrint({ typeCode, bookingId: this.id, type: this.PrintType }) BookingOrderPrint({ typeCode, bookingId: this.details.id, type: this.PrintType })
.then(res => { .then(res => {
if (!res.success) { if (!res.success) {
this.$message.error(res.message) this.$message.error(res.message)

@ -109,6 +109,13 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row :style="{ marginLeft: '36px', marginRight: '33px' }">
<a-col :span="24">
<a-form-item label="提单信息" :labelCol="labelCol4" :wrapperCol="wrapperCol4" has-feedback>
<a-textarea v-decorator="['tidaninfo']" :auto-size="{ minRows: 3, maxRows: 5 }" />
</a-form-item>
</a-col>
</a-row>
<a-row class="from-box3"> <a-row class="from-box3">
<a-col :span="6"> <a-col :span="6">
<a-form-item class="from-label" label="销售人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item class="from-label" label="销售人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
@ -279,6 +286,10 @@ export default {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 2 } sm: { span: 2 }
}, },
labelCol4: {
xs: { span: 24 },
sm: { span: 1 }
},
wrapperCol: { wrapperCol: {
xs: { span: 25 }, xs: { span: 25 },
sm: { span: 16 } sm: { span: 16 }
@ -291,6 +302,10 @@ export default {
xs: { span: 25 }, xs: { span: 25 },
sm: { span: 22 } sm: { span: 22 }
}, },
wrapperCol4: {
xs: { span: 25 },
sm: { span: 23 }
},
typeData: [], typeData: [],
visible: false, visible: false,
confirmLoading: false, confirmLoading: false,

@ -104,6 +104,13 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row>
<a-col :span="18">
<a-form-item label="提单信息" :labelCol="labelCol3" :wrapperCol="wrapperCol3" has-feedback>
<a-textarea v-decorator="['tidaninfo']" :auto-size="{ minRows: 3, maxRows: 5 }" />
</a-form-item>
</a-col>
</a-row>
<a-row class="from-box3"> <a-row class="from-box3">
<a-col :span="6"> <a-col :span="6">
<a-form-item class="from-label" label="销售人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item class="from-label" label="销售人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>

@ -0,0 +1,133 @@
<template>
<a-modal
title="新增配置"
:width="800"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="24">
<a-form-item label="用户" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-select
placeholder="请选择用户"
v-decorator="['sysUserId', { rules: [{ required: true, message: '请选择用户!' }] }]"
>
<a-select-option v-for="item in UserList" :key="item.id" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="打印模板" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-select
placeholder="请选择打印模板"
mode="multiple"
v-decorator="['printTemplateId', { rules: [{ required: true, message: '请选择用户!' }] }]"
>
<a-select-option v-for="item in TemplateList" :key="item.id" :value="item.id">
{{ item.typeName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import {
BookingTemplateAddPrinttemplateRight,
SysUserPage,
BookingPrintTemplateGetPrintTemplateList
} from '@/api/modular/main/PrinttemplateRight'
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),
UserList: [],
TemplateList: []
}
},
mounted() {
SysUserPage().then(res => {
this.UserList = res.data.rows
})
BookingPrintTemplateGetPrintTemplateList().then(res => {
this.TemplateList = res.data.rows
})
},
methods: {
//
add(record) {
this.visible = true
},
/**
* 提交表单
*/
FnChangeCtnCategory(e) {
console.log(e)
},
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])
// }
// }
BookingTemplateAddPrinttemplateRight(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,139 @@
<template>
<a-modal
title="编辑配置"
:width="800"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="24">
<a-form-item label="用户" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-select
placeholder="请选择用户"
v-decorator="['sysUserId', { rules: [{ required: true, message: '请选择用户!' }] }]"
>
<a-select-option v-for="item in UserList" :key="item.id" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="打印模板" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-select
placeholder="请选择打印模板"
mode="multiple"
v-decorator="['printTemplateId', { rules: [{ required: true, message: '请选择用户!' }] }]"
>
<a-select-option v-for="item in TemplateList" :key="item.id" :value="item.id">
{{ item.typeName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import {
BookingTemplateAddPrinttemplateRight,
SysUserPage,
BookingPrintTemplateGetPrintTemplateList
} from '@/api/modular/main/PrinttemplateRight'
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() {
SysUserPage().then(res => {
this.UserList = res.data.rows
})
BookingPrintTemplateGetPrintTemplateList().then(res => {
this.TemplateList = res.data.rows
})
},
methods: {
//
edit(record) {
this.data = record
console.log(record)
this.visible = true
setTimeout(() => {
this.form.setFieldsValue({
sysUserId: record.sysUserId.toString(),
printTemplateId: record.printTemplateId
})
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)
BookingTemplateAddPrinttemplateRight(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,167 @@
<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-select placeholder="请选择用户" v-model="queryParam.userId">
<a-select-option v-for="item in UserList" :key="item.id" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</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 { BookingTemplateGetPrinttemplateRightList, SysUserPage } from '@/api/modular/main/PrinttemplateRight'
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',
dataIndex: 'fileName'
},
{
title: '类型名称',
align: 'center',
dataIndex: 'typeName'
},
{
title: '租户名称',
align: 'center',
dataIndex: 'tenantName'
}
],
tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
// Promise
loadData: [],
CodeData: [],
WCodeData: [],
ModulesData: [],
carrierCodeData: [],
UserList: []
}
},
created() {},
mounted() {
this.init()
},
methods: {
toggleAdvanced() {
this.advanced = !this.advanced
},
init() {
Object.assign(this.$data, this.$options.data())
this.ColumnsQuery = this.columns
this.FnGetData()
SysUserPage().then(res => {
this.UserList = res.data.rows
})
},
FnGetData() {
this.loading = true
BookingTemplateGetPrinttemplateRightList(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