邮件管理新增系统相关分角色tab
continuous-integration/drone/push Build is passing Details

uat_us
DESKTOP-6C3NK6N\WXS 2024-08-06 17:12:31 +08:00
parent 0b49bd8dab
commit e955f4973c
3 changed files with 493 additions and 301 deletions

View File

@ -59,9 +59,14 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if='!IsSystemLevel'> <el-col :span="12" v-if="IsSystemLevel < 2">
<el-form-item label="收件人" prop="ToUserTypeList"> <el-form-item label="收件人" prop="ToUserTypeList">
<el-select v-model="form.ToUserTypeList" clearable multiple class="mr"> <el-select
v-model="form.ToUserTypeList"
clearable
multiple
class="mr"
>
<el-option <el-option
v-for="item of $d.UserType" v-for="item of $d.UserType"
:key="`ToUserTypeList${item.label}`" :key="`ToUserTypeList${item.label}`"
@ -71,9 +76,14 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if='!IsSystemLevel'> <el-col :span="12" v-if="!IsSystemLevel">
<el-form-item label="抄送人" prop="CopyUserTypeList"> <el-form-item label="抄送人" prop="CopyUserTypeList">
<el-select v-model="form.CopyUserTypeList" clearable multiple class="mr"> <el-select
v-model="form.CopyUserTypeList"
clearable
multiple
class="mr"
>
<el-option <el-option
v-for="item of $d.UserType" v-for="item of $d.UserType"
:key="`CopyUserTypeList${item.label}`" :key="`CopyUserTypeList${item.label}`"
@ -83,9 +93,18 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if='!IsSystemLevel'> <el-col :span="12" v-if="!IsSystemLevel">
<el-form-item label="加急状态" prop="EmailUrgentEnum"> <el-form-item label="加急状态" prop="EmailUrgentEnum">
<el-select v-model="form.EmailUrgentEnum" @change="(v) => {v === 1 ? form.EmailCron = null : null}" clearable class="mr"> <el-select
v-model="form.EmailUrgentEnum"
@change="
(v) => {
v === 1 ? (form.EmailCron = null) : null;
}
"
clearable
class="mr"
>
<el-option <el-option
v-for="item of $d.EmailUrgent" v-for="item of $d.EmailUrgent"
:key="`EmailUrgent${item.label}`" :key="`EmailUrgent${item.label}`"
@ -95,13 +114,17 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if='!IsSystemLevel'> <el-col :span="12" v-if="!IsSystemLevel">
<el-form-item label="发送周期和时间" v-if="form.EmailUrgentEnum !== 1" prop="EmailCron"> <el-form-item
label="发送周期和时间"
v-if="form.EmailUrgentEnum !== 1"
prop="EmailCron"
>
<el-input style="width: 300px" readonly v-model="form.EmailCron" /> <el-input style="width: 300px" readonly v-model="form.EmailCron" />
<el-button type="primary" @click="showDialog"> cron</el-button> <el-button type="primary" @click="showDialog"> cron</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if='!IsSystemLevel'> <el-col :span="12" v-if="!IsSystemLevel">
<el-form-item label="是否需要回执" prop="IsReturnRequired"> <el-form-item label="是否需要回执" prop="IsReturnRequired">
<el-radio-group v-model="form.IsReturnRequired"> <el-radio-group v-model="form.IsReturnRequired">
<el-radio :label="true"></el-radio> <el-radio :label="true"></el-radio>
@ -109,7 +132,7 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if='!IsSystemLevel'> <el-col :span="12" v-if="!IsSystemLevel">
<el-form-item label="是否自动发送" prop="IsAutoSend"> <el-form-item label="是否自动发送" prop="IsAutoSend">
<el-radio-group v-model="form.IsAutoSend"> <el-radio-group v-model="form.IsAutoSend">
<el-radio :label="true"></el-radio> <el-radio :label="true"></el-radio>
@ -117,18 +140,27 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if='!IsSystemLevel'> <el-col :span="12" v-if="!IsSystemLevel">
<el-form-item label="是否区分标准" prop="IsDistinguishCriteria"> <el-form-item label="是否区分标准" prop="IsDistinguishCriteria">
<el-radio-group v-model="form.IsDistinguishCriteria" @change="() => {form.CriterionTypeEnum = null}"> <el-radio-group
v-model="form.IsDistinguishCriteria"
@change="
() => {
form.CriterionTypeEnum = null;
}
"
>
<el-radio :label="true"></el-radio> <el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio> <el-radio :label="false"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if='!IsSystemLevel'> <el-col :span="12" v-if="!IsSystemLevel">
<el-form-item <el-form-item
:label="$t('trials:auditRecord:table:criterion')" :label="$t('trials:auditRecord:table:criterion')"
v-if="form.IsDistinguishCriteria" prop="CriterionTypeEnum"> v-if="form.IsDistinguishCriteria"
prop="CriterionTypeEnum"
>
<el-select v-model="form.CriterionTypeEnum" clearable class="mr"> <el-select v-model="form.CriterionTypeEnum" clearable class="mr">
<el-option <el-option
v-for="item of $d.CriterionType" v-for="item of $d.CriterionType"
@ -139,7 +171,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if='!IsSystemLevel'> <el-col :span="12" v-if="!IsSystemLevel">
<el-form-item label="是否启用" prop="IsEnable"> <el-form-item label="是否启用" prop="IsEnable">
<el-radio-group v-model="form.IsEnable"> <el-radio-group v-model="form.IsEnable">
<el-radio :label="true"></el-radio> <el-radio :label="true"></el-radio>
@ -147,7 +179,7 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if='!IsSystemLevel'> <el-col :span="12" v-if="!IsSystemLevel">
<el-form-item label="附件CN" prop="IsEnable"> <el-form-item label="附件CN" prop="IsEnable">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
@ -160,11 +192,16 @@
:limit="1" :limit="1"
:file-list="fileListCN" :file-list="fileListCN"
> >
<el-button size="small" type="primary" :disabled="fileListCN.length > 0">{{$t('common:button:upload')}}</el-button> <el-button
size="small"
type="primary"
:disabled="fileListCN.length > 0"
>{{ $t("common:button:upload") }}</el-button
>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if='!IsSystemLevel'> <el-col :span="12" v-if="!IsSystemLevel">
<el-form-item label="附件EN" prop="IsEnable"> <el-form-item label="附件EN" prop="IsEnable">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
@ -177,7 +214,12 @@
:limit="1" :limit="1"
:file-list="fileListEN" :file-list="fileListEN"
> >
<el-button size="small" type="primary" :disabled="fileListEN.length > 0">{{$t('common:button:upload')}}</el-button> <el-button
size="small"
type="primary"
:disabled="fileListEN.length > 0"
>{{ $t("common:button:upload") }}</el-button
>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -196,85 +238,117 @@
:autosize="{ minRows: 8, maxRows: 8 }" :autosize="{ minRows: 8, maxRows: 8 }"
/> />
</el-form-item> </el-form-item>
<div class="base-dialog-footer" style="text-align:right;margin-top:10px;padding-bottom: 10px"> <div
<el-form-item style="text-align:right;"> class="base-dialog-footer"
<el-button size="small" type="primary" @click="handleSave">Save</el-button> 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
>
</el-form-item> </el-form-item>
</div> </div>
<el-dialog append-to-body title="生成 cron" :visible.sync="showCron"> <el-dialog append-to-body title="生成 cron" :visible.sync="showCron">
<vcrontab :hideComponent="['year']" @hide="showCron=false" @fill="crontabFill" :expression="expression"></vcrontab> <vcrontab
:hideComponent="['year']"
@hide="showCron = false"
@fill="crontabFill"
:expression="expression"
></vcrontab>
</el-dialog> </el-dialog>
</el-form> </el-form>
</template> </template>
<script> <script>
import { Upload, addOrUpdateEmailNoticeConfigList } from '@/api/dictionary' import { Upload, addOrUpdateEmailNoticeConfigList } from "@/api/dictionary";
export default { export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default() { return {} } default() {
return {};
},
}, },
IsSystemLevel: { IsSystemLevel: {
type: Boolean, type: Number,
default() { default() {
return false return 0;
} },
} },
}, },
data() { data() {
return { return {
expression: '', expression: "",
showCron: false, showCron: false,
form: { form: {
Id: '', Id: "",
Code: '', Code: "",
EmailTopicCN: '', EmailTopicCN: "",
EmailTopic: '', EmailTopic: "",
BusinessLevelEnum: '', BusinessLevelEnum: "",
BusinessModuleEnum: '', BusinessModuleEnum: "",
ToUserTypeList: '', ToUserTypeList: "",
CopyUserTypeList: '', CopyUserTypeList: "",
EmailUrgentEnum: '', EmailUrgentEnum: "",
EmailCron: '', EmailCron: "",
BusinessScenarioEnum: null, BusinessScenarioEnum: null,
EmailHtmlContentCN: '', EmailHtmlContentCN: "",
EmailHtmlContent: '', EmailHtmlContent: "",
AttachPath: '', AttachPath: "",
AttachName: '', AttachName: "",
AttachNameCN: '', AttachNameCN: "",
AttachCNPath: '', AttachCNPath: "",
IsDistinguishCriteria: true, IsDistinguishCriteria: true,
IsReturnRequired: true, IsReturnRequired: true,
IsUrgent: true, IsUrgent: true,
IsEnable: true, IsEnable: true,
IsAutoSend: true, IsAutoSend: true,
CriterionTypeEnum: null CriterionTypeEnum: null,
}, },
rules: { rules: {
Code: [{ required: true, message: 'Please select', trigger: ['blur'] }], Code: [{ required: true, message: "Please select", trigger: ["blur"] }],
BusinessScenarioEnum: [{ required: true, message: 'Please select', trigger: ['blur'] }], BusinessScenarioEnum: [
EmailTopicCN: [{ required: true, message: 'Please select', trigger: ['blur'] }], { required: true, message: "Please select", trigger: ["blur"] },
EmailTopic: [{ required: true, message: 'Please select', trigger: ['blur'] }], ],
BusinessLevelEnum: [{ required: true, message: 'Please select', trigger: ['blur'] }], EmailTopicCN: [
ToUserTypeList: [{ required: true, message: 'Please select', trigger: ['blur'] }], { required: true, message: "Please select", trigger: ["blur"] },
EmailCron: [{ required: true, message: 'Please select', trigger: ['blur'] }], ],
EmailUrgentEnum: [{ required: true, message: 'Please select', trigger: ['blur'] }], EmailTopic: [
EmailHtmlContentCN: [{ required: true, message: 'Please select', trigger: ['blur'] }], { required: true, message: "Please select", trigger: ["blur"] },
EmailHtmlContent: [{ required: true, message: 'Please select', trigger: ['blur'] }], ],
CriterionTypeEnum: [{ 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"] },
],
}, },
scenarioOption: [], scenarioOption: [],
fileListCN: [], fileListCN: [],
fileListEN: [], fileListEN: [],
loading: false loading: false,
} };
}, },
mounted() { mounted() {
this.initForm(); this.initForm();
if (this.IsSystemLevel) { if (this.IsSystemLevel) {
this.form.ToUserTypeList = []; this.form.ToUserTypeList = [];
this.form.CopyUserTypeList = []; this.form.CopyUserTypeList = [];
this.form.EmailUrgentEnum = '3'; this.form.EmailUrgentEnum = "3";
this.form.IsReturnRequired = false; this.form.IsReturnRequired = false;
this.form.IsDistinguishCriteria = false; this.form.IsDistinguishCriteria = false;
} }
@ -288,92 +362,114 @@ export default {
this.form.EmailCron = value; this.form.EmailCron = value;
}, },
handleRemoveFileCN() { handleRemoveFileCN() {
this.form.AttachNameCN = null this.form.AttachNameCN = null;
this.form.AttachCNPath = null this.form.AttachCNPath = null;
this.fileListCN = [] this.fileListCN = [];
}, },
beforeUploadCN() { beforeUploadCN() {
if (this.fileListCN.length > 0) { if (this.fileListCN.length > 0) {
this.$alert('最多只能传一个附件') this.$alert("最多只能传一个附件");
return return;
} }
}, },
handlePreviewCN(row, r2) { handlePreviewCN(row, r2) {
if (row.fullPath) { if (row.fullPath) {
window.open(row.fullPath, '_blank') window.open(row.fullPath, "_blank");
} }
}, },
handleUploadFileCN(param) { handleUploadFileCN(param) {
this.btnLoading = true this.btnLoading = true;
const formData = new FormData() const formData = new FormData();
formData.append('file', param.file) formData.append("file", param.file);
this.form.AttachNameCN = param.file.name this.form.AttachNameCN = param.file.name;
Upload(formData, 3).then(res => { Upload(formData, 3).then((res) => {
this.form.AttachCNPath = res.Result.FilePath this.form.AttachCNPath = res.Result.FilePath;
this.btnLoading = false 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) { handleUploadFileEN(param) {
this.btnLoading = true this.btnLoading = true;
const formData = new FormData() const formData = new FormData();
formData.append('file', param.file) formData.append("file", param.file);
this.form.AttachName = param.file.name this.form.AttachName = param.file.name;
Upload(formData, 3).then(res => { Upload(formData, 3).then((res) => {
this.form.AttachPath = res.Result.FilePath this.form.AttachPath = res.Result.FilePath;
this.btnLoading = false 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() { handleRemoveFileEN() {
this.form.AttachName = null this.form.AttachName = null;
this.form.AttachPath = null this.form.AttachPath = null;
this.fileListEN = [] this.fileListEN = [];
}, },
beforeUploadEN() { beforeUploadEN() {
if (this.fileListEN.length > 0) { if (this.fileListEN.length > 0) {
this.$alert('最多只能传一个附件') this.$alert("最多只能传一个附件");
return return;
} }
}, },
handlePreviewEN(row, r2) { handlePreviewEN(row, r2) {
if (row.fullPath) { if (row.fullPath) {
window.open(row.fullPath, '_blank') window.open(row.fullPath, "_blank");
} }
}, },
async initForm() { async initForm() {
this.loading = true this.loading = true;
// await this.getScenarios() // await this.getScenarios()
for (const k in this.form) { for (const k in this.form) {
if (this.data.hasOwnProperty(k)) { if (this.data.hasOwnProperty(k)) {
this.form[k] = this.data[k] this.form[k] = this.data[k];
} }
if (k === 'AttachPath' && this.form[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]) { 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,
});
} }
} }
this.loading = false this.loading = false;
}, },
// //
handleSave() { handleSave() {
this.$refs.emailForm.validate(valid => { this.$refs.emailForm.validate((valid) => {
if (!valid) return if (!valid) return;
this.loading = true this.loading = true;
this.form.IsSystemLevel = this.IsSystemLevel; this.form.IsSystemLevel = this.IsSystemLevel;
addOrUpdateEmailNoticeConfigList(this.form).then(res => { addOrUpdateEmailNoticeConfigList(this.form)
this.loading = false .then((res) => {
this.$emit('closeDialog') this.loading = false;
this.$emit('getList') this.$emit("closeDialog");
this.$message.success('Saved successfully') this.$emit("getList");
}).catch(() => { this.$message.success("Saved successfully");
this.loading = false
}) })
}) .catch(() => {
} this.loading = false;
} });
} });
},
},
};
</script> </script>

View File

@ -1,25 +1,69 @@
<template> <template>
<box-content> <box-content>
<div class="search"> <div class="search">
<el-form v-if="!IsSystemLevel" :inline="true" size="mini" class="base-search-form"> <el-form
v-if="!IsSystemLevel"
:inline="true"
size="mini"
class="base-search-form"
>
<el-form-item label="是否需要回执:"> <el-form-item label="是否需要回执:">
<el-select v-model="searchData.IsReturnRequired" clearable style="width:100px;"> <el-select
<el-option v-for="item of $d.YesOrNo" :value="item.value" :label="item.label" :key="item.id"/> 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-select>
</el-form-item> </el-form-item>
<el-form-item label="是否加急:"> <el-form-item label="是否加急:">
<el-select v-model="searchData.IsUrgent" clearable style="width:100px;"> <el-select
<el-option v-for="item of $d.YesOrNo" :value="item.value" :label="item.label" :key="item.id"/> 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-select>
</el-form-item> </el-form-item>
<el-form-item label="是否启用:"> <el-form-item label="是否启用:">
<el-select v-model="searchData.IsEnable" clearable style="width:100px;"> <el-select
<el-option v-for="item of $d.YesOrNo" :value="item.value" :label="item.label" :key="item.id"/> 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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('trials:auditRecord:table:criterion')" v-if="isDistinguishCriteria"> <el-form-item
<el-select v-model="searchData.CriterionTypeEnum" clearable style="width:100px;"> :label="$t('trials:auditRecord:table:criterion')"
<el-option v-for="item of $d.CriterionType" :value="item.value" :label="item.label" :key="item.id"/> 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"
:key="item.id"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -27,22 +71,17 @@
<el-button type="primary" @click="handleReset"></el-button> <el-button type="primary" @click="handleReset"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span style="margin-left:auto;"> <span style="margin-left: auto">
<!-- <el-button <!-- <el-button
type="primary" type="primary"
size="mini" size="mini"
> >
场景配置 场景配置
</el-button> --> </el-button> -->
<el-button <el-button type="primary" size="mini" @click="handleAdd">
type="primary"
size="mini"
@click="handleAdd"
>
新增 新增
</el-button> </el-button>
</span> </span>
</div> </div>
<!-- 受试者列表 --> <!-- 受试者列表 -->
<el-table <el-table
@ -72,7 +111,7 @@
min-width="120" min-width="120"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ $fd('CriterionType', scope.row.CriterionTypeEnum) }} {{ $fd("CriterionType", scope.row.CriterionTypeEnum) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -94,9 +133,10 @@
label="业务层级" label="业务层级"
sortable="custom" sortable="custom"
show-overflow-tooltip show-overflow-tooltip
min-width="100"> min-width="100"
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ $fd('BusinessLevel',scope.row.BusinessLevelEnum) }} {{ $fd("BusinessLevel", scope.row.BusinessLevelEnum) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -104,9 +144,10 @@
label="业务模块" label="业务模块"
sortable="custom" sortable="custom"
show-overflow-tooltip show-overflow-tooltip
min-width="100"> min-width="100"
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ $fd('BusinessModule',scope.row.BusinessModuleEnum) }} {{ $fd("BusinessModule", scope.row.BusinessModuleEnum) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -117,7 +158,7 @@
min-width="130" min-width="130"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ $fd('Email_BusinessScenario',scope.row.BusinessScenarioEnum) }} {{ $fd("Email_BusinessScenario", scope.row.BusinessScenarioEnum) }}
</template> </template>
</el-table-column> </el-table-column>
<!-- 收件人 --> <!-- 收件人 -->
@ -126,10 +167,16 @@
:label="$t('trials:emailManageCfg:title:toUserTypeList')" :label="$t('trials:emailManageCfg:title:toUserTypeList')"
show-overflow-tooltip show-overflow-tooltip
min-width="100" min-width="100"
v-if="!IsSystemLevel" v-if="IsSystemLevel < 2"
> >
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
<!-- 抄送人 --> <!-- 抄送人 -->
@ -141,7 +188,13 @@
v-if="!IsSystemLevel" v-if="!IsSystemLevel"
> >
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -153,7 +206,7 @@
v-if="!IsSystemLevel" v-if="!IsSystemLevel"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ $fd('EmailUrgent',scope.row.EmailUrgentEnum) }} {{ $fd("EmailUrgent", scope.row.EmailUrgentEnum) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -173,7 +226,11 @@
v-if="!IsSystemLevel" v-if="!IsSystemLevel"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="scope.row.FilePath" type="text" @click="handlePreview(scope.row.FilePath)"> <el-button
v-if="scope.row.FilePath"
type="text"
@click="handlePreview(scope.row.FilePath)"
>
{{ scope.row.FileName }} {{ scope.row.FileName }}
</el-button> </el-button>
</template> </template>
@ -189,9 +246,11 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.IsReturnRequired" type="danger"> <el-tag v-if="scope.row.IsReturnRequired" type="danger">
{{ $fd('YesOrNo', scope.row.IsReturnRequired) }} {{ $fd("YesOrNo", scope.row.IsReturnRequired) }}
</el-tag> </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> </template>
</el-table-column> </el-table-column>
<!-- 是否自动发送 --> <!-- 是否自动发送 -->
@ -205,9 +264,11 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.IsAutoSend" type="danger"> <el-tag v-if="scope.row.IsAutoSend" type="danger">
{{ $fd('YesOrNo', scope.row.IsAutoSend) }} {{ $fd("YesOrNo", scope.row.IsAutoSend) }}
</el-tag> </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> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -220,9 +281,11 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.IsEnable" type="danger"> <el-tag v-if="scope.row.IsEnable" type="danger">
{{ $fd('YesOrNo', scope.row.IsEnable) }} {{ $fd("YesOrNo", scope.row.IsEnable) }}
</el-tag> </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> </template>
</el-table-column> </el-table-column>
<!-- 更新时间 --> <!-- 更新时间 -->
@ -243,20 +306,24 @@
/> />
<el-table-column label="Action" min-width="140" fixed="right"> <el-table-column label="Action" min-width="140" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button type="text" @click="handleEdit(scope.row)">
type="text"
@click="handleEdit(scope.row)"
>
编辑 编辑
</el-button> </el-button>
<el-button type="text" @click="handleDelete(scope.row)"></el-button> <el-button type="text" @click="handleDelete(scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </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 <el-dialog
@ -268,7 +335,12 @@
fullscreen fullscreen
custom-class="base-dialog-wrapper" custom-class="base-dialog-wrapper"
> >
<EmailForm :data="rowData" :is-system-level="IsSystemLevel" @closeDialog="closeDialog" @getList="getList" /> <EmailForm
:data="rowData"
:is-system-level="IsSystemLevel"
@closeDialog="closeDialog"
@getList="getList"
/>
</el-dialog> </el-dialog>
<!-- 修改受试者状态 --> <!-- 修改受试者状态 -->
@ -290,123 +362,128 @@
</box-content> </box-content>
</template> </template>
<script> <script>
import { getEmailNoticeConfigList, deleteEmailNoticeConfig } from '@/api/dictionary' import {
import BoxContent from '@/components/BoxContent' getEmailNoticeConfigList,
import Pagination from '@/components/Pagination' deleteEmailNoticeConfig,
import EmailForm from './EmailForm' } from "@/api/dictionary";
import AttachmentList from './AttachmentList' import BoxContent from "@/components/BoxContent";
import Pagination from "@/components/Pagination";
import EmailForm from "./EmailForm";
import AttachmentList from "./AttachmentList";
const searchDataDefault = () => { const searchDataDefault = () => {
return { return {
IsReturnRequired: '', IsReturnRequired: "",
IsUrgent: '', IsUrgent: "",
IsEnable: '', IsEnable: "",
CriterionTypeEnum: null, CriterionTypeEnum: null,
PageIndex: 1, PageIndex: 1,
PageSize: 20 PageSize: 20,
} };
} };
export default { export default {
name: 'EmailList', name: "EmailList",
components: { BoxContent, Pagination, EmailForm, AttachmentList }, components: { BoxContent, Pagination, EmailForm, AttachmentList },
props: { props: {
isDistinguishCriteria: { isDistinguishCriteria: {
type: Boolean, type: Boolean,
default() { default() {
return false return false;
} },
}, },
IsSystemLevel: { IsSystemLevel: {
type: Boolean, type: Number,
default() { default() {
return false return 0;
} },
} },
}, },
data() { data() {
return { return {
activeTab: '0', activeTab: "0",
searchData: searchDataDefault(), searchData: searchDataDefault(),
loading: false, loading: false,
list: [], list: [],
total: 0, total: 0,
rowData: {}, rowData: {},
title: '', title: "",
editVisible: false, editVisible: false,
attachmentVisible: false attachmentVisible: false,
} };
}, },
mounted() { mounted() {
this.getList() this.getList();
}, },
methods: { methods: {
// //
getList() { getList() {
this.loading = true this.loading = true;
this.searchData.IsDistinguishCriteria = this.isDistinguishCriteria; this.searchData.IsDistinguishCriteria = this.isDistinguishCriteria;
this.searchData.IsSystemLevel = this.IsSystemLevel; this.searchData.IsSystemLevel = this.IsSystemLevel;
getEmailNoticeConfigList(this.searchData).then(res => { getEmailNoticeConfigList(this.searchData)
this.loading = false .then((res) => {
this.list = res.Result.CurrentPageData this.loading = false;
this.total = res.Result.TotalCount this.list = res.Result.CurrentPageData;
}).catch(() => { this.loading = false }) this.total = res.Result.TotalCount;
})
.catch(() => {
this.loading = false;
});
}, },
// //
handleAdd() { handleAdd() {
this.rowData = {} this.rowData = {};
this.title = '新增' this.title = "新增";
this.editVisible = true this.editVisible = true;
}, },
// //
handleEdit(row) { handleEdit(row) {
this.rowData = { ...row } this.rowData = { ...row };
this.title = '编辑' this.title = "编辑";
this.editVisible = true this.editVisible = true;
}, },
// //
handleDelete(row) { handleDelete(row) {
this.$confirm(this.$t('trials:staffResearch:message:confirmDel'), { this.$confirm(this.$t("trials:staffResearch:message:confirmDel"), {
type: 'warning', type: "warning",
distinguishCancelAndClose: true distinguishCancelAndClose: true,
}) }).then(() => {
.then(() => { deleteEmailNoticeConfig(row.Id).then((res) => {
deleteEmailNoticeConfig(row.Id)
.then(res => {
if (res.IsSuccess) { if (res.IsSuccess) {
this.getList() this.getList();
this.$message.success('删除成功!') this.$message.success("删除成功!");
} }
}) });
}) });
}, },
handleDetail(row) { handleDetail(row) {
this.rowData = { ...row } this.rowData = { ...row };
this.attachmentVisible = true this.attachmentVisible = true;
}, },
// //
handleSearch() { handleSearch() {
this.searchData.PageIndex = 1 this.searchData.PageIndex = 1;
this.getList() this.getList();
}, },
// //
handleReset() { handleReset() {
this.searchData = searchDataDefault() this.searchData = searchDataDefault();
this.getList() this.getList();
}, },
// //
handleSortByColumn(column) { handleSortByColumn(column) {
if (column.order === 'ascending') { if (column.order === "ascending") {
this.searchData.Asc = true this.searchData.Asc = true;
} else { } else {
this.searchData.Asc = false this.searchData.Asc = false;
} }
this.searchData.SortField = column.prop this.searchData.SortField = column.prop;
this.searchData.PageIndex = 1 this.searchData.PageIndex = 1;
this.getList() this.getList();
}, },
// //
closeDialog() { closeDialog() {
this.editVisible = false this.editVisible = false;
} },
} },
} };
</script> </script>

View File

@ -2,129 +2,148 @@
<box-content> <box-content>
<el-tabs v-model="activeTab" type="border-card"> <el-tabs v-model="activeTab" type="border-card">
<!-- 通用 --> <!-- 通用 -->
<el-tab-pane <el-tab-pane :label="$t('trials:emailManageCfg:title:commom')" name="0">
:label="$t('trials:emailManageCfg:title:commom')" <EmailList
name="0" v-if="activeTab === '0'"
> :is-distinguish-criteria="false"
<EmailList v-if="activeTab === '0'" :is-distinguish-criteria="false" :is-system-level="false"></EmailList> :is-system-level="0"
></EmailList>
</el-tab-pane> </el-tab-pane>
<!-- 标准相关 --> <!-- 标准相关 -->
<el-tab-pane <el-tab-pane
:label="$t('trials:emailManageCfg:title:criterions')" :label="$t('trials:emailManageCfg:title:criterions')"
name="1" name="1"
> >
<EmailList v-if="activeTab === '1'" :is-distinguish-criteria="true" :is-system-level="false"></EmailList> <EmailList
v-if="activeTab === '1'"
:is-distinguish-criteria="true"
:is-system-level="0"
></EmailList>
</el-tab-pane> </el-tab-pane>
<!-- 标准相关 --> <!-- 系统相关 -->
<el-tab-pane <el-tab-pane :label="$t('trials:emailManageCfg:title:system')" name="2">
:label="$t('trials:emailManageCfg:title:system')" <EmailList
name="2" v-if="activeTab === '2'"
> :is-distinguish-criteria="false"
<EmailList v-if="activeTab === '2'" :is-distinguish-criteria="false" :is-system-level="true"></EmailList> :is-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"
:is-system-level="2"
></EmailList>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</box-content> </box-content>
</template> </template>
<script> <script>
import { getEmailNoticeConfigList, deleteEmailNoticeConfig } from '@/api/dictionary' import {
import BoxContent from '@/components/BoxContent' getEmailNoticeConfigList,
import Pagination from '@/components/Pagination' deleteEmailNoticeConfig,
import EmailList from './components/EmailList' } from "@/api/dictionary";
import BoxContent from "@/components/BoxContent";
import Pagination from "@/components/Pagination";
import EmailList from "./components/EmailList";
const searchDataDefault = () => { const searchDataDefault = () => {
return { return {
IsReturnRequired: '', IsReturnRequired: "",
IsUrgent: '', IsUrgent: "",
IsEnable: '', IsEnable: "",
PageIndex: 1, PageIndex: 1,
PageSize: 20 PageSize: 20,
} };
} };
export default { export default {
name: 'EmailListIndex', name: "EmailListIndex",
components: { BoxContent, Pagination, EmailList }, components: { BoxContent, Pagination, EmailList },
data() { data() {
return { return {
activeTab: '0', activeTab: "0",
searchData: searchDataDefault(), searchData: searchDataDefault(),
loading: false, loading: false,
list: [], list: [],
total: 0, total: 0,
rowData: {}, rowData: {},
title: '', title: "",
editVisible: false, editVisible: false,
attachmentVisible: false attachmentVisible: false,
} };
}, },
mounted() { mounted() {
this.getList() this.getList();
}, },
methods: { methods: {
// //
getList() { getList() {
this.loading = true this.loading = true;
getEmailNoticeConfigList(this.searchData).then(res => { getEmailNoticeConfigList(this.searchData)
this.loading = false .then((res) => {
this.list = res.Result.CurrentPageData this.loading = false;
this.total = res.Result.TotalCount this.list = res.Result.CurrentPageData;
}).catch(() => { this.loading = false }) this.total = res.Result.TotalCount;
})
.catch(() => {
this.loading = false;
});
}, },
// //
handleAdd() { handleAdd() {
this.rowData = {} this.rowData = {};
this.title = '新增' this.title = "新增";
this.editVisible = true this.editVisible = true;
}, },
// //
handleEdit(row) { handleEdit(row) {
this.rowData = { ...row } this.rowData = { ...row };
this.title = '编辑' this.title = "编辑";
this.editVisible = true this.editVisible = true;
}, },
// //
handleDelete(row) { handleDelete(row) {
this.$confirm(this.$t('trials:staffResearch:message:confirmDel'), { this.$confirm(this.$t("trials:staffResearch:message:confirmDel"), {
type: 'warning', type: "warning",
distinguishCancelAndClose: true distinguishCancelAndClose: true,
}) }).then(() => {
.then(() => { deleteEmailNoticeConfig(row.Id).then((res) => {
deleteEmailNoticeConfig(row.Id)
.then(res => {
if (res.IsSuccess) { if (res.IsSuccess) {
this.getList() this.getList();
this.$message.success('删除成功!') this.$message.success("删除成功!");
} }
}) });
}) });
}, },
handleDetail(row) { handleDetail(row) {
this.rowData = { ...row } this.rowData = { ...row };
this.attachmentVisible = true this.attachmentVisible = true;
}, },
// //
handleSearch() { handleSearch() {
this.searchData.PageIndex = 1 this.searchData.PageIndex = 1;
this.getList() this.getList();
}, },
// //
handleReset() { handleReset() {
this.searchData = searchDataDefault() this.searchData = searchDataDefault();
this.getList() this.getList();
}, },
// //
handleSortByColumn(column) { handleSortByColumn(column) {
if (column.order === 'ascending') { if (column.order === "ascending") {
this.searchData.Asc = true this.searchData.Asc = true;
} else { } else {
this.searchData.Asc = false this.searchData.Asc = false;
} }
this.searchData.SortField = column.prop this.searchData.SortField = column.prop;
this.searchData.PageIndex = 1 this.searchData.PageIndex = 1;
this.getList() this.getList();
}, },
// //
closeDialog() { closeDialog() {
this.editVisible = false this.editVisible = false;
} },
} },
} };
</script> </script>