培训记录
continuous-integration/drone/push Build is running Details

uat
wangxiaoshuang 2025-03-05 13:32:00 +08:00
parent bc34ed5c25
commit 5ca123e90b
4 changed files with 65 additions and 13 deletions

View File

@ -1226,3 +1226,18 @@ export function batchAddTrialTrianingRecord(data) {
data data
}) })
} }
// 项目文档-删除培训记录
export function deleteTrialTrianingRecord(id) {
return request({
url: `/TrialTrianingRecord/deleteTrialTrianingRecord/${id}`,
method: 'delete',
})
}
// 项目文档-培训记录授权
export function authorizedTrialTrianingRecord(data) {
return request({
url: `/TrialTrianingRecord/authorizedTrialTrianingRecord`,
method: 'post',
data
})
}

View File

@ -77,6 +77,7 @@
v-model="searchData.IsAuthorizedView" v-model="searchData.IsAuthorizedView"
style="width: 100px" style="width: 100px"
placeholder="" placeholder=""
clearable
> >
<el-option <el-option
v-for="item in $d.YesOrNo" v-for="item in $d.YesOrNo"
@ -143,8 +144,8 @@
@click.stop="delList" @click.stop="delList"
> >
{{ $t('trials:trialDocument:fileRecord:button:del') }} {{ $t('trials:trialDocument:fileRecord:button:del') }}
</el-button> </el-button> </el-form-item
</el-form-item>s >s
</el-form> </el-form>
</div> </div>
@ -672,6 +673,9 @@ export default {
async getList() { async getList() {
try { try {
if (!this.Id) return false if (!this.Id) return false
if (this.viewStatus) {
this.searchData.IsAuthorizedView = true
}
this.searchData.TrialFileTypeId = this.Id this.searchData.TrialFileTypeId = this.Id
this.searchData.TrialId = this.$route.query.trialId this.searchData.TrialId = this.$route.query.trialId
this.loading = true this.loading = true

View File

@ -93,6 +93,7 @@
v-model="searchData.IsAuthorizedView" v-model="searchData.IsAuthorizedView"
style="width: 100px" style="width: 100px"
placeholder="" placeholder=""
clearable
> >
<el-option <el-option
v-for="item in $d.YesOrNo" v-for="item in $d.YesOrNo"
@ -696,6 +697,9 @@ export default {
async getList() { async getList() {
try { try {
if (!this.Id) return false if (!this.Id) return false
if (this.viewStatus) {
this.searchData.IsAuthorizedView = true
}
this.searchData.TrialFileTypeId = this.Id this.searchData.TrialFileTypeId = this.Id
this.searchData.TrialId = this.$route.query.trialId this.searchData.TrialId = this.$route.query.trialId
this.loading = true this.loading = true

View File

@ -95,6 +95,7 @@
v-model="searchData.IsAuthorizedView" v-model="searchData.IsAuthorizedView"
style="width: 100px" style="width: 100px"
placeholder="" placeholder=""
clearable
> >
<el-option <el-option
v-for="item in $d.YesOrNo" v-for="item in $d.YesOrNo"
@ -199,7 +200,23 @@
:label="$t('trials:trialDocument:trainRecord:table:TrianingDate')" :label="$t('trials:trialDocument:trainRecord:table:TrianingDate')"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
/> >
<template slot-scope="scope">
<el-tooltip
v-if="!scope.row.TrianingDate"
class="item"
effect="dark"
:content="$t('trials:trialDocument:trainRecord:tip:noTrianingDate')"
placement="top"
>
<i
class="el-icon-warning"
style="cursor: pointer; color: #f56c6c"
></i>
</el-tooltip>
<span v-else>{{ scope.row.TrianingDate }}</span>
</template>
</el-table-column>
<el-table-column <el-table-column
prop="TrianingCount" prop="TrianingCount"
:label="$t('trials:trialDocument:trainRecord:table:TrianingCount')" :label="$t('trials:trialDocument:trainRecord:table:TrianingCount')"
@ -314,6 +331,7 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
:disabled="!scope.row.TrianingDate"
v-if="isManage && !viewStatus && hasEdit" v-if="isManage && !viewStatus && hasEdit"
v-model="scope.row.IsAuthorizedView" v-model="scope.row.IsAuthorizedView"
@change="(val) => auth(false, scope.row, val)" @change="(val) => auth(false, scope.row, val)"
@ -414,11 +432,10 @@
import { import {
addOrUpdateTrialFileType, addOrUpdateTrialFileType,
getTrialTrianingRecordList, getTrialTrianingRecordList,
deleteTrialNormalRecord, deleteTrialTrianingRecord,
authorizedTTrialNormalRecord, authorizedTrialTrianingRecord,
addOrUpdateTrialTrianingRecord, addOrUpdateTrialTrianingRecord,
batchAddTrialTrianingRecord, batchAddTrialTrianingRecord,
deleteTrialNormalRecordList,
} from '@/api/dictionary' } from '@/api/dictionary'
import { downLoadFile } from '@/utils/stream.js' import { downLoadFile } from '@/utils/stream.js'
import { deepClone } from '@/utils/index.js' import { deepClone } from '@/utils/index.js'
@ -509,7 +526,7 @@ export default {
let obj = { let obj = {
TrialId: this.$route.query.trialId, TrialId: this.$route.query.trialId,
TrialFileTypeId: this.Id, TrialFileTypeId: this.Id,
IsAuthorizedView: true, IsAuthorizedView: false,
TrialFileRecord: item, TrialFileRecord: item,
HistoryFileRecord: null, HistoryFileRecord: null,
Note: null, Note: null,
@ -536,7 +553,7 @@ export default {
upload(row, key) { upload(row, key) {
this.selectData = deepClone(row) this.selectData = deepClone(row)
this.update_config.title = `${this.$t( this.update_config.title = `${this.$t(
'trials:trialDocument:reportDoc:form:title:upload' 'trials:trialDocument:trainRecord:form:title:upload'
)} )}
- -
${this.isEN ? this.rowData.Name : this.rowData.NameCN}` ${this.isEN ? this.rowData.Name : this.rowData.NameCN}`
@ -548,7 +565,7 @@ export default {
handleAdd() { handleAdd() {
this.selectData = {} this.selectData = {}
this.update_config.title = `${this.$t( this.update_config.title = `${this.$t(
'trials:trialDocument:reportDoc:form:title:add' 'trials:trialDocument:trainRecord:form:title:add'
)} )}
- -
${this.isEN ? this.rowData.Name : this.rowData.NameCN}` ${this.isEN ? this.rowData.Name : this.rowData.NameCN}`
@ -560,7 +577,7 @@ export default {
handleEdit(row) { handleEdit(row) {
this.selectData = deepClone(row) this.selectData = deepClone(row)
this.update_config.title = `${this.$t( this.update_config.title = `${this.$t(
'trials:trialDocument:reportDoc:form:title:edit' 'trials:trialDocument:trainRecord:form:title:edit'
)} )}
- -
${this.isEN ? this.rowData.Name : this.rowData.NameCN}` ${this.isEN ? this.rowData.Name : this.rowData.NameCN}`
@ -639,7 +656,9 @@ export default {
arr.forEach((key) => { arr.forEach((key) => {
if (item[`${key}FileRecord`] && item[`${key}FileRecord`].FilePath) { if (item[`${key}FileRecord`] && item[`${key}FileRecord`].FilePath) {
let obj = { let obj = {
name: `${item[`${key}FileRecord`].FileName.substring( name: `${item.TrianingDate}_${item[
`${key}FileRecord`
].FileName.substring(
0, 0,
item[`${key}FileRecord`].FileName.lastIndexOf('.') item[`${key}FileRecord`].FileName.lastIndexOf('.')
)}__${new Date().getTime()}${item[ )}__${new Date().getTime()}${item[
@ -663,6 +682,13 @@ export default {
try { try {
let data = {} let data = {}
if (isArray) { if (isArray) {
let flag = this.selectTable.some((item) => !item.TrianingDate)
if (flag)
return this.$message.warning(
this.$t(
'trials:trialDocument:trainRecord:message:hsaNoTrianingDate'
)
)
data = { data = {
Ids: this.selectTable.map((item) => item.Id), Ids: this.selectTable.map((item) => item.Id),
IsAuthorizedView: true, IsAuthorizedView: true,
@ -674,7 +700,7 @@ export default {
} }
} }
this.loading = true this.loading = true
let res = await authorizedTTrialNormalRecord(data) let res = await authorizedTrialTrianingRecord(data)
this.loading = false this.loading = false
if (res.IsSuccess) { if (res.IsSuccess) {
this.$t('trials:trialDocument:trainRecord:message:authSuccessfully') this.$t('trials:trialDocument:trainRecord:message:authSuccessfully')
@ -701,7 +727,7 @@ export default {
) )
.then(() => { .then(() => {
this.loading = true this.loading = true
deleteTrialNormalRecord(row.Id) deleteTrialTrianingRecord(row.Id)
.then((res) => { .then((res) => {
this.loading = false this.loading = false
if (res.IsSuccess) { if (res.IsSuccess) {
@ -726,6 +752,9 @@ export default {
if (!this.Id) return false if (!this.Id) return false
this.searchData.TrialFileTypeId = this.Id this.searchData.TrialFileTypeId = this.Id
this.searchData.TrialId = this.$route.query.trialId this.searchData.TrialId = this.$route.query.trialId
if (this.viewStatus) {
this.searchData.IsAuthorizedView = true
}
if (this.TrianingDate && this.TrianingDate.length >= 2) { if (this.TrianingDate && this.TrianingDate.length >= 2) {
this.searchData.TrianingDateStartTime = this.TrianingDate[0] this.searchData.TrianingDateStartTime = this.TrianingDate[0]
this.searchData.TrianingDateEndTime = this.TrianingDate[1] this.searchData.TrianingDateEndTime = this.TrianingDate[1]