邮件管理
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
04d6972462
commit
3138bbcb3b
|
@ -42,6 +42,7 @@
|
|||
"nprogress": "0.2.0",
|
||||
"path-to-regexp": "2.4.0",
|
||||
"pdfobject": "^2.2.8",
|
||||
"prismjs": "^1.30.0",
|
||||
"popper.js": "^1.16.1",
|
||||
"sass-loader": "^8.0.0",
|
||||
"screenfull": "^4.2.0",
|
||||
|
@ -54,6 +55,7 @@
|
|||
"vue-contextmenujs": "^1.3.13",
|
||||
"vue-count-to": "^1.0.13",
|
||||
"vue-i18n": "^8.7.0",
|
||||
"vue-prism-editor": "^1.3.0",
|
||||
"vue-pdf": "^4.3.0",
|
||||
"vue-puzzle-vcode": "^1.1.10",
|
||||
"vue-router": "3.0.6",
|
||||
|
|
|
@ -59,7 +59,9 @@
|
|||
<el-form-item label="文件名" prop="Name">
|
||||
<el-input v-model="form.Name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="阅片标准: " prop="CriterionTypeEnum">
|
||||
<el-form-item
|
||||
:label="$t('trials:auditRecord:table:criterion')"
|
||||
prop="CriterionTypeEnum">
|
||||
<el-select
|
||||
v-model="form.CriterionTypeEnum"
|
||||
style="width:100%;"
|
||||
|
@ -77,7 +79,7 @@
|
|||
</el-form-item>
|
||||
<el-form-item v-if="form.Id !== ''" label="是否废除: ">
|
||||
<el-radio-group v-model="form.IsDeleted">
|
||||
<el-radio v-for="item of $d.YesOrNo" :label="item.value">{{ item.label }}</el-radio>
|
||||
<el-radio v-for="item of $d.YesOrNo" :key="`IsDeleted${item.value}`" :label="item.value">{{ item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述">
|
||||
|
@ -206,7 +208,7 @@ export default {
|
|||
this.loading = false
|
||||
this.$emit('closeDialog')
|
||||
this.$emit('getList')
|
||||
this.$message.success('保存成功!')
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
/>
|
||||
<el-table-column
|
||||
prop="CriterionTypeEnum"
|
||||
label="阅片标准"
|
||||
:label="$t('trials:auditRecord:table:criterion')"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
>
|
||||
|
|
|
@ -1,218 +1,247 @@
|
|||
<template>
|
||||
<el-form
|
||||
ref="emailForm"
|
||||
v-loading="loading"
|
||||
:model="form"
|
||||
label-width="180px"
|
||||
size="small"
|
||||
:rules="rules"
|
||||
>
|
||||
<el-form ref="emailForm" v-loading="loading" :model="form" label-width="180px" size="small" :rules="rules">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<!-- Code -->
|
||||
<el-form-item label="Code: " prop="Code">
|
||||
<el-input style="width: 300px" v-model="form.Code" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮件主题(CN)" prop="EmailTopicCN">
|
||||
<!-- 邮件主题(CN) -->
|
||||
<el-form-item :label="$t('trials:emailManageCfg:table:EmailTopicCN')" prop="EmailTopicCN">
|
||||
<el-input style="width: 300px" v-model="form.EmailTopicCN" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮件主题(EN)" prop="EmailTopic">
|
||||
<!-- 邮件主题(EN) -->
|
||||
<el-form-item :label="$t('trials:emailManageCfg:table:EmailTopic')" prop="EmailTopic">
|
||||
<el-input style="width: 300px" v-model="form.EmailTopic" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="业务层级" prop="BusinessLevelEnum">
|
||||
<!-- 邮件延时发送s数 -->
|
||||
<el-form-item :label="$t('dictionary:email:label:emailDelaySeconds')" prop="EmailDelaySeconds">
|
||||
<el-input v-model.number="form.EmailDelaySeconds" style="width: 300px" type="number" clearable>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<!-- 业务层级 -->
|
||||
<el-form-item :label="$t('dictionary:email:label:businessLevel')" prop="BusinessLevelEnum">
|
||||
<el-select v-model="form.BusinessLevelEnum" clearable class="mr">
|
||||
<el-option
|
||||
v-for="item of $d.BusinessLevel"
|
||||
:key="`BusinessLevel${item.label}`"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
<el-option v-for="item of $d.BusinessLevel" :key="`BusinessLevel${item.label}`" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="业务模块" prop="BusinessModuleEnum">
|
||||
<!-- 业务模块 -->
|
||||
<el-form-item :label="$t('dictionary:email:label:businessModule')" prop="BusinessModuleEnum">
|
||||
<el-select v-model="form.BusinessModuleEnum" clearable class="mr">
|
||||
<el-option
|
||||
v-for="item of $d.BusinessModule"
|
||||
:key="`BusinessModule${item.label}`"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
<el-option v-for="item of $d.BusinessModule" :key="`BusinessModule${item.label}`" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="业务场景" prop="BusinessScenarioEnum">
|
||||
<!-- 业务场景 -->
|
||||
<el-form-item :label="$t('trials:emailManageCfg:table:BusinessScenarioEnum')" prop="BusinessScenarioEnum">
|
||||
<el-select v-model="form.BusinessScenarioEnum" clearable class="mr">
|
||||
<el-option
|
||||
v-for="item of $d.Email_BusinessScenario"
|
||||
:key="`BusinessScenarioEnum${item.label}`"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
<el-option v-for="item of $d.Email_BusinessScenario" :key="`BusinessScenarioEnum${item.label}`"
|
||||
:label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收件人" prop="ToUserTypeList">
|
||||
<!-- 收件人 -->
|
||||
<el-form-item :label="$t('trials:emailManageCfg:title:toUserTypeList')" prop="ToUserTypeList">
|
||||
<el-select v-model="form.ToUserTypeList" clearable multiple class="mr">
|
||||
<el-option
|
||||
v-for="item of $d.UserType"
|
||||
:key="`ToUserTypeList${item.label}`"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
<el-option v-for="item of $d.UserType" :key="`ToUserTypeList${item.label}`" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="抄送人" prop="CopyUserTypeList">
|
||||
<!-- 抄送人 -->
|
||||
<el-form-item :label="$t('trials:emailManageCfg:title:copyUserTypeList')" prop="CopyUserTypeList">
|
||||
<el-select v-model="form.CopyUserTypeList" clearable multiple class="mr">
|
||||
<el-option
|
||||
v-for="item of $d.UserType"
|
||||
:key="`CopyUserTypeList${item.label}`"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
<el-option v-for="item of $d.UserType" :key="`CopyUserTypeList${item.label}`" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="加急状态" prop="EmailUrgentEnum">
|
||||
<el-select v-model="form.EmailUrgentEnum" @change="(v) => {v === 1 ? form.EmailCron = null : null}" clearable class="mr">
|
||||
<el-option
|
||||
v-for="item of $d.EmailUrgent"
|
||||
:key="`EmailUrgent${item.label}`"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
<!-- 加急状态 -->
|
||||
<el-form-item :label="$t('dictionary:email:label:IsUrgent')" prop="EmailUrgentEnum">
|
||||
<el-select v-model="form.EmailUrgentEnum" @change="
|
||||
(v) => {
|
||||
v === 1 ? (form.EmailCron = null) : null
|
||||
}
|
||||
" clearable class="mr">
|
||||
<el-option v-for="item of $d.EmailUrgent" :key="`EmailUrgent${item.label}`" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发送周期和时间" v-if="form.EmailUrgentEnum !== 1" prop="EmailCron">
|
||||
<!-- 发送周期和时间 -->
|
||||
<el-form-item :label="$t('trials:emailManageCfg:table:EmailCron')" v-if="form.EmailUrgentEnum !== 1"
|
||||
prop="EmailCron">
|
||||
<el-input style="width: 300px" readonly v-model="form.EmailCron" />
|
||||
<el-button type="primary" @click="showDialog">生成 cron</el-button>
|
||||
<!-- 生成 cron -->
|
||||
<el-button type="primary" @click="showDialog"> {{ $t('dictionary:email:button:cron') }} </el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否需要回执" prop="IsReturnRequired">
|
||||
<!-- 是否需要回执 -->
|
||||
<el-form-item :label="$t('trials:emailManageCfg:title:isReturnRequired')" prop="IsReturnRequired">
|
||||
<el-radio-group v-model="form.IsReturnRequired">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
<el-radio v-for="item of $d.YesOrNo" :label="item.value" :key="`IsReturnRequired${item.value}`">{{
|
||||
item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否自动发送" prop="IsAutoSend">
|
||||
<!-- 是否自动发送 -->
|
||||
<el-form-item :label="$t('trials:emailManageCfg:table:IsAutoSend')" prop="IsAutoSend">
|
||||
<el-radio-group v-model="form.IsAutoSend">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
<el-radio v-for="item of $d.YesOrNo" :label="item.value" :key="`IsAutoSend${item.value}`">{{ item.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="systemLevel">
|
||||
<!-- 是否区分标准 -->
|
||||
<el-form-item :label="$t('dictionary:email:button:isDistinguishCriteria')" prop="IsDistinguishCriteria">
|
||||
<el-radio-group v-model="form.IsDistinguishCriteria" @change="
|
||||
() => {
|
||||
form.CriterionTypeEnum = null
|
||||
}
|
||||
">
|
||||
<el-radio v-for="item of $d.YesOrNo" :label="item.value" :key="`IsDistinguishCriteria${item.value}`">{{
|
||||
item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否区分标准" prop="IsDistinguishCriteria">
|
||||
<el-radio-group v-model="form.IsDistinguishCriteria" @change="() => {form.CriterionTypeEnum = null}">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="阅片标准" v-if="form.IsDistinguishCriteria" prop="CriterionTypeEnum">
|
||||
<el-select v-model="form.CriterionTypeEnum" clearable class="mr">
|
||||
<el-option
|
||||
v-for="item of $d.CriterionType"
|
||||
:key="`CriterionType${item.label}`"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
<el-form-item :label="$t('trials:auditRecord:table:criterion')" v-if="form.IsDistinguishCriteria"
|
||||
prop="CriterionTypeList">
|
||||
<el-select v-model="form.CriterionTypeList" clearable class="mr" multiple>
|
||||
<el-option v-for="item of $d.CriterionType" :key="`CriterionType${item.label}`" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否启用" prop="IsEnable">
|
||||
<!-- 是否启用 -->
|
||||
<el-form-item :label="$t('trials:emailManageCfg:table:IsEnable')" prop="IsEnable">
|
||||
<el-radio-group v-model="form.IsEnable">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
<el-radio v-for="item of $d.YesOrNo" :label="item.value" :key="`IsEnable${item.value}`">{{ item.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="附件(CN)" prop="IsEnable">
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
action
|
||||
:before-upload="beforeUploadCN"
|
||||
:http-request="handleUploadFileCN"
|
||||
:on-preview="handlePreviewCN"
|
||||
:on-remove="handleRemoveFileCN"
|
||||
:show-file-list="true"
|
||||
:limit="1"
|
||||
:file-list="fileListCN"
|
||||
>
|
||||
<el-button size="small" type="primary" :disabled="fileListCN.length > 0">点击上传</el-button>
|
||||
<!-- 附件(CN) -->
|
||||
<el-form-item :label="$t('trials:emailManageCfg:table:fileListCN')" prop="IsEnable">
|
||||
<el-upload class="upload-demo" action :before-upload="beforeUploadCN" :http-request="handleUploadFileCN"
|
||||
:on-preview="handlePreviewCN" :on-remove="handleRemoveFileCN" :show-file-list="true" :limit="1"
|
||||
:file-list="fileListCN">
|
||||
<el-button size="small" type="primary" :disabled="fileListCN.length > 0">{{ $t('common:button:upload')
|
||||
}}</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="附件(EN)" prop="IsEnable">
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
action
|
||||
:before-upload="beforeUploadEN"
|
||||
:http-request="handleUploadFileEN"
|
||||
:on-preview="handlePreviewEN"
|
||||
:on-remove="handleRemoveFileEN"
|
||||
:show-file-list="true"
|
||||
:limit="1"
|
||||
:file-list="fileListEN"
|
||||
>
|
||||
<el-button size="small" type="primary" :disabled="fileListEN.length > 0">点击上传</el-button>
|
||||
<!-- 附件(EN) -->
|
||||
<el-form-item :label="$t('trials:emailManageCfg:table:fileListEN')" prop="IsEnable">
|
||||
<el-upload class="upload-demo" action :before-upload="beforeUploadEN" :http-request="handleUploadFileEN"
|
||||
:on-preview="handlePreviewEN" :on-remove="handleRemoveFileEN" :show-file-list="true" :limit="1"
|
||||
:file-list="fileListEN">
|
||||
<el-button size="small" type="primary" :disabled="fileListEN.length > 0">{{ $t('common:button:upload')
|
||||
}}</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="邮件内容模版(CN)" prop="EmailHtmlContentCN">
|
||||
<el-input
|
||||
v-model="form.EmailHtmlContentCN"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 8, maxRows: 8}"
|
||||
/>
|
||||
<!-- 邮件内容模版(CN) -->
|
||||
<el-form-item :label="$t('dictionary:email:label:emailHtmlContentCN')" prop="EmailHtmlContentCN"
|
||||
style="position: relative">
|
||||
<div class="html_temp">
|
||||
<prism-editor class="my-editor" v-model="form.EmailHtmlContentCN" :highlight="highlighter" :line-numbers="true"
|
||||
style="width: 50%;max-height: 500px;"></prism-editor>
|
||||
<div v-html="form.EmailHtmlContentCN" style="width: 50%;"></div>
|
||||
</div>
|
||||
<!-- <el-input v-model="form.EmailHtmlContentCN" type="textarea" :autosize="{ minRows: 8, maxRows: 8 }" />
|
||||
<el-button :disabled="!form.EmailHtmlContentCN && form.EmailHtmlContent" type="text"
|
||||
@click="PreviewHTML(form.EmailHtmlContentCN, form.EmailHtmlContent)"
|
||||
style="position: absolute; left: -50px; top: 30px">
|
||||
{{ $t('common:button:preview') }}
|
||||
</el-button> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="邮件内容模版(EN)" prop="EmailHtmlContent">
|
||||
<el-input
|
||||
v-model="form.EmailHtmlContent"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 8, maxRows: 8}"
|
||||
/>
|
||||
<!-- 邮件内容模版(EN) -->
|
||||
<el-form-item :label="$t('dictionary:email:label:emailHtmlContent')" prop="EmailHtmlContent"
|
||||
style="position: relative">
|
||||
<div class="html_temp">
|
||||
<prism-editor class="my-editor" v-model="form.EmailHtmlContent" :highlight="highlighter" :line-numbers="true"
|
||||
style="width: 50%;max-height: 500px;"></prism-editor>
|
||||
<div v-html="form.EmailHtmlContent" style="width: 50%;"></div>
|
||||
</div>
|
||||
<!-- <el-input v-model="form.EmailHtmlContent" type="textarea" :autosize="{ minRows: 8, maxRows: 8 }" />
|
||||
<el-button :disabled="!form.EmailHtmlContentCN && form.EmailHtmlContent" type="text"
|
||||
@click="PreviewHTML(form.EmailHtmlContentCN, form.EmailHtmlContent)"
|
||||
style="position: absolute; left: -50px; top: 30px">
|
||||
{{ $t('common:button:preview') }}
|
||||
</el-button> -->
|
||||
</el-form-item>
|
||||
<div class="base-dialog-footer" style="text-align:right;margin-top:10px;padding-bottom: 10px">
|
||||
<el-form-item style="text-align:right;">
|
||||
<el-button size="small" type="primary" @click="handleSave">Save</el-button>
|
||||
<div class="base-dialog-footer" style="text-align: right; margin-top: 10px; padding-bottom: 10px">
|
||||
<el-form-item style="text-align: right">
|
||||
<el-button size="small" type="primary" @click="handleSave">
|
||||
{{ $t('common:button:save') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-dialog append-to-body title="生成 cron" :visible.sync="showCron">
|
||||
<vcrontab :hideComponent="['year']" @hide="showCron=false" @fill="crontabFill" :expression="expression"></vcrontab>
|
||||
<!-- 生成 cron -->
|
||||
<el-dialog append-to-body :title="$t('dictionary:email:button:cron')" :visible.sync="showCron">
|
||||
<vcrontab :hideComponent="['year']" @hide="showCron = false" @fill="crontabFill" :expression="expression">
|
||||
</vcrontab>
|
||||
</el-dialog>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { Upload, addOrUpdateEmailNoticeConfigList } from '@/api/dictionary'
|
||||
import vcrontab from 'vcrontab'
|
||||
|
||||
import { PrismEditor } from 'vue-prism-editor';
|
||||
import 'vue-prism-editor/dist/prismeditor.min.css';
|
||||
import { highlight, languages } from 'prismjs/components/prism-core';
|
||||
import 'prismjs/components/prism-clike';
|
||||
import 'prismjs/components/prism-javascript';
|
||||
import 'prismjs/themes/prism.css';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
data: {
|
||||
type: Object,
|
||||
default() { return {} }
|
||||
}
|
||||
default() {
|
||||
return {}
|
||||
},
|
||||
},
|
||||
systemLevel: {
|
||||
type: Number,
|
||||
default() {
|
||||
return 0
|
||||
},
|
||||
},
|
||||
isDistinguishCriteria: {
|
||||
type: Boolean,
|
||||
default() {
|
||||
return false
|
||||
},
|
||||
},
|
||||
},
|
||||
components: { vcrontab, PrismEditor },
|
||||
data() {
|
||||
return {
|
||||
expression: '',
|
||||
|
@ -240,37 +269,73 @@ export default {
|
|||
IsUrgent: true,
|
||||
IsEnable: true,
|
||||
IsAutoSend: true,
|
||||
CriterionTypeEnum: null
|
||||
CriterionTypeEnum: null,
|
||||
EmailDelaySeconds: null,
|
||||
CriterionTypeList: []
|
||||
},
|
||||
rules: {
|
||||
Code: [{ required: true, message: 'Please select', trigger: ['blur'] }],
|
||||
BusinessScenarioEnum: [{ required: true, message: 'Please select', trigger: ['blur'] }],
|
||||
EmailTopicCN: [{ required: true, message: 'Please select', trigger: ['blur'] }],
|
||||
EmailTopic: [{ required: true, message: 'Please select', trigger: ['blur'] }],
|
||||
BusinessLevelEnum: [{ required: true, message: 'Please select', trigger: ['blur'] }],
|
||||
ToUserTypeList: [{ required: true, message: 'Please select', trigger: ['blur'] }],
|
||||
EmailCron: [{ required: true, message: 'Please select', trigger: ['blur'] }],
|
||||
EmailUrgentEnum: [{ required: true, message: 'Please select', trigger: ['blur'] }],
|
||||
EmailHtmlContentCN: [{ required: true, message: 'Please select', trigger: ['blur'] }],
|
||||
EmailHtmlContent: [{ required: true, message: 'Please select', trigger: ['blur'] }],
|
||||
CriterionTypeEnum: [{ required: true, message: 'Please select', trigger: ['blur'] }],
|
||||
Code: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur'] }],
|
||||
BusinessScenarioEnum: [
|
||||
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur'] },
|
||||
],
|
||||
EmailTopicCN: [
|
||||
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur'] },
|
||||
],
|
||||
EmailTopic: [
|
||||
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur'] },
|
||||
],
|
||||
BusinessLevelEnum: [
|
||||
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur'] },
|
||||
],
|
||||
// ToUserTypeList: [
|
||||
// { required: true, message: 'Please select', trigger: ['blur'] },
|
||||
// ],
|
||||
// EmailCron: [
|
||||
// { required: true, message: 'Please select', trigger: ['blur'] },
|
||||
// ],
|
||||
EmailUrgentEnum: [
|
||||
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur'] },
|
||||
],
|
||||
EmailHtmlContentCN: [
|
||||
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur'] },
|
||||
],
|
||||
EmailHtmlContent: [
|
||||
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur'] },
|
||||
],
|
||||
CriterionTypeList: [
|
||||
{ required: true, type: 'array', message: this.$t('common:ruleMessage:select'), trigger: ['blur'] },
|
||||
],
|
||||
},
|
||||
scenarioOption: [],
|
||||
fileListCN: [],
|
||||
fileListEN: [],
|
||||
loading: false
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initForm()
|
||||
if (this.systemLevel) {
|
||||
if (this.systemLevel === 1) {
|
||||
this.form.ToUserTypeList = []
|
||||
}
|
||||
this.form.CopyUserTypeList = []
|
||||
this.form.EmailUrgentEnum = 3
|
||||
this.form.IsReturnRequired = false
|
||||
this.form.IsDistinguishCriteria = false
|
||||
} else {
|
||||
this.form.IsDistinguishCriteria = this.isDistinguishCriteria
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
highlighter(code) {
|
||||
return highlight(code, languages.js);
|
||||
},
|
||||
showDialog() {
|
||||
this.expression = this.form.EmailCron;//传入的 cron 表达式,可以反解析到 UI 上
|
||||
this.showCron = true;
|
||||
this.expression = this.form.EmailCron //传入的 cron 表达式,可以反解析到 UI 上
|
||||
this.showCron = true
|
||||
},
|
||||
crontabFill(value) {
|
||||
this.form.EmailCron = value;
|
||||
this.form.EmailCron = value
|
||||
},
|
||||
handleRemoveFileCN() {
|
||||
this.form.AttachNameCN = null
|
||||
|
@ -279,7 +344,7 @@ export default {
|
|||
},
|
||||
beforeUploadCN() {
|
||||
if (this.fileListCN.length > 0) {
|
||||
this.$alert('最多只能传一个附件')
|
||||
this.$alert(this.$t('trials:emailManageCfg:message:msg1'))
|
||||
return
|
||||
}
|
||||
},
|
||||
|
@ -293,10 +358,15 @@ export default {
|
|||
const formData = new FormData()
|
||||
formData.append('file', param.file)
|
||||
this.form.AttachNameCN = param.file.name
|
||||
Upload(formData, 3).then(res => {
|
||||
Upload(formData, 3).then((res) => {
|
||||
this.form.AttachCNPath = res.Result.FilePath
|
||||
this.btnLoading = false
|
||||
this.fileListCN.push({ name: param.file.name, path: res.Result.FilePath, fullPath: res.Result.FullFilePath, url: res.Result.FilePath })
|
||||
this.fileListCN.push({
|
||||
name: param.file.name,
|
||||
path: res.Result.FilePath,
|
||||
fullPath: res.Result.FullFilePath,
|
||||
url: res.Result.FilePath,
|
||||
})
|
||||
})
|
||||
},
|
||||
handleUploadFileEN(param) {
|
||||
|
@ -304,10 +374,15 @@ export default {
|
|||
const formData = new FormData()
|
||||
formData.append('file', param.file)
|
||||
this.form.AttachName = param.file.name
|
||||
Upload(formData, 3).then(res => {
|
||||
Upload(formData, 3).then((res) => {
|
||||
this.form.AttachPath = res.Result.FilePath
|
||||
this.btnLoading = false
|
||||
this.fileListEN.push({ name: param.file.name, path: res.Result.FilePath, fullPath: res.Result.FullFilePath, url: res.Result.FilePath })
|
||||
this.fileListEN.push({
|
||||
name: param.file.name,
|
||||
path: res.Result.FilePath,
|
||||
fullPath: res.Result.FullFilePath,
|
||||
url: res.Result.FilePath,
|
||||
})
|
||||
})
|
||||
},
|
||||
handleRemoveFileEN() {
|
||||
|
@ -317,7 +392,7 @@ export default {
|
|||
},
|
||||
beforeUploadEN() {
|
||||
if (this.fileListEN.length > 0) {
|
||||
this.$alert('最多只能传一个附件')
|
||||
this.$alert(this.$t('trials:emailManageCfg:message:msg1'))
|
||||
return
|
||||
}
|
||||
},
|
||||
|
@ -334,31 +409,57 @@ export default {
|
|||
this.form[k] = this.data[k]
|
||||
}
|
||||
if (k === 'AttachPath' && this.form[k]) {
|
||||
this.fileListEN.push({ name: this.data.AttachName, path: this.data.AttachPath, fullPath: this.data.AttachPath, url: this.data.AttachPath })
|
||||
this.fileListEN.push({
|
||||
name: this.data.AttachName,
|
||||
path: this.data.AttachPath,
|
||||
fullPath: this.data.AttachPath,
|
||||
url: this.data.AttachPath,
|
||||
})
|
||||
}
|
||||
if (k === 'AttachCNPath' && this.form[k]) {
|
||||
this.fileListCN.push({ name: this.data.AttachNameCN, path: this.data.AttachCNPath, fullPath: this.data.AttachCNPath, url: this.data.AttachCNPath })
|
||||
this.fileListCN.push({
|
||||
name: this.data.AttachNameCN,
|
||||
path: this.data.AttachCNPath,
|
||||
fullPath: this.data.AttachCNPath,
|
||||
url: this.data.AttachCNPath,
|
||||
})
|
||||
}
|
||||
}
|
||||
console.log(this.fileListEN, this.fileListCN)
|
||||
this.loading = false
|
||||
},
|
||||
|
||||
// 保存
|
||||
handleSave() {
|
||||
this.$refs.emailForm.validate(valid => {
|
||||
this.$refs.emailForm.validate((valid) => {
|
||||
if (!valid) return
|
||||
this.loading = true
|
||||
addOrUpdateEmailNoticeConfigList(this.form).then(res => {
|
||||
this.loading = false
|
||||
this.$emit('closeDialog')
|
||||
this.$emit('getList')
|
||||
this.$message.success('Saved successfully')
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
this.form.systemLevel = this.systemLevel
|
||||
addOrUpdateEmailNoticeConfigList(this.form)
|
||||
.then((res) => {
|
||||
this.loading = false
|
||||
this.$emit('closeDialog')
|
||||
this.$emit('getList')
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
// 预览模板
|
||||
PreviewHTML(html, htmlEn) {
|
||||
this.$emit('PreviewHTML', html, htmlEn)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.html_temp {
|
||||
display: flex;
|
||||
|
||||
.my-editor {
|
||||
border: 1px solid #333;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,172 +1,160 @@
|
|||
<template>
|
||||
<box-content>
|
||||
<div class="search">
|
||||
<el-form :inline="true" size="mini" class="base-search-form">
|
||||
<el-form-item label="是否需要回执:">
|
||||
<el-select v-model="searchData.IsReturnRequired" clearable style="width:100px;">
|
||||
<el-option v-for="item of $d.YesOrNo" :value="item.value" :label="item.label" />
|
||||
<el-form :inline="true" class="base-search-form">
|
||||
<!-- 是否需要回执 -->
|
||||
<el-form-item :label="$t('trials:emailManageCfg:title:isReturnRequired')" v-if="!systemLevel">
|
||||
<el-select v-model="searchData.IsReturnRequired" clearable style="width: 100px">
|
||||
<el-option v-for="item of $d.YesOrNo" :value="item.value" :label="item.label" :key="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否加急:">
|
||||
<el-select v-model="searchData.IsUrgent" clearable style="width:100px;">
|
||||
<el-option v-for="item of $d.YesOrNo" :value="item.value" :label="item.label" />
|
||||
<!-- 是否加急 -->
|
||||
<el-form-item :label="$t('dictionary:email:label:IsUrgent')" v-if="!systemLevel">
|
||||
<el-select v-model="searchData.IsUrgent" clearable style="width: 100px">
|
||||
<el-option v-for="item of $d.YesOrNo" :value="item.value" :label="item.label" :key="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用:">
|
||||
<el-select v-model="searchData.IsEnable" clearable style="width:100px;">
|
||||
<el-option v-for="item of $d.YesOrNo" :value="item.value" :label="item.label" />
|
||||
<!-- 是否启用 -->
|
||||
<el-form-item :label="$t('trials:emailManageCfg:table:IsEnable')" v-if="!systemLevel">
|
||||
<el-select v-model="searchData.IsEnable" clearable style="width: 100px">
|
||||
<el-option v-for="item of $d.YesOrNo" :value="item.value" :label="item.label" :key="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="阅片标准:" v-if="isDistinguishCriteria">
|
||||
<el-select v-model="searchData.CriterionTypeEnum" clearable style="width:100px;">
|
||||
<el-option v-for="item of $d.CriterionType" :value="item.value" :label="item.label" />
|
||||
<el-form-item :label="$t('trials:auditRecord:table:criterion')" v-if="isDistinguishCriteria && !systemLevel">
|
||||
<el-select v-model="searchData.CriterionTypeEnum" clearable style="width: 100px">
|
||||
<el-option v-for="item of $d.CriterionType" :value="item.value" :label="item.label" :key="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('trials:emailManageCfg:form:BusinessModule')">
|
||||
<el-select v-model="searchData.BusinessModuleEnum" clearable style="width: 100px">
|
||||
<el-option v-for="item of $d.BusinessModule" :value="item.value" :label="item.label" :key="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('trials:emailManageCfg:form:BusinessScenario')">
|
||||
<el-select v-model="searchData.BusinessScenarioEnum" clearable style="width: 100px">
|
||||
<el-option v-for="item of $d.Email_BusinessScenario" :value="item.value" :label="item.label"
|
||||
:key="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('trials:emailManageCfg:form:ToUserType')">
|
||||
<el-select v-model="searchData.ToUserType" clearable style="width: 100px">
|
||||
<el-option v-for="item of UserTypeList" :value="item.value" :label="item.label" :key="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('trials:emailManageCfg:form:EmailUrgent')" v-if="systemLevel === 1">
|
||||
<el-select v-model="searchData.EmailUrgentEnum" clearable style="width: 100px">
|
||||
<el-option v-for="item of $d.EmailUrgent" :value="item.value" :label="item.label" :key="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearch">查询</el-button>
|
||||
<el-button type="primary" @click="handleReset">重置</el-button>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleSearch">
|
||||
{{ $t('common:button:search') }}
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh-left" @click="handleReset">
|
||||
{{ $t('common:button:reset') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span style="margin-left:auto;">
|
||||
<!-- <el-button
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleExport">
|
||||
{{ $t('common:button:export') }}
|
||||
</el-button>
|
||||
<!-- <el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
>
|
||||
场景配置
|
||||
</el-button> -->
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
<el-button type="primary" @click="handleAdd">
|
||||
{{ $t('common:button:new') }}
|
||||
</el-button>
|
||||
<el-button type="primary" @click="openDrawer" :disabled="multipleSelection.length <= 0">
|
||||
{{ $t('trials:emailManageCfg:button:batchAudit') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- 受试者列表 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
v-adaptive="{bottomOffset:45}"
|
||||
:data="list"
|
||||
stripe
|
||||
height="100"
|
||||
style="width:100%"
|
||||
@sort-change="handleSortByColumn"
|
||||
>
|
||||
<el-table-column type="index" width="40" />
|
||||
<el-table v-loading="loading" v-adaptive="{ bottomOffset: 45 }" :data="list" stripe height="100" style="width: 100%"
|
||||
@sort-change="handleSortByColumn" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="index" width="40" /> -->
|
||||
<el-table-column type="selection" width="55">
|
||||
</el-table-column>
|
||||
<!-- Code -->
|
||||
<el-table-column
|
||||
prop="Code"
|
||||
:label="$t('trials:emailManageCfg:title:code')"
|
||||
sortable="custom"
|
||||
show-overflow-tooltip
|
||||
width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isDistinguishCriteria"
|
||||
prop="TrialReadingCriterionId"
|
||||
:label="$t('trials:reviewTrack:table:criterionName')"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
width="120"
|
||||
>
|
||||
<el-table-column prop="Code" :label="$t('trials:emailManageCfg:title:code')" sortable="custom"
|
||||
show-overflow-tooltip min-width="100" />
|
||||
<el-table-column v-if="isDistinguishCriteria" prop="TrialReadingCriterionId"
|
||||
:label="$t('trials:reviewTrack:table:criterionName')" show-overflow-tooltip sortable="custom" min-width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.TrialCriterionName }}
|
||||
{{scope.row.CriterionTypeList ? scope.row.CriterionTypeList.map(item => $fd('CriterionType', item)).join(', ')
|
||||
: ''}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="EmailTopicCN"
|
||||
label="邮件主题(中文)"
|
||||
sortable="custom"
|
||||
show-overflow-tooltip
|
||||
width="160"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="EmailTopic"
|
||||
label="邮件主题(英文)"
|
||||
sortable="custom"
|
||||
show-overflow-tooltip
|
||||
width="160"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="BusinessLevelEnum"
|
||||
label="业务层级"
|
||||
sortable="custom"
|
||||
show-overflow-tooltip
|
||||
width="100">
|
||||
<!-- 邮件主题(中文) -->
|
||||
<el-table-column prop="EmailTopicCN" :label="$t('trials:emailManageCfg:table:EmailTopicCN')" sortable="custom"
|
||||
show-overflow-tooltip min-width="160" />
|
||||
<!-- 邮件主题(英文) -->
|
||||
<el-table-column prop="EmailTopic" :label="$t('trials:emailManageCfg:table:EmailTopic')" sortable="custom"
|
||||
show-overflow-tooltip min-width="160" />
|
||||
<!-- 业务层级 -->
|
||||
<el-table-column prop="BusinessLevelEnum" :label="$t('dictionary:email:label:businessLevel')" sortable="custom"
|
||||
show-overflow-tooltip min-width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ $fd('BusinessLevel',scope.row.BusinessLevelEnum) }}
|
||||
{{ $fd('BusinessLevel', scope.row.BusinessLevelEnum) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="BusinessModuleEnum"
|
||||
label="业务模块"
|
||||
sortable="custom"
|
||||
show-overflow-tooltip
|
||||
width="100">
|
||||
<!-- 业务模块 -->
|
||||
<el-table-column prop="BusinessModuleEnum" :label="$t('dictionary:email:label:businessModule')" sortable="custom"
|
||||
show-overflow-tooltip min-width="160">
|
||||
<template slot-scope="scope">
|
||||
{{ $fd('BusinessModule',scope.row.BusinessModuleEnum) }}
|
||||
{{ $fd('BusinessModule', scope.row.BusinessModuleEnum) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="BusinessScenarioEnum"
|
||||
label="业务场景"
|
||||
sortable="custom"
|
||||
show-overflow-tooltip
|
||||
width="130"
|
||||
>
|
||||
<!-- 业务场景 -->
|
||||
<el-table-column prop="BusinessScenarioEnum" :label="$t('trials:emailManageCfg:table:BusinessScenarioEnum')"
|
||||
sortable="custom" show-overflow-tooltip min-width="130">
|
||||
<template slot-scope="scope">
|
||||
{{ $fd('Email_BusinessScenario',scope.row.BusinessScenarioEnum) }}
|
||||
{{ $fd('Email_BusinessScenario', scope.row.BusinessScenarioEnum) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 收件人 -->
|
||||
<el-table-column
|
||||
prop="ToUserTypeList"
|
||||
:label="$t('trials:emailManageCfg:title:toUserTypeList')"
|
||||
show-overflow-tooltip
|
||||
width="100"
|
||||
>
|
||||
<!-- 收件人v-if="systemLevel !== 1" -->
|
||||
<el-table-column prop="ToUserTypeList" :label="$t('trials:emailManageCfg:title:toUserTypeList')"
|
||||
show-overflow-tooltip min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.ToUserTypeList.length > 0?scope.row.ToUserTypeList.map(v => $fd('UserType', v)).join('、'):'' }}
|
||||
{{
|
||||
scope.row.ToUserTypeList.length > 0
|
||||
? scope.row.ToUserTypeList.map((v) => $fd('UserType', v)).join(
|
||||
'、'
|
||||
)
|
||||
: ''
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 抄送人 -->
|
||||
<el-table-column
|
||||
prop="CopyUserTypeList"
|
||||
:label="$t('trials:emailManageCfg:title:copyUserTypeList')"
|
||||
show-overflow-tooltip
|
||||
width="100"
|
||||
>
|
||||
<!-- 抄送人v-if="!systemLevel" -->
|
||||
<el-table-column prop="CopyUserTypeList" :label="$t('trials:emailManageCfg:title:copyUserTypeList')"
|
||||
show-overflow-tooltip min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.CopyUserTypeList.length > 0?scope.row.CopyUserTypeList.map(v => $fd('UserType', v)).join('、'):'' }}
|
||||
{{
|
||||
scope.row.CopyUserTypeList.length > 0
|
||||
? scope.row.CopyUserTypeList.map((v) => $fd('UserType', v)).join(
|
||||
'、'
|
||||
)
|
||||
: ''
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="EmailUrgentEnum"
|
||||
label="加急状态"
|
||||
sortable="custom"
|
||||
show-overflow-tooltip
|
||||
width="100"
|
||||
>
|
||||
<!-- 加急状态 -->
|
||||
<el-table-column prop="EmailUrgentEnum" :label="$t('dictionary:email:label:IsUrgent')" sortable="custom"
|
||||
show-overflow-tooltip min-width="110">
|
||||
<template slot-scope="scope">
|
||||
{{ $fd('EmailUrgent',scope.row.EmailUrgentEnum) }}
|
||||
{{ $fd('EmailUrgent', scope.row.EmailUrgentEnum) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="EmailCron"
|
||||
label="发送周期和时间"
|
||||
sortable="custom"
|
||||
show-overflow-tooltip
|
||||
width="160"
|
||||
/>
|
||||
<!-- 发送周期和时间 -->
|
||||
<el-table-column prop="EmailCron" :label="$t('trials:emailManageCfg:table:EmailCron')" sortable="custom"
|
||||
show-overflow-tooltip min-width="180" />
|
||||
<!-- 附件 -->
|
||||
<el-table-column
|
||||
prop="FileName"
|
||||
:label="$t('trials:emailManageCfg:title:fileName')"
|
||||
show-overflow-tooltip
|
||||
width="100"
|
||||
>
|
||||
<el-table-column prop="FileName" :label="$t('trials:emailManageCfg:title:fileName')" show-overflow-tooltip
|
||||
min-width="100" v-if="!systemLevel">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.FilePath" type="text" @click="handlePreview(scope.row.FilePath)">
|
||||
{{ scope.row.FileName }}
|
||||
|
@ -174,115 +162,171 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<!-- 是否需要回执 -->
|
||||
<el-table-column
|
||||
prop="IsReturnRequired"
|
||||
:label="$t('trials:emailManageCfg:title:isReturnRequired')"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
width="140"
|
||||
>
|
||||
<el-table-column prop="IsReturnRequired" :label="$t('trials:emailManageCfg:title:isReturnRequired')"
|
||||
show-overflow-tooltip sortable="custom" min-width="160" v-if="!systemLevel">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.IsReturnRequired" type="danger">
|
||||
{{ $fd('YesOrNo', scope.row.IsReturnRequired) }}
|
||||
</el-tag>
|
||||
<el-tag v-else type="primary">{{ $fd('YesOrNo', scope.row.IsReturnRequired) }}</el-tag>
|
||||
<el-tag v-else type="primary">{{
|
||||
$fd('YesOrNo', scope.row.IsReturnRequired)
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 是否自动发送 -->
|
||||
<el-table-column
|
||||
prop="IsAutoSend"
|
||||
:label="$t('trials:emailManageCfg:title:isAutoSend')"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
width="160"
|
||||
>
|
||||
<el-table-column prop="IsAutoSend" :label="$t('trials:emailManageCfg:title:isAutoSend')" show-overflow-tooltip
|
||||
sortable="custom" min-width="160" v-if="!systemLevel">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.IsAutoSend" type="danger">
|
||||
{{ $fd('YesOrNo', scope.row.IsAutoSend) }}
|
||||
</el-tag>
|
||||
<el-tag v-else type="primary">{{ $fd('YesOrNo', scope.row.IsAutoSend) }}</el-tag>
|
||||
<el-tag v-else type="primary">{{
|
||||
$fd('YesOrNo', scope.row.IsAutoSend)
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="IsEnable"
|
||||
:label="$t('trials:emailManageCfg:table:IsEnable')"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
width="160"
|
||||
>
|
||||
<el-table-column prop="IsEnable" :label="$t('trials:emailManageCfg:table:IsEnable')" show-overflow-tooltip
|
||||
sortable="custom" min-width="160" v-if="!systemLevel">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.IsEnable" type="danger">
|
||||
{{ $fd('YesOrNo', scope.row.IsEnable) }}
|
||||
</el-tag>
|
||||
<el-tag v-else type="primary">{{ $fd('YesOrNo', scope.row.IsEnable) }}</el-tag>
|
||||
<el-tag v-else type="primary">{{
|
||||
$fd('YesOrNo', scope.row.IsEnable)
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 更新时间 -->
|
||||
<el-table-column
|
||||
prop="UpdateTime"
|
||||
:label="$t('trials:emailManageCfg:title:updateTime')"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
width="160"
|
||||
/>
|
||||
<el-table-column prop="UpdateTime" :label="$t('trials:emailManageCfg:title:updateTime')" show-overflow-tooltip
|
||||
sortable="custom" min-width="160" />
|
||||
<!-- 创建时间 -->
|
||||
<el-table-column
|
||||
prop="CreateTime"
|
||||
:label="$t('trials:emailManageCfg:title:createTime')"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
width="160"
|
||||
/>
|
||||
<el-table-column label="Action" width="140" fixed="right">
|
||||
<el-table-column prop="CreateTime" :label="$t('trials:emailManageCfg:title:createTime')" show-overflow-tooltip
|
||||
sortable="custom" min-width="160" />
|
||||
<el-table-column :label="$t('common:action:action')" min-width="180" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleEdit(scope.row)"
|
||||
>
|
||||
编辑
|
||||
<el-button type="text" @click="handleEdit(scope.row)">
|
||||
{{ $t('common:button:edit') }}
|
||||
</el-button>
|
||||
|
||||
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
|
||||
|
||||
<el-button type="text" @click="handleDelete(scope.row)">
|
||||
{{ $t('common:button:delete') }}
|
||||
</el-button>
|
||||
<el-button type="text" @click="
|
||||
preview(scope.row.EmailHtmlContentCN, scope.row.EmailHtmlContent)
|
||||
">{{ $t('common:button:preview') }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<pagination class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize" @pagination="getList" />
|
||||
<pagination class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize"
|
||||
@pagination="getList" />
|
||||
<!-- 搜索框 -->
|
||||
<!-- 修改受试者状态 -->
|
||||
<el-dialog
|
||||
v-if="editVisible"
|
||||
:visible.sync="editVisible"
|
||||
:close-on-click-modal="false"
|
||||
:title="title"
|
||||
width="700px"
|
||||
fullscreen
|
||||
custom-class="base-dialog-wrapper"
|
||||
>
|
||||
<EmailForm :data="rowData" @closeDialog="closeDialog" @getList="getList" />
|
||||
<el-dialog v-if="editVisible" :visible.sync="editVisible" :close-on-click-modal="false" :title="title" width="700px"
|
||||
fullscreen custom-class="base-dialog-wrapper">
|
||||
<EmailForm :data="rowData" :system-level="systemLevel" :isDistinguishCriteria="isDistinguishCriteria"
|
||||
@closeDialog="closeDialog" @getList="getList" @PreviewHTML="preview" />
|
||||
</el-dialog>
|
||||
|
||||
<!-- 修改受试者状态 -->
|
||||
<el-dialog
|
||||
v-if="attachmentVisible"
|
||||
:visible.sync="attachmentVisible"
|
||||
:close-on-click-modal="false"
|
||||
title="附件"
|
||||
width="80%"
|
||||
custom-class="base-dialog-wrapper"
|
||||
append-to-body
|
||||
>
|
||||
<AttachmentList
|
||||
:business-scenario-enum="rowData.BusinessScenarioEnum"
|
||||
:is-distinguish-criteria="rowData.IsDistinguishCriteria"
|
||||
@getList="getList"
|
||||
/>
|
||||
<el-dialog v-if="attachmentVisible" :visible.sync="attachmentVisible" :close-on-click-modal="false"
|
||||
:title="$t('trials:emailManageCfg:title:fileName')" width="80%" custom-class="base-dialog-wrapper" append-to-body>
|
||||
<AttachmentList :business-scenario-enum="rowData.BusinessScenarioEnum"
|
||||
:is-distinguish-criteria="rowData.IsDistinguishCriteria" @getList="getList" />
|
||||
</el-dialog>
|
||||
<!-- 预览模板 -->
|
||||
<el-dialog v-if="previewVisible" :visible.sync="previewVisible" :close-on-click-modal="false"
|
||||
:title="$t('common:button:preview')" fullscreen custom-class="base-dialog-wrapper">
|
||||
<div style="
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-around;
|
||||
flex-wrap: wrap;
|
||||
">
|
||||
<div style="min-width: 50%">
|
||||
<!-- 邮件内容模版(CN) -->
|
||||
<h3>{{ $t('dictionary:email:title:title1') }}</h3>
|
||||
<div v-html="previewHTML"></div>
|
||||
</div>
|
||||
<div style="min-width: 50%">
|
||||
<!-- 邮件内容模版(EN) -->
|
||||
<h3>{{ $t('dictionary:email:title:title2') }}</h3>
|
||||
<div v-html="previewHTMLEN"></div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-drawer :title="$t('trials:emailManageCfg:title:audit')" :visible.sync="drawer" direction="rtl" size="80%">
|
||||
<!-- <div style="width: 800px">
|
||||
<el-form label-width="100px" @submit.native.prevent size="small" :inline="true" class="demo-form-inline">
|
||||
<el-form-item :label="$t('il8n:search:keyword')">
|
||||
<el-input v-model="key" @input="keyChange" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('il8n:search:state')">
|
||||
<el-select v-model="State" clearable filterable @change="handleStateChange">
|
||||
<el-option v-for="item of $d.InternationalizationKeyState"
|
||||
:key="'InternationalizationKeyState' + item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div> -->
|
||||
<el-table :data="tableData" v-adaptive="{ bottomOffset: 50 }" height="100" style="width: 100%"
|
||||
@sort-change="handleSortByColumnDrawer">
|
||||
<!-- Code -->
|
||||
<el-table-column prop="Code" :label="$t('trials:emailManageCfg:title:code')" sortable="custom"
|
||||
show-overflow-tooltip min-width="100" />
|
||||
<el-table-column v-if="isDistinguishCriteria" prop="TrialReadingCriterionId"
|
||||
:label="$t('trials:reviewTrack:table:criterionName')" show-overflow-tooltip sortable="custom" min-width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ $fd('CriterionType', scope.row.CriterionTypeEnum) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 邮件主题(中文) -->
|
||||
<el-table-column prop="EmailTopicCN" :label="$t('trials:emailManageCfg:table:EmailTopicCN')" sortable="custom"
|
||||
show-overflow-tooltip min-width="160">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.EmailTopicCN" @input="
|
||||
(e) => {
|
||||
$set(scope.row, 'EmailTopicCN', e)
|
||||
}
|
||||
" size="mini"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 邮件主题(英文) -->
|
||||
<el-table-column prop="EmailTopic" :label="$t('trials:emailManageCfg:table:EmailTopic')" sortable="custom"
|
||||
show-overflow-tooltip min-width="160">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.EmailTopic" @input="
|
||||
(e) => {
|
||||
$set(scope.row, 'EmailTopic', e)
|
||||
}
|
||||
" size="mini"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 业务层级 -->
|
||||
<el-table-column prop="BusinessLevelEnum" :label="$t('dictionary:email:label:businessLevel')" sortable="custom"
|
||||
show-overflow-tooltip min-width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ $fd('BusinessLevel', scope.row.BusinessLevelEnum) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="text-align: right; padding-top: 10px; padding-right: 10px">
|
||||
<el-button size="mini" @click="drawer = false">{{ $t('common:button:cancel') }}
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="handleSave">{{
|
||||
$t('common:button:save')
|
||||
}}</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</box-content>
|
||||
</template>
|
||||
<script>
|
||||
import { getEmailNoticeConfigList, deleteEmailNoticeConfig } from '@/api/dictionary'
|
||||
import {
|
||||
getEmailNoticeConfigList,
|
||||
deleteEmailNoticeConfig,
|
||||
batchUpdateEmail
|
||||
} from '@/api/dictionary'
|
||||
import { GetEmailNoticeConfigList_Export } from '@/api/export'
|
||||
import BoxContent from '@/components/BoxContent'
|
||||
import Pagination from '@/components/Pagination'
|
||||
import EmailForm from './EmailForm'
|
||||
|
@ -293,8 +337,14 @@ const searchDataDefault = () => {
|
|||
IsUrgent: '',
|
||||
IsEnable: '',
|
||||
CriterionTypeEnum: null,
|
||||
BusinessModuleEnum: null,
|
||||
BusinessScenarioEnum: null,
|
||||
EmailUrgentEnum: null,
|
||||
ToUserType: null,
|
||||
PageIndex: 1,
|
||||
PageSize: 20
|
||||
PageSize: 20,
|
||||
SortField: 'Code',
|
||||
Asc: true,
|
||||
}
|
||||
}
|
||||
export default {
|
||||
|
@ -305,8 +355,14 @@ export default {
|
|||
type: Boolean,
|
||||
default() {
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
systemLevel: {
|
||||
type: Number,
|
||||
default() {
|
||||
return 0
|
||||
},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -318,50 +374,114 @@ export default {
|
|||
rowData: {},
|
||||
title: '',
|
||||
editVisible: false,
|
||||
attachmentVisible: false
|
||||
attachmentVisible: false,
|
||||
previewVisible: false,
|
||||
previewHTML: null,
|
||||
previewHTMLEN: null,
|
||||
multipleSelection: [],
|
||||
drawer: false,
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
UserTypeList() {
|
||||
if (this.systemLevel === 1) {
|
||||
return this.$d.UserType
|
||||
} else {
|
||||
return this.$d.UserType.filter(
|
||||
(item) => ![7, 31, 32, 21, 26, 27].includes(item.value)
|
||||
)
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
async handleSave() {
|
||||
try {
|
||||
let arr = []
|
||||
this.tableData.forEach(item => {
|
||||
let obj = {
|
||||
EmailTopic: item.EmailTopic,
|
||||
EmailTopicCN: item.EmailTopicCN,
|
||||
Id: item.Id
|
||||
}
|
||||
arr.push(obj)
|
||||
})
|
||||
this.drawer = false
|
||||
let res = await batchUpdateEmail(arr)
|
||||
if (res.IsSuccess) {
|
||||
this.$message.success(this.$t('trials:emailManageCfg:message:auditSuccess'))
|
||||
this.getList()
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
},
|
||||
// 排序
|
||||
handleSortByColumnDrawer(column) {
|
||||
if (column.order === 'ascending') {
|
||||
this.tableData.sort((a, b) =>
|
||||
a[column.prop].localeCompare(b[column.prop])
|
||||
)
|
||||
} else {
|
||||
this.tableData.sort((a, b) =>
|
||||
b[column.prop].localeCompare(a[column.prop])
|
||||
)
|
||||
}
|
||||
},
|
||||
openDrawer() {
|
||||
this.tableData = []
|
||||
this.multipleSelection.forEach(item => {
|
||||
let obj = Object.assign({}, item)
|
||||
this.tableData.push(obj)
|
||||
})
|
||||
this.drawer = true
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
// 获取受试者列表
|
||||
getList() {
|
||||
this.loading = true
|
||||
this.searchData.IsDistinguishCriteria = this.isDistinguishCriteria
|
||||
getEmailNoticeConfigList(this.searchData).then(res => {
|
||||
this.loading = false
|
||||
this.list = res.Result.CurrentPageData
|
||||
this.total = res.Result.TotalCount
|
||||
}).catch(() => { this.loading = false })
|
||||
this.searchData.systemLevel = this.systemLevel
|
||||
getEmailNoticeConfigList(this.searchData)
|
||||
.then((res) => {
|
||||
this.loading = false
|
||||
this.list = res.Result.CurrentPageData
|
||||
this.total = res.Result.TotalCount
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 新增
|
||||
handleAdd() {
|
||||
this.rowData = {}
|
||||
this.title = '新增'
|
||||
this.title = this.$t('common:button:new')
|
||||
this.editVisible = true
|
||||
},
|
||||
// 编辑
|
||||
handleEdit(row) {
|
||||
this.rowData = { ...row }
|
||||
this.title = '编辑'
|
||||
this.title = this.$t('common:button:edit')
|
||||
this.editVisible = true
|
||||
},
|
||||
// 删除
|
||||
handleDelete(row) {
|
||||
this.$confirm(this.$t('trials:staffResearch:message:confirmDel'), {
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true
|
||||
})
|
||||
.then(() => {
|
||||
deleteEmailNoticeConfig(row.Id)
|
||||
.then(res => {
|
||||
if (res.IsSuccess) {
|
||||
this.getList()
|
||||
this.$message.success('删除成功!')
|
||||
}
|
||||
})
|
||||
distinguishCancelAndClose: true,
|
||||
}).then(() => {
|
||||
deleteEmailNoticeConfig(row.Id).then((res) => {
|
||||
if (res.IsSuccess) {
|
||||
this.getList()
|
||||
this.$message.success(this.$t('common:message:deletedSuccessfully'))
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
handleDetail(row) {
|
||||
this.rowData = { ...row }
|
||||
|
@ -391,7 +511,24 @@ export default {
|
|||
// 关闭新增、编辑框
|
||||
closeDialog() {
|
||||
this.editVisible = false
|
||||
}
|
||||
}
|
||||
},
|
||||
preview(html, htmlEN) {
|
||||
this.previewHTML = html
|
||||
this.previewHTMLEN = htmlEN
|
||||
this.previewVisible = true
|
||||
},
|
||||
// 导出
|
||||
handleExport() {
|
||||
// this.searchData.IsDistinguishCriteria = this.isDistinguishCriteria
|
||||
// this.searchData.systemLevel = this.systemLevel
|
||||
// return GetEmailNoticeConfigList_Export(this.searchData)
|
||||
return GetEmailNoticeConfigList_Export(this.searchData)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.box-body .search .base-search-form .el-form-item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -2,24 +2,48 @@
|
|||
<box-content>
|
||||
<el-tabs v-model="activeTab" type="border-card">
|
||||
<!-- 通用 -->
|
||||
<el-tab-pane
|
||||
:label="$t('trials:emailManageCfg:title:commom')"
|
||||
name="0"
|
||||
>
|
||||
<EmailList v-if="activeTab === '0'" :is-distinguish-criteria="false"></EmailList>
|
||||
<el-tab-pane :label="$t('trials:emailManageCfg:title:commom')" name="0">
|
||||
<EmailList
|
||||
v-if="activeTab === '0'"
|
||||
:is-distinguish-criteria="false"
|
||||
:system-level="0"
|
||||
></EmailList>
|
||||
</el-tab-pane>
|
||||
<!-- 标准相关 -->
|
||||
<el-tab-pane
|
||||
:label="$t('trials:emailManageCfg:title:criterions')"
|
||||
name="1"
|
||||
>
|
||||
<EmailList v-if="activeTab === '1'" :is-distinguish-criteria="true"></EmailList>
|
||||
<EmailList
|
||||
v-if="activeTab === '1'"
|
||||
:is-distinguish-criteria="true"
|
||||
:system-level="0"
|
||||
></EmailList>
|
||||
</el-tab-pane>
|
||||
<!-- 系统相关 -->
|
||||
<el-tab-pane :label="$t('trials:emailManageCfg:title:system')" name="2">
|
||||
<EmailList
|
||||
v-if="activeTab === '2'"
|
||||
:is-distinguish-criteria="false"
|
||||
:system-level="1"
|
||||
></EmailList>
|
||||
</el-tab-pane>
|
||||
<!-- 系统相关-分角色 -->
|
||||
<!-- <el-tab-pane :label="$t('trials:emailManageCfg:title:systemDisRole')" name="3">
|
||||
<EmailList
|
||||
v-if="activeTab === '3'"
|
||||
:is-distinguish-criteria="false"
|
||||
:system-level="2"
|
||||
></EmailList>
|
||||
</el-tab-pane> -->
|
||||
</el-tabs>
|
||||
</box-content>
|
||||
</template>
|
||||
<script>
|
||||
import { getEmailNoticeConfigList, deleteEmailNoticeConfig } from '@/api/dictionary'
|
||||
import {
|
||||
getEmailNoticeConfigList,
|
||||
deleteEmailNoticeConfig,
|
||||
} from '@/api/dictionary'
|
||||
import BoxContent from '@/components/BoxContent'
|
||||
import Pagination from '@/components/Pagination'
|
||||
import EmailList from './components/EmailList'
|
||||
|
@ -29,7 +53,7 @@ const searchDataDefault = () => {
|
|||
IsUrgent: '',
|
||||
IsEnable: '',
|
||||
PageIndex: 1,
|
||||
PageSize: 20
|
||||
PageSize: 20,
|
||||
}
|
||||
}
|
||||
export default {
|
||||
|
@ -45,7 +69,7 @@ export default {
|
|||
rowData: {},
|
||||
title: '',
|
||||
editVisible: false,
|
||||
attachmentVisible: false
|
||||
attachmentVisible: false,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -55,11 +79,15 @@ export default {
|
|||
// 获取受试者列表
|
||||
getList() {
|
||||
this.loading = true
|
||||
getEmailNoticeConfigList(this.searchData).then(res => {
|
||||
this.loading = false
|
||||
this.list = res.Result.CurrentPageData
|
||||
this.total = res.Result.TotalCount
|
||||
}).catch(() => { this.loading = false })
|
||||
getEmailNoticeConfigList(this.searchData)
|
||||
.then((res) => {
|
||||
this.loading = false
|
||||
this.list = res.Result.CurrentPageData
|
||||
this.total = res.Result.TotalCount
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 新增
|
||||
handleAdd() {
|
||||
|
@ -77,17 +105,15 @@ export default {
|
|||
handleDelete(row) {
|
||||
this.$confirm(this.$t('trials:staffResearch:message:confirmDel'), {
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true
|
||||
})
|
||||
.then(() => {
|
||||
deleteEmailNoticeConfig(row.Id)
|
||||
.then(res => {
|
||||
if (res.IsSuccess) {
|
||||
this.getList()
|
||||
this.$message.success('删除成功!')
|
||||
}
|
||||
})
|
||||
distinguishCancelAndClose: true,
|
||||
}).then(() => {
|
||||
deleteEmailNoticeConfig(row.Id).then((res) => {
|
||||
if (res.IsSuccess) {
|
||||
this.getList()
|
||||
this.$message.success('删除成功!')
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
handleDetail(row) {
|
||||
this.rowData = { ...row }
|
||||
|
@ -117,7 +143,7 @@ export default {
|
|||
// 关闭新增、编辑框
|
||||
closeDialog() {
|
||||
this.editVisible = false
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue