irc_web/.svn/pristine/b0/b07dbecbc5137efcb55d0945e16...

331 lines
9.3 KiB
Plaintext

<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-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-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-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button type="primary" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<span style="margin-left:auto;">
<!-- <el-button
type="primary"
size="mini"
>
场景配置
</el-button> -->
<el-button
type="primary"
size="mini"
@click="handleAdd"
>
新增
</el-button>
</span>
</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-column
prop="Code"
label="Code"
sortable="custom"
show-overflow-tooltip
/>
<el-table-column
prop="BusinessScenarioEnum"
label="业务场景"
show-overflow-tooltip
sortable="custom"
>
<template slot-scope="scope">
{{ $fd('Common_File_BusinessScenario',scope.row.BusinessScenarioEnum) }}
</template>
</el-table-column>
<!-- <el-table-column
prop="Title"
label="标题"
show-overflow-tooltip
/>
<el-table-column
prop="Body"
label="正文"
show-overflow-tooltip
/>
<el-table-column
prop="FromEmail"
label="发件箱"
show-overflow-tooltip
/>
<el-table-column
prop="AuthorizationCode"
label="发件箱授权码"
show-overflow-tooltip
/>
<el-table-column
prop="ReceiveEmail"
label="收件人"
show-overflow-tooltip
/>
<el-table-column
prop="CopyEmail"
label="抄送邮箱"
show-overflow-tooltip
/> -->
<el-table-column
prop="IsReturnRequired"
label="是否需要回执"
show-overflow-tooltip
sortable="custom"
width="130"
>
<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>
</template>
</el-table-column>
<el-table-column
prop="IsUrgent"
label="是否加急"
show-overflow-tooltip
sortable="custom"
>
<template slot-scope="scope">
<el-tag v-if="scope.row.IsUrgent" type="danger">{{ $fd('YesOrNo', scope.row.IsUrgent) }}</el-tag>
<el-tag v-else type="primary">{{ $fd('YesOrNo', scope.row.IsUrgent) }}</el-tag>
</template>
</el-table-column>
<el-table-column
prop="IsAutoSend"
label="是否自动发送"
show-overflow-tooltip
sortable="custom"
>
<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>
</template>
</el-table-column>
<el-table-column
prop="IsDistinguishCriteria"
label="是否区分标准"
show-overflow-tooltip
sortable="custom"
>
<template slot-scope="scope">
<el-tag v-if="scope.row.IsDistinguishCriteria" type="danger">{{ $fd('YesOrNo', scope.row.IsDistinguishCriteria) }}</el-tag>
<el-tag v-else type="primary">{{ $fd('YesOrNo', scope.row.IsDistinguishCriteria) }}</el-tag>
</template>
</el-table-column>
<el-table-column
prop="IsEnable"
label="是否启用"
show-overflow-tooltip
sortable="custom"
>
<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>
</template>
</el-table-column>
<el-table-column
prop="UpdateTime"
label="更新时间"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
prop="CreateTime"
label="创建时间"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column label="Action" width="140" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
@click="handleDetail(scope.row)"
>
附件
</el-button>
<el-button
type="text"
@click="handleEdit(scope.row)"
>
编辑
</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<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"
:fullscreen="true"
width="700px"
custom-class="base-dialog-wrapper"
>
<EmailForm :data="rowData" @closeDialog="closeDialog" @getList="getList" />
</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>
</box-content>
</template>
<script>
import { getEmailNoticeConfigList, deleteEmailNoticeConfig } from '@/api/dictionary'
import BoxContent from '@/components/BoxContent'
import Pagination from '@/components/Pagination'
import EmailForm from './components/EmailForm'
import AttachmentList from './components/AttachmentList'
const searchDataDefault = () => {
return {
IsReturnRequired: '',
IsUrgent: '',
IsEnable: '',
PageIndex: 1,
PageSize: 20
}
}
export default {
name: 'EmailList',
components: { BoxContent, Pagination, EmailForm, AttachmentList },
data() {
return {
searchData: searchDataDefault(),
loading: false,
list: [],
total: 0,
rowData: {},
title: '',
editVisible: false,
attachmentVisible: false
}
},
mounted() {
this.getList()
},
methods: {
// 获取受试者列表
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 })
},
// 新增
handleAdd() {
this.rowData = {}
this.title = '新增'
this.editVisible = true
},
// 编辑
handleEdit(row) {
this.rowData = { ...row }
this.title = '编辑'
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('删除成功!')
}
})
})
},
handleDetail(row) {
this.rowData = { ...row }
this.attachmentVisible = true
},
// 查询
handleSearch() {
this.searchData.PageIndex = 1
this.getList()
},
// 重置
handleReset() {
this.searchData = searchDataDefault()
this.getList()
},
// 排序
handleSortByColumn(column) {
if (column.order === 'ascending') {
this.searchData.Asc = true
} else {
this.searchData.Asc = false
}
this.searchData.SortField = column.prop
this.searchData.PageIndex = 1
this.getList()
},
// 关闭新增、编辑框
closeDialog() {
this.editVisible = false
}
}
}
</script>