申办方、cro列表新增level字段
continuous-integration/drone/push Build is passing Details

uat_us
wangxiaoshuang 2024-06-03 14:34:03 +08:00
parent eec16c1a2c
commit c18364104f
4 changed files with 346 additions and 211 deletions

View File

@ -3,26 +3,34 @@
<div class="search"> <div class="search">
<el-form :inline="true" size="small" class="base-search-form"> <el-form :inline="true" size="small" class="base-search-form">
<el-form-item label="CRO Name:"> <el-form-item label="CRO Name:">
<el-input v-model="searchData.CROName" style="width:100px;" /> <el-input v-model="searchData.CROName" style="width: 100px" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">Search</el-button> <el-button type="primary" icon="el-icon-search" @click="handleSearch"
<el-button type="primary" icon="el-icon-refresh-left" @click="handleReset">Reset</el-button> >Search</el-button
>
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>Reset</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
size="small" size="small"
type="primary" type="primary"
style="margin-left:auto;" style="margin-left: auto"
icon="el-icon-plus" icon="el-icon-plus"
@click="handleAddCro" @click="handleAddCro"
>New</el-button> >New</el-button
>
</span> </span>
</div> </div>
<el-table <el-table
v-loading="loading" v-loading="loading"
v-adaptive="{bottomOffset:60}" v-adaptive="{ bottomOffset: 60 }"
:data="list" :data="list"
stripe stripe
height="100" height="100"
@ -50,6 +58,16 @@
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
/> />
<el-table-column
prop="IsTrialLevel"
label="Level"
show-overflow-tooltip
sortable="custom"
>
<template slot-scope="scope">
<span>{{ $fd("IsTrialLevel", String(scope.row.IsTrialLevel)) }}</span>
</template>
</el-table-column>
<el-table-column label="Action" min-width="200"> <el-table-column label="Action" min-width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -68,7 +86,13 @@
</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
v-if="editVisible" v-if="editVisible"
@ -78,26 +102,32 @@
width="600px" width="600px"
custom-class="base-dialog-wrapper" custom-class="base-dialog-wrapper"
> >
<CroForm v-if="editVisible" :data="rowData" @close="close" @getList="getList" /> <CroForm
v-if="editVisible"
:data="rowData"
:IsTrialLevel="rowData.IsTrialLevel"
@close="close"
@getList="getList"
/>
</el-dialog> </el-dialog>
</box-content> </box-content>
</template> </template>
<script> <script>
import { getCROPageList, deleteCROCompany } from '@/api/dictionary' import { getCROPageList, deleteCROCompany } from "@/api/dictionary";
import BoxContent from '@/components/BoxContent' import BoxContent from "@/components/BoxContent";
import Pagination from '@/components/Pagination' import Pagination from "@/components/Pagination";
import CroForm from './CroForm' import CroForm from "./CroForm";
const searchDataDefault = () => { const searchDataDefault = () => {
return { return {
CROName: '', CROName: "",
PageIndex: 1, PageIndex: 1,
PageSize: 20, PageSize: 20,
Asc: true, Asc: true,
SortField: '' SortField: "",
} };
} };
export default { export default {
name: 'Cros', name: "Cros",
components: { BoxContent, Pagination, CroForm }, components: { BoxContent, Pagination, CroForm },
data() { data() {
return { return {
@ -107,87 +137,93 @@ export default {
loading: false, loading: false,
rowData: {}, rowData: {},
editVisible: false, editVisible: false,
title: '' title: "",
} };
}, },
mounted() { mounted() {
this.getList() this.getList();
}, },
methods: { methods: {
// CRO // CRO
getList() { getList() {
this.loading = true this.loading = true;
getCROPageList(this.searchData).then(res => { getCROPageList(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.total = res.Result.TotalCount;
this.loading = false })
}) .catch(() => {
this.loading = false;
});
}, },
// CRO // CRO
handleAddCro() { handleAddCro() {
this.rowData = {} this.rowData = {};
this.title = 'Add' this.title = "Add";
this.editVisible = true this.editVisible = true;
}, },
// CRO // CRO
handleEdit(row) { handleEdit(row) {
this.rowData = row this.rowData = row;
this.title = 'Edit' this.title = "Edit";
this.editVisible = true this.editVisible = true;
}, },
// CRO // CRO
handleDelete(row) { handleDelete(row) {
this.$confirm(this.$t('trials:uploadedDicoms:message:deleteMes'), { this.$confirm(this.$t("trials:uploadedDicoms:message:deleteMes"), {
type: 'warning', type: "warning",
distinguishCancelAndClose: true, distinguishCancelAndClose: true,
}).then(() => {
}) this.loading = true;
.then(() => { deleteCROCompany(row.Id)
this.loading = true .then((res) => {
deleteCROCompany(row.Id) this.loading = false;
.then(res => { if (res.IsSuccess) {
this.loading = false this.list.splice(
if (res.IsSuccess) { this.list.findIndex((item) => item.Id === row.Id),
this.list.splice(this.list.findIndex(item => item.Id === row.Id), 1) 1
this.$message.success(this.$t('common:message:deletedSuccessfully')) );
} this.$message.success(
}).catch(() => { this.$t("common:message:deletedSuccessfully")
this.loading = false );
}) }
}) })
.catch(() => {
this.loading = false;
});
});
}, },
// //
handleReset() { handleReset() {
this.searchData = searchDataDefault() this.searchData = searchDataDefault();
this.getList() this.getList();
}, },
// //
handleSearch() { handleSearch() {
this.searchData.PageIndex = 1 this.searchData.PageIndex = 1;
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();
}, },
// //
close() { close() {
this.editVisible = false this.editVisible = false;
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.cros{ .cros {
height: 100%; height: 100%;
} }
</style> </style>

View File

@ -17,70 +17,98 @@
<el-form-item label="CRO Code: " prop="CROCode"> <el-form-item label="CRO Code: " prop="CROCode">
<el-input v-model="form.CROCode" /> <el-input v-model="form.CROCode" />
</el-form-item> </el-form-item>
<el-form-item label="Level: " prop="CROCode">
<el-switch
:disabled="!IsTrialLevel"
v-model="form.IsTrialLevel"
:active-text="$fd('IsTrialLevel', 'true')"
:inactive-text="$fd('IsTrialLevel', 'false')"
>
</el-switch>
</el-form-item>
</div> </div>
<div class="base-dialog-footer" style="text-align:right;margin-top:10px;"> <div class="base-dialog-footer" style="text-align: right; margin-top: 10px">
<el-form-item> <el-form-item>
<el-button :disabled="btnLoading" type="primary" @click="handleCancel">Cancel</el-button> <el-button :disabled="btnLoading" type="primary" @click="handleCancel"
<el-button type="primary" :loading="btnLoading" @click="handleSave">Save</el-button> >Cancel</el-button
>
<el-button type="primary" :loading="btnLoading" @click="handleSave"
>Save</el-button
>
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
</template> </template>
<script> <script>
import { addOrUpdateCro } from '@/api/dictionary' import { addOrUpdateCro } from "@/api/dictionary";
export default { export default {
name: 'CroForm', name: "CroForm",
props: { props: {
data: { data: {
type: Object, type: Object,
default() { default() {
return {} return {};
} },
} },
IsTrialLevel: {
type: Boolean,
default: true,
},
}, },
data() { data() {
return { return {
btnLoading: false, btnLoading: false,
form: { form: {
Id: '', Id: "",
CROName: '', CROName: "",
CRONameCN: '', CRONameCN: "",
CROCode: '' CROCode: "",
IsTrialLevel: true,
}, },
rules: { rules: {
CROName: [{ required: true, message: 'Please specify', trigger: 'blur' }, { max: 50, message: 'The maximum length is 50' }], CROName: [
CRONameCN: [{ required: true, message: 'Please specify', trigger: 'blur' }, { max: 50, message: 'The maximum length is 50' }], { required: true, message: "Please specify", trigger: "blur" },
CROCode: [{ required: true, message: 'Please specify', trigger: 'blur' }, { max: 50, message: 'The maximum length is 50' }] { max: 50, message: "The maximum length is 50" },
} ],
} CRONameCN: [
{ required: true, message: "Please specify", trigger: "blur" },
{ max: 50, message: "The maximum length is 50" },
],
CROCode: [
{ required: true, message: "Please specify", trigger: "blur" },
{ max: 50, message: "The maximum length is 50" },
],
},
};
}, },
mounted() { mounted() {
if (Object.keys(this.data).length && this.data.Id) { if (Object.keys(this.data).length && this.data.Id) {
this.form = { ...this.data } this.form = { ...this.data };
} }
}, },
methods: { methods: {
handleSave() { handleSave() {
this.$refs.CROForm.validate(valid => { this.$refs.CROForm.validate((valid) => {
if (!valid) return if (!valid) return;
this.btnLoading = true this.btnLoading = true;
addOrUpdateCro(this.form).then(res => { addOrUpdateCro(this.form)
this.btnLoading = false .then((res) => {
if (res.IsSuccess) { this.btnLoading = false;
this.$message.success('Saved successfully') if (res.IsSuccess) {
this.$refs['CROForm'].resetFields() this.$message.success("Saved successfully");
this.$emit('getList') this.$refs["CROForm"].resetFields();
this.$emit('close') this.$emit("getList");
} this.$emit("close");
}).catch(() => { }
this.btnLoading = false })
}) .catch(() => {
}) this.btnLoading = false;
});
});
}, },
handleCancel() { handleCancel() {
this.$emit('close') this.$emit("close");
} },
} },
};
}
</script> </script>

View File

@ -1,5 +1,4 @@
<template> <template>
<el-form <el-form
ref="sponsorForm" ref="sponsorForm"
:model="form" :model="form"
@ -18,70 +17,106 @@
<el-form-item label="Sponsor Code: " prop="SponsorName"> <el-form-item label="Sponsor Code: " prop="SponsorName">
<el-input v-model="form.SponsorCode" /> <el-input v-model="form.SponsorCode" />
</el-form-item> </el-form-item>
<el-form-item label="Level: " prop="CROCode">
<el-switch
:disabled="!IsTrialLevel"
v-model="form.IsTrialLevel"
:active-text="$fd('IsTrialLevel', 'true')"
:inactive-text="$fd('IsTrialLevel', 'false')"
>
</el-switch>
</el-form-item>
</div> </div>
<div class="base-dialog-footer" style="text-align:right;margin-top:10px;"> <div class="base-dialog-footer" style="text-align: right; margin-top: 10px">
<el-form-item> <el-form-item>
<el-button :disabled="btnLoading" size="small" type="primary" @click="handleCancel">Cancel</el-button> <el-button
<el-button size="small" type="primary" :loading="btnLoading" @click="handleSave">Save</el-button> :disabled="btnLoading"
size="small"
type="primary"
@click="handleCancel"
>Cancel</el-button
>
<el-button
size="small"
type="primary"
:loading="btnLoading"
@click="handleSave"
>Save</el-button
>
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
</template> </template>
<script> <script>
import { addOrUpdateSponsor } from '@/api/dictionary' import { addOrUpdateSponsor } from "@/api/dictionary";
export default { export default {
name: 'SponsorForm', name: "SponsorForm",
props: { props: {
data: { data: {
type: Object, type: Object,
default() { default() {
return {} return {};
} },
} },
IsTrialLevel: {
type: Boolean,
default: true,
},
}, },
data() { data() {
return { return {
btnLoading: false, btnLoading: false,
form: { form: {
Id: '', Id: "",
SponsorName: '', SponsorName: "",
SponsorNameCN: '', SponsorNameCN: "",
SponsorCode: '', SponsorCode: "",
IsTrialLevel: true,
}, },
rules: { rules: {
SponsorName: [{ required: true, message: 'Please specify', trigger: 'blur' }, { max: 50, message: 'The maximum length is 50' }], SponsorName: [
SponsorNameCN: [{ required: true, message: 'Please specify', trigger: 'blur' }, { max: 50, message: 'The maximum length is 50' }], { required: true, message: "Please specify", trigger: "blur" },
SponsorCode: [{ required: true, message: 'Please specify', trigger: 'blur' }, { max: 50, message: 'The maximum length is 50' }] { max: 50, message: "The maximum length is 50" },
} ],
} SponsorNameCN: [
{ required: true, message: "Please specify", trigger: "blur" },
{ max: 50, message: "The maximum length is 50" },
],
SponsorCode: [
{ required: true, message: "Please specify", trigger: "blur" },
{ max: 50, message: "The maximum length is 50" },
],
},
};
}, },
mounted() { mounted() {
if (Object.keys(this.data).length && this.data.Id) { if (Object.keys(this.data).length && this.data.Id) {
this.form = { ...this.data } this.form = { ...this.data };
} }
}, },
methods: { methods: {
handleSave() { handleSave() {
this.$refs.sponsorForm.validate(valid => { this.$refs.sponsorForm.validate((valid) => {
if (!valid) return if (!valid) return;
this.btnLoading = true this.btnLoading = true;
addOrUpdateSponsor(this.form).then(res => { addOrUpdateSponsor(this.form)
this.btnLoading = false .then((res) => {
if (res.IsSuccess) { this.btnLoading = false;
this.$message.success('Saved successfully') if (res.IsSuccess) {
this.$refs['sponsorForm'].resetFields() this.$message.success("Saved successfully");
this.$emit('getList') this.$refs["sponsorForm"].resetFields();
this.$emit('close') this.$emit("getList");
} this.$emit("close");
}).catch(() => { }
this.btnLoading = false })
}) .catch(() => {
}) this.btnLoading = false;
});
});
}, },
handleCancel() { handleCancel() {
this.$emit('close') this.$emit("close");
} },
} },
};
}
</script> </script>

View File

@ -3,26 +3,34 @@
<div class="search"> <div class="search">
<el-form :inline="true" size="small" class="base-search-form"> <el-form :inline="true" size="small" class="base-search-form">
<el-form-item label="Sponsor Name:"> <el-form-item label="Sponsor Name:">
<el-input v-model="searchData.SponsorName" style="width:100px;" /> <el-input v-model="searchData.SponsorName" style="width: 100px" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">Search</el-button> <el-button type="primary" icon="el-icon-search" @click="handleSearch"
<el-button type="primary" icon="el-icon-refresh-left" @click="handleReset">Reset</el-button> >Search</el-button
>
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>Reset</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
size="small" size="small"
type="primary" type="primary"
style="margin-left:auto;" style="margin-left: auto"
icon="el-icon-plus" icon="el-icon-plus"
@click="handleAddSponsor" @click="handleAddSponsor"
>New</el-button> >New</el-button
>
</span> </span>
</div> </div>
<el-table <el-table
v-loading="loading" v-loading="loading"
v-adaptive="{bottomOffset:60}" v-adaptive="{ bottomOffset: 60 }"
:data="list" :data="list"
stripe stripe
height="100" height="100"
@ -50,6 +58,16 @@
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
/> />
<el-table-column
prop="IsTrialLevel"
label="Level"
show-overflow-tooltip
sortable="custom"
>
<template slot-scope="scope">
<span>{{ $fd("IsTrialLevel", String(scope.row.IsTrialLevel)) }}</span>
</template>
</el-table-column>
<el-table-column label="Action" min-width="150"> <el-table-column label="Action" min-width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -68,7 +86,13 @@
</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
v-if="editVisible" v-if="editVisible"
@ -78,26 +102,32 @@
width="600px" width="600px"
custom-class="base-dialog-wrapper" custom-class="base-dialog-wrapper"
> >
<sponsor-form v-if="editVisible" :data="rowData" @close="close" @getList="getList" /> <sponsor-form
v-if="editVisible"
:IsTrialLevel="rowData.IsTrialLevel"
:data="rowData"
@close="close"
@getList="getList"
/>
</el-dialog> </el-dialog>
</box-content> </box-content>
</template> </template>
<script> <script>
import { getSponsorPageList, deleteSponsor } from '@/api/dictionary' import { getSponsorPageList, deleteSponsor } from "@/api/dictionary";
import BoxContent from '@/components/BoxContent' import BoxContent from "@/components/BoxContent";
import Pagination from '@/components/Pagination' import Pagination from "@/components/Pagination";
import SponsorForm from './SponsorForm' import SponsorForm from "./SponsorForm";
const searchDataDefault = () => { const searchDataDefault = () => {
return { return {
SponsorName: '', SponsorName: "",
PageIndex: 1, PageIndex: 1,
PageSize: 20, PageSize: 20,
Asc: true, Asc: true,
SortField: '' SortField: "",
} };
} };
export default { export default {
name: 'Sponsors', name: "Sponsors",
components: { BoxContent, Pagination, SponsorForm }, components: { BoxContent, Pagination, SponsorForm },
data() { data() {
return { return {
@ -107,87 +137,93 @@ export default {
loading: false, loading: false,
rowData: {}, rowData: {},
editVisible: false, editVisible: false,
title: '' title: "",
} };
}, },
mounted() { mounted() {
this.getList() this.getList();
}, },
methods: { methods: {
// Sponsors // Sponsors
getList() { getList() {
this.loading = true this.loading = true;
getSponsorPageList(this.searchData).then(res => { getSponsorPageList(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.total = res.Result.TotalCount;
this.loading = false })
}) .catch(() => {
this.loading = false;
});
}, },
// Sponsor // Sponsor
handleAddSponsor() { handleAddSponsor() {
this.rowData = {} this.rowData = {};
this.title = 'Add' this.title = "Add";
this.editVisible = true this.editVisible = true;
}, },
// Sponsor // Sponsor
handleEdit(row) { handleEdit(row) {
this.rowData = row this.rowData = row;
this.title = 'Edit' this.title = "Edit";
this.editVisible = true this.editVisible = true;
}, },
// Sponsor // Sponsor
handleDelete(row) { handleDelete(row) {
this.$confirm(this.$t('trials:uploadedDicoms:message:deleteMes'), { this.$confirm(this.$t("trials:uploadedDicoms:message:deleteMes"), {
type: 'warning', type: "warning",
distinguishCancelAndClose: true, distinguishCancelAndClose: true,
}).then(() => {
}) this.loading = true;
.then(() => { deleteSponsor(row.Id)
this.loading = true .then((res) => {
deleteSponsor(row.Id) this.loading = false;
.then(res => { if (res.IsSuccess) {
this.loading = false this.list.splice(
if (res.IsSuccess) { this.list.findIndex((item) => item.Id === row.Id),
this.list.splice(this.list.findIndex(item => item.Id === row.Id), 1) 1
this.$message.success(this.$t('common:message:deletedSuccessfully')) );
} this.$message.success(
}).catch(() => { this.$t("common:message:deletedSuccessfully")
this.loading = false );
}) }
}) })
.catch(() => {
this.loading = false;
});
});
}, },
// //
handleReset() { handleReset() {
this.searchData = searchDataDefault() this.searchData = searchDataDefault();
this.getList() this.getList();
}, },
// //
handleSearch() { handleSearch() {
this.searchData.PageIndex = 1 this.searchData.PageIndex = 1;
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();
}, },
// //
close() { close() {
this.editVisible = false this.editVisible = false;
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.sponsors{ .sponsors {
height: 100%; height: 100%;
} }
</style> </style>