+
-
-
-
+
-
+ :specialColumnName="state.infoTableColumnsName"
+ :specialLocalColumnName="state.infoTableColumnsName+'_PQLogDetail'"
+ :searchFilter="state.infoSearchFilter"
+ :hideSearch="true"
+ >
@@ -51,7 +47,7 @@
import elTable from '@/components/elTable/index.vue'
import elPager from '@/components/elPager/index.vue'
import { getLogJsonList } from '@/api/system/customlog'
- import { downLoadJSONByString,getColoumsByServeName } from '@/utils/common/index'
+ import { downLoadJSONByString,getColoumsByServeName,getApiByServeName } from '@/utils/common/index'
import EnumList from '@/utils/common/enumList'
import { useRoute } from 'vue-router'
@@ -78,6 +74,9 @@
drawerShow:false,
infoTableData:null,
infoTableColumns:[],
+ // 查看详情内部colums的名称
+ infoTableColumnsName:null,
+ infoSearchFilter: {},
columnWidth:null,
infoType:null,
infoAllData:null,
@@ -93,46 +92,23 @@
// 查看详情
if(btn.name == 'showInfo'){
state.infoCurrentRow = scope.row
- // 应答格式:直接实体 state.infoType = 1
- let _arr1 = [
- '整车月度生产计划1','整车月度生产计划2','M+6月物料需求计划','日物料需求计划',
- '计划协议','采购订单','过焊装未过总装','过涂装未过总装','排序供货','看板配送单',
- '退货单','奇瑞RDC共享库存','日MRP状态监控','日MRP预警推移'
+ state.infoTableColumns = getColoumsByServeName(scope.row.taskName,'taskName',true)
+ state.infoTableColumnsName = getApiByServeName(scope.row.taskName,'taskName')
+ if(!state.infoTableColumnsName){
+ ElMessage.error(`不支持的任务名: ${scope.row.taskName}`)
+ return
+ }
+ state.infoSearchFilter = [
+ {
+ logic: "And",
+ column: 'Uid',
+ action: '==',
+ value: scope.row.uId
+ },
]
- // 应答格式:获取list字段 state.infoType = 2
- let _arr2 = [
- '来料检验数据','排产数据','供应商基础信息','人员资质信息','BOM主数据',
- '过程控制项质量数据','生产过程数据','产品一次合格率','工位一次合格率',
- '缺陷业务数据','物料主数据','附件类数据','工艺装备','工艺','供应商共享库存',
- 'M+6月物料需求计划风险确认','日物料需求计划风险确认','采购订单风险确认'
- ]
- state.loading = true
- getLogJsonList(scope.row.uId)
- .then(res=>{
- if(_arr1.indexOf(scope.row.taskName) >= 0){
- state.columnWidth = null
- state.infoType = 1
- state.infoTableData = [JSON.parse(res.message)]
- state.infoTableColumns = [
- {prop:'date',title:'date'},
- {prop:'pageSize',title:'pageSize'},
- {prop:'pageNum',title:'pageNum'},
- {prop:'isForce',title:'isForce'},
- ]
- }
- if(_arr2.indexOf(scope.row.taskName) >= 0){
- state.columnWidth = 120
- state.infoType = 2
- state.infoAllData = JSON.parse(res.message).list
- state.infoPager.total = state.infoAllData.length
- state.infoTableColumns = getColoumsByServeName(scope.row.taskName,'taskName',true)
- initInfoType2Pagedata()
- }
- nextTick(() => {
- state.drawerShow = true
- })
- })
- .finally(() => (state.loading = false))
+ nextTick(() => {
+ state.drawerShow = true
+ })
}
// 下载json
if(btn.name == 'downloadJSON'){
@@ -178,10 +154,16 @@
total: null,
}
}
+
+ // 单元格变色
+ function tableCellClassName(data){
+ if(data.row.type == '错误' && data.column.property == 'type'){return 'table-danger-row'}
+ else{return 'normal-tableRow'}
+ }
\ No newline at end of file
diff --git a/Web/src/views/task/taskSub/index.vue b/Web/src/views/task/taskSub/index.vue
index 958cc65..d6cdc6d 100644
--- a/Web/src/views/task/taskSub/index.vue
+++ b/Web/src/views/task/taskSub/index.vue
@@ -10,23 +10,28 @@
:leftOperation="state.leftOperation"
:rightOperation="state.rightOperation"
@rightOperationHadel="rightOperationHadel"
+ :tableCellClassName="tableCellClassName"
>
@@ -38,7 +43,7 @@
import { ElMessageBox, ElMessage,ElTable, ElTableColumn } from 'element-plus'
import { reactive, ref, onMounted,nextTick } from 'vue'
import tablePage from '@/components/tablePage/index.vue'
- import { getColoumsByServeName } from '@/utils/common/index'
+ import { getApiByServeName,getColoumsByServeName } from '@/utils/common/index'
import { getCanceltaskByUid } from '@/api/system/taskSubApi'
const state = reactive({
@@ -55,10 +60,12 @@
{label:'查看详情',name:'showInfo',link:true,type:'primary'}
],
drawerShow:false,
- // 查看详情内部table列数据
+ taskName:null,
+ // 查看详情内部colums
infoTableColumns:null,
- // 查看详情内部table查询条件
- infoSearchFilter: [],
+ // 查看详情内部colums的名称
+ infoTableColumnsName:null,
+ infoSearchFilter: {},
rightOperation:[],
})
@@ -76,15 +83,17 @@
// 撤销按钮隐藏/显示
function hideCanceltaskBtn(row){
let _arr = ['M+6月物料需求计划风险确认','日物料需求计划风险确认','采购订单风险确认']
- // 任务为风险确认,并且失败次数>0时显示
+ // 任务为风险确认,并且失败条数>0时显示
return !(_arr.indexOf(row.taskName) >= 0 && row.failedCount > 0)
}
function leftOperationHadel(btn,scope) {
// 查看详情
if(btn.name == 'showInfo'){
+ state.taskName = scope.row.taskName
state.infoTableColumns = getColoumsByServeName(scope.row.tableName,'tableName',true)
- if(!state.infoTableColumns){
+ state.infoTableColumnsName = getApiByServeName(scope.row.tableName,'tableName')
+ if(!state.infoTableColumnsName){
ElMessage.error(`不支持的表名: ${scope.row.tableName}`)
return
}
@@ -129,6 +138,12 @@
}
}
+ // 单元格变色
+ function tableCellClassName(data){
+ if(Number(data.row.failedCount) > 0 && data.column.property == 'failedCount'){return 'table-danger-row'}
+ else{return 'normal-tableRow'}
+ }
+
\ No newline at end of file