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

View File

@ -17,70 +17,98 @@
<el-form-item label="CRO Code: " prop="CROCode">
<el-input v-model="form.CROCode" />
</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 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-button :disabled="btnLoading" type="primary" @click="handleCancel">Cancel</el-button>
<el-button type="primary" :loading="btnLoading" @click="handleSave">Save</el-button>
<el-button :disabled="btnLoading" type="primary" @click="handleCancel"
>Cancel</el-button
>
<el-button type="primary" :loading="btnLoading" @click="handleSave"
>Save</el-button
>
</el-form-item>
</div>
</el-form>
</template>
<script>
import { addOrUpdateCro } from '@/api/dictionary'
import { addOrUpdateCro } from "@/api/dictionary";
export default {
name: 'CroForm',
name: "CroForm",
props: {
data: {
type: Object,
default() {
return {}
}
}
return {};
},
},
IsTrialLevel: {
type: Boolean,
default: true,
},
},
data() {
return {
btnLoading: false,
form: {
Id: '',
CROName: '',
CRONameCN: '',
CROCode: ''
Id: "",
CROName: "",
CRONameCN: "",
CROCode: "",
IsTrialLevel: true,
},
rules: {
CROName: [{ required: true, message: 'Please specify', trigger: 'blur' }, { 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' }]
}
}
CROName: [
{ required: true, message: "Please specify", trigger: "blur" },
{ 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() {
if (Object.keys(this.data).length && this.data.Id) {
this.form = { ...this.data }
this.form = { ...this.data };
}
},
methods: {
handleSave() {
this.$refs.CROForm.validate(valid => {
if (!valid) return
this.btnLoading = true
addOrUpdateCro(this.form).then(res => {
this.btnLoading = false
if (res.IsSuccess) {
this.$message.success('Saved successfully')
this.$refs['CROForm'].resetFields()
this.$emit('getList')
this.$emit('close')
}
}).catch(() => {
this.btnLoading = false
})
})
this.$refs.CROForm.validate((valid) => {
if (!valid) return;
this.btnLoading = true;
addOrUpdateCro(this.form)
.then((res) => {
this.btnLoading = false;
if (res.IsSuccess) {
this.$message.success("Saved successfully");
this.$refs["CROForm"].resetFields();
this.$emit("getList");
this.$emit("close");
}
})
.catch(() => {
this.btnLoading = false;
});
});
},
handleCancel() {
this.$emit('close')
}
}
}
this.$emit("close");
},
},
};
</script>

View File

@ -1,5 +1,4 @@
<template>
<el-form
ref="sponsorForm"
:model="form"
@ -18,70 +17,106 @@
<el-form-item label="Sponsor Code: " prop="SponsorName">
<el-input v-model="form.SponsorCode" />
</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 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-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-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>
</div>
</el-form>
</template>
<script>
import { addOrUpdateSponsor } from '@/api/dictionary'
import { addOrUpdateSponsor } from "@/api/dictionary";
export default {
name: 'SponsorForm',
name: "SponsorForm",
props: {
data: {
type: Object,
default() {
return {}
}
}
return {};
},
},
IsTrialLevel: {
type: Boolean,
default: true,
},
},
data() {
return {
btnLoading: false,
form: {
Id: '',
SponsorName: '',
SponsorNameCN: '',
SponsorCode: '',
Id: "",
SponsorName: "",
SponsorNameCN: "",
SponsorCode: "",
IsTrialLevel: true,
},
rules: {
SponsorName: [{ required: true, message: 'Please specify', trigger: 'blur' }, { 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' }]
}
}
SponsorName: [
{ required: true, message: "Please specify", trigger: "blur" },
{ 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() {
if (Object.keys(this.data).length && this.data.Id) {
this.form = { ...this.data }
this.form = { ...this.data };
}
},
methods: {
handleSave() {
this.$refs.sponsorForm.validate(valid => {
if (!valid) return
this.btnLoading = true
addOrUpdateSponsor(this.form).then(res => {
this.btnLoading = false
if (res.IsSuccess) {
this.$message.success('Saved successfully')
this.$refs['sponsorForm'].resetFields()
this.$emit('getList')
this.$emit('close')
}
}).catch(() => {
this.btnLoading = false
})
})
this.$refs.sponsorForm.validate((valid) => {
if (!valid) return;
this.btnLoading = true;
addOrUpdateSponsor(this.form)
.then((res) => {
this.btnLoading = false;
if (res.IsSuccess) {
this.$message.success("Saved successfully");
this.$refs["sponsorForm"].resetFields();
this.$emit("getList");
this.$emit("close");
}
})
.catch(() => {
this.btnLoading = false;
});
});
},
handleCancel() {
this.$emit('close')
}
}
}
this.$emit("close");
},
},
};
</script>

View File

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