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

View File

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

View File

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