Compare commits

...

2 Commits

@ -47,7 +47,13 @@
import { ref, computed, unref } from 'vue'
import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index'
import { formSchema, ReceiverformSchema, SenderformSchema, CcformSchema } from './columns'
import {
formSchema,
ReceiverformSchema,
SenderformSchema,
CcformSchema,
ArrclientTag,
} from './columns'
import { ApiEdit, ApiInfo, GetPrintTemplateList } from './api'
import { useMessage } from '/@/hooks/web/useMessage'
// Emits
@ -209,9 +215,23 @@
} else {
updateSchema({ field: 'name', required: false })
}
ReceiverSetFieldsValue({
...res.data.receiver,
if (res.data.receivers.length) {
let WebReceiver = {
taskMailId: '',
carrier: false,
booking: false,
yard: false,
truck: false,
controller: false,
shipperCn: false,
}
res.data.receivers.forEach((item) => {
WebReceiver.taskMailId = item.taskMailId
WebReceiver[item.value] = true
})
ReceiverSetFieldsValue(WebReceiver)
}
SenderSetFieldsValue({
...res.data.sender,
})
@ -264,8 +284,21 @@
})
values.attachments = attachments
values.receiver = await ReceiverValidate()
values.receiver.taskMailId = values.id
values.receivers = []
let Webreceivers = await ReceiverValidate()
console.log(ArrclientTag)
ArrclientTag.forEach((item) => {
if (Webreceivers[item.value]) {
values.receivers.push({
id: '',
taskMailId: values.id,
value: item.value,
name: item.name,
})
}
})
// values.receivers = await ReceiverValidate()
// values.receivers.taskMailId = values.id
values.sender = await SenderValidate()
values.sender.taskMailId = values.id
values.cc = await CcValidate()
@ -339,9 +372,22 @@
} else {
updateSchema({ field: 'name', required: false })
}
ReceiverSetFieldsValue({
...res.data.receiver,
if (res.data.receivers.length) {
let WebReceiver = {
taskMailId: '',
carrier: false,
booking: false,
yard: false,
truck: false,
controller: false,
shipperCn: false,
}
res.data.receivers.forEach((item) => {
WebReceiver.taskMailId = item.taskMailId
WebReceiver[item.value] = true
})
ReceiverSetFieldsValue(WebReceiver)
}
SenderSetFieldsValue({
...res.data.sender,
})

@ -9,6 +9,7 @@ enum Api {
delfile = '/opApi/TaskMail/DeleteAttachments',
PrintTemplateList = '/mainApi/Print/GetOpenPrintTemplateList',
GetProviders = '/opApi/TaskMail/GetProviders',
}
// 列表 (Auth)
export function ApiList(data: PageRequest) {
@ -58,3 +59,11 @@ export function GetPrintTemplateList(data: PageRequest) {
data,
})
}
// 获取数据提供程序 (Auth)
export function ApiGetProviders(query) {
return request<DataResult>({
url: Api.GetProviders,
method: 'get',
params: query,
})
}

@ -1,9 +1,27 @@
import { BasicColumn, FormSchema } from '/@/components/Table'
// 字典
import { getDictOption } from '/@/utils/dictUtil'
import { GetPrintTemplateList, ApiDelFile } from './api.ts'
import { GetPrintTemplateList, ApiDelFile, ApiGetProviders } from './api.ts'
let documentTypeList = []
let attachmentsData = []
let Receiver: any = []
export const ArrclientTag = await getDictOption('infoclient-ArrclientTag')
ArrclientTag.forEach((item) => {
Receiver.push({
field: item.value,
label: `是否${item.name}`,
component: 'Switch',
colProps: { span: 6 },
defaultValue: false,
componentProps: {
checkedChildren: '是',
checkedValue: true,
unCheckedChildren: '否',
unCheckedValue: false,
},
})
})
export const columns: BasicColumn[] = [
{
title: '名称',
@ -248,6 +266,22 @@ export const formSchema: FormSchema[] = [
}
},
},
{
field: 'providerId',
label: '数据源提供程序',
component: 'ApiSelect',
colProps: { span: 6 },
componentProps: ({ formActionType }) => {
return {
api: ApiGetProviders,
labelField: 'name',
valueField: 'id',
allowClear: true,
showSearch: true,
resultField: 'data',
}
},
},
{
field: 'note',
label: '备注',
@ -276,7 +310,7 @@ export const formSchema: FormSchema[] = [
},
},
]
export const ReceiverformSchema: FormSchema[] = [
export let ReceiverformSchema: FormSchema[] = [
{
field: 'ReceiverDivider',
component: 'Divider',
@ -290,84 +324,85 @@ export const ReceiverformSchema: FormSchema[] = [
defaultValue: '',
show: false,
},
{
field: 'isCarrier',
label: '是否船公司',
component: 'Switch',
colProps: { span: 6 },
defaultValue: false,
componentProps: {
checkedChildren: '是',
checkedValue: true,
unCheckedChildren: '否',
unCheckedValue: false,
},
},
{
field: 'isBooking',
label: '是否订舱公司 ',
component: 'Switch',
colProps: { span: 6 },
defaultValue: false,
componentProps: {
checkedChildren: '是',
checkedValue: true,
unCheckedChildren: '否',
unCheckedValue: false,
},
},
{
field: 'isYard',
label: '是否场站',
component: 'Switch',
colProps: { span: 6 },
defaultValue: false,
componentProps: {
checkedChildren: '是',
checkedValue: true,
unCheckedChildren: '否',
unCheckedValue: false,
},
},
{
field: 'isTruck',
label: '是否车队',
component: 'Switch',
colProps: { span: 6 },
defaultValue: false,
componentProps: {
checkedChildren: '是',
checkedValue: true,
unCheckedChildren: '否',
unCheckedValue: false,
},
},
{
field: 'isController',
label: '是否委托单位',
component: 'Switch',
colProps: { span: 6 },
defaultValue: false,
componentProps: {
checkedChildren: '是',
checkedValue: true,
unCheckedChildren: '否',
unCheckedValue: false,
},
},
{
field: 'isShipperCn',
label: '是否国内发货人',
component: 'Switch',
colProps: { span: 6 },
defaultValue: false,
componentProps: {
checkedChildren: '是',
checkedValue: true,
unCheckedChildren: '否',
unCheckedValue: false,
},
},
...Receiver,
// {
// field: 'carrier',
// label: '是否船公司',
// component: 'Switch',
// colProps: { span: 6 },
// defaultValue: false,
// componentProps: {
// checkedChildren: '是',
// checkedValue: true,
// unCheckedChildren: '否',
// unCheckedValue: false,
// },
// },
// {
// field: 'booking',
// label: '是否订舱公司 ',
// component: 'Switch',
// colProps: { span: 6 },
// defaultValue: false,
// componentProps: {
// checkedChildren: '是',
// checkedValue: true,
// unCheckedChildren: '否',
// unCheckedValue: false,
// },
// },
// {
// field: 'yard',
// label: '是否场站',
// component: 'Switch',
// colProps: { span: 6 },
// defaultValue: false,
// componentProps: {
// checkedChildren: '是',
// checkedValue: true,
// unCheckedChildren: '否',
// unCheckedValue: false,
// },
// },
// {
// field: 'truck',
// label: '是否车队',
// component: 'Switch',
// colProps: { span: 6 },
// defaultValue: false,
// componentProps: {
// checkedChildren: '是',
// checkedValue: true,
// unCheckedChildren: '否',
// unCheckedValue: false,
// },
// },
// {
// field: 'controller',
// label: '是否委托单位',
// component: 'Switch',
// colProps: { span: 6 },
// defaultValue: false,
// componentProps: {
// checkedChildren: '是',
// checkedValue: true,
// unCheckedChildren: '否',
// unCheckedValue: false,
// },
// },
// {
// field: 'shipperCn',
// label: '是否国内发货人',
// component: 'Switch',
// colProps: { span: 6 },
// defaultValue: false,
// componentProps: {
// checkedChildren: '是',
// checkedValue: true,
// unCheckedChildren: '否',
// unCheckedValue: false,
// },
// },
]
export const SenderformSchema: FormSchema[] = [
{

Loading…
Cancel
Save