|
|
@@ -172,13 +172,14 @@
|
|
|
link
|
|
|
type="primary"
|
|
|
@click="openForm('update', scope.row.id)"
|
|
|
- v-hasPermi="['pressure2:dynamic-tb:update']"
|
|
|
- :disabled="scope.row.status == 200"
|
|
|
- >
|
|
|
+ >
|
|
|
+ <!-- :disabled="scope.row.status == 200"
|
|
|
+ > -->
|
|
|
编辑
|
|
|
</el-button>
|
|
|
<router-link :to="'/cybggl/dynamic-tb-col/'+scope.row.id">
|
|
|
- <el-button link type="primary" :disabled="scope.row.status == 200">数据</el-button>
|
|
|
+ <el-button link type="primary" >数据</el-button>
|
|
|
+ <!-- <el-button link type="primary" :disabled="scope.row.status == 200">数据</el-button> -->
|
|
|
</router-link>
|
|
|
<el-button
|
|
|
link
|
|
|
@@ -209,7 +210,6 @@
|
|
|
link
|
|
|
type="danger"
|
|
|
@click="handleDelete(scope.row.id)"
|
|
|
- v-hasPermi="['pressure2:dynamic-tb:delete']"
|
|
|
>
|
|
|
删除
|
|
|
</el-button>
|
|
|
@@ -258,6 +258,7 @@ import { dateFormatter } from '@/utils/formatTime'
|
|
|
import download from '@/utils/download'
|
|
|
import { DynamicTbApi, DynamicTbVO } from '@/api/pressure2/dynamictb'
|
|
|
import DynamicTbForm from './DynamicTbForm.vue'
|
|
|
+import { BoilerConnectRecordReportApi } from '@/api/pressure2/boilerconnectrecordreport'
|
|
|
|
|
|
|
|
|
/** 承压动态报表表单 列表 */
|
|
|
@@ -391,16 +392,34 @@ const handleShelvesSave = async () => {
|
|
|
|
|
|
// 下架
|
|
|
const handleUndercarriage = async (row) => {
|
|
|
- ElMessageBox.confirm('确定下架该报告模板吗?', '下架提示', {
|
|
|
- confirmButtonText: '确 认',
|
|
|
- cancelButtonText: '取 消'
|
|
|
- }).then(async () => {
|
|
|
- const res = await DynamicTbApi.updateStatus({id: row.id, status: 400})
|
|
|
- if(res) {
|
|
|
- ElMessage.success('下架成功')
|
|
|
- getList()
|
|
|
+ try {
|
|
|
+ const connectInfos = await BoilerConnectRecordReportApi.getByTemplateId({
|
|
|
+ templateId: row.id,
|
|
|
+ type: row.reportType === 100 ? 'record' : 'report'
|
|
|
+ })
|
|
|
+
|
|
|
+ if (connectInfos && connectInfos.length > 0) {
|
|
|
+ ElMessage.warning('该模板存在关联的检验项目,请先删除关联项目后再进行下架操作')
|
|
|
+ return
|
|
|
}
|
|
|
- })
|
|
|
+
|
|
|
+ ElMessageBox.confirm('确定下架该报告模板吗?', '下架提示', {
|
|
|
+ confirmButtonText: '确 认',
|
|
|
+ cancelButtonText: '取 消'
|
|
|
+ }).then(async () => {
|
|
|
+ try {
|
|
|
+ const res = await DynamicTbApi.updateStatus({id: row.id, status: 400})
|
|
|
+ if(res) {
|
|
|
+ ElMessage.success('下架成功')
|
|
|
+ getList()
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ ElMessage.error('下架失败:' + (error.message || '未知错误'))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } catch (error) {
|
|
|
+ ElMessage.error('查询关联项目失败:' + (error.message || '未知错误'))
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/** 初始化 **/
|