sunzehua 4 months ago
commit 6a2fe5987b

@ -126,13 +126,7 @@
}
id = ids[index + 1]
}
closePage()
go({
path: route.path,
query: {
id
}
})
closePage(route.path + '?id=' + id)
} else {
createMessage.warning('列表页面数据丢失,请回退列表页面后重试!')
}

@ -173,7 +173,7 @@
import DsPrint from '/@/components/Print/index.vue'
const [registerModal, { openModal }] = useModal()
const { createMessage } = useMessage()
const emits = defineEmits(['revoke', 'save', 'delete', 'cancel', 'refresh', 'history', 'selectInsert', 'submit'])
const emits = defineEmits(['revoke', 'save', 'delete', 'cancel', 'refresh', 'history', 'selectInsert', 'submit', 'add'])
const props = defineProps({
//
data: {
@ -213,6 +213,7 @@
}
props.data.push(deepCopyRow)
emits('add')
}
//
const copyRow = () => {

@ -21,6 +21,7 @@
@selectInsert="selectInsert"
@revoke="revoke"
@submit="submit"
@add="add"
></ActionBar>
</div>
<div>
@ -826,6 +827,13 @@
loading.value = false
})
}
//
const add = () => {
const hot = hotTb.value.hotInstance
nextTick(() => {
hot.selectCell(list.value.length - 1, 4)
})
}
onMounted(() => {
const hot = hotTb.value.hotInstance
hot.addHook('afterOnCellMouseDown', function (event, coords, TD) {})
@ -836,7 +844,7 @@
if (hot.getSelected()[0][0] == list.value.length - 1 && !hot.getActiveEditor()?._opened) {
list.value.push(JSON.parse(JSON.stringify(row)))
nextTick(() => {
hot.selectCell(list.value.length - 1, 3)
hot.selectCell(list.value.length - 1, 4)
})
return false
}

@ -1,6 +1,9 @@
.icon-locksuo {
.icon-locksuo, .icon-duihao1 {
color: #17a6a3;
}
.icon-lock-openkaisuo {
color: #7a8798;
.icon-lock-openkaisuo, .icon-chahao {
color: @msg-color;
}
.icon-bingtu3 {
color: #257afa;
}

@ -19,8 +19,7 @@ export function formatTableData(v) {
*/
export function closePage(topath) {
const tabStore = useMultipleTabStore()
// 当前路由
const fullPath = router?.currentRoute?._value?.fullPath
tabStore.closeTab(router.currentRoute._value, router)
// 有目标路径则跳转
if (topath) {
router.push(topath)

@ -5,7 +5,6 @@ enum Api {
list = '/mainApi/OrderContact/GetOrderContactList',
edit = '/mainApi/OrderContact/EditOrderContact',
info = '/mainApi/OrderContact/GetOrderContactInfo',
OrderContact = '/mainApi/OrderContact/GetOrderContactListByClientId',
Del = '/mainApi/OrderContact/BatchDelOrderContact',

@ -1999,10 +1999,19 @@ export function EditBusinessOrderContact(params) {
}
// 委托单位联系人详情
export function GetBusinessOrderContactInfo(data) {
export function GetBusinessOrderContactInfo(params) {
return request({
url: '/opApi/BusinessOrderContact/GetBusinessOrderContactInfo',
method: 'post',
data
method: 'get',
params
})
}
// 联系人下拉
export function GetOrderContactListByClientId(params) {
return request({
url: '/opApi/BusinessOrderContact/GetOrderContactListByClientId',
method: 'get',
params
})
}

@ -221,6 +221,7 @@ export const formSchema2: FormSchema[] = [
})
},
labelField: 'ediCode',
showName: 'portName',
valueField: 'id',
resultField: 'data',
filterOption: (input: string, option: any) => {

@ -33,6 +33,10 @@
EDI报文导出
<span class="iconfont icon-30jiantouxiangxiafill"></span>
</a-button>
<a-button type="link" @click="msg">
<span class="iconfont icon-xiaopiaodayin"></span>
打印
</a-button>
</div>
<div>
<a-button type="link" @click="create">
@ -215,12 +219,14 @@
resetFields2()
resetFields3()
resetFields4()
resetFields5()
formData.agentId = ''
formData.agentContent = ''
formData.cntrSealNo = ''
formData.description = ''
formData.marks = ''
setFieldsValue5({
...props.details
})
}
setFormValue()
}
@ -674,12 +680,14 @@
resetFields2()
resetFields3()
resetFields4()
resetFields5()
formData.agentId = ''
formData.agentContent = ''
formData.cntrSealNo = ''
formData.description = ''
formData.marks = ''
setFieldsValue5({
...props.details
})
createMessage.success('表单已置为新建状态!')
}
//

@ -3,13 +3,24 @@
v-bind="$attrs"
:use-wrapper="true"
:title="getTitle"
:form-schema="formSchema"
:form-schema="personFormSchema"
width="50%"
@register="registerModal"
@ok="handleSave"
>
<!-- 包装表单 -->
<BasicForm @register="registerForm" />
<BasicForm @register="registerForm">
<template #service="item">
<a-select show-search v-model:value="item.opid"
:default-active-first-option="false" :show-arrow="false" allowClear
:filter-option="false" :not-found-content="null"
>
<a-select-option v-for="item in personList" :key="item.id" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</template>
</BasicForm>
<!--右下角按钮-->
<template #footer>
<a-button
@ -47,10 +58,11 @@
//
import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index'
import { getDictOption } from '/@/utils/dictUtil'
//
import { personFormSchema } from './baseInfo'
//
import { EditBusinessOrderContact, GetBusinessOrderContactInfo } from '/@/views/operation/seaexport/api/BookingLedger'
import { EditBusinessOrderContact, GetBusinessOrderContactInfo, GetOrderContactListByClientId } from '/@/views/operation/seaexport/api/BookingLedger'
//
import { useMessage } from '/@/hooks/web/useMessage'
// Emits
@ -59,6 +71,8 @@
// loading
const loading = ref(false)
const rowId = ref('')
//
const personList = ref([])
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] =
useForm({
@ -68,6 +82,10 @@
})
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(async (data) => {
//
GetOrderContactListByClientId({ id: data.companyId }).then(res => {
personList.value = res.data
})
resetFields()
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
@ -82,7 +100,17 @@
})
}
} else {
setFieldsValue({ permissionIdentity: unref(2) })
//
const arr = await getDictOption('djy_cust_prop')
console.log(arr)
if (data.companyType) {
const res = arr.filter(item => {
return item.label == data.companyType
})
if (res && res.length) {
setFieldsValue({ customerType: res[0].value })
}
}
}
setModalProps({ loading: false })
})

@ -10,6 +10,7 @@ import {
GetDeptList,
GetPackageSelectList,
} from '/@/views/operation/seaexport/api/BookingLedger'
import { useOptionsStore } from '/@/store/modules/options'
const optionsStore = useOptionsStore()
const LockType = [
@ -414,7 +415,7 @@ export const basicInfoFormSchema: FormSchema[] = [
dynamicDisabled: false,
// defaultValue: '',
colProps: { span: 3 },
componentProps: () => {
componentProps: ({ formModel }) => {
return {
api: () => {
return new Promise((resolve) => {
@ -434,9 +435,22 @@ export const basicInfoFormSchema: FormSchema[] = [
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (e, obj) => {
if (obj) {
formModel.operatorName = obj.label
} else {
formModel.operatorName = ''
}
}
}
},
},
{
field: 'operatorName',
label: '',
component: 'Input',
show: false
},
{
label: '客服员',
field: 'customerService',
@ -445,7 +459,7 @@ export const basicInfoFormSchema: FormSchema[] = [
dynamicDisabled: false,
// defaultValue: '',
colProps: { span: 3 },
componentProps: () => {
componentProps: ({ formModel }) => {
return {
api: () => {
return new Promise((resolve) => {
@ -464,9 +478,22 @@ export const basicInfoFormSchema: FormSchema[] = [
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (e, obj) => {
if (obj) {
formModel.customerServiceName = obj.label
} else {
formModel.customerServiceName = ''
}
}
}
},
},
{
field: 'customerServiceName',
label: '',
component: 'Input',
show: false
},
{
label: '单证',
field: 'doc',
@ -475,7 +502,7 @@ export const basicInfoFormSchema: FormSchema[] = [
dynamicDisabled: false,
// defaultValue: '',
colProps: { span: 3 },
componentProps: () => {
componentProps: ({ formModel }) => {
return {
api: () => {
return new Promise((resolve) => {
@ -492,9 +519,22 @@ export const basicInfoFormSchema: FormSchema[] = [
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (e, obj) => {
if (obj) {
formModel.docName = obj.label
} else {
formModel.docName = ''
}
}
}
},
},
{
field: 'docName',
label: '',
component: 'Input',
show: false
},
{
label: '海外客服',
field: 'foreignCustomerService',
@ -503,7 +543,7 @@ export const basicInfoFormSchema: FormSchema[] = [
dynamicDisabled: false,
// defaultValue: '',
colProps: { span: 3 },
componentProps: () => {
componentProps: ({ formModel }) => {
return {
option: optionsStore.getOptionsByCode('GetSaleList'),
allowClear: true,
@ -513,9 +553,22 @@ export const basicInfoFormSchema: FormSchema[] = [
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (e, obj) => {
if (obj) {
formModel.foreignCustomerServiceName = obj.label
} else {
formModel.foreignCustomerServiceName = ''
}
}
}
},
},
{
field: 'foreignCustomerServiceName',
label: '',
component: 'Input',
show: false
},
{
field: 'saleDeptId',
label: '所属部门',
@ -532,9 +585,9 @@ export const basicInfoFormSchema: FormSchema[] = [
valueField: 'id',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
}
},
}
},
{
label: '所属分部',
@ -593,6 +646,7 @@ export const basicInfoFormSchema: FormSchema[] = [
{
field: 'truckerId',
label: '车队',
labelSlot: 'truckerId',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
@ -631,6 +685,7 @@ export const basicInfoFormSchema: FormSchema[] = [
{
label: '船公司',
field: 'carrierId',
labelSlot: 'carrierId',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
@ -670,6 +725,7 @@ export const basicInfoFormSchema: FormSchema[] = [
{
label: '订舱代理',
field: 'forwarderId',
labelSlot: 'forwarder',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
@ -711,6 +767,7 @@ export const basicInfoFormSchema: FormSchema[] = [
label: '船代',
field: 'shipAgencyId',
component: 'ApiSelect',
labelSlot: 'shipAgencyId',
required: false,
dynamicDisabled: false,
// defaultValue: '',
@ -753,6 +810,7 @@ export const basicInfoFormSchema: FormSchema[] = [
label: '场站',
component: 'ApiSelect',
required: false,
labelSlot: 'yardId',
dynamicDisabled: false,
// defaultValue: '',
colProps: { span: 3 },
@ -790,6 +848,7 @@ export const basicInfoFormSchema: FormSchema[] = [
field: 'customserId',
label: '报关行',
component: 'ApiSelect',
labelSlot: 'customserId',
required: false,
dynamicDisabled: false,
// defaultValue: '',
@ -2619,20 +2678,26 @@ export const personFormSchema: FormSchema[] = [
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
slot: 'service',
// defaultValue: '',
colProps: { span: 12 },
componentProps: () => {
return {
option: optionsStore.getOptionsByCode('GetServiceSelectList'),
allowClear: true,
showSearch: true,
labelField: 'enName',
valueField: 'id',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
}
// componentProps: () => {
// return {
// api: GetOrderContact,
// params: {
// id: ''
// },
// allowClear: true,
// showSearch: true,
// labelField: 'enName',
// resultField: 'data',
// valueField: 'id',
// immediate: false,
// filterOption: (input: string, option: any) => {
// return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
// },
// }
// }
},
{
label: '邮箱',

@ -22,8 +22,26 @@
<BasicForm @register="registerForm">
<!-- label插槽 -->
<template #customerId="item">
<span class="iconfont icon-tuandui" @click="openPersonModal(item)"></span>
<span class="iconfont icon-tuandui" @click="openPersonModal(item, '委托单位', 'customerId')"></span>
</template>
<!-- <template #truckerId>
<span class="iconfont icon-tuandui" @click="openPersonModal"></span>
</template>
<template #carrierId>
<span class="iconfont icon-tuandui" @click="openPersonModal"></span>
</template>
<template #forwarder>
<span class="iconfont icon-tuandui" @click="openPersonModal"></span>
</template>
<template #shipAgencyId>
<span class="iconfont icon-tuandui" @click="openPersonModal"></span>
</template>
<template #yardId>
<span class="iconfont icon-tuandui" @click="openPersonModal"></span>
</template> -->
<!-- <template #customserId>
<span class="iconfont icon-tuandui" @click="openPersonModal"></span>
</template> -->
<template #isBusinessLocking="item">
<a-input disabled :value="item.isBusinessLocking ? '已锁定' : '未锁定'"></a-input>
<span v-if="item.isBusinessLocking" class="iconfont icon-chenggong"></span>
@ -35,8 +53,9 @@
</BasicForm>
<a-modal
v-model:visible="visible"
title="费用模版"
title="关系人"
width="80%"
v-if="visible"
>
<BasicTable
@register="registerTable"
@ -94,8 +113,8 @@
size: 'small',
})
const visible = ref(false)
// id
let customerId = ''
// id
let companyId = ''
//
const [registerTable, { reload, getForm, getPaginationRef }] = useTable({
api: async (p) => {
@ -116,8 +135,8 @@
}
let condition: API.ConditionItem[] = []
condition.push({
FieldName: 'customerId',
FieldValue: customerId,
FieldName: 'businessId',
FieldValue: props.details.id,
ConditionalType: 1,
})
postParam.queryCondition = JSON.stringify(condition)
@ -131,10 +150,12 @@
showTableSetting: false,
bordered: true,
showIndexColumn: true,
rowSelection: {
type: 'checkbox'
},
canResize: false,
immediate: false,
actionColumn: {
width: 80,
width: 50,
title: '操作',
dataIndex: 'action',
fixed: 'right'
@ -153,22 +174,24 @@
})
RefChilrenRef.value.FnaddFormToSet(Arr)
}
//
let companyType = ''
//
const openPersonModal = (item) => {
console.log(item.values)
if (item?.values?.customerId) {
customerId = item.values.customerId
const openPersonModal = (item, type, field) => {
if (item?.values[field]) {
companyId = item.values[field]
} else {
return createMessage.warning('请选择委托单位!')
return createMessage.warning(`请选择${type}`)
}
companyType = type
visible.value = true
reload()
}
//
const create = () => {
openModal(true, {
isParent: false,
isUpdate: false,
companyType,
companyId
})
}
function handleSuccess() {
@ -179,6 +202,8 @@
openModal(true, {
record,
isUpdate: true,
companyType,
companyId
})
}
//

@ -47,7 +47,7 @@
<span
v-for="(serive, sindex) in bookingServiceItem"
class="items"
:class="{'item-active': serive.projectCode == projectCode}"
:class="{'item-active': serive.isYield}"
:key="sindex"
@click="saveService(serive)"
>
@ -660,9 +660,10 @@
)
function init() {
//
Getremark()
if (route.query.id && !route.query.isCopy) {
//
getServiceItemList(1, null)
getStatusServiceList(1, null)
} else {
@ -735,27 +736,22 @@
GetServiceProjectList(data).then((res) => {
if (res.success) {
bookingServiceItem.value = res.data.ext
// this.$bus.$emit('bookingServiceItem', res.data.ext)
emit('bookingServiceItem', res.data.ext)
} else {
createMessage.error(res.data.msg)
}
seriveLoading.value = false
})
}).chath
} else {
spinning.value = true
getStatusServiceList(1, null)
}
}
const projectCode = ref()
//
function saveService(data) {
projectCode.value = data.projectCode
var date = new Date()
console.log(date.valueOf())
if (!props.id) {
createMessage.error('请先保存主单')
createMessage.warning('请先保存主单')
return false
}
const obj = {

@ -52,6 +52,33 @@
<Icon icon="ant-design:copy-outlined" @click="FnCopy(record.mblno)" />
</div>
</template>
<!-- 应收开票 -->
<template v-if="column.dataIndex == 'arInvoiceStatus'">
<a-tooltip>
<template #title>{{ record.arInvoiceStatusName }}</template>
<i v-if="record.arInvoiceStatus == 2" class="iconfont icon-bingtu3"></i>
<i v-else-if="record.arInvoiceStatus == 1" class="iconfont icon-duihao1"></i>
<i v-else class="iconfont icon-chahao"></i>
</a-tooltip>
</template>
<!-- 应付开票 -->
<template v-if="column.dataIndex == 'apInvoiceStatus'">
<a-tooltip>
<template #title>{{ record.apInvoiceStatusName }}</template>
<i v-if="record.apInvoiceStatus == 2" class="iconfont icon-bingtu3"></i>
<i v-else-if="record.apInvoiceStatus == 1" class="iconfont icon-duihao1"></i>
<i v-else class="iconfont icon-chahao"></i>
</a-tooltip>
</template>
<!-- 应收对账 -->
<template v-if="column.dataIndex == 'arCheckStatus'">
<a-tooltip>
<template #title>{{ record.arCheckStatusName }}</template>
<i v-if="record.arCheckStatus == 2" class="iconfont icon-bingtu3"></i>
<i v-else-if="record.arCheckStatus == 1" class="iconfont icon-duihao1"></i>
<i v-else class="iconfont icon-chahao"></i>
</a-tooltip>
</template>
<!-- 业务锁定 -->
<template v-if="column.dataIndex == 'isBusinessLocking'">
<span v-if="record.isBusinessLocking">

@ -0,0 +1,84 @@
/*
* @Description:
* @Author: lijj
* @Date: 2024-04-25 15:48:33
*/
import { request } from '/@/utils/request'
import { DataResult, PageRequest } from '/@/api/model/baseModel'
enum Api {
list = '/mainApi/Print/GetOpenPrintTemplateList',
modalList = '/mainApi/Print/GetOpenPrintModuleList',
edit = '/mainApi/PrintTemplate//EditSysPrintModule',
temEidt = '/mainApi/PrintTemplate/EditSysPrintTemplate',
temInfo = '/mainApi/PrintTemplate/GetSysPrintTemplateInfo',
info = '/mainApi/PrintTemplate/GetSysPrintModuleInfo',
delete = '/mainApi/ClientParam/BatchDelClientParam',
GetTenantParamDataSelectList = '/mainApi/ClientParam/GetTenantParamDataSelectList'
}
// 列表 (Auth)
export function GetSysPrintTemplateList() {
return request<DataResult>({
url: Api.list,
method: 'get'
})
}
// 模块列表
export function GetPrintModuleList(params) {
return request<DataResult>({
url: Api.modalList,
method: 'get',
params
})
}
// 模块编辑 (Auth)
export function EditSysPrintModule(data: PageRequest) {
return request<DataResult>({
url: Api.edit,
method: 'post',
data
})
}
// 模块详情 (Auth)
export function GetSysPrintModuleInfo(query) {
return request<DataResult>({
url: Api.info,
method: 'get',
params: query
})
}
// 模版编辑
export function EditSysPrintTemplate(data: PageRequest) {
return request<DataResult>({
url: Api.temEidt,
method: 'post',
data
})
}
// 模版详情
export function GetSysPrintTemplateInfo(data: PageRequest) {
return request<DataResult>({
url: Api.temInfo,
method: 'post',
data
})
}
// 删除 (Auth)
export function BatchDelClientParam(data: PageRequest) {
return request<DataResult>({
url: Api.delete,
method: 'post',
data
})
}
export function GetTenantParamDataSelectList(query) {
return request<DataResult>({
url: Api.GetTenantParamDataSelectList,
method: 'get',
params: query
})
}

@ -0,0 +1,200 @@
/*
* @Description:
* @Author: lijj
* @Date: 2024-04-25 15:48:33
*/
import { ref } from 'vue'
import { BasicColumn, FormSchema } from '/@/components/Table'
import { useOptionsStore } from '/@/store/modules/options'
import { GetPrintModuleList } from './api'
const optionsStore = useOptionsStore()
const itemNameOption = ref([])
export const columns: BasicColumn[] = [
{
title: '模版名称',
dataIndex: 'templateName',
width: 200
},
{
title: '打印类型',
dataIndex: 'printType',
width: 120
},
{
title: '入口参数',
dataIndex: 'inParamColumn',
width: 200
},
{
title: '创建时间',
dataIndex: 'paramName',
width: 200
},
{
title: '备注',
dataIndex: 'note',
width: 200
}
]
export const searchFormSchema: FormSchema[] = [
{
field: 'templateName',
label: '模版名称',
colProps: { span: 6 },
component: 'Input'
},
]
export const formSchema: FormSchema[] = [
{
label: '',
field: 'id',
component: 'Input',
defaultValue: '',
show: false
},
{
field: 'moduleName',
label: '模块名称',
required: true,
component: 'Input',
colProps: { span: 12 }
},
{
field: 'moduleCode',
label: '模块编码',
required: true,
component: 'Input',
colProps: { span: 12 }
},
{
field: 'sortNo',
label: '排序',
component: 'Input',
colProps: { span: 12 }
},
{
field: 'disable',
label: '是否可用',
defaultValue: 0,
component: 'RadioButtonGroup',
colProps: { span: 12 },
componentProps: {
options: [
{ label: '禁用', value: 1 },
{ label: '启用', value: 0 }
]
}
},
{
field: 'note',
label: '备注',
component: 'InputTextArea',
colProps: { span: 24 }
}
]
export const temFormSchema: FormSchema[] = [
{
label: '',
field: 'id',
component: 'Input',
defaultValue: '',
show: false
},
{
field: 'moduleName',
label: '模版名称',
required: true,
component: 'Input',
colProps: { span: 12 }
},
{
field: 'printType',
label: '打印类型',
required: true,
component: 'Select',
colProps: { span: 12 },
componentProps: () => {
return {
options: [
{ label: 'PDF', value: 'PDF' },
{ label: 'EXCEL', value: 'EXCEL' },
{ label: 'WORD', value: 'WORD' },
],
allowClear: true,
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
{
label: '所属模块',
field: 'templateCode',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
// defaultValue: '',
colProps: { span: 12 },
componentProps: ({ formModel }) => {
return {
api: GetPrintModuleList,
allowClear: true,
showSearch: true,
labelField: 'moduleName',
valueField: 'moduleCode',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (e, obj) => {
if (obj) {
formModel.templateName = obj.label
formModel.moduleId = obj.id
} else {
formModel.templateName = ''
formModel.moduleId = ''
}
},
}
},
},
{
field: 'templateName',
label: '',
component: 'Input',
show: false
},
{
field: 'moduleId',
label: '',
component: 'Input',
show: false
},
{
field: 'isUseDataSource',
label: '是否使用数据源',
defaultValue: 0,
component: 'RadioButtonGroup',
colProps: { span: 12 },
componentProps: {
options: [
{ label: '是', value: 1 },
{ label: '否', value: 0 }
]
}
},
{
field: 'printJsonContent',
label: '打印设计内容',
component: 'InputTextArea',
colProps: { span: 24 },
componentProps: {
autoSize: { minRows: 3, maxRows: 20 }
}
}
]

@ -0,0 +1,110 @@
<template>
<BasicModal
v-bind="$attrs"
:use-wrapper="true"
:title="getTitle"
:form-schema="formSchema"
width="50%"
@register="registerModal"
@ok="handleSave"
>
<!-- 包装表单 -->
<BasicForm @register="registerForm" />
<!--右下角按钮-->
<template #footer>
<a-button
pre-icon="ant-design:close-outlined"
type="warning"
:loading="loading"
ghost
style="margin-right: 0.8rem"
@click="closeModal"
>
取消
</a-button>
<a-button
type="success"
:loading="loading"
pre-icon="ant-design:check-outlined"
style="margin-right: 0.8rem"
@click="handleSave(false)"
>
仅保存
</a-button>
<a-button
pre-icon="ant-design:check-circle-outlined"
type="primary"
:loading="loading"
@click="handleSave(true)"
>
保存并关闭
</a-button>
</template>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref } from 'vue'
//
import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index'
//
import { formSchema } from '../columns'
//
import { EditSysPrintModule, GetSysPrintModuleInfo } from '../api'
//
import { useMessage } from '/@/hooks/web/useMessage'
// Emits
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
// loading
const loading = ref(false)
const rowId = ref('')
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] =
useForm({
labelWidth: 100,
schemas: formSchema,
showActionButtonGroup: false,
})
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(async (data) => {
resetFields()
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
if (unref(isUpdate)) {
setModalProps({ confirmLoading: true });
updateFormField(updateSchema)
rowId.value = data.record.id
const res: API.DataResult = await GetSysPrintModuleInfo({ id: unref(rowId) })
if (res.succeeded) {
setFieldsValue({
...res.data,
})
}
} else {
setFieldsValue({ permissionIdentity: unref(2) })
}
setModalProps({ loading: false })
})
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'))
async function handleSave(exit) {
try {
const values = await validate()
loading.value = true
setModalProps({ confirmLoading: true, loading: true })
const res: API.DataResult = await EditSysPrintModule(values)
loading.value = false
if (res.succeeded) {
createMessage.success(res.message)
emit('success')
} else {
createMessage.error(res.message)
}
exit && closeModal()
} finally {
setModalProps({ confirmLoading: false, loading: false })
}
}
</script>

@ -0,0 +1,110 @@
<template>
<BasicModal
v-bind="$attrs"
:use-wrapper="true"
:title="getTitle"
:form-schema="formSchema"
width="50%"
@register="registerModal"
@ok="handleSave"
>
<!-- 包装表单 -->
<BasicForm @register="registerForm" />
<!--右下角按钮-->
<template #footer>
<a-button
pre-icon="ant-design:close-outlined"
type="warning"
:loading="loading"
ghost
style="margin-right: 0.8rem"
@click="closeModal"
>
取消
</a-button>
<a-button
type="success"
:loading="loading"
pre-icon="ant-design:check-outlined"
style="margin-right: 0.8rem"
@click="handleSave(false)"
>
仅保存
</a-button>
<a-button
pre-icon="ant-design:check-circle-outlined"
type="primary"
:loading="loading"
@click="handleSave(true)"
>
保存并关闭
</a-button>
</template>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref } from 'vue'
//
import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index'
//
import { temFormSchema } from '../columns'
//
import { EditSysPrintTemplate, GetSysPrintTemplateInfo } from '../api'
//
import { useMessage } from '/@/hooks/web/useMessage'
// Emits
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
// loading
const loading = ref(false)
const rowId = ref('')
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] =
useForm({
labelWidth: 100,
schemas: temFormSchema,
showActionButtonGroup: false,
})
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(async (data) => {
resetFields()
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
if (unref(isUpdate)) {
setModalProps({ confirmLoading: true });
updateFormField(updateSchema)
rowId.value = data.record.id
const res: API.DataResult = await GetSysPrintTemplateInfo({ id: unref(rowId) })
if (res.succeeded) {
setFieldsValue({
...res.data,
})
}
} else {
setFieldsValue({ permissionIdentity: unref(2) })
}
setModalProps({ loading: false })
})
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'))
async function handleSave(exit) {
try {
const values = await validate()
loading.value = true
setModalProps({ confirmLoading: true, loading: true })
const res: API.DataResult = await EditSysPrintTemplate(values)
loading.value = false
if (res.succeeded) {
createMessage.success(res.message)
emit('success')
} else {
createMessage.error(res.message)
}
exit && closeModal()
} finally {
setModalProps({ confirmLoading: false, loading: false })
}
}
</script>

@ -0,0 +1,219 @@
<template>
<div class="ds-print-tem">
<div class="flex">
<div class="opt">
<a-button
type="link"
@click="handleCreate"
>
<span class="iconfont icon-new_document"></span>
添加模块
</a-button>
<a-spin :spinning="mloading">
<div class="list-box">
<div v-for="item in modelList" :key="item.id" class="item" @click="toggleTable(item)">
<span class="count">{{ item.templateCount }}</span><span>{{ item.moduleName }}</span>
<span style="float: right" class="iconfont icon-bianji1" @click="handleEdit(item)"></span>
</div>
<img v-if="modelList.length == 0" src="../../../assets/images/nodata1.png" alt="">
</div>
</a-spin>
</div>
<BasicTable
class="ds-table"
@register="registerTable"
>
<template #toolbar>
<a-button type="link" @click="createTem">
<span class="iconfont icon-tianjia"></span>
新建
</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: 'clarity:note-edit-line',
tooltip: '编辑',
onClick: handleEdit.bind(null, record),
},
{
icon: 'ant-design:delete-outlined',
tooltip: '删除',
color: 'error',
popConfirm: {
title: '是否要删除此条数据?',
okText: '是',
cancelText: '否',
confirm: handleDelete.bind(null, record)
}
}
]"
/>
</template>
</template>
</BasicTable>
</div>
<!-- 新增模块弹窗 -->
<Modal @register="registerModal" @success="handleSuccess" />
<!-- 模版弹窗 -->
<temModal @register="registerTemModal" @success="temSuccess" />
</div>
</template>
<script lang="ts" setup>
import { onMounted, ref } from 'vue'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { formatParams } from '/@/hooks/web/common'
import { GetSysPrintTemplateList, GetPrintModuleList, BatchDelClientParam } from './api'
import { useModal } from '/@/components/Modal'
//
import Modal from './components/Modal.vue'
//
import temModal from './components/temModal.vue'
import { columns, searchFormSchema } from './columns'
import { useMessage } from '/@/hooks/web/useMessage'
const { notification } = useMessage()
//
const [registerModal, { openModal: openModal1 }] = useModal()
//
const [registerTemModal, { openModal: openModal2 }] = useModal()
//
const modelList = ref([])
const mloading = ref(false)
const [registerTable, { reload, getForm, getPaginationRef }] = useTable({
api: async (p) => {
const res: API.DataResult = await GetSysPrintTemplateList(p)
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
})
},
beforeFetch: (p) => {
if (modalId) {
p['id'] = modalId
}
initModel()
return formatParams(p)
},
columns,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
},
isTreeTable: false,
pagination: true,
striped: true,
useSearchForm: true,
showTableSetting: true,
bordered: true,
showIndexColumn: true,
canResize: false,
actionColumn: {
width: 80,
title: '操作',
dataIndex: 'action',
fixed: 'right',
},
})
//
const initModel = () => {
mloading.value = true
GetPrintModuleList().then(res => {
modelList.value = res.data
mloading.value = false
}).catch(() => {
mloading.value = false
})
}
//
function handleCreate() {
openModal1(true, {
isUpdate: false,
})
}
//
const createTem = () => {
openModal2(true, {
isUpdate: false,
})
}
//
function handleEdit(record) {
openModal1(true, {
record,
isUpdate: true,
})
}
// id
let modalId = ''
//
const toggleTable = (item) => {
modalId = item.id
reload()
}
//
async function handleDelete(record: Recordable) {
const res: API.DataResult = await BatchDelClientParam({
id: '',
ids: [record.id],
})
if (res.succeeded) {
notification.success({ message: res.message, duration: 3 })
reload()
} else {
notification.error({ message: res.message, duration: 3 })
}
}
onMounted(() => {
//
})
function handleSuccess() {
initModel()
}
const temSuccess = () => {
reload()
}
</script>
<style lang="less">
.ds-print-tem {
.opt {
padding: 10px;
}
.list-box {
border: 1px solid #E8EBED;
border-radius: 2px;
margin: 0 10px;
width: 210px;
padding: 16px 20px;
img {
margin: 20px 0 40px;
}
.item {
cursor: pointer;
}
}
.count {
width: 32px;
height: 20px;
border-radius: 2px;
background: #F5F9FC;
display: inline-block;
color: #257AFA;
text-align: center;
line-height: 19px;
margin-right: 8px;
margin-bottom: 8px;
}
.icon-bianji1 {
margin-top: 3px;
color: #257AFA;
display: none;
}
.item:hover {
.icon-bianji1 {
display: block;
}
}
}
</style>
Loading…
Cancel
Save