箱管 邮件模板 调整

szh-new
张同海 2 months ago
parent 0e7c21532a
commit bf2a7a0131

@ -327,7 +327,7 @@
}
}
async function Cancel() {
await handleSave(false)
// await handleSave(false)
let type: boolean = true
let ApiData: any = {
id: rowId.value,

@ -51,6 +51,7 @@
</div>
</div>
<div class="SearchBox">
<span class="pendingBusiness">待取业务</span>
<BasicForm class="Form" @register="registerSearchBoxForm" />
<div class="ButtonBox">
<a-button size="default" @click="handleReset"> </a-button>
@ -338,7 +339,7 @@
}
}
async function Cancel() {
await handleSave(false)
// await handleSave(false)
let type: boolean = true
let ApiData: any = {
id: rowId.value,
@ -943,6 +944,13 @@
}
</script>
<style lang="less" scoped>
.pendingBusiness {
font-weight: bold;
margin: 20px 8px 0px 0px;
writing-mode: vertical-rl;
border-left: 2px solid #257afa;
height: 64px;
}
.ds-goods-tb-check {
position: absolute;
left: 15px;

@ -51,6 +51,8 @@
</div>
</div>
<div class="SearchBox" v-if="TotTableType">
<!-- <span style="font-weight: bold; margin: 20px 8px 0px 0px">待取业务</span> -->
<span class="pendingBusiness">待取业务</span>
<BasicForm class="Form" @register="registerSearchBoxForm" />
<div class="ButtonBox">
<a-button size="default" @click="handleReset"> </a-button>
@ -340,7 +342,7 @@
}
}
async function Cancel() {
await handleSave(false)
// await handleSave(false)
let type: boolean = true
let ApiData: any = {
id: rowId.value,
@ -1281,6 +1283,13 @@
}
</script>
<style lang="less" scoped>
.pendingBusiness {
font-weight: bold;
margin: 20px 8px 0px 0px;
writing-mode: vertical-rl;
border-left: 2px solid #257afa;
height: 64px;
}
.ds-goods-tb-check {
position: absolute;
left: 15px;

@ -51,6 +51,7 @@
</div>
</div>
<div class="SearchBox">
<span class="pendingBusiness">待取业务</span>
<BasicForm class="Form" @register="registerSearchBoxForm" />
<div class="ButtonBox">
<a-button size="default" @click="handleReset"> </a-button>
@ -327,7 +328,7 @@
}
}
async function Cancel() {
await handleSave(false)
// await handleSave(false)
let type: boolean = true
let ApiData: any = {
id: rowId.value,
@ -1037,6 +1038,13 @@
}
</script>
<style lang="less" scoped>
.pendingBusiness {
font-weight: bold;
margin: 20px 8px 0px 0px;
writing-mode: vertical-rl;
border-left: 2px solid #257afa;
height: 64px;
}
.ds-goods-tb-check {
position: absolute;
left: 15px;

@ -274,7 +274,7 @@
}
}
async function Cancel() {
await handleSave(false)
// await handleSave(false)
let type: boolean = true
let ApiData: any = {
id: rowId.value,

@ -51,6 +51,7 @@
</div>
</div>
<div class="SearchBox">
<span class="pendingBusiness">待取业务</span>
<BasicForm class="Form" @register="registerSearchBoxForm" />
<div class="ButtonBox">
<a-button size="default" @click="handleReset"> </a-button>
@ -358,7 +359,7 @@
}
}
async function Cancel() {
await handleSave(false)
// await handleSave(false)
let type: boolean = true
let ApiData: any = {
id: rowId.value,
@ -1642,6 +1643,13 @@
}
</script>
<style lang="less" scoped>
.pendingBusiness {
font-weight: bold;
margin: 20px 8px 0px 0px;
writing-mode: vertical-rl;
border-left: 2px solid #257afa;
height: 64px;
}
.ds-goods-tb-check {
position: absolute;
left: 15px;

@ -51,6 +51,7 @@
</div>
</div>
<div class="SearchBox">
<span class="pendingBusiness">待取业务</span>
<BasicForm class="Form" @register="registerSearchBoxForm" />
<div class="ButtonBox">
<a-button size="default" @click="handleReset"> </a-button>
@ -338,7 +339,7 @@
}
}
async function Cancel() {
await handleSave(false)
// await handleSave(false)
let type: boolean = true
let ApiData: any = {
id: rowId.value,
@ -1094,6 +1095,13 @@
}
</script>
<style lang="less" scoped>
.pendingBusiness {
font-weight: bold;
margin: 20px 8px 0px 0px;
writing-mode: vertical-rl;
border-left: 2px solid #257afa;
height: 64px;
}
.ds-goods-tb-check {
position: absolute;
left: 15px;

@ -7,7 +7,7 @@
@register="registerModal"
@ok="handleSave"
>
<BasicForm @register="registerForm" />
<BasicForm @register="registerForm" @linkageForm="linkageForm" />
<!-- 任务邮件接收人配置 -->
<BasicForm @register="registerReceiverForm" />
<!-- 任务邮件发送人配置 -->
@ -22,7 +22,7 @@
:loading="loading"
ghost
style="margin-right: 0.8rem"
@click="closeModal"
@click="handlecloseModal"
>取消</a-button
>
<a-button
@ -50,17 +50,56 @@
import { formSchema, ReceiverformSchema, SenderformSchema, CcformSchema } from './columns'
import { ApiEdit, ApiInfo, GetPrintTemplateList } from './api'
import { useMessage } from '/@/hooks/web/useMessage'
import { any } from 'node_modules/vue-types/dist'
// Emits
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
const loading = ref(false)
const rowId = ref('')
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] = useForm({
const [
registerForm,
{
resetFields,
setFieldsValue,
validate,
updateSchema,
appendSchemaByField,
removeSchemaByField,
},
] = useForm({
labelWidth: 100,
schemas: formSchema,
showActionButtonGroup: false,
})
const DiyFieldIdS = ref<any>([])
function linkageForm(data) {
console.log(data)
// Schema
if (DiyFieldIdS.value.length) {
DiyFieldIdS.value.forEach((item) => {
removeSchemaByField(item.value)
})
}
DiyFieldIdS.value.splice(0)
data.forEach((item) => {
appendSchemaByField(
{
field: item.value,
label: item.label,
component: 'Input',
colProps: { span: 6 },
componentProps: {
placeholder: '自定义文件名称',
},
},
'attachments',
)
DiyFieldIdS.value.push(item)
})
}
const [
registerReceiverForm,
{
@ -100,18 +139,43 @@
CcResetFields()
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
DiyFieldIdS.value.forEach((item) => {
removeSchemaByField(item.value)
})
DiyFieldIdS.value.splice(0)
if (unref(isUpdate)) {
// setModalProps({ confirmLoading: true });
rowId.value = data.record.id
const res: API.DataResult = await ApiInfo({ id: unref(rowId) })
if (res.succeeded) {
let DiyFieldIdSArr: any = []
let DiyFieldIdSObj: any = {}
let attachments: any = []
let arrRes: any = await GetPrintTemplateList({
queryCondition: `[]`,
pageCondition: {
pageIndex: 1,
pageSize: 999,
sortConditions: [],
},
})
res.data.attachments.forEach((e) => {
attachments.push(e.templateId)
arrRes.data.forEach((element) => {
if (element.id == e.templateId) {
DiyFieldIdSArr.push({
value: e.templateId,
label: element.templateName,
})
DiyFieldIdSObj[e.templateId] = e.fileName
}
})
})
linkageForm(DiyFieldIdSArr)
setFieldsValue({
...res.data,
attachments,
...DiyFieldIdSObj,
})
if (res.data.documentType == 0) {
updateSchema({ field: 'name', required: true })
@ -139,7 +203,12 @@
})
const getTitle = computed(() => (!unref(isUpdate) ? '新增邮件模板' : '编辑邮件模板'))
function handlecloseModal() {
DiyFieldIdS.value.forEach((item) => {
removeSchemaByField(item.value)
})
closeModal()
}
async function handleSave(exit) {
try {
const values = await validate()
@ -153,6 +222,7 @@
sortConditions: [],
},
})
console.log(DiyFieldIdS.value)
arrRes.data.forEach((item) => {
values.attachments.forEach((e) => {
@ -162,7 +232,7 @@
attachments.push({
taskMailId: values.id,
templateId: item.id,
fileName: item.templateName,
fileName: values[item.id] ? values[item.id] : item.templateName,
})
}
})
@ -194,35 +264,61 @@
createMessage.error(res.message)
}
exit && closeModal()
exit && handlecloseModal()
} finally {
// loading.value = false;
setModalProps({ confirmLoading: false, loading: false })
}
}
async function refresh() {
DiyFieldIdS.value.forEach((item) => {
removeSchemaByField(item.value)
})
DiyFieldIdS.value.splice(0)
const res: API.DataResult = await ApiInfo({ id: unref(rowId) })
if (res.succeeded) {
let DiyFieldIdSArr: any = []
let DiyFieldIdSObj: any = {}
let attachments: any = []
let arrRes: any = await GetPrintTemplateList({
queryCondition: `[]`,
pageCondition: {
pageIndex: 1,
pageSize: 999,
sortConditions: [],
},
})
res.data.attachments.forEach((e) => {
attachments.push(e.templateId)
arrRes.data.forEach((element) => {
if (element.id == e.templateId) {
DiyFieldIdSArr.push({
value: e.templateId,
label: element.templateName,
})
DiyFieldIdSObj[e.templateId] = e.fileName
}
})
})
linkageForm(DiyFieldIdSArr)
setFieldsValue({
...res.data,
attachments,
...DiyFieldIdSObj,
})
if (res.data.documentType == 0) {
updateSchema({ field: 'name', required: true })
} else {
updateSchema({ field: 'name', required: false })
}
await ReceiverSetFieldsValue({
ReceiverSetFieldsValue({
...res.data.receiver,
})
await SenderSetFieldsValue({
SenderSetFieldsValue({
...res.data.sender,
})
await CcSetFieldsValue({
CcSetFieldsValue({
...res.data.cc,
})
}

@ -116,8 +116,6 @@ export const formSchema: FormSchema[] = [
valueField: 'value',
resultField: 'data',
onChange: (e, obj) => {
console.log(e)
if (formActionType) {
if (e == 0) {
formActionType.updateSchema({ field: 'name', required: true })
@ -148,30 +146,33 @@ export const formSchema: FormSchema[] = [
field: 'attachments',
component: 'ApiSelect',
colProps: { span: 12 },
componentProps: {
api: () => {
return new Promise((resolve) => {
GetPrintTemplateList({
// {"FieldName":"isUseDataSource","FieldValue":${true},"ConditionalType":0}
queryCondition: `[]`,
pageCondition: {
pageIndex: 1,
pageSize: 999,
sortConditions: [],
},
}).then((res) => {
console.log(res, 111111111111111)
resolve(res)
componentProps: ({ formActionType }) => {
return {
api: () => {
return new Promise((resolve) => {
GetPrintTemplateList({
queryCondition: `[]`,
pageCondition: {
pageIndex: 1,
pageSize: 999,
sortConditions: [],
},
}).then((res) => {
resolve(res)
})
})
})
},
labelField: 'templateName',
valueField: 'id',
resultField: 'data',
allowClear: true,
immediate: true,
mode: 'multiple',
class: 'NoLimitHeight',
},
labelField: 'templateName',
valueField: 'id',
resultField: 'data',
allowClear: true,
immediate: true,
mode: 'multiple',
class: 'NoLimitHeight',
onChange: (e, obj) => {
formActionType ? formActionType.linkageForm(obj) : null
},
}
},
},
{

Loading…
Cancel
Save