简历概述更改
continuous-integration/drone/push Build is passing Details

uat_us
wangxiaoshuang 2024-12-02 15:40:14 +08:00
parent f0b1d8f3c9
commit 581cd2c9c1
2 changed files with 384 additions and 81 deletions

View File

@ -20,6 +20,87 @@
<div class="noData" v-else>{{ $t('curriculumVitae:noData') }}</div>
<base-model :config="model_cfg">
<template slot="dialog-body">
<div class="form_title">
{{ $t('curriculumVitae:summarize:form:tableTitle') }}
</div>
<el-button
size="small"
type="primary"
@click="handleAdd()"
style="float: right; margin-bottom: 5px"
>
{{ $t('common:button:add') }}
</el-button>
<el-table
ref="summarizeTable"
:data="list"
border
class="table"
:loading="loading"
size="small"
:row-style="tableRowClassName"
>
<el-table-column type="index" width="30" />
<el-table-column
prop="Indication"
:label="$t('system:reviewer:label:Indication')"
show-overflow-tooltip
v-if="!isEN"
/>
<el-table-column
prop="IndicationEn"
:label="$t('system:reviewer:label:Indication')"
show-overflow-tooltip
v-else
/>
<el-table-column
prop="Summarize"
:label="$t('system:reviewer:label:SummarizeZH')"
show-overflow-tooltip
v-if="!isEN"
/>
<el-table-column
prop="SummarizeEn"
:label="$t('system:reviewer:label:SummarizeEN')"
show-overflow-tooltip
v-else
/>
<el-table-column
prop="IsMain"
:label="$t('system:reviewer:label:IsMain')"
show-overflow-tooltip
width="100px"
>
<template slot-scope="scope">
{{ $fd('YesOrNo', scope.row.IsMain) }}
</template>
</el-table-column>
<el-table-column
:label="$t('system:EducationTraining:table:Operation')"
width="120px"
>
<template slot-scope="scope">
<el-button type="text" size="small" @click="handleAdd(scope.row)">
{{ $t('common:button:edit') }}
</el-button>
<el-button
type="text"
size="small"
@click="handleDelete(scope.row, scope.$index)"
>
{{ $t('common:button:delete') }}
</el-button>
<el-button
type="text"
size="small"
@click="setCurrent(scope.row)"
v-if="trialId"
>
{{ $t('common:button:check') }}
</el-button>
</template>
</el-table-column>
</el-table>
<el-form
ref="summarizeFrom"
v-loading="loading"
@ -27,45 +108,26 @@
:rules="rules"
label-width="80px"
size="small"
v-if="trialId"
>
<template v-if="isPM && IndicationList.length > 0">
<el-form-item
:label="$t('curriculumVitae:summarize:form:Indication')"
prop="Indication"
v-if="!isEN"
>
<el-select
v-model="form.Indication"
placeholder=""
@change="handleChange"
>
<el-option
v-for="item in IndicationList"
:key="item.Id"
:label="item.Indication"
:value="item.Indication"
<div class="form_title">
{{ $t('curriculumVitae:summarize:form:formTitle') }}
</div>
<template>
<el-form-item>
<div style="float: right">
<!-- <el-button
type="text"
size="small"
@click="cover"
:disabled="!currentRow.Id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
:label="$t('curriculumVitae:summarize:form:Indication')"
prop="IndicationEn"
v-else
>
<el-select
v-model="form.IndicationEn"
placeholder=""
@change="handleChange"
>
<el-option
v-for="item in IndicationList"
:key="item.Id"
:label="item.IndicationEn"
:value="item.IndicationEn"
>
</el-option>
</el-select>
{{ $t('curriculumVitae:summarize:button:cover') }}
</el-button> -->
<el-button type="text" size="small" @click="addNew">
{{ $t('curriculumVitae:summarize:button:addNew') }}
</el-button>
</div>
</el-form-item>
</template>
<el-form-item
@ -102,7 +164,7 @@
</el-form-item>
</el-form>
</template>
<template slot="dialog-footer">
<template slot="dialog-footer" v-if="trialId">
<el-button size="small" type="primary" @click="handleCancle">
{{ $t('common:button:cancel') }}
</el-button>
@ -116,11 +178,111 @@
</el-button>
</template>
</base-model>
<base-model :config="model_cfg_table">
<template slot="dialog-body">
<el-form
ref="summarizeFrom2"
v-loading="loading"
:rules="rules"
:model="tableForm"
class="demo-ruleForm"
label-width="100px"
>
<el-form-item
:label="$t('system:reviewer:label:Indication')"
prop="Indication"
v-if="!isEN"
>
<el-input
v-model="tableForm.Indication"
:placeholder="
$t('curriculumVitae:summarize:form:placeholder:Indication')
"
size="small"
:maxlength="400"
/>
</el-form-item>
<el-form-item
prop="IndicationEn"
:label="$t('system:reviewer:label:Indication')"
v-else
>
<el-input
v-model="tableForm.IndicationEn"
:placeholder="
$t('curriculumVitae:summarize:form:placeholder:IndicationEn')
"
size="small"
:maxlength="400"
/>
</el-form-item>
<el-form-item
:label="$t('system:reviewer:label:Summarize')"
prop="Summarize"
v-if="!isEN"
>
<el-input
v-model="tableForm.Summarize"
type="textarea"
:rows="10"
:placeholder="
$t('curriculumVitae:summarize:form:placeholder:summarize')
"
size="small"
:maxlength="4000"
/>
</el-form-item>
<el-form-item
prop="SummarizeEn"
:label="$t('system:reviewer:label:Summarize')"
v-else
>
<el-input
v-model="tableForm.SummarizeEn"
type="textarea"
:rows="10"
:placeholder="
$t('curriculumVitae:summarize:form:placeholder:summarizeEN')
"
size="small"
:maxlength="4000"
/>
</el-form-item>
<el-form-item
prop="IsMain"
:label="$t('system:reviewer:label:IsMain')"
>
<el-switch
v-model="tableForm.IsMain"
:disabled="list.length <= 0 || ISMAIN"
>
</el-switch>
</el-form-item>
</el-form>
</template>
<template slot="dialog-footer">
<el-button size="small" type="primary" @click="handleCancle2">
{{ $t('common:button:cancel') }}
</el-button>
<el-button
size="small"
type="primary"
@click="handleSave2"
:loading="loading"
>
{{ $t('common:button:save') }}
</el-button>
</template>
</base-model>
</div>
</template>
<script>
import BaseModel from '@/components/BaseModel'
import { addOrUpdateGneralSituation } from '@/api/reviewers'
import {
addOrUpdateGneralSituation,
getSummarizeInfo,
deleteSummarizeInfo,
} from '@/api/reviewers'
const defaultForm = () => {
return {
Id: null,
@ -156,16 +318,6 @@ export default {
type: Boolean,
default: false,
},
isPM: {
type: Boolean,
default: false,
},
IndicationList: {
type: Array,
default: () => {
return []
},
},
},
data() {
return {
@ -176,8 +328,41 @@ export default {
title: this.$t('curriculumVitae:summarize:form:title'),
appendToBody: true,
},
model_cfg_table: {
visible: false,
showClose: true,
width: '800px',
title: this.$t('system:reviewer:form:SummarizeTitle'),
appendToBody: true,
top: '8vh',
},
tableForm: defaultForm(),
form: defaultForm(),
rules: {
Indication: [
{
required: true,
message: this.$t('common:ruleMessage:specify'),
trigger: 'blur',
},
{
max: 400,
message: this.$t('form:rules:maxLength:400'),
trigger: 'blur',
},
],
IndicationEn: [
{
required: true,
message: this.$t('common:ruleMessage:specify'),
trigger: 'blur',
},
{
max: 400,
message: this.$t('form:rules:maxLength:400'),
trigger: 'blur',
},
],
Summarize: [
{
max: 4000,
@ -194,6 +379,10 @@ export default {
],
},
loading: false,
list: [],
currentRow: {},
ISMAIN: false,
SaveSummarizeInfoType: 0,
}
},
computed: {
@ -208,6 +397,84 @@ export default {
},
},
methods: {
cover() {},
addNew() {
this.SaveSummarizeInfoType = 2
this.tableForm = defaultForm()
this.tableForm.Summarize = this.form.Summarize
this.tableForm.SummarizeEn = this.form.SummarizeEn
// this.tableForm.Indication = this.form.Indication
// this.tableForm.IndicationEn = this.form.IndicationEn
this.model_cfg_table.visible = true
},
tableRowClassName({ row, rowIndex }) {
if (row.Id === this.currentRow.Id) {
return {
background: '#d9ecff',
}
}
return {}
},
handleAdd(row) {
this.tableForm = defaultForm()
this.ISMAIN = false
this.SaveSummarizeInfoType = 0
if (row) {
Object.keys(this.tableForm).forEach((key) => {
this.tableForm[key] = row[key]
})
this.tableForm.Id = row.Id
if (this.tableForm.IsMain) {
this.ISMAIN = true
}
}
if (this.list.length <= 0) {
this.tableForm.IsMain = true
}
this.model_cfg_table.visible = true
},
async handleDelete(row, index) {
try {
if (row.IsMain) {
return this.$message.warning(
this.$t('system:reviewer:message:deletedSuccessfully')
)
}
let confirm = await this.$confirm(
this.$t('system:reviewer:confirm:delete')
)
if (!confirm) return false
let data = {
Id: row.Id,
}
this.loading = true
let res = await deleteSummarizeInfo(data)
this.loading = false
if (res.IsSuccess) {
this.$message.success(this.$t('common:message:deletedSuccessfully'))
// this.getDetail()
this.list.splice(index, 1)
}
} catch (err) {
console.log(err)
this.loading = false
}
},
//
async getIndicationList() {
try {
let id = this.reviewerId
if (!id) return false
let res = await getSummarizeInfo({
DoctorId: id,
})
if (res.IsSuccess) {
this.list = res.Result.SummarizeList
}
} catch (err) {
console.log(err)
}
},
async openEdit() {
this.form = defaultForm()
Object.keys(this.form).forEach((key) => {
@ -215,12 +482,19 @@ export default {
this.form[key] = this.mainSummarize[key]
// }
})
this.getIndicationList()
this.currentRow = {}
this.model_cfg.visible = true
},
handleCancle() {
this.form = defaultForm()
this.currentRow = {}
this.model_cfg.visible = false
},
handleCancle2() {
this.tableForm = defaultForm()
this.model_cfg_table.visible = false
},
async handleSave() {
try {
let validate = await this.$refs.summarizeFrom.validate()
@ -243,15 +517,47 @@ export default {
console.log(err)
}
},
handleChange(value) {
let data = this.IndicationList.find(
(item) => item.Indication === value || item.IndicationEn === value
)
Object.keys(this.form).forEach((key) => {
if (key !== 'Id') {
this.form[key] = data[key]
async handleSave2() {
try {
let validate = await this.$refs.summarizeFrom2.validate()
if (!validate) return false
this.tableForm.DoctorId = this.reviewerId
this.loading = true
if (this.trialId && this.SaveSummarizeInfoType > 0) {
this.tableForm.TrialId = this.trialId
this.tableForm.SaveSummarizeInfoType = this.SaveSummarizeInfoType
}
})
if (this.list.length <= 0) {
this.tableForm.IsMain = true
}
let res = await addOrUpdateGneralSituation(this.tableForm)
this.loading = false
if (res.IsSuccess) {
this.$message.success(this.$t('common:message:savedSuccessfully'))
this.model_cfg_table.visible = false
if (this.SaveSummarizeInfoType > 0) {
this.$emit('getInfo')
this.model_cfg.visible = false
return false
}
this.getIndicationList()
// this.getDetail()
}
} catch (err) {
this.loading = false
console.log(err)
}
},
handleCurrentChange(val) {
this.currentRow = val
this.form.Summarize = this.currentRow.Summarize
this.form.SummarizeEn = this.currentRow.SummarizeEn
this.form.Indication = this.currentRow.Indication
this.form.IndicationEn = this.currentRow.IndicationEn
},
setCurrent(row) {
// this.$refs.summarizeTable.setCurrentRow(row)
this.handleCurrentChange(row)
},
},
}
@ -277,4 +583,16 @@ export default {
word-wrap: break-word;
}
}
.form_title {
margin: 10px 0;
display: flex;
align-items: center;
&::after {
margin-left: 20px;
display: block;
content: '';
border-top: 1px solid #eee;
flex: 1;
}
}
</style>

View File

@ -65,6 +65,9 @@
<el-button type="text" @click.stop="openPreview">
{{ $t('common:button:preview') }}
</el-button>
<el-button type="text" @click.stop="openPreview(false)">
{{ $t('common:button:previewBlindState') }}
</el-button>
</div>
</div>
<div class="box" id="info">
@ -86,8 +89,6 @@
:reviewerId.sync="reviewerId"
:trialId="trialId"
:isEN="isEN"
:isPM="isPM"
:IndicationList="IndicationList"
@getInfo="getDetail"
/>
</div>
@ -188,6 +189,7 @@
:isEN="isEN"
:reviewerId.sync="reviewerId"
:trialId="trialId"
:isAll="isAll"
v-if="visible"
/>
</div>
@ -221,7 +223,7 @@ import pay from './components/info/pay.vue'
import holiday from './components/info/holiday.vue'
import setting from './components/info/setting.vue'
import preview from './preview.vue'
import { getDetail, getSummarizeInfo } from '@/api/reviewers'
import { getDetail } from '@/api/reviewers'
import { mapMutations } from 'vuex'
export default {
components: {
@ -269,10 +271,9 @@ export default {
dom: null,
holidayVisible: false,
isAll: true,
// settingVisible: false,
IndicationList: [],
}
},
computed: {
@ -312,21 +313,7 @@ export default {
},
methods: {
...mapMutations({ setLanguage: 'lang/setLanguage' }),
//
async getIndicationList() {
try {
let id = this.reviewerId
if (!id) return false
let res = await getSummarizeInfo({
DoctorId: id,
})
if (res.IsSuccess) {
this.IndicationList = res.Result.SummarizeList
}
} catch (err) {
console.log(err)
}
},
//
async getDetail() {
try {
@ -337,9 +324,6 @@ export default {
this.loading = false
if (res.IsSuccess) {
this.reviewerData = res.Result
if (this.isPM) {
this.getIndicationList()
}
}
} catch (err) {
this.loading = false
@ -379,7 +363,8 @@ export default {
}
},
//
openPreview() {
openPreview(isAll = true) {
this.isAll = isAll
this.visible = true
},
//