箱管 邮件模板 调整

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

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

@ -51,6 +51,7 @@
</div> </div>
</div> </div>
<div class="SearchBox"> <div class="SearchBox">
<span class="pendingBusiness">待取业务</span>
<BasicForm class="Form" @register="registerSearchBoxForm" /> <BasicForm class="Form" @register="registerSearchBoxForm" />
<div class="ButtonBox"> <div class="ButtonBox">
<a-button size="default" @click="handleReset"> </a-button> <a-button size="default" @click="handleReset"> </a-button>
@ -338,7 +339,7 @@
} }
} }
async function Cancel() { async function Cancel() {
await handleSave(false) // await handleSave(false)
let type: boolean = true let type: boolean = true
let ApiData: any = { let ApiData: any = {
id: rowId.value, id: rowId.value,
@ -943,6 +944,13 @@
} }
</script> </script>
<style lang="less" scoped> <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 { .ds-goods-tb-check {
position: absolute; position: absolute;
left: 15px; left: 15px;

@ -51,6 +51,8 @@
</div> </div>
</div> </div>
<div class="SearchBox" v-if="TotTableType"> <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" /> <BasicForm class="Form" @register="registerSearchBoxForm" />
<div class="ButtonBox"> <div class="ButtonBox">
<a-button size="default" @click="handleReset"> </a-button> <a-button size="default" @click="handleReset"> </a-button>
@ -340,7 +342,7 @@
} }
} }
async function Cancel() { async function Cancel() {
await handleSave(false) // await handleSave(false)
let type: boolean = true let type: boolean = true
let ApiData: any = { let ApiData: any = {
id: rowId.value, id: rowId.value,
@ -1281,6 +1283,13 @@
} }
</script> </script>
<style lang="less" scoped> <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 { .ds-goods-tb-check {
position: absolute; position: absolute;
left: 15px; left: 15px;

@ -51,6 +51,7 @@
</div> </div>
</div> </div>
<div class="SearchBox"> <div class="SearchBox">
<span class="pendingBusiness">待取业务</span>
<BasicForm class="Form" @register="registerSearchBoxForm" /> <BasicForm class="Form" @register="registerSearchBoxForm" />
<div class="ButtonBox"> <div class="ButtonBox">
<a-button size="default" @click="handleReset"> </a-button> <a-button size="default" @click="handleReset"> </a-button>
@ -327,7 +328,7 @@
} }
} }
async function Cancel() { async function Cancel() {
await handleSave(false) // await handleSave(false)
let type: boolean = true let type: boolean = true
let ApiData: any = { let ApiData: any = {
id: rowId.value, id: rowId.value,
@ -1037,6 +1038,13 @@
} }
</script> </script>
<style lang="less" scoped> <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 { .ds-goods-tb-check {
position: absolute; position: absolute;
left: 15px; left: 15px;

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

@ -51,6 +51,7 @@
</div> </div>
</div> </div>
<div class="SearchBox"> <div class="SearchBox">
<span class="pendingBusiness">待取业务</span>
<BasicForm class="Form" @register="registerSearchBoxForm" /> <BasicForm class="Form" @register="registerSearchBoxForm" />
<div class="ButtonBox"> <div class="ButtonBox">
<a-button size="default" @click="handleReset"> </a-button> <a-button size="default" @click="handleReset"> </a-button>
@ -358,7 +359,7 @@
} }
} }
async function Cancel() { async function Cancel() {
await handleSave(false) // await handleSave(false)
let type: boolean = true let type: boolean = true
let ApiData: any = { let ApiData: any = {
id: rowId.value, id: rowId.value,
@ -1642,6 +1643,13 @@
} }
</script> </script>
<style lang="less" scoped> <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 { .ds-goods-tb-check {
position: absolute; position: absolute;
left: 15px; left: 15px;

@ -51,6 +51,7 @@
</div> </div>
</div> </div>
<div class="SearchBox"> <div class="SearchBox">
<span class="pendingBusiness">待取业务</span>
<BasicForm class="Form" @register="registerSearchBoxForm" /> <BasicForm class="Form" @register="registerSearchBoxForm" />
<div class="ButtonBox"> <div class="ButtonBox">
<a-button size="default" @click="handleReset"> </a-button> <a-button size="default" @click="handleReset"> </a-button>
@ -338,7 +339,7 @@
} }
} }
async function Cancel() { async function Cancel() {
await handleSave(false) // await handleSave(false)
let type: boolean = true let type: boolean = true
let ApiData: any = { let ApiData: any = {
id: rowId.value, id: rowId.value,
@ -1094,6 +1095,13 @@
} }
</script> </script>
<style lang="less" scoped> <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 { .ds-goods-tb-check {
position: absolute; position: absolute;
left: 15px; left: 15px;

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

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

Loading…
Cancel
Save