打印模板 及其他问题调整

szh-new
张同海 2 months ago
parent 81702e466f
commit 9aa09de7d8

@ -78,7 +78,9 @@
setModalProps({ loading: false }) setModalProps({ loading: false })
}) })
const getTitle = computed(() => (!unref(isUpdate) ? '新增EDI设置' : '编辑EDI设置')) const getTitle = computed(() =>
!unref(isUpdate) ? '新增订舱货物状态管理' : '编辑订舱货物状态管理',
)
async function handleSave(exit) { async function handleSave(exit) {
try { try {

@ -265,19 +265,27 @@
data: 'unit', data: 'unit',
type: 'dropdown', type: 'dropdown',
source: async (query, process) => { source: async (query, process) => {
if (unitDict.value && unitDict.value.length) { // if (unitDict.value && unitDict.value.length) {
const dict = unitDict.value.map((item) => { // const dict = unitDict.value.map((item) => {
return item.value + '-' + item.name // return item.value + '-' + item.name
}) // })
process(dict) // process(dict)
} else { // } else {
const results = await feeUnitDict() // const results = await feeUnitDict()
unitDict.value = results // unitDict.value = results
const dict = results.map((item) => { // const dict = results.map((item) => {
return item.value + '-' + item.name // return item.value + '-' + item.name
// })
// process(dict)
// }
const results = [
{ label: '20GP', name: '20GP', value: '22G0' },
{ label: '40GP', name: '40GP', value: '42G0' },
]
const dict = results.map((res) => {
return res.label
}) })
process(dict) process(dict)
}
}, },
}, },
{ {

@ -417,7 +417,7 @@ export const searchFormSchema: FormSchema[] = [
label: '客户属性', label: '客户属性',
field: 'clientTag', field: 'clientTag',
component: 'ApiSelect', component: 'ApiSelect',
colProps: { span: 8 }, colProps: { span: 4 },
componentProps: () => { componentProps: () => {
return { return {
api: () => { api: () => {
@ -515,6 +515,19 @@ export const searchFormSchema: FormSchema[] = [
} }
}, },
}, },
{
field: 'auditStatus',
label: '审批状态',
component: 'Select',
colProps: { span: 4 },
componentProps: {
options: [
{ label: '待审批', value: 0 },
{ label: '审核通过', value: 1 },
{ label: '驳回', value: 2 },
],
},
},
] ]
export const formSchema: FormSchema[] = [ export const formSchema: FormSchema[] = [

@ -7,33 +7,45 @@
import { request } from '/@/utils/request' import { request } from '/@/utils/request'
import { DataResult, PageRequest } from '/@/api/model/baseModel' import { DataResult, PageRequest } from '/@/api/model/baseModel'
enum Api { enum Api {
list = '/mainApi/Print/GetOpenPrintTemplateList', // list = '/mainApi/Print/GetOpenPrintTemplateList',
modalList = '/mainApi/Print/GetOpenPrintModuleList', // modalList = '/mainApi/Print/GetOpenPrintModuleList',
edit = '/mainApi/PrintTemplate//EditSysPrintModule', // edit = '/mainApi/PrintTemplate//EditSysPrintModule',
// temEidt = '/mainApi/PrintTemplate/EditSysPrintTemplate',
// temInfo = '/mainApi/PrintTemplate/GetSysPrintTemplateInfo',
// info = '/mainApi/PrintTemplate/GetSysPrintModuleInfo',
// delete = '/mainApi/ClientParam/BatchDelClientParam',
// GetTenantParamDataSelectList = '/mainApi/ClientParam/GetTenantParamDataSelectList',
// GetOpenSqlPrintInfo = '/printApi/OpenPrint/GetOpenSqlPrintInfo',
// DownLoadSqlPrintFile = '/printApi/OpenPrint/DownLoadSqlPrintFile'
// ---------------------------
list = '/mainApi/PrintTemplate/GetPrintModuleList',
modalList = '/mainApi/PrintTemplate/GetSysPrintTemplateList',
edit = '/mainApi/PrintTemplate/EditSysPrintModule',
temEidt = '/mainApi/PrintTemplate/EditSysPrintTemplate', temEidt = '/mainApi/PrintTemplate/EditSysPrintTemplate',
temInfo = '/mainApi/PrintTemplate/GetSysPrintTemplateInfo', temInfo = '/mainApi/PrintTemplate/GetSysPrintTemplateInfo',
info = '/mainApi/PrintTemplate/GetSysPrintModuleInfo', info = '/mainApi/PrintTemplate/GetSysPrintModuleInfo',
delete = '/mainApi/ClientParam/BatchDelClientParam', delete = '/mainApi/PrintTemplate/BatchDelPrintTemplate',
GetTenantParamDataSelectList = '/mainApi/ClientParam/GetTenantParamDataSelectList', GetTenantParamDataSelectList = '/mainApi/ClientParam/GetTenantParamDataSelectList',
GetOpenSqlPrintInfo = '/printApi/OpenPrint/GetOpenSqlPrintInfo', GetOpenSqlPrintInfo = '/printApi/OpenPrint/GetOpenSqlPrintInfo',
DownLoadSqlPrintFile = '/printApi/OpenPrint/DownLoadSqlPrintFile' DownLoadSqlPrintFile = '/printApi/OpenPrint/DownLoadSqlPrintFile'
} }
// 模版列表 (Auth) // 模块列表
export function GetSysPrintTemplateList(data) { export function GetPrintModuleList(data) {
return request<DataResult>({ return request<DataResult>({
url: Api.list, url: Api.list,
method: 'post', method: 'post',
data data
}) })
} }
// 模块列表 // 模版列表 (Auth)
export function GetPrintModuleList(params) { export function GetSysPrintTemplateList(data) {
return request<DataResult>({ return request<DataResult>({
url: Api.modalList, url: Api.modalList,
method: 'get', method: 'post',
params data
}) })
} }
// 模块编辑 (Auth) // 模块编辑 (Auth)
export function EditSysPrintModule(data: PageRequest) { export function EditSysPrintModule(data: PageRequest) {
return request<DataResult>({ return request<DataResult>({

@ -6,33 +6,34 @@
import { BasicColumn, FormSchema } from '/@/components/Table' import { BasicColumn, FormSchema } from '/@/components/Table'
import { GetPrintModuleList } from './api' import { GetPrintModuleList } from './api'
import { GetCarrierSelectList } from '/@/api/common' import { GetCarrierSelectList } from '/@/api/common'
import { max } from 'lodash'
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
title: '模版名称', title: '模版名称',
dataIndex: 'templateName', dataIndex: 'templateName',
width: 200 width: 200,
}, },
{ {
title: '打印类型', title: '打印类型',
dataIndex: 'printType', dataIndex: 'printType',
width: 120 width: 120,
}, },
{ {
title: '船公司', title: '船公司',
dataIndex: 'carrierName', dataIndex: 'carrierName',
width: 150 width: 150,
}, },
{ {
title: '入口参数', title: '入口参数',
dataIndex: 'inParamColumn', dataIndex: 'inParamColumn',
width: 200 width: 200,
}, },
{ {
title: '备注', title: '备注',
dataIndex: 'note', dataIndex: 'note',
width: 200 width: 200,
} },
] ]
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
@ -40,7 +41,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'templateName', field: 'templateName',
label: '模版名称', label: '模版名称',
colProps: { span: 6 }, colProps: { span: 6 },
component: 'Input' component: 'Input',
}, },
] ]
export const formSchema: FormSchema[] = [ export const formSchema: FormSchema[] = [
@ -49,27 +50,30 @@ export const formSchema: FormSchema[] = [
field: 'id', field: 'id',
component: 'Input', component: 'Input',
defaultValue: '', defaultValue: '',
show: false show: false,
}, },
{ {
field: 'moduleName', field: 'moduleName',
label: '模块名称', label: '模块名称',
required: true, required: true,
component: 'Input', component: 'Input',
colProps: { span: 12 } colProps: { span: 12 },
}, },
{ {
field: 'moduleCode', field: 'moduleCode',
label: '模块编码', label: '模块编码',
required: true, required: true,
component: 'Input', component: 'Input',
colProps: { span: 12 } colProps: { span: 12 },
componentProps: {
maxlength: 4,
},
}, },
{ {
field: 'sortNo', field: 'sortNo',
label: '排序', label: '排序',
component: 'Input', component: 'Input',
colProps: { span: 12 } colProps: { span: 12 },
}, },
{ {
field: 'disable', field: 'disable',
@ -81,9 +85,9 @@ export const formSchema: FormSchema[] = [
componentProps: { componentProps: {
options: [ options: [
{ label: '禁用', value: 1 }, { label: '禁用', value: 1 },
{ label: '启用', value: 0 } { label: '启用', value: 0 },
] ],
} },
}, },
{ {
field: 'note', field: 'note',
@ -91,33 +95,32 @@ export const formSchema: FormSchema[] = [
component: 'InputTextArea', component: 'InputTextArea',
colProps: { span: 24 }, colProps: { span: 24 },
componentProps: { componentProps: {
autoSize: { minRows: 5, maxRows: 5 } autoSize: { minRows: 5, maxRows: 5 },
} },
} },
] ]
export const temFormSchema: FormSchema[] = [ export const temFormSchema: FormSchema[] = [
{ {
label: '', label: '',
field: 'id', field: 'id',
component: 'Input', component: 'Input',
defaultValue: '', defaultValue: '',
show: false show: false,
}, },
{ {
field: 'templateName', field: 'templateName',
label: '模版名称', label: '模版名称',
required: true, required: true,
component: 'Input', component: 'Input',
colProps: { span: 12 } colProps: { span: 12 },
}, },
{ {
field: 'templateCode', field: 'templateCode',
label: '模版编码', label: '模版编码',
required: true, required: true,
component: 'Input', component: 'Input',
colProps: { span: 12 } colProps: { span: 12 },
}, },
{ {
label: '', label: '',
@ -150,9 +153,9 @@ export const temFormSchema: FormSchema[] = [
formModel.carrierId = null formModel.carrierId = null
formModel.carrierName = null formModel.carrierName = null
} }
},
} }
} },
}
}, },
{ {
field: 'printType', field: 'printType',
@ -180,7 +183,7 @@ export const temFormSchema: FormSchema[] = [
field: 'moduleCode', field: 'moduleCode',
label: '', label: '',
component: 'Input', component: 'Input',
show: false show: false,
}, },
{ {
label: '所属模块', label: '所属模块',
@ -203,7 +206,7 @@ export const temFormSchema: FormSchema[] = [
}, },
onChange: (v, obj) => { onChange: (v, obj) => {
if (obj) formModel.moduleCode = obj.moduleCode if (obj) formModel.moduleCode = obj.moduleCode
} },
} }
}, },
}, },
@ -211,13 +214,13 @@ export const temFormSchema: FormSchema[] = [
field: 'templateName', field: 'templateName',
label: '', label: '',
component: 'Input', component: 'Input',
show: false show: false,
}, },
{ {
field: 'moduleId', field: 'moduleId',
label: '', label: '',
component: 'Input', component: 'Input',
show: false show: false,
}, },
{ {
field: 'isUseDataSource', field: 'isUseDataSource',
@ -229,9 +232,9 @@ export const temFormSchema: FormSchema[] = [
componentProps: { componentProps: {
options: [ options: [
{ label: '是', value: 1 }, { label: '是', value: 1 },
{ label: '否', value: 0 } { label: '否', value: 0 },
] ],
} },
}, },
{ {
field: 'sqlModel', field: 'sqlModel',
@ -241,7 +244,7 @@ export const temFormSchema: FormSchema[] = [
colProps: { span: 6 }, colProps: { span: 6 },
show: ({ values }) => { show: ({ values }) => {
return values.isUseDataSource && values.id return values.isUseDataSource && values.id
} },
}, },
{ {
field: 'downModel', field: 'downModel',
@ -251,7 +254,7 @@ export const temFormSchema: FormSchema[] = [
colProps: { span: 6 }, colProps: { span: 6 },
show: ({ values }) => { show: ({ values }) => {
return values.isUseDataSource && values.id return values.isUseDataSource && values.id
} },
}, },
{ {
field: 'sourceSql', field: 'sourceSql',
@ -260,11 +263,11 @@ export const temFormSchema: FormSchema[] = [
colProps: { span: 24 }, colProps: { span: 24 },
componentProps: { componentProps: {
autoSize: { minRows: 3, maxRows: 20 }, autoSize: { minRows: 3, maxRows: 20 },
disTrans: true disTrans: true,
}, },
show: ({ values }) => { show: ({ values }) => {
return values.isUseDataSource return values.isUseDataSource
} },
}, },
{ {
field: 'inParamColumn', field: 'inParamColumn',
@ -273,7 +276,7 @@ export const temFormSchema: FormSchema[] = [
colProps: { span: 12 }, colProps: { span: 12 },
show: ({ values }) => { show: ({ values }) => {
return values.isUseDataSource return values.isUseDataSource
} },
}, },
{ {
field: 'groupBy', field: 'groupBy',
@ -282,7 +285,7 @@ export const temFormSchema: FormSchema[] = [
colProps: { span: 12 }, colProps: { span: 12 },
show: ({ values }) => { show: ({ values }) => {
return values.isUseDataSource return values.isUseDataSource
} },
}, },
{ {
field: 'columnView', field: 'columnView',
@ -290,11 +293,11 @@ export const temFormSchema: FormSchema[] = [
component: 'InputTextArea', component: 'InputTextArea',
colProps: { span: 24 }, colProps: { span: 24 },
componentProps: { componentProps: {
autoSize: { minRows: 3, maxRows: 20 } autoSize: { minRows: 3, maxRows: 20 },
}, },
show: ({ values }) => { show: ({ values }) => {
return values.isUseDataSource return values.isUseDataSource
} },
}, },
{ {
field: 'printJsonContent', field: 'printJsonContent',
@ -303,7 +306,7 @@ export const temFormSchema: FormSchema[] = [
colProps: { span: 24 }, colProps: { span: 24 },
componentProps: { componentProps: {
autoSize: { minRows: 5, maxRows: 20 }, autoSize: { minRows: 5, maxRows: 20 },
disTrans: true disTrans: true,
} },
} },
] ]

@ -1,34 +1,33 @@
<template> <template>
<div class="ds-print-tem"> <div class="ds-print-tem">
<BasicTable <BasicTable class="ds-table-detail" @register="registerTable">
class="ds-table-detail"
@register="registerTable"
>
<template #left> <template #left>
<div class="opt"> <div class="opt">
<a-button <a-button type="link" @click="handleCreate">
type="link"
@click="handleCreate"
>
<span class="iconfont icon-new_document"></span> <span class="iconfont icon-new_document"></span>
添加模块 添加模块
</a-button> </a-button>
<a-spin :spinning="mloading"> <a-spin :spinning="mloading">
<div class="list-box"> <div class="list-box">
<div v-for="item in modelList" :key="item.id" class="item"> <div v-for="item in modelList" :key="item.id" class="item">
<span :class="{active: item.id == moduleId}" @click="toggleTable(item)"><span class="count">{{ item.templateCount }}</span><span>{{ item.moduleName }}</span></span> <span :class="{ active: item.id == moduleId }" @click="toggleTable(item)"
<span style="float: right" class="iconfont icon-bianji1" @click="handleEdit(item)"></span> ><span class="count">{{ item.moduleCode }}</span
><span>{{ item.moduleName }}</span></span
>
<span
style="float: right"
class="iconfont icon-bianji1"
@click="handleEdit(item)"
></span>
</div> </div>
<img v-if="modelList.length == 0" src="../../../assets/images/nodata1.png" alt=""> <img v-if="modelList.length == 0" src="../../../assets/images/nodata1.png" alt="" />
</div> </div>
</a-spin> </a-spin>
</div> </div>
</template> </template>
<template #tableTitle> <template #tableTitle>
<h4 style="margin: 0 10px 0 -5px;"> <h4 style="margin: 0 10px 0 -5px"> 打印模版列表 </h4>
打印模版列表
</h4>
<a-button type="link" @click="createTem"> <a-button type="link" @click="createTem">
<span class="iconfont icon-tianjia"></span> <span class="iconfont icon-tianjia"></span>
新建 新建
@ -51,9 +50,9 @@
title: '是否要删除此条数据?', title: '是否要删除此条数据?',
okText: '是', okText: '是',
cancelText: '否', cancelText: '否',
confirm: handleDelete.bind(null, record) confirm: handleDelete.bind(null, record),
} },
} },
]" ]"
/> />
</template> </template>
@ -83,19 +82,31 @@
// //
const [registerTemModal, { openModal: openModal2 }] = useModal() const [registerTemModal, { openModal: openModal2 }] = useModal()
const mloading = ref(false) const mloading = ref(false)
//
const modelList = ref<any>([])
// //
const initModel = () => { const initModel = () => {
modelList.value.splice(0)
mloading.value = true mloading.value = true
GetPrintModuleList().then(res => { let ApiData = {
modelList.value = res.data queryCondition: '[]',
pageCondition: { pageIndex: 1, pageSize: 999, sortConditions: [] },
}
GetPrintModuleList(ApiData)
.then((res) => {
res.data.forEach((item) => {
modelList.value.push(item)
})
moduleId.value = res.data[0].id
reload()
mloading.value = false mloading.value = false
}).catch(() => { })
.catch(() => {
mloading.value = false mloading.value = false
}) })
} }
initModel() initModel()
//
const modelList = ref([])
const [registerTable, { reload, getForm, getPaginationRef }] = useTable({ const [registerTable, { reload, getForm, getPaginationRef }] = useTable({
api: async (p) => { api: async (p) => {
const res: API.DataResult = await GetSysPrintTemplateList(p) const res: API.DataResult = await GetSysPrintTemplateList(p)
@ -122,6 +133,7 @@
showIndexColumn: true, showIndexColumn: true,
canResize: true, canResize: true,
resizeHeightOffset: 15, resizeHeightOffset: 15,
immediate: false,
actionColumn: { actionColumn: {
width: 80, width: 80,
title: '操作', title: '操作',
@ -165,7 +177,7 @@
// //
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
const res: API.DataResult = await BatchDelClientParam({ const res: API.DataResult = await BatchDelClientParam({
id: '', id: moduleId.value,
ids: [record.id], ids: [record.id],
}) })
if (res.succeeded) { if (res.succeeded) {
@ -187,7 +199,7 @@
</script> </script>
<style lang="less"> <style lang="less">
.ds-print-tem { .ds-print-tem {
padding-right: 5px; padding-right: 5px;
.opt { .opt {
padding: 10px; padding: 10px;
@ -196,7 +208,7 @@
justify-content: space-between; justify-content: space-between;
} }
.list-box { .list-box {
border: 1px solid #E8EBED; border: 1px solid #e8ebed;
border-radius: 2px; border-radius: 2px;
margin: 6px 10px 0; margin: 6px 10px 0;
width: 210px; width: 210px;
@ -212,9 +224,9 @@
width: 32px; width: 32px;
height: 20px; height: 20px;
border-radius: 2px; border-radius: 2px;
background: #F5F9FC; background: #f5f9fc;
display: inline-block; display: inline-block;
color: #257AFA; color: #257afa;
text-align: center; text-align: center;
line-height: 19px; line-height: 19px;
margin-right: 8px; margin-right: 8px;
@ -222,7 +234,7 @@
} }
.icon-bianji1 { .icon-bianji1 {
margin-top: 3px; margin-top: 3px;
color: #257AFA; color: #257afa;
display: none; display: none;
} }
.item:hover { .item:hover {
@ -231,11 +243,13 @@
} }
} }
.active { .active {
span {color: #257AFA;} span {
color: #257afa;
}
.count { .count {
background: #257AFA; background: #257afa;
color: #ffffff; color: #ffffff;
} }
} }
} }
</style> </style>
Loading…
Cancel
Save